opencode-swarm-plugin 0.12.9 → 0.12.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.
- package/dist/index.js +27 -8
- package/dist/plugin.js +27 -8
- package/package.json +1 -1
- package/src/swarm.ts +30 -8
package/dist/index.js
CHANGED
|
@@ -24166,19 +24166,31 @@ var STRATEGIES = {
|
|
|
24166
24166
|
"research",
|
|
24167
24167
|
"investigate",
|
|
24168
24168
|
"explore",
|
|
24169
|
-
"find",
|
|
24169
|
+
"find out",
|
|
24170
24170
|
"discover",
|
|
24171
24171
|
"understand",
|
|
24172
|
-
"learn",
|
|
24172
|
+
"learn about",
|
|
24173
24173
|
"analyze",
|
|
24174
|
-
"what",
|
|
24175
|
-
"
|
|
24176
|
-
"
|
|
24174
|
+
"what is",
|
|
24175
|
+
"what are",
|
|
24176
|
+
"how does",
|
|
24177
|
+
"how do",
|
|
24178
|
+
"why does",
|
|
24179
|
+
"why do",
|
|
24177
24180
|
"compare",
|
|
24178
24181
|
"evaluate",
|
|
24179
24182
|
"study",
|
|
24180
24183
|
"look up",
|
|
24181
|
-
"
|
|
24184
|
+
"look into",
|
|
24185
|
+
"search for",
|
|
24186
|
+
"dig into",
|
|
24187
|
+
"figure out",
|
|
24188
|
+
"debug options",
|
|
24189
|
+
"debug levers",
|
|
24190
|
+
"configuration options",
|
|
24191
|
+
"environment variables",
|
|
24192
|
+
"available options",
|
|
24193
|
+
"documentation"
|
|
24182
24194
|
],
|
|
24183
24195
|
guidelines: [
|
|
24184
24196
|
"Split by information source (PDFs, repos, history, web)",
|
|
@@ -24212,8 +24224,15 @@ function selectStrategy(task) {
|
|
|
24212
24224
|
for (const [strategyName, definition] of Object.entries(STRATEGIES)) {
|
|
24213
24225
|
const name = strategyName;
|
|
24214
24226
|
for (const keyword of definition.keywords) {
|
|
24215
|
-
if (
|
|
24216
|
-
|
|
24227
|
+
if (keyword.includes(" ")) {
|
|
24228
|
+
if (taskLower.includes(keyword)) {
|
|
24229
|
+
scores[name] += 1;
|
|
24230
|
+
}
|
|
24231
|
+
} else {
|
|
24232
|
+
const regex = new RegExp(`\\b${keyword}\\b`, "i");
|
|
24233
|
+
if (regex.test(taskLower)) {
|
|
24234
|
+
scores[name] += 1;
|
|
24235
|
+
}
|
|
24217
24236
|
}
|
|
24218
24237
|
}
|
|
24219
24238
|
}
|
package/dist/plugin.js
CHANGED
|
@@ -24124,19 +24124,31 @@ var STRATEGIES = {
|
|
|
24124
24124
|
"research",
|
|
24125
24125
|
"investigate",
|
|
24126
24126
|
"explore",
|
|
24127
|
-
"find",
|
|
24127
|
+
"find out",
|
|
24128
24128
|
"discover",
|
|
24129
24129
|
"understand",
|
|
24130
|
-
"learn",
|
|
24130
|
+
"learn about",
|
|
24131
24131
|
"analyze",
|
|
24132
|
-
"what",
|
|
24133
|
-
"
|
|
24134
|
-
"
|
|
24132
|
+
"what is",
|
|
24133
|
+
"what are",
|
|
24134
|
+
"how does",
|
|
24135
|
+
"how do",
|
|
24136
|
+
"why does",
|
|
24137
|
+
"why do",
|
|
24135
24138
|
"compare",
|
|
24136
24139
|
"evaluate",
|
|
24137
24140
|
"study",
|
|
24138
24141
|
"look up",
|
|
24139
|
-
"
|
|
24142
|
+
"look into",
|
|
24143
|
+
"search for",
|
|
24144
|
+
"dig into",
|
|
24145
|
+
"figure out",
|
|
24146
|
+
"debug options",
|
|
24147
|
+
"debug levers",
|
|
24148
|
+
"configuration options",
|
|
24149
|
+
"environment variables",
|
|
24150
|
+
"available options",
|
|
24151
|
+
"documentation"
|
|
24140
24152
|
],
|
|
24141
24153
|
guidelines: [
|
|
24142
24154
|
"Split by information source (PDFs, repos, history, web)",
|
|
@@ -24170,8 +24182,15 @@ function selectStrategy(task) {
|
|
|
24170
24182
|
for (const [strategyName, definition] of Object.entries(STRATEGIES)) {
|
|
24171
24183
|
const name = strategyName;
|
|
24172
24184
|
for (const keyword of definition.keywords) {
|
|
24173
|
-
if (
|
|
24174
|
-
|
|
24185
|
+
if (keyword.includes(" ")) {
|
|
24186
|
+
if (taskLower.includes(keyword)) {
|
|
24187
|
+
scores[name] += 1;
|
|
24188
|
+
}
|
|
24189
|
+
} else {
|
|
24190
|
+
const regex = new RegExp(`\\b${keyword}\\b`, "i");
|
|
24191
|
+
if (regex.test(taskLower)) {
|
|
24192
|
+
scores[name] += 1;
|
|
24193
|
+
}
|
|
24175
24194
|
}
|
|
24176
24195
|
}
|
|
24177
24196
|
}
|
package/package.json
CHANGED
package/src/swarm.ts
CHANGED
|
@@ -344,19 +344,31 @@ export const STRATEGIES: Record<
|
|
|
344
344
|
"research",
|
|
345
345
|
"investigate",
|
|
346
346
|
"explore",
|
|
347
|
-
"find",
|
|
347
|
+
"find out",
|
|
348
348
|
"discover",
|
|
349
349
|
"understand",
|
|
350
|
-
"learn",
|
|
350
|
+
"learn about",
|
|
351
351
|
"analyze",
|
|
352
|
-
"what",
|
|
353
|
-
"
|
|
354
|
-
"
|
|
352
|
+
"what is",
|
|
353
|
+
"what are",
|
|
354
|
+
"how does",
|
|
355
|
+
"how do",
|
|
356
|
+
"why does",
|
|
357
|
+
"why do",
|
|
355
358
|
"compare",
|
|
356
359
|
"evaluate",
|
|
357
360
|
"study",
|
|
358
361
|
"look up",
|
|
359
|
-
"
|
|
362
|
+
"look into",
|
|
363
|
+
"search for",
|
|
364
|
+
"dig into",
|
|
365
|
+
"figure out",
|
|
366
|
+
"debug options",
|
|
367
|
+
"debug levers",
|
|
368
|
+
"configuration options",
|
|
369
|
+
"environment variables",
|
|
370
|
+
"available options",
|
|
371
|
+
"documentation",
|
|
360
372
|
],
|
|
361
373
|
guidelines: [
|
|
362
374
|
"Split by information source (PDFs, repos, history, web)",
|
|
@@ -408,8 +420,18 @@ export function selectStrategy(task: string): {
|
|
|
408
420
|
for (const [strategyName, definition] of Object.entries(STRATEGIES)) {
|
|
409
421
|
const name = strategyName as Exclude<DecompositionStrategy, "auto">;
|
|
410
422
|
for (const keyword of definition.keywords) {
|
|
411
|
-
|
|
412
|
-
|
|
423
|
+
// Use word boundary matching to avoid "debug" matching "bug"
|
|
424
|
+
// For multi-word keywords, just check includes (they're specific enough)
|
|
425
|
+
if (keyword.includes(" ")) {
|
|
426
|
+
if (taskLower.includes(keyword)) {
|
|
427
|
+
scores[name] += 1;
|
|
428
|
+
}
|
|
429
|
+
} else {
|
|
430
|
+
// Single word: use word boundary regex
|
|
431
|
+
const regex = new RegExp(`\\b${keyword}\\b`, "i");
|
|
432
|
+
if (regex.test(taskLower)) {
|
|
433
|
+
scores[name] += 1;
|
|
434
|
+
}
|
|
413
435
|
}
|
|
414
436
|
}
|
|
415
437
|
}
|