@tangle-network/agent-interface 0.16.0 → 0.17.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.
|
@@ -43,7 +43,8 @@ export declare function snapModelToHarness(harness: HarnessType, modelId: string
|
|
|
43
43
|
* `opencode` for everything else.
|
|
44
44
|
*/
|
|
45
45
|
export declare function snapHarnessToModel(harness: HarnessType, modelId: string): HarnessType;
|
|
46
|
-
/** The reasoning efforts a harness can express, independent of model —
|
|
46
|
+
/** The reasoning efforts a harness can express, independent of model — its explicit override set, or
|
|
47
|
+
* `none` up to its ceiling (default `ultracode` for router/model-driven harnesses). */
|
|
47
48
|
export declare function harnessReasoningEfforts(harness: HarnessType): readonly ReasoningEffort[];
|
|
48
49
|
/** What the caller knows about a model's own reasoning capability (from a model catalog). */
|
|
49
50
|
export interface ModelReasoningCapability {
|
|
@@ -122,22 +122,43 @@ export function snapHarnessToModel(harness, modelId) {
|
|
|
122
122
|
}
|
|
123
123
|
// ── Reasoning-effort support ──────────────────────────────────────────────────
|
|
124
124
|
/**
|
|
125
|
-
* The
|
|
126
|
-
* in cli-bridge
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
* `
|
|
125
|
+
* The explicit reasoning-effort set a harness's runtime accepts when it ISN'T a plain `none…ceiling`
|
|
126
|
+
* slice — grounded in the cli-bridge adapters (NOT the canonical ladder):
|
|
127
|
+
* - codex: `model_reasoning_effort` accepts `minimal|low|medium|high` (xhigh/ultracode clamp down);
|
|
128
|
+
* it has no real `none` (the flag is just omitted), so `none` is dropped — `auto` covers "default".
|
|
129
|
+
* - claude-code: `--effort` accepts `low|medium|high|xhigh|max`. `ultracode` is the ladder's stand-in
|
|
130
|
+
* for claude's `max` (clamped at runtime); `minimal`→`low` and `none`/`auto`→no flag, so both are
|
|
131
|
+
* dropped as redundant.
|
|
132
|
+
* - pi / openclaw: `--thinking` accepts `minimal…xhigh` (max/ultracode clamp to `xhigh`; no `none`).
|
|
133
|
+
* - kimi-code: `--thinking` is BINARY (off/on) — `minimal` is the only value that emits
|
|
134
|
+
* `--no-thinking`, `high` is "thinking on". So two levels, not five.
|
|
135
|
+
*/
|
|
136
|
+
const harnessReasoningEffortsOverride = {
|
|
137
|
+
codex: ["minimal", "low", "medium", "high"],
|
|
138
|
+
"claude-code": ["low", "medium", "high", "xhigh", "ultracode"],
|
|
139
|
+
pi: ["minimal", "low", "medium", "high", "xhigh"],
|
|
140
|
+
openclaw: ["minimal", "low", "medium", "high", "xhigh"],
|
|
141
|
+
"kimi-code": ["minimal", "high"],
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* The ceiling for harnesses whose set IS a plain `none…ceiling` slice. Only the no-thinking runners
|
|
145
|
+
* need an entry (`cli-base` has no agent; `nanoclaw` sends no thinking flag). Harnesses with a
|
|
146
|
+
* provider-clamped or non-contiguous set live in {@link harnessReasoningEffortsOverride}; router /
|
|
147
|
+
* model-driven harnesses (opencode, gemini, …) have no entry → default to the full ladder, narrowed
|
|
148
|
+
* by the model's own capability.
|
|
130
149
|
*/
|
|
131
150
|
const harnessReasoningCeiling = {
|
|
132
151
|
"cli-base": "none",
|
|
133
|
-
codex: "high",
|
|
134
|
-
"kimi-code": "high",
|
|
135
|
-
"claude-code": "ultracode",
|
|
136
152
|
nanoclaw: "none",
|
|
137
153
|
};
|
|
138
|
-
/** The reasoning efforts a harness can express, independent of model —
|
|
154
|
+
/** The reasoning efforts a harness can express, independent of model — its explicit override set, or
|
|
155
|
+
* `none` up to its ceiling (default `ultracode` for router/model-driven harnesses). */
|
|
139
156
|
export function harnessReasoningEfforts(harness) {
|
|
140
|
-
const
|
|
157
|
+
const canonical = canonicalizeHarness(harness);
|
|
158
|
+
const override = harnessReasoningEffortsOverride[canonical];
|
|
159
|
+
if (override)
|
|
160
|
+
return override;
|
|
161
|
+
const ceiling = harnessReasoningCeiling[canonical] ?? "ultracode";
|
|
141
162
|
return reasoningLadder.slice(0, reasoningLadder.indexOf(ceiling) + 1);
|
|
142
163
|
}
|
|
143
164
|
/**
|
|
@@ -164,8 +185,8 @@ export function reasoningEffortsFor(harness, model) {
|
|
|
164
185
|
*
|
|
165
186
|
* - model dropped: `amp` (own agent picks the model), `openclaw` (dispatcher routes by its own
|
|
166
187
|
* config), `nanoclaw` (socket-bridge runner is config/env-driven).
|
|
167
|
-
* - effort dropped: `amp
|
|
168
|
-
* the underlying CLI).
|
|
188
|
+
* - effort dropped: `amp`, `factory-droids`, `hermes`, `nanoclaw`, and `acp` (no thinking flag is
|
|
189
|
+
* plumbed to the underlying CLI — the runner reads no `reasoningEffort`).
|
|
169
190
|
*
|
|
170
191
|
* This is distinct from {@link reasoningEffortsFor} (which levels a harness can EXPRESS): a picker uses
|
|
171
192
|
* these to trim or mark harnesses up front, so a user's model/effort choice is never silently ignored.
|
|
@@ -180,6 +201,7 @@ const harnessIgnoresEffort = new Set([
|
|
|
180
201
|
"factory-droids",
|
|
181
202
|
"hermes",
|
|
182
203
|
"nanoclaw",
|
|
204
|
+
"acp",
|
|
183
205
|
]);
|
|
184
206
|
/** Whether the harness's runner honors a per-turn MODEL override (vs. picking the model itself). */
|
|
185
207
|
export function harnessHonorsModel(harness) {
|