@inventarch/cli 3.5.1 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +2 -0
- package/README.md +2 -1
- package/SPEC.md +13 -4
- package/THIRD_PARTY_NOTICES.txt +49 -0
- package/assets/host/44dc1fa77e0235df35e1dd05d5a5ce8c2b19d4545caf0b8579f2f4e1b9efbbc6.tgz +0 -0
- package/assets/host.json +4 -4
- package/dist/args.d.ts +9 -0
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js.map +1 -1
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +53 -0
- package/dist/bin.js.map +1 -0
- package/dist/claude-cli.d.ts +13 -1
- package/dist/claude-cli.d.ts.map +1 -1
- package/dist/claude-cli.js +31 -1
- package/dist/claude-cli.js.map +1 -1
- package/dist/commands.d.ts +17 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +66 -3
- package/dist/commands.js.map +1 -1
- package/dist/committed-host.d.ts.map +1 -1
- package/dist/committed-host.js +14 -2
- package/dist/committed-host.js.map +1 -1
- package/dist/console/app.d.ts +47 -0
- package/dist/console/app.d.ts.map +1 -0
- package/dist/console/app.js +921 -0
- package/dist/console/app.js.map +1 -0
- package/dist/console/batch-next.d.ts +54 -0
- package/dist/console/batch-next.d.ts.map +1 -0
- package/dist/console/batch-next.js +260 -0
- package/dist/console/batch-next.js.map +1 -0
- package/dist/console/batch-plan.d.ts +109 -0
- package/dist/console/batch-plan.d.ts.map +1 -0
- package/dist/console/batch-plan.js +308 -0
- package/dist/console/batch-plan.js.map +1 -0
- package/dist/console/batch-run.d.ts +195 -0
- package/dist/console/batch-run.d.ts.map +1 -0
- package/dist/console/batch-run.js +868 -0
- package/dist/console/batch-run.js.map +1 -0
- package/dist/console/batch-screen.d.ts +36 -0
- package/dist/console/batch-screen.d.ts.map +1 -0
- package/dist/console/batch-screen.js +113 -0
- package/dist/console/batch-screen.js.map +1 -0
- package/dist/console/grid.d.ts +30 -0
- package/dist/console/grid.d.ts.map +1 -0
- package/dist/console/grid.js +87 -0
- package/dist/console/grid.js.map +1 -0
- package/dist/console/keys.d.ts +54 -0
- package/dist/console/keys.d.ts.map +1 -0
- package/dist/console/keys.js +204 -0
- package/dist/console/keys.js.map +1 -0
- package/dist/console/layout-all.d.ts +70 -0
- package/dist/console/layout-all.d.ts.map +1 -0
- package/dist/console/layout-all.js +401 -0
- package/dist/console/layout-all.js.map +1 -0
- package/dist/console/layout-repo.d.ts +65 -0
- package/dist/console/layout-repo.d.ts.map +1 -0
- package/dist/console/layout-repo.js +275 -0
- package/dist/console/layout-repo.js.map +1 -0
- package/dist/console/load.d.ts +33 -0
- package/dist/console/load.d.ts.map +1 -0
- package/dist/console/load.js +166 -0
- package/dist/console/load.js.map +1 -0
- package/dist/console/offers.d.ts +39 -0
- package/dist/console/offers.d.ts.map +1 -0
- package/dist/console/offers.js +285 -0
- package/dist/console/offers.js.map +1 -0
- package/dist/console/run.d.ts +56 -0
- package/dist/console/run.d.ts.map +1 -0
- package/dist/console/run.js +210 -0
- package/dist/console/run.js.map +1 -0
- package/dist/console/state.d.ts +127 -0
- package/dist/console/state.d.ts.map +1 -0
- package/dist/console/state.js +273 -0
- package/dist/console/state.js.map +1 -0
- package/dist/console/terminal.d.ts +60 -0
- package/dist/console/terminal.d.ts.map +1 -0
- package/dist/console/terminal.js +114 -0
- package/dist/console/terminal.js.map +1 -0
- package/dist/console/width-table.d.ts +10 -0
- package/dist/console/width-table.d.ts.map +1 -0
- package/dist/console/width-table.js +753 -0
- package/dist/console/width-table.js.map +1 -0
- package/dist/console/width.d.ts +18 -0
- package/dist/console/width.d.ts.map +1 -0
- package/dist/console/width.js +114 -0
- package/dist/console/width.js.map +1 -0
- package/dist/console/workspaces-state.d.ts +93 -0
- package/dist/console/workspaces-state.d.ts.map +1 -0
- package/dist/console/workspaces-state.js +192 -0
- package/dist/console/workspaces-state.js.map +1 -0
- package/dist/consumer.d.ts +13 -8
- package/dist/consumer.d.ts.map +1 -1
- package/dist/consumer.js +22 -34
- package/dist/consumer.js.map +1 -1
- package/dist/discovery.d.ts +8 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +36 -0
- package/dist/discovery.js.map +1 -0
- package/dist/distribute.d.ts +9 -0
- package/dist/distribute.d.ts.map +1 -1
- package/dist/distribute.js +70 -13
- package/dist/distribute.js.map +1 -1
- package/dist/doctor-authority.d.ts.map +1 -1
- package/dist/doctor-authority.js +7 -4
- package/dist/doctor-authority.js.map +1 -1
- package/dist/doctor-extensions.d.ts +36 -0
- package/dist/doctor-extensions.d.ts.map +1 -0
- package/dist/doctor-extensions.js +118 -0
- package/dist/doctor-extensions.js.map +1 -0
- package/dist/doctor-mounts.d.ts.map +1 -1
- package/dist/doctor-mounts.js +3 -2
- package/dist/doctor-mounts.js.map +1 -1
- package/dist/doctor-user.d.ts +64 -0
- package/dist/doctor-user.d.ts.map +1 -1
- package/dist/doctor-user.js +309 -34
- package/dist/doctor-user.js.map +1 -1
- package/dist/doctor.d.ts +22 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +81 -32
- package/dist/doctor.js.map +1 -1
- package/dist/fix.d.ts +67 -0
- package/dist/fix.d.ts.map +1 -0
- package/dist/fix.js +136 -0
- package/dist/fix.js.map +1 -0
- package/dist/handoff.d.ts +65 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +264 -0
- package/dist/handoff.js.map +1 -0
- package/dist/host-projection.d.ts.map +1 -1
- package/dist/host-projection.js +1 -8
- package/dist/host-projection.js.map +1 -1
- package/dist/host.d.ts +9 -3
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +23 -7
- package/dist/host.js.map +1 -1
- package/dist/init.d.ts +4 -6
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +80 -9
- package/dist/init.js.map +1 -1
- package/dist/local-cli.d.ts +67 -0
- package/dist/local-cli.d.ts.map +1 -0
- package/dist/local-cli.js +269 -0
- package/dist/local-cli.js.map +1 -0
- package/dist/main.d.ts +47 -3
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +121 -26
- package/dist/main.js.map +1 -1
- package/dist/marketplace-record.d.ts +7 -1
- package/dist/marketplace-record.d.ts.map +1 -1
- package/dist/marketplace-record.js +6 -3
- package/dist/marketplace-record.js.map +1 -1
- package/dist/package-manager.d.ts +43 -0
- package/dist/package-manager.d.ts.map +1 -0
- package/dist/package-manager.js +164 -0
- package/dist/package-manager.js.map +1 -0
- package/dist/position.d.ts.map +1 -1
- package/dist/position.js +16 -2
- package/dist/position.js.map +1 -1
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +11 -3
- package/dist/preview.js.map +1 -1
- package/dist/profile.d.ts +1 -1
- package/dist/profile.d.ts.map +1 -1
- package/dist/profile.js +3 -4
- package/dist/profile.js.map +1 -1
- package/dist/program.d.ts +10 -0
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +38 -1
- package/dist/program.js.map +1 -1
- package/dist/project.js +2 -2
- package/dist/project.js.map +1 -1
- package/dist/render.d.ts +7 -2
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +42 -3
- package/dist/render.js.map +1 -1
- package/dist/self.d.ts +6 -0
- package/dist/self.d.ts.map +1 -0
- package/dist/self.js +20 -0
- package/dist/self.js.map +1 -0
- package/dist/tracked-lock.d.ts +15 -0
- package/dist/tracked-lock.d.ts.map +1 -0
- package/dist/tracked-lock.js +37 -0
- package/dist/tracked-lock.js.map +1 -0
- package/dist/tracked.d.ts +125 -0
- package/dist/tracked.d.ts.map +1 -0
- package/dist/tracked.js +436 -0
- package/dist/tracked.js.map +1 -0
- package/dist/user-host.d.ts +7 -3
- package/dist/user-host.d.ts.map +1 -1
- package/dist/user-host.js +24 -11
- package/dist/user-host.js.map +1 -1
- package/dist/workspace-state.d.ts +15 -0
- package/dist/workspace-state.d.ts.map +1 -0
- package/dist/workspace-state.js +35 -0
- package/dist/workspace-state.js.map +1 -0
- package/dist/workspaces.d.ts +37 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +319 -0
- package/dist/workspaces.js.map +1 -0
- package/package.json +9 -8
- package/assets/host/e594fd978a0f8a9f042bf40ab124779067e1c88e4a72b7ce57261ca0e48a984c.tgz +0 -0
package/NOTICE
CHANGED
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ Each project keeps its own records in its own `.ia/` directory. The [main quick
|
|
|
40
40
|
|
|
41
41
|
## ⌨️ Commands
|
|
42
42
|
|
|
43
|
-
`ia --help` lists every command and `ia <command> --help` gives its full syntax. These rules hold across them:
|
|
43
|
+
Bare `ia` on an interactive terminal opens a console: the workspace's health by area, and the offers that fix or set it up, each showing the commands it runs and what they change before you confirm. Outside a workspace it opens on every workspace you track, where one offer can be batched across several, each in a new git worktree and branch, with nothing pushed unless you choose to. In a pipe or with `CI` set it prints help instead. `ia --help` lists every command and `ia <command> --help` gives its full syntax. These rules hold across them:
|
|
44
44
|
|
|
45
45
|
- **Plan, then apply.** `init`, `install`, `adopt`, `update`, `remove`, `project` and `host` print a plan and act only with `--apply`, which needs `--yes` without a terminal or with `--json`. A plan applies nothing, though acquiring for an install or update plan may fill the archive cache. `restore` has no preview, so it always takes `--apply`.
|
|
46
46
|
- **One next command.** Every consumer-command refusal names the one command to run next, on the `→` line or as `next` in the `--json` object `{version, ok: false, code, message, exit, where, next}`.
|
|
@@ -92,6 +92,7 @@ If the file changed since the preview, `ia author` refuses with `IA-CLI-EDIT-STA
|
|
|
92
92
|
| `ia read <locator>` | Prints the body behind a locator with its `sha256` and the line `body not certified by this read`. |
|
|
93
93
|
| `ia inspect [<identity>]` | Shows a workspace overview, or one record (by identity or `--path <file>`) with its edges, `--edges in\|out\|both` and `--depth` 0 to 3. |
|
|
94
94
|
| `ia vocabulary [<word>]` | Looks up the catalogue shipped with the package, with `--schema`, `--example`, `--domain`, `--kind` and `--search`. It opens no workspace. |
|
|
95
|
+
| `ia workspaces list\|add\|find\|remove` | Keeps your own list of the workspaces you keep current, in the IA home. `add [<directory>]` tracks one, `find <folder>` looks for them (and tracks them with `--apply`), `list` shows each with `present` or `missing`, and `remove <id\|directory>` drops one. `ia init --apply` offers to track the workspace it creates. The list is not the MCP server's. |
|
|
95
96
|
|
|
96
97
|
```sh
|
|
97
98
|
ia position
|
package/SPEC.md
CHANGED
|
@@ -26,7 +26,7 @@ Owner migrations and grants are explicit source changes followed by `ia validate
|
|
|
26
26
|
| --- | --- |
|
|
27
27
|
| `init [directory]` | Preview a workspace, or create it with `--apply`; `--host none` omits host registration and `--id <provider/name>` sets the package id (default `local/<directory name>`). `--from <plugin-directory>` lowers a Claude, Codex or Grok plugin into the new workspace as a kit, in place of `--system` (see [Host plugins](#host-plugins)). `--decline today` or `--decline forever` records that a repository should not be initialized, and `--forget-decline` removes that record. The target is positional, so `--root` is refused. The default starter (2026-10-09) is three records at placement authored (band 100) in `.ia/src/workspace.ia`, each with only the fields its schema declares: `@workspace <name>` (`composition.systems` naming every system the bundled base installs, `composition.sources [".ia/src @authored"]`, `composition.steward @agent <name>`), its participant `@agent <name>` ("The IDE agent operating in the <name> workspace, any vendor.", `governance.applies []`) and `@mandate <name>-mandate` (`governance.requires "Claim no host permission or execution from this mandate."`, `authority.participant @agent <name>`, `authority.moves [Observation, Verification, Synthesis, Delegation, Execution]`, `authority.scope [@workspace <name>]`). The record names are the workspace's; the package id's provider never prefixes them. With `--from` the starter is these three records plus the lowered kit: its `@system` and steward, its records, its resources and its assets, so it is no longer three records alone (see [Host plugins](#host-plugins)). `.ia/.gitignore` holding `work/` and `distributions/` is written only where none exists; an existing one is left as it is and reported, never a conflict. No local `@system` and no `@distribution` are written, so the release descriptor names no `distribution`. `--system`, for a repository that will own vocabulary, also writes `.ia/src/systems/<name>/system.ia` (the 1.x `@system <name>`, requiring `agent-system`, `work-system` and `workspace-system`, and its `@agent <name>-steward`) and `.ia/src/systems/<name>/records/distribution.ia` (`@distribution <name>-distribution` with `distribution.records [@system <name>]`), and the descriptor names that distribution, read from the compiled graph, so `pack` releases the system folder; its `@workspace` composes the local system after the base's (2026-10-09), so `composition.systems` ends with `@system <name>` and the position packet renders a pointer line for it. The apply runs install, author (create-only: a starter file already present with the same bytes is skipped), admission (zero error findings, and each starter record compiled at its path), descriptor (the completion point), then two effects reported apart: capture, the `capture` verb's own write of `.ia/work/snapshot/current.json` through the database, and, only with `--host`, project, the `host <host> --apply` path, whose projection `applyHostProjection` writes. An interruption before the descriptor names the rerun of `init`, which skips completed steps. Past the descriptor an effect that fails or is interrupted leaves every earlier result in place and says so, opening its next action with the sentence saying the workspace is initialized: a capture that fails is refused as `capture` refuses it, with its code, location and repair, then `capture --root <root>`, and without `--host` an interruption there names `capture --root <root>`. With `--host` the project effect runs after a capture that failed too, because the packet reads the live revision rather than the capture, and that capture refusal then says the projection is written; an interruption before the capture, or a host step that refuses, names `host <host> --root <root> --apply` (or `ia host`'s own remedy, rooted), saying whether the capture was taken. With `--json` the plan lists the steps `install`, `author`, `admission`, `descriptor`, `capture` and, with `--host`, `project`, and the starter's `system`, `paths`, `records` (each as `@<word> <name>`) and `ignore` (`{path, status}`, `create` or `present`); `applied` adds `distribution` (null without `--system`), `authored` (the starter records' identities in file order: three, six with `--system`, or three plus the lowered kit's with `--from`), `ignore` (`written` or `present`) and `effects`, `{capture: {revision, records}, project: {host, files, receipt} | 'skipped'}`, where `files` are the receipt's files with their SHA-256 and `receipt` is its path. The human report says the same: the records authored, the ignore file, the capture's records and revision, and the projected files and receipt or that project was skipped. `--migrate` (2026-10-09) rewrites a workspace a 1.1.0 `init` wrote (1.0 and 1.1 write the same starter) into this starter, keeping its descriptor's id. It takes `--system`, `--apply`, `--json` and `--yes`; `--id`, `--host` and the decline options with it are usage (exit 2). A 1.1.0 starter is one folder in `.ia/src/systems/`, its local system `<name>`, holding only `system.ia`, with exactly `@system <name>`, which registers no word, and `@agent <name>-steward`, and `records/*.ia`, of which `records/workspace.ia` holds exactly `@workspace <name>` and `@distribution <name>-distribution`, the distribution `.ia/release.json` names. The three records use fields only the base this CLI bundles declares (`composition.sources`, `composition.steward` and the `@mandate`'s `authority`), so a workspace whose installed `inventarch/language` is another archive has it replaced, which needs a lock holding that one base alone. Plan and apply run one preflight before anything is written: any other shape, a nested folder or another file or record included, and a base to replace in a lock that holds anything else, is refused as `IA-CLI-CONFLICT` (exit 3) naming `init --help`; a workspace that does not admit is refused as `IA-CLI-CONFLICT` naming `validate --root <root>`; with a host's projection state present, a pending host journal is refused with the journal's code, located at it, naming its recovery, `ia recover host`, `guard` or `lifecycle` with `--root <root>`, then the rerun; and each destination that already exists (`.ia/src/workspace.ia`, or `.ia/src/<file>.ia` for a moved file), each record the workspace keeps that holds the word and name of a starter record the migration authors anew (`@agent <name>` or `@mandate <name>-mandate`, which would tie with it), located at that record's file, and each host whose projection state exists and whose guard retirement or file plan the planners refuse, such as a file without a marker at a target path, is a conflict, as are edited starter or distribution text and a kept record that refers to a local identity the migration deletes (see [Migration recovery and portability](#migration-recovery-and-portability)). The plan lists the conflicts, the base install, every move, write and delete, the empty folders included, and each registered host's guard retirement and file actions, planned for the migrated records: every rendered file carries the workspace revision, which the migration changes, so none is `unchanged`. It is exit 0. `--apply` refuses a plan with conflicts and writes nothing: a destination or record collision as `IA-CLI-CONFLICT` naming `init <directory> --migrate`, whose plan lists each one; a projection conflict alone keeps the planner's code, located at its file, and names `host <host> --root <root>`, whose plan names each file it refuses. The apply first installs the bundled base where the plan says so, offline and as `init` installs it, while the records are still the 1.1.0 starter's, which the installer admits against it before activating it; an interruption there names the rerun of the migration, which installs the base again only if the bundled one is still not installed. It then moves every other `records/<file>.ia` byte for byte to `.ia/src/<file>.ia`, where its records keep their identities, since a record's word and not its folder decides its system; writes `.ia/src/workspace.ia` with the three starter records, keeping the 1.x `@workspace`'s name and `composition.systems` without the local system and adding `composition.sources` and `composition.steward`, and `.ia/.gitignore` where none exists, as [Migration recovery and portability](#migration-recovery-and-portability) qualifies; deletes `records/workspace.ia`, `system.ia` and the three folders they leave empty; and rewrites the descriptor without `distribution` and with the bundled base's dependency row, as `init` writes it, in place of the installed base's, keeping every other row. With `--system` it keeps `system.ia` as it is, writes `records/distribution.ia` as `init --system` does, rooted at `[@system <name>]`, composes the local system and keeps the descriptor's distribution, so `pack` still releases the folder; the descriptor is left byte for byte, whatever its formatting, when its base row is already the bundled base's. Admission then reads the starter identities and each moved file's, and the two effects follow: the capture, and for each host whose projection state exists its projection through `applyHostProjection`, which retires the 1.x steward guard and deletes the owned steward agent files. A file step that fails or is interrupted says that the migration is recorded in `.ia/migration.json` and that nothing was rolled back, and names the rerun of the migration, which resumes from the journal; a migrated workspace that fails admission names `validate --root <root>`, saying neither effect ran; an effect that fails or is interrupted leaves every earlier result in place, says so, and names the rerun of the migration, with host transaction recovery first when one is pending. With `--json` the plan holds `migrate` (`1.1.0`), `id`, `name`, `system`, `base` (`{id, installed, bundled}`, each `{version, archive}`), `conflicts` (`{path, reason}`, with `host` and `code` for a projection), `steps` (`install` first only when the base is replaced), `moves` (`{from, to, identities}`), `writes`, `records`, `systems`, `removes` (`{path, identities}` in delete order, a folder as `<path>/` with no identities), `ignore`, `descriptor` (`{path, before, after, dependencies: {before, after}}`) and `hosts` (`{host, guard, files}`), and `applied` is `{status: 'migrated', id, base: 'installed' | 'present', distribution, authored, moved, removed, ignore, effects: {capture, project: [{host, files, receipt, guard, removed}]}}`, `removed` being the plan's `removes` paths. |
|
|
28
28
|
| `validate [path...]` | Check the selected workspace records against language and declared contracts; report attributable diagnostics. A `composition.sources` entry that names no root, and a path selection that selects nothing, are each reported as an `IA-COMP-FIELD-VALUE` warning at the line that states it; admission does not change. These are the findings `ia-distribution validate` reports, from the same validation service. `--severity` sets the lowest severity reported and `--max-findings` the number rendered (default 50). `--verify-conformance` verifies COMP-KERNEL and COMP-FIXTURES in-process, as below. Execution bindings and checks are reported as below; a revoked binding or check exits 1 without being a finding. |
|
|
29
|
-
| `preview <word> [<name> [<field>=<value>...]]` | Show what one edit of the workspace's own records would compile to, and write nothing (2026-10-11; mode validate, move Verification). `ia preview <word> <name> [<field>=<value>...] [--at <path>]` drafts a new record (language `draftSource`, every value first judged by the strict `encodeValue`) and appends it to `--at` or `<first authored root>/<word>.ia`, the first root the repository's `@workspace` declares at authored placement inside `.ia/src`; `ia preview system <name>` is init's starter system at `.ia/src/systems/<name>/system.ia` and takes no field or `--at`; `--relate <owned> <spelling> <target>` adds one row to the record's `relationships` section; `--set <owned> <section.key>=<value>` sets one field, and `+=` adds one item to a list field, creating it when absent. A field is `<section>.<key>`, or a key one field of the schema alone has, and one given twice in either spelling is refused; the shell's split of a value is joined again with single spaces. Owned is a record at authored placement (band 100) whose file lies under an authored root of the repository's `@workspace`, inside `.ia/src` and outside the floor, named by canonical identity or `@word name`; `--at` is relative to the root and must lie under such a root, and is judged as the volume spells it: an existing part of it spelled otherwise (a case variant, an 8.3 short name) refuses, naming the volume's spelling, before the mandate profile or the ownership check reads it. The edit is language's (`appendRecord`, `addRelationship`, `setField`), spliced into the file as it is: other lines keep their bytes and line endings, a byte-order mark stays, and only the edited record is formatted. It compiles through db's draft overlay against one editor snapshot of the workspace and prints the record before and after, the base and candidate revisions, every record of the file with its digest before and after, the file's current sha256 (an absent file reads as empty), and the findings that count against the candidate: the edited or new record's own, and any the base does not hold, matched in the target file by code and record and elsewhere by code, path, line and message, so an error already in another record does not. The editor snapshot admits checks structurally, as `validate` admits them, and lists no evidence (2026-10-11; `AUTHORING` in `src/session.ts`): a `@check` naming one evaluator that is not built in is an owned record the edit forms can name and a new one drafts clean, a check naming none still counts against the candidate, and the base revision printed is the evidence-free one every strict reader reports. A record other than the target whose digest would change refuses the preview. `ia preview <word>` prints the word's lowering (kind, category, facets, primitive, move, artifact set), schema, default file and digest (for `system`, the per-system file), the consent rows that name it or that its own system's ledger can apply to it, and an example command. Exit 0 for a clean candidate and for word guidance, 1 for a candidate with errors. Refusals: a malformed form or an unknown relationship verb is usage (IA-CLI-USAGE, exit 2); an unknown word or field, a value of another type or carrying syntax, a field given twice, a duplicate row, item or record, a nested record, a system already in force (IA-CLI-EDIT-INVALID), no admitted record answering a name (IA-CLI-EDIT-MISSING), a record or path the workspace does not own (IA-CLI-EDIT-UNOWNED), a `@mandate` that binds the acting participant, before or after the edit (its participant is the actor, or it names none and its scope names the workspace or it claims paths), or whose authority the runtime cannot read, naming the governance position and saying a human or another participant makes that change (IA-CLI-EDIT-MANDATE; moves pool across the mandates that bind an actor), a row the two-sided consent rule refuses, naming the system whose ledger refuses it (IA-LANG-EDGE-UNCONSENTED), and the mandate profile's refusals (IA-RUNTIME-MANDATE-MOVE, -WORD, -ACTOR, and IA-RUNTIME-REQUEST-INVALID for a mandate authority the runtime cannot read) exit 1; another spelling of a path, an unsafe path (db's rule, and DEL, a C1 control, a line or paragraph separator or a bidirectional control, which the CLI refuses besides) or a link on the way (IA-DB-PATH-UNSAFE), an unreadable target (IA-DB-SOURCE-UNAVAILABLE), a target that changed while read (IA-DB-SOURCE-CHANGED), a path the draft overlay refuses (IA-DB-DRAFT-INVALID), and a workspace that does not open (as `ia validate` refuses it) exit 3. IA-CLI-EDIT-MANDATE retains its narrower preview rule. The writing command additionally reserves administrative words as described below; a preview is not authorization to write. A next command that would repeat a value holding shell syntax names the word's preview instead. |
|
|
29
|
+
| `preview <word> [<name> [<field>=<value>...]]` | Show what one edit of the workspace's own records would compile to, and write nothing (2026-10-11; mode validate, move Verification). `ia preview <word> <name> [<field>=<value>...] [--at <path>]` drafts a new record (language `draftSource`, every value first judged by the strict `encodeValue`) and appends it to `--at` or `<first authored root>/<word>.ia`, the first root the repository's `@workspace` declares at authored placement inside `.ia/src`; `ia preview system <name>` is init's starter system at `.ia/src/systems/<name>/system.ia` and takes no field or `--at`; `--relate <owned> <spelling> <target>` adds one row to the record's `relationships` section; `--set <owned> <section.key>=<value>` sets one field, and `+=` adds one item to a list field, creating it when absent. A field is `<section>.<key>`, or a key one field of the schema alone has, and one given twice in either spelling is refused; the shell's split of a value is joined again with single spaces. Owned is a record at authored placement (band 100) whose file lies under an authored root of the repository's `@workspace`, inside `.ia/src` and outside the floor (the longest declared root holding the file, which the repository's `@workspace` declares at authored placement; under a root several workspaces declare, db D02b `shared`, it owns the file as any one of the declarers, not only when its identity sorts first: 2026-11-04, inventarch/ia#194), named by canonical identity or `@word name`; `--at` is relative to the root and must lie under such a root, and is judged as the volume spells it: an existing part of it spelled otherwise (a case variant, an 8.3 short name) refuses, naming the volume's spelling, before the mandate profile or the ownership check reads it. The edit is language's (`appendRecord`, `addRelationship`, `setField`), spliced into the file as it is: other lines keep their bytes and line endings, a byte-order mark stays, and only the edited record is formatted. It compiles through db's draft overlay against one editor snapshot of the workspace and prints the record before and after, the base and candidate revisions, every record of the file with its digest before and after, the file's current sha256 (an absent file reads as empty), and the findings that count against the candidate: the edited or new record's own, and any the base does not hold, matched in the target file by code and record and elsewhere by code, path, line and message, so an error already in another record does not. The editor snapshot admits checks structurally, as `validate` admits them, and lists no evidence (2026-10-11; `AUTHORING` in `src/session.ts`): a `@check` naming one evaluator that is not built in is an owned record the edit forms can name and a new one drafts clean, a check naming none still counts against the candidate, and the base revision printed is the evidence-free one every strict reader reports. A record other than the target whose digest would change refuses the preview. `ia preview <word>` prints the word's lowering (kind, category, facets, primitive, move, artifact set), schema, default file and digest (for `system`, the per-system file), the consent rows that name it or that its own system's ledger can apply to it, and an example command. Exit 0 for a clean candidate and for word guidance, 1 for a candidate with errors. Refusals: a malformed form or an unknown relationship verb is usage (IA-CLI-USAGE, exit 2); an unknown word or field, a value of another type or carrying syntax, a field given twice, a duplicate row, item or record, a nested record, a system already in force (IA-CLI-EDIT-INVALID), no admitted record answering a name (IA-CLI-EDIT-MISSING), a record or path the workspace does not own (IA-CLI-EDIT-UNOWNED), a `@mandate` that binds the acting participant, before or after the edit (its participant is the actor, or it names none and its scope names the workspace or it claims paths), or whose authority the runtime cannot read, naming the governance position and saying a human or another participant makes that change (IA-CLI-EDIT-MANDATE; moves pool across the mandates that bind an actor), a row the two-sided consent rule refuses, naming the system whose ledger refuses it (IA-LANG-EDGE-UNCONSENTED), and the mandate profile's refusals (IA-RUNTIME-MANDATE-MOVE, -WORD, -ACTOR, and IA-RUNTIME-REQUEST-INVALID for a mandate authority the runtime cannot read) exit 1; another spelling of a path, an unsafe path (db's rule, and DEL, a C1 control, a line or paragraph separator or a bidirectional control, which the CLI refuses besides) or a link on the way (IA-DB-PATH-UNSAFE), an unreadable target (IA-DB-SOURCE-UNAVAILABLE), a target that changed while read (IA-DB-SOURCE-CHANGED), a path the draft overlay refuses (IA-DB-DRAFT-INVALID), and a workspace that does not open (as `ia validate` refuses it) exit 3. IA-CLI-EDIT-MANDATE retains its narrower preview rule. The writing command additionally reserves administrative words as described below; a preview is not authorization to write. A next command that would repeat a value holding shell syntax names the word's preview instead. |
|
|
30
30
|
| `author <word> <name> [<field>=<value>...] --digest <sha256>` | Write what the same `ia preview` form showed (2026-10-11; mode author, move Synthesis). Every preview form for a non-administrative record has an author form with the same arguments and `--digest <sha256>`, the target file's sha256 the preview printed (an absent file and an empty one read alike); the candidate is compiled again against one editor snapshot, opened as `preview` opens it (checks admitted structurally, no evidence listed), judged for the author mode, and written only when the file is still the one the digest names and the candidate is clean. The record written carries one attribution comment above it, `# authored-by @agent <participant> under @mandate <name> at <authored revision>`: the acting participant, the first governing mandate that binds it and grants Synthesis, and the workspace's authored revision (db `authoredRevision`) the candidate was compiled against; a second author replaces the comment rather than stacking one, and no capture membership records it. An existing file is read again through db's opened-handle reader just before the write and written by the distribution's `replace` (a temporary file and a rename, every component checked for links), keeping its permission bits; a new file by `createFile`, which refuses an entry that appeared since. `ia author` refuses administrative words as described below, including the system starter and its implicit agent. Every successful author names its next command (`ia validate`) judged by the profile that allowed it, as a refusal's next is: the governance position where the profile refuses that command, and a named actor carried as the participant it resolved. The output is the record written, the file's sha256 before and after, the authored revision and the revision of the workspace with what was written, the findings, and `ia validate` as the next command. Refusals are preview's for the same form, plus: a missing or malformed `--digest` (IA-CLI-USAGE, exit 2, naming the preview), judged after the profile and the candidate, so a mandate refusal comes first and the preview named is one the profile allows, else the governance position; a file that is not the one the digest names, or that changed, appeared or disappeared while authored (IA-CLI-EDIT-STALE, exit 1); a candidate with an error that counts against it (IA-CLI-EDIT-UNCLEAN, exit 1); a write the volume refuses (the distribution's IA-DIST code, or IA-CLI-FAILED for a raw volume error such as EPERM, exit 3, naming the repair and the preview). Each names the preview of the same form, and every refusal writes nothing. |
|
|
31
31
|
| `capture` | Admit the workspace and write its snapshot to `.ia/work/snapshot/current.json` in the `ia-snapshot-1` format: one JSON document with sorted keys and one final newline holding `format` (`ia-snapshot-1`), `language`, `kernelDigest`, `revision` (the full workspace revision), `authoredRevision` (the revision excluding runtime sources), `records` (the admitted records sorted by identity, each with its per-record `digest`), `membership` (one `{identity, root, band, digest}` capture membership row per record, sorted by identity), `diagnostics` (the admission findings and the warnings for declarations that declare nothing, below, ordered by path, line, code and message) and `counts` (`records`, `errors`, `warnings`, `notEvaluated`). Identical sources on one language version capture to identical bytes. The database writes the pair (db SPEC D08a), and every database handle seeds its previous snapshot from it, whatever its cache setting. `.ia/work/snapshot/previous.json` holds the most recent capture whose revision differs from the current one: a capture at a new revision renames the prior `current.json` there, byte for byte, and a capture at an unchanged revision keeps `previous.json` as it is while it holds a capture at another revision. With no readable prior capture (the first one, or a `current.json` that is not an `ia-snapshot-1` capture, which the capture names and replaces), a `previous.json` at another revision is kept as the most recent capture there is; a `previous.json` at the new revision, or one that is no capture, is removed once `current.json` is written. The new bytes are staged in a temporary file in the same directory before either file is replaced, a failed step undoes the ones before it so the pair stays as it was, and a `current.json` that already holds the capture's bytes is not rewritten. The capture writes only under `.ia/work/snapshot/`, creating it when needed, and never touches `.ia/src`. The snapshot is local working state that each clone captures for itself: `ia init` takes the first capture once it has initialized a workspace, so a snapshot exists from then on, and its `.ia/.gitignore`, written only where none exists, lists `work/`, which keeps the snapshot out of version control. Concurrent captures of one root are last-writer-wins. The effect is reported apart from validation: `records`, and how each record's digest compares with the prior capture's `current.json`, as `changed`, `unchanged`, `new` (no row in the prior capture) and `removed` (a row in the prior capture and none now), so `records` is `changed + unchanged + new` and two captures with no edit between them report 0 changed. The first capture has nothing to compare with, so every record is `new`. Admission findings in a source the workspace authors are written into the snapshot and counted, and never stop the write: a capture whose admission has errors still writes, marks its effect line with a warning symbol and exits 1, as `validate` does (warnings alone exit 0). Unresolved references, colliding identities, unconsented rows and every other registration or resolution finding (such as a keyword two adopted or installed systems both register) are such findings wherever they are. Two cases refuse before anything is written, so both files stay as they were: a floor or seed input (a source under `.ia/src/floor/`, an installed package's or an adopted mount's) that fails to parse, which is a syntax error the language's scanner or parser reports (such as `IA-LANG-HEADER-MALFORMED`), refuses with that finding's own code, located at it, exit 3, and names `ia validate`; a root whose own `.ia/src` declares no `@workspace`, admitted or refused, is no workspace to capture and refuses as `IA-DB-ROOT-INVALID` (exit 3), naming `ia init <root>`, or `ia validate` when its own sources have errors. A `composition.sources` entry that names no root, and a path selection that selects nothing (an absolute, `./` or `..` selection, below), are each written as an `IA-COMP-FIELD-VALUE` warning at the line that states it, as `validate` reports them; admission does not change. With `--json` the result is `{version: 1, snapshot, format, revision, digest, records, changed, unchanged, new, removed, prior, ignored, previous, rotated, admission}`: `snapshot` is the absolute path of `current.json` and `digest` the SHA-256 of its bytes; `prior` is the revision of the prior capture the counts compare with, or null; `ignored` says why an existing `current.json` was not taken as one, or is null; `previous` is `{path, revision}` of the retained `previous.json`, or null; `rotated` says whether this capture moved the prior `current.json` there; and `admission` is `{status, errors, warnings, notEvaluated}`. A link or junction on the snapshot path, an entry at `.ia/work` or `.ia/work/snapshot` that is not a directory, or an entry at either snapshot path that is not a regular file, refuses as `IA-DB-PATH-UNSAFE` (exit 3) before anything is written, located at the entry that is not a directory or not a regular file (a link or junction is named in the message, the refusal located at the snapshot directory), and names the repair and then `ia capture` for that root. A write the system refuses for a permission, a busy or read-only entry, or an entry of the wrong kind is `IA-CLI-FAILED` (exit 3), located at what to make writable and naming that and then `ia capture`; any other system error, such as a full disk or an I/O error, is not the path's to repair and takes the generic next below. On Windows a rename of, or onto, a read-only or open snapshot file names that file; otherwise, and on every platform for creating the staged file or the snapshot directory, it names the directory whose entries the write creates, renames or removes. `--preview` admits the workspace and refuses exactly as a capture does, both refusals above and the snapshot path checks included, then reports what the capture would write (db SPEC D08b) and writes nothing: it creates no directory, and `current.json` and `previous.json` keep their bytes and modification times, so the retained previous snapshot that readiness compares against is not rotated away. Its human output says it is a preview and that nothing has been written, prints the capture's counts, the snapshot's digest and size and the rotation the capture would make, names every changed, new and removed identity in full under a `Changed`, `New` or `Removed` heading (a heading with none is left out), each list sorted and each identity printed with each terminal control character (C0, DEL or C1) as visible escape text, never as the control (a removed identity is read from the `current.json` on disk; `--json` carries each as it is), and ends by naming `ia capture` with `--root` as given, or `ia validate` when admission has errors. Its exit class is the capture's: 1 when admission has errors, else 0. With `--json` it is the capture's result with `preview: true` after `version` and `identities` after `rotated`, `{version: 1, preview: true, snapshot, format, revision, digest, records, changed, unchanged, new, removed, prior, ignored, previous, rotated, identities, admission}`: the snapshot fields describe what the capture would write (`snapshot` and `digest` the file and the SHA-256 of the bytes it would hold, `previous` the `previous.json` it would retain, `rotated` whether it would move `current.json` there), and `identities` is `{changed, new, removed}`, the identities the three counts count, each sorted. A snapshot path refusal names the repair and then the same `ia capture --preview`; a preview writes nothing, so a system error it meets reading the pair is never named as a path to make writable and takes the generic next below. A capture without `--preview` writes and reports exactly as above, with no new key. |
|
|
32
32
|
| `compile` | Removed in 3.0. Every invocation, including `--help` and legacy options, refuses as `IA-CLI-USAGE` (exit 2) before workspace discovery or mandate evaluation and names the static `ia capture --help` command. It is absent from command help and the catalog, but its token remains core-reserved so an extension cannot revive it. Replace calls with `ia capture`; retain supported options and drop `--force`. The old `--out` and `--stdout` have no equivalent because capture writes a fixed snapshot. Published `@inventarch/cli/internal/compile` helper signatures remain available; the CLI no longer calls `runCompile`. |
|
|
@@ -35,8 +35,9 @@ Owner migrations and grants are explicit source changes followed by `ia validate
|
|
|
35
35
|
| `read <locator>` | Print the body behind a locator (runtime SPEC, body reader): text and its digest, never a certification. A locator is a record's full `system/kind/facet/name` identity; that identity with `#<phase>/<Primitive>` for the text of the record's cells at that address (a playbook's step) or `#<REQ-ID>` for one requirement's text; or `<path>:<line>`, the last colon splitting the path from a positive line, for the innermost admitted record whose source span holds that line of a workspace source. A cell or requirement locator reads that text, never a document. Otherwise a record whose word carries a source locator, and which states it, reads the document it names: `work.source` on `@spec`, `@plan`, `@milestone`, `@task` and `@decision`, `reference.document` on `@authoring-guide` and `template.resource` on `@template`. The path is read relative to the tree holding the record's source: the workspace root for the workspace's own `.ia/src`, a package's or an installed store's directory, and for an adopted mount the directory `.ia/workspace.json` binds it to, whose documents its revision pin does not cover. It is read through the workspace file reader `capture` uses, which refuses a path through a link or junction, a missing, non-regular or hard-linked file, a name that is not portable and a file over 4 MiB. A source locator `<path>#<anchor>` on a markdown file (`.md` or `.markdown`, in any case) reads only the section from the ATX heading whose anchor is `<anchor>` to the next heading of the same or a higher level, headings in fenced code ignored. The anchor is GitHub's for a plain-text heading (a repeated heading takes `-1`, `-2` and so on in document order, and a leading byte order mark is not part of the first heading); underscore emphasis, entity and character references, inline HTML and reference links are not rendered first, so such a heading may have another anchor on GitHub, and setext headings and headings in list items or block quotes are not read. Any other record reads its own body: its `meaning.says` (a `@system`'s head `describes`; a `@schema`, which states neither, has an empty body). Sections, fields and relationships stay in `inspect`. The output names `record` or `document` with the document's path, the SHA-256 of the body's UTF-8 bytes and the line `body not certified by this read`, the identity, locator and path printed with each terminal control character as visible escape text, then prints the body as read, byte for byte, terminal control characters included: the body is the source's own text, which `--json` carries as JSON escapes it; with `--json` it is `{version: 1, locator, identity, kind, path, digest, body, certified: false}`, where `locator` is the locator as given, `kind` is `record` or `document`, `path` is present for a document only and `digest` is the full SHA-256. A read opens the workspace without the db cache and writes nothing. A malformed locator refuses with `IA-CLI-USAGE` (exit 2) before anything is read and names `ia read --help`. The other refusals carry the runtime's codes: a locator no admitted record answers is `IA-RUNTIME-READ-UNADMITTED` (exit 1). For an identity a source holds whose record admission refused it reads `in this workspace's sources, but admission refused it` and names `ia validate`; for one no source holds it reads `not in this workspace's sources` and names the read of the nearest admitted identity when one is near, as `ia inspect` names the inspection, else `ia inspect` for the overview; for a line it names what the file holds: a source whose records admission refused names `ia validate`, a source whose admitted records span other lines names `ia inspect --path <file>`, and a file with no record of the workspace's sources names the overview. A cell or requirement the record lacks is `IA-RUNTIME-READ-FRAGMENT` (exit 1), naming `ia inspect <identity>`; a document path that names no file or is outside the workspace or the record's tree, a URL, which a read never fetches, a file the reader refuses or cannot find, bytes that are not UTF-8, an anchor on a file that is not markdown and an anchor no heading has are `IA-RUNTIME-READ-UNREACHABLE` (exit 3), naming `ia inspect <identity>`, which locates the record whose locator needs the repair (and the file to restore, when there is one); and a record at runtime placement (band 0) is `IA-RUNTIME-READ-PLACEMENT` (exit 3) unless `--include-runtime` is given, naming the same read with that flag. The workspace session this release opens admits no source at runtime placement, so through `ia read` the flag changes nothing yet. The `<path>` of `<path>:<line>` is relative to the workspace root, as every source path the toolchain names is; an absolute path inside the root is read as the root-relative path it names, by the rule `position --seat` reads a location with (runtime `rootRelative`): an in-root name that only begins with `..`, such as `..cache`, is inside the root, and the root itself reads as `.`, the workspace root, which is a directory and no source; any other path names no admitted record. These refusals name the `ia inspect` and `ia validate` commands above, which locate the record or the finding, rather than `ia scope --seat <qname> --shape context`. |
|
|
36
36
|
| `position` | Print the position body for a scope key: the runtime's `position` through the whole-workspace scope (runtime SPEC R14 to R17), as the consumer verb beside the frozen `ia scope` route, never a machine route. The key is K = (seat, shape, phase, depth, budget, word), with an optional primitive override, read from `--seat <id\|path>`, `--shape <H>`, `--phase <P>`, `--depth <d>`, `--budget <n>`, `--word <w>` and optional `--primitive <primitive>` only, so no request text reaches it: no flag is K0, the repository's `@workspace` at shape context, phase orient, depth 0 and budget 0, its pointers and tallies only; a key naming any part takes the runtime's defaults for the rest (context, the anchor phase of the explicit primitive or shape-derived primitive, depth 1, budget 16). A `--seat` that spells a canonical `system/kind/facet/name` identity is that record; any other is a location, a workspace-relative path or an absolute one inside the root, read by the rule `read` reads a line locator's path with (the root itself is the workspace root), and `./` makes a path spelled as an identity a location. A depth or budget of digits is that number; the closed sets and caps are the runtime's. The output is the seat with the body's revision; the key used, the capture's freshness (`current`, `stale` or `no-capture`: a position needs no capture; `stale` names `ia capture`, with `--root` as given, as the command that captures this revision), the body's digest and its counts; the loaded records, the pointers and their tallies past 48, the rules and playbooks that apply by word (a field match, not a row) with their tallies, the playbook cells, the blocking rules reserved outside the budget, the mandates, the frontier tallies and the unknowns, each record with its word, owner system, band, hop, how it was first reached and its owner system's steward; and the two widening keys as commands with `--root` as given: `ia position` one hop deeper, every part spelled (absent at depth 2), and the re-seat template `ia position --seat <identity> …` at depth 1 and budget 16, for any pointer or applies-by-word entry. `--word` restricts what loads, the pointers, their tallies and the frontier to records of that word, and never the reserved rules, the applies-by-word section, its cells or the mandates (runtime SPEC R15 and R17), so a word hides no blocking rule. Every string of the human output, what a source authored included (a cell's text, a finding's message, identities and paths), is printed with each terminal control character (C0, DEL or C1) as visible escape text, never as the control, as `ia next` prints its report; colour adds only the renderer's own styling. With `--json` it is `{version: 1, ok: true, body, digest, hostNote}`, the Door's `position` result byte for byte. A position exits 0, opens the workspace without the db cache and writes nothing. The refusals carry the runtime's code, `IA-RUNTIME-REQUEST-INVALID`, and its message, and each names one command, with `--root` as given where that command takes one: a shape, phase or primitive outside its closed set, or a depth or budget outside its cap, is refused before the workspace is read, at exit 2, naming this call again with the closed set (`<context\|governance\|execution\|sequence\|learning>` or `<orient\|plan\|act\|learn>`) or the cap (2 or 64) in that part's place; a word the closure does not register (exit 1, the message listing those it does) names `ia vocabulary`, which opens no workspace and so takes no `--root`; and a seat the workspace does not admit, a path outside it and a seat at runtime placement (exit 1, located at the workspace with a seat identity as identity) name `ia position`, K0, except a runtime-placed seat that is the repository's own `@workspace`, which names `ia inspect`. |
|
|
37
37
|
| `next` | Print one plan's delivery view (runtime SPEC R18), computed per read and never stored. The plan is the one `--seat` names: a `@plan`, or the plan a `@milestone`'s `work.plan` names, or that of a `@task`'s `work.milestone`; without `--seat`, the only `@plan` the workspace authors (band 100). The view is the runtime's `deliveryView` through the whole-workspace scope (runtime SPEC R18): the plan, its revision and a summary of how many tasks have exit evidence and which is next; its milestones, each satisfied or not with the reason (its own exit evidence, or every task's) and its status as self-declared; its tasks in one prerequisites-first order (a task follows the tasks and milestones it and its milestone require, ties by milestone, then task), each with its verdict line, `exit evidence recorded (<observation>, evaluator <evaluator>[, self-attributed | , self-attribution unknown])`, `no declared blocker` or `blocked (<basis>; …)`, its `work.status` printed as self-declared and never a basis, one `requires` line per effective prerequisite with its basis, and its five state lines (intent, definition, realizable, realized, worked); the review items with their owner; and, when a task has no declared blocker, the command the view names for it, `ia position --seat <task> --shape sequence`, with `--root` as given. Exit evidence is a success `@observation` on the task whose `subject-revision` is its current digest; a task's own status is never evidence, so a plan whose tasks are `closed` with no observation prints each `status closed (self-declared)` and a task that requires one `blocked (task <t>: no exit evidence)`, which is the honest answer. A relation row that carries a condition, such as `requires @task guide when phase is act`, counts only where it holds at the coordinate the scope binds, decided as graph traversal decides it (runtime SPEC R18): the record that states the row decides its provenance and artifact-set terms, and a severity term only where its own severity decides it at every coordinate, while a term on an axis the scope binds no value for, the phase on the whole-workspace scope `ia next` reads and the severity on every scope, leaves the row conditional with an unknown basis, never met; a row whose condition fails is no row. The Door's `next` decides a phase term through a token bound to a phase. With `--json` it is `{version: 1, ok: true, view}`, `view` being the Door's `next` result byte for byte. A view exits 0, whatever its verdicts and review items. The workspace opens without the db cache and nothing is written. The refusals carry the runtime's codes and messages at exit 1, located at the workspace with the seat as identity, and each names one command with `--root` as given: IA-RUNTIME-NEXT-SEAT for a seat the workspace does not admit names `ia validate` for a record admission refused, else, as `ia inspect` names the nearest admitted identity, `ia next --seat <nearest>` for the nearest admitted `@plan`, `@milestone` or `@task` when one is near, else the view without a seat, and for a record that is no `@plan`, `@milestone` or `@task` names `ia position --seat <seat>`, as the runtime does; the view without a seat is `ia next` when the workspace authors one `@plan` at band 100, `ia next --seat <the first>` when it authors several, and with none what IA-RUNTIME-NEXT-NO-PLAN names without a seat; IA-RUNTIME-NEXT-NO-PLAN names `ia validate` when admission refused a `@plan` a source holds (without a seat, any `@plan`; with one, the `@milestone` a `@task` seat's `work.milestone` names, or the `@plan` that `work.plan` names on its milestone or on a `@milestone` seat), else, without a seat in a workspace that registers `@plan`, `ia preview plan` where the acting participant's profile allows Verification and `@plan` (else the governance position), else the records to author, then `ia next` again with the seat given; IA-RUNTIME-NEXT-AMBIGUOUS, the plans listed in the message, names `ia next --seat <the first>`; and IA-RUNTIME-NEXT-CYCLE, the require rows listed in the message and the refusal located at the first, names `ia position --seat <record> --shape sequence` at the record the runtime names, the cycle's first task by milestone then task, else the first milestone a row requires. `ia next --help`, which the runtime's IA-RUNTIME-NEXT-NO-PLAN names to Door and MCP callers, says under `--seat` which records make a plan. It is the Door's `next` operation as a consumer verb, never a machine route. |
|
|
38
|
-
| `project <claude\|codex>` | With `--product plugin`, render the host plugin a lowered workspace describes instead (see [Host plugins](#host-plugins)); without it, `--out`, `--check` and `--compare` are usage (`IA-CLI-USAGE`, exit 2), refused before anything is read and naming the `--product plugin --check` form. Otherwise, plan, or with `--apply` write, the workspace projection alone (2026-10-09; runtime SPEC R19 and R20): the position packet of the admitted records rendered by the host's adapter for the consumer target, the files the workspace projection below describes. It plans by default, as `host` does, and the plan writes nothing, the IA home included: the packet's entry count (runtime R19's `entryCount`, 37 on a fresh init) and digest, the file plan (`create`, `update`, `unchanged`, `remove` for an owned and marked 1.x steward file, `foreign` for any other `.claude/agents/*.md` file, left in place) and the steward-guard retirement (`guard: 'retire'`), planned by the same `projectionElement` as `host`'s projection element. `--apply` plans again (`replanProjection`, shared with `host --apply`) with the rendering its gated plan session made, writes it through `applyHostProjection`, and prints the receipt: its files with their SHA-256, the legacy files removed, the foreign files and the retirement. A file changed since the plan still refuses, but a source or mandate change made while the confirmation question waits is not picked up, and `ia doctor` then reports the projection outdated. It registers no MCP server and creates no hook registration; once `host --apply` has registered the workspace's hooks, it keeps those groups in step with the authored `@hook` records, and without a registration it lists every `@hook` as not taken. It needs no capture, because the packet reads the live revision. With `--json` it prints `{version: 1, command: 'project', root, host, apply, plan: {entries, packetDigest, files, guard, hooks, unsupported, conflict}, applied?}`, `applied` being the receipt written; with a conflict `files` is empty and `guard` null, because the apply refuses it and so writes and retires nothing. A file without the generated marker at a path the adapter writes, an owned file or guard group changed by hand, or an ownership state that cannot be read makes a successful plan that names the file and its repair (`conflict: {code, path, reason}`), and `--apply` refuses it with that code, located at the file, before it asks anything or writes, naming the repair, then `ia project <host>`. A host other than `claude` or `codex` is `IA-CLI-USAGE` (exit 2) before anything is read, naming `ia project claude`, and a root without `.ia/
|
|
38
|
+
| `project <claude\|codex>` | With `--product plugin`, render the host plugin a lowered workspace describes instead (see [Host plugins](#host-plugins)); without it, `--out`, `--check` and `--compare` are usage (`IA-CLI-USAGE`, exit 2), refused before anything is read and naming the `--product plugin --check` form. Otherwise, plan, or with `--apply` write, the workspace projection alone (2026-10-09; runtime SPEC R19 and R20): the position packet of the admitted records rendered by the host's adapter for the consumer target, the files the workspace projection below describes. It plans by default, as `host` does, and the plan writes nothing, the IA home included: the packet's entry count (runtime R19's `entryCount`, 37 on a fresh init) and digest, the file plan (`create`, `update`, `unchanged`, `remove` for an owned and marked 1.x steward file, `foreign` for any other `.claude/agents/*.md` file, left in place) and the steward-guard retirement (`guard: 'retire'`), planned by the same `projectionElement` as `host`'s projection element. `--apply` plans again (`replanProjection`, shared with `host --apply`) with the rendering its gated plan session made, writes it through `applyHostProjection`, and prints the receipt: its files with their SHA-256, the legacy files removed, the foreign files and the retirement. A file changed since the plan still refuses, but a source or mandate change made while the confirmation question waits is not picked up, and `ia doctor` then reports the projection outdated. It registers no MCP server and creates no hook registration; once `host --apply` has registered the workspace's hooks, it keeps those groups in step with the authored `@hook` records, and without a registration it lists every `@hook` as not taken. It needs no capture, because the packet reads the live revision. With `--json` it prints `{version: 1, command: 'project', root, host, apply, plan: {entries, packetDigest, files, guard, hooks, unsupported, conflict}, applied?}`, `applied` being the receipt written; with a conflict `files` is empty and `guard` null, because the apply refuses it and so writes and retires nothing. A file without the generated marker at a path the adapter writes, an owned file or guard group changed by hand, or an ownership state that cannot be read makes a successful plan that names the file and its repair (`conflict: {code, path, reason}`), and `--apply` refuses it with that code, located at the file, before it asks anything or writes, naming the repair, then `ia project <host>`. A host other than `claude` or `codex` is `IA-CLI-USAGE` (exit 2) before anything is read, naming `ia project claude`, and a root without `.ia/src` is `IA-CLI-CONFLICT` naming `ia init` of the root as given; a release descriptor is not required, and a workspace that does not admit is refused naming `ia validate`. The same two guards, source presence then admission, apply to `ia host`, committed bootstrap included (`src/workspace-state.ts`). The `ia project`, `ia validate` and `ia init` commands a next action names carry the root as given; a pending host journal (`IA-DIST-RECOVERY-REQUIRED`, plan and apply) or a host lock held at apply (`IA-DIST-INSTALL-BUSY`) names its recovery, `ia recover host`, `guard` or `lifecycle` with `--root <root>`, using the resolved root, which recovery requires to be absolute, as `host` does, and a workspace whose sources cannot be opened names the resolved root, as every workspace verb does. |
|
|
39
39
|
| `vocabulary [word]` | Read the catalogue shipped with the package, including schemas (`--schema`) and worked examples (`--example`); `--domain`, `--kind` and `--search` filter it. No workspace is opened, so `--root` is refused. |
|
|
40
|
+
| `workspaces list\|add\|find\|remove` | Keep the tracked list in the IA home, `tracked-workspaces.json` (consumer CLI contract §2.16). `list` prints each row's id, state and root, `missing` when the root is gone or holds no `.ia/src`; every id, root and folder any action prints is escaped as visible text for each terminal control character before it is shortened; `add [directory]` tracks a workspace, by default the one holding the cwd, under `--id` or its default id; `find <folder>` walks to `--depth` (default 4, at most 8) and tracks what it found only with `--apply`; `remove <id\|directory>` drops one row. No workspace is opened, so `--root` is refused, and no catalog row is published: it is user state, not an agent command. It never reads or writes the MCP door's `workspace-locations.json`. |
|
|
40
41
|
|
|
41
42
|
Workspace discovery uses the nearest ancestor containing `.ia/src`, with `--root` selecting an explicit root where supported. Native syntax is `#! ia 1.0`. Initialization writes the three starter records, an ignore file and the release descriptor, installs the pinned bundled language base, `inventarch/language`, at the native version its content selected within the npm major, supplying the eleven public systems while retaining IA syntax 1.0, and captures the workspace; `--system` adds a consumer-local system and its distribution, and `--migrate` rewrites a 1.1.0 starter into this shape. A new consumer distribution starts at its own 0.1.0 version, independently of the CLI version.
|
|
42
43
|
|
|
@@ -83,6 +84,8 @@ The generated set (2026-10-11): `renderProjectionFor` holds the packet and works
|
|
|
83
84
|
|
|
84
85
|
`--help` and per-command help describe the accepted argument grammar. Consumer `--json` output is a single structured value without interactive prompts; applying without a terminal or with `--json` requires `--yes`. `--no-color` (or `NO_COLOR`), `--color`, `--ascii` and `--quiet` adjust human-readable output. Validation errors exit 1 (warnings alone exit 0), usage failures exit 2, unavailable inputs and local operational refusals exit 3, a remote registry or archive that `install`, `update` or `restore` cannot reach or read exits 4 (`IA-DIST-ARTIFACT-UNAVAILABLE`, or a remote `IA-DIST-LIMIT-EXCEEDED`), and interruption exits 130. Automation should inspect the structured diagnostic code and exit value together.
|
|
85
86
|
|
|
87
|
+
A command typed into an `ia` is handed to the workspace's own installed `@inventarch/cli` before it is parsed (consumer-cli-contract §1.2). `IA_NO_HANDOFF=1` turns hand-off off, so the `ia` that was typed answers, and the session hook sets it for every child it starts. `IA_HANDOFF_FROM` is set only by a copy that hands off, to its package root's real path, and any non-empty value stops the receiving copy from handing off again.
|
|
88
|
+
|
|
86
89
|
Every consumer refusal names one next command. With `--json` a refusal is `{version: 1, ok: false, code, message, exit, where, next}` and `next` is always a non-empty string; human output prints the same text on the `→` line, where the command it quotes is never broken across lines and runs past the line width when it must. The text quotes exactly one command and spells no other command or option outside it. That command is `ia …`, except that a recovery or a directory registry repair names `ia-distribution …`, the binary of `@inventarch/distribution`; a global install of `@inventarch/cli` does not put that binary on `PATH`, so such a command runs only where `@inventarch/distribution` is installed as well. The command carries the values this invocation supplied that it needs, such as the root (`ia init`'s `<directory>` included), the host, the package ids, the registry or catalog source, the descriptor or `--force`, so it runs from the directory the refused command ran in. Except where an unknown or interrupted command keeps the invocation as typed (below), a command that reruns the refused one repeats no output flag such as `--json` or `--quiet`, and one that runs the refused `ia install` or `ia update` again names its plan, without `--apply`: the plan applies nothing, although acquiring may fill the archive cache and `--plan-out` writes the plan file. A rerun of `ia restore`, which has no preview, carries `--apply --yes`; the rerun after deleting a cached archive drops `--offline`, so the archive is fetched again. A placeholder such as `<directory>`, `<path>`, `<file>` or `<url|dir>` stands only for the value the user has to correct or supply. A manual step the CLI cannot take, such as deleting or moving a named file, replacing a link under `.ia/src`, mapping a provider in `.ia/registries.json` or setting `IA_HOME`, may come first, and an explanation may follow. An unknown command names the nearest one with the rest of the invocation as typed, keeping only `--root` and `--params` for a machine operation. A workspace whose sources cannot be read (a link or alias under `.ia/src`, a source that changed during the read) names that repair and then `ia validate` with that root, which confirms the workspace opens. A service refusal that carries no next action of its own names the refused command's `--help` for a usage error, `ia validate` for a record finding (`IA-COMP-*`, `IA-GRAPH-*`, `IA-LANG-*`) and `ia doctor` for any other code, each with the root the invocation gave: its `--root`, or `ia init`'s `<directory>`. An interrupted command (`IA-CLI-INTERRUPTED`, exit 130) carries `next` in its JSON object and on its one stderr line: the rerun that finishes work already written, or otherwise the same invocation as typed, with any `--apply`, `--yes` and `--json` it was given. A file the invocation named that is not there (a `--descriptor`, `--catalog` or `--requests` file) names the same command with that one value as `<file>`. The machine protocol below is unchanged; its failures are the door's own one-line JSON and carry no `next`, so "every refusal names one next command" holds for the consumer commands. `@inventarch/cli/internal/consumer` keeps its 1.x forms: the `Refusal` constructor's `where` and `next` default to null, `refusalOf(error)` without the refused invocation returns a null `next` as before, and `renderRefusal` gives a refusal without a next action the fallback above, so `--json` `next` is always a string; every construction site in this CLI names its next action, which its tests enforce. `PlanRequest.reruns` in `@inventarch/cli/internal/distribute` is optional, and without it a plan's remedies are spelled from the request.
|
|
87
90
|
|
|
88
91
|
When a suggested root is omitted because it contains shell syntax, registry-consuming advice preserves the directory that a relative registry flag or inherited IA_REGISTRY selected from the original caller directory. The printed command uses a safe absolute spelling, or an equivalent safe relative spelling from the omitted root's destination. Explicit source-reselection remedies retain that intent; catalog and offline suggestions do not acquire an unused registry flag. Doctor has no registry flag, so a relocated doctor suggestion instead names its help and the exact original registry location to restore through the environment. If neither registry spelling is inert, the whole operation is likewise replaced by help and manual restoration guidance. Mere Windows separator normalization, an unchanged working directory, root-relative catalog/request/plan paths, actual parsed arguments, machine plan data and structured action argv keep their existing meaning.
|
|
@@ -116,6 +119,12 @@ Before any migration mutation, `migration-journal.ts` writes `.ia/migration.json
|
|
|
116
119
|
|
|
117
120
|
When a migration creates `.ia/.gitignore`, tracked distribution payload stays visible to Git: it omits `distributions/` when `.ia/distributions` is already tracked. It never removes files from Git's index and preserves an existing ignore file. Before mutation a tracked installation whose existing ignore rules would hide new generations is refused with the rule to repair; inability to verify Git state in a checkout also refuses. A tracked installation whose effective Git attributes, filters, encoding or CRLF configuration could rewrite immutable bytes is refused with a scoped `.gitattributes` remedy for `.ia/distributions/**` and `.ia/distributions.lock.json`; existing attributes and Git configuration are never rewritten.
|
|
118
121
|
|
|
122
|
+
`tracked.ts` owns the tracked list: its format, the atomic write through `writeHomeFile` that keeps unknown keys, every mutation held under the store lock of `tracked-lock.ts` (a wrapper over `@inventarch/distribution/home-lock`, the owner-stamped lock the update cache shares, whose lock file `ia` removes only when it published it, never another owner's, so a lock left by a killed process is deleted by hand), the default id, a row's state and the bounded folder walk.
|
|
123
|
+
|
|
124
|
+
`fix.ts` owns a doctor check's structured `fix` (consumer CLI contract §2.12): the flow derived from the parsed form under the grammar of the action it names (`CommandSpec.actions` and `flow`, which `workspaces.ts` also reads for the options each action owns), `iaFix` and `externalFix`, which build a remedy and its fix from one argv, `displayFix`, and the two forms a console runs, `previewArgv` and `confirmedArgv`. `package-manager.ts` builds the package-manager argv with an explicit directory flag when the manifest is not where the command runs. `doctor-extensions.ts` reads the checks an extension contributes through `Extension.console`: data only (areas, offers whose steps are the extension's own commands, and a state file under the IA home), confined to ids under its token, never replacing a core row; the public build declares no console. `workspaces.ts` is the `ia workspaces` handler over it, and `init.ts` calls it once `--apply` has initialized a target, to offer tracking (§2.16).
|
|
125
|
+
|
|
126
|
+
`console/` is bare `ia`'s console (consumer CLI contract §1.2 and §6), built on Node built-ins only. [`width.ts`](src/console/width.ts) is the one display-width function: grapheme clusters from `Intl.Segmenter`, widths from [`width-table.ts`](src/console/width-table.ts), which [`tools/unicode/generate-width-table.mjs`](../../tools/unicode/generate-width-table.mjs) generates from vendored Unicode 16.0.0 data (its notice ships as `THIRD_PARTY_NOTICES.txt`); `render.ts` wraps by it too, and `workspaces.ts` sizes its tables by it. [`grid.ts`](src/console/grid.ts) is the cell frame, the one place untrusted text meets the terminal, and [`terminal.ts`](src/console/terminal.ts) the alternate-screen session that writes changed rows, takes each piece of terminal state (alternate screen, hidden cursor, bracketed paste, raw mode) transactionally and gives back exactly what it holds. `app.ts` owns the one teardown: quit, a throw, an output failure, crash handlers, `SIGINT`/`SIGTERM`/`SIGHUP`/`SIGBREAK` (128 plus the signal number) and a synchronous `exit` handler, all removed when the console ends; it runs one offer at a time, drops keys decoded after a run starts or a quit, and lets go of stdin before a child starts. `keys.ts` treats a bracketed paste as text, never as keys, and discards one over `PASTE_LIMIT` (65,536 UTF-16 code units) or still open when the escape timer fires, up to its end marker, reading only Ctrl-C after such a timeout. `run.ts` shows each argument as written, or as a JSON string literal when it holds a control character or a lone surrogate, starts with a quote or is empty (`shownArgument`), and quotes `.cmd` arguments by the Windows argv rules, refusing `%`, any double quote and C0 control characters (`cmdArgument`); `main.ts`'s `consoleTerminal` falls back to a terminal stderr for the synchronous restoration once stdout has failed. [`keys.ts`](src/console/keys.ts) is a buffered key decoder with a text-entry mode. [`state.ts`](src/console/state.ts) splits doctor's rows by copy (`RUNNING_ROWS` and extension rows from the running copy, every other row from the workspace's copy), reads a repo copy's `doctor --json` run, and groups rows into areas through `AREA_TABLE`, which is data: an id it does not name lands in Other. [`load.ts`](src/console/load.ts) is the effectful loader with doctor collection injected; a doctor child past its bound, or aborted, gets SIGTERM and, still running `DOCTOR_KILL_GRACE_MS` (2 s) later, SIGKILL; it and `app.ts`'s `resolveRepo` take the workspace's copy from `handoff.ts`'s `runnableCopy`, the rule hand-off applies, so a committed copy or one under the user's `IA_NO_HANDOFF=1` is never run (`committed` fails closed: when git exits non-zero, times out or cannot be started and a `.git` exists at or above the copy, the copy counts as committed; its git runs without the caller's `GIT_*` routing variables, `program.ts`'s `withoutGitRouting`, which `batchEnv` shares; without a `.git` above, nothing is tracked), and every step and batch run in the all-workspaces view resolves its copy the same way. [`offers.ts`](src/console/offers.ts) derives every offer from state: one per row with a fix, register a host, add a kit, track this workspace, the upgrade recipe, Diagnostics, Check for updates now and an extension's declared offers. [`layout-repo.ts`](src/console/layout-repo.ts) draws the single-repo view; [`run.ts`](src/console/run.ts) runs an offer's steps by their flows, resolving each step's copy from the disk at that step; [`app.ts`](src/console/app.ts) is the event loop; outside a workspace it lands on the all-workspaces view, and tab switches views. [`workspaces-state.ts`](src/console/workspaces-state.ts) loads every tracked workspace through `load.ts` in a `doctorPool` of four slots, which a refresh of an opened workspace shares, each run bounded at 30 s and aborted on quit, and classifies each row from its own checks' statuses, never its offers; [`layout-all.ts`](src/console/layout-all.ts) draws that view. A batch is planned by [`batch-plan.ts`](src/console/batch-plan.ts), which is pure: the batchable offers on a selection, the branch (`chore/<offer>`) and worktree of each repository, the user and machine steps left for afterwards, and every path-bearing argument rebuilt for the worktree, read from the grammar's `path` marks on options (`always`, or `maybe` for a value that is a URL or an id unless spelled as a path) and positionals, with any other absolute or `..` token examined too; one that leads outside the worktree refuses the repository. [`batch-run.ts`](src/console/batch-run.ts) runs it through an injected runner: the git metadata operations it lists (`METADATA_OPS`) are the only commands that name the user's checkout; the worktree is added with `--no-track`; the install is built for the worktree, frozen to a tracked lockfile and without lifecycle scripts, unless the offer's first step is itself the package manager's install or the CLI pin (`installsDependencies`), which then installs, with the manager the base locks or else the repository is refused; the worktree path's real destination, fixed before anything is awaited, must lie outside the repository, every other repository of the batch and the IA home and is judged again immediately before `git worktree add`; a failed add is undone by `undoAdd`, which removes the worktree and deletes the branch only when `git worktree list --porcelain` shows that path on that branch at the base's commit, and names whatever it leaves; the created worktree is pinned (`pinWorktree`: real path, device and inode) and `checkPinned` verifies it before every later command, here and in `batch-next.ts`; `containedStep` checks the real filesystem before the install and before every step; the real path of an `ia` step's entry must lie inside the worktree (or be the running copy's own); `programIn` is the one rule for every program started (git and `gh` found once per batch, the package manager, a step's program), refusing one whose real path is inside the repository and keeping its canonical real path; every child, in this module and in `batch-next.ts`, starts through `spawnGuarded` (or `spawnGuardedSync` for the probes, which routes a `.cmd` through cmd.exe with `cmdArgument`), which immediately before each spawn checks the program's real path against its canonical path and the checkouts (and refuses a `.cmd` or `.bat` whose real path holds `%`), checks the pinned worktree when the cwd or an argument lies in it, and gives the child `programEnv(batchEnv(env))` with only the PATH entries that lead into no repository of the batch (`childEnv`, falling back to `/usr/bin:/bin` outside Windows when none is left); `batchEnv` drops git's repository-local variables (`GIT_LOCAL_ENV`), `GIT_ASKPASS` and `SSH_ASKPASS` from every child and sets `GIT_TERMINAL_PROMPT=0`, `GCM_INTERACTIVE=never`, `SSH_ASKPASS_REQUIRE=never` and an empty `core.askPass` through `GIT_CONFIG_COUNT` (`NO_PROMPT`); `withoutSshPrompt` adds `GIT_SSH_COMMAND='ssh -o BatchMode=yes'` unless the user names an ssh of their own, and fails closed when its `core.sshCommand` probe cannot run; outside Windows every runner child starts in a session and process group of its own (`detached`), with no controlling terminal, is started with the link it was found through as `argv0` (`Program`), is killed with its group (on Windows `taskkill /T`) at `BATCH_COMMAND_TIMEOUT_MS`, gets SIGINT when the run's abort signal fires, and is killed by a process `exit` listener, which a SIGKILL or a hard crash never runs; `planBatch` takes `gitTop` and `enclosingTop`, which names the work tree around the folder above a repository, null only on git's plain "not a git repository", and a refusal whenever git cannot say; while git still runs with the user's own configuration and hooks (global, system and `includeIf`), which the batch does not constrain: the checkout guarantee covers what the batch runs, not those hooks; and an `ia` step runs on the copy the worktree has at that step. [`batch-next.ts`](src/console/batch-next.ts) holds the choices after a run (commit as `chore: <title>`, push create-only (an empty-lease `--force-with-lease` with `--porcelain`, accepting only a new ref, so a branch already on origin at any commit is a collision) and open PRs through `gh` only after `gh auth status` exits 0, remove the worktrees and keep the branches), and [`batch-screen.ts`](src/console/batch-screen.ts) shows the preview, the progress, the results and those choices in the normal screen. `main.ts`'s `opensConsole` and `enter` decide console or help before dispatch.
|
|
127
|
+
|
|
119
128
|
`bundled-base.ts` is the shared exact archive reader for init and restore. Restore can acquire the CLI's bundled base without network or a prepopulated cache when the lock matches its package identity, version, archive digest and manifest digest. The reader verifies archive bytes and embedded manifest before caching. Existing corrupt immutable cache content and locked manifest/version mismatches refuse. Other archives keep the existing acquisition rules. An exact unpublished bundled pin is exempt from registry lookup through the existing cached-unpublished rule, online and offline alike.
|
|
120
129
|
|
|
121
130
|
An already-initialized init target names `ia position --root <directory>` in the plan's text and JSON `next` and the apply refusal; a missing authored workspace asks for restoring that file from source control first. The catalog describes the already-initialized refusal and names `ia position --root <directory>`; conflicting files still use init's plan and repair.
|
|
@@ -144,7 +153,7 @@ When validation cannot record evidence because a directory ancestor is a link or
|
|
|
144
153
|
|
|
145
154
|
Knowledge integration: the [consumer CLI contract](../../docs/specs/consumer-cli-contract/README.md#knowledge-commands) defines nested `ia kb` grammar, mandate modes, preview/apply and immutable output behavior. Its adapters consume `@inventarch/kb`; native `ia pack` and the nine machine routes keep their existing meanings.
|
|
146
155
|
|
|
147
|
-
Committed bootstrap (2026-10-30): `ia host <claude|codex|copilot> --commit [--remove] [--apply] [--actor <agent>] [--json] [--yes]` (`src/committed-host.ts`) plans or applies apps/distribution's `planBootstrap` for the CLI's own version, in
|
|
156
|
+
Committed bootstrap (2026-10-30): `ia host <claude|codex|copilot> --commit [--remove] [--apply] [--actor <agent>] [--json] [--yes]` (`src/committed-host.ts`) plans or applies apps/distribution's `planBootstrap` for the CLI's own version, in a workspace that has `.ia/src` and admits (`--remove` reads no record, so it also runs on one that does not); no release descriptor is needed. The plan writes nothing and lists each file with its kind (`instructions` or `mcp`) and action; `--json` is `{version: 1, command: 'host', host, mode: 'commit', remove, door, files, applied}`. `--apply` is the effect mode under the participant's mandate profile, judged on an opened session before the confirmation, and asks `Write this committed bootstrap? [y/N]` unless `--yes`; `--remove` is not judged. A refusal keeps the mechanism's code, located at the root, naming the repair and the rerun. `--commit` conflicts with `--user` and `--context`, and a host without a bootstrap row is usage. `ia host copilot` without `--commit` refuses `IA-DIST-HOST-UNSUPPORTED` naming `ia host copilot --commit`. The machine-local notes of `ia host claude` and `ia host codex` now end by naming the bootstrap to commit instead. The position packet's SPEC lines gain the session line (runtime R19), so every rendered entry file names `ia_session`, the lanes, `ia_catalogue` and `ia_method`. `tests/host-commit.test.ts` plans, applies and removes the Copilot bootstrap over `ia init`, with no workspace or IA home path in any file, and pins the refusals.
|
|
148
157
|
|
|
149
158
|
npm packages of kits (2026-10-31, contract C7b, ia-kb `dec-133`): `install --package <name>[@<version>]` (`src/kits-package.ts`, the Execution-gated `install` route, excluding positionals, `--requests`, `--registry` and `--catalog`) records one `package` entry in `.ia/distributions.lock.json` (db lock engine 0.1.2) and installs the kits it carries as ordinary releases. `npm view <name>@<version> --json` (`latest` by default) gives the exact version, `dist.integrity` and `ia.kits` (`{id, version, archive, manifest}`); the tarball is read from npm's content-addressed cache, `<npm cache>/_cacache/content-v2/sha512/<h[0:2]>/<h[2:4]>/<h[4:]>` with `h` the hex of the integrity's SHA-512 and `<npm cache>` `npm_config_cache`, else `npm config get cache`, else npm's default, and must hash to the integrity; when it is not there and the run is not `--offline`, `npm cache add <name>@<version>` puts it there. Each kit's `archives/<archive>.ia.tgz` is verified against its archive and manifest digests, id and version and cached in the workspace; the entry records the manifest's dependency ids; the plan is the installer's (`install`, or `update` with a lock). `--offline` installs only the version the lock records. `restore` first refetches a package entry's archives the workspace cache lacks the same way, offline from npm's cache. An unavailable package refuses `IA-CLI-KITS-PACKAGE-UNAVAILABLE`, an offline miss `IA-DIST-RESTORE-REQUIRED`, a tarball that does not hash to its integrity `IA-DIST-INTEGRITY-MISMATCH`. `IA_NPM` names a Node script run instead of `npm`, for tests only (`tests/fake-npm.mjs`). `host --commit` writes only the instruction block and the door entry, as before. `tests/install-package.test.ts` installs and restores the stand-in package in `tests/fixtures/kits-package`, whose archive `generate.mjs` packs with `ia pack`.
|
|
150
159
|
|
|
@@ -152,6 +161,6 @@ Required verification (2026-10-31, contract C7): `validate --verify-conformance
|
|
|
152
161
|
|
|
153
162
|
C′ skills (2026-10-30): the generated set's skills are workspace-runtime's capability skills, one per invocable `@capability`, never one per `@playbook`; a skill refused at a folder that holds the user's files names renaming the `@capability` that renders it. The receipt check accepts the generated words `agent-profile`, `capability` and `playbook`. `tests/host-generated.test.ts` and `tests/host-projection.test.ts` make the composition fixture's capability invocable under the playbook's name, so its one skill keeps its path.
|
|
154
163
|
|
|
155
|
-
User-level plugin from the public marketplace (2026-10-30, kit discovery decision 5): `ia host claude --user --apply` runs `claude plugin marketplace add inventarch/marketplace` and `claude plugin
|
|
164
|
+
User-level plugin from the public marketplace (2026-10-30, kit discovery decision 5): `ia host claude --user --apply` runs `claude plugin marketplace add inventarch/marketplace`, `claude plugin install ia@inventarch --scope user`, `claude plugin marketplace update inventarch` and `claude plugin update ia@inventarch --scope user --json` (so a rerun takes the catalogue's current release, which needs the network, and an update Claude reports it held back refuses as `IA-CLI-HOST-COMMAND-FAILED`), renders nothing, and records the install in `<IA home>/claude/marketplace-install.json` once `install` exits 0; the workspace plan's user-plugin check accepts that record or a rendered plugin. `--local` (which needs `--user` and conflicts with `--context` and `--commit`) keeps the rendered plugin in `<IA home>/claude/marketplace`, registered from that directory, and its reruns name `--local`. `--json` adds `plan.source` (`marketplace` or `local`); a removal runs the same Claude removal commands and deletes the rendered plugin and the record.
|
|
156
165
|
|
|
157
166
|
Doctor and the marketplace install (2026-10-30): `src/marketplace-record.ts` owns `<IA home>/claude/marketplace-install.json` (`{marketplace, plugin, cli}`), which `ia host claude --user --apply` writes and `--remove` deletes. With no rendered plugin, `ia doctor`'s `plugin-claude` row reads it: `ok` with `<plugin>, installed from <marketplace>; registration with Claude is not checked` when `cli` is this ia, `warn` naming the ia that installed it otherwise, and `warn` naming the record and why when it cannot be read, each `warn` with the remedy `ia host claude --user --apply`. The facts give the briefing the installing ia, so its stale-plugin notice and next action cover a marketplace install as they cover a rendered one. `tests/user-host.test.ts` pins the three rows and the notice.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Third-party notices for @inventarch/cli
|
|
2
|
+
|
|
3
|
+
dist/console/width-table.js is derived from the Unicode Character Database, version 16.0.0
|
|
4
|
+
(https://www.unicode.org/Public/16.0.0/ucd/): EastAsianWidth.txt, emoji/emoji-data.txt and
|
|
5
|
+
extracted/DerivedGeneralCategory.txt, generated by tools/unicode/generate-width-table.mjs in the
|
|
6
|
+
source repository. Those data files are distributed under the Unicode License v3, whose
|
|
7
|
+
copyright and permission notice follows.
|
|
8
|
+
|
|
9
|
+
--------------------------------------------------------------------------------
|
|
10
|
+
|
|
11
|
+
UNICODE LICENSE V3
|
|
12
|
+
|
|
13
|
+
COPYRIGHT AND PERMISSION NOTICE
|
|
14
|
+
|
|
15
|
+
Copyright © 1991-2026 Unicode, Inc.
|
|
16
|
+
|
|
17
|
+
NOTICE TO USER: Carefully read the following legal agreement. BY
|
|
18
|
+
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
|
|
19
|
+
SOFTWARE, YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE
|
|
20
|
+
TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU DO NOT AGREE, DO NOT
|
|
21
|
+
DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES OR SOFTWARE.
|
|
22
|
+
|
|
23
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
24
|
+
copy of data files and any associated documentation (the "Data Files") or
|
|
25
|
+
software and any associated documentation (the "Software") to deal in the
|
|
26
|
+
Data Files or Software without restriction, including without limitation
|
|
27
|
+
the rights to use, copy, modify, merge, publish, distribute, and/or sell
|
|
28
|
+
copies of the Data Files or Software, and to permit persons to whom the
|
|
29
|
+
Data Files or Software are furnished to do so, provided that either (a)
|
|
30
|
+
this copyright and permission notice appear with all copies of the Data
|
|
31
|
+
Files or Software, or (b) this copyright and permission notice appear in
|
|
32
|
+
associated Documentation.
|
|
33
|
+
|
|
34
|
+
THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
|
|
35
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
36
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
|
37
|
+
THIRD PARTY RIGHTS.
|
|
38
|
+
|
|
39
|
+
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
|
|
40
|
+
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
|
|
41
|
+
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
|
42
|
+
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
|
43
|
+
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
|
|
44
|
+
FILES OR SOFTWARE.
|
|
45
|
+
|
|
46
|
+
Except as contained in this notice, the name of a copyright holder shall
|
|
47
|
+
not be used in advertising or otherwise to promote the sale, use or other
|
|
48
|
+
dealings in these Data Files or Software without prior written
|
|
49
|
+
authorization of the copyright holder.
|
|
Binary file
|
package/assets/host.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"release": "
|
|
3
|
-
"archive": "
|
|
4
|
-
"files":
|
|
5
|
-
"bytes":
|
|
2
|
+
"release": "cc93f2d62086930b60a5f2b9db14eff00292ff08ddc0f57032a7df5b0f6e2aa4",
|
|
3
|
+
"archive": "44dc1fa77e0235df35e1dd05d5a5ce8c2b19d4545caf0b8579f2f4e1b9efbbc6",
|
|
4
|
+
"files": 1900,
|
|
5
|
+
"bytes": 11531000
|
|
6
6
|
}
|
package/dist/args.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export interface OptionSpec {
|
|
|
33
33
|
readonly excludesPositionals?: boolean;
|
|
34
34
|
/** §2.1 rejects the common `--root` for `ia init`; the reason is stated rather than spelled as "unknown". */
|
|
35
35
|
readonly refuse?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The value names a filesystem path: `always`, or `maybe` for a mixed-domain value (a URL or an id) that is a path
|
|
38
|
+
* only when spelled as one. Data only: parsing never reads it; the console rebuilds such values for a worktree.
|
|
39
|
+
*/
|
|
40
|
+
readonly path?: 'always' | 'maybe';
|
|
36
41
|
readonly summary: string;
|
|
37
42
|
}
|
|
38
43
|
export interface PositionalSpec {
|
|
@@ -40,6 +45,10 @@ export interface PositionalSpec {
|
|
|
40
45
|
readonly min: number;
|
|
41
46
|
/** `Number.POSITIVE_INFINITY` for a repeatable positional. */
|
|
42
47
|
readonly max: number;
|
|
48
|
+
/** The positionals from this index on name filesystem paths; data only, like `OptionSpec.path`. */
|
|
49
|
+
readonly path?: {
|
|
50
|
+
readonly from: number;
|
|
51
|
+
};
|
|
43
52
|
}
|
|
44
53
|
export interface Grammar {
|
|
45
54
|
readonly options: readonly OptionSpec[];
|
package/dist/args.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA;;;;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,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC;QAC/B,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QACtC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE;QACtC,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;YAC1B,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAClC,OAAO,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/bin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":""}
|
package/dist/bin.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The `ia` executable. consumer-cli-contract §1.2's hand-off is decided here, before any command module loads: deciding
|
|
4
|
+
* reads only directories, `package.json` files and a `pnpm-workspace.yaml`, and asks git once whether the copy is committed, so a command the
|
|
5
|
+
* workspace's own copy answers never pays for loading this copy's. When this copy answers, main.js runs the invocation.
|
|
6
|
+
*/
|
|
7
|
+
import { realpathSync } from 'node:fs';
|
|
8
|
+
import { iaHomeOf } from './discovery.js';
|
|
9
|
+
import { handOff, handoffTarget } from './handoff.js';
|
|
10
|
+
import { EXTENSIONS, packageRoot, version } from './self.js';
|
|
11
|
+
/**
|
|
12
|
+
* The exit code of the workspace's own installed copy when this invocation went to it, or undefined when this copy
|
|
13
|
+
* answers. A copy that is there but cannot be started is reported on stderr and passed over.
|
|
14
|
+
*/
|
|
15
|
+
async function handedOff(argv) {
|
|
16
|
+
const extensions = EXTENSIONS.map((extension) => extension.token);
|
|
17
|
+
// Only an extension can claim a core token, which dispatch refuses it; this table is empty, so the command table that
|
|
18
|
+
// names the core tokens loads only when there is an extension to check.
|
|
19
|
+
const coreTokens = extensions.length === 0 ? new Set() : (await import('./commands.js')).CORE_TOKENS;
|
|
20
|
+
let target;
|
|
21
|
+
try {
|
|
22
|
+
target = handoffTarget({
|
|
23
|
+
argv,
|
|
24
|
+
cwd: process.cwd(),
|
|
25
|
+
env: process.env,
|
|
26
|
+
packageRoot,
|
|
27
|
+
iaHome: iaHomeOf(process.env),
|
|
28
|
+
extensions,
|
|
29
|
+
coreTokens,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// Nothing the decision reads throws but the working directory itself, when it is gone; main.js reports that.
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
if (target === null)
|
|
37
|
+
return undefined;
|
|
38
|
+
try {
|
|
39
|
+
return handOff(target, argv, process.env, realpathSync(packageRoot));
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
43
|
+
process.stderr.write(`ia: could not start this workspace's @inventarch/cli ${target.version} (${message}); running ${version()} instead\n`);
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const argv = process.argv.slice(2);
|
|
48
|
+
const handed = await handedOff(argv);
|
|
49
|
+
if (handed !== undefined)
|
|
50
|
+
process.exitCode = handed;
|
|
51
|
+
else
|
|
52
|
+
await (await import('./main.js')).main(argv);
|
|
53
|
+
//# sourceMappingURL=bin.js.map
|
package/dist/bin.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AACA;;;;GAIG;AACH,O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O,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,wDAAwD,MAAM,CAAC,OAAO,KAAK,OAAO,cAAc,OAAO,EAAE,YAAY,CACtH,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACnC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;AACrC,IAAI,MAAM,KAAK,SAAS;IAAE,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC;;IAC/C,MAAM,CAAC,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/claude-cli.d.ts
CHANGED
|
@@ -21,8 +21,20 @@ export interface ClaudeRunner {
|
|
|
21
21
|
* array of `{id, scope, …}`. Only a user-scope install is ours to remove; a row without a scope is taken as one.
|
|
22
22
|
*/
|
|
23
23
|
export declare function observeClaude(runner: ClaudeRunner): ClaudeState;
|
|
24
|
-
/**
|
|
24
|
+
/**
|
|
25
|
+
* §6.3: all four commands are idempotent, so registration is always the same four. `install` leaves an installed plugin
|
|
26
|
+
* at its version and Claude does not refresh a third-party catalogue by default, so the last two bring an existing
|
|
27
|
+
* install to the catalogue's current release; both exit 0 when it already is. The update reports its outcome as JSON,
|
|
28
|
+
* which `updateHeld` reads.
|
|
29
|
+
*/
|
|
25
30
|
export declare const registrationCommands: (marketplace: string) => string[][];
|
|
31
|
+
export declare const isPluginUpdate: (command: readonly string[]) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Why a `plugin update --json` that exited 0 left the plugin where it was, or null when it reports no such thing. Claude
|
|
34
|
+
* exits 0 for a plugin another plugin pins to an older range (`updateOutcome` `skipped`, with its message) and for an
|
|
35
|
+
* update whose catalogue refresh failed (`refreshFailed`). Output that is not a JSON object reports nothing.
|
|
36
|
+
*/
|
|
37
|
+
export declare function updateHeld(stdout: string): string | null;
|
|
26
38
|
/** §6.3: `uninstall` and `remove` exit 1 when there is nothing to remove, so only what is listed (or unknown) is removed. */
|
|
27
39
|
export declare function removalCommands(state: ClaudeState): string[][];
|
|
28
40
|
export type Spawn = (command: string, args: readonly string[], options: Readonly<Record<string, unknown>>) => SpawnSyncReturns<string>;
|
package/dist/claude-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-cli.d.ts","sourceRoot":"","sources":["../src/claude-cli.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,KAAK,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;AACxD,eAAO,MAAM,SAAS,kBAA2C,CAAC;AAClE,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAAC;CACpC;AACD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,+GAA+G;IAC/G,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK;QACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAeD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW,CAc/D;AACD
|
|
1
|
+
{"version":3,"file":"claude-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,CAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KACvC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC9B,qGAAqG;AACrG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,iHAAiH;IACjH,QAAQ,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC;CACxB;AA8BD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,GAAE,kBAA6B,GAAG,YAAY,CAwChG"}
|
package/dist/claude-cli.js
CHANGED
|
@@ -37,11 +37,41 @@ export function observeClaude(runner) {
|
|
|
37
37
|
installed: listed(runner, ['plugin', 'list', '--json'], (row) => row['id'] === PLUGIN_ID && (row['scope'] === undefined || row['scope'] === 'user')),
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* §6.3: all four commands are idempotent, so registration is always the same four. `install` leaves an installed plugin
|
|
42
|
+
* at its version and Claude does not refresh a third-party catalogue by default, so the last two bring an existing
|
|
43
|
+
* install to the catalogue's current release; both exit 0 when it already is. The update reports its outcome as JSON,
|
|
44
|
+
* which `updateHeld` reads.
|
|
45
|
+
*/
|
|
41
46
|
export const registrationCommands = (marketplace) => [
|
|
42
47
|
['plugin', 'marketplace', 'add', marketplace],
|
|
43
48
|
['plugin', 'install', PLUGIN_ID, '--scope', 'user'],
|
|
49
|
+
['plugin', 'marketplace', 'update', CLAUDE_MARKETPLACE],
|
|
50
|
+
['plugin', 'update', PLUGIN_ID, '--scope', 'user', '--json'],
|
|
44
51
|
];
|
|
52
|
+
export const isPluginUpdate = (command) => command[0] === 'plugin' && command[1] === 'update';
|
|
53
|
+
/**
|
|
54
|
+
* Why a `plugin update --json` that exited 0 left the plugin where it was, or null when it reports no such thing. Claude
|
|
55
|
+
* exits 0 for a plugin another plugin pins to an older range (`updateOutcome` `skipped`, with its message) and for an
|
|
56
|
+
* update whose catalogue refresh failed (`refreshFailed`). Output that is not a JSON object reports nothing.
|
|
57
|
+
*/
|
|
58
|
+
export function updateHeld(stdout) {
|
|
59
|
+
let row;
|
|
60
|
+
try {
|
|
61
|
+
row = JSON.parse(stdout.trim().split('\n').pop() ?? '');
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
if (row === null || typeof row !== 'object')
|
|
67
|
+
return null;
|
|
68
|
+
const report = row, message = typeof report['message'] === 'string' ? report['message'] : '';
|
|
69
|
+
if (report['updateOutcome'] === 'skipped')
|
|
70
|
+
return (message || `skipped (${typeof report['skipReason'] === 'string' ? report['skipReason'] : 'no reason given'})`);
|
|
71
|
+
if (report['refreshFailed'] === true)
|
|
72
|
+
return message || 'the catalogue could not be refreshed';
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
45
75
|
/** §6.3: `uninstall` and `remove` exit 1 when there is nothing to remove, so only what is listed (or unknown) is removed. */
|
|
46
76
|
export function removalCommands(state) {
|
|
47
77
|
return [
|
package/dist/claude-cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-cli.js","sourceRoot":"","sources":["../src/claude-cli.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,M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;AACJ,CAAC"}
|
package/dist/commands.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import type { MODE_MOVES, Mode, PacketCatalogRow } from '@inventarch/runtime';
|
|
8
8
|
import type { Grammar, OptionSpec } from './args.js';
|
|
9
|
+
import type { Flow } from './fix.js';
|
|
9
10
|
/** The frozen machine routes admitted by `packages/runtime/src/door.ts`; see the contract’s “Exit classes and protocol boundaries”. */
|
|
10
11
|
export declare const LEGACY_OPERATIONS: readonly ["scope", "context", "select", "get", "records", "resolve", "search", "traverse", "report"];
|
|
11
12
|
/** Reserved so a later command can take the name without a rename; see “Dispatch and discovery”. */
|
|
@@ -34,7 +35,23 @@ export interface CommandSpec {
|
|
|
34
35
|
* them.
|
|
35
36
|
*/
|
|
36
37
|
readonly catalog?: CatalogTag;
|
|
38
|
+
/**
|
|
39
|
+
* The flow a fix of this command takes when its grammar decides none (consumer CLI contract §2.12, rule 5); the
|
|
40
|
+
* command declares it because neither `--apply` nor `--preview` describes how it writes.
|
|
41
|
+
*/
|
|
42
|
+
readonly flow?: Flow;
|
|
43
|
+
/**
|
|
44
|
+
* A command whose first positional is an action: the options only that action accepts (`owns`; any other action
|
|
45
|
+
* refuses them as usage) and the action's own declared flow. A fix's flow reads the grammar of the action it names.
|
|
46
|
+
*/
|
|
47
|
+
readonly actions?: Readonly<Record<string, CommandAction>>;
|
|
48
|
+
}
|
|
49
|
+
export interface CommandAction {
|
|
50
|
+
readonly owns?: readonly string[];
|
|
51
|
+
readonly flow?: Flow;
|
|
37
52
|
}
|
|
53
|
+
/** Each option an action owns, mapped to that action: the one table a command's refusal and a fix's flow both read. */
|
|
54
|
+
export declare const ownedOptions: (spec: CommandSpec) => Readonly<Record<string, string>>;
|
|
38
55
|
export declare const ROOT: OptionSpec;
|
|
39
56
|
/** §2.0. Shared consumer options; `init` (§2.1) and `vocabulary` (§2.2) refuse `--root`, each with its own reason. */
|
|
40
57
|
export declare const COMMON_OPTIONS: readonly OptionSpec[];
|