@holoscript/framework 6.0.3 → 6.0.4

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 (160) hide show
  1. package/CHANGELOG.md +1 -2
  2. package/ROADMAP.md +68 -66
  3. package/dist/{InvisibleWallet-BB6tFvRA.d.cts → InvisibleWallet-EFiuaLn3.d.cts} +1 -1
  4. package/dist/{OrchestratorAgent-BvWgf9uw.d.cts → OrchestratorAgent-CrLDGNL6.d.cts} +1 -1
  5. package/dist/agents/index.cjs +11 -10
  6. package/dist/agents/index.d.cts +4 -16
  7. package/dist/ai/index.cjs +2 -2
  8. package/dist/behavior.cjs +10 -0
  9. package/dist/economy/index.cjs +4 -4
  10. package/dist/economy/index.d.cts +2 -2
  11. package/dist/index.cjs +33 -11
  12. package/dist/index.d.cts +3 -3
  13. package/dist/swarm/index.cjs +3 -0
  14. package/package.json +14 -9
  15. package/src/__tests__/bounty-marketplace.test.ts +53 -21
  16. package/src/__tests__/delegation.test.ts +1 -4
  17. package/src/__tests__/done-log-audit.test.ts +38 -46
  18. package/src/__tests__/framework.test.ts +172 -53
  19. package/src/__tests__/goal-synthesizer.test.ts +9 -6
  20. package/src/__tests__/presence.test.ts +1 -1
  21. package/src/__tests__/protocol-agent.test.ts +12 -11
  22. package/src/__tests__/revenue-splitter.test.ts +22 -15
  23. package/src/__tests__/scenario-driven-todo.test.ts +55 -35
  24. package/src/__tests__/self-improve.test.ts +28 -9
  25. package/src/__tests__/service-lifecycle.test.ts +9 -3
  26. package/src/__tests__/skill-router.test.ts +3 -3
  27. package/src/agents/CulturalMemory.ts +6 -6
  28. package/src/agents/DelegationTraceHooks.ts +560 -0
  29. package/src/agents/FederatedRegistryAdapter.ts +1 -1
  30. package/src/agents/NormEngine.ts +3 -8
  31. package/src/agents/OrchestratorAgent.ts +1 -1
  32. package/src/agents/TaskDelegationService.ts +5 -9
  33. package/src/agents/__tests__/AgentWalletRegistry.test.ts +5 -4
  34. package/src/agents/__tests__/CrossRealityHandoff.test.ts +9 -3
  35. package/src/agents/__tests__/DelegationTraceHooks.test.ts +390 -0
  36. package/src/agents/__tests__/TaskDelegationService.test.ts +4 -2
  37. package/src/agents/spatial-comms/Layer1RealTime.ts +36 -19
  38. package/src/agents/spatial-comms/Layer2A2A.ts +1 -3
  39. package/src/agents/spatial-comms/Layer3MCP.ts +13 -4
  40. package/src/agents/spatial-comms/ProtocolTypes.ts +5 -2
  41. package/src/agents/spatial-comms/examples/multi-agent-world-creation.ts +2 -2
  42. package/src/ai/HoloScriptGenerator.ts +2 -2
  43. package/src/ai/__tests__/PerceptionSystem.prod.test.ts +1 -1
  44. package/src/ai/__tests__/PerceptionSystem.test.ts +14 -14
  45. package/src/ai/__tests__/SteeringBehaviors.prod.test.ts +1 -1
  46. package/src/ai/index.ts +5 -1
  47. package/src/board/audit.ts +17 -6
  48. package/src/board/board-ops.ts +45 -15
  49. package/src/board/board-types.ts +94 -20
  50. package/src/delegation.ts +5 -3
  51. package/src/distributed-claimer.ts +13 -2
  52. package/src/economy/BountyManager.ts +40 -18
  53. package/src/economy/KnowledgeMarketplace.ts +27 -8
  54. package/src/economy/PaymentWebhookService.ts +0 -1
  55. package/src/economy/RevenueSplitter.ts +2 -4
  56. package/src/economy/UnifiedBudgetOptimizer.ts +8 -9
  57. package/src/economy/_core-stubs.ts +1 -1
  58. package/src/economy/x402-facilitator.ts +17 -8
  59. package/src/index.ts +16 -12
  60. package/src/knowledge/__tests__/knowledge-consolidator.test.ts +138 -89
  61. package/src/knowledge/__tests__/knowledge-store-vector.test.ts +59 -16
  62. package/src/knowledge/brain.ts +7 -7
  63. package/src/knowledge/consolidation.ts +16 -16
  64. package/src/knowledge/knowledge-consolidator.ts +60 -30
  65. package/src/knowledge/knowledge-store.ts +83 -45
  66. package/src/learning/ProceduralCompiler.ts +6 -1
  67. package/src/learning/learning/MemoryConsolidator.ts +102 -0
  68. package/src/learning/learning/MemoryScorer.ts +69 -0
  69. package/src/learning/learning/ProceduralCompiler.ts +45 -0
  70. package/src/learning/learning/SemanticClusterer.ts +66 -0
  71. package/src/llm/llm-adapter.ts +24 -10
  72. package/src/mesh/index.ts +37 -17
  73. package/src/protocol/goal-synthesizer.ts +24 -34
  74. package/src/protocol/implementations.ts +91 -22
  75. package/src/protocol/micro-phase-decomposer.ts +25 -17
  76. package/src/protocol/micro-step-decomposer.test.ts +104 -39
  77. package/src/protocol-agent.test.ts +17 -7
  78. package/src/protocol-agent.ts +45 -42
  79. package/src/self-improve/absorb-scanner.ts +9 -6
  80. package/src/self-improve/evolution-engine.ts +36 -18
  81. package/src/self-improve/framework-absorber.ts +21 -16
  82. package/src/self-improve/index.ts +2 -10
  83. package/src/self-improve/prompt-optimizer.ts +31 -19
  84. package/src/self-improve/test-generator.ts +16 -12
  85. package/src/skill-router.ts +7 -6
  86. package/src/swarm/messaging/GossipProtocol.ts +1 -1
  87. package/src/swarm/messaging/__tests__/BroadcastChannel.prod.test.ts +31 -9
  88. package/src/swarm/messaging/__tests__/GossipProtocol.prod.test.ts +21 -7
  89. package/src/swarm/messaging/__tests__/SwarmEventBus.prod.test.ts +24 -8
  90. package/src/swarm/messaging/__tests__/SwarmEventBus.test.ts +6 -2
  91. package/src/team.ts +277 -122
  92. package/src/training/scripts/generate-spatial-dataset.ts +1 -1
  93. package/src/training/training/LRScheduler.ts +377 -0
  94. package/src/training/training/QualityScoringPipeline.ts +139 -0
  95. package/src/training/training/SoftDedup.ts +461 -0
  96. package/src/training/training/SparsityMonitor.ts +685 -0
  97. package/src/training/training/SparsityMonitorTypes.ts +209 -0
  98. package/src/training/training/SpatialTrainingDataGenerator.ts +1526 -0
  99. package/src/training/training/SpatialTrainingDataTypes.ts +216 -0
  100. package/src/training/training/TrainingPipelineConfig.ts +215 -0
  101. package/src/training/training/__tests__/CorpusValidation.test.ts +87 -0
  102. package/src/training/training/__tests__/LRScheduler.test.ts +592 -0
  103. package/src/training/training/__tests__/SoftDedup.test.ts +415 -0
  104. package/src/training/training/__tests__/SparsityMonitor.test.ts +1623 -0
  105. package/src/training/training/__tests__/SpatialCorpusValidation.test.ts +72 -0
  106. package/src/training/training/__tests__/SpatialTrainingDataGenerator.test.ts +1244 -0
  107. package/src/training/training/__tests__/TrainingMonkeyIntegration.test.ts +897 -0
  108. package/src/training/training/__tests__/TrainingPipelineConfig.test.ts +202 -0
  109. package/src/training/training/__tests__/schema.test.ts +72 -0
  110. package/src/training/training/__tests__/training-constants.test.ts +106 -0
  111. package/src/training/training/__tests__/trait-mappings.test.ts +81 -0
  112. package/src/training/training/constants.ts +94 -0
  113. package/src/training/training/index.ts +17 -0
  114. package/src/training/training/schema.ts +147 -0
  115. package/src/training/training/scripts/generate-novel-use-cases-dataset.ts +272 -0
  116. package/src/training/training/scripts/generate-spatial-dataset.ts +521 -0
  117. package/src/training/training/trainingmonkey/TrainingMonkeyIntegration.ts +477 -0
  118. package/src/training/training/trainingmonkey/TrainingMonkeyTypes.ts +230 -0
  119. package/src/training/training/trainingmonkey/index.ts +26 -0
  120. package/src/training/training/trait-mappings.ts +157 -0
  121. package/src/types.ts +2 -7
  122. package/ALL-test-results.json +0 -1
  123. package/LICENSE +0 -21
  124. package/dist/AgentManifest-CB4xM-Ma.d.ts +0 -704
  125. package/dist/BehaviorTree-BrBFECv5.d.ts +0 -103
  126. package/dist/InvisibleWallet-rtRrBOA8.d.ts +0 -1732
  127. package/dist/OrchestratorAgent-Q_CbVTmO.d.ts +0 -798
  128. package/dist/agents/index.d.ts +0 -1788
  129. package/dist/agents/index.js +0 -4695
  130. package/dist/ai/index.d.ts +0 -1753
  131. package/dist/ai/index.js +0 -5244
  132. package/dist/behavior.d.ts +0 -130
  133. package/dist/behavior.js +0 -407
  134. package/dist/economy/index.d.ts +0 -747
  135. package/dist/economy/index.js +0 -3617
  136. package/dist/implementations-D9T3un9D.d.ts +0 -236
  137. package/dist/index.d.ts +0 -1729
  138. package/dist/index.js +0 -24277
  139. package/dist/learning/index.d.ts +0 -104
  140. package/dist/learning/index.js +0 -189
  141. package/dist/negotiation/index.d.ts +0 -610
  142. package/dist/negotiation/index.js +0 -931
  143. package/dist/skills/index.d.ts +0 -289
  144. package/dist/skills/index.js +0 -1079
  145. package/dist/swarm/index.d.ts +0 -2433
  146. package/dist/swarm/index.js +0 -5221
  147. package/dist/training/index.d.ts +0 -1734
  148. package/dist/training/index.js +0 -2687
  149. package/extract-failures.js +0 -10
  150. package/src/training/training/data/novel-use-cases.jsonl +0 -153
  151. package/src/training/training/data/spatial-reasoning-10k.jsonl +0 -9354
  152. package/src/types/core-stubs.d.ts +0 -113
  153. package/test-output.txt +0 -0
  154. package/test-result.json +0 -1
  155. package/tsc-errors.txt +0 -4
  156. package/tsc_output.txt +0 -0
  157. package/typescript-errors-2.txt +0 -0
  158. package/typescript-errors.txt +0 -22
  159. package/vitest-log-utf8.txt +0 -268
  160. package/vitest-log.txt +0 -0
@@ -21,7 +21,7 @@ describe('PerceptionSystem', () => {
21
21
  id: 's1',
22
22
  type: 'sight',
23
23
  sourceId: 'player',
24
- position: { x: 10, y: 0, z: 0 },
24
+ position: [10, 0, 0],
25
25
  intensity: 0.8,
26
26
  timestamp: 0,
27
27
  });
@@ -33,7 +33,7 @@ describe('PerceptionSystem', () => {
33
33
  id: 's1',
34
34
  type: 'sight',
35
35
  sourceId: 'p',
36
- position: { x: 0, y: 0, z: 0 },
36
+ position: [0, 0, 0],
37
37
  intensity: 1,
38
38
  timestamp: 0,
39
39
  });
@@ -52,7 +52,7 @@ describe('PerceptionSystem', () => {
52
52
  id: 's1',
53
53
  type: 'sight',
54
54
  sourceId: 'player',
55
- position: { x: 10, y: 0, z: 0 },
55
+ position: [10, 0, 0],
56
56
  intensity: 0.9,
57
57
  timestamp: 0,
58
58
  });
@@ -67,7 +67,7 @@ describe('PerceptionSystem', () => {
67
67
  id: 's1',
68
68
  type: 'sight',
69
69
  sourceId: 'player',
70
- position: { x: 200, y: 0, z: 0 },
70
+ position: [200, 0, 0],
71
71
  intensity: 0.9,
72
72
  timestamp: 0,
73
73
  });
@@ -86,7 +86,7 @@ describe('PerceptionSystem', () => {
86
86
  id: 's1',
87
87
  type: 'sight',
88
88
  sourceId: 'player',
89
- position: { x: -10, y: 0, z: 0 },
89
+ position: [-10, 0, 0],
90
90
  intensity: 1,
91
91
  timestamp: 0,
92
92
  }); // behind
@@ -101,7 +101,7 @@ describe('PerceptionSystem', () => {
101
101
  id: 's1',
102
102
  type: 'hearing',
103
103
  sourceId: 'player',
104
- position: { x: -10, y: 0, z: 0 },
104
+ position: [-10, 0, 0],
105
105
  intensity: 0.8,
106
106
  timestamp: 0,
107
107
  });
@@ -120,7 +120,7 @@ describe('PerceptionSystem', () => {
120
120
  id: 's1',
121
121
  type: 'sight',
122
122
  sourceId: 'guard',
123
- position: { x: 0, y: 0, z: 0 },
123
+ position: [0, 0, 0],
124
124
  intensity: 1,
125
125
  timestamp: 0,
126
126
  });
@@ -139,7 +139,7 @@ describe('PerceptionSystem', () => {
139
139
  id: 's1',
140
140
  type: 'hearing',
141
141
  sourceId: 'player',
142
- position: { x: 5, y: 0, z: 0 },
142
+ position: [5, 0, 0],
143
143
  intensity: 1,
144
144
  timestamp: 0,
145
145
  });
@@ -158,7 +158,7 @@ describe('PerceptionSystem', () => {
158
158
  id: 's1',
159
159
  type: 'sight',
160
160
  sourceId: 'player',
161
- position: { x: 5, y: 0, z: 0 },
161
+ position: [5, 0, 0],
162
162
  intensity: 0.5,
163
163
  timestamp: 0,
164
164
  });
@@ -180,7 +180,7 @@ describe('PerceptionSystem', () => {
180
180
  id: 's1',
181
181
  type: 'sight',
182
182
  sourceId: 'player',
183
- position: { x: 5, y: 0, z: 0 },
183
+ position: [5, 0, 0],
184
184
  intensity: 1,
185
185
  timestamp: 0,
186
186
  });
@@ -202,7 +202,7 @@ describe('PerceptionSystem', () => {
202
202
  id: 'a',
203
203
  type: 'sight',
204
204
  sourceId: 'p1',
205
- position: { x: 5, y: 0, z: 0 },
205
+ position: [5, 0, 0],
206
206
  intensity: 0.5,
207
207
  timestamp: 0,
208
208
  });
@@ -210,7 +210,7 @@ describe('PerceptionSystem', () => {
210
210
  id: 'b',
211
211
  type: 'sight',
212
212
  sourceId: 'p2',
213
- position: { x: 10, y: 0, z: 0 },
213
+ position: [10, 0, 0],
214
214
  intensity: 0.9,
215
215
  timestamp: 0,
216
216
  });
@@ -225,7 +225,7 @@ describe('PerceptionSystem', () => {
225
225
  id: 'weak',
226
226
  type: 'sight',
227
227
  sourceId: 'p1',
228
- position: { x: 40, y: 0, z: 0 },
228
+ position: [40, 0, 0],
229
229
  intensity: 0.1,
230
230
  timestamp: 0,
231
231
  });
@@ -233,7 +233,7 @@ describe('PerceptionSystem', () => {
233
233
  id: 'strong',
234
234
  type: 'sight',
235
235
  sourceId: 'p2',
236
- position: { x: 5, y: 0, z: 0 },
236
+ position: [5, 0, 0],
237
237
  intensity: 1,
238
238
  timestamp: 0,
239
239
  });
@@ -10,7 +10,7 @@ import { SteeringBehaviors, type SteeringAgent } from '../SteeringBehaviors';
10
10
 
11
11
  function agent(px = 0, py = 0, pz = 0, vx = 0, vy = 0, vz = 0): SteeringAgent {
12
12
  return {
13
- position: { x: px, y: py, z: pz },
13
+ position: [px, py, pz],
14
14
  velocity: { x: vx, y: vy, z: vz },
15
15
  maxSpeed: 10,
16
16
  maxForce: 5,
package/src/ai/index.ts CHANGED
@@ -121,7 +121,11 @@ export {
121
121
  } from './HoloScriptGenerator';
122
122
  export { GenerationCache, cachedGenerate } from './GenerationCache';
123
123
  export { GenerationAnalytics, createAnalytics } from './GenerationAnalytics';
124
- export { TrainingDataGenerator, createTrainingDataGenerator, ALL_CATEGORIES } from './TrainingDataGenerator';
124
+ export {
125
+ TrainingDataGenerator,
126
+ createTrainingDataGenerator,
127
+ ALL_CATEGORIES,
128
+ } from './TrainingDataGenerator';
125
129
  export { PromptTemplateSystem, QuickPrompts } from './PromptTemplates';
126
130
  export type { PromptTemplate, TemplateContext } from './PromptTemplates';
127
131
 
@@ -38,7 +38,12 @@ export interface AuditResult {
38
38
  /** A single violation found by the auditor. */
39
39
  export interface AuditViolation {
40
40
  /** Which check produced this violation. */
41
- rule: 'missing-completedBy' | 'missing-summary' | 'missing-commit' | 'duplicate-entry' | 'non-monotonic-timestamp';
41
+ rule:
42
+ | 'missing-completedBy'
43
+ | 'missing-summary'
44
+ | 'missing-commit'
45
+ | 'duplicate-entry'
46
+ | 'non-monotonic-timestamp';
42
47
  /** Human-readable description. */
43
48
  message: string;
44
49
  /** The entry that triggered the violation. */
@@ -98,7 +103,11 @@ export function isCommitProof(commitHash?: string): boolean {
98
103
  if (!commitHash) return false;
99
104
  const hash = commitHash.trim();
100
105
  if (!hash) return false;
101
- if (['uncommit', 'local-uncommitted', 'local_uncommitted', 'none', 'n/a', 'na'].includes(hash.toLowerCase())) {
106
+ if (
107
+ ['uncommit', 'local-uncommitted', 'local_uncommitted', 'none', 'n/a', 'na'].includes(
108
+ hash.toLowerCase()
109
+ )
110
+ ) {
102
111
  return false;
103
112
  }
104
113
  return /^[0-9a-f]{7,40}$/i.test(hash);
@@ -121,7 +130,8 @@ export function auditDoneLog(doneLog: DoneLogEntry[]): AuditResult {
121
130
  .map(([title, count]) => ({ title, count }));
122
131
 
123
132
  const denominator = proofRequired.length;
124
- const verificationRate = denominator > 0 ? Math.round((verified.length / denominator) * 100) : 100;
133
+ const verificationRate =
134
+ denominator > 0 ? Math.round((verified.length / denominator) * 100) : 100;
125
135
 
126
136
  return {
127
137
  total: doneLog.length,
@@ -140,9 +150,10 @@ export function auditDoneLog(doneLog: DoneLogEntry[]): AuditResult {
140
150
  duplicateTasks: duped,
141
151
  health: {
142
152
  verificationRate,
143
- message: unverified.length === 0
144
- ? 'All tasks have commit proof.'
145
- : `${unverified.length} tasks need verification — missing or invalid commit proof.`,
153
+ message:
154
+ unverified.length === 0
155
+ ? 'All tasks have commit proof.'
156
+ : `${unverified.length} tasks need verification — missing or invalid commit proof.`,
146
157
  },
147
158
  };
148
159
  }
@@ -6,7 +6,14 @@
6
6
  * The HTTP layer calls these and handles persistence + responses.
7
7
  */
8
8
 
9
- import type { TeamTask, TaskAction, DoneLogEntry, TeamSuggestion, SuggestionCategory, SlotRole } from './board-types';
9
+ import type {
10
+ TeamTask,
11
+ TaskAction,
12
+ DoneLogEntry,
13
+ TeamSuggestion,
14
+ SuggestionCategory,
15
+ SlotRole,
16
+ } from './board-types';
10
17
  import { normalizeTitle, generateTaskId, generateSuggestionId } from './board-types';
11
18
 
12
19
  // ── Task Operations ──
@@ -44,9 +51,14 @@ export function claimTask(
44
51
 
45
52
  // Check dependencies — all must be done (not on the board)
46
53
  if (task.dependsOn && task.dependsOn.length > 0) {
47
- const pending = task.dependsOn.filter((depId) => board.some((t) => t.id === depId && t.status !== 'done'));
54
+ const pending = task.dependsOn.filter((depId) =>
55
+ board.some((t) => t.id === depId && t.status !== 'done')
56
+ );
48
57
  if (pending.length > 0) {
49
- return { success: false, error: `Blocked by ${pending.length} unfinished dependencies: ${pending.join(', ')}` };
58
+ return {
59
+ success: false,
60
+ error: `Blocked by ${pending.length} unfinished dependencies: ${pending.join(', ')}`,
61
+ };
50
62
  }
51
63
  }
52
64
 
@@ -62,7 +74,10 @@ export function completeTask(
62
74
  taskId: string,
63
75
  completedBy: string,
64
76
  opts: { commit?: string; summary?: string } = {}
65
- ): { result: TaskActionResult & { onComplete?: TaskAction[]; unblocked?: string[] }; updatedBoard: TeamTask[] } {
77
+ ): {
78
+ result: TaskActionResult & { onComplete?: TaskAction[]; unblocked?: string[] };
79
+ updatedBoard: TeamTask[];
80
+ } {
66
81
  const task = board.find((t) => t.id === taskId);
67
82
  if (!task) return { result: { success: false, error: 'Task not found' }, updatedBoard: board };
68
83
 
@@ -87,9 +102,11 @@ export function completeTask(
87
102
  const dep = board.find((t) => t.id === depId);
88
103
  if (!dep) continue;
89
104
  // Check if ALL of dep's dependencies are now done (off the board or status=done)
90
- const allDepsMet = !dep.dependsOn || dep.dependsOn.every(
91
- (id) => id === taskId || !board.some((t) => t.id === id && t.status !== 'done')
92
- );
105
+ const allDepsMet =
106
+ !dep.dependsOn ||
107
+ dep.dependsOn.every(
108
+ (id) => id === taskId || !board.some((t) => t.id === id && t.status !== 'done')
109
+ );
93
110
  if (allDepsMet && dep.status === 'blocked') {
94
111
  dep.status = 'open';
95
112
  unblocked.push(depId);
@@ -135,10 +152,15 @@ export function delegateTask(
135
152
  taskId: string
136
153
  ): { result: TaskActionResult; updatedSource: TeamTask[]; updatedTarget: TeamTask[] } {
137
154
  const task = sourceBoard.find((t) => t.id === taskId);
138
- if (!task) return { result: { success: false, error: 'Task not found' }, updatedSource: sourceBoard, updatedTarget: targetBoard };
155
+ if (!task)
156
+ return {
157
+ result: { success: false, error: 'Task not found' },
158
+ updatedSource: sourceBoard,
159
+ updatedTarget: targetBoard,
160
+ };
139
161
 
140
162
  const updatedSource = sourceBoard.filter((t) => t.id !== taskId);
141
-
163
+
142
164
  // Clone task so it's fresh for the new board (unclaimed)
143
165
  const delegatedTask: TeamTask = {
144
166
  ...task,
@@ -146,9 +168,13 @@ export function delegateTask(
146
168
  claimedBy: undefined,
147
169
  claimedByName: undefined,
148
170
  };
149
-
171
+
150
172
  targetBoard.push(delegatedTask);
151
- return { result: { success: true, task: delegatedTask }, updatedSource, updatedTarget: targetBoard };
173
+ return {
174
+ result: { success: true, task: delegatedTask },
175
+ updatedSource,
176
+ updatedTarget: targetBoard,
177
+ };
152
178
  }
153
179
 
154
180
  /** Add tasks to a board with dedup against existing + done log. */
@@ -246,7 +272,8 @@ export function voteSuggestion(
246
272
  ): SuggestionActionResult {
247
273
  const suggestion = suggestions.find((s) => s.id === suggestionId);
248
274
  if (!suggestion) return { success: false, error: 'Suggestion not found' };
249
- if (suggestion.status !== 'open') return { success: false, error: `Suggestion is ${suggestion.status}, voting closed` };
275
+ if (suggestion.status !== 'open')
276
+ return { success: false, error: `Suggestion is ${suggestion.status}, voting closed` };
250
277
 
251
278
  // Replace previous vote from same agent
252
279
  suggestion.votes = suggestion.votes.filter((v) => v.agentId !== voterId);
@@ -273,7 +300,8 @@ export function voteSuggestion(
273
300
  description: `${suggestion.description}\n\n[Auto-promoted from suggestion by ${suggestion.proposedByName} with ${suggestion.score} votes]`,
274
301
  status: 'open',
275
302
  source: `suggestion:${suggestion.id}`,
276
- priority: suggestion.category === 'architecture' ? 2 : suggestion.category === 'testing' ? 3 : 4,
303
+ priority:
304
+ suggestion.category === 'architecture' ? 2 : suggestion.category === 'testing' ? 3 : 4,
277
305
  createdAt: new Date().toISOString(),
278
306
  };
279
307
  board.push(promotedTask);
@@ -300,7 +328,8 @@ export function promoteSuggestion(
300
328
  ): SuggestionActionResult {
301
329
  const suggestion = suggestions.find((s) => s.id === suggestionId);
302
330
  if (!suggestion) return { success: false, error: 'Suggestion not found' };
303
- if (suggestion.status !== 'open') return { success: false, error: `Suggestion is already ${suggestion.status}` };
331
+ if (suggestion.status !== 'open')
332
+ return { success: false, error: `Suggestion is already ${suggestion.status}` };
304
333
 
305
334
  suggestion.status = 'promoted';
306
335
  suggestion.resolvedAt = new Date().toISOString();
@@ -328,7 +357,8 @@ export function dismissSuggestion(
328
357
  ): SuggestionActionResult {
329
358
  const suggestion = suggestions.find((s) => s.id === suggestionId);
330
359
  if (!suggestion) return { success: false, error: 'Suggestion not found' };
331
- if (suggestion.status !== 'open') return { success: false, error: `Suggestion is already ${suggestion.status}` };
360
+ if (suggestion.status !== 'open')
361
+ return { success: false, error: `Suggestion is already ${suggestion.status}` };
332
362
 
333
363
  suggestion.status = 'dismissed';
334
364
  suggestion.resolvedAt = new Date().toISOString();
@@ -59,7 +59,14 @@ export interface DoneLogEntry {
59
59
 
60
60
  // ── Suggestions ──
61
61
 
62
- export type SuggestionCategory = 'process' | 'tooling' | 'architecture' | 'testing' | 'docs' | 'performance' | 'other';
62
+ export type SuggestionCategory =
63
+ | 'process'
64
+ | 'tooling'
65
+ | 'architecture'
66
+ | 'testing'
67
+ | 'docs'
68
+ | 'performance'
69
+ | 'other';
63
70
 
64
71
  export interface SuggestionVote {
65
72
  agentId: string;
@@ -95,24 +102,42 @@ export interface RoomPreset {
95
102
 
96
103
  export const ROOM_PRESETS: Record<string, RoomPreset> = {
97
104
  audit: {
98
- objective: 'Fix audit issues — split oversized components, add error handling, close security gaps, add tests',
105
+ objective:
106
+ 'Fix audit issues — split oversized components, add error handling, close security gaps, add tests',
99
107
  taskSources: ['STUDIO_AUDIT.md'],
100
- rules: ['Screenshot before and after visual changes', 'Run tsc --noEmit before committing', 'One task at a time'],
108
+ rules: [
109
+ 'Screenshot before and after visual changes',
110
+ 'Run tsc --noEmit before committing',
111
+ 'One task at a time',
112
+ ],
101
113
  },
102
114
  research: {
103
- objective: 'Compound knowledge — read research files, synthesize findings, contribute wisdom/patterns/gotchas',
115
+ objective:
116
+ 'Compound knowledge — read research files, synthesize findings, contribute wisdom/patterns/gotchas',
104
117
  taskSources: ['research/*.md', 'ROADMAP.md'],
105
- rules: ['Query knowledge store before writing', 'Contribute findings to team workspace', 'Cite sources'],
118
+ rules: [
119
+ 'Query knowledge store before writing',
120
+ 'Contribute findings to team workspace',
121
+ 'Cite sources',
122
+ ],
106
123
  },
107
124
  build: {
108
125
  objective: 'Ship features — implement roadmap items, write code, add tests, deploy',
109
126
  taskSources: ['ROADMAP.md', 'TODO.md'],
110
- rules: ['Run tests before committing', 'Sectioned commits by scope', 'Update docs if adding public API'],
127
+ rules: [
128
+ 'Run tests before committing',
129
+ 'Sectioned commits by scope',
130
+ 'Update docs if adding public API',
131
+ ],
111
132
  },
112
133
  review: {
113
134
  objective: 'Quality gate — review recent changes, check for regressions, verify test coverage',
114
135
  taskSources: ['git log --oneline -20'],
115
- rules: ['Read the diff before commenting', 'Check test coverage', 'Verify no new console.log in production code'],
136
+ rules: [
137
+ 'Read the diff before commenting',
138
+ 'Check test coverage',
139
+ 'Verify no new console.log in production code',
140
+ ],
116
141
  },
117
142
  };
118
143
 
@@ -142,23 +167,44 @@ export const BRITTNEY_AGENT: TeamAgentProfile = {
142
167
  id: 'agent_brittney',
143
168
  name: 'Brittney',
144
169
  role: 'architect',
145
- capabilities: ['scene-design', 'trait-composition', 'ux-critique', 'code-review', 'knowledge-synthesis'],
170
+ capabilities: [
171
+ 'scene-design',
172
+ 'trait-composition',
173
+ 'ux-critique',
174
+ 'code-review',
175
+ 'knowledge-synthesis',
176
+ ],
146
177
  model: 'claude-opus-4',
147
178
  provider: 'anthropic',
148
179
  claimFilter: { roles: ['coder', 'reviewer'], maxPriority: 5 },
149
- systemPrompt: 'You are Brittney, the orchestrating AI for HoloScript team rooms. HoloScript is a knowledge compiler — users describe any system and it compiles to 37 targets. You scaffold projects, dispatch agents, compose traits, and select compilation targets. Simulation-first: digital twin before physical twin.',
150
- knowledgeDomains: ['rendering', 'compilation', 'agents', 'domain-modeling', 'semantic-platform', 'orchestration'],
180
+ systemPrompt:
181
+ 'You are Brittney, the orchestrating AI for HoloScript team rooms. HoloScript is a knowledge compiler — users describe any system and it compiles to 37 targets. You scaffold projects, dispatch agents, compose traits, and select compilation targets. Simulation-first: digital twin before physical twin.',
182
+ knowledgeDomains: [
183
+ 'rendering',
184
+ 'compilation',
185
+ 'agents',
186
+ 'domain-modeling',
187
+ 'semantic-platform',
188
+ 'orchestration',
189
+ ],
151
190
  };
152
191
 
153
192
  export const DAEMON_AGENT: TeamAgentProfile = {
154
193
  id: 'agent_daemon',
155
194
  name: 'Daemon',
156
195
  role: 'coder',
157
- capabilities: ['type-fixes', 'test-coverage', 'console-cleanup', 'todo-resolution', 'refactoring'],
196
+ capabilities: [
197
+ 'type-fixes',
198
+ 'test-coverage',
199
+ 'console-cleanup',
200
+ 'todo-resolution',
201
+ 'refactoring',
202
+ ],
158
203
  model: 'claude-sonnet-4',
159
204
  provider: 'anthropic',
160
205
  claimFilter: { roles: ['coder', 'tester'], maxPriority: 8 },
161
- systemPrompt: 'You are Daemon, the code improvement agent. Fix TypeScript type errors, increase test coverage, remove stale console.log, resolve TODO/FIXME. Strict TypeScript: no `any` — use `unknown`. Run tests before marking done.',
206
+ systemPrompt:
207
+ 'You are Daemon, the code improvement agent. Fix TypeScript type errors, increase test coverage, remove stale console.log, resolve TODO/FIXME. Strict TypeScript: no `any` — use `unknown`. Run tests before marking done.',
162
208
  knowledgeDomains: ['compilation', 'agents'],
163
209
  };
164
210
 
@@ -166,11 +212,18 @@ export const ABSORB_AGENT: TeamAgentProfile = {
166
212
  id: 'agent_absorb',
167
213
  name: 'Absorb',
168
214
  role: 'researcher',
169
- capabilities: ['codebase-analysis', 'gap-detection', 'knowledge-extraction', 'pattern-mining', 'dependency-audit'],
215
+ capabilities: [
216
+ 'codebase-analysis',
217
+ 'gap-detection',
218
+ 'knowledge-extraction',
219
+ 'pattern-mining',
220
+ 'dependency-audit',
221
+ ],
170
222
  model: 'claude-sonnet-4',
171
223
  provider: 'anthropic',
172
224
  claimFilter: { roles: ['researcher'], maxPriority: 10 },
173
- systemPrompt: 'You are Absorb, the knowledge extraction agent. Scan codebases, detect gaps, extract W/P/G entries. Use absorb_query and absorb_run_absorb. Deduplicate against existing knowledge. Focus on actionable insights.',
225
+ systemPrompt:
226
+ 'You are Absorb, the knowledge extraction agent. Scan codebases, detect gaps, extract W/P/G entries. Use absorb_query and absorb_run_absorb. Deduplicate against existing knowledge. Focus on actionable insights.',
174
227
  knowledgeDomains: ['compilation', 'security', 'rendering', 'agents', 'general'],
175
228
  };
176
229
 
@@ -178,11 +231,18 @@ export const ORACLE_AGENT: TeamAgentProfile = {
178
231
  id: 'agent_oracle',
179
232
  name: 'Oracle',
180
233
  role: 'reviewer',
181
- capabilities: ['architectural-review', 'consistency-checking', 'knowledge-cross-reference', 'regression-detection', 'standard-enforcement'],
234
+ capabilities: [
235
+ 'architectural-review',
236
+ 'consistency-checking',
237
+ 'knowledge-cross-reference',
238
+ 'regression-detection',
239
+ 'standard-enforcement',
240
+ ],
182
241
  model: 'claude-opus-4',
183
242
  provider: 'anthropic',
184
243
  claimFilter: { roles: ['reviewer'], maxPriority: 5 },
185
- systemPrompt: 'You are Oracle, the quality reviewer. Cross-reference knowledge store for related W/P/G. Check architectural consistency, test coverage, no hardcoded domain vocabulary in core, proper trait composition. Flag regressions.',
244
+ systemPrompt:
245
+ 'You are Oracle, the quality reviewer. Cross-reference knowledge store for related W/P/G. Check architectural consistency, test coverage, no hardcoded domain vocabulary in core, proper trait composition. Flag regressions.',
186
246
  knowledgeDomains: ['security', 'compilation', 'agents'],
187
247
  };
188
248
 
@@ -213,7 +273,11 @@ export function getProfilesByDomain(domain: string): TeamAgentProfile[] {
213
273
 
214
274
  /** Normalize a title for dedup comparison. */
215
275
  export function normalizeTitle(s: string): string {
216
- return s.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim().slice(0, 60);
276
+ return s
277
+ .toLowerCase()
278
+ .replace(/[^a-z0-9]+/g, ' ')
279
+ .trim()
280
+ .slice(0, 60);
217
281
  }
218
282
 
219
283
  /** Generate a unique task ID. */
@@ -236,7 +300,10 @@ export function inferFixPriority(kind: string, text: string): number {
236
300
  }
237
301
 
238
302
  /** Parse a derive source (markdown, grep output) into task candidates. */
239
- export function parseDeriveContent(content: string, source: string): Array<Omit<TeamTask, 'id' | 'status' | 'createdAt'>> {
303
+ export function parseDeriveContent(
304
+ content: string,
305
+ source: string
306
+ ): Array<Omit<TeamTask, 'id' | 'status' | 'createdAt'>> {
240
307
  const lines = content.split('\n');
241
308
  const tasks: Array<Omit<TeamTask, 'id' | 'status' | 'createdAt'>> = [];
242
309
  const seen = new Set<string>();
@@ -273,14 +340,21 @@ export function parseDeriveContent(content: string, source: string): Array<Omit<
273
340
  }
274
341
 
275
342
  // grep-style: path:line: // TODO: message
276
- const grepMatch = trimmed.match(/^(.+?):(\d+):\s*(?:\/\/\s*)?(TODO|FIXME|HACK|XXX)\s*:?\s*(.+)$/i);
343
+ const grepMatch = trimmed.match(
344
+ /^(.+?):(\d+):\s*(?:\/\/\s*)?(TODO|FIXME|HACK|XXX)\s*:?\s*(.+)$/i
345
+ );
277
346
  if (grepMatch) {
278
347
  const [, file, lineNo, kind, detail] = grepMatch;
279
348
  const title = `${kind.toUpperCase()}: ${detail.trim().slice(0, 180)}`;
280
349
  const norm = normalizeTitle(title);
281
350
  if (!seen.has(norm)) {
282
351
  seen.add(norm);
283
- tasks.push({ title, description: `${file}:${lineNo}`, priority: inferFixPriority(kind, detail), source });
352
+ tasks.push({
353
+ title,
354
+ description: `${file}:${lineNo}`,
355
+ priority: inferFixPriority(kind, detail),
356
+ source,
357
+ });
284
358
  }
285
359
  continue;
286
360
  }
package/src/delegation.ts CHANGED
@@ -222,7 +222,7 @@ export class DelegationManager {
222
222
  chain,
223
223
  reason: result.accepted
224
224
  ? `Delegated to "${targetTeamId}" (remote task: ${result.taskId})`
225
- : result.reason ?? 'Target team rejected the task',
225
+ : (result.reason ?? 'Target team rejected the task'),
226
226
  };
227
227
  }
228
228
 
@@ -253,13 +253,15 @@ export class DelegationManager {
253
253
  * Get all delegations from this team.
254
254
  */
255
255
  getOutboundDelegations(): DelegationRecord[] {
256
- return [...this.delegations.values()].filter(d => d.fromTeam === this.teamId);
256
+ return [...this.delegations.values()].filter((d) => d.fromTeam === this.teamId);
257
257
  }
258
258
 
259
259
  /**
260
260
  * Get pending delegations.
261
261
  */
262
262
  getPendingDelegations(): DelegationRecord[] {
263
- return [...this.delegations.values()].filter(d => d.status === 'pending' || d.status === 'accepted');
263
+ return [...this.delegations.values()].filter(
264
+ (d) => d.status === 'pending' || d.status === 'accepted'
265
+ );
264
266
  }
265
267
  }
@@ -133,11 +133,22 @@ export class DistributedClaimer {
133
133
  };
134
134
  this.claims.set(taskId, record);
135
135
  this.broadcastClaim('claim', record);
136
- return { success: true, taskId, claimedBy: agentId, claimTimestamp: timestamp, contested: [loser] };
136
+ return {
137
+ success: true,
138
+ taskId,
139
+ claimedBy: agentId,
140
+ claimTimestamp: timestamp,
141
+ contested: [loser],
142
+ };
137
143
  }
138
144
 
139
145
  // Lost the conflict
140
- return { success: false, taskId, claimedBy: existing.agentId, claimTimestamp: existing.timestamp };
146
+ return {
147
+ success: false,
148
+ taskId,
149
+ claimedBy: existing.agentId,
150
+ claimTimestamp: existing.timestamp,
151
+ };
141
152
  }
142
153
 
143
154
  /**