@open-agent-toolkit/cli 0.0.42 → 0.0.50
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 +230 -0
- package/assets/agents/oat-reviewer.md +3 -3
- package/assets/docs/cli-utilities/configuration.md +15 -3
- package/assets/docs/docs-tooling/add-docs-to-a-repo.md +12 -1
- package/assets/docs/docs-tooling/commands.md +4 -0
- package/assets/docs/reference/cli-reference.md +17 -14
- package/assets/docs/reference/oat-directory-structure.md +17 -17
- package/assets/docs/workflows/projects/artifacts.md +34 -0
- package/assets/docs/workflows/projects/implementation-execution.md +161 -0
- package/assets/docs/workflows/projects/lifecycle.md +22 -29
- package/assets/docs/workflows/projects/reviews.md +4 -2
- package/assets/docs/workflows/skills/index.md +0 -1
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-docs-bootstrap/SKILL.md +11 -3
- package/assets/skills/oat-doctor/SKILL.md +3 -3
- package/assets/skills/oat-project-implement/SKILL.md +368 -126
- package/assets/skills/oat-project-import-plan/SKILL.md +2 -3
- package/assets/skills/oat-project-next/SKILL.md +11 -12
- package/assets/skills/oat-project-plan/SKILL.md +23 -5
- package/assets/skills/oat-project-plan-writing/SKILL.md +2 -2
- package/assets/skills/oat-project-progress/SKILL.md +29 -35
- package/assets/skills/oat-project-quick-start/SKILL.md +14 -3
- package/assets/skills/oat-project-review-provide/SKILL.md +24 -2
- package/assets/skills/oat-project-review-receive/SKILL.md +5 -1
- package/assets/skills/oat-worktree-bootstrap-auto/SKILL.md +2 -2
- package/assets/templates/docs-app-fuma/docs/index.md +2 -0
- package/assets/templates/implementation.md +8 -3
- package/assets/templates/plan.md +24 -3
- package/assets/templates/state.md +1 -1
- package/dist/commands/config/index.d.ts.map +1 -1
- package/dist/commands/config/index.js +17 -4
- package/dist/commands/docs/index-generate/index.d.ts +1 -0
- package/dist/commands/docs/index-generate/index.d.ts.map +1 -1
- package/dist/commands/docs/index-generate/index.js +8 -1
- package/dist/commands/docs/init/index.d.ts.map +1 -1
- package/dist/commands/docs/init/index.js +46 -0
- package/dist/commands/docs/init/resolve-options.d.ts +2 -0
- package/dist/commands/docs/init/resolve-options.d.ts.map +1 -1
- package/dist/commands/docs/init/resolve-options.js +1 -0
- package/dist/commands/docs/init/root-package.d.ts +23 -0
- package/dist/commands/docs/init/root-package.d.ts.map +1 -0
- package/dist/commands/docs/init/root-package.js +226 -0
- package/dist/commands/init/tools/index.js +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.d.ts +2 -2
- package/dist/commands/init/tools/shared/skill-manifest.d.ts.map +1 -1
- package/dist/commands/init/tools/shared/skill-manifest.js +1 -1
- package/dist/commands/project/index.d.ts.map +1 -1
- package/dist/commands/project/index.js +3 -1
- package/dist/commands/project/set-mode/index.d.ts +0 -6
- package/dist/commands/project/set-mode/index.d.ts.map +1 -1
- package/dist/commands/project/set-mode/index.js +16 -96
- package/dist/commands/project/validate-plan/index.d.ts +3 -0
- package/dist/commands/project/validate-plan/index.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/index.js +44 -0
- package/dist/commands/project/validate-plan/validate-plan.d.ts +20 -0
- package/dist/commands/project/validate-plan/validate-plan.d.ts.map +1 -0
- package/dist/commands/project/validate-plan/validate-plan.js +77 -0
- package/dist/commands/tools/update/index.d.ts +4 -0
- package/dist/commands/tools/update/index.d.ts.map +1 -1
- package/dist/commands/tools/update/index.js +17 -1
- package/dist/commands/tools/update/update-tools.d.ts +1 -0
- package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
- package/dist/commands/tools/update/update-tools.js +80 -1
- package/dist/config/oat-config.d.ts +1 -0
- package/dist/config/oat-config.d.ts.map +1 -1
- package/dist/config/oat-config.js +3 -0
- package/dist/config/resolve.d.ts.map +1 -1
- package/dist/config/resolve.js +9 -0
- package/package.json +2 -2
- package/assets/skills/oat-project-subagent-implement/SKILL.md +0 -549
- package/assets/skills/oat-project-subagent-implement/examples/pattern-hill-checkpoint.md +0 -110
- package/assets/skills/oat-project-subagent-implement/examples/pattern-parallel-phases.md +0 -118
- package/assets/skills/oat-project-subagent-implement/scripts/dispatch.sh +0 -133
- package/assets/skills/oat-project-subagent-implement/scripts/reconcile.sh +0 -182
- package/assets/skills/oat-project-subagent-implement/scripts/review-gate.sh +0 -187
- package/assets/skills/oat-project-subagent-implement/tests/fixtures/sample-plan.md +0 -234
- package/assets/skills/oat-project-subagent-implement/tests/test-dry-run.sh +0 -126
- package/assets/skills/oat-project-subagent-implement/tests/test-hill-checkpoint.sh +0 -127
- package/assets/skills/oat-project-subagent-implement/tests/test-reconcile.sh +0 -254
- package/assets/skills/oat-project-subagent-implement/tests/test-review-gate.sh +0 -220
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAIL,KAAK,uBAAuB,EAK7B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAE5C,OAAO,EAIL,KAAK,uBAAuB,EAK7B,MAAM,mBAAmB,CAAC;AAkB3B,UAAU,oBAAoB;IAC5B,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,iBAAiB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACzC,eAAe,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;IAC9E,gBAAgB,EAAE,CAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5B,eAAe,EAAE,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAC1B,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvB,WAAW,EAAE,CACX,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,uBAAuB,EAChC,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,qBAAqB,EAAE,CACrB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAClC,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,CAAC;IACxD,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1E;AAyGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAc7E;AA+GD,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC5C,OAAO,CAuCT"}
|
|
@@ -6,7 +6,43 @@ import { readOatConfig, writeOatConfig, } from '../../../config/oat-config.js';
|
|
|
6
6
|
import { resolveAssetsRoot } from '../../../fs/assets.js';
|
|
7
7
|
import { Command, Option } from 'commander';
|
|
8
8
|
import { DEFAULT_DOCS_REPO_SHAPE_DEPENDENCIES, detectDocsRepoShape, getDefaultDocsAppName, resolveDocsInitOptions, } from './resolve-options.js';
|
|
9
|
+
import { patchRootPackageJson, } from './root-package.js';
|
|
9
10
|
import { scaffoldDocsApp } from './scaffold.js';
|
|
11
|
+
function logRootPackagePatch(context, result) {
|
|
12
|
+
if (result.status === 'disabled') {
|
|
13
|
+
context.logger.info('Skipped root package.json patch (--no-root-patch).');
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (result.diff) {
|
|
17
|
+
context.logger.info('');
|
|
18
|
+
context.logger.info('Root package.json diff:');
|
|
19
|
+
context.logger.info(result.diff);
|
|
20
|
+
}
|
|
21
|
+
if (result.status === 'applied') {
|
|
22
|
+
context.logger.info('Updated the root Turbo build scripts to exclude the docs app from the default build and added `build:docs`.');
|
|
23
|
+
}
|
|
24
|
+
else if (result.status === 'dry-run') {
|
|
25
|
+
context.logger.info('Dry run: the root Turbo build script patch was previewed but not written.');
|
|
26
|
+
context.logger.info('Run without --dry-run to apply these changes.');
|
|
27
|
+
}
|
|
28
|
+
else if (result.status === 'already-configured') {
|
|
29
|
+
context.logger.info('Root package.json already excludes the docs app from the default Turbo build and exposes `build:docs`.');
|
|
30
|
+
}
|
|
31
|
+
else if (result.status === 'skipped') {
|
|
32
|
+
for (const warning of result.warnings) {
|
|
33
|
+
context.logger.warn(warning);
|
|
34
|
+
}
|
|
35
|
+
if (result.manualSnippet) {
|
|
36
|
+
context.logger.info('');
|
|
37
|
+
context.logger.info('Recommended manual Turbo script snippet for the repo root:');
|
|
38
|
+
context.logger.info(result.manualSnippet);
|
|
39
|
+
}
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
for (const warning of result.warnings) {
|
|
43
|
+
context.logger.warn(warning);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
10
46
|
const DEFAULT_DEPENDENCIES = {
|
|
11
47
|
buildCommandContext,
|
|
12
48
|
resolveAssetsRoot,
|
|
@@ -18,6 +54,12 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
18
54
|
assetsRoot,
|
|
19
55
|
...options,
|
|
20
56
|
});
|
|
57
|
+
const rootPackagePatch = await patchRootPackageJson({
|
|
58
|
+
repoRoot: context.cwd,
|
|
59
|
+
appName: options.appName,
|
|
60
|
+
dryRun: context.dryRun,
|
|
61
|
+
enabled: options.rootPatch,
|
|
62
|
+
});
|
|
21
63
|
const config = await readOatConfig(context.cwd);
|
|
22
64
|
config.documentation = {
|
|
23
65
|
...config.documentation,
|
|
@@ -30,6 +72,7 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
30
72
|
...options,
|
|
31
73
|
createdFiles: result.createdFiles,
|
|
32
74
|
appRoot: result.appRoot,
|
|
75
|
+
rootPackagePatch,
|
|
33
76
|
});
|
|
34
77
|
return;
|
|
35
78
|
}
|
|
@@ -39,6 +82,7 @@ const DEFAULT_DEPENDENCIES = {
|
|
|
39
82
|
context.logger.info(` App name: ${options.appName}`);
|
|
40
83
|
context.logger.info(` Lint: ${options.lint}`);
|
|
41
84
|
context.logger.info(` Format: ${options.format}`);
|
|
85
|
+
logRootPackagePatch(context, rootPackagePatch);
|
|
42
86
|
},
|
|
43
87
|
upsertAgentsMdSection,
|
|
44
88
|
readOatConfig,
|
|
@@ -75,6 +119,7 @@ async function runDocsInitCommand(context, options, dependencies) {
|
|
|
75
119
|
providedSiteDescription: options.description,
|
|
76
120
|
providedLint: options.lint,
|
|
77
121
|
providedFormat: options.format,
|
|
122
|
+
providedRootPatch: options.rootPatch,
|
|
78
123
|
inputWithDefault: dependencies.inputWithDefault,
|
|
79
124
|
selectWithAbort: dependencies.selectWithAbort,
|
|
80
125
|
});
|
|
@@ -170,6 +215,7 @@ export function createDocsInitCommand(overrides = {}) {
|
|
|
170
215
|
'oxfmt',
|
|
171
216
|
'none',
|
|
172
217
|
]))
|
|
218
|
+
.option('--no-root-patch', 'Skip patching the consumer root package.json')
|
|
173
219
|
.option('--yes', 'Accept defaults without prompting')
|
|
174
220
|
.action(async (options, command) => {
|
|
175
221
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
@@ -12,6 +12,7 @@ export interface DocsInitResolvedOptions {
|
|
|
12
12
|
siteDescription: string;
|
|
13
13
|
lint: DocsLintMode;
|
|
14
14
|
format: DocsFormatMode;
|
|
15
|
+
rootPatch: boolean;
|
|
15
16
|
}
|
|
16
17
|
export interface ResolveDocsInitOptionsInput {
|
|
17
18
|
repoRoot: string;
|
|
@@ -24,6 +25,7 @@ export interface ResolveDocsInitOptionsInput {
|
|
|
24
25
|
providedSiteDescription?: string;
|
|
25
26
|
providedLint?: DocsLintMode;
|
|
26
27
|
providedFormat?: DocsFormatMode;
|
|
28
|
+
providedRootPatch?: boolean;
|
|
27
29
|
inputWithDefault: (message: string, defaultValue: string, ctx: PromptContext) => Promise<string | null>;
|
|
28
30
|
selectWithAbort: <T extends string>(message: string, choices: SelectChoice<T>[], ctx: PromptContext) => Promise<T | null>;
|
|
29
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/resolve-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACb,MAAM,iCAAiC,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,mBAAmB,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-options.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/resolve-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACb,MAAM,iCAAiC,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,mBAAmB,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;IACvB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,CAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5B,eAAe,EAAE,CAAC,CAAC,SAAS,MAAM,EAChC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,EAC1B,GAAG,EAAE,aAAa,KACf,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACvE;AAiBD,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,aAAa,GACvB,MAAM,CAMR;AAED,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,aAAa,EACxB,OAAO,EAAE,MAAM,GACd,MAAM,CAMR;AAoBD,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,yBAAyB,GACtC,OAAO,CAAC,aAAa,CAAC,CAqBxB;AAED,wBAAgB,cAAc,CAAC,SAAS,EAAE,aAAa,GAAG,MAAM,CAE/D;AAED,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,2BAA2B,GACjC,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAgFzC;AAED,eAAO,MAAM,oCAAoC,EAAE,yBAOlD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type RootPackagePatchReason = 'missing-package-json' | 'no-build-script' | 'non-turbo-build-script' | 'ambiguous-shell-build-script' | 'existing-filter-flags' | 'existing-build-docs-script' | 'disabled';
|
|
2
|
+
type RootPackagePatchStatus = 'applied' | 'dry-run' | 'skipped' | 'disabled' | 'already-configured';
|
|
3
|
+
export interface RootPackagePatchResult {
|
|
4
|
+
status: RootPackagePatchStatus;
|
|
5
|
+
reason?: RootPackagePatchReason;
|
|
6
|
+
packageJsonPath: string;
|
|
7
|
+
diff?: string;
|
|
8
|
+
manualSnippet?: string;
|
|
9
|
+
warnings: string[];
|
|
10
|
+
}
|
|
11
|
+
interface RootPackagePatchDependencies {
|
|
12
|
+
readFile: (path: string, encoding: BufferEncoding) => Promise<string>;
|
|
13
|
+
writeFile: (path: string, content: string, encoding: BufferEncoding) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
interface RootPackagePatchOptions {
|
|
16
|
+
repoRoot: string;
|
|
17
|
+
appName: string;
|
|
18
|
+
dryRun: boolean;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function patchRootPackageJson(options: RootPackagePatchOptions, dependencies?: RootPackagePatchDependencies): Promise<RootPackagePatchResult>;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=root-package.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-package.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/root-package.ts"],"names":[],"mappings":"AAMA,KAAK,sBAAsB,GACvB,sBAAsB,GACtB,iBAAiB,GACjB,wBAAwB,GACxB,8BAA8B,GAC9B,uBAAuB,GACvB,4BAA4B,GAC5B,UAAU,CAAC;AAEf,KAAK,sBAAsB,GACvB,SAAS,GACT,SAAS,GACT,SAAS,GACT,UAAU,GACV,oBAAoB,CAAC;AAMzB,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,UAAU,4BAA4B;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACtE,SAAS,EAAE,CACT,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,cAAc,KACrB,OAAO,CAAC,IAAI,CAAC,CAAC;CACpB;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAsKD,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,uBAAuB,EAChC,YAAY,GAAE,4BAAmD,GAChE,OAAO,CAAC,sBAAsB,CAAC,CA8IjC"}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const DEFAULT_BUILD_SCRIPT = 'turbo run build';
|
|
4
|
+
const ROOT_PACKAGE_PATH = 'package.json';
|
|
5
|
+
const DEFAULT_DEPENDENCIES = {
|
|
6
|
+
readFile,
|
|
7
|
+
writeFile,
|
|
8
|
+
};
|
|
9
|
+
function runsTurboBuild(script) {
|
|
10
|
+
return /^turbo\s+(?:run\s+)?build(?:\s+.*)?$/.test(script.trim());
|
|
11
|
+
}
|
|
12
|
+
function hasShellComposition(script) {
|
|
13
|
+
return /&&|\|\||[;|`]|[$][(]/.test(script);
|
|
14
|
+
}
|
|
15
|
+
function removeFilterFlags(script) {
|
|
16
|
+
return script
|
|
17
|
+
.replace(/\s+--filter(?:=|\s+)(?:"[^"]*"|'[^']*'|\S+)/g, '')
|
|
18
|
+
.trim();
|
|
19
|
+
}
|
|
20
|
+
function getFilterFlags(script) {
|
|
21
|
+
return Array.from(script.matchAll(/\s+(--filter(?:=|\s+)(?:"[^"]*"|'[^']*'|\S+))/g), (match) => match[1]);
|
|
22
|
+
}
|
|
23
|
+
function buildExcludeFilter(appName) {
|
|
24
|
+
return `--filter='!${appName}'`;
|
|
25
|
+
}
|
|
26
|
+
function buildIncludeFilter(appName) {
|
|
27
|
+
return `--filter=${appName}...`;
|
|
28
|
+
}
|
|
29
|
+
function buildManualSnippet(appName, baseBuildScript) {
|
|
30
|
+
const buildScript = baseBuildScript?.trim() || DEFAULT_BUILD_SCRIPT;
|
|
31
|
+
return [
|
|
32
|
+
'"scripts": {',
|
|
33
|
+
` "build": "${buildScript} ${buildExcludeFilter(appName)}",`,
|
|
34
|
+
` "build:docs": "${buildScript} ${buildIncludeFilter(appName)}"`,
|
|
35
|
+
'}',
|
|
36
|
+
].join('\n');
|
|
37
|
+
}
|
|
38
|
+
function inferIndentation(content) {
|
|
39
|
+
const match = /\n([ \t]+)"/.exec(content);
|
|
40
|
+
return match?.[1] ?? ' ';
|
|
41
|
+
}
|
|
42
|
+
function formatJsonWithOriginalStyle(original, value) {
|
|
43
|
+
const indentation = inferIndentation(original);
|
|
44
|
+
const trailingNewline = original.endsWith('\n') ? '\n' : '';
|
|
45
|
+
return `${JSON.stringify(value, null, indentation)}${trailingNewline}`;
|
|
46
|
+
}
|
|
47
|
+
function splitLines(content) {
|
|
48
|
+
const trimmed = content.endsWith('\n') ? content.slice(0, -1) : content;
|
|
49
|
+
return trimmed.length > 0 ? trimmed.split('\n') : [];
|
|
50
|
+
}
|
|
51
|
+
function buildDiffOperations(beforeLines, afterLines) {
|
|
52
|
+
const lengths = Array.from({ length: beforeLines.length + 1 }, () => Array(afterLines.length + 1).fill(0));
|
|
53
|
+
for (let beforeIndex = beforeLines.length - 1; beforeIndex >= 0; beforeIndex -= 1) {
|
|
54
|
+
for (let afterIndex = afterLines.length - 1; afterIndex >= 0; afterIndex -= 1) {
|
|
55
|
+
lengths[beforeIndex][afterIndex] =
|
|
56
|
+
beforeLines[beforeIndex] === afterLines[afterIndex]
|
|
57
|
+
? lengths[beforeIndex + 1][afterIndex + 1] + 1
|
|
58
|
+
: Math.max(lengths[beforeIndex + 1][afterIndex], lengths[beforeIndex][afterIndex + 1]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const operations = [];
|
|
62
|
+
let beforeIndex = 0;
|
|
63
|
+
let afterIndex = 0;
|
|
64
|
+
while (beforeIndex < beforeLines.length && afterIndex < afterLines.length) {
|
|
65
|
+
if (beforeLines[beforeIndex] === afterLines[afterIndex]) {
|
|
66
|
+
operations.push({ type: 'context', line: beforeLines[beforeIndex] });
|
|
67
|
+
beforeIndex += 1;
|
|
68
|
+
afterIndex += 1;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (lengths[beforeIndex + 1][afterIndex] >=
|
|
72
|
+
lengths[beforeIndex][afterIndex + 1]) {
|
|
73
|
+
operations.push({ type: 'remove', line: beforeLines[beforeIndex] });
|
|
74
|
+
beforeIndex += 1;
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
operations.push({ type: 'add', line: afterLines[afterIndex] });
|
|
78
|
+
afterIndex += 1;
|
|
79
|
+
}
|
|
80
|
+
while (beforeIndex < beforeLines.length) {
|
|
81
|
+
operations.push({ type: 'remove', line: beforeLines[beforeIndex] });
|
|
82
|
+
beforeIndex += 1;
|
|
83
|
+
}
|
|
84
|
+
while (afterIndex < afterLines.length) {
|
|
85
|
+
operations.push({ type: 'add', line: afterLines[afterIndex] });
|
|
86
|
+
afterIndex += 1;
|
|
87
|
+
}
|
|
88
|
+
return operations;
|
|
89
|
+
}
|
|
90
|
+
function createUnifiedDiff(filePath, before, after) {
|
|
91
|
+
if (before === after) {
|
|
92
|
+
return '';
|
|
93
|
+
}
|
|
94
|
+
const beforeLines = splitLines(before);
|
|
95
|
+
const afterLines = splitLines(after);
|
|
96
|
+
const operations = buildDiffOperations(beforeLines, afterLines);
|
|
97
|
+
return [
|
|
98
|
+
`--- ${filePath}`,
|
|
99
|
+
`+++ ${filePath}`,
|
|
100
|
+
`@@ -1,${beforeLines.length} +1,${afterLines.length} @@`,
|
|
101
|
+
...operations.map((operation) => {
|
|
102
|
+
const prefix = operation.type === 'context'
|
|
103
|
+
? ' '
|
|
104
|
+
: operation.type === 'remove'
|
|
105
|
+
? '-'
|
|
106
|
+
: '+';
|
|
107
|
+
return `${prefix}${operation.line}`;
|
|
108
|
+
}),
|
|
109
|
+
].join('\n');
|
|
110
|
+
}
|
|
111
|
+
export async function patchRootPackageJson(options, dependencies = DEFAULT_DEPENDENCIES) {
|
|
112
|
+
const packageJsonPath = join(options.repoRoot, ROOT_PACKAGE_PATH);
|
|
113
|
+
if (!options.enabled) {
|
|
114
|
+
return {
|
|
115
|
+
status: 'disabled',
|
|
116
|
+
reason: 'disabled',
|
|
117
|
+
packageJsonPath,
|
|
118
|
+
warnings: [],
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
let originalContent;
|
|
122
|
+
try {
|
|
123
|
+
originalContent = await dependencies.readFile(packageJsonPath, 'utf8');
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return {
|
|
127
|
+
status: 'skipped',
|
|
128
|
+
reason: 'missing-package-json',
|
|
129
|
+
packageJsonPath,
|
|
130
|
+
manualSnippet: buildManualSnippet(options.appName),
|
|
131
|
+
warnings: [
|
|
132
|
+
'Skipped root package.json patch: root package.json was not found.',
|
|
133
|
+
],
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
const parsed = JSON.parse(originalContent);
|
|
137
|
+
const currentScripts = parsed.scripts ?? {};
|
|
138
|
+
const currentBuildScript = currentScripts.build;
|
|
139
|
+
if (!currentBuildScript) {
|
|
140
|
+
return {
|
|
141
|
+
status: 'skipped',
|
|
142
|
+
reason: 'no-build-script',
|
|
143
|
+
packageJsonPath,
|
|
144
|
+
manualSnippet: buildManualSnippet(options.appName),
|
|
145
|
+
warnings: [
|
|
146
|
+
'Skipped root package.json patch: scripts.build is missing, so there was no Turbo build command to update.',
|
|
147
|
+
],
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
if (!runsTurboBuild(currentBuildScript)) {
|
|
151
|
+
return {
|
|
152
|
+
status: 'skipped',
|
|
153
|
+
reason: 'non-turbo-build-script',
|
|
154
|
+
packageJsonPath,
|
|
155
|
+
manualSnippet: buildManualSnippet(options.appName),
|
|
156
|
+
warnings: [
|
|
157
|
+
'Skipped root package.json patch: scripts.build does not run a Turbo build command, so OAT left it unchanged.',
|
|
158
|
+
],
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
if (hasShellComposition(currentBuildScript)) {
|
|
162
|
+
return {
|
|
163
|
+
status: 'skipped',
|
|
164
|
+
reason: 'ambiguous-shell-build-script',
|
|
165
|
+
packageJsonPath,
|
|
166
|
+
manualSnippet: buildManualSnippet(options.appName),
|
|
167
|
+
warnings: [
|
|
168
|
+
'Skipped root package.json patch: scripts.build wraps the Turbo build in a larger shell expression, so OAT left it unchanged rather than rewriting the full command.',
|
|
169
|
+
],
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
const excludeFilter = buildExcludeFilter(options.appName);
|
|
173
|
+
const filterFlags = getFilterFlags(currentBuildScript);
|
|
174
|
+
const hasUserAuthoredFilters = filterFlags.some((flag) => flag !== excludeFilter);
|
|
175
|
+
if (hasUserAuthoredFilters) {
|
|
176
|
+
return {
|
|
177
|
+
status: 'skipped',
|
|
178
|
+
reason: 'existing-filter-flags',
|
|
179
|
+
packageJsonPath,
|
|
180
|
+
manualSnippet: buildManualSnippet(options.appName, removeFilterFlags(currentBuildScript)),
|
|
181
|
+
warnings: [
|
|
182
|
+
'Skipped root package.json patch: scripts.build already uses `--filter`, so OAT left it unchanged rather than guessing how to merge filter semantics.',
|
|
183
|
+
],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
const nextScripts = { ...currentScripts };
|
|
187
|
+
const nextBuildScript = currentBuildScript.includes(excludeFilter)
|
|
188
|
+
? currentBuildScript
|
|
189
|
+
: `${currentBuildScript.trim()} ${excludeFilter}`;
|
|
190
|
+
nextScripts.build = nextBuildScript;
|
|
191
|
+
const baseBuildScript = removeFilterFlags(currentBuildScript);
|
|
192
|
+
const desiredBuildDocsScript = `${baseBuildScript} ${buildIncludeFilter(options.appName)}`;
|
|
193
|
+
const warnings = [];
|
|
194
|
+
if (nextScripts['build:docs'] &&
|
|
195
|
+
nextScripts['build:docs'] !== desiredBuildDocsScript) {
|
|
196
|
+
warnings.push('Left scripts["build:docs"] unchanged because the root package already defines a different value.');
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
nextScripts['build:docs'] = desiredBuildDocsScript;
|
|
200
|
+
}
|
|
201
|
+
const nextContent = formatJsonWithOriginalStyle(originalContent, {
|
|
202
|
+
...parsed,
|
|
203
|
+
scripts: nextScripts,
|
|
204
|
+
});
|
|
205
|
+
const diff = createUnifiedDiff(ROOT_PACKAGE_PATH, originalContent, nextContent);
|
|
206
|
+
if (!diff) {
|
|
207
|
+
return {
|
|
208
|
+
status: 'already-configured',
|
|
209
|
+
packageJsonPath,
|
|
210
|
+
warnings,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
if (!options.dryRun) {
|
|
214
|
+
await dependencies.writeFile(packageJsonPath, nextContent, 'utf8');
|
|
215
|
+
}
|
|
216
|
+
return {
|
|
217
|
+
status: options.dryRun ? 'dry-run' : 'applied',
|
|
218
|
+
reason: warnings.length > 0 ? 'existing-build-docs-script' : undefined,
|
|
219
|
+
packageJsonPath,
|
|
220
|
+
diff,
|
|
221
|
+
manualSnippet: warnings.length > 0
|
|
222
|
+
? buildManualSnippet(options.appName, baseBuildScript)
|
|
223
|
+
: undefined,
|
|
224
|
+
warnings,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
@@ -349,7 +349,7 @@ export function buildToolPacksSectionBody(packs) {
|
|
|
349
349
|
lines.push(`- **${pack}** — ${PACK_DESCRIPTIONS[pack]}${suffix}`);
|
|
350
350
|
}
|
|
351
351
|
if (hasWorkflows) {
|
|
352
|
-
lines.push('', '### Workflow Execution Continuation', '', '- This guidance applies only to OAT project lifecycle execution, such as `oat-project-implement`,
|
|
352
|
+
lines.push('', '### Workflow Execution Continuation', '', '- This guidance applies only to OAT project lifecycle execution, such as `oat-project-implement`, and OAT project review/receive flows. It does not apply to non-OAT tasks or ad-hoc work outside the OAT project workflow.', '- When executing an OAT project implementation or OAT project review workflow, do not stop at task boundaries, phase boundaries, or other clean checkpoints unless the configured HiLL checkpoint has been reached, a real blocker exists, or explicit user input is required.', '- Status summaries, completed bookkeeping, and "clean boundary" pauses are not valid stop reasons. After updating tracking artifacts, continue execution until an allowed stop condition applies.');
|
|
353
353
|
}
|
|
354
354
|
return lines.join('\n');
|
|
355
355
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* `bundle-assets.sh` maintains its own bash array — `bundle-consistency.test.ts`
|
|
6
6
|
* validates that it stays in sync with these lists.
|
|
7
7
|
*/
|
|
8
|
-
export declare const WORKFLOW_SKILLS: readonly ["oat-project-capture", "oat-project-clear-active", "oat-project-complete", "oat-project-design", "oat-project-discover", "oat-project-document", "oat-project-implement", "oat-project-import-plan", "oat-project-new", "oat-project-next", "oat-project-open", "oat-project-plan", "oat-project-plan-writing", "oat-project-pr-final", "oat-project-pr-progress", "oat-project-progress", "oat-project-promote-spec-driven", "oat-project-quick-start", "oat-project-reconcile", "oat-project-revise", "oat-project-review-provide", "oat-project-review-receive", "oat-project-review-receive-remote", "oat-project-spec", "oat-project-
|
|
9
|
-
export declare const WORKFLOW_AGENTS: readonly ["oat-codebase-mapper.md", "oat-reviewer.md"];
|
|
8
|
+
export declare const WORKFLOW_SKILLS: readonly ["oat-project-capture", "oat-project-clear-active", "oat-project-complete", "oat-project-design", "oat-project-discover", "oat-project-document", "oat-project-implement", "oat-project-import-plan", "oat-project-new", "oat-project-next", "oat-project-open", "oat-project-plan", "oat-project-plan-writing", "oat-project-pr-final", "oat-project-pr-progress", "oat-project-progress", "oat-project-promote-spec-driven", "oat-project-quick-start", "oat-project-reconcile", "oat-project-revise", "oat-project-review-provide", "oat-project-review-receive", "oat-project-review-receive-remote", "oat-project-spec", "oat-project-summary", "oat-repo-knowledge-index", "oat-worktree-bootstrap", "oat-worktree-bootstrap-auto", "oat-wrap-up"];
|
|
9
|
+
export declare const WORKFLOW_AGENTS: readonly ["oat-codebase-mapper.md", "oat-phase-implementer.md", "oat-reviewer.md"];
|
|
10
10
|
export declare const WORKFLOW_TEMPLATES: readonly ["state.md", "discovery.md", "spec.md", "design.md", "plan.md", "implementation.md", "summary.md"];
|
|
11
11
|
export declare const WORKFLOW_SCRIPTS: readonly ["generate-oat-state.sh", "generate-thin-index.sh", "resolve-tracking.sh"];
|
|
12
12
|
export declare const IDEA_SKILLS: readonly ["oat-idea-new", "oat-idea-ideate", "oat-idea-summarize", "oat-idea-scratchpad"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"skill-manifest.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/skill-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,eAAe,muBA8BlB,CAAC;AAEX,eAAO,MAAM,eAAe,oFAIlB,CAAC;AAEX,eAAO,MAAM,kBAAkB,6GAQrB,CAAC;AAEX,eAAO,MAAM,gBAAgB,qFAInB,CAAC;AAIX,eAAO,MAAM,WAAW,2FAKd,CAAC;AAIX,eAAO,MAAM,WAAW,qCAAsC,CAAC;AAI/D,eAAO,MAAM,WAAW,yIAMd,CAAC;AAEX,eAAO,MAAM,YAAY,kCAAmC,CAAC;AAI7D,eAAO,MAAM,cAAc,gJAMjB,CAAC;AAIX,eAAO,MAAM,yBAAyB,kGAI5B,CAAC;AAEX,eAAO,MAAM,4BAA4B,4CAG/B,CAAC;AAEX,eAAO,MAAM,0BAA0B,aAAc,CAAC;AAItD,eAAO,MAAM,eAAe,2EAMlB,CAAC;AAEX,eAAO,MAAM,eAAe,qCAAsC,CAAC"}
|
|
@@ -31,7 +31,6 @@ export const WORKFLOW_SKILLS = [
|
|
|
31
31
|
'oat-project-review-receive',
|
|
32
32
|
'oat-project-review-receive-remote',
|
|
33
33
|
'oat-project-spec',
|
|
34
|
-
'oat-project-subagent-implement',
|
|
35
34
|
'oat-project-summary',
|
|
36
35
|
'oat-repo-knowledge-index',
|
|
37
36
|
'oat-worktree-bootstrap',
|
|
@@ -40,6 +39,7 @@ export const WORKFLOW_SKILLS = [
|
|
|
40
39
|
];
|
|
41
40
|
export const WORKFLOW_AGENTS = [
|
|
42
41
|
'oat-codebase-mapper.md',
|
|
42
|
+
'oat-phase-implementer.md',
|
|
43
43
|
'oat-reviewer.md',
|
|
44
44
|
];
|
|
45
45
|
export const WORKFLOW_TEMPLATES = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/project/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,wBAAgB,oBAAoB,IAAI,OAAO,CAY9C"}
|
|
@@ -7,6 +7,7 @@ import { createProjectOpenCommand } from './open/index.js';
|
|
|
7
7
|
import { createProjectPauseCommand } from './pause/index.js';
|
|
8
8
|
import { createProjectSetModeCommand } from './set-mode/index.js';
|
|
9
9
|
import { createProjectStatusCommand } from './status.js';
|
|
10
|
+
import { createProjectValidatePlanCommand } from './validate-plan/index.js';
|
|
10
11
|
export function createProjectCommand() {
|
|
11
12
|
return new Command('project')
|
|
12
13
|
.description('Manage OAT project workflows')
|
|
@@ -17,5 +18,6 @@ export function createProjectCommand() {
|
|
|
17
18
|
.addCommand(createProjectOpenCommand())
|
|
18
19
|
.addCommand(createProjectPauseCommand())
|
|
19
20
|
.addCommand(createProjectSetModeCommand())
|
|
20
|
-
.addCommand(createProjectStatusCommand())
|
|
21
|
+
.addCommand(createProjectStatusCommand())
|
|
22
|
+
.addCommand(createProjectValidatePlanCommand());
|
|
21
23
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { readFile as defaultReadFile, writeFile as defaultWriteFile } from 'node:fs/promises';
|
|
2
1
|
import { buildCommandContext, type CommandContext } from '../../../app/command-context.js';
|
|
3
2
|
import { Command } from 'commander';
|
|
4
|
-
export type ExecutionMode = 'single-thread' | 'subagent-driven';
|
|
5
3
|
interface SetModeDependencies {
|
|
6
4
|
buildCommandContext: (options: Parameters<typeof buildCommandContext>[0]) => CommandContext;
|
|
7
|
-
resolveProjectRoot: (cwd: string) => Promise<string>;
|
|
8
|
-
readFile: typeof defaultReadFile;
|
|
9
|
-
writeFile: typeof defaultWriteFile;
|
|
10
|
-
now: () => Date;
|
|
11
5
|
}
|
|
12
6
|
export declare function createProjectSetModeCommand(overrides?: Partial<SetModeDependencies>): Command;
|
|
13
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/set-mode/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/set-mode/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEhF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,mBAAmB;IAC3B,mBAAmB,EAAE,CACnB,OAAO,EAAE,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAAC,KAC/C,cAAc,CAAC;CACrB;AA+BD,wBAAgB,2BAA2B,CACzC,SAAS,GAAE,OAAO,CAAC,mBAAmB,CAAM,GAC3C,OAAO,CAeT"}
|
|
@@ -1,104 +1,24 @@
|
|
|
1
|
-
import { readFile as defaultReadFile, writeFile as defaultWriteFile, } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
1
|
import { buildCommandContext } from '../../../app/command-context.js';
|
|
4
|
-
import { getFrontmatterBlock, getFrontmatterField, } from '../../shared/frontmatter.js';
|
|
5
|
-
import { replaceFrontmatter, upsertFrontmatterField, } from '../../shared/frontmatter-write.js';
|
|
6
2
|
import { readGlobalOptions } from '../../shared/shared.utils.js';
|
|
7
|
-
import { readOatLocalConfig } from '../../../config/oat-config.js';
|
|
8
|
-
import { resolveProjectRoot } from '../../../fs/paths.js';
|
|
9
3
|
import { Command } from 'commander';
|
|
10
|
-
const ORCHESTRATION_DEFAULTS = [
|
|
11
|
-
{ field: 'oat_orchestration_merge_strategy', value: 'merge' },
|
|
12
|
-
{ field: 'oat_orchestration_retry_limit', value: '2' },
|
|
13
|
-
{ field: 'oat_orchestration_baseline_policy', value: 'strict' },
|
|
14
|
-
{ field: 'oat_orchestration_unit_granularity', value: 'phase' },
|
|
15
|
-
];
|
|
16
4
|
const DEFAULT_DEPENDENCIES = {
|
|
17
5
|
buildCommandContext,
|
|
18
|
-
resolveProjectRoot,
|
|
19
|
-
readFile: defaultReadFile,
|
|
20
|
-
writeFile: defaultWriteFile,
|
|
21
|
-
now: () => new Date(),
|
|
22
6
|
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const localConfig = await readOatLocalConfig(repoRoot);
|
|
33
|
-
const activeProject = localConfig.activeProject?.trim();
|
|
34
|
-
if (!activeProject) {
|
|
35
|
-
throw new Error('No active project found (.oat/config.local.json has no activeProject).');
|
|
36
|
-
}
|
|
37
|
-
const activeProjectPath = join(repoRoot, activeProject);
|
|
38
|
-
const statePath = join(activeProjectPath, 'state.md');
|
|
39
|
-
let stateContent;
|
|
40
|
-
try {
|
|
41
|
-
stateContent = await dependencies.readFile(statePath, 'utf8');
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
throw new Error(`Active project state.md not found: ${statePath}`);
|
|
45
|
-
}
|
|
46
|
-
const frontmatterBlock = getFrontmatterBlock(stateContent);
|
|
47
|
-
if (!frontmatterBlock) {
|
|
48
|
-
throw new Error(`state.md is missing frontmatter: ${statePath}`);
|
|
49
|
-
}
|
|
50
|
-
const previousMode = getFrontmatterField(frontmatterBlock, 'oat_execution_mode');
|
|
51
|
-
let currentBlock = frontmatterBlock;
|
|
52
|
-
const modeUpdate = upsertFrontmatterField(currentBlock, 'oat_execution_mode', modeArg, true);
|
|
53
|
-
currentBlock = modeUpdate.nextBlock;
|
|
54
|
-
const defaultsAdded = [];
|
|
55
|
-
if (modeArg === 'subagent-driven') {
|
|
56
|
-
for (const entry of ORCHESTRATION_DEFAULTS) {
|
|
57
|
-
const update = upsertFrontmatterField(currentBlock, entry.field, entry.value, false);
|
|
58
|
-
currentBlock = update.nextBlock;
|
|
59
|
-
if (update.added) {
|
|
60
|
-
defaultsAdded.push(entry.field);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
currentBlock = upsertFrontmatterField(currentBlock, 'oat_project_state_updated', dependencies.now().toISOString(), true).nextBlock;
|
|
65
|
-
const updatedState = replaceFrontmatter(stateContent, currentBlock);
|
|
66
|
-
await dependencies.writeFile(statePath, updatedState, 'utf8');
|
|
67
|
-
if (context.json) {
|
|
68
|
-
context.logger.json({
|
|
69
|
-
status: 'ok',
|
|
70
|
-
mode: modeArg,
|
|
71
|
-
previousMode: previousMode || null,
|
|
72
|
-
statePath,
|
|
73
|
-
projectPath: activeProjectPath,
|
|
74
|
-
defaultsAdded,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
context.logger.info(`Set execution mode to ${modeArg}`);
|
|
79
|
-
context.logger.info(`Project: ${activeProjectPath}`);
|
|
80
|
-
context.logger.info(`State: ${statePath}`);
|
|
81
|
-
if (modeArg === 'subagent-driven') {
|
|
82
|
-
if (defaultsAdded.length > 0) {
|
|
83
|
-
context.logger.info(`Added orchestration defaults: ${defaultsAdded.join(', ')}`);
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
context.logger.info('Orchestration defaults already present; no defaults added.');
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
7
|
+
const DEPRECATION_MESSAGE = 'Execution mode is no longer user-selectable; oat-project-implement is the single execution skill. No changes were made. This command will be removed in a future release.';
|
|
8
|
+
async function runSetMode(_modeArg, context) {
|
|
9
|
+
if (context.json) {
|
|
10
|
+
context.logger.json({
|
|
11
|
+
status: 'deprecated',
|
|
12
|
+
command: 'oat project set-mode',
|
|
13
|
+
message: DEPRECATION_MESSAGE,
|
|
14
|
+
noop: true,
|
|
15
|
+
});
|
|
90
16
|
process.exitCode = 0;
|
|
17
|
+
return;
|
|
91
18
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
context.logger.json({ status: 'error', message });
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
context.logger.error(message);
|
|
99
|
-
}
|
|
100
|
-
process.exitCode = 1;
|
|
101
|
-
}
|
|
19
|
+
context.logger.warn("[deprecated] 'oat project set-mode' is a no-op.\n" +
|
|
20
|
+
`${DEPRECATION_MESSAGE}`);
|
|
21
|
+
process.exitCode = 0;
|
|
102
22
|
}
|
|
103
23
|
export function createProjectSetModeCommand(overrides = {}) {
|
|
104
24
|
const dependencies = {
|
|
@@ -106,10 +26,10 @@ export function createProjectSetModeCommand(overrides = {}) {
|
|
|
106
26
|
...overrides,
|
|
107
27
|
};
|
|
108
28
|
return new Command('set-mode')
|
|
109
|
-
.description('
|
|
110
|
-
.argument('<mode>', 'Execution mode
|
|
29
|
+
.description('[deprecated] No-op. Execution mode is no longer selectable.')
|
|
30
|
+
.argument('<mode>', 'Ignored. Execution mode is no longer selectable.')
|
|
111
31
|
.action(async (mode, _options, command) => {
|
|
112
32
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
113
|
-
await runSetMode(mode, context
|
|
33
|
+
await runSetMode(mode, context);
|
|
114
34
|
});
|
|
115
35
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/project/validate-plan/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,gCAAgC,IAAI,OAAO,CAgD1D"}
|