@zhivex-ai/harness 1.5.0 → 1.6.2
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 +20 -0
- package/README.md +1 -1
- package/SUPPORT.md +1 -1
- package/contracts/stable-api-signatures.json +7 -7
- package/dist/acp-cli.js +7 -7
- package/dist/approvals/auto-approve.d.ts +137 -0
- package/dist/audit/index.js +2 -2
- package/dist/{audit-pack-kvw7ng34.js → audit-pack-fckpqfsb.js} +3 -3
- package/dist/{cli-vyrytn3m.js → cli-84en174d.js} +6 -6
- package/dist/{cli-entry-q8bgkn9m.js → cli-entry-10th5awp.js} +16 -15
- package/dist/{cli-entry-h2yc9x37.js → cli-entry-4g2ewcnw.js} +10 -2
- package/dist/{cli-entry-928p8h41.js → cli-entry-6amx4mcc.js} +75 -11
- package/dist/{cli-entry-75j3r49b.js → cli-entry-z1pbjrg4.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/compat/code-support.js +5 -5
- package/dist/engine/acp.js +8 -8
- package/dist/engine/client.js +7 -7
- package/dist/engine/desktop-state-v1.js +4 -4
- package/dist/engine/index.js +10 -10
- package/dist/engine/mcp-stdio-v1.js +4 -4
- package/dist/engine/service.js +8 -8
- package/dist/hostile-repository-demo.js +98 -25
- package/dist/{index-96ezrvg2.js → index-1pn0ecs4.js} +2 -2
- package/dist/{index-5zbq9ztj.js → index-2r4f0p4n.js} +1 -1
- package/dist/{index-63gbp0cz.js → index-4mn6m3bq.js} +1 -1
- package/dist/{index-vvzc5ezz.js → index-74f9yhfh.js} +1 -1
- package/dist/{index-wwthv10a.js → index-amjttjaj.js} +1 -1
- package/dist/{index-vc7yxz50.js → index-paf7z8kn.js} +4 -4
- package/dist/{index-6fp7kdpx.js → index-pf73y4gt.js} +12 -4
- package/dist/{index-xfedewpt.js → index-rgqzdgv6.js} +2 -2
- package/dist/{index-pq3kz1r8.js → index-rz7wmp71.js} +16 -15
- package/dist/{index-ggstwr0v.js → index-w0m1nckc.js} +74 -10
- package/dist/{index-jpdvn09j.js → index-zrz4rs7p.js} +1 -1
- package/dist/index.js +9 -9
- package/dist/providers/bedrock.d.ts +1 -1
- package/dist/review/reveal-invisible.d.ts +13 -0
- package/dist/service-cli.js +8 -8
- package/dist/{service-client-cli-v6qptg9x.js → service-client-cli-pp5z4dmf.js} +3 -3
- package/dist/verify-historical-migrations.js +98 -25
- package/dist/workspace/text-integrity.d.ts +19 -0
- package/dist/workspace/workspace.d.ts +8 -3
- package/dist/zhx.js +2 -2
- package/docs/AUTO_APPROVE.md +51 -0
- package/docs/AZURE_OPENAI.md +4 -4
- package/docs/BEDROCK.md +4 -4
- package/docs/CLI.md +13 -0
- package/docs/CODE_RELEASE.md +8 -0
- package/docs/CREDENTIALS.md +1 -1
- package/docs/DURABLE_OPERATIONS.md +1 -1
- package/docs/ENGINE_API.md +1 -1
- package/docs/EXTENSIBILITY.md +1 -1
- package/docs/FIRST_USE.md +6 -6
- package/docs/MINIMUM_TASK_AUTHORITY.md +5 -5
- package/docs/PROJECT_MEMORY.md +1 -1
- package/docs/TOOL_POLICY.md +3 -0
- package/docs/VERTEX.md +2 -2
- package/docs/WEB_LIMITS.md +2 -2
- package/docs/adr/0002-isolated-mcp-stdio.md +1 -1
- package/evaluations/representative-assembly-matrix.json +28 -1
- package/examples/README.md +3 -3
- package/package.json +16 -15
|
@@ -13,18 +13,18 @@ import {
|
|
|
13
13
|
readHarnessTaskDraft,
|
|
14
14
|
requestHarnessTaskCancellation,
|
|
15
15
|
runHarnessTask
|
|
16
|
-
} from "../index-
|
|
16
|
+
} from "../index-pf73y4gt.js";
|
|
17
17
|
import {
|
|
18
18
|
TASK_SOURCE_KEY,
|
|
19
19
|
harnessToolExecution,
|
|
20
20
|
taskSources
|
|
21
|
-
} from "../index-
|
|
22
|
-
import"../index-
|
|
21
|
+
} from "../index-amjttjaj.js";
|
|
22
|
+
import"../index-2r4f0p4n.js";
|
|
23
23
|
import {
|
|
24
24
|
resolvePackageCheckCommand,
|
|
25
25
|
resolvePackageManager,
|
|
26
26
|
runPortableProcess
|
|
27
|
-
} from "../index-
|
|
27
|
+
} from "../index-w0m1nckc.js";
|
|
28
28
|
import {
|
|
29
29
|
DEFAULT_HARNESS_MAX_STEPS,
|
|
30
30
|
modelReasoningEfforts,
|
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
inspectUsageLedger,
|
|
48
48
|
usagePricingSchema
|
|
49
49
|
} from "../index-fqqz1yt8.js";
|
|
50
|
-
import"../index-
|
|
50
|
+
import"../index-rz7wmp71.js";
|
|
51
51
|
import {
|
|
52
52
|
FileChangedWhileReadingError,
|
|
53
53
|
FileSizeLimitError,
|
package/dist/engine/acp.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
discardMcpWorkspaceSnapshot,
|
|
3
3
|
launchDockerMcpGroup,
|
|
4
4
|
prepareMcpWorkspaceSnapshot
|
|
5
|
-
} from "../index-
|
|
5
|
+
} from "../index-1pn0ecs4.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-
|
|
14
|
-
import"../index-
|
|
13
|
+
} from "../index-paf7z8kn.js";
|
|
14
|
+
import"../index-4mn6m3bq.js";
|
|
15
15
|
import {
|
|
16
16
|
createHarness
|
|
17
|
-
} from "../index-
|
|
18
|
-
import"../index-
|
|
19
|
-
import"../index-
|
|
20
|
-
import"../index-
|
|
17
|
+
} from "../index-pf73y4gt.js";
|
|
18
|
+
import"../index-amjttjaj.js";
|
|
19
|
+
import"../index-2r4f0p4n.js";
|
|
20
|
+
import"../index-w0m1nckc.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
25
|
import"../index-fqqz1yt8.js";
|
|
26
|
-
import"../index-
|
|
26
|
+
import"../index-rz7wmp71.js";
|
|
27
27
|
import"../index-6dxrbnxm.js";
|
|
28
28
|
import"../index-4gt045j0.js";
|
|
29
29
|
import"../index-bpc596v3.js";
|
package/dist/engine/client.js
CHANGED
|
@@ -2,18 +2,18 @@ import {
|
|
|
2
2
|
createHarnessClientAdapter,
|
|
3
3
|
runResultDocument,
|
|
4
4
|
terminalContinuationMessages
|
|
5
|
-
} from "../index-
|
|
6
|
-
import"../index-
|
|
7
|
-
import"../index-
|
|
8
|
-
import"../index-
|
|
9
|
-
import"../index-
|
|
10
|
-
import"../index-
|
|
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";
|
|
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
15
|
import"../index-fqqz1yt8.js";
|
|
16
|
-
import"../index-
|
|
16
|
+
import"../index-rz7wmp71.js";
|
|
17
17
|
import"../index-6dxrbnxm.js";
|
|
18
18
|
import {
|
|
19
19
|
HARNESS_CLIENT_PROTOCOL_VERSION,
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createArchivedHarnessStateBackup,
|
|
3
3
|
createHarnessStateBackup,
|
|
4
4
|
validateRecordedWorkspace
|
|
5
|
-
} from "../index-
|
|
6
|
-
import"../index-
|
|
5
|
+
} from "../index-rgqzdgv6.js";
|
|
6
|
+
import"../index-4mn6m3bq.js";
|
|
7
7
|
import {
|
|
8
8
|
HARNESS_SQLITE_FILE
|
|
9
|
-
} from "../index-
|
|
10
|
-
import"../index-
|
|
9
|
+
} from "../index-amjttjaj.js";
|
|
10
|
+
import"../index-w0m1nckc.js";
|
|
11
11
|
import"../index-1265j7t2.js";
|
|
12
12
|
import"../index-c39197wq.js";
|
|
13
13
|
import"../index-mzydbzp8.js";
|
package/dist/engine/index.js
CHANGED
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
inspectHarnessState,
|
|
55
55
|
readHarnessStateBackup,
|
|
56
56
|
stateBackupBundleSchema
|
|
57
|
-
} from "../index-
|
|
57
|
+
} from "../index-rgqzdgv6.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-
|
|
76
|
+
} from "../index-zrz4rs7p.js";
|
|
77
77
|
import {
|
|
78
78
|
CHANGE_ENVELOPE_DIGEST_ALGORITHM,
|
|
79
79
|
CHANGE_ENVELOPE_SCHEMA_VERSION,
|
|
@@ -105,13 +105,13 @@ import {
|
|
|
105
105
|
recoverHarnessLocalService,
|
|
106
106
|
requestHarnessLocalService,
|
|
107
107
|
startHarnessLocalService
|
|
108
|
-
} from "../index-
|
|
108
|
+
} from "../index-74f9yhfh.js";
|
|
109
109
|
import {
|
|
110
110
|
createHarnessClientAdapter
|
|
111
|
-
} from "../index-
|
|
111
|
+
} from "../index-paf7z8kn.js";
|
|
112
112
|
import {
|
|
113
113
|
openWorkspaceCheckpointStore
|
|
114
|
-
} from "../index-
|
|
114
|
+
} from "../index-4mn6m3bq.js";
|
|
115
115
|
import {
|
|
116
116
|
DEFAULT_HARNESS_CONTEXT_MANIFEST,
|
|
117
117
|
DEFAULT_HARNESS_PROJECT_INSTRUCTIONS,
|
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
runHarness,
|
|
153
153
|
runHarnessReviewGroup,
|
|
154
154
|
selectHarnessModel
|
|
155
|
-
} from "../index-
|
|
155
|
+
} from "../index-pf73y4gt.js";
|
|
156
156
|
import {
|
|
157
157
|
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
158
158
|
HARNESS_PROJECT_MEMORY_LIMITS,
|
|
@@ -166,7 +166,7 @@ import {
|
|
|
166
166
|
migrateLegacyFileRuns,
|
|
167
167
|
openHarnessPersistence,
|
|
168
168
|
openHarnessProjectMemory
|
|
169
|
-
} from "../index-
|
|
169
|
+
} from "../index-amjttjaj.js";
|
|
170
170
|
import {
|
|
171
171
|
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
172
172
|
HARNESS_MCP_PERMISSIONS,
|
|
@@ -174,7 +174,7 @@ import {
|
|
|
174
174
|
createHttpMcpClient,
|
|
175
175
|
loadHarnessMcpConfiguration,
|
|
176
176
|
normalizeHarnessMcpConfiguration
|
|
177
|
-
} from "../index-
|
|
177
|
+
} from "../index-2r4f0p4n.js";
|
|
178
178
|
import {
|
|
179
179
|
CliOciRuntimeAdapter,
|
|
180
180
|
HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
describeOciCommand,
|
|
187
187
|
executionFingerprintInput,
|
|
188
188
|
harnessExecutionSession
|
|
189
|
-
} from "../index-
|
|
189
|
+
} from "../index-w0m1nckc.js";
|
|
190
190
|
import {
|
|
191
191
|
BUILTIN_PROVIDER_REGISTRATIONS,
|
|
192
192
|
DEFAULT_ALLOWED_CHECKS,
|
|
@@ -235,7 +235,7 @@ import {
|
|
|
235
235
|
BUN_ENGINE_RANGE,
|
|
236
236
|
HARNESS_VERSION,
|
|
237
237
|
NODE_ENGINE_RANGE
|
|
238
|
-
} from "../index-
|
|
238
|
+
} from "../index-rz7wmp71.js";
|
|
239
239
|
import {
|
|
240
240
|
EDIT_CONTRACT_SCHEMA_VERSION,
|
|
241
241
|
EDIT_DIGEST_ALGORITHM,
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
mcpResourcePlanSchema,
|
|
9
9
|
prepareMcpWorkspaceSnapshot,
|
|
10
10
|
recoverDockerMcpResources
|
|
11
|
-
} from "../index-
|
|
12
|
-
import"../index-
|
|
13
|
-
import"../index-
|
|
11
|
+
} from "../index-1pn0ecs4.js";
|
|
12
|
+
import"../index-2r4f0p4n.js";
|
|
13
|
+
import"../index-w0m1nckc.js";
|
|
14
14
|
import"../index-1265j7t2.js";
|
|
15
15
|
import"../index-c39197wq.js";
|
|
16
16
|
import"../index-mzydbzp8.js";
|
|
17
|
-
import"../index-
|
|
17
|
+
import"../index-rz7wmp71.js";
|
|
18
18
|
import"../index-6dxrbnxm.js";
|
|
19
19
|
import"../index-bpc596v3.js";
|
|
20
20
|
import"../index-fm84men1.js";
|
package/dist/engine/service.js
CHANGED
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
recoverHarnessLocalService,
|
|
6
6
|
requestHarnessLocalService,
|
|
7
7
|
startHarnessLocalService
|
|
8
|
-
} from "../index-
|
|
9
|
-
import"../index-
|
|
10
|
-
import"../index-
|
|
11
|
-
import"../index-
|
|
12
|
-
import"../index-
|
|
13
|
-
import"../index-
|
|
14
|
-
import"../index-
|
|
8
|
+
} from "../index-74f9yhfh.js";
|
|
9
|
+
import"../index-paf7z8kn.js";
|
|
10
|
+
import"../index-4mn6m3bq.js";
|
|
11
|
+
import"../index-pf73y4gt.js";
|
|
12
|
+
import"../index-amjttjaj.js";
|
|
13
|
+
import"../index-2r4f0p4n.js";
|
|
14
|
+
import"../index-w0m1nckc.js";
|
|
15
15
|
import"../index-1265j7t2.js";
|
|
16
16
|
import"../index-c39197wq.js";
|
|
17
17
|
import"../index-mzydbzp8.js";
|
|
18
18
|
import"../index-bt2p8x7r.js";
|
|
19
19
|
import"../index-fqqz1yt8.js";
|
|
20
|
-
import"../index-
|
|
20
|
+
import"../index-rz7wmp71.js";
|
|
21
21
|
import"../index-6dxrbnxm.js";
|
|
22
22
|
import"../index-4gt045j0.js";
|
|
23
23
|
import"../index-bpc596v3.js";
|
|
@@ -4154,6 +4154,55 @@ var runPortableProcess = async (command, options = {}) => {
|
|
|
4154
4154
|
}
|
|
4155
4155
|
};
|
|
4156
4156
|
|
|
4157
|
+
// src/workspace/text-integrity.ts
|
|
4158
|
+
var controlLabel = (code) => code === 0 ? "NUL byte" : `U+${code.toString(16).padStart(4, "0")}`;
|
|
4159
|
+
var firstDisallowedControl = (text2) => {
|
|
4160
|
+
let line = 1;
|
|
4161
|
+
for (let index = 0;index < text2.length; index += 1) {
|
|
4162
|
+
const code = text2.charCodeAt(index);
|
|
4163
|
+
if (code === 10) {
|
|
4164
|
+
line += 1;
|
|
4165
|
+
continue;
|
|
4166
|
+
}
|
|
4167
|
+
if (code === 9 || code === 13)
|
|
4168
|
+
continue;
|
|
4169
|
+
if (code < 32 || code === 127 || code >= 128 && code <= 159)
|
|
4170
|
+
return { line, label: controlLabel(code) };
|
|
4171
|
+
}
|
|
4172
|
+
return;
|
|
4173
|
+
};
|
|
4174
|
+
var firstDisallowedControlBytes = (bytes) => {
|
|
4175
|
+
let line = 1;
|
|
4176
|
+
for (let index = 0;index < bytes.length; index += 1) {
|
|
4177
|
+
const code = bytes[index] ?? 0;
|
|
4178
|
+
if (code === 10) {
|
|
4179
|
+
line += 1;
|
|
4180
|
+
continue;
|
|
4181
|
+
}
|
|
4182
|
+
if (code === 9 || code === 13)
|
|
4183
|
+
continue;
|
|
4184
|
+
if (code < 32 || code === 127)
|
|
4185
|
+
return { line, label: controlLabel(code) };
|
|
4186
|
+
}
|
|
4187
|
+
return;
|
|
4188
|
+
};
|
|
4189
|
+
var refuseControlMessage = (hit) => `Refusing to write a control byte into a text file: ${hit.label} at L${hit.line}. The file was not changed. Remove the control byte.`;
|
|
4190
|
+
var binaryAfterEditMessage = (hit) => `file is binary after edit: ${hit.label} at L${hit.line}. The edit was reverted. Read the file again before retrying.`;
|
|
4191
|
+
var textGuards = {
|
|
4192
|
+
beforeWrite(content, allowControlBytes) {
|
|
4193
|
+
if (allowControlBytes)
|
|
4194
|
+
return;
|
|
4195
|
+
const problem = firstDisallowedControl(content);
|
|
4196
|
+
if (problem)
|
|
4197
|
+
throw new HarnessWorkspaceError(refuseControlMessage(problem));
|
|
4198
|
+
},
|
|
4199
|
+
afterWrite(bytes, allowControlBytes) {
|
|
4200
|
+
if (allowControlBytes)
|
|
4201
|
+
return;
|
|
4202
|
+
return firstDisallowedControlBytes(bytes);
|
|
4203
|
+
}
|
|
4204
|
+
};
|
|
4205
|
+
|
|
4157
4206
|
// src/workspace/path-policy.ts
|
|
4158
4207
|
var HARD_IGNORES = new Set([".git", ".next", ".turbo", ".zhivex-harness", "coverage", "dist", "node_modules"]);
|
|
4159
4208
|
var isSensitiveName = (name) => {
|
|
@@ -4483,8 +4532,11 @@ class Workspace {
|
|
|
4483
4532
|
maxBytes: MAX_FILE_BYTES
|
|
4484
4533
|
});
|
|
4485
4534
|
const { contents } = file;
|
|
4486
|
-
if (!allowBinary && contents.includes(0))
|
|
4487
|
-
|
|
4535
|
+
if (!allowBinary && contents.includes(0)) {
|
|
4536
|
+
const hit = firstDisallowedControlBytes(contents);
|
|
4537
|
+
const where = hit ? `: ${hit.label} at L${hit.line}` : "";
|
|
4538
|
+
throw new HarnessWorkspaceError(`The file appears to be binary and cannot be read as text${where}.`);
|
|
4539
|
+
}
|
|
4488
4540
|
return {
|
|
4489
4541
|
path: wirePath(path8.relative(this.root, safe.path)),
|
|
4490
4542
|
absolutePath: safe.path,
|
|
@@ -5151,19 +5203,23 @@ class Workspace {
|
|
|
5151
5203
|
if (position < 0 || text2.indexOf(edit.oldText, position + 1) >= 0) {
|
|
5152
5204
|
throw new HarnessWorkspaceError("Replacement requires exactly one literal match; include more surrounding context.");
|
|
5153
5205
|
}
|
|
5154
|
-
return [{
|
|
5206
|
+
return [{
|
|
5207
|
+
path: edit.path,
|
|
5208
|
+
expectedDigest: edit.expectedDigest,
|
|
5209
|
+
content: text2.slice(0, position) + edit.newText + text2.slice(position + edit.oldText.length)
|
|
5210
|
+
}];
|
|
5155
5211
|
}
|
|
5156
|
-
async applyReplacement(input) {
|
|
5212
|
+
async applyReplacement(input, host = {}) {
|
|
5157
5213
|
const changes = await this.replacementChanges(input);
|
|
5158
|
-
return this.applyPatch({ proposalId: createEditProposal({ changes }).proposalId, changes });
|
|
5214
|
+
return this.applyPatch({ proposalId: createEditProposal({ changes }).proposalId, changes }, host);
|
|
5159
5215
|
}
|
|
5160
|
-
async applyPatch(input) {
|
|
5161
|
-
return this.applyPatchWithModes(input, new Map);
|
|
5216
|
+
async applyPatch(input, host = {}) {
|
|
5217
|
+
return this.applyPatchWithModes(input, new Map, undefined, host);
|
|
5162
5218
|
}
|
|
5163
|
-
async applyPatchWithModes(input, modes, assertActive) {
|
|
5164
|
-
return withWorkspaceMutation(this.root, () => this.applyPatchWithModesLocked(input, modes, assertActive));
|
|
5219
|
+
async applyPatchWithModes(input, modes, assertActive, host = {}) {
|
|
5220
|
+
return withWorkspaceMutation(this.root, () => this.applyPatchWithModesLocked(input, modes, assertActive, host));
|
|
5165
5221
|
}
|
|
5166
|
-
async applyPatchWithModesLocked(input, modes, assertActive) {
|
|
5222
|
+
async applyPatchWithModesLocked(input, modes, assertActive, host = {}) {
|
|
5167
5223
|
const proposal = validateEditProposal(input);
|
|
5168
5224
|
this.checkAuditCapacity(proposal.changes.length);
|
|
5169
5225
|
const targetPaths = new Set(proposal.changes.map((change) => change.path));
|
|
@@ -5208,6 +5264,7 @@ class Workspace {
|
|
|
5208
5264
|
throw new HarnessWorkspaceError(`Stale patch mode rejected for ${change.path}: expected ${modeBinding.beforeMode.toString(8)}, found ${before.mode.toString(8)}.`);
|
|
5209
5265
|
}
|
|
5210
5266
|
}
|
|
5267
|
+
textGuards.beforeWrite(change.content, host.allowControlBytes === true);
|
|
5211
5268
|
const temporary = await this.stageFile(safe.path, change.content, modeBinding?.afterMode ?? before?.mode ?? 420);
|
|
5212
5269
|
prepared.push({
|
|
5213
5270
|
change,
|
|
@@ -5247,6 +5304,13 @@ class Workspace {
|
|
|
5247
5304
|
await unlink(item.temporary);
|
|
5248
5305
|
}
|
|
5249
5306
|
committed.push(item);
|
|
5307
|
+
const published = await readRegularFileNoFollow(item.target, {
|
|
5308
|
+
label: "The published file",
|
|
5309
|
+
maxBytes: MAX_FILE_BYTES
|
|
5310
|
+
});
|
|
5311
|
+
const corrupt = textGuards.afterWrite(published.contents, host.allowControlBytes === true);
|
|
5312
|
+
if (corrupt)
|
|
5313
|
+
throw new HarnessWorkspaceError(binaryAfterEditMessage(corrupt));
|
|
5250
5314
|
await assertActive?.();
|
|
5251
5315
|
}
|
|
5252
5316
|
} catch (error) {
|
|
@@ -12486,6 +12550,7 @@ var record2 = (value) => value !== null && typeof value === "object" && !Array.i
|
|
|
12486
12550
|
var LOCAL_TOOLS = LOCAL_TOOL_NAMES;
|
|
12487
12551
|
var MAX_USER_STEERING = 10;
|
|
12488
12552
|
var CONTEXT_PRIORITY = "Latest user > chronological user steering > historical objective. Assistant never overrides user facts. Questions retain task.";
|
|
12553
|
+
var EARLIER = "[before later user messages] ";
|
|
12489
12554
|
var summarizeHarnessMessages = (messages, maxCharacters = 4000) => {
|
|
12490
12555
|
const redaction = createRedactionPolicy6({ includeEmails: true });
|
|
12491
12556
|
const clean = (text3, limit = 512) => redaction.redactText(text3).replace(/\bBearer\s+\S+/gi, "Bearer [REDACTED]").replace(/\b([A-Z][A-Z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD)|api[_-]?key|access[_-]?token|password)\s*([=:])\s*(?:"[^"]*"|'[^']*'|\S+)/gi, "$1$2[REDACTED]").replace(/\b(?:sk|ghp|gho|github_pat)-[A-Za-z0-9_-]{8,}\b/g, "[REDACTED]").replace(/\s+/g, " ").trim().slice(0, limit);
|
|
@@ -12511,6 +12576,12 @@ var summarizeHarnessMessages = (messages, maxCharacters = 4000) => {
|
|
|
12511
12576
|
omitted = true;
|
|
12512
12577
|
}
|
|
12513
12578
|
};
|
|
12579
|
+
const markRecentEarlier = () => {
|
|
12580
|
+
const marked = recent.map((value) => value.startsWith(EARLIER) ? value : `${EARLIER}${value}`);
|
|
12581
|
+
recent.length = 0;
|
|
12582
|
+
for (const value of marked)
|
|
12583
|
+
add(recent, value, 4);
|
|
12584
|
+
};
|
|
12514
12585
|
const rememberObservation = (tool3, detail) => {
|
|
12515
12586
|
if (typeof tool3 !== "string" || !LOCAL_TOOLS.has(tool3) || typeof detail !== "string")
|
|
12516
12587
|
return;
|
|
@@ -12628,6 +12699,7 @@ var summarizeHarnessMessages = (messages, maxCharacters = 4000) => {
|
|
|
12628
12699
|
objective = text3;
|
|
12629
12700
|
if (historicalObjective)
|
|
12630
12701
|
add(steering, text3, MAX_USER_STEERING);
|
|
12702
|
+
markRecentEarlier();
|
|
12631
12703
|
} else
|
|
12632
12704
|
add(recent, `${message.role}: ${text3}`, 4);
|
|
12633
12705
|
} else if (part.type === "tool-call") {
|
|
@@ -14875,7 +14947,7 @@ import { z as z32 } from "zod";
|
|
|
14875
14947
|
// package.json
|
|
14876
14948
|
var package_default = {
|
|
14877
14949
|
name: "@zhivex-ai/harness",
|
|
14878
|
-
version: "1.
|
|
14950
|
+
version: "1.6.2",
|
|
14879
14951
|
description: "Governed, provider-portable runtime for coding agents with durable approvals and isolated repository execution.",
|
|
14880
14952
|
type: "module",
|
|
14881
14953
|
license: "MIT",
|
|
@@ -14975,6 +15047,7 @@ var package_default = {
|
|
|
14975
15047
|
"LICENSE",
|
|
14976
15048
|
"docs/CHANGE_ENVELOPES.md",
|
|
14977
15049
|
"docs/CLI.md",
|
|
15050
|
+
"docs/AUTO_APPROVE.md",
|
|
14978
15051
|
"docs/WEB_LIMITS.md",
|
|
14979
15052
|
"docs/CODE_RELEASE.md",
|
|
14980
15053
|
"docs/CODE_WEB_TASKS.md",
|
|
@@ -15091,26 +15164,26 @@ var package_default = {
|
|
|
15091
15164
|
"smoke:mcp:installed": "bun run build && bun scripts/mcp-installed-smoke.ts"
|
|
15092
15165
|
},
|
|
15093
15166
|
dependencies: {
|
|
15094
|
-
"@zhivex-ai/agents": "1.
|
|
15095
|
-
"@zhivex-ai/anthropic": "0.
|
|
15096
|
-
"@zhivex-ai/azure-openai": "0.
|
|
15097
|
-
"@zhivex-ai/bedrock": "2.0
|
|
15098
|
-
"@zhivex-ai/core": "1.
|
|
15099
|
-
"@zhivex-ai/gemini": "0.
|
|
15100
|
-
"@zhivex-ai/meta": "0.
|
|
15101
|
-
"@zhivex-ai/openai": "0.
|
|
15102
|
-
"@zhivex-ai/qwen": "0.
|
|
15103
|
-
"@zhivex-ai/vertex": "1.
|
|
15104
|
-
"google-auth-library": "11.1
|
|
15105
|
-
zod: "4.6.
|
|
15167
|
+
"@zhivex-ai/agents": "1.12.0",
|
|
15168
|
+
"@zhivex-ai/anthropic": "0.15.0",
|
|
15169
|
+
"@zhivex-ai/azure-openai": "0.8.0",
|
|
15170
|
+
"@zhivex-ai/bedrock": "2.1.0",
|
|
15171
|
+
"@zhivex-ai/core": "1.36.0",
|
|
15172
|
+
"@zhivex-ai/gemini": "0.14.0",
|
|
15173
|
+
"@zhivex-ai/meta": "0.3.0",
|
|
15174
|
+
"@zhivex-ai/openai": "0.17.0",
|
|
15175
|
+
"@zhivex-ai/qwen": "0.18.0",
|
|
15176
|
+
"@zhivex-ai/vertex": "1.3.0",
|
|
15177
|
+
"google-auth-library": "11.3.1",
|
|
15178
|
+
zod: "4.6.7"
|
|
15106
15179
|
},
|
|
15107
15180
|
overrides: {
|
|
15108
|
-
"@zhivex-ai/core": "1.
|
|
15181
|
+
"@zhivex-ai/core": "1.36.0"
|
|
15109
15182
|
},
|
|
15110
15183
|
devDependencies: {
|
|
15111
15184
|
"@agentclientprotocol/sdk": "1.8.0",
|
|
15112
15185
|
"@modelcontextprotocol/server": "2.3.1",
|
|
15113
|
-
"@types/bun": "1.4.
|
|
15186
|
+
"@types/bun": "1.4.3",
|
|
15114
15187
|
"@types/node": "^26.6.5",
|
|
15115
15188
|
typescript: "7.0.2",
|
|
15116
15189
|
"typescript-compiler-api": "npm:typescript@6.0.3"
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
combineMcpHostSessions,
|
|
4
4
|
createHarnessMcpTools,
|
|
5
5
|
issueMcpHostSession
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-2r4f0p4n.js";
|
|
7
7
|
import {
|
|
8
8
|
collectSnapshotInventory,
|
|
9
9
|
readSnapshotFile,
|
|
10
10
|
runPortableProcess
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-w0m1nckc.js";
|
|
12
12
|
import {
|
|
13
13
|
readRegularFileNoFollow
|
|
14
14
|
} from "./index-6dxrbnxm.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openWorkspaceCheckpointStore
|
|
3
|
-
} from "./index-
|
|
3
|
+
} from "./index-4mn6m3bq.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-pf73y4gt.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-amjttjaj.js";
|
|
27
27
|
import {
|
|
28
28
|
resolvePackageCheckCommand
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-w0m1nckc.js";
|
|
30
30
|
import {
|
|
31
31
|
APPROVAL_HISTORY_KEY,
|
|
32
32
|
approvalDecisionViews,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
runtimeManifest,
|
|
21
21
|
taskSources,
|
|
22
22
|
tokenUsageCheckpointStore
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-amjttjaj.js";
|
|
24
24
|
import {
|
|
25
25
|
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
26
26
|
closeMcpHostSession,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
mcpConfigurationFingerprintInput,
|
|
30
30
|
normalizeHarnessMcpConfiguration,
|
|
31
31
|
resolveMcpHostSession
|
|
32
|
-
} from "./index-
|
|
32
|
+
} from "./index-2r4f0p4n.js";
|
|
33
33
|
import {
|
|
34
34
|
EnvironmentPatchDriftError,
|
|
35
35
|
Workspace,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
isHardIgnored,
|
|
41
41
|
replacementEditSchema,
|
|
42
42
|
resolvePackageCheckCommand
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-w0m1nckc.js";
|
|
44
44
|
import {
|
|
45
45
|
DEFAULT_PROVIDER_REGISTRY,
|
|
46
46
|
HARNESS_CONFIG_SCHEMA_VERSION,
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
} from "./index-fqqz1yt8.js";
|
|
89
89
|
import {
|
|
90
90
|
HARNESS_VERSION
|
|
91
|
-
} from "./index-
|
|
91
|
+
} from "./index-rz7wmp71.js";
|
|
92
92
|
import {
|
|
93
93
|
FileSizeLimitError,
|
|
94
94
|
MAX_EDIT_CHANGES,
|
|
@@ -1832,6 +1832,7 @@ var record = (value) => value !== null && typeof value === "object" && !Array.is
|
|
|
1832
1832
|
var LOCAL_TOOLS = LOCAL_TOOL_NAMES;
|
|
1833
1833
|
var MAX_USER_STEERING = 10;
|
|
1834
1834
|
var CONTEXT_PRIORITY = "Latest user > chronological user steering > historical objective. Assistant never overrides user facts. Questions retain task.";
|
|
1835
|
+
var EARLIER = "[before later user messages] ";
|
|
1835
1836
|
var summarizeHarnessMessages = (messages, maxCharacters = 4000) => {
|
|
1836
1837
|
const redaction = createRedactionPolicy({ includeEmails: true });
|
|
1837
1838
|
const clean = (text, limit = 512) => redaction.redactText(text).replace(/\bBearer\s+\S+/gi, "Bearer [REDACTED]").replace(/\b([A-Z][A-Z0-9_]*(?:KEY|TOKEN|SECRET|PASSWORD)|api[_-]?key|access[_-]?token|password)\s*([=:])\s*(?:"[^"]*"|'[^']*'|\S+)/gi, "$1$2[REDACTED]").replace(/\b(?:sk|ghp|gho|github_pat)-[A-Za-z0-9_-]{8,}\b/g, "[REDACTED]").replace(/\s+/g, " ").trim().slice(0, limit);
|
|
@@ -1857,6 +1858,12 @@ var summarizeHarnessMessages = (messages, maxCharacters = 4000) => {
|
|
|
1857
1858
|
omitted = true;
|
|
1858
1859
|
}
|
|
1859
1860
|
};
|
|
1861
|
+
const markRecentEarlier = () => {
|
|
1862
|
+
const marked = recent.map((value) => value.startsWith(EARLIER) ? value : `${EARLIER}${value}`);
|
|
1863
|
+
recent.length = 0;
|
|
1864
|
+
for (const value of marked)
|
|
1865
|
+
add(recent, value, 4);
|
|
1866
|
+
};
|
|
1860
1867
|
const rememberObservation = (tool2, detail) => {
|
|
1861
1868
|
if (typeof tool2 !== "string" || !LOCAL_TOOLS.has(tool2) || typeof detail !== "string")
|
|
1862
1869
|
return;
|
|
@@ -1974,6 +1981,7 @@ var summarizeHarnessMessages = (messages, maxCharacters = 4000) => {
|
|
|
1974
1981
|
objective = text;
|
|
1975
1982
|
if (historicalObjective)
|
|
1976
1983
|
add(steering, text, MAX_USER_STEERING);
|
|
1984
|
+
markRecentEarlier();
|
|
1977
1985
|
} else
|
|
1978
1986
|
add(recent, `${message.role}: ${text}`, 4);
|
|
1979
1987
|
} else if (part.type === "tool-call") {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
workspaceCheckpointSchema,
|
|
3
3
|
workspaceRestoreOperationSchema
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-4mn6m3bq.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-amjttjaj.js";
|
|
13
13
|
import {
|
|
14
14
|
BUDGET_LEDGER_NAMESPACE,
|
|
15
15
|
BUDGET_OWNER_NAMESPACE_KEY,
|