@openclaw/acpx 2026.7.2-beta.5 → 2026.8.1-beta.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/dist/{config-schema-lrk5nlcV.js → config-schema-DN_uAi4R.js} +0 -2
- package/dist/doctor-contract-api.js +36 -4
- package/dist/index.js +21 -1248
- package/dist/pi-session-catalog-runtime-BiTQtT7s.js +1220 -0
- package/dist/pi-session-paths-DgYt8LUg.js +81 -0
- package/dist/{process-lease-CU1cFI4I.js → process-lease-Cwvj7WGe.js} +66 -2
- package/dist/{process-reaper-BIOtp_Ek.js → process-reaper-DzVuCxl3.js} +68 -62
- package/dist/{register.runtime-Dajn8myc.js → register.runtime-C29AY8LI.js} +75 -30
- package/dist/register.runtime.js +1 -1
- package/dist/{runtime-CN4JQkdV.js → runtime-BmzHUTK8.js} +329 -107
- package/dist/{service-DOsKw_R1.js → service-LTeZyc7q.js} +38 -45
- package/openclaw.plugin.json +5 -17
- package/package.json +7 -7
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { n as createLazyAcpRuntimeProxy } from "./register.runtime-
|
|
2
|
-
import "./config-schema-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as resolveAcpxPluginRoot, c as splitCommandParts, d as LEGACY_CODEX_ACP_PACKAGE, f as OPENCLAW_CODEX_CONFIG_ARG, i as resolveAcpxPluginConfig, l as CODEX_ACP_BIN, o as toAcpMcpServers, r as reapStaleOpenClawOwnedAcpxOrphans, s as quoteCommandPart, t as cleanupOpenClawOwnedAcpxProcessTree, u as CODEX_ACP_PACKAGE } from "./process-reaper-BIOtp_Ek.js";
|
|
1
|
+
import { n as createLazyAcpRuntimeProxy } from "./register.runtime-C29AY8LI.js";
|
|
2
|
+
import "./config-schema-DN_uAi4R.js";
|
|
3
|
+
import { _ as quoteCommandPart, a as createAcpxProcessLeaseStore, f as ACPX_GATEWAY_INSTANCE_KEY, g as normalizeAcpxGatewayInstanceRecord, l as openAcpxProcessLeaseStateStore, n as OPENCLAW_ACPX_LEASE_ID_ARG, p as ACPX_GATEWAY_INSTANCE_NAMESPACE, r as OPENCLAW_GATEWAY_INSTANCE_ID_ARG, v as splitCommandParts } from "./process-lease-Cwvj7WGe.js";
|
|
4
|
+
import { a as resolveAcpxPluginConfig, c as CODEX_ACP_BIN, d as OPENCLAW_CODEX_CONFIG_ARG, i as reapStaleOpenClawOwnedAcpxOrphans, l as CODEX_ACP_PACKAGE, n as cleanupOpenClawOwnedAcpxProcessTree, o as resolveAcpxPluginRoot, s as toAcpMcpServers, t as cleanupOpenClawOwnedAcpxPendingLease, u as LEGACY_CODEX_ACP_PACKAGE } from "./process-reaper-DzVuCxl3.js";
|
|
6
5
|
import { createRequire } from "node:module";
|
|
7
6
|
import { finiteSecondsToTimerSafeMilliseconds } from "openclaw/plugin-sdk/number-runtime";
|
|
8
7
|
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
|
|
9
|
-
import {
|
|
8
|
+
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
9
|
+
import { isRecord, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import fs from "node:fs";
|
|
11
|
-
import fs$1 from "node:fs/promises";
|
|
12
|
-
import path from "node:path";
|
|
13
11
|
import os from "node:os";
|
|
12
|
+
import path from "node:path";
|
|
13
|
+
import fs$1 from "node:fs/promises";
|
|
14
14
|
import { randomUUID } from "node:crypto";
|
|
15
15
|
import { inspect } from "node:util";
|
|
16
|
-
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
17
16
|
import { readJsonFileWithFallback } from "openclaw/plugin-sdk/json-store";
|
|
18
17
|
import { parse, stringify } from "smol-toml";
|
|
19
18
|
//#region extensions/acpx/src/codex-trust-config.ts
|
|
@@ -893,14 +892,11 @@ function extractConfiguredAdapterArgs(params) {
|
|
|
893
892
|
if (isAcpBinName(parts[0] ?? "", params.binName)) return parts.slice(1);
|
|
894
893
|
if (basename(parts[0] ?? "") === "node" && isAcpBinName(parts[1] ?? "", params.binName)) return parts.slice(2);
|
|
895
894
|
}
|
|
896
|
-
function isConfigRecord(value) {
|
|
897
|
-
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
898
|
-
}
|
|
899
895
|
function mergeConfigRecords(base, override) {
|
|
900
896
|
const merged = { ...base };
|
|
901
897
|
for (const [key, value] of Object.entries(override)) {
|
|
902
898
|
const existing = merged[key];
|
|
903
|
-
const nextValue =
|
|
899
|
+
const nextValue = isRecord(existing) && isRecord(value) ? mergeConfigRecords(existing, value) : value;
|
|
904
900
|
Object.defineProperty(merged, key, {
|
|
905
901
|
value: nextValue,
|
|
906
902
|
configurable: true,
|
|
@@ -976,7 +972,7 @@ function buildCodexAcpWrapperCommand(wrapperPath, configuredCommand) {
|
|
|
976
972
|
}
|
|
977
973
|
async function persistMigratedCodexMcpConfig(params) {
|
|
978
974
|
const mcpServers = params.migratedConfig?.mcp_servers;
|
|
979
|
-
if (!
|
|
975
|
+
if (!isRecord(mcpServers)) return;
|
|
980
976
|
const configPath = path.join(params.codexHome, "config.toml");
|
|
981
977
|
const merged = mergeConfigRecords(parse(await fs$1.readFile(configPath, "utf8")), { mcp_servers: mcpServers });
|
|
982
978
|
await fs$1.writeFile(configPath, stringify(merged), "utf8");
|
|
@@ -1025,8 +1021,7 @@ async function prepareAcpxCodexAuthConfig(params) {
|
|
|
1025
1021
|
*/
|
|
1026
1022
|
const ENABLE_STARTUP_PROBE_ENV = "OPENCLAW_ACPX_RUNTIME_STARTUP_PROBE";
|
|
1027
1023
|
const SKIP_RUNTIME_PROBE_ENV = "OPENCLAW_SKIP_ACPX_RUNTIME_PROBE";
|
|
1028
|
-
const
|
|
1029
|
-
const loadRuntimeModule = createLazyRuntimeModule(() => import("./runtime-CN4JQkdV.js"));
|
|
1024
|
+
const loadRuntimeModule = createLazyRuntimeModule(() => import("./runtime-BmzHUTK8.js"));
|
|
1030
1025
|
/** Convert ACPX timeout seconds into timer-safe milliseconds. */
|
|
1031
1026
|
function resolveAcpxTimerTimeoutMs(timeoutSeconds) {
|
|
1032
1027
|
if (timeoutSeconds === void 0) return;
|
|
@@ -1067,13 +1062,6 @@ function createLazyDefaultRuntime(params) {
|
|
|
1067
1062
|
}
|
|
1068
1063
|
};
|
|
1069
1064
|
}
|
|
1070
|
-
function warnOnIgnoredLegacyCompatibilityConfig(params) {
|
|
1071
|
-
const ignoredFields = [];
|
|
1072
|
-
if (params.pluginConfig.legacyCompatibilityConfig.queueOwnerTtlSeconds != null) ignoredFields.push("queueOwnerTtlSeconds");
|
|
1073
|
-
if (params.pluginConfig.legacyCompatibilityConfig.strictWindowsCmdWrapper === false) ignoredFields.push("strictWindowsCmdWrapper=false");
|
|
1074
|
-
if (ignoredFields.length === 0) return;
|
|
1075
|
-
params.logger?.warn(`embedded acpx runtime ignores legacy compatibility config: ${ignoredFields.join(", ")}`);
|
|
1076
|
-
}
|
|
1077
1065
|
function formatDoctorDetail(detail) {
|
|
1078
1066
|
if (!detail) return null;
|
|
1079
1067
|
if (typeof detail === "string") return detail.trim() || null;
|
|
@@ -1152,21 +1140,22 @@ async function reapOpenAcpxProcessLeases(params) {
|
|
|
1152
1140
|
const leases = await params.leaseStore.listOpen(params.gatewayInstanceId);
|
|
1153
1141
|
const inspectedPids = [];
|
|
1154
1142
|
const terminatedPids = [];
|
|
1155
|
-
const
|
|
1143
|
+
const legacyWrapperRoots = /* @__PURE__ */ new Set();
|
|
1156
1144
|
for (const lease of leases) {
|
|
1157
1145
|
if (lease.rootPid <= 0) {
|
|
1146
|
+
legacyWrapperRoots.add(lease.wrapperRoot);
|
|
1158
1147
|
await params.leaseStore.markState(lease.leaseId, "closing");
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
await params.leaseStore.markState(lease.leaseId, result.terminatedPids.length > 0 ? "closed" : "lost");
|
|
1148
|
+
const result = await cleanupOpenClawOwnedAcpxPendingLease({
|
|
1149
|
+
leaseId: lease.leaseId,
|
|
1150
|
+
gatewayInstanceId: lease.gatewayInstanceId,
|
|
1151
|
+
wrapperRoot: lease.wrapperRoot,
|
|
1152
|
+
wrapperPath: lease.wrapperPath,
|
|
1153
|
+
deps: params.deps
|
|
1154
|
+
});
|
|
1155
|
+
inspectedPids.push(...result.inspectedPids);
|
|
1156
|
+
terminatedPids.push(...result.terminatedPids);
|
|
1157
|
+
const retryableEvidenceFailure = result.skippedReason === "ambiguous-root" || result.skippedReason === "process-list-unavailable" || result.skippedReason === "unsupported-platform" || result.skippedReason === "unverified-root" || lease.sessionKey === "openclaw:acpx:probe" && result.skippedReason === "missing-root";
|
|
1158
|
+
await params.leaseStore.markState(lease.leaseId, retryableEvidenceFailure ? "open" : result.terminatedPids.length > 0 ? "closed" : "lost");
|
|
1170
1159
|
continue;
|
|
1171
1160
|
}
|
|
1172
1161
|
await params.leaseStore.markState(lease.leaseId, "closing");
|
|
@@ -1179,7 +1168,15 @@ async function reapOpenAcpxProcessLeases(params) {
|
|
|
1179
1168
|
});
|
|
1180
1169
|
inspectedPids.push(...result.inspectedPids);
|
|
1181
1170
|
terminatedPids.push(...result.terminatedPids);
|
|
1182
|
-
await params.leaseStore.markState(lease.leaseId, result.terminatedPids.length > 0 ? "closed" : "lost");
|
|
1171
|
+
await params.leaseStore.markState(lease.leaseId, result.skippedReason === "process-list-unavailable" || result.skippedReason === "unsupported-platform" ? "open" : result.terminatedPids.length > 0 ? "closed" : "lost");
|
|
1172
|
+
}
|
|
1173
|
+
for (const wrapperRoot of legacyWrapperRoots) {
|
|
1174
|
+
const legacyResult = await reapStaleOpenClawOwnedAcpxOrphans({
|
|
1175
|
+
wrapperRoot,
|
|
1176
|
+
deps: params.deps
|
|
1177
|
+
});
|
|
1178
|
+
inspectedPids.push(...legacyResult.inspectedPids);
|
|
1179
|
+
terminatedPids.push(...legacyResult.terminatedPids);
|
|
1183
1180
|
}
|
|
1184
1181
|
return {
|
|
1185
1182
|
inspectedPids,
|
|
@@ -1187,7 +1184,7 @@ async function reapOpenAcpxProcessLeases(params) {
|
|
|
1187
1184
|
};
|
|
1188
1185
|
}
|
|
1189
1186
|
/** Create the ACPX plugin service that owns runtime registration and cleanup. */
|
|
1190
|
-
function createAcpxRuntimeService(params
|
|
1187
|
+
function createAcpxRuntimeService(params) {
|
|
1191
1188
|
let runtime = null;
|
|
1192
1189
|
let lifecycleRevision = 0;
|
|
1193
1190
|
return {
|
|
@@ -1225,10 +1222,6 @@ function createAcpxRuntimeService(params = {}) {
|
|
|
1225
1222
|
deps: params.processCleanupDeps
|
|
1226
1223
|
}));
|
|
1227
1224
|
if (startupReap.terminatedPids.length > 0) ctx.logger.info(`reaped ${startupReap.terminatedPids.length} stale OpenClaw-owned ACPX process${startupReap.terminatedPids.length === 1 ? "" : "es"}`);
|
|
1228
|
-
warnOnIgnoredLegacyCompatibilityConfig({
|
|
1229
|
-
pluginConfig,
|
|
1230
|
-
logger: ctx.logger
|
|
1231
|
-
});
|
|
1232
1225
|
const startedRuntime = await measureAcpxStartup(ctx, "runtime.create", () => params.runtimeFactory ? params.runtimeFactory({
|
|
1233
1226
|
pluginConfig,
|
|
1234
1227
|
gatewayInstanceId,
|
|
@@ -1246,11 +1239,11 @@ function createAcpxRuntimeService(params = {}) {
|
|
|
1246
1239
|
const shouldProbeRuntime = shouldProbeRuntimeAtStartup();
|
|
1247
1240
|
detailAcpxStartup(ctx, "probe-policy", [["startupProbeEnabledCount", shouldProbeRuntime ? 1 : 0], ["probeAgent", pluginConfig.probeAgent ?? "default"]]);
|
|
1248
1241
|
await measureAcpxStartup(ctx, "backend.register", () => {
|
|
1249
|
-
|
|
1250
|
-
id: ACPX_BACKEND_ID,
|
|
1242
|
+
const backend = {
|
|
1251
1243
|
runtime: startedRuntime,
|
|
1252
1244
|
...shouldProbeRuntime ? { healthy: () => runtime?.isHealthy() ?? false } : {}
|
|
1253
|
-
}
|
|
1245
|
+
};
|
|
1246
|
+
params.backendLifecycle.publish(backend);
|
|
1254
1247
|
ctx.logger.info(`embedded acpx runtime backend registered (cwd: ${pluginConfig.cwd})`);
|
|
1255
1248
|
});
|
|
1256
1249
|
if (!shouldProbeRuntime) return;
|
|
@@ -1279,7 +1272,7 @@ function createAcpxRuntimeService(params = {}) {
|
|
|
1279
1272
|
},
|
|
1280
1273
|
async stop(_ctx) {
|
|
1281
1274
|
lifecycleRevision += 1;
|
|
1282
|
-
|
|
1275
|
+
if (runtime) params.backendLifecycle.retract(runtime);
|
|
1283
1276
|
runtime = null;
|
|
1284
1277
|
}
|
|
1285
1278
|
};
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "acpx",
|
|
3
|
+
"doctorContract": {
|
|
4
|
+
"configRepair": true,
|
|
5
|
+
"stateMigrations": true
|
|
6
|
+
},
|
|
3
7
|
"activation": {
|
|
4
8
|
"onStartup": true
|
|
5
9
|
},
|
|
@@ -37,18 +41,11 @@
|
|
|
37
41
|
"openClawToolsMcpBridge": {
|
|
38
42
|
"type": "boolean"
|
|
39
43
|
},
|
|
40
|
-
"strictWindowsCmdWrapper": {
|
|
41
|
-
"type": "boolean"
|
|
42
|
-
},
|
|
43
44
|
"timeoutSeconds": {
|
|
44
45
|
"type": "number",
|
|
45
46
|
"minimum": 0.001,
|
|
46
47
|
"default": 120
|
|
47
48
|
},
|
|
48
|
-
"queueOwnerTtlSeconds": {
|
|
49
|
-
"type": "number",
|
|
50
|
-
"minimum": 0
|
|
51
|
-
},
|
|
52
49
|
"piSessionCatalog": {
|
|
53
50
|
"type": "object",
|
|
54
51
|
"additionalProperties": false,
|
|
@@ -87,6 +84,7 @@
|
|
|
87
84
|
"type": "object",
|
|
88
85
|
"additionalProperties": {
|
|
89
86
|
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
90
88
|
"properties": {
|
|
91
89
|
"command": {
|
|
92
90
|
"type": "string",
|
|
@@ -129,21 +127,11 @@
|
|
|
129
127
|
"help": "Default off. When enabled, inject the built-in OpenClaw core-tools MCP server into embedded ACP sessions so ACP agents can call selected built-in tools such as cron.",
|
|
130
128
|
"advanced": true
|
|
131
129
|
},
|
|
132
|
-
"strictWindowsCmdWrapper": {
|
|
133
|
-
"label": "Strict Windows cmd Wrapper",
|
|
134
|
-
"help": "Legacy compatibility field. The current embedded acpx/runtime package uses its own Windows command resolution behavior. Setting this to false is accepted for compatibility and logged as ignored.",
|
|
135
|
-
"advanced": true
|
|
136
|
-
},
|
|
137
130
|
"timeoutSeconds": {
|
|
138
131
|
"label": "Runtime Operation Timeout Seconds",
|
|
139
132
|
"help": "Timeout for embedded ACP runtime startup and control operations. ACP turns use OpenClaw agent/run timeouts.",
|
|
140
133
|
"advanced": true
|
|
141
134
|
},
|
|
142
|
-
"queueOwnerTtlSeconds": {
|
|
143
|
-
"label": "Queue Owner TTL Seconds",
|
|
144
|
-
"help": "Reserved compatibility field for the older embedded ACPX queue-owner path. Accepted for compatibility and logged as ignored.",
|
|
145
|
-
"advanced": true
|
|
146
|
-
},
|
|
147
135
|
"piSessionCatalog.enabled": {
|
|
148
136
|
"label": "Pi Session Catalog",
|
|
149
137
|
"help": "Auto-detect Pi sessions on the Gateway and paired nodes, then show them in the sessions sidebar."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/acpx",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.8.1-beta.2",
|
|
4
4
|
"description": "OpenClaw ACP runtime backend with plugin-owned session and transport management.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@agentclientprotocol/claude-agent-acp": "0.
|
|
11
|
+
"@agentclientprotocol/claude-agent-acp": "0.62.0",
|
|
12
12
|
"@agentclientprotocol/codex-acp": "1.1.7",
|
|
13
|
-
"acpx": "0.
|
|
14
|
-
"smol-toml": "1.7.
|
|
13
|
+
"acpx": "0.13.0",
|
|
14
|
+
"smol-toml": "1.7.1",
|
|
15
15
|
"zod": "4.4.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
45
|
"compat": {
|
|
46
|
-
"pluginApi": ">=2026.
|
|
46
|
+
"pluginApi": ">=2026.8.1-beta.2"
|
|
47
47
|
},
|
|
48
48
|
"build": {
|
|
49
|
-
"openclawVersion": "2026.
|
|
49
|
+
"openclawVersion": "2026.8.1-beta.2",
|
|
50
50
|
"staticAssets": [
|
|
51
51
|
{
|
|
52
52
|
"source": "./src/runtime-internals/mcp-proxy.mjs",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"skills/**"
|
|
75
75
|
],
|
|
76
76
|
"peerDependencies": {
|
|
77
|
-
"openclaw": ">=2026.
|
|
77
|
+
"openclaw": ">=2026.8.1-beta.2"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"openclaw": {
|