acpx 0.14.0 → 0.15.0
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 +3 -3
- package/dist/{cli-DSwJ-0g-.js → cli-Cen2Rb6S.js} +4 -4
- package/dist/{cli-DSwJ-0g-.js.map → cli-Cen2Rb6S.js.map} +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +8 -7
- package/dist/cli.js.map +1 -1
- package/dist/{client-IfFkZz0S.d.ts → client-Cvz6msGc.d.ts} +6 -2
- package/dist/client-Cvz6msGc.d.ts.map +1 -0
- package/dist/{flags-ftdtbXWd.js → flags-CRh8BJre.js} +3 -3
- package/dist/{flags-ftdtbXWd.js.map → flags-CRh8BJre.js.map} +1 -1
- package/dist/{flows-DEook1GU.js → flows-D-F3Y2o9.js} +52 -11
- package/dist/flows-D-F3Y2o9.js.map +1 -0
- package/dist/flows.d.ts +4 -2
- package/dist/flows.d.ts.map +1 -1
- package/dist/flows.js +1 -1
- package/dist/{live-checkpoint-BW9JivEG.js → live-checkpoint-CYRs-D9t.js} +260 -85
- package/dist/live-checkpoint-CYRs-D9t.js.map +1 -0
- package/dist/{output-jb0298L8.js → output-CIVecnHU.js} +41 -9
- package/dist/output-CIVecnHU.js.map +1 -0
- package/dist/runtime.d.ts +10 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +45 -7
- package/dist/runtime.js.map +1 -1
- package/dist/{session-options-DwRDODlr.d.ts → session-options-DyIGRNfu.d.ts} +48 -2
- package/dist/session-options-DyIGRNfu.d.ts.map +1 -0
- package/package.json +2 -2
- package/skills/acpx/SKILL.md +2 -0
- package/dist/client-IfFkZz0S.d.ts.map +0 -1
- package/dist/flows-DEook1GU.js.map +0 -1
- package/dist/live-checkpoint-BW9JivEG.js.map +0 -1
- package/dist/output-jb0298L8.js.map +0 -1
- package/dist/session-options-DwRDODlr.d.ts.map +0 -1
package/dist/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as RequestedModelUnsupportedErrorCode, i as RequestedModelUnsupportedError, n as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, o as RequestedModelUnsupportedReason, r as REQUESTED_MODEL_UNSUPPORTED_REASONS, s as isRequestedModelUnsupportedError, t as AcpClient } from "./client-
|
|
1
|
+
import { C as SessionRecord, a as AcpElicitationHandler, b as PermissionMode, c as AcpElicitationResponse, d as AcpProcessExit, f as AcpProcessLaunch, g as AcpProcessStarted, h as AcpProcessSpawnFailure, i as AcpElicitationContext, l as AcpPermissionDecision, m as AcpProcessLifecycle, n as SystemPromptOption, o as AcpElicitationMode, p as AcpProcessLaunchScope, s as AcpElicitationRequest, t as SessionAgentOptions, u as AcpPermissionRequest, v as McpServer$1, x as PermissionPolicy, y as NonInteractivePermissionPolicy } from "./session-options-DyIGRNfu.js";
|
|
2
|
+
import { a as RequestedModelUnsupportedErrorCode, i as RequestedModelUnsupportedError, n as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, o as RequestedModelUnsupportedReason, r as REQUESTED_MODEL_UNSUPPORTED_REASONS, s as isRequestedModelUnsupportedError, t as AcpClient } from "./client-Cvz6msGc.js";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { SetSessionConfigOptionResponse, ToolCallContent, ToolCallLocation, ToolKind } from "@agentclientprotocol/sdk";
|
|
5
5
|
//#region src/agent-registry.d.ts
|
|
@@ -206,6 +206,7 @@ type AcpRuntimeEvent = {
|
|
|
206
206
|
{
|
|
207
207
|
type: "done";
|
|
208
208
|
stopReason?: string;
|
|
209
|
+
_meta?: Record<string, unknown> | null;
|
|
209
210
|
} |
|
|
210
211
|
/**
|
|
211
212
|
* Compatibility failure event emitted by runTurn(...). startTurn(...).events
|
|
@@ -227,9 +228,11 @@ type AcpRuntimeTurnResultError = {
|
|
|
227
228
|
type AcpRuntimeTurnResult = {
|
|
228
229
|
status: "completed";
|
|
229
230
|
stopReason?: string;
|
|
231
|
+
_meta?: Record<string, unknown> | null;
|
|
230
232
|
} | {
|
|
231
233
|
status: "cancelled";
|
|
232
234
|
stopReason?: string;
|
|
235
|
+
_meta?: Record<string, unknown> | null;
|
|
233
236
|
} | {
|
|
234
237
|
status: "failed";
|
|
235
238
|
error: AcpRuntimeTurnResultError;
|
|
@@ -299,6 +302,8 @@ interface AcpAgentRegistry {
|
|
|
299
302
|
}
|
|
300
303
|
type AcpRuntimeOptions = {
|
|
301
304
|
cwd: string;
|
|
305
|
+
/** Trusted child-only environment, snapshotted at construction and never persisted. */
|
|
306
|
+
agentProcessEnv?: Record<string, string>;
|
|
302
307
|
sessionStore: AcpSessionStore;
|
|
303
308
|
agentRegistry: AcpAgentRegistry;
|
|
304
309
|
mcpServers?: McpServer$1[];
|
|
@@ -310,6 +315,8 @@ type AcpRuntimeOptions = {
|
|
|
310
315
|
verbose?: boolean;
|
|
311
316
|
/** ACP elicitation modes the embedding host can render for prompt turns. */
|
|
312
317
|
elicitationModes?: readonly AcpElicitationMode[];
|
|
318
|
+
/** Optional lifecycle observer for ACP agent processes owned by this runtime. */
|
|
319
|
+
processLifecycle?: AcpProcessLifecycle;
|
|
313
320
|
onPermissionRequest?: (req: AcpPermissionRequest, ctx: {
|
|
314
321
|
signal: AbortSignal;
|
|
315
322
|
}) => Promise<AcpPermissionDecision | undefined>;
|
|
@@ -549,5 +556,5 @@ export declare function createRuntimeStore(options: {
|
|
|
549
556
|
stateDir: string;
|
|
550
557
|
}): AcpSessionStore;
|
|
551
558
|
//#endregion
|
|
552
|
-
export { type AcpAgentRegistry, type AcpElicitationContext, type AcpElicitationHandler, type AcpElicitationMode, type AcpElicitationRequest, type AcpElicitationResponse, type AcpFileSessionStoreOptions, type AcpPermissionDecision, type AcpPermissionRequest, type AcpRuntime, type AcpRuntimeAvailableCommand, type AcpRuntimeCapabilities, type AcpRuntimeDoctorReport, type AcpRuntimeEnsureInput, type AcpRuntimeErrorCode, type AcpRuntimeEvent, type AcpRuntimeHandle, type AcpRuntimeOptions, type AcpRuntimePromptMode, type AcpRuntimeSessionMode, type AcpRuntimeSessionModels, 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, type PermissionPolicy, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, REQUESTED_MODEL_UNSUPPORTED_REASONS, RequestedModelUnsupportedError, type RequestedModelUnsupportedErrorCode, type RequestedModelUnsupportedReason, type SessionAgentOptions, type SystemPromptOption, isRequestedModelUnsupportedError };
|
|
559
|
+
export { type AcpAgentRegistry, type AcpElicitationContext, type AcpElicitationHandler, type AcpElicitationMode, type AcpElicitationRequest, type AcpElicitationResponse, type AcpFileSessionStoreOptions, type AcpPermissionDecision, 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 AcpRuntimePromptMode, type AcpRuntimeSessionMode, type AcpRuntimeSessionModels, 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, type PermissionPolicy, REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, REQUESTED_MODEL_UNSUPPORTED_REASONS, RequestedModelUnsupportedError, type RequestedModelUnsupportedErrorCode, type RequestedModelUnsupportedReason, type SessionAgentOptions, type SystemPromptOption, isRequestedModelUnsupportedError };
|
|
553
560
|
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../src/agent-registry.ts","../src/runtime/public/contract.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.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","names":[],"sources":["../src/agent-registry.ts","../src/runtime/public/contract.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.ts"],"mappings":";;;;;qBAoHa;;;KC7ED;KAEA;KAEA;KAaA;KAEA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;;KAGU;EACV;EACA;EACA,MAAM;EACN;EACA;;;;;;;;;EASA,iBAAiB;;KAGP;;;;;EAKV;EACA;;KAGU;EACV,QAAQ;EACR;EACA,cAAc;EACd,MAAM;EACN;EACA;EACA,SAAS;;EAET,gBAAgB;;KAGN;EACV,UAAU;EACV;;KAGU;EACV;EACA;;;;;;;KAQU;EACV;EACA;;;;;;;KAQU;EACV;EACA;EACA;EACA;EACA;EACA;;;;;;;;KASU;EACV;EACA;;EAEA;;;;;;;KAQU;EACV,aAAa;;EAEb,OAAO;;EAEP,aAAa,eAAe;;KAGlB;EACV;EACA;EACA;EACA;EACA,SAAS;;EAET,QAAQ;;;;;;;EAOR,oBAAoB;EACpB,UAAU;;KAGA;EACV;EACA;EACA;EACA;EACA;;;;;;KAOU;EACV;EACA;EACA;;KAGU;EAEN;EACA;EACA;EACA,MAAM;;;;;;;;;EASN;;;;;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AA6B,OAAO;wBAKpC,6BAA6B,6BAA6B;;;qBCgF7D;KAMR,kBAAkB;EACrB,qBAAqB;EACrB;EACA,UAAU,QAAQ;;wBAGJ,oBAAoB;EAClC,YAAY;IACV;qBAuCS,uBAAuB;mBAMf;mBACA;UANX;UACA;UACA;EAGW,YAAA,SAAS,mBACT;IACf,kBAAkB,SAAS,sBAAsB;IACjD,eAAe,SAAS,sBAAsB;MAC5C;MACA;MACA;;;EASN;EAIM,qBAAqB;EAKrB,UAAU,QAAQ;EAWlB,cAAc,OAAO,wBAAwB,QAAQ;EAyC3D,UAAU,OAAO;;;;;;;IA8BM,OAAA;MAAE;QAAiB;IAGd,YAAA;MAAE;QAAiB;;EAMxC,QAAQ,OAAO,sBAAsB,cAAc;EAgBpD,gBAAgB;IAAU,SAAS;MAAqB,QAAQ;EAyBhE,UAAU;IACd,QAAQ;IACR,SAAS;MACP,QAAQ;EAMN,QAAQ;IAAS,QAAQ;IAAkB;MAAiB;EAM5D,gBAAgB;IACpB,QAAQ;IACR;IACA;MACE,QAAQ;EAMN,OAAO;IAAS,QAAQ;IAAkB;MAAoB;EAM9D,MAAM;IACV,QAAQ;IACR;IACA;MACE;UAQU;UAeA;UAIN;UAcA;;wBA+BM,iBAAiB,SAAS,oBAAoB;wBAI9C,mBAAmB;EAAW;IAAqB"}
|
package/dist/runtime.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as RequestedModelUnsupportedError, At as DEFAULT_AGENT_NAME, Bt as extractAcpError, C as sessionOptionsFromRecord, D as AcpClient, E as reconcileAgentSessionId, Ft as resolveCanonicalAgentName, M as modelStateFromConfigOptions, Mt as normalizeAgentName, N as normalizeAgentCommandInput, Nt as resolveAgentArgv, O as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Pt as resolveAgentCommand, Q as assertPersistedKeyPolicy, S as persistSessionOptions, T as applyLifecycleSnapshotToRecord, Tt as textPrompt, Vt as isAcpResourceNotFoundError, Z as createAtomicWriteTempPath, _ as recordPromptSubmission, a as applyConfigOptionSelection, b as advertisedModelState, c as applyRequestedModelIfAdvertised, ct as serializeSessionRecordForDisk, d as setDesiredModeId, dt as defaultSessionEventLog, f as syncAdvertisedModelState, g as recordClientOperation, h as createSessionConversation, i as connectAndLoadSession, j as isRequestedModelUnsupportedError, jt as listBuiltInAgents, k as REQUESTED_MODEL_UNSUPPORTED_REASONS, kt as withTimeout, l as currentModelIdFromSetModelResponse, m as cloneSessionConversation, n as runPromptTurn, o as applyConfigOptionsToRecord, p as cloneSessionAcpxState, r as withConnectedSession, s as applyModelSelection, st as parseSessionRecord, t as LiveSessionCheckpoint, u as setCurrentModelId, v as recordSessionUpdate, w as applyConversation, y as trimConversationForRuntime, zt as normalizeOutputError } from "./live-checkpoint-
|
|
1
|
+
import { A as RequestedModelUnsupportedError, At as DEFAULT_AGENT_NAME, Bt as extractAcpError, C as sessionOptionsFromRecord, D as AcpClient, E as reconcileAgentSessionId, Ft as resolveCanonicalAgentName, M as modelStateFromConfigOptions, Mt as normalizeAgentName, N as normalizeAgentCommandInput, Nt as resolveAgentArgv, O as REQUESTED_MODEL_UNSUPPORTED_ERROR_CODE, Pt as resolveAgentCommand, Q as assertPersistedKeyPolicy, S as persistSessionOptions, T as applyLifecycleSnapshotToRecord, Tt as textPrompt, Vt as isAcpResourceNotFoundError, Z as createAtomicWriteTempPath, _ as recordPromptSubmission, a as applyConfigOptionSelection, b as advertisedModelState, c as applyRequestedModelIfAdvertised, ct as serializeSessionRecordForDisk, d as setDesiredModeId, dt as defaultSessionEventLog, f as syncAdvertisedModelState, g as recordClientOperation, h as createSessionConversation, i as connectAndLoadSession, j as isRequestedModelUnsupportedError, jt as listBuiltInAgents, k as REQUESTED_MODEL_UNSUPPORTED_REASONS, kt as withTimeout, l as currentModelIdFromSetModelResponse, m as cloneSessionConversation, n as runPromptTurn, o as applyConfigOptionsToRecord, p as cloneSessionAcpxState, r as withConnectedSession, s as applyModelSelection, st as parseSessionRecord, t as LiveSessionCheckpoint, u as setCurrentModelId, v as recordSessionUpdate, w as applyConversation, y as trimConversationForRuntime, zt as normalizeOutputError } from "./live-checkpoint-CYRs-D9t.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
@@ -655,7 +655,8 @@ function legacyTerminalEventFromTurnResult(result) {
|
|
|
655
655
|
};
|
|
656
656
|
return {
|
|
657
657
|
type: "done",
|
|
658
|
-
...result.stopReason ? { stopReason: result.stopReason } : {}
|
|
658
|
+
...result.stopReason ? { stopReason: result.stopReason } : {},
|
|
659
|
+
...result._meta === void 0 ? {} : { _meta: result._meta }
|
|
659
660
|
};
|
|
660
661
|
}
|
|
661
662
|
function statusSummary(record) {
|
|
@@ -788,7 +789,11 @@ var AcpRuntimeManager = class {
|
|
|
788
789
|
this.deps = deps;
|
|
789
790
|
}
|
|
790
791
|
createClient(options) {
|
|
791
|
-
|
|
792
|
+
const clientOptions = {
|
|
793
|
+
...options,
|
|
794
|
+
agentProcessEnv: this.options.agentProcessEnv
|
|
795
|
+
};
|
|
796
|
+
return this.deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
792
797
|
}
|
|
793
798
|
createSessionOwner(input) {
|
|
794
799
|
const owner = {
|
|
@@ -953,7 +958,14 @@ var AcpRuntimeManager = class {
|
|
|
953
958
|
sessionRecordId: record.acpxRecordId,
|
|
954
959
|
loadRecord: async (sessionRecordId) => await this.requireRecord(sessionRecordId),
|
|
955
960
|
saveRecord: async (connectedRecord) => await this.options.sessionStore.save(connectedRecord),
|
|
956
|
-
createClient: (options) => this.createClient(
|
|
961
|
+
createClient: (options) => this.createClient({
|
|
962
|
+
...options,
|
|
963
|
+
processLifecycle: this.options.processLifecycle,
|
|
964
|
+
processLaunchScope: {
|
|
965
|
+
kind: "runtime-session",
|
|
966
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
967
|
+
}
|
|
968
|
+
}),
|
|
957
969
|
mcpServers: [...this.options.mcpServers ?? []],
|
|
958
970
|
permissionMode: this.options.permissionMode,
|
|
959
971
|
nonInteractivePermissions: this.options.nonInteractivePermissions,
|
|
@@ -1062,6 +1074,11 @@ var AcpRuntimeManager = class {
|
|
|
1062
1074
|
permissionPolicy: this.options.permissionPolicy,
|
|
1063
1075
|
onPermissionRequest: this.options.onPermissionRequest,
|
|
1064
1076
|
elicitationModes: this.options.elicitationModes,
|
|
1077
|
+
processLifecycle: this.options.processLifecycle,
|
|
1078
|
+
processLaunchScope: {
|
|
1079
|
+
kind: "runtime-session",
|
|
1080
|
+
sessionKey: input.sessionKey
|
|
1081
|
+
},
|
|
1065
1082
|
verbose: this.options.verbose,
|
|
1066
1083
|
sessionOptions: input.sessionOptions
|
|
1067
1084
|
});
|
|
@@ -1242,7 +1259,8 @@ var AcpRuntimeManager = class {
|
|
|
1242
1259
|
await this.saveCompletedRuntimeTurn(turn, response.stopReason);
|
|
1243
1260
|
terminalResult = {
|
|
1244
1261
|
status: response.stopReason === "cancelled" ? "cancelled" : "completed",
|
|
1245
|
-
...response.stopReason ? { stopReason: response.stopReason } : {}
|
|
1262
|
+
...response.stopReason ? { stopReason: response.stopReason } : {},
|
|
1263
|
+
...response._meta === void 0 ? {} : { _meta: response._meta }
|
|
1246
1264
|
};
|
|
1247
1265
|
}
|
|
1248
1266
|
} catch (error) {
|
|
@@ -1386,6 +1404,11 @@ var AcpRuntimeManager = class {
|
|
|
1386
1404
|
permissionPolicy: this.options.permissionPolicy,
|
|
1387
1405
|
onPermissionRequest: this.options.onPermissionRequest,
|
|
1388
1406
|
elicitationModes: this.options.elicitationModes,
|
|
1407
|
+
processLifecycle: this.options.processLifecycle,
|
|
1408
|
+
processLaunchScope: {
|
|
1409
|
+
kind: "runtime-session",
|
|
1410
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1411
|
+
},
|
|
1389
1412
|
verbose: this.options.verbose,
|
|
1390
1413
|
sessionOptions: sessionOptionsFromRecord(record)
|
|
1391
1414
|
});
|
|
@@ -1720,6 +1743,11 @@ var AcpRuntimeManager = class {
|
|
|
1720
1743
|
permissionPolicy: this.options.permissionPolicy,
|
|
1721
1744
|
onPermissionRequest: this.options.onPermissionRequest,
|
|
1722
1745
|
elicitationModes: this.options.elicitationModes,
|
|
1746
|
+
processLifecycle: this.options.processLifecycle,
|
|
1747
|
+
processLaunchScope: {
|
|
1748
|
+
kind: "runtime-session",
|
|
1749
|
+
sessionKey: record.name ?? record.acpxRecordId
|
|
1750
|
+
},
|
|
1723
1751
|
verbose: this.options.verbose
|
|
1724
1752
|
}) };
|
|
1725
1753
|
}
|
|
@@ -1863,7 +1891,7 @@ function normalizeRuntimeDetails(details) {
|
|
|
1863
1891
|
async function probeRuntime(options, deps = {}) {
|
|
1864
1892
|
const agentName = options.probeAgent?.trim() || "codex";
|
|
1865
1893
|
const agentCommand = normalizeAgentCommandInput(options.agentRegistry.resolve(agentName));
|
|
1866
|
-
const client = createProbeClient(options, agentCommand, deps);
|
|
1894
|
+
const client = createProbeClient(options, agentName, agentCommand, deps);
|
|
1867
1895
|
try {
|
|
1868
1896
|
await client.start();
|
|
1869
1897
|
return {
|
|
@@ -1891,14 +1919,20 @@ async function probeRuntime(options, deps = {}) {
|
|
|
1891
1919
|
await client.close().catch(() => {});
|
|
1892
1920
|
}
|
|
1893
1921
|
}
|
|
1894
|
-
function createProbeClient(options, agentCommand, deps) {
|
|
1922
|
+
function createProbeClient(options, agentName, agentCommand, deps) {
|
|
1895
1923
|
const clientOptions = {
|
|
1896
1924
|
...agentCommand,
|
|
1897
1925
|
cwd: options.cwd,
|
|
1926
|
+
agentProcessEnv: options.agentProcessEnv,
|
|
1898
1927
|
mcpServers: [...options.mcpServers ?? []],
|
|
1899
1928
|
permissionMode: options.permissionMode,
|
|
1900
1929
|
nonInteractivePermissions: options.nonInteractivePermissions,
|
|
1901
1930
|
permissionPolicy: options.permissionPolicy,
|
|
1931
|
+
processLifecycle: options.processLifecycle,
|
|
1932
|
+
processLaunchScope: {
|
|
1933
|
+
kind: "runtime-probe",
|
|
1934
|
+
agent: agentName
|
|
1935
|
+
},
|
|
1902
1936
|
verbose: options.verbose
|
|
1903
1937
|
};
|
|
1904
1938
|
return deps.clientFactory?.(clientOptions) ?? new AcpClient(clientOptions);
|
|
@@ -1946,6 +1980,10 @@ var AcpxRuntime = class {
|
|
|
1946
1980
|
constructor(options, testOptions) {
|
|
1947
1981
|
this.options = options;
|
|
1948
1982
|
this.testOptions = testOptions;
|
|
1983
|
+
if (options.agentProcessEnv) this.options = {
|
|
1984
|
+
...options,
|
|
1985
|
+
agentProcessEnv: { ...options.agentProcessEnv }
|
|
1986
|
+
};
|
|
1949
1987
|
}
|
|
1950
1988
|
isHealthy() {
|
|
1951
1989
|
return this.healthy;
|