@zhivex-ai/harness 1.6.3 → 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.
- package/CHANGELOG.md +8 -1
- package/README.md +4 -4
- package/SECURITY.md +1 -1
- package/SUPPORT.md +2 -2
- package/benchmarks/README.md +72 -0
- package/contracts/engine-api.json +30 -0
- package/dist/acp-cli.js +8 -8
- package/dist/approvals/auto-approve.d.ts +1 -1
- package/dist/audit/index.js +3 -3
- package/dist/{audit-pack-s9n693by.js → audit-pack-y02n8zd0.js} +3 -3
- package/dist/{cli-entry-1epvek01.js → cli-entry-j6jcb2jb.js} +2 -2
- package/dist/{cli-entry-rsx0wpvs.js → cli-entry-td04s0fa.js} +340 -248
- package/dist/{cli-entry-mbcq96nx.js → cli-entry-v5db3eb2.js} +6 -2
- package/dist/{cli-entry-nyzyvf24.js → cli-entry-ynahz9qc.js} +68 -36
- package/dist/{cli-yxvq8qf1.js → cli-zw18kdqx.js} +6 -6
- package/dist/cli.js +2 -2
- package/dist/compat/code-support.d.ts +1 -0
- package/dist/compat/code-support.js +6 -6
- package/dist/context/scoped-context.d.ts +17 -5
- package/dist/engine/acp.js +9 -9
- package/dist/engine/client.js +8 -8
- package/dist/engine/desktop-state-v1.js +5 -5
- package/dist/engine/index.d.ts +4 -0
- package/dist/engine/index.js +17 -11
- package/dist/engine/mcp-stdio-v1.js +4 -4
- package/dist/engine/service.js +9 -9
- package/dist/hostile-repository-demo.js +570 -463
- package/dist/{index-2yyfg69h.js → index-ebb5d4s3.js} +33 -12
- package/dist/{index-vn91b9z1.js → index-h8r80xhk.js} +233 -118
- package/dist/{index-rgqzdgv6.js → index-k1a1xesg.js} +3 -3
- package/dist/{index-fqqz1yt8.js → index-qz4fs9f9.js} +14 -3
- package/dist/{index-5nmm0642.js → index-r0q0r88h.js} +2 -2
- package/dist/{index-amjttjaj.js → index-t6sjhxh8.js} +2 -2
- package/dist/{index-j466sekf.js → index-tc2r2n8b.js} +5 -5
- package/dist/{index-nxmk6re7.js → index-tgt8gtq7.js} +2 -2
- package/dist/{index-w0m1nckc.js → index-v17e1xs8.js} +22 -22
- package/dist/{index-4mn6m3bq.js → index-v86bh0eg.js} +2 -2
- package/dist/{index-3wwfn5n6.js → index-x9hv1a34.js} +6 -2
- package/dist/{index-hhrnrqfc.js → index-yp0jtaxp.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/runtime/agent-profile.d.ts +12 -0
- package/dist/runtime/harness.d.ts +11 -0
- package/dist/runtime/known-file-preload.d.ts +35 -0
- package/dist/service-cli.js +9 -9
- package/dist/{service-client-cli-xbj7j5kj.js → service-client-cli-gtk26axb.js} +3 -3
- package/dist/verify-historical-migrations.js +384 -277
- package/dist/zhx.js +2 -2
- package/docs/CODE_RELEASE.md +8 -4
- package/docs/CONTEXT_ENGINEERING.md +66 -0
- package/docs/ENGINE_API.md +8 -1
- package/docs/FIRST_USE.md +6 -6
- package/docs/PROJECT_MEMORY.md +1 -1
- package/docs/README.md +12 -4
- package/evaluations/representative-assembly-matrix.json +10 -1
- package/examples/README.md +4 -4
- package/package.json +6 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
workspaceCheckpointSchema,
|
|
3
3
|
workspaceRestoreOperationSchema
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-v86bh0eg.js";
|
|
5
5
|
import {
|
|
6
6
|
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
7
7
|
HARNESS_SQLITE_FILE,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
openHarnessPersistence,
|
|
10
10
|
projectMemoryRecordKey,
|
|
11
11
|
sqliteAdapter
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-t6sjhxh8.js";
|
|
13
13
|
import {
|
|
14
14
|
BUDGET_LEDGER_NAMESPACE,
|
|
15
15
|
BUDGET_OWNER_NAMESPACE_KEY,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
budgetLedgerNamespace,
|
|
19
19
|
openCliSessionStore,
|
|
20
20
|
validateStateDirectory
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-qz4fs9f9.js";
|
|
22
22
|
import {
|
|
23
23
|
SqliteDatabase,
|
|
24
24
|
readRegularFileChunksNoFollow
|
|
@@ -542,12 +542,23 @@ var openCliSessionStore = async (options) => {
|
|
|
542
542
|
ORDER BY activity_seq DESC
|
|
543
543
|
LIMIT ?3
|
|
544
544
|
`).all(workspaceKey, scopeKey, limit, search);
|
|
545
|
+
if (rows.length === 0)
|
|
546
|
+
return [];
|
|
547
|
+
const summaries = database.query(`
|
|
548
|
+
WITH totals AS (
|
|
549
|
+
SELECT session_id, COUNT(*) AS run_count, MAX(ordinal) AS latest_ordinal
|
|
550
|
+
FROM zhivex_cli_session_runs WHERE session_id IN (SELECT value FROM json_each(?))
|
|
551
|
+
GROUP BY session_id
|
|
552
|
+
)
|
|
553
|
+
SELECT r.*, totals.run_count FROM totals JOIN zhivex_cli_session_runs r
|
|
554
|
+
ON r.session_id=totals.session_id AND r.ordinal=totals.latest_ordinal
|
|
555
|
+
`).all(JSON.stringify(rows.map((row) => row.session_id)));
|
|
556
|
+
const bySession = new Map(summaries.map((row) => [row.session_id, row]));
|
|
545
557
|
return rows.map((row) => {
|
|
546
|
-
const latest =
|
|
547
|
-
const runCount = database.query("SELECT COUNT(*) AS count FROM zhivex_cli_session_runs WHERE session_id = ?1").get(row.session_id)?.count ?? 0;
|
|
558
|
+
const latest = bySession.get(row.session_id);
|
|
548
559
|
return {
|
|
549
560
|
...sessionBase(row),
|
|
550
|
-
runCount,
|
|
561
|
+
runCount: latest?.run_count ?? 0,
|
|
551
562
|
...latest ? { latestRun: toRunReference(latest) } : {}
|
|
552
563
|
};
|
|
553
564
|
});
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
inspectRuntimeManifest,
|
|
14
14
|
inspectUsageLedger,
|
|
15
15
|
readTaskAcceptanceLedger
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-qz4fs9f9.js";
|
|
17
17
|
import {
|
|
18
18
|
HARNESS_VERSION
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-x9hv1a34.js";
|
|
20
20
|
import {
|
|
21
21
|
taskCheckReceiptSchema
|
|
22
22
|
} from "./index-6dxrbnxm.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
harnessExecutionSession
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-v17e1xs8.js";
|
|
4
4
|
import {
|
|
5
5
|
defaultHarnessNamespace
|
|
6
6
|
} from "./index-1265j7t2.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
readTaskAcceptanceLedger,
|
|
23
23
|
validateStateDirectory,
|
|
24
24
|
withRuntimeInstruction
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-qz4fs9f9.js";
|
|
26
26
|
import {
|
|
27
27
|
SqliteDatabase
|
|
28
28
|
} from "./index-6dxrbnxm.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openWorkspaceCheckpointStore
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-v86bh0eg.js";
|
|
4
4
|
import {
|
|
5
5
|
appendUserMessage,
|
|
6
6
|
checkEvidence,
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
reviseHarnessTaskAcceptance,
|
|
17
17
|
runHarness,
|
|
18
18
|
runHarnessTask
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-h8r80xhk.js";
|
|
20
20
|
import {
|
|
21
21
|
ASSISTANT_RESPONSE_KEY,
|
|
22
22
|
TASK_SOURCE_KEY,
|
|
23
23
|
assistantResponses,
|
|
24
24
|
cancelHarnessRun,
|
|
25
25
|
captureTaskSources
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-t6sjhxh8.js";
|
|
27
27
|
import {
|
|
28
28
|
resolvePackageCheckCommand
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-v17e1xs8.js";
|
|
30
30
|
import {
|
|
31
31
|
APPROVAL_HISTORY_KEY,
|
|
32
32
|
approvalDecisionViews,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
nextTaskAcceptanceLedger,
|
|
49
49
|
openCliSessionStore,
|
|
50
50
|
readTaskAcceptanceLedger
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-qz4fs9f9.js";
|
|
52
52
|
import {
|
|
53
53
|
createEditProposal,
|
|
54
54
|
editProposalInputSchema,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
combineMcpHostSessions,
|
|
4
4
|
createHarnessMcpTools,
|
|
5
5
|
issueMcpHostSession
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-yp0jtaxp.js";
|
|
7
7
|
import {
|
|
8
8
|
collectSnapshotInventory,
|
|
9
9
|
readSnapshotFile,
|
|
10
10
|
runPortableProcess
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-v17e1xs8.js";
|
|
12
12
|
import {
|
|
13
13
|
readRegularFileNoFollow
|
|
14
14
|
} from "./index-6dxrbnxm.js";
|
|
@@ -1332,25 +1332,27 @@ class Workspace {
|
|
|
1332
1332
|
if (this.auditPath && this.auditEntries.length + count > 1e4)
|
|
1333
1333
|
throw new HarnessWorkspaceError("Mutation audit capacity exceeded; retain evidence and start a new run.");
|
|
1334
1334
|
}
|
|
1335
|
-
async audit(
|
|
1336
|
-
|
|
1337
|
-
|
|
1335
|
+
async audit(entries) {
|
|
1336
|
+
if (entries.length === 0)
|
|
1337
|
+
return [];
|
|
1338
|
+
const records = entries.map((entry) => ({ id: randomUUID(), timestamp: new Date().toISOString(), ...entry }));
|
|
1338
1339
|
if (this.auditPath) {
|
|
1339
1340
|
const temporary = `${this.auditPath}.${randomUUID()}.tmp`;
|
|
1340
|
-
const handle = await open2(temporary, "wx", 384);
|
|
1341
|
-
try {
|
|
1342
|
-
await handle.writeFile(JSON.stringify(this.auditEntries));
|
|
1343
|
-
await handle.sync();
|
|
1344
|
-
} finally {
|
|
1345
|
-
await handle.close();
|
|
1346
|
-
}
|
|
1347
1341
|
try {
|
|
1342
|
+
const handle = await open2(temporary, "wx", 384);
|
|
1343
|
+
try {
|
|
1344
|
+
await handle.writeFile(JSON.stringify([...this.auditEntries, ...records]));
|
|
1345
|
+
await handle.sync();
|
|
1346
|
+
} finally {
|
|
1347
|
+
await handle.close();
|
|
1348
|
+
}
|
|
1348
1349
|
await rename(temporary, this.auditPath);
|
|
1349
1350
|
} finally {
|
|
1350
1351
|
await unlink(temporary).catch(() => {});
|
|
1351
1352
|
}
|
|
1352
1353
|
}
|
|
1353
|
-
|
|
1354
|
+
this.auditEntries.push(...records);
|
|
1355
|
+
return records;
|
|
1354
1356
|
}
|
|
1355
1357
|
mutationAudit() {
|
|
1356
1358
|
return this.auditEntries.map((entry) => ({ ...entry }));
|
|
@@ -1582,14 +1584,12 @@ class Workspace {
|
|
|
1582
1584
|
throw error;
|
|
1583
1585
|
}
|
|
1584
1586
|
this.invalidateWorkspaceIndex();
|
|
1585
|
-
const changes =
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
afterDigest: digestBytes(item.change.content)
|
|
1592
|
-
}));
|
|
1587
|
+
const changes = await this.audit(prepared.map((item) => ({
|
|
1588
|
+
operation: item.before ? "update" : "create",
|
|
1589
|
+
path: item.change.path,
|
|
1590
|
+
...item.before ? { beforeDigest: item.before.digest } : {},
|
|
1591
|
+
afterDigest: digestBytes(item.change.content)
|
|
1592
|
+
})));
|
|
1593
1593
|
return { proposalId: proposal.proposalId, changes };
|
|
1594
1594
|
}
|
|
1595
1595
|
async writeFile(relativePath, content, overwrite = false) {
|
|
@@ -1649,7 +1649,7 @@ class Workspace {
|
|
|
1649
1649
|
throw error;
|
|
1650
1650
|
}
|
|
1651
1651
|
this.invalidateWorkspaceIndex();
|
|
1652
|
-
const audit = await this.audit({ operation: "move", path: parsed.source, destination: parsed.destination, beforeDigest: source.digest, afterDigest: source.digest });
|
|
1652
|
+
const audit = (await this.audit([{ operation: "move", path: parsed.source, destination: parsed.destination, beforeDigest: source.digest, afterDigest: source.digest }]))[0];
|
|
1653
1653
|
return { source: parsed.source, destination: parsed.destination, digest: source.digest, audit };
|
|
1654
1654
|
}
|
|
1655
1655
|
async secureQuarantineDirectory(create) {
|
|
@@ -1733,7 +1733,7 @@ class Workspace {
|
|
|
1733
1733
|
throw error;
|
|
1734
1734
|
}
|
|
1735
1735
|
this.invalidateWorkspaceIndex();
|
|
1736
|
-
const audit = await this.audit({ operation: "quarantine", path: parsed.path, beforeDigest: source.digest, quarantineId });
|
|
1736
|
+
const audit = (await this.audit([{ operation: "quarantine", path: parsed.path, beforeDigest: source.digest, quarantineId }]))[0];
|
|
1737
1737
|
return { quarantineId, path: parsed.path, digest: source.digest, audit };
|
|
1738
1738
|
}
|
|
1739
1739
|
async readRestorableQuarantine(quarantineId) {
|
|
@@ -1841,7 +1841,7 @@ class Workspace {
|
|
|
1841
1841
|
throw rollbackErrors.length ? new AggregateError([error, ...rollbackErrors], "Restore failed and rollback was incomplete.") : error;
|
|
1842
1842
|
}
|
|
1843
1843
|
this.invalidateWorkspaceIndex();
|
|
1844
|
-
const audit = await this.audit({ operation: "restore", path: destinationPath, afterDigest: digest, quarantineId: parsed.quarantineId });
|
|
1844
|
+
const audit = (await this.audit([{ operation: "restore", path: destinationPath, afterDigest: digest, quarantineId: parsed.quarantineId }]))[0];
|
|
1845
1845
|
return { quarantineId: parsed.quarantineId, path: destinationPath, digest, audit };
|
|
1846
1846
|
}
|
|
1847
1847
|
async runCheck(check, expectedScript, allowedChecks = DEFAULT_CHECKS) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@zhivex-ai/harness",
|
|
4
|
-
version: "1.
|
|
4
|
+
version: "1.7.0",
|
|
5
5
|
description: "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
|
|
6
6
|
type: "module",
|
|
7
7
|
license: "MIT",
|
|
@@ -169,6 +169,7 @@ var package_default = {
|
|
|
169
169
|
test: "bun test --preload ./tests/preload-bedrock-mock.ts ./tests ./desktop/tests",
|
|
170
170
|
evaluate: "bun run scripts/evaluate.ts",
|
|
171
171
|
"benchmark:workspace": "bun run scripts/benchmark-workspace.ts",
|
|
172
|
+
"benchmark:harness": "bun run scripts/benchmark-harness-overhead.ts",
|
|
172
173
|
"benchmark:workspace:ci": "bun run scripts/benchmark-workspace.ts --files 1000 --page-size 100 --repetitions 3 --warmups 0",
|
|
173
174
|
"benchmark:oci": "bun run scripts/benchmark-oci.ts",
|
|
174
175
|
"benchmark:safe-fix": "bun run scripts/benchmark-time-to-safe-fix.ts",
|
|
@@ -215,7 +216,10 @@ var package_default = {
|
|
|
215
216
|
"typecheck:code": "bun run --cwd packages/code typecheck",
|
|
216
217
|
"evaluate:tasks": "bun run scripts/task-acceptance.ts",
|
|
217
218
|
"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",
|
|
218
|
-
"smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts"
|
|
219
|
+
"smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts",
|
|
220
|
+
"prepare:assistant": "bun run build && bun install --cwd packages/assistant --frozen-lockfile --ignore-scripts && bun run --cwd packages/assistant prepare:local",
|
|
221
|
+
"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",
|
|
222
|
+
"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"
|
|
219
223
|
},
|
|
220
224
|
dependencies: {
|
|
221
225
|
"@zhivex-ai/agents": "1.12.0",
|
package/dist/index.js
CHANGED
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
inspectHarnessState,
|
|
64
64
|
readHarnessStateBackup,
|
|
65
65
|
stateBackupBundleSchema
|
|
66
|
-
} from "./index-
|
|
66
|
+
} from "./index-k1a1xesg.js";
|
|
67
67
|
import {
|
|
68
68
|
CLI_COMMAND_OPTION_CONTRACTS,
|
|
69
69
|
CLI_OPTION_DEFINITIONS,
|
|
@@ -109,13 +109,13 @@ import {
|
|
|
109
109
|
recoverHarnessLocalService,
|
|
110
110
|
requestHarnessLocalService,
|
|
111
111
|
startHarnessLocalService
|
|
112
|
-
} from "./index-
|
|
112
|
+
} from "./index-ebb5d4s3.js";
|
|
113
113
|
import {
|
|
114
114
|
createHarnessClientAdapter
|
|
115
|
-
} from "./index-
|
|
115
|
+
} from "./index-tc2r2n8b.js";
|
|
116
116
|
import {
|
|
117
117
|
openWorkspaceCheckpointStore
|
|
118
|
-
} from "./index-
|
|
118
|
+
} from "./index-v86bh0eg.js";
|
|
119
119
|
import {
|
|
120
120
|
DEFAULT_HARNESS_CONTEXT_MANIFEST,
|
|
121
121
|
DEFAULT_HARNESS_PROJECT_INSTRUCTIONS,
|
|
@@ -154,7 +154,7 @@ import {
|
|
|
154
154
|
runHarness,
|
|
155
155
|
runHarnessReviewGroup,
|
|
156
156
|
selectHarnessModel
|
|
157
|
-
} from "./index-
|
|
157
|
+
} from "./index-h8r80xhk.js";
|
|
158
158
|
import {
|
|
159
159
|
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
160
160
|
HARNESS_SQLITE_FILE,
|
|
@@ -165,7 +165,7 @@ import {
|
|
|
165
165
|
listHarnessRuns,
|
|
166
166
|
migrateLegacyFileRuns,
|
|
167
167
|
openHarnessPersistence
|
|
168
|
-
} from "./index-
|
|
168
|
+
} from "./index-t6sjhxh8.js";
|
|
169
169
|
import {
|
|
170
170
|
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
171
171
|
HARNESS_MCP_PERMISSIONS,
|
|
@@ -173,7 +173,7 @@ import {
|
|
|
173
173
|
createHttpMcpClient,
|
|
174
174
|
loadHarnessMcpConfiguration,
|
|
175
175
|
normalizeHarnessMcpConfiguration
|
|
176
|
-
} from "./index-
|
|
176
|
+
} from "./index-yp0jtaxp.js";
|
|
177
177
|
import {
|
|
178
178
|
CliOciRuntimeAdapter,
|
|
179
179
|
HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
|
|
@@ -185,7 +185,7 @@ import {
|
|
|
185
185
|
describeOciCommand,
|
|
186
186
|
executionFingerprintInput,
|
|
187
187
|
harnessExecutionSession
|
|
188
|
-
} from "./index-
|
|
188
|
+
} from "./index-v17e1xs8.js";
|
|
189
189
|
import {
|
|
190
190
|
BUILTIN_PROVIDER_REGISTRATIONS,
|
|
191
191
|
DEFAULT_ALLOWED_CHECKS,
|
|
@@ -226,12 +226,12 @@ import {
|
|
|
226
226
|
openCliSessionStore,
|
|
227
227
|
openSessionStore,
|
|
228
228
|
validateStateDirectory
|
|
229
|
-
} from "./index-
|
|
229
|
+
} from "./index-qz4fs9f9.js";
|
|
230
230
|
import {
|
|
231
231
|
BUN_ENGINE_RANGE,
|
|
232
232
|
HARNESS_VERSION,
|
|
233
233
|
NODE_ENGINE_RANGE
|
|
234
|
-
} from "./index-
|
|
234
|
+
} from "./index-x9hv1a34.js";
|
|
235
235
|
import {
|
|
236
236
|
EDIT_CONTRACT_SCHEMA_VERSION,
|
|
237
237
|
EDIT_DIGEST_ALGORITHM,
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Trusted host configuration. Profiles describe behavior, never grant permissions. */
|
|
3
|
+
export declare const harnessAgentProfileSchema: z.ZodObject<{
|
|
4
|
+
id: z.ZodString;
|
|
5
|
+
version: z.ZodString;
|
|
6
|
+
instructions: z.ZodString;
|
|
7
|
+
toolNames: z.ZodArray<z.ZodString>;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
export type HarnessAgentProfile = z.infer<typeof harnessAgentProfileSchema>;
|
|
10
|
+
export declare const GENERAL_ASSISTANT_PROFILE: Readonly<Omit<HarnessAgentProfile, "toolNames"> & {
|
|
11
|
+
toolNames: readonly string[];
|
|
12
|
+
}>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type KnownFilePreload } from "./known-file-preload.js";
|
|
1
2
|
import { type TaskTelemetrySnapshot } from './task-telemetry.js';
|
|
2
3
|
import { type HarnessSharedBudgetOptions } from "./shared-budget.js";
|
|
3
4
|
import { createRequestMeasurements } from '../context/request-measurements.js';
|
|
5
|
+
import { type HarnessAgentProfile } from "./agent-profile.js";
|
|
4
6
|
import { type HarnessIsolatedMcpSession } from '../integrations/mcp-host-session.js';
|
|
5
7
|
import { type HarnessDelegationContract } from "./delegation-contracts.js";
|
|
6
8
|
import { UsageLedger, type UsageAccountingOptions } from "./usage-ledger.js";
|
|
@@ -110,6 +112,8 @@ export interface HarnessRunOptions {
|
|
|
110
112
|
}
|
|
111
113
|
/** Experimental Code host options; the Stable runHarness contract remains unchanged. */
|
|
112
114
|
export interface HarnessTaskRunOptions extends HarnessRunOptions {
|
|
115
|
+
/** Opt-in bounded file snapshots for new local runs; never grants read permissions. */
|
|
116
|
+
preloadFiles?: KnownFilePreload;
|
|
113
117
|
taskBudgetExisting?: boolean;
|
|
114
118
|
taskBudgetContinue?: boolean;
|
|
115
119
|
/** Trusted host consent binding, rechecked during durable admission. Never metadata or model input. */
|
|
@@ -127,6 +131,13 @@ export declare const runHarnessTask: (harness: ZhivexHarness, input: AgentRunInp
|
|
|
127
131
|
export declare const estimateMessageTokens: (messages: readonly ModelMessage[]) => number;
|
|
128
132
|
export declare const compactHarnessMessages: (messages: readonly ModelMessage[]) => ModelMessage[];
|
|
129
133
|
export declare const createHarness: (options?: CreateHarnessOptions) => Promise<ZhivexHarness>;
|
|
134
|
+
export interface CreateProfiledHarnessOptions extends CreateHarnessOptions {
|
|
135
|
+
agentProfile: Readonly<Omit<HarnessAgentProfile, "toolNames"> & {
|
|
136
|
+
toolNames: readonly string[];
|
|
137
|
+
}>;
|
|
138
|
+
}
|
|
139
|
+
/** Experimental additive host API; leaves the stable coding constructor unchanged. */
|
|
140
|
+
export declare const createProfiledHarness: (options: CreateProfiledHarnessOptions) => Promise<ZhivexHarness>;
|
|
130
141
|
export declare const runHarness: (harness: ZhivexHarness, input: AgentRunInput<LanguageModel>, options?: HarnessRunOptions) => Promise<AgentRunOutput>;
|
|
131
142
|
export declare const appendUserMessage: (messages: readonly ModelMessage[], text: string) => ModelMessage[];
|
|
132
143
|
export { createWorkspaceTools } from "../tools/workspace.js";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolSet, LanguageModel, ToolApprovalPolicy } from '@zhivex-ai/core';
|
|
3
|
+
declare const schema: z.ZodObject<{
|
|
4
|
+
files: z.ZodArray<z.ZodObject<{
|
|
5
|
+
path: z.ZodString;
|
|
6
|
+
startLine: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
}, z.core.$strict>>;
|
|
9
|
+
maxBytes: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
/** Explicit host-selected context. Limits may only reduce the workspace reader's limits. */
|
|
12
|
+
export type KnownFilePreload = z.infer<typeof schema>;
|
|
13
|
+
export declare const parseKnownFilePreload: (value: KnownFilePreload) => {
|
|
14
|
+
files: {
|
|
15
|
+
path: string;
|
|
16
|
+
startLine?: number | undefined;
|
|
17
|
+
endLine?: number | undefined;
|
|
18
|
+
}[];
|
|
19
|
+
maxBytes?: number | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare function readKnownFilePreload(options: KnownFilePreload, tools: ToolSet, model: LanguageModel, signal?: AbortSignal, approvalPolicy?: ToolApprovalPolicy): Promise<{
|
|
22
|
+
text: string;
|
|
23
|
+
receipt: {
|
|
24
|
+
schemaVersion: number;
|
|
25
|
+
toolName: string;
|
|
26
|
+
requests: {
|
|
27
|
+
path: string;
|
|
28
|
+
startLine?: number | undefined;
|
|
29
|
+
endLine?: number | undefined;
|
|
30
|
+
}[];
|
|
31
|
+
bytes: number;
|
|
32
|
+
digest: string;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
export {};
|
package/dist/service-cli.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
import {
|
|
3
3
|
recoverHarnessLocalService,
|
|
4
4
|
startHarnessLocalService
|
|
5
|
-
} from "./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
5
|
+
} from "./index-ebb5d4s3.js";
|
|
6
|
+
import"./index-tc2r2n8b.js";
|
|
7
|
+
import"./index-v86bh0eg.js";
|
|
8
8
|
import {
|
|
9
9
|
createHarness
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
10
|
+
} from "./index-h8r80xhk.js";
|
|
11
|
+
import"./index-t6sjhxh8.js";
|
|
12
|
+
import"./index-yp0jtaxp.js";
|
|
13
|
+
import"./index-v17e1xs8.js";
|
|
14
14
|
import"./index-1265j7t2.js";
|
|
15
15
|
import"./index-c39197wq.js";
|
|
16
16
|
import"./index-mzydbzp8.js";
|
|
17
17
|
import"./index-bt2p8x7r.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
18
|
+
import"./index-qz4fs9f9.js";
|
|
19
|
+
import"./index-x9hv1a34.js";
|
|
20
20
|
import"./index-6dxrbnxm.js";
|
|
21
21
|
import"./index-4gt045j0.js";
|
|
22
22
|
import"./index-bpc596v3.js";
|
|
@@ -9,17 +9,17 @@ import {
|
|
|
9
9
|
navigateConsole,
|
|
10
10
|
printPolicyInspection,
|
|
11
11
|
sanitizeTerminalText
|
|
12
|
-
} from "./cli-entry-
|
|
12
|
+
} from "./cli-entry-td04s0fa.js";
|
|
13
13
|
import {
|
|
14
14
|
CLI_EVENT_SCHEMA_VERSION,
|
|
15
15
|
CLI_JSON_SCHEMA_VERSION,
|
|
16
16
|
changeEnvelopeSchema,
|
|
17
17
|
harnessPolicyDecisionEventSchema,
|
|
18
18
|
serializeStreamResult
|
|
19
|
-
} from "./cli-entry-
|
|
19
|
+
} from "./cli-entry-ynahz9qc.js";
|
|
20
20
|
import {
|
|
21
21
|
HARNESS_VERSION
|
|
22
|
-
} from "./cli-entry-
|
|
22
|
+
} from "./cli-entry-v5db3eb2.js";
|
|
23
23
|
import {
|
|
24
24
|
HARNESS_ERROR_CODES,
|
|
25
25
|
HARNESS_ERROR_SCHEMA_VERSION,
|