@davidorex/pi-jit-agents 0.29.0 → 0.30.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 CHANGED
@@ -4,6 +4,8 @@ All notable changes to this package are documented here. Format follows [Keep a
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.30.0] - 2026-06-04
8
+
7
9
  ## [0.29.0] - 2026-06-04
8
10
 
9
11
  ## [0.28.1] - 2026-06-03
package/README.md CHANGED
@@ -19,11 +19,15 @@ The package owns four public surfaces:
19
19
 
20
20
  - `loadAgent(name, ctx) → AgentSpec` — resolves spec from discovery tiers, fully resolves all path fields to absolute
21
21
  - `compileAgent(spec, ctx) → CompiledAgent` — renders templates, injects `contextBlocks` from the substrate directory, composes final prompts
22
- - `executeAgent(compiled, dispatch) → JitAgentResult` — in-process LLM dispatch with phantom tool enforcement
22
+ - `executeAgent(compiled, dispatch) → JitAgentResult` — in-process LLM dispatch with phantom tool enforcement; clamps the compiled agent's tool grant to a subset of the caller-supplied parent grant at the dispatch boundary
23
23
  - `agentContract(spec) → AgentContract` — projection for introspection, no execution
24
24
 
25
25
  Subprocess dispatch stays in pi-workflows. The package never reads from `.pi/` — that directory is Pi platform territory.
26
26
 
27
+ ## Tool-grant clamping
28
+
29
+ `AgentSpec.tools` (operation-granular tool names) threads through `compileAgent` into `CompiledAgent.tools`. At dispatch, `executeAgent` clamps `compiled.tools` to a subset of `DispatchContext.parentGrant` (the caller's own grant; undefined parent grant means the empty set). A child requesting a tool outside the parent grant raises `GrantViolationError`, naming the agent and the violating tools.
30
+
27
31
  ## Discovery tiers
28
32
 
29
33
  Agent specs are searched in this order:
@@ -34,12 +38,20 @@ Agent specs are searched in this order:
34
38
 
35
39
  The framework package itself ships no bundled agent specs. Consumer packages supply their own builtin directory at loader construction time.
36
40
 
41
+ ## Bundled templates
42
+
43
+ The agent-template tree ships in this package under `templates/` (relocated here from pi-workflows). `bundledTemplateDir()` returns its absolute path so consumers can discover the bundled templates from either source or built (`dist`) layouts. `templates/shared/macros.md` provides one per-item rendering macro per block kind plus six whole-block delegator macros (`render_decisions`, `render_features`, `render_framework_gaps`, `render_layer_plans`, `render_research`, `render_spec_reviews`) that wrap the per-item macros.
44
+
45
+ `CANONICAL_MACRO_NAMES` is the registry mapping each block kind to its `{ macro_name, array_key }`, surfacing the cases where the block kind differs from the data key the items live under (e.g. `framework-gaps`→`gaps`, `layer-plans`→`plans`, `spec-reviews`→`reviews`). `createRendererRegistry` builds the kind→macro-ref map consumed during compilation.
46
+
37
47
  ## Exports
38
48
 
39
49
  - `.` — main barrel
40
50
  - `./types` — type definitions
41
51
  - `./agent-spec` — `parseAgentYaml`, `createAgentLoader`
42
52
  - `./template` — `createTemplateEnv`, `renderTemplate`, `renderTemplateFile`
43
- - `./compile` — `compileAgent`
44
- - `./runtime` — `executeAgent`, `buildPhantomTool`
53
+ - `./compile` — `compileAgent`, `registerCompositionGlobals`
54
+ - `./runtime` — `executeAgent`, `buildPhantomTool`, `normalizeToolChoice`, `GrantViolationError`
45
55
  - `./introspect` — `agentContract`
56
+
57
+ The main barrel additionally re-exports the bundled-template entry point (`bundledTemplateDir`), the renderer registry (`CANONICAL_MACRO_NAMES`, `createRendererRegistry`), and `GrantViolationError`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@davidorex/pi-jit-agents",
3
- "version": "0.29.0",
3
+ "version": "0.30.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -62,7 +62,7 @@
62
62
  "test": "tsx --test src/*.test.ts"
63
63
  },
64
64
  "dependencies": {
65
- "@davidorex/pi-context": "^0.29.0",
65
+ "@davidorex/pi-context": "^0.30.0",
66
66
  "@earendil-works/pi-ai": "^0.75.4",
67
67
  "nunjucks": "^3.2.4",
68
68
  "proper-lockfile": "^4.1.2",