elanous 0.2.7 → 0.2.9
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.
- package/apps/pwa/out/404/index.html +1 -1
- package/apps/pwa/out/404.html +1 -1
- package/apps/pwa/out/_next/static/bFI5EEwg7T6aG88ibX4Zq/_buildManifest.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7032-f4ef698518fba61c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8067-d976b441a104ab74.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8519-5632377cce994f86.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8630-cdfc61e82c653ffc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8894-e263b332208e3957.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9454-139040d37c79dbc9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9740-8f5ff96c522b5f55.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-fb7c2d458f32fcad.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-35e2713597dd24d1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/page-918b656f064577ba.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/{page-624f7a2f89b60c8f.js → page-f972fc1c00a62e88.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/{page-5a5fb385a4df0ffe.js → page-5f30e00693527ebd.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/{page-80497e93a878ddc5.js → page-7fbae173b3c103a7.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/consult/{page-7457f52683562161.js → page-3b4edcce364062ea.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-c5794f484c251f44.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-1130d8eefcd87e76.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/editor/page-973996d584f008c1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/exec/{page-b7dcf5d48a854b76.js → page-016e2bda04eecb1f.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/field/{page-51480757e7d68b92.js → page-b4d6d9a3b56f2940.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-ec49a466121233ba.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/layout-f72db356744ceade.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live/page-a6fd9b50d1b85378.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/market/page-8b0402a46a749a3d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/{page-07267f1391b96aba.js → page-037f83e2a1edc8e2.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/morning/{page-55d50e9b0006a91d.js → page-adfbd2ba9598e59a.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-46fedff57d4bec67.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-0cf318e9dcee2bbf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-899b327cb8b6845c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-6c1e6ba743a29dfe.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/{page-a7e37af7d0399cb8.js → page-1a8e4807292f6b17.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-28deba6bcb834916.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-de68e2205794037d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/sessions/{page-15e5a15db84c56aa.js → page-c71c33a573230672.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/{page-a2e572e4511f2a16.js → page-0df30e0c7e50148a.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/page-4fc56790fe0d2682.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-59df2aebb38a7c1e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/page-4647be5dbcbd0795.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/share/page-e025892bda74b743.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-a0955de73b89f078.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/{page-c1c95739c0bff3b8.js → page-369846d2921af584.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/term/page-72cbc1c8cdd0f65d.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/{page-71d18eec33b9c667.js → page-77b28bfb0996d5ea.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/page-3220c4934f49c6c2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/{page-2c4e59079ee357ac.js → page-90670589b87abea8.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-7df9243ed021a4cc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/{page-5d422f38c052967e.js → page-4498c3853f4f688d.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-35bedde6d885f08f.js +1 -0
- package/apps/pwa/out/_next/static/css/f92f63a5df0ba229.css +1 -0
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +30 -29
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +30 -29
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +30 -29
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +27 -26
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +27 -26
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +27 -26
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +30 -29
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +30 -29
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +30 -29
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +30 -29
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +30 -29
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +30 -29
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +27 -26
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +30 -29
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +30 -29
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +27 -26
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +27 -26
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +30 -29
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +30 -29
- package/apps/pwa/out/ops/checklist/index.html +1 -0
- package/apps/pwa/out/ops/checklist/index.txt +30 -0
- package/apps/pwa/out/ops/release/index.html +1 -0
- package/apps/pwa/out/ops/release/index.txt +30 -0
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +28 -27
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +30 -29
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +27 -26
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +30 -29
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +30 -29
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +30 -29
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +30 -29
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +30 -29
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +27 -26
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +30 -29
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +30 -29
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +30 -29
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +30 -29
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +30 -29
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +30 -29
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +30 -29
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +30 -29
- package/graphs/release/recipes.yaml +3 -0
- package/graphs/release/release-loop.yaml +3 -1
- package/graphs/test-diet/nightly-audit.yaml +18 -0
- package/graphs/test-diet/recipes.yaml +12 -0
- package/graphs/test-diet/test-diet.yaml +22 -0
- package/package.json +2 -1
- package/persona-presets/_index.yaml +10 -0
- package/persona-presets/_schema.json +146 -0
- package/persona-presets/dana.yaml +26 -0
- package/persona-presets/haru.yaml +27 -0
- package/persona-presets/kai.yaml +27 -0
- package/persona-presets/leo.yaml +27 -0
- package/persona-presets/mira.yaml +30 -0
- package/persona-presets/nari.yaml +27 -0
- package/persona-presets/sora.yaml +27 -0
- package/persona-presets/yuna.yaml +27 -0
- package/plugins/doc-draft/graphs/run-step.ts +1 -1
- package/plugins/geo-check/graphs/run-step.ts +34 -10
- package/scripts/field-feed/deliver-node.ts +8 -3
- package/scripts/field-feed/lib.ts +2 -0
- package/scripts/install.sh +20 -11
- package/scripts/persona-presets/lint.ts +79 -0
- package/scripts/release-loop/checklist-gate-node.ts +2 -2
- package/scripts/release-loop/cutoff.ts +20 -2
- package/scripts/release-loop/export-check-node.ts +85 -0
- package/scripts/release-loop/gate-node.ts +45 -7
- package/scripts/release-loop/node-verdict.ts +8 -1
- package/scripts/release-loop/npm-publish-node.ts +10 -4
- package/scripts/release-loop/ops-upgrade-node.ts +11 -3
- package/scripts/release-loop/publish-node.ts +23 -1
- package/scripts/release-loop/shard-plan.ts +17 -0
- package/scripts/storyboard/storyboard.ts +167 -0
- package/scripts/test-diet/lib.ts +89 -0
- package/scripts/test-diet/node.ts +144 -0
- package/src/acp/auth-methods.ts +30 -0
- package/src/acp/server.ts +5 -5
- package/src/auth/setup-link-tokens.fixture.ts +19 -0
- package/src/auth/setup-link-tokens.ts +153 -0
- package/src/budget/unified-usage.ts +75 -0
- package/src/channel-bot-token.ts +37 -10
- package/src/channel-import/detect.ts +191 -0
- package/src/channel-import/run.ts +111 -0
- package/src/chat/index.ts +9 -9
- package/src/cli/config-test-sync.ts +4 -0
- package/src/cli/decisions-cli.ts +13 -3
- package/src/cli/doctor-bundle.ts +128 -0
- package/src/cli/doctor-cli.ts +36 -1
- package/src/cli/doctor-local-llm.ts +95 -0
- package/src/cli/import-cli.ts +60 -0
- package/src/cli/mcp-login.ts +13 -4
- package/src/cli/op-proxy-sync.ts +83 -0
- package/src/cli/persona-cli.ts +116 -0
- package/src/cli/pr-cli.ts +6 -2
- package/src/cli/release-cli.ts +49 -8
- package/src/cli/skills-cli.ts +173 -0
- package/src/cli/start-cli.ts +13 -4
- package/src/codex/setup.ts +15 -13
- package/src/dashboard/dashboard-status-lines.ts +45 -0
- package/src/dashboard/first-screen-band.ts +35 -0
- package/src/dashboard/index.ts +87 -14
- package/src/dashboard/provider-slash-runtime.ts +28 -11
- package/src/dashboard/slash-runtime/dashboard-handlers.ts +12 -2
- package/src/dashboard/slash-runtime/help-from-registry.ts +4 -2
- package/src/dashboard/turn-stream-formatter.ts +1 -1
- package/src/decisions/decision-cards.ts +291 -0
- package/src/decisions/decision-ledger.ts +5 -2
- package/src/decisions/discord-decision-cards.ts +133 -0
- package/src/decisions/telegram-decision-cards.ts +100 -0
- package/src/directives/version-at.ts +77 -0
- package/src/discord.ts +17 -0
- package/src/domains/outbound-alert.ts +44 -1
- package/src/domains/repeated-failure.ts +1 -1
- package/src/error-report/report.ts +200 -0
- package/src/exec-requests/planner.ts +8 -2
- package/src/exec-requests/runner.ts +64 -24
- package/src/exec-requests/store.ts +2 -0
- package/src/field/field-feed-auto.ts +48 -0
- package/src/field/field-reel.ts +8 -1
- package/src/hooks/error-report.ts +210 -0
- package/src/hooks/receiver.ts +41 -1
- package/src/import/apply.ts +128 -0
- package/src/import/plan.ts +197 -0
- package/src/index.ts +98 -11
- package/src/input-core/text-entry.ts +13 -5
- package/src/intake-plane/seat-answer.ts +96 -0
- package/src/intake-plane/seat-doc-route.ts +17 -3
- package/src/maturity/feature-maturity.ts +2 -0
- package/src/nexus/api/consult-requests.ts +19 -8
- package/src/nexus/api/error-reports.ts +108 -0
- package/src/nexus/api/http-server.ts +41 -1
- package/src/nexus/api/meta-api.ts +27 -0
- package/src/nexus/api/operator.ts +61 -0
- package/src/nexus/api/ops-api.ts +139 -0
- package/src/nexus/api/ops-seats-sources.ts +65 -0
- package/src/nexus/api/ops-seats.ts +114 -0
- package/src/nexus/api/outbound-report.ts +7 -0
- package/src/nexus/api/public-routes.ts +14 -1
- package/src/nexus/api/running-runs-background.ts +68 -0
- package/src/nexus/api/running-runs-child.ts +6 -0
- package/src/nexus/api/setup-claim.ts +21 -0
- package/src/nexus/api/share-captures.ts +91 -0
- package/src/nexus/api/skill-problems.ts +56 -0
- package/src/nexus/api/terminals.ts +24 -8
- package/src/nexus/config/secrets/file-backend.ts +56 -18
- package/src/nexus/index.ts +25 -1
- package/src/nexus/setup-status.ts +7 -2
- package/src/oauth/browser-availability.ts +14 -0
- package/src/oauth/codex-quota-policy.ts +16 -0
- package/src/onboarding/continue-here.ts +13 -8
- package/src/onboarding/first-run-doctor.ts +54 -0
- package/src/onboarding/web-first.ts +8 -1
- package/src/onboarding.ts +66 -12
- package/src/persona/presets.ts +105 -0
- package/src/release-loop/checklist.ts +33 -69
- package/src/release-loop/feature-store.ts +327 -0
- package/src/release-loop/manifest.ts +59 -5
- package/src/seat-dispatch/ceo-commands.ts +65 -0
- package/src/self-dev/orchestrate.ts +18 -11
- package/src/shell-env-bootstrap.ts +44 -7
- package/src/skills/connect-claude-plugin.ts +142 -0
- package/src/skills/connect.ts +70 -0
- package/src/skills/index.ts +29 -1
- package/src/skills/repair.ts +124 -0
- package/src/skills/runner.ts +11 -2
- package/src/skills/tools/usage-slash.ts +8 -7
- package/src/skills/trigger-extract.ts +1 -1
- package/src/task-orchestrator/surfaces/pod-command-job.ts +16 -8
- package/src/telegram-commands.ts +29 -0
- package/src/telegram-run.ts +83 -13
- package/src/telegram.ts +34 -0
- package/src/thinking-line.ts +28 -20
- package/src/tui/chat/execution-badge.ts +1 -1
- package/src/user-config.ts +111 -13
- package/src/ux-sim/turn-states.ts +1 -1
- package/src/version/packed-revision.json +1 -1
- package/apps/pwa/out/_next/static/chunks/4836-2eba6079f31b88d4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8067-f74bf14d67ad98f1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8519-f6b5d8a5833a7603.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8894-e92491a164192cc1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9454-a3e0953307216c58.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9740-67051141115ce775.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9804-64c02c3c127d5014.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-d5ebde04844689e6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-10ed24f413ed66e9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-211810b6c93ab66a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-cee86394de407aa6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-4ff8edab44196b8c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-92e4f44428d5e290.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-2a05dfe80c8bdf16.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/layout-d9979633aa82f8e6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-30533117beb53625.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-f7857826c2f97ad7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-9699b1786be6171d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-43dd772aee8af75f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-973ab7af59c718b7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-a9f8d3865b91e436.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/page-dd107bf1c7d52a90.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-d42b99cdfb9f27c6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-2764ff40dad5a995.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/share/page-c5f1152db116ff96.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-f933bca81ea38a6f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/term/page-a7aaffcf771662d8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/page-56adbe1a1f1379bd.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-a81f113f3ef89d72.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-fc27b00e20733146.js +0 -1
- package/apps/pwa/out/_next/static/css/f537bdb19c69306a.css +0 -1
- package/apps/pwa/out/_next/static/keajW7DDyghEs1y8oJe6T/_buildManifest.js +0 -1
- /package/apps/pwa/out/_next/static/{keajW7DDyghEs1y8oJe6T → bFI5EEwg7T6aG88ibX4Zq}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9740],{19528:(e,t,n)=>{n.d(t,{Er:()=>s,cj:()=>c,dc:()=>r,yR:()=>i});let a=/^(oauth\.|harness\.decision|llm\.router)/;function s(e){let t=[],n=e=>{"string"==typeof e&&e.trim()&&!t.includes(e.trim())&&t.push(e.trim())};for(let t of e){var s;let e=null!=(s=t.data)?s:{};if(t.category.startsWith("oauth.")){for(let t of["from","to","name","account"])n(e[t]);if(Array.isArray(e.usage))for(let t of e.usage)n(null==t?void 0:t.name);continue}if(a.test(t.category))for(let t of(n(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))n(e[1])}}return t}function l(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r(e){let t=new Map(e.map((e,t)=>[e,"account-".concat(t+1)])),n=e.length?RegExp("(^|[^\\w-])(".concat(e.map(l).sort((e,t)=>t.length-e.length).join("|"),")(?![\\w-])"),"g"):null,a=new Map;return(e,s)=>{let l=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 n=a.get(t);return e===e.toUpperCase()?n.toUpperCase():n})(e)).replace(/\bmbp\b/gi,e=>e===e.toUpperCase()?"LOCAL":"local").replace(/\/Users\/[^/\s"']+/g,"~").replace(/(크레딧|credits?|💳)(\s*[:=]?\s*)[\d][\d,.]*/gi,"$1$2•••").replace(/[\d][\d,.]*(\s*)(크레딧|credits?)/gi,"•••$1$2").replace(/\$\s?[\d][\d,.]*/g,"$•••").replace(/(잔량?|remaining|left)(\s*[:=]?\s*)(?:[A-Za-z0-9][\w.-]*\s+)?\d+(?:\.\d+)?\s?%/gi,"$1$2•••");return s&&n&&(l=l.replace(n,(e,n,a)=>{var s;return"".concat(n).concat(null!=(s=t.get(a))?s:"account")})),l}}function o(e,t){if("string"==typeof e)return t(e);if(Array.isArray(e))return e.map(e=>o(e,t));if(e&&"object"==typeof e){let n={};for(let[a,s]of Object.entries(e))"apiEquivalentUsd"===a||"usd"===a||/credit(s|Balance)?$/i.test(a)||(n[a]=o(s,t));return n}return e}function i(e){let t=r(s(e));return e.map(e=>{let n=a.test(e.category);return{...e,event:t(e.event,!1),data:e.data?o(e.data,e=>t(e,n)):e.data}})}function c(e,t){let n=r(t);return o(e,e=>n(e,!0))}},20796:(e,t,n)=>{n.d(t,{D3:()=>x,GJ:()=>g,Gp:()=>r,HR:()=>p,IE:()=>f,JW:()=>u,Jo:()=>v,NZ:()=>m,OL:()=>o,cD:()=>h,f:()=>c,fT:()=>b,kJ:()=>i,lb:()=>d});var a=n(79665);let s=e=>"string"==typeof e&&e.trim()?e:null,l=e=>"number"==typeof e&&Number.isFinite(e)?e:0;function r(e){let t=[];for(let i of e){var n,a,r,o;if(!i.category.startsWith("llm.usage"))continue;let e=null!=(n=i.data)?n:{},c=Date.parse(i.ts);if(!Number.isFinite(c))continue;let d=null!=(a=e.cost)?a:{};t.push({ts:i.ts,t:c,model:null!=(r=s(e.model))?r:"unknown",site:null!=(o=s(e.site))?o:"unknown",billing:s(e.billing),provider:s(e.billingProvider),input:l(e.inputTokens),output:l(e.outputTokens),cache:l(e.cacheReadInputTokens),apiUsd:l(d.apiEquivalentUsd)})}return t.sort((e,t)=>t.t-e.t)}function o(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:30,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6e4,s=Math.floor(t/a)*a-(n-1)*a,l=Array.from({length:n},(e,t)=>({t:s+t*a,count:0,tokens:0,byModel:{}}));for(let t of e){var r;let e=Math.floor((t.t-s)/a);if(e<0||e>=n)continue;let o=l[e];o.count+=1,o.tokens+=t.input+t.output,o.byModel[t.model]=(null!=(r=o.byModel[t.model])?r:0)+1}return l}function i(e,t,n){let a=t-n/2,s=new Map;for(let r of e){var l;if(r.t<t-n)continue;let e=null!=(l=s.get(r.model))?l:{count:0,tokens:0,late:0,early:0};e.count+=1,e.tokens+=r.input+r.output,r.t>=a?e.late+=1:e.early+=1,s.set(r.model,e)}return[...s.entries()].map(e=>{let[t,n]=e;return{model:t,count:n.count,tokens:n.tokens,delta:n.late>n.early?1:n.late<n.early?-1:0}}).sort((e,t)=>t.count-e.count)}function c(e){var t,n,a;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=new Map,o=new Map;for(let a of e)r.set(a.model,(null!=(t=r.get(a.model))?t:0)+1),o.set(a.site,(null!=(n=o.get(a.site))?n:0)+1);let i=[...r.entries()].sort((e,t)=>t[1]-e[1]).slice(0,s).map(e=>{let[t]=e;return t}),c=[...o.entries()].sort((e,t)=>t[1]-e[1]).slice(0,l).map(e=>{let[t]=e;return t}),d={},u=0;for(let t of e){if(!i.includes(t.model)||!c.includes(t.site))continue;let e="".concat(t.model,"|").concat(t.site);d[e]=(null!=(a=d[e])?a:0)+1,u=Math.max(u,d[e])}return{models:i,sites:c,cells:d,max:u}}function d(e){let t=new Map;for(let a of e){var n;let e=s(null==(n=a.data)?void 0:n.runId),l=Date.parse(a.ts);if(!e||!Number.isFinite(l))continue;let r=t.get(e);r?(r.lo=Math.min(r.lo,l),r.hi=Math.max(r.hi,l)):t.set(e,{lo:l,hi:l})}return[...t.entries()].map(e=>{let[t,n]=e;return{runId:t,ms:n.hi-n.lo}})}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,n=Array(t).fill(0);if(0===e.length)return{bins:n,lo:0,hi:0,max:0};let a=Math.min(...e),s=Math.max(...e),l=(s-a)/t||1;for(let s of e)n[Math.min(t-1,Math.floor((s-a)/l))]+=1;return{bins:n,lo:a,hi:s,max:Math.max(...n)}}function p(e){let t=Object.fromEntries(a.lV.map(e=>[e,0]));for(let n of e.snapshot.runs)n.current&&(t[n.current]+=1);let n=null;for(let e of a.lV)t[e]>0&&(!n||t[e]>t[n])&&(n=e);return{counts:t,busiest:n}}function h(e){let t=0,n=0;for(let s of e){let e=(0,a.dl)(s);"gate"===e.stage&&("ok"===e.tone?t+=1:"bad"===e.tone&&(n+=1))}return{pass:t,fail:n}}function m(e){let t=new Set,n=new Set;for(let o of e){var a,r;if(!o.category.startsWith("review-loop"))continue;let e=null!=(a=o.data)?a:{},i=null!=(r=s(e.pr))?r:l(e.prNumber)?String(l(e.prNumber)):null;i&&(("rework-start"===o.event||"judge-verdict"===o.event&&l(e.asks)>0)&&t.add(i),/merged/.test(o.event)&&n.add(i))}return[...t].filter(e=>n.has(e))}function f(e){let t=new Map;for(let a of e){var n;let e=s(null==(n=a.data)?void 0:n.runId);e&&a.instance&&!t.has(e)&&t.set(e,a.instance)}return[...t.entries()].map(e=>{let[t,n]=e;return{runId:t,instance:n}})}function x(e){let t=new Map;for(let i of e){var n,a,r,o;let e=s(null==(n=i.data)?void 0:n.runId);if(!e)continue;let c=Date.parse(i.ts),d=null;if("decompose-and-retry.applied"===i.event&&Array.isArray(null==(a=i.data)?void 0:a.pieceFeatures))d=i.data.pieceFeatures.map(e=>"string"==typeof e?e:"").filter(Boolean);else if("goal-steps-decomposed"===i.event&&l(null==(r=i.data)?void 0:r.stepCount)>1){let e=Math.min(12,l(null==(o=i.data)?void 0:o.stepCount));d=Array.from({length:e},(t,n)=>"단계 ".concat(n+1,"/").concat(e))}if(!d||0===d.length)continue;let u=t.get(e);(!u||c>=u.t)&&t.set(e,{t:c,pieces:d.slice(0,12)})}return[...t.entries()].map(e=>{let[t,n]=e;return{runId:t,pieces:n.pieces}})}function g(e){let t=[];for(let a of e){var n;if("harness.substrate"!==a.category||"dispatch-pod"!==a.event)continue;let e=s(null==(n=a.data)?void 0:n.podPool);e&&t.push({pool:e,ts:a.ts})}return t}function v(e){let t=new Map,n=new Map;for(let u of e){var r,o,i,c,d;let e=s(null==(r=u.data)?void 0:r.runId);if(!e)continue;u.category.startsWith("review-loop")&&"rework-start"===u.event&&t.set(e,Math.max(null!=(i=t.get(e))?i:0,l(null==(o=u.data)?void 0:o.round)||(null!=(c=t.get(e))?c:0)+1));let p=(0,a.dl)(u);"gate"===p.stage&&"bad"===p.tone&&n.set(e,(null!=(d=n.get(e))?d:0)+1)}return[...[...t.entries()].map(e=>{let[t,n]=e;return{runId:t,stage:"review",retries:n}}),...[...n.entries()].map(e=>{let[t,n]=e;return{runId:t,stage:"gate",retries:n}})]}function b(e){let t=new Map;for(let l of e){var n;let e=s(null==(n=l.data)?void 0:n.runId);if(!e)continue;let{stage:r,tone:o}=(0,a.dl)(l),i="".concat(e,"|").concat(l.category,".").concat(l.event),c=t.get(i);if(c){c.count+=1,c.bad||(c.bad="bad"===o);continue}t.set(i,{runId:e,key:i,label:l.event,stage:r,count:1,bad:"bad"===o})}return[...t.values()]}},51215:(e,t,n)=>{let a;n.d(t,{cY:()=>d,x8:()=>o});let s={debug:0,info:1,warn:2,error:3},l="/v1/debug-logs/batch",r=null;function o(e){r=e}class i{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(s[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)]<s[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,n=JSON.stringify({records:e});try{var a,s;t=await (a=this.fetchFn(n),s=this.postTimeoutMs,new Promise((e,t)=>{let n=setTimeout(()=>t(Error("debug-forward timeout after ".concat(s,"ms"))),s);a.then(t=>{clearTimeout(n),e(t)},e=>{clearTimeout(n),t(e)})}))}catch(e){t=!1}finally{this.inFlight=!1}if(!t){if(this.consecutiveFailures+=1,this.consecutiveFailures>=2&&r)try{await r(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let l=this.lastOkAt;this.lastOkAt=Date.now();let o=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:o,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches,pending:this.queue.length,previousOkAt:l},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(l,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",n=1e4,a=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=n,this.flushMs=a,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(l,{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 n=new Date().toISOString();if(void 0!==t){let a="";try{let e=new WeakSet;a=JSON.stringify(t,(t,n)=>{if("bigint"==typeof n)return"".concat(n.toString(),"n");if("function"==typeof n)return"[fn ".concat(n.name||"anon","]");if(n&&"object"==typeof n){if(e.has(n))return"[circular]";e.add(n)}return n})}catch(e){a="[unserializable: ".concat(String(e),"]")}a&&a.length>800&&(a=a.slice(0,797)+"..."),console.debug("[".concat(n,"] ").concat(e," ").concat(a),t),u(n,e,a)}else console.debug("[".concat(n,"] ").concat(e)),u(n,e,void 0)}function u(e,t,n){let s,l=function(){if(void 0!==a)return a;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 a=null,null;let t=new i(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return a=t,t}();if(!l)return;let r=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==n&&""!==n)try{s=JSON.parse(n)}catch(e){s=n}l.push({ts:e,category:t,event:r,...void 0!==s?{data:s}:{},source:{platform:"pwa"}})}},54061:(e,t,n)=>{n.d(t,{HI:()=>r});var a=n(91269),s=n(42012),l=n(91514);function r(e){var t,n,r;let o=(0,l.M1)(),i=(t,n)=>{var a;return{queryKey:["live","logs",t,null!=(a=e.store)?a:"",e.windowMinutes],queryFn:()=>o.getLogs({category:t,since:"".concat(e.windowMinutes,"m"),limit:n,store:e.store}),refetchInterval:5e3}},c=(0,s.I)(i("goal-author,harness.frontdoor,harness.substrate,harness.boundary,harness.role-llm,dev-pipeline,self-dev,self-gate,review-loop",1500)),d=(0,s.I)(i("llm.usage",2e3)),u=(0,s.I)(i("harness.decision,oauth.codex-account,harness.boundary",300)),p=(0,s.I)(i("research",300)),h=(0,a.useMemo)(()=>{var e,t,n,a,s,l,r,o;return[...null!=(s=null==(e=c.data)?void 0:e.logs)?s:[],...null!=(l=null==(t=d.data)?void 0:t.logs)?l:[],...null!=(r=null==(n=u.data)?void 0:n.logs)?r:[],...null!=(o=null==(a=p.data)?void 0:a.logs)?o:[]]},[c.data,d.data,u.data,p.data]),m={data:(0,a.useMemo)(()=>({ok:!0,logs:h,count:h.length}),[h]),error:null!=(r=null!=(n=null!=(t=c.error)?t:d.error)?n:u.error)?r:null,dataUpdatedAt:Math.max(c.dataUpdatedAt,d.dataUpdatedAt,u.dataUpdatedAt,p.dataUpdatedAt),truncated:[c,d,u].some(e=>e.data&&e.data.count>=(e===d?2e3:e===c?1500:300)),...function(e){let t=new Set,n=new Set,a=null;for(let r of e){var s,l;for(let e of null!=(s=null==r?void 0:r.stores)?s:[])t.add(e);for(let e of null!=(l=null==r?void 0:r.failedStores)?l:[])n.add(e.name);"number"==typeof(null==r?void 0:r.registeredStores)&&(a=Math.max(null!=a?a:0,r.registeredStores))}return{stores:[...t],failedStores:[...n],registeredStores:a}}([c.data,d.data,u.data,p.data])};return{logs:m,runs:(0,s.I)({queryKey:["live","runs"],queryFn:()=>o.getHarnessRuns(),refetchInterval:6e4}),instances:(0,s.I)({queryKey:["live","instances"],queryFn:()=>o.getLogInstances(),staleTime:6e4})}}},68550:(e,t,n)=>{n.d(t,{RT:()=>h});var a=n(41121),s=n(91269),l=n(45609),r=n.n(l),o=n(42012),i=n(91514),c=n(79665),d=n(51215);let u={"no-screen-key":"이 인스턴스 로그에 이 런의 화면 키가 없다 — 다른 우주(시험\xb7Pod)에서 돈 런이면 그 우주에서 본다.","screen-missing":"화면 키는 있는데 화면 파일이 없다 — 런이 끝나 화면이 정리됐을 수 있다.","log-store-missing":"이 인스턴스에 로그 저장소가 없다.","log-store-unreadable":"로그 저장소를 읽지 못했다."};function p(e){var t,n;let{runId:s,run:l,screen:o,screenError:i,lines:d,stopState:p,stopMessage:h,onStop:m,onConfirmStop:f,onCancelStop:x,onClose:g,max:v}=e,b=!!(null==o?void 0:o.stoppable);return(0,a.jsxs)("section",{className:"space-y-2 rounded-lg border border-primary/40 bg-card/60 p-3","aria-label":"런 서랍","data-live-run-drawer":s,children:[(0,a.jsxs)("header",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:s}),(null==l?void 0:l.current)&&(0,a.jsx)("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[11px]",children:c.fQ[l.current]}),(null==l?void 0:l.blocked)&&(0,a.jsx)("span",{className:"rounded bg-error/15 px-1.5 py-0.5 text-[11px] text-error",children:"막힘"}),(null==l?void 0:l.pr)&&(0,a.jsxs)("span",{className:"font-mono text-[11px]",children:["PR #",l.pr]}),(0,a.jsxs)("span",{className:"ml-auto flex items-center gap-2",children:[v&&("confirm"===v.state?(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs",role:"alertdialog","aria-label":"MAX 이 런만 확인",children:[(0,a.jsx)("span",{className:"text-amber-500",children:"이 런만 30분 상세 계측(부하가 든다)?"}),(0,a.jsx)("button",{type:"button",onClick:v.confirm,className:"rounded-md border border-amber-500 px-2 py-1 text-amber-600 hover:bg-amber-500/10","data-elanous-action":"live-run-max-confirm",children:"켜기"}),(0,a.jsx)("button",{type:"button",onClick:v.cancel,className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-muted",children:"취소"})]}):(0,a.jsx)("button",{type:"button",onClick:v.ask,disabled:"on"===v.state,className:"rounded-md border px-2 py-1 text-xs hover:bg-muted disabled:opacity-50","data-elanous-action":"live-run-max",title:"이 런의 판단 \xab왜\xb7목적\xb7어디로\xbb를 30분 자세히 남긴다",children:"on"===v.state?"● MAX 이 런 켜짐":"failed"===v.state?"MAX 못 켬 \xb7 다시":"MAX 이 런만"})),(0,a.jsx)(r(),{href:"/trace?level=L2&run=".concat(encodeURIComponent(s)),className:"rounded-md border px-2 py-1 text-xs hover:bg-muted","data-elanous-action":"live-run-trace",children:"Trace 로 →"}),!!(null==l?void 0:l.pr)&&"ok"!==l.stages.land&&(0,a.jsx)(r(),{href:"/approvals?pr=".concat(encodeURIComponent(l.pr)),className:"rounded-md border px-2 py-1 text-xs hover:bg-muted","data-elanous-action":"live-run-approvals",children:"승인 카드로 →"}),"confirm"===p?(0,a.jsxs)("span",{className:"flex items-center gap-1 text-xs",role:"alertdialog","aria-label":"멈춤 확인",children:[(0,a.jsx)("span",{className:"text-error",children:"이 런을 멈출까요? 되돌릴 수 없습니다."}),(0,a.jsx)("button",{type:"button",onClick:f,className:"rounded-md border border-error px-2 py-1 text-error hover:bg-error/10","data-elanous-action":"live-run-stop-confirm",children:"멈춤"}),(0,a.jsx)("button",{type:"button",onClick:x,className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-muted",children:"취소"})]}):(0,a.jsx)("button",{type:"button",onClick:m,disabled:!b||"stopping"===p||"stopped"===p,title:b?"부드러운 멈춤을 보낸다(확인 한 번)":"살아 있는 화면이 없어 멈출 수 없다",className:"rounded-md border px-2 py-1 text-xs hover:bg-muted disabled:opacity-40","data-elanous-action":"live-run-stop",children:"⏹ 멈춤"}),(0,a.jsx)("button",{type:"button",onClick:g,className:"rounded-md px-2 py-1 text-xs text-muted-foreground hover:bg-muted","aria-label":"서랍 닫기",children:"✕"})]})]}),h&&(0,a.jsx)("p",{className:"text-xs ".concat("failed"===p?"text-error":"text-muted-foreground"),"data-live-run-stop-result":!0,children:h}),(0,a.jsxs)("div",{className:"grid gap-2 lg:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["화면",(null==o?void 0:o.screenKey)?(0,a.jsxs)("span",{className:"ml-1 font-mono",children:["\xb7 ",o.screenKey]}):null]}),(0,a.jsx)("pre",{className:"max-h-64 overflow-auto rounded-md border bg-muted/30 p-2 text-[11px] leading-relaxed","data-live-run-screen":!0,children:i?"화면을 못 읽었다: ".concat(i):null!=(n=null==o?void 0:o.text)?n:(null==o?void 0:o.reason)?null!=(t=u[o.reason])?t:o.reason:"불러오는 중…"})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"mb-1 text-xs font-medium text-muted-foreground",children:["로그 ",(0,a.jsxs)("span",{className:"font-mono",children:["\xb7 ",d.length]})]}),(0,a.jsx)("pre",{className:"max-h-64 overflow-auto rounded-md border bg-muted/30 p-2 text-[11px] leading-relaxed","data-live-run-log":!0,children:d.slice(0,40).join("\n")||"—"})]})]})]})}function h(e){var t;let{runId:n,run:l,lines:r,onClose:c}=e,u=(0,i.M1)(),h=(0,o.I)({queryKey:["live","run-screen",n],queryFn:()=>u.getRunScreen(n,60),refetchInterval:3e3}),[m,f]=(0,s.useState)("idle"),[x,g]=(0,s.useState)(null),[v,b]=(0,s.useState)("idle");return(0,a.jsx)(p,{runId:n,run:l,screen:null!=(t=h.data)?t:null,screenError:h.error?h.error instanceof Error?h.error.message:String(h.error):null,lines:r,stopState:m,stopMessage:x,onStop:()=>f("confirm"),onConfirmStop:()=>{var e;let t=null==(e=h.data)?void 0:e.screenKey;t&&(f("stopping"),u.stopHarness(t).then(e=>{var t;let a=!!e.stopped;(0,d.cY)("pwa.live.run-stop",{runId:n,ok:a}),f(a?"stopped":"failed"),g(a?"멈춤을 보냈다 — 런이 다음 확인 지점에서 멈춘다(".concat(e.stopped,")."):"멈추지 못했다: ".concat(null!=(t=e.error)?t:"알 수 없음"))}).catch(e=>{(0,d.cY)("pwa.live.run-stop",{runId:n,ok:!1}),f("failed"),g("멈추지 못했다: ".concat(e instanceof Error?e.message:String(e)))}))},onCancelStop:()=>f("idle"),onClose:c,max:{state:v,ask:()=>b("confirm"),confirm:()=>{u.setLiveDetail({scope:n,ttlMin:30,by:"pwa-run-drawer"}).then(e=>{b(e.on?"on":"failed"),(0,d.cY)("pwa.live.run-max",{runId:n,on:e.on})}).catch(()=>b("failed"))},cancel:()=>b("idle")}})}},79665:(e,t,n)=>{n.d(t,{jg:()=>v,lV:()=>i,fQ:()=>c,Hc:()=>y,dl:()=>d,qo:()=>m,hS:()=>x,Yu:()=>f,BP:()=>g});let a={budget:"예산",placement:"장소",relation:"관계",memory:"기억"},s=e=>null===e||"object"!=typeof e||Array.isArray(e)?null:e,l=new Set(["한도 도달","후보 없음","측정 불가: 시간 초과"]);function r(e){if("string"!=typeof e)return null;let t=e.trim();return l.has(t)?t.slice(0,80):null}function o(e){let t=r(e);return"확인 못 함".concat(t?" \xb7 ".concat(t):"")}let i=["author","decompose","build","gate","review","land"],c={author:"저작",decompose:"분해",build:"구현",gate:"게이트",review:"리뷰",land:"착지"};function d(e){var t;let n=e.category,a=e.event,s="error"===e.level||/(fail|reject|block|abandon|conflict|error|unconvergeable|timeout)/i.test(a)?"bad":/(merged|pass|done|ok|opened|completed|approved)/i.test(a)?"ok":"info";if("self-implement.pod.ledger"===n&&"string"==typeof(null==(t=e.data)?void 0:t.stage)){let t=e.data.stage,n="string"==typeof e.data.status?e.data.status:"",a=/(fail|block|abandon|reject|error)/i.test(n)||/(fail|block|abandon)/i.test(t)?"bad":s,l=/^(implement|repair)/i.test(t)?"build":/^gat/i.test(t)?"gate":/^review/i.test(t)?"review":/(merged|pr-opened|landed|auto-merge)/i.test(t)?"land":null;if(l)return{stage:l,tone:"land"===l&&"bad"!==a?"ok":a}}return n.startsWith("goal-author")||n.startsWith("harness.frontdoor")||"dev-pipeline"===n&&/^(plan|selection|base-selection)$/.test(a)?{stage:"author",tone:s}:n.startsWith("self-dev")&&/decompos/i.test(a)||"self-dev.orchestrate"===n&&"start"===a?{stage:"decompose",tone:s}:n.startsWith("self-dev.spawn")||n.startsWith("harness.substrate")||"self-implement"===n||"dev-pipeline"===n&&"harness.launch"===a?{stage:"build",tone:s}:n.startsWith("self-gate")||n.startsWith("self-dev.reduce")&&/gate/i.test(a)?{stage:"gate",tone:s}:n.startsWith("review-loop")&&/(merged|auto-merge)/i.test(a)?{stage:"land",tone:"ok"}:n.startsWith("review-loop")?{stage:"review",tone:s}:n.startsWith("self-dev.reduce")&&/(pr-opened|merged)/i.test(a)||"dev-pipeline"===n&&"done"===a?{stage:"land",tone:s}:{stage:null,tone:s}}let u=e=>"string"==typeof e&&e.trim()?e:null,p=e=>"number"==typeof e&&Number.isFinite(e)?e:0;function h(e){var t,n,a,s,l;let r=null!=(t=e.data)?t:{},o=null!=(n=u(r.pr))?n:p(r.prNumber)?String(r.prNumber):null;return e.category.startsWith("review-loop")&&"judge-verdict"===e.event?"리뷰 판정: ".concat(null!=(a=u(r.verdict))?a:"?").concat(o?" \xb7 #".concat(o):"").concat(p(r.asks)?" \xb7 요구 ".concat(p(r.asks)):""):e.category.startsWith("review-loop")&&/merged/.test(e.event)?"자동 병합".concat(o?" #".concat(o):""):e.category.startsWith("review-loop")&&"rework-start"===e.event?"리뷰 반영 라운드 ".concat(p(r.round)||"?"," 시작").concat(o?" \xb7 #".concat(o):""):e.category.startsWith("llm.router")&&/fallback/i.test(e.event)?"모델 폴백: ".concat(null!=(s=u(r.from))?s:"?"," → ").concat(null!=(l=u(r.to))?l:"?"):e.category.startsWith("oauth")&&/rotat/i.test(e.event)?"계정 회전".concat(u(r.account)?": ".concat(u(r.account)):""):e.category.startsWith("harness.boundary")?"경계 밖 쓰기 거절".concat(u(r.path)?": ".concat(u(r.path)):""):e.category.startsWith("self-dev.reduce")&&/gate-failed/.test(e.event)?"게이트 실패 → 수리 라운드":"dev-pipeline"===e.category&&"rejected"===e.event?"발사 전 검사가 막았다".concat(u(r.reason)?": ".concat(u(r.reason)):""):null}function m(e,t){let n=new Date(e);return Number.isNaN(n.getTime())?e.slice(11,19):n.toLocaleTimeString("en-GB",{hour12:!1,...t?{timeZone:t}:{}})}function f(e){return/Error:|ENOENT|EACCES|EPERM|ECONN|TypeError|\bstack\b|at\s+\S+\s+\(|\/Users\/|\/home\/|\\/.test(e)}function x(e,t){return null==e?e:"owner"!==t&&f(e)?"실패 — 자세한 사유는 오너 화면에서":e}function g(e,t){var n;let a=null!=(n=e.data)?n:{},s=["runId","pr","verdict","model","provider","round","reason"].map(e=>void 0!==a[e]&&null!==a[e]&&""!==a[e]?"".concat(e,"=").concat(String(a[e]).slice(0,40)):null).filter(Boolean).join(" ");return"".concat(m(e.ts,t)," ").concat(e.category," ").concat(e.event).concat(s?" \xb7 ".concat(s):"").replace(/\b(sk-[A-Za-z0-9_-]{8,}|ghp_[A-Za-z0-9]{8,}|gho_[A-Za-z0-9]{8,}|xox[abpr]-[A-Za-z0-9-]{8,}|AKIA[0-9A-Z]{12,})\b/g,"[redacted]").replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]{8,}/gi,"$1[redacted]").replace(/("?(?:token|secret|password|apiKey|api_key|authorization)"?\s*[:=]\s*")[^"]{4,}"/gi,'$1[redacted]"')}let v=["PLAN","ROUTE","VERIFY","HEAL","ESCALATE","SHIP"];function b(e){let t=e.category,n=e.event;if("harness.decision"===t){var a;let t="string"==typeof(null==(a=e.data)?void 0:a.kind)?e.data.kind.toUpperCase():"";return v.includes(t)?t:null}return t.startsWith("review-loop")&&/merged/.test(n)||t.startsWith("self-dev.reduce")&&/(pr-opened|merged)/.test(n)?"SHIP":/(needs-human|hitl|escalat|parked)/i.test(n)||"dev-pipeline"===t&&"rejected"===n?"ESCALATE":t.startsWith("review-loop")&&/^rework-start$/.test(n)||/repair|rework-round/i.test(n)||t.startsWith("self-dev.supervisor")&&/(resume|retry)/i.test(n)?"HEAL":t.startsWith("review-loop")&&/verdict/.test(n)||t.startsWith("self-gate")||t.startsWith("self-dev.reduce")&&/gate/.test(n)?"VERIFY":t.startsWith("oauth.codex-account")&&/rotation$/.test(n)||t.startsWith("llm.router")&&/fallback/i.test(n)||t.startsWith("harness.role-llm")||t.startsWith("harness.substrate")&&/dispatch/.test(n)||t.startsWith("harness.boundary")?"ROUTE":t.startsWith("goal-author")&&/(done|assembled|phase-end)/.test(n)||t.startsWith("self-dev")&&/decompos/i.test(n)||"dev-pipeline"===t&&"plan"===n?"PLAN":null}function y(e,t,n){let l=function(e,t,n){var a,s,l,r,o,i,c,m,f,x;let g=n.now-6e4*n.windowMinutes,v=e.filter(e=>Date.parse(e.ts)>=g).sort((e,t)=>Date.parse(e.ts)-Date.parse(t.ts)),b=new Map,y=[],w=new Map,k=new Map,j=0,N=0;for(let e of v){let t=null!=(s=e.data)?s:{},n=u(t.runId);if(e.category.startsWith("llm.usage")){j+=1,N+=p(t.inputTokens)+p(t.outputTokens)+p(t.totalTokens&&!t.inputTokens?t.totalTokens:0);let e=null!=(r=null!=(l=u(t.model))?l:u(t.provider))?r:"unknown";w.set(e,(null!=(o=w.get(e))?o:0)+1)}if(e.category.startsWith("review-loop")&&"judge-verdict"===e.event){let e=null!=(i=u(t.verdict))?i:"unknown";k.set(e,(null!=(c=k.get(e))?c:0)+1)}let a=h(e),{stage:x,tone:g}=d(e);if(a&&y.push({ts:e.ts,runId:n,tone:/merged/.test(e.event)?"ok":g,text:a}),!n||!x)continue;let v=null!=(m=b.get(n))?m:{runId:n,stages:{},current:null,lastTs:e.ts,events:0,blocked:!1,pr:null,ledgerStatus:null};v.stages[x]=g,v.current=x,v.lastTs=e.ts,v.events+=1,v.blocked="bad"===g,v.pr=null!=(f=u(t.pr))?f:p(t.prNumber)?String(p(t.prNumber)):v.pr,b.set(n,v)}let M=new Map(t.map(e=>[e.runId,e]));for(let e of b.values())e.ledgerStatus=null!=(x=null==(a=M.get(e.runId))?void 0:a.status)?x:null;let S=[...b.values()].sort((e,t)=>Date.parse(t.lastTs)-Date.parse(e.lastTs)),E=S.filter(e=>"land"!==e.current&&n.now-Date.parse(e.lastTs)<9e5).length,I=e=>[...e.entries()].map(e=>{let[t,n]=e;return{name:t,count:n}}).sort((e,t)=>t.count-e.count);return{runs:S,cards:y.slice(-40).reverse(),counters:{activeRuns:E,llmRequests:j,llmRequestsPerMin:n.windowMinutes>0?Math.round(j/n.windowMinutes*10)/10:0,tokens:N,landed:S.filter(e=>"ok"===e.stages.land).length,blocked:S.filter(e=>e.blocked).length},providers:I(w),reviewVerdicts:I(k),windowMinutes:n.windowMinutes}}(e,t,n),i=n.now-6e4*n.windowMinutes,c=e.filter(e=>Date.parse(e.ts)>=i).sort((e,t)=>Date.parse(e.ts)-Date.parse(t.ts)),m=[],f={},x=new Set,g=new Map,v=new Map,y=new Map,w=0,k=new Set(c.filter(e=>"harness.decision"===e.category).map(e=>b(e)).filter(Boolean));for(let e of c){var j,N,M,S,E,I,A,T,C,R,L,P,O,F,H;let t=null!=(j=e.data)?j:{},n=u(t.runId);if(e.category.startsWith("review-loop")&&p(t.round)&&n&&(f[n]=Math.max(null!=(N=f[n])?N:0,p(t.round))),e.category.startsWith("review-loop")&&"judge-verdict"===e.event&&u(t.pr)&&p(t.round)){let e=null!=(M=y.get(u(t.pr)))?M:new Map;e.set(p(t.round),p(t.asks)),y.set(u(t.pr),e)}if(e.category.startsWith("llm.usage")){let e=p(t.inputTokens)+p(t.outputTokens);w+=e;let n=null!=(S=u(t.model))?S:"unknown",a=null!=(E=v.get(n))?E:{requests:0,tokens:0,billing:u(t.billing)};a.requests+=1,a.tokens+=e,v.set(n,a)}let l=b(e);if(!l||"harness.decision"!==e.category&&k.has(l))continue;let i="harness.decision"===e.category&&"string"==typeof t.what?function(e,t){var n,l;let i,c=/^execution-loop (budget|placement|relation|memory) gate$/.exec(e);if(!c)return null;let d=c[1],u="관문 \xb7 ".concat(a[d]),p=null;try{p=s(JSON.parse(null!=t?t:""))}catch(e){p=null!=(n=function(e,t){if(!t||t.startsWith("{"))return null;if(t.startsWith("unavailable"))return{decision:"unavailable"};let n=new Map;for(let e of t.split(" \xb7 ")){let t=e.indexOf("=");t>0&&!n.has(e.slice(0,t))&&n.set(e.slice(0,t),e.slice(t+1))}if(!n.size)return null;switch(e){case"budget":if(!n.has("action"))return null;return{decision:{action:n.get("action"),...n.get("provider")?{provider:n.get("provider")}:{},reasons:n.get("reason")?[n.get("reason")]:[]}};case"placement":{if(!n.has("substrate"))return null;let e=n.get("pool");return{decision:{substrate:n.get("substrate"),pool:e&&"none"!==e?e:null,...n.get("memory")?{memory:{limit:n.get("memory")}}:{}}}}case"relation":{let e=Number(n.get("overlap"));if(!Number.isInteger(e)||e<0)return null;return{decision:{action:"record",overlappingCards:Array.from({length:e},(e,t)=>"card-".concat(t+1))}}}case"memory":{let e=n.get("context");if("recalled"!==e&&"none"!==e)return null;return{decision:{action:"record",context:"recalled"===e?"recalled":null}}}}}(d,null!=t?t:""))?n:function(e){if(!e.startsWith('{"decision":{'))return null;let t={},n=t=>{var n;return null==(n=new RegExp('"'.concat(t,'":"([^"\\\\]*)"')).exec(e))?void 0:n[1]},a=n("action");a&&(t.action=a);let s=n("provider");s&&(t.provider=s);let l=n("substrate");l&&(t.substrate=l);let r=/"pool":(null|"([^"\\]*)")/.exec(e);r&&(t.pool="null"===r[1]?null:r[2]);let o=/"memory":\{[^}]*"limit":"([^"\\]*)"/.exec(e);o&&(t.memory={limit:o[1]});let i=/"overlappingCards":\[([^\]]*)\]/.exec(e);i&&(t.overlappingCards=i[1].trim()?i[1].split(",").map(e=>e.trim().replace(/^"|"$/g,"")):[]);let c=/"context":(null|")/.exec(e);if(c&&(t.context="null"===c[1]?null:"recalled"),/"reasons":\[/.test(e)){let n=/"reasons":\[((?:"[^"\\]*",?)*)\]/.exec(e);t.reasons=n?[...n[1].matchAll(/"([^"\\]*)"/g)].map(e=>e[1]):[]}return Object.keys(t).length?{decision:t}:null}(null!=t?t:"")}let h=s(null==p?void 0:p.decision),m=null==p?void 0:p.explanation;if(!h)return{what:u,why:o(m)};switch(d){case"budget":{let e,t=h.action,n="string"==typeof(e=h.provider)&&/^(openai-codex|grok|anthropic|openai|google|local|openrouter)$/.test(e)?e:null,a="proceed"===t?"그대로 진행":"next-provider"===t?"다른 제공자로".concat(n?"(".concat(n,")"):""):"wait-reset"===t?"한도 회복까지 대기":"stop"===t?"멈춤":null;if(!a||!Array.isArray(h.reasons))return{what:u,why:o(m)};let s=r(h.reasons[0]);i="".concat(a).concat(s?" \xb7 ".concat(s):"");break}case"placement":{let e,t,n=h.substrate;if("pod"!==n&&"local"!==n&&"unknown"!==n)return{what:u,why:o(m)};let a="string"==typeof(e=h.pool)&&/^(?:fast-\d{1,2}|pool-msb\d{1,2}(?:@msb\d{1,2}:\d{1,2})?)$/.test(e)?e:null,r="string"==typeof(t=null==(l=s(h.memory))?void 0:l.limit)&&/^\d+(?:\.\d+)?\s*(?:[KMGT]i?B?|bytes?)$/i.test(t)?t.replace(/\s+/g," "):null;i="".concat("pod"===n?"Pod".concat(a?" ".concat(a):""):"local"===n?"이 기기":"모름").concat(r?" \xb7 메모리 한도 ".concat(r):"");break}case"relation":if("record"!==h.action||!Array.isArray(h.overlappingCards)||!h.overlappingCards.every(e=>"string"==typeof e))return{what:u,why:o(m)};i=h.overlappingCards.length?"겹치는 카드 ".concat(h.overlappingCards.length,"개"):"겹치는 일 없음";break;case"memory":if("record"!==h.action||"string"!=typeof h.context&&null!==h.context)return{what:u,why:o(m)};i=h.context?"지난 기록 있음":"지난 기록 없음"}return{what:u,why:i}}(t.what,null!=(I=u(t.reason))?I:void 0):null,c=null!=(T=null!=(A=null==i?void 0:i.why)?A:u(t.reason))?T:u(t.why),d=i?null:u(t.purpose),W=i?null:null!=(O=null!=(R=null!=(C=u(t.target))?C:u(t.to))?R:u(t.account))?O:"SHIP"===l&&(null!=(L=u(t.pr))?L:p(t.prNumber)?String(p(t.prNumber)):null)?"#".concat(null!=(P=u(t.pr))?P:p(t.prNumber)):null,q=i?null:n;"HEAL"===l&&n&&x.add(n);let D=p(t.paths)||void 0;m.push({ts:e.ts,kind:l,runId:q,what:null!=(F=null==i?void 0:i.what)?F:function(e,t){var n,a;return"harness.decision"===e.category&&"string"==typeof(null==(n=e.data)?void 0:n.what)?e.data.what:null!=(a=h(e))?a:"".concat(e.category," ").concat(e.event).slice(0,80)}(e,0),why:c,purpose:d,target:W,...D?{paths:D}:{}});let U=[c?null:"why",d?null:"purpose",W?null:"target"].filter(Boolean);if(U.length){let t=i?"harness.decision decision":"".concat(e.category," ").concat(e.event),n=null!=(H=g.get(t))?H:{count:0,lacks:new Set};n.count+=1,U.forEach(e=>n.lacks.add(e)),g.set(t,n)}}let W=[...x],q=W.filter(e=>{var t;return(null==(t=l.runs.find(t=>t.runId===e))?void 0:t.stages.land)==="ok"}).length;return{snapshot:l,gauges:{live:l.counters.activeRuns,decisions:m.length,decisionsPerMin:n.windowMinutes>0?Math.round(m.length/n.windowMinutes*10)/10:0,shipped:m.filter(e=>"SHIP"===e.kind).length,selfHealRate:W.length?Math.round(q/W.length*100):null,selfHealRuns:W.length,burnTokensPerMin:n.windowMinutes>0?Math.round(w/n.windowMinutes):0},stream:m.slice(-80).reverse(),emitted:c.filter(e=>"harness.decision"===e.category).length,rounds:f,convergence:[...y.entries()].map(e=>{let[t,n]=e;return{pr:t,points:[...n.entries()].sort((e,t)=>e[0]-t[0]).map(e=>{let[t,n]=e;return{round:t,asks:n}})}}),scorecard:[...v.entries()].map(e=>{let[t,n]=e;return{model:t,...n}}).sort((e,t)=>t.requests-e.requests),missing:[...g.entries()].map(e=>{let[t,n]=e;return{key:t,count:n.count,lacks:[...n.lacks]}}).sort((e,t)=>t.count-e.count)}}},82157:(e,t,n)=>{n.d(t,{cn:()=>l});var a=n(3511),s=n(97043);function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,s.QP)((0,a.$)(t))}},91514:(e,t,n)=>{n.d(t,{M1:()=>c,Qj:()=>d,tI:()=>i});var a=n(41121),s=n(91269),l=n(19855),r=n(24818);let o=(0,s.createContext)(null);function i(e){let{client:t,queryClient:n,defaultStaleTimeMs:i,children:c}=e,d=(0,s.useMemo)(()=>null!=n?n:new l.E({defaultOptions:{queries:{staleTime:null!=i?i:2e3,refetchOnWindowFocus:!1}}}),[n,i]);return(0,a.jsx)(o.Provider,{value:t,children:(0,a.jsx)(r.Ht,{client:d,children:c})})}function c(){let e=(0,s.useContext)(o);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,s.useContext)(o)}},99482:(e,t,n)=>{n.d(t,{xl:()=>v});var a=n(41121),s=n(91269),l=n(79665);let r={author:"PLAN",decompose:"PLAN",build:"ROUTE",gate:"VERIFY",review:"VERIFY",land:"SHIP"},o=(e,t)=>"phase:".concat(e,":").concat(t),i=new Set(["model","target","account","universe","pod"]);var c=n(20796);let d={PLAN:"#38bdf8",ROUTE:"#a78bfa",VERIFY:"#fbbf24",HEAL:"#34d399",ESCALATE:"#fb7185",SHIP:"#4ade80"},u={harness:"#e0e7ff",run:"#818cf8",phase:"#c7d2fe",pr:"#4ade80",model:"#f0abfc",target:"#93c5fd",event:"#a5b4fc",site:"#f5d0fe",account:"#fbcfe8",request:"#f0abfc",universe:"#67e8f9",piece:"#7dd3fc",pod:"#fcd34d"},p={ok:"#4ade80",bad:"#fb7185",info:"#c7d2fe"},h=["#f0abfc","#c4b5fd","#93c5fd","#67e8f9","#a7f3d0","#fde68a","#fca5a5"],m={harness:16,run:8,phase:5.5,pr:5,model:7,target:4,event:2.6,site:3,account:6,request:1.2,universe:7,piece:3.4,pod:7},f=new Set(["harness","run","phase","pr","model","account","target","universe","pod"]),x=[];function g(e){return!!(e.why||e.purpose||e.target)}function v(e){var t,n,v,C;let{board:L,rows:P=x,windowMinutes:O=60,sourceLabel:F="this instance",shippedSource:H="log",autoReplay:W=!0,publicCapture:q=!1,onSelectRun:D,role:U="owner"}=e,B=(0,s.useRef)(null),$=(0,s.useRef)({nodes:[],edges:[]}),G=(0,s.useRef)([]),V=(0,s.useRef)([]),z=(0,s.useRef)(null),Y=(0,s.useRef)([]),[J,K]=(0,s.useState)(null),[_,Q]=(0,s.useState)(!1),[X,Z]=(0,s.useState)(0),[ee,et]=(0,s.useState)(""),[en,ea]=(0,s.useState)(5),[es,el]=(0,s.useState)({nodes:0,edges:0}),er=(0,s.useRef)(1500),eo=()=>"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ei=e=>{G.current.push({from:e.from,to:e.to,kind:e.kind,t:0,speed:.022,alpha:1,size:3.6}),"SHIP"===e.kind&&V.current.push({id:e.to,t:0})},ec=(0,s.useMemo)(()=>(0,c.Gp)(P),[P]),ed=(0,s.useMemo)(()=>{let e=Date.now(),t=6e4*O,n=(0,c.lb)(P).map(e=>e.ms/6e4).filter(e=>e>0),a=ec.map(e=>e.input+e.output).filter(e=>e>0);return{now:e,candles:(0,c.OL)(ec,e,40,Math.max(6e4,6e4*Math.ceil(t/40/6e4))),bucketMin:Math.max(1,Math.ceil(t/40/6e4)),ticker:(0,c.kJ)(ec,e,t),heat:(0,c.f)(ec),hist:(0,c.JW)(n,40),tokHist:(0,c.JW)(a.map(e=>Math.log10(e)),40),spans:n.length,gate:(0,c.cD)(P),load:(0,c.HR)(L),events:(0,c.fT)(P),universes:(0,c.IE)(P),plans:(0,c.D3)(P),pods:(0,c.GJ)(P),retries:(0,c.Jo)(P)}},[ec,P,L,O]),eu=(0,s.useMemo)(()=>{let e=new Map;return ed.ticker.forEach((t,n)=>e.set(t.model,h[n%h.length])),t=>{var n;return null!=(n=e.get(t))?n:"#a5b4fc"}},[ed.ticker]);(0,s.useEffect)(()=>{let e=()=>{et(new Date().toLocaleTimeString(void 0,{hour12:!1})),ea(e=>e<=1?5:e-1)};e();let t=window.setInterval(e,1e3);return()=>window.clearInterval(t)},[]),(0,s.useEffect)(()=>{ea(5)},[P]),(0,s.useEffect)(()=>{var e,t;let n=function(e){var t,n,a,s,i,c,d,u;let p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=new Map,m=[],f=function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=h.get(e);if(s)return s.weight+=a,s;let l="harness"===t?{x:.5,y:.5}:function(e){let t=0x811c9dc5;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),0x1000193);let n=(t>>>0)%3600/3600*Math.PI*2,a=.25+(t>>>12)%1e3/1e3*.2;return{x:.5+Math.cos(n)*a,y:.5+Math.sin(n)*a}}(e),r={id:e,kind:t,label:n,weight:a,x:l.x,y:l.y,vx:0,vy:0};return h.set(e,r),r},x=(e,t,n)=>{m.some(a=>a.from===e&&a.to===t&&a.kind===n)||m.push({from:e,to:t,kind:n})};for(let t of(f("harness","harness","harness",3),e.snapshot.runs.slice(0,12).forEach((e,t)=>{let n="run:".concat(e.runId);f(n,"run",e.runId.replace(/^run-/,"").slice(0,6),2),x("harness",n,"PLAN");let a=null;if(t<8){let t=n;for(let n of l.lV){let s=e.stages[n];if(!s&&e.current!==n)continue;let i=o(e.runId,n),c=f(i,"phase",l.fQ[n]);c.current=e.current===n,c.tone=null!=s?s:"info",x(t,i,"bad"===s?"ESCALATE":r[n]),t=i,a=i}}e.pr&&(f("pr:".concat(e.pr),"pr","#".concat(e.pr)),x(null!=a?a:n,"pr:".concat(e.pr),"ok"===e.stages.land?"SHIP":"VERIFY")),e.blocked&&x(n,"harness","ESCALATE")}),e.scorecard.slice(0,6)))f("model:".concat(t.model),"model",t.model.length>18?"".concat(t.model.slice(0,17),"…"):t.model,Math.max(1,Math.round(Math.log2(1+t.requests)))),x("harness","model:".concat(t.model),"ROUTE");let g=0;for(let e of null!=(t=p.events)?t:[]){if(g>=180)break;let t="run:".concat(e.runId);if(!h.has(t))continue;let n=e.stage?o(e.runId,e.stage):null,a=n&&h.has(n)?n:t,s=f("ev:".concat(e.key),"event",e.label,Math.max(1,Math.round(Math.log2(1+e.count))));e.bad&&(s.tone="bad"),x(a,s.id,e.bad?"ESCALATE":e.stage?r[e.stage]:"PLAN"),g+=1}let v=new Set,b=0;for(let e of null!=(n=p.reqs)?n:[]){let t="model:".concat(e.model);if(!h.has(t))continue;let n="site:".concat(e.model,"|").concat(e.site);if(v.has(n)?h.get(n).weight+=.05:(v.add(n),f(n,"site",e.site),x(t,n,"ROUTE")),e.provider){let n="acct:".concat(e.provider);h.has(n)||f(n,"account",e.provider,2),x(n,t,"ROUTE")}b<220&&(x(n,f("req:".concat(e.model,"|").concat(e.site,"|").concat(e.ts,"|").concat(b),"request","",Math.max(1,Math.log10(1+e.input+e.output))).id,"ROUTE"),b+=1)}for(let e of null!=(a=p.universes)?a:[]){let t="run:".concat(e.runId);if(!h.has(t))continue;let n="uni:".concat(e.instance);h.has(n)?h.get(n).weight+=1:f(n,"universe",e.instance,2),x(n,t,"PLAN")}for(let e of null!=(s=p.plans)?s:[]){let t="run:".concat(e.runId);if(!h.has(t))continue;let n=o(e.runId,"decompose"),a=h.has(n)?n:t;e.pieces.forEach((t,n)=>{let s="piece:".concat(e.runId,":").concat(n);f(s,"piece",t.length>22?"".concat(t.slice(0,21),"…"):t,1.5),x(a,s,"PLAN")})}for(let e of null!=(i=p.pods)?i:[]){let t="pod:".concat(e.pool);h.has(t)?h.get(t).weight+=.2:f(t,"pod",null!=(c=e.pool.replace(/^pool-/,"").split("@")[0])?c:e.pool,2),x("harness",t,"ROUTE")}for(let e of null!=(d=p.retries)?d:[]){let t=h.get(o(e.runId,e.stage));t&&(t.retries=Math.max(null!=(u=t.retries)?u:0,e.retries))}let y=0;for(let t of e.stream){let e=t.runId&&h.has("run:".concat(t.runId))?"run:".concat(t.runId):"harness";if("SHIP"===t.kind&&t.target)f("pr:".concat(t.target.replace(/^#/,"")),"pr",t.target),x(e,"pr:".concat(t.target.replace(/^#/,"")),"SHIP");else if(t.target&&y<10&&!t.target.startsWith("#")){let n="target:".concat(t.target);h.has(n)||(y+=1),f(n,"target",t.target.length>18?"".concat(t.target.slice(0,17),"…"):t.target),x(e,n,t.kind)}else("HEAL"===t.kind||"VERIFY"===t.kind)&&x(e,e,t.kind)}return{nodes:[...h.values()],edges:m}}(L,{events:ed.events,reqs:ec,universes:ed.universes,plans:ed.plans,pods:ed.pods,retries:ed.retries}),a=new Map($.current.nodes.map(e=>[e.id,e]));for(let e of n.nodes){let t=a.get(e.id);t&&(e.x=t.x,e.y=t.y,e.vx=t.vx,e.vy=t.vy)}$.current=n,el(e=>e.nodes===n.nodes.length&&e.edges===n.edges.length?e:{nodes:n.nodes.length,edges:n.edges.length});let s=ed.pods.map(e=>"pod|".concat(e.ts,"|").concat(e.pool));if(z.current)for(let e of ed.pods){let t="pod|".concat(e.ts,"|").concat(e.pool);z.current.has(t)||ei({from:"harness",to:"pod:".concat(e.pool),kind:"ROUTE"})}let i=function(e,t){let n=[];for(let s of t.stream){var a;let t="".concat(s.ts,"|").concat(s.kind,"|").concat(null!=(a=s.runId)?a:"","|").concat(s.what);if(e.has(t))continue;let l=s.runId?"run:".concat(s.runId):"harness",r="SHIP"===s.kind&&s.target?"pr:".concat(s.target.replace(/^#/,"")):s.target?"target:".concat(s.target):l;n.push({key:t,kind:s.kind,from:l,to:r})}return n}(null!=(e=z.current)?e:new Set,L);if(z.current){let e=new Map(L.stream.map(e=>{var t;return["".concat(e.ts,"|").concat(e.kind,"|").concat(null!=(t=e.runId)?t:"","|").concat(e.what),e]})),t=[...i].reverse();t.forEach((n,a)=>{let s=e.get(n.key);!s||!g(s)||eo()||a<t.length-6?ei(n):Y.current.push({key:n.key,line:s,from:n.from,to:n.to})}),Z(e=>e+1)}z.current=new Set([...null!=(t=z.current)?t:[],...i.map(e=>e.key),...s])},[L,ed.events,ed.universes,ed.plans,ed.pods,ed.retries,ec]),(0,s.useEffect)(()=>{if(J)return;let e=Y.current.shift();if(!e){_&&Q(!1);return}K({item:e,folding:!1})},[J,X,_]),(0,s.useEffect)(()=>{if(!J)return;if(!J.folding){let e=setTimeout(()=>K({item:J.item,folding:!0}),er.current);return()=>clearTimeout(e)}ei({from:J.item.from,to:J.item.to,kind:J.item.line.kind});let e=setTimeout(()=>K(null),250);return()=>clearTimeout(e)},[J]),(0,s.useEffect)(()=>{er.current=_?550:1500},[_]);let ep=(0,s.useRef)(!1);(0,s.useEffect)(()=>{if(!W||ep.current||0===L.stream.length||eo())return;ep.current=!0;let e=setTimeout(()=>eh(),1200);return()=>clearTimeout(e)},[L.stream.length]);let eh=()=>{Y.current=L.stream.filter(g).slice(0,40).reverse().map(e=>{let t=e.runId?"run:".concat(e.runId):"harness",n="SHIP"===e.kind&&e.target?"pr:".concat(e.target.replace(/^#/,"")):e.target?"target:".concat(e.target):t;return{key:"replay|".concat(e.ts,"|").concat(e.what),line:e,from:t,to:n}}),Q(!0),Z(e=>e+1)};(0,s.useEffect)(()=>{let e=B.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let n=eo(),a=new Map,s=e=>{let t=a.get(e);if(t)return t;let n=document.createElement("canvas");n.width=64,n.height=64;let s=n.getContext("2d");if(s){let t=s.createRadialGradient(32,32,0,32,32,32);t.addColorStop(0,"".concat(e,"ff")),t.addColorStop(.25,"".concat(e,"88")),t.addColorStop(1,"".concat(e,"00")),s.fillStyle=t,s.fillRect(0,0,64,64)}return a.set(e,n),n},l=0,r=0,o=()=>{let a=window.devicePixelRatio||1,c=e.clientWidth,h=e.clientHeight;(e.width!==Math.round(c*a)||e.height!==Math.round(h*a))&&(e.width=Math.round(c*a),e.height=Math.round(h*a)),t.setTransform(a,0,0,a,0,0);let x=$.current;n||function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{nodes:n,edges:a}=e,s=new Map(n.map(e=>[e.id,e])),l=Math.min(1,60/Math.max(1,n.length));for(let e=0;e<n.length;e++)for(let t=e+1;t<n.length;t++){let a=n[e],s=n[t],r=a.x-s.x,o=a.y-s.y,i=r*r+o*o;i<1e-6&&(r=.01,o=.01,i=2e-4);let c=e=>"phase"===e||"request"===e||"event"===e||"piece"===e,d=l*(c(a.kind)||c(s.kind)?"request"===a.kind||"request"===s.kind?12e-6:5e-5:18e-5)/i;a.vx+=r*d,a.vy+=o*d,s.vx-=r*d,s.vy-=o*d}for(let e of a){if(e.from===e.to)continue;let t=s.get(e.from),n=s.get(e.to);if(!t||!n)continue;let a=n.x-t.x,l=n.y-t.y,r=Math.sqrt(a*a+l*l)||.001,o=(r-("request"===n.kind?.035:"site"===n.kind?.06:i.has(t.kind)||i.has(n.kind)?.34:"harness"===t.kind||"harness"===n.kind?.2:"phase"===t.kind||"phase"===n.kind?.07:.12))*("phase"===t.kind||"phase"===n.kind?.05:.02);t.vx+=a/r*o,t.vy+=l/r*o,n.vx-=a/r*o,n.vy-=l/r*o}for(let e of n){if("harness"===e.kind){e.x=.5,e.y=.5,e.vx=0,e.vy=0;continue}if(i.has(e.kind)){let t=e.x-.5,n=e.y-.5,a=Math.sqrt(t*t+n*n)||.001,s=(("universe"===e.kind?.44:.3)-a)*.01;e.vx+=t/a*s,e.vy+=n/a*s}else e.vx+=(.5-e.x)*.003,e.vy+=(.5-e.y)*.003;e.x<.08&&(e.vx+=(.08-e.x)*.06),e.x>.92&&(e.vx-=(e.x-.92)*.06),e.y<.18&&(e.vy+=(.18-e.y)*.06),e.y>.87&&(e.vy-=(e.y-.87)*.06),e.vx*=.86,e.vy*=.86,e.x=Math.min(.97,Math.max(.03,e.x+e.vx*t)),e.y=Math.min(.95,Math.max(.1,e.y+e.vy*t))}}(x),r+=1;let g=new Map(x.nodes.map(e=>[e.id,e])),v=e=>n?0:1.4*Math.sin(r/40+e.id.length%7),b=e=>{let t=g.get(e);return t?{x:t.x*c+v(t),y:t.y*h+.7*v(t)}:null};for(let e of(t.clearRect(0,0,c,h),t.globalCompositeOperation="lighter",x.edges)){let n=b(e.from),a=b(e.to);n&&a&&(t.strokeStyle=d[e.kind],t.globalAlpha=e.to.startsWith("ev:")||e.to.startsWith("site:")?.15:.25,t.lineWidth="SHIP"===e.kind?1.4:.7,t.beginPath(),e.from===e.to?t.arc(n.x+8,n.y-8,8,0,2*Math.PI):(t.moveTo(n.x,n.y),t.lineTo(a.x,a.y)),t.stroke())}if(!n&&x.edges.length&&r%4==0&&G.current.length<110){let e=x.edges[7919*r%x.edges.length];e.from!==e.to&&G.current.push({from:e.from,to:e.to,kind:e.kind,t:0,speed:.008,alpha:.45,size:1.6})}for(let e of(G.current=G.current.filter(e=>e.t<=1),G.current)){let a=b(e.from),l=b(e.to);if(!a||!l){e.t=2;continue}e.t+=n?1:e.speed;let r=a.x+(l.x-a.x)*e.t,o=a.y+(l.y-a.y)*e.t-(e.from===e.to?24*Math.sin(e.t*Math.PI):0),i=5*e.size;t.globalAlpha=e.alpha,t.drawImage(s(d[e.kind]),r-i,o-i,2*i,2*i)}for(let e of(V.current=V.current.filter(e=>e.t<=1),V.current)){let a=b(e.id);if(!a){e.t=2;continue}e.t+=n?1:.014;let l=10+70*Math.min(1,e.t/.3);t.globalAlpha=1-e.t,t.strokeStyle=d.SHIP,t.lineWidth=2.5,t.beginPath(),t.arc(a.x,a.y,l,0,2*Math.PI),t.stroke(),t.drawImage(s(d.SHIP),a.x-l,a.y-l,2*l,2*l)}for(let e of x.nodes){let a=b(e.id),l="phase"===e.kind,o="harness"===e.kind||l&&e.current,i=m[e.kind]+("model"===e.kind||"run"===e.kind?Math.min(4,.4*e.weight):"event"===e.kind?Math.min(3,.5*e.weight):0),c=o&&!n?i*(1+Math.sin(r/(l?9:20))*(l?.35:.12)):i,h=(l||"event"===e.kind)&&e.tone?p[e.tone]:u[e.kind],f=o||"run"===e.kind||"model"===e.kind||"account"===e.kind||"universe"===e.kind,x=c*(f?8:3);if(t.globalAlpha=f?.6:.35,t.drawImage(s(h),a.x-x,a.y-x,2*x,2*x),t.globalAlpha="event"===e.kind?.85:1,t.fillStyle=h,t.beginPath(),t.arc(a.x,a.y,c,0,2*Math.PI),t.fill(),l&&e.retries){t.globalAlpha=.75,t.strokeStyle=d.HEAL,t.lineWidth=1,t.setLineDash([3,3]);for(let s=1;s<=Math.min(4,e.retries);s+=1)t.lineDashOffset=n?0:-(r*(.4+.1*s)),t.beginPath(),t.arc(a.x,a.y,c+4+4*s,0,2*Math.PI),t.stroke();t.setLineDash([])}if(l&&e.current&&!n){let e=r%60/60;t.strokeStyle=h,t.globalAlpha=1-e,t.lineWidth=1.2,t.beginPath(),t.arc(a.x,a.y,c+18*e,0,2*Math.PI),t.stroke()}}for(let e of(t.globalCompositeOperation="source-over",t.globalAlpha=1,x.nodes)){if(!f.has(e.kind))continue;let n=b(e.id);t.fillStyle="harness"===e.kind?"#eef2ff":"phase"===e.kind?"rgba(199,210,254,.65)":"rgba(226,232,240,.82)",t.font="harness"===e.kind?"600 12px ui-monospace, SFMono-Regular, monospace":"10px ui-monospace, SFMono-Regular, monospace";let a="harness"===e.kind?"ELANOUS HARNESS":"phase"===e.kind?e.label:e.label.toUpperCase();t.fillText(a,n.x+m[e.kind]+4,n.y+3)}n||(l=requestAnimationFrame(o))};l=requestAnimationFrame(o);let c=t=>{let n=e.getBoundingClientRect(),a=(t.clientX-n.left)/n.width,s=(t.clientY-n.top)/n.height,l=$.current.nodes.find(e=>"run"===e.kind&&.02>Math.hypot(e.x-a,e.y-s));l&&(null==D||D(l.id.replace(/^run:/,"")))};return e.addEventListener("click",c),()=>{cancelAnimationFrame(l),e.removeEventListener("click",c)}},[D]);let em=L.gauges,ef=function(e){var t;let n=e.snapshot.runs.filter(e=>"ok"===e.stages.land);if(n.length)return{run:[...n].sort((t,n)=>{var a,s;return(null!=(a=e.rounds[n.runId])?a:0)-(null!=(s=e.rounds[t.runId])?s:0)||n.events-t.events})[0],why:"merged"};let a=null!=(t=e.snapshot.runs.find(e=>e.current&&!e.blocked))?t:e.snapshot.runs[0];return a?{run:a,why:"in-flight"}:null}(L),ex=null!=(t=null==ef?void 0:ef.run)?t:null,eg=Object.values(L.rounds),ev=l.jg.map(e=>({k:e,n:L.stream.filter(t=>t.kind===e).length})),eb=ec.reduce((e,t)=>e+t.input+t.output,0),ey=ec.reduce((e,t)=>e+t.apiUsd,0),ew=Math.max(1,...ec.slice(0,10).map(e=>e.input+e.output)),ek=ex?l.lV.filter(e=>ex.stages[e]):[];return(0,a.jsxs)("div",{className:"live-stage live-v5 space-y-1.5 rounded-xl p-1.5 text-slate-100","data-live-max-stage":!0,"data-live-v5":!0,children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-md border border-indigo-400/10 bg-slate-950/60 px-2 py-1",children:[(0,a.jsx)("span",{className:"shrink-0 text-xl tracking-tight text-slate-50",style:{fontFamily:'Georgia, "Times New Roman", serif'},children:"Elanous"}),(0,a.jsx)("span",{className:"hidden shrink-0 font-mono text-[11px] sm:inline lg:text-[10.5px] tracking-[.18em] text-indigo-200/80",children:"\xd7 HARNESS \xb7 판단"}),(0,a.jsx)(w,{tone:"live",children:"● LIVE"}),(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)(N,{ariaLabel:"판단 띠",bare:!0,items:L.stream.slice(0,16).map((e,t)=>(0,a.jsxs)("span",{className:"mx-4 whitespace-nowrap",children:[(0,a.jsxs)("span",{style:{color:d[e.kind]},children:["▸ ",e.kind]})," ",(0,a.jsx)("span",{className:"text-slate-300",children:e.what}),e.target&&(0,a.jsxs)("span",{className:"text-slate-500",children:[" → ",e.target]})]},"".concat(e.ts,"-").concat(t)))})}),(0,a.jsx)("span",{className:"shrink-0 font-mono text-lg tabular-nums text-slate-200",suppressHydrationWarning:!0,children:ee})]}),(0,a.jsx)(N,{ariaLabel:"모델 띠",slow:!0,items:[(0,a.jsxs)("span",{className:"mx-4 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-rose-300",children:"● LIVE RUNS"})," ",em.live]},"live"),(0,a.jsxs)("span",{className:"mx-4 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-emerald-300",children:"SHIPPED"})," ",em.shipped]},"ship"),(0,a.jsxs)("span",{className:"mx-4 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-indigo-300",children:"DECISIONS/MIN"})," ",em.decisionsPerMin]},"dpm"),(0,a.jsxs)("span",{className:"mx-4 whitespace-nowrap",children:[(0,a.jsx)("span",{className:"text-indigo-300",children:"BURN/MIN"})," ",b(em.burnTokensPerMin)]},"burn"),...ed.ticker.map(e=>(0,a.jsxs)("span",{className:"mx-4 whitespace-nowrap",children:[(0,a.jsx)("span",{style:{color:eu(e.model)},children:e.model.toUpperCase()})," ",(0,a.jsx)("span",{className:e.delta>0?"text-emerald-300":e.delta<0?"text-rose-300":"text-slate-400",children:e.delta>0?"▲":e.delta<0?"▼":"■"})," ",e.count," req \xb7 ",b(e.tokens)," tok"]},e.model))]}),(0,a.jsxs)("div",{className:"grid grid-cols-12 gap-1.5",children:[(0,a.jsxs)(y,{className:"col-span-12 lg:col-span-4",title:"SHIPPED \xb7 병합된 PR",stat:"".concat("github"===H?"GITHUB":"LOG"," \xb7 ").concat(O>=60?"".concat(O/60,"H"):"".concat(O,"M")),children:[(0,a.jsxs)("div",{className:"flex items-end gap-3",children:[(0,a.jsx)(M,{value:em.shipped,accent:d.SHIP}),(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-1",children:[(0,a.jsx)(w,{tone:"ok",children:"MERGED"}),em.selfHealRuns>0&&(0,a.jsx)(w,{tone:"heal",children:"SELF-HEALED"}),L.snapshot.counters.blocked>0&&(0,a.jsxs)(w,{tone:"bad",children:["BLOCKED ",L.snapshot.counters.blocked]})]})]}),(0,a.jsxs)("div",{className:"mt-1 grid grid-cols-3 gap-2 border-t border-indigo-400/10 pt-2",children:[(0,a.jsx)(k,{label:"SELF-HEAL",value:null===em.selfHealRate?"—":"".concat(em.selfHealRate,"%"),color:d.HEAL}),(0,a.jsx)(k,{label:"RUNS",value:String(L.snapshot.runs.length),color:"#c7d2fe"}),(0,a.jsx)(k,{label:"DECISIONS",value:String(em.decisions),color:d.PLAN})]})]}),(0,a.jsx)(y,{className:"col-span-12 lg:col-span-4",title:(null==ef?void 0:ef.why)==="merged"?"BEST RUN \xb7 오늘 최고의 런":"NOW \xb7 지금 런",stat:ex?"R ".concat(null!=(n=L.rounds[ex.runId])?n:0,"/3"):"—",children:ex?(0,a.jsxs)("button",{type:"button",className:"block w-full text-left",onClick:()=>null==D?void 0:D(ex.runId),"data-live-v5-best":!0,children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-[11px] text-slate-400",children:"owner"===U?ex.runId:"런"}),(null==ef?void 0:ef.why)==="merged"?(0,a.jsxs)(w,{tone:"ok",children:["VERIFIED \xb7 MERGED",ex.pr?" #".concat(ex.pr):""]}):(0,a.jsx)(w,{tone:"live",children:"IN FLIGHT"})]}),(0,a.jsxs)("div",{className:"mt-1 flex items-baseline gap-3",children:[(0,a.jsx)("span",{className:"font-mono text-6xl font-semibold tabular-nums text-indigo-100",style:{textShadow:"0 0 24px #818cf888"},children:ex.pr?"#".concat(ex.pr):ex.current?l.fQ[ex.current]:"—"}),(0,a.jsxs)("span",{className:"font-mono text-xs text-slate-400",children:[ex.events," signals \xb7 라운드 ",null!=(v=L.rounds[ex.runId])?v:0]})]}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-1",children:ek.map(e=>{let t=ex.stages[e];return(0,a.jsxs)(w,{tone:"bad"===t?"bad":"ok"===t?"ok":"dim",children:[l.fQ[e],"ok"===t?" ✓":"bad"===t?" ✗":""]},e)})})]}):(0,a.jsx)("p",{className:"py-6 text-xs text-slate-500",children:"이 창에 런 신호가 없다 — ▶ REPLAY 로 최근 판단을 본다."})}),(0,a.jsx)(y,{className:"col-span-12 lg:col-span-4",title:"LLM \xb7 ".concat(ed.bucketMin,"분 봉 ⊕ 요청 창"),stat:"".concat(ec.length," REQ \xb7 ").concat(b(eb)," TOK"),children:(0,a.jsxs)("div",{className:"grid grid-cols-5 gap-2",children:[(0,a.jsx)(S,{candles:ed.candles,color:eu,unit:"/".concat(ed.bucketMin,"M"),className:"col-span-3"}),(0,a.jsxs)("ul",{className:"col-span-2 h-28 space-y-0.5 overflow-hidden font-mono text-[11px] lg:text-[10px]","data-live-v5-book":!0,children:[ec.slice(0,10).map((e,t)=>(0,a.jsxs)("li",{className:"relative flex justify-between gap-1 overflow-hidden px-1 ".concat(0===t?"live-line-in":""),children:[(0,a.jsx)("span",{className:"absolute inset-y-0 right-0 opacity-20",style:{width:"".concat((e.input+e.output)/ew*100,"%"),background:eu(e.model)}}),(0,a.jsx)("span",{className:"relative truncate",style:{color:eu(e.model)},children:e.model}),(0,a.jsx)("span",{className:"relative tabular-nums text-slate-300",children:b(e.input+e.output)})]},"".concat(e.ts,"-").concat(t))),0===ec.length&&(0,a.jsx)("li",{className:"text-slate-500",children:"요청 없음"})]})]})})]}),(0,a.jsx)(y,{title:"EXECUTION CYCLE \xb7 하니스 한 바퀴",stat:"".concat(ex?"ROUND ".concat(null!=(C=L.rounds[ex.runId])?C:0,"/3 \xb7 "):"","NEXT ").concat(en,"S"),children:(0,a.jsx)("div",{className:"grid grid-cols-3 gap-1.5 sm:grid-cols-6",children:l.lV.map((e,t)=>{let n=ex?ex.current===e:ed.load.busiest===e,s=null==ex?void 0:ex.stages[e];return(0,a.jsxs)("div",{"data-live-v5-stage":e,"data-hot":n?"1":void 0,className:"rounded-md border px-3 py-2 ".concat(n?"live-v5-hot":""),style:n?{borderColor:"#a78bfa",boxShadow:"0 0 18px #a78bfa66, inset 0 0 18px #a78bfa33",background:"rgba(124,58,237,.28)"}:{borderColor:"rgba(99,102,241,.18)",background:"rgba(2,6,23,.55)"},children:[(0,a.jsxs)("div",{className:"flex justify-between font-mono text-[11px] lg:text-[10px] text-slate-400",children:[(0,a.jsx)("span",{children:String(t+1).padStart(2,"0")}),s&&(0,a.jsx)("span",{style:{color:p[s]},children:"ok"===s?"✓":"bad"===s?"✗":"●"})]}),(0,a.jsxs)("div",{className:"flex items-baseline justify-between",children:[(0,a.jsx)("span",{className:n?"text-sm font-semibold text-white":"text-sm text-slate-300",children:l.fQ[e]}),(0,a.jsx)("span",{className:"font-mono text-xs tabular-nums text-slate-400",title:"지금 이 단계에 있는 런",children:ed.load.counts[e]})]})]},e)})})}),(0,a.jsxs)("div",{className:"grid grid-cols-12 gap-1.5",children:[(0,a.jsxs)(y,{className:"relative col-span-12 xl:col-span-10",title:"JUDGMENT GRAPH \xb7 FORCE",stat:"NODES ".concat(es.nodes," \xb7 EDGES ").concat(es.edges),bodyClass:"p-0",hot:!0,children:[(0,a.jsx)("canvas",{ref:B,className:"h-[370px] w-full bg-[radial-gradient(ellipse_at_center,rgba(79,70,229,.26),rgba(2,6,23,.96)_70%)]","aria-label":"판단 그래프"}),(0,a.jsx)("div",{className:"pointer-events-none absolute left-3 top-9 flex flex-col gap-0.5 rounded-md bg-slate-950/60 p-2 font-mono text-[11px] lg:text-[10px]",children:ev.map(e=>{let{k:t,n}=e;return(0,a.jsxs)("span",{style:{color:d[t]},children:["● ",t," ",(0,a.jsx)("span",{className:"text-slate-400",children:n})]},t)})}),(0,a.jsx)("button",{type:"button",onClick:eh,disabled:_||0===L.stream.length,"data-elanous-action":"live-replay",className:"absolute bottom-3 right-3 rounded-full border border-indigo-400/40 bg-slate-950/70 px-3 py-1 font-mono text-[11px] lg:text-[10px] text-indigo-200 hover:bg-indigo-500/20 disabled:opacity-40",title:"이 창의 판단을 옛것부터 빨리 감기(최근 40)",children:_?"REPLAY \xb7 ".concat(Y.current.length):"▶ REPLAY"}),J&&(0,a.jsx)(T,{item:J.item,folding:J.folding,role:U})]}),(0,a.jsx)(y,{className:"col-span-12 xl:col-span-2",title:"STATS",stat:"".concat(en,"S"),children:(0,a.jsxs)("dl",{className:"grid grid-cols-2 gap-x-2 gap-y-1.5 font-mono","data-live-v5-stats":!0,children:[(0,a.jsx)(j,{label:"PATHS",value:L.stream.reduce((e,t)=>{var n;return e+(null!=(n=t.paths)?n:0)},0)||"—"}),(0,a.jsx)(j,{label:"CONV",value:L.convergence.length?"".concat(L.convergence.filter(e=>{var t;return(null==(t=e.points.at(-1))?void 0:t.asks)===0}).length,"/").concat(L.convergence.length):"—"}),(0,a.jsx)(j,{label:"ROUNDS AVG",value:eg.length?(eg.reduce((e,t)=>e+t,0)/eg.length).toFixed(1):"—"}),(0,a.jsx)(j,{label:"DECISIONS/MIN",value:em.decisionsPerMin}),(0,a.jsx)(j,{label:"SIGNALS",value:P.length}),(0,a.jsx)(j,{label:"LLM REQ",value:ec.length}),q?(0,a.jsx)(j,{label:"MODELS",value:ed.ticker.length}):(0,a.jsx)(j,{label:"API ≈ USD",value:"$".concat(ey.toFixed(2))}),(0,a.jsx)(j,{label:"NEXT POLL",value:"".concat(en,"s")})]})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-12 gap-1.5",children:[(0,a.jsx)(y,{className:"col-span-12 md:col-span-6 xl:col-span-3",title:"MODEL \xd7 SITE \xb7 요청 수",stat:"MAX ".concat(ed.heat.max),children:(0,a.jsx)(E,{heat:ed.heat,color:eu})}),(0,a.jsx)(y,{className:"col-span-12 md:col-span-6 xl:col-span-3",title:"DISTRIBUTION \xb7 런 소요 ⊕ 요청 토큰",stat:"".concat(ed.spans," RUNS \xb7 ").concat(ec.length," REQ"),children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,a.jsx)(I,{hist:ed.hist,label:e=>"".concat(e.toFixed(0),"분")}),(0,a.jsx)(I,{hist:ed.tokHist,label:e=>b(10**e)})]})}),(0,a.jsx)(y,{className:"col-span-12 md:col-span-6 xl:col-span-3",title:"CONVERGENCE \xb7 must-fix ⊕ GATE",stat:"".concat(L.convergence.length," PR"),children:(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,a.jsx)("div",{className:"col-span-2",children:(0,a.jsx)(R,{series:L.convergence})}),(0,a.jsx)(A,{pass:ed.gate.pass,fail:ed.gate.fail,verdicts:L.snapshot.reviewVerdicts})]})}),(0,a.jsx)(y,{className:"col-span-12 md:col-span-6 xl:col-span-3",title:"EXECUTION LOG \xb7 LIVE",stat:"".concat(L.stream.length),bodyClass:"px-2 py-1",children:(0,a.jsxs)("ul",{className:"h-[124px] space-y-0.5 overflow-hidden font-mono text-[11px] lg:text-[10.5px]","data-live-max-stream":!0,children:[L.stream.slice(0,9).map((e,t)=>(0,a.jsxs)("li",{className:"flex gap-1.5 ".concat(0===t?"live-line-in":""),style:"SHIP"===e.kind?{textShadow:"0 0 10px ".concat(d.SHIP)}:void 0,children:[(0,a.jsx)("span",{className:"shrink-0 text-slate-500",title:e.ts,children:(0,l.qo)(e.ts)}),(0,a.jsx)("span",{className:"w-14 shrink-0 rounded px-1 text-center",style:{color:d[e.kind],background:"".concat(d[e.kind],"1f")},children:e.kind}),(0,a.jsxs)("span",{className:"truncate",children:[e.what,e.target&&(0,a.jsxs)("span",{className:"text-slate-500",children:[" → ",e.target]})]})]},"".concat(e.ts,"-").concat(t))),0===L.stream.length&&(0,a.jsx)("li",{className:"text-slate-500",children:"이 창에 판단 신호가 없다."})]})})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-6 gap-y-1 rounded-md border border-indigo-400/10 bg-slate-950/60 px-3 py-1 font-mono text-[11px] lg:text-[10px] text-slate-400",children:[(0,a.jsxs)("span",{children:["STACK ",(0,a.jsx)("span",{className:"text-slate-200",children:"elanous-core"})]}),(0,a.jsxs)("span",{children:["SOURCE ",(0,a.jsx)("span",{className:"text-slate-200",children:F})]}),(0,a.jsxs)("span",{children:["SIGNALS ",(0,a.jsx)("span",{className:"text-slate-200",children:P.length})]}),(0,a.jsxs)("span",{children:["LLM ",(0,a.jsxs)("span",{className:"text-slate-200",children:[ec.length," req"]})]}),(0,a.jsxs)("span",{children:["EMITTED ",(0,a.jsx)("span",{className:"text-slate-200",children:L.emitted})]}),q&&(0,a.jsx)("span",{className:"text-emerald-300","data-live-public-capture":!0,children:"PUBLIC CAPTURE \xb7 계정\xb7과금 가림"}),(0,a.jsx)("span",{className:"ml-auto",children:"EVERY NUMBER IS REAL \xb7 보이는 수는 전부 진짜"})]})]})}function b(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(e>=1e5?0:1),"k"):String(Math.round(e))}function y(e){let{title:t,stat:n,children:s,className:l="",bodyClass:r="p-2.5",hot:o=!1}=e;return(0,a.jsxs)("section",{className:"overflow-hidden rounded-lg border bg-slate-950/70 ".concat(l),style:o?{borderColor:"rgba(167,139,250,.7)",boxShadow:"0 0 22px #a78bfa33"}:{borderColor:"rgba(99,102,241,.16)"},"aria-label":t,"data-live-v5-panel":t,children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-indigo-400/10 px-2.5 py-1 font-mono text-[11px] lg:text-[10.5px] tracking-[.08em] text-slate-400",children:[(0,a.jsxs)("span",{children:["▸ ",t]}),n&&(0,a.jsx)("span",{className:"tabular-nums text-slate-300",children:n})]}),(0,a.jsx)("div",{className:r,children:s})]})}function w(e){let{tone:t,children:n}=e,s="ok"===t?d.SHIP:"bad"===t?d.ESCALATE:"heal"===t?d.HEAL:"dim"===t?"#a5b4fc":"#f0abfc";return(0,a.jsx)("span",{className:"inline-block whitespace-nowrap rounded px-1.5 py-0.5 font-mono text-[11px] lg:text-[10px] font-semibold tracking-wider ".concat("live"===t?"live-v5-blink":""),style:{color:s,background:"".concat(s,"22"),boxShadow:"inset 0 0 0 1px ".concat(s,"66")},children:n})}function k(e){let{label:t,value:n,color:s}=e;return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"font-mono text-[11px] lg:text-[9.5px] tracking-widest text-slate-500",children:t}),(0,a.jsx)("div",{className:"font-mono text-3xl font-semibold tabular-nums",style:{color:s,textShadow:"0 0 14px ".concat(s,"55")},children:n})]})}function j(e){let{label:t,value:n}=e;return(0,a.jsxs)("div",{className:"border-b border-indigo-400/10 pb-1",children:[(0,a.jsx)("dt",{className:"text-[11px] lg:text-[9.5px] tracking-widest text-slate-500",children:t}),(0,a.jsx)("dd",{className:"text-lg font-semibold tabular-nums text-indigo-100",children:n})]})}function N(e){let{items:t,ariaLabel:n,slow:s=!1,bare:l=!1}=e;return(0,a.jsx)("div",{className:"relative overflow-hidden font-mono text-[11px] ".concat(l?"":"rounded-md border border-indigo-400/10 bg-slate-950/60 py-1"),"aria-label":n,children:0===t.length?(0,a.jsx)("span",{className:"px-3 text-slate-500",children:"—"}):(0,a.jsxs)("div",{className:"live-v5-marquee flex w-max",style:{animationDuration:"".concat(Math.max(30,t.length*(s?9:6)),"s")},children:[(0,a.jsx)("div",{className:"flex",children:t}),(0,a.jsx)("div",{className:"flex","aria-hidden":!0,children:t})]})})}function M(e){let{value:t,accent:n}=e,[l,r]=(0,s.useState)(t),[o,i]=(0,s.useState)(!1),c=(0,s.useRef)(t);return(0,s.useEffect)(()=>{let e=c.current;t>e&&(i(!0),setTimeout(()=>i(!1),700)),c.current=t;let n=performance.now(),a=0,s=l=>{let o=Math.min(1,(l-n)/900);r(e+(t-e)*(1-Math.pow(1-o,3))),o<1&&(a=requestAnimationFrame(s))};return a=requestAnimationFrame(s),()=>cancelAnimationFrame(a)},[t]),(0,a.jsx)("div",{className:"font-mono text-[112px] font-semibold leading-none tabular-nums",style:{color:n,textShadow:"0 0 ".concat(o?40:26,"px ").concat(n).concat(o?"cc":"66")},"data-live-max-gauge":"SHIPPED",children:Math.round(l)})}function S(e){let{candles:t,color:n,unit:s,className:l=""}=e,r=Math.max(1,...t.map(e=>e.count)),o=240/t.length;return(0,a.jsxs)("svg",{viewBox:"0 0 ".concat(240," ").concat(120),className:"h-28 w-full ".concat(l),"data-live-v5-candles":!0,"aria-label":"분당 LLM 요청",children:[[.25,.5,.75].map(e=>(0,a.jsx)("line",{x1:0,x2:240,y1:120*e,y2:120*e,stroke:"#1e293b",strokeDasharray:"2 3"},e)),t.map((e,t)=>{let s=120;return Object.entries(e.byModel).map(e=>{let[l,i]=e,c=i/r*114;return s-=c,(0,a.jsx)("rect",{x:t*o+1,y:s,width:Math.max(1,o-2),height:c,fill:n(l),opacity:.85},"".concat(t,"-").concat(l))})}),(0,a.jsxs)("text",{x:238,y:10,fill:"#64748b",fontSize:8,fontFamily:"monospace",textAnchor:"end",children:[r,s]})]})}function E(e){let{heat:t,color:n}=e;return 0===t.models.length?(0,a.jsx)("p",{className:"py-6 text-xs text-slate-500",children:"이 창에 요청이 없다."}):(0,a.jsxs)("table",{className:"w-full border-separate border-spacing-0.5 font-mono text-[11px] lg:text-[10px]","data-live-v5-heat":!0,children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{}),t.sites.map(e=>(0,a.jsx)("th",{className:"max-w-16 truncate font-normal text-slate-500",children:e},e))]})}),(0,a.jsx)("tbody",{children:t.models.map(e=>(0,a.jsxs)("tr",{children:[(0,a.jsx)("td",{className:"max-w-24 truncate pr-1",style:{color:n(e)},children:e}),t.sites.map(n=>{var s;let l=null!=(s=t.cells["".concat(e,"|").concat(n)])?s:0,r=0===l?0:Math.min(5,Math.ceil(l/Math.max(1,t.max)*5));return(0,a.jsx)("td",{className:"rounded-sm px-1 py-0.5 text-center tabular-nums",style:{background:r?"rgba(167,139,250,".concat(.12+.15*r,")"):"rgba(30,41,59,.5)",color:r>=4?"#fff":"#cbd5e1"},children:l||"\xb7"},n)})]},e))})]})}function I(e){let{hist:t,label:n}=e,s=200/t.bins.length;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("svg",{viewBox:"0 0 ".concat(200," ").concat(90),className:"h-20 w-full","data-live-v5-hist":!0,"aria-label":"분포",children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"v5hist",x1:"0",x2:"1",y1:"0",y2:"0",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:d.HEAL}),(0,a.jsx)("stop",{offset:"60%",stopColor:d.PLAN}),(0,a.jsx)("stop",{offset:"100%",stopColor:d.ROUTE})]})}),t.bins.map((e,n)=>{let l=t.max?e/t.max*86:0;return(0,a.jsx)("rect",{x:n*s+.5,y:90-l,width:Math.max(1,s-1),height:l,fill:"url(#v5hist)",opacity:.9},n)}),(0,a.jsx)("line",{x1:0,x2:200,y1:89.5,y2:89.5,stroke:"#334155"})]}),(0,a.jsxs)("div",{className:"flex justify-between font-mono text-[11px] lg:text-[9.5px] text-slate-500",children:[(0,a.jsx)("span",{children:t.max?n(t.lo):"—"}),(0,a.jsx)("span",{children:t.max?n(t.hi):""})]})]})}function A(e){let{pass:t,fail:n,verdicts:s}=e,l=[{name:"GATE ✓",count:t,c:d.SHIP},{name:"GATE ✗",count:n,c:d.ESCALATE},...s.slice(0,3).map(e=>({name:e.name.toUpperCase(),count:e.count,c:d.VERIFY}))],r=Math.max(1,...l.map(e=>e.count));return(0,a.jsx)("ul",{className:"space-y-1 font-mono text-[11px] lg:text-[9.5px]","data-live-v5-gate":!0,children:l.map(e=>(0,a.jsxs)("li",{children:[(0,a.jsxs)("div",{className:"flex justify-between text-slate-400",children:[(0,a.jsx)("span",{className:"truncate",children:e.name}),(0,a.jsx)("span",{className:"tabular-nums text-slate-200",children:e.count})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-slate-800",children:(0,a.jsx)("div",{className:"h-1.5 rounded-full",style:{width:"".concat(e.count/r*100,"%"),background:e.c,boxShadow:"0 0 8px ".concat(e.c,"88")}})})]},e.name))})}function T(e){var t;let{item:n,folding:s,role:r}=e,{line:o}=n,i=d[o.kind];return(0,a.jsxs)("div",{"data-live-decision-card":o.kind,className:"pointer-events-none absolute left-1/2 top-12 w-[min(92%,580px)] rounded-xl border bg-slate-950/85 p-3 backdrop-blur transition-all duration-200",style:{borderColor:"".concat(i,"88"),boxShadow:"0 0 32px ".concat(i,"55"),opacity:+!s,transform:"translateX(-50%) scale(".concat(s?.6:1,")")},children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 font-mono text-[11px] lg:text-[10px]",children:[(0,a.jsxs)("span",{style:{color:i},children:["● ",o.kind]}),(0,a.jsx)("span",{className:"text-slate-500",children:(0,l.qo)(o.ts)}),"owner"===r&&o.runId&&(0,a.jsx)("span",{className:"text-slate-500",children:o.runId.replace(/^run-/,"").slice(0,8)}),o.paths?(0,a.jsxs)("span",{className:"ml-auto text-slate-400",children:["PATHS ",o.paths]}):null]}),(0,a.jsxs)("div",{className:"grid grid-cols-3 gap-2 text-[11px] leading-snug",children:[(0,a.jsx)(C,{label:"무엇 \xb7 WHAT",value:o.what,strong:!0}),(0,a.jsx)(C,{label:"왜 \xb7 WHY",value:null!=(t=(0,l.hS)(o.why,r))?t:o.purpose}),(0,a.jsx)(C,{label:"어디로 \xb7 TO",value:o.target,accent:i})]})]})}function C(e){let{label:t,value:n,strong:s=!1,accent:l}=e;return(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"font-mono text-[11px] lg:text-[9px] tracking-widest text-slate-500",children:t}),(0,a.jsx)("div",{className:s?"line-clamp-3 font-medium text-slate-100":"line-clamp-3 text-slate-300",style:l&&n?{color:l}:void 0,children:null!=n?n:"—"})]})}function R(e){let{series:t}=e,n=Math.max(1,...t.flatMap(e=>e.points.map(e=>e.asks))),s=Math.max(3,...t.flatMap(e=>e.points.map(e=>e.round))),l=e=>20+(e-1)/Math.max(1,s-1)*146,r=e=>84-e/n*72,o=Array.from({length:s},(e,t)=>t+1);return(0,a.jsx)("div",{"data-live-convergence":!0,children:0===t.length?(0,a.jsx)("div",{className:"py-8 text-center text-[11px] text-slate-500",children:"이 창에 리뷰 라운드가 없다."}):(0,a.jsxs)("svg",{viewBox:"0 0 ".concat(200," ").concat(100),className:"h-24 w-full",children:[(0,a.jsx)("line",{x1:20,y1:84,x2:166,y2:84,stroke:"#334155"}),(0,a.jsx)("line",{x1:20,y1:12,x2:20,y2:84,stroke:"#334155"}),o.map(e=>(0,a.jsxs)("g",{children:[(0,a.jsx)("line",{x1:l(e),y1:12,x2:l(e),y2:84,stroke:"#1e293b",strokeDasharray:"2 3"}),(0,a.jsxs)("text",{x:l(e),y:96,fill:"#64748b",fontSize:8,fontFamily:"monospace",textAnchor:"middle",children:["R",e]})]},e)),(0,a.jsx)("text",{x:17,y:r(n)+3,fill:"#64748b",fontSize:8,fontFamily:"monospace",textAnchor:"end",children:n}),(0,a.jsx)("text",{x:17,y:r(0)+3,fill:d.SHIP,fontSize:8,fontFamily:"monospace",textAnchor:"end",children:"0"}),t.slice(0,6).map((e,t)=>{let n=e.points.at(-1),s=0===n.asks?d.SHIP:["#818cf8","#fbbf24","#38bdf8","#f0abfc","#fb7185"][t%5];return(0,a.jsxs)("g",{children:[(0,a.jsx)("polyline",{fill:"none",stroke:s,strokeWidth:1.6,points:e.points.map(e=>"".concat(l(e.round),",").concat(r(e.asks))).join(" ")}),e.points.map(e=>(0,a.jsx)("circle",{cx:l(e.round),cy:r(e.asks),r:2.5,fill:s},e.round)),(0,a.jsxs)("text",{x:l(n.round)+4,y:r(n.asks)-3,fill:s,fontSize:8,fontFamily:"monospace",children:["#",e.pr," ",n.asks]})]},e.pr)})]})})}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6605],{50940:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(89117).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},53220:(e,t,a)=>{"use strict";a.d(t,{V5:()=>s,tV:()=>l});var r=a(94387);class n extends Error{constructor(e,t,a){super(a||t),this.status=e,this.error=t,this.reason=a,this.name="MergeApprovalsApiError"}}function s(e,t){return e instanceof n?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 l(e){var t,a;let s=null!=(t=e.fetchImpl)?t:fetch,l=(null!=(a=e.baseUrl)?a:"").replace(/\/+$/,"");async function o(t,a){let r={...a,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},o=e.client?await e.client.fetchResponse(t,r):await s("".concat(l).concat(t),r),c=await o.json().catch(()=>null);if(!o.ok){var i;let e=c&&"object"==typeof c?c:{};throw new n(o.status,null!=(i=e.error)?i:"request-failed",e.reason)}return c}return{list:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"open";return o("merged"===e?"".concat(r.r5,"?state=merged"):r.r5)},get:e=>o("".concat(r.r5,"/").concat(e)),check:(e,t)=>o("".concat(r.r5,"/").concat(e,"/check"),{method:"POST",body:JSON.stringify({headSha:t})}),merge:(e,t)=>o("".concat(r.r5,"/").concat(e,"/merge"),{method:"POST",body:JSON.stringify({headSha:t})})}}},71807:(e,t,a)=>{"use strict";a.d(t,{GC:()=>n,In:()=>i,OG:()=>o});var r=a(91269);let n="elanous.pwa.role",s="elanous:pwa-role";function l(){try{let e=window.localStorage.getItem(n);if("owner"===e||"contributor"===e||"general"===e)return e}catch(e){}return"general"}function o(e){try{window.localStorage.setItem(n,e)}catch(e){}"function"==typeof window.dispatchEvent&&window.dispatchEvent(new Event(s))}function c(e){if("function"!=typeof window.addEventListener)return()=>{};window.addEventListener(s,e);let t=t=>{(t.key===n||null===t.key)&&e()};return window.addEventListener("storage",t),()=>{window.removeEventListener(s,e),window.removeEventListener("storage",t)}}function i(){return(0,r.useSyncExternalStore)(c,l,()=>"general")}},84422:(e,t,a)=>{Promise.resolve().then(a.bind(a,98012))},89117:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var r=a(91269);let n=function(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return t.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim()},s=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var l={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 o=(0,r.createContext)({}),c=(0,r.forwardRef)((e,t)=>{var a,s,c;let{color:i,size:d,strokeWidth:u,absoluteStrokeWidth:m,className:p="",children:h,iconNode:x,...b}=e,{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:N=!1,color:j="currentColor",className:w=""}=null!=(a=(0,r.useContext)(o))?a:{},y=(null!=m?m:N)?24*Number(null!=u?u:g)/Number(null!=d?d:f):null!=u?u:g;return(0,r.createElement)("svg",{ref:t,...l,width:null!=(s=null!=d?d:f)?s:l.width,height:null!=(c=null!=d?d:f)?c:l.height,stroke:null!=i?i:j,strokeWidth:y,className:n("lucide",w,p),...!h&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(b)&&{"aria-hidden":"true"},...b},[...x.map(e=>{let[t,a]=e;return(0,r.createElement)(t,a)}),...Array.isArray(h)?h:[h]])}),i=(e,t)=>{let a=(0,r.forwardRef)((a,l)=>{let{className:o,...i}=a;return(0,r.createElement)(c,{ref:l,iconNode:t,className:n("lucide-".concat(s(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),o),...i})});return a.displayName=s(e),a}},94387:(e,t,a)=>{"use strict";a.d(t,{GM:()=>o,J3:()=>l,WF:()=>r,bR:()=>s,m:()=>c,r5:()=>n});let r="/v1/devices",n="/v1/approvals/merges",s="/v1/templates/capability-preview",l="/v1/idle-nudge/preview",o="/v1/morning-digest/showroom",c="/v1/next-fluent/dispatch"},98012:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>R});var r=a(41121),n=a(91269),s=a(71946),l=a(38317),o=a(38519),c=a(71807),i=a(53220);function d(e,t){return"UNKNOWN"===t&&e<3?3e3:null}async function u(e,t){let a,r=0,n=d(0,"UNKNOWN");for(;null!==n;){var s,l,o;if(await t.sleep(n),t.isActive&&!t.isActive())break;r++;try{a=await e(),null==(l=t.onDetail)||l.call(t,a)}catch(e){}null==(s=t.onAttempt)||s.call(t),n=d(r,null!=(o=null==a?void 0:a.mergeable)?o:"UNKNOWN")}return{attempts:r,...a?{last:a}:{}}}var m=a(50940);function p(e){let{view:t,target:a}=e,[s]=(0,n.useState)(()=>Date.now()),[l,o]=(0,n.useState)(s);(0,n.useEffect)(()=>{let e=window.setInterval(()=>o(Date.now()),100);return()=>window.clearInterval(e)},[]);let c=function(e,t,a){let r="".concat((Math.max(0,e)/1e3).toFixed(1),"초");return{title:"merged"===t?"GitHub 에서 반영된 코드 변경을 읽고 있습니다":a?"GitHub 에서 승인을 기다리는 코드 변경과 #".concat(a," 카드를 읽고 있습니다"):"GitHub 에서 승인을 기다리는 코드 변경을 읽고 있습니다",clock:r,hint:e>=8e3?"평소(2~5초)보다 오래 걸립니다 — GitHub 응답을 기다리는 중이며 멈추지 않았습니다.":null}}(l-s,t,a);return(0,r.jsxs)("section",{role:"status","aria-live":"polite","aria-busy":"true",className:"space-y-3","data-approvals-loading":!0,children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-blue-500/40 bg-blue-500/5 p-4",children:[(0,r.jsx)(m.A,{className:"h-6 w-6 shrink-0 text-blue-500 motion-safe:animate-spin","aria-hidden":!0}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-medium",children:c.title}),c.hint&&(0,r.jsx)("p",{className:"mt-1 text-sm text-amber-600 dark:text-amber-400",children:c.hint})]}),(0,r.jsx)("span",{className:"font-mono text-lg tabular-nums text-blue-600 dark:text-blue-300","aria-label":"경과 시간",children:c.clock})]}),(0,r.jsx)("div",{className:"h-1 overflow-hidden rounded-full bg-muted","aria-hidden":!0,children:(0,r.jsx)("div",{className:"h-full w-1/3 rounded-full bg-blue-500 motion-safe:animate-[approvals-slide_1.2s_ease-in-out_infinite]"})}),(0,r.jsx)("style",{children:"@keyframes approvals-slide{0%{transform:translateX(-100%)}100%{transform:translateX(300%)}}"}),[0,1].map(e=>(0,r.jsxs)("div",{className:"space-y-3 rounded-xl border border-border bg-card p-5 motion-safe:animate-pulse","aria-hidden":!0,children:[(0,r.jsx)("div",{className:"h-4 w-2/3 rounded bg-muted"}),(0,r.jsx)("div",{className:"h-3 w-full rounded bg-muted"}),(0,r.jsx)("div",{className:"h-3 w-5/6 rounded bg-muted"})]},e))]})}function h(e){let{view:t,onChange:a}=e,n=(e,n)=>(0,r.jsx)("button",{type:"button",role:"tab","aria-selected":t===e,onClick:()=>a(e),className:"rounded-md px-3 py-1 text-sm ".concat(t===e?"bg-foreground text-background":"bg-muted text-foreground"),children:n});return(0,r.jsxs)("div",{role:"tablist","aria-label":"승인 목록 보기",className:"flex gap-2",children:[n("open","승인 대기"),n("merged","완료")]})}function x(e){let{brief:t,lineage:a,summary:n}=e;return(0,r.jsxs)(r.Fragment,{children:[null!==t?(0,r.jsx)("section",{"aria-label":"승인 요약",className:"mt-3 break-words text-sm leading-relaxed [&_a]:text-blue-600 [&_a]:underline [&_blockquote]:border-l-2 [&_blockquote]:pl-3 [&_h3]:mt-3 [&_h3]:font-semibold [&_li]:ml-5 [&_li]:list-disc [&_p]:my-2 [&_table]:block [&_table]:overflow-x-auto",children:(0,r.jsx)(s.oz,{remarkPlugins:[l.A],components:{a:e=>{let{href:t,children:a}=e;return(0,r.jsx)("a",{href:t,target:"_blank",rel:"noreferrer",children:a})}},children:t})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{className:"mt-3 rounded border border-amber-500/40 bg-amber-500/15 p-3 text-sm text-amber-800 dark:text-amber-300",children:"승인 요약 내용이 없습니다 — GitHub 본문을 보거나 발사자에게 요청하세요"}),(0,r.jsx)("p",{className:"mt-3 whitespace-pre-wrap text-sm",children:n})]}),a&&(0,r.jsxs)("p",{className:"mt-3 text-sm text-muted-foreground",children:["아이디어 원장: ",a]})]})}function b(e){var t;let{gate:a,busy:n,blocked:s,mergeLabel:l,onCheck:o,onMerge:c}=e;return(0,r.jsxs)("div",{className:"mt-3 space-y-2","aria-label":"머지 전 검사",children:["none"===a.status&&(0,r.jsx)("button",{type:"button",onClick:o,disabled:n,className:"rounded-lg border px-3 py-2 text-sm disabled:opacity-50",children:"머지 전 검사 시작"}),"running"===a.status&&(0,r.jsx)("p",{role:"status",className:"text-sm",children:"검사 중…"}),"passed"===a.status&&(0,r.jsxs)("p",{className:"text-sm text-green-700 dark:text-green-400",children:["검사 통과 (",null!=(t=a.os)?t:"unknown",")",a.baseDrifted?" \xb7 검사 뒤 main 이 움직였다 — 머지 때 겹치는 파일이 있으면 다시 검사를 요구한다":""]}),("failed"===a.status||"unmeasured"===a.status)&&(0,r.jsxs)("div",{role:"alert",className:"text-sm text-red-600",children:[(0,r.jsx)("p",{children:"failed"===a.status?"검사 실패":"검사 측정 불가"}),(0,r.jsx)("ul",{className:"list-inside list-disc",children:a.failures.map((e,t)=>(0,r.jsx)("li",{children:e},t))}),(0,r.jsx)("button",{type:"button",onClick:o,disabled:n,className:"mt-2 rounded-lg border px-3 py-2 disabled:opacity-50",children:"머지 전 검사 다시 시작"})]}),(0,r.jsx)("button",{type:"button",onClick:c,disabled:n||s||"passed"!==a.status,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white disabled:cursor-not-allowed disabled:opacity-50",children:null!=l?l:"승인하고 머지"})]})}function f(e){let{card:t,api:a,attempt:r,onAttempt:s,onUpdate:l}=e,o="UNKNOWN"===t.mergeable&&!t.merged&&"OPEN"===t.state;return(0,n.useEffect)(()=>{if(!o||r>0)return;let e=!0,n=[];return u(()=>a.get(t.number),{sleep:e=>new Promise(t=>{n.push(window.setTimeout(t,e))}),isActive:()=>e,onDetail:a=>{e&&l(a,t.headSha)},onAttempt:()=>{e&&s(t.number)}}),()=>{for(let t of(e=!1,n))window.clearTimeout(t)}},[a,t.number,o,r,s,l]),null}function g(){let e=(0,c.In)(),{client:t}=(0,o.Q)(),a=(0,n.useMemo)(()=>(0,i.tV)({client:t}),[t]),[s,l]=(0,n.useState)([]),[u,m]=(0,n.useState)(!0),[g,N]=(0,n.useState)(null),[j,w]=(0,n.useState)(null),[y,v]=(0,n.useState)({}),[k,C]=(0,n.useState)({}),[S,I]=(0,n.useState)(null),[E,R]=(0,n.useState)("open"),U=(0,n.useCallback)(e=>{C(t=>{var a;return{...t,[e]:(null!=(a=t[e])?a:0)+1}})},[]),O=(0,n.useCallback)((e,t)=>{l(a=>a.map(a=>a.number!==e.number||a.headSha!==t?a:{...e,gate:e.headSha===t?e.gate:{status:"none",failures:[]},merged:a.merged}))},[]);async function L(e){w(e.number),v(t=>({...t,[e.number]:""}));try{let{gate:t}=await a.check(e.number,e.headSha);l(a=>a.map(a=>a.number===e.number&&a.headSha===e.headSha?{...a,gate:t}:a))}catch(t){v(a=>({...a,[e.number]:(0,i.V5)(t,"검사를 시작하지 못했습니다.").text}))}finally{w(null)}}async function A(e){if(window.confirm("#".concat(e.number," ").concat(e.title,"\n현재 확인한 변경을 승인하고 머지할까요?"))){w(e.number),v(t=>({...t,[e.number]:""}));try{await a.merge(e.number,e.headSha),l(t=>t.map(t=>t.number===e.number?{...t,merged:!0,state:"MERGED"}:t))}catch(t){v(a=>({...a,[e.number]:(0,i.V5)(t,"머지하지 못했습니다.").text}))}finally{w(null)}}}return((0,n.useEffect)(()=>{let e=s.filter(e=>"OPEN"===e.state&&("running"===e.gate.status||"passed"===e.gate.status));if("open"!==E||!e.length)return;let t=!0,r=window.setInterval(()=>{for(let r of e)a.get(r.number).then(e=>{t&&O(e,r.headSha)}).catch(e=>{t&&v(t=>({...t,[r.number]:(0,i.V5)(e,"검사 상태를 불러오지 못했습니다.").text}))})},1e4);return()=>{t=!1,window.clearInterval(r)}},[a,s,O,E]),(0,n.useEffect)(()=>{let e=!0,t=Number(new URLSearchParams(window.location.search).get("pr")),r=Number.isSafeInteger(t)&&t>0?t:null;return(m(!0),N(null),I(r),"merged"===E)?(a.list("merged").then(t=>{let{items:a}=t;e&&l(a)}).catch(t=>{e&&N((0,i.V5)(t,"목록을 불러오지 못했습니다."))}).finally(()=>{e&&m(!1)}),()=>{e=!1}):(a.list().then(async t=>{let{items:n}=t;if(!e)return;let s=n.find(e=>e.number===r);if(r&&!s)try{let t=await a.get(r);e&&l([t,...n])}catch(t){e&&N((0,i.V5)(t,"PR 을 불러오지 못했습니다.")),e&&l(n)}else l(r?[...n].sort((e,t)=>Number(t.number===r)-Number(e.number===r)):n)}).catch(t=>{e&&N((0,i.V5)(t,"목록을 불러오지 못했습니다."))}).finally(()=>{e&&m(!1)}),()=>{e=!1})},[a,E]),"owner"===e||"open"!==E||u||s.length||g)?(0,r.jsxs)("main",{className:"mx-auto max-w-3xl space-y-5 p-4 pb-20 text-foreground sm:p-8",children:[(0,r.jsxs)("header",{children:[(0,r.jsx)("h1",{className:"text-2xl font-semibold",children:"코드 변경 승인"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"자동으로 만든 코드 변경(PR)을 확인하고 승인합니다."})]}),(0,r.jsx)(h,{view:E,onChange:e=>{l([]),R(e)}}),u&&(0,r.jsx)(p,{view:E,target:S}),g&&(0,r.jsxs)("p",{role:"alert",className:"text-red-600","data-approvals-error":!0,children:[g.text,g.href&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)("a",{href:g.href,className:"font-semibold underline underline-offset-2","data-approvals-settings":!0,children:"설정 열기 →"})]})]}),!u&&!s.length&&!g&&(0,r.jsx)("p",{children:"merged"===E?"승인해 반영된 코드 변경이 아직 없습니다.":"승인을 기다리는 코드 변경이 없습니다."}),s.map(e=>{var t,n;let s=e.merged||"MERGED"===e.state,l="OPEN"!==e.state&&!s,o=e.draft?"초안 PR 은 머지할 수 없습니다. GitHub에서 초안을 해제한 뒤 다시 확인하세요.":e.checks.failure>0?"실패한 검사가 있습니다.":e.checks.pending>0?"검사가 아직 끝나지 않았습니다.":"CONFLICTING"===e.mergeable?"머지 충돌이 있습니다.":"MERGEABLE"!==e.mergeable?"머지 가능 여부가 아직 확인되지 않았습니다.":"main"!==e.base?"대상 브랜치가 main 이 아닙니다.":"",c=S===e.number,i=null!=(t=k[e.number])?t:0;return(0,r.jsxs)("article",{className:"rounded-xl border bg-card p-5 shadow-sm ".concat(c?"border-blue-500 ring-2 ring-blue-500/30":"border-border"),children:[(0,r.jsx)(f,{card:e,api:a,attempt:i,onAttempt:U,onUpdate:O}),(0,r.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,r.jsxs)("h2",{className:"font-semibold",children:["#",e.number," \xb7 ",e.title]}),(0,r.jsx)("span",{className:"rounded bg-muted px-2 py-1 text-xs",children:s?function(e){if(!e)return"머지됨";let t=new Date(e);if(Number.isNaN(t.getTime()))return"머지됨";let a=new Date(t.getTime()+324e5).toISOString();return"머지됨 ".concat(a.slice(5,10)," ").concat(a.slice(11,16)," KST")}(e.mergedAt):l?"닫힘":e.draft?"초안":"열림"})]}),(0,r.jsx)(x,{brief:e.brief,lineage:e.lineage,summary:e.summary}),(0,r.jsxs)("p",{className:"mt-3 text-sm text-muted-foreground",children:["+",e.additions," 추가 / −",e.deletions," 삭제 \xb7 파일 ",e.changedFiles]}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2 text-xs","aria-label":"검사 상태",children:[(0,r.jsxs)("span",{className:"rounded bg-green-500/15 px-2 py-1",children:["성공 ",e.checks.success]}),(0,r.jsxs)("span",{className:"rounded bg-red-500/15 px-2 py-1",children:["실패 ",e.checks.failure]}),(0,r.jsxs)("span",{className:"rounded bg-yellow-500/15 px-2 py-1",children:["대기 ",e.checks.pending]}),e.checks.success+e.checks.failure+e.checks.pending===0&&(0,r.jsx)("span",{className:"rounded bg-slate-500/15 px-2 py-1",children:"GitHub 검사 없음 — 머지 전 검사는 아래에서 별도로 실행"})]}),(0,r.jsxs)("details",{open:c,className:"mt-3 text-sm",children:[(0,r.jsx)("summary",{className:"cursor-pointer",children:"바뀐 파일 보기"}),(0,r.jsx)("ul",{className:"mt-2 list-inside list-disc break-all",children:e.files.map(e=>(0,r.jsx)("li",{children:e},e))})]}),(0,r.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-4",children:[(0,r.jsx)("a",{className:"text-sm text-blue-600 underline",href:e.url,target:"_blank",rel:"noopener noreferrer",children:"GitHub 에서 보기"}),!s&&!l&&(0,r.jsx)(b,{gate:e.gate,busy:null!==j,blocked:!!o,mergeLabel:j===e.number?"머지 중…":"UNKNOWN"!==(n=e.mergeable)?"승인하고 머지":null===d(i,n)?"확인 종료":"확인 중…",onCheck:()=>L(e),onMerge:()=>A(e)})]}),o&&!s&&!l&&(0,r.jsxs)("p",{className:"mt-2 text-sm text-amber-600",children:[o,"UNKNOWN"===e.mergeable&&i>=3?" 자동 확인이 끝났습니다. 최신 상태는 페이지를 새로고침하세요.":""]}),y[e.number]&&(0,r.jsx)("p",{role:"alert",className:"mt-2 text-sm text-red-600",children:y[e.number]})]},e.number)})]}):null}function N(e){return{slides:e.slides.map(e=>{let{image:t,caption:a,include:r}=e;return{image:t,caption:a,include:r}}),caption:{hook:e.caption.hook,body:e.caption.body},hashtags:[...e.hashtags],cover:{text:e.cover.text,sub:e.cover.sub},location:e.location}}class j extends Error{constructor(e,t){super(t),this.status=e,this.name="GraphApprovalsApiError"}}let w={list:"목록을 보려면",decide:"승인하려면",save:"초안을 저장하려면"},y="/app/settings/#bearer-token";function v(e){return e instanceof j&&(401===e.status||403===e.status)}function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decide";return e instanceof j?401===e.status||403===e.status?"".concat(w[t]," 이 기기를 데몬에 연결해야 합니다 — 설정 › 데몬 연결 › 연결 토큰 칸에 토큰을 넣어 주세요."):404===e.status?"이 실행을 찾지 못했습니다. 목록을 다시 확인해 주세요.":409===e.status?"이미 결정된 실행입니다. 목록을 다시 확인해 주세요.":400===e.status?"결정 내용을 확인한 뒤 다시 시도해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요.":e instanceof TypeError?"서버에 연결하지 못했습니다. 연결 상태를 확인해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요."}let C="/v1/graph-approvals";function S(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),a="release-loop"===e.graphId?"릴리스 발행":"announce-loop"===e.graphId?"공지":e.graphId,r=Date.parse(e.since),n=Number.isNaN(r)?0:Math.max(0,Math.floor((t-r)/6e4)),s=n<1?"방금 전":n<60?"".concat(n,"분 전"):n<1440?"".concat(Math.floor(n/60),"시간 전"):"".concat(Math.floor(n/1440),"일 전");return{title:a,nodeId:e.nodeId,waiting:s,message:e.message,recent:e.recent.map(e=>"".concat(e.ok&&"fail"!==e.outcome&&"error"!==e.outcome?"✓":"✗"," ").concat(e.nodeId).concat(e.outcome?" \xb7 ".concat(e.outcome):"").concat(e.summary?" \xb7 ".concat(e.summary):""))}}function I(e){var t,a,s,l,o,c,i;let{item:d,api:u,onDecided:m,confirm:p}=e,[h,x]=(0,n.useState)(d.feed),[b,f]=(0,n.useState)(()=>N(d.feed)),[g,j]=(0,n.useState)(!1),[w,C]=(0,n.useState)(0),[S,I]=(0,n.useState)(!1),[E,R]=(0,n.useState)(!1),[U,O]=(0,n.useState)(""),[L,A]=(0,n.useState)(""),[M,_]=(0,n.useState)(!1),D=(e,t)=>{A(k(e,t)),_(v(e))},[G,H]=(0,n.useState)({}),T=(0,n.useRef)(null),P=null!=p?p:e=>window.confirm(e),F=(i=N(h),JSON.stringify(b)!==JSON.stringify(i)),W=(0,n.useMemo)(()=>(function(e,t){let a=[];for(let r of(e.cover.image&&a.push({image:e.cover.image,isCover:!0}),t.slides))r.include&&a.push({image:r.image,caption:r.caption});return a})(h,b),[h,b]),V=W[Math.min(w,Math.max(0,W.length-1))],z=(0,n.useMemo)(()=>[h.cover.image,...h.slides.map(e=>e.image)].filter(e=>!!e),[h]);function J(e){C(t=>Math.max(0,Math.min(W.length-1,t+e)))}function K(e,t){f(a=>({...a,slides:a.slides.map((a,r)=>r===e?{...a,...t}:a)}))}function q(e,t){f(a=>{let r=e+t;if(r<0||r>=a.slides.length)return a;let n=[...a.slides];return[n[e],n[r]]=[n[r],n[e]],{...a,slides:n}})}async function X(){R(!0),A(""),_(!1),O("");try{let e=await u.saveFeedDraft(d.graphId,d.runId,b);return x(e.feed),f(N(e.feed)),O("저장했어요 \xb7 수정 ".concat(e.feed.revision," \xb7 아직 게시 전입니다")),!0}catch(e){return D(e,"save"),!1}finally{R(!1)}}async function $(){if(P("게시할까요? 승인하면 이 초안으로 게시 준비 묶음이 텔레그램으로 갑니다.")&&(!F||await X())){R(!0),A("");try{await u.decide(d.graphId,d.runId,"approved"),m()}catch(e){D(e,"decide")}finally{R(!1)}}}async function B(){if(P("이 게시 초안을 거절할까요?")){R(!0),A("");try{await u.decide(d.graphId,d.runId,"rejected"),m()}catch(e){D(e,"decide")}finally{R(!1)}}}(0,n.useEffect)(()=>{let e=!0,t=[],a="undefined"!=typeof URL&&"function"==typeof URL.createObjectURL;return Promise.all(z.map(async r=>{try{let n=await u.feedMedia(d.graphId,d.runId,r);if(!e||!a)return null;let s=URL.createObjectURL(n);return t.push(s),[r,s]}catch(e){return null}})).then(t=>{e&&H(Object.fromEntries(t.filter(e=>!!e)))}),()=>{e=!1,a&&"function"==typeof URL.revokeObjectURL&&t.forEach(e=>URL.revokeObjectURL(e))}},[u,d.graphId,d.runId,z]);let Q=(null==(t=h.brand)?void 0:t.name)||"브랜드",Z=Q.trim().charAt(0).toUpperCase()||"\xb7",Y=b.hashtags.join(" "),ee=b.cover.text!==(null!=(s=h.cover.renderedText)?s:h.cover.text)||b.cover.sub!==(null!=(l=h.cover.renderedSub)?l:h.cover.sub);return(0,r.jsxs)("article",{"aria-label":"피드 미리보기","data-feed-revision":h.revision,className:"mx-auto w-full max-w-md overflow-hidden rounded-xl border border-border bg-card text-foreground shadow-sm",children:[(0,r.jsxs)("header",{className:"flex items-center gap-3 px-3 py-2",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-muted text-sm font-semibold",children:Z}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"truncate text-sm font-semibold",children:Q}),(null==(a=h.brand)?void 0:a.handle)&&(0,r.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:h.brand.handle})]}),(0,r.jsxs)("span",{className:"ml-auto shrink-0 text-xs text-muted-foreground",children:["수정 ",h.revision,F?" \xb7 저장 안 됨":""]})]}),(0,r.jsxs)("div",{className:"relative aspect-[4/5] w-full touch-pan-y select-none overflow-hidden bg-muted",onTouchStart:e=>{var t,a;T.current=null!=(a=null==(t=e.touches[0])?void 0:t.clientX)?a:null},onTouchEnd:e=>{var t;let a=T.current;T.current=null;let r=null==(t=e.changedTouches[0])?void 0:t.clientX;null==a||null==r||40>Math.abs(r-a)||J(r<a?1:-1)},children:[(null==V?void 0:V.image)&&G[V.image]?(0,r.jsx)("img",{src:G[V.image],alt:V.isCover?b.cover.text:null!=(o=V.caption)?o:"",className:"h-full w-full object-cover"}):(0,r.jsx)("div",{className:"flex h-full w-full items-center justify-center text-sm text-muted-foreground",children:"이미지 불러오는 중"}),W.length>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button","aria-label":"이전 장",disabled:0===w,onClick:()=>J(-1),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full bg-black/40 px-2 py-1 text-white disabled:opacity-0",children:"‹"}),(0,r.jsx)("button",{type:"button","aria-label":"다음 장",disabled:w>=W.length-1,onClick:()=>J(1),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full bg-black/40 px-2 py-1 text-white disabled:opacity-0",children:"›"})]})]}),W.length>1&&(0,r.jsx)("div",{"aria-label":"장 표시",className:"flex justify-center gap-1.5 py-2",children:W.map((e,t)=>(0,r.jsx)("span",{"data-dot":t===w?"on":"off",className:"h-1.5 w-1.5 rounded-full ".concat(t===w?"bg-primary":"bg-muted-foreground/40")},t))}),ee&&(0,r.jsxs)("p",{"data-cover-pending":!0,className:"mx-3 mb-2 rounded border border-dashed border-border px-2 py-1 text-xs text-muted-foreground",children:["커버 문구 변경 — \xab",b.cover.text,b.cover.sub?" \xb7 ".concat(b.cover.sub):"","\xbb \xb7 게시 때 커버를 다시 그립니다"]}),(0,r.jsxs)("div",{className:"space-y-2 px-3 pb-3 text-sm",children:[(0,r.jsxs)("p",{className:"break-words",children:[(0,r.jsx)("span",{className:"font-semibold",children:Q})," ",b.caption.hook]}),b.caption.body&&(S?(0,r.jsx)("p",{className:"whitespace-pre-wrap break-words",children:b.caption.body}):(0,r.jsx)("button",{type:"button",onClick:()=>I(!0),className:"text-muted-foreground",children:"더 보기"})),b.hashtags.length>0&&(0,r.jsx)("p",{className:"flex flex-wrap gap-x-1.5 text-primary",children:b.hashtags.map((e,t)=>(0,r.jsx)("span",{className:"whitespace-nowrap",children:e},"".concat(e,"-").concat(t)))}),b.location&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCCD ",b.location]})]}),g&&(0,r.jsxs)("section",{"aria-label":"초안 편집",className:"space-y-3 border-t border-border px-3 py-3 text-sm",children:[(0,r.jsxs)("label",{className:"block",children:["커버 문구",(0,r.jsx)("input",{value:b.cover.text,onChange:e=>f({...b,cover:{...b.cover,text:e.target.value}}),className:"mt-1 w-full rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsxs)("label",{className:"block",children:["커버 부제",(0,r.jsx)("input",{value:b.cover.sub,onChange:e=>f({...b,cover:{...b.cover,sub:e.target.value}}),className:"mt-1 w-full rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsxs)("label",{className:"block",children:["첫 줄",(0,r.jsx)("input",{value:b.caption.hook,onChange:e=>f({...b,caption:{...b.caption,hook:e.target.value}}),className:"mt-1 w-full rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsxs)("label",{className:"block",children:["본문",(0,r.jsx)("textarea",{value:b.caption.body,rows:4,onChange:e=>f({...b,caption:{...b.caption,body:e.target.value}}),className:"mt-1 w-full rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsxs)("label",{className:"block",children:["해시태그(띄어쓰기로 구분)",(0,r.jsx)("input",{value:Y,onChange:e=>f({...b,hashtags:e.target.value.split(/\s+/).filter(Boolean)}),className:"mt-1 w-full rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsxs)("label",{className:"block",children:["위치(비우면 없음)",(0,r.jsx)("input",{value:null!=(c=b.location)?c:"",onChange:e=>f({...b,location:e.target.value.trim()?e.target.value:null}),className:"mt-1 w-full rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsx)("ol",{"aria-label":"사진 순서",className:"space-y-2",children:b.slides.map((e,t)=>(0,r.jsxs)("li",{"data-slide":e.image,className:"rounded border border-border p-2 ".concat(e.include?"":"opacity-50"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"w-6 shrink-0 text-xs text-muted-foreground",children:t+1}),(0,r.jsx)("input",{"aria-label":"".concat(t+1,"번 사진 설명"),value:e.caption,onChange:e=>K(t,{caption:e.target.value}),className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1"})]}),(0,r.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,r.jsx)("button",{type:"button",disabled:0===t,onClick:()=>q(t,-1),className:"rounded border px-2 py-0.5 disabled:opacity-40",children:"앞으로"}),(0,r.jsx)("button",{type:"button",disabled:t===b.slides.length-1,onClick:()=>q(t,1),className:"rounded border px-2 py-0.5 disabled:opacity-40",children:"뒤로"}),(0,r.jsx)("button",{type:"button",onClick:()=>K(t,{include:!e.include}),className:"rounded border px-2 py-0.5",children:e.include?"빼기":"되살리기"})]})]},e.image))})]}),(U||L)&&(0,r.jsx)("p",{role:L?"alert":"status",className:"px-3 pb-2 text-sm ".concat(L?"text-red-600":"text-muted-foreground"),children:L||U}),L&&M&&(0,r.jsx)("p",{className:"px-3 pb-2 text-sm",children:(0,r.jsx)("a",{href:y,className:"font-medium underline","data-connect-token-link":!0,children:"연결 토큰 칸 열기 →"})}),(0,r.jsxs)("footer",{className:"flex flex-wrap gap-2 border-t border-border px-3 py-3",children:[(0,r.jsx)("button",{type:"button",disabled:E,onClick:()=>j(e=>!e),className:"rounded-lg border px-3 py-2 text-sm disabled:opacity-50",children:g?"편집 닫기":"편집"}),(0,r.jsx)("button",{type:"button",disabled:E||!F,onClick:()=>{X()},className:"rounded-lg border px-3 py-2 text-sm disabled:opacity-50",children:"수정 저장"}),(0,r.jsx)("button",{type:"button",disabled:E,onClick:()=>{$()},className:"rounded-lg bg-blue-600 px-3 py-2 text-sm font-medium text-white disabled:opacity-50",children:"최종 게시"}),(0,r.jsx)("button",{type:"button",disabled:E,onClick:()=>{B()},className:"ml-auto rounded-lg px-3 py-2 text-sm text-muted-foreground disabled:opacity-50",children:"거절"})]})]})}function E(){let e,{client:t}=(0,o.Q)(),a=(0,n.useMemo)(()=>(function(e){var t,a;let r=(null!=(t=e.baseUrl)?t:"").replace(/\/+$/,""),n=null!=(a=e.fetchImpl)?a:fetch;async function s(t,a){let s={...a,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},l=e.client?await e.client.fetchResponse(t,s):await n("".concat(r).concat(t),s),o=await l.json().catch(()=>null);if(!l.ok){let e=o&&"object"==typeof o&&"error"in o&&"string"==typeof o.error?o.error:"request-failed";throw new j(l.status,e)}return o}return{list:()=>s(C),decide:(e,t,a)=>s("".concat(C,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)),{method:"POST",body:JSON.stringify({decision:a})}),saveFeedDraft:(e,t,a)=>s("".concat(C,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t),"/feed-draft"),{method:"PUT",body:JSON.stringify(a)}),feedMedia:async(t,a,s)=>{let l="".concat(C,"/").concat(encodeURIComponent(t),"/").concat(encodeURIComponent(a),"/media?path=").concat(encodeURIComponent(s)),o={headers:e.authHeader?{authorization:e.authHeader}:{}},c=e.client?await e.client.fetchResponse(l,o):await n("".concat(r).concat(l),o);if(!c.ok)throw new j(c.status,"media-failed");return c.blob()}}})({client:t}),[t]),[s,l]=(0,n.useState)([]),[c,i]=(0,n.useState)(""),[d,u]=(0,n.useState)(!1),[m,p]=(0,n.useState)(!1),h=(0,n.useRef)((e=0,{begin:()=>e+=1,isLatest:t=>t===e})).current,x=(0,n.useCallback)(async()=>{let e=h.begin();try{let t=await a.list();if(!h.isLatest(e))return;l(t.items),i(""),u(!1)}catch(t){h.isLatest(e)&&(i(k(t,"list")),u(v(t)))}},[a,h]);async function b(e,t){if("rejected"!==t||window.confirm("".concat(S(e).title," 실행을 거절할까요?"))){p(!0),i(""),h.begin();try{await a.decide(e.graphId,e.runId,t),await x()}catch(e){i(k(e,"decide")),u(v(e))}finally{p(!1)}}}(0,n.useEffect)(()=>{x();let e=window.setInterval(()=>{x()},3e4);return()=>window.clearInterval(e)},[x]);let f=s.filter(e=>!!e.feed),g=s.filter(e=>!e.feed);return s.length||c?(0,r.jsxs)(r.Fragment,{children:[f.length>0&&(0,r.jsxs)("section",{"aria-label":"게시 대기",className:"mx-auto max-w-3xl space-y-4 px-4 pt-6 text-foreground sm:px-8",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"게시 대기"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"고쳐서 저장해도 대기열에 남습니다. \xab최종 게시\xbb를 눌러야만 올라갑니다."}),f.map(e=>(0,r.jsx)(I,{item:e,api:a,onDecided:()=>{h.begin(),x()}},"".concat(e.graphId,"/").concat(e.runId)))]}),(g.length>0||c)&&(0,r.jsxs)("section",{"aria-label":"실행 승인",className:"mx-auto max-w-3xl space-y-4 px-4 pt-6 text-foreground sm:px-8",children:[(0,r.jsx)("h2",{className:"text-xl font-semibold",children:"실행 승인"}),c&&(0,r.jsx)("p",{role:"alert",className:"text-sm text-red-600",children:c}),c&&d&&(0,r.jsx)("p",{className:"text-sm",children:(0,r.jsx)("a",{href:y,className:"font-medium underline","data-connect-token-link":!0,children:"연결 토큰 칸 열기 →"})}),g.map(e=>{let t=S(e);return(0,r.jsxs)("article",{className:"rounded-xl border border-border bg-card p-5 shadow-sm",children:[(0,r.jsx)("h3",{className:"font-semibold",children:t.title}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:["멈춘 단계: ",t.nodeId," \xb7 ",t.waiting,"부터 대기 중"]}),(0,r.jsx)("p",{className:"mt-3 whitespace-pre-wrap break-words text-sm",children:t.message}),t.recent.length>0&&(0,r.jsxs)("div",{className:"mt-3 text-sm",children:[(0,r.jsx)("p",{className:"font-medium",children:"최근 단계"}),(0,r.jsx)("ul",{className:"mt-1 space-y-1",children:t.recent.map((e,t)=>(0,r.jsx)("li",{className:"break-words",children:e},t))})]}),(0,r.jsxs)("div",{className:"mt-4 flex gap-2",children:[(0,r.jsx)("button",{type:"button",disabled:m,onClick:()=>{b(e,"approved")},className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white disabled:opacity-50",children:"승인"}),(0,r.jsx)("button",{type:"button",disabled:m,onClick:()=>{b(e,"rejected")},className:"rounded-lg border px-4 py-2 text-sm disabled:opacity-50",children:"거절"})]})]},"".concat(e.graphId,"/").concat(e.runId))})]})]}):null}function R(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(E,{}),(0,r.jsx)(g,{})]})}}},e=>{e.O(0,[2330,8519,2367,6725,7358],()=>e(e.s=84422)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2922],{5344:(e,t,s)=>{"use strict";s.d(t,{r:()=>i});var r=s(41121),a=s(45609),n=s.n(a);let l=[{key:"autopilot",href:"/autopilot",num:"①",label:"미션",sub:"Autopilot"},{key:"tasks",href:"/tasks",num:"②",label:"작업",sub:"Tasks"},{key:"scheduler",href:"/scheduler",num:"③",label:"스케줄",sub:"Schedules"}];function i(e){let{active:t}=e;return(0,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"}),l.map((e,s)=>(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsxs)(n(),{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})]}),s<l.length-1&&(0,r.jsx)("span",{className:"text-muted-foreground/50","aria-hidden":!0,children:"→"})]},e.key))]})}},30968:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>O});var r=s(41121),a=s(91269),n=s(38519),l=s(72030),i=s(66062);let o=["dig","backtest","trade","retro","replay"],d=[["replay","dig"],["dig","backtest"],["backtest","trade"],["trade","retro"],["retro","replay"]];function c(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let s=Math.max(0,Math.floor((Date.now()-t)/1e3));if(s<60)return"".concat(s,"s ago");let r=Math.floor(s/60);if(r<60)return"".concat(r,"m ago");let a=Math.floor(r/60);return a<24?"".concat(a,"h ago"):"".concat(Math.floor(a/24),"d ago")}function u(e){var t;let s=(null==(t=e.last)?void 0:t.at)?Date.parse(e.last.at):NaN;return!Number.isNaN(s)&&Date.now()-s<36e5}function x(){var e;let{client:t}=(0,n.Q)(),[s,x]=(0,a.useState)([]),[m,p]=(0,a.useState)(!1),[g,h]=(0,a.useState)(null),f=(0,a.useCallback)(async()=>{p(!0);try{var e,s;let r=await t.fetchJson("/v1/dashboard/loops");x(null!=(s=null==(e=r.loops)?void 0:e.loops)?s:[])}catch(e){i.oR.error("loops load failed: ".concat(e instanceof Error?e.message:e))}finally{p(!1)}},[t]);(0,a.useEffect)(()=>{f();let e=window.setInterval(()=>void f(),3e4);return()=>window.clearInterval(e)},[f]);let b=(0,a.useMemo)(()=>{let e=new Map;for(let t of s)e.set(t.name,t);return e},[s]),v=(0,a.useMemo)(()=>{let e=new Map;return o.forEach((t,s)=>e.set(t,function(e){let t=Math.PI/180*(-90+72*e);return{x:200+128*Math.cos(t),y:190+128*Math.sin(t)}}(s))),e},[]),j=g&&null!=(e=b.get(g))?e:null;return(0,r.jsxs)("div",{className:"mx-auto max-w-[1100px] space-y-4 p-4",children:[(0,r.jsxs)("header",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"투자 루프 오케스트라"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"5개 자율 루프의 순환(분석→백테→매매→회고→재생). 원 클릭 = 활동 기록 \xb7 펄스 = 최근 활동 \xb7 채움 = armed."})]}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>void f(),disabled:m,children:"Refresh"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start",children:[(0,r.jsxs)("section",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("svg",{viewBox:"0 0 400 380",className:"w-full",role:"img","aria-label":"loop orchestra graph",children:[(0,r.jsx)("defs",{children:(0,r.jsx)("marker",{id:"loop-arrow",viewBox:"0 0 10 10",refX:"8",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto-start-reverse",children:(0,r.jsx)("path",{d:"M 0 0 L 10 5 L 0 10 z",className:"fill-muted-foreground/50"})})}),d.map(e=>{let[t,s]=e,a=v.get(t),n=v.get(s);if(!a||!n)return null;let l=n.x-a.x,i=n.y-a.y,o=Math.hypot(l,i)||1,d=l/o,c=i/o,u=a.x+42*d,x=a.y+42*c,m=n.x-48*d,p=n.y-48*c;return(0,r.jsx)("line",{x1:u,y1:x,x2:m,y2:p,className:"stroke-muted-foreground/30",strokeWidth:1.5,markerEnd:"url(#loop-arrow)"},"".concat(t,"-").concat(s))}),o.map(e=>{var t,s,a,n;let l=b.get(e),i=v.get(e),o=!!l&&u(l),d=(null==l?void 0:l.armed)===!0,x=(null==l?void 0:l.category)!=="reflect",m=g===e;return(0,r.jsxs)("g",{className:"cursor-pointer",onClick:()=>h(t=>t===e?null:e),children:[o&&(0,r.jsxs)("circle",{cx:i.x,cy:i.y,r:40,className:x?"fill-sky-400/20":"fill-violet-400/20",children:[(0,r.jsx)("animate",{attributeName:"r",values:"".concat(40,";").concat(52),dur:"1.6s",repeatCount:"indefinite"}),(0,r.jsx)("animate",{attributeName:"opacity",values:"0.5;0",dur:"1.6s",repeatCount:"indefinite"})]}),(0,r.jsx)("circle",{cx:i.x,cy:i.y,r:40,className:"".concat(d?x?"fill-sky-500/25":"fill-violet-500/25":"fill-card"," ").concat(x?"stroke-sky-400":"stroke-violet-400"),strokeWidth:m?3.5:1.8}),(0,r.jsx)("text",{x:i.x,y:i.y-4,textAnchor:"middle",className:"fill-foreground text-[11px] font-medium",children:null!=(n=null==l||null==(s=l.label)||null==(t=s.split("(")[0])?void 0:t.trim())?n:e}),(0,r.jsx)("text",{x:i.x,y:i.y+10,textAnchor:"middle",className:"fill-muted-foreground text-[9px]",children:l?"".concat(c(null==(a=l.last)?void 0:a.at)):"—"}),(0,r.jsx)("text",{x:i.x,y:i.y+21,textAnchor:"middle",className:"fill-muted-foreground/70 text-[8px]",children:l?"today ".concat(l.today).concat(o?" \xb7 active":""):""})]},e)})]}),(0,r.jsxs)("div",{className:"flex flex-wrap justify-center gap-3 text-[11px] text-muted-foreground",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-sky-400"})," 실행축"]}),(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-violet-400"})," 사색축"]}),(0,r.jsx)("span",{children:"채움=armed \xb7 펄스=최근 활동"})]})]}),j&&(0,r.jsxs)("aside",{className:"w-full shrink-0 space-y-3 rounded-2xl border border-border bg-card p-4 lg:w-[360px]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-base font-semibold",children:j.label}),(0,r.jsx)("button",{type:"button",onClick:()=>h(null),className:"rounded-md px-1.5 py-0.5 text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground","aria-label":"close",children:"✕"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5 text-[11px]",children:[(0,r.jsx)("span",{className:"rounded-full px-2 py-0.5 ring-1 ".concat("reflect"===j.category?"text-violet-300 ring-violet-500/30":"text-sky-300 ring-sky-500/30"),children:"reflect"===j.category?"사색축":"실행축"}),(0,r.jsxs)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:["armed ",null===j.armed?"—":j.armed?"ON":"off"]}),(0,r.jsxs)("span",{className:"rounded-full bg-muted px-2 py-0.5 text-muted-foreground",children:["today ",j.today]}),u(j)&&(0,r.jsx)("span",{className:"rounded-full bg-emerald-500/15 px-2 py-0.5 text-emerald-300 ring-1 ring-emerald-500/30",children:"active"})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"text-sm font-semibold",children:"활동 기록"}),j.recent&&j.recent.length>0?(0,r.jsx)("div",{className:"space-y-1.5",children:j.recent.map((e,t)=>(0,r.jsxs)("div",{className:"rounded-lg bg-muted/40 px-3 py-2 text-[11px]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"font-medium text-foreground",children:e.status}),(0,r.jsx)("span",{className:"text-muted-foreground",title:e.at,children:c(e.at)})]}),e.detail&&(0,r.jsx)("div",{className:"mt-0.5 truncate text-muted-foreground",title:e.detail,children:e.detail})]},"".concat(e.at,"-").concat(t)))}):(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"활동 기록 없음."})]})]})]})]})}function m(e){let{api:t}=e,[s,n]=(0,a.useState)([]),[i,o]=(0,a.useState)(!0),d=(0,a.useCallback)(async()=>{try{var e;let s=await t.repoWatch();n(null!=(e=s.repos)?e:[])}catch(e){}finally{o(!1)}},[t]);return((0,a.useEffect)(()=>{d()},[d]),i)?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"참조 에이전트 repo 감시 — 새 커밋을 흡수 후보로 분석(제안은 텔레그램 report\xb7크론 08:40\xb720:40)."}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",onClick:()=>void d(),children:"새로고침"})]}),(0,r.jsx)("div",{className:"grid gap-3 sm:grid-cols-3",children:s.map(e=>(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card/50 p-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"font-medium",children:e.key}),e.lastNew>0&&(0,r.jsxs)("span",{className:"rounded bg-amber-500/15 px-2 py-0.5 text-xs text-amber-300 ring-1 ring-amber-500/30",children:["새 ",e.lastNew]})]}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.repo}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e.note}),(0,r.jsxs)("div",{className:"mt-2 flex items-center justify-between text-xs",children:[(0,r.jsx)("span",{className:"font-mono text-muted-foreground",children:e.lastSha?e.lastSha.slice(0,7):"—"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:function(e){if(!e)return"미감지";let t=Date.now()-Date.parse(e);if(Number.isNaN(t))return"—";let s=Math.round(t/6e4);if(s<60)return"".concat(s,"분 전");let r=Math.round(s/60);return r<24?"".concat(r,"시간 전"):"".concat(Math.round(r/24),"일 전")}(e.lastSeen)})]})]},e.repo))}),(0,r.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"흡수 채택 → PR 초안 + 빌드/테스트 증거는 P2(disarmed) \xb7 merge/재부팅은 대표 HITL."})]})}let p=["dig","backtest","trade","retro","replay","delegate","autopilot"],g={trade:"bg-rose-500/15 text-rose-300 ring-rose-500/30",dig:"bg-sky-500/15 text-sky-200 ring-sky-500/30",backtest:"bg-violet-500/15 text-violet-200 ring-violet-500/30",retro:"bg-amber-500/15 text-amber-200 ring-amber-500/30",replay:"bg-indigo-500/15 text-indigo-200 ring-indigo-500/30",delegate:"bg-emerald-500/15 text-emerald-200 ring-emerald-500/30",autopilot:"bg-fuchsia-500/15 text-fuchsia-200 ring-fuchsia-500/30"};function h(e){let{api:t}=e,[s,n]=(0,a.useState)([]),[i,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(!0),u=(0,a.useCallback)(async()=>{c(!0);try{var e;let s=await t.autonomy(80,null!=i?i:void 0);n(null!=(e=s.actions)?e:[])}catch(e){}finally{c(!1)}},[t,i]);return(0,a.useEffect)(()=>{u()},[u]),(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:()=>o(null),className:["rounded px-2 py-0.5 text-xs ring-1",null===i?"bg-primary/20 text-foreground ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:"전체"}),p.map(e=>{var t;return(0,r.jsx)("button",{type:"button",onClick:()=>o(e),className:["rounded px-2 py-0.5 text-xs ring-1",i===e?null!=(t=g[e])?t:"bg-primary/20 ring-primary/40":"bg-muted text-muted-foreground ring-border"].join(" "),children:e},e)}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",className:"ml-auto",onClick:()=>void u(),children:"새로고침"})]}),d?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"불러오는 중…"}):0===s.length?(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"아직 기록된 자율행동이 없습니다. 자율루프가 돌면 여기에 “무엇을 왜 했나”가 쌓입니다."}):(0,r.jsx)("ul",{className:"space-y-2",children:s.map((e,t)=>{var s;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!=(s=g[e.loop])?s:"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 f=s(45609),b=s.n(f),v=s(86542);let j={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:"대기"}},y={cron:"크론",task:"태스크",action:"자율행동"};function N(e){var t;let{counts:s,total:a}=e,n=Object.entries(null!=s?s:{}).filter(e=>{let[,t]=e;return t>0});if(!a||0===a)return(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"태스크 0"});let l=null!=(t=null==s?void 0:s.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:["태스크 ",l,"/",a]}),n.map(e=>{let[t,s]=e;return(0,r.jsxs)("span",{className:"text-[11px] text-muted-foreground",children:[t,":",s]},t)})]})}function k(e){let{r:t}=e;if(!t||0===t.total)return(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"파생 0"});let s=(e,t)=>e>0?(0,r.jsxs)("span",{className:["text-xs",j[t].tone].join(" "),children:[j[t].icon,e]},t):null;return(0,r.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:["파생 ",t.total]}),s(t.ok,"ok"),s(t.stale,"stale"),s(t.error,"error"),s(t.active,"active"),s(t.pending,"pending")]})}function w(e){let{api:t,m:s,onDone:n}=e,i="scheduler"===s.model,o="task"===s.model,[d,c]=(0,a.useState)(""),[u,x]=(0,a.useState)(""),[m,p]=(0,a.useState)(""),[g,h]=(0,a.useState)(null),[f,b]=(0,a.useState)(null);if(!i&&!o)return(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["이 실행모델(",s.model,")은 지속 잡을 만들지 않아 구체화 대상이 아닙니다."]});let v=async e=>{h(e),b(null);let r=i?{command:d.trim(),...u.trim()?{cron:u.trim()}:{}}:{...m.trim()?{prompt:m.trim()}:{}};try{let l=await t.missionAction(s.id,e,r);if(l.error)b("오류: ".concat(l.error));else{var a;b("arm"===e?"승인\xb7arming ON 시 자동 실행":"구체화 완료(".concat(null!=(a=l.engine)?a:"",")")),n()}}catch(e){b(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:[i&&(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=>x(e.target.value),placeholder:"cron (선택 \xb7 비우면 골에서 추론)",className:"w-full rounded border border-border bg-background px-2 py-1 font-mono text-xs"})]}),o&&(0,r.jsx)("input",{value:m,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)(l.$,{size:"sm",disabled:!!g||i&&!d.trim(),onClick:()=>void v("materialize"),children:"materialize"===g?"…":"지금 구체화"}),(0,r.jsx)(l.$,{size:"sm",variant:"outline",disabled:!!g||i&&!d.trim(),onClick:()=>void v("arm"),children:"arm"===g?"…":"승인(arm)"}),f&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:f})]})]})}function S(e){let{api:t,m:s}=e,n=!1===s.isAutopilot,[i,o]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),[u,x]=(0,a.useState)(!1),m=s.model?v.NE[s.model]:null,p=(0,a.useCallback)(async()=>{x(!0);try{c(await t.trace(s.id))}catch(e){}finally{x(!1)}},[t,s.id]),[g,h]=(0,a.useState)(!1),[f,S]=(0,a.useState)(!1),[C,z]=(0,a.useState)(null),M=!n&&"proposed"===s.status,E=(0,a.useCallback)(async()=>{let e=!i;o(e),!e||d||n||await p()},[i,d,p,n]),A=(0,a.useCallback)(async()=>{h(!0),z(null);try{await t.missionAction(s.id,"cancel"),await p()}catch(e){}finally{h(!1)}},[t,s.id,p]),J=(0,a.useCallback)(async()=>{S(!0),z(null);try{var e;let r=await t.missionAction(s.id,"approve");r.error?z("오류: ".concat(r.error)):z("✅ 승인 — 태스크 ".concat(null!=(e=r.activated)?e:0,"건 실행 시작(ready). 미션 running.")),await p()}catch(e){z(e instanceof Error?e.message:String(e))}finally{S(!1)}},[t,s.id,p]);return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-card/50",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>void E(),className:"flex w-full items-start gap-3 p-3 text-left",children:[(0,r.jsx)("span",{className:"mt-0.5 text-muted-foreground",children:i?"▾":"▸"}),(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:[n?(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"}):m&&(0,r.jsx)("span",{className:["rounded px-2 py-0.5 text-xs font-medium ring-1",m.tone].join(" "),children:m.label}),!n&&"continuous"===s.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:"상시"}),!n&&"finite"===s.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:s.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:s.status}),s.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일+ 리뷰"}),n?(0,r.jsx)(N,{counts:s.taskCounts,total:s.taskCount}):(0,r.jsx)(k,{r:s.derived})]}),(0,r.jsx)("p",{className:"truncate text-sm text-foreground/90",children:s.goal}),(0,r.jsx)("p",{className:"font-mono text-[10px] text-muted-foreground",children:s.id})]})]}),i&&n&&(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)(N,{counts:s.taskCounts,total:s.taskCount}),(0,r.jsx)(b(),{href:"/tasks",className:"inline-block text-xs text-primary hover:underline",children:"② 작업 보드에서 보기 →"})]}),i&&!n&&(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"===s.model&&" 반복 스케줄은 승인 후 배선됩니다."]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.$,{size:"sm",disabled:f||g,onClick:()=>void J(),children:f?"승인 중…":"✅ 승인(실행 시작)"}),(0,r.jsx)(l.$,{size:"sm",variant:"ghost",disabled:f||g,onClick:()=>void A(),className:"text-rose-400 hover:text-rose-300",children:g?"거절 중…":"거절"}),C&&(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:C})]})]}),u&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:"계보 조회 중…"}),d&&0===d.derived.length&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:d.note}),d&&(0,v.on)(d.derived)&&(0,r.jsxs)(b(),{href:(0,v.on)(d.derived),className:"mb-2 inline-block text-xs text-primary hover:underline","data-mission-schedules":!0,children:["이 미션을 부르는 스케줄 ",d.derived.filter(e=>"cron"===e.kind&&e.id).length," →"]}),d&&d.derived.length>0&&(0,r.jsx)("ul",{className:"space-y-1.5",children:d.derived.map((e,t)=>{let s=j[e.status];return(0,r.jsxs)("li",{className:"flex items-start gap-2 text-sm",children:[(0,r.jsx)("span",{className:s.tone,children:s.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:y[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)})}),d&&"done"!==s.status&&"proposed"!==s.status&&(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,r.jsx)(l.$,{size:"sm",variant:"ghost",disabled:g,onClick:()=>void A(),className:"text-rose-400 hover:text-rose-300",children:g?"종료 중…":"미션 종료(파생 잡 release)"}),"continuous"===s.kind&&(0,r.jsx)("span",{className:"text-[11px] text-muted-foreground",children:"상시 미션 — 종료 전까지 계속 실행"})]}),d&&!M&&(0,r.jsx)(w,{api:t,m:s,onDone:()=>void p()})]})]})}function C(e){let{api:t,onCommitted:s}=e,[n,i]=(0,a.useState)(""),[o,d]=(0,a.useState)(null),[c,u]=(0,a.useState)(!1),[x,m]=(0,a.useState)(!1),[p,g]=(0,a.useState)(null),h=(0,a.useCallback)(async()=>{let e=n.trim();if(e){u(!0),g(null);try{d((await t.triagePreview(e)).triage)}catch(e){g(e instanceof Error?e.message:String(e))}finally{u(!1)}}},[t,n]),f=(0,a.useCallback)(async()=>{let e=n.trim();if(e){m(!0),g(null);try{(await t.commitMission(e,"intake")).missionId?(i(""),d(null),s()):g("미션 생성 실패")}catch(e){g(e instanceof Error?e.message:String(e))}finally{m(!1)}}},[t,n,s]),b=o?v.NE[o.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:n,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&h()},placeholder:"예: 삼성전자 급락하면 매매 검토 / 이 주제 끝까지 파봐 / 매일 아침 반도체 뉴스 정리",className:"min-h-[60px] w-full resize-y rounded-md border border-border bg-background px-3 py-2 text-sm"}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,r.jsx)(l.$,{onClick:()=>void h(),disabled:c||!n.trim(),size:"sm",variant:"outline",children:c?"분류 중…":"Triage (⌘↵)"}),(0,r.jsx)(l.$,{onClick:()=>void f(),disabled:x||!n.trim(),size:"sm",children:x?"커밋 중…":"미션 커밋 →"}),o&&b&&(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",b.tone].join(" "),children:b.label}),(0,r.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 text-muted-foreground ring-1 ring-border",children:"heavy"===o.tier?"무거움":"가벼움"}),(0,r.jsx)("span",{className:"text-muted-foreground",children:o.rationale})]}),p&&(0,r.jsx)("span",{className:"text-xs text-rose-400",children:p})]})]})}function z(e){var t,s;let{api:n}=e,[i,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(null),[u,x]=(0,a.useState)(!1),m=(0,a.useCallback)(async()=>{x(!0),c(null);try{let e=[...(await n.missionsUnified()).missions].sort((e,t)=>e.createdAt<t.createdAt?1:-1);o(e)}catch(e){c(e instanceof Error?e.message:String(e))}finally{x(!1)}},[n]);(0,a.useEffect)(()=>{m()},[m]);let p=null!=(t=null==i?void 0:i.filter(e=>e.isAutopilot).length)?t:0,g=(null!=(s=null==i?void 0:i.length)?s:0)-p;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실행 상태.",i&&(0,r.jsxs)("span",{className:"ml-1 text-[11px]",children:["자율 ",p," \xb7 사람 ",g]})]}),(0,r.jsx)(l.$,{onClick:()=>void m(),disabled:u,size:"sm",variant:"outline",children:u?"…":"새로고침"})]}),(0,r.jsx)(C,{api:n,onCommitted:()=>void m()}),d&&(0,r.jsx)("p",{className:"text-xs text-rose-400",children:d}),i&&0===i.length&&(0,r.jsx)("p",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"아직 미션이 없습니다. 아래 “골 던지기”로 자율 미션을 만들거나, Intake 에서 메모를 포착하세요."}),i&&i.length>0&&(0,r.jsx)("div",{className:"space-y-2",children:i.map(e=>(0,r.jsx)(S,{api:n,m:e},e.id))})]})}var M=s(5344);let E=[{id:"missions",label:"Missions"},{id:"repo",label:"Repo Watch"},{id:"autonomy",label:"자율행동"},{id:"loops",label:"루프 오케스트라"}];function A(e){var t;let{arming:s}=e;if(!s)return null;let a=(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:"자율 경계:"}),a(s.absorb,"흡수 PR초안(".concat(s.absorbBackend,")")),a(s.merge,"mandate merge"),a(s.reboot,"재부팅"),a(null!=(t=s.materialize)&&t,"자율 구체화"),(0,r.jsx)("span",{className:"text-[11px]",children:"\xb7 재부팅은 항상 HITL \xb7 기본 disarmed(fail-closed)"})]})}function J(){let{client:e}=(0,n.Q)(),t=(0,a.useMemo)(()=>new v.Yt(e),[e]),[s,l]=(0,a.useState)("missions"),[i,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{let e=!0;return t.arming().then(t=>{e&&o(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)(M.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)(A,{arming:i})]}),(0,r.jsx)("div",{className:"flex gap-1 border-b border-border",children:E.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>l(e.id),className:["-mb-px border-b-2 px-4 py-2 text-sm font-medium transition-colors",s===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"===s&&(0,r.jsx)(z,{api:t}),"repo"===s&&(0,r.jsx)(m,{api:t}),"autonomy"===s&&(0,r.jsx)(h,{api:t}),"loops"===s&&(0,r.jsx)(x,{})]})]})}function O(){return(0,r.jsx)(J,{})}},43771:(e,t,s)=>{Promise.resolve().then(s.bind(s,30968))},72030:(e,t,s)=>{"use strict";s.d(t,{$:()=>o});var r=s(41121),a=s(72524),n=s(49155),l=s(82157);let i=(0,n.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:s="default",size:n="default",...o}=e;return(0,r.jsx)(a.$,{"data-slot":"button",className:(0,l.cn)(i({variant:s,size:n,className:t})),...o})}},82157:(e,t,s)=>{"use strict";s.d(t,{cn:()=>n});var r=s(3511),a=s(97043);function n(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,a.QP)((0,r.$)(t))}},86542:(e,t,s)=>{"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}s.d(t,{NE:()=>o,Yt:()=>i,on:()=>r});let a=["task","goal-loop","single-shot"],n=["scheduler","monitor-trigger"];function l(e){var t,s,r,l,i,o,d;let c=e.autopilot,u=null!=(t=null==c?void 0:c.executionModel)?t:null;return{id:e.id,goal:e.title||e.description||e.id,source:null!=(s=null==c?void 0:c.origin)?s:"human",status:null!=(r=null==c?void 0:c.apmStatus)?r:e.status,model:u,tier:null!=(l=null==c?void 0:c.tier)?l:null,engine:null!=(i=null==c?void 0:c.engine)?i:null,kind:(d=null!=(o=null==c?void 0:c.executionModel)?o:null)&&a.includes(d)?"finite":d&&n.includes(d)?"continuous":"other",reviewDue:!1,createdAt:new Date(e.createdAt).toISOString(),isAutopilot:null!=c,toxStatus:e.status,taskCount:e.taskCount,taskCounts:e.taskStatusCounts}}class i{async triagePreview(e,t){return this.client.fetchJson("/v1/autopilot/triage-preview",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({goal:e,...t?{category:t}:{}})})}async commitMission(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"intake",s=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,...s?{category:s}:{}})})}async missions(e,t){let s=new URLSearchParams({...e?{status:e}:{},...t?{source:t}:{}}).toString();return this.client.fetchJson("/v1/autopilot/missions".concat(s?"?".concat(s):""))}async missionsUnified(e){var t,s;let r=new URLSearchParams({...e?{status:e}:{}}).toString(),a=await this.client.fetchJson("/v1/missions".concat(r?"?".concat(r):"")),n=null!=(t=a.missions)?t:[];return{ok:!0,total:null!=(s=a.total)?s:n.length,missions:n.map(l)}}async trace(e){return this.client.fetchJson("/v1/autopilot/trace?id=".concat(encodeURIComponent(e)))}async missionArcMap(){var e,t,s;let r=await this.client.fetchJson("/v1/missions"),a=new Map;for(let n of null!=(e=r.missions)?e:[]){let e=null==(t=n.autopilot)?void 0:t.arcs;e&&e.length>0&&a.set(n.id,{apmStatus:null==(s=n.autopilot)?void 0:s.apmStatus,arcs:e})}return a}async missionAction(e,t){let s=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,...s})})}async repoWatch(){return this.client.fetchJson("/v1/autopilot/repo-watch")}async autonomy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=arguments.length>1?arguments[1]:void 0,s=new URLSearchParams({limit:String(e),...t?{loop:t}:{}});return this.client.fetchJson("/v1/autopilot/autonomy?".concat(s.toString()))}async arming(){return this.client.fetchJson("/v1/autopilot/arming")}constructor(e){this.client=e}}let o={task:{label:"작업 분해",tone:"bg-sky-500/15 text-sky-200 ring-sky-500/30"},"goal-loop":{label:"목표 루프",tone:"bg-violet-500/15 text-violet-200 ring-violet-500/30"},scheduler:{label:"스케줄러",tone:"bg-emerald-500/15 text-emerald-200 ring-emerald-500/30"},"monitor-trigger":{label:"감시 트리거",tone:"bg-amber-500/15 text-amber-200 ring-amber-500/30"},hybrid:{label:"하이브리드",tone:"bg-fuchsia-500/15 text-fuchsia-200 ring-fuchsia-500/30"},fanout:{label:"병렬 팬아웃",tone:"bg-cyan-500/15 text-cyan-200 ring-cyan-500/30"},"single-shot":{label:"즉답",tone:"bg-muted text-muted-foreground ring-border"},"hitl-delegate":{label:"HITL 위임",tone:"bg-rose-500/15 text-rose-200 ring-rose-500/30"}}}},e=>{e.O(0,[2977,216,6062,7990,8519,2367,6725,7358],()=>e(e.s=43771)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7081],{19528:(e,t,a)=>{"use strict";a.d(t,{Er:()=>r,cj:()=>c,dc:()=>l,yR:()=>o});let n=/^(oauth\.|harness\.decision|llm\.router)/;function r(e){let t=[],a=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"])a(e[t]);if(Array.isArray(e.usage))for(let t of e.usage)a(null==t?void 0:t.name);continue}if(n.test(t.category))for(let t of(a(e.account),["what","why","reason"])){let n=e[t];if("string"==typeof n)for(let e of n.matchAll(/계정\s+([A-Za-z0-9][\w.-]*)/g))a(e[1])}}return t}function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function l(e){let t=new Map(e.map((e,t)=>[e,"account-".concat(t+1)])),a=e.length?RegExp("(^|[^\\w-])(".concat(e.map(s).sort((e,t)=>t.length-e.length).join("|"),")(?![\\w-])"),"g"):null,n=new Map;return(e,r)=>{let s=e.replace(/\b[a-z0-9-]+\.tail[0-9a-f]+\.ts\.net\b/gi,"tailnet-host").replace(/\bmsb\d+\b/gi,e=>(e=>{let t=e.toLowerCase();n.has(t)||n.set(t,"remote-".concat(n.size+1));let a=n.get(t);return e===e.toUpperCase()?a.toUpperCase():a})(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&&a&&(s=s.replace(a,(e,a,n)=>{var r;return"".concat(a).concat(null!=(r=t.get(n))?r:"account")})),s}}function i(e,t){if("string"==typeof e)return t(e);if(Array.isArray(e))return e.map(e=>i(e,t));if(e&&"object"==typeof e){let a={};for(let[n,r]of Object.entries(e))"apiEquivalentUsd"===n||"usd"===n||/credit(s|Balance)?$/i.test(n)||(a[n]=i(r,t));return a}return e}function o(e){let t=l(r(e));return e.map(e=>{let a=n.test(e.category);return{...e,event:t(e.event,!1),data:e.data?i(e.data,e=>t(e,a)):e.data}})}function c(e,t){let a=l(t);return i(e,e=>a(e,!0))}},35258:(e,t,a)=>{Promise.resolve().then(a.bind(a,80191))},80191:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>y});var n=a(41121),r=a(19528),s=a(91269),l=a(38519);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 o=a(42375);let c=["intake","triage","gates","relations","memory","workspace","run","landing","release"];function d(e){return null==e?"—":"string"==typeof e?e:JSON.stringify(e)}function u(e){let{entry:t}=e;return(0,n.jsxs)("details",{className:"mt-2 text-xs",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"JSON"}),(0,n.jsx)("pre",{className:"mt-2 max-h-64 overflow-auto rounded-lg bg-muted p-2 text-xs whitespace-pre-wrap break-all",children:JSON.stringify(t.data,null,2)})]})}function m(e){let{entry:t}=e,a=new Date(t.ts).toISOString();return(0,n.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,n.jsxs)("span",{children:["Owner: ",t.owner]}),(0,n.jsx)("time",{dateTime:a,children:a})]})}function f(e){var t;let{card:a}=e,r=null==(t=a.sections.gates)?void 0:t.data;return(0,n.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,n.jsxs)("header",{children:[(0,n.jsx)("h2",{className:"text-lg font-semibold",children:i(a)}),(0,n.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:a.taskId})]}),r&&(0,n.jsxs)("p",{className:"overflow-x-auto whitespace-nowrap text-sm","aria-label":"Gate decisions",children:["Gate \xb7 budget: ",d(r.budget)," \xb7 location: ",d(r.location)]}),c.map(e=>{let t=a.sections[e];return t?(0,n.jsxs)("section",{"aria-label":"".concat(e," section"),className:"rounded-xl border border-border p-3",children:[(0,n.jsx)("h3",{className:"mb-1 text-sm font-semibold capitalize",children:e}),(0,n.jsx)(m,{entry:t}),(0,n.jsx)(u,{entry:t})]},e):null}),(0,n.jsxs)("section",{"aria-label":"Incidents",className:"space-y-2",children:[(0,n.jsxs)("h3",{className:"text-sm font-semibold",children:["Incidents (",a.incidents.length,")"]}),a.incidents.length?(0,n.jsx)("ol",{className:"space-y-2",children:a.incidents.map(e=>(0,n.jsxs)("li",{className:"rounded-xl border border-border p-3",children:[(0,n.jsx)(m,{entry:e}),(0,n.jsx)(u,{entry:e})]},e.key))}):(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"No incidents."})]})]})}let p=["steward","execution","landing","release","done"],g=new Set(["intake","triage","gates","relations","memory","workspace","run","landing","release","incidents"]);function x(e){let t=[],a=Date.parse(e.createdAt);for(let n of e.sections){let r;if(!g.has(n.key))continue;try{let e=JSON.parse(n.content);r=e&&"object"==typeof e&&!Array.isArray(e)?e:{content:n.content}}catch(e){r={content:n.content}}let s=Date.parse(n.createdAt);t.push({taskId:e.id,section:n.key,key:"".concat(n.key,":").concat(n.createdAt,":").concat(t.length),owner:n.owner,ts:Number.isFinite(s)?s:a,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:a,data:{title:e.title}}),"closed"===e.status){let n=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(a,...t.map(e=>e.ts)),data:{...null==n?void 0:n.data,status:"done"}})}return{...function(e){let t,a=e[0];if(!a)return null;let n={},r=[],s=new Set,l=a.ts,i=-1/0;for(let o of e)if(!(o.taskId!==a.taskId||s.has(o.key)))if(s.add(o.key),l=Math.max(l,o.ts),o.runId&&o.ts>=i&&(t=o.runId,i=o.ts),"incidents"===o.section)r.push(o);else{let e=n[o.section];(!e||o.ts>=e.ts)&&(n[o.section]=o)}return{taskId:a.taskId,sections:n,incidents:r,updatedAt:l,...t?{runId:t}:{}}}(t),apiTitle:e.title}}function h(e){let{cards:t,selectedId:a,onSelect:r,selectedCard:s,detailError:l}=e,o=(null==s?void 0:s.taskId)===a?s:null;return(0,n.jsxs)("div",{className:"space-y-4 p-4",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold",children:"보드"}),(0,n.jsx)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:p.map(e=>(0,n.jsxs)("section",{"aria-label":"".concat(e," column"),className:"min-w-0 space-y-2 rounded-xl border border-border p-3",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold capitalize",children:e}),t.filter(t=>(function(e){var t;let a=null==(t=e.sections.release)?void 0:t.data;return(null==a?void 0:a.status)==="done"||(null==a?void 0:a.status)==="completed"?"done":a?"release":e.sections.landing?"landing":e.sections.run||e.sections.workspace||e.sections.gates||e.sections.relations||e.sections.memory?"execution":"steward"})(t)===e).map(e=>{var t,s;return(0,n.jsxs)("button",{type:"button",onClick:()=>r(e.taskId),"aria-pressed":a===e.taskId,className:"w-full rounded-lg border border-border bg-card p-3 text-left text-sm hover:bg-accent/40",children:[(0,n.jsx)("span",{className:"block font-medium",children:i(e)}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:(0,n.jsx)("time",{dateTime:new Date(e.updatedAt).toISOString(),title:new Date(e.updatedAt).toLocaleString(),children:(t=function(e){let t=new Map;for(let n of e.incidents){var a;let e=null!=(a=n.data.incidentId)?a:n.data.id,r="string"==typeof e&&e.trim()?e:n.key,s=t.get(r);(!s||n.ts>=s.ts)&&t.set(r,n)}return Array.from(t.values()).filter(e=>"closed"!==e.data.status&&"resolved"!==e.data.status).length}(e),s=Date.now(),[...t>0?["사고 ".concat(t)]:[],...e.runId?["런 ".concat(e.runId.replace(/^run-/,"").slice(0,8))]:[],function(e,t,a){let n=Math.floor((t-e)/6e4);if(!Number.isFinite(n)||n<1)return"방금";if(n<60)return"".concat(n,"분 전");if(n<1440)return"".concat(Math.floor(n/60),"시간 전");let r=new Intl.DateTimeFormat("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1,...a?{timeZone:a}:{}}).formatToParts(new Date(e)),s=e=>{var t,a;return null!=(a=null==(t=r.find(t=>t.type===e))?void 0:t.value)?a:""};return"".concat(s("month"),"/").concat(s("day")," ").concat(s("hour"),":").concat(s("minute"))}(e.updatedAt,s,void 0)]).join(" \xb7 ")})})]},e.taskId)})]},e))}),a&&(0,n.jsxs)("aside",{className:"max-w-3xl space-y-2","aria-label":"Selected card",children:[(0,n.jsx)("button",{type:"button",onClick:()=>r(null),"aria-label":"Close card detail",className:"text-sm text-muted-foreground",children:"Close"}),o?(0,n.jsx)(f,{card:o}):(0,n.jsx)("p",{role:"status",children:null!=l?l:"Loading card detail…"})]})]})}function b(){let{config:e}=(0,l.Q)(),t=(0,s.useMemo)(()=>e.baseUrl?(0,o.xX)({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}):null,[e.baseUrl,e.token]),[a,i]=(0,s.useState)([]),[c,d]=(0,s.useState)(null),[u,m]=(0,s.useState)(null),[f,p]=(0,s.useState)(null),[g,b]=(0,s.useState)(null),[y,k]=(0,s.useState)(!1);(0,s.useEffect)(()=>{"public"===new URLSearchParams(window.location.search).get("capture")&&k(!0)},[]);let j=(0,s.useMemo)(()=>y?a.map(e=>({...(0,r.cj)(e,[]),taskId:e.taskId})):a,[a,y]);return(0,s.useEffect)(()=>{let e=!1;if(i([]),d(null),m(null),p(null),!t)return void b("Connect to NEXUS to load task cards.");b(null);let a=()=>t.getTaskCards().then(t=>{let{cards:a}=t;e||(i(a.map(x)),b(null))}).catch(t=>{e||b(t instanceof o.Iu&&404===t.status?"Task cards are not available yet (pre-E1).":t instanceof Error?t.message:String(t))});a();let n=setInterval(()=>{a()},1e4);return()=>{e=!0,clearInterval(n)}},[t]),(0,s.useEffect)(()=>{if(!t||!c)return;let e=!1;return m(null),p(null),t.getTaskCard(c).then(t=>{let{card:a}=t;e||m(x(a))}).catch(t=>{e||p(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[t,c]),(0,n.jsxs)(n.Fragment,{children:[g&&(0,n.jsx)("p",{role:"status",className:"p-4 text-sm text-muted-foreground",children:g}),(0,n.jsx)(h,{cards:j,selectedId:c,selectedCard:u,detailError:f,onSelect:e=>{(null===e||c!==e)&&(m(null),p(null),d(e))}})]})}function y(){return(0,n.jsx)(b,{})}}},e=>{e.O(0,[8519,2375,2367,6725,7358],()=>e(e.s=35258)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{51618:(e,t,s)=>{Promise.resolve().then(s.bind(s,74715))},74715:(e,t,s)=>{"use strict";s.d(t,{BotlabPageContent:()=>h});var r,l=s(41121),a=s(91269);let o=(null!=(r=s(11518).env.NEXT_PUBLIC_ELANOUS_BOTLAB_HOST)?r:"").trim(),n="elanous.botlab.wallHost",d=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;function i(e){return e.length>0&&e.length<=253&&d.test(e)}function c(e){var t;let{search:s,remembered:r=null}=e,d=(0,a.useMemo)(()=>(function(e){var t,s;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=null;try{l=new URLSearchParams(e).get("host")}catch(e){l=null}let a=null!=(t=null==l?void 0:l.trim())?t:"";if(""!==a&&i(a))return{host:a,source:"query",rejected:null};let n=""===a?null:a,d=null!=(s=null==r?void 0:r.trim())?s:"";return""!==d&&i(d)?{host:d,source:"remembered",rejected:n}:""!==o&&i(o)?{host:o,source:"default",rejected:n}:{host:"",source:"unset",rejected:n}})(s,r),[s,r]),c="unset"===d.source?null:(t=d.host,"https://".concat(t).concat("/bot3/bot-wall.html"));return(0,a.useEffect)(()=>{if("query"===d.source)try{window.localStorage.setItem(n,d.host)}catch(e){}},[d.source,d.host]),(0,l.jsxs)("main",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-10 sm:px-10","data-testid":"botlab-panel",children:[(0,l.jsxs)("header",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Bot screens"}),(0,l.jsx)("h1",{className:"mt-2 text-3xl font-bold",children:"Botlab"}),(0,l.jsxs)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:["Live noVNC screens for the bots, served through Tailscale. One document holds all four sessions, so the VNC password is asked ",(0,l.jsx)("strong",{children:"once"}),", not four times."]}),(0,l.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"View-only by default. This surface cannot send commands or control the bots."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-4","aria-label":"Wall address",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Wall address"}),(0,l.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground","data-testid":"botlab-wall-url",children:null!=c?c:"(no host configured)"}),(0,l.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"botlab-host-source",children:"query"===d.source?"Host came from the ?host= query parameter (remembered on this device).":"remembered"===d.source?"Host is the one remembered on this device; override it with ?host=<tailnet-name>.":"default"===d.source?"Host is the build default (NEXT_PUBLIC_ELANOUS_BOTLAB_HOST); override it with ?host=<tailnet-name>.":"No wall host is configured. Open this page once with ?host=<the VM tailnet name> — it is remembered on this device."}),null!==d.rejected&&(0,l.jsxs)("p",{role:"alert",className:"mt-2 text-xs text-destructive","data-testid":"botlab-host-rejected",children:["Ignored ?host=",d.rejected," — not a valid hostname."]}),null!==c&&(0,l.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground",children:[(0,l.jsx)("a",{className:"underline",href:c,target:"_blank",rel:"noreferrer","data-testid":"botlab-open-tab",children:"Open the wall in a new tab"})," — ","use this if the embedded frame stays blank."]})]}),null!==c&&(0,l.jsx)("section",{"aria-label":"Bot screen wall",children:(0,l.jsx)("iframe",{src:c,title:"Bot screen wall","data-testid":"botlab-wall-frame",className:"h-[70vh] w-full rounded-xl border border-border bg-background"})}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5","aria-label":"If the wall is blank",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"If the wall stays blank"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"A blank frame is not necessarily a broken bot. There are three separate reasons, with different fixes:"}),(0,l.jsxs)("ol",{className:"mt-3 list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"This device is outside the tailnet."})," The address simply does not exist here. Join the tailnet, or view the screens from a device that is on it."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Tailscale serve is not published."})," Re-run"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"bash scripts/botlab/deploy-bot-wall.sh"}),", which re-publishes the paths and then verifies each one returns 200."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"The wall loaded but did not connect."})," That is a VNC-level failure, not a page failure — the wall itself reports connected/failed counts once you enter the password."]})]}),(0,l.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:"The VNC password is deliberately not carried in this page or in the URL: any page a bot browser opens could otherwise reach the local websocket, and websockets have no CORS."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-dashed border-border p-5","aria-label":"Not wired yet",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Not wired yet"}),(0,l.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:["Per-bot cell headers (name \xb7 last round verdict \xb7 whether CDP is alive) need"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"browserPort"})," and round results on the daemon's persona route. That route is owned by another track and is not published today."]}),(0,l.jsx)("li",{children:"Running a command from this surface needs a POST route that does not exist yet."})]})]})]})}function h(){let e=window.location.search,t=null;try{t=window.localStorage.getItem(n)}catch(e){t=null}return(0,l.jsx)(c,{search:e,remembered:t})}}},e=>{e.O(0,[2367,6725,7358],()=>e(e.s=51618)),_N_E=e.O()}]);
|