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,184 +1,8 @@
1
- /**
2
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
3
- * @license AGPL-3.0-or-later
4
- */
5
- import { TOOL_ANNOTATIONS } from "../tool-annotations.js";
6
- export const shareToolSpecs = [
7
- {
8
- name: "wyrm_ask",
9
- description: "Wyrm answers a natural-language question using its own data as context. Assembles relevant ground truths, sessions, artifacts, failures, symbols, then runs through Ollama (auto-detected on localhost:11434) or OpenAI (OPENAI_API_KEY fallback). Returns the answer + the context summary. If no LLM is reachable, returns the assembled raw context (degraded mode — explicit, not silent).",
10
- inputSchema: {
11
- type: "object",
12
- properties: {
13
- query: { type: "string", description: "Question in natural language" },
14
- projectPath: { type: "string", description: "Scope context to one project (optional)" },
15
- max_context_chars: { type: "number", description: "Soft cap on assembled context (default 12000, max 50000)" },
16
- model_override: { type: "string", description: "Force a specific model: 'ollama:llama3.2' or 'openai:gpt-4o-mini'" },
17
- },
18
- required: ["query"],
19
- },
20
- annotations: TOOL_ANNOTATIONS["wyrm_ask"],
21
- aliases: [],
22
- handler: async (args, ctx) => {
23
- const { db, subAgent } = ctx;
24
- const { query, projectPath, max_context_chars, model_override } = args;
25
- const project = projectPath ? db.getProject(projectPath) : null;
26
- const result = await subAgent.ask({
27
- query,
28
- project_id: project?.id ?? null,
29
- max_context_chars, model_override,
30
- });
31
- const header = result.degraded
32
- ? `󱅝 Wyrm (${result.model}, ${result.context_chars} ctx chars, ${result.latency_ms}ms) — DEGRADED MODE: ${result.error}\n\n`
33
- : `󱅝 Wyrm (${result.model}, ${result.context_chars} ctx chars, ${result.latency_ms}ms${result.tokens_in ? `, ${result.tokens_in}+${result.tokens_out} tok` : ''}):\n\n`;
34
- return { content: [{ type: "text", text: header + result.answer }] };
35
- },
36
- },
37
- {
38
- name: "wyrm_share",
39
- description: "Use to share a finding with the rest of the team - marks a row (session/quest/truth/artifact/edge) is_shared for the next sync push; make a record private again with wyrm_unshare when it must not leave this machine.",
40
- inputSchema: {
41
- type: "object",
42
- properties: {
43
- kind: { type: "string", enum: ["session", "quest", "truth", "artifact", "edge"] },
44
- id: { type: "number" },
45
- },
46
- required: ["kind", "id"],
47
- },
48
- annotations: TOOL_ANNOTATIONS["wyrm_share"],
49
- aliases: [],
50
- handler: async (args, ctx) => {
51
- const { federation } = ctx;
52
- const { kind, id } = args;
53
- const ok = federation.share(kind, id);
54
- return { content: [{ type: "text", text: ok ? `󱅝 ${kind}#${id} marked shared.` : `󱅝 ${kind}#${id} not found.` }] };
55
- },
56
- },
57
- {
58
- name: "wyrm_unshare",
59
- description: "Revoke team visibility for a row. Local row stays; future syncs won't include it.",
60
- inputSchema: {
61
- type: "object",
62
- properties: {
63
- kind: { type: "string", enum: ["session", "quest", "truth", "artifact", "edge"] },
64
- id: { type: "number" },
65
- },
66
- required: ["kind", "id"],
67
- },
68
- annotations: TOOL_ANNOTATIONS["wyrm_unshare"],
69
- aliases: [],
70
- handler: async (args, ctx) => {
71
- const { federation } = ctx;
72
- const { kind, id } = args;
73
- const ok = federation.unshare(kind, id);
74
- return { content: [{ type: "text", text: ok ? `󱅝 ${kind}#${id} unshared.` : `󱅝 ${kind}#${id} not found.` }] };
75
- },
76
- },
77
- {
78
- name: "wyrm_sync_conflicts",
79
- description: "List unresolved sync conflicts — rows where a remote push landed on top of a newer local edit. Each conflict has been auto-converted into a quest (tag 'sync-conflict') so the operator sees it on next session.",
80
- inputSchema: {
81
- type: "object",
82
- properties: {
83
- limit: { type: "number", description: "Max conflicts (default 50)" },
84
- },
85
- },
86
- annotations: TOOL_ANNOTATIONS["wyrm_sync_conflicts"],
87
- aliases: [],
88
- handler: async (args, ctx) => {
89
- const { federation, sync } = ctx;
90
- const { limit } = args;
91
- const conflicts = federation.unresolvedConflicts(Math.min(Math.max(1, limit ?? 50), 500));
92
- if (conflicts.length === 0) {
93
- return { content: [{ type: "text", text: "󱅝 No unresolved sync conflicts." }] };
94
- }
95
- const text = conflicts.map(c => `• #${c.id} ${c.local_kind}#${c.local_id} from ${c.remote_origin ?? '?'} at ${c.detected_at}` +
96
- (c.quest_id ? ` → quest #${c.quest_id}` : '')).join('\n');
97
- return { content: [{ type: "text", text: `󱅝 ${conflicts.length} unresolved conflict(s):\n${text}` }] };
98
- },
99
- },
100
- {
101
- name: "wyrm_sync_resolve",
102
- description: "Resolve a sync conflict. Mode: 'kept_local' (drop remote), 'kept_remote' (overwrite local with remote payload), 'merged' (apply a hand-merged payload supplied by the caller).",
103
- inputSchema: {
104
- type: "object",
105
- properties: {
106
- conflict_id: { type: "number" },
107
- mode: { type: "string", enum: ["kept_local", "kept_remote", "merged"] },
108
- merged_payload: { type: "object", description: "Required when mode='merged' — full row payload to write" },
109
- },
110
- required: ["conflict_id", "mode"],
111
- },
112
- annotations: TOOL_ANNOTATIONS["wyrm_sync_resolve"],
113
- aliases: [],
114
- handler: async (args, ctx) => {
115
- const { federation } = ctx;
116
- const { conflict_id, mode, merged_payload } = args;
117
- if (mode === 'merged' && !merged_payload) {
118
- return { content: [{ type: "text", text: "merged_payload required for mode=merged" }], isError: true };
119
- }
120
- const ok = federation.resolveConflict(conflict_id, mode, merged_payload);
121
- return { content: [{ type: "text", text: ok ? `󱅝 Conflict #${conflict_id} resolved (${mode}).` : `󱅝 Conflict #${conflict_id} not found or already resolved.` }] };
122
- },
123
- },
124
- {
125
- name: "wyrm_act",
126
- description: "Use to pursue a goal autonomously - the OODA loop: observe Wyrm context, orient, decide one whitelisted tool call, act, loop. Pass goal_id for an existing goal, or query+title to create and pursue ad-hoc.",
127
- inputSchema: {
128
- type: "object",
129
- properties: {
130
- goal_id: { type: "number" },
131
- query: { type: "string", description: "Ad-hoc" },
132
- title: { type: "string", description: "Ad-hoc goal" },
133
- projectPath: { type: "string" },
134
- max_steps: { type: "number", description: "Default 5, cap 50" },
135
- model_override: { type: "string", description: "ollama:model" },
136
- },
137
- },
138
- annotations: TOOL_ANNOTATIONS["wyrm_act"],
139
- aliases: [],
140
- handler: async (args, ctx) => {
141
- const { agentLoop, db, goals } = ctx;
142
- const a = args;
143
- let goalId = a.goal_id;
144
- let createdAdhoc = false;
145
- if (!goalId) {
146
- if (!a.query) {
147
- return { content: [{ type: "text", text: "Either goal_id or query required" }], isError: true };
148
- }
149
- const project = a.projectPath ? db.getProject(a.projectPath) : null;
150
- const goal = goals.set({
151
- project_id: project?.id ?? null,
152
- title: (a.title ?? a.query).slice(0, 140),
153
- description: a.query,
154
- priority: 'medium',
155
- max_iterations: Math.min(50, a.max_steps ?? 5) + 2,
156
- });
157
- goalId = goal.id;
158
- createdAdhoc = true;
159
- }
160
- const results = await agentLoop.pursue(goalId, {
161
- max_steps: a.max_steps,
162
- model_override: a.model_override,
163
- });
164
- if (results.length === 0) {
165
- return { content: [{ type: "text", text: `Goal #${goalId} not active or already at max_iterations.` }], isError: true };
166
- }
167
- const last = results[results.length - 1];
168
- const lines = [];
169
- lines.push(`󱅝 Agent ran ${results.length} iteration(s) on goal #${goalId}${createdAdhoc ? ' (ad-hoc)' : ''}.`);
170
- lines.push(`Final outcome: **${last.outcome}** (model: ${last.model}${last.degraded ? ', DEGRADED' : ''}, ${last.latency_ms}ms)`);
171
- lines.push('');
172
- for (const r of results) {
173
- lines.push(`### Iter #${r.iteration_num} — ${r.outcome}`);
174
- if (r.decided.thought)
175
- lines.push(`> ${r.decided.thought}`);
176
- lines.push(`Action: \`${r.decided.action}\`` + (r.decided.args ? ` args=${JSON.stringify(r.decided.args).slice(0, 200)}` : ''));
177
- lines.push(`Result: ${r.action_result.slice(0, 400)}`);
178
- lines.push('');
179
- }
180
- return { content: [{ type: "text", text: lines.join('\n') }] };
181
- },
182
- },
183
- ];
184
- //# sourceMappingURL=share.js.map
1
+ import{TOOL_ANNOTATIONS as u}from"../tool-annotations.js";const h=[{name:"wyrm_ask",description:"Wyrm answers a natural-language question using its own data as context. Assembles relevant ground truths, sessions, artifacts, failures, symbols, then runs through Ollama (auto-detected on localhost:11434) or OpenAI (OPENAI_API_KEY fallback). Returns the answer + the context summary. If no LLM is reachable, returns the assembled raw context (degraded mode \u2014 explicit, not silent).",inputSchema:{type:"object",properties:{query:{type:"string",description:"Question in natural language"},projectPath:{type:"string",description:"Scope context to one project (optional)"},max_context_chars:{type:"number",description:"Soft cap on assembled context (default 12000, max 50000)"},model_override:{type:"string",description:"Force a specific model: 'ollama:llama3.2' or 'openai:gpt-4o-mini'"}},required:["query"]},annotations:u.wyrm_ask,aliases:[],handler:async(s,a)=>{const{db:i,subAgent:n}=a,{query:t,projectPath:e,max_context_chars:c,model_override:r}=s,p=e?i.getProject(e):null,o=await n.ask({query:t,project_id:p?.id??null,max_context_chars:c,model_override:r});return{content:[{type:"text",text:(o.degraded?`\u{F115D} Wyrm (${o.model}, ${o.context_chars} ctx chars, ${o.latency_ms}ms) \u2014 DEGRADED MODE: ${o.error}
2
+
3
+ `:`\u{F115D} Wyrm (${o.model}, ${o.context_chars} ctx chars, ${o.latency_ms}ms${o.tokens_in?`, ${o.tokens_in}+${o.tokens_out} tok`:""}):
4
+
5
+ `)+o.answer}]}}},{name:"wyrm_share",description:"Use to share a finding with the rest of the team - marks a row (session/quest/truth/artifact/edge) is_shared for the next sync push; make a record private again with wyrm_unshare when it must not leave this machine.",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["session","quest","truth","artifact","edge"]},id:{type:"number"}},required:["kind","id"]},annotations:u.wyrm_share,aliases:[],handler:async(s,a)=>{const{federation:i}=a,{kind:n,id:t}=s;return{content:[{type:"text",text:i.share(n,t)?`\u{F115D} ${n}#${t} marked shared.`:`\u{F115D} ${n}#${t} not found.`}]}}},{name:"wyrm_unshare",description:"Revoke team visibility for a row. Local row stays; future syncs won't include it.",inputSchema:{type:"object",properties:{kind:{type:"string",enum:["session","quest","truth","artifact","edge"]},id:{type:"number"}},required:["kind","id"]},annotations:u.wyrm_unshare,aliases:[],handler:async(s,a)=>{const{federation:i}=a,{kind:n,id:t}=s;return{content:[{type:"text",text:i.unshare(n,t)?`\u{F115D} ${n}#${t} unshared.`:`\u{F115D} ${n}#${t} not found.`}]}}},{name:"wyrm_sync_conflicts",description:"List unresolved sync conflicts \u2014 rows where a remote push landed on top of a newer local edit. Each conflict has been auto-converted into a quest (tag 'sync-conflict') so the operator sees it on next session.",inputSchema:{type:"object",properties:{limit:{type:"number",description:"Max conflicts (default 50)"}}},annotations:u.wyrm_sync_conflicts,aliases:[],handler:async(s,a)=>{const{federation:i,sync:n}=a,{limit:t}=s,e=i.unresolvedConflicts(Math.min(Math.max(1,t??50),500));if(e.length===0)return{content:[{type:"text",text:"\u{F115D} No unresolved sync conflicts."}]};const c=e.map(r=>`\u2022 #${r.id} ${r.local_kind}#${r.local_id} from ${r.remote_origin??"?"} at ${r.detected_at}`+(r.quest_id?` \u2192 quest #${r.quest_id}`:"")).join(`
6
+ `);return{content:[{type:"text",text:`\u{F115D} ${e.length} unresolved conflict(s):
7
+ ${c}`}]}}},{name:"wyrm_sync_resolve",description:"Resolve a sync conflict. Mode: 'kept_local' (drop remote), 'kept_remote' (overwrite local with remote payload), 'merged' (apply a hand-merged payload supplied by the caller).",inputSchema:{type:"object",properties:{conflict_id:{type:"number"},mode:{type:"string",enum:["kept_local","kept_remote","merged"]},merged_payload:{type:"object",description:"Required when mode='merged' \u2014 full row payload to write"}},required:["conflict_id","mode"]},annotations:u.wyrm_sync_resolve,aliases:[],handler:async(s,a)=>{const{federation:i}=a,{conflict_id:n,mode:t,merged_payload:e}=s;return t==="merged"&&!e?{content:[{type:"text",text:"merged_payload required for mode=merged"}],isError:!0}:{content:[{type:"text",text:i.resolveConflict(n,t,e)?`\u{F115D} Conflict #${n} resolved (${t}).`:`\u{F115D} Conflict #${n} not found or already resolved.`}]}}},{name:"wyrm_act",description:"Use to pursue a goal autonomously - the OODA loop: observe Wyrm context, orient, decide one whitelisted tool call, act, loop. Pass goal_id for an existing goal, or query+title to create and pursue ad-hoc.",inputSchema:{type:"object",properties:{goal_id:{type:"number"},query:{type:"string",description:"Ad-hoc"},title:{type:"string",description:"Ad-hoc goal"},projectPath:{type:"string"},max_steps:{type:"number",description:"Default 5, cap 50"},model_override:{type:"string",description:"ollama:model"}}},annotations:u.wyrm_act,aliases:[],handler:async(s,a)=>{const{agentLoop:i,db:n,goals:t}=a,e=s;let c=e.goal_id,r=!1;if(!c){if(!e.query)return{content:[{type:"text",text:"Either goal_id or query required"}],isError:!0};const l=e.projectPath?n.getProject(e.projectPath):null;c=t.set({project_id:l?.id??null,title:(e.title??e.query).slice(0,140),description:e.query,priority:"medium",max_iterations:Math.min(50,e.max_steps??5)+2}).id,r=!0}const p=await i.pursue(c,{max_steps:e.max_steps,model_override:e.model_override});if(p.length===0)return{content:[{type:"text",text:`Goal #${c} not active or already at max_iterations.`}],isError:!0};const o=p[p.length-1],d=[];d.push(`\u{F115D} Agent ran ${p.length} iteration(s) on goal #${c}${r?" (ad-hoc)":""}.`),d.push(`Final outcome: **${o.outcome}** (model: ${o.model}${o.degraded?", DEGRADED":""}, ${o.latency_ms}ms)`),d.push("");for(const l of p)d.push(`### Iter #${l.iteration_num} \u2014 ${l.outcome}`),l.decided.thought&&d.push(`> ${l.decided.thought}`),d.push(`Action: \`${l.decided.action}\``+(l.decided.args?` args=${JSON.stringify(l.decided.args).slice(0,200)}`:"")),d.push(`Result: ${l.action_result.slice(0,400)}`),d.push("");return{content:[{type:"text",text:d.join(`
8
+ `)}]}}}];export{h as shareToolSpecs};