@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,11 +1,15 @@
1
1
  import {
2
2
  VERTEX_ENVIRONMENT,
3
+ azureOpenAIConfigured,
4
+ bedrockConfigured,
5
+ createAzureOpenAIModel,
6
+ createBedrockModel,
3
7
  createVertexModel,
4
8
  vertexConfigured
5
- } from "./index-m49jx72n.js";
9
+ } from "./index-c39197wq.js";
6
10
  import {
7
11
  bundledDefaultModel
8
- } from "./index-xqxeypt5.js";
12
+ } from "./index-mzydbzp8.js";
9
13
  import {
10
14
  HarnessConfigError,
11
15
  HarnessProviderError
@@ -323,7 +327,7 @@ import { createAnthropic } from "@zhivex-ai/anthropic";
323
327
  import { createGemini } from "@zhivex-ai/gemini";
324
328
  import { createOpenAI } from "@zhivex-ai/openai";
325
329
  import { createQwen } from "@zhivex-ai/qwen";
326
- var PROVIDERS = ["meta", "qwen", "openai", "gemini", "anthropic", "vertex"];
330
+ var PROVIDERS = ["meta", "qwen", "openai", "gemini", "anthropic", "vertex", "bedrock", "azure-openai"];
327
331
  var HARNESS_PROVIDER_CAPABILITIES = [
328
332
  "streaming",
329
333
  "tool-calling",
@@ -542,13 +546,13 @@ var createProviderRegistry = (registrations) => {
542
546
  const credentials = Object.freeze(registration.descriptor.credentialNames.map((name) => Object.freeze({ name, present: Boolean(env[name]?.trim()) })));
543
547
  return Object.freeze({
544
548
  ...registration.descriptor,
545
- configured: registration.descriptor.id === "vertex" ? vertexConfigured(env) : credentials.length === 0 || credentials.some((credential) => credential.present),
549
+ configured: builtinConfigured(registration.descriptor.id, env, credentials),
546
550
  credentials,
547
551
  configuration: providerConfiguration(registration.diagnostics, env)
548
552
  });
549
553
  })),
550
554
  transportFingerprint: (env = process.env) => {
551
- const transport = frozenRegistrations.filter((registration) => (registration.descriptor.id !== "anthropic" || Boolean(env.ANTHROPIC_BASE_URL?.trim())) && (registration.descriptor.id !== "vertex" || VERTEX_ENVIRONMENT.some((name) => Boolean(env[name]?.trim())))).map((registration) => {
555
+ const transport = frozenRegistrations.filter((registration) => includeTransport(registration.descriptor.id, env)).map((registration) => {
552
556
  const names = [
553
557
  registration.diagnostics.endpointEnvironmentVariable,
554
558
  ...(registration.diagnostics.presence ?? []).map((entry) => entry.environmentVariable),
@@ -568,6 +572,27 @@ var createProviderRegistry = (registrations) => {
568
572
  });
569
573
  return registry;
570
574
  };
575
+ var environmentPresent = (env, names) => names.some((name) => Boolean(env[name]?.trim()));
576
+ var builtinConfigured = (id, env, credentials) => {
577
+ if (id === "vertex")
578
+ return vertexConfigured(env);
579
+ if (id === "bedrock")
580
+ return bedrockConfigured(env);
581
+ if (id === "azure-openai")
582
+ return azureOpenAIConfigured(env);
583
+ return credentials.length === 0 || credentials.some((credential) => credential.present);
584
+ };
585
+ var includeTransport = (id, env) => {
586
+ if (id === "anthropic")
587
+ return Boolean(env.ANTHROPIC_BASE_URL?.trim());
588
+ if (id === "vertex")
589
+ return environmentPresent(env, VERTEX_ENVIRONMENT);
590
+ if (id === "bedrock")
591
+ return bedrockConfigured(env);
592
+ if (id === "azure-openai")
593
+ return azureOpenAIConfigured(env);
594
+ return true;
595
+ };
571
596
  var optionalQwenRegion = (value) => {
572
597
  if (!value) {
573
598
  return;
@@ -797,6 +822,48 @@ var BUILTIN_PROVIDER_REGISTRATIONS = Object.freeze([
797
822
  ...baseURL ? { baseURL } : {}
798
823
  })(model);
799
824
  }
825
+ },
826
+ {
827
+ descriptor: {
828
+ id: "bedrock",
829
+ name: "Amazon Bedrock",
830
+ defaultModel: bundledDefaultModel("bedrock"),
831
+ credentialNames: ["BEDROCK_API_KEY", "AWS_BEARER_TOKEN_BEDROCK"],
832
+ capabilities: HARNESS_PROVIDER_CAPABILITIES,
833
+ support: "provisional"
834
+ },
835
+ diagnostics: {
836
+ endpointEnvironmentVariable: "BEDROCK_OPENAI_BASE_URL",
837
+ presence: [
838
+ { key: "region", environmentVariable: "AWS_REGION" },
839
+ { key: "defaultRegion", environmentVariable: "AWS_DEFAULT_REGION" },
840
+ { key: "profile", environmentVariable: "AWS_PROFILE" }
841
+ ],
842
+ enums: [{
843
+ key: "runtime",
844
+ environmentVariable: "BEDROCK_RUNTIME",
845
+ allowedValues: ["converse", "openai"]
846
+ }]
847
+ },
848
+ factory: ({ model, env }) => createBedrockModel(model, env)
849
+ },
850
+ {
851
+ descriptor: {
852
+ id: "azure-openai",
853
+ name: "Azure OpenAI",
854
+ defaultModel: bundledDefaultModel("azure-openai"),
855
+ credentialNames: ["AZURE_OPENAI_API_KEY"],
856
+ capabilities: HARNESS_PROVIDER_CAPABILITIES,
857
+ support: "provisional"
858
+ },
859
+ diagnostics: {
860
+ endpointEnvironmentVariable: "AZURE_OPENAI_ENDPOINT",
861
+ presence: [
862
+ { key: "apiVersion", environmentVariable: "AZURE_OPENAI_API_VERSION" },
863
+ { key: "deployments", environmentVariable: "AZURE_OPENAI_DEPLOYMENTS" }
864
+ ]
865
+ },
866
+ factory: ({ model, env }) => createAzureOpenAIModel(model, env)
800
867
  }
801
868
  ]);
802
869
  var DEFAULT_PROVIDER_REGISTRY = createProviderRegistry(BUILTIN_PROVIDER_REGISTRATIONS);
@@ -1218,7 +1285,7 @@ var resolveHarnessConfig = (input = {}, registry = DEFAULT_PROVIDER_REGISTRY) =>
1218
1285
  var createProviderModel = (config, env = process.env, registry = DEFAULT_PROVIDER_REGISTRY) => {
1219
1286
  try {
1220
1287
  const model = registry.createModel(config, env);
1221
- return registry === DEFAULT_PROVIDER_REGISTRY && ["anthropic", "openai", "gemini", "vertex", "qwen"].includes(config.provider) ? markTaskTransportModel(model) : model;
1288
+ return registry === DEFAULT_PROVIDER_REGISTRY && ["anthropic", "openai", "gemini", "vertex", "qwen", "bedrock", "azure-openai"].includes(config.provider) ? markTaskTransportModel(model) : model;
1222
1289
  } catch (error) {
1223
1290
  throw new HarnessProviderError(`Provider ${config.provider} could not be initialized.`, {
1224
1291
  cause: error,
@@ -0,0 +1,269 @@
1
+ // package.json
2
+ var package_default = {
3
+ name: "@zhivex-ai/harness",
4
+ version: "1.4.1",
5
+ description: "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
6
+ type: "module",
7
+ license: "MIT",
8
+ repository: {
9
+ type: "git",
10
+ url: "git+https://github.com/Zhivex/zhivex-harness.git"
11
+ },
12
+ bugs: {
13
+ url: "https://github.com/Zhivex/zhivex-harness/issues"
14
+ },
15
+ homepage: "https://github.com/Zhivex/zhivex-harness#readme",
16
+ publishConfig: {
17
+ access: "public",
18
+ provenance: true,
19
+ registry: "https://registry.npmjs.org/"
20
+ },
21
+ keywords: [
22
+ "ai",
23
+ "agents",
24
+ "coding-agent",
25
+ "agent-runtime",
26
+ "agent-governance",
27
+ "change-control",
28
+ "policy-as-code",
29
+ "software-supply-chain",
30
+ "sandbox",
31
+ "durable-workflows",
32
+ "mcp",
33
+ "docker",
34
+ "typescript",
35
+ "node",
36
+ "bun",
37
+ "harness",
38
+ "zhivex"
39
+ ],
40
+ bin: {
41
+ "zhivex-harness": "./dist/cli.js",
42
+ zhx: "./dist/zhx.js",
43
+ "zhx-acp": "./dist/acp-cli.js"
44
+ },
45
+ exports: {
46
+ ".": {
47
+ types: "./dist/index.d.ts",
48
+ import: "./dist/index.js"
49
+ },
50
+ "./engine": {
51
+ types: "./dist/engine/index.d.ts",
52
+ import: "./dist/engine/index.js"
53
+ },
54
+ "./protocol": {
55
+ types: "./dist/engine/protocol.d.ts",
56
+ import: "./dist/engine/protocol.js"
57
+ },
58
+ "./client": {
59
+ types: "./dist/engine/client.d.ts",
60
+ import: "./dist/engine/client.js"
61
+ },
62
+ "./service": {
63
+ types: "./dist/engine/service.d.ts",
64
+ import: "./dist/engine/service.js"
65
+ },
66
+ "./acp": {
67
+ types: "./dist/engine/acp.d.ts",
68
+ import: "./dist/engine/acp.js"
69
+ },
70
+ "./code-support": {
71
+ types: "./dist/compat/code-support.d.ts",
72
+ import: "./dist/compat/code-support.js"
73
+ },
74
+ "./models": {
75
+ types: "./dist/engine/models.d.ts",
76
+ import: "./dist/engine/models.js"
77
+ },
78
+ "./desktop/v1/state": {
79
+ types: "./dist/engine/desktop-state-v1.d.ts",
80
+ import: "./dist/engine/desktop-state-v1.js"
81
+ },
82
+ "./desktop/v1/providers": {
83
+ types: "./dist/engine/desktop-providers-v1.d.ts",
84
+ import: "./dist/engine/desktop-providers-v1.js"
85
+ },
86
+ "./mcp/stdio/v1": {
87
+ types: "./dist/engine/mcp-stdio-v1.d.ts",
88
+ import: "./dist/engine/mcp-stdio-v1.js"
89
+ },
90
+ "./audit": {
91
+ types: "./dist/audit/index.d.ts",
92
+ import: "./dist/audit/index.js"
93
+ }
94
+ },
95
+ files: [
96
+ "dist",
97
+ "README.md",
98
+ "CHANGELOG.md",
99
+ "SECURITY.md",
100
+ "SUPPORT.md",
101
+ "LICENSE",
102
+ "docs/CHANGE_ENVELOPES.md",
103
+ "docs/CLI.md",
104
+ "docs/WEB_LIMITS.md",
105
+ "docs/CODE_RELEASE.md",
106
+ "docs/CODE_WEB_TASKS.md",
107
+ "docs/images/cli-conversation.png",
108
+ "docs/CLIENT_PROTOCOL.md",
109
+ "docs/CONTEXT_ENGINEERING.md",
110
+ "docs/CREDENTIALS.md",
111
+ "docs/MODEL_CATALOG.md",
112
+ "docs/DEPRECATIONS.md",
113
+ "docs/DURABLE_OPERATIONS.md",
114
+ "docs/EXECUTION_ENVIRONMENTS.md",
115
+ "docs/EXTENSIBILITY.md",
116
+ "docs/FIRST_USE.md",
117
+ "docs/FIRST_USE_EXAMPLE.md",
118
+ "docs/HOSTILE_REPOSITORY_DEMO.md",
119
+ "docs/LOCAL_SERVICE.md",
120
+ "docs/PUBLIC_SECURITY.md",
121
+ "docs/README.md",
122
+ "docs/REPOSITORY_EDITING.md",
123
+ "docs/STABILITY.md",
124
+ "docs/SUPPORT_MATRIX.md",
125
+ "docs/SUPPORT_MATRIX_1_1.md",
126
+ "docs/THREAT_MODEL.md",
127
+ "docs/TIME_TO_SAFE_FIX.md",
128
+ "docs/USAGE.md",
129
+ "docs/support-matrix.json",
130
+ "docs/support-matrix-1.1.json",
131
+ "contracts",
132
+ "examples",
133
+ "fixtures",
134
+ "evaluations/*.json",
135
+ "evaluations/*.jsonl",
136
+ "benchmarks/README.md",
137
+ "docs/ACP.md",
138
+ "docs/WORKSPACE_CHECKPOINTS.md",
139
+ "docs/ENGINE_API.md",
140
+ "docs/ANTHROPIC.md",
141
+ "docs/MCP_STDIO.md",
142
+ "docs/adr/0002-isolated-mcp-stdio.md",
143
+ "docs/VERTEX.md",
144
+ "docs/BEDROCK.md",
145
+ "docs/AZURE_OPENAI.md",
146
+ "docs/TOOL_POLICY.md",
147
+ "docs/fixtures/mcp-stdio-contract-v1.json",
148
+ "docs/PROJECT_MEMORY.md",
149
+ "docs/MINIMUM_TASK_AUTHORITY.md",
150
+ "docs/MINIMUM_OFFLINE_EVALS.md",
151
+ "docs/AUDIT_PACK.md"
152
+ ],
153
+ scripts: {
154
+ "models:check": "bun run scripts/validate-model-catalog.ts",
155
+ "models:import": "bun run scripts/generate-console-models.ts",
156
+ dev: "bun run build && node --env-file-if-exists=.env dist/cli.js",
157
+ start: "node dist/cli.js",
158
+ build: "bun run scripts/clean-dist.ts && bun build ./src/index.ts ./src/service-cli.ts ./src/acp-cli.ts ./src/audit/index.ts ./src/engine/index.ts ./src/engine/protocol.ts ./src/engine/client.ts ./src/engine/service.ts ./src/engine/acp.ts ./src/engine/models.ts ./src/engine/desktop-state-v1.ts ./src/engine/desktop-providers-v1.ts ./src/compat/code-support.ts ./src/engine/mcp-stdio-v1.ts --root ./src --outdir ./dist --target node --packages external --splitting && bun build ./src/engine/protocol.ts ./src/engine/models.ts --outdir ./dist/engine --target browser --packages external && bun build ./src/cli-entry.ts --outdir ./dist --target node --packages external --splitting && mv ./dist/cli-entry.js ./dist/cli.js && cp ./dist/cli.js ./dist/zhx.js && bun build ./scripts/verify-historical-migrations.ts --outfile ./dist/verify-historical-migrations.js --target node --packages external && bun build ./scripts/hostile-repository-demo.ts --outfile ./dist/hostile-repository-demo.js --target node --packages external && tsc --emitDeclarationOnly",
159
+ prepack: "bun run build",
160
+ "architecture:check": "bun run scripts/check-architecture.ts",
161
+ "docs:check": "bun run scripts/check-docs.ts",
162
+ "contract:check": "bun run scripts/check-1-0-readiness.ts",
163
+ "contract:signatures:update": "bun run scripts/generate-stable-api-signatures.ts --write",
164
+ "migration:check": "bun run scripts/verify-historical-migrations.ts",
165
+ "readiness:1.0": "bun run scripts/check-1-0-readiness.ts",
166
+ "readiness:1.0:release": "bun run scripts/check-1-0-readiness.ts --release",
167
+ typecheck: "tsc --noEmit",
168
+ test: "bun test --preload ./tests/preload-bedrock-mock.ts ./tests ./desktop/tests",
169
+ evaluate: "bun run scripts/evaluate.ts",
170
+ "benchmark:workspace": "bun run scripts/benchmark-workspace.ts",
171
+ "benchmark:workspace:ci": "bun run scripts/benchmark-workspace.ts --files 1000 --page-size 100 --repetitions 3 --warmups 0",
172
+ "benchmark:oci": "bun run scripts/benchmark-oci.ts",
173
+ "benchmark:safe-fix": "bun run scripts/benchmark-time-to-safe-fix.ts",
174
+ "benchmark:safe-fix:ci": "bun run scripts/benchmark-time-to-safe-fix.ts --tasks 2 --repetitions 1 --profiles direct,governed,optimized --carriers rule_file --summary",
175
+ "benchmark:safe-fix:live": "bun --env-file=.env run scripts/benchmark-time-to-safe-fix.ts --driver-zhivex",
176
+ "benchmark:safe-fix:live:smoke": "bun --env-file=.env run scripts/benchmark-time-to-safe-fix.ts --tasks 2 --repetitions 1 --profiles direct,governed,optimized --carriers rule_file --driver-zhivex --summary",
177
+ "benchmark:safe-fix:live:expanded": "bun --env-file=.env run scripts/benchmark-time-to-safe-fix.ts --dataset evaluations/time-to-safe-fix-expanded.jsonl --dataset-name zhivex-time-to-safe-fix-expanded --tasks 12 --repetitions 3 --profiles direct,governed,optimized --carriers rule_file --driver-zhivex --driver-timeout-ms 300000 --summary",
178
+ "benchmark:safe-fix:baseline": "bun run scripts/create-time-to-safe-fix-baseline.ts",
179
+ "benchmark:safe-fix:image:check": "bun run scripts/build-time-to-safe-fix-image.ts --validate-only",
180
+ "benchmark:safe-fix:image:build": "bun run scripts/build-time-to-safe-fix-image.ts",
181
+ "smoke:package": "bun run build && bun run scripts/package-smoke.ts",
182
+ "smoke:artifact": "bun run scripts/package-smoke.ts",
183
+ "smoke:mcp": "bun run scripts/mcp-interoperability-smoke.ts",
184
+ "smoke:mcp:official": "bun run scripts/mcp-official-sdk-smoke.ts",
185
+ "smoke:oci": "bun run scripts/oci-execution-smoke.ts",
186
+ "smoke:live": "bun --env-file=.env run scripts/live-provider-smoke.ts",
187
+ "smoke:live:orchestration": "bun --env-file=.env run scripts/live-orchestration-smoke.ts",
188
+ "smoke:live:routing": "bun --env-file=.env run scripts/live-routing-smoke.ts",
189
+ "smoke:live:execution": "bun --env-file=.env run scripts/live-execution-smoke.ts",
190
+ "demo:hostile": "bun run dist/hostile-repository-demo.js",
191
+ "artifact:check": "bun run scripts/check-release-artifact.ts",
192
+ "pack:inspect": "bun run build && bun pm pack --dry-run --ignore-scripts",
193
+ check: "bun run architecture:check && bun run docs:check && bun run contract:check && bun run typecheck && bun run typecheck:tooling && bun run test && bun run migration:check && bun run evaluate && bun run benchmark:workspace:ci && bun run benchmark:safe-fix:image:check && bun run benchmark:safe-fix:ci && bun run smoke:mcp && bun run smoke:mcp:official && bun run smoke:oci && bun run smoke:package",
194
+ "check:sdk-redaction": "bun run scripts/diagnostics/reproduce-redaction-state-divergence.ts --require-fixed",
195
+ "release:check": "bun run release:preflight && bun run check:sdk-redaction && bun run check && bun run scripts/audit-dependencies.ts && bun pm untrusted && bun run pack:inspect && bun run scripts/check-release-readiness.ts",
196
+ "release:status": "bun run scripts/check-registry-release-status.ts",
197
+ "release:verify": "bun run scripts/verify-registry-release.ts",
198
+ "benchmark:workspace:scale": "bun run scripts/benchmark-workspace.ts --files 10000 --directories 100 --file-bytes 4096 --page-size 100 --repetitions 5 --warmups 1",
199
+ "evaluate:continuity": "bun test tests/compaction.test.ts tests/harness.test.ts",
200
+ "benchmark:swebench": "bun run scripts/benchmark-swebench.ts",
201
+ "benchmark:swebench:test": "bun test tests/swebench.test.ts",
202
+ "typecheck:tooling": "tsc -p tsconfig.tooling.json",
203
+ service: "node dist/service-cli.js",
204
+ "smoke:console": "bun run build && python3 scripts/console-pty-smoke.py && python3 scripts/console-entry-smoke.py",
205
+ "smoke:credentials": "node --experimental-strip-types scripts/credential-store-smoke.ts",
206
+ "release:preflight": "bun run scripts/release-preflight.ts",
207
+ "release:prepare": "bun run scripts/prepare-release.ts",
208
+ "build:code": "bun run --cwd packages/code build",
209
+ "test:code": "bun run --cwd packages/code test",
210
+ "smoke:engine-code": "bun run scripts/smoke-engine-code.ts",
211
+ "smoke:state-upgrade": "bun run scripts/smoke-state-upgrade.ts",
212
+ "smoke:global-code": "node scripts/smoke-global-code.mjs",
213
+ "dev:code": "bun run build && bun run packages/code/scripts/link-local-engine.ts && bun run build:code",
214
+ "typecheck:code": "bun run --cwd packages/code typecheck",
215
+ "evaluate:tasks": "bun run scripts/task-acceptance.ts",
216
+ "prepare:desktop": "bun run build && bun pm pack --ignore-scripts --quiet --filename desktop/.harness-candidate.tgz && bun run desktop/scripts/prepare-harness.ts desktop/.harness-candidate.tgz",
217
+ "smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts"
218
+ },
219
+ dependencies: {
220
+ "@zhivex-ai/agents": "1.11.0",
221
+ "@zhivex-ai/anthropic": "0.14.0",
222
+ "@zhivex-ai/azure-openai": "0.7.8",
223
+ "@zhivex-ai/bedrock": "2.0.7",
224
+ "@zhivex-ai/core": "1.34.0",
225
+ "@zhivex-ai/gemini": "0.13.0",
226
+ "@zhivex-ai/meta": "0.2.9",
227
+ "@zhivex-ai/openai": "0.16.0",
228
+ "@zhivex-ai/qwen": "0.16.4",
229
+ "@zhivex-ai/vertex": "1.2.7",
230
+ "google-auth-library": "11.1.0",
231
+ zod: "4.6.5"
232
+ },
233
+ overrides: {
234
+ "@zhivex-ai/core": "1.34.0"
235
+ },
236
+ devDependencies: {
237
+ "@agentclientprotocol/sdk": "1.8.0",
238
+ "@modelcontextprotocol/server": "2.3.1",
239
+ "@types/bun": "1.4.2",
240
+ "@types/node": "^26.6.5",
241
+ typescript: "7.0.2",
242
+ "typescript-compiler-api": "npm:typescript@6.0.3"
243
+ },
244
+ engines: {
245
+ node: ">=22.13.0",
246
+ bun: ">=1.4.0"
247
+ },
248
+ packageManager: "bun@1.4.0",
249
+ optionalDependencies: {
250
+ "@napi-rs/keyring": "2.1.1"
251
+ }
252
+ };
253
+
254
+ // src/version.ts
255
+ var packageMetadata = package_default;
256
+ if (typeof packageMetadata.version !== "string" || packageMetadata.version.length === 0) {
257
+ throw new Error("package.json must contain a non-empty version.");
258
+ }
259
+ if (typeof packageMetadata.engines?.node !== "string" || packageMetadata.engines.node.length === 0) {
260
+ throw new Error("package.json must contain a non-empty engines.node requirement.");
261
+ }
262
+ if (typeof packageMetadata.engines?.bun !== "string" || packageMetadata.engines.bun.length === 0) {
263
+ throw new Error("package.json must contain a non-empty engines.bun requirement.");
264
+ }
265
+ var HARNESS_VERSION = packageMetadata.version;
266
+ var NODE_ENGINE_RANGE = packageMetadata.engines.node;
267
+ var BUN_ENGINE_RANGE = packageMetadata.engines.bun;
268
+
269
+ export { HARNESS_VERSION, NODE_ENGINE_RANGE, BUN_ENGINE_RANGE };
@@ -160,6 +160,24 @@ var harnessClientCommandSchema = z.discriminatedUnion("method", [
160
160
  z.object({ method: z.literal("restore.apply"), ...restore, ...mutation, expectedRevision: revision, reviewedProposalId: fileDigest }).strict(),
161
161
  z.object({ method: z.literal("restore.recoverFork"), ...restore, ...mutation, expectedRevision: revision, forkSessionId: id }).strict(),
162
162
  z.object({ method: z.literal("run.start"), ...session, ...mutation, expectedRevision: revision, prompt: z.string().min(1).max(64 * 1024) }).strict(),
163
+ z.object({
164
+ method: z.literal("task.start"),
165
+ ...session,
166
+ ...mutation,
167
+ expectedRevision: revision,
168
+ brief: z.strictObject({
169
+ goal: z.string().trim().min(1).max(2000),
170
+ paths: z.array(z.string().min(1).max(1024)).min(1).max(20),
171
+ checks: z.array(id).min(1).max(8),
172
+ constraints: z.array(z.string().trim().min(1).max(500)).max(8),
173
+ budget: z.strictObject({ inputTokens: z.number().int().positive().safe(), outputTokens: z.number().int().positive().safe(), totalTokens: z.number().int().positive().safe() })
174
+ })
175
+ }).strict(),
176
+ z.object({ method: z.literal("task.review"), ...run }).strict(),
177
+ z.object({ method: z.literal("task.keep"), ...run, ...mutation, reviewId: z.string().uuid() }).strict(),
178
+ z.object({ method: z.literal("task.revise"), ...run, ...mutation, reviewId: z.string().uuid(), correction: z.string().trim().min(1).max(500) }).strict(),
179
+ z.object({ method: z.literal("task.continue"), ...run, ...mutation, reviewId: z.string().uuid(), prompt: z.string().trim().min(1).max(2000) }).strict(),
180
+ z.object({ method: z.literal("task.get"), ...run, projectionVersion: z.number().int().nonnegative().safe() }).strict(),
163
181
  z.object({ method: z.literal("run.get"), ...run, includeReview: z.boolean().optional(), includeDiff: z.boolean().optional(), decisionOffset: z.number().int().min(0).max(512).optional() }).strict(),
164
182
  z.object({
165
183
  method: z.literal("approval.resolve"),
@@ -177,4 +195,94 @@ var harnessClientRequestSchema = z.object({
177
195
  command: harnessClientCommandSchema
178
196
  }).strict();
179
197
 
180
- export { CLI_JSON_SCHEMA_VERSION, CLI_EVENT_SCHEMA_VERSION, streamEventDocument, serializeStreamEvent, streamResultDocument, serializeStreamResult, HARNESS_CLIENT_PROTOCOL_VERSION, harnessClientCommandSchema, harnessClientRequestSchema };
198
+ // src/client/task-projection.ts
199
+ import { z as z2 } from "zod";
200
+ var HARNESS_TASK_PROJECTION_VERSION = 1;
201
+ var id2 = z2.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/);
202
+ var count = z2.number().int().nonnegative().safe();
203
+ var digest = z2.string().regex(/^sha256:[a-f0-9]{64}$/);
204
+ var text = z2.string().max(2048);
205
+ var tokens = z2.strictObject({ inputTokens: count, outputTokens: count, totalTokens: count });
206
+ var harnessTaskProjectionSchema = z2.strictObject({
207
+ schemaVersion: z2.literal(1),
208
+ connectionId: id2,
209
+ sequence: count,
210
+ projectId: id2,
211
+ sessionId: id2,
212
+ runId: id2,
213
+ task: z2.strictObject({
214
+ reference: digest,
215
+ contractRevision: count,
216
+ contractDigest: digest,
217
+ runRevision: count,
218
+ objective: text.nullable(),
219
+ objectiveSource: z2.enum(["operator_brief", "retained_operator_source", "unavailable"]),
220
+ observedRunId: id2,
221
+ historicalRequest: z2.boolean(),
222
+ execution: z2.enum(["created", "queued", "running", "waiting_approval", "cancel_requested", "completed", "failed", "cancelled", "timed_out", "unknown"]),
223
+ artifact: z2.strictObject({
224
+ observedDigest: digest.nullable(),
225
+ deliveredDigest: digest.nullable(),
226
+ correspondence: z2.enum(["current", "stale", "missing"]),
227
+ paths: z2.array(text).max(256),
228
+ contents: z2.literal("not_included")
229
+ }),
230
+ review: z2.strictObject({
231
+ structure: z2.enum(["verified", "incomplete"]),
232
+ semantic: z2.literal("pending"),
233
+ acceptance: z2.literal("not_recorded"),
234
+ human: z2.array(z2.strictObject({ id: text, requirement: text, status: z2.literal("pending") })).max(32),
235
+ checks: z2.array(z2.strictObject({ id: text, status: z2.enum(["confirmed", "missing", "missing_or_stale", "host_policy_changed"]), provenance: z2.literal("contract_snapshot_and_tool_journal") })).max(32)
236
+ }),
237
+ budget: z2.strictObject({
238
+ availability: z2.enum(["authoritative", "legacy_not_enabled"]),
239
+ revision: count.nullable(),
240
+ confirmed: tokens.nullable(),
241
+ reserved: tokens.nullable(),
242
+ unknown: tokens.nullable(),
243
+ remaining: tokens.nullable(),
244
+ limits: tokens.nullable(),
245
+ estimated: z2.null(),
246
+ estimation: z2.literal("not_separately_recorded"),
247
+ usageComplete: z2.boolean().nullable(),
248
+ admissionsClosed: z2.boolean().nullable(),
249
+ monetary: z2.strictObject({ estimatedConfirmedUsd: z2.number().finite().nonnegative().nullable(), reservedUsd: z2.number().finite().nonnegative().nullable(), unknownHeldUsd: z2.number().finite().nonnegative().nullable(), remainingUsd: z2.number().finite().nonnegative().nullable(), unknown: z2.boolean(), costKind: z2.literal("estimate-not-invoice") })
250
+ }),
251
+ effects: z2.strictObject({ readOnly: count, recorded: count, unknown: count, missingEvidence: z2.boolean(), automaticReplay: z2.literal(false), providerStopped: z2.literal("unconfirmed") }),
252
+ nextAction: z2.strictObject({
253
+ kind: z2.enum(["wait", "reconcile", "review_approval", "review_delivery", "explicit_continuation"]),
254
+ permitted: z2.literal("read_only"),
255
+ authorization: z2.literal("required_for_execution"),
256
+ preserves: z2.literal("contract_receipts_budget_and_effects"),
257
+ automaticReplay: z2.literal(false)
258
+ }),
259
+ diagnostic: z2.strictObject({ code: z2.enum(["EXECUTION_FAILED", "EXECUTION_CANCELLED", "EXECUTION_TIMED_OUT", "EVIDENCE_INCOMPLETE"]), cause: z2.enum(["execution_terminal_failure", "operator_or_runtime_cancellation", "execution_deadline", "receipts_missing_or_stale"]), impact: z2.literal("acceptance_not_established"), safeAction: z2.enum(["review_configuration", "reconcile", "review_delivery"]) }).nullable(),
260
+ reasons: z2.array(z2.string().regex(/^[A-Z][A-Z0-9_]{0,95}$/)).max(32),
261
+ provenance: z2.literal("host_durable_contract_journal_budget_and_fresh_native_snapshot"),
262
+ textTruncated: z2.boolean()
263
+ })
264
+ });
265
+ function reduceHarnessTaskProjection(current, incoming, expected) {
266
+ const inScope = (value) => ["connectionId", "projectId", "sessionId", "runId"].every((key) => value[key] === expected[key]);
267
+ const previous = harnessTaskProjectionSchema.safeParse(current);
268
+ const retained = previous.success && inScope(previous.data) ? previous.data : null;
269
+ let encoded;
270
+ try {
271
+ encoded = JSON.stringify(incoming);
272
+ } catch {
273
+ return { status: "refresh_required", snapshot: retained };
274
+ }
275
+ if (new TextEncoder().encode(encoded).length > 64 * 1024)
276
+ return { status: "refresh_required", snapshot: retained };
277
+ const parsed = harnessTaskProjectionSchema.safeParse(incoming);
278
+ if (!parsed.success || !inScope(parsed.data))
279
+ return { status: "refresh_required", snapshot: retained };
280
+ if (retained && parsed.data.sequence <= retained.sequence) {
281
+ if (parsed.data.sequence === retained.sequence && JSON.stringify(parsed.data) !== JSON.stringify(retained))
282
+ return { status: "refresh_required", snapshot: retained };
283
+ return { status: "ignored", snapshot: retained };
284
+ }
285
+ return { status: "applied", snapshot: parsed.data };
286
+ }
287
+
288
+ export { CLI_JSON_SCHEMA_VERSION, CLI_EVENT_SCHEMA_VERSION, streamEventDocument, serializeStreamEvent, streamResultDocument, serializeStreamResult, HARNESS_CLIENT_PROTOCOL_VERSION, harnessClientCommandSchema, harnessClientRequestSchema, HARNESS_TASK_PROJECTION_VERSION, harnessTaskProjectionSchema, reduceHarnessTaskProjection };
@@ -1,15 +1,17 @@
1
+ import {
2
+ withWorkspaceMutation
3
+ } from "./index-d9zkmhz3.js";
1
4
  import {
2
5
  TERMINAL_SESSION_RUN_STATUSES
3
- } from "./index-s2k2edts.js";
6
+ } from "./index-zxg4ve4j.js";
4
7
  import {
5
8
  SqliteDatabase,
6
9
  createEditProposal,
7
10
  fileDigestSchema,
8
11
  readRegularFileNoFollow,
9
12
  statRegularFileNoFollow,
10
- withWorkspaceMutation,
11
13
  workspaceFilePathSchema
12
- } from "./index-m34q25jj.js";
14
+ } from "./index-xdbkcccf.js";
13
15
 
14
16
  // src/persistence/workspace-checkpoints.ts
15
17
  import { createHash, randomUUID } from "node:crypto";
@@ -1,23 +1,25 @@
1
1
  import {
2
2
  workspaceCheckpointSchema,
3
3
  workspaceRestoreOperationSchema
4
- } from "./index-6dft2vev.js";
4
+ } from "./index-6599mpmy.js";
5
5
  import {
6
6
  HARNESS_OPERATIONS_SCHEMA_VERSION,
7
- HARNESS_SESSION_SCHEMA_VERSION,
8
7
  HARNESS_SQLITE_FILE,
9
- assertTaskBudgetBackupLinks,
10
8
  decodeProjectMemory,
11
- openCliSessionStore,
12
9
  openHarnessPersistence,
13
10
  projectMemoryRecordKey,
14
- sqliteAdapter,
11
+ sqliteAdapter
12
+ } from "./index-f6mqa5gk.js";
13
+ import {
14
+ HARNESS_SESSION_SCHEMA_VERSION,
15
+ assertTaskBudgetBackupLinks,
16
+ openCliSessionStore,
15
17
  validateStateDirectory
16
- } from "./index-s2k2edts.js";
18
+ } from "./index-zxg4ve4j.js";
17
19
  import {
18
20
  SqliteDatabase,
19
21
  readRegularFileChunksNoFollow
20
- } from "./index-m34q25jj.js";
22
+ } from "./index-xdbkcccf.js";
21
23
  import {
22
24
  HarnessStateConflictError,
23
25
  HarnessWorkspaceError
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  DEFAULT_PROVIDER_REGISTRY,
3
3
  HARNESS_SUBAGENT_PROFILES
4
- } from "./index-8zjmnyw5.js";
4
+ } from "./index-1265j7t2.js";
5
5
 
6
6
  // src/providers/routing.ts
7
7
  var routeError = (value) => new Error(`Invalid route: ${value}. Use <profile>=<provider>[:<model>].`);