@brainervirus/workit-pi 2.1.5 → 2.2.1
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/dist/worker.js +42 -29
- package/dist/workit.js +4206 -3616
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -7581,7 +7581,8 @@ var hostSchema = _enum([
|
|
|
7581
7581
|
"codex_cli",
|
|
7582
7582
|
"codex_desktop",
|
|
7583
7583
|
"pi",
|
|
7584
|
-
"workit_cli"
|
|
7584
|
+
"workit_cli",
|
|
7585
|
+
"claude_code"
|
|
7585
7586
|
]);
|
|
7586
7587
|
var assuranceSchema = _enum(["enforced", "agent_guided", "unavailable"]);
|
|
7587
7588
|
var outcomeSchema = _enum(["verified", "accepted_limitations", "stopped"]);
|
|
@@ -7934,7 +7935,8 @@ var taskRecordSchema = object({
|
|
|
7934
7935
|
decisions: array(entrySchema(decisionSchema)),
|
|
7935
7936
|
actionProgress: actionProgressListSchema.optional(),
|
|
7936
7937
|
findings: array(entrySchema(findingSchema)),
|
|
7937
|
-
workers: array(entrySchema(workerSchema))
|
|
7938
|
+
workers: array(entrySchema(workerSchema)),
|
|
7939
|
+
critical: array(nonEmpty).optional()
|
|
7938
7940
|
}).strict();
|
|
7939
7941
|
var workspaceRecordSchema = object({
|
|
7940
7942
|
schemaVersion: literal(1),
|
|
@@ -7942,7 +7944,8 @@ var workspaceRecordSchema = object({
|
|
|
7942
7944
|
revision,
|
|
7943
7945
|
root: nonEmpty,
|
|
7944
7946
|
runtime: runtimeSchema.optional(),
|
|
7945
|
-
writer: object({ state: _enum(["held", "uncertain"]), owner: ownerSchema, acquiredAt: utc }).strict().nullable()
|
|
7947
|
+
writer: object({ state: _enum(["held", "uncertain"]), owner: ownerSchema, acquiredAt: utc }).strict().nullable(),
|
|
7948
|
+
critical: array(nonEmpty).optional()
|
|
7946
7949
|
}).strict();
|
|
7947
7950
|
var capabilitySchema = object({
|
|
7948
7951
|
name: nonEmpty,
|
|
@@ -8180,6 +8183,11 @@ var operationSchemas = {
|
|
|
8180
8183
|
writer: discriminatedUnion("action", Object.values(writerOperations)),
|
|
8181
8184
|
state: discriminatedUnion("action", Object.values(stateOperations))
|
|
8182
8185
|
};
|
|
8186
|
+
var { recover: _unadvertisedRecover, ...advertisedStateOperations } = stateOperations;
|
|
8187
|
+
var advertisedOperationSchemas = {
|
|
8188
|
+
...operationSchemas,
|
|
8189
|
+
state: discriminatedUnion("action", Object.values(advertisedStateOperations))
|
|
8190
|
+
};
|
|
8183
8191
|
var compiledOperationSchemas = Object.fromEntries(OPERATION_FAMILIES.map((family) => [family, compile(operationSchemas[family])]));
|
|
8184
8192
|
var success = (revisionValue, workspaceRevisionValue, data) => ({
|
|
8185
8193
|
ok: true,
|
|
@@ -8259,12 +8267,8 @@ function candidateDigest(input) {
|
|
|
8259
8267
|
}
|
|
8260
8268
|
// packages/workit-core/src/core/task-store.ts
|
|
8261
8269
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
8262
|
-
|
|
8263
|
-
|
|
8264
|
-
pid: number2().int().nonnegative(),
|
|
8265
|
-
processStart: string2().nullable(),
|
|
8266
|
-
ownerDigest: string2().regex(/^[0-9a-f]{64}$/).nullable()
|
|
8267
|
-
}).strict();
|
|
8270
|
+
|
|
8271
|
+
// packages/workit-core/src/core/store-lock.ts
|
|
8268
8272
|
var metadataLockSchema = object({
|
|
8269
8273
|
pid: number2().int().nonnegative().safe(),
|
|
8270
8274
|
processStart: string2().nullable(),
|
|
@@ -8272,7 +8276,19 @@ var metadataLockSchema = object({
|
|
|
8272
8276
|
nonce: string2().min(1),
|
|
8273
8277
|
externalAction: literal(true).optional()
|
|
8274
8278
|
}).strict();
|
|
8279
|
+
var FOREIGN_LOCK_TTL_MS = 10 * 60000;
|
|
8280
|
+
|
|
8281
|
+
// packages/workit-core/src/core/task-store.ts
|
|
8282
|
+
var STALE_TEMPORARY_MS = 60 * 60000;
|
|
8283
|
+
var processEvidenceSchema = object({
|
|
8284
|
+
state: _enum(["stopped", "accounted_for"]),
|
|
8285
|
+
pid: number2().int().nonnegative(),
|
|
8286
|
+
processStart: string2().nullable(),
|
|
8287
|
+
ownerDigest: string2().regex(/^[0-9a-f]{64}$/).nullable()
|
|
8288
|
+
}).strict();
|
|
8289
|
+
var TRANSIENT_WINDOWS_CODES = new Set(["EPERM", "EACCES", "EBUSY"]);
|
|
8275
8290
|
var externalActionLockRoots = new AsyncLocalStorage;
|
|
8291
|
+
var heldInProcess = new Map;
|
|
8276
8292
|
// packages/workit-core/src/core/workspaces.ts
|
|
8277
8293
|
import path from "node:path";
|
|
8278
8294
|
|
|
@@ -8418,26 +8434,6 @@ var runtimeWorkspaceIndexSchema = object({
|
|
|
8418
8434
|
|
|
8419
8435
|
// packages/workit-core/src/core/authority.ts
|
|
8420
8436
|
var verifiedAuthorities = new WeakMap;
|
|
8421
|
-
|
|
8422
|
-
// packages/workit-core/src/core/policy-resolver.ts
|
|
8423
|
-
var resolverInputSchema = object({
|
|
8424
|
-
intent: intentSchema,
|
|
8425
|
-
assessment: assessmentSchema,
|
|
8426
|
-
constraints: array(constraintSchema),
|
|
8427
|
-
prior: object({
|
|
8428
|
-
decisions: array(decisionSchema),
|
|
8429
|
-
findings: array(findingSchema),
|
|
8430
|
-
requirements: array(requirementSchema)
|
|
8431
|
-
}).strict(),
|
|
8432
|
-
preferences: object({ fast: boolean2().optional(), thorough: boolean2().optional() }).strict().optional()
|
|
8433
|
-
}).strict();
|
|
8434
|
-
|
|
8435
|
-
// packages/workit-core/src/core/task-engine.ts
|
|
8436
|
-
var verifiedWorkers = new WeakMap;
|
|
8437
|
-
var dispatchReservations = new WeakMap;
|
|
8438
|
-
|
|
8439
|
-
// packages/workit-core/src/core/session-context.ts
|
|
8440
|
-
var cache = new Map;
|
|
8441
8437
|
// packages/workit-core/src/core/external-action.ts
|
|
8442
8438
|
var chainStepSchema = union([
|
|
8443
8439
|
string2().min(1),
|
|
@@ -8551,6 +8547,23 @@ var externalActionSchema = discriminatedUnion("operation", [
|
|
|
8551
8547
|
}).strict()
|
|
8552
8548
|
}).strict()
|
|
8553
8549
|
]);
|
|
8550
|
+
// packages/workit-core/src/core/policy-resolver.ts
|
|
8551
|
+
var resolverInputSchema = object({
|
|
8552
|
+
intent: intentSchema,
|
|
8553
|
+
assessment: assessmentSchema,
|
|
8554
|
+
constraints: array(constraintSchema),
|
|
8555
|
+
prior: object({
|
|
8556
|
+
decisions: array(decisionSchema),
|
|
8557
|
+
findings: array(findingSchema),
|
|
8558
|
+
requirements: array(requirementSchema)
|
|
8559
|
+
}).strict(),
|
|
8560
|
+
preferences: object({ fast: boolean2().optional(), thorough: boolean2().optional() }).strict().optional()
|
|
8561
|
+
}).strict();
|
|
8562
|
+
|
|
8563
|
+
// packages/workit-core/src/core/task-engine.ts
|
|
8564
|
+
var verifiedWorkers = new WeakMap;
|
|
8565
|
+
var dispatchReservations = new WeakMap;
|
|
8566
|
+
var retryPause = new Int32Array(new SharedArrayBuffer(4));
|
|
8554
8567
|
// packages/workit-pi/src/worker-protocol.ts
|
|
8555
8568
|
var MAX_WORKER_LINE_BYTES = 64 * 1024;
|
|
8556
8569
|
var MAX_WORKER_STDERR_BYTES = 64 * 1024;
|