blun-king-cli 9.1.563 → 9.1.565
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/agent-spine-plugin/.claude-plugin/marketplace.json +20 -20
- package/agent-spine-plugin/.claude-plugin/plugin.json +14 -14
- package/agent-spine-plugin/.codex-plugin/plugin.json +34 -34
- package/agent-spine-plugin/.mcp.json +8 -8
- package/agent-spine-plugin/CONTRIBUTING.md +52 -0
- package/agent-spine-plugin/LICENSE +186 -186
- package/agent-spine-plugin/README.md +394 -0
- package/agent-spine-plugin/SECURITY.md +47 -0
- package/agent-spine-plugin/assets/agentspine-banner.svg +32 -32
- package/agent-spine-plugin/bin/agentspine-mcp.js +4 -4
- package/agent-spine-plugin/bin/agentspine.js +7 -7
- package/agent-spine-plugin/blun.plugin.json +33 -33
- package/agent-spine-plugin/hooks/codex.json +47 -47
- package/agent-spine-plugin/hooks/hooks.json +106 -106
- package/agent-spine-plugin/hooks/version.json +5 -5
- package/agent-spine-plugin/package.json +69 -69
- package/agent-spine-plugin/scripts/check-hosts.js +199 -199
- package/agent-spine-plugin/skill/SKILL.md +76 -76
- package/agent-spine-plugin/skills/agent-spine/SKILL.md +85 -85
- package/agent-spine-plugin/src/cli.js +1488 -1442
- package/agent-spine-plugin/src/hook.js +886 -812
- package/agent-spine-plugin/src/index.js +93 -93
- package/agent-spine-plugin/src/lib/acceptance.js +333 -333
- package/agent-spine-plugin/src/lib/attention.js +755 -755
- package/agent-spine-plugin/src/lib/audit.js +351 -342
- package/agent-spine-plugin/src/lib/authentication.js +515 -515
- package/agent-spine-plugin/src/lib/briefing.js +317 -317
- package/agent-spine-plugin/src/lib/catalog.js +167 -167
- package/agent-spine-plugin/src/lib/channel-runtime.js +665 -665
- package/agent-spine-plugin/src/lib/context.js +154 -154
- package/agent-spine-plugin/src/lib/continuity.js +338 -338
- package/agent-spine-plugin/src/lib/coordination.js +577 -577
- package/agent-spine-plugin/src/lib/documents.js +217 -217
- package/agent-spine-plugin/src/lib/feed-transport.js +499 -499
- package/agent-spine-plugin/src/lib/filesystem-retry.js +32 -32
- package/agent-spine-plugin/src/lib/gateway-runtime.js +1119 -760
- package/agent-spine-plugin/src/lib/graph.js +337 -337
- package/agent-spine-plugin/src/lib/hook-audit.js +29 -0
- package/agent-spine-plugin/src/lib/https-transport.js +392 -392
- package/agent-spine-plugin/src/lib/indexed-memory-offline.js +40 -40
- package/agent-spine-plugin/src/lib/indexed-memory.js +281 -281
- package/agent-spine-plugin/src/lib/learning.js +6923 -6466
- package/agent-spine-plugin/src/lib/object-transport.js +206 -206
- package/agent-spine-plugin/src/lib/owned-file-lock.js +143 -143
- package/agent-spine-plugin/src/lib/paths.js +109 -109
- package/agent-spine-plugin/src/lib/peer-transport.js +283 -283
- package/agent-spine-plugin/src/lib/persona-runtime.js +581 -581
- package/agent-spine-plugin/src/lib/preflight.js +702 -702
- package/agent-spine-plugin/src/lib/runtime.js +13 -13
- package/agent-spine-plugin/src/lib/selfstarter.js +892 -819
- package/agent-spine-plugin/src/lib/sharing.js +969 -969
- package/agent-spine-plugin/src/lib/source-roots.js +529 -482
- package/agent-spine-plugin/src/lib/sqlite-transport.js +501 -501
- package/agent-spine-plugin/src/lib/telegram-adapter.js +119 -119
- package/agent-spine-plugin/src/lib/voice-runtime.js +39 -39
- package/agent-spine-plugin/src/mcp.js +597 -572
- package/agent-spine-plugin/src/version.js +1 -1
- package/agent-spine-plugin/src/worker.js +202 -195
- package/bin/active-steer-priority-policy.cjs +24 -0
- package/bin/launcher-runtime.js +8 -1
- package/bin/mnemo-tool-agent-policy.cjs +22 -0
- package/bin/thinking-activity-status-policy.cjs +132 -0
- package/bin/thinking-only-guard.cjs +75 -0
- package/bin/tool-call-loop-policy.cjs +53 -0
- package/bin/turn-thinking-policy.cjs +25 -1
- package/blun.mjs +554 -64
- package/package.json +4 -1
- package/standard-skills/translate-native/LICENSE +21 -21
- package/standard-skills/translate-native/references/evaluation-protocol.md +95 -95
- package/standard-skills/translate-native/references/native-orthography.md +79 -79
- package/standard-skills/translate-native/references/native-translation-standard.md +94 -94
- package/standard-skills/translate-native/references/structured-content.md +72 -72
- package/standard-skills/translate-native/references/translationese-review.md +77 -77
- package/standard-skills/translate-native/scripts/blun_language_guard.py +697 -697
- package/standard-skills/translate-native/scripts/check_diacritics.py +353 -353
- package/standard-skills/translate-native/scripts/guard_service_client.py +264 -264
- package/standard-skills/translate-native/scripts/language_gateway.py +62 -62
- package/standard-skills/translate-native/scripts/language_quality.py +377 -377
- package/standard-skills/translate-native/scripts/pre_output_guard.py +64 -64
- package/standard-skills/translate-native/scripts/translation_guard.py +916 -916
- package/standard-tools/language-guard/blun_language_guard.py +697 -697
- package/standard-tools/language-guard/check_diacritics.py +353 -353
- package/standard-tools/language-guard/guard_service_client.py +264 -264
- package/standard-tools/language-guard/language_quality.py +377 -377
- package/standard-tools/language-guard/translation_guard.py +916 -916
|
@@ -1,572 +1,597 @@
|
|
|
1
|
-
import { VERSION } from "./version.js";
|
|
2
|
-
import { isMainModule } from "./lib/runtime.js";
|
|
3
|
-
import { scanAndSave, verifyCatalog } from "./lib/catalog.js";
|
|
4
|
-
import { readDocument, resolveContext } from "./lib/context.js";
|
|
5
|
-
import { sessionBriefing } from "./lib/briefing.js";
|
|
6
|
-
import { runAudit } from "./lib/audit.js";
|
|
7
|
-
import {
|
|
8
|
-
attentionContext, configureAttention, deleteAttention,
|
|
9
|
-
recordActivity, resolveAttention, upsertAttention
|
|
10
|
-
} from "./lib/attention.js";
|
|
11
|
-
import {
|
|
12
|
-
addLearningEvidence, configureLearning, deleteLearning, evaluateLearning,
|
|
13
|
-
learningContext, learningOutcomeStatus, proposeLearning, reviewLearning, rollbackLearning
|
|
14
|
-
} from "./lib/learning.js";
|
|
15
|
-
import { checkDelegation, createTask, taskContext, updateTask } from "./lib/coordination.js";
|
|
16
|
-
import { sharedContext } from "./lib/sharing.js";
|
|
17
|
-
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
{
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
if (name === "
|
|
496
|
-
if (name === "
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
if (name === "
|
|
504
|
-
if (name === "
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
if (name === "
|
|
508
|
-
if (name === "
|
|
509
|
-
if (name === "
|
|
510
|
-
if (name === "
|
|
511
|
-
if (name === "
|
|
512
|
-
if (name === "
|
|
513
|
-
if (name === "
|
|
514
|
-
if (name === "
|
|
515
|
-
if (name === "
|
|
516
|
-
if (name === "
|
|
517
|
-
if (name === "
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
if (
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}
|
|
533
|
-
if (
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
if (
|
|
543
|
-
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
1
|
+
import { VERSION } from "./version.js";
|
|
2
|
+
import { isMainModule } from "./lib/runtime.js";
|
|
3
|
+
import { scanAndSave, verifyCatalog } from "./lib/catalog.js";
|
|
4
|
+
import { readDocument, resolveContext } from "./lib/context.js";
|
|
5
|
+
import { sessionBriefing } from "./lib/briefing.js";
|
|
6
|
+
import { runAudit } from "./lib/audit.js";
|
|
7
|
+
import {
|
|
8
|
+
attentionContext, configureAttention, deleteAttention,
|
|
9
|
+
recordActivity, resolveAttention, upsertAttention
|
|
10
|
+
} from "./lib/attention.js";
|
|
11
|
+
import {
|
|
12
|
+
addLearningEvidence, configureLearning, deleteLearning, evaluateLearning,
|
|
13
|
+
learningContext, learningOutcomeStatus, proposeLearning, reviewLearning, rollbackLearning
|
|
14
|
+
} from "./lib/learning.js";
|
|
15
|
+
import { checkDelegation, createTask, taskContext, updateTask } from "./lib/coordination.js";
|
|
16
|
+
import { sharedContext } from "./lib/sharing.js";
|
|
17
|
+
import { resolveGoalKnowledgeGap } from "./lib/gateway-runtime.js";
|
|
18
|
+
import {
|
|
19
|
+
annotateDocument, linkDocuments, linkEntities,
|
|
20
|
+
relationshipContext, upsertEntity
|
|
21
|
+
} from "./lib/graph.js";
|
|
22
|
+
|
|
23
|
+
const tools = [
|
|
24
|
+
{
|
|
25
|
+
name: "scan",
|
|
26
|
+
description: "Discover and fingerprint Markdown identity, rules, memory, soul, and reference files without modifying them.",
|
|
27
|
+
inputSchema: { type: "object", properties: { root: { type: "string" } } }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "resolve_context",
|
|
31
|
+
description: "Resolve the relevant constitution, soul, memory index, and linked facts for a host and working directory.",
|
|
32
|
+
inputSchema: {
|
|
33
|
+
type: "object",
|
|
34
|
+
properties: {
|
|
35
|
+
root: { type: "string" }, cwd: { type: "string" },
|
|
36
|
+
host: { type: "string", enum: ["codex", "claude", "generic"] },
|
|
37
|
+
maxBytes: { type: "integer", minimum: 0 }, includeContent: { type: "boolean" }
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: "session_briefing",
|
|
43
|
+
description: "Assemble one byte-budgeted, privacy-filtered session packet across native sources, relationships, accepted learning, reviewed shared memory, tasks, and optional attention cues. Read-only and context-only.",
|
|
44
|
+
inputSchema: {
|
|
45
|
+
type: "object", additionalProperties: false,
|
|
46
|
+
properties: {
|
|
47
|
+
root: { type: "string" }, cwd: { type: "string" },
|
|
48
|
+
host: { type: "string", enum: ["codex", "claude", "generic"] },
|
|
49
|
+
entityId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
50
|
+
userId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
51
|
+
tenantId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
52
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
53
|
+
projectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
54
|
+
currentTaskId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
55
|
+
includePrivate: { type: "boolean" }, focusActive: { type: "boolean" },
|
|
56
|
+
includeSourceContent: { type: "boolean" },
|
|
57
|
+
maxBytes: { type: "integer", minimum: 4096, maximum: 262144 },
|
|
58
|
+
now: { type: "string" }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "read_document",
|
|
64
|
+
description: "Read an indexed Markdown source byte range with its SHA-256 provenance.",
|
|
65
|
+
inputSchema: {
|
|
66
|
+
type: "object", required: ["path"],
|
|
67
|
+
properties: {
|
|
68
|
+
root: { type: "string" }, path: { type: "string" },
|
|
69
|
+
offset: { type: "integer", minimum: 0 }, length: { type: "integer", minimum: 1, maximum: 1048576 }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "verify",
|
|
75
|
+
description: "Compare current Markdown files with the last saved catalog and report additions, removals, or byte changes.",
|
|
76
|
+
inputSchema: { type: "object", properties: { root: { type: "string" } } }
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "link_documents",
|
|
80
|
+
description: "Record an agent-inferred relationship between two indexed documents in the external context graph. This never edits either document and never grants authority.",
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: "object", required: ["from", "to", "relation"],
|
|
83
|
+
properties: {
|
|
84
|
+
root: { type: "string" }, from: { type: "string" }, to: { type: "string" },
|
|
85
|
+
relation: { type: "string", enum: ["loads", "belongs-to", "explains", "supports", "related", "contradicts", "supersedes-in-relevance"] },
|
|
86
|
+
reason: { type: "string" }, confidence: { type: "number", minimum: 0, maximum: 1 }
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "annotate_document",
|
|
92
|
+
description: "Store the agent's semantic classification of an indexed document as a reversible overlay annotation, never as a source rewrite.",
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: "object", required: ["path", "layer"],
|
|
95
|
+
properties: {
|
|
96
|
+
root: { type: "string" }, path: { type: "string" },
|
|
97
|
+
layer: { type: "string", enum: ["soul", "memory-index", "memory-fact", "reference", "project-reference", "identity", "voice", "conduct", "history"] },
|
|
98
|
+
reason: { type: "string" }, confidence: { type: "number", minimum: 0, maximum: 1 }
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "upsert_entity",
|
|
104
|
+
description: "Create or update a person, agent, group, channel, or project in the local relationship graph. Authority fields are rejected.",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: "object", required: ["id", "kind"],
|
|
107
|
+
properties: {
|
|
108
|
+
root: { type: "string" }, id: { type: "string" },
|
|
109
|
+
kind: { type: "string", enum: ["person", "agent", "group", "channel", "project"] },
|
|
110
|
+
displayName: { type: "string" }, aliases: { type: "array", items: { type: "string" } },
|
|
111
|
+
attributes: { type: "object" }, sourceDocument: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
112
|
+
confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
113
|
+
privacy: { type: "string", enum: ["private", "shared", "group"] }
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: "link_entities",
|
|
119
|
+
description: "Record a contextual relationship between known entities. Relationships never grant permissions or delegation authority.",
|
|
120
|
+
inputSchema: {
|
|
121
|
+
type: "object", required: ["from", "to", "relation"],
|
|
122
|
+
properties: {
|
|
123
|
+
root: { type: "string" }, from: { type: "string" }, to: { type: "string" },
|
|
124
|
+
relation: { type: "string", enum: ["knows", "works-with", "member-of", "communicates-via", "responsible-for", "reports-to", "related"] },
|
|
125
|
+
reason: { type: "string" }, confidence: { type: "number", minimum: 0, maximum: 1 },
|
|
126
|
+
privacy: { type: "string", enum: ["private", "shared", "group"] }
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
name: "relationship_context",
|
|
132
|
+
description: "Return the privacy-filtered local relationship neighborhood for one entity. Private data is excluded unless explicitly requested.",
|
|
133
|
+
inputSchema: {
|
|
134
|
+
type: "object", required: ["entityId"],
|
|
135
|
+
properties: {
|
|
136
|
+
root: { type: "string" }, entityId: { type: "string" }, includePrivate: { type: "boolean" },
|
|
137
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "upsert_attention",
|
|
143
|
+
description: "Create or update a local attention cue for an unanswered question, promise, check-in, or meaningful change. Cues are context-only and never send messages.",
|
|
144
|
+
inputSchema: {
|
|
145
|
+
type: "object", required: ["kind", "summary"],
|
|
146
|
+
properties: {
|
|
147
|
+
root: { type: "string" }, id: { type: "string" },
|
|
148
|
+
kind: { type: "string", enum: ["unanswered-question", "promise", "check-in", "meaningful-change"] },
|
|
149
|
+
summary: { type: "string", maxLength: 500 }, entityId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
150
|
+
dueAt: { anyOf: [{ type: "string" }, { type: "null" }] }, priority: { type: "number", minimum: 0, maximum: 100 },
|
|
151
|
+
privacy: { type: "string", enum: ["private", "shared", "group"] },
|
|
152
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
153
|
+
sourceDocument: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
154
|
+
confidence: { type: "number", minimum: 0, maximum: 1 }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
name: "record_activity",
|
|
160
|
+
description: "Record a minimal interaction timestamp for a known entity so check-in suggestions reflect recent contact without storing conversation content.",
|
|
161
|
+
inputSchema: {
|
|
162
|
+
type: "object", required: ["entityId"],
|
|
163
|
+
properties: {
|
|
164
|
+
root: { type: "string" }, entityId: { type: "string" },
|
|
165
|
+
kind: { type: "string", enum: ["message", "interaction", "task", "check-in"] },
|
|
166
|
+
at: { type: "string" }, privacy: { type: "string", enum: ["private", "shared", "group"] },
|
|
167
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
name: "attention_context",
|
|
173
|
+
description: "Return a sparse, privacy-filtered list of due attention suggestions. Focus mode, quiet hours, and presentation throttling can suppress all output.",
|
|
174
|
+
inputSchema: {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {
|
|
177
|
+
root: { type: "string" }, includePrivate: { type: "boolean" }, focusActive: { type: "boolean" },
|
|
178
|
+
markPresented: { type: "boolean" }, maxItems: { type: "integer", minimum: 0, maximum: 20 },
|
|
179
|
+
entityId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
180
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
181
|
+
projectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
182
|
+
currentTaskId: { anyOf: [{ type: "string" }, { type: "null" }] }, now: { type: "string" }
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "resolve_attention",
|
|
188
|
+
description: "Mark an attention cue open, completed, or dismissed while retaining its previous state in private history.",
|
|
189
|
+
inputSchema: {
|
|
190
|
+
type: "object", required: ["id"],
|
|
191
|
+
properties: {
|
|
192
|
+
root: { type: "string" }, id: { type: "string" },
|
|
193
|
+
status: { type: "string", enum: ["open", "completed", "dismissed"] }
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "configure_attention",
|
|
199
|
+
description: "Configure local attention limits, silence threshold, quiet hours, or the global on/off switch.",
|
|
200
|
+
inputSchema: {
|
|
201
|
+
type: "object", required: ["config"],
|
|
202
|
+
properties: {
|
|
203
|
+
root: { type: "string" },
|
|
204
|
+
config: {
|
|
205
|
+
type: "object", additionalProperties: false,
|
|
206
|
+
properties: {
|
|
207
|
+
enabled: { type: "boolean" }, minIntervalHours: { type: "number", minimum: 1, maximum: 720 },
|
|
208
|
+
entitySilenceDays: { type: "number", minimum: 1, maximum: 3650 },
|
|
209
|
+
heartbeatStaleMinutes: { type: "integer", minimum: 1, maximum: 10080 },
|
|
210
|
+
maxItems: { type: "integer", minimum: 1, maximum: 20 },
|
|
211
|
+
quietHours: {
|
|
212
|
+
anyOf: [
|
|
213
|
+
{ type: "null" },
|
|
214
|
+
{
|
|
215
|
+
type: "object", required: ["start", "end"], additionalProperties: false,
|
|
216
|
+
properties: {
|
|
217
|
+
start: { type: "integer", minimum: 0, maximum: 23 }, end: { type: "integer", minimum: 0, maximum: 23 },
|
|
218
|
+
utcOffsetMinutes: { type: "integer", minimum: -720, maximum: 840 }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
name: "delete_attention",
|
|
230
|
+
description: "Permanently delete one cue, one lifecycle event, or all attention data for one entity, including retained history, receipts, and presentation timestamps.",
|
|
231
|
+
inputSchema: {
|
|
232
|
+
type: "object",
|
|
233
|
+
properties: {
|
|
234
|
+
root: { type: "string" }, signalId: { type: "string" }, eventId: { type: "string" }, entityId: { type: "string" }
|
|
235
|
+
},
|
|
236
|
+
oneOf: [{ required: ["signalId"] }, { required: ["eventId"] }, { required: ["entityId"] }]
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "propose_learning",
|
|
241
|
+
description: "Create an evidence-backed learning candidate in external state. Candidates are invisible to learned context until explicitly accepted or safely auto-promoted.",
|
|
242
|
+
inputSchema: {
|
|
243
|
+
type: "object", required: ["kind", "claim", "evidence"],
|
|
244
|
+
properties: {
|
|
245
|
+
root: { type: "string" }, id: { type: "string" },
|
|
246
|
+
kind: { type: "string", enum: ["preference", "no-go", "goal", "correction", "personal-fact", "project-fact", "reference", "behavior"] },
|
|
247
|
+
claim: { type: "string", maxLength: 1000 }, subjectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
248
|
+
privacy: { type: "string", enum: ["private", "shared", "group"] },
|
|
249
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
250
|
+
scope: {
|
|
251
|
+
type: "object", additionalProperties: false,
|
|
252
|
+
properties: {
|
|
253
|
+
personaId: { anyOf: [{ type: "string" }, { type: "null" }] }, userId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
254
|
+
tenantId: { anyOf: [{ type: "string" }, { type: "null" }] }, projectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
255
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] }, taskId: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
supersedesId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
259
|
+
evidence: { "$ref": "#/$defs/evidence" }
|
|
260
|
+
},
|
|
261
|
+
"$defs": {
|
|
262
|
+
evidence: {
|
|
263
|
+
type: "object", required: ["summary"], additionalProperties: false,
|
|
264
|
+
properties: {
|
|
265
|
+
id: { type: "string" }, type: { type: "string", enum: ["user-statement", "document", "interaction", "test"] },
|
|
266
|
+
summary: { type: "string", maxLength: 500 }, sourceDocument: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
267
|
+
confidence: { type: "number", minimum: 0, maximum: 1 }, observedAt: { type: "string" }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "add_learning_evidence",
|
|
275
|
+
description: "Append distinct evidence to an unreviewed learning candidate while retaining the previous candidate version in history.",
|
|
276
|
+
inputSchema: {
|
|
277
|
+
type: "object", required: ["id", "evidence"],
|
|
278
|
+
properties: {
|
|
279
|
+
root: { type: "string" }, id: { type: "string" },
|
|
280
|
+
evidence: {
|
|
281
|
+
type: "object", required: ["summary"], additionalProperties: false,
|
|
282
|
+
properties: {
|
|
283
|
+
id: { type: "string" }, type: { type: "string", enum: ["user-statement", "document", "interaction", "test"] },
|
|
284
|
+
summary: { type: "string", maxLength: 500 }, sourceDocument: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
285
|
+
confidence: { type: "number", minimum: 0, maximum: 1 }, observedAt: { type: "string" }
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: "review_learning",
|
|
293
|
+
description: "Accept or reject one candidate. Acceptance requires an explicit user-confirmation marker and never grants authority.",
|
|
294
|
+
inputSchema: {
|
|
295
|
+
type: "object", required: ["id", "decision", "reason"],
|
|
296
|
+
properties: {
|
|
297
|
+
root: { type: "string" }, id: { type: "string" },
|
|
298
|
+
decision: { type: "string", enum: ["accept", "reject"] }, reason: { type: "string", maxLength: 500 },
|
|
299
|
+
confirmedByUser: { type: "boolean" }
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: "learning_context",
|
|
305
|
+
description: "Return accepted learning only, filtered by privacy, exact group audience, kind, subject, and context limit.",
|
|
306
|
+
inputSchema: {
|
|
307
|
+
type: "object",
|
|
308
|
+
properties: {
|
|
309
|
+
root: { type: "string" }, includePrivate: { type: "boolean" },
|
|
310
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
311
|
+
scope: {
|
|
312
|
+
type: "object", additionalProperties: false,
|
|
313
|
+
properties: {
|
|
314
|
+
personaId: { anyOf: [{ type: "string" }, { type: "null" }] }, userId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
315
|
+
tenantId: { anyOf: [{ type: "string" }, { type: "null" }] }, projectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
316
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] }, taskId: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
kinds: { type: "array", items: { type: "string", enum: ["preference", "no-go", "goal", "correction", "personal-fact", "project-fact", "reference", "behavior"] } },
|
|
320
|
+
subjectIds: { type: "array", items: { type: "string" } }, maxItems: { type: "integer", minimum: 0, maximum: 50 }
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
name: "learning_outcome_status",
|
|
326
|
+
description: "Read outcome receipt counts, contradiction state, and canary health for learned context. This read-only view is context-only and cannot record evidence, promote learning, or grant authority.",
|
|
327
|
+
inputSchema: {
|
|
328
|
+
type: "object",
|
|
329
|
+
properties: {
|
|
330
|
+
root: { type: "string" },
|
|
331
|
+
scope: {
|
|
332
|
+
type: "object", additionalProperties: false,
|
|
333
|
+
properties: {
|
|
334
|
+
personaId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
335
|
+
userId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
336
|
+
tenantId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
337
|
+
projectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
338
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
339
|
+
taskId: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
name: "evaluate_learning",
|
|
347
|
+
description: "Evaluate pending candidates against the opt-in low-risk auto-promotion policy. Auto-promotion is disabled by default and limited to project facts and references.",
|
|
348
|
+
inputSchema: { type: "object", properties: { root: { type: "string" } } }
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
name: "rollback_learning",
|
|
352
|
+
description: "Roll back an accepted learning and restore the accepted fact it superseded, without deleting history.",
|
|
353
|
+
inputSchema: {
|
|
354
|
+
type: "object", required: ["id", "reason"],
|
|
355
|
+
properties: { root: { type: "string" }, id: { type: "string" }, reason: { type: "string", maxLength: 500 } }
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
name: "configure_learning",
|
|
360
|
+
description: "Configure the local learning context limit and the default-off, low-risk auto-promotion evidence thresholds.",
|
|
361
|
+
inputSchema: {
|
|
362
|
+
type: "object", required: ["config"],
|
|
363
|
+
properties: {
|
|
364
|
+
root: { type: "string" },
|
|
365
|
+
config: {
|
|
366
|
+
type: "object", additionalProperties: false,
|
|
367
|
+
properties: {
|
|
368
|
+
autoPromote: { type: "boolean" }, minConfidence: { type: "number", minimum: 0.5, maximum: 1 },
|
|
369
|
+
minEvidence: { type: "integer", minimum: 1, maximum: 10 }, maxContextItems: { type: "integer", minimum: 1, maximum: 50 },
|
|
370
|
+
minOutcomeReceipts: { type: "integer", minimum: 2, maximum: 10 },
|
|
371
|
+
minImprovement: { type: "number", minimum: 0, maximum: 1 },
|
|
372
|
+
regressionTolerance: { type: "number", minimum: 0, maximum: 1 },
|
|
373
|
+
outcomeMaxAgeDays: { type: "integer", minimum: 1, maximum: 365 },
|
|
374
|
+
canaryReceipts: { type: "integer", minimum: 1, maximum: 10 },
|
|
375
|
+
canaryTtlDays: { type: "integer", minimum: 1, maximum: 90 }
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
name: "delete_learning",
|
|
383
|
+
description: "Permanently delete one candidate and its retained learning history. Superseding active facts must be rolled back first.",
|
|
384
|
+
inputSchema: {
|
|
385
|
+
type: "object", required: ["id"],
|
|
386
|
+
properties: { root: { type: "string" }, id: { type: "string" } }
|
|
387
|
+
}
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
name: "check_delegation",
|
|
391
|
+
description: "Check the dedicated default-deny local policy before coordinating work for another person or agent. Relationships, memory, learning, and Markdown never affect this decision or grant host permissions.",
|
|
392
|
+
inputSchema: {
|
|
393
|
+
type: "object", required: ["actorId", "action"], additionalProperties: false,
|
|
394
|
+
properties: {
|
|
395
|
+
root: { type: "string" }, actorId: { type: "string" },
|
|
396
|
+
action: { type: "string", enum: ["assign", "reassign", "manage", "complete", "cancel"] },
|
|
397
|
+
targetId: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
name: "create_task",
|
|
403
|
+
description: "Create a context-only task, open thread, or handoff. Cross-entity assignment fails closed unless a separate explicit local delegation policy allows it.",
|
|
404
|
+
inputSchema: {
|
|
405
|
+
type: "object", required: ["actorId", "title"], additionalProperties: false,
|
|
406
|
+
properties: {
|
|
407
|
+
root: { type: "string" }, id: { type: "string" }, actorId: { type: "string" },
|
|
408
|
+
assigneeId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
409
|
+
kind: { type: "string", enum: ["task", "open-thread", "handoff"] },
|
|
410
|
+
title: { type: "string", maxLength: 200 }, summary: { anyOf: [{ type: "string", maxLength: 1000 }, { type: "null" }] },
|
|
411
|
+
projectId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
412
|
+
privacy: { type: "string", enum: ["private", "shared", "group"] },
|
|
413
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
414
|
+
priority: { type: "number", minimum: 0, maximum: 100 },
|
|
415
|
+
dueAt: { anyOf: [{ type: "string" }, { type: "null" }] }
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
name: "update_task",
|
|
421
|
+
description: "Update a coordination task with append-only prior history. Reassignment and third-party management are checked against the separate default-deny policy.",
|
|
422
|
+
inputSchema: {
|
|
423
|
+
type: "object", required: ["id", "actorId", "patch"], additionalProperties: false,
|
|
424
|
+
properties: {
|
|
425
|
+
root: { type: "string" }, id: { type: "string" }, actorId: { type: "string" },
|
|
426
|
+
patch: {
|
|
427
|
+
type: "object", minProperties: 1, additionalProperties: false,
|
|
428
|
+
properties: {
|
|
429
|
+
status: { type: "string", enum: ["open", "in-progress", "blocked", "completed", "cancelled"] },
|
|
430
|
+
assigneeId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
431
|
+
title: { type: "string", maxLength: 200 }, summary: { anyOf: [{ type: "string", maxLength: 1000 }, { type: "null" }] },
|
|
432
|
+
priority: { type: "number", minimum: 0, maximum: 100 }, dueAt: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
433
|
+
note: { anyOf: [{ type: "string", maxLength: 1000 }, { type: "null" }] }
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: "task_context",
|
|
441
|
+
description: "Return privacy-filtered coordination context without delegation snapshots. Tasks describe work only and never grant host, tool, file, network, production, or spending rights.",
|
|
442
|
+
inputSchema: {
|
|
443
|
+
type: "object", additionalProperties: false,
|
|
444
|
+
properties: {
|
|
445
|
+
root: { type: "string" }, includePrivate: { type: "boolean" },
|
|
446
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
447
|
+
actorId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
448
|
+
assigneeId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
449
|
+
projectId: { anyOf: [{ type: "string" }, { type: "null" }] }, includeClosed: { type: "boolean" },
|
|
450
|
+
maxItems: { type: "integer", minimum: 0, maximum: 100 }
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: "shared_context",
|
|
456
|
+
description: "Return locally reviewed, privacy-filtered shared memory. This tool cannot connect adapters, import, publish, review, or grant authority.",
|
|
457
|
+
inputSchema: {
|
|
458
|
+
type: "object", additionalProperties: false,
|
|
459
|
+
properties: {
|
|
460
|
+
root: { type: "string" }, scopeId: { anyOf: [{ type: "string" }, { type: "null" }] },
|
|
461
|
+
groupId: { anyOf: [{ type: "string" }, { type: "null" }] }, includePrivate: { type: "boolean" },
|
|
462
|
+
kinds: { type: "array", items: { type: "string", enum: ["preference", "no-go", "goal", "correction", "personal-fact", "project-fact", "reference"] } },
|
|
463
|
+
subjectIds: { type: "array", items: { type: "string" } }, maxItems: { type: "integer", minimum: 0, maximum: 50 }
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "goal_clarify",
|
|
469
|
+
description: "Resolve one exact open knowledge gap for a dependency-bound goal-plan step. This binds context only and grants no authority.",
|
|
470
|
+
inputSchema: {
|
|
471
|
+
type: "object", additionalProperties: false,
|
|
472
|
+
required: ["goalId", "gapId", "answer", "confirmLocalGoal"],
|
|
473
|
+
properties: {
|
|
474
|
+
root: { type: "string" }, goalId: { type: "string" }, gapId: { type: "string" },
|
|
475
|
+
answer: { type: "string", maxLength: 2000 },
|
|
476
|
+
answerSource: { type: "string", enum: ["owner-input", "objective-observation"] },
|
|
477
|
+
sourceDigest: { anyOf: [{ type: "string", pattern: "^[a-f0-9]{64}$" }, { type: "null" }] },
|
|
478
|
+
confirmLocalGoal: { type: "boolean", const: true }
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
name: "audit",
|
|
484
|
+
description: "Run AgentSpine's ten deterministic quality gates for discovery, hierarchy, links, authority, privacy, budget, and source preservation.",
|
|
485
|
+
inputSchema: { type: "object", properties: { root: { type: "string" } } }
|
|
486
|
+
}
|
|
487
|
+
];
|
|
488
|
+
|
|
489
|
+
function textResult(value, isError = false) {
|
|
490
|
+
return { content: [{ type: "text", text: JSON.stringify(value, null, 2) }], isError };
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
async function callTool(name, args = {}) {
|
|
494
|
+
const root = args.root || process.cwd();
|
|
495
|
+
if (name === "scan") return textResult(await scanAndSave(root));
|
|
496
|
+
if (name === "resolve_context") return textResult(await resolveContext({
|
|
497
|
+
root,
|
|
498
|
+
cwd: args.cwd || root,
|
|
499
|
+
host: args.host || "generic",
|
|
500
|
+
maxBytes: args.maxBytes ?? 65536,
|
|
501
|
+
includeContent: args.includeContent ?? true
|
|
502
|
+
}));
|
|
503
|
+
if (name === "session_briefing") return textResult(await sessionBriefing({ ...args, root }));
|
|
504
|
+
if (name === "read_document") return textResult(await readDocument({
|
|
505
|
+
root, path: args.path, offset: args.offset ?? 0, length: args.length ?? 65536
|
|
506
|
+
}));
|
|
507
|
+
if (name === "verify") return textResult(await verifyCatalog(root));
|
|
508
|
+
if (name === "link_documents") return textResult(await linkDocuments({ ...args, root }));
|
|
509
|
+
if (name === "annotate_document") return textResult(await annotateDocument({ ...args, root }));
|
|
510
|
+
if (name === "upsert_entity") return textResult(await upsertEntity({ ...args, root }));
|
|
511
|
+
if (name === "link_entities") return textResult(await linkEntities({ ...args, root }));
|
|
512
|
+
if (name === "relationship_context") return textResult(await relationshipContext({ ...args, root }));
|
|
513
|
+
if (name === "upsert_attention") return textResult(await upsertAttention({ ...args, root }));
|
|
514
|
+
if (name === "record_activity") return textResult(await recordActivity({ ...args, root }));
|
|
515
|
+
if (name === "attention_context") return textResult(await attentionContext({ ...args, root }));
|
|
516
|
+
if (name === "resolve_attention") return textResult(await resolveAttention({ ...args, root }));
|
|
517
|
+
if (name === "configure_attention") return textResult(await configureAttention({ ...args, root }));
|
|
518
|
+
if (name === "delete_attention") return textResult(await deleteAttention({ ...args, root }));
|
|
519
|
+
if (name === "propose_learning") return textResult(await proposeLearning({ ...args, root }));
|
|
520
|
+
if (name === "add_learning_evidence") return textResult(await addLearningEvidence({ ...args, root }));
|
|
521
|
+
if (name === "review_learning") return textResult(await reviewLearning({ ...args, root }));
|
|
522
|
+
if (name === "learning_context") return textResult(await learningContext({ ...args, root }));
|
|
523
|
+
if (name === "learning_outcome_status") return textResult(await learningOutcomeStatus({ ...args, root }));
|
|
524
|
+
if (name === "evaluate_learning") return textResult(await evaluateLearning({ ...args, root }));
|
|
525
|
+
if (name === "rollback_learning") return textResult(await rollbackLearning({ ...args, root }));
|
|
526
|
+
if (name === "configure_learning") return textResult(await configureLearning({ ...args, root }));
|
|
527
|
+
if (name === "delete_learning") return textResult(await deleteLearning({ ...args, root }));
|
|
528
|
+
if (name === "check_delegation") return textResult(await checkDelegation({ ...args, root }));
|
|
529
|
+
if (name === "create_task") return textResult(await createTask({ ...args, root }));
|
|
530
|
+
if (name === "update_task") return textResult(await updateTask({ ...args, root }));
|
|
531
|
+
if (name === "task_context") return textResult(await taskContext({ ...args, root }));
|
|
532
|
+
if (name === "shared_context") return textResult(await sharedContext({ ...args, root }));
|
|
533
|
+
if (name === "goal_clarify") return textResult(await resolveGoalKnowledgeGap({
|
|
534
|
+
root,
|
|
535
|
+
goalId: args.goalId,
|
|
536
|
+
gapId: args.gapId,
|
|
537
|
+
answer: args.answer,
|
|
538
|
+
answerSource: args.answerSource || "owner-input",
|
|
539
|
+
sourceDigest: args.sourceDigest || null,
|
|
540
|
+
confirmation: args.confirmLocalGoal === true ? "local-owner-confirmed" : null
|
|
541
|
+
}));
|
|
542
|
+
if (name === "audit") return textResult(await runAudit(root));
|
|
543
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
async function dispatch(message) {
|
|
547
|
+
const { id, method, params = {} } = message;
|
|
548
|
+
if (method === "initialize") {
|
|
549
|
+
return {
|
|
550
|
+
jsonrpc: "2.0", id,
|
|
551
|
+
result: {
|
|
552
|
+
protocolVersion: params.protocolVersion || "2025-06-18",
|
|
553
|
+
capabilities: { tools: { listChanged: false } },
|
|
554
|
+
serverInfo: { name: "agent-spine", version: VERSION }
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
if (method === "ping") return { jsonrpc: "2.0", id, result: {} };
|
|
559
|
+
if (method === "tools/list") return { jsonrpc: "2.0", id, result: { tools } };
|
|
560
|
+
if (method === "tools/call") {
|
|
561
|
+
try {
|
|
562
|
+
return { jsonrpc: "2.0", id, result: await callTool(params.name, params.arguments) };
|
|
563
|
+
} catch (error) {
|
|
564
|
+
return { jsonrpc: "2.0", id, result: textResult({ error: error.message }, true) };
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
if (method?.startsWith("notifications/")) return null;
|
|
568
|
+
return { jsonrpc: "2.0", id, error: { code: -32601, message: `Method not found: ${method}` } };
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
export function startMcpServer(input = process.stdin, output = process.stdout) {
|
|
572
|
+
input.setEncoding("utf8");
|
|
573
|
+
let buffer = "";
|
|
574
|
+
let queue = Promise.resolve();
|
|
575
|
+
input.on("data", (chunk) => {
|
|
576
|
+
buffer += chunk;
|
|
577
|
+
let newline;
|
|
578
|
+
while ((newline = buffer.indexOf("\n")) >= 0) {
|
|
579
|
+
const line = buffer.slice(0, newline).trim();
|
|
580
|
+
buffer = buffer.slice(newline + 1);
|
|
581
|
+
if (!line) continue;
|
|
582
|
+
queue = queue.then(async () => {
|
|
583
|
+
let response;
|
|
584
|
+
try {
|
|
585
|
+
response = await dispatch(JSON.parse(line));
|
|
586
|
+
} catch (error) {
|
|
587
|
+
response = { jsonrpc: "2.0", id: null, error: { code: -32700, message: error.message } };
|
|
588
|
+
}
|
|
589
|
+
if (response) output.write(`${JSON.stringify(response)}\n`);
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
if (isMainModule(import.meta.url)) {
|
|
596
|
+
startMcpServer();
|
|
597
|
+
}
|