@kodelyth/acpx 2026.5.42 → 2026.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kodelyth/acpx",
3
- "version": "2026.5.42",
3
+ "version": "2026.6.2",
4
4
  "description": "Klaw ACP runtime backend",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,7 +14,7 @@
14
14
  "zod": "4.4.3"
15
15
  },
16
16
  "devDependencies": {
17
- "@kodelyth/plugin-sdk": "1.0.1"
17
+ "@kodelyth/plugin-sdk": "workspace:*"
18
18
  },
19
19
  "klaw": {
20
20
  "extensions": [
@@ -48,6 +48,22 @@
48
48
  "release": {
49
49
  "publishToClawHub": true,
50
50
  "publishToNpm": true
51
+ },
52
+ "runtimeExtensions": [
53
+ "./dist/index.js"
54
+ ]
55
+ },
56
+ "files": [
57
+ "dist/**",
58
+ "klaw.plugin.json",
59
+ "skills/**"
60
+ ],
61
+ "peerDependencies": {
62
+ "klaw": ">=2026.5.39"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "klaw": {
66
+ "optional": true
51
67
  }
52
68
  }
53
69
  }
package/AGENTS.md DELETED
@@ -1,54 +0,0 @@
1
- # ACPX Extension Notes
2
-
3
- This file applies to work under `extensions/acpx/`.
4
-
5
- ## Purpose
6
-
7
- The ACPX extension is a thin Klaw wrapper around the published `acpx` package. Keep reusable ACP runtime logic in `klaw/acpx`, not in this extension.
8
-
9
- ## Default Version Policy
10
-
11
- - `extensions/acpx/package.json` should point at a published npm release by default.
12
- - Do not leave the extension pinned to a temporary GitHub commit or local checkout once the ACPX release exists.
13
- - Do not leave temporary pnpm build-script allowlist exceptions behind after switching back to a published ACPX package.
14
-
15
- ## Unreleased ACPX Development Flow
16
-
17
- Use this flow when Klaw needs unreleased ACPX changes before the ACPX version is published.
18
-
19
- 1. Make the ACPX code change in the `klaw/acpx` repo first.
20
- 2. In Klaw, temporarily point `extensions/acpx/package.json` at the ACPX GitHub commit you need.
21
- 3. If pnpm blocks ACPX lifecycle/build scripts for that temporary GitHub-sourced package, temporarily add `acpx: true` to `allowBuilds` in `pnpm-workspace.yaml`.
22
- 4. Refresh the root workspace lock:
23
- - `pnpm install --lockfile-only --filter ./extensions/acpx`
24
- 5. Refresh the extension-local npm lock for install metadata:
25
- - `cd extensions/acpx && npm install --package-lock-only --ignore-scripts`
26
- 6. Rebuild Klaw and restart the gateway before doing live ACP validation.
27
- 7. Once ACPX is released, switch `extensions/acpx/package.json` back to the published npm version and refresh the same lockfiles again.
28
- 8. Remove any temporary `acpx` build-script allowlist entry that was only needed for the GitHub-sourced development pin.
29
-
30
- ## Lockfile Notes
31
-
32
- - `pnpm-lock.yaml` is the tracked workspace lockfile and must match the ACPX version referenced by `extensions/acpx/package.json`.
33
- - `extensions/acpx/package-lock.json` is useful local install metadata for the plugin package.
34
- - If `extensions/acpx/package-lock.json` is gitignored in this repo state, regenerating it is still useful for local verification, but it will not appear in `git status`.
35
-
36
- ## Local Runtime Validation
37
-
38
- When ACPX integration changes here, prefer this sequence:
39
-
40
- 1. `pnpm install --filter ./extensions/acpx`
41
- 2. `pnpm test:extension acpx`
42
- 3. `pnpm build`
43
- 4. Restart the local gateway if ACP runtime behavior or bundled plugin wiring changed.
44
- 5. If the change affects direct ACP behavior in chat, run a real ACP smoke after restart.
45
-
46
- ## Direct ACPX Binary Policy
47
-
48
- - Prefer the plugin-local ACPX binary under `extensions/acpx/node_modules/.bin/acpx`.
49
- - Do not rely on a globally installed `acpx` binary for Klaw ACP validation.
50
- - If the plugin-local ACPX binary is missing or on the wrong version, reinstall it from the version pinned in `extensions/acpx/package.json`.
51
-
52
- ## Boundary Rule
53
-
54
- If a change feels like shared ACP runtime behavior instead of Klaw-specific glue, move it to `klaw/acpx` and consume it from here instead of re-implementing it inside `extensions/acpx`.
package/CLAUDE.md DELETED
@@ -1,54 +0,0 @@
1
- # ACPX Extension Notes
2
-
3
- This file applies to work under `extensions/acpx/`.
4
-
5
- ## Purpose
6
-
7
- The ACPX extension is a thin Klaw wrapper around the published `acpx` package. Keep reusable ACP runtime logic in `klaw/acpx`, not in this extension.
8
-
9
- ## Default Version Policy
10
-
11
- - `extensions/acpx/package.json` should point at a published npm release by default.
12
- - Do not leave the extension pinned to a temporary GitHub commit or local checkout once the ACPX release exists.
13
- - Do not leave temporary pnpm build-script allowlist exceptions behind after switching back to a published ACPX package.
14
-
15
- ## Unreleased ACPX Development Flow
16
-
17
- Use this flow when Klaw needs unreleased ACPX changes before the ACPX version is published.
18
-
19
- 1. Make the ACPX code change in the `klaw/acpx` repo first.
20
- 2. In Klaw, temporarily point `extensions/acpx/package.json` at the ACPX GitHub commit you need.
21
- 3. If pnpm blocks ACPX lifecycle/build scripts for that temporary GitHub-sourced package, temporarily add `acpx: true` to `allowBuilds` in `pnpm-workspace.yaml`.
22
- 4. Refresh the root workspace lock:
23
- - `pnpm install --lockfile-only --filter ./extensions/acpx`
24
- 5. Refresh the extension-local npm lock for install metadata:
25
- - `cd extensions/acpx && npm install --package-lock-only --ignore-scripts`
26
- 6. Rebuild Klaw and restart the gateway before doing live ACP validation.
27
- 7. Once ACPX is released, switch `extensions/acpx/package.json` back to the published npm version and refresh the same lockfiles again.
28
- 8. Remove any temporary `acpx` build-script allowlist entry that was only needed for the GitHub-sourced development pin.
29
-
30
- ## Lockfile Notes
31
-
32
- - `pnpm-lock.yaml` is the tracked workspace lockfile and must match the ACPX version referenced by `extensions/acpx/package.json`.
33
- - `extensions/acpx/package-lock.json` is useful local install metadata for the plugin package.
34
- - If `extensions/acpx/package-lock.json` is gitignored in this repo state, regenerating it is still useful for local verification, but it will not appear in `git status`.
35
-
36
- ## Local Runtime Validation
37
-
38
- When ACPX integration changes here, prefer this sequence:
39
-
40
- 1. `pnpm install --filter ./extensions/acpx`
41
- 2. `pnpm test:extension acpx`
42
- 3. `pnpm build`
43
- 4. Restart the local gateway if ACP runtime behavior or bundled plugin wiring changed.
44
- 5. If the change affects direct ACP behavior in chat, run a real ACP smoke after restart.
45
-
46
- ## Direct ACPX Binary Policy
47
-
48
- - Prefer the plugin-local ACPX binary under `extensions/acpx/node_modules/.bin/acpx`.
49
- - Do not rely on a globally installed `acpx` binary for Klaw ACP validation.
50
- - If the plugin-local ACPX binary is missing or on the wrong version, reinstall it from the version pinned in `extensions/acpx/package.json`.
51
-
52
- ## Boundary Rule
53
-
54
- If a change feels like shared ACP runtime behavior instead of Klaw-specific glue, move it to `klaw/acpx` and consume it from here instead of re-implementing it inside `extensions/acpx`.
package/index.test.ts DELETED
@@ -1,119 +0,0 @@
1
- import type { KlawPluginApi } from "klaw/plugin-sdk/plugin-entry";
2
- import { createTestPluginApi } from "klaw/plugin-sdk/plugin-test-api";
3
- import { beforeEach, describe, expect, it, vi } from "vitest";
4
- import setupPlugin from "./setup-api.js";
5
-
6
- const { createAcpxRuntimeServiceMock, tryDispatchAcpReplyHookMock } = vi.hoisted(() => ({
7
- createAcpxRuntimeServiceMock: vi.fn(),
8
- tryDispatchAcpReplyHookMock: vi.fn(),
9
- }));
10
-
11
- vi.mock("./register.runtime.js", () => ({
12
- createAcpxRuntimeService: createAcpxRuntimeServiceMock,
13
- }));
14
-
15
- vi.mock("klaw/plugin-sdk/acp-runtime-backend", () => ({
16
- tryDispatchAcpReplyHook: tryDispatchAcpReplyHookMock,
17
- }));
18
-
19
- import plugin from "./index.js";
20
-
21
- type AcpxAutoEnableProbe = Parameters<KlawPluginApi["registerAutoEnableProbe"]>[0];
22
-
23
- function registerAcpxAutoEnableProbe(): AcpxAutoEnableProbe {
24
- const probes: AcpxAutoEnableProbe[] = [];
25
- setupPlugin.register(
26
- createTestPluginApi({
27
- registerAutoEnableProbe(probe) {
28
- probes.push(probe);
29
- },
30
- }),
31
- );
32
- const probe = probes[0];
33
- if (!probe) {
34
- throw new Error("expected ACPX setup plugin to register an auto-enable probe");
35
- }
36
- return probe;
37
- }
38
-
39
- describe("acpx plugin", () => {
40
- beforeEach(() => {
41
- vi.clearAllMocks();
42
- });
43
-
44
- it("registers the runtime service and reply_dispatch hook", () => {
45
- const service = { id: "acpx-service", start: vi.fn() };
46
- createAcpxRuntimeServiceMock.mockReturnValue(service);
47
-
48
- const api = {
49
- pluginConfig: { stateDir: "/tmp/acpx" },
50
- registerService: vi.fn(),
51
- on: vi.fn(),
52
- };
53
-
54
- plugin.register(api as never);
55
-
56
- expect(createAcpxRuntimeServiceMock).toHaveBeenCalledWith({
57
- pluginConfig: api.pluginConfig,
58
- });
59
- expect(api.registerService).toHaveBeenCalledWith(service);
60
- expect(api.on).toHaveBeenCalledWith("reply_dispatch", tryDispatchAcpReplyHookMock);
61
- });
62
-
63
- it("preserves the ACP reply_dispatch runtime path through the registered hook", async () => {
64
- const service = { id: "acpx-service", start: vi.fn() };
65
- createAcpxRuntimeServiceMock.mockReturnValue(service);
66
- tryDispatchAcpReplyHookMock.mockResolvedValue({
67
- handled: true,
68
- queuedFinal: true,
69
- counts: { tool: 1, block: 0, final: 1 },
70
- });
71
-
72
- const on = vi.fn();
73
- const api = createTestPluginApi({
74
- pluginConfig: { stateDir: "/tmp/acpx" },
75
- registerService: vi.fn(),
76
- on,
77
- });
78
-
79
- plugin.register(api);
80
-
81
- const hook = on.mock.calls.find(([hookName]) => hookName === "reply_dispatch")?.[1];
82
- if (!hook) {
83
- throw new Error("expected reply_dispatch hook to be registered");
84
- }
85
-
86
- const event = {
87
- ctx: { raw: "reply ctx" },
88
- runId: "run-1",
89
- sessionKey: "agent:test:session",
90
- inboundAudio: false,
91
- shouldRouteToOriginating: false,
92
- shouldSendToolSummaries: true,
93
- sendPolicy: "allow",
94
- };
95
- const ctx = {
96
- cfg: {},
97
- dispatcher: { dispatch: vi.fn(), getQueuedCounts: vi.fn(), getFailedCounts: vi.fn() },
98
- recordProcessed: vi.fn(),
99
- markIdle: vi.fn(),
100
- };
101
-
102
- await expect(hook(event, ctx)).resolves.toEqual({
103
- handled: true,
104
- queuedFinal: true,
105
- counts: { tool: 1, block: 0, final: 1 },
106
- });
107
- expect(tryDispatchAcpReplyHookMock).toHaveBeenCalledWith(event, ctx);
108
- });
109
-
110
- it("declares setup auto-enable reasons for ACPX-owned ACP config", () => {
111
- const probe = registerAcpxAutoEnableProbe();
112
-
113
- expect(probe({ config: { acp: { enabled: true } }, env: {} })).toBe("ACP runtime configured");
114
- expect(probe({ config: { acp: { backend: "acpx" } }, env: {} })).toBe("ACP runtime configured");
115
- expect(probe({ config: { acp: { enabled: true, backend: "custom-runtime" } }, env: {} })).toBe(
116
- null,
117
- );
118
- });
119
- });
package/index.ts DELETED
@@ -1,19 +0,0 @@
1
- import { tryDispatchAcpReplyHook } from "klaw/plugin-sdk/acp-runtime-backend";
2
- import { createAcpxRuntimeService } from "./register.runtime.js";
3
- import type { KlawPluginApi } from "./runtime-api.js";
4
-
5
- const plugin = {
6
- id: "acpx",
7
- name: "ACPX Runtime",
8
- description: "Embedded ACP runtime backend with plugin-owned session and transport management.",
9
- register(api: KlawPluginApi) {
10
- api.registerService(
11
- createAcpxRuntimeService({
12
- pluginConfig: api.pluginConfig,
13
- }),
14
- );
15
- api.on("reply_dispatch", tryDispatchAcpReplyHook);
16
- },
17
- };
18
-
19
- export default plugin;
@@ -1,104 +0,0 @@
1
- import { afterEach, describe, expect, it, vi } from "vitest";
2
-
3
- const { runtimeRegistry } = vi.hoisted(() => ({
4
- runtimeRegistry: new Map<string, { runtime: unknown }>(),
5
- }));
6
-
7
- const { realRuntime, realServiceStartMock, realServiceStopMock, createRealServiceMock } =
8
- vi.hoisted(() => {
9
- const runtime = { isHealthy: vi.fn(() => true), probeAvailability: vi.fn(async () => {}) };
10
- const start = vi.fn(async () => {
11
- runtimeRegistry.set("acpx", { runtime });
12
- });
13
- const stop = vi.fn(async () => {
14
- runtimeRegistry.delete("acpx");
15
- });
16
- return {
17
- realRuntime: runtime,
18
- realServiceStartMock: start,
19
- realServiceStopMock: stop,
20
- createRealServiceMock: vi.fn(() => ({ id: "real-acpx-runtime", start, stop })),
21
- };
22
- });
23
-
24
- vi.mock("klaw/plugin-sdk/acp-runtime-backend", () => ({
25
- getAcpRuntimeBackend: (id: string) => runtimeRegistry.get(id),
26
- unregisterAcpRuntimeBackend: (id: string) => {
27
- runtimeRegistry.delete(id);
28
- },
29
- }));
30
-
31
- vi.mock("./src/service.js", () => ({
32
- createAcpxRuntimeService: createRealServiceMock,
33
- }));
34
-
35
- import { createAcpxRuntimeService } from "./register.runtime.js";
36
-
37
- const previousSkipRuntime = process.env.KLAW_SKIP_ACPX_RUNTIME;
38
-
39
- function restoreEnv(): void {
40
- if (previousSkipRuntime === undefined) {
41
- delete process.env.KLAW_SKIP_ACPX_RUNTIME;
42
- } else {
43
- process.env.KLAW_SKIP_ACPX_RUNTIME = previousSkipRuntime;
44
- }
45
- }
46
-
47
- function createServiceContext() {
48
- return {
49
- workspaceDir: "/tmp/klaw-acpx-register-test",
50
- stateDir: "/tmp/klaw-acpx-register-test/state",
51
- config: {},
52
- logger: {
53
- info: vi.fn(),
54
- warn: vi.fn(),
55
- error: vi.fn(),
56
- debug: vi.fn(),
57
- },
58
- };
59
- }
60
-
61
- describe("acpx register runtime service", () => {
62
- afterEach(() => {
63
- runtimeRegistry.clear();
64
- realServiceStartMock.mockClear();
65
- realServiceStopMock.mockClear();
66
- createRealServiceMock.mockClear();
67
- restoreEnv();
68
- });
69
-
70
- it("starts the real service by default while leaving probe policy to the inner service", async () => {
71
- delete process.env.KLAW_SKIP_ACPX_RUNTIME;
72
- const ctx = createServiceContext();
73
- const service = createAcpxRuntimeService({
74
- pluginConfig: { timeoutSeconds: 10 },
75
- });
76
-
77
- await service.start(ctx as never);
78
-
79
- expect(createRealServiceMock).toHaveBeenCalledWith({
80
- pluginConfig: { timeoutSeconds: 10 },
81
- });
82
- expect(realServiceStartMock).toHaveBeenCalledWith(ctx);
83
- expect(runtimeRegistry.get("acpx")?.runtime).toBe(realRuntime);
84
-
85
- await service.stop?.(ctx as never);
86
-
87
- expect(realServiceStopMock).toHaveBeenCalledWith(ctx);
88
- expect(runtimeRegistry.get("acpx")).toBeUndefined();
89
- });
90
-
91
- it("keeps the explicit runtime skip env as the only outer startup skip", async () => {
92
- process.env.KLAW_SKIP_ACPX_RUNTIME = "1";
93
- const ctx = createServiceContext();
94
- const service = createAcpxRuntimeService();
95
-
96
- await service.start(ctx as never);
97
-
98
- expect(createRealServiceMock).not.toHaveBeenCalled();
99
- expect(runtimeRegistry.get("acpx")).toBeUndefined();
100
- expect(ctx.logger.info).toHaveBeenCalledWith(
101
- "skipping embedded acpx runtime backend (KLAW_SKIP_ACPX_RUNTIME=1)",
102
- );
103
- });
104
- });
@@ -1,86 +0,0 @@
1
- import {
2
- getAcpRuntimeBackend,
3
- unregisterAcpRuntimeBackend,
4
- type AcpRuntime,
5
- } from "klaw/plugin-sdk/acp-runtime-backend";
6
- import type { KlawPluginService, KlawPluginServiceContext } from "klaw/plugin-sdk/core";
7
-
8
- const ACPX_BACKEND_ID = "acpx";
9
-
10
- type RealAcpxServiceModule = typeof import("./src/service.js");
11
- type CreateAcpxRuntimeServiceParams = NonNullable<
12
- Parameters<RealAcpxServiceModule["createAcpxRuntimeService"]>[0]
13
- >;
14
-
15
- type DeferredServiceState = {
16
- ctx: KlawPluginServiceContext | null;
17
- params: CreateAcpxRuntimeServiceParams;
18
- realRuntime: AcpRuntime | null;
19
- realService: KlawPluginService | null;
20
- startPromise: Promise<AcpRuntime> | null;
21
- };
22
-
23
- let serviceModulePromise: Promise<RealAcpxServiceModule> | null = null;
24
-
25
- function loadServiceModule(): Promise<RealAcpxServiceModule> {
26
- serviceModulePromise ??= import("./src/service.js");
27
- return serviceModulePromise;
28
- }
29
-
30
- async function startRealService(state: DeferredServiceState): Promise<AcpRuntime> {
31
- if (state.realRuntime) {
32
- return state.realRuntime;
33
- }
34
- if (!state.ctx) {
35
- throw new Error("ACPX runtime service is not started");
36
- }
37
- state.startPromise ??= (async () => {
38
- const { createAcpxRuntimeService } = await loadServiceModule();
39
- const service = createAcpxRuntimeService(state.params);
40
- state.realService = service;
41
- await service.start(state.ctx as KlawPluginServiceContext);
42
- const backend = getAcpRuntimeBackend(ACPX_BACKEND_ID);
43
- if (!backend?.runtime) {
44
- throw new Error("ACPX runtime service did not register an ACP backend");
45
- }
46
- state.realRuntime = backend.runtime;
47
- return state.realRuntime;
48
- })();
49
- return await state.startPromise;
50
- }
51
-
52
- export function createAcpxRuntimeService(
53
- params: CreateAcpxRuntimeServiceParams = {},
54
- ): KlawPluginService {
55
- const state: DeferredServiceState = {
56
- ctx: null,
57
- params,
58
- realRuntime: null,
59
- realService: null,
60
- startPromise: null,
61
- };
62
-
63
- return {
64
- id: "acpx-runtime",
65
- async start(ctx) {
66
- if (process.env.KLAW_SKIP_ACPX_RUNTIME === "1") {
67
- ctx.logger.info("skipping embedded acpx runtime backend (KLAW_SKIP_ACPX_RUNTIME=1)");
68
- return;
69
- }
70
-
71
- state.ctx = ctx;
72
- await startRealService(state);
73
- },
74
- async stop(ctx) {
75
- if (state.realService) {
76
- await state.realService.stop?.(ctx);
77
- } else {
78
- unregisterAcpRuntimeBackend(ACPX_BACKEND_ID);
79
- }
80
- state.ctx = null;
81
- state.realRuntime = null;
82
- state.realService = null;
83
- state.startPromise = null;
84
- },
85
- };
86
- }
package/runtime-api.ts DELETED
@@ -1,49 +0,0 @@
1
- export type { AcpRuntimeErrorCode } from "klaw/plugin-sdk/acp-runtime-backend";
2
- export {
3
- AcpRuntimeError,
4
- getAcpRuntimeBackend,
5
- tryDispatchAcpReplyHook,
6
- registerAcpRuntimeBackend,
7
- unregisterAcpRuntimeBackend,
8
- } from "klaw/plugin-sdk/acp-runtime-backend";
9
- export type {
10
- AcpRuntime,
11
- AcpRuntimeCapabilities,
12
- AcpRuntimeDoctorReport,
13
- AcpRuntimeEnsureInput,
14
- AcpRuntimeEvent,
15
- AcpRuntimeHandle,
16
- AcpRuntimeStatus,
17
- AcpRuntimeTurn,
18
- AcpRuntimeTurnAttachment,
19
- AcpRuntimeTurnInput,
20
- AcpRuntimeTurnResult,
21
- AcpRuntimeTurnResultError,
22
- AcpSessionUpdateTag,
23
- } from "klaw/plugin-sdk/acp-runtime-backend";
24
- export type {
25
- KlawPluginApi,
26
- KlawPluginConfigSchema,
27
- KlawPluginService,
28
- KlawPluginServiceContext,
29
- PluginLogger,
30
- } from "klaw/plugin-sdk/core";
31
- export type {
32
- PluginHookReplyDispatchContext,
33
- PluginHookReplyDispatchEvent,
34
- PluginHookReplyDispatchResult,
35
- } from "klaw/plugin-sdk/core";
36
- export type {
37
- WindowsSpawnProgram,
38
- WindowsSpawnProgramCandidate,
39
- WindowsSpawnResolution,
40
- } from "klaw/plugin-sdk/windows-spawn";
41
- export {
42
- applyWindowsSpawnProgramPolicy,
43
- materializeWindowsSpawnProgram,
44
- resolveWindowsSpawnProgramCandidate,
45
- } from "klaw/plugin-sdk/windows-spawn";
46
- export {
47
- listKnownProviderAuthEnvVarNames,
48
- omitEnvKeysCaseInsensitive,
49
- } from "klaw/plugin-sdk/provider-env-vars";
package/setup-api.ts DELETED
@@ -1,18 +0,0 @@
1
- import { definePluginEntry } from "klaw/plugin-sdk/plugin-entry";
2
- import { normalizeLowercaseStringOrEmpty } from "klaw/plugin-sdk/string-coerce-runtime";
3
-
4
- export default definePluginEntry({
5
- id: "acpx",
6
- name: "ACPX Setup",
7
- description: "Lightweight ACPX setup hooks",
8
- register(api) {
9
- api.registerAutoEnableProbe(({ config }) => {
10
- const backendRaw = normalizeLowercaseStringOrEmpty(config.acp?.backend);
11
- const configured =
12
- config.acp?.enabled === true ||
13
- config.acp?.dispatch?.enabled === true ||
14
- backendRaw === "acpx";
15
- return configured && (!backendRaw || backendRaw === "acpx") ? "ACP runtime configured" : null;
16
- });
17
- },
18
- });
@@ -1,65 +0,0 @@
1
- declare module "acpx/runtime" {
2
- export const ACPX_BACKEND_ID: string;
3
-
4
- export type AcpRuntimeDoctorReport = import("../runtime-api.js").AcpRuntimeDoctorReport;
5
- export type AcpRuntimeEnsureInput = import("../runtime-api.js").AcpRuntimeEnsureInput;
6
- export type AcpRuntimeEvent = import("../runtime-api.js").AcpRuntimeEvent;
7
- export type AcpRuntimeHandle = import("../runtime-api.js").AcpRuntimeHandle;
8
- export type AcpRuntimeCapabilities = import("../runtime-api.js").AcpRuntimeCapabilities;
9
- export type AcpRuntimeStatus = import("../runtime-api.js").AcpRuntimeStatus;
10
- export type AcpRuntimeTurn = import("../runtime-api.js").AcpRuntimeTurn;
11
- export type AcpRuntimeTurnInput = import("../runtime-api.js").AcpRuntimeTurnInput;
12
- export type AcpRuntimeTurnResult = import("../runtime-api.js").AcpRuntimeTurnResult;
13
-
14
- export type AcpAgentRegistry = {
15
- resolve(agent: string): string | undefined;
16
- list(): string[];
17
- };
18
-
19
- export type AcpSessionRecord = Record<string, unknown>;
20
-
21
- export type AcpSessionStore = {
22
- load(sessionId: string): Promise<AcpSessionRecord | undefined>;
23
- save(record: AcpSessionRecord): Promise<void>;
24
- };
25
-
26
- export type AcpRuntimeOptions = {
27
- cwd: string;
28
- sessionStore: AcpSessionStore;
29
- agentRegistry: AcpAgentRegistry;
30
- probeAgent?: string;
31
- mcpServers?: unknown;
32
- permissionMode?: unknown;
33
- nonInteractivePermissions?: unknown;
34
- timeoutMs?: number;
35
- probeAgent?: string;
36
- };
37
-
38
- export class AcpxRuntime {
39
- constructor(options: AcpRuntimeOptions, testOptions?: unknown);
40
- isHealthy(): boolean;
41
- probeAvailability(): Promise<void>;
42
- doctor(): Promise<AcpRuntimeDoctorReport>;
43
- ensureSession(input: AcpRuntimeEnsureInput): Promise<AcpRuntimeHandle>;
44
- startTurn(input: AcpRuntimeTurnInput): AcpRuntimeTurn;
45
- runTurn(input: AcpRuntimeTurnInput): AsyncIterable<AcpRuntimeEvent>;
46
- getCapabilities(input?: {
47
- handle?: AcpRuntimeHandle;
48
- }): AcpRuntimeCapabilities | Promise<AcpRuntimeCapabilities>;
49
- getStatus(input: { handle: AcpRuntimeHandle; signal?: AbortSignal }): Promise<AcpRuntimeStatus>;
50
- setMode(input: { handle: AcpRuntimeHandle; mode: string }): Promise<void>;
51
- setConfigOption(input: { handle: AcpRuntimeHandle; key: string; value: string }): Promise<void>;
52
- cancel(input: { handle: AcpRuntimeHandle; reason?: string }): Promise<void>;
53
- close(input: {
54
- handle: AcpRuntimeHandle;
55
- reason?: string;
56
- discardPersistentState?: boolean;
57
- }): Promise<void>;
58
- }
59
-
60
- export function createAcpRuntime(...args: unknown[]): AcpxRuntime;
61
- export function createAgentRegistry(params: { overrides?: unknown }): AcpAgentRegistry;
62
- export function createFileSessionStore(params: { stateDir: string }): AcpSessionStore;
63
- export function decodeAcpxRuntimeHandleState(...args: unknown[]): unknown;
64
- export function encodeAcpxRuntimeHandleState(...args: unknown[]): unknown;
65
- }