@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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Experimental, host-only OCI MCP API. Never load host policy from a workspace. */
|
|
2
|
+
export { createMcpStdioAdmissionAuthority, McpStdioAdmissionError } from '../integrations/mcp-stdio-admission.js';
|
|
3
|
+
export type { McpStdioLaunchProposal, McpStdioLaunchReceipt } from '../integrations/mcp-stdio-admission.js';
|
|
4
|
+
export { prepareMcpWorkspaceSnapshot, discardMcpWorkspaceSnapshot } from '../execution/mcp-workspace-snapshot.js';
|
|
5
|
+
export type { McpWorkspaceSnapshot } from '../execution/mcp-workspace-snapshot.js';
|
|
6
|
+
export { recoverDockerMcpResources } from '../execution/mcp-resource-recovery.js';
|
|
7
|
+
export { createMcpReconciliationAuthority } from '../persistence/mcp-reconciliation.js';
|
|
8
|
+
export type { McpReconciliationDecision, McpReconciliationReview } from '../persistence/mcp-reconciliation.js';
|
|
9
|
+
export type { HarnessIsolatedMcpSession } from '../integrations/mcp-host-session.js';
|
|
10
|
+
export type { IsolatedMcpLaunchOptions } from '../integrations/mcp-stdio-session.js';
|
|
11
|
+
export { launchIsolatedMcpSession } from '../integrations/mcp-stdio-session.js';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
McpStdioAdmissionError,
|
|
3
|
+
createMcpStdioAdmissionAuthority,
|
|
4
|
+
discardMcpWorkspaceSnapshot,
|
|
5
|
+
launchDockerMcpTools,
|
|
6
|
+
matchesMcpResourceScope,
|
|
7
|
+
mcpResourceOutputSchema,
|
|
8
|
+
mcpResourcePlanSchema,
|
|
9
|
+
prepareMcpWorkspaceSnapshot,
|
|
10
|
+
recoverDockerMcpResources
|
|
11
|
+
} from "../index-6m08wvab.js";
|
|
12
|
+
import"../index-azmwjp95.js";
|
|
13
|
+
import"../index-z0qxmkm2.js";
|
|
14
|
+
import"../index-yb239ghk.js";
|
|
15
|
+
import"../index-gq9xagx2.js";
|
|
16
|
+
import"../index-8705zxpr.js";
|
|
17
|
+
import"../index-xqxeypt5.js";
|
|
18
|
+
import"../index-1bx83sw4.js";
|
|
19
|
+
// src/persistence/mcp-reconciliation.ts
|
|
20
|
+
import { z } from "zod";
|
|
21
|
+
var digest = z.string().regex(/^[a-f0-9]{64}$/);
|
|
22
|
+
var identitySchema = z.object({
|
|
23
|
+
schemaVersion: z.literal(1),
|
|
24
|
+
kind: z.literal("isolated-mcp-call"),
|
|
25
|
+
proposalHash: digest,
|
|
26
|
+
argumentsHash: digest,
|
|
27
|
+
toolNameHash: digest
|
|
28
|
+
}).strict();
|
|
29
|
+
var decisionSchema = z.object({
|
|
30
|
+
toolCallId: z.string().regex(/^mcp_execution_[a-f0-9]{64}$/),
|
|
31
|
+
expectedRevision: z.number().int().nonnegative(),
|
|
32
|
+
outcome: z.enum(["effect_confirmed", "no_effect_confirmed"]),
|
|
33
|
+
evidenceDigest: z.string().regex(/^sha256:[a-f0-9]{64}$/)
|
|
34
|
+
}).strict();
|
|
35
|
+
function createMcpReconciliationAuthority(options) {
|
|
36
|
+
const { store, runId, hostId, authorize } = options;
|
|
37
|
+
const scope = Object.freeze(structuredClone(options.scope));
|
|
38
|
+
if (!store.loadToolCall || !store.saveToolCall || !store.listToolCalls || !runId || !hostId || !scope.userId || !scope.tenantId) {
|
|
39
|
+
throw new Error("MCP reconciliation requires a scoped durable host authority.");
|
|
40
|
+
}
|
|
41
|
+
const load = store.loadToolCall.bind(store), save = store.saveToolCall.bind(store), list = store.listToolCalls.bind(store);
|
|
42
|
+
const read = async (decision) => {
|
|
43
|
+
const row = await load(runId, decision.toolCallId, scope);
|
|
44
|
+
if (!row || row.toolName !== "isolated_mcp_call" || row.revision !== decision.expectedRevision || !(row.status === "pending" || row.status === "running" || row.error?.message === "MCP_OUTCOME_UNKNOWN")) {
|
|
45
|
+
throw new Error("MCP reconciliation target is stale or has no unresolved outcome.");
|
|
46
|
+
}
|
|
47
|
+
const identity = identitySchema.parse(row.input);
|
|
48
|
+
const resources = (await list(runId, scope)).filter((entry) => entry.toolName === "isolated_mcp_resources");
|
|
49
|
+
if (!resources.length || resources.some((entry) => {
|
|
50
|
+
const plan = mcpResourcePlanSchema.parse(entry.input);
|
|
51
|
+
return !matchesMcpResourceScope(plan, runId, scope, hostId) || mcpResourceOutputSchema.parse(entry.output).phase !== "closed";
|
|
52
|
+
}))
|
|
53
|
+
throw new Error("MCP reconciliation requires confirmed resource cleanup.");
|
|
54
|
+
return { row, identity };
|
|
55
|
+
};
|
|
56
|
+
return Object.freeze({
|
|
57
|
+
async reconcile(input) {
|
|
58
|
+
const decision = Object.freeze(decisionSchema.parse(input));
|
|
59
|
+
const initial = await read(decision);
|
|
60
|
+
const review = Object.freeze({
|
|
61
|
+
...decision,
|
|
62
|
+
runId,
|
|
63
|
+
scope,
|
|
64
|
+
proposalHash: initial.identity.proposalHash,
|
|
65
|
+
argumentsHash: initial.identity.argumentsHash,
|
|
66
|
+
toolNameHash: initial.identity.toolNameHash
|
|
67
|
+
});
|
|
68
|
+
if (await authorize(review) !== true)
|
|
69
|
+
throw new Error("MCP reconciliation was not authorized.");
|
|
70
|
+
const current = await read(decision);
|
|
71
|
+
if (JSON.stringify(current.identity) !== JSON.stringify(initial.identity))
|
|
72
|
+
throw new Error("MCP reconciliation identity changed.");
|
|
73
|
+
const now = Date.now();
|
|
74
|
+
await save({
|
|
75
|
+
...current.row,
|
|
76
|
+
status: "failed",
|
|
77
|
+
error: { message: "MCP_OUTCOME_RECONCILED" },
|
|
78
|
+
completedAt: now,
|
|
79
|
+
updatedAt: now,
|
|
80
|
+
output: {
|
|
81
|
+
schemaVersion: 1,
|
|
82
|
+
kind: "isolated-mcp-reconciliation",
|
|
83
|
+
outcome: decision.outcome,
|
|
84
|
+
evidenceDigest: decision.evidenceDigest,
|
|
85
|
+
previousStatus: current.row.status,
|
|
86
|
+
previousError: current.row.error?.message ?? null,
|
|
87
|
+
reviewedRevision: decision.expectedRevision,
|
|
88
|
+
actor: scope.userId,
|
|
89
|
+
resolvedAt: now
|
|
90
|
+
}
|
|
91
|
+
}, { expectedRevision: decision.expectedRevision });
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// src/integrations/mcp-stdio-session.ts
|
|
96
|
+
async function launchIsolatedMcpSession(options) {
|
|
97
|
+
const session = await launchDockerMcpTools(options);
|
|
98
|
+
return Object.freeze({ hostSession: session.hostSession, close: session.close });
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
McpStdioAdmissionError,
|
|
102
|
+
createMcpReconciliationAuthority,
|
|
103
|
+
createMcpStdioAdmissionAuthority,
|
|
104
|
+
discardMcpWorkspaceSnapshot,
|
|
105
|
+
launchIsolatedMcpSession,
|
|
106
|
+
prepareMcpWorkspaceSnapshot,
|
|
107
|
+
recoverDockerMcpResources
|
|
108
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Browser-safe model metadata. No credentials, transports, filesystem or processes. */
|
|
2
|
+
export { bundledModelCatalog, bundledDefaultModel, catalogModelSchema, modelCatalogSchema, catalogModels, modelDescription } from "../models/catalog.js";
|
|
3
|
+
export type { CatalogModel, ModelCatalog } from "../models/catalog.js";
|