@vandeepunk/pi-coding-agent 0.0.5 → 0.0.6
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/CHANGELOG.md +32 -1
- package/README.md +8 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +6 -6
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts +3 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +2 -1
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +1 -1
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/template.css +59 -0
- package/dist/core/export-html/template.js +21 -1
- package/dist/core/extensions/types.d.ts +2 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +1 -2
- package/dist/core/package-manager.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +4 -2
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/docs/custom-provider.md +9 -0
- package/docs/extensions.md +1 -1
- package/docs/providers.md +24 -19
- package/docs/rpc.md +7 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
- package/examples/extensions/subagent/index.ts +2 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
package/docs/custom-provider.md
CHANGED
|
@@ -7,8 +7,17 @@ Extensions can register custom model providers via `pi.registerProvider()`. This
|
|
|
7
7
|
- **OAuth/SSO** - Add authentication flows for enterprise providers
|
|
8
8
|
- **Custom APIs** - Implement streaming for non-standard LLM APIs
|
|
9
9
|
|
|
10
|
+
## Example Extensions
|
|
11
|
+
|
|
12
|
+
See these complete provider examples:
|
|
13
|
+
|
|
14
|
+
- [`examples/extensions/custom-provider-anthropic/`](../examples/extensions/custom-provider-anthropic/)
|
|
15
|
+
- [`examples/extensions/custom-provider-gitlab-duo/`](../examples/extensions/custom-provider-gitlab-duo/)
|
|
16
|
+
- [`examples/extensions/custom-provider-qwen-cli/`](../examples/extensions/custom-provider-qwen-cli/)
|
|
17
|
+
|
|
10
18
|
## Table of Contents
|
|
11
19
|
|
|
20
|
+
- [Example Extensions](#example-extensions)
|
|
12
21
|
- [Quick Reference](#quick-reference)
|
|
13
22
|
- [Override Existing Provider](#override-existing-provider)
|
|
14
23
|
- [Register New Provider](#register-new-provider)
|
package/docs/extensions.md
CHANGED
|
@@ -623,7 +623,7 @@ UI methods for user interaction. See [Custom UI](#custom-ui) for full details.
|
|
|
623
623
|
|
|
624
624
|
### ctx.hasUI
|
|
625
625
|
|
|
626
|
-
`false` in print mode (`-p`)
|
|
626
|
+
`false` in print mode (`-p`) and JSON mode. `true` in interactive and RPC mode. In RPC mode, dialog methods (`select`, `confirm`, `input`, `editor`) work via the extension UI sub-protocol, and fire-and-forget methods (`notify`, `setStatus`, `setWidget`, `setTitle`, `setEditorText`) emit requests to the client. Some TUI-specific methods are no-ops or return defaults (see [rpc.md](rpc.md#extension-ui-protocol)).
|
|
627
627
|
|
|
628
628
|
### ctx.cwd
|
|
629
629
|
|
package/docs/providers.md
CHANGED
|
@@ -42,6 +42,8 @@ Use `/logout` to clear credentials. Tokens are stored in `~/.pi/agent/auth.json`
|
|
|
42
42
|
|
|
43
43
|
## API Keys
|
|
44
44
|
|
|
45
|
+
### Environment Variables or Auth File
|
|
46
|
+
|
|
45
47
|
Set via environment variable:
|
|
46
48
|
|
|
47
49
|
```bash
|
|
@@ -49,25 +51,28 @@ export ANTHROPIC_API_KEY=sk-ant-...
|
|
|
49
51
|
pi
|
|
50
52
|
```
|
|
51
53
|
|
|
52
|
-
| Provider | Environment Variable |
|
|
53
|
-
|
|
54
|
-
| Anthropic | `ANTHROPIC_API_KEY` |
|
|
55
|
-
| OpenAI | `
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|
|
|
67
|
-
|
|
|
68
|
-
| MiniMax
|
|
69
|
-
|
|
70
|
-
|
|
54
|
+
| Provider | Environment Variable | `auth.json` key |
|
|
55
|
+
|----------|----------------------|------------------|
|
|
56
|
+
| Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
|
|
57
|
+
| Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
|
|
58
|
+
| OpenAI | `OPENAI_API_KEY` | `openai` |
|
|
59
|
+
| Google Gemini | `GEMINI_API_KEY` | `google` |
|
|
60
|
+
| Mistral | `MISTRAL_API_KEY` | `mistral` |
|
|
61
|
+
| Groq | `GROQ_API_KEY` | `groq` |
|
|
62
|
+
| Cerebras | `CEREBRAS_API_KEY` | `cerebras` |
|
|
63
|
+
| xAI | `XAI_API_KEY` | `xai` |
|
|
64
|
+
| OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
|
|
65
|
+
| Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
|
|
66
|
+
| ZAI | `ZAI_API_KEY` | `zai` |
|
|
67
|
+
| OpenCode Zen | `OPENCODE_API_KEY` | `opencode` |
|
|
68
|
+
| Hugging Face | `HF_TOKEN` | `huggingface` |
|
|
69
|
+
| Kimi For Coding | `KIMI_API_KEY` | `kimi-coding` |
|
|
70
|
+
| MiniMax | `MINIMAX_API_KEY` | `minimax` |
|
|
71
|
+
| MiniMax (China) | `MINIMAX_CN_API_KEY` | `minimax-cn` |
|
|
72
|
+
|
|
73
|
+
Reference for environment variables and `auth.json` keys: [`const envMap`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts) in [`packages/ai/src/env-api-keys.ts`](https://github.com/badlogic/pi-mono/blob/main/packages/ai/src/env-api-keys.ts).
|
|
74
|
+
|
|
75
|
+
#### Auth File
|
|
71
76
|
|
|
72
77
|
Store credentials in `~/.pi/agent/auth.json`:
|
|
73
78
|
|
package/docs/rpc.md
CHANGED
|
@@ -928,11 +928,17 @@ There are two categories of extension UI methods:
|
|
|
928
928
|
|
|
929
929
|
If a dialog method includes a `timeout` field, the agent-side will auto-resolve with a default value when the timeout expires. The client does not need to track timeouts.
|
|
930
930
|
|
|
931
|
-
Some `ExtensionUIContext` methods are not supported in RPC mode because they require direct TUI access:
|
|
931
|
+
Some `ExtensionUIContext` methods are not supported or degraded in RPC mode because they require direct TUI access:
|
|
932
932
|
- `custom()` returns `undefined`
|
|
933
933
|
- `setWorkingMessage()`, `setFooter()`, `setHeader()`, `setEditorComponent()`, `setToolsExpanded()` are no-ops
|
|
934
934
|
- `getEditorText()` returns `""`
|
|
935
935
|
- `getToolsExpanded()` returns `false`
|
|
936
|
+
- `pasteToEditor()` delegates to `setEditorText()` (no paste/collapse handling)
|
|
937
|
+
- `getAllThemes()` returns `[]`
|
|
938
|
+
- `getTheme()` returns `undefined`
|
|
939
|
+
- `setTheme()` returns `{ success: false, error: "..." }`
|
|
940
|
+
|
|
941
|
+
Note: `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol.
|
|
936
942
|
|
|
937
943
|
### Extension UI Requests (stdout)
|
|
938
944
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-custom-provider",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.9",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-custom-provider",
|
|
9
|
-
"version": "1.3.
|
|
9
|
+
"version": "1.3.9",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.52.0"
|
|
12
12
|
}
|
|
@@ -231,13 +231,14 @@ async function runSingleAgent(
|
|
|
231
231
|
const agent = agents.find((a) => a.name === agentName);
|
|
232
232
|
|
|
233
233
|
if (!agent) {
|
|
234
|
+
const available = agents.map((a) => `"${a.name}"`).join(", ") || "none";
|
|
234
235
|
return {
|
|
235
236
|
agent: agentName,
|
|
236
237
|
agentSource: "unknown",
|
|
237
238
|
task,
|
|
238
239
|
exitCode: 1,
|
|
239
240
|
messages: [],
|
|
240
|
-
stderr: `Unknown agent: ${agentName}
|
|
241
|
+
stderr: `Unknown agent: "${agentName}". Available agents: ${available}.`,
|
|
241
242
|
usage: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, cost: 0, contextTokens: 0, turns: 0 },
|
|
242
243
|
step,
|
|
243
244
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-extension-with-deps",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.9",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pi-extension-with-deps",
|
|
9
|
-
"version": "1.16.
|
|
9
|
+
"version": "1.16.9",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"ms": "^2.1.3"
|
|
12
12
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vandeepunk/pi-coding-agent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management forked from @mariozechner/pi-coding-agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"piConfig": {
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@mariozechner/jiti": "^2.6.2",
|
|
43
|
-
"@mariozechner/pi-agent-core": "^0.52.
|
|
44
|
-
"@mariozechner/pi-ai": "^0.52.
|
|
45
|
-
"@mariozechner/pi-tui": "^0.52.
|
|
43
|
+
"@mariozechner/pi-agent-core": "^0.52.9",
|
|
44
|
+
"@mariozechner/pi-ai": "^0.52.9",
|
|
45
|
+
"@mariozechner/pi-tui": "^0.52.9",
|
|
46
46
|
"@silvia-odwyer/photon-node": "^0.3.4",
|
|
47
47
|
"chalk": "^5.5.0",
|
|
48
48
|
"cli-highlight": "^2.1.11",
|