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.
- package/LICENSE +26 -667
- package/NOTICE +14 -33
- package/dist/activation.d.ts.map +1 -1
- package/dist/activation.js +1 -44
- package/dist/activation.js.map +1 -1
- package/dist/agent-daemon.js +4 -281
- package/dist/agent-loop.js +7 -332
- package/dist/analytics.js +13 -236
- package/dist/attribution.js +1 -49
- package/dist/audit.js +2 -457
- package/dist/auto-capture.js +3 -138
- package/dist/auto-orchestrator.js +1 -325
- package/dist/autoconfig.js +39 -840
- package/dist/buddy-runner.js +1 -109
- package/dist/buddy.js +14 -564
- package/dist/build-flags.js +1 -17
- package/dist/capabilities.js +3 -183
- package/dist/capture.js +1 -56
- package/dist/causality.js +6 -107
- package/dist/cli.js +20 -281
- package/dist/cloud/cli.js +5 -541
- package/dist/cloud/client.js +1 -221
- package/dist/cloud/crypto.js +1 -85
- package/dist/cloud/machine-id.js +2 -113
- package/dist/cloud/recovery.js +1 -60
- package/dist/cloud/sync-engine.js +7 -543
- package/dist/cloud-backup.js +5 -579
- package/dist/cloud-profile.js +1 -138
- package/dist/cloud-sync-entrypoint.js +1 -47
- package/dist/cloud-sync.js +2 -309
- package/dist/constellation.js +12 -168
- package/dist/context-build-budgeted.js +4 -144
- package/dist/context-ranking.js +1 -69
- package/dist/crypto.js +1 -179
- package/dist/daemon-write-endpoint.js +1 -290
- package/dist/daemon-writer.js +2 -406
- package/dist/database.js +43 -1110
- package/dist/deprecations.js +2 -162
- package/dist/design.js +13 -141
- package/dist/event-replication.js +1 -112
- package/dist/events-sse.js +7 -43
- package/dist/events.js +6 -238
- package/dist/failure-patterns.js +42 -659
- package/dist/federation.js +12 -236
- package/dist/goals.js +13 -101
- package/dist/golden.js +3 -355
- package/dist/handlers/agent.js +4 -165
- package/dist/handlers/alias-adapters.js +1 -129
- package/dist/handlers/aliases.js +1 -171
- package/dist/handlers/audit.js +1 -87
- package/dist/handlers/boundary.js +1 -221
- package/dist/handlers/capture.js +73 -1109
- package/dist/handlers/causality.js +7 -114
- package/dist/handlers/cloud.js +85 -382
- package/dist/handlers/companion.js +28 -459
- package/dist/handlers/datalake.js +7 -187
- package/dist/handlers/dispatch-context.js +0 -22
- package/dist/handlers/entity.js +25 -256
- package/dist/handlers/events.js +16 -335
- package/dist/handlers/failure.js +13 -340
- package/dist/handlers/goals.js +4 -296
- package/dist/handlers/intelligence.js +126 -674
- package/dist/handlers/invoicing.js +1 -70
- package/dist/handlers/mcpclient.js +6 -137
- package/dist/handlers/orchestration.js +40 -125
- package/dist/handlers/output-schemas.js +1 -24
- package/dist/handlers/presence.js +3 -99
- package/dist/handlers/project.js +28 -182
- package/dist/handlers/prompts.js +6 -157
- package/dist/handlers/quest.js +4 -224
- package/dist/handlers/recall.js +11 -218
- package/dist/handlers/registry.js +1 -167
- package/dist/handlers/resources.js +1 -288
- package/dist/handlers/review.js +11 -74
- package/dist/handlers/run.js +17 -487
- package/dist/handlers/search.js +15 -326
- package/dist/handlers/session.js +28 -615
- package/dist/handlers/share.js +8 -184
- package/dist/handlers/shims.js +1 -464
- package/dist/handlers/skill.js +67 -449
- package/dist/handlers/survivors.js +1 -120
- package/dist/handlers/symbols.js +8 -109
- package/dist/handlers/syncops.js +4 -302
- package/dist/handlers/types.js +1 -27
- package/dist/harvest.js +5 -191
- package/dist/hours.js +7 -156
- package/dist/http-auth.js +3 -321
- package/dist/http-fast.js +21 -1137
- package/dist/icons.js +1 -47
- package/dist/index.js +2 -924
- package/dist/indexer.js +4 -145
- package/dist/intelligence.js +31 -261
- package/dist/internal-dispatch.js +3 -212
- package/dist/keyset.js +1 -110
- package/dist/knowledge-graph.js +12 -176
- package/dist/license.d.ts +11 -0
- package/dist/license.d.ts.map +1 -1
- package/dist/license.js +2 -414
- package/dist/license.js.map +1 -1
- package/dist/logger.js +2 -199
- package/dist/maintenance.js +2 -148
- package/dist/mcp-client.js +6 -262
- package/dist/memory-artifacts.js +30 -449
- package/dist/migrate-prompt.js +2 -124
- package/dist/migrations.js +40 -655
- package/dist/performance.js +1 -228
- package/dist/presence.js +11 -140
- package/dist/priority-embed.js +5 -164
- package/dist/providers/embedding-provider.js +1 -196
- package/dist/readonly-gate.js +1 -29
- package/dist/rehydration.js +9 -157
- package/dist/reindex.js +1 -88
- package/dist/render-target.js +21 -514
- package/dist/render.js +4 -280
- package/dist/repl-guard.js +1 -173
- package/dist/replication-daemon-entrypoint.js +1 -31
- package/dist/replication-daemon.js +2 -262
- package/dist/resilience.js +1 -591
- package/dist/reverse-bridge.js +5 -360
- package/dist/security.js +1 -244
- package/dist/session-seen.js +3 -51
- package/dist/setup.js +1 -260
- package/dist/skill-author.js +5 -168
- package/dist/spec-kit.js +1 -191
- package/dist/sqlite-busy.js +1 -154
- package/dist/statusline.js +11 -315
- package/dist/sub-agent.js +13 -262
- package/dist/summarizer.js +13 -139
- package/dist/symbols.js +7 -283
- package/dist/sync.js +5 -359
- package/dist/tasks-dispatch.js +1 -84
- package/dist/tasks.js +1 -282
- package/dist/token-budget.js +1 -143
- package/dist/tool-analytics.js +7 -129
- package/dist/tool-annotations.js +1 -365
- package/dist/tool-manifest-v2.json +1 -1
- package/dist/tool-manifest.json +1 -1
- package/dist/tool-profiles.js +1 -75
- package/dist/trace-harvest.js +6 -244
- package/dist/types.js +1 -30
- package/dist/ui-dashboard.js +41 -50
- package/dist/ulid.js +1 -81
- package/dist/validate.js +1 -129
- package/dist/vault.js +1 -534
- package/dist/vectors.js +3 -184
- package/dist/version-check.js +4 -136
- package/dist/visibility.js +19 -155
- package/dist/wyrm-cli.js +98 -2451
- package/dist/wyrm-cli.js.map +1 -1
- package/dist/wyrm-guard.js +14 -424
- package/dist/wyrm-loop.js +3 -150
- package/dist/wyrm-manifest.json +1 -1
- package/dist/wyrm-statusline-daemon.js +1 -11
- package/dist/wyrm-statusline.js +4 -56
- package/dist/wyrm-ui.js +9 -77
- package/package.json +4 -2
package/dist/migrate-prompt.js
CHANGED
|
@@ -1,124 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. 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
|
+
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};
|