@cleocode/cleo 2026.4.138 → 2026.4.140

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
@@ -798,6 +798,13 @@ var init_lifecycle = __esm({
798
798
  }
799
799
  });
800
800
 
801
+ // packages/contracts/src/operations/llm.ts
802
+ var init_llm = __esm({
803
+ "packages/contracts/src/operations/llm.ts"() {
804
+ "use strict";
805
+ }
806
+ });
807
+
801
808
  // packages/contracts/src/operations/memory.ts
802
809
  var init_memory = __esm({
803
810
  "packages/contracts/src/operations/memory.ts"() {
@@ -935,6 +942,7 @@ var init_operations = __esm({
935
942
  init_conduit();
936
943
  init_issues();
937
944
  init_lifecycle();
945
+ init_llm();
938
946
  init_memory();
939
947
  init_nexus();
940
948
  init_nexus_user_profile();
@@ -7435,6 +7443,40 @@ var init_registry = __esm({
7435
7443
  ]
7436
7444
  },
7437
7445
  // ---------------------------------------------------------------------------
7446
+ // T1386 — nexus.sigil — peer-card identity (PSYCHE Wave 8 follow-up)
7447
+ // ---------------------------------------------------------------------------
7448
+ // Query: list every sigil currently stored in nexus.db
7449
+ {
7450
+ gateway: "query",
7451
+ domain: "nexus",
7452
+ operation: "sigil.list",
7453
+ description: "nexus.sigil.list (query) \u2014 list every sigil currently stored in nexus.db, optionally filtered by role",
7454
+ tier: 1,
7455
+ idempotent: true,
7456
+ sessionRequired: false,
7457
+ requiredParams: [],
7458
+ params: [
7459
+ {
7460
+ name: "role",
7461
+ type: "string",
7462
+ required: false,
7463
+ description: 'Filter by role (e.g. "orchestrator", "lead", "worker", "specialist", "subagent")'
7464
+ }
7465
+ ]
7466
+ },
7467
+ // Mutate: populate sigils from canonical CANT agents
7468
+ {
7469
+ gateway: "mutate",
7470
+ domain: "nexus",
7471
+ operation: "sigil.sync",
7472
+ description: "nexus.sigil.sync (mutate) \u2014 populate the sigils table with one row per canonical CANT agent (cleo-subagent + 5 seed roles + 2 meta agents). Idempotent.",
7473
+ tier: 1,
7474
+ idempotent: true,
7475
+ sessionRequired: false,
7476
+ requiredParams: [],
7477
+ params: []
7478
+ },
7479
+ // ---------------------------------------------------------------------------
7438
7480
  // sticky — Ephemeral notes for quick capture (T5282)
7439
7481
  // ---------------------------------------------------------------------------
7440
7482
  // Query operations
@@ -19142,12 +19184,12 @@ var init_memory2 = __esm({
19142
19184
  const { getBrainNativeDb: _getDoctorNativeDb } = await import("@cleocode/core/store/memory-sqlite.js");
19143
19185
  const doctorNativeDb = _getDoctorNativeDb();
19144
19186
  if (doctorNativeDb) {
19145
- const tableExists = doctorNativeDb.prepare(
19146
- `SELECT name FROM sqlite_master WHERE type='table' AND name='brain_v2_candidate'`
19187
+ const stagingTableRow = doctorNativeDb.prepare(
19188
+ `SELECT name FROM sqlite_master WHERE type='table' AND name IN ('brain_observations_staging', 'brain_v2_candidate') ORDER BY CASE name WHEN 'brain_observations_staging' THEN 0 ELSE 1 END LIMIT 1`
19147
19189
  ).get();
19148
- if (tableExists) {
19190
+ if (stagingTableRow?.name) {
19149
19191
  const countRow = doctorNativeDb.prepare(
19150
- `SELECT COUNT(*) AS cnt FROM brain_v2_candidate WHERE validation_status = 'pending'`
19192
+ `SELECT COUNT(*) AS cnt FROM ${stagingTableRow.name} WHERE validation_status = 'pending'`
19151
19193
  ).get();
19152
19194
  pendingCandidates = countRow?.cnt ?? 0;
19153
19195
  }
@@ -19170,7 +19212,7 @@ var init_memory2 = __esm({
19170
19212
  "memory",
19171
19213
  operation,
19172
19214
  "E_SWEEP_PENDING",
19173
- `Staged sweep has ${pendingCandidates} pending brain_v2_candidate rows. Run \`cleo memory sweep --status\` to review, then \`cleo memory sweep --approve <runId>\` to apply.`,
19215
+ `Staged sweep has ${pendingCandidates} pending brain_observations_staging rows. Run \`cleo memory sweep --status\` to review, then \`cleo memory sweep --approve <runId>\` to apply.`,
19174
19216
  startTime
19175
19217
  );
19176
19218
  }
@@ -20441,6 +20483,7 @@ import {
20441
20483
  getUserProfileTrait,
20442
20484
  importSnapshot as importSnapshot2,
20443
20485
  importUserProfile,
20486
+ listSigils,
20444
20487
  listUserProfile,
20445
20488
  nexusDeps,
20446
20489
  nexusGetProject,
@@ -20461,6 +20504,7 @@ import {
20461
20504
  searchAcrossProjects,
20462
20505
  setPermission,
20463
20506
  supersedeTrait,
20507
+ syncCanonicalSigils,
20464
20508
  upsertUserProfileTrait,
20465
20509
  validateSyntax,
20466
20510
  writeSnapshot as writeSnapshot2
@@ -20979,6 +21023,23 @@ async function nexusProfileSupersede(oldKey, newKey) {
20979
21023
  return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
20980
21024
  }
20981
21025
  }
21026
+ async function nexusSigilList(role) {
21027
+ try {
21028
+ const nexusDb = await getNexusDb();
21029
+ const sigils = await listSigils(nexusDb, role ? { role } : void 0);
21030
+ return engineSuccess({ sigils, count: sigils.length });
21031
+ } catch (error) {
21032
+ return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
21033
+ }
21034
+ }
21035
+ async function nexusSigilSync() {
21036
+ try {
21037
+ const result = await syncCanonicalSigils();
21038
+ return engineSuccess(result);
21039
+ } catch (error) {
21040
+ return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
21041
+ }
21042
+ }
20982
21043
  var init_nexus_engine = __esm({
20983
21044
  "packages/cleo/src/dispatch/engines/nexus-engine.ts"() {
20984
21045
  "use strict";
@@ -21729,6 +21790,11 @@ var init_nexus2 = __esm({
21729
21790
  const result = await nexusProfileGet(traitKey);
21730
21791
  return wrapResult(result, "query", "nexus", operation, startTime);
21731
21792
  }
21793
+ case "sigil.list": {
21794
+ const role = params?.role;
21795
+ const result = await nexusSigilList(role);
21796
+ return wrapResult(result, "query", "nexus", operation, startTime);
21797
+ }
21732
21798
  default:
21733
21799
  return unsupportedOp("query", "nexus", operation, startTime);
21734
21800
  }
@@ -21951,6 +22017,10 @@ var init_nexus2 = __esm({
21951
22017
  const result = await nexusProfileSupersede(oldKey, newKey);
21952
22018
  return wrapResult(result, "mutate", "nexus", operation, startTime);
21953
22019
  }
22020
+ case "sigil.sync": {
22021
+ const result = await nexusSigilSync();
22022
+ return wrapResult(result, "mutate", "nexus", operation, startTime);
22023
+ }
21954
22024
  default:
21955
22025
  return unsupportedOp("mutate", "nexus", operation, startTime);
21956
22026
  }
@@ -22003,7 +22073,9 @@ var init_nexus2 = __esm({
22003
22073
  "task-symbols",
22004
22074
  // T1080 — user-profile query verbs
22005
22075
  "profile.view",
22006
- "profile.get"
22076
+ "profile.get",
22077
+ // T1386 — sigil list (peer-card identity)
22078
+ "sigil.list"
22007
22079
  ],
22008
22080
  mutate: [
22009
22081
  "share.snapshot.export",
@@ -22024,7 +22096,9 @@ var init_nexus2 = __esm({
22024
22096
  "profile.export",
22025
22097
  "profile.reinforce",
22026
22098
  "profile.upsert",
22027
- "profile.supersede"
22099
+ "profile.supersede",
22100
+ // T1386 — sigil sync (canonical CANT agent peer cards)
22101
+ "sigil.sync"
22028
22102
  ]
22029
22103
  };
22030
22104
  }
@@ -52468,6 +52542,52 @@ ${result.count} cold symbol(s) found (threshold: ${thresholdDays} days).
52468
52542
  }
52469
52543
  }
52470
52544
  });
52545
+ var sigilSyncCommand = defineCommand({
52546
+ meta: {
52547
+ name: "sync",
52548
+ description: "Populate the nexus.db sigils table with one row per canonical CANT agent (cleo-subagent + 5 seed roles + 2 meta agents). Idempotent."
52549
+ },
52550
+ args: {
52551
+ json: {
52552
+ type: "boolean",
52553
+ description: "Output as JSON (LAFS envelope format)"
52554
+ }
52555
+ },
52556
+ async run() {
52557
+ await dispatchFromCli("mutate", "nexus", "sigil.sync", {}, { command: "nexus" });
52558
+ }
52559
+ });
52560
+ var sigilListCommand = defineCommand({
52561
+ meta: {
52562
+ name: "list",
52563
+ description: "List every sigil currently stored in nexus.db, optionally filtered by role."
52564
+ },
52565
+ args: {
52566
+ role: {
52567
+ type: "string",
52568
+ description: 'Filter by role (e.g. "orchestrator", "lead", "worker", "specialist", "subagent")'
52569
+ }
52570
+ },
52571
+ async run({ args }) {
52572
+ await dispatchFromCli(
52573
+ "query",
52574
+ "nexus",
52575
+ "sigil.list",
52576
+ { role: args.role },
52577
+ { command: "nexus" }
52578
+ );
52579
+ }
52580
+ });
52581
+ var sigilCommand = defineCommand({
52582
+ meta: {
52583
+ name: "sigil",
52584
+ description: "Sigil (peer-card) operations \u2014 sync from canonical CANT agents, list current rows"
52585
+ },
52586
+ subCommands: {
52587
+ sync: sigilSyncCommand,
52588
+ list: sigilListCommand
52589
+ }
52590
+ });
52471
52591
  var topEntriesCommand = defineCommand({
52472
52592
  meta: {
52473
52593
  name: "top-entries",
@@ -52561,7 +52681,9 @@ var nexusCommand = defineCommand({
52561
52681
  "hot-nodes": hotNodesCommand,
52562
52682
  "cold-symbols": coldSymbolsCommand,
52563
52683
  // T1013 / T1006 — top-weighted symbols by nexus_relations.weight
52564
- "top-entries": topEntriesCommand
52684
+ "top-entries": topEntriesCommand,
52685
+ // T1386 — sigil sync + list (canonical CANT agent peer cards)
52686
+ sigil: sigilCommand
52565
52687
  },
52566
52688
  async run({ cmd, rawArgs }) {
52567
52689
  const firstArg = rawArgs?.find((a) => !a.startsWith("-"));