@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.
Files changed (117) hide show
  1. package/CHANGELOG.md +29 -10
  2. package/README.md +7 -5
  3. package/SUPPORT.md +2 -2
  4. package/contracts/client-protocol-v1.schema.json +593 -0
  5. package/contracts/engine-api.json +156 -0
  6. package/contracts/public-api.json +12 -0
  7. package/contracts/stable-api-signatures.json +33 -33
  8. package/dist/acp-cli.js +54 -20
  9. package/dist/audit/index.d.ts +3 -0
  10. package/dist/audit/index.js +482 -0
  11. package/dist/audit/pack.d.ts +72 -0
  12. package/dist/audit-pack-e4vaq7np.js +532 -0
  13. package/dist/cli/arguments.d.ts +3 -1
  14. package/dist/cli/audit-pack.d.ts +24 -0
  15. package/dist/cli/cli-credentials.d.ts +6 -0
  16. package/dist/cli/cli-profiles.d.ts +4 -2
  17. package/dist/cli/node-engine.d.ts +2 -0
  18. package/dist/{cli-2h37qyvg.js → cli-1cf4dcnj.js} +245 -642
  19. package/dist/{cli-entry-w0hterjs.js → cli-entry-3s63zn4w.js} +40 -13
  20. package/dist/cli-entry-7f0cen32.js +9990 -0
  21. package/dist/cli-entry-a890x3kq.js +10348 -0
  22. package/dist/{cli-entry-20w6nh0k.js → cli-entry-hdtfef27.js} +439 -19
  23. package/dist/cli-entry-rgs6bxmy.js +484 -0
  24. package/dist/cli.js +27 -2
  25. package/dist/client/json-contracts.d.ts +4 -0
  26. package/dist/client/protocol.d.ts +133 -0
  27. package/dist/client/task-control-host.d.ts +400 -0
  28. package/dist/client/task-projection-host.d.ts +12 -0
  29. package/dist/client/task-projection.d.ts +168 -0
  30. package/dist/compat/code-support.js +28 -22
  31. package/dist/{config-qt69hkqj.js → config-r9fdhce6.js} +3 -3
  32. package/dist/{config-j9624t6t.js → config-vyajmksy.js} +1 -1
  33. package/dist/engine/acp.js +15 -11
  34. package/dist/engine/client.js +14 -10
  35. package/dist/engine/desktop-providers-v1.d.ts +2 -0
  36. package/dist/engine/desktop-providers-v1.js +23 -3
  37. package/dist/engine/desktop-state-v1.js +11 -8
  38. package/dist/engine/index.d.ts +3 -0
  39. package/dist/engine/index.js +101 -554
  40. package/dist/engine/mcp-stdio-v1.js +8 -6
  41. package/dist/engine/models.js +76 -4
  42. package/dist/engine/protocol.d.ts +2 -0
  43. package/dist/engine/protocol.js +110 -0
  44. package/dist/engine/service.js +15 -11
  45. package/dist/hostile-repository-demo.js +1095 -505
  46. package/dist/{index-937cb7y8.js → index-02pqtbbg.js} +559 -33
  47. package/dist/{index-pp474137.js → index-0zs2dz26.js} +766 -931
  48. package/dist/{index-8zjmnyw5.js → index-1265j7t2.js} +73 -6
  49. package/dist/index-4fx5f3k5.js +269 -0
  50. package/dist/{index-nmjdwd4p.js → index-4gt045j0.js} +109 -1
  51. package/dist/{index-6dft2vev.js → index-6599mpmy.js} +5 -3
  52. package/dist/{index-tfzta544.js → index-74kkpyqk.js} +9 -7
  53. package/dist/{index-61gthdz6.js → index-8sm2a1wa.js} +1 -1
  54. package/dist/index-c39197wq.js +552 -0
  55. package/dist/{index-5jhgatga.js → index-crta5wzv.js} +7 -6
  56. package/dist/{index-m34q25jj.js → index-d9zkmhz3.js} +143 -824
  57. package/dist/{index-pdmevfxv.js → index-dtb2c6ds.js} +5 -259
  58. package/dist/index-f6mqa5gk.js +1535 -0
  59. package/dist/index-j6zxnc8m.js +490 -0
  60. package/dist/{index-rkbf7dqg.js → index-mv8sb1ns.js} +5 -3
  61. package/dist/{index-xqxeypt5.js → index-mzydbzp8.js} +76 -4
  62. package/dist/{index-wg1sd3at.js → index-qfsrrnz6.js} +1 -1
  63. package/dist/{index-m82cfspw.js → index-sk3cap35.js} +877 -963
  64. package/dist/index-sstgcsr0.js +511 -0
  65. package/dist/index-wm9xeq1n.js +329 -0
  66. package/dist/index-xdbkcccf.js +719 -0
  67. package/dist/{index-s2k2edts.js → index-zxg4ve4j.js} +41 -1548
  68. package/dist/index.d.ts +3 -0
  69. package/dist/index.js +93 -77
  70. package/dist/internal/desktop/providers.d.ts +2 -0
  71. package/dist/models/catalog.d.ts +2 -0
  72. package/dist/persistence/sqlite-database.d.ts +1 -0
  73. package/dist/providers/azure-openai.d.ts +14 -0
  74. package/dist/providers/bedrock.d.ts +23 -0
  75. package/dist/providers/providers.d.ts +1 -1
  76. package/dist/runtime/durable-review-group.d.ts +33 -0
  77. package/dist/runtime/harness.d.ts +11 -0
  78. package/dist/runtime/run-interruption.d.ts +7 -0
  79. package/dist/runtime/shared-budget.d.ts +30 -0
  80. package/dist/runtime/task-continuity.d.ts +300 -77
  81. package/dist/service-cli.js +15 -11
  82. package/dist/{service-client-cli-fn54ev6w.js → service-client-cli-eqrdc9zq.js} +400 -305
  83. package/dist/verify-historical-migrations.js +1095 -505
  84. package/dist/zhx.js +27 -2
  85. package/docs/AUDIT_PACK.md +99 -0
  86. package/docs/AZURE_OPENAI.md +53 -0
  87. package/docs/BEDROCK.md +56 -0
  88. package/docs/CLI.md +15 -0
  89. package/docs/CLIENT_PROTOCOL.md +178 -0
  90. package/docs/CODE_RELEASE.md +31 -1
  91. package/docs/CODE_WEB_TASKS.md +116 -0
  92. package/docs/CONTEXT_ENGINEERING.md +59 -0
  93. package/docs/CREDENTIALS.md +21 -0
  94. package/docs/DURABLE_OPERATIONS.md +93 -1
  95. package/docs/ENGINE_API.md +5 -2
  96. package/docs/EXTENSIBILITY.md +2 -2
  97. package/docs/FIRST_USE.md +6 -6
  98. package/docs/MINIMUM_TASK_AUTHORITY.md +3 -3
  99. package/docs/PROJECT_MEMORY.md +1 -1
  100. package/docs/README.md +6 -1
  101. package/docs/STABILITY.md +3 -1
  102. package/docs/SUPPORT_MATRIX.md +1 -1
  103. package/docs/SUPPORT_MATRIX_1_1.md +1 -1
  104. package/docs/USAGE.md +3 -1
  105. package/docs/VERTEX.md +2 -2
  106. package/docs/WEB_LIMITS.md +4 -3
  107. package/docs/adr/0002-isolated-mcp-stdio.md +6 -3
  108. package/docs/support-matrix-1.1.json +3 -1
  109. package/docs/support-matrix.json +6 -4
  110. package/evaluations/code-task-ui.json +20 -0
  111. package/evaluations/representative-assembly-matrix.json +10 -1
  112. package/evaluations/task-projection.json +10 -0
  113. package/evaluations/task-recovery-lab.json +60 -0
  114. package/examples/README.md +3 -3
  115. package/package.json +23 -13
  116. package/dist/cli-entry-4ngptr62.js +0 -19900
  117. package/dist/index-m49jx72n.js +0 -220
@@ -1,6 +1,9 @@
1
1
  import type { ZhivexHarness } from './harness.js';
2
2
  /** Internal read set, checked again inside task invocation admission. No new store or recovery credit. */
3
- export declare function readTaskContinuity(host: ZhivexHarness, taskId: string): Promise<{
3
+ export declare function readTaskContinuityEvidence(host: ZhivexHarness, taskId: string, options?: {
4
+ legacyRunId?: string;
5
+ allowedRunIds?: readonly string[];
6
+ }): Promise<{
4
7
  report: {
5
8
  schemaVersion: 1;
6
9
  taskId: string;
@@ -84,7 +87,7 @@ export declare function readTaskContinuity(host: ZhivexHarness, taskId: string):
84
87
  categories: string[];
85
88
  costKind: "estimate-not-invoice";
86
89
  };
87
- };
90
+ } | null;
88
91
  runs: {
89
92
  runId: string;
90
93
  revision: number | undefined;
@@ -216,92 +219,231 @@ export declare function readTaskContinuity(host: ZhivexHarness, taskId: string):
216
219
  automaticEffectReplay: false;
217
220
  };
218
221
  verify: () => Promise<void>;
222
+ verifyAll: () => Promise<void>;
219
223
  }>;
220
- /** Host-only Experimental inspection; no model, writes, approval, cancellation revival or replay. */
221
- export declare function inspectHarnessTaskContinuity(host: ZhivexHarness, taskId: string): Promise<{
222
- schemaVersion: 1;
223
- taskId: string;
224
- budget: {
224
+ /** Invocation admission always requires the existing authoritative budget. */
225
+ export declare function readTaskContinuity(host: ZhivexHarness, taskId: string): Promise<{
226
+ verify: () => Promise<void>;
227
+ verifyAll: () => Promise<void>;
228
+ report: {
225
229
  schemaVersion: 1;
226
230
  taskId: string;
227
- accountRunId: string;
228
- revision: number;
229
- limits: {
230
- inputTokens: number;
231
- outputTokens: number;
232
- totalTokens: number;
233
- };
234
- confirmed: {
235
- inputTokens: number;
236
- outputTokens: number;
237
- totalTokens: number;
238
- };
239
- reserved: {
240
- inputTokens: number;
241
- outputTokens: number;
242
- totalTokens: number;
243
- };
244
- unknown: {
245
- inputTokens: number;
246
- outputTokens: number;
247
- totalTokens: number;
248
- };
249
- remaining: {
250
- inputTokens: number;
251
- outputTokens: number;
252
- totalTokens: number;
253
- };
254
- usageComplete: boolean;
255
- admissionsClosed: boolean;
256
- invocationPending: boolean;
257
- activeRunId: string | null;
258
- runs: string[];
259
- coordinatorId: string;
260
- cancellations: {
231
+ runs: {
261
232
  runId: string;
262
- requestedAt: number;
263
- origin: "abort" | "lease_lost" | "operator" | "timeout";
264
- localToolsDrainedAt?: number | undefined;
265
- localExecution: "native_tools_drained" | "unconfirmed";
266
- remoteExecution: 'unconfirmed';
233
+ revision: number | undefined;
234
+ status: import("@zhivex-ai/core").AgentStatus;
235
+ ledger: {
236
+ schemaVersion: 1;
237
+ revisions: {
238
+ revision: number;
239
+ digest: string;
240
+ previousDigest: string | null;
241
+ contract: {
242
+ schemaVersion: 1;
243
+ taskId: string;
244
+ allowedWritePaths: string[];
245
+ protectedFiles: string[];
246
+ requiredChecks: ({
247
+ id: string;
248
+ command: string;
249
+ args: string[];
250
+ purpose: string;
251
+ kind: "package-script";
252
+ script: string;
253
+ expectedScript: string;
254
+ execution: {
255
+ backend: "none" | "oci";
256
+ approval: "required";
257
+ };
258
+ } | {
259
+ id: string;
260
+ command: string;
261
+ args: string[];
262
+ purpose: string;
263
+ kind: "argv";
264
+ execution: {
265
+ backend: "oci";
266
+ approval: "required";
267
+ network: "none";
268
+ };
269
+ })[];
270
+ humanReview: {
271
+ id: string;
272
+ requirement: string;
273
+ status: "pending";
274
+ }[];
275
+ };
276
+ }[];
277
+ };
278
+ sources: {
279
+ id: string;
280
+ text: string;
281
+ original?: true;
282
+ }[];
283
+ decisions: import("../approvals/approval-history.js").ApprovalDecisionView[];
284
+ decisionsAvailability: string;
285
+ briefStatus: string;
286
+ objective: string | null;
287
+ constraints: string[];
288
+ hostPolicyCompatible: boolean;
289
+ assistantResponses: {
290
+ id: string;
291
+ text: string;
292
+ truncated: boolean;
293
+ untrusted: boolean;
294
+ verified: boolean;
295
+ }[];
296
+ effects: {
297
+ id: string;
298
+ tool: string;
299
+ revision: number;
300
+ status: string;
301
+ retry: string;
302
+ }[];
303
+ checks: {
304
+ id: string;
305
+ status: string;
306
+ }[];
307
+ snapshot: import("./task-acceptance-checks.js").TaskCheckBinding | null;
308
+ delivery: {} | null;
309
+ humanReview: {
310
+ id: string;
311
+ requirement: string;
312
+ status: "pending";
313
+ }[];
314
+ fingerprint: import("@zhivex-ai/core").AgentHarnessBinding | null;
267
315
  }[];
268
- monetary: {
269
- schemaVersion: number;
270
- runId: string;
271
- calls: number;
272
- routes: {
273
- provider: string;
274
- model: string;
316
+ currentContract: {
317
+ revision: number;
318
+ digest: string;
319
+ previousDigest: string | null;
320
+ contract: {
321
+ schemaVersion: 1;
322
+ taskId: string;
323
+ allowedWritePaths: string[];
324
+ protectedFiles: string[];
325
+ requiredChecks: ({
326
+ id: string;
327
+ command: string;
328
+ args: string[];
329
+ purpose: string;
330
+ kind: "package-script";
331
+ script: string;
332
+ expectedScript: string;
333
+ execution: {
334
+ backend: "none" | "oci";
335
+ approval: "required";
336
+ };
337
+ } | {
338
+ id: string;
339
+ command: string;
340
+ args: string[];
341
+ purpose: string;
342
+ kind: "argv";
343
+ execution: {
344
+ backend: "oci";
345
+ approval: "required";
346
+ network: "none";
347
+ };
348
+ })[];
349
+ humanReview: {
350
+ id: string;
351
+ requirement: string;
352
+ status: "pending";
353
+ }[];
354
+ };
355
+ } | null;
356
+ reasons: string[];
357
+ nextAction: string;
358
+ authorization: 'none';
359
+ automaticEffectReplay: false;
360
+ budget: {
361
+ schemaVersion: 1;
362
+ taskId: string;
363
+ accountRunId: string;
364
+ revision: number;
365
+ limits: {
366
+ inputTokens: number;
367
+ outputTokens: number;
368
+ totalTokens: number;
369
+ };
370
+ confirmed: {
371
+ inputTokens: number;
372
+ outputTokens: number;
373
+ totalTokens: number;
374
+ };
375
+ reserved: {
376
+ inputTokens: number;
377
+ outputTokens: number;
378
+ totalTokens: number;
379
+ };
380
+ unknown: {
381
+ inputTokens: number;
382
+ outputTokens: number;
383
+ totalTokens: number;
384
+ };
385
+ remaining: {
386
+ inputTokens: number;
387
+ outputTokens: number;
388
+ totalTokens: number;
389
+ };
390
+ usageComplete: boolean;
391
+ admissionsClosed: boolean;
392
+ invocationPending: boolean;
393
+ activeRunId: string | null;
394
+ runs: string[];
395
+ coordinatorId: string;
396
+ cancellations: {
397
+ runId: string;
398
+ requestedAt: number;
399
+ origin: "abort" | "lease_lost" | "operator" | "timeout";
400
+ localToolsDrainedAt?: number | undefined;
401
+ localExecution: "native_tools_drained" | "unconfirmed";
402
+ remoteExecution: 'unconfirmed';
403
+ }[];
404
+ monetary: {
405
+ schemaVersion: number;
406
+ runId: string;
275
407
  calls: number;
408
+ routes: {
409
+ provider: string;
410
+ model: string;
411
+ calls: number;
412
+ inputTokens: number;
413
+ outputTokens: number;
414
+ unknownCalls: number;
415
+ estimatedUsd: number | null;
416
+ priceStatuses: string[];
417
+ }[];
276
418
  inputTokens: number;
277
419
  outputTokens: number;
278
- unknownCalls: number;
420
+ historicalUsageUnknown: boolean;
421
+ usageComplete: boolean;
279
422
  estimatedUsd: number | null;
280
- priceStatuses: string[];
281
- }[];
282
- inputTokens: number;
283
- outputTokens: number;
284
- historicalUsageUnknown: boolean;
285
- usageComplete: boolean;
286
- estimatedUsd: number | null;
287
- limitUsd: number | null;
288
- costKind: "estimate-not-invoice";
289
- };
290
- monetaryDetails: {
291
- schemaVersion: 1;
292
- confirmedCalls: number;
293
- reservedCalls: number;
294
- unknownCalls: number;
295
- lateCalls: number;
296
- estimatedConfirmedUsd: number | null;
297
- reservedUsd: number | null;
298
- unknownHeldUsd: number | null;
299
- remainingUsd: number | null;
300
- costComplete: boolean;
301
- categories: string[];
302
- costKind: "estimate-not-invoice";
423
+ limitUsd: number | null;
424
+ costKind: "estimate-not-invoice";
425
+ };
426
+ monetaryDetails: {
427
+ schemaVersion: 1;
428
+ confirmedCalls: number;
429
+ reservedCalls: number;
430
+ unknownCalls: number;
431
+ lateCalls: number;
432
+ estimatedConfirmedUsd: number | null;
433
+ reservedUsd: number | null;
434
+ unknownHeldUsd: number | null;
435
+ remainingUsd: number | null;
436
+ costComplete: boolean;
437
+ categories: string[];
438
+ costKind: "estimate-not-invoice";
439
+ };
303
440
  };
304
441
  };
442
+ }>;
443
+ /** Host-only Experimental inspection; no model, writes, approval, cancellation revival or replay. */
444
+ export declare function inspectHarnessTaskContinuity(host: ZhivexHarness, taskId: string): Promise<{
445
+ schemaVersion: 1;
446
+ taskId: string;
305
447
  runs: {
306
448
  runId: string;
307
449
  revision: number | undefined;
@@ -431,4 +573,85 @@ export declare function inspectHarnessTaskContinuity(host: ZhivexHarness, taskId
431
573
  nextAction: string;
432
574
  authorization: 'none';
433
575
  automaticEffectReplay: false;
576
+ budget: {
577
+ schemaVersion: 1;
578
+ taskId: string;
579
+ accountRunId: string;
580
+ revision: number;
581
+ limits: {
582
+ inputTokens: number;
583
+ outputTokens: number;
584
+ totalTokens: number;
585
+ };
586
+ confirmed: {
587
+ inputTokens: number;
588
+ outputTokens: number;
589
+ totalTokens: number;
590
+ };
591
+ reserved: {
592
+ inputTokens: number;
593
+ outputTokens: number;
594
+ totalTokens: number;
595
+ };
596
+ unknown: {
597
+ inputTokens: number;
598
+ outputTokens: number;
599
+ totalTokens: number;
600
+ };
601
+ remaining: {
602
+ inputTokens: number;
603
+ outputTokens: number;
604
+ totalTokens: number;
605
+ };
606
+ usageComplete: boolean;
607
+ admissionsClosed: boolean;
608
+ invocationPending: boolean;
609
+ activeRunId: string | null;
610
+ runs: string[];
611
+ coordinatorId: string;
612
+ cancellations: {
613
+ runId: string;
614
+ requestedAt: number;
615
+ origin: "abort" | "lease_lost" | "operator" | "timeout";
616
+ localToolsDrainedAt?: number | undefined;
617
+ localExecution: "native_tools_drained" | "unconfirmed";
618
+ remoteExecution: 'unconfirmed';
619
+ }[];
620
+ monetary: {
621
+ schemaVersion: number;
622
+ runId: string;
623
+ calls: number;
624
+ routes: {
625
+ provider: string;
626
+ model: string;
627
+ calls: number;
628
+ inputTokens: number;
629
+ outputTokens: number;
630
+ unknownCalls: number;
631
+ estimatedUsd: number | null;
632
+ priceStatuses: string[];
633
+ }[];
634
+ inputTokens: number;
635
+ outputTokens: number;
636
+ historicalUsageUnknown: boolean;
637
+ usageComplete: boolean;
638
+ estimatedUsd: number | null;
639
+ limitUsd: number | null;
640
+ costKind: "estimate-not-invoice";
641
+ };
642
+ monetaryDetails: {
643
+ schemaVersion: 1;
644
+ confirmedCalls: number;
645
+ reservedCalls: number;
646
+ unknownCalls: number;
647
+ lateCalls: number;
648
+ estimatedConfirmedUsd: number | null;
649
+ reservedUsd: number | null;
650
+ unknownHeldUsd: number | null;
651
+ remainingUsd: number | null;
652
+ costComplete: boolean;
653
+ categories: string[];
654
+ costKind: "estimate-not-invoice";
655
+ };
656
+ };
434
657
  }>;
@@ -2,19 +2,23 @@
2
2
  import {
3
3
  recoverHarnessLocalService,
4
4
  startHarnessLocalService
5
- } from "./index-5jhgatga.js";
6
- import"./index-937cb7y8.js";
7
- import"./index-6dft2vev.js";
5
+ } from "./index-crta5wzv.js";
6
+ import"./index-02pqtbbg.js";
7
+ import"./index-6599mpmy.js";
8
8
  import {
9
9
  createHarness
10
- } from "./index-pp474137.js";
11
- import"./index-s2k2edts.js";
12
- import"./index-pdmevfxv.js";
13
- import"./index-m34q25jj.js";
14
- import"./index-8zjmnyw5.js";
15
- import"./index-m49jx72n.js";
16
- import"./index-xqxeypt5.js";
17
- import"./index-nmjdwd4p.js";
10
+ } from "./index-0zs2dz26.js";
11
+ import"./index-f6mqa5gk.js";
12
+ import"./index-dtb2c6ds.js";
13
+ import"./index-d9zkmhz3.js";
14
+ import"./index-1265j7t2.js";
15
+ import"./index-c39197wq.js";
16
+ import"./index-mzydbzp8.js";
17
+ import"./index-wm9xeq1n.js";
18
+ import"./index-zxg4ve4j.js";
19
+ import"./index-4fx5f3k5.js";
20
+ import"./index-xdbkcccf.js";
21
+ import"./index-4gt045j0.js";
18
22
  import"./index-bpc596v3.js";
19
23
  import"./index-fm84men1.js";
20
24
  import"./index-1bx83sw4.js";