@cleocode/cleo 2026.4.126 → 2026.4.127

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
@@ -18457,7 +18457,13 @@ var init_memory2 = __esm({
18457
18457
  startTime
18458
18458
  );
18459
18459
  }
18460
- return wrapResult(result, "query", "memory", operation, startTime);
18460
+ return wrapResult(
18461
+ { success: true, data: result },
18462
+ "query",
18463
+ "memory",
18464
+ operation,
18465
+ startTime
18466
+ );
18461
18467
  }
18462
18468
  // T791 — LLM extraction backend status
18463
18469
  case "llm-status": {
@@ -33560,7 +33566,7 @@ agent ${agentId}:
33560
33566
  house: none
33561
33567
  allegiance: canon
33562
33568
  role: ${role}
33563
- parent: cleoos-opus-orchestrator
33569
+ parent: project-orchestrator
33564
33570
  description: "${displayName}"
33565
33571
 
33566
33572
  tone:
@@ -35691,6 +35697,126 @@ var createCommand = defineCommand({
35691
35697
  }
35692
35698
  }
35693
35699
  });
35700
+ var mintCommand = defineCommand({
35701
+ meta: {
35702
+ name: "mint",
35703
+ description: "Synthesize a project-specific agent from a .cant spec using agent-architect meta-agent"
35704
+ },
35705
+ args: {
35706
+ spec: {
35707
+ type: "positional",
35708
+ description: "Path to the .cant spec file describing the agent to synthesize",
35709
+ required: true
35710
+ },
35711
+ "output-dir": {
35712
+ type: "string",
35713
+ description: "Directory to write synthesized .cant files (defaults to .cleo/cant/agents/)"
35714
+ },
35715
+ "dry-run": {
35716
+ type: "boolean",
35717
+ description: "Preview invocation tokens without invoking agent-architect",
35718
+ default: false
35719
+ },
35720
+ json: {
35721
+ type: "boolean",
35722
+ description: "Emit result as LAFS JSON envelope",
35723
+ default: false
35724
+ }
35725
+ },
35726
+ async run({ args }) {
35727
+ try {
35728
+ const { existsSync: existsSync12, readFileSync: readFileSync15, mkdirSync: mkdirSync4 } = await import("node:fs");
35729
+ const { resolve: resolve5, join: join22 } = await import("node:path");
35730
+ const specPath = resolve5(args.spec);
35731
+ if (!existsSync12(specPath)) {
35732
+ const errEnv = {
35733
+ success: false,
35734
+ error: { code: "E_NOT_FOUND", message: `spec file not found: ${specPath}` },
35735
+ meta: { operation: "agent.mint", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
35736
+ };
35737
+ if (args.json) {
35738
+ process.stdout.write(JSON.stringify(errEnv, null, 2) + "\n");
35739
+ } else {
35740
+ process.stderr.write(`error: spec file not found: ${specPath}
35741
+ `);
35742
+ }
35743
+ process.exitCode = 4;
35744
+ return;
35745
+ }
35746
+ const specContent = readFileSync15(specPath, "utf-8");
35747
+ const projectRoot = process.cwd();
35748
+ const outputDir = args["output-dir"] ? resolve5(args["output-dir"]) : join22(projectRoot, ".cleo", "cant", "agents");
35749
+ mkdirSync4(outputDir, { recursive: true });
35750
+ if (args["dry-run"]) {
35751
+ const preview = {
35752
+ success: true,
35753
+ data: {
35754
+ dryRun: true,
35755
+ agentName: "agent-architect",
35756
+ specPath,
35757
+ outputDir,
35758
+ projectRoot,
35759
+ message: "Dry-run: would invoke agent-architect with the above tokens"
35760
+ },
35761
+ meta: { operation: "agent.mint", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
35762
+ };
35763
+ process.stdout.write(JSON.stringify(preview, null, 2) + "\n");
35764
+ return;
35765
+ }
35766
+ const { invokeMetaAgent } = await import("@cleocode/core/agents/invoke-meta-agent");
35767
+ const result = await invokeMetaAgent({
35768
+ agentName: "agent-architect",
35769
+ projectRoot,
35770
+ tokens: {
35771
+ CANT_AGENTS_DIR: outputDir,
35772
+ // Pass spec content as PROJECT_CONTEXT to let agent-architect read it
35773
+ PROJECT_CONTEXT: specContent
35774
+ }
35775
+ });
35776
+ if (result.invoked) {
35777
+ const envelope = {
35778
+ success: true,
35779
+ data: {
35780
+ invoked: true,
35781
+ outputs: result.outputs ?? [],
35782
+ outputDir,
35783
+ message: `agent-architect synthesized ${result.outputs?.length ?? 0} agent(s)`
35784
+ },
35785
+ meta: { operation: "agent.mint", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
35786
+ };
35787
+ if (args.json) {
35788
+ process.stdout.write(JSON.stringify(envelope, null, 2) + "\n");
35789
+ } else {
35790
+ process.stdout.write(`minted ${result.outputs?.length ?? 0} agent(s) to ${outputDir}
35791
+ `);
35792
+ for (const out of result.outputs ?? []) {
35793
+ process.stdout.write(` + ${out}
35794
+ `);
35795
+ }
35796
+ }
35797
+ } else {
35798
+ const fallbackMsg = `agent-architect unavailable: ${result.reason ?? "unknown"}. Run 'cleo agent create' for static scaffolding.`;
35799
+ const envelope = {
35800
+ success: false,
35801
+ error: { code: "E_META_AGENT_UNAVAILABLE", message: fallbackMsg },
35802
+ meta: { operation: "agent.mint", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
35803
+ };
35804
+ if (args.json) {
35805
+ process.stdout.write(JSON.stringify(envelope, null, 2) + "\n");
35806
+ } else {
35807
+ process.stderr.write(`warn: ${fallbackMsg}
35808
+ `);
35809
+ }
35810
+ process.exitCode = 1;
35811
+ }
35812
+ } catch (err) {
35813
+ const message = err instanceof Error ? err.message : String(err);
35814
+ process.stderr.write(`error: agent mint failed: ${message}
35815
+ `);
35816
+ process.exitCode = 1;
35817
+ }
35818
+ }
35819
+ });
35694
35820
  var doctorCommand = defineCommand({
35695
35821
  meta: {
35696
35822
  name: "doctor",
@@ -35827,7 +35953,8 @@ var agentCommand = defineCommand({
35827
35953
  health: healthCommand3,
35828
35954
  install: installCommand,
35829
35955
  pack: packCommand,
35830
- create: createCommand
35956
+ create: createCommand,
35957
+ mint: mintCommand
35831
35958
  },
35832
35959
  async run({ cmd, rawArgs }) {
35833
35960
  const firstArg = rawArgs?.find((a) => !a.startsWith("-"));
@@ -52230,6 +52357,51 @@ var resumeCommand = defineCommand({
52230
52357
  );
52231
52358
  }
52232
52359
  });
52360
+ var createCommand2 = defineCommand({
52361
+ meta: {
52362
+ name: "create",
52363
+ description: "Scaffold a new .cantbook playbook (invokes playbook-architect meta-agent)"
52364
+ },
52365
+ args: {
52366
+ name: {
52367
+ type: "positional",
52368
+ description: 'Playbook name (kebab-case, e.g. "feature-ship")',
52369
+ required: true
52370
+ },
52371
+ description: {
52372
+ type: "string",
52373
+ description: "Plain-text description of what the playbook should do"
52374
+ },
52375
+ stages: {
52376
+ type: "string",
52377
+ description: "Comma-separated list of stage names to scaffold (auto-inferred if omitted)"
52378
+ },
52379
+ "output-dir": {
52380
+ type: "string",
52381
+ description: "Output directory for the .cantbook file (defaults to .cleo/cant/playbooks/)"
52382
+ },
52383
+ "dry-run": {
52384
+ type: "boolean",
52385
+ description: "Preview what would be created without writing files",
52386
+ default: false
52387
+ }
52388
+ },
52389
+ async run({ args }) {
52390
+ await dispatchFromCli(
52391
+ "mutate",
52392
+ "playbook",
52393
+ "create",
52394
+ {
52395
+ name: args.name,
52396
+ description: args.description,
52397
+ stages: args.stages,
52398
+ outputDir: args["output-dir"],
52399
+ dryRun: args["dry-run"]
52400
+ },
52401
+ { command: "playbook" }
52402
+ );
52403
+ }
52404
+ });
52233
52405
  var listCommand13 = defineCommand({
52234
52406
  meta: {
52235
52407
  name: "list",
@@ -52271,13 +52443,14 @@ var listCommand13 = defineCommand({
52271
52443
  var playbookCommand = defineCommand({
52272
52444
  meta: {
52273
52445
  name: "playbook",
52274
- description: "Playbook runtime operations (run, status, resume, list)"
52446
+ description: "Playbook runtime operations (run, status, resume, list, create)"
52275
52447
  },
52276
52448
  subCommands: {
52277
52449
  run: runCommand3,
52278
52450
  status: statusCommand10,
52279
52451
  resume: resumeCommand,
52280
- list: listCommand13
52452
+ list: listCommand13,
52453
+ create: createCommand2
52281
52454
  },
52282
52455
  async run({ cmd, rawArgs }) {
52283
52456
  const firstArg = rawArgs?.find((a) => !a.startsWith("-"));