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
package/dist/reindex.js CHANGED
@@ -1 +1,88 @@
1
- async function m(n,a,l,f={}){const d=f.dryRun===!0,c=f.onError??(()=>{});let o=0,r=0;for(const t of l){const p=n.prepare("SELECT id, objectives, completed, notes, summary FROM sessions WHERE project_id = ?").all(t);for(const e of p){const s=[e.objectives,e.completed,e.notes,e.summary].filter(Boolean).join(" ");if(s&&!d)try{await a.addVector(s,"session",e.id,t)?o++:r++}catch(i){c("Reindex session failed",{projectId:t,sessionId:e.id,error:i.message}),r++}else s&&o++}const h=n.prepare("SELECT id, title, description FROM quests WHERE project_id = ?").all(t);for(const e of h){const s=[e.title,e.description].filter(Boolean).join(" ");if(s&&!d)try{await a.addVector(s,"context",e.id,t)?o++:r++}catch(i){c("Reindex quest failed",{projectId:t,questId:e.id,error:i.message}),r++}else s&&o++}const E=n.prepare("SELECT id, problem, validated_fix FROM memory_artifacts WHERE project_id = ? AND needs_review = 0 AND supersedes_id IS NULL").all(t);for(const e of E){const s=[e.problem,e.validated_fix].filter(Boolean).join(" ");if(s&&!d)try{await a.addVector(s,"artifact",e.id,t)?o++:r++}catch(i){c("Reindex artifact failed",{projectId:t,artifactId:e.id,error:i.message}),r++}else s&&o++}}return{indexed:o,skipped:r}}export{m as reindexProjects};
1
+ /**
2
+ * Vector reindex — v7 F3 (T023).
3
+ *
4
+ * The `wyrm_reindex` MCP case's project loop (index.ts), extracted VERBATIM
5
+ * so the new `wyrm index rebuild` CLI subcommand and the MCP tool run the
6
+ * SAME code path (spec FR-4 / T023: CLI commands wrap existing src modules —
7
+ * never reimplementations). Iterates sessions, quests, and active memory
8
+ * artifacts per project and embeds them via the vector store; per-row
9
+ * failures are counted as skips and reported through `onError` (the MCP case
10
+ * forwards to the server logger, the CLI prints to stderr).
11
+ *
12
+ * @copyright 2026 Ghost Protocol (Pvt) Ltd.
13
+ * @license Proprietary — (c) 2026 Ghost Protocol (Pvt) Ltd. All rights reserved. See LICENSE.
14
+ */
15
+ /** Reindex the given projects' content into the vector store. */
16
+ export async function reindexProjects(rawDb, vectorStore, projectIds, opts = {}) {
17
+ const dryRun = opts.dryRun === true;
18
+ const onError = opts.onError ?? (() => { });
19
+ let indexed = 0;
20
+ let skipped = 0;
21
+ for (const projectId of projectIds) {
22
+ // Sessions
23
+ const sessions = rawDb.prepare('SELECT id, objectives, completed, notes, summary FROM sessions WHERE project_id = ?').all(projectId);
24
+ for (const s of sessions) {
25
+ const content = [s.objectives, s.completed, s.notes, s.summary].filter(Boolean).join(' ');
26
+ if (content && !dryRun) {
27
+ try {
28
+ const hash = await vectorStore.addVector(content, 'session', s.id, projectId);
29
+ if (hash)
30
+ indexed++;
31
+ else
32
+ skipped++;
33
+ }
34
+ catch (err) {
35
+ onError('Reindex session failed', { projectId, sessionId: s.id, error: err.message });
36
+ skipped++;
37
+ }
38
+ }
39
+ else if (content) {
40
+ indexed++;
41
+ }
42
+ }
43
+ // Quests
44
+ const quests = rawDb.prepare('SELECT id, title, description FROM quests WHERE project_id = ?').all(projectId);
45
+ for (const q of quests) {
46
+ const content = [q.title, q.description].filter(Boolean).join(' ');
47
+ if (content && !dryRun) {
48
+ try {
49
+ const hash = await vectorStore.addVector(content, 'context', q.id, projectId);
50
+ if (hash)
51
+ indexed++;
52
+ else
53
+ skipped++;
54
+ }
55
+ catch (err) {
56
+ onError('Reindex quest failed', { projectId, questId: q.id, error: err.message });
57
+ skipped++;
58
+ }
59
+ }
60
+ else if (content) {
61
+ indexed++;
62
+ }
63
+ }
64
+ // Memory artifacts (active only) — powers hybrid recall (FTS ⊕ vectors)
65
+ const artifacts = rawDb.prepare('SELECT id, problem, validated_fix FROM memory_artifacts WHERE project_id = ? AND needs_review = 0 AND supersedes_id IS NULL').all(projectId);
66
+ for (const a of artifacts) {
67
+ const content = [a.problem, a.validated_fix].filter(Boolean).join(' ');
68
+ if (content && !dryRun) {
69
+ try {
70
+ const hash = await vectorStore.addVector(content, 'artifact', a.id, projectId);
71
+ if (hash)
72
+ indexed++;
73
+ else
74
+ skipped++;
75
+ }
76
+ catch (err) {
77
+ onError('Reindex artifact failed', { projectId, artifactId: a.id, error: err.message });
78
+ skipped++;
79
+ }
80
+ }
81
+ else if (content) {
82
+ indexed++;
83
+ }
84
+ }
85
+ }
86
+ return { indexed, skipped };
87
+ }
88
+ //# sourceMappingURL=reindex.js.map