@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
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { McpServer } from '@agentclientprotocol/sdk';
|
|
2
|
+
|
|
3
|
+
/** ACP key/value entry used by stdio environments and HTTP headers. */
|
|
4
|
+
type AcpMcpKeyValue = {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
};
|
|
8
|
+
/** Host-friendly collection accepted wherever ACP requires key/value entries. */
|
|
9
|
+
type AcpMcpKeyValueCollection = Readonly<Record<string, string>> | readonly AcpMcpKeyValue[];
|
|
10
|
+
/** Backward-compatible stdio MCP configuration. ACP stdio has no `type` field. */
|
|
11
|
+
type AcpStdioMcpServerConfig = {
|
|
12
|
+
name: string;
|
|
13
|
+
command: string;
|
|
14
|
+
args?: readonly string[];
|
|
15
|
+
env?: AcpMcpKeyValueCollection;
|
|
16
|
+
};
|
|
17
|
+
/** Streamable HTTP MCP configuration from the ACP v1 schema. */
|
|
18
|
+
type AcpHttpMcpServerConfig = {
|
|
19
|
+
name: string;
|
|
20
|
+
type: "http";
|
|
21
|
+
url: string;
|
|
22
|
+
headers: AcpMcpKeyValueCollection;
|
|
23
|
+
};
|
|
24
|
+
/** Legacy HTTP+SSE MCP configuration from the ACP v1 schema. */
|
|
25
|
+
type AcpSseMcpServerConfig = {
|
|
26
|
+
name: string;
|
|
27
|
+
type: "sse";
|
|
28
|
+
url: string;
|
|
29
|
+
headers: AcpMcpKeyValueCollection;
|
|
30
|
+
};
|
|
31
|
+
/** Public MCP input accepted by agent-acp session lifecycle methods. */
|
|
32
|
+
type AcpMcpServerConfig = AcpStdioMcpServerConfig | AcpHttpMcpServerConfig | AcpSseMcpServerConfig;
|
|
33
|
+
/** Exact MCP server wire union from the pinned ACP protocol library. */
|
|
34
|
+
type AcpMcpServerWireConfig = McpServer;
|
|
35
|
+
/** Serialize a host-friendly config into the exact ACP v1 wire representation. */
|
|
36
|
+
declare function normalizeAcpMcpServerConfig(server: AcpMcpServerConfig): AcpMcpServerWireConfig;
|
|
37
|
+
/** Serialize a per-session list without retaining mutable caller collections. */
|
|
38
|
+
declare function normalizeAcpMcpServerConfigs(servers: readonly AcpMcpServerConfig[]): AcpMcpServerWireConfig[];
|
|
39
|
+
|
|
40
|
+
export { type AcpHttpMcpServerConfig, type AcpMcpKeyValue, type AcpMcpKeyValueCollection, type AcpMcpServerConfig, type AcpMcpServerWireConfig, type AcpSseMcpServerConfig, type AcpStdioMcpServerConfig, normalizeAcpMcpServerConfig, normalizeAcpMcpServerConfigs };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { a as AcpAgentStrategy } from './strategy-types-C7yw6yQL.js';
|
|
2
|
+
export { A as AcpAgentQuirks, 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';
|
|
3
|
+
|
|
4
|
+
declare const geminiStrategy: AcpAgentStrategy;
|
|
5
|
+
|
|
6
|
+
declare const grokStrategy: AcpAgentStrategy;
|
|
7
|
+
|
|
8
|
+
declare const kimiStrategy: AcpAgentStrategy;
|
|
9
|
+
|
|
10
|
+
declare const qwenStrategy: AcpAgentStrategy;
|
|
11
|
+
|
|
12
|
+
declare const BUILT_IN_ACP_STRATEGIES: readonly AcpAgentStrategy[];
|
|
13
|
+
/** Index a list of strategies by id (built-ins by default). */
|
|
14
|
+
declare function buildStrategyTable(strategies?: readonly AcpAgentStrategy[]): Map<string, AcpAgentStrategy>;
|
|
15
|
+
/** Look up a strategy by its registry id, falling back to the built-in table. */
|
|
16
|
+
declare function strategyById(id: string, table?: Map<string, AcpAgentStrategy>): AcpAgentStrategy | undefined;
|
|
17
|
+
/** Look up a strategy by its neutral backend id (`acp:<id>`). */
|
|
18
|
+
declare function strategyByBackendId(backendId: string, strategies?: readonly AcpAgentStrategy[]): AcpAgentStrategy | undefined;
|
|
19
|
+
|
|
20
|
+
export { AcpAgentStrategy, BUILT_IN_ACP_STRATEGIES, buildStrategyTable, geminiStrategy, grokStrategy, kimiStrategy, qwenStrategy, strategyByBackendId, strategyById };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BUILT_IN_ACP_STRATEGIES,
|
|
3
|
+
buildAcpBackendId,
|
|
4
|
+
buildStrategyTable,
|
|
5
|
+
defaultQuirks,
|
|
6
|
+
geminiStrategy,
|
|
7
|
+
grokStrategy,
|
|
8
|
+
kimiStrategy,
|
|
9
|
+
qwenStrategy,
|
|
10
|
+
strategyByBackendId,
|
|
11
|
+
strategyById
|
|
12
|
+
} from "./chunk-OFMIS7W6.js";
|
|
13
|
+
export {
|
|
14
|
+
BUILT_IN_ACP_STRATEGIES,
|
|
15
|
+
buildAcpBackendId,
|
|
16
|
+
buildStrategyTable,
|
|
17
|
+
defaultQuirks,
|
|
18
|
+
geminiStrategy,
|
|
19
|
+
grokStrategy,
|
|
20
|
+
kimiStrategy,
|
|
21
|
+
qwenStrategy,
|
|
22
|
+
strategyByBackendId,
|
|
23
|
+
strategyById
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=strategies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
type LocalAcpProbeResult = {
|
|
2
|
+
stdout?: string | Buffer;
|
|
3
|
+
stderr?: string | Buffer;
|
|
4
|
+
};
|
|
5
|
+
type LocalAcpProbeOptions = {
|
|
6
|
+
/** Budget for this probe spawn. An injected probe should honor it so a slow
|
|
7
|
+
* CLI is reported as "did not answer in time", not as "not installed". */
|
|
8
|
+
timeoutMs?: number | undefined;
|
|
9
|
+
/** Fires when discovery is abandoned mid-probe. */
|
|
10
|
+
signal?: AbortSignal | undefined;
|
|
11
|
+
};
|
|
12
|
+
type LocalAcpAgentProbe = (command: string, args: string[], options?: LocalAcpProbeOptions) => Promise<LocalAcpProbeResult>;
|
|
13
|
+
/** How a strategy decides it is installed + ACP-capable on this machine. */
|
|
14
|
+
type AcpDiscoveryProbe = {
|
|
15
|
+
/** Args that print a version (probed first; failure = not installed). */
|
|
16
|
+
versionArgs: string[];
|
|
17
|
+
/** Args probed to confirm ACP support. When `helpMatches` is set the OUTPUT
|
|
18
|
+
* must match it; when omitted, a SUCCESSFUL probe (exit 0) is itself the
|
|
19
|
+
* signal — for args that are an ACP subcommand whose mere existence proves
|
|
20
|
+
* capability (e.g. `kimi acp --help`). */
|
|
21
|
+
helpArgs: string[];
|
|
22
|
+
/** Regex the help/usage output must match for the agent to count as
|
|
23
|
+
* ACP-capable. OMIT to rely on the help probe's EXIT CODE instead — more
|
|
24
|
+
* robust than parsing help prose, which drifts across CLI versions. */
|
|
25
|
+
helpMatches?: RegExp;
|
|
26
|
+
/** Bare command name tried first. */
|
|
27
|
+
command: string;
|
|
28
|
+
/** Additional candidate command paths (Homebrew prefixes, `~/.<agent>/bin`, …). */
|
|
29
|
+
fallbackCommands?: string[];
|
|
30
|
+
};
|
|
31
|
+
/** Launch invocation: how to spawn the CLI in ACP stdio server mode. */
|
|
32
|
+
type AcpSpawnSpec = {
|
|
33
|
+
/** Command to run (resolved against the discovered candidate at spawn time). */
|
|
34
|
+
command: string;
|
|
35
|
+
/** Args that put the CLI into ACP stdio server mode (e.g. `["--acp"]`). */
|
|
36
|
+
args: string[];
|
|
37
|
+
/** Extra env to set when launching (e.g. Gemini workspace-trust). */
|
|
38
|
+
env?: Record<string, string>;
|
|
39
|
+
/** Extra args appended only when missing (e.g. Gemini `--skip-trust`). */
|
|
40
|
+
ensureArgs?: string[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Normalization quirks the normalizer reads. NO agent-id literal ever appears
|
|
44
|
+
* in the normalizer — it reads these fields off the strategy it was constructed
|
|
45
|
+
* with. A synthetic strategy with different quirk values flows through the
|
|
46
|
+
* normalizer with zero normalizer changes (asserted in tests).
|
|
47
|
+
*/
|
|
48
|
+
type AcpAgentQuirks = {
|
|
49
|
+
/**
|
|
50
|
+
* Whether agent "thought"/reasoning chunks surface as assistant messages.
|
|
51
|
+
* Qwen sets this false (its thoughts are noisy scaffolding); others true.
|
|
52
|
+
*/
|
|
53
|
+
surfaceThoughts: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Where the auto-generated thread title comes from:
|
|
56
|
+
* • "topic-update" — a `tool_call` titled `Update topic to: "…"` (Gemini/Kimi/Qwen);
|
|
57
|
+
* • "session-summary" — a vendor `session_summary_generated` update (Grok);
|
|
58
|
+
* • "both" — recognize either.
|
|
59
|
+
*/
|
|
60
|
+
titleFrom: "topic-update" | "session-summary" | "both";
|
|
61
|
+
/** Vendor notification methods routed through the same session/update path. */
|
|
62
|
+
vendorNotificationMethods?: string[];
|
|
63
|
+
};
|
|
64
|
+
type AcpAgentStrategy = {
|
|
65
|
+
/** Strategy id, also the registry id (`gemini`, `grok`, `kimi`, `qwen`, …). */
|
|
66
|
+
id: string;
|
|
67
|
+
/** Neutral backend id (`acp:<id>`) used as the thread/session correlation key. */
|
|
68
|
+
backendId: string;
|
|
69
|
+
displayName: string;
|
|
70
|
+
authors: string[];
|
|
71
|
+
license?: string;
|
|
72
|
+
repositoryUrl?: string;
|
|
73
|
+
discoveryProbe: AcpDiscoveryProbe;
|
|
74
|
+
spawn: AcpSpawnSpec;
|
|
75
|
+
quirks: AcpAgentQuirks;
|
|
76
|
+
};
|
|
77
|
+
/** Build the neutral backend id for a registry id. */
|
|
78
|
+
declare function buildAcpBackendId(registryId: string): string;
|
|
79
|
+
/** Quirks for an unknown/synthetic strategy default to the common case. */
|
|
80
|
+
declare function defaultQuirks(overrides?: Partial<AcpAgentQuirks>): AcpAgentQuirks;
|
|
81
|
+
|
|
82
|
+
export { type AcpAgentQuirks as A, type LocalAcpAgentProbe as L, type AcpAgentStrategy as a, type AcpDiscoveryProbe as b, type AcpSpawnSpec as c, type LocalAcpProbeOptions as d, type LocalAcpProbeResult as e, buildAcpBackendId as f, defaultQuirks as g };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pwrdrvr/agent-acp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "ACP (Agent Client Protocol) backend adapter for agent-kit: speaks ACP over stdio to local Kimi/Qwen/Gemini/Grok CLIs and normalizes their session/update stream into the agent-core neutral schema.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "PwrDrvr LLC",
|
|
@@ -9,6 +9,18 @@
|
|
|
9
9
|
".": {
|
|
10
10
|
"types": "./dist/index.d.ts",
|
|
11
11
|
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./strategies": {
|
|
14
|
+
"types": "./dist/strategies.d.ts",
|
|
15
|
+
"import": "./dist/strategies.js"
|
|
16
|
+
},
|
|
17
|
+
"./discovery": {
|
|
18
|
+
"types": "./dist/discovery.d.ts",
|
|
19
|
+
"import": "./dist/discovery.js"
|
|
20
|
+
},
|
|
21
|
+
"./mcp-server-config": {
|
|
22
|
+
"types": "./dist/mcp-server-config.d.ts",
|
|
23
|
+
"import": "./dist/mcp-server-config.js"
|
|
12
24
|
}
|
|
13
25
|
},
|
|
14
26
|
"main": "./dist/index.js",
|
|
@@ -44,7 +56,7 @@
|
|
|
44
56
|
"access": "public"
|
|
45
57
|
},
|
|
46
58
|
"scripts": {
|
|
47
|
-
"build": "tsup src/index.ts --format esm --dts --clean --sourcemap",
|
|
59
|
+
"build": "tsup --entry.index src/index.ts --entry.strategies src/entries/strategies.ts --entry.discovery src/entries/discovery.ts --entry.mcp-server-config src/entries/mcp-server-config.ts --format esm --dts --clean --sourcemap",
|
|
48
60
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
49
61
|
"test": "vitest run"
|
|
50
62
|
}
|