acpx 0.13.0 → 0.13.2
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 +64 -382
- package/dist/{cli-D52eGvxU.js → cli-DJT3MRRI.js} +6 -5
- package/dist/{cli-D52eGvxU.js.map → cli-DJT3MRRI.js.map} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +20 -13
- package/dist/cli.js.map +1 -1
- package/dist/{client-BeKvumq9.d.ts → client-CxNllqui.d.ts} +15 -3
- package/dist/client-CxNllqui.d.ts.map +1 -0
- package/dist/{flags---9OR06b.js → flags-CM2rAdBo.js} +3 -3
- package/dist/{flags---9OR06b.js.map → flags-CM2rAdBo.js.map} +1 -1
- package/dist/{flows-CYfjwbn2.js → flows-BiRKgCnW.js} +4 -4
- package/dist/{flows-CYfjwbn2.js.map → flows-BiRKgCnW.js.map} +1 -1
- package/dist/flows.d.ts +2 -2
- package/dist/flows.js +1 -1
- package/dist/{live-checkpoint-CBecfnSH.js → live-checkpoint-Gw2oGjhe.js} +445 -252
- package/dist/live-checkpoint-Gw2oGjhe.js.map +1 -0
- package/dist/{output-CzN8vLdE.js → output-DiPPprGk.js} +40 -84
- package/dist/output-DiPPprGk.js.map +1 -0
- package/dist/runtime.d.ts +107 -23
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +600 -202
- package/dist/runtime.js.map +1 -1
- package/dist/{session-options-CTdZvr68.d.ts → session-options-DwRDODlr.d.ts} +25 -3
- package/dist/session-options-DwRDODlr.d.ts.map +1 -0
- package/package.json +15 -15
- package/skills/acpx/SKILL.md +5 -1
- package/dist/client-BeKvumq9.d.ts.map +0 -1
- package/dist/live-checkpoint-CBecfnSH.js.map +0 -1
- package/dist/output-CzN8vLdE.js.map +0 -1
- package/dist/session-options-CTdZvr68.d.ts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as runSessionQueueOwner, c as buildQueueOwnerArgOverride, g as __exportAll, h as isProcessAlive, l as flushPerfMetricsCapture, n as getTextErrorRemediationHints, o as runOnce, p as probeQueueOwnerHealth, t as createOutputFormatter, u as installPerfMetricsCapture } from "./output-
|
|
3
|
-
import {
|
|
4
|
-
import { S as loadPermissionPolicySpec, _ as resolveGlobalFlags, b as resolveSessionNameFromFlags, c as parseHistoryLimit, d as parseOutputFormat$1, f as parsePruneBeforeDate, g as resolveAgentInvocation, h as parseTtlSeconds, i as addSessionOption, l as parseMaxTurns, m as parseTimeoutSeconds, n as addPromptInputOption, o as parseAllowedTools, p as parseSessionName, r as addSessionNameOption, s as parseDaysOlderThan, t as addGlobalFlags, u as parseNonEmptyValue, v as resolveOutputPolicy, x as toTimerMilliseconds, y as resolvePermissionMode } from "./flags
|
|
2
|
+
import { a as runSessionQueueOwner, c as buildQueueOwnerArgOverride, g as __exportAll, h as isProcessAlive, l as flushPerfMetricsCapture, n as getTextErrorRemediationHints, o as runOnce, p as probeQueueOwnerHealth, t as createOutputFormatter, u as installPerfMetricsCapture } from "./output-DiPPprGk.js";
|
|
3
|
+
import { $t as AgentSpawnError, At as DEFAULT_AGENT_NAME, Ct as parsePromptSource, Dt as TimeoutError, Et as InterruptedError, G as listSessions, H as findSession, It as exitCodeForOutputErrorCode, Jt as OUTPUT_FORMATS, L as getAcpxVersion, Mt as normalizeAgentName$1, P as renderArgvIdentity, Qt as AcpxOperationalError, St as mergePromptSourceWithText, Tt as textPrompt, U as findSessionByDirectoryWalk, V as findGitRepositoryRoot, Wt as EXIT_CODES, X as writeSessionRecord, _t as isAcpJsonRpcMessage, bt as PromptInputValidationError, ct as serializeSessionRecordForDisk, dt as defaultSessionEventLog, ht as sessionEventSegmentPath, jt as listBuiltInAgents, lt as normalizeRuntimeSessionId, mt as sessionEventLockPath, pt as sessionEventActivePath, q as normalizeName, st as parseSessionRecord, zt as normalizeOutputError } from "./live-checkpoint-Gw2oGjhe.js";
|
|
4
|
+
import { S as loadPermissionPolicySpec, _ as resolveGlobalFlags, b as resolveSessionNameFromFlags, c as parseHistoryLimit, d as parseOutputFormat$1, f as parsePruneBeforeDate, g as resolveAgentInvocation, h as parseTtlSeconds, i as addSessionOption, l as parseMaxTurns, m as parseTimeoutSeconds, n as addPromptInputOption, o as parseAllowedTools, p as parseSessionName, r as addSessionNameOption, s as parseDaysOlderThan, t as addGlobalFlags, u as parseNonEmptyValue, v as resolveOutputPolicy, x as toTimerMilliseconds, y as resolvePermissionMode } from "./flags-CM2rAdBo.js";
|
|
5
5
|
import { realpathSync } from "node:fs";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
7
|
import path from "node:path";
|
|
@@ -108,7 +108,8 @@ function parseEventLockPayload(raw) {
|
|
|
108
108
|
}
|
|
109
109
|
async function hasLiveEventLock(recordId) {
|
|
110
110
|
try {
|
|
111
|
-
|
|
111
|
+
const payload = await fs$1.readFile(sessionEventLockPath(recordId), "utf8");
|
|
112
|
+
return isProcessAlive(parseEventLockPayload(payload).pid);
|
|
112
113
|
} catch (error) {
|
|
113
114
|
if (error.code === "ENOENT") return false;
|
|
114
115
|
throw error;
|
|
@@ -387,11 +388,11 @@ let sessionModulePromise;
|
|
|
387
388
|
let outputModulePromise;
|
|
388
389
|
let outputRenderModulePromise;
|
|
389
390
|
function loadSessionModule() {
|
|
390
|
-
sessionModulePromise ??= import("./output-
|
|
391
|
+
sessionModulePromise ??= import("./output-DiPPprGk.js").then((n) => n.i);
|
|
391
392
|
return sessionModulePromise;
|
|
392
393
|
}
|
|
393
394
|
function loadOutputModule() {
|
|
394
|
-
outputModulePromise ??= import("./output-
|
|
395
|
+
outputModulePromise ??= import("./output-DiPPprGk.js").then((n) => n.r);
|
|
395
396
|
return outputModulePromise;
|
|
396
397
|
}
|
|
397
398
|
function loadOutputRenderModule() {
|
|
@@ -418,7 +419,8 @@ async function readPrompt(promptParts, filePath, cwd) {
|
|
|
418
419
|
}
|
|
419
420
|
}
|
|
420
421
|
async function readPromptFromFile(filePath, cwd, promptParts) {
|
|
421
|
-
const
|
|
422
|
+
const source = filePath === "-" ? await readPromptInputFromStdin() : await fs$1.readFile(path.resolve(cwd, filePath), "utf8");
|
|
423
|
+
const prompt = mergePromptSourceWithText(source, promptParts.join(" "));
|
|
422
424
|
if (prompt.length === 0) throw new InvalidArgumentError("Prompt from --file is empty");
|
|
423
425
|
return prompt;
|
|
424
426
|
}
|
|
@@ -457,7 +459,8 @@ async function resolvePermissionPolicyFromFlags$1(globalFlags) {
|
|
|
457
459
|
try {
|
|
458
460
|
return await loadPermissionPolicySpec(globalFlags.permissionPolicy, globalFlags.cwd);
|
|
459
461
|
} catch (error) {
|
|
460
|
-
|
|
462
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
463
|
+
throw new InvalidArgumentError(`Invalid permission policy: ${message}`);
|
|
461
464
|
}
|
|
462
465
|
}
|
|
463
466
|
function buildSessionStartOptions(params) {
|
|
@@ -1044,7 +1047,8 @@ async function readStdin() {
|
|
|
1044
1047
|
return data;
|
|
1045
1048
|
}
|
|
1046
1049
|
async function readPromptFile(filePath, promptText, cwd) {
|
|
1047
|
-
const
|
|
1050
|
+
const source = filePath === "-" ? await readStdin() : await fs$1.readFile(path.resolve(cwd, filePath), "utf8");
|
|
1051
|
+
const prompt = mergePromptSourceWithText(source, promptText);
|
|
1048
1052
|
if (prompt.length === 0) throw new InvalidArgumentError("Prompt from --file is empty");
|
|
1049
1053
|
return prompt;
|
|
1050
1054
|
}
|
|
@@ -1133,7 +1137,8 @@ async function resolvePermissionPolicyFromFlags(globalFlags) {
|
|
|
1133
1137
|
try {
|
|
1134
1138
|
return await loadPermissionPolicySpec(globalFlags.permissionPolicy, globalFlags.cwd);
|
|
1135
1139
|
} catch (error) {
|
|
1136
|
-
|
|
1140
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1141
|
+
throw new InvalidArgumentError(`Invalid permission policy: ${message}`);
|
|
1137
1142
|
}
|
|
1138
1143
|
}
|
|
1139
1144
|
function buildSuccessRow(agentName, result, capture, startedAt) {
|
|
@@ -2232,7 +2237,7 @@ function registerAgentCommand(program, agentName, config) {
|
|
|
2232
2237
|
}
|
|
2233
2238
|
function registerFlowCommand(program, config) {
|
|
2234
2239
|
program.command("flow").description("Run multi-step ACP workflows from flow files").command("run").description("Run a flow file").argument("<file>", "Flow module path").option("--input-json <json>", "Flow input as JSON").option("--input-file <path>", "Read flow input JSON from file").option("--default-agent <name>", "Default agent profile for ACP nodes without profile", (value) => parseNonEmptyValue("Default agent", value)).action(async function(file, flags) {
|
|
2235
|
-
const { handleFlowRun } = await import("./cli-
|
|
2240
|
+
const { handleFlowRun } = await import("./cli-DJT3MRRI.js");
|
|
2236
2241
|
await handleFlowRun(file, flags, this, config);
|
|
2237
2242
|
});
|
|
2238
2243
|
}
|
|
@@ -2336,7 +2341,8 @@ function assignSessionEnv(options, value) {
|
|
|
2336
2341
|
if (entries.length > 0) options.env = Object.fromEntries(entries);
|
|
2337
2342
|
}
|
|
2338
2343
|
async function runQueueOwnerFromEnv(env) {
|
|
2339
|
-
|
|
2344
|
+
const options = parseQueueOwnerPayload(await readQueueOwnerPayloadFromEnv(env));
|
|
2345
|
+
await runSessionQueueOwner(options);
|
|
2340
2346
|
}
|
|
2341
2347
|
async function readQueueOwnerPayloadFromEnv(env) {
|
|
2342
2348
|
const payloadFile = env[QUEUE_OWNER_PAYLOAD_FILE_ENV];
|
|
@@ -2666,8 +2672,9 @@ async function main(argv = process.argv) {
|
|
|
2666
2672
|
const initialCwd = detectInitialCwd(rawArgs);
|
|
2667
2673
|
const config = await loadResolvedConfig(initialCwd, { mcpConfigPath: detectMcpConfigPath(rawArgs, initialCwd) });
|
|
2668
2674
|
const requestedJsonStrict = detectJsonStrict(rawArgs);
|
|
2675
|
+
const requestedOutputFormat = detectRequestedOutputFormat(rawArgs, config.format);
|
|
2669
2676
|
const requestedOutputPolicy = {
|
|
2670
|
-
...resolveOutputPolicy(
|
|
2677
|
+
...resolveOutputPolicy(requestedOutputFormat, requestedJsonStrict),
|
|
2671
2678
|
suppressReads: rawArgs.some((token) => token === "--suppress-reads")
|
|
2672
2679
|
};
|
|
2673
2680
|
const program = createProgram(requestedJsonStrict);
|