wyrm-mcp 7.2.0 → 7.2.2

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 (156) hide show
  1. package/LICENSE +26 -667
  2. package/NOTICE +14 -33
  3. package/dist/activation.d.ts.map +1 -1
  4. package/dist/activation.js +1 -44
  5. package/dist/activation.js.map +1 -1
  6. package/dist/agent-daemon.js +4 -281
  7. package/dist/agent-loop.js +7 -332
  8. package/dist/analytics.js +13 -236
  9. package/dist/attribution.js +1 -49
  10. package/dist/audit.js +2 -457
  11. package/dist/auto-capture.js +3 -138
  12. package/dist/auto-orchestrator.js +1 -325
  13. package/dist/autoconfig.js +39 -840
  14. package/dist/buddy-runner.js +1 -109
  15. package/dist/buddy.js +14 -564
  16. package/dist/build-flags.js +1 -17
  17. package/dist/capabilities.js +3 -183
  18. package/dist/capture.js +1 -56
  19. package/dist/causality.js +6 -107
  20. package/dist/cli.js +20 -281
  21. package/dist/cloud/cli.js +5 -541
  22. package/dist/cloud/client.js +1 -221
  23. package/dist/cloud/crypto.js +1 -85
  24. package/dist/cloud/machine-id.js +2 -113
  25. package/dist/cloud/recovery.js +1 -60
  26. package/dist/cloud/sync-engine.js +7 -543
  27. package/dist/cloud-backup.js +5 -579
  28. package/dist/cloud-profile.js +1 -138
  29. package/dist/cloud-sync-entrypoint.js +1 -47
  30. package/dist/cloud-sync.js +2 -309
  31. package/dist/constellation.js +12 -168
  32. package/dist/context-build-budgeted.js +4 -144
  33. package/dist/context-ranking.js +1 -69
  34. package/dist/crypto.js +1 -179
  35. package/dist/daemon-write-endpoint.js +1 -290
  36. package/dist/daemon-writer.js +2 -406
  37. package/dist/database.js +43 -1110
  38. package/dist/deprecations.js +2 -162
  39. package/dist/design.js +13 -141
  40. package/dist/event-replication.js +1 -112
  41. package/dist/events-sse.js +7 -43
  42. package/dist/events.js +6 -238
  43. package/dist/failure-patterns.js +42 -659
  44. package/dist/federation.js +12 -236
  45. package/dist/goals.js +13 -101
  46. package/dist/golden.js +3 -355
  47. package/dist/handlers/agent.js +4 -165
  48. package/dist/handlers/alias-adapters.js +1 -129
  49. package/dist/handlers/aliases.js +1 -171
  50. package/dist/handlers/audit.js +1 -87
  51. package/dist/handlers/boundary.js +1 -221
  52. package/dist/handlers/capture.js +73 -1109
  53. package/dist/handlers/causality.js +7 -114
  54. package/dist/handlers/cloud.js +85 -382
  55. package/dist/handlers/companion.js +28 -459
  56. package/dist/handlers/datalake.js +7 -187
  57. package/dist/handlers/dispatch-context.js +0 -22
  58. package/dist/handlers/entity.js +25 -256
  59. package/dist/handlers/events.js +16 -335
  60. package/dist/handlers/failure.js +13 -340
  61. package/dist/handlers/goals.js +4 -296
  62. package/dist/handlers/intelligence.js +126 -674
  63. package/dist/handlers/invoicing.js +1 -70
  64. package/dist/handlers/mcpclient.js +6 -137
  65. package/dist/handlers/orchestration.js +40 -125
  66. package/dist/handlers/output-schemas.js +1 -24
  67. package/dist/handlers/presence.js +3 -99
  68. package/dist/handlers/project.js +28 -182
  69. package/dist/handlers/prompts.js +6 -157
  70. package/dist/handlers/quest.js +4 -224
  71. package/dist/handlers/recall.js +11 -218
  72. package/dist/handlers/registry.js +1 -167
  73. package/dist/handlers/resources.js +1 -288
  74. package/dist/handlers/review.js +11 -74
  75. package/dist/handlers/run.js +17 -487
  76. package/dist/handlers/search.js +15 -326
  77. package/dist/handlers/session.js +28 -615
  78. package/dist/handlers/share.js +8 -184
  79. package/dist/handlers/shims.js +1 -464
  80. package/dist/handlers/skill.js +67 -449
  81. package/dist/handlers/survivors.js +1 -120
  82. package/dist/handlers/symbols.js +8 -109
  83. package/dist/handlers/syncops.js +4 -302
  84. package/dist/handlers/types.js +1 -27
  85. package/dist/harvest.js +5 -191
  86. package/dist/hours.js +7 -156
  87. package/dist/http-auth.js +3 -321
  88. package/dist/http-fast.js +21 -1137
  89. package/dist/icons.js +1 -47
  90. package/dist/index.js +2 -924
  91. package/dist/indexer.js +4 -145
  92. package/dist/intelligence.js +31 -261
  93. package/dist/internal-dispatch.js +3 -212
  94. package/dist/keyset.js +1 -110
  95. package/dist/knowledge-graph.js +12 -176
  96. package/dist/license.d.ts +11 -0
  97. package/dist/license.d.ts.map +1 -1
  98. package/dist/license.js +2 -414
  99. package/dist/license.js.map +1 -1
  100. package/dist/logger.js +2 -199
  101. package/dist/maintenance.js +2 -148
  102. package/dist/mcp-client.js +6 -262
  103. package/dist/memory-artifacts.js +30 -449
  104. package/dist/migrate-prompt.js +2 -124
  105. package/dist/migrations.js +40 -655
  106. package/dist/performance.js +1 -228
  107. package/dist/presence.js +11 -140
  108. package/dist/priority-embed.js +5 -164
  109. package/dist/providers/embedding-provider.js +1 -196
  110. package/dist/readonly-gate.js +1 -29
  111. package/dist/rehydration.js +9 -157
  112. package/dist/reindex.js +1 -88
  113. package/dist/render-target.js +21 -514
  114. package/dist/render.js +4 -280
  115. package/dist/repl-guard.js +1 -173
  116. package/dist/replication-daemon-entrypoint.js +1 -31
  117. package/dist/replication-daemon.js +2 -262
  118. package/dist/resilience.js +1 -591
  119. package/dist/reverse-bridge.js +5 -360
  120. package/dist/security.js +1 -244
  121. package/dist/session-seen.js +3 -51
  122. package/dist/setup.js +1 -260
  123. package/dist/skill-author.js +5 -168
  124. package/dist/spec-kit.js +1 -191
  125. package/dist/sqlite-busy.js +1 -154
  126. package/dist/statusline.js +11 -315
  127. package/dist/sub-agent.js +13 -262
  128. package/dist/summarizer.js +13 -139
  129. package/dist/symbols.js +7 -283
  130. package/dist/sync.js +5 -359
  131. package/dist/tasks-dispatch.js +1 -84
  132. package/dist/tasks.js +1 -282
  133. package/dist/token-budget.js +1 -143
  134. package/dist/tool-analytics.js +7 -129
  135. package/dist/tool-annotations.js +1 -365
  136. package/dist/tool-manifest-v2.json +1 -1
  137. package/dist/tool-manifest.json +1 -1
  138. package/dist/tool-profiles.js +1 -75
  139. package/dist/trace-harvest.js +6 -244
  140. package/dist/types.js +1 -30
  141. package/dist/ui-dashboard.js +41 -50
  142. package/dist/ulid.js +1 -81
  143. package/dist/validate.js +1 -129
  144. package/dist/vault.js +1 -534
  145. package/dist/vectors.js +3 -184
  146. package/dist/version-check.js +4 -136
  147. package/dist/visibility.js +19 -155
  148. package/dist/wyrm-cli.js +98 -2451
  149. package/dist/wyrm-cli.js.map +1 -1
  150. package/dist/wyrm-guard.js +14 -424
  151. package/dist/wyrm-loop.js +3 -150
  152. package/dist/wyrm-manifest.json +1 -1
  153. package/dist/wyrm-statusline-daemon.js +1 -11
  154. package/dist/wyrm-statusline.js +4 -56
  155. package/dist/wyrm-ui.js +9 -77
  156. package/package.json +4 -2
@@ -1,464 +1 @@
1
- /**
2
- * v7 F3 (T022) — the FROZEN-SURFACE noun shims (spec FR-4).
3
- *
4
- * The 7.0 advertised surface collapses the 6.x long tail into ~31 verbs:
5
- * the hot-path singles keep their first-class names (survivors.ts), and the
6
- * remaining domains are advertised as ACTION-PARAM NOUNS — one tool per
7
- * domain, discriminated by `action` (or `mode` on the wyrm_capture write
8
- * funnel). Every noun is a THIN SHIM into the existing dispatcher:
9
- * `resolveShimCall()` translates `(noun, action=X, …args)` onto the original
10
- * 6.x dispatcher case and strips the discriminator — the SAME handler code
11
- * path, never a reimplementation (the T021 alias-spine law). The inverse
12
- * translation (6.x alias name → noun + discriminator) is GENERATED from this
13
- * same table in alias-adapters.ts, so alias → shim → original case roundtrips
14
- * to identity by construction (locked by tests/alias-spine.test.ts).
15
- *
16
- * Spec-FR-4 routing encoded here (task-mandated):
17
- * - sync_conflicts / sync_resolve → wyrm_replication action=conflicts|resolve
18
- * - wyrm_sync → wyrm_project action=sync
19
- * - token_* → wyrm_design_token (off the auth-token
20
- * keyword collision)
21
- * - write funnel: wyrm_capture mode=direct|extract|session|artifacts|import|
22
- * spec|checklist absorbs remember / auto_capture / distill / harvest /
23
- * import_git|pr|rules / spec_register / scaffold_save (mode=classify ==
24
- * the 6.x 'auto');
25
- * mode=trace|debrief arrive with wyrm_run (T027) and are NOT advertised
26
- * before they exist (honesty over spec-completeness — recorded deviation).
27
- * - events_* fold into wyrm_replication (action=publish|since|subscribe|
28
- * replicate) and entity_graph into wyrm_entity action=graph — the spec's
29
- * 34-name FR-4 list conflicts with its own §7 "≤32 advertised" pin; these
30
- * two same-domain folds reconcile it (recorded deviation).
31
- *
32
- * Two EXISTING survivors also gain absorbed actions (their defs stay in
33
- * buildAllTools(); only their route entries live here): wyrm_capture (mode
34
- * funnel) and wyrm_replication (action additions). For those, unknown /
35
- * missing discriminator values PASS THROUGH to their own 6.x case unchanged
36
- * (byte-identical legacy behavior); for the NEW nouns a missing/unknown
37
- * action is a clean SEP-1303 boundary ValidationError (T020).
38
- *
39
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
40
- * @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
41
- */
42
- import { ValidationError } from '../validate.js';
43
- /* ─────────────────────────────────────────────────────────────────────────
44
- * Route table — the single source of truth for shim → case translation AND
45
- * (inverted, in alias-adapters.ts) alias → shim adaptation.
46
- * ───────────────────────────────────────────────────────────────────────── */
47
- export const SHIM_ROUTES = {
48
- wyrm_quest: {
49
- discriminator: 'action',
50
- ownCase: false,
51
- routes: {
52
- add: 'wyrm_quest_add',
53
- complete: 'wyrm_quest_complete',
54
- claim: 'wyrm_quest_claim',
55
- release: 'wyrm_quest_release',
56
- list: 'wyrm_all_quests',
57
- },
58
- },
59
- wyrm_session: {
60
- discriminator: 'action',
61
- ownCase: false,
62
- routes: {
63
- start: 'wyrm_session_start',
64
- update: 'wyrm_session_update',
65
- rehydrate: 'wyrm_session_rehydrate',
66
- },
67
- },
68
- wyrm_skill: {
69
- discriminator: 'action',
70
- ownCase: false,
71
- routes: {
72
- list: 'wyrm_skill_list',
73
- search: 'wyrm_skill_search',
74
- get: 'wyrm_skill_get',
75
- register: 'wyrm_skill_register',
76
- create: 'wyrm_skill_create',
77
- activate: 'wyrm_skill_activate',
78
- deactivate: 'wyrm_skill_deactivate',
79
- graph: 'wyrm_skill_graph',
80
- stats: 'wyrm_skill_stats',
81
- delete: 'wyrm_skill_delete',
82
- },
83
- },
84
- wyrm_entity: {
85
- discriminator: 'action',
86
- ownCase: false,
87
- routes: {
88
- search: 'wyrm_entity_search',
89
- add: 'wyrm_entity_add',
90
- link: 'wyrm_entity_link',
91
- merge: 'wyrm_entity_merge',
92
- path: 'wyrm_entity_path',
93
- graph: 'wyrm_entity_graph', // entity_graph folds in (T022 deviation: §7 ≤32 pin)
94
- },
95
- },
96
- wyrm_decision_trace: {
97
- discriminator: 'action',
98
- ownCase: false,
99
- routes: {
100
- upstream: 'wyrm_decision_upstream',
101
- downstream: 'wyrm_decision_downstream',
102
- invalidate: 'wyrm_decision_invalidate',
103
- },
104
- },
105
- wyrm_goal: {
106
- discriminator: 'action',
107
- ownCase: false,
108
- routes: {
109
- list: 'wyrm_goal_list',
110
- set: 'wyrm_goal_set',
111
- complete: 'wyrm_goal_complete',
112
- pause: 'wyrm_goal_pause',
113
- resume: 'wyrm_goal_resume',
114
- abandon: 'wyrm_goal_abandon',
115
- iterations: 'wyrm_goal_iterations',
116
- },
117
- },
118
- wyrm_presence: {
119
- discriminator: 'action',
120
- ownCase: false,
121
- routes: {
122
- list: 'wyrm_presence_list',
123
- announce: 'wyrm_presence_announce',
124
- release: 'wyrm_presence_release',
125
- },
126
- },
127
- wyrm_mcp: {
128
- discriminator: 'action',
129
- ownCase: false,
130
- routes: {
131
- list: 'wyrm_mcp_list',
132
- register: 'wyrm_mcp_register',
133
- tools: 'wyrm_mcp_tools',
134
- disable: 'wyrm_mcp_disable',
135
- },
136
- },
137
- wyrm_audit: {
138
- discriminator: 'action',
139
- ownCase: false,
140
- routes: {
141
- log: 'wyrm_audit_log',
142
- export: 'wyrm_audit_export',
143
- verify: 'wyrm_audit_verify',
144
- },
145
- },
146
- wyrm_project: {
147
- discriminator: 'action',
148
- ownCase: false,
149
- routes: {
150
- list: 'wyrm_list_projects',
151
- context: 'wyrm_project_context',
152
- scan: 'wyrm_scan_projects',
153
- sync: 'wyrm_sync', // spec FR-4: project absorbs wyrm_sync as action=sync
154
- },
155
- },
156
- wyrm_design_token: {
157
- discriminator: 'action',
158
- ownCase: false,
159
- routes: {
160
- get: 'wyrm_token_get',
161
- set: 'wyrm_token_set',
162
- delete: 'wyrm_token_delete',
163
- },
164
- },
165
- wyrm_reference: {
166
- discriminator: 'action',
167
- ownCase: false,
168
- routes: {
169
- list: 'wyrm_reference_list',
170
- add: 'wyrm_reference_add',
171
- search: 'wyrm_reference_search',
172
- },
173
- },
174
- // ── Existing survivors growing absorbed actions ──────────────────────────
175
- wyrm_replication: {
176
- discriminator: 'action',
177
- ownCase: true, // start|stop|status|tick|peer_* stay on its own 6.x case
178
- routes: {
179
- conflicts: 'wyrm_sync_conflicts', // spec FR-4 routing (task-mandated)
180
- resolve: 'wyrm_sync_resolve',
181
- publish: 'wyrm_events_publish', // events fold (T022 deviation: §7 ≤32 pin)
182
- since: 'wyrm_events_since',
183
- subscribe: 'wyrm_events_subscribe',
184
- replicate: 'wyrm_events_replicate',
185
- },
186
- },
187
- wyrm_capture: {
188
- discriminator: 'mode',
189
- ownCase: true, // auto|quest|truth|memory (and absent) stay on its own case
190
- routes: {
191
- classify: 'wyrm_capture', // self-target: spec's 'classify' == 6.x 'auto' (stripped)
192
- direct: 'wyrm_remember',
193
- extract: 'wyrm_auto_capture',
194
- trace: 'wyrm_capture_trace', // T040: harness trace -> run-tagged review queue
195
- session: 'wyrm_distill',
196
- artifacts: 'wyrm_harvest',
197
- import: { key: 'source', routes: { git: 'wyrm_import_git', pr: 'wyrm_import_pr', rules: 'wyrm_import_rules' } },
198
- spec: 'wyrm_spec_register',
199
- checklist: 'wyrm_scaffold_save',
200
- },
201
- },
202
- };
203
- /* ─────────────────────────────────────────────────────────────────────────
204
- * Advertised definitions for the NEW nouns (the existing survivors' defs
205
- * stay in buildAllTools()). Schemas are LEAN unions of the absorbed tools'
206
- * core parameters — niche optional params are deliberately undeclared (they
207
- * still pass through to the original case untouched) and per-action
208
- * requirements are enforced by the original cases, because the whole default
209
- * surface must serialize ≤8K tokens (spec §7 criterion 1; measured by
210
- * bench/listtools-size.mjs). T026 extracts typed domains; T025 rewrites
211
- * descriptions for discovery.
212
- * ───────────────────────────────────────────────────────────────────────── */
213
- const SHIM_DEFS = [
214
- {
215
- name: 'wyrm_quest',
216
- description: "Use for project tasks and todos - action=add (add a todo or work item), complete (mark a task as done), claim (lock a quest so other agents don't duplicate the work; TTL lease stamped with agent_id/run_id), release, list (what's still open on my plate across all projects). The fleet coordination primitive.",
217
- inputSchema: {
218
- type: 'object',
219
- properties: {
220
- // v7 F3 (T026): property prose compressed to fund the hot-path
221
- // outputSchemas under the 8K default-surface pin (T022/T025 trade).
222
- action: { type: 'string', enum: ['add', 'complete', 'claim', 'release', 'list'] },
223
- projectPath: { type: 'string', description: 'add' },
224
- title: { type: 'string', description: 'add' },
225
- description: { type: 'string' },
226
- priority: { type: 'string', description: 'critical|high|medium|low' },
227
- tags: { type: 'string', description: 'add' },
228
- questId: { type: 'number', description: 'complete' },
229
- quest_id: { type: 'number', description: 'claim/release' },
230
- agent_id: { type: 'string', description: 'claim/release' },
231
- ttl_seconds: { type: 'number', description: 'claim' },
232
- },
233
- required: ['action'],
234
- },
235
- },
236
- {
237
- name: 'wyrm_session',
238
- description: 'Use to track working sessions - action=start (start tracking a new working session on a repo), update (log what you just finished: completed work, issues, commits), rehydrate (the full briefing from a past session so a fresh agent can take over).',
239
- inputSchema: {
240
- type: 'object',
241
- properties: {
242
- action: { type: 'string', enum: ['start', 'update', 'rehydrate'] },
243
- projectPath: { type: 'string', description: 'start/update' },
244
- objectives: { type: 'string' },
245
- completed: { type: 'string', description: 'update' },
246
- issues: { type: 'string' },
247
- commits: { type: 'string', description: 'update' },
248
- notes: { type: 'string' },
249
- session_id: { type: 'number', description: 'rehydrate' },
250
- },
251
- required: ['action'],
252
- },
253
- },
254
- {
255
- name: 'wyrm_skill',
256
- description: 'Use for reusable playbooks (skills) - do we already have a playbook for this? action=list (the playbooks and capabilities registered on this machine), search, get, register, create (package what you just learned into a reusable skill), activate, deactivate, graph (governance tree), stats, delete.',
257
- inputSchema: {
258
- type: 'object',
259
- properties: {
260
- action: { type: 'string', enum: ['list', 'search', 'get', 'register', 'create', 'activate', 'deactivate', 'graph', 'stats', 'delete'] },
261
- name: { type: 'string', description: 'skill name' },
262
- description: { type: 'string', description: 'register/create' },
263
- skillPath: { type: 'string', description: 'register' },
264
- body: { type: 'string', description: 'create' },
265
- query: { type: 'string' },
266
- category: { type: 'string', description: 'list/register/create' },
267
- tier: { type: 'string', description: 'atomic|mega|god' },
268
- limit: { type: 'number', description: 'search' },
269
- },
270
- required: ['action'],
271
- },
272
- },
273
- {
274
- name: 'wyrm_entity',
275
- description: 'Use for the knowledge graph - action=add (a person, vendor, service, or concept), link (record that Alice maintains the deploy pipeline: who maintains, uses, or depends on what), search, merge (destructive), path (how two entities or services are related to each other), graph (show everything connected to an entity, N hops).',
276
- inputSchema: {
277
- type: 'object',
278
- properties: {
279
- action: { type: 'string', enum: ['search', 'add', 'link', 'merge', 'path', 'graph'] },
280
- projectPath: { type: 'string' },
281
- name: { type: 'string', description: 'add' },
282
- type: { type: 'string', description: 'add/search' },
283
- source: { type: 'string', description: 'link/merge/path' },
284
- target: { type: 'string', description: 'link/merge/path' },
285
- relationship: { type: 'string', description: 'link: uses|depends_on' },
286
- query: { type: 'string' },
287
- entity: { type: 'string', description: 'graph' },
288
- depth: { type: 'number', description: 'graph' },
289
- limit: { type: 'number', description: 'search' },
290
- },
291
- required: ['action'],
292
- },
293
- },
294
- {
295
- name: 'wyrm_decision_trace',
296
- description: 'Use to trace decision causality - action=upstream (why did we pick this? walk me through the reasoning chain back to its sources), downstream (if that assumption turns out to be wrong, what else breaks - the blast radius), invalidate (a foundational fact was wrong: flag everything we built on top of it, cascading).',
297
- inputSchema: {
298
- type: 'object',
299
- properties: {
300
- action: { type: 'string', enum: ['upstream', 'downstream', 'invalidate'] },
301
- kind: { type: 'string', enum: ['truth', 'artifact', 'quest', 'session', 'data'] },
302
- id: { type: 'number' },
303
- reason: { type: 'string', description: 'invalidate' },
304
- },
305
- required: ['action'],
306
- },
307
- },
308
- {
309
- name: 'wyrm_goal',
310
- description: 'Use for persistent goals the wyrm-loop daemon pursues autonomously - action=set (define with success criteria), list, complete, pause, resume, abandon, iterations (the OODA pursuit history).',
311
- inputSchema: {
312
- type: 'object',
313
- properties: {
314
- action: { type: 'string', enum: ['list', 'set', 'complete', 'pause', 'resume', 'abandon', 'iterations'] },
315
- title: { type: 'string' },
316
- description: { type: 'string' },
317
- success_criteria: { type: 'string', description: 'set: definition of done' },
318
- priority: { type: 'string', description: 'set: critical|high|medium|low' },
319
- projectPath: { type: 'string' },
320
- id: { type: 'number', description: 'complete/pause/resume/abandon' },
321
- goal_id: { type: 'number', description: 'iterations' },
322
- },
323
- required: ['action'],
324
- },
325
- },
326
- {
327
- name: 'wyrm_presence',
328
- description: "Use for multi-agent presence - who else is working on this right now? action=list, announce (I'm online and working on X; a TTL heartbeat orchestrators and other agents see), release (clean exit: clears presence and drops any quest claims held).",
329
- inputSchema: {
330
- type: 'object',
331
- properties: {
332
- action: { type: 'string', enum: ['list', 'announce', 'release'] },
333
- agent_id: { type: 'string' },
334
- agent_kind: { type: 'string', description: 'announce: claude|codex|human' },
335
- projectPath: { type: 'string' },
336
- current_file: { type: 'string', description: 'announce' },
337
- ttl_seconds: { type: 'number', description: 'announce' },
338
- },
339
- required: ['action'],
340
- },
341
- },
342
- {
343
- name: 'wyrm_mcp',
344
- description: "Use to manage outbound MCP servers Wyrm can call - action=register (command, args, env), list, tools (one-shot tools/list), disable. Call a registered server's tools via wyrm_call_external.",
345
- inputSchema: {
346
- type: 'object',
347
- properties: {
348
- action: { type: 'string', enum: ['list', 'register', 'tools', 'disable'] },
349
- server_name: { type: 'string' },
350
- command: { type: 'string', description: 'register: executable' },
351
- args: { type: 'array', items: { type: 'string' }, description: 'register: argv' },
352
- env: { type: 'object', description: 'register' },
353
- },
354
- required: ['action'],
355
- },
356
- },
357
- {
358
- name: 'wyrm_audit',
359
- description: "Use for the tamper-evident audit chain - action=log (append a tamper-evident, hash-chained record of an admin action), export (the audit history as an offline-verifiable bundle for a compliance review), verify (prove the audit trail hasn't been tampered with).",
360
- inputSchema: {
361
- type: 'object',
362
- properties: {
363
- action: { type: 'string', enum: ['log', 'export', 'verify'] },
364
- event_kind: { type: 'string', description: 'log: tool_call etc' },
365
- actor: { type: 'string' },
366
- projectPath: { type: 'string' },
367
- payload: { type: 'object', description: 'log' },
368
- range_start: { type: 'string', description: 'export' },
369
- range_end: { type: 'string', description: 'export' },
370
- },
371
- required: ['action'],
372
- },
373
- },
374
- {
375
- name: 'wyrm_project',
376
- description: "Use for the project registry and cross-project landscape - action=list, context (one project's memory overview), scan (discover and register git repos under a directory), sync (DB rows to per-project .wyrm folders).",
377
- inputSchema: {
378
- type: 'object',
379
- properties: {
380
- action: { type: 'string', enum: ['list', 'context', 'scan', 'sync'] },
381
- search: { type: 'string', description: 'list' },
382
- limit: { type: 'number' },
383
- projectPath: { type: 'string', description: 'context/sync' },
384
- projectName: { type: 'string', description: 'context' },
385
- path: { type: 'string', description: 'scan' },
386
- watch: { type: 'boolean', description: 'scan' },
387
- recursive: { type: 'boolean' },
388
- direction: { type: 'string', description: 'sync: import|export|both' },
389
- },
390
- required: ['action'],
391
- },
392
- },
393
- {
394
- name: 'wyrm_design_token',
395
- description: "Use for the project's design system - store and read the values the brand uses: color, type, spacing, motion, shadow, radius, breakpoint. action=set (upsert a primary color or spacing value), get (what values does this design system use?), delete.",
396
- inputSchema: {
397
- type: 'object',
398
- properties: {
399
- action: { type: 'string', enum: ['get', 'set', 'delete'] },
400
- projectPath: { type: 'string' },
401
- category: { type: 'string', enum: ['color', 'type', 'spacing', 'motion', 'shadow', 'radius', 'breakpoint', 'custom'] },
402
- key: { type: 'string', description: 'set/delete' },
403
- value: { type: 'string', description: 'set' },
404
- },
405
- required: ['action'],
406
- },
407
- },
408
- {
409
- name: 'wyrm_reference',
410
- description: 'Use for design references and visual inspiration - action=add (clip a website, image, palette, or snippet to keep for later projects), search (find that inspiration link I saved a while back), list.',
411
- inputSchema: {
412
- type: 'object',
413
- properties: {
414
- action: { type: 'string', enum: ['list', 'add', 'search'] },
415
- projectPath: { type: 'string', description: 'Omit for global' },
416
- kind: { type: 'string', enum: ['url', 'image', 'palette', 'snippet'], description: 'add' },
417
- location: { type: 'string', description: 'add: URL/path/inline' },
418
- title: { type: 'string' },
419
- tags: { type: 'string', description: 'add' },
420
- query: { type: 'string', description: 'search' },
421
- limit: { type: 'number' },
422
- },
423
- required: ['action'],
424
- },
425
- },
426
- ];
427
- /** Advertised wire defs for the new nouns (merged into ListTools by index.ts). */
428
- export function shimToolDefs() {
429
- return SHIM_DEFS.map((d) => ({ ...d }));
430
- }
431
- /** The new noun names (sorted) — the advertised surface beyond the 6.x names. */
432
- export const SHIM_TOOL_NAMES = SHIM_DEFS.map((d) => d.name).sort();
433
- /**
434
- * Translate a shim call onto its original 6.x dispatcher case, stripping the
435
- * discriminator(s). Non-shim names pass through untouched. Existing tools
436
- * with `ownCase` keep their 6.x behavior for unrouted discriminator values;
437
- * the new nouns throw a boundary ValidationError (T020 SEP-1303 body) for a
438
- * missing/unknown action. Never mutates `args`.
439
- */
440
- export function resolveShimCall(name, args) {
441
- const entry = SHIM_ROUTES[name];
442
- if (!entry)
443
- return { tool: name, args };
444
- const value = args[entry.discriminator];
445
- const route = typeof value === 'string' ? entry.routes[value] : undefined;
446
- if (route === undefined) {
447
- if (entry.ownCase)
448
- return { tool: name, args }; // 6.x behavior, byte-identical
449
- throw new ValidationError(entry.discriminator, `must be one of: ${Object.keys(entry.routes).join(', ')}`);
450
- }
451
- if (typeof route === 'string') {
452
- const { [entry.discriminator]: _discriminator, ...rest } = args;
453
- return { tool: route, args: rest };
454
- }
455
- // Nested route (capture mode=import → source=git|pr|rules)
456
- const sub = args[route.key];
457
- const subTarget = typeof sub === 'string' ? route.routes[sub] : undefined;
458
- if (subTarget === undefined) {
459
- throw new ValidationError(route.key, `${entry.discriminator}=${String(value)} requires ${route.key} — one of: ${Object.keys(route.routes).join(', ')}`);
460
- }
461
- const { [entry.discriminator]: _discriminator, [route.key]: _sub, ...rest } = args;
462
- return { tool: subTarget, args: rest };
463
- }
464
- //# sourceMappingURL=shims.js.map
1
+ import{ValidationError as a}from"../validate.js";const m={wyrm_quest:{discriminator:"action",ownCase:!1,routes:{add:"wyrm_quest_add",complete:"wyrm_quest_complete",claim:"wyrm_quest_claim",release:"wyrm_quest_release",list:"wyrm_all_quests"}},wyrm_session:{discriminator:"action",ownCase:!1,routes:{start:"wyrm_session_start",update:"wyrm_session_update",rehydrate:"wyrm_session_rehydrate"}},wyrm_skill:{discriminator:"action",ownCase:!1,routes:{list:"wyrm_skill_list",search:"wyrm_skill_search",get:"wyrm_skill_get",register:"wyrm_skill_register",create:"wyrm_skill_create",activate:"wyrm_skill_activate",deactivate:"wyrm_skill_deactivate",graph:"wyrm_skill_graph",stats:"wyrm_skill_stats",delete:"wyrm_skill_delete"}},wyrm_entity:{discriminator:"action",ownCase:!1,routes:{search:"wyrm_entity_search",add:"wyrm_entity_add",link:"wyrm_entity_link",merge:"wyrm_entity_merge",path:"wyrm_entity_path",graph:"wyrm_entity_graph"}},wyrm_decision_trace:{discriminator:"action",ownCase:!1,routes:{upstream:"wyrm_decision_upstream",downstream:"wyrm_decision_downstream",invalidate:"wyrm_decision_invalidate"}},wyrm_goal:{discriminator:"action",ownCase:!1,routes:{list:"wyrm_goal_list",set:"wyrm_goal_set",complete:"wyrm_goal_complete",pause:"wyrm_goal_pause",resume:"wyrm_goal_resume",abandon:"wyrm_goal_abandon",iterations:"wyrm_goal_iterations"}},wyrm_presence:{discriminator:"action",ownCase:!1,routes:{list:"wyrm_presence_list",announce:"wyrm_presence_announce",release:"wyrm_presence_release"}},wyrm_mcp:{discriminator:"action",ownCase:!1,routes:{list:"wyrm_mcp_list",register:"wyrm_mcp_register",tools:"wyrm_mcp_tools",disable:"wyrm_mcp_disable"}},wyrm_audit:{discriminator:"action",ownCase:!1,routes:{log:"wyrm_audit_log",export:"wyrm_audit_export",verify:"wyrm_audit_verify"}},wyrm_project:{discriminator:"action",ownCase:!1,routes:{list:"wyrm_list_projects",context:"wyrm_project_context",scan:"wyrm_scan_projects",sync:"wyrm_sync"}},wyrm_design_token:{discriminator:"action",ownCase:!1,routes:{get:"wyrm_token_get",set:"wyrm_token_set",delete:"wyrm_token_delete"}},wyrm_reference:{discriminator:"action",ownCase:!1,routes:{list:"wyrm_reference_list",add:"wyrm_reference_add",search:"wyrm_reference_search"}},wyrm_replication:{discriminator:"action",ownCase:!0,routes:{conflicts:"wyrm_sync_conflicts",resolve:"wyrm_sync_resolve",publish:"wyrm_events_publish",since:"wyrm_events_since",subscribe:"wyrm_events_subscribe",replicate:"wyrm_events_replicate"}},wyrm_capture:{discriminator:"mode",ownCase:!0,routes:{classify:"wyrm_capture",direct:"wyrm_remember",extract:"wyrm_auto_capture",trace:"wyrm_capture_trace",session:"wyrm_distill",artifacts:"wyrm_harvest",import:{key:"source",routes:{git:"wyrm_import_git",pr:"wyrm_import_pr",rules:"wyrm_import_rules"}},spec:"wyrm_spec_register",checklist:"wyrm_scaffold_save"}}},c=[{name:"wyrm_quest",description:"Use for project tasks and todos - action=add (add a todo or work item), complete (mark a task as done), claim (lock a quest so other agents don't duplicate the work; TTL lease stamped with agent_id/run_id), release, list (what's still open on my plate across all projects). The fleet coordination primitive.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["add","complete","claim","release","list"]},projectPath:{type:"string",description:"add"},title:{type:"string",description:"add"},description:{type:"string"},priority:{type:"string",description:"critical|high|medium|low"},tags:{type:"string",description:"add"},questId:{type:"number",description:"complete"},quest_id:{type:"number",description:"claim/release"},agent_id:{type:"string",description:"claim/release"},ttl_seconds:{type:"number",description:"claim"}},required:["action"]}},{name:"wyrm_session",description:"Use to track working sessions - action=start (start tracking a new working session on a repo), update (log what you just finished: completed work, issues, commits), rehydrate (the full briefing from a past session so a fresh agent can take over).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["start","update","rehydrate"]},projectPath:{type:"string",description:"start/update"},objectives:{type:"string"},completed:{type:"string",description:"update"},issues:{type:"string"},commits:{type:"string",description:"update"},notes:{type:"string"},session_id:{type:"number",description:"rehydrate"}},required:["action"]}},{name:"wyrm_skill",description:"Use for reusable playbooks (skills) - do we already have a playbook for this? action=list (the playbooks and capabilities registered on this machine), search, get, register, create (package what you just learned into a reusable skill), activate, deactivate, graph (governance tree), stats, delete.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["list","search","get","register","create","activate","deactivate","graph","stats","delete"]},name:{type:"string",description:"skill name"},description:{type:"string",description:"register/create"},skillPath:{type:"string",description:"register"},body:{type:"string",description:"create"},query:{type:"string"},category:{type:"string",description:"list/register/create"},tier:{type:"string",description:"atomic|mega|god"},limit:{type:"number",description:"search"}},required:["action"]}},{name:"wyrm_entity",description:"Use for the knowledge graph - action=add (a person, vendor, service, or concept), link (record that Alice maintains the deploy pipeline: who maintains, uses, or depends on what), search, merge (destructive), path (how two entities or services are related to each other), graph (show everything connected to an entity, N hops).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["search","add","link","merge","path","graph"]},projectPath:{type:"string"},name:{type:"string",description:"add"},type:{type:"string",description:"add/search"},source:{type:"string",description:"link/merge/path"},target:{type:"string",description:"link/merge/path"},relationship:{type:"string",description:"link: uses|depends_on"},query:{type:"string"},entity:{type:"string",description:"graph"},depth:{type:"number",description:"graph"},limit:{type:"number",description:"search"}},required:["action"]}},{name:"wyrm_decision_trace",description:"Use to trace decision causality - action=upstream (why did we pick this? walk me through the reasoning chain back to its sources), downstream (if that assumption turns out to be wrong, what else breaks - the blast radius), invalidate (a foundational fact was wrong: flag everything we built on top of it, cascading).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["upstream","downstream","invalidate"]},kind:{type:"string",enum:["truth","artifact","quest","session","data"]},id:{type:"number"},reason:{type:"string",description:"invalidate"}},required:["action"]}},{name:"wyrm_goal",description:"Use for persistent goals the wyrm-loop daemon pursues autonomously - action=set (define with success criteria), list, complete, pause, resume, abandon, iterations (the OODA pursuit history).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["list","set","complete","pause","resume","abandon","iterations"]},title:{type:"string"},description:{type:"string"},success_criteria:{type:"string",description:"set: definition of done"},priority:{type:"string",description:"set: critical|high|medium|low"},projectPath:{type:"string"},id:{type:"number",description:"complete/pause/resume/abandon"},goal_id:{type:"number",description:"iterations"}},required:["action"]}},{name:"wyrm_presence",description:"Use for multi-agent presence - who else is working on this right now? action=list, announce (I'm online and working on X; a TTL heartbeat orchestrators and other agents see), release (clean exit: clears presence and drops any quest claims held).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["list","announce","release"]},agent_id:{type:"string"},agent_kind:{type:"string",description:"announce: claude|codex|human"},projectPath:{type:"string"},current_file:{type:"string",description:"announce"},ttl_seconds:{type:"number",description:"announce"}},required:["action"]}},{name:"wyrm_mcp",description:"Use to manage outbound MCP servers Wyrm can call - action=register (command, args, env), list, tools (one-shot tools/list), disable. Call a registered server's tools via wyrm_call_external.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["list","register","tools","disable"]},server_name:{type:"string"},command:{type:"string",description:"register: executable"},args:{type:"array",items:{type:"string"},description:"register: argv"},env:{type:"object",description:"register"}},required:["action"]}},{name:"wyrm_audit",description:"Use for the tamper-evident audit chain - action=log (append a tamper-evident, hash-chained record of an admin action), export (the audit history as an offline-verifiable bundle for a compliance review), verify (prove the audit trail hasn't been tampered with).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["log","export","verify"]},event_kind:{type:"string",description:"log: tool_call etc"},actor:{type:"string"},projectPath:{type:"string"},payload:{type:"object",description:"log"},range_start:{type:"string",description:"export"},range_end:{type:"string",description:"export"}},required:["action"]}},{name:"wyrm_project",description:"Use for the project registry and cross-project landscape - action=list, context (one project's memory overview), scan (discover and register git repos under a directory), sync (DB rows to per-project .wyrm folders).",inputSchema:{type:"object",properties:{action:{type:"string",enum:["list","context","scan","sync"]},search:{type:"string",description:"list"},limit:{type:"number"},projectPath:{type:"string",description:"context/sync"},projectName:{type:"string",description:"context"},path:{type:"string",description:"scan"},watch:{type:"boolean",description:"scan"},recursive:{type:"boolean"},direction:{type:"string",description:"sync: import|export|both"}},required:["action"]}},{name:"wyrm_design_token",description:"Use for the project's design system - store and read the values the brand uses: color, type, spacing, motion, shadow, radius, breakpoint. action=set (upsert a primary color or spacing value), get (what values does this design system use?), delete.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["get","set","delete"]},projectPath:{type:"string"},category:{type:"string",enum:["color","type","spacing","motion","shadow","radius","breakpoint","custom"]},key:{type:"string",description:"set/delete"},value:{type:"string",description:"set"}},required:["action"]}},{name:"wyrm_reference",description:"Use for design references and visual inspiration - action=add (clip a website, image, palette, or snippet to keep for later projects), search (find that inspiration link I saved a while back), list.",inputSchema:{type:"object",properties:{action:{type:"string",enum:["list","add","search"]},projectPath:{type:"string",description:"Omit for global"},kind:{type:"string",enum:["url","image","palette","snippet"],description:"add"},location:{type:"string",description:"add: URL/path/inline"},title:{type:"string"},tags:{type:"string",description:"add"},query:{type:"string",description:"search"},limit:{type:"number"}},required:["action"]}}];function g(){return c.map(r=>({...r}))}const w=c.map(r=>r.name).sort();function h(r,i){const e=m[r];if(!e)return{tool:r,args:i};const s=i[e.discriminator],t=typeof s=="string"?e.routes[s]:void 0;if(t===void 0){if(e.ownCase)return{tool:r,args:i};throw new a(e.discriminator,`must be one of: ${Object.keys(e.routes).join(", ")}`)}if(typeof t=="string"){const{[e.discriminator]:u,...d}=i;return{tool:t,args:d}}const n=i[t.key],o=typeof n=="string"?t.routes[n]:void 0;if(o===void 0)throw new a(t.key,`${e.discriminator}=${String(s)} requires ${t.key} \u2014 one of: ${Object.keys(t.routes).join(", ")}`);const{[e.discriminator]:y,[t.key]:l,...p}=i;return{tool:o,args:p}}export{m as SHIM_ROUTES,w as SHIM_TOOL_NAMES,h as resolveShimCall,g as shimToolDefs};