@dzhechkov/harness-core 0.3.98 → 0.3.100
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/LICENSE +21 -0
- package/dist/feature-adr-routing.d.ts +9 -0
- package/dist/feature-adr-routing.d.ts.map +1 -1
- package/dist/feature-adr-routing.js +21 -1
- package/dist/feature-adr-routing.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/usage.d.ts +88 -35
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +322 -86
- package/dist/usage.js.map +1 -1
- package/package.json +18 -18
- package/src/feature-adr-routing.ts +23 -1
- package/src/index.ts +24 -2
- package/src/usage.ts +421 -93
|
@@ -189,6 +189,9 @@ export const KNOWN_CODEX: Record<string, number> = { auto: 1, 'gpt-5.5': 1, 'gpt
|
|
|
189
189
|
/** The Claude model names the Workflow runtime accepts as `agent()` `model`. */
|
|
190
190
|
export const CLAUDE_NAMES: Record<string, number> = { fable: 1, opus: 1, sonnet: 1, haiku: 1 };
|
|
191
191
|
|
|
192
|
+
/** The codex-companion `--effort` vocabulary; a spec's `<reasoning>` is clamped to this (unknown ⇒ 'high'). */
|
|
193
|
+
export const VALID_REASONING: Record<string, number> = { none: 1, minimal: 1, low: 1, medium: 1, high: 1, xhigh: 1 };
|
|
194
|
+
|
|
192
195
|
/**
|
|
193
196
|
* The proven DEFAULT TABLE, applied only when the user opts into routing.
|
|
194
197
|
* `code`/`qe` are `null` SENTINELS: their defaults are DERIVED (the coder knob /
|
|
@@ -228,7 +231,13 @@ export function specToOpts(spec: string | null | undefined, env: RoutingEnv): St
|
|
|
228
231
|
log('models: unknown codex id ' + id + ' — using ' + env.CODEX_MODEL);
|
|
229
232
|
id = env.CODEX_MODEL;
|
|
230
233
|
}
|
|
231
|
-
|
|
234
|
+
let reasoning = parts[2] || 'high';
|
|
235
|
+
// Clamp to the codex-companion --effort vocabulary so a bad token (e.g. `codex:gpt-5.6:banana`)
|
|
236
|
+
// can't silently reach the runtime as `--effort banana` (QE LOW). Unknown ⇒ 'high'.
|
|
237
|
+
if (!VALID_REASONING[reasoning]) {
|
|
238
|
+
log('models: unknown reasoning ' + reasoning + ' — using high');
|
|
239
|
+
reasoning = 'high';
|
|
240
|
+
}
|
|
232
241
|
return { agentType: 'codex:codex-rescue', codexModel: id, _reasoning: reasoning };
|
|
233
242
|
}
|
|
234
243
|
if (CLAUDE_NAMES[head]) return { model: head };
|
|
@@ -350,6 +359,19 @@ export function needsLandedBarrier(opts: StageOpts | null | undefined): boolean
|
|
|
350
359
|
return !!(opts && opts.agentType === 'codex:codex-rescue');
|
|
351
360
|
}
|
|
352
361
|
|
|
362
|
+
/**
|
|
363
|
+
* The per-call Codex effort hint. Codex-rescue maps this prompt instruction to
|
|
364
|
+
* `codex-companion.mjs task --effort <reasoning>`, so the resolved per-stage `_reasoning`
|
|
365
|
+
* is no longer only a `modelsUsed` label. Non-Codex stages return an empty string, preserving
|
|
366
|
+
* the routing-off and Claude-stage prompt text exactly.
|
|
367
|
+
*/
|
|
368
|
+
export function codexEffortHint(opts: StageOpts | null | undefined): string {
|
|
369
|
+
if (opts && opts.agentType === 'codex:codex-rescue' && opts._reasoning) {
|
|
370
|
+
return ' (If you are the Codex runtime, run at --effort ' + opts._reasoning + '.)';
|
|
371
|
+
}
|
|
372
|
+
return '';
|
|
373
|
+
}
|
|
374
|
+
|
|
353
375
|
// ── Step-7.5 CODE landed barrier (Codex out-of-band write flush) ────────────
|
|
354
376
|
|
|
355
377
|
export const DEFAULT_CODE_LANDING_MAX_WAIT_MS = 120_000;
|
package/src/index.ts
CHANGED
|
@@ -184,10 +184,12 @@ export {
|
|
|
184
184
|
DEFAULT_MODELS,
|
|
185
185
|
KNOWN_CODEX,
|
|
186
186
|
CLAUDE_NAMES,
|
|
187
|
+
VALID_REASONING,
|
|
187
188
|
topCodexId,
|
|
188
189
|
decideUsageAction,
|
|
189
190
|
OVERRIDE_REASONING,
|
|
190
191
|
needsLandedBarrier,
|
|
192
|
+
codexEffortHint,
|
|
191
193
|
modelLabel,
|
|
192
194
|
stageLabel,
|
|
193
195
|
needsCodeLandedBarrier,
|
|
@@ -196,5 +198,25 @@ export {
|
|
|
196
198
|
CODE_LANDED_BARRIER_SLEEPS_SECONDS,
|
|
197
199
|
} from './feature-adr-routing.js';
|
|
198
200
|
export type { StageOpts, RoutingEnv, UsageSignal, UsageAction } from './feature-adr-routing.js';
|
|
199
|
-
export {
|
|
200
|
-
|
|
201
|
+
export {
|
|
202
|
+
CLAUDE_USAGE_MODELS,
|
|
203
|
+
computeUsage,
|
|
204
|
+
deriveUsageCalibration,
|
|
205
|
+
fixedBlockWindowFor,
|
|
206
|
+
normalizeClaudeUsageModel,
|
|
207
|
+
normalizeClaudeUsageModelKey,
|
|
208
|
+
parseWeeklyResetAnchor,
|
|
209
|
+
readUsageLimits,
|
|
210
|
+
weeklyWindowFor,
|
|
211
|
+
} from './usage.js';
|
|
212
|
+
export type {
|
|
213
|
+
ClaudeUsageModel,
|
|
214
|
+
UsageCalibrationChange,
|
|
215
|
+
UsageCalibrationInput,
|
|
216
|
+
UsageCalibrationPlan,
|
|
217
|
+
UsageEstimate,
|
|
218
|
+
UsageLimits,
|
|
219
|
+
UsageModelEstimate,
|
|
220
|
+
UsageWindow,
|
|
221
|
+
WeeklyResetAnchor,
|
|
222
|
+
} from './usage.js';
|