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
package/dist/ulid.js CHANGED
@@ -1,81 +1 @@
1
- /**
2
- * Wyrm ULID — crypto-based monotonic ULID generator (v7 F2, T008).
3
- *
4
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
5
- * @license AGPL-3.0-or-later — dual-licensed; commercial terms: ghosts.lk@proton.me. See LICENSE.
6
- *
7
- * 26-char Crockford-base32 identifier: 10 chars of millisecond timestamp +
8
- * 16 chars (80 bits) of crypto randomness. Used as `runs.run_id` (migration 20)
9
- * so run ids sort lexicographically in creation order — `ORDER BY run_id`
10
- * is `ORDER BY started-at` for free, with no coordination table.
11
- *
12
- * Monotonic within this process: two calls in the same millisecond (or after a
13
- * backwards clock step) increment the random tail instead of re-rolling, so ids
14
- * from one generator are ALWAYS strictly increasing. Zero dependencies — built
15
- * on node:crypto randomBytes (Article I: fully offline, no LLM, no network).
16
- */
17
- import { randomBytes } from 'crypto';
18
- /** Crockford base32 alphabet (no I, L, O, U — unambiguous when read aloud). */
19
- const ENCODING = '0123456789ABCDEFGHJKMNPQRSTVWXYZ';
20
- const TIME_LEN = 10; // 48-bit ms timestamp -> 10 base32 chars (good past year 10889)
21
- const RANDOM_LEN = 16; // 80 bits of randomness -> 16 base32 chars
22
- let lastTime = -1;
23
- let lastRandom = [];
24
- function encodeTime(time) {
25
- let out = '';
26
- for (let i = 0; i < TIME_LEN; i++) {
27
- out = ENCODING[time % 32] + out;
28
- time = Math.floor(time / 32);
29
- }
30
- return out;
31
- }
32
- /** 16 uniform base32 digits from crypto randomness (256 % 32 === 0: no modulo bias). */
33
- function randomDigits() {
34
- const bytes = randomBytes(RANDOM_LEN);
35
- const digits = new Array(RANDOM_LEN);
36
- for (let i = 0; i < RANDOM_LEN; i++)
37
- digits[i] = bytes[i] % 32;
38
- return digits;
39
- }
40
- /**
41
- * Generate a monotonic ULID. `now` is injectable for tests; defaults to
42
- * Date.now(). If the clock reads the same ms as (or earlier than) the previous
43
- * call, the previous timestamp is reused and the random tail incremented —
44
- * strict lexicographic monotonicity survives same-ms bursts and clock skew.
45
- */
46
- export function ulid(now = Date.now()) {
47
- let digits;
48
- let time = now;
49
- if (now <= lastTime) {
50
- // Same millisecond or clock went backwards: stay monotonic by reusing the
51
- // last timestamp and incrementing the 80-bit random tail by one.
52
- time = lastTime;
53
- digits = lastRandom.slice();
54
- let i = RANDOM_LEN - 1;
55
- for (; i >= 0; i--) {
56
- if (digits[i] < 31) {
57
- digits[i]++;
58
- break;
59
- }
60
- digits[i] = 0;
61
- }
62
- if (i < 0) {
63
- // 2^80 increments in one ms — practically unreachable; re-roll.
64
- digits = randomDigits();
65
- }
66
- }
67
- else {
68
- digits = randomDigits();
69
- }
70
- lastTime = time;
71
- lastRandom = digits;
72
- let tail = '';
73
- for (let i = 0; i < RANDOM_LEN; i++)
74
- tail += ENCODING[digits[i]];
75
- return encodeTime(time) + tail;
76
- }
77
- /** Shape check: 26 Crockford-base32 chars (excludes I, L, O, U). */
78
- export function isUlid(value) {
79
- return typeof value === 'string' && /^[0-9A-HJKMNP-TV-Z]{26}$/.test(value);
80
- }
81
- //# sourceMappingURL=ulid.js.map
1
+ import{randomBytes as a}from"crypto";const s="0123456789ABCDEFGHJKMNPQRSTVWXYZ",u=10,n=16;let r=-1,f=[];function d(e){let t="";for(let i=0;i<u;i++)t=s[e%32]+t,e=Math.floor(e/32);return t}function c(){const e=a(n),t=new Array(n);for(let i=0;i<n;i++)t[i]=e[i]%32;return t}function m(e=Date.now()){let t,i=e;if(e<=r){i=r,t=f.slice();let o=n-1;for(;o>=0;o--){if(t[o]<31){t[o]++;break}t[o]=0}o<0&&(t=c())}else t=c();r=i,f=t;let l="";for(let o=0;o<n;o++)l+=s[t[o]];return d(i)+l}function D(e){return typeof e=="string"&&/^[0-9A-HJKMNP-TV-Z]{26}$/.test(e)}export{D as isUlid,m as ulid};
package/dist/validate.js CHANGED
@@ -1,129 +1 @@
1
- /**
2
- * Boundary input validation for MCP tool arguments.
3
- *
4
- * v7 Pillar 4 (harden by construction) / Constitution Article VII (secure by
5
- * default). Coerce + validate a tool argument AT THE DISPATCH SEAM so a handler
6
- * never receives an out-of-contract value — closing the class the v6.14.1
7
- * `wyrm_prune` SQL-injection belonged to (a string where an integer was assumed).
8
- *
9
- * Every validator throws {@link ValidationError} on bad input; the CallTool
10
- * dispatcher catches it and returns a clean `isError` response — never a crash,
11
- * never an injection sink. The low-level MCP `Server` treats `inputSchema` as
12
- * advisory only, so this is the real enforcement layer.
13
- *
14
- * @copyright 2026 Ghost Protocol (Pvt) Ltd.
15
- * @license AGPL-3.0-or-later
16
- */
17
- export class ValidationError extends Error {
18
- field;
19
- constructor(field, reason) {
20
- super(`'${field}' ${reason}`);
21
- this.name = 'ValidationError';
22
- this.field = field;
23
- }
24
- }
25
- const isNil = (v) => v === undefined || v === null;
26
- /** Integer, coerced from a clean numeric string. Returns `default`/undefined when absent. */
27
- export function asInt(field, v, opts = {}) {
28
- if (isNil(v))
29
- return opts.default;
30
- let n;
31
- if (typeof v === 'number')
32
- n = v;
33
- else if (typeof v === 'string' && /^[+-]?\d+$/.test(v.trim()))
34
- n = Number(v.trim());
35
- else
36
- throw new ValidationError(field, 'must be an integer');
37
- if (!Number.isInteger(n))
38
- throw new ValidationError(field, 'must be an integer');
39
- if (opts.min !== undefined && n < opts.min)
40
- throw new ValidationError(field, `must be >= ${opts.min}`);
41
- if (opts.max !== undefined && n > opts.max)
42
- throw new ValidationError(field, `must be <= ${opts.max}`);
43
- return n;
44
- }
45
- /** Required integer — throws if absent. */
46
- export function requireInt(field, v, opts = {}) {
47
- const n = asInt(field, v, opts);
48
- if (n === undefined)
49
- throw new ValidationError(field, 'is required');
50
- return n;
51
- }
52
- /** Finite number (float allowed). */
53
- export function asNumber(field, v, opts = {}) {
54
- if (isNil(v))
55
- return opts.default;
56
- let n;
57
- if (typeof v === 'number')
58
- n = v;
59
- else if (typeof v === 'string' && v.trim() !== '' && Number.isFinite(Number(v)))
60
- n = Number(v);
61
- else
62
- throw new ValidationError(field, 'must be a number');
63
- if (!Number.isFinite(n))
64
- throw new ValidationError(field, 'must be a finite number');
65
- if (opts.min !== undefined && n < opts.min)
66
- throw new ValidationError(field, `must be >= ${opts.min}`);
67
- if (opts.max !== undefined && n > opts.max)
68
- throw new ValidationError(field, `must be <= ${opts.max}`);
69
- return n;
70
- }
71
- /** String with optional length + pattern bounds. */
72
- export function asString(field, v, opts = {}) {
73
- if (isNil(v))
74
- return opts.default;
75
- if (typeof v !== 'string')
76
- throw new ValidationError(field, 'must be a string');
77
- if (opts.minLen !== undefined && v.length < opts.minLen)
78
- throw new ValidationError(field, `must be at least ${opts.minLen} characters`);
79
- if (opts.maxLen !== undefined && v.length > opts.maxLen)
80
- throw new ValidationError(field, `must be at most ${opts.maxLen} characters`);
81
- if (opts.pattern && !opts.pattern.test(v))
82
- throw new ValidationError(field, 'has an invalid format');
83
- return v;
84
- }
85
- /** Required string — throws if absent. */
86
- export function requireString(field, v, opts = {}) {
87
- const s = asString(field, v, opts);
88
- if (s === undefined)
89
- throw new ValidationError(field, 'is required');
90
- return s;
91
- }
92
- /** Boolean, accepting the common truthy/falsey wire encodings (`'1'`/`'0'`, `'true'`/`'false'`, `1`/`0`). */
93
- export function asBool(field, v, def) {
94
- if (isNil(v))
95
- return def;
96
- if (typeof v === 'boolean')
97
- return v;
98
- if (v === 'true' || v === '1' || v === 1)
99
- return true;
100
- if (v === 'false' || v === '0' || v === 0)
101
- return false;
102
- throw new ValidationError(field, 'must be a boolean');
103
- }
104
- /** One of a fixed allowed set. */
105
- export function asEnum(field, v, allowed, def) {
106
- if (isNil(v))
107
- return def;
108
- if (typeof v !== 'string' || !allowed.includes(v)) {
109
- throw new ValidationError(field, `must be one of: ${allowed.join(', ')}`);
110
- }
111
- return v;
112
- }
113
- /** Array of strings, each optionally length-bounded. */
114
- export function asStringArray(field, v, opts = {}) {
115
- if (isNil(v))
116
- return undefined;
117
- if (!Array.isArray(v))
118
- throw new ValidationError(field, 'must be an array');
119
- if (opts.maxItems !== undefined && v.length > opts.maxItems)
120
- throw new ValidationError(field, `must have at most ${opts.maxItems} items`);
121
- return v.map((item, i) => {
122
- if (typeof item !== 'string')
123
- throw new ValidationError(`${field}[${i}]`, 'must be a string');
124
- if (opts.maxLen !== undefined && item.length > opts.maxLen)
125
- throw new ValidationError(`${field}[${i}]`, `must be at most ${opts.maxLen} characters`);
126
- return item;
127
- });
128
- }
129
- //# sourceMappingURL=validate.js.map
1
+ class i extends Error{field;constructor(e,n){super(`'${e}' ${n}`),this.name="ValidationError",this.field=e}}const u=r=>r==null;function m(r,e,n={}){if(u(e))return n.default;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&/^[+-]?\d+$/.test(e.trim()))t=Number(e.trim());else throw new i(r,"must be an integer");if(!Number.isInteger(t))throw new i(r,"must be an integer");if(n.min!==void 0&&t<n.min)throw new i(r,`must be >= ${n.min}`);if(n.max!==void 0&&t>n.max)throw new i(r,`must be <= ${n.max}`);return t}function s(r,e,n={}){const t=m(r,e,n);if(t===void 0)throw new i(r,"is required");return t}function o(r,e,n={}){if(u(e))return n.default;let t;if(typeof e=="number")t=e;else if(typeof e=="string"&&e.trim()!==""&&Number.isFinite(Number(e)))t=Number(e);else throw new i(r,"must be a number");if(!Number.isFinite(t))throw new i(r,"must be a finite number");if(n.min!==void 0&&t<n.min)throw new i(r,`must be >= ${n.min}`);if(n.max!==void 0&&t>n.max)throw new i(r,`must be <= ${n.max}`);return t}function f(r,e,n={}){if(u(e))return n.default;if(typeof e!="string")throw new i(r,"must be a string");if(n.minLen!==void 0&&e.length<n.minLen)throw new i(r,`must be at least ${n.minLen} characters`);if(n.maxLen!==void 0&&e.length>n.maxLen)throw new i(r,`must be at most ${n.maxLen} characters`);if(n.pattern&&!n.pattern.test(e))throw new i(r,"has an invalid format");return e}function w(r,e,n={}){const t=f(r,e,n);if(t===void 0)throw new i(r,"is required");return t}function h(r,e,n){if(u(e))return n;if(typeof e=="boolean")return e;if(e==="true"||e==="1"||e===1)return!0;if(e==="false"||e==="0"||e===0)return!1;throw new i(r,"must be a boolean")}function b(r,e,n,t){if(u(e))return t;if(typeof e!="string"||!n.includes(e))throw new i(r,`must be one of: ${n.join(", ")}`);return e}function x(r,e,n={}){if(!u(e)){if(!Array.isArray(e))throw new i(r,"must be an array");if(n.maxItems!==void 0&&e.length>n.maxItems)throw new i(r,`must have at most ${n.maxItems} items`);return e.map((t,a)=>{if(typeof t!="string")throw new i(`${r}[${a}]`,"must be a string");if(n.maxLen!==void 0&&t.length>n.maxLen)throw new i(`${r}[${a}]`,`must be at most ${n.maxLen} characters`);return t})}}export{i as ValidationError,h as asBool,b as asEnum,m as asInt,o as asNumber,f as asString,x as asStringArray,s as requireInt,w as requireString};