@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.
Files changed (35) hide show
  1. package/CHANGELOG.md +32 -1
  2. package/README.md +8 -0
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +6 -6
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/agent-session.d.ts +3 -6
  7. package/dist/core/agent-session.d.ts.map +1 -1
  8. package/dist/core/agent-session.js +2 -1
  9. package/dist/core/agent-session.js.map +1 -1
  10. package/dist/core/export-html/index.d.ts.map +1 -1
  11. package/dist/core/export-html/index.js +1 -1
  12. package/dist/core/export-html/index.js.map +1 -1
  13. package/dist/core/export-html/template.css +59 -0
  14. package/dist/core/export-html/template.js +21 -1
  15. package/dist/core/extensions/types.d.ts +2 -2
  16. package/dist/core/extensions/types.d.ts.map +1 -1
  17. package/dist/core/extensions/types.js.map +1 -1
  18. package/dist/core/package-manager.d.ts.map +1 -1
  19. package/dist/core/package-manager.js +1 -2
  20. package/dist/core/package-manager.js.map +1 -1
  21. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  22. package/dist/modes/interactive/interactive-mode.js +4 -2
  23. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  24. package/docs/custom-provider.md +9 -0
  25. package/docs/extensions.md +1 -1
  26. package/docs/providers.md +24 -19
  27. package/docs/rpc.md +7 -1
  28. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  29. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  30. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  31. package/examples/extensions/custom-provider-qwen-cli/package.json +1 -1
  32. package/examples/extensions/subagent/index.ts +2 -1
  33. package/examples/extensions/with-deps/package-lock.json +2 -2
  34. package/examples/extensions/with-deps/package.json +1 -1
  35. package/package.json +4 -4
@@ -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)
@@ -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`), JSON mode, and RPC mode. Always check before using `ctx.ui`.
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 | `OPENAI_API_KEY` |
56
- | Google Gemini | `GEMINI_API_KEY` |
57
- | Mistral | `MISTRAL_API_KEY` |
58
- | Groq | `GROQ_API_KEY` |
59
- | Cerebras | `CEREBRAS_API_KEY` |
60
- | xAI | `XAI_API_KEY` |
61
- | OpenRouter | `OPENROUTER_API_KEY` |
62
- | Vercel AI Gateway | `AI_GATEWAY_API_KEY` |
63
- | ZAI | `ZAI_API_KEY` |
64
- | OpenCode Zen | `OPENCODE_API_KEY` |
65
- | Hugging Face | `HF_TOKEN` |
66
- | Kimi For Coding | `KIMI_API_KEY` |
67
- | MiniMax | `MINIMAX_API_KEY` |
68
- | MiniMax (China) | `MINIMAX_CN_API_KEY` |
69
-
70
- ## Auth File
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.8",
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.8",
9
+ "version": "1.3.9",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.52.0"
12
12
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-anthropic",
3
3
  "private": true,
4
- "version": "1.3.8",
4
+ "version": "1.3.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-gitlab-duo",
3
3
  "private": true,
4
- "version": "1.3.8",
4
+ "version": "1.3.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-custom-provider-qwen-cli",
3
3
  "private": true,
4
- "version": "1.2.8",
4
+ "version": "1.2.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
@@ -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.8",
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.8",
9
+ "version": "1.16.9",
10
10
  "dependencies": {
11
11
  "ms": "^2.1.3"
12
12
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-extension-with-deps",
3
3
  "private": true,
4
- "version": "1.16.8",
4
+ "version": "1.16.9",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "clean": "echo 'nothing to clean'",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vandeepunk/pi-coding-agent",
3
- "version": "0.0.5",
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.8",
44
- "@mariozechner/pi-ai": "^0.52.8",
45
- "@mariozechner/pi-tui": "^0.52.8",
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",