botmux 2.111.0 → 2.112.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 (1041) hide show
  1. package/README.en.md +19 -7
  2. package/README.md +19 -7
  3. package/dist/adapters/adopt-route.d.ts.map +1 -1
  4. package/dist/adapters/adopt-route.js +2 -1
  5. package/dist/adapters/adopt-route.js.map +1 -1
  6. package/dist/adapters/backend/herdr-backend.d.ts +29 -0
  7. package/dist/adapters/backend/herdr-backend.d.ts.map +1 -1
  8. package/dist/adapters/backend/herdr-backend.js +167 -0
  9. package/dist/adapters/backend/herdr-backend.js.map +1 -1
  10. package/dist/adapters/backend/riff-backend.js +2 -2
  11. package/dist/adapters/backend/sandbox.d.ts +61 -6
  12. package/dist/adapters/backend/sandbox.d.ts.map +1 -1
  13. package/dist/adapters/backend/sandbox.js +235 -43
  14. package/dist/adapters/backend/sandbox.js.map +1 -1
  15. package/dist/adapters/backend/tmux-backend.d.ts +1 -0
  16. package/dist/adapters/backend/tmux-backend.d.ts.map +1 -1
  17. package/dist/adapters/backend/tmux-backend.js +1 -0
  18. package/dist/adapters/backend/tmux-backend.js.map +1 -1
  19. package/dist/adapters/cli/claude-code.d.ts +2 -0
  20. package/dist/adapters/cli/claude-code.d.ts.map +1 -1
  21. package/dist/adapters/cli/claude-code.js +7 -0
  22. package/dist/adapters/cli/claude-code.js.map +1 -1
  23. package/dist/adapters/cli/codex-app-turn.d.ts +16 -0
  24. package/dist/adapters/cli/codex-app-turn.d.ts.map +1 -1
  25. package/dist/adapters/cli/codex-app-turn.js +26 -0
  26. package/dist/adapters/cli/codex-app-turn.js.map +1 -1
  27. package/dist/adapters/cli/codex.d.ts.map +1 -1
  28. package/dist/adapters/cli/codex.js +1 -0
  29. package/dist/adapters/cli/codex.js.map +1 -1
  30. package/dist/adapters/cli/grok.d.ts +8 -6
  31. package/dist/adapters/cli/grok.d.ts.map +1 -1
  32. package/dist/adapters/cli/grok.js +14 -6
  33. package/dist/adapters/cli/grok.js.map +1 -1
  34. package/dist/adapters/cli/read-isolation.d.ts +40 -14
  35. package/dist/adapters/cli/read-isolation.d.ts.map +1 -1
  36. package/dist/adapters/cli/read-isolation.js +116 -19
  37. package/dist/adapters/cli/read-isolation.js.map +1 -1
  38. package/dist/adapters/cli/runner-control-channel.d.ts +32 -0
  39. package/dist/adapters/cli/runner-control-channel.d.ts.map +1 -0
  40. package/dist/adapters/cli/runner-control-channel.js +104 -0
  41. package/dist/adapters/cli/runner-control-channel.js.map +1 -0
  42. package/dist/adapters/cli/shared-hints.d.ts +1 -1
  43. package/dist/adapters/cli/shared-hints.d.ts.map +1 -1
  44. package/dist/adapters/cli/shared-hints.js +9 -0
  45. package/dist/adapters/cli/shared-hints.js.map +1 -1
  46. package/dist/adapters/cli/traex.d.ts.map +1 -1
  47. package/dist/adapters/cli/traex.js +100 -64
  48. package/dist/adapters/cli/traex.js.map +1 -1
  49. package/dist/adapters/cli/types.d.ts +13 -0
  50. package/dist/adapters/cli/types.d.ts.map +1 -1
  51. package/dist/bot-registry.d.ts +36 -27
  52. package/dist/bot-registry.d.ts.map +1 -1
  53. package/dist/bot-registry.js +354 -8
  54. package/dist/bot-registry.js.map +1 -1
  55. package/dist/cli/saved-workflow.d.ts +25 -0
  56. package/dist/cli/saved-workflow.d.ts.map +1 -0
  57. package/dist/cli/saved-workflow.js +338 -0
  58. package/dist/cli/saved-workflow.js.map +1 -0
  59. package/dist/cli/send-dispatch.d.ts +18 -3
  60. package/dist/cli/send-dispatch.d.ts.map +1 -1
  61. package/dist/cli/send-dispatch.js +22 -3
  62. package/dist/cli/send-dispatch.js.map +1 -1
  63. package/dist/cli/v3-run-cancel.d.ts +47 -0
  64. package/dist/cli/v3-run-cancel.d.ts.map +1 -0
  65. package/dist/cli/v3-run-cancel.js +96 -0
  66. package/dist/cli/v3-run-cancel.js.map +1 -0
  67. package/dist/cli/vc-agent.d.ts.map +1 -1
  68. package/dist/cli/vc-agent.js +54 -1
  69. package/dist/cli/vc-agent.js.map +1 -1
  70. package/dist/cli/workflow-migration.d.ts +39 -0
  71. package/dist/cli/workflow-migration.d.ts.map +1 -0
  72. package/dist/cli/workflow-migration.js +302 -0
  73. package/dist/cli/workflow-migration.js.map +1 -0
  74. package/dist/cli/workflow-run-archive.d.ts +29 -0
  75. package/dist/cli/workflow-run-archive.d.ts.map +1 -0
  76. package/dist/cli/workflow-run-archive.js +183 -0
  77. package/dist/cli/workflow-run-archive.js.map +1 -0
  78. package/dist/cli/workflow.d.ts +5 -10
  79. package/dist/cli/workflow.d.ts.map +1 -1
  80. package/dist/cli/workflow.js +85 -764
  81. package/dist/cli/workflow.js.map +1 -1
  82. package/dist/cli.d.ts.map +1 -1
  83. package/dist/cli.js +1018 -191
  84. package/dist/cli.js.map +1 -1
  85. package/dist/codex-app-runner.js +30 -21
  86. package/dist/codex-app-runner.js.map +1 -1
  87. package/dist/core/command-handler.d.ts.map +1 -1
  88. package/dist/core/command-handler.js +21 -9
  89. package/dist/core/command-handler.js.map +1 -1
  90. package/dist/core/current-turn-provenance.d.ts +39 -0
  91. package/dist/core/current-turn-provenance.d.ts.map +1 -0
  92. package/dist/core/current-turn-provenance.js +122 -0
  93. package/dist/core/current-turn-provenance.js.map +1 -0
  94. package/dist/core/daemon-ipc-auth.d.ts +20 -0
  95. package/dist/core/daemon-ipc-auth.d.ts.map +1 -0
  96. package/dist/core/daemon-ipc-auth.js +44 -0
  97. package/dist/core/daemon-ipc-auth.js.map +1 -0
  98. package/dist/core/daemon-ipc-session-auth.d.ts +37 -0
  99. package/dist/core/daemon-ipc-session-auth.d.ts.map +1 -0
  100. package/dist/core/daemon-ipc-session-auth.js +35 -0
  101. package/dist/core/daemon-ipc-session-auth.js.map +1 -0
  102. package/dist/core/dashboard-command/index.d.ts +0 -2
  103. package/dist/core/dashboard-command/index.d.ts.map +1 -1
  104. package/dist/core/dashboard-command/index.js +2 -2
  105. package/dist/core/dashboard-command/index.js.map +1 -1
  106. package/dist/core/dashboard-command/stub.d.ts +1 -1
  107. package/dist/core/dashboard-command/stub.d.ts.map +1 -1
  108. package/dist/core/dashboard-command/stub.js +0 -1
  109. package/dist/core/dashboard-command/stub.js.map +1 -1
  110. package/dist/core/dashboard-ipc-server.d.ts +11 -2
  111. package/dist/core/dashboard-ipc-server.d.ts.map +1 -1
  112. package/dist/core/dashboard-ipc-server.js +266 -41
  113. package/dist/core/dashboard-ipc-server.js.map +1 -1
  114. package/dist/core/dashboard-secret.d.ts +3 -0
  115. package/dist/core/dashboard-secret.d.ts.map +1 -0
  116. package/dist/core/dashboard-secret.js +7 -0
  117. package/dist/core/dashboard-secret.js.map +1 -0
  118. package/dist/core/data-dir.d.ts +24 -0
  119. package/dist/core/data-dir.d.ts.map +1 -0
  120. package/dist/core/data-dir.js +48 -0
  121. package/dist/core/data-dir.js.map +1 -0
  122. package/dist/core/inflight-input-tracker.d.ts +4 -2
  123. package/dist/core/inflight-input-tracker.d.ts.map +1 -1
  124. package/dist/core/inflight-input-tracker.js +6 -5
  125. package/dist/core/inflight-input-tracker.js.map +1 -1
  126. package/dist/core/inject-queue-policy.d.ts +70 -0
  127. package/dist/core/inject-queue-policy.d.ts.map +1 -0
  128. package/dist/core/inject-queue-policy.js +30 -0
  129. package/dist/core/inject-queue-policy.js.map +1 -0
  130. package/dist/core/maintenance.d.ts +1 -1
  131. package/dist/core/maintenance.d.ts.map +1 -1
  132. package/dist/core/maintenance.js +3 -2
  133. package/dist/core/maintenance.js.map +1 -1
  134. package/dist/core/managed-origin-capability.d.ts +30 -0
  135. package/dist/core/managed-origin-capability.d.ts.map +1 -0
  136. package/dist/core/managed-origin-capability.js +88 -0
  137. package/dist/core/managed-origin-capability.js.map +1 -0
  138. package/dist/core/role-library.d.ts +15 -0
  139. package/dist/core/role-library.d.ts.map +1 -0
  140. package/dist/core/role-library.js +75 -0
  141. package/dist/core/role-library.js.map +1 -0
  142. package/dist/core/session-cwd.d.ts +14 -0
  143. package/dist/core/session-cwd.d.ts.map +1 -0
  144. package/dist/core/session-cwd.js +17 -0
  145. package/dist/core/session-cwd.js.map +1 -0
  146. package/dist/core/session-manager.d.ts +4 -1
  147. package/dist/core/session-manager.d.ts.map +1 -1
  148. package/dist/core/session-manager.js +27 -8
  149. package/dist/core/session-manager.js.map +1 -1
  150. package/dist/core/session-marker.d.ts +22 -0
  151. package/dist/core/session-marker.d.ts.map +1 -1
  152. package/dist/core/session-marker.js +185 -20
  153. package/dist/core/session-marker.js.map +1 -1
  154. package/dist/core/slash-inject.d.ts +15 -0
  155. package/dist/core/slash-inject.d.ts.map +1 -0
  156. package/dist/core/slash-inject.js +25 -0
  157. package/dist/core/slash-inject.js.map +1 -0
  158. package/dist/core/terminal-url.d.ts +1 -0
  159. package/dist/core/terminal-url.d.ts.map +1 -1
  160. package/dist/core/terminal-url.js +14 -8
  161. package/dist/core/terminal-url.js.map +1 -1
  162. package/dist/core/terminal-write-auth.d.ts +26 -0
  163. package/dist/core/terminal-write-auth.d.ts.map +1 -1
  164. package/dist/core/terminal-write-auth.js +48 -3
  165. package/dist/core/terminal-write-auth.js.map +1 -1
  166. package/dist/core/trigger-session.d.ts +24 -1
  167. package/dist/core/trigger-session.d.ts.map +1 -1
  168. package/dist/core/trigger-session.js +106 -15
  169. package/dist/core/trigger-session.js.map +1 -1
  170. package/dist/core/types.d.ts +26 -1
  171. package/dist/core/types.d.ts.map +1 -1
  172. package/dist/core/types.js +10 -0
  173. package/dist/core/types.js.map +1 -1
  174. package/dist/core/worker-pool.d.ts +65 -2
  175. package/dist/core/worker-pool.d.ts.map +1 -1
  176. package/dist/core/worker-pool.js +459 -39
  177. package/dist/core/worker-pool.js.map +1 -1
  178. package/dist/daemon.d.ts +249 -8
  179. package/dist/daemon.d.ts.map +1 -1
  180. package/dist/daemon.js +7383 -1195
  181. package/dist/daemon.js.map +1 -1
  182. package/dist/dashboard/aggregator.d.ts +1 -1
  183. package/dist/dashboard/aggregator.d.ts.map +1 -1
  184. package/dist/dashboard/aggregator.js +2 -2
  185. package/dist/dashboard/aggregator.js.map +1 -1
  186. package/dist/dashboard/auth.d.ts +3 -8
  187. package/dist/dashboard/auth.d.ts.map +1 -1
  188. package/dist/dashboard/auth.js +63 -22
  189. package/dist/dashboard/auth.js.map +1 -1
  190. package/dist/dashboard/bot-onboarding.d.ts +5 -0
  191. package/dist/dashboard/bot-onboarding.d.ts.map +1 -1
  192. package/dist/dashboard/bot-onboarding.js +37 -0
  193. package/dist/dashboard/bot-onboarding.js.map +1 -1
  194. package/dist/dashboard/connector-api.d.ts.map +1 -1
  195. package/dist/dashboard/connector-api.js +42 -2
  196. package/dist/dashboard/connector-api.js.map +1 -1
  197. package/dist/dashboard/daemon-internal-api.d.ts +0 -2
  198. package/dist/dashboard/daemon-internal-api.d.ts.map +1 -1
  199. package/dist/dashboard/daemon-internal-api.js +26 -93
  200. package/dist/dashboard/daemon-internal-api.js.map +1 -1
  201. package/dist/dashboard/daemon-internal-client.d.ts.map +1 -1
  202. package/dist/dashboard/daemon-internal-client.js +2 -3
  203. package/dist/dashboard/daemon-internal-client.js.map +1 -1
  204. package/dist/dashboard/federation-api.js +1 -1
  205. package/dist/dashboard/federation-api.js.map +1 -1
  206. package/dist/dashboard/federation-spoke-api.js +1 -1
  207. package/dist/dashboard/federation-spoke-api.js.map +1 -1
  208. package/dist/dashboard/history-senders.d.ts +3 -0
  209. package/dist/dashboard/history-senders.d.ts.map +1 -1
  210. package/dist/dashboard/history-senders.js.map +1 -1
  211. package/dist/dashboard/http.d.ts +4 -0
  212. package/dist/dashboard/http.d.ts.map +1 -0
  213. package/dist/dashboard/http.js +6 -0
  214. package/dist/dashboard/http.js.map +1 -0
  215. package/dist/dashboard/registry.d.ts +4 -0
  216. package/dist/dashboard/registry.d.ts.map +1 -1
  217. package/dist/dashboard/registry.js.map +1 -1
  218. package/dist/dashboard/trigger-api.js +1 -1
  219. package/dist/dashboard/trigger-api.js.map +1 -1
  220. package/dist/dashboard/v3-runs-api.d.ts +13 -10
  221. package/dist/dashboard/v3-runs-api.d.ts.map +1 -1
  222. package/dist/dashboard/v3-runs-api.js +121 -4
  223. package/dist/dashboard/v3-runs-api.js.map +1 -1
  224. package/dist/dashboard/vc-consumer-profiles-api.d.ts +105 -0
  225. package/dist/dashboard/vc-consumer-profiles-api.d.ts.map +1 -0
  226. package/dist/dashboard/vc-consumer-profiles-api.js +312 -0
  227. package/dist/dashboard/vc-consumer-profiles-api.js.map +1 -0
  228. package/dist/dashboard/web/app.d.ts.map +1 -1
  229. package/dist/dashboard/web/app.js +7 -6
  230. package/dist/dashboard/web/app.js.map +1 -1
  231. package/dist/dashboard/web/bot-defaults-page.d.ts.map +1 -1
  232. package/dist/dashboard/web/bot-defaults-page.js +9 -14
  233. package/dist/dashboard/web/bot-defaults-page.js.map +1 -1
  234. package/dist/dashboard/web/bot-onboarding.d.ts.map +1 -1
  235. package/dist/dashboard/web/bot-onboarding.js +7 -3
  236. package/dist/dashboard/web/bot-onboarding.js.map +1 -1
  237. package/dist/dashboard/web/connectors-page.d.ts +5 -0
  238. package/dist/dashboard/web/connectors-page.d.ts.map +1 -1
  239. package/dist/dashboard/web/connectors-page.js +16 -12
  240. package/dist/dashboard/web/connectors-page.js.map +1 -1
  241. package/dist/dashboard/web/create-session-entry.d.ts +4 -0
  242. package/dist/dashboard/web/create-session-entry.d.ts.map +1 -0
  243. package/dist/dashboard/web/create-session-entry.js +17 -0
  244. package/dist/dashboard/web/create-session-entry.js.map +1 -0
  245. package/dist/dashboard/web/dashboard-components.d.ts +5 -0
  246. package/dist/dashboard/web/dashboard-components.d.ts.map +1 -1
  247. package/dist/dashboard/web/dashboard-components.js +29 -4
  248. package/dist/dashboard/web/dashboard-components.js.map +1 -1
  249. package/dist/dashboard/web/dashboard-routes.d.ts.map +1 -1
  250. package/dist/dashboard/web/dashboard-routes.js +0 -1
  251. package/dist/dashboard/web/dashboard-routes.js.map +1 -1
  252. package/dist/dashboard/web/i18n.d.ts.map +1 -1
  253. package/dist/dashboard/web/i18n.js +192 -382
  254. package/dist/dashboard/web/i18n.js.map +1 -1
  255. package/dist/dashboard/web/preferences.d.ts +3 -0
  256. package/dist/dashboard/web/preferences.d.ts.map +1 -1
  257. package/dist/dashboard/web/preferences.js +18 -0
  258. package/dist/dashboard/web/preferences.js.map +1 -1
  259. package/dist/dashboard/web/schedules-page.d.ts.map +1 -1
  260. package/dist/dashboard/web/schedules-page.js +4 -1
  261. package/dist/dashboard/web/schedules-page.js.map +1 -1
  262. package/dist/dashboard/web/sessions-page.d.ts.map +1 -1
  263. package/dist/dashboard/web/sessions-page.js +64 -18
  264. package/dist/dashboard/web/sessions-page.js.map +1 -1
  265. package/dist/dashboard/web/settings-page.d.ts.map +1 -1
  266. package/dist/dashboard/web/settings-page.js +2 -1
  267. package/dist/dashboard/web/settings-page.js.map +1 -1
  268. package/dist/dashboard/web/v3-api.d.ts +12 -2
  269. package/dist/dashboard/web/v3-api.d.ts.map +1 -1
  270. package/dist/dashboard/web/v3-api.js +34 -6
  271. package/dist/dashboard/web/v3-api.js.map +1 -1
  272. package/dist/dashboard/web/v3-components.d.ts +6 -0
  273. package/dist/dashboard/web/v3-components.d.ts.map +1 -1
  274. package/dist/dashboard/web/v3-components.js +66 -23
  275. package/dist/dashboard/web/v3-components.js.map +1 -1
  276. package/dist/dashboard/web/v3-model.js +1 -1
  277. package/dist/dashboard/web/v3-model.js.map +1 -1
  278. package/dist/dashboard/web/v3-terminal.js +2 -2
  279. package/dist/dashboard/web/v3-terminal.js.map +1 -1
  280. package/dist/dashboard/web/vc-consumer-profiles-section.d.ts +19 -0
  281. package/dist/dashboard/web/vc-consumer-profiles-section.d.ts.map +1 -0
  282. package/dist/dashboard/web/vc-consumer-profiles-section.js +382 -0
  283. package/dist/dashboard/web/vc-consumer-profiles-section.js.map +1 -0
  284. package/dist/dashboard/webhook-routes.d.ts.map +1 -1
  285. package/dist/dashboard/webhook-routes.js +29 -6
  286. package/dist/dashboard/webhook-routes.js.map +1 -1
  287. package/dist/dashboard-web/app.js +1 -1
  288. package/dist/dashboard-web/chunks/bot-defaults-page-RYBL4ZYE.js +4 -0
  289. package/dist/dashboard-web/chunks/{chunk-OEJIT66L.js → chunk-CMDPZOPK.js} +1 -1
  290. package/dist/dashboard-web/chunks/chunk-I35DXGM4.js +1 -0
  291. package/dist/dashboard-web/chunks/chunk-NYZHARIU.js +47 -0
  292. package/dist/dashboard-web/chunks/chunk-SZOB6VK2.js +1 -0
  293. package/dist/dashboard-web/chunks/{chunk-YQFXGRSD.js → chunk-YBOHL7T7.js} +1 -1
  294. package/dist/dashboard-web/chunks/chunk-YWCPDL4S.js +1 -0
  295. package/dist/dashboard-web/chunks/connectors-page-DAMP7TTV.js +1 -0
  296. package/dist/dashboard-web/chunks/{groups-page-5AJPPJH2.js → groups-page-BPFA356N.js} +1 -1
  297. package/dist/dashboard-web/chunks/{insights-page-R3DFECX4.js → insights-page-SHOPHTWY.js} +1 -1
  298. package/dist/dashboard-web/chunks/{monitor-room-NLMKJLDY.js → monitor-room-PXPJGZCN.js} +1 -1
  299. package/dist/dashboard-web/chunks/{monitoring-page-EHSOX4GV.js → monitoring-page-4DF54M5Y.js} +1 -1
  300. package/dist/dashboard-web/chunks/{office-page-OXJKFJ4R.js → office-page-6OHU6KMZ.js} +1 -1
  301. package/dist/dashboard-web/chunks/{overview-page-GJHIVXJF.js → overview-page-IHIZ6F5M.js} +1 -1
  302. package/dist/dashboard-web/chunks/{roles-page-6ZODQISW.js → roles-page-JYTBYKEF.js} +1 -1
  303. package/dist/dashboard-web/chunks/{schedules-page-DAGMHVCH.js → schedules-page-WJ72T7KV.js} +1 -1
  304. package/dist/dashboard-web/chunks/sessions-page-QC56OIAI.js +3 -0
  305. package/dist/dashboard-web/chunks/settings-page-TCKWEXTN.js +2 -0
  306. package/dist/dashboard-web/chunks/{skills-page-J7EVUHXP.js → skills-page-RJJNIECW.js} +1 -1
  307. package/dist/dashboard-web/chunks/{team-federation-page-YM5JBIII.js → team-federation-page-ZMDX3E7K.js} +1 -1
  308. package/dist/dashboard-web/chunks/v3-page-VLLAUQ33.js +94 -0
  309. package/dist/dashboard-web/chunks/{whiteboards-page-75N2U6W4.js → whiteboards-page-NAO53CKM.js} +1 -1
  310. package/dist/dashboard-web/style.css +363 -274
  311. package/dist/dashboard.js +194 -78
  312. package/dist/dashboard.js.map +1 -1
  313. package/dist/global-config.d.ts +1 -1
  314. package/dist/i18n/en.d.ts.map +1 -1
  315. package/dist/i18n/en.js +12 -87
  316. package/dist/i18n/en.js.map +1 -1
  317. package/dist/i18n/zh.d.ts.map +1 -1
  318. package/dist/i18n/zh.js +12 -87
  319. package/dist/i18n/zh.js.map +1 -1
  320. package/dist/im/lark/brand-template.d.ts +15 -0
  321. package/dist/im/lark/brand-template.d.ts.map +1 -0
  322. package/dist/im/lark/brand-template.js +114 -0
  323. package/dist/im/lark/brand-template.js.map +1 -0
  324. package/dist/im/lark/card-handler.d.ts +6 -3
  325. package/dist/im/lark/card-handler.d.ts.map +1 -1
  326. package/dist/im/lark/card-handler.js +23 -39
  327. package/dist/im/lark/card-handler.js.map +1 -1
  328. package/dist/im/lark/client.d.ts +8 -2
  329. package/dist/im/lark/client.d.ts.map +1 -1
  330. package/dist/im/lark/client.js +33 -31
  331. package/dist/im/lark/client.js.map +1 -1
  332. package/dist/im/lark/doc-comment.d.ts +18 -0
  333. package/dist/im/lark/doc-comment.d.ts.map +1 -1
  334. package/dist/im/lark/doc-comment.js +119 -5
  335. package/dist/im/lark/doc-comment.js.map +1 -1
  336. package/dist/im/lark/event-dispatcher.d.ts +18 -2
  337. package/dist/im/lark/event-dispatcher.d.ts.map +1 -1
  338. package/dist/im/lark/event-dispatcher.js +41 -19
  339. package/dist/im/lark/event-dispatcher.js.map +1 -1
  340. package/dist/im/lark/merge-forward.d.ts.map +1 -1
  341. package/dist/im/lark/merge-forward.js +7 -2
  342. package/dist/im/lark/merge-forward.js.map +1 -1
  343. package/dist/im/lark/message-parser.d.ts.map +1 -1
  344. package/dist/im/lark/message-parser.js +7 -0
  345. package/dist/im/lark/message-parser.js.map +1 -1
  346. package/dist/im/lark/overview-card.d.ts +1 -2
  347. package/dist/im/lark/overview-card.d.ts.map +1 -1
  348. package/dist/im/lark/overview-card.js +1 -48
  349. package/dist/im/lark/overview-card.js.map +1 -1
  350. package/dist/im/lark/v3-blocked-card-handler.d.ts.map +1 -1
  351. package/dist/im/lark/v3-blocked-card-handler.js +5 -5
  352. package/dist/im/lark/v3-blocked-card-handler.js.map +1 -1
  353. package/dist/im/lark/v3-blocked-card.d.ts +1 -0
  354. package/dist/im/lark/v3-blocked-card.d.ts.map +1 -1
  355. package/dist/im/lark/v3-blocked-card.js +19 -2
  356. package/dist/im/lark/v3-blocked-card.js.map +1 -1
  357. package/dist/im/lark/v3-distillation-card-handler.d.ts +12 -0
  358. package/dist/im/lark/v3-distillation-card-handler.d.ts.map +1 -0
  359. package/dist/im/lark/v3-distillation-card-handler.js +107 -0
  360. package/dist/im/lark/v3-distillation-card-handler.js.map +1 -0
  361. package/dist/im/lark/v3-distillation-card.d.ts +42 -0
  362. package/dist/im/lark/v3-distillation-card.d.ts.map +1 -0
  363. package/dist/im/lark/v3-distillation-card.js +206 -0
  364. package/dist/im/lark/v3-distillation-card.js.map +1 -0
  365. package/dist/im/lark/v3-gate-card-handler.d.ts +1 -1
  366. package/dist/im/lark/v3-gate-card-handler.d.ts.map +1 -1
  367. package/dist/im/lark/v3-gate-card-handler.js +6 -5
  368. package/dist/im/lark/v3-gate-card-handler.js.map +1 -1
  369. package/dist/im/lark/v3-gate-card.d.ts +8 -1
  370. package/dist/im/lark/v3-gate-card.d.ts.map +1 -1
  371. package/dist/im/lark/v3-gate-card.js +38 -7
  372. package/dist/im/lark/v3-gate-card.js.map +1 -1
  373. package/dist/im/lark/v3-loop-grant-card-handler.d.ts.map +1 -1
  374. package/dist/im/lark/v3-loop-grant-card-handler.js +3 -4
  375. package/dist/im/lark/v3-loop-grant-card-handler.js.map +1 -1
  376. package/dist/im/lark/v3-loop-grant-card.js +1 -1
  377. package/dist/im/lark/v3-loop-grant-card.js.map +1 -1
  378. package/dist/im/lark/v3-progress-card-manager.d.ts +79 -0
  379. package/dist/im/lark/v3-progress-card-manager.d.ts.map +1 -0
  380. package/dist/im/lark/v3-progress-card-manager.js +444 -0
  381. package/dist/im/lark/v3-progress-card-manager.js.map +1 -0
  382. package/dist/im/lark/v3-progress-card.d.ts +26 -0
  383. package/dist/im/lark/v3-progress-card.d.ts.map +1 -0
  384. package/dist/im/lark/v3-progress-card.js +211 -0
  385. package/dist/im/lark/v3-progress-card.js.map +1 -0
  386. package/dist/im/lark/v3-revisit-grant-card-handler.d.ts.map +1 -1
  387. package/dist/im/lark/v3-revisit-grant-card-handler.js +3 -4
  388. package/dist/im/lark/v3-revisit-grant-card-handler.js.map +1 -1
  389. package/dist/im/lark/v3-revisit-grant-card.js +1 -1
  390. package/dist/im/lark/v3-revisit-grant-card.js.map +1 -1
  391. package/dist/im/lark/v3-run-save-card-handler.d.ts +12 -0
  392. package/dist/im/lark/v3-run-save-card-handler.d.ts.map +1 -0
  393. package/dist/im/lark/v3-run-save-card-handler.js +160 -0
  394. package/dist/im/lark/v3-run-save-card-handler.js.map +1 -0
  395. package/dist/im/lark/v3-run-save-card.d.ts +38 -0
  396. package/dist/im/lark/v3-run-save-card.d.ts.map +1 -0
  397. package/dist/im/lark/v3-run-save-card.js +125 -0
  398. package/dist/im/lark/v3-run-save-card.js.map +1 -0
  399. package/dist/im/lark/v3-saved-workflow-command.d.ts +36 -0
  400. package/dist/im/lark/v3-saved-workflow-command.d.ts.map +1 -0
  401. package/dist/im/lark/v3-saved-workflow-command.js +186 -0
  402. package/dist/im/lark/v3-saved-workflow-command.js.map +1 -0
  403. package/dist/im/lark/v3-saved-workflow-handler.d.ts +89 -0
  404. package/dist/im/lark/v3-saved-workflow-handler.d.ts.map +1 -0
  405. package/dist/im/lark/v3-saved-workflow-handler.js +212 -0
  406. package/dist/im/lark/v3-saved-workflow-handler.js.map +1 -0
  407. package/dist/im/lark/workflow-slash-command.d.ts +7 -110
  408. package/dist/im/lark/workflow-slash-command.d.ts.map +1 -1
  409. package/dist/im/lark/workflow-slash-command.js +16 -230
  410. package/dist/im/lark/workflow-slash-command.js.map +1 -1
  411. package/dist/index-daemon.js +1 -1
  412. package/dist/index-daemon.js.map +1 -1
  413. package/dist/mir-runner.js +11 -15
  414. package/dist/mir-runner.js.map +1 -1
  415. package/dist/mira-runner.js +8 -12
  416. package/dist/mira-runner.js.map +1 -1
  417. package/dist/services/bridge-turn-queue.d.ts +29 -12
  418. package/dist/services/bridge-turn-queue.d.ts.map +1 -1
  419. package/dist/services/bridge-turn-queue.js +59 -23
  420. package/dist/services/bridge-turn-queue.js.map +1 -1
  421. package/dist/services/claude-transcript.d.ts +15 -0
  422. package/dist/services/claude-transcript.d.ts.map +1 -1
  423. package/dist/services/claude-transcript.js +24 -0
  424. package/dist/services/claude-transcript.js.map +1 -1
  425. package/dist/services/codex-bridge-queue.d.ts +13 -2
  426. package/dist/services/codex-bridge-queue.d.ts.map +1 -1
  427. package/dist/services/codex-bridge-queue.js +20 -3
  428. package/dist/services/codex-bridge-queue.js.map +1 -1
  429. package/dist/services/codex-transcript.d.ts +6 -0
  430. package/dist/services/codex-transcript.d.ts.map +1 -1
  431. package/dist/services/codex-transcript.js.map +1 -1
  432. package/dist/services/grok-transcript.d.ts +3 -2
  433. package/dist/services/grok-transcript.d.ts.map +1 -1
  434. package/dist/services/grok-transcript.js +73 -22
  435. package/dist/services/grok-transcript.js.map +1 -1
  436. package/dist/services/hook-runner.d.ts.map +1 -1
  437. package/dist/services/hook-runner.js +26 -3
  438. package/dist/services/hook-runner.js.map +1 -1
  439. package/dist/services/schedule-store.d.ts +37 -0
  440. package/dist/services/schedule-store.d.ts.map +1 -1
  441. package/dist/services/schedule-store.js +259 -141
  442. package/dist/services/schedule-store.js.map +1 -1
  443. package/dist/services/send-policy.d.ts +50 -0
  444. package/dist/services/send-policy.d.ts.map +1 -1
  445. package/dist/services/send-policy.js +65 -0
  446. package/dist/services/send-policy.js.map +1 -1
  447. package/dist/services/session-lifecycle-hooks.d.ts.map +1 -1
  448. package/dist/services/session-lifecycle-hooks.js +12 -0
  449. package/dist/services/session-lifecycle-hooks.js.map +1 -1
  450. package/dist/services/traex-transcript.d.ts +11 -2
  451. package/dist/services/traex-transcript.d.ts.map +1 -1
  452. package/dist/services/traex-transcript.js +142 -8
  453. package/dist/services/traex-transcript.js.map +1 -1
  454. package/dist/services/trigger-types.d.ts +6 -1
  455. package/dist/services/trigger-types.d.ts.map +1 -1
  456. package/dist/services/trigger-types.js.map +1 -1
  457. package/dist/services/turn-terminal-deduper.d.ts +14 -0
  458. package/dist/services/turn-terminal-deduper.d.ts.map +1 -0
  459. package/dist/services/turn-terminal-deduper.js +34 -0
  460. package/dist/services/turn-terminal-deduper.js.map +1 -0
  461. package/dist/services/vc-meeting-action-gate.d.ts +246 -0
  462. package/dist/services/vc-meeting-action-gate.d.ts.map +1 -0
  463. package/dist/services/vc-meeting-action-gate.js +756 -0
  464. package/dist/services/vc-meeting-action-gate.js.map +1 -0
  465. package/dist/services/vc-meeting-action-store.d.ts +222 -0
  466. package/dist/services/vc-meeting-action-store.d.ts.map +1 -0
  467. package/dist/services/vc-meeting-action-store.js +806 -0
  468. package/dist/services/vc-meeting-action-store.js.map +1 -0
  469. package/dist/services/vc-meeting-consumer-isolation.d.ts +27 -0
  470. package/dist/services/vc-meeting-consumer-isolation.d.ts.map +1 -0
  471. package/dist/services/vc-meeting-consumer-isolation.js +37 -0
  472. package/dist/services/vc-meeting-consumer-isolation.js.map +1 -0
  473. package/dist/services/vc-meeting-consumer-profile-bootstrap.d.ts +72 -0
  474. package/dist/services/vc-meeting-consumer-profile-bootstrap.d.ts.map +1 -0
  475. package/dist/services/vc-meeting-consumer-profile-bootstrap.js +343 -0
  476. package/dist/services/vc-meeting-consumer-profile-bootstrap.js.map +1 -0
  477. package/dist/services/vc-meeting-consumer-profile-store.d.ts +39 -0
  478. package/dist/services/vc-meeting-consumer-profile-store.d.ts.map +1 -0
  479. package/dist/services/vc-meeting-consumer-profile-store.js +190 -0
  480. package/dist/services/vc-meeting-consumer-profile-store.js.map +1 -0
  481. package/dist/services/vc-meeting-daemon-auth.d.ts +29 -0
  482. package/dist/services/vc-meeting-daemon-auth.d.ts.map +1 -0
  483. package/dist/services/vc-meeting-daemon-auth.js +117 -0
  484. package/dist/services/vc-meeting-daemon-auth.js.map +1 -0
  485. package/dist/services/vc-meeting-delivery-feed.d.ts +52 -0
  486. package/dist/services/vc-meeting-delivery-feed.d.ts.map +1 -0
  487. package/dist/services/vc-meeting-delivery-feed.js +231 -0
  488. package/dist/services/vc-meeting-delivery-feed.js.map +1 -0
  489. package/dist/services/vc-meeting-delivery-hub-store.d.ts +213 -0
  490. package/dist/services/vc-meeting-delivery-hub-store.d.ts.map +1 -0
  491. package/dist/services/vc-meeting-delivery-hub-store.js +1230 -0
  492. package/dist/services/vc-meeting-delivery-hub-store.js.map +1 -0
  493. package/dist/services/vc-meeting-delivery-protocol.d.ts +159 -0
  494. package/dist/services/vc-meeting-delivery-protocol.d.ts.map +1 -0
  495. package/dist/services/vc-meeting-delivery-protocol.js +443 -0
  496. package/dist/services/vc-meeting-delivery-protocol.js.map +1 -0
  497. package/dist/services/vc-meeting-delivery-receiver.d.ts +80 -0
  498. package/dist/services/vc-meeting-delivery-receiver.d.ts.map +1 -0
  499. package/dist/services/vc-meeting-delivery-receiver.js +543 -0
  500. package/dist/services/vc-meeting-delivery-receiver.js.map +1 -0
  501. package/dist/services/vc-meeting-delivery-store.d.ts +339 -0
  502. package/dist/services/vc-meeting-delivery-store.d.ts.map +1 -0
  503. package/dist/services/vc-meeting-delivery-store.js +1024 -0
  504. package/dist/services/vc-meeting-delivery-store.js.map +1 -0
  505. package/dist/services/vc-meeting-feed-metadata-store.d.ts +58 -0
  506. package/dist/services/vc-meeting-feed-metadata-store.d.ts.map +1 -0
  507. package/dist/services/vc-meeting-feed-metadata-store.js +356 -0
  508. package/dist/services/vc-meeting-feed-metadata-store.js.map +1 -0
  509. package/dist/services/vc-meeting-im-reply.d.ts +55 -0
  510. package/dist/services/vc-meeting-im-reply.d.ts.map +1 -0
  511. package/dist/services/vc-meeting-im-reply.js +279 -0
  512. package/dist/services/vc-meeting-im-reply.js.map +1 -0
  513. package/dist/services/vc-meeting-im-routing.d.ts +131 -0
  514. package/dist/services/vc-meeting-im-routing.d.ts.map +1 -0
  515. package/dist/services/vc-meeting-im-routing.js +449 -0
  516. package/dist/services/vc-meeting-im-routing.js.map +1 -0
  517. package/dist/services/vc-meeting-listener-message-store.d.ts +23 -0
  518. package/dist/services/vc-meeting-listener-message-store.d.ts.map +1 -0
  519. package/dist/services/vc-meeting-listener-message-store.js +142 -0
  520. package/dist/services/vc-meeting-listener-message-store.js.map +1 -0
  521. package/dist/services/vc-meeting-member-policy.d.ts +37 -0
  522. package/dist/services/vc-meeting-member-policy.d.ts.map +1 -0
  523. package/dist/services/vc-meeting-member-policy.js +102 -0
  524. package/dist/services/vc-meeting-member-policy.js.map +1 -0
  525. package/dist/services/vc-meeting-profile-instructions.d.ts +22 -0
  526. package/dist/services/vc-meeting-profile-instructions.d.ts.map +1 -0
  527. package/dist/services/vc-meeting-profile-instructions.js +64 -0
  528. package/dist/services/vc-meeting-profile-instructions.js.map +1 -0
  529. package/dist/services/vc-meeting-runtime-store.d.ts +63 -0
  530. package/dist/services/vc-meeting-runtime-store.d.ts.map +1 -1
  531. package/dist/services/vc-meeting-runtime-store.js +605 -116
  532. package/dist/services/vc-meeting-runtime-store.js.map +1 -1
  533. package/dist/services/vc-meeting-send-policy.d.ts +89 -0
  534. package/dist/services/vc-meeting-send-policy.d.ts.map +1 -0
  535. package/dist/services/vc-meeting-send-policy.js +150 -0
  536. package/dist/services/vc-meeting-send-policy.js.map +1 -0
  537. package/dist/services/vc-meeting-terminal-reconciler.d.ts +93 -0
  538. package/dist/services/vc-meeting-terminal-reconciler.d.ts.map +1 -0
  539. package/dist/services/vc-meeting-terminal-reconciler.js +198 -0
  540. package/dist/services/vc-meeting-terminal-reconciler.js.map +1 -0
  541. package/dist/setup/open-platform-automation.d.ts +2 -0
  542. package/dist/setup/open-platform-automation.d.ts.map +1 -1
  543. package/dist/setup/open-platform-automation.js +1 -0
  544. package/dist/setup/open-platform-automation.js.map +1 -1
  545. package/dist/setup/open-platform-outcome.d.ts +50 -0
  546. package/dist/setup/open-platform-outcome.d.ts.map +1 -0
  547. package/dist/setup/open-platform-outcome.js +56 -0
  548. package/dist/setup/open-platform-outcome.js.map +1 -0
  549. package/dist/setup/setup-args.d.ts +7 -2
  550. package/dist/setup/setup-args.d.ts.map +1 -1
  551. package/dist/setup/setup-args.js +21 -5
  552. package/dist/setup/setup-args.js.map +1 -1
  553. package/dist/skills/definitions.d.ts.map +1 -1
  554. package/dist/skills/definitions.js +66 -54
  555. package/dist/skills/definitions.js.map +1 -1
  556. package/dist/skills/injection-mode.d.ts +5 -4
  557. package/dist/skills/injection-mode.d.ts.map +1 -1
  558. package/dist/skills/injection-mode.js +19 -10
  559. package/dist/skills/injection-mode.js.map +1 -1
  560. package/dist/types.d.ts +187 -0
  561. package/dist/types.d.ts.map +1 -1
  562. package/dist/utils/canonical-input-hash.d.ts +5 -0
  563. package/dist/utils/canonical-input-hash.d.ts.map +1 -0
  564. package/dist/utils/canonical-input-hash.js +43 -0
  565. package/dist/utils/canonical-input-hash.js.map +1 -0
  566. package/dist/utils/canonical-json.d.ts +10 -0
  567. package/dist/utils/canonical-json.d.ts.map +1 -0
  568. package/dist/utils/canonical-json.js +23 -0
  569. package/dist/utils/canonical-json.js.map +1 -0
  570. package/dist/utils/child-env.d.ts +1 -1
  571. package/dist/utils/child-env.d.ts.map +1 -1
  572. package/dist/utils/child-env.js +8 -0
  573. package/dist/utils/child-env.js.map +1 -1
  574. package/dist/utils/daemon-discovery.d.ts +4 -0
  575. package/dist/utils/daemon-discovery.d.ts.map +1 -1
  576. package/dist/utils/daemon-discovery.js +12 -6
  577. package/dist/utils/daemon-discovery.js.map +1 -1
  578. package/dist/utils/file-lock.d.ts.map +1 -1
  579. package/dist/utils/file-lock.js +696 -102
  580. package/dist/utils/file-lock.js.map +1 -1
  581. package/dist/utils/fs-durability.d.ts +20 -0
  582. package/dist/utils/fs-durability.d.ts.map +1 -0
  583. package/dist/utils/fs-durability.js +84 -0
  584. package/dist/utils/fs-durability.js.map +1 -0
  585. package/dist/utils/global-install.d.ts +5 -2
  586. package/dist/utils/global-install.d.ts.map +1 -1
  587. package/dist/utils/global-install.js +22 -4
  588. package/dist/utils/global-install.js.map +1 -1
  589. package/dist/utils/herdr-web-history.d.ts +12 -0
  590. package/dist/utils/herdr-web-history.d.ts.map +1 -0
  591. package/dist/utils/herdr-web-history.js +74 -0
  592. package/dist/utils/herdr-web-history.js.map +1 -0
  593. package/dist/utils/herdr-web-terminal-binding.d.ts +39 -0
  594. package/dist/utils/herdr-web-terminal-binding.d.ts.map +1 -0
  595. package/dist/utils/herdr-web-terminal-binding.js +56 -0
  596. package/dist/utils/herdr-web-terminal-binding.js.map +1 -0
  597. package/dist/utils/pending-input-queue.d.ts +30 -1
  598. package/dist/utils/pending-input-queue.d.ts.map +1 -1
  599. package/dist/utils/pending-input-queue.js +45 -5
  600. package/dist/utils/pending-input-queue.js.map +1 -1
  601. package/dist/vc-agent/cards.d.ts +49 -4
  602. package/dist/vc-agent/cards.d.ts.map +1 -1
  603. package/dist/vc-agent/cards.js +460 -70
  604. package/dist/vc-agent/cards.js.map +1 -1
  605. package/dist/vc-agent/polling-source.d.ts +6 -1
  606. package/dist/vc-agent/polling-source.d.ts.map +1 -1
  607. package/dist/vc-agent/polling-source.js +17 -4
  608. package/dist/vc-agent/polling-source.js.map +1 -1
  609. package/dist/worker.js +1333 -283
  610. package/dist/worker.js.map +1 -1
  611. package/dist/workflows/definition.d.ts +28 -35
  612. package/dist/workflows/definition.d.ts.map +1 -1
  613. package/dist/workflows/definition.js +7 -24
  614. package/dist/workflows/definition.js.map +1 -1
  615. package/dist/workflows/events/payloads.d.ts +28 -28
  616. package/dist/workflows/events/replay.d.ts +5 -0
  617. package/dist/workflows/events/replay.d.ts.map +1 -1
  618. package/dist/workflows/events/replay.js +6 -1
  619. package/dist/workflows/events/replay.js.map +1 -1
  620. package/dist/workflows/events/schema.d.ts +663 -663
  621. package/dist/workflows/events/schema.d.ts.map +1 -1
  622. package/dist/workflows/events/schema.js +1 -4
  623. package/dist/workflows/events/schema.js.map +1 -1
  624. package/dist/workflows/hostExecutors/botmux-schedule.d.ts +5 -4
  625. package/dist/workflows/hostExecutors/botmux-schedule.d.ts.map +1 -1
  626. package/dist/workflows/hostExecutors/botmux-schedule.js +80 -35
  627. package/dist/workflows/hostExecutors/botmux-schedule.js.map +1 -1
  628. package/dist/workflows/hostExecutors/feishu-im.d.ts +3 -3
  629. package/dist/workflows/hostExecutors/feishu-im.d.ts.map +1 -1
  630. package/dist/workflows/hostExecutors/feishu-im.js +3 -3
  631. package/dist/workflows/hostExecutors/feishu-im.js.map +1 -1
  632. package/dist/workflows/hostExecutors/feishu-reply.d.ts +1 -1
  633. package/dist/workflows/hostExecutors/feishu-reply.d.ts.map +1 -1
  634. package/dist/workflows/hostExecutors/feishu-reply.js +1 -1
  635. package/dist/workflows/hostExecutors/feishu-reply.js.map +1 -1
  636. package/dist/workflows/hostExecutors/feishu-send.d.ts +1 -1
  637. package/dist/workflows/hostExecutors/feishu-send.d.ts.map +1 -1
  638. package/dist/workflows/hostExecutors/feishu-send.js +1 -1
  639. package/dist/workflows/hostExecutors/feishu-send.js.map +1 -1
  640. package/dist/workflows/hostExecutors/index.d.ts +0 -1
  641. package/dist/workflows/hostExecutors/index.d.ts.map +1 -1
  642. package/dist/workflows/hostExecutors/index.js +0 -1
  643. package/dist/workflows/hostExecutors/index.js.map +1 -1
  644. package/dist/workflows/hostExecutors/registry.d.ts +1 -1
  645. package/dist/workflows/hostExecutors/registry.d.ts.map +1 -1
  646. package/dist/workflows/hostExecutors/types.d.ts +21 -29
  647. package/dist/workflows/hostExecutors/types.d.ts.map +1 -1
  648. package/dist/workflows/migration/v2-definition-paths.d.ts +3 -0
  649. package/dist/workflows/migration/v2-definition-paths.d.ts.map +1 -0
  650. package/dist/workflows/migration/v2-definition-paths.js +10 -0
  651. package/dist/workflows/migration/v2-definition-paths.js.map +1 -0
  652. package/dist/workflows/migration/v2-ledger.d.ts +138 -0
  653. package/dist/workflows/migration/v2-ledger.d.ts.map +1 -0
  654. package/dist/workflows/migration/v2-ledger.js +599 -0
  655. package/dist/workflows/migration/v2-ledger.js.map +1 -0
  656. package/dist/workflows/migration/v2-migration-service.d.ts +40 -0
  657. package/dist/workflows/migration/v2-migration-service.d.ts.map +1 -0
  658. package/dist/workflows/migration/v2-migration-service.js +454 -0
  659. package/dist/workflows/migration/v2-migration-service.js.map +1 -0
  660. package/dist/workflows/migration/v2-read-only-ids.d.ts +7 -0
  661. package/dist/workflows/migration/v2-read-only-ids.d.ts.map +1 -0
  662. package/dist/workflows/migration/v2-read-only-ids.js +9 -0
  663. package/dist/workflows/migration/v2-read-only-ids.js.map +1 -0
  664. package/dist/workflows/migration/v2-run-archive-schema.d.ts +976 -0
  665. package/dist/workflows/migration/v2-run-archive-schema.d.ts.map +1 -0
  666. package/dist/workflows/migration/v2-run-archive-schema.js +113 -0
  667. package/dist/workflows/migration/v2-run-archive-schema.js.map +1 -0
  668. package/dist/workflows/migration/v2-run-archive.d.ts +92 -0
  669. package/dist/workflows/migration/v2-run-archive.d.ts.map +1 -0
  670. package/dist/workflows/migration/v2-run-archive.js +1220 -0
  671. package/dist/workflows/migration/v2-run-archive.js.map +1 -0
  672. package/dist/workflows/migration/v2-scanner.d.ts +22 -0
  673. package/dist/workflows/migration/v2-scanner.d.ts.map +1 -0
  674. package/dist/workflows/migration/v2-scanner.js +114 -0
  675. package/dist/workflows/migration/v2-scanner.js.map +1 -0
  676. package/dist/workflows/migration/v2-to-v3.d.ts +32 -0
  677. package/dist/workflows/migration/v2-to-v3.d.ts.map +1 -0
  678. package/dist/workflows/migration/v2-to-v3.js +494 -0
  679. package/dist/workflows/migration/v2-to-v3.js.map +1 -0
  680. package/dist/workflows/ops-projection.d.ts.map +1 -1
  681. package/dist/workflows/ops-projection.js +4 -3
  682. package/dist/workflows/ops-projection.js.map +1 -1
  683. package/dist/workflows/shared/idempotency-key.d.ts +19 -0
  684. package/dist/workflows/shared/idempotency-key.d.ts.map +1 -0
  685. package/dist/workflows/shared/idempotency-key.js +23 -0
  686. package/dist/workflows/shared/idempotency-key.js.map +1 -0
  687. package/dist/workflows/{params.d.ts → shared/params.d.ts} +42 -6
  688. package/dist/workflows/shared/params.d.ts.map +1 -0
  689. package/dist/workflows/{params.js → shared/params.js} +91 -4
  690. package/dist/workflows/shared/params.js.map +1 -0
  691. package/dist/workflows/shared/provider-reconciler.d.ts +47 -0
  692. package/dist/workflows/shared/provider-reconciler.d.ts.map +1 -0
  693. package/dist/workflows/shared/provider-reconciler.js +17 -0
  694. package/dist/workflows/shared/provider-reconciler.js.map +1 -0
  695. package/dist/workflows/{spawn-policy.d.ts → shared/sandbox-policy.d.ts} +2 -2
  696. package/dist/workflows/shared/sandbox-policy.d.ts.map +1 -0
  697. package/dist/workflows/{spawn-policy.js → shared/sandbox-policy.js} +1 -1
  698. package/dist/workflows/shared/sandbox-policy.js.map +1 -0
  699. package/dist/workflows/shared/worker-process.d.ts +29 -0
  700. package/dist/workflows/shared/worker-process.d.ts.map +1 -0
  701. package/dist/workflows/shared/worker-process.js +56 -0
  702. package/dist/workflows/shared/worker-process.js.map +1 -0
  703. package/dist/workflows/v3/architect.d.ts.map +1 -1
  704. package/dist/workflows/v3/architect.js +16 -4
  705. package/dist/workflows/v3/architect.js.map +1 -1
  706. package/dist/workflows/v3/attempt-ledger.d.ts +23 -0
  707. package/dist/workflows/v3/attempt-ledger.d.ts.map +1 -0
  708. package/dist/workflows/v3/attempt-ledger.js +74 -0
  709. package/dist/workflows/v3/attempt-ledger.js.map +1 -0
  710. package/dist/workflows/v3/bot-resolve.d.ts +19 -1
  711. package/dist/workflows/v3/bot-resolve.d.ts.map +1 -1
  712. package/dist/workflows/v3/bot-resolve.js +129 -3
  713. package/dist/workflows/v3/bot-resolve.js.map +1 -1
  714. package/dist/workflows/v3/cli-daemon-command-authority.d.ts +59 -0
  715. package/dist/workflows/v3/cli-daemon-command-authority.d.ts.map +1 -0
  716. package/dist/workflows/v3/cli-daemon-command-authority.js +175 -0
  717. package/dist/workflows/v3/cli-daemon-command-authority.js.map +1 -0
  718. package/dist/workflows/v3/cli-run.d.ts +27 -0
  719. package/dist/workflows/v3/cli-run.d.ts.map +1 -1
  720. package/dist/workflows/v3/cli-run.js +113 -29
  721. package/dist/workflows/v3/cli-run.js.map +1 -1
  722. package/dist/workflows/v3/contract.d.ts +16 -16
  723. package/dist/workflows/v3/contract.d.ts.map +1 -1
  724. package/dist/workflows/v3/contract.js +15 -11
  725. package/dist/workflows/v3/contract.js.map +1 -1
  726. package/dist/workflows/v3/daemon-ipc-auth.d.ts +113 -0
  727. package/dist/workflows/v3/daemon-ipc-auth.d.ts.map +1 -0
  728. package/dist/workflows/v3/daemon-ipc-auth.js +294 -0
  729. package/dist/workflows/v3/daemon-ipc-auth.js.map +1 -0
  730. package/dist/workflows/v3/daemon-ipc-body.d.ts +30 -0
  731. package/dist/workflows/v3/daemon-ipc-body.d.ts.map +1 -0
  732. package/dist/workflows/v3/daemon-ipc-body.js +65 -0
  733. package/dist/workflows/v3/daemon-ipc-body.js.map +1 -0
  734. package/dist/workflows/v3/daemon-ipc-client.d.ts +32 -0
  735. package/dist/workflows/v3/daemon-ipc-client.d.ts.map +1 -0
  736. package/dist/workflows/v3/daemon-ipc-client.js +74 -0
  737. package/dist/workflows/v3/daemon-ipc-client.js.map +1 -0
  738. package/dist/workflows/v3/daemon-run.d.ts +87 -2
  739. package/dist/workflows/v3/daemon-run.d.ts.map +1 -1
  740. package/dist/workflows/v3/daemon-run.js +863 -68
  741. package/dist/workflows/v3/daemon-run.js.map +1 -1
  742. package/dist/workflows/v3/dag.d.ts +22 -8
  743. package/dist/workflows/v3/dag.d.ts.map +1 -1
  744. package/dist/workflows/v3/dag.js +214 -22
  745. package/dist/workflows/v3/dag.js.map +1 -1
  746. package/dist/workflows/v3/distillation-compiler.d.ts +36 -0
  747. package/dist/workflows/v3/distillation-compiler.d.ts.map +1 -0
  748. package/dist/workflows/v3/distillation-compiler.js +704 -0
  749. package/dist/workflows/v3/distillation-compiler.js.map +1 -0
  750. package/dist/workflows/v3/distillation-private-root.d.ts +10 -0
  751. package/dist/workflows/v3/distillation-private-root.d.ts.map +1 -0
  752. package/dist/workflows/v3/distillation-private-root.js +34 -0
  753. package/dist/workflows/v3/distillation-private-root.js.map +1 -0
  754. package/dist/workflows/v3/distillation-runner.d.ts +64 -0
  755. package/dist/workflows/v3/distillation-runner.d.ts.map +1 -0
  756. package/dist/workflows/v3/distillation-runner.js +1028 -0
  757. package/dist/workflows/v3/distillation-runner.js.map +1 -0
  758. package/dist/workflows/v3/distillation-schema.d.ts +63 -0
  759. package/dist/workflows/v3/distillation-schema.d.ts.map +1 -0
  760. package/dist/workflows/v3/distillation-schema.js +184 -0
  761. package/dist/workflows/v3/distillation-schema.js.map +1 -0
  762. package/dist/workflows/v3/distillation-service.d.ts +78 -0
  763. package/dist/workflows/v3/distillation-service.d.ts.map +1 -0
  764. package/dist/workflows/v3/distillation-service.js +416 -0
  765. package/dist/workflows/v3/distillation-service.js.map +1 -0
  766. package/dist/workflows/v3/distillation-source.d.ts +35 -0
  767. package/dist/workflows/v3/distillation-source.d.ts.map +1 -0
  768. package/dist/workflows/v3/distillation-source.js +118 -0
  769. package/dist/workflows/v3/distillation-source.js.map +1 -0
  770. package/dist/workflows/v3/distillation-store.d.ts +185 -0
  771. package/dist/workflows/v3/distillation-store.d.ts.map +1 -0
  772. package/dist/workflows/v3/distillation-store.js +1127 -0
  773. package/dist/workflows/v3/distillation-store.js.map +1 -0
  774. package/dist/workflows/v3/drive-lease.d.ts +7 -0
  775. package/dist/workflows/v3/drive-lease.d.ts.map +1 -0
  776. package/dist/workflows/v3/drive-lease.js +10 -0
  777. package/dist/workflows/v3/drive-lease.js.map +1 -0
  778. package/dist/workflows/v3/ephemeral-pool.d.ts +1 -1
  779. package/dist/workflows/v3/ephemeral-pool.d.ts.map +1 -1
  780. package/dist/workflows/v3/ephemeral-pool.js +222 -37
  781. package/dist/workflows/v3/ephemeral-pool.js.map +1 -1
  782. package/dist/workflows/v3/grill-state.d.ts +18 -3
  783. package/dist/workflows/v3/grill-state.d.ts.map +1 -1
  784. package/dist/workflows/v3/grill-state.js +22 -5
  785. package/dist/workflows/v3/grill-state.js.map +1 -1
  786. package/dist/workflows/v3/host-bindings.d.ts +40 -0
  787. package/dist/workflows/v3/host-bindings.d.ts.map +1 -0
  788. package/dist/workflows/v3/host-bindings.js +272 -0
  789. package/dist/workflows/v3/host-bindings.js.map +1 -0
  790. package/dist/workflows/v3/host-effect-ledger.d.ts +22 -0
  791. package/dist/workflows/v3/host-effect-ledger.d.ts.map +1 -0
  792. package/dist/workflows/v3/host-effect-ledger.js +110 -0
  793. package/dist/workflows/v3/host-effect-ledger.js.map +1 -0
  794. package/dist/workflows/v3/host-execution.d.ts +142 -0
  795. package/dist/workflows/v3/host-execution.d.ts.map +1 -0
  796. package/dist/workflows/v3/host-execution.js +424 -0
  797. package/dist/workflows/v3/host-execution.js.map +1 -0
  798. package/dist/workflows/v3/host.d.ts +46 -10
  799. package/dist/workflows/v3/host.d.ts.map +1 -1
  800. package/dist/workflows/v3/host.js +419 -140
  801. package/dist/workflows/v3/host.js.map +1 -1
  802. package/dist/workflows/v3/human-gate.d.ts +19 -1
  803. package/dist/workflows/v3/human-gate.d.ts.map +1 -1
  804. package/dist/workflows/v3/human-gate.js +145 -19
  805. package/dist/workflows/v3/human-gate.js.map +1 -1
  806. package/dist/workflows/v3/journal.d.ts +125 -7
  807. package/dist/workflows/v3/journal.d.ts.map +1 -1
  808. package/dist/workflows/v3/journal.js +154 -38
  809. package/dist/workflows/v3/journal.js.map +1 -1
  810. package/dist/workflows/v3/library-materialize.d.ts +88 -0
  811. package/dist/workflows/v3/library-materialize.d.ts.map +1 -0
  812. package/dist/workflows/v3/library-materialize.js +294 -0
  813. package/dist/workflows/v3/library-materialize.js.map +1 -0
  814. package/dist/workflows/v3/library-schema.d.ts +138 -0
  815. package/dist/workflows/v3/library-schema.d.ts.map +1 -0
  816. package/dist/workflows/v3/library-schema.js +573 -0
  817. package/dist/workflows/v3/library-schema.js.map +1 -0
  818. package/dist/workflows/v3/library-service.d.ts +126 -0
  819. package/dist/workflows/v3/library-service.d.ts.map +1 -0
  820. package/dist/workflows/v3/library-service.js +542 -0
  821. package/dist/workflows/v3/library-service.js.map +1 -0
  822. package/dist/workflows/v3/library-store.d.ts +124 -0
  823. package/dist/workflows/v3/library-store.d.ts.map +1 -0
  824. package/dist/workflows/v3/library-store.js +665 -0
  825. package/dist/workflows/v3/library-store.js.map +1 -0
  826. package/dist/workflows/v3/orchestrator.d.ts +9 -1
  827. package/dist/workflows/v3/orchestrator.d.ts.map +1 -1
  828. package/dist/workflows/v3/orchestrator.js +2 -1
  829. package/dist/workflows/v3/orchestrator.js.map +1 -1
  830. package/dist/workflows/v3/progress-projection.d.ts +99 -0
  831. package/dist/workflows/v3/progress-projection.d.ts.map +1 -0
  832. package/dist/workflows/v3/progress-projection.js +197 -0
  833. package/dist/workflows/v3/progress-projection.js.map +1 -0
  834. package/dist/workflows/v3/run-envelope.d.ts +1279 -0
  835. package/dist/workflows/v3/run-envelope.d.ts.map +1 -0
  836. package/dist/workflows/v3/run-envelope.js +681 -0
  837. package/dist/workflows/v3/run-envelope.js.map +1 -0
  838. package/dist/workflows/v3/runtime.d.ts +39 -7
  839. package/dist/workflows/v3/runtime.d.ts.map +1 -1
  840. package/dist/workflows/v3/runtime.js +1992 -100
  841. package/dist/workflows/v3/runtime.js.map +1 -1
  842. package/dist/workflows/v3/session-relay-client.d.ts +61 -0
  843. package/dist/workflows/v3/session-relay-client.d.ts.map +1 -0
  844. package/dist/workflows/v3/session-relay-client.js +92 -0
  845. package/dist/workflows/v3/session-relay-client.js.map +1 -0
  846. package/dist/workflows/v3/session-relay.d.ts +66 -0
  847. package/dist/workflows/v3/session-relay.d.ts.map +1 -0
  848. package/dist/workflows/v3/session-relay.js +157 -0
  849. package/dist/workflows/v3/session-relay.js.map +1 -0
  850. package/dist/workflows/v3/start-intent.d.ts +8 -0
  851. package/dist/workflows/v3/start-intent.d.ts.map +1 -0
  852. package/dist/workflows/v3/start-intent.js +34 -0
  853. package/dist/workflows/v3/start-intent.js.map +1 -0
  854. package/dist/workflows/v3/state.d.ts +11 -2
  855. package/dist/workflows/v3/state.d.ts.map +1 -1
  856. package/dist/workflows/v3/state.js +182 -10
  857. package/dist/workflows/v3/state.js.map +1 -1
  858. package/dist/workflows/v3/template-bindings.d.ts +22 -0
  859. package/dist/workflows/v3/template-bindings.d.ts.map +1 -0
  860. package/dist/workflows/v3/template-bindings.js +204 -0
  861. package/dist/workflows/v3/template-bindings.js.map +1 -0
  862. package/dist/workflows/v3/worker-fence.d.ts +158 -0
  863. package/dist/workflows/v3/worker-fence.d.ts.map +1 -0
  864. package/dist/workflows/v3/worker-fence.js +685 -0
  865. package/dist/workflows/v3/worker-fence.js.map +1 -0
  866. package/package.json +3 -2
  867. package/dist/core/dashboard-command/workflows.d.ts +0 -20
  868. package/dist/core/dashboard-command/workflows.d.ts.map +0 -1
  869. package/dist/core/dashboard-command/workflows.js +0 -45
  870. package/dist/core/dashboard-command/workflows.js.map +0 -1
  871. package/dist/dashboard/web/legacy-workflow-link.d.ts +0 -2
  872. package/dist/dashboard/web/legacy-workflow-link.d.ts.map +0 -1
  873. package/dist/dashboard/web/legacy-workflow-link.js +0 -12
  874. package/dist/dashboard/web/legacy-workflow-link.js.map +0 -1
  875. package/dist/dashboard/web/legacy-workflow-page.d.ts +0 -3
  876. package/dist/dashboard/web/legacy-workflow-page.d.ts.map +0 -1
  877. package/dist/dashboard/web/legacy-workflow-page.js +0 -717
  878. package/dist/dashboard/web/legacy-workflow-page.js.map +0 -1
  879. package/dist/dashboard/web/workflow-version-switch.d.ts +0 -8
  880. package/dist/dashboard/web/workflow-version-switch.d.ts.map +0 -1
  881. package/dist/dashboard/web/workflow-version-switch.js +0 -9
  882. package/dist/dashboard/web/workflow-version-switch.js.map +0 -1
  883. package/dist/dashboard/web/workflows.d.ts +0 -273
  884. package/dist/dashboard/web/workflows.d.ts.map +0 -1
  885. package/dist/dashboard/web/workflows.js +0 -436
  886. package/dist/dashboard/web/workflows.js.map +0 -1
  887. package/dist/dashboard/workflow-api.d.ts +0 -30
  888. package/dist/dashboard/workflow-api.d.ts.map +0 -1
  889. package/dist/dashboard/workflow-api.js +0 -397
  890. package/dist/dashboard/workflow-api.js.map +0 -1
  891. package/dist/dashboard/workflow-card-model.d.ts +0 -127
  892. package/dist/dashboard/workflow-card-model.d.ts.map +0 -1
  893. package/dist/dashboard/workflow-card-model.js +0 -186
  894. package/dist/dashboard/workflow-card-model.js.map +0 -1
  895. package/dist/dashboard/workflows-action-helpers.d.ts +0 -105
  896. package/dist/dashboard/workflows-action-helpers.d.ts.map +0 -1
  897. package/dist/dashboard/workflows-action-helpers.js +0 -196
  898. package/dist/dashboard/workflows-action-helpers.js.map +0 -1
  899. package/dist/dashboard-web/chunks/bot-defaults-page-7T7DPOV6.js +0 -4
  900. package/dist/dashboard-web/chunks/chunk-IGXYYRYJ.js +0 -1
  901. package/dist/dashboard-web/chunks/chunk-ISOD7VDX.js +0 -1
  902. package/dist/dashboard-web/chunks/chunk-PNK3HQBI.js +0 -37
  903. package/dist/dashboard-web/chunks/chunk-SRIE4MLQ.js +0 -1
  904. package/dist/dashboard-web/chunks/connectors-page-UQ4QBE45.js +0 -1
  905. package/dist/dashboard-web/chunks/legacy-workflow-page-QMC7OZXH.js +0 -2
  906. package/dist/dashboard-web/chunks/sessions-page-NNZIDHZM.js +0 -3
  907. package/dist/dashboard-web/chunks/settings-page-LJIXX5LQ.js +0 -2
  908. package/dist/dashboard-web/chunks/v3-page-YLYVHGKD.js +0 -94
  909. package/dist/dashboard-web/terminal-replay.html +0 -227
  910. package/dist/im/lark/workflow-card-handler.d.ts +0 -51
  911. package/dist/im/lark/workflow-card-handler.d.ts.map +0 -1
  912. package/dist/im/lark/workflow-card-handler.js +0 -163
  913. package/dist/im/lark/workflow-card-handler.js.map +0 -1
  914. package/dist/im/lark/workflow-cards.d.ts +0 -47
  915. package/dist/im/lark/workflow-cards.d.ts.map +0 -1
  916. package/dist/im/lark/workflow-cards.js +0 -231
  917. package/dist/im/lark/workflow-cards.js.map +0 -1
  918. package/dist/im/lark/workflow-progress-card.d.ts +0 -81
  919. package/dist/im/lark/workflow-progress-card.d.ts.map +0 -1
  920. package/dist/im/lark/workflow-progress-card.js +0 -336
  921. package/dist/im/lark/workflow-progress-card.js.map +0 -1
  922. package/dist/im/lark/workflows-card.d.ts +0 -102
  923. package/dist/im/lark/workflows-card.d.ts.map +0 -1
  924. package/dist/im/lark/workflows-card.js +0 -737
  925. package/dist/im/lark/workflows-card.js.map +0 -1
  926. package/dist/workflows/attempt-resume.d.ts +0 -119
  927. package/dist/workflows/attempt-resume.d.ts.map +0 -1
  928. package/dist/workflows/attempt-resume.js +0 -392
  929. package/dist/workflows/attempt-resume.js.map +0 -1
  930. package/dist/workflows/blob.d.ts +0 -27
  931. package/dist/workflows/blob.d.ts.map +0 -1
  932. package/dist/workflows/blob.js +0 -40
  933. package/dist/workflows/blob.js.map +0 -1
  934. package/dist/workflows/cancel-run.d.ts +0 -45
  935. package/dist/workflows/cancel-run.d.ts.map +0 -1
  936. package/dist/workflows/cancel-run.js +0 -99
  937. package/dist/workflows/cancel-run.js.map +0 -1
  938. package/dist/workflows/cancel.d.ts +0 -111
  939. package/dist/workflows/cancel.d.ts.map +0 -1
  940. package/dist/workflows/cancel.js +0 -120
  941. package/dist/workflows/cancel.js.map +0 -1
  942. package/dist/workflows/catalog.d.ts +0 -60
  943. package/dist/workflows/catalog.d.ts.map +0 -1
  944. package/dist/workflows/catalog.js +0 -119
  945. package/dist/workflows/catalog.js.map +0 -1
  946. package/dist/workflows/cold-attach.d.ts +0 -30
  947. package/dist/workflows/cold-attach.d.ts.map +0 -1
  948. package/dist/workflows/cold-attach.js +0 -40
  949. package/dist/workflows/cold-attach.js.map +0 -1
  950. package/dist/workflows/cold-scan.d.ts +0 -21
  951. package/dist/workflows/cold-scan.d.ts.map +0 -1
  952. package/dist/workflows/cold-scan.js +0 -70
  953. package/dist/workflows/cold-scan.js.map +0 -1
  954. package/dist/workflows/daemon-spawn.d.ts +0 -119
  955. package/dist/workflows/daemon-spawn.d.ts.map +0 -1
  956. package/dist/workflows/daemon-spawn.js +0 -564
  957. package/dist/workflows/daemon-spawn.js.map +0 -1
  958. package/dist/workflows/effect-input.d.ts +0 -4
  959. package/dist/workflows/effect-input.d.ts.map +0 -1
  960. package/dist/workflows/effect-input.js +0 -19
  961. package/dist/workflows/effect-input.js.map +0 -1
  962. package/dist/workflows/events/append.d.ts +0 -77
  963. package/dist/workflows/events/append.d.ts.map +0 -1
  964. package/dist/workflows/events/append.js +0 -214
  965. package/dist/workflows/events/append.js.map +0 -1
  966. package/dist/workflows/events/idempotency.d.ts +0 -77
  967. package/dist/workflows/events/idempotency.d.ts.map +0 -1
  968. package/dist/workflows/events/idempotency.js +0 -116
  969. package/dist/workflows/events/idempotency.js.map +0 -1
  970. package/dist/workflows/events/index.d.ts +0 -7
  971. package/dist/workflows/events/index.d.ts.map +0 -1
  972. package/dist/workflows/events/index.js +0 -7
  973. package/dist/workflows/events/index.js.map +0 -1
  974. package/dist/workflows/fanout.d.ts +0 -36
  975. package/dist/workflows/fanout.d.ts.map +0 -1
  976. package/dist/workflows/fanout.js +0 -115
  977. package/dist/workflows/fanout.js.map +0 -1
  978. package/dist/workflows/hostExecutors/protocol.d.ts +0 -42
  979. package/dist/workflows/hostExecutors/protocol.d.ts.map +0 -1
  980. package/dist/workflows/hostExecutors/protocol.js +0 -181
  981. package/dist/workflows/hostExecutors/protocol.js.map +0 -1
  982. package/dist/workflows/loader.d.ts +0 -30
  983. package/dist/workflows/loader.d.ts.map +0 -1
  984. package/dist/workflows/loader.js +0 -84
  985. package/dist/workflows/loader.js.map +0 -1
  986. package/dist/workflows/loop.d.ts +0 -50
  987. package/dist/workflows/loop.d.ts.map +0 -1
  988. package/dist/workflows/loop.js +0 -408
  989. package/dist/workflows/loop.js.map +0 -1
  990. package/dist/workflows/orchestrator.d.ts +0 -171
  991. package/dist/workflows/orchestrator.d.ts.map +0 -1
  992. package/dist/workflows/orchestrator.js +0 -609
  993. package/dist/workflows/orchestrator.js.map +0 -1
  994. package/dist/workflows/output-binding.d.ts +0 -77
  995. package/dist/workflows/output-binding.d.ts.map +0 -1
  996. package/dist/workflows/output-binding.js +0 -329
  997. package/dist/workflows/output-binding.js.map +0 -1
  998. package/dist/workflows/params.d.ts.map +0 -1
  999. package/dist/workflows/params.js.map +0 -1
  1000. package/dist/workflows/resume.d.ts +0 -263
  1001. package/dist/workflows/resume.d.ts.map +0 -1
  1002. package/dist/workflows/resume.js +0 -808
  1003. package/dist/workflows/resume.js.map +0 -1
  1004. package/dist/workflows/run-id.d.ts +0 -2
  1005. package/dist/workflows/run-id.d.ts.map +0 -1
  1006. package/dist/workflows/run-id.js +0 -7
  1007. package/dist/workflows/run-id.js.map +0 -1
  1008. package/dist/workflows/run-init.d.ts +0 -48
  1009. package/dist/workflows/run-init.d.ts.map +0 -1
  1010. package/dist/workflows/run-init.js +0 -100
  1011. package/dist/workflows/run-init.js.map +0 -1
  1012. package/dist/workflows/runs-dir.d.ts +0 -4
  1013. package/dist/workflows/runs-dir.d.ts.map +0 -1
  1014. package/dist/workflows/runs-dir.js +0 -15
  1015. package/dist/workflows/runs-dir.js.map +0 -1
  1016. package/dist/workflows/runtime.d.ts +0 -215
  1017. package/dist/workflows/runtime.d.ts.map +0 -1
  1018. package/dist/workflows/runtime.js +0 -630
  1019. package/dist/workflows/runtime.js.map +0 -1
  1020. package/dist/workflows/spawn-bot.d.ts +0 -165
  1021. package/dist/workflows/spawn-bot.d.ts.map +0 -1
  1022. package/dist/workflows/spawn-bot.js +0 -215
  1023. package/dist/workflows/spawn-bot.js.map +0 -1
  1024. package/dist/workflows/spawn-policy.d.ts.map +0 -1
  1025. package/dist/workflows/spawn-policy.js.map +0 -1
  1026. package/dist/workflows/system.d.ts +0 -49
  1027. package/dist/workflows/system.d.ts.map +0 -1
  1028. package/dist/workflows/system.js +0 -48
  1029. package/dist/workflows/system.js.map +0 -1
  1030. package/dist/workflows/trigger-from-envelope.d.ts +0 -13
  1031. package/dist/workflows/trigger-from-envelope.d.ts.map +0 -1
  1032. package/dist/workflows/trigger-from-envelope.js +0 -68
  1033. package/dist/workflows/trigger-from-envelope.js.map +0 -1
  1034. package/dist/workflows/trigger-run.d.ts +0 -70
  1035. package/dist/workflows/trigger-run.d.ts.map +0 -1
  1036. package/dist/workflows/trigger-run.js +0 -88
  1037. package/dist/workflows/trigger-run.js.map +0 -1
  1038. package/dist/workflows/wait.d.ts +0 -141
  1039. package/dist/workflows/wait.d.ts.map +0 -1
  1040. package/dist/workflows/wait.js +0 -203
  1041. package/dist/workflows/wait.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{b as K}from"./chunk-OEJIT66L.js";import{b as Ce,c as je,d as te,h as ze,k as de}from"./chunk-SRIE4MLQ.js";import{u as we}from"./chunk-PNK3HQBI.js";import{a as He}from"./chunk-SYC6D5XU.js";import{a as bl,b as pl,d as Oe}from"./chunk-5THX4DI2.js";import{c as ce}from"./chunk-7SZRL6FY.js";var i=ce(bl(),1),qe=ce(pl(),1);var e=ce(Oe(),1),hl=2;function Sl(l,s){let o=String(l??"").replace(/\\/g,"/");return o.includes("/.codex/skills/")?s("skills.sourceCodex"):o.includes("/.claude/skills/")?s("skills.sourceClaude"):o.includes("/.trae/skills/")?s("skills.sourceTrae"):o.includes("/.cursor/skills/")?s("skills.sourceCursor"):o.includes("/.gemini/skills/")?s("skills.sourceGemini"):o.includes("/.config/opencode/skills/")?s("skills.sourceOpenCode"):null}function _e(l,s){let o=l.source??{};return o.type==="github"?`github:${o.owner}/${o.repo}/${o.path??""}`:o.type==="git"?`${o.url??"git"}#${o.path??""}`:o.type==="local-link"?Sl(o.path,s)??s("skills.sourceLocalLink"):o.type==="local-copy"?s("skills.sourceBotmuxCopy"):String(o.type??"unknown")}function ke(l){return(l?.include??[]).filter(s=>s.startsWith("skill:")).map(s=>s.slice(6))}function Nl(l){return ke(l).length}function wl(l){return ke(l).length>0}function ue(l){return`${l.cliId}
1
+ import{b as K}from"./chunk-CMDPZOPK.js";import{b as Ce,c as je,d as te,h as ze,k as de}from"./chunk-I35DXGM4.js";import{w as we}from"./chunk-NYZHARIU.js";import{a as He}from"./chunk-SYC6D5XU.js";import{a as bl,b as pl,d as Oe}from"./chunk-5THX4DI2.js";import{c as ce}from"./chunk-7SZRL6FY.js";var i=ce(bl(),1),qe=ce(pl(),1);var e=ce(Oe(),1),hl=2;function Sl(l,s){let o=String(l??"").replace(/\\/g,"/");return o.includes("/.codex/skills/")?s("skills.sourceCodex"):o.includes("/.claude/skills/")?s("skills.sourceClaude"):o.includes("/.trae/skills/")?s("skills.sourceTrae"):o.includes("/.cursor/skills/")?s("skills.sourceCursor"):o.includes("/.gemini/skills/")?s("skills.sourceGemini"):o.includes("/.config/opencode/skills/")?s("skills.sourceOpenCode"):null}function _e(l,s){let o=l.source??{};return o.type==="github"?`github:${o.owner}/${o.repo}/${o.path??""}`:o.type==="git"?`${o.url??"git"}#${o.path??""}`:o.type==="local-link"?Sl(o.path,s)??s("skills.sourceLocalLink"):o.type==="local-copy"?s("skills.sourceBotmuxCopy"):String(o.type??"unknown")}function ke(l){return(l?.include??[]).filter(s=>s.startsWith("skill:")).map(s=>s.slice(6))}function Nl(l){return ke(l).length}function wl(l){return ke(l).length>0}function ue(l){return`${l.cliId}
2
2
  ${l.rootDir}`}function Cl(l){return l>=1600?4:l<=620?1:l<=980?2:3}async function O(l,s){let o=await fetch(l,{...s,headers:{"content-type":"application/json",...s.headers??{}}}),k=await o.json().catch(()=>({}));if(!o.ok||k.ok===!1){let f=new Error(k?.error??`HTTP ${o.status}`);throw f.status=o.status,f.body=k,f}return k}function Re(l){return`oncall-status${l?` ${l.ok?"hint-ok":"hint-warn-inline"}`:""}`}function Ge(l){let s=l.options.find(o=>o.value===l.value);return(0,e.jsxs)("div",{className:"skills-segmented-control",children:[(0,e.jsx)("div",{className:"segmented skills-segmented",role:"group",children:l.options.map(o=>(0,e.jsx)("button",{type:"button",className:l.value===o.value?"active":"","aria-pressed":l.value===o.value?"true":"false",title:typeof o.help=="string"?o.help:void 0,disabled:l.disabled,onClick:()=>l.onChange(o.value),children:o.label},o.value))}),s?.help?(0,e.jsx)("span",{className:"skills-setting-hint",children:s.help}):null]})}function Rl(l){let s=K(),o=(0,i.useRef)(null),k=l.installCandidates??[],f=l.selectedInstallSkills??new Set,b=k.length>0&&k.every(r=>f.has(r.name)),y=l.installBusy||l.installDiscovering;return(0,i.useEffect)(()=>{let r=o.current;if(r)if(l.installSelectionOpen&&!r.open)try{r.showModal()}catch{}else!l.installSelectionOpen&&r.open&&r.close()},[l.installSelectionOpen,k.length]),(0,e.jsxs)("article",{className:"bd-card skills-install-panel",children:[l.showTitle===!1?null:(0,e.jsx)("div",{className:"skills-install-title",children:(0,e.jsx)("h3",{className:"bd-section-title",children:(0,e.jsx)(de,{help:s("skills.installInfo"),helpLabel:s("skills.installInfoLabel"),children:s("skills.install")})})}),(0,e.jsxs)("div",{className:"skills-install-grid",children:[(0,e.jsxs)("label",{className:"skills-source-label",children:[(0,e.jsx)(de,{help:(0,e.jsxs)("span",{className:"skills-source-help",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:s("skills.sourceHelpRemoteLabel")}),s("skills.sourceHelpRemote")]}),(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:s("skills.sourceHelpLocalLabel")}),s("skills.sourceHelpLocal")]}),(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:s("skills.sourceHelpAgentbuddyLabel")}),s("skills.sourceHelpAgentbuddy")]})]}),helpLabel:s("skills.source"),children:s("skills.source")}),(0,e.jsx)("div",{className:"skills-source-control",children:(0,e.jsx)("input",{type:"text","data-install":"source","aria-label":s("skills.source"),placeholder:s("skills.sourcePlaceholder"),value:l.installSource,onChange:r=>l.onInstallSourceChange(r.currentTarget.value)})})]}),(0,e.jsxs)("label",{className:"skills-install-field-wide skills-install-path-field",children:[(0,e.jsx)("span",{children:s("skills.path")}),(0,e.jsx)("input",{type:"text","data-install":"path",placeholder:s("skills.pathPlaceholder"),value:l.installPath,onChange:r=>l.onInstallPathChange(r.currentTarget.value)})]}),(0,e.jsxs)("label",{className:"skills-install-field-wide skills-install-ref-field",children:[(0,e.jsx)("span",{children:s("skills.ref")}),(0,e.jsx)("input",{type:"text","data-install":"ref",placeholder:s("skills.refPlaceholder"),value:l.installRef,onChange:r=>l.onInstallRefChange(r.currentTarget.value)})]}),(0,e.jsx)("div",{className:"skills-install-actions",children:(0,e.jsx)("button",{type:"button","data-action":"install",disabled:y,onClick:()=>l.onInstall(),children:l.installDiscovering?s("skills.scanning"):l.installBusy?s("skills.jobRunning"):s("skills.installSubmit")})}),(0,e.jsx)("div",{className:"skills-install-bottom-row",children:(0,e.jsxs)("div",{className:"skills-local-discovery-panel",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("strong",{children:s("skills.localDiscoverTitle")}),(0,e.jsx)("span",{children:s("skills.localDiscoverHelp")})]}),(0,e.jsx)("button",{type:"button","data-action":"open-native-skill-discovery",onClick:()=>l.onOpenNativeDiscovery(),children:s("skills.localDiscover")})]})})]}),l.installStatus?(0,e.jsx)("div",{className:"actions skills-install-status-row",children:(0,e.jsx)("span",{className:Re(l.installStatus),"data-skills-status":!0,children:l.installStatus.text})}):null,(0,e.jsx)("dialog",{className:"skills-discovery-dialog skills-install-selection-dialog","data-install-selection-dialog":!0,ref:o,onClose:()=>l.onCloseInstallSelection?.(),children:(0,e.jsxs)("article",{children:[(0,e.jsxs)("header",{children:[(0,e.jsx)("h3",{children:s("skills.installSelectionTitle")}),(0,e.jsx)("p",{children:s("skills.installSelectionHelp",{count:k.length})})]}),(0,e.jsx)("div",{className:"skills-discovery-body skills-install-selection-body",children:(0,e.jsxs)("div",{className:"skills-candidate-list","data-install-candidates":!0,children:[(0,e.jsxs)("div",{className:"skills-candidate-list-head",children:[(0,e.jsx)("span",{children:s("skills.scanFound",{count:k.length})}),l.onSelectAllInstallSkills?(0,e.jsx)("button",{type:"button","data-action":"toggle-all-source-skills",disabled:l.installBusy,onClick:()=>l.onSelectAllInstallSkills?.(!b),children:s(b?"skills.discoverClearSelection":"skills.discoverSelectAll")}):null]}),k.map(r=>(0,e.jsxs)("label",{className:"skills-candidate-row",children:[(0,e.jsx)("input",{type:"checkbox",checked:f.has(r.name),disabled:l.installBusy,onChange:()=>l.onToggleInstallSkill?.(r.name)}),(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:r.name}),(0,e.jsxs)("small",{children:[r.path,r.description?` \xB7 ${r.description}`:""]})]})]},`${r.name}:${r.path}`))]})}),(0,e.jsxs)("footer",{className:"actions",children:[(0,e.jsx)("button",{type:"button","data-action":"close-install-selection",disabled:l.installBusy,onClick:()=>l.onCloseInstallSelection?.(),children:s("skills.installSelectionCancel")}),(0,e.jsx)("button",{type:"button",className:"primary","data-action":"confirm-install-selection",disabled:l.installBusy||f.size===0,onClick:()=>l.onConfirmInstallSelection?.(),children:l.installBusy?s("skills.jobRunning"):s("skills.installSelected")})]})]})})]})}function Il(l){let s=K(),o=(0,i.useRef)(null),k=(0,i.useRef)(new Set(l.skills.map(a=>a.name))),f=(0,i.useRef)(""),b=(0,i.useRef)(!1),y=(0,i.useRef)(null),[r,p]=(0,i.useState)(""),[w,R]=(0,i.useState)(!1),[I,D]=(0,i.useState)(()=>new Set),[x,M]=(0,i.useState)(0),[A,j]=(0,i.useState)(()=>typeof window>"u"?1200:window.innerWidth),L=r.trim().toLocaleLowerCase();f.current=r,b.current=w;let h=(0,i.useMemo)(()=>L?l.skills.filter(a=>[a.name,a.displayName,a.description,...a.tags??[],_e(a,s)].filter(Boolean).join(`
3
3
  `).toLocaleLowerCase().includes(L)):l.skills,[L,l.skills,s]),B=Cl(A)*hl,T=Math.max(1,Math.ceil(h.length/B)),F=h.slice(x*B,x*B+B),q=(0,i.useMemo)(()=>new Set(h.map(a=>a.name)),[h]),z=h.filter(a=>I.has(a.name)).length,_=Math.max(0,I.size-z),c=h.length>0&&z===h.length;(0,i.useEffect)(()=>{if(typeof window>"u")return;let a=()=>j(window.innerWidth);return window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),(0,i.useEffect)(()=>M(0),[L,B]),(0,i.useEffect)(()=>{M(a=>Math.min(Math.max(0,a),T-1))},[T]),(0,i.useEffect)(()=>{let a=new Set(l.skills.map(u=>u.name)),C=[...k.current].some(u=>!a.has(u));D(u=>{let P=new Set([...u].filter(H=>a.has(H)));return P.size===u.size?u:P}),C&&(R(!1),D(new Set)),k.current=a},[l.skills]),(0,i.useEffect)(()=>{o.current&&(o.current.indeterminate=z>0&&!c)},[c,z]),(0,i.useEffect)(()=>{if(typeof document>"u")return;let a=u=>{if(u.key!=="Escape"||!b.current)return;let P=f.current;y.current=P,u.preventDefault(),u.stopPropagation(),R(!1),D(new Set),window.setTimeout(()=>{p(H=>H||P),y.current=null},50)},C=u=>{if(u.key!=="Escape"||y.current===null)return;let P=y.current;y.current=null,u.preventDefault(),u.stopPropagation(),p(P)};return document.addEventListener("keydown",a,!0),document.addEventListener("keyup",C,!0),()=>{document.removeEventListener("keydown",a,!0),document.removeEventListener("keyup",C,!0)}},[]);function g(a){D(C=>{let u=new Set(C);return u.has(a)?u.delete(a):u.add(a),u})}function S(){D(a=>{let C=new Set(a);if(c)for(let u of q)C.delete(u);else for(let u of q)C.add(u);return C})}function $(a=!1){let C=r;R(!1),D(new Set),a&&typeof window<"u"&&window.setTimeout(()=>p(C),0)}return(0,e.jsxs)("section",{className:"skills-installed-block",children:[(0,e.jsx)(te,{title:s("skills.installed"),count:s("skills.installedCount",{count:l.skills.length}),hint:s("skills.installedHelp"),children:(0,e.jsx)("div",{className:"skills-installed-header-actions",children:w?(0,e.jsx)("button",{type:"button","data-action":"cancel-installed-selection",onClick:()=>$(),children:s("skills.cancel")}):(0,e.jsx)("button",{type:"button","data-action":"select-installed-skills",disabled:l.skills.length===0,onClick:()=>R(!0),children:s("skills.select")})})}),(0,e.jsxs)("section",{className:"bd-card skills-installed-panel",children:[(0,e.jsxs)("div",{className:"skills-library-toolbar",children:[(0,e.jsxs)("label",{className:"skills-installed-search",children:[(0,e.jsx)("span",{className:"sr-only",children:s("skills.searchLabel")}),(0,e.jsx)("input",{type:"text",role:"searchbox",inputMode:"search","data-action":"search-installed-skills",placeholder:s("skills.searchPlaceholder"),value:r,onChange:a=>p(a.currentTarget.value),onKeyDown:a=>{a.key!=="Escape"||!w||(a.preventDefault(),a.stopPropagation(),$(!0))}}),r?(0,e.jsx)("button",{type:"button","data-action":"clear-installed-search","aria-label":s("skills.clearSearch"),onClick:()=>p(""),children:"\xD7"}):null]}),w?(0,e.jsxs)("label",{className:"skills-select-all-results",children:[(0,e.jsx)("input",{ref:o,type:"checkbox",checked:c,disabled:h.length===0||l.removingNames.size>0,onChange:S}),(0,e.jsx)("span",{children:L?s("skills.selectSearchResults",{count:h.length}):s("skills.selectAllSkills",{count:h.length})})]}):null,L?(0,e.jsx)("span",{className:"skills-filter-count",children:s("skills.resultCount",{count:h.length})}):null,T>1?(0,e.jsxs)("div",{className:"skills-pager",children:[(0,e.jsx)("button",{type:"button",className:"skills-pager-button","data-action":"page-installed-skills","data-dir":"-1","aria-label":s("skills.prevPage"),title:s("skills.prevPage"),disabled:x===0,onClick:()=>M(a=>Math.max(0,a-1)),children:"\u2039"}),(0,e.jsx)("span",{children:s("skills.pageStatus",{page:x+1,pages:T})}),(0,e.jsx)("button",{type:"button",className:"skills-pager-button","data-action":"page-installed-skills","data-dir":"1","aria-label":s("skills.nextPage"),title:s("skills.nextPage"),disabled:x>=T-1,onClick:()=>M(a=>Math.min(T-1,a+1)),children:"\u203A"})]}):null]}),(0,e.jsx)("div",{className:"skills-installed-live",role:"status","aria-live":"polite",children:l.status?(0,e.jsx)("span",{className:Re(l.status),children:l.status.text}):null}),l.skills.length===0?(0,e.jsxs)("div",{className:"skills-library-empty",children:[(0,e.jsx)("strong",{children:s("skills.emptyTitle")}),(0,e.jsx)("p",{children:s("skills.emptyHelp")})]}):h.length===0?(0,e.jsxs)("div",{className:"skills-library-empty","data-empty":"search",children:[(0,e.jsx)("strong",{children:s("skills.noResultsTitle",{query:r.trim()})}),(0,e.jsx)("p",{children:s("skills.noResultsHelp")}),(0,e.jsx)("button",{type:"button","data-action":"clear-installed-search-empty",onClick:()=>p(""),children:s("skills.clearSearch")})]}):(0,e.jsx)("div",{className:"skills-list",children:F.map(a=>{let C=I.has(a.name),u=l.removingNames.has(a.name);return(0,e.jsxs)("article",{className:`skills-row skills-installed-card${w?" is-selectable":""}${C?" is-selected":""}${u?" is-removing":""}`,"data-skill":a.name,"data-selection-mode":w?"true":void 0,"aria-busy":u||void 0,onClick:w?()=>g(a.name):void 0,children:[(0,e.jsxs)("div",{className:"skills-row-body",children:[(0,e.jsxs)("div",{className:"skills-row-title",children:[w?(0,e.jsx)("input",{type:"checkbox","aria-label":s("skills.selectNamed",{skill:a.displayName??a.name}),checked:C,disabled:u,onClick:P=>P.stopPropagation(),onChange:()=>g(a.name)}):null,(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:a.displayName??a.name}),a.displayName&&a.displayName!==a.name?(0,e.jsx)("small",{className:"skills-canonical-name",children:a.name}):null]})]}),a.description?(0,e.jsx)("p",{children:a.description}):null,(0,e.jsx)("small",{className:"skills-source-badge",children:_e(a,s)}),u?(0,e.jsx)("span",{className:"skills-removing-label",children:s("skills.removing")}):null]}),w?null:(0,e.jsxs)("div",{className:"skills-card-actions",children:[(0,e.jsx)("button",{type:"button","data-action":"update-skill",disabled:l.busySkill===`${a.name}:update`||u,onClick:()=>l.onUpdate(a.name),children:s("skills.update")}),(0,e.jsx)("button",{type:"button","data-action":"remove-skill",disabled:u,onClick:()=>l.onRequestRemove([a.name]),children:s("skills.remove")})]})]},a.name)})})]}),w?(0,e.jsxs)("div",{className:"skills-bulk-action-bar",role:"toolbar","aria-label":s("skills.bulkActions"),children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:s("skills.selectedCount",{count:I.size})}),_>0?(0,e.jsx)("small",{children:s("skills.selectedHidden",{count:_})}):null]}),(0,e.jsx)("button",{type:"button",className:"danger","data-action":"remove-selected-skills",disabled:I.size===0||l.removingNames.size>0,onClick:()=>l.onRequestRemove([...I]),children:s("skills.removeSelected",{count:I.size})})]}):null]})}function Pl(l){let s=K(),o=(0,i.useRef)(null),k=l.names??[],f=l.references.length>0,b=k.slice(0,3),y=new Set(l.references.flatMap(r=>r.bots)).size;return(0,i.useEffect)(()=>{let r=o.current;if(r)if(l.names&&!r.open)try{r.showModal()}catch{}else!l.names&&r.open&&r.close()},[l.names]),(0,e.jsx)("dialog",{className:"skills-remove-dialog","data-remove-skills-dialog":!0,ref:o,onCancel:r=>{r.preventDefault(),l.busy||l.onCancel()},onClick:r=>{r.target===r.currentTarget&&!l.busy&&l.onCancel()},children:(0,e.jsxs)("article",{children:[(0,e.jsxs)("header",{children:[(0,e.jsx)("h3",{children:f?k.length===1?s("skills.removeInUseOneTitle",{skill:k[0]}):s("skills.removeInUseManyTitle",{count:k.length}):k.length===1?s("skills.removeOneTitle",{skill:k[0]}):s("skills.removeManyTitle",{count:k.length})}),(0,e.jsx)("p",{children:f?k.length===1?s("skills.removeInUseOneHelp",{count:y}):s("skills.removeInUseManyHelp",{count:y}):k.length===1?s("skills.removeOnePermanentHelp"):s("skills.removePermanentHelp")})]}),(0,e.jsxs)("div",{className:"skills-remove-dialog-body",children:[k.length>1?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("ul",{children:b.map(r=>(0,e.jsx)("li",{children:r},r))}),k.length>b.length?(0,e.jsx)("p",{children:s("skills.removeMore",{count:k.length-b.length})}):null]}):null,l.references.length>0?(0,e.jsxs)("div",{className:"skills-remove-reference-warning",role:"alert",children:[(0,e.jsx)("strong",{children:s("skills.removeReferencesDetail")}),(0,e.jsx)("ul",{children:l.references.map(r=>(0,e.jsxs)("li",{children:[(0,e.jsx)("strong",{children:r.name}),(0,e.jsx)("span",{children:r.bots.join(", ")})]},r.name))})]}):null,l.error?(0,e.jsx)("p",{className:"hint-warn",role:"alert",children:l.error}):null]}),(0,e.jsxs)("footer",{className:"actions",children:[(0,e.jsx)("button",{type:"button",autoFocus:!0,disabled:l.busy,onClick:l.onCancel,children:s("skills.cancel")}),(0,e.jsx)("button",{type:"button",className:"danger",disabled:l.busy,onClick:()=>l.onConfirm(f),children:l.busy?s("skills.removing"):f?s("skills.removeAnyway"):k.length===1?s("skills.removeOneConfirm"):s("skills.removeSelected",{count:k.length})})]})]})})}function Tl(){let l=K(),s=(0,i.useRef)(!0),o=(0,i.useRef)(new Set),k=(0,i.useRef)(null),[f,b]=(0,i.useState)([]),[y,r]=(0,i.useState)([]),[p,w]=(0,i.useState)([]),[R,I]=(0,i.useState)("off"),[D,x]=(0,i.useState)("auto"),[M,A]=(0,i.useState)(null),[j,L]=(0,i.useState)(!0),[h,B]=(0,i.useState)(""),[T,F]=(0,i.useState)(""),[q,z]=(0,i.useState)(""),[_,c]=(0,i.useState)(null),[g,S]=(0,i.useState)(!1),[$,a]=(0,i.useState)(!1),[C,u]=(0,i.useState)(!1),[P,H]=(0,i.useState)([]),[Q,U]=(0,i.useState)(()=>new Set),[W,X]=(0,i.useState)(!1),[Je,Ie]=(0,i.useState)(!1),[me,Ke]=(0,i.useState)(null),[ge,fe]=(0,i.useState)(()=>new Set),[Pe,ne]=(0,i.useState)(null),[Ue,Te]=(0,i.useState)(null),[We,De]=(0,i.useState)(null),[Fe,ve]=(0,i.useState)({}),[ye,V]=(0,i.useState)(null),[xe,be]=(0,i.useState)(null),[Qe,Y]=(0,i.useState)(!1),[Xe,ie]=(0,i.useState)([]),[Ve,ae]=(0,i.useState)(null),[Z,Me]=(0,i.useState)(()=>new Set),ee=(0,i.useMemo)(()=>new Set(f.map(t=>t.name)),[f]),J=(0,i.useMemo)(()=>y.length===0?void 0:(me?y.find(n=>ue(n)===me):void 0)??y.find(n=>n.skills.length>0)??y[0],[me,y]),pe=J?ue(J):"",le=(0,i.useMemo)(()=>J?J.skills.filter(t=>!ee.has(t.name)).map(t=>t.rootDir??t.source?.root??"").filter(Boolean):[],[J,ee]),Ae=le.length>0&&le.every(t=>ge.has(t)),Le=(0,i.useCallback)(()=>{for(let t of o.current)window.clearTimeout(t);o.current.clear()},[]),Ye=(0,i.useCallback)(t=>new Promise(n=>{let d=window.setTimeout(()=>{o.current.delete(d),n()},t);o.current.add(d)}),[]),Ee=(0,i.useCallback)(async()=>{let[t,n]=await Promise.all([fetch("/api/skills"),fetch("/api/bots")]),d=await t.json().catch(()=>({})),m=await n.json().catch(()=>({}));if(!t.ok){let v=d?.error??`skills HTTP ${t.status}`;throw new Error(v==="not_found_yet"||v==="not_found"?l("skills.apiUnavailable"):v)}if(!n.ok)throw new Error(m?.error??`bots HTTP ${n.status}`);return{skills:Array.isArray(d.skills)?d.skills:[],nativeSkillGroups:Array.isArray(d.nativeSkillGroups)?d.nativeSkillGroups:[],bots:Array.isArray(m.bots)?m.bots:[],trustProjectSkills:d.trustProjectSkills==="all"?"all":"off",delivery:d.delivery==="prompt"||d.delivery==="native"?d.delivery:"auto"}},[l]),se=(0,i.useCallback)(async()=>{L(!0);try{let t=await Ee();if(!s.current)return;b(t.skills),r(t.nativeSkillGroups),w(t.bots),I(t.trustProjectSkills),x(t.delivery),A(null),fe(n=>{let d=new Set,m=new Set(t.skills.map(v=>v.name));for(let v of t.nativeSkillGroups)for(let N of v.skills){let E=N.rootDir??N.source?.root??"";E&&!m.has(N.name)&&n.has(E)&&d.add(E)}return d})}catch(t){if(!s.current)return;A(t?.message??String(t))}finally{s.current&&L(!1)}},[Ee]);(0,i.useEffect)(()=>(s.current=!0,se(),()=>{s.current=!1,Le()}),[Le,se]),(0,i.useEffect)(()=>{if(!ye||Z.size>0)return;let t=window.setTimeout(()=>{s.current&&V(null)},6e3);return()=>window.clearTimeout(t)},[ye,Z]),(0,i.useEffect)(()=>{let t=k.current;if(t)if(W&&!t.open)try{t.showModal()}catch{}else!W&&t.open&&t.close()},[W,pe]);async function Be(t,n,d=!0){let m=t;for(n({text:l("skills.jobRunning"),ok:!0});;){if(!s.current)return;if(m.status==="succeeded"){n({text:l("skills.saved"),ok:!0}),d&&await se();return}if(m.status==="failed")throw new Error(m.error??"job_failed");if(await Ye(800),!s.current)return;let v=await O(`/api/skills/jobs/${encodeURIComponent(m.id)}`,{method:"GET"});if(!s.current)return;m=v.job}}function Ze(t){return p.filter(n=>ke(n.skills).includes(t)).map(n=>n.botName??n.larkAppId)}function oe(){H([]),U(new Set),u(!1)}function $e(){return{source:h.trim(),path:T.trim()||void 0,ref:q.trim()||void 0}}function el(t){let n=t??[...Q];return{...$e(),skillNames:n.length>0?n:void 0}}async function ll(){a(!0),c({text:l("skills.scanning"),ok:!0});try{let t=await O("/api/skills/discover",{method:"POST",body:JSON.stringify($e())});if(!s.current)return{skills:[],directInstall:!1};let n=t.discovery?.directInstall===!0,d=Array.isArray(t.discovery?.skills)?t.discovery.skills:[];return H(d),U(new Set(d.map(m=>m.name))),{skills:d,directInstall:n}}finally{s.current&&a(!1)}}function G(t){let n=t||"";return n.startsWith("agentbuddy_not_found")?l("skills.agentbuddyNotFound"):n.startsWith("agentbuddy_command_failed")?/login|credential|unauthor|not logged|401|403/i.test(n)?l("skills.agentbuddyNeedsLogin"):l("skills.agentbuddyCommandFailed"):n.startsWith("agentbuddy_clear_telemetry_failed")||n.startsWith("agentbuddy_telemetry_not_stripped")?l("skills.agentbuddyTelemetryFailed"):n.startsWith("agentbuddy_no_skill_produced")?l("skills.agentbuddyNoSkill"):n.startsWith("invalid_agentbuddy")?l("skills.agentbuddyInvalid"):n}async function he(t){S(!0);try{let n=await O("/api/skills/install",{method:"POST",body:JSON.stringify(el(t))});if(!s.current)return;await Be(n.job,c),s.current&&oe()}catch(n){s.current&&c({text:`${l("skills.failed")}: ${G(n?.message??String(n))}`,ok:!1})}finally{s.current&&S(!1)}}function sl(t){U(n=>{let d=new Set(n);return d.has(t)?d.delete(t):d.add(t),d})}function tl(t){U(t?new Set(P.map(n=>n.name)):new Set)}async function nl(){if(!h.trim()){c({text:l("skills.sourceRequired"),ok:!1});return}try{u(!1);let{skills:t,directInstall:n}=await ll();if(!s.current)return;if(n){await he();return}if(t.length===0){c({text:l("skills.scanEmpty"),ok:!1});return}if(t.length===1){await he([t[0].name]);return}c({text:l("skills.scanFound",{count:t.length}),ok:!0}),u(!0)}catch(t){s.current&&c({text:`${l("skills.failed")}: ${G(t?.message??String(t))}`,ok:!1})}}async function il(){let t=[...Q];if(t.length===0){c({text:l("skills.discoverNothingSelected"),ok:!1});return}await he(t)}async function al(){let t=[...ge].filter(Boolean);if(t.length===0){c({text:l("skills.discoverNothingSelected"),ok:!1});return}Ie(!0);try{if(c({text:l("skills.discoverRegisteringBatch",{total:t.length}),ok:!0}),await O("/api/skills/install-local-links",{method:"POST",body:JSON.stringify({sources:t})}),!s.current)return;X(!1),await se(),s.current&&c({text:l("skills.saved"),ok:!0})}catch(n){s.current&&c({text:`${l("skills.failed")}: ${G(n?.message??String(n))}`,ok:!1})}finally{s.current&&Ie(!1)}}async function ol(t){if(R!==t){ne("project");try{let n=await O("/api/skills/global",{method:"PUT",body:JSON.stringify({trustProjectSkills:t})});if(!s.current)return;I(n.trustProjectSkills==="all"?"all":t)}catch(n){s.current&&window.alert(`${l("skills.failed")}: ${G(n?.message??String(n))}`)}finally{s.current&&ne(null)}}}async function rl(t){if(D!==t){ne("delivery");try{let n=await O("/api/skills/global",{method:"PUT",body:JSON.stringify({delivery:t})});if(!s.current)return;x(n.delivery==="prompt"||n.delivery==="native"?n.delivery:t)}catch(n){s.current&&window.alert(`${l("skills.failed")}: ${G(n?.message??String(n))}`)}finally{s.current&&ne(null)}}}async function cl(t){Te(`${t}:update`);try{let n=await O(`/api/skills/${encodeURIComponent(t)}/update`,{method:"POST",body:"{}"});if(!s.current)return;await Be(n.job,c)}catch(n){s.current&&window.alert(`${l("skills.failed")}: ${G(n?.message??String(n))}`)}finally{s.current&&Te(null)}}function dl(t){let n=[...new Set(t.filter(d=>ee.has(d)))];n.length!==0&&(be(n),Y(!0),ie([]),ae(null))}function ul(){Z.size>0||(Y(!1),be(null),ie([]),ae(null))}async function kl(t){let n=xe??[];if(n.length!==0){Me(new Set(n)),Y(!1),ae(null),V({text:l("skills.removingCount",{count:n.length}),ok:!0});try{let d=await O("/api/skills",{method:"DELETE",body:JSON.stringify({names:n,force:t})});if(!s.current)return;let m=Array.isArray(d.removed)?d.removed.filter(N=>typeof N=="string"):n,v=new Set(m);b(N=>N.filter(E=>!v.has(E.name))),V({text:m.length===1?l("skills.removedOne",{skill:m[0]}):l("skills.removedMany",{count:m.length}),ok:!0}),be(null),ie([])}catch(d){if(!s.current)return;if(d?.status===409&&d?.body?.error==="skills_in_use"){let v=Array.isArray(d.body.affectedSkills)?d.body.affectedSkills.map(N=>{let E=typeof N?.name=="string"?N.name:"",Se=Array.isArray(N?.affectedBots)?N.affectedBots.map(re=>re?.botName||re?.larkAppId||"").filter(Boolean):Ze(E);return E?{name:E,bots:Se}:null}).filter(N=>N!==null):[];ie(v),Y(!0),V(null);return}let m=l("skills.removeFailed",{detail:G(d?.message??String(d))});ae(m),Y(!0),V({text:m,ok:!1})}finally{s.current&&Me(new Set)}}}async function ml(t,n){let d=`${t}:set`;De(d),ve(m=>({...m,[t]:null}));try{let m=await O(`/api/bots/${encodeURIComponent(t)}/skills`,{method:"PUT",body:JSON.stringify({action:"set",policy:n.length>0?{include:n.map(v=>`skill:${v}`)}:null})});if(!s.current)return;w(v=>v.map(N=>N.larkAppId===t?{...N,skills:m.skills??null}:N)),ve(v=>({...v,[t]:{text:l("skills.policySaved"),ok:!0}}))}catch(m){throw s.current&&ve(v=>({...v,[t]:{text:`${l("skills.failed")}: ${G(m?.message??String(m))}`,ok:!1}})),m}finally{s.current&&De(null)}}let gl=p.filter(t=>wl(t.skills)).length,fl=p.reduce((t,n)=>t+Nl(n.skills),0),vl=(0,e.jsxs)("div",{className:"page-heading-actions skills-heading-actions",children:[(0,e.jsxs)("div",{className:"skills-metric-strip",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("small",{children:l("skills.metricInstalled")}),(0,e.jsx)("strong",{children:f.length})]}),(0,e.jsxs)("span",{children:[(0,e.jsx)("small",{children:l("skills.metricBots")}),(0,e.jsxs)("strong",{children:[gl,"/",p.length]})]}),(0,e.jsxs)("span",{children:[(0,e.jsx)("small",{children:l("skills.metricAttached")}),(0,e.jsx)("strong",{children:fl})]})]}),(0,e.jsx)(ze,{id:"skills-refresh",label:l("skills.refresh"),busy:j,disabled:j,onClick:()=>{se()}})]}),yl=(0,e.jsx)("div",{className:"skills-page-stack",children:j?(0,e.jsx)(je,{label:l("common.loading")}):M?(0,e.jsx)("p",{className:"hint-warn",children:M}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"skills-config-row",children:[(0,e.jsxs)("section",{className:"skills-config-block",children:[(0,e.jsx)(te,{title:l("skills.globalDefaults")}),(0,e.jsxs)("article",{className:"bd-card skills-defaults-panel skills-config-card",children:[(0,e.jsxs)("div",{className:"skills-control-block",children:[(0,e.jsx)("span",{className:"skills-control-label",children:l("skills.globalProject")}),(0,e.jsx)(Ge,{value:R,disabled:Pe==="project",options:[{value:"off",label:l("skills.globalProjectOff"),help:l("skills.globalProjectOffHelp")},{value:"all",label:l("skills.globalProjectAll"),help:l("skills.globalProjectAllHelp")}],onChange:t=>{ol(t)}})]}),(0,e.jsxs)("div",{className:"skills-control-block",children:[(0,e.jsx)("span",{className:"skills-control-label",children:l("skills.globalDelivery")}),(0,e.jsx)(Ge,{value:D,disabled:Pe==="delivery",options:[{value:"auto",label:l("skills.deliveryAuto"),help:l("skills.deliveryAutoHelp")},{value:"prompt",label:l("skills.deliveryPrompt"),help:l("skills.deliveryPromptHelp")},{value:"native",label:l("skills.deliveryNative"),help:l("skills.deliveryNativeHelp")}],onChange:t=>{rl(t)}})]})]})]}),(0,e.jsxs)("section",{className:"skills-config-block",children:[(0,e.jsx)(te,{title:(0,e.jsx)(de,{help:l("skills.installInfo"),helpLabel:l("skills.installInfoLabel"),children:l("skills.install")})}),(0,e.jsx)(Rl,{showTitle:!1,installSource:h,installPath:T,installRef:q,installStatus:_,installBusy:g,installDiscovering:$,installSelectionOpen:C,installCandidates:P,selectedInstallSkills:Q,onInstallSourceChange:t=>{B(t),oe()},onInstallPathChange:t=>{F(t),oe()},onInstallRefChange:t=>{z(t),oe()},onToggleInstallSkill:sl,onSelectAllInstallSkills:tl,onConfirmInstallSelection:()=>{il()},onCloseInstallSelection:()=>u(!1),onInstall:()=>{nl()},onOpenNativeDiscovery:()=>X(!0)})]}),(0,e.jsxs)("section",{className:"skills-config-block",children:[(0,e.jsx)(te,{title:l("skills.bots"),count:l("skills.botCount",{count:p.length}),hint:l("skills.botsHelp")}),(0,e.jsx)("section",{className:"bd-card skills-bots-panel skills-config-card",children:(0,e.jsx)("div",{className:"skills-bot-grid",children:p.map(t=>(0,e.jsx)(Ml,{bot:t,installedNames:ee,skills:f,status:Fe[t.larkAppId]??null,busyKey:We,onSave:ml},t.larkAppId))})})]})]}),(0,e.jsx)(Il,{skills:f,busySkill:Ue,removingNames:Z,status:ye,onUpdate:t=>{cl(t)},onRequestRemove:dl}),(0,e.jsx)(Pl,{names:Qe?xe:null,references:Xe,busy:Z.size>0,error:Ve,onCancel:ul,onConfirm:t=>{kl(t)}}),(0,e.jsx)("dialog",{className:"skills-discovery-dialog",id:"skills-discovery-dialog",ref:k,onClose:()=>X(!1),onClick:t=>{t.target===t.currentTarget&&X(!1)},children:(0,e.jsxs)("article",{children:[(0,e.jsxs)("header",{children:[(0,e.jsx)("h3",{children:l("skills.discoverTitle")}),(0,e.jsx)("p",{children:l("skills.discoverHelp")}),(0,e.jsx)("button",{type:"button",className:"skills-discovery-close","data-action":"close-discovery","aria-label":l("skills.discoverClose"),title:l("skills.discoverClose"),onClick:()=>X(!1)})]}),(0,e.jsx)("div",{className:"skills-discovery-body",children:J?(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)("div",{className:"skills-discovery-layout",children:[(0,e.jsx)("div",{className:"skills-discovery-tabs",role:"tablist","aria-label":l("skills.discoverTitle"),children:y.map(t=>{let n=ue(t),d=n===pe;return(0,e.jsxs)("button",{type:"button",role:"tab","data-discovery-tab":n,className:d?"selected":"","aria-selected":d?"true":"false",onClick:()=>Ke(n),children:[(0,e.jsx)("strong",{children:t.label??t.cliId}),(0,e.jsx)("small",{children:l("skills.skillCount",{count:t.skills.length})})]},n)})}),(0,e.jsxs)("div",{className:"skills-discovery-main",children:[(0,e.jsx)("div",{className:"skills-discovery-path",children:(0,e.jsx)("code",{children:J.rootDir})}),y.map(t=>{let n=ue(t);return(0,e.jsx)("section",{className:"skills-discovery-group","data-discovery-panel":n,hidden:!(n===pe),children:t.skills.length===0?(0,e.jsx)("p",{className:"empty",children:l("skills.discoverGroupEmpty")}):(0,e.jsx)("div",{className:"skills-discovery-list",children:t.skills.map(m=>{let v=ee.has(m.name),N=m.rootDir??m.source?.root??"";return(0,e.jsxs)("label",{className:`skills-discovery-row${v?" installed":""}`,children:[(0,e.jsx)("input",{type:"checkbox","data-discovered-skill":!0,value:N,disabled:v,checked:!v&&ge.has(N),onChange:E=>{let Se=E.currentTarget.checked;fe(re=>{let Ne=new Set(re);return Se?Ne.add(N):Ne.delete(N),Ne})}}),(0,e.jsxs)("span",{children:[(0,e.jsx)("strong",{children:m.name}),m.description?(0,e.jsx)("small",{children:m.description}):null]}),v?(0,e.jsx)("em",{children:l("skills.discoverRegistered")}):null]},`${m.name}:${N}`)})})},n)})]})]})}):(0,e.jsx)("p",{className:"empty",children:l("skills.discoverEmpty")})}),(0,e.jsxs)("footer",{className:"actions",children:[(0,e.jsx)("button",{type:"button","data-action":"toggle-discovered-skills",disabled:le.length===0,onClick:()=>{fe(t=>{let n=new Set(t);return Ae?le.forEach(d=>n.delete(d)):le.forEach(d=>n.add(d)),n})},children:l(Ae?"skills.discoverClearSelection":"skills.discoverSelectAll")}),(0,e.jsx)("button",{type:"button",className:"primary","data-action":"register-discovered-skills",disabled:Je,onClick:()=>{al()},children:l("skills.discoverRegister")})]})]})})]})});return(0,e.jsxs)("section",{className:"page skills-page",children:[(0,e.jsxs)("div",{className:"page-heading",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:l("nav.skills")}),(0,e.jsx)("h1",{children:l("skills.title")})]}),vl]}),(0,e.jsx)("div",{id:"skills-body",children:yl})]})}function Dl(l,s){return l.size===s.length&&s.every(o=>l.has(o))}function xl(l){let s=K(),o=(0,i.useRef)(null),k=(0,i.useRef)(null),f=(0,i.useRef)(null),[b,y]=(0,i.useState)(!1),[r,p]=(0,i.useState)(""),[w,R]=(0,i.useState)(()=>new Set(l.names)),[I,D]=(0,i.useState)(null),x=l.names.join(`
4
4
  `),M=r.trim().toLocaleLowerCase(),A=(0,i.useMemo)(()=>{let c=new Map(l.skills.map(g=>[g.name,g]));for(let g of l.names)c.has(g)||c.set(g,{name:g});return[...c.values()].sort((g,S)=>g.name.localeCompare(S.name))},[l.names,l.skills]),j=(0,i.useMemo)(()=>M?A.filter(c=>`${c.name} ${c.description||""}`.toLocaleLowerCase().includes(M)):A,[M,A]),L=!Dl(w,l.names),h=(0,i.useCallback)(()=>{let c=k.current;if(!c||typeof window>"u")return;let g=c.getBoundingClientRect(),S=12,$=7,a=Math.min(370,Math.max(260,window.innerWidth-S*2)),C=Math.min(Math.max(S,g.left),Math.max(S,window.innerWidth-a-S)),u=Math.max(0,g.top-$-S),P=Math.max(0,window.innerHeight-g.bottom-$-S),H=u>P,Q=H?u:P,U=118+Math.min(A.length,5)*42,W=Math.max(180,Math.min(U,Q));D({left:C,top:H?Math.max(S,g.top-$-W):g.bottom+$,width:a,height:W})},[A.length]);(0,i.useEffect)(()=>{b||R(new Set(l.names))},[x,b]),(0,i.useEffect)(()=>{if(!b||typeof document>"u")return;let c=g=>{o.current?.contains(g.target)||f.current?.contains(g.target)||(y(!1),p(""),R(new Set(l.names)))};return document.addEventListener("pointerdown",c),window.addEventListener("resize",h),window.addEventListener("scroll",h,!0),h(),()=>{document.removeEventListener("pointerdown",c),window.removeEventListener("resize",h),window.removeEventListener("scroll",h,!0)}},[x,b,h]);function B(){R(new Set(l.names)),p(""),h(),y(!0)}function T(){R(new Set(l.names)),p(""),y(!1)}function F(c){R(g=>{let S=new Set(g);return S.has(c)?S.delete(c):S.add(c),S})}async function q(){let c=[...w].sort((g,S)=>g.localeCompare(S));try{await l.onSave(c),p(""),y(!1)}catch{}}let z=l.names.length===0?s("skills.pickerPlaceholder"):l.names.length===1?l.names[0]:s("skills.pickerSelectedCount",{count:l.names.length}),_=b?(0,e.jsxs)("div",{ref:f,className:"skills-multi-picker-popover",style:I?{left:I.left,top:I.top,width:I.width,height:I.height}:void 0,children:[(0,e.jsxs)("div",{className:"skills-multi-picker-head",children:[(0,e.jsxs)("label",{className:"skills-multi-picker-search",children:[(0,e.jsx)("span",{className:"skills-multi-picker-search-icon","aria-hidden":"true"}),(0,e.jsx)("input",{type:"search","data-action":"search-skills",autoFocus:!0,autoComplete:"off",value:r,placeholder:s("skills.pickerSearchPlaceholder"),onChange:c=>p(c.currentTarget.value),onKeyDown:c=>{c.key==="Escape"&&(c.preventDefault(),T())}})]}),(0,e.jsxs)("div",{className:"skills-multi-picker-meta",children:[(0,e.jsx)("span",{children:s("skills.pickerSelectionMeta",{selected:w.size,total:A.length})}),w.size>0?(0,e.jsx)("button",{type:"button",className:"skills-multi-picker-clear","data-action":"clear-skill-selection",onClick:()=>R(new Set),children:s("skills.pickerClear")}):null]})]}),(0,e.jsxs)("div",{className:"skills-multi-picker-options",role:"listbox","aria-label":s("skills.priority"),"aria-multiselectable":"true",children:[j.map(c=>{let g=w.has(c.name),S=!l.installedNames.has(c.name);return(0,e.jsxs)("button",{type:"button",className:`skills-multi-picker-option${g?" selected":""}${S?" dangling":""}`,role:"option","aria-selected":g,"data-skill-name":c.name,onClick:()=>F(c.name),children:[(0,e.jsx)("span",{className:"skills-multi-picker-check","aria-hidden":"true"}),(0,e.jsxs)("span",{className:"skills-multi-picker-option-copy",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("b",{children:c.name}),S?(0,e.jsx)("em",{children:s("skills.dangling")}):null]}),c.description?(0,e.jsx)("small",{children:c.description}):null]})]},c.name)}),j.length===0?(0,e.jsx)("p",{className:"skills-multi-picker-empty",children:s("skills.pickerNoResults")}):null]}),(0,e.jsxs)("footer",{className:"skills-multi-picker-actions",children:[(0,e.jsx)("button",{type:"button",className:"ghost","data-action":"cancel-skill-selection",disabled:l.busy,onClick:T,children:s("skills.cancel")}),(0,e.jsx)("button",{type:"button",className:"primary","data-action":"save-skill-selection",disabled:!L||l.busy,onClick:()=>{q()},children:l.busy?s("skills.saving"):s("skills.saveSelection")})]})]}):null;return(0,e.jsxs)("div",{ref:o,className:`skills-multi-picker${b?" open":""}`,"data-skill-picker":l.botId,children:[(0,e.jsxs)("button",{ref:k,type:"button",className:"skills-multi-picker-trigger","data-action":"open-skill-picker","aria-haspopup":"listbox","aria-expanded":b,disabled:l.busy,onClick:()=>b?T():B(),children:[(0,e.jsxs)("span",{className:"skills-multi-picker-trigger-copy",children:[(0,e.jsx)("b",{children:z}),(0,e.jsx)("small",{children:s("skills.pickerTriggerHint")})]}),(0,e.jsx)("span",{className:"skills-multi-picker-chevron","aria-hidden":"true"})]}),_&&typeof document<"u"?(0,qe.createPortal)(_,document.body):_]})}function Ml(l){let s=K(),{bot:o,installedNames:k,skills:f,status:b,busyKey:y,onSave:r}=l,p=o.botName??o.larkAppId,w=ke(o.skills);return o.error?(0,e.jsxs)("article",{className:"bd-card skills-bot-card","data-appid":o.larkAppId,children:[(0,e.jsxs)("header",{children:[(0,e.jsx)(Ce,{html:we({name:p,larkAppId:o.larkAppId,size:"sm"})}),(0,e.jsx)("strong",{children:p})]}),(0,e.jsx)("p",{className:"hint-warn-inline",children:o.error})]}):(0,e.jsxs)("article",{className:"bd-card skills-bot-card","data-appid":o.larkAppId,children:[(0,e.jsxs)("header",{className:"skills-bot-head",children:[(0,e.jsx)(Ce,{html:we({name:p,larkAppId:o.larkAppId,size:"sm",dot:"ok"})}),(0,e.jsxs)("div",{className:"skills-bot-title-line",children:[(0,e.jsx)("strong",{children:p}),(0,e.jsx)("span",{className:"skills-count-pill",children:s("skills.skillCount",{count:w.length})})]})]}),(0,e.jsxs)("section",{className:"skills-policy-panel",children:[(0,e.jsx)("div",{className:"skills-priority-head",children:(0,e.jsx)("h3",{className:"skills-priority-title",children:s("skills.priority")})}),(0,e.jsx)(xl,{botId:o.larkAppId,names:w,installedNames:k,skills:f,busy:y===`${o.larkAppId}:set`,onSave:R=>r(o.larkAppId,R)})]}),(0,e.jsx)("span",{className:Re(b),"data-bot-status":!0,children:b?.text??""})]})}function $l(l){return He(l,(0,e.jsx)(Tl,{}))}export{Ml as BotPolicyCard,Il as InstalledSkillsLibrary,Pl as RemoveSkillsDialog,xl as SkillMultiPicker,Rl as SkillsInstallPanel,$l as renderSkillsPage};
@@ -1 +1 @@
1
- import{a as G,b as J,c as S,d as re}from"./chunk-EVK77ASG.js";import{b as E}from"./chunk-OEJIT66L.js";import{a as oe,d as q,g as ie,p as se}from"./chunk-SRIE4MLQ.js";import"./chunk-PNK3HQBI.js";import{a as K}from"./chunk-SYC6D5XU.js";import{a as z,d as ne}from"./chunk-5THX4DI2.js";import{c as L}from"./chunk-7SZRL6FY.js";var d=L(z(),1);async function V(){return G("/api/team/hosted")}async function le(){return G("/api/team/remote-roster")}async function de(t,a){return re("/api/team/local-bots/"+encodeURIComponent(t)+"/capability",{capability:a})}async function me(t){return G("/api/team/local-bots/"+encodeURIComponent(t)+"/role")}async function ce(t){return S("/api/team/identity/auto-bind",t?{unionId:t}:void 0)}async function ue(t,a){return J("DELETE",`/api/team/hosted/${encodeURIComponent(t)}/members/${encodeURIComponent(a)}`)}async function pe(t,a,n){return S("/api/team/federated-group",{name:a,larkAppIds:n,teamId:t})}async function ge(t,a,n,o){return S("/api/team/remote-group",{hubUrl:t,teamId:a,name:n,larkAppIds:o})}async function ye(t){return S("/api/team/hosted",{name:t})}async function fe(t){return J("DELETE","/api/team/hosted/"+encodeURIComponent(t))}async function be(t){return S("/api/team/local-invite",{teamId:t})}async function ke(t,a){return S("/api/team/join-remote",{hubUrl:t,inviteCode:a})}function F(t,a){let n=a.query.trim().toLowerCase();return!(n&&!((t.name||"")+" "+(t.cliId||"")+" "+(t.capability||"")).toLowerCase().includes(n)||a.cliId&&t.cliId!==a.cliId||a.hasCapability&&!t.capability||a.hasRole&&!t.hasTeamRole)}function he(t){return Array.from(new Set(t.flatMap(a=>a.bots.map(n=>n.cliId)).filter(Boolean))).sort()}function ve(t,a){return(t.teams||[]).map(n=>({kind:"local",key:`local:${n.teamId}`,teamId:n.teamId,label:n.isDefault?a("team.myHostedTeam"):n.name,sub:"",ok:!0,deployments:n.deployments||[],bots:n.bots||[]}))}function Te(t,a){return(t.memberships||[]).map(o=>{let m=o.roster?.deployments||[],r=m.find(v=>v.local),p=r?.name?a("team.remoteTeamLabel",{name:r.name}):o.teamName||o.teamId;return{kind:"remote",key:`${o.hubUrl}::${o.teamId}`,teamId:o.teamId,label:p,sub:o.hubUrl,ok:!!o.ok,error:o.error,hubUrl:o.hubUrl,deployments:m,bots:o.roster?.bots||[]}})}function W(t,a,n){return t.map(o=>({...o,bots:o.bots.map(m=>m.larkAppId===a?{...m,capability:n.trim()||null}:m)}))}var e=L(ne(),1),we=L(z(),1);function Ie(){let t=(0,d.useRef)(!0);return(0,d.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Ce(t){let a=E(),n=t.active==="home",o=t.active==="manage";return(0,e.jsxs)("nav",{className:"team-subnav insight-tabs",role:"tablist","aria-label":a("team.eyebrow"),children:[(0,e.jsx)("a",{href:"#/team",className:`itab${n?" on":""}`,role:"tab","aria-selected":n,children:a("team.navHome")}),(0,e.jsx)("a",{href:"#/team/manage",className:`itab${o?" on":""}`,role:"tab","aria-selected":o,children:a("team.navManage")})]})}function Q(t,a){return t.get(a)??new Set}function He(){let t=E(),a=Ie(),[n,o]=(0,d.useState)([]),[m,r]=(0,d.useState)([]),[p,v]=(0,d.useState)(""),[N,T]=(0,d.useState)(t("team.unbound")),[u,R]=(0,d.useState)({query:"",cliId:"",hasCapability:!1,hasRole:!1}),[P,M]=(0,d.useState)(()=>new Map),[D,x]=(0,d.useState)(()=>new Map),[O,I]=(0,d.useState)(()=>new Set),[B,A]=(0,d.useState)(()=>new Set),[U,C]=(0,d.useState)({kind:"hidden"}),[j,c]=(0,d.useState)(()=>new Map),[g,h]=(0,d.useState)(null),y=(0,d.useMemo)(()=>[...n,...m],[n,m]),Y=(0,d.useMemo)(()=>he(y),[y]),Z=(0,d.useMemo)(()=>[{value:"",label:t("team.allCli")},...Y.map(i=>({value:i,label:i}))],[Y,t]),H=(0,d.useCallback)(async()=>{let i=await V();if(!a.current)return;let s=i.body;if(!s?.ok){o([]);return}v(s.deployment?.deploymentId??""),T(s.deployment?.ownerName||(s.deployment?.ownerUnionId?t("team.bound"):t("team.unbound"))),o(ve(s,t))},[a,t]),ee=(0,d.useCallback)(async()=>{let i=await le();a.current&&r(Te(i.body,t))},[a,t]);(0,d.useEffect)(()=>{M(new Map),x(new Map),I(new Set),A(new Set),H(),ee()},[H,ee]),(0,d.useEffect)(()=>{T(i=>i==="\u672A\u7ED1\u5B9A"||i==="Unbound"?t("team.unbound"):i)},[t]),(0,d.useEffect)(()=>{let i=new Map;for(let s of y)i.set(s.key,new Set(s.bots.filter(l=>F(l,u)).map(l=>l.larkAppId)));M(s=>{let l=!1,f=new Map;for(let[b,k]of s){let w=i.get(b),$=new Set([...k].filter(Ae=>w?.has(Ae)));$.size!==k.size&&(l=!0),$.size&&f.set(b,$)}return l?f:s})},[u,y]);let te=(0,d.useMemo)(()=>{if(!y.length)return"";let i=new Set,s=new Set;for(let b of y)b.bots.filter(w=>F(w,u)).forEach(w=>i.add(w.larkAppId)),b.bots.forEach(w=>s.add(w.larkAppId));let l=y.length>1?t("team.acrossTeams",{n:y.length}):"";return`\xB7 ${i.size===s.size?`${s.size}`:`${i.size} / ${s.size}`} ${t("team.botsWord")}${l}`},[u,y,t]);function _(i,s){c(l=>{let f=new Map(l);return f.set(i,s),f})}function Se(i,s,l){M(f=>{let b=new Map(f),k=new Set(b.get(i)??[]);return l?k.add(s):k.delete(s),k.size?b.set(i,k):b.delete(i),b})}function Me(i,s){x(l=>{let f=new Map(l);return s?f.set(i,s):f.delete(i),f})}async function xe(i,s){await de(i,s),a.current&&(o(l=>W(l,i,s)),r(l=>W(l,i,s)))}async function Be(i,s){let l=await me(i);a.current&&h({app:i,name:s,content:l.body?.role||""})}async function Pe(i,s,l){confirm(t("team.removeMemberConfirm",{name:l}))&&(await ue(i,s),a.current&&H())}async function De(i){let s=[...Q(P,i.key)];if(!s.length){_(i.key,{kind:"err",key:"team.errPickBot"});return}let l=(D.get(i.key)||"").trim()||t("team.defaultGroupName");_(i.key,{kind:"muted",key:"team.creatingGroup"});let f=i.kind==="local"?await pe(i.teamId,l,s):await ge(i.hubUrl,i.teamId,l,s);a.current&&(_(i.key,{kind:"group-result",body:f.body,status:f.status}),f.body?.ok&&(M(b=>{let k=new Map(b);return k.delete(i.key),k}),x(b=>{let k=new Map(b);return k.delete(i.key),k}),i.kind==="local"&&H()))}async function ae(i){C({kind:"loading",key:i?"team.binding":"team.identifying"});let s=await ce(i);if(!a.current)return;let l=s.body;if(l?.ok&&l.owner){C({kind:"ok",name:l.owner.name||l.owner.unionId||""}),H();return}if(l?.ok&&l.needChoice&&Array.isArray(l.candidates)){C({kind:"choice",candidates:l.candidates});return}if(l?.error==="no_candidates"){C({kind:"err",key:"team.noCandidates"});return}C({kind:"bind-fail",error:String(l?.error||"unknown")})}return(0,e.jsxs)("section",{className:"page team-page team-home-page",children:[(0,e.jsxs)("div",{className:"page-heading",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:t("team.eyebrow")}),(0,e.jsx)("h1",{children:t("team.homeTitle")})]}),(0,e.jsx)("div",{className:"page-heading-actions",children:(0,e.jsx)(Ce,{active:"home"})})]}),(0,e.jsxs)("section",{className:"overview-block team-identity-section",children:[(0,e.jsx)(q,{title:t("team.localDeployTitle"),hint:t("team.bindHint")}),(0,e.jsx)("div",{className:"card team-card team-identity-card",children:(0,e.jsxs)("p",{className:"team-identity-row",children:[(0,e.jsx)("span",{className:"team-identity-label",children:t("team.myIdentity")}),(0,e.jsx)("b",{id:"tf-owner",children:N}),(0,e.jsx)("button",{type:"button",id:"tf-autobind",className:"page-primary-action",onClick:()=>{ae()},children:t("team.bindBtn")}),(0,e.jsx)("span",{id:"tf-bind-out",className:"team-bind-status",hidden:U.kind==="hidden",children:(0,e.jsx)(Le,{state:U,tr:t,onPick:i=>{ae(i)}})})]})})]}),(0,e.jsxs)("section",{className:"overview-block team-roster-section",children:[(0,e.jsx)(q,{title:t("team.myTeams"),count:te?te.replace(/^·\s*/,""):void 0,hint:t("team.teamsHint")}),(0,e.jsxs)("div",{className:"card team-card team-roster-card",children:[(0,e.jsxs)("form",{className:"team-filters dashboard-toolbar",onSubmit:i=>i.preventDefault(),children:[(0,e.jsx)("input",{id:"tf-search",type:"search",placeholder:t("team.searchPh"),value:u.query,onChange:i=>R(s=>({...s,query:i.target.value}))}),(0,e.jsx)(se,{id:"tf-cli",className:"team-cli-menu",ariaLabel:t("team.allCli"),value:u.cliId,label:oe(Z,u.cliId),options:Z,onChange:i=>R(s=>({...s,cliId:i}))}),(0,e.jsxs)("label",{className:"filter-toggle",children:[(0,e.jsx)("input",{type:"checkbox",id:"tf-fcap",checked:u.hasCapability,onChange:i=>R(s=>({...s,hasCapability:i.target.checked}))}),(0,e.jsx)("span",{className:"filter-toggle-switch","aria-hidden":"true"}),(0,e.jsx)("span",{className:"filter-toggle-label",children:t("team.hasCap")})]}),(0,e.jsxs)("label",{className:"filter-toggle",children:[(0,e.jsx)("input",{type:"checkbox",id:"tf-frole",checked:u.hasRole,onChange:i=>R(s=>({...s,hasRole:i.target.checked}))}),(0,e.jsx)("span",{className:"filter-toggle-switch","aria-hidden":"true"}),(0,e.jsx)("span",{className:"filter-toggle-label",children:t("team.hasRole")})]})]}),(0,e.jsx)("div",{id:"tf-teams",children:(0,e.jsx)(Oe,{teams:y,filters:u,pickedByTeam:P,gnameByTeam:D,expandedTeams:O,expandedDeps:B,groupOutputs:j,myDeploymentId:p,tr:t,onToggleTeam:i=>I(s=>Ne(s,i)),onToggleDep:i=>A(s=>Ne(s,i)),onPick:Se,onGroupNameChange:Me,onCapabilityChange:(i,s)=>{xe(i,s)},onOpenRole:(i,s)=>{Be(i,s)},onRemoveMember:(i,s,l)=>{Pe(i,s,l)},onPullGroup:i=>{De(i)}})})]})]}),(0,e.jsx)(_e,{state:g,tr:t,onClose:()=>h(null)})]})}function Ne(t,a){let n=new Set(t);return n.has(a)?n.delete(a):n.add(a),n}function Le(t){let{state:a,tr:n}=t;return a.kind==="hidden"?null:a.kind==="loading"?(0,e.jsx)("span",{className:"team-bind-loading",children:n(a.key)}):a.kind==="ok"?(0,e.jsx)("span",{className:"ok",children:n("team.bound2",{name:a.name})}):a.kind==="choice"?(0,e.jsxs)(e.Fragment,{children:[n("team.multiCandidate"),(0,e.jsx)("br",{}),a.candidates.map(o=>(0,e.jsx)("button",{type:"button",className:"tf-pickowner ghost","data-union":o.unionId,style:{margin:"2px"},onClick:()=>t.onPick(o.unionId),children:o.name||o.unionId},o.unionId))]}):a.kind==="err"?(0,e.jsx)("span",{className:"err",children:n(a.key)}):(0,e.jsx)("span",{className:"err",children:n("team.bindFail",{error:a.error})})}function Oe(t){let{tr:a}=t;return t.teams.length?(0,e.jsx)(e.Fragment,{children:t.teams.map(n=>{let o=n.bots.filter(p=>F(p,t.filters)),m=!t.expandedTeams.has(n.key),r=n.kind==="remote"?n.ok?(0,e.jsx)("span",{className:"team-status-pill ok",children:a("team.connected")}):(0,e.jsx)("span",{className:"team-status-pill err",children:a("team.connectFail",{error:n.error||""})}):(0,e.jsx)("span",{className:"team-status-pill muted",children:a("team.iHost")});return(0,e.jsxs)("article",{className:"card team-list-card",children:[(0,e.jsxs)("button",{type:"button",className:"tf-team-h","data-tk":n.key,"aria-expanded":!m,onClick:()=>t.onToggleTeam(n.key),children:[(0,e.jsx)("span",{className:"team-chevron","aria-hidden":"true",children:m?"\u203A":"\u2304"}),(0,e.jsx)("b",{children:n.label}),n.sub?(0,e.jsx)("span",{className:"muted",children:n.sub}):null,r,(0,e.jsx)("span",{className:"team-meta-pill",children:a("team.teamMeta",{deps:n.deployments.length,bots:n.bots.length})})]}),m?null:n.kind==="remote"&&!n.ok?(0,e.jsx)("p",{className:"muted",style:{margin:"8px 0 0"},children:a("team.rosterFail")}):(0,e.jsx)(Ue,{...t,team:n,filtered:o})]},n.key)})}):(0,e.jsx)("p",{className:"muted",children:a("team.noTeams")})}function Ue(t){let{team:a,tr:n}=t,o=[...a.deployments].sort((r,p)=>r.local===p.local?0:r.local?-1:1),m=o.some(r=>t.filtered.some(p=>p.deployment.id===r.id));return(0,e.jsxs)(e.Fragment,{children:[o.map(r=>(0,we.createElement)(je,{...t,deployment:r,key:r.id})),m?null:(0,e.jsx)("p",{className:"muted",style:{margin:"8px 0 0"},children:n("team.noMatch")}),(0,e.jsxs)("div",{className:"team-pull-row",children:[(0,e.jsxs)("label",{className:"team-pill-field team-group-name-field",children:[(0,e.jsx)("span",{children:n("team.gnameLabel")}),(0,e.jsx)("input",{className:"tf-gname","data-tk":a.key,value:t.gnameByTeam.get(a.key)||"",placeholder:n("team.gnamePlaceholder"),onChange:r=>t.onGroupNameChange(a.key,r.target.value)})]}),(0,e.jsx)("button",{className:"tf-grp page-primary-action","data-tk":a.key,onClick:()=>t.onPullGroup(a),children:n("team.pullGroupBtn")}),(0,e.jsx)("span",{className:"muted team-pull-hint",children:n("team.pullGroupHint")}),(0,e.jsx)("span",{className:"tf-gout","data-tk":a.key,children:(0,e.jsx)(Ge,{output:t.groupOutputs.get(a.key),tr:n})})]})]})}function je(t){let{team:a,deployment:n,tr:o}=t,m=t.filtered.filter(u=>u.deployment.id===n.id);if(!m.length)return null;let r=n.id===t.myDeploymentId,p=r?o("team.tagLocal"):n.stale?o("team.tagRemoteStale"):o("team.tagRemote"),v=`${a.key}::${n.id}`,N=t.expandedDeps.has(v),T=m.filter(u=>Q(t.pickedByTeam,a.key).has(u.larkAppId)).length;return(0,e.jsxs)("section",{className:"team-deployment-block",children:[(0,e.jsxs)("div",{className:"tf-dep-h","data-dk":v,"aria-expanded":N,role:"button",tabIndex:0,onClick:()=>t.onToggleDep(v),onKeyDown:u=>{u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),t.onToggleDep(v))},children:[(0,e.jsx)("span",{className:"team-chevron","aria-hidden":"true",children:N?"\u2304":"\u203A"}),(0,e.jsx)("b",{children:n.name}),(0,e.jsxs)("span",{className:"muted",children:[o("team.depTag",{tag:p})," \xB7 ",o("team.depCount",{count:m.length}),T?o("team.depSelected",{n:T}):""]}),a.kind==="local"&&!r?(0,e.jsx)("button",{type:"button",className:"tf-rmmember ghost","data-team":a.teamId,"data-dep":n.id,"data-name":n.name,onClick:u=>{u.stopPropagation(),t.onRemoveMember(a.teamId,n.id,n.name)},children:o("team.removeMember")}):null]}),N?(0,e.jsx)("div",{className:"team-roster-list",children:m.map(u=>(0,e.jsx)(Ee,{bot:u,mine:r,picked:Q(t.pickedByTeam,a.key).has(u.larkAppId),teamKey:a.key,tr:o,onPick:t.onPick,onCapabilityChange:t.onCapabilityChange,onOpenRole:t.onOpenRole},u.larkAppId))}):null]})}function Ee(t){let{bot:a,tr:n}=t,o=a.deployment.stale?{opacity:.55}:void 0,m=()=>t.onPick(t.teamKey,a.larkAppId,!t.picked);return(0,e.jsxs)("article",{className:`team-bot-row${t.picked?" selected":""}`,style:o,role:"checkbox","aria-checked":t.picked,tabIndex:0,onClick:r=>{Re(r.target)||m()},onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||Re(r.target)||(r.preventDefault(),m())},children:[(0,e.jsxs)("label",{className:`team-check-pill${t.picked?" selected":""}`,onClick:r=>r.stopPropagation(),children:[(0,e.jsx)("input",{type:"checkbox",className:"tf-pick","data-tk":t.teamKey,"data-app":a.larkAppId,checked:t.picked,onChange:r=>t.onPick(t.teamKey,a.larkAppId,r.target.checked)}),(0,e.jsx)("span",{className:"team-check-dot","aria-hidden":"true"})]}),(0,e.jsxs)("div",{className:"team-bot-main",children:[(0,e.jsx)("strong",{children:a.name}),(0,e.jsx)("span",{children:a.larkAppId})]}),(0,e.jsx)("span",{className:"team-meta-pill",children:a.cliId}),(0,e.jsx)("div",{className:"team-capability-cell",children:t.mine?(0,e.jsxs)("label",{className:"team-pill-field team-cap-field",children:[(0,e.jsx)("span",{children:n("team.capLabel")}),(0,e.jsx)("input",{className:"tf-cap","data-app":a.larkAppId,defaultValue:a.capability||"",placeholder:n("team.capPh"),onBlur:r=>{let p=r.target.value;p!==(a.capability||"")&&t.onCapabilityChange(a.larkAppId,p)},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),r.currentTarget.blur())}})]}):a.capability||null}),(0,e.jsx)("div",{className:"team-role-cell",children:a.hasTeamRole?t.mine?(0,e.jsx)("button",{className:"tf-role","data-app":a.larkAppId,"data-name":a.name,onClick:()=>t.onOpenRole(a.larkAppId,a.name),children:n("team.viewRole")}):n("team.hasRoleShort"):(0,e.jsx)("span",{className:"muted",children:"\u2014"})})]})}function Re(t){return t instanceof HTMLElement?!!t.closest('button, input, textarea, select, a, label, [contenteditable="true"]'):!1}function Ge(t){let{output:a,tr:n}=t;return a?a.kind==="muted"?(0,e.jsx)("span",{className:"muted",children:n(a.key)}):a.kind==="err"?(0,e.jsx)("span",{className:"err",children:n(a.key)}):(0,e.jsx)(Fe,{body:a.body,status:a.status,tr:n}):null}function Fe(t){let{body:a,status:n,tr:o}=t;if(a?.ok&&a.chatId){let p=a.shareLink||"https://applink.feishu.cn/client/chat/open?openChatId="+encodeURIComponent(a.chatId);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"ok",children:o("team.groupCreated")}),a.delegatedTo?o("team.delegatedBy",{name:String(a.delegatedTo)}):""," \xB7 ",(0,e.jsx)("a",{href:p,target:"_blank",rel:"noreferrer",children:o("team.openInLark")}),(a.invalidBotIds||[]).length?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.invalidBots",{ids:(a.invalidBotIds||[]).join(", ")})]}):null,(a.invalidOwnerUnionIds||[]).length?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.invalidOwners",{n:(a.invalidOwnerUnionIds||[]).length})]}):null,a.missingOperatorIdentity?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.missingIdentity")]}):null,(a.skippedNoOwner||[]).length?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.skippedNoOwner",{n:(a.skippedNoOwner||[]).length})]}):null]})}let m=a?.error||n,r=m==="no_local_online_bot"?o("team.errNoLocalBot"):m==="all_bots_skipped_no_owner"?o("team.errAllSkipped"):m==="no_creator_available"?o("team.errNoCreator"):m==="delegation_timeout"?o("team.errDelegationTimeout"):o("team.errGroupCreate",{error:String(m)});return(0,e.jsx)("span",{className:"err",children:r})}function _e(t){let{state:a,tr:n}=t;return(0,e.jsx)("div",{id:"tf-modal",className:"team-role-modal","data-app":a?.app,hidden:!a,children:(0,e.jsxs)("div",{className:"team-role-dialog",children:[(0,e.jsx)("h2",{id:"tf-modal-title",children:a?n("team.roleModalTitleName",{name:a.name}):n("team.roleModalTitle")}),(0,e.jsx)("p",{className:"muted",style:{fontSize:"13px"},children:n("team.roleModalHint")}),(0,e.jsx)("textarea",{id:"tf-modal-text",readOnly:!0,value:a?.content??""}),(0,e.jsx)("div",{className:"team-role-actions",children:(0,e.jsx)("button",{type:"button",id:"tf-modal-cancel",onClick:t.onClose,children:n("team.close")})})]})})}function $e(){let t=E(),a=Ie(),[n,o]=(0,d.useState)([]),[m,r]=(0,d.useState)(""),[p,v]=(0,d.useState)(""),[N,T]=(0,d.useState)({kind:"none"}),[u,R]=(0,d.useState)(()=>new Map),[P,M]=(0,d.useState)(""),[D,x]=(0,d.useState)(""),[O,I]=(0,d.useState)({kind:"none"}),B=(0,d.useCallback)(async()=>{let c=await V();if(!a.current)return;let g=c.body;r(h=>g?.suggestedHubUrl||h),o(g?.teams||[])},[a]);(0,d.useEffect)(()=>{B()},[B]);async function A(){let c=p.trim();if(!c){T({kind:"err",key:"team.errName"});return}T({kind:"muted",key:"team.creating"});let g=await ye(c);a.current&&(g.body?.ok?(T({kind:"ok",key:"team.created"}),v(""),B()):T({kind:"create-fail",error:String(g.body?.error||g.status)}))}async function U(c){R(h=>{let y=new Map(h);return y.set(c,{kind:"muted",key:"team.generating"}),y});let g=await be(c);a.current&&R(h=>{let y=new Map(h);return y.set(c,g.body?.code?{kind:"invite",code:g.body.code}:{kind:"err",key:"team.genFail"}),y})}async function C(c,g){confirm(t("team.delConfirm",{name:g}))&&(await fe(c),a.current&&B())}async function j(){let c=P.trim(),g=D.trim();if(I({kind:"muted",key:"team.joining"}),!c||!g){I({kind:"err",key:"team.errHubCode"});return}let h=await ke(c,g);a.current&&(h.body?.ok?(I({kind:"joined",name:String(h.body.teamName||"")}),x("")):I({kind:"join-fail",error:h.body?.error||h.status}))}return(0,e.jsxs)("section",{className:"page team-page team-manage-page",children:[(0,e.jsxs)("div",{className:"page-heading",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:t("team.eyebrow")}),(0,e.jsx)("h1",{children:t("team.manageTitle")})]}),(0,e.jsx)("div",{className:"page-heading-actions",children:(0,e.jsx)(Ce,{active:"manage"})})]}),(0,e.jsxs)("div",{className:"card team-card",children:[(0,e.jsx)("div",{className:"team-card-head",children:(0,e.jsx)("h2",{children:t("team.hostedTitle")})}),(0,e.jsxs)("form",{className:"team-inline-form dashboard-toolbar",onSubmit:c=>{c.preventDefault(),A()},children:[(0,e.jsx)("input",{id:"tm-newname",type:"text",placeholder:t("team.newTeamPh"),value:p,onChange:c=>v(c.target.value)}),(0,e.jsx)(ie,{id:"tm-create",className:"page-primary-action",onClick:()=>{A()},children:t("team.createTeamBtn")}),(0,e.jsx)("span",{className:"toolbar-status tm-cout",children:(0,e.jsx)(X,{status:N,tr:t})})]}),(0,e.jsx)("div",{id:"tm-list",children:(0,e.jsx)(ze,{teams:n,suggestedHubUrl:m,inviteStatuses:u,tr:t,onInvite:c=>{U(c)},onDelete:(c,g)=>{C(c,g)}})})]}),(0,e.jsxs)("div",{className:"card team-card",children:[(0,e.jsx)("div",{className:"team-card-head",children:(0,e.jsx)("h2",{children:t("team.joinTitle")})}),(0,e.jsxs)("form",{className:"team-inline-form dashboard-toolbar team-join-form",onSubmit:c=>{c.preventDefault(),j()},children:[(0,e.jsx)("input",{id:"tm-hub",type:"text",placeholder:t("team.hubPh"),value:P,onChange:c=>M(c.target.value)}),(0,e.jsx)("input",{id:"tm-code",type:"text",placeholder:t("team.codePh"),value:D,onChange:c=>x(c.target.value)}),(0,e.jsx)("button",{type:"button",id:"tm-join",className:"page-primary-action",onClick:()=>{j()},children:t("team.joinBtn")})]}),(0,e.jsx)("div",{id:"tm-join-out",className:"team-inline-output",hidden:O.kind==="none",children:(0,e.jsx)(X,{status:O,tr:t})})]})]})}function ze(t){let{teams:a,tr:n}=t;return a.length?(0,e.jsx)(e.Fragment,{children:a.map(o=>{let m=(o.deployments||[]).filter(p=>!p.local).length,r=t.inviteStatuses.get(o.teamId)??{kind:"none"};return(0,e.jsxs)("div",{className:"card team-list-card team-manage-card",children:[(0,e.jsxs)("div",{className:"team-manage-head",children:[(0,e.jsx)("b",{children:o.name}),o.isDefault?(0,e.jsx)("span",{className:"team-status-pill muted",children:n("team.default")}):null,(0,e.jsxs)("span",{className:"team-meta-pill",children:[n("team.manageMetaDeps",{count:(o.deployments||[]).length}),m?n("team.manageMetaRemote",{r:m}):""," \xB7 ",n("team.manageMetaBots",{count:(o.bots||[]).length})]}),(0,e.jsxs)("span",{className:"team-manage-actions",children:[(0,e.jsx)("button",{className:"tm-invite ghost","data-team":o.teamId,onClick:()=>t.onInvite(o.teamId),children:n("team.genInvite")}),o.isDefault?null:(0,e.jsx)("button",{className:"tm-del ghost","data-team":o.teamId,"data-name":o.name,onClick:()=>t.onDelete(o.teamId,o.name),children:n("team.delBtn")})]})]}),(0,e.jsx)("div",{className:"tm-inv-out team-inline-output","data-team":o.teamId,hidden:r.kind==="none",children:(0,e.jsx)(X,{status:r,tr:n,suggestedHubUrl:t.suggestedHubUrl})})]},o.teamId)})}):(0,e.jsx)("p",{className:"muted",children:n("team.noTeamsShort")})}function X(t){let{status:a,tr:n}=t;if(a.kind==="none")return null;if(a.kind==="muted")return(0,e.jsx)("span",{className:"muted",children:n(a.key)});if(a.kind==="ok")return(0,e.jsx)("span",{className:"ok",children:n(a.key)});if(a.kind==="err")return(0,e.jsx)("span",{className:"err",children:n(a.key)});if(a.kind==="create-fail")return(0,e.jsx)("span",{className:"err",children:n("team.createFail",{error:a.error})});if(a.kind==="invite")return(0,e.jsxs)(e.Fragment,{children:[n("team.inviteResultLede"),(0,e.jsx)("br",{}),n("team.inviteHub"),(0,e.jsx)("code",{children:t.suggestedHubUrl||""}),(0,e.jsx)("br",{}),n("team.inviteCode"),(0,e.jsx)("code",{className:"team-invite-code",children:a.code})]});if(a.kind==="joined")return(0,e.jsx)("span",{className:"ok",children:n("team.joined",{name:a.name})});let o=a.error,m=o==="cannot_join_self"?n("team.joinErrSelf"):o==="deployment_already_joined"?n("team.joinErrAlready"):o==="hub_unreachable"?n("team.joinErrUnreachable"):o==="hub_timeout"?n("team.joinErrTimeout"):n("team.joinErrGeneric",{error:String(o)});return(0,e.jsx)("span",{className:"err",children:m})}function Xe(t){return K(t,(0,e.jsx)(He,{}))}function Ye(t){return K(t,(0,e.jsx)($e,{}))}export{Xe as renderTeamFederationPage,Ye as renderTeamManagePage};
1
+ import{a as G,b as J,c as S,d as re}from"./chunk-EVK77ASG.js";import{b as E}from"./chunk-CMDPZOPK.js";import{a as oe,d as q,g as ie,p as se}from"./chunk-I35DXGM4.js";import"./chunk-NYZHARIU.js";import{a as K}from"./chunk-SYC6D5XU.js";import{a as z,d as ne}from"./chunk-5THX4DI2.js";import{c as L}from"./chunk-7SZRL6FY.js";var d=L(z(),1);async function V(){return G("/api/team/hosted")}async function le(){return G("/api/team/remote-roster")}async function de(t,a){return re("/api/team/local-bots/"+encodeURIComponent(t)+"/capability",{capability:a})}async function me(t){return G("/api/team/local-bots/"+encodeURIComponent(t)+"/role")}async function ce(t){return S("/api/team/identity/auto-bind",t?{unionId:t}:void 0)}async function ue(t,a){return J("DELETE",`/api/team/hosted/${encodeURIComponent(t)}/members/${encodeURIComponent(a)}`)}async function pe(t,a,n){return S("/api/team/federated-group",{name:a,larkAppIds:n,teamId:t})}async function ge(t,a,n,o){return S("/api/team/remote-group",{hubUrl:t,teamId:a,name:n,larkAppIds:o})}async function ye(t){return S("/api/team/hosted",{name:t})}async function fe(t){return J("DELETE","/api/team/hosted/"+encodeURIComponent(t))}async function be(t){return S("/api/team/local-invite",{teamId:t})}async function ke(t,a){return S("/api/team/join-remote",{hubUrl:t,inviteCode:a})}function F(t,a){let n=a.query.trim().toLowerCase();return!(n&&!((t.name||"")+" "+(t.cliId||"")+" "+(t.capability||"")).toLowerCase().includes(n)||a.cliId&&t.cliId!==a.cliId||a.hasCapability&&!t.capability||a.hasRole&&!t.hasTeamRole)}function he(t){return Array.from(new Set(t.flatMap(a=>a.bots.map(n=>n.cliId)).filter(Boolean))).sort()}function ve(t,a){return(t.teams||[]).map(n=>({kind:"local",key:`local:${n.teamId}`,teamId:n.teamId,label:n.isDefault?a("team.myHostedTeam"):n.name,sub:"",ok:!0,deployments:n.deployments||[],bots:n.bots||[]}))}function Te(t,a){return(t.memberships||[]).map(o=>{let m=o.roster?.deployments||[],r=m.find(v=>v.local),p=r?.name?a("team.remoteTeamLabel",{name:r.name}):o.teamName||o.teamId;return{kind:"remote",key:`${o.hubUrl}::${o.teamId}`,teamId:o.teamId,label:p,sub:o.hubUrl,ok:!!o.ok,error:o.error,hubUrl:o.hubUrl,deployments:m,bots:o.roster?.bots||[]}})}function W(t,a,n){return t.map(o=>({...o,bots:o.bots.map(m=>m.larkAppId===a?{...m,capability:n.trim()||null}:m)}))}var e=L(ne(),1),we=L(z(),1);function Ie(){let t=(0,d.useRef)(!0);return(0,d.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Ce(t){let a=E(),n=t.active==="home",o=t.active==="manage";return(0,e.jsxs)("nav",{className:"team-subnav insight-tabs",role:"tablist","aria-label":a("team.eyebrow"),children:[(0,e.jsx)("a",{href:"#/team",className:`itab${n?" on":""}`,role:"tab","aria-selected":n,children:a("team.navHome")}),(0,e.jsx)("a",{href:"#/team/manage",className:`itab${o?" on":""}`,role:"tab","aria-selected":o,children:a("team.navManage")})]})}function Q(t,a){return t.get(a)??new Set}function He(){let t=E(),a=Ie(),[n,o]=(0,d.useState)([]),[m,r]=(0,d.useState)([]),[p,v]=(0,d.useState)(""),[N,T]=(0,d.useState)(t("team.unbound")),[u,R]=(0,d.useState)({query:"",cliId:"",hasCapability:!1,hasRole:!1}),[P,M]=(0,d.useState)(()=>new Map),[D,x]=(0,d.useState)(()=>new Map),[O,I]=(0,d.useState)(()=>new Set),[B,A]=(0,d.useState)(()=>new Set),[U,C]=(0,d.useState)({kind:"hidden"}),[j,c]=(0,d.useState)(()=>new Map),[g,h]=(0,d.useState)(null),y=(0,d.useMemo)(()=>[...n,...m],[n,m]),Y=(0,d.useMemo)(()=>he(y),[y]),Z=(0,d.useMemo)(()=>[{value:"",label:t("team.allCli")},...Y.map(i=>({value:i,label:i}))],[Y,t]),H=(0,d.useCallback)(async()=>{let i=await V();if(!a.current)return;let s=i.body;if(!s?.ok){o([]);return}v(s.deployment?.deploymentId??""),T(s.deployment?.ownerName||(s.deployment?.ownerUnionId?t("team.bound"):t("team.unbound"))),o(ve(s,t))},[a,t]),ee=(0,d.useCallback)(async()=>{let i=await le();a.current&&r(Te(i.body,t))},[a,t]);(0,d.useEffect)(()=>{M(new Map),x(new Map),I(new Set),A(new Set),H(),ee()},[H,ee]),(0,d.useEffect)(()=>{T(i=>i==="\u672A\u7ED1\u5B9A"||i==="Unbound"?t("team.unbound"):i)},[t]),(0,d.useEffect)(()=>{let i=new Map;for(let s of y)i.set(s.key,new Set(s.bots.filter(l=>F(l,u)).map(l=>l.larkAppId)));M(s=>{let l=!1,f=new Map;for(let[b,k]of s){let w=i.get(b),$=new Set([...k].filter(Ae=>w?.has(Ae)));$.size!==k.size&&(l=!0),$.size&&f.set(b,$)}return l?f:s})},[u,y]);let te=(0,d.useMemo)(()=>{if(!y.length)return"";let i=new Set,s=new Set;for(let b of y)b.bots.filter(w=>F(w,u)).forEach(w=>i.add(w.larkAppId)),b.bots.forEach(w=>s.add(w.larkAppId));let l=y.length>1?t("team.acrossTeams",{n:y.length}):"";return`\xB7 ${i.size===s.size?`${s.size}`:`${i.size} / ${s.size}`} ${t("team.botsWord")}${l}`},[u,y,t]);function _(i,s){c(l=>{let f=new Map(l);return f.set(i,s),f})}function Se(i,s,l){M(f=>{let b=new Map(f),k=new Set(b.get(i)??[]);return l?k.add(s):k.delete(s),k.size?b.set(i,k):b.delete(i),b})}function Me(i,s){x(l=>{let f=new Map(l);return s?f.set(i,s):f.delete(i),f})}async function xe(i,s){await de(i,s),a.current&&(o(l=>W(l,i,s)),r(l=>W(l,i,s)))}async function Be(i,s){let l=await me(i);a.current&&h({app:i,name:s,content:l.body?.role||""})}async function Pe(i,s,l){confirm(t("team.removeMemberConfirm",{name:l}))&&(await ue(i,s),a.current&&H())}async function De(i){let s=[...Q(P,i.key)];if(!s.length){_(i.key,{kind:"err",key:"team.errPickBot"});return}let l=(D.get(i.key)||"").trim()||t("team.defaultGroupName");_(i.key,{kind:"muted",key:"team.creatingGroup"});let f=i.kind==="local"?await pe(i.teamId,l,s):await ge(i.hubUrl,i.teamId,l,s);a.current&&(_(i.key,{kind:"group-result",body:f.body,status:f.status}),f.body?.ok&&(M(b=>{let k=new Map(b);return k.delete(i.key),k}),x(b=>{let k=new Map(b);return k.delete(i.key),k}),i.kind==="local"&&H()))}async function ae(i){C({kind:"loading",key:i?"team.binding":"team.identifying"});let s=await ce(i);if(!a.current)return;let l=s.body;if(l?.ok&&l.owner){C({kind:"ok",name:l.owner.name||l.owner.unionId||""}),H();return}if(l?.ok&&l.needChoice&&Array.isArray(l.candidates)){C({kind:"choice",candidates:l.candidates});return}if(l?.error==="no_candidates"){C({kind:"err",key:"team.noCandidates"});return}C({kind:"bind-fail",error:String(l?.error||"unknown")})}return(0,e.jsxs)("section",{className:"page team-page team-home-page",children:[(0,e.jsxs)("div",{className:"page-heading",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:t("team.eyebrow")}),(0,e.jsx)("h1",{children:t("team.homeTitle")})]}),(0,e.jsx)("div",{className:"page-heading-actions",children:(0,e.jsx)(Ce,{active:"home"})})]}),(0,e.jsxs)("section",{className:"overview-block team-identity-section",children:[(0,e.jsx)(q,{title:t("team.localDeployTitle"),hint:t("team.bindHint")}),(0,e.jsx)("div",{className:"card team-card team-identity-card",children:(0,e.jsxs)("p",{className:"team-identity-row",children:[(0,e.jsx)("span",{className:"team-identity-label",children:t("team.myIdentity")}),(0,e.jsx)("b",{id:"tf-owner",children:N}),(0,e.jsx)("button",{type:"button",id:"tf-autobind",className:"page-primary-action",onClick:()=>{ae()},children:t("team.bindBtn")}),(0,e.jsx)("span",{id:"tf-bind-out",className:"team-bind-status",hidden:U.kind==="hidden",children:(0,e.jsx)(Le,{state:U,tr:t,onPick:i=>{ae(i)}})})]})})]}),(0,e.jsxs)("section",{className:"overview-block team-roster-section",children:[(0,e.jsx)(q,{title:t("team.myTeams"),count:te?te.replace(/^·\s*/,""):void 0,hint:t("team.teamsHint")}),(0,e.jsxs)("div",{className:"card team-card team-roster-card",children:[(0,e.jsxs)("form",{className:"team-filters dashboard-toolbar",onSubmit:i=>i.preventDefault(),children:[(0,e.jsx)("input",{id:"tf-search",type:"search",placeholder:t("team.searchPh"),value:u.query,onChange:i=>R(s=>({...s,query:i.target.value}))}),(0,e.jsx)(se,{id:"tf-cli",className:"team-cli-menu",ariaLabel:t("team.allCli"),value:u.cliId,label:oe(Z,u.cliId),options:Z,onChange:i=>R(s=>({...s,cliId:i}))}),(0,e.jsxs)("label",{className:"filter-toggle",children:[(0,e.jsx)("input",{type:"checkbox",id:"tf-fcap",checked:u.hasCapability,onChange:i=>R(s=>({...s,hasCapability:i.target.checked}))}),(0,e.jsx)("span",{className:"filter-toggle-switch","aria-hidden":"true"}),(0,e.jsx)("span",{className:"filter-toggle-label",children:t("team.hasCap")})]}),(0,e.jsxs)("label",{className:"filter-toggle",children:[(0,e.jsx)("input",{type:"checkbox",id:"tf-frole",checked:u.hasRole,onChange:i=>R(s=>({...s,hasRole:i.target.checked}))}),(0,e.jsx)("span",{className:"filter-toggle-switch","aria-hidden":"true"}),(0,e.jsx)("span",{className:"filter-toggle-label",children:t("team.hasRole")})]})]}),(0,e.jsx)("div",{id:"tf-teams",children:(0,e.jsx)(Oe,{teams:y,filters:u,pickedByTeam:P,gnameByTeam:D,expandedTeams:O,expandedDeps:B,groupOutputs:j,myDeploymentId:p,tr:t,onToggleTeam:i=>I(s=>Ne(s,i)),onToggleDep:i=>A(s=>Ne(s,i)),onPick:Se,onGroupNameChange:Me,onCapabilityChange:(i,s)=>{xe(i,s)},onOpenRole:(i,s)=>{Be(i,s)},onRemoveMember:(i,s,l)=>{Pe(i,s,l)},onPullGroup:i=>{De(i)}})})]})]}),(0,e.jsx)(_e,{state:g,tr:t,onClose:()=>h(null)})]})}function Ne(t,a){let n=new Set(t);return n.has(a)?n.delete(a):n.add(a),n}function Le(t){let{state:a,tr:n}=t;return a.kind==="hidden"?null:a.kind==="loading"?(0,e.jsx)("span",{className:"team-bind-loading",children:n(a.key)}):a.kind==="ok"?(0,e.jsx)("span",{className:"ok",children:n("team.bound2",{name:a.name})}):a.kind==="choice"?(0,e.jsxs)(e.Fragment,{children:[n("team.multiCandidate"),(0,e.jsx)("br",{}),a.candidates.map(o=>(0,e.jsx)("button",{type:"button",className:"tf-pickowner ghost","data-union":o.unionId,style:{margin:"2px"},onClick:()=>t.onPick(o.unionId),children:o.name||o.unionId},o.unionId))]}):a.kind==="err"?(0,e.jsx)("span",{className:"err",children:n(a.key)}):(0,e.jsx)("span",{className:"err",children:n("team.bindFail",{error:a.error})})}function Oe(t){let{tr:a}=t;return t.teams.length?(0,e.jsx)(e.Fragment,{children:t.teams.map(n=>{let o=n.bots.filter(p=>F(p,t.filters)),m=!t.expandedTeams.has(n.key),r=n.kind==="remote"?n.ok?(0,e.jsx)("span",{className:"team-status-pill ok",children:a("team.connected")}):(0,e.jsx)("span",{className:"team-status-pill err",children:a("team.connectFail",{error:n.error||""})}):(0,e.jsx)("span",{className:"team-status-pill muted",children:a("team.iHost")});return(0,e.jsxs)("article",{className:"card team-list-card",children:[(0,e.jsxs)("button",{type:"button",className:"tf-team-h","data-tk":n.key,"aria-expanded":!m,onClick:()=>t.onToggleTeam(n.key),children:[(0,e.jsx)("span",{className:"team-chevron","aria-hidden":"true",children:m?"\u203A":"\u2304"}),(0,e.jsx)("b",{children:n.label}),n.sub?(0,e.jsx)("span",{className:"muted",children:n.sub}):null,r,(0,e.jsx)("span",{className:"team-meta-pill",children:a("team.teamMeta",{deps:n.deployments.length,bots:n.bots.length})})]}),m?null:n.kind==="remote"&&!n.ok?(0,e.jsx)("p",{className:"muted",style:{margin:"8px 0 0"},children:a("team.rosterFail")}):(0,e.jsx)(Ue,{...t,team:n,filtered:o})]},n.key)})}):(0,e.jsx)("p",{className:"muted",children:a("team.noTeams")})}function Ue(t){let{team:a,tr:n}=t,o=[...a.deployments].sort((r,p)=>r.local===p.local?0:r.local?-1:1),m=o.some(r=>t.filtered.some(p=>p.deployment.id===r.id));return(0,e.jsxs)(e.Fragment,{children:[o.map(r=>(0,we.createElement)(je,{...t,deployment:r,key:r.id})),m?null:(0,e.jsx)("p",{className:"muted",style:{margin:"8px 0 0"},children:n("team.noMatch")}),(0,e.jsxs)("div",{className:"team-pull-row",children:[(0,e.jsxs)("label",{className:"team-pill-field team-group-name-field",children:[(0,e.jsx)("span",{children:n("team.gnameLabel")}),(0,e.jsx)("input",{className:"tf-gname","data-tk":a.key,value:t.gnameByTeam.get(a.key)||"",placeholder:n("team.gnamePlaceholder"),onChange:r=>t.onGroupNameChange(a.key,r.target.value)})]}),(0,e.jsx)("button",{className:"tf-grp page-primary-action","data-tk":a.key,onClick:()=>t.onPullGroup(a),children:n("team.pullGroupBtn")}),(0,e.jsx)("span",{className:"muted team-pull-hint",children:n("team.pullGroupHint")}),(0,e.jsx)("span",{className:"tf-gout","data-tk":a.key,children:(0,e.jsx)(Ge,{output:t.groupOutputs.get(a.key),tr:n})})]})]})}function je(t){let{team:a,deployment:n,tr:o}=t,m=t.filtered.filter(u=>u.deployment.id===n.id);if(!m.length)return null;let r=n.id===t.myDeploymentId,p=r?o("team.tagLocal"):n.stale?o("team.tagRemoteStale"):o("team.tagRemote"),v=`${a.key}::${n.id}`,N=t.expandedDeps.has(v),T=m.filter(u=>Q(t.pickedByTeam,a.key).has(u.larkAppId)).length;return(0,e.jsxs)("section",{className:"team-deployment-block",children:[(0,e.jsxs)("div",{className:"tf-dep-h","data-dk":v,"aria-expanded":N,role:"button",tabIndex:0,onClick:()=>t.onToggleDep(v),onKeyDown:u=>{u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),t.onToggleDep(v))},children:[(0,e.jsx)("span",{className:"team-chevron","aria-hidden":"true",children:N?"\u2304":"\u203A"}),(0,e.jsx)("b",{children:n.name}),(0,e.jsxs)("span",{className:"muted",children:[o("team.depTag",{tag:p})," \xB7 ",o("team.depCount",{count:m.length}),T?o("team.depSelected",{n:T}):""]}),a.kind==="local"&&!r?(0,e.jsx)("button",{type:"button",className:"tf-rmmember ghost","data-team":a.teamId,"data-dep":n.id,"data-name":n.name,onClick:u=>{u.stopPropagation(),t.onRemoveMember(a.teamId,n.id,n.name)},children:o("team.removeMember")}):null]}),N?(0,e.jsx)("div",{className:"team-roster-list",children:m.map(u=>(0,e.jsx)(Ee,{bot:u,mine:r,picked:Q(t.pickedByTeam,a.key).has(u.larkAppId),teamKey:a.key,tr:o,onPick:t.onPick,onCapabilityChange:t.onCapabilityChange,onOpenRole:t.onOpenRole},u.larkAppId))}):null]})}function Ee(t){let{bot:a,tr:n}=t,o=a.deployment.stale?{opacity:.55}:void 0,m=()=>t.onPick(t.teamKey,a.larkAppId,!t.picked);return(0,e.jsxs)("article",{className:`team-bot-row${t.picked?" selected":""}`,style:o,role:"checkbox","aria-checked":t.picked,tabIndex:0,onClick:r=>{Re(r.target)||m()},onKeyDown:r=>{r.key!=="Enter"&&r.key!==" "||Re(r.target)||(r.preventDefault(),m())},children:[(0,e.jsxs)("label",{className:`team-check-pill${t.picked?" selected":""}`,onClick:r=>r.stopPropagation(),children:[(0,e.jsx)("input",{type:"checkbox",className:"tf-pick","data-tk":t.teamKey,"data-app":a.larkAppId,checked:t.picked,onChange:r=>t.onPick(t.teamKey,a.larkAppId,r.target.checked)}),(0,e.jsx)("span",{className:"team-check-dot","aria-hidden":"true"})]}),(0,e.jsxs)("div",{className:"team-bot-main",children:[(0,e.jsx)("strong",{children:a.name}),(0,e.jsx)("span",{children:a.larkAppId})]}),(0,e.jsx)("span",{className:"team-meta-pill",children:a.cliId}),(0,e.jsx)("div",{className:"team-capability-cell",children:t.mine?(0,e.jsxs)("label",{className:"team-pill-field team-cap-field",children:[(0,e.jsx)("span",{children:n("team.capLabel")}),(0,e.jsx)("input",{className:"tf-cap","data-app":a.larkAppId,defaultValue:a.capability||"",placeholder:n("team.capPh"),onBlur:r=>{let p=r.target.value;p!==(a.capability||"")&&t.onCapabilityChange(a.larkAppId,p)},onKeyDown:r=>{r.key==="Enter"&&(r.preventDefault(),r.currentTarget.blur())}})]}):a.capability||null}),(0,e.jsx)("div",{className:"team-role-cell",children:a.hasTeamRole?t.mine?(0,e.jsx)("button",{className:"tf-role","data-app":a.larkAppId,"data-name":a.name,onClick:()=>t.onOpenRole(a.larkAppId,a.name),children:n("team.viewRole")}):n("team.hasRoleShort"):(0,e.jsx)("span",{className:"muted",children:"\u2014"})})]})}function Re(t){return t instanceof HTMLElement?!!t.closest('button, input, textarea, select, a, label, [contenteditable="true"]'):!1}function Ge(t){let{output:a,tr:n}=t;return a?a.kind==="muted"?(0,e.jsx)("span",{className:"muted",children:n(a.key)}):a.kind==="err"?(0,e.jsx)("span",{className:"err",children:n(a.key)}):(0,e.jsx)(Fe,{body:a.body,status:a.status,tr:n}):null}function Fe(t){let{body:a,status:n,tr:o}=t;if(a?.ok&&a.chatId){let p=a.shareLink||"https://applink.feishu.cn/client/chat/open?openChatId="+encodeURIComponent(a.chatId);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"ok",children:o("team.groupCreated")}),a.delegatedTo?o("team.delegatedBy",{name:String(a.delegatedTo)}):""," \xB7 ",(0,e.jsx)("a",{href:p,target:"_blank",rel:"noreferrer",children:o("team.openInLark")}),(a.invalidBotIds||[]).length?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.invalidBots",{ids:(a.invalidBotIds||[]).join(", ")})]}):null,(a.invalidOwnerUnionIds||[]).length?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.invalidOwners",{n:(a.invalidOwnerUnionIds||[]).length})]}):null,a.missingOperatorIdentity?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.missingIdentity")]}):null,(a.skippedNoOwner||[]).length?(0,e.jsxs)("span",{className:"err",children:[" \xB7 ",o("team.skippedNoOwner",{n:(a.skippedNoOwner||[]).length})]}):null]})}let m=a?.error||n,r=m==="no_local_online_bot"?o("team.errNoLocalBot"):m==="all_bots_skipped_no_owner"?o("team.errAllSkipped"):m==="no_creator_available"?o("team.errNoCreator"):m==="delegation_timeout"?o("team.errDelegationTimeout"):o("team.errGroupCreate",{error:String(m)});return(0,e.jsx)("span",{className:"err",children:r})}function _e(t){let{state:a,tr:n}=t;return(0,e.jsx)("div",{id:"tf-modal",className:"team-role-modal","data-app":a?.app,hidden:!a,children:(0,e.jsxs)("div",{className:"team-role-dialog",children:[(0,e.jsx)("h2",{id:"tf-modal-title",children:a?n("team.roleModalTitleName",{name:a.name}):n("team.roleModalTitle")}),(0,e.jsx)("p",{className:"muted",style:{fontSize:"13px"},children:n("team.roleModalHint")}),(0,e.jsx)("textarea",{id:"tf-modal-text",readOnly:!0,value:a?.content??""}),(0,e.jsx)("div",{className:"team-role-actions",children:(0,e.jsx)("button",{type:"button",id:"tf-modal-cancel",onClick:t.onClose,children:n("team.close")})})]})})}function $e(){let t=E(),a=Ie(),[n,o]=(0,d.useState)([]),[m,r]=(0,d.useState)(""),[p,v]=(0,d.useState)(""),[N,T]=(0,d.useState)({kind:"none"}),[u,R]=(0,d.useState)(()=>new Map),[P,M]=(0,d.useState)(""),[D,x]=(0,d.useState)(""),[O,I]=(0,d.useState)({kind:"none"}),B=(0,d.useCallback)(async()=>{let c=await V();if(!a.current)return;let g=c.body;r(h=>g?.suggestedHubUrl||h),o(g?.teams||[])},[a]);(0,d.useEffect)(()=>{B()},[B]);async function A(){let c=p.trim();if(!c){T({kind:"err",key:"team.errName"});return}T({kind:"muted",key:"team.creating"});let g=await ye(c);a.current&&(g.body?.ok?(T({kind:"ok",key:"team.created"}),v(""),B()):T({kind:"create-fail",error:String(g.body?.error||g.status)}))}async function U(c){R(h=>{let y=new Map(h);return y.set(c,{kind:"muted",key:"team.generating"}),y});let g=await be(c);a.current&&R(h=>{let y=new Map(h);return y.set(c,g.body?.code?{kind:"invite",code:g.body.code}:{kind:"err",key:"team.genFail"}),y})}async function C(c,g){confirm(t("team.delConfirm",{name:g}))&&(await fe(c),a.current&&B())}async function j(){let c=P.trim(),g=D.trim();if(I({kind:"muted",key:"team.joining"}),!c||!g){I({kind:"err",key:"team.errHubCode"});return}let h=await ke(c,g);a.current&&(h.body?.ok?(I({kind:"joined",name:String(h.body.teamName||"")}),x("")):I({kind:"join-fail",error:h.body?.error||h.status}))}return(0,e.jsxs)("section",{className:"page team-page team-manage-page",children:[(0,e.jsxs)("div",{className:"page-heading",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:t("team.eyebrow")}),(0,e.jsx)("h1",{children:t("team.manageTitle")})]}),(0,e.jsx)("div",{className:"page-heading-actions",children:(0,e.jsx)(Ce,{active:"manage"})})]}),(0,e.jsxs)("div",{className:"card team-card",children:[(0,e.jsx)("div",{className:"team-card-head",children:(0,e.jsx)("h2",{children:t("team.hostedTitle")})}),(0,e.jsxs)("form",{className:"team-inline-form dashboard-toolbar",onSubmit:c=>{c.preventDefault(),A()},children:[(0,e.jsx)("input",{id:"tm-newname",type:"text",placeholder:t("team.newTeamPh"),value:p,onChange:c=>v(c.target.value)}),(0,e.jsx)(ie,{id:"tm-create",className:"page-primary-action",onClick:()=>{A()},children:t("team.createTeamBtn")}),(0,e.jsx)("span",{className:"toolbar-status tm-cout",children:(0,e.jsx)(X,{status:N,tr:t})})]}),(0,e.jsx)("div",{id:"tm-list",children:(0,e.jsx)(ze,{teams:n,suggestedHubUrl:m,inviteStatuses:u,tr:t,onInvite:c=>{U(c)},onDelete:(c,g)=>{C(c,g)}})})]}),(0,e.jsxs)("div",{className:"card team-card",children:[(0,e.jsx)("div",{className:"team-card-head",children:(0,e.jsx)("h2",{children:t("team.joinTitle")})}),(0,e.jsxs)("form",{className:"team-inline-form dashboard-toolbar team-join-form",onSubmit:c=>{c.preventDefault(),j()},children:[(0,e.jsx)("input",{id:"tm-hub",type:"text",placeholder:t("team.hubPh"),value:P,onChange:c=>M(c.target.value)}),(0,e.jsx)("input",{id:"tm-code",type:"text",placeholder:t("team.codePh"),value:D,onChange:c=>x(c.target.value)}),(0,e.jsx)("button",{type:"button",id:"tm-join",className:"page-primary-action",onClick:()=>{j()},children:t("team.joinBtn")})]}),(0,e.jsx)("div",{id:"tm-join-out",className:"team-inline-output",hidden:O.kind==="none",children:(0,e.jsx)(X,{status:O,tr:t})})]})]})}function ze(t){let{teams:a,tr:n}=t;return a.length?(0,e.jsx)(e.Fragment,{children:a.map(o=>{let m=(o.deployments||[]).filter(p=>!p.local).length,r=t.inviteStatuses.get(o.teamId)??{kind:"none"};return(0,e.jsxs)("div",{className:"card team-list-card team-manage-card",children:[(0,e.jsxs)("div",{className:"team-manage-head",children:[(0,e.jsx)("b",{children:o.name}),o.isDefault?(0,e.jsx)("span",{className:"team-status-pill muted",children:n("team.default")}):null,(0,e.jsxs)("span",{className:"team-meta-pill",children:[n("team.manageMetaDeps",{count:(o.deployments||[]).length}),m?n("team.manageMetaRemote",{r:m}):""," \xB7 ",n("team.manageMetaBots",{count:(o.bots||[]).length})]}),(0,e.jsxs)("span",{className:"team-manage-actions",children:[(0,e.jsx)("button",{className:"tm-invite ghost","data-team":o.teamId,onClick:()=>t.onInvite(o.teamId),children:n("team.genInvite")}),o.isDefault?null:(0,e.jsx)("button",{className:"tm-del ghost","data-team":o.teamId,"data-name":o.name,onClick:()=>t.onDelete(o.teamId,o.name),children:n("team.delBtn")})]})]}),(0,e.jsx)("div",{className:"tm-inv-out team-inline-output","data-team":o.teamId,hidden:r.kind==="none",children:(0,e.jsx)(X,{status:r,tr:n,suggestedHubUrl:t.suggestedHubUrl})})]},o.teamId)})}):(0,e.jsx)("p",{className:"muted",children:n("team.noTeamsShort")})}function X(t){let{status:a,tr:n}=t;if(a.kind==="none")return null;if(a.kind==="muted")return(0,e.jsx)("span",{className:"muted",children:n(a.key)});if(a.kind==="ok")return(0,e.jsx)("span",{className:"ok",children:n(a.key)});if(a.kind==="err")return(0,e.jsx)("span",{className:"err",children:n(a.key)});if(a.kind==="create-fail")return(0,e.jsx)("span",{className:"err",children:n("team.createFail",{error:a.error})});if(a.kind==="invite")return(0,e.jsxs)(e.Fragment,{children:[n("team.inviteResultLede"),(0,e.jsx)("br",{}),n("team.inviteHub"),(0,e.jsx)("code",{children:t.suggestedHubUrl||""}),(0,e.jsx)("br",{}),n("team.inviteCode"),(0,e.jsx)("code",{className:"team-invite-code",children:a.code})]});if(a.kind==="joined")return(0,e.jsx)("span",{className:"ok",children:n("team.joined",{name:a.name})});let o=a.error,m=o==="cannot_join_self"?n("team.joinErrSelf"):o==="deployment_already_joined"?n("team.joinErrAlready"):o==="hub_unreachable"?n("team.joinErrUnreachable"):o==="hub_timeout"?n("team.joinErrTimeout"):n("team.joinErrGeneric",{error:String(o)});return(0,e.jsx)("span",{className:"err",children:m})}function Xe(t){return K(t,(0,e.jsx)(He,{}))}function Ye(t){return K(t,(0,e.jsx)($e,{}))}export{Xe as renderTeamFederationPage,Ye as renderTeamManagePage};
@@ -0,0 +1,94 @@
1
+ import{b as $}from"./chunk-CMDPZOPK.js";import{d as E}from"./chunk-I35DXGM4.js";import{r as F}from"./chunk-NYZHARIU.js";import{a as O}from"./chunk-SYC6D5XU.js";import{a as re,d as V}from"./chunk-5THX4DI2.js";import{c as S}from"./chunk-7SZRL6FY.js";var l=S(re(),1);async function _(t=fetch){let e=await t("/api/v3/runs");if(!e.ok)return[];let o=await e.json();return Array.isArray(o.runs)?o.runs:[]}async function j(t,e=fetch){let o=await e(`/api/v3/runs/${encodeURIComponent(t)}`);return o.ok?{ok:!0,view:await o.json()}:{ok:!1,status:o.status}}async function J(t,e=fetch){let o=await e(`/api/v3/runs/${encodeURIComponent(t)}/cancel`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({})}),s={};try{let a=await o.json();a&&typeof a=="object"&&!Array.isArray(a)&&(s=a)}catch{}if(!o.ok||s.ok===!1)return{ok:!1,status:o.status,error:typeof s.error=="string"?s.error:`http_${o.status}`};let r=s.status;return{ok:!0,...typeof s.runId=="string"?{runId:s.runId}:{},...ae(r)?{runStatus:r}:{},...s.alreadyTerminal===!0?{alreadyTerminal:!0}:{}}}function ae(t){return t==="running"||t==="cancelling"||t==="cancelled"||t==="succeeded"||t==="failed"||t==="blocked"}var I={pending:"\u5F85\u673A",gateWaiting:"\u7B49\u5BA1\u6279",running:"\u8FD0\u884C\u4E2D",done:"\u5B8C\u6210",skipped:"\u5DF2\u8DF3\u8FC7",cancelled:"\u5DF2\u53D6\u6D88",blocked:"\u53D7\u963B",superseded:"\u5DF2\u5237\u65B0",failed:"\u5931\u8D25"},X={exit:"\u2713 \u901A\u8FC7",continue:"\u21BB \u7EE7\u7EED\u8FD4\u5DE5",exhausted:"\u26D4 \u8F6E\u6570\u8017\u5C3D"},p={nodeWidth:168,plainHeight:48,loopHeight:70,columnGap:226,verticalGap:30,padding:26,maxDots:8},x={width:104,height:30,columnGap:138,rowGap:42,padding:6};function k(t){return t==="succeeded"||t==="failed"||t==="cancelled"}function W(t=typeof location<"u"?location.hash:""){let e=t.match(/^#\/workflows\/([^?#]+)/);if(!e)return null;try{return decodeURIComponent(e[1])}catch{return e[1]}}function L(t,e){return t.length>e?`${t.slice(0,e-1)}\u2026`:t}function D(t){return t.isLoop?p.loopHeight:p.plainHeight}function C(t){return t.nodes.filter(e=>!e.loop)}function z(t){let e=C(t),o=ie(e),s=new Map;for(let i of e){let m=o.get(i.id)??0,u=s.get(m);u?u.push(i):s.set(m,[i])}let r=[...s.keys()].sort((i,m)=>i-m),a=[],d=new Map,c=0;for(let i of r){let m=s.get(i)??[],u=p.padding;for(let g of m){let v={node:g,x:p.padding+i*p.columnGap,y:u,width:p.nodeWidth,height:D(g)};a.push(v),d.set(g.id,v),u+=v.height+p.verticalGap}c=Math.max(c,u-p.verticalGap+p.padding)}let f=p.padding*2+(r.length===0?0:Math.max(...r)*p.columnGap+p.nodeWidth),w=new Map(e.map(i=>[i.id,i])),y=[];for(let i of e){let m=d.get(i.id);if(m)for(let u of i.depends){let g=d.get(u),v=w.get(u);if(!g||!v)continue;let N=g.x+p.nodeWidth,R=g.y+D(v)/2,b=m.x,M=m.y+D(i)/2;y.push({fromId:u,toId:i.id,x1:N,y1:R,x2:b,y2:M,mx:(N+b)/2,live:i.status==="running"})}}return{width:f,height:c,nodes:a,edges:y}}function ie(t){let e=new Map(t.map(a=>[a.id,a])),o=new Map,s=new Set;function r(a){if(o.has(a))return o.get(a);if(s.has(a))return 0;s.add(a);let c=(e.get(a)?.depends??[]).filter(w=>e.has(w)),f=c.length?1+Math.max(...c.map(r)):0;return s.delete(a),o.set(a,f),f}for(let a of t)r(a.id);return o}function U(t,e){return(t?.nodes??[]).filter(o=>o.loop?.loopId===e)}function q(t,e,o){if(o&&e){let r=t.find(a=>a.id===e);if(r)return r}let s=t.filter(r=>r.status==="running");return s[s.length-1]??t[t.length-1]??null}function Y(t){let e=new Map;for(let o of t){let s=o.loop?.iteration;if(s===void 0)continue;let r=e.get(s);r?r.push(o):e.set(s,[o])}return[...e.entries()].sort((o,s)=>o[0]-s[0]).map(([o,s])=>({iteration:o,instances:s}))}function P(t){let e=t.loopState?.maxIterations;return t.loopState&&e!==void 0?e+t.loopState.granted:void 0}function K(t,e){let o=new Map(t.map(i=>[i.id,i])),s=new Map;function r(i){if(s.has(i))return s.get(i);s.set(i,0);let m=(o.get(i)?.depends??[]).filter(g=>o.has(g)),u=m.length?1+Math.max(...m.map(r)):0;return s.set(i,u),u}let a=new Map,d=0,c=[],f=new Map;for(let i of t){let m=r(i.id),u=a.get(m)??0;a.set(m,u+1),d=Math.max(d,u);let g={templateId:i.id,node:e.get(i.id),x:x.padding+m*x.columnGap,y:x.padding+u*x.rowGap,width:x.width,height:x.height};c.push(g),f.set(i.id,g)}let w=s.size?Math.max(...s.values()):0,y=[];for(let i of t){let m=f.get(i.id);if(m)for(let u of i.depends){let g=f.get(u);if(!g)continue;let v=g.x+x.width,N=g.y+x.height/2,R=m.x,b=m.y+x.height/2;y.push({fromId:u,toId:i.id,x1:v,y1:N,x2:R,y2:b,mx:(v+R)/2,live:e.get(i.id)?.status==="running"})}}return{width:x.padding*2+(t.length?w*x.columnGap+x.width:0),height:x.padding*2+d*x.rowGap+x.height,nodes:c,edges:y}}function H(t){let e=t.webTerminal;return`${e?.status??"-"}|${e?.sessionId??"-"}|${e?.webPort??"-"}|${t.hasPtyLog?"1":"0"}`}function Q(t,e,o){t.setAttribute("data-run-id",e),t.setAttribute("data-node-id",o.id),t.innerHTML=le(e,o).html}function le(t,e,o={}){let s=H(e),r=e.webTerminal;if(r?.status==="live"&&r.webPort&&r.webPort>0)return{kind:"live",signature:s,html:de(r.webPort,r.sessionId,o.host)};if(e.hasPtyLog)return{kind:"replay",signature:s,html:ue(t,e.id,r?.status==="closed")};let a=r?.status==="live"?"\u7EC8\u7AEF\u6B63\u5728\u542F\u52A8\uFF0C\u7A0D\u540E\u5237\u65B0":"\u6682\u65E0\u7EC8\u7AEF\u8BB0\u5F55";return{kind:"empty",signature:s,html:ce(a)}}function de(t,e,o){let s=me(t,o,e);return`<div class="v3-terminal-panel">
2
+ <div class="v3-terminal-head">
3
+ <span class="v3-terminal-dot live"></span>
4
+ <span>\u5B9E\u65F6\u7EC8\u7AEF\uFF08\u53EA\u8BFB\uFF09</span>
5
+ <span class="muted">:${t}</span>
6
+ <a class="btn-link" href="${T(s)}" target="_blank" rel="noopener">\u65B0\u7A97\u53E3\u6253\u5F00</a>
7
+ </div>
8
+ <iframe class="v3-terminal-frame" src="${T(s)}" title="v3 live terminal" loading="lazy"></iframe>
9
+ </div>`}function ue(t,e,o){let s=`/api/v3/runs/${encodeURIComponent(t)}/nodes/${encodeURIComponent(e)}/pty-log`,r=fe(s,`${t} / ${e}`);return`<div class="v3-terminal-panel">
10
+ <div class="v3-terminal-head">
11
+ <span class="v3-terminal-dot ${o?"closed":"replay"}"></span>
12
+ <span>${o?"\u7EC8\u7AEF\u56DE\u653E":"\u7EC8\u7AEF\u8BB0\u5F55"}</span>
13
+ <span class="muted">PTY log</span>
14
+ <a class="btn-link" href="${T(s)}" target="_blank" rel="noopener">\u4E0B\u8F7D/\u6253\u5F00\u539F\u59CB\u65E5\u5FD7</a>
15
+ </div>
16
+ <iframe class="v3-terminal-frame" srcdoc="${T(r)}" title="v3 terminal replay" loading="lazy"></iframe>
17
+ </div>`}function ce(t){return`<div class="v3-terminal-empty muted">${G(t)}</div>`}function me(t,e,o){return o&&typeof window<"u"&&window.location.protocol==="https:"?`${window.location.origin}/s/${encodeURIComponent(o)}`:`http://${e??pe()}:${t}/`}function pe(){return typeof window>"u"?"127.0.0.1":window.location.hostname||"127.0.0.1"}function fe(t,e){let o=JSON.stringify(t);return`<!doctype html>
18
+ <html>
19
+ <head>
20
+ <meta charset="utf-8">
21
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@xterm/xterm@5.5.0/css/xterm.css">
22
+ <style>
23
+ html,body{margin:0;height:100%;background:#0d1117;color:#c9d1d9;font:12px ui-monospace,SFMono-Regular,Menlo,monospace}
24
+ #bar{height:31px;display:flex;align-items:center;gap:10px;padding:0 10px;background:#161b22;border-bottom:1px solid #30363d;box-sizing:border-box}
25
+ #status{margin-left:auto;color:#8b949e;white-space:nowrap}
26
+ #term{height:calc(100% - 31px);padding:4px;box-sizing:border-box;overflow:auto}
27
+ a{color:#58a6ff;text-decoration:none}
28
+ </style>
29
+ </head>
30
+ <body>
31
+ <div id="bar"><span>${G(e)}</span><span id="status">loading...</span></div>
32
+ <div id="term"></div>
33
+ <script src="https://cdn.jsdelivr.net/npm/@xterm/xterm@5.5.0/lib/xterm.js"><\/script>
34
+ <script src="https://cdn.jsdelivr.net/npm/@xterm/addon-fit@0.10.0/lib/addon-fit.js"><\/script>
35
+ <script>
36
+ (function(){
37
+ var endpoint=${o};
38
+ // v3 ephemeral workers spawn their PTY at DEFAULT_RENDER_COLS (=160, see
39
+ // worker.ts) and never adopt, so the captured stream's TUI / box-drawing
40
+ // is exactly 160 cols wide. Fitting it into a narrower (or oddly-measured)
41
+ // grid re-wraps those fixed-width lines into a stair-stepped mess and
42
+ // wastes the panel. So we render at the capture width and let FitAddon
43
+ // only size the ROW count to the iframe height (cols pinned back to 160).
44
+ var COLS=160;
45
+ var status=document.getElementById('status');
46
+ var termEl=document.getElementById('term');
47
+ if(!window.Terminal){status.textContent='xterm.js failed to load';return;}
48
+ var term=new Terminal({
49
+ cols:COLS,
50
+ convertEol:false,
51
+ scrollback:100000,
52
+ fontSize:13,
53
+ disableStdin:true,
54
+ theme:{background:'#0d1117',foreground:'#c9d1d9',cursor:'#c9d1d9'}
55
+ });
56
+ var fit=null;
57
+ if(window.FitAddon){fit=new window.FitAddon.FitAddon();term.loadAddon(fit);}
58
+ term.open(termEl);
59
+ function doFit(){
60
+ try{if(fit)fit.fit()}catch(_){}
61
+ if(term.cols!==COLS)term.resize(COLS,term.rows||24);
62
+ }
63
+ doFit(); window.addEventListener('resize',doFit);
64
+ fetch(endpoint,{credentials:'include'}).then(function(res){
65
+ if(!res.ok){
66
+ if(res.status===401){status.textContent='\u9700\u8981\u767B\u5F55 dashboard \u540E\u67E5\u770B\u56DE\u653E';}
67
+ else if(res.status===404){status.textContent='\u6CA1\u6709 PTY \u65E5\u5FD7';}
68
+ else{status.textContent='\u52A0\u8F7D\u5931\u8D25 HTTP '+res.status;}
69
+ return null;
70
+ }
71
+ var total=Number(res.headers.get('x-botmux-log-bytes')||0);
72
+ var served=Number(res.headers.get('x-botmux-served-bytes')||0);
73
+ var truncated=res.headers.get('x-botmux-truncated')==='1';
74
+ status.textContent=truncated
75
+ ? 'showing tail '+formatBytes(served)+' / '+formatBytes(total)
76
+ : 'loaded '+formatBytes(total);
77
+ return res.arrayBuffer();
78
+ }).then(function(buf){
79
+ if(!buf)return;
80
+ term.write(new TextDecoder().decode(buf));
81
+ setTimeout(doFit,0);
82
+ }).catch(function(err){
83
+ status.textContent='\u52A0\u8F7D\u5931\u8D25: '+(err&&err.message?err.message:String(err));
84
+ });
85
+ function formatBytes(n){
86
+ if(!Number.isFinite(n)||n<=0)return '0 B';
87
+ var u=['B','KiB','MiB','GiB'];var i=0;
88
+ while(n>=1024&&i<u.length-1){n/=1024;i++;}
89
+ return (i===0?String(n):n.toFixed(1))+' '+u[i];
90
+ }
91
+ })();
92
+ <\/script>
93
+ </body>
94
+ </html>`}function G(t){return t.replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[e])}function T(t){return G(t).replace(/`/g,"&#96;")}var n=S(V(),1);function ee(){return typeof document<"u"&&document.hidden}function ge(){let[t,e]=(0,l.useState)([]);return(0,l.useEffect)(()=>{let o=!1,s=null,r=()=>{s=window.setTimeout(()=>{a()},2e3)};async function a(){if(!o){if(!ee())try{let d=await _();o||e(d)}catch{}o||r()}}return a(),()=>{o=!0,s!==null&&window.clearTimeout(s)}},[]),t}function ve(t){let[e,o]=(0,l.useState)(null),[s,r]=(0,l.useState)("");return(0,l.useEffect)(()=>{let a=!1,d=null,c=()=>{d=window.setTimeout(()=>{f()},2e3)};async function f(){if(a)return;let w=!1;if(!ee())try{let y=await j(t);if(a)return;y.ok?(o(y.view),r(y.view.runStatus),w=k(y.view.runStatus)):r(y.status===404?"not found":`HTTP ${y.status}`)}catch{}!a&&!w&&c()}return f(),()=>{a=!0,d!==null&&window.clearTimeout(d)}},[t]),{view:e,statusText:s}}function he(){let t=$(),e=ge(),o=(0,n.jsx)("div",{className:"page-heading-actions v3r-run-toolbar",children:(0,n.jsx)("span",{className:"v3r-run-count",children:e.length})});return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"page-heading",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"eyebrow",children:t("nav.workflows")}),(0,n.jsx)("h1",{children:t("nav.workflows")})]}),o]}),(0,n.jsx)("section",{className:"overview-block v3r-runs-section",children:(0,n.jsx)("div",{className:"v3r-run-list",children:e.length?e.map(s=>(0,n.jsxs)("a",{className:"v3r-run-card",href:`#/workflows/${encodeURIComponent(s.runId)}`,children:[(0,n.jsxs)("span",{className:"v3r-run-main",children:[(0,n.jsx)("code",{className:"v3r-runid",children:s.runId}),(0,n.jsxs)("small",{children:["\u8282\u70B9 ",s.nodeCount]})]}),(0,n.jsx)("span",{className:`v3r-pill rs-${s.runStatus}`,children:s.runStatus})]},s.runId)):(0,n.jsxs)("div",{className:"empty v3r-empty",children:["\u6682\u65E0\u5DE5\u4F5C\u6D41\u8FD0\u884C\uFF08\u7528 ",(0,n.jsx)("code",{children:"/workflow new"})," \u53D1\u8D77\u4E00\u4E2A\uFF09"]})})})]})}function we(t){let e=$(),{view:o,statusText:s}=ve(t.runId),[r,a]=(0,l.useState)(null),[d,c]=(0,l.useState)(null),[f,w]=(0,l.useState)(!1),[y,i]=(0,l.useState)(!1),[m,u]=(0,l.useState)(!1),[g,v]=(0,l.useState)(null);(0,l.useEffect)(()=>{a(null),c(null),w(!1),i(!1),u(!1),v(null)},[t.runId]),(0,l.useEffect)(()=>{o?.runStatus==="cancelling"?(u(!0),v(e("workflow.v3.cancelPending"))):o?.runStatus==="cancelled"?(u(!1),v(e("workflow.v3.cancelled"))):k(o?.runStatus)&&u(!1)},[e,o?.runStatus]),(0,l.useEffect)(()=>{o&&a(h=>h&&o.nodes.some(oe=>oe.id===h)?h:C(o)[0]?.id??o.nodes[0]?.id??null)},[o]);let N=(0,l.useCallback)(h=>{a(h),c(null),w(!1)},[]),R=(0,l.useCallback)(h=>{c(h),w(!0)},[]),b=o?.nodes.find(h=>h.id===r)??null,M=o?`v3r-pill rs-${o.runStatus}`:"v3r-pill",A=k(o?.runStatus),B=y||m||o?.runStatus==="cancelling",se=(0,l.useCallback)(async()=>{if(!(!o||A||B)&&window.confirm(e("workflow.v3.cancelConfirm",{runId:t.runId}))){i(!0),v(null);try{let h=await J(t.runId);if(!h.ok){v(h.status===401?e("workflow.v3.cancelAuthRequired"):e("workflow.v3.cancelFailed",{error:h.error}));return}v(h.runStatus==="cancelled"?e("workflow.v3.cancelled"):h.alreadyTerminal?e("workflow.v3.cancelAlreadyTerminal"):e("workflow.v3.cancelPending")),u(h.runStatus!=="cancelled"&&h.alreadyTerminal!==!0)}catch{v(e("workflow.v3.cancelFailed",{error:"network_error"}))}finally{i(!1)}}},[B,t.runId,A,e,o]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"page-heading v3r-detail-heading",children:[(0,n.jsxs)("div",{className:"v3r-title-row",children:[(0,n.jsx)("p",{className:"eyebrow",children:e("nav.workflows")}),(0,n.jsxs)("a",{href:"#/workflows",className:"btn-link v3r-back-link",children:["\u2190 ",e("nav.workflows")]}),(0,n.jsx)("h1",{children:t.runId}),(0,n.jsx)("span",{className:`${M} v3r-run-status-pill`,children:s})]}),(0,n.jsx)("div",{className:"page-heading-actions",children:(0,n.jsx)(ye,{runStatus:o?.runStatus,busy:y||m,onCancel:()=>{se()}})})]}),g?(0,n.jsx)("div",{className:`v3r-cancel-notice${o?.runStatus==="cancelled"?" done":""}`,role:"status",children:g}):null,(0,n.jsxs)("div",{className:"v3r-wrap",children:[(0,n.jsxs)("section",{className:"overview-block v3r-graph-section",children:[(0,n.jsx)(E,{title:"\u8FD0\u884C\u62D3\u6251",hint:o?`${o.nodes.length} \u4E2A\u8282\u70B9`:s}),(0,n.jsxs)("div",{className:"v3r-graph-card",children:[(0,n.jsx)(be,{view:o,selectedId:r,onSelect:N}),(0,n.jsx)(xe,{})]})]}),(0,n.jsxs)("section",{className:"overview-block v3r-node-section",children:[(0,n.jsx)(E,{title:"\u8282\u70B9\u8BE6\u60C5",hint:b?(0,n.jsxs)("span",{className:`v3r-pill v3r-node-status-pill st-${b.status}`,children:[(0,n.jsx)("i",{className:"dot"}),I[b.status]]}):"\u9009\u62E9\u4E00\u4E2A\u8282\u70B9"}),(0,n.jsx)(Se,{runId:t.runId,view:o,node:b,instanceId:d,instancePinned:f,onInstanceSelect:R})]})]})]})}function ye(t){let e=$();if(!F.authed)return null;let o=k(t.runStatus),s=t.busy||t.runStatus==="cancelling";return(0,n.jsx)("button",{type:"button",className:"danger v3r-cancel-button",disabled:!t.runStatus||o||s,title:e(o?"workflow.v3.cancelTerminal":"workflow.v3.cancelTitle"),onClick:t.onCancel,children:e(s?"workflow.v3.cancelling":o?"workflow.v3.cancelTerminal":"workflow.v3.cancel")})}function xe(){return(0,n.jsxs)("div",{className:"v3r-legend",children:[(0,n.jsx)("span",{className:"lg st-pending",children:"\u5F85\u673A"}),(0,n.jsx)("span",{className:"lg st-running",children:"\u8FD0\u884C\u4E2D"}),(0,n.jsx)("span",{className:"lg st-gateWaiting",children:"\u7B49\u5BA1\u6279"}),(0,n.jsx)("span",{className:"lg st-done",children:"\u5B8C\u6210"}),(0,n.jsx)("span",{className:"lg st-skipped",children:"\u5DF2\u8DF3\u8FC7"}),(0,n.jsx)("span",{className:"lg st-cancelled",children:"\u5DF2\u53D6\u6D88"}),(0,n.jsx)("span",{className:"lg st-blocked",children:"\u53D7\u963B"}),(0,n.jsx)("span",{className:"lg st-failed",children:"\u5931\u8D25"}),(0,n.jsx)("span",{className:"lg lg-loop",children:"\u27F3 \u5FAA\u73AF\u5BB9\u5668"})]})}function be(t){let e=(0,l.useMemo)(()=>t.view?z(t.view):null,[t.view]),o=e?`${e.width}:${e.height}:${e.nodes.map(r=>r.node.id).join("\0")}`:"",s=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{let r=s.current;if(!r||!o)return;let a=0,d=()=>{a=0,r.scrollLeft=Math.max(0,(r.scrollWidth-r.clientWidth)/2),r.scrollTop=Math.max(0,(r.scrollHeight-r.clientHeight)/2)},c=()=>{a&&window.cancelAnimationFrame(a),a=window.requestAnimationFrame(d)};c();let f=typeof ResizeObserver>"u"?null:new ResizeObserver(c);f?.observe(r);let w=r.querySelector(".v3r-graph-stage");return w&&f?.observe(w),()=>{a&&window.cancelAnimationFrame(a),f?.disconnect()}},[o]),(0,n.jsx)("div",{id:"v3-graph",className:"v3r-graph",ref:s,children:e?(0,n.jsx)("div",{className:"v3r-graph-stage",children:(0,n.jsxs)("svg",{width:e.width,height:e.height,viewBox:`0 0 ${e.width} ${e.height}`,children:[(0,n.jsx)("defs",{children:(0,n.jsx)("marker",{id:"v3arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"7",markerHeight:"7",orient:"auto-start-reverse",children:(0,n.jsx)("path",{d:"M0,0 L10,5 L0,10 z",fill:"var(--faint, #8b98aa)"})})}),e.edges.map(r=>(0,n.jsx)("path",{className:`v3r-edge${r.live?" live":""}`,d:`M${r.x1},${r.y1} C${r.mx},${r.y1} ${r.mx},${r.y2} ${r.x2},${r.y2}`,markerEnd:"url(#v3arrow)"},`${r.fromId}->${r.toId}`)),e.nodes.map(r=>(0,n.jsx)(Ne,{box:r,selected:r.node.id===t.selectedId,onSelect:t.onSelect},r.node.id))]})}):null})}function Ne(t){let{box:e,selected:o}=t,s=e.node;return s.isLoop?(0,n.jsx)(Re,{box:e,selected:o,onSelect:t.onSelect}):(0,n.jsxs)("g",{className:`v3r-node st-${s.status}${o?" sel":""}`,"data-node":s.id,onClick:()=>t.onSelect(s.id),children:[(0,n.jsx)("rect",{className:"v3r-box",x:e.x,y:e.y,width:p.nodeWidth,height:p.plainHeight,rx:"10"}),(0,n.jsx)("text",{className:"v3r-nid",x:e.x+14,y:e.y+20,children:L(s.id,18)}),(0,n.jsx)("text",{className:"v3r-nstatus",x:e.x+14,y:e.y+37,children:I[s.status]})]})}function Re(t){let{box:e,selected:o}=t,s=e.node,r=s.loopState,a=P(s),d=r?`${I[s.status]} \xB7 \u7B2C${r.iteration}${a!==void 0?`/${a}`:""}\u8F6E`:`${I[s.status]} \xB7 loop`,c=r?.maxIterations;return(0,n.jsxs)("g",{className:`v3r-node v3r-loopnode st-${s.status}${o?" sel":""}`,"data-node":s.id,onClick:()=>t.onSelect(s.id),children:[(0,n.jsx)("rect",{className:"v3r-cap",x:e.x-4,y:e.y-4,width:p.nodeWidth+8,height:p.loopHeight+8,rx:"14"}),(0,n.jsx)("rect",{className:"v3r-box",x:e.x,y:e.y,width:p.nodeWidth,height:p.loopHeight,rx:"10"}),(0,n.jsx)("text",{className:"v3r-spin",x:e.x+14,y:e.y+21,children:"\u27F3"}),(0,n.jsx)("text",{className:"v3r-nid",x:e.x+30,y:e.y+21,children:L(s.id,16)}),(0,n.jsx)("text",{className:"v3r-nstatus",x:e.x+14,y:e.y+39,children:d}),r&&a!==void 0&&a<=p.maxDots?(0,n.jsx)(Ie,{node:s,x:e.x,y:e.y,budget:a,maxIterations:c}):null]})}function Ie(t){let e=t.node.loopState,o=t.y+p.loopHeight-13,s=Array.from({length:t.budget},(r,a)=>a+1);return(0,n.jsxs)(n.Fragment,{children:[s.map(r=>{let a=r<e.iteration?"v3r-dot done":r===e.iteration?`v3r-dot cur${t.node.status==="running"?" live":""}`:"v3r-dot todo",d=t.maxIterations!==void 0&&r>t.maxIterations?" grant":"";return(0,n.jsx)("circle",{className:`${a}${d}`,cx:t.x+14+(r-1)*15,cy:o,r:"3.6"},r)}),e.lastDecision==="exit"?(0,n.jsx)("text",{className:"v3r-dots-verdict ok",x:t.x+14+t.budget*15+4,y:o+4,children:"\u2713"}):null,e.lastDecision==="exhausted"&&t.node.status==="blocked"?(0,n.jsx)("text",{className:"v3r-dots-verdict warn",x:t.x+14+t.budget*15+4,y:o+4,children:"\u26A0"}):null]})}function Se(t){let e=t.node,o=(0,l.useMemo)(()=>e?.isLoop?U(t.view,e.id):[],[e,t.view]),s=e?.isLoop?q(o,t.instanceId,t.instancePinned):e,r=e?.isLoop?s?.id??null:null;return e?(0,n.jsxs)("div",{id:"v3-node-panel",className:"v3r-panel",children:[(0,n.jsxs)("div",{id:"v3-node-meta",children:[e.goal?(0,n.jsx)("p",{className:"v3r-goal",children:e.goal}):null,e.depends.length?(0,n.jsxs)("p",{className:"v3r-deps",children:[(0,n.jsx)("span",{children:"\u4F9D\u8D56"}),e.depends.map(a=>(0,n.jsx)("span",{className:"v3r-dep",children:a},a))]}):null,e.errorClass?(0,n.jsx)(ke,{node:e}):null,e.isLoop?(0,n.jsx)($e,{runId:t.runId,node:e,instances:o,activeInstanceId:r,onInstanceSelect:t.onInstanceSelect}):null]}),(0,n.jsx)("div",{id:"v3-inst-strip",children:e.isLoop&&s?(0,n.jsx)(Ve,{node:s,auto:!t.instancePinned}):null}),(0,n.jsx)(Te,{runId:t.runId,node:s})]}):(0,n.jsx)("div",{id:"v3-node-panel",className:"v3r-panel",children:(0,n.jsx)("p",{className:"muted",children:"\u70B9\u4E00\u4E2A\u8282\u70B9\u770B\u8BE6\u60C5\u4E0E\u7EC8\u7AEF"})})}function ke(t){let e=t.node;return(0,n.jsxs)("p",{className:"v3r-err",children:["\u539F\u56E0\uFF1A",e.errorClass,e.errorCode?` (${e.errorCode})`:"",e.status==="blocked"&&!e.isLoop?(0,n.jsxs)(n.Fragment,{children:[" \u2014 \u98DE\u4E66\u5361\u7247\u6216 ",(0,n.jsx)("code",{children:"botmux workflow retry"})," \u53EF\u91CD\u8BD5"]}):null]})}function Ve(t){let e=t.node.loop;return(0,n.jsxs)("div",{className:"v3r-inst-strip",children:[(0,n.jsx)("span",{className:"lbl",children:"\u5B9E\u4F8B\u7EC8\u7AEF"}),(0,n.jsx)("span",{className:"v3r-nodeid sm",children:t.node.id}),(0,n.jsxs)("span",{className:`v3r-pill st-${t.node.status}`,children:[(0,n.jsx)("i",{className:"dot"}),I[t.node.status]]}),(0,n.jsxs)("span",{className:"muted",children:["\u7B2C ",e.iteration," \u8F6E \xB7 ",e.bodyNodeId,t.auto?" \xB7 \u81EA\u52A8\u8DDF\u968F":""]})]})}function $e(t){let e=t.node.loopState;if(!e)return(0,n.jsx)("p",{className:"muted",children:"loop \u672A\u5F00\u59CB"});let o=P(t.node),s=new Map(e.decisions.map(a=>[a.iteration,a.decision])),r=Y(t.instances);return(0,n.jsxs)("div",{className:"v3r-loop-sec",children:[(0,n.jsxs)("div",{className:"v3r-loop-meter",children:[(0,n.jsxs)("span",{className:"num",children:["\u7B2C ",(0,n.jsx)("b",{children:e.iteration}),o!==void 0?(0,n.jsxs)(n.Fragment,{children:[" / ",(0,n.jsx)("b",{children:o})]}):null," \u8F6E"]}),e.granted>0?(0,n.jsxs)("span",{className:"v3r-granted-tag",children:["\u542B\u4EBA\u5DE5\u8FFD\u52A0 +",e.granted]}):null,e.lastDecision==="exit"?(0,n.jsx)("span",{className:"v3r-verdict vd-exit",children:"\u2713 \u5DF2\u6536\u655B"}):null]}),(0,n.jsx)("div",{className:"v3r-rounds",children:r.map(a=>{let d=s.get(a.iteration),c=a.iteration===e.iteration,f=e.maxIterations!==void 0&&a.iteration>e.maxIterations;return(0,n.jsxs)("div",{className:`v3r-round${c?" cur":""}${d?` vd-${d}`:""}`,children:[(0,n.jsxs)("div",{className:"v3r-round-head",children:[(0,n.jsxs)("span",{className:"rn",children:["R",a.iteration]}),f?(0,n.jsx)("span",{className:"v3r-granted-tag",children:"\u2795 \u8FFD\u52A0\u8F6E"}):null,d?(0,n.jsx)("span",{className:`v3r-verdict vd-${d}`,children:X[d]}):c&&t.node.status==="running"?(0,n.jsx)("span",{className:"v3r-verdict vd-live",children:"\u25B6 \u8FDB\u884C\u4E2D"}):null]}),(0,n.jsx)(Le,{template:e.bodyTemplate,instances:a.instances,activeInstanceId:t.activeInstanceId,onInstanceSelect:t.onInstanceSelect})]},a.iteration)})}),t.node.status==="blocked"?(0,n.jsxs)("div",{className:"v3r-cta",children:["\u26A0 \u8F6E\u6570\u8017\u5C3D\uFF0C\u7B49\u4EBA\u8FFD\u52A0 \u2014 \u98DE\u4E66\u5361\u7247\u70B9\u300C\u2795 \u8FFD\u52A0 1 \u8F6E\u300D\uFF0C\u6216 ",(0,n.jsxs)("code",{children:["botmux workflow grant ",t.runId]})]}):null]})}function Le(t){let e=(0,l.useMemo)(()=>new Map(t.instances.map(s=>[s.loop.bodyNodeId,s])),[t.instances]),o=(0,l.useMemo)(()=>K(t.template,e),[t.template,e]);return(0,n.jsxs)("svg",{className:"v3r-mini-svg",width:o.width,height:o.height,viewBox:`0 0 ${o.width} ${o.height}`,children:[(0,n.jsx)("defs",{children:(0,n.jsx)("marker",{id:"v3arrow-mini",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,n.jsx)("path",{d:"M0,0 L10,5 L0,10 z",fill:"var(--faint, #8b98aa)"})})}),o.edges.map(s=>(0,n.jsx)("path",{className:`v3r-edge${s.live?" live":""}`,d:`M${s.x1},${s.y1} C${s.mx},${s.y1} ${s.mx},${s.y2} ${s.x2},${s.y2}`,markerEnd:"url(#v3arrow-mini)"},`${s.fromId}->${s.toId}`)),o.nodes.map(s=>{let r=s.node,a=r?.status??"pending",d=r?.id===t.activeInstanceId;return(0,n.jsxs)("g",{className:`v3r-node v3r-mini st-${a}${d?" sel":""}${r?"":" ghost"}`,"data-sel":r?.id,style:r?{cursor:"pointer"}:void 0,onClick:c=>{r&&(c.stopPropagation(),t.onInstanceSelect(r.id))},children:[(0,n.jsx)("rect",{className:"v3r-box",x:s.x,y:s.y,width:s.width,height:s.height,rx:"8"}),(0,n.jsx)("circle",{className:"v3r-mini-dot",cx:s.x+13,cy:s.y+s.height/2,r:"3.4"}),(0,n.jsx)("text",{className:"v3r-nid",x:s.x+24,y:s.y+s.height/2+4,children:L(s.templateId,12)})]},s.templateId)})]})}function Te(t){let e=(0,l.useRef)(null),o=(0,l.useRef)(null),s=t.node?`${t.runId}|${t.node.id}|${H(t.node)}`:null;return(0,l.useEffect)(()=>{let r=e.current;if(r){if(!t.node||!s){r.innerHTML="",o.current=null;return}o.current!==s&&(Q(r,t.runId,t.node),o.current=s)}},[t.runId,t.node,s]),(0,n.jsx)("div",{id:"v3-term-slot",className:"v3r-term-slot",ref:e})}function te(){let t=W();return(0,n.jsx)("section",{className:"page workflows-page v3-page",children:t?(0,n.jsx)(we,{runId:t}):(0,n.jsx)(he,{})})}var ne=S(V(),1);function je(t){return O(t,(0,ne.jsx)(te,{}))}export{je as renderV3RunsPage};
@@ -1 +1 @@
1
- import{b as B}from"./chunk-OEJIT66L.js";import{c as W,j as C}from"./chunk-SRIE4MLQ.js";import"./chunk-PNK3HQBI.js";import{a as P}from"./chunk-SYC6D5XU.js";import{a as O,d as T}from"./chunk-5THX4DI2.js";import{c as R}from"./chunk-7SZRL6FY.js";var r=R(O(),1);var e=R(T(),1);function x(t){let a=Date.parse(t);if(!a)return t||"-";let o=Math.max(0,Math.floor((Date.now()-a)/1e3));if(o<60)return`${o}s ago`;let i=Math.floor(o/60);if(i<60)return`${i}m ago`;let n=Math.floor(i/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function F(t){return t.chatId?.trim()||"__local__"}function G(t,a){if(t==="__local__")return"\u672A\u7ED1\u5B9A\u7FA4 / \u672C\u5730\u767D\u677F";let o=a.get(t);return o&&o!==t?`${o} (${t})`:t}function K(t,a){let o=new Map;for(let i of t){let n=F(i),c=o.get(n)??[];c.push(i),o.set(n,c)}return[...o.entries()].map(([i,n])=>({chatId:i,label:G(i,a),rows:[...n].sort((c,b)=>b.updatedAt.localeCompare(c.updatedAt))})).sort((i,n)=>i.label.localeCompare(n.label))}function z(){return decodeURIComponent((location.hash.match(/^#\/whiteboards\/([^/]+)/)?.[1]??"").trim())}async function E(t,a){let o=await fetch(`/api/whiteboards/${encodeURIComponent(t)}`),i=await o.json().catch(()=>({}));if(o.ok)return{id:t,content:String(i.content??""),row:a.find(n=>n.id===t)}}async function J(t){let a=new Map;if(!t?.ok)return a;let o=await t.json().catch(()=>({})),i=Array.isArray(o.chats)?o.chats:[];for(let n of i)n.chatId&&a.set(String(n.chatId),String(n.name||n.chatId));return a}function Q(t){let a=t.row,o=a.title||a.id;return(0,e.jsxs)("a",{className:`wb-item${t.active?" active":""}`,"data-whiteboard-id":a.id,href:`#/whiteboards/${encodeURIComponent(a.id)}`,onClick:i=>{i.preventDefault(),t.onSelect(a.id)},children:[(0,e.jsx)("div",{className:"wb-item-head",children:(0,e.jsxs)("div",{className:"wb-item-main",children:[(0,e.jsx)("strong",{children:(0,e.jsx)(C,{text:o,textClassName:"wb-title-scroll"})}),(0,e.jsx)("span",{className:"wb-id-text",title:a.id,children:a.id})]})}),(0,e.jsxs)("div",{className:"wb-item-foot",children:[(0,e.jsxs)("div",{className:"wb-item-meta",children:[(0,e.jsx)("span",{children:x(a.updatedAt)}),(0,e.jsx)("span",{children:"\xB7"}),(0,e.jsxs)("span",{children:["log ",a.logCount]})]}),(0,e.jsx)("span",{className:"wb-scope",title:a.scope,children:a.scope})]})]})}function p(t){let a=t.value||"-";return(0,e.jsxs)("div",{className:"wb-meta-card",title:a,children:[(0,e.jsx)("span",{children:t.label}),(0,e.jsx)("strong",{children:a})]})}function V(t){let a=t.selected;if(!a)return(0,e.jsx)("p",{className:"empty",children:"\u9009\u62E9\u5DE6\u4FA7\u767D\u677F\u67E5\u770B meta \u548C board.md\u3002"});let o=a.row,i=o?.chatId?G(o.chatId,t.groupNames):"\u672A\u7ED1\u5B9A\u7FA4 / \u672C\u5730\u767D\u677F",n=o?.title||a.id;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"wb-detail-head",children:[(0,e.jsxs)("div",{className:"wb-detail-title",children:[(0,e.jsx)("p",{className:"eyebrow",children:"WHITEBOARD"}),(0,e.jsx)("h2",{title:n,children:n}),(0,e.jsx)("code",{title:a.id,children:a.id})]}),(0,e.jsx)("button",{type:"button",className:"danger","data-delete-whiteboard":!0,onClick:t.onDelete,children:"\u5220\u9664\u767D\u677F"})]}),(0,e.jsxs)("div",{className:"wb-meta-grid",children:[(0,e.jsx)(p,{label:"\u6240\u5C5E\u7FA4",value:i}),(0,e.jsx)(p,{label:"\u8303\u56F4",value:o?.scope??"-"}),(0,e.jsx)(p,{label:"\u6700\u8FD1\u66F4\u65B0",value:o?.updatedAt?x(o.updatedAt):"-"}),(0,e.jsx)(p,{label:"\u6765\u6E90\u76EE\u5F55",value:o?.workingDir??"-"})]}),(0,e.jsxs)("details",{className:"wb-admin-info",children:[(0,e.jsx)("summary",{children:"\u7BA1\u7406\u4FE1\u606F / \u6587\u4EF6\u8DEF\u5F84"}),(0,e.jsx)("code",{children:o?.path??""})]}),(0,e.jsxs)("section",{className:"wb-board-panel",children:[(0,e.jsxs)("div",{className:"wb-board-panel-head",children:[(0,e.jsx)("strong",{children:"board.md"}),(0,e.jsx)("span",{children:"\u53EA\u8BFB\u9884\u89C8"})]}),(0,e.jsx)("pre",{children:a.content||"\uFF08\u6682\u65E0\u5185\u5BB9\uFF09"})]})]})}function X(t){let a=t.selected.row?.title||t.selected.id;return(0,e.jsx)("div",{className:"wb-delete-backdrop","data-delete-modal":!0,onClick:o=>{o.target===o.currentTarget&&t.onCancel()},children:(0,e.jsxs)("div",{className:"wb-delete-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"wb-delete-title",children:[(0,e.jsxs)("div",{className:"wb-delete-body",children:[(0,e.jsx)("div",{className:"wb-delete-mark","aria-hidden":"true",children:"!"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{id:"wb-delete-title",children:"\u5220\u9664\u767D\u677F\uFF1F"}),(0,e.jsxs)("p",{children:["\u5C06\u5220\u9664 ",(0,e.jsx)("strong",{children:a}),"\uFF08",(0,e.jsx)("code",{children:t.selected.id}),"\uFF09\u7684 board\u3001log\u3001meta\uFF0C\u5E76\u6E05\u7406\u9ED8\u8BA4\u7ED1\u5B9A\u548C\u4F1A\u8BDD\u5F15\u7528\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002"]})]})]}),(0,e.jsxs)("div",{className:"actions wb-delete-actions",children:[(0,e.jsx)("button",{type:"button","data-delete-cancel":!0,onClick:t.onCancel,disabled:t.deleting,children:"\u53D6\u6D88"}),(0,e.jsx)("button",{type:"button",className:"danger","data-delete-confirm":!0,onClick:t.onConfirm,disabled:t.deleting,children:t.deleting?"\u5220\u9664\u4E2D...":"\u786E\u8BA4\u5220\u9664"})]})]})})}function Y(){let t=B(),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),[i,n]=(0,r.useState)(!1),[c,b]=(0,r.useState)([]),[g,_]=(0,r.useState)(()=>new Map),[m,f]=(0,r.useState)(),[H,S]=(0,r.useState)(!0),[k,M]=(0,r.useState)(null),[u,h]=(0,r.useState)(null),[L,D]=(0,r.useState)(!1),I=(0,r.useMemo)(()=>K(c,g),[c,g]);(0,r.useEffect)(()=>{a.current=!0;let s=z();async function d(){S(!0);try{let[l,y]=await Promise.all([fetch("/api/whiteboards"),fetch("/api/groups").catch(()=>null)]),w=await l.json().catch(()=>({}));if(!l.ok)throw new Error(w?.error??`HTTP ${l.status}`);let q=await J(y),$=Array.isArray(w.whiteboards)?w.whiteboards:[],A;if(s&&(A=await E(s,$)),!a.current)return;n(w.enabled===!0),b($),_(q),f(A),M(null)}catch(l){a.current&&M(l instanceof Error?l.message:String(l))}finally{a.current&&S(!1)}}return d(),()=>{a.current=!1,o.current+=1}},[]);async function U(s){let d=o.current+1;o.current=d;let l=await E(s,c);!a.current||o.current!==d||!l||(f(l),window.history.replaceState(null,"",`#/whiteboards/${encodeURIComponent(s)}`))}async function j(){if(u){D(!0);try{let s=await fetch(`/api/whiteboards/${encodeURIComponent(u.id)}`,{method:"DELETE"}),d=await s.json().catch(()=>({}));if(!s.ok||d.ok===!1)throw new Error(d?.error??`HTTP ${s.status}`);if(!a.current)return;b(l=>l.filter(y=>y.id!==u.id)),m?.id===u.id&&(f(void 0),window.history.replaceState(null,"","#/whiteboards")),h(null)}catch(s){a.current&&window.alert(`\u5220\u9664\u5931\u8D25\uFF1A${s instanceof Error?s.message:String(s)}`)}finally{a.current&&D(!1)}}}let v="\u767D\u677F\u80FD\u529B\u5F53\u524D\u5173\u95ED\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u521B\u5EFA/\u7ED1\u5B9A\u767D\u677F\uFF0C\u4E5F\u4E0D\u4F1A\u6CE8\u5165\u5230 agent prompt\u3002\u5386\u53F2\u767D\u677F\u4EC5\u5728 dashboard \u4E2D\u53EA\u8BFB\u53EF\u89C1\uFF0C\u53EF\u5728\u6B64\u6E05\u7406\u3002",N=(s=!1)=>(0,e.jsx)("div",{className:"page-heading",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:t("nav.whiteboards")}),(0,e.jsx)("h1",{children:t("nav.whiteboards")}),s?(0,e.jsx)("span",{className:"wb-disabled-pill",title:v,"aria-label":v,children:v}):null]})});return k?(0,e.jsxs)("section",{className:"page whiteboards-page",children:[N(),(0,e.jsxs)("p",{className:"hint-warn",children:["\u52A0\u8F7D\u767D\u677F\u5931\u8D25\uFF1A",k]})]}):H?(0,e.jsxs)("section",{className:"page whiteboards-page","data-whiteboards-host":!0,children:[N(),(0,e.jsx)(W,{label:t("common.loading")})]}):(0,e.jsxs)("section",{className:"page whiteboards-page",children:[N(!i),(0,e.jsxs)("div",{className:"wb-split",children:[(0,e.jsx)("section",{className:"overview-block wb-list-block",children:(0,e.jsx)("div",{className:"wb-list-panel",children:I.length===0?(0,e.jsx)("p",{className:"empty wb-empty",children:"\u6682\u65E0\u767D\u677F\u3002\u6253\u5F00\u80FD\u529B\u540E\uFF0C\u6BCF\u4E2A\u7FA4\u9996\u6B21\u9700\u8981\u767D\u677F\u65F6\u624D\u4F1A\u521B\u5EFA\u9ED8\u8BA4\u767D\u677F\u3002"}):I.map(s=>(0,e.jsxs)("details",{className:"wb-group",open:!0,children:[(0,e.jsxs)("summary",{children:[(0,e.jsx)("span",{className:"wb-group-title",children:(0,e.jsx)(C,{text:s.label,textClassName:"wb-group-title-scroll"})}),(0,e.jsx)("small",{children:s.rows.length})]}),(0,e.jsx)("div",{className:"wb-group-items",children:s.rows.map(d=>(0,e.jsx)(Q,{row:d,active:m?.id===d.id,onSelect:l=>{U(l)}},d.id))})]},s.chatId))})}),(0,e.jsx)("section",{className:"overview-block wb-detail-block",children:(0,e.jsx)("div",{className:"wb-detail-panel",id:"whiteboard-detail",children:(0,e.jsx)(V,{selected:m,groupNames:g,onDelete:()=>{m&&h(m)}})})})]}),u?(0,e.jsx)(X,{selected:u,deleting:L,onCancel:()=>h(null),onConfirm:()=>{j()}}):null]})}function ae(t){return P(t,(0,e.jsx)(Y,{}))}export{ae as renderWhiteboardsPage};
1
+ import{b as B}from"./chunk-CMDPZOPK.js";import{c as W,j as C}from"./chunk-I35DXGM4.js";import"./chunk-NYZHARIU.js";import{a as P}from"./chunk-SYC6D5XU.js";import{a as O,d as T}from"./chunk-5THX4DI2.js";import{c as R}from"./chunk-7SZRL6FY.js";var r=R(O(),1);var e=R(T(),1);function x(t){let a=Date.parse(t);if(!a)return t||"-";let o=Math.max(0,Math.floor((Date.now()-a)/1e3));if(o<60)return`${o}s ago`;let i=Math.floor(o/60);if(i<60)return`${i}m ago`;let n=Math.floor(i/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}function F(t){return t.chatId?.trim()||"__local__"}function G(t,a){if(t==="__local__")return"\u672A\u7ED1\u5B9A\u7FA4 / \u672C\u5730\u767D\u677F";let o=a.get(t);return o&&o!==t?`${o} (${t})`:t}function K(t,a){let o=new Map;for(let i of t){let n=F(i),c=o.get(n)??[];c.push(i),o.set(n,c)}return[...o.entries()].map(([i,n])=>({chatId:i,label:G(i,a),rows:[...n].sort((c,b)=>b.updatedAt.localeCompare(c.updatedAt))})).sort((i,n)=>i.label.localeCompare(n.label))}function z(){return decodeURIComponent((location.hash.match(/^#\/whiteboards\/([^/]+)/)?.[1]??"").trim())}async function E(t,a){let o=await fetch(`/api/whiteboards/${encodeURIComponent(t)}`),i=await o.json().catch(()=>({}));if(o.ok)return{id:t,content:String(i.content??""),row:a.find(n=>n.id===t)}}async function J(t){let a=new Map;if(!t?.ok)return a;let o=await t.json().catch(()=>({})),i=Array.isArray(o.chats)?o.chats:[];for(let n of i)n.chatId&&a.set(String(n.chatId),String(n.name||n.chatId));return a}function Q(t){let a=t.row,o=a.title||a.id;return(0,e.jsxs)("a",{className:`wb-item${t.active?" active":""}`,"data-whiteboard-id":a.id,href:`#/whiteboards/${encodeURIComponent(a.id)}`,onClick:i=>{i.preventDefault(),t.onSelect(a.id)},children:[(0,e.jsx)("div",{className:"wb-item-head",children:(0,e.jsxs)("div",{className:"wb-item-main",children:[(0,e.jsx)("strong",{children:(0,e.jsx)(C,{text:o,textClassName:"wb-title-scroll"})}),(0,e.jsx)("span",{className:"wb-id-text",title:a.id,children:a.id})]})}),(0,e.jsxs)("div",{className:"wb-item-foot",children:[(0,e.jsxs)("div",{className:"wb-item-meta",children:[(0,e.jsx)("span",{children:x(a.updatedAt)}),(0,e.jsx)("span",{children:"\xB7"}),(0,e.jsxs)("span",{children:["log ",a.logCount]})]}),(0,e.jsx)("span",{className:"wb-scope",title:a.scope,children:a.scope})]})]})}function p(t){let a=t.value||"-";return(0,e.jsxs)("div",{className:"wb-meta-card",title:a,children:[(0,e.jsx)("span",{children:t.label}),(0,e.jsx)("strong",{children:a})]})}function V(t){let a=t.selected;if(!a)return(0,e.jsx)("p",{className:"empty",children:"\u9009\u62E9\u5DE6\u4FA7\u767D\u677F\u67E5\u770B meta \u548C board.md\u3002"});let o=a.row,i=o?.chatId?G(o.chatId,t.groupNames):"\u672A\u7ED1\u5B9A\u7FA4 / \u672C\u5730\u767D\u677F",n=o?.title||a.id;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"wb-detail-head",children:[(0,e.jsxs)("div",{className:"wb-detail-title",children:[(0,e.jsx)("p",{className:"eyebrow",children:"WHITEBOARD"}),(0,e.jsx)("h2",{title:n,children:n}),(0,e.jsx)("code",{title:a.id,children:a.id})]}),(0,e.jsx)("button",{type:"button",className:"danger","data-delete-whiteboard":!0,onClick:t.onDelete,children:"\u5220\u9664\u767D\u677F"})]}),(0,e.jsxs)("div",{className:"wb-meta-grid",children:[(0,e.jsx)(p,{label:"\u6240\u5C5E\u7FA4",value:i}),(0,e.jsx)(p,{label:"\u8303\u56F4",value:o?.scope??"-"}),(0,e.jsx)(p,{label:"\u6700\u8FD1\u66F4\u65B0",value:o?.updatedAt?x(o.updatedAt):"-"}),(0,e.jsx)(p,{label:"\u6765\u6E90\u76EE\u5F55",value:o?.workingDir??"-"})]}),(0,e.jsxs)("details",{className:"wb-admin-info",children:[(0,e.jsx)("summary",{children:"\u7BA1\u7406\u4FE1\u606F / \u6587\u4EF6\u8DEF\u5F84"}),(0,e.jsx)("code",{children:o?.path??""})]}),(0,e.jsxs)("section",{className:"wb-board-panel",children:[(0,e.jsxs)("div",{className:"wb-board-panel-head",children:[(0,e.jsx)("strong",{children:"board.md"}),(0,e.jsx)("span",{children:"\u53EA\u8BFB\u9884\u89C8"})]}),(0,e.jsx)("pre",{children:a.content||"\uFF08\u6682\u65E0\u5185\u5BB9\uFF09"})]})]})}function X(t){let a=t.selected.row?.title||t.selected.id;return(0,e.jsx)("div",{className:"wb-delete-backdrop","data-delete-modal":!0,onClick:o=>{o.target===o.currentTarget&&t.onCancel()},children:(0,e.jsxs)("div",{className:"wb-delete-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"wb-delete-title",children:[(0,e.jsxs)("div",{className:"wb-delete-body",children:[(0,e.jsx)("div",{className:"wb-delete-mark","aria-hidden":"true",children:"!"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{id:"wb-delete-title",children:"\u5220\u9664\u767D\u677F\uFF1F"}),(0,e.jsxs)("p",{children:["\u5C06\u5220\u9664 ",(0,e.jsx)("strong",{children:a}),"\uFF08",(0,e.jsx)("code",{children:t.selected.id}),"\uFF09\u7684 board\u3001log\u3001meta\uFF0C\u5E76\u6E05\u7406\u9ED8\u8BA4\u7ED1\u5B9A\u548C\u4F1A\u8BDD\u5F15\u7528\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u6062\u590D\u3002"]})]})]}),(0,e.jsxs)("div",{className:"actions wb-delete-actions",children:[(0,e.jsx)("button",{type:"button","data-delete-cancel":!0,onClick:t.onCancel,disabled:t.deleting,children:"\u53D6\u6D88"}),(0,e.jsx)("button",{type:"button",className:"danger","data-delete-confirm":!0,onClick:t.onConfirm,disabled:t.deleting,children:t.deleting?"\u5220\u9664\u4E2D...":"\u786E\u8BA4\u5220\u9664"})]})]})})}function Y(){let t=B(),a=(0,r.useRef)(!1),o=(0,r.useRef)(0),[i,n]=(0,r.useState)(!1),[c,b]=(0,r.useState)([]),[g,_]=(0,r.useState)(()=>new Map),[m,f]=(0,r.useState)(),[H,S]=(0,r.useState)(!0),[k,M]=(0,r.useState)(null),[u,h]=(0,r.useState)(null),[L,D]=(0,r.useState)(!1),I=(0,r.useMemo)(()=>K(c,g),[c,g]);(0,r.useEffect)(()=>{a.current=!0;let s=z();async function d(){S(!0);try{let[l,y]=await Promise.all([fetch("/api/whiteboards"),fetch("/api/groups").catch(()=>null)]),w=await l.json().catch(()=>({}));if(!l.ok)throw new Error(w?.error??`HTTP ${l.status}`);let q=await J(y),$=Array.isArray(w.whiteboards)?w.whiteboards:[],A;if(s&&(A=await E(s,$)),!a.current)return;n(w.enabled===!0),b($),_(q),f(A),M(null)}catch(l){a.current&&M(l instanceof Error?l.message:String(l))}finally{a.current&&S(!1)}}return d(),()=>{a.current=!1,o.current+=1}},[]);async function U(s){let d=o.current+1;o.current=d;let l=await E(s,c);!a.current||o.current!==d||!l||(f(l),window.history.replaceState(null,"",`#/whiteboards/${encodeURIComponent(s)}`))}async function j(){if(u){D(!0);try{let s=await fetch(`/api/whiteboards/${encodeURIComponent(u.id)}`,{method:"DELETE"}),d=await s.json().catch(()=>({}));if(!s.ok||d.ok===!1)throw new Error(d?.error??`HTTP ${s.status}`);if(!a.current)return;b(l=>l.filter(y=>y.id!==u.id)),m?.id===u.id&&(f(void 0),window.history.replaceState(null,"","#/whiteboards")),h(null)}catch(s){a.current&&window.alert(`\u5220\u9664\u5931\u8D25\uFF1A${s instanceof Error?s.message:String(s)}`)}finally{a.current&&D(!1)}}}let v="\u767D\u677F\u80FD\u529B\u5F53\u524D\u5173\u95ED\uFF1A\u4E0D\u4F1A\u81EA\u52A8\u521B\u5EFA/\u7ED1\u5B9A\u767D\u677F\uFF0C\u4E5F\u4E0D\u4F1A\u6CE8\u5165\u5230 agent prompt\u3002\u5386\u53F2\u767D\u677F\u4EC5\u5728 dashboard \u4E2D\u53EA\u8BFB\u53EF\u89C1\uFF0C\u53EF\u5728\u6B64\u6E05\u7406\u3002",N=(s=!1)=>(0,e.jsx)("div",{className:"page-heading",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"eyebrow",children:t("nav.whiteboards")}),(0,e.jsx)("h1",{children:t("nav.whiteboards")}),s?(0,e.jsx)("span",{className:"wb-disabled-pill",title:v,"aria-label":v,children:v}):null]})});return k?(0,e.jsxs)("section",{className:"page whiteboards-page",children:[N(),(0,e.jsxs)("p",{className:"hint-warn",children:["\u52A0\u8F7D\u767D\u677F\u5931\u8D25\uFF1A",k]})]}):H?(0,e.jsxs)("section",{className:"page whiteboards-page","data-whiteboards-host":!0,children:[N(),(0,e.jsx)(W,{label:t("common.loading")})]}):(0,e.jsxs)("section",{className:"page whiteboards-page",children:[N(!i),(0,e.jsxs)("div",{className:"wb-split",children:[(0,e.jsx)("section",{className:"overview-block wb-list-block",children:(0,e.jsx)("div",{className:"wb-list-panel",children:I.length===0?(0,e.jsx)("p",{className:"empty wb-empty",children:"\u6682\u65E0\u767D\u677F\u3002\u6253\u5F00\u80FD\u529B\u540E\uFF0C\u6BCF\u4E2A\u7FA4\u9996\u6B21\u9700\u8981\u767D\u677F\u65F6\u624D\u4F1A\u521B\u5EFA\u9ED8\u8BA4\u767D\u677F\u3002"}):I.map(s=>(0,e.jsxs)("details",{className:"wb-group",open:!0,children:[(0,e.jsxs)("summary",{children:[(0,e.jsx)("span",{className:"wb-group-title",children:(0,e.jsx)(C,{text:s.label,textClassName:"wb-group-title-scroll"})}),(0,e.jsx)("small",{children:s.rows.length})]}),(0,e.jsx)("div",{className:"wb-group-items",children:s.rows.map(d=>(0,e.jsx)(Q,{row:d,active:m?.id===d.id,onSelect:l=>{U(l)}},d.id))})]},s.chatId))})}),(0,e.jsx)("section",{className:"overview-block wb-detail-block",children:(0,e.jsx)("div",{className:"wb-detail-panel",id:"whiteboard-detail",children:(0,e.jsx)(V,{selected:m,groupNames:g,onDelete:()=>{m&&h(m)}})})})]}),u?(0,e.jsx)(X,{selected:u,deleting:L,onCancel:()=>h(null),onConfirm:()=>{j()}}):null]})}function ae(t){return P(t,(0,e.jsx)(Y,{}))}export{ae as renderWhiteboardsPage};