pi-namespace-patch 1.0.0-namespace.1 → 1.0.0-namespace.2

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
@@ -1,41 +1,116 @@
1
+ <div align="center">
2
+
1
3
  # pi-namespace-patch
2
4
 
3
- The [`pi`](https://github.com/earendil-works/pi) coding agent — **maskshell fork build** carrying the
4
- [`pi.namespace`](https://github.com/earendil-works/pi/issues/8834) patch: an opt-in package namespace
5
- for skills and prompt templates. A package declaring `"pi": { "namespace": "myorg" }` exposes
6
- its skills and prompt templates as `<ns>:<name>` (`/skill:myorg:foo`, `/myorg:foo`); resource
7
- content stays untouched and bare user/project names coexist.
5
+ **[pi](https://github.com/earendil-works/pi) with first-class package namespaces for skills and prompt templates**
6
+
7
+ _Your package ships `review`; your users invoke `/acme:review` — no collisions, no renamed frontmatter, no silent shadowing._
8
+
9
+ [![npm](https://img.shields.io/npm/v/pi-namespace-patch.svg)](https://www.npmjs.com/package/pi-namespace-patch)
10
+ [![pi base](https://img.shields.io/badge/pi%20base-1.0.0-blueviolet)](https://github.com/earendil-works/pi/releases)
11
+ [![license](https://img.shields.io/badge/license-MIT-blue)](#license)
12
+
13
+ </div>
14
+
15
+ ---
16
+
17
+ ## What this is
18
+
19
+ The upstream pi coding agent as a drop-in npm alias, carrying exactly one maintained patch: **`pi.namespace`**. A package that declares a namespace exposes every skill and prompt template it ships under one prefix. Nothing else about pi changes.
20
+
21
+ This is not the official package — that is [`@earendil-works/pi-coding-agent`](https://www.npmjs.com/package/@earendil-works/pi-coding-agent). This alias tracks every upstream release through an automated re-base pipeline: same code, one feature ahead.
8
22
 
9
- This is not the official package. It tracks upstream releases as a
10
- [release-managed patch](https://github.com/maskshell/pi/tree/namespace-patch/patch) — everything
11
- else is upstream pi. Product documentation: the
12
- [upstream README](https://github.com/earendil-works/pi).
23
+ ## The problem
13
24
 
14
- ## Install
25
+ pi loads skills and prompt templates from every installed package into one flat pool. On a name collision the first one found wins; there is no grouping and no provenance in the invocation surface:
26
+
27
+ ```
28
+ /skill:review ← the user's review? the project's? pkg-a's? pkg-b's?
29
+ /review ← a prompt template or a skill? from where?
30
+ ```
31
+
32
+ Authors cannot claim a prefix, users cannot tell where a resource came from, and same-named resources silently shadow each other.
33
+
34
+ ## The fix
35
+
36
+ One field in the package manifest:
37
+
38
+ ```json
39
+ {
40
+ "name": "@acme/pi-toolkit",
41
+ "pi": {
42
+ "namespace": "acme",
43
+ "skills": ["./skills"],
44
+ "prompts": ["./prompts"]
45
+ }
46
+ }
47
+ ```
48
+
49
+ | | Before (flat pool) | With `"namespace": "acme"` |
50
+ |---|---|---|
51
+ | Skill invocation | `/skill:review` — collision risk | `/skill:acme:review` — canonical, unambiguous |
52
+ | Bare invocation | — | `/acme:review` — the package's unified surface |
53
+ | Prompt template | `/review` — may shadow a skill | `/acme:review` — prefixed, coexists |
54
+ | `SKILL.md` frontmatter | `name: review` | `name: review` — unchanged, spec-clean |
55
+ | User's own `/skill:review` | shadowed or shadowing | coexists — namespaces never occupy bare names |
56
+
57
+ ## Quickstart
58
+
59
+ As a **user** there is nothing to learn — install, and packages that declare a namespace simply appear prefixed:
15
60
 
16
61
  ```bash
17
62
  npm install -g pi-namespace-patch
18
- pi --version # 1.0.0-namespace.1 (this alias)
63
+ pi --version # 1.0.0-namespace.2
19
64
  ```
20
65
 
21
- Pinned to this release / registry-free — same build; the GitHub tarball reports the
22
- workspace-stamped form `1.0.0+namespace.1`:
66
+ As a **package author**, add the `pi.namespace` field (two lines above), publish, and your resources are invocable in-session:
23
67
 
24
- ```bash
25
- npm install -g https://github.com/maskshell/pi/releases/download/v1.0.0-namespace.1/earendil-works-pi-coding-agent-1.0.0-namespace.1.tgz
26
68
  ```
69
+ /acme:review # unified surface: template first, then a skill of the same name
70
+ /skill:acme:review # the unambiguous skill form
71
+ ```
72
+
73
+ A real consumer: the [solidforge](https://github.com/maskshell/solidforge-pi) toolchain exposes its agent skills as `solidforge:*` through this mechanism.
74
+
75
+ ## How it works
76
+
77
+ The mechanics, in order of depth:
78
+
79
+ - **Applied at load time.** The namespace never enters `SKILL.md` frontmatter or template filenames — the Agent Skills spec stays intact and resource content is untouched. pi composes `<ns>:<name>` when loading.
80
+ - **`/ns:name` is a unified surface.** Input resolves a prompt template owning that exact name first, then a skill whose exposed name matches. `/skill:<ns>:<name>` remains the explicit, unambiguous skill form.
81
+ - **Bare names keep working.** `/skill:review` still resolves when the namespaced resource is the unique owner of that base name and no bare skill shadows it; colon-bearing requests always resolve by exact match only.
82
+ - **Coexistence by construction.** User, project, and other-package resources with the same base name load beside namespaced ones — a namespaced skill no longer occupies its bare name.
83
+ - **Validated, not guessed.** The value must be lowercase `a-z`, `0-9`, hyphens; ≤64 chars; no leading/trailing or consecutive hyphens. An invalid string warns and the resources load un-namespaced; a non-string `pi.namespace` is dropped silently.
84
+ - **Package resolution only.** Namespaces come from pi's package resolution — a raw settings or CLI path pointing inside the package bypasses the prefix and loads bare.
85
+ - **Scoped to name-keyed resources.** Skills and prompt templates only. Themes and runtime-registered tools/commands are not renamed; packages shipping subagents through their own extension read `pi.namespace` and prefix agent names themselves.
86
+ - **Legacy colon-filenames** (`prompts/acme:cmd.md`) keep working via exact match; with a namespace declared they compose to `acme:acme:cmd` — migrate them to plain filenames.
87
+
88
+ ## Versions and upstream tracking
89
+
90
+ - The version scheme `X.Y.Z-namespace.N` mirrors the upstream release it tracks (`X.Y.Z`) plus the fork patch revision (`N`). **Pin exact versions** — never ranges.
91
+ - Each upstream release flows through an automated pipeline: release detection, mechanical re-base, agent repair on conflict, full check chain plus touched suites, then OIDC trusted publishing with signed provenance.
92
+ - `pi --version` on this alias reports `1.0.0-namespace.2` (registry-stamped); the [GitHub tarball](https://github.com/maskshell/pi/releases/download/v1.0.0-namespace.1/earendil-works-pi-coding-agent-1.0.0-namespace.1.tgz) reports the workspace form `1.0.0+namespace.2` — same build, never rebuilt.
93
+
94
+ ## Provenance and trust
95
+
96
+ - Every registry version is derived from the verified GitHub release asset of [maskshell/pi](https://github.com/maskshell/pi).
97
+ - Published via npm trusted publishing (OIDC); each version carries a signed provenance statement.
98
+ - The patch is a maintained proposal ([earendil-works/pi#8834](https://github.com/earendil-works/pi/issues/8834)); the full patch chain, gates, and tracking records are public on the [`namespace-patch` branch](https://github.com/maskshell/pi/tree/namespace-patch/patch).
99
+
100
+ ## FAQ
101
+
102
+ **Is this the official pi?**
103
+ No. Install `@earendil-works/pi-coding-agent` for that. This alias is upstream pi plus the namespace patch; everything else is identical.
27
104
 
28
- ## Version scheme
105
+ **Does it change my existing skills and templates?**
106
+ No. Namespacing is opt-in per package. User and project resources load exactly as before, and packages without `pi.namespace` behave identically to upstream.
29
107
 
30
- Registry versions use the prerelease form `X.Y.Z-namespace.N`, matching the fork's release tags:
31
- npm collapses semver build metadata, so the workspace's `X.Y.Z+namespace.N` form cannot be reused
32
- here, and the registry suffix may run ahead of the release suffix when a re-publish occupies a new
33
- slot. Pin exact versions (`pi-namespace-patch@1.0.0-namespace.1`), not ranges.
108
+ **What happens when upstream releases?**
109
+ The pipeline re-bases and publishes a tracking version, typically within a day of the upstream tag.
34
110
 
35
- ## Provenance
111
+ **Can I mix this with the official package?**
112
+ Pick one per environment — both provide the `pi` binary.
36
113
 
37
- Each alias version is derived from the verified GitHub release asset (never rebuilt) and published
38
- via trusted publishing (OIDC) with provenance attached. Sources and lifecycle:
39
- [maskshell/pi](https://github.com/maskshell/pi), branch `namespace-patch`.
114
+ ## License
40
115
 
41
- License: MIT (as upstream).
116
+ MIT, as upstream.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "pi-namespace-patch",
3
- "version": "1.0.0-namespace.1",
3
+ "version": "1.0.0-namespace.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "pi-namespace-patch",
9
- "version": "1.0.0-namespace.1",
9
+ "version": "1.0.0-namespace.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@earendil-works/chord": "^1.0.0",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-namespace-patch",
3
- "version": "1.0.0-namespace.1",
3
+ "version": "1.0.0-namespace.2",
4
4
  "description": "Coding agent CLI with read, bash, edit, write tools and session management — maskshell fork build with the pi.namespace patch (earendil-works/pi#8834)",
5
5
  "type": "module",
6
6
  "piConfig": {