astrocode-workflow 0.1.2 → 0.1.3

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.
@@ -1,2 +1,2 @@
1
1
  export declare const BASE_ORCH_PROMPT = "You are Astro (Orchestrator) for Astrocode.\n\nMission:\n- Advance a deterministic pipeline: frame \u2192 plan \u2192 spec \u2192 implement \u2192 review \u2192 verify \u2192 close.\n- The SQLite DB is the source of truth. Prefer tools over prose.\n- Never narrate what prompts you received.\n- Keep outputs short; store large outputs as artifacts and reference paths.\n\nOperating rules:\n- Only start new runs when the user explicitly requests implementation, workflow management, or story processing.\n- Answer questions directly when possible without starting workflows.\n- Prefer calling astro_workflow_proceed (step/loop) and astro_status only when actively managing a workflow.\n- Delegate stage work only to the stage subagent matching the current stage.\n- If a stage subagent returns status=blocked, inject the BLOCKED directive and stop.\n- Never delegate from subagents (enforced by permissions).\n- Be discretionary: assess if the user's request requires workflow initiation or just information.\n";
2
- export declare const BASE_STAGE_PROMPT = "You are an Astro stage subagent.\n\nFollow the latest [SYSTEM DIRECTIVE: ASTROCODE \u2014 STAGE_*] you receive.\n\nOutput exactly:\n1) Baton markdown (short, structured)\n2) Valid ASTRO JSON between markers:\n<!-- ASTRO_JSON_BEGIN -->\n{...}\n<!-- ASTRO_JSON_END -->\n\nDo not narrate. If blocked, ask exactly ONE question and stop.\n";
2
+ export declare const BASE_STAGE_PROMPT = "You are an Astro stage subagent.\n\nFollow the latest [SYSTEM DIRECTIVE: ASTROCODE \u2014 STAGE_*] you receive.\n\nOutput exactly:\n1) Baton markdown (short, structured)\n2) Valid ASTRO JSON between markers with ALL required fields:\n<!-- ASTRO_JSON_BEGIN -->\n{\n \"stage_key\": \"CURRENT_STAGE\",\n \"status\": \"ok\",\n \"summary\": \"Brief summary of work done\",\n \"decisions\": [\"Decision 1\", \"Decision 2\"],\n \"next_actions\": [\"Action 1\", \"Action 2\"],\n \"files\": [{\"path\": \"file.js\", \"kind\": \"file\"}],\n \"evidence\": [{\"path\": \"test.js\", \"kind\": \"evidence\"}],\n \"tasks\": [{\"title\": \"Task\", \"complexity\": 3}],\n \"new_stories\": [{\"title\": \"Story\", \"body_md\": \"Desc\"}],\n \"questions\": [],\n \"metrics\": {\"lines\": 100}\n}\n<!-- ASTRO_JSON_END -->\n\nCRITICAL: Include stage_key, status, and summary in EVERY response. Use \"ok\" status unless blocked/failed.\n\nDo not narrate. If blocked, ask exactly ONE question and stop.\n";
@@ -21,10 +21,24 @@ Follow the latest [SYSTEM DIRECTIVE: ASTROCODE — STAGE_*] you receive.
21
21
 
22
22
  Output exactly:
23
23
  1) Baton markdown (short, structured)
24
- 2) Valid ASTRO JSON between markers:
24
+ 2) Valid ASTRO JSON between markers with ALL required fields:
25
25
  <!-- ASTRO_JSON_BEGIN -->
26
- {...}
26
+ {
27
+ "stage_key": "CURRENT_STAGE",
28
+ "status": "ok",
29
+ "summary": "Brief summary of work done",
30
+ "decisions": ["Decision 1", "Decision 2"],
31
+ "next_actions": ["Action 1", "Action 2"],
32
+ "files": [{"path": "file.js", "kind": "file"}],
33
+ "evidence": [{"path": "test.js", "kind": "evidence"}],
34
+ "tasks": [{"title": "Task", "complexity": 3}],
35
+ "new_stories": [{"title": "Story", "body_md": "Desc"}],
36
+ "questions": [],
37
+ "metrics": {"lines": 100}
38
+ }
27
39
  <!-- ASTRO_JSON_END -->
28
40
 
41
+ CRITICAL: Include stage_key, status, and summary in EVERY response. Use "ok" status unless blocked/failed.
42
+
29
43
  Do not narrate. If blocked, ask exactly ONE question and stop.
30
44
  `;
@@ -81,10 +81,10 @@ export function createAstroStageCompleteTool(opts) {
81
81
  }
82
82
  const parsed = parseStageOutputText(output_text);
83
83
  if (parsed.error || !parsed.astro_json) {
84
- return `❌ Stage completion failed: ${parsed.error ?? "ASTRO JSON missing"}. Please ensure output includes proper JSON markers.`;
84
+ return `❌ JSON Parse Error: ${parsed.error ?? "ASTRO JSON missing"}. Ensure output includes <!-- ASTRO_JSON_BEGIN -->{...}<!-- ASTRO_JSON_END --> markers with valid JSON.`;
85
85
  }
86
86
  if (parsed.astro_json.stage_key !== sk) {
87
- return `❌ Stage completion failed: ASTRO JSON stage_key mismatch (expected ${sk}, got ${parsed.astro_json.stage_key}).`;
87
+ return `❌ Stage Key Mismatch: ASTRO JSON has stage_key="${parsed.astro_json.stage_key}" but expected "${sk}". Update the JSON to match the current stage.`;
88
88
  }
89
89
  // Evidence requirement
90
90
  const evidenceRequired = (sk === "verify" && config.workflow.evidence_required.verify) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astrocode-workflow",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "dependencies": {
19
19
  "@opencode-ai/plugin": "^1.1.19",
20
20
  "@opencode-ai/sdk": "^1.1.19",
21
- "astrocode-workflow": "0.1.1",
21
+ "astrocode-workflow": "^0.1.1",
22
22
  "jsonc-parser": "^3.2.0",
23
23
  "zod": "4.1.8"
24
24
  },
@@ -22,10 +22,24 @@ Follow the latest [SYSTEM DIRECTIVE: ASTROCODE — STAGE_*] you receive.
22
22
 
23
23
  Output exactly:
24
24
  1) Baton markdown (short, structured)
25
- 2) Valid ASTRO JSON between markers:
25
+ 2) Valid ASTRO JSON between markers with ALL required fields:
26
26
  <!-- ASTRO_JSON_BEGIN -->
27
- {...}
27
+ {
28
+ "stage_key": "CURRENT_STAGE",
29
+ "status": "ok",
30
+ "summary": "Brief summary of work done",
31
+ "decisions": ["Decision 1", "Decision 2"],
32
+ "next_actions": ["Action 1", "Action 2"],
33
+ "files": [{"path": "file.js", "kind": "file"}],
34
+ "evidence": [{"path": "test.js", "kind": "evidence"}],
35
+ "tasks": [{"title": "Task", "complexity": 3}],
36
+ "new_stories": [{"title": "Story", "body_md": "Desc"}],
37
+ "questions": [],
38
+ "metrics": {"lines": 100}
39
+ }
28
40
  <!-- ASTRO_JSON_END -->
29
41
 
42
+ CRITICAL: Include stage_key, status, and summary in EVERY response. Use "ok" status unless blocked/failed.
43
+
30
44
  Do not narrate. If blocked, ask exactly ONE question and stop.
31
45
  `;
@@ -94,11 +94,11 @@ export function createAstroStageCompleteTool(opts: { ctx: any; config: Astrocode
94
94
 
95
95
  const parsed = parseStageOutputText(output_text);
96
96
  if (parsed.error || !parsed.astro_json) {
97
- return `❌ Stage completion failed: ${parsed.error ?? "ASTRO JSON missing"}. Please ensure output includes proper JSON markers.`;
97
+ return `❌ JSON Parse Error: ${parsed.error ?? "ASTRO JSON missing"}. Ensure output includes <!-- ASTRO_JSON_BEGIN -->{...}<!-- ASTRO_JSON_END --> markers with valid JSON.`;
98
98
  }
99
99
 
100
100
  if (parsed.astro_json.stage_key !== sk) {
101
- return `❌ Stage completion failed: ASTRO JSON stage_key mismatch (expected ${sk}, got ${parsed.astro_json.stage_key}).`;
101
+ return `❌ Stage Key Mismatch: ASTRO JSON has stage_key="${parsed.astro_json.stage_key}" but expected "${sk}". Update the JSON to match the current stage.`;
102
102
  }
103
103
 
104
104
  // Evidence requirement