@zhivex-ai/harness 1.4.0-rc.8 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +124 -72
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +2 -2
  5. package/dist/acp-cli.js +13 -12
  6. package/dist/{cli-3bzvq594.js → cli-2h37qyvg.js} +4 -4
  7. package/dist/{cli-entry-yqwa1943.js → cli-entry-20w6nh0k.js} +321 -16
  8. package/dist/{cli-entry-25xefnws.js → cli-entry-4ngptr62.js} +3 -3
  9. package/dist/{cli-entry-qav71mxw.js → cli-entry-w0hterjs.js} +1 -1
  10. package/dist/cli.js +2 -2
  11. package/dist/compat/code-support.js +8 -7
  12. package/dist/{config-pwbnze4g.js → config-j9624t6t.js} +1 -1
  13. package/dist/{config-depqpsae.js → config-qt69hkqj.js} +4 -3
  14. package/dist/engine/acp.js +12 -11
  15. package/dist/engine/client.js +11 -10
  16. package/dist/engine/desktop-providers-v1.js +2 -1
  17. package/dist/engine/desktop-state-v1.js +8 -7
  18. package/dist/engine/index.js +15 -14
  19. package/dist/engine/mcp-stdio-v1.js +7 -6
  20. package/dist/engine/protocol.js +12 -0
  21. package/dist/engine/service.js +12 -11
  22. package/dist/hostile-repository-demo.js +322 -17
  23. package/dist/{index-1k248k0w.js → index-5jhgatga.js} +5 -5
  24. package/dist/{index-pcn2bk8j.js → index-61gthdz6.js} +1 -1
  25. package/dist/{index-sbzvrpm7.js → index-6dft2vev.js} +2 -2
  26. package/dist/{index-09zphhwt.js → index-8zjmnyw5.js} +2 -2
  27. package/dist/{index-txrqqd2r.js → index-937cb7y8.js} +6 -6
  28. package/dist/{index-jdb1q8yn.js → index-bpc596v3.js} +15 -10
  29. package/dist/index-fm84men1.js +239 -0
  30. package/dist/{index-zmx264xy.js → index-m34q25jj.js} +2 -2
  31. package/dist/index-m49jx72n.js +220 -0
  32. package/dist/{index-9v72fpya.js → index-m82cfspw.js} +16 -10
  33. package/dist/{index-ngg2168h.js → index-nmjdwd4p.js} +1 -1
  34. package/dist/{index-w9pjt7td.js → index-pdmevfxv.js} +3 -3
  35. package/dist/{index-nqhnh1hz.js → index-pp474137.js} +5 -5
  36. package/dist/{index-vga76vmb.js → index-rkbf7dqg.js} +2 -2
  37. package/dist/{index-fny13znr.js → index-s2k2edts.js} +3 -3
  38. package/dist/{index-7y6b4yjx.js → index-tfzta544.js} +4 -4
  39. package/dist/index.js +15 -14
  40. package/dist/providers/vertex-auth.d.ts +5 -1
  41. package/dist/runtime/error-diagnostics.d.ts +8 -0
  42. package/dist/runtime/provider-transient.d.ts +33 -0
  43. package/dist/runtime/time-to-safe-fix.d.ts +8 -0
  44. package/dist/service-cli.js +12 -11
  45. package/dist/{service-client-cli-ra3yzvjg.js → service-client-cli-fn54ev6w.js} +3 -3
  46. package/dist/verify-historical-migrations.js +322 -17
  47. package/dist/zhx.js +2 -2
  48. package/docs/CLI.md +1 -1
  49. package/docs/CODE_RELEASE.md +38 -1
  50. package/docs/FIRST_USE.md +6 -6
  51. package/docs/PROJECT_MEMORY.md +1 -1
  52. package/evaluations/representative-assembly-matrix.json +10 -1
  53. package/examples/README.md +5 -5
  54. package/package.json +1 -1
  55. package/dist/index-8705zxpr.js +0 -145
@@ -87,6 +87,8 @@ function providerDiagnostic(body, status) {
87
87
  reason = "permission";
88
88
  else if (["rate_limit_exceeded", "rate_limit_error", "RESOURCE_EXHAUSTED"].includes(code))
89
89
  reason = "rate_limit";
90
+ else if (["UNAVAILABLE", "DEADLINE_EXCEEDED", "ABORTED", "INTERNAL"].includes(code))
91
+ reason = "server_error";
90
92
  else if (["model_not_found", "model_not_available", "NOT_FOUND"].includes(code))
91
93
  reason = "model_unavailable";
92
94
  else if (["invalid_request_error", "INVALID_ARGUMENT"].includes(code) || status === 400 || status === 422)
@@ -97,6 +99,201 @@ function providerDiagnostic(body, status) {
97
99
  }
98
100
  }
99
101
 
102
+ // src/runtime/provider-transient.ts
103
+ var PROVIDER_STATUS_CATEGORIES = [
104
+ "ABORTED",
105
+ "RESOURCE_EXHAUSTED",
106
+ "UNAVAILABLE",
107
+ "DEADLINE_EXCEEDED",
108
+ "INTERNAL",
109
+ "STREAM_RESET"
110
+ ];
111
+ var VERTEX_TRANSIENT_ATTEMPTS = 3;
112
+ var TRANSIENT_HTTP = {
113
+ 408: "DEADLINE_EXCEEDED",
114
+ 409: "ABORTED",
115
+ 425: "UNAVAILABLE",
116
+ 429: "RESOURCE_EXHAUSTED",
117
+ 500: "INTERNAL",
118
+ 502: "UNAVAILABLE",
119
+ 503: "UNAVAILABLE",
120
+ 504: "DEADLINE_EXCEEDED"
121
+ };
122
+ var TRANSIENT_GRPC = {
123
+ 4: "DEADLINE_EXCEEDED",
124
+ 8: "RESOURCE_EXHAUSTED",
125
+ 10: "ABORTED",
126
+ 13: "INTERNAL",
127
+ 14: "UNAVAILABLE"
128
+ };
129
+ var CATEGORY_HTTP = {
130
+ ABORTED: 409,
131
+ RESOURCE_EXHAUSTED: 429,
132
+ UNAVAILABLE: 503,
133
+ DEADLINE_EXCEEDED: 504,
134
+ INTERNAL: 500,
135
+ STREAM_RESET: undefined
136
+ };
137
+ var SYMBOLIC = new Set(["ABORTED", "RESOURCE_EXHAUSTED", "UNAVAILABLE", "DEADLINE_EXCEEDED", "INTERNAL"]);
138
+ var STREAM_RESET_CODES = new Set(["ECONNRESET", "ECONNABORTED", "EPIPE", "ETIMEDOUT", "UND_ERR_SOCKET", "ERR_STREAM_PREMATURE_CLOSE"]);
139
+ var HTTP_IN_MESSAGE = /(?:^|[^\d])(408|409|425|429|500|502|503|504)(?=$|[^\d])/;
140
+ var STREAM_RESET_MESSAGE = /stream reset|RST_STREAM|ECONNRESET|socket hang up|ERR_STREAM_PREMATURE_CLOSE|UND_ERR_SOCKET/i;
141
+ var isProviderStatus = (value) => typeof value === "string" && PROVIDER_STATUS_CATEGORIES.includes(value);
142
+ var httpStatusValue = (value) => typeof value === "number" && Number.isInteger(value) && value >= 100 && value <= 599 ? value : undefined;
143
+ var definitiveClientStatus = (status) => status !== undefined && status >= 400 && status < 500 && TRANSIENT_HTTP[status] === undefined;
144
+ function readProviderFailureRecord(record, depth = 0) {
145
+ let retryable = false;
146
+ let clientError = false;
147
+ let httpStatus;
148
+ let providerStatus;
149
+ const noteHttp = (status) => {
150
+ if (status === undefined)
151
+ return;
152
+ httpStatus ??= status;
153
+ const category = TRANSIENT_HTTP[status];
154
+ if (category) {
155
+ retryable = true;
156
+ providerStatus ??= category;
157
+ } else if (status >= 400 && status < 500)
158
+ clientError = true;
159
+ };
160
+ const noteCategory = (category) => {
161
+ if (!category || clientError)
162
+ return;
163
+ retryable = true;
164
+ providerStatus ??= category;
165
+ if (httpStatus === undefined)
166
+ httpStatus = CATEGORY_HTTP[category];
167
+ };
168
+ const absorb = (value) => {
169
+ if (depth >= 2 || !value || typeof value !== "object" || value === record)
170
+ return;
171
+ const signals = readProviderFailureRecord(value, depth + 1);
172
+ noteHttp(signals.httpStatus);
173
+ noteCategory(signals.providerStatus);
174
+ };
175
+ noteHttp(httpStatusValue(record.status) ?? httpStatusValue(record.statusCode) ?? httpStatusValue(record.httpStatusCode));
176
+ if (typeof record.status === "string" && /^\d{3}$/.test(record.status))
177
+ noteHttp(Number(record.status));
178
+ if (typeof record.code === "number" && record.code >= 100 && record.code <= 599)
179
+ noteHttp(record.code);
180
+ if (typeof record.code === "number" && record.code >= 0 && record.code <= 16)
181
+ noteCategory(TRANSIENT_GRPC[record.code]);
182
+ if (typeof record.code === "string") {
183
+ if (STREAM_RESET_CODES.has(record.code))
184
+ noteCategory("STREAM_RESET");
185
+ else if (SYMBOLIC.has(record.code))
186
+ noteCategory(record.code);
187
+ }
188
+ if (typeof record.status === "string" && SYMBOLIC.has(record.status))
189
+ noteCategory(record.status);
190
+ if (isProviderStatus(record.providerStatus))
191
+ noteCategory(record.providerStatus);
192
+ if (record.diagnosticCode === "VERTEX_STREAM_TOOL_TRUNCATED" || record.reason === "stream_truncated")
193
+ noteCategory("STREAM_RESET");
194
+ if (record.code === "PROVIDER_UNAVAILABLE" && record.retryable === true)
195
+ retryable = true;
196
+ const body = record.responseBody ?? record.body;
197
+ if (!clientError) {
198
+ if (typeof body === "string")
199
+ noteCategory(categoryFromBody(body));
200
+ else
201
+ absorb(body);
202
+ absorb(record.error);
203
+ }
204
+ if (!retryable && !clientError && typeof record.message === "string") {
205
+ const match = record.message.match(HTTP_IN_MESSAGE);
206
+ if (match?.[1])
207
+ noteHttp(Number(match[1]));
208
+ else if (STREAM_RESET_MESSAGE.test(record.message))
209
+ noteCategory("STREAM_RESET");
210
+ }
211
+ if (httpStatus !== undefined && definitiveClientStatus(httpStatus))
212
+ return { retryable: false, httpStatus };
213
+ return { retryable, ...httpStatus !== undefined ? { httpStatus } : {}, ...providerStatus ? { providerStatus } : {} };
214
+ }
215
+ function categoryFromBody(body) {
216
+ if (Buffer.byteLength(body) > 8192)
217
+ return;
218
+ try {
219
+ const parsed = JSON.parse(body);
220
+ if (!parsed || typeof parsed !== "object")
221
+ return;
222
+ const detail = parsed.error;
223
+ const source = detail && typeof detail === "object" ? detail : parsed;
224
+ return readProviderFailureRecord(source).providerStatus;
225
+ } catch {
226
+ return;
227
+ }
228
+ }
229
+ function classifyProviderFailure(error) {
230
+ if (error && typeof error === "object") {
231
+ const top = readProviderFailureRecord(error);
232
+ if (top.httpStatus !== undefined && definitiveClientStatus(top.httpStatus))
233
+ return { retryable: false, httpStatus: top.httpStatus };
234
+ }
235
+ const seen = new Set;
236
+ let retryable = false;
237
+ let httpStatus;
238
+ let providerStatus;
239
+ const visit = (current, depth) => {
240
+ if (!current || typeof current !== "object" || depth > 5 || seen.has(current))
241
+ return;
242
+ seen.add(current);
243
+ const record = current;
244
+ const signals = readProviderFailureRecord(record);
245
+ httpStatus ??= signals.httpStatus;
246
+ providerStatus ??= signals.providerStatus;
247
+ if (httpStatus !== undefined && providerStatus === undefined)
248
+ providerStatus = TRANSIENT_HTTP[httpStatus];
249
+ if (record.retryable === false)
250
+ return;
251
+ if (signals.retryable)
252
+ retryable = true;
253
+ visit(record.cause, depth + 1);
254
+ if (record.error && typeof record.error === "object")
255
+ visit(record.error, depth + 1);
256
+ if (record.details && typeof record.details === "object")
257
+ visit(record.details, depth + 1);
258
+ if (Array.isArray(record.chain))
259
+ for (const entry of record.chain)
260
+ visit(entry, depth + 1);
261
+ };
262
+ visit(error, 0);
263
+ if (retryable && httpStatus === undefined && providerStatus)
264
+ httpStatus = CATEGORY_HTTP[providerStatus];
265
+ return { retryable, ...httpStatus !== undefined ? { httpStatus } : {}, ...providerStatus ? { providerStatus } : {} };
266
+ }
267
+ function isRetryableProviderFailure(error) {
268
+ return classifyProviderFailure(error).retryable;
269
+ }
270
+ function transientBackoffMs(attempt, baseMs = 250) {
271
+ const exponential = Math.min(baseMs * 2 ** Math.max(0, attempt), 1e4);
272
+ return exponential + Math.floor(Math.random() * exponential);
273
+ }
274
+ var thoughtOnlyText = (text) => {
275
+ try {
276
+ const parsed = JSON.parse(text);
277
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
278
+ return false;
279
+ const record = parsed;
280
+ return record.thought === true && Object.keys(record).every((key) => key === "thought" || key === "thoughtSignature");
281
+ } catch {
282
+ return false;
283
+ }
284
+ };
285
+ function isEmptyModelTurn(result) {
286
+ if (result.finishReason === "content-filter" || result.finishReason === "error")
287
+ return false;
288
+ if ((result.images?.length ?? 0) > 0 || (result.audio?.length ?? 0) > 0)
289
+ return false;
290
+ const parts = result.messages?.flatMap((message) => message.parts ?? []) ?? [];
291
+ if (parts.some((part) => part.type === "tool-call" || part.type === "image" || part.type === "audio"))
292
+ return false;
293
+ const texts = [result.text ?? "", ...parts.filter((part) => part.type === "text").map((part) => part.text ?? "")];
294
+ return texts.every((text) => text.trim().length === 0 || thoughtOnlyText(text.trim()));
295
+ }
296
+
100
297
  // src/providers/vertex-auth.ts
101
298
  var CLOUD_PLATFORM_SCOPE = "https://www.googleapis.com/auth/cloud-platform";
102
299
  function vertexRoute(env) {
@@ -146,13 +343,31 @@ class VertexAuthenticationError extends Error {
146
343
  this.name = "VertexAuthenticationError";
147
344
  }
148
345
  }
149
- function createVertexModel(model, env, createAuth) {
346
+ function createVertexModel(model, env, createAuth, retry) {
150
347
  const route = vertexRoute(env);
151
348
  const adapter = createVertex({
152
349
  ...route,
153
350
  getAccessToken: vertexTokenSource(env, route, createAuth)
154
351
  })(model);
155
- return wrapLanguageModel2(adapter, [{
352
+ const attempts = retry?.attempts ?? VERTEX_TRANSIENT_ATTEMPTS;
353
+ const delayFor = (input) => retry?.delayMs ?? ((attempt) => input.retryBackoffMs === 0 ? 0 : transientBackoffMs(attempt, input.retryBackoffMs ?? 250));
354
+ const generate = async (input) => withVertexAttempts(input.abortSignal, vertexAttemptBudget(input, attempts), delayFor(input), async () => {
355
+ try {
356
+ return await adapter.generate({ ...input, maxRetries: 0 });
357
+ } catch (error) {
358
+ throw safeVertexError(error);
359
+ }
360
+ }, (result) => !isEmptyModelTurn(result));
361
+ const innerStream = adapter.stream?.bind(adapter);
362
+ const retrying = innerStream ? {
363
+ ...adapter,
364
+ generate,
365
+ async stream(input) {
366
+ const events = await withVertexAttempts(input.abortSignal, vertexAttemptBudget(input, attempts), delayFor(input), () => collectVertexStream(() => innerStream({ ...input, maxRetries: 0 })), (events2) => !isEmptyVertexStream(events2));
367
+ return replayVertexStream(events);
368
+ }
369
+ } : { ...adapter, generate };
370
+ return wrapLanguageModel2(retrying, [{
156
371
  name: "harness-vertex-sanitized-errors",
157
372
  async wrapGenerate(_context, next) {
158
373
  try {
@@ -178,19 +393,109 @@ function createVertexModel(model, env, createAuth) {
178
393
  }
179
394
  }]);
180
395
  }
396
+ async function collectVertexStream(next) {
397
+ let stream;
398
+ try {
399
+ stream = await next();
400
+ } catch (error) {
401
+ throw safeVertexError(error);
402
+ }
403
+ const events = [];
404
+ try {
405
+ for await (const event of stream) {
406
+ if (event.type === "error")
407
+ throw safeVertexError(event.error);
408
+ events.push(event);
409
+ }
410
+ } catch (error) {
411
+ throw error instanceof Error && error.message.startsWith("Vertex request failed.") ? error : safeVertexError(error);
412
+ }
413
+ return events;
414
+ }
415
+ function isEmptyVertexStream(events) {
416
+ let text = "";
417
+ let finishReason;
418
+ let tools = false;
419
+ let media = false;
420
+ for (const event of events) {
421
+ if (event.type === "text-delta")
422
+ text += event.textDelta;
423
+ else if (event.type === "tool-call" || event.type === "tool-approval-request")
424
+ tools = true;
425
+ else if (event.type === "image-generation")
426
+ media = true;
427
+ else if (event.type === "finish")
428
+ finishReason = event.finishReason;
429
+ }
430
+ return isEmptyModelTurn({
431
+ text,
432
+ finishReason,
433
+ ...tools ? { messages: [{ parts: [{ type: "tool-call" }] }] } : {},
434
+ ...media ? { images: [{}] } : {}
435
+ });
436
+ }
437
+ function replayVertexStream(events) {
438
+ return async function* () {
439
+ yield* events;
440
+ }();
441
+ }
442
+ async function withVertexAttempts(abortSignal, attempts, delayMs, run, accept) {
443
+ let last;
444
+ for (let attempt = 0;attempt < attempts; attempt += 1) {
445
+ if (abortSignal?.aborted)
446
+ throw new DOMException("Vertex request cancelled.", "AbortError");
447
+ try {
448
+ const value = await run();
449
+ if (accept(value) || attempt === attempts - 1)
450
+ return value;
451
+ last = value;
452
+ } catch (error) {
453
+ const safe = error instanceof Error && (error.name === "AbortError" || error.message.startsWith("Vertex request failed.")) ? error : safeVertexError(error);
454
+ if (safe.name === "AbortError" || abortSignal?.aborted || attempt === attempts - 1 || !isRetryableProviderFailure(safe))
455
+ throw safe;
456
+ }
457
+ await sleep(delayMs(attempt));
458
+ }
459
+ return last;
460
+ }
461
+ var sleep = (ms) => ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve();
462
+ function vertexAttemptBudget(input, fallback) {
463
+ const requested = [
464
+ typeof input.maxProviderRequests === "number" ? input.maxProviderRequests : undefined,
465
+ typeof input.maxRetries === "number" ? input.maxRetries + 1 : undefined
466
+ ].filter((value) => value !== undefined);
467
+ if (requested.length === 0)
468
+ return Math.max(1, fallback);
469
+ return Math.max(1, Math.min(...requested));
470
+ }
181
471
  function safeVertexError(error) {
182
472
  if (error instanceof VertexAuthenticationError)
183
473
  return error;
184
474
  const record = error && typeof error === "object" ? error : {};
185
475
  if (record.name === "AbortError")
186
476
  return new DOMException("Vertex request cancelled.", "AbortError");
187
- const status = typeof record.status === "number" && Number.isInteger(record.status) && record.status >= 100 && record.status <= 599 ? record.status : undefined;
477
+ const failure = classifyProviderFailure(error);
478
+ const body = providerBody(record.responseBody) ?? providerBody(record.body);
479
+ const preserved = providerDiagnosticSchema.safeParse(record.provider);
480
+ const provider = body !== undefined ? providerDiagnostic(body, failure.httpStatus) : preserved.success ? preserved.data : providerDiagnostic(undefined, failure.httpStatus);
188
481
  return Object.assign(new Error("Vertex request failed. Check the sanitized provider diagnosis."), {
189
- ...status ? { status } : {},
190
- provider: providerDiagnostic(record.responseBody ?? record.body, status),
191
- retryable: record.retryable === true
482
+ ...failure.httpStatus !== undefined ? { status: failure.httpStatus } : {},
483
+ ...failure.providerStatus ? { providerStatus: failure.providerStatus } : {},
484
+ provider,
485
+ retryable: failure.retryable
192
486
  });
193
487
  }
488
+ function providerBody(value) {
489
+ if (typeof value === "string")
490
+ return value;
491
+ if (!value || typeof value !== "object")
492
+ return;
493
+ try {
494
+ return JSON.stringify(value).slice(0, 8192);
495
+ } catch {
496
+ return;
497
+ }
498
+ }
194
499
 
195
500
  // src/providers/qwen-hosted-policy.ts
196
501
  import { wrapLanguageModel as wrapLanguageModel3 } from "@zhivex-ai/core";
@@ -1968,13 +2273,6 @@ var harnessErrorDocument = (error) => {
1968
2273
  }
1969
2274
  };
1970
2275
  };
1971
- var numericStatuses = (error) => {
1972
- if (!error || typeof error !== "object")
1973
- return;
1974
- const record = error;
1975
- const values = [record.status, record.statusCode].filter((value) => typeof value === "number" && Number.isSafeInteger(value));
1976
- return values.length > 0 ? values : undefined;
1977
- };
1978
2276
  var normalizeHarnessError = (error) => {
1979
2277
  const diagnostic = providerStreamDiagnostic(error);
1980
2278
  if (diagnostic)
@@ -1982,9 +2280,16 @@ var normalizeHarnessError = (error) => {
1982
2280
  if (error instanceof HarnessError)
1983
2281
  return error;
1984
2282
  const message = error instanceof Error ? error.message : "Harness execution failed.";
1985
- const statuses = numericStatuses(error) ?? [];
1986
- if (statuses.some((status) => status === 429 || status >= 500 && status <= 599)) {
1987
- return new HarnessProviderError(message, { cause: error, retryable: true });
2283
+ const failure = classifyProviderFailure(error);
2284
+ if (failure.retryable) {
2285
+ const record = error && typeof error === "object" ? error : {};
2286
+ const body = typeof record.responseBody === "string" ? record.responseBody : typeof record.body === "string" ? record.body : undefined;
2287
+ const providerError = new HarnessProviderError("Provider request failed.", { cause: error, retryable: true });
2288
+ return Object.assign(providerError, {
2289
+ ...failure.httpStatus !== undefined ? { status: failure.httpStatus } : {},
2290
+ ...failure.providerStatus ? { providerStatus: failure.providerStatus } : {},
2291
+ provider: providerDiagnostic(body, failure.httpStatus)
2292
+ });
1988
2293
  }
1989
2294
  const name = error && typeof error === "object" && typeof error.name === "string" ? error.name : "";
1990
2295
  const code = error && typeof error === "object" && typeof error.code === "string" ? error.code : "";
@@ -3,7 +3,7 @@ import {
3
3
  HARNESS_VERSION,
4
4
  resolveHelpTopic,
5
5
  validateCliCommandOptions
6
- } from "./cli-entry-qav71mxw.js";
6
+ } from "./cli-entry-w0hterjs.js";
7
7
  import {
8
8
  DEFAULT_PROVIDER_REGISTRY,
9
9
  HARNESS_CONFIG_SCHEMA_VERSION,
@@ -35,7 +35,7 @@ import {
35
35
  vertexConfigured,
36
36
  vertexRoute,
37
37
  withReasoningEffort
38
- } from "./cli-entry-yqwa1943.js";
38
+ } from "./cli-entry-20w6nh0k.js";
39
39
  import {
40
40
  __require
41
41
  } from "./cli-entry-1bx83sw4.js";
@@ -6151,7 +6151,7 @@ This connection will replace Qwen environment settings for this CLI session.
6151
6151
  }
6152
6152
  }
6153
6153
  async function credentialModel(config, env, modelFactory) {
6154
- const { createProviderModel: createProviderModel2 } = await import("./config-pwbnze4g.js");
6154
+ const { createProviderModel: createProviderModel2 } = await import("./config-j9624t6t.js");
6155
6155
  const { wrapLanguageModel: wrapLanguageModel2 } = await import("@zhivex-ai/core");
6156
6156
  const secrets = providerDescriptor(config.provider).credentialNames.map((name) => env[name]).filter((value) => !!value);
6157
6157
  const safeError = (error) => {
@@ -427,7 +427,7 @@ Use zhx help all for the full reference and exit codes.`;
427
427
  // package.json
428
428
  var package_default = {
429
429
  name: "@zhivex-ai/harness",
430
- version: "1.4.0-rc.8",
430
+ version: "1.4.0",
431
431
  description: "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
432
432
  type: "module",
433
433
  license: "MIT",
package/dist/cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  HARNESS_VERSION,
4
4
  shortCliHelp
5
- } from "./cli-entry-qav71mxw.js";
5
+ } from "./cli-entry-w0hterjs.js";
6
6
  import {
7
7
  __require
8
8
  } from "./cli-entry-1bx83sw4.js";
@@ -16,6 +16,6 @@ if (argv.length === 1 && ["--version", "-v", "version"].includes(argv[0])) {
16
16
  process.stdout.write(`${shortCliHelp(HARNESS_VERSION)}
17
17
  `);
18
18
  } else {
19
- const { runCli } = await import("./cli-3bzvq594.js");
19
+ const { runCli } = await import("./cli-2h37qyvg.js");
20
20
  await runCli(argv);
21
21
  }
@@ -13,7 +13,7 @@ import {
13
13
  readHarnessTaskDraft,
14
14
  requestHarnessTaskCancellation,
15
15
  runHarnessTask
16
- } from "../index-nqhnh1hz.js";
16
+ } from "../index-pp474137.js";
17
17
  import {
18
18
  TASK_ACCEPTANCE_EVIDENCE_KEY,
19
19
  TASK_BUDGET_KEY,
@@ -26,8 +26,8 @@ import {
26
26
  inspectUsageLedger,
27
27
  taskSources,
28
28
  usagePricingSchema
29
- } from "../index-fny13znr.js";
30
- import"../index-w9pjt7td.js";
29
+ } from "../index-s2k2edts.js";
30
+ import"../index-pdmevfxv.js";
31
31
  import {
32
32
  FileChangedWhileReadingError,
33
33
  FileSizeLimitError,
@@ -37,19 +37,20 @@ import {
37
37
  resolvePackageCheckCommand,
38
38
  resolvePackageManager,
39
39
  runPortableProcess
40
- } from "../index-zmx264xy.js";
40
+ } from "../index-m34q25jj.js";
41
41
  import {
42
42
  DEFAULT_HARNESS_MAX_STEPS,
43
43
  modelReasoningEfforts,
44
44
  reasoningEffortSchema
45
- } from "../index-09zphhwt.js";
46
- import"../index-8705zxpr.js";
45
+ } from "../index-8zjmnyw5.js";
46
+ import"../index-m49jx72n.js";
47
47
  import {
48
48
  bundledModelCatalog,
49
49
  catalogModels,
50
50
  modelDescription
51
51
  } from "../index-xqxeypt5.js";
52
- import"../index-jdb1q8yn.js";
52
+ import"../index-bpc596v3.js";
53
+ import"../index-fm84men1.js";
53
54
  import"../index-1bx83sw4.js";
54
55
  // src/compat/code-support.ts
55
56
  var inspectCodeStateDatabase = (databasePath) => {
@@ -26,7 +26,7 @@ import {
26
26
  providerAvailability,
27
27
  providerDescriptor,
28
28
  resolveHarnessConfig
29
- } from "./cli-entry-yqwa1943.js";
29
+ } from "./cli-entry-20w6nh0k.js";
30
30
  import"./cli-entry-1bx83sw4.js";
31
31
  export {
32
32
  BUILTIN_PROVIDER_REGISTRATIONS,
@@ -26,10 +26,11 @@ import {
26
26
  providerAvailability,
27
27
  providerDescriptor,
28
28
  resolveHarnessConfig
29
- } from "./index-09zphhwt.js";
30
- import"./index-8705zxpr.js";
29
+ } from "./index-8zjmnyw5.js";
30
+ import"./index-m49jx72n.js";
31
31
  import"./index-xqxeypt5.js";
32
- import"./index-jdb1q8yn.js";
32
+ import"./index-bpc596v3.js";
33
+ import"./index-fm84men1.js";
33
34
  import"./index-1bx83sw4.js";
34
35
  export {
35
36
  BUILTIN_PROVIDER_REGISTRATIONS,
@@ -2,7 +2,7 @@ import {
2
2
  discardMcpWorkspaceSnapshot,
3
3
  launchDockerMcpGroup,
4
4
  prepareMcpWorkspaceSnapshot
5
- } from "../index-vga76vmb.js";
5
+ } from "../index-rkbf7dqg.js";
6
6
  import {
7
7
  createAcpConnection,
8
8
  issueAcpMcpSessionProvider,
@@ -10,19 +10,20 @@ import {
10
10
  } from "../index-3ah1f369.js";
11
11
  import {
12
12
  createHarnessClientAdapter
13
- } from "../index-txrqqd2r.js";
14
- import"../index-sbzvrpm7.js";
13
+ } from "../index-937cb7y8.js";
14
+ import"../index-6dft2vev.js";
15
15
  import {
16
16
  createHarness
17
- } from "../index-nqhnh1hz.js";
18
- import"../index-fny13znr.js";
19
- import"../index-w9pjt7td.js";
20
- import"../index-zmx264xy.js";
21
- import"../index-09zphhwt.js";
22
- import"../index-8705zxpr.js";
17
+ } from "../index-pp474137.js";
18
+ import"../index-s2k2edts.js";
19
+ import"../index-pdmevfxv.js";
20
+ import"../index-m34q25jj.js";
21
+ import"../index-8zjmnyw5.js";
22
+ import"../index-m49jx72n.js";
23
23
  import"../index-xqxeypt5.js";
24
- import"../index-ngg2168h.js";
25
- import"../index-jdb1q8yn.js";
24
+ import"../index-nmjdwd4p.js";
25
+ import"../index-bpc596v3.js";
26
+ import"../index-fm84men1.js";
26
27
  import"../index-1bx83sw4.js";
27
28
  // src/client/acp-mcp-host.ts
28
29
  import { createHash } from "node:crypto";
@@ -2,21 +2,22 @@ import {
2
2
  createHarnessClientAdapter,
3
3
  runResultDocument,
4
4
  terminalContinuationMessages
5
- } from "../index-txrqqd2r.js";
6
- import"../index-sbzvrpm7.js";
7
- import"../index-nqhnh1hz.js";
8
- import"../index-fny13znr.js";
9
- import"../index-w9pjt7td.js";
10
- import"../index-zmx264xy.js";
11
- import"../index-09zphhwt.js";
12
- import"../index-8705zxpr.js";
5
+ } from "../index-937cb7y8.js";
6
+ import"../index-6dft2vev.js";
7
+ import"../index-pp474137.js";
8
+ import"../index-s2k2edts.js";
9
+ import"../index-pdmevfxv.js";
10
+ import"../index-m34q25jj.js";
11
+ import"../index-8zjmnyw5.js";
12
+ import"../index-m49jx72n.js";
13
13
  import"../index-xqxeypt5.js";
14
14
  import {
15
15
  HARNESS_CLIENT_PROTOCOL_VERSION,
16
16
  harnessClientCommandSchema,
17
17
  harnessClientRequestSchema
18
- } from "../index-ngg2168h.js";
19
- import"../index-jdb1q8yn.js";
18
+ } from "../index-nmjdwd4p.js";
19
+ import"../index-bpc596v3.js";
20
+ import"../index-fm84men1.js";
20
21
  import"../index-1bx83sw4.js";
21
22
  export {
22
23
  HARNESS_CLIENT_PROTOCOL_VERSION,
@@ -6,8 +6,9 @@ import {
6
6
  vertexEnvironment,
7
7
  vertexRoute,
8
8
  vertexTokenSource
9
- } from "../index-8705zxpr.js";
9
+ } from "../index-m49jx72n.js";
10
10
  import"../index-xqxeypt5.js";
11
+ import"../index-fm84men1.js";
11
12
  import"../index-1bx83sw4.js";
12
13
  export {
13
14
  loadModelCatalog,
@@ -2,12 +2,12 @@ import {
2
2
  createArchivedHarnessStateBackup,
3
3
  createHarnessStateBackup,
4
4
  validateRecordedWorkspace
5
- } from "../index-7y6b4yjx.js";
6
- import"../index-sbzvrpm7.js";
5
+ } from "../index-tfzta544.js";
6
+ import"../index-6dft2vev.js";
7
7
  import {
8
8
  HARNESS_SQLITE_FILE,
9
9
  validateStateDirectory
10
- } from "../index-fny13znr.js";
10
+ } from "../index-s2k2edts.js";
11
11
  import {
12
12
  SqliteDatabase,
13
13
  acquireSqliteAccess,
@@ -16,11 +16,12 @@ import {
16
16
  protectPersistenceSecret,
17
17
  readRegularFileNoFollow,
18
18
  statRegularFileNoFollow
19
- } from "../index-zmx264xy.js";
20
- import"../index-09zphhwt.js";
21
- import"../index-8705zxpr.js";
19
+ } from "../index-m34q25jj.js";
20
+ import"../index-8zjmnyw5.js";
21
+ import"../index-m49jx72n.js";
22
22
  import"../index-xqxeypt5.js";
23
- import"../index-jdb1q8yn.js";
23
+ import"../index-bpc596v3.js";
24
+ import"../index-fm84men1.js";
24
25
  import"../index-1bx83sw4.js";
25
26
 
26
27
  // src/persistence/host-database-backup.ts