hadara 0.1.0-rc.0

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 (121) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +109 -0
  3. package/dist/agent/evidence.js +50 -0
  4. package/dist/agent/loop.js +124 -0
  5. package/dist/cli/args.js +70 -0
  6. package/dist/cli/dashboard.js +185 -0
  7. package/dist/cli/debt.js +41 -0
  8. package/dist/cli/doctor.js +68 -0
  9. package/dist/cli/errors.js +58 -0
  10. package/dist/cli/evidence-json.js +75 -0
  11. package/dist/cli/evidence.js +80 -0
  12. package/dist/cli/handoff.js +16 -0
  13. package/dist/cli/harness.js +57 -0
  14. package/dist/cli/hermes-json.js +31 -0
  15. package/dist/cli/hermes.js +28 -0
  16. package/dist/cli/init.js +142 -0
  17. package/dist/cli/install.js +34 -0
  18. package/dist/cli/main.js +216 -0
  19. package/dist/cli/mcp.js +15 -0
  20. package/dist/cli/package-smoke.js +37 -0
  21. package/dist/cli/policy-json.js +22 -0
  22. package/dist/cli/policy.js +43 -0
  23. package/dist/cli/release-artifact.js +47 -0
  24. package/dist/cli/release-dry-run.js +24 -0
  25. package/dist/cli/release-gate.js +28 -0
  26. package/dist/cli/release-publish.js +41 -0
  27. package/dist/cli/run-scaffold.js +68 -0
  28. package/dist/cli/run-state.js +41 -0
  29. package/dist/cli/run.js +191 -0
  30. package/dist/cli/smoke.js +58 -0
  31. package/dist/cli/status-json.js +6 -0
  32. package/dist/cli/status.js +26 -0
  33. package/dist/cli/task-json.js +8 -0
  34. package/dist/cli/task.js +64 -0
  35. package/dist/cli/tools.js +25 -0
  36. package/dist/cli/tui.js +72 -0
  37. package/dist/cli/write-preflight.js +27 -0
  38. package/dist/core/audit.js +41 -0
  39. package/dist/core/events.js +63 -0
  40. package/dist/core/fs.js +44 -0
  41. package/dist/core/paths.js +59 -0
  42. package/dist/core/redaction.js +178 -0
  43. package/dist/core/schema.js +253 -0
  44. package/dist/core/workspace.js +47 -0
  45. package/dist/evidence/evidence.js +170 -0
  46. package/dist/evidence/private-manifest.js +101 -0
  47. package/dist/handoff/handoff.js +49 -0
  48. package/dist/harness/replay.js +200 -0
  49. package/dist/harness/validate.js +465 -0
  50. package/dist/hermes/context-export.js +104 -0
  51. package/dist/index.js +29 -0
  52. package/dist/mcp/server.js +104 -0
  53. package/dist/mcp/tool-dispatch.js +159 -0
  54. package/dist/mcp/tool-registry.js +150 -0
  55. package/dist/mcp/tool-schemas.js +18 -0
  56. package/dist/policy/command-risk.js +39 -0
  57. package/dist/policy/permission-matrix.js +42 -0
  58. package/dist/policy/policy.js +20 -0
  59. package/dist/policy/preflight.js +47 -0
  60. package/dist/policy/presets.js +24 -0
  61. package/dist/policy/tokenizer.js +53 -0
  62. package/dist/providers/fallback-executor.js +46 -0
  63. package/dist/providers/mock-provider.js +49 -0
  64. package/dist/providers/provider-contract.js +2 -0
  65. package/dist/providers/provider-preparation.js +220 -0
  66. package/dist/providers/scripted-provider.js +69 -0
  67. package/dist/schemas/active-run-projection.schema.json +73 -0
  68. package/dist/schemas/active-run-resume.schema.json +68 -0
  69. package/dist/schemas/clean-checkout-smoke.schema.json +126 -0
  70. package/dist/schemas/context-export.schema.json +35 -0
  71. package/dist/schemas/event.schema.json +17 -0
  72. package/dist/schemas/evidence-list.schema.json +49 -0
  73. package/dist/schemas/feature-smoke.schema.json +67 -0
  74. package/dist/schemas/install-plan.schema.json +93 -0
  75. package/dist/schemas/package-smoke.schema.json +130 -0
  76. package/dist/schemas/private-evidence.schema.json +48 -0
  77. package/dist/schemas/provider-call.schema.json +42 -0
  78. package/dist/schemas/provider-config.schema.json +43 -0
  79. package/dist/schemas/release-artifact-manifest.schema.json +55 -0
  80. package/dist/schemas/release-artifact.schema.json +140 -0
  81. package/dist/schemas/release-dry-run.schema.json +141 -0
  82. package/dist/schemas/release-gate.schema.json +42 -0
  83. package/dist/schemas/release-publish.schema.json +114 -0
  84. package/dist/schemas/schema-index.json +145 -0
  85. package/dist/schemas/smoke-evidence-summary.schema.json +88 -0
  86. package/dist/schemas/tools-list.schema.json +78 -0
  87. package/dist/schemas/write-preflight.schema.json +47 -0
  88. package/dist/services/active-run-state.js +215 -0
  89. package/dist/services/capability-registry.js +540 -0
  90. package/dist/services/clean-checkout-smoke.js +393 -0
  91. package/dist/services/evidence-list.js +136 -0
  92. package/dist/services/feature-smoke.js +155 -0
  93. package/dist/services/harness-service.js +7 -0
  94. package/dist/services/install-plan.js +233 -0
  95. package/dist/services/operational-debt.js +767 -0
  96. package/dist/services/operations-status-service.js +195 -0
  97. package/dist/services/package-smoke.js +676 -0
  98. package/dist/services/policy-service.js +25 -0
  99. package/dist/services/project-read-model.js +101 -0
  100. package/dist/services/release-artifact-evidence.js +77 -0
  101. package/dist/services/release-artifact.js +351 -0
  102. package/dist/services/release-dry-run.js +253 -0
  103. package/dist/services/release-evidence.js +138 -0
  104. package/dist/services/release-publish.js +163 -0
  105. package/dist/services/smoke-evidence.js +104 -0
  106. package/dist/services/task-read-model.js +125 -0
  107. package/dist/services/tools-list.js +26 -0
  108. package/dist/services/write-preflight.js +240 -0
  109. package/dist/task/task-capsule.js +121 -0
  110. package/dist/tools/fake-shell.js +56 -0
  111. package/dist/tui/cache.js +341 -0
  112. package/dist/tui/constants.js +44 -0
  113. package/dist/tui/layout.js +140 -0
  114. package/dist/tui/markdown.js +238 -0
  115. package/dist/tui/read-model-worker.js +24 -0
  116. package/dist/tui/read-model.js +502 -0
  117. package/dist/tui/snapshot.js +434 -0
  118. package/dist/tui/state.js +229 -0
  119. package/dist/tui/terminal.js +475 -0
  120. package/dist/tui/theme.js +86 -0
  121. package/package.json +16 -0
@@ -0,0 +1,540 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.HADARA_DISABLED_CAPABILITIES = exports.HADARA_MCP_EVIDENCE_ATTACH_CAPABILITY = exports.HADARA_MCP_READ_CAPABILITIES = exports.HADARA_CLI_CAPABILITIES = void 0;
4
+ const DEFAULT_READ = {
5
+ category: 'read',
6
+ stable: true,
7
+ readOnly: true,
8
+ enabledByDefault: true,
9
+ availability: 'default',
10
+ risk: 'low'
11
+ };
12
+ exports.HADARA_CLI_CAPABILITIES = [
13
+ {
14
+ ...DEFAULT_READ,
15
+ name: 'hadara doctor',
16
+ schemaVersion: 'hadara.doctor.v1'
17
+ },
18
+ {
19
+ name: 'hadara init [--profile minimal|full|hadara-protocol]',
20
+ category: 'write',
21
+ stable: true,
22
+ readOnly: false,
23
+ enabledByDefault: true,
24
+ availability: 'default',
25
+ risk: 'medium',
26
+ notes: 'CLI-owned project bootstrap writes protocol files into the selected project root.'
27
+ },
28
+ {
29
+ name: 'hadara task create <title>',
30
+ category: 'write',
31
+ stable: true,
32
+ readOnly: false,
33
+ enabledByDefault: true,
34
+ availability: 'default',
35
+ risk: 'medium',
36
+ notes: 'Creates a Task Capsule under tasks/.'
37
+ },
38
+ {
39
+ ...DEFAULT_READ,
40
+ name: 'hadara task list --json',
41
+ schemaVersion: 'hadara.task.list.v1'
42
+ },
43
+ {
44
+ ...DEFAULT_READ,
45
+ name: 'hadara task show <task-id> --json',
46
+ schemaVersion: 'hadara.task.show.v1'
47
+ },
48
+ {
49
+ name: 'hadara evidence collect --task <task-id> ... --json',
50
+ category: 'write',
51
+ stable: true,
52
+ readOnly: false,
53
+ enabledByDefault: true,
54
+ availability: 'default',
55
+ risk: 'medium',
56
+ schemaVersion: 'hadara.evidence.collect.v1',
57
+ notes: 'CLI-owned evidence write; public artifacts pass workspace boundary and redaction policy.'
58
+ },
59
+ {
60
+ ...DEFAULT_READ,
61
+ name: 'hadara evidence list --task <task-id> --json',
62
+ schemaVersion: 'hadara.evidence.list.v1'
63
+ },
64
+ {
65
+ ...DEFAULT_READ,
66
+ name: 'hadara debt list --json',
67
+ schemaVersion: 'hadara.operational_debt.v1'
68
+ },
69
+ {
70
+ ...DEFAULT_READ,
71
+ name: 'hadara debt show <id> --json',
72
+ schemaVersion: 'hadara.operational_debt.show.v1'
73
+ },
74
+ {
75
+ ...DEFAULT_READ,
76
+ name: 'hadara tools list --json',
77
+ schemaVersion: 'hadara.tools.list.v1'
78
+ },
79
+ {
80
+ name: 'hadara handoff update --task <task-id>',
81
+ category: 'write',
82
+ stable: true,
83
+ readOnly: false,
84
+ enabledByDefault: true,
85
+ availability: 'default',
86
+ risk: 'medium',
87
+ notes: 'CLI-owned handoff update writes docs/AGENT_HANDOFF.md.'
88
+ },
89
+ {
90
+ ...DEFAULT_READ,
91
+ name: 'hadara policy check-shell <command> --json',
92
+ schemaVersion: 'hadara.policy.check.v1'
93
+ },
94
+ {
95
+ ...DEFAULT_READ,
96
+ name: 'hadara policy preflight-shell <command> --json',
97
+ schemaVersion: 'hadara.policy.preflight.v1',
98
+ notes: 'Evaluates shell policy without executing commands.'
99
+ },
100
+ {
101
+ ...DEFAULT_READ,
102
+ name: 'hadara harness validate --task <task-id> --json',
103
+ schemaVersion: 'hadara.harness.validate.v1'
104
+ },
105
+ {
106
+ ...DEFAULT_READ,
107
+ name: 'hadara harness replay <scenario.jsonl> --json',
108
+ schemaVersion: 'hadara.harness.replay.v1',
109
+ notes: 'Reads deterministic replay input and reports replay results without real shell execution.'
110
+ },
111
+ {
112
+ ...DEFAULT_READ,
113
+ name: 'hadara hermes detect --json',
114
+ schemaVersion: 'hadara.hermes.detect.v1'
115
+ },
116
+ {
117
+ name: 'hadara hermes export-context --json',
118
+ category: 'write',
119
+ stable: true,
120
+ readOnly: false,
121
+ enabledByDefault: true,
122
+ availability: 'default',
123
+ risk: 'medium',
124
+ schemaVersion: 'hadara.hermes.export-context.v1',
125
+ notes: 'CLI-only context export writes .hadara/context/HADARA_CONTEXT.md.'
126
+ },
127
+ {
128
+ name: 'hadara mcp serve [--enable-evidence-attach]',
129
+ category: 'read',
130
+ stable: true,
131
+ readOnly: true,
132
+ enabledByDefault: true,
133
+ availability: 'default',
134
+ risk: 'low',
135
+ notes: 'Starts stdio MCP server; default profile is read-only, evidence attach is opt-in per server process.'
136
+ },
137
+ {
138
+ ...DEFAULT_READ,
139
+ name: 'hadara status --json',
140
+ schemaVersion: 'hadara.ops.status.v1'
141
+ },
142
+ {
143
+ ...DEFAULT_READ,
144
+ name: 'hadara ops status --json',
145
+ schemaVersion: 'hadara.ops.status.v1'
146
+ },
147
+ {
148
+ name: 'hadara dashboard serve [--host <host>] [--port <port>]',
149
+ category: 'read',
150
+ stable: true,
151
+ readOnly: true,
152
+ enabledByDefault: true,
153
+ availability: 'default',
154
+ risk: 'low',
155
+ notes: 'Serves static sample-backed dashboard assets through allowlisted routes only.'
156
+ },
157
+ {
158
+ name: 'hadara tui [--snapshot]',
159
+ category: 'read',
160
+ stable: true,
161
+ readOnly: true,
162
+ enabledByDefault: true,
163
+ availability: 'default',
164
+ risk: 'low',
165
+ notes: 'Starts the local read-only terminal work console; --snapshot renders one deterministic frame for smoke checks.'
166
+ },
167
+ {
168
+ name: 'hadara run scaffold --task <task-id> --command <command> --json',
169
+ category: 'write',
170
+ stable: true,
171
+ readOnly: false,
172
+ enabledByDefault: true,
173
+ availability: 'default',
174
+ risk: 'medium',
175
+ notes: 'Writes deterministic scenario files under .hadara/scenarios/.'
176
+ },
177
+ {
178
+ ...DEFAULT_READ,
179
+ name: 'hadara run-state show --json',
180
+ schemaVersion: 'hadara.active_run.projection.v1'
181
+ },
182
+ {
183
+ ...DEFAULT_READ,
184
+ name: 'hadara run-state resume --json',
185
+ schemaVersion: 'hadara.active_run.resume.v1',
186
+ notes: 'Read-only resume guidance derived from the active-run projection; does not update state or resume an agent process.'
187
+ },
188
+ {
189
+ name: 'hadara install plan --json',
190
+ category: 'read',
191
+ stable: true,
192
+ readOnly: true,
193
+ enabledByDefault: true,
194
+ availability: 'default',
195
+ risk: 'low',
196
+ schemaVersion: 'hadara.install.plan.v1',
197
+ notes: 'Read-only installer dry-run plan; reports planned writes with redacted public path references and does not mutate install locations.'
198
+ },
199
+ {
200
+ name: 'hadara smoke run --profile core --json',
201
+ category: 'read',
202
+ stable: true,
203
+ readOnly: true,
204
+ enabledByDefault: true,
205
+ availability: 'default',
206
+ risk: 'low',
207
+ schemaVersion: 'hadara.featureSmoke.v1',
208
+ notes: 'Reduced read-only core feature smoke runner over service/read-model surfaces; does not execute installed binaries, package smoke, install mutation, or strict release evidence gates.'
209
+ },
210
+ {
211
+ name: 'hadara smoke clean-checkout --execute --json',
212
+ category: 'execute',
213
+ stable: true,
214
+ readOnly: false,
215
+ enabledByDefault: true,
216
+ availability: 'default',
217
+ risk: 'medium',
218
+ schemaVersion: 'hadara.cleanCheckoutSmoke.v1',
219
+ notes: 'Explicit source-checkout smoke; runs npm ci/build/check and built CLI doctor/status/strict release gate in a disposable clean copy without package install, publish, release mutation, or public raw logs.'
220
+ },
221
+ {
222
+ name: 'hadara package smoke --dry-run --json',
223
+ category: 'read',
224
+ stable: true,
225
+ readOnly: true,
226
+ enabledByDefault: true,
227
+ availability: 'default',
228
+ risk: 'low',
229
+ schemaVersion: 'hadara.packageSmoke.v1',
230
+ notes: 'Read-only package-smoke dry-run planner; previews workspace, steps, artifacts, and evidence without npm pack, install, subprocess execution, artifact writes, or evidence attachment.'
231
+ },
232
+ {
233
+ name: 'hadara package smoke --execute --json',
234
+ category: 'execute',
235
+ stable: true,
236
+ readOnly: false,
237
+ enabledByDefault: true,
238
+ availability: 'default',
239
+ risk: 'medium',
240
+ schemaVersion: 'hadara.packageSmoke.v1',
241
+ notes: 'Explicit local package-smoke execution; runs npm pack, isolated prefix install, installed doctor, and installed core smoke in a disposable workspace without publish, release mutation, global install, or public raw logs.'
242
+ },
243
+ {
244
+ name: 'hadara release gate --mode advisory|strict --json',
245
+ category: 'release',
246
+ stable: true,
247
+ readOnly: true,
248
+ enabledByDefault: true,
249
+ availability: 'default',
250
+ risk: 'medium',
251
+ schemaVersion: 'hadara.releaseGate.v1',
252
+ notes: 'Read-only release readiness report; advisory mode warns, strict mode blocks on open high-severity debt, and neither mode packages, deploys, or executes release actions.'
253
+ },
254
+ {
255
+ name: 'hadara release dry-run --json',
256
+ category: 'release',
257
+ stable: true,
258
+ readOnly: true,
259
+ enabledByDefault: true,
260
+ availability: 'default',
261
+ risk: 'medium',
262
+ schemaVersion: 'hadara.releaseDryRun.v1',
263
+ notes: 'Read-only final release dry-run; cross-checks linked public evidence artifacts, package version, git commit metadata when present, and release artifact manifest hashes without publish or GitHub Release mutation.'
264
+ },
265
+ {
266
+ name: 'hadara release publish --mode dry-run --json',
267
+ category: 'release',
268
+ stable: true,
269
+ readOnly: true,
270
+ enabledByDefault: true,
271
+ availability: 'default',
272
+ risk: 'medium',
273
+ schemaVersion: 'hadara.releasePublish.v1',
274
+ notes: 'Read-only publish/deploy dry-run readiness report; checks release dry-run, package metadata, approval requirements, and token presence without token values. It never publishes, creates GitHub Releases, builds Docker images, writes audit records, or exposes an MCP release surface.'
275
+ },
276
+ {
277
+ name: 'hadara release publish --mode execute --json',
278
+ category: 'release',
279
+ stable: true,
280
+ readOnly: false,
281
+ enabledByDefault: true,
282
+ availability: 'default',
283
+ risk: 'high',
284
+ requiresApproval: true,
285
+ schemaVersion: 'hadara.releasePublish.v1',
286
+ notes: 'Approval-gated execute request surface; requires approval metadata, privately audits blocked requests, and currently never publishes, creates GitHub Releases, builds Docker images, or exposes an MCP release surface.'
287
+ },
288
+ {
289
+ name: 'hadara release artifact --execute --json',
290
+ category: 'release',
291
+ stable: true,
292
+ readOnly: false,
293
+ enabledByDefault: true,
294
+ availability: 'default',
295
+ risk: 'medium',
296
+ schemaVersion: 'hadara.releaseArtifact.v1',
297
+ notes: 'Explicit release artifact build; creates a whitelisted npm tarball, checksum, and manifest in a disposable or explicit output directory without publish, GitHub Release, Docker image build, or public raw logs. Public reduced evidence attachment is available with --attach-evidence --task <task-id>.'
298
+ },
299
+ {
300
+ name: 'hadara run --script <script.json> --json',
301
+ category: 'execute',
302
+ stable: true,
303
+ readOnly: false,
304
+ enabledByDefault: true,
305
+ availability: 'default',
306
+ risk: 'medium',
307
+ requiresApproval: true,
308
+ schemaVersion: 'hadara.agent.loop.v1',
309
+ notes: 'Deterministic harness path only; fake shell observations are policy-gated and no real provider calls occur.'
310
+ }
311
+ ];
312
+ exports.HADARA_MCP_READ_CAPABILITIES = [
313
+ {
314
+ name: 'hadara.task.list',
315
+ description: 'List Task Capsules known to the project.',
316
+ inputSchema: {
317
+ type: 'object',
318
+ additionalProperties: false,
319
+ properties: {}
320
+ },
321
+ surface: { ...DEFAULT_READ, name: 'hadara.task.list' }
322
+ },
323
+ {
324
+ name: 'hadara.task.read',
325
+ description: 'Read a single Task Capsule summary and standard capsule files.',
326
+ inputSchema: {
327
+ type: 'object',
328
+ required: ['taskId'],
329
+ additionalProperties: false,
330
+ properties: {
331
+ taskId: { type: 'string', pattern: '^T-[0-9]{4}$' },
332
+ includePrivate: { type: 'boolean', default: false }
333
+ }
334
+ },
335
+ surface: { ...DEFAULT_READ, name: 'hadara.task.read' }
336
+ },
337
+ {
338
+ name: 'hadara.handoff.read',
339
+ description: 'Read compact handoff state and historical indexes.',
340
+ inputSchema: {
341
+ type: 'object',
342
+ additionalProperties: false,
343
+ properties: {
344
+ includeHistory: { type: 'boolean', default: false },
345
+ historyLimit: { type: 'integer', minimum: 1, maximum: 100, default: 20 }
346
+ }
347
+ },
348
+ surface: { ...DEFAULT_READ, name: 'hadara.handoff.read' }
349
+ },
350
+ {
351
+ name: 'hadara.project.state.read',
352
+ description: 'Read project state and roadmap pointers.',
353
+ inputSchema: {
354
+ type: 'object',
355
+ additionalProperties: false,
356
+ properties: {
357
+ includeDocuments: { type: 'boolean', default: true },
358
+ summaryOnly: { type: 'boolean', default: false }
359
+ }
360
+ },
361
+ surface: { ...DEFAULT_READ, name: 'hadara.project.state.read' }
362
+ },
363
+ {
364
+ name: 'hadara.policy.evaluate',
365
+ description: 'Evaluate policy for a shell-like command without executing it.',
366
+ inputSchema: {
367
+ type: 'object',
368
+ required: ['command'],
369
+ additionalProperties: false,
370
+ properties: {
371
+ command: { type: 'string', minLength: 1 },
372
+ mode: { type: 'string', enum: ['readonly', 'assisted', 'trusted', 'auto', 'release'], default: 'assisted' }
373
+ }
374
+ },
375
+ surface: { ...DEFAULT_READ, name: 'hadara.policy.evaluate' }
376
+ },
377
+ {
378
+ name: 'hadara.harness.validate',
379
+ description: 'Validate a Task Capsule without mutating it.',
380
+ inputSchema: {
381
+ type: 'object',
382
+ required: ['taskId'],
383
+ additionalProperties: false,
384
+ properties: {
385
+ taskId: { type: 'string', pattern: '^T-[0-9]{4}$' },
386
+ level: { type: 'string', enum: ['draft', 'done'], default: 'draft' }
387
+ }
388
+ },
389
+ surface: { ...DEFAULT_READ, name: 'hadara.harness.validate' }
390
+ },
391
+ {
392
+ name: 'hadara.evidence.list',
393
+ description: 'List evidence index records for one Task Capsule without reading artifact contents.',
394
+ inputSchema: {
395
+ type: 'object',
396
+ required: ['taskId'],
397
+ additionalProperties: false,
398
+ properties: {
399
+ taskId: { type: 'string', pattern: '^T-[0-9]{4}$' },
400
+ limit: { type: 'integer', minimum: 0, maximum: 500, default: 50 },
401
+ includePrivate: { type: 'boolean', default: false }
402
+ }
403
+ },
404
+ surface: { ...DEFAULT_READ, name: 'hadara.evidence.list' }
405
+ },
406
+ {
407
+ name: 'hadara.context.export',
408
+ description: 'Export HADARA context as an in-memory read-only payload without writing files.',
409
+ inputSchema: {
410
+ type: 'object',
411
+ additionalProperties: false,
412
+ properties: {
413
+ format: { type: 'string', enum: ['markdown', 'json'], default: 'markdown' },
414
+ summaryOnly: { type: 'boolean', default: false }
415
+ }
416
+ },
417
+ surface: { ...DEFAULT_READ, name: 'hadara.context.export' }
418
+ },
419
+ {
420
+ name: 'hadara.tools.list',
421
+ description: 'List current HADARA CLI/MCP capabilities and disabled surfaces.',
422
+ inputSchema: {
423
+ type: 'object',
424
+ additionalProperties: false,
425
+ properties: {}
426
+ },
427
+ surface: { ...DEFAULT_READ, name: 'hadara.tools.list', schemaVersion: 'hadara.tools.list.v1' }
428
+ },
429
+ {
430
+ name: 'hadara.active.run.read',
431
+ description: 'Read the single active-run projection without mutating local state.',
432
+ inputSchema: {
433
+ type: 'object',
434
+ additionalProperties: false,
435
+ properties: {}
436
+ },
437
+ surface: { ...DEFAULT_READ, name: 'hadara.active.run.read', schemaVersion: 'hadara.active_run.projection.v1' }
438
+ },
439
+ {
440
+ name: 'hadara.active.run.resume',
441
+ description: 'Read resume guidance derived from the active-run projection without mutating local state.',
442
+ inputSchema: {
443
+ type: 'object',
444
+ additionalProperties: false,
445
+ properties: {}
446
+ },
447
+ surface: { ...DEFAULT_READ, name: 'hadara.active.run.resume', schemaVersion: 'hadara.active_run.resume.v1' }
448
+ },
449
+ {
450
+ name: 'hadara.debt.list',
451
+ description: 'List operational debt records, aggregate counts, and debt-related warnings without mutating state.',
452
+ inputSchema: {
453
+ type: 'object',
454
+ additionalProperties: false,
455
+ properties: {}
456
+ },
457
+ surface: { ...DEFAULT_READ, name: 'hadara.debt.list', schemaVersion: 'hadara.operational_debt.v1' }
458
+ },
459
+ {
460
+ name: 'hadara.debt.show',
461
+ description: 'Read one operational debt record by id without mutating state.',
462
+ inputSchema: {
463
+ type: 'object',
464
+ required: ['id'],
465
+ additionalProperties: false,
466
+ properties: {
467
+ id: { type: 'string', pattern: '^OD-[0-9]{4}$' }
468
+ }
469
+ },
470
+ surface: { ...DEFAULT_READ, name: 'hadara.debt.show', schemaVersion: 'hadara.operational_debt.show.v1' }
471
+ }
472
+ ];
473
+ exports.HADARA_MCP_EVIDENCE_ATTACH_CAPABILITY = {
474
+ name: 'hadara.evidence.attach',
475
+ description: 'Attach evidence to an existing Task Capsule using HADARA evidence store semantics.',
476
+ inputSchema: {
477
+ type: 'object',
478
+ required: ['taskId', 'kind', 'summary', 'result', 'approval'],
479
+ additionalProperties: false,
480
+ properties: {
481
+ taskId: { type: 'string', pattern: '^T-[0-9]{4}$' },
482
+ kind: { type: 'string', enum: ['test-log', 'command-log', 'diff-summary', 'screenshot', 'note'] },
483
+ summary: { type: 'string', minLength: 1 },
484
+ result: { type: 'string', enum: ['passed', 'failed', 'blocked', 'unknown'] },
485
+ visibility: { type: 'string', enum: ['public', 'private'], default: 'public' },
486
+ artifactPath: { type: 'string', minLength: 1 },
487
+ approval: {
488
+ type: 'object',
489
+ required: ['actor', 'reason'],
490
+ additionalProperties: false,
491
+ properties: {
492
+ actor: { type: 'string', minLength: 1 },
493
+ reason: { type: 'string', minLength: 1 }
494
+ }
495
+ }
496
+ }
497
+ },
498
+ surface: {
499
+ name: 'hadara.evidence.attach',
500
+ category: 'write',
501
+ stable: true,
502
+ readOnly: false,
503
+ enabledByDefault: false,
504
+ availability: 'opt-in',
505
+ risk: 'medium',
506
+ requiresApproval: true,
507
+ schemaVersion: 'hadara.evidence.collect.v1',
508
+ notes: 'Available only when hadara mcp serve starts with --enable-evidence-attach and each call includes approval metadata.'
509
+ }
510
+ };
511
+ exports.HADARA_DISABLED_CAPABILITIES = [
512
+ {
513
+ name: 'mcp.shell.execute',
514
+ category: 'execute',
515
+ availability: 'disabled',
516
+ risk: 'high',
517
+ reason: 'MCP shell execution is out of scope for the current read-only bridge.'
518
+ },
519
+ {
520
+ name: 'mcp.provider.call',
521
+ category: 'provider',
522
+ availability: 'deferred',
523
+ risk: 'high',
524
+ reason: 'Real provider calls are deferred until provider adapter preparation is complete.'
525
+ },
526
+ {
527
+ name: 'mcp.release.execute',
528
+ category: 'release',
529
+ availability: 'deferred',
530
+ risk: 'high',
531
+ reason: 'Release and packaging execution is deferred to a later release-gate slice.'
532
+ },
533
+ {
534
+ name: 'mcp.write.*',
535
+ category: 'write',
536
+ availability: 'disabled',
537
+ risk: 'high',
538
+ reason: 'Broad MCP writes are disabled; only explicitly enabled evidence attach is implemented.'
539
+ }
540
+ ];