@astrosheep/keiyaku 4.5.8 → 4.5.9
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 +1 -1
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku/SKILL.md +2 -2
- package/build/integrations/marketplace/plugins/keiyaku/skills/keiyaku-akuma/SKILL.md +15 -15
- package/build/src/akuma/akuma.d.ts +24 -4
- package/build/src/akuma/archetype.js +1 -1
- package/build/src/akuma/body.d.ts +2 -1
- package/build/src/akuma/body.js +7 -2
- package/build/src/akuma/call-request.js +1 -1
- package/build/src/akuma/heart/facts.d.ts +10 -0
- package/build/src/akuma/heart/facts.js +11 -0
- package/build/src/akuma/heart/index.d.ts +3 -2
- package/build/src/akuma/heart/index.js +4 -1
- package/build/src/akuma/projection.d.ts +63 -12
- package/build/src/akuma/projection.js +5 -11
- package/build/src/akuma/provider.js +8 -1
- package/build/src/akuma/providers/claude/events.d.ts +2 -2
- package/build/src/akuma/providers/claude/events.js +16 -3
- package/build/src/akuma/providers/codex-app-server/events.d.ts +2 -2
- package/build/src/akuma/providers/codex-app-server/events.js +25 -4
- package/build/src/akuma/providers/pi/index.js +55 -69
- package/build/src/akuma/request-lifecycle.d.ts +1 -1
- package/build/src/akuma/request-lifecycle.js +3 -1
- package/build/src/akuma/request-serve.d.ts +1 -1
- package/build/src/akuma/request-serve.js +4 -4
- package/build/src/akuma/turn-drive.js +8 -2
- package/build/src/body/amend.js +18 -19
- package/build/src/cli/commands/akuma.js +2 -2
- package/build/src/cli/commands/contract-invoke.js +27 -22
- package/build/src/cli/commands/contract.d.ts +6 -10
- package/build/src/cli/commands/contract.js +29 -11
- package/build/src/cli/commands/install.d.ts +1 -0
- package/build/src/cli/commands/install.js +2 -1
- package/build/src/cli/parse.js +23 -9
- package/build/src/cli/render/akuma-activity.d.ts +1 -1
- package/build/src/cli/render/akuma-activity.js +4 -3
- package/build/src/cli/render/akuma.js +1 -1
- package/build/src/cli/render/catalog.js +1 -1
- package/build/src/cli/render/contract.js +13 -0
- package/build/src/cli/render/kanshi-akuma.js +26 -5
- package/build/src/cli/render/kanshi.js +26 -3
- package/build/src/cli/render/terminal.d.ts +4 -1
- package/build/src/cli/render/terminal.js +12 -1
- package/build/src/cli/runtime.js +1 -1
- package/build/src/git/nuke.js +3 -3
- package/build/src/git/process.js +7 -4
- package/build/src/git/read-observation.js +1 -1
- package/build/src/git/reconcile.d.ts +2 -1
- package/build/src/git/reconcile.js +6 -0
- package/build/src/git/ref-migration.d.ts +22 -0
- package/build/src/git/ref-migration.js +55 -0
- package/build/src/git/repository.d.ts +4 -4
- package/build/src/git/repository.js +8 -8
- package/build/src/library/audit.d.ts +13 -5
- package/build/src/library/audit.js +9 -21
- package/build/src/library/composition.d.ts +41 -27
- package/build/src/library/composition.js +3 -3
- package/build/src/library/contract-forwarding-reconciliation-result.d.ts +17 -11
- package/build/src/library/contract-forwarding-reconciliation-result.js +11 -2
- package/build/src/library/contract-forwarding-result.d.ts +1628 -3887
- package/build/src/library/contract-forwarding-result.js +1 -1
- package/build/src/library/contract-forwarding.d.ts +12 -13
- package/build/src/library/contract-forwarding.js +17 -28
- package/build/src/library/contract-handle.d.ts +3 -1
- package/build/src/library/contract-handle.js +23 -22
- package/build/src/library/contract-operations.d.ts +61 -893
- package/build/src/library/contract-operations.js +2 -3
- package/build/src/library/contract-types.d.ts +7 -3
- package/build/src/library/contract.d.ts +12 -4
- package/build/src/library/contract.js +21 -6
- package/build/src/library/fleet-result.d.ts +138 -12
- package/build/src/library/fleet-result.js +2 -0
- package/build/src/library/input.d.ts +1 -1
- package/build/src/library/input.js +7 -1
- package/build/src/library/keiyaku.d.ts +44 -27
- package/build/src/library/keiyaku.js +6 -1
- package/build/src/runtime/proc/run.d.ts +1 -0
- package/build/src/runtime/proc/run.js +25 -5
- package/build/src/runtime/proc/windows-launch.exe +0 -0
- package/package.json +1 -1
|
@@ -7,12 +7,27 @@ import { createProcessLifecycle } from "./lifecycle.js";
|
|
|
7
7
|
import { terminateOwnedProcess } from "./termination.js";
|
|
8
8
|
import { spawnWindowsRetainedProcess } from "./windows-run.js";
|
|
9
9
|
const STREAM_TAIL_BYTES = 16 * 1024;
|
|
10
|
+
function waitForProcessEnd(child, terminationFailure) {
|
|
11
|
+
const childEnd = new Promise((resolve) => {
|
|
12
|
+
child.once("close", (code) => resolve({ kind: "closed", code }));
|
|
13
|
+
child.once("error", (error) => resolve({ kind: "spawn-error", error }));
|
|
14
|
+
});
|
|
15
|
+
return Promise.race([childEnd, terminationFailure]);
|
|
16
|
+
}
|
|
10
17
|
export function spawnCancellableProcess(input) {
|
|
11
18
|
const child = spawn(input.argv[0], input.argv.slice(1), spawnOptionsFor(input, ["pipe", "pipe", "pipe"]));
|
|
12
19
|
let cancelled = false;
|
|
13
20
|
let termination;
|
|
21
|
+
let reportTerminationFailure;
|
|
22
|
+
const terminationFailure = new Promise((_resolve, reject) => {
|
|
23
|
+
reportTerminationFailure = reject;
|
|
24
|
+
});
|
|
25
|
+
void terminationFailure.catch(() => undefined);
|
|
14
26
|
const terminate = (force = false) => {
|
|
15
|
-
termination
|
|
27
|
+
if (termination === undefined) {
|
|
28
|
+
termination = terminateOwnedProcess(child, force);
|
|
29
|
+
void termination.catch(reportTerminationFailure);
|
|
30
|
+
}
|
|
16
31
|
return termination;
|
|
17
32
|
};
|
|
18
33
|
const cancel = () => {
|
|
@@ -27,6 +42,7 @@ export function spawnCancellableProcess(input) {
|
|
|
27
42
|
return {
|
|
28
43
|
child,
|
|
29
44
|
cancelled: () => cancelled,
|
|
45
|
+
terminationFailure,
|
|
30
46
|
terminate,
|
|
31
47
|
async waitTermination() {
|
|
32
48
|
input.signal?.removeEventListener("abort", cancel);
|
|
@@ -143,11 +159,16 @@ async function executeProcess(input, timeoutMs, consumeStdout, spawnProcess = sp
|
|
|
143
159
|
let stop;
|
|
144
160
|
let streamError;
|
|
145
161
|
let termination;
|
|
162
|
+
let reportTerminationFailure;
|
|
163
|
+
const terminationFailure = new Promise((resolve) => {
|
|
164
|
+
reportTerminationFailure = (error) => resolve({ kind: "termination-error", error });
|
|
165
|
+
});
|
|
146
166
|
const requestStop = (reason) => {
|
|
147
167
|
if (stop !== undefined)
|
|
148
168
|
return;
|
|
149
169
|
stop = reason;
|
|
150
170
|
termination = terminateOwnedProcess(child);
|
|
171
|
+
void termination.catch(reportTerminationFailure);
|
|
151
172
|
};
|
|
152
173
|
const failStream = (error) => {
|
|
153
174
|
if (streamError !== undefined)
|
|
@@ -175,13 +196,12 @@ async function executeProcess(input, timeoutMs, consumeStdout, spawnProcess = sp
|
|
|
175
196
|
const cancel = () => requestStop("cancelled");
|
|
176
197
|
input.signal?.addEventListener("abort", cancel, { once: true });
|
|
177
198
|
const timeout = timeoutMs === undefined ? undefined : setTimeout(() => requestStop("timeout"), timeoutMs);
|
|
178
|
-
const terminal = await
|
|
179
|
-
child.once("close", (code) => resolve({ kind: "closed", code }));
|
|
180
|
-
child.once("error", (error) => resolve({ kind: "spawn-error", error }));
|
|
181
|
-
});
|
|
199
|
+
const terminal = await waitForProcessEnd(child, terminationFailure);
|
|
182
200
|
if (timeout !== undefined)
|
|
183
201
|
clearTimeout(timeout);
|
|
184
202
|
input.signal?.removeEventListener("abort", cancel);
|
|
203
|
+
if (terminal.kind === "termination-error")
|
|
204
|
+
throw terminal.error;
|
|
185
205
|
await termination;
|
|
186
206
|
const pid = child.pid ?? null;
|
|
187
207
|
if (terminal.kind === "spawn-error") {
|
|
Binary file
|