@astrosheep/keiyaku 2.9.12 → 2.9.13
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/README.md +22 -18
- package/build/.tsbuildinfo +1 -1
- package/build/agents/call-terms.js +1 -0
- package/build/agents/providers/claude-agent-sdk/adapter.js +2 -2
- package/build/cli/commands/akuma/akuma/handler.js +2 -1
- package/build/cli/commands/akuma/akuma/meta.js +4 -3
- package/build/cli/commands/akuma/catalog.js +2 -0
- package/build/cli/commands/akuma/list/handler.js +1 -1
- package/build/cli/commands/akuma/list/meta-list.js +12 -0
- package/build/cli/commands/akuma/list/meta-ls.js +2 -2
- package/build/cli/commands/akuma.js +5 -0
- package/build/cli/commands/contract/amend/meta.js +4 -3
- package/build/cli/commands/contract/arc/meta.js +2 -0
- package/build/cli/commands/contract/audit/handler.js +28 -2
- package/build/cli/commands/contract/audit/meta.js +4 -3
- package/build/cli/commands/contract/petition/handler.js +2 -1
- package/build/cli/commands/contract/petition/meta.js +2 -2
- package/build/cli/commands/contract/renew/handler.js +44 -3
- package/build/cli/commands/contract/renew/meta.js +5 -4
- package/build/cli/commands/metadata.js +12 -9
- package/build/cli/commands/projection/call/handler.js +1 -1
- package/build/cli/commands/projection/call/meta.js +1 -1
- package/build/cli/commands/projection/catalog.js +2 -2
- package/build/cli/commands/projection/{revive → fork}/handler.js +10 -5
- package/build/cli/commands/projection/fork/meta.js +12 -0
- package/build/cli/commands/projection/history/handler.js +46 -2
- package/build/cli/commands/projection/history/meta.js +3 -3
- package/build/cli/commands/projection/kill/meta.js +2 -2
- package/build/cli/commands/projection/status/handler.js +29 -13
- package/build/cli/commands/projection/status/meta.js +14 -3
- package/build/cli/commands/projection/tell/handler.js +8 -4
- package/build/cli/commands/projection/tell/meta.js +1 -1
- package/build/cli/commands/projection/wait/handler.js +45 -20
- package/build/cli/commands/projection/wait/meta.js +1 -1
- package/build/cli/commands/shared.js +1 -1
- package/build/cli/commands/system/catalog.js +2 -0
- package/build/cli/commands/task/add/handler.js +28 -12
- package/build/cli/commands/task/add/meta.js +18 -6
- package/build/cli/commands/task/catalog.js +2 -0
- package/build/cli/commands/task/compose/handler.js +2 -2
- package/build/cli/commands/task/compose/meta.js +2 -2
- package/build/cli/commands/task/doctor/handler.js +2 -3
- package/build/cli/commands/task/doctor/meta.js +2 -2
- package/build/cli/commands/task/done/meta.js +2 -2
- package/build/cli/commands/task/drop/handler.js +7 -2
- package/build/cli/commands/task/drop/meta.js +6 -3
- package/build/cli/commands/task/hold/meta.js +2 -2
- package/build/cli/commands/task/log/meta.js +2 -2
- package/build/cli/commands/task/ls/meta.js +2 -2
- package/build/cli/commands/task/note/handler.js +6 -0
- package/build/cli/commands/task/note/meta.js +11 -0
- package/build/cli/commands/task/resume/meta.js +2 -2
- package/build/cli/commands/task/shared.js +29 -15
- package/build/cli/commands/task/show/meta.js +2 -2
- package/build/cli/commands/task/start/meta.js +2 -2
- package/build/cli/commands/task/stop/meta.js +2 -2
- package/build/cli/commands/task/update/meta.js +3 -2
- package/build/cli/commands/verification/handler.js +43 -0
- package/build/cli/commands/verification/meta.js +13 -0
- package/build/cli/completion.js +16 -13
- package/build/cli/flags.js +43 -11
- package/build/cli/help.js +29 -30
- package/build/cli/index.js +6 -5
- package/build/cli/parse-flags.js +39 -0
- package/build/cli/parse-metadata.js +5 -2
- package/build/cli/parse-selectors.js +18 -0
- package/build/cli/parse.js +21 -8
- package/build/cli/render/arc.js +12 -3
- package/build/cli/render/audit.js +2 -2
- package/build/cli/render/call.js +4 -4
- package/build/cli/render/kanshi.js +122 -85
- package/build/cli/render/misc.js +2 -2
- package/build/cli/render/petition.js +16 -1
- package/build/cli/render/projection-history.js +17 -4
- package/build/cli/render/shared.js +5 -5
- package/build/cli/render/status-indicator.js +47 -0
- package/build/cli/render/status.js +106 -76
- package/build/cli/render/success-response.js +20 -5
- package/build/cli/render/task.js +6 -5
- package/build/cli/render/tell.js +10 -4
- package/build/cli/render/tool-command-normalization.js +137 -0
- package/build/cli/render/tool-presentation.js +2 -1
- package/build/cli/render/verification.js +23 -0
- package/build/cli/render/wait.js +101 -33
- package/build/cli/types.js +2 -1
- package/build/config/akuma-loader.js +21 -1
- package/build/config/settings/knobs.js +7 -1
- package/build/config/settings/schema.js +10 -5
- package/build/core/amend.js +102 -17
- package/build/core/arc.js +4 -4
- package/build/core/audit/candidate.js +10 -18
- package/build/core/audit/coordinates.js +12 -17
- package/build/core/audit/evidence.js +6 -4
- package/build/core/audit/facade.js +3 -3
- package/build/core/audit/report.js +1 -1
- package/build/core/bind-reconciliation.js +42 -23
- package/build/core/bind.js +182 -81
- package/build/core/call/call.js +6 -7
- package/build/core/call/context.js +43 -30
- package/build/core/call/execution.js +21 -6
- package/build/core/call/prompt.js +11 -42
- package/build/core/contract-carrier-runtime.js +209 -105
- package/build/core/contract-carrier.js +156 -73
- package/build/core/contract-view.js +42 -5
- package/build/core/contract.js +2 -1
- package/build/core/derived-replay.js +168 -35
- package/build/core/draft.js +9 -5
- package/build/core/forfeit.js +1 -1
- package/build/core/lifecycle-history.js +13 -0
- package/build/core/lifecycle-recovery.js +32 -27
- package/build/core/lifecycle-runner.js +14 -14
- package/build/core/log.js +1 -1
- package/build/core/outcome-base.js +2 -2
- package/build/core/projection/akuma-name.js +43 -0
- package/build/core/projection/generation/database.js +141 -79
- package/build/core/projection/generation/ledger.js +91 -0
- package/build/core/projection/generation/model.js +18 -13
- package/build/core/projection/generation/projection-generation-continuation.js +1 -1
- package/build/core/projection/generation/projection-generation-doorbell.js +88 -0
- package/build/core/projection/generation/projection-generation-execution.js +24 -0
- package/build/core/projection/generation/projection-generation-identity.js +4 -0
- package/build/core/projection/generation/projection-generation-launcher.js +72 -138
- package/build/core/projection/generation/projection-generation-process.js +16 -15
- package/build/core/projection/generation/projection-generation-runner.js +125 -79
- package/build/core/projection/generation/projection-generation-runtime.js +10 -61
- package/build/core/projection/generation/protocol.js +68 -0
- package/build/core/projection/generation/store.js +17 -7
- package/build/core/projection/generation/transitions.js +14 -14
- package/build/core/projection/index.js +5 -5
- package/build/core/projection/projection-core.js +6 -2
- package/build/core/projection/projection-execution-observer.js +1 -1
- package/build/core/projection/projection-history.js +7 -7
- package/build/core/projection/projection-kill.js +15 -6
- package/build/core/projection/projection-life-observer.js +8 -8
- package/build/core/projection/projection-mint.js +6 -8
- package/build/core/projection/projection-status-observation.js +77 -8
- package/build/core/projection/projection-status.js +151 -4
- package/build/core/projection/projection-wait.js +46 -27
- package/build/core/projection/projection-wake.js +27 -89
- package/build/core/projection/tell/launch-store.js +1 -1
- package/build/core/projection/tell/store.js +1 -1
- package/build/core/renew-build.js +204 -74
- package/build/core/renew-plan.js +34 -9
- package/build/core/renew-rewrite.js +56 -15
- package/build/core/renew.js +39 -35
- package/build/core/repository-ledger/accepted-fold-read.js +6 -3
- package/build/core/repository-ledger/codec.js +11 -5
- package/build/core/repository-ledger/current-state-store.js +13 -16
- package/build/core/repository-ledger/fold-repository.js +5 -6
- package/build/core/repository-ledger/identity.js +60 -0
- package/build/core/repository-ledger/inventory.js +3 -3
- package/build/core/repository-ledger/read-model.js +54 -6
- package/build/core/repository-ledger/write-transaction.js +9 -4
- package/build/core/run-control/connection-bound-close.js +41 -0
- package/build/core/run-control/detached-lease-bootstrap.js +208 -0
- package/build/core/run-control/detached-process.js +14 -0
- package/build/core/run-control/index.js +6 -0
- package/build/core/{process-group.js → run-control/process-tree.js} +1 -1
- package/build/core/run-control/runner-lease.js +172 -0
- package/build/core/{sqlite-process-lifetime-lock.js → run-control/sqlite-process-lifetime-lock.js} +4 -24
- package/build/core/seal.js +44 -32
- package/build/core/settlement/claim-delivery.js +22 -9
- package/build/core/settlement/claim.js +8 -6
- package/build/core/settlement/petition-claim-gates.js +9 -8
- package/build/core/settlement/petition-head-guard.js +5 -6
- package/build/core/settlement/petition-preview.js +21 -5
- package/build/core/settlement/petition.js +51 -17
- package/build/core/settlement/settlement.js +20 -15
- package/build/core/settlement/verdict.js +2 -2
- package/build/core/settlement/verification.js +492 -364
- package/build/core/status/board.js +184 -75
- package/build/core/status/drift.js +8 -10
- package/build/core/task/board.js +1 -0
- package/build/core/task/commands.js +25 -0
- package/build/core/task/compose.js +3 -2
- package/build/core/task/document.js +102 -39
- package/build/core/task/index.js +3 -3
- package/build/core/task/settlement-git.js +1 -4
- package/build/core/task/settlement-policy.js +27 -14
- package/build/core/task/source-board.js +1 -0
- package/build/core/task/task-bind-preparation.js +59 -9
- package/build/core/task/task-contract.js +2 -2
- package/build/core/task/task-store-repository.js +1 -0
- package/build/core/task/task.js +2 -2
- package/build/core/transcripts.js +4 -4
- package/build/core/verification-declaration.js +95 -0
- package/build/core/worktree-bootstrap.js +1 -1
- package/build/core/worktree-path.js +7 -11
- package/build/flow-error.js +9 -1
- package/build/generated/version.js +2 -2
- package/build/git/branches.js +41 -70
- package/build/git/commits.js +92 -21
- package/build/git/core.js +9 -161
- package/build/git/diff/preview.js +4 -4
- package/build/git/diff/read.js +4 -4
- package/build/git/diff/structured.js +5 -5
- package/build/git/process.js +229 -0
- package/build/git/refs.js +30 -5
- package/build/git/staging.js +39 -115
- package/build/git/streaming-batch.js +9 -16
- package/build/git/worktree.js +104 -91
- package/build/index.js +7 -0
- package/package.json +1 -1
- package/skills/keiyaku-akuma/SKILL.md +21 -20
- package/skills/keiyaku-task/SKILL.md +38 -4
- package/skills/keiyaku-workflow/SKILL.md +51 -11
- package/build/cli/commands/projection/revive/meta.js +0 -12
- package/build/core/projection/projection-life-protocol.js +0 -115
- package/build/core/projection/projection-runner-lock.js +0 -211
- package/build/core/projection/tell/database.js +0 -127
- package/build/core/settlement/verification-coordination.js +0 -305
- package/build/core/settlement/verification-supervisor.js +0 -275
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
import { execFile, spawn } from "node:child_process";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { PROCESS_GROUP_KILL_GRACE_MS } from "../process-group.js";
|
|
5
|
-
export const VERIFICATION_SUPERVISOR_PROTOCOL_VERSION = 1;
|
|
6
|
-
const configureMessageSchema = z.object({
|
|
7
|
-
version: z.literal(VERIFICATION_SUPERVISOR_PROTOCOL_VERSION),
|
|
8
|
-
type: z.literal("configure"),
|
|
9
|
-
cwd: z.string().min(1),
|
|
10
|
-
command: z.string().min(1),
|
|
11
|
-
args: z.array(z.string()),
|
|
12
|
-
shell: z.boolean(),
|
|
13
|
-
timeoutMs: z.number().int().positive(),
|
|
14
|
-
}).strict();
|
|
15
|
-
const startMessageSchema = z.object({
|
|
16
|
-
version: z.literal(VERIFICATION_SUPERVISOR_PROTOCOL_VERSION),
|
|
17
|
-
type: z.literal("start"),
|
|
18
|
-
}).strict();
|
|
19
|
-
export const supervisorMessageSchema = z.discriminatedUnion("type", [
|
|
20
|
-
z.object({
|
|
21
|
-
version: z.literal(VERIFICATION_SUPERVISOR_PROTOCOL_VERSION),
|
|
22
|
-
type: z.literal("ready"),
|
|
23
|
-
}).strict(),
|
|
24
|
-
z.object({
|
|
25
|
-
version: z.literal(VERIFICATION_SUPERVISOR_PROTOCOL_VERSION),
|
|
26
|
-
type: z.literal("configured"),
|
|
27
|
-
}).strict(),
|
|
28
|
-
z.object({
|
|
29
|
-
version: z.literal(VERIFICATION_SUPERVISOR_PROTOCOL_VERSION),
|
|
30
|
-
type: z.literal("started"),
|
|
31
|
-
}).strict(),
|
|
32
|
-
z.object({
|
|
33
|
-
version: z.literal(VERIFICATION_SUPERVISOR_PROTOCOL_VERSION),
|
|
34
|
-
type: z.literal("terminal"),
|
|
35
|
-
durationMs: z.number().nonnegative(),
|
|
36
|
-
outcome: z.discriminatedUnion("kind", [
|
|
37
|
-
z.object({ kind: z.literal("exit"), code: z.number().int() }).strict(),
|
|
38
|
-
z.object({ kind: z.literal("signal"), signal: z.string().nullable() }).strict(),
|
|
39
|
-
z.object({ kind: z.literal("spawn-failed"), message: z.string() }).strict(),
|
|
40
|
-
z.object({ kind: z.literal("timeout") }).strict(),
|
|
41
|
-
z.object({ kind: z.literal("tree-termination-failed"), message: z.string() }).strict(),
|
|
42
|
-
]),
|
|
43
|
-
}).strict(),
|
|
44
|
-
]);
|
|
45
|
-
function verificationSupervisorPath() {
|
|
46
|
-
const extension = import.meta.url.endsWith(".ts") ? "ts" : "js";
|
|
47
|
-
return fileURLToPath(new URL(`./verification-supervisor.${extension}`, import.meta.url));
|
|
48
|
-
}
|
|
49
|
-
export function verificationSupervisorArguments() {
|
|
50
|
-
const target = verificationSupervisorPath();
|
|
51
|
-
return import.meta.url.endsWith(".ts") ? ["--import", "tsx", target] : [target];
|
|
52
|
-
}
|
|
53
|
-
function send(message) {
|
|
54
|
-
if (process.connected)
|
|
55
|
-
process.send?.(message);
|
|
56
|
-
}
|
|
57
|
-
function durationMs(started) {
|
|
58
|
-
return Number((process.hrtime.bigint() - started) / 1000000n);
|
|
59
|
-
}
|
|
60
|
-
function forward(source, destination, outputLost) {
|
|
61
|
-
source?.on("data", (chunk) => {
|
|
62
|
-
try {
|
|
63
|
-
if (!destination.write(chunk)) {
|
|
64
|
-
source.pause();
|
|
65
|
-
destination.once("drain", () => source.resume());
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
outputLost();
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
async function drainOutput() {
|
|
74
|
-
const drains = [];
|
|
75
|
-
for (const stream of [process.stdout, process.stderr]) {
|
|
76
|
-
if (!stream.destroyed && !stream.closed && stream.writableNeedDrain) {
|
|
77
|
-
drains.push(new Promise((resolve) => stream.once("drain", resolve)));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
await Promise.all(drains);
|
|
81
|
-
}
|
|
82
|
-
function defaultTaskkill(pid) {
|
|
83
|
-
return new Promise((resolve, reject) => {
|
|
84
|
-
execFile("taskkill", ["/PID", String(pid), "/T", "/F"], { windowsHide: true }, (error) => {
|
|
85
|
-
if (error)
|
|
86
|
-
reject(error);
|
|
87
|
-
else
|
|
88
|
-
resolve();
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
export async function terminateWindowsPayloadTree(pid, taskkill = defaultTaskkill) {
|
|
93
|
-
await taskkill(pid);
|
|
94
|
-
}
|
|
95
|
-
function signalOwnedGroup(signal) {
|
|
96
|
-
if (process.platform === "win32")
|
|
97
|
-
return;
|
|
98
|
-
try {
|
|
99
|
-
process.kill(-process.pid, signal);
|
|
100
|
-
}
|
|
101
|
-
catch (error) {
|
|
102
|
-
if (!(error && typeof error === "object" && "code" in error && error.code === "ESRCH"))
|
|
103
|
-
throw error;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
async function runSupervisor() {
|
|
107
|
-
if (typeof process.send !== "function")
|
|
108
|
-
process.exit(2);
|
|
109
|
-
let payload;
|
|
110
|
-
let payloadStartedAt;
|
|
111
|
-
let commandTimer;
|
|
112
|
-
let killTimer;
|
|
113
|
-
let shutdown;
|
|
114
|
-
let finalized = false;
|
|
115
|
-
let configuration;
|
|
116
|
-
let payloadClosedAtMs;
|
|
117
|
-
let windowsTaskkillComplete = false;
|
|
118
|
-
const finish = async (message) => {
|
|
119
|
-
if (finalized)
|
|
120
|
-
return;
|
|
121
|
-
finalized = true;
|
|
122
|
-
if (commandTimer)
|
|
123
|
-
clearTimeout(commandTimer);
|
|
124
|
-
if (killTimer)
|
|
125
|
-
clearTimeout(killTimer);
|
|
126
|
-
await drainOutput();
|
|
127
|
-
if (message)
|
|
128
|
-
send(message);
|
|
129
|
-
if (process.connected)
|
|
130
|
-
process.disconnect?.();
|
|
131
|
-
process.exit(0);
|
|
132
|
-
};
|
|
133
|
-
const finishShutdown = () => {
|
|
134
|
-
if (shutdown === "timeout") {
|
|
135
|
-
void finish({
|
|
136
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
137
|
-
type: "terminal",
|
|
138
|
-
durationMs: payloadClosedAtMs ?? durationMs(payloadStartedAt),
|
|
139
|
-
outcome: { kind: "timeout" },
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
void finish();
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
const beginShutdown = (reason) => {
|
|
147
|
-
if (shutdown || finalized)
|
|
148
|
-
return;
|
|
149
|
-
shutdown = reason;
|
|
150
|
-
if (!payload) {
|
|
151
|
-
void finish();
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (process.platform === "win32") {
|
|
155
|
-
if (!payload.pid) {
|
|
156
|
-
void finish();
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
void terminateWindowsPayloadTree(payload.pid).then(() => {
|
|
160
|
-
windowsTaskkillComplete = true;
|
|
161
|
-
if (payloadClosedAtMs !== undefined)
|
|
162
|
-
finishShutdown();
|
|
163
|
-
}, (error) => {
|
|
164
|
-
send({
|
|
165
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
166
|
-
type: "terminal",
|
|
167
|
-
durationMs: durationMs(payloadStartedAt),
|
|
168
|
-
outcome: {
|
|
169
|
-
kind: "tree-termination-failed",
|
|
170
|
-
message: error instanceof Error ? error.message : String(error),
|
|
171
|
-
},
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
signalOwnedGroup("SIGTERM");
|
|
177
|
-
killTimer = setTimeout(() => signalOwnedGroup("SIGKILL"), PROCESS_GROUP_KILL_GRACE_MS);
|
|
178
|
-
};
|
|
179
|
-
process.on("SIGTERM", () => beginShutdown("external"));
|
|
180
|
-
process.on("disconnect", () => beginShutdown("parent-lost"));
|
|
181
|
-
const outputLost = () => beginShutdown("parent-lost");
|
|
182
|
-
process.stdout.once("error", outputLost);
|
|
183
|
-
process.stdout.once("close", outputLost);
|
|
184
|
-
process.stderr.once("error", outputLost);
|
|
185
|
-
process.stderr.once("close", outputLost);
|
|
186
|
-
process.on("message", (raw) => {
|
|
187
|
-
const configured = configureMessageSchema.safeParse(raw);
|
|
188
|
-
if (configured.success && !configuration && !payload && process.connected) {
|
|
189
|
-
configuration = configured.data;
|
|
190
|
-
send({ version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION, type: "configured" });
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
const start = startMessageSchema.safeParse(raw);
|
|
194
|
-
if (!start.success || !configuration || payload || !process.connected) {
|
|
195
|
-
void finish();
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
const message = configuration;
|
|
199
|
-
payloadStartedAt = process.hrtime.bigint();
|
|
200
|
-
try {
|
|
201
|
-
payload = spawn(message.command, message.args, {
|
|
202
|
-
cwd: message.cwd,
|
|
203
|
-
shell: message.shell,
|
|
204
|
-
env: process.env,
|
|
205
|
-
detached: false,
|
|
206
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
catch (error) {
|
|
210
|
-
void finish({
|
|
211
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
212
|
-
type: "terminal",
|
|
213
|
-
durationMs: durationMs(payloadStartedAt),
|
|
214
|
-
outcome: { kind: "spawn-failed", message: error instanceof Error ? error.message : String(error) },
|
|
215
|
-
});
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
forward(payload.stdout, process.stdout, outputLost);
|
|
219
|
-
forward(payload.stderr, process.stderr, outputLost);
|
|
220
|
-
payload.once("error", (error) => {
|
|
221
|
-
void finish({
|
|
222
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
223
|
-
type: "terminal",
|
|
224
|
-
durationMs: durationMs(payloadStartedAt),
|
|
225
|
-
outcome: { kind: "spawn-failed", message: error.message },
|
|
226
|
-
});
|
|
227
|
-
});
|
|
228
|
-
payload.once("close", (code, signal) => {
|
|
229
|
-
const elapsed = durationMs(payloadStartedAt);
|
|
230
|
-
payloadClosedAtMs = elapsed;
|
|
231
|
-
if (shutdown && process.platform === "win32") {
|
|
232
|
-
if (windowsTaskkillComplete)
|
|
233
|
-
finishShutdown();
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
else if (shutdown === "parent-lost") {
|
|
237
|
-
return;
|
|
238
|
-
}
|
|
239
|
-
else if (shutdown === "timeout") {
|
|
240
|
-
void finish({
|
|
241
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
242
|
-
type: "terminal",
|
|
243
|
-
durationMs: elapsed,
|
|
244
|
-
outcome: { kind: "timeout" },
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
else if (shutdown) {
|
|
248
|
-
void finish();
|
|
249
|
-
}
|
|
250
|
-
else if (code === null) {
|
|
251
|
-
void finish({
|
|
252
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
253
|
-
type: "terminal",
|
|
254
|
-
durationMs: elapsed,
|
|
255
|
-
outcome: { kind: "signal", signal },
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
else {
|
|
259
|
-
void finish({
|
|
260
|
-
version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION,
|
|
261
|
-
type: "terminal",
|
|
262
|
-
durationMs: elapsed,
|
|
263
|
-
outcome: { kind: "exit", code },
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
});
|
|
267
|
-
commandTimer = setTimeout(() => beginShutdown("timeout"), message.timeoutMs);
|
|
268
|
-
commandTimer.unref?.();
|
|
269
|
-
send({ version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION, type: "started" });
|
|
270
|
-
});
|
|
271
|
-
send({ version: VERIFICATION_SUPERVISOR_PROTOCOL_VERSION, type: "ready" });
|
|
272
|
-
}
|
|
273
|
-
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
274
|
-
void runSupervisor();
|
|
275
|
-
}
|