nightshift-mcp 1.0.8 → 1.0.10

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.
Files changed (48) hide show
  1. package/README.md +113 -38
  2. package/dist/agent-spawner.d.ts +2 -2
  3. package/dist/agent-spawner.d.ts.map +1 -1
  4. package/dist/agent-spawner.js +60 -10
  5. package/dist/agent-spawner.js.map +1 -1
  6. package/dist/context-store.d.ts +24 -0
  7. package/dist/context-store.d.ts.map +1 -0
  8. package/dist/context-store.js +118 -0
  9. package/dist/context-store.js.map +1 -0
  10. package/dist/index.js +12 -4
  11. package/dist/index.js.map +1 -1
  12. package/dist/orchestrator.d.ts.map +1 -1
  13. package/dist/orchestrator.js +4 -2
  14. package/dist/orchestrator.js.map +1 -1
  15. package/dist/platform.d.ts.map +1 -1
  16. package/dist/platform.js +6 -5
  17. package/dist/platform.js.map +1 -1
  18. package/dist/tool-registry.d.ts +3 -1
  19. package/dist/tool-registry.d.ts.map +1 -1
  20. package/dist/tool-registry.js +2 -0
  21. package/dist/tool-registry.js.map +1 -1
  22. package/dist/tools/agents.d.ts.map +1 -1
  23. package/dist/tools/agents.js +92 -12
  24. package/dist/tools/agents.js.map +1 -1
  25. package/dist/tools/context.d.ts +5 -0
  26. package/dist/tools/context.d.ts.map +1 -0
  27. package/dist/tools/context.js +138 -0
  28. package/dist/tools/context.js.map +1 -0
  29. package/dist/tools/index.d.ts +4 -0
  30. package/dist/tools/index.d.ts.map +1 -1
  31. package/dist/tools/index.js +8 -0
  32. package/dist/tools/index.js.map +1 -1
  33. package/dist/tools/trace.d.ts +4 -0
  34. package/dist/tools/trace.d.ts.map +1 -0
  35. package/dist/tools/trace.js +98 -0
  36. package/dist/tools/trace.js.map +1 -0
  37. package/dist/tools/utility.d.ts.map +1 -1
  38. package/dist/tools/utility.js +2 -1
  39. package/dist/tools/utility.js.map +1 -1
  40. package/dist/trace-manager.d.ts +65 -0
  41. package/dist/trace-manager.d.ts.map +1 -0
  42. package/dist/trace-manager.js +143 -0
  43. package/dist/trace-manager.js.map +1 -0
  44. package/dist/workflow-manager.d.ts +8 -1
  45. package/dist/workflow-manager.d.ts.map +1 -1
  46. package/dist/workflow-manager.js +30 -3
  47. package/dist/workflow-manager.js.map +1 -1
  48. package/package.json +2 -4
package/README.md CHANGED
@@ -6,7 +6,7 @@ Explicit delegation, review, and handoffs between AI models.
6
6
 
7
7
  ---
8
8
 
9
- An MCP (Model Context Protocol) server for agent teams and multi-agent orchestration across different AI models. Coordinate Claude, Codex, Gemini, and Vibe as an agentic team — with structured delegation, shared task management, and autonomous workflows. Works with any MCP-compatible client.
9
+ An MCP (Model Context Protocol) server for agent teams and multi-agent orchestration across different AI models. Coordinate Claude, Codex, Gemini, Vibe, and Goose as an agentic team — with structured delegation, shared task management, and autonomous workflows. Works with any MCP-compatible client.
10
10
 
11
11
  ## Features
12
12
 
@@ -14,7 +14,9 @@ An MCP (Model Context Protocol) server for agent teams and multi-agent orchestra
14
14
  - **Failover handling**: Seamless handoffs when an agent hits limits or context windows fill up
15
15
  - **PRD-driven task management**: Work through user stories in prd.json with Zod-validated schemas and helpful error messages
16
16
  - **Progress tracking**: Shared learnings via progress.txt
17
- - **Agent spawning & orchestration**: Spawn Claude, Codex, Gemini, or Vibe as subprocesses with full lifecycle tracking
17
+ - **Selective context retrieval**: Topic-based context store lets agents query relevant context instead of prompt-stuffing
18
+ - **Execution tracing**: Structured trace of agent spawns, completions, and failures with parent-child tree visualization
19
+ - **Agent spawning & orchestration**: Spawn Claude, Codex, Gemini, Vibe, or Goose as subprocesses with full lifecycle tracking
18
20
  - **Autonomous orchestration**: Single `orchestrate` tool runs a claim→implement→complete loop until all stories pass
19
21
  - **Agent status tracking**: Monitor spawned agents by PID, check exit codes, and tail output in real-time
20
22
  - **Smart retry**: Automatically suggests or uses a different agent when one fails
@@ -23,7 +25,7 @@ An MCP (Model Context Protocol) server for agent teams and multi-agent orchestra
23
25
  - **Auto-archiving**: Archive old messages to keep the chat file manageable
24
26
  - **Cross-platform**: Works on Windows, Linux, and macOS (uses cross-spawn and platform-safe process management)
25
27
  - **Heterogeneous agent teams**: Mix different AI models — use each for what it's best at
26
- - **Universal compatibility**: Works with any MCP-supporting tool (42 tools across 8 categories)
28
+ - **Universal compatibility**: Works with any MCP-supporting tool (49 tools across 10 categories)
27
29
  - **Simple file-based storage**: No external services required
28
30
 
29
31
  ## Installation
@@ -374,36 +376,107 @@ Add a reusable pattern to the Codebase Patterns section.
374
376
  **Parameters:**
375
377
  - `pattern` (required): The pattern (e.g., "Use sql<number> for aggregations")
376
378
 
379
+ ### Context Store
380
+
381
+ NightShift includes a selective context retrieval system that replaces prompt-stuffing with topic-based queries. Instead of truncating progress.txt to fit the context window, agents can store and retrieve relevant context on demand.
382
+
383
+ Context entries are stored as individual JSON files in `.robot-chat/context/` for concurrent-safe multi-agent access.
384
+
385
+ #### `store_context`
386
+ Store a context entry for other agents to query later.
387
+
388
+ **Parameters:**
389
+ - `topic` (required): Topic/category (e.g., "authentication", "database-schema")
390
+ - `content` (required): The context to store (learnings, decisions, findings)
391
+ - `agent` (required): Your agent name
392
+ - `tags` (optional): Tags for better searchability (e.g., ["auth", "jwt"])
393
+
394
+ **Example:**
395
+ ```
396
+ store_context(topic: "authentication", content: "Using JWT with RS256. Refresh tokens stored in httpOnly cookies.", agent: "Claude", tags: ["jwt", "cookies"])
397
+ ```
398
+
399
+ #### `query_context`
400
+ Search stored context entries by topic.
401
+
402
+ **Parameters:**
403
+ - `topic` (required): Search term (case-insensitive match on topic and tags)
404
+ - `limit` (optional): Max entries to return (default: 10)
405
+
406
+ **Example:**
407
+ ```
408
+ query_context(topic: "auth")
409
+ # Returns all entries matching "auth" in topic or tags, sorted by recency
410
+ ```
411
+
412
+ #### `list_context`
413
+ List all topics in the context store with entry counts.
414
+
415
+ **How delegation uses context:**
416
+
417
+ When `delegate_story` or `delegate_research` spawns an agent, it queries the context store for entries relevant to the task and includes them in the prompt — instead of blindly truncating progress.txt. Agents are also instructed to use `store_context` to save their learnings, creating a self-enriching context loop.
418
+
419
+ ### Execution Tracing
420
+
421
+ NightShift automatically traces all agent spawns, completions, and failures into a structured execution log at `.robot-chat/trace.json`. Each trace event has parent-child relationships that can be reconstructed as a tree for debugging multi-agent runs.
422
+
423
+ #### `get_trace`
424
+ View the execution trace as a flat list or tree.
425
+
426
+ **Parameters:**
427
+ - `tree` (optional): Return as tree with parent-child relationships (default: false)
428
+ - `taskId` (optional): Filter by story/task ID
429
+
430
+ **Example:**
431
+ ```
432
+ get_trace(tree: true)
433
+ # Returns tree showing: orchestrator → spawned claude (US-001) → completed
434
+ # orchestrator → spawned codex (US-002) → failed → retried with gemini → completed
435
+ ```
436
+
437
+ #### `clear_trace`
438
+ Reset the trace for a fresh orchestration run.
439
+
440
+ **What gets traced automatically:**
441
+ - `spawn_agent` and `spawn_agent_background` calls
442
+ - `delegate_story` and `delegate_research` delegations
443
+ - `orchestrate` decisions (inline mode)
444
+ - Agent completions with exit codes
445
+ - Agent failures with error details
446
+
447
+ Each trace event includes metadata: agent type, story ID, prompt length, exit code, and timing.
448
+
377
449
  ### Autonomous Workflow
378
450
 
379
451
  With multiple agents working together:
380
452
 
381
453
  ```
382
- ┌─────────────────────────────────────────────────────────────┐
383
- NightShift Workflow
384
- ├─────────────────────────────────────────────────────────────┤
385
-
386
- │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
387
- │ │ Claude │ │ Codex │ │ Gemini │ │ Vibe │
388
- │ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘
389
- │ │ │ │ │
390
- └───────────┴─────┬─────┴───────────┘
391
-
392
-
393
- ┌─────────────────┐
394
- │ │ .robot-chat/ │ ◄── Agent coordination
395
- │ │ chat.txt │
396
- └─────────────────┘
397
-
398
- ┌───────────────┼───────────────┐
399
- │ │
400
- │ ▼
401
- ┌─────────┐ ┌──────────┐ ┌────────────┐
402
- prd.json│ │progress.Code
403
- (tasks) │ txt │ Changes
404
- └─────────┘ └──────────┘ └────────────┘
405
-
406
- └─────────────────────────────────────────────────────────────┘
454
+ ┌──────────────────────────────────────────────────────────────────┐
455
+ NightShift Workflow
456
+ ├──────────────────────────────────────────────────────────────────┤
457
+
458
+ │ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
459
+ │ │ Claude │ │ Codex │ │ Gemini │ │ Vibe │ Goose │ │
460
+ │ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘ └───┬────┘
461
+ │ │ │ │ │
462
+ └───────────┴─────┬─────┴───────────┴───────────┘
463
+
464
+
465
+ ┌──────────────────┐
466
+ │ │ .robot-chat/ │ ◄── Agent coordination
467
+ │ │ chat.txt │
468
+ └──────────────────┘
469
+
470
+ ┌──────────┬────────┼────────┬──────────┐
471
+ │ │
472
+ ▼ ▼
473
+ ┌────────┐ ┌────────┐ ┌────┐ ┌──────────┐ ┌──────────┐
474
+ │prd.json│ │progress │Code│ context/ │ │trace.json│ │
475
+ │(tasks) │ .txt │ │ (per-topic (execution│ │
476
+ │ │ │ │ │ │ │ queries) │ │ tree)
477
+ └────────┘ └────────┘ └────┘ └──────────┘ └──────────┘
478
+ │ │
479
+ └──────────────────────────────────────────────────────────────────┘
407
480
  ```
408
481
 
409
482
  Each agent:
@@ -602,13 +675,13 @@ One agent can spawn others as subprocesses, enabling fully autonomous multi-agen
602
675
  ### Spawning Tools
603
676
 
604
677
  #### `list_available_agents`
605
- Check which agent CLIs (claude, codex, gemini, vibe) are installed and ready to run.
678
+ Check which agent CLIs (claude, codex, gemini, vibe, goose) are installed and ready to run.
606
679
 
607
680
  #### `spawn_agent`
608
681
  Spawn another agent as a subprocess and wait for completion.
609
682
 
610
683
  **Parameters:**
611
- - `agent` (required): "claude", "codex", "gemini", or "vibe"
684
+ - `agent` (required): "claude", "codex", "gemini", "vibe", or "goose"
612
685
  - `prompt` (required): Task/prompt to send
613
686
  - `timeout` (optional): Seconds before timeout (default: 300)
614
687
 
@@ -621,14 +694,14 @@ spawn_agent(agent: "codex", prompt: "Fix the type errors in src/utils.ts")
621
694
  Spawn an agent in the background (non-blocking). Returns immediately with PID and output file path.
622
695
 
623
696
  **Parameters:**
624
- - `agent` (required): "claude", "codex", "gemini", or "vibe"
697
+ - `agent` (required): "claude", "codex", "gemini", "vibe", or "goose"
625
698
  - `prompt` (required): Task/prompt to send
626
699
 
627
700
  #### `delegate_story`
628
701
  Delegate a PRD user story to another agent with full context. On failure, returns a `retryHint` suggesting alternative available agents.
629
702
 
630
703
  **Parameters:**
631
- - `agent` (required): "claude", "codex", "gemini", or "vibe"
704
+ - `agent` (required): "claude", "codex", "gemini", "vibe", or "goose"
632
705
  - `storyId` (optional): Story ID to delegate (defaults to next available)
633
706
  - `background` (optional): Run in background (default: false)
634
707
 
@@ -639,15 +712,16 @@ delegate_story(agent: "gemini", storyId: "US-003", background: true)
639
712
 
640
713
  The spawned agent receives:
641
714
  - Full story description and acceptance criteria
642
- - Recent content from progress.txt
715
+ - Relevant context from the context store (or progress.txt as fallback)
643
716
  - Recent chat messages for context
644
- - Instructions to use nightshift tools for coordination
717
+ - Instructions to use nightshift tools for coordination (including `store_context` and `query_context`)
645
718
 
646
719
  #### `delegate_research`
647
- Delegate a research or planning task to Gemini. Ideal for read-only tasks like codebase analysis, architecture planning, code review, and documentation.
720
+ Delegate a research or planning task to an agent (default: Gemini). Ideal for read-only tasks like codebase analysis, architecture planning, code review, and documentation. Queries the context store for relevant prior findings.
648
721
 
649
722
  **Parameters:**
650
723
  - `task` (required): The research/planning task description
724
+ - `agent` (optional): Which agent to use (default: gemini)
651
725
  - `context` (optional): Additional context to provide
652
726
  - `background` (optional): Run in background (default: false)
653
727
 
@@ -697,7 +771,7 @@ delegate_story(agent: "gemini") # Then delegate next
697
771
  **Parallel execution:**
698
772
  ```
699
773
  delegate_story(agent: "codex", storyId: "US-001", background: true)
700
- delegate_story(agent: "gemini", storyId: "US-002", background: true)
774
+ delegate_story(agent: "goose", storyId: "US-002", background: true)
701
775
  # Work on US-003 yourself while they run in parallel
702
776
  # Monitor with get_agent_status or list_running_agents
703
777
  ```
@@ -788,12 +862,13 @@ The daemon provides hands-off multi-agent orchestration:
788
862
  1. **Same directory**: All agents must run in the same project directory to share chat
789
863
  2. **Claim before working**: Always claim stories to prevent duplicate work
790
864
  3. **Post status updates**: Keep other agents informed of progress
791
- 4. **Document learnings**: Progress.txt helps future iterations
865
+ 4. **Store context, not just progress**: Use `store_context` to share learnings by topic — other agents can query for exactly what they need instead of reading a giant progress file
792
866
  5. **Handle failovers**: Check for and claim failovers at the start of each session
793
867
  6. **Use delegation**: One orchestrating agent can spawn others for parallel work
794
868
  7. **Monitor background agents**: Use `get_agent_status` and `list_running_agents` to track spawned agents
795
869
  8. **Use `orchestrate` for full autonomy**: The `orchestrate` tool handles the entire claim→implement→complete loop
796
- 9. **Add `.robot-chat/` to your project's `.gitignore`**: Chat logs are ephemeral and shouldn't be committed
870
+ 9. **Review traces after runs**: Use `get_trace(tree: true)` to understand what happened during orchestration
871
+ 10. **Add `.robot-chat/` to your project's `.gitignore`**: Chat logs, context, and traces are ephemeral and shouldn't be committed
797
872
 
798
873
  ## License
799
874
 
@@ -1,4 +1,4 @@
1
- export type AgentType = "claude" | "codex" | "gemini" | "vibe";
1
+ export type AgentType = "claude" | "codex" | "gemini" | "vibe" | "goose";
2
2
  export interface TrackedAgent {
3
3
  agent: AgentType;
4
4
  pid: number | undefined;
@@ -70,7 +70,7 @@ export declare function spawnAgentBackground(options: SpawnOptions): {
70
70
  */
71
71
  export declare function isAgentAvailable(agent: AgentType): Promise<boolean>;
72
72
  /**
73
- * Check if an agent can actually run
73
+ * Check if an agent can actually run by executing a quick smoke test (--version)
74
74
  */
75
75
  export declare function canAgentRun(agent: AgentType): Promise<{
76
76
  available: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-spawner.d.ts","sourceRoot":"","sources":["../src/agent-spawner.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAA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EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA8DD;;GAEG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAmG5E;AAiJD;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG;IAC3D,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAqEA;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAGzE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC;IAC3D,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC,CAmDD;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC,CAW/D;AAED;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAC7C,MAAM,CAAC,SAAS,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAC5E,CAYA"}
@@ -1,7 +1,7 @@
1
- import crossSpawn from "cross-spawn";
1
+ import { spawn, spawnSync } from "child_process";
2
2
  import * as path from "path";
3
3
  import * as fs from "fs";
4
- import { commandExistsAsync, killProcess, isProcessRunning, } from "./platform.js";
4
+ import { commandExistsAsync, killProcess, isProcessRunning, isWindows, } from "./platform.js";
5
5
  /** All agents spawned in this session, keyed by PID or outputFile */
6
6
  const trackedAgents = new Map();
7
7
  function trackAgent(entry) {
@@ -103,11 +103,23 @@ function getAgentConfig(agent) {
103
103
  case "vibe":
104
104
  // -p enables programmatic mode (reads prompt from stdin)
105
105
  // --output text gives clean output without JSON wrapper
106
+ // Prompt is delivered via stdin to avoid Windows cmd.exe quoting
107
+ // issues and command-line length limits (~8191 chars on Windows)
106
108
  return {
107
109
  cmd: "vibe",
108
110
  args: ["-p", "--output", "text"],
109
111
  promptDelivery: "stdin",
110
112
  };
113
+ case "goose":
114
+ // goose run: non-interactive task execution
115
+ // --no-session: don't persist session state
116
+ // -q: quiet mode, only model output
117
+ // --instructions -: read prompt from stdin (supports large prompts)
118
+ return {
119
+ cmd: "goose",
120
+ args: ["run", "--no-session", "-q", "--instructions", "-"],
121
+ promptDelivery: "stdin",
122
+ };
111
123
  default:
112
124
  throw new Error(`Unknown agent type: ${agent}`);
113
125
  }
@@ -131,14 +143,17 @@ export async function spawnAgent(options) {
131
143
  }
132
144
  finalArgs.push(promptFlag, prompt);
133
145
  }
134
- // Use cross-spawn for cross-platform compatibility
135
- const proc = crossSpawn(cmd, finalArgs, {
146
+ // Use native spawn with shell: true on Windows to resolve .cmd/.bat shims
147
+ // (cross-spawn with shell: true still fails ENOENT on Windows .cmd shims)
148
+ const proc = spawn(cmd, finalArgs, {
136
149
  cwd: projectPath,
137
150
  env: {
138
151
  ...process.env,
139
152
  ROBOT_CHAT_PROJECT_PATH: projectPath,
140
153
  },
141
154
  stdio: ["pipe", "pipe", "pipe"],
155
+ shell: isWindows,
156
+ windowsHide: true,
142
157
  });
143
158
  // Set timeout
144
159
  const timeoutId = setTimeout(() => {
@@ -262,12 +277,13 @@ if (promptDelivery === "flag" && promptFlag) {
262
277
  // Write header to output file
263
278
  fs.writeFileSync(outputFile, \`Agent: \${agent}\\nStarted: \${new Date().toISOString()}\\n---\\n\`);
264
279
 
265
- // Spawn the agent
280
+ // Spawn the agent (use shell on Windows to resolve .cmd/.bat shims)
266
281
  const proc = spawn(cmd, finalArgs, {
267
282
  cwd: process.cwd(),
268
283
  env: process.env,
269
284
  stdio: ["pipe", "pipe", "pipe"],
270
- shell: false,
285
+ shell: process.platform === "win32",
286
+ windowsHide: true,
271
287
  });
272
288
 
273
289
  let output = "";
@@ -347,7 +363,7 @@ export function spawnAgentBackground(options) {
347
363
  const wrapperScript = createWrapperScript(agent, cmd, args, promptFile, outputFile, promptDelivery, promptFlag);
348
364
  fs.writeFileSync(wrapperFile, wrapperScript, "utf-8");
349
365
  // Spawn Node.js to run the wrapper script
350
- const proc = crossSpawn("node", [wrapperFile], {
366
+ const proc = spawn("node", [wrapperFile], {
351
367
  cwd: projectPath,
352
368
  env: {
353
369
  ...process.env,
@@ -355,6 +371,7 @@ export function spawnAgentBackground(options) {
355
371
  },
356
372
  detached: true,
357
373
  stdio: "ignore",
374
+ windowsHide: true,
358
375
  });
359
376
  proc.unref();
360
377
  // Track the spawned agent
@@ -389,7 +406,7 @@ export async function isAgentAvailable(agent) {
389
406
  return commandExistsAsync(config.cmd);
390
407
  }
391
408
  /**
392
- * Check if an agent can actually run
409
+ * Check if an agent can actually run by executing a quick smoke test (--version)
393
410
  */
394
411
  export async function canAgentRun(agent) {
395
412
  const config = getAgentConfig(agent);
@@ -401,6 +418,39 @@ export async function canAgentRun(agent) {
401
418
  reason: `${agent} CLI not found in PATH`,
402
419
  };
403
420
  }
421
+ // Actually try running the agent with --version to verify it works
422
+ // This catches broken installs, missing auth, bad configurations, etc.
423
+ try {
424
+ const result = spawnSync(config.cmd, ["--version"], {
425
+ timeout: 15000,
426
+ stdio: "pipe",
427
+ shell: isWindows,
428
+ windowsHide: true,
429
+ encoding: "utf-8",
430
+ });
431
+ if (result.error) {
432
+ return {
433
+ available: true,
434
+ canRun: false,
435
+ reason: `${agent} CLI found but failed to execute: ${result.error.message}`,
436
+ };
437
+ }
438
+ if (result.status !== null && result.status !== 0) {
439
+ const stderr = (result.stderr || "").trim();
440
+ return {
441
+ available: true,
442
+ canRun: false,
443
+ reason: `${agent} CLI found but --version check failed (exit ${result.status}): ${stderr.substring(0, 200)}`,
444
+ };
445
+ }
446
+ }
447
+ catch (err) {
448
+ return {
449
+ available: true,
450
+ canRun: false,
451
+ reason: `${agent} CLI found but validation failed: ${err instanceof Error ? err.message : String(err)}`,
452
+ };
453
+ }
404
454
  return {
405
455
  available: true,
406
456
  canRun: true,
@@ -410,7 +460,7 @@ export async function canAgentRun(agent) {
410
460
  * Get list of available agents
411
461
  */
412
462
  export async function getAvailableAgents() {
413
- const agents = ["claude", "codex", "gemini", "vibe"];
463
+ const agents = ["claude", "codex", "gemini", "vibe", "goose"];
414
464
  const available = [];
415
465
  for (const agent of agents) {
416
466
  if (await isAgentAvailable(agent)) {
@@ -423,7 +473,7 @@ export async function getAvailableAgents() {
423
473
  * Get detailed status of all agents
424
474
  */
425
475
  export async function getAgentStatus() {
426
- const agents = ["claude", "codex", "gemini", "vibe"];
476
+ const agents = ["claude", "codex", "gemini", "vibe", "goose"];
427
477
  const status = {};
428
478
  for (const agent of agents) {
429
479
  status[agent] = await canAgentRun(agent);
@@ -1 +1 @@
1
- {"version":3,"file":"agent-spawner.js","sourceRoot":"","sources":["../src/agent-spawner.ts"],"names":[],"mappings":"AACA,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAEL,kBAAkB,EAClB,WAAW,EACX,gBAAgB,GAGjB,MAAM,eAAe,CAAC;AAiBvB,qEAAqE;AACrE,MAAM,aAAa,GAA8B,IAAI,GAAG,EAAE,CAAC;AAE3D,SAAS,UAAU,CAAC,KAAmB;IACrC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,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GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE;SACxG,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,IAAI;KACb,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB;IACtC,MAAM,MAAM,GAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAgB,EAAE,CAAC;IAElC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,MAAM,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;YAClC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc;IAGlC,MAAM,MAAM,GAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAC3E,MAAM,MAAM,GAGR,EAAS,CAAC;IAEd,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,WAAW,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,24 @@
1
+ export interface ContextEntry {
2
+ id: string;
3
+ topic: string;
4
+ content: string;
5
+ agent: string;
6
+ timestamp: string;
7
+ tags: string[];
8
+ }
9
+ export declare class ContextStore {
10
+ private readonly contextDir;
11
+ constructor(projectPath: string);
12
+ private ensureContextDir;
13
+ private getEntryPath;
14
+ private readAllEntries;
15
+ write(topic: string, content: string, agent: string, tags?: string[]): ContextEntry;
16
+ query(topic: string, limit?: number): ContextEntry[];
17
+ list(): Array<{
18
+ topic: string;
19
+ count: number;
20
+ lastUpdated: string;
21
+ }>;
22
+ delete(id: string): boolean;
23
+ }
24
+ //# sourceMappingURL=context-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-store.d.ts","sourceRoot":"","sources":["../src/context-store.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,qBAAa,YAAY;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;gBAExB,WAAW,EAAE,MAAM;IAK/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,cAAc;IAqCtB,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,YAAY;IAkBvF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,YAAY,EAAE;IAoBxD,IAAI,IAAI,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC;IAuBpE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;CAY5B"}
@@ -0,0 +1,118 @@
1
+ import * as fs from "fs";
2
+ import * as path from "path";
3
+ import { randomUUID } from "crypto";
4
+ export class ContextStore {
5
+ contextDir;
6
+ constructor(projectPath) {
7
+ this.contextDir = path.join(projectPath, ".robot-chat", "context");
8
+ this.ensureContextDir();
9
+ }
10
+ ensureContextDir() {
11
+ if (!fs.existsSync(this.contextDir)) {
12
+ fs.mkdirSync(this.contextDir, { recursive: true });
13
+ }
14
+ }
15
+ getEntryPath(id) {
16
+ return path.join(this.contextDir, `${id}.json`);
17
+ }
18
+ readAllEntries() {
19
+ this.ensureContextDir();
20
+ let files = [];
21
+ try {
22
+ files = fs
23
+ .readdirSync(this.contextDir, { withFileTypes: true })
24
+ .filter((d) => d.isFile() && d.name.endsWith(".json"))
25
+ .map((d) => path.join(this.contextDir, d.name));
26
+ }
27
+ catch {
28
+ return [];
29
+ }
30
+ const entries = [];
31
+ for (const file of files) {
32
+ try {
33
+ const raw = fs.readFileSync(file, "utf-8");
34
+ const data = JSON.parse(raw);
35
+ // Basic shape validation
36
+ if (data &&
37
+ typeof data.id === "string" &&
38
+ typeof data.topic === "string" &&
39
+ typeof data.content === "string" &&
40
+ typeof data.agent === "string" &&
41
+ typeof data.timestamp === "string" &&
42
+ Array.isArray(data.tags)) {
43
+ entries.push(data);
44
+ }
45
+ }
46
+ catch {
47
+ // Skip malformed files
48
+ continue;
49
+ }
50
+ }
51
+ return entries;
52
+ }
53
+ write(topic, content, agent, tags = []) {
54
+ this.ensureContextDir();
55
+ const id = randomUUID();
56
+ const timestamp = new Date().toISOString();
57
+ const entry = {
58
+ id,
59
+ topic,
60
+ content,
61
+ agent,
62
+ timestamp,
63
+ tags: Array.isArray(tags) ? tags : [],
64
+ };
65
+ const filePath = this.getEntryPath(id);
66
+ fs.writeFileSync(filePath, JSON.stringify(entry, null, 2), "utf-8");
67
+ return entry;
68
+ }
69
+ query(topic, limit = 10) {
70
+ const q = (topic || "").toLowerCase();
71
+ if (!q) {
72
+ return [];
73
+ }
74
+ const entries = this.readAllEntries();
75
+ const matches = entries.filter((e) => {
76
+ const inTopic = e.topic.toLowerCase().includes(q);
77
+ const inTags = (e.tags || []).some((t) => t.toLowerCase().includes(q));
78
+ return inTopic || inTags;
79
+ });
80
+ matches.sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
81
+ return matches.slice(0, Math.max(0, limit));
82
+ }
83
+ list() {
84
+ const entries = this.readAllEntries();
85
+ const map = new Map();
86
+ for (const e of entries) {
87
+ const existing = map.get(e.topic);
88
+ if (!existing) {
89
+ map.set(e.topic, { count: 1, lastUpdated: e.timestamp });
90
+ }
91
+ else {
92
+ existing.count += 1;
93
+ if (new Date(e.timestamp).getTime() > new Date(existing.lastUpdated).getTime()) {
94
+ existing.lastUpdated = e.timestamp;
95
+ }
96
+ }
97
+ }
98
+ return Array.from(map.entries()).map(([topic, v]) => ({
99
+ topic,
100
+ count: v.count,
101
+ lastUpdated: v.lastUpdated,
102
+ }));
103
+ }
104
+ delete(id) {
105
+ const filePath = this.getEntryPath(id);
106
+ if (fs.existsSync(filePath)) {
107
+ try {
108
+ fs.unlinkSync(filePath);
109
+ return true;
110
+ }
111
+ catch {
112
+ return false;
113
+ }
114
+ }
115
+ return false;
116
+ }
117
+ }
118
+ //# sourceMappingURL=context-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-store.js","sourceRoot":"","sources":["../src/context-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAWpC,MAAM,OAAO,YAAY;IACN,UAAU,CAAS;IAEpC,YAAY,WAAmB;QAC7B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;QACnE,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAC1B,CAAC;IAEO,gBAAgB;QACtB,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,C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