@zhivex-ai/harness 1.3.0-rc.3 → 1.3.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 (157) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +12 -10
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +4 -4
  5. package/contracts/engine-api.json +334 -0
  6. package/contracts/public-api.json +267 -1
  7. package/contracts/stable-api-signatures.json +43 -43
  8. package/dist/acp-cli.js +54 -18
  9. package/dist/approvals/approval-history.d.ts +22 -0
  10. package/dist/approvals/explicit-review.d.ts +24 -0
  11. package/dist/approvals/host-policy-identity.d.ts +3 -0
  12. package/dist/cli/arguments.d.ts +6 -2
  13. package/dist/cli/checkpoints.d.ts +230 -0
  14. package/dist/cli/cli-profiles.d.ts +4 -2
  15. package/dist/cli/governance-report.d.ts +5 -0
  16. package/dist/cli/policy-decisions.d.ts +9 -0
  17. package/dist/cli/policy.d.ts +5 -0
  18. package/dist/cli/presentation.d.ts +3 -1
  19. package/dist/cli/terminal/terminal-ui.d.ts +4 -0
  20. package/dist/{cli-entry-xmf48p6a.js → cli-entry-1gfg3brj.js} +14921 -10692
  21. package/dist/cli-entry-bx3vjw7h.js +656 -0
  22. package/dist/{index-fvca1xea.js → cli-entry-d5788aay.js} +339 -58
  23. package/dist/{cli-qgwvtk0w.js → cli-etsmtst3.js} +918 -2222
  24. package/dist/cli.js +3 -5
  25. package/dist/client/acp-mcp-admission.d.ts +32 -0
  26. package/dist/client/acp-mcp-host.d.ts +19 -0
  27. package/dist/client/acp-mcp-session.d.ts +14 -0
  28. package/dist/client/acp-stdio.d.ts +2 -0
  29. package/dist/client/acp.d.ts +4 -1
  30. package/dist/client/adapter.d.ts +13 -1
  31. package/dist/client/json-contracts.d.ts +107 -4
  32. package/dist/client/local-service.d.ts +2 -0
  33. package/dist/client/protocol.d.ts +127 -1
  34. package/dist/client/service-events.d.ts +4 -0
  35. package/dist/compat/cli-options.d.ts +13 -1
  36. package/dist/compat/code-support.js +23 -87
  37. package/dist/{config-q32jm1e6.js → config-c002f06f.js} +1 -1
  38. package/dist/{config-6gtpxvjv.js → config-j3jga5wh.js} +3 -1
  39. package/dist/context/adaptive-compaction.d.ts +1 -0
  40. package/dist/context/compaction.d.ts +1 -1
  41. package/dist/context/request-measurements.d.ts +17 -0
  42. package/dist/context/request-projection.d.ts +10 -0
  43. package/dist/context/task-memory.d.ts +1 -0
  44. package/dist/engine/acp.d.ts +2 -0
  45. package/dist/engine/acp.js +197 -1
  46. package/dist/engine/client.js +11 -4
  47. package/dist/engine/desktop-providers-v1.d.ts +4 -0
  48. package/dist/engine/desktop-providers-v1.js +18 -0
  49. package/dist/engine/desktop-state-v1.d.ts +10 -0
  50. package/dist/engine/desktop-state-v1.js +168 -0
  51. package/dist/engine/index.d.ts +12 -0
  52. package/dist/engine/index.js +571 -71
  53. package/dist/engine/mcp-stdio-v1.d.ts +11 -0
  54. package/dist/engine/mcp-stdio-v1.js +108 -0
  55. package/dist/engine/models.d.ts +3 -0
  56. package/dist/engine/models.js +894 -0
  57. package/dist/engine/protocol.d.ts +1 -0
  58. package/dist/engine/protocol.js +24 -0
  59. package/dist/engine/service.js +12 -5
  60. package/dist/execution/acceptance-snapshot.d.ts +2 -0
  61. package/dist/execution/execution-environment.d.ts +10 -0
  62. package/dist/execution/mcp-oci-channel.d.ts +11 -0
  63. package/dist/execution/mcp-oci-server.d.ts +38 -0
  64. package/dist/execution/mcp-oci-workspace.d.ts +23 -0
  65. package/dist/execution/mcp-resource-recovery.d.ts +19 -0
  66. package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
  67. package/dist/hostile-repository-demo.js +3169 -1163
  68. package/dist/{index-f4sb0e2q.js → index-2jrdcj6b.js} +17 -2
  69. package/dist/{index-77h9qr5h.js → index-3ah1f369.js} +40 -10
  70. package/dist/{index-pgqz45fj.js → index-42gp2hy8.js} +197 -1091
  71. package/dist/{index-41fkzt91.js → index-4jw3tvy8.js} +10 -2
  72. package/dist/index-6m08wvab.js +1768 -0
  73. package/dist/index-8705zxpr.js +145 -0
  74. package/dist/{index-d0wrghff.js → index-8vm2m34s.js} +225 -1416
  75. package/dist/index-8zzhggxv.js +477 -0
  76. package/dist/index-a97bezbz.js +1073 -0
  77. package/dist/index-azmwjp95.js +1004 -0
  78. package/dist/{cli-entry-0mmeag20.js → index-gq9xagx2.js} +122 -836
  79. package/dist/index-h0mqx2ed.js +1373 -0
  80. package/dist/index-hnaxfpb5.js +5589 -0
  81. package/dist/{index-2aymdsqc.js → index-qfpz5y2v.js} +24 -0
  82. package/dist/{index-kfgt9yqq.js → index-w2sj0wkw.js} +33 -10
  83. package/dist/index-wg1sd3at.js +80 -0
  84. package/dist/index-xqxeypt5.js +888 -0
  85. package/dist/index-yb239ghk.js +961 -0
  86. package/dist/index-z0qxmkm2.js +3389 -0
  87. package/dist/index.js +85 -72
  88. package/dist/integrations/mcp-host-session.d.ts +26 -0
  89. package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
  90. package/dist/integrations/mcp-stdio-client.d.ts +44 -0
  91. package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
  92. package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
  93. package/dist/integrations/mcp-stdio-session.d.ts +7 -0
  94. package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
  95. package/dist/internal/desktop/catalog.d.ts +2 -0
  96. package/dist/internal/desktop/persistence.d.ts +2 -3
  97. package/dist/internal/desktop/providers.d.ts +1 -0
  98. package/dist/models/catalog.d.ts +2 -0
  99. package/dist/persistence/governance-context.d.ts +126 -0
  100. package/dist/persistence/governance-report.d.ts +299 -0
  101. package/dist/persistence/host-database-backup.d.ts +28 -0
  102. package/dist/persistence/mcp-execution-journal.d.ts +19 -0
  103. package/dist/persistence/mcp-reconciliation.d.ts +33 -0
  104. package/dist/persistence/mcp-resource-journal.d.ts +54 -0
  105. package/dist/persistence/workspace-checkpoints.d.ts +138 -0
  106. package/dist/providers/anthropic-continuation.d.ts +5 -0
  107. package/dist/providers/providers.d.ts +1 -1
  108. package/dist/providers/vertex-auth.d.ts +27 -0
  109. package/dist/runtime/delegation-contracts.d.ts +9 -0
  110. package/dist/runtime/delegation-correction.d.ts +9 -0
  111. package/dist/runtime/delegation-result.d.ts +73 -0
  112. package/dist/runtime/error-diagnostics.d.ts +86 -0
  113. package/dist/runtime/harness.d.ts +11 -1
  114. package/dist/runtime/policy-decisions.d.ts +66 -0
  115. package/dist/runtime/policy-inspection.d.ts +52 -0
  116. package/dist/runtime/provider-diagnostics.d.ts +1 -0
  117. package/dist/runtime/runtime-instructions.d.ts +8 -0
  118. package/dist/runtime/task-acceptance-checks.d.ts +103 -0
  119. package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
  120. package/dist/runtime/task-acceptance-host.d.ts +20 -0
  121. package/dist/runtime/task-acceptance-record.d.ts +107 -0
  122. package/dist/runtime/task-acceptance-validation.d.ts +25 -0
  123. package/dist/runtime/task-acceptance.d.ts +47 -0
  124. package/dist/runtime/time-to-safe-fix.d.ts +83 -0
  125. package/dist/runtime/tool-policy-file.d.ts +23 -0
  126. package/dist/runtime/tool-policy-paths.d.ts +5 -0
  127. package/dist/runtime/tool-policy.d.ts +6 -0
  128. package/dist/service-cli.js +14 -7
  129. package/dist/{service-client-cli-gs78wrxe.js → service-client-cli-3365rfav.js} +307 -248
  130. package/dist/verify-historical-migrations.js +3134 -1129
  131. package/dist/workspace/path-policy.d.ts +4 -0
  132. package/dist/zhx.js +3 -5
  133. package/docs/ACP.md +14 -2
  134. package/docs/ANTHROPIC.md +33 -0
  135. package/docs/CLI.md +132 -0
  136. package/docs/CLIENT_PROTOCOL.md +45 -0
  137. package/docs/CODE_RELEASE.md +35 -18
  138. package/docs/ENGINE_API.md +216 -7
  139. package/docs/EXTENSIBILITY.md +46 -3
  140. package/docs/FIRST_USE.md +6 -6
  141. package/docs/LOCAL_SERVICE.md +13 -0
  142. package/docs/MCP_STDIO.md +20 -0
  143. package/docs/README.md +1 -0
  144. package/docs/STABILITY.md +4 -2
  145. package/docs/SUPPORT_MATRIX.md +1 -1
  146. package/docs/TOOL_POLICY.md +81 -0
  147. package/docs/VERTEX.md +50 -0
  148. package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
  149. package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
  150. package/docs/support-matrix.json +2 -0
  151. package/evaluations/representative-assembly-matrix.json +46 -1
  152. package/evaluations/task-acceptance-routes.json +7 -0
  153. package/examples/README.md +3 -3
  154. package/package.json +43 -12
  155. package/dist/cli-entry-64pdp3k5.js +0 -17
  156. package/dist/cli-entry-7h9savv5.js +0 -375
  157. package/dist/index-5wjwe91x.js +0 -9434
@@ -0,0 +1,299 @@
1
+ import { z } from 'zod';
2
+ import type { AgentRunStore, AgentStoreScope } from '@zhivex-ai/core';
3
+ import { type GovernanceSessionSource } from './governance-context.js';
4
+ /** Experimental v1 projection. No messages, arguments, outputs or arbitrary metadata fields. */
5
+ export declare const harnessGovernanceReportSchema: z.ZodObject<{
6
+ schemaVersion: z.ZodLiteral<1>;
7
+ kind: z.ZodLiteral<"harness-governance-report">;
8
+ exporterVersion: z.ZodString;
9
+ executionArtifact: z.ZodObject<{
10
+ version: z.ZodNullable<z.ZodString>;
11
+ digest: z.ZodNull;
12
+ availability: z.ZodEnum<{
13
+ "recorded-version": "recorded-version";
14
+ unavailable: "unavailable";
15
+ }>;
16
+ configurationFingerprint: z.ZodNullable<z.ZodString>;
17
+ authenticity: z.ZodLiteral<"not-verified">;
18
+ }, z.core.$strict>;
19
+ rootReference: z.ZodString;
20
+ identity: z.ZodLiteral<"not-verified">;
21
+ referencePolicy: z.ZodLiteral<"sha256-domain-separated-pseudonyms-not-anonymity">;
22
+ session: z.ZodObject<{
23
+ availability: z.ZodEnum<{
24
+ recorded: "recorded";
25
+ unavailable: "unavailable";
26
+ }>;
27
+ reference: z.ZodNullable<z.ZodString>;
28
+ revision: z.ZodNullable<z.ZodNumber>;
29
+ }, z.core.$strict>;
30
+ eventHistory: z.ZodObject<{
31
+ availability: z.ZodEnum<{
32
+ recorded: "recorded";
33
+ unavailable: "unavailable";
34
+ }>;
35
+ retention: z.ZodEnum<{
36
+ expired: "expired";
37
+ retained: "retained";
38
+ unknown: "unknown";
39
+ }>;
40
+ incomplete: z.ZodBoolean;
41
+ policyDecisions: z.ZodArray<z.ZodObject<{
42
+ runReference: z.ZodString;
43
+ sequence: z.ZodNumber;
44
+ toolReference: z.ZodString;
45
+ phase: z.ZodEnum<{
46
+ "approval-request": "approval-request";
47
+ "tool-entry": "tool-entry";
48
+ }>;
49
+ decision: z.ZodEnum<{
50
+ allow: "allow";
51
+ ask_user: "ask_user";
52
+ deny: "deny";
53
+ }>;
54
+ policyDigest: z.ZodNullable<z.ZodString>;
55
+ source: z.ZodEnum<{
56
+ application: "application";
57
+ baseline: "baseline";
58
+ "operator-file": "operator-file";
59
+ }>;
60
+ ruleReferences: z.ZodArray<z.ZodString>;
61
+ explicitReviewRequired: z.ZodBoolean;
62
+ }, z.core.$strict>>;
63
+ }, z.core.$strict>;
64
+ changeEnvelopes: z.ZodArray<z.ZodObject<{
65
+ source: z.ZodLiteral<"caller-supplied">;
66
+ envelopeId: z.ZodNullable<z.ZodString>;
67
+ patchReference: z.ZodNullable<z.ZodString>;
68
+ patchDigest: z.ZodNullable<z.ZodString>;
69
+ linkedRunReferences: z.ZodArray<z.ZodString>;
70
+ schemaValid: z.ZodBoolean;
71
+ integrity: z.ZodEnum<{
72
+ invalid: "invalid";
73
+ valid: "valid";
74
+ }>;
75
+ expiration: z.ZodEnum<{
76
+ current: "current";
77
+ expired: "expired";
78
+ "not-yet-valid": "not-yet-valid";
79
+ unknown: "unknown";
80
+ }>;
81
+ checkedAt: z.ZodISODateTime;
82
+ expiredApprovals: z.ZodNumber;
83
+ authenticity: z.ZodLiteral<"not-verified">;
84
+ patchBytes: z.ZodLiteral<"not-verified">;
85
+ }, z.core.$strict>>;
86
+ runs: z.ZodArray<z.ZodObject<{
87
+ reference: z.ZodString;
88
+ parentReference: z.ZodNullable<z.ZodString>;
89
+ revision: z.ZodNullable<z.ZodNumber>;
90
+ status: z.ZodEnum<{
91
+ cancel_requested: "cancel_requested";
92
+ cancelled: "cancelled";
93
+ completed: "completed";
94
+ created: "created";
95
+ failed: "failed";
96
+ running: "running";
97
+ timed_out: "timed_out";
98
+ unknown: "unknown";
99
+ waiting_approval: "waiting_approval";
100
+ }>;
101
+ finalized: z.ZodBoolean;
102
+ failure: z.ZodNullable<z.ZodEnum<{
103
+ cancelled: "cancelled";
104
+ not_reported: "not_reported";
105
+ run_failed: "run_failed";
106
+ timed_out: "timed_out";
107
+ }>>;
108
+ failureDetails: z.ZodObject<{
109
+ providerToolReason: z.ZodNullable<z.ZodEnum<{
110
+ arguments_too_large: "arguments_too_large";
111
+ empty_arguments: "empty_arguments";
112
+ incomplete_arguments: "incomplete_arguments";
113
+ inconsistent_metadata: "inconsistent_metadata";
114
+ invalid_json: "invalid_json";
115
+ response_failed: "response_failed";
116
+ response_incomplete: "response_incomplete";
117
+ stream_truncated: "stream_truncated";
118
+ }>>;
119
+ diagnosticReference: z.ZodNullable<z.ZodString>;
120
+ deliveryReason: z.ZodNullable<z.ZodEnum<{
121
+ TASK_ACCEPTANCE_CHECKS_MISSING: "TASK_ACCEPTANCE_CHECKS_MISSING";
122
+ TASK_ACCEPTANCE_DELIVERY_DRIFT: "TASK_ACCEPTANCE_DELIVERY_DRIFT";
123
+ TASK_ACCEPTANCE_DELIVERY_INSPECTION_FAILED: "TASK_ACCEPTANCE_DELIVERY_INSPECTION_FAILED";
124
+ TASK_ACCEPTANCE_HUMAN_REVIEW_REQUIRED: "TASK_ACCEPTANCE_HUMAN_REVIEW_REQUIRED";
125
+ TASK_ACCEPTANCE_IMPORT_UNCONFIRMED: "TASK_ACCEPTANCE_IMPORT_UNCONFIRMED";
126
+ TASK_ACCEPTANCE_NO_DELIVERY_EVIDENCE: "TASK_ACCEPTANCE_NO_DELIVERY_EVIDENCE";
127
+ TASK_ACCEPTANCE_RUN_NOT_COMPLETED: "TASK_ACCEPTANCE_RUN_NOT_COMPLETED";
128
+ TASK_ACCEPTANCE_RUN_NOT_FINISHED: "TASK_ACCEPTANCE_RUN_NOT_FINISHED";
129
+ TASK_ACCEPTANCE_SCOPE_VIOLATION: "TASK_ACCEPTANCE_SCOPE_VIOLATION";
130
+ TASK_ACCEPTANCE_VERIFIED: "TASK_ACCEPTANCE_VERIFIED";
131
+ }>>;
132
+ }, z.core.$strict>;
133
+ identity: z.ZodLiteral<"not-verified">;
134
+ runtimePolicy: z.ZodNullable<z.ZodEnum<{
135
+ "assistant-v3-durable-closure": "assistant-v3-durable-closure";
136
+ }>>;
137
+ contract: z.ZodObject<{
138
+ availability: z.ZodEnum<{
139
+ invalid: "invalid";
140
+ recorded: "recorded";
141
+ unavailable: "unavailable";
142
+ }>;
143
+ digest: z.ZodNullable<z.ZodString>;
144
+ revision: z.ZodNullable<z.ZodNumber>;
145
+ requiredChecks: z.ZodNullable<z.ZodNumber>;
146
+ humanReviewsPending: z.ZodNullable<z.ZodNumber>;
147
+ allowedWritePathReferences: z.ZodArray<z.ZodString>;
148
+ protectedPathReferences: z.ZodArray<z.ZodString>;
149
+ checks: z.ZodArray<z.ZodObject<{
150
+ reference: z.ZodString;
151
+ argvDigest: z.ZodString;
152
+ kind: z.ZodEnum<{
153
+ argv: "argv";
154
+ "package-script": "package-script";
155
+ }>;
156
+ backend: z.ZodEnum<{
157
+ none: "none";
158
+ oci: "oci";
159
+ }>;
160
+ approval: z.ZodLiteral<"required">;
161
+ }, z.core.$strict>>;
162
+ humanReviewReferences: z.ZodArray<z.ZodString>;
163
+ }, z.core.$strict>;
164
+ delivery: z.ZodObject<{
165
+ availability: z.ZodEnum<{
166
+ invalid: "invalid";
167
+ recorded: "recorded";
168
+ unavailable: "unavailable";
169
+ }>;
170
+ status: z.ZodEnum<{
171
+ failed: "failed";
172
+ incomplete: "incomplete";
173
+ pending: "pending";
174
+ pending_review: "pending_review";
175
+ unknown: "unknown";
176
+ verified: "verified";
177
+ }>;
178
+ patchId: z.ZodNullable<z.ZodString>;
179
+ snapshotDigest: z.ZodNullable<z.ZodString>;
180
+ interpretation: z.ZodLiteral<"recorded-checkpoint-not-current-workspace-verification">;
181
+ checks: z.ZodArray<z.ZodObject<{
182
+ reference: z.ZodString;
183
+ argvDigest: z.ZodString;
184
+ patchId: z.ZodString;
185
+ snapshotDigest: z.ZodString;
186
+ exitCode: z.ZodNumber;
187
+ timedOut: z.ZodBoolean;
188
+ unchanged: z.ZodBoolean;
189
+ }, z.core.$strict>>;
190
+ }, z.core.$strict>;
191
+ approvals: z.ZodObject<{
192
+ availability: z.ZodEnum<{
193
+ invalid: "invalid";
194
+ recorded: "recorded";
195
+ unavailable: "unavailable";
196
+ }>;
197
+ items: z.ZodArray<z.ZodObject<{
198
+ reference: z.ZodString;
199
+ toolReference: z.ZodString;
200
+ approved: z.ZodBoolean;
201
+ origin: z.ZodEnum<{
202
+ application: "application";
203
+ automatic: "automatic";
204
+ interactive: "interactive";
205
+ unknown: "unknown";
206
+ }>;
207
+ channelReference: z.ZodString;
208
+ policyDigest: z.ZodNullable<z.ZodString>;
209
+ status: z.ZodEnum<{
210
+ applied: "applied";
211
+ approved: "approved";
212
+ failed: "failed";
213
+ rejected: "rejected";
214
+ succeeded: "succeeded";
215
+ unknown: "unknown";
216
+ }>;
217
+ proposalId: z.ZodNullable<z.ZodString>;
218
+ exitCode: z.ZodNullable<z.ZodNumber>;
219
+ timedOut: z.ZodNullable<z.ZodBoolean>;
220
+ effects: z.ZodArray<z.ZodObject<{
221
+ pathReference: z.ZodString;
222
+ beforeDigest: z.ZodNullable<z.ZodString>;
223
+ afterDigest: z.ZodNullable<z.ZodString>;
224
+ }, z.core.$strict>>;
225
+ }, z.core.$strict>>;
226
+ }, z.core.$strict>;
227
+ usage: z.ZodObject<{
228
+ availability: z.ZodEnum<{
229
+ recorded: "recorded";
230
+ unavailable: "unavailable";
231
+ }>;
232
+ calls: z.ZodNullable<z.ZodNumber>;
233
+ inputTokens: z.ZodNullable<z.ZodNumber>;
234
+ outputTokens: z.ZodNullable<z.ZodNumber>;
235
+ complete: z.ZodNullable<z.ZodBoolean>;
236
+ estimatedUsd: z.ZodNullable<z.ZodNumber>;
237
+ costKind: z.ZodLiteral<"estimate-not-invoice">;
238
+ }, z.core.$strict>;
239
+ journal: z.ZodObject<{
240
+ availability: z.ZodEnum<{
241
+ recorded: "recorded";
242
+ unavailable: "unavailable";
243
+ }>;
244
+ entries: z.ZodNumber;
245
+ failed: z.ZodNumber;
246
+ unfinished: z.ZodNumber;
247
+ }, z.core.$strict>;
248
+ delegations: z.ZodObject<{
249
+ availability: z.ZodEnum<{
250
+ invalid: "invalid";
251
+ recorded: "recorded";
252
+ unavailable: "unavailable";
253
+ }>;
254
+ interpretation: z.ZodLiteral<"recorded-checkpoint-not-semantic-review">;
255
+ items: z.ZodArray<z.ZodObject<{
256
+ taskReference: z.ZodString;
257
+ childReference: z.ZodNullable<z.ZodString>;
258
+ recordedAcceptance: z.ZodBoolean;
259
+ reason: z.ZodEnum<{
260
+ child_identity_unavailable: "child_identity_unavailable";
261
+ coverage_missing: "coverage_missing";
262
+ duplicate_claim: "duplicate_claim";
263
+ evidence_missing: "evidence_missing";
264
+ incomplete: "incomplete";
265
+ invalid_json: "invalid_json";
266
+ invalid_schema: "invalid_schema";
267
+ missing_child: "missing_child";
268
+ path_denied: "path_denied";
269
+ task_mismatch: "task_mismatch";
270
+ valid: "valid";
271
+ }>;
272
+ semanticReview: z.ZodEnum<{
273
+ not_requested: "not_requested";
274
+ pending: "pending";
275
+ }>;
276
+ correctionsUsed: z.ZodNullable<z.ZodNumber>;
277
+ }, z.core.$strict>>;
278
+ }, z.core.$strict>;
279
+ children: z.ZodArray<z.ZodString>;
280
+ }, z.core.$strict>>;
281
+ missingChildren: z.ZodArray<z.ZodString>;
282
+ limitations: z.ZodArray<z.ZodEnum<{
283
+ invalid_approvals: "invalid_approvals";
284
+ invalid_contract: "invalid_contract";
285
+ invalid_delivery: "invalid_delivery";
286
+ journal_unavailable: "journal_unavailable";
287
+ missing_child: "missing_child";
288
+ tree_limit: "tree_limit";
289
+ }>>;
290
+ }, z.core.$strict>;
291
+ export type HarnessGovernanceReport = z.infer<typeof harnessGovernanceReportSchema>;
292
+ export interface HarnessGovernanceOptions {
293
+ session?: GovernanceSessionSource;
294
+ changeEnvelopes?: readonly unknown[];
295
+ now?: number;
296
+ }
297
+ /** Read-only store projection. Refuses concurrent revision changes and excessive journals. */
298
+ export declare function exportHarnessGovernanceReport(store: AgentRunStore, scope: AgentStoreScope | undefined, runId: string, options?: HarnessGovernanceOptions): Promise<HarnessGovernanceReport>;
299
+ export declare function renderHarnessGovernanceMarkdown(input: unknown): string;
@@ -0,0 +1,28 @@
1
+ import type { HarnessConfig } from "../runtime/config.js";
2
+ import { type SqliteAccessLease } from "./sqlite-access.js";
3
+ export declare const DESKTOP_DATABASE_BACKUP_LIMIT: number;
4
+ export interface DesktopDatabaseBackup {
5
+ directory: string;
6
+ size: number;
7
+ sha256: string;
8
+ logicalChecksum: string;
9
+ }
10
+ export interface DesktopBackupConfig extends HarnessConfig {
11
+ workspaceAbsent?: true;
12
+ accessLease?: SqliteAccessLease;
13
+ }
14
+ /** Full SQLite snapshot, including visual activity and any other tables.
15
+ * Caller must hold desktop admission closed and provide host-controlled paths.
16
+ * This captures one database; cross-project/index consistency belongs to the update transaction.
17
+ */
18
+ export declare function createDesktopDatabaseBackup(config: DesktopBackupConfig, backupRoot: string): Promise<DesktopDatabaseBackup>;
19
+ /** Rechecks the immutable copy against the host-held receipt before recovery may consume it. */
20
+ export declare function verifyDesktopDatabaseBackup(backup: DesktopDatabaseBackup): Promise<void>;
21
+ /** Worker state check under an exclusive inherited lease. Reads the live database
22
+ * without migrations, checkpointing, opening sessions or recreating a checkout.
23
+ * Core export validation covers its records; it is not an equality comparison
24
+ * against the backup or a semantic validator for every desktop activity table.
25
+ */
26
+ export declare function verifyDesktopDatabaseState(config: DesktopBackupConfig & {
27
+ accessLease: SqliteAccessLease;
28
+ }): Promise<void>;
@@ -0,0 +1,19 @@
1
+ import type { AgentRunStore, AgentStoreScope, McpClient } from '@zhivex-ai/core';
2
+ import type { McpStdioLaunchProposal } from '../integrations/mcp-stdio-admission.js';
3
+ export declare class McpExecutionJournalError extends Error {
4
+ readonly code: 'persistence_failed' | 'identity_changed' | 'replay_denied' | 'outcome_unknown' | 'cleanup_required';
5
+ readonly outcomeUnknown: boolean;
6
+ constructor(code: 'persistence_failed' | 'identity_changed' | 'replay_denied' | 'outcome_unknown' | 'cleanup_required', outcomeUnknown: boolean);
7
+ }
8
+ /** Reuses the scoped operations journal. Never stores raw arguments, secrets or server output. */
9
+ export declare function createJournaledMcpClient(options: {
10
+ client: McpClient & {
11
+ close(): Promise<void>;
12
+ };
13
+ proposal: Readonly<McpStdioLaunchProposal>;
14
+ store: AgentRunStore;
15
+ runId: string;
16
+ scope: AgentStoreScope;
17
+ }): McpClient & {
18
+ close(): Promise<void>;
19
+ };
@@ -0,0 +1,33 @@
1
+ import { z } from 'zod';
2
+ import type { AgentRunStore, AgentStoreScope } from '@zhivex-ai/core';
3
+ declare const decisionSchema: z.ZodObject<{
4
+ toolCallId: z.ZodString;
5
+ expectedRevision: z.ZodNumber;
6
+ outcome: z.ZodEnum<{
7
+ effect_confirmed: "effect_confirmed";
8
+ no_effect_confirmed: "no_effect_confirmed";
9
+ }>;
10
+ evidenceDigest: z.ZodString;
11
+ }, z.core.$strict>;
12
+ export type McpReconciliationDecision = z.infer<typeof decisionSchema>;
13
+ export interface McpReconciliationReview extends McpReconciliationDecision {
14
+ readonly runId: string;
15
+ readonly scope: Readonly<AgentStoreScope>;
16
+ readonly proposalHash: string;
17
+ readonly argumentsHash: string;
18
+ readonly toolNameHash: string;
19
+ }
20
+ /** Host-only decision authority. No model tool or workspace configuration exposes it.
21
+ * A resolution never supplies a fabricated result or replays the original key.
22
+ * Fresh execution still requires fresh host admission and agent approval.
23
+ */
24
+ export declare function createMcpReconciliationAuthority(options: {
25
+ store: AgentRunStore;
26
+ runId: string;
27
+ scope: AgentStoreScope;
28
+ hostId: string;
29
+ authorize(review: Readonly<McpReconciliationReview>): Promise<boolean>;
30
+ }): Readonly<{
31
+ reconcile(input: McpReconciliationDecision): Promise<void>;
32
+ }>;
33
+ export {};
@@ -0,0 +1,54 @@
1
+ import { z } from 'zod';
2
+ import type { AgentRunStore, AgentStoreScope } from '@zhivex-ai/core';
3
+ import type { McpStdioLaunchProposal } from '../integrations/mcp-stdio-admission.js';
4
+ declare const phases: readonly ['reserved', 'provisioning', 'ready', 'closing', 'closed', 'cleanup_required'];
5
+ export type McpResourcePhase = typeof phases[number];
6
+ export declare const mcpResourcePlanSchema: z.ZodObject<{
7
+ schemaVersion: z.ZodLiteral<1>;
8
+ kind: z.ZodLiteral<"isolated-mcp-resources">;
9
+ leaseId: z.ZodString;
10
+ scopeHash: z.ZodString;
11
+ hostHash: z.ZodString;
12
+ proposalHash: z.ZodString;
13
+ daemonId: z.ZodString;
14
+ ownerPid: z.ZodNumber;
15
+ ownerInstance: z.ZodString;
16
+ serverImageId: z.ZodString;
17
+ provisionerImageId: z.ZodString;
18
+ serverName: z.ZodString;
19
+ volumeName: z.ZodString;
20
+ seederName: z.ZodString;
21
+ }, z.core.$strict>;
22
+ export type McpResourcePlan = Readonly<z.infer<typeof mcpResourcePlanSchema>>;
23
+ export declare const mcpResourceOutputSchema: z.ZodObject<{
24
+ schemaVersion: z.ZodLiteral<1>;
25
+ phase: z.ZodEnum<{
26
+ cleanup_required: "cleanup_required";
27
+ closed: "closed";
28
+ closing: "closing";
29
+ provisioning: "provisioning";
30
+ ready: "ready";
31
+ reserved: "reserved";
32
+ }>;
33
+ }, z.core.$strict>;
34
+ export interface McpResourceLeaseJournal {
35
+ readonly plan: McpResourcePlan;
36
+ /** Label values contain only scoped identifiers, never commands or credentials. */
37
+ readonly labels: Readonly<Record<string, string>>;
38
+ advance(phase: McpResourcePhase): Promise<void>;
39
+ }
40
+ /** Reserve all names durably before creating any Docker resource. Host identity is host-owned. */
41
+ export declare function reserveMcpResources(options: {
42
+ store: AgentRunStore;
43
+ runId: string;
44
+ scope: AgentStoreScope;
45
+ hostId: string;
46
+ daemonId: string;
47
+ proposal: Readonly<McpStdioLaunchProposal>;
48
+ serverImageId: string;
49
+ provisionerImageId: string;
50
+ }): Promise<McpResourceLeaseJournal>;
51
+ /** Reconstruct only non-secret ownership labels from a validated durable plan. */
52
+ export declare function mcpResourceLabels(plan: McpResourcePlan): Readonly<Record<string, string>>;
53
+ export declare function matchesMcpResourceScope(plan: McpResourcePlan, runId: string, scope: AgentStoreScope, hostId: string): boolean;
54
+ export {};
@@ -40,6 +40,10 @@ export declare const workspaceRestoreOperationSchema: z.ZodObject<{
40
40
  }, z.core.$strict>;
41
41
  export type WorkspaceCheckpoint = z.infer<typeof workspaceCheckpointSchema>;
42
42
  export type WorkspaceRestoreOperation = z.infer<typeof workspaceRestoreOperationSchema>;
43
+ declare const retentionSelection: z.ZodObject<{
44
+ checkpointIds: z.ZodArray<z.ZodString>;
45
+ completedRestoreIds: z.ZodArray<z.ZodString>;
46
+ }, z.core.$strict>;
43
47
  /** Existing text files only. No deletion, creation, binary file, or mode rollback. */
44
48
  export declare const openWorkspaceCheckpointStore: (workspace: Workspace, sessions: CliSessionStore) => Promise<{
45
49
  close: () => void;
@@ -72,6 +76,139 @@ export declare const openWorkspaceCheckpointStore: (workspace: Workspace, sessio
72
76
  stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
73
77
  forkSessionId?: string | undefined;
74
78
  };
79
+ storageStatus: () => {
80
+ policy: 'explicit-reviewed-removal';
81
+ automaticEviction: false;
82
+ maxRecords: number;
83
+ maxRecordBytes: number;
84
+ maxFilesPerCheckpoint: number;
85
+ maxFileBytes: number;
86
+ records: number;
87
+ availableRecords: number;
88
+ serializedBytes: number;
89
+ pendingRestores: number;
90
+ checkpoints: {
91
+ id: string;
92
+ referenced: boolean;
93
+ }[];
94
+ };
95
+ prepareRetention: (input: z.infer<typeof retentionSelection>) => {
96
+ planId: string;
97
+ selection: {
98
+ checkpointIds: string[];
99
+ completedRestoreIds: string[];
100
+ };
101
+ records: {
102
+ id: string;
103
+ kind: string;
104
+ sessionId: string;
105
+ bytes: number;
106
+ }[];
107
+ recordsBefore: number;
108
+ recordsAfter: number;
109
+ bytesRemoved: number;
110
+ workspaceFilesChanged: false;
111
+ conversationsChanged: false;
112
+ };
113
+ /** Explicit operator review. Atomic scoped deletion never removes workspace files or sessions. */
114
+ applyRetention: (selection: z.infer<typeof retentionSelection>, reviewedPlanId: FileDigest) => Promise<{
115
+ planId: string;
116
+ selection: {
117
+ checkpointIds: string[];
118
+ completedRestoreIds: string[];
119
+ };
120
+ records: {
121
+ id: string;
122
+ kind: string;
123
+ sessionId: string;
124
+ bytes: number;
125
+ }[];
126
+ recordsBefore: number;
127
+ recordsAfter: number;
128
+ bytesRemoved: number;
129
+ workspaceFilesChanged: false;
130
+ conversationsChanged: false;
131
+ }>;
132
+ /** Scoped metadata only; file contents are disclosed only by explicit review. */
133
+ listCheckpoints: (sessionId: string) => {
134
+ id: string;
135
+ sessionId: string;
136
+ turnId: string;
137
+ files: {
138
+ path: string;
139
+ digest: string;
140
+ bytes: number;
141
+ mode: number;
142
+ }[];
143
+ }[];
144
+ listRestores: (sessionId: string) => {
145
+ id: string;
146
+ checkpointId: string;
147
+ proposalId: string;
148
+ stage: "applied" | "applying" | "completed" | "forked" | "forking" | "prepared";
149
+ forkSessionId?: string;
150
+ }[];
151
+ /** Read projection, not authorization. Digests must still be supplied to prepareRestore.
152
+ * Missing/protected/binary/oversized files are unavailable, never recreated. */
153
+ inspectCheckpoint: (id: string) => Promise<{
154
+ checkpoint: {
155
+ id: string;
156
+ sessionId: string;
157
+ turnId: string;
158
+ files: {
159
+ path: string;
160
+ digest: string;
161
+ bytes: number;
162
+ mode: number;
163
+ }[];
164
+ };
165
+ files: ({
166
+ path: string;
167
+ status: "mode-conflict";
168
+ before?: never;
169
+ after?: never;
170
+ expectedDigest?: never;
171
+ afterDigest?: never;
172
+ mode?: never;
173
+ } | {
174
+ path: string;
175
+ status: "available";
176
+ before: string;
177
+ after: string;
178
+ expectedDigest: string;
179
+ afterDigest: string;
180
+ mode: number;
181
+ } | {
182
+ before?: never;
183
+ after?: never;
184
+ expectedDigest?: never;
185
+ afterDigest?: never;
186
+ mode?: never;
187
+ path: string;
188
+ status: "unavailable";
189
+ })[];
190
+ coverage: {
191
+ existingTextOnly: true;
192
+ maxFiles: number;
193
+ maxFileBytes: number;
194
+ creation: false;
195
+ deletion: false;
196
+ binary: false;
197
+ modeRollback: false;
198
+ fullWorkspaceSnapshot: false;
199
+ };
200
+ }>;
201
+ /** Exact prepared diff. Reading it never forks a conversation or writes files. */
202
+ previewRestore: (id: string) => Promise<{
203
+ proposalId: string;
204
+ files: {
205
+ path: string;
206
+ expectedDigest: FileDigest | null;
207
+ before: string | null;
208
+ after: string;
209
+ afterDigest: FileDigest;
210
+ }[];
211
+ }>;
75
212
  capture: (input: {
76
213
  sessionId: string;
77
214
  turnId: string;
@@ -147,3 +284,4 @@ export declare const openWorkspaceCheckpointStore: (workspace: Workspace, sessio
147
284
  forkSessionId?: string | undefined;
148
285
  }>;
149
286
  }>;
287
+ export {};
@@ -0,0 +1,5 @@
1
+ import { type LanguageModel, type StreamEvent } from "@zhivex-ai/core";
2
+ /** SDK 0.12.4 exposes thinking/signature deltas as provider-data. Reassemble the
3
+ * signed block before it enters durable history; never replay raw delta objects. */
4
+ export declare function assembleAnthropicContinuation(events: AsyncIterable<StreamEvent>): AsyncIterable<StreamEvent>;
5
+ export declare const withAnthropicContinuation: (model: LanguageModel) => LanguageModel;
@@ -1,6 +1,6 @@
1
1
  import type { LanguageModel } from "@zhivex-ai/agents";
2
2
  import { type ModelGenerateInput, type ToolCall } from "@zhivex-ai/core";
3
- export declare const PROVIDERS: readonly ["meta", "qwen", "openai", "gemini"];
3
+ export declare const PROVIDERS: readonly ["meta", "qwen", "openai", "gemini", "anthropic", "vertex"];
4
4
  export type BuiltInHarnessProvider = (typeof PROVIDERS)[number];
5
5
  export type HarnessProvider = BuiltInHarnessProvider | (string & {});
6
6
  export type ProviderCapability = "streaming" | "tool-calling" | "approval-resume";
@@ -0,0 +1,27 @@
1
+ export interface VertexRoute {
2
+ readonly projectId: string;
3
+ readonly location: string;
4
+ }
5
+ /** Reject malformed resource segments without including customer identifiers in errors. */
6
+ export declare function vertexRoute(env: NodeJS.ProcessEnv): VertexRoute;
7
+ /** Configuration presence only; does not assert ADC validity or contact Google. */
8
+ export declare function vertexConfigured(env: NodeJS.ProcessEnv): boolean;
9
+ export declare const VERTEX_ENVIRONMENT: readonly ["GOOGLE_CLOUD_PROJECT", "VERTEX_LOCATION", "GOOGLE_APPLICATION_CREDENTIALS"];
10
+ export declare function vertexEnvironment(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
11
+ interface TokenSource {
12
+ getAccessToken(): Promise<string | null | undefined>;
13
+ }
14
+ type AuthFactory = (options: {
15
+ projectId: string;
16
+ scopes: string[];
17
+ keyFilename?: string;
18
+ }) => TokenSource;
19
+ /** ADC owns token caching/refresh. Never cache a bearer token in Harness configuration. */
20
+ export declare function vertexTokenSource(env: NodeJS.ProcessEnv, route: VertexRoute, createAuth?: AuthFactory): () => Promise<string>;
21
+ export declare class VertexAuthenticationError extends Error {
22
+ readonly status = 401;
23
+ readonly retryable = false;
24
+ constructor();
25
+ }
26
+ export declare function createVertexModel(model: string, env: NodeJS.ProcessEnv, createAuth?: AuthFactory): import("@zhivex-ai/core").LanguageModel<import("@zhivex-ai/vertex").VertexLanguageModelOptions>;
27
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { type LanguageModel } from "@zhivex-ai/core";
2
+ import { type DelegationResultContract } from "./delegation-result.js";
2
3
  /** Trusted application input, never constructed from a model tool call. */
3
4
  export interface HarnessDelegationContract {
4
5
  taskId: string;
@@ -6,6 +7,8 @@ export interface HarnessDelegationContract {
6
7
  prompt: string;
7
8
  allowedReadPaths: readonly string[];
8
9
  requiredOutput: string;
10
+ /** Opt-in experimental result evidence; legacy marker contracts remain unchanged. */
11
+ resultContract?: DelegationResultContract;
9
12
  }
10
13
  export declare const normalizeDelegationContracts: (value?: readonly HarnessDelegationContract[]) => Readonly<{
11
14
  taskId: string;
@@ -13,6 +16,12 @@ export declare const normalizeDelegationContracts: (value?: readonly HarnessDele
13
16
  prompt: string;
14
17
  requiredOutput: string;
15
18
  allowedReadPaths: readonly string[];
19
+ resultContract?: Readonly<{
20
+ requiredReadPaths: readonly string[];
21
+ schemaVersion: 1;
22
+ humanReviewRequired: boolean;
23
+ maxCorrections: number;
24
+ }>;
16
25
  }>[];
17
26
  export declare const delegationPrompt: (contract: HarnessDelegationContract) => string;
18
27
  export declare const delegationFingerprint: (contracts: readonly HarnessDelegationContract[]) => string;
@@ -0,0 +1,9 @@
1
+ import { type LanguageModel, type ToolExecutionResult, type ToolSet } from '@zhivex-ai/core';
2
+ import type { HarnessDelegationContract } from './delegation-contracts.js';
3
+ export declare const DELEGATION_FEEDBACK_TOOL = "__harness_result_feedback";
4
+ export declare const delegationCorrectionCount: (results: readonly ToolExecutionResult[]) => number;
5
+ /** Internal no-effect continuation lets SDK steps, journals, budgets and cancellation govern every retry. */
6
+ export declare function createDelegationCorrection(model: LanguageModel, contract: HarnessDelegationContract): {
7
+ model: LanguageModel;
8
+ tools: ToolSet;
9
+ };