@shardworks/nexus 0.1.17 → 0.1.19

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.
Files changed (46) hide show
  1. package/dist/commands/clock.d.ts +1 -1
  2. package/dist/commands/clock.d.ts.map +1 -1
  3. package/dist/commands/commission.d.ts +2 -0
  4. package/dist/commands/commission.d.ts.map +1 -0
  5. package/dist/commands/{dispatch.js → commission.js} +6 -10
  6. package/dist/commands/commission.js.map +1 -0
  7. package/dist/commands/consult.d.ts +8 -3
  8. package/dist/commands/consult.d.ts.map +1 -1
  9. package/dist/commands/consult.js +11 -71
  10. package/dist/commands/consult.js.map +1 -1
  11. package/dist/commands/init.d.ts +1 -4
  12. package/dist/commands/init.d.ts.map +1 -1
  13. package/dist/commands/init.js +10 -3
  14. package/dist/commands/init.js.map +1 -1
  15. package/dist/commands/install-tool.d.ts +1 -5
  16. package/dist/commands/install-tool.d.ts.map +1 -1
  17. package/dist/commands/instantiate.d.ts +1 -5
  18. package/dist/commands/instantiate.d.ts.map +1 -1
  19. package/dist/commands/manifest.d.ts +1 -3
  20. package/dist/commands/manifest.d.ts.map +1 -1
  21. package/dist/commands/rehydrate.d.ts +1 -1
  22. package/dist/commands/rehydrate.d.ts.map +1 -1
  23. package/dist/commands/remove-tool.d.ts +1 -3
  24. package/dist/commands/remove-tool.d.ts.map +1 -1
  25. package/dist/commands/signal.d.ts +1 -3
  26. package/dist/commands/signal.d.ts.map +1 -1
  27. package/dist/commands/status.d.ts +1 -1
  28. package/dist/commands/status.d.ts.map +1 -1
  29. package/dist/commands/workshop.d.ts +1 -1
  30. package/dist/commands/workshop.d.ts.map +1 -1
  31. package/dist/program.d.ts +1 -3
  32. package/dist/program.d.ts.map +1 -1
  33. package/dist/program.js +8 -3
  34. package/dist/program.js.map +1 -1
  35. package/dist/session.d.ts +30 -0
  36. package/dist/session.d.ts.map +1 -0
  37. package/dist/session.js +90 -0
  38. package/dist/session.js.map +1 -0
  39. package/dist/summon.d.ts +6 -0
  40. package/dist/summon.d.ts.map +1 -0
  41. package/dist/summon.js +68 -0
  42. package/dist/summon.js.map +1 -0
  43. package/package.json +11 -11
  44. package/dist/commands/dispatch.d.ts +0 -5
  45. package/dist/commands/dispatch.d.ts.map +0 -1
  46. package/dist/commands/dispatch.js.map +0 -1
@@ -1,2 +1,2 @@
1
- export declare function makeClockCommand(): import("commander").Command<[], {}, {}>;
1
+ export declare function makeClockCommand(): import("commander").Command;
2
2
  //# sourceMappingURL=clock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/commands/clock.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,4CA2G/B"}
1
+ {"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/commands/clock.ts"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,gCA2G/B"}
@@ -0,0 +1,2 @@
1
+ export declare function makeCommissionCommand(): import("commander").Command;
2
+ //# sourceMappingURL=commission.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commission.d.ts","sourceRoot":"","sources":["../../src/commands/commission.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,gCAsBpC"}
@@ -1,25 +1,21 @@
1
1
  import { createCommand } from 'commander';
2
- import { dispatch } from '@shardworks/nexus-core';
2
+ import { commission } from '@shardworks/nexus-core';
3
3
  import { resolveHome } from "../resolve-home.js";
4
- export function makeDispatchCommand() {
5
- return createCommand('dispatch')
4
+ export function makeCommissionCommand() {
5
+ return createCommand('commission')
6
6
  .description('Post a commission to the guild')
7
7
  .argument('<spec>', 'Commission specification — what needs to be done')
8
8
  .requiredOption('--workshop <workshop>', 'Target workshop')
9
- .option('--anima <anima>', 'Target anima name')
10
9
  .action((spec, options, cmd) => {
11
10
  const home = resolveHome(cmd);
12
11
  try {
13
- const result = dispatch({
12
+ const result = commission({
14
13
  home,
15
14
  spec,
16
15
  workshop: options.workshop,
17
- anima: options.anima,
18
16
  });
19
17
  console.log(`Commission #${result.commissionId} posted to workshop "${options.workshop}"`);
20
- if (result.assigned) {
21
- console.log(` Assigned to: ${result.assignedTo}`);
22
- }
18
+ console.log(` Run \`nsg clock run\` to process through Clockworks.`);
23
19
  }
24
20
  catch (err) {
25
21
  console.error(`Error: ${err.message}`);
@@ -27,4 +23,4 @@ export function makeDispatchCommand() {
27
23
  }
28
24
  });
29
25
  }
30
- //# sourceMappingURL=dispatch.js.map
26
+ //# sourceMappingURL=commission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commission.js","sourceRoot":"","sources":["../../src/commands/commission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,qBAAqB;IACnC,OAAO,aAAa,CAAC,YAAY,CAAC;SAC/B,WAAW,CAAC,gCAAgC,CAAC;SAC7C,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;SACtE,cAAc,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;SAC1D,MAAM,CAAC,CAAC,IAAY,EAAE,OAA6B,EAAE,GAAG,EAAE,EAAE;QAC3D,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,UAAU,CAAC;gBACxB,IAAI;gBACJ,IAAI;gBACJ,QAAQ,EAAE,OAAO,CAAC,QAAQ;aAC3B,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,YAAY,wBAAwB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC3F,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACxE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,4 +1,9 @@
1
- export declare function makeConsultCommand(): import("commander").Command<[string | undefined], {
2
- name?: string | undefined;
3
- }, {}>;
1
+ /**
2
+ * Look up the name of the first active anima holding a given role.
3
+ *
4
+ * If multiple animas share the role, one is selected arbitrarily (lowest id).
5
+ * Throws if no active anima holds the role.
6
+ */
7
+ export declare function resolveAnimaByRole(home: string, role: string): string;
8
+ export declare function makeConsultCommand(): import("commander").Command;
4
9
  //# sourceMappingURL=consult.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consult.d.ts","sourceRoot":"","sources":["../../src/commands/consult.ts"],"names":[],"mappings":"AAsGA,wBAAgB,kBAAkB;;OA2EjC"}
1
+ {"version":3,"file":"consult.d.ts","sourceRoot":"","sources":["../../src/commands/consult.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAmBrE;AAED,wBAAgB,kBAAkB,gCAkDjC"}
@@ -4,34 +4,22 @@
4
4
  * Starts an interactive Claude session with a guild member (anima).
5
5
  * The anima is identified by role (positional) or by name (--name flag).
6
6
  *
7
- * Session setup:
8
- * 1. Look up the anima in the Ledger
9
- * 2. Manifest the anima (system prompt + MCP config via engine-manifest)
10
- * 3. Write temp files: system prompt, MCP server config, Claude MCP config
11
- * 4. Launch `claude --bare --dangerously-skip-permissions` in the guild root
12
- * 5. Clean up temp files after the session exits
13
- *
14
- * --setting-sources user limits Claude to user-level settings only, skipping
15
- * project-level CLAUDE.md auto-discovery that could bleed unintended
16
- * instructions into the anima's carefully composed context.
7
+ * Uses the shared session launcher so interactive and commissioned sessions
8
+ * share the same setup/teardown/metrics path.
17
9
  */
18
10
  import { createCommand } from 'commander';
19
- import { spawnSync } from 'node:child_process';
20
- import fs from 'node:fs';
21
- import os from 'node:os';
22
- import path from 'node:path';
23
- import { fileURLToPath } from 'node:url';
24
11
  import Database from 'better-sqlite3';
25
12
  import { manifest } from '@shardworks/engine-manifest';
26
13
  import { ledgerPath } from '@shardworks/nexus-core';
27
14
  import { resolveHome } from "../resolve-home.js";
15
+ import { launchSession } from "../session.js";
28
16
  /**
29
17
  * Look up the name of the first active anima holding a given role.
30
18
  *
31
19
  * If multiple animas share the role, one is selected arbitrarily (lowest id).
32
20
  * Throws if no active anima holds the role.
33
21
  */
34
- function resolveAnimaByRole(home, role) {
22
+ export function resolveAnimaByRole(home, role) {
35
23
  const db = new Database(ledgerPath(home));
36
24
  db.pragma('foreign_keys = ON');
37
25
  try {
@@ -51,38 +39,6 @@ function resolveAnimaByRole(home, role) {
51
39
  db.close();
52
40
  }
53
41
  }
54
- /**
55
- * Build the Claude MCP config JSON (mcpServers format) that launches the
56
- * engine-mcp-server as a stdio process serving the anima's tools.
57
- *
58
- * The engine module exports main() but doesn't self-invoke, so we write a
59
- * tiny wrapper script that imports it and calls main(). This also sidesteps
60
- * the CJS/ESM resolution mismatch — we resolve the engine via
61
- * import.meta.resolve (ESM-aware) and import it by URL in the wrapper.
62
- */
63
- function buildClaudeMcpConfig(tmpDir, mcpServerConfigPath, serverConfig) {
64
- // Resolve engine-mcp-server via ESM resolution (handles both dev .ts and prod .js).
65
- const engineUrl = import.meta.resolve('@shardworks/engine-mcp-server');
66
- const enginePath = fileURLToPath(engineUrl);
67
- // Write a wrapper script that imports and invokes main().
68
- // The wrapper passes the config path via argv so main() picks it up.
69
- const wrapperPath = path.join(tmpDir, 'mcp-entry.mjs');
70
- fs.writeFileSync(wrapperPath, `import { main } from ${JSON.stringify(engineUrl)};\nawait main();\n`);
71
- // In dev the resolved path is .ts source; add the transform flag.
72
- const nodeArgs = [];
73
- if (enginePath.endsWith('.ts')) {
74
- nodeArgs.push('--disable-warning=ExperimentalWarning', '--experimental-transform-types');
75
- }
76
- return {
77
- mcpServers: {
78
- 'nexus-guild': {
79
- command: 'node',
80
- args: [...nodeArgs, wrapperPath, mcpServerConfigPath],
81
- env: serverConfig.env ?? {},
82
- },
83
- },
84
- };
85
- }
86
42
  export function makeConsultCommand() {
87
43
  return createCommand('consult')
88
44
  .description('Start an interactive consultation with a guild member')
@@ -121,29 +77,13 @@ export function makeConsultCommand() {
121
77
  process.exitCode = 1;
122
78
  return;
123
79
  }
124
- // Write temp files into a dedicated temp dir
125
- const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'nsg-consult-'));
126
- try {
127
- const systemPromptPath = path.join(tmpDir, 'system-prompt.md');
128
- const mcpServerConfigPath = path.join(tmpDir, 'mcp-server-config.json');
129
- const claudeMcpConfigPath = path.join(tmpDir, 'claude-mcp-config.json');
130
- fs.writeFileSync(systemPromptPath, result.systemPrompt);
131
- fs.writeFileSync(mcpServerConfigPath, JSON.stringify(result.mcpConfig, null, 2));
132
- fs.writeFileSync(claudeMcpConfigPath, JSON.stringify(buildClaudeMcpConfig(tmpDir, mcpServerConfigPath, result.mcpConfig), null, 2));
133
- console.log(`Consulting ${result.anima.name} (${result.anima.roles.join(', ')})...\n`);
134
- spawnSync('claude', [
135
- '--setting-sources', 'user',
136
- '--dangerously-skip-permissions',
137
- '--system-prompt-file', systemPromptPath,
138
- '--mcp-config', claudeMcpConfigPath,
139
- ], {
140
- cwd: home,
141
- stdio: 'inherit',
142
- });
143
- }
144
- finally {
145
- fs.rmSync(tmpDir, { recursive: true, force: true });
146
- }
80
+ console.log(`Consulting ${result.anima.name} (${result.anima.roles.join(', ')})...\n`);
81
+ launchSession({
82
+ home,
83
+ cwd: home,
84
+ manifest: result,
85
+ mode: 'interactive',
86
+ });
147
87
  });
148
88
  }
149
89
  //# sourceMappingURL=consult.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consult.js","sourceRoot":"","sources":["../../src/commands/consult.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;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,CAAC,kBAAkB,CAAC,IAAI,EAAE,IAAK,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,kDAAkD;QAClD,IAAI,MAA4C,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,UAAW,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAClD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YACrB,OAAO;QACT,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEvF,aAAa,CAAC;YACZ,IAAI;YACJ,GAAG,EAAE,IAAI;YACT,QAAQ,EAAE,MAAM;YAChB,IAAI,EAAE,aAAa;SACpB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,5 +1,2 @@
1
- export declare function makeInitCommand(): import("commander").Command<[string | undefined], {
2
- model: string;
3
- bundle: string;
4
- }, {}>;
1
+ export declare function makeInitCommand(): import("commander").Command;
5
2
  //# sourceMappingURL=init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAwCA,wBAAgB,eAAe;;;OA4D9B"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAwCA,wBAAgB,eAAe,gCAmE9B"}
@@ -67,15 +67,22 @@ export function makeInitCommand() {
67
67
  installBundle({ home, bundleDir, commit: false });
68
68
  // 3. Create ledger via migration engine
69
69
  applyMigrations(home);
70
- // 4. Instantiate the advisor anima
70
+ // 4. Instantiate the starting animas
71
71
  instantiate({
72
72
  home,
73
- name: 'advisor',
73
+ name: 'Advisor',
74
74
  roles: ['advisor'],
75
75
  curriculum: 'guild-operations',
76
76
  temperament: 'guide',
77
77
  });
78
- // 5. Commit everything from the bundle install + advisor
78
+ instantiate({
79
+ home,
80
+ name: 'Unnamed Artificer',
81
+ roles: ['artificer'],
82
+ curriculum: 'guild-operations',
83
+ temperament: 'artisan',
84
+ });
85
+ // 5. Commit everything from the bundle install + animas
79
86
  execFileSync('git', ['add', '-A'], { cwd: home, stdio: 'pipe' });
80
87
  execFileSync('git', ['commit', '-m', 'Install starter kit'], { cwd: home, stdio: 'pipe' });
81
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,MAAM,aAAa,GAAG,QAAQ,CAAC;AAC/B,MAAM,cAAc,GAAG,+BAA+B,CAAC;AAEvD,KAAK,UAAU,MAAM,CAAC,QAAgB,EAAE,YAAqB;IAC3D,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IACtF,IAAI,CAAC;QACH,MAAM,MAAM,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eInstallToolCommand(): import("commander").Command<[string], {
2
- name?: string | undefined;
3
- roles?: string | undefined;
4
- link?: true | undefined;
5
- }, {}>;
1
+ export declare function makeInstallToolCommand(): import("commander").Command;
6
2
  //# sourceMappingURL=install-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"install-tool.d.ts","sourceRoot":"","sources":["../../src/commands/install-tool.ts"],"names":[],"mappings":"AA6BA,wBAAgB,sBAAsB;;;;OAgDrC"}
1
+ {"version":3,"file":"install-tool.d.ts","sourceRoot":"","sources":["../../src/commands/install-tool.ts"],"names":[],"mappings":"AA6BA,wBAAgB,sBAAsB,gCAgDrC"}
@@ -1,6 +1,2 @@
1
- export declare function makeInstantiateCommand(): import("commander").Command<[string], {
2
- roles: string;
3
- curriculum?: string | undefined;
4
- temperament?: string | undefined;
5
- }, {}>;
1
+ export declare function makeInstantiateCommand(): import("commander").Command;
6
2
  //# sourceMappingURL=instantiate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instantiate.d.ts","sourceRoot":"","sources":["../../src/commands/instantiate.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB;;;;OAuCrC"}
1
+ {"version":3,"file":"instantiate.d.ts","sourceRoot":"","sources":["../../src/commands/instantiate.ts"],"names":[],"mappings":"AAIA,wBAAgB,sBAAsB,gCAuCrC"}
@@ -1,4 +1,2 @@
1
- export declare function makeManifestCommand(): import("commander").Command<[string], {
2
- json?: true | undefined;
3
- }, {}>;
1
+ export declare function makeManifestCommand(): import("commander").Command;
4
2
  //# sourceMappingURL=manifest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/commands/manifest.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB;;OAuBlC"}
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/commands/manifest.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,gCAuBlC"}
@@ -1,2 +1,2 @@
1
- export declare function makeRestoreCommand(): import("commander").Command<[], {}, {}>;
1
+ export declare function makeRestoreCommand(): import("commander").Command;
2
2
  //# sourceMappingURL=rehydrate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rehydrate.d.ts","sourceRoot":"","sources":["../../src/commands/rehydrate.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,4CAyCjC"}
1
+ {"version":3,"file":"rehydrate.d.ts","sourceRoot":"","sources":["../../src/commands/rehydrate.ts"],"names":[],"mappings":"AAIA,wBAAgB,kBAAkB,gCAyCjC"}
@@ -1,4 +1,2 @@
1
- export declare function makeRemoveToolCommand(): import("commander").Command<[string], {
2
- type?: string | undefined;
3
- }, {}>;
1
+ export declare function makeRemoveToolCommand(): import("commander").Command;
4
2
  //# sourceMappingURL=remove-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove-tool.d.ts","sourceRoot":"","sources":["../../src/commands/remove-tool.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB;;OAsBpC"}
1
+ {"version":3,"file":"remove-tool.d.ts","sourceRoot":"","sources":["../../src/commands/remove-tool.ts"],"names":[],"mappings":"AAIA,wBAAgB,qBAAqB,gCAsBpC"}
@@ -1,4 +1,2 @@
1
- export declare function makeSignalCommand(): import("commander").Command<[string], {
2
- payload?: string | undefined;
3
- }, {}>;
1
+ export declare function makeSignalCommand(): import("commander").Command;
4
2
  //# sourceMappingURL=signal.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/commands/signal.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB;;OA4BhC"}
1
+ {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/commands/signal.ts"],"names":[],"mappings":"AAIA,wBAAgB,iBAAiB,gCA4BhC"}
@@ -1,2 +1,2 @@
1
- export declare function makeStatusCommand(): import("commander").Command<[], {}, {}>;
1
+ export declare function makeStatusCommand(): import("commander").Command;
2
2
  //# sourceMappingURL=status.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AASA,wBAAgB,iBAAiB,4CAyEhC"}
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/commands/status.ts"],"names":[],"mappings":"AASA,wBAAgB,iBAAiB,gCAyEhC"}
@@ -1,2 +1,2 @@
1
- export declare function makeWorkshopCommand(): import("commander").Command<[], {}, {}>;
1
+ export declare function makeWorkshopCommand(): import("commander").Command;
2
2
  //# sourceMappingURL=workshop.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workshop.d.ts","sourceRoot":"","sources":["../../src/commands/workshop.ts"],"names":[],"mappings":"AAWA,wBAAgB,mBAAmB,4CAmHlC"}
1
+ {"version":3,"file":"workshop.d.ts","sourceRoot":"","sources":["../../src/commands/workshop.ts"],"names":[],"mappings":"AAWA,wBAAgB,mBAAmB,gCAmHlC"}
package/dist/program.d.ts CHANGED
@@ -1,4 +1,2 @@
1
- export declare const program: import("commander").Command<[], {
2
- guildRoot?: string | undefined;
3
- }, {}>;
1
+ export declare const program: import("commander").Command;
4
2
  //# sourceMappingURL=program.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,OAAO;;MAGkE,CAAC"}
1
+ {"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,OAAO,6BAGkE,CAAC"}
package/dist/program.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { createCommand } from 'commander';
2
- import { VERSION } from '@shardworks/nexus-core';
2
+ import { VERSION, registerSummonHandler } from '@shardworks/nexus-core';
3
3
  import { makeInitCommand } from "./commands/init.js";
4
4
  import { makeInstallToolCommand } from "./commands/install-tool.js";
5
5
  import { makeRemoveToolCommand } from "./commands/remove-tool.js";
6
6
  import { makeRestoreCommand } from "./commands/rehydrate.js";
7
- import { makeDispatchCommand } from "./commands/dispatch.js";
7
+ import { makeCommissionCommand } from "./commands/commission.js";
8
8
  import { makeInstantiateCommand } from "./commands/instantiate.js";
9
9
  import { makeManifestCommand } from "./commands/manifest.js";
10
10
  import { makeStatusCommand } from "./commands/status.js";
@@ -12,6 +12,11 @@ import { makeConsultCommand } from "./commands/consult.js";
12
12
  import { makeSignalCommand } from "./commands/signal.js";
13
13
  import { makeClockCommand } from "./commands/clock.js";
14
14
  import { makeWorkshopCommand } from "./commands/workshop.js";
15
+ import { createSummonHandler } from "./summon.js";
16
+ // Register the summon handler so Clockworks can launch anima sessions.
17
+ // This wires the CLI's session launcher into the core's event processing
18
+ // without creating a circular dependency.
19
+ registerSummonHandler(createSummonHandler());
15
20
  export const program = createCommand('nsg')
16
21
  .description('Nexus Mk 2.1 — experimental multi-agent AI system')
17
22
  .version(VERSION)
@@ -19,7 +24,7 @@ export const program = createCommand('nsg')
19
24
  // ── Top-level commands ──────────────────────────────────────────────────
20
25
  program.addCommand(makeInitCommand());
21
26
  program.addCommand(makeConsultCommand());
22
- program.addCommand(makeDispatchCommand());
27
+ program.addCommand(makeCommissionCommand());
23
28
  program.addCommand(makeStatusCommand());
24
29
  program.addCommand(makeSignalCommand());
25
30
  program.addCommand(makeClockCommand());
@@ -1 +1 @@
1
- {"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAA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AAC;AAC9C,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAE9B,2EAA2E;AAC3E,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC;KACtC,WAAW,CAAC,eAAe,CAAC,CAAC;AAChC,UAAU,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC;AAChD,UAAU,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;AAC7C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ import type { ManifestResult } from '@shardworks/engine-manifest';
2
+ export interface SessionOptions {
3
+ /** Absolute path to the guild root (for tool/engine resolution). */
4
+ home: string;
5
+ /** Working directory for the claude process. */
6
+ cwd: string;
7
+ /** Manifest result from engine-manifest. */
8
+ manifest: ManifestResult;
9
+ /** Interactive = stdio inherit; print = commission spec as prompt. */
10
+ mode: 'interactive' | {
11
+ print: string;
12
+ };
13
+ /** Display name for session tracking (--name flag). */
14
+ name?: string;
15
+ }
16
+ export interface SessionResult {
17
+ /** Process exit code (0 = success, non-zero = error or crash). */
18
+ exitCode: number;
19
+ }
20
+ /**
21
+ * Launch a claude session for an anima.
22
+ *
23
+ * Handles all temp file setup, claude process spawning, and cleanup.
24
+ * Returns a SessionResult with the exit code (and eventually metrics).
25
+ *
26
+ * Interactive mode: stdio inherited, human at the keyboard.
27
+ * Print mode: commission spec passed as prompt, output captured.
28
+ */
29
+ export declare function launchSession(options: SessionOptions): SessionResult;
30
+ //# sourceMappingURL=session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAmB,MAAM,6BAA6B,CAAC;AAInF,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,QAAQ,EAAE,cAAc,CAAC;IACzB,sEAAsE;IACtE,IAAI,EAAE,aAAa,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;CAGlB;AA8CD;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,aAAa,CA+CpE"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Session launcher — shared infrastructure for starting claude sessions.
3
+ *
4
+ * Both `nsg consult` (interactive) and the Clockworks `summon` verb
5
+ * (commissioned) use this to launch anima sessions. Factored here so
6
+ * session setup, metrics collection, and cleanup happen in one place.
7
+ */
8
+ import { spawnSync } from 'node:child_process';
9
+ import fs from 'node:fs';
10
+ import os from 'node:os';
11
+ import path from 'node:path';
12
+ import { fileURLToPath } from 'node:url';
13
+ // ── Internal helpers ───────────────────────────────────────────────────
14
+ /**
15
+ * Build the Claude MCP config JSON (mcpServers format) that launches the
16
+ * engine-mcp-server as a stdio process serving the anima's tools.
17
+ */
18
+ function buildClaudeMcpConfig(tmpDir, mcpServerConfigPath, serverConfig) {
19
+ // Resolve engine-mcp-server via ESM resolution (handles both dev .ts and prod .js).
20
+ const engineUrl = import.meta.resolve('@shardworks/engine-mcp-server');
21
+ const enginePath = fileURLToPath(engineUrl);
22
+ // Write a wrapper script that imports and invokes main().
23
+ const wrapperPath = path.join(tmpDir, 'mcp-entry.mjs');
24
+ fs.writeFileSync(wrapperPath, `import { main } from ${JSON.stringify(engineUrl)};\nawait main();\n`);
25
+ // In dev the resolved path is .ts source; add the transform flag.
26
+ const nodeArgs = [];
27
+ if (enginePath.endsWith('.ts')) {
28
+ nodeArgs.push('--disable-warning=ExperimentalWarning', '--experimental-transform-types');
29
+ }
30
+ return {
31
+ mcpServers: {
32
+ 'nexus-guild': {
33
+ command: 'node',
34
+ args: [...nodeArgs, wrapperPath, mcpServerConfigPath],
35
+ env: serverConfig.env ?? {},
36
+ },
37
+ },
38
+ };
39
+ }
40
+ // ── Public API ─────────────────────────────────────────────────────────
41
+ /**
42
+ * Launch a claude session for an anima.
43
+ *
44
+ * Handles all temp file setup, claude process spawning, and cleanup.
45
+ * Returns a SessionResult with the exit code (and eventually metrics).
46
+ *
47
+ * Interactive mode: stdio inherited, human at the keyboard.
48
+ * Print mode: commission spec passed as prompt, output captured.
49
+ */
50
+ export function launchSession(options) {
51
+ const { home, cwd, manifest: result, mode, name } = options;
52
+ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'nsg-session-'));
53
+ try {
54
+ const systemPromptPath = path.join(tmpDir, 'system-prompt.md');
55
+ const mcpServerConfigPath = path.join(tmpDir, 'mcp-server-config.json');
56
+ const claudeMcpConfigPath = path.join(tmpDir, 'claude-mcp-config.json');
57
+ fs.writeFileSync(systemPromptPath, result.systemPrompt);
58
+ fs.writeFileSync(mcpServerConfigPath, JSON.stringify(result.mcpConfig, null, 2));
59
+ fs.writeFileSync(claudeMcpConfigPath, JSON.stringify(buildClaudeMcpConfig(tmpDir, mcpServerConfigPath, result.mcpConfig), null, 2));
60
+ // Base args — shared between interactive and print modes
61
+ const args = [
62
+ '--bare',
63
+ '--setting-sources', 'user',
64
+ '--dangerously-skip-permissions',
65
+ '--system-prompt-file', systemPromptPath,
66
+ '--mcp-config', claudeMcpConfigPath,
67
+ ];
68
+ if (name) {
69
+ args.push('--name', name);
70
+ }
71
+ if (mode === 'interactive') {
72
+ // Interactive: human at keyboard, inherit stdio
73
+ const proc = spawnSync('claude', args, { cwd, stdio: 'inherit' });
74
+ return { exitCode: proc.status ?? 1 };
75
+ }
76
+ else {
77
+ // Print mode: commission spec as prompt, capture output
78
+ args.push('--print', mode.print);
79
+ const proc = spawnSync('claude', args, {
80
+ cwd,
81
+ stdio: ['pipe', 'inherit', 'inherit'],
82
+ });
83
+ return { exitCode: proc.status ?? 1 };
84
+ }
85
+ }
86
+ finally {
87
+ fs.rmSync(tmpDir, { recursive: true, force: true });
88
+ }
89
+ }
90
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyBzC,0EAA0E;AAE1E;;;GAGG;AACH,SAAS,oBAAoB,CAC3B,MAAc,EACd,mBAA2B,EAC3B,YAA6B;IAE7B,oFAAoF;IACpF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAC;IACvE,MAAM,UAAU,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC;IAE5C,0DAA0D;IAC1D,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACvD,EAAE,CAAC,aAAa,CACd,WAAW,EACX,wBAAwB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,oBAAoB,CACtE,CAAC;IAEF,kEAAkE;IAClE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,QAAQ,CAAC,IAAI,CACX,uCAAuC,EACvC,gCAAgC,CACjC,CAAC;IACJ,CAAC;IAED,OAAO;QACL,UAAU,EAAE;YACV,aAAa,EAAE;gBACb,OAAO,EAAE,MAAM;gBACf,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,WAAW,EAAE,mBAAmB,CAAC;gBACrD,GAAG,EAAE,YAAY,CAAC,GAAG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AE,IAAI,CAAC,CAAC;QAC5B,CAAC;QAED,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;YAC3B,gDAAgD;YAChD,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;YAClE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,wDAAwD;YACxD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YAEjC,MAAM,IAAI,GAAG,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE;gBACrC,GAAG;gBACH,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC;aACtC,CAAC,CAAC;YACH,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QACxC,CAAC;IACH,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { SummonHandler } from '@shardworks/nexus-core';
2
+ /**
3
+ * Create a summon handler that can be registered with the Clockworks runner.
4
+ */
5
+ export declare function createSummonHandler(): SummonHandler;
6
+ //# sourceMappingURL=summon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summon.d.ts","sourceRoot":"","sources":["../src/summon.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAc,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIxE;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CA2EnD"}
package/dist/summon.js ADDED
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Summon handler — wires the Clockworks summon verb to the session launcher.
3
+ *
4
+ * When a standing order fires with `summon: "roleName"`, the Clockworks
5
+ * runner calls this handler. It:
6
+ * 1. Resolves the role to an active anima
7
+ * 2. Reads the commission content from the event payload
8
+ * 3. Manifests the anima (system prompt + MCP config)
9
+ * 4. Launches a claude session in the worktree directory
10
+ * 5. Signals commission.session.ended when the session exits
11
+ *
12
+ * This lives in the CLI package (not core) because it depends on
13
+ * engine-manifest and the session launcher, which are CLI-layer concerns.
14
+ */
15
+ import Database from 'better-sqlite3';
16
+ import { manifest } from '@shardworks/engine-manifest';
17
+ import { ledgerPath, signalEvent, updateCommissionStatus, readCommission, } from '@shardworks/nexus-core';
18
+ import { resolveAnimaByRole } from "./commands/consult.js";
19
+ import { launchSession } from "./session.js";
20
+ /**
21
+ * Create a summon handler that can be registered with the Clockworks runner.
22
+ */
23
+ export function createSummonHandler() {
24
+ return async (home, event, roleName, _noticeType) => {
25
+ const payload = event.payload;
26
+ if (!payload || typeof payload.commissionId !== 'number') {
27
+ throw new Error(`Summon handler expected event payload with commissionId, got: ${JSON.stringify(payload)}`);
28
+ }
29
+ const commissionId = payload.commissionId;
30
+ const workshop = payload.workshop;
31
+ const worktreePath = payload.worktreePath;
32
+ // Read commission content from the Ledger
33
+ const commissionRecord = readCommission(home, commissionId);
34
+ if (!commissionRecord) {
35
+ throw new Error(`Commission #${commissionId} not found in the Ledger.`);
36
+ }
37
+ // Resolve role to a specific anima
38
+ const animaName = resolveAnimaByRole(home, roleName);
39
+ // Write commission assignment
40
+ const db = new Database(ledgerPath(home));
41
+ db.pragma('foreign_keys = ON');
42
+ try {
43
+ const animaRow = db.prepare(`SELECT id FROM animas WHERE name = ?`).get(animaName);
44
+ if (animaRow) {
45
+ db.prepare(`INSERT OR IGNORE INTO commission_assignments (commission_id, anima_id) VALUES (?, ?)`).run(commissionId, animaRow.id);
46
+ }
47
+ }
48
+ finally {
49
+ db.close();
50
+ }
51
+ // Update commission status
52
+ updateCommissionStatus(home, commissionId, 'in_progress', `summoned ${animaName} (${roleName})`);
53
+ // Manifest the anima
54
+ const manifestResult = await manifest(home, animaName);
55
+ // Launch session in the worktree
56
+ const sessionResult = launchSession({
57
+ home,
58
+ cwd: worktreePath,
59
+ manifest: manifestResult,
60
+ mode: { print: commissionRecord.content },
61
+ name: `commission-${commissionId}`,
62
+ });
63
+ // Signal session ended for the next standing order (workshop-merge)
64
+ signalEvent(home, 'commission.session.ended', { commissionId, workshop, exitCode: sessionResult.exitCode }, 'framework');
65
+ return { animaName, exitCode: sessionResult.exitCode };
66
+ };
67
+ }
68
+ //# sourceMappingURL=summon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"summon.js","sourceRoot":"","sources":["../src/summon.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EACL,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,cAAc,GACf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,KAAK,EACV,IAAY,EACZ,KAAiB,EACjB,QAAgB,EAChB,WAA+B,EACmB,EAAE;QACpD,MAAM,OAAO,GAAG,KAAK,CAAC,OAAyC,CAAC;QAEhE,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CACb,iEAAiE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAC3F,CAAC;QACJ,CAAC;QAED,MAAM,YAAY,GAAG,OAAO,CAAC,YAAsB,CAAC;QACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAkB,CAAC;QAC5C,MAAM,YAAY,GAAG,OAAO,CAA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pE,WAAW,CACT,IAAI,EACJ,0BAA0B,EAC1B,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,EAC5D,WAAW,CACZ,CAAC;QAEF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,CAAC,QAAQ,EAAE,CAAC;IACzD,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shardworks/nexus",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,16 +26,16 @@
26
26
  "dependencies": {
27
27
  "better-sqlite3": "12.8.0",
28
28
  "commander": "14.0.3",
29
- "@shardworks/nexus-core": "0.1.17",
30
- "@shardworks/engine-ledger-migrate": "0.1.17",
31
- "@shardworks/engine-manifest": "0.1.17",
32
- "@shardworks/tool-install": "0.1.17",
33
- "@shardworks/tool-instantiate": "0.1.17",
34
- "@shardworks/tool-nexus-version": "0.1.17",
35
- "@shardworks/tool-remove": "0.1.17",
36
- "@shardworks/engine-mcp-server": "0.1.17",
37
- "@shardworks/engine-worktree-setup": "0.1.17",
38
- "@shardworks/tool-dispatch": "0.1.17"
29
+ "@shardworks/nexus-core": "0.1.19",
30
+ "@shardworks/engine-ledger-migrate": "0.1.19",
31
+ "@shardworks/engine-manifest": "0.1.19",
32
+ "@shardworks/tool-commission": "0.1.19",
33
+ "@shardworks/tool-instantiate": "0.1.19",
34
+ "@shardworks/tool-install": "0.1.19",
35
+ "@shardworks/tool-remove": "0.1.19",
36
+ "@shardworks/tool-nexus-version": "0.1.19",
37
+ "@shardworks/engine-mcp-server": "0.1.19",
38
+ "@shardworks/engine-worktree-setup": "0.1.19"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@commander-js/extra-typings": "14.0.0",
@@ -1,5 +0,0 @@
1
- export declare function makeDispatchCommand(): import("commander").Command<[string], {
2
- workshop: string;
3
- anima?: string | undefined;
4
- }, {}>;
5
- //# sourceMappingURL=dispatch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB;;;OA0BlC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../src/commands/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,UAAU,mBAAmB;IACjC,OAAO,aAAa,CAAC,UAAU,CAAC;SAC7B,WAAW,CAAC,gCAAgC,CAAC;SAC7C,QAAQ,CAAC,QAAQ,EAAE,kDAAkD,CAAC;SACtE,cAAc,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;SAC1D,MAAM,CAAC,iBAAiB,EAAE,mBAAmB,CAAC;SAC9C,MAAM,CAAC,CAAC,IAAY,EAAE,OAA6C,EAAE,GAAG,EAAE,EAAE;QAC3E,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAE9B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC;gBACtB,IAAI;gBACJ,IAAI;gBACJ,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,KAAK,EAAE,OAAO,CAAC,KAAK;aACrB,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,YAAY,wBAAwB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;YAC3F,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;gBACpB,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EA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