astrocode-workflow 0.1.48 → 0.1.52

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.
@@ -10,13 +10,13 @@ import { debug } from "../shared/log";
10
10
  import { createToastManager } from "../ui/toasts";
11
11
  // Agent name mapping for case-sensitive resolution
12
12
  const STAGE_TO_AGENT_MAP = {
13
- frame: "explore", // Research and analysis for requirements
14
- plan: "general", // General planning and decomposition
15
- spec: "Librarian", // Documentation and specification
16
- implement: "general", // General implementation
17
- review: "general", // General review
18
- verify: "general", // General verification
19
- close: "general" // General closure
13
+ frame: "frame",
14
+ plan: "plan",
15
+ spec: "spec",
16
+ implement: "implement",
17
+ review: "review",
18
+ verify: "verify",
19
+ close: "close"
20
20
  };
21
21
  function resolveAgentName(stageKey, config) {
22
22
  // Use configurable agent names from config, fallback to hardcoded map, then General
@@ -193,8 +193,7 @@ export function createAstroWorkflowProceedTool(opts) {
193
193
  return false;
194
194
  };
195
195
  if (!agentExists(agentName)) {
196
- console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to orchestrator instead of General.`);
197
- console.warn(`[Astrocode] Agent check: config.agent exists: ${!!systemConfig.agent}, agentName in config: ${systemConfig.agent ? agentName in systemConfig.agent : 'N/A'}`);
196
+ console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to orchestrator.`);
198
197
  // Skip General fallback for stage agents to avoid malformed output
199
198
  agentName = config.agents?.orchestrator_name || "Astro";
200
199
  if (!agentExists(agentName)) {
package/dist/ui/inject.js CHANGED
@@ -6,7 +6,7 @@ export async function injectChatPrompt(opts) {
6
6
  const prefixedText = `[${agent}]\n\n${text}`;
7
7
  if (isInjecting) {
8
8
  // Replace any existing queued injection (keep only latest)
9
- queuedInjection = { ...opts, text: prefixedText, agent };
9
+ queuedInjection = opts;
10
10
  return;
11
11
  }
12
12
  isInjecting = true;
@@ -39,7 +39,7 @@ export async function injectChatPrompt(opts) {
39
39
  const next = queuedInjection;
40
40
  queuedInjection = null;
41
41
  // Schedule next injection asynchronously to prevent recursion
42
- setImmediate(() => injectChatPrompt({ ...next, text: prefixedText, agent }));
42
+ setImmediate(() => injectChatPrompt(next));
43
43
  }
44
44
  }
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astrocode-workflow",
3
- "version": "0.1.48",
3
+ "version": "0.1.52",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,13 +14,13 @@ import { createToastManager } from "../ui/toasts";
14
14
 
15
15
  // Agent name mapping for case-sensitive resolution
16
16
  const STAGE_TO_AGENT_MAP: Record<string, string> = {
17
- frame: "explore", // Research and analysis for requirements
18
- plan: "general", // General planning and decomposition
19
- spec: "Librarian", // Documentation and specification
20
- implement: "general", // General implementation
21
- review: "general", // General review
22
- verify: "general", // General verification
23
- close: "general" // General closure
17
+ frame: "frame",
18
+ plan: "plan",
19
+ spec: "spec",
20
+ implement: "implement",
21
+ review: "review",
22
+ verify: "verify",
23
+ close: "close"
24
24
  };
25
25
 
26
26
  function resolveAgentName(stageKey: StageKey, config: AstrocodeConfig): string {
@@ -235,8 +235,7 @@ export function createAstroWorkflowProceedTool(opts: { ctx: any; config: Astroco
235
235
  };
236
236
 
237
237
  if (!agentExists(agentName)) {
238
- console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to orchestrator instead of General.`);
239
- console.warn(`[Astrocode] Agent check: config.agent exists: ${!!systemConfig.agent}, agentName in config: ${systemConfig.agent ? agentName in systemConfig.agent : 'N/A'}`);
238
+ console.warn(`[Astrocode] Agent ${agentName} not found in config. Falling back to orchestrator.`);
240
239
  // Skip General fallback for stage agents to avoid malformed output
241
240
  agentName = config.agents?.orchestrator_name || "Astro";
242
241
  if (!agentExists(agentName)) {
package/src/ui/inject.ts CHANGED
@@ -14,7 +14,7 @@ export async function injectChatPrompt(opts: {
14
14
 
15
15
  if (isInjecting) {
16
16
  // Replace any existing queued injection (keep only latest)
17
- queuedInjection = { ...opts, text: prefixedText, agent };
17
+ queuedInjection = opts;
18
18
  return;
19
19
  }
20
20
 
@@ -49,7 +49,7 @@ export async function injectChatPrompt(opts: {
49
49
  const next = queuedInjection;
50
50
  queuedInjection = null;
51
51
  // Schedule next injection asynchronously to prevent recursion
52
- setImmediate(() => injectChatPrompt({ ...next, text: prefixedText, agent }));
52
+ setImmediate(() => injectChatPrompt(next));
53
53
  }
54
54
  }
55
55
  }