@tinoy/pi-canon 0.1.0 → 0.2.0

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 (2) hide show
  1. package/README.md +31 -1
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -19,11 +19,41 @@ pi install npm:@tinoy/pi-canon
19
19
  - **Peer notices** — entry changes are broadcast over the pi-intercom bus (namespace `canon`); receivers match the entry scope against their own model and audience.
20
20
  - **Tail sections** — another extension contributes prompt text through the `canon:section` event; its ids are published on `canon:sections`.
21
21
 
22
+ ## Exports
23
+
24
+ `canon.ts` is the package entry, and it is also the module API:
25
+
26
+ | Export | What it is |
27
+ | --- | --- |
28
+ | default | the pi extension factory — the hooks, the four tools and the two commands |
29
+ | `setTailSection(id, text)` | contribute a tail section, replaced per id |
30
+ | `registeredSectionIds()` | the ids currently registered |
31
+
32
+ The tail-section registry stays here because it owns this package's event contract: the
33
+ `canon:section` / `canon:sections` names, the `canon` hook-log source, and the section
34
+ cap. `setTailSection` / `registeredSectionIds` are exported for this package's own use
35
+ and are never re-exported elsewhere; another extension reaches the registry through the
36
+ `canon:section` event, because an exported function is unreachable across the loader's
37
+ module isolation.
38
+
39
+ ## The system-prompt seam
40
+
41
+ The seam canon composes the tail through — `canonicalSystemPrompt(systemPrompt, block)`,
42
+ `systemPromptSlot(payload)` and the append separator `PROMPT_APPEND_SEP` — is NOT
43
+ exported from this package. It lives in `@tinoy/pi-ext-lib` (`src/system-prompt.ts`),
44
+ together with the rule that makes it shared: `before_agent_start` fires only from the
45
+ interactive `prompt()` path, so an appended block has to be re-normalized on every
46
+ provider request for the request prefix to stay byte-identical. Canon imports it from
47
+ there, and so does any other extension that appends to the system prompt — import
48
+ `@tinoy/pi-ext-lib`, not this package. What stays here is the policy: the block's
49
+ content, its scope rules, and what happens when the payload carries no rewritable slot.
50
+
22
51
  ## Dependencies
23
52
 
24
53
  pi supplies these, so they are declared as peer dependencies with `*` and are not
25
54
  bundled: `@earendil-works/pi-ai`, `@earendil-works/pi-coding-agent`, `typebox`.
26
- `@tinoy/pi-ext-lib` is a plain dependency.
55
+ `@tinoy/pi-ext-lib` is a plain dependency; the prompt seam above is imported from it,
56
+ not re-exported by this package.
27
57
 
28
58
  ## Licence
29
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinoy/pi-canon",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Durable system-prompt rules for pi: an on-disk canon store, its tools, and the /canon commands.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -36,6 +36,6 @@
36
36
  "typebox": "*"
37
37
  },
38
38
  "dependencies": {
39
- "@tinoy/pi-ext-lib": "^0.1.0"
39
+ "@tinoy/pi-ext-lib": "*"
40
40
  }
41
41
  }