Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,23 @@ jobs:
(cd "$dir" && npm pack --dry-run)
echo "::endgroup::"
done

# Packs every workspace package into a real tarball and installs them into
# an isolated fixture consumer, then typechecks and runs it. Inside the
# workspace every import resolves locally regardless of a package's
# `exports` map, so `bun test` and `npm pack --dry-run` above cannot catch
# a broken or missing published entry point β€” only a real tarball install
# fails the way a downstream consumer would.
consumer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.0
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run build
- name: Consumer check
run: bun run test:consumer
16 changes: 10 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Publish to npm

# Publishes on a per-package version tag (protocol-v0.12.0, platform-v0.17.4,
# Publishes on a per-package version tag (musicos-v0.1.0, partyos-v0.1.0, platform-v0.25.0,
# streaming-v0.1.0, transcoding-v0.3.0, …), so a release is a deliberate act rather
# than a side effect of merging, and releasing one workspace package never
# implies another. Failed tag jobs
# can be re-run from Actions without permitting a branch to publish a package.
on:
push:
tags: ["protocol-v*", "platform-v*", "streaming-v*", "transcoding-v*"]
tags: ["musicos-v*", "partyos-v*", "platform-v*", "streaming-v*", "transcoding-v*"]

concurrency:
group: publish-${{ github.ref }}
Expand Down Expand Up @@ -53,9 +53,13 @@ jobs:
run: |
TAG="${GITHUB_REF_NAME}"
case "$TAG" in
protocol-v*)
DIR="packages/protocol"
VERSION="${TAG#protocol-v}"
musicos-v*)
DIR="packages/musicos"
VERSION="${TAG#musicos-v}"
;;
partyos-v*)
DIR="packages/partyos"
VERSION="${TAG#partyos-v}"
;;
platform-v*)
DIR="packages/platform"
Expand All @@ -70,7 +74,7 @@ jobs:
VERSION="${TAG#transcoding-v}"
;;
*)
echo "::error::Tag '$TAG' does not match protocol-v*, platform-v*, streaming-v*, or transcoding-v*"
echo "::error::Tag '$TAG' does not match musicos-v*, partyos-v*, platform-v*, streaming-v*, or transcoding-v*"
exit 1
;;
esac
Expand Down
38 changes: 35 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,46 @@ extrapolate from other blockchains.

## Project Structure

This is a Bun workspace of publishable packages under `packages/*`:

- `packages/musicos` β€” `@misofm/musicos`, the works object model SDK (Composition,
Recording, Release, Track).
- `packages/partyos` β€” `@misofm/partyos`, the Party object model SDK (Party, admin cap,
group membership).
- `packages/platform` β€” `@misofm/platform`, everything Miso builds on top of the object
models (work and Party extensions, royalty primitives, Vault, Actions, product workflows).
- `packages/streaming`, `packages/transcoding` β€” the streaming transcode contract and
transcoder.

Within `packages/musicos`, `packages/partyos`, and `packages/platform`:

- `src/` β€” public TypeScript SDK, transaction builders, reads, and generated bindings
- `src/contracts/` β€” generated bindings; regenerate with `bun run codegen`
- `src/contracts/` β€” generated bindings; regenerate with `bun run codegen` at the repo root
- `tests/` β€” Bun unit and transaction-shape tests
- `sui-codegen.config.ts` β€” sibling Move package inputs for binding generation

At the repo root:

- `sui-codegen.config.ts` β€” the three generated trees' Move package inputs, and the source of
truth for which package lands in `packages/musicos/src/contracts/`,
`packages/partyos/src/contracts/`, or `packages/platform/src/contracts/`. See the "Expected checkout layout" comment there for
where this repo expects its sibling Move package checkouts to live β€” do not restate that
layout elsewhere.
- `scripts/codegen.ts` β€” the codegen runner that generates every tree.

## The object-model / platform boundary

> `@misofm/musicos` and `@misofm/partyos` are the object models. Everything Miso offers on top
> of them is platform.

When adding a feature, decide which package it belongs to using that rule, not convenience:
if it is intrinsic to a Composition/Recording/Release/Track, it belongs in `musicos`; if it is
intrinsic to a Party (identity, admin cap, membership), it belongs in `partyos`; if it is an
opinion Miso's product adds on top β€” including every `party_*` extension β€” it belongs in
`platform`.

## Project Rules

- Use `@mysten/sui` v2 APIs and gRPC/Core client patterns; do not add JSON-RPC.
- Do not hand-edit generated files under `src/contracts/`.
- Do not hand-edit generated files under any `packages/*/src/contracts/`.
- Keep PTB helpers composable: accept a `Transaction`, return results when useful, and do not execute.
- Run `bun run typecheck`, `bun test`, `bun run build`, and `bun run codegen:check` before handoff.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,35 @@ Monorepo for the Miso platform-layer TypeScript SDKs.

| Package | Description |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| [`packages/platform`](packages/platform/README.md) | `@misofm/platform` β€” the complete client SDK for the Miso platform layer: catalog/artist/wallet reads, record production and sale, and Vault custody/Actions/plugins. |
| [`packages/protocol`](packages/protocol/README.md) | `@misofm/protocol` β€” typed bindings, queries, event decoders, and PTB builders for the Miso protocol and Party package set. |
| [`packages/musicos`](packages/musicos/README.md) | `@misofm/musicos` β€” typed bindings, queries, event decoders, and PTB builders for the works object model (Composition, Recording, Release, Track). |
| [`packages/partyos`](packages/partyos/README.md) | `@misofm/partyos` β€” typed bindings, queries, and PTB builders for the Party object model (Party, admin cap, group membership). |
| [`packages/platform`](packages/platform/README.md) | `@misofm/platform` β€” the complete client SDK for the Miso platform layer: work and Party extensions, catalog/artist/wallet reads, record production and sale, and Vault custody/Actions/plugins. |
| [`packages/streaming`](packages/streaming/README.md) | `@misofm/streaming` β€” the `miso-hls/v1` streaming transcode contract (ladder, segment policy, Quilt item naming) plus a browser player entry point. |
| [`packages/transcoding`](packages/transcoding/README.md) | `@misofm/transcoding` β€” deterministic AAC-LC fMP4 HLS transcoder that produces and verifies the `miso-hls/v1` layout. Node only, FFmpeg required. |

This root `package.json` is private; each package under `packages/*` is
published independently. See each package's own README for install
instructions and API surface.

## The object-model / platform boundary

The three Sui packages split along one rule:

> `@misofm/musicos` and `@misofm/partyos` are the object models. Everything Miso
> offers on top of them is platform.

`@misofm/musicos` binds only the `musicos` Move package (Composition, Recording,
Release, Track) and `@misofm/partyos` only the `partyos` Move package (Party,
admin cap, group membership) β€” the permissionless object models anyone can
build on. Everything else Miso's own product adds on top β€” work and Party
extensions, royalty primitives, Vault, Actions, and every product-specific
workflow β€” ships from `@misofm/platform`. Generated bindings follow the same
split: `packages/musicos/src/contracts/` and `packages/partyos/src/contracts/`
hold only their object model, and `packages/platform/src/contracts/` holds
everything else. `sui-codegen.config.ts`
is the source of truth for exactly which Move package lands in which tree β€”
see its `packages` list rather than looking for an enumeration here.

## Development

This is a Bun workspace.
Expand Down
Loading
Loading