@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,20 @@
|
|
|
1
|
+
import type { AgentRunInput, LanguageModel, ToolSet } from '@zhivex-ai/core';
|
|
2
|
+
import type { ZhivexHarness } from './harness.js';
|
|
3
|
+
import type { HarnessConfig } from './config.js';
|
|
4
|
+
import type { HarnessToolPolicy } from './tool-policy.js';
|
|
5
|
+
import type { TaskAcceptanceContract } from './task-acceptance.js';
|
|
6
|
+
import { type TaskAcceptanceLedger } from './task-acceptance-record.js';
|
|
7
|
+
export declare function bindTaskAcceptanceHost(host: object, context: {
|
|
8
|
+
config: HarnessConfig;
|
|
9
|
+
tools: ToolSet;
|
|
10
|
+
policy?: HarnessToolPolicy;
|
|
11
|
+
}): void;
|
|
12
|
+
export declare function inspectHarnessTaskAcceptance(host: ZhivexHarness, runId: string): Promise<TaskAcceptanceLedger | undefined>;
|
|
13
|
+
/** Application API: revising requirements never grants approval or claims that checks passed. */
|
|
14
|
+
export declare function reviseHarnessTaskAcceptance(host: ZhivexHarness, request: {
|
|
15
|
+
runId: string;
|
|
16
|
+
expectedRunRevision: number;
|
|
17
|
+
expectedContractRevision: number;
|
|
18
|
+
contract: TaskAcceptanceContract;
|
|
19
|
+
}): Promise<TaskAcceptanceLedger>;
|
|
20
|
+
export declare function withTaskAcceptanceRun<T>(host: ZhivexHarness, input: AgentRunInput<LanguageModel>, requirements: TaskAcceptanceContract | undefined, work: (input: AgentRunInput<LanguageModel>, ledger?: TaskAcceptanceLedger) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type AgentRunState, type AgentRunStore, type AgentStoreScope } from '@zhivex-ai/core';
|
|
3
|
+
export declare const TASK_ACCEPTANCE_KEY = "zhivexTaskAcceptanceV1";
|
|
4
|
+
export declare const TASK_ACCEPTANCE_EVIDENCE_KEY = "zhivexTaskAcceptanceEvidenceV1";
|
|
5
|
+
declare const ledgerSchema: z.ZodObject<{
|
|
6
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
7
|
+
revisions: z.ZodArray<z.ZodObject<{
|
|
8
|
+
revision: z.ZodNumber;
|
|
9
|
+
digest: z.ZodString;
|
|
10
|
+
previousDigest: z.ZodNullable<z.ZodString>;
|
|
11
|
+
contract: z.ZodObject<{
|
|
12
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
13
|
+
taskId: z.ZodString;
|
|
14
|
+
allowedWritePaths: z.ZodArray<z.ZodString>;
|
|
15
|
+
protectedFiles: z.ZodArray<z.ZodString>;
|
|
16
|
+
requiredChecks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
id: z.ZodString;
|
|
18
|
+
command: z.ZodString;
|
|
19
|
+
args: z.ZodArray<z.ZodString>;
|
|
20
|
+
purpose: z.ZodString;
|
|
21
|
+
kind: z.ZodLiteral<"package-script">;
|
|
22
|
+
script: z.ZodString;
|
|
23
|
+
expectedScript: z.ZodString;
|
|
24
|
+
execution: z.ZodObject<{
|
|
25
|
+
backend: z.ZodEnum<{
|
|
26
|
+
none: "none";
|
|
27
|
+
oci: "oci";
|
|
28
|
+
}>;
|
|
29
|
+
approval: z.ZodLiteral<"required">;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
command: z.ZodString;
|
|
34
|
+
args: z.ZodArray<z.ZodString>;
|
|
35
|
+
purpose: z.ZodString;
|
|
36
|
+
kind: z.ZodLiteral<"argv">;
|
|
37
|
+
execution: z.ZodObject<{
|
|
38
|
+
backend: z.ZodLiteral<"oci">;
|
|
39
|
+
approval: z.ZodLiteral<"required">;
|
|
40
|
+
network: z.ZodLiteral<"none">;
|
|
41
|
+
}, z.core.$strict>;
|
|
42
|
+
}, z.core.$strict>], "kind">>;
|
|
43
|
+
humanReview: z.ZodArray<z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
requirement: z.ZodString;
|
|
46
|
+
status: z.ZodLiteral<"pending">;
|
|
47
|
+
}, z.core.$strict>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
}, z.core.$strict>>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export type TaskAcceptanceLedger = z.infer<typeof ledgerSchema>;
|
|
52
|
+
export declare function readTaskAcceptanceLedger(state: Pick<AgentRunState, 'metadata'>): TaskAcceptanceLedger | undefined;
|
|
53
|
+
/** Internal host-only transition. The caller must preflight the new requirements. */
|
|
54
|
+
export declare function nextTaskAcceptanceLedger(current: TaskAcceptanceLedger | undefined, requirements: unknown): TaskAcceptanceLedger;
|
|
55
|
+
/** CAS on the authoritative run; stale operator views never overwrite another revision. */
|
|
56
|
+
export declare function persistTaskAcceptanceRevision(store: AgentRunStore, options: {
|
|
57
|
+
runId: string;
|
|
58
|
+
scope?: AgentStoreScope;
|
|
59
|
+
expectedRunRevision: number;
|
|
60
|
+
expectedContractRevision: number;
|
|
61
|
+
requirements: unknown;
|
|
62
|
+
}): Promise<{
|
|
63
|
+
schemaVersion: 1;
|
|
64
|
+
revisions: {
|
|
65
|
+
revision: number;
|
|
66
|
+
digest: string;
|
|
67
|
+
previousDigest: string | null;
|
|
68
|
+
contract: {
|
|
69
|
+
schemaVersion: 1;
|
|
70
|
+
taskId: string;
|
|
71
|
+
allowedWritePaths: string[];
|
|
72
|
+
protectedFiles: string[];
|
|
73
|
+
requiredChecks: ({
|
|
74
|
+
id: string;
|
|
75
|
+
command: string;
|
|
76
|
+
args: string[];
|
|
77
|
+
purpose: string;
|
|
78
|
+
kind: "package-script";
|
|
79
|
+
script: string;
|
|
80
|
+
expectedScript: string;
|
|
81
|
+
execution: {
|
|
82
|
+
backend: "none" | "oci";
|
|
83
|
+
approval: "required";
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
id: string;
|
|
87
|
+
command: string;
|
|
88
|
+
args: string[];
|
|
89
|
+
purpose: string;
|
|
90
|
+
kind: "argv";
|
|
91
|
+
execution: {
|
|
92
|
+
backend: "oci";
|
|
93
|
+
approval: "required";
|
|
94
|
+
network: "none";
|
|
95
|
+
};
|
|
96
|
+
})[];
|
|
97
|
+
humanReview: {
|
|
98
|
+
id: string;
|
|
99
|
+
requirement: string;
|
|
100
|
+
status: "pending";
|
|
101
|
+
}[];
|
|
102
|
+
};
|
|
103
|
+
}[];
|
|
104
|
+
}>;
|
|
105
|
+
/** Preserve host requirements through SDK checkpoints/compaction, independently of mutable model context. */
|
|
106
|
+
export declare function taskAcceptanceCheckpointStore(store: AgentRunStore, runId: string, ledger: TaskAcceptanceLedger): AgentRunStore;
|
|
107
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ToolSet } from '@zhivex-ai/core';
|
|
2
|
+
import type { HarnessConfig } from './config.js';
|
|
3
|
+
import { type HarnessToolPolicy } from './tool-policy.js';
|
|
4
|
+
/** Admission-time inspection only; execution must still revalidate changing files. */
|
|
5
|
+
export declare function validateTaskAcceptanceWorkspace(input: unknown, host: {
|
|
6
|
+
config: HarnessConfig;
|
|
7
|
+
tools: ToolSet;
|
|
8
|
+
policy?: HarnessToolPolicy;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
digest: string;
|
|
11
|
+
contract: import("./task-acceptance.js").TaskAcceptanceContract;
|
|
12
|
+
}>;
|
|
13
|
+
/** Read-only host preflight. Manifest must come from the host's bounded safe reader. */
|
|
14
|
+
export declare function validateTaskAcceptanceContract(input: unknown, host: {
|
|
15
|
+
config: HarnessConfig;
|
|
16
|
+
tools: ToolSet;
|
|
17
|
+
packageManifest?: {
|
|
18
|
+
packageManager?: unknown;
|
|
19
|
+
scripts?: unknown;
|
|
20
|
+
};
|
|
21
|
+
policy?: HarnessToolPolicy;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
digest: string;
|
|
24
|
+
contract: import("./task-acceptance.js").TaskAcceptanceContract;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Host-authored requirements. This contract contains no successful-check or approval claims. */
|
|
3
|
+
export declare const taskAcceptanceContractSchema: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
5
|
+
taskId: z.ZodString;
|
|
6
|
+
allowedWritePaths: z.ZodArray<z.ZodString>;
|
|
7
|
+
protectedFiles: z.ZodArray<z.ZodString>;
|
|
8
|
+
requiredChecks: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
command: z.ZodString;
|
|
11
|
+
args: z.ZodArray<z.ZodString>;
|
|
12
|
+
purpose: z.ZodString;
|
|
13
|
+
kind: z.ZodLiteral<"package-script">;
|
|
14
|
+
script: z.ZodString;
|
|
15
|
+
expectedScript: z.ZodString;
|
|
16
|
+
execution: z.ZodObject<{
|
|
17
|
+
backend: z.ZodEnum<{
|
|
18
|
+
none: "none";
|
|
19
|
+
oci: "oci";
|
|
20
|
+
}>;
|
|
21
|
+
approval: z.ZodLiteral<"required">;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
24
|
+
id: z.ZodString;
|
|
25
|
+
command: z.ZodString;
|
|
26
|
+
args: z.ZodArray<z.ZodString>;
|
|
27
|
+
purpose: z.ZodString;
|
|
28
|
+
kind: z.ZodLiteral<"argv">;
|
|
29
|
+
execution: z.ZodObject<{
|
|
30
|
+
backend: z.ZodLiteral<"oci">;
|
|
31
|
+
approval: z.ZodLiteral<"required">;
|
|
32
|
+
network: z.ZodLiteral<"none">;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
}, z.core.$strict>], "kind">>;
|
|
35
|
+
humanReview: z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
requirement: z.ZodString;
|
|
38
|
+
status: z.ZodLiteral<"pending">;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export type TaskAcceptanceContract = z.infer<typeof taskAcceptanceContractSchema>;
|
|
42
|
+
export declare const MAX_TASK_ACCEPTANCE_BYTES: number;
|
|
43
|
+
/** Canonical requirements identity; array ordering of sets is irrelevant, argv ordering is significant. */
|
|
44
|
+
export declare function compileTaskAcceptanceContract(input: unknown): {
|
|
45
|
+
digest: string;
|
|
46
|
+
contract: TaskAcceptanceContract;
|
|
47
|
+
};
|
|
@@ -163,6 +163,7 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
163
163
|
context_length_exceeded: "context_length_exceeded";
|
|
164
164
|
invalid_request: "invalid_request";
|
|
165
165
|
model_unavailable: "model_unavailable";
|
|
166
|
+
payment_required: "payment_required";
|
|
166
167
|
permission: "permission";
|
|
167
168
|
previous_response_unavailable: "previous_response_unavailable";
|
|
168
169
|
rate_limit: "rate_limit";
|
|
@@ -261,6 +262,7 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
261
262
|
context_length_exceeded: "context_length_exceeded";
|
|
262
263
|
invalid_request: "invalid_request";
|
|
263
264
|
model_unavailable: "model_unavailable";
|
|
265
|
+
payment_required: "payment_required";
|
|
264
266
|
permission: "permission";
|
|
265
267
|
previous_response_unavailable: "previous_response_unavailable";
|
|
266
268
|
rate_limit: "rate_limit";
|
|
@@ -376,6 +378,7 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
376
378
|
ZodError: "ZodError";
|
|
377
379
|
}>>;
|
|
378
380
|
checkpoint: z.ZodOptional<z.ZodEnum<{
|
|
381
|
+
continuity_phase: "continuity_phase";
|
|
379
382
|
execution_approval_sequence: "execution_approval_sequence";
|
|
380
383
|
execution_approval_tool: "execution_approval_tool";
|
|
381
384
|
execution_command_arguments: "execution_command_arguments";
|
|
@@ -398,6 +401,8 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
398
401
|
request_persistence: "request_persistence";
|
|
399
402
|
request_status: "request_status";
|
|
400
403
|
resume_arguments: "resume_arguments";
|
|
404
|
+
resume_compaction: "resume_compaction";
|
|
405
|
+
resume_continuation: "resume_continuation";
|
|
401
406
|
resume_effect: "resume_effect";
|
|
402
407
|
resume_file_content: "resume_file_content";
|
|
403
408
|
resume_file_read: "resume_file_read";
|
|
@@ -439,6 +444,7 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
439
444
|
context_length_exceeded: "context_length_exceeded";
|
|
440
445
|
invalid_request: "invalid_request";
|
|
441
446
|
model_unavailable: "model_unavailable";
|
|
447
|
+
payment_required: "payment_required";
|
|
442
448
|
permission: "permission";
|
|
443
449
|
previous_response_unavailable: "previous_response_unavailable";
|
|
444
450
|
rate_limit: "rate_limit";
|
|
@@ -480,6 +486,21 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
480
486
|
contract: "contract";
|
|
481
487
|
path: "path";
|
|
482
488
|
}>>;
|
|
489
|
+
liveRunState: z.ZodOptional<z.ZodObject<{
|
|
490
|
+
status: z.ZodEnum<{
|
|
491
|
+
cancelled: "cancelled";
|
|
492
|
+
completed: "completed";
|
|
493
|
+
failed: "failed";
|
|
494
|
+
running: "running";
|
|
495
|
+
waiting_approval: "waiting_approval";
|
|
496
|
+
}>;
|
|
497
|
+
steps: z.ZodNumber;
|
|
498
|
+
maxSteps: z.ZodNumber;
|
|
499
|
+
pendingApprovals: z.ZodNumber;
|
|
500
|
+
toolResults: z.ZodNumber;
|
|
501
|
+
toolErrors: z.ZodNumber;
|
|
502
|
+
compactions: z.ZodNumber;
|
|
503
|
+
}, z.core.$strict>>;
|
|
483
504
|
editEffect: z.ZodOptional<z.ZodObject<{
|
|
484
505
|
resultReceipts: z.ZodNumber;
|
|
485
506
|
errorReceipts: z.ZodNumber;
|
|
@@ -496,6 +517,68 @@ export declare const timeToSafeFixDriverResultSchema: z.ZodObject<{
|
|
|
496
517
|
shape: "shape";
|
|
497
518
|
unknown_fields: "unknown_fields";
|
|
498
519
|
}>>>;
|
|
520
|
+
executionArguments: z.ZodOptional<z.ZodObject<{
|
|
521
|
+
rootType: z.ZodEnum<{
|
|
522
|
+
array: "array";
|
|
523
|
+
boolean: "boolean";
|
|
524
|
+
null: "null";
|
|
525
|
+
number: "number";
|
|
526
|
+
object: "object";
|
|
527
|
+
string: "string";
|
|
528
|
+
undefined: "undefined";
|
|
529
|
+
}>;
|
|
530
|
+
commandPresent: z.ZodBoolean;
|
|
531
|
+
commandType: z.ZodEnum<{
|
|
532
|
+
array: "array";
|
|
533
|
+
boolean: "boolean";
|
|
534
|
+
null: "null";
|
|
535
|
+
number: "number";
|
|
536
|
+
object: "object";
|
|
537
|
+
string: "string";
|
|
538
|
+
undefined: "undefined";
|
|
539
|
+
}>;
|
|
540
|
+
commandMatchesExpected: z.ZodBoolean;
|
|
541
|
+
argsPresent: z.ZodBoolean;
|
|
542
|
+
argsType: z.ZodEnum<{
|
|
543
|
+
array: "array";
|
|
544
|
+
boolean: "boolean";
|
|
545
|
+
null: "null";
|
|
546
|
+
number: "number";
|
|
547
|
+
object: "object";
|
|
548
|
+
string: "string";
|
|
549
|
+
undefined: "undefined";
|
|
550
|
+
}>;
|
|
551
|
+
expectedArgCount: z.ZodNumber;
|
|
552
|
+
actualArgCount: z.ZodOptional<z.ZodNumber>;
|
|
553
|
+
extraArgCount: z.ZodNumber;
|
|
554
|
+
extraFieldCount: z.ZodNumber;
|
|
555
|
+
argumentMismatches: z.ZodArray<z.ZodObject<{
|
|
556
|
+
index: z.ZodNumber;
|
|
557
|
+
actualType: z.ZodEnum<{
|
|
558
|
+
array: "array";
|
|
559
|
+
boolean: "boolean";
|
|
560
|
+
null: "null";
|
|
561
|
+
number: "number";
|
|
562
|
+
object: "object";
|
|
563
|
+
string: "string";
|
|
564
|
+
undefined: "undefined";
|
|
565
|
+
}>;
|
|
566
|
+
matchesExpected: z.ZodBoolean;
|
|
567
|
+
nestedMemberCount: z.ZodOptional<z.ZodNumber>;
|
|
568
|
+
}, z.core.$strict>>;
|
|
569
|
+
}, z.core.$strict>>;
|
|
570
|
+
continuity: z.ZodOptional<z.ZodObject<{
|
|
571
|
+
phase: z.ZodNumber;
|
|
572
|
+
failedChecks: z.ZodArray<z.ZodEnum<{
|
|
573
|
+
codename: "codename";
|
|
574
|
+
compacted: "compacted";
|
|
575
|
+
compatibility: "compatibility";
|
|
576
|
+
completed: "completed";
|
|
577
|
+
noTools: "noTools";
|
|
578
|
+
objective: "objective";
|
|
579
|
+
rejectedApproach: "rejectedApproach";
|
|
580
|
+
}>>;
|
|
581
|
+
}, z.core.$strict>>;
|
|
499
582
|
budget: z.ZodOptional<z.ZodObject<{
|
|
500
583
|
budgetLimit: z.ZodEnum<{
|
|
501
584
|
maxInputTokens: "maxInputTokens";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** Explicit host input only. Never discover this file from repository instructions. */
|
|
2
|
+
export declare const loadHarnessToolPolicyFile: (filename: string, workspaceRoot: string) => Promise<{
|
|
3
|
+
digest: string;
|
|
4
|
+
evaluate: (request: {
|
|
5
|
+
toolName: string;
|
|
6
|
+
paths?: readonly string[];
|
|
7
|
+
requiresApproval?: boolean;
|
|
8
|
+
hardDenied?: boolean;
|
|
9
|
+
}) => import("./tool-policy.js").HarnessToolPolicyDecision;
|
|
10
|
+
policy: {
|
|
11
|
+
schemaVersion: number;
|
|
12
|
+
explicitReview?: {
|
|
13
|
+
schemaVersion: 1;
|
|
14
|
+
};
|
|
15
|
+
rules: {
|
|
16
|
+
id: string;
|
|
17
|
+
paths?: string[] | undefined;
|
|
18
|
+
decision: "allow" | "ask_user" | "deny";
|
|
19
|
+
reason: string;
|
|
20
|
+
tools: string[];
|
|
21
|
+
}[];
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HarnessToolPolicy } from './tool-policy.js';
|
|
2
|
+
export declare const BUILTIN_TOOL_POLICY_PATHS_VERSION = "builtin-exact-files-v1";
|
|
3
|
+
export declare const validateBuiltinToolPolicy: (policy: HarnessToolPolicy, tools: readonly string[]) => void;
|
|
4
|
+
/** Only invoked for tools with a path-scoped rule; irrelevant inputs stay opaque. */
|
|
5
|
+
export declare const builtinToolPolicyPathResolver: (policy: HarnessToolPolicy) => (name: string, input: unknown) => readonly string[];
|
|
@@ -2,6 +2,9 @@ import type { ToolSet } from "@zhivex-ai/core";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
export declare const harnessToolPolicySchema: z.ZodObject<{
|
|
4
4
|
schemaVersion: z.ZodLiteral<1>;
|
|
5
|
+
explicitReview: z.ZodOptional<z.ZodObject<{
|
|
6
|
+
schemaVersion: z.ZodLiteral<1>;
|
|
7
|
+
}, z.core.$strict>>;
|
|
5
8
|
rules: z.ZodArray<z.ZodObject<{
|
|
6
9
|
id: z.ZodString;
|
|
7
10
|
tools: z.ZodArray<z.ZodString>;
|
|
@@ -31,6 +34,9 @@ export declare const createHarnessToolPolicy: (input: HarnessToolPolicy) => {
|
|
|
31
34
|
}) => HarnessToolPolicyDecision;
|
|
32
35
|
policy: {
|
|
33
36
|
schemaVersion: number;
|
|
37
|
+
explicitReview?: {
|
|
38
|
+
schemaVersion: 1;
|
|
39
|
+
};
|
|
34
40
|
rules: {
|
|
35
41
|
id: string;
|
|
36
42
|
paths?: string[] | undefined;
|
package/dist/service-cli.js
CHANGED
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
import {
|
|
3
3
|
recoverHarnessLocalService,
|
|
4
4
|
startHarnessLocalService
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-w2sj0wkw.js";
|
|
6
6
|
import {
|
|
7
7
|
createHarness
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
8
|
+
} from "./index-hnaxfpb5.js";
|
|
9
|
+
import"./index-h0mqx2ed.js";
|
|
10
|
+
import"./index-8zzhggxv.js";
|
|
11
|
+
import"./index-42gp2hy8.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-qfpz5y2v.js";
|
|
12
19
|
import"./index-1bx83sw4.js";
|
|
13
20
|
|
|
14
21
|
// src/service-cli.ts
|
|
@@ -22,13 +29,13 @@ var main = async () => {
|
|
|
22
29
|
recover = true;
|
|
23
30
|
continue;
|
|
24
31
|
}
|
|
25
|
-
if (!["--workspace", "--directory", "--provider", "--model"].includes(name) || !args[i + 1] || values[name] !== undefined)
|
|
32
|
+
if (!["--workspace", "--directory", "--provider", "--model", "--tool-policy"].includes(name) || !args[i + 1] || values[name] !== undefined)
|
|
26
33
|
throw new Error("SERVICE_USAGE_INVALID");
|
|
27
34
|
values[name] = args[++i];
|
|
28
35
|
}
|
|
29
36
|
if (!values["--workspace"] || !values["--directory"])
|
|
30
37
|
throw new Error("SERVICE_USAGE_INVALID");
|
|
31
|
-
const harness = await createHarness({ workspace: values["--workspace"], ...values["--provider"] ? { provider: values["--provider"] } : {}, ...values["--model"] ? { model: values["--model"] } : {} });
|
|
38
|
+
const harness = await createHarness({ workspace: values["--workspace"], ...values["--tool-policy"] ? { toolPolicyFile: values["--tool-policy"] } : {}, ...values["--provider"] ? { provider: values["--provider"] } : {}, ...values["--model"] ? { model: values["--model"] } : {} });
|
|
32
39
|
try {
|
|
33
40
|
if (recover)
|
|
34
41
|
await recoverHarnessLocalService(harness, values["--directory"]);
|