cohorte 3.0.0-dev.6 → 3.0.0-dev.8
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/README.md +59 -392
- package/assets/manifest.json +14 -4
- package/assets/prompts/agents/brainstormer.md +3 -0
- package/assets/prompts/agents/spec-author.md +3 -0
- package/assets/schemas/commands.schema.json +7 -0
- package/dist/bundle-manifest.json +72 -50
- package/dist/chunks/align-ds-r_X_1aQ_.mjs +93 -0
- package/dist/chunks/align-ds-r_X_1aQ_.mjs.map +1 -0
- package/dist/chunks/audit-B4ZWQ_DI.mjs +179 -0
- package/dist/chunks/audit-B4ZWQ_DI.mjs.map +1 -0
- package/dist/chunks/brainstorm-SJwOIEif.mjs +123 -0
- package/dist/chunks/brainstorm-SJwOIEif.mjs.map +1 -0
- package/dist/chunks/build-C_-mbZfD.mjs +19 -0
- package/dist/chunks/build-C_-mbZfD.mjs.map +1 -0
- package/dist/chunks/{catalogue-DzsslCSN.mjs → catalogue-IaCJdfB8.mjs} +4 -4
- package/dist/chunks/{catalogue-DzsslCSN.mjs.map → catalogue-IaCJdfB8.mjs.map} +1 -1
- package/dist/chunks/{compose-ckM7eAJ_.mjs → compose-DRKjQcn0.mjs} +42 -23
- package/dist/chunks/compose-DRKjQcn0.mjs.map +1 -0
- package/dist/chunks/{config-DcGPL3i7.mjs → config-Cqu5XQoP.mjs} +2 -2
- package/dist/chunks/{config-DcGPL3i7.mjs.map → config-Cqu5XQoP.mjs.map} +1 -1
- package/dist/chunks/{contract-DiWla5G9.mjs → contract-DjssDPpS.mjs} +45 -25
- package/dist/chunks/contract-DjssDPpS.mjs.map +1 -0
- package/dist/chunks/{diff-D_0hBwHl.mjs → diff-Qw0II0sj.mjs} +2 -2
- package/dist/chunks/{diff-D_0hBwHl.mjs.map → diff-Qw0II0sj.mjs.map} +1 -1
- package/dist/chunks/{discover-BBiluyl4.mjs → discover-BZPolSZG.mjs} +2 -2
- package/dist/chunks/{discover-BBiluyl4.mjs.map → discover-BZPolSZG.mjs.map} +1 -1
- package/dist/chunks/{doctor-BAcemCDr.mjs → doctor-DcDFPvQM.mjs} +6 -6
- package/dist/chunks/{doctor-BAcemCDr.mjs.map → doctor-DcDFPvQM.mjs.map} +1 -1
- package/dist/chunks/fix-C9roGiQz.mjs +82 -0
- package/dist/chunks/fix-C9roGiQz.mjs.map +1 -0
- package/dist/chunks/fleet-yWHQY2ya.mjs +297 -0
- package/dist/chunks/fleet-yWHQY2ya.mjs.map +1 -0
- package/dist/chunks/{init-DfOKw-rD.mjs → init--FxxkrcT.mjs} +2 -2
- package/dist/chunks/{init-DfOKw-rD.mjs.map → init--FxxkrcT.mjs.map} +1 -1
- package/dist/chunks/intake-C1pesxCJ.mjs +12 -0
- package/dist/chunks/intake-C1pesxCJ.mjs.map +1 -0
- package/dist/chunks/loop-BWsUpyus.mjs +212 -0
- package/dist/chunks/loop-BWsUpyus.mjs.map +1 -0
- package/dist/chunks/{migrate-D3-4beNR.mjs → migrate-DuYCAbE3.mjs} +2 -2
- package/dist/chunks/{migrate-D3-4beNR.mjs.map → migrate-DuYCAbE3.mjs.map} +1 -1
- package/dist/chunks/{obsidian-D1jf1sTR.mjs → obsidian-BHLkXx_H.mjs} +50 -6
- package/dist/chunks/obsidian-BHLkXx_H.mjs.map +1 -0
- package/dist/chunks/patch-sAgVqjpx.mjs +50 -0
- package/dist/chunks/patch-sAgVqjpx.mjs.map +1 -0
- package/dist/chunks/{policy-Y65MYKzn.mjs → policy-Du7WVBFX.mjs} +4 -4
- package/dist/chunks/{policy-Y65MYKzn.mjs.map → policy-Du7WVBFX.mjs.map} +1 -1
- package/dist/chunks/{reconcile-B6mGZWtp.mjs → reconcile-BHn66X3C.mjs} +3 -3
- package/dist/chunks/{reconcile-B6mGZWtp.mjs.map → reconcile-BHn66X3C.mjs.map} +1 -1
- package/dist/chunks/refactor-DV3RfGjk.mjs +153 -0
- package/dist/chunks/refactor-DV3RfGjk.mjs.map +1 -0
- package/dist/chunks/retro-Dr-2RTNN.mjs +78 -0
- package/dist/chunks/retro-Dr-2RTNN.mjs.map +1 -0
- package/dist/chunks/review-ZsBqp3vZ.mjs +35 -0
- package/dist/chunks/review-ZsBqp3vZ.mjs.map +1 -0
- package/dist/chunks/{run-BInPXOcm.mjs → run-BGabwbDL.mjs} +32 -5
- package/dist/chunks/run-BGabwbDL.mjs.map +1 -0
- package/dist/chunks/{schema-hSyIURjN.mjs → schema-Bq9qtgsd.mjs} +2 -2
- package/dist/chunks/{schema-hSyIURjN.mjs.map → schema-Bq9qtgsd.mjs.map} +1 -1
- package/dist/chunks/ship-BizfUe62.mjs +140 -0
- package/dist/chunks/ship-BizfUe62.mjs.map +1 -0
- package/dist/chunks/spec-C2h3U64g.mjs +65 -0
- package/dist/chunks/spec-C2h3U64g.mjs.map +1 -0
- package/dist/chunks/spec-path-tptqR7W8.mjs +10 -0
- package/dist/chunks/spec-path-tptqR7W8.mjs.map +1 -0
- package/dist/chunks/{src-C7hs8Bjw.mjs → src-Bfr1yzsn.mjs} +3 -3
- package/dist/chunks/{src-C7hs8Bjw.mjs.map → src-Bfr1yzsn.mjs.map} +1 -1
- package/dist/chunks/{src-Daa5lIcP.mjs → src-CPW2_Ons.mjs} +101 -17
- package/dist/chunks/src-CPW2_Ons.mjs.map +1 -0
- package/dist/chunks/{src-DMrQ5m6I.mjs → src-DNsLSxgm.mjs} +2 -2
- package/dist/chunks/{src-DMrQ5m6I.mjs.map → src-DNsLSxgm.mjs.map} +1 -1
- package/dist/chunks/{src-BnlNkd3S.mjs → src-DbS9gkJy.mjs} +2 -2
- package/dist/chunks/{src-BnlNkd3S.mjs.map → src-DbS9gkJy.mjs.map} +1 -1
- package/dist/chunks/{src-s7YRvk0t.mjs → src-yi5whv3n.mjs} +4 -2
- package/dist/chunks/src-yi5whv3n.mjs.map +1 -0
- package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs +56 -0
- package/dist/chunks/update-pipeline-Du-Gu1Pl.mjs.map +1 -0
- package/dist/cli.mjs +29 -19
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/brainstorm-kBUiZLce.mjs +0 -7
- package/dist/chunks/brainstorm-kBUiZLce.mjs.map +0 -1
- package/dist/chunks/compose-ckM7eAJ_.mjs.map +0 -1
- package/dist/chunks/contract-DiWla5G9.mjs.map +0 -1
- package/dist/chunks/fix-D4Tj8RVA.mjs +0 -18
- package/dist/chunks/fix-D4Tj8RVA.mjs.map +0 -1
- package/dist/chunks/obsidian-D1jf1sTR.mjs.map +0 -1
- package/dist/chunks/review-BDdjb6kB.mjs +0 -17
- package/dist/chunks/review-BDdjb6kB.mjs.map +0 -1
- package/dist/chunks/run-BInPXOcm.mjs.map +0 -1
- package/dist/chunks/ship-DTuLGoaJ.mjs +0 -19
- package/dist/chunks/ship-DTuLGoaJ.mjs.map +0 -1
- package/dist/chunks/spec-MVP9y8dN.mjs +0 -20
- package/dist/chunks/spec-MVP9y8dN.mjs.map +0 -1
- package/dist/chunks/src-Daa5lIcP.mjs.map +0 -1
- package/dist/chunks/src-s7YRvk0t.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contract-DiWla5G9.mjs","names":[],"sources":["../../../../apps/cli/src/contract/command-module.ts","../../../../apps/cli/src/contract/documents.ts","../../../../apps/cli/src/contract/exit-codes.ts","../../../../apps/cli/src/contract/verbs.ts"],"sourcesContent":["// apps/cli/src/contract/command-module.ts — DESIGN 10.1 rule 3 \"every barrel entry is a live export\": each verb's\n// `commands/<verb>/index.ts` implements `CommandModule`. Wave 0 fills every one with `notImplementedCommand` (the\n// documented not-available error, spec 24 `configuration/phase-not-available`); later waves replace the body,\n// never the shape — `cli.ts` and `lazy.ts` never change to accommodate a filled-in verb.\nimport { CohorteError, errorOf } from '@cohorte/base';\nimport type { CliContext } from './context.ts';\n\n/** What `cli.ts` hands a module after commander parsed the line: positionals, options, and the JSON flag. */\nexport interface CommandArgs {\n /**\n * Every token commander did not consume, IN ORDER — which in V3.0 means every flag a verb defines for itself:\n * `cohorte run spec-1 --wait 8 --detach` arrives as `['spec-1', '--wait', '8', '--detach']`. A verb module parses\n * its own flags from here.\n */\n readonly positionals: readonly string[];\n /**\n * In V3.0 this carries ONLY `json`. The registry is frozen (PLAN §3 rule 3) and `cli.ts` registers no option but\n * `--json`, on the verbs that publish a document; with `allowUnknownOption(true)` every other flag is left\n * unparsed in `positionals`. So `args.options.wait` / `args.options.check` are ALWAYS `undefined` — read\n * `positionals`. The map is kept open (rather than typed `{ json?: boolean }`) because a post-3.0 registry\n * amendment that declares a real option is a MINOR, not a breaking change to this contract.\n */\n readonly options: Readonly<Record<string, unknown>>;\n /** Set when the verb has DESIGN §9 sub-verbs (`config get`, `auth login`, ...): the one commander matched. */\n readonly subVerb?: string;\n readonly json: boolean;\n}\n\nexport interface CommandModule {\n readonly verb: string;\n /**\n * Runs the verb; returns the process exit code (DESIGN 2.8 / 2.3.4). Throwing is equivalent to returning the\n * class exit code of `toErrorInfo(thrown, …)`: `cli.ts` converts every throw at the boundary, so a module is\n * free to throw a `CohorteError`, a `NotImplemented`, or let an unexpected error surface — nothing here writes to\n * `ctx.stdio` on error, `cli.ts` alone owns the spec-21 `cause / impact / run / next action / exit code` format.\n */\n run(ctx: CliContext, args: CommandArgs): Promise<number>;\n}\n\n/**\n * The Wave-0 body of every verb (DESIGN §9 \"stubbed with a seam\" and the plain \"not yet built\" ones alike): a verb\n * a later wave fills replaces this factory call with a real implementation, never the module's shape.\n *\n * It throws a CLASSIFIED `CohorteError`, not a bare `NotImplemented`: `toErrorInfo` keeps a `CohorteError`'s own\n * code, so the documented `configuration/phase-not-available` (DESIGN §9, exit 10) is what the stub MEANS rather\n * than what `cli.ts`'s unknown-throwable fallback happens to be. `cli.ts`'s fallback is `configuration/unexpected`\n * (DESIGN 2.8 \"Unknown throwables -> `<nearest class>/unexpected`\"), so a real defect in a filled-in verb can never\n * masquerade as \"this phase is not available in this build\".\n */\nexport function notImplementedCommand(verb: string): CommandModule {\n return {\n verb,\n // `ctx`/`args` intentionally unused: the Wave-0 stub never touches a port (DESIGN 1.3).\n async run(_ctx, _args): Promise<number> {\n throw new CohorteError(\n errorOf('configuration/phase-not-available', `the verb \\`${verb}\\` is not available in this build`),\n );\n },\n };\n}\n","// apps/cli/src/contract/documents.ts — DESIGN 2.3.5 \"one [S] document per --json output\". `JSON_OUTPUTS` is the\n// map a Wave-4 command unit's `--json validates` test reads: verb -> the published document(s) that verb's\n// `--json` can print, each resolvable to a real schema in the protocol, project-model or security contract (PLAN\n// U0.10 test list, 6th row).\n\nimport { ProjectModel, ReconcilePlan } from '@cohorte/project-model/contract';\nimport { DOCUMENTS, type DocumentName } from '@cohorte/protocol';\nimport type { TSchema } from 'typebox';\n\n/** The two project-model documents a `--json` verb may print (DESIGN §9: `reconcile --plan`, `discover`). */\nexport const PROJECT_MODEL_DOCUMENT_NAMES = ['reconcile-plan', 'project-model'] as const;\nexport type ProjectModelDocumentName = (typeof PROJECT_MODEL_DOCUMENT_NAMES)[number];\n\nexport type DocumentRef =\n | { readonly source: 'protocol'; readonly name: DocumentName }\n | { readonly source: 'project-model'; readonly name: ProjectModelDocumentName };\n\n/** Resolves a `DocumentRef` to its real schema; throws when the referenced contract has no such entry (a drift\n * guard, not a runtime path: every entry of `JSON_OUTPUTS` below is checked against this at test time). */\nexport function resolveDocumentSchema(ref: DocumentRef): TSchema {\n if (ref.source === 'protocol') {\n const schema = DOCUMENTS[ref.name];\n if (!schema) throw new RangeError(`resolveDocumentSchema: no protocol document named ${ref.name}`);\n return schema;\n }\n // A plain lookup, not a `switch` with an unreachable default: the ref may come from a Wave-4 unit's data, so an\n // unknown name must throw at run time and not only fail to typecheck.\n // No cast: `TUnsafe<T> extends TSchema`, and there is exactly one typebox install (the `pnpm-workspace.yaml`\n // override pins 1.3.7), so `@cohorte/project-model/contract`'s schemas ARE `TSchema`s here. If this ever stops\n // compiling, the cause is a second typebox identity in the graph — a real defect to report, not to cast away.\n const projectModelSchemas: Record<ProjectModelDocumentName, TSchema> = {\n 'reconcile-plan': ReconcilePlan,\n 'project-model': ProjectModel,\n };\n const schema = projectModelSchemas[ref.name];\n if (!schema) throw new RangeError(`resolveDocumentSchema: no project-model document named ${String(ref.name)}`);\n return schema;\n}\n\nconst protocolDoc = (name: DocumentName): DocumentRef => ({ source: 'protocol', name });\nconst reconcilePlanDoc: DocumentRef = { source: 'project-model', name: 'reconcile-plan' };\n/** DESIGN §9 verb semantics: \"`cohorte discover` prints the deterministic scan as a Project Model document\". */\nconst projectModelDoc: DocumentRef = { source: 'project-model', name: 'project-model' };\n/** DESIGN 2.3.4's inbox route: every mutating command answers with a `CommandResultDocument`. */\nconst commandResult: readonly DocumentRef[] = [protocolDoc('command-result')];\n\n/**\n * Keyed by CLI verb (not by `CommandType`: read-only verbs publish a document with no command behind them).\n *\n * The key set is exactly `{ verb.name | verb.json }` of `contract/verbs.ts`, and `cli.ts` registers `--json` only\n * for those verbs — `apps/cli/test/registry/json-outputs.test.ts` pins both directions. `logs` and `tail` are\n * deliberately absent: DESIGN 4.7 gives an observer `--format=line|json` over an NDJSON *stream* of event\n * envelopes, not a single `--json` document (request U0.10 R1 asks U0.G to confirm that reading).\n */\nexport const JSON_OUTPUTS: Readonly<Record<string, readonly DocumentRef[]>> = Object.freeze({\n // `status <run>` -> run-state; `status` (no run) -> project-status (DESIGN 2.3.4 \"no runId => ProjectStatusDocument\")\n status: [protocolDoc('project-status'), protocolDoc('run-state')],\n inspect: [protocolDoc('inspect')],\n diff: [protocolDoc('run-diff')],\n doctor: [protocolDoc('doctor-report')],\n auth: [protocolDoc('auth-status')],\n reconcile: [reconcilePlanDoc],\n discover: [projectModelDoc],\n // `run` drives `start`; its `--wait`/`--json` prints the same run-state an observer would (DESIGN 4.7).\n run: [protocolDoc('command-result'), protocolDoc('run-state')],\n resume: commandResult,\n pause: commandResult,\n cancel: commandResult,\n approve: commandResult,\n deny: commandResult,\n retry: commandResult,\n skip: commandResult,\n shutdown: commandResult,\n send: commandResult,\n 'run-tool': commandResult,\n});\n","// apps/cli/src/contract/exit-codes.ts — DESIGN 2.8 \"Exit codes of a process that waits for a run\" + DESIGN 4.7 +\n// the controller codes of DESIGN 2.3.4 (`CONTROLLER_EXIT_CODES`). Total over `ErrorClass` because it is built\n// directly from `@cohorte/base`'s `EXIT_CODE_BY_CLASS`, which is itself total (a `satisfies Record<ErrorClass, …>`\n// literal): the totality test in `apps/cli/test/registry` checks that equality holds, it does not re-derive it.\nimport { ERROR_CLASSES, type ErrorClass, EXIT_CODE_BY_CLASS } from '@cohorte/base';\nimport { CONTROLLER_EXIT_CODES, HALTED_STATES, type PipelineState, SUSPENDED_STATES } from '@cohorte/protocol';\n\nexport { CONTROLLER_EXIT_CODES, EXIT_CODE_BY_CLASS };\n\n/** DESIGN 4.7 \"4 on a suspended state\" / DESIGN 2.3.4 \"4 accepted-but-pending at --wait expiry (not an error)\". */\nexport const SUSPENDED_EXIT_CODE = 4;\n/** DESIGN 2.8 \"16 on CANCELLED\" (shares the `conflict` class code, but CANCELLED is not itself an error). */\nexport const CANCELLED_EXIT_CODE = 16;\nexport const COMPLETED_EXIT_CODE = 0;\n\nconst SUSPENDED = new Set<string>(SUSPENDED_STATES);\nconst HALTED = new Set<string>(HALTED_STATES);\n\n/**\n * DESIGN 2.8 / 4.7: \"an observer started by `run`, or any `--wait`, exits 0 on COMPLETED, the class code of\n * `run.lastError` on FAILED/BLOCKED, 4 on a suspended state, 16 on CANCELLED.\" `lastErrorClass` is required\n * exactly when `state` is FAILED or BLOCKED (DESIGN 2.8: every halted run carries a `lastError`).\n */\nexport function waitExitCode(state: PipelineState, lastErrorClass?: ErrorClass): number {\n if (state === 'COMPLETED') return COMPLETED_EXIT_CODE;\n if (state === 'CANCELLED') return CANCELLED_EXIT_CODE;\n if (SUSPENDED.has(state)) return SUSPENDED_EXIT_CODE;\n if (HALTED.has(state)) {\n if (!lastErrorClass) throw new RangeError(`waitExitCode: ${state} requires lastErrorClass (DESIGN 2.8)`);\n return EXIT_CODE_BY_CLASS[lastErrorClass];\n }\n // IDLE and every ACTIVE_PIPELINE_STATE are not terminal/suspended: a waiter never observes them as a final state.\n throw new RangeError(`waitExitCode: ${state} is not a terminal or suspended state (DESIGN 2.8)`);\n}\n\nexport interface ExitCodeHelpRow {\n readonly code: number;\n readonly meaning: string;\n}\n\n/** DESIGN 2.3.4 \"Controller exit codes: 0 completed · 3 rejected · 4 accepted-but-pending · 2 usage.\" */\nexport const CONTROLLER_EXIT_HELP: readonly ExitCodeHelpRow[] = [\n { code: CONTROLLER_EXIT_CODES.completed, meaning: 'completed' },\n { code: CONTROLLER_EXIT_CODES.usage, meaning: 'usage error' },\n { code: CONTROLLER_EXIT_CODES.rejected, meaning: 'rejected' },\n { code: CONTROLLER_EXIT_CODES.pending, meaning: 'accepted, pending at --wait expiry (not an error: durable inbox)' },\n];\n\n/** DESIGN 2.8's table, class by class, in spec order. */\nexport const ERROR_CLASS_EXIT_HELP: readonly ExitCodeHelpRow[] = ERROR_CLASSES.map((errorClass) => ({\n code: EXIT_CODE_BY_CLASS[errorClass],\n meaning: `${errorClass} error`,\n}));\n\nexport const CANCELLED_EXIT_HELP: ExitCodeHelpRow = { code: CANCELLED_EXIT_CODE, meaning: 'cancelled' };\n\n/** Rendered into `--help` (PLAN U0.10 test: \"controller codes 0/2/3/4 documented in --help\"). */\nexport function formatExitCodesHelp(): string {\n const rows = [...CONTROLLER_EXIT_HELP, ...ERROR_CLASS_EXIT_HELP, CANCELLED_EXIT_HELP].reduce<ExitCodeHelpRow[]>(\n (merged, row) => {\n const existing = merged.find((item) => item.code === row.code);\n if (existing) {\n const index = merged.indexOf(existing);\n merged[index] = { code: row.code, meaning: `${existing.meaning} / ${row.meaning}` };\n } else {\n merged.push({ ...row });\n }\n return merged;\n },\n [],\n );\n const width = Math.max(...rows.map((row) => String(row.code).length));\n const lines = rows.map((row) => ` ${String(row.code).padStart(width)} ${row.meaning}`);\n return ['Exit codes:', ...lines].join('\\n');\n}\n","// apps/cli/src/contract/verbs.ts — DESIGN §9 \"V3.0 scope cut\" CLI row + the verb-semantics paragraph, and DESIGN\n// 2.3.4 \"every command type has a CLI verb, because one-shot CLI spawns are the only V3.0 transport\". `cli.ts`\n// builds the whole commander tree from this table and NOTHING ELSE (PLAN §3 rule 3: \"cli.ts pre-registers every\n// verb against commands/<verb>/index.ts\"); a later wave fills a verb's module, never this table's shape.\nimport type { CommandType } from '@cohorte/protocol';\n\nexport interface VerbSpec {\n readonly name: string;\n readonly summary: string;\n /** DESIGN §9: `config get|set|validate|trust`, `auth login|status|logout`, `providers list|test`, ... */\n readonly subVerbs?: readonly string[];\n /** Not listed in `cohorte --help` (the `__host` internal entry point, DESIGN 4.7). */\n readonly hidden?: boolean;\n /**\n * This verb accepts `--json` and publishes a document for it (DESIGN 2.3.5). Set exactly on the verbs that have\n * a `JSON_OUTPUTS` entry — `cli.ts` registers the `--json` option only for those, and\n * `apps/cli/test/registry/json-outputs.test.ts` pins the two sides equal in BOTH directions, so a verb can never\n * be silently flagged `--json` with no document behind it.\n */\n readonly json?: boolean;\n /** The `@cohorte/protocol` `CommandType` this verb drives 1:1, when it drives exactly one (DESIGN 2.3.4). */\n readonly commandType?: CommandType;\n}\n\nexport const VERBS: readonly VerbSpec[] = [\n { name: 'init', summary: 'Scaffold .cohorte/ for this repository' },\n { name: 'doctor', summary: 'Diagnose the installation, configuration and toolchain', json: true },\n { name: 'discover', summary: 'Print the deterministic project scan (no write)', json: true },\n { name: 'run', summary: 'Start a pipeline run', commandType: 'start', json: true },\n { name: 'status', summary: 'Show a run, or the project, status', commandType: 'status', json: true },\n {\n name: 'inspect',\n summary: 'Inspect one agent, context, approval, effect, snapshot, lock, diff or artifact',\n commandType: 'inspect',\n json: true,\n },\n { name: 'resume', summary: 'Resume a suspended run', commandType: 'resume', json: true },\n { name: 'pause', summary: 'Pause an active run', commandType: 'pause', json: true },\n { name: 'cancel', summary: 'Cancel a run', commandType: 'cancel', json: true },\n { name: 'shutdown', summary: 'Ask the detached host to shut down gracefully', commandType: 'shutdown', json: true },\n { name: 'approve', summary: 'Approve a pending approval request', commandType: 'approve', json: true },\n { name: 'deny', summary: 'Deny a pending approval request', commandType: 'deny', json: true },\n { name: 'retry', summary: 'Retry a phase or an agent', commandType: 'retry', json: true },\n { name: 'skip', summary: 'Skip a phase (only if policy.skip lists it)', commandType: 'skip', json: true },\n { name: 'logs', summary: 'Print durable run events' },\n { name: 'tail', summary: 'Follow a run (durable + ephemeral events)', commandType: 'tail' },\n { name: 'diff', summary: 'Show the run diff for a surface', json: true },\n { name: 'review', summary: 'Start a review-profile run over a ref range or a prior run' },\n { name: 'fix', summary: \"Retry a run's FIX phase\" },\n { name: 'ship', summary: 'Show and resolve the pending ship approval' },\n { name: 'auth', summary: 'Manage provider authentication', subVerbs: ['login', 'status', 'logout'], json: true },\n { name: 'providers', summary: 'List or test configured providers', subVerbs: ['list', 'test'] },\n { name: 'models', summary: 'List available models', subVerbs: ['list'] },\n {\n name: 'config',\n summary: 'Read, write, validate or trust the project configuration',\n subVerbs: ['get', 'set', 'validate', 'trust'],\n },\n { name: 'migrate', summary: 'Check or apply state-store migrations' },\n {\n name: 'reconcile',\n summary: 'Plan the project configuration against the discovered state',\n commandType: 'reconcile',\n json: true,\n },\n { name: 'spec', summary: 'Validate or freeze a human-written spec', subVerbs: ['validate', 'freeze'] },\n {\n name: 'obsidian',\n summary: 'Connect and synchronize an Obsidian board',\n subVerbs: ['create', 'connect', 'status', 'move'],\n },\n { name: 'policy', summary: 'Explain the effective security policy', subVerbs: ['explain'] },\n { name: 'gc', summary: 'Garbage-collect worktrees, spools and old runs' },\n {\n name: 'update',\n // DESIGN §9 spells it as a FLAG, `update --check`, not a sub-verb: the Wave-5 unit that fills\n // `commands/update/index.ts` reads `--check` from `args.options`/`args.positionals` like every other verb flag.\n summary: 'Check for a newer pinned install (offline, --check only in V3.0)',\n },\n { name: 'brainstorm', summary: 'Not available in V3.0 (reserved verb id, DESIGN §9)' },\n {\n name: 'run-tool',\n summary: 'Run one tool directly (admin; policy.admin.runTool)',\n commandType: 'run-tool',\n json: true,\n },\n {\n name: 'send',\n summary: 'Send text to a running agent (policy.steer.enabled)',\n commandType: 'agent.send',\n json: true,\n },\n { name: '__host', summary: 'Internal: run the detached host in-process', hidden: true },\n];\n\nconst BY_NAME = new Map(VERBS.map((verb) => [verb.name, verb]));\n\nexport function findVerb(name: string): VerbSpec | undefined {\n return BY_NAME.get(name);\n}\n\nexport const VERB_NAMES: readonly string[] = VERBS.map((verb) => verb.name);\n\n/** DESIGN 2.3.4: every `CommandType` has exactly one driving verb. Built from `VERBS`, so it can never drift. */\nexport const COMMAND_TYPE_TO_VERB: Readonly<Record<CommandType, string>> = Object.freeze(\n Object.fromEntries(\n VERBS.filter((verb): verb is VerbSpec & { commandType: CommandType } => verb.commandType !== undefined).map(\n (verb) => [verb.commandType, verb.name],\n ),\n ) as Record<CommandType, string>,\n);\n"],"mappings":";;;;;;;;;;;;;;AAiDA,SAAgB,sBAAsB,MAA6B;CACjE,OAAO;EACL;EAEA,MAAM,IAAI,MAAM,OAAwB;GACtC,MAAM,IAAI,aACR,QAAQ,qCAAqC,cAAc,KAAK,kCAAkC,CACpG;EACF;CACF;AACF;;;ACpBA,MAAM,eAAe,UAAqC;CAAE,QAAQ;CAAY;AAAK;AACrF,MAAM,mBAAgC;CAAE,QAAQ;CAAiB,MAAM;AAAiB;;AAExF,MAAM,kBAA+B;CAAE,QAAQ;CAAiB,MAAM;AAAgB;;AAEtF,MAAM,gBAAwC,CAAC,YAAY,gBAAgB,CAAC;AAUE,OAAO,OAAO;CAE1F,QAAQ,CAAC,YAAY,gBAAgB,GAAG,YAAY,WAAW,CAAC;CAChE,SAAS,CAAC,YAAY,SAAS,CAAC;CAChC,MAAM,CAAC,YAAY,UAAU,CAAC;CAC9B,QAAQ,CAAC,YAAY,eAAe,CAAC;CACrC,MAAM,CAAC,YAAY,aAAa,CAAC;CACjC,WAAW,CAAC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CAC/G;EAAE,MAAM;EAAa,SAAS;EAAqC,UAAU,CAAC,QAAQ,MAAM;CAAE;CAC9F;EAAE,MAAM;EAAU,SAAS;EAAyB,UAAU,CAAC,MAAM;CAAE;CACvE;EACE,MAAM;EACN,SAAS;EACT,UAAU;GAAC;GAAO;GAAO;GAAY;EAAO;CAC9C;CACA;EAAE,MAAM;EAAW,SAAS;CAAwC;CACpE;EACE,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;CACR;CACA;EAAE,MAAM;EAAQ,SAAS;EAA2C,UAAU,CAAC,YAAY,QAAQ;CAAE;CACrG;EACE,MAAM;EACN,SAAS;EACT,UAAU;GAAC;GAAU;GAAW;GAAU;EAAM;CAClD;CACA;EAAE,MAAM;EAAU,SAAS;EAAyC,UAAU,CAAC,SAAS;CAAE;CAC1F;EAAE,MAAM;EAAM,SAAS;CAAiD;CACxE;EACE,MAAM;EAGN,SAAS;CACX;CACA;EAAE,MAAM;EAAc,SAAS;CAAsD;CACrF;EACE,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;CACR;CACA;EACE,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;CACR;CACA;EAAE,MAAM;EAAU,SAAS;EAA8C,QAAQ;CAAK;AACxF;AAEgB,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,KAAK,MAAM,IAAI,CAAC,CAAC;AAMjB,MAAM,KAAK,SAAS,KAAK,IAAI;AAGC,OAAO,OAChF,OAAO,YACL,MAAM,QAAQ,SAA0D,KAAK,gBAAgB,KAAA,CAAS,CAAC,CAAC,KACrG,SAAS,CAAC,KAAK,aAAa,KAAK,IAAI,CACxC,CACF,CACF"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//#region src/commands/fix/index.ts
|
|
2
|
-
const fix = {
|
|
3
|
-
verb: "fix",
|
|
4
|
-
async run(ctx, args) {
|
|
5
|
-
const runId = args.positionals[0];
|
|
6
|
-
if (!runId) return 2;
|
|
7
|
-
const result = await ctx.controller.send("retry", { target: {
|
|
8
|
-
kind: "phase",
|
|
9
|
-
state: "FIX"
|
|
10
|
-
} }, { runId });
|
|
11
|
-
ctx.stdio.stdout.write(`${JSON.stringify(result)}\n`);
|
|
12
|
-
return result.status === "rejected" ? 3 : result.status === "pending" ? 4 : 0;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { fix as default };
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=fix-D4Tj8RVA.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fix-D4Tj8RVA.mjs","names":[],"sources":["../../../../apps/cli/src/commands/fix/index.ts"],"sourcesContent":["// apps/cli/src/commands/fix/index.ts — DESIGN §9 verb `fix` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/fix/**`.\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst fix: CommandModule = {\n verb: 'fix',\n async run(ctx, args) {\n const runId = args.positionals[0];\n if (!runId) return 2;\n const result = await ctx.controller.send('retry', { target: { kind: 'phase', state: 'FIX' } }, { runId });\n ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default fix;\n"],"mappings":";AAMA,MAAM,MAAqB;CACzB,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,QAAQ,KAAK,YAAY;EAC/B,IAAI,CAAC,OAAO,OAAO;EACnB,MAAM,SAAS,MAAM,IAAI,WAAW,KAAK,SAAS,EAAE,QAAQ;GAAE,MAAM;GAAS,OAAO;EAAM,EAAE,GAAG,EAAE,MAAM,CAAC;EACxG,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;EACpD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"obsidian-D1jf1sTR.mjs","names":[],"sources":["../../../../apps/cli/src/commands/obsidian/index.ts"],"sourcesContent":["import { access, mkdir, readFile, writeFile } from 'node:fs/promises';\nimport { dirname, join, resolve } from 'node:path';\nimport { parse, stringify } from 'yaml';\nimport type { CommandModule } from '../../contract/index.ts';\n\ntype Card = { id: string; title: string; checked: boolean; column: string; line: number };\n\nconst COLUMNS = ['Ideas', 'Brainstorm', 'Spec', 'Ready to build', 'Building', 'Review', 'Fix', 'Ship', 'Shipped'];\nconst STAGES = new Map([\n ['ideas', 'Ideas'],\n ['brainstorm', 'Brainstorm'],\n ['spec', 'Spec'],\n ['ready', 'Ready to build'],\n ['building', 'Building'],\n ['review', 'Review'],\n ['fix', 'Fix'],\n ['ship', 'Ship'],\n ['shipped', 'Shipped'],\n]);\n\nconst BOARD_TEMPLATE = `---\nkanban-plugin: board\n---\n\n${COLUMNS.map((column) => `## ${column}\\n`).join('\\n')}\n%% kanban:settings\n\\`\\`\\`\n{\"kanban-plugin\":\"board\",\"list-collapse\":[false,false,false,false,false,false,false,false,false]}\n\\`\\`\\`\n%%\n`;\n\nfunction parseCards(source: string): Card[] {\n const lines = source.split(/\\r?\\n/);\n let column = '';\n const cards: Card[] = [];\n lines.forEach((line, lineIndex) => {\n const heading = /^##\\s+(.+?)\\s*$/.exec(line);\n if (heading) {\n column = heading[1] ?? '';\n return;\n }\n const card = /^-\\s+\\[([ xX])\\]\\s+(.+)$/.exec(line);\n if (!card || !column) return;\n const title = card[2] ?? '';\n const tag = /#([a-z0-9][a-z0-9-]*)\\b/i.exec(title);\n if (!tag) return;\n cards.push({\n id: (tag[1] ?? '').toLowerCase(),\n title,\n checked: (card[1] ?? '').toLowerCase() === 'x',\n column,\n line: lineIndex,\n });\n });\n return cards;\n}\n\nasync function loadUserConfig(home: string): Promise<{ path: string; value: Record<string, unknown> }> {\n const path = join(home, '.cohorte', 'config.yaml');\n try {\n const value = parse(await readFile(path, 'utf8')) as Record<string, unknown>;\n return { path, value: value && typeof value === 'object' ? value : {} };\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n return { path, value: {} };\n }\n}\n\nfunction configured(value: Record<string, unknown>): { vaultPath: string; board: string } | undefined {\n const integrations = value.integrations;\n if (!integrations || typeof integrations !== 'object') return undefined;\n const obsidian = (integrations as Record<string, unknown>).obsidian;\n if (!obsidian || typeof obsidian !== 'object') return undefined;\n const { vaultPath, board } = obsidian as Record<string, unknown>;\n return typeof vaultPath === 'string' && typeof board === 'string' ? { vaultPath, board } : undefined;\n}\n\nasync function boardPath(home: string): Promise<{ config: { vaultPath: string; board: string }; path: string }> {\n const loaded = await loadUserConfig(home);\n const config = configured(loaded.value);\n if (!config) throw new Error('Obsidian is not configured; run `cohorte obsidian connect <vault> <board>`');\n const path = resolve(config.vaultPath, config.board);\n await access(path);\n return { config, path };\n}\n\nfunction replaceCard(source: string, id: string, target: string): string {\n const lines = source.split(/\\r?\\n/);\n const cards = parseCards(source);\n const card = cards.find((item) => item.id === id);\n if (!card) throw new Error(`Obsidian card #${id} was not found`);\n if (!COLUMNS.includes(target)) throw new Error(`Unknown Obsidian column: ${target}`);\n if (card.column === target) return source;\n const line = lines[card.line] ?? '';\n lines.splice(card.line, 1);\n let heading = lines.indexOf(`## ${target}`);\n if (heading < 0) {\n if (!source.endsWith('\\n')) lines.push('');\n lines.push(`## ${target}`, '');\n heading = lines.length - 2;\n }\n let insert = heading + 1;\n while (insert < lines.length && !(lines[insert] ?? '').startsWith('## ')) insert++;\n lines.splice(insert, 0, line);\n return lines.join('\\n');\n}\n\nconst obsidian: CommandModule = {\n verb: 'obsidian',\n async run(ctx, args) {\n const home = ctx.env.HOME ?? ctx.cwd;\n if (args.subVerb === 'create') {\n const [vaultPath, board = 'Weave/Tasks.md'] = args.positionals;\n if (!vaultPath) return 2;\n const path = resolve(vaultPath, board);\n try {\n await access(path);\n throw new Error(`Obsidian board already exists: ${path}`);\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error;\n }\n await mkdir(dirname(path), { recursive: true });\n await writeFile(path, BOARD_TEMPLATE, 'utf8');\n const loaded = await loadUserConfig(home);\n const integrations = loaded.value.integrations;\n const nextIntegrations = integrations && typeof integrations === 'object' ? { ...(integrations as object) } : {};\n (nextIntegrations as Record<string, unknown>).obsidian = { vaultPath, board };\n loaded.value.integrations = nextIntegrations;\n await mkdir(dirname(loaded.path), { recursive: true });\n await writeFile(loaded.path, stringify(loaded.value), 'utf8');\n ctx.stdio.stdout.write(`created and connected ${path}\\n`);\n return 0;\n }\n if (args.subVerb === 'connect') {\n const [vaultPath, board = 'Weave/Tasks.md'] = args.positionals;\n if (!vaultPath) return 2;\n const loaded = await loadUserConfig(home);\n const integrations = loaded.value.integrations;\n const nextIntegrations = integrations && typeof integrations === 'object' ? { ...(integrations as object) } : {};\n (nextIntegrations as Record<string, unknown>).obsidian = { vaultPath, board };\n loaded.value.integrations = nextIntegrations;\n await mkdir(dirname(loaded.path), { recursive: true });\n await writeFile(loaded.path, stringify(loaded.value), 'utf8');\n ctx.stdio.stdout.write(`connected ${resolve(vaultPath, board)}\\n`);\n return 0;\n }\n if (args.subVerb === 'status') {\n const resolved = await boardPath(home);\n const cards = parseCards(await readFile(resolved.path, 'utf8'));\n if (args.json) ctx.stdio.stdout.write(`${JSON.stringify({ ...resolved.config, path: resolved.path, cards })}\\n`);\n else\n ctx.stdio.stdout.write(\n `${resolved.path}\\n${cards.map((card) => `${card.id}\\t${card.column}\\t${card.title}`).join('\\n')}\\n`,\n );\n return 0;\n }\n if (args.subVerb === 'move') {\n const [id, stage] = args.positionals;\n const target = stage ? (STAGES.get(stage) ?? stage) : undefined;\n if (!id || !target) return 2;\n const resolved = await boardPath(home);\n const source = await readFile(resolved.path, 'utf8');\n await writeFile(resolved.path, replaceCard(source, id, target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,IAAI,MAAM,GAAG,MAAM;GACtE,IAAI,MAAM,OAAO,MAAM,UAAU,GAAG,MAAM,OAAO,GAAG;GACpD,OAAO;EACT;EACA,OAAO;CACT;AACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
//#region src/commands/review/index.ts
|
|
2
|
-
const review = {
|
|
3
|
-
verb: "review",
|
|
4
|
-
async run(ctx, args) {
|
|
5
|
-
const result = await ctx.controller.send("start", {
|
|
6
|
-
profile: "review",
|
|
7
|
-
unattended: false,
|
|
8
|
-
...args.positionals[0] ? { reviewTarget: { ref: args.positionals[0] } } : {}
|
|
9
|
-
});
|
|
10
|
-
ctx.stdio.stdout.write(`${JSON.stringify(result)}\n`);
|
|
11
|
-
return result.status === "rejected" ? 3 : result.status === "pending" ? 4 : 0;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
//#endregion
|
|
15
|
-
export { review as default };
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=review-BDdjb6kB.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"review-BDdjb6kB.mjs","names":[],"sources":["../../../../apps/cli/src/commands/review/index.ts"],"sourcesContent":["// apps/cli/src/commands/review/index.ts — DESIGN §9 verb `review` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/review/**`.\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst review: CommandModule = {\n verb: 'review',\n async run(ctx, args) {\n const result = await ctx.controller.send('start', {\n profile: 'review',\n unattended: false,\n ...(args.positionals[0] ? { reviewTarget: { ref: args.positionals[0] } } : {}),\n });\n ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default review;\n"],"mappings":";AAMA,MAAM,SAAwB;CAC5B,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,SAAS,MAAM,IAAI,WAAW,KAAK,SAAS;GAChD,SAAS;GACT,YAAY;GACZ,GAAI,KAAK,YAAY,KAAK,EAAE,cAAc,EAAE,KAAK,KAAK,YAAY,GAAG,EAAE,IAAI,CAAC;EAC9E,CAAC;EACD,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;EACpD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-BInPXOcm.mjs","names":[],"sources":["../../../../apps/cli/src/commands/run/index.ts"],"sourcesContent":["// apps/cli/src/commands/run/index.ts — DESIGN §9 verb `run` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/run/**`.\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport { CohorteError, errorOf, type Sha256, sha256Hex } from '@cohorte/base';\nimport { loadConfig, resolveConfig } from '@cohorte/config';\nimport { createKeyStore, createTrustStore } from '@cohorte/security/auth';\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst run: CommandModule = {\n verb: 'run',\n async run(ctx, args) {\n const valueAfter = (flag: string): string | undefined => {\n const index = args.positionals.indexOf(flag);\n return index >= 0 ? args.positionals[index + 1] : undefined;\n };\n const profile = (valueAfter('--profile') ??\n args.positionals.find((value) => ['feature', 'bugfix', 'review'].includes(value)) ??\n 'feature') as 'feature' | 'bugfix' | 'review';\n if (!['feature', 'bugfix', 'review'].includes(profile)) return 2;\n const spec = args.positionals.find(\n (value, index) =>\n !value.startsWith('--') &&\n args.positionals[index - 1] !== '--profile' &&\n args.positionals[index - 1] !== '--runtime' &&\n args.positionals[index - 1] !== '--script' &&\n args.positionals[index - 1] !== '--model' &&\n !['feature', 'bugfix', 'review'].includes(value),\n );\n const model = valueAfter('--model');\n const waitValue = valueAfter('--wait');\n const waitMs = waitValue === undefined ? undefined : Number(waitValue) * 1000;\n if (waitValue !== undefined && (!Number.isFinite(waitMs) || (waitMs as number) < 0)) return 2;\n const trustProjectConfig = args.positionals.includes('--trust-project-config');\n let consent: { policySha256: Sha256; via: 'cli-flag' } | undefined;\n // Test/fake contexts intentionally omit HOME; a real CLI invocation always\n // supplies it and is the only context allowed to resolve project trust.\n if (ctx.env.HOME && existsSync(join(ctx.cwd, '.cohorte', 'config.yaml'))) {\n const home = ctx.env.HOME ?? ctx.cwd;\n const loaded = await loadConfig({ cwd: ctx.cwd, home });\n const keys = createKeyStore({ directory: join(home, '.cohorte', 'keys') });\n const trustStore = createTrustStore({ directory: join(home, '.cohorte', 'trust'), keys });\n const resolved = await resolveConfig(loaded, {\n trustStore,\n projectKeyId: sha256Hex(loaded.projectRoot).slice(0, 24),\n });\n if (resolved.status === 'untrusted' && !trustProjectConfig) {\n throw new CohorteError(\n errorOf(\n 'security/project-policy-untrusted',\n `project policy is untrusted (${resolved.loosenedKeys.join(', ') || 'unknown key'})`,\n ),\n );\n }\n if (resolved.status === 'untrusted') consent = { policySha256: resolved.policySha256, via: 'cli-flag' };\n }\n const payload = {\n profile,\n unattended: false,\n ...(spec ? { spec: { path: spec } } : {}),\n ...(valueAfter('--runtime') ? { runtime: valueAfter('--runtime') as string } : {}),\n ...(valueAfter('--script') ? { fakeScript: valueAfter('--script') as string } : {}),\n ...(model ? { modelOverrides: { implementer: { provider: 'default', model } } } : {}),\n ...(consent ? { consent } : {}),\n };\n const result =\n waitMs === undefined\n ? await ctx.controller.send('start', payload)\n : await ctx.controller.send('start', payload, { waitMs });\n if (result.status === 'pending' && result.result && typeof result.result === 'object' && 'runId' in result.result) {\n const runId = (result.result as { runId?: string }).runId;\n if (runId) await ctx.hostSpawner.spawnDetached(runId);\n }\n if (args.json) ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n else ctx.stdio.stdout.write(`${result.status}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default run;\n"],"mappings":";;;;;;;AAWA,MAAM,MAAqB;CACzB,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,cAAc,SAAqC;GACvD,MAAM,QAAQ,KAAK,YAAY,QAAQ,IAAI;GAC3C,OAAO,SAAS,IAAI,KAAK,YAAY,QAAQ,KAAK,KAAA;EACpD;EACA,MAAM,UAAW,WAAW,WAAW,KACrC,KAAK,YAAY,MAAM,UAAU;GAAC;GAAW;GAAU;EAAQ,CAAC,CAAC,SAAS,KAAK,CAAC,KAChF;EACF,IAAI,CAAC;GAAC;GAAW;GAAU;EAAQ,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;EAC/D,MAAM,OAAO,KAAK,YAAY,MAC3B,OAAO,UACN,CAAC,MAAM,WAAW,IAAI,KACtB,KAAK,YAAY,QAAQ,OAAO,eAChC,KAAK,YAAY,QAAQ,OAAO,eAChC,KAAK,YAAY,QAAQ,OAAO,cAChC,KAAK,YAAY,QAAQ,OAAO,aAChC,CAAC;GAAC;GAAW;GAAU;EAAQ,CAAC,CAAC,SAAS,KAAK,CACnD;EACA,MAAM,QAAQ,WAAW,SAAS;EAClC,MAAM,YAAY,WAAW,QAAQ;EACrC,MAAM,SAAS,cAAc,KAAA,IAAY,KAAA,IAAY,OAAO,SAAS,IAAI;EACzE,IAAI,cAAc,KAAA,MAAc,CAAC,OAAO,SAAS,MAAM,KAAM,SAAoB,IAAI,OAAO;EAC5F,MAAM,qBAAqB,KAAK,YAAY,SAAS,wBAAwB;EAC7E,IAAI;EAGJ,IAAI,IAAI,IAAI,QAAQ,WAAW,KAAK,IAAI,KAAK,YAAY,aAAa,CAAC,GAAG;GACxE,MAAM,OAAO,IAAI,IAAI,QAAQ,IAAI;GACjC,MAAM,SAAS,MAAM,WAAW;IAAE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O,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;OAC9D,IAAI,MAAM,OAAO,MAAM,GAAG,OAAO,OAAO,GAAG;EAChD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
//#region src/commands/ship/index.ts
|
|
2
|
-
const ship = {
|
|
3
|
-
verb: "ship",
|
|
4
|
-
async run(ctx, args) {
|
|
5
|
-
const [runId, approvalId] = args.positionals;
|
|
6
|
-
if (!runId || !approvalId) return 2;
|
|
7
|
-
const result = await ctx.controller.send("approve", {
|
|
8
|
-
approvalId,
|
|
9
|
-
scope: "run",
|
|
10
|
-
answer: "ship"
|
|
11
|
-
}, { runId });
|
|
12
|
-
ctx.stdio.stdout.write(`${JSON.stringify(result)}\n`);
|
|
13
|
-
return result.status === "rejected" ? 3 : result.status === "pending" ? 4 : 0;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
|
-
export { ship as default };
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=ship-DTuLGoaJ.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ship-DTuLGoaJ.mjs","names":[],"sources":["../../../../apps/cli/src/commands/ship/index.ts"],"sourcesContent":["// apps/cli/src/commands/ship/index.ts — DESIGN §9 verb `ship` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/ship/**`.\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst ship: CommandModule = {\n verb: 'ship',\n async run(ctx, args) {\n const [runId, approvalId] = args.positionals;\n if (!runId || !approvalId) return 2;\n const result = await ctx.controller.send(\n 'approve',\n { approvalId: approvalId as never, scope: 'run', answer: 'ship' },\n { runId },\n );\n ctx.stdio.stdout.write(`${JSON.stringify(result)}\\n`);\n return result.status === 'rejected' ? 3 : result.status === 'pending' ? 4 : 0;\n },\n};\n\nexport default ship;\n"],"mappings":";AAMA,MAAM,OAAsB;CAC1B,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,CAAC,OAAO,cAAc,KAAK;EACjC,IAAI,CAAC,SAAS,CAAC,YAAY,OAAO;EAClC,MAAM,SAAS,MAAM,IAAI,WAAW,KAClC,WACA;GAAc;GAAqB,OAAO;GAAO,QAAQ;EAAO,GAChE,EAAE,MAAM,CACV;EACA,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,MAAM,EAAE,GAAG;EACpD,OAAO,OAAO,WAAW,aAAa,IAAI,OAAO,WAAW,YAAY,IAAI;CAC9E;AACF"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { r as loadSpec, t as freezeSpec } from "./src-BnlNkd3S.mjs";
|
|
2
|
-
import { writeFile } from "node:fs/promises";
|
|
3
|
-
import { stringify } from "yaml";
|
|
4
|
-
//#region src/commands/spec/index.ts
|
|
5
|
-
const spec = {
|
|
6
|
-
verb: "spec",
|
|
7
|
-
async run(ctx, args) {
|
|
8
|
-
const file = args.positionals.find((value) => !value.startsWith("--"));
|
|
9
|
-
if (!file) return 2;
|
|
10
|
-
const frozen = args.subVerb === "freeze";
|
|
11
|
-
const value = frozen ? await freezeSpec(file) : await loadSpec(file);
|
|
12
|
-
if (frozen) await writeFile(file, stringify(value));
|
|
13
|
-
ctx.stdio.stdout.write(`${JSON.stringify(value)}\n`);
|
|
14
|
-
return 0;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { spec as default };
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=spec-MVP9y8dN.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"spec-MVP9y8dN.mjs","names":[],"sources":["../../../../apps/cli/src/commands/spec/index.ts"],"sourcesContent":["// apps/cli/src/commands/spec/index.ts — DESIGN §9 verb `spec` (PLAN §3 rule 3 \"later units fill\n// stub files that lie inside their owned paths; they never edit ... the registry\"). Wave-0 stub: exits with the\n// documented not-available error (spec 24 `configuration/phase-not-available`); filled by the Wave-4/5\n// unit that owns `apps/cli/src/commands/spec/**`.\nimport { writeFile } from 'node:fs/promises';\nimport { freezeSpec, loadSpec } from '@cohorte/config';\nimport { stringify } from 'yaml';\nimport type { CommandModule } from '../../contract/index.ts';\n\nconst spec: CommandModule = {\n verb: 'spec',\n async run(ctx, args) {\n const file = args.positionals.find((value) => !value.startsWith('--'));\n if (!file) return 2;\n const frozen = args.subVerb === 'freeze';\n const value = frozen ? await freezeSpec(file) : await loadSpec(file);\n if (frozen) await writeFile(file, stringify(value));\n ctx.stdio.stdout.write(`${JSON.stringify(value)}\\n`);\n return 0;\n },\n};\n\nexport default spec;\n"],"mappings":";;;;AASA,MAAM,OAAsB;CAC1B,MAAM;CACN,MAAM,IAAI,KAAK,MAAM;EACnB,MAAM,OAAO,KAAK,YAAY,MAAM,UAAU,CAAC,MAAM,WAAW,IAAI,CAAC;EACrE,IAAI,CAAC,MAAM,OAAO;EAClB,MAAM,SAAS,KAAK,YAAY;EAChC,MAAM,QAAQ,SAAS,MAAM,WAAW,IAAI,IAAI,MAAM,SAAS,IAAI;EACnE,IAAI,QAAQ,MAAM,UAAU,MAAM,UAAU,KAAK,CAAC;EAClD,IAAI,MAAM,OAAO,MAAM,GAAG,KAAK,UAAU,KAAK,EAAE,GAAG;EACnD,OAAO;CACT;AACF"}
|