@openclaw/acpx 2026.9.3 → 2026.9.5

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.
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
2
+ <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M4 4h16v16H4ZM7 8l3 3-3 3M12 15h5" />
3
+ </svg>
Binary file
@@ -1,11 +1,46 @@
1
- import { t as AcpxPluginConfigSchema } from "./config-schema-DN_uAi4R.js";
2
- import { _ as splitCommandParts } from "./process-lease-B83BGiLj.js";
1
+ import { _ as splitCommandParts } from "./process-lease-B83BGiLj.mjs";
3
2
  import { createRequire } from "node:module";
4
3
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
5
4
  import fs from "node:fs";
6
5
  import path from "node:path";
7
6
  import { fileURLToPath } from "node:url";
8
7
  import { formatPluginConfigIssue } from "openclaw/plugin-sdk/extension-shared";
8
+ import { z } from "zod";
9
+ //#region extensions/acpx/src/config-schema.ts
10
+ /**
11
+ * ACPX plugin configuration schema and public config types. Runtime setup uses
12
+ * this file as the single source of truth for validation and defaulting.
13
+ */
14
+ const ACPX_PERMISSION_MODES = [
15
+ "approve-all",
16
+ "approve-reads",
17
+ "deny-all"
18
+ ];
19
+ const ACPX_NON_INTERACTIVE_POLICIES = ["deny", "fail"];
20
+ const nonEmptyTrimmedString = (message) => z.string({ error: message }).trim().min(1, { error: message });
21
+ const McpServerConfigSchema = z.object({
22
+ command: nonEmptyTrimmedString("command must be a non-empty string").describe("Command to run the MCP server"),
23
+ args: z.array(z.string({ error: "args must be an array of strings" }), { error: "args must be an array of strings" }).optional().describe("Arguments to pass to the command"),
24
+ env: z.record(z.string(), z.string({ error: "env values must be strings" }), { error: "env must be an object of strings" }).optional().describe("Environment variables for the MCP server")
25
+ });
26
+ /** Zod schema for validating raw ACPX plugin config from OpenClaw config. */
27
+ const AcpxPluginConfigSchema = z.strictObject({
28
+ cwd: nonEmptyTrimmedString("cwd must be a non-empty string").optional(),
29
+ stateDir: nonEmptyTrimmedString("stateDir must be a non-empty string").optional(),
30
+ probeAgent: nonEmptyTrimmedString("probeAgent must be a non-empty string").optional(),
31
+ permissionMode: z.enum(ACPX_PERMISSION_MODES, { error: `permissionMode must be one of: ${ACPX_PERMISSION_MODES.join(", ")}` }).optional(),
32
+ nonInteractivePermissions: z.enum(ACPX_NON_INTERACTIVE_POLICIES, { error: `nonInteractivePermissions must be one of: ${ACPX_NON_INTERACTIVE_POLICIES.join(", ")}` }).optional(),
33
+ pluginToolsMcpBridge: z.boolean({ error: "pluginToolsMcpBridge must be a boolean" }).optional(),
34
+ openClawToolsMcpBridge: z.boolean({ error: "openClawToolsMcpBridge must be a boolean" }).optional(),
35
+ timeoutSeconds: z.number({ error: "timeoutSeconds must be a number >= 0.001" }).min(.001, { error: "timeoutSeconds must be a number >= 0.001" }).default(120),
36
+ piSessionCatalog: z.strictObject({ enabled: z.boolean({ error: "piSessionCatalog.enabled must be a boolean" }).default(true) }).optional(),
37
+ mcpServers: z.record(z.string(), McpServerConfigSchema).optional(),
38
+ agents: z.record(z.string(), z.strictObject({
39
+ command: nonEmptyTrimmedString("agents.<id>.command must be a non-empty string"),
40
+ args: z.array(z.string({ error: "args must be an array of strings" })).optional()
41
+ })).optional()
42
+ });
43
+ //#endregion
9
44
  //#region extensions/acpx/src/config.ts
10
45
  /**
11
46
  * Resolves ACPX plugin config from raw user configuration. It locates the
@@ -1,5 +1,4 @@
1
- import { c as PI_SESSION_READ_COMMAND, i as PI_LOCAL_SESSION_HOST_ID, l as PI_TERMINAL_RESUME_COMMAND, n as piSessionStore, o as PI_SESSIONS_LIST_COMMAND, r as piSessionStoreAvailable, s as PI_SESSION_ID_PATTERN, t as piAcpSessionStoreRoot } from "./pi-session-paths-EMbd4Hkz.js";
2
- import { parseDateFirstTimestampMs } from "openclaw/plugin-sdk/number-runtime";
1
+ import { c as PI_SESSION_READ_COMMAND, i as PI_LOCAL_SESSION_HOST_ID, l as PI_TERMINAL_RESUME_COMMAND, n as piSessionStore, o as PI_SESSIONS_LIST_COMMAND, r as piSessionStoreAvailable, s as PI_SESSION_ID_PATTERN, t as piAcpSessionStoreRoot } from "./pi-session-paths-EMbd4Hkz.mjs";
3
2
  import { resolveNodeHostExecutable } from "openclaw/plugin-sdk/node-host";
4
3
  import { createSessionCatalogFamily, importSessionCatalogHistory, isExternalUserText, listAdoptedSessionCatalogSessions, sessionCatalogAdoptedSessionKey } from "openclaw/plugin-sdk/session-catalog";
5
4
  import { isRecord, normalizeBoundedOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
@@ -12,7 +11,8 @@ import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-ru
12
11
  import { sessionCatalogPaging } from "openclaw/plugin-sdk/session-catalog-paging";
13
12
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
14
13
  import { runTasksWithConcurrency } from "openclaw/plugin-sdk/concurrency-runtime";
15
- import { isPathStrictlyInside } from "openclaw/plugin-sdk/file-access-runtime";
14
+ import { isPathStrictlyInside, readFileRangeAsync } from "openclaw/plugin-sdk/file-access-runtime";
15
+ import { parseDateFirstTimestampMs } from "openclaw/plugin-sdk/number-runtime";
16
16
  //#region extensions/acpx/src/pi-session-timestamp.ts
17
17
  /** Preserve Pi JSONL's date-first string contract while accepting numeric millisecond values. */
18
18
  function parsePiSessionTimestampMs(value) {
@@ -587,16 +587,6 @@ async function readLocalPiTranscriptPage(value) {
587
587
  //#endregion
588
588
  //#region extensions/acpx/src/pi-session-upstream-activity.ts
589
589
  const MAX_PI_UPSTREAM_SCAN_BYTES = 1048576;
590
- async function readFileRange(handle, position, length) {
591
- const buffer = Buffer.alloc(length);
592
- let offset = 0;
593
- while (offset < length) {
594
- const { bytesRead } = await handle.read(buffer, offset, length - offset, position + offset);
595
- if (bytesRead <= 0) break;
596
- offset += bytesRead;
597
- }
598
- return offset === length ? buffer : buffer.subarray(0, offset);
599
- }
600
590
  function parseCompletePiRows(tail) {
601
591
  const entries = [];
602
592
  let lineStart = 0;
@@ -667,7 +657,7 @@ async function checkPiSessionUpstreamActivity(probe) {
667
657
  };
668
658
  if (stat.size <= markerOffset) return;
669
659
  const readLength = Math.min(stat.size - markerOffset, MAX_PI_UPSTREAM_SCAN_BYTES);
670
- const { entries, classifiedBytes } = parseCompletePiRows(await readFileRange(handle, markerOffset, readLength));
660
+ const { entries, classifiedBytes } = parseCompletePiRows(await readFileRangeAsync(handle, markerOffset, readLength));
671
661
  if (classifiedBytes === 0) return;
672
662
  let humanTurns = 0;
673
663
  let occurredAt;
@@ -880,6 +870,7 @@ function createPiSessionCatalogRuntime(api) {
880
870
  },
881
871
  terminal: {
882
872
  executable: "pi",
873
+ uploadPathStyle: "native",
883
874
  args: (threadId) => ["--session", threadId],
884
875
  title: (threadId) => `pi --session ${threadId.slice(0, 12)}…`,
885
876
  requireLocalSession: requireLocalPiSession,
@@ -25,6 +25,9 @@ function lazyStartRuntimeTurn(resolveRuntime, input) {
25
25
  function createLazyAcpRuntimeProxy(resolveRuntime) {
26
26
  return {
27
27
  ownerAwareSessions: 1,
28
+ async shutdown() {
29
+ await (await resolveRuntime()).shutdown();
30
+ },
28
31
  async ensureSession(input) {
29
32
  return await (await resolveRuntime()).ensureSession(input);
30
33
  },
@@ -67,7 +70,7 @@ function createLazyAcpRuntimeProxy(resolveRuntime) {
67
70
  * immediately, then imports the heavier service only when a session needs it.
68
71
  */
69
72
  const ACPX_BACKEND_ID = "acpx";
70
- const loadServiceModule = createLazyRuntimeModule(() => import("./service-BAf6nuci.js").then((n) => n.t));
73
+ const loadServiceModule = createLazyRuntimeModule(() => import("./service-DZYyo6-7.mjs").then((n) => n.t));
71
74
  function unregisterOwnedRuntime(runtime) {
72
75
  if (runtime && getAcpRuntimeBackend(ACPX_BACKEND_ID)?.runtime === runtime) unregisterAcpRuntimeBackend(ACPX_BACKEND_ID);
73
76
  }