@zhivex-ai/harness 1.4.0 → 1.5.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 (128) hide show
  1. package/CHANGELOG.md +32 -10
  2. package/README.md +7 -5
  3. package/SUPPORT.md +2 -2
  4. package/contracts/client-protocol-v1.schema.json +593 -0
  5. package/contracts/engine-api.json +156 -0
  6. package/contracts/public-api.json +12 -0
  7. package/contracts/stable-api-signatures.json +36 -36
  8. package/dist/acp-cli.js +54 -20
  9. package/dist/approvals/approval-diff.d.ts +2 -1
  10. package/dist/approvals/approval-preview.d.ts +1 -1
  11. package/dist/audit/index.d.ts +3 -0
  12. package/dist/audit/index.js +482 -0
  13. package/dist/audit/pack.d.ts +72 -0
  14. package/dist/audit-pack-kvw7ng34.js +532 -0
  15. package/dist/cli/arguments.d.ts +3 -1
  16. package/dist/cli/audit-pack.d.ts +24 -0
  17. package/dist/cli/cli-credentials.d.ts +6 -0
  18. package/dist/cli/cli-profiles.d.ts +4 -2
  19. package/dist/cli/node-engine.d.ts +2 -0
  20. package/dist/cli-entry-75j3r49b.js +484 -0
  21. package/dist/cli-entry-928p8h41.js +10067 -0
  22. package/dist/cli-entry-h2yc9x37.js +10350 -0
  23. package/dist/{cli-entry-20w6nh0k.js → cli-entry-hdtfef27.js} +439 -19
  24. package/dist/{cli-entry-w0hterjs.js → cli-entry-q8bgkn9m.js} +40 -13
  25. package/dist/{cli-2h37qyvg.js → cli-vyrytn3m.js} +253 -644
  26. package/dist/cli.js +27 -2
  27. package/dist/client/json-contracts.d.ts +4 -0
  28. package/dist/client/protocol.d.ts +133 -0
  29. package/dist/client/task-control-host.d.ts +400 -0
  30. package/dist/client/task-projection-host.d.ts +12 -0
  31. package/dist/client/task-projection.d.ts +168 -0
  32. package/dist/compat/code-support.js +28 -22
  33. package/dist/{config-qt69hkqj.js → config-r9fdhce6.js} +3 -3
  34. package/dist/{config-j9624t6t.js → config-vyajmksy.js} +1 -1
  35. package/dist/engine/acp.js +15 -11
  36. package/dist/engine/client.js +14 -10
  37. package/dist/engine/desktop-providers-v1.d.ts +2 -0
  38. package/dist/engine/desktop-providers-v1.js +23 -3
  39. package/dist/engine/desktop-state-v1.js +11 -8
  40. package/dist/engine/index.d.ts +3 -0
  41. package/dist/engine/index.js +101 -554
  42. package/dist/engine/mcp-stdio-v1.js +8 -6
  43. package/dist/engine/models.js +76 -4
  44. package/dist/engine/protocol.d.ts +2 -0
  45. package/dist/engine/protocol.js +110 -0
  46. package/dist/engine/service.js +15 -11
  47. package/dist/hostile-repository-demo.js +1232 -564
  48. package/dist/{index-8zjmnyw5.js → index-1265j7t2.js} +73 -6
  49. package/dist/{index-nmjdwd4p.js → index-4gt045j0.js} +109 -1
  50. package/dist/{index-pdmevfxv.js → index-5zbq9ztj.js} +5 -259
  51. package/dist/{index-6dft2vev.js → index-63gbp0cz.js} +5 -3
  52. package/dist/index-6dxrbnxm.js +719 -0
  53. package/dist/{index-pp474137.js → index-6fp7kdpx.js} +769 -933
  54. package/dist/{index-61gthdz6.js → index-8sm2a1wa.js} +1 -1
  55. package/dist/{index-rkbf7dqg.js → index-96ezrvg2.js} +57 -13
  56. package/dist/index-bt2p8x7r.js +329 -0
  57. package/dist/index-c39197wq.js +552 -0
  58. package/dist/{index-m82cfspw.js → index-eps3c3g6.js} +877 -963
  59. package/dist/{index-s2k2edts.js → index-fqqz1yt8.js} +110 -1544
  60. package/dist/{index-m34q25jj.js → index-ggstwr0v.js} +192 -838
  61. package/dist/index-jpdvn09j.js +490 -0
  62. package/dist/{index-xqxeypt5.js → index-mzydbzp8.js} +76 -4
  63. package/dist/index-pq3kz1r8.js +269 -0
  64. package/dist/{index-wg1sd3at.js → index-qfsrrnz6.js} +1 -1
  65. package/dist/{index-937cb7y8.js → index-vc7yxz50.js} +561 -35
  66. package/dist/{index-5jhgatga.js → index-vvzc5ezz.js} +7 -6
  67. package/dist/index-wwthv10a.js +1507 -0
  68. package/dist/{index-tfzta544.js → index-xfedewpt.js} +17 -9
  69. package/dist/index-yx52bt4a.js +511 -0
  70. package/dist/index.d.ts +3 -0
  71. package/dist/index.js +93 -77
  72. package/dist/integrations/mcp-stdio-tools.d.ts +4 -1
  73. package/dist/internal/desktop/providers.d.ts +2 -0
  74. package/dist/models/catalog.d.ts +2 -0
  75. package/dist/persistence/sqlite-database.d.ts +1 -0
  76. package/dist/providers/azure-openai.d.ts +14 -0
  77. package/dist/providers/bedrock.d.ts +23 -0
  78. package/dist/providers/providers.d.ts +1 -1
  79. package/dist/runtime/budget-ledger-scope.d.ts +14 -0
  80. package/dist/runtime/durable-review-group.d.ts +33 -0
  81. package/dist/runtime/harness.d.ts +11 -0
  82. package/dist/runtime/run-interruption.d.ts +7 -0
  83. package/dist/runtime/shared-budget.d.ts +30 -0
  84. package/dist/runtime/task-continuity.d.ts +300 -77
  85. package/dist/service-cli.js +15 -11
  86. package/dist/{service-client-cli-fn54ev6w.js → service-client-cli-v6qptg9x.js} +400 -305
  87. package/dist/tools/workspace.d.ts +2 -2
  88. package/dist/verify-historical-migrations.js +1237 -566
  89. package/dist/workspace/edit-contracts.d.ts +2 -2
  90. package/dist/workspace/path-policy.d.ts +2 -1
  91. package/dist/workspace/workspace.d.ts +13 -0
  92. package/dist/zhx.js +27 -2
  93. package/docs/AUDIT_PACK.md +99 -0
  94. package/docs/AZURE_OPENAI.md +53 -0
  95. package/docs/BEDROCK.md +56 -0
  96. package/docs/CLI.md +15 -0
  97. package/docs/CLIENT_PROTOCOL.md +178 -0
  98. package/docs/CODE_RELEASE.md +59 -7
  99. package/docs/CODE_WEB_TASKS.md +116 -0
  100. package/docs/CONTEXT_ENGINEERING.md +59 -0
  101. package/docs/CREDENTIALS.md +21 -0
  102. package/docs/DURABLE_OPERATIONS.md +93 -1
  103. package/docs/ENGINE_API.md +5 -2
  104. package/docs/EXTENSIBILITY.md +8 -4
  105. package/docs/FIRST_USE.md +6 -6
  106. package/docs/MINIMUM_TASK_AUTHORITY.md +3 -3
  107. package/docs/PROJECT_MEMORY.md +1 -1
  108. package/docs/PUBLIC_SECURITY.md +14 -1
  109. package/docs/README.md +6 -1
  110. package/docs/REPOSITORY_EDITING.md +1 -1
  111. package/docs/STABILITY.md +3 -1
  112. package/docs/SUPPORT_MATRIX.md +1 -1
  113. package/docs/SUPPORT_MATRIX_1_1.md +1 -1
  114. package/docs/TOOL_POLICY.md +4 -1
  115. package/docs/USAGE.md +3 -1
  116. package/docs/VERTEX.md +2 -2
  117. package/docs/WEB_LIMITS.md +4 -3
  118. package/docs/adr/0002-isolated-mcp-stdio.md +7 -4
  119. package/docs/support-matrix-1.1.json +3 -1
  120. package/docs/support-matrix.json +6 -4
  121. package/evaluations/code-task-ui.json +20 -0
  122. package/evaluations/representative-assembly-matrix.json +19 -1
  123. package/evaluations/task-projection.json +10 -0
  124. package/evaluations/task-recovery-lab.json +60 -0
  125. package/examples/README.md +3 -3
  126. package/package.json +23 -13
  127. package/dist/cli-entry-4ngptr62.js +0 -19900
  128. package/dist/index-m49jx72n.js +0 -220
package/dist/index.js CHANGED
@@ -8,13 +8,7 @@ import {
8
8
  terminalSupportsColor
9
9
  } from "./index-4jw3tvy8.js";
10
10
  import {
11
- CHANGE_ENVELOPE_DIGEST_ALGORITHM,
12
- CHANGE_ENVELOPE_SCHEMA_VERSION,
13
11
  DEFAULT_TIME_TO_SAFE_FIX_GOAL,
14
- MAX_CHANGE_ENVELOPE_APPROVALS,
15
- MAX_CHANGE_ENVELOPE_APPROVAL_SCOPES,
16
- MAX_CHANGE_ENVELOPE_ATTESTATIONS,
17
- MAX_CHANGE_ENVELOPE_CHECKS,
18
12
  TIME_TO_SAFE_FIX_CARRIERS,
19
13
  TIME_TO_SAFE_FIX_DIAGNOSTIC_CODES,
20
14
  TIME_TO_SAFE_FIX_FAILURE_ORIGINS,
@@ -22,16 +16,7 @@ import {
22
16
  TIME_TO_SAFE_FIX_GOALS,
23
17
  TIME_TO_SAFE_FIX_PROFILES,
24
18
  TIME_TO_SAFE_FIX_SCHEMA_VERSION,
25
- canonicalizeChangeEnvelope,
26
- changeEnvelopeApprovalSchema,
27
- changeEnvelopeBaseSchema,
28
- changeEnvelopeCheckSchema,
29
- changeEnvelopeEvidenceSchema,
30
- changeEnvelopeFingerprintsSchema,
31
- changeEnvelopeInputSchema,
32
- changeEnvelopePatchSchema,
33
- changeEnvelopePreconditionsSchema,
34
- changeEnvelopeSchema,
19
+ cancelHarnessReviewGroup,
35
20
  classifyTimeToSafeFixFailure,
36
21
  cliChangeEnvelopeVerificationDocumentSchema,
37
22
  cliDoctorDocumentSchema,
@@ -55,23 +40,19 @@ import {
55
40
  cliStateStatusDocumentSchema,
56
41
  cliStreamErrorDocumentSchema,
57
42
  cliStreamResultDocumentSchema,
58
- computeChangeEnvelopeDigest,
59
- computeChangeEnvelopeEvidenceDigest,
60
- createChangeEnvelope,
61
43
  createTimeToSafeFixCases,
62
44
  createTimeToSafeFixReport,
63
45
  createTimeToSafeFixSample,
64
- digestChangeEnvelopeArtifact,
65
- externalAttestationReferenceSchema,
66
46
  injectTimeToSafeFixAttack,
47
+ inspectHarnessReviewGroup,
67
48
  parseCliJsonDocument,
68
49
  parseCliJsonLineDocument,
69
50
  recommendCompactionModels,
51
+ runHarnessDurableReviewGroup,
70
52
  timeToSafeFixDriverResultSchema,
71
53
  timeToSafeFixLatencyStatistics,
72
- timeToSafeFixTaskSchema,
73
- verifyChangeEnvelope
74
- } from "./index-m82cfspw.js";
54
+ timeToSafeFixTaskSchema
55
+ } from "./index-eps3c3g6.js";
75
56
  import {
76
57
  HARNESS_STATE_BACKUP_MAX_BYTES,
77
58
  HARNESS_STATE_BACKUP_SCHEMA_VERSION,
@@ -82,7 +63,7 @@ import {
82
63
  inspectHarnessState,
83
64
  readHarnessStateBackup,
84
65
  stateBackupBundleSchema
85
- } from "./index-tfzta544.js";
66
+ } from "./index-xfedewpt.js";
86
67
  import {
87
68
  CLI_COMMAND_OPTION_CONTRACTS,
88
69
  CLI_OPTION_DEFINITIONS,
@@ -92,7 +73,35 @@ import {
92
73
  resolveHarnessModelRoutes,
93
74
  serializeHarnessModelRoutes,
94
75
  validateCliCommandOptions
95
- } from "./index-61gthdz6.js";
76
+ } from "./index-8sm2a1wa.js";
77
+ import {
78
+ createAcpConnection,
79
+ serveAcpStdio
80
+ } from "./index-3ah1f369.js";
81
+ import {
82
+ CHANGE_ENVELOPE_DIGEST_ALGORITHM,
83
+ CHANGE_ENVELOPE_SCHEMA_VERSION,
84
+ MAX_CHANGE_ENVELOPE_APPROVALS,
85
+ MAX_CHANGE_ENVELOPE_APPROVAL_SCOPES,
86
+ MAX_CHANGE_ENVELOPE_ATTESTATIONS,
87
+ MAX_CHANGE_ENVELOPE_CHECKS,
88
+ canonicalizeChangeEnvelope,
89
+ changeEnvelopeApprovalSchema,
90
+ changeEnvelopeBaseSchema,
91
+ changeEnvelopeCheckSchema,
92
+ changeEnvelopeEvidenceSchema,
93
+ changeEnvelopeFingerprintsSchema,
94
+ changeEnvelopeInputSchema,
95
+ changeEnvelopePatchSchema,
96
+ changeEnvelopePreconditionsSchema,
97
+ changeEnvelopeSchema,
98
+ computeChangeEnvelopeDigest,
99
+ computeChangeEnvelopeEvidenceDigest,
100
+ createChangeEnvelope,
101
+ digestChangeEnvelopeArtifact,
102
+ externalAttestationReferenceSchema,
103
+ verifyChangeEnvelope
104
+ } from "./index-yx52bt4a.js";
96
105
  import {
97
106
  harnessLocalCredentialsSchema,
98
107
  openHarnessActivityStore,
@@ -100,17 +109,13 @@ import {
100
109
  recoverHarnessLocalService,
101
110
  requestHarnessLocalService,
102
111
  startHarnessLocalService
103
- } from "./index-5jhgatga.js";
104
- import {
105
- createAcpConnection,
106
- serveAcpStdio
107
- } from "./index-3ah1f369.js";
112
+ } from "./index-vvzc5ezz.js";
108
113
  import {
109
114
  createHarnessClientAdapter
110
- } from "./index-937cb7y8.js";
115
+ } from "./index-vc7yxz50.js";
111
116
  import {
112
117
  openWorkspaceCheckpointStore
113
- } from "./index-6dft2vev.js";
118
+ } from "./index-63gbp0cz.js";
114
119
  import {
115
120
  DEFAULT_HARNESS_CONTEXT_MANIFEST,
116
121
  DEFAULT_HARNESS_PROJECT_INSTRUCTIONS,
@@ -127,7 +132,6 @@ import {
127
132
  MAX_HARNESS_SKILL_FILE_BYTES,
128
133
  SEMANTIC_COMPACTION_VERSION,
129
134
  appendUserMessage,
130
- applyHarnessToolPolicy,
131
135
  assertHarnessModelCapabilities,
132
136
  compactHarnessMessages,
133
137
  createEmptyHarnessContextBundle,
@@ -135,7 +139,6 @@ import {
135
139
  createHarness,
136
140
  createHarnessLifecycleDispatcher,
137
141
  createHarnessSubagents,
138
- createHarnessToolPolicy,
139
142
  createProgressMonitor,
140
143
  createSemanticCompactor,
141
144
  estimateMessageTokens,
@@ -143,7 +146,6 @@ import {
143
146
  harnessContextFingerprintInput,
144
147
  harnessLifecycleFingerprintInput,
145
148
  harnessSkillLoadInputSchema,
146
- harnessToolPolicySchema,
147
149
  inspectHarnessModelCapabilities,
148
150
  isHarnessContextDigest,
149
151
  loadHarnessProjectContext,
@@ -152,69 +154,38 @@ import {
152
154
  runHarness,
153
155
  runHarnessReviewGroup,
154
156
  selectHarnessModel
155
- } from "./index-pp474137.js";
157
+ } from "./index-6fp7kdpx.js";
156
158
  import {
157
159
  HARNESS_OPERATIONS_SCHEMA_VERSION,
158
- HARNESS_SESSION_INDEX_FILE,
159
- HARNESS_SESSION_SCHEMA_VERSION,
160
160
  HARNESS_SQLITE_FILE,
161
- SESSION_RUN_STATUSES,
162
161
  TERMINAL_RUN_STATUSES,
163
- TERMINAL_SESSION_RUN_STATUSES,
164
162
  cancelHarnessRun,
165
163
  cleanupHarnessRuns,
166
164
  inspectHarnessRun,
167
165
  listHarnessRuns,
168
166
  migrateLegacyFileRuns,
169
- openCliSessionStore,
170
- openHarnessPersistence,
171
- openSessionStore,
172
- validateStateDirectory
173
- } from "./index-s2k2edts.js";
167
+ openHarnessPersistence
168
+ } from "./index-wwthv10a.js";
174
169
  import {
175
- BUN_ENGINE_RANGE,
176
170
  HARNESS_MCP_CONFIG_SCHEMA_VERSION,
177
171
  HARNESS_MCP_PERMISSIONS,
178
- HARNESS_VERSION,
179
- NODE_ENGINE_RANGE,
180
172
  createHarnessMcpTools,
181
173
  createHttpMcpClient,
182
174
  loadHarnessMcpConfiguration,
183
175
  normalizeHarnessMcpConfiguration
184
- } from "./index-pdmevfxv.js";
176
+ } from "./index-5zbq9ztj.js";
185
177
  import {
186
178
  CliOciRuntimeAdapter,
187
- EDIT_CONTRACT_SCHEMA_VERSION,
188
- EDIT_DIGEST_ALGORITHM,
189
179
  HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
190
180
  HARNESS_OCI_LABEL,
191
181
  HARNESS_OCI_LABEL_VALUE,
192
- MAX_EDIT_CHANGES,
193
- MAX_EDIT_FILE_BYTES,
194
- MAX_EDIT_PROPOSAL_BYTES,
195
182
  Workspace,
196
- applyEditProposalInputSchema,
197
183
  cleanupHarnessExecutionArtifacts,
198
- createEditProposal,
199
184
  createHarnessOciExecutionEnvironment,
200
185
  describeOciCommand,
201
- editChangeSchema,
202
- editChangesSchema,
203
- editContractDocument,
204
- editProposalChangeSchema,
205
- editProposalInputSchema,
206
- editProposalSchema,
207
186
  executionFingerprintInput,
208
- fileDigestSchema,
209
- harnessExecutionSession,
210
- moveFileInputSchema,
211
- mutationAuditEntrySchema,
212
- mutationOperationSchema,
213
- quarantineFileInputSchema,
214
- restoreFileInputSchema,
215
- validateEditProposal,
216
- workspaceFilePathSchema
217
- } from "./index-m34q25jj.js";
187
+ harnessExecutionSession
188
+ } from "./index-ggstwr0v.js";
218
189
  import {
219
190
  BUILTIN_PROVIDER_REGISTRATIONS,
220
191
  DEFAULT_ALLOWED_CHECKS,
@@ -239,9 +210,51 @@ import {
239
210
  providerAvailability,
240
211
  providerDescriptor,
241
212
  resolveHarnessConfig
242
- } from "./index-8zjmnyw5.js";
243
- import"./index-m49jx72n.js";
244
- import"./index-xqxeypt5.js";
213
+ } from "./index-1265j7t2.js";
214
+ import"./index-c39197wq.js";
215
+ import"./index-mzydbzp8.js";
216
+ import {
217
+ applyHarnessToolPolicy,
218
+ createHarnessToolPolicy,
219
+ harnessToolPolicySchema
220
+ } from "./index-bt2p8x7r.js";
221
+ import {
222
+ HARNESS_SESSION_INDEX_FILE,
223
+ HARNESS_SESSION_SCHEMA_VERSION,
224
+ SESSION_RUN_STATUSES,
225
+ TERMINAL_SESSION_RUN_STATUSES,
226
+ openCliSessionStore,
227
+ openSessionStore,
228
+ validateStateDirectory
229
+ } from "./index-fqqz1yt8.js";
230
+ import {
231
+ BUN_ENGINE_RANGE,
232
+ HARNESS_VERSION,
233
+ NODE_ENGINE_RANGE
234
+ } from "./index-pq3kz1r8.js";
235
+ import {
236
+ EDIT_CONTRACT_SCHEMA_VERSION,
237
+ EDIT_DIGEST_ALGORITHM,
238
+ MAX_EDIT_CHANGES,
239
+ MAX_EDIT_FILE_BYTES,
240
+ MAX_EDIT_PROPOSAL_BYTES,
241
+ applyEditProposalInputSchema,
242
+ createEditProposal,
243
+ editChangeSchema,
244
+ editChangesSchema,
245
+ editContractDocument,
246
+ editProposalChangeSchema,
247
+ editProposalInputSchema,
248
+ editProposalSchema,
249
+ fileDigestSchema,
250
+ moveFileInputSchema,
251
+ mutationAuditEntrySchema,
252
+ mutationOperationSchema,
253
+ quarantineFileInputSchema,
254
+ restoreFileInputSchema,
255
+ validateEditProposal,
256
+ workspaceFilePathSchema
257
+ } from "./index-6dxrbnxm.js";
245
258
  import {
246
259
  CLI_EVENT_SCHEMA_VERSION,
247
260
  CLI_JSON_SCHEMA_VERSION,
@@ -252,7 +265,7 @@ import {
252
265
  serializeStreamResult,
253
266
  streamEventDocument,
254
267
  streamResultDocument
255
- } from "./index-nmjdwd4p.js";
268
+ } from "./index-4gt045j0.js";
256
269
  import {
257
270
  HARNESS_ERROR_CODES,
258
271
  HARNESS_ERROR_SCHEMA_VERSION,
@@ -356,6 +369,7 @@ export {
356
369
  applyEditProposalInputSchema,
357
370
  applyHarnessToolPolicy,
358
371
  assertHarnessModelCapabilities,
372
+ cancelHarnessReviewGroup,
359
373
  cancelHarnessRun,
360
374
  canonicalizeChangeEnvelope,
361
375
  changeEnvelopeApprovalSchema,
@@ -448,6 +462,7 @@ export {
448
462
  importHarnessStateBackupFile,
449
463
  injectTimeToSafeFixAttack,
450
464
  inspectHarnessModelCapabilities,
465
+ inspectHarnessReviewGroup,
451
466
  inspectHarnessRun,
452
467
  inspectHarnessState,
453
468
  isHarnessContextDigest,
@@ -485,6 +500,7 @@ export {
485
500
  resolveTerminalApprovals,
486
501
  restoreFileInputSchema,
487
502
  runHarness,
503
+ runHarnessDurableReviewGroup,
488
504
  runHarnessReviewGroup,
489
505
  sanitizeTerminalText,
490
506
  selectHarnessModel,
@@ -1,12 +1,15 @@
1
1
  import { type McpClient, type ToolSet } from '@zhivex-ai/core';
2
2
  import type { McpStdioLaunchProposal } from './mcp-stdio-admission.js';
3
3
  import { createJournaledMcpClient } from '../persistence/mcp-execution-journal.js';
4
- /** Host tool bridge. Existing agent execution supplies durable interrupt approvals. */
4
+ /** Host tool bridge. Tool results are untrusted data. Existing agent execution supplies durable interrupt approvals.
5
+ * flagEncodedSecrets is optional. Credential-bearing servers use it to mark encodings and high-entropy tokens; it does not rewrite discovery schemas. */
5
6
  export declare function createIsolatedMcpTools(options: {
6
7
  client: McpClient & {
7
8
  close(): Promise<void>;
8
9
  };
9
10
  proposal: Readonly<McpStdioLaunchProposal>;
10
11
  sensitiveValues?: readonly string[];
12
+ /** When set, tool results flag known encodings of sensitiveValues and other high-entropy encoded strings. */
13
+ flagEncodedSecrets?: boolean;
11
14
  journal?: Pick<Parameters<typeof createJournaledMcpClient>[0], 'store' | 'runId' | 'scope'>;
12
15
  }): Promise<ToolSet>;
@@ -5,6 +5,8 @@ export { resolveHarnessConfig } from "../../runtime/config.js";
5
5
  export { DEFAULT_PROVIDER_REGISTRY } from "../../providers/providers.js";
6
6
  export { PROVIDERS } from "../../providers/providers.js";
7
7
  export { vertexConfigured, vertexEnvironment, vertexTokenSource, vertexRoute } from "../../providers/vertex-auth.js";
8
+ export { bedrockConfigured, bedrockEnvironment, bedrockOpenAIBaseURL, bedrockRegion, bedrockRuntime } from "../../providers/bedrock.js";
9
+ export { azureOpenAIConfigured, azureOpenAIEnvironment, azureOpenAIEndpoint, azureOpenAIApiVersion, azureOpenAIDeployments } from "../../providers/azure-openai.js";
8
10
  export { bundledModelCatalog, catalogModels, modelDescription } from "../../models/catalog.js";
9
11
  export type { CatalogModel, ModelCatalog } from "../../models/catalog.js";
10
12
  export { loadModelCatalog } from "../../models/catalog-store.js";
@@ -70,6 +70,8 @@ export declare const modelCatalogSchema: z.ZodObject<{
70
70
  providers: z.ZodArray<z.ZodObject<{
71
71
  id: z.ZodEnum<{
72
72
  anthropic: "anthropic";
73
+ "azure-openai": "azure-openai";
74
+ bedrock: "bedrock";
73
75
  gemini: "gemini";
74
76
  meta: "meta";
75
77
  openai: "openai";
@@ -1,4 +1,5 @@
1
1
  import { type SqliteAccessLease } from "./sqlite-access.js";
2
+ export declare const installSqliteExperimentalWarningFilter: () => void;
2
3
  export interface SqliteDatabaseOptions {
3
4
  create?: boolean;
4
5
  readonly?: boolean;
@@ -0,0 +1,14 @@
1
+ import { type LanguageModel } from "@zhivex-ai/core";
2
+ /** Transport settings hashed into durable resumes. The API key is not included. */
3
+ export declare const AZURE_OPENAI_TRANSPORT_ENVIRONMENT: readonly ["AZURE_OPENAI_ENDPOINT", "AZURE_OPENAI_API_VERSION", "AZURE_OPENAI_DEPLOYMENTS"];
4
+ export interface AzureOpenAIDeployment {
5
+ readonly model: string;
6
+ }
7
+ export declare function azureOpenAIEndpoint(env: NodeJS.ProcessEnv): string;
8
+ export declare function azureOpenAIApiVersion(env: NodeJS.ProcessEnv): string | undefined;
9
+ /** Accepts `{"deployment":"gpt-5.4"}` and `{"deployment":{"model":"gpt-5.4"}}`. */
10
+ export declare function azureOpenAIDeployments(env: NodeJS.ProcessEnv): Readonly<Record<string, AzureOpenAIDeployment>>;
11
+ /** Presence only. Does not contact Azure or check the key's account access. */
12
+ export declare function azureOpenAIConfigured(env: NodeJS.ProcessEnv): boolean;
13
+ export declare function azureOpenAIEnvironment(env: NodeJS.ProcessEnv, secret?: string): NodeJS.ProcessEnv;
14
+ export declare function createAzureOpenAIModel(model: string, env: NodeJS.ProcessEnv): LanguageModel;
@@ -0,0 +1,23 @@
1
+ import { type LanguageModel } from "@zhivex-ai/core";
2
+ /** Transport settings hashed into durable resumes. Secrets stay out of this list. */
3
+ export declare const BEDROCK_TRANSPORT_ENVIRONMENT: readonly ["AWS_REGION", "AWS_DEFAULT_REGION", "AWS_PROFILE", "BEDROCK_RUNTIME", "BEDROCK_OPENAI_BASE_URL"];
4
+ export declare const BEDROCK_CREDENTIAL_ENVIRONMENT: readonly ["BEDROCK_API_KEY", "AWS_BEARER_TOKEN_BEDROCK"];
5
+ /**
6
+ * SDK matrix: Converse is Tier B and `runtime: "openai"` is Tier A.
7
+ * Published `@zhivex-ai/bedrock@2.0.7` reports those labels. Converse includes
8
+ * reasoning and `toolChoiceNone`. Harness reports the installed label and
9
+ * does not relabel the model.
10
+ */
11
+ export declare const BEDROCK_MATRIX_TIER: {
12
+ readonly converse: "tier-b";
13
+ readonly openai: "tier-a";
14
+ };
15
+ export type BedrockRuntime = "converse" | "openai";
16
+ export declare function bedrockRuntime(env: NodeJS.ProcessEnv): BedrockRuntime;
17
+ /** Region only. Does not contact AWS or read the credential chain. */
18
+ export declare function bedrockRegion(env: NodeJS.ProcessEnv): string;
19
+ export declare function bedrockOpenAIBaseURL(env: NodeJS.ProcessEnv): string;
20
+ /** Presence only. The AWS credential chain is not resolved and no request is sent. */
21
+ export declare function bedrockConfigured(env: NodeJS.ProcessEnv): boolean;
22
+ export declare function bedrockEnvironment(env: NodeJS.ProcessEnv, secret?: string): NodeJS.ProcessEnv;
23
+ export declare function createBedrockModel(model: string, env: NodeJS.ProcessEnv): 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", "anthropic", "vertex"];
3
+ export declare const PROVIDERS: readonly ["meta", "qwen", "openai", "gemini", "anthropic", "vertex", "bedrock", "azure-openai"];
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,14 @@
1
+ import type { AgentRunStore, AgentStoreScope } from "@zhivex-ai/core";
2
+ /** SDK coordinators address ledgers with this namespace. The durable owner appends the source namespace. */
3
+ export declare const BUDGET_LEDGER_NAMESPACE = "__zhivex_budget__";
4
+ export declare const BUDGET_OWNER_NAMESPACE_KEY = "budgetOwnerNamespace";
5
+ export declare const isReservedBudgetNamespace: (namespace: string | undefined) => boolean;
6
+ /** Bind the caller's full namespace into the ledger owner. Collapsing every namespace to the SDK marker lets one tenant read another's ledger by run id. */
7
+ export declare const budgetLedgerNamespace: (namespace: string) => string;
8
+ /**
9
+ * A named source becomes `__zhivex_budget__:<namespace>`.
10
+ * An omitted namespace uses the trailing-colon owner, which `budgetLedgerNamespace` never produces, so it cannot join a named ledger.
11
+ */
12
+ export declare const budgetLedgerScope: (scope: Pick<AgentStoreScope, "tenantId" | "userId" | "namespace">) => AgentStoreScope;
13
+ /** Translate the SDK's collapsed namespace onto the bound owner before the file or SQLite store. */
14
+ export declare const bindBudgetLedgerStore: (primary: AgentRunStore, scope: AgentStoreScope, budget?: AgentRunStore) => AgentRunStore;
@@ -0,0 +1,33 @@
1
+ import { type AgentRunOutput, type AgentDefinition, type LanguageModel } from "@zhivex-ai/agents";
2
+ import type { AgentRunStore } from "@zhivex-ai/agents/ops";
3
+ import type { UsageLedger } from "./usage-ledger.js";
4
+ import type { HarnessConfig, HarnessSubagentProfile } from "./config.js";
5
+ type Runtime = {
6
+ usageLedger?: UsageLedger;
7
+ config: HarnessConfig;
8
+ store: AgentRunStore;
9
+ subagents: ReadonlyMap<HarnessSubagentProfile, AgentDefinition<LanguageModel>>;
10
+ };
11
+ export interface HarnessDurableReviewGroupResult {
12
+ schemaVersion: 1;
13
+ kind: "durable-review-group";
14
+ groupId: string;
15
+ cancellationRequested: boolean;
16
+ status: "queued" | "running" | "blocked" | "waiting_approval" | "suspended" | "completed" | "partial" | "failed" | "timed_out" | "cancel_requested" | "cancelled";
17
+ members: {
18
+ profile: "explorer" | "reviewer";
19
+ runId: string;
20
+ output?: AgentRunOutput;
21
+ }[];
22
+ }
23
+ /** Read-only reconstruction; no model calls and no new child identities. */
24
+ export declare function inspectHarnessReviewGroup(runtime: Runtime, groupId: string): Promise<HarnessDurableReviewGroupResult>;
25
+ /** Opt-in durable counterpart to the legacy, ephemeral runHarnessReviewGroup. */
26
+ export declare function runHarnessDurableReviewGroup(runtime: Runtime, input: {
27
+ groupId: string;
28
+ prompt: string;
29
+ abortSignal?: AbortSignal;
30
+ }, profiles?: readonly HarnessSubagentProfile[]): Promise<HarnessDurableReviewGroupResult>;
31
+ /** Persist intention before traversal. Never change a terminal child. */
32
+ export declare function cancelHarnessReviewGroup(runtime: Runtime, groupId: string): Promise<HarnessDurableReviewGroupResult>;
33
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { type TaskTelemetrySnapshot } from './task-telemetry.js';
2
+ import { type HarnessSharedBudgetOptions } from "./shared-budget.js";
2
3
  import { createRequestMeasurements } from '../context/request-measurements.js';
3
4
  import { type HarnessIsolatedMcpSession } from '../integrations/mcp-host-session.js';
4
5
  import { type HarnessDelegationContract } from "./delegation-contracts.js";
@@ -84,6 +85,8 @@ export interface HarnessRunDiagnostics {
84
85
  progress?: ReturnType<typeof createRepairProgress>["stats"];
85
86
  }
86
87
  export interface HarnessRunOptions {
88
+ /** Opt-in host-owned shared SDK token reservations across primary, children and compaction. */
89
+ sharedBudget?: HarnessSharedBudgetOptions;
87
90
  /** Experimental, application-owned requirements for a new run. */
88
91
  taskAcceptance?: TaskAcceptanceContract;
89
92
  onDiagnostics?: (diagnostics: HarnessRunDiagnostics) => void;
@@ -109,6 +112,14 @@ export interface HarnessRunOptions {
109
112
  export interface HarnessTaskRunOptions extends HarnessRunOptions {
110
113
  taskBudgetExisting?: boolean;
111
114
  taskBudgetContinue?: boolean;
115
+ /** Trusted host consent binding, rechecked during durable admission. Never metadata or model input. */
116
+ taskAdmissionReview?: {
117
+ runId: string;
118
+ runRevision: number;
119
+ contractDigest: string;
120
+ snapshotDigest: string | null;
121
+ budgetRevision: number;
122
+ };
112
123
  telemetryTemperature?: 'cold' | 'warm' | 'unknown';
113
124
  onTaskTelemetry?: (telemetry: TaskTelemetrySnapshot) => void;
114
125
  }
@@ -1,4 +1,11 @@
1
1
  import type { AgentRunOutput, AgentStoreScope } from "@zhivex-ai/core";
2
2
  import type { AgentRunStore } from "@zhivex-ai/agents/ops";
3
+ /** Capture the winning source before relaying its abort. Nested AbortSignal.any
4
+ * trees can propagate a different ancestor's reason on supported Node versions. */
5
+ export declare const composeRunInterruption: (caller: AbortSignal | undefined, deadline: AbortSignal | undefined, failure: AbortSignal) => {
6
+ signal: AbortSignal;
7
+ kind: () => "cancelled" | "timed_out" | undefined;
8
+ dispose: () => void;
9
+ };
3
10
  /** Called only after the interrupted runtime has settled and released its lease. */
4
11
  export declare const settleInterruptedRun: (store: AgentRunStore, runId: string, scope?: AgentStoreScope, kind?: 'cancelled' | 'timed_out') => Promise<AgentRunOutput | undefined>;
@@ -0,0 +1,30 @@
1
+ import { type AgentTokenReservation, type LanguageModel } from "@zhivex-ai/core";
2
+ import { Agent, type AgentRunInput } from "@zhivex-ai/agents";
3
+ import type { ZhivexHarness } from "./harness.js";
4
+ export interface HarnessSharedBudgetOptions {
5
+ /** Host-supplied conservative bound for each primary model call. */
6
+ modelReservation: AgentTokenReservation;
7
+ /** Defaults to modelReservation. Must fit the child's narrowed allocation. */
8
+ childModelReservation?: AgentTokenReservation;
9
+ }
10
+ /** Reuse SDK atomic reservations; never create a second token ledger. */
11
+ export declare function withSharedBudget(harness: ZhivexHarness, runId: string, input: AgentRunInput<LanguageModel>, options: HarnessSharedBudgetOptions): Promise<{
12
+ harness: {
13
+ agent: Agent<LanguageModel<import("@zhivex-ai/core").ProviderOptions>, unknown, unknown, unknown>;
14
+ compactionModel?: LanguageModel;
15
+ usageLedger?: import("./usage-ledger.js").UsageLedger;
16
+ config: import("./config.js").HarnessConfig;
17
+ workspace: import("../index.js").Workspace;
18
+ store: import("@zhivex-ai/core").AgentRunStore;
19
+ traceCollector: import("@zhivex-ai/core").AgentTraceCollector;
20
+ capabilities: import("../index.js").HarnessModelCapabilityReport;
21
+ context: import("../index.js").HarnessContextBundle;
22
+ mcpConfiguration: import("../index.js").HarnessMcpConfiguration;
23
+ subagents: import("./orchestration.js").HarnessSubagentRuntime["agents"];
24
+ executionEnvironment?: import("../index.js").HarnessOciExecutionEnvironment;
25
+ persistence?: import("../index.js").HarnessPersistence;
26
+ dispatchLifecycle(event: import("../index.js").HarnessLifecycleEvent): Promise<readonly import("../index.js").HarnessLifecycleHookFailure[]>;
27
+ close(): Promise<void>;
28
+ };
29
+ input: AgentRunInput<LanguageModel>;
30
+ }>;