@zhivex-ai/harness 1.4.0 → 1.4.1
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 +29 -10
- package/README.md +7 -5
- package/SUPPORT.md +2 -2
- package/contracts/client-protocol-v1.schema.json +593 -0
- package/contracts/engine-api.json +156 -0
- package/contracts/public-api.json +12 -0
- package/contracts/stable-api-signatures.json +33 -33
- package/dist/acp-cli.js +54 -20
- package/dist/audit/index.d.ts +3 -0
- package/dist/audit/index.js +482 -0
- package/dist/audit/pack.d.ts +72 -0
- package/dist/audit-pack-e4vaq7np.js +532 -0
- package/dist/cli/arguments.d.ts +3 -1
- package/dist/cli/audit-pack.d.ts +24 -0
- package/dist/cli/cli-credentials.d.ts +6 -0
- package/dist/cli/cli-profiles.d.ts +4 -2
- package/dist/cli/node-engine.d.ts +2 -0
- package/dist/{cli-2h37qyvg.js → cli-1cf4dcnj.js} +245 -642
- package/dist/{cli-entry-w0hterjs.js → cli-entry-3s63zn4w.js} +40 -13
- package/dist/cli-entry-7f0cen32.js +9990 -0
- package/dist/cli-entry-a890x3kq.js +10348 -0
- package/dist/{cli-entry-20w6nh0k.js → cli-entry-hdtfef27.js} +439 -19
- package/dist/cli-entry-rgs6bxmy.js +484 -0
- package/dist/cli.js +27 -2
- package/dist/client/json-contracts.d.ts +4 -0
- package/dist/client/protocol.d.ts +133 -0
- package/dist/client/task-control-host.d.ts +400 -0
- package/dist/client/task-projection-host.d.ts +12 -0
- package/dist/client/task-projection.d.ts +168 -0
- package/dist/compat/code-support.js +28 -22
- package/dist/{config-qt69hkqj.js → config-r9fdhce6.js} +3 -3
- package/dist/{config-j9624t6t.js → config-vyajmksy.js} +1 -1
- package/dist/engine/acp.js +15 -11
- package/dist/engine/client.js +14 -10
- package/dist/engine/desktop-providers-v1.d.ts +2 -0
- package/dist/engine/desktop-providers-v1.js +23 -3
- package/dist/engine/desktop-state-v1.js +11 -8
- package/dist/engine/index.d.ts +3 -0
- package/dist/engine/index.js +101 -554
- package/dist/engine/mcp-stdio-v1.js +8 -6
- package/dist/engine/models.js +76 -4
- package/dist/engine/protocol.d.ts +2 -0
- package/dist/engine/protocol.js +110 -0
- package/dist/engine/service.js +15 -11
- package/dist/hostile-repository-demo.js +1095 -505
- package/dist/{index-937cb7y8.js → index-02pqtbbg.js} +559 -33
- package/dist/{index-pp474137.js → index-0zs2dz26.js} +766 -931
- package/dist/{index-8zjmnyw5.js → index-1265j7t2.js} +73 -6
- package/dist/index-4fx5f3k5.js +269 -0
- package/dist/{index-nmjdwd4p.js → index-4gt045j0.js} +109 -1
- package/dist/{index-6dft2vev.js → index-6599mpmy.js} +5 -3
- package/dist/{index-tfzta544.js → index-74kkpyqk.js} +9 -7
- package/dist/{index-61gthdz6.js → index-8sm2a1wa.js} +1 -1
- package/dist/index-c39197wq.js +552 -0
- package/dist/{index-5jhgatga.js → index-crta5wzv.js} +7 -6
- package/dist/{index-m34q25jj.js → index-d9zkmhz3.js} +143 -824
- package/dist/{index-pdmevfxv.js → index-dtb2c6ds.js} +5 -259
- package/dist/index-f6mqa5gk.js +1535 -0
- package/dist/index-j6zxnc8m.js +490 -0
- package/dist/{index-rkbf7dqg.js → index-mv8sb1ns.js} +5 -3
- package/dist/{index-xqxeypt5.js → index-mzydbzp8.js} +76 -4
- package/dist/{index-wg1sd3at.js → index-qfsrrnz6.js} +1 -1
- package/dist/{index-m82cfspw.js → index-sk3cap35.js} +877 -963
- package/dist/index-sstgcsr0.js +511 -0
- package/dist/index-wm9xeq1n.js +329 -0
- package/dist/index-xdbkcccf.js +719 -0
- package/dist/{index-s2k2edts.js → index-zxg4ve4j.js} +41 -1548
- package/dist/index.d.ts +3 -0
- package/dist/index.js +93 -77
- package/dist/internal/desktop/providers.d.ts +2 -0
- package/dist/models/catalog.d.ts +2 -0
- package/dist/persistence/sqlite-database.d.ts +1 -0
- package/dist/providers/azure-openai.d.ts +14 -0
- package/dist/providers/bedrock.d.ts +23 -0
- package/dist/providers/providers.d.ts +1 -1
- package/dist/runtime/durable-review-group.d.ts +33 -0
- package/dist/runtime/harness.d.ts +11 -0
- package/dist/runtime/run-interruption.d.ts +7 -0
- package/dist/runtime/shared-budget.d.ts +30 -0
- package/dist/runtime/task-continuity.d.ts +300 -77
- package/dist/service-cli.js +15 -11
- package/dist/{service-client-cli-fn54ev6w.js → service-client-cli-eqrdc9zq.js} +400 -305
- package/dist/verify-historical-migrations.js +1095 -505
- package/dist/zhx.js +27 -2
- package/docs/AUDIT_PACK.md +99 -0
- package/docs/AZURE_OPENAI.md +53 -0
- package/docs/BEDROCK.md +56 -0
- package/docs/CLI.md +15 -0
- package/docs/CLIENT_PROTOCOL.md +178 -0
- package/docs/CODE_RELEASE.md +31 -1
- package/docs/CODE_WEB_TASKS.md +116 -0
- package/docs/CONTEXT_ENGINEERING.md +59 -0
- package/docs/CREDENTIALS.md +21 -0
- package/docs/DURABLE_OPERATIONS.md +93 -1
- package/docs/ENGINE_API.md +5 -2
- package/docs/EXTENSIBILITY.md +2 -2
- package/docs/FIRST_USE.md +6 -6
- package/docs/MINIMUM_TASK_AUTHORITY.md +3 -3
- package/docs/PROJECT_MEMORY.md +1 -1
- package/docs/README.md +6 -1
- package/docs/STABILITY.md +3 -1
- package/docs/SUPPORT_MATRIX.md +1 -1
- package/docs/SUPPORT_MATRIX_1_1.md +1 -1
- package/docs/USAGE.md +3 -1
- package/docs/VERTEX.md +2 -2
- package/docs/WEB_LIMITS.md +4 -3
- package/docs/adr/0002-isolated-mcp-stdio.md +6 -3
- package/docs/support-matrix-1.1.json +3 -1
- package/docs/support-matrix.json +6 -4
- package/evaluations/code-task-ui.json +20 -0
- package/evaluations/representative-assembly-matrix.json +10 -1
- package/evaluations/task-projection.json +10 -0
- package/evaluations/task-recovery-lab.json +60 -0
- package/examples/README.md +3 -3
- package/package.json +23 -13
- package/dist/cli-entry-4ngptr62.js +0 -19900
- package/dist/index-m49jx72n.js +0 -220
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { HarnessTaskProjection } from './task-projection.js';
|
|
1
2
|
import type { HarnessErrorDocument, ProviderStreamDiagnostic } from "../runtime/errors.js";
|
|
2
3
|
import type { HarnessPolicyDecisionEvent } from "../runtime/policy-decisions.js";
|
|
3
4
|
import type { HarnessPolicyInspection } from "../runtime/policy-inspection.js";
|
|
@@ -89,6 +90,57 @@ export declare const harnessClientCommandSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
89
90
|
method: z.ZodLiteral<"run.start">;
|
|
90
91
|
expectedRevision: z.ZodNumber;
|
|
91
92
|
prompt: z.ZodString;
|
|
93
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
94
|
+
projectId: z.ZodString;
|
|
95
|
+
sessionId: z.ZodString;
|
|
96
|
+
idempotencyKey: z.ZodString;
|
|
97
|
+
method: z.ZodLiteral<"task.start">;
|
|
98
|
+
expectedRevision: z.ZodNumber;
|
|
99
|
+
brief: z.ZodObject<{
|
|
100
|
+
goal: z.ZodString;
|
|
101
|
+
paths: z.ZodArray<z.ZodString>;
|
|
102
|
+
checks: z.ZodArray<z.ZodString>;
|
|
103
|
+
constraints: z.ZodArray<z.ZodString>;
|
|
104
|
+
budget: z.ZodObject<{
|
|
105
|
+
inputTokens: z.ZodNumber;
|
|
106
|
+
outputTokens: z.ZodNumber;
|
|
107
|
+
totalTokens: z.ZodNumber;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
}, z.core.$strict>;
|
|
110
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
111
|
+
projectId: z.ZodString;
|
|
112
|
+
sessionId: z.ZodString;
|
|
113
|
+
runId: z.ZodString;
|
|
114
|
+
method: z.ZodLiteral<"task.review">;
|
|
115
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
116
|
+
projectId: z.ZodString;
|
|
117
|
+
sessionId: z.ZodString;
|
|
118
|
+
runId: z.ZodString;
|
|
119
|
+
idempotencyKey: z.ZodString;
|
|
120
|
+
method: z.ZodLiteral<"task.keep">;
|
|
121
|
+
reviewId: z.ZodString;
|
|
122
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
123
|
+
projectId: z.ZodString;
|
|
124
|
+
sessionId: z.ZodString;
|
|
125
|
+
runId: z.ZodString;
|
|
126
|
+
idempotencyKey: z.ZodString;
|
|
127
|
+
method: z.ZodLiteral<"task.revise">;
|
|
128
|
+
reviewId: z.ZodString;
|
|
129
|
+
correction: z.ZodString;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
+
projectId: z.ZodString;
|
|
132
|
+
sessionId: z.ZodString;
|
|
133
|
+
runId: z.ZodString;
|
|
134
|
+
idempotencyKey: z.ZodString;
|
|
135
|
+
method: z.ZodLiteral<"task.continue">;
|
|
136
|
+
reviewId: z.ZodString;
|
|
137
|
+
prompt: z.ZodString;
|
|
138
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
139
|
+
projectId: z.ZodString;
|
|
140
|
+
sessionId: z.ZodString;
|
|
141
|
+
runId: z.ZodString;
|
|
142
|
+
method: z.ZodLiteral<"task.get">;
|
|
143
|
+
projectionVersion: z.ZodNumber;
|
|
92
144
|
}, z.core.$strict>, z.ZodObject<{
|
|
93
145
|
projectId: z.ZodString;
|
|
94
146
|
sessionId: z.ZodString;
|
|
@@ -200,6 +252,57 @@ export declare const harnessClientRequestSchema: z.ZodObject<{
|
|
|
200
252
|
method: z.ZodLiteral<"run.start">;
|
|
201
253
|
expectedRevision: z.ZodNumber;
|
|
202
254
|
prompt: z.ZodString;
|
|
255
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
256
|
+
projectId: z.ZodString;
|
|
257
|
+
sessionId: z.ZodString;
|
|
258
|
+
idempotencyKey: z.ZodString;
|
|
259
|
+
method: z.ZodLiteral<"task.start">;
|
|
260
|
+
expectedRevision: z.ZodNumber;
|
|
261
|
+
brief: z.ZodObject<{
|
|
262
|
+
goal: z.ZodString;
|
|
263
|
+
paths: z.ZodArray<z.ZodString>;
|
|
264
|
+
checks: z.ZodArray<z.ZodString>;
|
|
265
|
+
constraints: z.ZodArray<z.ZodString>;
|
|
266
|
+
budget: z.ZodObject<{
|
|
267
|
+
inputTokens: z.ZodNumber;
|
|
268
|
+
outputTokens: z.ZodNumber;
|
|
269
|
+
totalTokens: z.ZodNumber;
|
|
270
|
+
}, z.core.$strict>;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
273
|
+
projectId: z.ZodString;
|
|
274
|
+
sessionId: z.ZodString;
|
|
275
|
+
runId: z.ZodString;
|
|
276
|
+
method: z.ZodLiteral<"task.review">;
|
|
277
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
278
|
+
projectId: z.ZodString;
|
|
279
|
+
sessionId: z.ZodString;
|
|
280
|
+
runId: z.ZodString;
|
|
281
|
+
idempotencyKey: z.ZodString;
|
|
282
|
+
method: z.ZodLiteral<"task.keep">;
|
|
283
|
+
reviewId: z.ZodString;
|
|
284
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
285
|
+
projectId: z.ZodString;
|
|
286
|
+
sessionId: z.ZodString;
|
|
287
|
+
runId: z.ZodString;
|
|
288
|
+
idempotencyKey: z.ZodString;
|
|
289
|
+
method: z.ZodLiteral<"task.revise">;
|
|
290
|
+
reviewId: z.ZodString;
|
|
291
|
+
correction: z.ZodString;
|
|
292
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
293
|
+
projectId: z.ZodString;
|
|
294
|
+
sessionId: z.ZodString;
|
|
295
|
+
runId: z.ZodString;
|
|
296
|
+
idempotencyKey: z.ZodString;
|
|
297
|
+
method: z.ZodLiteral<"task.continue">;
|
|
298
|
+
reviewId: z.ZodString;
|
|
299
|
+
prompt: z.ZodString;
|
|
300
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
301
|
+
projectId: z.ZodString;
|
|
302
|
+
sessionId: z.ZodString;
|
|
303
|
+
runId: z.ZodString;
|
|
304
|
+
method: z.ZodLiteral<"task.get">;
|
|
305
|
+
projectionVersion: z.ZodNumber;
|
|
203
306
|
}, z.core.$strict>, z.ZodObject<{
|
|
204
307
|
projectId: z.ZodString;
|
|
205
308
|
sessionId: z.ZodString;
|
|
@@ -254,7 +357,30 @@ export interface HarnessClientRun {
|
|
|
254
357
|
filePreview?: ApprovalFilePreview;
|
|
255
358
|
}[];
|
|
256
359
|
}
|
|
360
|
+
export interface HarnessTaskHumanDecision {
|
|
361
|
+
status: 'not_recorded' | 'current' | 'stale';
|
|
362
|
+
at: number | null;
|
|
363
|
+
provenance: 'explicit_operator_review' | null;
|
|
364
|
+
}
|
|
365
|
+
export interface HarnessTaskReview {
|
|
366
|
+
reviewId: string;
|
|
367
|
+
expiresAt: number;
|
|
368
|
+
projection: HarnessTaskProjection;
|
|
369
|
+
diff: string;
|
|
370
|
+
complete: boolean;
|
|
371
|
+
canKeep: boolean;
|
|
372
|
+
canContinue: boolean;
|
|
373
|
+
canRevise: boolean;
|
|
374
|
+
humanDecision: HarnessTaskHumanDecision;
|
|
375
|
+
}
|
|
257
376
|
export type HarnessClientData = {
|
|
377
|
+
kind: "task";
|
|
378
|
+
projection: HarnessTaskProjection;
|
|
379
|
+
humanDecision?: HarnessTaskHumanDecision;
|
|
380
|
+
} | {
|
|
381
|
+
kind: "taskReview";
|
|
382
|
+
review: HarnessTaskReview;
|
|
383
|
+
} | {
|
|
258
384
|
kind: "project";
|
|
259
385
|
projectId: string;
|
|
260
386
|
} | {
|
|
@@ -299,6 +425,11 @@ export type HarnessClientResponse = {
|
|
|
299
425
|
error: {
|
|
300
426
|
code: HarnessClientErrorCode;
|
|
301
427
|
providerDiagnostic?: ProviderStreamDiagnostic;
|
|
428
|
+
taskDiagnostic?: {
|
|
429
|
+
cause: "UNSUPPORTED_VERSION" | "UNSUPPORTED_HOST" | "OUT_OF_SCOPE" | "CONTRACT_UNAVAILABLE" | "EVIDENCE_UNAVAILABLE" | "SNAPSHOT_CHANGED" | "PAYLOAD_LIMIT";
|
|
430
|
+
impact: "projection_unavailable";
|
|
431
|
+
safeAction: "retry_read" | "review_configuration" | "reconcile";
|
|
432
|
+
};
|
|
302
433
|
};
|
|
303
434
|
});
|
|
304
435
|
export type HarnessClientNegotiation = {
|
|
@@ -314,6 +445,8 @@ export type HarnessClientNegotiation = {
|
|
|
314
445
|
};
|
|
315
446
|
};
|
|
316
447
|
export interface HarnessClientAdapterOptions {
|
|
448
|
+
/** Host-owned secrets for the bounded task projection. Never supplied by commands. */
|
|
449
|
+
taskProjectionSensitiveValues?: readonly string[];
|
|
317
450
|
approvalMaxAgeMs?: number;
|
|
318
451
|
now?: () => number;
|
|
319
452
|
onPolicyDecision?: (sessionId: string, runId: string, event: HarnessPolicyDecisionEvent) => void | Promise<void>;
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import type { ZhivexHarness } from '../runtime/harness.js';
|
|
2
|
+
import { compileTaskAcceptanceContract } from '../runtime/task-acceptance.js';
|
|
3
|
+
import type { HarnessTaskProjection } from './task-projection.js';
|
|
4
|
+
import type { AgentRunState } from '@zhivex-ai/core';
|
|
5
|
+
export declare const TASK_HUMAN_DECISION_KEY = "harnessClientHumanDecisionV1";
|
|
6
|
+
export interface TaskBrief {
|
|
7
|
+
goal: string;
|
|
8
|
+
paths: string[];
|
|
9
|
+
checks: string[];
|
|
10
|
+
constraints: string[];
|
|
11
|
+
budget: {
|
|
12
|
+
inputTokens: number;
|
|
13
|
+
outputTokens: number;
|
|
14
|
+
totalTokens: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare const taskReviewIdentity: (p: HarnessTaskProjection) => string;
|
|
18
|
+
export declare function taskHumanDecision(host: ZhivexHarness, p: HarnessTaskProjection): Promise<{
|
|
19
|
+
status: 'not_recorded';
|
|
20
|
+
at: null;
|
|
21
|
+
provenance: null;
|
|
22
|
+
} | {
|
|
23
|
+
status: "current" | "stale";
|
|
24
|
+
at: number;
|
|
25
|
+
provenance: 'explicit_operator_review';
|
|
26
|
+
}>;
|
|
27
|
+
export declare function visibleTaskFiles(host: ZhivexHarness, paths: readonly string[]): Promise<void>;
|
|
28
|
+
export declare function taskGitReview(host: ZhivexHarness): Promise<{
|
|
29
|
+
text: string;
|
|
30
|
+
identity: string;
|
|
31
|
+
}>;
|
|
32
|
+
/** Browser supplies a bounded operator brief, never a contract, receipt or execution grant. */
|
|
33
|
+
export declare function prepareClientTask(host: ZhivexHarness, brief: TaskBrief): Promise<{
|
|
34
|
+
schemaVersion: 1;
|
|
35
|
+
budgetVersion: 1;
|
|
36
|
+
goal: string;
|
|
37
|
+
constraints: string[];
|
|
38
|
+
contract: {
|
|
39
|
+
schemaVersion: 1;
|
|
40
|
+
taskId: string;
|
|
41
|
+
allowedWritePaths: string[];
|
|
42
|
+
protectedFiles: string[];
|
|
43
|
+
requiredChecks: ({
|
|
44
|
+
id: string;
|
|
45
|
+
command: string;
|
|
46
|
+
args: string[];
|
|
47
|
+
purpose: string;
|
|
48
|
+
kind: "package-script";
|
|
49
|
+
script: string;
|
|
50
|
+
expectedScript: string;
|
|
51
|
+
execution: {
|
|
52
|
+
backend: "none" | "oci";
|
|
53
|
+
approval: "required";
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
id: string;
|
|
57
|
+
command: string;
|
|
58
|
+
args: string[];
|
|
59
|
+
purpose: string;
|
|
60
|
+
kind: "argv";
|
|
61
|
+
execution: {
|
|
62
|
+
backend: "oci";
|
|
63
|
+
approval: "required";
|
|
64
|
+
network: "none";
|
|
65
|
+
};
|
|
66
|
+
})[];
|
|
67
|
+
humanReview: {
|
|
68
|
+
id: string;
|
|
69
|
+
requirement: string;
|
|
70
|
+
status: "pending";
|
|
71
|
+
}[];
|
|
72
|
+
};
|
|
73
|
+
baseline: Record<string, string>;
|
|
74
|
+
}>;
|
|
75
|
+
export declare function currentClientTask(host: ZhivexHarness, runId: string, allowedRunIds: readonly string[]): Promise<{
|
|
76
|
+
state: AgentRunState;
|
|
77
|
+
ledger: {
|
|
78
|
+
schemaVersion: 1;
|
|
79
|
+
revisions: {
|
|
80
|
+
revision: number;
|
|
81
|
+
digest: string;
|
|
82
|
+
previousDigest: string | null;
|
|
83
|
+
contract: {
|
|
84
|
+
schemaVersion: 1;
|
|
85
|
+
taskId: string;
|
|
86
|
+
allowedWritePaths: string[];
|
|
87
|
+
protectedFiles: string[];
|
|
88
|
+
requiredChecks: ({
|
|
89
|
+
id: string;
|
|
90
|
+
command: string;
|
|
91
|
+
args: string[];
|
|
92
|
+
purpose: string;
|
|
93
|
+
kind: "package-script";
|
|
94
|
+
script: string;
|
|
95
|
+
expectedScript: string;
|
|
96
|
+
execution: {
|
|
97
|
+
backend: "none" | "oci";
|
|
98
|
+
approval: "required";
|
|
99
|
+
};
|
|
100
|
+
} | {
|
|
101
|
+
id: string;
|
|
102
|
+
command: string;
|
|
103
|
+
args: string[];
|
|
104
|
+
purpose: string;
|
|
105
|
+
kind: "argv";
|
|
106
|
+
execution: {
|
|
107
|
+
backend: "oci";
|
|
108
|
+
approval: "required";
|
|
109
|
+
network: "none";
|
|
110
|
+
};
|
|
111
|
+
})[];
|
|
112
|
+
humanReview: {
|
|
113
|
+
id: string;
|
|
114
|
+
requirement: string;
|
|
115
|
+
status: "pending";
|
|
116
|
+
}[];
|
|
117
|
+
};
|
|
118
|
+
}[];
|
|
119
|
+
};
|
|
120
|
+
evidence: {
|
|
121
|
+
report: {
|
|
122
|
+
schemaVersion: 1;
|
|
123
|
+
taskId: string;
|
|
124
|
+
budget: {
|
|
125
|
+
schemaVersion: 1;
|
|
126
|
+
taskId: string;
|
|
127
|
+
accountRunId: string;
|
|
128
|
+
revision: number;
|
|
129
|
+
limits: {
|
|
130
|
+
inputTokens: number;
|
|
131
|
+
outputTokens: number;
|
|
132
|
+
totalTokens: number;
|
|
133
|
+
};
|
|
134
|
+
confirmed: {
|
|
135
|
+
inputTokens: number;
|
|
136
|
+
outputTokens: number;
|
|
137
|
+
totalTokens: number;
|
|
138
|
+
};
|
|
139
|
+
reserved: {
|
|
140
|
+
inputTokens: number;
|
|
141
|
+
outputTokens: number;
|
|
142
|
+
totalTokens: number;
|
|
143
|
+
};
|
|
144
|
+
unknown: {
|
|
145
|
+
inputTokens: number;
|
|
146
|
+
outputTokens: number;
|
|
147
|
+
totalTokens: number;
|
|
148
|
+
};
|
|
149
|
+
remaining: {
|
|
150
|
+
inputTokens: number;
|
|
151
|
+
outputTokens: number;
|
|
152
|
+
totalTokens: number;
|
|
153
|
+
};
|
|
154
|
+
usageComplete: boolean;
|
|
155
|
+
admissionsClosed: boolean;
|
|
156
|
+
invocationPending: boolean;
|
|
157
|
+
activeRunId: string | null;
|
|
158
|
+
runs: string[];
|
|
159
|
+
coordinatorId: string;
|
|
160
|
+
cancellations: {
|
|
161
|
+
runId: string;
|
|
162
|
+
requestedAt: number;
|
|
163
|
+
origin: "abort" | "lease_lost" | "operator" | "timeout";
|
|
164
|
+
localToolsDrainedAt?: number | undefined;
|
|
165
|
+
localExecution: "native_tools_drained" | "unconfirmed";
|
|
166
|
+
remoteExecution: 'unconfirmed';
|
|
167
|
+
}[];
|
|
168
|
+
monetary: {
|
|
169
|
+
schemaVersion: number;
|
|
170
|
+
runId: string;
|
|
171
|
+
calls: number;
|
|
172
|
+
routes: {
|
|
173
|
+
provider: string;
|
|
174
|
+
model: string;
|
|
175
|
+
calls: number;
|
|
176
|
+
inputTokens: number;
|
|
177
|
+
outputTokens: number;
|
|
178
|
+
unknownCalls: number;
|
|
179
|
+
estimatedUsd: number | null;
|
|
180
|
+
priceStatuses: string[];
|
|
181
|
+
}[];
|
|
182
|
+
inputTokens: number;
|
|
183
|
+
outputTokens: number;
|
|
184
|
+
historicalUsageUnknown: boolean;
|
|
185
|
+
usageComplete: boolean;
|
|
186
|
+
estimatedUsd: number | null;
|
|
187
|
+
limitUsd: number | null;
|
|
188
|
+
costKind: "estimate-not-invoice";
|
|
189
|
+
};
|
|
190
|
+
monetaryDetails: {
|
|
191
|
+
schemaVersion: 1;
|
|
192
|
+
confirmedCalls: number;
|
|
193
|
+
reservedCalls: number;
|
|
194
|
+
unknownCalls: number;
|
|
195
|
+
lateCalls: number;
|
|
196
|
+
estimatedConfirmedUsd: number | null;
|
|
197
|
+
reservedUsd: number | null;
|
|
198
|
+
unknownHeldUsd: number | null;
|
|
199
|
+
remainingUsd: number | null;
|
|
200
|
+
costComplete: boolean;
|
|
201
|
+
categories: string[];
|
|
202
|
+
costKind: "estimate-not-invoice";
|
|
203
|
+
};
|
|
204
|
+
} | null;
|
|
205
|
+
runs: {
|
|
206
|
+
runId: string;
|
|
207
|
+
revision: number | undefined;
|
|
208
|
+
status: import("@zhivex-ai/core").AgentStatus;
|
|
209
|
+
ledger: {
|
|
210
|
+
schemaVersion: 1;
|
|
211
|
+
revisions: {
|
|
212
|
+
revision: number;
|
|
213
|
+
digest: string;
|
|
214
|
+
previousDigest: string | null;
|
|
215
|
+
contract: {
|
|
216
|
+
schemaVersion: 1;
|
|
217
|
+
taskId: string;
|
|
218
|
+
allowedWritePaths: string[];
|
|
219
|
+
protectedFiles: string[];
|
|
220
|
+
requiredChecks: ({
|
|
221
|
+
id: string;
|
|
222
|
+
command: string;
|
|
223
|
+
args: string[];
|
|
224
|
+
purpose: string;
|
|
225
|
+
kind: "package-script";
|
|
226
|
+
script: string;
|
|
227
|
+
expectedScript: string;
|
|
228
|
+
execution: {
|
|
229
|
+
backend: "none" | "oci";
|
|
230
|
+
approval: "required";
|
|
231
|
+
};
|
|
232
|
+
} | {
|
|
233
|
+
id: string;
|
|
234
|
+
command: string;
|
|
235
|
+
args: string[];
|
|
236
|
+
purpose: string;
|
|
237
|
+
kind: "argv";
|
|
238
|
+
execution: {
|
|
239
|
+
backend: "oci";
|
|
240
|
+
approval: "required";
|
|
241
|
+
network: "none";
|
|
242
|
+
};
|
|
243
|
+
})[];
|
|
244
|
+
humanReview: {
|
|
245
|
+
id: string;
|
|
246
|
+
requirement: string;
|
|
247
|
+
status: "pending";
|
|
248
|
+
}[];
|
|
249
|
+
};
|
|
250
|
+
}[];
|
|
251
|
+
};
|
|
252
|
+
sources: {
|
|
253
|
+
id: string;
|
|
254
|
+
text: string;
|
|
255
|
+
original?: true;
|
|
256
|
+
}[];
|
|
257
|
+
decisions: import("../approvals/approval-history.js").ApprovalDecisionView[];
|
|
258
|
+
decisionsAvailability: string;
|
|
259
|
+
briefStatus: string;
|
|
260
|
+
objective: string | null;
|
|
261
|
+
constraints: string[];
|
|
262
|
+
hostPolicyCompatible: boolean;
|
|
263
|
+
assistantResponses: {
|
|
264
|
+
id: string;
|
|
265
|
+
text: string;
|
|
266
|
+
truncated: boolean;
|
|
267
|
+
untrusted: boolean;
|
|
268
|
+
verified: boolean;
|
|
269
|
+
}[];
|
|
270
|
+
effects: {
|
|
271
|
+
id: string;
|
|
272
|
+
tool: string;
|
|
273
|
+
revision: number;
|
|
274
|
+
status: string;
|
|
275
|
+
retry: string;
|
|
276
|
+
}[];
|
|
277
|
+
checks: {
|
|
278
|
+
id: string;
|
|
279
|
+
status: string;
|
|
280
|
+
}[];
|
|
281
|
+
snapshot: import("../runtime/task-acceptance-checks.js").TaskCheckBinding | null;
|
|
282
|
+
delivery: {} | null;
|
|
283
|
+
humanReview: {
|
|
284
|
+
id: string;
|
|
285
|
+
requirement: string;
|
|
286
|
+
status: "pending";
|
|
287
|
+
}[];
|
|
288
|
+
fingerprint: import("@zhivex-ai/core").AgentHarnessBinding | null;
|
|
289
|
+
}[];
|
|
290
|
+
currentContract: {
|
|
291
|
+
revision: number;
|
|
292
|
+
digest: string;
|
|
293
|
+
previousDigest: string | null;
|
|
294
|
+
contract: {
|
|
295
|
+
schemaVersion: 1;
|
|
296
|
+
taskId: string;
|
|
297
|
+
allowedWritePaths: string[];
|
|
298
|
+
protectedFiles: string[];
|
|
299
|
+
requiredChecks: ({
|
|
300
|
+
id: string;
|
|
301
|
+
command: string;
|
|
302
|
+
args: string[];
|
|
303
|
+
purpose: string;
|
|
304
|
+
kind: "package-script";
|
|
305
|
+
script: string;
|
|
306
|
+
expectedScript: string;
|
|
307
|
+
execution: {
|
|
308
|
+
backend: "none" | "oci";
|
|
309
|
+
approval: "required";
|
|
310
|
+
};
|
|
311
|
+
} | {
|
|
312
|
+
id: string;
|
|
313
|
+
command: string;
|
|
314
|
+
args: string[];
|
|
315
|
+
purpose: string;
|
|
316
|
+
kind: "argv";
|
|
317
|
+
execution: {
|
|
318
|
+
backend: "oci";
|
|
319
|
+
approval: "required";
|
|
320
|
+
network: "none";
|
|
321
|
+
};
|
|
322
|
+
})[];
|
|
323
|
+
humanReview: {
|
|
324
|
+
id: string;
|
|
325
|
+
requirement: string;
|
|
326
|
+
status: "pending";
|
|
327
|
+
}[];
|
|
328
|
+
};
|
|
329
|
+
} | null;
|
|
330
|
+
reasons: string[];
|
|
331
|
+
nextAction: string;
|
|
332
|
+
authorization: 'none';
|
|
333
|
+
automaticEffectReplay: false;
|
|
334
|
+
};
|
|
335
|
+
verify: () => Promise<void>;
|
|
336
|
+
verifyAll: () => Promise<void>;
|
|
337
|
+
};
|
|
338
|
+
current: {
|
|
339
|
+
revision: number;
|
|
340
|
+
digest: string;
|
|
341
|
+
previousDigest: string | null;
|
|
342
|
+
contract: {
|
|
343
|
+
schemaVersion: 1;
|
|
344
|
+
taskId: string;
|
|
345
|
+
allowedWritePaths: string[];
|
|
346
|
+
protectedFiles: string[];
|
|
347
|
+
requiredChecks: ({
|
|
348
|
+
id: string;
|
|
349
|
+
command: string;
|
|
350
|
+
args: string[];
|
|
351
|
+
purpose: string;
|
|
352
|
+
kind: "package-script";
|
|
353
|
+
script: string;
|
|
354
|
+
expectedScript: string;
|
|
355
|
+
execution: {
|
|
356
|
+
backend: "none" | "oci";
|
|
357
|
+
approval: "required";
|
|
358
|
+
};
|
|
359
|
+
} | {
|
|
360
|
+
id: string;
|
|
361
|
+
command: string;
|
|
362
|
+
args: string[];
|
|
363
|
+
purpose: string;
|
|
364
|
+
kind: "argv";
|
|
365
|
+
execution: {
|
|
366
|
+
backend: "oci";
|
|
367
|
+
approval: "required";
|
|
368
|
+
network: "none";
|
|
369
|
+
};
|
|
370
|
+
})[];
|
|
371
|
+
humanReview: {
|
|
372
|
+
id: string;
|
|
373
|
+
requirement: string;
|
|
374
|
+
status: "pending";
|
|
375
|
+
}[];
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
taskId: string;
|
|
379
|
+
}>;
|
|
380
|
+
/** Record a host preparation failure before any model invocation, retaining the original account.
|
|
381
|
+
* If authority cannot be acquired, the caller must leave the durable draft blocked, never downgrade to chat. */
|
|
382
|
+
export declare function persistClientTaskPreparationFailure(host: ZhivexHarness, state: AgentRunState, contract: ReturnType<typeof compileTaskAcceptanceContract>['contract']): Promise<void>;
|
|
383
|
+
/** Account exclusion is the same exclusion used for task admission; run CAS alone is insufficient. */
|
|
384
|
+
export declare function keepClientTask(host: ZhivexHarness, runId: string, allowedRunIds: readonly string[], expected: {
|
|
385
|
+
runRevision: number;
|
|
386
|
+
contractDigest: string;
|
|
387
|
+
snapshotDigest: string;
|
|
388
|
+
budgetRevision: number;
|
|
389
|
+
gitIdentity: string;
|
|
390
|
+
}): Promise<{
|
|
391
|
+
schemaVersion: number;
|
|
392
|
+
kind: string;
|
|
393
|
+
runId: string;
|
|
394
|
+
contractDigest: string;
|
|
395
|
+
contractRevision: number;
|
|
396
|
+
snapshotDigest: string;
|
|
397
|
+
reviewedRunRevision: number;
|
|
398
|
+
at: number;
|
|
399
|
+
provenance: string;
|
|
400
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ZhivexHarness } from '../runtime/harness.js';
|
|
2
|
+
import { type HarnessTaskProjection, type HarnessTaskProjectionScope } from './task-projection.js';
|
|
3
|
+
export type TaskProjectionCause = 'UNSUPPORTED_VERSION' | 'UNSUPPORTED_HOST' | 'OUT_OF_SCOPE' | 'CONTRACT_UNAVAILABLE' | 'EVIDENCE_UNAVAILABLE' | 'SNAPSHOT_CHANGED' | 'PAYLOAD_LIMIT';
|
|
4
|
+
export declare class TaskProjectionFault extends Error {
|
|
5
|
+
readonly causeCode: TaskProjectionCause;
|
|
6
|
+
constructor(causeCode: TaskProjectionCause);
|
|
7
|
+
}
|
|
8
|
+
export declare function redactTaskDisplayText(host: ZhivexHarness, raw: string, sensitiveValues?: readonly string[]): string;
|
|
9
|
+
/** Derivation only: no session refresh, ledger creation, state save, checks or model calls. */
|
|
10
|
+
export declare function projectHarnessTask(host: ZhivexHarness, request: HarnessTaskProjectionScope & {
|
|
11
|
+
sequence: number;
|
|
12
|
+
}, allowedRunIds: readonly string[], sensitiveValues?: readonly string[]): Promise<HarnessTaskProjection>;
|