@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.
- package/CHANGELOG.md +53 -0
- package/README.md +12 -10
- package/SECURITY.md +1 -1
- package/SUPPORT.md +4 -4
- package/contracts/engine-api.json +334 -0
- package/contracts/public-api.json +267 -1
- package/contracts/stable-api-signatures.json +43 -43
- package/dist/acp-cli.js +54 -18
- package/dist/approvals/approval-history.d.ts +22 -0
- package/dist/approvals/explicit-review.d.ts +24 -0
- package/dist/approvals/host-policy-identity.d.ts +3 -0
- package/dist/cli/arguments.d.ts +6 -2
- package/dist/cli/checkpoints.d.ts +230 -0
- package/dist/cli/cli-profiles.d.ts +4 -2
- package/dist/cli/governance-report.d.ts +5 -0
- package/dist/cli/policy-decisions.d.ts +9 -0
- package/dist/cli/policy.d.ts +5 -0
- package/dist/cli/presentation.d.ts +3 -1
- package/dist/cli/terminal/terminal-ui.d.ts +4 -0
- package/dist/{cli-entry-xmf48p6a.js → cli-entry-1gfg3brj.js} +14921 -10692
- package/dist/cli-entry-bx3vjw7h.js +656 -0
- package/dist/{index-fvca1xea.js → cli-entry-d5788aay.js} +339 -58
- package/dist/{cli-qgwvtk0w.js → cli-etsmtst3.js} +918 -2222
- package/dist/cli.js +3 -5
- package/dist/client/acp-mcp-admission.d.ts +32 -0
- package/dist/client/acp-mcp-host.d.ts +19 -0
- package/dist/client/acp-mcp-session.d.ts +14 -0
- package/dist/client/acp-stdio.d.ts +2 -0
- package/dist/client/acp.d.ts +4 -1
- package/dist/client/adapter.d.ts +13 -1
- package/dist/client/json-contracts.d.ts +107 -4
- package/dist/client/local-service.d.ts +2 -0
- package/dist/client/protocol.d.ts +127 -1
- package/dist/client/service-events.d.ts +4 -0
- package/dist/compat/cli-options.d.ts +13 -1
- package/dist/compat/code-support.js +23 -87
- package/dist/{config-q32jm1e6.js → config-c002f06f.js} +1 -1
- package/dist/{config-6gtpxvjv.js → config-j3jga5wh.js} +3 -1
- package/dist/context/adaptive-compaction.d.ts +1 -0
- package/dist/context/compaction.d.ts +1 -1
- package/dist/context/request-measurements.d.ts +17 -0
- package/dist/context/request-projection.d.ts +10 -0
- package/dist/context/task-memory.d.ts +1 -0
- package/dist/engine/acp.d.ts +2 -0
- package/dist/engine/acp.js +197 -1
- package/dist/engine/client.js +11 -4
- package/dist/engine/desktop-providers-v1.d.ts +4 -0
- package/dist/engine/desktop-providers-v1.js +18 -0
- package/dist/engine/desktop-state-v1.d.ts +10 -0
- package/dist/engine/desktop-state-v1.js +168 -0
- package/dist/engine/index.d.ts +12 -0
- package/dist/engine/index.js +571 -71
- package/dist/engine/mcp-stdio-v1.d.ts +11 -0
- package/dist/engine/mcp-stdio-v1.js +108 -0
- package/dist/engine/models.d.ts +3 -0
- package/dist/engine/models.js +894 -0
- package/dist/engine/protocol.d.ts +1 -0
- package/dist/engine/protocol.js +24 -0
- package/dist/engine/service.js +12 -5
- package/dist/execution/acceptance-snapshot.d.ts +2 -0
- package/dist/execution/execution-environment.d.ts +10 -0
- package/dist/execution/mcp-oci-channel.d.ts +11 -0
- package/dist/execution/mcp-oci-server.d.ts +38 -0
- package/dist/execution/mcp-oci-workspace.d.ts +23 -0
- package/dist/execution/mcp-resource-recovery.d.ts +19 -0
- package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
- package/dist/hostile-repository-demo.js +3169 -1163
- package/dist/{index-f4sb0e2q.js → index-2jrdcj6b.js} +17 -2
- package/dist/{index-77h9qr5h.js → index-3ah1f369.js} +40 -10
- package/dist/{index-pgqz45fj.js → index-42gp2hy8.js} +197 -1091
- package/dist/{index-41fkzt91.js → index-4jw3tvy8.js} +10 -2
- package/dist/index-6m08wvab.js +1768 -0
- package/dist/index-8705zxpr.js +145 -0
- package/dist/{index-d0wrghff.js → index-8vm2m34s.js} +225 -1416
- package/dist/index-8zzhggxv.js +477 -0
- package/dist/index-a97bezbz.js +1073 -0
- package/dist/index-azmwjp95.js +1004 -0
- package/dist/{cli-entry-0mmeag20.js → index-gq9xagx2.js} +122 -836
- package/dist/index-h0mqx2ed.js +1373 -0
- package/dist/index-hnaxfpb5.js +5589 -0
- package/dist/{index-2aymdsqc.js → index-qfpz5y2v.js} +24 -0
- package/dist/{index-kfgt9yqq.js → index-w2sj0wkw.js} +33 -10
- package/dist/index-wg1sd3at.js +80 -0
- package/dist/index-xqxeypt5.js +888 -0
- package/dist/index-yb239ghk.js +961 -0
- package/dist/index-z0qxmkm2.js +3389 -0
- package/dist/index.js +85 -72
- package/dist/integrations/mcp-host-session.d.ts +26 -0
- package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
- package/dist/integrations/mcp-stdio-client.d.ts +44 -0
- package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
- package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
- package/dist/integrations/mcp-stdio-session.d.ts +7 -0
- package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
- package/dist/internal/desktop/catalog.d.ts +2 -0
- package/dist/internal/desktop/persistence.d.ts +2 -3
- package/dist/internal/desktop/providers.d.ts +1 -0
- package/dist/models/catalog.d.ts +2 -0
- package/dist/persistence/governance-context.d.ts +126 -0
- package/dist/persistence/governance-report.d.ts +299 -0
- package/dist/persistence/host-database-backup.d.ts +28 -0
- package/dist/persistence/mcp-execution-journal.d.ts +19 -0
- package/dist/persistence/mcp-reconciliation.d.ts +33 -0
- package/dist/persistence/mcp-resource-journal.d.ts +54 -0
- package/dist/persistence/workspace-checkpoints.d.ts +138 -0
- package/dist/providers/anthropic-continuation.d.ts +5 -0
- package/dist/providers/providers.d.ts +1 -1
- package/dist/providers/vertex-auth.d.ts +27 -0
- package/dist/runtime/delegation-contracts.d.ts +9 -0
- package/dist/runtime/delegation-correction.d.ts +9 -0
- package/dist/runtime/delegation-result.d.ts +73 -0
- package/dist/runtime/error-diagnostics.d.ts +86 -0
- package/dist/runtime/harness.d.ts +11 -1
- package/dist/runtime/policy-decisions.d.ts +66 -0
- package/dist/runtime/policy-inspection.d.ts +52 -0
- package/dist/runtime/provider-diagnostics.d.ts +1 -0
- package/dist/runtime/runtime-instructions.d.ts +8 -0
- package/dist/runtime/task-acceptance-checks.d.ts +103 -0
- package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
- package/dist/runtime/task-acceptance-host.d.ts +20 -0
- package/dist/runtime/task-acceptance-record.d.ts +107 -0
- package/dist/runtime/task-acceptance-validation.d.ts +25 -0
- package/dist/runtime/task-acceptance.d.ts +47 -0
- package/dist/runtime/time-to-safe-fix.d.ts +83 -0
- package/dist/runtime/tool-policy-file.d.ts +23 -0
- package/dist/runtime/tool-policy-paths.d.ts +5 -0
- package/dist/runtime/tool-policy.d.ts +6 -0
- package/dist/service-cli.js +14 -7
- package/dist/{service-client-cli-gs78wrxe.js → service-client-cli-3365rfav.js} +307 -248
- package/dist/verify-historical-migrations.js +3134 -1129
- package/dist/workspace/path-policy.d.ts +4 -0
- package/dist/zhx.js +3 -5
- package/docs/ACP.md +14 -2
- package/docs/ANTHROPIC.md +33 -0
- package/docs/CLI.md +132 -0
- package/docs/CLIENT_PROTOCOL.md +45 -0
- package/docs/CODE_RELEASE.md +35 -18
- package/docs/ENGINE_API.md +216 -7
- package/docs/EXTENSIBILITY.md +46 -3
- package/docs/FIRST_USE.md +6 -6
- package/docs/LOCAL_SERVICE.md +13 -0
- package/docs/MCP_STDIO.md +20 -0
- package/docs/README.md +1 -0
- package/docs/STABILITY.md +4 -2
- package/docs/SUPPORT_MATRIX.md +1 -1
- package/docs/TOOL_POLICY.md +81 -0
- package/docs/VERTEX.md +50 -0
- package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
- package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
- package/docs/support-matrix.json +2 -0
- package/evaluations/representative-assembly-matrix.json +46 -1
- package/evaluations/task-acceptance-routes.json +7 -0
- package/examples/README.md +3 -3
- package/package.json +43 -12
- package/dist/cli-entry-64pdp3k5.js +0 -17
- package/dist/cli-entry-7h9savv5.js +0 -375
- package/dist/index-5wjwe91x.js +0 -9434
package/dist/index.js
CHANGED
|
@@ -6,13 +6,11 @@ import {
|
|
|
6
6
|
resolveTerminalApprovals,
|
|
7
7
|
sanitizeTerminalText,
|
|
8
8
|
terminalSupportsColor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-4jw3tvy8.js";
|
|
10
10
|
import {
|
|
11
11
|
CHANGE_ENVELOPE_DIGEST_ALGORITHM,
|
|
12
12
|
CHANGE_ENVELOPE_SCHEMA_VERSION,
|
|
13
13
|
DEFAULT_TIME_TO_SAFE_FIX_GOAL,
|
|
14
|
-
HARNESS_STATE_BACKUP_MAX_BYTES,
|
|
15
|
-
HARNESS_STATE_BACKUP_SCHEMA_VERSION,
|
|
16
14
|
MAX_CHANGE_ENVELOPE_APPROVALS,
|
|
17
15
|
MAX_CHANGE_ENVELOPE_APPROVAL_SCOPES,
|
|
18
16
|
MAX_CHANGE_ENVELOPE_ATTESTATIONS,
|
|
@@ -60,28 +58,31 @@ import {
|
|
|
60
58
|
computeChangeEnvelopeDigest,
|
|
61
59
|
computeChangeEnvelopeEvidenceDigest,
|
|
62
60
|
createChangeEnvelope,
|
|
63
|
-
createHarnessStateBackup,
|
|
64
61
|
createTimeToSafeFixCases,
|
|
65
62
|
createTimeToSafeFixReport,
|
|
66
63
|
createTimeToSafeFixSample,
|
|
67
64
|
digestChangeEnvelopeArtifact,
|
|
68
|
-
exportHarnessStateBackup,
|
|
69
65
|
externalAttestationReferenceSchema,
|
|
70
|
-
importHarnessStateBackup,
|
|
71
|
-
importHarnessStateBackupFile,
|
|
72
66
|
injectTimeToSafeFixAttack,
|
|
73
|
-
inspectHarnessState,
|
|
74
|
-
openWorkspaceCheckpointStore,
|
|
75
67
|
parseCliJsonDocument,
|
|
76
68
|
parseCliJsonLineDocument,
|
|
77
|
-
readHarnessStateBackup,
|
|
78
69
|
recommendCompactionModels,
|
|
79
|
-
stateBackupBundleSchema,
|
|
80
70
|
timeToSafeFixDriverResultSchema,
|
|
81
71
|
timeToSafeFixLatencyStatistics,
|
|
82
72
|
timeToSafeFixTaskSchema,
|
|
83
73
|
verifyChangeEnvelope
|
|
84
|
-
} from "./index-
|
|
74
|
+
} from "./index-8vm2m34s.js";
|
|
75
|
+
import {
|
|
76
|
+
HARNESS_STATE_BACKUP_MAX_BYTES,
|
|
77
|
+
HARNESS_STATE_BACKUP_SCHEMA_VERSION,
|
|
78
|
+
createHarnessStateBackup,
|
|
79
|
+
exportHarnessStateBackup,
|
|
80
|
+
importHarnessStateBackup,
|
|
81
|
+
importHarnessStateBackupFile,
|
|
82
|
+
inspectHarnessState,
|
|
83
|
+
readHarnessStateBackup,
|
|
84
|
+
stateBackupBundleSchema
|
|
85
|
+
} from "./index-a97bezbz.js";
|
|
85
86
|
import {
|
|
86
87
|
CLI_COMMAND_OPTION_CONTRACTS,
|
|
87
88
|
CLI_OPTION_DEFINITIONS,
|
|
@@ -91,7 +92,7 @@ import {
|
|
|
91
92
|
resolveHarnessModelRoutes,
|
|
92
93
|
serializeHarnessModelRoutes,
|
|
93
94
|
validateCliCommandOptions
|
|
94
|
-
} from "./index-
|
|
95
|
+
} from "./index-2jrdcj6b.js";
|
|
95
96
|
import {
|
|
96
97
|
harnessLocalCredentialsSchema,
|
|
97
98
|
openHarnessActivityStore,
|
|
@@ -99,99 +100,67 @@ import {
|
|
|
99
100
|
recoverHarnessLocalService,
|
|
100
101
|
requestHarnessLocalService,
|
|
101
102
|
startHarnessLocalService
|
|
102
|
-
} from "./index-
|
|
103
|
+
} from "./index-w2sj0wkw.js";
|
|
104
|
+
import {
|
|
105
|
+
createAcpConnection,
|
|
106
|
+
serveAcpStdio
|
|
107
|
+
} from "./index-3ah1f369.js";
|
|
103
108
|
import {
|
|
104
|
-
BUN_ENGINE_RANGE,
|
|
105
|
-
CliOciRuntimeAdapter,
|
|
106
109
|
DEFAULT_HARNESS_CONTEXT_MANIFEST,
|
|
107
110
|
DEFAULT_HARNESS_PROJECT_INSTRUCTIONS,
|
|
108
|
-
EDIT_CONTRACT_SCHEMA_VERSION,
|
|
109
|
-
EDIT_DIGEST_ALGORITHM,
|
|
110
111
|
HARNESS_CONTEXT_BUNDLE_SCHEMA_VERSION,
|
|
111
112
|
HARNESS_CONTEXT_CONFIG_SCHEMA_VERSION,
|
|
112
|
-
HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
|
|
113
113
|
HARNESS_INSTRUCTIONS,
|
|
114
114
|
HARNESS_LIFECYCLE_EVENTS,
|
|
115
|
-
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
116
|
-
HARNESS_MCP_PERMISSIONS,
|
|
117
|
-
HARNESS_OCI_LABEL,
|
|
118
|
-
HARNESS_OCI_LABEL_VALUE,
|
|
119
|
-
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
120
|
-
HARNESS_SQLITE_FILE,
|
|
121
115
|
HARNESS_SUBAGENT_PROFILE_DESCRIPTORS,
|
|
122
|
-
HARNESS_VERSION,
|
|
123
|
-
MAX_EDIT_CHANGES,
|
|
124
|
-
MAX_EDIT_FILE_BYTES,
|
|
125
|
-
MAX_EDIT_PROPOSAL_BYTES,
|
|
126
116
|
MAX_HARNESS_CONTEXT_FILES,
|
|
127
117
|
MAX_HARNESS_CONTEXT_FILE_BYTES,
|
|
128
118
|
MAX_HARNESS_CONTEXT_TOTAL_BYTES,
|
|
129
119
|
MAX_HARNESS_SKILLS,
|
|
130
120
|
MAX_HARNESS_SKILL_DIRECTORIES,
|
|
131
121
|
MAX_HARNESS_SKILL_FILE_BYTES,
|
|
132
|
-
NODE_ENGINE_RANGE,
|
|
133
122
|
SEMANTIC_COMPACTION_VERSION,
|
|
134
|
-
TERMINAL_RUN_STATUSES,
|
|
135
|
-
Workspace,
|
|
136
123
|
appendUserMessage,
|
|
137
|
-
applyEditProposalInputSchema,
|
|
138
124
|
applyHarnessToolPolicy,
|
|
139
125
|
assertHarnessModelCapabilities,
|
|
140
|
-
cancelHarnessRun,
|
|
141
|
-
cleanupHarnessExecutionArtifacts,
|
|
142
|
-
cleanupHarnessRuns,
|
|
143
126
|
compactHarnessMessages,
|
|
144
|
-
createEditProposal,
|
|
145
127
|
createEmptyHarnessContextBundle,
|
|
146
128
|
createExecutionEnvironmentTools,
|
|
147
129
|
createHarness,
|
|
148
130
|
createHarnessClientAdapter,
|
|
149
131
|
createHarnessLifecycleDispatcher,
|
|
150
|
-
createHarnessMcpTools,
|
|
151
|
-
createHarnessOciExecutionEnvironment,
|
|
152
132
|
createHarnessSubagents,
|
|
153
133
|
createHarnessToolPolicy,
|
|
154
|
-
createHttpMcpClient,
|
|
155
134
|
createProgressMonitor,
|
|
156
135
|
createSemanticCompactor,
|
|
157
|
-
describeOciCommand,
|
|
158
|
-
editChangeSchema,
|
|
159
|
-
editChangesSchema,
|
|
160
|
-
editContractDocument,
|
|
161
|
-
editProposalChangeSchema,
|
|
162
|
-
editProposalInputSchema,
|
|
163
|
-
editProposalSchema,
|
|
164
136
|
estimateMessageTokens,
|
|
165
|
-
executionFingerprintInput,
|
|
166
|
-
fileDigestSchema,
|
|
167
137
|
harnessContextConfigurationSchema,
|
|
168
138
|
harnessContextFingerprintInput,
|
|
169
|
-
harnessExecutionSession,
|
|
170
139
|
harnessLifecycleFingerprintInput,
|
|
171
140
|
harnessSkillLoadInputSchema,
|
|
172
141
|
harnessToolPolicySchema,
|
|
173
142
|
inspectHarnessModelCapabilities,
|
|
174
|
-
inspectHarnessRun,
|
|
175
143
|
isHarnessContextDigest,
|
|
176
|
-
listHarnessRuns,
|
|
177
|
-
loadHarnessMcpConfiguration,
|
|
178
144
|
loadHarnessProjectContext,
|
|
179
145
|
loadHarnessSkill,
|
|
180
|
-
migrateLegacyFileRuns,
|
|
181
|
-
moveFileInputSchema,
|
|
182
|
-
mutationAuditEntrySchema,
|
|
183
|
-
mutationOperationSchema,
|
|
184
|
-
normalizeHarnessMcpConfiguration,
|
|
185
|
-
openHarnessPersistence,
|
|
186
|
-
quarantineFileInputSchema,
|
|
187
146
|
renderHarnessContextInstructions,
|
|
188
|
-
restoreFileInputSchema,
|
|
189
147
|
runHarness,
|
|
190
148
|
runHarnessReviewGroup,
|
|
191
|
-
selectHarnessModel
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
149
|
+
selectHarnessModel
|
|
150
|
+
} from "./index-hnaxfpb5.js";
|
|
151
|
+
import {
|
|
152
|
+
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
153
|
+
HARNESS_SQLITE_FILE,
|
|
154
|
+
TERMINAL_RUN_STATUSES,
|
|
155
|
+
cancelHarnessRun,
|
|
156
|
+
cleanupHarnessRuns,
|
|
157
|
+
inspectHarnessRun,
|
|
158
|
+
listHarnessRuns,
|
|
159
|
+
migrateLegacyFileRuns,
|
|
160
|
+
openHarnessPersistence,
|
|
161
|
+
openWorkspaceCheckpointStore
|
|
162
|
+
} from "./index-h0mqx2ed.js";
|
|
163
|
+
import"./index-8zzhggxv.js";
|
|
195
164
|
import {
|
|
196
165
|
HARNESS_SESSION_INDEX_FILE,
|
|
197
166
|
HARNESS_SESSION_SCHEMA_VERSION,
|
|
@@ -200,7 +169,53 @@ import {
|
|
|
200
169
|
openCliSessionStore,
|
|
201
170
|
openSessionStore,
|
|
202
171
|
validateStateDirectory
|
|
203
|
-
} from "./index-
|
|
172
|
+
} from "./index-42gp2hy8.js";
|
|
173
|
+
import {
|
|
174
|
+
BUN_ENGINE_RANGE,
|
|
175
|
+
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
176
|
+
HARNESS_MCP_PERMISSIONS,
|
|
177
|
+
HARNESS_VERSION,
|
|
178
|
+
NODE_ENGINE_RANGE,
|
|
179
|
+
createHarnessMcpTools,
|
|
180
|
+
createHttpMcpClient,
|
|
181
|
+
loadHarnessMcpConfiguration,
|
|
182
|
+
normalizeHarnessMcpConfiguration
|
|
183
|
+
} from "./index-azmwjp95.js";
|
|
184
|
+
import {
|
|
185
|
+
CliOciRuntimeAdapter,
|
|
186
|
+
HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
|
|
187
|
+
HARNESS_OCI_LABEL,
|
|
188
|
+
HARNESS_OCI_LABEL_VALUE,
|
|
189
|
+
Workspace,
|
|
190
|
+
cleanupHarnessExecutionArtifacts,
|
|
191
|
+
createHarnessOciExecutionEnvironment,
|
|
192
|
+
describeOciCommand,
|
|
193
|
+
executionFingerprintInput,
|
|
194
|
+
harnessExecutionSession
|
|
195
|
+
} from "./index-z0qxmkm2.js";
|
|
196
|
+
import {
|
|
197
|
+
EDIT_CONTRACT_SCHEMA_VERSION,
|
|
198
|
+
EDIT_DIGEST_ALGORITHM,
|
|
199
|
+
MAX_EDIT_CHANGES,
|
|
200
|
+
MAX_EDIT_FILE_BYTES,
|
|
201
|
+
MAX_EDIT_PROPOSAL_BYTES,
|
|
202
|
+
applyEditProposalInputSchema,
|
|
203
|
+
createEditProposal,
|
|
204
|
+
editChangeSchema,
|
|
205
|
+
editChangesSchema,
|
|
206
|
+
editContractDocument,
|
|
207
|
+
editProposalChangeSchema,
|
|
208
|
+
editProposalInputSchema,
|
|
209
|
+
editProposalSchema,
|
|
210
|
+
fileDigestSchema,
|
|
211
|
+
moveFileInputSchema,
|
|
212
|
+
mutationAuditEntrySchema,
|
|
213
|
+
mutationOperationSchema,
|
|
214
|
+
quarantineFileInputSchema,
|
|
215
|
+
restoreFileInputSchema,
|
|
216
|
+
validateEditProposal,
|
|
217
|
+
workspaceFilePathSchema
|
|
218
|
+
} from "./index-yb239ghk.js";
|
|
204
219
|
import {
|
|
205
220
|
BUILTIN_PROVIDER_REGISTRATIONS,
|
|
206
221
|
DEFAULT_ALLOWED_CHECKS,
|
|
@@ -236,7 +251,9 @@ import {
|
|
|
236
251
|
providerAvailability,
|
|
237
252
|
providerDescriptor,
|
|
238
253
|
resolveHarnessConfig
|
|
239
|
-
} from "./index-
|
|
254
|
+
} from "./index-gq9xagx2.js";
|
|
255
|
+
import"./index-8705zxpr.js";
|
|
256
|
+
import"./index-xqxeypt5.js";
|
|
240
257
|
import {
|
|
241
258
|
CLI_EVENT_SCHEMA_VERSION,
|
|
242
259
|
CLI_JSON_SCHEMA_VERSION,
|
|
@@ -247,11 +264,7 @@ import {
|
|
|
247
264
|
serializeStreamResult,
|
|
248
265
|
streamEventDocument,
|
|
249
266
|
streamResultDocument
|
|
250
|
-
} from "./index-
|
|
251
|
-
import {
|
|
252
|
-
createAcpConnection,
|
|
253
|
-
serveAcpStdio
|
|
254
|
-
} from "./index-77h9qr5h.js";
|
|
267
|
+
} from "./index-qfpz5y2v.js";
|
|
255
268
|
import"./index-1bx83sw4.js";
|
|
256
269
|
export {
|
|
257
270
|
BUILTIN_PROVIDER_REGISTRATIONS,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AgentRunStore, AgentStoreScope, ToolSet } from '@zhivex-ai/core';
|
|
2
|
+
import type { McpStdioLaunchProposal } from './mcp-stdio-admission.js';
|
|
3
|
+
/** Opaque capability issued only after the host's admitted OCI launch succeeds. */
|
|
4
|
+
export type HarnessIsolatedMcpSession = Readonly<Record<never, never>>;
|
|
5
|
+
/** Internal issuer; this module is not a package entry point. */
|
|
6
|
+
export declare function issueMcpHostSession(options: {
|
|
7
|
+
tools: ToolSet;
|
|
8
|
+
store: AgentRunStore;
|
|
9
|
+
scope: AgentStoreScope;
|
|
10
|
+
runId: string;
|
|
11
|
+
proposal: Readonly<McpStdioLaunchProposal>;
|
|
12
|
+
close(): Promise<void>;
|
|
13
|
+
}): HarnessIsolatedMcpSession;
|
|
14
|
+
export declare function resolveMcpHostSession(token: HarnessIsolatedMcpSession): {
|
|
15
|
+
tools: ToolSet;
|
|
16
|
+
store: AgentRunStore;
|
|
17
|
+
scope: AgentStoreScope;
|
|
18
|
+
runId: string;
|
|
19
|
+
workspace: string;
|
|
20
|
+
fingerprint: string;
|
|
21
|
+
close(): Promise<void>;
|
|
22
|
+
active: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare function closeMcpHostSession(token: HarnessIsolatedMcpSession): Promise<void>;
|
|
25
|
+
/** Internal composition of already admitted sessions; never accepts raw tools. */
|
|
26
|
+
export declare function combineMcpHostSessions(tokens: readonly HarnessIsolatedMcpSession[]): HarnessIsolatedMcpSession;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
declare const proposalSchema: z.ZodObject<{
|
|
3
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
4
|
+
serverId: z.ZodString;
|
|
5
|
+
boundary: z.ZodLiteral<"oci">;
|
|
6
|
+
image: z.ZodString;
|
|
7
|
+
executable: z.ZodString;
|
|
8
|
+
args: z.ZodArray<z.ZodString>;
|
|
9
|
+
protocolVersion: z.ZodLiteral<"2025-11-25">;
|
|
10
|
+
workingDirectory: z.ZodString;
|
|
11
|
+
snapshotDigest: z.ZodString;
|
|
12
|
+
scope: z.ZodObject<{
|
|
13
|
+
principal: z.ZodString;
|
|
14
|
+
tenant: z.ZodString;
|
|
15
|
+
session: z.ZodString;
|
|
16
|
+
workspace: z.ZodString;
|
|
17
|
+
}, z.core.$strict>;
|
|
18
|
+
includeTools: z.ZodArray<z.ZodString>;
|
|
19
|
+
permissions: z.ZodArray<z.ZodEnum<{
|
|
20
|
+
read: "read";
|
|
21
|
+
write: "write";
|
|
22
|
+
}>>;
|
|
23
|
+
environment: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
24
|
+
secretReferences: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
25
|
+
limits: z.ZodObject<{
|
|
26
|
+
sessionMs: z.ZodNumber;
|
|
27
|
+
callMs: z.ZodNumber;
|
|
28
|
+
memoryMb: z.ZodNumber;
|
|
29
|
+
maxCpus: z.ZodNumber;
|
|
30
|
+
maxPids: z.ZodNumber;
|
|
31
|
+
maxWorkspaceBytes: z.ZodNumber;
|
|
32
|
+
maxFileWriteBytes: z.ZodNumber;
|
|
33
|
+
tmpfsMb: z.ZodNumber;
|
|
34
|
+
maxOutputBytes: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type McpStdioLaunchProposal = z.infer<typeof proposalSchema>;
|
|
38
|
+
export type McpStdioLaunchReceipt = Readonly<Record<never, never>>;
|
|
39
|
+
export declare class McpStdioAdmissionError extends Error {
|
|
40
|
+
constructor(message: string);
|
|
41
|
+
}
|
|
42
|
+
/** Owned by the trusted host, never constructed from client/workspace configuration. */
|
|
43
|
+
export declare function createMcpStdioAdmissionAuthority(options: {
|
|
44
|
+
policyVersion: string;
|
|
45
|
+
maximumLimits: McpStdioLaunchProposal['limits'];
|
|
46
|
+
authorize: (proposal: Readonly<McpStdioLaunchProposal>) => Promise<boolean>;
|
|
47
|
+
receiptTtlMs?: number;
|
|
48
|
+
reviewTimeoutMs?: number;
|
|
49
|
+
now?: () => number;
|
|
50
|
+
}): {
|
|
51
|
+
admit(input: unknown): Promise<McpStdioLaunchReceipt>;
|
|
52
|
+
consume(receipt: McpStdioLaunchReceipt, input: unknown): Readonly<McpStdioLaunchProposal>;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { McpCallToolOptions, McpCallToolRequest, McpCallToolResponse, McpClient, McpListToolsRequest, McpListToolsResponse } from '@zhivex-ai/core';
|
|
2
|
+
/** Supplied only by the admitted isolated-process owner. No executable or spawn API. */
|
|
3
|
+
export interface IsolatedMcpChannel {
|
|
4
|
+
stdout: AsyncIterable<Uint8Array>;
|
|
5
|
+
write(frame: Uint8Array): Promise<void>;
|
|
6
|
+
/** Resolves only after the entire boundary/process tree has been removed. */
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare class McpStdioClientError extends Error {
|
|
10
|
+
readonly code: 'closed' | 'busy' | 'timeout' | 'cancelled' | 'protocol' | 'remote' | 'cleanup_required';
|
|
11
|
+
readonly outcomeUnknown: boolean;
|
|
12
|
+
constructor(code: 'closed' | 'busy' | 'timeout' | 'cancelled' | 'protocol' | 'remote' | 'cleanup_required', message: string, outcomeUnknown?: boolean);
|
|
13
|
+
}
|
|
14
|
+
/** Internal protocol client. Admission, isolated launch and per-tool approval belong to the host. */
|
|
15
|
+
export declare class IsolatedMcpStdioClient implements McpClient {
|
|
16
|
+
private readonly channel;
|
|
17
|
+
private readonly limits;
|
|
18
|
+
private nextId;
|
|
19
|
+
private pending;
|
|
20
|
+
private stopped;
|
|
21
|
+
private ready;
|
|
22
|
+
private initializing;
|
|
23
|
+
private closing;
|
|
24
|
+
private readonly decoder;
|
|
25
|
+
private readonly reading;
|
|
26
|
+
constructor(channel: IsolatedMcpChannel, limits: {
|
|
27
|
+
callMs: number;
|
|
28
|
+
initializeMs: number;
|
|
29
|
+
sessionMs: number;
|
|
30
|
+
maxFrameBytes: number;
|
|
31
|
+
closeMs?: number;
|
|
32
|
+
});
|
|
33
|
+
private readonly sessionTimer;
|
|
34
|
+
private receive;
|
|
35
|
+
private read;
|
|
36
|
+
private fail;
|
|
37
|
+
private request;
|
|
38
|
+
initialize(): Promise<void>;
|
|
39
|
+
private initializeInternal;
|
|
40
|
+
listTools(input?: McpListToolsRequest, options?: McpCallToolOptions): Promise<McpListToolsResponse>;
|
|
41
|
+
callTool(input: McpCallToolRequest, options?: McpCallToolOptions): Promise<McpCallToolResponse>;
|
|
42
|
+
private boundedCleanup;
|
|
43
|
+
close(): Promise<void>;
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Internal codec only. It does not spawn processes, admit servers or grant tools. */
|
|
2
|
+
export type McpStdioMessage = Record<string, unknown> & {
|
|
3
|
+
jsonrpc: '2.0';
|
|
4
|
+
};
|
|
5
|
+
export declare class McpStdioProtocolError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
8
|
+
/** Byte limits apply before UTF-8 decoding, including an unfinished line. */
|
|
9
|
+
export declare class McpStdioFrameDecoder {
|
|
10
|
+
private readonly maxFrameBytes;
|
|
11
|
+
private readonly onMessage;
|
|
12
|
+
private readonly frame;
|
|
13
|
+
private size;
|
|
14
|
+
private ended;
|
|
15
|
+
constructor(maxFrameBytes: number, onMessage: (message: McpStdioMessage) => void);
|
|
16
|
+
push(chunk: Uint8Array): void;
|
|
17
|
+
finish(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { consumeMcpWorkspaceSnapshot, type McpWorkspaceSnapshot } from '../execution/mcp-workspace-snapshot.js';
|
|
2
|
+
import { type createMcpStdioAdmissionAuthority, type McpStdioLaunchProposal, type McpStdioLaunchReceipt } from './mcp-stdio-admission.js';
|
|
3
|
+
type Authority = ReturnType<typeof createMcpStdioAdmissionAuthority>;
|
|
4
|
+
type SnapshotFiles = Parameters<Parameters<typeof consumeMcpWorkspaceSnapshot>[2]>[0];
|
|
5
|
+
/** Trusted host handoff only. The seeder owns creation, OCI attestation and cleanup. */
|
|
6
|
+
export declare function withAdmittedMcpLaunch<T>(options: {
|
|
7
|
+
authority: Authority;
|
|
8
|
+
receipt: McpStdioLaunchReceipt;
|
|
9
|
+
proposal: unknown;
|
|
10
|
+
snapshot: McpWorkspaceSnapshot;
|
|
11
|
+
/** Supplied by the authenticated host session, never copied from proposal input. */
|
|
12
|
+
scope: McpStdioLaunchProposal['scope'];
|
|
13
|
+
resolveSecret: (reference: string, signal: AbortSignal) => Promise<string | undefined>;
|
|
14
|
+
seed: (launch: {
|
|
15
|
+
proposal: Readonly<McpStdioLaunchProposal>;
|
|
16
|
+
environment: Readonly<Record<string, string>>;
|
|
17
|
+
files: SnapshotFiles;
|
|
18
|
+
}) => Promise<T>;
|
|
19
|
+
}): Promise<T>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { launchDockerMcpTools } from '../execution/mcp-oci-server.js';
|
|
2
|
+
export type IsolatedMcpLaunchOptions = Omit<Parameters<typeof launchDockerMcpTools>[0], 'resourceJournal'>;
|
|
3
|
+
/** Returns only the opaque harness capability and lifecycle control, not raw tools. */
|
|
4
|
+
export declare function launchIsolatedMcpSession(options: IsolatedMcpLaunchOptions): Promise<Readonly<{
|
|
5
|
+
hostSession: Readonly<Record<never, never>>;
|
|
6
|
+
close: () => Promise<void>;
|
|
7
|
+
}>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type McpClient, type ToolSet } from '@zhivex-ai/core';
|
|
2
|
+
import type { McpStdioLaunchProposal } from './mcp-stdio-admission.js';
|
|
3
|
+
import { createJournaledMcpClient } from '../persistence/mcp-execution-journal.js';
|
|
4
|
+
/** Host tool bridge. Existing agent execution supplies durable interrupt approvals. */
|
|
5
|
+
export declare function createIsolatedMcpTools(options: {
|
|
6
|
+
client: McpClient & {
|
|
7
|
+
close(): Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
proposal: Readonly<McpStdioLaunchProposal>;
|
|
10
|
+
sensitiveValues?: readonly string[];
|
|
11
|
+
journal?: Pick<Parameters<typeof createJournaledMcpClient>[0], 'store' | 'runId' | 'scope'>;
|
|
12
|
+
}): Promise<ToolSet>;
|
|
@@ -8,7 +8,6 @@ export { acquireSqliteAccess } from "../../persistence/sqlite-access.js";
|
|
|
8
8
|
export { adoptExclusiveSqliteAccess } from "../../persistence/sqlite-access.js";
|
|
9
9
|
export { exclusiveSqliteAccessDescriptor } from "../../persistence/sqlite-access.js";
|
|
10
10
|
export type { SqliteAccessLease } from "../../persistence/sqlite-access.js";
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export { createHarnessStateBackup } from "../../persistence/state-backup.js";
|
|
11
|
+
export { DESKTOP_DATABASE_BACKUP_LIMIT, createDesktopDatabaseBackup, verifyDesktopDatabaseBackup, verifyDesktopDatabaseState } from "../../persistence/host-database-backup.js";
|
|
12
|
+
export type { DesktopDatabaseBackup, DesktopBackupConfig } from "../../persistence/host-database-backup.js";
|
|
14
13
|
export { validateStateDirectory } from "../../persistence/state-directory.js";
|
|
@@ -4,6 +4,7 @@ export type { HarnessConfig } from "../../runtime/config.js";
|
|
|
4
4
|
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
|
+
export { vertexConfigured, vertexEnvironment, vertexTokenSource, vertexRoute } from "../../providers/vertex-auth.js";
|
|
7
8
|
export { bundledModelCatalog, catalogModels, modelDescription } from "../../models/catalog.js";
|
|
8
9
|
export type { CatalogModel, ModelCatalog } from "../../models/catalog.js";
|
|
9
10
|
export { loadModelCatalog } from "../../models/catalog-store.js";
|
package/dist/models/catalog.d.ts
CHANGED
|
@@ -69,10 +69,12 @@ export declare const modelCatalogSchema: z.ZodObject<{
|
|
|
69
69
|
revision: z.ZodString;
|
|
70
70
|
providers: z.ZodArray<z.ZodObject<{
|
|
71
71
|
id: z.ZodEnum<{
|
|
72
|
+
anthropic: "anthropic";
|
|
72
73
|
gemini: "gemini";
|
|
73
74
|
meta: "meta";
|
|
74
75
|
openai: "openai";
|
|
75
76
|
qwen: "qwen";
|
|
77
|
+
vertex: "vertex";
|
|
76
78
|
}>;
|
|
77
79
|
defaultModel: z.ZodString;
|
|
78
80
|
models: z.ZodArray<z.ZodObject<{
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { CliSessionStore } from './sessions.js';
|
|
3
|
+
export declare const governanceReference: (kind: string, value: string) => string;
|
|
4
|
+
export declare const governanceSessionSchema: z.ZodObject<{
|
|
5
|
+
availability: z.ZodEnum<{
|
|
6
|
+
recorded: "recorded";
|
|
7
|
+
unavailable: "unavailable";
|
|
8
|
+
}>;
|
|
9
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
10
|
+
revision: z.ZodNullable<z.ZodNumber>;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
export declare const governanceHistorySchema: z.ZodObject<{
|
|
13
|
+
availability: z.ZodEnum<{
|
|
14
|
+
recorded: "recorded";
|
|
15
|
+
unavailable: "unavailable";
|
|
16
|
+
}>;
|
|
17
|
+
retention: z.ZodEnum<{
|
|
18
|
+
expired: "expired";
|
|
19
|
+
retained: "retained";
|
|
20
|
+
unknown: "unknown";
|
|
21
|
+
}>;
|
|
22
|
+
incomplete: z.ZodBoolean;
|
|
23
|
+
policyDecisions: z.ZodArray<z.ZodObject<{
|
|
24
|
+
runReference: z.ZodString;
|
|
25
|
+
sequence: z.ZodNumber;
|
|
26
|
+
toolReference: z.ZodString;
|
|
27
|
+
phase: z.ZodEnum<{
|
|
28
|
+
"approval-request": "approval-request";
|
|
29
|
+
"tool-entry": "tool-entry";
|
|
30
|
+
}>;
|
|
31
|
+
decision: z.ZodEnum<{
|
|
32
|
+
allow: "allow";
|
|
33
|
+
ask_user: "ask_user";
|
|
34
|
+
deny: "deny";
|
|
35
|
+
}>;
|
|
36
|
+
policyDigest: z.ZodNullable<z.ZodString>;
|
|
37
|
+
source: z.ZodEnum<{
|
|
38
|
+
application: "application";
|
|
39
|
+
baseline: "baseline";
|
|
40
|
+
"operator-file": "operator-file";
|
|
41
|
+
}>;
|
|
42
|
+
ruleReferences: z.ZodArray<z.ZodString>;
|
|
43
|
+
explicitReviewRequired: z.ZodBoolean;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
export declare const governanceEnvelopeSchema: z.ZodObject<{
|
|
47
|
+
source: z.ZodLiteral<"caller-supplied">;
|
|
48
|
+
envelopeId: z.ZodNullable<z.ZodString>;
|
|
49
|
+
patchReference: z.ZodNullable<z.ZodString>;
|
|
50
|
+
patchDigest: z.ZodNullable<z.ZodString>;
|
|
51
|
+
linkedRunReferences: z.ZodArray<z.ZodString>;
|
|
52
|
+
schemaValid: z.ZodBoolean;
|
|
53
|
+
integrity: z.ZodEnum<{
|
|
54
|
+
invalid: "invalid";
|
|
55
|
+
valid: "valid";
|
|
56
|
+
}>;
|
|
57
|
+
expiration: z.ZodEnum<{
|
|
58
|
+
current: "current";
|
|
59
|
+
expired: "expired";
|
|
60
|
+
"not-yet-valid": "not-yet-valid";
|
|
61
|
+
unknown: "unknown";
|
|
62
|
+
}>;
|
|
63
|
+
checkedAt: z.ZodISODateTime;
|
|
64
|
+
expiredApprovals: z.ZodNumber;
|
|
65
|
+
authenticity: z.ZodLiteral<"not-verified">;
|
|
66
|
+
patchBytes: z.ZodLiteral<"not-verified">;
|
|
67
|
+
}, z.core.$strict>;
|
|
68
|
+
/** Both readers must already be bound to the same workspace and scope as the run store. */
|
|
69
|
+
export interface GovernanceSessionSource {
|
|
70
|
+
id: string;
|
|
71
|
+
index: Pick<CliSessionStore, 'get'>;
|
|
72
|
+
history?: {
|
|
73
|
+
replay(sessionId: string, after?: number): {
|
|
74
|
+
schemaVersion: 1;
|
|
75
|
+
cursorExpired: boolean;
|
|
76
|
+
hasMore?: boolean;
|
|
77
|
+
policyEvidenceIncomplete?: boolean;
|
|
78
|
+
nextCursor: number;
|
|
79
|
+
events: Array<{
|
|
80
|
+
sessionId: string;
|
|
81
|
+
runId: string;
|
|
82
|
+
sequence: number;
|
|
83
|
+
activity: Record<string, unknown>;
|
|
84
|
+
}>;
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export declare function readGovernanceSession(source: GovernanceSessionSource | undefined, rootRunId: string, runIds: ReadonlySet<string>): Promise<{
|
|
89
|
+
session: {
|
|
90
|
+
availability: "recorded" | "unavailable";
|
|
91
|
+
reference: string | null;
|
|
92
|
+
revision: number | null;
|
|
93
|
+
};
|
|
94
|
+
history: {
|
|
95
|
+
availability: "recorded" | "unavailable";
|
|
96
|
+
retention: "expired" | "retained" | "unknown";
|
|
97
|
+
incomplete: boolean;
|
|
98
|
+
policyDecisions: {
|
|
99
|
+
runReference: string;
|
|
100
|
+
sequence: number;
|
|
101
|
+
toolReference: string;
|
|
102
|
+
phase: "approval-request" | "tool-entry";
|
|
103
|
+
decision: "allow" | "ask_user" | "deny";
|
|
104
|
+
policyDigest: string | null;
|
|
105
|
+
source: "application" | "baseline" | "operator-file";
|
|
106
|
+
ruleReferences: string[];
|
|
107
|
+
explicitReviewRequired: boolean;
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
110
|
+
verify: () => Promise<void>;
|
|
111
|
+
}>;
|
|
112
|
+
/** Envelopes are references supplied by the caller, never inferred signatures or executed checks. */
|
|
113
|
+
export declare function projectGovernanceEnvelopes(envelopes: readonly unknown[], patches: ReadonlyMap<string, readonly string[]>, now: number): {
|
|
114
|
+
source: "caller-supplied";
|
|
115
|
+
envelopeId: string | null;
|
|
116
|
+
patchReference: string | null;
|
|
117
|
+
patchDigest: string | null;
|
|
118
|
+
linkedRunReferences: string[];
|
|
119
|
+
schemaValid: boolean;
|
|
120
|
+
integrity: "invalid" | "valid";
|
|
121
|
+
expiration: "current" | "expired" | "not-yet-valid" | "unknown";
|
|
122
|
+
checkedAt: string;
|
|
123
|
+
expiredApprovals: number;
|
|
124
|
+
authenticity: "not-verified";
|
|
125
|
+
patchBytes: "not-verified";
|
|
126
|
+
}[];
|