@tinoy/pi-canon 0.4.0 → 0.5.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.
- package/README.md +1 -1
- package/index.ts +5 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ pi install npm:@tinoy/pi-canon
|
|
|
17
17
|
- **Commands** — `/canon` (list, add, remove, edit, category management) and `/canon-dump`.
|
|
18
18
|
- **Injection** — the block is appended at `before_agent_start` and re-normalized on every provider request, so a run started by an injected message carries the same bytes as an interactive prompt.
|
|
19
19
|
- **Category headings** — a category sub-heading inside a scope group prints the store id after the word `category` (`#### Behavioural Preferences [category 1cg5lr]`), which is the same id a `canon_add` refusal lists; the word keeps it from reading as an entry handle, which the block renders as `[1i15c2]`. Uncategorized entries carry no id, and a scope group holding a single category stays flat with no sub-heading.
|
|
20
|
-
- **Peer notices** — entry changes are
|
|
20
|
+
- **Peer notices** — entry changes are published over the `ipc` transport's bus (namespace `canon`); receivers match the entry scope against their own model and audience.
|
|
21
21
|
- **Tail sections** — another extension contributes prompt text through the `canon:section` event; its ids are published on `canon:sections`.
|
|
22
22
|
|
|
23
23
|
## Exports
|
package/index.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* changes via canon notices (and the user's /canon-dump).
|
|
15
15
|
* Edited at runtime via canon_add / canon_remove / canon_edit (plus
|
|
16
16
|
* the /canon and /canon-dump commands). Changes are broadcast to peer sessions
|
|
17
|
-
* over the
|
|
17
|
+
* over the `ipc` transport's extension bus (namespace "canon"); each receiver matches
|
|
18
18
|
* the entry scope against its own model + audience before showing a notice.
|
|
19
19
|
*
|
|
20
20
|
* Replaces APPEND_SYSTEM.md (global/parent) and FLASH.md (global/subagent).
|
|
@@ -714,8 +714,8 @@ export default function (pi: ExtensionAPI) {
|
|
|
714
714
|
|
|
715
715
|
// Best-effort peer notice: the store write has already landed when this runs,
|
|
716
716
|
// so EVERY failure mode of the channel call is swallowed here and logged:
|
|
717
|
-
// -
|
|
718
|
-
//
|
|
717
|
+
// - the channel's publish may throw SYNCHRONOUSLY when the transport is
|
|
718
|
+
// down, and returns void, so there is no promise to catch;
|
|
719
719
|
// - it returns void, so .catch must only ever be reached through the
|
|
720
720
|
// optional call (chaining it directly was the TypeError that escaped);
|
|
721
721
|
// - a promise-returning build rejects instead of throwing — the guarded
|
|
@@ -748,7 +748,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
// ----------
|
|
751
|
+
// ---------- the bus channel (mirrors the ipc package's registration) ----------
|
|
752
752
|
|
|
753
753
|
const registration: CanonRegistration = {
|
|
754
754
|
namespace: NAMESPACE,
|
|
@@ -793,7 +793,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
793
793
|
pi.events.emit("intercom:extension-register", registration);
|
|
794
794
|
}
|
|
795
795
|
|
|
796
|
-
//
|
|
796
|
+
// The registrar may load after this extension; re-emit once the registry is
|
|
797
797
|
// reported ready. First successful registration wins (duplicate namespace
|
|
798
798
|
// is rejected, not thrown).
|
|
799
799
|
pi.events.on("intercom:extension-registry-ready", () => {
|