@@ -4,38 +4,30 @@ Implements the PI block executor. Each sub-mode delegates to a dedicated backend
44
55## Folder layout
66
7- ```
8- pi/
9- ├── pi-handler.ts # Single dispatcher — reads the block's mode and routes to the correct backend
10- ├── core/ # Shared contracts and infrastructure
11- │ ├── backend.ts # Backend contracts — all run-params types, PiRunContext, PiRunResult, and PiBackendRun
12- │ ├── context.ts # Skills-resolution and memory helpers (resolvePiSkills, loadPiMemory, buildPiPrompt, appendPiMemory)
13- │ ├── events.ts # Streaming event helpers
14- │ ├── keys.ts # API-key resolution utilities
15- │ ├── pi-sdk.ts # Thin wrapper around the PI SDK client
16- │ └── redaction.ts # Secret redaction for logs and responses
17- ├── cloud/ # Cloud mode — GitHub-hosted sandboxes
18- │ ├── shared.ts # Shared GitHub and sandbox utilities (repo helpers, polling, etc.)
19- │ ├── github-pr.ts # Low-level GitHub PR API wrappers
20- │ ├── authoring/ # Create PR and Update PR implementation
21- │ │ └── backend.ts
22- │ ├── review/ # Review Code implementation
23- │ │ ├── backend.ts
24- │ │ ├── tools.ts # Tool definitions injected into the review agent
25- │ │ └── tools-script.ts
26- │ └── babysit/ # PR review / check continuation (babysit mode)
27- │ ├── backend.ts
28- │ ├── github.ts # GitHub status/check polling helpers
29- │ └── round.ts # Single babysit iteration logic
30- ├── local/ # Local Dev mode — SSH-connected local machine
31- │ ├── backend.ts
32- │ ├── sim-tools.ts # Sim-side tool implementations
33- │ └── ssh-tools.ts # SSH tool implementations
34- └── search/ # Shared search support used across modes
35- ├── tool.ts # Search tool definition
36- ├── normalize.ts # Result normalisation
37- └── extension-source.ts # Extension-based source adapter
38- ```
7+ | Path | Responsibility |
8+ | --- | --- |
9+ | ` pi-handler.ts ` | Single dispatcher — reads the block's mode and routes to the correct backend |
10+ | ` core/backend.ts ` | Backend contracts — all run-params types, ` PiRunContext ` , ` PiRunResult ` , and ` PiBackendRun ` |
11+ | ` core/context.ts ` | Skills-resolution and memory helpers (` resolvePiSkills ` , ` loadPiMemory ` , ` buildPiPrompt ` , ` appendPiMemory ` ) |
12+ | ` core/events.ts ` | Streaming event helpers |
13+ | ` core/keys.ts ` | API-key resolution utilities |
14+ | ` core/pi-sdk.ts ` | Thin wrapper around the PI SDK client |
15+ | ` core/redaction.ts ` | Secret redaction for logs and responses |
16+ | ` cloud/shared.ts ` | Shared GitHub and sandbox utilities (repo helpers, polling, etc.) |
17+ | ` cloud/github-pr.ts ` | Low-level GitHub PR API wrappers |
18+ | ` cloud/authoring/backend.ts ` | Create PR and Update PR implementation |
19+ | ` cloud/review/backend.ts ` | Review Code implementation |
20+ | ` cloud/review/tools.ts ` | Tool definitions injected into the review agent |
21+ | ` cloud/review/tools-script.ts ` | Script loaded by the review tools |
22+ | ` cloud/babysit/backend.ts ` | PR review / check continuation (babysit mode) |
23+ | ` cloud/babysit/github.ts ` | GitHub status/check polling helpers |
24+ | ` cloud/babysit/round.ts ` | Single babysit iteration logic |
25+ | ` local/backend.ts ` | Local Dev mode — SSH-connected local machine |
26+ | ` local/sim-tools.ts ` | Sim-side tool implementations |
27+ | ` local/ssh-tools.ts ` | SSH tool implementations |
28+ | ` search/tool.ts ` | Search tool definition |
29+ | ` search/normalize.ts ` | Result normalisation |
30+ | ` search/extension-source.ts ` | Extension-based source adapter |
3931
4032## Dispatch flow
4133
0 commit comments