@victor-software-house/pi-acp 0.13.0 → 0.13.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/README.md CHANGED
@@ -7,7 +7,7 @@ ACP ([Agent Client Protocol](https://agentclientprotocol.com/get-started/introdu
7
7
  ## Specs and decisions
8
8
 
9
9
  - [`docs/prd/PRD-001-acp-v013-zed-alignment.md`](docs/prd/PRD-001-acp-v013-zed-alignment.md) — v0.5 release PRD (Shipped).
10
- - [`docs/prd/PRD-002-portable-runtime.md`](docs/prd/PRD-002-portable-runtime.md) — v0.6 portable runtime + multi-host resource composition (Draft).
10
+ - [`docs/prd/PRD-002-portable-runtime.md`](docs/prd/PRD-002-portable-runtime.md) — v0.6 portable runtime + multi-host resource composition (Substrate Shipped; Phases 8b/9 deferred).
11
11
  - [`docs/prd/PRD-003-runtime-daemon.md`](docs/prd/PRD-003-runtime-daemon.md) — v0.6 long-running daemon + thin-client binary (Draft).
12
12
  - [`docs/architecture/plan-acp-v013-zed-alignment.md`](docs/architecture/plan-acp-v013-zed-alignment.md) — v0.5 phased implementation plan.
13
13
  - [`docs/architecture/plan-portable-runtime.md`](docs/architecture/plan-portable-runtime.md) — v0.6 portable-runtime plan.
@@ -53,6 +53,63 @@ Active development. ACP compliance is improving steadily. Development is centere
53
53
  - Built-in adapter commands (see below)
54
54
  - Authentication via Terminal Auth (ACP Registry support)
55
55
  - Startup info block with pi version and context (configurable via `quietStartup` setting)
56
+ - **Resource composition manifest** (`.pi-acp.yaml`) — PRD-002 §FR-3
57
+ - Cascade: ACP session params > project `<cwd>/.pi-acp.yaml` > user-global `~/.pi-acp/config.yaml` > synthesized default
58
+ - Backends: `local`, `ssh` (Bun Shell `$` + ssh self-terminate options), `http` (HTTPS-only fetch + per-URL TTL cache, default 300s)
59
+ - Merge strategies: `append` (default) or `override-by-name` for skills and prompts
60
+ - Opt-in diagnostics surface (`diagnostics: true`) — one-line resource summary on first prompt of each session
61
+ - **Cwd-independence modes** (PRD-002 §FR-5)
62
+ - `local` (default) / `overlay` — ACP `params.cwd` used as session cwd; manifest roots compose
63
+ - `none` — pi-acp mints an ephemeral tmpdir under `os.tmpdir()/pi-acp-session-*`, cleaned up at session dispose. For one-shot Q&A sessions that shouldn't pollute any project directory.
64
+ - **ACP-FS `read` delegation** (PRD-002 §FR-6) — When the client advertises `clientCapabilities.fs.readTextFile`, pi-acp routes pi's built-in `read` tool through `connection.fs.readTextFile` instead of local disk. Lets Zed Remote read the actual remote workspace files (the ones the user is editing) while pi runs locally.
65
+
66
+ ## Resource composition (`.pi-acp.yaml`)
67
+
68
+ Drop a `.pi-acp.yaml` at the project root (or `~/.pi-acp/config.yaml` for user-global defaults). Schema version `1`:
69
+
70
+ ```yaml
71
+ version: 1
72
+ mode: local # local (default) | overlay | none
73
+ mergeStrategy: append # append | override-by-name
74
+ diagnostics: false # true: emit a one-line resource summary on first prompt
75
+
76
+ roots:
77
+ # Local roots (cwd + optional alt agentDir)
78
+ - id: project
79
+ kind: local
80
+ paths:
81
+ cwd: .
82
+ agentDir: ~/.pi/agent
83
+
84
+ # Remote files over SSH (operator's ~/.ssh/config honored end-to-end)
85
+ - id: cvm
86
+ kind: ssh
87
+ host: cvm
88
+ user: varaujo
89
+ paths:
90
+ agentsFiles:
91
+ - /home/varaujo/.pi/agent/AGENTS.md
92
+ - /workspace/team/SECURITY.md
93
+ # skills/prompts/extensions over SSH not yet implemented;
94
+ # declaring paths.skills here emits a diagnostic at session start.
95
+
96
+ # Public HTTPS fetch (e.g. team's shared AGENTS file on a public repo)
97
+ - id: team
98
+ kind: http
99
+ baseUrl: https://raw.githubusercontent.com/team/dotfiles/main
100
+ cache:
101
+ ttl: 600 # per-URL TTL in seconds; default 300, 0 disables
102
+ paths:
103
+ agentsFiles:
104
+ - AGENTS.md
105
+ ```
106
+
107
+ Cascade precedence (highest first):
108
+
109
+ 1. ACP session params: `params._meta.piAcp.manifest` (inline manifest object OR string path to a YAML file)
110
+ 2. Project: `<cwd>/.pi-acp.yaml`
111
+ 3. User-global: `~/.pi-acp/config.yaml`
112
+ 4. Synthesized default (single implicit local root)
56
113
 
57
114
  ## Prerequisites
58
115
 
@@ -151,7 +208,7 @@ bun run dev # run from src
151
208
  bun run build # tsdown -> dist/index.mjs
152
209
  bun run typecheck # tsc --noEmit
153
210
  bun run lint # biome + oxlint
154
- bun test # 26 tests
211
+ bun test # 277 tests
155
212
  ```
156
213
 
157
214
  Project layout:
@@ -191,7 +248,7 @@ test/
191
248
  ### Not implemented (MAY / client capabilities)
192
249
 
193
250
  - **`agent_plan`** -- plan updates not emitted before tool execution. pi has no equivalent planning surface.
194
- - **ACP filesystem delegation** (`fs/read_text_file`, `fs/write_text_file`) -- pi reads/writes locally. Not advertised.
251
+ - **ACP filesystem `write` delegation** (`fs/write_text_file`) -- pi writes locally. Not advertised. `fs/read_text_file` IS routed through ACP when the client advertises the capability (see Features → ACP-FS `read` delegation).
195
252
  - **ACP terminal delegation** (`terminal/*`) -- pi executes commands locally. Not advertised.
196
253
 
197
254
  ### Design decisions
@@ -2007,7 +2007,7 @@ var SshBackend = class {
2007
2007
  //#endregion
2008
2008
  //#region package.json
2009
2009
  var name = "@victor-software-house/pi-acp";
2010
- var version = "0.13.0";
2010
+ var version = "0.13.1";
2011
2011
  //#endregion
2012
2012
  //#region src/acp/agent.ts
2013
2013
  /** Builtin ACP slash commands handled directly by the adapter. */
@@ -2139,15 +2139,20 @@ var PiAcpAgent = class {
2139
2139
  * Phase 7 adds `kind: "http"`. `acp-fs` still parses fine but surfaces as
2140
2140
  * a diagnostic until its backend lands in a subsequent phase.
2141
2141
  */
2142
- async buildResourceLoader(cwd, sessionParams) {
2142
+ async buildResourceLoader(cwd, sessionParams, opts) {
2143
2143
  const loaded = await loadManifest({
2144
2144
  cwd,
2145
2145
  sessionParams
2146
2146
  });
2147
- const modeResult = resolveMode({
2147
+ const modeResult = opts?.resolveCwdMode !== false ? resolveMode({
2148
2148
  manifest: loaded.manifest,
2149
2149
  requestedCwd: cwd
2150
- });
2150
+ }) : {
2151
+ mode: loaded.manifest.mode,
2152
+ cwd,
2153
+ cleanup: () => {},
2154
+ ephemeral: false
2155
+ };
2151
2156
  const effectiveCwd = modeResult.cwd;
2152
2157
  const diagnostics = [...loaded.diagnostics];
2153
2158
  const sources = [];
@@ -2579,7 +2584,7 @@ var PiAcpAgent = class {
2579
2584
  let result;
2580
2585
  try {
2581
2586
  const sm = SessionManager.open(sessionFile);
2582
- const { loader: resourceLoader } = await this.buildResourceLoader(params.cwd, params);
2587
+ const { loader: resourceLoader } = await this.buildResourceLoader(params.cwd, params, { resolveCwdMode: false });
2583
2588
  result = await createAgentSession({
2584
2589
  cwd: params.cwd,
2585
2590
  sessionManager: sm,
@@ -2685,7 +2690,7 @@ var PiAcpAgent = class {
2685
2690
  let result;
2686
2691
  try {
2687
2692
  const sm = SessionManager.open(sessionFile);
2688
- const { loader: resourceLoader } = await this.buildResourceLoader(params.cwd, params);
2693
+ const { loader: resourceLoader } = await this.buildResourceLoader(params.cwd, params, { resolveCwdMode: false });
2689
2694
  result = await createAgentSession({
2690
2695
  cwd: params.cwd,
2691
2696
  sessionManager: sm,
@@ -2750,7 +2755,7 @@ var PiAcpAgent = class {
2750
2755
  let result;
2751
2756
  try {
2752
2757
  const sm = SessionManager.forkFrom(sourceFile, params.cwd);
2753
- const { loader: resourceLoader } = await this.buildResourceLoader(params.cwd, params);
2758
+ const { loader: resourceLoader } = await this.buildResourceLoader(params.cwd, params, { resolveCwdMode: false });
2754
2759
  result = await createAgentSession({
2755
2760
  cwd: params.cwd,
2756
2761
  sessionManager: sm,
@@ -3387,4 +3392,4 @@ async function runDaemon() {
3387
3392
  //#endregion
3388
3393
  export { runDaemon };
3389
3394
 
3390
- //# sourceMappingURL=daemon-BdW4nUzA.mjs.map
3395
+ //# sourceMappingURL=daemon-BErbUhcE.mjs.map