@vedmalex/ai-connect 0.4.0 → 0.5.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/README.md +4 -9
- package/dist/browser/index.js +24 -87
- package/dist/browser/index.js.map +2 -2
- package/dist/bun/index.js +30 -388
- package/dist/bun/index.js.map +3 -3
- package/dist/bun/local.js +22 -350
- package/dist/bun/local.js.map +3 -3
- package/dist/node/index.js +30 -388
- package/dist/node/index.js.map +3 -3
- package/dist/node/local.js +22 -350
- package/dist/node/local.js.map +3 -3
- package/dist/types/acp-presets.d.ts.map +1 -1
- package/dist/types/acp.d.ts.map +1 -1
- package/dist/types/catalog.d.ts.map +1 -1
- package/dist/types/cli-presets.d.ts.map +1 -1
- package/dist/types/cli.d.ts.map +1 -1
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/model-reference.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -1
- package/dist/types/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -274,6 +274,7 @@ Known local presets now include:
|
|
|
274
274
|
- `openai:codex-cli`
|
|
275
275
|
- `anthropic:claude-cli`
|
|
276
276
|
- `openclaude:openclaude-cli`
|
|
277
|
+
- `pi:pi-cli`
|
|
277
278
|
- `anthropic:claude-code-acp`
|
|
278
279
|
- `opencode:opencode-server`
|
|
279
280
|
- `opencode:opencode-acp`
|
|
@@ -362,7 +363,7 @@ const client = createLocalClient(
|
|
|
362
363
|
);
|
|
363
364
|
```
|
|
364
365
|
|
|
365
|
-
|
|
366
|
+
`pi` has a built-in CLI preset (`pi-cli`). The preset supplies the default command (`pi`), argsTemplate (`["--print","--model","{model}","{prompt}"]`), parser (`kind: "text"`), and discovery (`via: "none"`). The minimal config is therefore:
|
|
366
367
|
|
|
367
368
|
```ts
|
|
368
369
|
import { createLocalClient, defineConfig } from "@vedmalex/ai-connect";
|
|
@@ -376,15 +377,9 @@ const client = createLocalClient(
|
|
|
376
377
|
id: "local",
|
|
377
378
|
transport: {
|
|
378
379
|
kind: "cli",
|
|
379
|
-
id: "pi-cli",
|
|
380
|
-
command: "pi",
|
|
381
|
-
cli: {
|
|
382
|
-
argsTemplate: ["--print", "--model", "{model}", "{prompt}"],
|
|
383
|
-
parser: { kind: "text" }, // raw stdout -> result.text
|
|
384
|
-
discovery: { via: "none" }, // no ACP sidecar for pi
|
|
385
|
-
},
|
|
380
|
+
id: "pi-cli", // selects the built-in pi-cli preset
|
|
386
381
|
},
|
|
387
|
-
models: ["gemini-3.1-pro-low"
|
|
382
|
+
models: ["gemini-3.1-pro-low"],
|
|
388
383
|
},
|
|
389
384
|
],
|
|
390
385
|
},
|
package/dist/browser/index.js
CHANGED
|
@@ -383,7 +383,7 @@ function normalizeTransport(providerId, input) {
|
|
|
383
383
|
};
|
|
384
384
|
}
|
|
385
385
|
if (descriptor.kind === "cli") {
|
|
386
|
-
const inferredId2 = providerId === "anthropic" ? "claude-cli" : providerId === "openclaude" ? "openclaude-cli" : providerId === "openai" ? "codex-cli" : providerId === "
|
|
386
|
+
const inferredId2 = providerId === "anthropic" ? "claude-cli" : providerId === "openclaude" ? "openclaude-cli" : providerId === "openai" ? "codex-cli" : providerId === "pi" ? "pi-cli" : "cli";
|
|
387
387
|
return {
|
|
388
388
|
kind: "cli",
|
|
389
389
|
id: descriptor.id?.trim() || inferredId2,
|
|
@@ -400,7 +400,7 @@ function normalizeTransport(providerId, input) {
|
|
|
400
400
|
...descriptor.baseUrl?.trim() ? { baseUrl: descriptor.baseUrl.trim() } : {}
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
|
-
const inferredId = providerId === "anthropic" ? "claude-code-acp" : providerId === "openai" ? "codex-acp" :
|
|
403
|
+
const inferredId = providerId === "anthropic" ? "claude-code-acp" : providerId === "openai" ? "codex-acp" : "acp";
|
|
404
404
|
const normalizedLaunch = descriptor.launch ? (() => {
|
|
405
405
|
const contextMode = descriptor.launch?.contextMode ?? "workspace";
|
|
406
406
|
const skillsMode = descriptor.launch?.skillsMode ?? "default";
|
|
@@ -1638,18 +1638,14 @@ var MODEL_REFERENCE = {
|
|
|
1638
1638
|
key: "gemini-3.1-flash-lite",
|
|
1639
1639
|
contextLength: 1048576
|
|
1640
1640
|
},
|
|
1641
|
+
"gemini-3.1-pro": { key: "gemini-3.1-pro", contextLength: 1048576 },
|
|
1641
1642
|
"gemini-3-pro": { key: "gemini-3-pro", contextLength: 2097152 },
|
|
1642
1643
|
"auto-gemini-3": { key: "auto-gemini-3", contextLength: 1048576 },
|
|
1643
1644
|
"gemini-2.5-flash": { key: "gemini-2.5-flash", contextLength: 1048576 },
|
|
1644
1645
|
"gemini-2.5-pro": { key: "gemini-2.5-pro", contextLength: 2097152 },
|
|
1645
1646
|
"gemini-2.0-flash": { key: "gemini-2.0-flash", contextLength: 1048576 },
|
|
1646
1647
|
"gemini-1.5-flash": { key: "gemini-1.5-flash", contextLength: 1048576 },
|
|
1647
|
-
"gemini-1.5-pro": { key: "gemini-1.5-pro", contextLength: 2097152 }
|
|
1648
|
-
// --- Qwen (catalog: qwen3-coder-plus) ---
|
|
1649
|
-
"qwen3-coder-plus": { key: "qwen3-coder-plus", contextLength: 1048576 },
|
|
1650
|
-
"qwen3-coder": { key: "qwen3-coder", contextLength: 262144 },
|
|
1651
|
-
"qwen-max": { key: "qwen-max", contextLength: 32768 },
|
|
1652
|
-
"qwen-plus": { key: "qwen-plus", contextLength: 131072 }
|
|
1648
|
+
"gemini-1.5-pro": { key: "gemini-1.5-pro", contextLength: 2097152 }
|
|
1653
1649
|
};
|
|
1654
1650
|
function normalizeModelKey(model) {
|
|
1655
1651
|
let key = model.trim().toLowerCase();
|
|
@@ -6340,54 +6336,26 @@ function createDefaultRouteHandlers(options = {}) {
|
|
|
6340
6336
|
var AI_CONNECT_DEFAULT_ACP_COMMANDS = {
|
|
6341
6337
|
"anthropic:claude-code-acp": "npx -y @agentclientprotocol/claude-agent-acp@^0.25.0",
|
|
6342
6338
|
"openai:codex-acp": "npx @zed-industries/codex-acp@^0.11.1",
|
|
6343
|
-
"gemini:gemini-acp": "gemini --acp",
|
|
6344
|
-
"qwen:qwen-acp": "qwen --acp",
|
|
6345
6339
|
"opencode:opencode-acp": "opencode acp"
|
|
6346
6340
|
};
|
|
6347
6341
|
|
|
6348
6342
|
// src/cli-presets.ts
|
|
6349
6343
|
var AI_CONNECT_DEFAULT_CLI_PRESETS = {
|
|
6350
|
-
|
|
6351
|
-
id: "
|
|
6352
|
-
label: "
|
|
6353
|
-
command: "
|
|
6354
|
-
transportId: "
|
|
6344
|
+
pi: {
|
|
6345
|
+
id: "pi",
|
|
6346
|
+
label: "pi (coding agent)",
|
|
6347
|
+
command: "pi",
|
|
6348
|
+
transportId: "pi-cli",
|
|
6355
6349
|
options: {
|
|
6356
|
-
preset: "
|
|
6357
|
-
|
|
6350
|
+
preset: "pi",
|
|
6351
|
+
// pi print mode emits the answer as plain text on stdout (no JSON wrapper),
|
|
6352
|
+
// and has no ACP mode — so it uses the raw `text` parser and no discovery sidecar.
|
|
6353
|
+
argsTemplate: ["--print", "--model", "{model}", "{prompt}"],
|
|
6358
6354
|
discovery: {
|
|
6359
|
-
via: "
|
|
6360
|
-
acp: {
|
|
6361
|
-
transportId: "gemini-acp"
|
|
6362
|
-
}
|
|
6363
|
-
},
|
|
6364
|
-
parser: {
|
|
6365
|
-
kind: "json",
|
|
6366
|
-
textPath: "response",
|
|
6367
|
-
usagePath: "stats",
|
|
6368
|
-
errorPath: "error"
|
|
6369
|
-
}
|
|
6370
|
-
}
|
|
6371
|
-
},
|
|
6372
|
-
qwen: {
|
|
6373
|
-
id: "qwen",
|
|
6374
|
-
label: "Qwen CLI",
|
|
6375
|
-
command: "qwen",
|
|
6376
|
-
transportId: "qwen-cli",
|
|
6377
|
-
options: {
|
|
6378
|
-
preset: "qwen",
|
|
6379
|
-
argsTemplate: ["-p", "{prompt}", "--output-format", "json", "--model", "{model}"],
|
|
6380
|
-
discovery: {
|
|
6381
|
-
via: "acp",
|
|
6382
|
-
acp: {
|
|
6383
|
-
transportId: "qwen-acp"
|
|
6384
|
-
}
|
|
6355
|
+
via: "none"
|
|
6385
6356
|
},
|
|
6386
6357
|
parser: {
|
|
6387
|
-
kind: "
|
|
6388
|
-
textPath: "__preset__:qwen.result",
|
|
6389
|
-
usagePath: "__preset__:qwen.stats",
|
|
6390
|
-
errorPath: "__preset__:qwen.error"
|
|
6358
|
+
kind: "text"
|
|
6391
6359
|
}
|
|
6392
6360
|
}
|
|
6393
6361
|
},
|
|
@@ -6471,8 +6439,7 @@ var AI_CONNECT_DEFAULT_CLI_COMMANDS = {
|
|
|
6471
6439
|
"anthropic:openclaude-cli": AI_CONNECT_DEFAULT_CLI_PRESETS.openclaude.command,
|
|
6472
6440
|
"openclaude:openclaude-cli": AI_CONNECT_DEFAULT_CLI_PRESETS.openclaude.command,
|
|
6473
6441
|
"openai:codex-cli": AI_CONNECT_DEFAULT_CLI_PRESETS.codex.command,
|
|
6474
|
-
"
|
|
6475
|
-
"qwen:qwen-cli": AI_CONNECT_DEFAULT_CLI_PRESETS.qwen.command
|
|
6442
|
+
"pi:pi-cli": AI_CONNECT_DEFAULT_CLI_PRESETS.pi.command
|
|
6476
6443
|
};
|
|
6477
6444
|
function getCliTransportPreset(presetId) {
|
|
6478
6445
|
return AI_CONNECT_DEFAULT_CLI_PRESETS[presetId];
|
|
@@ -6594,52 +6561,22 @@ var TEXT_PROVIDER_CATALOG = [
|
|
|
6594
6561
|
runtime: "universal",
|
|
6595
6562
|
defaultModel: "gemini-3.1-flash-lite",
|
|
6596
6563
|
defaultBaseUrl: ""
|
|
6597
|
-
},
|
|
6598
|
-
{
|
|
6599
|
-
providerId: "gemini",
|
|
6600
|
-
providerLabel: "Gemini",
|
|
6601
|
-
transportKind: "cli",
|
|
6602
|
-
transportId: "gemini-cli",
|
|
6603
|
-
transportLabel: "Gemini CLI",
|
|
6604
|
-
runtime: "local",
|
|
6605
|
-
defaultModel: "gemini-2.5-flash",
|
|
6606
|
-
defaultCommand: AI_CONNECT_DEFAULT_CLI_COMMANDS["gemini:gemini-cli"]
|
|
6607
|
-
},
|
|
6608
|
-
{
|
|
6609
|
-
providerId: "gemini",
|
|
6610
|
-
providerLabel: "Gemini",
|
|
6611
|
-
transportKind: "acp",
|
|
6612
|
-
transportId: "gemini-acp",
|
|
6613
|
-
transportLabel: "Gemini ACP",
|
|
6614
|
-
runtime: "local",
|
|
6615
|
-
defaultModel: "auto-gemini-3",
|
|
6616
|
-
defaultCommand: AI_CONNECT_DEFAULT_ACP_COMMANDS["gemini:gemini-acp"]
|
|
6617
6564
|
}
|
|
6618
6565
|
]
|
|
6619
6566
|
},
|
|
6620
6567
|
{
|
|
6621
|
-
providerId: "
|
|
6622
|
-
label: "
|
|
6568
|
+
providerId: "pi",
|
|
6569
|
+
label: "pi",
|
|
6623
6570
|
transports: [
|
|
6624
6571
|
{
|
|
6625
|
-
providerId: "
|
|
6626
|
-
providerLabel: "
|
|
6572
|
+
providerId: "pi",
|
|
6573
|
+
providerLabel: "pi",
|
|
6627
6574
|
transportKind: "cli",
|
|
6628
|
-
transportId: "
|
|
6629
|
-
transportLabel: "
|
|
6630
|
-
runtime: "local",
|
|
6631
|
-
defaultModel: "qwen3-coder-plus",
|
|
6632
|
-
defaultCommand: AI_CONNECT_DEFAULT_CLI_COMMANDS["qwen:qwen-cli"]
|
|
6633
|
-
},
|
|
6634
|
-
{
|
|
6635
|
-
providerId: "qwen",
|
|
6636
|
-
providerLabel: "Qwen",
|
|
6637
|
-
transportKind: "acp",
|
|
6638
|
-
transportId: "qwen-acp",
|
|
6639
|
-
transportLabel: "Qwen ACP",
|
|
6575
|
+
transportId: "pi-cli",
|
|
6576
|
+
transportLabel: "pi CLI",
|
|
6640
6577
|
runtime: "local",
|
|
6641
|
-
defaultModel: "
|
|
6642
|
-
defaultCommand:
|
|
6578
|
+
defaultModel: "gemini-3.1-pro-low",
|
|
6579
|
+
defaultCommand: AI_CONNECT_DEFAULT_CLI_COMMANDS["pi:pi-cli"]
|
|
6643
6580
|
}
|
|
6644
6581
|
]
|
|
6645
6582
|
},
|