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,109 +1 @@
1
- /**
2
- * Companion-buddy runner (v7 F4 T036 - extracted from the index.ts monolith).
3
- * The buddy fold's ONE implementation: wyrm_buddy calls it directly and the
4
- * well-known `buddy` tool calls it when any companion param is present. Lifted
5
- * VERBATIM behind a factory that captures the same singletons it always closed
6
- * over (db / mcpClient / our version string for cycle-prevention).
7
- *
8
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
9
- * @license AGPL-3.0-or-later
10
- */
11
- import { gatherBuddyInputs, buildBuddyOutput } from "./buddy.js";
12
- export function makeRunCompanionBuddy(deps) {
13
- const { db, mcpClient, version } = deps;
14
- /**
15
- * Spec 015 — buddy federation.
16
- *
17
- * For each registered + enabled outbound MCP server, list its tools and
18
- * call any whose name matches /^(buddy_|.+_buddy$)/ (case-insensitive).
19
- * Collects up to 3 replies; budget-frugal, best-effort.
20
- */
21
- async function collectExternalBuddyReplies(projectId) {
22
- const replies = [];
23
- const servers = mcpClient.list().filter((r) => r.enabled);
24
- // Identify ourselves for cycle prevention per Buddy Protocol v1.0 §4.
25
- const fromBuddy = `wyrm@${version}`;
26
- // Try to give peers context — name of the project the local buddy is on.
27
- let projectHint;
28
- try {
29
- const row = db.getDatabase().prepare('SELECT name FROM projects WHERE id = ?').get(projectId);
30
- projectHint = row?.name;
31
- }
32
- catch { /* fine */ }
33
- for (const srv of servers) {
34
- if (replies.length >= 3)
35
- break;
36
- let tools = null;
37
- try {
38
- tools = await mcpClient.listTools(srv.server_name);
39
- }
40
- catch {
41
- continue;
42
- }
43
- if (!tools)
44
- continue;
45
- // Prefer well-known `buddy` (Buddy Protocol v1.0); fall back to `*_buddy` / `buddy_*` patterns.
46
- const wellKnown = tools.find((t) => t.name.toLowerCase() === 'buddy');
47
- const buddyTools = wellKnown
48
- ? [wellKnown]
49
- : tools.filter((t) => /^(buddy_|.*_buddy)$/i.test(t.name));
50
- for (const t of buddyTools) {
51
- if (replies.length >= 3)
52
- break;
53
- try {
54
- const r = await mcpClient.call(srv.server_name, t.name, {
55
- from_buddy: fromBuddy,
56
- project_hint: projectHint,
57
- size: 'compact',
58
- });
59
- const text = typeof r.result === 'string' ? r.result : JSON.stringify(r.result).slice(0, 800);
60
- if (text)
61
- replies.push({ server: srv.server_name, tool: t.name, reply: text });
62
- }
63
- catch { /* skip on error */ }
64
- }
65
- }
66
- return replies;
67
- }
68
- /**
69
- * v7 F3 (T021) — the companion buddy code path, extracted VERBATIM from the
70
- * wyrm_buddy switch case so the buddy fold shares ONE implementation:
71
- * `wyrm_buddy` calls it directly, and the well-known `buddy` tool calls it
72
- * whenever any companion param (persona/persona_name/mood/federate/
73
- * project_path — handlers/alias-adapters.ts) is present. Never a duplicate;
74
- * the alias spine routes wyrm_buddy → buddy with an argument adapter and the
75
- * golden replay CI proves both entries byte-equivalent.
76
- */
77
- async function runCompanionBuddy(args) {
78
- const { project_path: bdPath, mood: bdMood, persona: bdPersona, persona_name: bdPersonaName, federate: bdFederate, size: bdSize } = args;
79
- // Resolve project: explicit path > cwd > nothing
80
- const cwd = bdPath ?? process.cwd();
81
- const project = db.getProject(cwd);
82
- if (!project) {
83
- return {
84
- content: [{
85
- type: 'text',
86
- text: `󱅝 I don't see *${cwd}* in my hoard yet — scan it first with \`wyrm_scan_projects\`, then come back.`,
87
- }],
88
- };
89
- }
90
- const persona = bdPersona ?? process.env.WYRM_BUDDY_DEFAULT_PERSONA ?? 'wyrm';
91
- const inputs = gatherBuddyInputs(db.getDatabase(), project.id);
92
- // Federate with other "*_buddy" tools on registered external MCPs.
93
- // Skipped in quiet mode (token-frugal) and on explicit federate:false.
94
- if (bdFederate !== false && bdMood !== 'quiet') {
95
- try {
96
- const externals = await collectExternalBuddyReplies(project.id);
97
- if (externals.length > 0)
98
- inputs.externalBuddies = externals;
99
- }
100
- catch {
101
- // Federation is best-effort. Don't fail the local buddy on a remote hiccup.
102
- }
103
- }
104
- const out = buildBuddyOutput(inputs, { mood: bdMood, persona, personaName: bdPersonaName, size: bdSize });
105
- return { content: [{ type: 'text', text: out.markdown }] };
106
- }
107
- return runCompanionBuddy;
108
- }
109
- //# sourceMappingURL=buddy-runner.js.map
1
+ import{gatherBuddyInputs as _,buildBuddyOutput as g}from"./buddy.js";function v(f){const{db:d,mcpClient:u,version:b}=f;async function h(l){const n=[],c=u.list().filter(t=>t.enabled),p=`wyrm@${b}`;let i;try{i=d.getDatabase().prepare("SELECT name FROM projects WHERE id = ?").get(l)?.name}catch{}for(const t of c){if(n.length>=3)break;let o=null;try{o=await u.listTools(t.server_name)}catch{continue}if(!o)continue;const s=o.find(e=>e.name.toLowerCase()==="buddy"),a=s?[s]:o.filter(e=>/^(buddy_|.*_buddy)$/i.test(e.name));for(const e of a){if(n.length>=3)break;try{const r=await u.call(t.server_name,e.name,{from_buddy:p,project_hint:i,size:"compact"}),m=typeof r.result=="string"?r.result:JSON.stringify(r.result).slice(0,800);m&&n.push({server:t.server_name,tool:e.name,reply:m})}catch{}}}return n}async function w(l){const{project_path:n,mood:c,persona:p,persona_name:i,federate:t,size:o}=l,s=n??process.cwd(),a=d.getProject(s);if(!a)return{content:[{type:"text",text:`\u{F115D} I don't see *${s}* in my hoard yet \u2014 scan it first with \`wyrm_scan_projects\`, then come back.`}]};const e=p??process.env.WYRM_BUDDY_DEFAULT_PERSONA??"wyrm",r=_(d.getDatabase(),a.id);if(t!==!1&&c!=="quiet")try{const y=await h(a.id);y.length>0&&(r.externalBuddies=y)}catch{}return{content:[{type:"text",text:g(r,{mood:c,persona:e,personaName:i,size:o}).markdown}]}}return w}export{v as makeRunCompanionBuddy};