astrocode-workflow 0.1.18 → 0.1.19
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/agents/prompts.d.ts +1 -1
- package/dist/agents/prompts.js +20 -12
- package/dist/tools/stage.js +23 -1
- package/package.json +2 -2
- package/src/agents/prompts.ts +20 -12
- package/src/tools/stage.ts +23 -1
package/dist/agents/prompts.d.ts
CHANGED
|
@@ -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 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\": [
|
|
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 in this order:\n1) Baton markdown (short, structured narrative summary)\n2) Valid ASTRO JSON between markers with ALL required fields (do not omit any):\n\n<!-- ASTRO_JSON_BEGIN -->\n{\n \"schema_version\": 1,\n \"stage_key\": \"CURRENT_STAGE\",\n \"status\": \"ok\",\n \"summary\": \"Brief summary of work done\",\n \"decisions\": [],\n \"next_actions\": [],\n \"tasks\": [],\n \"files\": [],\n \"evidence\": [],\n \"new_stories\": [],\n \"questions\": [],\n \"metrics\": {}\n}\n<!-- ASTRO_JSON_END -->\n\nCRITICAL REQUIREMENTS:\n- Include ALL fields shown above (even if empty arrays/objects)\n- stage_key must match the current stage exactly\n- status must be \"ok\", \"blocked\", or \"failed\"\n- summary must be a non-empty string describing the work\n- JSON must be valid syntax and parseable\n- Markers must be exact: <!-- ASTRO_JSON_BEGIN --> and <!-- ASTRO_JSON_END -->\n\nDo not narrate extra text. If blocked, set status=\"blocked\", ask exactly ONE question in questions array, and stop.\n";
|
package/dist/agents/prompts.js
CHANGED
|
@@ -19,26 +19,34 @@ export const BASE_STAGE_PROMPT = `You are an Astro stage subagent.
|
|
|
19
19
|
|
|
20
20
|
Follow the latest [SYSTEM DIRECTIVE: ASTROCODE — STAGE_*] you receive.
|
|
21
21
|
|
|
22
|
-
Output exactly:
|
|
23
|
-
1) Baton markdown (short, structured)
|
|
24
|
-
2) Valid ASTRO JSON between markers with ALL required fields:
|
|
22
|
+
Output exactly in this order:
|
|
23
|
+
1) Baton markdown (short, structured narrative summary)
|
|
24
|
+
2) Valid ASTRO JSON between markers with ALL required fields (do not omit any):
|
|
25
|
+
|
|
25
26
|
<!-- ASTRO_JSON_BEGIN -->
|
|
26
27
|
{
|
|
28
|
+
"schema_version": 1,
|
|
27
29
|
"stage_key": "CURRENT_STAGE",
|
|
28
30
|
"status": "ok",
|
|
29
31
|
"summary": "Brief summary of work done",
|
|
30
|
-
"decisions": [
|
|
31
|
-
"next_actions": [
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"new_stories": [
|
|
32
|
+
"decisions": [],
|
|
33
|
+
"next_actions": [],
|
|
34
|
+
"tasks": [],
|
|
35
|
+
"files": [],
|
|
36
|
+
"evidence": [],
|
|
37
|
+
"new_stories": [],
|
|
36
38
|
"questions": [],
|
|
37
|
-
"metrics": {
|
|
39
|
+
"metrics": {}
|
|
38
40
|
}
|
|
39
41
|
<!-- ASTRO_JSON_END -->
|
|
40
42
|
|
|
41
|
-
CRITICAL:
|
|
43
|
+
CRITICAL REQUIREMENTS:
|
|
44
|
+
- Include ALL fields shown above (even if empty arrays/objects)
|
|
45
|
+
- stage_key must match the current stage exactly
|
|
46
|
+
- status must be "ok", "blocked", or "failed"
|
|
47
|
+
- summary must be a non-empty string describing the work
|
|
48
|
+
- JSON must be valid syntax and parseable
|
|
49
|
+
- Markers must be exact: <!-- ASTRO_JSON_BEGIN --> and <!-- ASTRO_JSON_END -->
|
|
42
50
|
|
|
43
|
-
Do not narrate. If blocked, ask exactly ONE question and stop.
|
|
51
|
+
Do not narrate extra text. If blocked, set status="blocked", ask exactly ONE question in questions array, and stop.
|
|
44
52
|
`;
|
package/dist/tools/stage.js
CHANGED
|
@@ -117,7 +117,29 @@ export function createAstroStageCompleteTool(opts) {
|
|
|
117
117
|
}
|
|
118
118
|
const parsed = parseStageOutputText(output_text);
|
|
119
119
|
if (parsed.error || !parsed.astro_json) {
|
|
120
|
-
return `❌ JSON Parse Error: ${parsed.error ?? "ASTRO JSON missing"}.
|
|
120
|
+
return `❌ JSON Parse Error: ${parsed.error ?? "ASTRO JSON missing"}.
|
|
121
|
+
|
|
122
|
+
Expected format:
|
|
123
|
+
1) Narrative summary (optional)
|
|
124
|
+
2) Valid JSON between markers:
|
|
125
|
+
<!-- ASTRO_JSON_BEGIN -->
|
|
126
|
+
{
|
|
127
|
+
"schema_version": 1,
|
|
128
|
+
"stage_key": "${sk}",
|
|
129
|
+
"status": "ok",
|
|
130
|
+
"summary": "Brief summary",
|
|
131
|
+
"decisions": [],
|
|
132
|
+
"next_actions": [],
|
|
133
|
+
"tasks": [],
|
|
134
|
+
"files": [],
|
|
135
|
+
"evidence": [],
|
|
136
|
+
"new_stories": [],
|
|
137
|
+
"questions": [],
|
|
138
|
+
"metrics": {}
|
|
139
|
+
}
|
|
140
|
+
<!-- ASTRO_JSON_END -->
|
|
141
|
+
|
|
142
|
+
Ensure JSON has required fields (stage_key, status) and valid syntax.`;
|
|
121
143
|
}
|
|
122
144
|
if (parsed.astro_json.stage_key !== sk) {
|
|
123
145
|
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.`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astrocode-workflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
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.
|
|
21
|
+
"astrocode-workflow": "^0.1.18",
|
|
22
22
|
"jsonc-parser": "^3.2.0",
|
|
23
23
|
"zod": "4.1.8"
|
|
24
24
|
},
|
package/src/agents/prompts.ts
CHANGED
|
@@ -20,26 +20,34 @@ export const BASE_STAGE_PROMPT = `You are an Astro stage subagent.
|
|
|
20
20
|
|
|
21
21
|
Follow the latest [SYSTEM DIRECTIVE: ASTROCODE — STAGE_*] you receive.
|
|
22
22
|
|
|
23
|
-
Output exactly:
|
|
24
|
-
1) Baton markdown (short, structured)
|
|
25
|
-
2) Valid ASTRO JSON between markers with ALL required fields:
|
|
23
|
+
Output exactly in this order:
|
|
24
|
+
1) Baton markdown (short, structured narrative summary)
|
|
25
|
+
2) Valid ASTRO JSON between markers with ALL required fields (do not omit any):
|
|
26
|
+
|
|
26
27
|
<!-- ASTRO_JSON_BEGIN -->
|
|
27
28
|
{
|
|
29
|
+
"schema_version": 1,
|
|
28
30
|
"stage_key": "CURRENT_STAGE",
|
|
29
31
|
"status": "ok",
|
|
30
32
|
"summary": "Brief summary of work done",
|
|
31
|
-
"decisions": [
|
|
32
|
-
"next_actions": [
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"new_stories": [
|
|
33
|
+
"decisions": [],
|
|
34
|
+
"next_actions": [],
|
|
35
|
+
"tasks": [],
|
|
36
|
+
"files": [],
|
|
37
|
+
"evidence": [],
|
|
38
|
+
"new_stories": [],
|
|
37
39
|
"questions": [],
|
|
38
|
-
"metrics": {
|
|
40
|
+
"metrics": {}
|
|
39
41
|
}
|
|
40
42
|
<!-- ASTRO_JSON_END -->
|
|
41
43
|
|
|
42
|
-
CRITICAL:
|
|
44
|
+
CRITICAL REQUIREMENTS:
|
|
45
|
+
- Include ALL fields shown above (even if empty arrays/objects)
|
|
46
|
+
- stage_key must match the current stage exactly
|
|
47
|
+
- status must be "ok", "blocked", or "failed"
|
|
48
|
+
- summary must be a non-empty string describing the work
|
|
49
|
+
- JSON must be valid syntax and parseable
|
|
50
|
+
- Markers must be exact: <!-- ASTRO_JSON_BEGIN --> and <!-- ASTRO_JSON_END -->
|
|
43
51
|
|
|
44
|
-
Do not narrate. If blocked, ask exactly ONE question and stop.
|
|
52
|
+
Do not narrate extra text. If blocked, set status="blocked", ask exactly ONE question in questions array, and stop.
|
|
45
53
|
`;
|
package/src/tools/stage.ts
CHANGED
|
@@ -153,7 +153,29 @@ export function createAstroStageCompleteTool(opts: { ctx: any; config: Astrocode
|
|
|
153
153
|
|
|
154
154
|
const parsed = parseStageOutputText(output_text);
|
|
155
155
|
if (parsed.error || !parsed.astro_json) {
|
|
156
|
-
|
|
156
|
+
return `❌ JSON Parse Error: ${parsed.error ?? "ASTRO JSON missing"}.
|
|
157
|
+
|
|
158
|
+
Expected format:
|
|
159
|
+
1) Narrative summary (optional)
|
|
160
|
+
2) Valid JSON between markers:
|
|
161
|
+
<!-- ASTRO_JSON_BEGIN -->
|
|
162
|
+
{
|
|
163
|
+
"schema_version": 1,
|
|
164
|
+
"stage_key": "${sk}",
|
|
165
|
+
"status": "ok",
|
|
166
|
+
"summary": "Brief summary",
|
|
167
|
+
"decisions": [],
|
|
168
|
+
"next_actions": [],
|
|
169
|
+
"tasks": [],
|
|
170
|
+
"files": [],
|
|
171
|
+
"evidence": [],
|
|
172
|
+
"new_stories": [],
|
|
173
|
+
"questions": [],
|
|
174
|
+
"metrics": {}
|
|
175
|
+
}
|
|
176
|
+
<!-- ASTRO_JSON_END -->
|
|
177
|
+
|
|
178
|
+
Ensure JSON has required fields (stage_key, status) and valid syntax.`;
|
|
157
179
|
}
|
|
158
180
|
|
|
159
181
|
if (parsed.astro_json.stage_key !== sk) {
|