@zhivex-ai/harness 1.2.0 → 1.3.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.
Files changed (164) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +9 -10
  3. package/contracts/engine-api.json +2921 -0
  4. package/contracts/public-api.json +267 -1
  5. package/contracts/stable-api-signatures.json +43 -43
  6. package/dist/acp-cli.js +137 -15002
  7. package/dist/approvals/approval-history.d.ts +22 -0
  8. package/dist/approvals/explicit-review.d.ts +24 -0
  9. package/dist/approvals/host-policy-identity.d.ts +3 -0
  10. package/dist/cli/arguments.d.ts +6 -2
  11. package/dist/cli/checkpoints.d.ts +230 -0
  12. package/dist/cli/cli-options.d.ts +2 -41
  13. package/dist/cli/cli-profiles.d.ts +4 -2
  14. package/dist/cli/cli-stream.d.ts +2 -167
  15. package/dist/cli/governance-report.d.ts +5 -0
  16. package/dist/cli/policy-decisions.d.ts +9 -0
  17. package/dist/cli/policy.d.ts +5 -0
  18. package/dist/cli/presentation.d.ts +3 -1
  19. package/dist/cli/run-document.d.ts +2 -91
  20. package/dist/cli/terminal/terminal-continuation.d.ts +2 -3
  21. package/dist/cli/terminal/terminal-ui.d.ts +4 -0
  22. package/dist/{cli-entry-c2f58zj2.js → cli-entry-ae7x44d4.js} +14969 -10731
  23. package/dist/{cli-entry-427869g9.js → cli-entry-d5788aay.js} +388 -47
  24. package/dist/cli-entry-ev76ezcd.js +656 -0
  25. package/dist/{cli-3jmy4h5h.js → cli-t7hrhayq.js} +918 -2223
  26. package/dist/cli.js +3 -5
  27. package/dist/client/acp-mcp-admission.d.ts +32 -0
  28. package/dist/client/acp-mcp-host.d.ts +19 -0
  29. package/dist/client/acp-mcp-session.d.ts +14 -0
  30. package/dist/client/acp-stdio.d.ts +2 -0
  31. package/dist/client/acp.d.ts +4 -1
  32. package/dist/client/adapter.d.ts +13 -1
  33. package/dist/client/continuation.d.ts +3 -0
  34. package/dist/client/json-contracts.d.ts +107 -4
  35. package/dist/client/local-service.d.ts +2 -0
  36. package/dist/client/protocol.d.ts +127 -1
  37. package/dist/client/run-document.d.ts +91 -0
  38. package/dist/client/service-events.d.ts +4 -0
  39. package/dist/client/stream.d.ts +167 -0
  40. package/dist/compat/cli-options.d.ts +53 -0
  41. package/dist/compat/code-support.d.ts +22 -0
  42. package/dist/compat/code-support.js +74 -0
  43. package/dist/{config-1k9t4jhh.js → config-c002f06f.js} +1 -1
  44. package/dist/config-j3jga5wh.js +61 -0
  45. package/dist/context/adaptive-compaction.d.ts +1 -0
  46. package/dist/context/compaction.d.ts +1 -1
  47. package/dist/context/request-measurements.d.ts +17 -0
  48. package/dist/context/request-projection.d.ts +10 -0
  49. package/dist/context/task-memory.d.ts +1 -0
  50. package/dist/engine/acp.d.ts +6 -0
  51. package/dist/engine/acp.js +205 -0
  52. package/dist/engine/client.d.ts +6 -0
  53. package/dist/engine/client.js +28 -0
  54. package/dist/engine/desktop-providers-v1.d.ts +4 -0
  55. package/dist/engine/desktop-providers-v1.js +18 -0
  56. package/dist/engine/desktop-state-v1.d.ts +10 -0
  57. package/dist/engine/desktop-state-v1.js +168 -0
  58. package/dist/engine/index.d.ts +73 -0
  59. package/dist/engine/index.js +977 -0
  60. package/dist/engine/mcp-stdio-v1.d.ts +11 -0
  61. package/dist/engine/mcp-stdio-v1.js +108 -0
  62. package/dist/engine/models.d.ts +3 -0
  63. package/dist/engine/models.js +894 -0
  64. package/dist/engine/protocol.d.ts +7 -0
  65. package/dist/engine/protocol.js +182 -0
  66. package/dist/engine/service.d.ts +5 -0
  67. package/dist/engine/service.js +28 -0
  68. package/dist/execution/acceptance-snapshot.d.ts +2 -0
  69. package/dist/execution/execution-environment.d.ts +10 -0
  70. package/dist/execution/mcp-oci-channel.d.ts +11 -0
  71. package/dist/execution/mcp-oci-server.d.ts +38 -0
  72. package/dist/execution/mcp-oci-workspace.d.ts +23 -0
  73. package/dist/execution/mcp-resource-recovery.d.ts +19 -0
  74. package/dist/execution/mcp-workspace-snapshot.d.ts +20 -0
  75. package/dist/hostile-repository-demo.js +3368 -1304
  76. package/dist/index-1bx83sw4.js +4 -0
  77. package/dist/index-2gz7jv7g.js +549 -0
  78. package/dist/{cli-entry-b1mfvmxe.js → index-2jrdcj6b.js} +72 -115
  79. package/dist/index-3ah1f369.js +356 -0
  80. package/dist/index-42gp2hy8.js +1555 -0
  81. package/dist/index-4jw3tvy8.js +301 -0
  82. package/dist/index-8705zxpr.js +145 -0
  83. package/dist/index-8vm2m34s.js +2080 -0
  84. package/dist/index-8zzhggxv.js +477 -0
  85. package/dist/index-a97bezbz.js +1073 -0
  86. package/dist/index-gq9xagx2.js +1343 -0
  87. package/dist/index-h0mqx2ed.js +1373 -0
  88. package/dist/index-jgrx804e.js +5589 -0
  89. package/dist/index-qfpz5y2v.js +174 -0
  90. package/dist/index-t60rva31.js +1004 -0
  91. package/dist/index-wg1sd3at.js +80 -0
  92. package/dist/index-xqxeypt5.js +888 -0
  93. package/dist/index-yb239ghk.js +961 -0
  94. package/dist/index-z0qxmkm2.js +3389 -0
  95. package/dist/index-z4e8d0ph.js +1768 -0
  96. package/dist/index.js +251 -18649
  97. package/dist/integrations/mcp-host-session.d.ts +26 -0
  98. package/dist/integrations/mcp-stdio-admission.d.ts +54 -0
  99. package/dist/integrations/mcp-stdio-client.d.ts +44 -0
  100. package/dist/integrations/mcp-stdio-framing.d.ts +18 -0
  101. package/dist/integrations/mcp-stdio-launch.d.ts +20 -0
  102. package/dist/integrations/mcp-stdio-session.d.ts +7 -0
  103. package/dist/integrations/mcp-stdio-tools.d.ts +12 -0
  104. package/dist/internal/desktop/catalog.d.ts +2 -0
  105. package/dist/internal/desktop/persistence.d.ts +2 -3
  106. package/dist/internal/desktop/providers.d.ts +1 -0
  107. package/dist/models/catalog.d.ts +2 -0
  108. package/dist/persistence/governance-context.d.ts +126 -0
  109. package/dist/persistence/governance-report.d.ts +299 -0
  110. package/dist/persistence/host-database-backup.d.ts +28 -0
  111. package/dist/persistence/mcp-execution-journal.d.ts +19 -0
  112. package/dist/persistence/mcp-reconciliation.d.ts +33 -0
  113. package/dist/persistence/mcp-resource-journal.d.ts +54 -0
  114. package/dist/persistence/workspace-checkpoints.d.ts +138 -0
  115. package/dist/providers/anthropic-continuation.d.ts +5 -0
  116. package/dist/providers/providers.d.ts +1 -1
  117. package/dist/providers/vertex-auth.d.ts +27 -0
  118. package/dist/runtime/delegation-contracts.d.ts +9 -0
  119. package/dist/runtime/delegation-correction.d.ts +9 -0
  120. package/dist/runtime/delegation-result.d.ts +73 -0
  121. package/dist/runtime/error-diagnostics.d.ts +86 -0
  122. package/dist/runtime/harness.d.ts +11 -1
  123. package/dist/runtime/policy-decisions.d.ts +66 -0
  124. package/dist/runtime/policy-inspection.d.ts +52 -0
  125. package/dist/runtime/provider-diagnostics.d.ts +1 -0
  126. package/dist/runtime/runtime-instructions.d.ts +8 -0
  127. package/dist/runtime/task-acceptance-checks.d.ts +103 -0
  128. package/dist/runtime/task-acceptance-delivery.d.ts +107 -0
  129. package/dist/runtime/task-acceptance-host.d.ts +20 -0
  130. package/dist/runtime/task-acceptance-record.d.ts +107 -0
  131. package/dist/runtime/task-acceptance-validation.d.ts +25 -0
  132. package/dist/runtime/task-acceptance.d.ts +47 -0
  133. package/dist/runtime/time-to-safe-fix.d.ts +83 -0
  134. package/dist/runtime/tool-policy-file.d.ts +23 -0
  135. package/dist/runtime/tool-policy-paths.d.ts +5 -0
  136. package/dist/runtime/tool-policy.d.ts +6 -0
  137. package/dist/service-cli.js +19 -14504
  138. package/dist/{service-client-cli-yx56n0hc.js → service-client-cli-kns4mf57.js} +307 -248
  139. package/dist/verify-historical-migrations.js +3314 -1251
  140. package/dist/workspace/path-policy.d.ts +4 -0
  141. package/dist/zhx.js +3 -5
  142. package/docs/ACP.md +14 -2
  143. package/docs/ANTHROPIC.md +33 -0
  144. package/docs/CLI.md +132 -0
  145. package/docs/CLIENT_PROTOCOL.md +45 -0
  146. package/docs/CODE_RELEASE.md +93 -0
  147. package/docs/ENGINE_API.md +319 -0
  148. package/docs/EXTENSIBILITY.md +46 -3
  149. package/docs/FIRST_USE.md +6 -6
  150. package/docs/LOCAL_SERVICE.md +13 -0
  151. package/docs/MCP_STDIO.md +20 -0
  152. package/docs/README.md +6 -0
  153. package/docs/STABILITY.md +9 -1
  154. package/docs/SUPPORT_MATRIX.md +1 -1
  155. package/docs/TOOL_POLICY.md +81 -0
  156. package/docs/VERTEX.md +50 -0
  157. package/docs/adr/0002-isolated-mcp-stdio.md +135 -0
  158. package/docs/fixtures/mcp-stdio-contract-v1.json +189 -0
  159. package/docs/support-matrix.json +2 -0
  160. package/evaluations/representative-assembly-matrix.json +64 -1
  161. package/evaluations/task-acceptance-routes.json +7 -0
  162. package/examples/README.md +1 -1
  163. package/package.json +74 -12
  164. package/dist/cli-entry-64pdp3k5.js +0 -17
@@ -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;