@pwrdrvr/agent-acp 0.16.0 → 0.17.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/chunk-64RRSPSB.js +51 -0
- package/dist/chunk-64RRSPSB.js.map +1 -0
- package/dist/chunk-GCWY5T5H.js +675 -0
- package/dist/chunk-GCWY5T5H.js.map +1 -0
- package/dist/chunk-OFMIS7W6.js +163 -0
- package/dist/chunk-OFMIS7W6.js.map +1 -0
- package/dist/discovery.d.ts +223 -0
- package/dist/discovery.js +32 -0
- package/dist/discovery.js.map +1 -0
- package/dist/index.d.ts +28 -360
- package/dist/index.js +140 -881
- package/dist/index.js.map +1 -1
- package/dist/mcp-server-config.d.ts +40 -0
- package/dist/mcp-server-config.js +9 -0
- package/dist/mcp-server-config.js.map +1 -0
- package/dist/strategies.d.ts +20 -0
- package/dist/strategies.js +25 -0
- package/dist/strategies.js.map +1 -0
- package/dist/strategy-types-C7yw6yQL.d.ts +82 -0
- package/package.json +14 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import { Client
|
|
1
|
+
import { Client } from '@agentclientprotocol/sdk';
|
|
2
2
|
import { Logger, AgentBackend, NormalizedThreadEvent, Unsubscribe, AgentBackendToolCallHandler, AgentBackendApprovalHandler, AgentStartThreadOptions, AgentBackendStartThreadResult, AgentStartTurnOptions, NormalizedTokenUsage, NormalizedToolCall } from '@pwrdrvr/agent-core';
|
|
3
3
|
import { JsonRpcId } from '@pwrdrvr/agent-transport';
|
|
4
|
+
import { a as AcpAgentStrategy, A as AcpAgentQuirks } from './strategy-types-C7yw6yQL.js';
|
|
5
|
+
export { b as AcpDiscoveryProbe, c as AcpSpawnSpec, L as LocalAcpAgentProbe, d as LocalAcpProbeOptions, e as LocalAcpProbeResult, f as buildAcpBackendId, g as defaultQuirks } from './strategy-types-C7yw6yQL.js';
|
|
6
|
+
import { AcpMcpServerConfig } from './mcp-server-config.js';
|
|
7
|
+
export { AcpHttpMcpServerConfig, AcpMcpKeyValue, AcpMcpKeyValueCollection, AcpMcpServerWireConfig, AcpSseMcpServerConfig, AcpStdioMcpServerConfig, normalizeAcpMcpServerConfig, normalizeAcpMcpServerConfigs } from './mcp-server-config.js';
|
|
8
|
+
export { BUILT_IN_ACP_STRATEGIES, buildStrategyTable, geminiStrategy, grokStrategy, kimiStrategy, qwenStrategy, strategyByBackendId, strategyById } from './strategies.js';
|
|
9
|
+
export { ACP_REGISTRY_URL, AcpAgentAllowlist, AcpAgentAllowlistRule, AcpAgentInstanceSource, AcpAllowlistDecision, AcpBinaryPlatformDistribution, AcpDistributionKind, AcpDistributionPolicy, AcpPackageDistribution, AcpPathExecutableLister, AcpRegistryAgent, AcpRegistryAgentWithPolicy, AcpRegistryAuthDescriptor, AcpRegistryAuthMethod, AcpRegistryDistribution, AcpRegistryFetch, AcpRegistryService, AcpRegistryServiceOptions, AcpRegistrySnapshot, AcpVerificationStatus, BANNED_ACP_REGISTRY_IDS, DEFAULT_ACP_AGENT_ALLOWLIST, DEFAULT_ACP_PROBE_TIMEOUT_MS, DiscoveredAcpAgent, DiscoveredAcpAgentGroup, DiscoveredAcpAgentInstance, LocalAcpDiscoveryOptions, RejectedAcpAgentInstance, defaultAcpAgentAllowlist, discoverLocalAcpAgentInstances, discoverLocalAcpAgents, evaluateAcpDistributionPolicy, isBannedAcpRegistryId, normalizeRegistry, wellKnownAgentBinDirs } from './discovery.js';
|
|
4
10
|
|
|
5
11
|
interface AcpJsonRpcTransport {
|
|
6
12
|
request(method: string, params?: Record<string, unknown>, timeoutMs?: number): Promise<unknown>;
|
|
@@ -75,87 +81,6 @@ declare class AcpConnection implements AcpJsonRpcTransport {
|
|
|
75
81
|
onRequest(listener: (method: string, params: Record<string, unknown>, id?: JsonRpcId) => Promise<unknown> | unknown): () => void;
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
type LocalAcpProbeResult = {
|
|
79
|
-
stdout?: string | Buffer;
|
|
80
|
-
stderr?: string | Buffer;
|
|
81
|
-
};
|
|
82
|
-
type LocalAcpProbeOptions = {
|
|
83
|
-
/** Budget for this probe spawn. An injected probe should honor it so a slow
|
|
84
|
-
* CLI is reported as "did not answer in time", not as "not installed". */
|
|
85
|
-
timeoutMs?: number | undefined;
|
|
86
|
-
/** Fires when discovery is abandoned mid-probe. */
|
|
87
|
-
signal?: AbortSignal | undefined;
|
|
88
|
-
};
|
|
89
|
-
type LocalAcpAgentProbe = (command: string, args: string[], options?: LocalAcpProbeOptions) => Promise<LocalAcpProbeResult>;
|
|
90
|
-
/** How a strategy decides it is installed + ACP-capable on this machine. */
|
|
91
|
-
type AcpDiscoveryProbe = {
|
|
92
|
-
/** Args that print a version (probed first; failure = not installed). */
|
|
93
|
-
versionArgs: string[];
|
|
94
|
-
/** Args probed to confirm ACP support. When `helpMatches` is set the OUTPUT
|
|
95
|
-
* must match it; when omitted, a SUCCESSFUL probe (exit 0) is itself the
|
|
96
|
-
* signal — for args that are an ACP subcommand whose mere existence proves
|
|
97
|
-
* capability (e.g. `kimi acp --help`). */
|
|
98
|
-
helpArgs: string[];
|
|
99
|
-
/** Regex the help/usage output must match for the agent to count as
|
|
100
|
-
* ACP-capable. OMIT to rely on the help probe's EXIT CODE instead — more
|
|
101
|
-
* robust than parsing help prose, which drifts across CLI versions. */
|
|
102
|
-
helpMatches?: RegExp;
|
|
103
|
-
/** Bare command name tried first. */
|
|
104
|
-
command: string;
|
|
105
|
-
/** Additional candidate command paths (Homebrew prefixes, `~/.<agent>/bin`, …). */
|
|
106
|
-
fallbackCommands?: string[];
|
|
107
|
-
};
|
|
108
|
-
/** Launch invocation: how to spawn the CLI in ACP stdio server mode. */
|
|
109
|
-
type AcpSpawnSpec = {
|
|
110
|
-
/** Command to run (resolved against the discovered candidate at spawn time). */
|
|
111
|
-
command: string;
|
|
112
|
-
/** Args that put the CLI into ACP stdio server mode (e.g. `["--acp"]`). */
|
|
113
|
-
args: string[];
|
|
114
|
-
/** Extra env to set when launching (e.g. Gemini workspace-trust). */
|
|
115
|
-
env?: Record<string, string>;
|
|
116
|
-
/** Extra args appended only when missing (e.g. Gemini `--skip-trust`). */
|
|
117
|
-
ensureArgs?: string[];
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Normalization quirks the normalizer reads. NO agent-id literal ever appears
|
|
121
|
-
* in the normalizer — it reads these fields off the strategy it was constructed
|
|
122
|
-
* with. A synthetic strategy with different quirk values flows through the
|
|
123
|
-
* normalizer with zero normalizer changes (asserted in tests).
|
|
124
|
-
*/
|
|
125
|
-
type AcpAgentQuirks = {
|
|
126
|
-
/**
|
|
127
|
-
* Whether agent "thought"/reasoning chunks surface as assistant messages.
|
|
128
|
-
* Qwen sets this false (its thoughts are noisy scaffolding); others true.
|
|
129
|
-
*/
|
|
130
|
-
surfaceThoughts: boolean;
|
|
131
|
-
/**
|
|
132
|
-
* Where the auto-generated thread title comes from:
|
|
133
|
-
* • "topic-update" — a `tool_call` titled `Update topic to: "…"` (Gemini/Kimi/Qwen);
|
|
134
|
-
* • "session-summary" — a vendor `session_summary_generated` update (Grok);
|
|
135
|
-
* • "both" — recognize either.
|
|
136
|
-
*/
|
|
137
|
-
titleFrom: "topic-update" | "session-summary" | "both";
|
|
138
|
-
/** Vendor notification methods routed through the same session/update path. */
|
|
139
|
-
vendorNotificationMethods?: string[];
|
|
140
|
-
};
|
|
141
|
-
type AcpAgentStrategy = {
|
|
142
|
-
/** Strategy id, also the registry id (`gemini`, `grok`, `kimi`, `qwen`, …). */
|
|
143
|
-
id: string;
|
|
144
|
-
/** Neutral backend id (`acp:<id>`) used as the thread/session correlation key. */
|
|
145
|
-
backendId: string;
|
|
146
|
-
displayName: string;
|
|
147
|
-
authors: string[];
|
|
148
|
-
license?: string;
|
|
149
|
-
repositoryUrl?: string;
|
|
150
|
-
discoveryProbe: AcpDiscoveryProbe;
|
|
151
|
-
spawn: AcpSpawnSpec;
|
|
152
|
-
quirks: AcpAgentQuirks;
|
|
153
|
-
};
|
|
154
|
-
/** Build the neutral backend id for a registry id. */
|
|
155
|
-
declare function buildAcpBackendId(registryId: string): string;
|
|
156
|
-
/** Quirks for an unknown/synthetic strategy default to the common case. */
|
|
157
|
-
declare function defaultQuirks(overrides?: Partial<AcpAgentQuirks>): AcpAgentQuirks;
|
|
158
|
-
|
|
159
84
|
type AcpRuntimeConfigOptionValue = {
|
|
160
85
|
value: string;
|
|
161
86
|
label?: string;
|
|
@@ -264,43 +189,6 @@ declare function mergeAcpRuntimeState(existing: AcpSessionRuntimeState | undefin
|
|
|
264
189
|
/** Resolve the human-facing label for a mode id from the capabilities snapshot. */
|
|
265
190
|
declare function modeLabelFor(capabilities: AcpRuntimeCapabilities | undefined, modeId: string): string | undefined;
|
|
266
191
|
|
|
267
|
-
/** ACP key/value entry used by stdio environments and HTTP headers. */
|
|
268
|
-
type AcpMcpKeyValue = {
|
|
269
|
-
name: string;
|
|
270
|
-
value: string;
|
|
271
|
-
};
|
|
272
|
-
/** Host-friendly collection accepted wherever ACP requires key/value entries. */
|
|
273
|
-
type AcpMcpKeyValueCollection = Readonly<Record<string, string>> | readonly AcpMcpKeyValue[];
|
|
274
|
-
/** Backward-compatible stdio MCP configuration. ACP stdio has no `type` field. */
|
|
275
|
-
type AcpStdioMcpServerConfig = {
|
|
276
|
-
name: string;
|
|
277
|
-
command: string;
|
|
278
|
-
args?: readonly string[];
|
|
279
|
-
env?: AcpMcpKeyValueCollection;
|
|
280
|
-
};
|
|
281
|
-
/** Streamable HTTP MCP configuration from the ACP v1 schema. */
|
|
282
|
-
type AcpHttpMcpServerConfig = {
|
|
283
|
-
name: string;
|
|
284
|
-
type: "http";
|
|
285
|
-
url: string;
|
|
286
|
-
headers: AcpMcpKeyValueCollection;
|
|
287
|
-
};
|
|
288
|
-
/** Legacy HTTP+SSE MCP configuration from the ACP v1 schema. */
|
|
289
|
-
type AcpSseMcpServerConfig = {
|
|
290
|
-
name: string;
|
|
291
|
-
type: "sse";
|
|
292
|
-
url: string;
|
|
293
|
-
headers: AcpMcpKeyValueCollection;
|
|
294
|
-
};
|
|
295
|
-
/** Public MCP input accepted by agent-acp session lifecycle methods. */
|
|
296
|
-
type AcpMcpServerConfig = AcpStdioMcpServerConfig | AcpHttpMcpServerConfig | AcpSseMcpServerConfig;
|
|
297
|
-
/** Exact MCP server wire union from the pinned ACP protocol library. */
|
|
298
|
-
type AcpMcpServerWireConfig = McpServer;
|
|
299
|
-
/** Serialize a host-friendly config into the exact ACP v1 wire representation. */
|
|
300
|
-
declare function normalizeAcpMcpServerConfig(server: AcpMcpServerConfig): AcpMcpServerWireConfig;
|
|
301
|
-
/** Serialize a per-session list without retaining mutable caller collections. */
|
|
302
|
-
declare function normalizeAcpMcpServerConfigs(servers: readonly AcpMcpServerConfig[]): AcpMcpServerWireConfig[];
|
|
303
|
-
|
|
304
192
|
type AcpPromptContentBlock = {
|
|
305
193
|
type: "text";
|
|
306
194
|
text: string;
|
|
@@ -384,6 +272,11 @@ declare class AcpAgentClient implements AgentBackend {
|
|
|
384
272
|
private unsubscribeRequest;
|
|
385
273
|
private initialized;
|
|
386
274
|
private runtimeCapabilities?;
|
|
275
|
+
/** What `initialize` reported: agent-level, and never any one session's. The
|
|
276
|
+
* base a session's own menus are built on — the client-wide snapshot above is
|
|
277
|
+
* whichever session wrote last, and a fresh session must not inherit its
|
|
278
|
+
* menus or their current values. */
|
|
279
|
+
private initializeCapabilities?;
|
|
387
280
|
constructor(options: AcpAgentClientOptions);
|
|
388
281
|
private readonly clientName;
|
|
389
282
|
private readonly clientTitle;
|
|
@@ -510,7 +403,7 @@ declare class AcpAgentClient implements AgentBackend {
|
|
|
510
403
|
* `session/set_model` answers `{}` and refreshes only via an async
|
|
511
404
|
* notification. On Kimi the model DETERMINES which thought levels exist —
|
|
512
405
|
* `K2.7 Coding` offers only `on`, `K3` offers `low`/`high`/`max` — and
|
|
513
|
-
* `applyReasoning` picks from
|
|
406
|
+
* `applyReasoning` picks from THIS session's menus on the following
|
|
514
407
|
* `startTurn`, so the refresh this write leaves behind is what it reads. */
|
|
515
408
|
setModel(threadId: string, modelId: string): Promise<void>;
|
|
516
409
|
setConfigOption(threadId: string, optionId: string, value: string): Promise<void>;
|
|
@@ -537,7 +430,17 @@ declare class AcpAgentClient implements AgentBackend {
|
|
|
537
430
|
/** Read an image file and build an ACP `image` content block (base64 + inferred
|
|
538
431
|
* mimeType). Throws on read failure; the caller catches + skips. */
|
|
539
432
|
private imageBlockFromPath;
|
|
433
|
+
/** Normalize `result` into a capability snapshot, filling what it omits from
|
|
434
|
+
* `base`. Required, not defaulted: an explicit `undefined` would trigger a
|
|
435
|
+
* default parameter, and the only default on hand is the client-wide
|
|
436
|
+
* snapshot — which may be another session's. */
|
|
540
437
|
private captureRuntimeCapabilities;
|
|
438
|
+
/** The option menus to consult when choosing a value for `threadId`. A
|
|
439
|
+
* session with none of its own gets the agent-level `initialize` menus, never
|
|
440
|
+
* another session's. */
|
|
441
|
+
private sessionCapabilities;
|
|
442
|
+
/** What a session's menus are built on: its own, or `initialize`'s. */
|
|
443
|
+
private sessionBase;
|
|
541
444
|
private notifyRuntimeCapabilities;
|
|
542
445
|
private emitThreadSettings;
|
|
543
446
|
private requireSession;
|
|
@@ -550,9 +453,10 @@ declare class AcpAgentClient implements AgentBackend {
|
|
|
550
453
|
supportsSseMcp(): boolean;
|
|
551
454
|
}
|
|
552
455
|
/** Pick the value to set on a "thinking" config option for a neutral reasoning
|
|
553
|
-
* token:
|
|
554
|
-
*
|
|
555
|
-
*
|
|
456
|
+
* token: high-effort → the ON-like value; low-effort → the OFF-like value, or,
|
|
457
|
+
* when the agent offers only graded levels, the LOW one — the closest thing to
|
|
458
|
+
* off it has. Returns undefined when the token isn't an effort signal we
|
|
459
|
+
* recognize, or the option has no value to match (caller leaves it alone).
|
|
556
460
|
* Exported for testing. */
|
|
557
461
|
declare function reasoningValueForThoughtLevel(reasoning: string, values: ReadonlyArray<AcpRuntimeConfigOptionValue>): string | undefined;
|
|
558
462
|
|
|
@@ -717,240 +621,4 @@ declare function readFirstLocationPath(record: Record<string, unknown>): string
|
|
|
717
621
|
/** The assistant/user text carried by a chunk update (camel/snake tolerant). */
|
|
718
622
|
declare function readUpdateText(update: Record<string, unknown>): string | undefined;
|
|
719
623
|
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
declare const grokStrategy: AcpAgentStrategy;
|
|
723
|
-
|
|
724
|
-
declare const kimiStrategy: AcpAgentStrategy;
|
|
725
|
-
|
|
726
|
-
declare const qwenStrategy: AcpAgentStrategy;
|
|
727
|
-
|
|
728
|
-
declare const BUILT_IN_ACP_STRATEGIES: readonly AcpAgentStrategy[];
|
|
729
|
-
/** Index a list of strategies by id (built-ins by default). */
|
|
730
|
-
declare function buildStrategyTable(strategies?: readonly AcpAgentStrategy[]): Map<string, AcpAgentStrategy>;
|
|
731
|
-
/** Look up a strategy by its registry id, falling back to the built-in table. */
|
|
732
|
-
declare function strategyById(id: string, table?: Map<string, AcpAgentStrategy>): AcpAgentStrategy | undefined;
|
|
733
|
-
/** Look up a strategy by its neutral backend id (`acp:<id>`). */
|
|
734
|
-
declare function strategyByBackendId(backendId: string, strategies?: readonly AcpAgentStrategy[]): AcpAgentStrategy | undefined;
|
|
735
|
-
|
|
736
|
-
/** How a discovered instance's executable path was located. */
|
|
737
|
-
type AcpAgentInstanceSource = "override" | "path" | "fallback";
|
|
738
|
-
/** One installed executable of an agent that passed the probe. */
|
|
739
|
-
type DiscoveredAcpAgentInstance = {
|
|
740
|
-
/** Resolved command/path that passed the probe. */
|
|
741
|
-
command: string;
|
|
742
|
-
/** Parsed CLI version, when the version probe yielded one. */
|
|
743
|
-
version?: string;
|
|
744
|
-
/** Where this candidate came from (user override, `PATH`, or a fallback path). */
|
|
745
|
-
source: AcpAgentInstanceSource;
|
|
746
|
-
};
|
|
747
|
-
/** A detected executable that did not satisfy a strategy's discovery probe.
|
|
748
|
-
* It is diagnostic-only: hosts must never use it to launch an ACP session. */
|
|
749
|
-
type RejectedAcpAgentInstance = {
|
|
750
|
-
command: string;
|
|
751
|
-
/** Parsed from successful `--version` output when available. */
|
|
752
|
-
version?: string;
|
|
753
|
-
source: AcpAgentInstanceSource;
|
|
754
|
-
/** `probe-timed-out` means the CLI did not answer within the probe budget —
|
|
755
|
-
* UNLIKE the other reasons it is not a verdict on the CLI, and a host may
|
|
756
|
-
* re-probe on a larger `probeTimeoutMs` instead of reporting it unusable. */
|
|
757
|
-
reason: "version-probe-failed" | "acp-probe-failed" | "acp-help-mismatch" | "probe-timed-out";
|
|
758
|
-
};
|
|
759
|
-
/** Every installed instance of one agent found on this machine. */
|
|
760
|
-
type DiscoveredAcpAgentGroup = {
|
|
761
|
-
strategyId: string;
|
|
762
|
-
backendId: string;
|
|
763
|
-
name: string;
|
|
764
|
-
/** Spawn args that put it into ACP stdio mode (same for every instance). */
|
|
765
|
-
args: string[];
|
|
766
|
-
/** Extra env to set at launch (same for every instance). */
|
|
767
|
-
env: Record<string, string>;
|
|
768
|
-
/** All instances that passed the probe, in candidate order (override → PATH → fallback). */
|
|
769
|
-
instances: DiscoveredAcpAgentInstance[];
|
|
770
|
-
/** Detected candidates that failed the version or ACP-capability probe. Only
|
|
771
|
-
* populated when `includeRejectedCandidates` is enabled. */
|
|
772
|
-
rejectedInstances?: RejectedAcpAgentInstance[];
|
|
773
|
-
discoveredAt: number;
|
|
774
|
-
};
|
|
775
|
-
type DiscoveredAcpAgent = {
|
|
776
|
-
strategyId: string;
|
|
777
|
-
backendId: string;
|
|
778
|
-
name: string;
|
|
779
|
-
version?: string;
|
|
780
|
-
/** Resolved command that passed the probe (may be a fallback path). */
|
|
781
|
-
command: string;
|
|
782
|
-
/** Spawn args that put it into ACP stdio mode. */
|
|
783
|
-
args: string[];
|
|
784
|
-
/** Extra env to set at launch. */
|
|
785
|
-
env: Record<string, string>;
|
|
786
|
-
discoveredAt: number;
|
|
787
|
-
};
|
|
788
|
-
/** Lists every executable named `command` across the dirs in `env.PATH`,
|
|
789
|
-
* in `PATH` order (the `which -a` view). */
|
|
790
|
-
type AcpPathExecutableLister = (command: string, env: NodeJS.ProcessEnv) => string[];
|
|
791
|
-
type LocalAcpDiscoveryOptions = {
|
|
792
|
-
probe?: LocalAcpAgentProbe;
|
|
793
|
-
now?: () => number;
|
|
794
|
-
/** Strategy table to probe (built-ins by default). */
|
|
795
|
-
strategies?: readonly AcpAgentStrategy[];
|
|
796
|
-
/** Per-strategy command override (tried before the strategy's own candidates). */
|
|
797
|
-
overrides?: Record<string, string>;
|
|
798
|
-
/** Env used both for PATH enumeration and (by the default probe) for spawns. */
|
|
799
|
-
env?: NodeJS.ProcessEnv;
|
|
800
|
-
/** Injectable `PATH` executable lister (real-fs scan by default). */
|
|
801
|
-
listExecutables?: AcpPathExecutableLister;
|
|
802
|
-
/** Include candidates known to exist but rejected by a discovery probe.
|
|
803
|
-
* Defaults false to preserve the legacy installed-only result. */
|
|
804
|
-
includeRejectedCandidates?: boolean;
|
|
805
|
-
/** Budget for ONE probe spawn (the default probe only — an injected `probe`
|
|
806
|
-
* owns its own timing). Defaults to `DEFAULT_ACP_PROBE_TIMEOUT_MS`. */
|
|
807
|
-
probeTimeoutMs?: number;
|
|
808
|
-
/** Abandon discovery in flight (re-triggered discovery, app quitting).
|
|
809
|
-
* Already-probed groups are still returned. */
|
|
810
|
-
signal?: AbortSignal;
|
|
811
|
-
};
|
|
812
|
-
/**
|
|
813
|
-
* Budget for one ACP discovery probe spawn, in ms.
|
|
814
|
-
*
|
|
815
|
-
* Unchanged from the value this module has always used. Kept lower than
|
|
816
|
-
* codex-discovery's version-probe budget on purpose: `discoverStrategyInstances`
|
|
817
|
-
* walks its candidates SERIALLY, so the worst case here is (candidates x
|
|
818
|
-
* budget) rather than a single budget. Hosts that scan machines with many
|
|
819
|
-
* installed copies can raise it knowingly via `probeTimeoutMs`.
|
|
820
|
-
*/
|
|
821
|
-
declare const DEFAULT_ACP_PROBE_TIMEOUT_MS = 5000;
|
|
822
|
-
/**
|
|
823
|
-
* Discover every installed instance of each agent (all `PATH` matches +
|
|
824
|
-
* fallbacks + override that pass the probe), grouped per strategy. Groups with
|
|
825
|
-
* no passing instance are omitted unless `includeRejectedCandidates` is true
|
|
826
|
-
* and a detected candidate failed a probe.
|
|
827
|
-
*/
|
|
828
|
-
declare function discoverLocalAcpAgentInstances(options?: LocalAcpDiscoveryOptions): Promise<DiscoveredAcpAgentGroup[]>;
|
|
829
|
-
/**
|
|
830
|
-
* First-match-per-agent discovery (legacy view). Returns at most one record per
|
|
831
|
-
* agent — the first instance that passed the probe in candidate order.
|
|
832
|
-
*/
|
|
833
|
-
declare function discoverLocalAcpAgents(options?: LocalAcpDiscoveryOptions): Promise<DiscoveredAcpAgent[]>;
|
|
834
|
-
/** Well-known bin dirs where a CLI installed via a node/JS version manager or
|
|
835
|
-
* a per-user package manager lives — even when it isn't on a GUI app's `PATH`.
|
|
836
|
-
* Exported for testing; `home` defaults to the user's home dir. */
|
|
837
|
-
declare function wellKnownAgentBinDirs(home?: string): string[];
|
|
838
|
-
|
|
839
|
-
declare const ACP_REGISTRY_URL = "https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json";
|
|
840
|
-
type AcpDistributionKind = "npx" | "uvx" | "binary" | "local";
|
|
841
|
-
type AcpRegistryDistributionEnv = Record<string, string>;
|
|
842
|
-
type AcpPackageDistribution = {
|
|
843
|
-
kind: "npx" | "uvx";
|
|
844
|
-
packageName: string;
|
|
845
|
-
args: string[];
|
|
846
|
-
env: AcpRegistryDistributionEnv;
|
|
847
|
-
};
|
|
848
|
-
type AcpBinaryPlatformDistribution = {
|
|
849
|
-
kind: "binary";
|
|
850
|
-
platform: string;
|
|
851
|
-
archiveUrl: string;
|
|
852
|
-
command: string;
|
|
853
|
-
args: string[];
|
|
854
|
-
env: AcpRegistryDistributionEnv;
|
|
855
|
-
checksum?: string;
|
|
856
|
-
signatureUrl?: string;
|
|
857
|
-
};
|
|
858
|
-
type AcpRegistryDistribution = AcpPackageDistribution | AcpBinaryPlatformDistribution;
|
|
859
|
-
type AcpRegistryAuthMethod = "agent-managed" | "terminal" | "unknown";
|
|
860
|
-
type AcpRegistryAuthDescriptor = {
|
|
861
|
-
required: boolean;
|
|
862
|
-
methods: AcpRegistryAuthMethod[];
|
|
863
|
-
raw?: unknown;
|
|
864
|
-
};
|
|
865
|
-
type AcpRegistryAgent = {
|
|
866
|
-
id: string;
|
|
867
|
-
backendId: string;
|
|
868
|
-
name: string;
|
|
869
|
-
version?: string;
|
|
870
|
-
description?: string;
|
|
871
|
-
authors: string[];
|
|
872
|
-
license?: string;
|
|
873
|
-
repositoryUrl?: string;
|
|
874
|
-
websiteUrl?: string;
|
|
875
|
-
iconUrl?: string;
|
|
876
|
-
distributions: AcpRegistryDistribution[];
|
|
877
|
-
distributionKinds: AcpDistributionKind[];
|
|
878
|
-
auth: AcpRegistryAuthDescriptor;
|
|
879
|
-
raw: unknown;
|
|
880
|
-
};
|
|
881
|
-
type AcpVerificationStatus = "verified" | "unverified-allowed" | "unverified-blocked" | "not-applicable";
|
|
882
|
-
type AcpAllowlistDecision = {
|
|
883
|
-
allowed: true;
|
|
884
|
-
ruleId: string;
|
|
885
|
-
unverifiedBinaryAllowed: boolean;
|
|
886
|
-
} | {
|
|
887
|
-
allowed: false;
|
|
888
|
-
reason: string;
|
|
889
|
-
};
|
|
890
|
-
type AcpRegistryAgentWithPolicy = AcpRegistryAgent & {
|
|
891
|
-
allowlist: AcpAllowlistDecision;
|
|
892
|
-
installable: boolean;
|
|
893
|
-
unavailableReason?: string;
|
|
894
|
-
verificationStatus: AcpVerificationStatus;
|
|
895
|
-
};
|
|
896
|
-
type AcpRegistrySnapshot = {
|
|
897
|
-
fetchedAt: number;
|
|
898
|
-
agents: AcpRegistryAgent[];
|
|
899
|
-
raw: unknown;
|
|
900
|
-
};
|
|
901
|
-
|
|
902
|
-
type AcpAgentAllowlistRule = {
|
|
903
|
-
id: string;
|
|
904
|
-
registryId: string;
|
|
905
|
-
versions?: string[];
|
|
906
|
-
distributionKinds?: AcpDistributionKind[];
|
|
907
|
-
allowedPackageNames?: string[];
|
|
908
|
-
allowedArchiveHosts?: string[];
|
|
909
|
-
allowUnverifiedBinary?: boolean;
|
|
910
|
-
allowGplFamilyLicense?: boolean;
|
|
911
|
-
};
|
|
912
|
-
declare const BANNED_ACP_REGISTRY_IDS: Set<string>;
|
|
913
|
-
declare const DEFAULT_ACP_AGENT_ALLOWLIST: AcpAgentAllowlistRule[];
|
|
914
|
-
declare class AcpAgentAllowlist {
|
|
915
|
-
private readonly rules;
|
|
916
|
-
constructor(rules: AcpAgentAllowlistRule[]);
|
|
917
|
-
evaluate(agent: AcpRegistryAgent): AcpAllowlistDecision;
|
|
918
|
-
evaluateDistribution(agent: AcpRegistryAgent, distribution: AcpRegistryDistribution): AcpAllowlistDecision;
|
|
919
|
-
}
|
|
920
|
-
declare const defaultAcpAgentAllowlist: AcpAgentAllowlist;
|
|
921
|
-
declare function isBannedAcpRegistryId(registryId: string): boolean;
|
|
922
|
-
|
|
923
|
-
type AcpRegistryFetch = (input: string, init?: {
|
|
924
|
-
headers?: Record<string, string>;
|
|
925
|
-
}) => Promise<{
|
|
926
|
-
ok: boolean;
|
|
927
|
-
status: number;
|
|
928
|
-
statusText: string;
|
|
929
|
-
json(): Promise<unknown>;
|
|
930
|
-
}>;
|
|
931
|
-
type AcpRegistryServiceOptions = {
|
|
932
|
-
allowlist?: AcpAgentAllowlist;
|
|
933
|
-
fetch?: AcpRegistryFetch;
|
|
934
|
-
now?: () => number;
|
|
935
|
-
registryUrl?: string;
|
|
936
|
-
};
|
|
937
|
-
type AcpDistributionPolicy = {
|
|
938
|
-
allowlist: AcpAllowlistDecision;
|
|
939
|
-
installable: boolean;
|
|
940
|
-
verificationStatus: AcpVerificationStatus;
|
|
941
|
-
unavailableReason?: string;
|
|
942
|
-
};
|
|
943
|
-
declare class AcpRegistryService {
|
|
944
|
-
private readonly allowlist;
|
|
945
|
-
private readonly fetcher;
|
|
946
|
-
private readonly now;
|
|
947
|
-
private readonly registryUrl;
|
|
948
|
-
constructor(options?: AcpRegistryServiceOptions);
|
|
949
|
-
fetchRegistry(): Promise<AcpRegistrySnapshot>;
|
|
950
|
-
applyAllowlist(snapshot: AcpRegistrySnapshot): AcpRegistryAgentWithPolicy[];
|
|
951
|
-
evaluateDistribution(agent: AcpRegistryAgent, distribution: AcpRegistryDistribution): AcpDistributionPolicy;
|
|
952
|
-
}
|
|
953
|
-
declare function evaluateAcpDistributionPolicy(distribution: AcpRegistryDistribution, allowlist: AcpAllowlistDecision): AcpDistributionPolicy;
|
|
954
|
-
declare function normalizeRegistry(raw: unknown): AcpRegistryAgent[];
|
|
955
|
-
|
|
956
|
-
export { ACP_REGISTRY_URL, ACP_REQUEST_TIMEOUT_MESSAGE_PREFIX, AcpAgentAllowlist, type AcpAgentAllowlistRule, AcpAgentClient, type AcpAgentClientFactory, type AcpAgentClientOptions, AcpAgentClientPool, type AcpAgentClientPoolOptions, type AcpAgentConnection, type AcpAgentConnectionHandle, type AcpAgentInstanceSource, type AcpAgentQuirks, type AcpAgentStrategy, type AcpAllowlistDecision, type AcpApplyContext, type AcpBinaryPlatformDistribution, AcpConnection, type AcpConnectionOptions, type AcpDiscoveryProbe, type AcpDistributionKind, type AcpDistributionPolicy, type AcpHttpMcpServerConfig, type AcpJsonRpcTransport, type AcpLoadThreadOptions, type AcpMcpKeyValue, type AcpMcpKeyValueCollection, type AcpMcpServerConfig, type AcpMcpServerWireConfig, type AcpNormalizeResult, type AcpNormalizerOptions, AcpOneShotClient, type AcpOneShotClientOptions, type AcpOneShotRequest, type AcpOneShotResponse, type AcpPackageDistribution, type AcpPathExecutableLister, type AcpPromptContentBlock, type AcpRegistryAgent, type AcpRegistryAgentWithPolicy, type AcpRegistryAuthDescriptor, type AcpRegistryAuthMethod, type AcpRegistryDistribution, type AcpRegistryFetch, AcpRegistryService, type AcpRegistryServiceOptions, type AcpRegistrySnapshot, type AcpRuntimeAgentCapabilities, type AcpRuntimeAgentInfo, type AcpRuntimeCapabilities, type AcpRuntimeCapabilitiesHandler, type AcpRuntimeCapabilitiesSource, type AcpRuntimeConfigOption, type AcpRuntimeConfigOptionValue, type AcpRuntimeMcpCapabilities, type AcpRuntimeMode, type AcpRuntimeModel, type AcpRuntimeModels, type AcpRuntimeModes, type AcpRuntimeOptionSource, AcpSessionNormalizer, type AcpSessionRuntimeState, type AcpSpawnSpec, type AcpSseMcpServerConfig, type AcpStartThreadOptions, type AcpStartTurnOptions, type AcpStdioMcpServerConfig, type AcpTitleHandler, type AcpVerificationStatus, BANNED_ACP_REGISTRY_IDS, BUILT_IN_ACP_STRATEGIES, DEFAULT_ACP_AGENT_ALLOWLIST, DEFAULT_ACP_PROBE_TIMEOUT_MS, type DiscoveredAcpAgent, type DiscoveredAcpAgentGroup, type DiscoveredAcpAgentInstance, type LocalAcpAgentProbe, type LocalAcpDiscoveryOptions, type LocalAcpProbeOptions, type LocalAcpProbeResult, type RejectedAcpAgentInstance, acpRuntimeSupportsHttpMcp, acpRuntimeSupportsSessionLoad, acpRuntimeSupportsSseMcp, acpSessionRuntimeStateFromCapabilities, acpSessionRuntimeStateFromUpdate, asRecord, buildAcpBackendId, buildStrategyTable, defaultAcpAgentAllowlist, defaultQuirks, discoverLocalAcpAgentInstances, discoverLocalAcpAgents, evaluateAcpDistributionPolicy, geminiStrategy, grokStrategy, isBannedAcpRegistryId, kimiStrategy, mergeAcpRuntimeState, modeLabelFor, modelConfigOption, modelIdFromCapabilities, modelsFromCapabilities, normalizeAcpMcpServerConfig, normalizeAcpMcpServerConfigs, normalizeAcpRuntimeCapabilities, normalizeRegistry, qwenStrategy, readAcpContentText, readBoolean, readContentText, readFirstLocationPath, readFirstString, readKind, readNonEmptyString, readNumber, readPromptText, readString, readToolCallId, readToolContentText, readToolOutput, readUpdateText, reasoningValueForThoughtLevel, strategyByBackendId, strategyById, toolCallFromUpdate, wellKnownAgentBinDirs };
|
|
624
|
+
export { ACP_REQUEST_TIMEOUT_MESSAGE_PREFIX, AcpAgentClient, type AcpAgentClientFactory, type AcpAgentClientOptions, AcpAgentClientPool, type AcpAgentClientPoolOptions, type AcpAgentConnection, type AcpAgentConnectionHandle, AcpAgentQuirks, AcpAgentStrategy, type AcpApplyContext, AcpConnection, type AcpConnectionOptions, type AcpJsonRpcTransport, type AcpLoadThreadOptions, AcpMcpServerConfig, type AcpNormalizeResult, type AcpNormalizerOptions, AcpOneShotClient, type AcpOneShotClientOptions, type AcpOneShotRequest, type AcpOneShotResponse, type AcpPromptContentBlock, type AcpRuntimeAgentCapabilities, type AcpRuntimeAgentInfo, type AcpRuntimeCapabilities, type AcpRuntimeCapabilitiesHandler, type AcpRuntimeCapabilitiesSource, type AcpRuntimeConfigOption, type AcpRuntimeConfigOptionValue, type AcpRuntimeMcpCapabilities, type AcpRuntimeMode, type AcpRuntimeModel, type AcpRuntimeModels, type AcpRuntimeModes, type AcpRuntimeOptionSource, AcpSessionNormalizer, type AcpSessionRuntimeState, type AcpStartThreadOptions, type AcpStartTurnOptions, type AcpTitleHandler, acpRuntimeSupportsHttpMcp, acpRuntimeSupportsSessionLoad, acpRuntimeSupportsSseMcp, acpSessionRuntimeStateFromCapabilities, acpSessionRuntimeStateFromUpdate, asRecord, mergeAcpRuntimeState, modeLabelFor, modelConfigOption, modelIdFromCapabilities, modelsFromCapabilities, normalizeAcpRuntimeCapabilities, readAcpContentText, readBoolean, readContentText, readFirstLocationPath, readFirstString, readKind, readNonEmptyString, readNumber, readPromptText, readString, readToolCallId, readToolContentText, readToolOutput, readUpdateText, reasoningValueForThoughtLevel, toolCallFromUpdate };
|