@pellux/goodvibes-sdk 0.33.20 → 0.33.21

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 (55) 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 +18 -0
  12. package/dist/platform/agents/wrfc-controller.d.ts.map +1 -1
  13. package/dist/platform/agents/wrfc-controller.js +237 -13
  14. package/dist/platform/agents/wrfc-types.d.ts +1 -1
  15. package/dist/platform/agents/wrfc-types.d.ts.map +1 -1
  16. package/dist/platform/control-plane/method-catalog-knowledge.d.ts.map +1 -1
  17. package/dist/platform/control-plane/method-catalog-knowledge.js +154 -1
  18. package/dist/platform/control-plane/operator-contract-schemas-project-planning.d.ts +4 -0
  19. package/dist/platform/control-plane/operator-contract-schemas-project-planning.d.ts.map +1 -1
  20. package/dist/platform/control-plane/operator-contract-schemas-project-planning.js +78 -0
  21. package/dist/platform/daemon/http/project-planning-routes.d.ts.map +1 -1
  22. package/dist/platform/daemon/http/project-planning-routes.js +67 -0
  23. package/dist/platform/knowledge/index.d.ts +1 -1
  24. package/dist/platform/knowledge/index.d.ts.map +1 -1
  25. package/dist/platform/knowledge/project-planning/helpers.d.ts +1 -1
  26. package/dist/platform/knowledge/project-planning/helpers.d.ts.map +1 -1
  27. package/dist/platform/knowledge/project-planning/helpers.js +4 -0
  28. package/dist/platform/knowledge/project-planning/index.d.ts +1 -1
  29. package/dist/platform/knowledge/project-planning/index.d.ts.map +1 -1
  30. package/dist/platform/knowledge/project-planning/service.d.ts +21 -1
  31. package/dist/platform/knowledge/project-planning/service.d.ts.map +1 -1
  32. package/dist/platform/knowledge/project-planning/service.js +502 -1
  33. package/dist/platform/knowledge/project-planning/types.d.ts +140 -0
  34. package/dist/platform/knowledge/project-planning/types.d.ts.map +1 -1
  35. package/dist/platform/runtime/emitters/agents.d.ts +11 -0
  36. package/dist/platform/runtime/emitters/agents.d.ts.map +1 -1
  37. package/dist/platform/runtime/emitters/planner.d.ts +22 -0
  38. package/dist/platform/runtime/emitters/planner.d.ts.map +1 -1
  39. package/dist/platform/runtime/emitters/planner.js +15 -0
  40. package/dist/platform/runtime/events/index.d.ts +1 -1
  41. package/dist/platform/runtime/events/index.d.ts.map +1 -1
  42. package/dist/platform/runtime/services.d.ts.map +1 -1
  43. package/dist/platform/runtime/services.js +2 -0
  44. package/dist/platform/runtime/store/domains/agents.d.ts +3 -1
  45. package/dist/platform/runtime/store/domains/agents.d.ts.map +1 -1
  46. package/dist/platform/runtime/store/helpers/reducers/lifecycle.d.ts.map +1 -1
  47. package/dist/platform/runtime/store/helpers/reducers/lifecycle.js +25 -6
  48. package/dist/platform/tools/agent/index.d.ts.map +1 -1
  49. package/dist/platform/tools/agent/index.js +110 -64
  50. package/dist/platform/tools/agent/manager.d.ts +1 -0
  51. package/dist/platform/tools/agent/manager.d.ts.map +1 -1
  52. package/dist/platform/tools/agent/manager.js +33 -7
  53. package/dist/platform/tools/agent/schema.js +3 -3
  54. package/dist/platform/version.js +1 -1
  55. 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,72 @@ 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 agentExecutionContract(record) {
40
+ return {
41
+ executionIntent: record.executionIntent ?? null,
42
+ tools: record.tools,
43
+ capabilityCeilingTools: record.capabilityCeilingTools ?? record.tools,
44
+ successCriteria: record.successCriteria ?? [],
45
+ requiredEvidence: record.requiredEvidence ?? [],
46
+ writeScope: record.writeScope ?? [],
47
+ executionProtocol: record.executionProtocol,
48
+ reviewMode: record.reviewMode,
49
+ communicationLane: record.communicationLane,
50
+ knowledgeInjections: record.knowledgeInjections ?? [],
51
+ };
52
+ }
53
+ function agentSummary(record) {
54
+ return {
55
+ id: record.id,
56
+ task: record.task,
57
+ template: record.template,
58
+ status: record.status,
59
+ startedAt: record.startedAt,
60
+ toolCallCount: record.toolCallCount,
61
+ cohort: record.cohort,
62
+ progress: record.progress,
63
+ ...agentTopology(record),
64
+ };
65
+ }
66
+ function batchTaskToSpawnInput(input, taskDef) {
67
+ return {
68
+ mode: 'spawn',
69
+ task: taskDef.task,
70
+ template: taskDef.template ?? input.template ?? 'general',
71
+ model: taskDef.model ?? input.model,
72
+ provider: taskDef.provider ?? input.provider,
73
+ fallbackModels: taskDef.fallbackModels ?? input.fallbackModels,
74
+ routing: taskDef.routing ?? input.routing,
75
+ reasoningEffort: taskDef.reasoningEffort ?? input.reasoningEffort,
76
+ tools: taskDef.tools ?? input.tools,
77
+ restrictTools: taskDef.restrictTools ?? input.restrictTools,
78
+ context: taskDef.context ?? input.context,
79
+ successCriteria: taskDef.successCriteria ?? input.successCriteria,
80
+ requiredEvidence: taskDef.requiredEvidence ?? input.requiredEvidence,
81
+ writeScope: taskDef.writeScope ?? input.writeScope,
82
+ executionProtocol: taskDef.executionProtocol ?? input.executionProtocol,
83
+ reviewMode: taskDef.reviewMode ?? input.reviewMode,
84
+ communicationLane: taskDef.communicationLane ?? input.communicationLane,
85
+ parentAgentId: taskDef.parentAgentId ?? input.parentAgentId,
86
+ orchestrationGraphId: taskDef.orchestrationGraphId ?? input.orchestrationGraphId,
87
+ orchestrationNodeId: taskDef.orchestrationNodeId,
88
+ parentNodeId: taskDef.parentNodeId ?? input.parentNodeId,
89
+ dangerously_disable_wrfc: taskDef.dangerously_disable_wrfc ?? input.dangerously_disable_wrfc,
90
+ cohort: input.cohort,
91
+ };
92
+ }
27
93
  export function createAgentTool(config) {
28
94
  const archetypeLoader = config.archetypeLoader ?? new ArchetypeLoader();
29
95
  return {
@@ -50,12 +116,6 @@ export function createAgentTool(config) {
50
116
  if (!input.task || typeof input.task !== 'string' || input.task.trim() === '') {
51
117
  return { success: false, error: 'Missing required parameter for spawn: task' };
52
118
  }
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
119
  if (input.template && !AGENT_TEMPLATES[input.template]) {
60
120
  // Also allow custom archetypes loaded from .goodvibes/agents/*.md
61
121
  const customArchetype = archetypeLoader.loadArchetype(input.template);
@@ -85,17 +145,8 @@ export function createAgentTool(config) {
85
145
  status: 'spawned',
86
146
  template: record.template,
87
147
  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,
148
+ ...agentExecutionContract(record),
149
+ ...agentTopology(record),
99
150
  }),
100
151
  };
101
152
  }
@@ -121,6 +172,7 @@ export function createAgentTool(config) {
121
172
  toolCallCount: record.toolCallCount,
122
173
  progress: record.progress,
123
174
  error: record.error,
175
+ ...agentTopology(record),
124
176
  }),
125
177
  };
126
178
  }
@@ -149,15 +201,7 @@ export function createAgentTool(config) {
149
201
  return {
150
202
  success: true,
151
203
  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
- })),
204
+ agents: records.map(agentSummary),
161
205
  count: records.length,
162
206
  ...(input.cohort ? { cohort: input.cohort } : {}),
163
207
  }),
@@ -203,9 +247,7 @@ export function createAgentTool(config) {
203
247
  executionProtocol: record.executionProtocol,
204
248
  reviewMode: record.reviewMode,
205
249
  communicationLane: record.communicationLane,
206
- parentAgentId: record.parentAgentId ?? null,
207
- orchestrationGraphId: record.orchestrationGraphId ?? null,
208
- orchestrationNodeId: record.orchestrationNodeId ?? null,
250
+ ...agentTopology(record),
209
251
  };
210
252
  const contract = {
211
253
  tools: record.tools,
@@ -381,6 +423,41 @@ export function createAgentTool(config) {
381
423
  if (input.tasks.length > 20) {
382
424
  return { success: false, error: 'batch-spawn limited to 20 tasks per batch.' };
383
425
  }
426
+ if (input.tasks.length === 1) {
427
+ const taskDef = input.tasks[0];
428
+ if (!taskDef.task || typeof taskDef.task !== 'string' || taskDef.task.trim() === '') {
429
+ return { success: false, error: 'Each task in batch-spawn must have a non-empty task string.' };
430
+ }
431
+ if (taskDef.template && !AGENT_TEMPLATES[taskDef.template]) {
432
+ const customArchetype = archetypeLoader.loadArchetype(taskDef.template);
433
+ if (!customArchetype || customArchetype.isCustom === false) {
434
+ return {
435
+ success: false,
436
+ error: `Unknown template: '${taskDef.template}'. Available: ${Object.keys(AGENT_TEMPLATES).join(', ')}`,
437
+ };
438
+ }
439
+ }
440
+ let record;
441
+ try {
442
+ record = manager.spawn(batchTaskToSpawnInput(input, taskDef));
443
+ }
444
+ catch (error) {
445
+ return {
446
+ success: false,
447
+ error: summarizeError(error),
448
+ };
449
+ }
450
+ return {
451
+ success: true,
452
+ output: JSON.stringify({
453
+ agents: [{ ...agentSummary(record), task: record.task.slice(0, 80) }],
454
+ count: 1,
455
+ cohort: input.cohort,
456
+ skipped: 0,
457
+ normalizedToSpawn: true,
458
+ }),
459
+ };
460
+ }
384
461
  const batchPolicy = evaluateWrfcBatchPolicy(input);
385
462
  if (batchPolicy.kind === 'collapse-to-wrfc') {
386
463
  let record;
@@ -396,14 +473,7 @@ export function createAgentTool(config) {
396
473
  return {
397
474
  success: true,
398
475
  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
- }],
476
+ agents: [{ ...agentSummary(record), task: record.task.slice(0, 80) }],
407
477
  count: 1,
408
478
  cohort: input.cohort,
409
479
  skipped: 0,
@@ -444,31 +514,7 @@ export function createAgentTool(config) {
444
514
  };
445
515
  }
446
516
  }
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
- };
517
+ const spawnInput = batchTaskToSpawnInput(input, taskDef);
472
518
  let record;
473
519
  try {
474
520
  record = manager.spawn(spawnInput);
@@ -479,7 +525,7 @@ export function createAgentTool(config) {
479
525
  error: summarizeError(error),
480
526
  };
481
527
  }
482
- results.push({ id: record.id, task: taskDef.task.slice(0, 80), template: record.template, cohort: record.cohort });
528
+ results.push({ ...agentSummary(record), task: taskDef.task.slice(0, 80) });
483
529
  }
484
530
  return {
485
531
  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.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,MAAM,CAAkC;IAChD,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,mBAAmB,CAAqB;IAChD,OAAO,CAAC,QAAQ,CAAC,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;IAgSrC,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,31 @@ 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
+ if (!input.parentAgentId && isRootReviewRoleTask({ task, template })) {
103
+ input = {
104
+ ...input,
105
+ template: 'engineer',
106
+ reviewMode: 'wrfc',
107
+ dangerously_disable_wrfc: false,
108
+ context: [
109
+ input.context?.trim(),
110
+ '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.',
111
+ ].filter((part) => Boolean(part)).join('\n\n'),
112
+ successCriteria: [
113
+ ...(input.successCriteria ?? []),
114
+ 'Keep the work as one WRFC owner chain; review, test, verification, and fix phases must remain lifecycle children.',
115
+ ],
116
+ };
117
+ task = input.task ?? task;
118
+ template = input.template ?? 'engineer';
104
119
  }
105
120
  const archetype = this.archetypeLoader.loadArchetype(template);
106
121
  const templateDef = AGENT_TEMPLATES[template] ?? AGENT_TEMPLATES.general;
@@ -307,7 +322,7 @@ export class AgentManager {
307
322
  this.wrfcController?.createChain(record);
308
323
  if (record.wrfcRole === 'owner') {
309
324
  record.status = 'running';
310
- record.progress = 'WRFC owner supervising child agents';
325
+ record.progress ??= 'WRFC owner supervising child agents';
311
326
  if (this.runtimeBus) {
312
327
  const ctx = {
313
328
  sessionId: 'agent-manager',
@@ -315,8 +330,19 @@ export class AgentManager {
315
330
  source: 'agent-manager',
316
331
  agentId: id,
317
332
  };
318
- emitAgentRunning(this.runtimeBus, ctx, { agentId: id });
319
- emitAgentProgress(this.runtimeBus, ctx, { agentId: id, progress: record.progress });
333
+ emitAgentRunning(this.runtimeBus, ctx, {
334
+ agentId: id,
335
+ wrfcId: record.wrfcId,
336
+ wrfcRole: record.wrfcRole,
337
+ wrfcPhaseOrder: record.wrfcPhaseOrder,
338
+ });
339
+ emitAgentProgress(this.runtimeBus, ctx, {
340
+ agentId: id,
341
+ progress: record.progress,
342
+ wrfcId: record.wrfcId,
343
+ wrfcRole: record.wrfcRole,
344
+ wrfcPhaseOrder: record.wrfcPhaseOrder,
345
+ });
320
346
  }
321
347
  return record;
322
348
  }
@@ -151,7 +151,7 @@ export const AGENT_TOOL_SCHEMA = {
151
151
  },
152
152
  dangerously_disable_wrfc: {
153
153
  type: 'boolean',
154
- description: 'If true, skip the WRFC review chain for this agent (mode: spawn). Default: false.',
154
+ 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
155
  default: false,
156
156
  },
157
157
  // mode: batch-spawn
@@ -191,10 +191,10 @@ export const AGENT_TOOL_SCHEMA = {
191
191
  orchestrationGraphId: { type: 'string', description: 'Graph id to attach the worker to.' },
192
192
  orchestrationNodeId: { type: 'string', description: 'Explicit node id for the worker.' },
193
193
  parentNodeId: { type: 'string', description: 'Parent node id for the worker.' },
194
- dangerously_disable_wrfc: { type: 'boolean', description: 'Skip WRFC review.' },
194
+ 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
195
  },
196
196
  },
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.',
197
+ 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
198
  },
199
199
  // mode: spawn, batch-spawn, list, cohort-status, cohort-report
200
200
  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.21';
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.21",
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.21",
453
+ "@pellux/goodvibes-daemon-sdk": "0.33.21",
454
+ "@pellux/goodvibes-errors": "0.33.21",
455
+ "@pellux/goodvibes-operator-sdk": "0.33.21",
456
+ "@pellux/goodvibes-peer-sdk": "0.33.21",
457
+ "@pellux/goodvibes-transport-core": "0.33.21",
458
+ "@pellux/goodvibes-transport-http": "0.33.21",
459
+ "@pellux/goodvibes-transport-realtime": "0.33.21"
460
460
  },
461
461
  "optionalDependencies": {
462
462
  "@agentclientprotocol/sdk": "^0.21.0",