Skip to content

Publish the toolchain, and make the pack it installs runnable - #16

Merged
Mathieu2301 merged 1 commit into
mainfrom
mathieu/publish-packages
Sep 15, 2026
Merged

Mathieu2301 merged 1 commit into
mainfrom
mathieu/publish-packages

Conversation

@Mathieu2301

Copy link
Copy Markdown
Member

@miakapp/cli@4.0.0-alpha.0, @miakapp/component@4.0.0-alpha.0 and miakapi@4.0.0-alpha.0 are published. This PR is the repository state that produced them, plus the defect that publishing exposed.

Publication

package latest next
miakapi 3.0.31 (unchanged — V3 production) 4.0.0-alpha.0
@miakapp/cli 4.0.0-alpha.0
@miakapp/component 4.0.0-alpha.0

publishConfig.tag stays next on miakapi and drops to the default on the two scoped packages. A package whose only release is a prerelease and which carries no latest tag cannot be resolved by name, and npx @miakapp/cli is exactly what the pack tells a client to run.

Both scoped packages listed LICENSE in files and shipped without one. Added.

⚠️ npm 10.9.8 misreports the tag on the async publish path. The miakapi publish printed Publishing … with tag latest and returned PUT 202 + exit 0; the registry shows next → 4.0.0-alpha.0 with latest still 3.0.31, which is correct. The CLI notice is not authoritative on a 202 — only the packument is. Worth knowing before someone panics about a production tag.

The defect publishing exposed

Rehearsed in a fresh owner repository, against the published package: agent-pack writes an .mcp.json naming a bare miakapp binary. Nobody installed it, so the server never starts — the pack equips a repository with a tool that cannot run.

The original reasoning is in the code comment and it was sound: a name travels between machines, an absolute path does not. The conclusion did not survive contact. The entry now runs npx -y @miakapp/cli@<version> mcp — portable and self-installing — with the version pinned so the guide written beside it belongs to the release that answers.

That writes a version into someone else's repository, which turns the hand-kept CLI_VERSION literal from cosmetic into load-bearing. It moves to src/version.ts next to PACKAGE_NAME, with a test comparing both to the manifest. They cannot stay in main.ts, which imports agent-pack.ts.

The old test asserting the bare name is replaced, not deleted — same property (portability), an assertion that can now be satisfied.

Verification

End-to-end against the registry, not asserted: the .mcp.json this writes boots the published package over stdio and answers initialize with serverInfo.version 4.0.0-alpha.0.

Four negative controls, each red then reverted clean: bare binary name, drifted CLI_VERSION, drifted PACKAGE_NAME, absolute path leaked into the entry.

Bun 1.2.23 (the CI pin): root check 301 pass / 0 fail, check:packages green — cli 119, component 38, template 8.

Still open — the F gate does not close yet

Publishing was necessary, not sufficient. The same rehearsal found two more holes, both now unblocked:

  1. The installed guide says "Start from templates/home", and references packages/cli/README.md, templates/home/README.md, docs/rfcs/* and component-runtime/src/none of which exist in the owner's repository.
  2. miakapp init writes miakapp.yaml and nothing else, so there is no project to check.

templates/home is 9 files and 28 kB. Shipping it as a CLI asset and having init scaffold it — with the same byte-equality guard the guide asset already uses, minus the dependency block, which must move from file: to the published versions — closes both. That is the next unit.

`@miakapp/cli` and `@miakapp/component` were `private: true`, so the agent
pack pointed at a toolchain that did not exist anywhere an owner could
reach. Both are now publishable, and both carry the LICENSE their `files`
list already promised but never shipped.

`publishConfig.tag` drops to the default on the two scoped packages. It
said `next`, which is right for `miakapi` — that package has production
users on `latest` 3.0.31 and the V4 alpha must not displace them — and
wrong for a package whose only release is that alpha: with no `latest`
tag at all, `npx @miakapp/cli` resolves nothing.

The pack's MCP entry named a bare `miakapp` binary, reasoning that a name
travels between machines where an absolute path does not. The reasoning
holds; the conclusion did not survive a rehearsal in a fresh repository,
where the binary is simply absent and the server never starts. It now
runs `npx -y @miakapp/cli@<version> mcp`, which is equally portable and
brings its own tool. The version is pinned so the guide written beside it
is the guide of the release that answers.

That pins a version into someone else's repository, which makes the
hand-kept `CLI_VERSION` constant load-bearing rather than cosmetic, so it
moves into `src/version.ts` beside `PACKAGE_NAME` and a test compares
both to the manifest. The constants cannot live in `main.ts`: it imports
`agent-pack.ts`, which now needs them.

Verified against the registry rather than asserted: the `.mcp.json` this
writes boots the published package over stdio and answers `initialize`
with `serverInfo.version` 4.0.0-alpha.0. Four negative controls — bare
binary, drifted version, drifted name, leaked absolute path — each go red
and revert clean.
@Mathieu2301
Mathieu2301 merged commit 6af78ef into main Sep 15, 2026
1 check passed
@Mathieu2301
Mathieu2301 deleted the mathieu/publish-packages branch September 15, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant