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,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FR-PLAN-0035 — create-kind template for bootstrapping an orchestrator plan.
|
|
3
|
+
* Placeholders: [plan-name], [plan-description].
|
|
4
|
+
* Content byte-equivalent to create-for-orchestrator.json (verified in Phase 9 tests).
|
|
5
|
+
*/
|
|
6
|
+
export declare const forOrchestrator: {
|
|
7
|
+
readonly name: "for-orchestrator";
|
|
8
|
+
readonly brief: "Bootstrap a new plan with the Rosetta orchestrator preparation phase.";
|
|
9
|
+
readonly placeholders: readonly ["plan-name", "plan-description"];
|
|
10
|
+
readonly content: {
|
|
11
|
+
readonly name: "[plan-name]";
|
|
12
|
+
readonly description: "[plan-description]";
|
|
13
|
+
readonly previous_version: null;
|
|
14
|
+
readonly phases: readonly [{
|
|
15
|
+
readonly id: "ph-prep";
|
|
16
|
+
readonly name: "Preparation";
|
|
17
|
+
readonly description: "Mandatory Rosetta preparation steps for the orchestrator. Execute every step sequentially. No skipping.";
|
|
18
|
+
readonly depends_on: readonly [];
|
|
19
|
+
readonly steps: readonly [{
|
|
20
|
+
readonly id: "ph-prep-s-load-context-instructions";
|
|
21
|
+
readonly name: "Load bootstrap context";
|
|
22
|
+
readonly prompt: "Call get_context_instructions exactly once to load the bundled bootstrap rules (core policy, execution policy, guardrails, HITL, rosetta files). This is the blocking prerequisite gate (Prep Step 1). Do not call any other tool first.";
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "ph-prep-s-create-todo-tasks";
|
|
25
|
+
readonly name: "Create todo tasks for prep and workflow";
|
|
26
|
+
readonly prompt: "Create separate, dedicated, detailed todo tasks covering all actions of Prep Step 2 and Prep Step 3 (loading workflow, creating workflow-phase tasks, executing the workflow). Output to the user: 'Tasks Created: [task ids returned by the tool]'.";
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "ph-prep-s-use-load-context-skill";
|
|
29
|
+
readonly name: "Use load-context skill";
|
|
30
|
+
readonly prompt: "USE SKILL load-context as the canonical current-context loader. The skill is required even when its expected outputs already look satisfied.";
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "ph-prep-s-read-context-architecture";
|
|
33
|
+
readonly name: "Read CONTEXT.md and ARCHITECTURE.md in full";
|
|
34
|
+
readonly prompt: "Read docs/CONTEXT.md and docs/ARCHITECTURE.md in full. Read all lines at once. These files carry critical project context.";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "ph-prep-s-grep-implementation-memory";
|
|
37
|
+
readonly name: "Grep headers of IMPLEMENTATION.md and MEMORY.md";
|
|
38
|
+
readonly prompt: "Grep '^#{1,3}' headers of agents/IMPLEMENTATION.md and agents/MEMORY.md. Read further sections only as needed.";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "ph-prep-s-validate-requirements";
|
|
41
|
+
readonly name: "Use and validate requirements";
|
|
42
|
+
readonly prompt: "If docs/REQUIREMENTS exists, use and validate the relevant requirement set. Apply the requirements-use skill when present.";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "ph-prep-s-identify-request-size";
|
|
45
|
+
readonly name: "Identify request size";
|
|
46
|
+
readonly prompt: "Classify the user request as SMALL (1-2 file changes, single area), MEDIUM (up to ~10 file changes, single area), or LARGE (more than 10 file changes or multiple areas). Re-evaluate and announce if the size changes later.";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "ph-prep-s-acquire-workflow";
|
|
49
|
+
readonly name: "Acquire matching workflow";
|
|
50
|
+
readonly prompt: "ACQUIRE the most matching workflow tag from KB (for example workflows/coding-flow.md) and load its full definition. The workflow guides the end-to-end execution for the request size.";
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "ph-prep-s-add-workflow-tasks";
|
|
53
|
+
readonly name: "Add todo tasks for workflow phases";
|
|
54
|
+
readonly prompt: "Add and update separate, dedicated todo tasks reflecting the loaded workflow's phases. Output to the user: 'Tasks Created: [task ids returned by the tool]'.";
|
|
55
|
+
}, {
|
|
56
|
+
readonly id: "ph-prep-s-execute-workflow";
|
|
57
|
+
readonly name: "Execute the workflow";
|
|
58
|
+
readonly prompt: "Proceed executing the loaded workflow end-to-end, integrating questioning, planning, implementation, review, validation, and HITL gates as the workflow prescribes.";
|
|
59
|
+
}];
|
|
60
|
+
}];
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=for-orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for-orchestrator.d.ts","sourceRoot":"","sources":["../../../../../src/commands/plan/templates/create/for-orchestrator.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqElB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// Implements FR-PLAN-0035 (seed create template: for-orchestrator).
|
|
2
|
+
// Content is byte-equivalent to docs/requirements/rosettify/assets/templates/create-for-orchestrator.json.
|
|
3
|
+
/**
|
|
4
|
+
* FR-PLAN-0035 — create-kind template for bootstrapping an orchestrator plan.
|
|
5
|
+
* Placeholders: [plan-name], [plan-description].
|
|
6
|
+
* Content byte-equivalent to create-for-orchestrator.json (verified in Phase 9 tests).
|
|
7
|
+
*/
|
|
8
|
+
export const forOrchestrator = {
|
|
9
|
+
name: "for-orchestrator",
|
|
10
|
+
brief: "Bootstrap a new plan with the Rosetta orchestrator preparation phase.",
|
|
11
|
+
placeholders: ["plan-name", "plan-description"],
|
|
12
|
+
content: {
|
|
13
|
+
name: "[plan-name]",
|
|
14
|
+
description: "[plan-description]",
|
|
15
|
+
previous_version: null,
|
|
16
|
+
phases: [
|
|
17
|
+
{
|
|
18
|
+
id: "ph-prep",
|
|
19
|
+
name: "Preparation",
|
|
20
|
+
description: "Mandatory Rosetta preparation steps for the orchestrator. Execute every step sequentially. No skipping.",
|
|
21
|
+
depends_on: [],
|
|
22
|
+
steps: [
|
|
23
|
+
{
|
|
24
|
+
id: "ph-prep-s-load-context-instructions",
|
|
25
|
+
name: "Load bootstrap context",
|
|
26
|
+
prompt: "Call get_context_instructions exactly once to load the bundled bootstrap rules (core policy, execution policy, guardrails, HITL, rosetta files). This is the blocking prerequisite gate (Prep Step 1). Do not call any other tool first.",
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "ph-prep-s-create-todo-tasks",
|
|
30
|
+
name: "Create todo tasks for prep and workflow",
|
|
31
|
+
prompt: "Create separate, dedicated, detailed todo tasks covering all actions of Prep Step 2 and Prep Step 3 (loading workflow, creating workflow-phase tasks, executing the workflow). Output to the user: 'Tasks Created: [task ids returned by the tool]'.",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "ph-prep-s-use-load-context-skill",
|
|
35
|
+
name: "Use load-context skill",
|
|
36
|
+
prompt: "USE SKILL load-context as the canonical current-context loader. The skill is required even when its expected outputs already look satisfied.",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "ph-prep-s-read-context-architecture",
|
|
40
|
+
name: "Read CONTEXT.md and ARCHITECTURE.md in full",
|
|
41
|
+
prompt: "Read docs/CONTEXT.md and docs/ARCHITECTURE.md in full. Read all lines at once. These files carry critical project context.",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "ph-prep-s-grep-implementation-memory",
|
|
45
|
+
name: "Grep headers of IMPLEMENTATION.md and MEMORY.md",
|
|
46
|
+
prompt: "Grep '^#{1,3}' headers of agents/IMPLEMENTATION.md and agents/MEMORY.md. Read further sections only as needed.",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "ph-prep-s-validate-requirements",
|
|
50
|
+
name: "Use and validate requirements",
|
|
51
|
+
prompt: "If docs/REQUIREMENTS exists, use and validate the relevant requirement set. Apply the requirements-use skill when present.",
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "ph-prep-s-identify-request-size",
|
|
55
|
+
name: "Identify request size",
|
|
56
|
+
prompt: "Classify the user request as SMALL (1-2 file changes, single area), MEDIUM (up to ~10 file changes, single area), or LARGE (more than 10 file changes or multiple areas). Re-evaluate and announce if the size changes later.",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "ph-prep-s-acquire-workflow",
|
|
60
|
+
name: "Acquire matching workflow",
|
|
61
|
+
prompt: "ACQUIRE the most matching workflow tag from KB (for example workflows/coding-flow.md) and load its full definition. The workflow guides the end-to-end execution for the request size.",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "ph-prep-s-add-workflow-tasks",
|
|
65
|
+
name: "Add todo tasks for workflow phases",
|
|
66
|
+
prompt: "Add and update separate, dedicated todo tasks reflecting the loaded workflow's phases. Output to the user: 'Tasks Created: [task ids returned by the tool]'.",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "ph-prep-s-execute-workflow",
|
|
70
|
+
name: "Execute the workflow",
|
|
71
|
+
prompt: "Proceed executing the loaded workflow end-to-end, integrating questioning, planning, implementation, review, validation, and HITL gates as the workflow prescribes.",
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=for-orchestrator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for-orchestrator.js","sourceRoot":"","sources":["../../../../../src/commands/plan/templates/create/for-orchestrator.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,2GAA2G;AAE3G;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,uEAAuE;IAC9E,YAAY,EAAE,CAAC,WAAW,EAAE,kBAAkB,CAAU;IACxD,OAAO,EAAE;QACP,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,oBAAoB;QACjC,gBAAgB,EAAE,IAAI;QACtB,MAAM,EAAE;YACN;gBACE,EAAE,EAAE,SAAS;gBACb,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,yGAAyG;gBACtH,UAAU,EAAE,EAAE;gBACd,KAAK,EAAE;oBACL;wBACE,EAAE,EAAE,qCAAqC;wBACzC,IAAI,EAAE,wBAAwB;wBAC9B,MAAM,EAAE,0OAA0O;qBACnP;oBACD;wBACE,EAAE,EAAE,6BAA6B;wBACjC,IAAI,EAAE,yCAAyC;wBAC/C,MAAM,EAAE,sPAAsP;qBAC/P;oBACD;wBACE,EAAE,EAAE,kCAAkC;wBACtC,IAAI,EAAE,wBAAwB;wBAC9B,MAAM,EAAE,8IAA8I;qBACvJ;oBACD;wBACE,EAAE,EAAE,qCAAqC;wBACzC,IAAI,EAAE,6CAA6C;wBACnD,MAAM,EAAE,4HAA4H;qBACrI;oBACD;wBACE,EAAE,EAAE,sCAAsC;wBAC1C,IAAI,EAAE,iDAAiD;wBACvD,MAAM,EAAE,gHAAgH;qBACzH;oBACD;wBACE,EAAE,EAAE,iCAAiC;wBACrC,IAAI,EAAE,+BAA+B;wBACrC,MAAM,EAAE,4HAA4H;qBACrI;oBACD;wBACE,EAAE,EAAE,iCAAiC;wBACrC,IAAI,EAAE,uBAAuB;wBAC7B,MAAM,EAAE,+NAA+N;qBACxO;oBACD;wBACE,EAAE,EAAE,4BAA4B;wBAChC,IAAI,EAAE,2BAA2B;wBACjC,MAAM,EAAE,wLAAwL;qBACjM;oBACD;wBACE,EAAE,EAAE,8BAA8B;wBAClC,IAAI,EAAE,oCAAoC;wBAC1C,MAAM,EAAE,8JAA8J;qBACvK;oBACD;wBACE,EAAE,EAAE,4BAA4B;wBAChC,IAAI,EAAE,sBAAsB;wBAC5B,MAAM,EAAE,qKAAqK;qBAC9K;iBACF;aACF;SACF;KACF;CACO,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
export declare const createTemplates: {
|
|
2
|
+
readonly "for-orchestrator": {
|
|
3
|
+
readonly name: "for-orchestrator";
|
|
4
|
+
readonly brief: "Bootstrap a new plan with the Rosetta orchestrator preparation phase.";
|
|
5
|
+
readonly placeholders: readonly ["plan-name", "plan-description"];
|
|
6
|
+
readonly content: {
|
|
7
|
+
readonly name: "[plan-name]";
|
|
8
|
+
readonly description: "[plan-description]";
|
|
9
|
+
readonly previous_version: null;
|
|
10
|
+
readonly phases: readonly [{
|
|
11
|
+
readonly id: "ph-prep";
|
|
12
|
+
readonly name: "Preparation";
|
|
13
|
+
readonly description: "Mandatory Rosetta preparation steps for the orchestrator. Execute every step sequentially. No skipping.";
|
|
14
|
+
readonly depends_on: readonly [];
|
|
15
|
+
readonly steps: readonly [{
|
|
16
|
+
readonly id: "ph-prep-s-load-context-instructions";
|
|
17
|
+
readonly name: "Load bootstrap context";
|
|
18
|
+
readonly prompt: "Call get_context_instructions exactly once to load the bundled bootstrap rules (core policy, execution policy, guardrails, HITL, rosetta files). This is the blocking prerequisite gate (Prep Step 1). Do not call any other tool first.";
|
|
19
|
+
}, {
|
|
20
|
+
readonly id: "ph-prep-s-create-todo-tasks";
|
|
21
|
+
readonly name: "Create todo tasks for prep and workflow";
|
|
22
|
+
readonly prompt: "Create separate, dedicated, detailed todo tasks covering all actions of Prep Step 2 and Prep Step 3 (loading workflow, creating workflow-phase tasks, executing the workflow). Output to the user: 'Tasks Created: [task ids returned by the tool]'.";
|
|
23
|
+
}, {
|
|
24
|
+
readonly id: "ph-prep-s-use-load-context-skill";
|
|
25
|
+
readonly name: "Use load-context skill";
|
|
26
|
+
readonly prompt: "USE SKILL load-context as the canonical current-context loader. The skill is required even when its expected outputs already look satisfied.";
|
|
27
|
+
}, {
|
|
28
|
+
readonly id: "ph-prep-s-read-context-architecture";
|
|
29
|
+
readonly name: "Read CONTEXT.md and ARCHITECTURE.md in full";
|
|
30
|
+
readonly prompt: "Read docs/CONTEXT.md and docs/ARCHITECTURE.md in full. Read all lines at once. These files carry critical project context.";
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "ph-prep-s-grep-implementation-memory";
|
|
33
|
+
readonly name: "Grep headers of IMPLEMENTATION.md and MEMORY.md";
|
|
34
|
+
readonly prompt: "Grep '^#{1,3}' headers of agents/IMPLEMENTATION.md and agents/MEMORY.md. Read further sections only as needed.";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "ph-prep-s-validate-requirements";
|
|
37
|
+
readonly name: "Use and validate requirements";
|
|
38
|
+
readonly prompt: "If docs/REQUIREMENTS exists, use and validate the relevant requirement set. Apply the requirements-use skill when present.";
|
|
39
|
+
}, {
|
|
40
|
+
readonly id: "ph-prep-s-identify-request-size";
|
|
41
|
+
readonly name: "Identify request size";
|
|
42
|
+
readonly prompt: "Classify the user request as SMALL (1-2 file changes, single area), MEDIUM (up to ~10 file changes, single area), or LARGE (more than 10 file changes or multiple areas). Re-evaluate and announce if the size changes later.";
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "ph-prep-s-acquire-workflow";
|
|
45
|
+
readonly name: "Acquire matching workflow";
|
|
46
|
+
readonly prompt: "ACQUIRE the most matching workflow tag from KB (for example workflows/coding-flow.md) and load its full definition. The workflow guides the end-to-end execution for the request size.";
|
|
47
|
+
}, {
|
|
48
|
+
readonly id: "ph-prep-s-add-workflow-tasks";
|
|
49
|
+
readonly name: "Add todo tasks for workflow phases";
|
|
50
|
+
readonly prompt: "Add and update separate, dedicated todo tasks reflecting the loaded workflow's phases. Output to the user: 'Tasks Created: [task ids returned by the tool]'.";
|
|
51
|
+
}, {
|
|
52
|
+
readonly id: "ph-prep-s-execute-workflow";
|
|
53
|
+
readonly name: "Execute the workflow";
|
|
54
|
+
readonly prompt: "Proceed executing the loaded workflow end-to-end, integrating questioning, planning, implementation, review, validation, and HITL gates as the workflow prescribes.";
|
|
55
|
+
}];
|
|
56
|
+
}];
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export declare const upsertTemplates: {
|
|
61
|
+
readonly "for-subagent": {
|
|
62
|
+
readonly name: "for-subagent";
|
|
63
|
+
readonly brief: "Bootstrap a subagent preparation phase with standard Rosetta load-context steps.";
|
|
64
|
+
readonly placeholders: readonly ["phase-id", "phase-name", "phase-description"];
|
|
65
|
+
readonly content: {
|
|
66
|
+
readonly id: "[phase-id]";
|
|
67
|
+
readonly name: "[phase-name]";
|
|
68
|
+
readonly description: "[phase-description]";
|
|
69
|
+
readonly depends_on: readonly [];
|
|
70
|
+
readonly steps: readonly [{
|
|
71
|
+
readonly id: "[phase-id]-s-load-context-instructions";
|
|
72
|
+
readonly name: "Load bootstrap context";
|
|
73
|
+
readonly prompt: "Call get_context_instructions exactly once to load the bundled bootstrap rules. This is the blocking prerequisite gate (Prep Step 1). Do not call any other tool first.";
|
|
74
|
+
}, {
|
|
75
|
+
readonly id: "[phase-id]-s-execution-planning";
|
|
76
|
+
readonly name: "Plan execution at the task level";
|
|
77
|
+
readonly prompt: "Perform execution-level planning using todo tasks for this phase's scope. Identify dependencies and the right order before acting.";
|
|
78
|
+
}, {
|
|
79
|
+
readonly id: "[phase-id]-s-read-context-architecture";
|
|
80
|
+
readonly name: "Read CONTEXT.md and ARCHITECTURE.md in full";
|
|
81
|
+
readonly prompt: "Read docs/CONTEXT.md and docs/ARCHITECTURE.md in full. Read all lines at once. These files carry critical project context.";
|
|
82
|
+
}, {
|
|
83
|
+
readonly id: "[phase-id]-s-grep-implementation-memory";
|
|
84
|
+
readonly name: "Grep headers of IMPLEMENTATION.md and MEMORY.md";
|
|
85
|
+
readonly prompt: "Grep '^#{1,3}' headers of agents/IMPLEMENTATION.md and agents/MEMORY.md. Read further sections only as needed.";
|
|
86
|
+
}, {
|
|
87
|
+
readonly id: "[phase-id]-s-execute-tasks";
|
|
88
|
+
readonly name: "Execute todo tasks and adopt changes";
|
|
89
|
+
readonly prompt: "Execute the planned todo tasks and adopt the resulting changes. Update task status as work progresses.";
|
|
90
|
+
}, {
|
|
91
|
+
readonly id: "[phase-id]-s-proceed-with-request";
|
|
92
|
+
readonly name: "Proceed with the assigned request";
|
|
93
|
+
readonly prompt: "Proceed with the original assigned request and its activities, following all guardrails and HITL rules.";
|
|
94
|
+
}];
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export interface TemplateCatalogEntry {
|
|
99
|
+
name: string;
|
|
100
|
+
brief: string;
|
|
101
|
+
placeholders: readonly string[];
|
|
102
|
+
}
|
|
103
|
+
/** Returns the catalog for list-templates (FR-PLAN-0032). */
|
|
104
|
+
export declare function buildTemplateCatalog(): {
|
|
105
|
+
create: TemplateCatalogEntry[];
|
|
106
|
+
upsert: TemplateCatalogEntry[];
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/plan/templates/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAElB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAElB,CAAC;AAGX,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACjC;AAED,6DAA6D;AAC7D,wBAAgB,oBAAoB,IAAI;IACtC,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAC/B,MAAM,EAAE,oBAAoB,EAAE,CAAC;CAChC,CAYA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Implements FR-PLAN-0033 (template registry: two kinds, per-file modules, compiled-in).
|
|
2
|
+
import { forOrchestrator } from "./create/for-orchestrator.js";
|
|
3
|
+
import { forSubagent } from "./upsert/for-subagent.js";
|
|
4
|
+
// FR-PLAN-0033 — create-kind template collection, keyed by template name
|
|
5
|
+
export const createTemplates = {
|
|
6
|
+
"for-orchestrator": forOrchestrator,
|
|
7
|
+
};
|
|
8
|
+
// FR-PLAN-0033 — upsert-kind template collection, keyed by template name
|
|
9
|
+
export const upsertTemplates = {
|
|
10
|
+
"for-subagent": forSubagent,
|
|
11
|
+
};
|
|
12
|
+
/** Returns the catalog for list-templates (FR-PLAN-0032). */
|
|
13
|
+
export function buildTemplateCatalog() {
|
|
14
|
+
const create = Object.values(createTemplates).map((t) => ({
|
|
15
|
+
name: t.name,
|
|
16
|
+
brief: t.brief,
|
|
17
|
+
placeholders: t.placeholders,
|
|
18
|
+
}));
|
|
19
|
+
const upsert = Object.values(upsertTemplates).map((t) => ({
|
|
20
|
+
name: t.name,
|
|
21
|
+
brief: t.brief,
|
|
22
|
+
placeholders: t.placeholders,
|
|
23
|
+
}));
|
|
24
|
+
return { create, upsert };
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/plan/templates/index.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,kBAAkB,EAAE,eAAe;CAC3B,CAAC;AAEX,yEAAyE;AACzE,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,cAAc,EAAE,WAAW;CACnB,CAAC;AASX,6DAA6D;AAC7D,MAAM,UAAU,oBAAoB;IAIlC,MAAM,MAAM,GAA2B,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,YAAY,EAAE,CAAC,CAAC,YAAY;KAC7B,CAAC,CAAC,CAAC;IACJ,MAAM,MAAM,GAA2B,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAChF,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,KAAK,EAAE,CAAC,CAAC,KAAK;QACd,YAAY,EAAE,CAAC,CAAC,YAAY;KAC7B,CAAC,CAAC,CAAC;IACJ,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders a template by substituting placeholder values.
|
|
3
|
+
* FR-PLAN-0034 — strict bidirectional matching:
|
|
4
|
+
* 1. Pre-substitution scan: any [token] in template content not in declared set → unexpected_template_param
|
|
5
|
+
* 2. If caller provides key not in declared set → unexpected_template_param
|
|
6
|
+
* 3. If declared placeholder not provided by caller → missing_template_param
|
|
7
|
+
* 4. Then substitute (literal string replacement).
|
|
8
|
+
*/
|
|
9
|
+
export declare function renderTemplate(template: {
|
|
10
|
+
placeholders: readonly string[];
|
|
11
|
+
content: unknown;
|
|
12
|
+
}, params: Record<string, string>): {
|
|
13
|
+
ok: true;
|
|
14
|
+
rendered: unknown;
|
|
15
|
+
} | {
|
|
16
|
+
ok: false;
|
|
17
|
+
error: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=render.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../../src/commands/plan/templates/render.ts"],"names":[],"mappings":"AAuDA;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE;IAAE,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,EAC/D,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC7B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CA6BhE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Implements FR-PLAN-0034 (placeholder substitution with strict bidirectional matching).
|
|
2
|
+
import { ERR_MISSING_TEMPLATE_PARAM, ERR_UNEXPECTED_TEMPLATE_PARAM } from "../errors.js";
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
// FR-PLAN-0034 — Placeholder render with strict bidirectional matching
|
|
5
|
+
// ---------------------------------------------------------------------------
|
|
6
|
+
// Regex to find ALL [token] occurrences in a string value
|
|
7
|
+
const PLACEHOLDER_REGEX = /\[([a-z][a-z0-9-]*)\]/g;
|
|
8
|
+
/** Collects all [token] occurrences in a JSON tree (only in string leaves). */
|
|
9
|
+
function collectPlaceholderTokens(value) {
|
|
10
|
+
const found = new Set();
|
|
11
|
+
function walk(v) {
|
|
12
|
+
if (typeof v === "string") {
|
|
13
|
+
for (const match of v.matchAll(PLACEHOLDER_REGEX)) {
|
|
14
|
+
found.add(match[1]);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
else if (Array.isArray(v)) {
|
|
18
|
+
for (const item of v)
|
|
19
|
+
walk(item);
|
|
20
|
+
}
|
|
21
|
+
else if (typeof v === "object" && v !== null) {
|
|
22
|
+
for (const val of Object.values(v))
|
|
23
|
+
walk(val);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
walk(value);
|
|
27
|
+
return found;
|
|
28
|
+
}
|
|
29
|
+
/** Replaces all [token] occurrences in a JSON tree (only in string leaves) with params values. */
|
|
30
|
+
function substituteValues(value, params) {
|
|
31
|
+
if (typeof value === "string") {
|
|
32
|
+
// FR-PLAN-0034 — literal string replacement; values are not re-interpreted
|
|
33
|
+
let result = value;
|
|
34
|
+
for (const [token, replacement] of Object.entries(params)) {
|
|
35
|
+
// Replace all occurrences of [token]
|
|
36
|
+
result = result.split(`[${token}]`).join(replacement);
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
if (Array.isArray(value)) {
|
|
41
|
+
return value.map((item) => substituteValues(item, params));
|
|
42
|
+
}
|
|
43
|
+
if (typeof value === "object" && value !== null) {
|
|
44
|
+
const out = {};
|
|
45
|
+
for (const [k, v] of Object.entries(value)) {
|
|
46
|
+
out[k] = substituteValues(v, params);
|
|
47
|
+
}
|
|
48
|
+
return out;
|
|
49
|
+
}
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Renders a template by substituting placeholder values.
|
|
54
|
+
* FR-PLAN-0034 — strict bidirectional matching:
|
|
55
|
+
* 1. Pre-substitution scan: any [token] in template content not in declared set → unexpected_template_param
|
|
56
|
+
* 2. If caller provides key not in declared set → unexpected_template_param
|
|
57
|
+
* 3. If declared placeholder not provided by caller → missing_template_param
|
|
58
|
+
* 4. Then substitute (literal string replacement).
|
|
59
|
+
*/
|
|
60
|
+
export function renderTemplate(template, params) {
|
|
61
|
+
const declared = new Set(template.placeholders);
|
|
62
|
+
const provided = new Set(Object.keys(params));
|
|
63
|
+
// FR-PLAN-0034 — check caller provides no undeclared params
|
|
64
|
+
for (const key of provided) {
|
|
65
|
+
if (!declared.has(key)) {
|
|
66
|
+
return { ok: false, error: `${ERR_UNEXPECTED_TEMPLATE_PARAM}: ${key}` };
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// FR-PLAN-0034 — check all declared placeholders are provided
|
|
70
|
+
for (const placeholder of declared) {
|
|
71
|
+
if (!provided.has(placeholder)) {
|
|
72
|
+
return { ok: false, error: `${ERR_MISSING_TEMPLATE_PARAM}: ${placeholder}` };
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// FR-PLAN-0034 — pre-substitution scan: check template content contains no undeclared [token] literals
|
|
76
|
+
const tokensInContent = collectPlaceholderTokens(template.content);
|
|
77
|
+
for (const token of tokensInContent) {
|
|
78
|
+
if (!declared.has(token)) {
|
|
79
|
+
return { ok: false, error: `${ERR_UNEXPECTED_TEMPLATE_PARAM}: ${token}` };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// FR-PLAN-0034 — substitute (literal replacement; values are not re-interpreted)
|
|
83
|
+
const rendered = substituteValues(template.content, params);
|
|
84
|
+
return { ok: true, rendered };
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=render.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render.js","sourceRoot":"","sources":["../../../../src/commands/plan/templates/render.ts"],"names":[],"mappings":"AAAA,yFAAyF;AAEzF,OAAO,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAEzF,8EAA8E;AAC9E,uEAAuE;AACvE,8EAA8E;AAE9E,0DAA0D;AAC1D,MAAM,iBAAiB,GAAG,wBAAwB,CAAC;AAEnD,+EAA+E;AAC/E,SAAS,wBAAwB,CAAC,KAAc;IAC9C,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AuG;IACvG,MAAM,eAAe,GAAG,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACnE,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,6BAA6B,KAAK,KAAK,EAAE,EAAE,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,iFAAiF;IACjF,MAAM,QAAQ,GAAG,gBAAgB,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAgC,CAAC,CAAC;IACtF,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FR-PLAN-0036 — upsert-kind template for bootstrapping a subagent preparation phase.
|
|
3
|
+
* Placeholders: [phase-id], [phase-name], [phase-description].
|
|
4
|
+
* Step IDs are prefixed with [phase-id]-s- to ensure plan-wide uniqueness (FR-PLAN-0001).
|
|
5
|
+
* Content byte-equivalent to upsert-for-subagent.json (verified in Phase 9 tests).
|
|
6
|
+
*/
|
|
7
|
+
export declare const forSubagent: {
|
|
8
|
+
readonly name: "for-subagent";
|
|
9
|
+
readonly brief: "Bootstrap a subagent preparation phase with standard Rosetta load-context steps.";
|
|
10
|
+
readonly placeholders: readonly ["phase-id", "phase-name", "phase-description"];
|
|
11
|
+
readonly content: {
|
|
12
|
+
readonly id: "[phase-id]";
|
|
13
|
+
readonly name: "[phase-name]";
|
|
14
|
+
readonly description: "[phase-description]";
|
|
15
|
+
readonly depends_on: readonly [];
|
|
16
|
+
readonly steps: readonly [{
|
|
17
|
+
readonly id: "[phase-id]-s-load-context-instructions";
|
|
18
|
+
readonly name: "Load bootstrap context";
|
|
19
|
+
readonly prompt: "Call get_context_instructions exactly once to load the bundled bootstrap rules. This is the blocking prerequisite gate (Prep Step 1). Do not call any other tool first.";
|
|
20
|
+
}, {
|
|
21
|
+
readonly id: "[phase-id]-s-execution-planning";
|
|
22
|
+
readonly name: "Plan execution at the task level";
|
|
23
|
+
readonly prompt: "Perform execution-level planning using todo tasks for this phase's scope. Identify dependencies and the right order before acting.";
|
|
24
|
+
}, {
|
|
25
|
+
readonly id: "[phase-id]-s-read-context-architecture";
|
|
26
|
+
readonly name: "Read CONTEXT.md and ARCHITECTURE.md in full";
|
|
27
|
+
readonly prompt: "Read docs/CONTEXT.md and docs/ARCHITECTURE.md in full. Read all lines at once. These files carry critical project context.";
|
|
28
|
+
}, {
|
|
29
|
+
readonly id: "[phase-id]-s-grep-implementation-memory";
|
|
30
|
+
readonly name: "Grep headers of IMPLEMENTATION.md and MEMORY.md";
|
|
31
|
+
readonly prompt: "Grep '^#{1,3}' headers of agents/IMPLEMENTATION.md and agents/MEMORY.md. Read further sections only as needed.";
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "[phase-id]-s-execute-tasks";
|
|
34
|
+
readonly name: "Execute todo tasks and adopt changes";
|
|
35
|
+
readonly prompt: "Execute the planned todo tasks and adopt the resulting changes. Update task status as work progresses.";
|
|
36
|
+
}, {
|
|
37
|
+
readonly id: "[phase-id]-s-proceed-with-request";
|
|
38
|
+
readonly name: "Proceed with the assigned request";
|
|
39
|
+
readonly prompt: "Proceed with the original assigned request and its activities, following all guardrails and HITL rules.";
|
|
40
|
+
}];
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=for-subagent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for-subagent.d.ts","sourceRoot":"","sources":["../../../../../src/commands/plan/templates/upsert/for-subagent.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Cd,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Implements FR-PLAN-0036 (seed upsert template: for-subagent).
|
|
2
|
+
// Content is byte-equivalent to docs/requirements/rosettify/assets/templates/upsert-for-subagent.json.
|
|
3
|
+
/**
|
|
4
|
+
* FR-PLAN-0036 — upsert-kind template for bootstrapping a subagent preparation phase.
|
|
5
|
+
* Placeholders: [phase-id], [phase-name], [phase-description].
|
|
6
|
+
* Step IDs are prefixed with [phase-id]-s- to ensure plan-wide uniqueness (FR-PLAN-0001).
|
|
7
|
+
* Content byte-equivalent to upsert-for-subagent.json (verified in Phase 9 tests).
|
|
8
|
+
*/
|
|
9
|
+
export const forSubagent = {
|
|
10
|
+
name: "for-subagent",
|
|
11
|
+
brief: "Bootstrap a subagent preparation phase with standard Rosetta load-context steps.",
|
|
12
|
+
placeholders: ["phase-id", "phase-name", "phase-description"],
|
|
13
|
+
content: {
|
|
14
|
+
id: "[phase-id]",
|
|
15
|
+
name: "[phase-name]",
|
|
16
|
+
description: "[phase-description]",
|
|
17
|
+
depends_on: [],
|
|
18
|
+
steps: [
|
|
19
|
+
{
|
|
20
|
+
id: "[phase-id]-s-load-context-instructions",
|
|
21
|
+
name: "Load bootstrap context",
|
|
22
|
+
prompt: "Call get_context_instructions exactly once to load the bundled bootstrap rules. This is the blocking prerequisite gate (Prep Step 1). Do not call any other tool first.",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "[phase-id]-s-execution-planning",
|
|
26
|
+
name: "Plan execution at the task level",
|
|
27
|
+
prompt: "Perform execution-level planning using todo tasks for this phase's scope. Identify dependencies and the right order before acting.",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "[phase-id]-s-read-context-architecture",
|
|
31
|
+
name: "Read CONTEXT.md and ARCHITECTURE.md in full",
|
|
32
|
+
prompt: "Read docs/CONTEXT.md and docs/ARCHITECTURE.md in full. Read all lines at once. These files carry critical project context.",
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "[phase-id]-s-grep-implementation-memory",
|
|
36
|
+
name: "Grep headers of IMPLEMENTATION.md and MEMORY.md",
|
|
37
|
+
prompt: "Grep '^#{1,3}' headers of agents/IMPLEMENTATION.md and agents/MEMORY.md. Read further sections only as needed.",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "[phase-id]-s-execute-tasks",
|
|
41
|
+
name: "Execute todo tasks and adopt changes",
|
|
42
|
+
prompt: "Execute the planned todo tasks and adopt the resulting changes. Update task status as work progresses.",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "[phase-id]-s-proceed-with-request",
|
|
46
|
+
name: "Proceed with the assigned request",
|
|
47
|
+
prompt: "Proceed with the original assigned request and its activities, following all guardrails and HITL rules.",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=for-subagent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for-subagent.js","sourceRoot":"","sources":["../../../../../src/commands/plan/templates/upsert/for-subagent.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,uGAAuG;AAEvG;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,kFAAkF;IACzF,YAAY,EAAE,CAAC,UAAU,EAAE,YAAY,EAAE,mBAAmB,CAAU;IACtE,OAAO,EAAE;QACP,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,cAAc;QACpB,WAAW,EAAE,qBAAqB;QAClC,UAAU,EAAE,EAAE;QACd,KAAK,EAAE;YACL;gBACE,EAAE,EAAE,wCAAwC;gBAC5C,IAAI,EAAE,wBAAwB;gBAC9B,MAAM,EAAE,yKAAyK;aAClL;YACD;gBACE,EAAE,EAAE,iCAAiC;gBACrC,IAAI,EAAE,kCAAkC;gBACxC,MAAM,EAAE,oIAAoI;aAC7I;YACD;gBACE,EAAE,EAAE,wCAAwC;gBAC5C,IAAI,EAAE,6CAA6C;gBACnD,MAAM,EAAE,4HAA4H;aACrI;YACD;gBACE,EAAE,EAAE,yCAAyC;gBAC7C,IAAI,EAAE,iDAAiD;gBACvD,MAAM,EAAE,gHAAgH;aACzH;YACD;gBACE,EAAE,EAAE,4BAA4B;gBAChC,IAAI,EAAE,sCAAsC;gBAC5C,MAAM,EAAE,wGAAwG;aACjH;YACD;gBACE,EAAE,EAAE,mCAAmC;gBACvC,IAAI,EAAE,mCAAmC;gBACzC,MAAM,EAAE,yGAAyG;aAClH;SACF;KACF;CACO,CAAC"}
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
import type { RunEnvelope } from "../../registry/types.js";
|
|
2
2
|
import { type UpdateStatusResult } from "./core.js";
|
|
3
|
+
export declare const updateStatusInputSchema: {
|
|
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
|
+
new_status: {
|
|
15
|
+
type: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
required: never[];
|
|
20
|
+
};
|
|
21
|
+
export declare const updateStatusOutputSchema: {
|
|
22
|
+
type: "object";
|
|
23
|
+
description: string;
|
|
24
|
+
properties: {
|
|
25
|
+
id: {
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
status: {
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
31
|
+
plan_status: {
|
|
32
|
+
type: string;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
3
36
|
export declare function cmdUpdateStatus(planFile: string, targetId: string, newStatus: string): Promise<RunEnvelope<UpdateStatusResult>>;
|
|
4
37
|
//# sourceMappingURL=update-status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-status.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/update-status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-status.d.ts","sourceRoot":"","sources":["../../../src/commands/plan/update-status.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAGL,KAAK,kBAAkB,EAMxB,MAAM,WAAW,CAAC;AAEnB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;CAQnC,CAAC;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;CAQpC,CAAC;AAEF,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,CA2C1C"}
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
+
// Implements FR-PLAN-0012 (update_status subcommand).
|
|
2
|
+
// Uses FR-PLAN-0024 write cycle (atomicWriteWithBackup) for all plan writes.
|
|
3
|
+
// FR-PLAN-0025 — plan writes go through FR-PLAN-0024, NOT the FR-SHRD-0006 optimistic-concurrency function.
|
|
1
4
|
import { logger } from "../../shared/logger.js";
|
|
2
|
-
import {
|
|
3
|
-
import { VALID_STATUSES,
|
|
5
|
+
import { atomicWriteWithBackup } from "../../shared/plan-io.js";
|
|
6
|
+
import { VALID_STATUSES, savePlan, propagateStatuses, findPhase, findStep, } from "./core.js";
|
|
7
|
+
export const updateStatusInputSchema = {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
plan_file: { type: "string", description: "Path to the plan JSON file" },
|
|
11
|
+
target_id: { type: "string", description: "Step ID to update" },
|
|
12
|
+
new_status: { type: "string", description: "New status: open | in_progress | complete | blocked | failed" },
|
|
13
|
+
},
|
|
14
|
+
required: [],
|
|
15
|
+
};
|
|
16
|
+
export const updateStatusOutputSchema = {
|
|
17
|
+
type: "object",
|
|
18
|
+
description: "FR-PLAN-0012 — result of update_status",
|
|
19
|
+
properties: {
|
|
20
|
+
id: { type: "string" },
|
|
21
|
+
status: { type: "string" },
|
|
22
|
+
plan_status: { type: "string" },
|
|
23
|
+
},
|
|
24
|
+
};
|
|
4
25
|
export async function cmdUpdateStatus(planFile, targetId, newStatus) {
|
|
5
26
|
try {
|
|
6
|
-
|
|
27
|
+
// FR-PLAN-0024 — use rename-as-guard write cycle
|
|
28
|
+
const writeResult = await atomicWriteWithBackup(planFile, (plan) => {
|
|
7
29
|
if (targetId === "entire_plan") {
|
|
8
30
|
return { ok: false, error: "invalid_target" };
|
|
9
31
|
}
|
|
@@ -27,7 +49,11 @@ export async function cmdUpdateStatus(planFile, targetId, newStatus) {
|
|
|
27
49
|
result: { id: targetId, status: newStatus, plan_status: plan.status },
|
|
28
50
|
updated: plan,
|
|
29
51
|
};
|
|
30
|
-
});
|
|
52
|
+
}, savePlan);
|
|
53
|
+
if (!writeResult.ok) {
|
|
54
|
+
return { ok: false, result: null, error: writeResult.error, include_help: writeResult.include_help };
|
|
55
|
+
}
|
|
56
|
+
return { ok: true, result: writeResult.result.result, error: null, include_help: false };
|
|
31
57
|
}
|
|
32
58
|
catch (e) {
|
|
33
59
|
const msg = e instanceof Error ? e.message : String(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-status.js","sourceRoot":"","sources":["../../../src/commands/plan/update-status.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-status.js","sourceRoot":"","sources":["../../../src/commands/plan/update-status.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,6EAA6E;AAC7E,4GAA4G;AAI5G,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAIL,cAAc,EACd,QAAQ,EACR,iBAAiB,EACjB,SAAS,EACT,QAAQ,GACT,MAAM,WAAW,CAAC;AAEnB,MAAM,CAAC,MAA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