@agimon-ai/doompi-extension-contracts 0.0.1-alpha.21 → 0.0.1-alpha.22

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 +61 -36
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # @agimon-ai/doompi-extension-contracts
2
2
 
3
- **One event name. One payload. One contract.**
3
+ Validated protocols and lifecycle contracts shared by independently bundled DoomPi extensions.
4
4
 
5
- Doompi extensions talk over Pi's shared event bus. This package keeps that bus from
6
- becoming a collection of magic strings and hopeful type casts. Import the protocol,
7
- validate the payload at the boundary, and let separately bundled extensions agree on what
8
- they are saying.
5
+ This is a library, not a Pi extension: it has no Pi manifest, no Pi peer dependency, and nothing to add to a DoomPi layer. Extension authors install it when contributing to shared DoomPi surfaces.
9
6
 
10
- This is part of [Doompi](https://www.npmjs.com/package/@agimon-ai/doompi). Most users get
11
- it transitively; extension authors install it when contributing to Doompi's shared
12
- surfaces.
7
+ > **Alpha:** protocol contracts may change between releases.
8
+
9
+ ## Requirements
10
+
11
+ - Node.js 22.19.0 or newer
13
12
 
14
13
  ## Install
15
14
 
@@ -17,34 +16,60 @@ surfaces.
17
16
  npm install @agimon-ai/doompi-extension-contracts
18
17
  ```
19
18
 
20
- ## How it loads
21
-
22
- This is a library, not a Pi extension. Doompi packages import it directly; there is no
23
- extension entry and nothing to add to `.doom/modes.yaml`.
24
-
25
- ## The important contracts
26
-
27
- - `/mode` owns the session-scoped minor-mode catalog, owner registration, revisioned
28
- snapshots, and owner-routed actions used by the `MODES` line and headless clients. A
29
- registered mode remains discoverable while inactive.
30
- - `/leader` is the binding-contribution protocol behind the shared `SPC` tree.
31
- - `/help` carries package-qualified Help descriptors to the parent-only host and publishes
32
- generation-safe active-skill snapshots without depending on Pi types.
33
- - `/voice-tools` is the canonical session-scoped spoken-capability registry. Extensions
34
- register callbacks; the façade remains exactly `describe_voice_tools` plus
35
- `use_voice_tools`. `VOICE_NARRATE_TOOL_NAME` names Voice's separate mode-owned `narrate`
36
- tool, and `VOICE_MODE_TOOL_NAMES` is the complete three-name reconciliation set.
37
- - `/background-work`, `/delegation`, `/subagent-policy`, and `/subagent-tool` keep parent,
38
- child, and task runtimes on the same lifecycle rules.
39
- - `/narration` lets task, workflow, user-feedback, and other extensions request
40
- session-scoped external speech. It shares the 4,096-character schema and normalization
41
- boundary used by direct narration, but it does not expose or invoke the primary-agent
42
- `narrate` tool.
43
- - `/config`, `/footer`, `/mcp-status`, `/skills`, `/workflow`, and the process contracts
44
- cover the other shared Doompi surfaces.
45
-
46
- Registrations are validated, bounded, generation-safe, and shared across separately loaded
47
- ESM and CJS bundles. `package.json` carries the complete supported subpath list.
19
+ ## Contract map
20
+
21
+ The root export provides common protocol helpers. Focused subpaths define ownership boundaries:
22
+
23
+ | Subpath | Contract |
24
+ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------- |
25
+ | `/protocol` | Runtime creation, request/reply, notification, job, validation, and protocol errors |
26
+ | `/mode` | Session-scoped minor-mode registration, snapshots, and owner-routed actions |
27
+ | `/leader` | Leader Space contributions and action handlers |
28
+ | `/help` | Package-qualified Help descriptors and active-skill snapshots |
29
+ | `/voice-tools`, `/narration` | Spoken tool registration and external narration requests |
30
+ | `/background-work`, `/delegation` | Background/delegated work lifecycle |
31
+ | `/subagent-policy`, `/subagent-tool` | Team policy and tool boundaries |
32
+ | `/config`, `/footer`, `/mcp-status`, `/skills`, `/workflow` | Other shared DoomPi surfaces |
33
+ | `/child-process`, `/runner-pty`, `/fable-plan` | Focused process, terminal, and planning integration contracts |
34
+
35
+ Schemas validate data at the event boundary. Registrations are generation-safe and work across separately loaded ESM and CJS bundles.
36
+
37
+ ## Example: contribute a Leader binding
38
+
39
+ ```ts
40
+ import { registerDoomLeaderContribution } from '@agimon-ai/doompi-extension-contracts/leader';
41
+ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
42
+
43
+ export function registerReviewLeader(pi: ExtensionAPI): () => void {
44
+ return registerDoomLeaderContribution(pi, {
45
+ source: '@example/review-extension',
46
+ bindings: [
47
+ {
48
+ id: 'review.open',
49
+ path: [{ key: 'r', label: 'review' }],
50
+ command: { name: 'review' },
51
+ },
52
+ ],
53
+ });
54
+ }
55
+ ```
56
+
57
+ Keep the returned disposer and invoke it during extension shutdown. Providers own their protocol and policy; consumers register semantic contributions rather than mutating another package's tool calls.
58
+
59
+ ## Session boundaries
60
+
61
+ The protocols coordinate runtimes; they do not create global persistence. Parent and child processes install their own providers and clients. Session-scoped registrations, revisions, and generation tokens prevent stale providers from silently controlling a later session.
62
+
63
+ Use these contracts when authoring DoomPi extensions, host adapters, Help contributors, Leader entries, mode owners, Team consumers, Workflow integrations, or Voice-aware capabilities.
64
+
65
+ ## Development
66
+
67
+ ```bash
68
+ pnpm build
69
+ pnpm typecheck
70
+ pnpm test
71
+ pnpm lint
72
+ ```
48
73
 
49
74
  ## License
50
75
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-extension-contracts",
3
- "version": "0.0.1-alpha.21",
3
+ "version": "0.0.1-alpha.22",
4
4
  "description": "Validated event protocols shared by Doompi extensions",
5
5
  "keywords": [
6
6
  "ai",