@goondocks/myco 0.18.1 → 0.19.1

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