delegation-layer 0.1.6 → 0.1.8
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 +7 -3
- package/package.json +1 -1
- package/skills/agent-integration/SKILL.md +38 -16
- package/skills/agent-integration/evals/evals.json +20 -0
- package/skills/agent-integration/examples/read-only-task.md +1 -1
- package/skills/agent-integration/examples/workspace-write-task.md +5 -3
- package/skills/agent-integration/references/command-reference.md +1 -1
- package/skills/agent-integration/references/continuation.md +4 -0
- package/skills/agent-integration/references/result-handling.md +9 -6
package/README.md
CHANGED
|
@@ -115,7 +115,11 @@ stopped. An explicit `--pueue-config` or
|
|
|
115
115
|
`DELEGATE_PUEUE_CONFIG` can still select an existing compatible supervisor for
|
|
116
116
|
advanced integrations. Node.js 18 or newer is needed only for the npm-based
|
|
117
117
|
installers; it is not a runtime requirement for the released Go CLI. Provider
|
|
118
|
-
authentication remains native to each provider.
|
|
118
|
+
authentication remains native to each provider. Your provider settings, MCP
|
|
119
|
+
servers, plugins, and skills stay with that provider. Permission modes select
|
|
120
|
+
native behavior; Delegation Layer is not an independent sandbox. Authorized
|
|
121
|
+
`workspace-write` tasks run unattended using native approval behavior, including
|
|
122
|
+
Pi file edits and shell commands. Native access can extend beyond the workspace.
|
|
119
123
|
|
|
120
124
|
## Try one bounded task
|
|
121
125
|
|
|
@@ -138,8 +142,8 @@ The response contains a task ID and separate admission, liveness, and
|
|
|
138
142
|
publication fields. Observe and collect it with:
|
|
139
143
|
|
|
140
144
|
```sh
|
|
141
|
-
delegate status TASK_ID --json
|
|
142
|
-
delegate collect TASK_ID --watch 5s --json
|
|
145
|
+
delegate --root "$HOME/delegation-state" status TASK_ID --json
|
|
146
|
+
delegate --root "$HOME/delegation-state" collect TASK_ID --watch 5s --json
|
|
143
147
|
```
|
|
144
148
|
|
|
145
149
|
Use `delegate providers --json` for the compiled provider catalog and
|
package/package.json
CHANGED
|
@@ -16,7 +16,7 @@ inspect, authenticate, or install a provider CLI directly.
|
|
|
16
16
|
2. Use `dispatch --auto` unless the user explicitly selected a provider ID.
|
|
17
17
|
Provider selection, executable checks, compatibility checks, authentication
|
|
18
18
|
gates, and supervisor admission belong inside Delegation Layer.
|
|
19
|
-
3. Give every turn an absolute workspace, a separate state root,
|
|
19
|
+
3. Give every turn an absolute workspace, a separate state root, an explicit
|
|
20
20
|
permission mode, and a finite budget.
|
|
21
21
|
4. Use `--json` and save the returned `task_id`. Read `admission`, `liveness`,
|
|
22
22
|
`publication`, `status`, `outcome`, `continuation`, and `error` as separate
|
|
@@ -31,6 +31,10 @@ inspect, authenticate, or install a provider CLI directly.
|
|
|
31
31
|
successful, or failed provider behavior, and do not invent login commands.
|
|
32
32
|
8. Never put credentials, tokens, or unrestricted provider output in a brief,
|
|
33
33
|
option, receipt, or agent message.
|
|
34
|
+
9. Permission modes select provider-native behavior, not an independent sandbox.
|
|
35
|
+
Providers load their own configuration and extensions. If a task is rejected,
|
|
36
|
+
report delegate's evidence; do not assume the user's configuration is faulty
|
|
37
|
+
or remove MCP servers, plugins, settings, or credentials to make it pass.
|
|
34
38
|
|
|
35
39
|
## Operating procedure
|
|
36
40
|
|
|
@@ -42,8 +46,9 @@ Run a quick local check:
|
|
|
42
46
|
command -v delegate && delegate --version
|
|
43
47
|
```
|
|
44
48
|
|
|
45
|
-
If
|
|
46
|
-
|
|
49
|
+
If discovery fails, report that Delegation Layer is missing. If the version
|
|
50
|
+
command fails, report that the installed CLI is unusable. Stop in either case.
|
|
51
|
+
Do not substitute a provider command.
|
|
47
52
|
|
|
48
53
|
### 2. Discover only when useful
|
|
49
54
|
|
|
@@ -59,11 +64,14 @@ ready. If the caller named one provider ID and wants a side-effect-free check,
|
|
|
59
64
|
run:
|
|
60
65
|
|
|
61
66
|
```sh
|
|
62
|
-
delegate preflight --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE
|
|
67
|
+
delegate preflight --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE \
|
|
68
|
+
--permission REQUESTED_MODE --json
|
|
63
69
|
```
|
|
64
70
|
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
Replace `REQUESTED_MODE` with `read-only` for investigation or
|
|
72
|
+
`workspace-write` for authorized edits. Preflight reports static admission only.
|
|
73
|
+
It does not create a task, start the supervisor, or launch a provider. Do not keep
|
|
74
|
+
retrying preflight when it says
|
|
67
75
|
`blocked` or `unsupported`; report the bounded reason.
|
|
68
76
|
|
|
69
77
|
### 3. Prepare separate paths and a finite brief
|
|
@@ -73,7 +81,7 @@ brief file that contains the requested work and its acceptance criteria. Keep
|
|
|
73
81
|
the state root outside the workspace:
|
|
74
82
|
|
|
75
83
|
```sh
|
|
76
|
-
STATE_ROOT="${DELEGATE_ROOT:-$HOME
|
|
84
|
+
STATE_ROOT="${DELEGATE_ROOT:-$HOME/delegation-state}"
|
|
77
85
|
WORKSPACE="$PWD"
|
|
78
86
|
BRIEF="$(mktemp)"
|
|
79
87
|
cat >"$BRIEF" <<'EOF'
|
|
@@ -83,11 +91,17 @@ EOF
|
|
|
83
91
|
```
|
|
84
92
|
|
|
85
93
|
Replace the example brief with the actual user request. Do not place the state
|
|
86
|
-
root inside the workspace or place secrets in either path’s task data.
|
|
94
|
+
root inside the workspace or place secrets in either path’s task data. Keep it
|
|
95
|
+
outside provider configuration and runtime directories as well. If delegate
|
|
96
|
+
rejects placement before admission, choose a separate state directory; do not
|
|
97
|
+
change provider settings. Once admitted, retain that state root for every
|
|
98
|
+
observation and continuation.
|
|
87
99
|
|
|
88
100
|
### 4. Dispatch one bounded turn
|
|
89
101
|
|
|
90
|
-
Use automatic selection unless the user explicitly supplied `PROVIDER_ID
|
|
102
|
+
Use automatic selection unless the user explicitly supplied `PROVIDER_ID`.
|
|
103
|
+
For a named provider, replace `--auto` with `--provider PROVIDER_ID`; never
|
|
104
|
+
combine the two:
|
|
91
105
|
|
|
92
106
|
```sh
|
|
93
107
|
delegate --root "$STATE_ROOT" dispatch --auto \
|
|
@@ -98,8 +112,11 @@ delegate --root "$STATE_ROOT" dispatch --auto \
|
|
|
98
112
|
--json
|
|
99
113
|
```
|
|
100
114
|
|
|
101
|
-
For an authorized code change, use `--permission workspace-write
|
|
102
|
-
|
|
115
|
+
For an authorized code change, use `--permission workspace-write`; this requests
|
|
116
|
+
unattended native tool execution, including shell commands and file edits.
|
|
117
|
+
The provider may allow access beyond the selected workspace. Delegate supplies
|
|
118
|
+
the native approval options; do not add provider flags or call its CLI yourself.
|
|
119
|
+
Keep the budget finite. A successful dispatch means the request was durably admitted;
|
|
103
120
|
it does not mean the delegated work finished.
|
|
104
121
|
|
|
105
122
|
Save the exact `task_id` from the JSON response. If dispatch returns an error,
|
|
@@ -117,8 +134,10 @@ delegate --root "$STATE_ROOT" status TASK_ID --json
|
|
|
117
134
|
delegate --root "$STATE_ROOT" collect TASK_ID --watch 5s --json
|
|
118
135
|
```
|
|
119
136
|
|
|
120
|
-
|
|
121
|
-
|
|
137
|
+
Check `status` first: if it is `timed_out`, follow step 6 even when publication
|
|
138
|
+
is pending and no outcome is present. Otherwise, if `collect` exits with code
|
|
139
|
+
`3` because publication is still pending, wait a short interval and run
|
|
140
|
+
`collect` again. Do not dispatch again. Continue until
|
|
122
141
|
the response has a terminal `outcome` or a bounded operational error that
|
|
123
142
|
requires the caller’s attention.
|
|
124
143
|
|
|
@@ -156,8 +175,10 @@ delegate --root "$STATE_ROOT" continue \
|
|
|
156
175
|
--json
|
|
157
176
|
```
|
|
158
177
|
|
|
159
|
-
The command preserves the exact provider session and
|
|
160
|
-
|
|
178
|
+
The command preserves the exact provider session and permission mode and
|
|
179
|
+
creates a new task ID. Do not add `--permission` to `continue`. Always include
|
|
180
|
+
the original `--root`, even if a returned command hint omits it. Observe and
|
|
181
|
+
collect the successor by repeating step 5. If `resumable` is
|
|
161
182
|
false, report the reason and stop; a fresh dispatch would lose the original
|
|
162
183
|
conversation and is not an equivalent recovery.
|
|
163
184
|
|
|
@@ -176,7 +197,8 @@ The adapter’s required flags and runtime behavior decide compatibility.
|
|
|
176
197
|
|
|
177
198
|
Authentication is a separate live gate. `live_acceptance.status` values are
|
|
178
199
|
`not_run`, `passed`, or `blocked`; a blocked authentication prerequisite is
|
|
179
|
-
neutral evidence and must not be relabeled.
|
|
200
|
+
neutral evidence and must not be relabeled. Report the missing authentication
|
|
201
|
+
prerequisite and stop that attempt; do not retry or authenticate the provider.
|
|
180
202
|
|
|
181
203
|
The task response separates:
|
|
182
204
|
|
|
@@ -26,6 +26,26 @@
|
|
|
26
26
|
"name": "provider-neutrality",
|
|
27
27
|
"prompt": "Use the skill without a provider name.",
|
|
28
28
|
"expected": ["delegate only", "dispatch --auto", "no direct provider CLI"]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"name": "pi-write",
|
|
32
|
+
"prompt": "Use pi:json through delegate to update a file and run its tests. Edits are authorized.",
|
|
33
|
+
"expected": ["--provider pi:json", "--permission workspace-write", "delegate only", "save task_id", "collect validated evidence"]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"name": "write-permission-denial",
|
|
37
|
+
"prompt": "An admitted workspace-write task reports a native tool permission denial.",
|
|
38
|
+
"expected": ["report task evidence", "do not edit provider configuration", "do not call provider CLI", "no automatic redispatch"]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "unavailable-provider",
|
|
42
|
+
"prompt": "The selected provider is unavailable before admission.",
|
|
43
|
+
"expected": ["report bounded reason", "do not install or authenticate provider", "do not claim success"]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "write-timeout",
|
|
47
|
+
"prompt": "An authorized write task has status timed_out, publication unknown, no outcome, and continuation.resumable true.",
|
|
48
|
+
"expected": ["delegate continue --task", "same state root", "new task id", "do not wait indefinitely for an outcome", "no fresh unrelated dispatch"]
|
|
29
49
|
}
|
|
30
50
|
]
|
|
31
51
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Read-only task
|
|
2
2
|
|
|
3
3
|
```sh
|
|
4
|
-
STATE_ROOT="${DELEGATE_ROOT:-$HOME
|
|
4
|
+
STATE_ROOT="${DELEGATE_ROOT:-$HOME/delegation-state}"
|
|
5
5
|
BRIEF="$(mktemp)"
|
|
6
6
|
printf '%s\n' 'Inspect the workspace and summarize the current test failures. Do not edit files.' >"$BRIEF"
|
|
7
7
|
delegate --root "$STATE_ROOT" dispatch --auto \
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# Authorized workspace write task
|
|
2
2
|
|
|
3
3
|
```sh
|
|
4
|
-
STATE_ROOT="${DELEGATE_ROOT:-$HOME
|
|
4
|
+
STATE_ROOT="${DELEGATE_ROOT:-$HOME/delegation-state}"
|
|
5
5
|
delegate --root "$STATE_ROOT" dispatch --auto \
|
|
6
6
|
--brief "$PWD/delegated-task.md" --cwd "$PWD" \
|
|
7
7
|
--permission workspace-write --budget 30m --json
|
|
8
8
|
```
|
|
9
9
|
|
|
10
10
|
Use `workspace-write` only when the caller authorized edits in the selected
|
|
11
|
-
workspace.
|
|
12
|
-
|
|
11
|
+
workspace. Delegate requests unattended native approval for commands and edits.
|
|
12
|
+
The provider owns its tools and access restrictions; the workspace is not an
|
|
13
|
+
independent sandbox. Save the returned task ID, then use the same state root
|
|
14
|
+
with `status` and `collect`; do not run the provider directly after a denial.
|
|
@@ -24,7 +24,7 @@ Dispatch flags:
|
|
|
24
24
|
|
|
25
25
|
- `--brief FILE`: bounded task instructions;
|
|
26
26
|
- `--cwd ABS`: workspace for the delegated turn;
|
|
27
|
-
- `--permission read-only|workspace-write`:
|
|
27
|
+
- `--permission read-only|workspace-write`: read-only investigation or authorized unattended write execution, including commands (not independent containment);
|
|
28
28
|
- `--budget DURATION`: finite turn budget;
|
|
29
29
|
- `--auto`: let the CLI select a ready provider;
|
|
30
30
|
- `--provider ID`: use only when the caller explicitly selected an ID;
|
|
@@ -24,6 +24,10 @@ delegate --root "$STATE_ROOT" continue \
|
|
|
24
24
|
--json
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
A timed-out turn can have `publication: "unknown"` and no `outcome` while
|
|
28
|
+
`continuation.resumable` is true. Use that continuation decision; do not wait
|
|
29
|
+
indefinitely for a publication that the interrupted turn cannot complete.
|
|
30
|
+
|
|
27
31
|
The follow-up brief is optional. If it is omitted, Delegation Layer reuses the
|
|
28
32
|
validated predecessor brief. A successful continuation returns a new task ID
|
|
29
33
|
and links it to the predecessor. Observe and collect the new ID separately.
|
|
@@ -4,16 +4,19 @@ Use the response fields independently. A successful control command is not
|
|
|
4
4
|
the same as a successful provider result.
|
|
5
5
|
|
|
6
6
|
1. Save `task_id` immediately after dispatch or continue.
|
|
7
|
-
2. If
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
2. If a dispatch or continue response does not confirm admission, preserve any
|
|
8
|
+
task ID and report its bounded error. An uncertain admission must be
|
|
9
|
+
inspected, never automatically dispatched again. Status and collect can
|
|
10
|
+
report `admission: "unknown"` alongside valid terminal evidence.
|
|
11
|
+
3. If `status` is `timed_out`, follow the continuation procedure before treating
|
|
12
|
+
pending publication as a reason to wait. `continuation.resumable: true`
|
|
13
|
+
permits a linked successor even when no outcome has been published.
|
|
11
14
|
4. If `publication` is committed and `outcome.verdict` is committed, return
|
|
12
15
|
the result and its payload/evidence descriptors.
|
|
13
16
|
5. If `outcome.verdict` is rejected, report a terminal rejected result with its
|
|
14
17
|
refusal and evidence. Do not retry automatically.
|
|
15
|
-
6.
|
|
16
|
-
|
|
18
|
+
6. Otherwise, if `liveness` is queued or running or publication is pending,
|
|
19
|
+
observe the same task again with a finite watch interval.
|
|
17
20
|
7. If authentication is `blocked`, preserve that neutral state and tell the
|
|
18
21
|
caller what prerequisite is unavailable without inventing a login command.
|
|
19
22
|
8. If a command reports an operational uncertainty, inspect the original task
|