@zhivex-ai/harness 1.3.0 → 1.4.0-rc.6
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 +56 -0
- package/README.md +30 -8
- package/SECURITY.md +1 -1
- package/SUPPORT.md +2 -2
- package/contracts/engine-api.json +70 -0
- package/contracts/public-api.json +162 -0
- package/contracts/stable-api-signatures.json +9 -9
- package/dist/acp-cli.js +38 -12
- package/dist/cli/arguments.d.ts +5 -1
- package/dist/cli/memory.d.ts +2 -0
- package/dist/{cli-entry-bx3vjw7h.js → cli-entry-4k1cf0m3.js} +38 -12
- package/dist/{cli-entry-1gfg3brj.js → cli-entry-9c2k0zwz.js} +1086 -446
- package/dist/{cli-etsmtst3.js → cli-s1rs15vv.js} +136 -24
- package/dist/cli.js +2 -2
- package/dist/client/check-evidence.d.ts +17 -0
- package/dist/client/run-document.d.ts +12 -0
- package/dist/compat/cli-options.d.ts +12 -1
- package/dist/compat/code-support.d.ts +4 -0
- package/dist/compat/code-support.js +12 -4
- package/dist/context/compaction.d.ts +5 -0
- package/dist/context/project-memory-context.d.ts +6 -0
- package/dist/context/task-memory.d.ts +33 -1
- package/dist/engine/acp.js +8 -8
- package/dist/engine/client.js +7 -7
- package/dist/engine/desktop-state-v1.js +5 -5
- package/dist/engine/index.d.ts +4 -0
- package/dist/engine/index.js +88 -11
- package/dist/engine/mcp-stdio-v1.js +4 -4
- package/dist/engine/service.js +8 -8
- package/dist/hostile-repository-demo.js +1260 -712
- package/dist/{index-azmwjp95.js → index-0g939pfs.js} +13 -12
- package/dist/{index-6m08wvab.js → index-2tgb2b4e.js} +3 -3
- package/dist/{index-w2sj0wkw.js → index-49ys3s4q.js} +64 -14
- package/dist/{index-hnaxfpb5.js → index-4j1h4j8c.js} +137 -42
- package/dist/{index-8zzhggxv.js → index-a1q355va.js} +125 -2
- package/dist/{index-8vm2m34s.js → index-dj5z774k.js} +18 -2
- package/dist/{index-z0qxmkm2.js → index-e6r04a18.js} +1 -1
- package/dist/{index-yb239ghk.js → index-r0tdj04h.js} +21 -6
- package/dist/{index-h0mqx2ed.js → index-rd0s3gqj.js} +300 -4
- package/dist/{index-42gp2hy8.js → index-vtqfjnab.js} +98 -27
- package/dist/{index-2jrdcj6b.js → index-wq2tax80.js} +15 -1
- package/dist/{index-a97bezbz.js → index-z6br6qdn.js} +44 -23
- package/dist/index.js +11 -11
- package/dist/persistence/project-memory-command.d.ts +11 -0
- package/dist/persistence/project-memory.d.ts +109 -0
- package/dist/persistence/sdk-store-identity.d.ts +4 -0
- package/dist/persistence/sessions.d.ts +4 -0
- package/dist/runtime/error-diagnostics.d.ts +35 -0
- package/dist/runtime/harness.d.ts +5 -1
- package/dist/runtime/run-interruption.d.ts +1 -1
- package/dist/runtime/runtime-checkpoints.d.ts +3 -0
- package/dist/runtime/task-acceptance-native.d.ts +10 -0
- package/dist/runtime/time-to-safe-fix.d.ts +35 -0
- package/dist/service-cli.js +8 -8
- package/dist/{service-client-cli-3365rfav.js → service-client-cli-b52c67hx.js} +2 -2
- package/dist/verify-historical-migrations.js +1021 -456
- package/dist/zhx.js +2 -2
- package/docs/CLI.md +4 -0
- package/docs/CLIENT_PROTOCOL.md +10 -0
- package/docs/CODE_RELEASE.md +136 -19
- package/docs/CONTEXT_ENGINEERING.md +25 -0
- package/docs/DURABLE_OPERATIONS.md +60 -1
- package/docs/ENGINE_API.md +23 -9
- package/docs/EXTENSIBILITY.md +1 -1
- package/docs/FIRST_USE.md +6 -6
- package/docs/LOCAL_SERVICE.md +10 -4
- package/docs/PROJECT_MEMORY.md +157 -0
- package/docs/README.md +2 -0
- package/docs/STABILITY.md +1 -1
- package/docs/WORKSPACE_CHECKPOINTS.md +11 -1
- package/evaluations/representative-assembly-matrix.json +55 -1
- package/examples/README.md +4 -4
- package/package.json +12 -11
package/dist/engine/client.js
CHANGED
|
@@ -2,13 +2,13 @@ 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-
|
|
11
|
-
import"../index-
|
|
5
|
+
} from "../index-4j1h4j8c.js";
|
|
6
|
+
import"../index-rd0s3gqj.js";
|
|
7
|
+
import"../index-a1q355va.js";
|
|
8
|
+
import"../index-vtqfjnab.js";
|
|
9
|
+
import"../index-0g939pfs.js";
|
|
10
|
+
import"../index-e6r04a18.js";
|
|
11
|
+
import"../index-r0tdj04h.js";
|
|
12
12
|
import"../index-gq9xagx2.js";
|
|
13
13
|
import"../index-8705zxpr.js";
|
|
14
14
|
import"../index-xqxeypt5.js";
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
createArchivedHarnessStateBackup,
|
|
3
3
|
createHarnessStateBackup,
|
|
4
4
|
validateRecordedWorkspace
|
|
5
|
-
} from "../index-
|
|
5
|
+
} from "../index-z6br6qdn.js";
|
|
6
6
|
import {
|
|
7
7
|
HARNESS_SQLITE_FILE
|
|
8
|
-
} from "../index-
|
|
8
|
+
} from "../index-rd0s3gqj.js";
|
|
9
9
|
import {
|
|
10
10
|
validateStateDirectory
|
|
11
|
-
} from "../index-
|
|
12
|
-
import"../index-
|
|
11
|
+
} from "../index-vtqfjnab.js";
|
|
12
|
+
import"../index-e6r04a18.js";
|
|
13
13
|
import {
|
|
14
14
|
SqliteDatabase,
|
|
15
15
|
acquireSqliteAccess,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
protectPersistenceSecret,
|
|
19
19
|
readRegularFileNoFollow,
|
|
20
20
|
statRegularFileNoFollow
|
|
21
|
-
} from "../index-
|
|
21
|
+
} from "../index-r0tdj04h.js";
|
|
22
22
|
import"../index-gq9xagx2.js";
|
|
23
23
|
import"../index-8705zxpr.js";
|
|
24
24
|
import"../index-xqxeypt5.js";
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/** Terminal-free host engine surface. Named aliases retain their historical stability tiers. */
|
|
2
|
+
/** Experimental operator-owned project memory. See docs/PROJECT_MEMORY.md. */
|
|
3
|
+
export { HARNESS_PROJECT_MEMORY_SCHEMA_VERSION, HARNESS_PROJECT_MEMORY_LIMITS, openHarnessProjectMemory } from "../persistence/project-memory.js";
|
|
4
|
+
export type { HarnessProjectMemory, HarnessProjectMemoryEntry, HarnessProjectMemoryInput, HarnessProjectMemoryOptions, HarnessProjectMemoryView } from "../persistence/project-memory.js";
|
|
5
|
+
export { HARNESS_MEMORY_COMMANDS, executeHarnessMemoryCommand } from "../persistence/project-memory-command.js";
|
|
2
6
|
export { DEFAULT_ALLOWED_CHECKS, DEFAULT_OCI_EXECUTION, DEFAULT_SUBAGENT_BUDGET, HARNESS_CONFIG_MIGRATABLE_SCHEMA_VERSIONS, HARNESS_CONFIG_SCHEMA_VERSION, HARNESS_EXECUTION_BACKENDS, HARNESS_EXECUTION_POLICY_VERSION, HARNESS_OCI_RUNTIMES, HARNESS_OCI_SHELL_MODES, HARNESS_REQUIRED_CAPABILITIES, HARNESS_SUBAGENT_PROFILES, BUILTIN_PROVIDER_REGISTRATIONS, DEFAULT_PROVIDER_REGISTRY, PROVIDERS, PROVIDER_DESCRIPTORS, createProviderModel, createProviderRegistry, defaultHarnessNamespace, migrateHarnessConfigInput, parseProvider, providerAvailability, providerDescriptor, resolveHarnessConfig } from "../runtime/config.js";
|
|
3
7
|
export type { BuiltInHarnessProvider, HarnessBudget, HarnessCompactionConfig, HarnessContextConfig, HarnessConfig, HarnessConfigInput, HarnessConfigMigrationResult, HarnessCostBudget, HarnessExecutionBackend, HarnessExecutionConfig, HarnessOciRuntime, HarnessOciShellMode, HarnessOrchestrationConfig, HarnessProvider, HarnessProviderRegistry, HarnessRequiredCapability, HarnessStoreBackend, HarnessSubagentProfile, ProviderCapability, ProviderAvailability, ProviderCredentials, ProviderDescriptor, ProviderDiagnosticsDescriptor, ProviderEnumDiagnostic, ProviderModelFactory, ProviderModelFactoryContext, ProviderPresenceDiagnostic, ProviderRegistration, ProviderSupport } from "../runtime/config.js";
|
|
4
8
|
export { createHarnessRouteModels, parseHarnessModelRoute, resolveHarnessModelRoutes, serializeHarnessModelRoutes } from "../providers/routing.js";
|
package/dist/engine/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
timeToSafeFixLatencyStatistics,
|
|
63
63
|
timeToSafeFixTaskSchema,
|
|
64
64
|
verifyChangeEnvelope
|
|
65
|
-
} from "../index-
|
|
65
|
+
} from "../index-dj5z774k.js";
|
|
66
66
|
import {
|
|
67
67
|
HARNESS_STATE_BACKUP_MAX_BYTES,
|
|
68
68
|
HARNESS_STATE_BACKUP_SCHEMA_VERSION,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
inspectHarnessState,
|
|
74
74
|
readHarnessStateBackup,
|
|
75
75
|
stateBackupBundleSchema
|
|
76
|
-
} from "../index-
|
|
76
|
+
} from "../index-z6br6qdn.js";
|
|
77
77
|
import {
|
|
78
78
|
CLI_COMMAND_OPTION_CONTRACTS,
|
|
79
79
|
CLI_OPTION_DEFINITIONS,
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
resolveHarnessModelRoutes,
|
|
84
84
|
serializeHarnessModelRoutes,
|
|
85
85
|
validateCliCommandOptions
|
|
86
|
-
} from "../index-
|
|
86
|
+
} from "../index-wq2tax80.js";
|
|
87
87
|
import {
|
|
88
88
|
harnessLocalCredentialsSchema,
|
|
89
89
|
openHarnessActivityStore,
|
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
recoverHarnessLocalService,
|
|
92
92
|
requestHarnessLocalService,
|
|
93
93
|
startHarnessLocalService
|
|
94
|
-
} from "../index-
|
|
94
|
+
} from "../index-49ys3s4q.js";
|
|
95
95
|
import {
|
|
96
96
|
createAcpConnection,
|
|
97
97
|
serveAcpStdio
|
|
@@ -144,9 +144,11 @@ import {
|
|
|
144
144
|
runHarness,
|
|
145
145
|
runHarnessReviewGroup,
|
|
146
146
|
selectHarnessModel
|
|
147
|
-
} from "../index-
|
|
147
|
+
} from "../index-4j1h4j8c.js";
|
|
148
148
|
import {
|
|
149
149
|
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
150
|
+
HARNESS_PROJECT_MEMORY_LIMITS,
|
|
151
|
+
HARNESS_PROJECT_MEMORY_SCHEMA_VERSION,
|
|
150
152
|
HARNESS_SQLITE_FILE,
|
|
151
153
|
TERMINAL_RUN_STATUSES,
|
|
152
154
|
cancelHarnessRun,
|
|
@@ -155,9 +157,10 @@ import {
|
|
|
155
157
|
listHarnessRuns,
|
|
156
158
|
migrateLegacyFileRuns,
|
|
157
159
|
openHarnessPersistence,
|
|
160
|
+
openHarnessProjectMemory,
|
|
158
161
|
openWorkspaceCheckpointStore
|
|
159
|
-
} from "../index-
|
|
160
|
-
import"../index-
|
|
162
|
+
} from "../index-rd0s3gqj.js";
|
|
163
|
+
import"../index-a1q355va.js";
|
|
161
164
|
import {
|
|
162
165
|
HARNESS_SESSION_INDEX_FILE,
|
|
163
166
|
HARNESS_SESSION_SCHEMA_VERSION,
|
|
@@ -173,7 +176,7 @@ import {
|
|
|
173
176
|
readTaskAcceptanceLedger,
|
|
174
177
|
taskAcceptanceContractSchema,
|
|
175
178
|
validateStateDirectory
|
|
176
|
-
} from "../index-
|
|
179
|
+
} from "../index-vtqfjnab.js";
|
|
177
180
|
import {
|
|
178
181
|
BUN_ENGINE_RANGE,
|
|
179
182
|
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
@@ -184,7 +187,7 @@ import {
|
|
|
184
187
|
createHttpMcpClient,
|
|
185
188
|
loadHarnessMcpConfiguration,
|
|
186
189
|
normalizeHarnessMcpConfiguration
|
|
187
|
-
} from "../index-
|
|
190
|
+
} from "../index-0g939pfs.js";
|
|
188
191
|
import {
|
|
189
192
|
CliOciRuntimeAdapter,
|
|
190
193
|
HARNESS_EXECUTION_ARTIFACT_SCHEMA_VERSION,
|
|
@@ -196,7 +199,7 @@ import {
|
|
|
196
199
|
describeOciCommand,
|
|
197
200
|
executionFingerprintInput,
|
|
198
201
|
harnessExecutionSession
|
|
199
|
-
} from "../index-
|
|
202
|
+
} from "../index-e6r04a18.js";
|
|
200
203
|
import {
|
|
201
204
|
EDIT_CONTRACT_SCHEMA_VERSION,
|
|
202
205
|
EDIT_DIGEST_ALGORITHM,
|
|
@@ -220,7 +223,7 @@ import {
|
|
|
220
223
|
taskCheckReceiptSchema,
|
|
221
224
|
validateEditProposal,
|
|
222
225
|
workspaceFilePathSchema
|
|
223
|
-
} from "../index-
|
|
226
|
+
} from "../index-r0tdj04h.js";
|
|
224
227
|
import {
|
|
225
228
|
BUILTIN_PROVIDER_REGISTRATIONS,
|
|
226
229
|
DEFAULT_ALLOWED_CHECKS,
|
|
@@ -271,6 +274,75 @@ import {
|
|
|
271
274
|
streamResultDocument
|
|
272
275
|
} from "../index-qfpz5y2v.js";
|
|
273
276
|
import"../index-1bx83sw4.js";
|
|
277
|
+
// src/persistence/project-memory-command.ts
|
|
278
|
+
var HARNESS_MEMORY_COMMANDS = ["remember", "list", "read", "update", "forget", "suggest", "accept", "clear", "enable", "disable", "context"];
|
|
279
|
+
async function executeHarnessMemoryCommand(options, command, args, source = "Explicit operator input") {
|
|
280
|
+
const counts = {
|
|
281
|
+
remember: 1,
|
|
282
|
+
list: 0,
|
|
283
|
+
read: 1,
|
|
284
|
+
update: 3,
|
|
285
|
+
forget: 2,
|
|
286
|
+
suggest: 1,
|
|
287
|
+
accept: 2,
|
|
288
|
+
clear: 0,
|
|
289
|
+
enable: 0,
|
|
290
|
+
disable: 0,
|
|
291
|
+
context: 1
|
|
292
|
+
};
|
|
293
|
+
if (!Object.hasOwn(counts, command) || args.length !== counts[command])
|
|
294
|
+
throw new HarnessConfigError("Invalid memory command arguments. Use memory --help.");
|
|
295
|
+
const memory = await openHarnessProjectMemory(options);
|
|
296
|
+
try {
|
|
297
|
+
let result;
|
|
298
|
+
switch (command) {
|
|
299
|
+
case "list":
|
|
300
|
+
result = memory.list();
|
|
301
|
+
break;
|
|
302
|
+
case "read":
|
|
303
|
+
result = memory.read(args[0]);
|
|
304
|
+
break;
|
|
305
|
+
case "remember":
|
|
306
|
+
result = memory.remember({ content: args[0], source });
|
|
307
|
+
break;
|
|
308
|
+
case "suggest":
|
|
309
|
+
result = memory.suggest({ content: args[0], source });
|
|
310
|
+
break;
|
|
311
|
+
case "update":
|
|
312
|
+
result = memory.update(args[0], Number(args[1]), { content: args[2], source });
|
|
313
|
+
break;
|
|
314
|
+
case "accept":
|
|
315
|
+
result = memory.accept(args[0], Number(args[1]));
|
|
316
|
+
break;
|
|
317
|
+
case "forget":
|
|
318
|
+
memory.forget(args[0], Number(args[1]));
|
|
319
|
+
result = { forgotten: args[0] };
|
|
320
|
+
break;
|
|
321
|
+
case "clear":
|
|
322
|
+
result = { cleared: memory.clear() };
|
|
323
|
+
break;
|
|
324
|
+
case "enable":
|
|
325
|
+
case "disable":
|
|
326
|
+
memory.setEnabled(command === "enable");
|
|
327
|
+
result = { enabled: command === "enable" };
|
|
328
|
+
break;
|
|
329
|
+
case "context":
|
|
330
|
+
result = memory.retrieve(args[0]);
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
const view = memory.list();
|
|
334
|
+
return {
|
|
335
|
+
schemaVersion: 1,
|
|
336
|
+
kind: "memory-command",
|
|
337
|
+
command,
|
|
338
|
+
workspaceKey: view.workspaceKey,
|
|
339
|
+
scopeKey: view.scopeKey,
|
|
340
|
+
result
|
|
341
|
+
};
|
|
342
|
+
} finally {
|
|
343
|
+
memory.close();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
274
346
|
// src/persistence/governance-report.ts
|
|
275
347
|
import { createHash as createHash2 } from "node:crypto";
|
|
276
348
|
import { z as z2 } from "zod";
|
|
@@ -770,11 +842,14 @@ export {
|
|
|
770
842
|
HARNESS_LIFECYCLE_EVENTS,
|
|
771
843
|
HARNESS_MCP_CONFIG_SCHEMA_VERSION,
|
|
772
844
|
HARNESS_MCP_PERMISSIONS,
|
|
845
|
+
HARNESS_MEMORY_COMMANDS,
|
|
773
846
|
HARNESS_OCI_LABEL,
|
|
774
847
|
HARNESS_OCI_LABEL_VALUE,
|
|
775
848
|
HARNESS_OCI_RUNTIMES,
|
|
776
849
|
HARNESS_OCI_SHELL_MODES,
|
|
777
850
|
HARNESS_OPERATIONS_SCHEMA_VERSION,
|
|
851
|
+
HARNESS_PROJECT_MEMORY_LIMITS,
|
|
852
|
+
HARNESS_PROJECT_MEMORY_SCHEMA_VERSION,
|
|
778
853
|
HARNESS_REQUIRED_CAPABILITIES,
|
|
779
854
|
HARNESS_SESSION_INDEX_FILE,
|
|
780
855
|
HARNESS_SESSION_SCHEMA_VERSION,
|
|
@@ -895,6 +970,7 @@ export {
|
|
|
895
970
|
editProposalInputSchema,
|
|
896
971
|
editProposalSchema,
|
|
897
972
|
estimateMessageTokens,
|
|
973
|
+
executeHarnessMemoryCommand,
|
|
898
974
|
executionFingerprintInput,
|
|
899
975
|
exportHarnessGovernanceReport,
|
|
900
976
|
exportHarnessStateBackup,
|
|
@@ -934,6 +1010,7 @@ export {
|
|
|
934
1010
|
openCliSessionStore,
|
|
935
1011
|
openHarnessActivityStore,
|
|
936
1012
|
openHarnessPersistence,
|
|
1013
|
+
openHarnessProjectMemory,
|
|
937
1014
|
openSessionStore,
|
|
938
1015
|
openWorkspaceCheckpointStore,
|
|
939
1016
|
parseCliJsonDocument,
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
mcpResourcePlanSchema,
|
|
9
9
|
prepareMcpWorkspaceSnapshot,
|
|
10
10
|
recoverDockerMcpResources
|
|
11
|
-
} from "../index-
|
|
12
|
-
import"../index-
|
|
13
|
-
import"../index-
|
|
14
|
-
import"../index-
|
|
11
|
+
} from "../index-2tgb2b4e.js";
|
|
12
|
+
import"../index-0g939pfs.js";
|
|
13
|
+
import"../index-e6r04a18.js";
|
|
14
|
+
import"../index-r0tdj04h.js";
|
|
15
15
|
import"../index-gq9xagx2.js";
|
|
16
16
|
import"../index-8705zxpr.js";
|
|
17
17
|
import"../index-xqxeypt5.js";
|
package/dist/engine/service.js
CHANGED
|
@@ -5,14 +5,14 @@ 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-
|
|
15
|
-
import"../index-
|
|
8
|
+
} from "../index-49ys3s4q.js";
|
|
9
|
+
import"../index-4j1h4j8c.js";
|
|
10
|
+
import"../index-rd0s3gqj.js";
|
|
11
|
+
import"../index-a1q355va.js";
|
|
12
|
+
import"../index-vtqfjnab.js";
|
|
13
|
+
import"../index-0g939pfs.js";
|
|
14
|
+
import"../index-e6r04a18.js";
|
|
15
|
+
import"../index-r0tdj04h.js";
|
|
16
16
|
import"../index-gq9xagx2.js";
|
|
17
17
|
import"../index-8705zxpr.js";
|
|
18
18
|
import"../index-xqxeypt5.js";
|