@cleocode/cleo 2026.5.83 → 2026.5.84

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/dist/cli/index.js CHANGED
@@ -268,16 +268,6 @@ async function runCommand(cmd, opts) {
268
268
  }
269
269
  return { result };
270
270
  }
271
- async function resolveSubCommand(cmd, rawArgs, parent) {
272
- const subCommands2 = await resolveValue(cmd.subCommands);
273
- if (subCommands2 && Object.keys(subCommands2).length > 0) {
274
- const subCommandArgIndex = rawArgs.findIndex((arg) => !arg.startsWith("-"));
275
- const subCommandName = rawArgs[subCommandArgIndex];
276
- const subCommand = await resolveValue(subCommands2[subCommandName]);
277
- if (subCommand) return resolveSubCommand(subCommand, rawArgs.slice(subCommandArgIndex + 1), cmd);
278
- }
279
- return [cmd, parent];
280
- }
281
271
  async function showUsage(cmd, parent) {
282
272
  try {
283
273
  console.log(await renderUsage(cmd, parent) + "\n");
@@ -347,26 +337,6 @@ async function renderUsage(cmd, parent) {
347
337
  }
348
338
  return usageLines.filter((l) => typeof l === "string").join("\n");
349
339
  }
350
- async function runMain(cmd, opts = {}) {
351
- const rawArgs = opts.rawArgs || process.argv.slice(2);
352
- const showUsage$1 = opts.showUsage || showUsage;
353
- try {
354
- if (rawArgs.includes("--help") || rawArgs.includes("-h")) {
355
- await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
356
- process.exit(0);
357
- } else if (rawArgs.length === 1 && rawArgs[0] === "--version") {
358
- const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
359
- if (!meta?.version) throw new CLIError("No version specified", "E_NO_VERSION");
360
- console.log(meta.version);
361
- } else await runCommand(cmd, { rawArgs });
362
- } catch (error) {
363
- if (error instanceof CLIError) {
364
- await showUsage$1(...await resolveSubCommand(cmd, rawArgs));
365
- console.error(error.message);
366
- } else console.error(error, "\n");
367
- process.exit(1);
368
- }
369
- }
370
340
  var CLIError, noColor, _c, bold, cyan, gray, underline, negativePrefixRe;
371
341
  var init_dist = __esm({
372
342
  "node_modules/.pnpm/citty@0.2.1/node_modules/citty/dist/index.mjs"() {
@@ -9063,6 +9033,25 @@ var init_registry = __esm({
9063
9033
  }
9064
9034
  ]
9065
9035
  },
9036
+ {
9037
+ gateway: "query",
9038
+ domain: "pipeline",
9039
+ operation: "release.pr-status",
9040
+ description: "Poll GitHub CI check statuses for the open release PR matching release/v<version> (T9095)",
9041
+ tier: 1,
9042
+ idempotent: true,
9043
+ sessionRequired: false,
9044
+ requiredParams: ["version"],
9045
+ params: [
9046
+ {
9047
+ name: "version",
9048
+ type: "string",
9049
+ required: true,
9050
+ description: "Release version (e.g. 2026.5.43 or v2026.5.43)",
9051
+ cli: { positional: true }
9052
+ }
9053
+ ]
9054
+ },
9066
9055
  // release.prepare/changelog/commit/tag/push/gates.run removed — merged into release.ship via step param (T5615)
9067
9056
  {
9068
9057
  gateway: "mutate",
@@ -27375,6 +27364,7 @@ var init_pipeline3 = __esm({
27375
27364
  "release.show",
27376
27365
  "release.channel.show",
27377
27366
  "release.changelog.since",
27367
+ "release.pr-status",
27378
27368
  "phase.show",
27379
27369
  "phase.list",
27380
27370
  "chain.show",
@@ -41102,7 +41092,10 @@ import {
41102
41092
  publishDocs,
41103
41093
  rankDocs,
41104
41094
  readJson,
41105
- searchDocs as searchDocs2
41095
+ recordPublication,
41096
+ searchDocs as searchDocs2,
41097
+ statusDocs,
41098
+ syncFromGit
41106
41099
  } from "@cleocode/core/internal";
41107
41100
  async function getScriptNames(projectRoot) {
41108
41101
  const scriptsDir = join14(projectRoot, "scripts");
@@ -41166,7 +41159,7 @@ async function runGapCheck(_projectRoot, filterId) {
41166
41159
  }
41167
41160
  return results;
41168
41161
  }
41169
- var addCommand4, listCommand7, fetchCommand, removeCommand2, generateCommand, exportCommand4, searchCommand, mergeCommand, graphCommand, rankCommand, versionsCommand, publishCommand2, syncCommand3, gapCheckCommand, docsCommand;
41162
+ var addCommand4, listCommand7, fetchCommand, removeCommand2, generateCommand, exportCommand4, searchCommand, mergeCommand, graphCommand, rankCommand, versionsCommand, publishCommand2, syncCommand3, statusCommand6, gapCheckCommand, docsCommand;
41170
41163
  var init_docs3 = __esm({
41171
41164
  "packages/cleo/src/cli/commands/docs.ts"() {
41172
41165
  "use strict";
@@ -41718,30 +41711,87 @@ var init_docs3 = __esm({
41718
41711
  attachmentId: args.attachment ?? void 0,
41719
41712
  projectRoot
41720
41713
  });
41714
+ try {
41715
+ await recordPublication({
41716
+ ownerId: result.ownerId,
41717
+ blobName: result.blobName,
41718
+ publishedPath: result.relativePath,
41719
+ lastBlobSha: result.blobSha256,
41720
+ projectRoot
41721
+ });
41722
+ } catch {
41723
+ }
41721
41724
  cliOutput(result, { command: "docs publish", operation: "docs.publish" });
41722
41725
  } catch (err) {
41723
41726
  const message = err instanceof Error ? err.message : String(err);
41724
- cliOutput(
41725
- formatError5(new CleoError3(1 /* GENERAL_ERROR */, `docs publish failed: ${message}`)),
41726
- { command: "docs publish", operation: "docs.publish" }
41727
- );
41727
+ cliError(`docs publish failed: ${message}`, 1 /* GENERAL_ERROR */, {
41728
+ name: "E_DOCS_PUBLISH_FAILED"
41729
+ });
41728
41730
  process.exit(1 /* GENERAL_ERROR */);
41729
41731
  }
41730
41732
  }
41731
41733
  });
41732
41734
  syncCommand3 = defineCommand({
41733
- meta: { name: "sync", description: "Run drift detection between scripts and docs index" },
41735
+ meta: {
41736
+ name: "sync",
41737
+ description: "Bidirectional docs sync. Use --from <path> --for <ownerId> to ingest a git file as a new blob version. Without --from, runs the legacy drift check between scripts/ and COMMANDS-INDEX.json."
41738
+ },
41734
41739
  args: {
41740
+ from: {
41741
+ type: "string",
41742
+ description: "Git-tracked file path to ingest as a new blob version (triggers reverse-ingest mode)"
41743
+ },
41744
+ for: {
41745
+ type: "string",
41746
+ description: "Owner entity ID for reverse-ingest mode (T###, ses_*, O-*). Required when --from is set."
41747
+ },
41748
+ name: {
41749
+ type: "string",
41750
+ description: "Override the blob name used in the manifest. Default: basename of --from."
41751
+ },
41752
+ "content-type": {
41753
+ type: "string",
41754
+ description: "IANA MIME type recorded with the new blob version (default: application/octet-stream)"
41755
+ },
41735
41756
  quick: {
41736
41757
  type: "boolean",
41737
- description: "Quick check (commands only)"
41758
+ description: "Legacy mode only: quick check (commands only)"
41738
41759
  },
41739
41760
  strict: {
41740
41761
  type: "boolean",
41741
- description: "Exit with error on any drift"
41762
+ description: "Legacy mode only: exit with error on any drift"
41742
41763
  }
41743
41764
  },
41744
41765
  async run({ args }) {
41766
+ if (args.from) {
41767
+ const projectRoot = getProjectRoot27();
41768
+ const ownerId = args.for ?? void 0;
41769
+ if (!ownerId) {
41770
+ cliError(
41771
+ "--for <ownerId> is required when --from <path> is set",
41772
+ 6 /* VALIDATION_ERROR */,
41773
+ { name: "E_VALIDATION" }
41774
+ );
41775
+ process.exit(6 /* VALIDATION_ERROR */);
41776
+ }
41777
+ try {
41778
+ const result = await syncFromGit({
41779
+ ownerId: String(ownerId),
41780
+ fromPath: String(args.from),
41781
+ blobName: args.name ?? void 0,
41782
+ contentType: args["content-type"] ?? void 0,
41783
+ projectRoot
41784
+ });
41785
+ cliOutput(result, { command: "docs sync", operation: "docs.sync" });
41786
+ } catch (err) {
41787
+ const message = err instanceof Error ? err.message : String(err);
41788
+ cliError(`docs sync failed: ${message}`, 1 /* GENERAL_ERROR */, {
41789
+ name: "E_DOCS_SYNC_FAILED"
41790
+ });
41791
+ process.exit(1 /* GENERAL_ERROR */);
41792
+ }
41793
+ return;
41794
+ }
41745
41795
  try {
41746
41796
  const projectRoot = process.cwd();
41747
41797
  const result = await detectDrift(projectRoot);
@@ -41769,6 +41819,34 @@ var init_docs3 = __esm({
41769
41819
  }
41770
41820
  }
41771
41821
  });
41822
+ statusCommand6 = defineCommand({
41823
+ meta: {
41824
+ name: "status",
41825
+ description: "Compare published files on disk against the docs SSoT and report drift. Exits 0 when all entries are in-sync, 2 when any drift is present."
41826
+ },
41827
+ args: {
41828
+ json: {
41829
+ type: "boolean",
41830
+ description: "Emit LAFS JSON envelope"
41831
+ }
41832
+ },
41833
+ async run() {
41834
+ const projectRoot = getProjectRoot27();
41835
+ try {
41836
+ const result = await statusDocs({ projectRoot });
41837
+ cliOutput(result, { command: "docs status", operation: "docs.status" });
41838
+ if (!result.allInSync) {
41839
+ process.exit(2);
41840
+ }
41841
+ } catch (err) {
41842
+ const message = err instanceof Error ? err.message : String(err);
41843
+ cliError(`docs status failed: ${message}`, 1 /* GENERAL_ERROR */, {
41844
+ name: "E_DOCS_STATUS_FAILED"
41845
+ });
41846
+ process.exit(1 /* GENERAL_ERROR */);
41847
+ }
41848
+ }
41849
+ });
41772
41850
  gapCheckCommand = defineCommand({
41773
41851
  meta: {
41774
41852
  name: "gap-check",
@@ -41812,7 +41890,7 @@ var init_docs3 = __esm({
41812
41890
  docsCommand = defineCommand({
41813
41891
  meta: {
41814
41892
  name: "docs",
41815
- description: "Documentation attachment management (add/list/fetch/remove), llmtxt primitives (search/merge/graph/rank/versions/publish), and drift detection (sync/gap-check)"
41893
+ description: "Documentation attachment management (add/list/fetch/remove), llmtxt primitives (search/merge/graph/rank/versions/publish), and drift detection (sync/status/gap-check)"
41816
41894
  },
41817
41895
  subCommands: {
41818
41896
  add: addCommand4,
@@ -41828,6 +41906,7 @@ var init_docs3 = __esm({
41828
41906
  versions: versionsCommand,
41829
41907
  publish: publishCommand2,
41830
41908
  sync: syncCommand3,
41909
+ status: statusCommand6,
41831
41910
  "gap-check": gapCheckCommand
41832
41911
  },
41833
41912
  async run({ cmd, rawArgs }) {
@@ -43490,7 +43569,7 @@ function formatBytes(bytes) {
43490
43569
  const value = bytes / 1024 ** exp;
43491
43570
  return `${value.toFixed(exp === 0 ? 0 : 1)} ${units[exp] ?? "B"}`;
43492
43571
  }
43493
- var runCommand2, statusCommand6, worktreesCommand, tempCommand, gcCommand;
43572
+ var runCommand2, statusCommand7, worktreesCommand, tempCommand, gcCommand;
43494
43573
  var init_gc = __esm({
43495
43574
  "packages/cleo/src/cli/commands/gc.ts"() {
43496
43575
  "use strict";
@@ -43543,7 +43622,7 @@ var init_gc = __esm({
43543
43622
  }
43544
43623
  }
43545
43624
  });
43546
- statusCommand6 = defineCommand({
43625
+ statusCommand7 = defineCommand({
43547
43626
  meta: {
43548
43627
  name: "status",
43549
43628
  description: "Show last GC run stats, disk usage, and escalation state"
@@ -43706,7 +43785,7 @@ var init_gc = __esm({
43706
43785
  },
43707
43786
  subCommands: {
43708
43787
  run: runCommand2,
43709
- status: statusCommand6,
43788
+ status: statusCommand7,
43710
43789
  worktrees: worktreesCommand,
43711
43790
  temp: tempCommand
43712
43791
  },
@@ -44005,7 +44084,7 @@ function applyJsonFlag(jsonFlag) {
44005
44084
  setFormatContext({ format: "json", source: "flag", quiet: false });
44006
44085
  }
44007
44086
  }
44008
- var statusCommand7, resolveCommand, depsCommand2, rawCommand, discoverCommand, searchCommand2, augmentCommand, contextCommand2, impactCommand2, impactFullCommand, clustersCommand, flowsCommand, diffCommand, routeMapCommand, shapeCheckCommand, searchCodeCommand, wikiCommand, hotPathsCommand, hotNodesCommand, coldSymbolsCommand, orphansCommand, queryCommand, initCommand, syncCommand4, reconcileCommand, livingFullContextCommand, livingTaskFootprintCommand, livingBrainAnchorsCommand, livingWhyCommand, livingConduitScanCommand, livingCommand, graphCommand2;
44087
+ var statusCommand8, resolveCommand, depsCommand2, rawCommand, discoverCommand, searchCommand2, augmentCommand, contextCommand2, impactCommand2, impactFullCommand, clustersCommand, flowsCommand, diffCommand, routeMapCommand, shapeCheckCommand, searchCodeCommand, wikiCommand, hotPathsCommand, hotNodesCommand, coldSymbolsCommand, orphansCommand, queryCommand, initCommand, syncCommand4, reconcileCommand, livingFullContextCommand, livingTaskFootprintCommand, livingBrainAnchorsCommand, livingWhyCommand, livingConduitScanCommand, livingCommand, graphCommand2;
44009
44088
  var init_graph2 = __esm({
44010
44089
  "packages/cleo/src/cli/commands/graph.ts"() {
44011
44090
  "use strict";
@@ -44013,7 +44092,7 @@ var init_graph2 = __esm({
44013
44092
  init_cli();
44014
44093
  init_format_context();
44015
44094
  init_renderers();
44016
- statusCommand7 = defineCommand({
44095
+ statusCommand8 = defineCommand({
44017
44096
  meta: {
44018
44097
  name: "status",
44019
44098
  description: "Show code intelligence index freshness: file count, node/relation counts, last indexed time."
@@ -44800,7 +44879,7 @@ var init_graph2 = __esm({
44800
44879
  description: "Project-scoped code intelligence: symbol graph, impact analysis, clusters, flows"
44801
44880
  },
44802
44881
  subCommands: {
44803
- status: statusCommand7,
44882
+ status: statusCommand8,
44804
44883
  resolve: resolveCommand,
44805
44884
  deps: depsCommand2,
44806
44885
  raw: rawCommand,
@@ -49723,7 +49802,7 @@ function applyJsonFlag2(jsonFlag) {
49723
49802
  setFormatContext({ format: "json", source: "flag", quiet: false });
49724
49803
  }
49725
49804
  }
49726
- var initCommand3, registerCommand2, unregisterCommand, listCommand12, statusCommand8, showCommand8, resolveCommand2, discoverCommand2, augmentCommand2, setupCommand, searchCommand3, depsCommand3, criticalPathCommand2, blockingCommand, orphansCommand2, syncCommand5, reconcileCommand2, graphCommand3, shareStatusCommand, transferPreviewCommand, transferCommand, permissionSetCommand, permissionCommand, shareExportCommand, shareImportCommand, shareCommand, clustersCommand2, flowsCommand2, contextCommand4, impactCommand3, analyzeCommand3, projectsListCommand, projectsRegisterCommand, projectsRemoveCommand, projectsScanCommand, projectsCleanCommand, projectsCommand, refreshBridgeCommand, exportCommand6, diffCommand2, queryCommand2, routeMapCommand2, shapeCheckCommand2, fullContextCommand, taskFootprintCommand, brainAnchorsCommand, whyCommand, impactFullCommand2, conduitScanCommand, taskSymbolsCommand, searchCodeCommand2, contractsSyncCommand, contractsShowCommand, contractsLinkTasksCommand, contractsCommand, groupCommand, wikiCommand2, hotPathsCommand2, hotNodesCommand2, coldSymbolsCommand2, sigilSyncCommand, sigilListCommand, sigilCommand, topEntriesCommand, nexusCommand;
49805
+ var initCommand3, registerCommand2, unregisterCommand, listCommand12, statusCommand9, showCommand8, resolveCommand2, discoverCommand2, augmentCommand2, setupCommand, searchCommand3, depsCommand3, criticalPathCommand2, blockingCommand, orphansCommand2, syncCommand5, reconcileCommand2, graphCommand3, shareStatusCommand, transferPreviewCommand, transferCommand, permissionSetCommand, permissionCommand, shareExportCommand, shareImportCommand, shareCommand, clustersCommand2, flowsCommand2, contextCommand4, impactCommand3, analyzeCommand3, projectsListCommand, projectsRegisterCommand, projectsRemoveCommand, projectsScanCommand, projectsCleanCommand, projectsCommand, refreshBridgeCommand, exportCommand6, diffCommand2, queryCommand2, routeMapCommand2, shapeCheckCommand2, fullContextCommand, taskFootprintCommand, brainAnchorsCommand, whyCommand, impactFullCommand2, conduitScanCommand, taskSymbolsCommand, searchCodeCommand2, contractsSyncCommand, contractsShowCommand, contractsLinkTasksCommand, contractsCommand, groupCommand, wikiCommand2, hotPathsCommand2, hotNodesCommand2, coldSymbolsCommand2, sigilSyncCommand, sigilListCommand, sigilCommand, topEntriesCommand, nexusCommand;
49727
49806
  var init_nexus4 = __esm({
49728
49807
  "packages/cleo/src/cli/commands/nexus.ts"() {
49729
49808
  "use strict";
@@ -49795,7 +49874,7 @@ var init_nexus4 = __esm({
49795
49874
  await dispatchFromCli("query", "nexus", "list", {}, { command: "nexus" });
49796
49875
  }
49797
49876
  });
49798
- statusCommand8 = defineCommand({
49877
+ statusCommand9 = defineCommand({
49799
49878
  meta: {
49800
49879
  name: "status",
49801
49880
  description: "Show code intelligence index freshness: file count, node/relation counts, last indexed time, stale files. Falls back to NEXUS registry status if code-intelligence index is unavailable."
@@ -52224,7 +52303,7 @@ var init_nexus4 = __esm({
52224
52303
  register: registerCommand2,
52225
52304
  unregister: unregisterCommand,
52226
52305
  list: listCommand12,
52227
- status: statusCommand8,
52306
+ status: statusCommand9,
52228
52307
  show: showCommand8,
52229
52308
  resolve: resolveCommand2,
52230
52309
  discover: discoverCommand2,
@@ -52363,7 +52442,7 @@ function formatRollupTable(rollup) {
52363
52442
  }
52364
52443
  return lines.join("\n");
52365
52444
  }
52366
- var rollupCommand, startCommand5, statusCommand9, analyzeCommand4, readyCommand, nextCommand2, wavesCommand2, planCommand, spawnCommand2, validateCommand6, contextCommand5, ivtrCommand, parallelCommand, tesseraListCommand, tesseraInstantiateCommand, tesseraCommand, unblockCommand, bootstrapCommand, classifyCommand, fanoutStatusCommand, handoffCommand, spawnExecuteCommand, fanoutCommand, pruneCommand, worktreeCompleteCommand, conduitStatusCommand, conduitPeekCommand, conduitStartCommand, conduitStopCommand, approveCommand, rejectCommand, pendingCommand, conduitSendCommand, orchestrateCommand;
52445
+ var rollupCommand, startCommand5, statusCommand10, analyzeCommand4, readyCommand, nextCommand2, wavesCommand2, planCommand, spawnCommand2, validateCommand6, contextCommand5, ivtrCommand, parallelCommand, tesseraListCommand, tesseraInstantiateCommand, tesseraCommand, unblockCommand, bootstrapCommand, classifyCommand, fanoutStatusCommand, handoffCommand, spawnExecuteCommand, fanoutCommand, pruneCommand, worktreeCompleteCommand, conduitStatusCommand, conduitPeekCommand, conduitStartCommand, conduitStopCommand, approveCommand, rejectCommand, pendingCommand, conduitSendCommand, orchestrateCommand;
52367
52446
  var init_orchestrate3 = __esm({
52368
52447
  "packages/cleo/src/cli/commands/orchestrate.ts"() {
52369
52448
  "use strict";
@@ -52415,7 +52494,7 @@ var init_orchestrate3 = __esm({
52415
52494
  );
52416
52495
  }
52417
52496
  });
52418
- statusCommand9 = defineCommand({
52497
+ statusCommand10 = defineCommand({
52419
52498
  meta: { name: "status", description: "Get orchestration status for an epic or overall project" },
52420
52499
  args: {
52421
52500
  epic: {
@@ -53159,7 +53238,7 @@ var init_orchestrate3 = __esm({
53159
53238
  meta: { name: "orchestrate", description: "Multi-agent orchestration commands" },
53160
53239
  subCommands: {
53161
53240
  start: startCommand5,
53162
- status: statusCommand9,
53241
+ status: statusCommand10,
53163
53242
  "roll-up": rollupCommand,
53164
53243
  analyze: analyzeCommand4,
53165
53244
  ready: readyCommand,
@@ -53215,13 +53294,13 @@ import {
53215
53294
  getOtelSummary,
53216
53295
  getRealTokenUsage
53217
53296
  } from "@cleocode/core/internal";
53218
- var statusCommand10, summaryCommand2, sessionsCommand, spawnsCommand, realCommand, clearCommand, otelCommand;
53297
+ var statusCommand11, summaryCommand2, sessionsCommand, spawnsCommand, realCommand, clearCommand, otelCommand;
53219
53298
  var init_otel = __esm({
53220
53299
  "packages/cleo/src/cli/commands/otel.ts"() {
53221
53300
  "use strict";
53222
53301
  init_dist();
53223
53302
  init_renderers();
53224
- statusCommand10 = defineCommand({
53303
+ statusCommand11 = defineCommand({
53225
53304
  meta: { name: "status", description: "Show token tracking status and recent activity" },
53226
53305
  async run() {
53227
53306
  try {
@@ -53356,7 +53435,7 @@ var init_otel = __esm({
53356
53435
  description: "Lightweight token metrics from .cleo/metrics/TOKEN_USAGE.jsonl (session-level, spawn-level events)"
53357
53436
  },
53358
53437
  subCommands: {
53359
- status: statusCommand10,
53438
+ status: statusCommand11,
53360
53439
  summary: summaryCommand2,
53361
53440
  sessions: sessionsCommand,
53362
53441
  spawns: spawnsCommand,
@@ -53661,7 +53740,7 @@ var playbook_exports = {};
53661
53740
  __export(playbook_exports, {
53662
53741
  playbookCommand: () => playbookCommand
53663
53742
  });
53664
- var runCommand3, statusCommand11, resumeCommand, createCommand2, listCommand14, validateCommand7, playbookCommand;
53743
+ var runCommand3, statusCommand12, resumeCommand, createCommand2, listCommand14, validateCommand7, playbookCommand;
53665
53744
  var init_playbook3 = __esm({
53666
53745
  "packages/cleo/src/cli/commands/playbook.ts"() {
53667
53746
  "use strict";
@@ -53693,7 +53772,7 @@ var init_playbook3 = __esm({
53693
53772
  );
53694
53773
  }
53695
53774
  });
53696
- statusCommand11 = defineCommand({
53775
+ statusCommand12 = defineCommand({
53697
53776
  meta: {
53698
53777
  name: "status",
53699
53778
  description: "Return the current state of a playbook run from playbook_runs"
@@ -53850,7 +53929,7 @@ var init_playbook3 = __esm({
53850
53929
  },
53851
53930
  subCommands: {
53852
53931
  run: runCommand3,
53853
- status: statusCommand11,
53932
+ status: statusCommand12,
53854
53933
  resume: resumeCommand,
53855
53934
  list: listCommand14,
53856
53935
  create: createCommand2,
@@ -54690,18 +54769,34 @@ var init_release3 = __esm({
54690
54769
  description: "Generate CHANGELOG from git log since a given tag, with task/epic grouping"
54691
54770
  },
54692
54771
  args: {
54772
+ sinceTag: {
54773
+ type: "positional",
54774
+ description: "Git tag or ref to generate changelog from (e.g. v2026.4.75)",
54775
+ required: false
54776
+ },
54693
54777
  since: {
54694
54778
  type: "string",
54695
- description: "Git tag or ref to generate changelog from (e.g. v2026.4.75)",
54696
- required: true
54779
+ description: "Git tag or ref to generate changelog from (e.g. v2026.4.75). Alias for the positional argument.",
54780
+ required: false
54697
54781
  }
54698
54782
  },
54699
54783
  async run({ args }) {
54784
+ const sinceTag = typeof args["sinceTag"] === "string" && args["sinceTag"].length > 0 ? args["sinceTag"] : typeof args["since"] === "string" && args["since"].length > 0 ? args["since"] : void 0;
54785
+ if (sinceTag === void 0) {
54786
+ cliError(
54787
+ "Missing required argument: <sinceTag> (or --since)",
54788
+ 2,
54789
+ { name: "E_MISSING_ARGUMENT", fix: "Run: cleo release changelog <tag>" },
54790
+ { operation: "release.changelog.since" }
54791
+ );
54792
+ process.exit(2);
54793
+ return;
54794
+ }
54700
54795
  await dispatchFromCli(
54701
54796
  "query",
54702
54797
  "pipeline",
54703
54798
  "release.changelog.since",
54704
- { sinceTag: args.since },
54799
+ { sinceTag },
54705
54800
  { command: "release" }
54706
54801
  );
54707
54802
  }
@@ -54915,8 +55010,21 @@ var init_release3 = __esm({
54915
55010
  fromWorkflow: args["from-workflow"] === true,
54916
55011
  rollback: args.rollback === true
54917
55012
  });
54918
- cliOutput(result, { command: "release", operation: "release.reconcile" });
54919
- if (!result.success) process.exit(1);
55013
+ if (result.success) {
55014
+ cliOutput(result.data, { command: "release", operation: "release.reconcile" });
55015
+ return;
55016
+ }
55017
+ cliError(
55018
+ result.error.message,
55019
+ result.error.code,
55020
+ {
55021
+ name: result.error.code,
55022
+ ...result.error.details ? { details: result.error.details } : {},
55023
+ ...result.error.fix ? { fix: result.error.fix } : {}
55024
+ },
55025
+ { operation: "release.reconcile" }
55026
+ );
55027
+ process.exit(1);
54920
55028
  }
54921
55029
  });
54922
55030
  releaseCommand = defineCommand({
@@ -58144,7 +58252,7 @@ async function promptOwnerAuthPassword(sessionName) {
58144
58252
  const token = deriveOwnerAuthToken(sessionName, password);
58145
58253
  return token;
58146
58254
  }
58147
- var startCommand7, endCommand, handoffCommand2, statusCommand12, resumeCommand2, findCommand6, listCommand21, gcCommand2, showCommand13, driftCommand, contextDriftCommand, suspendCommand, recordAssumptionCommand, recordDecisionCommand, decisionLogCommand, sessionCommand;
58255
+ var startCommand7, endCommand, handoffCommand2, statusCommand13, resumeCommand2, findCommand6, listCommand21, gcCommand2, showCommand13, driftCommand, contextDriftCommand, suspendCommand, recordAssumptionCommand, recordDecisionCommand, decisionLogCommand, sessionCommand;
58148
58256
  var init_session4 = __esm({
58149
58257
  "packages/cleo/src/cli/commands/session.ts"() {
58150
58258
  "use strict";
@@ -58332,7 +58440,7 @@ var init_session4 = __esm({
58332
58440
  );
58333
58441
  }
58334
58442
  });
58335
- statusCommand12 = defineCommand({
58443
+ statusCommand13 = defineCommand({
58336
58444
  meta: { name: "status", description: "Show current session status" },
58337
58445
  async run() {
58338
58446
  const response = await dispatchRaw("query", "session", "status");
@@ -58672,7 +58780,7 @@ var init_session4 = __esm({
58672
58780
  end: endCommand,
58673
58781
  stop: endCommand,
58674
58782
  handoff: handoffCommand2,
58675
- status: statusCommand12,
58783
+ status: statusCommand13,
58676
58784
  resume: resumeCommand2,
58677
58785
  find: findCommand6,
58678
58786
  list: listCommand21,
@@ -59299,7 +59407,8 @@ var skills_exports = {};
59299
59407
  __export(skills_exports, {
59300
59408
  skillsCommand: () => skillsCommand2
59301
59409
  });
59302
- var listCommand22, searchCommand4, validateCommand8, infoCommand, installCommand3, uninstallCommand2, enableCommand2, disableCommand2, refreshCommand, dispatchCommand, catalogCommand, precedenceCommand, depsCommand4, spawnProvidersCommand, skillsCommand2;
59410
+ import { AgentsSkillsRealDirError, runDoctorBridge } from "@cleocode/caamp";
59411
+ var listCommand22, searchCommand4, validateCommand8, infoCommand, installCommand3, uninstallCommand2, enableCommand2, disableCommand2, refreshCommand, dispatchCommand, catalogCommand, precedenceCommand, depsCommand4, doctorBridgeCommand, doctorCommand4, spawnProvidersCommand, skillsCommand2;
59303
59412
  var init_skills2 = __esm({
59304
59413
  "packages/cleo/src/cli/commands/skills.ts"() {
59305
59414
  "use strict";
@@ -59600,6 +59709,72 @@ var init_skills2 = __esm({
59600
59709
  );
59601
59710
  }
59602
59711
  });
59712
+ doctorBridgeCommand = defineCommand({
59713
+ meta: {
59714
+ name: "bridge",
59715
+ description: "Create the single ~/.agents/skills bridge symlink + remove orphan per-skill symlinks"
59716
+ },
59717
+ args: {
59718
+ force: {
59719
+ type: "boolean",
59720
+ description: "Back up and replace a real ~/.agents/skills directory if present"
59721
+ },
59722
+ "dry-run": {
59723
+ type: "boolean",
59724
+ description: "Print planned actions without mutating disk state"
59725
+ },
59726
+ json: {
59727
+ type: "boolean",
59728
+ description: "Output as JSON (default)"
59729
+ },
59730
+ human: {
59731
+ type: "boolean",
59732
+ description: "Output in human-readable format"
59733
+ }
59734
+ },
59735
+ async run({ args }) {
59736
+ const { cliError: cliError2, cliOutput: cliOutput2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
59737
+ try {
59738
+ const result = await runDoctorBridge({
59739
+ force: args.force === true,
59740
+ dryRun: args["dry-run"] === true
59741
+ });
59742
+ cliOutput2(
59743
+ { success: true, data: result },
59744
+ { command: "skills doctor bridge", operation: "skills.doctor.bridge" }
59745
+ );
59746
+ } catch (error) {
59747
+ if (error instanceof AgentsSkillsRealDirError) {
59748
+ cliError2(
59749
+ error.message,
59750
+ error.code,
59751
+ {
59752
+ details: {
59753
+ agentsSkillsPath: error.agentsSkillsPath,
59754
+ entryCount: error.entryCount
59755
+ }
59756
+ },
59757
+ { operation: "skills.doctor.bridge" }
59758
+ );
59759
+ process.exit(1);
59760
+ }
59761
+ const message = error instanceof Error ? error.message : String(error);
59762
+ cliError2(message, "E_INTERNAL_ERROR", void 0, {
59763
+ operation: "skills.doctor.bridge"
59764
+ });
59765
+ process.exit(1);
59766
+ }
59767
+ }
59768
+ });
59769
+ doctorCommand4 = defineCommand({
59770
+ meta: {
59771
+ name: "doctor",
59772
+ description: "Diagnose and repair the skill storage topology"
59773
+ },
59774
+ subCommands: {
59775
+ bridge: doctorBridgeCommand
59776
+ }
59777
+ });
59603
59778
  spawnProvidersCommand = defineCommand({
59604
59779
  meta: { name: "spawn-providers", description: "List providers capable of spawning subagents" },
59605
59780
  args: {
@@ -59634,7 +59809,8 @@ var init_skills2 = __esm({
59634
59809
  catalog: catalogCommand,
59635
59810
  precedence: precedenceCommand,
59636
59811
  deps: depsCommand4,
59637
- "spawn-providers": spawnProvidersCommand
59812
+ "spawn-providers": spawnProvidersCommand,
59813
+ doctor: doctorCommand4
59638
59814
  },
59639
59815
  async run({ cmd, rawArgs }) {
59640
59816
  if (isSubCommandDispatch(rawArgs, cmd.subCommands)) return;
@@ -59862,7 +60038,7 @@ var init_stats = __esm({
59862
60038
  // packages/cleo/src/cli/commands/status.ts
59863
60039
  var status_exports = {};
59864
60040
  __export(status_exports, {
59865
- statusCommand: () => statusCommand13
60041
+ statusCommand: () => statusCommand14
59866
60042
  });
59867
60043
  import { getCleoStatus } from "@cleocode/core/status";
59868
60044
  function formatEpoch(epoch) {
@@ -59948,7 +60124,7 @@ function computeExitCode(status) {
59948
60124
  const hasInvalid = status.credentials.some((c) => c.lastStatus === "invalid");
59949
60125
  return hasInvalid ? 1 : 0;
59950
60126
  }
59951
- var statusCommand13;
60127
+ var statusCommand14;
59952
60128
  var init_status = __esm({
59953
60129
  "packages/cleo/src/cli/commands/status.ts"() {
59954
60130
  "use strict";
@@ -59956,7 +60132,7 @@ var init_status = __esm({
59956
60132
  init_format_context();
59957
60133
  init_colors();
59958
60134
  init_renderers();
59959
- statusCommand13 = defineCommand({
60135
+ statusCommand14 = defineCommand({
59960
60136
  meta: {
59961
60137
  name: "status",
59962
60138
  description: "Unified config + credential + session + harness + daemon snapshot. Use --json for the full LAFS envelope (CleoStatus interface). Exits non-zero when any credential is in invalid state."
@@ -60573,7 +60749,7 @@ var testing_exports = {};
60573
60749
  __export(testing_exports, {
60574
60750
  testingCommand: () => testingCommand
60575
60751
  });
60576
- var validateCommand9, checkCommand7, statusCommand14, coverageCommand, runCommand4, testingCommand;
60752
+ var validateCommand9, checkCommand7, statusCommand15, coverageCommand, runCommand4, testingCommand;
60577
60753
  var init_testing = __esm({
60578
60754
  "packages/cleo/src/cli/commands/testing.ts"() {
60579
60755
  "use strict";
@@ -60634,7 +60810,7 @@ var init_testing = __esm({
60634
60810
  );
60635
60811
  }
60636
60812
  });
60637
- statusCommand14 = defineCommand({
60813
+ statusCommand15 = defineCommand({
60638
60814
  meta: { name: "status", description: "Show test suite status" },
60639
60815
  async run() {
60640
60816
  await dispatchFromCli(
@@ -60681,7 +60857,7 @@ var init_testing = __esm({
60681
60857
  subCommands: {
60682
60858
  validate: validateCommand9,
60683
60859
  check: checkCommand7,
60684
- status: statusCommand14,
60860
+ status: statusCommand15,
60685
60861
  coverage: coverageCommand,
60686
60862
  run: runCommand4
60687
60863
  },
@@ -62050,7 +62226,7 @@ Logs: ${logFile}`
62050
62226
  { command: "web", message: `CLEO Web UI running on port ${port}` }
62051
62227
  );
62052
62228
  }
62053
- var DEFAULT_PORT, DEFAULT_HOST, startCommand9, stopCommand5, restartCommand, statusCommand15, openCommand2, webCommand;
62229
+ var DEFAULT_PORT, DEFAULT_HOST, startCommand9, stopCommand5, restartCommand, statusCommand16, openCommand2, webCommand;
62054
62230
  var init_web = __esm({
62055
62231
  "packages/cleo/src/cli/commands/web.ts"() {
62056
62232
  "use strict";
@@ -62182,7 +62358,7 @@ var init_web = __esm({
62182
62358
  }
62183
62359
  }
62184
62360
  });
62185
- statusCommand15 = defineCommand({
62361
+ statusCommand16 = defineCommand({
62186
62362
  meta: { name: "status", description: "Check server status" },
62187
62363
  async run() {
62188
62364
  try {
@@ -62236,7 +62412,7 @@ var init_web = __esm({
62236
62412
  start: startCommand9,
62237
62413
  stop: stopCommand5,
62238
62414
  restart: restartCommand,
62239
- status: statusCommand15,
62415
+ status: statusCommand16,
62240
62416
  open: openCommand2
62241
62417
  },
62242
62418
  async run({ cmd, rawArgs }) {
@@ -62470,8 +62646,14 @@ var init_worktree3 = __esm({
62470
62646
  prune: pruneCommand3,
62471
62647
  "force-unlock": forceUnlockCommand
62472
62648
  },
62473
- async run() {
62474
- await showUsage(worktreeCommand);
62649
+ // Early-return when a subcommand was matched; citty still invokes the
62650
+ // parent run() after the subcommand finishes which would otherwise
62651
+ // append the help text to the subcommand's JSON envelope output
62652
+ // (T9686-A bug A4).
62653
+ async run({ cmd, rawArgs }) {
62654
+ const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
62655
+ if (firstArg && cmd.subCommands && firstArg in cmd.subCommands) return;
62656
+ await showUsage(cmd);
62475
62657
  }
62476
62658
  });
62477
62659
  }
@@ -63774,7 +63956,51 @@ async function startCli() {
63774
63956
  }
63775
63957
  }
63776
63958
  }
63777
- runMain(main, { showUsage: customShowUsage });
63959
+ await runMainWithLafsEnvelope(main, argv, customShowUsage);
63960
+ }
63961
+ function asCittyCliError(value) {
63962
+ if (!(value instanceof Error)) return null;
63963
+ if (value.name !== "CLIError") return null;
63964
+ if (!("code" in value)) return null;
63965
+ const code = value.code;
63966
+ if (typeof code !== "string") return null;
63967
+ return value;
63968
+ }
63969
+ async function runMainWithLafsEnvelope(cmd, rawArgs, showUsage2) {
63970
+ const helpFlags = ["--help", "-h"];
63971
+ const versionFlags = ["--version", "-V"];
63972
+ if (rawArgs.some((a) => helpFlags.includes(a))) {
63973
+ await showUsage2(cmd);
63974
+ process.exit(0);
63975
+ }
63976
+ if (rawArgs.length === 1 && versionFlags.includes(rawArgs[0])) {
63977
+ const meta = typeof cmd.meta === "function" ? await cmd.meta() : await cmd.meta;
63978
+ const version = meta?.version;
63979
+ if (!version) {
63980
+ const { cliError: cliError2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
63981
+ cliError2("No version specified", 1, { name: "E_NO_VERSION" });
63982
+ process.exit(1);
63983
+ }
63984
+ process.stdout.write(`${version}
63985
+ `);
63986
+ process.exit(0);
63987
+ }
63988
+ try {
63989
+ await runCommand(cmd, { rawArgs });
63990
+ } catch (err) {
63991
+ const { cliError: cliError2 } = await Promise.resolve().then(() => (init_renderers(), renderers_exports));
63992
+ const cittyCliError = asCittyCliError(err);
63993
+ if (cittyCliError) {
63994
+ cliError2(cittyCliError.message, 1, {
63995
+ name: cittyCliError.code === "EARG" ? "E_VALIDATION" : `E_${cittyCliError.code}`,
63996
+ fix: `Run 'cleo <command> --help' to see required arguments.`
63997
+ });
63998
+ process.exit(1);
63999
+ }
64000
+ const message = err instanceof Error ? err.message : String(err);
64001
+ cliError2(message, 1, { name: "E_CLI_UNCAUGHT" });
64002
+ process.exit(1);
64003
+ }
63778
64004
  }
63779
64005
  async function runStartupMaintenance() {
63780
64006
  const {