pi-code 1.0.56 → 1.0.57

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 (41) hide show
  1. package/extensions/commands.ts +6 -12
  2. package/extensions/context-imports.ts +2 -10
  3. package/extensions/env-settings.ts +1 -5
  4. package/extensions/git-checkpoint.ts +4 -12
  5. package/extensions/goal.ts +2 -2
  6. package/extensions/hooks/config.ts +6 -21
  7. package/extensions/hooks/decisions.ts +3 -2
  8. package/extensions/hooks/index.ts +4 -16
  9. package/extensions/hooks/matcher.ts +2 -1
  10. package/extensions/hooks/runners.ts +4 -3
  11. package/extensions/internal/command-file.ts +7 -241
  12. package/extensions/internal/command-spans.ts +246 -0
  13. package/extensions/internal/managed-settings.ts +3 -5
  14. package/extensions/internal/plugins.ts +2 -2
  15. package/extensions/internal/settings-chain.ts +19 -0
  16. package/extensions/internal/values.ts +38 -0
  17. package/extensions/mcp/index.ts +6 -5
  18. package/extensions/mcp/listing.ts +2 -1
  19. package/extensions/mcp/oauth-flow.ts +2 -1
  20. package/extensions/mcp/policy.ts +9 -2
  21. package/extensions/memory.ts +10 -15
  22. package/extensions/output-styles.ts +4 -17
  23. package/extensions/plan-mode/index.ts +9 -9
  24. package/extensions/plan-mode/utils.ts +31 -0
  25. package/extensions/session-title.ts +2 -12
  26. package/extensions/skills.ts +6 -18
  27. package/extensions/status-line.ts +2 -8
  28. package/extensions/subagent/README.md +12 -2
  29. package/extensions/subagent/agents.ts +2 -2
  30. package/extensions/subagent/background.ts +2 -1
  31. package/extensions/subagent/child.ts +197 -0
  32. package/extensions/subagent/concurrency.ts +23 -0
  33. package/extensions/subagent/index.ts +36 -1426
  34. package/extensions/subagent/modes.ts +405 -0
  35. package/extensions/subagent/params.ts +56 -0
  36. package/extensions/subagent/registry-text.ts +105 -0
  37. package/extensions/subagent/render-result.ts +306 -0
  38. package/extensions/subagent/run.ts +375 -0
  39. package/extensions/subagent/types.ts +41 -0
  40. package/extensions/subagent/worktree.ts +2 -1
  41. package/package.json +1 -1
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The result shapes the subagent tool produces and its renderers read. They live apart
3
+ * from both so neither has to import the other.
4
+ */
5
+
6
+ import type { Message } from '@earendil-works/pi-ai'
7
+
8
+ import type { AgentScope } from './agents.js'
9
+
10
+ export interface UsageStats {
11
+ input: number
12
+ output: number
13
+ cacheRead: number
14
+ cacheWrite: number
15
+ cost: number
16
+ contextTokens: number
17
+ turns: number
18
+ }
19
+
20
+ export interface SingleResult {
21
+ agent: string
22
+ agentSource: 'user' | 'project' | 'builtin' | 'plugin' | 'unknown'
23
+ task: string
24
+ exitCode: number
25
+ messages: Message[]
26
+ stderr: string
27
+ usage: UsageStats
28
+ model?: string
29
+ stopReason?: string
30
+ errorMessage?: string
31
+ step?: number
32
+ /** Claude's partial marker: the run stopped at its maxTurns limit. */
33
+ partial?: boolean
34
+ }
35
+
36
+ export interface SubagentDetails {
37
+ mode: 'single' | 'parallel' | 'chain'
38
+ agentScope: AgentScope
39
+ projectAgentsDir: string | null
40
+ results: SingleResult[]
41
+ }
@@ -13,6 +13,7 @@ import { randomUUID } from 'node:crypto'
13
13
  import * as os from 'node:os'
14
14
  import * as path from 'node:path'
15
15
  import { promisify } from 'node:util'
16
+ import { errorMessage } from '../internal/values.js'
16
17
 
17
18
  const git = async (cwd: string, ...args: string[]): Promise<string> => {
18
19
  const { stdout } = await promisify(execFile)('git', args, { cwd })
@@ -61,7 +62,7 @@ export async function createAgentWorktree(repoCwd: string, agentName: string): P
61
62
  await git(repoCwd, 'worktree', 'add', '-b', branch, dir, await defaultBranch(repoCwd))
62
63
  return { dir, branch, baseSha: await git(dir, 'rev-parse', 'HEAD') }
63
64
  } catch (error) {
64
- return { error: error instanceof Error ? error.message : String(error) }
65
+ return { error: errorMessage(error) }
65
66
  }
66
67
  }
67
68
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-code",
3
- "version": "1.0.56",
3
+ "version": "1.0.57",
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",