pi-code 1.0.55 → 1.0.56

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 CHANGED
@@ -13,7 +13,7 @@
13
13
 
14
14
  Claude Code experience for the [pi](https://pi.dev) coding agent, in one package. Point pi at a project that already has a `.claude/` directory and it reads your existing config: rules, commands, skills, hooks, output styles, MCP servers, and agents. It also adds the Claude Code features pi lacks: a todo overlay, checkpoints, memory, web search, subagents, and goals.
15
15
 
16
- What a repository ships is treated as untrusted until you approve it: project MCP servers, hooks, agents, rules, output styles, commands and skills load only once you say yes.
16
+ What a repository ships is treated as untrusted until you approve it: project MCP servers, hooks, agents, rules, output styles, commands and skills load only once you say yes. A headless run (`pi -p`) cannot ask, so an undecided project loads none of them there, which is stricter than Claude, where a headless run uses them without showing the dialog.
17
17
 
18
18
  ![pi-code demo](demos/hero.gif)
19
19
 
@@ -45,7 +45,7 @@ Each topic links to its own doc with the full contract and any divergences from
45
45
  - **[MCP servers](docs/mcp.md)** — every Claude config scope, all four transports, OAuth, managed policy, timeouts, prompts, and resources.
46
46
  - **[Custom slash commands](docs/commands.md)** — `.claude/commands` with arguments, bash spans, `@file` inlining, frontmatter, and model invocation.
47
47
  - **[Skills](docs/skills.md)** — `.claude/skills` discovery plus the same dynamic content commands get.
48
- - **[Subagents / Task](docs/subagents.md)** — built-in and custom agents, background runs, per-agent memory, worktree isolation.
48
+ - **[Subagents](docs/subagents.md)** — built-in and custom agents, background runs, per-agent memory, worktree isolation.
49
49
  - **[CLAUDE.md, @imports, and rules](docs/claude-md.md)** — the context files and path-scoped rules pi does not load natively.
50
50
  - **[Settings `env`](docs/settings-env.md)** — env blocks from every settings scope, exported with Claude's precedence.
51
51
  - **[Output styles](docs/output-styles.md)** — replace semantics, bundled built-ins, `/output-style`.
@@ -224,7 +224,11 @@ export async function runHttpHook(hook: { type?: string; command: string; url?:
224
224
  }
225
225
  return { code: 0, stdout: body, stderr: '', timedOut: false }
226
226
  } catch (error) {
227
- return { code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error), timedOut: false }
227
+ // A timeout is the abort that AbortSignal.timeout raises. Mark it as one so a gated
228
+ // event fails closed on it, exactly as a command hook that ran out of time does: the
229
+ // hook never answered, whichever transport it used.
230
+ const name = error instanceof Error ? error.name : ''
231
+ return { code: 1, stdout: '', stderr: error instanceof Error ? error.message : String(error), timedOut: name === 'TimeoutError' || name === 'AbortError' }
228
232
  }
229
233
  }
230
234
 
@@ -319,7 +323,8 @@ export async function runMcpToolHook(hook: HookCommand, payload: unknown, timeou
319
323
  const input = hook.input && typeof hook.input === 'object' ? (substituteInputPaths(hook.input, payload) as Record<string, unknown>) : {}
320
324
  let timer: ReturnType<typeof setTimeout> | undefined
321
325
  const deadline = new Promise<HookRunResult>((resolve) => {
322
- timer = setTimeout(() => resolve({ code: 1, stdout: '', stderr: `mcp_tool hook timed out after ${timeoutMs}ms`, timedOut: false }), timeoutMs)
326
+ // Marked as a timeout so a gated event fails closed on it, like a command hook.
327
+ timer = setTimeout(() => resolve({ code: 1, stdout: '', stderr: `mcp_tool hook timed out after ${timeoutMs}ms`, timedOut: true }), timeoutMs)
323
328
  })
324
329
  const call = callMcpTool(hook.server, hook.tool, input)
325
330
  .then((result): HookRunResult => ({ code: result.isError ? 1 : 0, stdout: result.text, stderr: '', timedOut: false }))
@@ -39,7 +39,7 @@ This tool executes a separate `pi` subprocess with a delegated system prompt and
39
39
 
40
40
  **Default behavior:** Loads the bundled builtin agents (Explore, Plan, general-purpose) plus **user-level agents** from `~/.claude/agents` and `~/.pi/agent/agents`. A user or project agent with the same name overrides a builtin. Discovered agents and their descriptions are listed in the system prompt each turn, so the model can pick one itself; project agent descriptions appear only once the project is approved.
41
41
 
42
- To enable project-local agents (`.claude/agents`, `.pi/agents`), pass `agentScope: "both"` (or `"project"`). Only do this for repositories you trust.
42
+ Project-local agents (`.claude/agents`, `.pi/agents`) load once the project is approved: a default call resolves `agentScope` to `"both"` for an approved project and `"user"` otherwise, and an explicit `agentScope` still narrows or widens it. Every invocation passes the project-agent gate either way.
43
43
 
44
44
  When running interactively, the tool prompts for confirmation before running project-local agents. `confirmProjectAgents: false` skips that prompt for a project you have already approved; an unapproved project is still asked about.
45
45
 
@@ -134,9 +134,9 @@ enforces per call.
134
134
 
135
135
  **Locations:**
136
136
  - `~/.claude/agents/*.md`, `~/.pi/agent/agents/*.md` - User-level (always loaded; `~/.pi` wins a name conflict)
137
- - `.claude/agents/*.md`, `.pi/agents/*.md` - Project-level (only with `agentScope: "project"` or `"both"`; `.pi` wins a name conflict)
137
+ - `.claude/agents/*.md`, `.pi/agents/*.md` - Project-level (an approved project, or an explicit `agentScope` of `"project"`/`"both"`; `.pi` wins a name conflict)
138
138
 
139
- Project agents override user agents with the same name when `agentScope: "both"`.
139
+ Project agents override user agents with the same name when both scopes are in play.
140
140
 
141
141
  ## Builtin Agents
142
142
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-code",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "Claude Code experience for the pi coding agent: reads your .claude config (rules, commands, skills, hooks, output styles, MCP servers, agents) and adds todo, checkpoints, memory, web, subagents, and goals",
5
5
  "keywords": [
6
6
  "pi",