@pellux/goodvibes-sdk 0.33.20 → 0.33.22

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 (65) hide show
  1. package/dist/browser-knowledge.d.ts +49 -0
  2. package/dist/browser-knowledge.d.ts.map +1 -1
  3. package/dist/browser-knowledge.js +22 -0
  4. package/dist/contracts/artifacts/operator-contract.json +4615 -4
  5. package/dist/events/agents.d.ts +11 -0
  6. package/dist/events/agents.d.ts.map +1 -1
  7. package/dist/events/index.d.ts +1 -1
  8. package/dist/events/index.d.ts.map +1 -1
  9. package/dist/events/planner.d.ts +69 -1
  10. package/dist/events/planner.d.ts.map +1 -1
  11. package/dist/platform/agents/wrfc-controller.d.ts +19 -0
  12. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  13. package/dist/platform/agents/wrfc-controller.js +286 -22
  14. package/dist/platform/agents/wrfc-reporting.d.ts.map +1 -1
  15. package/dist/platform/agents/wrfc-reporting.js +5 -1
  16. package/dist/platform/agents/wrfc-types.d.ts +1 -1
  17. package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
  18. package/dist/platform/control-plane/method-catalog-knowledge.d.ts.map +1 -1
  19. package/dist/platform/control-plane/method-catalog-knowledge.js +154 -1
  20. package/dist/platform/control-plane/operator-contract-schemas-project-planning.d.ts +4 -0
  21. package/dist/platform/control-plane/operator-contract-schemas-project-planning.d.ts.map +1 -1
  22. package/dist/platform/control-plane/operator-contract-schemas-project-planning.js +78 -0
  23. package/dist/platform/core/orchestrator-turn-helpers.d.ts.map +1 -1
  24. package/dist/platform/core/orchestrator-turn-helpers.js +27 -11
  25. package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
  26. package/dist/platform/core/orchestrator-turn-loop.js +4 -1
  27. package/dist/platform/core/wrfc-routing.d.ts +5 -0
  28. package/dist/platform/core/wrfc-routing.d.ts.map +1 -0
  29. package/dist/platform/core/wrfc-routing.js +51 -0
  30. package/dist/platform/daemon/http/project-planning-routes.d.ts.map +1 -1
  31. package/dist/platform/daemon/http/project-planning-routes.js +67 -0
  32. package/dist/platform/knowledge/index.d.ts +1 -1
  33. package/dist/platform/knowledge/index.d.ts.map +1 -1
  34. package/dist/platform/knowledge/project-planning/helpers.d.ts +1 -1
  35. package/dist/platform/knowledge/project-planning/helpers.d.ts.map +1 -1
  36. package/dist/platform/knowledge/project-planning/helpers.js +4 -0
  37. package/dist/platform/knowledge/project-planning/index.d.ts +1 -1
  38. package/dist/platform/knowledge/project-planning/index.d.ts.map +1 -1
  39. package/dist/platform/knowledge/project-planning/service.d.ts +21 -1
  40. package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
  41. package/dist/platform/knowledge/project-planning/service.js +502 -1
  42. package/dist/platform/knowledge/project-planning/types.d.ts +140 -0
  43. package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
  44. package/dist/platform/runtime/emitters/agents.d.ts +11 -0
  45. package/dist/platform/runtime/emitters/agents.d.ts.map +1 -1
  46. package/dist/platform/runtime/emitters/planner.d.ts +22 -0
  47. package/dist/platform/runtime/emitters/planner.d.ts.map +1 -1
  48. package/dist/platform/runtime/emitters/planner.js +15 -0
  49. package/dist/platform/runtime/events/index.d.ts +1 -1
  50. package/dist/platform/runtime/events/index.d.ts.map +1 -1
  51. package/dist/platform/runtime/services.d.ts.map +1 -1
  52. package/dist/platform/runtime/services.js +2 -0
  53. package/dist/platform/runtime/store/domains/agents.d.ts +3 -1
  54. package/dist/platform/runtime/store/domains/agents.d.ts.map +1 -1
  55. package/dist/platform/runtime/store/helpers/reducers/lifecycle.d.ts.map +1 -1
  56. package/dist/platform/runtime/store/helpers/reducers/lifecycle.js +25 -6
  57. package/dist/platform/tools/agent/index.d.ts.map +1 -1
  58. package/dist/platform/tools/agent/index.js +131 -64
  59. package/dist/platform/tools/agent/manager.d.ts +1 -0
  60. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  61. package/dist/platform/tools/agent/manager.js +36 -7
  62. package/dist/platform/tools/agent/schema.d.ts.map +1 -1
  63. package/dist/platform/tools/agent/schema.js +7 -6
  64. package/dist/platform/version.js +1 -1
  65. package/package.json +9 -9
@@ -5,7 +5,7 @@ import { AGENT_TEMPLATES, AgentManager } from './manager.js';
5
5
  import { evaluateOrchestrationSpawn } from '../../runtime/orchestration/spawn-policy.js';
6
6
  import { summarizeError } from '../../utils/error-display.js';
7
7
  import { toRecord } from '../../utils/record-coerce.js';
8
- import { evaluateWrfcBatchPolicy, isRootReviewRoleTask } from './wrfc-batch-policy.js';
8
+ import { evaluateWrfcBatchPolicy } from './wrfc-batch-policy.js';
9
9
  export { AGENT_TEMPLATES, AgentManager } from './manager.js';
10
10
  // ---------------------------------------------------------------------------
11
11
  // Tool implementation
@@ -24,6 +24,90 @@ function summarizeWrfcEvent(event) {
24
24
  issueCount: Array.isArray(event.issues) ? event.issues.length : undefined,
25
25
  };
26
26
  }
27
+ function agentTopology(record) {
28
+ return {
29
+ parentAgentId: record.parentAgentId ?? null,
30
+ wrfcId: record.wrfcId ?? null,
31
+ wrfcRole: record.wrfcRole ?? null,
32
+ wrfcPhaseOrder: record.wrfcPhaseOrder ?? null,
33
+ wrfcRouteReason: record.wrfcRouteReason ?? null,
34
+ orchestrationGraphId: record.orchestrationGraphId ?? null,
35
+ orchestrationNodeId: record.orchestrationNodeId ?? null,
36
+ parentNodeId: record.parentNodeId ?? null,
37
+ };
38
+ }
39
+ function agentOrchestrationControl(record) {
40
+ const authoritativeWrfcChain = record.wrfcRole === 'owner' && typeof record.wrfcId === 'string' && record.wrfcId.length > 0;
41
+ return {
42
+ authoritativeWrfcChain,
43
+ continueRootSpawning: authoritativeWrfcChain ? false : true,
44
+ rootSpawnContinuation: authoritativeWrfcChain ? 'stop' : 'allowed',
45
+ orchestrationStopSignal: authoritativeWrfcChain ? 'wrfc_owner_chain_started' : null,
46
+ orchestrationInstruction: authoritativeWrfcChain
47
+ ? 'This WRFC owner chain is authoritative for the deliverable. Do not spawn additional root review/test/verification/fix agents for the same work.'
48
+ : null,
49
+ };
50
+ }
51
+ function agentExecutionContract(record) {
52
+ return {
53
+ executionIntent: record.executionIntent ?? null,
54
+ tools: record.tools,
55
+ capabilityCeilingTools: record.capabilityCeilingTools ?? record.tools,
56
+ successCriteria: record.successCriteria ?? [],
57
+ requiredEvidence: record.requiredEvidence ?? [],
58
+ writeScope: record.writeScope ?? [],
59
+ executionProtocol: record.executionProtocol,
60
+ reviewMode: record.reviewMode,
61
+ communicationLane: record.communicationLane,
62
+ knowledgeInjections: record.knowledgeInjections ?? [],
63
+ };
64
+ }
65
+ function agentSummary(record) {
66
+ return {
67
+ id: record.id,
68
+ task: record.task,
69
+ template: record.template,
70
+ status: record.status,
71
+ startedAt: record.startedAt,
72
+ toolCallCount: record.toolCallCount,
73
+ cohort: record.cohort,
74
+ progress: record.progress,
75
+ ...agentTopology(record),
76
+ };
77
+ }
78
+ function agentSpawnSummary(record) {
79
+ return {
80
+ ...agentSummary(record),
81
+ ...agentOrchestrationControl(record),
82
+ };
83
+ }
84
+ function batchTaskToSpawnInput(input, taskDef) {
85
+ return {
86
+ mode: 'spawn',
87
+ task: taskDef.task,
88
+ template: taskDef.template ?? input.template ?? 'general',
89
+ model: taskDef.model ?? input.model,
90
+ provider: taskDef.provider ?? input.provider,
91
+ fallbackModels: taskDef.fallbackModels ?? input.fallbackModels,
92
+ routing: taskDef.routing ?? input.routing,
93
+ reasoningEffort: taskDef.reasoningEffort ?? input.reasoningEffort,
94
+ tools: taskDef.tools ?? input.tools,
95
+ restrictTools: taskDef.restrictTools ?? input.restrictTools,
96
+ context: taskDef.context ?? input.context,
97
+ successCriteria: taskDef.successCriteria ?? input.successCriteria,
98
+ requiredEvidence: taskDef.requiredEvidence ?? input.requiredEvidence,
99
+ writeScope: taskDef.writeScope ?? input.writeScope,
100
+ executionProtocol: taskDef.executionProtocol ?? input.executionProtocol,
101
+ reviewMode: taskDef.reviewMode ?? input.reviewMode,
102
+ communicationLane: taskDef.communicationLane ?? input.communicationLane,
103
+ parentAgentId: taskDef.parentAgentId ?? input.parentAgentId,
104
+ orchestrationGraphId: taskDef.orchestrationGraphId ?? input.orchestrationGraphId,
105
+ orchestrationNodeId: taskDef.orchestrationNodeId,
106
+ parentNodeId: taskDef.parentNodeId ?? input.parentNodeId,
107
+ dangerously_disable_wrfc: taskDef.dangerously_disable_wrfc ?? input.dangerously_disable_wrfc,
108
+ cohort: input.cohort,
109
+ };
110
+ }
27
111
  export function createAgentTool(config) {
28
112
  const archetypeLoader = config.archetypeLoader ?? new ArchetypeLoader();
29
113
  return {
@@ -50,12 +134,6 @@ export function createAgentTool(config) {
50
134
  if (!input.task || typeof input.task !== 'string' || input.task.trim() === '') {
51
135
  return { success: false, error: 'Missing required parameter for spawn: task' };
52
136
  }
53
- if (!input.parentAgentId && input.dangerously_disable_wrfc && isRootReviewRoleTask({ task: input.task, template: input.template })) {
54
- return {
55
- success: false,
56
- error: 'Root reviewer/tester/verifier agents are not valid independent roots. Start one WRFC owner chain for the deliverable, or spawn genuinely independent sidecar research/implementation tasks.',
57
- };
58
- }
59
137
  if (input.template && !AGENT_TEMPLATES[input.template]) {
60
138
  // Also allow custom archetypes loaded from .goodvibes/agents/*.md
61
139
  const customArchetype = archetypeLoader.loadArchetype(input.template);
@@ -85,17 +163,9 @@ export function createAgentTool(config) {
85
163
  status: 'spawned',
86
164
  template: record.template,
87
165
  task: record.task,
88
- executionIntent: record.executionIntent ?? null,
89
- tools: record.tools,
90
- capabilityCeilingTools: record.capabilityCeilingTools ?? record.tools,
91
- successCriteria: record.successCriteria ?? [],
92
- requiredEvidence: record.requiredEvidence ?? [],
93
- writeScope: record.writeScope ?? [],
94
- executionProtocol: record.executionProtocol,
95
- reviewMode: record.reviewMode,
96
- communicationLane: record.communicationLane,
97
- knowledgeInjections: record.knowledgeInjections ?? [],
98
- parentAgentId: record.parentAgentId ?? null,
166
+ ...agentExecutionContract(record),
167
+ ...agentTopology(record),
168
+ ...agentOrchestrationControl(record),
99
169
  }),
100
170
  };
101
171
  }
@@ -121,6 +191,7 @@ export function createAgentTool(config) {
121
191
  toolCallCount: record.toolCallCount,
122
192
  progress: record.progress,
123
193
  error: record.error,
194
+ ...agentTopology(record),
124
195
  }),
125
196
  };
126
197
  }
@@ -149,15 +220,7 @@ export function createAgentTool(config) {
149
220
  return {
150
221
  success: true,
151
222
  output: JSON.stringify({
152
- agents: records.map((r) => ({
153
- id: r.id,
154
- task: r.task,
155
- template: r.template,
156
- status: r.status,
157
- startedAt: r.startedAt,
158
- toolCallCount: r.toolCallCount,
159
- cohort: r.cohort,
160
- })),
223
+ agents: records.map(agentSummary),
161
224
  count: records.length,
162
225
  ...(input.cohort ? { cohort: input.cohort } : {}),
163
226
  }),
@@ -203,9 +266,7 @@ export function createAgentTool(config) {
203
266
  executionProtocol: record.executionProtocol,
204
267
  reviewMode: record.reviewMode,
205
268
  communicationLane: record.communicationLane,
206
- parentAgentId: record.parentAgentId ?? null,
207
- orchestrationGraphId: record.orchestrationGraphId ?? null,
208
- orchestrationNodeId: record.orchestrationNodeId ?? null,
269
+ ...agentTopology(record),
209
270
  };
210
271
  const contract = {
211
272
  tools: record.tools,
@@ -381,6 +442,42 @@ export function createAgentTool(config) {
381
442
  if (input.tasks.length > 20) {
382
443
  return { success: false, error: 'batch-spawn limited to 20 tasks per batch.' };
383
444
  }
445
+ if (input.tasks.length === 1) {
446
+ const taskDef = input.tasks[0];
447
+ if (!taskDef.task || typeof taskDef.task !== 'string' || taskDef.task.trim() === '') {
448
+ return { success: false, error: 'Each task in batch-spawn must have a non-empty task string.' };
449
+ }
450
+ if (taskDef.template && !AGENT_TEMPLATES[taskDef.template]) {
451
+ const customArchetype = archetypeLoader.loadArchetype(taskDef.template);
452
+ if (!customArchetype || customArchetype.isCustom === false) {
453
+ return {
454
+ success: false,
455
+ error: `Unknown template: '${taskDef.template}'. Available: ${Object.keys(AGENT_TEMPLATES).join(', ')}`,
456
+ };
457
+ }
458
+ }
459
+ let record;
460
+ try {
461
+ record = manager.spawn(batchTaskToSpawnInput(input, taskDef));
462
+ }
463
+ catch (error) {
464
+ return {
465
+ success: false,
466
+ error: summarizeError(error),
467
+ };
468
+ }
469
+ return {
470
+ success: true,
471
+ output: JSON.stringify({
472
+ agents: [{ ...agentSpawnSummary(record), task: record.task.slice(0, 80) }],
473
+ count: 1,
474
+ cohort: input.cohort,
475
+ skipped: 0,
476
+ normalizedToSpawn: true,
477
+ ...agentOrchestrationControl(record),
478
+ }),
479
+ };
480
+ }
384
481
  const batchPolicy = evaluateWrfcBatchPolicy(input);
385
482
  if (batchPolicy.kind === 'collapse-to-wrfc') {
386
483
  let record;
@@ -396,14 +493,7 @@ export function createAgentTool(config) {
396
493
  return {
397
494
  success: true,
398
495
  output: JSON.stringify({
399
- agents: [{
400
- id: record.id,
401
- task: record.task.slice(0, 80),
402
- template: record.template,
403
- cohort: record.cohort,
404
- wrfcId: record.wrfcId ?? null,
405
- wrfcRole: record.wrfcRole ?? null,
406
- }],
496
+ agents: [{ ...agentSpawnSummary(record), task: record.task.slice(0, 80) }],
407
497
  count: 1,
408
498
  cohort: input.cohort,
409
499
  skipped: 0,
@@ -411,6 +501,7 @@ export function createAgentTool(config) {
411
501
  collapsedTaskCount: input.tasks.length,
412
502
  reason: batchPolicy.reason,
413
503
  roleTaskIndexes: batchPolicy.roleTaskIndexes ?? [],
504
+ ...agentOrchestrationControl(record),
414
505
  }),
415
506
  };
416
507
  }
@@ -444,31 +535,7 @@ export function createAgentTool(config) {
444
535
  };
445
536
  }
446
537
  }
447
- const spawnInput = {
448
- mode: 'spawn',
449
- task: taskDef.task,
450
- template: taskDef.template ?? input.template ?? 'general',
451
- model: taskDef.model ?? input.model,
452
- provider: taskDef.provider ?? input.provider,
453
- fallbackModels: taskDef.fallbackModels ?? input.fallbackModels,
454
- routing: taskDef.routing ?? input.routing,
455
- reasoningEffort: taskDef.reasoningEffort ?? input.reasoningEffort,
456
- tools: taskDef.tools ?? input.tools,
457
- restrictTools: taskDef.restrictTools ?? input.restrictTools,
458
- context: taskDef.context ?? input.context,
459
- successCriteria: taskDef.successCriteria ?? input.successCriteria,
460
- requiredEvidence: taskDef.requiredEvidence ?? input.requiredEvidence,
461
- writeScope: taskDef.writeScope ?? input.writeScope,
462
- executionProtocol: taskDef.executionProtocol ?? input.executionProtocol,
463
- reviewMode: taskDef.reviewMode ?? input.reviewMode,
464
- communicationLane: taskDef.communicationLane ?? input.communicationLane,
465
- parentAgentId: taskDef.parentAgentId ?? input.parentAgentId,
466
- orchestrationGraphId: taskDef.orchestrationGraphId ?? input.orchestrationGraphId,
467
- orchestrationNodeId: taskDef.orchestrationNodeId,
468
- parentNodeId: taskDef.parentNodeId ?? input.parentNodeId,
469
- dangerously_disable_wrfc: taskDef.dangerously_disable_wrfc ?? input.dangerously_disable_wrfc,
470
- cohort: input.cohort,
471
- };
538
+ const spawnInput = batchTaskToSpawnInput(input, taskDef);
472
539
  let record;
473
540
  try {
474
541
  record = manager.spawn(spawnInput);
@@ -479,7 +546,7 @@ export function createAgentTool(config) {
479
546
  error: summarizeError(error),
480
547
  };
481
548
  }
482
- results.push({ id: record.id, task: taskDef.task.slice(0, 80), template: record.template, cohort: record.cohort });
549
+ results.push({ ...agentSpawnSummary(record), task: taskDef.task.slice(0, 80) });
483
550
  }
484
551
  return {
485
552
  success: true,
@@ -52,6 +52,7 @@ export interface AgentRecord {
52
52
  streamingContent?: string | undefined;
53
53
  wrfcId?: string | undefined;
54
54
  wrfcRole?: WrfcAgentRole | undefined;
55
+ wrfcPhaseOrder?: number | undefined;
55
56
  wrfcRouteReason?: string | undefined;
56
57
  dangerously_disable_wrfc?: boolean | undefined;
57
58
  cohort?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../../src/platform/tools/agent/manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6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eAAe,CAAyC;IACzE,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyC;IACpE,OAAO,CAAC,cAAc,CAA6C;IACnE,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoC;gBAEtD,IAAI,GAAE,wBAA6B;IAQ/C,aAAa,CAAC,UAAU,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI;IAIvD,OAAO,CAAC,oBAAoB;IAkC5B,KAAK,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW;IAmSrC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAIzC,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAkC3B,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE;IAI3C,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE;IAkB5C,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE;IAQtC,IAAI,IAAI,WAAW,EAAE;IAIrB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,EAAE;IAI3C,KAAK,IAAI,IAAI;IAKb,WAAW,IAAI,WAAW,EAAE;IAU5B,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI;IAOzC,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAAG,IAAI;IAIjD,iBAAiB,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,GAAG,IAAI,GAAG,IAAI;CAGpF"}
@@ -91,16 +91,33 @@ export class AgentManager {
91
91
  };
92
92
  }
93
93
  spawn(input) {
94
- const task = input.task;
94
+ let task = input.task;
95
95
  if (!task || typeof task !== 'string' || task.trim() === '') {
96
96
  throw new Error('spawn() requires a non-empty task string');
97
97
  }
98
98
  if (!this.configManager) {
99
99
  throw new Error('AgentManager requires configManager');
100
100
  }
101
- const template = input.template ?? 'general';
102
- if (!input.parentAgentId && input.dangerously_disable_wrfc && isRootReviewRoleTask({ task, template })) {
103
- throw new Error('Root reviewer/tester/verifier agents are not valid independent roots. Start one WRFC owner chain for the deliverable, or spawn genuinely independent sidecar research/implementation tasks.');
101
+ let template = input.template ?? 'general';
102
+ let wrfcRouteReason;
103
+ if (!input.parentAgentId && isRootReviewRoleTask({ task, template })) {
104
+ wrfcRouteReason = 'root-review-role-normalized';
105
+ input = {
106
+ ...input,
107
+ template: 'engineer',
108
+ reviewMode: 'wrfc',
109
+ dangerously_disable_wrfc: false,
110
+ context: [
111
+ input.context?.trim(),
112
+ 'SDK WRFC topology enforcement normalized this root review/test/verification task into a single owner chain. Review, test, verification, and fix work are lifecycle phases owned by the WRFC controller, not independent root agents.',
113
+ ].filter((part) => Boolean(part)).join('\n\n'),
114
+ successCriteria: [
115
+ ...(input.successCriteria ?? []),
116
+ 'Keep the work as one WRFC owner chain; review, test, verification, and fix phases must remain lifecycle children.',
117
+ ],
118
+ };
119
+ task = input.task ?? task;
120
+ template = input.template ?? 'engineer';
104
121
  }
105
122
  const archetype = this.archetypeLoader.loadArchetype(template);
106
123
  const templateDef = AGENT_TEMPLATES[template] ?? AGENT_TEMPLATES.general;
@@ -219,6 +236,7 @@ export class AgentManager {
219
236
  } : {}),
220
237
  ...(input.parentAgentId ? { parentAgentId: input.parentAgentId } : {}),
221
238
  ...(parentNodeId ? { parentNodeId } : {}),
239
+ ...(wrfcRouteReason ? { wrfcRouteReason } : {}),
222
240
  ...(toolResolution.capabilityCeilingTools ? { capabilityCeilingTools: toolResolution.capabilityCeilingTools } : {}),
223
241
  ...(input.successCriteria ? { successCriteria: [...input.successCriteria] } : {}),
224
242
  ...(input.requiredEvidence ? { requiredEvidence: [...input.requiredEvidence] } : {}),
@@ -307,7 +325,7 @@ export class AgentManager {
307
325
  this.wrfcController?.createChain(record);
308
326
  if (record.wrfcRole === 'owner') {
309
327
  record.status = 'running';
310
- record.progress = 'WRFC owner supervising child agents';
328
+ record.progress ??= 'WRFC owner supervising child agents';
311
329
  if (this.runtimeBus) {
312
330
  const ctx = {
313
331
  sessionId: 'agent-manager',
@@ -315,8 +333,19 @@ export class AgentManager {
315
333
  source: 'agent-manager',
316
334
  agentId: id,
317
335
  };
318
- emitAgentRunning(this.runtimeBus, ctx, { agentId: id });
319
- emitAgentProgress(this.runtimeBus, ctx, { agentId: id, progress: record.progress });
336
+ emitAgentRunning(this.runtimeBus, ctx, {
337
+ agentId: id,
338
+ wrfcId: record.wrfcId,
339
+ wrfcRole: record.wrfcRole,
340
+ wrfcPhaseOrder: record.wrfcPhaseOrder,
341
+ });
342
+ emitAgentProgress(this.runtimeBus, ctx, {
343
+ agentId: id,
344
+ progress: record.progress,
345
+ wrfcId: record.wrfcId,
346
+ wrfcRole: record.wrfcRole,
347
+ wrfcPhaseOrder: record.wrfcPhaseOrder,
348
+ });
320
349
  }
321
350
  return record;
322
351
  }
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/platform/tools/agent/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,cA2O/B,CAAC;AAEF,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;IAC7E,qBAAqB,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAAC;IACjE,cAAc,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;CAChD;AAED,sCAAsC;AACtC,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,GAAG,aAAa,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAA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,SAAS,CAAC;QAC5F,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACnC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1C,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACzC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,wBAAwB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;KAChD,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;IAElE,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,IAAI,CAAC,EAAE,WAAW,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;IAExH,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B"}
@@ -18,7 +18,8 @@ export const AGENT_TOOL_SCHEMA = {
18
18
  'wrfc-history (detailed event history for a specific WRFC chain — reviews, scores, issues, gates), ' +
19
19
  'cohort-status (JSON summary of all agents in a named cohort), ' +
20
20
  'cohort-report (markdown table report for all agents in a named cohort).' +
21
- ' Discovery: use mode=list to see all agents and their status, mode=templates to see available agent templates.',
21
+ ' Discovery: use mode=list to see all agents and their status, mode=templates to see available agent templates. ' +
22
+ 'If the user asks for WRFC, agent review, reviewed implementation, review/fix cycles, or test/verify work for one deliverable, call this tool with mode=spawn, template=engineer, reviewMode=wrfc; do not answer by describing WRFC in prose.',
22
23
  sideEffects: ['agent', 'workflow', 'state'],
23
24
  concurrency: 'serial',
24
25
  supportsProgress: true,
@@ -34,7 +35,7 @@ export const AGENT_TOOL_SCHEMA = {
34
35
  // mode: spawn
35
36
  task: {
36
37
  type: 'string',
37
- description: 'Task description for the agent to execute (mode: spawn).',
38
+ description: 'Task description for the agent to execute (mode: spawn). For a user request that asks for WRFC/review/test/verify of one deliverable, describe the implementation deliverable itself and use reviewMode=wrfc; do not spawn reviewer/tester roots.',
38
39
  },
39
40
  template: {
40
41
  type: 'string',
@@ -119,7 +120,7 @@ export const AGENT_TOOL_SCHEMA = {
119
120
  reviewMode: {
120
121
  type: 'string',
121
122
  enum: ['none', 'wrfc'],
122
- description: 'Review loop requirement for the spawned agent (mode: spawn). Default: wrfc unless explicitly disabled.',
123
+ description: 'Review loop requirement for the spawned agent (mode: spawn). Default: wrfc unless explicitly disabled. Use wrfc for any requested WRFC, review/fix cycle, reviewed implementation, test, or verification flow for a single deliverable.',
123
124
  },
124
125
  communicationLane: {
125
126
  type: 'string',
@@ -151,7 +152,7 @@ export const AGENT_TOOL_SCHEMA = {
151
152
  },
152
153
  dangerously_disable_wrfc: {
153
154
  type: 'boolean',
154
- description: 'If true, skip the WRFC review chain for this agent (mode: spawn). Default: false.',
155
+ description: 'If true, skip the WRFC review chain for ordinary implementation/research agents (mode: spawn). Root reviewer/tester/verifier tasks are still normalized into one WRFC owner chain.',
155
156
  default: false,
156
157
  },
157
158
  // mode: batch-spawn
@@ -191,10 +192,10 @@ export const AGENT_TOOL_SCHEMA = {
191
192
  orchestrationGraphId: { type: 'string', description: 'Graph id to attach the worker to.' },
192
193
  orchestrationNodeId: { type: 'string', description: 'Explicit node id for the worker.' },
193
194
  parentNodeId: { type: 'string', description: 'Parent node id for the worker.' },
194
- dangerously_disable_wrfc: { type: 'boolean', description: 'Skip WRFC review.' },
195
+ dangerously_disable_wrfc: { type: 'boolean', description: 'Skip WRFC review for ordinary implementation/research agents. Root review/test/verify role phases are still normalized into WRFC ownership.' },
195
196
  },
196
197
  },
197
- description: 'Array of genuinely independent tasks to spawn as agents (mode: batch-spawn). Max 20. Do not place tester/reviewer/verifier role phases here for one deliverable; those are WRFC lifecycle children owned by one owner chain.',
198
+ description: 'Array of genuinely independent tasks to spawn as agents (mode: batch-spawn). Max 20. One-task batches are normalized through spawn. Do not place tester/reviewer/verifier role phases here for one deliverable; those are WRFC lifecycle children owned by one owner chain.',
198
199
  },
199
200
  // mode: spawn, batch-spawn, list, cohort-status, cohort-report
200
201
  cohort: {
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- let version = '0.33.20';
3
+ let version = '0.33.22';
4
4
  try {
5
5
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
6
6
  version = pkg.version ?? version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-sdk",
3
- "version": "0.33.20",
3
+ "version": "0.33.22",
4
4
  "description": "TypeScript SDK for building GoodVibes operator, peer, web, mobile, and daemon-connected apps with typed contracts, auth, realtime events, and transport layers.",
5
5
  "keywords": [
6
6
  "goodvibes",
@@ -449,14 +449,14 @@
449
449
  "sideEffects": false,
450
450
  "type": "module",
451
451
  "dependencies": {
452
- "@pellux/goodvibes-contracts": "0.33.20",
453
- "@pellux/goodvibes-daemon-sdk": "0.33.20",
454
- "@pellux/goodvibes-errors": "0.33.20",
455
- "@pellux/goodvibes-operator-sdk": "0.33.20",
456
- "@pellux/goodvibes-peer-sdk": "0.33.20",
457
- "@pellux/goodvibes-transport-core": "0.33.20",
458
- "@pellux/goodvibes-transport-http": "0.33.20",
459
- "@pellux/goodvibes-transport-realtime": "0.33.20"
452
+ "@pellux/goodvibes-contracts": "0.33.22",
453
+ "@pellux/goodvibes-daemon-sdk": "0.33.22",
454
+ "@pellux/goodvibes-errors": "0.33.22",
455
+ "@pellux/goodvibes-operator-sdk": "0.33.22",
456
+ "@pellux/goodvibes-peer-sdk": "0.33.22",
457
+ "@pellux/goodvibes-transport-core": "0.33.22",
458
+ "@pellux/goodvibes-transport-http": "0.33.22",
459
+ "@pellux/goodvibes-transport-realtime": "0.33.22"
460
460
  },
461
461
  "optionalDependencies": {
462
462
  "@agentclientprotocol/sdk": "^0.21.0",