@aipper/aiws 0.0.46 → 0.0.47
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/dist/cli.js +13 -2
- package/dist/cli.js.map +1 -1
- package/dist/codex-prompts.d.ts +17 -0
- package/dist/codex-prompts.js +49 -0
- package/dist/codex-prompts.js.map +1 -0
- package/dist/codex-skills.d.ts +17 -0
- package/dist/codex-skills.js +75 -0
- package/dist/codex-skills.js.map +1 -0
- package/dist/commands/codex-install-prompts.d.ts +4 -0
- package/dist/commands/codex-install-prompts.js +68 -0
- package/dist/commands/codex-install-prompts.js.map +1 -0
- package/dist/commands/codex-install-skills.d.ts +4 -0
- package/dist/commands/codex-install-skills.js +74 -0
- package/dist/commands/codex-install-skills.js.map +1 -0
- package/dist/commands/codex-status-prompts.d.ts +4 -0
- package/dist/commands/codex-status-prompts.js +44 -0
- package/dist/commands/codex-status-prompts.js.map +1 -0
- package/dist/commands/codex-status-skills.d.ts +4 -0
- package/dist/commands/codex-status-skills.js +54 -0
- package/dist/commands/codex-status-skills.js.map +1 -0
- package/dist/commands/codex-uninstall-prompts.d.ts +4 -0
- package/dist/commands/codex-uninstall-prompts.js +51 -0
- package/dist/commands/codex-uninstall-prompts.js.map +1 -0
- package/dist/commands/codex-uninstall-skills.d.ts +4 -0
- package/dist/commands/codex-uninstall-skills.js +59 -0
- package/dist/commands/codex-uninstall-skills.js.map +1 -0
- package/dist/commands/goal-advance.d.ts +20 -2
- package/dist/commands/goal-advance.js +201 -44
- package/dist/commands/goal-advance.js.map +1 -1
- package/dist/commands/goal-help.js +6 -2
- package/dist/commands/goal-help.js.map +1 -1
- package/dist/commands/goal-validate-state.d.ts +16 -1
- package/dist/commands/goal-validate-state.js +61 -3
- package/dist/commands/goal-validate-state.js.map +1 -1
- package/dist/commands/init.d.ts +7 -2
- package/dist/commands/init.js +60 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/hooks/deploy-claude.d.ts +13 -0
- package/dist/hooks/deploy-claude.js +67 -0
- package/dist/hooks/deploy-claude.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import fs from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { loadTemplate } from "../spec.js";
|
|
4
|
+
import { normalizeNewlines } from "../hash.js";
|
|
5
|
+
import { findManagedBlock } from "../managed-blocks.js";
|
|
6
|
+
import { pathExists, readText } from "../fs.js";
|
|
7
|
+
import { listTemplateCodexSkills, resolveCodexSkillsDir } from "../codex-skills.js";
|
|
8
|
+
/**
|
|
9
|
+
* @param {{ templateId: string, skillsDir?: string }} options
|
|
10
|
+
*/
|
|
11
|
+
export async function codexStatusSkillsCommand(options) {
|
|
12
|
+
const templateId = String(options.templateId || "workspace");
|
|
13
|
+
const tpl = await loadTemplate(templateId);
|
|
14
|
+
const skillsDir = resolveCodexSkillsDir(options.skillsDir);
|
|
15
|
+
const skillsDirIsSymlink = await fs
|
|
16
|
+
.lstat(skillsDir)
|
|
17
|
+
.then((st) => st.isSymbolicLink())
|
|
18
|
+
.catch(() => false);
|
|
19
|
+
const skillsDirReal = skillsDirIsSymlink ? await fs.realpath(skillsDir).catch(() => skillsDir) : skillsDir;
|
|
20
|
+
const skillFiles = await listTemplateCodexSkills(tpl);
|
|
21
|
+
/** @type {Array<{ name: string, status: "ok" | "missing" | "unmanaged" | "outdated" }>} */
|
|
22
|
+
const rows = [];
|
|
23
|
+
for (const sf of skillFiles) {
|
|
24
|
+
const destAbs = path.join(skillsDir, sf.skillName, "SKILL.md");
|
|
25
|
+
if (!(await pathExists(destAbs))) {
|
|
26
|
+
rows.push({ name: sf.skillName, status: "missing" });
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const currentText = normalizeNewlines(await readText(destAbs));
|
|
30
|
+
const block = findManagedBlock(currentText, sf.blockId);
|
|
31
|
+
if (!block) {
|
|
32
|
+
rows.push({ name: sf.skillName, status: "unmanaged" });
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
rows.push({ name: sf.skillName, status: block.innerText === sf.innerText ? "ok" : "outdated" });
|
|
36
|
+
}
|
|
37
|
+
const counts = rows.reduce((acc, r) => {
|
|
38
|
+
acc[r.status] = (acc[r.status] || 0) + 1;
|
|
39
|
+
return acc;
|
|
40
|
+
}, { ok: 0, missing: 0, unmanaged: 0, outdated: 0 });
|
|
41
|
+
const header = skillsDirIsSymlink && skillsDirReal !== skillsDir ? `${skillsDir} -> ${skillsDirReal}` : skillsDir;
|
|
42
|
+
console.log(`✓ aiws codex status-skills: ${header}`);
|
|
43
|
+
console.log(`ok=${counts.ok} missing=${counts.missing} unmanaged=${counts.unmanaged} outdated=${counts.outdated}`);
|
|
44
|
+
for (const r of rows) {
|
|
45
|
+
console.log(`${r.status}\t${r.name}`);
|
|
46
|
+
}
|
|
47
|
+
if (counts.ok === 0 && counts.missing === rows.length && skillsDirIsSymlink) {
|
|
48
|
+
console.log("Note: skills dir is a symlink; if you installed to a different dir, pass --dir (or set CODEX_HOME).");
|
|
49
|
+
}
|
|
50
|
+
if (counts.missing > 0 || counts.outdated > 0) {
|
|
51
|
+
console.log("Next: aiws codex install-skills");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=codex-status-skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-status-skills.js","sourceRoot":"","sources":["../../src/commands/codex-status-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,uB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OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,IAAI,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,MAAM,IAAI,kBAAkB,EAAE,CAAC;QAC5E,OAAO,CAAC,GAAG,CAAC,qGAAqG,CAAC,CAAC;IACrH,CAAC;IACD,IAAI,MAAM,CAAC,OAAO,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IACjD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import { loadTemplate } from "../spec.js";
|
|
4
|
+
import { normalizeNewlines } from "../hash.js";
|
|
5
|
+
import { findManagedBlock } from "../managed-blocks.js";
|
|
6
|
+
import { copyFile, pathExists, readText } from "../fs.js";
|
|
7
|
+
import { codexBackupPathFor, codexBackupStamp, listTemplateCodexPrompts, resolveCodexPromptsDir } from "../codex-prompts.js";
|
|
8
|
+
/**
|
|
9
|
+
* @param {{ templateId: string, promptsDir?: string }} options
|
|
10
|
+
*/
|
|
11
|
+
export async function codexUninstallPromptsCommand(options) {
|
|
12
|
+
const templateId = String(options.templateId || "workspace");
|
|
13
|
+
const tpl = await loadTemplate(templateId);
|
|
14
|
+
const promptsDir = resolveCodexPromptsDir(options.promptsDir);
|
|
15
|
+
const promptFiles = await listTemplateCodexPrompts(tpl);
|
|
16
|
+
const backupStamp = codexBackupStamp();
|
|
17
|
+
const backupDir = path.join(promptsDir, ".aiws", "backups", "codex-prompts", backupStamp);
|
|
18
|
+
/** @type {string[]} */
|
|
19
|
+
const removed = [];
|
|
20
|
+
/** @type {string[]} */
|
|
21
|
+
const skippedUnmanaged = [];
|
|
22
|
+
/** @type {string[]} */
|
|
23
|
+
const missing = [];
|
|
24
|
+
for (const pf of promptFiles) {
|
|
25
|
+
const destAbs = path.join(promptsDir, pf.filename);
|
|
26
|
+
if (!(await pathExists(destAbs))) {
|
|
27
|
+
missing.push(pf.filename);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const currentText = normalizeNewlines(await readText(destAbs));
|
|
31
|
+
const block = findManagedBlock(currentText, pf.blockId);
|
|
32
|
+
if (!block) {
|
|
33
|
+
skippedUnmanaged.push(pf.filename);
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const backup = codexBackupPathFor(promptsDir, pf.filename, backupStamp);
|
|
37
|
+
await copyFile(destAbs, backup);
|
|
38
|
+
await fs.unlink(destAbs);
|
|
39
|
+
removed.push(pf.filename);
|
|
40
|
+
}
|
|
41
|
+
console.log(`✓ aiws codex uninstall-prompts: ${promptsDir}`);
|
|
42
|
+
if (removed.length > 0)
|
|
43
|
+
console.log(`removed: ${removed.join(", ")}`);
|
|
44
|
+
if (removed.length > 0)
|
|
45
|
+
console.log(`backup: ${backupDir}`);
|
|
46
|
+
if (skippedUnmanaged.length > 0)
|
|
47
|
+
console.log(`skipped (unmanaged): ${skippedUnmanaged.join(", ")}`);
|
|
48
|
+
if (missing.length > 0)
|
|
49
|
+
console.log(`missing: ${missing.join(", ")}`);
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=codex-uninstall-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-uninstall-prompts.js","sourceRoot":"","sources":["../../src/commands/codex-uninstall-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE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D,MAAM,KAAK,GAAG,gBAAgB,CAAC,WAAW,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;YACnC,SAAS;QACX,CAAC;QAED,MAAM,MAAM,GAAG,kBAAkB,CAAC,UAAU,EAAE,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;QACxE,MAAM,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAChC,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,mCAAmC,UAAU,EAAE,CAAC,CAAC;IAC7D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC;IAC5D,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpG,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import { loadTemplate } from "../spec.js";
|
|
4
|
+
import { normalizeNewlines } from "../hash.js";
|
|
5
|
+
import { findManagedBlock } from "../managed-blocks.js";
|
|
6
|
+
import { copyFile, pathExists, readText } from "../fs.js";
|
|
7
|
+
import { codexSkillsBackupPathFor, codexSkillsBackupStamp, listTemplateCodexSkills, resolveCodexSkillsDir } from "../codex-skills.js";
|
|
8
|
+
/**
|
|
9
|
+
* @param {{ templateId: string, skillsDir?: string }} options
|
|
10
|
+
*/
|
|
11
|
+
export async function codexUninstallSkillsCommand(options) {
|
|
12
|
+
const templateId = String(options.templateId || "workspace");
|
|
13
|
+
const tpl = await loadTemplate(templateId);
|
|
14
|
+
const skillsDir = resolveCodexSkillsDir(options.skillsDir);
|
|
15
|
+
const skillFiles = await listTemplateCodexSkills(tpl);
|
|
16
|
+
const backupStamp = codexSkillsBackupStamp();
|
|
17
|
+
const backupDir = path.join(skillsDir, ".aiws", "backups", "codex-skills", backupStamp);
|
|
18
|
+
/** @type {string[]} */
|
|
19
|
+
const removed = [];
|
|
20
|
+
/** @type {string[]} */
|
|
21
|
+
const skippedUnmanaged = [];
|
|
22
|
+
/** @type {string[]} */
|
|
23
|
+
const missing = [];
|
|
24
|
+
for (const sf of skillFiles) {
|
|
25
|
+
const destDir = path.join(skillsDir, sf.skillName);
|
|
26
|
+
const destAbs = path.join(destDir, "SKILL.md");
|
|
27
|
+
if (!(await pathExists(destAbs))) {
|
|
28
|
+
missing.push(sf.skillName);
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const currentText = normalizeNewlines(await readText(destAbs));
|
|
32
|
+
const block = findManagedBlock(currentText, sf.blockId);
|
|
33
|
+
if (!block) {
|
|
34
|
+
skippedUnmanaged.push(sf.skillName);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const backup = codexSkillsBackupPathFor(skillsDir, sf.skillName, backupStamp);
|
|
38
|
+
await copyFile(destAbs, backup);
|
|
39
|
+
await fs.unlink(destAbs);
|
|
40
|
+
// Only remove the directory if it's empty after removing SKILL.md.
|
|
41
|
+
try {
|
|
42
|
+
await fs.rmdir(destDir);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
// ignore
|
|
46
|
+
}
|
|
47
|
+
removed.push(sf.skillName);
|
|
48
|
+
}
|
|
49
|
+
console.log(`✓ aiws codex uninstall-skills: ${skillsDir}`);
|
|
50
|
+
if (removed.length > 0)
|
|
51
|
+
console.log(`removed: ${removed.join(", ")}`);
|
|
52
|
+
if (removed.length > 0)
|
|
53
|
+
console.log(`backup: ${backupDir}`);
|
|
54
|
+
if (skippedUnmanaged.length > 0)
|
|
55
|
+
console.log(`skipped (unmanaged): ${skippedUnmanaged.join(", ")}`);
|
|
56
|
+
if (missing.length > 0)
|
|
57
|
+
console.log(`missing: ${missing.join(", ")}`);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=codex-uninstall-skills.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex-uninstall-skills.js","sourceRoot":"","sources":["../../src/commands/codex-uninstall-skills.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEtI;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,OAAY;IAC5D,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,IAAI,WAAW,CAAC,CAAC;IAC7D,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;IAE3C,MAAM,SAAS,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CAAC;QAChC,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACzB,mEAAmE;QACnE,IAAI,CAAC;YACH,MAAM,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;IAC7B,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,kCAAkC,SAAS,EAAE,CAAC,CAAC;IAC3D,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACtE,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,WAAW,SAAS,EAAE,CAAC,CAAC;IAC5D,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpG,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,YAAY,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxE,CAAC"}
|
|
@@ -7,12 +7,30 @@ export interface GoalAdvanceOptions {
|
|
|
7
7
|
phase?: string;
|
|
8
8
|
/** If true, only show what would change without writing */
|
|
9
9
|
dryRun?: boolean;
|
|
10
|
+
/** If true, output structured JSON for AI consumption */
|
|
11
|
+
json?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface GoalAdvanceResult {
|
|
14
|
+
ok: boolean;
|
|
15
|
+
goalId: string;
|
|
16
|
+
previousPhase: string | null;
|
|
17
|
+
currentPhase: string | null;
|
|
18
|
+
status: "active" | "complete" | "blocked" | "error";
|
|
19
|
+
done: boolean;
|
|
20
|
+
nextActions: {
|
|
21
|
+
phase: string;
|
|
22
|
+
description: string;
|
|
23
|
+
needsUserInput: boolean;
|
|
24
|
+
blockers: string[];
|
|
25
|
+
} | null;
|
|
26
|
+
currentGroup: string | null;
|
|
27
|
+
message: string;
|
|
10
28
|
}
|
|
11
29
|
/**
|
|
12
30
|
* `aiws goal advance` command handler.
|
|
13
31
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
32
|
+
* Completes the current phase (if in_progress), then advances to the next phase.
|
|
33
|
+
* Sets the next phase checkpoint to in_progress and writes updated state.
|
|
16
34
|
*/
|
|
17
35
|
export declare function goalAdvanceCommand(options: GoalAdvanceOptions): Promise<{
|
|
18
36
|
ok: boolean;
|
|
@@ -1,61 +1,118 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { VALID_PHASES, readGoalState, writeGoalState, validateGoalState, computeNextPhase, listPendingPhases, resolveGoalStatePath, } from "./goal-validate-state.js";
|
|
2
|
+
import { VALID_PHASES, readGoalState, writeGoalState, validateGoalState, computeNextPhase, listPendingPhases, resolveGoalStatePath, getPhaseGuidance, } from "./goal-validate-state.js";
|
|
3
3
|
/**
|
|
4
4
|
* `aiws goal advance` command handler.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Completes the current phase (if in_progress), then advances to the next phase.
|
|
7
|
+
* Sets the next phase checkpoint to in_progress and writes updated state.
|
|
8
8
|
*/
|
|
9
9
|
export async function goalAdvanceCommand(options) {
|
|
10
|
-
// Resolve goal state file
|
|
11
10
|
const statePath = await resolveGoalStatePath(options.goalDir, options.goalId);
|
|
12
11
|
if (!statePath) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:
|
|
16
|
-
|
|
12
|
+
return formatResult({
|
|
13
|
+
ok: false,
|
|
14
|
+
goalId: options.goalId ?? "unknown",
|
|
15
|
+
previousPhase: null,
|
|
16
|
+
currentPhase: null,
|
|
17
|
+
status: "error",
|
|
18
|
+
done: false,
|
|
19
|
+
nextActions: null,
|
|
20
|
+
currentGroup: null,
|
|
21
|
+
message: options.goalId
|
|
22
|
+
? `Goal state file not found: ${path.join(options.goalDir, `${options.goalId}.state.json`)}`
|
|
23
|
+
: "No goal state files found in " + options.goalDir,
|
|
24
|
+
}, options.json ?? false);
|
|
17
25
|
}
|
|
18
26
|
const goalId = options.goalId ?? path.basename(statePath, ".state.json");
|
|
19
27
|
const state = await readGoalState(statePath);
|
|
20
28
|
// Validate state integrity
|
|
21
29
|
const validation = validateGoalState(state);
|
|
22
30
|
if (!validation.valid) {
|
|
23
|
-
return {
|
|
31
|
+
return formatResult({
|
|
24
32
|
ok: false,
|
|
25
|
-
|
|
26
|
-
|
|
33
|
+
goalId,
|
|
34
|
+
previousPhase: null,
|
|
35
|
+
currentPhase: state.current_phase ?? null,
|
|
36
|
+
status: "error",
|
|
37
|
+
done: false,
|
|
38
|
+
nextActions: null,
|
|
39
|
+
currentGroup: null,
|
|
40
|
+
message: `State validation failed:\n${validation.errors.join("\n")}`,
|
|
41
|
+
}, options.json ?? false);
|
|
27
42
|
}
|
|
28
43
|
if (options.phase) {
|
|
29
|
-
|
|
30
|
-
return advanceToExplicitPhase(statePath, state, goalId, options.phase, options.dryRun);
|
|
44
|
+
return advanceToExplicitPhase(statePath, state, goalId, options);
|
|
31
45
|
}
|
|
32
|
-
|
|
33
|
-
return autoAdvancePhase(statePath, state, goalId, options.dryRun);
|
|
46
|
+
return autoAdvancePhase(statePath, state, goalId, options);
|
|
34
47
|
}
|
|
35
|
-
async function advanceToExplicitPhase(statePath, state, goalId,
|
|
48
|
+
async function advanceToExplicitPhase(statePath, state, goalId, options) {
|
|
49
|
+
const phase = options.phase;
|
|
36
50
|
if (!VALID_PHASES.includes(phase)) {
|
|
37
|
-
return {
|
|
51
|
+
return formatResult({
|
|
38
52
|
ok: false,
|
|
39
|
-
|
|
40
|
-
|
|
53
|
+
goalId,
|
|
54
|
+
previousPhase: state.current_phase ?? null,
|
|
55
|
+
currentPhase: null,
|
|
56
|
+
status: "error",
|
|
57
|
+
done: false,
|
|
58
|
+
nextActions: null,
|
|
59
|
+
currentGroup: null,
|
|
60
|
+
message: `Invalid phase: "${phase}". Valid phases: ${VALID_PHASES.join(", ")}`,
|
|
61
|
+
}, options.json ?? false);
|
|
62
|
+
}
|
|
63
|
+
// Complete the current phase first
|
|
64
|
+
const prevPhase = state.current_phase ?? null;
|
|
65
|
+
if (prevPhase && prevPhase !== phase) {
|
|
66
|
+
const prevCp = state.checkpoints[prevPhase];
|
|
67
|
+
if (prevCp && prevCp.status === "in_progress") {
|
|
68
|
+
state.checkpoints[prevPhase] = {
|
|
69
|
+
...prevCp,
|
|
70
|
+
status: "complete",
|
|
71
|
+
completed_at: new Date().toISOString(),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
41
74
|
}
|
|
42
|
-
//
|
|
75
|
+
// Verify all prerequisite phases are complete
|
|
43
76
|
const phaseIdx = VALID_PHASES.indexOf(phase);
|
|
44
77
|
for (let i = 0; i < phaseIdx; i++) {
|
|
45
78
|
const depPhase = VALID_PHASES[i];
|
|
46
79
|
const depCp = state.checkpoints[depPhase];
|
|
47
80
|
if (depCp && depCp.status !== "complete") {
|
|
48
|
-
return {
|
|
81
|
+
return formatResult({
|
|
49
82
|
ok: false,
|
|
50
|
-
|
|
51
|
-
|
|
83
|
+
goalId,
|
|
84
|
+
previousPhase: prevPhase,
|
|
85
|
+
currentPhase: state.current_phase ?? null,
|
|
86
|
+
status: "blocked",
|
|
87
|
+
done: false,
|
|
88
|
+
nextActions: {
|
|
89
|
+
phase: depPhase,
|
|
90
|
+
description: `Prerequisite phase "${depPhase}" must be completed before advancing to "${phase}"`,
|
|
91
|
+
needsUserInput: false,
|
|
92
|
+
blockers: [`Phase ${depPhase} is ${depCp.status}`],
|
|
93
|
+
},
|
|
94
|
+
currentGroup: null,
|
|
95
|
+
message: `Cannot advance to "${phase}": prerequisite "${depPhase}" is ${depCp.status}`,
|
|
96
|
+
}, options.json ?? false);
|
|
52
97
|
}
|
|
53
98
|
}
|
|
54
|
-
if (dryRun) {
|
|
55
|
-
return {
|
|
99
|
+
if (options.dryRun) {
|
|
100
|
+
return formatResult({
|
|
56
101
|
ok: true,
|
|
57
|
-
|
|
58
|
-
|
|
102
|
+
goalId,
|
|
103
|
+
previousPhase: prevPhase,
|
|
104
|
+
currentPhase: phase,
|
|
105
|
+
status: "active",
|
|
106
|
+
done: false,
|
|
107
|
+
nextActions: {
|
|
108
|
+
phase,
|
|
109
|
+
description: `[DRY RUN] Would advance to phase "${phase}". No changes written.`,
|
|
110
|
+
needsUserInput: false,
|
|
111
|
+
blockers: [],
|
|
112
|
+
},
|
|
113
|
+
currentGroup: null,
|
|
114
|
+
message: `[DRY RUN] Would advance ${goalId} to phase "${phase}"`,
|
|
115
|
+
}, options.json ?? false);
|
|
59
116
|
}
|
|
60
117
|
// Initialize or update checkpoint for the target phase
|
|
61
118
|
const existingCp = state.checkpoints[phase];
|
|
@@ -68,32 +125,89 @@ async function advanceToExplicitPhase(statePath, state, goalId, phase, dryRun) {
|
|
|
68
125
|
state.current_phase = phase;
|
|
69
126
|
state.updated_at = new Date().toISOString();
|
|
70
127
|
await writeGoalState(statePath, state);
|
|
71
|
-
|
|
128
|
+
const guidance = getPhaseGuidance(goalId, state);
|
|
129
|
+
return formatResult({
|
|
72
130
|
ok: true,
|
|
73
|
-
|
|
74
|
-
|
|
131
|
+
goalId,
|
|
132
|
+
previousPhase: prevPhase,
|
|
133
|
+
currentPhase: phase,
|
|
134
|
+
status: "active",
|
|
135
|
+
done: false,
|
|
136
|
+
nextActions: guidance,
|
|
137
|
+
currentGroup: null,
|
|
138
|
+
message: `Advanced ${goalId} to phase "${phase}"`,
|
|
139
|
+
}, options.json ?? false);
|
|
75
140
|
}
|
|
76
|
-
async function autoAdvancePhase(statePath, state, goalId,
|
|
141
|
+
async function autoAdvancePhase(statePath, state, goalId, options) {
|
|
142
|
+
const prevPhase = state.current_phase ?? null;
|
|
143
|
+
// Step 1: If current phase is in_progress, complete it first
|
|
144
|
+
if (prevPhase) {
|
|
145
|
+
const prevCp = state.checkpoints[prevPhase];
|
|
146
|
+
if (prevCp && prevCp.status === "in_progress") {
|
|
147
|
+
// Mark current phase as complete
|
|
148
|
+
state.checkpoints[prevPhase] = {
|
|
149
|
+
...prevCp,
|
|
150
|
+
status: "complete",
|
|
151
|
+
completed_at: new Date().toISOString(),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
// Step 2: Compute next phase from the updated state
|
|
77
156
|
const next = computeNextPhase(state);
|
|
78
157
|
if (next.done) {
|
|
79
|
-
|
|
158
|
+
state.status = "complete";
|
|
159
|
+
state.updated_at = new Date().toISOString();
|
|
160
|
+
if (!options.dryRun) {
|
|
161
|
+
await writeGoalState(statePath, state);
|
|
162
|
+
}
|
|
163
|
+
return formatResult({
|
|
164
|
+
ok: true,
|
|
165
|
+
goalId,
|
|
166
|
+
previousPhase: prevPhase,
|
|
167
|
+
currentPhase: null,
|
|
168
|
+
status: "complete",
|
|
169
|
+
done: true,
|
|
170
|
+
nextActions: null,
|
|
171
|
+
currentGroup: null,
|
|
172
|
+
message: `Goal ${goalId} complete`,
|
|
173
|
+
}, options.json ?? false);
|
|
80
174
|
}
|
|
81
|
-
|
|
82
|
-
|
|
175
|
+
// If next phase is the same as previous (still needs work), report what's pending
|
|
176
|
+
if (!options.dryRun && next.phase === state.current_phase) {
|
|
83
177
|
const pending = listPendingPhases(state);
|
|
84
|
-
|
|
178
|
+
const guidance = getPhaseGuidance(goalId, state);
|
|
179
|
+
return formatResult({
|
|
85
180
|
ok: true,
|
|
86
|
-
|
|
87
|
-
|
|
181
|
+
goalId,
|
|
182
|
+
previousPhase: prevPhase,
|
|
183
|
+
currentPhase: state.current_phase ?? null,
|
|
184
|
+
status: "active",
|
|
185
|
+
done: false,
|
|
186
|
+
nextActions: guidance,
|
|
187
|
+
currentGroup: next.groupId,
|
|
188
|
+
message: `Phase "${state.current_phase}" not yet complete. Pending: ${pending.join(", ")}`,
|
|
189
|
+
}, options.json ?? false);
|
|
88
190
|
}
|
|
89
191
|
const groupInfo = next.groupId ? ` [group ${next.groupId}]` : "";
|
|
90
|
-
if (dryRun) {
|
|
91
|
-
return {
|
|
192
|
+
if (options.dryRun) {
|
|
193
|
+
return formatResult({
|
|
92
194
|
ok: true,
|
|
93
|
-
|
|
94
|
-
|
|
195
|
+
goalId,
|
|
196
|
+
previousPhase: prevPhase,
|
|
197
|
+
currentPhase: next.phase,
|
|
198
|
+
status: "active",
|
|
199
|
+
done: false,
|
|
200
|
+
nextActions: {
|
|
201
|
+
phase: next.phase,
|
|
202
|
+
description: `[DRY RUN] Would advance to phase "${next.phase}"${groupInfo}. No changes written.`,
|
|
203
|
+
needsUserInput: false,
|
|
204
|
+
blockers: [],
|
|
205
|
+
},
|
|
206
|
+
currentGroup: next.groupId,
|
|
207
|
+
message: `[DRY RUN] Would advance ${goalId} → "${next.phase}"${groupInfo}`,
|
|
208
|
+
}, options.json ?? false);
|
|
95
209
|
}
|
|
96
|
-
// Initialize
|
|
210
|
+
// Initialize checkpoint for the next phase
|
|
97
211
|
const existingCp = state.checkpoints[next.phase];
|
|
98
212
|
state.checkpoints[next.phase] = {
|
|
99
213
|
status: "in_progress",
|
|
@@ -104,9 +218,52 @@ async function autoAdvancePhase(statePath, state, goalId, dryRun) {
|
|
|
104
218
|
state.current_phase = next.phase;
|
|
105
219
|
state.updated_at = new Date().toISOString();
|
|
106
220
|
await writeGoalState(statePath, state);
|
|
107
|
-
|
|
221
|
+
const guidance = getPhaseGuidance(goalId, state);
|
|
222
|
+
return formatResult({
|
|
108
223
|
ok: true,
|
|
109
|
-
|
|
224
|
+
goalId,
|
|
225
|
+
previousPhase: prevPhase,
|
|
226
|
+
currentPhase: next.phase,
|
|
227
|
+
status: "active",
|
|
228
|
+
done: false,
|
|
229
|
+
nextActions: guidance,
|
|
230
|
+
currentGroup: next.groupId,
|
|
231
|
+
message: `Next: ${goalId} → "${next.phase}"${groupInfo}`,
|
|
232
|
+
}, options.json ?? false);
|
|
233
|
+
}
|
|
234
|
+
function formatResult(result, json) {
|
|
235
|
+
if (!json) {
|
|
236
|
+
// Text output: include structured guidance as actionable text
|
|
237
|
+
let text = result.message;
|
|
238
|
+
if (result.nextActions && !result.done) {
|
|
239
|
+
text += `\n\nNext phase: ${result.nextActions.phase}`;
|
|
240
|
+
text += `\nAction: ${result.nextActions.description}`;
|
|
241
|
+
if (result.nextActions.blockers.length > 0) {
|
|
242
|
+
text += `\nBlockers:\n- ${result.nextActions.blockers.join("\n- ")}`;
|
|
243
|
+
}
|
|
244
|
+
if (result.nextActions.needsUserInput) {
|
|
245
|
+
text += "\n⚠️ User input required before continuing.";
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return { ok: result.ok, output: text };
|
|
249
|
+
}
|
|
250
|
+
// JSON output: structured for AI consumption
|
|
251
|
+
const jsonOutput = {
|
|
252
|
+
ok: result.ok,
|
|
253
|
+
goal_id: result.goalId,
|
|
254
|
+
previous_phase: result.previousPhase,
|
|
255
|
+
current_phase: result.currentPhase,
|
|
256
|
+
status: result.status,
|
|
257
|
+
done: result.done,
|
|
258
|
+
next_actions: result.nextActions ? {
|
|
259
|
+
phase: result.nextActions.phase,
|
|
260
|
+
description: result.nextActions.description,
|
|
261
|
+
needs_user_input: result.nextActions.needsUserInput,
|
|
262
|
+
blockers: result.nextActions.blockers,
|
|
263
|
+
} : null,
|
|
264
|
+
current_group: result.currentGroup,
|
|
265
|
+
message: result.message,
|
|
110
266
|
};
|
|
267
|
+
return { ok: result.ok, output: JSON.stringify(jsonOutput, null, 2) };
|
|
111
268
|
}
|
|
112
269
|
//# sourceMappingURL=goal-advance.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-advance.js","sourceRoot":"","sources":["../../src/commands/goal-advance.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAEL,YA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E,MAAM,CAAC,WAAW,CAAC,QAAQ;SACtC,CAAC,CAAC,CAAC,IAAI;QACR,aAAa,EAAE,MAAM,CAAC,YAAY;QAClC,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;IAEF,OAAO,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;AACxE,CAAC"}
|
|
@@ -2,12 +2,13 @@ export function printGoalHelp() {
|
|
|
2
2
|
console.log(`aiws goal
|
|
3
3
|
|
|
4
4
|
Usage:
|
|
5
|
-
aiws goal advance [--goal-id <id>] [--phase <phase>] [--dry-run]
|
|
5
|
+
aiws goal advance [--goal-id <id>] [--phase <phase>] [--dry-run] [--json]
|
|
6
6
|
aiws goal validate-state [--goal-id <id>]
|
|
7
7
|
|
|
8
8
|
Subcommands:
|
|
9
9
|
advance Advance a goal to the next phase (auto-detect) or to an
|
|
10
|
-
explicit phase (--phase).
|
|
10
|
+
explicit phase (--phase). Completes current phase first if
|
|
11
|
+
it is in_progress, then starts the next phase.
|
|
11
12
|
validate-state Validate one or all goal state files for structural
|
|
12
13
|
integrity. Reports errors and warnings.
|
|
13
14
|
|
|
@@ -18,6 +19,9 @@ Options:
|
|
|
18
19
|
intake, goal_def, dep_check, ws_analysis, plan, dev,
|
|
19
20
|
review, finish
|
|
20
21
|
--dry-run Show what would change without writing (advance only)
|
|
22
|
+
--json Output structured JSON for AI consumption. Includes
|
|
23
|
+
next_actions guidance: phase name, description, blockers,
|
|
24
|
+
and whether user input is needed.
|
|
21
25
|
|
|
22
26
|
Notes:
|
|
23
27
|
- Phase sequence is enforced: no phase can complete before its predecessors.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goal-help.js","sourceRoot":"","sources":["../../src/commands/goal-help.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,GAAG,CAAC
|
|
1
|
+
{"version":3,"file":"goal-help.js","sourceRoot":"","sources":["../../src/commands/goal-help.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,aAAa;IAC3B,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4Bb,CAAC,CAAC;AACH,CAAC"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const VALID_PHASES: readonly string[];
|
|
6
6
|
export interface GoalCheckpoint {
|
|
7
|
-
status: "pending" | "in_progress" | "complete";
|
|
7
|
+
status: "pending" | "in_progress" | "complete" | "failed";
|
|
8
8
|
attempts: number;
|
|
9
9
|
completed_at: string | null;
|
|
10
10
|
error: string | null;
|
|
@@ -75,6 +75,21 @@ export declare function computeNextPhase(state: GoalState): {
|
|
|
75
75
|
done: boolean;
|
|
76
76
|
reason: string;
|
|
77
77
|
};
|
|
78
|
+
/**
|
|
79
|
+
* Per-phase guidance descriptions for AI consumption.
|
|
80
|
+
* Maps each VALID_PHASE to a brief "what to do in this phase" instruction.
|
|
81
|
+
*/
|
|
82
|
+
export declare const PHASE_GUIDANCE: Record<string, string>;
|
|
83
|
+
/**
|
|
84
|
+
* Get next-actions guidance for the current phase of a goal state.
|
|
85
|
+
* Returns a structured description telling the AI what to do next.
|
|
86
|
+
*/
|
|
87
|
+
export declare function getPhaseGuidance(goalId: string, state: GoalState): {
|
|
88
|
+
phase: string;
|
|
89
|
+
description: string;
|
|
90
|
+
needsUserInput: boolean;
|
|
91
|
+
blockers: string[];
|
|
92
|
+
};
|
|
78
93
|
/**
|
|
79
94
|
* Collect pending (non-complete) phases from checkpoints.
|
|
80
95
|
*/
|