acpx 0.20.0 → 0.21.1
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-Gtwn7nMp.js → agent-registry-Cz9fD9H1.js} +5 -8
- package/dist/{agent-registry-Gtwn7nMp.js.map → agent-registry-Cz9fD9H1.js.map} +1 -1
- package/dist/agent-registry.d.ts +0 -2
- package/dist/agent-registry.d.ts.map +1 -1
- package/dist/agent-registry.js +1 -1
- package/dist/{cli-CnufHoAJ.js → cli-BLEPj7lL.js} +6 -8
- package/dist/{cli-CnufHoAJ.js.map → cli-BLEPj7lL.js.map} +1 -1
- package/dist/cli.d.ts +1 -5
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +27 -45
- package/dist/cli.js.map +1 -1
- package/dist/{client-R5OmZ--S.d.ts → client-D12zqSyN.d.ts} +3 -8
- package/dist/client-D12zqSyN.d.ts.map +1 -0
- package/dist/{flows-CTRAV28u.js → flows-BVpRv0Df.js} +19 -33
- package/dist/{flows-CTRAV28u.js.map → flows-BVpRv0Df.js.map} +1 -1
- package/dist/flows.d.ts +2 -14
- package/dist/flows.d.ts.map +1 -1
- package/dist/flows.js +1 -1
- package/dist/{invocation-options-DE3Z_fqa.js → invocation-options-VJlayf-0.js} +16 -12
- package/dist/{invocation-options-DE3Z_fqa.js.map → invocation-options-VJlayf-0.js.map} +1 -1
- package/dist/{ipc-D2BC99hf.js → ipc-BbYFsKOj.js} +38 -69
- package/dist/ipc-BbYFsKOj.js.map +1 -0
- package/dist/{output-B1Srnvko.js → output-mqRHzGzM.js} +10 -17
- package/dist/{output-B1Srnvko.js.map → output-mqRHzGzM.js.map} +1 -1
- package/dist/{queue-owner-runtime-Be8sr9L5.js → queue-owner-runtime-B0mPqOu4.js} +168 -117
- package/dist/queue-owner-runtime-B0mPqOu4.js.map +1 -0
- package/dist/runtime.d.ts +18 -26
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +29 -32
- package/dist/runtime.js.map +1 -1
- package/dist/{session-options-DQlqgFv2.d.ts → session-options-BlnP3WAc.d.ts} +8 -7
- package/dist/session-options-BlnP3WAc.d.ts.map +1 -0
- package/dist/{session-watch-CpYYtV62.js → session-watch-BnIxHQrU.js} +5 -6
- package/dist/{session-watch-CpYYtV62.js.map → session-watch-BnIxHQrU.js.map} +1 -1
- package/dist/{watch-Db2D1eYN.js → watch-bQXyUy3z.js} +3 -4
- package/dist/{watch-Db2D1eYN.js.map → watch-bQXyUy3z.js.map} +1 -1
- package/package.json +20 -20
- package/skills/acpx/SKILL.md +27 -1
- package/dist/client-R5OmZ--S.d.ts.map +0 -1
- package/dist/ipc-D2BC99hf.js.map +0 -1
- package/dist/queue-owner-runtime-Be8sr9L5.js.map +0 -1
- package/dist/session-options-DQlqgFv2.d.ts.map +0 -1
package/dist/runtime.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { AcpAgentInspection, AcpAgentInspectionOptions, AcpAgentRegistry, AcpInspectableAgentRegistry, DEFAULT_AGENT_NAME, createAgentRegistry } from "./agent-registry.js";
|
|
2
|
-
import { C as PermissionPolicy, E as PromptInput, S as PermissionMode, T as SessionRecord, _ as AcpProcessSpawnFailure, a as AcpElicitationHandler, b as McpServer$1, c as AcpElicitationResponse, d as AcpPermissionHandler, f as AcpPermissionRequest, g as AcpProcessLifecycle, h as AcpProcessLaunchScope, i as AcpElicitationContext, l as AcpJsonRpcMessage, m as AcpProcessLaunch, n as SystemPromptOption, o as AcpElicitationMode, p as AcpProcessExit, s as AcpElicitationRequest, t as SessionAgentOptions, u as AcpPermissionDecision, v as AcpProcessStarted, x as NonInteractivePermissionPolicy, y as AuthPolicy } from "./session-options-
|
|
3
|
-
import { n as AcpControlAuthority, t as AcpClient } from "./client-
|
|
2
|
+
import { C as PermissionPolicy, E as PromptInput, S as PermissionMode, T as SessionRecord, _ as AcpProcessSpawnFailure, a as AcpElicitationHandler, b as McpServer$1, c as AcpElicitationResponse, d as AcpPermissionHandler, f as AcpPermissionRequest, g as AcpProcessLifecycle, h as AcpProcessLaunchScope, i as AcpElicitationContext, l as AcpJsonRpcMessage, m as AcpProcessLaunch, n as SystemPromptOption, o as AcpElicitationMode, p as AcpProcessExit, s as AcpElicitationRequest, t as SessionAgentOptions, u as AcpPermissionDecision, v as AcpProcessStarted, x as NonInteractivePermissionPolicy, y as AuthPolicy } from "./session-options-BlnP3WAc.js";
|
|
3
|
+
import { n as AcpControlAuthority, t as AcpClient } from "./client-D12zqSyN.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { SetSessionConfigOptionResponse, ToolCallContent, ToolCallLocation, ToolKind } from "@agentclientprotocol/sdk";
|
|
6
|
-
//#region src/acp/model-support.d.ts
|
|
7
6
|
export declare const REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE: "ACP_MODEL_UNSUPPORTED";
|
|
8
7
|
type RequestedModelUnsupportedErrorCode = typeof REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE;
|
|
9
8
|
export declare const REQUESTED_MODEL_UNSUPPORTED_REASONS: readonly ["missing-capability", "unadvertised-model"];
|
|
@@ -17,8 +16,6 @@ export declare class RequestedModelUnsupportedError extends Error {
|
|
|
17
16
|
});
|
|
18
17
|
}
|
|
19
18
|
export declare function isRequestedModelUnsupportedError(value: unknown): value is RequestedModelUnsupportedError;
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/session/journal.d.ts
|
|
22
19
|
type SessionWatchResult = {
|
|
23
20
|
status: "completed" | "cancelled";
|
|
24
21
|
stopReason?: string;
|
|
@@ -46,8 +43,6 @@ type SessionWatchEvent = {
|
|
|
46
43
|
requestId: string;
|
|
47
44
|
result: SessionWatchResult;
|
|
48
45
|
});
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/runtime/public/contract.d.ts
|
|
51
46
|
/**
|
|
52
47
|
* ACP has no mid-turn steering request. In-process runtimes admit a "steer"
|
|
53
48
|
* turn like "prompt": it waits behind any active turn on the same session and
|
|
@@ -407,6 +402,18 @@ type AcpRuntimeOptions = {
|
|
|
407
402
|
cwd: string;
|
|
408
403
|
/** Trusted child-only environment, snapshotted at construction and never persisted. */
|
|
409
404
|
agentProcessEnv?: Record<string, string>;
|
|
405
|
+
/**
|
|
406
|
+
* Opt-in allowlist for agent children, command probes and ACP terminals: when set, they
|
|
407
|
+
* inherit only process essentials, these parent names and `ACPX_AUTH_*` grants.
|
|
408
|
+
* Snapshotted at construction. Explicit grants and overlays still apply.
|
|
409
|
+
*/
|
|
410
|
+
agentProcessEnvAllow?: readonly string[];
|
|
411
|
+
/**
|
|
412
|
+
* Parent environment names withheld from agent children, command probes and ACP
|
|
413
|
+
* terminals, applied after `agentProcessEnvAllow` and snapshotted at construction.
|
|
414
|
+
* Explicit grants and overlays still apply.
|
|
415
|
+
*/
|
|
416
|
+
agentProcessEnvBlock?: readonly string[];
|
|
410
417
|
sessionStore: AcpSessionStore;
|
|
411
418
|
agentRegistry: AcpAgentRegistry;
|
|
412
419
|
/**
|
|
@@ -454,8 +461,6 @@ type AcpRuntimeOptions = {
|
|
|
454
461
|
type AcpFileSessionStoreOptions = {
|
|
455
462
|
stateDir: string;
|
|
456
463
|
};
|
|
457
|
-
//#endregion
|
|
458
|
-
//#region src/runtime/public/probe.d.ts
|
|
459
464
|
type RuntimeHealthReport = {
|
|
460
465
|
ok: boolean;
|
|
461
466
|
message: string;
|
|
@@ -469,14 +474,16 @@ type InspectAgentModelsOptions = {
|
|
|
469
474
|
timeoutMs?: number;
|
|
470
475
|
/** Trusted child-only environment overlay; never persisted. */
|
|
471
476
|
agentProcessEnv?: Record<string, string>;
|
|
477
|
+
/** Opt-in allowlist of parent environment names the inspected agent inherits. */
|
|
478
|
+
agentProcessEnvAllow?: readonly string[];
|
|
479
|
+
/** Parent environment names the inspected agent does not inherit. */
|
|
480
|
+
agentProcessEnvBlock?: readonly string[];
|
|
472
481
|
};
|
|
473
482
|
/**
|
|
474
483
|
* Inspect session model metadata without a runtime store or prompt. The agent
|
|
475
484
|
* may create native session history; only its owned transport is closed.
|
|
476
485
|
*/
|
|
477
486
|
export declare function inspectAgentModels(options: InspectAgentModelsOptions): Promise<AcpRuntimeSessionModels | undefined>;
|
|
478
|
-
//#endregion
|
|
479
|
-
//#region src/runtime/engine/turn.d.ts
|
|
480
487
|
type Deferred<T> = {
|
|
481
488
|
promise: Promise<T>;
|
|
482
489
|
resolve: (value: T) => void;
|
|
@@ -492,8 +499,6 @@ declare class AsyncEventQueue {
|
|
|
492
499
|
next(): Promise<AcpRuntimeEvent | null>;
|
|
493
500
|
iterate(): AsyncIterable<AcpRuntimeEvent>;
|
|
494
501
|
}
|
|
495
|
-
//#endregion
|
|
496
|
-
//#region src/runtime/engine/manager.d.ts
|
|
497
502
|
type AcpRuntimeManagerDeps = {
|
|
498
503
|
clientFactory?: (options: ConstructorParameters<typeof AcpClient>[0]) => AcpClient;
|
|
499
504
|
};
|
|
@@ -655,11 +660,7 @@ declare class AcpRuntimeManager {
|
|
|
655
660
|
private handleBackendSessionCloseError;
|
|
656
661
|
private requireRecord;
|
|
657
662
|
}
|
|
658
|
-
//#endregion
|
|
659
|
-
//#region src/runtime/public/file-session-store.d.ts
|
|
660
663
|
export declare function createFileSessionStore(options: AcpFileSessionStoreOptions): AcpSessionStore;
|
|
661
|
-
//#endregion
|
|
662
|
-
//#region src/runtime/public/errors.d.ts
|
|
663
664
|
declare const ACP_ERROR_CODES: readonly ["ACP_BACKEND_MISSING", "ACP_BACKEND_UNAVAILABLE", "ACP_BACKEND_UNSUPPORTED_CONTROL", "ACP_DISPATCH_DISABLED", "ACP_INVALID_RUNTIME_OPTION", "ACP_SESSION_INIT_FAILED", "ACP_TURN_FAILED"];
|
|
664
665
|
type AcpRuntimeErrorCode = (typeof ACP_ERROR_CODES)[number];
|
|
665
666
|
export declare class AcpRuntimeError extends Error {
|
|
@@ -670,8 +671,6 @@ export declare class AcpRuntimeError extends Error {
|
|
|
670
671
|
});
|
|
671
672
|
}
|
|
672
673
|
export declare function isAcpRuntimeError(value: unknown): value is AcpRuntimeError;
|
|
673
|
-
//#endregion
|
|
674
|
-
//#region src/runtime/public/shared.d.ts
|
|
675
674
|
type AcpxHandleState = {
|
|
676
675
|
name: string;
|
|
677
676
|
agent: string;
|
|
@@ -681,12 +680,8 @@ type AcpxHandleState = {
|
|
|
681
680
|
backendSessionId?: string;
|
|
682
681
|
agentSessionId?: string;
|
|
683
682
|
};
|
|
684
|
-
//#endregion
|
|
685
|
-
//#region src/runtime/public/handle-state.d.ts
|
|
686
683
|
export declare function encodeAcpxRuntimeHandleState(state: AcpxHandleState): string;
|
|
687
684
|
export declare function decodeAcpxRuntimeHandleState(runtimeSessionName: string): AcpxHandleState | null;
|
|
688
|
-
//#endregion
|
|
689
|
-
//#region src/runtime/shared.d.ts
|
|
690
685
|
type SharedAcpRuntimeOptions = {
|
|
691
686
|
cwd: string;
|
|
692
687
|
agentRegistry?: AcpAgentRegistry;
|
|
@@ -765,8 +760,6 @@ export declare class SharedAcpRuntime {
|
|
|
765
760
|
shutdown(): Promise<void>;
|
|
766
761
|
}
|
|
767
762
|
export declare function createSharedAcpRuntime(options: SharedAcpRuntimeOptions): SharedAcpRuntime;
|
|
768
|
-
//#endregion
|
|
769
|
-
//#region src/runtime.d.ts
|
|
770
763
|
export declare const ACPX_BACKEND_ID = "acpx";
|
|
771
764
|
type AcpxRuntimeLike = AcpRuntime & {
|
|
772
765
|
probeAvailability(): Promise<void>;
|
|
@@ -856,6 +849,5 @@ export declare function createAcpRuntime(options: AcpRuntimeOptions): AcpxRuntim
|
|
|
856
849
|
export declare function createRuntimeStore(options: {
|
|
857
850
|
stateDir: string;
|
|
858
851
|
}): AcpSessionStore;
|
|
859
|
-
//#endregion
|
|
860
852
|
export { type AcpAgentInspection, type AcpAgentInspectionOptions, type AcpAgentRegistry, type AcpElicitationContext, type AcpElicitationHandler, type AcpElicitationMode, type AcpElicitationRequest, type AcpElicitationResponse, type AcpFileSessionStoreOptions, type AcpInspectableAgentRegistry, type AcpPermissionDecision, type AcpPermissionHandler, type AcpPermissionRequest, type AcpProcessExit, type AcpProcessLaunch, type AcpProcessLaunchScope, type AcpProcessLifecycle, type AcpProcessSpawnFailure, type AcpProcessStarted, type AcpRuntime, type AcpRuntimeAvailableCommand, type AcpRuntimeCapabilities, type AcpRuntimeDoctorReport, type AcpRuntimeEnsureInput, type AcpRuntimeErrorCode, type AcpRuntimeEvent, type AcpRuntimeHandle, type AcpRuntimeOptions, type AcpRuntimePlanEntry, type AcpRuntimePromptMode, type AcpRuntimeSessionContext, type AcpRuntimeSessionMode, type AcpRuntimeSessionModels, type AcpRuntimeSessionPermissions, type AcpRuntimeSessionUsage, type AcpRuntimeStatus, type AcpRuntimeTurn, type AcpRuntimeTurnAttachment, type AcpRuntimeTurnInput, type AcpRuntimeTurnResult, type AcpRuntimeTurnResultError, type AcpRuntimeUsageBreakdown, type AcpRuntimeUsageCost, type AcpSessionRecord, type AcpSessionStore, type AcpSessionUpdateTag, type AcpTextDeltaOriginMeta, DEFAULT_AGENT_NAME, type InspectAgentModelsOptions, type PermissionPolicy, type RequestedModelUnsupportedErrorCode, type RequestedModelUnsupportedReason, type SessionAgentOptions, type SessionWatchEvent, type SessionWatchResult, type SharedAcpRuntimeOptions, type SystemPromptOption, createAgentRegistry };
|
|
861
853
|
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","names":["McpServer","_$__public_contract_js0.AcpRuntimeEvent","_$__public_contract_js0.AcpRuntimeStatus","_$___runtime_js0.SessionWatchEvent","_$__runtime_js0.AcpRuntimeTurnResult"],"sources":["../src/acp/model-support.ts","../src/session/journal.ts","../src/runtime/public/contract.ts","../src/runtime/public/probe.ts","../src/runtime/engine/turn.ts","../src/runtime/engine/manager.ts","../src/runtime/public/file-session-store.ts","../src/runtime/public/errors.ts","../src/runtime/public/shared.ts","../src/runtime/public/handle-state.ts","../src/runtime/shared.ts","../src/runtime.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","names":["McpServer","_$__public_contract_js0.AcpRuntimeEvent","_$__public_contract_js0.AcpRuntimeStatus","_$___runtime_js0.SessionWatchEvent","_$__runtime_js0.AcpRuntimeTurnResult"],"sources":["../src/acp/model-support.ts","../src/session/journal.ts","../src/runtime/public/contract.ts","../src/runtime/public/probe.ts","../src/runtime/engine/turn.ts","../src/runtime/engine/manager.ts","../src/runtime/public/file-session-store.ts","../src/runtime/public/errors.ts","../src/runtime/public/shared.ts","../src/runtime/public/handle-state.ts","../src/runtime/shared.ts","../src/runtime.ts"],"mappings":";;;;;qBAea;KAED,4CAA4C;qBAE3C;KAKD,0CAA0C;qBAEzC,uCAAuC;WACzC;WACA,QAAQ;WACR;EAGP,YAAA,iBACA,QAAQ,iCACR;IAAY;;;wBAoBA,iCACd,iBACC,SAAS;KCtCA;EAEN;EACA;EACA,QAAQ;;EAGR;EACA;IAAS;IAAiB;IAAe;IAAqB;;;KAGxD;EAAsB;;EAC5B;EAAiB;EAA0B,SAAS;;EACpD;EAAsB;;EACtB;EAAqB;EAAmB,QAAQ;;;;;;;KCgB1C;KAEA;KAEA;KAaA;KAMA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA,MAAM;EACN;EACA;;;;;;;;;EASA,iBAAiB;;KAGP;;;;;EAKV;EACA;;;;;;KAOU,sBAAsB;EAChC,QAAQ;EACR;EACA,cAAc;EACd,MAAM;EACN;EACA;;;;;;EAMA,sBAAsB;;EAEtB,gBAAgB;;;KAIN;EACV,UAAU;EACV;;KAGU;EACV;EACA;;EAEA,kBAAkB;IAAQ;IAAiB;;;;;;;;KAQjC;EACV;EACA;;;;;;;KAQU;EACV;EACA;EACA;EACA;EACA;EACA;;;;;;;;KASU;EACV;EACA;;EAEA;;;;;;KAOU;EACV;EACA;EACA;;;;;;;KAQU;EACV,aAAa;;EAEb,OAAO;;EAEP,aAA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QAAQ;EAWN,cAAc,OAAO,wBAAwB,QAAQ;UAenD;EAyBR,UAAU,OAAO;;;;;;;IAkCM,OAAA;MAAE;QAAiB;IAGd,YAAA;MAAE;QAAiB;;EAMxC,QAAQ,OAAO,sBAAsB,cAAc;EAkBpD,gBAAgB;IAAU,SAAS;MAAqB,QAAQ;EAWhE,UAAU;IACd,QAAQ;IACR,SAAS;MACP,QAAQ;EAMN,QACJ,OAAO;IAAwB,QAAQ;IAAkB;MACxD;EAMG,SACJ,OAAO;IAAwB,QAAQ;IAAkB;MACxD;EAMG,gBACJ,OAAO;IACL,QAAQ;IACR;IACA;MAED,QAAQ;EAML,OAAO;IAAS,QAAQ;IAAkB;MAAoB;EAM9D,oBAAoB;IAAS,QAAQ;MAAqB;EAM1D,MAAM;IACV,QAAQ;IACR;IACA;MACE;EAQJ,YAAY;UAeE;UAkBA;UAmBN;UAcA;;wBA+BM,iBAAiB,SAAS,oBAAoB;wBAI9C,mBAAmB;EAAW;IAAqB"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { A as findSession, B as assertPersistedKeyPolicy, C as textPrompt, Dt as normalizeOutputError, L as readSessionRecord, Ot as extractAcpError, R as resolveSessionRecord, U as serializeSessionRecordForDisk, V as parseSessionRecord, bt as writePrivateJsonFile, kt as isAcpResourceNotFoundError, t as tryCancelOnRunningOwner } from "./ipc-
|
|
2
|
-
import { O as normalizeAgentCommandInput, a as createAgentRegistry, i as DEFAULT_AGENT_NAME } from "./agent-registry-
|
|
3
|
-
import { $ as isRequestedModelUnsupportedError, A as applyInitialModelSelection, B as reconcileAgentSessionId, C as setSessionModeOnOwner, D as connectAndLoadSession, E as withConnectedSession, F as persistSessionOptions, G as recordSessionUpdate, I as sessionOptionsFromRecord, J as advertisedModelState, K as trimConversationForRuntime, L as applyConversation, M as applyRequestedModelIfAdvertised, N as setDesiredModeId, O as applyConfigOptionSelection, P as normalizeSessionOptionShape, Q as RequestedModelUnsupportedError, R as applyLifecycleSnapshotToRecord, T as setSessionModelOnOwner, U as recordClientOperation, V as cloneSessionConversation, W as recordPromptSubmission, X as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Y as AcpClient, Z as REQUESTED_MODEL_UNSUPPORTED_REASONS, _ as cancelSessionPrompt, c as LiveSessionCheckpoint,
|
|
4
|
-
import { t as watchSession } from "./watch-
|
|
1
|
+
import { A as findSession, B as assertPersistedKeyPolicy, C as textPrompt, Dt as normalizeOutputError, L as readSessionRecord, Ot as extractAcpError, R as resolveSessionRecord, U as serializeSessionRecordForDisk, V as parseSessionRecord, bt as writePrivateJsonFile, kt as isAcpResourceNotFoundError, t as tryCancelOnRunningOwner } from "./ipc-BbYFsKOj.js";
|
|
2
|
+
import { O as normalizeAgentCommandInput, a as createAgentRegistry, i as DEFAULT_AGENT_NAME } from "./agent-registry-Cz9fD9H1.js";
|
|
3
|
+
import { $ as isRequestedModelUnsupportedError, A as applyInitialModelSelection, B as reconcileAgentSessionId, C as setSessionModeOnOwner, D as connectAndLoadSession, E as withConnectedSession, F as persistSessionOptions, G as recordSessionUpdate, I as sessionOptionsFromRecord, J as advertisedModelState, K as trimConversationForRuntime, L as applyConversation, M as applyRequestedModelIfAdvertised, N as setDesiredModeId, O as applyConfigOptionSelection, P as normalizeSessionOptionShape, Q as RequestedModelUnsupportedError, R as applyLifecycleSnapshotToRecord, T as setSessionModelOnOwner, U as recordClientOperation, V as cloneSessionConversation, W as recordPromptSubmission, X as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Y as AcpClient, Z as REQUESTED_MODEL_UNSUPPORTED_REASONS, _ as cancelSessionPrompt, c as LiveSessionCheckpoint, et as resolveRequestedConfigOption, ft as TimeoutError, h as ensureSession, ht as withTimeout, j as applyModelSelection, k as applyConfigOptionsToRecord, l as runPromptTurn, pt as assertControlAuthority, q as cloneSessionAcpxState, r as sendSession, rt as snapshotEnvNames, s as DISCARD_OUTPUT_FORMATTER, tt as resolveRequestedModelId, v as closeSession, x as setSessionConfigOptionOnOwner, z as createInitialSessionRecord } from "./queue-owner-runtime-B0mPqOu4.js";
|
|
4
|
+
import { t as watchSession } from "./watch-bQXyUy3z.js";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
8
8
|
import { randomUUID } from "node:crypto";
|
|
9
9
|
import { isDeepStrictEqual } from "node:util";
|
|
10
|
-
|
|
10
|
+
// src/runtime/public/errors.ts
|
|
11
11
|
var AcpRuntimeError = class extends Error {
|
|
12
12
|
code;
|
|
13
13
|
cause;
|
|
@@ -21,8 +21,7 @@ var AcpRuntimeError = class extends Error {
|
|
|
21
21
|
function isAcpRuntimeError(value) {
|
|
22
22
|
return value instanceof AcpRuntimeError;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
//#region src/runtime/engine/controls.ts
|
|
24
|
+
// src/runtime/engine/controls.ts
|
|
26
25
|
function advertisedConfigOptionIds(record) {
|
|
27
26
|
const configOptions = record?.acpx?.config_options;
|
|
28
27
|
if (!configOptions) return;
|
|
@@ -50,8 +49,7 @@ function resolveSupportedConfigOptionId(record, configId) {
|
|
|
50
49
|
const supportedText = supported.length > 0 ? supported.join(", ") : "none";
|
|
51
50
|
throw new AcpRuntimeError("ACP_BACKEND_UNSUPPORTED_CONTROL", `ACP session ${record.acpxRecordId} does not advertise config option '${configId}'. Supported config options: ${supportedText}.`);
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
//#region src/runtime/public/shared.ts
|
|
52
|
+
// src/runtime/public/shared.ts
|
|
55
53
|
function isRecord(value) {
|
|
56
54
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
57
55
|
}
|
|
@@ -68,8 +66,7 @@ function deriveAgentFromSessionKey(sessionKey, fallbackAgent) {
|
|
|
68
66
|
const match = sessionKey.match(/^agent:([^:]+):/i);
|
|
69
67
|
return (match?.[1] ? asTrimmedString(match[1]) : "") || fallbackAgent;
|
|
70
68
|
}
|
|
71
|
-
|
|
72
|
-
//#region src/runtime/public/events.ts
|
|
69
|
+
// src/runtime/public/events.ts
|
|
73
70
|
const TOOL_OUTPUT_SUMMARY_MAX_CHARS = 500;
|
|
74
71
|
function safeParseJsonObject(line) {
|
|
75
72
|
try {
|
|
@@ -575,8 +572,7 @@ function updateStatusEvent(payload, tag) {
|
|
|
575
572
|
...tag ? { tag } : {}
|
|
576
573
|
} : null;
|
|
577
574
|
}
|
|
578
|
-
|
|
579
|
-
//#region src/runtime/public/probe.ts
|
|
575
|
+
// src/runtime/public/probe.ts
|
|
580
576
|
/**
|
|
581
577
|
* Inspect session model metadata without a runtime store or prompt. The agent
|
|
582
578
|
* may create native session history; only its owned transport is closed.
|
|
@@ -592,6 +588,8 @@ async function inspectAgentModels(options) {
|
|
|
592
588
|
...normalizeAgentCommandInput(options.agentCommand),
|
|
593
589
|
cwd: options.cwd,
|
|
594
590
|
agentProcessEnv: options.agentProcessEnv,
|
|
591
|
+
agentProcessEnvAllow: options.agentProcessEnvAllow,
|
|
592
|
+
agentProcessEnvBlock: options.agentProcessEnvBlock,
|
|
595
593
|
permissionMode: "deny-all",
|
|
596
594
|
nonInteractivePermissions: "deny",
|
|
597
595
|
fs: false,
|
|
@@ -699,6 +697,8 @@ function createProbeClient(options, agentName, agentCommand, deps) {
|
|
|
699
697
|
...agentCommand,
|
|
700
698
|
cwd: options.cwd,
|
|
701
699
|
agentProcessEnv: options.agentProcessEnv,
|
|
700
|
+
agentProcessEnvAllow: options.agentProcessEnvAllow,
|
|
701
|
+
agentProcessEnvBlock: options.agentProcessEnvBlock,
|
|
702
702
|
mcpServers: typeof options.mcpServers === "function" ? [] : [...options.mcpServers ?? []],
|
|
703
703
|
permissionMode: options.permissionMode,
|
|
704
704
|
nonInteractivePermissions: options.nonInteractivePermissions,
|
|
@@ -714,8 +714,7 @@ function createProbeClient(options, agentName, agentCommand, deps) {
|
|
|
714
714
|
};
|
|
715
715
|
return deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
716
716
|
}
|
|
717
|
-
|
|
718
|
-
//#region src/runtime/engine/reuse-policy.ts
|
|
717
|
+
// src/runtime/engine/reuse-policy.ts
|
|
719
718
|
function shouldReuseExistingRecord(record, params) {
|
|
720
719
|
if (record.acpx?.reset_on_next_ensure === true) return false;
|
|
721
720
|
if (path.resolve(record.cwd) !== path.resolve(params.cwd)) return false;
|
|
@@ -729,8 +728,7 @@ function sameArgv(left, right) {
|
|
|
729
728
|
const rightValues = right ?? [];
|
|
730
729
|
return leftValues.length === rightValues.length && leftValues.every((value, index) => value === rightValues[index]);
|
|
731
730
|
}
|
|
732
|
-
|
|
733
|
-
//#region src/runtime/engine/status.ts
|
|
731
|
+
// src/runtime/engine/status.ts
|
|
734
732
|
function runtimeStatusFromRecord(record) {
|
|
735
733
|
return {
|
|
736
734
|
...record.lastRequestId ? { lastRequestId: record.lastRequestId } : {},
|
|
@@ -822,8 +820,7 @@ function commandRecord(value) {
|
|
|
822
820
|
if (!value || typeof value !== "object" || Array.isArray(value)) return;
|
|
823
821
|
return value;
|
|
824
822
|
}
|
|
825
|
-
|
|
826
|
-
//#region src/runtime/engine/turn.ts
|
|
823
|
+
// src/runtime/engine/turn.ts
|
|
827
824
|
function createDeferred() {
|
|
828
825
|
let resolve;
|
|
829
826
|
let reject;
|
|
@@ -919,8 +916,7 @@ function legacyTerminalEventFromTurnResult(result) {
|
|
|
919
916
|
...result._meta === void 0 ? {} : { _meta: result._meta }
|
|
920
917
|
};
|
|
921
918
|
}
|
|
922
|
-
|
|
923
|
-
//#region src/runtime/engine/manager.ts
|
|
919
|
+
// src/runtime/engine/manager.ts
|
|
924
920
|
async function settleAttempt(run) {
|
|
925
921
|
try {
|
|
926
922
|
return {
|
|
@@ -1013,6 +1009,8 @@ var AcpRuntimeManager = class {
|
|
|
1013
1009
|
const clientOptions = {
|
|
1014
1010
|
...options,
|
|
1015
1011
|
agentProcessEnv: this.options.agentProcessEnv,
|
|
1012
|
+
agentProcessEnvAllow: this.options.agentProcessEnvAllow,
|
|
1013
|
+
agentProcessEnvBlock: this.options.agentProcessEnvBlock,
|
|
1016
1014
|
processLifecycle: {
|
|
1017
1015
|
...options.processLifecycle,
|
|
1018
1016
|
onBeforeSpawn: async (launch) => {
|
|
@@ -2278,8 +2276,7 @@ var AcpRuntimeManager = class {
|
|
|
2278
2276
|
return record;
|
|
2279
2277
|
}
|
|
2280
2278
|
};
|
|
2281
|
-
|
|
2282
|
-
//#region src/runtime/public/file-session-store.ts
|
|
2279
|
+
// src/runtime/public/file-session-store.ts
|
|
2283
2280
|
function safeSessionId(sessionId) {
|
|
2284
2281
|
return encodeURIComponent(sessionId);
|
|
2285
2282
|
}
|
|
@@ -2327,8 +2324,7 @@ var FileSessionStore = class {
|
|
|
2327
2324
|
function createFileSessionStore(options) {
|
|
2328
2325
|
return new FileSessionStore(path.resolve(options.stateDir));
|
|
2329
2326
|
}
|
|
2330
|
-
|
|
2331
|
-
//#region src/runtime/public/handle-state.ts
|
|
2327
|
+
// src/runtime/public/handle-state.ts
|
|
2332
2328
|
const ACPX_RUNTIME_HANDLE_PREFIX = "acpx:v2:";
|
|
2333
2329
|
function encodeAcpxRuntimeHandleState(state) {
|
|
2334
2330
|
const payload = Buffer.from(JSON.stringify(state), "utf8").toString("base64url");
|
|
@@ -2365,8 +2361,7 @@ function writeHandleState(handle, state) {
|
|
|
2365
2361
|
handle.backendSessionId = state.backendSessionId;
|
|
2366
2362
|
handle.agentSessionId = state.agentSessionId;
|
|
2367
2363
|
}
|
|
2368
|
-
|
|
2369
|
-
//#region src/runtime/shared.ts
|
|
2364
|
+
// src/runtime/shared.ts
|
|
2370
2365
|
const SHARED_BACKEND = "acpx-shared";
|
|
2371
2366
|
function invalidOption(message) {
|
|
2372
2367
|
throw new AcpRuntimeError("ACP_INVALID_RUNTIME_OPTION", message);
|
|
@@ -2426,6 +2421,8 @@ var SharedAcpRuntime = class {
|
|
|
2426
2421
|
for (const name of [
|
|
2427
2422
|
"sessionStore",
|
|
2428
2423
|
"agentProcessEnv",
|
|
2424
|
+
"agentProcessEnvAllow",
|
|
2425
|
+
"agentProcessEnvBlock",
|
|
2429
2426
|
"mcpServers",
|
|
2430
2427
|
"sessionPermissions",
|
|
2431
2428
|
"processLifecycle",
|
|
@@ -2671,8 +2668,7 @@ var SharedAcpRuntime = class {
|
|
|
2671
2668
|
function createSharedAcpRuntime(options) {
|
|
2672
2669
|
return new SharedAcpRuntime(options);
|
|
2673
2670
|
}
|
|
2674
|
-
|
|
2675
|
-
//#region src/runtime.ts
|
|
2671
|
+
// src/runtime.ts
|
|
2676
2672
|
const ACPX_BACKEND_ID = "acpx";
|
|
2677
2673
|
var AcpxRuntime = class {
|
|
2678
2674
|
options;
|
|
@@ -2685,9 +2681,11 @@ var AcpxRuntime = class {
|
|
|
2685
2681
|
constructor(options, testOptions) {
|
|
2686
2682
|
this.options = options;
|
|
2687
2683
|
this.testOptions = testOptions;
|
|
2688
|
-
if (options.agentProcessEnv) this.options = {
|
|
2684
|
+
if (options.agentProcessEnv || options.agentProcessEnvAllow !== void 0 || options.agentProcessEnvBlock !== void 0) this.options = {
|
|
2689
2685
|
...options,
|
|
2690
|
-
agentProcessEnv: { ...options.agentProcessEnv }
|
|
2686
|
+
agentProcessEnv: options.agentProcessEnv ? { ...options.agentProcessEnv } : void 0,
|
|
2687
|
+
agentProcessEnvAllow: snapshotEnvNames("agentProcessEnvAllow", options.agentProcessEnvAllow),
|
|
2688
|
+
agentProcessEnvBlock: snapshotEnvNames("agentProcessEnvBlock", options.agentProcessEnvBlock)
|
|
2691
2689
|
};
|
|
2692
2690
|
}
|
|
2693
2691
|
isHealthy() {
|
|
@@ -2914,7 +2912,6 @@ function createAcpRuntime(options) {
|
|
|
2914
2912
|
function createRuntimeStore(options) {
|
|
2915
2913
|
return createFileSessionStore(options);
|
|
2916
2914
|
}
|
|
2917
|
-
//#endregion
|
|
2918
2915
|
export { ACPX_BACKEND_ID, AcpRuntimeError, AcpxRuntime, DEFAULT_AGENT_NAME, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, REQUESTED_MODEL_UNSUPPORTED_REASONS, RequestedModelUnsupportedError, SharedAcpRuntime, createAcpRuntime, createAgentRegistry, createFileSessionStore, createRuntimeStore, createSharedAcpRuntime, decodeAcpxRuntimeHandleState, encodeAcpxRuntimeHandleState, inspectAgentModels, isAcpRuntimeError, isRequestedModelUnsupportedError };
|
|
2919
2916
|
|
|
2920
2917
|
//# sourceMappingURL=runtime.js.map
|