pi-delegation-policy 0.4.1 → 0.5.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 +11 -0
- package/README.md +7 -5
- package/SECURITY.md +1 -1
- package/package.json +1 -1
- package/src/delegate-panel.ts +2 -2
- package/src/prompt.ts +12 -2
- package/src/types.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.5.0 - 2026-08-28
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Expanded the optional visual specialist to create assets and complete bounded presentation-layer changes when behavior and data contracts are already defined.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Renamed the user-facing UI Design role to Visual Design while preserving the `uiDesign` configuration key and `ui-design` status token.
|
|
14
|
+
- Clarified routing boundaries for application behavior, accessibility, checks, integration, and final acceptance.
|
|
15
|
+
|
|
5
16
|
## 0.4.1 - 2026-08-28
|
|
6
17
|
|
|
7
18
|
### Fixed
|
package/README.md
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
# pi-delegation-policy
|
|
2
2
|
|
|
3
|
-
A local Pi extension that helps the main agent decide **when delegation is worth it** and which exact models to use for the Small, Medium, Large, and optional
|
|
3
|
+
A local Pi extension that helps the main agent decide **when delegation is worth it** and which exact models to use for the Small, Medium, Large, and optional Visual Design roles. It provides guidance; it is not a subagent runner.
|
|
4
4
|
|
|
5
|
-
> **Status:** Version **0.
|
|
5
|
+
> **Status:** Version **0.5.0** is the latest published package. The package requires Pi `>=0.84.3`; Pi `0.84.3` is the explicitly checked baseline (newer versions are not claimed as tested). The repository and npm package describe the same published behavior.
|
|
6
6
|
>
|
|
7
7
|
> **Docs:** [Read the documentation site](https://yivas.github.io/pi-delegation-policy/).
|
|
8
8
|
|
|
9
9
|
## Value and boundary
|
|
10
10
|
|
|
11
11
|
- Choose `off`, `normal`, or `aggressive` delegation intensity globally or for the current session branch.
|
|
12
|
-
- Configure exact provider/model references for Small, Medium, Large, and optionally
|
|
12
|
+
- Configure exact provider/model references for Small, Medium, Large, and optionally Visual Design.
|
|
13
13
|
- Keep global defaults and session-branch overrides across reload, resume, and tree navigation.
|
|
14
14
|
- Validate active configurations before injecting one policy block through Pi's public `before_agent_start` event.
|
|
15
15
|
|
|
16
16
|
The extension guides the main agent. It never creates, launches, routes, supervises, or blocks subagents; changes Pi's main model or thinking; stores credentials; intercepts tools; or makes its own network requests. It has no model fallback, telemetry, project configuration, presets, or external skill loading.
|
|
17
17
|
|
|
18
|
+
Visual Design is an optional specialist for direction, assets, bounded presentation-layer implementation, and visual review. Use it only when behavior and data contracts are already defined and unchanged, the affected surface is bounded, and visual quality or user experience is the primary acceptance criterion. Route business logic, data, APIs, routes, application architecture, tooling, interaction behavior, and cross-system integration to Small, Medium, or Large by task fit. The main agent retains final integration and acceptance.
|
|
19
|
+
|
|
18
20
|
## Install and start
|
|
19
21
|
|
|
20
22
|
Install the published package in Pi's user settings, then reload Pi:
|
|
@@ -25,7 +27,7 @@ pi install npm:pi-delegation-policy
|
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
1. Open `/delegate` (or press `Alt+G` in Pi's TUI).
|
|
28
|
-
2. Configure exact, authenticated Small, Medium, and Large provider/model references.
|
|
30
|
+
2. Configure exact, authenticated Small, Medium, and Large provider/model references. Visual Design is optional.
|
|
29
31
|
3. Select `normal` or `aggressive`, then choose **Apply changes**.
|
|
30
32
|
4. Run `/delegate status` and inspect the exact role references and their sources. `D:ERR` means an active required role is invalid; no policy is injected.
|
|
31
33
|
5. The applied state affects the **next** agent run. An agent already running is not rewritten.
|
|
@@ -47,7 +49,7 @@ The editor is a bounded, keyboard-first panel. It shows model ID first and `[pro
|
|
|
47
49
|
|
|
48
50
|
## Configuration and safety
|
|
49
51
|
|
|
50
|
-
Global defaults are stored at `~/.pi/agent/delegation-policy.json` (schema version 2). The file stores optional intensity, preference, exact role references, and an optional
|
|
52
|
+
Global defaults are stored at `~/.pi/agent/delegation-policy.json` (schema version 2). The file stores optional intensity, preference, exact role references, and an optional Visual Design reference under the stable `uiDesign` key; it never stores thinking. A valid active mode requires exact, available, in-scope, authenticated Small, Medium, and Large references. Before every delegated launch, the policy requires the selected role's exact `provider/model` base and a thinking level chosen for that task instead of relying on ambient defaults. With `pi-subagents`, the main agent passes both as `model: "provider/model:LEVEL"`; other launchers may expose a separate per-run thinking field. Invalid active configuration fails closed as `D:ERR` with no policy injection; `off` is always `D:OFF`.
|
|
51
53
|
|
|
52
54
|
The extension stores only policy settings and provider/model identifiers in local defaults and session entries. Review local configuration before sharing diagnostics, and remove credentials, prompts, personal paths, session files, and unredacted logs from reports. See the [limits and privacy reference](https://yivas.github.io/pi-delegation-policy/limits-and-privacy/) and [security policy](https://github.com/Yivas/pi-delegation-policy/blob/main/SECURITY.md).
|
|
53
55
|
|
package/SECURITY.md
CHANGED
|
@@ -14,4 +14,4 @@ Include the affected version or commit, operating system, Pi version, reproducti
|
|
|
14
14
|
|
|
15
15
|
## Supported versions
|
|
16
16
|
|
|
17
|
-
Only the latest published version is supported. Version 0.
|
|
17
|
+
Only the latest published version is supported. Version 0.5.0 is the current supported release.
|
package/package.json
CHANGED
package/src/delegate-panel.ts
CHANGED
|
@@ -73,7 +73,7 @@ const FIELD_LABELS: Record<DelegateField, string> = {
|
|
|
73
73
|
small: "Small model",
|
|
74
74
|
medium: "Medium model",
|
|
75
75
|
large: "Large model",
|
|
76
|
-
uiDesign: "
|
|
76
|
+
uiDesign: "Visual Design",
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
const FIELD_DESCRIPTIONS: Record<DelegateField, string> = {
|
|
@@ -82,7 +82,7 @@ const FIELD_DESCRIPTIONS: Record<DelegateField, string> = {
|
|
|
82
82
|
small: "Bounded, planned, and verifiable execution.",
|
|
83
83
|
medium: "Planning, ambiguity, synthesis, and coordination.",
|
|
84
84
|
large: "Exceptional unblocker for persistent hard problems.",
|
|
85
|
-
uiDesign: "
|
|
85
|
+
uiDesign: "Design, assets, and bounded presentation work; no app behavior.",
|
|
86
86
|
};
|
|
87
87
|
|
|
88
88
|
const ACTION_LABELS: Record<PanelAction, string> = {
|
package/src/prompt.ts
CHANGED
|
@@ -23,6 +23,16 @@ Large quantities of repetitive, independent work favor multiple Small delegation
|
|
|
23
23
|
|
|
24
24
|
In every intensity, keep global strategy, coordination, integration, final review, and work whose essential context is too costly or risky to transfer with the main agent.`;
|
|
25
25
|
|
|
26
|
+
const VISUAL_DESIGN_POLICY = `Visual Design is an optional specialist role. Use it only when all four conditions hold:
|
|
27
|
+
1. the primary acceptance criterion is a visual or user-experience result;
|
|
28
|
+
2. product behavior and data contracts are already defined and remain unchanged;
|
|
29
|
+
3. the patch is bounded to an identifiable surface, component, or set of assets;
|
|
30
|
+
4. it requires no business logic, data flow, APIs, routes, application architecture, tooling, or cross-system coordination.
|
|
31
|
+
|
|
32
|
+
When eligible, Visual Design may design, create, implement, and review scoped presentation code and visual assets, including layout, styles, responsive presentation, typography, images, icons, logos, SVGs, diagrams, and documentation visuals. It may address visual accessibility such as contrast and focus visibility. It must run and report the relevant existing checks for its patch.
|
|
33
|
+
|
|
34
|
+
Route interaction behavior, state, validation, semantic HTML changes, keyboard mechanics, ARIA behavior, authentication, permissions, persistence, test infrastructure, and behavior-test ownership to Small, Medium, or Large by task fit. If any eligibility condition fails, use an ordinary role or split the visual portion from the broader task. The main agent retains cross-domain integration and final acceptance.`;
|
|
35
|
+
|
|
26
36
|
function preferenceGuidance(preference: Preference): string {
|
|
27
37
|
if (preference === "efficient") {
|
|
28
38
|
return "Use efficient only as a Small tie-break when Small and Medium are comparably credible. Do not choose Small when Medium is a materially better task fit.";
|
|
@@ -81,7 +91,7 @@ export function buildDelegationPolicy(state: RuntimeState): string | undefined {
|
|
|
81
91
|
|
|
82
92
|
const intensityPolicy = effective.intensity === "normal" ? NORMAL_POLICY : AGGRESSIVE_POLICY;
|
|
83
93
|
const uiDesign = effective.uiDesign
|
|
84
|
-
? `\n-
|
|
94
|
+
? `\n- Visual Design: ${formatReference(effective.uiDesign)}; exact model base: ${formatLaunchModel(effective.uiDesign)}; pi-subagents form: ${formatThinkingLaunchModel(effective.uiDesign)}`
|
|
85
95
|
: "";
|
|
86
96
|
|
|
87
97
|
return `<delegation_policy>
|
|
@@ -98,7 +108,7 @@ Roles:
|
|
|
98
108
|
- Small: ${formatReference(effective.small)}; exact model base: ${formatLaunchModel(effective.small)}; pi-subagents form: ${formatThinkingLaunchModel(effective.small)}
|
|
99
109
|
- Medium: ${formatReference(effective.medium)}; exact model base: ${formatLaunchModel(effective.medium)}; pi-subagents form: ${formatThinkingLaunchModel(effective.medium)}
|
|
100
110
|
- Large: ${formatReference(effective.large)}; exact model base: ${formatLaunchModel(effective.large)}; pi-subagents form: ${formatThinkingLaunchModel(effective.large)}${uiDesign}
|
|
101
|
-
|
|
111
|
+
${effective.uiDesign ? `\n${VISUAL_DESIGN_POLICY}\n` : ""}
|
|
102
112
|
This is guidance for the main agent. It does not create, execute, route, supervise, or enforce delegated work.
|
|
103
113
|
</delegation_policy>`;
|
|
104
114
|
}
|
package/src/types.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const ROLE_LABELS: Record<ModelConfigKey, string> = {
|
|
|
14
14
|
small: "Small",
|
|
15
15
|
medium: "Medium",
|
|
16
16
|
large: "Large",
|
|
17
|
-
uiDesign: "
|
|
17
|
+
uiDesign: "Visual Design",
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export type ModelRef = {
|
|
@@ -39,7 +39,7 @@ export type SessionDelegateState = {
|
|
|
39
39
|
small?: ModelRef;
|
|
40
40
|
medium?: ModelRef;
|
|
41
41
|
large?: ModelRef;
|
|
42
|
-
// Null explicitly disables a global
|
|
42
|
+
// Null explicitly disables a global Visual Design role for this session branch.
|
|
43
43
|
uiDesign?: ModelRef | null;
|
|
44
44
|
};
|
|
45
45
|
|