@open-agent-toolkit/cli 0.1.33 → 0.1.35
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/config-and-local-state.md +20 -0
- package/assets/docs/cli-utilities/configuration.md +17 -6
- package/assets/docs/cli-utilities/index.md +5 -0
- package/assets/docs/cli-utilities/tool-packs.md +1 -1
- package/assets/docs/cli-utilities/workflow-gates.md +163 -0
- package/assets/docs/contributing/design-principles.md +1 -1
- package/assets/docs/contributing/skills.md +25 -0
- package/assets/docs/reference/cli-reference.md +3 -0
- package/assets/docs/reference/file-locations.md +1 -0
- package/assets/docs/reference/oat-directory-structure.md +3 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-project-implement/SKILL.md +23 -1
- package/assets/skills/oat-project-plan/SKILL.md +23 -1
- package/dist/app/create-program.d.ts.map +1 -1
- package/dist/app/create-program.js +3 -6
- package/dist/app/help-config.d.ts +12 -0
- package/dist/app/help-config.d.ts.map +1 -0
- package/dist/app/help-config.js +15 -0
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +2 -1
- package/dist/commands/gate/index.d.ts +35 -0
- package/dist/commands/gate/index.d.ts.map +1 -0
- package/dist/commands/gate/index.js +500 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/init/index.d.ts.map +1 -1
- package/dist/commands/init/index.js +2 -1
- package/dist/commands/init/tools/brainstorm/index.d.ts.map +1 -1
- package/dist/commands/init/tools/brainstorm/index.js +2 -1
- package/dist/commands/init/tools/core/index.d.ts.map +1 -1
- package/dist/commands/init/tools/core/index.js +18 -0
- package/dist/commands/init/tools/docs/index.d.ts.map +1 -1
- package/dist/commands/init/tools/docs/index.js +2 -1
- package/dist/commands/init/tools/ideas/index.d.ts.map +1 -1
- package/dist/commands/init/tools/ideas/index.js +2 -1
- package/dist/commands/init/tools/project-management/index.d.ts.map +1 -1
- package/dist/commands/init/tools/project-management/index.js +19 -0
- package/dist/commands/init/tools/research/index.d.ts.map +1 -1
- package/dist/commands/init/tools/research/index.js +2 -1
- package/dist/commands/init/tools/utility/index.d.ts.map +1 -1
- package/dist/commands/init/tools/utility/index.js +2 -1
- package/dist/commands/init/tools/workflows/index.d.ts.map +1 -1
- package/dist/commands/init/tools/workflows/index.js +2 -1
- package/dist/commands/internal/validate-oat-skills.d.ts +3 -0
- package/dist/commands/internal/validate-oat-skills.d.ts.map +1 -1
- package/dist/commands/internal/validate-oat-skills.js +44 -2
- package/dist/commands/project/split/evaluate-signals.d.ts.map +1 -1
- package/dist/commands/project/split/evaluate-signals.js +11 -1
- package/dist/commands/project/split/run.d.ts.map +1 -1
- package/dist/commands/project/split/run.js +14 -0
- package/dist/commands/project/split/validate-plan.d.ts.map +1 -1
- package/dist/commands/project/split/validate-plan.js +30 -6
- package/dist/commands/project/validate-plan/index.d.ts +6 -1
- package/dist/commands/project/validate-plan/index.d.ts.map +1 -1
- package/dist/commands/project/validate-plan/index.js +36 -9
- package/dist/commands/providers/inspect/inspect.d.ts.map +1 -1
- package/dist/commands/providers/inspect/inspect.js +2 -1
- package/dist/commands/providers/list/list.d.ts.map +1 -1
- package/dist/commands/providers/list/list.js +2 -1
- package/dist/commands/providers/set/index.d.ts.map +1 -1
- package/dist/commands/providers/set/index.js +6 -2
- package/dist/commands/remove/skill/remove-skill.d.ts.map +1 -1
- package/dist/commands/remove/skill/remove-skill.js +2 -1
- package/dist/commands/remove/skills/remove-skills.d.ts.map +1 -1
- package/dist/commands/remove/skills/remove-skills.js +2 -1
- package/dist/commands/repo/pr-comments/triage-collection/triage-comments.d.ts +1 -0
- package/dist/commands/repo/pr-comments/triage-collection/triage-comments.d.ts.map +1 -1
- package/dist/commands/repo/pr-comments/triage-collection/triage-comments.js +25 -13
- package/dist/commands/shared/scope-option.d.ts +21 -0
- package/dist/commands/shared/scope-option.d.ts.map +1 -0
- package/dist/commands/shared/scope-option.js +24 -0
- package/dist/commands/status/index.d.ts.map +1 -1
- package/dist/commands/status/index.js +2 -1
- package/dist/commands/sync/index.d.ts.map +1 -1
- package/dist/commands/sync/index.js +2 -1
- package/dist/commands/tools/info/index.d.ts.map +1 -1
- package/dist/commands/tools/info/index.js +2 -1
- package/dist/commands/tools/install/index.d.ts.map +1 -1
- package/dist/commands/tools/install/index.js +2 -0
- package/dist/commands/tools/list/index.d.ts.map +1 -1
- package/dist/commands/tools/list/index.js +2 -1
- package/dist/commands/tools/outdated/index.d.ts.map +1 -1
- package/dist/commands/tools/outdated/index.js +2 -1
- package/dist/commands/tools/remove/index.d.ts.map +1 -1
- package/dist/commands/tools/remove/index.js +2 -1
- package/dist/commands/tools/update/index.d.ts.map +1 -1
- package/dist/commands/tools/update/index.js +6 -2
- package/dist/config/oat-config.d.ts +22 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +136 -0
- package/dist/config/resolve.d.ts +3 -1
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +103 -1
- package/dist/validation/skills.d.ts +2 -0
- package/dist/validation/skills.d.ts.map +1 -1
- package/dist/validation/skills.js +39 -0
- package/package.json +2 -2
|
@@ -8,22 +8,44 @@ export const defaultTriageDependencies = {
|
|
|
8
8
|
const content = await readFile(path, 'utf8');
|
|
9
9
|
return JSON.parse(content);
|
|
10
10
|
},
|
|
11
|
+
fileExists,
|
|
11
12
|
};
|
|
12
13
|
export async function runTriageComments(context, options, deps = defaultTriageDependencies) {
|
|
13
14
|
const { logger } = context;
|
|
14
15
|
const { inputDir, outputDir, month } = options;
|
|
15
16
|
const inputPath = join(inputDir, `${month}.json`);
|
|
16
|
-
if (!(await fileExists(inputPath))) {
|
|
17
|
+
if (!(await deps.fileExists(inputPath))) {
|
|
17
18
|
throw new CliError(`Collection file not found: ${inputPath}`);
|
|
18
19
|
}
|
|
19
20
|
const chunk = await deps.readJsonFile(inputPath);
|
|
20
21
|
if (chunk.comments.length === 0) {
|
|
21
|
-
|
|
22
|
+
if (context.json) {
|
|
23
|
+
logger.json({ status: 'ok', month, total: 0, comments: [] });
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
logger.warn(`No comments in ${month} to triage.`);
|
|
27
|
+
}
|
|
22
28
|
return;
|
|
23
29
|
}
|
|
30
|
+
// Non-interactive path: emit collection state without prompting.
|
|
31
|
+
// This is the code path reached when --json is set or when running
|
|
32
|
+
// outside a TTY. Interactive triage is reserved for TTY sessions only.
|
|
24
33
|
if (!context.interactive) {
|
|
25
|
-
|
|
34
|
+
if (context.json) {
|
|
35
|
+
logger.json({
|
|
36
|
+
status: 'ok',
|
|
37
|
+
month,
|
|
38
|
+
total: chunk.comments.length,
|
|
39
|
+
comments: chunk.comments,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
logger.info(`Collection ${month}: ${chunk.comments.length} comment(s) pending triage.`);
|
|
44
|
+
logger.info('Re-run in an interactive terminal to triage, or pass --json to retrieve the collection state.');
|
|
45
|
+
}
|
|
46
|
+
return;
|
|
26
47
|
}
|
|
48
|
+
// Interactive path: prompt for each comment (TTY sessions only).
|
|
27
49
|
logger.info(`Triaging ${chunk.comments.length} comments from ${month}...`);
|
|
28
50
|
logger.info('For each comment, enter [k]eep or [d]iscard (default: keep).\n');
|
|
29
51
|
const kept = [];
|
|
@@ -51,16 +73,6 @@ export async function runTriageComments(context, options, deps = defaultTriageDe
|
|
|
51
73
|
const outputPath = join(outputDir, `${month}.triaged.json`);
|
|
52
74
|
await writeFile(outputPath, `${JSON.stringify(outputChunk, null, 2)}\n`, 'utf8');
|
|
53
75
|
logger.success(`Triage complete: kept ${kept.length}/${chunk.comments.length} comments → ${outputPath}`);
|
|
54
|
-
if (context.json) {
|
|
55
|
-
logger.json({
|
|
56
|
-
status: 'ok',
|
|
57
|
-
month,
|
|
58
|
-
total: chunk.comments.length,
|
|
59
|
-
kept: kept.length,
|
|
60
|
-
discarded: chunk.comments.length - kept.length,
|
|
61
|
-
outputPath,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
76
|
}
|
|
65
77
|
function printCommentSummary(comment) {
|
|
66
78
|
const lines = [
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Command } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a local `--scope <scope>` option to the given command.
|
|
4
|
+
*
|
|
5
|
+
* `--scope` is deliberately NOT a global option because only a subset of
|
|
6
|
+
* commands consume it. Attaching it here (as a per-command option) means it
|
|
7
|
+
* appears in the command's own Options section and is rejected with an
|
|
8
|
+
* "unknown option" error on commands that do not call this helper.
|
|
9
|
+
*
|
|
10
|
+
* `readGlobalOptions` uses `command.optsWithGlobals()` which merges local and
|
|
11
|
+
* parent options, so `context.scope` is populated correctly with no changes to
|
|
12
|
+
* `buildCommandContext`.
|
|
13
|
+
*
|
|
14
|
+
* @param cmd - The Commander command to add the option to.
|
|
15
|
+
* @param defaultScope - The default scope value. Defaults to `'all'` for most
|
|
16
|
+
* commands. Use `'project'` for commands that only support project scope
|
|
17
|
+
* (e.g. `providers set`) so bare invocations succeed without requiring an
|
|
18
|
+
* explicit `--scope project` flag.
|
|
19
|
+
*/
|
|
20
|
+
export declare function withScopeOption(cmd: Command, defaultScope?: 'project' | 'user' | 'all'): Command;
|
|
21
|
+
//# sourceMappingURL=scope-option.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-option.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/scope-option.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGzC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,OAAO,EACZ,YAAY,GAAE,SAAS,GAAG,MAAM,GAAG,KAAa,GAC/C,OAAO,CAMT"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Option } from 'commander';
|
|
2
|
+
/**
|
|
3
|
+
* Adds a local `--scope <scope>` option to the given command.
|
|
4
|
+
*
|
|
5
|
+
* `--scope` is deliberately NOT a global option because only a subset of
|
|
6
|
+
* commands consume it. Attaching it here (as a per-command option) means it
|
|
7
|
+
* appears in the command's own Options section and is rejected with an
|
|
8
|
+
* "unknown option" error on commands that do not call this helper.
|
|
9
|
+
*
|
|
10
|
+
* `readGlobalOptions` uses `command.optsWithGlobals()` which merges local and
|
|
11
|
+
* parent options, so `context.scope` is populated correctly with no changes to
|
|
12
|
+
* `buildCommandContext`.
|
|
13
|
+
*
|
|
14
|
+
* @param cmd - The Commander command to add the option to.
|
|
15
|
+
* @param defaultScope - The default scope value. Defaults to `'all'` for most
|
|
16
|
+
* commands. Use `'project'` for commands that only support project scope
|
|
17
|
+
* (e.g. `providers set`) so bare invocations succeed without requiring an
|
|
18
|
+
* explicit `--scope project` flag.
|
|
19
|
+
*/
|
|
20
|
+
export function withScopeOption(cmd, defaultScope = 'all') {
|
|
21
|
+
return cmd.addOption(new Option('--scope <scope>', 'Limit execution scope')
|
|
22
|
+
.choices(['project', 'user', 'all'])
|
|
23
|
+
.default(defaultScope));
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/status/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/status/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAK9B,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAEnB,MAAM,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;KAAE,KACrC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACvB,iBAAiB,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,MAAM,CAAC;CACvD;AAED,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,YAAY,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AAgfD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,OAAO,CAoBT"}
|
|
@@ -2,6 +2,7 @@ import { basename, join, relative } from 'node:path';
|
|
|
2
2
|
import { buildCommandContext, } from '../../app/command-context.js';
|
|
3
3
|
import { adoptStrayToCanonical, isAdoptionConflictError, } from '../shared/adopt-stray.js';
|
|
4
4
|
import { detectCodexRoleStrays, regenerateCodexAfterAdoption, } from '../shared/codex-strays.js';
|
|
5
|
+
import { withScopeOption } from '../shared/scope-option.js';
|
|
5
6
|
import { confirmAction, selectManyWithAbort, } from '../shared/shared.prompts.js';
|
|
6
7
|
import { readGlobalOptions, resolveConcreteScopes, } from '../shared/shared.utils.js';
|
|
7
8
|
import { detectDrift, detectStrays, } from '../../drift/index.js';
|
|
@@ -350,7 +351,7 @@ export function createStatusCommand(overrides = {}) {
|
|
|
350
351
|
...DEFAULT_DEPENDENCIES,
|
|
351
352
|
...overrides,
|
|
352
353
|
};
|
|
353
|
-
return new Command('status')
|
|
354
|
+
return withScopeOption(new Command('status'))
|
|
354
355
|
.description('Report provider sync and drift status')
|
|
355
356
|
.option('--hook', 'Emit a minimal pre-commit message: warn on managed drift, info on strays')
|
|
356
357
|
.action(async (options, command) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,KAAK,EAEV,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAoTtB,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,uBAAuB,CAAM,GAC/C,OAAO,CA6BT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { buildCommandContext } from '../../app/command-context.js';
|
|
3
3
|
import { PROVIDER_CONFIG_REMEDIATION } from '../shared/messages.js';
|
|
4
|
+
import { withScopeOption } from '../shared/scope-option.js';
|
|
4
5
|
import { selectManyWithAbort, } from '../shared/shared.prompts.js';
|
|
5
6
|
import { readGlobalOptions, resolveConcreteScopes, } from '../shared/shared.utils.js';
|
|
6
7
|
import { DEFAULT_SYNC_CONFIG, loadSyncConfig, saveSyncConfig, } from '../../config/index.js';
|
|
@@ -229,7 +230,7 @@ export function createSyncCommand(overrides = {}) {
|
|
|
229
230
|
...defaultDependencies(),
|
|
230
231
|
...overrides,
|
|
231
232
|
};
|
|
232
|
-
return new Command('sync')
|
|
233
|
+
return withScopeOption(new Command('sync'))
|
|
233
234
|
.description('Sync canonical content to provider views')
|
|
234
235
|
.option('--dry-run', 'Preview sync changes without applying')
|
|
235
236
|
.addOption(new Option('--install-canonical <path>', 'Internal install sync filter')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/info/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/info/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,aAAa,CAAC;AA2DrB,wBAAgB,sBAAsB,CACpC,YAAY,GAAE,oBAA0C,GACvD,OAAO,CAYT"}
|
|
@@ -2,6 +2,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
4
4
|
import { getFrontmatterBlock, getFrontmatterField, parseFrontmatterField, } from '../../shared/frontmatter.js';
|
|
5
|
+
import { withScopeOption } from '../../shared/scope-option.js';
|
|
5
6
|
import { readGlobalOptions } from '../../shared/shared.utils.js';
|
|
6
7
|
import { scanTools } from '../../tools/shared/scan-tools.js';
|
|
7
8
|
import { resolveAssetsRoot } from '../../../fs/assets.js';
|
|
@@ -60,7 +61,7 @@ const defaultDependencies = {
|
|
|
60
61
|
getToolDetail,
|
|
61
62
|
};
|
|
62
63
|
export function createToolsInfoCommand(dependencies = defaultDependencies) {
|
|
63
|
-
return new Command('info')
|
|
64
|
+
return withScopeOption(new Command('info'))
|
|
64
65
|
.description('Show details for an installed tool')
|
|
65
66
|
.argument('<name>', 'Tool name')
|
|
66
67
|
.action(async (name, _opts, command) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/install/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/install/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBzC,wBAAgB,yBAAyB,CACvC,gBAAgB,GAAE,oBAA8C,EAChE,aAAa,GAAE,OAAO,CAAC,qBAAqB,CAAM,EAClD,iBAAiB,CAAC,EAAE,MAAM,OAAO,GAChC,OAAO,CAqCT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
2
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
3
3
|
import { consumeInitToolsRunMetadata, createInitToolsCommand, } from '../../init/tools/index.js';
|
|
4
|
+
import { withScopeOption } from '../../shared/scope-option.js';
|
|
4
5
|
import { readGlobalOptions, resolveConcreteScopes, } from '../../shared/shared.utils.js';
|
|
5
6
|
import { autoSync, } from '../../tools/shared/auto-sync.js';
|
|
6
7
|
import { getInstalledCanonicalPaths as getInstallSyncCanonicalPaths } from '../../tools/shared/install-sync-context.js';
|
|
@@ -31,6 +32,7 @@ export function createToolsInstallCommand(syncDependencies = defaultSyncDependen
|
|
|
31
32
|
? createInitToolsCommand(initOverrides)
|
|
32
33
|
: createBaseCommand();
|
|
33
34
|
cmd.name('install');
|
|
35
|
+
withScopeOption(cmd);
|
|
34
36
|
cmd.option('--no-sync', 'Skip auto-sync after install');
|
|
35
37
|
cmd.hook('postAction', async (thisCommand, actionCommand) => {
|
|
36
38
|
if (process.exitCode !== 0 && process.exitCode !== undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/list/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/list/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,qBAAqB,EAAgB,MAAM,cAAc,CAAC;AAWxE,wBAAgB,sBAAsB,CACpC,YAAY,GAAE,qBAA2C,GACxD,OAAO,CAQT"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
2
|
+
import { withScopeOption } from '../../shared/scope-option.js';
|
|
2
3
|
import { readGlobalOptions } from '../../shared/shared.utils.js';
|
|
3
4
|
import { scanTools } from '../../tools/shared/scan-tools.js';
|
|
4
5
|
import { resolveAssetsRoot } from '../../../fs/assets.js';
|
|
@@ -15,7 +16,7 @@ const defaultDependencies = {
|
|
|
15
16
|
resolveAssetsRoot,
|
|
16
17
|
};
|
|
17
18
|
export function createToolsListCommand(dependencies = defaultDependencies) {
|
|
18
|
-
return new Command('list')
|
|
19
|
+
return withScopeOption(new Command('list'))
|
|
19
20
|
.description('List installed tools with version and status')
|
|
20
21
|
.action(async (_opts, command) => {
|
|
21
22
|
const globalOptions = readGlobalOptions(command);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/outdated/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/outdated/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,kBAAkB,CAAC;AAW1B,wBAAgB,0BAA0B,CACxC,YAAY,GAAE,yBAA+C,GAC5D,OAAO,CAQT"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
2
|
+
import { withScopeOption } from '../../shared/scope-option.js';
|
|
2
3
|
import { readGlobalOptions } from '../../shared/shared.utils.js';
|
|
3
4
|
import { scanTools } from '../../tools/shared/scan-tools.js';
|
|
4
5
|
import { resolveAssetsRoot } from '../../../fs/assets.js';
|
|
@@ -15,7 +16,7 @@ const defaultDependencies = {
|
|
|
15
16
|
resolveAssetsRoot,
|
|
16
17
|
};
|
|
17
18
|
export function createToolsOutdatedCommand(dependencies = defaultDependencies) {
|
|
18
|
-
return new Command('outdated')
|
|
19
|
+
return withScopeOption(new Command('outdated'))
|
|
19
20
|
.description('Show tools with available updates')
|
|
20
21
|
.action(async (_opts, command) => {
|
|
21
22
|
const globalOptions = readGlobalOptions(command);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/remove/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/remove/index.ts"],"names":[],"mappings":"AASA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAM1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,gBAAgB,CAAC;AA4CxB,wBAAgB,wBAAwB,CACtC,YAAY,GAAE,uBAA6C,EAC3D,gBAAgB,GAAE,oBAA8C,GAC/D,OAAO,CAwGT"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { execFile } from 'node:child_process';
|
|
2
2
|
import { rm, unlink } from 'node:fs/promises';
|
|
3
3
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
4
|
+
import { withScopeOption } from '../../shared/scope-option.js';
|
|
4
5
|
import { readGlobalOptions, resolveConcreteScopes, } from '../../shared/shared.utils.js';
|
|
5
6
|
import { autoSync, } from '../../tools/shared/auto-sync.js';
|
|
6
7
|
import { scanTools } from '../../tools/shared/scan-tools.js';
|
|
@@ -47,7 +48,7 @@ const VALID_PACKS = [
|
|
|
47
48
|
'brainstorm',
|
|
48
49
|
];
|
|
49
50
|
export function createToolsRemoveCommand(dependencies = defaultDependencies, syncDependencies = defaultSyncDependencies) {
|
|
50
|
-
return new Command('remove')
|
|
51
|
+
return withScopeOption(new Command('remove'))
|
|
51
52
|
.description('Remove installed tools')
|
|
52
53
|
.argument('[name]', 'Tool name to remove')
|
|
53
54
|
.option('--pack <pack>', 'Remove all tools in a pack (core|ideas|docs|workflows|utility|project-management|research|brainstorm)')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/update/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/update/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,KAAK,EAAY,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAKvE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,uBAAuB,EAE7B,MAAM,gBAAgB,CAAC;AAexB,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAAE,EAClB,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,GAClD,MAAM,EAAE,CAaV;AAgCD,wBAAgB,wBAAwB,CACtC,YAAY,GAAE,uBAA6C,EAC3D,gBAAgB,GAAE,oBAA8C,GAC/D,OAAO,CA4JT;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAI7E;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,YAAY,EACpB,MAAM,EAAE,YAAY,GACnB,OAAO,CAOT;AAED,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,OAAO,GACd,MAAM,CAMR"}
|
|
@@ -3,6 +3,7 @@ import { join } from 'node:path';
|
|
|
3
3
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
4
4
|
import { applyOatCoreGitignore } from '../../init/gitignore.js';
|
|
5
5
|
import { copyDirWithStatus, copyFileWithStatus, } from '../../init/tools/shared/copy-helpers.js';
|
|
6
|
+
import { withScopeOption } from '../../shared/scope-option.js';
|
|
6
7
|
import { readGlobalOptions, resolveConcreteScopes, } from '../../shared/shared.utils.js';
|
|
7
8
|
import { autoSync, } from '../../tools/shared/auto-sync.js';
|
|
8
9
|
import { scanTools } from '../../tools/shared/scan-tools.js';
|
|
@@ -26,14 +27,17 @@ const defaultDependencies = {
|
|
|
26
27
|
applyOatCoreGitignore,
|
|
27
28
|
};
|
|
28
29
|
export function buildSyncSubprocessArgs(entrypoint, execArgv, options) {
|
|
30
|
+
// `--scope` is a per-command option on `sync` (not a global flag), so it must
|
|
31
|
+
// come AFTER the `sync` subcommand token. `--cwd` remains a global flag and
|
|
32
|
+
// can precede the subcommand.
|
|
29
33
|
return [
|
|
30
34
|
...execArgv,
|
|
31
35
|
entrypoint,
|
|
32
36
|
'--cwd',
|
|
33
37
|
options.cwd,
|
|
38
|
+
'sync',
|
|
34
39
|
'--scope',
|
|
35
40
|
options.scope,
|
|
36
|
-
'sync',
|
|
37
41
|
];
|
|
38
42
|
}
|
|
39
43
|
const defaultSyncDependencies = {
|
|
@@ -62,7 +66,7 @@ const VALID_PACKS = [
|
|
|
62
66
|
'brainstorm',
|
|
63
67
|
];
|
|
64
68
|
export function createToolsUpdateCommand(dependencies = defaultDependencies, syncDependencies = defaultSyncDependencies) {
|
|
65
|
-
return new Command('update')
|
|
69
|
+
return withScopeOption(new Command('update'))
|
|
66
70
|
.description('Update installed tools to bundled versions')
|
|
67
71
|
.argument('[name]', 'Tool name to update')
|
|
68
72
|
.option('--pack <pack>', 'Update all tools in a pack (core|ideas|docs|workflows|utility|project-management|research|brainstorm)')
|
|
@@ -23,6 +23,8 @@ export type WorkflowDesignMode = 'collaborative' | 'selective' | 'draft';
|
|
|
23
23
|
export type WorkflowCodexDispatchCeiling = 'low' | 'medium' | 'high' | 'xhigh';
|
|
24
24
|
export type WorkflowClaudeDispatchCeiling = 'haiku' | 'sonnet' | 'opus';
|
|
25
25
|
export type WorkflowDispatchCeilingPreset = 'balanced' | 'maximum' | 'cost-conscious';
|
|
26
|
+
export type GateOnFailure = 'block' | 'prompt' | 'warn';
|
|
27
|
+
export type GateAvoid = 'same-runtime' | 'none';
|
|
26
28
|
export interface WorkflowDispatchCeiling {
|
|
27
29
|
preset?: WorkflowDispatchCeilingPreset;
|
|
28
30
|
providers?: {
|
|
@@ -34,6 +36,24 @@ export interface WorkflowAutoArtifactReview {
|
|
|
34
36
|
plan?: boolean;
|
|
35
37
|
analysis?: boolean;
|
|
36
38
|
}
|
|
39
|
+
export interface GateConfig {
|
|
40
|
+
command: string;
|
|
41
|
+
onFailure: GateOnFailure;
|
|
42
|
+
description?: string;
|
|
43
|
+
maxAttempts?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface ExecTarget {
|
|
46
|
+
runtime: string;
|
|
47
|
+
baseCommand: string[];
|
|
48
|
+
hostDetectionCommand?: string[];
|
|
49
|
+
availabilityCommand?: string[];
|
|
50
|
+
priority: number;
|
|
51
|
+
}
|
|
52
|
+
export type ExecTargetConfig = Partial<ExecTarget>;
|
|
53
|
+
export interface WorkflowGatesConfig {
|
|
54
|
+
execTargets?: Record<string, ExecTargetConfig | null>;
|
|
55
|
+
skills?: Record<string, GateConfig | null>;
|
|
56
|
+
}
|
|
37
57
|
export interface OatWorkflowConfig {
|
|
38
58
|
hillCheckpointDefault?: WorkflowHillCheckpointDefault;
|
|
39
59
|
archiveOnComplete?: boolean;
|
|
@@ -45,10 +65,12 @@ export interface OatWorkflowConfig {
|
|
|
45
65
|
autoArtifactReview?: WorkflowAutoArtifactReview;
|
|
46
66
|
designMode?: WorkflowDesignMode;
|
|
47
67
|
dispatchCeiling?: WorkflowDispatchCeiling;
|
|
68
|
+
gates?: WorkflowGatesConfig;
|
|
48
69
|
}
|
|
49
70
|
export declare const VALID_CODEX_DISPATCH_CEILINGS: readonly WorkflowCodexDispatchCeiling[];
|
|
50
71
|
export declare const VALID_CLAUDE_DISPATCH_CEILINGS: readonly WorkflowClaudeDispatchCeiling[];
|
|
51
72
|
export declare const VALID_DISPATCH_CEILING_PRESETS: readonly WorkflowDispatchCeilingPreset[];
|
|
73
|
+
export declare const BUILTIN_EXEC_TARGETS: Readonly<Record<string, ExecTarget>>;
|
|
52
74
|
export type OatToolsConfig = Partial<Record<'core' | 'ideas' | 'docs' | 'workflows' | 'utility' | 'project-management' | 'research' | 'brainstorm', boolean>>;
|
|
53
75
|
export interface OatConfig {
|
|
54
76
|
version: number;
|
|
@@ -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,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,6BAA6B,GAAG,OAAO,GAAG,OAAO,CAAC;AAC9D,MAAM,MAAM,6BAA6B,GACrC,MAAM,GACN,SAAS,GACT,IAAI,GACJ,SAAS,CAAC;AACd,MAAM,MAAM,4BAA4B,GACpC,UAAU,GACV,QAAQ,GACR,eAAe,CAAC;AACpB,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG,WAAW,GAAG,OAAO,CAAC;AACzE,MAAM,MAAM,4BAA4B,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC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AE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,OAAO,CAAC,IAAI,CAAC,CAYf;AA2BD,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"}
|
|
@@ -19,6 +19,128 @@ const VALID_DESIGN_MODES = [
|
|
|
19
19
|
export const VALID_CODEX_DISPATCH_CEILINGS = ['low', 'medium', 'high', 'xhigh'];
|
|
20
20
|
export const VALID_CLAUDE_DISPATCH_CEILINGS = ['haiku', 'sonnet', 'opus'];
|
|
21
21
|
export const VALID_DISPATCH_CEILING_PRESETS = ['balanced', 'maximum', 'cost-conscious'];
|
|
22
|
+
const VALID_GATE_ON_FAILURES = [
|
|
23
|
+
'block',
|
|
24
|
+
'prompt',
|
|
25
|
+
'warn',
|
|
26
|
+
];
|
|
27
|
+
export const BUILTIN_EXEC_TARGETS = {
|
|
28
|
+
'codex-default': {
|
|
29
|
+
runtime: 'codex',
|
|
30
|
+
baseCommand: ['codex', 'exec'],
|
|
31
|
+
hostDetectionCommand: [
|
|
32
|
+
'sh',
|
|
33
|
+
'-c',
|
|
34
|
+
'[ -n "$CODEX_THREAD_ID" ] || [ -n "$CODEX_SESSION_ID" ]',
|
|
35
|
+
],
|
|
36
|
+
availabilityCommand: ['codex', '--version'],
|
|
37
|
+
priority: 100,
|
|
38
|
+
},
|
|
39
|
+
'claude-default': {
|
|
40
|
+
runtime: 'claude',
|
|
41
|
+
baseCommand: ['claude', '-p'],
|
|
42
|
+
hostDetectionCommand: ['sh', '-c', 'test -n "$CLAUDECODE"'],
|
|
43
|
+
availabilityCommand: ['claude', '--version'],
|
|
44
|
+
priority: 100,
|
|
45
|
+
},
|
|
46
|
+
'cursor-default': {
|
|
47
|
+
runtime: 'cursor',
|
|
48
|
+
baseCommand: ['cursor-agent', '-p', '--force'],
|
|
49
|
+
hostDetectionCommand: ['sh', '-c', 'test -n "$CURSOR_AGENT"'],
|
|
50
|
+
availabilityCommand: ['cursor-agent', '--version'],
|
|
51
|
+
priority: 70,
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
function normalizeMaxAttempts(value) {
|
|
55
|
+
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
|
56
|
+
return 2;
|
|
57
|
+
}
|
|
58
|
+
const attempts = Math.trunc(value);
|
|
59
|
+
return attempts >= 1 ? attempts : 2;
|
|
60
|
+
}
|
|
61
|
+
function normalizeArgv(value) {
|
|
62
|
+
if (!Array.isArray(value) ||
|
|
63
|
+
value.length === 0 ||
|
|
64
|
+
!value.every((item) => typeof item === 'string')) {
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
const [executable] = value;
|
|
68
|
+
if (executable === undefined || !executable.trim()) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
return [...value];
|
|
72
|
+
}
|
|
73
|
+
function normalizeGateConfig(value) {
|
|
74
|
+
if (value === null) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
if (!isRecord(value)) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const command = trimNonEmptyString(value.command);
|
|
81
|
+
if (command === undefined ||
|
|
82
|
+
typeof value.onFailure !== 'string' ||
|
|
83
|
+
!VALID_GATE_ON_FAILURES.includes(value.onFailure)) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const gate = {
|
|
87
|
+
command,
|
|
88
|
+
onFailure: value.onFailure,
|
|
89
|
+
maxAttempts: normalizeMaxAttempts(value.maxAttempts),
|
|
90
|
+
};
|
|
91
|
+
const description = trimNonEmptyString(value.description);
|
|
92
|
+
if (description !== undefined) {
|
|
93
|
+
gate.description = description;
|
|
94
|
+
}
|
|
95
|
+
return gate;
|
|
96
|
+
}
|
|
97
|
+
function normalizeExecTarget(value) {
|
|
98
|
+
if (value === null) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
if (!isRecord(value)) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const target = {};
|
|
105
|
+
const runtime = trimNonEmptyString(value.runtime);
|
|
106
|
+
if (runtime !== undefined) {
|
|
107
|
+
target.runtime = runtime;
|
|
108
|
+
}
|
|
109
|
+
const baseCommand = normalizeArgv(value.baseCommand);
|
|
110
|
+
if (baseCommand !== undefined) {
|
|
111
|
+
target.baseCommand = baseCommand;
|
|
112
|
+
}
|
|
113
|
+
if ('priority' in value) {
|
|
114
|
+
if (typeof value.priority === 'number' && Number.isFinite(value.priority)) {
|
|
115
|
+
target.priority = value.priority;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const hostDetectionCommand = normalizeArgv(value.hostDetectionCommand);
|
|
119
|
+
if (hostDetectionCommand !== undefined) {
|
|
120
|
+
target.hostDetectionCommand = hostDetectionCommand;
|
|
121
|
+
}
|
|
122
|
+
const availabilityCommand = normalizeArgv(value.availabilityCommand);
|
|
123
|
+
if (availabilityCommand !== undefined) {
|
|
124
|
+
target.availabilityCommand = availabilityCommand;
|
|
125
|
+
}
|
|
126
|
+
return Object.keys(target).length > 0 ? target : undefined;
|
|
127
|
+
}
|
|
128
|
+
function normalizeRecordMap(value, normalizeValue) {
|
|
129
|
+
if (!isRecord(value)) {
|
|
130
|
+
return undefined;
|
|
131
|
+
}
|
|
132
|
+
const next = {};
|
|
133
|
+
for (const [key, rawEntry] of Object.entries(value)) {
|
|
134
|
+
if (!key.trim()) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const normalized = normalizeValue(rawEntry);
|
|
138
|
+
if (normalized !== undefined) {
|
|
139
|
+
next[key] = normalized;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return Object.keys(next).length > 0 ? next : undefined;
|
|
143
|
+
}
|
|
22
144
|
function normalizeWorkflowConfig(parsed) {
|
|
23
145
|
if (!isRecord(parsed)) {
|
|
24
146
|
return undefined;
|
|
@@ -94,6 +216,20 @@ function normalizeWorkflowConfig(parsed) {
|
|
|
94
216
|
next.dispatchCeiling = dispatchCeiling;
|
|
95
217
|
}
|
|
96
218
|
}
|
|
219
|
+
if (isRecord(parsed.gates)) {
|
|
220
|
+
const gates = {};
|
|
221
|
+
const execTargets = normalizeRecordMap(parsed.gates.execTargets, normalizeExecTarget);
|
|
222
|
+
if (execTargets !== undefined) {
|
|
223
|
+
gates.execTargets = execTargets;
|
|
224
|
+
}
|
|
225
|
+
const skills = normalizeRecordMap(parsed.gates.skills, normalizeGateConfig);
|
|
226
|
+
if (skills !== undefined) {
|
|
227
|
+
gates.skills = skills;
|
|
228
|
+
}
|
|
229
|
+
if (Object.keys(gates).length > 0) {
|
|
230
|
+
next.gates = gates;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
97
233
|
return Object.keys(next).length > 0 ? next : undefined;
|
|
98
234
|
}
|
|
99
235
|
const DEFAULT_OAT_CONFIG = { version: 1 };
|
package/dist/config/resolve.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type OatConfig, type OatLocalConfig, type UserConfig } from './oat-config.js';
|
|
1
|
+
import { type ExecTarget, type GateConfig, type OatConfig, type OatLocalConfig, type UserConfig } from './oat-config.js';
|
|
2
2
|
export type ResolvedConfigSource = 'shared' | 'local' | 'user' | 'env' | 'default';
|
|
3
3
|
export interface ResolvedKeyEntry {
|
|
4
4
|
value: unknown;
|
|
@@ -16,4 +16,6 @@ export interface ResolveEffectiveConfigDependencies {
|
|
|
16
16
|
readUserConfig: (userConfigDir: string) => Promise<UserConfig>;
|
|
17
17
|
}
|
|
18
18
|
export declare function resolveEffectiveConfig(repoRoot: string, userConfigDir: string, env?: NodeJS.ProcessEnv, overrides?: Partial<ResolveEffectiveConfigDependencies>): Promise<ResolvedConfig>;
|
|
19
|
+
export declare function resolveGate(effective: ResolvedConfig, skillName: string): GateConfig | null;
|
|
20
|
+
export declare function resolveExecTargets(effective: ResolvedConfig): Record<string, ExecTarget>;
|
|
19
21
|
//# 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,EAKL,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,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