maskweaver 0.9.4 → 0.9.5

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 (227) hide show
  1. package/dist/cli/doctor.js +5 -21
  2. package/dist/cli/install.d.ts +0 -8
  3. package/dist/cli/install.js +0 -39
  4. package/dist/context/config.d.ts +0 -22
  5. package/dist/context/config.js +0 -28
  6. package/dist/context/feature.d.ts +0 -39
  7. package/dist/context/feature.js +0 -77
  8. package/dist/context/files.d.ts +0 -13
  9. package/dist/context/files.js +1 -24
  10. package/dist/context/index.d.ts +0 -7
  11. package/dist/context/index.js +0 -12
  12. package/dist/context/project.d.ts +0 -21
  13. package/dist/context/project.js +0 -30
  14. package/dist/context/types.d.ts +0 -48
  15. package/dist/context/types.js +0 -12
  16. package/dist/context/utils.d.ts +0 -18
  17. package/dist/context/utils.js +0 -27
  18. package/dist/core/engine/promptBuilder.d.ts +0 -17
  19. package/dist/core/engine/promptBuilder.js +0 -28
  20. package/dist/core/index.d.ts +0 -6
  21. package/dist/core/index.js +0 -9
  22. package/dist/core/loader/MaskLoader.d.ts +0 -23
  23. package/dist/core/loader/MaskLoader.js +0 -29
  24. package/dist/core/schema/types.d.ts +0 -47
  25. package/dist/core/schema/types.js +0 -6
  26. package/dist/core/schema/validator.d.ts +0 -14
  27. package/dist/core/schema/validator.js +0 -18
  28. package/dist/i18n/index.d.ts +0 -18
  29. package/dist/i18n/index.js +4 -23
  30. package/dist/index.d.ts +0 -8
  31. package/dist/index.js +0 -8
  32. package/dist/lib.d.ts +0 -5
  33. package/dist/lib.js +0 -12
  34. package/dist/memory/chunking.d.ts +0 -22
  35. package/dist/memory/chunking.js +2 -37
  36. package/dist/memory/core.d.ts +0 -29
  37. package/dist/memory/core.js +1 -52
  38. package/dist/memory/index.d.ts +0 -5
  39. package/dist/memory/index.js +0 -10
  40. package/dist/memory/indexer.d.ts +0 -21
  41. package/dist/memory/indexer.js +0 -44
  42. package/dist/memory/providers/examples.d.ts +0 -5
  43. package/dist/memory/providers/examples.js +4 -64
  44. package/dist/memory/providers/factory.d.ts +0 -44
  45. package/dist/memory/providers/factory.js +0 -46
  46. package/dist/memory/providers/index.d.ts +0 -26
  47. package/dist/memory/providers/index.js +0 -28
  48. package/dist/memory/providers/ollama.d.ts +0 -6
  49. package/dist/memory/providers/ollama.js +1 -8
  50. package/dist/memory/providers/openai.d.ts +0 -6
  51. package/dist/memory/providers/openai.js +1 -8
  52. package/dist/memory/providers/openrouter.d.ts +0 -6
  53. package/dist/memory/providers/openrouter.js +0 -8
  54. package/dist/memory/providers/text-only.d.ts +0 -13
  55. package/dist/memory/providers/text-only.js +0 -17
  56. package/dist/memory/providers/types.d.ts +0 -39
  57. package/dist/memory/providers/types.js +0 -7
  58. package/dist/memory/providers/voyage.d.ts +0 -22
  59. package/dist/memory/providers/voyage.js +1 -24
  60. package/dist/memory/search/hybrid.d.ts +0 -12
  61. package/dist/memory/search/hybrid.js +1 -22
  62. package/dist/memory/store/sqlite.d.ts +0 -72
  63. package/dist/memory/store/sqlite.js +4 -127
  64. package/dist/plugin/config/index.d.ts +0 -112
  65. package/dist/plugin/config/index.js +0 -115
  66. package/dist/plugin/index.d.ts +0 -13
  67. package/dist/plugin/index.js +1 -123
  68. package/dist/plugin/tools/command-registry.d.ts +0 -6
  69. package/dist/plugin/tools/command-registry.js +0 -14
  70. package/dist/plugin/tools/context.d.ts +0 -12
  71. package/dist/plugin/tools/context.js +0 -58
  72. package/dist/plugin/tools/maskSave.d.ts +0 -3
  73. package/dist/plugin/tools/maskSave.js +0 -3
  74. package/dist/plugin/tools/memoryGet.d.ts +0 -3
  75. package/dist/plugin/tools/memoryGet.js +0 -3
  76. package/dist/plugin/tools/memoryIndexer.d.ts +0 -3
  77. package/dist/plugin/tools/memoryIndexer.js +0 -10
  78. package/dist/plugin/tools/memorySearch.d.ts +0 -31
  79. package/dist/plugin/tools/memorySearch.js +0 -79
  80. package/dist/plugin/tools/memoryWrite.d.ts +0 -8
  81. package/dist/plugin/tools/memoryWrite.js +0 -32
  82. package/dist/plugin/tools/retrospect.d.ts +0 -3
  83. package/dist/plugin/tools/retrospect.js +0 -3
  84. package/dist/plugin/tools/slashcommand.d.ts +0 -11
  85. package/dist/plugin/tools/slashcommand.js +0 -38
  86. package/dist/plugin/tools/squad.d.ts +0 -12
  87. package/dist/plugin/tools/squad.js +11 -83
  88. package/dist/plugin/tools/weave.d.ts +0 -6
  89. package/dist/plugin/tools/weave.js +0 -78
  90. package/dist/plugin/types.d.ts +0 -20
  91. package/dist/plugin/types.js +0 -7
  92. package/dist/retrospect/index.d.ts +0 -7
  93. package/dist/retrospect/index.js +0 -9
  94. package/dist/retrospect/mask-save.d.ts +0 -12
  95. package/dist/retrospect/mask-save.js +1 -80
  96. package/dist/retrospect/retrospect.d.ts +0 -18
  97. package/dist/retrospect/retrospect.js +0 -63
  98. package/dist/retrospect/strategies/base.d.ts +0 -15
  99. package/dist/retrospect/strategies/base.js +0 -7
  100. package/dist/retrospect/strategies/deep.d.ts +0 -12
  101. package/dist/retrospect/strategies/deep.js +0 -24
  102. package/dist/retrospect/strategies/index.d.ts +0 -12
  103. package/dist/retrospect/strategies/index.js +0 -12
  104. package/dist/retrospect/strategies/quick.d.ts +0 -12
  105. package/dist/retrospect/strategies/quick.js +0 -19
  106. package/dist/retrospect/strategies/standard.d.ts +0 -12
  107. package/dist/retrospect/strategies/standard.js +0 -15
  108. package/dist/retrospect/types.d.ts +0 -7
  109. package/dist/retrospect/types.js +0 -7
  110. package/dist/shared/config.d.ts +0 -105
  111. package/dist/shared/config.js +0 -33
  112. package/dist/shared/errors.d.ts +0 -18
  113. package/dist/shared/errors.js +0 -19
  114. package/dist/shared/generate-agents.d.ts +0 -69
  115. package/dist/shared/generate-agents.js +2 -86
  116. package/dist/shared/image.d.ts +0 -67
  117. package/dist/shared/image.js +6 -104
  118. package/dist/shared/index.d.ts +0 -5
  119. package/dist/shared/index.js +0 -7
  120. package/dist/shared/model-registry.d.ts +0 -72
  121. package/dist/shared/model-registry.js +5 -95
  122. package/dist/shared/types.d.ts +0 -15
  123. package/dist/shared/types.js +0 -3
  124. package/dist/shared-context/dag.d.ts +0 -105
  125. package/dist/shared-context/dag.js +3 -114
  126. package/dist/shared-context/index.d.ts +0 -5
  127. package/dist/shared-context/index.js +0 -15
  128. package/dist/shared-context/logger.d.ts +0 -37
  129. package/dist/shared-context/logger.js +0 -41
  130. package/dist/shared-context/parallel-executor.d.ts +0 -54
  131. package/dist/shared-context/parallel-executor.js +4 -56
  132. package/dist/shared-context/session.d.ts +0 -56
  133. package/dist/shared-context/session.js +0 -47
  134. package/dist/shared-context/squad.d.ts +0 -68
  135. package/dist/shared-context/squad.js +0 -63
  136. package/dist/shared-context/storage.d.ts +0 -132
  137. package/dist/shared-context/storage.js +0 -116
  138. package/dist/shared-context/task.d.ts +0 -120
  139. package/dist/shared-context/task.js +0 -152
  140. package/dist/shared-context/test/dag.test.js +9 -14
  141. package/dist/shared-context/test/logger.test.d.ts +0 -8
  142. package/dist/shared-context/test/logger.test.js +0 -52
  143. package/dist/shared-context/test/session.test.d.ts +0 -7
  144. package/dist/shared-context/test/session.test.js +0 -63
  145. package/dist/shared-context/test/squad.test.d.ts +0 -10
  146. package/dist/shared-context/test/squad.test.js +2 -68
  147. package/dist/shared-context/test/storage.test.d.ts +0 -8
  148. package/dist/shared-context/test/storage.test.js +0 -68
  149. package/dist/shared-context/test/task.test.d.ts +0 -7
  150. package/dist/shared-context/test/task.test.js +0 -54
  151. package/dist/shared-context/test/watchdog.test.d.ts +0 -7
  152. package/dist/shared-context/test/watchdog.test.js +3 -58
  153. package/dist/shared-context/types.d.ts +0 -215
  154. package/dist/shared-context/types.js +0 -125
  155. package/dist/shared-context/watchdog.d.ts +0 -127
  156. package/dist/shared-context/watchdog.js +0 -148
  157. package/dist/shared-context/worktree.d.ts +0 -68
  158. package/dist/shared-context/worktree.js +2 -34
  159. package/dist/verify/budget.d.ts +0 -29
  160. package/dist/verify/budget.js +0 -34
  161. package/dist/verify/critical-files.d.ts +0 -17
  162. package/dist/verify/critical-files.js +0 -37
  163. package/dist/verify/escalation.d.ts +0 -20
  164. package/dist/verify/escalation.js +0 -22
  165. package/dist/verify/index.d.ts +0 -5
  166. package/dist/verify/index.js +0 -11
  167. package/dist/verify/prompts.d.ts +0 -20
  168. package/dist/verify/prompts.js +0 -20
  169. package/dist/verify/types.d.ts +0 -26
  170. package/dist/verify/types.js +1 -12
  171. package/dist/verify/verifier.d.ts +0 -29
  172. package/dist/verify/verifier.js +0 -54
  173. package/dist/version.d.ts +1 -16
  174. package/dist/version.js +1 -16
  175. package/dist/weave/bridge.d.ts +0 -35
  176. package/dist/weave/bridge.js +0 -51
  177. package/dist/weave/environment/detector.d.ts +0 -6
  178. package/dist/weave/environment/detector.js +4 -45
  179. package/dist/weave/environment/index.d.ts +0 -19
  180. package/dist/weave/environment/index.js +1 -39
  181. package/dist/weave/environment/issues.d.ts +0 -35
  182. package/dist/weave/environment/issues.js +0 -59
  183. package/dist/weave/git.d.ts +0 -8
  184. package/dist/weave/git.js +0 -8
  185. package/dist/weave/index.d.ts +0 -13
  186. package/dist/weave/index.js +2 -28
  187. package/dist/weave/knowledge/global.d.ts +0 -39
  188. package/dist/weave/knowledge/global.js +2 -78
  189. package/dist/weave/loop.js +0 -3
  190. package/dist/weave/orchestrator.d.ts +0 -69
  191. package/dist/weave/orchestrator.js +1 -101
  192. package/dist/weave/phase-manager.d.ts +0 -64
  193. package/dist/weave/phase-manager.js +0 -89
  194. package/dist/weave/security/secret-scan.d.ts +0 -14
  195. package/dist/weave/security/secret-scan.js +0 -19
  196. package/dist/weave/stages/build.js +0 -15
  197. package/dist/weave/stages/execute.d.ts +0 -42
  198. package/dist/weave/stages/execute.js +4 -86
  199. package/dist/weave/stages/handoff.d.ts +0 -7
  200. package/dist/weave/stages/handoff.js +0 -43
  201. package/dist/weave/stages/index.d.ts +0 -3
  202. package/dist/weave/stages/index.js +0 -3
  203. package/dist/weave/stages/intake.d.ts +0 -8
  204. package/dist/weave/stages/intake.js +5 -65
  205. package/dist/weave/stages/map.d.ts +0 -1
  206. package/dist/weave/stages/openspec.d.ts +0 -1
  207. package/dist/weave/stages/plan.d.ts +0 -11
  208. package/dist/weave/stages/plan.js +1 -53
  209. package/dist/weave/stages/refine.d.ts +0 -7
  210. package/dist/weave/stages/refine.js +0 -7
  211. package/dist/weave/stages/research.d.ts +0 -6
  212. package/dist/weave/stages/research.js +0 -6
  213. package/dist/weave/stages/spec.d.ts +0 -12
  214. package/dist/weave/stages/spec.js +0 -17
  215. package/dist/weave/types.d.ts +0 -20
  216. package/dist/weave/types.js +0 -5
  217. package/dist/weave/verification/commands.d.ts +0 -12
  218. package/dist/weave/verification/commands.js +0 -19
  219. package/dist/weave/verification/index.d.ts +0 -6
  220. package/dist/weave/verification/index.js +1 -19
  221. package/dist/weave/verification/playwright.d.ts +0 -47
  222. package/dist/weave/verification/playwright.js +1 -90
  223. package/dist/weave/worktree.d.ts +0 -16
  224. package/dist/weave/worktree.js +0 -23
  225. package/dist/weave/yaml-repair.d.ts +0 -39
  226. package/dist/weave/yaml-repair.js +13 -116
  227. package/package.json +1 -1
@@ -1,24 +1,9 @@
1
- /**
2
- * Slashcommand Tool for OpenCode Plugin
3
- *
4
- * Handles slash commands directly as a tool, inspired by oh-my-opencode.
5
- * This ensures commands work on first run without requiring restart.
6
- *
7
- * Pattern: Commands are discovered from:
8
- * 1. Built-in embedded commands (always available)
9
- * 2. Package assets/commands/ folder
10
- * 3. Project .opencode/commands/ folder (overrides)
11
- */
12
1
  import { z } from 'zod';
13
- // Inline shim: tool() is just an identity function in @opencode-ai/plugin
14
2
  const tool = (input) => input;
15
3
  import * as fs from 'node:fs';
16
4
  import * as path from 'node:path';
17
5
  import { parse as parseYaml } from 'yaml';
18
6
  import { loadCommandsJson } from './command-registry.js';
19
- // ============================================================================
20
- // Built-in Commands from Registry (commands.json)
21
- // ============================================================================
22
7
  function getBuiltinCommandsFromRegistry() {
23
8
  const registry = loadCommandsJson();
24
9
  const builtins = {};
@@ -40,9 +25,6 @@ function getBuiltinCommandsFromRegistry() {
40
25
  }
41
26
  return builtins;
42
27
  }
43
- // ============================================================================
44
- // Command Discovery
45
- // ============================================================================
46
28
  function parseFrontmatter(content) {
47
29
  const parts = content.split('---');
48
30
  if (parts.length < 3) {
@@ -93,17 +75,14 @@ function discoverCommandsFromDir(commandsDir, scope) {
93
75
  }
94
76
  function getAllCommands(assetsDir, projectDir) {
95
77
  const BUILTIN_COMMANDS = getBuiltinCommandsFromRegistry();
96
- // Start with builtin commands
97
78
  const commands = Object.entries(BUILTIN_COMMANDS).map(([name, cmd]) => ({
98
79
  name,
99
80
  metadata: cmd.metadata,
100
81
  content: cmd.content,
101
82
  scope: 'builtin',
102
83
  }));
103
- // Load from package assets
104
84
  if (assetsDir) {
105
85
  const packageCommands = discoverCommandsFromDir(path.join(assetsDir, 'commands'), 'package');
106
- // Package commands override builtins
107
86
  for (const cmd of packageCommands) {
108
87
  const existingIndex = commands.findIndex(c => c.name === cmd.name);
109
88
  if (existingIndex >= 0) {
@@ -114,7 +93,6 @@ function getAllCommands(assetsDir, projectDir) {
114
93
  }
115
94
  }
116
95
  }
117
- // Load from project .opencode/commands (highest priority)
118
96
  const projectCommands = discoverCommandsFromDir(path.join(projectDir, '.opencode', 'commands'), 'project');
119
97
  for (const cmd of projectCommands) {
120
98
  const existingIndex = commands.findIndex(c => c.name === cmd.name);
@@ -127,9 +105,6 @@ function getAllCommands(assetsDir, projectDir) {
127
105
  }
128
106
  return commands;
129
107
  }
130
- // ============================================================================
131
- // Tool Factory
132
- // ============================================================================
133
108
  export function createSlashcommandTool(assetsDir) {
134
109
  const registry = loadCommandsJson();
135
110
  const descLines = ['Execute a slash command. Available commands include:'];
@@ -138,7 +113,6 @@ export function createSlashcommandTool(assetsDir) {
138
113
  }
139
114
  descLines.push('');
140
115
  descLines.push('Use command="list" to see all available commands.');
141
- // Build dynamic shorthand list from registry
142
116
  const shorthandSet = new Set();
143
117
  for (const cmd of registry.commands) {
144
118
  shorthandSet.add(cmd.name);
@@ -156,9 +130,7 @@ export function createSlashcommandTool(assetsDir) {
156
130
  },
157
131
  execute: async (args, context) => {
158
132
  const projectDir = context.worktree;
159
- // Discover all commands (builtin + package + project)
160
133
  const commands = getAllCommands(assetsDir, projectDir);
161
- // Handle "list" command
162
134
  if (args.command === 'list' || !args.command) {
163
135
  const lines = ['# Available Slash Commands\n'];
164
136
  for (const cmd of commands) {
@@ -168,41 +140,31 @@ export function createSlashcommandTool(assetsDir) {
168
140
  lines.push(`\n**Total**: ${commands.length} commands`);
169
141
  return lines.join('\n');
170
142
  }
171
- // Normalize command name (remove leading /)
172
143
  let cmdName = args.command.replace(/^\//, '').toLowerCase();
173
- // Handle "weave" command with optional subcommand
174
- // e.g., "weave status" -> "weave-status"
175
- // e.g., "status" (alone) -> might mean "weave-status"
176
144
  if (cmdName.startsWith('weave ')) {
177
- // "weave design" -> "weave-design"
178
145
  cmdName = cmdName.replace(' ', '-');
179
146
  }
180
147
  else if (cmdName === 'weave') {
181
- // Just "weave" -> "weave-help"
182
148
  const helpCmd = commands.find(c => c.name === 'weave-help');
183
149
  if (helpCmd) {
184
150
  return helpCmd.content || 'Weave help content not available.';
185
151
  }
186
152
  }
187
153
  else if (shorthandList.includes(cmdName)) {
188
- // Shorthand: "status" -> "weave-status"
189
154
  const weaveCmd = commands.find(c => c.name === `weave-${cmdName}`);
190
155
  if (weaveCmd) {
191
156
  return weaveCmd.content || `weave-${cmdName} content not available.`;
192
157
  }
193
158
  }
194
- // Find exact match
195
159
  const exactMatch = commands.find(c => c.name.toLowerCase() === cmdName);
196
160
  if (exactMatch) {
197
161
  return exactMatch.content || `/${exactMatch.name} has no content.`;
198
162
  }
199
- // Find partial matches
200
163
  const partialMatches = commands.filter(c => c.name.toLowerCase().includes(cmdName));
201
164
  if (partialMatches.length > 0) {
202
165
  const matchList = partialMatches.map(c => `/${c.name}`).join(', ');
203
166
  return `No exact match for "/${cmdName}". Did you mean: ${matchList}?`;
204
167
  }
205
- // No match found
206
168
  const available = commands.slice(0, 10).map(c => `/${c.name}`).join(', ');
207
169
  return `Command "/${cmdName}" not found. Available: ${available}...`;
208
170
  },
@@ -1,15 +1,3 @@
1
- /**
2
- * Squad Management Tool
3
- *
4
- * Multi-agent collaboration session and squad management
5
- *
6
- * Design Principles:
7
- * - Intention-Revealing Code
8
- * - Clear error messages
9
- * - Consistent JSON response format (following context.ts pattern)
10
- *
11
- * @author Martin Fowler's Dummy Human
12
- */
13
1
  import { z } from "zod";
14
2
  import type { ToolFactory } from '../types.js';
15
3
  export declare const squadSchema: z.ZodObject<{
@@ -1,39 +1,22 @@
1
- /**
2
- * Squad Management Tool
3
- *
4
- * Multi-agent collaboration session and squad management
5
- *
6
- * Design Principles:
7
- * - Intention-Revealing Code
8
- * - Clear error messages
9
- * - Consistent JSON response format (following context.ts pattern)
10
- *
11
- * @author Martin Fowler's Dummy Human
12
- */
13
1
  import { z } from "zod";
14
2
  import * as shared from '../../shared-context/index.js';
15
3
  import { join } from "path";
16
4
  import { getModelRegistry } from '../../shared/model-registry.js';
17
- // ============================================================================
18
- // Schema Definition
19
- // ============================================================================
20
5
  export const squadSchema = z.object({
21
6
  action: z.enum([
22
- "start", // Start new session (goal required)
23
- "squad", // Create squad (mission required)
24
- "assign", // Assign task (squadId, description, assignee required)
25
- "update", // Update task (squadId, taskId, status required)
26
- "complete", // Complete task (squadId, taskId, result required)
27
- "status", // View session/squad status
28
- "watchdog", // Run watchdog (dryRun optional)
29
- "list", // List all squads
30
- "plan", // Analyze task dependencies and create parallel execution plan
31
- "models" // Query available models and their concurrency status
7
+ "start",
8
+ "squad",
9
+ "assign",
10
+ "update",
11
+ "complete",
12
+ "status",
13
+ "watchdog",
14
+ "list",
15
+ "plan",
16
+ "models"
32
17
  ]).describe("Action to execute"),
33
- // start action params
34
18
  goal: z.string().optional().describe("Session goal (for start action)"),
35
19
  createdBy: z.string().optional().describe("Agent ID creating the session"),
36
- // squad action params
37
20
  mission: z.string().optional().describe("Squad mission (for squad action)"),
38
21
  operator: z.string().optional().describe("Squad operator agent ID"),
39
22
  scope: z.object({
@@ -45,25 +28,21 @@ export const squadSchema = z.object({
45
28
  tokenBudget: z.number().optional(),
46
29
  maxWorkers: z.number().optional(),
47
30
  }).optional().describe("Squad resource constraints"),
48
- // assign action params
49
31
  squadId: z.string().optional().describe("Target squad ID"),
50
32
  assignee: z.string().optional().describe("Agent to assign task to"),
51
33
  description: z.string().optional().describe("Task description"),
52
34
  priority: z.enum(["low", "medium", "high", "critical"]).optional()
53
35
  .describe("Task priority"),
54
- // update action params
55
36
  taskId: z.string().optional().describe("Task ID to update"),
56
37
  status: z.enum(["pending", "active", "paused", "completed", "failed"]).optional()
57
38
  .describe("New task status"),
58
39
  startedAt: z.string().optional().describe("Task start timestamp"),
59
- // complete action params
60
40
  success: z.boolean().optional().describe("Whether task succeeded"),
61
41
  output: z.unknown().optional().describe("Task output data"),
62
42
  error: z.object({
63
43
  code: z.string(),
64
44
  message: z.string(),
65
45
  }).optional().describe("Task error info"),
66
- // watchdog action params
67
46
  dryRun: z.boolean().optional().describe("Run watchdog without side effects"),
68
47
  });
69
48
  function createResponse(success, action, message, data) {
@@ -79,9 +58,6 @@ function successResponse(action, message, data) {
79
58
  function errorResponse(action, message) {
80
59
  return createResponse(false, action, message);
81
60
  }
82
- // ============================================================================
83
- // Active Session Management
84
- // ============================================================================
85
61
  const ACTIVE_SESSION_FILE = "shared/active.json";
86
62
  async function getActiveSessionId(basePath) {
87
63
  const storage = new shared.FileStorageAdapter(join(basePath, ".opencode"));
@@ -104,12 +80,6 @@ async function loadActiveSession(basePath) {
104
80
  const storage = new shared.FileStorageAdapter(join(basePath, ".opencode"));
105
81
  return shared.loadSession(storage, sessionId);
106
82
  }
107
- // ============================================================================
108
- // Tool Factory
109
- // ============================================================================
110
- /**
111
- * Analyze task dependencies and create parallel execution plan
112
- */
113
83
  async function handlePlan(basePath, squadId) {
114
84
  if (!squadId || squadId.trim().length === 0) {
115
85
  return errorResponse("plan", 'Squad ID is required. Example: squadId="squad-abc123"');
@@ -138,7 +108,7 @@ async function handlePlan(basePath, squadId) {
138
108
  criticalPath: plan.dag.criticalPath,
139
109
  hasCycle: plan.dag.hasCycle,
140
110
  waves: plan.waves,
141
- rawOutput: planOutput, // Include a raw string for easier display
111
+ rawOutput: planOutput,
142
112
  });
143
113
  }
144
114
  catch (error) {
@@ -224,14 +194,6 @@ Direct use of assign/update/complete by primary agent pollutes strategic context
224
194
  }
225
195
  };
226
196
  }
227
- // ============================================================================
228
- // Action Handlers
229
- // ============================================================================
230
- /**
231
- * Start a new collaboration session
232
- *
233
- * Creates a session and sets it as the active session.
234
- */
235
197
  async function handleStart(basePath, goal, createdBy) {
236
198
  if (!goal || goal.trim().length === 0) {
237
199
  return errorResponse("start", 'Session goal (goal) is required. Example: goal="Implement OAuth login"');
@@ -242,7 +204,6 @@ async function handleStart(basePath, goal, createdBy) {
242
204
  goal,
243
205
  createdBy: agentId,
244
206
  });
245
- // Set as active session
246
207
  await setActiveSession(basePath, session.manifest.sessionId, goal);
247
208
  return successResponse("start", `Session started: ${goal}`, {
248
209
  sessionId: session.manifest.sessionId,
@@ -252,9 +213,6 @@ async function handleStart(basePath, goal, createdBy) {
252
213
  basePath: session.sessionPath,
253
214
  });
254
215
  }
255
- /**
256
- * Create a new squad within the active session
257
- */
258
216
  async function handleSquad(basePath, mission, operator, scope, constraints) {
259
217
  if (!mission || mission.trim().length === 0) {
260
218
  return errorResponse("squad", 'Squad mission is required. Example: mission="Implement user authentication"');
@@ -282,9 +240,6 @@ async function handleSquad(basePath, mission, operator, scope, constraints) {
282
240
  createdAt: spec.createdAt,
283
241
  });
284
242
  }
285
- /**
286
- * Assign a task to an agent within a squad
287
- */
288
243
  async function handleAssign(basePath, squadId, assignee, description, priority) {
289
244
  if (!squadId || squadId.trim().length === 0) {
290
245
  return errorResponse("assign", 'Squad ID is required. Example: squadId="squad-abc123"');
@@ -313,9 +268,6 @@ async function handleAssign(basePath, squadId, assignee, description, priority)
313
268
  createdAt: task.createdAt,
314
269
  });
315
270
  }
316
- /**
317
- * Update a task's status
318
- */
319
271
  async function handleUpdate(basePath, squadId, taskId, status, startedAt) {
320
272
  if (!squadId || squadId.trim().length === 0) {
321
273
  return errorResponse("update", 'Squad ID is required. Example: squadId="squad-abc123"');
@@ -343,9 +295,6 @@ async function handleUpdate(basePath, squadId, taskId, status, startedAt) {
343
295
  startedAt: updatedTask.startedAt,
344
296
  });
345
297
  }
346
- /**
347
- * Complete a task with result
348
- */
349
298
  async function handleComplete(basePath, squadId, taskId, success, output, error) {
350
299
  if (!squadId || squadId.trim().length === 0) {
351
300
  return errorResponse("complete", 'Squad ID is required. Example: squadId="squad-abc123"');
@@ -360,7 +309,6 @@ async function handleComplete(basePath, squadId, taskId, success, output, error)
360
309
  if (!session) {
361
310
  return errorResponse("complete", 'No active session. Start a session first with action="start"');
362
311
  }
363
- // Build TaskResult
364
312
  const result = success
365
313
  ? { success: true, output }
366
314
  : { success: false, error: error ?? { code: "UNKNOWN", message: "Task failed" } };
@@ -373,9 +321,6 @@ async function handleComplete(basePath, squadId, taskId, success, output, error)
373
321
  result: completedTask.result,
374
322
  });
375
323
  }
376
- /**
377
- * View session or squad status
378
- */
379
324
  async function handleStatus(basePath, squadId) {
380
325
  const session = await loadActiveSession(basePath);
381
326
  if (!session) {
@@ -383,7 +328,6 @@ async function handleStatus(basePath, squadId) {
383
328
  hasActiveSession: false,
384
329
  });
385
330
  }
386
- // If squadId provided, show squad details
387
331
  if (squadId && squadId.trim().length > 0) {
388
332
  const squad = await shared.getSquad(session, squadId);
389
333
  if (!squad) {
@@ -409,7 +353,6 @@ async function handleStatus(basePath, squadId) {
409
353
  updatedAt: squad.state.updatedAt,
410
354
  });
411
355
  }
412
- // Show session overview
413
356
  const squads = [];
414
357
  for (const sid of session.manifest.squads) {
415
358
  const squad = await shared.getSquad(session, sid);
@@ -431,9 +374,6 @@ async function handleStatus(basePath, squadId) {
431
374
  squads,
432
375
  });
433
376
  }
434
- /**
435
- * Run watchdog to detect stuck squads/tasks
436
- */
437
377
  async function handleWatchdog(basePath, dryRun) {
438
378
  const session = await loadActiveSession(basePath);
439
379
  if (!session) {
@@ -455,9 +395,6 @@ async function handleWatchdog(basePath, dryRun) {
455
395
  dryRun: dryRun ?? false,
456
396
  });
457
397
  }
458
- /**
459
- * List all squads in the active session
460
- */
461
398
  async function handleList(basePath) {
462
399
  const session = await loadActiveSession(basePath);
463
400
  if (!session) {
@@ -482,7 +419,6 @@ async function handleList(basePath) {
482
419
  });
483
420
  }
484
421
  }
485
- // Group by status
486
422
  const counts = {
487
423
  pending: squads.filter(s => s.status === "pending").length,
488
424
  active: squads.filter(s => s.status === "active").length,
@@ -497,13 +433,6 @@ async function handleList(basePath) {
497
433
  squads,
498
434
  });
499
435
  }
500
- // ============================================================================
501
- // Models Handler - Query model pool status
502
- // ============================================================================
503
- /**
504
- * Show available models and their concurrency status.
505
- * Used by Squad Operator to make informed assignee decisions.
506
- */
507
436
  async function handleModels() {
508
437
  try {
509
438
  const registry = getModelRegistry();
@@ -521,7 +450,6 @@ async function handleModels() {
521
450
  available: m.available,
522
451
  description: m.entry.description || '',
523
452
  }));
524
- // Group by tier
525
453
  const byTier = {};
526
454
  for (const m of modelDetails) {
527
455
  (byTier[m.tier] ??= []).push(m);
@@ -1,9 +1,3 @@
1
- /**
2
- * Weave Tool for OpenCode Plugin
3
- *
4
- * Integrates Weave workflow into OpenCode as a tool.
5
- * Commands: design, craft, status
6
- */
7
1
  import { z } from 'zod';
8
2
  export declare function createWeaveTool(): {
9
3
  description: string;