@open-agent-toolkit/cli 0.1.43 → 0.1.46
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/agents/oat-reviewer.md +2 -2
- package/assets/config/dispatch-matrix-recommendation.json +23 -0
- package/assets/docs/cli-utilities/config-and-local-state.md +7 -0
- package/assets/docs/cli-utilities/configuration.md +104 -25
- package/assets/docs/cli-utilities/workflow-gates.md +79 -16
- package/assets/docs/contributing/code.md +10 -4
- package/assets/docs/contributing/hooks-and-safety.md +23 -0
- package/assets/docs/provider-sync/config.md +5 -1
- package/assets/docs/provider-sync/manifest-and-drift.md +6 -1
- package/assets/docs/provider-sync/providers.md +6 -3
- package/assets/docs/provider-sync/scope-and-surface.md +2 -1
- package/assets/docs/reference/oat-directory-structure.md +2 -2
- package/assets/docs/workflows/projects/dispatch-ceiling.md +110 -27
- package/assets/docs/workflows/projects/implementation-execution.md +20 -13
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +155 -58
- package/assets/skills/oat-project-plan/SKILL.md +22 -3
- package/assets/skills/oat-project-quick-start/SKILL.md +54 -23
- package/assets/templates/state.md +5 -0
- package/dist/commands/config/index.d.ts +6 -0
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +429 -20
- package/dist/commands/doctor/index.d.ts +6 -1
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +209 -19
- package/dist/commands/gate/index.d.ts +39 -2
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +343 -30
- package/dist/commands/internal/cursor-current-target.d.ts +37 -0
- package/dist/commands/internal/cursor-current-target.d.ts.map +1 -0
- package/dist/commands/internal/cursor-current-target.js +228 -0
- package/dist/commands/internal/index.d.ts.map +1 -1
- package/dist/commands/internal/index.js +2 -0
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +487 -17
- package/dist/commands/providers/codex/index.d.ts +4 -0
- package/dist/commands/providers/codex/index.d.ts.map +1 -0
- package/dist/commands/providers/codex/index.js +7 -0
- package/dist/commands/providers/codex/materialize.d.ts +5 -0
- package/dist/commands/providers/codex/materialize.d.ts.map +1 -0
- package/dist/commands/providers/codex/materialize.js +152 -0
- package/dist/commands/providers/index.d.ts +2 -2
- package/dist/commands/providers/index.d.ts.map +1 -1
- package/dist/commands/providers/index.js +4 -2
- package/dist/commands/providers/providers.types.d.ts +23 -0
- package/dist/commands/providers/providers.types.d.ts.map +1 -1
- package/dist/commands/shared/codex-strays.d.ts.map +1 -1
- package/dist/commands/shared/codex-strays.js +11 -1
- package/dist/commands/status/index.d.ts +4 -1
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +1 -1
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +1 -1
- package/dist/commands/sync/sync.types.d.ts +4 -1
- package/dist/commands/sync/sync.types.d.ts.map +1 -1
- package/dist/config/dispatch-ceiling-preset.d.ts +4 -0
- package/dist/config/dispatch-ceiling-preset.d.ts.map +1 -1
- package/dist/config/dispatch-ceiling-preset.js +3 -0
- package/dist/config/dispatch-policy-options.d.ts +20 -0
- package/dist/config/dispatch-policy-options.d.ts.map +1 -0
- package/dist/config/dispatch-policy-options.js +96 -0
- package/dist/config/oat-config.d.ts +21 -5
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +118 -10
- package/dist/config/resolve.js +12 -0
- package/dist/manifest/manifest.types.d.ts +12 -12
- package/dist/providers/ceiling/registry.d.ts +7 -5
- package/dist/providers/ceiling/registry.d.ts.map +1 -1
- package/dist/providers/ceiling/registry.js +32 -5
- package/dist/providers/codex/codec/config-merge.d.ts +6 -0
- package/dist/providers/codex/codec/config-merge.d.ts.map +1 -1
- package/dist/providers/codex/codec/config-merge.js +7 -0
- package/dist/providers/codex/codec/materialize.d.ts +16 -0
- package/dist/providers/codex/codec/materialize.d.ts.map +1 -0
- package/dist/providers/codex/codec/materialize.js +57 -0
- package/dist/providers/codex/codec/shared.d.ts +1 -0
- package/dist/providers/codex/codec/shared.d.ts.map +1 -1
- package/dist/providers/codex/codec/shared.js +9 -1
- package/dist/providers/codex/codec/sync-extension.d.ts +7 -1
- package/dist/providers/codex/codec/sync-extension.d.ts.map +1 -1
- package/dist/providers/codex/codec/sync-extension.js +183 -46
- package/dist/providers/identity/availability.d.ts +45 -0
- package/dist/providers/identity/availability.d.ts.map +1 -0
- package/dist/providers/identity/availability.js +353 -0
- package/dist/providers/identity/family.d.ts +13 -0
- package/dist/providers/identity/family.d.ts.map +1 -0
- package/dist/providers/identity/family.js +32 -0
- package/dist/providers/identity/provenance.d.ts +21 -0
- package/dist/providers/identity/provenance.d.ts.map +1 -0
- package/dist/providers/identity/provenance.js +65 -0
- package/dist/providers/identity/stamp.d.ts +35 -0
- package/dist/providers/identity/stamp.d.ts.map +1 -0
- package/dist/providers/identity/stamp.js +171 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oat-config.d.ts","sourceRoot":"","sources":["../../src/config/oat-config.ts"],"names":[],"mappings":"AASA,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,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CA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QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CA6B5D"}
|
|
@@ -21,6 +21,7 @@ export const VALID_CLAUDE_DISPATCH_CEILINGS = ['haiku', 'sonnet', 'opus', 'fable
|
|
|
21
21
|
export const VALID_DISPATCH_CEILING_PRESETS = ['balanced', 'maximum', 'cost-conscious'];
|
|
22
22
|
export const VALID_DISPATCH_POLICY_MODES = ['managed', 'inherit'];
|
|
23
23
|
export const VALID_MANAGED_DISPATCH_POLICIES = ['economy', 'balanced', 'high', 'frontier', 'uncapped'];
|
|
24
|
+
export const VALID_DISPATCH_MATRIX_TIERS = ['economy', 'balanced', 'high', 'frontier'];
|
|
24
25
|
const VALID_GATE_ON_FAILURES = [
|
|
25
26
|
'block',
|
|
26
27
|
'prompt',
|
|
@@ -49,10 +50,29 @@ export const BUILTIN_EXEC_TARGETS = {
|
|
|
49
50
|
runtime: 'cursor',
|
|
50
51
|
baseCommand: ['cursor-agent', '-p'],
|
|
51
52
|
hostDetectionCommand: ['sh', '-c', 'test -n "$CURSOR_AGENT"'],
|
|
52
|
-
availabilityCommand: [
|
|
53
|
+
availabilityCommand: [
|
|
54
|
+
'sh',
|
|
55
|
+
'-c',
|
|
56
|
+
'command -v cursor-agent || command -v agent',
|
|
57
|
+
],
|
|
53
58
|
priority: 70,
|
|
54
59
|
},
|
|
55
60
|
};
|
|
61
|
+
export function isCodexMaterializedRouteTarget(provider, target) {
|
|
62
|
+
return (target.harness ?? provider) === 'codex';
|
|
63
|
+
}
|
|
64
|
+
export function validateDispatchRouteTarget(provider, target) {
|
|
65
|
+
if (!isCodexMaterializedRouteTarget(provider, target)) {
|
|
66
|
+
return { valid: true };
|
|
67
|
+
}
|
|
68
|
+
if (!target.model || !target.effort) {
|
|
69
|
+
return {
|
|
70
|
+
valid: false,
|
|
71
|
+
reason: 'Codex materialized dispatch targets must provide both model and effort.',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return { valid: true };
|
|
75
|
+
}
|
|
56
76
|
function normalizeMaxAttempts(value) {
|
|
57
77
|
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
58
78
|
return 2;
|
|
@@ -72,6 +92,14 @@ function normalizeArgv(value) {
|
|
|
72
92
|
}
|
|
73
93
|
return [...value];
|
|
74
94
|
}
|
|
95
|
+
function normalizeStringList(value) {
|
|
96
|
+
if (!Array.isArray(value) ||
|
|
97
|
+
value.length === 0 ||
|
|
98
|
+
!value.every((item) => typeof item === 'string' && item.trim().length > 0)) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
return value.map((item) => item.trim());
|
|
102
|
+
}
|
|
75
103
|
function normalizeGateConfig(value) {
|
|
76
104
|
if (value === null) {
|
|
77
105
|
return null;
|
|
@@ -96,6 +124,82 @@ function normalizeGateConfig(value) {
|
|
|
96
124
|
}
|
|
97
125
|
return gate;
|
|
98
126
|
}
|
|
127
|
+
function normalizeProviderBareValue(providerKey, value) {
|
|
128
|
+
const trimmed = trimNonEmptyString(value);
|
|
129
|
+
if (trimmed === undefined) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
if (providerKey === 'codex' &&
|
|
133
|
+
!VALID_CODEX_DISPATCH_CEILINGS.includes(trimmed)) {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
if (providerKey === 'claude' &&
|
|
137
|
+
!VALID_CLAUDE_DISPATCH_CEILINGS.includes(trimmed)) {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
return trimmed;
|
|
141
|
+
}
|
|
142
|
+
function normalizeDispatchRouteTarget(value) {
|
|
143
|
+
if (!isRecord(value)) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
const target = {};
|
|
147
|
+
const harness = trimNonEmptyString(value.harness);
|
|
148
|
+
if (harness !== undefined) {
|
|
149
|
+
target.harness = harness;
|
|
150
|
+
}
|
|
151
|
+
const model = trimNonEmptyString(value.model);
|
|
152
|
+
if (model !== undefined) {
|
|
153
|
+
target.model = model;
|
|
154
|
+
}
|
|
155
|
+
const effort = trimNonEmptyString(value.effort);
|
|
156
|
+
if (effort !== undefined) {
|
|
157
|
+
target.effort = effort;
|
|
158
|
+
}
|
|
159
|
+
return Object.keys(target).length > 0 ? target : undefined;
|
|
160
|
+
}
|
|
161
|
+
function normalizeDispatchMatrixCell(providerKey, value) {
|
|
162
|
+
const bareValue = normalizeProviderBareValue(providerKey, value);
|
|
163
|
+
if (bareValue !== undefined) {
|
|
164
|
+
return bareValue;
|
|
165
|
+
}
|
|
166
|
+
if (!Array.isArray(value) || value.length === 0) {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
const route = [];
|
|
170
|
+
for (const entry of value) {
|
|
171
|
+
const bareEntry = normalizeProviderBareValue(providerKey, entry);
|
|
172
|
+
if (bareEntry !== undefined) {
|
|
173
|
+
route.push(bareEntry);
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
const target = normalizeDispatchRouteTarget(entry);
|
|
177
|
+
if (target !== undefined) {
|
|
178
|
+
route.push(target);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return route.length > 0 ? route : undefined;
|
|
182
|
+
}
|
|
183
|
+
function normalizeDispatchProviderValue(providerKey, value) {
|
|
184
|
+
const bareValue = normalizeProviderBareValue(providerKey, value);
|
|
185
|
+
if (bareValue !== undefined) {
|
|
186
|
+
return bareValue;
|
|
187
|
+
}
|
|
188
|
+
if (!isRecord(value)) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
const tierMap = {};
|
|
192
|
+
for (const [tier, rawCell] of Object.entries(value)) {
|
|
193
|
+
if (!VALID_DISPATCH_MATRIX_TIERS.includes(tier)) {
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
const normalized = normalizeDispatchMatrixCell(providerKey, rawCell);
|
|
197
|
+
if (normalized !== undefined) {
|
|
198
|
+
tierMap[tier] = normalized;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return Object.keys(tierMap).length > 0 ? tierMap : undefined;
|
|
202
|
+
}
|
|
99
203
|
function normalizeExecTarget(value) {
|
|
100
204
|
if (value === null) {
|
|
101
205
|
return null;
|
|
@@ -112,6 +216,10 @@ function normalizeExecTarget(value) {
|
|
|
112
216
|
if (baseCommand !== undefined) {
|
|
113
217
|
target.baseCommand = baseCommand;
|
|
114
218
|
}
|
|
219
|
+
const models = normalizeStringList(value.models);
|
|
220
|
+
if (models !== undefined) {
|
|
221
|
+
target.models = models;
|
|
222
|
+
}
|
|
115
223
|
if ('priority' in value) {
|
|
116
224
|
if (typeof value.priority === 'number' && Number.isFinite(value.priority)) {
|
|
117
225
|
target.priority = value.priority;
|
|
@@ -215,17 +323,17 @@ function normalizeWorkflowConfig(parsed) {
|
|
|
215
323
|
dispatchCeiling.preset = parsed.dispatchCeiling
|
|
216
324
|
.preset;
|
|
217
325
|
}
|
|
326
|
+
const recommendationVersion = trimNonEmptyString(parsed.dispatchCeiling.recommendationVersion);
|
|
327
|
+
if (recommendationVersion !== undefined) {
|
|
328
|
+
dispatchCeiling.recommendationVersion = recommendationVersion;
|
|
329
|
+
}
|
|
218
330
|
if (isRecord(parsed.dispatchCeiling.providers)) {
|
|
219
331
|
const providers = {};
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
if (typeof parsed.dispatchCeiling.providers.claude === 'string' &&
|
|
226
|
-
VALID_CLAUDE_DISPATCH_CEILINGS.includes(parsed.dispatchCeiling.providers.claude)) {
|
|
227
|
-
providers.claude = parsed.dispatchCeiling.providers
|
|
228
|
-
.claude;
|
|
332
|
+
for (const [providerKey, rawProviderValue] of Object.entries(parsed.dispatchCeiling.providers)) {
|
|
333
|
+
const normalized = normalizeDispatchProviderValue(providerKey, rawProviderValue);
|
|
334
|
+
if (normalized !== undefined) {
|
|
335
|
+
providers[providerKey] = normalized;
|
|
336
|
+
}
|
|
229
337
|
}
|
|
230
338
|
if (Object.keys(providers).length > 0) {
|
|
231
339
|
dispatchCeiling.providers = providers;
|
package/dist/config/resolve.js
CHANGED
|
@@ -181,6 +181,7 @@ function mergeExecTargetLayer(targets, layer) {
|
|
|
181
181
|
targets[id] = cloneExecTarget({
|
|
182
182
|
runtime: override.runtime ?? existing.runtime,
|
|
183
183
|
baseCommand: override.baseCommand ?? existing.baseCommand,
|
|
184
|
+
models: override.models ?? existing.models,
|
|
184
185
|
hostDetectionCommand: override.hostDetectionCommand ?? existing.hostDetectionCommand,
|
|
185
186
|
availabilityCommand: override.availabilityCommand ?? existing.availabilityCommand,
|
|
186
187
|
priority: override.priority ?? existing.priority,
|
|
@@ -211,6 +212,9 @@ function cloneExecTarget(target) {
|
|
|
211
212
|
if (target.availabilityCommand) {
|
|
212
213
|
next.availabilityCommand = [...target.availabilityCommand];
|
|
213
214
|
}
|
|
215
|
+
if (target.models) {
|
|
216
|
+
next.models = [...target.models];
|
|
217
|
+
}
|
|
214
218
|
return next;
|
|
215
219
|
}
|
|
216
220
|
function toCompleteExecTarget(target) {
|
|
@@ -231,8 +235,16 @@ function toCompleteExecTarget(target) {
|
|
|
231
235
|
if (isValidArgv(target.availabilityCommand)) {
|
|
232
236
|
completeTarget.availabilityCommand = [...target.availabilityCommand];
|
|
233
237
|
}
|
|
238
|
+
if (isValidStringList(target.models)) {
|
|
239
|
+
completeTarget.models = target.models.map((model) => model.trim());
|
|
240
|
+
}
|
|
234
241
|
return completeTarget;
|
|
235
242
|
}
|
|
243
|
+
function isValidStringList(value) {
|
|
244
|
+
return (Array.isArray(value) &&
|
|
245
|
+
value.length > 0 &&
|
|
246
|
+
value.every((part) => typeof part === 'string' && part.trim().length > 0));
|
|
247
|
+
}
|
|
236
248
|
function isValidArgv(value) {
|
|
237
249
|
if (!Array.isArray(value) ||
|
|
238
250
|
value.length === 0 ||
|
|
@@ -9,36 +9,36 @@ export declare const ManifestEntrySchema: z.ZodEffects<z.ZodObject<{
|
|
|
9
9
|
isFile: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
lastSynced: z.ZodString;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
provider: string;
|
|
12
13
|
canonicalPath: string;
|
|
13
14
|
providerPath: string;
|
|
14
|
-
provider: string;
|
|
15
15
|
contentType: "skill" | "agent" | "rule";
|
|
16
16
|
strategy: "symlink" | "copy";
|
|
17
17
|
contentHash: string | null;
|
|
18
18
|
isFile: boolean;
|
|
19
19
|
lastSynced: string;
|
|
20
20
|
}, {
|
|
21
|
+
provider: string;
|
|
21
22
|
canonicalPath: string;
|
|
22
23
|
providerPath: string;
|
|
23
|
-
provider: string;
|
|
24
24
|
contentType: "skill" | "agent" | "rule";
|
|
25
25
|
strategy: "symlink" | "copy";
|
|
26
26
|
contentHash: string | null;
|
|
27
27
|
lastSynced: string;
|
|
28
28
|
isFile?: boolean | undefined;
|
|
29
29
|
}>, {
|
|
30
|
+
provider: string;
|
|
30
31
|
canonicalPath: string;
|
|
31
32
|
providerPath: string;
|
|
32
|
-
provider: string;
|
|
33
33
|
contentType: "skill" | "agent" | "rule";
|
|
34
34
|
strategy: "symlink" | "copy";
|
|
35
35
|
contentHash: string | null;
|
|
36
36
|
isFile: boolean;
|
|
37
37
|
lastSynced: string;
|
|
38
38
|
}, {
|
|
39
|
+
provider: string;
|
|
39
40
|
canonicalPath: string;
|
|
40
41
|
providerPath: string;
|
|
41
|
-
provider: string;
|
|
42
42
|
contentType: "skill" | "agent" | "rule";
|
|
43
43
|
strategy: "symlink" | "copy";
|
|
44
44
|
contentHash: string | null;
|
|
@@ -58,36 +58,36 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
58
58
|
isFile: z.ZodDefault<z.ZodBoolean>;
|
|
59
59
|
lastSynced: z.ZodString;
|
|
60
60
|
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
provider: string;
|
|
61
62
|
canonicalPath: string;
|
|
62
63
|
providerPath: string;
|
|
63
|
-
provider: string;
|
|
64
64
|
contentType: "skill" | "agent" | "rule";
|
|
65
65
|
strategy: "symlink" | "copy";
|
|
66
66
|
contentHash: string | null;
|
|
67
67
|
isFile: boolean;
|
|
68
68
|
lastSynced: string;
|
|
69
69
|
}, {
|
|
70
|
+
provider: string;
|
|
70
71
|
canonicalPath: string;
|
|
71
72
|
providerPath: string;
|
|
72
|
-
provider: string;
|
|
73
73
|
contentType: "skill" | "agent" | "rule";
|
|
74
74
|
strategy: "symlink" | "copy";
|
|
75
75
|
contentHash: string | null;
|
|
76
76
|
lastSynced: string;
|
|
77
77
|
isFile?: boolean | undefined;
|
|
78
78
|
}>, {
|
|
79
|
+
provider: string;
|
|
79
80
|
canonicalPath: string;
|
|
80
81
|
providerPath: string;
|
|
81
|
-
provider: string;
|
|
82
82
|
contentType: "skill" | "agent" | "rule";
|
|
83
83
|
strategy: "symlink" | "copy";
|
|
84
84
|
contentHash: string | null;
|
|
85
85
|
isFile: boolean;
|
|
86
86
|
lastSynced: string;
|
|
87
87
|
}, {
|
|
88
|
+
provider: string;
|
|
88
89
|
canonicalPath: string;
|
|
89
90
|
providerPath: string;
|
|
90
|
-
provider: string;
|
|
91
91
|
contentType: "skill" | "agent" | "rule";
|
|
92
92
|
strategy: "symlink" | "copy";
|
|
93
93
|
contentHash: string | null;
|
|
@@ -97,9 +97,9 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
97
97
|
lastUpdated: z.ZodString;
|
|
98
98
|
}, "strip", z.ZodTypeAny, {
|
|
99
99
|
entries: {
|
|
100
|
+
provider: string;
|
|
100
101
|
canonicalPath: string;
|
|
101
102
|
providerPath: string;
|
|
102
|
-
provider: string;
|
|
103
103
|
contentType: "skill" | "agent" | "rule";
|
|
104
104
|
strategy: "symlink" | "copy";
|
|
105
105
|
contentHash: string | null;
|
|
@@ -111,9 +111,9 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
111
111
|
lastUpdated: string;
|
|
112
112
|
}, {
|
|
113
113
|
entries: {
|
|
114
|
+
provider: string;
|
|
114
115
|
canonicalPath: string;
|
|
115
116
|
providerPath: string;
|
|
116
|
-
provider: string;
|
|
117
117
|
contentType: "skill" | "agent" | "rule";
|
|
118
118
|
strategy: "symlink" | "copy";
|
|
119
119
|
contentHash: string | null;
|
|
@@ -125,9 +125,9 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
125
125
|
lastUpdated: string;
|
|
126
126
|
}>, {
|
|
127
127
|
entries: {
|
|
128
|
+
provider: string;
|
|
128
129
|
canonicalPath: string;
|
|
129
130
|
providerPath: string;
|
|
130
|
-
provider: string;
|
|
131
131
|
contentType: "skill" | "agent" | "rule";
|
|
132
132
|
strategy: "symlink" | "copy";
|
|
133
133
|
contentHash: string | null;
|
|
@@ -139,9 +139,9 @@ export declare const ManifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
139
139
|
lastUpdated: string;
|
|
140
140
|
}, {
|
|
141
141
|
entries: {
|
|
142
|
+
provider: string;
|
|
142
143
|
canonicalPath: string;
|
|
143
144
|
providerPath: string;
|
|
144
|
-
provider: string;
|
|
145
145
|
contentType: "skill" | "agent" | "rule";
|
|
146
146
|
strategy: "symlink" | "copy";
|
|
147
147
|
contentHash: string | null;
|
|
@@ -8,17 +8,19 @@
|
|
|
8
8
|
* ceiling intent with these adapters to decide enforced/advisory/unsupported and
|
|
9
9
|
* to produce concrete dispatch args — skills never re-implement this logic.
|
|
10
10
|
*
|
|
11
|
-
* Codex enforces via sync-time
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* enforces via the per-call Task `model` argument (no variant files). Every other
|
|
15
|
-
* provider is advisory by default.
|
|
11
|
+
* Codex enforces via sync-time materialized role variants selected from matrix
|
|
12
|
+
* model+effort targets. Claude enforces via the per-call Task `model` argument
|
|
13
|
+
* (no variant files). Every other provider is advisory by default.
|
|
16
14
|
*/
|
|
17
15
|
export type EnforcementMechanism = 'pinned-variant' | 'model-arg' | 'none';
|
|
18
16
|
export type CeilingRole = 'implementer' | 'reviewer';
|
|
19
17
|
export interface CeilingCompileContext {
|
|
20
18
|
/** The orchestrator's own tier, used to detect above-orchestrator upgrades. */
|
|
21
19
|
orchestratorTier?: string;
|
|
20
|
+
target?: {
|
|
21
|
+
model?: string;
|
|
22
|
+
effort?: string;
|
|
23
|
+
} | null;
|
|
22
24
|
}
|
|
23
25
|
export type CeilingDispatchArgs = {
|
|
24
26
|
variant: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/providers/ceiling/registry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/providers/ceiling/registry.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;GAaG;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;IAC1B,MAAM,CAAC,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,IAAI,CAAC;CACV;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,EAK9C,CAAC;AAqGF;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,sBAAsB,CAE1E"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { VALID_CLAUDE_DISPATCH_CEILINGS, VALID_CODEX_DISPATCH_CEILINGS, } from '../../config/oat-config.js';
|
|
2
|
-
|
|
2
|
+
import { buildCodexMaterializedRoleName } from '../codex/codec/materialize.js';
|
|
3
|
+
/** Codex materialized-role base names (must match sync-extension output). */
|
|
3
4
|
const CODEX_IMPLEMENTER_ROLE = 'oat-phase-implementer';
|
|
4
5
|
const CODEX_REVIEWER_ROLE = 'oat-reviewer';
|
|
5
6
|
/** Claude tier order, low → high, for above-orchestrator comparison. */
|
|
@@ -14,15 +15,25 @@ const codexAdapter = {
|
|
|
14
15
|
supportsCeiling: true,
|
|
15
16
|
validValues: [...VALID_CODEX_DISPATCH_CEILINGS],
|
|
16
17
|
mechanism: 'pinned-variant',
|
|
17
|
-
compileToDispatchArgs(value, role) {
|
|
18
|
+
compileToDispatchArgs(value, role, ctx) {
|
|
18
19
|
if (!VALID_CODEX_DISPATCH_CEILINGS.includes(value)) {
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
22
|
+
const target = ctx.target;
|
|
23
|
+
if (!target?.model || !target.effort) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
21
26
|
const baseRole = role === 'reviewer' ? CODEX_REVIEWER_ROLE : CODEX_IMPLEMENTER_ROLE;
|
|
22
|
-
return {
|
|
27
|
+
return {
|
|
28
|
+
variant: buildCodexMaterializedRoleName({
|
|
29
|
+
agentName: baseRole,
|
|
30
|
+
model: target.model,
|
|
31
|
+
effort: target.effort,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
23
34
|
},
|
|
24
|
-
// Codex enforces via effort
|
|
25
|
-
// above-orchestrator upgrade path to verify.
|
|
35
|
+
// Codex enforces via materialized model+effort roles, not model tier; there
|
|
36
|
+
// is no above-orchestrator upgrade path to verify.
|
|
26
37
|
verifyOnDispatch() {
|
|
27
38
|
return false;
|
|
28
39
|
},
|
|
@@ -54,6 +65,21 @@ const claudeAdapter = {
|
|
|
54
65
|
return isAboveOrchestrator(value, ctx.orchestratorTier);
|
|
55
66
|
},
|
|
56
67
|
};
|
|
68
|
+
const cursorAdapter = {
|
|
69
|
+
provider: 'cursor',
|
|
70
|
+
supportsCeiling: true,
|
|
71
|
+
validValues: [],
|
|
72
|
+
mechanism: 'model-arg',
|
|
73
|
+
compileToDispatchArgs(value) {
|
|
74
|
+
const model = value.trim();
|
|
75
|
+
return model ? { model } : null;
|
|
76
|
+
},
|
|
77
|
+
// Cursor model slugs do not share a total order, so upgrade verification is
|
|
78
|
+
// not meaningful here; availability is checked by the identity oracle layer.
|
|
79
|
+
verifyOnDispatch() {
|
|
80
|
+
return false;
|
|
81
|
+
},
|
|
82
|
+
};
|
|
57
83
|
function advisoryAdapter(provider) {
|
|
58
84
|
return {
|
|
59
85
|
provider,
|
|
@@ -71,6 +97,7 @@ function advisoryAdapter(provider) {
|
|
|
71
97
|
const REGISTERED_ADAPTERS = {
|
|
72
98
|
codex: codexAdapter,
|
|
73
99
|
claude: claudeAdapter,
|
|
100
|
+
cursor: cursorAdapter,
|
|
74
101
|
};
|
|
75
102
|
/**
|
|
76
103
|
* Look up the ceiling adapter for a provider. Unknown providers fall back to an
|
|
@@ -8,10 +8,16 @@ export interface CodexConfigMergeArgs {
|
|
|
8
8
|
desiredRoles: CodexManagedRoleConfig[];
|
|
9
9
|
staleManagedRoles?: string[];
|
|
10
10
|
}
|
|
11
|
+
export interface CodexSingleRoleConfigMergeArgs {
|
|
12
|
+
existingContent: string | null;
|
|
13
|
+
role: CodexManagedRoleConfig;
|
|
14
|
+
staleManagedRoles?: string[];
|
|
15
|
+
}
|
|
11
16
|
export interface CodexConfigMergeResult {
|
|
12
17
|
mergedContent: string;
|
|
13
18
|
changed: boolean;
|
|
14
19
|
removedRoles: string[];
|
|
15
20
|
}
|
|
16
21
|
export declare function mergeCodexConfig({ existingContent, desiredRoles, staleManagedRoles, }: CodexConfigMergeArgs): CodexConfigMergeResult;
|
|
22
|
+
export declare function mergeCodexConfigForRole({ existingContent, role, staleManagedRoles, }: CodexSingleRoleConfigMergeArgs): CodexConfigMergeResult;
|
|
17
23
|
//# sourceMappingURL=config-merge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-merge.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/config-merge.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAiCD,wBAAgB,gBAAgB,CAAC,EAC/B,eAAe,EACf,YAAY,EACZ,iBAAsB,GACvB,EAAE,oBAAoB,GAAG,sBAAsB,CAsC/C"}
|
|
1
|
+
{"version":3,"file":"config-merge.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/config-merge.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,8BAA8B;IAC7C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,IAAI,EAAE,sBAAsB,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAiCD,wBAAgB,gBAAgB,CAAC,EAC/B,eAAe,EACf,YAAY,EACZ,iBAAsB,GACvB,EAAE,oBAAoB,GAAG,sBAAsB,CAsC/C;AAED,wBAAgB,uBAAuB,CAAC,EACtC,eAAe,EACf,IAAI,EACJ,iBAAsB,GACvB,EAAE,8BAA8B,GAAG,sBAAsB,CAMzD"}
|
|
@@ -59,3 +59,10 @@ export function mergeCodexConfig({ existingContent, desiredRoles, staleManagedRo
|
|
|
59
59
|
removedRoles,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
export function mergeCodexConfigForRole({ existingContent, role, staleManagedRoles = [], }) {
|
|
63
|
+
return mergeCodexConfig({
|
|
64
|
+
existingContent,
|
|
65
|
+
desiredRoles: [role],
|
|
66
|
+
staleManagedRoles,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CanonicalAgentDocument } from '../../../agents/canonical/index.js';
|
|
2
|
+
import { type CodexRoleExport } from './export-to-codex.js';
|
|
3
|
+
export interface CodexMaterializeRoleOptions {
|
|
4
|
+
agent: CanonicalAgentDocument;
|
|
5
|
+
model: string;
|
|
6
|
+
effort: string;
|
|
7
|
+
roleName?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CodexMaterializedRoleNameOptions {
|
|
10
|
+
agentName: string;
|
|
11
|
+
model: string;
|
|
12
|
+
effort: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildCodexMaterializedRoleName({ agentName, model, effort, }: CodexMaterializedRoleNameOptions): string;
|
|
15
|
+
export declare function materializeCodexRole({ agent, model, effort, roleName, }: CodexMaterializeRoleOptions): CodexRoleExport;
|
|
16
|
+
//# sourceMappingURL=materialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialize.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/materialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAGhE,OAAO,EACL,KAAK,eAAe,EAErB,MAAM,mBAAmB,CAAC;AAG3B,MAAM,WAAW,2BAA2B;IAC1C,KAAK,EAAE,sBAAsB,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gCAAgC;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAUD,wBAAgB,8BAA8B,CAAC,EAC7C,SAAS,EACT,KAAK,EACL,MAAM,GACP,EAAE,gCAAgC,GAAG,MAAM,CAa3C;AAWD,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,KAAK,EACL,MAAM,EACN,QAAQ,GACT,EAAE,2BAA2B,GAAG,eAAe,CA+B/C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { CliError } from '../../../errors/index.js';
|
|
2
|
+
import { exportCanonicalAgentToCodexRole, } from './export-to-codex.js';
|
|
3
|
+
import { normalizeCodexRoleName, sanitizeCodexRoleName } from './shared.js';
|
|
4
|
+
function requireNonEmpty(value, label) {
|
|
5
|
+
const normalized = value.trim();
|
|
6
|
+
if (!normalized) {
|
|
7
|
+
throw new CliError(`Cannot materialize Codex role: missing ${label}.`);
|
|
8
|
+
}
|
|
9
|
+
return normalized;
|
|
10
|
+
}
|
|
11
|
+
export function buildCodexMaterializedRoleName({ agentName, model, effort, }) {
|
|
12
|
+
const normalizedAgentName = sanitizeCodexRoleName(agentName);
|
|
13
|
+
const normalizedModel = normalizeCodexRoleName(model);
|
|
14
|
+
const normalizedEffort = normalizeCodexRoleName(effort);
|
|
15
|
+
const roleName = normalizeCodexRoleName(`${normalizedAgentName}-${normalizedModel}-${normalizedEffort}`);
|
|
16
|
+
if (!roleName) {
|
|
17
|
+
throw new CliError('Cannot materialize Codex role: missing role name.');
|
|
18
|
+
}
|
|
19
|
+
return roleName;
|
|
20
|
+
}
|
|
21
|
+
function codexExtensionObject(agent) {
|
|
22
|
+
const extension = agent.extensions.x_codex;
|
|
23
|
+
if (!extension || typeof extension !== 'object' || Array.isArray(extension)) {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
return { ...extension };
|
|
27
|
+
}
|
|
28
|
+
export function materializeCodexRole({ agent, model, effort, roleName, }) {
|
|
29
|
+
const materializedModel = requireNonEmpty(model, 'model');
|
|
30
|
+
const materializedEffort = requireNonEmpty(effort, 'effort');
|
|
31
|
+
const materializedRoleName = roleName
|
|
32
|
+
? sanitizeCodexRoleName(roleName)
|
|
33
|
+
: buildCodexMaterializedRoleName({
|
|
34
|
+
agentName: agent.name,
|
|
35
|
+
model: materializedModel,
|
|
36
|
+
effort: materializedEffort,
|
|
37
|
+
});
|
|
38
|
+
if (!materializedRoleName) {
|
|
39
|
+
throw new CliError('Cannot materialize Codex role: missing role name.');
|
|
40
|
+
}
|
|
41
|
+
return exportCanonicalAgentToCodexRole({
|
|
42
|
+
...agent,
|
|
43
|
+
name: materializedRoleName,
|
|
44
|
+
frontmatter: {
|
|
45
|
+
...agent.frontmatter,
|
|
46
|
+
name: materializedRoleName,
|
|
47
|
+
},
|
|
48
|
+
extensions: {
|
|
49
|
+
...agent.extensions,
|
|
50
|
+
x_codex: {
|
|
51
|
+
...codexExtensionObject(agent),
|
|
52
|
+
model: materializedModel,
|
|
53
|
+
model_reasoning_effort: materializedEffort,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare const OAT_MANAGED_ROLE_HEADER = "# oat-managed: true";
|
|
2
2
|
export declare const OAT_MANAGED_ROLE_NAME_PREFIX = "# oat-role: ";
|
|
3
3
|
export declare function sanitizeCodexRoleName(input: string): string;
|
|
4
|
+
export declare function normalizeCodexRoleName(input: string): string;
|
|
4
5
|
export declare function isOatManagedCodexRoleFile(content: string, roleName?: string): boolean;
|
|
5
6
|
export declare function withOatManagedCodexHeader(roleName: string, tomlBody: string): string;
|
|
6
7
|
export declare function stringifyToml(object: Record<string, unknown>): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAUT;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/shared.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,4BAA4B,iBAAiB,CAAC;AAE3D,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAO5D;AAED,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAUT;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,MAAM,CAER;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAErE"}
|
|
@@ -2,7 +2,15 @@ import TOML from '@iarna/toml';
|
|
|
2
2
|
export const OAT_MANAGED_ROLE_HEADER = '# oat-managed: true';
|
|
3
3
|
export const OAT_MANAGED_ROLE_NAME_PREFIX = '# oat-role: ';
|
|
4
4
|
export function sanitizeCodexRoleName(input) {
|
|
5
|
-
return input.
|
|
5
|
+
return normalizeCodexRoleName(input.replace(/\.md$/i, ''));
|
|
6
|
+
}
|
|
7
|
+
export function normalizeCodexRoleName(input) {
|
|
8
|
+
return input
|
|
9
|
+
.trim()
|
|
10
|
+
.toLowerCase()
|
|
11
|
+
.replace(/[^a-z0-9_-]+/g, '-')
|
|
12
|
+
.replace(/-{2,}/g, '-')
|
|
13
|
+
.replace(/^-+|-+$/g, '');
|
|
6
14
|
}
|
|
7
15
|
export function isOatManagedCodexRoleFile(content, roleName) {
|
|
8
16
|
if (!content.includes(OAT_MANAGED_ROLE_HEADER)) {
|
|
@@ -21,7 +21,12 @@ export interface CodexExtensionApplyResult {
|
|
|
21
21
|
failed: number;
|
|
22
22
|
skipped: number;
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
interface CodexMaterializationTargetOptions {
|
|
25
|
+
userConfigDir?: string;
|
|
26
|
+
projectPath?: string | null;
|
|
27
|
+
env?: NodeJS.ProcessEnv;
|
|
28
|
+
}
|
|
29
|
+
export declare function computeCodexProjectExtensionPlan(scopeRoot: string, canonicalEntries: CanonicalEntry[], allowedCanonicalPaths?: string[], options?: CodexMaterializationTargetOptions): Promise<CodexExtensionPlan>;
|
|
25
30
|
export declare function applyCodexProjectExtensionPlan(scopeRoot: string, plan: CodexExtensionPlan): Promise<CodexExtensionApplyResult>;
|
|
26
31
|
export declare function hasCodexExtensionChanges(plan: CodexExtensionPlan): boolean;
|
|
27
32
|
export declare function summarizeCodexExtension(plan: CodexExtensionPlan): {
|
|
@@ -29,4 +34,5 @@ export declare function summarizeCodexExtension(plan: CodexExtensionPlan): {
|
|
|
29
34
|
skipped: number;
|
|
30
35
|
};
|
|
31
36
|
export declare function toCodexExtensionOperations(plan: CodexExtensionPlan): CodexExtensionOperation[];
|
|
37
|
+
export {};
|
|
32
38
|
//# sourceMappingURL=sync-extension.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync-extension.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/sync-extension.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sync-extension.d.ts","sourceRoot":"","sources":["../../../../src/providers/codex/codec/sync-extension.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAUpD,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3E,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,QAAQ,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,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