@synergenius/flow-weaver-pack-weaver 0.9.181 → 0.9.183

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.
@@ -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 from behavior config or defaults
171
+ // Resolve available capabilities: profile pool > behavior config > all defaults
172
172
  const behavior = context.behaviorJson ? JSON.parse(context.behaviorJson) : undefined;
173
- const availableCapNames: string[] = behavior?.capabilities ?? BUILT_IN_CAPABILITIES.map(c => c.name);
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: cheap Haiku call selects which capabilities this task needs
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
- const triageResult = await callCapabilityTriage(pInfo, task.instruction, availableCaps);
179
- if (triageResult) {
180
- selectedCaps = getCapabilitiesByNames(triageResult);
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