@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.
- package/README.md +61 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
# @agimon-ai/doompi-extension-contracts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Validated protocols and lifecycle contracts shared by independently bundled DoomPi extensions.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
##
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- `/
|
|
31
|
-
- `/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|