elanous 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) 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/chunks/{280-f880696e14bc1032.js → 280-66f2ebc166517702.js} +1 -1
  4. package/apps/pwa/out/_next/static/chunks/{5359-11952bdf39bae0c7.js → 5359-7aa498ded308ea17.js} +1 -1
  5. package/apps/pwa/out/_next/static/chunks/app/approvals/{page-822c5395a88eb1e5.js → page-538c811d4da4d7b8.js} +1 -1
  6. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-32cb397d044bb5aa.js +1 -0
  7. package/apps/pwa/out/_next/static/chunks/app/board/page-02d148f66a3da6bb.js +1 -0
  8. package/apps/pwa/out/_next/static/chunks/app/botlab/page-42b7211f972c6001.js +1 -0
  9. package/apps/pwa/out/_next/static/chunks/app/bots/{page-d1cdb65c4ceb5c33.js → page-46bac74d4ce82733.js} +1 -1
  10. package/apps/pwa/out/_next/static/chunks/app/ceo/page-10e7ee66dc7c3d8a.js +1 -0
  11. package/apps/pwa/out/_next/static/chunks/app/chat/page-391a9ecbfb541e68.js +1 -0
  12. package/apps/pwa/out/_next/static/chunks/app/consult/{page-c5b8f3b77568a8e9.js → page-6b69baa42370ba35.js} +1 -1
  13. package/apps/pwa/out/_next/static/chunks/app/control/{page-77db1e47b120b94e.js → page-58960a34c0fa8f97.js} +1 -1
  14. package/apps/pwa/out/_next/static/chunks/app/decisions/{page-3048505d466ec98a.js → page-9b16ae10bbe63997.js} +1 -1
  15. package/apps/pwa/out/_next/static/chunks/app/design-check/page-417a7b86f7eceeea.js +1 -0
  16. package/apps/pwa/out/_next/static/chunks/app/editor/{page-6a36535d413596b1.js → page-09f86a64836617b7.js} +1 -1
  17. package/apps/pwa/out/_next/static/chunks/app/exec/page-cb640bac3150eb4c.js +1 -0
  18. package/apps/pwa/out/_next/static/chunks/app/field/page-e80fc997e0c589d5.js +1 -0
  19. package/apps/pwa/out/_next/static/chunks/app/inside/page-173d296c2127560a.js +1 -0
  20. package/apps/pwa/out/_next/static/chunks/app/intake/page-358c3e0c2ce7184c.js +1 -0
  21. package/apps/pwa/out/_next/static/chunks/app/{layout-956789c8340e289e.js → layout-09c6e6033ddb1605.js} +1 -1
  22. package/apps/pwa/out/_next/static/chunks/app/live/page-11a4763fe20fe116.js +1 -0
  23. package/apps/pwa/out/_next/static/chunks/app/live-run/page-e7e02e459ca54062.js +1 -0
  24. package/apps/pwa/out/_next/static/chunks/app/loops/{page-e911bcd2bfb5c305.js → page-b0c21fcb45c049d0.js} +1 -1
  25. package/apps/pwa/out/_next/static/chunks/app/market/{page-52b55f54c9d8e0fb.js → page-f331955e0ca9bf84.js} +1 -1
  26. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-c4c4b4333b24e505.js +1 -0
  27. package/apps/pwa/out/_next/static/chunks/app/morning/{page-afa5068541a55cd1.js → page-7cab7257602fe967.js} +1 -1
  28. package/apps/pwa/out/_next/static/chunks/app/{not-found-3eb72a4f6788a903.js → not-found-a0dc43b385fba1b5.js} +1 -1
  29. package/apps/pwa/out/_next/static/chunks/app/observatory/page-65ecf674fc5e9d19.js +1 -0
  30. package/apps/pwa/out/_next/static/chunks/app/ops/checklist/{page-c9e4ca5025534239.js → page-d34cea406f837407.js} +1 -1
  31. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-7d69cc10c33882b7.js +1 -0
  32. package/apps/pwa/out/_next/static/chunks/app/ops/resources/{page-da8f855dc25cae3d.js → page-c2b69a4da710ccee.js} +1 -1
  33. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-80adac335abc5070.js +1 -0
  34. package/apps/pwa/out/_next/static/chunks/app/outputs/page-10b7dbd205510a67.js +1 -0
  35. package/apps/pwa/out/_next/static/chunks/app/{page-f95beb047d743d09.js → page-5f3c9b795a225d8c.js} +1 -1
  36. package/apps/pwa/out/_next/static/chunks/app/reflection/{page-3b0434a6fc1154e1.js → page-68ece02272941b6c.js} +1 -1
  37. package/apps/pwa/out/_next/static/chunks/app/scheduler/{page-9deae0524ce7a7e2.js → page-21d4e1472f806b1e.js} +1 -1
  38. package/apps/pwa/out/_next/static/chunks/app/sessions/{page-4f4f0858754f73a4.js → page-1156870631db0555.js} +1 -1
  39. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-4fc726c790e6a7bf.js +1 -0
  40. package/apps/pwa/out/_next/static/chunks/app/settings/page-e0dc9ec9ac537906.js +1 -0
  41. package/apps/pwa/out/_next/static/chunks/app/setup/done/{page-2e8cc4d212f1ca01.js → page-83138c236444d7d5.js} +1 -1
  42. package/apps/pwa/out/_next/static/chunks/app/setup/page-61133c103b342d2b.js +1 -0
  43. package/apps/pwa/out/_next/static/chunks/app/share/{page-b8c0c73c2e5a8917.js → page-40cac04d8f4822c6.js} +1 -1
  44. package/apps/pwa/out/_next/static/chunks/app/showroom/page-ecb7be39ce14845a.js +1 -0
  45. package/apps/pwa/out/_next/static/chunks/app/tasks/{page-aedaede687cc293d.js → page-a288059ee8ed73fb.js} +1 -1
  46. package/apps/pwa/out/_next/static/chunks/app/term/{page-bb5c95ce68358be2.js → page-31ed388024d4f660.js} +1 -1
  47. package/apps/pwa/out/_next/static/chunks/app/today/page-29d28b05a7ddede3.js +1 -0
  48. package/apps/pwa/out/_next/static/chunks/app/trace/page-b39bdb4ce095ccfc.js +1 -0
  49. package/apps/pwa/out/_next/static/chunks/app/vault/{page-9a1cdd7c5a50bf73.js → page-ecbc7b9f31d195b7.js} +1 -1
  50. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-059b94e88f91e73f.js +1 -0
  51. package/apps/pwa/out/_next/static/chunks/app/workflows/page-ca29c405228c72b9.js +1 -0
  52. package/apps/pwa/out/_next/static/chunks/app/workspace/page-ff99da4e3ff50503.js +1 -0
  53. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-2aa0c6cdb2ef7ea8.js +1 -0
  54. package/apps/pwa/out/approvals/index.html +1 -1
  55. package/apps/pwa/out/approvals/index.txt +13 -13
  56. package/apps/pwa/out/autopilot/index.html +1 -1
  57. package/apps/pwa/out/autopilot/index.txt +13 -13
  58. package/apps/pwa/out/board/index.html +1 -1
  59. package/apps/pwa/out/board/index.txt +13 -13
  60. package/apps/pwa/out/botlab/index.html +1 -1
  61. package/apps/pwa/out/botlab/index.txt +13 -13
  62. package/apps/pwa/out/bots/index.html +1 -1
  63. package/apps/pwa/out/bots/index.txt +13 -13
  64. package/apps/pwa/out/ceo/index.html +1 -1
  65. package/apps/pwa/out/ceo/index.txt +13 -13
  66. package/apps/pwa/out/chat/index.html +1 -1
  67. package/apps/pwa/out/chat/index.txt +13 -13
  68. package/apps/pwa/out/consult/index.html +1 -1
  69. package/apps/pwa/out/consult/index.txt +13 -13
  70. package/apps/pwa/out/control/index.html +1 -1
  71. package/apps/pwa/out/control/index.txt +13 -13
  72. package/apps/pwa/out/decisions/index.html +1 -1
  73. package/apps/pwa/out/decisions/index.txt +13 -13
  74. package/apps/pwa/out/design-check/index.html +1 -1
  75. package/apps/pwa/out/design-check/index.txt +13 -13
  76. package/apps/pwa/out/editor/index.html +1 -1
  77. package/apps/pwa/out/editor/index.txt +13 -13
  78. package/apps/pwa/out/exec/index.html +1 -1
  79. package/apps/pwa/out/exec/index.txt +13 -13
  80. package/apps/pwa/out/field/index.html +1 -1
  81. package/apps/pwa/out/field/index.txt +13 -13
  82. package/apps/pwa/out/healthz +1 -1
  83. package/apps/pwa/out/index.html +1 -1
  84. package/apps/pwa/out/index.txt +13 -13
  85. package/apps/pwa/out/inside/index.html +1 -1
  86. package/apps/pwa/out/inside/index.txt +13 -13
  87. package/apps/pwa/out/intake/index.html +1 -1
  88. package/apps/pwa/out/intake/index.txt +13 -13
  89. package/apps/pwa/out/live/index.html +1 -1
  90. package/apps/pwa/out/live/index.txt +13 -13
  91. package/apps/pwa/out/live-run/index.html +1 -1
  92. package/apps/pwa/out/live-run/index.txt +13 -13
  93. package/apps/pwa/out/loops/index.html +1 -1
  94. package/apps/pwa/out/loops/index.txt +13 -13
  95. package/apps/pwa/out/market/index.html +1 -1
  96. package/apps/pwa/out/market/index.txt +13 -13
  97. package/apps/pwa/out/missions/placeholder/index.html +1 -1
  98. package/apps/pwa/out/missions/placeholder/index.txt +13 -13
  99. package/apps/pwa/out/morning/index.html +1 -1
  100. package/apps/pwa/out/morning/index.txt +13 -13
  101. package/apps/pwa/out/observatory/index.html +1 -1
  102. package/apps/pwa/out/observatory/index.txt +13 -13
  103. package/apps/pwa/out/ops/checklist/index.html +1 -1
  104. package/apps/pwa/out/ops/checklist/index.txt +13 -13
  105. package/apps/pwa/out/ops/release/index.html +1 -1
  106. package/apps/pwa/out/ops/release/index.txt +13 -13
  107. package/apps/pwa/out/ops/resources/index.html +1 -1
  108. package/apps/pwa/out/ops/resources/index.txt +13 -13
  109. package/apps/pwa/out/ops/seats/index.html +1 -1
  110. package/apps/pwa/out/ops/seats/index.txt +13 -13
  111. package/apps/pwa/out/outputs/index.html +1 -1
  112. package/apps/pwa/out/outputs/index.txt +13 -13
  113. package/apps/pwa/out/reflection/index.html +1 -1
  114. package/apps/pwa/out/reflection/index.txt +14 -14
  115. package/apps/pwa/out/scheduler/index.html +1 -1
  116. package/apps/pwa/out/scheduler/index.txt +13 -13
  117. package/apps/pwa/out/sessions/index.html +1 -1
  118. package/apps/pwa/out/sessions/index.txt +13 -13
  119. package/apps/pwa/out/settings/devices/index.html +1 -1
  120. package/apps/pwa/out/settings/devices/index.txt +13 -13
  121. package/apps/pwa/out/settings/index.html +1 -1
  122. package/apps/pwa/out/settings/index.txt +13 -13
  123. package/apps/pwa/out/setup/done/index.html +1 -1
  124. package/apps/pwa/out/setup/done/index.txt +13 -13
  125. package/apps/pwa/out/setup/index.html +1 -1
  126. package/apps/pwa/out/setup/index.txt +13 -13
  127. package/apps/pwa/out/share/index.html +1 -1
  128. package/apps/pwa/out/share/index.txt +13 -13
  129. package/apps/pwa/out/showroom/index.html +1 -1
  130. package/apps/pwa/out/showroom/index.txt +13 -13
  131. package/apps/pwa/out/tasks/index.html +1 -1
  132. package/apps/pwa/out/tasks/index.txt +13 -13
  133. package/apps/pwa/out/term/index.html +1 -1
  134. package/apps/pwa/out/term/index.txt +13 -13
  135. package/apps/pwa/out/today/index.html +1 -1
  136. package/apps/pwa/out/today/index.txt +13 -13
  137. package/apps/pwa/out/trace/index.html +1 -1
  138. package/apps/pwa/out/trace/index.txt +13 -13
  139. package/apps/pwa/out/vault/index.html +1 -1
  140. package/apps/pwa/out/vault/index.txt +13 -13
  141. package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
  142. package/apps/pwa/out/workflows/chat-ui/index.txt +13 -13
  143. package/apps/pwa/out/workflows/index.html +1 -1
  144. package/apps/pwa/out/workflows/index.txt +13 -13
  145. package/apps/pwa/out/workspace/index.html +1 -1
  146. package/apps/pwa/out/workspace/index.txt +13 -13
  147. package/apps/pwa/out/worktrees/index.html +1 -1
  148. package/apps/pwa/out/worktrees/index.txt +13 -13
  149. package/graphs/natural-language-research.yaml +38 -0
  150. package/package.json +1 -1
  151. package/personas/botlab-4.yaml +8 -0
  152. package/src/acp/core-turn-bridge.ts +5 -0
  153. package/src/auto-research/research-turn.ts +120 -5
  154. package/src/cli/intake-source-cli.ts +9 -4
  155. package/src/cli/release-cli.ts +7 -2
  156. package/src/cli/setup-cli.ts +2 -2
  157. package/src/cli/setup-keys.ts +8 -5
  158. package/src/core-turn/run-core-turn.ts +93 -14
  159. package/src/dashboard/first-screen-band.ts +2 -6
  160. package/src/dashboard/index.ts +41 -13
  161. package/src/dashboard/plugin-wizard-runtime.ts +15 -1
  162. package/src/dashboard/plugin-wizard-tool.ts +16 -2
  163. package/src/dashboard/turn-preamble.ts +8 -0
  164. package/src/index.ts +26 -0
  165. package/src/intake-plane/actions.ts +20 -12
  166. package/src/intake-plane/intake-sources.ts +32 -11
  167. package/src/intake-plane/items.ts +1 -1
  168. package/src/mcp/server.ts +7 -2
  169. package/src/native-tool-catalog.ts +3 -0
  170. package/src/nexus/api/harness-api.ts +17 -2
  171. package/src/nexus/api/harness-traversal.ts +14 -4
  172. package/src/nexus/api/meta-api.ts +3 -1
  173. package/src/nexus/api/research-run-observer.ts +59 -0
  174. package/src/onboarding/first-run-doctor-test-control.ts +42 -0
  175. package/src/onboarding/first-run-doctor.ts +1 -0
  176. package/src/plugins/core/host.ts +12 -0
  177. package/src/prompt-library/session-guidance.ts +7 -6
  178. package/src/self-implement/orchestrator.ts +13 -0
  179. package/src/self-implement/run-ledger.ts +1 -1
  180. package/src/self-implement/run-step-projection.ts +10 -2
  181. package/src/session/chat.ts +2 -0
  182. package/src/session-runtime/index.ts +47 -5
  183. package/src/setup/service-key-catalog.ts +4 -2
  184. package/src/setup/service-keys.ts +34 -10
  185. package/src/terminal/coding-agent.ts +12 -1
  186. package/src/tool-hints/gate.ts +7 -3
  187. package/src/tool-hints/signals.ts +43 -1
  188. package/src/tool-runtime/browser-hand-runtime.ts +19 -9
  189. package/src/tool-runtime/elanous-linear-issue-runtime.ts +13 -3
  190. package/src/tui.ts +97 -4
  191. package/src/ux-sim/classic-tui-seat-scenarios.ts +54 -4
  192. package/src/ux-sim/mock-scenario-catalog.json +8 -3
  193. package/src/version/packed-revision.json +1 -1
  194. package/apps/pwa/out/_next/static/chunks/app/autopilot/page-9d7432ad7cb155ce.js +0 -1
  195. package/apps/pwa/out/_next/static/chunks/app/board/page-26941f067e899ed3.js +0 -1
  196. package/apps/pwa/out/_next/static/chunks/app/botlab/page-3c29b0e0d681e33d.js +0 -1
  197. package/apps/pwa/out/_next/static/chunks/app/ceo/page-1224ce11e2a2eef5.js +0 -1
  198. package/apps/pwa/out/_next/static/chunks/app/chat/page-940b44876305fac2.js +0 -1
  199. package/apps/pwa/out/_next/static/chunks/app/design-check/page-8d97da172a2cd552.js +0 -1
  200. package/apps/pwa/out/_next/static/chunks/app/exec/page-8696a777c88bacc2.js +0 -1
  201. package/apps/pwa/out/_next/static/chunks/app/field/page-c4f1095489266f97.js +0 -1
  202. package/apps/pwa/out/_next/static/chunks/app/inside/page-ea374796ca2317b9.js +0 -1
  203. package/apps/pwa/out/_next/static/chunks/app/intake/page-111a4245428caa84.js +0 -1
  204. package/apps/pwa/out/_next/static/chunks/app/live/page-7645ef6d17d2314b.js +0 -1
  205. package/apps/pwa/out/_next/static/chunks/app/live-run/page-3448160192777209.js +0 -1
  206. package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-6a904a7d1b3aee11.js +0 -1
  207. package/apps/pwa/out/_next/static/chunks/app/observatory/page-527a398eac0b4699.js +0 -1
  208. package/apps/pwa/out/_next/static/chunks/app/ops/release/page-63c8938149254e9d.js +0 -1
  209. package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-f48403ffee4c4b77.js +0 -1
  210. package/apps/pwa/out/_next/static/chunks/app/outputs/page-905013106f55daad.js +0 -1
  211. package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-73857fa536e7c832.js +0 -1
  212. package/apps/pwa/out/_next/static/chunks/app/settings/page-c0bdee145df0f6c9.js +0 -1
  213. package/apps/pwa/out/_next/static/chunks/app/setup/page-fe67b4e66f496b3a.js +0 -1
  214. package/apps/pwa/out/_next/static/chunks/app/showroom/page-2e8ed69b1a70c746.js +0 -1
  215. package/apps/pwa/out/_next/static/chunks/app/today/page-c6b096777f73c43a.js +0 -1
  216. package/apps/pwa/out/_next/static/chunks/app/trace/page-45967d78c1748112.js +0 -1
  217. package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-c54c8b957ebf94e2.js +0 -1
  218. package/apps/pwa/out/_next/static/chunks/app/workflows/page-9dc19aee0932542a.js +0 -1
  219. package/apps/pwa/out/_next/static/chunks/app/workspace/page-8f291522cb3d91a6.js +0 -1
  220. package/apps/pwa/out/_next/static/chunks/app/worktrees/page-52b36e1c8acd087f.js +0 -1
  221. /package/apps/pwa/out/_next/static/{5URFQKPO21SIgTlLvb1Jv → v4GHQkFrQs8lzZY_KFv9_}/_buildManifest.js +0 -0
  222. /package/apps/pwa/out/_next/static/{5URFQKPO21SIgTlLvb1Jv → v4GHQkFrQs8lzZY_KFv9_}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2922],{273:(e,t,n)=>{"use strict";n.d(t,{cn:()=>a});var r=n(86922),s=n(34558);function a(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,s.QP)((0,r.$)(t))}},6071:(e,t,n)=>{Promise.resolve().then(n.bind(n,80020))},15249:(e,t,n)=>{"use strict";n.d(t,{Zr:()=>i,f6:()=>s,oD:()=>a});let r="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(r,e),e):localStorage.getItem(r)}();if(e)return e;let t=s();return localStorage.setItem(r,t),t}function i(){let e=s();return localStorage.setItem(r,e),e}},49620:(e,t,n)=>{"use strict";n.d(t,{r:()=>o});var r=n(17594),s=n(51596),a=n.n(s);let i=[{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 o(e){let{active:t}=e;return(0,r.jsxs)("nav",{"aria-label":"Mission Fabric 파이프라인","data-testid":"fabric-stage-header",className:"flex flex-wrap items-center gap-1 text-xs",children:[(0,r.jsx)("span",{className:"mr-1 text-muted-foreground",children:"Missions"}),i.map((e,n)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.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,r.jsx)("span",{className:"mr-1",children:e.num}),e.label,(0,r.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:e.sub})]}),n<i.length-1&&(0,r.jsx)("span",{className:"text-muted-foreground/50","aria-hidden":!0,children:"→"})]},e.key))]})}},53974:(e,t,n)=>{"use strict";async function r(e){let t=await e.fetchResponse("/v1/ops-board/notices");if(!t.ok)throw Error("notices list failed: ".concat(t.status));return(await t.json()).notices}async function s(e,t,n){let r=await e.fetchResponse("/v1/ops-board/notices",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({noticeId:t,body:n})});if(!r.ok)throw Error("notice reply failed: ".concat(r.status));return(await r.json()).reply}async function a(e){let t=await e.fetchResponse("/v1/decisions?status=open");if(!t.ok)throw Error("decisions list failed: ".concat(t.status));return(await t.json()).decisions}async function i(e,t,n,r){let s=await e.fetchResponse("/v1/decisions/".concat(encodeURIComponent(t),"/decide"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({choice:n,...void 0===r?{}:{note:r}})});if(!s.ok)throw Error("decision failed: ".concat(s.status));return s.json()}n.d(t,{LD:()=>i,aj:()=>s,kh:()=>r,qK:()=>a})},58274:(e,t,n)=>{"use strict";n.d(t,{$:()=>l});var r=n(17594),s=n(39515),a=n(34796),i=n(273);let o=(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 l(e){let{className:t,variant:n="default",size:a="default",...l}=e;return(0,r.jsx)(s.$,{"data-slot":"button",className:(0,i.cn)(o({variant:n,size:a,className:t})),...l})}},80020:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>I});var r=n(17594),s=n(48082),a=n(87691),i=n(58274);let o=["dig","backtest","trade","retro","replay","delegate","autopilot"],l={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 d(e){let{api:t}=e,[n,a]=(0,s.useState)([]),[d,c]=(0,s.useState)(null),[u,m]=(0,s.useState)(!0),x=(0,s.useCallback)(async()=>{m(!0);try{var e;let n=await t.autonomy(80,null!=d?d:void 0);a(null!=(e=n.actions)?e:[])}catch(e){}finally{m(!1)}},[t,d]);return(0,s.useEffect)(()=>{x()},[x]),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)("button",{type:"button",onClick:()=>c(null),className:["rounded px-2 py-0.5 text-xs ring-1",null===d?"bg-primary/20 text-foreground ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:"전체"}),o.map(e=>{var t;return(0,r.jsx)("button",{type:"button",onClick:()=>c(e),className:["rounded px-2 py-0.5 text-xs ring-1",d===e?null!=(t=l[e])?t:"bg-primary/20 ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:e},e)}),(0,r.jsx)(i.$,{size:"sm",variant:"outline",className:"ml-auto",onClick:()=>void x(),children:"새로고침"})]}),u?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}):0===n.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 기록된 자율행동이 없습니다. 자율루프가 돌면 여기에 “무엇을 왜 했나”가 쌓입니다."}):(0,r.jsx)("ul",{className:"space-y-2",children:n.map((e,t)=>{var n;return(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-card/50 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:["rounded px-2 py-0.5 text-xs ring-1",null!=(n=l[e.loop])?n:"bg-muted text-muted-foreground ring-border"].join(" "),children:e.loop}),(0,r.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,r.jsx)("span",{className:"rounded bg-rose-500/15 px-1.5 text-[10px] text-rose-300 ring-1 ring-rose-500/30",children:"중요"})]}),(0,r.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 c=n(51596),u=n.n(c),m=n(87442);let x=new Set(["done","failed","disarmed","rejected","completed","cancelled"]);function p(e){return x.has(null!=e?e:"")}function g(){return"갱신이 ".concat(14,"일 넘게 없으면 \xab멈춤\xbb으로 본다 — 마지막 갱신 이후 진행 흔적이 없다는 뜻이다.")}function h(e){return null==e?"파생 미측정":"파생 ".concat(e.total)}let b={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:"대기"}},f={cron:"크론",task:"태스크",action:"자율행동"};function v(e){var t;let{counts:n,total:s}=e,a=Object.entries(null!=n?n:{}).filter(e=>{let[,t]=e;return t>0});if(!s||0===s)return(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"태스크 0"});let i=null!=(t=null==n?void 0:n.done)?t:0;return(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["태스크 ",i,"/",s]}),a.map(e=>{let[t,n]=e;return(0,r.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[t,":",n]},t)})]})}function y(e){let{r:t}=e;if(!t||0===t.total)return(0,r.jsx)("span",{className:"text-xs text-muted-foreground",...t?{}:{title:"서버가 파생 롤업을 싣지 않았다 — \xab파생 0\xbb이 아니라 \xab못 잰\xbb 값이다(구 서버 \xb7 집계 실패)."},children:h(t)});let n=(e,t)=>e>0?(0,r.jsxs)("span",{className:["text-xs",b[t].tone].join(" "),children:[b[t].icon,e]},t):null;return(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:h(t)}),n(t.ok,"ok"),n(t.stale,"stale"),n(t.error,"error"),n(t.active,"active"),n(t.pending,"pending")]})}function j(e){let{api:t,m:n,onDone:a}=e,o="scheduler"===n.model,l="task"===n.model,[d,c]=(0,s.useState)(""),[u,m]=(0,s.useState)(""),[x,p]=(0,s.useState)(""),[g,h]=(0,s.useState)(null),[b,f]=(0,s.useState)(null);if(!o&&!l)return(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["이 실행모델(",n.model,")은 지속 잡을 만들지 않아 구체화 대상이 아닙니다."]});let v=async e=>{h(e),f(null);let r=o?{command:d.trim(),...u.trim()?{cron:u.trim()}:{}}:{...x.trim()?{prompt:x.trim()}:{}};try{let i=await t.missionAction(n.id,e,r);if(i.error)f("오류: ".concat(i.error));else{var s;f("arm"===e?"승인\xb7arming ON 시 자동 실행":"구체화 완료(".concat(null!=(s=i.engine)?s:"",")")),a()}}catch(e){f(e instanceof Error?e.message:String(e))}finally{h(null)}};return(0,r.jsxs)("div",{className:"mt-3 space-y-2 rounded-md border border-border bg-background/50 p-2.5",children:[o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.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,r.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"})]}),l&&(0,r.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,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.$,{size:"sm",disabled:!!g||o&&!d.trim(),onClick:()=>void v("materialize"),children:"materialize"===g?"…":"지금 구체화"}),(0,r.jsx)(i.$,{size:"sm",variant:"outline",disabled:!!g||o&&!d.trim(),onClick:()=>void v("arm"),children:"arm"===g?"…":"승인(arm)"}),b&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:b})]})]})}function N(e){let{api:t,m:n,onMutate:a}=e,o=!1===n.isAutopilot,[l,d]=(0,s.useState)(!1),[c,x]=(0,s.useState)(null),[h,N]=(0,s.useState)(!1),k=n.model?m.NE[n.model]:null,w=function(e,t,n){var r;if(void 0===e||!Number.isFinite(e)||!Number.isFinite(t))return null;let s=new Date(e);if(!Number.isFinite(s.getTime()))return null;let a=new Intl.DateTimeFormat("en-CA",{timeZone:null==n?void 0:n.timeZone,year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(s),i=e=>{var t;return null==(t=a.find(t=>t.type===e))?void 0:t.value},o="".concat(i("year"),"-").concat(i("month"),"-").concat(i("day")),l=Math.floor((t-e)/864e5);return{stale:!p(null==n?void 0:n.status)&&l>=(null!=(r=null==n?void 0:n.thresholdDays)?r:14),days:l,lastUpdated:o}}(n.updatedAt,Date.now(),{status:n.status}),S=(null==w?void 0:w.stale)?w:null,[C,z]=(0,s.useState)(!1),A=(0,s.useCallback)(async()=>{N(!0);try{x(await t.trace(n.id))}catch(e){}finally{N(!1)}},[t,n.id]),[E,D]=(0,s.useState)(!1),[I,O]=(0,s.useState)(!1),[P,U]=(0,s.useState)(null),M=!o&&"proposed"===n.status,T=(0,s.useCallback)(async()=>{let e=!l;d(e),!e||c||o||await A()},[l,c,A,o]),$=(0,s.useCallback)(async()=>{D(!0),U(null);try{await t.missionAction(n.id,"cancel"),z(!1),await A(),a()}catch(e){}finally{D(!1)}},[t,n.id,A,a]),J=(0,s.useCallback)(async()=>{O(!0),U(null);try{var e;let r=await t.missionAction(n.id,"approve");r.error?U("오류: ".concat(r.error)):U("✅ 승인 — 태스크 ".concat(null!=(e=r.activated)?e:0,"건 실행 시작(ready). 미션 running.")),await A()}catch(e){U(e instanceof Error?e.message:String(e))}finally{O(!1)}},[t,n.id,A]);return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card/50",children:[(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>void T(),className:"flex min-w-0 flex-1 items-start gap-3 p-3 text-left",children:[(0,r.jsx)("span",{className:"mt-0.5 text-muted-foreground",children:l?"▾":"▸"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[o?(0,r.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"}):k&&(0,r.jsx)("span",{className:["rounded px-2 py-0.5 text-xs font-medium ring-1",k.tone].join(" "),children:k.label}),!o&&"continuous"===n.kind&&(0,r.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:"상시"}),!o&&"finite"===n.kind&&(0,r.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,r.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground ring-1 ring-border",children:n.source}),M?(0,r.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,r.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[11px] text-muted-foreground ring-1 ring-border",children:n.status}),n.reviewDue&&(0,r.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일+ 리뷰"}),o?(0,r.jsx)(v,{counts:n.taskCounts,total:n.taskCount}):(0,r.jsx)(y,{r:n.derived}),S&&(0,r.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/30",title:g(),children:"".concat(S.days,"일 멈춤 \xb7 마지막 갱신 ").concat(S.lastUpdated)})]}),(0,r.jsx)("p",{className:"truncate text-sm text-foreground/90",children:n.goal}),(0,r.jsx)("p",{className:"font-mono text-[10px] text-muted-foreground",children:n.id})]})]}),S&&!o&&(0,r.jsxs)("div",{className:"mr-3 mt-3 flex shrink-0 flex-col items-end gap-1.5",children:[(0,r.jsx)(i.$,{size:"sm",variant:"outline",disabled:E,onClick:()=>z(e=>!e),"aria-expanded":C,"aria-controls":"mission-close-confirm-".concat(n.id),className:"border-amber-500/40 text-amber-300 hover:text-amber-200",children:E?"종료 중…":"닫기 제안"}),C&&(0,r.jsxs)("div",{id:"mission-close-confirm-".concat(n.id),role:"group","aria-label":"미션 종료 확인",className:"w-60 space-y-1.5 rounded-md border border-amber-500/40 bg-amber-500/5 p-2",children:[(0,r.jsx)("p",{className:"text-[11px] leading-snug text-amber-200/90",children:g()}),(0,r.jsxs)("p",{className:"text-[11px] leading-snug text-muted-foreground",children:[S.days,"일째 갱신 없음 \xb7 파생 잡까지 release 되며 되돌릴 수 없다."]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,r.jsx)(i.$,{size:"sm",variant:"ghost",disabled:E,className:"h-7 px-2 text-[11px] text-muted-foreground",onClick:()=>z(!1),children:"취소"}),(0,r.jsx)(i.$,{size:"sm",variant:"outline",disabled:E,className:"h-7 border-rose-500/50 px-2 text-[11px] text-rose-300 hover:text-rose-200",onClick:()=>void $(),children:E?"종료 중…":"종료 확인"})]})]})]}),S&&o&&(0,r.jsxs)("div",{className:"mr-3 mt-3 flex shrink-0 flex-col items-end gap-1.5",children:[(0,r.jsx)(u(),{href:"/tasks",title:"".concat(S.days,"일째 갱신 없음 \xb7 ").concat(g()),className:"inline-flex h-8 items-center rounded-md border border-amber-500/40 px-3 text-xs font-medium text-amber-300 hover:text-amber-200",children:"닫기 제안 — 작업 보드"}),(0,r.jsxs)("span",{className:"max-w-[15rem] text-right text-[11px] leading-snug text-muted-foreground",children:[S.days,"일째 갱신 없음 \xb7 사람 미션은 작업 보드에서 닫습니다"]})]})]}),l&&o&&(0,r.jsxs)("div",{className:"border-t border-border px-4 py-3 space-y-2",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"사람이 Intake 로 만든 미션입니다. 실행은 Task 보드에서 진행됩니다."}),(0,r.jsx)(v,{counts:n.taskCounts,total:n.taskCount}),(0,r.jsx)(u(),{href:"/tasks",className:"inline-block text-xs text-primary hover:underline",children:"② 작업 보드에서 보기 →"})]}),l&&!o&&(0,r.jsxs)("div",{className:"border-t border-border px-4 py-3",children:[M&&(0,r.jsxs)("div",{className:"mb-3 space-y-2 rounded-md border border-amber-500/30 bg-amber-500/5 p-3",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-amber-200",children:"자동 분해 완료 \xb7 승인 대기"}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["골을 태스크로 자동 구체화했습니다(아직 ",(0,r.jsx)("b",{children:"실행 안 함"}),"). 승인하면 실행이 시작됩니다.","scheduler"===n.model&&" 반복 스케줄은 승인 후 배선됩니다."]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(i.$,{size:"sm",disabled:I||E,onClick:()=>void J(),children:I?"승인 중…":"✅ 승인(실행 시작)"}),(0,r.jsx)(i.$,{size:"sm",variant:"ghost",disabled:I||E,onClick:()=>void $(),className:"text-rose-400 hover:text-rose-300",children:E?"거절 중…":"거절"}),P&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:P})]})]}),h&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"계보 조회 중…"}),c&&0===c.derived.length&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:c.note}),c&&(0,m.on)(c.derived)&&(0,r.jsxs)(u(),{href:(0,m.on)(c.derived),className:"mb-2 inline-block text-xs text-primary hover:underline","data-mission-schedules":!0,children:["이 미션을 부르는 스케줄 ",c.derived.filter(e=>"cron"===e.kind&&e.id).length," →"]}),c&&c.derived.length>0&&(0,r.jsx)("ul",{className:"space-y-1.5",children:c.derived.map((e,t)=>{let n=b[e.status];return(0,r.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,r.jsx)("span",{className:n.tone,children:n.icon}),(0,r.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground ring-1 ring-border",children:f[e.kind]}),(0,r.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,r.jsx)("span",{className:"text-foreground/90",children:e.name}),e.detail&&(0,r.jsx)("span",{className:"ml-2 text-xs text-muted-foreground",children:e.detail})]})]},t)})}),c&&!p(n.status)&&!M&&(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,r.jsx)(i.$,{size:"sm",variant:"ghost",disabled:E,onClick:()=>void $(),className:"text-rose-400 hover:text-rose-300",children:E?"종료 중…":"미션 종료(파생 잡 release)"}),"continuous"===n.kind&&(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"상시 미션 — 종료 전까지 계속 실행"})]}),c&&!M&&(0,r.jsx)(j,{api:t,m:n,onDone:()=>void A()})]})]})}function k(e){let{api:t,onCommitted:n}=e,[a,o]=(0,s.useState)(""),[l,d]=(0,s.useState)(null),[c,u]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),[g,h]=(0,s.useState)(null),b=(0,s.useCallback)(async()=>{let e=a.trim();if(e){u(!0),h(null);try{d((await t.triagePreview(e)).triage)}catch(e){h(e instanceof Error?e.message:String(e))}finally{u(!1)}}},[t,a]),f=(0,s.useCallback)(async()=>{let e=a.trim();if(e){p(!0),h(null);try{(await t.commitMission(e,"intake")).missionId?(o(""),d(null),n()):h("미션 생성 실패")}catch(e){h(e instanceof Error?e.message:String(e))}finally{p(!1)}}},[t,a,n]),v=l?m.NE[l.executionModel]:null;return(0,r.jsxs)("div",{className:"space-y-2 rounded-lg border border-border bg-card/40 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:"text-sm font-medium",children:["골 던지기 ",(0,r.jsx)("span",{className:"text-xs font-normal text-muted-foreground",children:"— 소망을 말하면 미션이 됩니다"})]}),(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"텔레그램에선 “미션:” 마커로"})]}),(0,r.jsx)("textarea",{value:a,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&b()},placeholder:"예: 삼성전자 급락하면 매매 검토 / 이 주제 끝까지 파봐 / 매일 아침 반도체 뉴스 정리",className:"min-h-[60px] w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm"}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(i.$,{onClick:()=>void b(),disabled:c||!a.trim(),size:"sm",variant:"outline",children:c?"분류 중…":"Triage (⌘↵)"}),(0,r.jsx)(i.$,{onClick:()=>void f(),disabled:x||!a.trim(),size:"sm",children:x?"커밋 중…":"미션 커밋 →"}),l&&v&&(0,r.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5 text-xs",children:[(0,r.jsx)("span",{className:["rounded px-2 py-0.5 ring-1",v.tone].join(" "),children:v.label}),(0,r.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-muted-foreground ring-1 ring-border",children:"heavy"===l.tier?"무거움":"가벼움"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:l.rationale})]}),g&&(0,r.jsx)("span",{className:"text-xs text-rose-400",children:g})]})]})}function w(e){var t,n;let{api:a}=e,[o,l]=(0,s.useState)(null),[d,c]=(0,s.useState)(null),[u,m]=(0,s.useState)(!1),x=(0,s.useCallback)(async()=>{m(!0),c(null);try{let e=[...(await a.missionsUnified()).missions].sort((e,t)=>e.createdAt<t.createdAt?1:-1);l(e)}catch(e){c(e instanceof Error?e.message:String(e))}finally{m(!1)}},[a]);(0,s.useEffect)(()=>{x()},[x]);let p=(0,s.useCallback)(()=>{x()},[x]),g=null!=(t=null==o?void 0:o.filter(e=>e.isAutopilot).length)?t:0,h=(null!=(n=null==o?void 0:o.length)?n:0)-g;return(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["모든 미션(사람 intake + 자율)의 계보\xb7실행 상태.",o&&(0,r.jsxs)("span",{className:"ml-1 text-[11px]",children:["자율 ",g," \xb7 사람 ",h]})]}),(0,r.jsx)(i.$,{onClick:()=>void x(),disabled:u,size:"sm",variant:"outline",children:u?"…":"새로고침"})]}),(0,r.jsx)(k,{api:a,onCommitted:()=>void x()}),d&&(0,r.jsx)("p",{className:"text-xs text-rose-400",children:d}),o&&0===o.length&&(0,r.jsx)("p",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"아직 미션이 없습니다. 위 “골 던지기”로 자율 미션을 만들거나, Intake 에서 메모를 포착하세요."}),o&&o.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:o.map(e=>(0,r.jsx)(N,{api:a,m:e,onMutate:p},e.id))})]})}var S=n(53974);function C(e){let{client:t}=e,[n,a]=(0,s.useState)({total:0,items:[],error:null,loading:!0});return(0,s.useEffect)(()=>{let e=!0;return a({total:0,items:[],error:null,loading:!0}),(0,S.qK)(t).then(t=>{let n=[...t].sort((e,t)=>{var n,r;return(e.dueAt?Date.parse(e.dueAt):1/0)-(t.dueAt?Date.parse(t.dueAt):1/0)||(null!=(n=e.raisedAt)?n:"").localeCompare(null!=(r=t.raisedAt)?r:"")});e&&a({total:n.length,items:n.slice(0,3),error:null,loading:!1})}).catch(t=>{e&&a({total:0,items:[],error:t instanceof Error?t.message:String(t),loading:!1})}),()=>{e=!1}},[t]),(0,r.jsxs)("section",{"aria-label":"결정 대기",className:"mb-4 rounded-xl border border-border bg-card p-4",children:[n.loading?(0,r.jsx)("p",{role:"status",children:"결정 대기 읽는 중"}):n.error?(0,r.jsxs)("p",{role:"alert",children:["결정 대기 못 읽음 \xb7 ",n.error]}):0===n.total?(0,r.jsx)("p",{children:"열린 결정 없음"}):(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium",children:"결정 대기 ".concat(n.total,"건").concat(n.total>n.items.length?" \xb7 상위 3건 표시":"")}),(0,r.jsx)("ol",{className:"mt-2 space-y-1",children:n.items.map(e=>(0,r.jsx)("li",{className:"text-sm break-words",children:(0,r.jsx)("span",{"aria-label":e.title,children:"".concat(e.title).concat(e.dueAt?" \xb7 기한 ".concat(e.dueAt):"")})},e.id))})]}),(0,r.jsx)("a",{href:"/decisions",className:"mt-2 inline-block text-sm underline",children:"결정 대기 카드 열기"})]})}var z=n(49620);let A=[{id:"missions",label:"Missions"},{id:"autonomy",label:"자율행동"}];function E(e){var t;let{arming:n}=e;if(!n)return null;let s=(e,t)=>(0,r.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,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,r.jsx)("span",{children:"자율 경계:"}),s(n.absorb,"흡수 PR초안(".concat(n.absorbBackend,")")),s(n.merge,"mandate merge"),s(n.reboot,"재부팅"),s(null!=(t=n.materialize)&&t,"자율 구체화"),(0,r.jsx)("span",{className:"text-[11px]",children:"\xb7 재부팅은 항상 HITL \xb7 기본 disarmed(fail-closed)"})]})}function D(){let{client:e}=(0,a.Q)(),t=(0,s.useMemo)(()=>new m.Yt(e),[e]),[n,i]=(0,s.useState)("missions"),[o,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=!0;return t.arming().then(t=>{e&&l(t.arming)}).catch(()=>{}),()=>{e=!1}},[t]),(0,r.jsxs)("div",{className:"mx-auto max-w-[1400px] px-4 pt-4",children:[(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(z.r,{active:"autopilot"})}),(0,r.jsxs)("div",{className:"mb-3 space-y-2",children:[(0,r.jsxs)("h1",{className:"text-lg font-semibold",children:["Missions ",(0,r.jsx)("span",{className:"text-sm font-normal text-muted-foreground",children:"미션 지휘 센터 \xb7 Autopilot"})]}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"미션(사람 + 자율)의 계보\xb7상태\xb7자율행동. 아래 “골 던지기” 또는 텔레그램 “미션:” 마커로 소망을 던지면 미션이 됩니다."}),(0,r.jsx)(E,{arming:o})]}),(0,r.jsx)(C,{client:e}),(0,r.jsx)("div",{className:"flex gap-1 border-b border-border",children:A.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>i(e.id),className:["-mb-px border-b-2 px-4 py-2 text-sm font-medium transition-colors",n===e.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"].join(" "),children:e.label},e.id))}),(0,r.jsxs)("div",{className:"py-4",children:["missions"===n&&(0,r.jsx)(w,{api:t}),"autonomy"===n&&(0,r.jsx)(d,{api:t})]})]})}function I(){return(0,r.jsx)(D,{})}},87442:(e,t,n)=>{"use strict";function r(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}n.d(t,{NE:()=>l,Yt:()=>o,on:()=>r});let s=["task","goal-loop","single-shot"],a=["scheduler","monitor-trigger"];function i(e){var t,n,r,i,o,l,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!=(n=null==c?void 0:c.origin)?n:"human",status:null!=(r=null==c?void 0:c.apmStatus)?r:e.status,model:u,tier:null!=(i=null==c?void 0:c.tier)?i:null,engine:null!=(o=null==c?void 0:c.engine)?o:null,kind:(d=null!=(l=null==c?void 0:c.executionModel)?l:null)&&s.includes(d)?"finite":d&&a.includes(d)?"continuous":"other",reviewDue:!1,createdAt:new Date(e.createdAt).toISOString(),updatedAt:e.updatedAt,derived:e.derived,isAutopilot:null!=c,toxStatus:e.status,taskCount:e.taskCount,taskCounts:e.taskStatusCounts}}class o{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",n=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,...n?{category:n}:{}})})}async missionsUnified(e){var t,n;let r=new URLSearchParams({...e?{status:e}:{}}).toString(),s=await this.client.fetchJson("/v1/missions".concat(r?"?".concat(r):"")),a=null!=(t=s.missions)?t:[];return{ok:!0,total:null!=(n=s.total)?n:a.length,missions:a.map(i)}}async trace(e){return this.client.fetchJson("/v1/autopilot/trace?id=".concat(encodeURIComponent(e)))}async missionArcMap(){var e,t,n;let r=await this.client.fetchJson("/v1/missions"),s=new Map;for(let a of null!=(e=r.missions)?e:[]){let e=null==(t=a.autopilot)?void 0:t.arcs;e&&e.length>0&&s.set(a.id,{apmStatus:null==(n=a.autopilot)?void 0:n.apmStatus,arcs:e})}return s}async missionAction(e,t){let n=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,...n})})}async autonomy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1?arguments[1]:void 0,n=new URLSearchParams({limit:String(e),...t?{loop:t}:{}});return this.client.fetchJson("/v1/autopilot/autonomy?".concat(n.toString()))}async arming(){return this.client.fetchJson("/v1/autopilot/arming")}constructor(e){this.client=e}}let l={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"}}},87691:(e,t,n)=>{"use strict";n.d(t,{C:()=>d,DaemonProvider:()=>c,Q:()=>u});var r=n(17594),s=n(48082),a=n(87338),i=n(15249),o=n(47648),l=n(91659);let d=(0,s.createContext)(null);function c(e){let{children:t}=e,n={baseUrl:"",token:"",provider:""},[c,u]=(0,s.useState)(n),[m,x]=(0,s.useState)(""),[p]=(0,s.useState)(()=>new o.ki(n));(0,s.useEffect)(()=>{let e=(0,a.Fp)();u(e),p.updateConfig(e),x((0,i.oD)()),(0,l.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,s.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,l.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,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)},[p]);let g=e=>{u(t=>{let n={...t,...e};return(0,a.Qc)(e),p.updateConfig(n),(0,l.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),n})},h=e=>{x(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,l.cY)("webterm.provider.daemon.session-set",{sessionId:e})},b=(0,s.useMemo)(()=>({config:c,setConfig:g,client:p,sessionId:m,setSessionId:h}),[c,p,m]);return(0,r.jsx)(d.Provider,{value:b,children:t})}function u(){let e=(0,s.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}}},e=>{e.O(0,[1695,8414,1596,7648,4306,3702,7358],()=>e(e.s=6071)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7081],{15249:(e,t,s)=>{"use strict";s.d(t,{Zr:()=>l,f6:()=>r,oD:()=>n});let a="elanous.daemon.sessionId";function r(){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 n(){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=r();return localStorage.setItem(a,t),t}function l(){let e=r();return localStorage.setItem(a,e),e}},22244:(e,t,s)=>{"use strict";s.d(t,{Er:()=>r,cj:()=>c,dc:()=>l,yR:()=>i});let a=/^(oauth\.|harness\.decision|llm\.router)/;function r(e){let t=[],s=e=>{"string"==typeof e&&e.trim()&&!t.includes(e.trim())&&t.push(e.trim())};for(let t of e){var r;let e=null!=(r=t.data)?r:{};if(t.category.startsWith("oauth.")){for(let t of["from","to","name","account"])s(e[t]);if(Array.isArray(e.usage))for(let t of e.usage)s(null==t?void 0:t.name);continue}if(a.test(t.category))for(let t of(s(e.account),["what","why","reason"])){let a=e[t];if("string"==typeof a)for(let e of a.matchAll(/계정\s+([A-Za-z0-9][\w.-]*)/g))s(e[1])}}return t}function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Map(e.map((e,t)=>[e,"account-".concat(t+1)])),s=e.length?RegExp("(^|[^\\w-])(".concat(e.map(n).sort((e,t)=>t.length-e.length).join("|"),")(?![\\w-])"),"g"):null,a=new Map;return(e,r)=>{let n=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();a.has(t)||a.set(t,"remote-".concat(a.size+1));let s=a.get(t);return e===e.toUpperCase()?s.toUpperCase():s})(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 r&&s&&(n=n.replace(s,(e,s,a)=>{var r;return"".concat(s).concat(null!=(r=t.get(a))?r:"account")})),n}}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 s={};for(let[a,r]of Object.entries(e))"apiEquivalentUsd"===a||"usd"===a||/credit(s|Balance)?$/i.test(a)||(s[a]=o(r,t));return s}return e}function i(e){let t=l(r(e));return e.map(e=>{let s=a.test(e.category);return{...e,event:t(e.event,!1),data:e.data?o(e.data,e=>t(e,s)):e.data}})}function c(e,t){let s=l(t);return o(e,e=>s(e,!0))}},38723:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>k});var a=s(17594),r=s(22244);function n(e){return e.map(e=>({...(0,r.cj)(e,[]),taskId:e.taskId,...e.wishReply?{wishReply:{surface:e.wishReply.surface,address:null}}:{}}))}var l=s(48082),o=s(87691);function i(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 c=s(67307);let d={green:"순항",yellow:"진행 중",red:"막힘",done:"완료"},u=["intake","triage","gates","relations","memory","workspace","run","landing","release"];function m(e){return null==e?"—":"string"==typeof e?e:JSON.stringify(e)}function p(e){let{entry:t}=e;return(0,a.jsxs)("details",{className:"mt-2 text-xs",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"JSON"}),(0,a.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 f(e){let{entry:t}=e,s=new Date(t.ts).toISOString();return(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{children:["Owner: ",t.owner]}),(0,a.jsx)("time",{dateTime:s,children:s})]})}function h(e){var t,s,r;let{card:n,placements:o,onClose:c,publicCapture:h=!1}=e,[x,g]=(0,l.useState)(""),[b,y]=(0,l.useState)(!1),[w,k]=(0,l.useState)(null),v=async e=>{if(e.preventDefault(),!(!c||!x.trim()||/[\r\n]/.test(x))&&!b){y(!0),k(null);try{await c(x.trim())}catch(e){k(e instanceof Error?e.message:String(e))}finally{y(!1)}}},j=null==(t=n.sections.gates)?void 0:t.data;return(0,a.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,a.jsxs)("header",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:i(n)}),(0,a.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:n.taskId}),"closed"===n.status?(0,a.jsxs)("p",{role:"status",children:["닫힘 \xb7 ",null!=(s=n.closedReason)?s:"사유 없음"]}):!h&&c?(0,a.jsxs)("form",{onSubmit:v,className:"mt-3 flex flex-wrap items-end gap-2",children:[(0,a.jsxs)("label",{className:"text-sm",children:["닫기 사유 (한 줄)",(0,a.jsx)("input",{type:"text",required:!0,value:x,onChange:e=>g(e.target.value),className:"block rounded-md border border-border bg-background px-2 py-1"})]}),(0,a.jsx)("button",{type:"submit",disabled:b||!x.trim()||/[\r\n]/.test(x),className:"rounded-md border border-border px-3 py-1 text-sm",children:b?"닫는 중…":"닫기"}),w&&(0,a.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:w})]}):null]}),void 0!==n.wishReply&&(0,a.jsxs)("section",{"aria-label":"Wish reply destination",className:"rounded-xl border border-border p-3 text-sm",children:[(0,a.jsx)("h3",{className:"mb-1 font-semibold",children:"어디로 회신하나"}),(0,a.jsx)("p",{className:"break-all",children:n.wishReply?"".concat(null!=(r=({telegram:"텔레그램 대화",pwa:"PWA",tui:"TUI",linear:"Linear"})[n.wishReply.surface])?r:n.wishReply.surface).concat(n.wishReply.address?" \xb7 ".concat(n.wishReply.address):""):"회신 주소 없음"})]}),void 0!==n.wishReply&&(0,a.jsxs)("section",{"aria-label":"Wish reply history",className:"rounded-xl border border-border p-3 text-sm",children:[(0,a.jsx)("h3",{className:"mb-1 font-semibold",children:"회신 이력"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"카드 원장에는 회신 발송 이력이 기록되지 않습니다"})]}),o&&(0,a.jsxs)("p",{className:"overflow-x-auto whitespace-nowrap text-sm","aria-label":"Wish placement and progress",children:["배치 \xb7 ",o.length?o.map(e=>{let{cellId:t,cellTitle:s,version:a,status:r}=e;return"".concat(t," ").concat(s," \xb7 ").concat(a,"판 \xb7 ").concat(d[r])}).join(" / "):"아직 배치되지 않음"]}),j&&(0,a.jsxs)("p",{className:"overflow-x-auto whitespace-nowrap text-sm","aria-label":"Gate decisions",children:["Gate \xb7 budget: ",m(j.budget)," \xb7 location: ",m(j.location)]}),u.map(e=>{let t=n.sections[e];return t?(0,a.jsxs)("section",{"aria-label":"".concat(e," section"),className:"rounded-xl border border-border p-3",children:[(0,a.jsx)("h3",{className:"mb-1 text-sm font-semibold capitalize",children:e}),(0,a.jsx)(f,{entry:t}),(0,a.jsx)(p,{entry:t})]},e):null}),(0,a.jsxs)("section",{"aria-label":"Incidents",className:"space-y-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold",children:["Incidents (",n.incidents.length,")"]}),n.incidents.length?(0,a.jsx)("ol",{className:"space-y-2",children:n.incidents.map(e=>(0,a.jsxs)("li",{className:"rounded-xl border border-border p-3",children:[(0,a.jsx)(f,{entry:e}),(0,a.jsx)(p,{entry:e})]},e.key))}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No incidents."})]})]})}let x=["steward","execution","landing","release","done"],g=new Set(["intake","triage","gates","relations","memory","workspace","run","landing","release","incidents"]);function b(e){let t=[],s=Date.parse(e.createdAt),a=e.sections.find(e=>"intake:reply:0"===e.key),r=null;if(a)try{let e=JSON.parse(a.content);if(e&&"object"==typeof e&&!Array.isArray(e)){let{surface:t,address:s}=e;"string"==typeof t&&("string"==typeof s||null===s)&&(r={surface:t,address:s})}}catch(e){}for(let a of e.sections){let r;if(!g.has(a.key))continue;try{let e=JSON.parse(a.content);r=e&&"object"==typeof e&&!Array.isArray(e)?e:{content:a.content}}catch(e){r={content:a.content}}let n=Date.parse(a.createdAt);t.push({taskId:e.id,section:a.key,key:"".concat(a.key,":").concat(a.createdAt,":").concat(t.length),owner:a.owner,ts:Number.isFinite(n)?n:s,data:r,..."string"==typeof r.runId?{runId:r.runId}:{}})}if(0===t.length&&t.push({taskId:e.id,section:"triage",key:"api:title",owner:"task-card API",ts:s,data:{title:e.title}}),"closed"===e.status){let a=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(s,...t.map(e=>e.ts)),data:{...null==a?void 0:a.data,status:"done"}})}return{...function(e){let t,s=e[0];if(!s)return null;let a={},r=[],n=new Set,l=s.ts,o=-1/0;for(let i of e)if(!(i.taskId!==s.taskId||n.has(i.key)))if(n.add(i.key),l=Math.max(l,i.ts),i.runId&&i.ts>=o&&(t=i.runId,o=i.ts),"incidents"===i.section)r.push(i);else{let e=a[i.section];(!e||i.ts>=e.ts)&&(a[i.section]=i)}return{taskId:s.taskId,sections:a,incidents:r,updatedAt:l,...t?{runId:t}:{}}}(t),apiTitle:e.title,status:e.status,...void 0===e.closedReason?{}:{closedReason:e.closedReason},...e.goalId.startsWith("wish:")?{wishReply:r}:{}}}function y(e){let{cards:t,selectedId:s,onSelect:r,selectedCard:n,detailError:l,placements:o,onCloseCard:c,publicCapture:d}=e,u=(null==n?void 0:n.taskId)===s?n:null;return(0,a.jsxs)("div",{className:"space-y-4 p-4",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"보드"}),(0,a.jsx)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:x.map(e=>(0,a.jsxs)("section",{"aria-label":"".concat(e," column"),className:"min-w-0 space-y-2 rounded-xl border border-border p-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold capitalize",children:e}),t.filter(t=>(function(e){var t;let s=null==(t=e.sections.release)?void 0:t.data;return(null==s?void 0:s.status)==="done"||(null==s?void 0:s.status)==="completed"?"done":s?"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,n;return(0,a.jsxs)("button",{type:"button",onClick:()=>r(e.taskId),"aria-pressed":s===e.taskId,className:"w-full rounded-lg border border-border bg-card p-3 text-left text-sm hover:bg-accent/40",children:[(0,a.jsx)("span",{className:"block font-medium",children:i(e)}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:(0,a.jsx)("time",{dateTime:new Date(e.updatedAt).toISOString(),title:new Date(e.updatedAt).toLocaleString(),children:(t=function(e){let t=new Map;for(let a of e.incidents){var s;let e=null!=(s=a.data.incidentId)?s:a.data.id,r="string"==typeof e&&e.trim()?e:a.key,n=t.get(r);(!n||a.ts>=n.ts)&&t.set(r,a)}return Array.from(t.values()).filter(e=>"closed"!==e.data.status&&"resolved"!==e.data.status).length}(e),n=Date.now(),[...t>0?["사고 ".concat(t)]:[],...e.runId?["런 ".concat(e.runId.replace(/^run-/,"").slice(0,8))]:[],function(e,t,s){let a=Math.floor((t-e)/6e4);if(!Number.isFinite(a)||a<1)return"방금";if(a<60)return"".concat(a,"분 전");if(a<1440)return"".concat(Math.floor(a/60),"시간 전");let r=new Intl.DateTimeFormat("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1,...s?{timeZone:s}:{}}).formatToParts(new Date(e)),n=e=>{var t,s;return null!=(s=null==(t=r.find(t=>t.type===e))?void 0:t.value)?s:""};return"".concat(n("month"),"/").concat(n("day")," ").concat(n("hour"),":").concat(n("minute"))}(e.updatedAt,n,void 0)]).join(" \xb7 ")})})]},e.taskId)})]},e))}),s&&(0,a.jsxs)("aside",{className:"max-w-3xl space-y-2","aria-label":"Selected card",children:[(0,a.jsx)("button",{type:"button",onClick:()=>r(null),"aria-label":"Close card detail",className:"text-sm text-muted-foreground",children:"Close"}),u?(0,a.jsx)(h,{card:u,placements:o,onClose:c,publicCapture:d}):(0,a.jsx)("p",{role:"status",children:null!=l?l:"Loading card detail…"})]})]})}function w(){let{config:e}=(0,o.Q)(),t=(0,l.useMemo)(()=>e.baseUrl?(0,c.xX)({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}):null,[e.baseUrl,e.token]),[s,i]=(0,l.useState)([]),[d,u]=(0,l.useState)(null),[m,p]=(0,l.useState)(null),[f,h]=(0,l.useState)(void 0),[x,g]=(0,l.useState)(null),[w,k]=(0,l.useState)(null),[v,j]=(0,l.useState)(!1);(0,l.useEffect)(()=>{"public"===new URLSearchParams(window.location.search).get("capture")&&j(!0)},[]);let N=(0,l.useMemo)(()=>v?n(s):s,[s,v]),I=v&&m?n([m])[0]:m,S=v&&f?(0,r.cj)(f,[]):f;(0,l.useEffect)(()=>{let e=!1;if(i([]),u(null),p(null),h(void 0),g(null),!t)return void k("Connect to NEXUS to load task cards.");k(null);let s=()=>t.getTaskCards().then(t=>{let{cards:s}=t;e||(i(s.map(b)),k(null))}).catch(t=>{e||k(t instanceof c.Iu&&404===t.status?"Task cards are not available yet (pre-E1).":t instanceof Error?t.message:String(t))});s();let a=setInterval(()=>{s()},1e4);return()=>{e=!0,clearInterval(a)}},[t]),(0,l.useEffect)(()=>{if(!t||!d)return;let e=!1;return p(null),h(void 0),g(null),t.getTaskCard(d).then(t=>{let{card:s,placements:a}=t;e||(h(a),p(b(s)))}).catch(t=>{e||g(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[t,d]);let C=async e=>{if(!t||!d||v)throw Error("Card close unavailable");let{card:s}=await t.closeTaskCard(d,e);p(e=>(null==e?void 0:e.taskId)===d?b(s):e),i(e=>e.map(e=>e.taskId===s.id?b(s):e))};return(0,a.jsxs)(a.Fragment,{children:[w&&(0,a.jsx)("p",{role:"status",className:"p-4 text-sm text-muted-foreground",children:w}),(0,a.jsx)(y,{cards:N,selectedId:d,selectedCard:I,detailError:x,placements:S,onSelect:e=>{(null===e||d!==e)&&(p(null),h(void 0),g(null),u(e))},onCloseCard:C,publicCapture:v})]})}function k(){return(0,a.jsx)(w,{})}},67037:(e,t,s)=>{Promise.resolve().then(s.bind(s,38723))},87691:(e,t,s)=>{"use strict";s.d(t,{C:()=>c,DaemonProvider:()=>d,Q:()=>u});var a=s(17594),r=s(48082),n=s(87338),l=s(15249),o=s(47648),i=s(91659);let c=(0,r.createContext)(null);function d(e){let{children:t}=e,s={baseUrl:"",token:"",provider:""},[d,u]=(0,r.useState)(s),[m,p]=(0,r.useState)(""),[f]=(0,r.useState)(()=>new o.ki(s));(0,r.useEffect)(()=>{let e=(0,n.Fp)();u(e),f.updateConfig(e),p((0,l.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[f]),(0,r.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,n.Fp)();f.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&&p(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=>{u(t=>{let s={...t,...e};return(0,n.Qc)(e),f.updateConfig(s),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),s})},x=e=>{p(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},g=(0,r.useMemo)(()=>({config:d,setConfig:h,client:f,sessionId:m,setSessionId:x}),[d,f,m]);return(0,a.jsx)(c.Provider,{value:g,children:t})}function u(){let e=(0,r.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}}},e=>{e.O(0,[7648,7307,4306,3702,7358],()=>e(e.s=67037)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{81829:(e,t,s)=>{Promise.resolve().then(s.bind(s,97638))},97638:(e,t,s)=>{"use strict";s.d(t,{BotlabPageContent:()=>h});var r,l=s(17594),a=s(48082);let o=(null!=(r=s(30047).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,[4306,3702,7358],()=>e(e.s=81829)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9084],{478:(e,t,s)=>{"use strict";s.d(t,{QK:()=>a,i6:()=>n,Pz:()=>o,Em:()=>i,Yy:()=>d});var r=s(42510);let l={alive:"살아 있음",late:"늦음",failed:"실패",off:"꺼짐"},n="/v1/schedules?includeOff=1",a="/v1/dashboard/loops";async function i(e,t){var s,i,o,c,u,m,p,f;let[h,x]=await Promise.allSettled([e(n),e(a)]),b="fulfilled"===h.status?null==(s=h.value)?void 0:s.schedules:null,v="fulfilled"===x.status?null==(o=x.value)||null==(i=o.loops)?void 0:i.loops:null;if(!Array.isArray(b)&&!Array.isArray(v))throw Error("loop registries unavailable");if(!Array.isArray(b))throw Error("스케줄 레지스트리 조회 실패");if(!Array.isArray(v))throw Error("루프 레지스트리 조회 실패");let g=d(b,t).map(e=>({...e,id:"schedule:".concat(e.id)}));for(let e of v){let s=e.last?Date.parse(e.last.at):NaN,n=(0,r.u)({enabled:!1!==e.armed,lastRunAt:null!=(m=null==(c=e.last)?void 0:c.at)?m:null,lastStatus:null!=(p=null==(u=e.last)?void 0:u.status.toLowerCase())?p:null,intervalMs:null},t);g.push({id:"loop:".concat(e.name),name:e.label,layer:null!=(f=e.category)?f:"루프",owner:"미지정",mode:null===e.armed?"관측":e.armed?"armed":"off",lastRun:Number.isFinite(s)?e.last.at:null,verdict:"alive"===n?"판정 불가":l[n]})}return g}function o(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now,r=0,l=!0;return{async refresh(){let n=++r;try{let a=await i(e,s());l&&n===r&&t({rows:a,state:"ready"})}catch(e){l&&n===r&&t({rows:[],state:"error"})}},dispose(){l=!1}}}function d(e,t){return e.map(e=>{var s,n,a,i,o,d,c;let u=e.lastRun?Date.parse(e.lastRun.at):NaN,m=(0,r.u)({enabled:"off"!==e.state,lastRunAt:null!=(d=null==(s=e.lastRun)?void 0:s.at)?d:null,lastStatus:(null==(n=e.lastRun)?void 0:n.exit)!=null&&0!==e.lastRun.exit?"failed":(null==(a=e.lastRun)?void 0:a.status)==null||["ok","success","completed"].includes(e.lastRun.status.toLowerCase())?null!=(c=null==(o=e.lastRun)||null==(i=o.status)?void 0:i.toLowerCase())?c:null:"failed",intervalMs:e.cron?null:e.intervalMs,...e.cron?{scheduleState:e.state}:{}},t),p=!e.cron&&!(e.intervalMs&&e.intervalMs>0),f="alive"===m&&(!Number.isFinite(u)||p)?"판정 불가":l[m];return{id:e.id,name:e.name,layer:e.domain||e.category||e.source,owner:"미지정",mode:e.runVia||e.source,lastRun:Number.isFinite(u)?e.lastRun.at:null,verdict:f}})}},5010:(e,t,s)=>{"use strict";s.d(t,{D:()=>r,F:()=>l});let r="/loops?view=interact";function l(e){return(null==e?void 0:e.get("view"))==="resources"?"resources":(null==e?void 0:e.get("view"))==="interact"?"interact":"status"}},20538:(e,t,s)=>{Promise.resolve().then(s.bind(s,84122))},42510:(e,t,s)=>{"use strict";function r(e,t){if(!e.enabled||"off"===e.scheduleState)return"off";if("failed"===e.lastStatus||"error"===e.lastStatus||"failure"===e.lastStatus||"abandoned"===e.lastStatus||"expired"===e.lastStatus)return"failed";if("stale"===e.scheduleState)return"late";let s=null===e.lastRunAt?NaN:Date.parse(e.lastRunAt);if(void 0!==e.secondDueAt){let r=null===e.secondDueAt?NaN:Date.parse(e.secondDueAt);return Number.isFinite(s)&&Number.isFinite(t)&&Number.isFinite(r)&&r>s&&t>r?"late":"alive"}return Number.isFinite(t)&&Number.isFinite(s)&&null!==e.intervalMs&&Number.isFinite(e.intervalMs)&&e.intervalMs>0&&t-s>2*e.intervalMs?"late":"alive"}s.d(t,{u:()=>r})},53974:(e,t,s)=>{"use strict";async function r(e){let t=await e.fetchResponse("/v1/ops-board/notices");if(!t.ok)throw Error("notices list failed: ".concat(t.status));return(await t.json()).notices}async function l(e,t,s){let r=await e.fetchResponse("/v1/ops-board/notices",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({noticeId:t,body:s})});if(!r.ok)throw Error("notice reply failed: ".concat(r.status));return(await r.json()).reply}async function n(e){let t=await e.fetchResponse("/v1/decisions?status=open");if(!t.ok)throw Error("decisions list failed: ".concat(t.status));return(await t.json()).decisions}async function a(e,t,s,r){let l=await e.fetchResponse("/v1/decisions/".concat(encodeURIComponent(t),"/decide"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({choice:s,...void 0===r?{}:{note:r}})});if(!l.ok)throw Error("decision failed: ".concat(l.status));return l.json()}s.d(t,{LD:()=>a,aj:()=>l,kh:()=>r,qK:()=>n})},84122:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var r=s(17594),l=s(51596),n=s.n(l),a=s(48082),i=s(87691);let o="못 잼",d="불러오는 중…";var c=s(478),u=s(5010),m=s(53974),p=s(65989);let f=e=>!!e&&"object"==typeof e&&!Array.isArray(e),h=e=>Number.isInteger(e)&&e>=0,x=e=>null===e||"number"==typeof e&&Number.isFinite(e);async function b(e){try{let r,l=await e.fetchResponse("/v1/drafts/metrics");if(!l.ok)return{kind:"unavailable",reason:null};var t,s=await l.json();if(!f(s))return{kind:"unavailable",reason:null};let n="string"==typeof s.reason?s.reason:null;if("measuring"===s.state)return{kind:"measuring"};if("unavailable"===s.state)return{kind:"unavailable",reason:n};let a=s.metrics;return"ready"===s.state&&f(a)&&"string"==typeof s.measuredAt&&Number.isFinite(Date.parse(s.measuredAt))&&h(a.inventory)&&h(a.needsOwner)&&h(a.converted48h)&&h(a.cohort48h)&&x(a.oldestAgeHours)&&x(a.conversion48h)?{kind:"ready",measuredAt:s.measuredAt,refreshError:n,metrics:{inventory:a.inventory,oldestAgeHours:a.oldestAgeHours,needsOwner:a.needsOwner,converted48h:a.converted48h,cohort48h:a.cohort48h,conversion48h:a.conversion48h,overlap:(t=a.overlap,f(t)?["launches24h","launched","unmeasured","linked","autoLanded","salvaged","salvageUnmeasured"].every(e=>null===t[e]||h(t[e]))&&"boolean"==typeof t.sourceIncomplete&&(null===t[r="secondSiblingMedianHours"]||x(t[r])&&t[r]>=0)&&(null===t.autoRate||x(t.autoRate)&&t.autoRate>=0&&t.autoRate<=1)?t:null:null)}}:{kind:"unavailable",reason:null}}catch(e){return{kind:"unavailable",reason:null}}}function v(e){var t,s,l;let{value:n}=e,a="draft 재고";return(0,r.jsxs)("section",{"aria-label":a,className:"col-span-2 min-w-0 rounded-xl border border-border bg-card p-3 sm:p-4",children:[(0,r.jsx)("h2",{className:"text-xs font-medium text-muted-foreground sm:text-sm",children:a}),"loading"===n.kind?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"불러오는 중…"}):"measuring"===n.kind?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"측정 중"}):"unavailable"===n.kind?(0,r.jsx)("p",{className:"mt-2 text-sm",title:null!=(t=n.reason)?t:void 0,children:"못 읽음"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("dl",{className:"mt-2 grid grid-cols-2 gap-x-3 gap-y-1 text-xs sm:grid-cols-4 sm:text-sm",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("dt",{className:"text-muted-foreground",children:"열린 draft"}),(0,r.jsx)("dd",{className:"text-lg font-semibold tabular-nums sm:text-xl",children:n.metrics.inventory})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("dt",{className:"text-muted-foreground",children:"최장 나이"}),(0,r.jsx)("dd",{className:"text-lg font-semibold tabular-nums sm:text-xl",children:null===(s=n.metrics.oldestAgeHours)?"해당 없음":s>=48?"".concat((s/24).toFixed(1),"일"):"".concat(s.toFixed(1),"시간")})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("dt",{className:"text-muted-foreground",children:"주인 표식 없는 draft"}),(0,r.jsx)("dd",{className:"text-lg font-semibold tabular-nums sm:text-xl",children:n.metrics.needsOwner}),n.metrics.inventory>0&&n.metrics.needsOwner===n.metrics.inventory&&(0,r.jsx)("dd",{className:"text-muted-foreground",children:"처리 중 표식 0건"})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("dt",{className:"text-muted-foreground",children:"48h 전환율"}),(0,r.jsx)("dd",{className:"text-lg font-semibold tabular-nums sm:text-xl",children:null===n.metrics.conversion48h?"표본 없음":"".concat((100*n.metrics.conversion48h).toFixed(1),"%")}),null!==n.metrics.conversion48h&&(0,r.jsxs)("dd",{className:"text-muted-foreground tabular-nums",children:[n.metrics.converted48h,"/",n.metrics.cohort48h]})]})]}),n.metrics.overlap&&(0,r.jsxs)("p",{className:"mt-2 text-xs text-muted-foreground tabular-nums",children:["겹침 발사 24h ",null===n.metrics.overlap.launches24h?"못 잼":n.metrics.overlap.launches24h," \xb7 자동 착지 ",null===n.metrics.overlap.autoRate?"못 잼":"".concat((100*n.metrics.overlap.autoRate).toFixed(1),"%")," (",null===n.metrics.overlap.autoLanded?"못 잼":n.metrics.overlap.autoLanded,"/",null===n.metrics.overlap.linked?"못 잼":n.metrics.overlap.linked,")"," \xb7 둘째 형제 착지 중앙값 ",null===n.metrics.overlap.secondSiblingMedianHours?"못 잼":"".concat(n.metrics.overlap.secondSiblingMedianHours.toFixed(1),"h"),(n.metrics.overlap.sourceIncomplete||null===n.metrics.overlap.unmeasured||n.metrics.overlap.unmeasured>0)&&" \xb7 부분 측정"]}),(0,r.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[(0,r.jsx)("time",{dateTime:n.measuredAt,children:(l=n.measuredAt,new Intl.DateTimeFormat("ko-KR",{timeZone:"Asia/Seoul",hour:"2-digit",minute:"2-digit",hour12:!1}).format(new Date(l)))})," 측정",n.refreshError&&(0,r.jsx)("span",{className:"ml-1 text-amber-700",title:n.refreshError,children:"\xb7 갱신 실패 — 이전 값"})]})]})]})}let g={unobservable:"관측 불가",blocked:"막힘","loop-down":"루프 정지",saturated:"자원 포화","supply-empty":"공급 부족",degraded:"흐름 저하",flowing:"흐름 정상"},y={flow:void 0,release:void 0,loops:void 0,decisions:void 0,decisionTitles:void 0,merged:void 0,risks:void 0,grid:void 0,drafts:{kind:"loading"}},j=e=>"string"==typeof e&&Number.isFinite(Date.parse(e)),w=e=>!!e&&"object"==typeof e&&!Array.isArray(e);async function N(e){try{let t=await e.fetchResponse("/v1/ops/overview");if(!t.ok)return null;return function(e){if(!(e&&"object"==typeof e&&!Array.isArray(e))||!Object.hasOwn(e,"verdict")||!Object.hasOwn(e,"reasons"))return null;let t=e.verdict;if("string"!=typeof t||!Object.hasOwn(g,t))return null;let s=e.reasons;if(!Array.isArray(s)||!s.every(e=>"string"==typeof e))return null;let r=s[0]?s[0]:null,l=Object.hasOwn(e,"cacheAgeMs")?e.cacheAgeMs:void 0;return"number"!=typeof l||!Number.isFinite(l)||l<0?null:{verdict:t,label:g[t],reason:r,stale:l>=1e4}}(await t.json())}catch(e){return null}}function k(e){return null!==e&&"object"==typeof e&&"string"==typeof e.id&&"string"==typeof e.name&&"string"==typeof e.source&&(null===e.category||"string"==typeof e.category)&&(null===e.domain||"string"==typeof e.domain)&&(null===e.runVia||"string"==typeof e.runVia)&&["live","firing","stale","off"].includes(e.state)&&(null===e.cron||"string"==typeof e.cron)&&(null===e.intervalMs||"number"==typeof e.intervalMs&&Number.isFinite(e.intervalMs))&&Array.isArray(e.next)&&e.next.every(e=>"string"==typeof e)&&(null===e.lastRun||"object"==typeof e.lastRun&&null!==e.lastRun&&"string"==typeof e.lastRun.at&&(null===e.lastRun.status||"string"==typeof e.lastRun.status)&&(null===e.lastRun.exit||"number"==typeof e.lastRun.exit))}async function A(e){try{var t;let s=await e.fetchResponse(c.i6);if(!s.ok)return null;let r=await s.json();if(null===r||"object"!=typeof r||!("schedules"in r))return null;let l=r.schedules;if(!Array.isArray(l)||!l.every(k))return null;let n=(0,c.Yy)(l,Date.now()),a={};for(let e of n)a[e.verdict]=(null!=(t=a[e.verdict])?t:0)+1;let i=n.flatMap((e,t)=>"실패"===e.verdict&&j(e.lastRun)?[{id:"loop:".concat(e.id),kind:"실패 루프",title:e.name,at:l[t].lastRun.at}]:[]);return{summary:a,risks:i}}catch(e){return null}}async function R(e){try{let t=await e.fetchResponse(c.QK);if(!t.ok)return null;let s=await t.json();if(!w(s)||!w(s.loops)||!Array.isArray(s.loops.loops))return null;let r=s.loops.loops;if(!r.every(e=>w(e)&&"string"==typeof e.name&&"string"==typeof e.label&&(null===e.last||w(e.last)&&j(e.last.at)&&"string"==typeof e.last.status)))return null;return r.flatMap(e=>e.last&&["error","failed","failure","abandoned"].includes(e.last.status.toLowerCase())?[{id:"loop:".concat(e.name),kind:"실패 루프",title:e.label,at:e.last.at}]:[])}catch(e){return null}}async function F(e,t){try{let s=await e.fetchResponse("/v1/harness/runs?finishedSince=".concat(t)),r=s.ok?await s.json():null,l=w(r)?r.landed:null;return w(r)&&(void 0===r.landedTruncated||!1===r.landedTruncated)&&null==r.landedError&&Array.isArray(l)&&l.every(e=>w(e)&&"number"==typeof e.number&&j(e.mergedAt))?new Set(l.filter(e=>Date.parse(e.mergedAt)>=t).map(e=>e.number)).size:null}catch(e){return null}}async function S(e,t){try{let s=await e.fetchResponse("/v1/harness/runs?finishedSince=".concat(t-6048e5)),r=s.ok?await s.json():null;if(!w(r))return null;let l=r.finished,n=r.entries;return"complete"===r.completeness&&Array.isArray(l)&&Array.isArray(n)&&w(r.finishedObservation)&&Number.isInteger(r.finishedObservation.skippedFiles)&&0===r.finishedObservation.skippedFiles&&l.every(e=>w(e)&&"string"==typeof e.runId&&"string"==typeof e.status&&j(e.endedAt))&&n.every(e=>w(e)&&"string"==typeof e.runId&&"string"==typeof e.status)?[...l.filter(e=>"human-stop"===e.status||"failed"===e.status||"parked"===e.status||"cancelled"===e.status&&"soft-stopped"===e.stage).map(e=>({id:"run:".concat(e.runId),kind:"멈춘 하니스 런",title:"string"==typeof e.objective&&e.objective?e.objective:e.runId,at:e.endedAt})),...n.filter(e=>"ended-unclosed"===e.status&&j(e.lastActivityTimestamp)&&!l.some(t=>t.runId===e.runId)).map(e=>({id:"run:".concat(e.runId),kind:"멈춘 하니스 런",title:"string"==typeof e.objective&&e.objective?e.objective:e.runId,at:e.lastActivityTimestamp}))]:null}catch(e){return null}}async function M(e,t){try{let s=await (0,m.qK)(e);if(!Array.isArray(s)||!s.every(e=>w(e)&&"string"==typeof e.id))return null;return{count:s.length,titles:s.map(e=>"string"==typeof e.title&&e.title.trim()?e.title.trim():e.id),risks:s.flatMap(e=>j(e.dueAt)&&Date.parse(e.dueAt)<t?[{id:"decision:".concat(e.id),kind:"기한 지난 결정",title:"string"==typeof e.title?e.title:e.id,at:e.dueAt}]:[])}}catch(e){return null}}async function D(e){try{let t=await e.fetchResponse("/v1/grid");if(!t.ok)return null;let s=await t.json();if(!w(s)||!w(s.hq)||!Array.isArray(s.members)||null!==s.poolReason&&"string"!=typeof s.poolReason)return null;let r=s.hq;if(null!==r.record&&(!w(r.record)||"string"!=typeof r.record.holder)||null!==r.ageSeconds&&("number"!=typeof r.ageSeconds||!Number.isFinite(r.ageSeconds))||null!==r.expired&&"boolean"!=typeof r.expired||null!==r.reason&&"string"!=typeof r.reason||!s.members.every(e=>w(e)&&"string"==typeof e.context&&"number"==typeof e.capacity&&Number.isFinite(e.capacity)&&(null===e.occupied||"number"==typeof e.occupied&&Number.isFinite(e.occupied))))return null;return s}catch(e){return null}}function O(e,t){return new Promise(s=>{let r=setTimeout(()=>s(t),15e3);e.then(e=>{clearTimeout(r),s(e)},()=>{clearTimeout(r),s(t)})})}function T(e){let{title:t,children:s}=e;return(0,r.jsxs)("section",{"aria-label":t,className:"min-w-0 rounded-xl border border-border bg-card p-3 sm:p-4",children:[(0,r.jsx)("h2",{className:"text-xs font-medium text-muted-foreground sm:text-sm",children:t}),(0,r.jsx)("div",{className:"mt-2 text-lg font-semibold leading-snug tabular-nums sm:text-xl",children:s})]})}function E(){var e,t,s,l,c;let{client:m}=(0,i.Q)(),[f,h]=(0,a.useState)(y);(0,a.useEffect)(()=>{let e=!0;return h(y),!function(e,t){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0,r=Date.now(),l=function(e){let t=new Intl.DateTimeFormat("sv-SE",{timeZone:"Asia/Seoul"}).format(e);return Date.parse("".concat(t,"T00:00:00+09:00"))}(new Date(r)),n=O(N(e),null),a=O((0,p.Nn)(e),{kind:"error",status:0}),i=O(A(e),null),o=O(R(e),null),d=O(M(e,r),null),c=O(F(e,l),null),u=O(S(e,l),null),m=O(D(e),null);!function e(t,s,r){let l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:30;O(b(t),{kind:"unavailable",reason:null}).then(n=>{r()&&(s({drafts:n}),"measuring"===n.kind&&l>0&&setTimeout(()=>{r()&&e(t,s,r,l-1)},1e4))})}(e,t,s),n.then(e=>t({flow:e})),a.then(e=>{var s;return t({release:"ready"===e.kind?4!==(s=e.data).seats.length||s.seats.some(e=>null===e.checklist)?null:{green:s.seats.reduce((e,t)=>e+t.checklist.green,0),yellow:s.seats.reduce((e,t)=>e+t.checklist.yellow,0)}:null})}),i.then(e=>{var s;return t({loops:null!=(s=null==e?void 0:e.summary)?s:null})}),d.then(e=>{var s;return t({decisions:null!=(s=null==e?void 0:e.count)?s:null,decisionTitles:e?e.titles:null})}),c.then(e=>t({merged:e})),m.then(e=>t({grid:e})),Promise.all([i,o,d,u]).then(e=>{let[s,r,l,n]=e;t({risks:s&&r&&l&&n?[...new Map([...s.risks,...r,...l.risks,...n].sort((e,t)=>Date.parse(e.at)-Date.parse(t.at)).map(e=>[e.id,e])).values()].sort((e,t)=>Date.parse(t.at)-Date.parse(e.at)||e.id.localeCompare(t.id)).slice(0,5):null})})}(m,t=>{e&&h(e=>({...e,...t}))},()=>e),()=>{e=!1}},[m]);let x=void 0===f.flow?"불러오는 중…":null===f.flow?"못 잼":"".concat(f.flow.label," \xb7 ").concat(null!=(s=f.flow.reason)?s:"사유 없음").concat(f.flow.stale?" \xb7 낡음":""),g=(null==(e=f.flow)?void 0:e.verdict)==="loop-down"||(null==(t=f.flow)?void 0:t.verdict)==="blocked"?"/loops?view=map":"/ops/resources",j=function(e){var t,s,r;let l=void 0===e.flow?d:null===e.flow?o:"".concat(e.flow.label).concat(e.flow.reason?" \xb7 ".concat(e.flow.reason):""),n=void 0===e.risks?d:null===e.risks?o:0===e.risks.length?"해당 없음":"".concat(e.risks[0].kind," \xb7 ").concat(e.risks[0].title),a=void 0===e.grid||!(r=e.grid)||r.poolReason||0===r.members.length||r.members.some(e=>null===e.occupied)?null:r.members.reduce((e,t)=>e+Math.max(0,t.capacity-t.occupied),0);return{blocked:"".concat(l," / 톱 ").concat(n),decide:void 0===e.decisions?d:null===e.decisions?o:"결정 대기 ".concat(e.decisions,"건").concat((null==(t=e.decisionTitles)?void 0:t[0])?" \xb7 ".concat(e.decisionTitles[0]):""),landed:void 0===e.merged?d:null===e.merged?o:"".concat(e.merged,"건"),spare:void 0===e.grid?d:null===a?o:"".concat(a,"칸"),heartbeat:void 0===e.grid?d:function(e){if(null==e||!Number.isFinite(e)||e<0)return o;let t=Math.round(e);return t<60?"".concat(t,"초 전"):"".concat(Math.floor(t/60),"분 전")}(null==(s=e.grid)?void 0:s.hq.ageSeconds),release:void 0===e.release?d:null===e.release?o:"green ".concat(e.release.green," \xb7 노랑 ").concat(e.release.yellow)}}({flow:f.flow,release:f.release,decisions:f.decisions,decisionTitles:f.decisionTitles,merged:f.merged,risks:f.risks,grid:f.grid});return(0,r.jsxs)("main",{className:"mx-auto w-full min-w-0 max-w-3xl px-3 py-4 text-foreground sm:px-6",children:[(0,r.jsxs)("header",{className:"mb-4",children:[(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"운영 \xb7 오늘"}),(0,r.jsx)("h1",{className:"text-xl font-semibold",children:"대표 조망판"})]}),(0,r.jsx)("p",{"aria-label":"흐름 판정",className:"mb-3 min-w-0 truncate rounded-xl border border-border bg-card px-3 py-2 text-sm",children:void 0===f.flow||null===f.flow?x:(0,r.jsx)(n(),{href:g,className:"rounded underline-offset-4 hover:underline focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary",children:x})}),(0,r.jsxs)("div",{role:"region","aria-label":"한 화면 답",className:"mb-3 grid min-w-0 grid-cols-2 gap-2 text-xs sm:grid-cols-3 sm:gap-3",children:[(0,r.jsxs)("p",{className:"min-w-0 rounded-xl border border-border bg-card px-3 py-2",children:[(0,r.jsx)("span",{className:"block text-muted-foreground",children:"지금 막힘"}),(0,r.jsx)("span",{className:"block min-w-0 break-words font-semibold",children:j.blocked})]}),(0,r.jsxs)("p",{className:"min-w-0 rounded-xl border border-border bg-card px-3 py-2",children:[(0,r.jsx)("span",{className:"block text-muted-foreground",children:"결정해야 함"}),(0,r.jsx)("span",{className:"block font-semibold tabular-nums",children:j.decide}),(0,r.jsx)(n(),{href:"/decisions",className:"mt-1 block min-w-0 break-words rounded text-[11px] text-muted-foreground underline underline-offset-4 hover:text-foreground",children:"결정 카드 열기 →"})]}),(0,r.jsxs)("p",{className:"min-w-0 rounded-xl border border-border bg-card px-3 py-2",children:[(0,r.jsx)("span",{className:"block text-muted-foreground",children:"오늘 착지"}),(0,r.jsx)("span",{className:"block font-semibold tabular-nums",children:j.landed})]}),(0,r.jsxs)("p",{className:"min-w-0 rounded-xl border border-border bg-card px-3 py-2",children:[(0,r.jsx)("span",{className:"block text-muted-foreground",children:"예비\xb7하트비트"}),(0,r.jsxs)("span",{className:"block min-w-0 break-words font-semibold tabular-nums",children:["예비 ",j.spare," \xb7 하트비트 ",j.heartbeat]})]}),(0,r.jsxs)("p",{className:"min-w-0 rounded-xl border border-border bg-card px-3 py-2",children:[(0,r.jsx)("span",{className:"block text-muted-foreground",children:"판"}),(0,r.jsx)("span",{className:"block font-semibold tabular-nums",children:j.release}),(0,r.jsx)(n(),{href:"/ops/release",className:"mt-1 block rounded text-[11px] text-muted-foreground underline underline-offset-4 hover:text-foreground",children:"컷\xb7발행 현황 →"})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:gap-4","aria-label":"대표 조망 카드",children:[(0,r.jsxs)(T,{title:"릴리스 판 진행",children:[void 0===f.release?"불러오는 중…":f.release?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{className:"text-emerald-600",children:["green ",f.release.green]}),(0,r.jsxs)("span",{className:"block text-amber-600",children:["노랑 ",f.release.yellow]})]}):"못 읽음",(0,r.jsx)(n(),{href:"/ops/release",className:"mt-1 block rounded text-xs font-medium text-primary underline underline-offset-4 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary","aria-label":"발행 현황 보기 — 운영 › 릴리스",children:"발행 현황 보기 →"})]}),(0,r.jsxs)(T,{title:"루프 판정",children:[void 0===f.loops?"불러오는 중…":null===f.loops?"못 읽음":0===Object.keys(f.loops).length?"등록된 일정 0":(0,r.jsx)("div",{className:"flex flex-wrap gap-1 text-xs font-medium",children:Object.entries(f.loops).map(e=>{let[t,s]=e;return(0,r.jsxs)("span",{className:"rounded-full bg-muted px-2 py-1",children:[t," ",s]},t)})}),(0,r.jsx)(n(),{href:u.D,className:"mt-1 block rounded text-xs font-medium text-primary underline underline-offset-4 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary","aria-label":"루프 상호작용 보기 — 운영 › 루프 상호작용",children:"루프 상호작용 보기 →"})]}),(0,r.jsx)(T,{title:"결정 대기 카드",children:(0,r.jsx)(n(),{href:"/decisions",className:"rounded underline underline-offset-4 focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary","aria-label":"결정 대기 카드 보기",children:void 0===f.decisions?"불러오는 중…":null===f.decisions?"못 읽음":0===f.decisions?"0":(0,r.jsxs)("span",{className:"block space-y-1 text-sm font-medium",children:[(0,r.jsx)("span",{className:"block tabular-nums",children:f.decisions}),(null!=(l=f.decisionTitles)?l:[]).map(e=>(0,r.jsx)("span",{className:"block min-w-0 truncate rounded-lg bg-muted px-2 py-1",title:e,children:e},e))]})})}),(0,r.jsx)(T,{title:"오늘 병합 PR",children:void 0===f.merged?"불러오는 중…":null!=(c=f.merged)?c:"못 읽음"})]}),(0,r.jsxs)("div",{className:"mt-2 grid min-w-0 grid-cols-2 gap-2 sm:mt-4 sm:gap-4","aria-label":"위험과 그리드 카드",children:[(0,r.jsxs)("section",{"aria-label":"위험\xb7막힘 톱 5",className:"min-w-0 rounded-xl border border-border bg-card p-2 sm:p-4",children:[(0,r.jsx)("h2",{className:"text-xs font-medium text-muted-foreground sm:text-sm",children:"위험\xb7막힘 톱 5"}),void 0===f.risks?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"불러오는 중…"}):null===f.risks?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"못 읽음"}):0===f.risks.length?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"해당 없음"}):(0,r.jsx)("ol",{className:"mt-2 space-y-1 text-xs",children:f.risks.map(e=>(0,r.jsxs)("li",{className:"min-w-0 border-b border-border pb-1 last:border-0",children:[(0,r.jsxs)("span",{className:"block text-muted-foreground",children:[e.kind," \xb7 ",(0,r.jsx)("time",{dateTime:e.at,children:e.at.slice(0,16).replace("T"," ")})]}),(0,r.jsx)("span",{className:"block truncate",title:e.title,children:e.title})]},e.id))})]}),(0,r.jsxs)("section",{"aria-label":"그리드",className:"min-w-0 rounded-xl border border-border bg-card p-2 sm:p-4",children:[(0,r.jsx)("h2",{className:"text-xs font-medium text-muted-foreground sm:text-sm",children:"그리드"}),void 0===f.grid?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"불러오는 중…"}):null===f.grid?(0,r.jsx)("p",{className:"mt-2 text-sm",children:"못 읽음"}):(0,r.jsxs)("div",{className:"mt-2 space-y-2 text-xs",children:[(0,r.jsxs)("p",{className:"min-w-0 break-words",children:["본부 \xb7 ",f.grid.hq.reason?"본부 못 읽음":f.grid.hq.record?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{title:f.grid.hq.record.holder,children:f.grid.hq.record.holder}),null!==f.grid.hq.ageSeconds&&(0,r.jsxs)(r.Fragment,{children:[" \xb7 ",Math.floor(f.grid.hq.ageSeconds/60),"분 전"]}),f.grid.hq.expired&&(0,r.jsx)("span",{className:"ml-1 font-semibold text-red-600",children:"만료"})]}):"임대 없음"]}),f.grid.poolReason&&(0,r.jsxs)("p",{className:"break-words text-amber-700",title:f.grid.poolReason,children:["풀 못 읽음 \xb7 ",f.grid.poolReason.slice(0,40)]}),(0,r.jsx)("ul",{className:"space-y-1",children:f.grid.members.map(e=>{var t;return(0,r.jsxs)("li",{className:"min-w-0",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-1",children:[(0,r.jsx)("span",{className:"min-w-0 truncate",title:e.context,children:e.context}),(0,r.jsx)("span",{className:"shrink-0 tabular-nums",children:null===e.occupied?"측정 불가":"".concat(e.occupied,"/").concat(e.capacity)})]}),(0,r.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",role:"meter","aria-label":"".concat(e.context," 칸 사용"),"aria-valuemin":0,"aria-valuemax":Math.max(e.capacity,null!=(t=e.occupied)?t:0,1),...null===e.occupied?{}:{"aria-valuenow":e.occupied},children:null!==e.occupied&&(0,r.jsx)("div",{className:"h-full rounded-full bg-emerald-600",style:{width:"".concat(e.capacity>0?Math.min(100,Math.max(0,e.occupied/e.capacity*100)):0,"%")}})})]},e.context)})}),(0,r.jsxs)("p",{className:"font-medium tabular-nums",children:["칸 사용 ",f.grid.poolReason||f.grid.members.some(e=>null===e.occupied)?"측정 불가":f.grid.members.reduce((e,t)=>e+t.occupied,0),"/",f.grid.members.reduce((e,t)=>e+t.capacity,0)]})]})]}),(0,r.jsx)(v,{value:f.drafts})]})]})}}},e=>{e.O(0,[1596,7648,8987,4306,3702,7358],()=>e(e.s=20538)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8457],{13586:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).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"}]])},24169:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).A)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},26496:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).A)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]])},40336:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).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"}]])},58402:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var i=r(17594);r(48082);var l=r(17051),a=r(273);function n(e){let{className:t,type:r,...n}=e;return(0,i.jsx)(l.p,{type:r,"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",t),...n})}},58813:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},59884:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).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"}]])},83673:(e,t,r)=>{Promise.resolve().then(r.bind(r,33461))},84977:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(89570).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},89570:(e,t,r)=>{"use strict";r.d(t,{A:()=>c});var i=r(48082);let l=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},a=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.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,t)=>{var r,a,d;let{color:c,size:u,strokeWidth:o,absoluteStrokeWidth:h,className:p="",children:y,iconNode:k,...f}=e,{size:v=24,strokeWidth:g=2,absoluteStrokeWidth:b=!1,color:m="currentColor",className:x=""}=null!=(r=(0,i.useContext)(s))?r:{},w=(null!=h?h:b)?24*Number(null!=o?o:g)/Number(null!=u?u:v):null!=o?o:g;return(0,i.createElement)("svg",{ref:t,...n,width:null!=(a=null!=u?u:v)?a:n.width,height:null!=(d=null!=u?u:v)?d:n.height,stroke:null!=c?c:m,strokeWidth:w,className:l("lucide",x,p),...!y&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(f)&&{"aria-hidden":"true"},...f},[...k.map(e=>{let[t,r]=e;return(0,i.createElement)(t,r)}),...Array.isArray(y)?y:[y]])}),c=(e,t)=>{let r=(0,i.forwardRef)((r,n)=>{let{className:s,...c}=r;return(0,i.createElement)(d,{ref:n,iconNode:t,className:l("lucide-".concat(a(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),s),...c})});return r.displayName=a(e),r}}},e=>{e.O(0,[1695,8414,1596,5457,7051,1226,5017,7648,8987,3135,2785,6761,4450,5927,3461,4306,3702,7358],()=>e(e.s=83673)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6348],{3060:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89570).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"}]])},17650:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89570).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},27486:(e,t,s)=>{"use strict";s.d(t,{AF:()=>r});let r={all:["nexus"],health:()=>[...r.all,"health"],snapshot:()=>[...r.all,"snapshot"],tabs:e=>e?[...r.all,"tabs",{kind:e}]:[...r.all,"tabs"],tab:e=>[...r.all,"tab",e],templates:()=>[...r.all,"templates"],template:e=>[...r.all,"template",e],config:()=>[...r.all,"config"],switches:()=>[...r.all,"switches"],switch:e=>[...r.all,"switch",e],secrets:()=>[...r.all,"secrets"],bindingChannels:()=>[...r.all,"bindings","channels"],bindings:e=>[...r.all,"bindings",e],binding:(e,t)=>[...r.all,"binding",e,t],logsTail:(e,t)=>t?[...r.all,"logs",e,{lines:t}]:[...r.all,"logs",e],workflows:()=>[...r.all,"workflows"],workflow:e=>[...r.all,"workflow",e],workflowRun:e=>[...r.all,"workflow-run",e],workflowRuns:()=>[...r.all,"workflow-runs"],pendingApprovals:()=>[...r.all,"workflow-pending-approvals"],platforms:()=>[...r.all,"platforms"],providers:()=>[...r.all,"providers"],worktrees:()=>[...r.all,"worktrees"],designCheck:()=>[...r.all,"design-check"],designPreviews:()=>[...r.all,"design-previews"],designPreview:e=>[...r.all,"design-preview",e],registryCatalog:()=>[...r.all,"registry-catalog"],resolvedView:()=>[...r.all,"resolved-view"]};r.snapshot(),r.tabs(),r.health(),r.snapshot(),r.config(),r.switches()},44928:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>a,SI:()=>o,dJ:()=>l});let r="elanous:auth-required",n=null,i=!1;function a(e){null===n&&(n=e,window.dispatchEvent(new CustomEvent(r,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(r,s),null===n||i||e({path:n}),()=>t.removeEventListener(r,s)}function o(){i=!0}},46982:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>d,tI:()=>o});var r=s(17594),n=s(48082),i=s(67384),a=s(34585);let l=(0,n.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,d=(0,n.useMemo)(()=>null!=s?s:new i.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,r.jsx)(l.Provider,{value:t,children:(0,r.jsx)(a.Ht,{client:d,children:c})})}function c(){let e=(0,n.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,n.useContext)(l)}},49758:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var r=s(48082),n=s(29790),i=s(8879),a=s(84440),l=s(73906),o=class extends a.Q{#e;#t=void 0;#s;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#n()}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.#n(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#i()}mutate(e,t){return this.#r=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#n(){let e=this.#s?.state??(0,n.$)();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.#r&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#r.onSuccess?.(e.data,t,s,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,s,r)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#r.onError?.(e.error,t,s,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,s,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(34585);function d(e,t){let s=(0,c.jE)(t),[n]=r.useState(()=>new o(s,e));r.useEffect(()=>{n.setOptions(e)},[n,e]);let a=r.useSyncExternalStore(r.useCallback(e=>n.subscribe(i.jG.batchCalls(e)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),d=r.useCallback((e,t)=>{n.mutate(e,t).catch(l.lQ)},[n]);if(a.error&&(0,l.GU)(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:d,mutateAsync:a.mutate}}},65661:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89570).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"}]])},68557:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});let r=(0,s(89570).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"}]])},81610:(e,t,s)=>{Promise.resolve().then(s.bind(s,92554))},89570:(e,t,s)=>{"use strict";s.d(t,{A:()=>c});var r=s(48082);let n=function(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return t.filter((e,t,s)=>!!e&&""!==e.trim()&&s.indexOf(e)===t).join(" ").trim()},i=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,s)=>s?s.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var a={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 l=(0,r.createContext)({}),o=(0,r.forwardRef)((e,t)=>{var s,i,o;let{color:c,size:d,strokeWidth:u,absoluteStrokeWidth:h,className:m="",children:p,iconNode:f,...g}=e,{size:x=24,strokeWidth:b=2,absoluteStrokeWidth:y=!1,color:v="currentColor",className:w=""}=null!=(s=(0,r.useContext)(l))?s:{},k=(null!=h?h:y)?24*Number(null!=u?u:b)/Number(null!=d?d:x):null!=u?u:b;return(0,r.createElement)("svg",{ref:t,...a,width:null!=(i=null!=d?d:x)?i:a.width,height:null!=(o=null!=d?d:x)?o:a.height,stroke:null!=c?c:v,strokeWidth:k,className:n("lucide",w,m),...!p&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(g)&&{"aria-hidden":"true"},...g},[...f.map(e=>{let[t,s]=e;return(0,r.createElement)(t,s)}),...Array.isArray(p)?p:[p]])}),c=(e,t)=>{let s=(0,r.forwardRef)((s,a)=>{let{className:l,...c}=s;return(0,r.createElement)(o,{ref:a,iconNode:t,className:n("lucide-".concat(i(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),l),...c})});return s.displayName=i(e),s}},91659:(e,t,s)=>{"use strict";let r;s.d(t,{cY:()=>d,x8:()=>l});let n={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(!(n[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)]<n[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 r,n;t=await (r=this.fetchFn(s),n=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(n,"ms"))),n);r.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,r=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,this.flushMs=r,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 r="";try{let e=new WeakSet;r=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){r="[unserializable: ".concat(String(e),"]")}r&&r.length>800&&(r=r.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(r),t),u(s,e,r)}else console.debug("[".concat(s,"] ").concat(e)),u(s,e,void 0)}function u(e,t,s){let n,i=function(){if(void 0!==r)return r;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 r=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return r=t,t}();if(!i)return;let a=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{n=JSON.parse(s)}catch(e){n=s}i.push({ts:e,category:t,event:a,...void 0!==n?{data:n}:{},source:{platform:"pwa"}})}},92554:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var r=s(17594),n=s(3060),i=s(17650);let a=(0,s(89570).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(65661),o=s(68557),c=s(48082),d=s(46982),u=s(74055),h=s(34585),m=s(49758),p=s(27486),f=s(67307);function g(e){let{available:t,declared:s,onPick:n,pendingId:i,previews:a,onPreview:l}=e,{systems:o,themes:c}=function(e){let t=[],s=[];for(let r of e)("design-system"===r.source?t:s).push(r);return{systems:t,themes:s}}(t);return(0,r.jsxs)("div",{className:"space-y-4",children:[o.length>0&&(0,r.jsx)(x,{title:"Design systems",hint:"Web \xb7 copies tokens.css and DESIGN.md into design/system/",items:o,declared:s,onPick:n,pendingId:i,previews:a,onPreview:l}),c.length>0&&(0,r.jsx)(x,{title:"Terminal themes",hint:"One line in DESIGN.md",items:c,declared:s,onPick:n,pendingId:i,previews:a,onPreview:l})]})}function x(e){let{title:t,hint:s,items:n,declared:i,onPick:a,pendingId:l,previews:o,onPreview:c}=e;return(0,r.jsxs)("section",{className:"space-y-2","aria-label":t,children:[(0,r.jsxs)("h3",{className:"flex items-baseline gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[t,(0,r.jsxs)("span",{className:"normal-case tracking-normal",children:[n.length," \xb7 ",s]})]}),(0,r.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:n.map(e=>(0,r.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,n,a,l,o,c,d,u;let{direction:h,chosen:m,onPick:p,pending:f,busy:g,hasPreview:x,onPreview:b}=e,y=null!=(n=h.swatch.bg)?n: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,r.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,r.jsxs)("div",{className:"flex items-center gap-1.5","aria-hidden":!0,children:[[y,v,h.swatch.accent].map((e,t)=>(0,r.jsx)("span",{className:"h-5 w-5 rounded-full border",style:{backgroundColor:e,borderColor:h.swatch.muted}},t)),h.category&&(0,r.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:h.category})]}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"truncate font-medium",children:null!=(c=h.label)?c:h.id}),(0,r.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(0,r.jsx)("code",{children:h.id}),w?" \xb7 ".concat(w):""]}),(0,r.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:h.mood})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,r.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,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:[(0,r.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Selected"]}):(0,r.jsx)("button",{type:"button",disabled:g,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:f?"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:n,result:i,error:a}=e,[l,o]=(0,c.useState)("url"),[d,u]=(0,c.useState)(""),[h,m]=(0,c.useState)(""),[p,f]=(0,c.useState)(""),g=v(h).filter(e=>y.test(e)),x=v(h).length,b=x>=2&&x<=6&&p.trim().length>0&&g.length===x;return(0,r.jsxs)("section",{className:"rounded-md border p-3","aria-label":"Make my system","data-make-my-system":"",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-medium",children:"Make my system"}),(0,r.jsxs)("div",{className:"flex gap-1",role:"tablist",children:[(0,r.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,r.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,r.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,r.jsxs)("form",{className:"mt-2 flex flex-col gap-2 sm:flex-row",onSubmit:e=>{e.preventDefault();let s=d.trim();s&&!n&&t({kind:"url",url:s})},children:[(0,r.jsx)("label",{className:"sr-only",htmlFor:"make-system-url",children:"Website URL"}),(0,r.jsx)("input",{id:"make-system-url",type:"url",value:d,disabled:n,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,r.jsx)("button",{type:"button",disabled:n,onClick:()=>{let e=w("make-system-url",d).trim();e&&!n&&t({kind:"url",url:e})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:n?"Measuring…":"Make it"})]}):(0,r.jsxs)("form",{className:"mt-2 space-y-2",onSubmit:e=>{e.preventDefault(),b&&!n&&t({kind:"palette",colors:g,id:p.trim()})},children:[(0,r.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-colors",children:"2–6 colors"}),(0,r.jsx)("input",{id:"make-system-colors",value:h,disabled:n,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"}),g.length>0&&(0,r.jsx)("ul",{className:"flex gap-1","aria-label":"Color preview",children:g.map(e=>(0,r.jsx)("li",{className:"h-6 w-6 rounded-sm border",style:{backgroundColor:e},title:e},e))}),(0,r.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-id",children:"id"}),(0,r.jsx)("input",{id:"make-system-id",value:p,disabled:n,placeholder:"stumptowncoffee",onChange:e=>f(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,r.jsx)("button",{type:"button",disabled:n,onClick:()=>{let e=v(w("make-system-colors",h)).filter(e=>y.test(e)),s=w("make-system-id",p).trim();n||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:n?"Measuring…":"Make it"})]}),n&&(0,r.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Measuring…"}),a&&(0,r.jsx)("p",{className:"mt-2 text-sm text-error",role:"alert",children:a}),i&&(0,r.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,r.jsxs)("p",{children:["Made ",i.id," — ",i.tokens.length," tokens \xb7 ",i.unread," unread"]}),i.warnings.map(e=>(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e)),(0,r.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:n.A,declared:i.A,available:a};function C(){return(0,d.Qj)()?(0,r.jsx)(M,{}):(0,r.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Design check"}),(0,r.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,r.jsxs)("div",{className:"mx-auto max-w-3xl space-y-4 p-6",children:[(0,r.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,r.jsx)(l.A,{className:"h-5 w-5","aria-hidden":!0}),"Design check"]}),(0,r.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Craft rulebooks declared by this repository's ",(0,r.jsx)("code",{children:"DESIGN.md"}),"."]})]}),(0,r.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,r.jsx)(o.A,{className:"h-4 w-4 ".concat(a?"animate-spin":""),"aria-hidden":!0}),"Refresh"]})]}),t&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),s&&(0,r.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,r.jsxs)("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/5 p-4",children:[(0,r.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,r.jsx)(n.A,{className:"h-4 w-4 text-warning","aria-hidden":!0}),"Design check blocked"]}),(0,r.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,r.jsx)(A,{data:e})]})}function A(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 r of e.declaredRulebooks)s.set(r,t.has(r)?"missing":"declared");let r={missing:0,declared:1,available:2};return[...s.entries()].map(e=>{let[t,s]=e;return{name:t,status:s}}).sort((e,t)=>r[e.status]-r[t.status]||e.name.localeCompare(t.name))}(t),n=t.unavailableRulebooks.length;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"rounded-md p-3 text-sm ".concat(n?"bg-error/10 text-error":"bg-green-600/10 text-green-700"),children:n?"".concat(n," declared rulebook").concat(1===n?"":"s"," could not be found."):"All ".concat(t.declaredRulebooks.length," declared rulebook").concat(1===t.declaredRulebooks.length?"":"s"," resolve.")}),(0,r.jsxs)("dl",{className:"grid grid-cols-1 gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,r.jsxs)("div",{className:"truncate sm:col-span-2",children:[(0,r.jsx)("dt",{className:"inline font-medium",children:"Repository: "}),(0,r.jsxs)("dd",{className:"inline",children:[(0,r.jsx)("code",{children:t.repoRoot}),t.repoSource&&(0,r.jsxs)("span",{className:"ml-1",children:["(","config"===t.repoSource?"harness.defaultRepo":"daemon folder",")"]})]})]}),(0,r.jsxs)("div",{className:"truncate",children:[(0,r.jsx)("dt",{className:"inline font-medium",children:"Document: "}),(0,r.jsx)("dd",{className:"inline",children:(0,r.jsx)("code",{children:t.documentPath})})]}),(0,r.jsxs)("div",{className:"truncate",children:[(0,r.jsx)("dt",{className:"inline font-medium",children:"Rulebooks: "}),(0,r.jsx)("dd",{className:"inline",children:(0,r.jsx)("code",{children:t.craftDirectory})})]})]}),(0,r.jsx)(O,{data:t}),0===s.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"elanous ships no craft rulebooks and this document declares none."}):(0,r.jsx)("ul",{className:"divide-y rounded-md border",children:s.map(e=>{let t=S[e.status];return(0,r.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,r.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,r.jsx)("code",{children:e.name})]}),(0,r.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,n,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,r.jsxs)("section",{className:"space-y-2",children:[(0,r.jsx)("h2",{className:"text-sm font-medium",children:"Design direction"}),(0,r.jsx)(k,{pending:o.isPending,result:null!=(n=o.data)?n:null,error:o.isError?function(e){switch(e instanceof f.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 f.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,r.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:["Declared direction ",(0,r.jsx)("code",{children:j.unavailable})," is not registered."]}),null===j.declared&&!j.unavailable&&(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"None declared — pick one below."}),l.isError&&(0,r.jsx)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:function(e){switch(e instanceof f.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 f.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,r.jsx)(F,{system:b,onClose:()=>y(null),onSelect:()=>l.mutate(b),selecting:N===b,busy:null!==N,alreadySelected:j.declared===b}),(0,r.jsx)(g,{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 F(e){let{system:t,onClose:s,onSelect:n,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,r.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("p",{className:"text-sm font-medium",children:["Preview \xb7 ",(0,r.jsx)("code",{children:t})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,r.jsx)("span",{className:"text-xs text-primary",children:"Selected"}):(0,r.jsx)("button",{type:"button",disabled:a,onClick:n,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,r.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,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading preview…"}),o.isError&&(0,r.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,r.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,r.jsx)(C,{})}}},e=>{e.O(0,[5616,4055,7307,4306,3702,7358],()=>e(e.s=81610)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[650],{13604:(e,t,r)=>{Promise.resolve().then(r.bind(r,37197))},15249:(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}},37197:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var n=r(17594),s=r(48082),a=r(87691),l=r(39306);let o={report:"보고서",pdf:"PDF",video:"영상",image:"그림",text:"글",link:"링크"};function c(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 i(e){let{client:t,id:r,result:a}=e,[l,i]=(0,s.useState)(""),[u,d]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),f=c(a.url,r),x=a.title||o[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),i(""),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&&i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}),()=>{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)||u)return;let e="pdf"===a.kind?window.open("","_blank"):null;if("pdf"===a.kind&&!e)return void i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.");e&&(e.opener=null),d(!0),i("");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(),i("결과 파일을 열지 못했습니다. 다시 시도해 주세요.")}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:u,className:"font-medium text-primary underline underline-offset-4 disabled:opacity-50",children:u?"여는 중…":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 ",o[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=c(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 u(e){switch(e){case"planning":return"계획 중";case"running":return"진행 중";case"done":return"완료";case"failed":return"멈춤"}}function d(e){switch(e){case"waiting":return"대기";case"running":return"진행 중";case"done":return"완료";case"failed":return"못 함"}}function m(){var e,t,r,o;let{client:c}=(0,a.Q)(),[m,p]=(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,p(""),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}},[c]),(0,s.useEffect)(()=>{let e=!0,t=!1;async function r(){if(!t){t=!0;try{let t=await c.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)}},[c,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 c.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)}}},[c,k]);async function V(e){e.preventDefault();let t=m.trim();if(!t||f)return;let r=F.current;x(!0),w("");try{let e=await c.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)]),p("")}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:m,onChange:e=>p(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:!m.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:u(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(d(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:u(null!=(o=null!=(r=null==J?void 0:J.status)?r:null==z?void 0:z.status)?o:"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:d(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)(i,{client:c,id:J.id,result:e},e.url))})]}),(0,n.jsx)(l.a,{client:c,approvals:J.approvals,onDecided:()=>L(e=>e+1),onPendingChange:P},J.id)]})]})]})}},37664:(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()}}}},39306:(e,t,r)=>{"use strict";r.d(t,{a:()=>o});var n=r(17594),s=r(48082),a=r(37664);let l=e=>JSON.stringify([e.graphId,e.runId]);function o(e){let{client:t,approvals:r,onDecided:o,onPendingChange:c}=e,i=(0,s.useMemo)(()=>(0,a.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(l).join("|");function v(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;d(e),c(r.filter(r=>!t[l(r)]&&e.some(e=>l(e)===l(r))).length)}async function j(e,t){let n=l(e);if(f||m[n]||!r.some(e=>l(e)===n)||!u.some(e=>l(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),o();let a=await i.list();g.current===s&&v(a.items,r)}catch(e){g.current===s&&b((0,a.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,a.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=l(e),r=u.some(e=>l(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)})})]})}},87691:(e,t,r)=>{"use strict";r.d(t,{C:()=>i,DaemonProvider:()=>u,Q:()=>d});var n=r(17594),s=r(48082),a=r(87338),l=r(15249),o=r(47648),c=r(91659);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}}},e=>{e.O(0,[7648,4306,3702,7358],()=>e(e.s=13604)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[141],{15249:(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}},43393:(e,t,r)=>{Promise.resolve().then(r.bind(r,45597))},45597:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(17594),l=r(48082),a=r(87691);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})]})}},87691:(e,t,r)=>{"use strict";r.d(t,{C:()=>c,DaemonProvider:()=>u,Q:()=>d});var s=r(17594),l=r(48082),a=r(87338),n=r(15249),o=r(47648),i=r(91659);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}}},e=>{e.O(0,[7648,4306,3702,7358],()=>e(e.s=43393)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8891],{11247:(e,t,n)=>{Promise.resolve().then(n.bind(n,37473))},37473:(e,t,n)=>{"use strict";n.d(t,{InsidePage:()=>W});var s=n(17594),r=n(48082),a=n(96545),l=n(87534);let i=[{id:"loop-agent",title:"루프 에이전트",oneLine:"일을 반복 관측하고 다음 행동을 고릅니다.",docs:["docs/manual/MANUAL-execution-and-landing-loops-2026-09-29.md"],code:["src/harness/mission-solve-loop.ts","src/mission-loop/composite-cycle.ts"]},{id:"graph-engineering",title:"그래프 엔지니어링",oneLine:"실행의 노드와 경로를 그래프로 읽습니다.",docs:["docs/manual/MANUAL-graph-operations-2026-09-10.md"],code:["src/self-implement/graph-templates.ts","src/self-implement/graph-authority.ts"]},{id:"pty-intelligence",title:"PTY 인텔리전스",oneLine:"에이전트가 터미널의 실행과 관측을 연결합니다.",docs:["docs/manual/MANUAL-external-agent-pty-missions-2026-08-11.md"],code:["src/self-dev/dev-cli.ts"]},{id:"harness",title:"받침 \xb7 하니스",oneLine:"구현과 검증이 지나가는 실행 받침입니다.",docs:["docs/TECH-harness-execution-anatomy-current-state-2026-08-10.md"],code:["src/self-implement/orchestrator.ts","src/self-dev/dev-cli.ts"]},{id:"mission-fabric",title:"미션 패브릭",oneLine:"들어온 일을 미션으로 정하고 실행에 잇습니다.",docs:["docs/manual/MANUAL-mission-fabric-integration-2026-09-03.md"],code:["src/mission-loop/composite-cycle.ts","src/harness/mission-solve-loop.ts"]},{id:"observation",title:"바닥 \xb7 관측\xb7인지\xb7힐링",oneLine:"본 것을 이해하고 스스로 고치는 바닥입니다.",docs:["docs/manual/MANUAL-self-cognition-observability-2026-07-14.md"],code:["src/self-implement/orchestrator.ts"]}];var o=n(71029);function d(e){let{entry:t}=e,[n,a]=(0,r.useState)(!1);return(0,s.jsxs)("details",{open:n,style:{minWidth:0,border:"1px solid #68788f",borderRadius:12,padding:18,background:"#16263b"},children:[(0,s.jsx)("summary",{onClick:e=>{e.preventDefault(),a(e=>!e)},style:{cursor:"pointer",fontWeight:700,overflowWrap:"anywhere"},children:(0,o.t)(t.title)}),(0,s.jsx)("p",{children:(0,o.t)(t.oneLine)}),(0,s.jsxs)("div",{children:[(0,s.jsx)("strong",{children:"문서"}),(0,s.jsx)("ul",{children:t.docs.map(e=>(0,s.jsx)("li",{style:{overflowWrap:"anywhere"},children:(0,o.t)(e)},e))}),(0,s.jsx)("strong",{children:"코드"}),(0,s.jsx)("ul",{children:t.code.map(e=>(0,s.jsx)("li",{style:{overflowWrap:"anywhere"},children:(0,o.t)(e)},e))})]})]})}function c(){return(0,s.jsxs)("div",{"data-architecture-scene":!0,style:{width:"100%",maxWidth:1600,margin:"auto",display:"grid",gap:20,fontSize:18},children:[(0,s.jsx)("h2",{style:{fontSize:28,margin:0},children:"엘라누스의 구조"}),(0,s.jsx)("div",{"aria-label":"메인",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 240px), 1fr))",gap:16},children:i.slice(0,2).map(e=>(0,s.jsx)(d,{entry:e},e.id))}),(0,s.jsx)("div",{"aria-label":"받침",style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(min(100%, 240px), 1fr))",gap:16},children:i.slice(2,4).map(e=>(0,s.jsx)(d,{entry:e},e.id))}),(0,s.jsx)("div",{"aria-label":"실행 이음",style:{width:"100%",maxWidth:480,justifySelf:"center"},children:(0,s.jsx)(d,{entry:i[4]})}),(0,s.jsx)("div",{"aria-label":"바닥",children:(0,s.jsx)(d,{entry:i[5]})})]})}var u=n(87691),p=n(50750);let m={currentMissionId:null,missions:{}},f=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),h=e=>"string"==typeof e&&e.trim().length>0;function g(e){let t=e;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){return null}if(!t||"object"!=typeof t||Array.isArray(t))return null;let n=t;if("wizard.step"!==n.category||"wizard.step"!==n.event||!n.data||"object"!=typeof n.data||Array.isArray(n.data))return null;let s=n.data;return"string"==typeof s.ts&&Number.isFinite(Date.parse(s.ts))&&"string"==typeof s.wizardId&&s.wizardId&&["request","research","draft","validate","install","done"].includes(s.step)&&"string"==typeof s.text?{ts:s.ts,wizardId:s.wizardId,step:s.step,text:s.text,...void 0===s.detail?{}:{detail:s.detail}}:null}function x(e,t){let n=e.logsStreamUrl({exactCategory:"wizard.step"});return n?(0,p.BX)(n,{events:{log:e=>{let n=g(e.data);n&&t(n)}}}):()=>{}}let y={currentRunId:null,runs:{}},b={start:"border-sky-400 bg-sky-500/15 text-sky-200",ok:"border-green-500 bg-green-500/15 text-green-300",fail:"border-red-500 bg-red-500/15 text-red-300"};function v(e){let{state:t,now:n,receivedAt:r,lastSettlement:a,lastActivityTs:l=null,activityStatus:i="loading",wizardSteps:d=[]}=e,c=t.currentRunId?t.runs[t.currentRunId]:null,u=!c||n-r>6e4,p=null==c?void 0:c.order.some(e=>"start"===c.nodes[e].phase),m=a&&!p&&n-a.receivedAt<15e3,f=a&&!p&&n-a.receivedAt>=15e3,h=c?Math.max(0,Math.floor((n-Date.parse(c.startedAt))/1e3)):0,g=c&&a?Math.max(0,Math.floor((Date.parse(a.ts)-Date.parse(c.startedAt))/1e3)):0,x=f?"fail"===a.phase?"실패 \xb7 ".concat(a.nodeId):"완료 \xb7 ".concat(g,"초"):null;return(0,s.jsxs)("section",{"aria-label":"라이브 트레이스",className:"min-w-0 space-y-6 p-6 text-lg leading-relaxed",children:[d.length>0&&(0,s.jsx)("ol",{"aria-label":"플러그인 마법사 흐름",children:d.map(e=>(0,s.jsxs)("li",{children:["마법사 ",e.step," \xb7 ",(0,o.t)(e.text)]},"".concat(e.wizardId,":").concat(e.step)))}),u?(0,s.jsxs)("div",{className:"space-y-4 text-muted-foreground",children:[(0,s.jsx)("p",{children:"지금 도는 런이 없습니다"}),(0,s.jsxs)("p",{role:"status",children:["마지막 활동: ",l&&Number.isFinite(Date.parse(l))?(0,s.jsxs)("time",{dateTime:l,children:[new Date(l).toLocaleString("ko-KR",{timeZone:"Asia/Seoul"})," KST"]}):"loading"===i?"확인 중":"unavailable"===i?"못 읽음":"기록 없음"]}),(0,s.jsx)("button",{type:"button",className:"rounded-lg border border-border px-5 py-3 text-lg",disabled:!0,children:"녹화 보기"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("header",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 break-all text-lg",children:[(0,s.jsx)("h2",{className:"font-semibold",children:c.graphId}),(0,s.jsxs)("span",{children:["런 ",c.runId.slice(0,6)]}),(0,s.jsxs)("span",{children:["경과 ",h,"초"]}),x&&(0,s.jsx)("span",{role:"status",children:x})]}),(0,s.jsxs)("div",{role:"list","aria-label":"노드 흐름",className:"flex flex-wrap gap-3",children:[m&&(0,s.jsx)("span",{className:"rounded-lg border border-border bg-muted px-3 py-1 text-sm text-muted-foreground",children:"다음 단계 준비 중"}),c.order.map(e=>{let t=c.nodes[e];return(0,s.jsxs)("div",{role:"listitem",className:"min-w-0 max-w-full break-all rounded-lg border px-5 py-3 ".concat(b[t.phase]),children:[(0,s.jsxs)("span",{className:"start"===t.phase?"animate-pulse":"",children:[t.nodeId," \xb7 ","start"===t.phase?"진행 중":"ok"===t.phase?"ok":"fail"]}),t.retries>0&&(0,s.jsxs)("span",{className:"ml-3","aria-label":"다시 ".concat(t.retries,"회"),children:["↻",t.retries]})]},e)})]})]})]})}function w(){let{client:e,config:t}=(0,u.Q)(),[n,a]=(0,r.useState)(()=>({client:e,baseUrl:t.baseUrl,token:t.token,state:y,receivedAt:0,lastSettlement:null,lastActivityTs:null,activityStatus:"loading"})),[l,i]=(0,r.useState)(0),[o,d]=(0,r.useState)([]),c=n.client===e&&n.baseUrl===t.baseUrl&&n.token===t.token;return(0,r.useEffect)(()=>{let n=!0;a({client:e,baseUrl:t.baseUrl,token:t.token,state:y,receivedAt:0,lastSettlement:null,lastActivityTs:null,activityStatus:"loading"}),d([]),e.listLogs({category:"graph.run",event:"node",limit:"1"}).then(s=>{n&&a(n=>{var r,a;if(n.client!==e||n.baseUrl!==t.baseUrl||n.token!==t.token)return n;let l=null==(a=s.logs)||null==(r=a[0])?void 0:r.ts,i="string"==typeof l&&Number.isFinite(Date.parse(l))?l:null,o=i&&(!n.lastActivityTs||Date.parse(i)>Date.parse(n.lastActivityTs))?i:n.lastActivityTs;return{...n,lastActivityTs:o,activityStatus:s.ok&&Array.isArray(s.logs)?"ready":"unavailable"}})}).catch(()=>{n&&a(n=>n.client===e&&n.baseUrl===t.baseUrl&&n.token===t.token?{...n,activityStatus:"unavailable"}:n)});let s=x(e,e=>{n&&d(t=>"request"===e.step?[e]:[...t.filter(t=>t.wizardId===e.wizardId),e].slice(-6))}),r=function(e,t){let n=e.logsStreamUrl({category:"graph.run"});return n?(0,p.BX)(n,{events:{log:e=>{let n=function(e){let t=e;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){return null}if("object"!=typeof t||null===t||Array.isArray(t))return null;let n=t;if("graph.run"!==n.category||"node"!==n.event)return null;let s=n.data;return"object"!=typeof s||null===s||Array.isArray(s)?null:["graphId","runId","nodeId"].every(e=>"string"==typeof s[e]&&s[e].trim().length>0)&&("start"===s.phase||"ok"===s.phase||"fail"===s.phase)&&"string"==typeof n.ts&&Number.isFinite(Date.parse(n.ts))&&(void 0===s.seconds||"number"==typeof s.seconds&&Number.isFinite(s.seconds)&&!(s.seconds<0))?{kind:"node",graphId:s.graphId,runId:s.runId,nodeId:s.nodeId,phase:s.phase,ts:n.ts,...void 0===s.seconds?{}:{seconds:s.seconds}}:null}(e.data);n&&t(n)}}}):()=>{}}(e,s=>{if(!n)return;let r=Date.now();a(a=>{var l,i;if(!n)return a;let o=a.client===e&&a.baseUrl===t.baseUrl&&a.token===t.token,d=o?a.state:y,c=d.currentRunId===s.runId&&"start"!==s.phase&&(null==(i=d.runs[s.runId])||null==(l=i.nodes[s.nodeId])?void 0:l.phase)===s.phase,u=d.currentRunId!==s.runId&&d.runs[s.runId]?a.lastSettlement:"start"===s.phase||d.currentRunId!==s.runId?null:c?a.lastSettlement:{receivedAt:r,nodeId:s.nodeId,phase:s.phase,ts:s.ts},p=!o||!a.lastActivityTs||Date.parse(s.ts)>Date.parse(a.lastActivityTs)?s.ts:a.lastActivityTs;return{client:e,baseUrl:t.baseUrl,token:t.token,receivedAt:r,lastSettlement:u,lastActivityTs:p,activityStatus:o?a.activityStatus:"loading",state:function(e,t){var n,s,r,a;let l=Object.hasOwn(e.runs,t.runId)?e.runs[t.runId]:void 0,i=l&&Object.hasOwn(l.nodes,t.nodeId)?l.nodes[t.nodeId]:void 0,o={nodeId:t.nodeId,phase:t.phase,retries:(null!=(n=null==i?void 0:i.retries)?n:0)+("start"===t.phase&&i?1:0)},d={graphId:t.graphId,runId:t.runId,startedAt:null!=(s=null==l?void 0:l.startedAt)?s:t.ts,order:i?l.order:[...null!=(r=null==l?void 0:l.order)?r:[],t.nodeId],nodes:{...null==l?void 0:l.nodes,[t.nodeId]:o}};return{currentRunId:l&&null!=(a=e.currentRunId)?a:t.runId,runs:{...e.runs,[t.runId]:d}}}(d,s)}}),i(r)}),l=setInterval(()=>i(Date.now()),1e3);return()=>{n=!1,r(),s(),clearInterval(l)}},[e,t.baseUrl,t.token]),(0,s.jsx)(v,{state:c?n.state:y,now:l,receivedAt:n.receivedAt,lastSettlement:c?n.lastSettlement:null,lastActivityTs:c?n.lastActivityTs:null,activityStatus:c?n.activityStatus:"loading",wizardSteps:c?o:[]})}var j=n(81998),k=n(3138),I=n(43755);let A=I.DN.map(e=>({graph:"harness",kind:e,plugin:null,description:"",schema:{},core:!0})),S=I.CF.map(e=>({graph:"workflow",kind:e,plugin:null,description:"",schema:{},core:!0}));function N(){let{GraphEditor:e=j.F,WorkflowEditor:t=k.N}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[n,a]=(0,r.useState)("harness");return(0,s.jsxs)("section",{"aria-label":"그래프 편집기",className:"flex h-full min-h-[640px] min-w-0 flex-col",children:[(0,s.jsx)("div",{role:"tablist","aria-label":"그래프 편집 모드",className:"flex shrink-0 gap-2 border-b border-border px-4 py-3",children:["harness","workflow"].map(e=>(0,s.jsx)("button",{type:"button",role:"tab",id:"inside-editor-tab-".concat(e),"aria-controls":"inside-editor-panel-".concat(e),"aria-selected":n===e,onClick:()=>a(e),className:"rounded-lg px-4 py-2 text-lg min-[1440px]:text-[22px] ".concat(n===e?"bg-accent/15 text-text-primary":"text-text-tertiary hover:bg-surface-elevated"),children:"harness"===e?"실행 그래프":"워크플로"},e))}),(0,s.jsx)("div",{id:"inside-editor-panel-harness",role:"tabpanel","aria-labelledby":"inside-editor-tab-harness",hidden:"harness"!==n,className:"harness"===n?"min-h-0 min-w-0 flex-1 overflow-x-auto":"hidden",children:(0,s.jsx)("div",{className:"flex h-full min-h-[640px] min-w-[700px] flex-col min-[700px]:min-w-0",children:(0,s.jsx)(e,{palette:A,initialGraphId:"self-implement"})})}),(0,s.jsx)("div",{id:"inside-editor-panel-workflow",role:"tabpanel","aria-labelledby":"inside-editor-tab-workflow",hidden:"workflow"!==n,className:"workflow"===n?"min-h-0 min-w-0 flex-1 overflow-x-auto":"hidden",children:(0,s.jsx)("div",{className:"flex h-full min-h-[640px] min-w-[700px] flex-col min-[700px]:min-w-0",children:(0,s.jsx)(t,{palette:S})})})]})}var T=n(99777);let D=/^\s*(승인|거부|반려|보류|허용|차단|중단|취소)(?=$|[\s.,!?;:])/;function z(e){let{decisions:t,now:n=Date.now()}=e,r=Object.values(t.missions).flat().filter(e=>"answer"===e.step).sort((e,t)=>Date.parse(t.ts)-Date.parse(e.ts)||t.seq-e.seq),a=r[0],l=a?Math.max(0,Math.floor((n-Date.parse(a.ts))/6e4)):null,i=r.flatMap(e=>{var t;let s=null==(t=D.exec(e.detail.answer))?void 0:t[1];return s&&n-Date.parse(e.ts)<3e5?[{item:e,outcome:s}]:[]});return(0,s.jsxs)("section",{"aria-label":"PTY 인텔리전스",className:"min-w-0 rounded-xl border border-slate-600 p-5 text-lg leading-relaxed min-[1440px]:text-[22px]",children:[(0,s.jsx)("h2",{className:"mb-5 font-semibold",children:"PTY 판단"}),0===i.length?(0,s.jsxs)("p",{role:"status",children:["지금 PTY 판단이 없습니다 — 마지막 판단 ",null===l?"기록 없음":"".concat(l,"분 전")]}):(0,s.jsx)("ol",{"aria-label":"최근 PTY 판단",className:"space-y-4",children:i.slice(0,3).map(e=>{let{item:t,outcome:n}=e;return(0,s.jsxs)("li",{className:"min-w-0 rounded-lg border border-slate-600 p-4",children:[(0,s.jsx)("time",{dateTime:t.ts,children:(0,o.t)(t.ts)})," \xb7 ",(0,o.t)(n)]},"".concat(t.missionId,":").concat(t.seq))})})]})}let U=[{step:"request",label:"요청"},{step:"research",label:"조사"},{step:"draft",label:"초안"},{step:"validate",label:"검증"},{step:"install",label:"설치"},{step:"done",label:"끝"}],C={done:"border-green-500 bg-green-500/15 text-green-300",now:"border-sky-400 bg-sky-500/15 text-sky-200",todo:"border-slate-500 bg-slate-500/15 text-slate-300",failed:"border-red-500 bg-red-500/15 text-red-300"},E={done:"완료",now:"진행 중",todo:"대기",failed:"실패"};function L(e){let{events:t}=e,n=function(e){if(0===e.length)return[];let t=e.map((e,t)=>({event:e,order:t,time:function(e){let t=Date.parse(e);return Number.isFinite(t)?t:-1/0}(e.ts)})).sort((e,t)=>e.time-t.time||e.order-t.order),n=t[t.length-1].event.wizardId,s=t.filter(e=>e.event.wizardId===n),r=s[s.length-1].event,a=U.findIndex(e=>e.step===r.step);return U.map((e,t)=>{var n;let{step:l,label:i}=e,o=null==(n=s.filter(e=>e.event.step===l).at(-1))?void 0:n.event,d=(null==o?void 0:o.detail)!=null&&"object"==typeof o.detail&&!Array.isArray(o.detail)&&!1===o.detail.ok;return{step:l,label:i,state:"done"===r.step?"done":d?"failed":t<a?"done":t===a?"now":"todo",...o?{text:o.text,at:o.ts}:{}}})}(t);return(0,s.jsx)("section",{"aria-label":"마법사 → 마켓",className:"min-w-0 space-y-6 p-4 text-lg min-[1440px]:text-[22px]",children:0===n.length?(0,s.jsxs)("p",{children:["마법사가 아직 돌지 않았습니다 — ",(0,s.jsx)("code",{children:'elanous plugin make "<한 줄>"'})," 로 시작"]}):(0,s.jsx)("ol",{"aria-label":"마법사 단계",className:"grid grid-cols-1 gap-3 min-[900px]:grid-cols-6",children:n.map(e=>(0,s.jsxs)("li",{"data-wizard-step":e.step,"data-state":e.state,className:"min-w-0 rounded-xl border p-4 ".concat(C[e.state]),children:[(0,s.jsxs)("div",{className:"font-semibold",children:[e.label," ",(0,s.jsxs)("span",{className:"font-normal",children:["\xb7 ",E[e.state]]})]}),e.text&&(0,s.jsx)("p",{className:"mt-3 overflow-hidden text-ellipsis whitespace-nowrap",title:(0,o.t)(e.text),children:(0,o.t)(e.text)})]},e.step))})})}let M=e=>"".concat(e.wizardId,":").concat(e.step,":").concat(e.ts,":").concat(e.text);function R(){let{client:e}=(0,u.Q)(),[t,n]=(0,r.useState)(()=>({client:e,events:[]}));return(0,r.useEffect)(()=>{let t=!0;n({client:e,events:[]});let s=s=>{t&&s.length&&n(t=>({client:e,events:function(e,t){let n=new Map;for(let s of[...e,...t])n.set(M(s),s);return[...n.values()].sort((e,t)=>e.ts.localeCompare(t.ts)).slice(-50)}(t.client===e?t.events:[],s)}))},r=e.fetchJson;"function"==typeof r&&r.call(e,"/v1/logs?exactCategory=wizard.step&limit=".concat(50)).then(e=>{let t=null==e?void 0:e.logs;s(Array.isArray(t)?t.map(g).filter(e=>null!==e):[])}).catch(()=>{});let a=x(e,e=>s([e]));return()=>{t=!1,a()}},[e]),(0,s.jsx)(L,{events:t.client===e?t.events:[]})}var K=n(77978);let q=["문서 아키텍처","라이브 트레이스","루프 에이전트","그래프 편집기","마법사 → 마켓","PTY 인텔리전스"],O=q.length,F="elanous.inside.demo";function P(e){return null!==e&&/^[1-9]$/.test(e)&&Number(e)<=O?Number(e):1}function W(){let{loopInteraction:e=K.ZR}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,a.useSearchParams)();return(0,s.jsx)(Y,{search:t,loopInteraction:e})}function Y(e){let{search:t,loopInteraction:n=K.ZR,liveTrace:a=(0,s.jsx)(w,{}),editorScene:i=(0,s.jsx)(N,{}),loopScene:d,wizardScene:u=(0,s.jsx)(R,{}),ptyScene:p=(0,s.jsx)(_,{})}=e,m=(0,K.kU)(t,n.refParam),[f,h]=(0,r.useState)(()=>P(t.get("scene"))),[g,x]=(0,r.useState)(()=>"1"===t.get("demo")),y=(0,r.useRef)(null),b=(0,r.useRef)(f),v=(0,r.useRef)(g);b.current=f,v.current=g;let j=(0,r.useCallback)(e=>{let t=new URL(window.location.href);for(let[n,s]of Object.entries(e))t.searchParams.set(n,s);window.history.replaceState(window.history.state,"",t.toString())},[]),k=(0,r.useCallback)(e=>{e<1||e>O||(b.current=e,h(e),j({scene:String(e)}))},[j]),I=(0,r.useCallback)(()=>{let e=!v.current;v.current=e,x(e),j({demo:e?"1":"0"});try{window.localStorage.setItem(F,e?"1":"0")}catch(e){}},[j]);return(0,r.useEffect)(()=>{let e=t.get("demo"),n="1"===e;if(null===e)try{n="1"===window.localStorage.getItem(F)}catch(e){}else try{window.localStorage.setItem(F,n?"1":"0")}catch(e){}v.current=n,x(n);let s=P(t.get("scene"));b.current=s,h(s)},[t]),(0,r.useEffect)(()=>{window.dispatchEvent(new window.Event("elanous:inside-demo"))},[g]),(0,r.useEffect)(()=>{let e=e=>{if(!(e.altKey||e.ctrlKey||e.metaKey||(0,l._i)(e.target))){if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();let t="ArrowRight"===e.key?1:-1;k(Math.min(O,Math.max(1,b.current+t)))}else if("d"===e.key.toLowerCase())I();else if("f"===e.key.toLowerCase()){var t;"function"==typeof(null==(t=y.current)?void 0:t.requestFullscreen)&&y.current.requestFullscreen().catch(()=>{})}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[k,I]),(0,s.jsxs)("main",{ref:y,"data-inside-page":!0,style:{width:"100%",minHeight:"100vh",minWidth:0,padding:20,boxSizing:"border-box",background:"#0c1828",color:"#f1f5fa",fontSize:18},children:[(0,s.jsx)("style",{children:'@media (min-width: 1440px) {\n [data-inside-page] h1 { font-size: 40px !important; }\n [data-inside-page] nav button { font-size: 22px !important; }\n [data-inside-page] [data-inside-scene="1"] [data-architecture-scene],\n [data-inside-page] [data-inside-scene="2"] section,\n [data-inside-page] [data-inside-scene="2"] header,\n [data-inside-page] [data-inside-scene="2"] button,\n [data-inside-page] [data-inside-scene="2"] .text-sm { font-size: 22px !important; }\n }'}),(0,s.jsxs)("header",{style:{display:"flex",alignItems:"center",gap:16},children:[(0,s.jsx)("h1",{style:{fontSize:28,margin:0},children:"엘라누스 안쪽"}),g&&(0,s.jsx)("span",{"aria-label":"시연 모드",style:{fontSize:18},children:"시연"})]}),(0,s.jsx)("nav",{"aria-label":"장면 선택",style:{display:"flex",minHeight:48,overflowX:"auto",gap:8,margin:"18px 0",whiteSpace:"nowrap"},children:q.map((e,t)=>(0,s.jsx)("button",{type:"button","aria-current":f===t+1?"page":void 0,onClick:()=>k(t+1),style:{flexShrink:0,minHeight:48,padding:"8px 16px",fontSize:18,borderRadius:8,border:"1px solid #7188a5",color:"#fff",background:f===t+1?"#22558b":"#203147"},children:(0,o.t)("".concat(t+1," ").concat(e))},e))}),q.map((e,t)=>(0,s.jsx)("section",{"data-inside-scene":t+1,hidden:f!==t+1,"aria-label":(0,o.t)("".concat(t+1," ").concat(e)),style:{minWidth:0},children:0===t?(0,s.jsx)(c,{}):1===t?a:2===t?null!=d?d:(0,s.jsx)(T.p1,{initialLoopRef:m}):3===t?i:4===t?u:p},e))]})}function _(){let{client:e}=(0,u.Q)(),[t,n]=(0,r.useState)(()=>({client:e,decisions:m})),[a,l]=(0,r.useState)(()=>Date.now());return(0,r.useEffect)(()=>{let e=setInterval(()=>l(Date.now()),6e4);return()=>clearInterval(e)},[]),(0,r.useEffect)(()=>{let t=!0;n({client:e,decisions:m});let s=function(e,t){let n=e.logsStreamUrl({exactCategory:"pty.decision"});return n?(0,p.BX)(n,{events:{log:e=>{let n;try{n=JSON.parse(e.data)}catch(e){return}if(!n||"object"!=typeof n||Array.isArray(n))return;let s=n;if("pty.decision"!==s.category)return;let r=function(e){if(!f(e))return null;let{ts:t,missionId:n,seq:s,sessionId:r,terminalId:a,agent:l,step:i,text:o,detail:d}=e;if(!h(t)||!Number.isFinite(Date.parse(t))||!h(n)||!Number.isSafeInteger(s)||s<0||!h(r)||!h(a)||!h(l)||!h(o)||void 0!==d&&!f(d)||f(d)&&(void 0!==d.keys&&"string"!=typeof d.keys||void 0!==d.row&&(!Number.isSafeInteger(d.row)||d.row<0)))return null;let c={ts:t,missionId:n,seq:s,sessionId:r,terminalId:a,agent:l,text:o},u=f(d)?{...void 0!==d.keys?{keys:d.keys}:{},...void 0!==d.row?{row:d.row}:{}}:{};return"answer"===i?f(d)&&h(d.question)&&h(d.answer)?{...c,step:i,detail:{...u,question:d.question,answer:d.answer}}:null:"recover"===i?f(d)&&h(d.blocked)&&h(d.action)?{...c,step:i,detail:{...u,blocked:d.blocked,action:d.action}}:null:"done"===i?f(d)&&f(d.result)&&h(d.result.ref)&&("pr"===d.result.kind||"file"===d.result.kind||"text"===d.result.kind)?{...c,step:i,detail:{...u,result:{kind:d.result.kind,ref:d.result.ref}}}:null:"read"===i||"judge"===i||"input"===i?{...c,step:i,...void 0!==d?{detail:u}:{}}:null}(s.data);r&&s.event===r.step&&t(r)}}}):()=>{}}(e,s=>{t&&n(t=>({client:e,decisions:function(e,t){let n=Object.hasOwn(e.missions,t.missionId)?e.missions[t.missionId]:[];if(n.some(e=>e.seq===t.seq))return e;let s=[...n,t].sort((e,t)=>e.seq-t.seq),r={...e.missions,[t.missionId]:s},a=e.currentMissionId?r[e.currentMissionId]:void 0,l=s.at(-1),i=null==a?void 0:a.at(-1);return{missions:r,currentMissionId:!i||Date.parse(l.ts)>Date.parse(i.ts)?t.missionId:e.currentMissionId}}(t.client===e?t.decisions:m,s)}))});return()=>{t=!1,s()}},[e]),(0,s.jsx)(z,{decisions:t.client===e?t.decisions:m,now:a})}},87534:(e,t,n)=>{"use strict";function s(e){return e.metaKey||e.ctrlKey}function r(e){let t=e.key.toLowerCase();return!s(e)||e.shiftKey||e.altKey||"k"!==t?s(e)&&e.shiftKey&&!e.altKey&&"j"===t?e.fromEditable?null:"toggle-role-judge":s(e)&&e.shiftKey&&!e.altKey&&"m"===t?e.fromEditable?null:"toggle-voice":s(e)&&e.shiftKey&&!e.altKey&&"y"===t?e.fromEditable?null:"toggle-tts":"?"!==e.key||s(e)||e.altKey?null:e.fromEditable?null:"open-help":"focus-broadcast-input"}function a(e){var t;if(!e)return!1;let n=e.tagName;if(!n)return!1;if("INPUT"===n||"TEXTAREA"===n||"SELECT"===n)return!0;let s=null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===s||"true"===s}n.d(t,{ZQ:()=>r,_i:()=>a,nm:()=>l});let l=[{id:"focus-broadcast-input",combo:"⌘K / Ctrl+K",effect:"Focus broadcast input"},{id:"toggle-role-judge",combo:"⌘⇧J / Ctrl+⇧J",effect:"Toggle role-judge backend"},{id:"toggle-voice",combo:"⌘⇧M / Ctrl+⇧M",effect:"Toggle voice mode (mic)"},{id:"toggle-tts",combo:"⌘⇧Y / Ctrl+⇧Y",effect:"Toggle TTS mute"},{id:"open-help",combo:"?",effect:"Open this help overlay"}]}},e=>{e.O(0,[8997,7571,3727,5616,4055,3603,8073,3985,5892,7648,7307,8987,5359,5456,6955,597,9777,4306,3702,7358],()=>e(e.s=11247)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[131],{273:(e,t,r)=>{"use strict";r.d(t,{cn:()=>s});var n=r(86922),a=r(34558);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.QP)((0,n.$)(t))}},7192:(e,t,r)=>{"use strict";r.d(t,{V5:()=>s,tV:()=>i});var n=r(39991);class a extends Error{constructor(e,t,r){super(r||t),this.status=e,this.error=t,this.reason=r,this.name="MergeApprovalsApiError"}}function s(e,t){return e instanceof a?401===e.status||"unauthorized"===e.error?{text:"이 기기에 소유자 토큰이 없어 승인 목록을 못 읽었습니다 — 이미 연결된 기기의 설정 › 연결 토큰 만들기 에서 토큰을 만들어, 이 기기의 설정 › 데몬 연결 › 연결 토큰 칸에 붙이면 바로 보입니다.",href:"/app/settings/#bearer-token"}:"gh-failed"===e.error?{text:"데몬이 GitHub 를 읽지 못했습니다(데몬 기계의 gh 로그인\xb7네트워크) — 잠시 뒤 다시 열어 보세요.".concat(e.reason?" 사유: ".concat(e.reason.split("\n")[0].slice(0,160)):"")}:"gh-invalid-response"===e.error?{text:"GitHub 응답을 해석하지 못했습니다 — 잠시 뒤 다시 열어 보세요."}:"approvals-repo-unknown"===e.error?{text:"승인할 저장소를 모릅니다 — 데몬 설정 intake.approvals.repo(예: owner/repo)를 채워 주세요.",href:"/app/settings/"}:e.reason?{text:e.reason}:{text:"".concat(t," (").concat(e.status," ").concat(e.error,")")}:e instanceof TypeError?{text:"데몬에 닿지 못했습니다 — 데몬이 켜져 있는지, 이 기기가 같은 네트워크(tailnet)에 있는지 확인하세요."}:{text:e instanceof Error&&e.message?e.message:t}}function i(e){var t,r;let s=null!=(t=e.fetchImpl)?t:fetch,i=(null!=(r=e.baseUrl)?r:"").replace(/\/+$/,"");async function l(t,r){let n={...r,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},l=e.client?await e.client.fetchResponse(t,n):await s("".concat(i).concat(t),n),o=await l.json().catch(()=>null);if(!l.ok){var c;let e=o&&"object"==typeof o?o:{};throw new a(l.status,null!=(c=e.error)?c:"request-failed",e.reason)}return o}return{list:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";return l("merged"===e?"".concat(n.r5,"?state=merged"):n.r5)},get:e=>l("".concat(n.r5,"/").concat(e)),check:(e,t)=>l("".concat(n.r5,"/").concat(e,"/check"),{method:"POST",body:JSON.stringify({headSha:t})}),merge:(e,t)=>l("".concat(n.r5,"/").concat(e,"/merge"),{method:"POST",body:JSON.stringify({headSha:t})})}}},15249:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>i,f6:()=>a,oD:()=>s});let n="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(n,e),e):localStorage.getItem(n)}();if(e)return e;let t=a();return localStorage.setItem(n,t),t}function i(){let e=a();return localStorage.setItem(n,e),e}},20067:(e,t,r)=>{"use strict";r.d(t,{SY:()=>b});var n=r(17594),a=r(48082),s=r(87691),i=r(58274),l=r(23496);let o=["absorbed","discarded","routed","checked"],c={new:"대기 중",queued:"대기 중",absorbed:"흡수됨",routed:"다른 갈래로 넘김",checked:"확인됨",discarded:"버림",deferred:"미룸"};function u(e){var t,r,n;if(null===e)return{label:"찾을 수 없음",settled:!1,noteRef:null};let a=null!=(r=e.outputs)?r:[];return{label:Object.hasOwn(c,e.status)?c[e.status]:e.status,settled:o.includes(e.status),noteRef:null!=(n=null==(t=a.find(e=>"note"===e.kind))?void 0:t.ref)?n:null}}let d={"headless.spawn":"실행 시작","gate.baseline":"게이트 검사","review.diff-scope":"리뷰 중","headless.done":"실행 종료","run-terminal":"종료"};function p(e){var t,r,n,a,s;let i=e.at(-1),l=e.find(e=>"run-terminal"===e.event),o=null==l||null==(t=l.payload)?void 0:t.runStatus;return{stage:i?null!=(n=d[i.event])?n:i.event:null,lastEventAt:null!=(a=null==i?void 0:i.ts)?a:null,done:void 0!==l,outcome:l?"completed"===o||"failed"===o?o:"unknown":null,error:null!=(s=null==l||null==(r=l.payload)?void 0:r.error)?s:null}}let f="elanous.intake.recent",h={absorb:"→ 흡수",tasks:"→ 작업",graph:"→ 그래프","ask-human":"→ 직접 고르세요"};function m(e){if(null==e?void 0:e.storage)return e.storage;try{return globalThis.localStorage}catch(e){return null}}function v(e){try{var t;let r=null==(t=m(e))?void 0:t.getItem(f);if(!r)return[];let n=JSON.parse(r);return Array.isArray(n)?n:[]}catch(e){return[]}}async function g(e,t,r){let n=(0,l.cE)(r);return"absorb"===t?{absorbIds:(await (0,l.IH)(e,r)).ids,recentPreview:n}:{acceptanceId:(await (0,l.ZJ)(e,r)).acceptanceId,recentPreview:n}}function b(){var e,t;let{state:r,deps:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{client:c,sessionId:d}=(0,s.Q)(),[b,x]=(0,a.useState)(""),[y,k]=(0,a.useState)(!1),[w,I]=(0,a.useState)(null),[j,S]=(0,a.useState)(null),[N,E]=(0,a.useState)(null),[O,z]=(0,a.useState)(null),[C,T]=(0,a.useState)({}),[R,J]=(0,a.useState)(null),P=(0,a.useRef)(null),[U,D]=(0,a.useState)([]),[M,_]=(0,a.useState)({}),A=(0,a.useRef)(M),V=(0,a.useMemo)(()=>[...new Set(U.filter(e=>"absorb"===e.track).flatMap(e=>{var t;return null!=(t=e.ids)?t:[]}))],[U]),$=(0,a.useRef)(V);$.current=V;let Y=(0,a.useRef)(()=>{}),[H,q]=(0,a.useState)(null),[F,G]=(0,a.useState)(!1),Q=(0,a.useRef)(!1),B=(0,a.useRef)(0),L=(0,a.useRef)(b);L.current=b;let W=(0,a.useRef)(null),Z=(0,a.useRef)(C),K=(0,a.useRef)(U),X=(0,a.useMemo)(()=>[...new Set([...U.filter(e=>"graph"===e.track).map(e=>e.runId),null==O?void 0:O.runId].filter(e=>!!e))],[U,null==O?void 0:O.runId]);(0,a.useEffect)(()=>{D(v(o))},[o]),(0,a.useEffect)(()=>{K.current=U},[U]),(0,a.useEffect)(()=>{let e=!1,t=new Map,r=async n=>{var a;if(e||!$.current.includes(n)||u(null!=(a=A.current[n])?a:null).settled)return;let s=null;try{s=await (0,l.Gm)(c,n)}catch(e){}e||(A.current={...A.current,[n]:s},_(A.current),$.current.includes(n)&&!u(s).settled?t.set(n,setTimeout(()=>{r(n)},6e4)):t.delete(n))};return Y.current=e=>{var n;t.has(e)||u(null!=(n=A.current[e])?n:null).settled||(t.set(e,null),r(e))},$.current.forEach(Y.current),()=>{for(let r of(e=!0,t.values()))null!==r&&clearTimeout(r);t.clear(),Y.current=()=>{}}},[c]),(0,a.useEffect)(()=>{V.forEach(Y.current)},[V]);let ee=(0,a.useCallback)(e=>{var t,r;D(function(e,t){let r=[e,...v(t)].slice(0,20);try{var n;null==(n=m(t))||n.setItem(f,JSON.stringify(r))}catch(e){}return r}({...e,at:null!=(r=null==o||null==(t=o.now)?void 0:t.call(o))?r:new Date().toISOString()},o))},[o]),et=(0,a.useCallback)(async()=>{let e=b.trim();if(e&&!y){k(!0),I(null),S(null);try{var t;let r=await g(c,"absorb",e),n=null!=(t=r.absorbIds)?t:[];$.current=[...new Set([...n,...$.current])],S(n),ee({track:"absorb",preview:r.recentPreview,ids:n}),n.forEach(Y.current)}catch(e){I(e instanceof Error?e.message:String(e))}finally{k(!1)}}},[y,c,ee,b]),er=(0,a.useCallback)(async()=>{var e;let t=b.trim();if(!t||y||!d)return;let r=null!=(e=P.current)?e:crypto.randomUUID();P.current=r,k(!0),I(null),J(null);try{let e=await (0,l.qI)(c,t,d,r);P.current=null,J(e.cardId),ee({track:"split",preview:(0,l.cE)(t),cardId:e.cardId})}catch(e){I(e instanceof Error?e.message:String(e))}finally{k(!1)}},[y,c,ee,d,b]),en=(0,a.useCallback)(async()=>{let e=b.trim();if(e&&!y){k(!0),I(null),E(null),z(null);try{var t;let r=await g(c,"graph",e);E(null!=(t=r.acceptanceId)?t:null),W.current=Date.now(),ee({track:"graph",preview:r.recentPreview,acceptanceId:r.acceptanceId})}catch(e){I(e instanceof Error?e.message:String(e))}finally{k(!1)}}},[y,c,ee,b]);(0,a.useEffect)(()=>{let e=++B.current;if(q(null),!b.trim())return;let t=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},n=e.trim();if(!n)return()=>{};let a=r.setTimeout(()=>t(n),500);return()=>r.clearTimeout(a)}(b,t=>{(0,l.sg)(c,t).then(t=>{B.current===e&&q(t)},()=>{B.current===e&&q(null)})});return()=>{++B.current,t()}},[c,b]);let ea=(0,a.useCallback)(async()=>{let e=b.trim();if(!e||Q.current||y||(null==H?void 0:H.reason)!=="rule-unknown")return;let t=++B.current;Q.current=!0,G(!0);try{let r=await (0,l.sg)(c,e,{classify:!0});B.current===t&&L.current.trim()===e&&q(r)}catch(r){B.current===t&&L.current.trim()===e&&q({track:"ask-human",confidence:0,reason:"classifier-failed:request-error",decidedBy:"classifier"})}finally{Q.current=!1,G(!1)}},[y,c,null==H?void 0:H.reason,b]);(0,a.useEffect)(()=>{if(!N)return;let e=!1,t=async()=>{var t,r;if(e)return;let n=null!=(t=W.current)?t:Date.now();if(!(Date.now()-n>3e5))try{let t=await (0,l.PM)(c,N);if(!e&&(z(t),t.runId&&K.current.some(e=>"graph"===e.track&&e.acceptanceId===N&&e.runId!==t.runId))){let e=K.current.map(e=>"graph"===e.track&&e.acceptanceId===N?{...e,runId:t.runId}:e);K.current=e;try{null==(r=m(o))||r.setItem(f,JSON.stringify(e))}catch(e){}D(e)}}catch(e){}};t();let r=setInterval(()=>{t()},5e3);return()=>{e=!0,clearInterval(r)}},[N,c,o]),(0,a.useEffect)(()=>{Z.current=C},[C]),(0,a.useEffect)(()=>{let e;if(0===X.length)return;let t=!1,r=!1,n=async()=>{if(t||r)return;let a=X.filter(e=>{var t;return!p(null!=(t=Z.current[e])?t:[]).done});if(0!==a.length){r=!0;try{let e=await Promise.allSettled(a.map(e=>(0,l.dy)(c,e)));if(t)return;let r={};e.forEach((e,t)=>{"fulfilled"===e.status&&(r[a[t]]=e.value)}),Object.keys(r).length>0&&(Z.current={...Z.current,...r},T(Z.current))}finally{r=!1,!t&&X.some(e=>{var t;return!p(null!=(t=Z.current[e])?t:[]).done})&&(e=setTimeout(()=>{n()},3e4))}}};return n(),()=>{t=!0,e&&clearTimeout(e)}},[c,X]);let es=null!=r?r:{text:b,busy:y,error:w,absorbIds:j,acceptanceId:N,graph:O,runEvents:C,wishCardId:R,recent:U,route:H},ei=(0,a.useMemo)(()=>{var e,t;return es.acceptanceId?{acceptanceId:es.acceptanceId,phase:null==(e=es.graph)?void 0:e.phase,runId:null==(t=es.graph)?void 0:t.runId}:null},[es.acceptanceId,es.graph]),el=0===es.text.trim().length,eo=null!=(e=es.route)?e:null,ec=eo?"absorb"===(t=eo.track)?"absorb":"tasks"===t?"split":"graph"===t?"graph":null:null,eu=e=>ec===e?"ring-2 ring-ring":void 0;return(0,n.jsxs)("section",{className:"mx-auto flex max-w-lg flex-col gap-4 p-4","data-testid":"intake-front-door",children:[(0,n.jsx)("header",{className:"space-y-1",children:(0,n.jsx)("h1",{className:"font-heading text-lg font-medium",children:"Intake"})}),(0,n.jsx)("textarea",{value:es.text,onChange:e=>{P.current=null,x(e.target.value)},rows:6,disabled:es.busy,"data-testid":"intake-front-door-field","aria-label":"intake",className:"w-full resize-y rounded-md border border-input bg-background px-3 py-2 text-sm shadow-xs focus:outline-none focus:ring-2 focus:ring-ring"}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"intake-front-door-explainer",children:"보내면 elanous 가 이 글을 처리합니다(흡수 \xb7 작업 분할 \xb7 그래프 실행)."}),eo&&(0,n.jsxs)("div",{"data-testid":"intake-route-chip","data-auto-submit":"0",className:"space-y-0.5 text-sm",children:[(0,n.jsx)("p",{"data-testid":"intake-route-chip-label",children:h[eo.track]}),"classifier"===eo.decidedBy&&(0,n.jsxs)("p",{"data-testid":"intake-route-chip-classifier",children:["분류기 판정 \xb7 확신 ",Math.round(100*eo.confidence),"%"]}),(0,n.jsx)("p",{"data-testid":"intake-route-chip-reason",className:"text-xs text-muted-foreground",children:function(e){if("classifier"!==e.decidedBy)return e.reason;if(e.reason.startsWith("classifier-failed:"))return"분류기가 못 갈랐습니다 — 직접 골라 주세요";if(e.reason.startsWith("classifier-low-confidence:")){var t,r;let n=e.reason.slice(26);return"분류기 추정: ".concat(null!=(r=null==(t=h[n])?void 0:t.slice(2))?r:n," (확신 낮음)")}return e.reason}(eo)}),"rule-unknown"===eo.reason&&(0,n.jsx)(i.$,{type:"button",size:"sm",variant:"outline",disabled:F||es.busy||el,onClick:()=>void ea(),"data-testid":"intake-route-classify",children:"분류기로 가르기"})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(i.$,{type:"button",size:"sm",className:eu("absorb"),"aria-pressed":"absorb"===ec,disabled:el||es.busy,onClick:()=>void et(),"data-testid":"intake-absorb","data-emphasized":"absorb"===ec?"true":"false",children:"흡수"}),(0,n.jsx)(i.$,{type:"button",size:"sm",variant:"outline",className:eu("split"),"aria-pressed":"split"===ec,disabled:el||es.busy||!d,onClick:()=>void er(),"data-testid":"intake-split","data-emphasized":"split"===ec?"true":"false",children:"작업으로 나누기"}),(0,n.jsx)(i.$,{type:"button",size:"sm",variant:"secondary",className:eu("graph"),"aria-pressed":"graph"===ec,disabled:el||es.busy,onClick:()=>void en(),"data-testid":"intake-graph","data-emphasized":"graph"===ec?"true":"false",children:"그래프로 실행"})]}),es.absorbIds&&(0,n.jsxs)("div",{"data-testid":"intake-absorb-result",className:"space-y-1 text-sm",children:[(0,n.jsx)("p",{children:"대기열에 넣었습니다(아침 정기 흡수에서 처리)"}),(0,n.jsx)("ul",{children:es.absorbIds.map(e=>(0,n.jsx)("li",{"data-testid":"intake-absorb-id",children:e},e))})]}),ei&&(0,n.jsxs)("div",{"data-testid":"intake-graph-result",className:"space-y-1 text-sm",children:[(0,n.jsx)("p",{"data-testid":"intake-acceptance-id",children:ei.acceptanceId}),ei.phase&&(0,n.jsx)("p",{"data-testid":"intake-graph-phase",children:ei.phase}),ei.runId&&(0,n.jsx)("p",{"data-testid":"intake-graph-run",children:ei.runId})]}),es.error&&(0,n.jsx)("p",{className:"text-sm text-destructive","data-testid":"intake-front-door-error",children:es.error}),es.wishCardId&&(0,n.jsxs)("p",{className:"text-sm","data-testid":"intake-wish-card-id",children:["소원 카드 ",es.wishCardId]}),es.recent.length>0&&(0,n.jsx)("ul",{"data-testid":"intake-recent",className:"space-y-1 text-xs text-muted-foreground",children:es.recent.map((e,t)=>{var r;let a=(e=>{var t,r,n;let a=null!=(r=e.runId)?r:e.acceptanceId===es.acceptanceId?null==ei?void 0:ei.runId:void 0;return a?p(null!=(n=null==(t=es.runEvents)?void 0:t[a])?n:[]):null})(e);return(0,n.jsxs)("li",{"data-testid":"intake-recent-row",children:[e.track," \xb7 ",e.preview,e.ids?" \xb7 ".concat(e.ids.join(", ")):"","absorb"===e.track&&(null==(r=e.ids)?void 0:r.map(e=>{var t,r,a;let s=Object.hasOwn(M,e)?u(null!=(r=M[e])?r:null):null,i=(null==(t=M[e])?void 0:t.status)==="absorbed";return(0,n.jsxs)("span",{"data-testid":"intake-absorb-status",children:[" \xb7 ","흡수: ",null!=(a=null==s?void 0:s.label)?a:"조회 중",(null==s?void 0:s.noteRef)?" \xb7 ".concat(s.noteRef):"",i?" \xb7 위키: 준비 중":""]},e)})),e.cardId?" \xb7 카드 ".concat(e.cardId):"",e.acceptanceId?" \xb7 ".concat(e.acceptanceId):"",(null==a?void 0:a.stage)&&(0,n.jsxs)("span",{"data-testid":"intake-run-stage",children:[" \xb7 단계: ",a.stage]}),(null==a?void 0:a.lastEventAt)&&(0,n.jsxs)("time",{"data-testid":"intake-run-last-event",dateTime:a.lastEventAt,children:[" \xb7 마지막 사건: ",a.lastEventAt]}),(null==a?void 0:a.done)&&(0,n.jsxs)("span",{"data-testid":"intake-run-outcome",children:[" \xb7 ","completed"===a.outcome?"완료":"failed"===a.outcome?"실패":"결과 미상",a.error?" \xb7 ".concat(a.error.split("\n")[0]):""]})]},"".concat(e.at,"-").concat(t))})})]})}},23496:(e,t,r)=>{"use strict";r.d(t,{Gm:()=>u,IH:()=>s,PM:()=>o,ZJ:()=>l,cE:()=>a,dy:()=>c,qI:()=>i,sg:()=>d});let n=/https?:\/\/[^\s<>"']+/g;function a(e){return e.slice(0,40)}async function s(e,t){let r=function(e){var t;let r=null!=(t=e.match(n))?t:[];return 0===r.length?[{text:e}]:r.map(e=>({url:e}))}(t),a=await e.fetchJson("/v1/intake-ledger/items",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({items:r,source:"pwa"})});return{ids:a.ids,added:a.added,merged:a.merged}}function i(e,t,r,n){return e.fetchJson("/v1/task-cards/wish",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,sessionId:r,ref:n})})}async function l(e,t){return{acceptanceId:(await e.fetchJson("/v1/harness/ask",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t})})).acceptanceId}}function o(e,t){return e.fetchJson("/v1/harness/ask-status?acceptanceId=".concat(encodeURIComponent(t)))}function c(e,t){return e.fetchJson("/v1/harness/run-events?runId=".concat(encodeURIComponent(t)))}function u(e,t){return e.fetchJson("/v1/intake-ledger/items/".concat(encodeURIComponent(t)))}function d(e,t,r){return e.fetchJson("/v1/intake/route",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:t,consent:"route",source:"pwa",...(null==r?void 0:r.classify)!==void 0?{classify:r.classify}:{}})})}},39991:(e,t,r)=>{"use strict";r.d(t,{GM:()=>l,J3:()=>i,WF:()=>n,bR:()=>s,m:()=>o,r5:()=>a});let n="/v1/devices",a="/v1/approvals/merges",s="/v1/templates/capability-preview",i="/v1/idle-nudge/preview",l="/v1/morning-digest/showroom",o="/v1/next-fluent/dispatch"},58274:(e,t,r)=>{"use strict";r.d(t,{$:()=>o});var n=r(17594),a=r(39515),s=r(34796),i=r(273);let l=(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 o(e){let{className:t,variant:r="default",size:s="default",...o}=e;return(0,n.jsx)(a.$,{"data-slot":"button",className:(0,i.cn)(l({variant:r,size:s,className:t})),...o})}},61632:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>p});var n=r(17594),a=r(51596),s=r.n(a),i=r(48082),l=r(87691),o=r(7192);function c(e){let{items:t}=e,r=t.filter(e=>"OPEN"===e.state&&!e.draft);if(0===r.length)return null;let a=r.slice(0,3);return(0,n.jsx)("div",{className:"mx-auto max-w-lg px-4 pt-4",children:(0,n.jsxs)("section",{"aria-label":"승인 대기",className:"rounded-lg border border-emerald-600/40 bg-emerald-500/10 p-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"font-semibold",children:["흡수 아이디어 승인 대기 ",r.length,"건"]}),(0,n.jsx)(s(),{href:"/approvals",className:"rounded-md bg-emerald-700 px-3 py-1 text-white hover:bg-emerald-800",children:"Approvals 에서 보기 →"})]}),(0,n.jsxs)("ul",{className:"mt-2 space-y-1",children:[a.map(e=>(0,n.jsxs)("li",{className:"break-words",children:[(0,n.jsxs)(s(),{href:"/approvals?pr=".concat(e.number),className:"underline",children:["#",e.number]})," \xb7 ",e.title]},e.number)),r.length>a.length&&(0,n.jsxs)("li",{className:"text-muted-foreground",children:["외 ",r.length-a.length,"건"]})]})]})})}function u(){let{client:e}=(0,l.Q)(),t=(0,i.useMemo)(()=>(0,o.tV)({client:e}),[e]),[r,a]=(0,i.useState)([]);return(0,i.useEffect)(()=>{let e=!0;return t.list().then(t=>{let{items:r}=t;e&&a(r)}).catch(()=>{e&&a([])}),()=>{e=!1}},[t]),(0,n.jsx)(c,{items:r})}var d=r(20067);function p(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u,{}),(0,n.jsx)(d.SY,{})]})}},87691:(e,t,r)=>{"use strict";r.d(t,{C:()=>c,DaemonProvider:()=>u,Q:()=>d});var n=r(17594),a=r(48082),s=r(87338),i=r(15249),l=r(47648),o=r(91659);let c=(0,a.createContext)(null);function u(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[u,d]=(0,a.useState)(r),[p,f]=(0,a.useState)(""),[h]=(0,a.useState)(()=>new l.ki(r));(0,a.useEffect)(()=>{let e=(0,s.Fp)();d(e),h.updateConfig(e),f((0,i.oD)()),(0,o.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[h]),(0,a.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();h.updateConfig(t),d(t),(0,o.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,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)},[h]);let m=e=>{d(t=>{let r={...t,...e};return(0,s.Qc)(e),h.updateConfig(r),(0,o.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},v=e=>{f(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,o.cY)("webterm.provider.daemon.session-set",{sessionId:e})},g=(0,a.useMemo)(()=>({config:u,setConfig:m,client:h,sessionId:p,setSessionId:v}),[u,h,p]);return(0,n.jsx)(c.Provider,{value:g,children:t})}function d(){let e=(0,a.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},91547:(e,t,r)=>{Promise.resolve().then(r.bind(r,61632))}},e=>{e.O(0,[1695,8414,1596,7648,4306,3702,7358],()=>e(e.s=91547)),_N_E=e.O()}]);