@cleocode/cleo 2026.4.138 → 2026.4.139

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
@@ -7435,6 +7435,40 @@ var init_registry = __esm({
7435
7435
  ]
7436
7436
  },
7437
7437
  // ---------------------------------------------------------------------------
7438
+ // T1386 — nexus.sigil — peer-card identity (PSYCHE Wave 8 follow-up)
7439
+ // ---------------------------------------------------------------------------
7440
+ // Query: list every sigil currently stored in nexus.db
7441
+ {
7442
+ gateway: "query",
7443
+ domain: "nexus",
7444
+ operation: "sigil.list",
7445
+ description: "nexus.sigil.list (query) \u2014 list every sigil currently stored in nexus.db, optionally filtered by role",
7446
+ tier: 1,
7447
+ idempotent: true,
7448
+ sessionRequired: false,
7449
+ requiredParams: [],
7450
+ params: [
7451
+ {
7452
+ name: "role",
7453
+ type: "string",
7454
+ required: false,
7455
+ description: 'Filter by role (e.g. "orchestrator", "lead", "worker", "specialist", "subagent")'
7456
+ }
7457
+ ]
7458
+ },
7459
+ // Mutate: populate sigils from canonical CANT agents
7460
+ {
7461
+ gateway: "mutate",
7462
+ domain: "nexus",
7463
+ operation: "sigil.sync",
7464
+ 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.",
7465
+ tier: 1,
7466
+ idempotent: true,
7467
+ sessionRequired: false,
7468
+ requiredParams: [],
7469
+ params: []
7470
+ },
7471
+ // ---------------------------------------------------------------------------
7438
7472
  // sticky — Ephemeral notes for quick capture (T5282)
7439
7473
  // ---------------------------------------------------------------------------
7440
7474
  // Query operations
@@ -19142,12 +19176,12 @@ var init_memory2 = __esm({
19142
19176
  const { getBrainNativeDb: _getDoctorNativeDb } = await import("@cleocode/core/store/memory-sqlite.js");
19143
19177
  const doctorNativeDb = _getDoctorNativeDb();
19144
19178
  if (doctorNativeDb) {
19145
- const tableExists = doctorNativeDb.prepare(
19146
- `SELECT name FROM sqlite_master WHERE type='table' AND name='brain_v2_candidate'`
19179
+ const stagingTableRow = doctorNativeDb.prepare(
19180
+ `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
19181
  ).get();
19148
- if (tableExists) {
19182
+ if (stagingTableRow?.name) {
19149
19183
  const countRow = doctorNativeDb.prepare(
19150
- `SELECT COUNT(*) AS cnt FROM brain_v2_candidate WHERE validation_status = 'pending'`
19184
+ `SELECT COUNT(*) AS cnt FROM ${stagingTableRow.name} WHERE validation_status = 'pending'`
19151
19185
  ).get();
19152
19186
  pendingCandidates = countRow?.cnt ?? 0;
19153
19187
  }
@@ -19170,7 +19204,7 @@ var init_memory2 = __esm({
19170
19204
  "memory",
19171
19205
  operation,
19172
19206
  "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.`,
19207
+ `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
19208
  startTime
19175
19209
  );
19176
19210
  }
@@ -20441,6 +20475,7 @@ import {
20441
20475
  getUserProfileTrait,
20442
20476
  importSnapshot as importSnapshot2,
20443
20477
  importUserProfile,
20478
+ listSigils,
20444
20479
  listUserProfile,
20445
20480
  nexusDeps,
20446
20481
  nexusGetProject,
@@ -20461,6 +20496,7 @@ import {
20461
20496
  searchAcrossProjects,
20462
20497
  setPermission,
20463
20498
  supersedeTrait,
20499
+ syncCanonicalSigils,
20464
20500
  upsertUserProfileTrait,
20465
20501
  validateSyntax,
20466
20502
  writeSnapshot as writeSnapshot2
@@ -20979,6 +21015,23 @@ async function nexusProfileSupersede(oldKey, newKey) {
20979
21015
  return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
20980
21016
  }
20981
21017
  }
21018
+ async function nexusSigilList(role) {
21019
+ try {
21020
+ const nexusDb = await getNexusDb();
21021
+ const sigils = await listSigils(nexusDb, role ? { role } : void 0);
21022
+ return engineSuccess({ sigils, count: sigils.length });
21023
+ } catch (error) {
21024
+ return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
21025
+ }
21026
+ }
21027
+ async function nexusSigilSync() {
21028
+ try {
21029
+ const result = await syncCanonicalSigils();
21030
+ return engineSuccess(result);
21031
+ } catch (error) {
21032
+ return engineError("E_INTERNAL", error instanceof Error ? error.message : String(error));
21033
+ }
21034
+ }
20982
21035
  var init_nexus_engine = __esm({
20983
21036
  "packages/cleo/src/dispatch/engines/nexus-engine.ts"() {
20984
21037
  "use strict";
@@ -21729,6 +21782,11 @@ var init_nexus2 = __esm({
21729
21782
  const result = await nexusProfileGet(traitKey);
21730
21783
  return wrapResult(result, "query", "nexus", operation, startTime);
21731
21784
  }
21785
+ case "sigil.list": {
21786
+ const role = params?.role;
21787
+ const result = await nexusSigilList(role);
21788
+ return wrapResult(result, "query", "nexus", operation, startTime);
21789
+ }
21732
21790
  default:
21733
21791
  return unsupportedOp("query", "nexus", operation, startTime);
21734
21792
  }
@@ -21951,6 +22009,10 @@ var init_nexus2 = __esm({
21951
22009
  const result = await nexusProfileSupersede(oldKey, newKey);
21952
22010
  return wrapResult(result, "mutate", "nexus", operation, startTime);
21953
22011
  }
22012
+ case "sigil.sync": {
22013
+ const result = await nexusSigilSync();
22014
+ return wrapResult(result, "mutate", "nexus", operation, startTime);
22015
+ }
21954
22016
  default:
21955
22017
  return unsupportedOp("mutate", "nexus", operation, startTime);
21956
22018
  }
@@ -22003,7 +22065,9 @@ var init_nexus2 = __esm({
22003
22065
  "task-symbols",
22004
22066
  // T1080 — user-profile query verbs
22005
22067
  "profile.view",
22006
- "profile.get"
22068
+ "profile.get",
22069
+ // T1386 — sigil list (peer-card identity)
22070
+ "sigil.list"
22007
22071
  ],
22008
22072
  mutate: [
22009
22073
  "share.snapshot.export",
@@ -22024,7 +22088,9 @@ var init_nexus2 = __esm({
22024
22088
  "profile.export",
22025
22089
  "profile.reinforce",
22026
22090
  "profile.upsert",
22027
- "profile.supersede"
22091
+ "profile.supersede",
22092
+ // T1386 — sigil sync (canonical CANT agent peer cards)
22093
+ "sigil.sync"
22028
22094
  ]
22029
22095
  };
22030
22096
  }
@@ -52468,6 +52534,52 @@ ${result.count} cold symbol(s) found (threshold: ${thresholdDays} days).
52468
52534
  }
52469
52535
  }
52470
52536
  });
52537
+ var sigilSyncCommand = defineCommand({
52538
+ meta: {
52539
+ name: "sync",
52540
+ description: "Populate the nexus.db sigils table with one row per canonical CANT agent (cleo-subagent + 5 seed roles + 2 meta agents). Idempotent."
52541
+ },
52542
+ args: {
52543
+ json: {
52544
+ type: "boolean",
52545
+ description: "Output as JSON (LAFS envelope format)"
52546
+ }
52547
+ },
52548
+ async run() {
52549
+ await dispatchFromCli("mutate", "nexus", "sigil.sync", {}, { command: "nexus" });
52550
+ }
52551
+ });
52552
+ var sigilListCommand = defineCommand({
52553
+ meta: {
52554
+ name: "list",
52555
+ description: "List every sigil currently stored in nexus.db, optionally filtered by role."
52556
+ },
52557
+ args: {
52558
+ role: {
52559
+ type: "string",
52560
+ description: 'Filter by role (e.g. "orchestrator", "lead", "worker", "specialist", "subagent")'
52561
+ }
52562
+ },
52563
+ async run({ args }) {
52564
+ await dispatchFromCli(
52565
+ "query",
52566
+ "nexus",
52567
+ "sigil.list",
52568
+ { role: args.role },
52569
+ { command: "nexus" }
52570
+ );
52571
+ }
52572
+ });
52573
+ var sigilCommand = defineCommand({
52574
+ meta: {
52575
+ name: "sigil",
52576
+ description: "Sigil (peer-card) operations \u2014 sync from canonical CANT agents, list current rows"
52577
+ },
52578
+ subCommands: {
52579
+ sync: sigilSyncCommand,
52580
+ list: sigilListCommand
52581
+ }
52582
+ });
52471
52583
  var topEntriesCommand = defineCommand({
52472
52584
  meta: {
52473
52585
  name: "top-entries",
@@ -52561,7 +52673,9 @@ var nexusCommand = defineCommand({
52561
52673
  "hot-nodes": hotNodesCommand,
52562
52674
  "cold-symbols": coldSymbolsCommand,
52563
52675
  // T1013 / T1006 — top-weighted symbols by nexus_relations.weight
52564
- "top-entries": topEntriesCommand
52676
+ "top-entries": topEntriesCommand,
52677
+ // T1386 — sigil sync + list (canonical CANT agent peer cards)
52678
+ sigil: sigilCommand
52565
52679
  },
52566
52680
  async run({ cmd, rawArgs }) {
52567
52681
  const firstArg = rawArgs?.find((a) => !a.startsWith("-"));