@zew1me/pi-skills-patch 0.1.1-alpha.190 → 0.1.1-alpha.221

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 (43) hide show
  1. package/dist/ATTRIBUTION.md +158 -49
  2. package/dist/patches/pi-1.6.0/patched.sha256 +1 -1
  3. package/dist/patches/pi-1.6.0/pre-checkout-trust-upgrade.patch +25 -14
  4. package/dist/patches/{pi-1.5.2/patched.sha256 → pi-1.6.0/pre-error-cause-patched.sha256} +3 -3
  5. package/dist/patches/pi-1.6.0/pre-error-cause-upgrade.patch +15 -0
  6. package/dist/patches/pi-1.6.0/skills.patch +5 -3
  7. package/dist/scripts/install-extensions.sh +1 -1
  8. package/package.json +1 -1
  9. package/dist/patches/pi-1.0.3/baseline.absent +0 -2
  10. package/dist/patches/pi-1.0.3/baseline.sha256 +0 -8
  11. package/dist/patches/pi-1.0.3/patched.sha256 +0 -10
  12. package/dist/patches/pi-1.0.3/pre-checkout-trust-patched.sha256 +0 -10
  13. package/dist/patches/pi-1.0.3/pre-checkout-trust-upgrade.patch +0 -216
  14. package/dist/patches/pi-1.0.3/pre-expansion-patched.sha256 +0 -10
  15. package/dist/patches/pi-1.0.3/pre-expansion-upgrade.patch +0 -436
  16. package/dist/patches/pi-1.0.3/skills.patch +0 -1162
  17. package/dist/patches/pi-1.1.0/baseline.absent +0 -2
  18. package/dist/patches/pi-1.1.0/baseline.sha256 +0 -8
  19. package/dist/patches/pi-1.1.0/patched.sha256 +0 -10
  20. package/dist/patches/pi-1.1.0/pre-checkout-trust-patched.sha256 +0 -10
  21. package/dist/patches/pi-1.1.0/pre-checkout-trust-upgrade.patch +0 -216
  22. package/dist/patches/pi-1.1.0/pre-expansion-patched.sha256 +0 -10
  23. package/dist/patches/pi-1.1.0/pre-expansion-upgrade.patch +0 -436
  24. package/dist/patches/pi-1.1.0/skills.patch +0 -1168
  25. package/dist/patches/pi-1.3.0/baseline.absent +0 -2
  26. package/dist/patches/pi-1.3.0/baseline.sha256 +0 -8
  27. package/dist/patches/pi-1.3.0/patched.sha256 +0 -10
  28. package/dist/patches/pi-1.3.0/pre-checkout-trust-patched.sha256 +0 -10
  29. package/dist/patches/pi-1.3.0/pre-checkout-trust-upgrade.patch +0 -216
  30. package/dist/patches/pi-1.3.0/pre-expansion-patched.sha256 +0 -10
  31. package/dist/patches/pi-1.3.0/pre-expansion-upgrade.patch +0 -436
  32. package/dist/patches/pi-1.3.0/skills.patch +0 -1168
  33. package/dist/patches/pi-1.4.0/baseline.absent +0 -2
  34. package/dist/patches/pi-1.4.0/baseline.sha256 +0 -8
  35. package/dist/patches/pi-1.4.0/patched.sha256 +0 -10
  36. package/dist/patches/pi-1.4.0/pre-checkout-trust-patched.sha256 +0 -10
  37. package/dist/patches/pi-1.4.0/pre-checkout-trust-upgrade.patch +0 -216
  38. package/dist/patches/pi-1.4.0/skills.patch +0 -1168
  39. package/dist/patches/pi-1.5.2/baseline.absent +0 -2
  40. package/dist/patches/pi-1.5.2/baseline.sha256 +0 -8
  41. package/dist/patches/pi-1.5.2/pre-checkout-trust-patched.sha256 +0 -10
  42. package/dist/patches/pi-1.5.2/pre-checkout-trust-upgrade.patch +0 -216
  43. package/dist/patches/pi-1.5.2/skills.patch +0 -1168
@@ -1,5 +1,65 @@
1
1
  # Attribution
2
2
 
3
+ ## Model router (`extensions/router`)
4
+
5
+ This section supersedes, for the router only, the "router … intentionally not adopted" notes in the subagent context
6
+ mode and npm packaging sections below: a simplified router is now adopted from the sources listed here.
7
+
8
+ - Source: [`nigel-upstart/pi-buildout`](https://github.com/nigel-upstart/pi-buildout) `extensions/router/` and
9
+ `specs/routing-layer/`
10
+ - Revision reviewed:
11
+ [`1453faf`](https://github.com/nigel-upstart/pi-buildout/commit/1453fafc11158421bb5ad46e91f1ff33cd662b41)
12
+ - License: MIT (Copyright 2026 Nigel Stuke); the root `LICENSE` preserves the notice.
13
+
14
+ Copied and modified code: the continuation, discontinuity and same-task-operation regexes and the plan-then-implement
15
+ rule of `deterministicBoundaryGate` (`core/lease.ts`); the provider quota-exhaustion error pattern (`core/fallback.ts`);
16
+ the significant-reusable-cache threshold and the "cache resists a marginal task switch" rule; and the bounded,
17
+ newest-first session synopsis (`core/synopsis.ts`, reduced to goals, outcomes, files and failed tools). Adapted ideas:
18
+ an LLM classifier that only extracts task features while deterministic code maps them to an archetype and route;
19
+ per-task leases with hard boundaries; a fresh-task classifier failure keeping the current route; the reconciliation rule
20
+ that a switch must beat its cache-switch penalty; shadow/active modes with a `/route` command; JSONL telemetry without
21
+ prompt text that drops to shadow on write failure; and a Pi contract canary test. Not adopted: the twenty-field feature
22
+ schema and twelve archetypes (reduced to seven features and six archetypes), code-defined model policies and
23
+ evidence/telemetry-learned ranking, secondary cross-vendor classifier reconciliation, reviewer sessions, plan
24
+ validators, the safety-policy layer, prompt profiles and system-prompt compilation, xstate, OpenTelemetry spans,
25
+ endpoint health probes, the `off` mode, and private packaging.
26
+
27
+ - Source: [`alexei-led/pi-model-router`](https://github.com/alexei-led/pi-model-router)
28
+ - Revision reviewed:
29
+ [`04a24b0`](https://github.com/alexei-led/pi-model-router/commit/04a24b09c3041d35cc805ecf819a06843b6c120f)
30
+ - License: MIT
31
+
32
+ Conceptual inspiration only, no code copied: explicit capability tiers bound to ordered fallback lists; the switch-cost
33
+ horizon comparison (stay warm versus one cold request plus warm requests on the target); effort-only changes keeping the
34
+ prompt cache; quota-group holds driven by `retry-after`; repeated-failure escalation keyed by a normalized error
35
+ signature after an intervening edit. Not adopted: the custom provider wrapper, the tier × activity × phase matrix,
36
+ advisor probability-mass selection, per-request background advice, session budget caps and inline prompt keywords.
37
+
38
+ - Source: [`mraghakhani/pi-triage-router`](https://github.com/mraghakhani/pi-triage-router)
39
+ - Revision reviewed:
40
+ [`7e93e36`](https://github.com/mraghakhani/pi-triage-router/commit/7e93e36af34bf1e5414a32a2aac8d053307cf976)
41
+ - License: MIT
42
+
43
+ Conceptual inspiration only, no code copied: routing through Pi's virtual-model `route()` hook, one pure decision
44
+ function returning a reason code, sending `direct` (compaction) requests to the cheapest model, and context-window
45
+ eligibility. Not adopted: the local ONNX classifier, benchmark/price scoring, OpenRouter price caches and the dashboard.
46
+
47
+ - Source: [`green-dalii/pi-shift-router`](https://github.com/green-dalii/pi-shift-router)
48
+ - Revision reviewed:
49
+ [`ee8b627`](https://github.com/green-dalii/pi-shift-router/commit/ee8b627eafb045e080814a04e068c97ab52b240a)
50
+ - License: MIT
51
+
52
+ Conceptual inspiration only, no code copied: the expected-value escalation threshold θ = 1/R; treating low-confidence or
53
+ missing classifier answers as a hold; asymmetric stickiness (up immediately, down only after consecutive decisive lower
54
+ decisions); blocking downgrades while the prompt cache is warm; and exponential cooldowns (×4) cleared by a successful
55
+ response, starting 4xx failures further up the ladder. Changed here: the cap is one week instead of six hours, because
56
+ providers enforce weekly limits. Not adopted: the eco/default/sport presets (R is fixed at 3), event-driven `setModel`
57
+ switching, the two-tier fast/smart model, orchestration mode, acceptance audits, savings reports and session profiles.
58
+
59
+ - Pi virtual models and classifiers: `@earendil-works/pi-coding-agent` 1.6.0 `docs/virtual-models.md` and
60
+ `examples/extensions/jev-router.ts` (MIT) informed the `route()` reason handling; no example code was copied.
61
+ - OpenAI Decisions API guide: <https://developers.openai.com/api/docs/guides/decisions> informed the classifier chain.
62
+
3
63
  ## Published-package skills smoke tests
4
64
 
5
65
  - Source: [`nigel-upstart/pi-buildout`](https://github.com/nigel-upstart/pi-buildout)
@@ -36,6 +96,45 @@ Adapted the fork's empty hook directory and explicit `a/` and `b/` diff prefixes
36
96
  regression test reuses the fork's Git-serialized hook path containing `#`, with a separate fixture process. The fork's
37
97
  patch artifacts, version selection, and release tooling were not adopted.
38
98
 
99
+ ## Automatic subagent completion delivery
100
+
101
+ - Source: [`nigel-upstart/pi-buildout`](https://github.com/nigel-upstart/pi-buildout), revision
102
+ [`1453fafc11158421bb5ad46e91f1ff33cd662b41`](https://github.com/nigel-upstart/pi-buildout/pull/168) (#168), MIT
103
+ (Copyright 2026 Nigel Stuke; notice preserved in `LICENSE`).
104
+ - Design reference: [`earendil-works/pi`](https://github.com/earendil-works/pi), `packages/durable` v1.0.0
105
+ (`a13d35a742c6ef8462812a28fbe1d8c8b7431c32`), MIT. Owner edges and subtree-idle waits were conceptual inspiration;
106
+ Pi's RPC extension-UI `setStatus` and event ordering were API references only.
107
+
108
+ Copied and adapted the fork's background result watchers, notification and consumption behavior, lineage and
109
+ subtree-idle tracking, docs, and tests. No Pi durable code, persistence, replay, router integration, or fork-specific
110
+ release settings were imported. Later local fixes are not from the fork: settlement rechecked after refresh, handled
111
+ prompt dispositions (an idle handled prompt keeps the previous answer), retried descendant confirmation, and releasing a
112
+ delivered result on its own `message_start` or, if it was dropped before settlement, at `agent_settled`.
113
+
114
+ ## Generic subagent signaling
115
+
116
+ - Source: [`nigel-upstart/pi-buildout`](https://github.com/nigel-upstart/pi-buildout), revision
117
+ [`78234ea69545cb690098de05271904ca7e2817bc`](https://github.com/nigel-upstart/pi-buildout/pull/142) (#142), MIT
118
+ (Copyright 2026 Nigel Stuke; notice preserved in `LICENSE`).
119
+ - Protocol reference: [`tintinweb/pi-subagents`](https://github.com/tintinweb/pi-subagents), MIT, v0.22.0
120
+ (`85a704cb8f35c96c0cabfa665b572bab296942e5`) and snapshot `ca93a5247e72e7053fcd10bea7125d6c4205f949`.
121
+
122
+ Copied and adapted the fork's compatible protocol-2 ping/spawn/consume/stop handlers, isolated launch and bundled model
123
+ validation, cancellation and terminal publication, docs, and tests. This is protocol compatibility, not copied tintinweb
124
+ code. Pi's CLI, event bus, and bundled model catalog were API references only. Preserved the local pinned real-Pi
125
+ fixture; no router consumer, profile or workflow management, scheduling, or worktree code was imported.
126
+
127
+ ## Subagent wait results
128
+
129
+ - Source: [`nigel-upstart/pi-buildout`](https://github.com/nigel-upstart/pi-buildout), revision
130
+ [`722d0416f7ab30834621665f32ca3f1f87f5cd88`](https://github.com/nigel-upstart/pi-buildout/pull/136) (#136).
131
+ - License: MIT (Copyright 2026 Nigel Stuke); the root `LICENSE` preserves the notice.
132
+
133
+ Copied and adapted the final-answer RPC tracking, wait result shaping, documentation, and regression tests. Pi's
134
+ published 1.3.0 agent-session, RPC mode, and agent-loop code informed the original queue recovery design: queued user
135
+ messages start before their assistant response, and request-owned markers match that boundary. No Pi queue or scheduling
136
+ code was copied. Fork package metadata, release tests, and router changes were not imported.
137
+
39
138
  ## Subagent context modes from `nigel-upstart/pi-buildout`
40
139
 
41
140
  - Source: `nigel-upstart/pi-buildout`
@@ -144,11 +243,12 @@ Follow-up work adopted three conceptual patterns: explicit, bounded result waiti
144
243
  (tokens, cost, context utilization, compactions, and active tool); and treating an output-limit stop with no assistant
145
244
  text as a failed child run rather than a successful empty result. They were implemented as original code inside the
146
245
  existing single-tool RPC design. No tintinweb code was copied or modified. Major pieces intentionally not adopted
147
- include named/default agent types, custom agent frontmatter, proactive completion notifications, FleetView/widget UI,
246
+ included named/default agent types, custom agent frontmatter, proactive completion notifications, FleetView/widget UI,
148
247
  scheduling, event-bus RPC, persistent memory, worktree isolation, skill preloading, and its three-tool Claude
149
- Code-compatible surface.
248
+ Code-compatible surface. The signaling and completion-delivery backports above later adopted a limited event-bus RPC
249
+ subset and proactive notifications.
150
250
 
151
- ## Pi 1.0.3 `/skills` runtime patch
251
+ ## Pi 1.0.3 `/skills` runtime patch (retired)
152
252
 
153
253
  - Source: `@earendil-works/pi-coding-agent@1.0.3`
154
254
  - Canonical repository: <https://github.com/earendil-works/pi> (`packages/coding-agent`)
@@ -156,15 +256,15 @@ Code-compatible surface.
156
256
  - Source archive: `pi-1.0.3-source.tar.gz`, verified against the release's published `SHA256SUMS`
157
257
  - License declared by the package: MIT
158
258
 
159
- [`pi-overlay/versions/1.0.3/integration.patch`](pi-overlay/versions/1.0.3/integration.patch) adapts the existing opt-in
160
- skills seam to the MIT-licensed 1.0.3 TypeScript sources and documentation. The generated
161
- [`skills.patch`](patches/pi-1.0.3/skills.patch) modifies the published resource loader, slash-command list, CLI and
162
- interactive entry points, and `docs/skills.md`; it adds this repository's original skill-management modules. The patch
163
- reuses Pi's package/resource discovery, project-trust, and `proper-lockfile` APIs, including the adapted lock pattern
164
- described under the TypeScript overlay below. It keeps discovered skills catalog-only, enables explicit global,
165
- repository, and session activation, preserves explicit `--skill` paths when `--no-skills` is used, and leaves Pi's
166
- unrelated extensions, prompts, themes, packages, providers, trust behavior, and bundled chunks unchanged. It does not
167
- copy Pi's automatic skill-loading behavior or its runtime implementation into the overlay.
259
+ [`pi-overlay/versions/1.0.3/integration.patch`][retired-1.0.3-integration] adapts the existing opt-in skills seam to the
260
+ MIT-licensed 1.0.3 TypeScript sources and documentation. The generated `skills.patch` modifies the published resource
261
+ loader, slash-command list, CLI and interactive entry points, and `docs/skills.md`; it adds this repository's original
262
+ skill-management modules. The patch reuses Pi's package/resource discovery, project-trust, and `proper-lockfile` APIs,
263
+ including the adapted lock pattern described under the TypeScript overlay below. It keeps discovered skills
264
+ catalog-only, enables explicit global, repository, and session activation, preserves explicit `--skill` paths when
265
+ `--no-skills` is used, and leaves Pi's unrelated extensions, prompts, themes, packages, providers, trust behavior, and
266
+ bundled chunks unchanged. It does not copy Pi's automatic skill-loading behavior or its runtime implementation into the
267
+ overlay.
168
268
 
169
269
  The `cli-runtime.js` and `rpc-entry.js` replacements are original wrappers written for this repository, not derived from
170
270
  upstream's bundle output; Pi's published `dist/bundle/cli.js` compile-cache loader remains unchanged and is pinned by
@@ -189,7 +289,7 @@ its skill implementation were not copied into the overlay. The original `cli-run
189
289
  reused from the earlier patch; the published `dist/bundle/cli.js` loader is unchanged and checksum-pinned. Inputs come
190
290
  from the verified release archive and npm tarball; no complete Pi source checkout is committed.
191
291
 
192
- ## Pi 1.1.0 `/skills` runtime patch
292
+ ## Pi 1.1.0 `/skills` runtime patch (retired)
193
293
 
194
294
  - Source: `@earendil-works/pi-coding-agent@1.1.0`
195
295
  - Canonical repository: <https://github.com/earendil-works/pi> (`packages/coding-agent`)
@@ -197,17 +297,17 @@ from the verified release archive and npm tarball; no complete Pi source checkou
197
297
  - Source archive: `pi-1.1.0-source.tar.gz`, verified against the release's published `SHA256SUMS`
198
298
  - License declared by the package: MIT
199
299
 
200
- [`pi-overlay/versions/1.1.0/integration.patch`](pi-overlay/versions/1.1.0/integration.patch) adapts the opt-in skills
201
- seam to Pi 1.1.0's MIT-licensed TypeScript sources and documentation. The generated
202
- [`skills.patch`](patches/pi-1.1.0/skills.patch) modifies the published resource loader, slash-command list, CLI and
203
- interactive entry points, and skill documentation. It adds this repository's original skill-management modules and
204
- reuses Pi's package/resource discovery, project-trust, and `proper-lockfile` APIs. It keeps catalog skills inactive
205
- until explicitly enabled, preserves explicit `--skill` paths with `--no-skills`, and does not copy Pi's automatic skill
206
- loading or its skill implementation. The original `cli-runtime.js` wrapper reuses Pi's `setupCli()` path; the original
207
- `rpc-entry.js` wrapper also preserves Pi 1.1.0's process markers and HTTP-dispatcher setup. The published
208
- `dist/bundle/cli.js` loader remains unchanged and checksum-pinned. No complete Pi source checkout is committed.
300
+ [`pi-overlay/versions/1.1.0/integration.patch`][retired-1.1.0-integration] adapts the opt-in skills seam to Pi 1.1.0's
301
+ MIT-licensed TypeScript sources and documentation. The generated `skills.patch` modifies the published resource loader,
302
+ slash-command list, CLI and interactive entry points, and skill documentation. It adds this repository's original
303
+ skill-management modules and reuses Pi's package/resource discovery, project-trust, and `proper-lockfile` APIs. It keeps
304
+ catalog skills inactive until explicitly enabled, preserves explicit `--skill` paths with `--no-skills`, and does not
305
+ copy Pi's automatic skill loading or its skill implementation. The original `cli-runtime.js` wrapper reuses Pi's
306
+ `setupCli()` path; the original `rpc-entry.js` wrapper also preserves Pi 1.1.0's process markers and HTTP-dispatcher
307
+ setup. The published `dist/bundle/cli.js` loader remains unchanged and checksum-pinned. No complete Pi source checkout
308
+ is committed.
209
309
 
210
- ## Pi 1.3.0 `/skills` runtime patch
310
+ ## Pi 1.3.0 `/skills` runtime patch (retired)
211
311
 
212
312
  - Source: `@earendil-works/pi-coding-agent@1.3.0`
213
313
  - Canonical repository: <https://github.com/earendil-works/pi> (`packages/coding-agent`)
@@ -217,17 +317,17 @@ loading or its skill implementation. The original `cli-runtime.js` wrapper reuse
217
317
  - npm tarball: `pi-coding-agent-1.3.0.tgz`, pinned by SHA-256 and registry integrity
218
318
  - License declared by the package: MIT
219
319
 
220
- [`pi-overlay/versions/1.3.0/integration.patch`](pi-overlay/versions/1.3.0/integration.patch) is the 1.1.0 seam rebased
221
- onto Pi 1.3.0's MIT-licensed TypeScript sources and documentation: the added and removed lines are unchanged, and only
222
- hunk positions and blob indexes differ. The generated [`skills.patch`](patches/pi-1.3.0/skills.patch) modifies the
223
- published resource loader, slash-command list, CLI and interactive entry points, and skill documentation, within the
224
- same 48-line seam budget. It adds this repository's original skill-management modules, which compile byte-identically to
225
- the 1.1.0 output, and reuses Pi's package/resource discovery, project-trust, and `proper-lockfile` APIs. It keeps
226
- catalog skills inactive until explicitly enabled, preserves explicit `--skill` paths with `--no-skills`, and does not
227
- copy Pi's automatic skill loading or its skill implementation. The original `cli-runtime.js` and `rpc-entry.js` wrappers
228
- are reused byte-for-byte from 1.1.0 because Pi 1.3.0's `src/cli.ts`, `src/rpc-entry.ts`, and `src/cli/setup.ts` are
229
- unchanged. The published `dist/bundle/cli.js` loader remains unchanged and checksum-pinned. Upstream changes elsewhere
230
- in 1.3.0, including those near the seams, were not adopted. No complete Pi source checkout is committed.
320
+ [`pi-overlay/versions/1.3.0/integration.patch`][retired-1.3.0-integration] is the 1.1.0 seam rebased onto Pi 1.3.0's
321
+ MIT-licensed TypeScript sources and documentation: the added and removed lines are unchanged, and only hunk positions
322
+ and blob indexes differ. The generated `skills.patch` modifies the published resource loader, slash-command list, CLI
323
+ and interactive entry points, and skill documentation, within the same 48-line seam budget. It adds this repository's
324
+ original skill-management modules, which compile byte-identically to the 1.1.0 output, and reuses Pi's package/resource
325
+ discovery, project-trust, and `proper-lockfile` APIs. It keeps catalog skills inactive until explicitly enabled,
326
+ preserves explicit `--skill` paths with `--no-skills`, and does not copy Pi's automatic skill loading or its skill
327
+ implementation. The original `cli-runtime.js` and `rpc-entry.js` wrappers are reused byte-for-byte from 1.1.0 because Pi
328
+ 1.3.0's `src/cli.ts`, `src/rpc-entry.ts`, and `src/cli/setup.ts` are unchanged. The published `dist/bundle/cli.js`
329
+ loader remains unchanged and checksum-pinned. Upstream changes elsewhere in 1.3.0, including those near the seams, were
330
+ not adopted. No complete Pi source checkout is committed.
231
331
 
232
332
  ## Pi 1.6.0 `/skills` runtime patch
233
333
 
@@ -240,7 +340,7 @@ TypeScript sources and skill documentation, including the changed model-resolver
240
340
  this repository's shared skill management and CLI/RPC wrappers. The generated patch contains edits to upstream runtime
241
341
  files and docs; it does not vendor the upstream tree, adopt Pi's auto-loading policy, or rebuild its bundled chunks.
242
342
 
243
- ## Pi 1.5.2 `/skills` runtime patch
343
+ ## Pi 1.5.2 `/skills` runtime patch (retired)
244
344
 
245
345
  - Source: [nigel-upstart/pi-buildout](https://github.com/nigel-upstart/pi-buildout), commit
246
346
  `0704169310246b2b4fe8144f94ad4314c4a382e3`, MIT.
@@ -252,7 +352,7 @@ modifies Pi source and documentation. The generated runtime patch uses this repo
252
352
  path behavior rather than copying downstream's generated skill implementation. Other downstream changes and a complete
253
353
  Pi source checkout were not adopted.
254
354
 
255
- ## Pi 1.4.0 `/skills` runtime patch
355
+ ## Pi 1.4.0 `/skills` runtime patch (retired)
256
356
 
257
357
  - Source: `@earendil-works/pi-coding-agent@1.4.0`
258
358
  - Canonical repository: <https://github.com/earendil-works/pi> (`packages/coding-agent`)
@@ -262,17 +362,16 @@ Pi source checkout were not adopted.
262
362
  - npm tarball: `pi-coding-agent-1.4.0.tgz`, pinned by SHA-256 and registry integrity
263
363
  - License declared by the package: MIT
264
364
 
265
- [`pi-overlay/versions/1.4.0/integration.patch`](pi-overlay/versions/1.4.0/integration.patch) adapts the existing seam
266
- against Pi 1.4.0's MIT-licensed TypeScript sources and documentation. The modified-code patch retains the same additions
267
- and removals as 1.3.0; the interactive-mode hunk positions and blob indexes are refreshed. The generated
268
- [`skills.patch`](patches/pi-1.4.0/skills.patch) changes the resource loader, slash-command list, CLI/interactive
269
- dispatch, and skill documentation within the same 48-line generated-runtime seam budget. It adds this repository's
270
- original skill-management modules unchanged, reusing Pi's package discovery, project trust, path, and locking APIs
271
- rather than copying its skill implementation. The original CLI/RPC wrappers are reused byte-for-byte from 1.3.0 after
272
- reviewing 1.4.0's unchanged entrypoint sources and setup. The unchanged compile-cache loader is checksum-pinned. The
273
- build order follows 1.4.0's root build, with telemetry first. Pi's automatic activation of all discovered skills and
274
- unrelated runtime changes are intentionally not adopted into the overlay; unrelated package files and bundled chunks are
275
- left unchanged. No complete Pi source checkout is committed.
365
+ [`pi-overlay/versions/1.4.0/integration.patch`][retired-1.4.0-integration] adapts the existing seam against Pi 1.4.0's
366
+ MIT-licensed TypeScript sources and documentation. The modified-code patch retains the same additions and removals as
367
+ 1.3.0; the interactive-mode hunk positions and blob indexes are refreshed. The generated `skills.patch` changes the
368
+ resource loader, slash-command list, CLI/interactive dispatch, and skill documentation within the same 48-line
369
+ generated-runtime seam budget. It adds this repository's original skill-management modules unchanged, reusing Pi's
370
+ package discovery, project trust, path, and locking APIs rather than copying its skill implementation. The original
371
+ CLI/RPC wrappers are reused byte-for-byte from 1.3.0 after reviewing 1.4.0's unchanged entrypoint sources and setup. The
372
+ unchanged compile-cache loader is checksum-pinned. The build order follows 1.4.0's root build, with telemetry first.
373
+ Pi's automatic activation of all discovered skills and unrelated runtime changes are intentionally not adopted into the
374
+ overlay; unrelated package files and bundled chunks are left unchanged. No complete Pi source checkout is committed.
276
375
 
277
376
  ## Pi `/skills` TypeScript overlay
278
377
 
@@ -289,8 +388,9 @@ left unchanged. No complete Pi source checkout is committed.
289
388
  published `SHA256SUMS`
290
389
  - License declared by the package: MIT
291
390
 
292
- [`pi-overlay`](pi-overlay) is the authored form of the `/skills` runtime patch; the artifacts under `patches/pi-1.0.3/`,
293
- `patches/pi-1.0.4/`, `patches/pi-1.1.0/`, `patches/pi-1.3.0/`, and `patches/pi-1.4.0/` are generated from it.
391
+ [`pi-overlay`](pi-overlay) is the authored form of the `/skills` runtime patch; the artifacts under
392
+ `patches/pi-<version>/` are generated from it. Patches for Pi releases before 1.6.0, the minimum supported release, are
393
+ retired and no longer retained; their sections above record the upstream sources they were derived from.
294
394
 
295
395
  `pi-overlay/skill-management-core.ts` and `pi-overlay/skill-management.ts` are original code for this repository. They
296
396
  are a TypeScript reimplementation of the `dist/core/skill-management.js` previously authored here as JavaScript,
@@ -364,3 +464,12 @@ Pi's official launcher signatures and managed marker fields informed nonexecutin
364
464
  <https://github.com/earendil-works/pi>, local source revision `741fb3a686f8dcc075f12ea77f985967ced59e21`
365
465
  (`packages/coding-agent/src/package-manager-cli.ts`; MIT), plus the installed official launcher. These are behavioral
366
466
  references only; no launcher code, execution, installation, or self-update machinery was copied or adopted.
467
+
468
+ [retired-1.0.3-integration]:
469
+ https://github.com/zew1me/pi-buildout/blob/8250d571f6346e6ee2788ea0ffd2c1a452d30cd1/pi-overlay/versions/1.0.3/integration.patch
470
+ [retired-1.1.0-integration]:
471
+ https://github.com/zew1me/pi-buildout/blob/8250d571f6346e6ee2788ea0ffd2c1a452d30cd1/pi-overlay/versions/1.1.0/integration.patch
472
+ [retired-1.3.0-integration]:
473
+ https://github.com/zew1me/pi-buildout/blob/8250d571f6346e6ee2788ea0ffd2c1a452d30cd1/pi-overlay/versions/1.3.0/integration.patch
474
+ [retired-1.4.0-integration]:
475
+ https://github.com/zew1me/pi-buildout/blob/8250d571f6346e6ee2788ea0ffd2c1a452d30cd1/pi-overlay/versions/1.4.0/integration.patch
@@ -3,7 +3,7 @@
3
3
  1763b278a30e772bf8ee2da004bf368d479b2bc679515ab83afca161e6d69ae6 dist/main.js
4
4
  9f4153ba4c0b60441e372d96ff1970c1b300ff4a4bd506741d311229771f7315 dist/modes/interactive/interactive-mode.js
5
5
  dce32d936de2732cac1bf9dbd0257fc2734cc530bb90e38c496cc25b6eec8f09 dist/core/skill-management.js
6
- 8f261e1425f0a297169a5abda041c9f84df428435ce7f8277bdd80a39656ed79 dist/core/skill-management-core.js
6
+ 12d16a678ed6cc0ad11f1bdb4b116f53f5847bffb378b8324762640ac1df9845 dist/core/skill-management-core.js
7
7
  22cf701c147ec6c6da0d1962025cab71f221e471d6fb29688d70b8c2541b1726 docs/skills.md
8
8
  e1ff73f68c6668278fe8dc0c12645cef032ad2c8d4c13536c223a33382fc02df dist/bundle/cli-runtime.js
9
9
  a3e0c75e3d4c074cf3839d0660cdc866541a20b013f1da6221d7036f0f12c4e1 dist/bundle/rpc-entry.js
@@ -1,8 +1,19 @@
1
1
  diff --git a/dist/core/skill-management-core.js b/dist/core/skill-management-core.js
2
- index 0b4ae56..dc70fae 100644
2
+ index 0b4ae56..6f3c5e1 100644
3
3
  --- a/dist/core/skill-management-core.js
4
4
  +++ b/dist/core/skill-management-core.js
5
- @@ -191,9 +191,13 @@ export function expandEnvironmentVariables(env, input) {
5
+ @@ -19,7 +19,9 @@ function readJson(env, path) {
6
+ return value;
7
+ }
8
+ catch (error) {
9
+ - throw new Error(`Could not parse ${path}: ${error instanceof Error ? error.message : String(error)}`);
10
+ + throw new Error(`Could not parse ${path}: ${error instanceof Error ? error.message : String(error)}`, {
11
+ + cause: error,
12
+ + });
13
+ }
14
+ }
15
+ function writeJson(env, path, value) {
16
+ @@ -191,9 +193,13 @@ export function expandEnvironmentVariables(env, input) {
6
17
  function resolveSkillPath(env, source, cwd) {
7
18
  return env.resolvePath(expandEnvironmentVariables(env, source).value, cwd, { trim: true });
8
19
  }
@@ -17,7 +28,7 @@ index 0b4ae56..dc70fae 100644
17
28
  }
18
29
  /** The checkout root for `cwd`; relative repository entries resolve against it. */
19
30
  function findRepoRoot(env, cwd) {
20
- @@ -235,7 +239,7 @@ function referencesDirectoryVariable(typed) {
31
+ @@ -235,7 +241,7 @@ function referencesDirectoryVariable(typed) {
21
32
  }
22
33
  /** True for a `~` or `$NAME` path that resolves the same way from any directory in the current environment. */
23
34
  function isPortableSpelling(env, typed) {
@@ -26,7 +37,7 @@ index 0b4ae56..dc70fae 100644
26
37
  if (!spelled || !looksLikePath(typed) || referencesDirectoryVariable(typed))
27
38
  return false;
28
39
  const { value, unset } = expandEnvironmentVariables(env, typed);
29
- @@ -304,6 +308,10 @@ function normalizePersistedSource(env, source, context) {
40
+ @@ -304,6 +310,10 @@ function normalizePersistedSource(env, source, context) {
30
41
  : env.resolvePath(value, context.cwd, { trim: true });
31
42
  return env.fs.existsSync(path) ? env.fs.realpathSync(path) : path;
32
43
  }
@@ -37,7 +48,7 @@ index 0b4ae56..dc70fae 100644
37
48
  export function updatePersistedSkill(env, action, source, scope, options) {
38
49
  const location = configLocation(env, scope, options.cwd, options.agentDir);
39
50
  const path = location.path;
40
- @@ -314,7 +322,13 @@ export function updatePersistedSkill(env, action, source, scope, options) {
51
+ @@ -314,7 +324,13 @@ export function updatePersistedSkill(env, action, source, scope, options) {
41
52
  scope,
42
53
  repoRoot: scope === "repo" ? findRepoRoot(env, options.cwd) : undefined,
43
54
  };
@@ -52,7 +63,7 @@ index 0b4ae56..dc70fae 100644
52
63
  const matches = (entry) => normalizePersistedSource(env, sourceOf(entry), context) === key;
53
64
  return withSkillConfigLock(env, path, () => {
54
65
  const config = readJson(env, path);
55
- @@ -344,7 +358,10 @@ function removePersistedSkill(env, source, target, scope, options) {
66
+ @@ -344,7 +360,10 @@ function removePersistedSkill(env, source, target, scope, options) {
56
67
  const candidates = looksLikePath(source)
57
68
  ? [target]
58
69
  : [target, source, env.resolvePath(source, options.cwd, { trim: true })];
@@ -64,7 +75,7 @@ index 0b4ae56..dc70fae 100644
64
75
  }
65
76
  export function getActiveSkillEntries(env, { cwd, agentDir, strict = false, onWarn }) {
66
77
  const entries = [];
67
- @@ -504,20 +521,24 @@ async function runMutationCommand(env, command, rest, surface, options) {
78
+ @@ -504,20 +523,24 @@ async function runMutationCommand(env, command, rest, surface, options) {
68
79
  // Removal never consults the catalog, whose package resolution can install missing packages. A stored bare
69
80
  // value is a catalog name, so removing a bare name tries that literal name first and its resolved path after.
70
81
  const resolution = command === "add" ? await resolveSkillSource(env, source, options) : undefined;
@@ -97,7 +108,7 @@ index 0b4ae56..dc70fae 100644
97
108
  : removePersistedSkill(env, source, target, scope, options);
98
109
  if (!updated)
99
110
  throw new Error(`Skill is not enabled for ${scope} scope: ${source}`);
100
- @@ -554,6 +575,7 @@ export async function runSkillsCommand(env, args, options) {
111
+ @@ -554,6 +577,7 @@ export async function runSkillsCommand(env, args, options) {
101
112
  */
102
113
  export async function resolveActiveSkillPaths(env, context) {
103
114
  const { cwd, agentDir, settingsManager, resolvedSkillResources, resolveResourcePath } = context;
@@ -105,7 +116,7 @@ index 0b4ae56..dc70fae 100644
105
116
  const paths = [];
106
117
  const diagnostics = [];
107
118
  const entries = getActiveSkillEntries(env, {
108
- @@ -566,7 +588,7 @@ export async function resolveActiveSkillPaths(env, context) {
119
+ @@ -566,7 +590,7 @@ export async function resolveActiveSkillPaths(env, context) {
109
120
  catalogPathsByName ??= new Map((await getSkillCatalog(env, {
110
121
  cwd,
111
122
  agentDir,
@@ -114,7 +125,7 @@ index 0b4ae56..dc70fae 100644
114
125
  ...(resolvedSkillResources ? { resolvedSkillResources } : {}),
115
126
  })).map((skill) => [skill.name, skill.filePath]));
116
127
  return catalogPathsByName.get(name);
117
- @@ -574,12 +596,22 @@ export async function resolveActiveSkillPaths(env, context) {
128
+ @@ -574,12 +598,22 @@ export async function resolveActiveSkillPaths(env, context) {
118
129
  let repoRoot;
119
130
  const entryPath = (entry) => {
120
131
  const value = expandEnvironmentVariables(env, entry.source).value.trim();
@@ -142,7 +153,7 @@ index 0b4ae56..dc70fae 100644
142
153
  };
143
154
  for (const entry of entries) {
144
155
  if (!looksLikePath(entry.source)) {
145
- @@ -591,6 +623,8 @@ export async function resolveActiveSkillPaths(env, context) {
156
+ @@ -591,6 +625,8 @@ export async function resolveActiveSkillPaths(env, context) {
146
157
  continue;
147
158
  }
148
159
  const path = entryPath(entry);
@@ -151,7 +162,7 @@ index 0b4ae56..dc70fae 100644
151
162
  if (env.fs.existsSync(path))
152
163
  paths.push(path);
153
164
  else
154
- @@ -625,15 +659,14 @@ export async function resolveSkillEntryPath(env, context, source) {
165
+ @@ -625,15 +661,14 @@ export async function resolveSkillEntryPath(env, context, source) {
155
166
  * Returns the line to show, or `undefined` when it has already reported an error. The list is mutated in
156
167
  * place because the loader holds the same array.
157
168
  */
@@ -170,7 +181,7 @@ index 0b4ae56..dc70fae 100644
170
181
  if (!resolved) {
171
182
  context.showError(`Skill not found in the catalog: ${session.source}`);
172
183
  return undefined;
173
- @@ -642,18 +675,15 @@ async function applySessionSkillChange(env, session, context) {
184
+ @@ -642,18 +677,15 @@ async function applySessionSkillChange(env, session, context) {
174
185
  additionalSkillPaths.push(resolved);
175
186
  return `Enabled ${resolved} for this session.`;
176
187
  }
@@ -192,7 +203,7 @@ index 0b4ae56..dc70fae 100644
192
203
  // A bare name added as a local path stays removable by that name after the path is deleted, but only when
193
204
  // nothing matches it directly.
194
205
  const localPath = looksLikePath(session.source) ? undefined : env.resolvePath(session.source, cwd, { trim: true });
195
- @@ -697,7 +727,7 @@ export async function handleSkillsInteractive(env, text, context) {
206
+ @@ -697,7 +729,7 @@ export async function handleSkillsInteractive(env, text, context) {
196
207
  }
197
208
  let lines = result.lines;
198
209
  if (result.session) {
@@ -1,7 +1,7 @@
1
- b9a3811e70bf8a3a9f2a4e80210584f5d321af5f504767160a9d494191c638f2 dist/core/resource-loader.js
1
+ 657cae5277f7b9537bf30eb50502eb85bafa45cc494551c71f036555ac03f150 dist/core/resource-loader.js
2
2
  252b7195eae2225527c2ea77908bb7b3ddbc202cf25e2bf5bea9d3ce8990e63d dist/core/slash-commands.js
3
- d24f3e3cf156e05b9adac97cbb20e3f0313d45a38ecbe35631119b37d46b271c dist/main.js
4
- 9e29eb9eb89fd9509daab6a899e02f486868e3c8bb74376cb9f550b837fd872c dist/modes/interactive/interactive-mode.js
3
+ 1763b278a30e772bf8ee2da004bf368d479b2bc679515ab83afca161e6d69ae6 dist/main.js
4
+ 9f4153ba4c0b60441e372d96ff1970c1b300ff4a4bd506741d311229771f7315 dist/modes/interactive/interactive-mode.js
5
5
  dce32d936de2732cac1bf9dbd0257fc2734cc530bb90e38c496cc25b6eec8f09 dist/core/skill-management.js
6
6
  8f261e1425f0a297169a5abda041c9f84df428435ce7f8277bdd80a39656ed79 dist/core/skill-management-core.js
7
7
  22cf701c147ec6c6da0d1962025cab71f221e471d6fb29688d70b8c2541b1726 docs/skills.md
@@ -0,0 +1,15 @@
1
+ diff --git a/dist/core/skill-management-core.js b/dist/core/skill-management-core.js
2
+ index dc70fae..6f3c5e1 100644
3
+ --- a/dist/core/skill-management-core.js
4
+ +++ b/dist/core/skill-management-core.js
5
+ @@ -19,7 +19,9 @@ function readJson(env, path) {
6
+ return value;
7
+ }
8
+ catch (error) {
9
+ - throw new Error(`Could not parse ${path}: ${error instanceof Error ? error.message : String(error)}`);
10
+ + throw new Error(`Could not parse ${path}: ${error instanceof Error ? error.message : String(error)}`, {
11
+ + cause: error,
12
+ + });
13
+ }
14
+ }
15
+ function writeJson(env, path, value) {
@@ -68,10 +68,10 @@ index 379db9e..7fb431e 100644
68
68
  const resolved = this.resolveResourcePath(p);
69
69
  diff --git a/dist/core/skill-management-core.js b/dist/core/skill-management-core.js
70
70
  new file mode 100644
71
- index 0000000..dc70fae
71
+ index 0000000..6f3c5e1
72
72
  --- /dev/null
73
73
  +++ b/dist/core/skill-management-core.js
74
- @@ -0,0 +1,749 @@
74
+ @@ -0,0 +1,751 @@
75
75
  +/**
76
76
  + * Opt-in skill management for the patched Pi runtime.
77
77
  + *
@@ -93,7 +93,9 @@ index 0000000..dc70fae
93
93
  + return value;
94
94
  + }
95
95
  + catch (error) {
96
- + throw new Error(`Could not parse ${path}: ${error instanceof Error ? error.message : String(error)}`);
96
+ + throw new Error(`Could not parse ${path}: ${error instanceof Error ? error.message : String(error)}`, {
97
+ + cause: error,
98
+ + });
97
99
  + }
98
100
  +}
99
101
  +function writeJson(env, path, value) {
@@ -6,7 +6,7 @@ AGENT_DIR=${PI_AGENT_DIR:-"${PI_CODING_AGENT_DIR:-$HOME/.pi/agent}"}
6
6
  EXTENSION_DIR="$AGENT_DIR/extensions"
7
7
  APPLY_SKILLS_PATCH=1
8
8
  INSTALL_EXTENSIONS=1
9
- EXTENSIONS=(clear effort markdown-backlinks subagents)
9
+ EXTENSIONS=(clear effort markdown-backlinks router subagents)
10
10
  # The standalone npm package exposes this script as a `pi-skills-patch` bin symlink.
11
11
  # Resolve data paths from BASH_SOURCE but use the invocation name to default to patch-only mode.
12
12
  if [[ "$(basename "$0")" == "pi-skills-patch" ]]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zew1me/pi-skills-patch",
3
- "version": "0.1.1-alpha.190",
3
+ "version": "0.1.1-alpha.221",
4
4
  "type": "module",
5
5
  "description": "Version-checked /skills runtime patch installer for supported Pi versions",
6
6
  "license": "SEE LICENSE IN dist/LICENSE",
@@ -1,2 +0,0 @@
1
- dist/core/skill-management.js
2
- dist/core/skill-management-core.js
@@ -1,8 +0,0 @@
1
- 710e367e37c40df9f8f0239ebee6955e0a971a028d20467024bf4ea9ff55a42a dist/core/resource-loader.js
2
- 3c4b7576c59d81e39e7dff4a847fdb51021fbea544a7880746018866a599f1e6 dist/core/slash-commands.js
3
- 060521b0b81f91948d8ded9139e423e5d0c9e6808a45c81750cc30519de4d2db dist/main.js
4
- 89ad3129807c036820c746ef4e0e930292b4ea7ab8150c085e75148a581793c4 dist/modes/interactive/interactive-mode.js
5
- 5b9805525b194474ef1fe5455a0917ef15ed7f710aa9bec2eee11879556469e5 docs/skills.md
6
- 71dc8ce35ba21a37b48569c41245fe3f25b58f41b878687be45f4af37f57e9ba dist/bundle/cli-runtime.js
7
- ee933f7877d383df227007ef220c0871673c31b8d1ae5bae228d42f63df9b846 dist/bundle/rpc-entry.js
8
- e79626f2dd6f94aa45d30f3fa63cd84319a6eefcd150b353cfaf274366926774 dist/bundle/cli.js
@@ -1,10 +0,0 @@
1
- ebf4f6c2de7d95e253cb36be6fecd2d2fc7b1a719227f88c5a3cc65a0aaa1b3b dist/core/resource-loader.js
2
- 6b212fda1510fcbb86fc9c53fc63335b1e8c6a03710223b53862d93e221afa73 dist/core/slash-commands.js
3
- 449d85fd9fa507f6558b54ed9c7c8cdd98d5aedc902dc4c34e72c7f7f204c7f5 dist/main.js
4
- 556bf3a093f8f3c8cf320fd9be13476d861b2fda8804d7228f4405cc07948ae7 dist/modes/interactive/interactive-mode.js
5
- dce32d936de2732cac1bf9dbd0257fc2734cc530bb90e38c496cc25b6eec8f09 dist/core/skill-management.js
6
- 8f261e1425f0a297169a5abda041c9f84df428435ce7f8277bdd80a39656ed79 dist/core/skill-management-core.js
7
- 22cf701c147ec6c6da0d1962025cab71f221e471d6fb29688d70b8c2541b1726 docs/skills.md
8
- e1ff73f68c6668278fe8dc0c12645cef032ad2c8d4c13536c223a33382fc02df dist/bundle/cli-runtime.js
9
- bec9d85dfd59bac034fcef8c3951a8d7927dc82a3282ba271bf0214cf29f3bdc dist/bundle/rpc-entry.js
10
- e79626f2dd6f94aa45d30f3fa63cd84319a6eefcd150b353cfaf274366926774 dist/bundle/cli.js
@@ -1,10 +0,0 @@
1
- ebf4f6c2de7d95e253cb36be6fecd2d2fc7b1a719227f88c5a3cc65a0aaa1b3b dist/core/resource-loader.js
2
- 6b212fda1510fcbb86fc9c53fc63335b1e8c6a03710223b53862d93e221afa73 dist/core/slash-commands.js
3
- 449d85fd9fa507f6558b54ed9c7c8cdd98d5aedc902dc4c34e72c7f7f204c7f5 dist/main.js
4
- 556bf3a093f8f3c8cf320fd9be13476d861b2fda8804d7228f4405cc07948ae7 dist/modes/interactive/interactive-mode.js
5
- dce32d936de2732cac1bf9dbd0257fc2734cc530bb90e38c496cc25b6eec8f09 dist/core/skill-management.js
6
- afb5dac60cf8791d8d12888ea083173e978de5f0c04b7205fec6a834c2c46b57 dist/core/skill-management-core.js
7
- 9ed8e6da4be22f62f99a444d306abc20a5e0d8ba76ecab13de6e7460be2584d2 docs/skills.md
8
- e1ff73f68c6668278fe8dc0c12645cef032ad2c8d4c13536c223a33382fc02df dist/bundle/cli-runtime.js
9
- bec9d85dfd59bac034fcef8c3951a8d7927dc82a3282ba271bf0214cf29f3bdc dist/bundle/rpc-entry.js
10
- e79626f2dd6f94aa45d30f3fa63cd84319a6eefcd150b353cfaf274366926774 dist/bundle/cli.js