mancode 0.3.13 → 0.3.14

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.js CHANGED
@@ -123,7 +123,7 @@ import {
123
123
  workflowMetadataDigest,
124
124
  writeOperationReservation,
125
125
  writeProjectFacts
126
- } from "./chunk-O3QAKAPJ.js";
126
+ } from "./chunk-LMXUPBCN.js";
127
127
 
128
128
  // src/cli.ts
129
129
  import { Option, program } from "commander";
@@ -11240,7 +11240,7 @@ async function activateLegacyMigration(input) {
11240
11240
  if (session === null || session.status !== "active") {
11241
11241
  throw new Error("MANCODE_SESSION_NOT_FOUND");
11242
11242
  }
11243
- const store = new (await import("./store-JUB2KAFT.js")).V3ContextStore(root);
11243
+ const store = new (await import("./store-DCTOW75Z.js")).V3ContextStore(root);
11244
11244
  const project = await store.readProjectSnapshot();
11245
11245
  const stage = await readMigrationStage(root, input.stageId);
11246
11246
  if (stage.state !== "staged" || stage.revision !== input.expectedStageRevision) {
@@ -28436,8 +28436,16 @@ function printV3Text(result2) {
28436
28436
  console.log(
28437
28437
  `Identity: ${result2.localIdentity.displayName ?? "not configured"}`
28438
28438
  );
28439
+ const sessionEvidenceDetail = result2.sessionEvidence.ready ? "ready" : [
28440
+ ...result2.sessionEvidence.explicitRequiredPlatforms,
28441
+ ...result2.sessionEvidence.missingPlatforms.filter(
28442
+ (platform) => !result2.sessionEvidence.explicitRequiredPlatforms.includes(
28443
+ platform
28444
+ )
28445
+ )
28446
+ ].join(", ") || "none recorded";
28439
28447
  console.log(
28440
- `Session evidence: ${result2.sessionEvidence.ready ? "ready" : `explicit required (${result2.sessionEvidence.explicitRequiredPlatforms.join(", ")})`}`
28448
+ `Session evidence: ${result2.sessionEvidence.ready ? "ready" : `explicit required (${sessionEvidenceDetail})`}`
28441
28449
  );
28442
28450
  if (result2.compatibility.failures.length > 0) {
28443
28451
  console.log(`Compatibility: ${result2.compatibility.failures.join(", ")}`);
@@ -36915,7 +36923,7 @@ async function uninstallV3(rootDir, platform, options) {
36915
36923
  if (!platform || options.all) {
36916
36924
  console.error("\u2717 mancode authority is protected from bulk uninstall.");
36917
36925
  console.error(
36918
- " Remove a single bootstrap with `mancode uninstall <platform>`, or complete an explicit mancode archive/migration workflow first."
36926
+ " Remove a single bootstrap with `mancode uninstall <platform>`. Inspect runtime retention with `mancode context compact --dry-run`; V3 workflow authority is not bulk-deleted."
36919
36927
  );
36920
36928
  return EXIT_V3_AUTHORITY_PROTECTED;
36921
36929
  }
@@ -41522,6 +41530,15 @@ async function workflow(rootDir, subcommand, args = [], options = {}) {
41522
41530
  }
41523
41531
  }
41524
41532
  async function workflowV3(rootDir, subcommand, args, options) {
41533
+ if (subcommand === "list") {
41534
+ return workflowListV3(rootDir, args, options);
41535
+ }
41536
+ if (subcommand === "show") {
41537
+ return workflowShowV3(rootDir, args, options);
41538
+ }
41539
+ if (subcommand === "clean") {
41540
+ return workflowCleanV3(options);
41541
+ }
41525
41542
  if (subcommand === "create") {
41526
41543
  return workflowCreateV3(rootDir, args, options);
41527
41544
  }
@@ -41561,6 +41578,126 @@ async function workflowV3(rootDir, subcommand, args, options) {
41561
41578
  `workflow ${subcommand} is not yet implemented for mancode authority.`
41562
41579
  );
41563
41580
  }
41581
+ async function workflowListV3(rootDir, args, options) {
41582
+ if (args.length !== 0) {
41583
+ return printV3Error(
41584
+ options.json,
41585
+ "MANCODE_WORKFLOW_LIST_ARGUMENT_INVALID",
41586
+ "Use: workflow list [--json].",
41587
+ EXIT_INVALID_ARG3
41588
+ );
41589
+ }
41590
+ try {
41591
+ const project = await readV3CommandProject(rootDir);
41592
+ const workflows = await project.store.listWorkflowMetadata();
41593
+ if (options.json) {
41594
+ return printV3Result(true, {
41595
+ schemaVersion: 1,
41596
+ workflows
41597
+ });
41598
+ }
41599
+ if (workflows.length === 0) {
41600
+ console.log("No mancode workflows.");
41601
+ return EXIT_OK10;
41602
+ }
41603
+ const active = workflows.filter(
41604
+ (item) => ["in_progress", "planned", "blocked"].includes(item.status)
41605
+ ).length;
41606
+ console.log(
41607
+ `mancode workflows (${workflows.length} total, ${active} active)`
41608
+ );
41609
+ console.log("");
41610
+ for (const metadata of workflows) {
41611
+ console.log(formatV3WorkflowRow(metadata));
41612
+ }
41613
+ return EXIT_OK10;
41614
+ } catch (error) {
41615
+ return printV3Error(
41616
+ options.json,
41617
+ v3ErrorCode(error, "MANCODE_V3_WORKFLOW_LIST_FAILED"),
41618
+ error instanceof Error ? error.message : "Unable to list mancode workflows."
41619
+ );
41620
+ }
41621
+ }
41622
+ async function workflowShowV3(rootDir, args, options) {
41623
+ const requested = args[0];
41624
+ if (!requested || args.length !== 1) {
41625
+ return printV3Error(
41626
+ options.json,
41627
+ "MANCODE_WORKFLOW_SHOW_ARGUMENT_INVALID",
41628
+ "Use: workflow show <namespace:ULID> [--json].",
41629
+ EXIT_INVALID_ARG3
41630
+ );
41631
+ }
41632
+ try {
41633
+ const project = await readV3CommandProject(rootDir);
41634
+ const location = await project.store.locateTask(requested);
41635
+ const [snapshot, activeChildren] = await Promise.all([
41636
+ project.store.readTaskSnapshot(location.taskRef),
41637
+ project.store.listActiveChildTaskRefs(location.taskRef)
41638
+ ]);
41639
+ const result2 = {
41640
+ schemaVersion: 1,
41641
+ taskRef: location.taskRef,
41642
+ metadata: snapshot.metadata,
41643
+ aggregate: snapshot.aggregate,
41644
+ aggregateError: snapshot.aggregateError,
41645
+ activeChildren
41646
+ };
41647
+ if (options.json) return printV3Result(true, result2);
41648
+ const metadata = snapshot.metadata;
41649
+ console.log(`Workflow: ${formatTaskRef(metadata.taskRef)}`);
41650
+ console.log(`Task: ${metadata.task}`);
41651
+ console.log(`Mode: ${metadata.workflowMode}`);
41652
+ console.log(`Status: ${metadata.status}`);
41653
+ console.log(
41654
+ `Current step: ${metadata.currentStep}/${maxV3WorkflowStep(metadata.workflowMode)}`
41655
+ );
41656
+ console.log(`Revision: ${metadata.revision}`);
41657
+ console.log(`Visibility: ${metadata.visibility}`);
41658
+ console.log(`Coordination: ${metadata.coordination}`);
41659
+ console.log(`Updated: ${metadata.updatedAt}`);
41660
+ if (metadata.blockingReason !== null) {
41661
+ console.log(`Blocked: ${metadata.blockingReason}`);
41662
+ }
41663
+ if (activeChildren.length > 0) {
41664
+ console.log(
41665
+ `Children: ${activeChildren.map(formatTaskRef).join(", ")}`
41666
+ );
41667
+ }
41668
+ if (snapshot.aggregateError !== null) {
41669
+ console.log(`Aggregate: ${snapshot.aggregateError}`);
41670
+ }
41671
+ return EXIT_OK10;
41672
+ } catch (error) {
41673
+ return printV3Error(
41674
+ options.json,
41675
+ v3ErrorCode(error, "MANCODE_V3_WORKFLOW_SHOW_FAILED"),
41676
+ error instanceof Error ? error.message : "Unable to show the mancode workflow."
41677
+ );
41678
+ }
41679
+ }
41680
+ function workflowCleanV3(options) {
41681
+ return printV3Error(
41682
+ options.json,
41683
+ "MANCODE_V3_WORKFLOW_CLEAN_UNSUPPORTED",
41684
+ "V3 workflow authority is durable and is not deleted by workflow clean. Use `mancode context compact --dry-run` to inspect eligible runtime retention records.",
41685
+ EXIT_INVALID_ARG3
41686
+ );
41687
+ }
41688
+ function formatV3WorkflowRow(metadata) {
41689
+ return [
41690
+ formatTaskRef(metadata.taskRef),
41691
+ metadata.workflowMode,
41692
+ metadata.status,
41693
+ `Step ${metadata.currentStep}/${maxV3WorkflowStep(metadata.workflowMode)}`,
41694
+ `r${metadata.revision}`,
41695
+ metadata.task
41696
+ ].join(" ");
41697
+ }
41698
+ function maxV3WorkflowStep(mode) {
41699
+ return mode === "manba" ? 5 : 9;
41700
+ }
41564
41701
  async function workflowUpdateV3(rootDir, args, options) {
41565
41702
  const task = args[0];
41566
41703
  if (!task || args.length !== 1) {