@wrongstack/acp 0.284.1 → 0.285.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/dist/agent/index.d.ts +13 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/{wrongstack-acp-agent-nzrqmJnc.d.ts → agent/protocol-handler.d.ts} +26 -75
- package/dist/agent/protocol-handler.d.ts.map +1 -0
- package/dist/{server-agent-turn-C3U0lhA-.d.ts → agent/server-agent-turn.d.ts} +8 -63
- package/dist/agent/server-agent-turn.d.ts.map +1 -0
- package/dist/agent/session-store.d.ts +53 -0
- package/dist/agent/session-store.d.ts.map +1 -0
- package/dist/agent/stdio-transport.d.ts +82 -0
- package/dist/agent/stdio-transport.d.ts.map +1 -0
- package/dist/{tools-registry-D2xdbzN7.d.ts → agent/tools-registry.d.ts} +4 -7
- package/dist/agent/tools-registry.d.ts.map +1 -0
- package/dist/agent/wrongstack-acp-agent.d.ts +58 -0
- package/dist/agent/wrongstack-acp-agent.d.ts.map +1 -0
- package/dist/agent/ws-bridge-transport.d.ts +37 -0
- package/dist/agent/ws-bridge-transport.d.ts.map +1 -0
- package/dist/agent.d.ts +1 -45
- package/dist/agent.js +21 -11
- package/dist/agent.js.map +7 -1
- package/dist/client/acp-session.d.ts +349 -0
- package/dist/client/acp-session.d.ts.map +1 -0
- package/dist/client/file-server.d.ts +44 -0
- package/dist/client/file-server.d.ts.map +1 -0
- package/dist/client/index.d.ts +12 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/permission.d.ts +45 -0
- package/dist/client/permission.d.ts.map +1 -0
- package/dist/client/terminal-server.d.ts +54 -0
- package/dist/client/terminal-server.d.ts.map +1 -0
- package/dist/{index-DEEYyEpu.d.ts → client/tool-translator.d.ts} +17 -8
- package/dist/client/tool-translator.d.ts.map +1 -0
- package/dist/client/websocket-transport.d.ts +40 -0
- package/dist/client/websocket-transport.d.ts.map +1 -0
- package/dist/client.d.ts +1 -5
- package/dist/client.js +36 -17
- package/dist/client.js.map +7 -1
- package/dist/index.d.ts +43 -457
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +126 -67
- package/dist/index.js.map +7 -1
- package/dist/integration/acp-bench.d.ts +68 -0
- package/dist/integration/acp-bench.d.ts.map +1 -0
- package/dist/integration/acp-subagent-runner.d.ts +194 -0
- package/dist/integration/acp-subagent-runner.d.ts.map +1 -0
- package/dist/integration/ensemble-runner.d.ts +147 -0
- package/dist/integration/ensemble-runner.d.ts.map +1 -0
- package/dist/integration/run-one-acp-task.d.ts +29 -0
- package/dist/integration/run-one-acp-task.d.ts.map +1 -0
- package/dist/registry/acp-registry-fetch.d.ts +86 -0
- package/dist/registry/acp-registry-fetch.d.ts.map +1 -0
- package/dist/registry/agents.catalog.d.ts +46 -0
- package/dist/registry/agents.catalog.d.ts.map +1 -0
- package/dist/registry/ensemble-registry.d.ts +104 -0
- package/dist/registry/ensemble-registry.d.ts.map +1 -0
- package/dist/sdk.d.ts +41 -12
- package/dist/sdk.d.ts.map +1 -0
- package/dist/sdk.js +142 -72
- package/dist/sdk.js.map +7 -1
- package/dist/types/acp-messages.d.ts +133 -0
- package/dist/types/acp-messages.d.ts.map +1 -0
- package/dist/types/acp-v1.d.ts +476 -0
- package/dist/types/acp-v1.d.ts.map +1 -0
- package/dist/win32-cmd.d.ts +7 -0
- package/dist/win32-cmd.d.ts.map +1 -0
- package/dist/wrongstack-acp-agent.d.ts +1 -3
- package/dist/wrongstack-acp-agent.js +11 -9
- package/dist/wrongstack-acp-agent.js.map +7 -1
- package/package.json +4 -4
- package/dist/acp-subagent-runner-BAlo23L-.d.ts +0 -644
- package/dist/acp-v1-BxskPsdo.d.ts +0 -520
- package/dist/terminal-server-P9KpMZTT.d.ts +0 -99
package/dist/index.d.ts
CHANGED
|
@@ -1,458 +1,44 @@
|
|
|
1
|
-
export { n as ACPCancelParams, o as ACPCapabilities, p as ACPChildProcess, A as ACPClientTransport, q as ACPError, r as ACPImageContent, s as ACPInitializeParams, t as ACPInputSchema, b as ACPMessage, u as ACPNotification, v as ACPPlanContent, w as ACPPlanStep, x as ACPProgressContent, y as ACPRequest, z as ACPResourceContent, B as ACPResponse, D as ACPSessionInfo, E as ACPSessionMode, F as ACPTextContent, G as ACPToolCallRequest, H as ACPToolCallResponse, I as ACPToolDefinition, c as ACPToolList, d as ACPToolResult, a as AgentServerTransport, J as ClientTransport, K as ClientTransportOptions, L as ContentBlock, S as StdioTransport } from './acp-v1-BxskPsdo.js';
|
|
2
|
-
export { A as ACPToolsRegistry } from './tools-registry-D2xdbzN7.js';
|
|
3
|
-
export { A as ACPProtocolHandler, e as WrongStackACPServer, f as WrongStackACPServerOptions } from './wrongstack-acp-agent-nzrqmJnc.js';
|
|
4
|
-
import { i as ACPSubagentRunnerOptions, b as ACPProgressEvent } from './acp-subagent-runner-BAlo23L-.js';
|
|
5
|
-
export { A as ACPCapturedDiff, a as ACPCapturedToolCall, c as ACPProgressHandler, d as ACPSession, e as ACPSessionError, f as ACPSessionErrorKind, g as ACPSessionOptions, h as ACPSessionRunResult, j as ACP_AGENT_COMMANDS, k as AcpAgentCommandOverrides, B as AcpLiveCatalog, l as AcpProbeResult, P as PermissionPolicy, m as PermissionRequest, C as ProbeAcpAgentsOptions, D as REGISTRY_ID_ALIASES, R as RunOneAcpTaskOptions, n as RunOneAcpTaskResult, W as WebSocketClientTransport, o as WebSocketClientTransportOptions, p as audioContent, q as defaultPermissionPolicy, r as imageContent, s as makeACPSubagentRunner, t as makeACPSubagentRunnerWithStop, u as makePermissionPolicy, v as probeAcpAgent, E as probeAcpAgents, w as readOnlyPermissionPolicy, x as resolveAcpAgentCommand, y as runOneAcpTask, z as textContent } from './acp-subagent-runner-BAlo23L-.js';
|
|
6
|
-
export { T as ToolTranslator, a as ToolTranslatorOptions } from './index-DEEYyEpu.js';
|
|
7
|
-
export { F as FileServer, a as FileServerOptions, b as FsError, c as FsErrorCode, R as ReadFileParams, T as TerminalServer, d as TerminalServerOptions, W as WriteFileParams } from './terminal-server-P9KpMZTT.js';
|
|
8
|
-
import 'node:events';
|
|
9
|
-
import '@wrongstack/core';
|
|
10
|
-
|
|
11
|
-
/** Vendor classification — used to filter the catalog by family. */
|
|
12
|
-
type ACPAgentVendor = 'anthropic' | 'google' | 'openai' | 'github' | 'community';
|
|
13
|
-
/** How the agent is integrated into ACP. */
|
|
14
|
-
type ACPIntegration =
|
|
15
|
-
/** Agent ships with a documented ACP entry flag. */
|
|
16
|
-
'native'
|
|
17
|
-
/** Runs through Zed's SDK adapter or similar wrapper. */
|
|
18
|
-
| 'adapter'
|
|
19
|
-
/** Community-maintained wrapper (e.g. @agentify/cline, bub-acp-server). */
|
|
20
|
-
| 'community'
|
|
21
|
-
/** Listed by ACP but no public ACP entry yet; may not work. */
|
|
22
|
-
| 'experimental';
|
|
23
|
-
/** Static metadata for a known agent. */
|
|
24
|
-
interface ACPAgentDescriptor {
|
|
25
|
-
/** Stable identifier used as the spawn key. Lowercase, hyphenated. */
|
|
26
|
-
id: string;
|
|
27
|
-
/** Display name shown in the TUI / WebUI / CLI. */
|
|
28
|
-
displayName: string;
|
|
29
|
-
vendor: ACPAgentVendor;
|
|
30
|
-
/** argv to detect installation. Exits 0 with stdout on success. */
|
|
31
|
-
probe: {
|
|
32
|
-
command: string;
|
|
33
|
-
args?: readonly string[];
|
|
34
|
-
};
|
|
35
|
-
/** argv to start the agent in ACP mode. */
|
|
36
|
-
acp: {
|
|
37
|
-
command: string;
|
|
38
|
-
args?: readonly string[];
|
|
39
|
-
env?: Record<string, string>;
|
|
40
|
-
};
|
|
41
|
-
/** Capability hints — used to fail fast when the binary predates ACP. */
|
|
42
|
-
supports: {
|
|
43
|
-
loadSession: boolean;
|
|
44
|
-
promptImages: boolean;
|
|
45
|
-
terminal: boolean;
|
|
46
|
-
fs: boolean;
|
|
47
|
-
};
|
|
48
|
-
integration: ACPIntegration;
|
|
49
|
-
/** Documentation URL — shown in `wstack acp list` and the ensemble UI. */
|
|
50
|
-
docs: string;
|
|
51
|
-
}
|
|
52
|
-
/** A descriptor with its runtime detection result attached. */
|
|
53
|
-
interface DetectedAgent extends ACPAgentDescriptor {
|
|
54
|
-
installed: boolean;
|
|
55
|
-
/** Absolute path to the binary, if discovered. */
|
|
56
|
-
path?: string;
|
|
57
|
-
/** Captured version string, if `probe` produced one. */
|
|
58
|
-
version?: string;
|
|
59
|
-
/**
|
|
60
|
-
* When `installed: false`, a short reason — typically "binary not
|
|
61
|
-
* found", "binary predates ACP", or "probe timed out".
|
|
62
|
-
*/
|
|
63
|
-
reason?: string;
|
|
64
|
-
}
|
|
65
|
-
/** A single probe failure — never thrown, always returned. */
|
|
66
|
-
interface ProbeFailure {
|
|
67
|
-
ok: false;
|
|
68
|
-
reason: string;
|
|
69
|
-
/** Wall-clock duration of the failed probe in ms. */
|
|
70
|
-
durationMs: number;
|
|
71
|
-
}
|
|
72
|
-
interface ProbeSuccess {
|
|
73
|
-
ok: true;
|
|
74
|
-
version: string;
|
|
75
|
-
path?: string;
|
|
76
|
-
durationMs: number;
|
|
77
|
-
}
|
|
78
|
-
type ProbeResult = ProbeSuccess | ProbeFailure;
|
|
79
|
-
interface EnsembleRegistryOptions {
|
|
80
|
-
/** Override the catalog (mostly for tests). */
|
|
81
|
-
catalog?: readonly ACPAgentDescriptor[];
|
|
82
|
-
/** Override the probe timeout (ms). */
|
|
83
|
-
probeTimeoutMs?: number;
|
|
84
|
-
/** Inject a custom probe function (used by tests). */
|
|
85
|
-
probeFn?: (descriptor: ACPAgentDescriptor) => Promise<ProbeResult>;
|
|
86
|
-
}
|
|
87
|
-
declare class EnsembleRegistry {
|
|
88
|
-
private readonly catalog;
|
|
89
|
-
private readonly timeoutMs;
|
|
90
|
-
private readonly probe;
|
|
91
|
-
private cache;
|
|
92
|
-
constructor(options?: EnsembleRegistryOptions);
|
|
93
|
-
/** Return the full catalog (no probe), in catalog order. */
|
|
94
|
-
listAll(): readonly ACPAgentDescriptor[];
|
|
95
|
-
/**
|
|
96
|
-
* Probe every catalog entry in parallel and return the detection
|
|
97
|
-
* results. Results are cached for `PROBE_CACHE_MS`.
|
|
98
|
-
*
|
|
99
|
-
* Probes are dispatched with bounded concurrency (`MAX_PARALLEL_PROBES`)
|
|
100
|
-
* so cold-start lists do not spawn `catalog.length` subprocesses at
|
|
101
|
-
* once — which is especially wasteful on Windows shells and on hosts
|
|
102
|
-
* with large agent catalogs. The output order still matches
|
|
103
|
-
* `this.catalog` so callers can index by position.
|
|
104
|
-
*/
|
|
105
|
-
list(): Promise<readonly DetectedAgent[]>;
|
|
106
|
-
/** Probe a single descriptor. Always returns a `DetectedAgent`. */
|
|
107
|
-
detect(desc: ACPAgentDescriptor): Promise<DetectedAgent>;
|
|
108
|
-
/** Invalidate the per-process cache. */
|
|
109
|
-
invalidate(): void;
|
|
110
|
-
/** Convenience: just the installed agents. */
|
|
111
|
-
listInstalled(): Promise<readonly DetectedAgent[]>;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
1
|
/**
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
declare function findAgentDescriptor(id: string): ACPAgentDescriptor | undefined;
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* Official ACP registry fetcher.
|
|
162
|
-
*
|
|
163
|
-
* The Agent Client Protocol maintains a canonical, hourly-updated registry of
|
|
164
|
-
* ACP-supporting agents at https://github.com/agentclientprotocol/registry,
|
|
165
|
-
* published as a single JSON document on a CDN. This module fetches that
|
|
166
|
-
* document and maps each entry to our `ACPAgentDescriptor` shape so the live
|
|
167
|
-
* list can supersede the bundled static `AGENTS_CATALOG` (which remains the
|
|
168
|
-
* offline fallback).
|
|
169
|
-
*
|
|
170
|
-
* Distribution → spawn-command mapping (per the registry FORMAT.md):
|
|
171
|
-
* - npx: { package, args } → `npx -y <package> <args>`
|
|
172
|
-
* - uvx: { package, args } → `uvx <package> <args>`
|
|
173
|
-
* - binary: { "<os>-<arch>": { cmd, args, env } }
|
|
174
|
-
* → `<basename(cmd)> <args>` for THIS host
|
|
175
|
-
*
|
|
176
|
-
* Binary entries reference a downloadable archive we do NOT fetch; we map the
|
|
177
|
-
* platform `cmd` to its basename so an already-installed on-PATH binary (the
|
|
178
|
-
* common case for goose/opencode/cursor) still launches. Agents distributed
|
|
179
|
-
* ONLY as a binary with no current-platform target are dropped (not runnable).
|
|
180
|
-
*
|
|
181
|
-
* Network is never required at runtime: this is invoked by an explicit
|
|
182
|
-
* `wstack acp sync` / `/acp sync`, the result is cached, and resolution falls
|
|
183
|
-
* back to the static catalog when no cache exists.
|
|
184
|
-
*/
|
|
185
|
-
|
|
186
|
-
/** Canonical CDN endpoint for the latest registry snapshot. */
|
|
187
|
-
declare const ACP_REGISTRY_URL = "https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json";
|
|
188
|
-
/** One raw entry from the registry JSON (only the fields we consume). */
|
|
189
|
-
interface RegistryAgentEntry {
|
|
190
|
-
id: string;
|
|
191
|
-
name?: string;
|
|
192
|
-
version?: string;
|
|
193
|
-
description?: string;
|
|
194
|
-
repository?: string;
|
|
195
|
-
website?: string;
|
|
196
|
-
authors?: string[];
|
|
197
|
-
distribution?: {
|
|
198
|
-
npx?: {
|
|
199
|
-
package: string;
|
|
200
|
-
args?: string[];
|
|
201
|
-
};
|
|
202
|
-
uvx?: {
|
|
203
|
-
package: string;
|
|
204
|
-
args?: string[];
|
|
205
|
-
};
|
|
206
|
-
binary?: Record<string, {
|
|
207
|
-
archive?: string;
|
|
208
|
-
cmd: string;
|
|
209
|
-
args?: string[];
|
|
210
|
-
env?: Record<string, string>;
|
|
211
|
-
}>;
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
interface FetchAcpRegistryResult {
|
|
215
|
-
/** ISO timestamp the snapshot was fetched. */
|
|
216
|
-
fetchedAt: string;
|
|
217
|
-
/** Mapped, runnable descriptors (entries we could not map are dropped). */
|
|
218
|
-
agents: ACPAgentDescriptor[];
|
|
219
|
-
}
|
|
220
|
-
interface FetchAcpRegistryOptions {
|
|
221
|
-
/** Override the endpoint (tests / mirrors). */
|
|
222
|
-
url?: string | undefined;
|
|
223
|
-
/** Abort the fetch from the caller. */
|
|
224
|
-
signal?: AbortSignal | undefined;
|
|
225
|
-
/** Hard timeout in ms (default 15s). Layered under any caller signal. */
|
|
226
|
-
timeoutMs?: number | undefined;
|
|
227
|
-
/** ISO timestamp to stamp the result with (tests pass a fixed value). */
|
|
228
|
-
now?: string | undefined;
|
|
229
|
-
/** Platform key for binary selection (tests). Defaults to this host. */
|
|
230
|
-
platformKey?: string | undefined;
|
|
231
|
-
}
|
|
232
|
-
/** Map Node's platform/arch to the registry's `<os>-<arch>` key form. */
|
|
233
|
-
declare function currentPlatformKey(): string;
|
|
234
|
-
/**
|
|
235
|
-
* Map one registry entry to an `ACPAgentDescriptor`, or `null` if it carries
|
|
236
|
-
* no distribution runnable on this host. Pure — no I/O.
|
|
237
|
-
*/
|
|
238
|
-
declare function mapRegistryEntry(entry: RegistryAgentEntry, platformKey?: string): ACPAgentDescriptor | null;
|
|
239
|
-
/**
|
|
240
|
-
* Fetch the live registry and return mapped descriptors. Throws on network /
|
|
241
|
-
* parse failure so the caller (`wstack acp sync`) can surface it; callers that
|
|
242
|
-
* want graceful degradation use the cached/static fallback instead.
|
|
243
|
-
*/
|
|
244
|
-
declare function fetchAcpRegistry(opts?: FetchAcpRegistryOptions): Promise<FetchAcpRegistryResult>;
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Ensemble runner — fan a single task out to multiple ACP agents in parallel.
|
|
248
|
-
*
|
|
249
|
-
* This is the engine behind both:
|
|
250
|
-
* - `wstack acp parallel <csv> <task>` (CLI subcommand)
|
|
251
|
-
* - `/ensemble <csv> <task>` (TUI slash command)
|
|
252
|
-
*
|
|
253
|
-
* The CLI wraps `runEnsemble` with a plain-text renderer. The TUI can
|
|
254
|
-
* call it directly and format the result however it likes (text dump,
|
|
255
|
-
* per-agent tabbed panels, etc.).
|
|
256
|
-
*
|
|
257
|
-
* Design notes
|
|
258
|
-
* ────────────
|
|
259
|
-
* - Skipping is up-front. We probe the registry once, then run only
|
|
260
|
-
* the installed agents. This keeps the "no installed agents" path
|
|
261
|
-
* cheap (no spawn attempts) and the error message clear.
|
|
262
|
-
* - All agents run concurrently via `Promise.allSettled`. A single
|
|
263
|
-
* failed agent doesn't kill the others; the call returns once every
|
|
264
|
-
* agent has either completed or crashed.
|
|
265
|
-
* - Per-agent errors are captured as structured `{kind, message}`
|
|
266
|
-
* objects, not thrown. The aggregated result is one `EnsembleResult`
|
|
267
|
-
* with per-agent outcomes. Callers can render it as they please.
|
|
268
|
-
* - The `signal` option propagates as the parent AbortSignal for each
|
|
269
|
-
* `SubagentRunner`. Aborting cancels all in-flight agents.
|
|
270
|
-
* - Idempotent cleanup: each agent's `stop()` is called in a
|
|
271
|
-
* `finally`, so a throw in the body still tears the child down.
|
|
272
|
-
*/
|
|
273
|
-
|
|
274
|
-
/** Live per-agent progress callback for an ensemble run. */
|
|
275
|
-
type EnsembleProgressHandler = (agentId: string, event: ACPProgressEvent) => void;
|
|
276
|
-
/**
|
|
277
|
-
* Per-agent outcome from an ensemble run.
|
|
278
|
-
* `status === 'skipped'` carries a `reason`; the other statuses carry
|
|
279
|
-
* either a result or an error envelope.
|
|
280
|
-
*/
|
|
281
|
-
interface EnsembleAgentResult {
|
|
282
|
-
agentId: string;
|
|
283
|
-
status: 'success' | 'failed' | 'skipped' | 'cancelled';
|
|
284
|
-
/** The agent's text result. Present for `status === 'success'`. */
|
|
285
|
-
result?: string | undefined;
|
|
286
|
-
/** Structured error. Present for `status === 'failed' | 'cancelled'`. */
|
|
287
|
-
error?: {
|
|
288
|
-
kind: string;
|
|
289
|
-
message: string;
|
|
290
|
-
} | undefined;
|
|
291
|
-
/** Why the agent was skipped (not installed, unknown id, etc.). */
|
|
292
|
-
reason?: string | undefined;
|
|
293
|
-
/** Wall-clock time spent on this agent. 0 for skipped. */
|
|
294
|
-
durationMs: number;
|
|
295
|
-
/** Agent-reported iteration count (1 per ACP turn). */
|
|
296
|
-
iterations: number;
|
|
297
|
-
/** Agent-reported tool call count (currently 0 for ACP). */
|
|
298
|
-
toolCalls: number;
|
|
299
|
-
}
|
|
300
|
-
/** Aggregate result of one ensemble run. */
|
|
301
|
-
interface EnsembleResult {
|
|
302
|
-
/** The task that was dispatched. */
|
|
303
|
-
task: string;
|
|
304
|
-
/** Agent ids as the user provided them, after dedup. */
|
|
305
|
-
requested: string[];
|
|
306
|
-
/** Per-agent outcomes, in the order they were requested. */
|
|
307
|
-
results: EnsembleAgentResult[];
|
|
308
|
-
/** Roll-up of the per-agent statuses. */
|
|
309
|
-
summary: {
|
|
310
|
-
succeeded: number;
|
|
311
|
-
failed: number;
|
|
312
|
-
skipped: number;
|
|
313
|
-
cancelled: number;
|
|
314
|
-
};
|
|
315
|
-
/** Total wall-clock time of the run (longest agent). */
|
|
316
|
-
totalDurationMs: number;
|
|
317
|
-
}
|
|
318
|
-
/** Sync command resolver: id → command, or null if unknown. */
|
|
319
|
-
type EnsembleCmdResolver = (id: string) => ACPSubagentRunnerOptions | null;
|
|
320
|
-
interface EnsembleRunnerOptions {
|
|
321
|
-
/**
|
|
322
|
-
* Comma-separated agent ids. Whitespace, empty entries, and
|
|
323
|
-
* duplicates are filtered out. Order is preserved.
|
|
324
|
-
*/
|
|
325
|
-
agentIds: string;
|
|
326
|
-
/** The task description forwarded verbatim to each agent. */
|
|
327
|
-
task: string;
|
|
328
|
-
/**
|
|
329
|
-
* Per-agent hard timeout in ms. Defaults to 5 minutes; the
|
|
330
|
-
* `SubagentRunner` itself layers a turn-level timeout under this.
|
|
331
|
-
*/
|
|
332
|
-
timeoutMs?: number;
|
|
333
|
-
/**
|
|
334
|
-
* Override the registry used for the install probe. Defaults to
|
|
335
|
-
* `new EnsembleRegistry()`. Useful for tests.
|
|
336
|
-
*/
|
|
337
|
-
registry?: EnsembleRegistry;
|
|
338
|
-
/**
|
|
339
|
-
* Override the command resolver. Defaults to
|
|
340
|
-
* `defaultEnsembleCmdResolver` (legacy `ACP_AGENT_COMMANDS` map
|
|
341
|
-
* with catalog fallback via `findAgentDescriptor`). Useful for
|
|
342
|
-
* tests that don't want the real `makeACPSubagentRunnerWithStop`.
|
|
343
|
-
*/
|
|
344
|
-
resolveCmd?: EnsembleCmdResolver;
|
|
345
|
-
/**
|
|
346
|
-
* Cancellation signal. Aborting stops all in-flight agents via the
|
|
347
|
-
* `SubagentRunContext.signal` they receive.
|
|
348
|
-
*/
|
|
349
|
-
signal?: AbortSignal | undefined;
|
|
350
|
-
/**
|
|
351
|
-
* Live progress callback. Invoked for every streamed update from every
|
|
352
|
-
* agent, tagged with the agent id so the caller can render interleaved
|
|
353
|
-
* progress (e.g. `[gemini-cli] edit foo.ts`).
|
|
354
|
-
*/
|
|
355
|
-
onProgress?: EnsembleProgressHandler | undefined;
|
|
356
|
-
/**
|
|
357
|
-
* Maximum number of agents to launch concurrently. Defaults to
|
|
358
|
-
* `DEFAULT_MAX_CONCURRENCY` (4). Set to 1 for serial execution;
|
|
359
|
-
* values larger than the runnable count are clamped down. Bounded
|
|
360
|
-
* fan-out keeps simultaneous ACP subprocess / WebSocket counts
|
|
361
|
-
* manageable when an ensemble has many members.
|
|
362
|
-
*/
|
|
363
|
-
maxConcurrency?: number | undefined;
|
|
364
|
-
}
|
|
365
|
-
/**
|
|
366
|
-
* Default command resolver — delegates to `resolveAcpAgentCommand`, so the
|
|
367
|
-
* catalog's corrected invocations win over the stale legacy map (the legacy
|
|
368
|
-
* map is now only a last-resort fallback). Returns `null` for unknown ids.
|
|
369
|
-
*/
|
|
370
|
-
declare const defaultEnsembleCmdResolver: EnsembleCmdResolver;
|
|
371
|
-
/**
|
|
372
|
-
* Fan a task out to multiple ACP agents concurrently.
|
|
373
|
-
*
|
|
374
|
-
* Returns once every requested agent has either completed, failed, or
|
|
375
|
-
* been cancelled. Skipped agents (not installed, unknown id) are
|
|
376
|
-
* reported with `status: 'skipped'` and don't block the result.
|
|
377
|
-
*
|
|
378
|
-
* The function is a pure orchestrator — it does NOT render output. The
|
|
379
|
-
* caller decides how to format the `EnsembleResult`.
|
|
380
|
-
*/
|
|
381
|
-
declare function runEnsemble(opts: EnsembleRunnerOptions): Promise<EnsembleResult>;
|
|
382
|
-
/**
|
|
383
|
-
* Render an `EnsembleResult` as a plain-text block. Useful as the
|
|
384
|
-
* default for the CLI; the TUI can call this or build a richer view.
|
|
385
|
-
*
|
|
386
|
-
* The format mirrors the output the `wstack acp parallel` subcommand
|
|
387
|
-
* emits, so existing scripts that parse the CLI's output keep working.
|
|
388
|
-
*/
|
|
389
|
-
declare function renderEnsembleText(result: EnsembleResult): string;
|
|
390
|
-
|
|
391
|
-
type AcpBenchStatus = 'pass' | 'partial' | 'fail' | 'skipped';
|
|
392
|
-
interface AcpBenchCheck {
|
|
393
|
-
name: 'handshake' | 'prompt' | 'marker' | 'fs';
|
|
394
|
-
ok: boolean;
|
|
395
|
-
detail?: string | undefined;
|
|
396
|
-
}
|
|
397
|
-
interface AcpBenchAgentResult {
|
|
398
|
-
agentId: string;
|
|
399
|
-
status: AcpBenchStatus;
|
|
400
|
-
checks: AcpBenchCheck[];
|
|
401
|
-
/** Agent metadata from the initialize handshake. */
|
|
402
|
-
agentInfo?: {
|
|
403
|
-
name: string;
|
|
404
|
-
title?: string | undefined;
|
|
405
|
-
version: string;
|
|
406
|
-
} | undefined;
|
|
407
|
-
handshakeMs?: number | undefined;
|
|
408
|
-
promptMs?: number | undefined;
|
|
409
|
-
/** First line of the agent's reply (trimmed), for the report. */
|
|
410
|
-
sample?: string | undefined;
|
|
411
|
-
/** Why the agent failed / was skipped. */
|
|
412
|
-
reason?: string | undefined;
|
|
413
|
-
durationMs: number;
|
|
414
|
-
}
|
|
415
|
-
interface AcpBenchResult {
|
|
416
|
-
results: AcpBenchAgentResult[];
|
|
417
|
-
summary: {
|
|
418
|
-
pass: number;
|
|
419
|
-
partial: number;
|
|
420
|
-
fail: number;
|
|
421
|
-
skipped: number;
|
|
422
|
-
};
|
|
423
|
-
totalDurationMs: number;
|
|
424
|
-
}
|
|
425
|
-
/** Resolve an agent id to its spawn command (null = unknown). */
|
|
426
|
-
type AcpBenchCmdResolver = (id: string) => ACPSubagentRunnerOptions | null;
|
|
427
|
-
interface AcpBenchOptions {
|
|
428
|
-
/** Agent ids to bench. */
|
|
429
|
-
agentIds: string[];
|
|
430
|
-
/** Resolve each id → spawn command (wire overrides + synced registry here). */
|
|
431
|
-
resolveCmd: AcpBenchCmdResolver;
|
|
432
|
-
/** FS sandbox + cwd for each agent. Defaults to `process.cwd()`. */
|
|
433
|
-
projectRoot?: string | undefined;
|
|
434
|
-
/** Per-agent hard timeout (handshake + each prompt). Default 60s. */
|
|
435
|
-
timeoutMs?: number | undefined;
|
|
436
|
-
/** Also verify the `fs/read_text_file` callback channel. Default false. */
|
|
437
|
-
checkFs?: boolean | undefined;
|
|
438
|
-
/** Max agents benched concurrently. Default 2 (each runs a real LLM turn). */
|
|
439
|
-
concurrency?: number | undefined;
|
|
440
|
-
/** Cancellation. Aborts the in-flight agent and skips the rest. */
|
|
441
|
-
signal?: AbortSignal | undefined;
|
|
442
|
-
/** Live per-agent status callback for the UI. */
|
|
443
|
-
onProgress?: ((agentId: string, phase: 'start' | 'done', result?: AcpBenchAgentResult) => void) | undefined;
|
|
444
|
-
/** Marker token override (tests). Default is a random per-run token. */
|
|
445
|
-
marker?: string | undefined;
|
|
446
|
-
/** Clock injection (tests). Defaults to `Date.now`. */
|
|
447
|
-
now?: (() => number) | undefined;
|
|
448
|
-
}
|
|
449
|
-
/**
|
|
450
|
-
* Bench a set of ACP agents end-to-end and return a graded report. Unknown
|
|
451
|
-
* ids are reported `skipped`. Bounded concurrency keeps the number of live
|
|
452
|
-
* ACP subprocesses (each running a real model turn) manageable.
|
|
453
|
-
*/
|
|
454
|
-
declare function runAcpBench(opts: AcpBenchOptions): Promise<AcpBenchResult>;
|
|
455
|
-
/** Render an `AcpBenchResult` as a plain-text report. */
|
|
456
|
-
declare function renderAcpBenchText(result: AcpBenchResult): string;
|
|
457
|
-
|
|
458
|
-
export { type ACPAgentDescriptor, type ACPAgentVendor, type ACPIntegration, ACPProgressEvent, ACPSubagentRunnerOptions, ACP_REGISTRY_URL, AGENTS_CATALOG, type AcpBenchAgentResult, type AcpBenchCheck, type AcpBenchCmdResolver, type AcpBenchOptions, type AcpBenchResult, type AcpBenchStatus, type DetectedAgent, type EnsembleAgentResult, type EnsembleCmdResolver, type EnsembleProgressHandler, EnsembleRegistry, type EnsembleRegistryOptions, type EnsembleResult, type EnsembleRunnerOptions, type FetchAcpRegistryOptions, type FetchAcpRegistryResult, type RegistryAgentEntry, currentPlatformKey, defaultEnsembleCmdResolver, fetchAcpRegistry, findAgentDescriptor, mapRegistryEntry, renderAcpBenchText, renderEnsembleText, runAcpBench, runEnsemble };
|
|
2
|
+
* @wrongstack/acp — ACP integration public surface.
|
|
3
|
+
*
|
|
4
|
+
* DIR-2: WrongStack as ACP Server
|
|
5
|
+
* import { WrongStackACPServer } from '@wrongstack/acp/agent';
|
|
6
|
+
*
|
|
7
|
+
* DIR-1: WrongStack as ACP Client
|
|
8
|
+
* import { makeACPSubagentRunner } from '@wrongstack/acp/client';
|
|
9
|
+
*/
|
|
10
|
+
export { StdioTransport } from './agent/stdio-transport.js';
|
|
11
|
+
export type { AgentServerTransport } from './agent/stdio-transport.js';
|
|
12
|
+
export { ACPToolsRegistry } from './agent/tools-registry.js';
|
|
13
|
+
export { ACPProtocolHandler } from './agent/protocol-handler.js';
|
|
14
|
+
export { WrongStackACPServer } from './agent/wrongstack-acp-agent.js';
|
|
15
|
+
export type { WrongStackACPServerOptions } from './agent/wrongstack-acp-agent.js';
|
|
16
|
+
export { ClientTransport } from './agent/stdio-transport.js';
|
|
17
|
+
export type { ClientTransportOptions, ACPChildProcess, ACPClientTransport } from './agent/stdio-transport.js';
|
|
18
|
+
export { WebSocketClientTransport } from './client/websocket-transport.js';
|
|
19
|
+
export type { WebSocketClientTransportOptions } from './client/websocket-transport.js';
|
|
20
|
+
export { ToolTranslator } from './client/tool-translator.js';
|
|
21
|
+
export type { ToolTranslatorOptions } from './client/tool-translator.js';
|
|
22
|
+
export { makeACPSubagentRunner, makeACPSubagentRunnerWithStop } from './integration/acp-subagent-runner.js';
|
|
23
|
+
export type { ACPSubagentRunnerOptions } from './integration/acp-subagent-runner.js';
|
|
24
|
+
export { ACP_AGENT_COMMANDS } from './integration/acp-subagent-runner.js';
|
|
25
|
+
export { resolveAcpAgentCommand, runOneAcpTask, probeAcpAgent, probeAcpAgents, REGISTRY_ID_ALIASES, } from './integration/acp-subagent-runner.js';
|
|
26
|
+
export type { AcpAgentCommandOverrides, AcpLiveCatalog, RunOneAcpTaskOptions, RunOneAcpTaskResult, AcpProbeResult, ProbeAcpAgentsOptions, } from './integration/acp-subagent-runner.js';
|
|
27
|
+
export { AGENTS_CATALOG, findAgentDescriptor } from './registry/agents.catalog.js';
|
|
28
|
+
export { EnsembleRegistry } from './registry/ensemble-registry.js';
|
|
29
|
+
export { ACP_REGISTRY_URL, currentPlatformKey, fetchAcpRegistry, mapRegistryEntry, } from './registry/acp-registry-fetch.js';
|
|
30
|
+
export type { FetchAcpRegistryOptions, FetchAcpRegistryResult, RegistryAgentEntry, } from './registry/acp-registry-fetch.js';
|
|
31
|
+
export type { ACPAgentDescriptor, ACPAgentVendor, ACPIntegration, DetectedAgent, EnsembleRegistryOptions, } from './registry/ensemble-registry.js';
|
|
32
|
+
export { ACPSession, ACPSessionError, textContent, imageContent, audioContent } from './client/acp-session.js';
|
|
33
|
+
export type { ACPSessionOptions, ACPSessionRunResult, ACPSessionErrorKind, ACPProgressEvent, ACPProgressHandler, ACPCapturedToolCall, ACPCapturedDiff, } from './client/acp-session.js';
|
|
34
|
+
export { FileServer, FsError } from './client/file-server.js';
|
|
35
|
+
export type { FileServerOptions, ReadFileParams, WriteFileParams, FsErrorCode } from './client/file-server.js';
|
|
36
|
+
export { TerminalServer } from './client/terminal-server.js';
|
|
37
|
+
export type { TerminalServerOptions } from './client/terminal-server.js';
|
|
38
|
+
export { defaultPermissionPolicy, readOnlyPermissionPolicy, makePermissionPolicy, } from './client/permission.js';
|
|
39
|
+
export type { PermissionPolicy, PermissionRequest } from './client/permission.js';
|
|
40
|
+
export { defaultEnsembleCmdResolver, renderEnsembleText, runEnsemble, type EnsembleAgentResult, type EnsembleCmdResolver, type EnsembleProgressHandler, type EnsembleResult, type EnsembleRunnerOptions, } from './integration/ensemble-runner.js';
|
|
41
|
+
export { runAcpBench, renderAcpBenchText } from './integration/acp-bench.js';
|
|
42
|
+
export type { AcpBenchOptions, AcpBenchResult, AcpBenchAgentResult, AcpBenchCheck, AcpBenchStatus, AcpBenchCmdResolver, } from './integration/acp-bench.js';
|
|
43
|
+
export * from './types/acp-messages.js';
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAC,oBAAoB,EAAC,MAAM,4BAA4B,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