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

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 +65 -36
  2. package/package.json +8 -6
package/README.md CHANGED
@@ -1,15 +1,16 @@
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
+ Part of the [DoomPi distribution](https://www.npmjs.com/package/@agimon-ai/doompi).
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
+ 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.
8
+
9
+ > **Alpha:** protocol contracts may change between releases.
10
+
11
+ ## Requirements
12
+
13
+ - Node.js 22.19.0 or newer
13
14
 
14
15
  ## Install
15
16
 
@@ -17,34 +18,62 @@ surfaces.
17
18
  npm install @agimon-ai/doompi-extension-contracts
18
19
  ```
19
20
 
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.
21
+ ## Contract map
22
+
23
+ The root export provides common protocol helpers. Focused subpaths define ownership boundaries:
24
+
25
+ | Subpath | Contract |
26
+ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------- |
27
+ | `/protocol` | Runtime creation, request/reply, notification, job, validation, and protocol errors |
28
+ | `/mode` | Session-scoped minor-mode registration, snapshots, and owner-routed actions |
29
+ | `/leader` | Leader Space contributions and action handlers |
30
+ | `/help` | Package-qualified Help descriptors and active-skill snapshots |
31
+ | `/voice-tools`, `/narration` | Spoken tool registration and external narration requests |
32
+ | `/background-work`, `/delegation` | Background/delegated work lifecycle |
33
+ | `/subagent-policy`, `/subagent-tool` | Team policy and tool boundaries |
34
+ | `/config`, `/footer`, `/mcp-status`, `/skills`, `/workflow` | Other shared DoomPi surfaces |
35
+ | `/child-process`, `/runner-pty`, `/fable-plan` | Focused process, terminal, and planning integration contracts |
36
+
37
+ Schemas validate data at the event boundary. Registrations are generation-safe and work across separately loaded ESM and CJS bundles.
38
+
39
+ ## Example: contribute a Leader binding
40
+
41
+ ```ts
42
+ import { registerDoomLeaderContribution } from '@agimon-ai/doompi-extension-contracts/leader';
43
+ import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
44
+
45
+ export function registerReviewLeader(pi: ExtensionAPI): () => void {
46
+ return registerDoomLeaderContribution(pi, {
47
+ source: '@example/review-extension',
48
+ bindings: [
49
+ {
50
+ id: 'review.open',
51
+ path: [{ key: 'r', label: 'review' }],
52
+ command: { name: 'review' },
53
+ },
54
+ ],
55
+ });
56
+ }
57
+ ```
58
+
59
+ 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.
60
+
61
+ ## Session boundaries
62
+
63
+ 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.
64
+
65
+ Use these contracts when authoring DoomPi extensions, host adapters, Help contributors, Leader entries, mode owners, Team consumers, Workflow integrations, or Voice-aware capabilities.
66
+
67
+ ## Development
68
+
69
+ ```bash
70
+ pnpm build
71
+ pnpm typecheck
72
+ pnpm test
73
+ pnpm lint
74
+ ```
75
+
76
+ Maintained by [Agimon](https://agimon.ai/about).
48
77
 
49
78
  ## License
50
79
 
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@agimon-ai/doompi-extension-contracts",
3
- "version": "0.0.1-alpha.21",
4
- "description": "Validated event protocols shared by Doompi extensions",
3
+ "version": "0.0.1-alpha.23",
4
+ "description": "Typed lifecycle, protocol, and Leader contracts for independently bundled DoomPi extensions.",
5
5
  "keywords": [
6
- "ai",
7
- "coding-agent",
8
- "developer-tools",
9
6
  "doompi",
10
- "pi-package"
7
+ "extension-api",
8
+ "leader-key",
9
+ "lifecycle",
10
+ "pi-extension",
11
+ "protocol",
12
+ "typescript"
11
13
  ],
12
14
  "homepage": "https://agimon.ai",
13
15
  "license": "MIT",