astrocode-workflow 0.1.12 → 0.1.16

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,6 +1,6 @@
1
1
  import type { AgentConfig } from "@opencode-ai/sdk";
2
2
  import type { AstrocodeConfig } from "../config/schema";
3
3
  export declare function createAstroAgents(opts: {
4
- systemDefaultModel: string;
4
+ systemDefaultModel?: string;
5
5
  pluginConfig: AstrocodeConfig;
6
6
  }): Record<string, AgentConfig>;
package/dist/index.js CHANGED
@@ -6,11 +6,14 @@ import { createAstroTools } from "./tools";
6
6
  import { createContinuationEnforcer } from "./hooks/continuation-enforcer";
7
7
  import { createToolOutputTruncatorHook } from "./hooks/tool-output-truncator";
8
8
  import { createToastManager } from "./ui/toasts";
9
+ import { createAstroAgents } from "./agents/registry";
9
10
  console.log("Astrocode plugin loading...");
10
11
  const Astrocode = async (ctx) => {
11
12
  const repoRoot = ctx.directory;
12
13
  // Always load config first - this provides defaults even in limited mode
13
14
  let pluginConfig = loadAstrocodeConfig(repoRoot);
15
+ // Create agents for registration
16
+ const agents = createAstroAgents({ pluginConfig });
14
17
  // Always ensure .astro directories exist, even in limited mode
15
18
  const paths = getAstroPaths(repoRoot, pluginConfig.db.path);
16
19
  ensureAstroDirs(paths);
@@ -48,6 +51,8 @@ const Astrocode = async (ctx) => {
48
51
  }
49
52
  return {
50
53
  name: "Astrocode",
54
+ // Register agents
55
+ agents,
51
56
  // Merge agents + slash commands into system config
52
57
  config: configHandler,
53
58
  // Register tools
@@ -219,8 +219,9 @@ export function createAstroStageCompleteTool(opts) {
219
219
  const specPath = path.join(repoRoot, ".astro", "spec.md");
220
220
  if (fs.existsSync(specPath) && fs.statSync(specPath).size > 100) {
221
221
  // Skip spec
222
- db.prepare("INSERT INTO stage_runs (stage_run_id, run_id, stage_key, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)")
223
- .run(newId("stage"), rid, "spec", "skipped", now, now);
222
+ const specIndex = pipeline.indexOf("spec");
223
+ db.prepare("INSERT INTO stage_runs (stage_run_id, run_id, stage_key, stage_index, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)")
224
+ .run(newId("stage"), rid, "spec", specIndex, "skipped", now, now);
224
225
  next = "implement";
225
226
  }
226
227
  }
@@ -85,11 +85,15 @@ export function buildStageDirective(opts) {
85
85
  `Output contract (strict):`,
86
86
  `1) Baton markdown (short, structured)`,
87
87
  `2) ASTRO JSON between markers:`,
88
- ` ${"```"}`,
89
88
  ` ${"<!-- ASTRO_JSON_BEGIN -->"}`,
90
- ` {...}`,
89
+ ` {`,
90
+ ` "schema_version": 1,`,
91
+ ` "stage_key": "${stage_key}",`,
92
+ ` "status": "ok",`,
93
+ ` "summary": "Brief summary of work done",`,
94
+ ` ...`,
95
+ ` }`,
91
96
  ` ${"<!-- ASTRO_JSON_END -->"}`,
92
- ` ${"```"}`,
93
97
  ``,
94
98
  `ASTRO JSON requirements:`,
95
99
  `- stage_key must be "${stage_key}"`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astrocode-workflow",
3
- "version": "0.1.12",
3
+ "version": "0.1.16",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -116,7 +116,7 @@ function stageVerifyPermissions(): PermissionMap {
116
116
  }
117
117
 
118
118
  export function createAstroAgents(opts: {
119
- systemDefaultModel: string;
119
+ systemDefaultModel?: string;
120
120
  pluginConfig: AstrocodeConfig;
121
121
  }): Record<string, AgentConfig> {
122
122
  const { systemDefaultModel, pluginConfig } = opts;
package/src/index.ts CHANGED
@@ -7,6 +7,7 @@ import { createAstroTools } from "./tools";
7
7
  import { createContinuationEnforcer } from "./hooks/continuation-enforcer";
8
8
  import { createToolOutputTruncatorHook } from "./hooks/tool-output-truncator";
9
9
  import { createToastManager } from "./ui/toasts";
10
+ import { createAstroAgents } from "./agents/registry";
10
11
  import { info, warn } from "./shared/log";
11
12
 
12
13
  console.log("Astrocode plugin loading...");
@@ -17,6 +18,9 @@ const Astrocode: Plugin = async (ctx) => {
17
18
  // Always load config first - this provides defaults even in limited mode
18
19
  let pluginConfig = loadAstrocodeConfig(repoRoot);
19
20
 
21
+ // Create agents for registration
22
+ const agents = createAstroAgents({ pluginConfig });
23
+
20
24
  // Always ensure .astro directories exist, even in limited mode
21
25
  const paths = getAstroPaths(repoRoot, pluginConfig.db.path);
22
26
  ensureAstroDirs(paths);
@@ -62,6 +66,9 @@ const Astrocode: Plugin = async (ctx) => {
62
66
  return {
63
67
  name: "Astrocode",
64
68
 
69
+ // Register agents
70
+ agents,
71
+
65
72
  // Merge agents + slash commands into system config
66
73
  config: configHandler,
67
74
 
@@ -300,8 +300,9 @@ export function createAstroStageCompleteTool(opts: { ctx: any; config: Astrocode
300
300
  const specPath = path.join(repoRoot, ".astro", "spec.md");
301
301
  if (fs.existsSync(specPath) && fs.statSync(specPath).size > 100) {
302
302
  // Skip spec
303
- db.prepare("INSERT INTO stage_runs (stage_run_id, run_id, stage_key, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?)")
304
- .run(newId("stage"), rid, "spec", "skipped", now, now);
303
+ const specIndex = pipeline.indexOf("spec");
304
+ db.prepare("INSERT INTO stage_runs (stage_run_id, run_id, stage_key, stage_index, status, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?)")
305
+ .run(newId("stage"), rid, "spec", specIndex, "skipped", now, now);
305
306
  next = "implement";
306
307
  }
307
308
  }
@@ -140,11 +140,15 @@ export function buildStageDirective(opts: {
140
140
  `Output contract (strict):`,
141
141
  `1) Baton markdown (short, structured)`,
142
142
  `2) ASTRO JSON between markers:`,
143
- ` ${"```"}`,
144
143
  ` ${"<!-- ASTRO_JSON_BEGIN -->"}`,
145
- ` {...}`,
144
+ ` {`,
145
+ ` "schema_version": 1,`,
146
+ ` "stage_key": "${stage_key}",`,
147
+ ` "status": "ok",`,
148
+ ` "summary": "Brief summary of work done",`,
149
+ ` ...`,
150
+ ` }`,
146
151
  ` ${"<!-- ASTRO_JSON_END -->"}`,
147
- ` ${"```"}`,
148
152
  ``,
149
153
  `ASTRO JSON requirements:`,
150
154
  `- stage_key must be "${stage_key}"`,