@goondocks/myco 0.18.1 → 0.19.0

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 (173) hide show
  1. package/README.md +17 -130
  2. package/dist/{agent-run-I4O2K2CK.js → agent-run-EADUYYAS.js} +6 -6
  3. package/dist/{agent-tasks-UOW5BQIB.js → agent-tasks-GC77JXQB.js} +6 -6
  4. package/dist/{chunk-W7WENJ6F.js → chunk-2CKDAFSX.js} +2 -2
  5. package/dist/{chunk-TOER6RNC.js → chunk-2DF4OZ2D.js} +2 -2
  6. package/dist/{chunk-CURS2TNP.js → chunk-2LN2BBKA.js} +2 -2
  7. package/dist/{chunk-RIDSOQDR.js → chunk-2OO3BRFK.js} +2 -2
  8. package/dist/{chunk-RAV5YMRU.js → chunk-3TPD6HEF.js} +4 -4
  9. package/dist/{chunk-D7TYRPRM.js → chunk-6LQIMRTC.js} +145 -145
  10. package/dist/chunk-6LQIMRTC.js.map +1 -0
  11. package/dist/{chunk-NI23QCHB.js → chunk-AELJ4PS5.js} +5 -5
  12. package/dist/{chunk-XWOQL4XN.js → chunk-CYBC2HZ3.js} +3 -3
  13. package/dist/chunk-EM63ZFKA.js +166 -0
  14. package/dist/chunk-EM63ZFKA.js.map +1 -0
  15. package/dist/{chunk-O3TRN3RC.js → chunk-INWD6AIQ.js} +2 -2
  16. package/dist/{chunk-CML4MCYF.js → chunk-KSXTNYXO.js} +2 -2
  17. package/dist/{chunk-TCSVDQF5.js → chunk-LLJMDXO2.js} +58 -58
  18. package/dist/chunk-LLJMDXO2.js.map +1 -0
  19. package/dist/{chunk-2V7HR7HB.js → chunk-MDEUXYJG.js} +4 -4
  20. package/dist/{chunk-YZPI2Y3E.js → chunk-MS6FDV45.js} +3 -3
  21. package/dist/{chunk-TLK46KKD.js → chunk-N77K772N.js} +3 -3
  22. package/dist/{chunk-E4VLWIJC.js → chunk-ODXLRR4U.js} +1 -1
  23. package/dist/{chunk-LSP5HYOO.js → chunk-OZF5EURR.js} +4 -4
  24. package/dist/{chunk-IB76KGBY.js → chunk-POEPHBQK.js} +1 -1
  25. package/dist/{chunk-TZAXQKO6.js → chunk-REN37KYI.js} +2 -2
  26. package/dist/{chunk-C3EGL5JX.js → chunk-RXROZBSK.js} +8 -8
  27. package/dist/{chunk-U3J2DDSR.js → chunk-SCI55NKY.js} +2 -2
  28. package/dist/{chunk-GDY63YAW.js → chunk-U6PF3YII.js} +79 -79
  29. package/dist/chunk-U6PF3YII.js.map +1 -0
  30. package/dist/{chunk-DPSLJ242.js → chunk-UVKQ62II.js} +3 -3
  31. package/dist/{chunk-N75GMQGA.js → chunk-UW6DGPSV.js} +3 -3
  32. package/dist/{chunk-CKJAWZQE.js → chunk-W4VHC2ES.js} +11 -3
  33. package/dist/chunk-W4VHC2ES.js.map +1 -0
  34. package/dist/{chunk-75AZFBFW.js → chunk-YPWF322W.js} +3 -3
  35. package/dist/{cli-D3TJYJ2U.js → cli-X7CFP4YD.js} +39 -39
  36. package/dist/{client-4LLEXLVK.js → client-YA33HUFY.js} +4 -4
  37. package/dist/{config-DA4IUVFL.js → config-RFB2DJC6.js} +6 -6
  38. package/dist/{detect-SZ2KDUF4.js → detect-BEOIHGBC.js} +5 -5
  39. package/dist/{detect-providers-PSVKXTWE.js → detect-providers-2OQBU4VX.js} +4 -4
  40. package/dist/{doctor-KCTXPX5D.js → doctor-FAH7N66M.js} +11 -11
  41. package/dist/{executor-UYIZC3L5.js → executor-ICTRRUBY.js} +17 -17
  42. package/dist/{init-QFNBKKDC.js → init-PTJEOTJV.js} +15 -15
  43. package/dist/{llm-SMA5ZEAW.js → llm-7D2OGDEK.js} +4 -4
  44. package/dist/{loader-Q3P3R4UP.js → loader-O2JFO2UC.js} +6 -6
  45. package/dist/{loader-SKKUMT5C.js → loader-VPE4RCIF.js} +6 -6
  46. package/dist/{main-5THODR77.js → main-EIKBLOUL.js} +341 -84
  47. package/dist/main-EIKBLOUL.js.map +1 -0
  48. package/dist/{open-7737CSPN.js → open-2JCSOLZS.js} +6 -6
  49. package/dist/{post-compact-2TJ5FPZH.js → post-compact-2HPPWPBI.js} +10 -10
  50. package/dist/{post-tool-use-FRTSICC3.js → post-tool-use-TWBBBABS.js} +9 -9
  51. package/dist/{post-tool-use-failure-KYO2NCNB.js → post-tool-use-failure-LIJYR4KL.js} +10 -10
  52. package/dist/{pre-compact-J6GCJEJR.js → pre-compact-II2CMNTG.js} +10 -10
  53. package/dist/{provider-check-AE3L5Z6R.js → provider-check-KEQNQ6LO.js} +4 -4
  54. package/dist/{registry-O2NZLO3V.js → registry-X5FDGYXT.js} +7 -7
  55. package/dist/{remove-3WZZC7AX.js → remove-L5MVYBOY.js} +11 -11
  56. package/dist/{resolution-events-XWYLLDRK.js → resolution-events-MVIZMONR.js} +4 -4
  57. package/dist/{restart-HUHEFOXU.js → restart-VIT3JBD6.js} +7 -7
  58. package/dist/{search-ZGN3LDXG.js → search-O6BB5MTO.js} +7 -7
  59. package/dist/{server-PTXLVVEE.js → server-O3UPJVBR.js} +258 -173
  60. package/dist/server-O3UPJVBR.js.map +1 -0
  61. package/dist/{session-7VV3IQMO.js → session-5JV3DQIK.js} +8 -8
  62. package/dist/{session-end-SMU55UCM.js → session-end-PZ2OXBGG.js} +9 -9
  63. package/dist/{session-start-NIMWEOIZ.js → session-start-FDGM56BX.js} +14 -14
  64. package/dist/{setup-llm-7S3VPAPN.js → setup-llm-MQK557BB.js} +10 -10
  65. package/dist/src/cli.js +1 -1
  66. package/dist/src/daemon/main.js +1 -1
  67. package/dist/src/hooks/post-tool-use.js +1 -1
  68. package/dist/src/hooks/session-end.js +1 -1
  69. package/dist/src/hooks/session-start.js +1 -1
  70. package/dist/src/hooks/stop.js +1 -1
  71. package/dist/src/hooks/user-prompt-submit.js +1 -1
  72. package/dist/src/mcp/server.js +1 -1
  73. package/dist/{stats-GEOQ2DFF.js → stats-2STTARTC.js} +11 -11
  74. package/dist/{stop-7AKYBJJ2.js → stop-WNKCMCGO.js} +9 -9
  75. package/dist/{stop-failure-NLE2EURG.js → stop-failure-6GTOBVTN.js} +10 -10
  76. package/dist/{subagent-start-LBNZF2TG.js → subagent-start-VJF5YKVX.js} +10 -10
  77. package/dist/{subagent-stop-B2Z5GYAB.js → subagent-stop-UW6HMICY.js} +10 -10
  78. package/dist/{task-completed-PO5TETJ7.js → task-completed-U4Q3XXLX.js} +10 -10
  79. package/dist/{team-DPNP2RN7.js → team-N6TXS2PF.js} +148 -103
  80. package/dist/team-N6TXS2PF.js.map +1 -0
  81. package/dist/ui/assets/{index-CiI1fwas.js → index-CHIm98OP.js} +48 -48
  82. package/dist/ui/index.html +1 -1
  83. package/dist/{update-WBWB5URU.js → update-ZYCOWKMD.js} +11 -11
  84. package/dist/{user-prompt-submit-IZJC3NV7.js → user-prompt-submit-SOYL4OWF.js} +9 -9
  85. package/dist/{verify-FNSP62I3.js → verify-P37PQ4YM.js} +8 -8
  86. package/dist/{version-QEVU66NT.js → version-XAWC277D.js} +2 -2
  87. package/package.json +19 -2
  88. package/CONTRIBUTING.md +0 -132
  89. package/dist/chunk-CKJAWZQE.js.map +0 -1
  90. package/dist/chunk-D7TYRPRM.js.map +0 -1
  91. package/dist/chunk-GDY63YAW.js.map +0 -1
  92. package/dist/chunk-RJMXDUMA.js +0 -40
  93. package/dist/chunk-RJMXDUMA.js.map +0 -1
  94. package/dist/chunk-TCSVDQF5.js.map +0 -1
  95. package/dist/main-5THODR77.js.map +0 -1
  96. package/dist/server-PTXLVVEE.js.map +0 -1
  97. package/dist/src/worker/package-lock.json +0 -4338
  98. package/dist/src/worker/package.json +0 -22
  99. package/dist/src/worker/src/auth.ts +0 -31
  100. package/dist/src/worker/src/index.ts +0 -476
  101. package/dist/src/worker/src/mcp/auth.ts +0 -65
  102. package/dist/src/worker/src/mcp/server.ts +0 -53
  103. package/dist/src/worker/src/mcp/tools/context.ts +0 -13
  104. package/dist/src/worker/src/mcp/tools/get.ts +0 -15
  105. package/dist/src/worker/src/mcp/tools/graph.ts +0 -35
  106. package/dist/src/worker/src/mcp/tools/search.ts +0 -32
  107. package/dist/src/worker/src/mcp/tools/sessions.ts +0 -24
  108. package/dist/src/worker/src/mcp/tools/skills.ts +0 -16
  109. package/dist/src/worker/src/mcp/tools/team.ts +0 -9
  110. package/dist/src/worker/src/schema.ts +0 -326
  111. package/dist/src/worker/src/search-helpers.ts +0 -70
  112. package/dist/src/worker/tsconfig.json +0 -16
  113. package/dist/src/worker/wrangler.toml +0 -30
  114. package/dist/team-DPNP2RN7.js.map +0 -1
  115. /package/dist/{agent-run-I4O2K2CK.js.map → agent-run-EADUYYAS.js.map} +0 -0
  116. /package/dist/{agent-tasks-UOW5BQIB.js.map → agent-tasks-GC77JXQB.js.map} +0 -0
  117. /package/dist/{chunk-W7WENJ6F.js.map → chunk-2CKDAFSX.js.map} +0 -0
  118. /package/dist/{chunk-TOER6RNC.js.map → chunk-2DF4OZ2D.js.map} +0 -0
  119. /package/dist/{chunk-CURS2TNP.js.map → chunk-2LN2BBKA.js.map} +0 -0
  120. /package/dist/{chunk-RIDSOQDR.js.map → chunk-2OO3BRFK.js.map} +0 -0
  121. /package/dist/{chunk-RAV5YMRU.js.map → chunk-3TPD6HEF.js.map} +0 -0
  122. /package/dist/{chunk-NI23QCHB.js.map → chunk-AELJ4PS5.js.map} +0 -0
  123. /package/dist/{chunk-XWOQL4XN.js.map → chunk-CYBC2HZ3.js.map} +0 -0
  124. /package/dist/{chunk-O3TRN3RC.js.map → chunk-INWD6AIQ.js.map} +0 -0
  125. /package/dist/{chunk-CML4MCYF.js.map → chunk-KSXTNYXO.js.map} +0 -0
  126. /package/dist/{chunk-2V7HR7HB.js.map → chunk-MDEUXYJG.js.map} +0 -0
  127. /package/dist/{chunk-YZPI2Y3E.js.map → chunk-MS6FDV45.js.map} +0 -0
  128. /package/dist/{chunk-TLK46KKD.js.map → chunk-N77K772N.js.map} +0 -0
  129. /package/dist/{chunk-E4VLWIJC.js.map → chunk-ODXLRR4U.js.map} +0 -0
  130. /package/dist/{chunk-LSP5HYOO.js.map → chunk-OZF5EURR.js.map} +0 -0
  131. /package/dist/{chunk-IB76KGBY.js.map → chunk-POEPHBQK.js.map} +0 -0
  132. /package/dist/{chunk-TZAXQKO6.js.map → chunk-REN37KYI.js.map} +0 -0
  133. /package/dist/{chunk-C3EGL5JX.js.map → chunk-RXROZBSK.js.map} +0 -0
  134. /package/dist/{chunk-U3J2DDSR.js.map → chunk-SCI55NKY.js.map} +0 -0
  135. /package/dist/{chunk-DPSLJ242.js.map → chunk-UVKQ62II.js.map} +0 -0
  136. /package/dist/{chunk-N75GMQGA.js.map → chunk-UW6DGPSV.js.map} +0 -0
  137. /package/dist/{chunk-75AZFBFW.js.map → chunk-YPWF322W.js.map} +0 -0
  138. /package/dist/{cli-D3TJYJ2U.js.map → cli-X7CFP4YD.js.map} +0 -0
  139. /package/dist/{client-4LLEXLVK.js.map → client-YA33HUFY.js.map} +0 -0
  140. /package/dist/{config-DA4IUVFL.js.map → config-RFB2DJC6.js.map} +0 -0
  141. /package/dist/{detect-SZ2KDUF4.js.map → detect-BEOIHGBC.js.map} +0 -0
  142. /package/dist/{detect-providers-PSVKXTWE.js.map → detect-providers-2OQBU4VX.js.map} +0 -0
  143. /package/dist/{doctor-KCTXPX5D.js.map → doctor-FAH7N66M.js.map} +0 -0
  144. /package/dist/{executor-UYIZC3L5.js.map → executor-ICTRRUBY.js.map} +0 -0
  145. /package/dist/{init-QFNBKKDC.js.map → init-PTJEOTJV.js.map} +0 -0
  146. /package/dist/{llm-SMA5ZEAW.js.map → llm-7D2OGDEK.js.map} +0 -0
  147. /package/dist/{loader-Q3P3R4UP.js.map → loader-O2JFO2UC.js.map} +0 -0
  148. /package/dist/{loader-SKKUMT5C.js.map → loader-VPE4RCIF.js.map} +0 -0
  149. /package/dist/{open-7737CSPN.js.map → open-2JCSOLZS.js.map} +0 -0
  150. /package/dist/{post-compact-2TJ5FPZH.js.map → post-compact-2HPPWPBI.js.map} +0 -0
  151. /package/dist/{post-tool-use-FRTSICC3.js.map → post-tool-use-TWBBBABS.js.map} +0 -0
  152. /package/dist/{post-tool-use-failure-KYO2NCNB.js.map → post-tool-use-failure-LIJYR4KL.js.map} +0 -0
  153. /package/dist/{pre-compact-J6GCJEJR.js.map → pre-compact-II2CMNTG.js.map} +0 -0
  154. /package/dist/{provider-check-AE3L5Z6R.js.map → provider-check-KEQNQ6LO.js.map} +0 -0
  155. /package/dist/{registry-O2NZLO3V.js.map → registry-X5FDGYXT.js.map} +0 -0
  156. /package/dist/{remove-3WZZC7AX.js.map → remove-L5MVYBOY.js.map} +0 -0
  157. /package/dist/{resolution-events-XWYLLDRK.js.map → resolution-events-MVIZMONR.js.map} +0 -0
  158. /package/dist/{restart-HUHEFOXU.js.map → restart-VIT3JBD6.js.map} +0 -0
  159. /package/dist/{search-ZGN3LDXG.js.map → search-O6BB5MTO.js.map} +0 -0
  160. /package/dist/{session-7VV3IQMO.js.map → session-5JV3DQIK.js.map} +0 -0
  161. /package/dist/{session-end-SMU55UCM.js.map → session-end-PZ2OXBGG.js.map} +0 -0
  162. /package/dist/{session-start-NIMWEOIZ.js.map → session-start-FDGM56BX.js.map} +0 -0
  163. /package/dist/{setup-llm-7S3VPAPN.js.map → setup-llm-MQK557BB.js.map} +0 -0
  164. /package/dist/{stats-GEOQ2DFF.js.map → stats-2STTARTC.js.map} +0 -0
  165. /package/dist/{stop-7AKYBJJ2.js.map → stop-WNKCMCGO.js.map} +0 -0
  166. /package/dist/{stop-failure-NLE2EURG.js.map → stop-failure-6GTOBVTN.js.map} +0 -0
  167. /package/dist/{subagent-start-LBNZF2TG.js.map → subagent-start-VJF5YKVX.js.map} +0 -0
  168. /package/dist/{subagent-stop-B2Z5GYAB.js.map → subagent-stop-UW6HMICY.js.map} +0 -0
  169. /package/dist/{task-completed-PO5TETJ7.js.map → task-completed-U4Q3XXLX.js.map} +0 -0
  170. /package/dist/{update-WBWB5URU.js.map → update-ZYCOWKMD.js.map} +0 -0
  171. /package/dist/{user-prompt-submit-IZJC3NV7.js.map → user-prompt-submit-SOYL4OWF.js.map} +0 -0
  172. /package/dist/{verify-FNSP62I3.js.map → verify-P37PQ4YM.js.map} +0 -0
  173. /package/dist/{version-QEVU66NT.js.map → version-XAWC277D.js.map} +0 -0
@@ -15,16 +15,18 @@ import {
15
15
  getEmbeddingQueueDepth,
16
16
  getUnembedded,
17
17
  markEmbedded
18
- } from "./chunk-LSP5HYOO.js";
18
+ } from "./chunk-OZF5EURR.js";
19
19
  import {
20
20
  loadSecrets,
21
+ readJsonConfig,
21
22
  readSecrets,
23
+ resolveHomeConfigPath,
22
24
  writeSecret
23
- } from "./chunk-RJMXDUMA.js";
25
+ } from "./chunk-EM63ZFKA.js";
24
26
  import {
25
27
  Anthropic,
26
28
  createEmbeddingProvider
27
- } from "./chunk-TCSVDQF5.js";
29
+ } from "./chunk-LLJMDXO2.js";
28
30
  import {
29
31
  buildTaskInstruction,
30
32
  closeOpenBatches,
@@ -72,24 +74,24 @@ import {
72
74
  setResponseSummary,
73
75
  updateCandidate,
74
76
  updateNotificationStatus
75
- } from "./chunk-C3EGL5JX.js";
77
+ } from "./chunk-RXROZBSK.js";
76
78
  import {
77
79
  fullTextSearch,
78
80
  hydrateSearchResults
79
- } from "./chunk-TOER6RNC.js";
81
+ } from "./chunk-2DF4OZ2D.js";
80
82
  import {
81
83
  copyTaskToUser,
82
84
  deleteUserTask,
83
85
  loadAllTasks,
84
86
  validateTaskName,
85
87
  writeUserTask
86
- } from "./chunk-RAV5YMRU.js";
88
+ } from "./chunk-3TPD6HEF.js";
87
89
  import {
88
90
  AgentTaskSchema,
89
91
  registerAgent,
90
92
  resolveDefinitionsDir,
91
93
  taskFromParsed
92
- } from "./chunk-NI23QCHB.js";
94
+ } from "./chunk-AELJ4PS5.js";
93
95
  import {
94
96
  listTurnsByRun
95
97
  } from "./chunk-QLCD77AN.js";
@@ -105,24 +107,24 @@ import {
105
107
  cleanStaleBuffers,
106
108
  listBufferSessionIds
107
109
  } from "./chunk-V7XG6V6C.js";
108
- import "./chunk-IB76KGBY.js";
109
- import "./chunk-TLK46KKD.js";
110
+ import "./chunk-POEPHBQK.js";
111
+ import "./chunk-N77K772N.js";
110
112
  import "./chunk-SAKJMNSR.js";
111
113
  import "./chunk-WYOE4IAX.js";
112
114
  import {
113
115
  checkLocalProvider
114
- } from "./chunk-75AZFBFW.js";
116
+ } from "./chunk-YPWF322W.js";
115
117
  import {
116
118
  LmStudioBackend,
117
119
  OllamaBackend
118
- } from "./chunk-CML4MCYF.js";
120
+ } from "./chunk-KSXTNYXO.js";
119
121
  import {
120
122
  countSpores,
121
123
  getSpore,
122
124
  insertSpore,
123
125
  listSpores,
124
126
  updateSporeStatus
125
- } from "./chunk-TZAXQKO6.js";
127
+ } from "./chunk-REN37KYI.js";
126
128
  import {
127
129
  closeSession,
128
130
  countSessions,
@@ -133,7 +135,7 @@ import {
133
135
  listSessions,
134
136
  updateSession,
135
137
  upsertSession
136
- } from "./chunk-RIDSOQDR.js";
138
+ } from "./chunk-2OO3BRFK.js";
137
139
  import {
138
140
  backfillUnsynced,
139
141
  countDeadLettered,
@@ -149,13 +151,13 @@ import {
149
151
  pruneOld,
150
152
  retryDeadLettered,
151
153
  syncRow
152
- } from "./chunk-O3TRN3RC.js";
154
+ } from "./chunk-INWD6AIQ.js";
153
155
  import {
154
156
  EMBEDDING_DIMENSIONS,
155
157
  REST_SETTABLE_STATUSES,
156
158
  SCHEMA_VERSION,
157
159
  createSchema
158
- } from "./chunk-CURS2TNP.js";
160
+ } from "./chunk-2LN2BBKA.js";
159
161
  import {
160
162
  CONFIG_FILENAME,
161
163
  MycoConfigSchema,
@@ -164,7 +166,7 @@ import {
164
166
  updateBackupConfig,
165
167
  updateConfig,
166
168
  updateTeamConfig
167
- } from "./chunk-2V7HR7HB.js";
169
+ } from "./chunk-MDEUXYJG.js";
168
170
  import {
169
171
  closeDatabase,
170
172
  getDatabase,
@@ -173,13 +175,13 @@ import {
173
175
  } from "./chunk-MYX5NCRH.js";
174
176
  import {
175
177
  resolveCliEntryPath
176
- } from "./chunk-XWOQL4XN.js";
178
+ } from "./chunk-CYBC2HZ3.js";
177
179
  import {
178
180
  getPluginVersion
179
- } from "./chunk-W7WENJ6F.js";
181
+ } from "./chunk-2CKDAFSX.js";
180
182
  import {
181
183
  loadManifests
182
- } from "./chunk-DPSLJ242.js";
184
+ } from "./chunk-UVKQ62II.js";
183
185
  import {
184
186
  findPackageRoot
185
187
  } from "./chunk-LPUQPDC2.js";
@@ -201,7 +203,7 @@ import {
201
203
  MS_PER_SECOND,
202
204
  MYCO_GLOBAL_DIR,
203
205
  NPM_PACKAGE_NAME,
204
- NPM_REGISTRY_URL,
206
+ NPM_REGISTRY_BASE_URL,
205
207
  POWER_ACTIVE_INTERVAL_MS,
206
208
  POWER_DEEP_SLEEP_THRESHOLD_MS,
207
209
  POWER_IDLE_THRESHOLD_MS,
@@ -228,6 +230,7 @@ import {
228
230
  UPDATE_CHECK_INTERVAL_HOURS,
229
231
  UPDATE_CONFIG_PATH,
230
232
  UPDATE_ERROR_PATH,
233
+ UPDATE_PACKAGES,
231
234
  UPDATE_SCRIPT_DELAY_SECONDS,
232
235
  UPDATE_STAMP_FILENAME,
233
236
  USER_AGENT_ID,
@@ -235,18 +238,18 @@ import {
235
238
  USER_TASK_SOURCE,
236
239
  epochSeconds,
237
240
  estimateTokens
238
- } from "./chunk-CKJAWZQE.js";
241
+ } from "./chunk-W4VHC2ES.js";
239
242
  import {
240
243
  LOG_KINDS,
241
244
  kindToComponent
242
245
  } from "./chunk-E7NUADTQ.js";
243
246
  import {
244
247
  require_dist
245
- } from "./chunk-D7TYRPRM.js";
246
- import "./chunk-E4VLWIJC.js";
248
+ } from "./chunk-6LQIMRTC.js";
249
+ import "./chunk-ODXLRR4U.js";
247
250
  import {
248
251
  external_exports
249
- } from "./chunk-GDY63YAW.js";
252
+ } from "./chunk-U6PF3YII.js";
250
253
  import {
251
254
  __toESM
252
255
  } from "./chunk-PZUWP5VK.js";
@@ -1749,7 +1752,25 @@ function writeUpdateConfig(config) {
1749
1752
  function readCachedCheck() {
1750
1753
  try {
1751
1754
  const raw = fs9.readFileSync(UPDATE_CHECK_CACHE_PATH, "utf-8");
1752
- return JSON.parse(raw);
1755
+ const parsed = JSON.parse(raw);
1756
+ if (parsed && typeof parsed === "object" && "packages" in parsed && parsed.packages) {
1757
+ return parsed;
1758
+ }
1759
+ const legacy = parsed;
1760
+ if (typeof legacy.checked_at === "string" && typeof legacy.latest_stable === "string") {
1761
+ return {
1762
+ checked_at: legacy.checked_at,
1763
+ channel: RELEASE_CHANNELS.includes(legacy.channel) ? legacy.channel : DEFAULT_RELEASE_CHANNEL,
1764
+ packages: {
1765
+ myco: {
1766
+ package_name: NPM_PACKAGE_NAME,
1767
+ latest_stable: legacy.latest_stable,
1768
+ latest_beta: legacy.latest_beta ?? null
1769
+ }
1770
+ }
1771
+ };
1772
+ }
1773
+ return null;
1753
1774
  } catch {
1754
1775
  return null;
1755
1776
  }
@@ -1767,6 +1788,9 @@ function isCacheStale(cache, intervalHours) {
1767
1788
  const ageMs = Date.now() - checkedAt;
1768
1789
  return ageMs > intervalHours * MS_PER_HOUR;
1769
1790
  }
1791
+ function packageRegistryUrl(packageName) {
1792
+ return `${NPM_REGISTRY_BASE_URL}/${encodeURIComponent(packageName)}`;
1793
+ }
1770
1794
  function resolveTargetVersion(distTags, channel) {
1771
1795
  const stable = distTags.latest;
1772
1796
  const beta = distTags.beta ?? null;
@@ -1776,34 +1800,79 @@ function resolveTargetVersion(distTags, channel) {
1776
1800
  const higher = semver.gt(beta, stable) ? beta : stable;
1777
1801
  return higher;
1778
1802
  }
1779
- function buildCheckResult(currentVersion, cache, config, error) {
1780
- const targetVersion = resolveTargetVersion(
1781
- { latest: cache.latest_stable, beta: cache.latest_beta ?? void 0 },
1782
- cache.channel
1803
+ function resolveTargetVersionFromCache(pkg, channel) {
1804
+ return resolveTargetVersion(
1805
+ { latest: pkg.latest_stable, beta: pkg.latest_beta ?? void 0 },
1806
+ channel
1783
1807
  );
1784
- const update_available = semver.valid(currentVersion) !== null && semver.valid(targetVersion) !== null && semver.gt(targetVersion, currentVersion);
1808
+ }
1809
+ function buildInstalledPackageVersions(globalPrefix, currentVersion) {
1810
+ const installed = {
1811
+ myco: currentVersion,
1812
+ "myco-team": null,
1813
+ "myco-collective": null
1814
+ };
1815
+ if (globalPrefix === null) return installed;
1816
+ for (const pkg of UPDATE_PACKAGES) {
1817
+ const version = getInstalledVersion(globalPrefix, pkg.packageName);
1818
+ if (pkg.id === "myco") {
1819
+ installed.myco = version ?? currentVersion;
1820
+ continue;
1821
+ }
1822
+ installed[pkg.id] = version;
1823
+ }
1824
+ return installed;
1825
+ }
1826
+ function buildPackageResults(currentVersion, cache, channel, globalPrefix) {
1827
+ const installedVersions = buildInstalledPackageVersions(globalPrefix, currentVersion);
1828
+ return UPDATE_PACKAGES.map((pkg) => {
1829
+ const cached = cache.packages[pkg.id];
1830
+ const installedVersion = installedVersions[pkg.id];
1831
+ const latestVersion = cached ? resolveTargetVersionFromCache(cached, channel) : null;
1832
+ const updateAvailable = installedVersion !== null && latestVersion !== null && semver.valid(installedVersion) !== null && semver.valid(latestVersion) !== null && semver.gt(latestVersion, installedVersion);
1833
+ return {
1834
+ id: pkg.id,
1835
+ display_name: pkg.displayName,
1836
+ package_name: pkg.packageName,
1837
+ installed: installedVersion !== null,
1838
+ installed_version: installedVersion,
1839
+ latest_version: latestVersion,
1840
+ latest_stable: cached?.latest_stable ?? null,
1841
+ latest_beta: cached?.latest_beta ?? null,
1842
+ update_available: updateAvailable
1843
+ };
1844
+ });
1845
+ }
1846
+ function buildCheckResult(currentVersion, cache, config, error, globalPrefix) {
1847
+ const packages = buildPackageResults(currentVersion, cache, cache.channel, globalPrefix);
1848
+ const primaryPackage = packages.find((pkg) => pkg.id === "myco");
1849
+ const targetVersion = primaryPackage?.latest_version ?? currentVersion;
1850
+ const latestStable = primaryPackage?.latest_stable ?? currentVersion;
1851
+ const latestBeta = primaryPackage?.latest_beta ?? null;
1852
+ const updateAvailable = packages.some((pkg) => pkg.installed && pkg.update_available);
1785
1853
  return {
1786
- update_available,
1854
+ update_available: updateAvailable,
1787
1855
  running_version: currentVersion,
1788
1856
  latest_version: targetVersion,
1789
- latest_stable: cache.latest_stable,
1790
- latest_beta: cache.latest_beta,
1857
+ latest_stable: latestStable,
1858
+ latest_beta: latestBeta,
1791
1859
  channel: cache.channel,
1792
1860
  check_interval_hours: config.check_interval_hours,
1793
1861
  last_check: cache.checked_at,
1794
- error
1862
+ error,
1863
+ packages
1795
1864
  };
1796
1865
  }
1797
1866
  function resolveGlobalPrefix() {
1798
1867
  return execFileSync("npm", ["prefix", "-g"], { encoding: "utf-8", timeout: 5e3 }).trim();
1799
1868
  }
1800
- function getInstalledVersion(globalPrefix) {
1869
+ function getInstalledVersion(globalPrefix, packageName = NPM_PACKAGE_NAME) {
1801
1870
  try {
1802
1871
  const pkgPath = path9.join(
1803
1872
  globalPrefix,
1804
1873
  "lib",
1805
1874
  "node_modules",
1806
- NPM_PACKAGE_NAME,
1875
+ packageName,
1807
1876
  "package.json"
1808
1877
  );
1809
1878
  const raw = fs9.readFileSync(pkgPath, "utf-8");
@@ -1813,25 +1882,51 @@ function getInstalledVersion(globalPrefix) {
1813
1882
  return null;
1814
1883
  }
1815
1884
  }
1816
- async function checkForUpdate(currentVersion) {
1885
+ async function checkForUpdate(currentVersion, globalPrefix = null) {
1817
1886
  const config = readUpdateConfig();
1818
1887
  const existingCache = readCachedCheck();
1819
- let distTags;
1820
- let fetchError = null;
1821
- try {
1822
- const response = await fetch(NPM_REGISTRY_URL, {
1823
- signal: AbortSignal.timeout(REGISTRY_FETCH_TIMEOUT_MS)
1824
- });
1825
- if (!response.ok) {
1826
- throw new Error(`Registry responded with ${response.status}`);
1888
+ const freshPackages = {};
1889
+ const fetchErrors = [];
1890
+ const registryChecks = await Promise.allSettled(
1891
+ UPDATE_PACKAGES.map(async (pkg) => {
1892
+ const response = await fetch(packageRegistryUrl(pkg.packageName), {
1893
+ signal: AbortSignal.timeout(REGISTRY_FETCH_TIMEOUT_MS)
1894
+ });
1895
+ if (!response.ok) {
1896
+ throw new Error(`${pkg.packageName}: registry responded with ${response.status}`);
1897
+ }
1898
+ const data = await response.json();
1899
+ return {
1900
+ id: pkg.id,
1901
+ package_name: pkg.packageName,
1902
+ latest_stable: data["dist-tags"].latest,
1903
+ latest_beta: data["dist-tags"].beta ?? null
1904
+ };
1905
+ })
1906
+ );
1907
+ for (const result of registryChecks) {
1908
+ if (result.status === "fulfilled") {
1909
+ freshPackages[result.value.id] = {
1910
+ package_name: result.value.package_name,
1911
+ latest_stable: result.value.latest_stable,
1912
+ latest_beta: result.value.latest_beta
1913
+ };
1914
+ continue;
1827
1915
  }
1828
- const data = await response.json();
1829
- distTags = data["dist-tags"];
1830
- } catch (err) {
1831
- fetchError = err instanceof Error ? err.message : String(err);
1832
- if (existingCache !== null) {
1833
- return buildCheckResult(currentVersion, existingCache, config, fetchError);
1916
+ const message = result.reason instanceof Error ? result.reason.message : String(result.reason);
1917
+ fetchErrors.push(message);
1918
+ }
1919
+ if (existingCache !== null) {
1920
+ for (const pkg of UPDATE_PACKAGES) {
1921
+ if (freshPackages[pkg.id] !== void 0) continue;
1922
+ const cached = existingCache.packages[pkg.id];
1923
+ if (cached) {
1924
+ freshPackages[pkg.id] = cached;
1925
+ }
1834
1926
  }
1927
+ }
1928
+ if (Object.keys(freshPackages).length === 0) {
1929
+ const fetchError = fetchErrors[0] ?? "registry fetch failed";
1835
1930
  return {
1836
1931
  update_available: false,
1837
1932
  running_version: currentVersion,
@@ -1841,31 +1936,33 @@ async function checkForUpdate(currentVersion) {
1841
1936
  channel: config.channel,
1842
1937
  check_interval_hours: config.check_interval_hours,
1843
1938
  last_check: (/* @__PURE__ */ new Date()).toISOString(),
1844
- error: fetchError
1939
+ error: fetchError,
1940
+ packages: buildPackageResults(
1941
+ currentVersion,
1942
+ { checked_at: (/* @__PURE__ */ new Date()).toISOString(), channel: config.channel, packages: {} },
1943
+ config.channel,
1944
+ globalPrefix
1945
+ )
1845
1946
  };
1846
1947
  }
1847
- const latestStable = distTags.latest;
1848
- const latestBeta = distTags.beta ?? null;
1849
- const targetVersion = resolveTargetVersion(distTags, config.channel);
1850
1948
  const freshCache = {
1851
1949
  checked_at: (/* @__PURE__ */ new Date()).toISOString(),
1852
- current_version: currentVersion,
1853
- latest_stable: latestStable,
1854
- latest_beta: latestBeta,
1855
- channel: config.channel
1950
+ channel: config.channel,
1951
+ packages: freshPackages
1856
1952
  };
1857
1953
  try {
1858
1954
  fs9.mkdirSync(path9.dirname(UPDATE_CHECK_CACHE_PATH), { recursive: true });
1859
1955
  fs9.writeFileSync(UPDATE_CHECK_CACHE_PATH, JSON.stringify(freshCache, null, 2), "utf-8");
1860
1956
  } catch {
1861
1957
  }
1862
- return buildCheckResult(currentVersion, freshCache, config, null);
1958
+ const error = fetchErrors.length > 0 ? fetchErrors.join("; ") : null;
1959
+ return buildCheckResult(currentVersion, freshCache, config, error, globalPrefix);
1863
1960
  }
1864
- function statusFromCache(currentVersion, cache, config) {
1961
+ function statusFromCache(currentVersion, cache, config, globalPrefix = null) {
1865
1962
  const resolvedCache = cache !== void 0 ? cache : readCachedCheck();
1866
1963
  if (resolvedCache === null) return null;
1867
1964
  const resolvedConfig = config !== void 0 ? config : readUpdateConfig();
1868
- return buildCheckResult(currentVersion, resolvedCache, resolvedConfig, null);
1965
+ return buildCheckResult(currentVersion, resolvedCache, resolvedConfig, null, globalPrefix);
1869
1966
  }
1870
1967
 
1871
1968
  // src/daemon/update-installer.ts
@@ -1874,14 +1971,14 @@ import os6 from "os";
1874
1971
  import path10 from "path";
1875
1972
  import { spawn as spawn2 } from "child_process";
1876
1973
  function generateUpdateScript(params) {
1877
- const { targetVersion, projectRoot, vaultDir, mycoBinary } = params;
1878
- const packageSpec = `${NPM_PACKAGE_NAME}@${targetVersion}`;
1974
+ const { packageSpecs, projectRoot, vaultDir, mycoBinary } = params;
1975
+ const installArgs = packageSpecs.map((spec) => JSON.stringify(spec)).join(" ");
1879
1976
  const quotedProjectRoot = JSON.stringify(projectRoot);
1880
1977
  const quotedVaultDir = JSON.stringify(vaultDir);
1881
1978
  const quotedMycoBinary = JSON.stringify(mycoBinary);
1882
1979
  const quotedErrorPath = JSON.stringify(UPDATE_ERROR_PATH);
1883
1980
  const errorJson = JSON.stringify(
1884
- JSON.stringify({ error: `npm install failed for ${packageSpec}` })
1981
+ JSON.stringify({ error: `npm install failed for ${packageSpecs.join(", ")}` })
1885
1982
  );
1886
1983
  return `#!/bin/sh
1887
1984
  set -e
@@ -1891,7 +1988,7 @@ MYCO=${quotedMycoBinary}
1891
1988
  sleep ${UPDATE_SCRIPT_DELAY_SECONDS}
1892
1989
 
1893
1990
  # Attempt the update
1894
- if npm install -g ${packageSpec} 2>&1; then
1991
+ if npm install -g ${installArgs} 2>&1; then
1895
1992
  # Sync project files (gitignore, symbiont registration)
1896
1993
  "$MYCO" update --project ${quotedProjectRoot} || true
1897
1994
  # Clear any previous error
@@ -2009,10 +2106,10 @@ function createUpdateHandlers(deps) {
2009
2106
  const config = readUpdateConfig();
2010
2107
  const cache = readCachedCheck();
2011
2108
  if (isCacheStale(cache, config.check_interval_hours)) {
2012
- checkForUpdate(currentVersion).catch(() => {
2109
+ checkForUpdate(currentVersion, globalPrefix).catch(() => {
2013
2110
  });
2014
2111
  }
2015
- const status = statusFromCache(currentVersion, cache, config);
2112
+ const status = statusFromCache(currentVersion, cache, config, globalPrefix);
2016
2113
  if (!status) {
2017
2114
  return {
2018
2115
  body: {
@@ -2038,25 +2135,32 @@ function createUpdateHandlers(deps) {
2038
2135
  body: { error: "update_exempt", message: "Updates disabled in dev mode" }
2039
2136
  };
2040
2137
  }
2041
- const result = await checkForUpdate(currentVersion);
2138
+ const result = await checkForUpdate(currentVersion, globalPrefix);
2042
2139
  return { body: { exempt: false, ...result } };
2043
2140
  }
2044
2141
  async function handleUpdateApply(_req) {
2045
2142
  if (isUpdateExempt()) {
2046
2143
  return { status: 400, body: { error: "update_exempt" } };
2047
2144
  }
2048
- const status = statusFromCache(currentVersion);
2049
- if (!status || !status.update_available) {
2145
+ const status = statusFromCache(currentVersion, void 0, void 0, globalPrefix);
2146
+ const packageSpecs = (status?.packages ?? []).filter((pkg) => pkg.installed && pkg.update_available && pkg.latest_version).map((pkg) => `${pkg.package_name}@${pkg.latest_version}`);
2147
+ if (!status || packageSpecs.length === 0) {
2050
2148
  return { status: 400, body: { error: "no_update_available" } };
2051
2149
  }
2052
2150
  spawnUpdateScript({
2053
- targetVersion: status.latest_version,
2151
+ packageSpecs,
2054
2152
  projectRoot,
2055
2153
  vaultDir,
2056
2154
  mycoBinary: resolveMycoBinary()
2057
2155
  });
2058
2156
  scheduleShutdown();
2059
- return { body: { status: "applying", version: status.latest_version } };
2157
+ return {
2158
+ body: {
2159
+ status: "applying",
2160
+ version: status.latest_version,
2161
+ packages: packageSpecs
2162
+ }
2163
+ };
2060
2164
  }
2061
2165
  async function handleUpdateChannel(req) {
2062
2166
  const parsed = ChannelBodySchema.safeParse(req.body);
@@ -2067,7 +2171,7 @@ function createUpdateHandlers(deps) {
2067
2171
  const config = readUpdateConfig();
2068
2172
  writeUpdateConfig({ ...config, channel });
2069
2173
  clearCachedCheck();
2070
- const channelStatus = statusFromCache(currentVersion);
2174
+ const channelStatus = statusFromCache(currentVersion, void 0, void 0, globalPrefix);
2071
2175
  if (!channelStatus) {
2072
2176
  return {
2073
2177
  body: {
@@ -2444,6 +2548,18 @@ var TeamSyncClient = class _TeamSyncClient {
2444
2548
  const res = await this.request("GET", "/config");
2445
2549
  return res;
2446
2550
  }
2551
+ async getCollectiveStatus() {
2552
+ const res = await this.request("GET", "/collective/status");
2553
+ return res;
2554
+ }
2555
+ async getCollectiveSettings() {
2556
+ const res = await this.request("GET", "/collective/settings");
2557
+ return res;
2558
+ }
2559
+ async collectiveQuery(tool, args = {}) {
2560
+ const res = await this.request("POST", "/collective/query", { tool, args });
2561
+ return res;
2562
+ }
2447
2563
  // ---------------------------------------------------------------------------
2448
2564
  // MCP token accessors
2449
2565
  // ---------------------------------------------------------------------------
@@ -2484,6 +2600,12 @@ var TeamSyncClient = class _TeamSyncClient {
2484
2600
  };
2485
2601
 
2486
2602
  // src/daemon/api/team-connect.ts
2603
+ var TEAM_CONFIG_DIR = ".myco-team";
2604
+ var TEAM_CONFIG_FILE = "config.json";
2605
+ function readInstalledTeamPackageVersion() {
2606
+ const config = readJsonConfig(resolveHomeConfigPath(TEAM_CONFIG_DIR, TEAM_CONFIG_FILE));
2607
+ return config?.package_version?.trim() || null;
2608
+ }
2487
2609
  function createTeamHandlers(deps) {
2488
2610
  const { vaultDir, machineId, logger } = deps;
2489
2611
  async function handleConnect(req) {
@@ -2538,6 +2660,7 @@ function createTeamHandlers(deps) {
2538
2660
  const client = deps.getTeamClient();
2539
2661
  const secrets = readSecrets(vaultDir);
2540
2662
  const hasApiKey = Boolean(secrets[TEAM_API_KEY_SECRET]);
2663
+ const installedTeamPackageVersion = readInstalledTeamPackageVersion();
2541
2664
  let healthy = false;
2542
2665
  let healthError;
2543
2666
  if (client && config.team.enabled) {
@@ -2555,6 +2678,14 @@ function createTeamHandlers(deps) {
2555
2678
  deadLetterCount = countDeadLettered();
2556
2679
  } catch {
2557
2680
  }
2681
+ let collectiveStatus = null;
2682
+ if (client && config.team.enabled) {
2683
+ try {
2684
+ collectiveStatus = await client.getCollectiveStatus();
2685
+ } catch {
2686
+ collectiveStatus = null;
2687
+ }
2688
+ }
2558
2689
  return {
2559
2690
  body: {
2560
2691
  enabled: config.team.enabled,
@@ -2567,8 +2698,16 @@ function createTeamHandlers(deps) {
2567
2698
  dead_letter_count: deadLetterCount,
2568
2699
  machine_id: machineId,
2569
2700
  package_version: getPluginVersion(),
2701
+ installed_team_package_version: installedTeamPackageVersion,
2570
2702
  deployed_worker_version: config.team.deployed_worker_version ?? null,
2571
- worker_update_available: config.team.enabled ? config.team.deployed_worker_version !== getPluginVersion() : false,
2703
+ worker_update_available: config.team.enabled && Boolean(installedTeamPackageVersion) && config.team.deployed_worker_version !== installedTeamPackageVersion,
2704
+ collective_connected: collectiveStatus?.connected ?? false,
2705
+ collective_url: collectiveStatus?.collective_url ?? null,
2706
+ collective_project_id: collectiveStatus?.project_id ?? null,
2707
+ collective_last_settings_sync: collectiveStatus?.last_settings_sync ?? null,
2708
+ collective_last_heartbeat: collectiveStatus?.last_heartbeat ?? null,
2709
+ collective_capabilities: collectiveStatus?.capabilities ?? [],
2710
+ collective_settings: collectiveStatus?.settings ?? {},
2572
2711
  schema_version: SCHEMA_VERSION,
2573
2712
  sync_protocol_version: SYNC_PROTOCOL_VERSION,
2574
2713
  mcp_token: client?.getMcpToken() ?? null,
@@ -2585,7 +2724,7 @@ function createTeamHandlers(deps) {
2585
2724
  return { body: { retried: count } };
2586
2725
  }
2587
2726
  async function handleUpgradeWorker(_req) {
2588
- const { upgradeWorker } = await import("./team-DPNP2RN7.js");
2727
+ const { upgradeWorker } = await import("./team-N6TXS2PF.js");
2589
2728
  logger.info("team-sync.upgrade.start", "Starting worker upgrade");
2590
2729
  const result = upgradeWorker(vaultDir);
2591
2730
  if (!result.success) {
@@ -2634,6 +2773,96 @@ function createTeamHandlers(deps) {
2634
2773
  return { handleConnect, handleDisconnect, handleStatus, handleBackfill, handleRetryFailed, handleUpgradeWorker, handleRotateMcpToken };
2635
2774
  }
2636
2775
 
2776
+ // src/daemon/api/collective.ts
2777
+ function createCollectiveHandlers(deps) {
2778
+ async function requireTeamClient() {
2779
+ const client = deps.getTeamClient();
2780
+ if (!client) {
2781
+ throw new Error("Team sync is not connected");
2782
+ }
2783
+ return client;
2784
+ }
2785
+ async function handleStatus(_req) {
2786
+ try {
2787
+ const client = await requireTeamClient();
2788
+ return { body: await client.getCollectiveStatus() };
2789
+ } catch (error) {
2790
+ return {
2791
+ status: 400,
2792
+ body: { error: error instanceof Error ? error.message : String(error) }
2793
+ };
2794
+ }
2795
+ }
2796
+ async function handleSearch(req) {
2797
+ try {
2798
+ const client = await requireTeamClient();
2799
+ const query = req.query.q;
2800
+ if (!query) {
2801
+ return { status: 400, body: { error: "Missing q parameter" } };
2802
+ }
2803
+ const project = req.query.project;
2804
+ const limit = req.query.limit ? Number(req.query.limit) : void 0;
2805
+ return {
2806
+ body: await client.collectiveQuery("collective_search", { query, project, limit })
2807
+ };
2808
+ } catch (error) {
2809
+ return {
2810
+ status: 400,
2811
+ body: { error: error instanceof Error ? error.message : String(error) }
2812
+ };
2813
+ }
2814
+ }
2815
+ async function handleProjects(_req) {
2816
+ try {
2817
+ const client = await requireTeamClient();
2818
+ return {
2819
+ body: await client.collectiveQuery("collective_projects", {})
2820
+ };
2821
+ } catch (error) {
2822
+ return {
2823
+ status: 400,
2824
+ body: { error: error instanceof Error ? error.message : String(error) }
2825
+ };
2826
+ }
2827
+ }
2828
+ async function handleProject(req) {
2829
+ try {
2830
+ const client = await requireTeamClient();
2831
+ const project = req.query.project;
2832
+ if (!project) {
2833
+ return { status: 400, body: { error: "Missing project parameter" } };
2834
+ }
2835
+ const includeDigest = req.query.include_digest === "true";
2836
+ return {
2837
+ body: await client.collectiveQuery("collective_project", { project, include_digest: includeDigest })
2838
+ };
2839
+ } catch (error) {
2840
+ return {
2841
+ status: 400,
2842
+ body: { error: error instanceof Error ? error.message : String(error) }
2843
+ };
2844
+ }
2845
+ }
2846
+ async function handleSettings(_req) {
2847
+ try {
2848
+ const client = await requireTeamClient();
2849
+ return { body: await client.getCollectiveSettings() };
2850
+ } catch (error) {
2851
+ return {
2852
+ status: 400,
2853
+ body: { error: error instanceof Error ? error.message : String(error) }
2854
+ };
2855
+ }
2856
+ }
2857
+ return {
2858
+ handleStatus,
2859
+ handleSearch,
2860
+ handleProjects,
2861
+ handleProject,
2862
+ handleSettings
2863
+ };
2864
+ }
2865
+
2637
2866
  // src/daemon/api/session-lifecycle.ts
2638
2867
  var RegisterBody = external_exports.object({
2639
2868
  session_id: external_exports.string(),
@@ -3825,6 +4054,26 @@ async function handleGetDigest(req) {
3825
4054
  }
3826
4055
 
3827
4056
  // src/daemon/api/search.ts
4057
+ var SEARCH_NAMESPACE_RULES = [
4058
+ { key: "all", value: void 0 },
4059
+ { key: "session", value: "sessions" },
4060
+ { key: "sessions", value: "sessions" },
4061
+ { key: "spore", value: "spores" },
4062
+ { key: "spores", value: "spores" },
4063
+ { key: "plan", value: "plans" },
4064
+ { key: "plans", value: "plans" },
4065
+ { key: "artifact", value: "artifacts" },
4066
+ { key: "artifacts", value: "artifacts" },
4067
+ { key: "skill", value: "skill_records" },
4068
+ { key: "skill_records", value: "skill_records" }
4069
+ ];
4070
+ function normalizeSearchNamespace(value) {
4071
+ if (!value) return void 0;
4072
+ for (const rule of SEARCH_NAMESPACE_RULES) {
4073
+ if (rule.key === value) return rule.value;
4074
+ }
4075
+ return value;
4076
+ }
3828
4077
  function createSearchHandler(deps) {
3829
4078
  return async function handleSearch(req) {
3830
4079
  const query = req.query.q;
@@ -3845,7 +4094,7 @@ function createSearchHandler(deps) {
3845
4094
  }
3846
4095
  return { body: { mode: "semantic", results: [], provider_unavailable: true } };
3847
4096
  }
3848
- const searchNamespace = namespace ?? type;
4097
+ const searchNamespace = normalizeSearchNamespace(namespace ?? type);
3849
4098
  const vectorResults = deps.embeddingManager.searchVectors(queryVector, {
3850
4099
  namespace: searchNamespace,
3851
4100
  limit,
@@ -5922,7 +6171,7 @@ async function registerScheduledTasks(powerManager, deps) {
5922
6171
  logger.info(LOG_KINDS.AGENT_RUN, "Scheduled agent tasks disabled globally (agent.scheduled_tasks_enabled: false)");
5923
6172
  return;
5924
6173
  }
5925
- const { loadAllTasks: loadAllTasks2 } = await import("./registry-O2NZLO3V.js");
6174
+ const { loadAllTasks: loadAllTasks2 } = await import("./registry-X5FDGYXT.js");
5926
6175
  const allTasks = Array.from(loadAllTasks2(definitionsDir, vaultDir).values());
5927
6176
  const taskAgentMap = /* @__PURE__ */ new Map();
5928
6177
  for (const task of allTasks) {
@@ -5948,7 +6197,7 @@ async function registerScheduledTasks(powerManager, deps) {
5948
6197
  else runningTasks.delete(name);
5949
6198
  },
5950
6199
  runTask: async (taskName) => {
5951
- const { runAgent } = await import("./executor-UYIZC3L5.js");
6200
+ const { runAgent } = await import("./executor-ICTRRUBY.js");
5952
6201
  const taskConfig = config.agent.tasks?.[taskName];
5953
6202
  const projectRoot = resolve(vaultDir, "..");
5954
6203
  const built = buildTaskInstruction(taskName, taskConfig?.params, taskAgentMap.get(taskName), projectRoot, embeddingManager);
@@ -6118,7 +6367,7 @@ function createMcpProxyHandlers(deps) {
6118
6367
  name: USER_AGENT_NAME,
6119
6368
  created_at: now
6120
6369
  });
6121
- const { insertResolutionEvent } = await import("./resolution-events-XWYLLDRK.js");
6370
+ const { insertResolutionEvent } = await import("./resolution-events-MVIZMONR.js");
6122
6371
  const resolutionId = `res-${randomBytes(RESOLUTION_ID_RANDOM_BYTES).toString("hex")}`;
6123
6372
  insertResolutionEvent({
6124
6373
  id: resolutionId,
@@ -6246,7 +6495,7 @@ function createAgentRunHandlers(deps) {
6246
6495
  };
6247
6496
  }
6248
6497
  }
6249
- const { runAgent } = await import("./executor-UYIZC3L5.js");
6498
+ const { runAgent } = await import("./executor-ICTRRUBY.js");
6250
6499
  const resultPromise = runAgent(vaultDir, {
6251
6500
  task,
6252
6501
  instruction,
@@ -7069,7 +7318,7 @@ function createStopProcessor(deps) {
7069
7318
  if (config.agent.summary_batch_interval <= 0) return;
7070
7319
  if (config.agent.event_tasks_enabled === false) return;
7071
7320
  try {
7072
- const { runAgent } = await import("./executor-UYIZC3L5.js");
7321
+ const { runAgent } = await import("./executor-ICTRRUBY.js");
7073
7322
  runAgent(vaultDir, {
7074
7323
  task: "title-summary",
7075
7324
  instruction: `Process session ${sessionId} only`,
@@ -7677,7 +7926,7 @@ async function main() {
7677
7926
  const databaseManager = new DatabaseMaintenanceManager(vaultDbPath(vaultDir), vaultDir, logger);
7678
7927
  let definitionsDir;
7679
7928
  try {
7680
- const { registerBuiltInAgentsAndTasks, resolveDefinitionsDir: resolveDefinitionsDir2 } = await import("./loader-SKKUMT5C.js");
7929
+ const { registerBuiltInAgentsAndTasks, resolveDefinitionsDir: resolveDefinitionsDir2 } = await import("./loader-VPE4RCIF.js");
7681
7930
  definitionsDir = resolveDefinitionsDir2();
7682
7931
  await registerBuiltInAgentsAndTasks(definitionsDir, vaultDir);
7683
7932
  logger.info(LOG_KINDS.AGENT_TASK, "Built-in agents and tasks registered");
@@ -7915,6 +8164,14 @@ async function main() {
7915
8164
  server.registerRoute("POST", "/api/team/retry-failed", teamHandlers.handleRetryFailed);
7916
8165
  server.registerRoute("POST", "/api/team/upgrade-worker", teamHandlers.handleUpgradeWorker);
7917
8166
  server.registerRoute("POST", "/api/team/rotate-mcp-token", teamHandlers.handleRotateMcpToken);
8167
+ const collectiveHandlers = createCollectiveHandlers({
8168
+ getTeamClient: teamSync.getTeamClient
8169
+ });
8170
+ server.registerRoute("GET", "/api/collective/status", collectiveHandlers.handleStatus);
8171
+ server.registerRoute("GET", "/api/collective/search", collectiveHandlers.handleSearch);
8172
+ server.registerRoute("GET", "/api/collective/projects", collectiveHandlers.handleProjects);
8173
+ server.registerRoute("GET", "/api/collective/project", collectiveHandlers.handleProject);
8174
+ server.registerRoute("GET", "/api/collective/settings", collectiveHandlers.handleSettings);
7918
8175
  server.registerRoute("GET", "/api/search", createSearchHandler({ embeddingManager, getTeamClient: teamSync.getTeamClient, machineId }));
7919
8176
  server.registerRoute("GET", "/api/activity", handleGetFeed);
7920
8177
  server.registerRoute("GET", "/api/embedding/status", async () => handleGetEmbeddingStatus(vaultDir));
@@ -7987,4 +8244,4 @@ export {
7987
8244
  handleUserPrompt,
7988
8245
  main
7989
8246
  };
7990
- //# sourceMappingURL=main-5THODR77.js.map
8247
+ //# sourceMappingURL=main-EIKBLOUL.js.map