@open-agent-toolkit/cli 0.1.11 → 0.1.12
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/assets/docs/cli-utilities/configuration.md +66 -11
- package/assets/docs/reference/oat-directory-structure.md +22 -21
- package/assets/docs/workflows/projects/dispatch-ceiling.md +123 -0
- package/assets/docs/workflows/projects/implementation-execution.md +27 -9
- package/assets/docs/workflows/projects/index.md +1 -0
- package/assets/docs/workflows/projects/lifecycle.md +1 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +125 -31
- package/assets/skills/oat-project-plan/SKILL.md +28 -28
- package/assets/skills/oat-project-quick-start/SKILL.md +28 -27
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +53 -13
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +126 -28
- package/dist/config/dispatch-ceiling-preset.d.ts +54 -0
- package/dist/config/dispatch-ceiling-preset.d.ts.map +1 -0
- package/dist/config/dispatch-ceiling-preset.js +32 -0
- package/dist/config/oat-config.d.ts +9 -2
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +22 -15
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +5 -2
- package/dist/providers/ceiling/registry.d.ts +53 -0
- package/dist/providers/ceiling/registry.d.ts.map +1 -0
- package/dist/providers/ceiling/registry.js +77 -0
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ import { resolveActiveProject, } from '../../../config/oat-config.js';
|
|
|
7
7
|
import { resolveEffectiveConfig, } from '../../../config/resolve.js';
|
|
8
8
|
import { resolveProjectRoot } from '../../../fs/paths.js';
|
|
9
9
|
import TOML from '@iarna/toml';
|
|
10
|
+
import { getCeilingAdapter, } from '../../../providers/ceiling/registry.js';
|
|
10
11
|
import { Command } from 'commander';
|
|
11
12
|
import YAML from 'yaml';
|
|
12
13
|
const CODEX_VALUES = [
|
|
@@ -38,18 +39,26 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
38
39
|
processEnv: process.env,
|
|
39
40
|
};
|
|
40
41
|
function normalizeProvider(value) {
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
// Provider-neutral: accept any provider name. Unknown providers do not throw;
|
|
43
|
+
// they resolve through the fallback advisory adapter as `mode: unsupported`.
|
|
44
|
+
const normalized = value?.trim();
|
|
45
|
+
if (!normalized) {
|
|
46
|
+
throw new Error('Provider is required.');
|
|
43
47
|
}
|
|
44
|
-
|
|
48
|
+
return normalized;
|
|
45
49
|
}
|
|
46
50
|
function isValidProviderValue(provider, value) {
|
|
51
|
+
// Typed concrete-value validation only applies to providers with a value
|
|
52
|
+
// enum. Unknown providers have no concrete ceiling value (always advisory).
|
|
47
53
|
if (provider === 'codex') {
|
|
48
54
|
return (typeof value === 'string' &&
|
|
49
55
|
CODEX_VALUES.includes(value));
|
|
50
56
|
}
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
if (provider === 'claude') {
|
|
58
|
+
return (typeof value === 'string' &&
|
|
59
|
+
CLAUDE_VALUES.includes(value));
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
53
62
|
}
|
|
54
63
|
function configSourceToCeilingSource(source) {
|
|
55
64
|
if (source === 'local') {
|
|
@@ -83,7 +92,14 @@ function sourceLabel(source) {
|
|
|
83
92
|
}
|
|
84
93
|
}
|
|
85
94
|
function providerLabel(provider) {
|
|
86
|
-
|
|
95
|
+
if (provider === 'codex') {
|
|
96
|
+
return 'Codex';
|
|
97
|
+
}
|
|
98
|
+
if (provider === 'claude') {
|
|
99
|
+
return 'Claude';
|
|
100
|
+
}
|
|
101
|
+
// Unknown providers: title-case the raw name for human-readable output.
|
|
102
|
+
return provider.charAt(0).toUpperCase() + provider.slice(1);
|
|
87
103
|
}
|
|
88
104
|
function resolveTargetProjectPath(repoRoot, projectPath) {
|
|
89
105
|
return isAbsolute(projectPath) ? projectPath : join(repoRoot, projectPath);
|
|
@@ -102,11 +118,21 @@ function readProjectDispatchCeiling(provider, content) {
|
|
|
102
118
|
return null;
|
|
103
119
|
}
|
|
104
120
|
const ceilingRecord = ceiling;
|
|
105
|
-
|
|
121
|
+
// Clean break: read concrete per-provider values only. The preset label is
|
|
122
|
+
// provenance and is never used to drive dispatch.
|
|
123
|
+
const providers = ceilingRecord['providers'];
|
|
124
|
+
if (!providers || typeof providers !== 'object' || Array.isArray(providers)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
const value = providers[provider];
|
|
128
|
+
if (!isValidProviderValue(provider, value)) {
|
|
106
129
|
return null;
|
|
107
130
|
}
|
|
108
|
-
const
|
|
109
|
-
return
|
|
131
|
+
const presetValue = ceilingRecord['preset'];
|
|
132
|
+
return {
|
|
133
|
+
value,
|
|
134
|
+
preset: typeof presetValue === 'string' ? presetValue : null,
|
|
135
|
+
};
|
|
110
136
|
}
|
|
111
137
|
async function resolveProjectStateCeiling(provider, projectPath, dependencies) {
|
|
112
138
|
if (!projectPath) {
|
|
@@ -131,7 +157,10 @@ async function resolveProjectPath(repoRoot, dependencies, options) {
|
|
|
131
157
|
return join(repoRoot, activeProject.path);
|
|
132
158
|
}
|
|
133
159
|
function readResolvedConfigCeiling(provider, resolvedConfig) {
|
|
134
|
-
|
|
160
|
+
// Read the concrete per-provider value from the nested key. The flat
|
|
161
|
+
// `workflow.dispatchCeiling.<provider>` shape was removed in p01; never read
|
|
162
|
+
// the preset label for dispatch.
|
|
163
|
+
const entry = resolvedConfig.resolved[`workflow.dispatchCeiling.providers.${provider}`];
|
|
135
164
|
const source = entry ? configSourceToCeilingSource(entry.source) : null;
|
|
136
165
|
if (!entry || !source || !isValidProviderValue(provider, entry.value)) {
|
|
137
166
|
return null;
|
|
@@ -141,6 +170,46 @@ function readResolvedConfigCeiling(provider, resolvedConfig) {
|
|
|
141
170
|
source,
|
|
142
171
|
};
|
|
143
172
|
}
|
|
173
|
+
function normalizeRole(value) {
|
|
174
|
+
return value === 'reviewer' ? 'reviewer' : 'implementer';
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Join a resolved ceiling value with the active provider's adapter to compute
|
|
178
|
+
* the enforcement mode, mechanism, dispatch args, and verify-on-upgrade flag.
|
|
179
|
+
* Mode is computed here at call time — it is never read from persisted state.
|
|
180
|
+
*/
|
|
181
|
+
function buildProviderResolution(provider, value, role, orchestratorTier) {
|
|
182
|
+
const adapter = getCeilingAdapter(provider);
|
|
183
|
+
if (value === null) {
|
|
184
|
+
return {
|
|
185
|
+
value: null,
|
|
186
|
+
mode: adapter.supportsCeiling ? 'advisory' : 'unsupported',
|
|
187
|
+
mechanism: adapter.mechanism,
|
|
188
|
+
dispatchArgs: null,
|
|
189
|
+
verifyOnDispatch: false,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
const dispatchArgs = adapter.compileToDispatchArgs(value, role, {
|
|
193
|
+
orchestratorTier,
|
|
194
|
+
});
|
|
195
|
+
let mode;
|
|
196
|
+
if (!adapter.supportsCeiling) {
|
|
197
|
+
mode = 'unsupported';
|
|
198
|
+
}
|
|
199
|
+
else if (dispatchArgs) {
|
|
200
|
+
mode = 'enforced';
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
mode = 'advisory';
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
value,
|
|
207
|
+
mode,
|
|
208
|
+
mechanism: adapter.mechanism,
|
|
209
|
+
dispatchArgs,
|
|
210
|
+
verifyOnDispatch: adapter.verifyOnDispatch(value, { orchestratorTier }),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
144
213
|
function readCodexDefaultFromToml(content) {
|
|
145
214
|
let parsed;
|
|
146
215
|
try {
|
|
@@ -170,13 +239,15 @@ async function resolveCodexProviderDefaultEffort(repoRoot, context, dependencies
|
|
|
170
239
|
}
|
|
171
240
|
function blockMessage(provider) {
|
|
172
241
|
const label = providerLabel(provider);
|
|
173
|
-
return `BLOCKED: ${label} dispatch ceiling is unresolved in non-interactive mode.\nSet workflow.dispatchCeiling.${provider} in .oat/config.json or oat_dispatch_ceiling in project state.`;
|
|
242
|
+
return `BLOCKED: ${label} dispatch ceiling is unresolved in non-interactive mode.\nSet workflow.dispatchCeiling.providers.${provider} in .oat/config.json or oat_dispatch_ceiling in project state.`;
|
|
174
243
|
}
|
|
175
244
|
function isNonInteractiveEnv(env) {
|
|
176
245
|
return env['OAT_NON_INTERACTIVE'] === '1';
|
|
177
246
|
}
|
|
178
247
|
async function resolveDispatchCeiling(context, dependencies, options) {
|
|
179
248
|
const provider = normalizeProvider(options.provider);
|
|
249
|
+
const role = normalizeRole(options.role);
|
|
250
|
+
const orchestratorTier = options.orchestratorTier;
|
|
180
251
|
const repoRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
181
252
|
const userConfigDir = join(context.home, '.oat');
|
|
182
253
|
const [resolvedConfig, projectPath] = await Promise.all([
|
|
@@ -186,28 +257,22 @@ async function resolveDispatchCeiling(context, dependencies, options) {
|
|
|
186
257
|
const providerDefaultEffort = provider === 'codex'
|
|
187
258
|
? await resolveCodexProviderDefaultEffort(repoRoot, context, dependencies)
|
|
188
259
|
: 'not-applicable';
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
source: configCeiling.source,
|
|
196
|
-
unresolved: false,
|
|
197
|
-
projectPath,
|
|
198
|
-
providerDefaultEffort,
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
const projectCeiling = await resolveProjectStateCeiling(provider, projectPath, dependencies);
|
|
202
|
-
if (projectCeiling) {
|
|
260
|
+
const resolvedValue = await resolveCeilingValue(provider, resolvedConfig, projectPath, dependencies);
|
|
261
|
+
const providerResolution = buildProviderResolution(provider, resolvedValue?.value ?? null, role, orchestratorTier);
|
|
262
|
+
const providers = {
|
|
263
|
+
[provider]: providerResolution,
|
|
264
|
+
};
|
|
265
|
+
if (resolvedValue) {
|
|
203
266
|
return {
|
|
204
267
|
status: 'resolved',
|
|
205
268
|
provider,
|
|
206
|
-
value:
|
|
207
|
-
source:
|
|
269
|
+
value: resolvedValue.value,
|
|
270
|
+
source: resolvedValue.source,
|
|
271
|
+
preset: resolvedValue.preset,
|
|
208
272
|
unresolved: false,
|
|
209
273
|
projectPath,
|
|
210
274
|
providerDefaultEffort,
|
|
275
|
+
providers,
|
|
211
276
|
};
|
|
212
277
|
}
|
|
213
278
|
const shouldBlock = options.nonInteractive === true ||
|
|
@@ -219,12 +284,39 @@ async function resolveDispatchCeiling(context, dependencies, options) {
|
|
|
219
284
|
provider,
|
|
220
285
|
value: null,
|
|
221
286
|
source: null,
|
|
287
|
+
preset: null,
|
|
222
288
|
unresolved: true,
|
|
223
289
|
projectPath,
|
|
224
290
|
providerDefaultEffort,
|
|
291
|
+
providers,
|
|
225
292
|
message,
|
|
226
293
|
};
|
|
227
294
|
}
|
|
295
|
+
/**
|
|
296
|
+
* Resolve the concrete per-provider ceiling value, applying config precedence
|
|
297
|
+
* (local > shared > user, via `resolveEffectiveConfig`) before project state.
|
|
298
|
+
* Never reads the preset label for dispatch — the preset is surfaced as
|
|
299
|
+
* provenance only.
|
|
300
|
+
*/
|
|
301
|
+
async function resolveCeilingValue(provider, resolvedConfig, projectPath, dependencies) {
|
|
302
|
+
const configCeiling = readResolvedConfigCeiling(provider, resolvedConfig);
|
|
303
|
+
if (configCeiling) {
|
|
304
|
+
return {
|
|
305
|
+
value: configCeiling.value,
|
|
306
|
+
source: configCeiling.source,
|
|
307
|
+
preset: null,
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
const projectCeiling = await resolveProjectStateCeiling(provider, projectPath, dependencies);
|
|
311
|
+
if (projectCeiling) {
|
|
312
|
+
return {
|
|
313
|
+
value: projectCeiling.value,
|
|
314
|
+
source: 'project-state',
|
|
315
|
+
preset: projectCeiling.preset,
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
228
320
|
function writeHumanResolution(context, resolution) {
|
|
229
321
|
const label = providerLabel(resolution.provider);
|
|
230
322
|
if (resolution.status === 'blocked' && resolution.message) {
|
|
@@ -233,6 +325,10 @@ function writeHumanResolution(context, resolution) {
|
|
|
233
325
|
}
|
|
234
326
|
context.logger.info(`${label} dispatch ceiling: ${resolution.value ?? 'unresolved'}`);
|
|
235
327
|
context.logger.info(`Source: ${sourceLabel(resolution.source)}`);
|
|
328
|
+
const providerResolution = resolution.providers[resolution.provider];
|
|
329
|
+
if (providerResolution) {
|
|
330
|
+
context.logger.info(`Mode: ${providerResolution.mode} (${providerResolution.mechanism})`);
|
|
331
|
+
}
|
|
236
332
|
if (resolution.provider === 'codex') {
|
|
237
333
|
context.logger.info(`Codex provider default effort: ${resolution.providerDefaultEffort}`);
|
|
238
334
|
context.logger.info(`Note: OAT will use pinned subagent variants up to ${resolution.value ?? 'the resolved ceiling'}. Base/unpinned roles resolve through the provider default.`);
|
|
@@ -271,7 +367,9 @@ export function createProjectDispatchCeilingCommand(overrides = {}) {
|
|
|
271
367
|
const command = new Command('dispatch-ceiling').description('Resolve OAT project dispatch ceiling metadata');
|
|
272
368
|
command.addCommand(new Command('resolve')
|
|
273
369
|
.description('Resolve dispatch ceiling for a provider')
|
|
274
|
-
.requiredOption('--provider <provider>', 'Provider: codex or claude')
|
|
370
|
+
.requiredOption('--provider <provider>', 'Provider name: codex or claude are enforced; any other provider resolves as advisory (unsupported)')
|
|
371
|
+
.option('--role <role>', 'Dispatch role for variant compilation: implementer (default) or reviewer')
|
|
372
|
+
.option('--orchestrator-tier <tier>', 'Orchestrator tier, used to flag verify-on-upgrade for above-orchestrator requests')
|
|
275
373
|
.option('--project-path <path>', 'Read project-state ceiling from an explicit project path')
|
|
276
374
|
.option('--preflight', 'Treat unresolved non-interactive resolution as an implementation block')
|
|
277
375
|
.option('--non-interactive', 'Force non-interactive block behavior when the ceiling is unresolved')
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { WorkflowClaudeDispatchCeiling, WorkflowCodexDispatchCeiling, WorkflowDispatchCeiling, WorkflowDispatchCeilingPreset } from './oat-config.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fixed mapping table: preset → concrete per-provider values.
|
|
4
|
+
* This is the single authority for preset compilation; the resolver and skills
|
|
5
|
+
* must not re-map these values.
|
|
6
|
+
*
|
|
7
|
+
* Design notes:
|
|
8
|
+
* - cost-conscious holds Claude at `sonnet` (no Haiku reviewers by default).
|
|
9
|
+
* - The table is `as const` to preserve literal types for downstream consumers.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DISPATCH_CEILING_PRESETS: {
|
|
12
|
+
readonly balanced: {
|
|
13
|
+
readonly codex: "high";
|
|
14
|
+
readonly claude: "sonnet";
|
|
15
|
+
};
|
|
16
|
+
readonly maximum: {
|
|
17
|
+
readonly codex: "xhigh";
|
|
18
|
+
readonly claude: "opus";
|
|
19
|
+
};
|
|
20
|
+
readonly 'cost-conscious': {
|
|
21
|
+
readonly codex: "medium";
|
|
22
|
+
readonly claude: "sonnet";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Result of compiling a preset selection.
|
|
27
|
+
* Both `preset` (provenance label) and `providers` (concrete values) are present.
|
|
28
|
+
*/
|
|
29
|
+
export interface PresetCompileResult {
|
|
30
|
+
preset: WorkflowDispatchCeilingPreset;
|
|
31
|
+
providers: {
|
|
32
|
+
codex: WorkflowCodexDispatchCeiling;
|
|
33
|
+
claude: WorkflowClaudeDispatchCeiling;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Result of compiling an advanced/manual per-provider selection.
|
|
38
|
+
* No `preset` key — advanced selections store only `providers`.
|
|
39
|
+
*/
|
|
40
|
+
export interface AdvancedCompileResult {
|
|
41
|
+
providers: WorkflowDispatchCeiling['providers'] & object;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Compile a preset label into concrete per-provider values.
|
|
45
|
+
* The returned `preset` field is provenance only; runtime dispatch reads
|
|
46
|
+
* only `providers`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function compileDispatchCeilingPreset(preset: WorkflowDispatchCeilingPreset): PresetCompileResult;
|
|
49
|
+
/**
|
|
50
|
+
* Pass through advanced/manual per-provider values with no `preset` key.
|
|
51
|
+
* Advanced selections do not set a preset so the persisted shape omits it.
|
|
52
|
+
*/
|
|
53
|
+
export declare function compileAdvancedDispatchCeiling(providers: WorkflowDispatchCeiling['providers'] & object): AdvancedCompileResult;
|
|
54
|
+
//# sourceMappingURL=dispatch-ceiling-preset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch-ceiling-preset.d.ts","sourceRoot":"","sources":["../../src/config/dispatch-ceiling-preset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC5B,uBAAuB,EACvB,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AAEtB;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;CAOpC,CAAC;AAEF;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,6BAA6B,CAAC;IACtC,SAAS,EAAE;QACT,KAAK,EAAE,4BAA4B,CAAC;QACpC,MAAM,EAAE,6BAA6B,CAAC;KACvC,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC;CAC1D;AAED;;;;GAIG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,6BAA6B,GACpC,mBAAmB,CAKrB;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,uBAAuB,CAAC,WAAW,CAAC,GAAG,MAAM,GACvD,qBAAqB,CAEvB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed mapping table: preset → concrete per-provider values.
|
|
3
|
+
* This is the single authority for preset compilation; the resolver and skills
|
|
4
|
+
* must not re-map these values.
|
|
5
|
+
*
|
|
6
|
+
* Design notes:
|
|
7
|
+
* - cost-conscious holds Claude at `sonnet` (no Haiku reviewers by default).
|
|
8
|
+
* - The table is `as const` to preserve literal types for downstream consumers.
|
|
9
|
+
*/
|
|
10
|
+
export const DISPATCH_CEILING_PRESETS = {
|
|
11
|
+
balanced: { codex: 'high', claude: 'sonnet' },
|
|
12
|
+
maximum: { codex: 'xhigh', claude: 'opus' },
|
|
13
|
+
'cost-conscious': { codex: 'medium', claude: 'sonnet' },
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Compile a preset label into concrete per-provider values.
|
|
17
|
+
* The returned `preset` field is provenance only; runtime dispatch reads
|
|
18
|
+
* only `providers`.
|
|
19
|
+
*/
|
|
20
|
+
export function compileDispatchCeilingPreset(preset) {
|
|
21
|
+
return {
|
|
22
|
+
preset,
|
|
23
|
+
providers: { ...DISPATCH_CEILING_PRESETS[preset] },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Pass through advanced/manual per-provider values with no `preset` key.
|
|
28
|
+
* Advanced selections do not set a preset so the persisted shape omits it.
|
|
29
|
+
*/
|
|
30
|
+
export function compileAdvancedDispatchCeiling(providers) {
|
|
31
|
+
return { providers };
|
|
32
|
+
}
|
|
@@ -22,9 +22,13 @@ export type WorkflowReviewExecutionModel = 'subagent' | 'inline' | 'fresh-sessio
|
|
|
22
22
|
export type WorkflowDesignMode = 'collaborative' | 'selective' | 'draft';
|
|
23
23
|
export type WorkflowCodexDispatchCeiling = 'low' | 'medium' | 'high' | 'xhigh';
|
|
24
24
|
export type WorkflowClaudeDispatchCeiling = 'haiku' | 'sonnet' | 'opus';
|
|
25
|
+
export type WorkflowDispatchCeilingPreset = 'balanced' | 'maximum' | 'cost-conscious';
|
|
25
26
|
export interface WorkflowDispatchCeiling {
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
preset?: WorkflowDispatchCeilingPreset;
|
|
28
|
+
providers?: {
|
|
29
|
+
codex?: WorkflowCodexDispatchCeiling;
|
|
30
|
+
claude?: WorkflowClaudeDispatchCeiling;
|
|
31
|
+
};
|
|
28
32
|
}
|
|
29
33
|
export interface OatWorkflowConfig {
|
|
30
34
|
hillCheckpointDefault?: WorkflowHillCheckpointDefault;
|
|
@@ -37,6 +41,9 @@ export interface OatWorkflowConfig {
|
|
|
37
41
|
designMode?: WorkflowDesignMode;
|
|
38
42
|
dispatchCeiling?: WorkflowDispatchCeiling;
|
|
39
43
|
}
|
|
44
|
+
export declare const VALID_CODEX_DISPATCH_CEILINGS: readonly WorkflowCodexDispatchCeiling[];
|
|
45
|
+
export declare const VALID_CLAUDE_DISPATCH_CEILINGS: readonly WorkflowClaudeDispatchCeiling[];
|
|
46
|
+
export declare const VALID_DISPATCH_CEILING_PRESETS: readonly WorkflowDispatchCeilingPreset[];
|
|
40
47
|
export type OatToolsConfig = Partial<Record<'core' | 'ideas' | 'docs' | 'workflows' | 'utility' | 'project-management' | 'research' | 'brainstorm', boolean>>;
|
|
41
48
|
export interface OatConfig {
|
|
42
49
|
version: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oat-config.d.ts","sourceRoot":"","sources":["../../src/config/oat-config.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC;AAED,MAAM,WAAW,YAAY;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,OAAO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AI,CAAC,CAMrE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA6B5D"}
|
|
@@ -15,13 +15,9 @@ const VALID_DESIGN_MODES = [
|
|
|
15
15
|
'selective',
|
|
16
16
|
'draft',
|
|
17
17
|
];
|
|
18
|
-
const VALID_CODEX_DISPATCH_CEILINGS = [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
'high',
|
|
22
|
-
'xhigh',
|
|
23
|
-
];
|
|
24
|
-
const VALID_CLAUDE_DISPATCH_CEILINGS = ['haiku', 'sonnet', 'opus'];
|
|
18
|
+
export const VALID_CODEX_DISPATCH_CEILINGS = ['low', 'medium', 'high', 'xhigh'];
|
|
19
|
+
export const VALID_CLAUDE_DISPATCH_CEILINGS = ['haiku', 'sonnet', 'opus'];
|
|
20
|
+
export const VALID_DISPATCH_CEILING_PRESETS = ['balanced', 'maximum', 'cost-conscious'];
|
|
25
21
|
function normalizeWorkflowConfig(parsed) {
|
|
26
22
|
if (!isRecord(parsed)) {
|
|
27
23
|
return undefined;
|
|
@@ -60,15 +56,26 @@ function normalizeWorkflowConfig(parsed) {
|
|
|
60
56
|
}
|
|
61
57
|
if (isRecord(parsed.dispatchCeiling)) {
|
|
62
58
|
const dispatchCeiling = {};
|
|
63
|
-
if (typeof parsed.dispatchCeiling.
|
|
64
|
-
|
|
65
|
-
dispatchCeiling.
|
|
66
|
-
.
|
|
59
|
+
if (typeof parsed.dispatchCeiling.preset === 'string' &&
|
|
60
|
+
VALID_DISPATCH_CEILING_PRESETS.includes(parsed.dispatchCeiling.preset)) {
|
|
61
|
+
dispatchCeiling.preset = parsed.dispatchCeiling
|
|
62
|
+
.preset;
|
|
67
63
|
}
|
|
68
|
-
if (
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
.
|
|
64
|
+
if (isRecord(parsed.dispatchCeiling.providers)) {
|
|
65
|
+
const providers = {};
|
|
66
|
+
if (typeof parsed.dispatchCeiling.providers.codex === 'string' &&
|
|
67
|
+
VALID_CODEX_DISPATCH_CEILINGS.includes(parsed.dispatchCeiling.providers.codex)) {
|
|
68
|
+
providers.codex = parsed.dispatchCeiling.providers
|
|
69
|
+
.codex;
|
|
70
|
+
}
|
|
71
|
+
if (typeof parsed.dispatchCeiling.providers.claude === 'string' &&
|
|
72
|
+
VALID_CLAUDE_DISPATCH_CEILINGS.includes(parsed.dispatchCeiling.providers.claude)) {
|
|
73
|
+
providers.claude = parsed.dispatchCeiling.providers
|
|
74
|
+
.claude;
|
|
75
|
+
}
|
|
76
|
+
if (Object.keys(providers).length > 0) {
|
|
77
|
+
dispatchCeiling.providers = providers;
|
|
78
|
+
}
|
|
72
79
|
}
|
|
73
80
|
if (Object.keys(dispatchCeiling).length > 0) {
|
|
74
81
|
next.dispatchCeiling = dispatchCeiling;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kCAAkC;IACjD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAClE,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAChE;
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAC5B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,KAAK,GACL,SAAS,CAAC;AAEd,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,oBAAoB,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kCAAkC;IACjD,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAClE,cAAc,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CAChE;AA2ED,wBAAsB,sBAAsB,CAC1C,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,SAAS,GAAE,OAAO,CAAC,kCAAkC,CAAM,GAC1D,OAAO,CAAC,cAAc,CAAC,CAgFzB"}
|
package/dist/config/resolve.js
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider ceiling adapter registry.
|
|
3
|
+
*
|
|
4
|
+
* Each adapter is the single source of truth for *what a provider can do* with a
|
|
5
|
+
* dispatch ceiling: whether it can enforce one, by what mechanism, the valid
|
|
6
|
+
* value set, and how to compile a ceiling value into dispatch arguments for a
|
|
7
|
+
* given role. The resolver (`oat project dispatch-ceiling resolve`) joins stored
|
|
8
|
+
* ceiling intent with these adapters to decide enforced/advisory/unsupported and
|
|
9
|
+
* to produce concrete dispatch args — skills never re-implement this logic.
|
|
10
|
+
*
|
|
11
|
+
* Codex enforces via sync-time pinned role variants
|
|
12
|
+
* (`oat-phase-implementer-<effort>` / `oat-reviewer-<effort>`); the adapter only
|
|
13
|
+
* *consumes* those existing names and never generates new variant files. Claude
|
|
14
|
+
* enforces via the per-call Task `model` argument (no variant files). Every other
|
|
15
|
+
* provider is advisory by default.
|
|
16
|
+
*/
|
|
17
|
+
export type EnforcementMechanism = 'pinned-variant' | 'model-arg' | 'none';
|
|
18
|
+
export type CeilingRole = 'implementer' | 'reviewer';
|
|
19
|
+
export interface CeilingCompileContext {
|
|
20
|
+
/** The orchestrator's own tier, used to detect above-orchestrator upgrades. */
|
|
21
|
+
orchestratorTier?: string;
|
|
22
|
+
}
|
|
23
|
+
export type CeilingDispatchArgs = {
|
|
24
|
+
variant: string;
|
|
25
|
+
} | {
|
|
26
|
+
model: string;
|
|
27
|
+
} | null;
|
|
28
|
+
export interface ProviderCeilingAdapter {
|
|
29
|
+
provider: string;
|
|
30
|
+
supportsCeiling: boolean;
|
|
31
|
+
validValues: string[];
|
|
32
|
+
mechanism: EnforcementMechanism;
|
|
33
|
+
/**
|
|
34
|
+
* Compile a ceiling value into dispatch args for the given role, or `null`
|
|
35
|
+
* when the value is invalid or the provider is advisory/unsupported.
|
|
36
|
+
*/
|
|
37
|
+
compileToDispatchArgs(value: string, role: CeilingRole, ctx: CeilingCompileContext): CeilingDispatchArgs;
|
|
38
|
+
/**
|
|
39
|
+
* Whether dispatch must verify the actual model/tier before reporting
|
|
40
|
+
* `enforced`. Only the upgrade path (requested tier > orchestrator tier) needs
|
|
41
|
+
* verification; cap-down and lateral requests never do.
|
|
42
|
+
*/
|
|
43
|
+
verifyOnDispatch(value: string, ctx: CeilingCompileContext): boolean;
|
|
44
|
+
}
|
|
45
|
+
/** Claude tier order, low → high, for above-orchestrator comparison. */
|
|
46
|
+
export declare const CLAUDE_TIER_ORDER: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* Look up the ceiling adapter for a provider. Unknown providers fall back to an
|
|
49
|
+
* advisory no-op adapter (`supportsCeiling: false`, `mechanism: 'none'`,
|
|
50
|
+
* `compileToDispatchArgs → null`).
|
|
51
|
+
*/
|
|
52
|
+
export declare function getCeilingAdapter(provider: string): ProviderCeilingAdapter;
|
|
53
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/providers/ceiling/registry.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,WAAW,GAAG,MAAM,CAAC;AAE3E,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,UAAU,CAAC;AAErD,MAAM,WAAW,qBAAqB;IACpC,+EAA+E;IAC/E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GACnB;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GACjB,IAAI,CAAC;AAET,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,EAAE,oBAAoB,CAAC;IAChC;;;OAGG;IACH,qBAAqB,CACnB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,qBAAqB,GACzB,mBAAmB,CAAC;IACvB;;;;OAIG;IACH,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,qBAAqB,GAAG,OAAO,CAAC;CACtE;AAMD,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAAgC,CAAC;AA0EhF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,CAE1E"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { VALID_CLAUDE_DISPATCH_CEILINGS, VALID_CODEX_DISPATCH_CEILINGS, } from '../../config/oat-config.js';
|
|
2
|
+
/** Codex pinned-variant base role names (must match sync-extension output). */
|
|
3
|
+
const CODEX_IMPLEMENTER_ROLE = 'oat-phase-implementer';
|
|
4
|
+
const CODEX_REVIEWER_ROLE = 'oat-reviewer';
|
|
5
|
+
/** Claude tier order, low → high, for above-orchestrator comparison. */
|
|
6
|
+
export const CLAUDE_TIER_ORDER = ['haiku', 'sonnet', 'opus'];
|
|
7
|
+
const codexAdapter = {
|
|
8
|
+
provider: 'codex',
|
|
9
|
+
supportsCeiling: true,
|
|
10
|
+
validValues: [...VALID_CODEX_DISPATCH_CEILINGS],
|
|
11
|
+
mechanism: 'pinned-variant',
|
|
12
|
+
compileToDispatchArgs(value, role) {
|
|
13
|
+
if (!VALID_CODEX_DISPATCH_CEILINGS.includes(value)) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const baseRole = role === 'reviewer' ? CODEX_REVIEWER_ROLE : CODEX_IMPLEMENTER_ROLE;
|
|
17
|
+
return { variant: `${baseRole}-${value}` };
|
|
18
|
+
},
|
|
19
|
+
// Codex enforces via effort variants, not model tier; there is no
|
|
20
|
+
// above-orchestrator upgrade path to verify.
|
|
21
|
+
verifyOnDispatch() {
|
|
22
|
+
return false;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
function isAboveOrchestrator(value, orchestratorTier) {
|
|
26
|
+
if (!orchestratorTier) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
const requestedIndex = CLAUDE_TIER_ORDER.indexOf(value);
|
|
30
|
+
const orchestratorIndex = CLAUDE_TIER_ORDER.indexOf(orchestratorTier);
|
|
31
|
+
if (requestedIndex < 0 || orchestratorIndex < 0) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return requestedIndex > orchestratorIndex;
|
|
35
|
+
}
|
|
36
|
+
const claudeAdapter = {
|
|
37
|
+
provider: 'claude',
|
|
38
|
+
supportsCeiling: true,
|
|
39
|
+
validValues: [...VALID_CLAUDE_DISPATCH_CEILINGS],
|
|
40
|
+
mechanism: 'model-arg',
|
|
41
|
+
compileToDispatchArgs(value) {
|
|
42
|
+
if (!VALID_CLAUDE_DISPATCH_CEILINGS.includes(value)) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return { model: value };
|
|
46
|
+
},
|
|
47
|
+
// Verify only when the request is above the orchestrator tier (upgrade path).
|
|
48
|
+
verifyOnDispatch(value, ctx) {
|
|
49
|
+
return isAboveOrchestrator(value, ctx.orchestratorTier);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
function advisoryAdapter(provider) {
|
|
53
|
+
return {
|
|
54
|
+
provider,
|
|
55
|
+
supportsCeiling: false,
|
|
56
|
+
validValues: [],
|
|
57
|
+
mechanism: 'none',
|
|
58
|
+
compileToDispatchArgs() {
|
|
59
|
+
return null;
|
|
60
|
+
},
|
|
61
|
+
verifyOnDispatch() {
|
|
62
|
+
return false;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const REGISTERED_ADAPTERS = {
|
|
67
|
+
codex: codexAdapter,
|
|
68
|
+
claude: claudeAdapter,
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Look up the ceiling adapter for a provider. Unknown providers fall back to an
|
|
72
|
+
* advisory no-op adapter (`supportsCeiling: false`, `mechanism: 'none'`,
|
|
73
|
+
* `compileToDispatchArgs → null`).
|
|
74
|
+
*/
|
|
75
|
+
export function getCeilingAdapter(provider) {
|
|
76
|
+
return REGISTERED_ADAPTERS[provider] ?? advisoryAdapter(provider);
|
|
77
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Open Agent Toolkit CLI",
|
|
6
6
|
"homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"ora": "^9.0.0",
|
|
34
34
|
"yaml": "2.8.2",
|
|
35
35
|
"zod": "^3.25.76",
|
|
36
|
-
"@open-agent-toolkit/control-plane": "0.1.
|
|
36
|
+
"@open-agent-toolkit/control-plane": "0.1.12"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.0",
|