@davidorex/pi-agent-dispatch 0.28.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/CHANGELOG.md +25 -0
- package/README.md +37 -0
- package/dist/attested-commit.d.ts +32 -0
- package/dist/attested-commit.d.ts.map +1 -0
- package/dist/attested-commit.js +61 -0
- package/dist/attested-commit.js.map +1 -0
- package/dist/auth-gate.d.ts +92 -0
- package/dist/auth-gate.d.ts.map +1 -0
- package/dist/auth-gate.js +210 -0
- package/dist/auth-gate.js.map +1 -0
- package/dist/author-agent-spec-tool.d.ts +33 -0
- package/dist/author-agent-spec-tool.d.ts.map +1 -0
- package/dist/author-agent-spec-tool.js +98 -0
- package/dist/author-agent-spec-tool.js.map +1 -0
- package/dist/author-tool-grant-tool.d.ts +47 -0
- package/dist/author-tool-grant-tool.d.ts.map +1 -0
- package/dist/author-tool-grant-tool.js +87 -0
- package/dist/author-tool-grant-tool.js.map +1 -0
- package/dist/call-agent-tool.d.ts +42 -0
- package/dist/call-agent-tool.d.ts.map +1 -0
- package/dist/call-agent-tool.js +90 -0
- package/dist/call-agent-tool.js.map +1 -0
- package/dist/capability-composer.d.ts +11 -0
- package/dist/capability-composer.d.ts.map +1 -0
- package/dist/capability-composer.js +35 -0
- package/dist/capability-composer.js.map +1 -0
- package/dist/commit-attested-tool.d.ts +29 -0
- package/dist/commit-attested-tool.d.ts.map +1 -0
- package/dist/commit-attested-tool.js +45 -0
- package/dist/commit-attested-tool.js.map +1 -0
- package/dist/composite-loader.d.ts +36 -0
- package/dist/composite-loader.d.ts.map +1 -0
- package/dist/composite-loader.js +137 -0
- package/dist/composite-loader.js.map +1 -0
- package/dist/composites/command-allowlist.d.ts +29 -0
- package/dist/composites/command-allowlist.d.ts.map +1 -0
- package/dist/composites/command-allowlist.js +36 -0
- package/dist/composites/command-allowlist.js.map +1 -0
- package/dist/composites/git-log.d.ts +31 -0
- package/dist/composites/git-log.d.ts.map +1 -0
- package/dist/composites/git-log.js +39 -0
- package/dist/composites/git-log.js.map +1 -0
- package/dist/composites/grep-paths.d.ts +26 -0
- package/dist/composites/grep-paths.d.ts.map +1 -0
- package/dist/composites/grep-paths.js +34 -0
- package/dist/composites/grep-paths.js.map +1 -0
- package/dist/composites/read-files.d.ts +24 -0
- package/dist/composites/read-files.d.ts.map +1 -0
- package/dist/composites/read-files.js +35 -0
- package/dist/composites/read-files.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/operation-vocab.d.ts +25 -0
- package/dist/operation-vocab.d.ts.map +1 -0
- package/dist/operation-vocab.js +78 -0
- package/dist/operation-vocab.js.map +1 -0
- package/dist/read-truncation-gate.d.ts +143 -0
- package/dist/read-truncation-gate.d.ts.map +1 -0
- package/dist/read-truncation-gate.js +175 -0
- package/dist/read-truncation-gate.js.map +1 -0
- package/dist/real-check-runner.d.ts +66 -0
- package/dist/real-check-runner.d.ts.map +1 -0
- package/dist/real-check-runner.js +133 -0
- package/dist/real-check-runner.js.map +1 -0
- package/dist/run-real-checks-tool.d.ts +28 -0
- package/dist/run-real-checks-tool.d.ts.map +1 -0
- package/dist/run-real-checks-tool.js +47 -0
- package/dist/run-real-checks-tool.js.map +1 -0
- package/dist/run-work-order-loop-tool.d.ts +35 -0
- package/dist/run-work-order-loop-tool.d.ts.map +1 -0
- package/dist/run-work-order-loop-tool.js +46 -0
- package/dist/run-work-order-loop-tool.js.map +1 -0
- package/dist/verified-identity.d.ts +54 -0
- package/dist/verified-identity.d.ts.map +1 -0
- package/dist/verified-identity.js +133 -0
- package/dist/verified-identity.js.map +1 -0
- package/dist/work-order-loop.d.ts +82 -0
- package/dist/work-order-loop.d.ts.map +1 -0
- package/dist/work-order-loop.js +149 -0
- package/dist/work-order-loop.js.map +1 -0
- package/package.json +59 -0
- package/skill-narrative.md +53 -0
- package/skills/pi-agent-dispatch/SKILL.md +138 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pi-agent-dispatch
|
|
3
|
+
description: >
|
|
4
|
+
Sibling Pi extension that registers in-pi agent-as-tool dispatch, capability
|
|
5
|
+
composition, real-check execution, attested commits, and the bounded north-star
|
|
6
|
+
work-order loop. Use when authoring agent specs, granting tool capabilities,
|
|
7
|
+
running deterministic checks, committing with writer attestation, loading
|
|
8
|
+
config-declared composite operations, or driving end-to-end work-orders through
|
|
9
|
+
their bounded retry loop.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<tools_reference>
|
|
13
|
+
<tool name="author-agent-spec">
|
|
14
|
+
Write a new .agent.yaml spec to the agents tier. Requires user authorization via interactive confirmation at the pi-dispatch auth-gate; on confirm, the verified terminal-operator identity is stamped as writer. The written file is AJV-validated against AgentSpec before persisting.
|
|
15
|
+
|
|
16
|
+
*Author a privileged JIT-agent spec — declares input, prompts, tools grant, output schema, contextBlocks.*
|
|
17
|
+
|
|
18
|
+
| Parameter | Type | Required | Description |
|
|
19
|
+
|-----------|------|----------|-------------|
|
|
20
|
+
| `name` | string | yes | Agent name (becomes <name>.agent.yaml filename + AgentSpec.name). |
|
|
21
|
+
| `spec` | unknown | yes | AgentSpec object body (will be serialized to YAML). Must conform to AgentSpec shape. |
|
|
22
|
+
| `writer` | object | yes | DispatchContext.writer payload; see pi-context/src/dispatch-context.ts for the discriminated union. |
|
|
23
|
+
</tool>
|
|
24
|
+
|
|
25
|
+
<tool name="call-agent">
|
|
26
|
+
Dispatch a privileged JIT-agent as a typed tool call. Loads the named .agent.yaml, compiles with input, composes the tool grant (intersection of caller's parentGrant and the agent's requestedGrant), and executes via pi-jit-agents executeAgent (clamp enforces child ⊆ parent at dispatch boundary).
|
|
27
|
+
|
|
28
|
+
*Dispatch a typed sub-agent with scoped capability grant.*
|
|
29
|
+
|
|
30
|
+
| Parameter | Type | Required | Description |
|
|
31
|
+
|-----------|------|----------|-------------|
|
|
32
|
+
| `spec_name` | string | yes | Name of the agent spec to load (resolves to <name>.agent.yaml in the agents tier). |
|
|
33
|
+
| `input` | unknown | yes | Typed input passed to the agent's compileAgent context. |
|
|
34
|
+
| `parent_grant` | array | no | The caller's own tool grant. Default-empty. |
|
|
35
|
+
| `requested_grant` | array | no | The grant requested for the dispatched sub-agent. Will be clamped to the intersection with parent_grant. |
|
|
36
|
+
| `max_tokens` | number | no | Max tokens for the LLM call. Defaults to 1024. |
|
|
37
|
+
</tool>
|
|
38
|
+
|
|
39
|
+
<tool name="run-real-checks">
|
|
40
|
+
Run the deterministic real-checks declared on a work-order (build/check/test exit + runtime-demo + adversarial-probe). Returns a structured RealCheckResult. NEVER LLM self-report; verdict is the actual exit code.
|
|
41
|
+
|
|
42
|
+
*Run a work-order's declared real-checks for verdict gating.*
|
|
43
|
+
|
|
44
|
+
| Parameter | Type | Required | Description |
|
|
45
|
+
|-----------|------|----------|-------------|
|
|
46
|
+
| `work_order_id` | string | yes | ID of the work-order whose real_check_criteria to run (e.g. 'WO-NNN'). |
|
|
47
|
+
| `max_check_time_ms` | number | no | Max total time per check in milliseconds. Defaults to 600000 (10 minutes). |
|
|
48
|
+
</tool>
|
|
49
|
+
|
|
50
|
+
<tool name="commit-attested">
|
|
51
|
+
Stage declared files + invoke git commit with DispatchContext writer.kind=agent attestation footer. Husky pre-commit runs as backup gate; never bypass (--no-verify forbidden per feedback_no_destructive_git_ops). The primary gate is run-real-checks called BEFORE this tool.
|
|
52
|
+
|
|
53
|
+
*Commit agent-authored work-product files with attestation footer.*
|
|
54
|
+
|
|
55
|
+
| Parameter | Type | Required | Description |
|
|
56
|
+
|-----------|------|----------|-------------|
|
|
57
|
+
| `files` | array | yes | Files to stage + commit. Empty array refused. |
|
|
58
|
+
| `message` | string | yes | Commit message body (the attestation footer is appended automatically). |
|
|
59
|
+
| `agent_id` | string | yes | Agent id for writer.kind=agent attestation (e.g. 'spec-implementer-001'). |
|
|
60
|
+
| `work_order_id` | string | no | Optional work-order id for the attestation footer. |
|
|
61
|
+
</tool>
|
|
62
|
+
|
|
63
|
+
<tool name="author-tool-grant">
|
|
64
|
+
Add or remove an entry in config.tool_operations[] or config.tool_operations_forbidden[]. Requires user authorization via interactive confirmation at the pi-dispatch auth-gate; on confirm, the verified terminal-operator identity is stamped as writer. Refuses any attempt to register a framework-forbidden wholesale token.
|
|
65
|
+
|
|
66
|
+
*Author a config tool-grant entry (operation registration or project-forbidden token).*
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Required | Description |
|
|
69
|
+
|-----------|------|----------|-------------|
|
|
70
|
+
| `target` | unknown | yes | Which config registry to mutate. |
|
|
71
|
+
| `operation` | unknown | yes | amendConfigEntry operation. |
|
|
72
|
+
| `key` | string | yes | For tool_operations: the canonical_id (must match entry.canonical_id). For tool_operations_forbidden: the token string. |
|
|
73
|
+
| `entry` | unknown | no | ToolOperationDecl object — required for target=tool_operations + operation=add. |
|
|
74
|
+
| `writer` | object | yes | DispatchContext.writer payload; see pi-context/src/dispatch-context.ts for the discriminated union. |
|
|
75
|
+
</tool>
|
|
76
|
+
|
|
77
|
+
<tool name="run-work-order-loop">
|
|
78
|
+
Execute the bounded work-order loop: dispatch target_agent (via direct pi-jit-agents library) → run-real-checks (deterministic verdict — the actual exit code, never an LLM self-report) → on-pass commit-attested → on-fail human-OK retry at the iteration boundary. Bounded iterations (default 3); human-OK gate governs retry.
|
|
79
|
+
|
|
80
|
+
*Execute the end-to-end work-order loop for a declared spec.*
|
|
81
|
+
|
|
82
|
+
| Parameter | Type | Required | Description |
|
|
83
|
+
|-----------|------|----------|-------------|
|
|
84
|
+
| `work_order_id` | string | yes | ID of the work-order to execute (loads from .project/work-orders.json schema). |
|
|
85
|
+
| `max_iterations` | number | no | Max iteration count before fail-final. Default 3. |
|
|
86
|
+
| `agent_grant` | array | no | Tool grant for the dispatched privileged agent (capability composition). Default empty. |
|
|
87
|
+
</tool>
|
|
88
|
+
|
|
89
|
+
</tools_reference>
|
|
90
|
+
|
|
91
|
+
<events>
|
|
92
|
+
`tool_call`, `tool_result`
|
|
93
|
+
</events>
|
|
94
|
+
|
|
95
|
+
<objective>
|
|
96
|
+
pi-agent-dispatch is the harness-confined orchestrator's in-pi surface. It registers Pi tools the orchestrator agent invokes to dispatch sub-agents, author specs and tool grants, run deterministic checks the executive cannot fake, commit with writer attestation, and drive bounded work-order loops. It is the sibling-consumer registration site; pi-jit-agents stays a library consumed directly by this package and by pi-workflows.
|
|
97
|
+
</objective>
|
|
98
|
+
|
|
99
|
+
<dispatch_tools>
|
|
100
|
+
| Tool | Purpose |
|
|
101
|
+
|------|---------|
|
|
102
|
+
| `call-agent` | Dispatch a declared agent spec with a composed tool grant (parent ∩ requested ∩ spec.tools). |
|
|
103
|
+
| `author-agent-spec` | Write an `.agent.yaml` spec to the substrate. Human-authorized via auth-gate confirm at the pi-dispatch layer; the verified terminal-operator identity is stamped as writer on confirm. |
|
|
104
|
+
| `run-work-order-loop` | Execute the bounded work-order loop: dispatch → run-real-checks → on-pass commit-attested → on-fail human-OK retry. |
|
|
105
|
+
</dispatch_tools>
|
|
106
|
+
|
|
107
|
+
<real_check_tools>
|
|
108
|
+
| Tool | Purpose |
|
|
109
|
+
|------|---------|
|
|
110
|
+
| `run-real-checks` | Execute declared deterministic checks (build/check/test exit codes, schema validations, git diff probes, runtime event probes). Verdict is the actual exit code, never an LLM self-report. |
|
|
111
|
+
| `commit-attested` | Stage + commit with writer-identity footer. Refuses on missing agent_id, files, or message. |
|
|
112
|
+
</real_check_tools>
|
|
113
|
+
|
|
114
|
+
<capability_authoring>
|
|
115
|
+
Tool grants are config-declared (bounded composites) and authored only via the `author-tool-grant` Pi tool, which is human-authorized at the pi-dispatch auth-gate (interactive confirmation; on confirm the verified terminal-operator identity is stamped as writer). Default grant is empty; widening goes through the auth-gate. The FORBIDDEN_WHOLESALE_OPERATIONS set blocks shipping wholesale L1 surfaces (bash, write, edit) as a single composite token; the L1 ∪ L5 forbidden union check refuses tokens that already appear on the L1 wholesale-forbidden list.
|
|
116
|
+
</capability_authoring>
|
|
117
|
+
|
|
118
|
+
<composite_loader>
|
|
119
|
+
On extension load, `composite-loader` reads the active substrate's `config.tool_operations[]` and dynamically registers each declared bounded composite as a Pi tool. Config-absent (no pointer or unbootstrapped substrate) degrades gracefully: extension still registers the 6 static tools; the absence is observed via the `extension_load_warning` TraceEntry and (when available) surfaced through `pi.ui.notify`. The substrate is the single source of truth — no parallel ungated path widens capability outside the loader.
|
|
120
|
+
</composite_loader>
|
|
121
|
+
|
|
122
|
+
<canonical_intention>
|
|
123
|
+
Anchors:
|
|
124
|
+
- Harness-confined orchestrator (positive clause: substrate-write + call-agent + author-agent-spec + run-real-checks + commit-attested + author-tool-grant + run-work-order-loop + declared composites; negative clause: NO bash/edit/write).
|
|
125
|
+
- Sibling-consumer scope; pi-jit-agents stays a library.
|
|
126
|
+
- Human-authorized authoring at the pi-dispatch auth-gate; default empty; terminal verdict = real deterministic checks.
|
|
127
|
+
- Capability composition + end-to-end work-order loop + bounded-composite vocabulary + launch-chain integration.
|
|
128
|
+
- Orchestrator uses jit-agents directly; capability composition lives in the dispatch layer.
|
|
129
|
+
</canonical_intention>
|
|
130
|
+
|
|
131
|
+
<success_criteria>
|
|
132
|
+
- 6 static tools register on every load: call-agent, author-agent-spec, author-tool-grant, run-real-checks, commit-attested, run-work-order-loop.
|
|
133
|
+
- Composite tools register from config.tool_operations[] when present; load proceeds with warning when absent.
|
|
134
|
+
- Every write-bearing tool routes through the pi-dispatch auth-gate; the verified terminal-operator identity is stamped as writer on confirm.
|
|
135
|
+
- Work-order loop honors max_iterations + human-OK retry gate + on-pass attested commit.
|
|
136
|
+
</success_criteria>
|
|
137
|
+
|
|
138
|
+
*Generated from source by `scripts/generate-skills.js` — do not edit by hand.*
|