@open-agent-toolkit/cli 0.1.31 → 0.1.32
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 +18 -5
- package/assets/docs/cli-utilities/tool-packs.md +13 -8
- package/assets/docs/reference/cli-reference.md +14 -13
- package/assets/docs/reference/file-locations.md +2 -1
- package/assets/docs/reference/oat-directory-structure.md +35 -22
- package/assets/migration/pjm-restructure.md +500 -0
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/deep-research/SKILL.md +2 -2
- package/assets/skills/oat-brainstorm/SKILL.md +3 -3
- package/assets/skills/oat-brainstorm/references/destinations.md +10 -2
- package/assets/skills/oat-brainstorm/references/dogfood-results.md +4 -4
- package/assets/skills/oat-pjm-add-backlog-item/SKILL.md +17 -20
- package/assets/skills/oat-pjm-decision/SKILL.md +129 -0
- package/assets/skills/oat-pjm-review-backlog/SKILL.md +17 -17
- package/assets/skills/oat-pjm-review-backlog/references/backlog-review-template.md +2 -2
- package/assets/skills/oat-pjm-review-backlog/references/priority-alignment-template.md +13 -13
- package/assets/skills/oat-pjm-update-repo-reference/SKILL.md +34 -25
- package/assets/skills/oat-project-complete/SKILL.md +2 -2
- package/assets/skills/oat-project-document/SKILL.md +4 -3
- package/assets/skills/oat-project-import-plan/SKILL.md +2 -2
- package/assets/skills/oat-project-summary/SKILL.md +76 -8
- package/assets/templates/backlog-item.md +1 -1
- package/assets/templates/current-state.md +11 -2
- package/assets/templates/decision.md +18 -0
- package/assets/templates/pjm-agents.md +13 -0
- package/assets/templates/reference-agents.md +14 -0
- package/assets/templates/repo-agents.md +13 -0
- package/assets/templates/roadmap.md +8 -3
- package/dist/commands/backlog/index.d.ts +1 -0
- package/dist/commands/backlog/index.d.ts.map +1 -1
- package/dist/commands/backlog/index.js +48 -11
- package/dist/commands/backlog/init.js +1 -1
- package/dist/commands/backlog/regenerate-index.d.ts.map +1 -1
- package/dist/commands/backlog/regenerate-index.js +24 -5
- package/dist/commands/backlog/shared/generate-id.d.ts +1 -3
- package/dist/commands/backlog/shared/generate-id.d.ts.map +1 -1
- package/dist/commands/backlog/shared/generate-id.js +4 -64
- package/dist/commands/cleanup/artifacts/artifacts.d.ts.map +1 -1
- package/dist/commands/cleanup/artifacts/artifacts.js +4 -1
- package/dist/commands/decision/index.d.ts +20 -0
- package/dist/commands/decision/index.d.ts.map +1 -0
- package/dist/commands/decision/index.js +177 -0
- package/dist/commands/decision/init.d.ts +7 -0
- package/dist/commands/decision/init.d.ts.map +1 -0
- package/dist/commands/decision/init.js +53 -0
- package/dist/commands/decision/migrate.d.ts +24 -0
- package/dist/commands/decision/migrate.d.ts.map +1 -0
- package/dist/commands/decision/migrate.js +270 -0
- package/dist/commands/decision/new.d.ts +16 -0
- package/dist/commands/decision/new.d.ts.map +1 -0
- package/dist/commands/decision/new.js +118 -0
- package/dist/commands/decision/regenerate-index.d.ts +14 -0
- package/dist/commands/decision/regenerate-index.d.ts.map +1 -0
- package/dist/commands/decision/regenerate-index.js +122 -0
- package/dist/commands/decision/shared/generate-id.d.ts +2 -0
- package/dist/commands/decision/shared/generate-id.d.ts.map +1 -0
- package/dist/commands/decision/shared/generate-id.js +5 -0
- package/dist/commands/doctor/index.d.ts +2 -0
- package/dist/commands/doctor/index.d.ts.map +1 -1
- package/dist/commands/doctor/index.js +6 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +2 -0
- 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 +5 -1
- package/dist/commands/pjm/doctor.d.ts +3 -0
- package/dist/commands/pjm/doctor.d.ts.map +1 -0
- package/dist/commands/pjm/doctor.js +238 -0
- package/dist/commands/pjm/index.d.ts +7 -0
- package/dist/commands/pjm/index.d.ts.map +1 -1
- package/dist/commands/pjm/index.js +132 -10
- package/dist/commands/pjm/init.d.ts +3 -2
- package/dist/commands/pjm/init.d.ts.map +1 -1
- package/dist/commands/pjm/init.js +42 -33
- package/dist/commands/pjm/migrate.d.ts +36 -0
- package/dist/commands/pjm/migrate.d.ts.map +1 -0
- package/dist/commands/pjm/migrate.js +393 -0
- package/dist/commands/shared/date-id.d.ts +2 -0
- package/dist/commands/shared/date-id.d.ts.map +1 -0
- package/dist/commands/shared/date-id.js +10 -0
- package/dist/commands/shared/managed-index.d.ts +22 -0
- package/dist/commands/shared/managed-index.d.ts.map +1 -0
- package/dist/commands/shared/managed-index.js +92 -0
- package/dist/commands/shared/slug.d.ts +2 -0
- package/dist/commands/shared/slug.d.ts.map +1 -0
- package/dist/commands/shared/slug.js +57 -0
- package/dist/commands/shared/strip-template-frontmatter.d.ts +2 -0
- package/dist/commands/shared/strip-template-frontmatter.d.ts.map +1 -0
- package/dist/commands/shared/strip-template-frontmatter.js +16 -0
- package/dist/release/public-package-contract.d.ts.map +1 -1
- package/dist/release/public-package-contract.js +10 -1
- package/package.json +2 -2
- package/assets/templates/decision-record.md +0 -21
|
@@ -1,21 +1,83 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { buildCommandContext } from '../../app/command-context.js';
|
|
3
3
|
import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
4
|
+
import { readOatConfig } from '../../config/oat-config.js';
|
|
4
5
|
import { resolveAssetsRoot } from '../../fs/assets.js';
|
|
5
6
|
import { resolveProjectRoot } from '../../fs/paths.js';
|
|
7
|
+
import { formatDoctorResults } from '../../ui/output.js';
|
|
6
8
|
import { Command } from 'commander';
|
|
9
|
+
import { runPjmDoctorChecks } from './doctor.js';
|
|
7
10
|
import { initializeRepoReference } from './init.js';
|
|
11
|
+
import { migratePjmRepo, readPjmMigrationPrompt } from './migrate.js';
|
|
8
12
|
const DEFAULT_DEPENDENCIES = {
|
|
9
13
|
buildCommandContext,
|
|
10
14
|
resolveProjectRoot,
|
|
11
15
|
resolveAssetsRoot,
|
|
16
|
+
readOatConfig,
|
|
12
17
|
initializeRepoReference,
|
|
18
|
+
runPjmDoctorChecks,
|
|
19
|
+
migratePjmRepo,
|
|
20
|
+
readPjmMigrationPrompt,
|
|
13
21
|
};
|
|
14
|
-
async function
|
|
22
|
+
async function resolveRepoRoot(context, projectRoot, configuredRoot) {
|
|
15
23
|
if (configuredRoot) {
|
|
16
24
|
return resolve(context.cwd, configuredRoot);
|
|
17
25
|
}
|
|
18
|
-
return resolve(projectRoot, '.oat', 'repo'
|
|
26
|
+
return resolve(projectRoot, '.oat', 'repo');
|
|
27
|
+
}
|
|
28
|
+
function reportError(context, error) {
|
|
29
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
30
|
+
if (context.json) {
|
|
31
|
+
context.logger.json({ status: 'error', message });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
context.logger.error(message);
|
|
35
|
+
}
|
|
36
|
+
process.exitCode = 1;
|
|
37
|
+
}
|
|
38
|
+
function doctorStatus(checks) {
|
|
39
|
+
if (checks.some((check) => check.status === 'fail')) {
|
|
40
|
+
return 'fail';
|
|
41
|
+
}
|
|
42
|
+
if (checks.some((check) => check.status === 'warn')) {
|
|
43
|
+
return 'warn';
|
|
44
|
+
}
|
|
45
|
+
return 'ok';
|
|
46
|
+
}
|
|
47
|
+
function setDoctorExitCode(checks) {
|
|
48
|
+
const status = doctorStatus(checks);
|
|
49
|
+
process.exitCode = status === 'fail' ? 2 : status === 'warn' ? 1 : 0;
|
|
50
|
+
}
|
|
51
|
+
function formatMigrationResult(result) {
|
|
52
|
+
const lines = [
|
|
53
|
+
`PJM migration ${result.dryRun ? 'dry run' : 'apply'} for ${result.repoRoot}`,
|
|
54
|
+
`status: ${result.status}`,
|
|
55
|
+
];
|
|
56
|
+
if (result.reason) {
|
|
57
|
+
lines.push(`reason: ${result.reason}`);
|
|
58
|
+
}
|
|
59
|
+
if (result.actions.length > 0) {
|
|
60
|
+
lines.push('actions:');
|
|
61
|
+
for (const action of result.actions) {
|
|
62
|
+
const pathSummary = action.source && action.target
|
|
63
|
+
? `${action.source} -> ${action.target}`
|
|
64
|
+
: (action.source ?? action.target ?? '');
|
|
65
|
+
lines.push(`- ${action.type} ${pathSummary} (${action.result}${action.reason ? `: ${action.reason}` : ''})`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (result.backlogMappings.length > 0) {
|
|
69
|
+
lines.push('backlog mappings:');
|
|
70
|
+
for (const mapping of result.backlogMappings) {
|
|
71
|
+
lines.push(`- ${mapping.legacyId} -> ${mapping.id}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
if (result.decisionMappings.length > 0) {
|
|
75
|
+
lines.push('decision mappings:');
|
|
76
|
+
for (const mapping of result.decisionMappings) {
|
|
77
|
+
lines.push(`- ${mapping.legacyId} -> ${mapping.id}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return lines.join('\n');
|
|
19
81
|
}
|
|
20
82
|
export function createPjmCommand(overrides = {}) {
|
|
21
83
|
const dependencies = {
|
|
@@ -26,15 +88,15 @@ export function createPjmCommand(overrides = {}) {
|
|
|
26
88
|
cmd
|
|
27
89
|
.command('init')
|
|
28
90
|
.description('Scaffold the canonical PJM repo reference surface')
|
|
29
|
-
.option('--
|
|
91
|
+
.option('--repo-root <path>', 'PJM repo reference root directory (defaults to .oat/repo)')
|
|
30
92
|
.action(async (options, command) => {
|
|
31
93
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
32
94
|
try {
|
|
33
95
|
const projectRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
34
|
-
const
|
|
96
|
+
const repoRoot = await resolveRepoRoot(context, projectRoot, options.repoRoot);
|
|
35
97
|
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
36
98
|
const result = await dependencies.initializeRepoReference({
|
|
37
|
-
|
|
99
|
+
repoRoot,
|
|
38
100
|
assetsRoot,
|
|
39
101
|
templatesRoot: resolve(projectRoot, '.oat', 'templates'),
|
|
40
102
|
});
|
|
@@ -42,7 +104,7 @@ export function createPjmCommand(overrides = {}) {
|
|
|
42
104
|
context.logger.json({ status: 'ok', ...result });
|
|
43
105
|
}
|
|
44
106
|
else {
|
|
45
|
-
context.logger.info(`Initialized PJM repo reference scaffold at ${result.
|
|
107
|
+
context.logger.info(`Initialized PJM repo reference scaffold at ${result.repoRoot}`);
|
|
46
108
|
if (result.created.length > 0) {
|
|
47
109
|
context.logger.info(`Created: ${result.created.join(', ')}`);
|
|
48
110
|
}
|
|
@@ -53,14 +115,74 @@ export function createPjmCommand(overrides = {}) {
|
|
|
53
115
|
process.exitCode = 0;
|
|
54
116
|
}
|
|
55
117
|
catch (error) {
|
|
56
|
-
|
|
118
|
+
reportError(context, error);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
cmd
|
|
122
|
+
.command('doctor')
|
|
123
|
+
.description('Run PJM repo reference diagnostics')
|
|
124
|
+
.option('--repo-root <path>', 'PJM repo reference root directory (defaults to .oat/repo)')
|
|
125
|
+
.action(async (options, command) => {
|
|
126
|
+
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
127
|
+
try {
|
|
128
|
+
const projectRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
129
|
+
const repoRoot = await resolveRepoRoot(context, projectRoot, options.repoRoot);
|
|
130
|
+
const checks = await dependencies.runPjmDoctorChecks(repoRoot);
|
|
131
|
+
const status = doctorStatus(checks);
|
|
57
132
|
if (context.json) {
|
|
58
|
-
context.logger.json({ status
|
|
133
|
+
context.logger.json({ status, repoRoot, checks });
|
|
59
134
|
}
|
|
60
135
|
else {
|
|
61
|
-
context.logger.
|
|
136
|
+
context.logger.info(formatDoctorResults(checks));
|
|
62
137
|
}
|
|
63
|
-
|
|
138
|
+
setDoctorExitCode(checks);
|
|
139
|
+
}
|
|
140
|
+
catch (error) {
|
|
141
|
+
reportError(context, error);
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
cmd
|
|
145
|
+
.command('migrate')
|
|
146
|
+
.description('Migrate legacy PJM repo reference docs to the two-layer layout')
|
|
147
|
+
.option('--repo-root <path>', 'PJM repo reference root directory (defaults to .oat/repo)')
|
|
148
|
+
.option('--apply', 'Apply mechanical migration steps')
|
|
149
|
+
.option('--dry-run', 'Preview migration without applying (default)')
|
|
150
|
+
.option('--print-prompt', 'Print the bundled agent migration prompt')
|
|
151
|
+
.action(async (options, command) => {
|
|
152
|
+
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
153
|
+
try {
|
|
154
|
+
const projectRoot = await dependencies.resolveProjectRoot(context.cwd);
|
|
155
|
+
const repoRoot = await resolveRepoRoot(context, projectRoot, options.repoRoot);
|
|
156
|
+
const assetsRoot = await dependencies.resolveAssetsRoot();
|
|
157
|
+
if (options.printPrompt) {
|
|
158
|
+
const prompt = await dependencies.readPjmMigrationPrompt(assetsRoot);
|
|
159
|
+
if (context.json) {
|
|
160
|
+
context.logger.json({ status: 'ok', prompt });
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
context.logger.info(prompt.trimEnd());
|
|
164
|
+
}
|
|
165
|
+
process.exitCode = 0;
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const config = await dependencies.readOatConfig(projectRoot);
|
|
169
|
+
const result = await dependencies.migratePjmRepo({
|
|
170
|
+
repoRoot,
|
|
171
|
+
assetsRoot,
|
|
172
|
+
templatesRoot: resolve(projectRoot, '.oat', 'templates'),
|
|
173
|
+
projectManagementEnabled: config.tools?.['project-management'] === true,
|
|
174
|
+
apply: options.dryRun ? false : (options.apply ?? false),
|
|
175
|
+
});
|
|
176
|
+
if (context.json) {
|
|
177
|
+
context.logger.json(result);
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
context.logger.info(formatMigrationResult(result));
|
|
181
|
+
}
|
|
182
|
+
process.exitCode = 0;
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
reportError(context, error);
|
|
64
186
|
}
|
|
65
187
|
});
|
|
66
188
|
return cmd;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
export interface InitializeRepoReferenceOptions {
|
|
2
|
-
|
|
2
|
+
repoRoot: string;
|
|
3
3
|
assetsRoot: string;
|
|
4
4
|
templatesRoot?: string;
|
|
5
5
|
}
|
|
6
6
|
export interface RepoReferenceInitResult {
|
|
7
|
-
|
|
7
|
+
repoRoot: string;
|
|
8
8
|
created: string[];
|
|
9
9
|
skipped: string[];
|
|
10
10
|
}
|
|
11
|
+
export declare const CANONICAL_REPO_REFERENCE_PATHS: readonly [...("AGENTS.md" | "pjm/AGENTS.md" | "pjm/current-state.md" | "pjm/roadmap.md" | "reference/AGENTS.md")[], "pjm/backlog/index.md", "pjm/backlog/completed.md", "pjm/backlog/items/.gitkeep", "pjm/backlog/archived/.gitkeep", "reference/decisions/index.md"];
|
|
11
12
|
export declare function initializeRepoReference(options: InitializeRepoReferenceOptions): Promise<RepoReferenceInitResult>;
|
|
12
13
|
//# sourceMappingURL=init.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/init.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/init.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAwBD,eAAO,MAAM,8BAA8B,wQAIjC,CAAC;AAyEX,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,uBAAuB,CAAC,CAgElC"}
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { access, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
2
|
import { dirname, join } from 'node:path';
|
|
3
3
|
import { initializeBacklog } from '../backlog/init.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
'
|
|
4
|
+
import { initializeDecisionRecords } from '../decision/init.js';
|
|
5
|
+
import { stripTemplateFrontmatter } from '../shared/strip-template-frontmatter.js';
|
|
6
|
+
const TEMPLATE_TARGETS = [
|
|
7
|
+
{ template: 'repo-agents.md', target: 'AGENTS.md' },
|
|
8
|
+
{ template: 'pjm-agents.md', target: 'pjm/AGENTS.md' },
|
|
9
|
+
{ template: 'current-state.md', target: 'pjm/current-state.md' },
|
|
10
|
+
{ template: 'roadmap.md', target: 'pjm/roadmap.md' },
|
|
11
|
+
{ template: 'reference-agents.md', target: 'reference/AGENTS.md' },
|
|
8
12
|
];
|
|
9
13
|
const BACKLOG_PATHS = [
|
|
10
|
-
'backlog/index.md',
|
|
11
|
-
'backlog/completed.md',
|
|
12
|
-
'backlog/items/.gitkeep',
|
|
13
|
-
'backlog/archived/.gitkeep',
|
|
14
|
+
'pjm/backlog/index.md',
|
|
15
|
+
'pjm/backlog/completed.md',
|
|
16
|
+
'pjm/backlog/items/.gitkeep',
|
|
17
|
+
'pjm/backlog/archived/.gitkeep',
|
|
18
|
+
];
|
|
19
|
+
const DECISION_PATHS = ['reference/decisions/index.md'];
|
|
20
|
+
export const CANONICAL_REPO_REFERENCE_PATHS = [
|
|
21
|
+
...TEMPLATE_TARGETS.map((target) => target.target),
|
|
22
|
+
...BACKLOG_PATHS,
|
|
23
|
+
...DECISION_PATHS,
|
|
14
24
|
];
|
|
15
25
|
async function pathExists(path) {
|
|
16
26
|
try {
|
|
@@ -54,22 +64,6 @@ async function resolveTemplateContent(name, options) {
|
|
|
54
64
|
}
|
|
55
65
|
throw new Error(`Template ${name} was not found in repo-local templates or bundled assets.`);
|
|
56
66
|
}
|
|
57
|
-
function stripTemplateFrontmatter(content) {
|
|
58
|
-
if (!content.startsWith('---\n')) {
|
|
59
|
-
return content;
|
|
60
|
-
}
|
|
61
|
-
const end = content.indexOf('\n---', 4);
|
|
62
|
-
if (end === -1) {
|
|
63
|
-
return content;
|
|
64
|
-
}
|
|
65
|
-
const frontmatter = content.slice(4, end);
|
|
66
|
-
if (!/\boat_template\s*:/i.test(frontmatter) &&
|
|
67
|
-
!/\boat_template_name\s*:/i.test(frontmatter)) {
|
|
68
|
-
return content;
|
|
69
|
-
}
|
|
70
|
-
const afterFrontmatter = content.slice(end + '\n---'.length);
|
|
71
|
-
return afterFrontmatter.replace(/^\r?\n+/, '');
|
|
72
|
-
}
|
|
73
67
|
async function writeFileIfMissing(filePath, content) {
|
|
74
68
|
if (await pathExists(filePath)) {
|
|
75
69
|
return 'skipped';
|
|
@@ -81,28 +75,28 @@ async function writeFileIfMissing(filePath, content) {
|
|
|
81
75
|
export async function initializeRepoReference(options) {
|
|
82
76
|
const created = [];
|
|
83
77
|
const skipped = [];
|
|
84
|
-
for (const
|
|
85
|
-
const targetPath = join(options.
|
|
78
|
+
for (const target of TEMPLATE_TARGETS) {
|
|
79
|
+
const targetPath = join(options.repoRoot, target.target);
|
|
86
80
|
if (await pathExists(targetPath)) {
|
|
87
|
-
skipped.push(
|
|
81
|
+
skipped.push(target.target);
|
|
88
82
|
continue;
|
|
89
83
|
}
|
|
90
|
-
const template = await resolveTemplateContent(
|
|
84
|
+
const template = await resolveTemplateContent(target.template, options);
|
|
91
85
|
const status = await writeFileIfMissing(targetPath, stripTemplateFrontmatter(template));
|
|
92
86
|
if (status === 'created') {
|
|
93
|
-
created.push(
|
|
87
|
+
created.push(target.target);
|
|
94
88
|
}
|
|
95
89
|
else {
|
|
96
|
-
skipped.push(
|
|
90
|
+
skipped.push(target.target);
|
|
97
91
|
}
|
|
98
92
|
}
|
|
99
93
|
const existingBacklogPaths = new Set();
|
|
100
94
|
for (const relativePath of BACKLOG_PATHS) {
|
|
101
|
-
if (await pathExists(join(options.
|
|
95
|
+
if (await pathExists(join(options.repoRoot, relativePath))) {
|
|
102
96
|
existingBacklogPaths.add(relativePath);
|
|
103
97
|
}
|
|
104
98
|
}
|
|
105
|
-
await initializeBacklog(join(options.
|
|
99
|
+
await initializeBacklog(join(options.repoRoot, 'pjm', 'backlog'));
|
|
106
100
|
for (const relativePath of BACKLOG_PATHS) {
|
|
107
101
|
if (existingBacklogPaths.has(relativePath)) {
|
|
108
102
|
skipped.push(relativePath);
|
|
@@ -111,8 +105,23 @@ export async function initializeRepoReference(options) {
|
|
|
111
105
|
created.push(relativePath);
|
|
112
106
|
}
|
|
113
107
|
}
|
|
108
|
+
const existingDecisionPaths = new Set();
|
|
109
|
+
for (const relativePath of DECISION_PATHS) {
|
|
110
|
+
if (await pathExists(join(options.repoRoot, relativePath))) {
|
|
111
|
+
existingDecisionPaths.add(relativePath);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
await initializeDecisionRecords(join(options.repoRoot, 'reference', 'decisions'));
|
|
115
|
+
for (const relativePath of DECISION_PATHS) {
|
|
116
|
+
if (existingDecisionPaths.has(relativePath)) {
|
|
117
|
+
skipped.push(relativePath);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
created.push(relativePath);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
114
123
|
return {
|
|
115
|
-
|
|
124
|
+
repoRoot: options.repoRoot,
|
|
116
125
|
created,
|
|
117
126
|
skipped,
|
|
118
127
|
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type DecisionMigrationMapping } from '../decision/migrate.js';
|
|
2
|
+
export type PjmMigrationActionType = 'move' | 'create' | 'migrate-backlog' | 'migrate-decisions' | 'propose';
|
|
3
|
+
export type PjmMigrationActionResult = 'planned' | 'applied' | 'skipped';
|
|
4
|
+
export interface PjmMigrationAction {
|
|
5
|
+
type: PjmMigrationActionType;
|
|
6
|
+
result: PjmMigrationActionResult;
|
|
7
|
+
source?: string;
|
|
8
|
+
target?: string;
|
|
9
|
+
reason?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface PjmBacklogMigrationMapping {
|
|
12
|
+
legacyId: string;
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
filePath: string;
|
|
16
|
+
}
|
|
17
|
+
export interface PjmMigrationResult {
|
|
18
|
+
repoRoot: string;
|
|
19
|
+
status: 'skipped' | 'dry-run' | 'already-migrated' | 'migrated';
|
|
20
|
+
reason?: string;
|
|
21
|
+
dryRun: boolean;
|
|
22
|
+
actions: PjmMigrationAction[];
|
|
23
|
+
backlogMappings: PjmBacklogMigrationMapping[];
|
|
24
|
+
decisionMappings: DecisionMigrationMapping[];
|
|
25
|
+
written: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface PjmMigrationOptions {
|
|
28
|
+
repoRoot: string;
|
|
29
|
+
assetsRoot: string;
|
|
30
|
+
templatesRoot?: string;
|
|
31
|
+
projectManagementEnabled: boolean;
|
|
32
|
+
apply?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare function migratePjmRepo(options: PjmMigrationOptions): Promise<PjmMigrationResult>;
|
|
35
|
+
export declare function readPjmMigrationPrompt(assetsRoot: string): Promise<string>;
|
|
36
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/commands/pjm/migrate.ts"],"names":[],"mappings":"AAeA,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,4BAA4B,CAAC;AAMpC,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,QAAQ,GACR,iBAAiB,GACjB,mBAAmB,GACnB,SAAS,CAAC;AAEd,MAAM,MAAM,wBAAwB,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzE,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,sBAAsB,CAAC;IAC7B,MAAM,EAAE,wBAAwB,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,kBAAkB,GAAG,UAAU,CAAC;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,eAAe,EAAE,0BAA0B,EAAE,CAAC;IAC9C,gBAAgB,EAAE,wBAAwB,EAAE,CAAC;IAC7C,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAoZD,wBAAsB,cAAc,CAClC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CAkG7B;AAED,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAEjB"}
|