@synergenius/flow-weaver-pack-weaver 0.9.180 → 0.9.182
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/bot/capability-registry.d.ts.map +1 -1
- package/dist/bot/capability-registry.js +107 -364
- package/dist/bot/capability-registry.js.map +1 -1
- package/dist/bot/system-prompt.d.ts.map +1 -1
- package/dist/bot/system-prompt.js +1 -8
- package/dist/bot/system-prompt.js.map +1 -1
- package/dist/node-types/plan-task.d.ts.map +1 -1
- package/dist/node-types/plan-task.js +13 -15
- package/dist/node-types/plan-task.js.map +1 -1
- package/dist/ui/capability-editor.js +105 -363
- package/dist/ui/profile-editor.js +105 -363
- package/dist/ui/swarm-dashboard.js +101 -359
- package/flowweaver.manifest.json +1 -1
- package/package.json +1 -1
- package/src/bot/capability-registry.ts +108 -365
- package/src/bot/system-prompt.ts +1 -8
- package/src/node-types/plan-task.ts +13 -15
|
@@ -3,7 +3,7 @@ import { callPlatformWithMessages, callCapabilityTriage } from '../bot/ai-client
|
|
|
3
3
|
import type { AiTool, AiCallResult, ChatMessage } from '../bot/ai-client.js';
|
|
4
4
|
import { auditEmit } from '../bot/audit-logger.js';
|
|
5
5
|
import { executeStep } from '../bot/step-executor.js';
|
|
6
|
-
import { getCapabilitiesByNames, BUILT_IN_CAPABILITIES } from '../bot/capability-registry.js';
|
|
6
|
+
import { getCapabilitiesByNames, BUILT_IN_CAPABILITIES, PROFILE_CAPABILITIES } from '../bot/capability-registry.js';
|
|
7
7
|
|
|
8
8
|
// ---------------------------------------------------------------------------
|
|
9
9
|
// Tool definitions — built dynamically from capability-granted operations
|
|
@@ -168,16 +168,20 @@ export async function weaverPlanTask(
|
|
|
168
168
|
}
|
|
169
169
|
const task = JSON.parse(context.taskJson);
|
|
170
170
|
|
|
171
|
-
// Resolve available capabilities
|
|
171
|
+
// Resolve available capabilities: profile pool > behavior config > all defaults
|
|
172
172
|
const behavior = context.behaviorJson ? JSON.parse(context.behaviorJson) : undefined;
|
|
173
|
-
const
|
|
173
|
+
const profilePool = task.assignedProfile ? PROFILE_CAPABILITIES[task.assignedProfile] : undefined;
|
|
174
|
+
const availableCapNames: string[] = profilePool ?? behavior?.capabilities ?? BUILT_IN_CAPABILITIES.map(c => c.name);
|
|
174
175
|
const availableCaps = getCapabilitiesByNames(availableCapNames);
|
|
175
176
|
|
|
176
|
-
// Capability triage:
|
|
177
|
+
// Capability triage: only run when using the default (all) pool.
|
|
178
|
+
// Profile pools are already scoped — triage would just add latency + cost.
|
|
177
179
|
let selectedCaps = availableCaps;
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
180
|
+
if (!profilePool) {
|
|
181
|
+
const triageResult = await callCapabilityTriage(pInfo, task.instruction, availableCaps);
|
|
182
|
+
if (triageResult) {
|
|
183
|
+
selectedCaps = getCapabilitiesByNames(triageResult);
|
|
184
|
+
}
|
|
181
185
|
}
|
|
182
186
|
|
|
183
187
|
// Build system prompt from capabilities
|
|
@@ -195,20 +199,14 @@ export async function weaverPlanTask(
|
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
// Build tool definitions from capability-granted operations
|
|
198
|
-
// Only orchestrators get task_create — workers must execute, not delegate.
|
|
199
|
-
const isOrchestrator = availableCapNames.includes('role-orchestrator') ||
|
|
200
|
-
availableCapNames.includes('decomposition') ||
|
|
201
|
-
(behavior?.role === 'orchestrator');
|
|
202
202
|
let tools: AiTool[];
|
|
203
203
|
try {
|
|
204
204
|
const mod2 = await import('../bot/system-prompt.js');
|
|
205
|
-
|
|
206
|
-
if (!isOrchestrator) {
|
|
207
|
-
grantedTools = grantedTools.filter((t: string) => t !== 'task_create');
|
|
208
|
-
}
|
|
205
|
+
const grantedTools = mod2.collectToolsFromCapabilities(selectedCaps);
|
|
209
206
|
tools = buildToolDefinitions(grantedTools);
|
|
210
207
|
} catch (err) {
|
|
211
208
|
console.warn('[plan-task] capability resolution failed, using worker defaults:', err);
|
|
209
|
+
// Fallback: worker tools only — NO task_create (that's orchestrator-only)
|
|
212
210
|
tools = buildToolDefinitions(['read_file', 'write_file', 'patch_file', 'run_shell', 'list_files']);
|
|
213
211
|
}
|
|
214
212
|
|