delegation-layer 0.1.8 → 0.1.9

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 CHANGED
@@ -24,6 +24,8 @@ already use instead of replacing them.
24
24
  session through a linked successor task.
25
25
  - **Runtime compatibility** — the selected provider's executable and advertised
26
26
  capabilities are checked when the task is prepared.
27
+ - **Model choice when needed** — native model and effort discovery is available
28
+ without turning discovery into an admission allowlist.
27
29
  - **Native authentication** — provider login stays with the provider CLI; task
28
30
  state does not contain copied credentials.
29
31
 
@@ -153,6 +155,24 @@ checks static admission without creating a task. Dispatch still performs the
153
155
  host-specific runtime probe; catalog discovery alone does not prove
154
156
  authentication or supervisor readiness.
155
157
 
158
+ When an explicit model or effort choice is needed, query the implemented native
159
+ discovery command:
160
+
161
+ ```sh
162
+ delegate models --provider codex:exec --cwd "$HOME/delegation-workspace" --json
163
+ ```
164
+
165
+ `--cwd` defaults to the current directory. Model discovery uses the
166
+ state-rooted supervisor and a bounded `model-discovery-v1` 60-second inspection,
167
+ creates inspection evidence without admitting a provider task, and may contact
168
+ the provider CLI.
169
+ It is advisory: a discovered model is not an admission guarantee or an
170
+ allowlist. `complete` describes model enumeration. A null effort list means
171
+ unknown metadata; an empty list means the provider explicitly reported no
172
+ choices. Per-model effort metadata is independent of the harness-wide list.
173
+ Discovery exits `0` for `available` or `partial`, `2` for `blocked` or
174
+ `unavailable`, and `1` for `failed`.
175
+
156
176
  If a task reports `status: "timed_out"` and
157
177
  `continuation.resumable: true`, continue the exact session:
158
178
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delegation-layer",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Multi-provider AI agent delegation CLI and Agent Skill for running bounded coding tasks across provider CLIs.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -74,6 +74,33 @@ It does not create a task, start the supervisor, or launch a provider. Do not ke
74
74
  retrying preflight when it says
75
75
  `blocked` or `unsupported`; report the bounded reason.
76
76
 
77
+ If the caller needs an explicit model or effort, use the implemented native
78
+ discovery command for that provider:
79
+
80
+ ```sh
81
+ delegate models --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE --json
82
+ ```
83
+
84
+ Omit `--cwd` to use the current directory. Run discovery only when the caller
85
+ needs a non-default choice; provider defaults are valid. The command uses the
86
+ state-rooted supervisor and a bounded `model-discovery-v1` 60-second native
87
+ inspection, creates inspection evidence without admitting a provider task, and may contact the
88
+ provider CLI. It is advisory and never an admission allowlist. Do not reject a
89
+ requested value merely because discovery did not list it, and do not infer
90
+ per-model effort support from the harness-wide list. If a selected model has
91
+ `efforts: null` or `efforts: []`, omit `--effort` unless the caller explicitly
92
+ requested it; do not invent model aliases or combine options by guessing.
93
+
94
+ The response includes `schema_version`, `command: "models"`, `provider`,
95
+ `observed_at`, `status`, `reason_code`, `complete`, `source`, nullable
96
+ `efforts`, and model rows with exact `id` values plus optional `name`, nullable
97
+ `efforts`, and optional `default_effort`. `complete` describes model
98
+ enumeration, not effort metadata. `null` means effort metadata is unknown;
99
+ `[]` means the provider explicitly reported no choices. Discovery exits `0`
100
+ for `available` or `partial`, `2` for `blocked` or `unavailable`, and `1` for
101
+ `failed`. Preserve a blocked or unavailable discovery result as unresolved;
102
+ defaults remain allowed.
103
+
77
104
  ### 3. Prepare separate paths and a finite brief
78
105
 
79
106
  Use an existing task brief when one is supplied. Otherwise create a bounded
@@ -119,6 +146,15 @@ the native approval options; do not add provider flags or call its CLI yourself.
119
146
  Keep the budget finite. A successful dispatch means the request was durably admitted;
120
147
  it does not mean the delegated work finished.
121
148
 
149
+ When an explicit selection is supplied, pass it through the public fields:
150
+ `--model MODEL` and `--effort VALUE`. Codex encodes effort as its native TOML
151
+ `model_reasoning_effort` setting; Claude and AGY use their native effort flags;
152
+ Pi maps effort to `--thinking`; and OpenCode maps effort to `--variant`. An
153
+ omitted or `default` effort is omitted from native argv. For AGY read-only,
154
+ `--permission read-only` selects the exact native `--sandbox --mode plan` path
155
+ without a bypass. Authorized AGY workspace-write retains its existing native
156
+ bypass. Do not add these native flags yourself.
157
+
122
158
  Save the exact `task_id` from the JSON response. If dispatch returns an error,
123
159
  use its `status`, `capability`, and `error` fields to report whether the request
124
160
  was invalid, unsupported, blocked by authentication, or operationally
@@ -12,6 +12,16 @@
12
12
  "prompt": "Run one bounded task through the available agent provider.",
13
13
  "expected": ["dispatch --auto", "--json", "save task_id", "status", "collect"]
14
14
  },
15
+ {
16
+ "name": "model-discovery-when-needed",
17
+ "prompt": "The caller needs an explicit model and effort for codex:exec.",
18
+ "expected": ["delegate models --provider codex:exec", "--json", "preserve null versus empty efforts", "advisory", "pass --model and --effort"]
19
+ },
20
+ {
21
+ "name": "model-default-without-discovery",
22
+ "prompt": "Run a task without an explicit model or effort.",
23
+ "expected": ["provider defaults are valid", "do not run models unnecessarily", "dispatch --auto"]
24
+ },
15
25
  {
16
26
  "name": "timeout",
17
27
  "prompt": "The result says status timed_out and continuation.resumable is true.",
@@ -8,6 +8,7 @@ All paths passed to `--root`, `--cwd`, and `--brief` must be absolute. Add
8
8
  | `delegate --version` | Confirm the installed control CLI | No |
9
9
  | `delegate providers --json` | List compiled provider metadata | No |
10
10
  | `delegate capabilities --provider ID --json` | Read the catalog contract | No |
11
+ | `delegate models --provider ID [--cwd ABS] --json` | Discover advisory native model and effort facts | Native inspection only; no admitted task |
11
12
  | `delegate preflight --provider ID --cwd ABS --json` | Check static provider admission | No |
12
13
  | `delegate dispatch --auto ... --json` | Select and admit one bounded turn | Yes, at most once |
13
14
  | `delegate status TASK --json` | Reconcile and observe task state | No provider launch |
@@ -29,8 +30,19 @@ Dispatch flags:
29
30
  - `--auto`: let the CLI select a ready provider;
30
31
  - `--provider ID`: use only when the caller explicitly selected an ID;
31
32
  - `--model MODEL` and `--effort VALUE`: optional provider-advertised choices;
33
+ Codex maps effort to TOML `model_reasoning_effort`, while Claude and AGY
34
+ pass native effort flags; Pi maps effort to `--thinking`; OpenCode maps it to
35
+ `--variant`; `default` is omitted;
32
36
  - `--native-timeout DURATION`: optional provider-native timeout where advertised.
33
37
 
38
+ Model discovery uses the same `--provider ID` profiles and accepts an optional
39
+ absolute `--cwd` (default: current directory). Its JSON has `status` values
40
+ `available`, `partial`, `blocked`, `unavailable`, or `failed`; exits are `0`,
41
+ `0`, `2`, `2`, and `1` respectively. `complete` describes model enumeration.
42
+ Top-level or per-model `efforts: null` means unknown, while `[]` means no
43
+ choices were explicitly reported. Discovery is advisory and never an admission
44
+ allowlist; defaults remain valid when it is not run.
45
+
34
46
  Continuation flags:
35
47
 
36
48
  - `--task TASK`: predecessor task ID;
@@ -23,6 +23,15 @@ the same as a successful provider result.
23
23
  with `status` and `collect` before considering any action. Never relaunch an
24
24
  uncertain task by guessing.
25
25
 
26
+ For `delegate models`, validate the complete JSON envelope before using any
27
+ fact. Treat `available` and `partial` with exit `0` as observations, preserve
28
+ `blocked` and `unavailable` with exit `2` as unresolved prerequisites, and
29
+ preserve `failed` with exit `1` as a discovery failure. `complete` refers to
30
+ model enumeration. Keep `efforts: null` distinct from `efforts: []`, and do not
31
+ apply harness-wide effort choices to every model. Discovery is advisory and
32
+ never an admission allowlist; a provider default remains valid and a listed
33
+ model is not an execution guarantee.
34
+
26
35
  Exit codes are bounded control signals: `0` is a completed command, `1` is an
27
36
  operational error, `2` is an invalid or unsupported request, `3` is a pending
28
37
  collection watch, and `4` is a validated rejected outcome.