wyrm-mcp 7.2.1 → 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 (150) hide show
  1. package/LICENSE +26 -667
  2. package/NOTICE +14 -33
  3. package/dist/activation.js +1 -60
  4. package/dist/agent-daemon.js +4 -281
  5. package/dist/agent-loop.js +7 -332
  6. package/dist/analytics.js +13 -236
  7. package/dist/attribution.js +1 -49
  8. package/dist/audit.js +2 -457
  9. package/dist/auto-capture.js +3 -138
  10. package/dist/auto-orchestrator.js +1 -325
  11. package/dist/autoconfig.js +39 -840
  12. package/dist/buddy-runner.js +1 -109
  13. package/dist/buddy.js +14 -564
  14. package/dist/build-flags.js +1 -17
  15. package/dist/capabilities.js +3 -183
  16. package/dist/capture.js +1 -56
  17. package/dist/causality.js +6 -107
  18. package/dist/cli.js +20 -281
  19. package/dist/cloud/cli.js +5 -541
  20. package/dist/cloud/client.js +1 -221
  21. package/dist/cloud/crypto.js +1 -85
  22. package/dist/cloud/machine-id.js +2 -113
  23. package/dist/cloud/recovery.js +1 -60
  24. package/dist/cloud/sync-engine.js +7 -543
  25. package/dist/cloud-backup.js +5 -579
  26. package/dist/cloud-profile.js +1 -138
  27. package/dist/cloud-sync-entrypoint.js +1 -47
  28. package/dist/cloud-sync.js +2 -309
  29. package/dist/constellation.js +12 -168
  30. package/dist/context-build-budgeted.js +4 -144
  31. package/dist/context-ranking.js +1 -69
  32. package/dist/crypto.js +1 -179
  33. package/dist/daemon-write-endpoint.js +1 -290
  34. package/dist/daemon-writer.js +2 -406
  35. package/dist/database.js +43 -1110
  36. package/dist/deprecations.js +2 -162
  37. package/dist/design.js +13 -141
  38. package/dist/event-replication.js +1 -112
  39. package/dist/events-sse.js +7 -43
  40. package/dist/events.js +6 -238
  41. package/dist/failure-patterns.js +42 -659
  42. package/dist/federation.js +12 -236
  43. package/dist/goals.js +13 -101
  44. package/dist/golden.js +3 -355
  45. package/dist/handlers/agent.js +4 -165
  46. package/dist/handlers/alias-adapters.js +1 -129
  47. package/dist/handlers/aliases.js +1 -171
  48. package/dist/handlers/audit.js +1 -87
  49. package/dist/handlers/boundary.js +1 -221
  50. package/dist/handlers/capture.js +73 -1109
  51. package/dist/handlers/causality.js +7 -114
  52. package/dist/handlers/cloud.js +85 -382
  53. package/dist/handlers/companion.js +28 -459
  54. package/dist/handlers/datalake.js +7 -187
  55. package/dist/handlers/dispatch-context.js +0 -22
  56. package/dist/handlers/entity.js +25 -256
  57. package/dist/handlers/events.js +16 -335
  58. package/dist/handlers/failure.js +13 -340
  59. package/dist/handlers/goals.js +4 -296
  60. package/dist/handlers/intelligence.js +126 -674
  61. package/dist/handlers/invoicing.js +1 -70
  62. package/dist/handlers/mcpclient.js +6 -137
  63. package/dist/handlers/orchestration.js +40 -125
  64. package/dist/handlers/output-schemas.js +1 -24
  65. package/dist/handlers/presence.js +3 -99
  66. package/dist/handlers/project.js +28 -182
  67. package/dist/handlers/prompts.js +6 -157
  68. package/dist/handlers/quest.js +4 -224
  69. package/dist/handlers/recall.js +11 -218
  70. package/dist/handlers/registry.js +1 -167
  71. package/dist/handlers/resources.js +1 -288
  72. package/dist/handlers/review.js +11 -74
  73. package/dist/handlers/run.js +17 -487
  74. package/dist/handlers/search.js +15 -326
  75. package/dist/handlers/session.js +28 -615
  76. package/dist/handlers/share.js +8 -184
  77. package/dist/handlers/shims.js +1 -464
  78. package/dist/handlers/skill.js +67 -449
  79. package/dist/handlers/survivors.js +1 -120
  80. package/dist/handlers/symbols.js +8 -109
  81. package/dist/handlers/syncops.js +4 -302
  82. package/dist/handlers/types.js +1 -27
  83. package/dist/harvest.js +5 -191
  84. package/dist/hours.js +7 -156
  85. package/dist/http-auth.js +3 -321
  86. package/dist/http-fast.js +21 -1137
  87. package/dist/icons.js +1 -47
  88. package/dist/index.js +2 -924
  89. package/dist/indexer.js +4 -145
  90. package/dist/intelligence.js +31 -261
  91. package/dist/internal-dispatch.js +3 -212
  92. package/dist/keyset.js +1 -110
  93. package/dist/knowledge-graph.js +12 -176
  94. package/dist/license.js +2 -441
  95. package/dist/logger.js +2 -199
  96. package/dist/maintenance.js +2 -148
  97. package/dist/mcp-client.js +6 -262
  98. package/dist/memory-artifacts.js +30 -449
  99. package/dist/migrate-prompt.js +2 -124
  100. package/dist/migrations.js +40 -655
  101. package/dist/performance.js +1 -228
  102. package/dist/presence.js +11 -140
  103. package/dist/priority-embed.js +5 -164
  104. package/dist/providers/embedding-provider.js +1 -196
  105. package/dist/readonly-gate.js +1 -29
  106. package/dist/rehydration.js +9 -157
  107. package/dist/reindex.js +1 -88
  108. package/dist/render-target.js +21 -514
  109. package/dist/render.js +4 -280
  110. package/dist/repl-guard.js +1 -173
  111. package/dist/replication-daemon-entrypoint.js +1 -31
  112. package/dist/replication-daemon.js +2 -262
  113. package/dist/resilience.js +1 -591
  114. package/dist/reverse-bridge.js +5 -360
  115. package/dist/security.js +1 -244
  116. package/dist/session-seen.js +3 -51
  117. package/dist/setup.js +1 -260
  118. package/dist/skill-author.js +5 -168
  119. package/dist/spec-kit.js +1 -191
  120. package/dist/sqlite-busy.js +1 -154
  121. package/dist/statusline.js +11 -315
  122. package/dist/sub-agent.js +13 -262
  123. package/dist/summarizer.js +13 -139
  124. package/dist/symbols.js +7 -283
  125. package/dist/sync.js +5 -359
  126. package/dist/tasks-dispatch.js +1 -84
  127. package/dist/tasks.js +1 -282
  128. package/dist/token-budget.js +1 -143
  129. package/dist/tool-analytics.js +7 -129
  130. package/dist/tool-annotations.js +1 -365
  131. package/dist/tool-manifest-v2.json +1 -1
  132. package/dist/tool-manifest.json +1 -1
  133. package/dist/tool-profiles.js +1 -75
  134. package/dist/trace-harvest.js +6 -244
  135. package/dist/types.js +1 -30
  136. package/dist/ui-dashboard.js +41 -50
  137. package/dist/ulid.js +1 -81
  138. package/dist/validate.js +1 -129
  139. package/dist/vault.js +1 -534
  140. package/dist/vectors.js +3 -184
  141. package/dist/version-check.js +4 -136
  142. package/dist/visibility.js +19 -155
  143. package/dist/wyrm-cli.js +98 -2464
  144. package/dist/wyrm-guard.js +14 -424
  145. package/dist/wyrm-loop.js +3 -150
  146. package/dist/wyrm-manifest.json +1 -1
  147. package/dist/wyrm-statusline-daemon.js +1 -11
  148. package/dist/wyrm-statusline.js +4 -56
  149. package/dist/wyrm-ui.js +9 -77
  150. package/package.json +4 -2
@@ -1,296 +1,4 @@
1
- /**
2
- * Goals domain — ToolSpec contract v2 (v7 F3 T018, the proof-of-contract
3
- * migration; originally extracted verbatim from the index.ts dispatch switch
4
- * in v7 A2 slice 1).
5
- *
6
- * Each tool is ONE ToolSpec: the advertised definition (name/description/
7
- * inputSchema — moved here VERBATIM from buildAllTools(), byte-identical on
8
- * the wire) and the handler live on the same object, so the surface and the
9
- * behavior cannot drift. Handlers are typed against the narrow GoalsContext
10
- * slice ({projects, goals}) — NOT the WyrmDB god-object.
11
- *
12
- * v7 F3 (T019): the domain is the first consumer of the single dual-emit
13
- * renderer (src/render.ts) — every success response carries a canonical
14
- * `structuredContent` body validated by the declared `outputSchema`, and
15
- * `content[0].text` is DERIVED from that body by a pure template (plain
16
- * ASCII by default, brand glyphs behind WYRM_FANCY=1). The 6.x prose
17
- * reformats accordingly (spec §6: text persists but reformats; the glyph
18
- * decoration moved behind WYRM_FANCY). Not-found responses stay plain
19
- * `isError` text — error responses are exempt from outputSchema per MCP
20
- * convention (SEP-1303 bodies are T020's, domain not-founds are 6.x prose).
21
- *
22
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
23
- * @license AGPL-3.0-or-later
24
- */
25
- import { TOOL_ANNOTATIONS } from '../tool-annotations.js';
26
- import { renderResult, withGlyph } from '../render.js';
27
- export const goalToolSpecs = [
28
- {
29
- name: "wyrm_goal_set",
30
- description: "Set a persistent goal Wyrm will pursue across sessions. Goals carry title, success_criteria, deadline, priority, and a max_iterations cap. The wyrm-loop daemon picks the highest-priority active goal each tick.",
31
- inputSchema: {
32
- type: "object",
33
- properties: {
34
- title: { type: "string", description: "Short, action-oriented title" },
35
- description: { type: "string", description: "Longer context" },
36
- success_criteria: { type: "string", description: "How Wyrm knows when the goal is done — checked each iteration" },
37
- deadline: { type: "string", description: "Optional ISO timestamp (YYYY-MM-DD or full)" },
38
- priority: { type: "string", enum: ["critical", "high", "medium", "low"], description: "Default: medium" },
39
- max_iterations: { type: "number", description: "Cap on OODA iterations (default 20, max 200) — guard against infinite spinning" },
40
- projectPath: { type: "string", description: "Scope to a project (optional)" },
41
- },
42
- required: ["title"],
43
- },
44
- outputSchema: {
45
- type: "object",
46
- properties: {
47
- id: { type: "integer" },
48
- title: { type: "string" },
49
- priority: { type: "string", enum: ["critical", "high", "medium", "low"] },
50
- status: { type: "string", enum: ["active", "paused", "completed", "abandoned"] },
51
- project_id: { type: ["integer", "null"] },
52
- },
53
- required: ["id", "title", "priority", "status", "project_id"],
54
- },
55
- annotations: TOOL_ANNOTATIONS.wyrm_goal_set,
56
- aliases: [],
57
- handler: (args, { projects, goals }) => {
58
- const a = args;
59
- const project = a.projectPath ? projects.getProject(a.projectPath) : null;
60
- const goal = goals.set({
61
- project_id: project?.id ?? null,
62
- title: a.title,
63
- description: a.description,
64
- success_criteria: a.success_criteria,
65
- deadline: a.deadline,
66
- priority: a.priority,
67
- max_iterations: a.max_iterations,
68
- });
69
- return renderResult({ id: goal.id, title: goal.title, priority: goal.priority, status: goal.status, project_id: goal.project_id }, (b, g) => withGlyph(g.brand, `Goal #${b.id} set [${b.priority}]: ${b.title}`));
70
- },
71
- },
72
- {
73
- name: "wyrm_goal_list",
74
- description: "List goals, optionally filtered by status / project. Default: active goals, prioritized.",
75
- inputSchema: {
76
- type: "object",
77
- properties: {
78
- status: { type: "string", enum: ["active", "paused", "completed", "abandoned"] },
79
- projectPath: { type: "string" },
80
- limit: { type: "number" },
81
- },
82
- },
83
- outputSchema: {
84
- type: "object",
85
- properties: {
86
- count: { type: "integer" },
87
- goals: {
88
- type: "array",
89
- items: {
90
- type: "object",
91
- properties: {
92
- id: { type: "integer" },
93
- title: { type: "string" },
94
- priority: { type: "string", enum: ["critical", "high", "medium", "low"] },
95
- status: { type: "string", enum: ["active", "paused", "completed", "abandoned"] },
96
- iterations_count: { type: "integer" },
97
- max_iterations: { type: "integer" },
98
- progress_pct: { type: "integer", minimum: 0 },
99
- last_outcome: { type: ["string", "null"] },
100
- },
101
- required: ["id", "title", "priority", "status", "iterations_count", "max_iterations", "progress_pct", "last_outcome"],
102
- },
103
- },
104
- },
105
- required: ["count", "goals"],
106
- },
107
- annotations: TOOL_ANNOTATIONS.wyrm_goal_list,
108
- aliases: [],
109
- handler: (args, { projects, goals }) => {
110
- const a = args;
111
- const project = a.projectPath ? projects.getProject(a.projectPath) : null;
112
- const rows = goals.list({ status: a.status, project_id: project?.id, limit: a.limit });
113
- const body = {
114
- count: rows.length,
115
- goals: rows.map((row) => ({
116
- id: row.id,
117
- title: row.title,
118
- priority: row.priority,
119
- status: row.status,
120
- iterations_count: row.iterations_count,
121
- max_iterations: row.max_iterations,
122
- progress_pct: Math.round(100 * row.iterations_count / Math.max(1, row.max_iterations)),
123
- last_outcome: row.last_outcome,
124
- })),
125
- };
126
- return renderResult(body, (b, g) => {
127
- if (b.count === 0)
128
- return withGlyph(g.brand, 'No goals.');
129
- const lines = b.goals.map((row) => `${g.bullet} #${row.id} [${row.priority}/${row.status}] ${row.title} -- ${row.iterations_count}/${row.max_iterations} iter (${row.progress_pct}%)` +
130
- (row.last_outcome ? ` last:${row.last_outcome}` : ''));
131
- return `${withGlyph(g.brand, `${b.count} goal(s):`)}\n${lines.join('\n')}`;
132
- });
133
- },
134
- },
135
- {
136
- name: "wyrm_goal_complete",
137
- description: "Manually mark a goal completed (e.g. when the agent reports done or the operator finishes it).",
138
- inputSchema: {
139
- type: "object",
140
- properties: {
141
- id: { type: "number" },
142
- note: { type: "string", description: "Final outcome note" },
143
- },
144
- required: ["id"],
145
- },
146
- outputSchema: {
147
- type: "object",
148
- properties: {
149
- id: { type: "integer" },
150
- title: { type: "string" },
151
- status: { type: "string", enum: ["completed"] },
152
- },
153
- required: ["id", "title", "status"],
154
- },
155
- annotations: TOOL_ANNOTATIONS.wyrm_goal_complete,
156
- aliases: [],
157
- handler: (args, { goals }) => {
158
- const a = args;
159
- const row = goals.complete(a.id, a.note);
160
- if (!row)
161
- return { content: [{ type: "text", text: `Goal #${a.id} not found.` }], isError: true };
162
- return renderResult({ id: row.id, title: row.title, status: 'completed' }, (b, g) => withGlyph(g.ok, `Goal #${b.id} completed.`));
163
- },
164
- },
165
- {
166
- name: "wyrm_goal_pause",
167
- description: "Pause a goal — wyrm-loop will skip it until resumed.",
168
- inputSchema: {
169
- type: "object",
170
- properties: { id: { type: "number" } },
171
- required: ["id"],
172
- },
173
- outputSchema: {
174
- type: "object",
175
- properties: {
176
- id: { type: "integer" },
177
- title: { type: "string" },
178
- status: { type: "string", enum: ["paused"] },
179
- },
180
- required: ["id", "title", "status"],
181
- },
182
- annotations: TOOL_ANNOTATIONS.wyrm_goal_pause,
183
- aliases: [],
184
- handler: (args, { goals }) => {
185
- const a = args;
186
- const row = goals.pause(a.id);
187
- if (!row)
188
- return { content: [{ type: "text", text: `Goal #${a.id} not found.` }], isError: true };
189
- return renderResult({ id: row.id, title: row.title, status: 'paused' }, (b, g) => withGlyph(g.paused, `Goal #${b.id} paused.`));
190
- },
191
- },
192
- {
193
- name: "wyrm_goal_resume",
194
- description: "Resume a paused goal.",
195
- inputSchema: {
196
- type: "object",
197
- properties: { id: { type: "number" } },
198
- required: ["id"],
199
- },
200
- outputSchema: {
201
- type: "object",
202
- properties: {
203
- id: { type: "integer" },
204
- title: { type: "string" },
205
- status: { type: "string", enum: ["active"] },
206
- },
207
- required: ["id", "title", "status"],
208
- },
209
- annotations: TOOL_ANNOTATIONS.wyrm_goal_resume,
210
- aliases: [],
211
- handler: (args, { goals }) => {
212
- const a = args;
213
- const row = goals.resume(a.id);
214
- if (!row)
215
- return { content: [{ type: "text", text: `Goal #${a.id} not found.` }], isError: true };
216
- return renderResult({ id: row.id, title: row.title, status: 'active' }, (b, g) => withGlyph(g.resumed, `Goal #${b.id} resumed.`));
217
- },
218
- },
219
- {
220
- name: "wyrm_goal_abandon",
221
- description: "Abandon a goal (won't be auto-pursued; record kept for audit).",
222
- inputSchema: {
223
- type: "object",
224
- properties: {
225
- id: { type: "number" },
226
- reason: { type: "string" },
227
- },
228
- required: ["id"],
229
- },
230
- outputSchema: {
231
- type: "object",
232
- properties: {
233
- id: { type: "integer" },
234
- title: { type: "string" },
235
- status: { type: "string", enum: ["abandoned"] },
236
- },
237
- required: ["id", "title", "status"],
238
- },
239
- annotations: TOOL_ANNOTATIONS.wyrm_goal_abandon,
240
- aliases: [],
241
- handler: (args, { goals }) => {
242
- const a = args;
243
- const row = goals.abandon(a.id, a.reason);
244
- if (!row)
245
- return { content: [{ type: "text", text: `Goal #${a.id} not found.` }], isError: true };
246
- return renderResult({ id: row.id, title: row.title, status: 'abandoned' }, (b, g) => withGlyph(g.brand, `Goal #${b.id} abandoned.`));
247
- },
248
- },
249
- {
250
- name: "wyrm_goal_iterations",
251
- description: "List the OODA iterations Wyrm has run for a goal — what it observed, decided, and resulted.",
252
- inputSchema: {
253
- type: "object",
254
- properties: {
255
- goal_id: { type: "number" },
256
- limit: { type: "number" },
257
- },
258
- required: ["goal_id"],
259
- },
260
- outputSchema: {
261
- type: "object",
262
- properties: {
263
- goal_id: { type: "integer" },
264
- count: { type: "integer" },
265
- iterations: {
266
- type: "array",
267
- items: {
268
- type: "object",
269
- properties: {
270
- id: { type: "integer" },
271
- iteration_num: { type: "integer" },
272
- observe_summary: { type: ["string", "null"] },
273
- decided_action: { type: ["string", "null"] },
274
- action_result: { type: ["string", "null"] },
275
- outcome: { type: "string", enum: ["progressed", "blocked", "done", "error"] },
276
- ran_at: { type: "string" },
277
- },
278
- required: ["id", "iteration_num", "outcome", "ran_at"],
279
- },
280
- },
281
- },
282
- required: ["goal_id", "count", "iterations"],
283
- },
284
- annotations: TOOL_ANNOTATIONS.wyrm_goal_iterations,
285
- aliases: [],
286
- handler: (args, { goals }) => {
287
- const a = args;
288
- const rows = goals.iterationsFor(a.goal_id, Math.min(100, a.limit ?? 20));
289
- const body = { goal_id: a.goal_id, count: rows.length, iterations: rows };
290
- return renderResult(body, (b, g) => b.count === 0
291
- ? withGlyph(g.brand, `Goal #${b.goal_id} has no iterations yet.`)
292
- : `${withGlyph(g.brand, `${b.count} iteration(s) for goal #${b.goal_id}:`)}\n${JSON.stringify(b.iterations, null, 2)}`);
293
- },
294
- },
295
- ];
296
- //# sourceMappingURL=goals.js.map
1
+ import{TOOL_ANNOTATIONS as u}from"../tool-annotations.js";import{renderResult as l,withGlyph as p}from"../render.js";const _=[{name:"wyrm_goal_set",description:"Set a persistent goal Wyrm will pursue across sessions. Goals carry title, success_criteria, deadline, priority, and a max_iterations cap. The wyrm-loop daemon picks the highest-priority active goal each tick.",inputSchema:{type:"object",properties:{title:{type:"string",description:"Short, action-oriented title"},description:{type:"string",description:"Longer context"},success_criteria:{type:"string",description:"How Wyrm knows when the goal is done \u2014 checked each iteration"},deadline:{type:"string",description:"Optional ISO timestamp (YYYY-MM-DD or full)"},priority:{type:"string",enum:["critical","high","medium","low"],description:"Default: medium"},max_iterations:{type:"number",description:"Cap on OODA iterations (default 20, max 200) \u2014 guard against infinite spinning"},projectPath:{type:"string",description:"Scope to a project (optional)"}},required:["title"]},outputSchema:{type:"object",properties:{id:{type:"integer"},title:{type:"string"},priority:{type:"string",enum:["critical","high","medium","low"]},status:{type:"string",enum:["active","paused","completed","abandoned"]},project_id:{type:["integer","null"]}},required:["id","title","priority","status","project_id"]},annotations:u.wyrm_goal_set,aliases:[],handler:(o,{projects:n,goals:i})=>{const t=o,a=t.projectPath?n.getProject(t.projectPath):null,e=i.set({project_id:a?.id??null,title:t.title,description:t.description,success_criteria:t.success_criteria,deadline:t.deadline,priority:t.priority,max_iterations:t.max_iterations});return l({id:e.id,title:e.title,priority:e.priority,status:e.status,project_id:e.project_id},(d,r)=>p(r.brand,`Goal #${d.id} set [${d.priority}]: ${d.title}`))}},{name:"wyrm_goal_list",description:"List goals, optionally filtered by status / project. Default: active goals, prioritized.",inputSchema:{type:"object",properties:{status:{type:"string",enum:["active","paused","completed","abandoned"]},projectPath:{type:"string"},limit:{type:"number"}}},outputSchema:{type:"object",properties:{count:{type:"integer"},goals:{type:"array",items:{type:"object",properties:{id:{type:"integer"},title:{type:"string"},priority:{type:"string",enum:["critical","high","medium","low"]},status:{type:"string",enum:["active","paused","completed","abandoned"]},iterations_count:{type:"integer"},max_iterations:{type:"integer"},progress_pct:{type:"integer",minimum:0},last_outcome:{type:["string","null"]}},required:["id","title","priority","status","iterations_count","max_iterations","progress_pct","last_outcome"]}}},required:["count","goals"]},annotations:u.wyrm_goal_list,aliases:[],handler:(o,{projects:n,goals:i})=>{const t=o,a=t.projectPath?n.getProject(t.projectPath):null,e=i.list({status:t.status,project_id:a?.id,limit:t.limit}),d={count:e.length,goals:e.map(r=>({id:r.id,title:r.title,priority:r.priority,status:r.status,iterations_count:r.iterations_count,max_iterations:r.max_iterations,progress_pct:Math.round(100*r.iterations_count/Math.max(1,r.max_iterations)),last_outcome:r.last_outcome}))};return l(d,(r,c)=>{if(r.count===0)return p(c.brand,"No goals.");const m=r.goals.map(s=>`${c.bullet} #${s.id} [${s.priority}/${s.status}] ${s.title} -- ${s.iterations_count}/${s.max_iterations} iter (${s.progress_pct}%)`+(s.last_outcome?` last:${s.last_outcome}`:""));return`${p(c.brand,`${r.count} goal(s):`)}
2
+ ${m.join(`
3
+ `)}`})}},{name:"wyrm_goal_complete",description:"Manually mark a goal completed (e.g. when the agent reports done or the operator finishes it).",inputSchema:{type:"object",properties:{id:{type:"number"},note:{type:"string",description:"Final outcome note"}},required:["id"]},outputSchema:{type:"object",properties:{id:{type:"integer"},title:{type:"string"},status:{type:"string",enum:["completed"]}},required:["id","title","status"]},annotations:u.wyrm_goal_complete,aliases:[],handler:(o,{goals:n})=>{const i=o,t=n.complete(i.id,i.note);return t?l({id:t.id,title:t.title,status:"completed"},(a,e)=>p(e.ok,`Goal #${a.id} completed.`)):{content:[{type:"text",text:`Goal #${i.id} not found.`}],isError:!0}}},{name:"wyrm_goal_pause",description:"Pause a goal \u2014 wyrm-loop will skip it until resumed.",inputSchema:{type:"object",properties:{id:{type:"number"}},required:["id"]},outputSchema:{type:"object",properties:{id:{type:"integer"},title:{type:"string"},status:{type:"string",enum:["paused"]}},required:["id","title","status"]},annotations:u.wyrm_goal_pause,aliases:[],handler:(o,{goals:n})=>{const i=o,t=n.pause(i.id);return t?l({id:t.id,title:t.title,status:"paused"},(a,e)=>p(e.paused,`Goal #${a.id} paused.`)):{content:[{type:"text",text:`Goal #${i.id} not found.`}],isError:!0}}},{name:"wyrm_goal_resume",description:"Resume a paused goal.",inputSchema:{type:"object",properties:{id:{type:"number"}},required:["id"]},outputSchema:{type:"object",properties:{id:{type:"integer"},title:{type:"string"},status:{type:"string",enum:["active"]}},required:["id","title","status"]},annotations:u.wyrm_goal_resume,aliases:[],handler:(o,{goals:n})=>{const i=o,t=n.resume(i.id);return t?l({id:t.id,title:t.title,status:"active"},(a,e)=>p(e.resumed,`Goal #${a.id} resumed.`)):{content:[{type:"text",text:`Goal #${i.id} not found.`}],isError:!0}}},{name:"wyrm_goal_abandon",description:"Abandon a goal (won't be auto-pursued; record kept for audit).",inputSchema:{type:"object",properties:{id:{type:"number"},reason:{type:"string"}},required:["id"]},outputSchema:{type:"object",properties:{id:{type:"integer"},title:{type:"string"},status:{type:"string",enum:["abandoned"]}},required:["id","title","status"]},annotations:u.wyrm_goal_abandon,aliases:[],handler:(o,{goals:n})=>{const i=o,t=n.abandon(i.id,i.reason);return t?l({id:t.id,title:t.title,status:"abandoned"},(a,e)=>p(e.brand,`Goal #${a.id} abandoned.`)):{content:[{type:"text",text:`Goal #${i.id} not found.`}],isError:!0}}},{name:"wyrm_goal_iterations",description:"List the OODA iterations Wyrm has run for a goal \u2014 what it observed, decided, and resulted.",inputSchema:{type:"object",properties:{goal_id:{type:"number"},limit:{type:"number"}},required:["goal_id"]},outputSchema:{type:"object",properties:{goal_id:{type:"integer"},count:{type:"integer"},iterations:{type:"array",items:{type:"object",properties:{id:{type:"integer"},iteration_num:{type:"integer"},observe_summary:{type:["string","null"]},decided_action:{type:["string","null"]},action_result:{type:["string","null"]},outcome:{type:"string",enum:["progressed","blocked","done","error"]},ran_at:{type:"string"}},required:["id","iteration_num","outcome","ran_at"]}}},required:["goal_id","count","iterations"]},annotations:u.wyrm_goal_iterations,aliases:[],handler:(o,{goals:n})=>{const i=o,t=n.iterationsFor(i.goal_id,Math.min(100,i.limit??20)),a={goal_id:i.goal_id,count:t.length,iterations:t};return l(a,(e,d)=>e.count===0?p(d.brand,`Goal #${e.goal_id} has no iterations yet.`):`${p(d.brand,`${e.count} iteration(s) for goal #${e.goal_id}:`)}
4
+ ${JSON.stringify(e.iterations,null,2)}`)}}];export{_ as goalToolSpecs};