@zhivex-ai/harness 1.6.2 → 1.7.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 (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +4 -2
  3. package/SECURITY.md +1 -1
  4. package/SUPPORT.md +2 -2
  5. package/benchmarks/README.md +72 -0
  6. package/contracts/engine-api.json +30 -0
  7. package/dist/acp-cli.js +8 -8
  8. package/dist/approvals/auto-approve.d.ts +1 -1
  9. package/dist/audit/index.js +3 -3
  10. package/dist/{audit-pack-fckpqfsb.js → audit-pack-y02n8zd0.js} +3 -3
  11. package/dist/{cli-entry-z1pbjrg4.js → cli-entry-j6jcb2jb.js} +2 -2
  12. package/dist/{cli-entry-4g2ewcnw.js → cli-entry-td04s0fa.js} +340 -248
  13. package/dist/{cli-entry-10th5awp.js → cli-entry-v5db3eb2.js} +12 -8
  14. package/dist/{cli-entry-6amx4mcc.js → cli-entry-ynahz9qc.js} +68 -36
  15. package/dist/{cli-84en174d.js → cli-zw18kdqx.js} +6 -6
  16. package/dist/cli.js +2 -2
  17. package/dist/compat/code-support.d.ts +1 -0
  18. package/dist/compat/code-support.js +6 -6
  19. package/dist/context/scoped-context.d.ts +17 -5
  20. package/dist/engine/acp.js +9 -9
  21. package/dist/engine/client.js +8 -8
  22. package/dist/engine/desktop-state-v1.js +5 -5
  23. package/dist/engine/index.d.ts +4 -0
  24. package/dist/engine/index.js +17 -11
  25. package/dist/engine/mcp-stdio-v1.js +4 -4
  26. package/dist/engine/service.js +9 -9
  27. package/dist/hostile-repository-demo.js +576 -469
  28. package/dist/{index-74f9yhfh.js → index-ebb5d4s3.js} +33 -12
  29. package/dist/{index-pf73y4gt.js → index-h8r80xhk.js} +233 -118
  30. package/dist/{index-rgqzdgv6.js → index-k1a1xesg.js} +3 -3
  31. package/dist/{index-fqqz1yt8.js → index-qz4fs9f9.js} +14 -3
  32. package/dist/{index-zrz4rs7p.js → index-r0q0r88h.js} +2 -2
  33. package/dist/{index-amjttjaj.js → index-t6sjhxh8.js} +2 -2
  34. package/dist/{index-paf7z8kn.js → index-tc2r2n8b.js} +5 -5
  35. package/dist/{index-1pn0ecs4.js → index-tgt8gtq7.js} +2 -2
  36. package/dist/{index-w0m1nckc.js → index-v17e1xs8.js} +22 -22
  37. package/dist/{index-4mn6m3bq.js → index-v86bh0eg.js} +2 -2
  38. package/dist/{index-rz7wmp71.js → index-x9hv1a34.js} +12 -8
  39. package/dist/{index-2r4f0p4n.js → index-yp0jtaxp.js} +1 -1
  40. package/dist/index.js +10 -10
  41. package/dist/runtime/agent-profile.d.ts +12 -0
  42. package/dist/runtime/harness.d.ts +11 -0
  43. package/dist/runtime/known-file-preload.d.ts +35 -0
  44. package/dist/service-cli.js +9 -9
  45. package/dist/{service-client-cli-pp5z4dmf.js → service-client-cli-gtk26axb.js} +3 -3
  46. package/dist/verify-historical-migrations.js +390 -283
  47. package/dist/zhx.js +2 -2
  48. package/docs/AZURE_OPENAI.md +1 -1
  49. package/docs/BEDROCK.md +1 -1
  50. package/docs/CODE_RELEASE.md +24 -7
  51. package/docs/CONTEXT_ENGINEERING.md +66 -0
  52. package/docs/DURABLE_OPERATIONS.md +1 -1
  53. package/docs/ENGINE_API.md +8 -1
  54. package/docs/EXTENSIBILITY.md +1 -1
  55. package/docs/FIRST_USE.md +6 -6
  56. package/docs/MINIMUM_TASK_AUTHORITY.md +1 -1
  57. package/docs/PROJECT_MEMORY.md +1 -1
  58. package/docs/README.md +12 -4
  59. package/docs/VERTEX.md +1 -1
  60. package/docs/WEB_LIMITS.md +1 -1
  61. package/docs/adr/0002-isolated-mcp-stdio.md +1 -1
  62. package/evaluations/representative-assembly-matrix.json +19 -1
  63. package/examples/README.md +4 -4
  64. package/package.json +12 -8
@@ -444,7 +444,7 @@ Use zhx help all for the full reference and exit codes.`;
444
444
  // package.json
445
445
  var package_default = {
446
446
  name: "@zhivex-ai/harness",
447
- version: "1.6.2",
447
+ version: "1.7.0",
448
448
  description: "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
449
449
  type: "module",
450
450
  license: "MIT",
@@ -612,6 +612,7 @@ var package_default = {
612
612
  test: "bun test --preload ./tests/preload-bedrock-mock.ts ./tests ./desktop/tests",
613
613
  evaluate: "bun run scripts/evaluate.ts",
614
614
  "benchmark:workspace": "bun run scripts/benchmark-workspace.ts",
615
+ "benchmark:harness": "bun run scripts/benchmark-harness-overhead.ts",
615
616
  "benchmark:workspace:ci": "bun run scripts/benchmark-workspace.ts --files 1000 --page-size 100 --repetitions 3 --warmups 0",
616
617
  "benchmark:oci": "bun run scripts/benchmark-oci.ts",
617
618
  "benchmark:safe-fix": "bun run scripts/benchmark-time-to-safe-fix.ts",
@@ -658,29 +659,32 @@ var package_default = {
658
659
  "typecheck:code": "bun run --cwd packages/code typecheck",
659
660
  "evaluate:tasks": "bun run scripts/task-acceptance.ts",
660
661
  "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",
661
- "smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts"
662
+ "smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts",
663
+ "prepare:assistant": "bun run build && bun install --cwd packages/assistant --frozen-lockfile --ignore-scripts && bun run --cwd packages/assistant prepare:local",
664
+ "check:assistant": "bun run --cwd packages/assistant typecheck && bun run --cwd packages/assistant test && bun run --cwd packages/assistant smoke && bun run --cwd packages/assistant smoke:installed",
665
+ "smoke:assistant:web": "bun run --cwd packages/assistant build && bun run --cwd packages/assistant smoke:daily-web && bun run --cwd packages/assistant smoke:microsoft-web"
662
666
  },
663
667
  dependencies: {
664
668
  "@zhivex-ai/agents": "1.12.0",
665
669
  "@zhivex-ai/anthropic": "0.15.0",
666
670
  "@zhivex-ai/azure-openai": "0.8.0",
667
671
  "@zhivex-ai/bedrock": "2.1.0",
668
- "@zhivex-ai/core": "1.36.0",
672
+ "@zhivex-ai/core": "1.37.0",
669
673
  "@zhivex-ai/gemini": "0.14.0",
670
674
  "@zhivex-ai/meta": "0.3.0",
671
675
  "@zhivex-ai/openai": "0.17.0",
672
- "@zhivex-ai/qwen": "0.18.0",
676
+ "@zhivex-ai/qwen": "0.18.1",
673
677
  "@zhivex-ai/vertex": "1.3.0",
674
678
  "google-auth-library": "11.3.1",
675
679
  zod: "4.6.7"
676
680
  },
677
681
  overrides: {
678
- "@zhivex-ai/core": "1.36.0"
682
+ "@zhivex-ai/core": "1.37.0"
679
683
  },
680
684
  devDependencies: {
681
- "@agentclientprotocol/sdk": "1.8.0",
685
+ "@agentclientprotocol/sdk": "2.1.0",
682
686
  "@modelcontextprotocol/server": "2.3.1",
683
- "@types/bun": "1.4.3",
687
+ "@types/bun": "1.4.4",
684
688
  "@types/node": "^26.6.5",
685
689
  typescript: "7.0.2",
686
690
  "typescript-compiler-api": "npm:typescript@6.0.3"
@@ -691,7 +695,7 @@ var package_default = {
691
695
  },
692
696
  packageManager: "bun@1.4.0",
693
697
  optionalDependencies: {
694
- "@napi-rs/keyring": "2.1.1"
698
+ "@napi-rs/keyring": "2.1.2"
695
699
  }
696
700
  };
697
701
 
@@ -2,7 +2,7 @@ import {
2
2
  CLI_OPTION_DEFINITIONS,
3
3
  resolveHelpTopic,
4
4
  validateCliCommandOptions
5
- } from "./cli-entry-10th5awp.js";
5
+ } from "./cli-entry-v5db3eb2.js";
6
6
  import {
7
7
  DEFAULT_PROVIDER_REGISTRY,
8
8
  HARNESS_EXECUTION_POLICY_VERSION,
@@ -1889,12 +1889,23 @@ var openCliSessionStore = async (options) => {
1889
1889
  ORDER BY activity_seq DESC
1890
1890
  LIMIT ?3
1891
1891
  `).all(workspaceKey, scopeKey, limit, search);
1892
+ if (rows.length === 0)
1893
+ return [];
1894
+ const summaries = database.query(`
1895
+ WITH totals AS (
1896
+ SELECT session_id, COUNT(*) AS run_count, MAX(ordinal) AS latest_ordinal
1897
+ FROM zhivex_cli_session_runs WHERE session_id IN (SELECT value FROM json_each(?))
1898
+ GROUP BY session_id
1899
+ )
1900
+ SELECT r.*, totals.run_count FROM totals JOIN zhivex_cli_session_runs r
1901
+ ON r.session_id=totals.session_id AND r.ordinal=totals.latest_ordinal
1902
+ `).all(JSON.stringify(rows.map((row) => row.session_id)));
1903
+ const bySession = new Map(summaries.map((row) => [row.session_id, row]));
1892
1904
  return rows.map((row) => {
1893
- const latest = latestRunRow(row.session_id);
1894
- const runCount = database.query("SELECT COUNT(*) AS count FROM zhivex_cli_session_runs WHERE session_id = ?1").get(row.session_id)?.count ?? 0;
1905
+ const latest = bySession.get(row.session_id);
1895
1906
  return {
1896
1907
  ...sessionBase(row),
1897
- runCount,
1908
+ runCount: latest?.run_count ?? 0,
1898
1909
  ...latest ? { latestRun: toRunReference(latest) } : {}
1899
1910
  };
1900
1911
  });
@@ -4923,25 +4934,27 @@ class Workspace {
4923
4934
  if (this.auditPath && this.auditEntries.length + count2 > 1e4)
4924
4935
  throw new HarnessWorkspaceError("Mutation audit capacity exceeded; retain evidence and start a new run.");
4925
4936
  }
4926
- async audit(entry) {
4927
- const record = { id: randomUUID4(), timestamp: new Date().toISOString(), ...entry };
4928
- this.auditEntries.push(record);
4937
+ async audit(entries) {
4938
+ if (entries.length === 0)
4939
+ return [];
4940
+ const records = entries.map((entry) => ({ id: randomUUID4(), timestamp: new Date().toISOString(), ...entry }));
4929
4941
  if (this.auditPath) {
4930
4942
  const temporary = `${this.auditPath}.${randomUUID4()}.tmp`;
4931
- const handle = await open6(temporary, "wx", 384);
4932
- try {
4933
- await handle.writeFile(JSON.stringify(this.auditEntries));
4934
- await handle.sync();
4935
- } finally {
4936
- await handle.close();
4937
- }
4938
4943
  try {
4944
+ const handle = await open6(temporary, "wx", 384);
4945
+ try {
4946
+ await handle.writeFile(JSON.stringify([...this.auditEntries, ...records]));
4947
+ await handle.sync();
4948
+ } finally {
4949
+ await handle.close();
4950
+ }
4939
4951
  await rename2(temporary, this.auditPath);
4940
4952
  } finally {
4941
4953
  await unlink2(temporary).catch(() => {});
4942
4954
  }
4943
4955
  }
4944
- return record;
4956
+ this.auditEntries.push(...records);
4957
+ return records;
4945
4958
  }
4946
4959
  mutationAudit() {
4947
4960
  return this.auditEntries.map((entry) => ({ ...entry }));
@@ -5173,14 +5186,12 @@ class Workspace {
5173
5186
  throw error;
5174
5187
  }
5175
5188
  this.invalidateWorkspaceIndex();
5176
- const changes = [];
5177
- for (const item of prepared)
5178
- changes.push(await this.audit({
5179
- operation: item.before ? "update" : "create",
5180
- path: item.change.path,
5181
- ...item.before ? { beforeDigest: item.before.digest } : {},
5182
- afterDigest: digestBytes(item.change.content)
5183
- }));
5189
+ const changes = await this.audit(prepared.map((item) => ({
5190
+ operation: item.before ? "update" : "create",
5191
+ path: item.change.path,
5192
+ ...item.before ? { beforeDigest: item.before.digest } : {},
5193
+ afterDigest: digestBytes(item.change.content)
5194
+ })));
5184
5195
  return { proposalId: proposal.proposalId, changes };
5185
5196
  }
5186
5197
  async writeFile(relativePath, content, overwrite = false) {
@@ -5240,7 +5251,7 @@ class Workspace {
5240
5251
  throw error;
5241
5252
  }
5242
5253
  this.invalidateWorkspaceIndex();
5243
- const audit = await this.audit({ operation: "move", path: parsed.source, destination: parsed.destination, beforeDigest: source.digest, afterDigest: source.digest });
5254
+ const audit = (await this.audit([{ operation: "move", path: parsed.source, destination: parsed.destination, beforeDigest: source.digest, afterDigest: source.digest }]))[0];
5244
5255
  return { source: parsed.source, destination: parsed.destination, digest: source.digest, audit };
5245
5256
  }
5246
5257
  async secureQuarantineDirectory(create) {
@@ -5324,7 +5335,7 @@ class Workspace {
5324
5335
  throw error;
5325
5336
  }
5326
5337
  this.invalidateWorkspaceIndex();
5327
- const audit = await this.audit({ operation: "quarantine", path: parsed.path, beforeDigest: source.digest, quarantineId });
5338
+ const audit = (await this.audit([{ operation: "quarantine", path: parsed.path, beforeDigest: source.digest, quarantineId }]))[0];
5328
5339
  return { quarantineId, path: parsed.path, digest: source.digest, audit };
5329
5340
  }
5330
5341
  async readRestorableQuarantine(quarantineId) {
@@ -5432,7 +5443,7 @@ class Workspace {
5432
5443
  throw rollbackErrors.length ? new AggregateError([error, ...rollbackErrors], "Restore failed and rollback was incomplete.") : error;
5433
5444
  }
5434
5445
  this.invalidateWorkspaceIndex();
5435
- const audit = await this.audit({ operation: "restore", path: destinationPath, afterDigest: digest3, quarantineId: parsed.quarantineId });
5446
+ const audit = (await this.audit([{ operation: "restore", path: destinationPath, afterDigest: digest3, quarantineId: parsed.quarantineId }]))[0];
5436
5447
  return { quarantineId: parsed.quarantineId, path: destinationPath, digest: digest3, audit };
5437
5448
  }
5438
5449
  async runCheck(check, expectedScript, allowedChecks = DEFAULT_CHECKS) {
@@ -9336,14 +9347,22 @@ var openHarnessActivityStore = async (config, options = {}) => {
9336
9347
  }
9337
9348
  db.exec(`CREATE TABLE IF NOT EXISTS client_activity_events(sequence INTEGER PRIMARY KEY AUTOINCREMENT, scope TEXT NOT NULL, session TEXT NOT NULL, run TEXT NOT NULL, at INTEGER NOT NULL, activity TEXT NOT NULL);
9338
9349
  CREATE INDEX IF NOT EXISTS client_activity_scope ON client_activity_events(scope, session, sequence);
9350
+ CREATE INDEX IF NOT EXISTS client_activity_sequence ON client_activity_events(scope, sequence);
9351
+ CREATE INDEX IF NOT EXISTS client_activity_age ON client_activity_events(scope, at);
9339
9352
  CREATE TABLE IF NOT EXISTS client_activity_snapshots(scope TEXT NOT NULL, session TEXT NOT NULL, sequence INTEGER NOT NULL, expired_through INTEGER NOT NULL DEFAULT 0, snapshot TEXT NOT NULL, PRIMARY KEY(scope,session));`);
9340
9353
  const readSnapshot = db.query("SELECT snapshot,expired_through FROM client_activity_snapshots WHERE scope=? AND session=?");
9341
- const expiredEvents = db.query(`SELECT session,MAX(sequence) AS seq FROM client_activity_events WHERE scope=? AND (at < ? OR sequence NOT IN (SELECT sequence FROM client_activity_events WHERE scope=? ORDER BY sequence DESC LIMIT ?)) GROUP BY session`);
9354
+ const retentionCutoff = db.query("SELECT sequence FROM client_activity_events WHERE scope=? ORDER BY sequence DESC LIMIT 1 OFFSET ?");
9355
+ const expiredEvents = db.query(`SELECT session,MAX(sequence) AS seq FROM (
9356
+ SELECT session,sequence FROM client_activity_events WHERE scope=? AND at < ?
9357
+ UNION ALL SELECT session,sequence FROM client_activity_events WHERE scope=? AND sequence<=?
9358
+ ) GROUP BY session`);
9342
9359
  const markExpired = db.query("UPDATE client_activity_snapshots SET expired_through=MAX(expired_through,?) WHERE scope=? AND session=?");
9343
9360
  const deleteExpired = db.query("DELETE FROM client_activity_events WHERE scope=? AND session=? AND sequence<=?");
9344
9361
  const insertEvent = db.query("INSERT INTO client_activity_events(scope,session,run,at,activity) VALUES(?,?,?,?,?)");
9345
9362
  const lastSequence = db.query("SELECT last_insert_rowid() AS seq");
9346
9363
  const saveSnapshot = db.query("INSERT INTO client_activity_snapshots(scope,session,sequence,snapshot) VALUES(?,?,?,?) ON CONFLICT(scope,session) DO UPDATE SET sequence=excluded.sequence,snapshot=excluded.snapshot");
9364
+ const dataVersion = db.query("PRAGMA data_version");
9365
+ let cached;
9347
9366
  const readEvents = db.query("SELECT sequence,session,run,at,activity FROM client_activity_events WHERE scope=? AND session=? AND sequence>? ORDER BY sequence LIMIT 201");
9348
9367
  const redaction2 = createRedactionPolicy7({ includeEmails: true });
9349
9368
  const redact4 = (text2) => {
@@ -9397,7 +9416,8 @@ var openHarnessActivityStore = async (config, options = {}) => {
9397
9416
  return { state: row ? JSON.parse(row.snapshot) : { schemaVersion: 1, sessionId: sessionId2, sequence: 0, runs: {} }, expiredThrough: row?.expired_through ?? 0 };
9398
9417
  };
9399
9418
  const prune = () => {
9400
- const expired = expiredEvents.all(scope, now() - retentionMs, scope, maxEvents);
9419
+ const cutoff = retentionCutoff.get(scope, maxEvents)?.sequence ?? 0;
9420
+ const expired = expiredEvents.all(scope, now() - retentionMs, scope, cutoff);
9401
9421
  for (const row of expired) {
9402
9422
  markExpired.run(row.seq, scope, row.session);
9403
9423
  deleteExpired.run(scope, row.session, row.seq);
@@ -9412,11 +9432,12 @@ var openHarnessActivityStore = async (config, options = {}) => {
9412
9432
  throw new Error("ACTIVITY_TOO_LARGE");
9413
9433
  db.exec("BEGIN IMMEDIATE");
9414
9434
  try {
9415
- const current2 = snapshot(sessionId2).state;
9416
- const runs = Object.keys(current2.runs);
9417
- if (!current2.runs[runId] && runs.length >= 1000)
9435
+ const version = dataVersion.get().data_version;
9436
+ const runs = cached?.sessionId === sessionId2 && cached.version === version ? { ...cached.runs } : Object.fromEntries(Object.entries(snapshot(sessionId2).state.runs).map(([id, run]) => [id, JSON.stringify(run)]));
9437
+ const previous = Object.hasOwn(runs, runId) ? runs[runId] : undefined;
9438
+ if (!previous && Object.keys(runs).length >= 1000)
9418
9439
  throw new Error("ACTIVITY_RUN_LIMIT");
9419
- const state = current2.runs[runId] ?? { text: "", status: "running", truncated: false };
9440
+ const state = previous ? JSON.parse(previous) : { text: "", status: "running", truncated: false };
9420
9441
  if (typeof activity.textDelta === "string") {
9421
9442
  state.text += activity.textDelta;
9422
9443
  if (state.text.length > 256 * 1024) {
@@ -9441,14 +9462,23 @@ var openHarnessActivityStore = async (config, options = {}) => {
9441
9462
  state.status = "running";
9442
9463
  if (activity.type === "tool-approval-request" || activity.type === "agent-approval-request")
9443
9464
  state.status = "waiting_approval";
9444
- current2.runs[runId] = state;
9445
9465
  insertEvent.run(scope, sessionId2, runId, at, encoded);
9446
- current2.sequence = lastSequence.get().seq;
9447
- const bounded = serializeBoundedSnapshot(current2, runId);
9448
- saveSnapshot.run(scope, sessionId2, current2.sequence, bounded);
9466
+ const sequence2 = lastSequence.get().seq;
9467
+ Object.defineProperty(runs, runId, { value: JSON.stringify(state), enumerable: true, configurable: true, writable: true });
9468
+ const header = JSON.stringify({ schemaVersion: 1, sessionId: sessionId2, sequence: sequence2 });
9469
+ let bounded = header.slice(0, -1) + ',"runs":{' + Object.entries(runs).map(([id, run]) => JSON.stringify(id) + ":" + run).join(",") + "}}";
9470
+ if (Buffer.byteLength(bounded) > MAX_SNAPSHOT_BYTES) {
9471
+ bounded = serializeBoundedSnapshot(JSON.parse(bounded), runId);
9472
+ const compacted = JSON.parse(bounded);
9473
+ for (const [id, run] of Object.entries(compacted.runs))
9474
+ runs[id] = JSON.stringify(run);
9475
+ }
9476
+ saveSnapshot.run(scope, sessionId2, sequence2, bounded);
9449
9477
  prune();
9450
9478
  db.exec("COMMIT");
9479
+ cached = { sessionId: sessionId2, version, runs };
9451
9480
  } catch (e) {
9481
+ cached = undefined;
9452
9482
  db.exec("ROLLBACK");
9453
9483
  throw e;
9454
9484
  }
@@ -9523,6 +9553,7 @@ var openHarnessActivityStore = async (config, options = {}) => {
9523
9553
  prune();
9524
9554
  db.exec("COMMIT");
9525
9555
  } catch (e) {
9556
+ cached = undefined;
9526
9557
  db.exec("ROLLBACK");
9527
9558
  throw e;
9528
9559
  }
@@ -9538,6 +9569,7 @@ var openHarnessActivityStore = async (config, options = {}) => {
9538
9569
  },
9539
9570
  close() {
9540
9571
  db.close();
9572
+ cached = undefined;
9541
9573
  tails.clear();
9542
9574
  discard.clear();
9543
9575
  }
@@ -61,11 +61,11 @@ import {
61
61
  withTemporaryHarnessProfiles,
62
62
  workspaceCheckpointSchema,
63
63
  workspaceRestoreOperationSchema
64
- } from "./cli-entry-4g2ewcnw.js";
64
+ } from "./cli-entry-td04s0fa.js";
65
65
  import {
66
66
  exportHarnessGovernanceReport,
67
67
  renderHarnessGovernanceMarkdown
68
- } from "./cli-entry-z1pbjrg4.js";
68
+ } from "./cli-entry-j6jcb2jb.js";
69
69
  import {
70
70
  BUDGET_LEDGER_NAMESPACE,
71
71
  BUDGET_OWNER_NAMESPACE_KEY,
@@ -125,14 +125,14 @@ import {
125
125
  updateCliProfile,
126
126
  validateStateDirectory,
127
127
  verifyChangeEnvelope
128
- } from "./cli-entry-6amx4mcc.js";
128
+ } from "./cli-entry-ynahz9qc.js";
129
129
  import {
130
130
  BUN_ENGINE_RANGE,
131
131
  HARNESS_VERSION,
132
132
  NODE_ENGINE_RANGE,
133
133
  formatCliHelp,
134
134
  shortCliHelp
135
- } from "./cli-entry-10th5awp.js";
135
+ } from "./cli-entry-v5db3eb2.js";
136
136
  import {
137
137
  DEFAULT_PROVIDER_REGISTRY,
138
138
  HARNESS_SUBAGENT_PROFILES,
@@ -4091,7 +4091,7 @@ var main = async (argv = process.argv.slice(2)) => {
4091
4091
  parsedOptions = { ...parsedOptions, prompt: await readStdinTask() };
4092
4092
  }
4093
4093
  if (parsedOptions.serviceFile) {
4094
- const { runServiceCli } = await import("./service-client-cli-pp5z4dmf.js");
4094
+ const { runServiceCli } = await import("./service-client-cli-gtk26axb.js");
4095
4095
  await runServiceCli(parsedOptions, annotateCliStreamError);
4096
4096
  return;
4097
4097
  }
@@ -4156,7 +4156,7 @@ var main = async (argv = process.argv.slice(2)) => {
4156
4156
  return;
4157
4157
  case "export-audit":
4158
4158
  case "verify-audit": {
4159
- const { auditPackCli } = await import("./audit-pack-fckpqfsb.js");
4159
+ const { auditPackCli } = await import("./audit-pack-y02n8zd0.js");
4160
4160
  await auditPackCli(options);
4161
4161
  return;
4162
4162
  }
package/dist/cli.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  HARNESS_VERSION,
4
4
  NODE_ENGINE_RANGE,
5
5
  shortCliHelp
6
- } from "./cli-entry-10th5awp.js";
6
+ } from "./cli-entry-v5db3eb2.js";
7
7
  import {
8
8
  __require
9
9
  } from "./cli-entry-1bx83sw4.js";
@@ -41,6 +41,6 @@ if (argv.length === 1 && ["--version", "-v", "version"].includes(argv[0])) {
41
41
  process.stdout.write(`${shortCliHelp(HARNESS_VERSION)}
42
42
  `);
43
43
  } else {
44
- const { runCli } = await import("./cli-84en174d.js");
44
+ const { runCli } = await import("./cli-zw18kdqx.js");
45
45
  await runCli(argv);
46
46
  }
@@ -30,3 +30,4 @@ export { inspectHarnessTaskContinuity } from '../runtime/task-continuity.js';
30
30
  export { createTaskTelemetry } from '../runtime/task-telemetry.js';
31
31
  export { runHarnessTask } from '../runtime/harness.js';
32
32
  export type { HarnessTaskRunOptions } from '../runtime/harness.js';
33
+ export type { KnownFilePreload } from "../runtime/known-file-preload.js";
@@ -13,18 +13,18 @@ import {
13
13
  readHarnessTaskDraft,
14
14
  requestHarnessTaskCancellation,
15
15
  runHarnessTask
16
- } from "../index-pf73y4gt.js";
16
+ } from "../index-h8r80xhk.js";
17
17
  import {
18
18
  TASK_SOURCE_KEY,
19
19
  harnessToolExecution,
20
20
  taskSources
21
- } from "../index-amjttjaj.js";
22
- import"../index-2r4f0p4n.js";
21
+ } from "../index-t6sjhxh8.js";
22
+ import"../index-yp0jtaxp.js";
23
23
  import {
24
24
  resolvePackageCheckCommand,
25
25
  resolvePackageManager,
26
26
  runPortableProcess
27
- } from "../index-w0m1nckc.js";
27
+ } from "../index-v17e1xs8.js";
28
28
  import {
29
29
  DEFAULT_HARNESS_MAX_STEPS,
30
30
  modelReasoningEfforts,
@@ -46,8 +46,8 @@ import {
46
46
  inspectTaskBudgetSummary,
47
47
  inspectUsageLedger,
48
48
  usagePricingSchema
49
- } from "../index-fqqz1yt8.js";
50
- import"../index-rz7wmp71.js";
49
+ } from "../index-qz4fs9f9.js";
50
+ import"../index-x9hv1a34.js";
51
51
  import {
52
52
  FileChangedWhileReadingError,
53
53
  FileSizeLimitError,
@@ -39,11 +39,6 @@ export declare const refreshHarnessScopedContext: (workspace: Pick<Workspace, "r
39
39
  sources: HarnessScopedContextSource[];
40
40
  instructions: string;
41
41
  }>;
42
- /**
43
- * Discover only ancestors of already authorized file targets, never siblings.
44
- * Root AGENTS.md belongs to the initial project bundle and is not duplicated.
45
- * Persist the returned state with the run; callers must serialize state updates.
46
- */
47
42
  export declare const discoverHarnessScopedContext: (workspace: Pick<Workspace, "root">, options: {
48
43
  paths: readonly string[];
49
44
  state?: HarnessScopedContextState;
@@ -59,3 +54,20 @@ export declare const discoverHarnessScopedContext: (workspace: Pick<Workspace, "
59
54
  sources: HarnessScopedContextSource[];
60
55
  instructions: string;
61
56
  }>;
57
+ /** Conversational discovery accepts refreshed guidance and reuses those verified
58
+ * sources only within this operation. Durable strict validation stays separate. */
59
+ export declare const refreshAndDiscoverHarnessScopedContext: (workspace: Pick<Workspace, "root">, options: {
60
+ paths: readonly string[];
61
+ state?: HarnessScopedContextState;
62
+ }) => Promise<{
63
+ state: {
64
+ schemaVersion: 1;
65
+ entries: {
66
+ path: string;
67
+ digest: string | null;
68
+ bytes: number;
69
+ }[];
70
+ };
71
+ sources: HarnessScopedContextSource[];
72
+ instructions: string;
73
+ }>;
@@ -2,7 +2,7 @@ import {
2
2
  discardMcpWorkspaceSnapshot,
3
3
  launchDockerMcpGroup,
4
4
  prepareMcpWorkspaceSnapshot
5
- } from "../index-1pn0ecs4.js";
5
+ } from "../index-tgt8gtq7.js";
6
6
  import {
7
7
  createAcpConnection,
8
8
  issueAcpMcpSessionProvider,
@@ -10,20 +10,20 @@ import {
10
10
  } from "../index-3ah1f369.js";
11
11
  import {
12
12
  createHarnessClientAdapter
13
- } from "../index-paf7z8kn.js";
14
- import"../index-4mn6m3bq.js";
13
+ } from "../index-tc2r2n8b.js";
14
+ import"../index-v86bh0eg.js";
15
15
  import {
16
16
  createHarness
17
- } from "../index-pf73y4gt.js";
18
- import"../index-amjttjaj.js";
19
- import"../index-2r4f0p4n.js";
20
- import"../index-w0m1nckc.js";
17
+ } from "../index-h8r80xhk.js";
18
+ import"../index-t6sjhxh8.js";
19
+ import"../index-yp0jtaxp.js";
20
+ import"../index-v17e1xs8.js";
21
21
  import"../index-1265j7t2.js";
22
22
  import"../index-c39197wq.js";
23
23
  import"../index-mzydbzp8.js";
24
24
  import"../index-bt2p8x7r.js";
25
- import"../index-fqqz1yt8.js";
26
- import"../index-rz7wmp71.js";
25
+ import"../index-qz4fs9f9.js";
26
+ import"../index-x9hv1a34.js";
27
27
  import"../index-6dxrbnxm.js";
28
28
  import"../index-4gt045j0.js";
29
29
  import"../index-bpc596v3.js";
@@ -2,18 +2,18 @@ import {
2
2
  createHarnessClientAdapter,
3
3
  runResultDocument,
4
4
  terminalContinuationMessages
5
- } from "../index-paf7z8kn.js";
6
- import"../index-4mn6m3bq.js";
7
- import"../index-pf73y4gt.js";
8
- import"../index-amjttjaj.js";
9
- import"../index-2r4f0p4n.js";
10
- import"../index-w0m1nckc.js";
5
+ } from "../index-tc2r2n8b.js";
6
+ import"../index-v86bh0eg.js";
7
+ import"../index-h8r80xhk.js";
8
+ import"../index-t6sjhxh8.js";
9
+ import"../index-yp0jtaxp.js";
10
+ import"../index-v17e1xs8.js";
11
11
  import"../index-1265j7t2.js";
12
12
  import"../index-c39197wq.js";
13
13
  import"../index-mzydbzp8.js";
14
14
  import"../index-bt2p8x7r.js";
15
- import"../index-fqqz1yt8.js";
16
- import"../index-rz7wmp71.js";
15
+ import"../index-qz4fs9f9.js";
16
+ import"../index-x9hv1a34.js";
17
17
  import"../index-6dxrbnxm.js";
18
18
  import {
19
19
  HARNESS_CLIENT_PROTOCOL_VERSION,
@@ -2,18 +2,18 @@ import {
2
2
  createArchivedHarnessStateBackup,
3
3
  createHarnessStateBackup,
4
4
  validateRecordedWorkspace
5
- } from "../index-rgqzdgv6.js";
6
- import"../index-4mn6m3bq.js";
5
+ } from "../index-k1a1xesg.js";
6
+ import"../index-v86bh0eg.js";
7
7
  import {
8
8
  HARNESS_SQLITE_FILE
9
- } from "../index-amjttjaj.js";
10
- import"../index-w0m1nckc.js";
9
+ } from "../index-t6sjhxh8.js";
10
+ import"../index-v17e1xs8.js";
11
11
  import"../index-1265j7t2.js";
12
12
  import"../index-c39197wq.js";
13
13
  import"../index-mzydbzp8.js";
14
14
  import {
15
15
  validateStateDirectory
16
- } from "../index-fqqz1yt8.js";
16
+ } from "../index-qz4fs9f9.js";
17
17
  import {
18
18
  SqliteDatabase,
19
19
  acquireSqliteAccess,
@@ -1,4 +1,8 @@
1
+ export { createProfiledHarness } from "../runtime/harness.js";
2
+ export type { CreateProfiledHarnessOptions } from "../runtime/harness.js";
1
3
  /** Terminal-free host engine surface. Named aliases retain their historical stability tiers. */
4
+ export { GENERAL_ASSISTANT_PROFILE, harnessAgentProfileSchema } from "../runtime/agent-profile.js";
5
+ export type { HarnessAgentProfile } from "../runtime/agent-profile.js";
2
6
  /** Experimental operator-owned project memory. See docs/PROJECT_MEMORY.md. */
3
7
  export { HARNESS_PROJECT_MEMORY_SCHEMA_VERSION, HARNESS_PROJECT_MEMORY_LIMITS, openHarnessProjectMemory } from "../persistence/project-memory.js";
4
8
  export type { HarnessProjectMemory, HarnessProjectMemoryEntry, HarnessProjectMemoryInput, HarnessProjectMemoryOptions, HarnessProjectMemoryView } from "../persistence/project-memory.js";
@@ -54,7 +54,7 @@ import {
54
54
  inspectHarnessState,
55
55
  readHarnessStateBackup,
56
56
  stateBackupBundleSchema
57
- } from "../index-rgqzdgv6.js";
57
+ } from "../index-k1a1xesg.js";
58
58
  import {
59
59
  CLI_COMMAND_OPTION_CONTRACTS,
60
60
  CLI_OPTION_DEFINITIONS,
@@ -73,7 +73,7 @@ import {
73
73
  exportHarnessGovernanceReport,
74
74
  harnessGovernanceReportSchema,
75
75
  renderHarnessGovernanceMarkdown
76
- } from "../index-zrz4rs7p.js";
76
+ } from "../index-r0q0r88h.js";
77
77
  import {
78
78
  CHANGE_ENVELOPE_DIGEST_ALGORITHM,
79
79
  CHANGE_ENVELOPE_SCHEMA_VERSION,
@@ -105,16 +105,17 @@ import {
105
105
  recoverHarnessLocalService,
106
106
  requestHarnessLocalService,
107
107
  startHarnessLocalService
108
- } from "../index-74f9yhfh.js";
108
+ } from "../index-ebb5d4s3.js";
109
109
  import {
110
110
  createHarnessClientAdapter
111
- } from "../index-paf7z8kn.js";
111
+ } from "../index-tc2r2n8b.js";
112
112
  import {
113
113
  openWorkspaceCheckpointStore
114
- } from "../index-4mn6m3bq.js";
114
+ } from "../index-v86bh0eg.js";
115
115
  import {
116
116
  DEFAULT_HARNESS_CONTEXT_MANIFEST,
117
117
  DEFAULT_HARNESS_PROJECT_INSTRUCTIONS,
118
+ GENERAL_ASSISTANT_PROFILE,
118
119
  HARNESS_CONTEXT_BUNDLE_SCHEMA_VERSION,
119
120
  HARNESS_CONTEXT_CONFIG_SCHEMA_VERSION,
120
121
  HARNESS_INSTRUCTIONS,
@@ -135,9 +136,11 @@ import {
135
136
  createHarness,
136
137
  createHarnessLifecycleDispatcher,
137
138
  createHarnessSubagents,
139
+ createProfiledHarness,
138
140
  createProgressMonitor,
139
141
  createSemanticCompactor,
140
142
  estimateMessageTokens,
143
+ harnessAgentProfileSchema,
141
144
  harnessContextConfigurationSchema,
142
145
  harnessContextFingerprintInput,
143
146
  harnessLifecycleFingerprintInput,
@@ -152,7 +155,7 @@ import {
152
155
  runHarness,
153
156
  runHarnessReviewGroup,
154
157
  selectHarnessModel
155
- } from "../index-pf73y4gt.js";
158
+ } from "../index-h8r80xhk.js";
156
159
  import {
157
160
  HARNESS_OPERATIONS_SCHEMA_VERSION,
158
161
  HARNESS_PROJECT_MEMORY_LIMITS,
@@ -166,7 +169,7 @@ import {
166
169
  migrateLegacyFileRuns,
167
170
  openHarnessPersistence,
168
171
  openHarnessProjectMemory
169
- } from "../index-amjttjaj.js";
172
+ } from "../index-t6sjhxh8.js";
170
173
  import {
171
174
  HARNESS_MCP_CONFIG_SCHEMA_VERSION,
172
175
  HARNESS_MCP_PERMISSIONS,
@@ -174,7 +177,7 @@ import {
174
177
  createHttpMcpClient,
175
178
  loadHarnessMcpConfiguration,
176
179
  normalizeHarnessMcpConfiguration
177
- } from "../index-2r4f0p4n.js";
180
+ } from "../index-yp0jtaxp.js";
178
181
  import {
179
182
  CliOciRuntimeAdapter,
180
183
  HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
@@ -186,7 +189,7 @@ import {
186
189
  describeOciCommand,
187
190
  executionFingerprintInput,
188
191
  harnessExecutionSession
189
- } from "../index-w0m1nckc.js";
192
+ } from "../index-v17e1xs8.js";
190
193
  import {
191
194
  BUILTIN_PROVIDER_REGISTRATIONS,
192
195
  DEFAULT_ALLOWED_CHECKS,
@@ -230,12 +233,12 @@ import {
230
233
  openSessionStore,
231
234
  taskAcceptanceContractSchema,
232
235
  validateStateDirectory
233
- } from "../index-fqqz1yt8.js";
236
+ } from "../index-qz4fs9f9.js";
234
237
  import {
235
238
  BUN_ENGINE_RANGE,
236
239
  HARNESS_VERSION,
237
240
  NODE_ENGINE_RANGE
238
- } from "../index-rz7wmp71.js";
241
+ } from "../index-x9hv1a34.js";
239
242
  import {
240
243
  EDIT_CONTRACT_SCHEMA_VERSION,
241
244
  EDIT_DIGEST_ALGORITHM,
@@ -374,6 +377,7 @@ export {
374
377
  DEFAULT_TIME_TO_SAFE_FIX_GOAL,
375
378
  EDIT_CONTRACT_SCHEMA_VERSION,
376
379
  EDIT_DIGEST_ALGORITHM,
380
+ GENERAL_ASSISTANT_PROFILE,
377
381
  HARNESS_CLIENT_PROTOCOL_VERSION,
378
382
  HARNESS_CONFIG_MIGRATABLE_SCHEMA_VERSIONS,
379
383
  HARNESS_CONFIG_SCHEMA_VERSION,
@@ -500,6 +504,7 @@ export {
500
504
  createHarnessSubagents,
501
505
  createHarnessToolPolicy,
502
506
  createHttpMcpClient,
507
+ createProfiledHarness,
503
508
  createProgressMonitor,
504
509
  createProviderModel,
505
510
  createProviderRegistry,
@@ -523,6 +528,7 @@ export {
523
528
  exportHarnessStateBackup,
524
529
  externalAttestationReferenceSchema,
525
530
  fileDigestSchema,
531
+ harnessAgentProfileSchema,
526
532
  harnessClientCommandSchema,
527
533
  harnessClientRequestSchema,
528
534
  harnessContextConfigurationSchema,