rosettify 2.0.1 → 2.2.0
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/commands/help/index.d.ts.map +1 -1
- package/dist/commands/help/index.js +10 -20
- package/dist/commands/help/index.js.map +1 -1
- package/dist/commands/plan/core.d.ts +2 -1
- package/dist/commands/plan/core.d.ts.map +1 -1
- package/dist/commands/plan/core.js +6 -1
- package/dist/commands/plan/core.js.map +1 -1
- package/dist/commands/plan/create-with-template.d.ts +41 -0
- package/dist/commands/plan/create-with-template.d.ts.map +1 -0
- package/dist/commands/plan/create-with-template.js +50 -0
- package/dist/commands/plan/create-with-template.js.map +1 -0
- package/dist/commands/plan/create.d.ts +72 -2
- package/dist/commands/plan/create.d.ts.map +1 -1
- package/dist/commands/plan/create.js +58 -1
- package/dist/commands/plan/create.js.map +1 -1
- package/dist/commands/plan/errors.d.ts +11 -0
- package/dist/commands/plan/errors.d.ts.map +1 -0
- package/dist/commands/plan/errors.js +15 -0
- package/dist/commands/plan/errors.js.map +1 -0
- package/dist/commands/plan/help-content.d.ts +132 -19
- package/dist/commands/plan/help-content.d.ts.map +1 -1
- package/dist/commands/plan/help-content.js +113 -24
- package/dist/commands/plan/help-content.js.map +1 -1
- package/dist/commands/plan/index.d.ts.map +1 -1
- package/dist/commands/plan/index.js +81 -7
- package/dist/commands/plan/index.js.map +1 -1
- package/dist/commands/plan/list-templates.d.ts +43 -0
- package/dist/commands/plan/list-templates.d.ts.map +1 -0
- package/dist/commands/plan/list-templates.js +25 -0
- package/dist/commands/plan/list-templates.js.map +1 -0
- package/dist/commands/plan/next.d.ts +34 -0
- package/dist/commands/plan/next.d.ts.map +1 -1
- package/dist/commands/plan/next.js +31 -3
- package/dist/commands/plan/next.js.map +1 -1
- package/dist/commands/plan/output.d.ts +25 -0
- package/dist/commands/plan/output.d.ts.map +1 -0
- package/dist/commands/plan/output.js +23 -0
- package/dist/commands/plan/output.js.map +1 -0
- package/dist/commands/plan/query.d.ts +18 -0
- package/dist/commands/plan/query.d.ts.map +1 -1
- package/dist/commands/plan/query.js +25 -2
- package/dist/commands/plan/query.js.map +1 -1
- package/dist/commands/plan/schemas.d.ts +366 -0
- package/dist/commands/plan/schemas.d.ts.map +1 -0
- package/dist/commands/plan/schemas.js +135 -0
- package/dist/commands/plan/schemas.js.map +1 -0
- package/dist/commands/plan/show-status.d.ts +35 -0
- package/dist/commands/plan/show-status.d.ts.map +1 -1
- package/dist/commands/plan/show-status.js +32 -4
- package/dist/commands/plan/show-status.js.map +1 -1
- package/dist/commands/plan/templates/create/for-orchestrator.d.ts +63 -0
- package/dist/commands/plan/templates/create/for-orchestrator.d.ts.map +1 -0
- package/dist/commands/plan/templates/create/for-orchestrator.js +78 -0
- package/dist/commands/plan/templates/create/for-orchestrator.js.map +1 -0
- package/dist/commands/plan/templates/index.d.ts +108 -0
- package/dist/commands/plan/templates/index.d.ts.map +1 -0
- package/dist/commands/plan/templates/index.js +26 -0
- package/dist/commands/plan/templates/index.js.map +1 -0
- package/dist/commands/plan/templates/render.d.ts +19 -0
- package/dist/commands/plan/templates/render.d.ts.map +1 -0
- package/dist/commands/plan/templates/render.js +86 -0
- package/dist/commands/plan/templates/render.js.map +1 -0
- package/dist/commands/plan/templates/upsert/for-subagent.d.ts +43 -0
- package/dist/commands/plan/templates/upsert/for-subagent.d.ts.map +1 -0
- package/dist/commands/plan/templates/upsert/for-subagent.js +52 -0
- package/dist/commands/plan/templates/upsert/for-subagent.js.map +1 -0
- package/dist/commands/plan/update-status.d.ts +33 -0
- package/dist/commands/plan/update-status.d.ts.map +1 -1
- package/dist/commands/plan/update-status.js +30 -4
- package/dist/commands/plan/update-status.js.map +1 -1
- package/dist/commands/plan/upsert-with-template.d.ts +45 -0
- package/dist/commands/plan/upsert-with-template.d.ts.map +1 -0
- package/dist/commands/plan/upsert-with-template.js +53 -0
- package/dist/commands/plan/upsert-with-template.js.map +1 -0
- package/dist/commands/plan/upsert.d.ts +45 -2
- package/dist/commands/plan/upsert.d.ts.map +1 -1
- package/dist/commands/plan/upsert.js +65 -34
- package/dist/commands/plan/upsert.js.map +1 -1
- package/dist/frontends/cli.d.ts.map +1 -1
- package/dist/frontends/cli.js +81 -26
- package/dist/frontends/cli.js.map +1 -1
- package/dist/frontends/mcp.d.ts.map +1 -1
- package/dist/frontends/mcp.js +9 -2
- package/dist/frontends/mcp.js.map +1 -1
- package/dist/registry/types.d.ts +36 -3
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/shared/constants.d.ts +4 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +6 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/envelope.d.ts +4 -1
- package/dist/shared/envelope.d.ts.map +1 -1
- package/dist/shared/envelope.js +18 -0
- package/dist/shared/envelope.js.map +1 -1
- package/dist/shared/plan-io.d.ts +41 -0
- package/dist/shared/plan-io.d.ts.map +1 -0
- package/dist/shared/plan-io.js +235 -0
- package/dist/shared/plan-io.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RunEnvelope } from "../../registry/types.js";
|
|
2
|
+
export interface ListTemplatesResult {
|
|
3
|
+
create: Array<{
|
|
4
|
+
name: string;
|
|
5
|
+
brief: string;
|
|
6
|
+
placeholders: readonly string[];
|
|
7
|
+
}>;
|
|
8
|
+
upsert: Array<{
|
|
9
|
+
name: string;
|
|
10
|
+
brief: string;
|
|
11
|
+
placeholders: readonly string[];
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export declare const listTemplatesInputSchema: {
|
|
15
|
+
type: "object";
|
|
16
|
+
properties: {
|
|
17
|
+
plan_file: {
|
|
18
|
+
type: string;
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
required: never[];
|
|
23
|
+
};
|
|
24
|
+
export declare const listTemplatesOutputSchema: {
|
|
25
|
+
type: "object";
|
|
26
|
+
description: string;
|
|
27
|
+
properties: {
|
|
28
|
+
create: {
|
|
29
|
+
type: string;
|
|
30
|
+
items: {
|
|
31
|
+
type: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
upsert: {
|
|
35
|
+
type: string;
|
|
36
|
+
items: {
|
|
37
|
+
type: string;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare function cmdListTemplates(): Promise<RunEnvelope<ListTemplatesResult>>;
|
|
43
|
+
//# sourceMappingURL=list-templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-templates.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/list-templates.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAM3D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAChF,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACjF;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;CAMpC,CAAC;AAEF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;CAOrC,CAAC;AAEF,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC,CAIlF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Implements FR-PLAN-0032 (list-templates subcommand).
|
|
2
|
+
import { ok } from "../../shared/envelope.js";
|
|
3
|
+
import { logger } from "../../shared/logger.js";
|
|
4
|
+
import { buildTemplateCatalog } from "./templates/index.js";
|
|
5
|
+
export const listTemplatesInputSchema = {
|
|
6
|
+
type: "object",
|
|
7
|
+
properties: {
|
|
8
|
+
plan_file: { type: "string", description: "Unused; included for CLI consistency" },
|
|
9
|
+
},
|
|
10
|
+
required: [],
|
|
11
|
+
};
|
|
12
|
+
export const listTemplatesOutputSchema = {
|
|
13
|
+
type: "object",
|
|
14
|
+
description: "FR-PLAN-0032 — catalog of registered templates grouped by kind",
|
|
15
|
+
properties: {
|
|
16
|
+
create: { type: "array", items: { type: "object" } },
|
|
17
|
+
upsert: { type: "array", items: { type: "object" } },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export async function cmdListTemplates() {
|
|
21
|
+
logger.info({}, "list-templates");
|
|
22
|
+
// FR-PLAN-0032 — return catalog grouped by kind
|
|
23
|
+
return ok(buildTemplateCatalog());
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=list-templates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-templates.js","sourceRoot":"","sources":["../../../src/commands/plan/list-templates.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAGvD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAQ5D,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,QAAiB;IACvB,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sCAAsC,EAAE;KACnF;IACD,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,IAAI,EAAE,QAAiB;IACvB,WAAW,EAAE,gEAAgE;IAC7E,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;QACpD,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;KACrD;CACF,CAAC;AAEF,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IAClC,gDAAgD;IAChD,OAAO,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -1,4 +1,38 @@
|
|
|
1
1
|
import type { RunEnvelope } from "../../registry/types.js";
|
|
2
2
|
import { type NextResult } from "./core.js";
|
|
3
|
+
export declare const nextInputSchema: {
|
|
4
|
+
type: "object";
|
|
5
|
+
properties: {
|
|
6
|
+
plan_file: {
|
|
7
|
+
type: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
limit: {
|
|
11
|
+
type: string;
|
|
12
|
+
minimum: number;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
target_id: {
|
|
16
|
+
type: string;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
required: never[];
|
|
21
|
+
};
|
|
22
|
+
export declare const nextOutputSchema: {
|
|
23
|
+
type: "object";
|
|
24
|
+
description: string;
|
|
25
|
+
properties: {
|
|
26
|
+
ready: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
count: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
plan_status: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
3
37
|
export declare function cmdNext(planFile: string, targetId?: string, limit?: number): Promise<RunEnvelope<NextResult>>;
|
|
4
38
|
//# sourceMappingURL=next.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/next.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/next.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,OAAO,EAEL,KAAK,UAAU,EAMhB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;CAQ5B,CAAC;AAEF,wBAAsB,OAAO,CAC3B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,EACjB,KAAK,SAAK,GACT,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC,CAqElC"}
|
|
@@ -1,11 +1,40 @@
|
|
|
1
|
+
// Implements FR-PLAN-0011 (next subcommand).
|
|
2
|
+
// Uses FR-SHRD-0009 (readPlanWithRetry) for read resilience.
|
|
1
3
|
import { ok, err } from "../../shared/envelope.js";
|
|
2
4
|
import { logger } from "../../shared/logger.js";
|
|
3
|
-
import {
|
|
5
|
+
import { readPlanWithRetry } from "../../shared/plan-io.js";
|
|
6
|
+
import { ERR_PLAN_FILE_CORRUPTED } from "./errors.js";
|
|
7
|
+
import { buildStepStatusMap, depsSatisfied, } from "./core.js";
|
|
8
|
+
export const nextInputSchema = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
plan_file: { type: "string", description: "Path to the plan JSON file" },
|
|
12
|
+
limit: { type: "integer", minimum: 0, description: "Max steps to return (default: 10)" },
|
|
13
|
+
target_id: { type: "string", description: "Scope to a specific phase ID" },
|
|
14
|
+
},
|
|
15
|
+
required: [],
|
|
16
|
+
};
|
|
17
|
+
export const nextOutputSchema = {
|
|
18
|
+
type: "object",
|
|
19
|
+
description: "FR-PLAN-0011 — next steps result",
|
|
20
|
+
properties: {
|
|
21
|
+
ready: { type: "array" },
|
|
22
|
+
count: { type: "integer" },
|
|
23
|
+
plan_status: { type: "string" },
|
|
24
|
+
},
|
|
25
|
+
};
|
|
4
26
|
export async function cmdNext(planFile, targetId, limit = 10) {
|
|
5
27
|
try {
|
|
6
28
|
if (limit < 0)
|
|
7
29
|
return err("invalid_limit", true);
|
|
8
|
-
|
|
30
|
+
// FR-SHRD-0009 — read with resilience (retries if plan file missing but backup exists)
|
|
31
|
+
let plan;
|
|
32
|
+
try {
|
|
33
|
+
plan = await readPlanWithRetry(planFile);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return err(ERR_PLAN_FILE_CORRUPTED);
|
|
37
|
+
}
|
|
9
38
|
if (!plan)
|
|
10
39
|
return err("plan_not_found");
|
|
11
40
|
// Validate target_id if provided — must reference an existing phase
|
|
@@ -38,7 +67,6 @@ export async function cmdNext(planFile, targetId, limit = 10) {
|
|
|
38
67
|
inProgress.push(buildNextStep(step, phase, { resume: true }));
|
|
39
68
|
}
|
|
40
69
|
else if (st === "open") {
|
|
41
|
-
// Check step deps satisfied
|
|
42
70
|
if (depsSatisfied(step, stepStatusMap)) {
|
|
43
71
|
openReady.push(buildNextStep(step, phase, { resume: false }));
|
|
44
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../../src/commands/plan/next.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"next.js","sourceRoot":"","sources":["../../../src/commands/plan/next.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,6DAA6D;AAG7D,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAML,kBAAkB,EAClB,aAAa,GACd,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI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IC;IAED,MAAM,MAAM,GAAa;QACvB,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE;QACjC,QAAQ,EAAE,KAAK,CAAC,EAAE;QAClB,UAAU,EAAE,KAAK,CAAC,IAAI;KACvB,CAAC;IACF,IAAI,KAAK,CAAC,MAAM;QAAE,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC;IACvC,IAAI,KAAK,CAAC,kBAAkB;QAAE,MAAM,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAC/D,IAAI,KAAK,CAAC,iBAAiB;QAAE,MAAM,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAC7D,IAAI,IAAI,CAAC,QAAQ;QAAE,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IACnD,IAAI,IAAI,CAAC,IAAI;QAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACvC,IAAI,IAAI,CAAC,KAAK;QAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1C,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Plan, Status } from "./core.js";
|
|
2
|
+
export interface CompressedPlanTree {
|
|
3
|
+
plan: {
|
|
4
|
+
name: string;
|
|
5
|
+
status: Status;
|
|
6
|
+
};
|
|
7
|
+
/** FR-PLAN-0040 — backup path from FR-PLAN-0024, or null on first create. */
|
|
8
|
+
previous_version: string | null;
|
|
9
|
+
phases: Array<{
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
status: Status;
|
|
13
|
+
steps: Array<{
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
status: Status;
|
|
17
|
+
}>;
|
|
18
|
+
}>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Builds the compressed-tree representation of a plan after a successful write.
|
|
22
|
+
* FR-PLAN-0040 — contains only plan.name/status, previous_version, and phases with steps (id/name/status only).
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildCompressedTree(plan: Plan, previousVersion: string | null): CompressedPlanTree;
|
|
25
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAM9C,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,6EAA6E;IAC7E,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,KAAK,CAAC;YAAE,EAAE,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC5D,CAAC,CAAC;CACJ;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,GAAG,IAAI,GAAG,kBAAkB,CAgBlG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Implements FR-PLAN-0040 (compressed-tree output shape for write subcommands).
|
|
2
|
+
/**
|
|
3
|
+
* Builds the compressed-tree representation of a plan after a successful write.
|
|
4
|
+
* FR-PLAN-0040 — contains only plan.name/status, previous_version, and phases with steps (id/name/status only).
|
|
5
|
+
*/
|
|
6
|
+
export function buildCompressedTree(plan, previousVersion) {
|
|
7
|
+
// FR-PLAN-0040 — only the specified fields, no extras
|
|
8
|
+
return {
|
|
9
|
+
plan: { name: plan.name, status: plan.status },
|
|
10
|
+
previous_version: previousVersion,
|
|
11
|
+
phases: plan.phases.map((ph) => ({
|
|
12
|
+
id: ph.id,
|
|
13
|
+
name: ph.name,
|
|
14
|
+
status: ph.status,
|
|
15
|
+
steps: (ph.steps ?? []).map((s) => ({
|
|
16
|
+
id: s.id,
|
|
17
|
+
name: s.name,
|
|
18
|
+
status: s.status,
|
|
19
|
+
})),
|
|
20
|
+
})),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/commands/plan/output.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAoBhF;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAU,EAAE,eAA8B;IAC5E,sDAAsD;IACtD,OAAO;QACL,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE;QAC9C,gBAAgB,EAAE,eAAe;QACjC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;YAC/B,EAAE,EAAE,EAAE,CAAC,EAAE;YACT,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,MAAM,EAAE,EAAE,CAAC,MAAM;YACjB,KAAK,EAAE,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAClC,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,MAAM,EAAE,CAAC,CAAC,MAAM;aACjB,CAAC,CAAC;SACJ,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
import type { RunEnvelope } from "../../registry/types.js";
|
|
2
2
|
import { type Plan, type Phase, type Step } from "./core.js";
|
|
3
|
+
export declare const queryInputSchema: {
|
|
4
|
+
type: "object";
|
|
5
|
+
properties: {
|
|
6
|
+
plan_file: {
|
|
7
|
+
type: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
target_id: {
|
|
11
|
+
type: string;
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
required: never[];
|
|
16
|
+
};
|
|
17
|
+
export declare const queryOutputSchema: {
|
|
18
|
+
type: "object";
|
|
19
|
+
description: string;
|
|
20
|
+
};
|
|
3
21
|
export declare function cmdQuery(planFile: string, targetId?: string): Promise<RunEnvelope<Plan | Phase | Step>>;
|
|
4
22
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/query.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,OAAO,EACL,KAAK,IAAI,EACT,KAAK,KAAK,EACV,KAAK,IAAI,EAGV,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;CAO5B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;CAG7B,CAAC;AAEF,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,CAAC,CAiC3C"}
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
// Implements FR-PLAN-0014 (query subcommand).
|
|
2
|
+
// Uses FR-SHRD-0009 (readPlanWithRetry) for read resilience.
|
|
1
3
|
import { ok, err } from "../../shared/envelope.js";
|
|
2
4
|
import { logger } from "../../shared/logger.js";
|
|
3
|
-
import {
|
|
5
|
+
import { readPlanWithRetry } from "../../shared/plan-io.js";
|
|
6
|
+
import { ERR_PLAN_FILE_CORRUPTED } from "./errors.js";
|
|
7
|
+
import { findPhase, findStep, } from "./core.js";
|
|
8
|
+
export const queryInputSchema = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
plan_file: { type: "string", description: "Path to the plan JSON file" },
|
|
12
|
+
target_id: { type: "string", description: "entire_plan | phase-id | step-id (default: entire_plan)" },
|
|
13
|
+
},
|
|
14
|
+
required: [],
|
|
15
|
+
};
|
|
16
|
+
export const queryOutputSchema = {
|
|
17
|
+
type: "object",
|
|
18
|
+
description: "FR-PLAN-0014 — full JSON of the target (plan, phase, or step)",
|
|
19
|
+
};
|
|
4
20
|
export async function cmdQuery(planFile, targetId) {
|
|
5
21
|
try {
|
|
6
|
-
|
|
22
|
+
// FR-SHRD-0009 — read with resilience
|
|
23
|
+
let plan;
|
|
24
|
+
try {
|
|
25
|
+
plan = await readPlanWithRetry(planFile);
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return err(ERR_PLAN_FILE_CORRUPTED);
|
|
29
|
+
}
|
|
7
30
|
if (!plan)
|
|
8
31
|
return err("plan_not_found");
|
|
9
32
|
if (!targetId || targetId === "entire_plan") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/plan/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../../src/commands/plan/query.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,6DAA6D;AAG7D,OAAO,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO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