@open-agent-toolkit/cli 0.1.45 → 0.1.48
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-phase-implementer.md +202 -191
- package/assets/agents/oat-reviewer.md +12 -2
- package/assets/config/dispatch-matrix-recommendation.json +120 -13
- package/assets/docs/cli-utilities/config-and-local-state.md +7 -0
- package/assets/docs/cli-utilities/configuration.md +183 -84
- package/assets/docs/cli-utilities/workflow-gates.md +161 -27
- package/assets/docs/contributing/skills.md +14 -8
- 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 +42 -5
- package/assets/docs/provider-sync/scope-and-surface.md +3 -2
- package/assets/docs/reference/cli-reference.md +3 -1
- package/assets/docs/reference/oat-directory-structure.md +27 -26
- package/assets/docs/workflows/projects/artifacts.md +31 -1
- package/assets/docs/workflows/projects/dispatch-ceiling.md +235 -174
- package/assets/docs/workflows/projects/implementation-execution.md +283 -253
- package/assets/docs/workflows/projects/lifecycle.md +26 -5
- package/assets/docs/workflows/projects/reviews.md +27 -2
- package/assets/migration/pjm-restructure.md +1 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +347 -178
- package/assets/skills/oat-project-import-plan/SKILL.md +173 -16
- package/assets/skills/oat-project-next/SKILL.md +2 -2
- package/assets/skills/oat-project-plan/SKILL.md +122 -92
- package/assets/skills/oat-project-plan-writing/SKILL.md +246 -15
- package/assets/skills/oat-project-quick-start/SKILL.md +156 -94
- package/assets/skills/oat-project-review-provide/SKILL.md +94 -22
- package/dist/commands/config/index.d.ts +2 -2
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +129 -53
- package/dist/commands/doctor/index.d.ts +2 -2
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +102 -31
- package/dist/commands/gate/index.d.ts +7 -1
- package/dist/commands/gate/index.d.ts.map +1 -1
- package/dist/commands/gate/index.js +544 -67
- package/dist/commands/gate/review-verdict.d.ts +16 -0
- package/dist/commands/gate/review-verdict.d.ts.map +1 -1
- package/dist/commands/gate/review-verdict.js +72 -9
- package/dist/commands/project/dispatch-ceiling/index.d.ts.map +1 -1
- package/dist/commands/project/dispatch-ceiling/index.js +586 -23
- 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 +157 -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/shared/frontmatter.d.ts +4 -0
- package/dist/commands/shared/frontmatter.d.ts.map +1 -1
- package/dist/commands/shared/frontmatter.js +23 -0
- package/dist/commands/status/index.d.ts +5 -1
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +10 -4
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +10 -3
- package/dist/commands/sync/sync.types.d.ts +5 -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 +25 -2
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +154 -24
- package/dist/config/resolve.d.ts +8 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +66 -2
- package/dist/engine/index.d.ts +1 -1
- package/dist/engine/index.d.ts.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/engine/scanner.d.ts +1 -0
- package/dist/engine/scanner.d.ts.map +1 -1
- package/dist/engine/scanner.js +17 -1
- package/dist/fs/paths.d.ts +4 -0
- package/dist/fs/paths.d.ts.map +1 -1
- package/dist/fs/paths.js +18 -1
- package/dist/providers/ceiling/registry.d.ts +8 -5
- package/dist/providers/ceiling/registry.d.ts.map +1 -1
- package/dist/providers/ceiling/registry.js +25 -7
- package/dist/providers/codex/codec/catalog.d.ts +14 -0
- package/dist/providers/codex/codec/catalog.d.ts.map +1 -0
- package/dist/providers/codex/codec/catalog.js +21 -0
- 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 +58 -0
- package/dist/providers/codex/codec/shared.d.ts +20 -0
- package/dist/providers/codex/codec/shared.d.ts.map +1 -1
- package/dist/providers/codex/codec/shared.js +107 -6
- 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 +299 -52
- package/dist/providers/identity/availability.d.ts +24 -1
- package/dist/providers/identity/availability.d.ts.map +1 -1
- package/dist/providers/identity/availability.js +253 -19
- package/dist/providers/identity/stamp.d.ts.map +1 -1
- package/dist/providers/identity/stamp.js +4 -0
- package/dist/shared/types.d.ts +1 -0
- package/dist/shared/types.d.ts.map +1 -1
- package/dist/shared/types.js +4 -0
- package/package.json +2 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { dispatchPolicyProviderTargets, } from './dispatch-ceiling-preset.js';
|
|
2
|
+
import { VALID_MANAGED_DISPATCH_POLICIES, } from './oat-config.js';
|
|
3
|
+
const MANAGED_POLICY_DESCRIPTIONS = {
|
|
4
|
+
economy: 'Managed capped policy for lower-cost implementation and review dispatch.',
|
|
5
|
+
balanced: 'Managed capped policy for normal implementation and review dispatch.',
|
|
6
|
+
high: 'Managed capped policy for broad or higher-risk implementation and review dispatch.',
|
|
7
|
+
frontier: 'Managed capped policy for highest-tier implementation and review dispatch.',
|
|
8
|
+
uncapped: 'OAT still manages dispatch selection, but stores no maximum cap. The implementer can choose the preferred model/effort for the task. This is not host default behavior.',
|
|
9
|
+
};
|
|
10
|
+
const MANAGED_POLICY_LABELS = {
|
|
11
|
+
economy: 'Economy',
|
|
12
|
+
balanced: 'Balanced',
|
|
13
|
+
high: 'High',
|
|
14
|
+
frontier: 'Frontier',
|
|
15
|
+
uncapped: 'Uncapped',
|
|
16
|
+
};
|
|
17
|
+
function isCappedManagedPolicy(policy) {
|
|
18
|
+
return policy !== 'uncapped';
|
|
19
|
+
}
|
|
20
|
+
function managedChoice(policy) {
|
|
21
|
+
if (isCappedManagedPolicy(policy)) {
|
|
22
|
+
return {
|
|
23
|
+
value: policy,
|
|
24
|
+
label: MANAGED_POLICY_LABELS[policy],
|
|
25
|
+
kind: 'managed-capped',
|
|
26
|
+
runtimePolicy: true,
|
|
27
|
+
description: MANAGED_POLICY_DESCRIPTIONS[policy],
|
|
28
|
+
policy,
|
|
29
|
+
providers: dispatchPolicyProviderTargets(policy),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
value: policy,
|
|
34
|
+
label: MANAGED_POLICY_LABELS[policy],
|
|
35
|
+
kind: 'managed-uncapped',
|
|
36
|
+
runtimePolicy: true,
|
|
37
|
+
description: MANAGED_POLICY_DESCRIPTIONS[policy],
|
|
38
|
+
policy,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function getDispatchPolicyChoices() {
|
|
42
|
+
return [
|
|
43
|
+
...VALID_MANAGED_DISPATCH_POLICIES.map(managedChoice),
|
|
44
|
+
{
|
|
45
|
+
value: 'inherit',
|
|
46
|
+
label: 'Inherit Host Defaults',
|
|
47
|
+
kind: 'inherit',
|
|
48
|
+
runtimePolicy: true,
|
|
49
|
+
description: 'OAT does not choose model or effort. Subagents use the current host/provider default behavior, such as parent session model, base Codex role defaults, or provider config.',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: 'leave-unresolved',
|
|
53
|
+
label: 'Leave Unresolved',
|
|
54
|
+
kind: 'unresolved',
|
|
55
|
+
runtimePolicy: false,
|
|
56
|
+
description: 'Planning records no policy as a planning/preflight deferral. Implementation preflight must block until a policy is configured or explicitly selected.',
|
|
57
|
+
},
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
export function managedDispatchPolicyValueList(separator = ' | ') {
|
|
61
|
+
return VALID_MANAGED_DISPATCH_POLICIES.join(separator);
|
|
62
|
+
}
|
|
63
|
+
export function dispatchPolicyModeDescription() {
|
|
64
|
+
return [
|
|
65
|
+
'Dispatch policy mode.',
|
|
66
|
+
'"managed" means OAT selects model/effort from workflow.dispatchPolicy.policy.',
|
|
67
|
+
'"inherit" leaves dispatch controls to host/provider defaults.',
|
|
68
|
+
'Resolution: local > shared > user > default.',
|
|
69
|
+
].join(' ');
|
|
70
|
+
}
|
|
71
|
+
export function dispatchPolicyPolicyDescription() {
|
|
72
|
+
return [
|
|
73
|
+
'Managed dispatch policy.',
|
|
74
|
+
'economy, balanced, high, and frontier are capped managed policies.',
|
|
75
|
+
'uncapped keeps OAT-managed preferred selection without provider caps.',
|
|
76
|
+
'inherit leaves dispatch controls to host/provider defaults through workflow.dispatchPolicy.mode.',
|
|
77
|
+
'Setting this key writes workflow.dispatchPolicy.mode=managed.',
|
|
78
|
+
'Resolution: local > shared > user > default.',
|
|
79
|
+
].join(' ');
|
|
80
|
+
}
|
|
81
|
+
function providerSummary(choice) {
|
|
82
|
+
return choice.providers
|
|
83
|
+
? `Codex: ${choice.providers.codex}; Claude: ${choice.providers.claude}`
|
|
84
|
+
: choice.kind === 'managed-uncapped'
|
|
85
|
+
? 'No stored maximum cap'
|
|
86
|
+
: choice.kind === 'inherit'
|
|
87
|
+
? 'Host/provider defaults'
|
|
88
|
+
: 'No runtime policy';
|
|
89
|
+
}
|
|
90
|
+
export function renderDispatchPolicyChoicesMarkdown(choices = getDispatchPolicyChoices()) {
|
|
91
|
+
return [
|
|
92
|
+
'Set the dispatch policy - how OAT should choose subagent model/effort controls.',
|
|
93
|
+
'',
|
|
94
|
+
...choices.map((choice, index) => `${index + 1}. ${choice.label} - ${providerSummary(choice)}. ${choice.description}`),
|
|
95
|
+
].join('\n');
|
|
96
|
+
}
|
|
@@ -20,7 +20,7 @@ export type WorkflowHillCheckpointDefault = 'every' | 'final';
|
|
|
20
20
|
export type WorkflowPostImplementSequence = 'wait' | 'summary' | 'pr' | 'docs-pr';
|
|
21
21
|
export type WorkflowReviewExecutionModel = 'subagent' | 'inline' | 'fresh-session';
|
|
22
22
|
export type WorkflowDesignMode = 'collaborative' | 'selective' | 'draft';
|
|
23
|
-
export type WorkflowCodexDispatchCeiling = 'low' | 'medium' | 'high' | 'xhigh';
|
|
23
|
+
export type WorkflowCodexDispatchCeiling = 'low' | 'medium' | 'high' | 'xhigh' | 'max';
|
|
24
24
|
export type WorkflowClaudeDispatchCeiling = 'haiku' | 'sonnet' | 'opus' | 'fable';
|
|
25
25
|
export type WorkflowDispatchCeilingPreset = 'balanced' | 'maximum' | 'cost-conscious';
|
|
26
26
|
export type WorkflowDispatchPolicyMode = 'managed' | 'inherit';
|
|
@@ -31,9 +31,21 @@ export interface WorkflowDispatchRouteTarget {
|
|
|
31
31
|
model?: string;
|
|
32
32
|
effort?: string;
|
|
33
33
|
}
|
|
34
|
+
export interface DispatchRouteTargetValidation {
|
|
35
|
+
valid: boolean;
|
|
36
|
+
reason?: string;
|
|
37
|
+
}
|
|
34
38
|
export type WorkflowDispatchRouteEntry = string | WorkflowDispatchRouteTarget;
|
|
35
39
|
export type WorkflowDispatchRoute = WorkflowDispatchRouteEntry[];
|
|
36
|
-
export
|
|
40
|
+
export interface WorkflowDispatchFallbackRoute {
|
|
41
|
+
route: WorkflowDispatchRoute;
|
|
42
|
+
}
|
|
43
|
+
export type WorkflowDispatchCandidate = WorkflowDispatchRouteEntry | WorkflowDispatchFallbackRoute;
|
|
44
|
+
export interface WorkflowDispatchCandidateLadder {
|
|
45
|
+
candidates: WorkflowDispatchCandidate[];
|
|
46
|
+
}
|
|
47
|
+
export type WorkflowDispatchLegacyMatrixCell = string | WorkflowDispatchRoute;
|
|
48
|
+
export type WorkflowDispatchMatrixCell = WorkflowDispatchCandidateLadder | WorkflowDispatchLegacyMatrixCell;
|
|
37
49
|
export type WorkflowDispatchProviderValue = string | Partial<Record<WorkflowDispatchMatrixTier, WorkflowDispatchMatrixCell>>;
|
|
38
50
|
export type GateOnFailure = 'block' | 'prompt' | 'warn';
|
|
39
51
|
export type GateAvoid = 'same-family' | 'same-runtime' | 'none';
|
|
@@ -56,9 +68,14 @@ export interface GateConfig {
|
|
|
56
68
|
description?: string;
|
|
57
69
|
maxAttempts?: number;
|
|
58
70
|
}
|
|
71
|
+
export interface ExecTargetInvocation {
|
|
72
|
+
model?: string | 'provider-default';
|
|
73
|
+
reasoningEffort?: string | 'provider-default';
|
|
74
|
+
}
|
|
59
75
|
export interface ExecTarget {
|
|
60
76
|
runtime: string;
|
|
61
77
|
baseCommand: string[];
|
|
78
|
+
invocation?: ExecTargetInvocation;
|
|
62
79
|
models?: string[];
|
|
63
80
|
hostDetectionCommand?: string[];
|
|
64
81
|
availabilityCommand?: string[];
|
|
@@ -90,6 +107,11 @@ export declare const VALID_DISPATCH_POLICY_MODES: readonly WorkflowDispatchPolic
|
|
|
90
107
|
export declare const VALID_MANAGED_DISPATCH_POLICIES: readonly WorkflowManagedDispatchPolicy[];
|
|
91
108
|
export declare const VALID_DISPATCH_MATRIX_TIERS: readonly WorkflowDispatchMatrixTier[];
|
|
92
109
|
export declare const BUILTIN_EXEC_TARGETS: Readonly<Record<string, ExecTarget>>;
|
|
110
|
+
export declare function isCodexMaterializedRouteTarget(provider: string, target: WorkflowDispatchRouteTarget): boolean;
|
|
111
|
+
export declare function validateDispatchRouteTarget(provider: string, target: WorkflowDispatchRouteTarget): DispatchRouteTargetValidation;
|
|
112
|
+
export declare function isWorkflowDispatchFallbackRoute(value: unknown): value is WorkflowDispatchFallbackRoute;
|
|
113
|
+
export declare function isWorkflowDispatchCandidateLadder(value: unknown): value is WorkflowDispatchCandidateLadder;
|
|
114
|
+
export declare function toWorkflowDispatchCandidateLadder(cell: WorkflowDispatchMatrixCell): WorkflowDispatchCandidateLadder;
|
|
93
115
|
export type OatToolsConfig = Partial<Record<'core' | 'ideas' | 'docs' | 'workflows' | 'utility' | 'project-management' | 'research' | 'brainstorm', boolean>>;
|
|
94
116
|
export interface OatConfig {
|
|
95
117
|
version: number;
|
|
@@ -125,6 +147,7 @@ export interface ActiveProjectResolution {
|
|
|
125
147
|
path: string | null;
|
|
126
148
|
status: 'active' | 'missing' | 'unset';
|
|
127
149
|
}
|
|
150
|
+
export declare function normalizeProjectPath(repoRoot: string, pathValue: string | null | undefined): string | null;
|
|
128
151
|
export declare function resolveLocalPaths(config: OatConfig): string[];
|
|
129
152
|
export declare function readOatConfig(repoRoot: string): Promise<OatConfig>;
|
|
130
153
|
export declare function readOatLocalConfig(repoRoot: string): Promise<OatLocalConfig>;
|
|
@@ -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,2BAA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AQ,EAAE,MAAM,GACf,OAAO,CAAC,uBAAuB,CAAC,CAwClC;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,MAAM,EAChB,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAAC,IAAI,CAAC,CAiCf;AAED,wBAAsB,kBAAkB,CACtC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,OAAO,CAAC,IAAI,CAAC,CAYf;AAgCD,wBAAsB,cAAc,CAClC,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,UAAU,CAAC,CAarB;AAED,wBAAsB,eAAe,CACnC,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,wBAAsB,aAAa,CACjC,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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { execSync } from 'node:child_process';
|
|
2
|
-
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { lstat, readFile } from 'node:fs/promises';
|
|
3
3
|
import { basename, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
4
4
|
import { atomicWriteJson, dirExists, fileExists } from '../fs/io.js';
|
|
5
|
-
import { normalizeToPosixPath } from '../fs/paths.js';
|
|
5
|
+
import { normalizeToPosixPath, validateRealPathWithinScope } from '../fs/paths.js';
|
|
6
6
|
import { parseJsonConfig } from './json.js';
|
|
7
7
|
const VALID_HILL_CHECKPOINT_DEFAULTS = ['every', 'final'];
|
|
8
8
|
const VALID_POST_IMPLEMENT_SEQUENCES = ['wait', 'summary', 'pr', 'docs-pr'];
|
|
@@ -16,7 +16,7 @@ const VALID_DESIGN_MODES = [
|
|
|
16
16
|
'selective',
|
|
17
17
|
'draft',
|
|
18
18
|
];
|
|
19
|
-
export const VALID_CODEX_DISPATCH_CEILINGS = ['low', 'medium', 'high', 'xhigh'];
|
|
19
|
+
export const VALID_CODEX_DISPATCH_CEILINGS = ['low', 'medium', 'high', 'xhigh', 'max'];
|
|
20
20
|
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'];
|
|
@@ -31,6 +31,10 @@ export const BUILTIN_EXEC_TARGETS = {
|
|
|
31
31
|
'codex-default': {
|
|
32
32
|
runtime: 'codex',
|
|
33
33
|
baseCommand: ['codex', 'exec'],
|
|
34
|
+
invocation: {
|
|
35
|
+
model: 'provider-default',
|
|
36
|
+
reasoningEffort: 'provider-default',
|
|
37
|
+
},
|
|
34
38
|
hostDetectionCommand: [
|
|
35
39
|
'sh',
|
|
36
40
|
'-c',
|
|
@@ -42,6 +46,10 @@ export const BUILTIN_EXEC_TARGETS = {
|
|
|
42
46
|
'claude-default': {
|
|
43
47
|
runtime: 'claude',
|
|
44
48
|
baseCommand: ['claude', '-p'],
|
|
49
|
+
invocation: {
|
|
50
|
+
model: 'provider-default',
|
|
51
|
+
reasoningEffort: 'provider-default',
|
|
52
|
+
},
|
|
45
53
|
hostDetectionCommand: ['sh', '-c', 'test -n "$CLAUDECODE"'],
|
|
46
54
|
availabilityCommand: ['claude', '--version'],
|
|
47
55
|
priority: 100,
|
|
@@ -49,6 +57,10 @@ export const BUILTIN_EXEC_TARGETS = {
|
|
|
49
57
|
'cursor-default': {
|
|
50
58
|
runtime: 'cursor',
|
|
51
59
|
baseCommand: ['cursor-agent', '-p'],
|
|
60
|
+
invocation: {
|
|
61
|
+
model: 'provider-default',
|
|
62
|
+
reasoningEffort: 'provider-default',
|
|
63
|
+
},
|
|
52
64
|
hostDetectionCommand: ['sh', '-c', 'test -n "$CURSOR_AGENT"'],
|
|
53
65
|
availabilityCommand: [
|
|
54
66
|
'sh',
|
|
@@ -58,6 +70,35 @@ export const BUILTIN_EXEC_TARGETS = {
|
|
|
58
70
|
priority: 70,
|
|
59
71
|
},
|
|
60
72
|
};
|
|
73
|
+
export function isCodexMaterializedRouteTarget(provider, target) {
|
|
74
|
+
return (target.harness ?? provider) === 'codex';
|
|
75
|
+
}
|
|
76
|
+
export function validateDispatchRouteTarget(provider, target) {
|
|
77
|
+
if (!isCodexMaterializedRouteTarget(provider, target)) {
|
|
78
|
+
return { valid: true };
|
|
79
|
+
}
|
|
80
|
+
if (!target.model || !target.effort) {
|
|
81
|
+
return {
|
|
82
|
+
valid: false,
|
|
83
|
+
reason: 'Codex materialized dispatch targets must provide both model and effort.',
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return { valid: true };
|
|
87
|
+
}
|
|
88
|
+
export function isWorkflowDispatchFallbackRoute(value) {
|
|
89
|
+
return isRecord(value) && Array.isArray(value.route);
|
|
90
|
+
}
|
|
91
|
+
export function isWorkflowDispatchCandidateLadder(value) {
|
|
92
|
+
return isRecord(value) && Array.isArray(value.candidates);
|
|
93
|
+
}
|
|
94
|
+
export function toWorkflowDispatchCandidateLadder(cell) {
|
|
95
|
+
if (isWorkflowDispatchCandidateLadder(cell)) {
|
|
96
|
+
return cell;
|
|
97
|
+
}
|
|
98
|
+
return {
|
|
99
|
+
candidates: [Array.isArray(cell) ? { route: cell } : cell],
|
|
100
|
+
};
|
|
101
|
+
}
|
|
61
102
|
function normalizeMaxAttempts(value) {
|
|
62
103
|
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
63
104
|
return 2;
|
|
@@ -143,11 +184,7 @@ function normalizeDispatchRouteTarget(value) {
|
|
|
143
184
|
}
|
|
144
185
|
return Object.keys(target).length > 0 ? target : undefined;
|
|
145
186
|
}
|
|
146
|
-
function
|
|
147
|
-
const bareValue = normalizeProviderBareValue(providerKey, value);
|
|
148
|
-
if (bareValue !== undefined) {
|
|
149
|
-
return bareValue;
|
|
150
|
-
}
|
|
187
|
+
function normalizeDispatchRoute(providerKey, value) {
|
|
151
188
|
if (!Array.isArray(value) || value.length === 0) {
|
|
152
189
|
return undefined;
|
|
153
190
|
}
|
|
@@ -165,6 +202,39 @@ function normalizeDispatchMatrixCell(providerKey, value) {
|
|
|
165
202
|
}
|
|
166
203
|
return route.length > 0 ? route : undefined;
|
|
167
204
|
}
|
|
205
|
+
function normalizeDispatchCandidate(providerKey, value) {
|
|
206
|
+
const bareValue = normalizeProviderBareValue(providerKey, value);
|
|
207
|
+
if (bareValue !== undefined) {
|
|
208
|
+
return bareValue;
|
|
209
|
+
}
|
|
210
|
+
if (isRecord(value) && Object.hasOwn(value, 'route')) {
|
|
211
|
+
const route = normalizeDispatchRoute(providerKey, value.route);
|
|
212
|
+
return route ? { route } : undefined;
|
|
213
|
+
}
|
|
214
|
+
return normalizeDispatchRouteTarget(value);
|
|
215
|
+
}
|
|
216
|
+
function normalizeDispatchMatrixCell(providerKey, value) {
|
|
217
|
+
const bareValue = normalizeProviderBareValue(providerKey, value);
|
|
218
|
+
if (bareValue !== undefined) {
|
|
219
|
+
return { candidates: [bareValue] };
|
|
220
|
+
}
|
|
221
|
+
if (isWorkflowDispatchCandidateLadder(value)) {
|
|
222
|
+
const candidates = [];
|
|
223
|
+
for (const candidate of value.candidates) {
|
|
224
|
+
const normalized = normalizeDispatchCandidate(providerKey, candidate);
|
|
225
|
+
if (normalized !== undefined) {
|
|
226
|
+
candidates.push(normalized);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return candidates.length > 0 ? { candidates } : undefined;
|
|
230
|
+
}
|
|
231
|
+
const directTarget = normalizeDispatchRouteTarget(value);
|
|
232
|
+
if (directTarget !== undefined) {
|
|
233
|
+
return { candidates: [directTarget] };
|
|
234
|
+
}
|
|
235
|
+
const route = normalizeDispatchRoute(providerKey, value);
|
|
236
|
+
return route ? { candidates: [{ route }] } : undefined;
|
|
237
|
+
}
|
|
168
238
|
function normalizeDispatchProviderValue(providerKey, value) {
|
|
169
239
|
const bareValue = normalizeProviderBareValue(providerKey, value);
|
|
170
240
|
if (bareValue !== undefined) {
|
|
@@ -201,6 +271,16 @@ function normalizeExecTarget(value) {
|
|
|
201
271
|
if (baseCommand !== undefined) {
|
|
202
272
|
target.baseCommand = baseCommand;
|
|
203
273
|
}
|
|
274
|
+
if (isRecord(value.invocation)) {
|
|
275
|
+
const model = trimNonEmptyString(value.invocation.model);
|
|
276
|
+
const reasoningEffort = trimNonEmptyString(value.invocation.reasoningEffort);
|
|
277
|
+
if (model !== undefined || reasoningEffort !== undefined) {
|
|
278
|
+
target.invocation = {
|
|
279
|
+
...(model !== undefined ? { model } : {}),
|
|
280
|
+
...(reasoningEffort !== undefined ? { reasoningEffort } : {}),
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
}
|
|
204
284
|
const models = normalizeStringList(value.models);
|
|
205
285
|
if (models !== undefined) {
|
|
206
286
|
target.models = models;
|
|
@@ -390,7 +470,7 @@ function normalizeKnownStrays(value) {
|
|
|
390
470
|
.filter((pathValue) => pathValue !== undefined);
|
|
391
471
|
return normalized.length > 0 ? [...new Set(normalized)].sort() : undefined;
|
|
392
472
|
}
|
|
393
|
-
function normalizeProjectPath(repoRoot, pathValue) {
|
|
473
|
+
export function normalizeProjectPath(repoRoot, pathValue) {
|
|
394
474
|
if (pathValue == null) {
|
|
395
475
|
return null;
|
|
396
476
|
}
|
|
@@ -398,25 +478,42 @@ function normalizeProjectPath(repoRoot, pathValue) {
|
|
|
398
478
|
if (!trimmed) {
|
|
399
479
|
return null;
|
|
400
480
|
}
|
|
401
|
-
if (!isAbsolute(trimmed)) {
|
|
402
|
-
const normalizedRelative = trimPathValue(normalizeToPosixPath(trimmed));
|
|
403
|
-
return normalizedRelative && normalizedRelative !== '.'
|
|
404
|
-
? normalizedRelative
|
|
405
|
-
: null;
|
|
406
|
-
}
|
|
407
481
|
const repoRootResolved = resolve(repoRoot);
|
|
408
|
-
const absoluteResolved = resolve(trimmed);
|
|
409
|
-
const
|
|
410
|
-
|
|
482
|
+
const absoluteResolved = resolve(repoRootResolved, trimmed);
|
|
483
|
+
const relativePath = relative(repoRootResolved, absoluteResolved);
|
|
484
|
+
const isInsideRepo = !isAbsolute(relativePath) &&
|
|
485
|
+
relativePath !== '..' &&
|
|
486
|
+
!relativePath.startsWith(`..${sep}`);
|
|
411
487
|
if (!isInsideRepo) {
|
|
412
488
|
return null;
|
|
413
489
|
}
|
|
414
|
-
const
|
|
415
|
-
const normalizedRelative = trimPathValue(relativePath);
|
|
490
|
+
const normalizedRelative = trimPathValue(normalizeToPosixPath(relativePath));
|
|
416
491
|
return normalizedRelative && normalizedRelative !== '.'
|
|
417
492
|
? normalizedRelative
|
|
418
493
|
: null;
|
|
419
494
|
}
|
|
495
|
+
async function normalizeReadableProjectPath(repoRoot, pathValue) {
|
|
496
|
+
const normalizedPath = normalizeProjectPath(repoRoot, pathValue);
|
|
497
|
+
if (!normalizedPath) {
|
|
498
|
+
return null;
|
|
499
|
+
}
|
|
500
|
+
const absolutePath = join(repoRoot, normalizedPath);
|
|
501
|
+
try {
|
|
502
|
+
await lstat(absolutePath);
|
|
503
|
+
}
|
|
504
|
+
catch (error) {
|
|
505
|
+
return isMissingFileError(error) ? normalizedPath : null;
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
const validated = await validateRealPathWithinScope(absolutePath, repoRoot);
|
|
509
|
+
return (await dirExists(validated.realPath))
|
|
510
|
+
? normalizeProjectPath(validated.realScopeRoot, validated.realPath)
|
|
511
|
+
: null;
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
}
|
|
420
517
|
function normalizeOatConfig(parsed) {
|
|
421
518
|
const next = { ...DEFAULT_OAT_CONFIG };
|
|
422
519
|
if (!isRecord(parsed)) {
|
|
@@ -583,7 +680,11 @@ export async function readOatLocalConfig(repoRoot) {
|
|
|
583
680
|
const configPath = getLocalConfigPath(repoRoot);
|
|
584
681
|
try {
|
|
585
682
|
const raw = await readFile(configPath, 'utf8');
|
|
586
|
-
|
|
683
|
+
const normalized = normalizeOatLocalConfig(repoRoot, parseJsonConfig(raw, configPath));
|
|
684
|
+
if (normalized.activeProject !== undefined) {
|
|
685
|
+
normalized.activeProject = await normalizeReadableProjectPath(repoRoot, normalized.activeProject);
|
|
686
|
+
}
|
|
687
|
+
return normalized;
|
|
587
688
|
}
|
|
588
689
|
catch (error) {
|
|
589
690
|
if (isMissingFileError(error)) {
|
|
@@ -608,12 +709,29 @@ export async function resolveActiveProject(repoRoot) {
|
|
|
608
709
|
if (!projectPath) {
|
|
609
710
|
return { name: null, path: null, status: 'unset' };
|
|
610
711
|
}
|
|
611
|
-
|
|
712
|
+
let resolvedProjectPath = projectPath;
|
|
713
|
+
let absoluteProjectPath = join(repoRoot, projectPath);
|
|
714
|
+
try {
|
|
715
|
+
const validated = await validateRealPathWithinScope(absoluteProjectPath, repoRoot);
|
|
716
|
+
const canonicalProjectPath = normalizeProjectPath(validated.realScopeRoot, validated.realPath);
|
|
717
|
+
if (!canonicalProjectPath) {
|
|
718
|
+
throw new Error('Project path resolves to the repository root.');
|
|
719
|
+
}
|
|
720
|
+
resolvedProjectPath = canonicalProjectPath;
|
|
721
|
+
absoluteProjectPath = validated.realPath;
|
|
722
|
+
}
|
|
723
|
+
catch {
|
|
724
|
+
return {
|
|
725
|
+
name: basename(absoluteProjectPath),
|
|
726
|
+
path: projectPath,
|
|
727
|
+
status: 'missing',
|
|
728
|
+
};
|
|
729
|
+
}
|
|
612
730
|
const statePath = join(absoluteProjectPath, 'state.md');
|
|
613
731
|
const isValid = (await dirExists(absoluteProjectPath)) && (await fileExists(statePath));
|
|
614
732
|
return {
|
|
615
733
|
name: basename(absoluteProjectPath),
|
|
616
|
-
path:
|
|
734
|
+
path: resolvedProjectPath,
|
|
617
735
|
status: isValid ? 'active' : 'missing',
|
|
618
736
|
};
|
|
619
737
|
}
|
|
@@ -622,10 +740,22 @@ export async function setActiveProject(repoRoot, projectRelativePath) {
|
|
|
622
740
|
if (!normalizedPath) {
|
|
623
741
|
throw new Error(`Active project path must be repo-relative or inside repo root: ${projectRelativePath}`);
|
|
624
742
|
}
|
|
743
|
+
let canonicalPath;
|
|
744
|
+
try {
|
|
745
|
+
const validated = await validateRealPathWithinScope(join(repoRoot, normalizedPath), repoRoot);
|
|
746
|
+
const canonicalProjectPath = normalizeProjectPath(validated.realScopeRoot, validated.realPath);
|
|
747
|
+
if (!canonicalProjectPath || !(await dirExists(validated.realPath))) {
|
|
748
|
+
throw new Error('Project directory is missing.');
|
|
749
|
+
}
|
|
750
|
+
canonicalPath = canonicalProjectPath;
|
|
751
|
+
}
|
|
752
|
+
catch {
|
|
753
|
+
throw new Error(`Active project path must be repo-relative or inside repo root: ${projectRelativePath}`);
|
|
754
|
+
}
|
|
625
755
|
const localConfig = await readOatLocalConfig(repoRoot);
|
|
626
756
|
await writeOatLocalConfig(repoRoot, {
|
|
627
757
|
...localConfig,
|
|
628
|
-
activeProject:
|
|
758
|
+
activeProject: canonicalPath,
|
|
629
759
|
});
|
|
630
760
|
}
|
|
631
761
|
export async function clearActiveProject(repoRoot, options) {
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -18,4 +18,12 @@ export interface ResolveEffectiveConfigDependencies {
|
|
|
18
18
|
export declare function resolveEffectiveConfig(repoRoot: string, userConfigDir: string, env?: NodeJS.ProcessEnv, overrides?: Partial<ResolveEffectiveConfigDependencies>): Promise<ResolvedConfig>;
|
|
19
19
|
export declare function resolveGate(effective: ResolvedConfig, skillName: string): GateConfig | null;
|
|
20
20
|
export declare function resolveExecTargets(effective: ResolvedConfig): Record<string, ExecTarget>;
|
|
21
|
+
export type ExecTargetOrigin = 'builtin' | 'user' | 'shared' | 'local';
|
|
22
|
+
export interface ResolvedExecTargetView {
|
|
23
|
+
target: ExecTarget;
|
|
24
|
+
origin: ExecTargetOrigin;
|
|
25
|
+
explicitlyConfigured: boolean;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function resolveExecTargetViews(effective: ResolvedConfig): Record<string, ResolvedExecTargetView>;
|
|
21
29
|
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/config/resolve.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,UAAU,EACf,KAAK,UAAU,EACf,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;AAmFD,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;AAED,wBAAgB,WAAW,CACzB,SAAS,EAAE,cAAc,EACzB,SAAS,EAAE,MAAM,GAChB,UAAU,GAAG,IAAI,CAcnB;AAED,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,cAAc,GACxB,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAY5B;AAED,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,gBAAgB,CAAC;IACzB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,cAAc,GACxB,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAoDxC"}
|
package/dist/config/resolve.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BUILTIN_EXEC_TARGETS, readOatConfig, readOatLocalConfig, readUserConfig, } from './oat-config.js';
|
|
1
|
+
import { BUILTIN_EXEC_TARGETS, isWorkflowDispatchCandidateLadder, readOatConfig, readOatLocalConfig, readUserConfig, } from './oat-config.js';
|
|
2
2
|
const DEFAULT_DEPENDENCIES = {
|
|
3
3
|
readOatConfig,
|
|
4
4
|
readOatLocalConfig,
|
|
@@ -167,6 +167,53 @@ export function resolveExecTargets(effective) {
|
|
|
167
167
|
}
|
|
168
168
|
return targets;
|
|
169
169
|
}
|
|
170
|
+
export function resolveExecTargetViews(effective) {
|
|
171
|
+
const targets = cloneExecTargetRegistry(BUILTIN_EXEC_TARGETS);
|
|
172
|
+
const views = Object.fromEntries(Object.entries(targets).map(([id, target]) => [
|
|
173
|
+
id,
|
|
174
|
+
{
|
|
175
|
+
target: cloneExecTarget(target),
|
|
176
|
+
origin: 'builtin',
|
|
177
|
+
explicitlyConfigured: false,
|
|
178
|
+
enabled: true,
|
|
179
|
+
},
|
|
180
|
+
]));
|
|
181
|
+
for (const [origin, layer] of [
|
|
182
|
+
['user', effective.user.workflow?.gates?.execTargets],
|
|
183
|
+
['shared', effective.shared.workflow?.gates?.execTargets],
|
|
184
|
+
['local', effective.local.workflow?.gates?.execTargets],
|
|
185
|
+
]) {
|
|
186
|
+
if (!layer) {
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
for (const [id, override] of Object.entries(layer)) {
|
|
190
|
+
if (override === null) {
|
|
191
|
+
const target = targets[id] ?? views[id]?.target;
|
|
192
|
+
delete targets[id];
|
|
193
|
+
if (target) {
|
|
194
|
+
views[id] = {
|
|
195
|
+
target: cloneExecTarget(target),
|
|
196
|
+
origin,
|
|
197
|
+
explicitlyConfigured: true,
|
|
198
|
+
enabled: false,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
mergeExecTargetLayer(targets, { [id]: override });
|
|
204
|
+
const target = targets[id];
|
|
205
|
+
if (target) {
|
|
206
|
+
views[id] = {
|
|
207
|
+
target: cloneExecTarget(target),
|
|
208
|
+
origin,
|
|
209
|
+
explicitlyConfigured: true,
|
|
210
|
+
enabled: true,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return views;
|
|
216
|
+
}
|
|
170
217
|
function mergeExecTargetLayer(targets, layer) {
|
|
171
218
|
if (!layer) {
|
|
172
219
|
return;
|
|
@@ -181,6 +228,7 @@ function mergeExecTargetLayer(targets, layer) {
|
|
|
181
228
|
targets[id] = cloneExecTarget({
|
|
182
229
|
runtime: override.runtime ?? existing.runtime,
|
|
183
230
|
baseCommand: override.baseCommand ?? existing.baseCommand,
|
|
231
|
+
invocation: mergeExecTargetInvocation(existing.invocation, override.invocation),
|
|
184
232
|
models: override.models ?? existing.models,
|
|
185
233
|
hostDetectionCommand: override.hostDetectionCommand ?? existing.hostDetectionCommand,
|
|
186
234
|
availabilityCommand: override.availabilityCommand ?? existing.availabilityCommand,
|
|
@@ -209,6 +257,9 @@ function cloneExecTarget(target) {
|
|
|
209
257
|
if (target.hostDetectionCommand) {
|
|
210
258
|
next.hostDetectionCommand = [...target.hostDetectionCommand];
|
|
211
259
|
}
|
|
260
|
+
if (target.invocation) {
|
|
261
|
+
next.invocation = { ...target.invocation };
|
|
262
|
+
}
|
|
212
263
|
if (target.availabilityCommand) {
|
|
213
264
|
next.availabilityCommand = [...target.availabilityCommand];
|
|
214
265
|
}
|
|
@@ -229,6 +280,9 @@ function toCompleteExecTarget(target) {
|
|
|
229
280
|
? target.priority
|
|
230
281
|
: 0,
|
|
231
282
|
};
|
|
283
|
+
if (target.invocation) {
|
|
284
|
+
completeTarget.invocation = { ...target.invocation };
|
|
285
|
+
}
|
|
232
286
|
if (isValidArgv(target.hostDetectionCommand)) {
|
|
233
287
|
completeTarget.hostDetectionCommand = [...target.hostDetectionCommand];
|
|
234
288
|
}
|
|
@@ -240,6 +294,15 @@ function toCompleteExecTarget(target) {
|
|
|
240
294
|
}
|
|
241
295
|
return completeTarget;
|
|
242
296
|
}
|
|
297
|
+
function mergeExecTargetInvocation(existing, override) {
|
|
298
|
+
if (!existing && !override) {
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
301
|
+
return {
|
|
302
|
+
...existing,
|
|
303
|
+
...override,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
243
306
|
function isValidStringList(value) {
|
|
244
307
|
return (Array.isArray(value) &&
|
|
245
308
|
value.length > 0 &&
|
|
@@ -264,7 +327,8 @@ function flattenConfig(value, prefix = '') {
|
|
|
264
327
|
continue;
|
|
265
328
|
}
|
|
266
329
|
const nextKey = prefix ? `${prefix}.${key}` : key;
|
|
267
|
-
if (isRecord(nestedValue)
|
|
330
|
+
if (isRecord(nestedValue) &&
|
|
331
|
+
!isWorkflowDispatchCandidateLadder(nestedValue)) {
|
|
268
332
|
Object.assign(flattened, flattenConfig(nestedValue, nextKey));
|
|
269
333
|
continue;
|
|
270
334
|
}
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export { configureLocalHooksPath, getHookInstallInfo, HOOK_DRIFT_WARNING, HOOK_M
|
|
|
5
5
|
export type { HookInstallInfo, HookStatus } from './hook.js';
|
|
6
6
|
export { hasMarker, insertMarker, OAT_DIRECTORY_SENTINEL, OAT_MARKER_PREFIX, writeDirectorySentinel, } from './markers.js';
|
|
7
7
|
export type { CanonicalEntry } from './scanner.js';
|
|
8
|
-
export { scanCanonical } from './scanner.js';
|
|
8
|
+
export { scanBundledManagedCodexAgents, scanCanonical } from './scanner.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,YAAY,EACZ,aAAa,GACd,MAAM,QAAQ,CAAC;AAChB,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EACL,SAAS,EACT,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,6BAA6B,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/engine/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { SYNC_OPERATION_TYPES, } from './engine.types.js';
|
|
|
3
3
|
export { executeSyncPlan } from './execute-plan.js';
|
|
4
4
|
export { configureLocalHooksPath, getHookInstallInfo, HOOK_DRIFT_WARNING, HOOK_MARKER_END, HOOK_MARKER_START, HOOK_STRAY_INFO, installHook, isHookInstalled, REPO_GITHOOKS_PATH, runHookCheck, uninstallHook, } from './hook.js';
|
|
5
5
|
export { hasMarker, insertMarker, OAT_DIRECTORY_SENTINEL, OAT_MARKER_PREFIX, writeDirectorySentinel, } from './markers.js';
|
|
6
|
-
export { scanCanonical } from './scanner.js';
|
|
6
|
+
export { scanBundledManagedCodexAgents, scanCanonical } from './scanner.js';
|
package/dist/engine/scanner.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface CanonicalEntry {
|
|
|
6
6
|
canonicalPath: string;
|
|
7
7
|
isFile: boolean;
|
|
8
8
|
}
|
|
9
|
+
export declare function scanBundledManagedCodexAgents(): Promise<CanonicalEntry[]>;
|
|
9
10
|
export declare function scanCanonical(basePath: string, scope: ConcreteScope): Promise<CanonicalEntry[]>;
|
|
10
11
|
export {};
|
|
11
12
|
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/engine/scanner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../src/engine/scanner.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,KAAK,EACX,MAAM,eAAe,CAAC;AAEvB,KAAK,aAAa,GAAG,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAE3C,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,OAAO,CAAC;CACjB;AA0DD,wBAAsB,6BAA6B,IAAI,OAAO,CAC5D,cAAc,EAAE,CACjB,CAsBA;AAED,wBAAsB,aAAa,CACjC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CA2B3B"}
|