@cotal-ai/runtime 0.100.1 → 0.101.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/dist/engine-host.d.ts +4 -0
- package/dist/engine-host.d.ts.map +1 -1
- package/dist/engine-host.js +1 -1
- package/dist/engine-host.js.map +1 -1
- package/dist/index.js +19 -19
- package/dist/index.js.map +1 -1
- package/dist/log-line.d.ts +8 -0
- package/dist/log-line.d.ts.map +1 -0
- package/dist/log-line.js +10 -0
- package/dist/log-line.js.map +1 -0
- package/dist/mesh-handler.d.ts +9 -4
- package/dist/mesh-handler.d.ts.map +1 -1
- package/dist/mesh-handler.js +38 -12
- package/dist/mesh-handler.js.map +1 -1
- package/dist/offline-command.d.ts +6 -1
- package/dist/offline-command.d.ts.map +1 -1
- package/dist/offline-command.js +117 -15
- package/dist/offline-command.js.map +1 -1
- package/dist/resolve-checkpoint.d.ts +17 -8
- package/dist/resolve-checkpoint.d.ts.map +1 -1
- package/dist/resolve-checkpoint.js +51 -11
- package/dist/resolve-checkpoint.js.map +1 -1
- package/dist/run-command.d.ts +13 -1
- package/dist/run-command.d.ts.map +1 -1
- package/dist/run-command.js +354 -78
- package/dist/run-command.js.map +1 -1
- package/dist/run-driver.d.ts +5 -0
- package/dist/run-driver.d.ts.map +1 -1
- package/dist/run-driver.js +8 -5
- package/dist/run-driver.js.map +1 -1
- package/dist/run-host.d.ts +3 -2
- package/dist/run-host.d.ts.map +1 -1
- package/dist/run-host.js +55 -11
- package/dist/run-host.js.map +1 -1
- package/dist/workflow-views.d.ts +18 -2
- package/dist/workflow-views.d.ts.map +1 -1
- package/dist/workflow-views.js +89 -19
- package/dist/workflow-views.js.map +1 -1
- package/package.json +4 -4
package/dist/engine-host.d.ts
CHANGED
|
@@ -47,6 +47,10 @@ export interface EngineHostRequest {
|
|
|
47
47
|
readonly seed?: string;
|
|
48
48
|
readonly effectCeiling?: number;
|
|
49
49
|
readonly stepBudget?: number;
|
|
50
|
+
readonly onLog?: (line: {
|
|
51
|
+
readonly scope: string;
|
|
52
|
+
readonly values: readonly unknown[];
|
|
53
|
+
}) => void;
|
|
50
54
|
}
|
|
51
55
|
/**
|
|
52
56
|
* The compiled worker entry of the installed `@cotal-ai/lang`, and the refusal when it is absent.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-host.d.ts","sourceRoot":"","sources":["../src/engine-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,OAAO,EAGL,KAAK,sBAAsB,EAU3B,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,SAAS,EAEf,MAAM,gBAAgB,CAAC;AAoBxB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,kFAAkF;IAClF,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,+GAA+G;IAC/G,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"engine-host.d.ts","sourceRoot":"","sources":["../src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AG,OAAO,CAAC,SAAS,CAAC,CAyElF"}
|
package/dist/engine-host.js
CHANGED
|
@@ -150,7 +150,7 @@ export async function runOnHostedEngine(req) {
|
|
|
150
150
|
...(req.seed !== undefined ? { seed: req.seed } : {}),
|
|
151
151
|
...(req.effectCeiling !== undefined ? { effectCeiling: req.effectCeiling } : {}),
|
|
152
152
|
...(req.stepBudget !== undefined ? { stepBudget: req.stepBudget } : {}),
|
|
153
|
-
}, { entry, bridge: { handler: req.handler, store } });
|
|
153
|
+
}, { entry, bridge: { handler: req.handler, store }, ...(req.onLog !== undefined ? { onLog: req.onLog } : {}) });
|
|
154
154
|
publish = (reason) => worker.stop(reason);
|
|
155
155
|
const unsubscribe = req.cancellation?.subscribe((reason) => worker.cancel(reason));
|
|
156
156
|
// A horizon that passed before the run began is published before the thread's first pre-effect
|
package/dist/engine-host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine-host.js","sourceRoot":"","sources":["../src/engine-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,WAAW,EACX,SAAS,EAET,oBAAoB,EACpB,OAAO,EACP,qBAAqB,EACrB,WAAW,EACX,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,WAAW,EACX,SAAS,GAOV,MAAM,gBAAgB,CAAC;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,YAAY,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"engine-host.js","sourceRoot":"","sources":["../src/engine-host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CA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AI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;YAChC,IAAI,MAAM,KAAK,SAAS;gBAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,SAAS,GAAG,CAAC,IAAI,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;YACxE,aAAa,CAAC,IAAI,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC,oEAAoE,CAAC,CAAC;QACpF,CAAC;IACH,CAAC,EAAE,YAAY,CAAC,CAAC;IAEjB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC;QACjC,IAAI,SAAS,KAAK,SAAS;YAAE,MAAM,SAAS,CAAC;QAC7C,IAAI,CAAC,MAAM,CAAC,EAAE;YAAE,MAAM,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC/C,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,OAAO,EAAE,IAAI,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;YACjE,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,KAAK,EAAE,MAAM,CAAC,KAAK;SACpB,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,WAAW,EAAE,EAAE,CAAC;QAChB,aAAa,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -39,39 +39,39 @@ const runCommand = {
|
|
|
39
39
|
reads: true,
|
|
40
40
|
subcommands: [
|
|
41
41
|
{ name: "list", aliases: ["ps"], hidden: true, summary: "list recorded workflow runs", reads: true, outputs: ["json", "plain"] },
|
|
42
|
-
{ name: "start", summary: "start a workflow on the manager", outputs: ["json", "plain"] },
|
|
43
|
-
{ name: "show", aliases: ["journal"], summary: "read recorded state, open requests and journal", reads: true, outputs: ["json", "plain"] },
|
|
44
|
-
{ name: "resume", summary: "resume a workflow from its recorded program", outputs: ["json", "plain"] },
|
|
45
|
-
{ name: "answer", summary: "answer an open checkpoint or ask", outputs: ["json", "plain"] },
|
|
46
|
-
{ name: "amend", summary: "record an amendment without reopening the pause", outputs: ["json", "plain"] },
|
|
47
|
-
{ name: "check", aliases: ["migrate"], summary: "check an edited program against a recorded journal without committing it", reads: true },
|
|
48
|
-
{ name: "revoke", summary: "revoke run admission
|
|
49
|
-
...["validate", "plan", "simulate"].map((name) => ({ name, summary: name === "validate" ? "validate cotal-lang offline" : name === "plan" ? "show validated static call sites offline" : "simulate with explicit JSON results offline", reads: true, prepareMeshTarget: false, outputs: ["json", "plain"] })),
|
|
50
|
-
{ name: "turns", summary: "read this managed seat's own assigned turns", reads: true, prepareMeshTarget: false, outputs: ["json", "plain"] },
|
|
51
|
-
{ name: "yield", summary: "report this managed seat's assigned turn outcome", prepareMeshTarget: false, outputs: ["json", "plain"] },
|
|
42
|
+
{ name: "start", flagNames: ["space", "server", "creds", "on", "file", "local", "admit-read", "admit-publish", "endpoint", "timeout", "json", "plain"], summary: "start a workflow on the manager", usage: "cotal run start <file> [--on <instance>] [--timeout <dur>] [--json|--plain] | run start <file> --local --admit-read <channels> --admit-publish <channels> [--endpoint <ep>]", outputs: ["json", "plain"] },
|
|
43
|
+
{ name: "show", aliases: ["journal"], flagNames: ["space", "server", "creds", "on", "local", "endpoint", "json", "plain"], summary: "read recorded state, open requests and journal", usage: "cotal run show <run-id> [--on <instance> | --local] [--endpoint <ep>] [--json|--plain]", reads: true, outputs: ["json", "plain"] },
|
|
44
|
+
{ name: "resume", flagNames: ["space", "server", "creds", "on", "file", "local", "endpoint", "timeout", "json", "plain"], summary: "resume a workflow from its recorded program", usage: "cotal run resume <run-id> [--on <instance>] [--timeout <dur>] [--json|--plain] | run resume <run-id> --local [--file <program>] [--endpoint <ep>]", outputs: ["json", "plain"] },
|
|
45
|
+
{ name: "answer", flagNames: ["space", "server", "creds", "on", "local", "endpoint", "by", "value", "artifact", "json", "plain"], summary: "answer an open checkpoint or ask", usage: "cotal run answer <run-id> <step> [--value <json>] [--artifact <ref>] [--on <instance> | --local --by <who>] [--endpoint <ep>] [--json|--plain]", outputs: ["json", "plain"] },
|
|
46
|
+
{ name: "amend", flagNames: ["space", "server", "creds", "on", "local", "endpoint", "by", "value", "artifact", "json", "plain"], summary: "record an amendment without reopening the pause", usage: "cotal run amend <run-id> <step> [--value <json>] [--artifact <ref>] [--on <instance> | --local --by <who>] [--endpoint <ep>] [--json|--plain]", outputs: ["json", "plain"] },
|
|
47
|
+
{ name: "check", aliases: ["migrate"], flagNames: ["space", "server", "creds", "endpoint"], summary: "check an edited program against a recorded journal without committing it", usage: "cotal run check <run-id> <file> [--endpoint <ep>]", reads: true },
|
|
48
|
+
{ name: "revoke", flagNames: ["space", "server", "creds", "local", "by", "reason", "endpoint"], summary: "revoke run admission; it does not cancel work that touches no channel", usage: "cotal run revoke <run-id> --local --by <who> --reason <text> [--endpoint <ep>]" },
|
|
49
|
+
...["validate", "plan", "simulate"].map((name) => ({ name, flagNames: name === "simulate" ? ["handler", "json", "plain"] : ["json", "plain"], summary: name === "validate" ? "validate cotal-lang offline" : name === "plan" ? "show validated static call sites offline" : "simulate with explicit JSON results offline", usage: name === "simulate" ? "cotal run simulate <file> [--handler <results.json>] [--json|--plain]" : `cotal run ${name} <file> [--json|--plain]`, reads: true, prepareMeshTarget: false, outputs: ["json", "plain"] })),
|
|
50
|
+
{ name: "turns", flagNames: ["space", "server", "json", "plain"], summary: "read this managed seat's own assigned turns", usage: "cotal run turns [--json|--plain]", reads: true, prepareMeshTarget: false, outputs: ["json", "plain"] },
|
|
51
|
+
{ name: "yield", flagNames: ["space", "server", "status", "to", "note", "json", "plain"], summary: "report this managed seat's assigned turn outcome", usage: "cotal run yield <turn-id> --status <done|blocked|handoff> [--to <agent>] [--note <text>] [--json|--plain]", prepareMeshTarget: false, outputs: ["json", "plain"] },
|
|
52
52
|
],
|
|
53
53
|
validate: (args) => { workflowArguments(args); },
|
|
54
54
|
flags: [
|
|
55
55
|
...targetFlags,
|
|
56
56
|
{ name: "on", type: "string", value: "<instance>", description: "hosted verbs only: pin one full manager instance as cotal ps prints it" },
|
|
57
|
-
{ name: "file", type: "string", short: "f", value: "<program>", description: "cotal-lang program source (start; resume --local when no program is recorded)" },
|
|
57
|
+
{ name: "file", type: "string", short: "f", value: "<program>", description: "cotal-lang program source (start; resume --local when no program is recorded)", completion: "files" },
|
|
58
58
|
{ name: "local", type: "boolean", description: "drive in this process instead of on the manager (bare broker, or a run the manager cannot host)" },
|
|
59
59
|
{ name: "admit-read", type: "string", value: "<channels>", description: "start --local: the channels the run may read, comma-separated patterns or `none` (required; SPEC 14.8)" },
|
|
60
60
|
{ name: "admit-publish", type: "string", value: "<channels>", description: "start --local: the channels the run may post to, comma-separated patterns or `none` (required; SPEC 14.8)" },
|
|
61
|
-
{ name: "endpoint", type: "string", value: "<ep>", description: "endpoint the run record lives under (
|
|
61
|
+
{ name: "endpoint", type: "string", value: "<ep>", description: "endpoint the run record lives under (the run list, show, answer, amend; default: manager)" },
|
|
62
62
|
{ name: "timeout", type: "string", value: "<dur>", description: "default checkpoint timeout for this drive (default: 1h)" },
|
|
63
63
|
{ name: "by", type: "string", value: "<who>", description: "who is answering, amending or revoking (answer --local, amend --local, revoke; the manager records the caller for a hosted answer)" },
|
|
64
64
|
{ name: "reason", type: "string", value: "<text>", description: "revoke: why the run's admission is revoked, recorded on the marker (required)" },
|
|
65
65
|
{ name: "value", type: "string", value: "<json>", description: "checkpoint answer payload as JSON (answer, amend)" },
|
|
66
66
|
{ name: "artifact", type: "string", value: "<ref>", description: "artifact reference attached to the answer (answer, amend)" },
|
|
67
|
-
{ name: "adopt", type: "string", value: "<handle>", description: "REFUSED by `
|
|
68
|
-
{ name: "release", type: "string", value: "<handle>", description: "REFUSED by `
|
|
69
|
-
{ name: "discard-approvals", type: "boolean", description: "REFUSED by `
|
|
70
|
-
{ name: "page", type: "boolean", description: "hosted
|
|
71
|
-
{ name: "limit", type: "string", value: "<n>", description: "
|
|
72
|
-
{ name: "cursor", type: "string", value: "<cursor>", description: "
|
|
67
|
+
{ name: "adopt", type: "string", value: "<handle>", description: "REFUSED by `check`: it decides what a commit does with an orphan, and that verb only checks" },
|
|
68
|
+
{ name: "release", type: "string", value: "<handle>", description: "REFUSED by `check`: it decides what a commit does with an orphan, and that verb only checks" },
|
|
69
|
+
{ name: "discard-approvals", type: "boolean", description: "REFUSED by `check`: it decides what a commit does with a recorded decision, and that verb only checks" },
|
|
70
|
+
{ name: "page", type: "boolean", description: "hosted run list: one bounded diagnostic JSON page; requires --on and proves no absence or ownership" },
|
|
71
|
+
{ name: "limit", type: "string", value: "<n>", description: "run --page: row limit from 1 to 16 (default 8); byte and read bounds can return fewer. show: journal rows printed, 1 to 1000 (default 20)" },
|
|
72
|
+
{ name: "cursor", type: "string", value: "<cursor>", description: "run --page: continuation from the same manager instance, epoch and filter" },
|
|
73
73
|
jsonFlag, plainFlag,
|
|
74
|
-
{ name: "handler", type: "string", value: "<results.json>", description: "simulate: explicit JSON simulation results; no JavaScript handler is executed" },
|
|
74
|
+
{ name: "handler", type: "string", value: "<results.json>", description: "simulate: explicit JSON simulation results; no JavaScript handler is executed", completion: "files" },
|
|
75
75
|
{ name: "status", type: "string", value: "<done|blocked|handoff>", description: "yield: the assigned turn's actual outcome" },
|
|
76
76
|
{ name: "to", type: "string", value: "<agent>", description: "yield: required destination for a handoff" },
|
|
77
77
|
{ name: "note", type: "string", value: "<text>", description: "yield: context for the turn outcome" },
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG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AE;QACrJ,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,2IAA2I,EAAE;QACzM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,2EAA2E,EAAE;QAC/I,QAAQ,EAAE,SAAS;QACnB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,+EAA+E,EAAE,UAAU,EAAE,OAAO,EAAE;QAC/K,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,2CAA2C,EAAE;QAC7H,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,2CAA2C,EAAE;QAC1G,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;KACtG;IACD,WAAW,EAAE,eAAe;IAC5B,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;CACxC,CAAC;AAEF,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** One `log(...)` line as text: strings as written and other values inspected on one line, after the
|
|
2
|
+
* scope it was written from when that is not the run's root. Control characters are escaped, so a
|
|
3
|
+
* logged newline cannot start a second line that reads as its own. */
|
|
4
|
+
export declare function logLineText(line: {
|
|
5
|
+
readonly scope: string;
|
|
6
|
+
readonly values: readonly unknown[];
|
|
7
|
+
}): string;
|
|
8
|
+
//# sourceMappingURL=log-line.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-line.d.ts","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAGA;;uEAEuE;AACvE,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,GAAG,MAAM,CAGzG"}
|
package/dist/log-line.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { inspect } from "node:util";
|
|
2
|
+
import { oneLine } from "@cotal-ai/core";
|
|
3
|
+
/** One `log(...)` line as text: strings as written and other values inspected on one line, after the
|
|
4
|
+
* scope it was written from when that is not the run's root. Control characters are escaped, so a
|
|
5
|
+
* logged newline cannot start a second line that reads as its own. */
|
|
6
|
+
export function logLineText(line) {
|
|
7
|
+
const text = line.values.map((value) => typeof value === "string" ? value : inspect(value, { depth: 6, breakLength: Infinity })).join(" ");
|
|
8
|
+
return oneLine(line.scope ? `${line.scope} ${text}` : text);
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=log-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-line.js","sourceRoot":"","sources":["../src/log-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAEzC;;uEAEuE;AACvE,MAAM,UAAU,WAAW,CAAC,IAAqE;IAC/F,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC3I,OAAO,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AAC9D,CAAC"}
|
package/dist/mesh-handler.d.ts
CHANGED
|
@@ -506,10 +506,11 @@ export declare class MeshHandler {
|
|
|
506
506
|
* terminal, carrying the TurnResult. The DEADLINE is double-covered: the manager arms a
|
|
507
507
|
* goal-bound hold (its expiry commits `failed` reason `turn-deadline`), and this client arms its
|
|
508
508
|
* OWN pause under the step's request id — the L4003 authority that survives a dead manager.
|
|
509
|
-
* DEATH
|
|
510
|
-
*
|
|
511
|
-
* reads death the way `wait(down)` does: a superseded incarnation at
|
|
512
|
-
* once it has stayed absent for {@link LAPSE_CONFIRM_MS} and its manager
|
|
509
|
+
* DEATH: the manager's reap hook marks pending turns; death rides the deadline terminal as
|
|
510
|
+
* `agentDownAt`. This client's presence watch is the early L4002 authority even while the
|
|
511
|
+
* manager runs. The watch reads death the way `wait(down)` does: a superseded incarnation at
|
|
512
|
+
* once, a lapsed row only once it has stayed absent for {@link LAPSE_CONFIRM_MS} and its manager
|
|
513
|
+
* no longer runs the seat.
|
|
513
514
|
*
|
|
514
515
|
* Handoff honoring (lang §5.3) happens HERE: the scope's pending memo is spent at every turn's
|
|
515
516
|
* begin, and when this turn targets its `to`, the link rides the submission (`handoffFrom`, the
|
|
@@ -746,6 +747,10 @@ export declare class MeshHandler {
|
|
|
746
747
|
* raised rather than waited on.
|
|
747
748
|
*/
|
|
748
749
|
private arm;
|
|
750
|
+
/** `arm`, answering `true` when the deadline passed before anything was minted for it. Only a
|
|
751
|
+
* first arm finds that (`PauseOverdue`), and there is then no pause to settle, so a caller whose
|
|
752
|
+
* deadline is its own outcome takes `true` as that outcome. Cancellation still wins. */
|
|
753
|
+
private armUnlessDue;
|
|
749
754
|
private armOnce;
|
|
750
755
|
/** Push a live deadline out — the idle window restarting. The heartbeat CAS-advances the
|
|
751
756
|
* generation before replacing the timer, so a fire from the old one no-ops rather than racing. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-handler.d.ts","sourceRoot":"","sources":["../src/mesh-handler.ts"],"names":[],"mappings":"AAqBA,OAAO,EAkDL,KAAK,aAAa,EAClB,KAAK,oBAAoB,EAGzB,KAAK,QAAQ,EAQb,KAAK,gBAAgB,EAItB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAO,KAAK,EAAE,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAGL,WAAW,EAMX,KAAK,UAAU,EACf,KAAK,gBAAgB,EAErB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,eAAe,EAGrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAgB,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAoC,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC9F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,S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gB,sBAAsB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,EAAE,CAIjF;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAiB,YAAW,aAAa;IAElD,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,SAAe;IAGlC,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAOrE"}
|
package/dist/mesh-handler.js
CHANGED
|
@@ -698,8 +698,8 @@ export class MeshHandler {
|
|
|
698
698
|
endpoint: this.binding.endpoint,
|
|
699
699
|
token: observeToken(ctx.requestId, req.attempt),
|
|
700
700
|
};
|
|
701
|
-
await this.
|
|
702
|
-
|
|
701
|
+
if (!(await this.armUnlessDue(ref, wake, ctx.signal)))
|
|
702
|
+
await this.settle(ref, ctx.signal);
|
|
703
703
|
// Re-read the clock rather than trusting the arithmetic: the pause may have been settled by a
|
|
704
704
|
// heartbeat-advanced deadline or by this host being away, and what decides whether there is
|
|
705
705
|
// still time is where the clock actually is now.
|
|
@@ -757,7 +757,8 @@ export class MeshHandler {
|
|
|
757
757
|
// step with nothing armed behind it, instead of leaving a timer to fire into a failed step.
|
|
758
758
|
if (ctx.attempt > 0 && req.to !== undefined)
|
|
759
759
|
await this.relayEscalation(req, ctx, ref.token, deadline);
|
|
760
|
-
await this.
|
|
760
|
+
if (await this.armUnlessDue(ref, deadline, ctx.signal))
|
|
761
|
+
return { outcome: "expired", at: this.now() };
|
|
761
762
|
const settled = await this.settle(ref, ctx.signal, true);
|
|
762
763
|
if (settled.settle === "expired")
|
|
763
764
|
return { outcome: "expired", at: settled.ts };
|
|
@@ -846,11 +847,11 @@ export class MeshHandler {
|
|
|
846
847
|
const outer = idleFor !== undefined && timeoutAt !== undefined
|
|
847
848
|
? { endpoint: this.binding.endpoint, token: waitTimeoutToken(ctx.requestId) }
|
|
848
849
|
: undefined;
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
850
|
+
// A deadline that passed before its pause was minted has nothing to settle. It ends the wait in
|
|
851
|
+
// the loop, once the channel is open under the run's read admission and after cancellation.
|
|
852
|
+
const primaryDue = primary !== undefined && await this.armUnlessDue(primary, idleFor !== undefined ? this.now() + idleFor : timeoutAt, ctx.signal);
|
|
853
|
+
const outerDue = outer !== undefined && await this.armUnlessDue(outer, timeoutAt, ctx.signal);
|
|
854
|
+
const timedOut = outer !== undefined ? outerDue : idleFor === undefined && primaryDue;
|
|
854
855
|
const durable = waitConsumerName(ctx.requestId);
|
|
855
856
|
const stream = chatStream(this.binding.space);
|
|
856
857
|
if (this.services)
|
|
@@ -877,6 +878,13 @@ export class MeshHandler {
|
|
|
877
878
|
over = true;
|
|
878
879
|
throw new Cancelled(ctx.signal.reason ?? "cancelled");
|
|
879
880
|
}
|
|
881
|
+
// A deadline that passed before its pause was minted, the timeout ahead of the idle window.
|
|
882
|
+
if (timedOut || idleFor !== undefined && primaryDue) {
|
|
883
|
+
if (outer !== undefined)
|
|
884
|
+
await this.cancelTimer(timedOut ? primary : outer);
|
|
885
|
+
over = true;
|
|
886
|
+
return timedOut ? null : { channel: ev.channel, at: this.now() };
|
|
887
|
+
}
|
|
880
888
|
// The deadline is durable and authoritative — a checkpoint's settle fact — and this is only
|
|
881
889
|
// the OBSERVATION of it, so the cost of polling is lateness bounded by one poll rather than
|
|
882
890
|
// a wait that outlives its deadline.
|
|
@@ -1389,10 +1397,11 @@ export class MeshHandler {
|
|
|
1389
1397
|
* terminal, carrying the TurnResult. The DEADLINE is double-covered: the manager arms a
|
|
1390
1398
|
* goal-bound hold (its expiry commits `failed` reason `turn-deadline`), and this client arms its
|
|
1391
1399
|
* OWN pause under the step's request id — the L4003 authority that survives a dead manager.
|
|
1392
|
-
* DEATH
|
|
1393
|
-
*
|
|
1394
|
-
* reads death the way `wait(down)` does: a superseded incarnation at
|
|
1395
|
-
* once it has stayed absent for {@link LAPSE_CONFIRM_MS} and its manager
|
|
1400
|
+
* DEATH: the manager's reap hook marks pending turns; death rides the deadline terminal as
|
|
1401
|
+
* `agentDownAt`. This client's presence watch is the early L4002 authority even while the
|
|
1402
|
+
* manager runs. The watch reads death the way `wait(down)` does: a superseded incarnation at
|
|
1403
|
+
* once, a lapsed row only once it has stayed absent for {@link LAPSE_CONFIRM_MS} and its manager
|
|
1404
|
+
* no longer runs the seat.
|
|
1396
1405
|
*
|
|
1397
1406
|
* Handoff honoring (lang §5.3) happens HERE: the scope's pending memo is spent at every turn's
|
|
1398
1407
|
* begin, and when this turn targets its `to`, the link rides the submission (`handoffFrom`, the
|
|
@@ -2240,6 +2249,23 @@ export class MeshHandler {
|
|
|
2240
2249
|
// because THIS PROCESS was off the CPU is not evidence about the plane. See `host-starvation`.
|
|
2241
2250
|
return await servedDespiteStarvation(() => this.armOnce(ref, deadline), this.lag, `arming the pause ${ref.token}`, this.onStarved);
|
|
2242
2251
|
}
|
|
2252
|
+
/** `arm`, answering `true` when the deadline passed before anything was minted for it. Only a
|
|
2253
|
+
* first arm finds that (`PauseOverdue`), and there is then no pause to settle, so a caller whose
|
|
2254
|
+
* deadline is its own outcome takes `true` as that outcome. Cancellation still wins. */
|
|
2255
|
+
async armUnlessDue(ref, deadline, signal) {
|
|
2256
|
+
try {
|
|
2257
|
+
await this.arm(ref, deadline);
|
|
2258
|
+
return false;
|
|
2259
|
+
}
|
|
2260
|
+
catch (error) {
|
|
2261
|
+
if (error instanceof PauseOverdue) {
|
|
2262
|
+
if (signal.cancelled)
|
|
2263
|
+
throw new Cancelled(signal.reason ?? "cancelled");
|
|
2264
|
+
return true;
|
|
2265
|
+
}
|
|
2266
|
+
throw error;
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2243
2269
|
async armOnce(ref, deadline) {
|
|
2244
2270
|
if (this.services)
|
|
2245
2271
|
return this.services.pauses.arm(ref.token, deadline);
|