elanous 0.2.10 → 0.2.11

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 (584) hide show
  1. package/apps/pwa/out/404/index.html +1 -1
  2. package/apps/pwa/out/404.html +1 -1
  3. package/apps/pwa/out/_next/static/Y4zKzL62sakG5momz3SoQ/_buildManifest.js +1 -0
  4. package/apps/pwa/out/_next/static/chunks/1159-0c5ef8bc21cb6afb.js +1 -0
  5. package/apps/pwa/out/_next/static/chunks/1394-556de6d71bbdb0fb.js +1 -0
  6. package/apps/pwa/out/_next/static/chunks/1452.93700483b9d4fc61.js +9 -0
  7. package/apps/pwa/out/_next/static/chunks/{6062-73e68343a9814f6a.js → 1829-b453a1b22d3999bb.js} +1 -1
  8. package/apps/pwa/out/_next/static/chunks/2176-c379e3ebce874151.js +1 -0
  9. package/apps/pwa/out/_next/static/chunks/2310-7a59f043f6db207e.js +1 -0
  10. package/apps/pwa/out/_next/static/chunks/2426.8c6ee0c668d53def.js +1 -0
  11. package/apps/pwa/out/_next/static/chunks/2548-6e316138d347cefe.js +1 -0
  12. package/apps/pwa/out/_next/static/chunks/3170-7ec60a56fa0e4728.js +1 -0
  13. package/apps/pwa/out/_next/static/chunks/3278-ae6ef084769f6195.js +1 -0
  14. package/apps/pwa/out/_next/static/chunks/3454-988a53dac60a1763.js +1 -0
  15. package/apps/pwa/out/_next/static/chunks/3638-aa80b4641ea439db.js +1 -0
  16. package/apps/pwa/out/_next/static/chunks/3735-fe3402553ac1c9c6.js +1 -0
  17. package/apps/pwa/out/_next/static/chunks/3869-a39d1d9921e10d43.js +1 -0
  18. package/apps/pwa/out/_next/static/chunks/390.c373e31b3b9d0c41.js +5 -0
  19. package/apps/pwa/out/_next/static/chunks/3992-2e522a8ac5f2afde.js +25 -0
  20. package/apps/pwa/out/_next/static/chunks/4215-c9d91dd644ec1719.js +1 -0
  21. package/apps/pwa/out/_next/static/chunks/4508-5d0161d1e724d735.js +1 -0
  22. package/apps/pwa/out/_next/static/chunks/4685-c3c1c625b71accd1.js +1 -0
  23. package/apps/pwa/out/_next/static/chunks/4733-623a79345b171e1c.js +1 -0
  24. package/apps/pwa/out/_next/static/chunks/4883.3bd969ea1d3aaaff.js +2 -0
  25. package/apps/pwa/out/_next/static/chunks/507-5acd98bd6dab2d8a.js +1 -0
  26. package/apps/pwa/out/_next/static/chunks/5445-745eb795c5963d79.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/5532.6899a12958a89b72.js +1 -0
  28. package/apps/pwa/out/_next/static/chunks/{8067-87ce253ec2f23697.js → 5845-e6c003ce8d5fd36a.js} +1 -1
  29. package/apps/pwa/out/_next/static/chunks/5978-b27004c677119115.js +1 -0
  30. package/apps/pwa/out/_next/static/chunks/{8046cadf-211ca3c0e00f2b72.js → 5cd7e3a9-404fd6b8d0ecd44c.js} +1 -1
  31. package/apps/pwa/out/_next/static/chunks/6048-4c5c33579bc4ef78.js +1 -0
  32. package/apps/pwa/out/_next/static/chunks/6303-422dbf0f67c72aac.js +1 -0
  33. package/apps/pwa/out/_next/static/chunks/6751-bb3595948b2e311b.js +1 -0
  34. package/apps/pwa/out/_next/static/chunks/7274-19b7279f18b47ab3.js +1 -0
  35. package/apps/pwa/out/_next/static/chunks/{4323.c5dfb6f503304775.js → 7334.a6679d9168f37aa8.js} +1 -1
  36. package/apps/pwa/out/_next/static/chunks/7551-a0e0707b79164ddd.js +1 -0
  37. package/apps/pwa/out/_next/static/chunks/7777-79f845045aa1ed86.js +1 -0
  38. package/apps/pwa/out/_next/static/chunks/79f8be9e-957d68913b590b08.js +1 -0
  39. package/apps/pwa/out/_next/static/chunks/8025-cc24ee5d8f2fb6f8.js +1 -0
  40. package/apps/pwa/out/_next/static/chunks/8039-df92e08fede5de8f.js +1 -0
  41. package/apps/pwa/out/_next/static/chunks/8206-c6684dcde12be721.js +1 -0
  42. package/apps/pwa/out/_next/static/chunks/8421-1c4acfb1395a0edf.js +1 -0
  43. package/apps/pwa/out/_next/static/chunks/8605-ea5bee9dfae512c7.js +1 -0
  44. package/apps/pwa/out/_next/static/chunks/8725.bf46bb1395dd0fa2.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/8734-252d511cd276c0dc.js +1 -0
  46. package/apps/pwa/out/_next/static/chunks/8834-ca1cb09c1cb1a6bf.js +1 -0
  47. package/apps/pwa/out/_next/static/chunks/{2415.ed6428ff334c7ce2.js → 9269.d2a4795bc6812717.js} +1 -1
  48. package/apps/pwa/out/_next/static/chunks/9538-2816b90923606459.js +1 -0
  49. package/apps/pwa/out/_next/static/chunks/9656-c1540088f5859c80.js +1 -0
  50. package/apps/pwa/out/_next/static/chunks/9906-482c6619b3fdda20.js +1 -0
  51. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-d16993889b125c42.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/app/approvals/page-1dcdc58fc2de2454.js +1 -0
  53. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-6a061bd97f0b9398.js +1 -0
  54. package/apps/pwa/out/_next/static/chunks/app/board/page-cb95a7432c9ee744.js +1 -0
  55. package/apps/pwa/out/_next/static/chunks/app/botlab/{page-54b32bd27726588d.js → page-b12b6d2f8d2d1aea.js} +1 -1
  56. package/apps/pwa/out/_next/static/chunks/app/bots/page-b9efe868bfd36255.js +1 -0
  57. package/apps/pwa/out/_next/static/chunks/app/chat/page-7c97dcdfe2e37a60.js +1 -0
  58. package/apps/pwa/out/_next/static/chunks/app/consult/page-8fd36984f549270a.js +1 -0
  59. package/apps/pwa/out/_next/static/chunks/app/control/page-5721537ca8a3598c.js +1 -0
  60. package/apps/pwa/out/_next/static/chunks/app/design-check/page-b654240a572e4c48.js +1 -0
  61. package/apps/pwa/out/_next/static/chunks/app/editor/page-b9750abc897508c3.js +1 -0
  62. package/apps/pwa/out/_next/static/chunks/app/exec/page-4cd1de371f8ad048.js +1 -0
  63. package/apps/pwa/out/_next/static/chunks/app/field/page-d99f89657828421c.js +1 -0
  64. package/apps/pwa/out/_next/static/chunks/app/healthz/route-d16993889b125c42.js +1 -0
  65. package/apps/pwa/out/_next/static/chunks/app/inside/page-50cb2a0eb15e6c83.js +1 -0
  66. package/apps/pwa/out/_next/static/chunks/app/intake/page-c8b1ccda6ba7ae98.js +1 -0
  67. package/apps/pwa/out/_next/static/chunks/app/layout-d6b1d156fb95e74b.js +1 -0
  68. package/apps/pwa/out/_next/static/chunks/app/live/page-2a9932ddb62d76bd.js +1 -0
  69. package/apps/pwa/out/_next/static/chunks/app/market/page-9688f5b4f1ff950f.js +1 -0
  70. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-6b15dd6456c5df09.js +1 -0
  71. package/apps/pwa/out/_next/static/chunks/app/morning/page-35414e0a007b4082.js +1 -0
  72. package/apps/pwa/out/_next/static/chunks/app/not-found-e7a529e0507ac86c.js +1 -0
  73. package/apps/pwa/out/_next/static/chunks/app/observatory/page-e001823c35c9dd67.js +1 -0
  74. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-371423d1a573d64b.js +1 -0
  75. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-4b764b125339ac17.js +1 -0
  76. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-cdf8e4b01067bcf1.js +1 -0
  77. package/apps/pwa/out/_next/static/chunks/app/outputs/page-3a24072b35470157.js +1 -0
  78. package/apps/pwa/out/_next/static/chunks/app/page-94c82eb0ae5abb32.js +1 -0
  79. package/apps/pwa/out/_next/static/chunks/app/reflection/page-0be8d4b2ced75ba0.js +1 -0
  80. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-d37cb0d52f9b6bd5.js +1 -0
  81. package/apps/pwa/out/_next/static/chunks/app/sessions/page-686da0df9bf23e5c.js +1 -0
  82. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-4dc614f3ce043e63.js +1 -0
  83. package/apps/pwa/out/_next/static/chunks/app/settings/page-53f80edc6b8dc07c.js +1 -0
  84. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-d02c782fc792e2af.js +1 -0
  85. package/apps/pwa/out/_next/static/chunks/app/setup/layout-d16993889b125c42.js +1 -0
  86. package/apps/pwa/out/_next/static/chunks/app/setup/page-239c17b911b84e72.js +1 -0
  87. package/apps/pwa/out/_next/static/chunks/app/share/page-dc6a79fb003f746c.js +1 -0
  88. package/apps/pwa/out/_next/static/chunks/app/showroom/page-0fffb84cafdc9da6.js +1 -0
  89. package/apps/pwa/out/_next/static/chunks/app/tasks/page-1218753c82d585f6.js +1 -0
  90. package/apps/pwa/out/_next/static/chunks/app/term/page-4b5935e67531efb5.js +1 -0
  91. package/apps/pwa/out/_next/static/chunks/app/today/page-3285bc87caf1eaa5.js +1 -0
  92. package/apps/pwa/out/_next/static/chunks/app/trace/page-ad553b0e06505ecd.js +1 -0
  93. package/apps/pwa/out/_next/static/chunks/app/vault/page-fca096e3e860306f.js +1 -0
  94. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-9ebfa78f0d9885c3.js +1 -0
  95. package/apps/pwa/out/_next/static/chunks/app/workflows/page-3dc5f21f7e39622d.js +1 -0
  96. package/apps/pwa/out/_next/static/chunks/app/workspace/page-c6da2b468454532d.js +1 -0
  97. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-93bc70e36f595414.js +1 -0
  98. package/apps/pwa/out/_next/static/chunks/{2ea96958-e8c7e112de50b067.js → f48170cc-d05d28bf87a43bf4.js} +1 -1
  99. package/apps/pwa/out/_next/static/chunks/framework-172630e6aa5e2d7f.js +1 -0
  100. package/apps/pwa/out/_next/static/chunks/main-app-f0fe2d7477845181.js +1 -0
  101. package/apps/pwa/out/_next/static/chunks/main-fc98ac70b44eccb0.js +1 -0
  102. package/apps/pwa/out/_next/static/chunks/pages/_app-5bd7f10271f72413.js +1 -0
  103. package/apps/pwa/out/_next/static/chunks/pages/_error-97d0d85ea05fef9b.js +1 -0
  104. package/apps/pwa/out/_next/static/chunks/webpack-9e4d02d567b98240.js +1 -0
  105. package/apps/pwa/out/_next/static/css/543f56bcb1f79fca.css +1 -0
  106. package/apps/pwa/out/approvals/index.html +1 -1
  107. package/apps/pwa/out/approvals/index.txt +23 -23
  108. package/apps/pwa/out/autopilot/index.html +1 -1
  109. package/apps/pwa/out/autopilot/index.txt +23 -23
  110. package/apps/pwa/out/board/index.html +1 -1
  111. package/apps/pwa/out/board/index.txt +23 -23
  112. package/apps/pwa/out/botlab/index.html +1 -1
  113. package/apps/pwa/out/botlab/index.txt +22 -22
  114. package/apps/pwa/out/bots/index.html +1 -1
  115. package/apps/pwa/out/bots/index.txt +22 -22
  116. package/apps/pwa/out/chat/index.html +1 -1
  117. package/apps/pwa/out/chat/index.txt +22 -22
  118. package/apps/pwa/out/consult/index.html +1 -1
  119. package/apps/pwa/out/consult/index.txt +23 -23
  120. package/apps/pwa/out/control/index.html +1 -1
  121. package/apps/pwa/out/control/index.txt +23 -23
  122. package/apps/pwa/out/design-check/index.html +1 -1
  123. package/apps/pwa/out/design-check/index.txt +23 -23
  124. package/apps/pwa/out/editor/index.html +1 -1
  125. package/apps/pwa/out/editor/index.txt +23 -23
  126. package/apps/pwa/out/exec/index.html +1 -1
  127. package/apps/pwa/out/exec/index.txt +23 -23
  128. package/apps/pwa/out/field/index.html +1 -1
  129. package/apps/pwa/out/field/index.txt +23 -23
  130. package/apps/pwa/out/healthz +1 -1
  131. package/apps/pwa/out/index.html +1 -1
  132. package/apps/pwa/out/index.txt +22 -22
  133. package/apps/pwa/out/inside/index.html +1 -0
  134. package/apps/pwa/out/inside/index.txt +31 -0
  135. package/apps/pwa/out/intake/index.html +1 -1
  136. package/apps/pwa/out/intake/index.txt +23 -23
  137. package/apps/pwa/out/live/index.html +1 -1
  138. package/apps/pwa/out/live/index.txt +23 -23
  139. package/apps/pwa/out/market/index.html +1 -1
  140. package/apps/pwa/out/market/index.txt +22 -22
  141. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  142. package/apps/pwa/out/missions/placeholder/index.txt +22 -22
  143. package/apps/pwa/out/morning/index.html +1 -1
  144. package/apps/pwa/out/morning/index.txt +23 -23
  145. package/apps/pwa/out/observatory/index.html +1 -1
  146. package/apps/pwa/out/observatory/index.txt +23 -23
  147. package/apps/pwa/out/ops/checklist/index.html +1 -1
  148. package/apps/pwa/out/ops/checklist/index.txt +22 -22
  149. package/apps/pwa/out/ops/release/index.html +1 -1
  150. package/apps/pwa/out/ops/release/index.txt +22 -22
  151. package/apps/pwa/out/ops/seats/index.html +1 -1
  152. package/apps/pwa/out/ops/seats/index.txt +22 -22
  153. package/apps/pwa/out/outputs/index.html +1 -0
  154. package/apps/pwa/out/outputs/index.txt +30 -0
  155. package/apps/pwa/out/reflection/index.html +1 -1
  156. package/apps/pwa/out/reflection/index.txt +23 -23
  157. package/apps/pwa/out/scheduler/index.html +1 -1
  158. package/apps/pwa/out/scheduler/index.txt +23 -23
  159. package/apps/pwa/out/sessions/index.html +1 -1
  160. package/apps/pwa/out/sessions/index.txt +22 -22
  161. package/apps/pwa/out/settings/devices/index.html +1 -1
  162. package/apps/pwa/out/settings/devices/index.txt +23 -23
  163. package/apps/pwa/out/settings/index.html +1 -1
  164. package/apps/pwa/out/settings/index.txt +23 -23
  165. package/apps/pwa/out/setup/done/index.html +1 -1
  166. package/apps/pwa/out/setup/done/index.txt +23 -23
  167. package/apps/pwa/out/setup/index.html +1 -1
  168. package/apps/pwa/out/setup/index.txt +23 -23
  169. package/apps/pwa/out/share/index.html +1 -1
  170. package/apps/pwa/out/share/index.txt +23 -23
  171. package/apps/pwa/out/showroom/index.html +1 -1
  172. package/apps/pwa/out/showroom/index.txt +22 -22
  173. package/apps/pwa/out/tasks/index.html +1 -1
  174. package/apps/pwa/out/tasks/index.txt +23 -23
  175. package/apps/pwa/out/term/index.html +1 -1
  176. package/apps/pwa/out/term/index.txt +23 -24
  177. package/apps/pwa/out/today/index.html +1 -1
  178. package/apps/pwa/out/today/index.txt +23 -23
  179. package/apps/pwa/out/trace/index.html +1 -1
  180. package/apps/pwa/out/trace/index.txt +23 -23
  181. package/apps/pwa/out/vault/index.html +1 -1
  182. package/apps/pwa/out/vault/index.txt +23 -23
  183. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  184. package/apps/pwa/out/workflows/chat-ui/index.txt +23 -23
  185. package/apps/pwa/out/workflows/index.html +1 -1
  186. package/apps/pwa/out/workflows/index.txt +23 -23
  187. package/apps/pwa/out/workspace/index.html +1 -1
  188. package/apps/pwa/out/workspace/index.txt +23 -24
  189. package/apps/pwa/out/worktrees/index.html +1 -1
  190. package/apps/pwa/out/worktrees/index.txt +23 -23
  191. package/graphs/drafts/draft-cleanup.yaml +19 -0
  192. package/graphs/drafts/recipes.yaml +23 -0
  193. package/graphs/intake/intake-daily.yaml +2 -1
  194. package/graphs/ops/recipes.yaml +3 -0
  195. package/graphs/ops/secret-exposure.yaml +24 -0
  196. package/graphs/release/recipes.yaml +3 -0
  197. package/graphs/release/release-loop.yaml +4 -1
  198. package/graphs/video/explainer-line.yaml +2 -2
  199. package/package.json +2 -1
  200. package/plugins/elanous-hwp/README.md +25 -0
  201. package/plugins/elanous-hwp/cli.ts +22 -0
  202. package/plugins/elanous-hwp/converter.ts +237 -0
  203. package/plugins/elanous-hwp/fixtures/fixed-controls.hwpx +0 -0
  204. package/plugins/elanous-hwp/fixtures/fixed-table-controls.hwpx +0 -0
  205. package/plugins/elanous-hwp/fixtures/fixed.hwpx +0 -0
  206. package/plugins/elanous-hwp/plugin.json +16 -0
  207. package/plugins/elanous-hwp/plugin.ts +40 -0
  208. package/scripts/ci-public-export-leak-gate.ts +75 -14
  209. package/scripts/ci-public-leak-gate.ts +44 -9
  210. package/scripts/context-hooks/claude-stop.sh +4 -0
  211. package/scripts/context-hooks/emit.ts +24 -0
  212. package/scripts/context-hooks/post-tool-use.sh +4 -0
  213. package/scripts/coord-channel-watch.sh +12 -0
  214. package/scripts/coord-requests-bridge.ts +143 -0
  215. package/scripts/field-feed/lib.ts +4 -0
  216. package/scripts/fleet/node-setup.sh +20 -3
  217. package/scripts/homebrew-formula-bump.ts +69 -0
  218. package/scripts/marketing/measure-site-numbers.ts +169 -0
  219. package/scripts/measure-gate-shards.ts +309 -0
  220. package/scripts/mission-request-judge.ts +31 -1
  221. package/scripts/morning-report.ts +2 -2
  222. package/scripts/opportunity-scan.ts +1 -1
  223. package/scripts/release-loop/auto-approve-node.ts +21 -4
  224. package/scripts/release-loop/cut-branch.ts +84 -0
  225. package/scripts/release-loop/gate-node.ts +14 -13
  226. package/scripts/release-loop/mac-smoke-node.ts +229 -0
  227. package/scripts/release-loop/node-verdict.ts +3 -3
  228. package/scripts/release-loop/tui-node-checks.ts +42 -0
  229. package/scripts/release-loop/tui-sim-node.ts +32 -8
  230. package/scripts/release-loop/unattended-release.ts +5 -3
  231. package/scripts/release-loop/version-node.ts +61 -10
  232. package/scripts/signal-digest-cycle.ts +2 -7
  233. package/scripts/signal-digest-photo.ts +11 -0
  234. package/scripts/tech1-public-measure.ts +94 -0
  235. package/scripts/test-diet/node.ts +1 -1
  236. package/scripts/tui-regress.ts +2 -2
  237. package/scripts/ux/demo-rehearsal.ts +243 -0
  238. package/scripts/ux/lib/rehearsal-verdict.ts +73 -0
  239. package/skills/diagram-master/SKILL.md +366 -0
  240. package/skills/diagram-master/references/engines/excalidraw/color-palette.md +67 -0
  241. package/skills/diagram-master/references/engines/excalidraw/element-templates.md +182 -0
  242. package/skills/diagram-master/references/engines/excalidraw/json-schema.md +71 -0
  243. package/skills/diagram-master/references/engines/excalidraw/render_excalidraw.py +189 -0
  244. package/skills/diagram-master/references/engines/excalidraw/render_template.html +57 -0
  245. package/skills/diagram-master/references/engines/matplotlib/matplotlib-patterns.md +235 -0
  246. package/skills/diagram-master/references/engines/matplotlib/render_matplotlib.py +184 -0
  247. package/skills/diagram-master/references/engines/mermaid/domain-templates.md +435 -0
  248. package/skills/diagram-master/references/engines/mermaid/render_mermaid.py +116 -0
  249. package/skills/diagram-master/references/engines/mermaid/syntax-reference.md +2247 -0
  250. package/skills/diagram-master/references/engines/nanobannana/render_nanobannana2.py +168 -0
  251. package/skills/diagram-master/references/engines/svg/color-palette.md +188 -0
  252. package/skills/diagram-master/references/engines/svg/html-base-template.html +332 -0
  253. package/skills/diagram-master/references/engines/svg/interactivity-patterns.md +435 -0
  254. package/skills/diagram-master/references/engines/svg/render_interactive_svg.py +212 -0
  255. package/skills/diagram-master/references/engines/svg/svg-element-templates.md +349 -0
  256. package/skills/diagram-master/references/examples/README.md +69 -0
  257. package/skills/diagram-master/references/examples/ref_grid_architecture.png +0 -0
  258. package/skills/diagram-master/references/examples/ref_layered_flow.png +0 -0
  259. package/skills/diagram-master/references/pyproject.toml +16 -0
  260. package/skills/diagram-master/references/quality-checklist.md +33 -0
  261. package/skills/diagram-master/references/routing-guide.md +164 -0
  262. package/skills/diagram-master/references/uv.lock +1356 -0
  263. package/skills/google-workspace/SKILL.md +33 -0
  264. package/skills/google-workspace/scripts/gws-safe.sh +177 -0
  265. package/skills/grill-me/SKILL.md +1 -1
  266. package/skills/lecture-note-digitizer/SKILL.md +926 -0
  267. package/skills/lecture-note-digitizer/references/convert_to_pdf.py +30 -0
  268. package/skills/lecture-note-digitizer/references/extract_slide_diagram.py +73 -0
  269. package/skills/lecture-note-digitizer/references/html-template.md +167 -0
  270. package/skills/lecture-note-digitizer/references/katex-style-guide.md +165 -0
  271. package/skills/omni-crawl/SKILL.md +21 -11
  272. package/skills/omni-crawl/scripts/main.ts +6 -6
  273. package/skills/omni-crawl/src/router.ts +3 -3
  274. package/skills/omni-digest/SKILL.md +17 -9
  275. package/skills/omni-digest/digest.md +2 -2
  276. package/skills/omni-digest/src/fetch.ts +30 -3
  277. package/skills/pitch-deck/SKILL.md +2 -2
  278. package/skills/pitch-deck/template.html +2 -2
  279. package/skills/youtube-master/SKILL.md +163 -0
  280. package/skills/youtube-master/package-lock.json +558 -0
  281. package/skills/youtube-master/package.json +13 -0
  282. package/skills/youtube-master/references/study-note-template.md +124 -0
  283. package/skills/youtube-master/scripts/main.ts +435 -0
  284. package/skills/youtube-master/scripts/transcribe-local.ts +24 -0
  285. package/skills/youtube-master/src/audio.ts +63 -0
  286. package/skills/youtube-master/src/domain-staging.ts +50 -0
  287. package/skills/youtube-master/src/env.ts +36 -0
  288. package/skills/youtube-master/src/obsidian.ts +155 -0
  289. package/skills/youtube-master/src/router.ts +110 -0
  290. package/skills/youtube-master/src/stt.ts +199 -0
  291. package/skills/youtube-master/src/study-note.ts +175 -0
  292. package/skills/youtube-master/src/summarize.ts +358 -0
  293. package/skills/youtube-master/src/transcript.ts +76 -0
  294. package/skills/youtube-master/src/types.ts +91 -0
  295. package/skills/youtube-master/src/util.ts +93 -0
  296. package/skills/youtube-master/src/youtube.ts +70 -0
  297. package/skills/youtube-master/tsconfig.json +13 -0
  298. package/src/acp/server.ts +5 -2
  299. package/src/agent-mission/driver.ts +80 -10
  300. package/src/agent-mission/pty-decision.ts +71 -0
  301. package/src/agent-mission/review-loop.ts +30 -0
  302. package/src/autopilot/build/llm-conflict-merge.ts +16 -3
  303. package/src/autopilot/tool-registry.ts +2 -0
  304. package/src/boot/daemon-prompt-turn.ts +5 -0
  305. package/src/boot/daemon-runtime.ts +9 -3
  306. package/src/boot/daemon-tools/web-search.ts +3 -0
  307. package/src/card-followup/core.ts +109 -0
  308. package/src/chat/index.ts +1 -0
  309. package/src/cli/drive-input-jail.ts +101 -0
  310. package/src/cli/hooks-cli.ts +17 -3
  311. package/src/cli/make-cli.ts +43 -0
  312. package/src/cli/persona-cli.ts +90 -4
  313. package/src/cli/plugin-cli.ts +31 -22
  314. package/src/cli/pod-cli.ts +19 -9
  315. package/src/cli/pr-cli.ts +51 -15
  316. package/src/cli/pty-drive-cli.ts +41 -7
  317. package/src/cli/pty-drive-verdict.ts +40 -0
  318. package/src/cli/release-cli.ts +17 -4
  319. package/src/cli/setup-cli.ts +43 -1
  320. package/src/cli/skills-cli.ts +17 -1
  321. package/src/context-bus/claude-hooks-install.ts +10 -0
  322. package/src/context-bus/context-now-surfaces.ts +48 -0
  323. package/src/context-bus/context-now.ts +104 -0
  324. package/src/context-bus/coord-events.ts +2 -2
  325. package/src/context-bus/external-events.ts +52 -0
  326. package/src/context-bus/long-term-memory.ts +108 -0
  327. package/src/dashboard/index.ts +9 -4
  328. package/src/dashboard/slash-runtime/dashboard-handlers.ts +7 -1
  329. package/src/decisions/decision-cards.ts +10 -3
  330. package/src/decisions/decision-ledger.ts +13 -5
  331. package/src/discord/sprint21-runtime.ts +5 -1
  332. package/src/discord-self-message.ts +32 -0
  333. package/src/discord-slash-wire.ts +5 -1
  334. package/src/discord.ts +17 -1
  335. package/src/domains/core-tools.ts +3 -2
  336. package/src/domains/outbound-alert.ts +6 -1
  337. package/src/domains/telegram-kind-route.ts +51 -13
  338. package/src/exec-requests/default-outputs.ts +25 -0
  339. package/src/exec-requests/planner.ts +10 -2
  340. package/src/exec-requests/runner.ts +20 -6
  341. package/src/exec-requests/store.ts +3 -0
  342. package/src/execution-loop/launch-gate.ts +100 -0
  343. package/src/field/field-reel.ts +5 -1
  344. package/src/field-note/index.ts +201 -0
  345. package/src/field-note/transcribe.ts +248 -0
  346. package/src/graph-kinds/registry.ts +3 -3
  347. package/src/graph-runner/graph-cli.ts +61 -1
  348. package/src/graph-runner/graph-grow-llm.ts +37 -0
  349. package/src/graph-runner/graph-grow.ts +47 -0
  350. package/src/graph-runner/runner.ts +317 -25
  351. package/src/grok/agent-search.ts +8 -2
  352. package/src/guardian/secret-exposure-scan.ts +101 -0
  353. package/src/harness/harness-cli-command.ts +247 -7
  354. package/src/harness/harness-pod-dispatch.ts +43 -23
  355. package/src/harness/harness-seams.ts +38 -4
  356. package/src/harness/harness-stop.ts +23 -4
  357. package/src/harness/launch-registry.ts +91 -0
  358. package/src/harness/process-garbage.ts +5 -3
  359. package/src/hooks/dispatch.ts +82 -0
  360. package/src/hooks/expose.ts +254 -0
  361. package/src/hooks/github-shadow.ts +108 -0
  362. package/src/hooks/providers.ts +71 -5
  363. package/src/hooks/queue.ts +1 -1
  364. package/src/hooks/receiver.ts +21 -20
  365. package/src/index.ts +52 -14
  366. package/src/intake-plane/categorize.ts +18 -46
  367. package/src/intake-plane/discord-seat-work.ts +10 -0
  368. package/src/intake-plane/front-route-classifier.ts +33 -39
  369. package/src/intake-plane/persona-answer.ts +30 -0
  370. package/src/intake-plane/runtime-callables.ts +8 -1
  371. package/src/intake-plane/telegram-seat-work.ts +36 -2
  372. package/src/intake-plane/wish-folder.ts +67 -0
  373. package/src/intent-gate/gate.ts +30 -10
  374. package/src/live/detail-switch.ts +5 -0
  375. package/src/llm/difficulty.ts +57 -0
  376. package/src/llm/judge-layer.ts +101 -0
  377. package/src/llm/mission-router.ts +33 -19
  378. package/src/loops/contract/examples/cmo-seat.loop.yaml +51 -0
  379. package/src/loops/contract/examples/orchestrator.loop.yaml +57 -0
  380. package/src/loops/contract/examples/steward.loop.yaml +50 -0
  381. package/src/loops/contract/loop-agent.schema.json +138 -0
  382. package/src/loops/contract/validate.ts +64 -0
  383. package/src/loops/registry.ts +20 -6
  384. package/src/market/signed-index.ts +4 -0
  385. package/src/maturity/bot-command-maturity.ts +45 -0
  386. package/src/maturity/feature-maturity.ts +26 -4
  387. package/src/model-tier/index.ts +2 -2
  388. package/src/model-tier/tier-resolver.ts +20 -20
  389. package/src/model-tier/types.ts +6 -6
  390. package/src/mss/logging/log-store.ts +15 -0
  391. package/src/nexus/api/config-model-tier.ts +5 -4
  392. package/src/nexus/api/fabric-plans.ts +53 -0
  393. package/src/nexus/api/harness-api.ts +5 -1
  394. package/src/nexus/api/health.ts +2 -0
  395. package/src/nexus/api/http-server.ts +36 -0
  396. package/src/nexus/api/inside-events.ts +226 -0
  397. package/src/nexus/api/meta-api.ts +21 -8
  398. package/src/nexus/api/missions.ts +6 -1
  399. package/src/nexus/api/ops-seats.ts +33 -0
  400. package/src/nexus/api/outputs-route.ts +44 -0
  401. package/src/nexus/api/seat-requests.ts +44 -2
  402. package/src/nexus/api/sessions-store.ts +17 -38
  403. package/src/nexus/api/sub-seat-charters.ts +34 -0
  404. package/src/nexus/api/tabs-mutations.ts +3 -1
  405. package/src/nexus/api/trace.ts +18 -6
  406. package/src/nexus/api/workflow-run-event-bridge.ts +1 -0
  407. package/src/nexus/api/workflows.ts +80 -6
  408. package/src/nexus/index.ts +2 -0
  409. package/src/nexus/kinds/webterm.ts +2 -1
  410. package/src/nexus/webterm/pty.ts +6 -2
  411. package/src/onboarding/cli-auth-status.ts +80 -0
  412. package/src/onboarding/voice-ai.ts +3 -3
  413. package/src/org/seat-budget.ts +48 -0
  414. package/src/org/stall-escalation.ts +63 -0
  415. package/src/outputs/ledger.ts +120 -0
  416. package/src/persona/persona-todo.ts +79 -0
  417. package/src/persona/presets.ts +116 -2
  418. package/src/persona/team-set.ts +155 -0
  419. package/src/plugins/install/plugin-install.ts +14 -0
  420. package/src/plugins/maker/market-bundle.ts +109 -0
  421. package/src/plugins/maker/plugin-maker.ts +254 -11
  422. package/src/plugins/maker/wizard-generate.ts +103 -0
  423. package/src/pod-lease/admission.ts +150 -0
  424. package/src/pod-lease/dependency-state.ts +85 -0
  425. package/src/pod-lease/host-lease.ts +127 -0
  426. package/src/project/project-suggestion.ts +16 -0
  427. package/src/project/session-context.ts +24 -0
  428. package/src/release-loop/checklist.ts +2 -2
  429. package/src/release-loop/feature-store.ts +5 -3
  430. package/src/release-loop/next-md-merge.ts +58 -0
  431. package/src/release-loop/release-note.ts +59 -4
  432. package/src/seat-dispatch/seat-ask.ts +130 -0
  433. package/src/seat-dispatch/seat-questions.ts +100 -0
  434. package/src/seat-loop/seat-loop.ts +548 -29
  435. package/src/seat-loop/seat-report.ts +37 -2
  436. package/src/self-dev/dev-cli.ts +4 -1
  437. package/src/self-dev/dev-pipeline.ts +37 -1
  438. package/src/self-dev/draft-sweep.ts +38 -33
  439. package/src/self-dev/draft-triage-rules.ts +8 -5
  440. package/src/self-dev/fabric-plan-core.ts +297 -0
  441. package/src/self-dev/orchestrate.ts +36 -4
  442. package/src/self-dev/release-path-guard.ts +62 -0
  443. package/src/self-dev/shard-aggregate.ts +230 -0
  444. package/src/self-dev/shard-placement.ts +60 -0
  445. package/src/self-dev/shard-plan.ts +48 -0
  446. package/src/self-dev/shard-pod-run.ts +77 -0
  447. package/src/self-dev/shard-run.ts +105 -0
  448. package/src/self-implement/gate-baseline.ts +1 -1
  449. package/src/self-implement/gate-cli.ts +40 -1
  450. package/src/self-implement/gate-scope.ts +37 -7
  451. package/src/self-implement/graph-variant.ts +171 -0
  452. package/src/self-implement/harness-policy-gates.ts +1 -1
  453. package/src/self-implement/headless-elanous-driver.ts +22 -3
  454. package/src/self-implement/host-regate.ts +22 -1
  455. package/src/self-implement/importer-test-index.ts +2 -1
  456. package/src/self-implement/l8-merge-queue.ts +130 -0
  457. package/src/self-implement/orchestrator.ts +242 -9
  458. package/src/self-implement/route-consumer-test-index.ts +122 -0
  459. package/src/self-implement/seams.ts +72 -11
  460. package/src/self-implement/test-seams.ts +1 -0
  461. package/src/self-implement/uncommitted-work.ts +59 -0
  462. package/src/session/index.ts +36 -13
  463. package/src/skills/gift-install.ts +215 -0
  464. package/src/skills/tools/web-search.ts +4 -1
  465. package/src/steward/launch.ts +42 -26
  466. package/src/steward/steward-cards.ts +17 -9
  467. package/src/steward/triage.ts +46 -14
  468. package/src/task-cards/card-cli.ts +25 -1
  469. package/src/task-orchestrator/mission.ts +5 -0
  470. package/src/task-orchestrator/store.ts +12 -3
  471. package/src/task-orchestrator/surfaces/pod-command-job.ts +29 -7
  472. package/src/task-orchestrator/surfaces/pod-lease.ts +156 -19
  473. package/src/task-orchestrator/surfaces/pod-pool.ts +127 -26
  474. package/src/task-orchestrator/surfaces/self-implement-pod.ts +214 -40
  475. package/src/task-orchestrator/surfaces/self-implement.ts +15 -2
  476. package/src/task-orchestrator/types.ts +2 -0
  477. package/src/telegram-card-followup.ts +16 -96
  478. package/src/telegram-commands.ts +10 -1
  479. package/src/telegram-project-command.ts +71 -0
  480. package/src/telegram-report.ts +21 -17
  481. package/src/telegram.ts +29 -3
  482. package/src/tool-runtime/self-cognition-runtimes.ts +13 -3
  483. package/src/user-config.ts +102 -20
  484. package/src/version/packed-revision.json +1 -1
  485. package/src/web-search/grok.ts +7 -1
  486. package/src/web-search/index.ts +28 -1
  487. package/src/web-search/provider.ts +4 -0
  488. package/src/web-search/x-intent.ts +5 -0
  489. package/src/workflow-runtime/executor.ts +277 -47
  490. package/src/workflow-runtime/index.ts +1 -0
  491. package/src/workflow-runtime/nodes/subworkflow.ts +60 -0
  492. package/src/workflow-runtime/plugin-kind-node.ts +1 -1
  493. package/src/workflow-runtime/schema.ts +79 -4
  494. package/src/workflow-runtime/types.ts +35 -4
  495. package/apps/pwa/out/_next/static/2DsiDfDCks44g1cPUMhiW/_buildManifest.js +0 -1
  496. package/apps/pwa/out/_next/static/chunks/1105-c473ed46272fba79.js +0 -1
  497. package/apps/pwa/out/_next/static/chunks/1377-1efeffbbac0963ff.js +0 -1
  498. package/apps/pwa/out/_next/static/chunks/1470.98a6ab61ccb4131c.js +0 -1
  499. package/apps/pwa/out/_next/static/chunks/216-5acd01cbde4acda7.js +0 -1
  500. package/apps/pwa/out/_next/static/chunks/2330-c2f07246c8788af1.js +0 -1
  501. package/apps/pwa/out/_next/static/chunks/2375-cb6debea56cce4fb.js +0 -1
  502. package/apps/pwa/out/_next/static/chunks/24-e6d28380efab7faf.js +0 -1
  503. package/apps/pwa/out/_next/static/chunks/2977-e38442e86289f1d3.js +0 -1
  504. package/apps/pwa/out/_next/static/chunks/2982-2a2df543be3d2e5a.js +0 -25
  505. package/apps/pwa/out/_next/static/chunks/3403.4bc97b4066945a94.js +0 -5
  506. package/apps/pwa/out/_next/static/chunks/3615-740dd270764ffa24.js +0 -1
  507. package/apps/pwa/out/_next/static/chunks/371-4ad6af55dad02ced.js +0 -1
  508. package/apps/pwa/out/_next/static/chunks/3734-1015fe991eb9b7e7.js +0 -1
  509. package/apps/pwa/out/_next/static/chunks/4114-3e63117452378807.js +0 -1
  510. package/apps/pwa/out/_next/static/chunks/5012-a7fe6f3c8b6fe45a.js +0 -1
  511. package/apps/pwa/out/_next/static/chunks/5609-012bb3557211f07e.js +0 -1
  512. package/apps/pwa/out/_next/static/chunks/5783-ef40ebfc91d55230.js +0 -1
  513. package/apps/pwa/out/_next/static/chunks/5791-bb82743fa6299562.js +0 -1
  514. package/apps/pwa/out/_next/static/chunks/62-ff227c3edb8b248b.js +0 -1
  515. package/apps/pwa/out/_next/static/chunks/6320-baac91d68843a9a6.js +0 -1
  516. package/apps/pwa/out/_next/static/chunks/6725-68ab7cc0b1faf00d.js +0 -1
  517. package/apps/pwa/out/_next/static/chunks/6998-a654fe5c58271600.js +0 -1
  518. package/apps/pwa/out/_next/static/chunks/7633-1b3709b0854c9412.js +0 -1
  519. package/apps/pwa/out/_next/static/chunks/7647.2fcd30d894d5ee30.js +0 -1
  520. package/apps/pwa/out/_next/static/chunks/7673-2eda1507d38dadb8.js +0 -1
  521. package/apps/pwa/out/_next/static/chunks/7951-8b03dbb10b24cd06.js +0 -1
  522. package/apps/pwa/out/_next/static/chunks/7990-e12efba616f46e03.js +0 -1
  523. package/apps/pwa/out/_next/static/chunks/8142-744998d65d7bb17e.js +0 -1
  524. package/apps/pwa/out/_next/static/chunks/8195-6fde3d7a39859206.js +0 -10
  525. package/apps/pwa/out/_next/static/chunks/8619-4365e03a2862830f.js +0 -1
  526. package/apps/pwa/out/_next/static/chunks/8894-b5fb36bab837cd29.js +0 -1
  527. package/apps/pwa/out/_next/static/chunks/920-f7dceb78f1c585ef.js +0 -1
  528. package/apps/pwa/out/_next/static/chunks/9454-84d0d5d77446bd92.js +0 -1
  529. package/apps/pwa/out/_next/static/chunks/9651-3cd291a6fa1370d2.js +0 -1
  530. package/apps/pwa/out/_next/static/chunks/988-5f92e7ab7ccea3dd.js +0 -1
  531. package/apps/pwa/out/_next/static/chunks/9989-5582582f06429840.js +0 -1
  532. package/apps/pwa/out/_next/static/chunks/ae787e4c-f2998de7f1ba72a4.js +0 -1
  533. package/apps/pwa/out/_next/static/chunks/app/_not-found/page-859cea1570b6227a.js +0 -1
  534. package/apps/pwa/out/_next/static/chunks/app/approvals/page-d2253d7e58ef1890.js +0 -1
  535. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-5441d4a9ab35e518.js +0 -1
  536. package/apps/pwa/out/_next/static/chunks/app/board/page-d9b12d680922d980.js +0 -1
  537. package/apps/pwa/out/_next/static/chunks/app/bots/page-e268d6d145827a22.js +0 -1
  538. package/apps/pwa/out/_next/static/chunks/app/chat/page-f8116559c7424da7.js +0 -1
  539. package/apps/pwa/out/_next/static/chunks/app/consult/page-1085399fd0f32112.js +0 -1
  540. package/apps/pwa/out/_next/static/chunks/app/control/page-1df686a14f65895a.js +0 -1
  541. package/apps/pwa/out/_next/static/chunks/app/design-check/page-54e1f966ab60a4dc.js +0 -1
  542. package/apps/pwa/out/_next/static/chunks/app/editor/page-7ed95f296f5ee8e9.js +0 -1
  543. package/apps/pwa/out/_next/static/chunks/app/exec/page-11edac668d77e5c3.js +0 -1
  544. package/apps/pwa/out/_next/static/chunks/app/field/page-59e2b9a22cd5a6d5.js +0 -1
  545. package/apps/pwa/out/_next/static/chunks/app/healthz/route-859cea1570b6227a.js +0 -1
  546. package/apps/pwa/out/_next/static/chunks/app/intake/page-2976df21ad74ab48.js +0 -1
  547. package/apps/pwa/out/_next/static/chunks/app/layout-34d211a67f16d510.js +0 -1
  548. package/apps/pwa/out/_next/static/chunks/app/live/page-8ff652d5d950639b.js +0 -1
  549. package/apps/pwa/out/_next/static/chunks/app/market/page-b31610deda76337b.js +0 -1
  550. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-6cb0e1bbefe5fb3d.js +0 -1
  551. package/apps/pwa/out/_next/static/chunks/app/morning/page-a286a152cf584576.js +0 -1
  552. package/apps/pwa/out/_next/static/chunks/app/not-found-d9237581e7003bcb.js +0 -1
  553. package/apps/pwa/out/_next/static/chunks/app/observatory/page-83274e761643fdd2.js +0 -1
  554. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-ceee6cfb1d4e6d68.js +0 -1
  555. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-9c9f8bb3e4a64091.js +0 -1
  556. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-c17217603ea3426a.js +0 -1
  557. package/apps/pwa/out/_next/static/chunks/app/page-efb6177cbf1e8a51.js +0 -1
  558. package/apps/pwa/out/_next/static/chunks/app/reflection/page-d307523703bc4df3.js +0 -1
  559. package/apps/pwa/out/_next/static/chunks/app/scheduler/page-462f4e4bab45ce7d.js +0 -1
  560. package/apps/pwa/out/_next/static/chunks/app/sessions/page-8990e96f33af3837.js +0 -1
  561. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-e168fa1030af0548.js +0 -1
  562. package/apps/pwa/out/_next/static/chunks/app/settings/page-1233e05a4068bc9c.js +0 -1
  563. package/apps/pwa/out/_next/static/chunks/app/setup/done/page-13a1840b1fac337a.js +0 -1
  564. package/apps/pwa/out/_next/static/chunks/app/setup/layout-859cea1570b6227a.js +0 -1
  565. package/apps/pwa/out/_next/static/chunks/app/setup/page-64a29fc80b11ab55.js +0 -1
  566. package/apps/pwa/out/_next/static/chunks/app/share/page-68e787339a16b3dc.js +0 -1
  567. package/apps/pwa/out/_next/static/chunks/app/showroom/page-4fddc90b23feb215.js +0 -1
  568. package/apps/pwa/out/_next/static/chunks/app/tasks/page-886ba8260dc79c79.js +0 -1
  569. package/apps/pwa/out/_next/static/chunks/app/term/page-0f26507a1722e40b.js +0 -1
  570. package/apps/pwa/out/_next/static/chunks/app/today/page-109d4ccd42259c9d.js +0 -1
  571. package/apps/pwa/out/_next/static/chunks/app/trace/page-f5c2a4e510726774.js +0 -1
  572. package/apps/pwa/out/_next/static/chunks/app/vault/page-b2e0039416f42522.js +0 -1
  573. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-26102fd7350f171e.js +0 -1
  574. package/apps/pwa/out/_next/static/chunks/app/workflows/page-708948bc8a802794.js +0 -1
  575. package/apps/pwa/out/_next/static/chunks/app/workspace/page-5e5611620f78fb0b.js +0 -1
  576. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-139ba5c367bbf60a.js +0 -1
  577. package/apps/pwa/out/_next/static/chunks/framework-ea806bb57f2b8923.js +0 -1
  578. package/apps/pwa/out/_next/static/chunks/main-8d2302399c2c8f87.js +0 -1
  579. package/apps/pwa/out/_next/static/chunks/main-app-202b4e81f33895ea.js +0 -1
  580. package/apps/pwa/out/_next/static/chunks/pages/_app-b10928c60f0b8488.js +0 -1
  581. package/apps/pwa/out/_next/static/chunks/pages/_error-689039227d443fab.js +0 -1
  582. package/apps/pwa/out/_next/static/chunks/webpack-e5bea36f183b25e6.js +0 -1
  583. package/apps/pwa/out/_next/static/css/43feca5fd387dcbd.css +0 -1
  584. /package/apps/pwa/out/_next/static/{2DsiDfDCks44g1cPUMhiW → Y4zKzL62sakG5momz3SoQ}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2922],{1355:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>l,f6:()=>n,oD:()=>a});let s="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(s,e),e):localStorage.getItem(s)}();if(e)return e;let t=n();return localStorage.setItem(s,t),t}function l(){let e=n();return localStorage.setItem(s,e),e}},10080:(e,t,r)=>{"use strict";r.d(t,{$:()=>o});var s=r(54456),n=r(80247),a=r(13680),l=r(74591);let i=(0,a.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:r="default",size:a="default",...o}=e;return(0,s.jsx)(n.$,{"data-slot":"button",className:(0,l.cn)(i({variant:r,size:a,className:t})),...o})}},36581:(e,t,r)=>{"use strict";r.d(t,{C:()=>d,DaemonProvider:()=>c,Q:()=>u});var s=r(54456),n=r(60500),a=r(86704),l=r(1355),i=r(39906),o=r(50733);let d=(0,n.createContext)(null);function c(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[c,u]=(0,n.useState)(r),[m,x]=(0,n.useState)(""),[p]=(0,n.useState)(()=>new i.ki(r));(0,n.useEffect)(()=>{let e=(0,a.Fp)();u(e),p.updateConfig(e),x((0,l.oD)()),(0,o.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();p.updateConfig(t),u(t),(0,o.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&x(t=>t===e.newValue?t:((0,o.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p]);let g=e=>{u(t=>{let r={...t,...e};return(0,a.Qc)(e),p.updateConfig(r),(0,o.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{x(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,o.cY)("webterm.provider.daemon.session-set",{sessionId:e})},f=(0,n.useMemo)(()=>({config:c,setConfig:g,client:p,sessionId:m,setSessionId:h}),[c,p,m]);return(0,s.jsx)(d.Provider,{value:f,children:t})}function u(){let e=(0,n.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},74591:(e,t,r)=>{"use strict";r.d(t,{cn:()=>a});var s=r(49454),n=r(79946);function a(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,s.$)(t))}},75820:(e,t,r)=>{"use strict";function s(e){let t=e.filter(e=>"cron"===e.kind&&e.id).map(e=>e.id);return t.length?"/scheduler?ids=".concat(t.map(encodeURIComponent).join(",")):null}r.d(t,{NE:()=>o,Yt:()=>i,on:()=>s});let n=["task","goal-loop","single-shot"],a=["scheduler","monitor-trigger"];function l(e){var t,r,s,l,i,o,d;let c=e.autopilot,u=null!=(t=null==c?void 0:c.executionModel)?t:null;return{id:e.id,goal:e.title||e.description||e.id,source:null!=(r=null==c?void 0:c.origin)?r:"human",status:null!=(s=null==c?void 0:c.apmStatus)?s:e.status,model:u,tier:null!=(l=null==c?void 0:c.tier)?l:null,engine:null!=(i=null==c?void 0:c.engine)?i:null,kind:(d=null!=(o=null==c?void 0:c.executionModel)?o:null)&&n.includes(d)?"finite":d&&a.includes(d)?"continuous":"other",reviewDue:!1,createdAt:new Date(e.createdAt).toISOString(),isAutopilot:null!=c,toxStatus:e.status,taskCount:e.taskCount,taskCounts:e.taskStatusCounts}}class i{async triagePreview(e,t){return this.client.fetchJson("/v1/autopilot/triage-preview",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({goal:e,...t?{category:t}:{}})})}async commitMission(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"intake",r=arguments.length>2?arguments[2]:void 0;return this.client.fetchJson("/v1/autopilot/triage-preview",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({goal:e,commit:!0,source:t,...r?{category:r}:{}})})}async missions(e,t){let r=new URLSearchParams({...e?{status:e}:{},...t?{source:t}:{}}).toString();return this.client.fetchJson("/v1/autopilot/missions".concat(r?"?".concat(r):""))}async missionsUnified(e){var t,r;let s=new URLSearchParams({...e?{status:e}:{}}).toString(),n=await this.client.fetchJson("/v1/missions".concat(s?"?".concat(s):"")),a=null!=(t=n.missions)?t:[];return{ok:!0,total:null!=(r=n.total)?r:a.length,missions:a.map(l)}}async trace(e){return this.client.fetchJson("/v1/autopilot/trace?id=".concat(encodeURIComponent(e)))}async missionArcMap(){var e,t,r;let s=await this.client.fetchJson("/v1/missions"),n=new Map;for(let a of null!=(e=s.missions)?e:[]){let e=null==(t=a.autopilot)?void 0:t.arcs;e&&e.length>0&&n.set(a.id,{apmStatus:null==(r=a.autopilot)?void 0:r.apmStatus,arcs:e})}return n}async missionAction(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.client.fetchJson("/v1/autopilot/mission-action",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,action:t,...r})})}async repoWatch(){return this.client.fetchJson("/v1/autopilot/repo-watch")}async autonomy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1?arguments[1]:void 0,r=new URLSearchParams({limit:String(e),...t?{loop:t}:{}});return this.client.fetchJson("/v1/autopilot/autonomy?".concat(r.toString()))}async arming(){return this.client.fetchJson("/v1/autopilot/arming")}constructor(e){this.client=e}}let o={task:{label:"작업 분해",tone:"bg-sky-500/15 text-sky-200 ring-sky-500/30"},"goal-loop":{label:"목표 루프",tone:"bg-violet-500/15 text-violet-200 ring-violet-500/30"},scheduler:{label:"스케줄러",tone:"bg-emerald-500/15 text-emerald-200 ring-emerald-500/30"},"monitor-trigger":{label:"감시 트리거",tone:"bg-amber-500/15 text-amber-200 ring-amber-500/30"},hybrid:{label:"하이브리드",tone:"bg-fuchsia-500/15 text-fuchsia-200 ring-fuchsia-500/30"},fanout:{label:"병렬 팬아웃",tone:"bg-cyan-500/15 text-cyan-200 ring-cyan-500/30"},"single-shot":{label:"즉답",tone:"bg-muted text-muted-foreground ring-border"},"hitl-delegate":{label:"HITL 위임",tone:"bg-rose-500/15 text-rose-200 ring-rose-500/30"}}},83750:(e,t,r)=>{"use strict";r.d(t,{r:()=>i});var s=r(54456),n=r(86048),a=r.n(n);let l=[{key:"autopilot",href:"/autopilot",num:"①",label:"미션",sub:"Autopilot"},{key:"tasks",href:"/tasks",num:"②",label:"작업",sub:"Tasks"},{key:"scheduler",href:"/scheduler",num:"③",label:"스케줄",sub:"Schedules"}];function i(e){let{active:t}=e;return(0,s.jsxs)("nav",{"aria-label":"Mission Fabric 파이프라인","data-testid":"fabric-stage-header",className:"flex flex-wrap items-center gap-1 text-xs",children:[(0,s.jsx)("span",{className:"mr-1 text-muted-foreground",children:"Missions"}),l.map((e,r)=>(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsxs)(a(),{href:e.href,"aria-current":e.key===t?"page":void 0,className:["rounded px-2 py-1 ring-1 transition-colors",e.key===t?"bg-primary/15 font-medium text-foreground ring-primary/40":"text-muted-foreground ring-border hover:bg-muted hover:text-foreground"].join(" "),children:[(0,s.jsx)("span",{className:"mr-1",children:e.num}),e.label,(0,s.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:e.sub})]}),r<l.length-1&&(0,s.jsx)("span",{className:"text-muted-foreground/50","aria-hidden":!0,children:"→"})]},e.key))]})}},89723:(e,t,r)=>{Promise.resolve().then(r.bind(r,93004))},93004:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>A});var s=r(54456),n=r(60500),a=r(36581),l=r(10080),i=r(71829);let o=["dig","backtest","trade","retro","replay"],d=[["replay","dig"],["dig","backtest"],["backtest","trade"],["trade","retro"],["retro","replay"]];function c(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let r=Math.max(0,Math.floor((Date.now()-t)/1e3));if(r<60)return"".concat(r,"s ago");let s=Math.floor(r/60);if(s<60)return"".concat(s,"m ago");let n=Math.floor(s/60);return n<24?"".concat(n,"h ago"):"".concat(Math.floor(n/24),"d ago")}function u(e){var t;let r=(null==(t=e.last)?void 0:t.at)?Date.parse(e.last.at):NaN;return!Number.isNaN(r)&&Date.now()-r<36e5}function m(){var e;let{client:t}=(0,a.Q)(),[r,m]=(0,n.useState)([]),[x,p]=(0,n.useState)(!1),[g,h]=(0,n.useState)(null),f=(0,n.useCallback)(async()=>{p(!0);try{var e,r;let s=await t.fetchJson("/v1/dashboard/loops");m(null!=(r=null==(e=s.loops)?void 0:e.loops)?r:[])}catch(e){i.oR.error("loops load failed: ".concat(e instanceof Error?e.message:e))}finally{p(!1)}},[t]);(0,n.useEffect)(()=>{f();let e=window.setInterval(()=>void f(),3e4);return()=>window.clearInterval(e)},[f]);let b=(0,n.useMemo)(()=>{let e=new Map;for(let t of r)e.set(t.name,t);return e},[r]),v=(0,n.useMemo)(()=>{let e=new Map;return o.forEach((t,r)=>e.set(t,function(e){let t=Math.PI/180*(-90+72*e);return{x:200+128*Math.cos(t),y:190+128*Math.sin(t)}}(r))),e},[]),y=g&&null!=(e=b.get(g))?e:null;return(0,s.jsxs)("div",{className:"mx-auto max-w-[1100px] space-y-4 p-4",children:[(0,s.jsxs)("header",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"투자 루프 오케스트라"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"5개 자율 루프의 순환(분석→백테→매매→회고→재생). 원 클릭 = 활동 기록 \xb7 펄스 = 최근 활동 \xb7 채움 = armed."})]}),(0,s.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>void f(),disabled:x,children:"Refresh"})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start",children:[(0,s.jsxs)("section",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("svg",{viewBox:"0 0 400 380",className:"w-full",role:"img","aria-label":"loop orchestra graph",children:[(0,s.jsx)("defs",{children:(0,s.jsx)("marker",{id:"loop-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,s.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-muted-foreground/50"})})}),d.map(e=>{let[t,r]=e,n=v.get(t),a=v.get(r);if(!n||!a)return null;let l=a.x-n.x,i=a.y-n.y,o=Math.hypot(l,i)||1,d=l/o,c=i/o,u=n.x+42*d,m=n.y+42*c,x=a.x-48*d,p=a.y-48*c;return(0,s.jsx)("line",{x1:u,y1:m,x2:x,y2:p,className:"stroke-muted-foreground/30",strokeWidth:1.5,markerEnd:"url(#loop-arrow)"},"".concat(t,"-").concat(r))}),o.map(e=>{var t,r,n,a;let l=b.get(e),i=v.get(e),o=!!l&&u(l),d=(null==l?void 0:l.armed)===!0,m=(null==l?void 0:l.category)!=="reflect",x=g===e;return(0,s.jsxs)("g",{className:"cursor-pointer",onClick:()=>h(t=>t===e?null:e),children:[o&&(0,s.jsxs)("circle",{cx:i.x,cy:i.y,r:40,className:m?"fill-sky-400/20":"fill-violet-400/20",children:[(0,s.jsx)("animate",{attributeName:"r",values:"".concat(40,";").concat(52),dur:"1.6s",repeatCount:"indefinite"}),(0,s.jsx)("animate",{attributeName:"opacity",values:"0.5;0",dur:"1.6s",repeatCount:"indefinite"})]}),(0,s.jsx)("circle",{cx:i.x,cy:i.y,r:40,className:"".concat(d?m?"fill-sky-500/25":"fill-violet-500/25":"fill-card"," ").concat(m?"stroke-sky-400":"stroke-violet-400"),strokeWidth:x?3.5:1.8}),(0,s.jsx)("text",{x:i.x,y:i.y-4,textAnchor:"middle",className:"fill-foreground text-[11px] font-medium",children:null!=(a=null==l||null==(r=l.label)||null==(t=r.split("(")[0])?void 0:t.trim())?a:e}),(0,s.jsx)("text",{x:i.x,y:i.y+10,textAnchor:"middle",className:"fill-muted-foreground text-[9px]",children:l?"".concat(c(null==(n=l.last)?void 0:n.at)):"—"}),(0,s.jsx)("text",{x:i.x,y:i.y+21,textAnchor:"middle",className:"fill-muted-foreground/70 text-[8px]",children:l?"today ".concat(l.today).concat(o?" \xb7 active":""):""})]},e)})]}),(0,s.jsxs)("div",{className:"flex flex-wrap justify-center gap-3 text-[11px] text-muted-foreground",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-sky-400"})," 실행축"]}),(0,s.jsxs)("span",{className:"flex items-center gap-1",children:[(0,s.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-violet-400"})," 사색축"]}),(0,s.jsx)("span",{children:"채움=armed \xb7 펄스=최근 활동"})]})]}),y&&(0,s.jsxs)("aside",{className:"w-full shrink-0 space-y-3 rounded-2xl border border-border bg-card p-4 lg:w-[360px]",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-base font-semibold",children:y.label}),(0,s.jsx)("button",{type:"button",onClick:()=>h(null),className:"rounded-md px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground","aria-label":"close",children:"✕"})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5 text-[11px]",children:[(0,s.jsx)("span",{className:"rounded-full px-2 py-0.5 ring-1 ".concat("reflect"===y.category?"text-violet-300 ring-violet-500/30":"text-sky-300 ring-sky-500/30"),children:"reflect"===y.category?"사색축":"실행축"}),(0,s.jsxs)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:["armed ",null===y.armed?"—":y.armed?"ON":"off"]}),(0,s.jsxs)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:["today ",y.today]}),u(y)&&(0,s.jsx)("span",{className:"rounded-full bg-emerald-500/15 px-2 py-0.5 text-emerald-300 ring-1 ring-emerald-500/30",children:"active"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("div",{className:"text-sm font-semibold",children:"활동 기록"}),y.recent&&y.recent.length>0?(0,s.jsx)("div",{className:"space-y-1.5",children:y.recent.map((e,t)=>(0,s.jsxs)("div",{className:"rounded-lg bg-muted/40 px-3 py-2 text-[11px]",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-medium text-foreground",children:e.status}),(0,s.jsx)("span",{className:"text-muted-foreground",title:e.at,children:c(e.at)})]}),e.detail&&(0,s.jsx)("div",{className:"mt-0.5 truncate text-muted-foreground",title:e.detail,children:e.detail})]},"".concat(e.at,"-").concat(t)))}):(0,s.jsx)("div",{className:"text-sm text-muted-foreground",children:"활동 기록 없음."})]})]})]})]})}function x(e){let{api:t}=e,[r,a]=(0,n.useState)([]),[i,o]=(0,n.useState)(!0),d=(0,n.useCallback)(async()=>{try{var e;let r=await t.repoWatch();a(null!=(e=r.repos)?e:[])}catch(e){}finally{o(!1)}},[t]);return((0,n.useEffect)(()=>{d()},[d]),i)?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}):(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"참조 에이전트 repo 감시 — 새 커밋을 흡수 후보로 분석(제안은 텔레그램 report\xb7크론 08:40\xb720:40)."}),(0,s.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>void d(),children:"새로고침"})]}),(0,s.jsx)("div",{className:"grid gap-3 sm:grid-cols-3",children:r.map(e=>(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-card/50 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"font-medium",children:e.key}),e.lastNew>0&&(0,s.jsxs)("span",{className:"rounded bg-amber-500/15 px-2 py-0.5 text-xs text-amber-300 ring-1 ring-amber-500/30",children:["새 ",e.lastNew]})]}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.repo}),(0,s.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.note}),(0,s.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs",children:[(0,s.jsx)("span",{className:"font-mono text-muted-foreground",children:e.lastSha?e.lastSha.slice(0,7):"—"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:function(e){if(!e)return"미감지";let t=Date.now()-Date.parse(e);if(Number.isNaN(t))return"—";let r=Math.round(t/6e4);if(r<60)return"".concat(r,"분 전");let s=Math.round(r/60);return s<24?"".concat(s,"시간 전"):"".concat(Math.round(s/24),"일 전")}(e.lastSeen)})]})]},e.repo))}),(0,s.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"흡수 채택 → PR 초안 + 빌드/테스트 증거는 P2(disarmed) \xb7 merge/재부팅은 대표 HITL."})]})}let p=["dig","backtest","trade","retro","replay","delegate","autopilot"],g={trade:"bg-rose-500/15 text-rose-300 ring-rose-500/30",dig:"bg-sky-500/15 text-sky-200 ring-sky-500/30",backtest:"bg-violet-500/15 text-violet-200 ring-violet-500/30",retro:"bg-amber-500/15 text-amber-200 ring-amber-500/30",replay:"bg-indigo-500/15 text-indigo-200 ring-indigo-500/30",delegate:"bg-emerald-500/15 text-emerald-200 ring-emerald-500/30",autopilot:"bg-fuchsia-500/15 text-fuchsia-200 ring-fuchsia-500/30"};function h(e){let{api:t}=e,[r,a]=(0,n.useState)([]),[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!0),u=(0,n.useCallback)(async()=>{c(!0);try{var e;let r=await t.autonomy(80,null!=i?i:void 0);a(null!=(e=r.actions)?e:[])}catch(e){}finally{c(!1)}},[t,i]);return(0,n.useEffect)(()=>{u()},[u]),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>o(null),className:["rounded px-2 py-0.5 text-xs ring-1",null===i?"bg-primary/20 text-foreground ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:"전체"}),p.map(e=>{var t;return(0,s.jsx)("button",{type:"button",onClick:()=>o(e),className:["rounded px-2 py-0.5 text-xs ring-1",i===e?null!=(t=g[e])?t:"bg-primary/20 ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:e},e)}),(0,s.jsx)(l.$,{size:"sm",variant:"outline",className:"ml-auto",onClick:()=>void u(),children:"새로고침"})]}),d?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}):0===r.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 기록된 자율행동이 없습니다. 자율루프가 돌면 여기에 “무엇을 왜 했나”가 쌓입니다."}):(0,s.jsx)("ul",{className:"space-y-2",children:r.map((e,t)=>{var r;return(0,s.jsxs)("li",{className:"rounded-lg border border-border bg-card/50 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:["rounded px-2 py-0.5 text-xs ring-1",null!=(r=g[e.loop])?r:"bg-muted text-muted-foreground ring-border"].join(" "),children:e.loop}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){try{return new Intl.DateTimeFormat("ko-KR",{timeZone:"Asia/Seoul",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(new Date(e))}catch(t){return e.slice(5,16)}}(e.ts)}),e.importance>=8&&(0,s.jsx)("span",{className:"rounded bg-rose-500/15 px-1.5 text-[10px] text-rose-300 ring-1 ring-rose-500/30",children:"중요"})]}),(0,s.jsx)("pre",{className:"mt-1.5 whitespace-pre-wrap font-sans text-sm text-foreground/90",children:e.text})]},"".concat(e.ts,"-").concat(t))})})]})}var f=r(86048),b=r.n(f),v=r(75820);let y={ok:{icon:"✅",tone:"text-emerald-300",label:"정상"},done:{icon:"✅",tone:"text-emerald-300",label:"완료"},stale:{icon:"⏰",tone:"text-amber-300",label:"밀림"},error:{icon:"❌",tone:"text-rose-400",label:"실패"},active:{icon:"\uD83D\uDD35",tone:"text-sky-300",label:"실행중"},pending:{icon:"⏳",tone:"text-muted-foreground",label:"대기"}},j={cron:"크론",task:"태스크",action:"자율행동"};function N(e){var t;let{counts:r,total:n}=e,a=Object.entries(null!=r?r:{}).filter(e=>{let[,t]=e;return t>0});if(!n||0===n)return(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"태스크 0"});let l=null!=(t=null==r?void 0:r.done)?t:0;return(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:["태스크 ",l,"/",n]}),a.map(e=>{let[t,r]=e;return(0,s.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[t,":",r]},t)})]})}function k(e){let{r:t}=e;if(!t||0===t.total)return(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"파생 0"});let r=(e,t)=>e>0?(0,s.jsxs)("span",{className:["text-xs",y[t].tone].join(" "),children:[y[t].icon,e]},t):null;return(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:["파생 ",t.total]}),r(t.ok,"ok"),r(t.stale,"stale"),r(t.error,"error"),r(t.active,"active"),r(t.pending,"pending")]})}function w(e){let{api:t,m:r,onDone:a}=e,i="scheduler"===r.model,o="task"===r.model,[d,c]=(0,n.useState)(""),[u,m]=(0,n.useState)(""),[x,p]=(0,n.useState)(""),[g,h]=(0,n.useState)(null),[f,b]=(0,n.useState)(null);if(!i&&!o)return(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["이 실행모델(",r.model,")은 지속 잡을 만들지 않아 구체화 대상이 아닙니다."]});let v=async e=>{h(e),b(null);let s=i?{command:d.trim(),...u.trim()?{cron:u.trim()}:{}}:{...x.trim()?{prompt:x.trim()}:{}};try{let l=await t.missionAction(r.id,e,s);if(l.error)b("오류: ".concat(l.error));else{var n;b("arm"===e?"승인\xb7arming ON 시 자동 실행":"구체화 완료(".concat(null!=(n=l.engine)?n:"",")")),a()}}catch(e){b(e instanceof Error?e.message:String(e))}finally{h(null)}};return(0,s.jsxs)("div",{className:"mt-3 space-y-2 rounded-md border border-border bg-background/50 p-2.5",children:[i&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{value:d,onChange:e=>c(e.target.value),placeholder:"실행할 명령 (예: scripts/foo.ts) — 필수",className:"w-full rounded border border-border bg-background px-2 py-1 text-xs"}),(0,s.jsx)("input",{value:u,onChange:e=>m(e.target.value),placeholder:"cron (선택 \xb7 비우면 골에서 추론)",className:"w-full rounded border border-border bg-background px-2 py-1 font-mono text-xs"})]}),o&&(0,s.jsx)("input",{value:x,onChange:e=>p(e.target.value),placeholder:"태스크 내용 (선택 \xb7 비우면 골 사용)",className:"w-full rounded border border-border bg-background px-2 py-1 text-xs"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.$,{size:"sm",disabled:!!g||i&&!d.trim(),onClick:()=>void v("materialize"),children:"materialize"===g?"…":"지금 구체화"}),(0,s.jsx)(l.$,{size:"sm",variant:"outline",disabled:!!g||i&&!d.trim(),onClick:()=>void v("arm"),children:"arm"===g?"…":"승인(arm)"}),f&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:f})]})]})}function S(e){let{api:t,m:r}=e,a=!1===r.isAutopilot,[i,o]=(0,n.useState)(!1),[d,c]=(0,n.useState)(null),[u,m]=(0,n.useState)(!1),x=r.model?v.NE[r.model]:null,p=(0,n.useCallback)(async()=>{m(!0);try{c(await t.trace(r.id))}catch(e){}finally{m(!1)}},[t,r.id]),[g,h]=(0,n.useState)(!1),[f,S]=(0,n.useState)(!1),[C,M]=(0,n.useState)(null),z=!a&&"proposed"===r.status,E=(0,n.useCallback)(async()=>{let e=!i;o(e),!e||d||a||await p()},[i,d,p,a]),I=(0,n.useCallback)(async()=>{h(!0),M(null);try{await t.missionAction(r.id,"cancel"),await p()}catch(e){}finally{h(!1)}},[t,r.id,p]),D=(0,n.useCallback)(async()=>{S(!0),M(null);try{var e;let s=await t.missionAction(r.id,"approve");s.error?M("오류: ".concat(s.error)):M("✅ 승인 — 태스크 ".concat(null!=(e=s.activated)?e:0,"건 실행 시작(ready). 미션 running.")),await p()}catch(e){M(e instanceof Error?e.message:String(e))}finally{S(!1)}},[t,r.id,p]);return(0,s.jsxs)("div",{className:"rounded-lg border border-border bg-card/50",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>void E(),className:"flex w-full items-start gap-3 p-3 text-left",children:[(0,s.jsx)("span",{className:"mt-0.5 text-muted-foreground",children:i?"▾":"▸"}),(0,s.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[a?(0,s.jsx)("span",{className:"rounded bg-slate-500/15 px-2 py-0.5 text-xs font-medium text-slate-300 ring-1 ring-slate-500/30",children:"사람 \xb7 intake"}):x&&(0,s.jsx)("span",{className:["rounded px-2 py-0.5 text-xs font-medium ring-1",x.tone].join(" "),children:x.label}),!a&&"continuous"===r.kind&&(0,s.jsx)("span",{className:"rounded bg-sky-500/15 px-1.5 py-0.5 text-[11px] text-sky-300 ring-1 ring-sky-500/30",children:"상시"}),!a&&"finite"===r.kind&&(0,s.jsx)("span",{className:"rounded bg-violet-500/15 px-1.5 py-0.5 text-[11px] text-violet-300 ring-1 ring-violet-500/30",children:"유한"}),(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground ring-1 ring-border",children:r.source}),z?(0,s.jsx)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[11px] font-medium text-amber-300 ring-1 ring-amber-500/40",children:"승인 대기"}):(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground ring-1 ring-border",children:r.status}),r.reviewDue&&(0,s.jsx)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[11px] text-amber-300 ring-1 ring-amber-500/30",children:"⚠ 30일+ 리뷰"}),a?(0,s.jsx)(N,{counts:r.taskCounts,total:r.taskCount}):(0,s.jsx)(k,{r:r.derived})]}),(0,s.jsx)("p",{className:"truncate text-sm text-foreground/90",children:r.goal}),(0,s.jsx)("p",{className:"font-mono text-[10px] text-muted-foreground",children:r.id})]})]}),i&&a&&(0,s.jsxs)("div",{className:"border-t border-border px-4 py-3 space-y-2",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"사람이 Intake 로 만든 미션입니다. 실행은 Task 보드에서 진행됩니다."}),(0,s.jsx)(N,{counts:r.taskCounts,total:r.taskCount}),(0,s.jsx)(b(),{href:"/tasks",className:"inline-block text-xs text-primary hover:underline",children:"② 작업 보드에서 보기 →"})]}),i&&!a&&(0,s.jsxs)("div",{className:"border-t border-border px-4 py-3",children:[z&&(0,s.jsxs)("div",{className:"mb-3 space-y-2 rounded-md border border-amber-500/30 bg-amber-500/5 p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-amber-200",children:"자동 분해 완료 \xb7 승인 대기"}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["골을 태스크로 자동 구체화했습니다(아직 ",(0,s.jsx)("b",{children:"실행 안 함"}),"). 승인하면 실행이 시작됩니다.","scheduler"===r.model&&" 반복 스케줄은 승인 후 배선됩니다."]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.$,{size:"sm",disabled:f||g,onClick:()=>void D(),children:f?"승인 중…":"✅ 승인(실행 시작)"}),(0,s.jsx)(l.$,{size:"sm",variant:"ghost",disabled:f||g,onClick:()=>void I(),className:"text-rose-400 hover:text-rose-300",children:g?"거절 중…":"거절"}),C&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:C})]})]}),u&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"계보 조회 중…"}),d&&0===d.derived.length&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:d.note}),d&&(0,v.on)(d.derived)&&(0,s.jsxs)(b(),{href:(0,v.on)(d.derived),className:"mb-2 inline-block text-xs text-primary hover:underline","data-mission-schedules":!0,children:["이 미션을 부르는 스케줄 ",d.derived.filter(e=>"cron"===e.kind&&e.id).length," →"]}),d&&d.derived.length>0&&(0,s.jsx)("ul",{className:"space-y-1.5",children:d.derived.map((e,t)=>{let r=y[e.status];return(0,s.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,s.jsx)("span",{className:r.tone,children:r.icon}),(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground ring-1 ring-border",children:j[e.kind]}),(0,s.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,s.jsx)("span",{className:"text-foreground/90",children:e.name}),e.detail&&(0,s.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:e.detail})]})]},t)})}),d&&"done"!==r.status&&"proposed"!==r.status&&(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)(l.$,{size:"sm",variant:"ghost",disabled:g,onClick:()=>void I(),className:"text-rose-400 hover:text-rose-300",children:g?"종료 중…":"미션 종료(파생 잡 release)"}),"continuous"===r.kind&&(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"상시 미션 — 종료 전까지 계속 실행"})]}),d&&!z&&(0,s.jsx)(w,{api:t,m:r,onDone:()=>void p()})]})]})}function C(e){let{api:t,onCommitted:r}=e,[a,i]=(0,n.useState)(""),[o,d]=(0,n.useState)(null),[c,u]=(0,n.useState)(!1),[m,x]=(0,n.useState)(!1),[p,g]=(0,n.useState)(null),h=(0,n.useCallback)(async()=>{let e=a.trim();if(e){u(!0),g(null);try{d((await t.triagePreview(e)).triage)}catch(e){g(e instanceof Error?e.message:String(e))}finally{u(!1)}}},[t,a]),f=(0,n.useCallback)(async()=>{let e=a.trim();if(e){x(!0),g(null);try{(await t.commitMission(e,"intake")).missionId?(i(""),d(null),r()):g("미션 생성 실패")}catch(e){g(e instanceof Error?e.message:String(e))}finally{x(!1)}}},[t,a,r]),b=o?v.NE[o.executionModel]:null;return(0,s.jsxs)("div",{className:"space-y-2 rounded-lg border border-border bg-card/40 p-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-sm font-medium",children:["골 던지기 ",(0,s.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:"— 소망을 말하면 미션이 됩니다"})]}),(0,s.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"텔레그램에선 “미션:” 마커로"})]}),(0,s.jsx)("textarea",{value:a,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&h()},placeholder:"예: 삼성전자 급락하면 매매 검토 / 이 주제 끝까지 파봐 / 매일 아침 반도체 뉴스 정리",className:"min-h-[60px] w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(l.$,{onClick:()=>void h(),disabled:c||!a.trim(),size:"sm",variant:"outline",children:c?"분류 중…":"Triage (⌘↵)"}),(0,s.jsx)(l.$,{onClick:()=>void f(),disabled:m||!a.trim(),size:"sm",children:m?"커밋 중…":"미션 커밋 →"}),o&&b&&(0,s.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,s.jsx)("span",{className:["rounded px-2 py-0.5 ring-1",b.tone].join(" "),children:b.label}),(0,s.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-muted-foreground ring-1 ring-border",children:"heavy"===o.tier?"무거움":"가벼움"}),(0,s.jsx)("span",{className:"text-muted-foreground",children:o.rationale})]}),p&&(0,s.jsx)("span",{className:"text-xs text-rose-400",children:p})]})]})}function M(e){var t,r;let{api:a}=e,[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(null),[u,m]=(0,n.useState)(!1),x=(0,n.useCallback)(async()=>{m(!0),c(null);try{let e=[...(await a.missionsUnified()).missions].sort((e,t)=>e.createdAt<t.createdAt?1:-1);o(e)}catch(e){c(e instanceof Error?e.message:String(e))}finally{m(!1)}},[a]);(0,n.useEffect)(()=>{x()},[x]);let p=null!=(t=null==i?void 0:i.filter(e=>e.isAutopilot).length)?t:0,g=(null!=(r=null==i?void 0:i.length)?r:0)-p;return(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["모든 미션(사람 intake + 자율)의 계보\xb7실행 상태.",i&&(0,s.jsxs)("span",{className:"ml-1 text-[11px]",children:["자율 ",p," \xb7 사람 ",g]})]}),(0,s.jsx)(l.$,{onClick:()=>void x(),disabled:u,size:"sm",variant:"outline",children:u?"…":"새로고침"})]}),(0,s.jsx)(C,{api:a,onCommitted:()=>void x()}),d&&(0,s.jsx)("p",{className:"text-xs text-rose-400",children:d}),i&&0===i.length&&(0,s.jsx)("p",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"아직 미션이 없습니다. 아래 “골 던지기”로 자율 미션을 만들거나, Intake 에서 메모를 포착하세요."}),i&&i.length>0&&(0,s.jsx)("div",{className:"space-y-2",children:i.map(e=>(0,s.jsx)(S,{api:a,m:e},e.id))})]})}var z=r(83750);let E=[{id:"missions",label:"Missions"},{id:"repo",label:"Repo Watch"},{id:"autonomy",label:"자율행동"},{id:"loops",label:"루프 오케스트라"}];function I(e){var t;let{arming:r}=e;if(!r)return null;let n=(e,t)=>(0,s.jsxs)("span",{className:["rounded px-2 py-0.5 text-xs ring-1",e?"bg-emerald-500/15 text-emerald-300 ring-emerald-500/30":"bg-muted text-muted-foreground ring-border"].join(" "),children:[t," ",e?"ON":"OFF"]});return(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)("span",{children:"자율 경계:"}),n(r.absorb,"흡수 PR초안(".concat(r.absorbBackend,")")),n(r.merge,"mandate merge"),n(r.reboot,"재부팅"),n(null!=(t=r.materialize)&&t,"자율 구체화"),(0,s.jsx)("span",{className:"text-[11px]",children:"\xb7 재부팅은 항상 HITL \xb7 기본 disarmed(fail-closed)"})]})}function D(){let{client:e}=(0,a.Q)(),t=(0,n.useMemo)(()=>new v.Yt(e),[e]),[r,l]=(0,n.useState)("missions"),[i,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{let e=!0;return t.arming().then(t=>{e&&o(t.arming)}).catch(()=>{}),()=>{e=!1}},[t]),(0,s.jsxs)("div",{className:"mx-auto max-w-[1400px] px-4 pt-4",children:[(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsx)(z.r,{active:"autopilot"})}),(0,s.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,s.jsxs)("h1",{className:"text-lg font-semibold",children:["Missions ",(0,s.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:"미션 지휘 센터 \xb7 Autopilot"})]}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"미션(사람 + 자율)의 계보\xb7상태\xb7자율행동. 아래 “골 던지기” 또는 텔레그램 “미션:” 마커로 소망을 던지면 미션이 됩니다."}),(0,s.jsx)(I,{arming:i})]}),(0,s.jsx)("div",{className:"flex gap-1 border-b border-border",children:E.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>l(e.id),className:["-mb-px border-b-2 px-4 py-2 text-sm font-medium transition-colors",r===e.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"].join(" "),children:e.label},e.id))}),(0,s.jsxs)("div",{className:"py-4",children:["missions"===r&&(0,s.jsx)(M,{api:t}),"repo"===r&&(0,s.jsx)(x,{api:t}),"autonomy"===r&&(0,s.jsx)(h,{api:t}),"loops"===r&&(0,s.jsx)(m,{})]})]})}function A(){return(0,s.jsx)(D,{})}}},e=>{e.O(0,[7777,3278,1829,6048,9906,6390,3170,7358],()=>e(e.s=89723)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7081],{1355:(e,t,n)=>{"use strict";n.d(t,{Zr:()=>l,f6:()=>a,oD:()=>s});let r="elanous.daemon.sessionId";function a(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function s(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(r,e),e):localStorage.getItem(r)}();if(e)return e;let t=a();return localStorage.setItem(r,t),t}function l(){let e=a();return localStorage.setItem(r,e),e}},36581:(e,t,n)=>{"use strict";n.d(t,{C:()=>c,DaemonProvider:()=>d,Q:()=>u});var r=n(54456),a=n(60500),s=n(86704),l=n(1355),o=n(39906),i=n(50733);let c=(0,a.createContext)(null);function d(e){let{children:t}=e,n={baseUrl:"",token:"",provider:""},[d,u]=(0,a.useState)(n),[m,f]=(0,a.useState)(""),[p]=(0,a.useState)(()=>new o.ki(n));(0,a.useEffect)(()=>{let e=(0,s.Fp)();u(e),p.updateConfig(e),f((0,l.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,a.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();p.updateConfig(t),u(t),(0,i.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&f(t=>t===e.newValue?t:((0,i.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p]);let g=e=>{u(t=>{let n={...t,...e};return(0,s.Qc)(e),p.updateConfig(n),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),n})},h=e=>{f(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},x=(0,a.useMemo)(()=>({config:d,setConfig:g,client:p,sessionId:m,setSessionId:h}),[d,p,m]);return(0,r.jsx)(c.Provider,{value:x,children:t})}function u(){let e=(0,a.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},48346:(e,t,n)=>{Promise.resolve().then(n.bind(n,63563))},50738:(e,t,n)=>{"use strict";n.d(t,{Er:()=>a,cj:()=>c,dc:()=>l,yR:()=>i});let r=/^(oauth\.|harness\.decision|llm\.router)/;function a(e){let t=[],n=e=>{"string"==typeof e&&e.trim()&&!t.includes(e.trim())&&t.push(e.trim())};for(let t of e){var a;let e=null!=(a=t.data)?a:{};if(t.category.startsWith("oauth.")){for(let t of["from","to","name","account"])n(e[t]);if(Array.isArray(e.usage))for(let t of e.usage)n(null==t?void 0:t.name);continue}if(r.test(t.category))for(let t of(n(e.account),["what","why","reason"])){let r=e[t];if("string"==typeof r)for(let e of r.matchAll(/계정\s+([A-Za-z0-9][\w.-]*)/g))n(e[1])}}return t}function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Map(e.map((e,t)=>[e,"account-".concat(t+1)])),n=e.length?RegExp("(^|[^\\w-])(".concat(e.map(s).sort((e,t)=>t.length-e.length).join("|"),")(?![\\w-])"),"g"):null,r=new Map;return(e,a)=>{let s=e.replace(/\b[a-z0-9-]+\.tail[0-9a-f]+\.ts\.net\b/gi,"tailnet-host").replace(/\bmsb\d+\b/gi,e=>(e=>{let t=e.toLowerCase();r.has(t)||r.set(t,"remote-".concat(r.size+1));let n=r.get(t);return e===e.toUpperCase()?n.toUpperCase():n})(e)).replace(/\bmbp\b/gi,e=>e===e.toUpperCase()?"LOCAL":"local").replace(/\/Users\/[^/\s"']+/g,"~").replace(/(크레딧|credits?|💳)(\s*[:=]?\s*)[\d][\d,.]*/gi,"$1$2•••").replace(/[\d][\d,.]*(\s*)(크레딧|credits?)/gi,"•••$1$2").replace(/\$\s?[\d][\d,.]*/g,"$•••").replace(/(잔량?|remaining|left)(\s*[:=]?\s*)(?:[A-Za-z0-9][\w.-]*\s+)?\d+(?:\.\d+)?\s?%/gi,"$1$2•••");return a&&n&&(s=s.replace(n,(e,n,r)=>{var a;return"".concat(n).concat(null!=(a=t.get(r))?a:"account")})),s}}function o(e,t){if("string"==typeof e)return t(e);if(Array.isArray(e))return e.map(e=>o(e,t));if(e&&"object"==typeof e){let n={};for(let[r,a]of Object.entries(e))"apiEquivalentUsd"===r||"usd"===r||/credit(s|Balance)?$/i.test(r)||(n[r]=o(a,t));return n}return e}function i(e){let t=l(a(e));return e.map(e=>{let n=r.test(e.category);return{...e,event:t(e.event,!1),data:e.data?o(e.data,e=>t(e,n)):e.data}})}function c(e,t){let n=l(t);return o(e,e=>n(e,!0))}},63563:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>y});var r=n(54456),a=n(50738),s=n(60500),l=n(36581);function o(e){var t;for(let t of[e.sections.triage,e.sections.intake]){let e=null==t?void 0:t.data.title;if("string"==typeof e&&e.trim())return e.trim()}return(null==(t=e.apiTitle)?void 0:t.trim())||e.taskId}var i=n(23869);let c=["intake","triage","gates","relations","memory","workspace","run","landing","release"];function d(e){return null==e?"—":"string"==typeof e?e:JSON.stringify(e)}function u(e){let{entry:t}=e;return(0,r.jsxs)("details",{className:"mt-2 text-xs",children:[(0,r.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"JSON"}),(0,r.jsx)("pre",{className:"mt-2 max-h-64 overflow-auto rounded-lg bg-muted p-2 text-xs whitespace-pre-wrap break-all",children:JSON.stringify(t.data,null,2)})]})}function m(e){let{entry:t}=e,n=new Date(t.ts).toISOString();return(0,r.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,r.jsxs)("span",{children:["Owner: ",t.owner]}),(0,r.jsx)("time",{dateTime:n,children:n})]})}function f(e){var t;let{card:n}=e,a=null==(t=n.sections.gates)?void 0:t.data;return(0,r.jsxs)("section",{"aria-label":"Task card detail",className:"min-w-0 space-y-4 rounded-2xl border border-border bg-card p-4",children:[(0,r.jsxs)("header",{children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:o(n)}),(0,r.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:n.taskId})]}),a&&(0,r.jsxs)("p",{className:"overflow-x-auto whitespace-nowrap text-sm","aria-label":"Gate decisions",children:["Gate \xb7 budget: ",d(a.budget)," \xb7 location: ",d(a.location)]}),c.map(e=>{let t=n.sections[e];return t?(0,r.jsxs)("section",{"aria-label":"".concat(e," section"),className:"rounded-xl border border-border p-3",children:[(0,r.jsx)("h3",{className:"mb-1 text-sm font-semibold capitalize",children:e}),(0,r.jsx)(m,{entry:t}),(0,r.jsx)(u,{entry:t})]},e):null}),(0,r.jsxs)("section",{"aria-label":"Incidents",className:"space-y-2",children:[(0,r.jsxs)("h3",{className:"text-sm font-semibold",children:["Incidents (",n.incidents.length,")"]}),n.incidents.length?(0,r.jsx)("ol",{className:"space-y-2",children:n.incidents.map(e=>(0,r.jsxs)("li",{className:"rounded-xl border border-border p-3",children:[(0,r.jsx)(m,{entry:e}),(0,r.jsx)(u,{entry:e})]},e.key))}):(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"No incidents."})]})]})}let p=["steward","execution","landing","release","done"],g=new Set(["intake","triage","gates","relations","memory","workspace","run","landing","release","incidents"]);function h(e){let t=[],n=Date.parse(e.createdAt);for(let r of e.sections){let a;if(!g.has(r.key))continue;try{let e=JSON.parse(r.content);a=e&&"object"==typeof e&&!Array.isArray(e)?e:{content:r.content}}catch(e){a={content:r.content}}let s=Date.parse(r.createdAt);t.push({taskId:e.id,section:r.key,key:"".concat(r.key,":").concat(r.createdAt,":").concat(t.length),owner:r.owner,ts:Number.isFinite(s)?s:n,data:a,..."string"==typeof a.runId?{runId:a.runId}:{}})}if(0===t.length&&t.push({taskId:e.id,section:"triage",key:"api:title",owner:"task-card API",ts:n,data:{title:e.title}}),"closed"===e.status){let r=t.filter(e=>"release"===e.section).sort((e,t)=>t.ts-e.ts)[0];t.push({taskId:e.id,section:"release",key:"api:closed",owner:"task-card API",ts:Math.max(n,...t.map(e=>e.ts)),data:{...null==r?void 0:r.data,status:"done"}})}return{...function(e){let t,n=e[0];if(!n)return null;let r={},a=[],s=new Set,l=n.ts,o=-1/0;for(let i of e)if(!(i.taskId!==n.taskId||s.has(i.key)))if(s.add(i.key),l=Math.max(l,i.ts),i.runId&&i.ts>=o&&(t=i.runId,o=i.ts),"incidents"===i.section)a.push(i);else{let e=r[i.section];(!e||i.ts>=e.ts)&&(r[i.section]=i)}return{taskId:n.taskId,sections:r,incidents:a,updatedAt:l,...t?{runId:t}:{}}}(t),apiTitle:e.title}}function x(e){let{cards:t,selectedId:n,onSelect:a,selectedCard:s,detailError:l}=e,i=(null==s?void 0:s.taskId)===n?s:null;return(0,r.jsxs)("div",{className:"space-y-4 p-4",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold",children:"보드"}),(0,r.jsx)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:p.map(e=>(0,r.jsxs)("section",{"aria-label":"".concat(e," column"),className:"min-w-0 space-y-2 rounded-xl border border-border p-3",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold capitalize",children:e}),t.filter(t=>(function(e){var t;let n=null==(t=e.sections.release)?void 0:t.data;return(null==n?void 0:n.status)==="done"||(null==n?void 0:n.status)==="completed"?"done":n?"release":e.sections.landing?"landing":e.sections.run||e.sections.workspace||e.sections.gates||e.sections.relations||e.sections.memory?"execution":"steward"})(t)===e).map(e=>{var t,s;return(0,r.jsxs)("button",{type:"button",onClick:()=>a(e.taskId),"aria-pressed":n===e.taskId,className:"w-full rounded-lg border border-border bg-card p-3 text-left text-sm hover:bg-accent/40",children:[(0,r.jsx)("span",{className:"block font-medium",children:o(e)}),(0,r.jsx)("span",{className:"block text-xs text-muted-foreground",children:(0,r.jsx)("time",{dateTime:new Date(e.updatedAt).toISOString(),title:new Date(e.updatedAt).toLocaleString(),children:(t=function(e){let t=new Map;for(let r of e.incidents){var n;let e=null!=(n=r.data.incidentId)?n:r.data.id,a="string"==typeof e&&e.trim()?e:r.key,s=t.get(a);(!s||r.ts>=s.ts)&&t.set(a,r)}return Array.from(t.values()).filter(e=>"closed"!==e.data.status&&"resolved"!==e.data.status).length}(e),s=Date.now(),[...t>0?["사고 ".concat(t)]:[],...e.runId?["런 ".concat(e.runId.replace(/^run-/,"").slice(0,8))]:[],function(e,t,n){let r=Math.floor((t-e)/6e4);if(!Number.isFinite(r)||r<1)return"방금";if(r<60)return"".concat(r,"분 전");if(r<1440)return"".concat(Math.floor(r/60),"시간 전");let a=new Intl.DateTimeFormat("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1,...n?{timeZone:n}:{}}).formatToParts(new Date(e)),s=e=>{var t,n;return null!=(n=null==(t=a.find(t=>t.type===e))?void 0:t.value)?n:""};return"".concat(s("month"),"/").concat(s("day")," ").concat(s("hour"),":").concat(s("minute"))}(e.updatedAt,s,void 0)]).join(" \xb7 ")})})]},e.taskId)})]},e))}),n&&(0,r.jsxs)("aside",{className:"max-w-3xl space-y-2","aria-label":"Selected card",children:[(0,r.jsx)("button",{type:"button",onClick:()=>a(null),"aria-label":"Close card detail",className:"text-sm text-muted-foreground",children:"Close"}),i?(0,r.jsx)(f,{card:i}):(0,r.jsx)("p",{role:"status",children:null!=l?l:"Loading card detail…"})]})]})}function b(){let{config:e}=(0,l.Q)(),t=(0,s.useMemo)(()=>e.baseUrl?(0,i.xX)({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}):null,[e.baseUrl,e.token]),[n,o]=(0,s.useState)([]),[c,d]=(0,s.useState)(null),[u,m]=(0,s.useState)(null),[f,p]=(0,s.useState)(null),[g,b]=(0,s.useState)(null),[y,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{"public"===new URLSearchParams(window.location.search).get("capture")&&k(!0)},[]);let w=(0,s.useMemo)(()=>y?n.map(e=>({...(0,a.cj)(e,[]),taskId:e.taskId})):n,[n,y]);return(0,s.useEffect)(()=>{let e=!1;if(o([]),d(null),m(null),p(null),!t)return void b("Connect to NEXUS to load task cards.");b(null);let n=()=>t.getTaskCards().then(t=>{let{cards:n}=t;e||(o(n.map(h)),b(null))}).catch(t=>{e||b(t instanceof i.Iu&&404===t.status?"Task cards are not available yet (pre-E1).":t instanceof Error?t.message:String(t))});n();let r=setInterval(()=>{n()},1e4);return()=>{e=!0,clearInterval(r)}},[t]),(0,s.useEffect)(()=>{if(!t||!c)return;let e=!1;return m(null),p(null),t.getTaskCard(c).then(t=>{let{card:n}=t;e||m(h(n))}).catch(t=>{e||p(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[t,c]),(0,r.jsxs)(r.Fragment,{children:[g&&(0,r.jsx)("p",{role:"status",className:"p-4 text-sm text-muted-foreground",children:g}),(0,r.jsx)(x,{cards:w,selectedId:c,selectedCard:u,detailError:f,onSelect:e=>{(null===e||c!==e)&&(m(null),p(null),d(e))}})]})}function y(){return(0,r.jsx)(b,{})}}},e=>{e.O(0,[9906,3869,6390,3170,7358],()=>e(e.s=48346)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{25736:(e,t,s)=>{Promise.resolve().then(s.bind(s,74715))},74715:(e,t,s)=>{"use strict";s.d(t,{BotlabPageContent:()=>h});var r,l=s(41121),a=s(91269);let o=(null!=(r=s(11518).env.NEXT_PUBLIC_ELANOUS_BOTLAB_HOST)?r:"").trim(),n="elanous.botlab.wallHost",d=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;function i(e){return e.length>0&&e.length<=253&&d.test(e)}function c(e){var t;let{search:s,remembered:r=null}=e,d=(0,a.useMemo)(()=>(function(e){var t,s;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=null;try{l=new URLSearchParams(e).get("host")}catch(e){l=null}let a=null!=(t=null==l?void 0:l.trim())?t:"";if(""!==a&&i(a))return{host:a,source:"query",rejected:null};let n=""===a?null:a,d=null!=(s=null==r?void 0:r.trim())?s:"";return""!==d&&i(d)?{host:d,source:"remembered",rejected:n}:""!==o&&i(o)?{host:o,source:"default",rejected:n}:{host:"",source:"unset",rejected:n}})(s,r),[s,r]),c="unset"===d.source?null:(t=d.host,"https://".concat(t).concat("/bot3/bot-wall.html"));return(0,a.useEffect)(()=>{if("query"===d.source)try{window.localStorage.setItem(n,d.host)}catch(e){}},[d.source,d.host]),(0,l.jsxs)("main",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-10 sm:px-10","data-testid":"botlab-panel",children:[(0,l.jsxs)("header",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Bot screens"}),(0,l.jsx)("h1",{className:"mt-2 text-3xl font-bold",children:"Botlab"}),(0,l.jsxs)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:["Live noVNC screens for the bots, served through Tailscale. One document holds all four sessions, so the VNC password is asked ",(0,l.jsx)("strong",{children:"once"}),", not four times."]}),(0,l.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"View-only by default. This surface cannot send commands or control the bots."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-4","aria-label":"Wall address",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Wall address"}),(0,l.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground","data-testid":"botlab-wall-url",children:null!=c?c:"(no host configured)"}),(0,l.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"botlab-host-source",children:"query"===d.source?"Host came from the ?host= query parameter (remembered on this device).":"remembered"===d.source?"Host is the one remembered on this device; override it with ?host=<tailnet-name>.":"default"===d.source?"Host is the build default (NEXT_PUBLIC_ELANOUS_BOTLAB_HOST); override it with ?host=<tailnet-name>.":"No wall host is configured. Open this page once with ?host=<the VM tailnet name> — it is remembered on this device."}),null!==d.rejected&&(0,l.jsxs)("p",{role:"alert",className:"mt-2 text-xs text-destructive","data-testid":"botlab-host-rejected",children:["Ignored ?host=",d.rejected," — not a valid hostname."]}),null!==c&&(0,l.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground",children:[(0,l.jsx)("a",{className:"underline",href:c,target:"_blank",rel:"noreferrer","data-testid":"botlab-open-tab",children:"Open the wall in a new tab"})," — ","use this if the embedded frame stays blank."]})]}),null!==c&&(0,l.jsx)("section",{"aria-label":"Bot screen wall",children:(0,l.jsx)("iframe",{src:c,title:"Bot screen wall","data-testid":"botlab-wall-frame",className:"h-[70vh] w-full rounded-xl border border-border bg-background"})}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5","aria-label":"If the wall is blank",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"If the wall stays blank"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"A blank frame is not necessarily a broken bot. There are three separate reasons, with different fixes:"}),(0,l.jsxs)("ol",{className:"mt-3 list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"This device is outside the tailnet."})," The address simply does not exist here. Join the tailnet, or view the screens from a device that is on it."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Tailscale serve is not published."})," Re-run"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"bash scripts/botlab/deploy-bot-wall.sh"}),", which re-publishes the paths and then verifies each one returns 200."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"The wall loaded but did not connect."})," That is a VNC-level failure, not a page failure — the wall itself reports connected/failed counts once you enter the password."]})]}),(0,l.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:"The VNC password is deliberately not carried in this page or in the URL: any page a bot browser opens could otherwise reach the local websocket, and websockets have no CORS."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-dashed border-border p-5","aria-label":"Not wired yet",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Not wired yet"}),(0,l.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:["Per-bot cell headers (name \xb7 last round verdict \xb7 whether CDP is alive) need"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"browserPort"})," and round results on the daemon's persona route. That route is owned by another track and is not published today."]}),(0,l.jsx)("li",{children:"Running a command from this surface needs a POST route that does not exist yet."})]})]})]})}function h(){let e=window.location.search,t=null;try{t=window.localStorage.getItem(n)}catch(e){t=null}return(0,l.jsx)(c,{search:e,remembered:t})}}},e=>{e.O(0,[2367,6725,7358],()=>e(e.s=25736)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{40802:(e,t,s)=>{Promise.resolve().then(s.bind(s,41287))},41287:(e,t,s)=>{"use strict";s.d(t,{BotlabPageContent:()=>h});var r,l=s(54456),a=s(60500);let o=(null!=(r=s(41347).env.NEXT_PUBLIC_ELANOUS_BOTLAB_HOST)?r:"").trim(),n="elanous.botlab.wallHost",d=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;function i(e){return e.length>0&&e.length<=253&&d.test(e)}function c(e){var t;let{search:s,remembered:r=null}=e,d=(0,a.useMemo)(()=>(function(e){var t,s;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=null;try{l=new URLSearchParams(e).get("host")}catch(e){l=null}let a=null!=(t=null==l?void 0:l.trim())?t:"";if(""!==a&&i(a))return{host:a,source:"query",rejected:null};let n=""===a?null:a,d=null!=(s=null==r?void 0:r.trim())?s:"";return""!==d&&i(d)?{host:d,source:"remembered",rejected:n}:""!==o&&i(o)?{host:o,source:"default",rejected:n}:{host:"",source:"unset",rejected:n}})(s,r),[s,r]),c="unset"===d.source?null:(t=d.host,"https://".concat(t).concat("/bot3/bot-wall.html"));return(0,a.useEffect)(()=>{if("query"===d.source)try{window.localStorage.setItem(n,d.host)}catch(e){}},[d.source,d.host]),(0,l.jsxs)("main",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-10 sm:px-10","data-testid":"botlab-panel",children:[(0,l.jsxs)("header",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Bot screens"}),(0,l.jsx)("h1",{className:"mt-2 text-3xl font-bold",children:"Botlab"}),(0,l.jsxs)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:["Live noVNC screens for the bots, served through Tailscale. One document holds all four sessions, so the VNC password is asked ",(0,l.jsx)("strong",{children:"once"}),", not four times."]}),(0,l.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"View-only by default. This surface cannot send commands or control the bots."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-4","aria-label":"Wall address",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Wall address"}),(0,l.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground","data-testid":"botlab-wall-url",children:null!=c?c:"(no host configured)"}),(0,l.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"botlab-host-source",children:"query"===d.source?"Host came from the ?host= query parameter (remembered on this device).":"remembered"===d.source?"Host is the one remembered on this device; override it with ?host=<tailnet-name>.":"default"===d.source?"Host is the build default (NEXT_PUBLIC_ELANOUS_BOTLAB_HOST); override it with ?host=<tailnet-name>.":"No wall host is configured. Open this page once with ?host=<the VM tailnet name> — it is remembered on this device."}),null!==d.rejected&&(0,l.jsxs)("p",{role:"alert",className:"mt-2 text-xs text-destructive","data-testid":"botlab-host-rejected",children:["Ignored ?host=",d.rejected," — not a valid hostname."]}),null!==c&&(0,l.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground",children:[(0,l.jsx)("a",{className:"underline",href:c,target:"_blank",rel:"noreferrer","data-testid":"botlab-open-tab",children:"Open the wall in a new tab"})," — ","use this if the embedded frame stays blank."]})]}),null!==c&&(0,l.jsx)("section",{"aria-label":"Bot screen wall",children:(0,l.jsx)("iframe",{src:c,title:"Bot screen wall","data-testid":"botlab-wall-frame",className:"h-[70vh] w-full rounded-xl border border-border bg-background"})}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5","aria-label":"If the wall is blank",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"If the wall stays blank"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"A blank frame is not necessarily a broken bot. There are three separate reasons, with different fixes:"}),(0,l.jsxs)("ol",{className:"mt-3 list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"This device is outside the tailnet."})," The address simply does not exist here. Join the tailnet, or view the screens from a device that is on it."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Tailscale serve is not published."})," Re-run"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"bash scripts/botlab/deploy-bot-wall.sh"}),", which re-publishes the paths and then verifies each one returns 200."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"The wall loaded but did not connect."})," That is a VNC-level failure, not a page failure — the wall itself reports connected/failed counts once you enter the password."]})]}),(0,l.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:"The VNC password is deliberately not carried in this page or in the URL: any page a bot browser opens could otherwise reach the local websocket, and websockets have no CORS."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-dashed border-border p-5","aria-label":"Not wired yet",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Not wired yet"}),(0,l.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:["Per-bot cell headers (name \xb7 last round verdict \xb7 whether CDP is alive) need"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"browserPort"})," and round results on the daemon's persona route. That route is owned by another track and is not published today."]}),(0,l.jsx)("li",{children:"Running a command from this surface needs a POST route that does not exist yet."})]})]})]})}function h(){let e=window.location.search,t=null;try{t=window.localStorage.getItem(n)}catch(e){t=null}return(0,l.jsx)(c,{search:e,remembered:t})}}},e=>{e.O(0,[6390,3170,7358],()=>e(e.s=40802)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2885],{1355:(e,t,n)=>{"use strict";n.d(t,{Zr:()=>a,f6:()=>l,oD:()=>s});let r="elanous.daemon.sessionId";function l(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function s(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(r,e),e):localStorage.getItem(r)}();if(e)return e;let t=l();return localStorage.setItem(r,t),t}function a(){let e=l();return localStorage.setItem(r,e),e}},14968:(e,t,n)=>{Promise.resolve().then(n.bind(n,24033))},16882:(e,t,n)=>{"use strict";n.d(t,{v:()=>a});var r=n(60500),l=n(50733);let s=null;function a(e){let[t,n]=(0,r.useState)(()=>s&&Date.now()-s.at<6e4?s.data:[]),[a,o]=(0,r.useState)(!1),[i,d]=(0,r.useState)(null),u=(0,r.useCallback)(async()=>{o(!0),d(null);try{let t=await e.listPersonas();s={at:Date.now(),data:t.personas},n(t.personas)}catch(e){d(e instanceof Error?e.message:String(e))}finally{o(!1)}},[e]);(0,r.useEffect)(()=>{if(s&&Date.now()-s.at<6e4)return void n(s.data);u()},[u]);let c=(0,r.useCallback)(async()=>{s=null,await u()},[u]);return(0,r.useEffect)(()=>{let t=e.personasEventsUrl();if(!t)return;let n=null;try{n=new EventSource(t)}catch(e){(0,l.cY)("showroom.personas.sse.construct-error",{error:String(e)});return}let r=e=>()=>{"hello"!==e&&((0,l.cY)("showroom.personas.sse.event",{kind:e}),s=null,u())};return n.addEventListener("hello",r("hello")),n.addEventListener("load-dir",r("load-dir")),n.addEventListener("reload-all",r("reload-all")),n.addEventListener("upsert",r("upsert")),n.addEventListener("remove",r("remove")),n.onerror=e=>{(0,l.cY)("showroom.personas.sse.error",{type:e.type})},()=>{try{null==n||n.close()}catch(e){}}},[e,u]),{personas:t,loading:a,error:i,reload:c}}},24033:(e,t,n)=>{"use strict";n.d(t,{BotsPageContent:()=>D});var r=n(54456),l=n(60500),s=n(36581),a=n(16882);function o(e){if(null==e)return null;let t=e.replace(/[,%\s]/g,"").replace(/\*/g,"").trim();if(""===t||"-"===t||"N/A"===t)return null;let n=Number(t);return Number.isFinite(n)?n:null}let i=e=>"string"==typeof e&&""!==e?e:null,d=e=>"number"==typeof e&&Number.isFinite(e)?e:null,u=e=>"boolean"==typeof e?e:null;function c(e){var t,n,r,l,s;let a=[],c=[];for(let t of null!=(n=e.artifacts)?n:[]){let e=null!=(r=i(null==t?void 0:t.name))?r:"(이름 없음)",n=i(null==t?void 0:t.text);if(null===n){c.push(e);continue}a.push(function(e,t){var n;let r=function(e){let t=e.split("\n").filter(e=>""!==e.trim()&&!e.includes("━")),n=t.slice(0,3).join(" / ").slice(0,160),r=t.slice(0,3).join("\n");return/^Traceback \(most recent call last\):/m.test(r)?{kindOf:"파이썬 예외(Traceback)",head:n}:/^⛔\s*.*(실패|failed|error)/mi.test(r)?{kindOf:"스킬이 \xab실패\xbb라고 말했다",head:n}:/^(Error|error):/m.test(r)?{kindOf:"오류",head:n}:/^\s*command not found|No such file or directory/m.test(r)?{kindOf:"명령\xb7파일이 \xab없다\xbb",head:n}:null}(t);if(null!==r)return{kind:"failure",name:e,kindOf:r.kindOf,head:r.head};let l=function(e){var t,n,r,l;let s=null!=(l=null!=(r=null==(t=/^대상:\s*(\S+)/m.exec(e))?void 0:t[1])?r:null==(n=/^##\s+(\S+)\s+Real-Time Quote/m.exec(e))?void 0:n[1])?l:null;if(null===s)return null;let a=t=>{var n,r;return null!=(r=null==(n=RegExp("\\*\\*".concat(t,":\\*\\*\\s*([-+0-9.,]+)"),"i").exec(e))?void 0:n[1])?r:null},i=/\*\*Change:\*\*\s*([-+0-9.,]+)\s*\(([-+0-9.]+)%\)/i.exec(e),d={symbol:s,close:o(a("Close")),change:i?o(i[1]):o(a("Change")),changePct:i?o(i[2]):null,open:o(a("Open")),high:o(a("High")),low:o(a("Low")),volume:o(a("Volume")),prevClose:o(a("Prev Close"))};return[d.close,d.change,d.open,d.high,d.low,d.volume,d.prevClose].some(e=>null!==e)?d:null}(t);if(null!==l)return{kind:"quote",name:e,quote:l};let s=null!=(n=function(e){var t,n,r,l,s,a,i,d;let u=e.split("\n"),c=u.findIndex(e=>e.includes("|")&&e.includes("외국인")&&e.includes("기관")&&e.includes("개인"));if(c<0)return null;let m=e=>e.split("|").map(e=>e.trim()).filter((e,t,n)=>""!==e||0!==t&&t!==n.length-1),x=m(u[c]),f=e=>x.findIndex(t=>t.includes(e)),[h,g,p,b]=[0,f("외국인"),f("기관"),f("개인")];if(g<0||p<0||b<0)return null;let j=[];for(let e=c+1;e<u.length;e+=1){let t=u[e];if(!t.includes("|")){if(j.length>0)break;continue}if(/^\s*\|?[\s:|-]+\|?\s*$/.test(t))continue;let n=m(t);if(n.length<=Math.max(g,p,b))continue;let r=(null!=(l=n[h])?l:"").trim();""!==r&&j.push({key:r,foreign:o(n[g]),institution:o(n[p]),individual:o(n[b])})}if(0===j.length)return null;let y="";for(let e=c;e>=0;e-=1){let t=/^#{2,3}\s+(.+)$/.exec((null!=(s=u[e])?s:"").trim());if(t){y=t[1];break}}return""===y&&(y=null!=(a=null==(t=u.find(e=>""!==e.trim()&&!e.includes("━")))?void 0:t.trim())?a:"(제목 없음)"),{title:y,unit:null!=(d=null==(n=/\((백만|천|억)\)/.exec(x.join(" ")))?void 0:n[1])?d:null!=(i=null==(r=/\(([^)]*원[^)]*)\)/.exec(x.join(" ")))?void 0:r[1])?i:null,rows:j}}(t))?n:function(e){let t,n=e.trimStart();if(!n.startsWith("{"))return null;try{t=JSON.parse(n)}catch(e){return null}let r=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(let t of n){let n=e[t];if("number"==typeof n&&Number.isFinite(n))return n}return null},l=[],s=t.periods;if("object"==typeof s&&null!==s&&!Array.isArray(s))for(let[e,t]of Object.entries(s))"object"==typeof t&&null!==t&&l.push({key:e,foreign:r(t,"frgn_net_shares","frgn_net_amount_million"),institution:r(t,"inst_net_shares","inst_net_amount_million"),individual:r(t,"prsn_net_shares","prsn_net_amount_million")});if(0===l.length&&Array.isArray(t.rows))for(let e of t.rows){if("object"!=typeof e||null===e)continue;let t="string"==typeof e.date?e.date:null;null!==t&&l.push({key:t,foreign:r(e,"frgn_net_shares","frgn_net_amount_million"),institution:r(e,"inst_net_shares","inst_net_amount_million"),individual:r(e,"prsn_net_shares","prsn_net_amount_million")})}if(0===l.length)return null;let a="string"==typeof t.ticker?t.ticker:null,o="string"==typeof t.name&&t.name!==a?t.name:null;return{title:null!==o&&null!==a?"".concat(o,"(").concat(a,") 투자자 수급"):null!==a?"".concat(a," 투자자 수급"):"투자자 수급",unit:"주",rows:l}}(t);if(null!==s)return{kind:"flow",name:e,flow:s};let a=function(e){let t,n=e.split("\n"),r=n.findIndex(e=>"---BEGIN_OMNI_CRAWL_JSON---"===e);if(r<0)return{news:null,why:null,fenced:!1};let l=n.findIndex((e,t)=>t>r&&"---END_OMNI_CRAWL_JSON---"===e);if(l<0)return{news:null,why:"Omni crawl JSON 끝 울타리를 \xab못 찾았다\xbb",fenced:!0};try{t=JSON.parse(n.slice(r+1,l).join("\n"))}catch(e){return{news:null,why:"Omni crawl 울타리 안 JSON을 \xab못 읽었다\xbb",fenced:!0}}if("object"!=typeof t||null===t||Array.isArray(t))return{news:null,why:"Omni crawl JSON 최상위가 객체가 아니다",fenced:!0};let s=t;if(!Array.isArray(s.results))return{news:null,why:"Omni crawl JSON에 results 배열이 없다",fenced:!0};let a=[];for(let e of s.results){if("object"!=typeof e||null===e||Array.isArray(e))continue;let t=e.items;if(Array.isArray(t))for(let e of t)"object"!=typeof e||null===e||Array.isArray(e)||a.push({title:"string"==typeof e.title?e.title:null,url:"string"==typeof e.url?e.url:null,date:"string"==typeof e.date?e.date:null})}return{news:{query:"string"==typeof s.query?s.query:null,items:a},why:null,fenced:!0}}(t);if(null!==a.news)return{kind:"news",name:e,news:a.news};let i=t.split("\n").filter(e=>""!==e.trim()&&!e.includes("━")).slice(0,2).join(" / ").slice(0,120);if(a.fenced)return{kind:"unparsed",name:e,why:a.why,head:i};let d=function(e){let t=e.split("\n").filter(e=>""!==e.trim()&&!e.includes("━"));if(t.length<2)return null;let n=[];for(let e of t.slice(1)){let t=/^\s{1,}(\S[^:]*?)\s+:\s+(.+?)\s*$/.exec(e);if(null===t)continue;let r=t[1].trim(),l=t[2].trim();""===r||""===l||r.includes("//")||n.push({label:r,value:l,num:o(l)})}return 0===n.length?null:{title:t[0].trim(),entries:n}}(t);return null!==d?{kind:"keyed",name:e,keyed:d}:{kind:"unparsed",name:e,why:"아는 꼴이 \xab아니다\xbb(시세\xb7수급표\xb7뉴스\xb7라벨:값 넷 다 아님)",head:i}}(e,n))}return{personaId:null!=(l=i(e.personaId))?l:"unknown",runId:i(e.runId),atUtc:i(e.atUtc),ok:u(e.ok),steps:d(e.steps),failed:d(e.failed),source:null!=(s=i(e.source))?s:"unknown",delivered:u(null==(t=e.delivery)?void 0:t.sent),artifacts:a,textless:c}}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null===e)return"—";let n=Math.abs(e)>=1e3?e.toLocaleString("en-US"):String(e);return!0===t.sign&&e>0?"+".concat(n):n}async function x(e,t,n){try{var r,l,s=await e.fetchJson("/v1/bots/rounds?persona=".concat(encodeURIComponent(t),"&limit=").concat(n));if("object"!=typeof s||null===s)return{kind:"error",reason:"라우트 응답을 \xab못 읽었다\xbb(객체가 아니다)"};if(!Array.isArray(s.rounds))return{kind:"error",reason:"`rounds` 가 \xab배열이 아니다\xbb — 「0건」과 \xab다른 값\xbb이다"};let a=s.unreadableBy,o=void 0===a?null:Object.entries(a).filter(e=>{let[t]=e;return"result-missing"!==t}).reduce((e,t)=>{var n;let[,r]=t;return e+(null!=(n=d(r))?n:0)},0);return{kind:"ready",rounds:s.rounds.map(c),unreadable:null!=(r=d(s.unreadable))?r:0,unreadableNow:null!=o?o:null!=(l=d(s.unreadable))?l:0}}catch(e){return{kind:"error",reason:e instanceof Error&&e.message?e.message:String(e)}}}function f(e){let{a:t}=e,n=t.quote,l=null!==n.changePct&&n.changePct>0,s=null!==n.changePct&&n.changePct<0;return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-background/60 p-3","data-testid":"quote-".concat(n.symbol),children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-baseline gap-x-3",children:[(0,r.jsx)("h4",{className:"font-mono text-sm font-semibold",children:n.symbol}),(0,r.jsx)("span",{className:"text-lg font-bold tabular-nums",children:m(n.close)}),(0,r.jsxs)("span",{className:"text-sm font-semibold tabular-nums ".concat(l?"text-emerald-600":s?"text-rose-600":"text-muted-foreground"),children:[m(n.change,{sign:!0}),null!==n.changePct&&" (".concat(m(n.changePct,{sign:!0}),"%)")]})]}),(0,r.jsx)("dl",{className:"mt-2 grid grid-cols-2 gap-x-4 gap-y-1 text-xs text-muted-foreground sm:grid-cols-4",children:[["시가",n.open],["고가",n.high],["저가",n.low],["전일",n.prevClose]].map(e=>{let[t,n]=e;return(0,r.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,r.jsx)("dt",{children:t}),(0,r.jsx)("dd",{className:"tabular-nums text-foreground",children:m(n)})]},t)})})]})}function h(e){let{a:t}=e,n=t.flow;return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-background/60 p-3","data-testid":"flow-block",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold",children:n.title}),null!==n.unit&&(0,r.jsxs)("p",{className:"mt-0.5 text-xs text-muted-foreground",children:["단위: ",n.unit]}),(0,r.jsx)("div",{className:"mt-2 overflow-x-auto",children:(0,r.jsxs)("table",{className:"w-full min-w-[22rem] text-xs",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"text-muted-foreground",children:[(0,r.jsx)("th",{className:"py-1 text-left font-medium",children:"기간"}),["외국인","기관","개인"].map(e=>(0,r.jsx)("th",{className:"py-1 text-right font-medium",children:e},e))]})}),(0,r.jsx)("tbody",{children:n.rows.slice(0,6).map(e=>(0,r.jsxs)("tr",{className:"border-t border-border/60",children:[(0,r.jsx)("td",{className:"py-1 font-mono",children:e.key}),[e.foreign,e.institution,e.individual].map((e,t)=>(0,r.jsx)("td",{className:"py-1 text-right tabular-nums ".concat(null===e?"text-muted-foreground":e>0?"text-emerald-600":e<0?"text-rose-600":""),children:m(e,{sign:!0})},t))]},e.key))})]})}),n.rows.length>6&&(0,r.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:["…",n.rows.length-6,"줄 더 (전체는 회차 원본에)"]})]})}function g(e){let{a:t}=e,n=t.keyed;return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-background/60 p-3","data-testid":"keyed-block",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold",children:n.title}),(0,r.jsx)("dl",{className:"mt-2 grid gap-1 sm:grid-cols-2",children:n.entries.map(e=>(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-3 text-sm",children:[(0,r.jsx)("dt",{className:"text-muted-foreground",children:e.label}),(0,r.jsx)("dd",{className:"font-semibold tabular-nums",children:e.value})]},e.label))})]})}function p(e){let{a:t}=e;return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-background/60 p-3","data-testid":"news-block",children:[(0,r.jsx)("h4",{className:"text-sm font-semibold",children:null===t.news.query?"뉴스":"뉴스: ".concat(t.news.query)}),0===t.news.items.length?(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"수집된 기사가 0건이다."}):(0,r.jsx)("ul",{className:"mt-2 space-y-2",children:t.news.items.map((e,t)=>{var n,l,s,a;return(0,r.jsxs)("li",{className:"text-sm",children:[null===e.url?null!=(n=e.title)?n:"(제목 없음)":(0,r.jsx)("a",{className:"font-medium underline underline-offset-2",href:e.url,children:null!=(l=e.title)?l:e.url}),null!==e.date&&(0,r.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:e.date})]},"".concat(null!=(a=null!=(s=e.url)?s:e.title)?a:"article","-").concat(t))})})]})}function b(e){let{a:t}=e;return(0,r.jsxs)("div",{className:"rounded-lg border border-rose-500/40 bg-rose-500/5 p-3","data-testid":"failure-block",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-baseline gap-2",children:[(0,r.jsx)("h4",{className:"font-mono text-sm font-semibold",children:t.name}),(0,r.jsx)("span",{className:"rounded bg-rose-500/15 px-2 py-0.5 text-xs font-medium text-rose-700",children:"이 단계가 \xab실패\xbb했다"})]}),(0,r.jsx)("p",{className:"mt-1 text-xs text-rose-700",children:t.kindOf}),(0,r.jsx)("p",{className:"mt-1 break-words font-mono text-xs text-muted-foreground",children:t.head})]})}function j(e){let{a:t}=e;return(0,r.jsxs)("div",{className:"rounded-lg border border-dashed border-border bg-background/40 p-3","data-testid":"unparsed-block",children:[(0,r.jsx)("h4",{className:"font-mono text-sm",children:t.name}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-amber-600",children:["⚠️ 이 산출을 \xab못 읽었다\xbb — ",t.why]}),(0,r.jsx)("p",{className:"mt-1 truncate text-xs text-muted-foreground",children:t.head})]})}function y(e){var t;let{round:n}=e,l=null!==n.failed&&n.failed>0;return(0,r.jsxs)("article",{className:"rounded-xl border border-border bg-card p-5","data-testid":"round-".concat(null!=(t=n.runId)?t:"unknown"),children:[(0,r.jsxs)("header",{className:"flex flex-wrap items-baseline justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-lg font-semibold",children:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Asia/Seoul";if(null===e)return"시각 \xab모름\xbb";let n=new Date(e);if(Number.isNaN(n.getTime()))return"시각을 \xab못 읽었다\xbb(".concat(e.slice(0,24),")");let r=new Intl.DateTimeFormat("ko-KR",{timeZone:t,month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});return"".concat(r.format(n)," KST")}(n.atUtc)}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,r.jsx)("span",{className:"rounded px-2 py-0.5 font-medium ".concat("cron"===n.source?"bg-emerald-500/15 text-emerald-700":"bg-muted text-muted-foreground"),children:"cron"===n.source?"무인(cron)":"manual"===n.source?"손":"출처 \xab모름\xbb"}),(0,r.jsxs)("span",{className:"rounded px-2 py-0.5 font-medium ".concat(l?"bg-rose-500/15 text-rose-700":"bg-muted text-muted-foreground"),children:[null===n.steps?"단계 \xab모름\xbb":"".concat(n.steps,"단계"),l&&" \xb7 실패 ".concat(n.failed)]}),(0,r.jsx)("span",{className:"rounded px-2 py-0.5 font-medium ".concat(!0===n.delivered?"bg-sky-500/15 text-sky-700":"bg-muted text-muted-foreground"),children:null===n.delivered?"배달 \xab모름\xbb":n.delivered?"폰에 갔다":"안 갔다"})]})]}),(0,r.jsxs)("div",{className:"mt-4 space-y-3",children:[n.artifacts.map((e,t)=>"quote"===e.kind?(0,r.jsx)(f,{a:e},t):"flow"===e.kind?(0,r.jsx)(h,{a:e},t):"news"===e.kind?(0,r.jsx)(p,{a:e},t):"keyed"===e.kind?(0,r.jsx)(g,{a:e},t):"failure"===e.kind?(0,r.jsx)(b,{a:e},t):(0,r.jsx)(j,{a:e},t)),0===n.artifacts.length&&0===n.textless.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"이 회차에 산출이 \xab없다\xbb."}),n.textless.length>0&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["본문을 \xab안 받은\xbb 산출 ",n.textless.length,"건: ",n.textless.join(" \xb7 ")]})]})]})}function N(e){let{client:t,persona:n,title:s,subtitle:a,limit:o=3}=e,[i,d]=(0,l.useState)({kind:"loading"});return(0,l.useEffect)(()=>{let e=!0;return d({kind:"loading"}),x(t,n,o).then(t=>{e&&d(t)}),()=>{e=!1}},[t,n,o]),(0,r.jsxs)("section",{className:"flex flex-col gap-4","aria-label":"".concat(n," rounds"),"data-testid":"rounds-".concat(n),children:[(0,r.jsxs)("header",{children:[(0,r.jsx)("h2",{className:"text-xl font-bold",children:s}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a})]}),"loading"===i.kind&&(0,r.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"투자 회차를 불러오는 중…"}),"error"===i.kind&&(0,r.jsxs)("div",{role:"alert",className:"rounded-lg border border-destructive/40 bg-destructive/5 p-3 text-sm",children:[(0,r.jsx)("p",{className:"font-medium text-destructive",children:"회차를 \xab못 받았다\xbb."}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i.reason}),(0,r.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground",children:["⚠️ 라우트 ",(0,r.jsx)("code",{className:"font-mono",children:"/v1/bots/rounds"})," 가 아직 \xab없을 수\xbb 있다(\uD83C\uDD63 축). 그때는 이 자리가 비는 것이 \xab맞다\xbb — 화면이 그것을 말하고 있다."]})]}),"ready"===i.kind&&0===i.rounds.length&&(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["회차가 \xab0건\xbb이다.",i.unreadable>0&&" (못 읽은 자리 ".concat(i.unreadable,"곳 — 「없다」가 아니다)")]}),"ready"===i.kind&&i.rounds.length>0&&(0,r.jsxs)(r.Fragment,{children:[i.unreadableNow>0?(0,r.jsxs)("p",{role:"alert",className:"text-xs text-amber-600",children:["⚠️ ***지금 못 읽는 자리 ",i.unreadableNow,"곳*** — 아래 수는 \xab과소\xbb다."]}):i.unreadable>0?(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["못 읽은 자리 ",i.unreadable,"곳(옛 회차) — 「지금 깨진 것」은 \xab없다\xbb."]}):null,(0,r.jsx)("div",{className:"flex flex-col gap-4",children:i.rounds.map(e=>{var t,n;return(0,r.jsx)(y,{round:e},null!=(n=null!=(t=e.runId)?t:e.atUtc)?n:Math.random())})})]})]})}function w(e){let{client:t,limit:n=3}=e;return(0,r.jsx)(N,{client:t,persona:"investor",limit:n,title:"\uD83D\uDCC8 투자 회차",subtitle:"봇이 \xab실제로 낸\xbb 산출이다. ⛔ 차트는 \xab일부러\xbb 안 그린다 — 글만 낸다."})}function v(e){let{client:t,limit:n=2}=e;return(0,r.jsx)(N,{client:t,persona:"assistant",limit:n,title:"\uD83D\uDDD3️ 비서 회차",subtitle:"안 읽은 메일\xb7앞으로의 일정. ⛔ 「0」도 \xab잰 값\xbb이라 그대로 보여 준다."})}function k(e){let{client:t,limit:n=2}=e;return(0,r.jsx)(N,{client:t,persona:"newsbot",limit:n,title:"\uD83D\uDCF0 뉴스 회차",subtitle:"⚠️ 이 봇의 산출은 꼴이 여럿이다 — 못 읽은 것은 \xab이름을 대고\xbb 남는다."})}async function _(e){try{let t=await e.fetchJson("/v1/bots/commands");return{kind:"ready",commands:t}}catch(e){return{kind:"error",reason:e instanceof Error&&e.message?e.message:"string"==typeof e&&e?e:"Unknown error"}}}function S(e){let{client:t}=e,n=(0,a.v)(t),[s,o]=(0,l.useState)({kind:"loading"});(0,l.useEffect)(()=>{let e=!0;return o({kind:"loading"}),_(t).then(t=>{e&&o(t)}),()=>{e=!1}},[t]);let i=n.error,d="error"===s.kind?s.reason:null,u=null!==i||null!==d,c=!u&&(n.loading||"loading"===s.kind),m="ready"===s.kind?s.commands:[],x=!c&&!u;return(0,r.jsxs)("main",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-6 py-10 sm:px-10","data-testid":"bots-panel",children:[(0,r.jsxs)("header",{children:[(0,r.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Bot directory"}),(0,r.jsx)("h1",{className:"mt-2 text-3xl font-bold",children:"Bots"}),(0,r.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"Commands are global: every bot exposes the same catalog."}),(0,r.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"This surface cannot send commands yet; it only shows what you can ask bots to do."})]}),c&&(0,r.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"Loading bot identities and command catalog…"}),i&&(0,r.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Unable to load bot identities: ",i]}),d&&(0,r.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Unable to load bot catalog: ",d]}),x&&0===n.personas.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No bots are configured."}),x&&n.personas.length>0&&0===m.length&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"No bot commands are available."}),(0,r.jsx)(w,{client:t}),(0,r.jsx)(v,{client:t}),(0,r.jsx)(k,{client:t}),x&&n.personas.length>0&&m.length>0&&(0,r.jsx)("section",{className:"grid gap-4 md:grid-cols-2","aria-label":"Bot identities",children:n.personas.map(e=>{var t;return(0,r.jsxs)("article",{className:"rounded-xl border border-border bg-card p-5","data-testid":"bot-card-".concat(e.personaId),children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:e.displayName}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:null!=(t=e.description)?t:"No description provided."}),(0,r.jsx)("h3",{className:"mt-5 text-sm font-semibold",children:"Available commands"}),(0,r.jsx)("ul",{className:"mt-3 space-y-3","aria-label":"Available bot commands",children:m.map(e=>(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-background/60 p-3",children:[(0,r.jsx)("h4",{className:"font-mono text-sm font-semibold",children:e.name}),(0,r.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e.description}),e.arguments.length>0?(0,r.jsx)("ul",{className:"mt-2 space-y-1","aria-label":"".concat(e.name," arguments"),children:e.arguments.map(e=>(0,r.jsxs)("li",{className:"text-xs text-muted-foreground",children:[(0,r.jsx)("code",{className:"font-semibold text-foreground",children:e.name}),e.required?" (required)":" (optional)"," — ",e.description]},e.name))}):(0,r.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"No arguments."})]},e.name))})]},e.personaId)})})]})}function D(){let{client:e}=(0,s.Q)();return(0,r.jsx)(S,{client:e})}},36581:(e,t,n)=>{"use strict";n.d(t,{C:()=>d,DaemonProvider:()=>u,Q:()=>c});var r=n(54456),l=n(60500),s=n(86704),a=n(1355),o=n(39906),i=n(50733);let d=(0,l.createContext)(null);function u(e){let{children:t}=e,n={baseUrl:"",token:"",provider:""},[u,c]=(0,l.useState)(n),[m,x]=(0,l.useState)(""),[f]=(0,l.useState)(()=>new o.ki(n));(0,l.useEffect)(()=>{let e=(0,s.Fp)();c(e),f.updateConfig(e),x((0,a.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[f]),(0,l.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();f.updateConfig(t),c(t),(0,i.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&x(t=>t===e.newValue?t:((0,i.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[f]);let h=e=>{c(t=>{let n={...t,...e};return(0,s.Qc)(e),f.updateConfig(n),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),n})},g=e=>{x(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},p=(0,l.useMemo)(()=>({config:u,setConfig:h,client:f,sessionId:m,setSessionId:g}),[u,f,m]);return(0,r.jsx)(d.Provider,{value:p,children:t})}function c(){let e=(0,l.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}}},e=>{e.O(0,[9906,6390,3170,7358],()=>e(e.s=14968)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8457],{13784:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});let i=(0,t(18494).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},18494:(e,r,t)=>{"use strict";t.d(r,{A:()=>c});var i=t(60500);let l=function(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return r.filter((e,r,t)=>!!e&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim()},a=e=>{let r=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase());return r.charAt(0).toUpperCase()+r.slice(1)};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let s=(0,i.createContext)({}),d=(0,i.forwardRef)((e,r)=>{var t,a,d;let{color:c,size:o,strokeWidth:u,absoluteStrokeWidth:h,className:p="",children:k,iconNode:y,...f}=e,{size:g=24,strokeWidth:v=2,absoluteStrokeWidth:b=!1,color:m="currentColor",className:x=""}=null!=(t=(0,i.useContext)(s))?t:{},w=(null!=h?h:b)?24*Number(null!=u?u:v)/Number(null!=o?o:g):null!=u?u:v;return(0,i.createElement)("svg",{ref:r,...n,width:null!=(a=null!=o?o:g)?a:n.width,height:null!=(d=null!=o?o:g)?d:n.height,stroke:null!=c?c:m,strokeWidth:w,className:l("lucide",x,p),...!k&&!(e=>{for(let r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0;return!1})(f)&&{"aria-hidden":"true"},...f},[...y.map(e=>{let[r,t]=e;return(0,i.createElement)(r,t)}),...Array.isArray(k)?k:[k]])}),c=(e,r)=>{let t=(0,i.forwardRef)((t,n)=>{let{className:s,...c}=t;return(0,i.createElement)(d,{ref:n,iconNode:r,className:l("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),s),...c})});return t.displayName=a(e),t}},32454:(e,r,t)=>{Promise.resolve().then(t.bind(t,15445))},37637:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});let i=(0,t(18494).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},78844:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});let i=(0,t(18494).A)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]])},91321:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});let i=(0,t(18494).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},91988:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});let i=(0,t(18494).A)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},92798:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});let i=(0,t(18494).A)("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]])},95564:(e,r,t)=>{"use strict";t.d(r,{p:()=>n});var i=t(54456);t(60500);var l=t(27551),a=t(74591);function n(e){let{className:r,type:t,...n}=e;return(0,i.jsx)(l.p,{type:t,"data-slot":"input",className:(0,a.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),...n})}}},e=>{e.O(0,[7777,3278,1829,7551,5978,1159,9906,4215,507,1394,4685,5445,6390,3170,7358],()=>e(e.s=32454)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3933],{1355:(e,t,s)=>{"use strict";s.d(t,{Zr:()=>l,f6:()=>n,oD:()=>r});let a="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function r(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=n();return localStorage.setItem(a,t),t}function l(){let e=n();return localStorage.setItem(a,e),e}},3086:(e,t,s)=>{Promise.resolve().then(s.bind(s,60570))},36581:(e,t,s)=>{"use strict";s.d(t,{C:()=>i,DaemonProvider:()=>d,Q:()=>m});var a=s(54456),n=s(60500),r=s(86704),l=s(1355),o=s(39906),c=s(50733);let i=(0,n.createContext)(null);function d(e){let{children:t}=e,s={baseUrl:"",token:"",provider:""},[d,m]=(0,n.useState)(s),[u,p]=(0,n.useState)(""),[x]=(0,n.useState)(()=>new o.ki(s));(0,n.useEffect)(()=>{let e=(0,r.Fp)();m(e),x.updateConfig(e),p((0,l.oD)()),(0,c.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[x]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,r.Fp)();x.updateConfig(t),m(t),(0,c.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,c.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[x]);let f=e=>{m(t=>{let s={...t,...e};return(0,r.Qc)(e),x.updateConfig(s),(0,c.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),s})},h=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,c.cY)("webterm.provider.daemon.session-set",{sessionId:e})},g=(0,n.useMemo)(()=>({config:d,setConfig:f,client:x,sessionId:u,setSessionId:h}),[d,x,u]);return(0,a.jsx)(i.Provider,{value:g,children:t})}function m(){let e=(0,n.useContext)(i);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},60570:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var a=s(54456),n=s(60500),r=s(36581);let l="user@elanvital.ai",o={name:"이름",org:"회사명",kind:"회사/개인",interest:"관심 분야",contact:"연락처",consent:"동의"};function c(){let{client:e}=(0,r.Q)(),[t,s]=(0,n.useState)(""),[c,i]=(0,n.useState)(""),[d,m]=(0,n.useState)("personal"),[u,p]=(0,n.useState)("A"),[x,f]=(0,n.useState)(""),[h,g]=(0,n.useState)(!1),[b,y]=(0,n.useState)(!1),[j,v]=(0,n.useState)(""),[k,N]=(0,n.useState)(!1);async function w(s){if(s.preventDefault(),!h||b)return;let a={name:t.trim(),..."company"===d?{org:c.trim()}:{},kind:d,interest:u,contact:x.trim(),consent:!0},n=a.name?"company"!==d||a.org?a.contact?null:"contact":"org":"name";if(n){N(!0),v("".concat(o[n]," 항목을 입력해 주세요."));return}y(!0),v("");try{let t=await e.submitConsultRequest(a);if("receiptId"in t)N(!1),v("접수했습니다 \xb7 ".concat(t.receiptId," — 곧 연락드리겠습니다"));else{var r;N(!0),v("".concat(null!=(r=o[t.field])?r:"필수"," 항목을 확인해 주세요."))}}catch(e){N(!0),v("접수하지 못했습니다. 연결 상태를 확인하고 다시 보내 주세요.")}finally{y(!1)}}return(0,a.jsxs)("main",{className:"mx-auto w-full max-w-xl px-5 py-10 sm:py-16",children:[(0,a.jsxs)("header",{className:"mb-8",children:[(0,a.jsx)("p",{className:"mb-2 text-sm font-medium text-primary",children:"AX \xb7 상담 문의"}),(0,a.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"어떤 도움이 필요하신가요?"}),(0,a.jsx)("p",{className:"mt-3 text-sm text-muted-foreground",children:"도입 상담이나 교육 과정에 대해 남겨 주세요. 확인 후 연락드리겠습니다."}),(0,a.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["메일로 바로 문의: ",(0,a.jsx)("a",{className:"underline",href:"mailto:".concat(l),children:l})]})]}),(0,a.jsxs)("form",{onSubmit:w,noValidate:!0,className:"space-y-6 rounded-xl border border-border bg-card p-5 sm:p-8",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-name",className:"block text-sm font-medium",children:"이름"}),(0,a.jsx)("input",{id:"consult-name",name:"name",required:!0,autoComplete:"name",value:t,onChange:e=>s(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"회사/개인"}),(0,a.jsxs)("div",{className:"flex gap-5 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"kind",value:"company",checked:"company"===d,onChange:()=>m("company")}),"회사"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"kind",value:"personal",checked:"personal"===d,onChange:()=>m("personal")}),"개인"]})]})]}),"company"===d&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-org",className:"block text-sm font-medium",children:"회사명"}),(0,a.jsx)("input",{id:"consult-org",name:"org",required:!0,autoComplete:"organization",value:c,onChange:e=>i(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"관심 분야"}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 text-sm",children:[(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"interest",value:"A",checked:"A"===u,onChange:()=>p("A")}),"A \xb7 AX 도입 상담"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{type:"radio",name:"interest",value:"B",checked:"B"===u,onChange:()=>p("B")}),"B \xb7 과정\xb7교육 문의"]})]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"consult-contact",className:"block text-sm font-medium",children:"연락처 (메일 또는 전화)"}),(0,a.jsx)("input",{id:"consult-contact",name:"contact",required:!0,value:x,onChange:e=>f(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 text-sm leading-6",children:[(0,a.jsx)("input",{type:"checkbox",name:"consent",checked:h,onChange:e=>g(e.target.checked),className:"mt-1"}),(0,a.jsx)("span",{children:"입력한 정보는 상담 연락을 위해 서버로 전송하며, 상담 연락에만 사용합니다"})]}),j&&(0,a.jsx)("p",{role:k?"alert":"status",className:k?"text-sm text-destructive":"text-sm text-primary",children:j}),(0,a.jsx)("button",{type:"submit",disabled:!h||b,className:"w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:b?"보내는 중…":"보내기"})]})]})}}},e=>{e.O(0,[9906,6390,3170,7358],()=>e(e.s=3086)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2580],{1355:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>o,f6:()=>n,oD:()=>s});let a="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function s(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=n();return localStorage.setItem(a,t),t}function o(){let e=n();return localStorage.setItem(a,e),e}},4222:(e,t,r)=>{"use strict";r.d(t,{U:()=>m});var a=r(54456),n=r(60500),s=r(36581),o=r(10080),i=r(95564);function l(e){let{items:t}=e;return 0===t.length?(0,a.jsx)("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No control signals matched the current filter."}):(0,a.jsx)("ul",{className:"space-y-2",children:t.map((e,t)=>{var r,n,s,o,i;let l=[(null==(r=e.scope)?void 0:r.surface)&&"surface=".concat(e.scope.surface),(null==(n=e.scope)?void 0:n.channel)&&"channel=".concat(e.scope.channel),(null==(s=e.scope)?void 0:s.sessionId)&&"session=".concat(e.scope.sessionId)].filter(Boolean).join(" \xb7 ")||"unscoped";return(0,a.jsxs)("li",{className:"rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsxs)("div",{className:"text-sm font-medium",children:[e.kind," \xb7 ",e.urgency]}),(0,a.jsxs)("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:[function(e){let t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):"".concat(Math.floor(t/864e5),"d ago")}(e.createdAt)," \xb7 ",null!=(o=e.source)?o:"unknown"," \xb7 ",l]}),(0,a.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted p-2 text-[11px]",children:JSON.stringify(null!=(i=e.payload)?i:{},null,2)})]},t)})})}let d=["background","quick-pass","normal","priority","critical"];class c{async list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;Object.entries(e).forEach(e=>{let[r,a]=e;a&&t.set(r,a)});let r=t.toString();return this.client.fetchJson("/v1/control-signals".concat(r?"?".concat(r):""))}emit(e){return this.client.fetchJson("/v1/control-signals",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}constructor(e){this.client=e}}var u=r(71829),p=r(50733);function m(){var e,t,r,m;let{client:g}=(0,s.Q)(),x=(0,n.useMemo)(()=>new c(g),[g]),[v,f]=(0,n.useState)({items:[]}),[b,h]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[k,j]=(0,n.useState)(""),[N,S]=(0,n.useState)(""),[C,z]=(0,n.useState)(""),[I,E]=(0,n.useState)(""),[U,D]=(0,n.useState)(""),[_,O]=(0,n.useState)("normal"),[P,J]=(0,n.useState)("operator"),[R,Y]=(0,n.useState)(""),[M,V]=(0,n.useState)(""),[$,F]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[T,q]=(0,n.useState)(!1),A=(0,n.useCallback)(async()=>{(0,p.cY)("webterm.control.list.refresh",{kind:y,surface:k,minUrgency:N,sessionId:C,limit:I}),h(!0);try{let e=await x.list({kind:y||void 0,surface:k||void 0,minUrgency:N||void 0,sessionId:C||void 0,limit:I||void 0});f(e)}catch(e){u.oR.error("signals list failed: ".concat(e instanceof Error?e.message:e))}finally{h(!1)}},[x,y,k,N,C,I]);(0,n.useEffect)(()=>{A()},[A]);let B=async e=>{if(e.preventDefault(),!U.trim())return void u.oR.error("kind required");let t={};if(L.trim())try{t=JSON.parse(L)}catch(e){u.oR.error("payload must be valid JSON");return}let r={kind:U.trim(),urgency:_,source:P.trim()||"operator",mayPreempt:T,payload:t,scope:{...R?{surface:R}:{},...M?{channel:M}:{},...$?{sessionId:$}:{}}};(0,p.cY)("webterm.control.emit",{kind:r.kind,urgency:r.urgency});try{h(!0),await x.emit(r),u.oR.success("signal emitted"),Q(""),await A()}catch(e){u.oR.error("emit failed: ".concat(e instanceof Error?e.message:e))}finally{h(!1)}},K=null!=(e=v.countsByKind)?e:{};return(0,a.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-4",children:[(0,a.jsxs)("header",{className:"space-y-2",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Control signals"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["total ",null!=(t=v.total)?t:0]}),(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["latest ",null!=(r=v.latest)?r:"-"]}),Object.entries(K).map(e=>{let[t,r]=e;return(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:[t," ",r]},t)})]})]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),A()},className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsx)(i.p,{value:y,onChange:e=>w(e.target.value),placeholder:"kind",className:"flex-1 min-w-[140px]"}),(0,a.jsx)(i.p,{value:k,onChange:e=>j(e.target.value),placeholder:"surface",className:"flex-1 min-w-[140px]"}),(0,a.jsxs)("select",{value:N,onChange:e=>S(e.target.value),className:"h-9 flex-1 min-w-[170px] rounded-md border border-input bg-background px-2 text-sm",children:[(0,a.jsx)("option",{value:"",children:"min urgency (any)"}),d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)(i.p,{value:C,onChange:e=>z(e.target.value),placeholder:"session id",className:"flex-1 min-w-[140px]"}),(0,a.jsx)(i.p,{value:I,onChange:e=>E(e.target.value),placeholder:"limit",type:"number",className:"w-[100px]"}),(0,a.jsx)(o.$,{type:"submit",size:"sm",disabled:b,children:"Filter"})]}),(0,a.jsxs)("form",{onSubmit:B,className:"space-y-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Emit a signal"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(i.p,{value:U,onChange:e=>D(e.target.value),placeholder:"kind (required)",className:"flex-1 min-w-[140px]"}),(0,a.jsx)("select",{value:_,onChange:e=>{let t=e.target.value;"string"==typeof t&&d.includes(t)&&O(t)},className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(i.p,{value:P,onChange:e=>J(e.target.value),placeholder:"source",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:R,onChange:e=>Y(e.target.value),placeholder:"scope.surface",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:M,onChange:e=>V(e.target.value),placeholder:"scope.channel",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:$,onChange:e=>F(e.target.value),placeholder:"scope.session",className:"flex-1 min-w-[120px]"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs",children:[(0,a.jsx)("input",{type:"checkbox",checked:T,onChange:e=>q(e.target.checked)}),"mayPreempt"]})]}),(0,a.jsx)("textarea",{value:L,onChange:e=>Q(e.target.value),placeholder:'payload JSON (optional, e.g. {"reason":"manual"})',rows:3,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs"}),(0,a.jsx)(o.$,{type:"submit",size:"sm",disabled:b,children:"Emit"})]}),(0,a.jsx)(l,{items:null!=(m=v.items)?m:[]})]})}},10080:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var a=r(54456),n=r(80247),s=r(13680),o=r(74591);let i=(0,s.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:r="default",size:s="default",...l}=e;return(0,a.jsx)(n.$,{"data-slot":"button",className:(0,o.cn)(i({variant:r,size:s,className:t})),...l})}},30975:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var a=r(54456),n=r(4222);function s(){return(0,a.jsx)(n.U,{})}},36581:(e,t,r)=>{"use strict";r.d(t,{C:()=>d,DaemonProvider:()=>c,Q:()=>u});var a=r(54456),n=r(60500),s=r(86704),o=r(1355),i=r(39906),l=r(50733);let d=(0,n.createContext)(null);function c(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[c,u]=(0,n.useState)(r),[p,m]=(0,n.useState)(""),[g]=(0,n.useState)(()=>new i.ki(r));(0,n.useEffect)(()=>{let e=(0,s.Fp)();u(e),g.updateConfig(e),m((0,o.oD)()),(0,l.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[g]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();g.updateConfig(t),u(t),(0,l.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&m(t=>t===e.newValue?t:((0,l.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[g]);let x=e=>{u(t=>{let r={...t,...e};return(0,s.Qc)(e),g.updateConfig(r),(0,l.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},v=e=>{m(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,l.cY)("webterm.provider.daemon.session-set",{sessionId:e})},f=(0,n.useMemo)(()=>({config:c,setConfig:x,client:g,sessionId:p,setSessionId:v}),[c,g,p]);return(0,a.jsx)(d.Provider,{value:f,children:t})}function u(){let e=(0,n.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},74591:(e,t,r)=>{"use strict";r.d(t,{cn:()=>s});var a=r(49454),n=r(79946);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,a.$)(t))}},88226:(e,t,r)=>{Promise.resolve().then(r.bind(r,30975))},95564:(e,t,r)=>{"use strict";r.d(t,{p:()=>o});var a=r(54456);r(60500);var n=r(27551),s=r(74591);function o(e){let{className:t,type:r,...o}=e;return(0,a.jsx)(n.p,{type:r,"data-slot":"input",className:(0,s.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...o})}}},e=>{e.O(0,[7777,3278,1829,7551,9906,6390,3170,7358],()=>e(e.s=88226)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6348],{3472:(e,t,s)=>{"use strict";s.d(t,{AF:()=>n});let n={all:["nexus"],health:()=>[...n.all,"health"],snapshot:()=>[...n.all,"snapshot"],tabs:e=>e?[...n.all,"tabs",{kind:e}]:[...n.all,"tabs"],tab:e=>[...n.all,"tab",e],templates:()=>[...n.all,"templates"],template:e=>[...n.all,"template",e],config:()=>[...n.all,"config"],switches:()=>[...n.all,"switches"],switch:e=>[...n.all,"switch",e],secrets:()=>[...n.all,"secrets"],bindingChannels:()=>[...n.all,"bindings","channels"],bindings:e=>[...n.all,"bindings",e],binding:(e,t)=>[...n.all,"binding",e,t],logsTail:(e,t)=>t?[...n.all,"logs",e,{lines:t}]:[...n.all,"logs",e],workflows:()=>[...n.all,"workflows"],workflow:e=>[...n.all,"workflow",e],workflowRun:e=>[...n.all,"workflow-run",e],workflowRuns:()=>[...n.all,"workflow-runs"],pendingApprovals:()=>[...n.all,"workflow-pending-approvals"],platforms:()=>[...n.all,"platforms"],providers:()=>[...n.all,"providers"],worktrees:()=>[...n.all,"worktrees"],designCheck:()=>[...n.all,"design-check"],designPreviews:()=>[...n.all,"design-previews"],designPreview:e=>[...n.all,"design-preview",e],registryCatalog:()=>[...n.all,"registry-catalog"],resolvedView:()=>[...n.all,"resolved-view"]};n.snapshot(),n.tabs(),n.health(),n.snapshot(),n.config(),n.switches()},28042:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>a,SI:()=>o,dJ:()=>l});let n="elanous:auth-required",r=null,i=!1;function a(e){null===r&&(r=e,window.dispatchEvent(new CustomEvent(n,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(n,s),null===r||i||e({path:r}),()=>t.removeEventListener(n,s)}function o(){i=!0}},35448:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(18494).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},39681:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(18494).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},43468:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>d,tI:()=>o});var n=s(54456),r=s(60500),i=s(40324),a=s(59405);let l=(0,r.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,d=(0,r.useMemo)(()=>null!=s?s:new i.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,n.jsx)(l.Provider,{value:t,children:(0,n.jsx)(a.Ht,{client:d,children:c})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,r.useContext)(l)}},45086:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(18494).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},50733:(e,t,s)=>{"use strict";let n;s.d(t,{cY:()=>d,x8:()=>l});let r={debug:0,info:1,warn:2,error:3},i="/v1/debug-logs/batch",a=null;function l(e){a=e}class o{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(r[function(e){let t=e.slice(e.lastIndexOf(".")+1).toLowerCase();return/^(error|exception|crash|fail|failed)$/.test(t)?"error":/^(warn|degraded|timeout)$/.test(t)?"warn":/^(boot|ready|start|begin|open|ok|done|resolve|end|stop|close)$/.test(t)?"info":"debug"}(e.category)]<r[this.minLevel])){if(this.queue.push(e),this.queue.length>500){let e=this.queue.length-500;this.droppedByCap+=e,this.queue.splice(0,e)}if(this.queue.length>=100&&!this.inFlight){null!==this.timer&&(clearTimeout(this.timer),this.timer=null),this.flush();return}null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}}async flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.inFlight||0===this.queue.length)return;let e=this.queue.slice(0,100);this.inFlight=!0;let t=!1,s=JSON.stringify({records:e});try{var n,r;t=await (n=this.fetchFn(s),r=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(r,"ms"))),r);n.then(t=>{clearTimeout(s),e(t)},e=>{clearTimeout(s),t(e)})}))}catch(e){t=!1}finally{this.inFlight=!1}if(!t){if(this.consecutiveFailures+=1,this.consecutiveFailures>=2&&a)try{await a(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let i=this.lastOkAt;this.lastOkAt=Date.now();let l=this.consecutiveFailures;this.consecutiveFailures=0,this.queue.splice(0,e.length),this.wasFailing&&(this.wasFailing=!1,this.queue.push({ts:new Date().toISOString(),category:"pwa.debug-forwarder.recovered",event:"recovered",data:{consecutiveFailures:l,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches,pending:this.queue.length,previousOkAt:i},source:{platform:"pwa"}})),this.queue.length>0&&null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}scheduleRetry(){if(null!==this.timer||0===this.queue.length)return;let e=Math.min(this.flushMs*2**this.consecutiveFailures,3e4);this.timer=setTimeout(()=>{this.flush()},e)}blockedNotice(){return{ts:new Date().toISOString(),category:"pwa.debug-forwarder.http-blocked",event:"http-blocked",data:{consecutiveFailures:this.consecutiveFailures,pending:this.queue.length,droppedByCap:this.droppedByCap,lastOkAt:this.lastOkAt,via:"acp-fallback"},source:{platform:"pwa"}}}beaconFlush(){if(0!==this.queue.length)try{if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon){let e=this.queue.slice(0,100),t=new Blob([JSON.stringify({records:e})],{type:"application/json"});navigator.sendBeacon(i,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",s=1e4,n=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,this.flushMs=n,this.queue=[],this.timer=null,this.inFlight=!1,this.consecutiveFailures=0,this.lastOkAt=null,this.droppedByCap=0,this.fallbackBatches=0,this.wasFailing=!1}}async function c(e){return(await fetch(i,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function d(e,t){if("undefined"==typeof console)return;let s=new Date().toISOString();if(void 0!==t){let n="";try{let e=new WeakSet;n=JSON.stringify(t,(t,s)=>{if("bigint"==typeof s)return"".concat(s.toString(),"n");if("function"==typeof s)return"[fn ".concat(s.name||"anon","]");if(s&&"object"==typeof s){if(e.has(s))return"[circular]";e.add(s)}return s})}catch(e){n="[unserializable: ".concat(String(e),"]")}n&&n.length>800&&(n=n.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(n),t),u(s,e,n)}else console.debug("[".concat(s,"] ").concat(e)),u(s,e,void 0)}function u(e,t,s){let r,i=function(){if(void 0!==n)return n;let e=function(){try{let e="off"!==window.localStorage.getItem("elanous.pwa.debug.forward"),t=window.localStorage.getItem("elanous.pwa.debug.forwardLevel");return{forward:e,level:"info"===t||"warn"===t||"error"===t?t:"debug"}}catch(e){return{forward:!0,level:"debug"}}}();if(!e.forward)return n=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return n=t,t}();if(!i)return;let a=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{r=JSON.parse(s)}catch(e){r=s}i.push({ts:e,category:t,event:a,...void 0!==r?{data:r}:{},source:{platform:"pwa"}})}},73245:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var n=s(54456),r=s(35448),i=s(45086);let a=(0,s(18494).A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);var l=s(97857),o=s(39681),c=s(60500),d=s(43468),u=s(81707),h=s(59405),m=s(89762),p=s(3472),g=s(23869);function f(e){let{available:t,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}=e,{systems:o,themes:c}=function(e){let t=[],s=[];for(let n of e)("design-system"===n.source?t:s).push(n);return{systems:t,themes:s}}(t);return(0,n.jsxs)("div",{className:"space-y-4",children:[o.length>0&&(0,n.jsx)(x,{title:"Design systems",hint:"Web \xb7 copies tokens.css and DESIGN.md into design/system/",items:o,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}),c.length>0&&(0,n.jsx)(x,{title:"Terminal themes",hint:"One line in DESIGN.md",items:c,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l})]})}function x(e){let{title:t,hint:s,items:r,declared:i,onPick:a,pendingId:l,previews:o,onPreview:c}=e;return(0,n.jsxs)("section",{className:"space-y-2","aria-label":t,children:[(0,n.jsxs)("h3",{className:"flex items-baseline gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[t,(0,n.jsxs)("span",{className:"normal-case tracking-normal",children:[r.length," \xb7 ",s]})]}),(0,n.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>(0,n.jsx)(b,{direction:e,chosen:e.id===i,onPick:a,pending:l===e.id,busy:null!==l,hasPreview:(null==o?void 0:o.has(e.id))===!0&&void 0!==c,onPreview:c},e.id))})]})}function b(e){var t,s,r,a,l,o,c,d,u;let{direction:h,chosen:m,onPick:p,pending:g,busy:f,hasPreview:x,onPreview:b}=e,y=null!=(r=h.swatch.bg)?r:h.isDark?"#111111":"#ffffff",v=null!=(a=h.swatch.fg)?a:h.swatch.text,w=null!=(o=null!=(l=null==(t=h.typography)?void 0:t.display)?l:null==(s=h.typography)?void 0:s.body)?o:null;return(0,n.jsxs)("li",{"data-direction":h.id,"data-direction-id":h.id,className:"flex flex-col gap-2 rounded-md border p-3 text-sm ".concat(m?"border-primary ring-1 ring-primary":""),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5","aria-hidden":!0,children:[[y,v,h.swatch.accent].map((e,t)=>(0,n.jsx)("span",{className:"h-5 w-5 rounded-full border",style:{backgroundColor:e,borderColor:h.swatch.muted}},t)),h.category&&(0,n.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:h.category})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"truncate font-medium",children:null!=(c=h.label)?c:h.id}),(0,n.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(0,n.jsx)("code",{children:h.id}),w?" \xb7 ".concat(w):""]}),(0,n.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:h.mood})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,n.jsx)("button",{type:"button",onClick:()=>null==b?void 0:b(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Preview ".concat(null!=(d=h.label)?d:h.id),children:"Preview"}),m?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Selected"]}):(0,n.jsx)("button",{type:"button",disabled:f,onClick:()=>p(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(null!=(u=h.label)?u:h.id),children:g?"Selecting…":"Select"})]})]})}let y=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function v(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function w(e,t){if("undefined"==typeof document)return t;let s=document.getElementById(e);return s&&"value"in s&&"string"==typeof s.value?s.value:t}function k(e){let{onCreate:t,onSelect:s,pending:r,result:i,error:a}=e,[l,o]=(0,c.useState)("url"),[d,u]=(0,c.useState)(""),[h,m]=(0,c.useState)(""),[p,g]=(0,c.useState)(""),f=v(h).filter(e=>y.test(e)),x=v(h).length,b=x>=2&&x<=6&&p.trim().length>0&&f.length===x;return(0,n.jsxs)("section",{className:"rounded-md border p-3","aria-label":"Make my system","data-make-my-system":"",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Make my system"}),(0,n.jsxs)("div",{className:"flex gap-1",role:"tablist",children:[(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"url"===l,className:"rounded-md px-2 py-1 text-xs ".concat("url"===l?"bg-muted":""),onClick:()=>o("url"),children:"From a website"}),(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"colors"===l,className:"rounded-md px-2 py-1 text-xs ".concat("colors"===l?"bg-muted":""),onClick:()=>o("colors"),children:"From colors"})]})]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Reference, not a copy — logos, names, images and text are not taken."}),"url"===l?(0,n.jsxs)("form",{className:"mt-2 flex flex-col gap-2 sm:flex-row",onSubmit:e=>{e.preventDefault();let s=d.trim();s&&!r&&t({kind:"url",url:s})},children:[(0,n.jsx)("label",{className:"sr-only",htmlFor:"make-system-url",children:"Website URL"}),(0,n.jsx)("input",{id:"make-system-url",type:"url",value:d,disabled:r,placeholder:"https://example.com",onChange:e=>u(e.target.value),className:"min-w-0 flex-1 rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=w("make-system-url",d).trim();e&&!r&&t({kind:"url",url:e})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}):(0,n.jsxs)("form",{className:"mt-2 space-y-2",onSubmit:e=>{e.preventDefault(),b&&!r&&t({kind:"palette",colors:f,id:p.trim()})},children:[(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-colors",children:"2–6 colors"}),(0,n.jsx)("input",{id:"make-system-colors",value:h,disabled:r,placeholder:"#f4efe6, #1f3a2e, #c8553d",onChange:e=>m(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),f.length>0&&(0,n.jsx)("ul",{className:"flex gap-1","aria-label":"Color preview",children:f.map(e=>(0,n.jsx)("li",{className:"h-6 w-6 rounded-sm border",style:{backgroundColor:e},title:e},e))}),(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-id",children:"id"}),(0,n.jsx)("input",{id:"make-system-id",value:p,disabled:r,placeholder:"stumptowncoffee",onChange:e=>g(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=v(w("make-system-colors",h)).filter(e=>y.test(e)),s=w("make-system-id",p).trim();r||e.length<2||e.length>6||0===s.length||t({kind:"palette",colors:e,id:s})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}),r&&(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Measuring…"}),a&&(0,n.jsx)("p",{className:"mt-2 text-sm text-error",role:"alert",children:a}),i&&(0,n.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,n.jsxs)("p",{children:["Made ",i.id," — ",i.tokens.length," tokens \xb7 ",i.unread," unread"]}),i.warnings.map(e=>(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e)),(0,n.jsx)("button",{type:"button",onClick:()=>s(i.id),className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted",children:"Select it"})]})]})}let j={missing:"Missing",declared:"Declared",available:"Not declared"},N={missing:"bg-error/10 text-error",declared:"bg-green-600/10 text-green-700",available:"bg-muted text-muted-foreground"},S={missing:r.A,declared:i.A,available:a};function C(){return(0,d.Qj)()?(0,n.jsx)(M,{}):(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Design check"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to see this repository's craft rulebooks."})]})}function M(){let{data:e,isLoading:t,error:s,refetch:i,isFetching:a}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designCheck(),queryFn:()=>s.getDesignCheck(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}();return(0,n.jsxs)("div",{className:"mx-auto max-w-3xl space-y-4 p-6",children:[(0,n.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(l.A,{className:"h-5 w-5","aria-hidden":!0}),"Design check"]}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Craft rulebooks declared by this repository's ",(0,n.jsx)("code",{children:"DESIGN.md"}),"."]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void i(),className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm hover:bg-muted","aria-label":"Refresh design check",children:[(0,n.jsx)(o.A,{className:"h-4 w-4 ".concat(a?"animate-spin":""),"aria-hidden":!0}),"Refresh"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),s&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["Could not reach the daemon: ",s instanceof Error?s.message:String(s)]}),e&&!1===e.ok&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/5 p-4",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(r.A,{className:"h-4 w-4 text-warning","aria-hidden":!0}),"Design check blocked"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:function(e,t){switch(e){case"no-repository":return"The daemon is not running inside a git checkout, so there is no DESIGN.md to check.";case"craft-directory":return"elanous's craft rulebook directory could not be read: ".concat(null!=t?t:"(unknown path)");case"design-document":return"This repository has no readable DESIGN.md: ".concat(null!=t?t:"(unknown path)");default:return"The design check is blocked (".concat(e,").")}}(e.blockedOn,e.path)})]}),e&&!0===e.ok&&(0,n.jsx)(F,{data:e})]})}function F(e){let{data:t}=e,s=function(e){let t=new Set(e.unavailableRulebooks),s=new Map;for(let t of e.availableRulebooks)s.set(t,"available");for(let n of e.declaredRulebooks)s.set(n,t.has(n)?"missing":"declared");let n={missing:0,declared:1,available:2};return[...s.entries()].map(e=>{let[t,s]=e;return{name:t,status:s}}).sort((e,t)=>n[e.status]-n[t.status]||e.name.localeCompare(t.name))}(t),r=t.unavailableRulebooks.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"rounded-md p-3 text-sm ".concat(r?"bg-error/10 text-error":"bg-green-600/10 text-green-700"),children:r?"".concat(r," declared rulebook").concat(1===r?"":"s"," could not be found."):"All ".concat(t.declaredRulebooks.length," declared rulebook").concat(1===t.declaredRulebooks.length?"":"s"," resolve.")}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,n.jsxs)("div",{className:"truncate sm:col-span-2",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Repository: "}),(0,n.jsxs)("dd",{className:"inline",children:[(0,n.jsx)("code",{children:t.repoRoot}),t.repoSource&&(0,n.jsxs)("span",{className:"ml-1",children:["(","config"===t.repoSource?"harness.defaultRepo":"daemon folder",")"]})]})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Document: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.documentPath})})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Rulebooks: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.craftDirectory})})]})]}),(0,n.jsx)(O,{data:t}),0===s.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"elanous ships no craft rulebooks and this document declares none."}):(0,n.jsx)("ul",{className:"divide-y rounded-md border",children:s.map(e=>{let t=S[e.status];return(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,n.jsx)("code",{children:e.name})]}),(0,n.jsx)("span",{className:"shrink-0 rounded-full px-2 py-0.5 text-xs ".concat(N[e.status]),children:j[e.status]})]},e.name)})})]})}function O(e){var t,s,r,i;let{data:a}=e,l=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.setDesignDirection(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),o=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.createDesignSystem(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),x=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreviews(),queryFn:()=>s.listDesignPreviews(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}(),[b,y]=(0,c.useState)(null),[v,w]=(0,c.useState)(null),j=a.directions;if((0,c.useEffect)(()=>{if(!v||!j)return;let e=document.querySelector('[data-direction-id="'.concat(v.replace(/"/g,""),'"]'));null==e||e.scrollIntoView({block:"nearest"})},[v,j]),!j)return null;let N=l.isPending&&null!=(s=l.variables)?s:null;return(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"Design direction"}),(0,n.jsx)(k,{pending:o.isPending,result:null!=(r=o.data)?r:null,error:o.isError?function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"bad-url":return"That address is not an http or https URL.";case"bad-id":return"The id may only use lowercase letters, digits, and hyphens.";case"id-taken":return"That id is already taken.";case"extract-failed":return"The page could not be measured.";case"no-colors":return"Give between 2 and 6 colors.";case"busy":return"Another system is being made — wait for it to finish.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can make a system — sign in first.";return"Could not make the system: ".concat(e instanceof Error?e.message:String(e))}}(o.error):null,onCreate:e=>{o.mutate(e,{onSuccess:e=>w(e.id)})},onSelect:e=>{w(e),l.mutate(e)}}),j.unavailable&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:["Declared direction ",(0,n.jsx)("code",{children:j.unavailable})," is not registered."]}),null===j.declared&&!j.unavailable&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"None declared — pick one below."}),l.isError&&(0,n.jsx)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"unknown-direction":return"The daemon does not know this direction.";case"no-repository":return"The daemon has no repository to write to (set harness.defaultRepo).";case"conflicting-system-file":return"design/system/ already holds a file the daemon will not overwrite.";case"cannot-read":return"The DESIGN.md could not be read.";case"cannot-write":return"The DESIGN.md could not be written.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can pick a direction — sign in first.";return"Could not set the direction: ".concat(e instanceof Error?e.message:String(e))}}(l.error)}),b&&(0,n.jsx)(A,{system:b,onClose:()=>y(null),onSelect:()=>l.mutate(b),selecting:N===b,busy:null!==N,alreadySelected:j.declared===b}),(0,n.jsx)(f,{available:j.available,declared:j.declared,pendingId:N,previews:new Set((null!=(i=null==(t=x.data)?void 0:t.previews)?i:[]).map(e=>e.system)),onPreview:e=>y(e),onPick:e=>l.mutate(e)})]})}function A(e){let{system:t,onClose:s,onSelect:r,selecting:i,busy:a,alreadySelected:l}=e,o=function(e){let t=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreview(null!=e?e:""),queryFn:()=>t.getDesignPreview(e),enabled:null!==e&&""!==e})}(t);return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"text-sm font-medium",children:["Preview \xb7 ",(0,n.jsx)("code",{children:t})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,n.jsx)("span",{className:"text-xs text-primary",children:"Selected"}):(0,n.jsx)("button",{type:"button",disabled:a,onClick:r,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(t),children:i?"Selecting…":"Select"}),(0,n.jsx)("button",{type:"button",onClick:s,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Close preview",children:"Close"})]})]}),o.isLoading&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading preview…"}),o.isError&&(0,n.jsxs)("p",{className:"text-sm text-error",children:["Could not load the preview: ",o.error instanceof Error?o.error.message:String(o.error)]}),o.data&&(0,n.jsx)("iframe",{sandbox:"",srcDoc:o.data.html,title:"Preview \xb7 ".concat(t),className:"h-80 w-full rounded-md border bg-white"})]})}function E(){return(0,n.jsx)(C,{})}},89751:(e,t,s)=>{Promise.resolve().then(s.bind(s,73245))},89762:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var n=s(60500),r=s(12146),i=s(23515),a=s(46484),l=s(5318),o=class extends a.Q{#e;#t=void 0;#s;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#i()}mutate(e,t){return this.#n=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#r(){let e=this.#s?.state??(0,r.$)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#i(e){i.jG.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,s,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,s,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(59405);function d(e,t){let s=(0,c.jE)(t),[r]=n.useState(()=>new o(s,e));n.useEffect(()=>{r.setOptions(e)},[r,e]);let a=n.useSyncExternalStore(n.useCallback(e=>r.subscribe(i.jG.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),d=n.useCallback((e,t)=>{r.mutate(e,t).catch(l.lQ)},[r]);if(a.error&&(0,l.GU)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:d,mutateAsync:a.mutate}}},97857:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(18494).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])}},e=>{e.O(0,[9538,9656,3869,6390,3170,7358],()=>e(e.s=89751)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6766],{11231:(e,s,r)=>{"use strict";r.r(s),r.d(s,{default:()=>m});var a=r(54456),l=r(60500),t=r(81707),n=r(80581),c=r(43468),i=r(49464),d=r(50053),x=r(93477);function o(e){let{palette:s,fallback:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("strong",{children:"노드 팔레트"}),s.map(e=>{var s;return(0,a.jsxs)("span",{title:e.description,className:"rounded border border-border px-2 py-0.5",children:[e.kind," ",e.plugin&&(0,a.jsx)("small",{className:"rounded bg-accent/15 px-1 text-accent",children:e.plugin})]},"".concat(null!=(s=e.plugin)?s:"core",":").concat(e.kind))})]}),r&&(0,a.jsx)("p",{role:"status",className:"mt-1 text-warning",children:"어휘 목록을 불러오지 못해 코어 팔레트를 표시합니다."})]})}function p(e){let{palette:s,fallback:r}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("details",{className:"border-b border-border px-3 py-2 text-xs min-[640px]:hidden","aria-label":"노드 팔레트",children:[(0,a.jsxs)("summary",{className:"cursor-pointer",children:["노드 더하기 (",s.length,")"]}),(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(o,{palette:s,fallback:r})})]}),(0,a.jsx)("div",{className:"hidden border-b border-border px-3 py-2 text-xs min-[640px]:block","aria-label":"노드 팔레트",children:(0,a.jsx)(o,{palette:s,fallback:r})})]})}function h(){let e="harness"===(0,n.useSearchParams)().get("mode")?"harness":"workflow",s=(0,c.Qj)(),r=(0,t.I)({queryKey:["graph-kinds",e],queryFn:()=>s.getGraphKinds(e),enabled:null!==s,retry:!1}),o=(0,l.useMemo)(()=>{var s;return(null==(s=r.data)?void 0:s.kinds.length)?r.data.kinds:("harness"===e?x.DN:x.CF).map(s=>({graph:e,kind:s,plugin:null,description:"",schema:{},core:!0}))},[r.data,e]),h=r.isError||r.isSuccess&&!r.data.kinds.length;return(0,a.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,a.jsxs)("header",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-2",children:[(0,a.jsx)("h1",{className:"text-sm font-semibold",children:"편집기"}),(0,a.jsx)("nav",{"aria-label":"그래프 편집 모드",className:"flex gap-1",children:["workflow","harness"].map(s=>(0,a.jsx)("a",{href:"/app/editor/?mode=".concat(s),"aria-current":e===s?"page":void 0,className:"rounded px-3 py-1 text-xs ".concat(e===s?"bg-accent/15 text-text-primary":"text-text-tertiary hover:bg-surface-elevated"),children:"workflow"===s?"워크플로":"실행 그래프"},s))})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[s&&(0,a.jsx)(p,{palette:o,fallback:h}),"workflow"===e?(0,a.jsx)(i.N,{palette:o}):s?(0,a.jsx)(d.F,{palette:o}):(0,a.jsx)("p",{className:"p-4 text-sm text-text-tertiary",children:"Daemon 연결이 설정되지 않았습니다. Settings 에서 Base URL 을 입력하세요."})]})]})}function m(){return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)("p",{className:"p-4 text-sm",children:"편집기를 불러오는 중…"}),children:(0,a.jsx)(h,{})})}},93497:(e,s,r)=>{Promise.resolve().then(r.bind(r,11231))}},e=>{e.O(0,[6691,9100,9538,9656,8734,3992,9906,3869,8421,2548,6390,3170,7358],()=>e(e.s=93497)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[650],{1355:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>l,f6:()=>s,oD:()=>a});let n="elanous.daemon.sessionId";function s(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(n,e),e):localStorage.getItem(n)}();if(e)return e;let t=s();return localStorage.setItem(n,t),t}function l(){let e=s();return localStorage.setItem(n,e),e}},17437:(e,t,r)=>{Promise.resolve().then(r.bind(r,95653))},31594:(e,t,r)=>{"use strict";function n(e){return{slides:e.slides.map(e=>{let{image:t,caption:r,include:n}=e;return{image:t,caption:r,include:n}}),caption:{hook:e.caption.hook,body:e.caption.body},hashtags:[...e.hashtags],cover:{text:e.cover.text,sub:e.cover.sub},location:e.location}}r.d(t,{$Y:()=>l,LP:()=>c,Mz:()=>n,ll:()=>u,rH:()=>o});class s extends Error{constructor(e,t){super(t),this.status=e,this.name="GraphApprovalsApiError"}}let a={list:"목록을 보려면",decide:"승인하려면",save:"초안을 저장하려면"},l="/app/settings/#bearer-token";function o(e){return e instanceof s&&(401===e.status||403===e.status)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decide";return e instanceof s?401===e.status||403===e.status?"".concat(a[t]," 이 기기를 데몬에 연결해야 합니다 — 설정 › 데몬 연결 › 연결 토큰 칸에 토큰을 넣어 주세요."):404===e.status?"이 실행을 찾지 못했습니다. 목록을 다시 확인해 주세요.":409===e.status?"이미 결정된 실행입니다. 목록을 다시 확인해 주세요.":400===e.status?"결정 내용을 확인한 뒤 다시 시도해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요.":e instanceof TypeError?"서버에 연결하지 못했습니다. 연결 상태를 확인해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요."}let i="/v1/graph-approvals";function u(e){var t,r;let n=(null!=(t=e.baseUrl)?t:"").replace(/\/+$/,""),a=null!=(r=e.fetchImpl)?r:fetch;async function l(t,r){let l={...r,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},o=e.client?await e.client.fetchResponse(t,l):await a("".concat(n).concat(t),l),c=await o.json().catch(()=>null);if(!o.ok){let e=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:"request-failed";throw new s(o.status,e)}return c}return{list:()=>l(i),decide:(e,t,r)=>l("".concat(i,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)),{method:"POST",body:JSON.stringify({decision:r})}),saveFeedDraft:(e,t,r)=>l("".concat(i,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t),"/feed-draft"),{method:"PUT",body:JSON.stringify(r)}),feedMedia:async(t,r,l)=>{let o="".concat(i,"/").concat(encodeURIComponent(t),"/").concat(encodeURIComponent(r),"/media?path=").concat(encodeURIComponent(l)),c={headers:e.authHeader?{authorization:e.authHeader}:{}},u=e.client?await e.client.fetchResponse(o,c):await a("".concat(n).concat(o),c);if(!u.ok)throw new s(u.status,"media-failed");return u.blob()}}}},36581:(e,t,r)=>{"use strict";r.d(t,{C:()=>i,DaemonProvider:()=>u,Q:()=>d});var n=r(54456),s=r(60500),a=r(86704),l=r(1355),o=r(39906),c=r(50733);let i=(0,s.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,s.useState)(r),[m,p]=(0,s.useState)(""),[f]=(0,s.useState)(()=>new o.ki(r));(0,s.useEffect)(()=>{let e=(0,a.Fp)();d(e),f.updateConfig(e),p((0,l.oD)()),(0,c.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[f]),(0,s.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();f.updateConfig(t),d(t),(0,c.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&p(t=>t===e.newValue?t:((0,c.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[f]);let x=e=>{d(t=>{let r={...t,...e};return(0,a.Qc)(e),f.updateConfig(r),(0,c.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,c.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,s.useMemo)(()=>({config:u,setConfig:x,client:f,sessionId:m,setSessionId:h}),[u,f,m]);return(0,n.jsx)(i.Provider,{value:b,children:t})}function d(){let e=(0,s.useContext)(i);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},95653:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>f});var n=r(54456),s=r(60500),a=r(36581),l=r(31594);let o=e=>JSON.stringify([e.graphId,e.runId]);function c(e){let{client:t,approvals:r,onDecided:a,onPendingChange:c}=e,i=(0,s.useMemo)(()=>(0,l.ll)({client:t}),[t]),[u,d]=(0,s.useState)([]),[m,p]=(0,s.useState)({}),[f,x]=(0,s.useState)(null),[h,b]=(0,s.useState)(""),g=(0,s.useRef)(0),y=r.map(o).join("|");function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;d(e),c(r.filter(r=>!t[o(r)]&&e.some(e=>o(e)===o(r))).length)}async function j(e,t){let n=o(e);if(f||m[n]||!r.some(e=>o(e)===n)||!u.some(e=>o(e)===n))return;let s=g.current;x(n),b("");try{if(await i.decide(e.graphId,e.runId,t),g.current!==s)return;let r={...m,[n]:t};p(r),v(u,r),a();let l=await i.list();g.current===s&&v(l.items,r)}catch(e){g.current===s&&b((0,l.LP)(e,"decide"))}finally{g.current===s&&x(null)}}return((0,s.useEffect)(()=>{let e=++g.current;return(d([]),b(""),y)?(i.list().then(t=>{g.current===e&&v(t.items)}).catch(t=>{g.current===e&&b((0,l.LP)(t,"list"))}),()=>{g.current+=1}):(c(0),()=>{g.current+=1})},[i,y]),0===r.length)?null:(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"게시 승인"}),h&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h}),(0,n.jsx)("ul",{className:"space-y-2",children:r.map(e=>{let t=o(e),r=u.some(e=>o(e)===t);return(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,n.jsx)("p",{children:e.message}),m[t]?(0,n.jsx)("p",{className:"mt-2 text-muted-foreground",children:"approved"===m[t]?"승인됨":"보류됨"}):r?(0,n.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,n.jsx)("button",{type:"button",disabled:null!==f,onClick:()=>void j(e,"approved"),className:"rounded-lg bg-primary px-3 py-1 text-primary-foreground disabled:opacity-50",children:"승인"}),(0,n.jsx)("button",{type:"button",disabled:null!==f,onClick:()=>void j(e,"rejected"),className:"rounded-lg border border-border px-3 py-1 disabled:opacity-50",children:"보류"})]}):(0,n.jsx)("p",{className:"mt-2 text-muted-foreground",children:"대기 중인 승인이 아닙니다."})]},t)})})]})}let i={report:"보고서",pdf:"PDF",video:"영상",image:"그림",text:"글",link:"링크"};function u(e,t){if(e.startsWith("/v1/exec-requests/".concat(encodeURIComponent(t),"/files/")))return{url:e,daemonFile:!0};try{let t=new URL(e);if(("https:"===t.protocol||"http:"===t.protocol)&&!t.username&&!t.password)return{url:t.href,daemonFile:!1}}catch(e){}return null}function d(e){let{client:t,id:r,result:a}=e,[l,o]=(0,s.useState)(""),[c,d]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),f=u(a.url,r),x=a.title||i[a.kind],h=(null==f?void 0:f.daemonFile)&&("video"===a.kind||"image"===a.kind);if((0,s.useEffect)(()=>{let e;if(!h||!f)return;let r=!0;return p(null),o(""),t.fetchResponse(f.url).then(async t=>{if(!t.ok)throw Error("HTTP ".concat(t.status));let n=await t.blob();r&&p(e=URL.createObjectURL(n))}).catch(()=>{r&&o("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}),()=>{r=!1,e&&URL.revokeObjectURL(e)}},[t,h,null==f?void 0:f.url]),!f)return null;async function b(){if(!(null==f?void 0:f.daemonFile)||c)return;let e="pdf"===a.kind?window.open("","_blank"):null;if("pdf"===a.kind&&!e)return void o("결과 파일을 열지 못했습니다. 다시 시도해 주세요.");e&&(e.opener=null),d(!0),o("");try{let n=await t.fetchResponse(f.url);if(!n.ok)throw Error("HTTP ".concat(n.status));let s=URL.createObjectURL(await n.blob());if(e)e.closed?URL.revokeObjectURL(s):(e.location.replace(s),setTimeout(()=>URL.revokeObjectURL(s),6e4));else{var r;let e=document.createElement("a");e.href=s,e.download=decodeURIComponent(null!=(r=f.url.split("/").at(-1))?r:x),document.body.appendChild(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(s),6e4)}}catch(t){null==e||e.close(),o("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}finally{d(!1)}}return(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"font-medium",children:x}),m&&("video"===a.kind?(0,n.jsx)("video",{controls:!0,src:m,"aria-label":x,className:"mt-2 max-w-full"}):(0,n.jsx)("img",{src:m,alt:x,className:"mt-2 max-w-full"}))]}):f.daemonFile?(0,n.jsx)("button",{type:"button",onClick:()=>void b(),disabled:c,className:"font-medium text-primary underline underline-offset-4 disabled:opacity-50",children:c?"여는 중…":x}):(0,n.jsx)("a",{href:f.url,target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary underline underline-offset-4",children:x}),(0,n.jsxs)("span",{className:"ml-2 text-muted-foreground",children:[a.seat.toUpperCase()," \xb7 ",i[a.kind]]}),a.sources&&a.sources.length>0&&(0,n.jsx)("ul",{className:"mt-2 flex flex-wrap gap-2","aria-label":"출처",children:a.sources.slice(0,3).map((e,t)=>{let s=u(e.url,r);return s&&!s.daemonFile?(0,n.jsx)("li",{children:(0,n.jsx)("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-4",children:e.title})},"".concat(e.url,":").concat(t)):null})}),l&&(0,n.jsx)("p",{role:"alert",className:"mt-1 text-destructive",children:l})]})}function m(e){switch(e){case"planning":return"계획 중";case"running":return"진행 중";case"done":return"완료";case"failed":return"멈춤"}}function p(e){switch(e){case"waiting":return"대기";case"running":return"진행 중";case"done":return"완료";case"failed":return"못 함"}}function f(){var e,t,r,l;let{client:o}=(0,a.Q)(),[i,u]=(0,s.useState)(""),[f,x]=(0,s.useState)(!1),[h,b]=(0,s.useState)([]),[g,y]=(0,s.useState)(!1),[v,j]=(0,s.useState)(""),[N,w]=(0,s.useState)(""),[k,R]=(0,s.useState)(null),[S,U]=(0,s.useState)(null),[C,I]=(0,s.useState)(""),[E,L]=(0,s.useState)(0),[O,P]=(0,s.useState)(null),D=(0,s.useRef)(new Map),F=(0,s.useRef)(0),T=(0,s.useRef)(k);T.current=k;let _=(0,s.useRef)(null),H=(0,s.useRef)(0),M=h.some(e=>"planning"===e.status||"running"===e.status),q=null==(e=h.find(e=>e.id===k))?void 0:e.status,Y=(null==S?void 0:S.id)===k&&(null===O?S.approvals.length>0:O>0);(0,s.useEffect)(()=>{var e,t;return F.current+=1,H.current+=1,_.current=null,D.current=new Map,u(""),x(!1),b([]),y(!1),j(""),w(""),R(new URLSearchParams(null!=(t=null==(e=window.location)?void 0:e.search)?t:"").get("request")),U(null),I(""),P(null),()=>{F.current+=1}},[o]),(0,s.useEffect)(()=>{let e=!0,t=!1;async function r(){if(!t){t=!0;try{let t=await o.listExecRequests();if(!e)return;for(let e of t.items)D.current.delete(e.id);b([...D.current.values(),...t.items].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)||t.id.localeCompare(e.id))),j("")}catch(t){e&&j("맡긴 일을 읽지 못했습니다. 연결을 확인해 주세요.")}finally{t=!1,e&&y(!0)}}}r();let n=M?setInterval(()=>void r(),5e3):null;return()=>{e=!1,n&&clearInterval(n)}},[o,M]);let A=(0,s.useCallback)(async()=>{if(!k)return;let e=F.current,t=H.current,r="".concat(e,":").concat(t,":").concat(k);if(_.current!==r){_.current=r;try{let r=await o.getExecRequest(k);if(F.current!==e||H.current!==t||T.current!==k)return;U(r),I("")}catch(r){F.current===e&&H.current===t&&T.current===k&&I("상세를 읽지 못했습니다. 잠시 뒤 다시 시도해 주세요.")}finally{_.current===r&&(_.current=null)}}},[o,k]);async function V(e){e.preventDefault();let t=i.trim();if(!t||f)return;let r=F.current;x(!0),w("");try{let e=await o.submitExecRequest(t);if(F.current!==r)return;let n={id:e.id,text:t,createdAt:new Date().toISOString(),status:e.status,seats:[],resultCount:0};D.current.set(n.id,n),b(e=>[n,...e.filter(e=>e.id!==n.id)]),u("")}catch(e){F.current===r&&w("보내지 못했습니다. 연결을 확인하고 다시 시도해 주세요.")}finally{F.current===r&&x(!1)}}(0,s.useEffect)(()=>{k&&A()},[A,E]),(0,s.useEffect)(()=>{if(!k||"planning"!==q&&"running"!==q&&!Y)return;let e=setInterval(()=>void A(),5e3);return()=>clearInterval(e)},[k,q,Y,A]);let z=h.find(e=>e.id===k),J=(null==S?void 0:S.id)===k?S:null;return(0,n.jsxs)("main",{className:"mx-auto w-full max-w-2xl space-y-8 px-5 py-10 sm:py-14",children:[(0,n.jsxs)("section",{"aria-labelledby":"exec-compose",className:"space-y-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{id:"exec-compose",className:"text-2xl font-semibold tracking-tight",children:"COO 에게 맡기기"}),(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"할 일을 한 줄로 적어 보내세요. 자리별 진행과 결과를 여기서 볼 수 있습니다."})]}),(0,n.jsxs)("form",{onSubmit:V,className:"flex gap-2",children:[(0,n.jsx)("label",{htmlFor:"exec-text",className:"sr-only",children:"한 줄로 맡길 일"}),(0,n.jsx)("input",{id:"exec-text",name:"text",value:i,onChange:e=>u(e.target.value),placeholder:"한 줄로 맡길 일",className:"min-w-0 flex-1 rounded-lg border border-input bg-background px-3 py-2 text-sm"}),(0,n.jsx)("button",{type:"submit",disabled:!i.trim()||f,className:"rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground disabled:opacity-50",children:f?"보내는 중…":"보내기"})]}),N&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:N})]}),(0,n.jsxs)("section",{"aria-labelledby":"exec-list",className:"space-y-3",children:[(0,n.jsx)("h2",{id:"exec-list",className:"text-xl font-semibold",children:"맡긴 일"}),v&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:v}),!g&&0===h.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}),g&&0===h.length&&!v&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 맡긴 일이 없습니다."}),(0,n.jsx)("ul",{className:"space-y-2",children:h.map(e=>{var t;return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>{k!==e.id&&(H.current+=1,R(e.id),U(null),I(""),P(null))},"aria-expanded":k===e.id,className:"w-full rounded-xl border border-border bg-card p-4 text-left hover:border-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",children:[(0,n.jsxs)("span",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("span",{className:"min-w-0 truncate text-sm font-semibold",children:null!=(t=e.text.trim().split(/\r?\n/,1)[0])?t:""}),(0,n.jsx)("span",{className:"shrink-0 text-sm font-medium text-primary",children:m(e.status)})]}),e.seats.length>0&&(0,n.jsx)("span",{className:"mt-2 block truncate text-xs text-muted-foreground",children:e.seats.map(e=>"".concat(e.seat.toUpperCase()," ").concat(p(e.status))).join(" \xb7 ")}),e.resultCount>0&&(0,n.jsxs)("span",{className:"mt-1 block text-xs text-muted-foreground",children:["결과 ",e.resultCount,"개"]})]})},e.id)})})]}),k&&(0,n.jsxs)("section",{"aria-labelledby":"exec-detail",className:"space-y-5 rounded-xl border border-border bg-card p-5",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsx)("h2",{id:"exec-detail",className:"text-lg font-semibold",children:"맡긴 일 상세"}),(0,n.jsx)("button",{type:"button",onClick:()=>{H.current+=1,R(null),U(null),P(null)},className:"text-sm text-primary underline underline-offset-4",children:"닫기"})]}),(0,n.jsx)("p",{className:"whitespace-pre-wrap text-sm",children:null!=(t=null==J?void 0:J.text)?t:null==z?void 0:z.text}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:m(null!=(l=null!=(r=null==J?void 0:J.status)?r:null==z?void 0:z.status)?l:"planning")}),C&&(0,n.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:C}),!J&&!C&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"상세 불러오는 중…"}),J&&(0,n.jsxs)(n.Fragment,{children:[J.summary&&(0,n.jsx)("p",{className:"text-sm",children:J.summary}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"이렇게 나눠 맡겼습니다"}),0===J.seats.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"planning"===J.status?"COO 가 나누는 중입니다":"맡은 자리가 없습니다"}),(0,n.jsx)("ul",{className:"space-y-2",children:J.seats.map(e=>(0,n.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,n.jsxs)("span",{className:"font-semibold",children:[e.seat.toUpperCase()," \xb7 ",e.title]}),(0,n.jsx)("span",{className:"shrink-0 text-muted-foreground",children:p(e.status)})]}),"failed"===e.status&&e.reason&&(0,n.jsxs)("p",{className:"mt-2 text-destructive",children:["못 한 이유 \xb7 ",e.reason]})]},"".concat(e.seat,":").concat(e.title)))})]}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h3",{className:"font-semibold",children:"결과"}),0===J.results.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 결과가 없습니다."}),(0,n.jsx)("ul",{className:"space-y-2",children:J.results.map(e=>(0,n.jsx)(d,{client:o,id:J.id,result:e},e.url))})]}),(0,n.jsx)(c,{client:o,approvals:J.approvals,onDecided:()=>L(e=>e+1),onPendingChange:P},J.id)]})]})]})}}},e=>{e.O(0,[9906,6390,3170,7358],()=>e(e.s=17437)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[141],{1355:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>n,f6:()=>l,oD:()=>a});let s="elanous.daemon.sessionId";function l(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function a(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(s,e),e):localStorage.getItem(s)}();if(e)return e;let t=l();return localStorage.setItem(s,t),t}function n(){let e=l();return localStorage.setItem(s,e),e}},6230:(e,t,r)=>{Promise.resolve().then(r.bind(r,47258))},36581:(e,t,r)=>{"use strict";r.d(t,{C:()=>c,DaemonProvider:()=>u,Q:()=>d});var s=r(54456),l=r(60500),a=r(86704),n=r(1355),o=r(39906),i=r(50733);let c=(0,l.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,l.useState)(r),[m,f]=(0,l.useState)(""),[p]=(0,l.useState)(()=>new o.ki(r));(0,l.useEffect)(()=>{let e=(0,a.Fp)();d(e),p.updateConfig(e),f((0,n.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,l.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,a.Fp)();p.updateConfig(t),d(t),(0,i.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&f(t=>t===e.newValue?t:((0,i.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p]);let x=e=>{d(t=>{let r={...t,...e};return(0,a.Qc)(e),p.updateConfig(r),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},h=e=>{f(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,l.useMemo)(()=>({config:u,setConfig:x,client:p,sessionId:m,setSessionId:h}),[u,p,m]);return(0,s.jsx)(c.Provider,{value:b,children:t})}function d(){let e=(0,l.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},47258:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(54456),l=r(60500),a=r(36581);let n=/^[a-z0-9][a-z0-9._-]{0,63}$/;function o(e){var t,r,o;let{event:i,refreshKey:c=0}=e,{client:u}=(0,a.Q)(),[d,m]=(0,l.useState)(null),[f,p]=(0,l.useState)(null),x=(null==d?void 0:d.event)===i&&d.refreshKey===c?d:null,h=(null==f?void 0:f.event)===i&&f.refreshKey===c?f.message:"";return((0,l.useEffect)(()=>{let e;if(!n.test(i))return;let t=!0,r="";m(null),p(null);let s=e=>{t&&m(t=>(null==t?void 0:t.event)===i&&t.refreshKey===c?{...t,...e}:t)};async function l(e){try{let l=await u.fetchResponse(e);if(!l.ok)throw Error("HTTP ".concat(l.status));let a=await l.blob();if(!t)return;r=URL.createObjectURL(a),s({videoUrl:r})}catch(e){s({error:"영상을 열지 못했습니다: ".concat(String(e))})}}async function a(){try{let r=await u.fieldReelStatus(i);if(!t)return;s({reel:{status:r.state,url:r.url},reelError:"failed"===r.state?r.error:void 0,error:void 0}),"done"===r.state&&r.url?await l(r.url):"done"!==r.state&&"failed"!==r.state&&(e=setTimeout(a,5e3))}catch(r){s({error:"영상 상태를 읽지 못했습니다: ".concat(String(r))}),t&&(e=setTimeout(a,5e3))}}return u.fetchJson("/v1/field/uploads?event=".concat(encodeURIComponent(i))).then(e=>{t&&(m({...e,event:i,refreshKey:c}),e.reel&&("done"===e.reel.status&&e.reel.url?l(e.reel.url):a()))}).catch(e=>{t&&p({event:i,refreshKey:c,message:"폴더 상태를 읽지 못했습니다: ".concat(String(e))})}),()=>{t=!1,e&&clearTimeout(e),r&&URL.revokeObjectURL(r)}},[u,i,c]),n.test(i))?(0,s.jsxs)("section",{"aria-label":"행사 폴더 상태",className:"space-y-3 rounded-xl border border-border bg-card p-5",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:i}),h&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:h}),!x&&!h&&(0,s.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"폴더 상태를 읽는 중…"}),x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{className:"text-sm",children:["폴더에 ",x.count,"개 \xb7 영상 ",(null==(t=x.reel)?void 0:t.status)==="done"?"완료":(null==(r=x.reel)?void 0:r.status)==="failed"?"만들지 못함":x.reel?"만드는 중":"없음"]}),(null==(o=x.reel)?void 0:o.status)==="failed"&&x.reelError&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:x.reelError}),x.error&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:x.error}),x.videoUrl&&(0,s.jsx)("video",{controls:!0,playsInline:!0,src:x.videoUrl,className:"mx-auto aspect-[9/16] max-h-[70vh] w-full max-w-xs rounded-lg bg-black","aria-label":"현장 세로 영상"})]})]}):null}let i=/^[a-z0-9][a-z0-9._-]{0,63}$/;function c(){let{client:e}=(0,a.Q)(),[t,r]=(0,l.useState)(""),n=(0,l.useRef)(!1),[c,u]=(0,l.useState)([]),[d,m]=(0,l.useState)(null),f=(0,l.useRef)(null),[p,x]=(0,l.useState)(""),[h,b]=(0,l.useState)(!1),[v,g]=(0,l.useState)(0),[y,j]=(0,l.useState)(0),[w,N]=(0,l.useState)("");(0,l.useEffect)(()=>{let t=!0;return e.fieldDefaultEvent().then(e=>{let{defaultEvent:s}=e;t&&i.test(s)&&!n.current&&r(s)}).catch(e=>{t&&N("행사 폴더를 불러오지 못했습니다: ".concat(String(e)))}),()=>{t=!1}},[e]);let k=i.test(t),S=t&&k?"":"영문 소문자\xb7숫자로 시작하고 영문 소문자\xb7숫자\xb7점\xb7밑줄\xb7하이픈만 사용해 주세요 (최대 64자).";async function U(r){if(r.preventDefault(),!h){if(!k)return void N(S);if(!c.length)return void N("사진\xb7영상을 먼저 골라 주세요.");b(!0),g(0),N("");try{await e.uploadField(t,c,p,g),g(100),j(e=>e+1),u([]),m(null),f.current&&(f.current.value=""),x("")}catch(e){N("올리지 못했습니다: ".concat(e instanceof Error?e.message:String(e)))}finally{b(!1)}}}return(0,s.jsxs)("main",{className:"mx-auto w-full max-w-xl space-y-6 px-5 py-10 sm:py-16",children:[(0,s.jsxs)("header",{className:"space-y-2",children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:"현장 올리기"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"사진\xb7영상을 행사 폴더에 모으면 세로 영상이 만들어집니다."})]}),(0,s.jsxs)("form",{onSubmit:U,noValidate:!0,className:"space-y-5 rounded-xl border border-border bg-card p-5 sm:p-8",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-event",className:"block text-sm font-medium",children:"행사 폴더"}),(0,s.jsx)("input",{id:"field-event",name:"event",value:t,onChange:e=>{n.current=!0,r(e.target.value)},"aria-invalid":!k,"aria-describedby":k?void 0:"field-slug-error",autoCapitalize:"none",autoCorrect:"off",className:"w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-sm"}),!k&&(0,s.jsx)("p",{id:"field-slug-error",className:"text-sm text-destructive",children:S})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-files",className:"block text-sm font-medium",children:"사진\xb7영상 고르기"}),(0,s.jsx)("input",{ref:f,id:"field-files",name:"files",type:"file",multiple:!0,accept:"image/*,video/*",onChange:function(e){var t;let r=function(e){let t=[],r=0,s=0,l=0,a=0;for(let n of e){if(n.size>0x6400000){r+=1;continue}if(t.length>=20){l+=1;continue}if(a+n.size>262144e3){s+=1;continue}t.push(n),a+=n.size}let n=[r?"".concat(r,"개는 한 개가 100MB 를 넘습니다"):"",l?"".concat(l,"개는 한 번에 ").concat(20,"개를 넘습니다"):"",s?"".concat(s,"개는 합계 250MB 를 넘습니다"):""].filter(Boolean),o=r+l+s;return{kept:t,note:o?"".concat(o,"개는 빠집니다 — ").concat(n.join(" \xb7 ")):null}}(Array.from(null!=(t=e.target.files)?t:[]));u(r.kept),m(r.note),N("")},className:"block w-full rounded-md border border-input bg-background px-3 py-2 text-sm file:mr-3 file:rounded-md file:border-0 file:bg-primary file:px-3 file:py-1 file:text-primary-foreground"}),c.length>0&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:[c.length,"개 골랐습니다"]}),d&&(0,s.jsx)("p",{role:"status",className:"text-sm text-orange-600 dark:text-orange-400",children:d})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("label",{htmlFor:"field-caption",className:"block text-sm font-medium",children:"한 줄 설명(첫 장 자막 \xb7 선택)"}),(0,s.jsx)("input",{id:"field-caption",name:"caption",value:p,onChange:e=>x(e.target.value),className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm"})]}),w&&(0,s.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:w}),(0,s.jsx)("button",{type:"submit",disabled:h||!k||!c.length,className:"w-full rounded-md bg-primary px-4 py-2.5 text-sm font-medium text-primary-foreground disabled:cursor-not-allowed disabled:opacity-50",children:h?"올리는 중…":"올리기"}),h&&(0,s.jsxs)("div",{role:"status",className:"space-y-1 text-sm","aria-live":"polite",children:[(0,s.jsxs)("label",{htmlFor:"field-progress",children:["올리기 ",v,"%"]}),(0,s.jsx)("progress",{id:"field-progress",value:v,max:100,className:"w-full"})]})]}),k&&(0,s.jsx)(o,{event:t,refreshKey:y})]})}}},e=>{e.O(0,[9906,6390,3170,7358],()=>e(e.s=6230)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3787,6815,9492],{64144:()=>{}},_=>{_.O(0,[6390,3170,7358],()=>_(_.s=64144)),_N_E=_.O()}]);