wyrm-mcp 7.3.2 → 7.3.3

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 (184) hide show
  1. package/README.md +8 -14
  2. package/dist/activation.js +59 -1
  3. package/dist/agent-daemon.js +281 -4
  4. package/dist/agent-loop.js +332 -7
  5. package/dist/analytics.js +236 -13
  6. package/dist/attribution.js +49 -1
  7. package/dist/audit.js +457 -2
  8. package/dist/auto-capture.js +138 -3
  9. package/dist/auto-orchestrator.js +325 -1
  10. package/dist/autoconfig.d.ts +50 -0
  11. package/dist/autoconfig.d.ts.map +1 -1
  12. package/dist/autoconfig.js +1115 -39
  13. package/dist/autoconfig.js.map +1 -1
  14. package/dist/buddy-runner.js +109 -1
  15. package/dist/buddy.js +564 -14
  16. package/dist/build-flags.js +15 -1
  17. package/dist/capabilities.js +183 -3
  18. package/dist/capture.js +56 -1
  19. package/dist/causality.js +148 -8
  20. package/dist/cli.js +281 -20
  21. package/dist/cloud/cli.js +541 -5
  22. package/dist/cloud/client.js +221 -1
  23. package/dist/cloud/crypto.js +85 -1
  24. package/dist/cloud/machine-id.js +113 -2
  25. package/dist/cloud/recovery.js +60 -1
  26. package/dist/cloud/sync-engine.js +543 -7
  27. package/dist/cloud-backup.js +579 -5
  28. package/dist/cloud-profile.js +138 -1
  29. package/dist/cloud-sync-entrypoint.js +47 -1
  30. package/dist/cloud-sync.js +309 -2
  31. package/dist/connectors/bridge-source.d.ts +46 -0
  32. package/dist/connectors/bridge-source.d.ts.map +1 -0
  33. package/dist/connectors/bridge-source.js +77 -0
  34. package/dist/connectors/bridge-source.js.map +1 -0
  35. package/dist/connectors/index.d.ts +24 -0
  36. package/dist/connectors/index.d.ts.map +1 -0
  37. package/dist/connectors/index.js +69 -0
  38. package/dist/connectors/index.js.map +1 -0
  39. package/dist/connectors/ingest.d.ts +16 -0
  40. package/dist/connectors/ingest.d.ts.map +1 -0
  41. package/dist/connectors/ingest.js +116 -0
  42. package/dist/connectors/ingest.js.map +1 -0
  43. package/dist/connectors/types.d.ts +99 -0
  44. package/dist/connectors/types.d.ts.map +1 -0
  45. package/dist/connectors/types.js +17 -0
  46. package/dist/connectors/types.js.map +1 -0
  47. package/dist/constellation.js +168 -12
  48. package/dist/content-signature.js +45 -1
  49. package/dist/context-build-budgeted.js +144 -4
  50. package/dist/context-ranking.js +69 -1
  51. package/dist/crypto.js +179 -1
  52. package/dist/daemon-write-endpoint.js +290 -1
  53. package/dist/daemon-writer.js +406 -2
  54. package/dist/database.js +1278 -53
  55. package/dist/deprecations.js +162 -2
  56. package/dist/design.js +141 -13
  57. package/dist/event-replication.js +112 -1
  58. package/dist/events-sse.js +43 -7
  59. package/dist/events.js +238 -6
  60. package/dist/failure-patterns.d.ts +107 -0
  61. package/dist/failure-patterns.d.ts.map +1 -1
  62. package/dist/failure-patterns.js +924 -43
  63. package/dist/failure-patterns.js.map +1 -1
  64. package/dist/federation.js +236 -12
  65. package/dist/goals.js +101 -13
  66. package/dist/golden.js +355 -3
  67. package/dist/handlers/agent.js +165 -4
  68. package/dist/handlers/alias-adapters.js +129 -1
  69. package/dist/handlers/aliases.js +171 -1
  70. package/dist/handlers/audit.js +87 -1
  71. package/dist/handlers/boundary.js +221 -1
  72. package/dist/handlers/capture.js +1114 -73
  73. package/dist/handlers/causality.js +119 -9
  74. package/dist/handlers/cloud.js +382 -85
  75. package/dist/handlers/companion.js +459 -28
  76. package/dist/handlers/datalake.js +187 -7
  77. package/dist/handlers/dispatch-context.js +22 -0
  78. package/dist/handlers/entity.js +256 -25
  79. package/dist/handlers/events.js +335 -16
  80. package/dist/handlers/failure.d.ts.map +1 -1
  81. package/dist/handlers/failure.js +408 -13
  82. package/dist/handlers/failure.js.map +1 -1
  83. package/dist/handlers/goals.js +296 -4
  84. package/dist/handlers/intelligence.js +681 -126
  85. package/dist/handlers/invoicing.js +70 -1
  86. package/dist/handlers/mcpclient.js +137 -6
  87. package/dist/handlers/orchestration.js +125 -40
  88. package/dist/handlers/output-schemas.js +24 -1
  89. package/dist/handlers/presence.js +99 -3
  90. package/dist/handlers/project.js +182 -28
  91. package/dist/handlers/prompts.js +157 -6
  92. package/dist/handlers/quest.js +224 -4
  93. package/dist/handlers/recall.js +237 -13
  94. package/dist/handlers/registry.js +167 -1
  95. package/dist/handlers/resources.js +288 -1
  96. package/dist/handlers/review.js +74 -11
  97. package/dist/handlers/run.js +498 -16
  98. package/dist/handlers/search.js +338 -15
  99. package/dist/handlers/session.js +643 -31
  100. package/dist/handlers/share.js +184 -8
  101. package/dist/handlers/shims.js +464 -1
  102. package/dist/handlers/skill.js +449 -67
  103. package/dist/handlers/survivors.js +120 -1
  104. package/dist/handlers/symbols.js +109 -8
  105. package/dist/handlers/syncops.js +302 -4
  106. package/dist/handlers/types.js +27 -1
  107. package/dist/harvest.js +191 -5
  108. package/dist/hours.js +156 -7
  109. package/dist/http-auth.js +321 -3
  110. package/dist/http-fast.js +1302 -22
  111. package/dist/icons.js +47 -1
  112. package/dist/importers.js +268 -1
  113. package/dist/index.js +840 -2
  114. package/dist/indexer.js +145 -4
  115. package/dist/intelligence.js +261 -31
  116. package/dist/internal-dispatch.js +212 -3
  117. package/dist/keyset.js +110 -1
  118. package/dist/knowledge-graph.js +176 -12
  119. package/dist/license.js +441 -2
  120. package/dist/logger.js +199 -2
  121. package/dist/maintenance.js +148 -2
  122. package/dist/mcp-client.js +262 -6
  123. package/dist/memory-artifacts.js +596 -32
  124. package/dist/migrate-prompt.js +124 -2
  125. package/dist/migrations.d.ts.map +1 -1
  126. package/dist/migrations.js +799 -42
  127. package/dist/migrations.js.map +1 -1
  128. package/dist/performance.js +228 -1
  129. package/dist/presence.js +140 -11
  130. package/dist/priority-embed.js +164 -5
  131. package/dist/providers/embedding-provider.js +196 -1
  132. package/dist/readonly-gate.js +29 -1
  133. package/dist/receipt.js +43 -1
  134. package/dist/rehydration.js +157 -9
  135. package/dist/reindex.js +88 -1
  136. package/dist/render-target.js +544 -21
  137. package/dist/render.js +280 -4
  138. package/dist/repl-guard.js +173 -1
  139. package/dist/replication-daemon-entrypoint.js +31 -1
  140. package/dist/replication-daemon.js +262 -2
  141. package/dist/rerank.js +142 -1
  142. package/dist/resilience.js +591 -1
  143. package/dist/reverse-bridge.js +360 -5
  144. package/dist/security.js +244 -1
  145. package/dist/session-seen.js +51 -3
  146. package/dist/setup.js +260 -1
  147. package/dist/skill-author.js +168 -5
  148. package/dist/spec-kit.js +191 -1
  149. package/dist/sqlite-busy.js +154 -1
  150. package/dist/statusline.js +315 -11
  151. package/dist/sub-agent.js +262 -13
  152. package/dist/summarizer.js +139 -13
  153. package/dist/symbols.js +283 -7
  154. package/dist/sync.js +359 -5
  155. package/dist/tasks-dispatch.js +84 -1
  156. package/dist/tasks.js +282 -1
  157. package/dist/token-budget.js +143 -1
  158. package/dist/tool-analytics.js +129 -7
  159. package/dist/tool-annotations.js +365 -1
  160. package/dist/tool-manifest-v2.json +1 -1
  161. package/dist/tool-manifest.json +1 -1
  162. package/dist/tool-profiles.js +75 -1
  163. package/dist/trace-harvest.js +244 -6
  164. package/dist/types.js +30 -1
  165. package/dist/ui-dashboard.js +50 -41
  166. package/dist/ulid.js +81 -1
  167. package/dist/usage-tracker.js +66 -1
  168. package/dist/validate.js +129 -1
  169. package/dist/vault.js +534 -1
  170. package/dist/vector-init.js +67 -1
  171. package/dist/vectors.js +184 -3
  172. package/dist/version-check.js +136 -4
  173. package/dist/visibility.js +155 -19
  174. package/dist/wyrm-cli.js +2845 -101
  175. package/dist/wyrm-cli.js.map +1 -1
  176. package/dist/wyrm-guard.d.ts.map +1 -1
  177. package/dist/wyrm-guard.js +475 -14
  178. package/dist/wyrm-guard.js.map +1 -1
  179. package/dist/wyrm-loop.js +150 -3
  180. package/dist/wyrm-manifest.json +1 -1
  181. package/dist/wyrm-statusline-daemon.js +11 -1
  182. package/dist/wyrm-statusline.js +56 -4
  183. package/dist/wyrm-ui.js +77 -9
  184. package/package.json +1 -1
@@ -1,2 +1,124 @@
1
- import{readFileSync as h,writeFileSync as p,existsSync as g}from"fs";import{join as m}from"path";const $="<!-- wyrm:start -->",c="<!-- wyrm:end -->",y=[".github/copilot-instructions.md",".cursor/rules",".cursor/rules.md",".windsurfrules","CLAUDE.md",".claude/instructions.md"];function a(r){let e=0;for(let s=0;s<r.length;s++)e=(e<<5)-e+r.charCodeAt(s),e|=0;return e.toString(36)}function x(r,e,s){if(!g(r))return{file:r,status:"file-not-found"};let o;try{o=h(r,"utf-8")}catch(l){return{file:r,status:"error",detail:String(l)}}const i=o.indexOf($),u=o.indexOf(c);if(i===-1||u===-1||u<i)return{file:r,status:"missing-markers",detail:"No Wyrm-managed block found; nothing to migrate."};const f=o.slice(0,i),n=o.slice(i,u+c.length),t=o.slice(u+c.length);if(n===e)return{file:r,status:"unchanged"};const d={oldChars:n.length,newChars:e.length,oldHash:a(n),newHash:a(e)};if(!s)return{file:r,status:"updated",proposedDiff:d,detail:"Would rewrite (dry-run)."};try{return p(r,`${f}${e}${t}`,"utf-8"),{file:r,status:"updated",proposedDiff:d}}catch(l){return{file:r,status:"error",detail:String(l)}}}function A(r){return y.map(e=>x(m(r.projectPath,e),r.newBlock,r.apply))}function C(r,e){const s=r.filter(t=>t.status==="updated"),o=r.filter(t=>t.status==="unchanged"),i=r.filter(t=>t.status==="missing-markers"),u=r.filter(t=>t.status==="file-not-found"),f=r.filter(t=>t.status==="error"),n=[];if(n.push(`\u{F115D} **Migrate Prompt** \u2014 ${e?"applied":"dry-run"}`),n.push(""),s.length>0){n.push(`### ${e?"Updated":"Would update"} (${s.length})`);for(const t of s){const d=t.proposedDiff?` \xB7 ${t.proposedDiff.oldChars}\u2192${t.proposedDiff.newChars} chars`:"";n.push(`- ${t.file}${d}`)}n.push("")}if(o.length>0){n.push(`### Already current (${o.length})`);for(const t of o)n.push(`- ${t.file}`);n.push("")}if(i.length>0){n.push(`### No Wyrm block \u2014 run \`wyrm_inject_prompt\` first (${i.length})`);for(const t of i)n.push(`- ${t.file}`);n.push("")}if(u.length>0&&u.length<5){n.push(`### Not found (${u.length})`);for(const t of u)n.push(`- ${t.file}`);n.push("")}if(f.length>0){n.push(`### Errors (${f.length})`);for(const t of f)n.push(`- ${t.file} \u2014 ${t.detail}`)}return s.length===0&&i.length===0&&f.length===0&&o.length===0&&n.push("_No Wyrm-managed client config found in this project._"),n.join(`
2
- `)}export{x as migrateOne,A as migrateProject,C as renderMigrationReport};
1
+ /**
2
+ * wyrm_migrate_prompt rewrite operator client-config Wyrm blocks
3
+ * (spec 018 phase 5).
4
+ *
5
+ * Reads existing client instruction files (.cursor/rules,
6
+ * .github/copilot-instructions.md, etc.), diffs the Wyrm-injected block
7
+ * (between `<!-- wyrm:start -->` / `<!-- wyrm:end -->` markers) against
8
+ * the current `WYRM_INJECT_BLOCK`, and updates ONLY the Wyrm block — any
9
+ * operator-authored content outside the markers is preserved verbatim.
10
+ *
11
+ * Dry-run by default. Operator must pass `apply: true` to write changes.
12
+ *
13
+ * @copyright 2026 Ghost Protocol (Pvt) Ltd.
14
+ * @license Proprietary — (c) 2026 Ghost Protocol (Pvt) Ltd. All rights reserved. See LICENSE.
15
+ */
16
+ import { readFileSync, writeFileSync, existsSync } from 'fs';
17
+ import { join } from 'path';
18
+ const MARKER_START = '<!-- wyrm:start -->';
19
+ const MARKER_END = '<!-- wyrm:end -->';
20
+ const CLIENT_TARGETS = [
21
+ '.github/copilot-instructions.md',
22
+ '.cursor/rules',
23
+ '.cursor/rules.md',
24
+ '.windsurfrules',
25
+ 'CLAUDE.md',
26
+ '.claude/instructions.md',
27
+ ];
28
+ function shortHash(s) {
29
+ // Cheap deterministic fingerprint — not cryptographic.
30
+ let h = 0;
31
+ for (let i = 0; i < s.length; i++) {
32
+ h = (h << 5) - h + s.charCodeAt(i);
33
+ h |= 0;
34
+ }
35
+ return h.toString(36);
36
+ }
37
+ export function migrateOne(filePath, newBlock, apply) {
38
+ if (!existsSync(filePath)) {
39
+ return { file: filePath, status: 'file-not-found' };
40
+ }
41
+ let body;
42
+ try {
43
+ body = readFileSync(filePath, 'utf-8');
44
+ }
45
+ catch (e) {
46
+ return { file: filePath, status: 'error', detail: String(e) };
47
+ }
48
+ const startIdx = body.indexOf(MARKER_START);
49
+ const endIdx = body.indexOf(MARKER_END);
50
+ if (startIdx === -1 || endIdx === -1 || endIdx < startIdx) {
51
+ return { file: filePath, status: 'missing-markers', detail: 'No Wyrm-managed block found; nothing to migrate.' };
52
+ }
53
+ const before = body.slice(0, startIdx);
54
+ const oldBlock = body.slice(startIdx, endIdx + MARKER_END.length);
55
+ const after = body.slice(endIdx + MARKER_END.length);
56
+ if (oldBlock === newBlock) {
57
+ return { file: filePath, status: 'unchanged' };
58
+ }
59
+ const proposed = {
60
+ oldChars: oldBlock.length,
61
+ newChars: newBlock.length,
62
+ oldHash: shortHash(oldBlock),
63
+ newHash: shortHash(newBlock),
64
+ };
65
+ if (!apply) {
66
+ return { file: filePath, status: 'updated', proposedDiff: proposed, detail: 'Would rewrite (dry-run).' };
67
+ }
68
+ try {
69
+ writeFileSync(filePath, `${before}${newBlock}${after}`, 'utf-8');
70
+ return { file: filePath, status: 'updated', proposedDiff: proposed };
71
+ }
72
+ catch (e) {
73
+ return { file: filePath, status: 'error', detail: String(e) };
74
+ }
75
+ }
76
+ export function migrateProject(opts) {
77
+ return CLIENT_TARGETS.map((rel) => migrateOne(join(opts.projectPath, rel), opts.newBlock, opts.apply));
78
+ }
79
+ export function renderMigrationReport(results, applied) {
80
+ const updated = results.filter((r) => r.status === 'updated');
81
+ const unchanged = results.filter((r) => r.status === 'unchanged');
82
+ const missing = results.filter((r) => r.status === 'missing-markers');
83
+ const notFound = results.filter((r) => r.status === 'file-not-found');
84
+ const errors = results.filter((r) => r.status === 'error');
85
+ const lines = [];
86
+ lines.push(`󱅝 **Migrate Prompt** — ${applied ? 'applied' : 'dry-run'}`);
87
+ lines.push('');
88
+ if (updated.length > 0) {
89
+ lines.push(`### ${applied ? 'Updated' : 'Would update'} (${updated.length})`);
90
+ for (const r of updated) {
91
+ const diff = r.proposedDiff ? ` · ${r.proposedDiff.oldChars}→${r.proposedDiff.newChars} chars` : '';
92
+ lines.push(`- ${r.file}${diff}`);
93
+ }
94
+ lines.push('');
95
+ }
96
+ if (unchanged.length > 0) {
97
+ lines.push(`### Already current (${unchanged.length})`);
98
+ for (const r of unchanged)
99
+ lines.push(`- ${r.file}`);
100
+ lines.push('');
101
+ }
102
+ if (missing.length > 0) {
103
+ lines.push(`### No Wyrm block — run \`wyrm_inject_prompt\` first (${missing.length})`);
104
+ for (const r of missing)
105
+ lines.push(`- ${r.file}`);
106
+ lines.push('');
107
+ }
108
+ if (notFound.length > 0 && notFound.length < 5) {
109
+ lines.push(`### Not found (${notFound.length})`);
110
+ for (const r of notFound)
111
+ lines.push(`- ${r.file}`);
112
+ lines.push('');
113
+ }
114
+ if (errors.length > 0) {
115
+ lines.push(`### Errors (${errors.length})`);
116
+ for (const r of errors)
117
+ lines.push(`- ${r.file} — ${r.detail}`);
118
+ }
119
+ if (updated.length === 0 && missing.length === 0 && errors.length === 0 && unchanged.length === 0) {
120
+ lines.push('_No Wyrm-managed client config found in this project._');
121
+ }
122
+ return lines.join('\n');
123
+ }
124
+ //# sourceMappingURL=migrate-prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,EA6nDjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,SAAS,EAAE,CAuChE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,MAAM,CAQ9D"}
1
+ {"version":3,"file":"migrations.d.ts","sourceRoot":"","sources":["../src/migrations.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAE3C,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,KAAK,IAAI,CAAC;CACrC;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,SAAS,EAgsDjC,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,SAAS,EAAE,CAuChE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,MAAM,CAQ9D"}