@counterposition/skill-pi 0.74.1 → 0.78.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@counterposition/skill-pi",
3
- "version": "0.74.1",
3
+ "version": "0.78.1",
4
4
  "description": "Pi coding agent reference skill — extensions, settings, providers, SDK/RPC, packages, and .pi/ config",
5
5
  "keywords": [
6
6
  "ai-skill",
@@ -82,7 +82,7 @@ Useful session events:
82
82
 
83
83
  Useful agent events:
84
84
 
85
- - `input`
85
+ - `input` — carries `event.streamingBehavior` (`"steer" | "followUp" | undefined`) so handlers can distinguish idle prompts, mid-stream steers, and queued follow-ups; return `{ action: "transform" | "handled" | "continue" }`
86
86
  - `before_agent_start` — receives `event.systemPromptOptions` (a `BuildSystemPromptOptions`) so handlers can inspect the structured inputs feeding the system prompt
87
87
  - `agent_start`
88
88
  - `agent_end`
@@ -111,19 +111,23 @@ Tool results may include `terminate: true` to end the current tool batch without
111
111
 
112
112
  ## Extension Context
113
113
 
114
- `ctx` gives extensions access to:
114
+ `ctx` (`ExtensionContext`) gives extensions access to:
115
115
 
116
116
  - `ctx.ui` for interactive UI hooks
117
+ - `ctx.mode` — `"tui" | "rpc" | "json" | "print"`; gate terminal-only features on `ctx.mode === "tui"`
117
118
  - `ctx.cwd`
118
- - `ctx.session`
119
- - `ctx.sessionManager`
120
- - `ctx.modelRegistry`
121
- - `ctx.hasUI`
122
- - `ctx.isIdle()`
123
- - `ctx.abort()`
119
+ - `ctx.sessionManager` (read-only)
120
+ - `ctx.modelRegistry` / `ctx.model`
121
+ - `ctx.hasUI` — `true` in TUI and RPC modes
122
+ - `ctx.signal` — the active agent abort signal (or `undefined` when idle); pass it to `fetch`/model calls for abort-aware nested work
123
+ - `ctx.isIdle()` / `ctx.hasPendingMessages()`
124
+ - `ctx.abort()` / `ctx.shutdown()`
124
125
  - `ctx.getContextUsage()`
126
+ - `ctx.compact(options?)` — trigger compaction without awaiting completion
125
127
  - `ctx.getSystemPrompt()`
126
128
 
129
+ Command handlers receive `ExtensionCommandContext`, which extends the above with session-control methods that would deadlock from event handlers: `ctx.getSystemPromptOptions()` (inspect the base system-prompt inputs), `ctx.waitForIdle()`, `ctx.newSession()`, `ctx.fork()`, `ctx.switchSession()`, `ctx.navigateTree()`, and `ctx.reload()`.
130
+
127
131
  ## Tool Registration
128
132
 
129
133
  ```typescript
@@ -149,6 +153,8 @@ pi.registerTool({
149
153
  });
150
154
  ```
151
155
 
156
+ Optional prompt metadata: add `promptSnippet` to give the tool a one-line entry in the system prompt's `Available tools` list, and `promptGuidelines: string[]` to append bullets to the `Guidelines` section while the tool is active. Guidelines are appended flat with no tool-name prefix, so each bullet must name its tool (write `"Use my_tool when..."`, not `"Use this tool when..."`). `pi.getAllTools()` exposes each tool's `promptGuidelines` for attribution.
157
+
152
158
  Important rules:
153
159
 
154
160
  1. Truncate large output.
@@ -23,7 +23,7 @@ pi update <source> # update one package
23
23
  pi config
24
24
  ```
25
25
 
26
- By default, `install` and `remove` write to global settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead.
26
+ By default, `install` and `remove` write to user settings (`~/.pi/agent/settings.json`). Use `-l` to write to project settings (`.pi/settings.json`) instead.
27
27
 
28
28
  Project installs are shareable with a team. Pi will install missing project packages automatically on startup.
29
29
 
@@ -38,7 +38,7 @@ npm:@scope/pkg@1.2.3
38
38
  npm:pkg
39
39
  ```
40
40
 
41
- - Global installs use `npm install -g`
41
+ - User installs go under `~/.pi/agent/npm/`
42
42
  - Project installs go under `.pi/npm/`
43
43
  - Version-pinned installs are skipped by `pi update`
44
44
  - Use `npmCommand` in settings if you need a wrapper such as `mise` or `asdf`
@@ -7,7 +7,7 @@ Pi supports subscription-based providers via OAuth, API-key providers via env va
7
7
  Use `/login` in interactive mode, then select a provider. The `/login` selector is fuzzy-searchable and shows where each entry's auth comes from (`--api-key`, env var, custom provider) without leaking the secret.
8
8
 
9
9
  - Anthropic Claude Pro / Max — third-party usage draws from extra usage and is billed per token (suppress the warning via `warnings.anthropicExtraUsage`)
10
- - OpenAI ChatGPT Plus / Pro (Codex)
10
+ - OpenAI ChatGPT Plus / Pro (Codex) — `/login` defaults to browser auth but can use a device-code flow for headless environments
11
11
  - GitHub Copilot
12
12
 
13
13
  Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Google Gemini CLI and Google Antigravity providers.
@@ -17,9 +17,11 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
17
17
  | Provider | Env Var | `auth.json` key |
18
18
  |----------|---------|-----------------|
19
19
  | Anthropic | `ANTHROPIC_API_KEY` | `anthropic` |
20
+ | Ant Ling | `ANT_LING_API_KEY` | `ant-ling` |
20
21
  | Azure OpenAI Responses | `AZURE_OPENAI_API_KEY` | `azure-openai-responses` |
21
22
  | OpenAI | `OPENAI_API_KEY` | `openai` |
22
23
  | DeepSeek | `DEEPSEEK_API_KEY` | `deepseek` |
24
+ | NVIDIA NIM | `NVIDIA_API_KEY` | `nvidia` |
23
25
  | Google Gemini | `GEMINI_API_KEY` | `google` |
24
26
  | Mistral | `MISTRAL_API_KEY` | `mistral` |
25
27
  | Groq | `GROQ_API_KEY` | `groq` |
@@ -30,6 +32,7 @@ Use `/logout` to clear stored OAuth credentials. Pi 0.71.0 removed built-in Goog
30
32
  | OpenRouter | `OPENROUTER_API_KEY` | `openrouter` |
31
33
  | Vercel AI Gateway | `AI_GATEWAY_API_KEY` | `vercel-ai-gateway` |
32
34
  | ZAI | `ZAI_API_KEY` | `zai` |
35
+ | ZAI Coding Plan (China) | `ZAI_CODING_CN_API_KEY` | `zai-coding-cn` |
33
36
  | OpenCode Zen | `OPENCODE_API_KEY` | `opencode` |
34
37
  | OpenCode Go | `OPENCODE_API_KEY` | `opencode-go` |
35
38
  | Hugging Face | `HF_TOKEN` | `huggingface` |
@@ -66,10 +66,10 @@ const { session } = await createAgentSession({
66
66
  agentDir: "~/.pi/agent",
67
67
  authStorage,
68
68
  modelRegistry,
69
- model: getModel("anthropic", "claude-opus-4-7"),
69
+ model: getModel("anthropic", "claude-opus-4-8"),
70
70
  thinkingLevel: "medium",
71
71
  scopedModels: [
72
- { model: getModel("anthropic", "claude-opus-4-7"), thinkingLevel: "high" },
72
+ { model: getModel("anthropic", "claude-opus-4-8"), thinkingLevel: "high" },
73
73
  ],
74
74
  tools: ["read", "bash", "edit", "write"],
75
75
  customTools: [/* defineTool(...) entries */],
@@ -65,11 +65,10 @@ Edit JSON directly or use `/settings` for common interactive options.
65
65
  "enabled": true,
66
66
  "maxRetries": 3,
67
67
  "baseDelayMs": 2000,
68
- "maxDelayMs": 60000,
69
68
  "provider": {
70
- "timeoutMs": 0,
69
+ "timeoutMs": 3600000,
71
70
  "maxRetries": 0,
72
- "maxRetryDelayMs": 0
71
+ "maxRetryDelayMs": 60000
73
72
  }
74
73
  }
75
74
  }
@@ -77,8 +76,9 @@ Edit JSON directly or use `/settings` for common interactive options.
77
76
 
78
77
  Notes:
79
78
 
80
- - `retry.maxDelayMs = 0` disables the cap on server-requested retry delays.
81
- - `retry.provider.*` (Pi 0.70.1) controls the underlying provider SDK's request timeout and retry/backoff — useful for slow local LLMs and flaky proxies. Pi forwards these into `streamSimple` request options when set.
79
+ - `retry.maxRetries` (default `3`) and `retry.baseDelayMs` (default `2000`) govern Pi's own agent-level retry with exponential backoff.
80
+ - `retry.provider.*` controls the underlying provider SDK's request timeout and retry/backoff — useful for slow local LLMs and flaky proxies. `retry.provider.timeoutMs` sets the SDK request timeout; `retry.provider.maxRetries` defaults to `0` (keep it there unless you need SDK-level retries, since raising it can let provider retries swallow usage-limit errors before Pi handles them).
81
+ - `retry.provider.maxRetryDelayMs` (default `60000`) caps how long a server-requested retry delay can be before the request fails immediately with an informative error; set to `0` to disable the cap. The old top-level `retry.maxDelayMs` was renamed to this and is auto-migrated.
82
82
  - `branchSummary.skipPrompt` skips the confirmation step when navigating with `/tree`.
83
83
 
84
84
  ## Message Delivery
@@ -87,12 +87,16 @@ Notes:
87
87
  {
88
88
  "steeringMode": "one-at-a-time",
89
89
  "followUpMode": "one-at-a-time",
90
- "transport": "sse"
90
+ "transport": "auto",
91
+ "httpIdleTimeoutMs": 300000,
92
+ "websocketConnectTimeoutMs": 15000
91
93
  }
92
94
  ```
93
95
 
94
96
  - `steeringMode` and `followUpMode`: `"all"` or `"one-at-a-time"`
95
- - `transport`: `"sse"`, `"websocket"`, or `"auto"`
97
+ - `transport` (default `"auto"`): `"sse"`, `"websocket"`, `"websocket-cached"`, or `"auto"` — the preferred transport for providers that support several
98
+ - `httpIdleTimeoutMs` (default `300000`) is the HTTP header/body idle timeout, also applied as the default SDK request timeout for providers that support it (e.g. OpenAI Codex WebSocket waits, llama.cpp). Set to `0` to disable.
99
+ - `websocketConnectTimeoutMs` (default `15000`) bounds the WebSocket connect/open handshake. Set to `0` to disable.
96
100
 
97
101
  ## Terminal, Images, and Shell
98
102
 
@@ -114,7 +118,7 @@ Notes:
114
118
  }
115
119
  ```
116
120
 
117
- - `npmCommand` is argv-style and is used for npm lookup/install operations, including git-package installs.
121
+ - `npmCommand` is argv-style and is used for npm lookup/install operations, including git-package installs. User-scoped npm packages install under `~/.pi/agent/npm/`; project-scoped npm packages install under `.pi/npm/`.
118
122
  - `terminal.showTerminalProgress` (default `false` since Pi 0.70.0) toggles OSC 9;4 progress reporting in supporting terminals (iTerm2, WezTerm, Windows Terminal, Kitty).
119
123
  - `terminal.imageWidthCells` (Pi 0.68.1) caps inline tool-output image width in terminal cells.
120
124
 
@@ -218,12 +222,15 @@ pi [options] [@files...] [messages...]
218
222
  -c, --continue continue most recent session
219
223
  -r, --resume browse and select
220
224
  --session <path|id>
225
+ --session-id <id> use an exact project-local session id, creating it if missing
221
226
  --fork <path|id>
222
227
  --session-dir <dir>
228
+ -n, --name <name> set the session display name at startup
223
229
  --no-session ephemeral
224
230
 
225
231
  # tools and resources
226
232
  --tools <list>, -t name allowlist (read,bash,edit,write,grep,find,ls,...)
233
+ --exclude-tools <list>, -xt disable specific built-in/extension/custom tools, keep the rest
227
234
  --no-tools, -nt disable everything
228
235
  --no-builtin-tools, -nbt disable built-ins, keep extension/custom
229
236
  -e, --extension <source> repeatable; npm/git/path
@@ -248,7 +255,7 @@ pi [options] [@files...] [messages...]
248
255
  | `PI_PACKAGE_DIR` | Override package storage directory |
249
256
  | `PI_SKIP_VERSION_CHECK` | Skip the `pi.dev` latest-version request at startup |
250
257
  | `PI_OFFLINE` | Disable all startup network operations (update checks, telemetry) |
251
- | `PI_TELEMETRY` | Force install telemetry on/off (`1`/`0`); does not gate update checks |
258
+ | `PI_TELEMETRY` | Override install/update telemetry and provider attribution headers (`1`/`0`); does not gate update checks |
252
259
  | `PI_CACHE_RETENTION` | Set to `long` for extended prompt-cache retention where supported |
253
260
  | `PI_OAUTH_CALLBACK_HOST` | Bind the OAuth callback server to a custom interface |
254
261
  | `PI_CODING_AGENT=true` | Set automatically at startup so subprocesses can detect Pi |