@zhivex-ai/harness 0.8.0 → 0.10.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.
@@ -0,0 +1,271 @@
1
+ import { z } from "zod";
2
+ import { type FileDigest } from "./edit-contracts.js";
3
+ export declare const CHANGE_ENVELOPE_SCHEMA_VERSION: 1;
4
+ export declare const CHANGE_ENVELOPE_DIGEST_ALGORITHM: "sha256";
5
+ export declare const MAX_CHANGE_ENVELOPE_CHECKS = 100;
6
+ export declare const MAX_CHANGE_ENVELOPE_APPROVALS = 100;
7
+ export declare const MAX_CHANGE_ENVELOPE_APPROVAL_SCOPES = 32;
8
+ export declare const MAX_CHANGE_ENVELOPE_ATTESTATIONS = 32;
9
+ export declare const changeEnvelopeCheckSchema: z.ZodObject<{
10
+ checkId: z.ZodString;
11
+ status: z.ZodEnum<{
12
+ passed: "passed";
13
+ failed: "failed";
14
+ skipped: "skipped";
15
+ }>;
16
+ redacted: z.ZodLiteral<true>;
17
+ startedAt: z.ZodISODateTime;
18
+ completedAt: z.ZodISODateTime;
19
+ durationMs: z.ZodNumber;
20
+ exitCode: z.ZodOptional<z.ZodNumber>;
21
+ redactedOutputDigest: z.ZodOptional<z.ZodString>;
22
+ runnerFingerprint: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strict>;
24
+ export type ChangeEnvelopeCheck = z.infer<typeof changeEnvelopeCheckSchema>;
25
+ export declare const changeEnvelopeApprovalSchema: z.ZodObject<{
26
+ kind: z.ZodLiteral<"approval-reference">;
27
+ approvalId: z.ZodString;
28
+ approvalDigest: z.ZodString;
29
+ approverDigest: z.ZodString;
30
+ scopes: z.ZodArray<z.ZodString>;
31
+ approvedAt: z.ZodISODateTime;
32
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
33
+ }, z.core.$strict>;
34
+ export type ChangeEnvelopeApproval = z.infer<typeof changeEnvelopeApprovalSchema>;
35
+ export declare const externalAttestationReferenceSchema: z.ZodObject<{
36
+ kind: z.ZodLiteral<"external-attestation-reference">;
37
+ attestationId: z.ZodString;
38
+ format: z.ZodString;
39
+ mediaType: z.ZodString;
40
+ bundleDigest: z.ZodString;
41
+ }, z.core.$strict>;
42
+ export type ExternalAttestationReference = z.infer<typeof externalAttestationReferenceSchema>;
43
+ export declare const changeEnvelopeBaseSchema: z.ZodObject<{
44
+ workspaceDigest: z.ZodString;
45
+ treeDigest: z.ZodString;
46
+ }, z.core.$strict>;
47
+ export declare const changeEnvelopePatchSchema: z.ZodObject<{
48
+ patchId: z.ZodString;
49
+ patchDigest: z.ZodString;
50
+ }, z.core.$strict>;
51
+ export declare const changeEnvelopeFingerprintsSchema: z.ZodObject<{
52
+ harness: z.ZodString;
53
+ policy: z.ZodString;
54
+ environment: z.ZodString;
55
+ }, z.core.$strict>;
56
+ export declare const changeEnvelopeEvidenceSchema: z.ZodObject<{
57
+ schemaVersion: z.ZodLiteral<1>;
58
+ kind: z.ZodLiteral<"check-evidence-summary">;
59
+ digestAlgorithm: z.ZodLiteral<"sha256">;
60
+ evidenceDigest: z.ZodString;
61
+ checks: z.ZodArray<z.ZodObject<{
62
+ checkId: z.ZodString;
63
+ status: z.ZodEnum<{
64
+ passed: "passed";
65
+ failed: "failed";
66
+ skipped: "skipped";
67
+ }>;
68
+ redacted: z.ZodLiteral<true>;
69
+ startedAt: z.ZodISODateTime;
70
+ completedAt: z.ZodISODateTime;
71
+ durationMs: z.ZodNumber;
72
+ exitCode: z.ZodOptional<z.ZodNumber>;
73
+ redactedOutputDigest: z.ZodOptional<z.ZodString>;
74
+ runnerFingerprint: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strict>>;
76
+ }, z.core.$strict>;
77
+ export type ChangeEnvelopeEvidence = z.infer<typeof changeEnvelopeEvidenceSchema>;
78
+ export declare const changeEnvelopeInputSchema: z.ZodObject<{
79
+ createdAt: z.ZodISODateTime;
80
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
81
+ base: z.ZodObject<{
82
+ workspaceDigest: z.ZodString;
83
+ treeDigest: z.ZodString;
84
+ }, z.core.$strict>;
85
+ patch: z.ZodObject<{
86
+ patchId: z.ZodString;
87
+ patchDigest: z.ZodString;
88
+ }, z.core.$strict>;
89
+ fingerprints: z.ZodObject<{
90
+ harness: z.ZodString;
91
+ policy: z.ZodString;
92
+ environment: z.ZodString;
93
+ }, z.core.$strict>;
94
+ checks: z.ZodArray<z.ZodObject<{
95
+ checkId: z.ZodString;
96
+ status: z.ZodEnum<{
97
+ passed: "passed";
98
+ failed: "failed";
99
+ skipped: "skipped";
100
+ }>;
101
+ redacted: z.ZodLiteral<true>;
102
+ startedAt: z.ZodISODateTime;
103
+ completedAt: z.ZodISODateTime;
104
+ durationMs: z.ZodNumber;
105
+ exitCode: z.ZodOptional<z.ZodNumber>;
106
+ redactedOutputDigest: z.ZodOptional<z.ZodString>;
107
+ runnerFingerprint: z.ZodOptional<z.ZodString>;
108
+ }, z.core.$strict>>;
109
+ approvals: z.ZodOptional<z.ZodArray<z.ZodObject<{
110
+ kind: z.ZodLiteral<"approval-reference">;
111
+ approvalId: z.ZodString;
112
+ approvalDigest: z.ZodString;
113
+ approverDigest: z.ZodString;
114
+ scopes: z.ZodArray<z.ZodString>;
115
+ approvedAt: z.ZodISODateTime;
116
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
117
+ }, z.core.$strict>>>;
118
+ externalAttestations: z.ZodOptional<z.ZodArray<z.ZodObject<{
119
+ kind: z.ZodLiteral<"external-attestation-reference">;
120
+ attestationId: z.ZodString;
121
+ format: z.ZodString;
122
+ mediaType: z.ZodString;
123
+ bundleDigest: z.ZodString;
124
+ }, z.core.$strict>>>;
125
+ }, z.core.$strict>;
126
+ export type CreateChangeEnvelopeInput = z.infer<typeof changeEnvelopeInputSchema>;
127
+ export declare const changeEnvelopeSchema: z.ZodObject<{
128
+ schemaVersion: z.ZodLiteral<1>;
129
+ kind: z.ZodLiteral<"change-envelope">;
130
+ digestAlgorithm: z.ZodLiteral<"sha256">;
131
+ envelopeId: z.ZodString;
132
+ createdAt: z.ZodISODateTime;
133
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
134
+ base: z.ZodObject<{
135
+ workspaceDigest: z.ZodString;
136
+ treeDigest: z.ZodString;
137
+ }, z.core.$strict>;
138
+ patch: z.ZodObject<{
139
+ patchId: z.ZodString;
140
+ patchDigest: z.ZodString;
141
+ }, z.core.$strict>;
142
+ fingerprints: z.ZodObject<{
143
+ harness: z.ZodString;
144
+ policy: z.ZodString;
145
+ environment: z.ZodString;
146
+ }, z.core.$strict>;
147
+ evidence: z.ZodObject<{
148
+ schemaVersion: z.ZodLiteral<1>;
149
+ kind: z.ZodLiteral<"check-evidence-summary">;
150
+ digestAlgorithm: z.ZodLiteral<"sha256">;
151
+ evidenceDigest: z.ZodString;
152
+ checks: z.ZodArray<z.ZodObject<{
153
+ checkId: z.ZodString;
154
+ status: z.ZodEnum<{
155
+ passed: "passed";
156
+ failed: "failed";
157
+ skipped: "skipped";
158
+ }>;
159
+ redacted: z.ZodLiteral<true>;
160
+ startedAt: z.ZodISODateTime;
161
+ completedAt: z.ZodISODateTime;
162
+ durationMs: z.ZodNumber;
163
+ exitCode: z.ZodOptional<z.ZodNumber>;
164
+ redactedOutputDigest: z.ZodOptional<z.ZodString>;
165
+ runnerFingerprint: z.ZodOptional<z.ZodString>;
166
+ }, z.core.$strict>>;
167
+ }, z.core.$strict>;
168
+ approvals: z.ZodOptional<z.ZodArray<z.ZodObject<{
169
+ kind: z.ZodLiteral<"approval-reference">;
170
+ approvalId: z.ZodString;
171
+ approvalDigest: z.ZodString;
172
+ approverDigest: z.ZodString;
173
+ scopes: z.ZodArray<z.ZodString>;
174
+ approvedAt: z.ZodISODateTime;
175
+ expiresAt: z.ZodOptional<z.ZodISODateTime>;
176
+ }, z.core.$strict>>>;
177
+ externalAttestations: z.ZodOptional<z.ZodArray<z.ZodObject<{
178
+ kind: z.ZodLiteral<"external-attestation-reference">;
179
+ attestationId: z.ZodString;
180
+ format: z.ZodString;
181
+ mediaType: z.ZodString;
182
+ bundleDigest: z.ZodString;
183
+ }, z.core.$strict>>>;
184
+ }, z.core.$strict>;
185
+ export type ChangeEnvelope = z.infer<typeof changeEnvelopeSchema>;
186
+ /** Content-addresses exact artifact bytes for patch/base inputs without parsing them. */
187
+ export declare const digestChangeEnvelopeArtifact: (value: string | Uint8Array) => FileDigest;
188
+ /**
189
+ * Creates a content-addressed envelope. The caller supplies all timestamps, so
190
+ * repeated calls with semantically identical input return the same envelope.
191
+ * Raw command output, prompts, reasons, and credentials are intentionally not
192
+ * representable by this contract.
193
+ */
194
+ export declare const createChangeEnvelope: (input: unknown) => ChangeEnvelope;
195
+ /** Returns the canonical, whitespace-free JSON representation of a valid envelope. */
196
+ export declare const canonicalizeChangeEnvelope: (input: unknown) => string;
197
+ /** Recomputes the envelope identifier without trusting its embedded envelopeId. */
198
+ export declare const computeChangeEnvelopeDigest: (input: unknown) => FileDigest;
199
+ /** Recomputes the independently addressable digest of the redacted check summary. */
200
+ export declare const computeChangeEnvelopeEvidenceDigest: (input: unknown) => FileDigest;
201
+ export declare const changeEnvelopePreconditionsSchema: z.ZodObject<{
202
+ envelopeId: z.ZodOptional<z.ZodString>;
203
+ baseWorkspaceDigest: z.ZodOptional<z.ZodString>;
204
+ baseTreeDigest: z.ZodOptional<z.ZodString>;
205
+ patchId: z.ZodOptional<z.ZodString>;
206
+ patchDigest: z.ZodOptional<z.ZodString>;
207
+ harnessFingerprint: z.ZodOptional<z.ZodString>;
208
+ policyFingerprint: z.ZodOptional<z.ZodString>;
209
+ environmentFingerprint: z.ZodOptional<z.ZodString>;
210
+ evidenceDigest: z.ZodOptional<z.ZodString>;
211
+ requiredPassedChecks: z.ZodOptional<z.ZodArray<z.ZodString>>;
212
+ requiredApprovalDigests: z.ZodOptional<z.ZodArray<z.ZodString>>;
213
+ requiredApprovalScopes: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
+ requiredAttestationDigests: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ }, z.core.$strict>;
216
+ export type ChangeEnvelopePreconditions = z.infer<typeof changeEnvelopePreconditionsSchema>;
217
+ export interface ChangeEnvelopeVerificationOptions {
218
+ now?: Date | string | number;
219
+ preconditions?: ChangeEnvelopePreconditions;
220
+ }
221
+ export type ChangeEnvelopeVerificationIssueCode = "invalid-schema" | "envelope-digest-mismatch" | "evidence-digest-mismatch" | "envelope-not-yet-valid" | "envelope-expired" | "approval-expired" | "precondition-mismatch" | "missing-passed-check" | "missing-approval-digest" | "missing-approval-scope" | "missing-attestation-digest";
222
+ export interface ChangeEnvelopeVerificationIssue {
223
+ code: ChangeEnvelopeVerificationIssueCode;
224
+ path: readonly (string | number)[];
225
+ message: string;
226
+ expected?: string;
227
+ actual?: string;
228
+ }
229
+ export interface ChangeEnvelopeVerificationResult {
230
+ valid: boolean;
231
+ verificationScope: "integrity-expiration-and-preconditions-only";
232
+ envelope?: ChangeEnvelope;
233
+ issues: ChangeEnvelopeVerificationIssue[];
234
+ integrity: {
235
+ envelopeDigestValid: boolean;
236
+ evidenceDigestValid: boolean;
237
+ };
238
+ expiration: {
239
+ checkedAt: string;
240
+ envelopeNotYetValid: boolean;
241
+ envelopeExpired: boolean;
242
+ expiredApprovalIds: string[];
243
+ };
244
+ checks: {
245
+ recorded: number;
246
+ passed: string[];
247
+ failed: string[];
248
+ skipped: string[];
249
+ requiredPassed: string[];
250
+ missingPassed: string[];
251
+ };
252
+ approvals: {
253
+ recorded: number;
254
+ requiredScopes: string[];
255
+ missingScopes: string[];
256
+ authenticity: "not-verified";
257
+ };
258
+ externalAttestations: {
259
+ referenced: number;
260
+ requiredDigests: FileDigest[];
261
+ missingDigests: FileDigest[];
262
+ authenticity: "not-verified";
263
+ };
264
+ }
265
+ /**
266
+ * Verifies schema, content digests, expiry, and caller-supplied preconditions
267
+ * without network access. Approval and attestation references are integrity
268
+ * bound only: their issuer/signature authenticity must be checked by an
269
+ * external Sigstore/in-toto (or equivalent) verifier.
270
+ */
271
+ export declare const verifyChangeEnvelope: (input: unknown, options?: ChangeEnvelopeVerificationOptions) => ChangeEnvelopeVerificationResult;
@@ -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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
37
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
44
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
52
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
60
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
67
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
73
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
82
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
89
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
95
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
102
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
108
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
116
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
125
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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: "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "image-generation" | "finish" | "error" | "agent-run-start" | "agent-step-start" | "agent-step-finish" | "agent-approval-request" | "agent-approval-resolved" | "agent-compaction" | "agent-run-finish";
134
+ type: "error" | "text-delta" | "tool-call" | "tool-result" | "tool-approval-request" | "provider-data" | "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
  /**
package/dist/cli.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env node
2
2
  import { type AgentApprovalRequest, type AgentRunInput, type AgentRunOutput, type AgentRunState, type AgentStatus } from "@zhivex-ai/agents";
3
3
  import { providerAvailability, resolveHarnessConfig, type HarnessConfig, type HarnessConfigInput, type HarnessProvider, type HarnessSubagentProfile } from "./config.js";
4
4
  import { type ZhivexHarness } from "./harness.js";
@@ -14,9 +14,10 @@ export declare const CLI_EXIT_CODES: {
14
14
  readonly usageError: 2;
15
15
  readonly doctorFailed: 3;
16
16
  };
17
- type Command = "run" | "review" | "chat" | "providers" | "doctor" | "resume" | "runs" | "sessions" | "help" | "version";
17
+ type Command = "run" | "review" | "chat" | "providers" | "doctor" | "resume" | "runs" | "sessions" | "changes" | "help" | "version";
18
18
  type RunsCommand = "list" | "inspect" | "cancel" | "cleanup" | "export";
19
19
  type SessionsCommand = "list" | "inspect" | "rename" | "fork" | "archive";
20
+ type ChangesCommand = "create" | "verify";
20
21
  export interface CliOptions {
21
22
  command: Command;
22
23
  provider?: string;
@@ -68,6 +69,11 @@ export interface CliOptions {
68
69
  idempotencyKey?: string;
69
70
  runsCommand?: RunsCommand;
70
71
  sessionsCommand?: SessionsCommand;
72
+ changesCommand?: ChangesCommand;
73
+ artifactPath?: string;
74
+ patchPath?: string;
75
+ preconditionsPath?: string;
76
+ verificationTime?: string;
71
77
  sessionId?: string;
72
78
  sessionTitle?: string;
73
79
  continueSession: boolean;
@@ -202,6 +208,8 @@ export interface DoctorReport {
202
208
  }
203
209
  export interface DoctorContext {
204
210
  env?: NodeJS.ProcessEnv;
211
+ nodeVersion?: string;
212
+ /** @deprecated Test-only compatibility injection for the secondary Bun runtime. */
205
213
  bunVersion?: string;
206
214
  ociRuntimeAdapter?: HarnessOciRuntimeAdapter;
207
215
  }