acpx 0.19.2 → 0.19.4
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/{agent-registry-DWlx5BQ4.js → agent-registry-kHdpsK9F.js} +35 -21
- package/dist/agent-registry-kHdpsK9F.js.map +1 -0
- package/dist/agent-registry.d.ts.map +1 -1
- package/dist/agent-registry.js +1 -1
- package/dist/{cli-D-s_eTUy.js → cli-DCtHeMEi.js} +34 -46
- package/dist/cli-DCtHeMEi.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +57 -40
- package/dist/cli.js.map +1 -1
- package/dist/{client-BchvQRpz.d.ts → client-DqCXdF0Q.d.ts} +6 -18
- package/dist/client-DqCXdF0Q.d.ts.map +1 -0
- package/dist/{flows-DdxEaeZo.js → flows--1zpaEh9.js} +38 -14
- package/dist/flows--1zpaEh9.js.map +1 -0
- package/dist/flows.d.ts +2 -2
- package/dist/flows.js +1 -1
- package/dist/{invocation-options-HjxSBsK0.js → invocation-options-CvkenzCc.js} +6 -12
- package/dist/invocation-options-CvkenzCc.js.map +1 -0
- package/dist/{ipc-D0ZMQ0q9.js → ipc-D7zT86b9.js} +430 -307
- package/dist/ipc-D7zT86b9.js.map +1 -0
- package/dist/{output-GQnhkJMU.js → output-lylSoEBd.js} +12 -4
- package/dist/output-lylSoEBd.js.map +1 -0
- package/dist/{queue-owner-runtime-W0lly6ap.js → queue-owner-runtime-C0wIYowh.js} +766 -547
- package/dist/queue-owner-runtime-C0wIYowh.js.map +1 -0
- package/dist/runtime.d.ts +23 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +52 -22
- package/dist/runtime.js.map +1 -1
- package/dist/{session-options-Dp6mzNSy.d.ts → session-options-X7LhX9BF.d.ts} +2 -1
- package/dist/{session-options-Dp6mzNSy.d.ts.map → session-options-X7LhX9BF.d.ts.map} +1 -1
- package/dist/{session-watch-_8yxQ6ba.js → session-watch-DPOwDRf8.js} +4 -4
- package/dist/{session-watch-_8yxQ6ba.js.map → session-watch-DPOwDRf8.js.map} +1 -1
- package/dist/{watch-C0mwpJcN.js → watch-H7rNOJtv.js} +2 -2
- package/dist/{watch-C0mwpJcN.js.map → watch-H7rNOJtv.js.map} +1 -1
- package/package.json +17 -16
- package/skills/acpx/SKILL.md +13 -3
- package/dist/agent-registry-DWlx5BQ4.js.map +0 -1
- package/dist/cli-D-s_eTUy.js.map +0 -1
- package/dist/client-BchvQRpz.d.ts.map +0 -1
- package/dist/flows-DdxEaeZo.js.map +0 -1
- package/dist/invocation-options-HjxSBsK0.js.map +0 -1
- package/dist/ipc-D0ZMQ0q9.js.map +0 -1
- package/dist/output-GQnhkJMU.js.map +0 -1
- package/dist/queue-owner-runtime-W0lly6ap.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as PromptInput, S as PermissionMode, a as AcpElicitationHandler, d as AcpPermissionHandler, r as AcpClientOptions, w as PermissionStats, x as NonInteractivePermissionPolicy } from "./session-options-
|
|
1
|
+
import { E as PromptInput, S as PermissionMode, a as AcpElicitationHandler, d as AcpPermissionHandler, r as AcpClientOptions, w as PermissionStats, x as NonInteractivePermissionPolicy } from "./session-options-X7LhX9BF.js";
|
|
2
2
|
import { AnyMessage, InitializeResponse, ListSessionsRequest, ListSessionsResponse, PromptResponse, SessionConfigOption, SetSessionConfigOptionResponse } from "@agentclientprotocol/sdk";
|
|
3
3
|
//#region src/async-control.d.ts
|
|
4
4
|
type AcpControlAuthority = {
|
|
@@ -6,7 +6,7 @@ type AcpControlAuthority = {
|
|
|
6
6
|
assertActive?: () => void;
|
|
7
7
|
};
|
|
8
8
|
//#endregion
|
|
9
|
-
//#region src/acp/model-
|
|
9
|
+
//#region src/acp/model-config-state.d.ts
|
|
10
10
|
type SessionModelState = {
|
|
11
11
|
configId?: string;
|
|
12
12
|
currentModelId: string;
|
|
@@ -15,19 +15,6 @@ type SessionModelState = {
|
|
|
15
15
|
name: string;
|
|
16
16
|
}>;
|
|
17
17
|
};
|
|
18
|
-
declare const REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE: "ACP_MODEL_UNSUPPORTED";
|
|
19
|
-
type RequestedModelUnsupportedErrorCode = typeof REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE;
|
|
20
|
-
declare const REQUESTED_MODEL_UNSUPPORTED_REASONS: readonly ["missing-capability", "unadvertised-model"];
|
|
21
|
-
type RequestedModelUnsupportedReason = (typeof REQUESTED_MODEL_UNSUPPORTED_REASONS)[number];
|
|
22
|
-
declare class RequestedModelUnsupportedError extends Error {
|
|
23
|
-
readonly code: "ACP_MODEL_UNSUPPORTED";
|
|
24
|
-
readonly reason: RequestedModelUnsupportedReason;
|
|
25
|
-
readonly ambiguous?: true;
|
|
26
|
-
constructor(message: string, reason: RequestedModelUnsupportedReason, details?: {
|
|
27
|
-
ambiguous?: true;
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
declare function isRequestedModelUnsupportedError(value: unknown): value is RequestedModelUnsupportedError;
|
|
31
18
|
//#endregion
|
|
32
19
|
//#region src/acp/client.d.ts
|
|
33
20
|
type LoadSessionOptions = {
|
|
@@ -123,7 +110,7 @@ declare class AcpClient {
|
|
|
123
110
|
hasActivePrompt(sessionId?: string): boolean;
|
|
124
111
|
hasUnresolvedPrompt(): boolean;
|
|
125
112
|
private abortSessionRequests;
|
|
126
|
-
start(authority?: AcpControlAuthority): Promise<void>;
|
|
113
|
+
start(authority?: AcpControlAuthority, options?: Pick<AcpClientOptions, "sessionOptions">): Promise<void>;
|
|
127
114
|
private waitForPreviousClose;
|
|
128
115
|
private resolveAgentLaunchPlan;
|
|
129
116
|
private logAgentLaunch;
|
|
@@ -140,6 +127,7 @@ declare class AcpClient {
|
|
|
140
127
|
private initializeProtocolConnection;
|
|
141
128
|
private handleInitializeFailure;
|
|
142
129
|
private createTappedStream;
|
|
130
|
+
private sessionMeta;
|
|
143
131
|
createSession(cwd?: string, authority?: AcpControlAuthority): Promise<SessionCreateResult>;
|
|
144
132
|
loadSession(sessionId: string, cwd?: string): Promise<SessionLoadResult>;
|
|
145
133
|
loadSessionWithOptions(sessionId: string, cwd?: string, options?: LoadSessionOptions): Promise<SessionLoadResult>;
|
|
@@ -233,5 +221,5 @@ declare class AcpClient {
|
|
|
233
221
|
}): Promise<void>;
|
|
234
222
|
}
|
|
235
223
|
//#endregion
|
|
236
|
-
export {
|
|
237
|
-
//# sourceMappingURL=client-
|
|
224
|
+
export { AcpControlAuthority as n, AcpClient as t };
|
|
225
|
+
//# sourceMappingURL=client-DqCXdF0Q.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-DqCXdF0Q.d.ts","names":[],"sources":["../src/async-control.ts","../src/acp/model-config-state.ts","../src/acp/client.ts"],"mappings":";;;KAcY;EACV,SAAS;EACT;;;;KChBU;EACV;EACA;EACA,iBAAiB;IACf;IACA;;;;;KCiNC;EACH,YAAY;EACZ;EACA;EACA;;KAGU;EACV;EACA;EACA,gBAAgB;EAChB,SAAS;EACT;EACA;;KAGU;EACV;EACA,gBAAgB;EAChB,SAAS;EACT;EACA;;KAGU,sBAAsB;KA4C7B;KAsFO;EACV;EACA,QAAQ,OAAO;EACf;EACA,QAAQ;EACR;;KAGU;EACV;EACA;EACA;EACA,WAAW;;cAoBA;UACH;UACA;UACA;mBACS;mBACA;mBACA;UACT;UACA;UACA;mBAQS;mBAMA;mBACA;UACT;UACA;UACA;UACA;UACA;UACA;mBACS;mBACA;mBACA;UACT;UACA;UAEA;UACA;UACA;UACA;mBACS;mBACA;EAEL,YAAA,SAAS;MAmCjB,oBAAoB;EAIxB;EAIA,sBAAsB;EAItB,6BAA6B;EAW7B;EAIA;EAIA;EAIA;EAIA,iBACE,UAAU,KACR;EAWJ;EAIA,qBAAqB;IACnB,iBAAiB;IACjB,4BAA4B;IAC5B,mBAAmB;IACnB;IACA;IACA;IACA;;UAuBM;UASA;UAcA;EAUR,mBAAmB;EAInB,gBAAgB;E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;MACE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as createOutputFormatter } from "./output-
|
|
2
|
-
import {
|
|
3
|
-
import { N as runTimedExecFile } from "./agent-registry-
|
|
4
|
-
import { G as
|
|
1
|
+
import { a as MAX_TIMER_DELAY_MS, t as createOutputFormatter } from "./output-lylSoEBd.js";
|
|
2
|
+
import { At as PERMISSION_MODES, C as textPrompt, Mt as SESSION_RECORD_SCHEMA, R as resolveSessionRecord, S as promptToDisplayText, gt as writePrivateJsonFile, ht as writePrivateFile, ut as defaultSessionEventLog } from "./ipc-D7zT86b9.js";
|
|
3
|
+
import { N as runTimedExecFile } from "./agent-registry-kHdpsK9F.js";
|
|
4
|
+
import { G as recordSessionUpdate, H as createSessionConversation, U as recordClientOperation, W as recordPromptSubmission, dt as TimeoutError, i as runOnce, m as createSessionWithClient, mt as withTimeout, o as sendSessionDirect, pt as withInterrupt, q as cloneSessionAcpxState, ut as InterruptedError } from "./queue-owner-runtime-C0wIYowh.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -11,6 +11,13 @@ import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
|
11
11
|
import { ZodError, z } from "zod";
|
|
12
12
|
import { createHash, randomUUID } from "node:crypto";
|
|
13
13
|
import { performance } from "node:perf_hooks";
|
|
14
|
+
//#region src/flows/timeout.ts
|
|
15
|
+
function resolveFlowTimeoutMs(timeoutMs) {
|
|
16
|
+
if (timeoutMs === void 0) return;
|
|
17
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs > 2147483647) throw new TypeError(`timeoutMs must be a finite number no greater than ${MAX_TIMER_DELAY_MS}`);
|
|
18
|
+
return timeoutMs > 0 ? timeoutMs : void 0;
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
14
21
|
//#region src/flows/attempt.ts
|
|
15
22
|
/** One node attempt owns admission and completion of its managed operations. */
|
|
16
23
|
var FlowAttempt = class {
|
|
@@ -33,10 +40,11 @@ var FlowAttempt = class {
|
|
|
33
40
|
this.attemptId = options.attemptId;
|
|
34
41
|
this.startedAt = options.startedAt;
|
|
35
42
|
this.signal = this.controller.signal;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
43
|
+
const timeoutMs = resolveFlowTimeoutMs(options.timeoutMs);
|
|
44
|
+
if (timeoutMs !== void 0) {
|
|
45
|
+
this.timeoutMs = timeoutMs;
|
|
46
|
+
this.deadlineAt = performance.now() + timeoutMs;
|
|
47
|
+
this.timer = setTimeout(() => this.cancel(new TimeoutError(timeoutMs)), timeoutMs);
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
50
|
get active() {
|
|
@@ -167,7 +175,7 @@ function functionSchema(label) {
|
|
|
167
175
|
return z.custom((value) => typeof value === "function", { message: `${label} must be a function` });
|
|
168
176
|
}
|
|
169
177
|
const flowNodeCommonShape = {
|
|
170
|
-
timeoutMs: finiteNonNegativeNumberSchema.optional(),
|
|
178
|
+
timeoutMs: finiteNonNegativeNumberSchema.max(MAX_TIMER_DELAY_MS).optional(),
|
|
171
179
|
heartbeatMs: finiteNonNegativeNumberSchema.optional(),
|
|
172
180
|
statusDetail: z.string().optional()
|
|
173
181
|
};
|
|
@@ -538,8 +546,7 @@ function createShellFailureError(spec, args, exitCode, signal, stderr) {
|
|
|
538
546
|
* Positive values arm SIGTERM/SIGKILL after that many ms.
|
|
539
547
|
*/
|
|
540
548
|
function resolveShellActionTimeoutMs(timeoutMs) {
|
|
541
|
-
|
|
542
|
-
return timeoutMs;
|
|
549
|
+
return resolveFlowTimeoutMs(timeoutMs);
|
|
543
550
|
}
|
|
544
551
|
function rejectIfShellFailed(spec, args, result, timedOut, timeoutMs) {
|
|
545
552
|
if (timedOut) return new TimeoutError(timeoutMs ?? spec.timeoutMs ?? 0);
|
|
@@ -551,7 +558,9 @@ function waitForShellResult(child, spec, args, cwd, startMs, termination, mode)
|
|
|
551
558
|
if (!stdoutStream || !stderrStream) throw new Error("Shell action child is missing stdio pipes");
|
|
552
559
|
return new Promise((resolve, reject) => {
|
|
553
560
|
let settled = false;
|
|
561
|
+
let drainDeadline;
|
|
554
562
|
const fail = (error) => {
|
|
563
|
+
clearTimeout(drainDeadline);
|
|
555
564
|
settled = true;
|
|
556
565
|
reject(error);
|
|
557
566
|
};
|
|
@@ -569,8 +578,14 @@ function waitForShellResult(child, spec, args, cwd, startMs, termination, mode)
|
|
|
569
578
|
capture.append("stderr", chunk);
|
|
570
579
|
});
|
|
571
580
|
child.once("error", fail);
|
|
572
|
-
|
|
581
|
+
const finish = (exitCode, signal) => {
|
|
582
|
+
clearTimeout(drainDeadline);
|
|
583
|
+
if (settled) return;
|
|
573
584
|
settled = true;
|
|
585
|
+
if (mode === "node" && !termination.cancelled()) {
|
|
586
|
+
stdoutStream.unref();
|
|
587
|
+
stderrStream.unref();
|
|
588
|
+
}
|
|
574
589
|
const { stdout, stderr } = capture.output;
|
|
575
590
|
resolve({
|
|
576
591
|
command: spec.command,
|
|
@@ -584,6 +599,11 @@ function waitForShellResult(child, spec, args, cwd, startMs, termination, mode)
|
|
|
584
599
|
durationMs: Date.now() - startMs,
|
|
585
600
|
timedOut: mode === "node" ? termination.cancelled() : termination.timedOut()
|
|
586
601
|
});
|
|
602
|
+
};
|
|
603
|
+
child.once("close", finish);
|
|
604
|
+
if (mode === "node") child.once("exit", (exitCode, signal) => {
|
|
605
|
+
if (settled) return;
|
|
606
|
+
drainDeadline = setTimeout(() => finish(exitCode, signal), 100);
|
|
587
607
|
});
|
|
588
608
|
});
|
|
589
609
|
}
|
|
@@ -672,6 +692,7 @@ async function runShellProcess(spec, options, mode) {
|
|
|
672
692
|
const startMs = Date.now();
|
|
673
693
|
const timeoutMs = resolveShellActionTimeoutMs(spec.timeoutMs);
|
|
674
694
|
validateShellActionMaxBufferBytes(spec.maxBufferBytes);
|
|
695
|
+
if (spec.stdin !== void 0 && typeof spec.stdin !== "string") throw new TypeError("stdin must be a string");
|
|
675
696
|
const child = spawn(spec.command, args, {
|
|
676
697
|
cwd,
|
|
677
698
|
env: {
|
|
@@ -689,11 +710,14 @@ async function runShellProcess(spec, options, mode) {
|
|
|
689
710
|
});
|
|
690
711
|
const termination = createShellTermination(child, timeoutMs, options);
|
|
691
712
|
const finish = waitForShellResult(child, spec, args, cwd, startMs, termination, mode);
|
|
692
|
-
writeShellStdin(child, spec.stdin);
|
|
693
713
|
try {
|
|
714
|
+
writeShellStdin(child, spec.stdin);
|
|
694
715
|
const result = await Promise.race([finish, termination.cleanupFailure]);
|
|
695
716
|
throwIfShellCancelled(options.signal, mode);
|
|
696
717
|
return result;
|
|
718
|
+
} catch (error) {
|
|
719
|
+
await termination.cancel("SIGTERM");
|
|
720
|
+
throw error;
|
|
697
721
|
} finally {
|
|
698
722
|
await termination.dispose();
|
|
699
723
|
}
|
|
@@ -2447,4 +2471,4 @@ function formatDecisionPrompt(question, choices, field) {
|
|
|
2447
2471
|
//#endregion
|
|
2448
2472
|
export { parseStrictJsonObject as a, validateFlowDefinition as c, checkpoint as d, compute as f, isDefinedFlow as h, parseJsonObject as i, acp as l, shell as m, decisionEdge as n, FlowRunner as o, defineFlow as p, extractJsonObject as r, flowRunsBaseDir as s, decision as t, action as u };
|
|
2449
2473
|
|
|
2450
|
-
//# sourceMappingURL=flows
|
|
2474
|
+
//# sourceMappingURL=flows--1zpaEh9.js.map
|