@zhivex-ai/harness 0.11.0 → 1.0.0-rc.7
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 +129 -0
- package/README.md +9 -8
- package/ROADMAP.md +31 -8
- package/SECURITY.md +4 -2
- package/SUPPORT.md +4 -2
- package/contracts/public-api.json +1359 -0
- package/contracts/security-controls.json +15 -0
- package/contracts/stable-api-signatures.json +490 -0
- package/dist/cli-options.d.ts +40 -0
- package/dist/cli-stream.d.ts +15 -15
- package/dist/cli.d.ts +20 -6
- package/dist/cli.js +2103 -496
- package/dist/config.d.ts +14 -0
- package/dist/errors.d.ts +68 -0
- package/dist/file-security.d.ts +29 -0
- package/dist/hostile-repository-demo.js +793 -329
- package/dist/index.d.ts +12 -4
- package/dist/index.js +7392 -5216
- package/dist/json-contracts.d.ts +1707 -0
- package/dist/operations.d.ts +1 -1
- package/dist/providers.d.ts +5 -0
- package/dist/state-backup.d.ts +148 -0
- package/dist/time-to-safe-fix.d.ts +43 -2
- package/dist/verify-historical-migrations.js +7667 -0
- package/dist/zhx.js +2103 -496
- package/docs/CLI.md +21 -4
- package/docs/DEPRECATIONS.md +9 -0
- package/docs/DURABLE_OPERATIONS.md +18 -1
- package/docs/EXTENSIBILITY.md +3 -3
- package/docs/GA_READINESS.md +23 -0
- package/docs/GEMINI_1_0_DECISION.md +9 -0
- package/docs/LIVE_CERTIFICATION.md +22 -2
- package/docs/PUBLIC_SECURITY.md +39 -0
- package/docs/RELEASE.md +17 -10
- package/docs/ROLLBACK.md +9 -0
- package/docs/SECURITY_REVIEW_EVIDENCE.md +15 -0
- package/docs/STABILITY.md +13 -0
- package/docs/SUPPORT_MATRIX.md +17 -0
- package/docs/THREAT_MODEL.md +28 -0
- package/docs/TIME_TO_SAFE_FIX.md +2 -2
- package/docs/ga-readiness.json +235 -0
- package/docs/support-matrix.json +29 -0
- package/evaluations/representative-assembly-matrix.json +138 -0
- package/evaluations/representative-matrix.json +179 -0
- package/evaluations/representative-repositories.jsonl +7 -0
- package/examples/mcp-config.json +1 -1
- package/fixtures/contracts/v1/doctor.json +45 -0
- package/fixtures/contracts/v1/error.json +9 -0
- package/fixtures/contracts/v1/observational-documents.json +34 -0
- package/fixtures/contracts/v1/providers.json +17 -0
- package/fixtures/contracts/v1/run-result-forward.json +37 -0
- package/fixtures/contracts/v1/run-result.json +34 -0
- package/fixtures/contracts/v1/run-stream-result.jsonl +1 -0
- package/fixtures/migrations/0.10.0.json +315 -0
- package/fixtures/migrations/0.10.0.sqlite +0 -0
- package/fixtures/migrations/0.11.1.json +319 -0
- package/fixtures/migrations/0.11.1.sqlite +0 -0
- package/fixtures/migrations/README.md +20 -0
- package/package.json +16 -9
package/dist/cli-stream.d.ts
CHANGED
|
@@ -34,14 +34,14 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
34
34
|
schemaVersion: 1;
|
|
35
35
|
kind: "run-event";
|
|
36
36
|
sequence: number;
|
|
37
|
-
type: "error" | "
|
|
37
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
38
38
|
} | {
|
|
39
39
|
toolCallId: string;
|
|
40
40
|
toolName: string;
|
|
41
41
|
schemaVersion: 1;
|
|
42
42
|
kind: "run-event";
|
|
43
43
|
sequence: number;
|
|
44
|
-
type: "error" | "
|
|
44
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
45
45
|
} | {
|
|
46
46
|
toolCallId: string;
|
|
47
47
|
toolName: string;
|
|
@@ -49,7 +49,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
49
49
|
schemaVersion: 1;
|
|
50
50
|
kind: "run-event";
|
|
51
51
|
sequence: number;
|
|
52
|
-
type: "error" | "
|
|
52
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
53
53
|
} | {
|
|
54
54
|
approvalRequestId: string;
|
|
55
55
|
approvalKind: "provider" | "local-tool" | "subagent";
|
|
@@ -57,20 +57,20 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
57
57
|
schemaVersion: 1;
|
|
58
58
|
kind: "run-event";
|
|
59
59
|
sequence: number;
|
|
60
|
-
type: "error" | "
|
|
60
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
61
61
|
} | {
|
|
62
62
|
approvalRequestId: string;
|
|
63
63
|
approved: boolean;
|
|
64
64
|
schemaVersion: 1;
|
|
65
65
|
kind: "run-event";
|
|
66
66
|
sequence: number;
|
|
67
|
-
type: "error" | "
|
|
67
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
68
68
|
} | {
|
|
69
69
|
provider: string;
|
|
70
70
|
schemaVersion: 1;
|
|
71
71
|
kind: "run-event";
|
|
72
72
|
sequence: number;
|
|
73
|
-
type: "error" | "
|
|
73
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
74
74
|
} | {
|
|
75
75
|
index?: number;
|
|
76
76
|
id?: string;
|
|
@@ -79,33 +79,33 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
79
79
|
schemaVersion: 1;
|
|
80
80
|
kind: "run-event";
|
|
81
81
|
sequence: number;
|
|
82
|
-
type: "error" | "
|
|
82
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
83
83
|
} | {
|
|
84
84
|
usage?: import("@zhivex-ai/core").TokenUsage;
|
|
85
85
|
finishReason?: import("@zhivex-ai/core").FinishReason;
|
|
86
86
|
schemaVersion: 1;
|
|
87
87
|
kind: "run-event";
|
|
88
88
|
sequence: number;
|
|
89
|
-
type: "error" | "
|
|
89
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
90
90
|
} | {
|
|
91
91
|
error: string;
|
|
92
92
|
schemaVersion: 1;
|
|
93
93
|
kind: "run-event";
|
|
94
94
|
sequence: number;
|
|
95
|
-
type: "error" | "
|
|
95
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
96
96
|
} | {
|
|
97
97
|
currentStep: number;
|
|
98
98
|
maxSteps: number;
|
|
99
99
|
schemaVersion: 1;
|
|
100
100
|
kind: "run-event";
|
|
101
101
|
sequence: number;
|
|
102
|
-
type: "error" | "
|
|
102
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
103
103
|
} | {
|
|
104
104
|
stepIndex: number;
|
|
105
105
|
schemaVersion: 1;
|
|
106
106
|
kind: "run-event";
|
|
107
107
|
sequence: number;
|
|
108
|
-
type: "error" | "
|
|
108
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
109
109
|
} | {
|
|
110
110
|
stepIndex: number;
|
|
111
111
|
status: import("@zhivex-ai/core").AgentStepStatus;
|
|
@@ -113,7 +113,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
113
113
|
schemaVersion: 1;
|
|
114
114
|
kind: "run-event";
|
|
115
115
|
sequence: number;
|
|
116
|
-
type: "error" | "
|
|
116
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
117
117
|
} | {
|
|
118
118
|
compactionId: string;
|
|
119
119
|
reasons: import("@zhivex-ai/core").AgentCompactionReason[];
|
|
@@ -122,7 +122,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
122
122
|
schemaVersion: 1;
|
|
123
123
|
kind: "run-event";
|
|
124
124
|
sequence: number;
|
|
125
|
-
type: "error" | "
|
|
125
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
126
126
|
} | {
|
|
127
127
|
runId: string;
|
|
128
128
|
status: import("@zhivex-ai/core").AgentStatus;
|
|
@@ -131,7 +131,7 @@ export declare const streamEventDocument: (event: AgentStreamEvent, sequence?: n
|
|
|
131
131
|
schemaVersion: 1;
|
|
132
132
|
kind: "run-event";
|
|
133
133
|
sequence: number;
|
|
134
|
-
type: "error" | "
|
|
134
|
+
type: "error" | "tool-call" | "tool-result" | "provider-data" | "text-delta" | "tool-approval-request" | "image-generation" | "finish" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
|
|
135
135
|
};
|
|
136
136
|
export declare const serializeStreamEvent: (event: AgentStreamEvent, sequence?: number) => string;
|
|
137
137
|
/**
|
|
@@ -144,7 +144,7 @@ export declare const serializeStreamEvent: (event: AgentStreamEvent, sequence?:
|
|
|
144
144
|
*/
|
|
145
145
|
export declare const streamResultDocument: (result: StreamRunResultSource, sequence?: number) => {
|
|
146
146
|
schemaVersion: 1;
|
|
147
|
-
kind: "run-result";
|
|
147
|
+
kind: "run-stream-result";
|
|
148
148
|
sequence: number;
|
|
149
149
|
runId: string;
|
|
150
150
|
status: string;
|
package/dist/cli.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { type ZhivexHarness } from "./harness.js";
|
|
|
5
5
|
import { type HarnessOciRuntimeAdapter } from "./execution-environment.js";
|
|
6
6
|
import { type HarnessModelRoute } from "./routing.js";
|
|
7
7
|
import { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
|
|
8
|
+
import { HarnessError } from "./errors.js";
|
|
8
9
|
export { CLI_JSON_SCHEMA_VERSION } from "./cli-stream.js";
|
|
9
10
|
export declare const HARNESS_RESUME_METADATA_KEY: "zhivexHarnessResume";
|
|
10
11
|
export declare const HARNESS_RESUME_METADATA_SCHEMA_VERSION: 1;
|
|
@@ -14,10 +15,19 @@ export declare const CLI_EXIT_CODES: {
|
|
|
14
15
|
readonly usageError: 2;
|
|
15
16
|
readonly doctorFailed: 3;
|
|
16
17
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export declare const annotateCliStreamError: (error: unknown, lastSequence: number | undefined) => Error;
|
|
19
|
+
export declare const cliStreamErrorSequence: (error: unknown) => number;
|
|
20
|
+
export declare const terminalErrorMessage: (error: unknown) => string;
|
|
21
|
+
export declare const CLI_COMMANDS: readonly ["run", "review", "chat", "providers", "doctor", "resume", "runs", "sessions", "changes", "state", "help", "version"];
|
|
22
|
+
export declare const CLI_RUNS_COMMANDS: readonly ["list", "inspect", "cancel", "cleanup", "export"];
|
|
23
|
+
export declare const CLI_SESSIONS_COMMANDS: readonly ["list", "inspect", "rename", "fork", "archive"];
|
|
24
|
+
export declare const CLI_CHANGES_COMMANDS: readonly ["create", "verify"];
|
|
25
|
+
export declare const CLI_STATE_COMMANDS: readonly ["status", "export", "import"];
|
|
26
|
+
type Command = (typeof CLI_COMMANDS)[number];
|
|
27
|
+
type RunsCommand = (typeof CLI_RUNS_COMMANDS)[number];
|
|
28
|
+
type SessionsCommand = (typeof CLI_SESSIONS_COMMANDS)[number];
|
|
29
|
+
type ChangesCommand = (typeof CLI_CHANGES_COMMANDS)[number];
|
|
30
|
+
type StateCommand = (typeof CLI_STATE_COMMANDS)[number];
|
|
21
31
|
export interface CliOptions {
|
|
22
32
|
command: Command;
|
|
23
33
|
provider?: string;
|
|
@@ -73,10 +83,12 @@ export interface CliOptions {
|
|
|
73
83
|
runsCommand?: RunsCommand;
|
|
74
84
|
sessionsCommand?: SessionsCommand;
|
|
75
85
|
changesCommand?: ChangesCommand;
|
|
86
|
+
stateCommand?: StateCommand;
|
|
76
87
|
artifactPath?: string;
|
|
77
88
|
patchPath?: string;
|
|
78
89
|
preconditionsPath?: string;
|
|
79
90
|
verificationTime?: string;
|
|
91
|
+
backupPath?: string;
|
|
80
92
|
sessionId?: string;
|
|
81
93
|
sessionTitle?: string;
|
|
82
94
|
continueSession: boolean;
|
|
@@ -88,12 +100,13 @@ export interface CliOptions {
|
|
|
88
100
|
reason?: string;
|
|
89
101
|
cascade: boolean;
|
|
90
102
|
final: boolean;
|
|
103
|
+
apply: boolean;
|
|
91
104
|
yes: boolean;
|
|
92
105
|
approve?: boolean;
|
|
93
106
|
json: boolean;
|
|
94
107
|
jsonl: boolean;
|
|
95
108
|
}
|
|
96
|
-
export declare class CliUsageError extends
|
|
109
|
+
export declare class CliUsageError extends HarnessError {
|
|
97
110
|
constructor(message: string);
|
|
98
111
|
}
|
|
99
112
|
export declare const createHarnessResumeMetadata: (config: HarnessConfig, routes?: ReadonlyMap<HarnessSubagentProfile, HarnessModelRoute>) => NonNullable<AgentRunInput["metadata"]>;
|
|
@@ -101,6 +114,7 @@ export declare const readHarnessResumeConfig: (state: Pick<AgentRunState, "metad
|
|
|
101
114
|
export declare const readHarnessResumeRoutes: (state: Pick<AgentRunState, "metadata">) => Map<"explorer" | "implementer" | "tester" | "reviewer", HarnessModelRoute>;
|
|
102
115
|
export declare const resumeCommand: (runId: string, config: HarnessConfig, approve?: boolean) => string;
|
|
103
116
|
export declare const parseCliArgs: (argv: string[]) => CliOptions;
|
|
117
|
+
export declare const CLI_HELP_TEXT: string;
|
|
104
118
|
export declare const summarizeApproval: (approval: AgentApprovalRequest) => string;
|
|
105
119
|
export declare const runResultDocument: (result: AgentRunOutput, harness: ZhivexHarness) => {
|
|
106
120
|
scope: import("@zhivex-ai/core").AgentStoreScope | undefined;
|
|
@@ -120,7 +134,7 @@ export declare const runResultDocument: (result: AgentRunOutput, harness: Zhivex
|
|
|
120
134
|
image?: never;
|
|
121
135
|
};
|
|
122
136
|
store: {
|
|
123
|
-
backend: "
|
|
137
|
+
backend: "file" | "sqlite";
|
|
124
138
|
stateDirectory: string;
|
|
125
139
|
migration: import("./operations.js").HarnessMigrationResult | undefined;
|
|
126
140
|
};
|