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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9740],{19528:(e,t,n)=>{n.d(t,{Er:()=>l,cj:()=>c,yR:()=>i});let a=/^(oauth\.|harness\.decision|llm\.router)/;function l(e){let t=[],n=e=>{"string"==typeof e&&e.trim()&&!t.includes(e.trim())&&t.push(e.trim())};for(let t of e){var l;let e=null!=(l=t.data)?l:{};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 s(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(s).sort((e,t)=>t.length-e.length).join("|"),")(?![\\w-])"),"g"):null,a=new Map;return(e,l)=>{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();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 l&&n&&(s=s.replace(n,(e,n,a)=>{var l;return"".concat(n).concat(null!=(l=t.get(a))?l:"account")})),s}}function o(e,t){if("string"==typeof e)return t(e);if(Array.isArray(e))return e.map(e=>o(e,t));if(e&&"object"==typeof e){let n={};for(let[a,l]of Object.entries(e))"apiEquivalentUsd"===a||"usd"===a||/credit(s|Balance)?$/i.test(a)||(n[a]=o(l,t));return n}return e}function i(e){let t=r(l(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 l=e=>"string"==typeof e&&e.trim()?e:null,s=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=l(e.model))?r:"unknown",site:null!=(o=l(e.site))?o:"unknown",billing:l(e.billing),provider:l(e.billingProvider),input:s(e.inputTokens),output:s(e.outputTokens),cache:s(e.cacheReadInputTokens),apiUsd:s(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,l=Math.floor(t/a)*a-(n-1)*a,s=Array.from({length:n},(e,t)=>({t:l+t*a,count:0,tokens:0,byModel:{}}));for(let t of e){var r;let e=Math.floor((t.t-l)/a);if(e<0||e>=n)continue;let o=s[e];o.count+=1,o.tokens+=t.input+t.output,o.byModel[t.model]=(null!=(r=o.byModel[t.model])?r:0)+1}return s}function i(e,t,n){let a=t-n/2,l=new Map;for(let r of e){var s;if(r.t<t-n)continue;let e=null!=(s=l.get(r.model))?s:{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,l.set(r.model,e)}return[...l.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 l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:7,s=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,l).map(e=>{let[t]=e;return t}),c=[...o.entries()].sort((e,t)=>t[1]-e[1]).slice(0,s).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=l(null==(n=a.data)?void 0:n.runId),s=Date.parse(a.ts);if(!e||!Number.isFinite(s))continue;let r=t.get(e);r?(r.lo=Math.min(r.lo,s),r.hi=Math.max(r.hi,s)):t.set(e,{lo:s,hi:s})}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),l=Math.max(...e),s=(l-a)/t||1;for(let l of e)n[Math.min(t-1,Math.floor((l-a)/s))]+=1;return{bins:n,lo:a,hi:l,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 l of e){let e=(0,a.dl)(l);"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=l(e.pr))?r:s(e.prNumber)?String(s(e.prNumber)):null;i&&(("rework-start"===o.event||"judge-verdict"===o.event&&s(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=l(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=l(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&&s(null==(r=i.data)?void 0:r.stepCount)>1){let e=Math.min(12,s(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=l(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=l(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,s(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 s of e){var n;let e=l(null==(n=s.data)?void 0:n.runId);if(!e)continue;let{stage:r,tone:o}=(0,a.dl)(s),i="".concat(e,"|").concat(s.category,".").concat(s.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:s.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 l={debug:0,info:1,warn:2,error:3},s="/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(!(l[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)]<l[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)}null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},100))}}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,l;t=await (a=this.fetchFn(n),l=this.postTimeoutMs,new Promise((e,t)=>{let n=setTimeout(()=>t(Error("debug-forward timeout after ".concat(l,"ms"))),l);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 s=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:s},source:{platform:"pwa"}})),this.queue.length>0&&null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},100))}scheduleRetry(){if(null!==this.timer||0===this.queue.length)return;let e=Math.min(100*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(s,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",n=1e4){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=n,this.queue=[],this.timer=null,this.inFlight=!1,this.consecutiveFailures=0,this.lastOkAt=null,this.droppedByCap=0,this.fallbackBatches=0,this.wasFailing=!1}}async function c(e){return(await fetch(s,{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 l,s=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);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return a=t,t}();if(!s)return;let r=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==n&&""!==n)try{l=JSON.parse(n)}catch(e){l=n}s.push({ts:e,category:t,event:r,...void 0!==l?{data:l}:{},source:{platform:"pwa"}})}},54061:(e,t,n)=>{n.d(t,{HI:()=>r});var a=n(91269),l=n(42012),s=n(91514);function r(e){var t,n,r;let o=(0,s.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,l.I)(i("goal-author,harness.frontdoor,harness.substrate,harness.boundary,harness.role-llm,dev-pipeline,self-dev,self-gate,review-loop",1500)),d=(0,l.I)(i("llm.usage",2e3)),u=(0,l.I)(i("harness.decision,oauth.codex-account,harness.boundary",300)),p=(0,l.I)(i("research",300)),h=(0,a.useMemo)(()=>{var e,t,n,a,l,s,r,o;return[...null!=(l=null==(e=c.data)?void 0:e.logs)?l:[],...null!=(s=null==(t=d.data)?void 0:t.logs)?s:[],...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 l,s;for(let e of null!=(l=null==r?void 0:r.stores)?l:[])t.add(e);for(let e of null!=(s=null==r?void 0:r.failedStores)?s:[])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,l.I)({queryKey:["live","runs"],queryFn:()=>o.getHarnessRuns(),refetchInterval:6e4}),instances:(0,l.I)({queryKey:["live","instances"],queryFn:()=>o.getLogInstances(),staleTime:6e4})}}},68550:(e,t,n)=>{n.d(t,{RT:()=>h});var a=n(41121),l=n(91269),s=n(45609),r=n.n(s),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:l,run:s,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":l,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:l}),(null==s?void 0:s.current)&&(0,a.jsx)("span",{className:"rounded bg-primary/15 px-1.5 py-0.5 text-[11px]",children:c.fQ[s.current]}),(null==s?void 0:s.blocked)&&(0,a.jsx)("span",{className:"rounded bg-error/15 px-1.5 py-0.5 text-[11px] text-error",children:"막힘"}),(null==s?void 0:s.pr)&&(0,a.jsxs)("span",{className:"font-mono text-[11px]",children:["PR #",s.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(l)),className:"rounded-md border px-2 py-1 text-xs hover:bg-muted","data-elanous-action":"live-run-trace",children:"Trace 로 →"}),!!(null==s?void 0:s.pr)&&"ok"!==s.stages.land&&(0,a.jsx)(r(),{href:"/approvals?pr=".concat(encodeURIComponent(s.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:s,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,l.useState)("idle"),[x,g]=(0,l.useState)(null),[v,b]=(0,l.useState)("idle");return(0,a.jsx)(p,{runId:n,run:s,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:"기억"},l=e=>null===e||"object"!=typeof e||Array.isArray(e)?null:e,s=new Set(["한도 도달","후보 없음","측정 불가: 시간 초과"]);function r(e){if("string"!=typeof e)return null;let t=e.trim();return s.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,l="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":l,s=/^(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(s)return{stage:s,tone:"land"===s&&"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:l}:n.startsWith("self-dev")&&/decompos/i.test(a)||"self-dev.orchestrate"===n&&"start"===a?{stage:"decompose",tone:l}:n.startsWith("self-dev.spawn")||n.startsWith("harness.substrate")||"self-implement"===n||"dev-pipeline"===n&&"harness.launch"===a?{stage:"build",tone:l}:n.startsWith("self-gate")||n.startsWith("self-dev.reduce")&&/gate/i.test(a)?{stage:"gate",tone:l}:n.startsWith("review-loop")&&/(merged|auto-merge)/i.test(a)?{stage:"land",tone:"ok"}:n.startsWith("review-loop")?{stage:"review",tone:l}:n.startsWith("self-dev.reduce")&&/(pr-opened|merged)/i.test(a)||"dev-pipeline"===n&&"done"===a?{stage:"land",tone:l}:{stage:null,tone:l}}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,l,s;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!=(l=u(r.from))?l:"?"," → ").concat(null!=(s=u(r.to))?s:"?"):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:{},l=["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(l?" \xb7 ".concat(l):"").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 s=function(e,t,n){var a,l,s,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!=(l=e.data)?l:{},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!=(s=u(t.model))?s: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 s=b(e);if(!s||"harness.decision"!==e.category&&k.has(s))continue;let i="harness.decision"===e.category&&"string"==typeof t.what?function(e,t){var n,s;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=l(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 l=n("provider");l&&(t.provider=l);let s=n("substrate");s&&(t.substrate=s);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=l(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 l=r(h.reasons[0]);i="".concat(a).concat(l?" \xb7 ".concat(l):"");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==(s=l(h.memory))?void 0:s.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"===s&&(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"===s&&n&&x.add(n);let D=p(t.paths)||void 0;m.push({ts:e.ts,kind:s,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=s.runs.find(t=>t.runId===e))?void 0:t.stages.land)==="ok"}).length;return{snapshot:s,gauges:{live:s.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:()=>s});var a=n(3511),l=n(97043);function s(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,l.QP)((0,a.$)(t))}},91514:(e,t,n)=>{n.d(t,{M1:()=>c,Qj:()=>d,tI:()=>i});var a=n(41121),l=n(91269),s=n(19855),r=n(24818);let o=(0,l.createContext)(null);function i(e){let{client:t,queryClient:n,defaultStaleTimeMs:i,children:c}=e,d=(0,l.useMemo)(()=>null!=n?n:new s.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,l.useContext)(o);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,l.useContext)(o)}},99482:(e,t,n)=>{n.d(t,{xl:()=>v});var a=n(41121),l=n(91269),s=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,l.useRef)(null),$=(0,l.useRef)({nodes:[],edges:[]}),G=(0,l.useRef)([]),V=(0,l.useRef)([]),z=(0,l.useRef)(null),Y=(0,l.useRef)([]),[J,K]=(0,l.useState)(null),[_,Q]=(0,l.useState)(!1),[X,Z]=(0,l.useState)(0),[ee,et]=(0,l.useState)(""),[en,ea]=(0,l.useState)(5),[el,es]=(0,l.useState)({nodes:0,edges:0}),er=(0,l.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,l.useMemo)(()=>(0,c.Gp)(P),[P]),ed=(0,l.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,l.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,l.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,l.useEffect)(()=>{ea(5)},[P]),(0,l.useEffect)(()=>{var e,t;let n=function(e){var t,n,a,l,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,l=h.get(e);if(l)return l.weight+=a,l;let s="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:s.x,y:s.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 s.lV){let l=e.stages[n];if(!l&&e.current!==n)continue;let i=o(e.runId,n),c=f(i,"phase",s.fQ[n]);c.current=e.current===n,c.tone=null!=l?l:"info",x(t,i,"bad"===l?"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,l=f("ev:".concat(e.key),"event",e.label,Math.max(1,Math.round(Math.log2(1+e.count))));e.bad&&(l.tone="bad"),x(a,l.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!=(l=p.plans)?l:[]){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 l="piece:".concat(e.runId,":").concat(n);f(l,"piece",t.length>22?"".concat(t.slice(0,21),"…"):t,1.5),x(a,l,"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,es(e=>e.nodes===n.nodes.length&&e.edges===n.edges.length?e:{nodes:n.nodes.length,edges:n.edges.length});let l=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 l of t.stream){var a;let t="".concat(l.ts,"|").concat(l.kind,"|").concat(null!=(a=l.runId)?a:"","|").concat(l.what);if(e.has(t))continue;let s=l.runId?"run:".concat(l.runId):"harness",r="SHIP"===l.kind&&l.target?"pr:".concat(l.target.replace(/^#/,"")):l.target?"target:".concat(l.target):s;n.push({key:t,kind:l.kind,from:s,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 l=e.get(n.key);!l||!g(l)||eo()||a<t.length-6?ei(n):Y.current.push({key:n.key,line:l,from:n.from,to:n.to})}),Z(e=>e+1)}z.current=new Set([...null!=(t=z.current)?t:[],...i.map(e=>e.key),...l])},[L,ed.events,ed.universes,ed.plans,ed.pods,ed.retries,ec]),(0,l.useEffect)(()=>{if(J)return;let e=Y.current.shift();if(!e){_&&Q(!1);return}K({item:e,folding:!1})},[J,X,_]),(0,l.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,l.useEffect)(()=>{er.current=_?550:1500},[_]);let ep=(0,l.useRef)(!1);(0,l.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,l.useEffect)(()=>{let e=B.current;if(!e)return;let t=e.getContext("2d");if(!t)return;let n=eo(),a=new Map,l=e=>{let t=a.get(e);if(t)return t;let n=document.createElement("canvas");n.width=64,n.height=64;let l=n.getContext("2d");if(l){let t=l.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")),l.fillStyle=t,l.fillRect(0,0,64,64)}return a.set(e,n),n},s=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,l=new Map(n.map(e=>[e.id,e])),s=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],l=n[t],r=a.x-l.x,o=a.y-l.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=s*(c(a.kind)||c(l.kind)?"request"===a.kind||"request"===l.kind?12e-6:5e-5:18e-5)/i;a.vx+=r*d,a.vy+=o*d,l.vx-=r*d,l.vy-=o*d}for(let e of a){if(e.from===e.to)continue;let t=l.get(e.from),n=l.get(e.to);if(!t||!n)continue;let a=n.x-t.x,s=n.y-t.y,r=Math.sqrt(a*a+s*s)||.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+=s/r*o,n.vx-=a/r*o,n.vy-=s/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,l=(("universe"===e.kind?.44:.3)-a)*.01;e.vx+=t/a*l,e.vy+=n/a*l}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),s=b(e.to);if(!a||!s){e.t=2;continue}e.t+=n?1:e.speed;let r=a.x+(s.x-a.x)*e.t,o=a.y+(s.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(l(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 s=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,s,0,2*Math.PI),t.stroke(),t.drawImage(l(d.SHIP),a.x-s,a.y-s,2*s,2*s)}for(let e of x.nodes){let a=b(e.id),s="phase"===e.kind,o="harness"===e.kind||s&&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/(s?9:20))*(s?.35:.12)):i,h=(s||"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(l(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(),s&&e.retries){t.globalAlpha=.75,t.strokeStyle=d.HEAL,t.lineWidth=1,t.setLineDash([3,3]);for(let l=1;l<=Math.min(4,e.retries);l+=1)t.lineDashOffset=n?0:-(r*(.4+.1*l)),t.beginPath(),t.arc(a.x,a.y,c+4+4*l,0,2*Math.PI),t.stroke();t.setLineDash([])}if(s&&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||(s=requestAnimationFrame(o))};s=requestAnimationFrame(o);let c=t=>{let n=e.getBoundingClientRect(),a=(t.clientX-n.left)/n.width,l=(t.clientY-n.top)/n.height,s=$.current.nodes.find(e=>"run"===e.kind&&.02>Math.hypot(e.x-a,e.y-l));s&&(null==D||D(s.id.replace(/^run:/,"")))};return e.addEventListener("click",c),()=>{cancelAnimationFrame(s),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,l;return(null!=(a=e.rounds[n.runId])?a:0)-(null!=(l=e.rounds[t.runId])?l: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=s.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?s.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?s.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:[s.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:s.lV.map((e,t)=>{let n=ex?ex.current===e:ed.load.busiest===e,l=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")}),l&&(0,a.jsx)("span",{style:{color:p[l]},children:"ok"===l?"✓":"bad"===l?"✗":"●"})]}),(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:s.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(el.nodes," \xb7 EDGES ").concat(el.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,s.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:l,className:s="",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(s),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:l})]})}function w(e){let{tone:t,children:n}=e,l="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:l,background:"".concat(l,"22"),boxShadow:"inset 0 0 0 1px ".concat(l,"66")},children:n})}function k(e){let{label:t,value:n,color:l}=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:l,textShadow:"0 0 14px ".concat(l,"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:l=!1,bare:s=!1}=e;return(0,a.jsx)("div",{className:"relative overflow-hidden font-mono text-[11px] ".concat(s?"":"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*(l?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,[s,r]=(0,l.useState)(t),[o,i]=(0,l.useState)(!1),c=(0,l.useRef)(t);return(0,l.useEffect)(()=>{let e=c.current;t>e&&(i(!0),setTimeout(()=>i(!1),700)),c.current=t;let n=performance.now(),a=0,l=s=>{let o=Math.min(1,(s-n)/900);r(e+(t-e)*(1-Math.pow(1-o,3))),o<1&&(a=requestAnimationFrame(l))};return a=requestAnimationFrame(l),()=>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(s)})}function S(e){let{candles:t,color:n,unit:l,className:s=""}=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(s),"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 l=120;return Object.entries(e.byModel).map(e=>{let[s,i]=e,c=i/r*114;return l-=c,(0,a.jsx)("rect",{x:t*o+1,y:l,width:Math.max(1,o-2),height:c,fill:n(s),opacity:.85},"".concat(t,"-").concat(s))})}),(0,a.jsxs)("text",{x:238,y:10,fill:"#64748b",fontSize:8,fontFamily:"monospace",textAnchor:"end",children:[r,l]})]})}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 l;let s=null!=(l=t.cells["".concat(e,"|").concat(n)])?l:0,r=0===s?0:Math.min(5,Math.ceil(s/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:s||"\xb7"},n)})]},e))})]})}function I(e){let{hist:t,label:n}=e,l=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 s=t.max?e/t.max*86:0;return(0,a.jsx)("rect",{x:n*l+.5,y:90-s,width:Math.max(1,l-1),height:s,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:l}=e,s=[{name:"GATE ✓",count:t,c:d.SHIP},{name:"GATE ✗",count:n,c:d.ESCALATE},...l.slice(0,3).map(e=>({name:e.name.toUpperCase(),count:e.count,c:d.VERIFY}))],r=Math.max(1,...s.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:s.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:l,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:+!l,transform:"translateX(-50%) scale(".concat(l?.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,s.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,s.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:l=!1,accent:s}=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:l?"line-clamp-3 font-medium text-slate-100":"line-clamp-3 text-slate-300",style:s&&n?{color:s}: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))),l=Math.max(3,...t.flatMap(e=>e.points.map(e=>e.round))),s=e=>20+(e-1)/Math.max(1,l-1)*146,r=e=>84-e/n*72,o=Array.from({length:l},(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:s(e),y1:12,x2:s(e),y2:84,stroke:"#1e293b",strokeDasharray:"2 3"}),(0,a.jsxs)("text",{x:s(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),l=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:l,strokeWidth:1.6,points:e.points.map(e=>"".concat(s(e.round),",").concat(r(e.asks))).join(" ")}),e.points.map(e=>(0,a.jsx)("circle",{cx:s(e.round),cy:r(e.asks),r:2.5,fill:l},e.round)),(0,a.jsxs)("text",{x:s(n.round)+4,y:r(n.asks)-3,fill:l,fontSize:8,fontFamily:"monospace",children:["#",e.pr," ",n.asks]})]},e.pr)})]})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9804],{330:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("messages-square",[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]])},6015:(t,e,s)=>{"use strict";s.d(e,{n:()=>o});var r=s(91269),i=s(95817),a=s(83026),u=s(37963),n=s(98883),h=class extends u.Q{#t;#e=void 0;#s;#r;constructor(t,e){super(),this.#t=t,this.setOptions(e),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){let e=this.options;this.options=this.#t.defaultMutationOptions(t),(0,n.f8)(this.options,e)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&(0,n.EN)(e.mutationKey)!==(0,n.EN)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#a(t)}getCurrentResult(){return this.#e}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#i(),this.#a()}mutate(t,e){return this.#r=e,this.#s?.removeObserver(this),this.#s=this.#t.getMutationCache().build(this.#t,this.options),this.#s.addObserver(this),this.#s.execute(t)}#i(){let t=this.#s?.state??(0,i.$)();this.#e={...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset}}#a(t){a.jG.batch(()=>{if(this.#r&&this.hasListeners()){let e=this.#e.variables,s=this.#e.context,r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#r.onSuccess?.(t.data,e,s,r)}catch(t){Promise.reject(t)}try{this.#r.onSettled?.(t.data,null,e,s,r)}catch(t){Promise.reject(t)}}else if(t?.type==="error"){try{this.#r.onError?.(t.error,e,s,r)}catch(t){Promise.reject(t)}try{this.#r.onSettled?.(void 0,t.error,e,s,r)}catch(t){Promise.reject(t)}}}this.listeners.forEach(t=>{t(this.#e)})})}},c=s(24818);function o(t,e){let s=(0,c.jE)(e),[i]=r.useState(()=>new h(s,t));r.useEffect(()=>{i.setOptions(t)},[i,t]);let u=r.useSyncExternalStore(r.useCallback(t=>i.subscribe(a.jG.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=r.useCallback((t,e)=>{i.mutate(t,e).catch(n.lQ)},[i]);if(u.error&&(0,n.GU)(i.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:o,mutateAsync:u.mutate}}},9050:(t,e,s)=>{"use strict";var r=s(65390);s.o(r,"useParams")&&s.d(e,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(e,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(e,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(e,{useSearchParams:function(){return r.useSearchParams}})},19696:t=>{t.exports={style:{fontFamily:"'Geist', 'Geist Fallback'",fontStyle:"normal"},className:"__className_45c93f",variable:"__variable_45c93f"}},24721:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]])},29565:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]])},30422:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]])},30448:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},31014:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},34419:(t,e,s)=>{"use strict";s.d(e,{B:()=>c});var r=s(91269),i=s(76787),a=s(41121);let u=r.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new i.E,currentIdRef:{current:null},currentContextRef:{current:null}});function n(t){let{children:e,delay:s,timeoutMs:n=0}=t,h=r.useRef(s),c=r.useRef(s),o=r.useRef(null),d=r.useRef(null),l=(0,i.Z)();return(0,a.jsx)(u.Provider,{value:r.useMemo(()=>({hasProvider:!0,delayRef:h,initialDelayRef:c,currentIdRef:o,timeoutMs:n,currentContextRef:d,timeout:l}),[n,l]),children:e})}let h=r.createContext(void 0),c=function(t){let{delay:e,closeDelay:s,timeout:i=400}=t,u=r.useMemo(()=>({delay:e,closeDelay:s}),[e,s]),c=r.useMemo(()=>({open:e,close:s}),[e,s]);return(0,a.jsx)(h.Provider,{value:u,children:(0,a.jsx)(n,{delay:c,timeoutMs:i,children:t.children})})}},40148:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},44011:(t,e,s)=>{"use strict";s.d(e,{j:()=>a});var r=s(91269);let i={};function a(t,e){let s=r.useRef(i);return s.current===i&&(s.current=t(e)),s}},50635:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("clipboard-list",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]])},50940:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},68958:(t,e,s)=>{"use strict";s.d(e,{y:()=>a});var r=s(91269);let i=[];function a(t){r.useEffect(t,i)}},69935:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("share",[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]])},72754:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},73334:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},76787:(t,e,s)=>{"use strict";s.d(e,{E:()=>a,Z:()=>u});var r=s(44011),i=s(68958);class a{static create(){return new a}start(t,e){this.clear(),this.currentId=setTimeout(()=>{this.currentId=0,e()},t)}isStarted(){return 0!==this.currentId}constructor(){this.currentId=0,this.clear=()=>{0!==this.currentId&&(clearTimeout(this.currentId),this.currentId=0)},this.disposeEffect=()=>this.clear}}function u(){let t=(0,r.j)(a.create).current;return(0,i.y)(t.disposeEffect),t}},78316:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]])},82823:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]])},85576:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},86715:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]])},91968:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("octagon-x",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},93981:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},95515:(t,e,s)=>{"use strict";s.d(e,{A:()=>r});let r=(0,s(89117).A)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},99993:(t,e,s)=>{"use strict";s.d(e,{D:()=>u});var r=s(91269),i=r.createContext(void 0),a={setTheme:t=>{},themes:[]},u=()=>{var t;return null!=(t=r.useContext(i))?t:a}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6605],{1812:(e,t,a)=>{Promise.resolve().then(a.bind(a,98012))},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:()=>n,tV:()=>l});var r=a(94387);class s extends Error{constructor(e,t,a){super(a||t),this.status=e,this.error=t,this.reason=a,this.name="MergeApprovalsApiError"}}function n(e,t){return e instanceof s?401===e.status||"unauthorized"===e.error?{text:"이 기기에 소유자 토큰이 없어 승인 목록을 못 읽었습니다 — 이미 연결된 기기의 설정 › Connect token 에서 토큰을 만들어, 이 기기의 설정 › Daemon › Bearer token 칸에 붙이면 바로 보입니다.",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 n=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 n("".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 s(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})})}}},89117:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var r=a(91269);let s=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()},n=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,n,c;let{color:i,size:d,strokeWidth:u,absoluteStrokeWidth:m,className:p="",children:h,iconNode:b,...x}=e,{size:f=24,strokeWidth:g=2,absoluteStrokeWidth:N=!1,color:j="currentColor",className:y=""}=null!=(a=(0,r.useContext)(o))?a:{},v=(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!=(n=null!=d?d:f)?n:l.width,height:null!=(c=null!=d?d:f)?c:l.height,stroke:null!=i?i:j,strokeWidth:v,className:s("lucide",y,p),...!h&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(x)&&{"aria-hidden":"true"},...x},[...b.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:s("lucide-".concat(n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),o),...i})});return a.displayName=n(e),a}},94387:(e,t,a)=>{"use strict";a.d(t,{GM:()=>o,J3:()=>l,WF:()=>r,bR:()=>n,m:()=>c,r5:()=>s});let r="/v1/devices",s="/v1/approvals/merges",n="/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:()=>C});var r=a(41121),s=a(91269),n=a(71946),l=a(38317),o=a(38519),c=a(53220);function i(e,t){return"UNKNOWN"===t&&e<3?3e3:null}async function d(e,t){let a,r=0,s=i(0,"UNKNOWN");for(;null!==s;){var n,l,o;if(await t.sleep(s),t.isActive&&!t.isActive())break;r++;try{a=await e(),null==(l=t.onDetail)||l.call(t,a)}catch(e){}null==(n=t.onAttempt)||n.call(t),s=i(r,null!=(o=null==a?void 0:a.mergeable)?o:"UNKNOWN")}return{attempts:r,...a?{last:a}:{}}}var u=a(50940);function m(e){let{view:t,target:a}=e,[n]=(0,s.useState)(()=>Date.now()),[l,o]=(0,s.useState)(n);(0,s.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 에서 승인해 머지된 PR 을 읽고 있습니다":a?"GitHub 에서 승인 대기 PR 과 #".concat(a," 카드를 읽고 있습니다"):"GitHub 에서 승인 대기 PR 을 읽고 있습니다",clock:r,hint:e>=8e3?"평소(2~5초)보다 오래 걸립니다 — GitHub 응답을 기다리는 중이며 멈추지 않았습니다.":null}}(l-n,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)(u.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 p(e){let{view:t,onChange:a}=e,s=(e,s)=>(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:s});return(0,r.jsxs)("div",{role:"tablist","aria-label":"승인 목록 보기",className:"flex gap-2",children:[s("open","승인 대기"),s("merged","완료")]})}function h(e){let{brief:t,lineage:a,summary:s}=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)(n.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:s})]}),a&&(0,r.jsxs)("p",{className:"mt-3 text-sm text-muted-foreground",children:["아이디어 원장: ",a]})]})}function b(e){var t;let{gate:a,busy:s,blocked:n,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:s,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:s,className:"mt-2 rounded-lg border px-3 py-2 disabled:opacity-50",children:"머지 전 검사 다시 시작"})]}),(0,r.jsx)("button",{type:"button",onClick:c,disabled:s||n||"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 x(e){let{card:t,api:a,attempt:r,onAttempt:n,onUpdate:l}=e,o="UNKNOWN"===t.mergeable&&!t.merged&&"OPEN"===t.state;return(0,s.useEffect)(()=>{if(!o||r>0)return;let e=!0,s=[];return d(()=>a.get(t.number),{sleep:e=>new Promise(t=>{s.push(window.setTimeout(t,e))}),isActive:()=>e,onDetail:a=>{e&&l(a,t.headSha)},onAttempt:()=>{e&&n(t.number)}}),()=>{for(let t of(e=!1,s))window.clearTimeout(t)}},[a,t.number,o,r,n,l]),null}function f(){let{client:e}=(0,o.Q)(),t=(0,s.useMemo)(()=>(0,c.tV)({client:e}),[e]),[a,n]=(0,s.useState)([]),[l,d]=(0,s.useState)(!0),[u,f]=(0,s.useState)(null),[g,N]=(0,s.useState)(null),[j,y]=(0,s.useState)({}),[v,w]=(0,s.useState)({}),[k,C]=(0,s.useState)(null),[S,I]=(0,s.useState)("open"),R=(0,s.useCallback)(e=>{w(t=>{var a;return{...t,[e]:(null!=(a=t[e])?a:0)+1}})},[]),E=(0,s.useCallback)((e,t)=>{n(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 U(e){N(e.number),y(t=>({...t,[e.number]:""}));try{let{gate:a}=await t.check(e.number,e.headSha);n(t=>t.map(t=>t.number===e.number&&t.headSha===e.headSha?{...t,gate:a}:t))}catch(t){y(a=>({...a,[e.number]:(0,c.V5)(t,"검사를 시작하지 못했습니다.").text}))}finally{N(null)}}async function O(e){if(window.confirm("#".concat(e.number," ").concat(e.title,"\n현재 확인한 변경을 승인하고 머지할까요?"))){N(e.number),y(t=>({...t,[e.number]:""}));try{await t.merge(e.number,e.headSha),n(t=>t.map(t=>t.number===e.number?{...t,merged:!0,state:"MERGED"}:t))}catch(t){y(a=>({...a,[e.number]:(0,c.V5)(t,"머지하지 못했습니다.").text}))}finally{N(null)}}}return(0,s.useEffect)(()=>{let e=a.filter(e=>"OPEN"===e.state&&("running"===e.gate.status||"passed"===e.gate.status));if("open"!==S||!e.length)return;let r=!0,s=window.setInterval(()=>{for(let a of e)t.get(a.number).then(e=>{r&&E(e,a.headSha)}).catch(e=>{r&&y(t=>({...t,[a.number]:(0,c.V5)(e,"검사 상태를 불러오지 못했습니다.").text}))})},1e4);return()=>{r=!1,window.clearInterval(s)}},[t,a,E,S]),(0,s.useEffect)(()=>{let e=!0,a=Number(new URLSearchParams(window.location.search).get("pr")),r=Number.isSafeInteger(a)&&a>0?a:null;return(d(!0),f(null),C(r),"merged"===S)?(t.list("merged").then(t=>{let{items:a}=t;e&&n(a)}).catch(t=>{e&&f((0,c.V5)(t,"목록을 불러오지 못했습니다."))}).finally(()=>{e&&d(!1)}),()=>{e=!1}):(t.list().then(async a=>{let{items:s}=a;if(!e)return;let l=s.find(e=>e.number===r);if(r&&!l)try{let a=await t.get(r);e&&n([a,...s])}catch(t){e&&f((0,c.V5)(t,"PR 을 불러오지 못했습니다.")),e&&n(s)}else n(r?[...s].sort((e,t)=>Number(t.number===r)-Number(e.number===r)):s)}).catch(t=>{e&&f((0,c.V5)(t,"목록을 불러오지 못했습니다."))}).finally(()=>{e&&d(!1)}),()=>{e=!1})},[t,S]),(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:"Approvals"}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:"아이디어 PR 변경 사항을 확인하고 승인합니다."})]}),(0,r.jsx)(p,{view:S,onChange:e=>{n([]),I(e)}}),l&&(0,r.jsx)(m,{view:S,target:k}),u&&(0,r.jsxs)("p",{role:"alert",className:"text-red-600","data-approvals-error":!0,children:[u.text,u.href&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)("a",{href:u.href,className:"font-semibold underline underline-offset-2","data-approvals-settings":!0,children:"설정 열기 →"})]})]}),!l&&!a.length&&!u&&(0,r.jsx)("p",{children:"merged"===S?"승인해 머지된 아이디어 PR 이 아직 없습니다.":"승인을 기다리는 PR 이 없습니다."}),a.map(e=>{var a,s;let n=e.merged||"MERGED"===e.state,l="OPEN"!==e.state&&!n,o=e.draft?"초안 PR 은 머지할 수 없습니다. GitHub에서 초안을 해제한 뒤 다시 확인하세요.":e.checks.failure>0?"실패한 검사가 있습니다.":e.checks.pending>0?"검사가 아직 끝나지 않았습니다.":"CONFLICTING"===e.mergeable?"머지 충돌이 있습니다.":"MERGEABLE"!==e.mergeable?"머지 가능 여부가 아직 확인되지 않았습니다.":"main"!==e.base?"대상 브랜치가 main 이 아닙니다.":"",c=k===e.number,d=null!=(a=v[e.number])?a: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)(x,{card:e,api:t,attempt:d,onAttempt:R,onUpdate:E}),(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:n?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)(h,{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 에서 보기"}),!n&&!l&&(0,r.jsx)(b,{gate:e.gate,busy:null!==g,blocked:!!o,mergeLabel:g===e.number?"머지 중…":"UNKNOWN"!==(s=e.mergeable)?"승인하고 머지":null===i(d,s)?"확인 종료":"확인 중…",onCheck:()=>U(e),onMerge:()=>O(e)})]}),o&&!n&&!l&&(0,r.jsxs)("p",{className:"mt-2 text-sm text-amber-600",children:[o,"UNKNOWN"===e.mergeable&&d>=3?" 자동 확인이 끝났습니다. 최신 상태는 페이지를 새로고침하세요.":""]}),j[e.number]&&(0,r.jsx)("p",{role:"alert",className:"mt-2 text-sm text-red-600",children:j[e.number]})]},e.number)})]})}function g(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 N extends Error{constructor(e,t){super(t),this.status=e,this.name="GraphApprovalsApiError"}}function j(e){return e instanceof N?401===e.status?"소유자 인증이 필요합니다. 설정에서 연결 토큰을 확인해 주세요.":403===e.status?"이 기기에서 승인하려면 페어링이 필요합니다. 설정에서 연결 토큰을 넣어 주세요.":404===e.status?"이 실행을 찾지 못했습니다. 목록을 다시 확인해 주세요.":409===e.status?"이미 결정된 실행입니다. 목록을 다시 확인해 주세요.":400===e.status?"결정 내용을 확인한 뒤 다시 시도해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요.":e instanceof TypeError?"서버에 연결하지 못했습니다. 연결 상태를 확인해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요."}let y="/v1/graph-approvals";function v(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),s=Number.isNaN(r)?0:Math.max(0,Math.floor((t-r)/6e4)),n=s<1?"방금 전":s<60?"".concat(s,"분 전"):s<1440?"".concat(Math.floor(s/60),"시간 전"):"".concat(Math.floor(s/1440),"일 전");return{title:a,nodeId:e.nodeId,waiting:n,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 w(e){var t,a,n,l,o,c,i;let{item:d,api:u,onDecided:m,confirm:p}=e,[h,b]=(0,s.useState)(d.feed),[x,f]=(0,s.useState)(()=>g(d.feed)),[N,y]=(0,s.useState)(!1),[v,w]=(0,s.useState)(0),[k,C]=(0,s.useState)(!1),[S,I]=(0,s.useState)(!1),[R,E]=(0,s.useState)(""),[U,O]=(0,s.useState)(""),[A,M]=(0,s.useState)({}),_=(0,s.useRef)(null),L=null!=p?p:e=>window.confirm(e),P=(i=g(h),JSON.stringify(x)!==JSON.stringify(i)),D=(0,s.useMemo)(()=>(function(e,t){let a=[];for(let r of(e.cover.image&&a.push({image:e.cover.image,cover:t.cover}),t.slides))r.include&&a.push({image:r.image,caption:r.caption});return a})(h,x),[h,x]),G=D[Math.min(v,Math.max(0,D.length-1))],H=(0,s.useMemo)(()=>[h.cover.image,...h.slides.map(e=>e.image)].filter(e=>!!e),[h]);function T(e){w(t=>Math.max(0,Math.min(D.length-1,t+e)))}function F(e,t){f(a=>({...a,slides:a.slides.map((a,r)=>r===e?{...a,...t}:a)}))}function W(e,t){f(a=>{let r=e+t;if(r<0||r>=a.slides.length)return a;let s=[...a.slides];return[s[e],s[r]]=[s[r],s[e]],{...a,slides:s}})}async function V(){I(!0),O(""),E("");try{let e=await u.saveFeedDraft(d.graphId,d.runId,x);return b(e.feed),f(g(e.feed)),E("저장했어요 \xb7 수정 ".concat(e.feed.revision," \xb7 아직 게시 전입니다")),!0}catch(e){return O(j(e)),!1}finally{I(!1)}}async function z(){if(L("게시할까요? 승인하면 이 초안으로 게시 준비 묶음이 텔레그램으로 갑니다.")&&(!P||await V())){I(!0),O("");try{await u.decide(d.graphId,d.runId,"approved"),m()}catch(e){O(j(e))}finally{I(!1)}}}async function J(){if(L("이 게시 초안을 거절할까요?")){I(!0),O("");try{await u.decide(d.graphId,d.runId,"rejected"),m()}catch(e){O(j(e))}finally{I(!1)}}}(0,s.useEffect)(()=>{let e=!0,t=[],a="undefined"!=typeof URL&&"function"==typeof URL.createObjectURL;return Promise.all(H.map(async r=>{try{let s=await u.feedMedia(d.graphId,d.runId,r);if(!e||!a)return null;let n=URL.createObjectURL(s);return t.push(n),[r,n]}catch(e){return null}})).then(t=>{e&&M(Object.fromEntries(t.filter(e=>!!e)))}),()=>{e=!1,a&&"function"==typeof URL.revokeObjectURL&&t.forEach(e=>URL.revokeObjectURL(e))}},[u,d.graphId,d.runId,H]);let K=(null==(t=h.brand)?void 0:t.name)||"브랜드",q=K.trim().charAt(0).toUpperCase()||"\xb7",B=x.hashtags.join(" ");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:q}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"truncate text-sm font-semibold",children:K}),(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,P?" \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;_.current=null!=(a=null==(t=e.touches[0])?void 0:t.clientX)?a:null},onTouchEnd:e=>{var t;let a=_.current;_.current=null;let r=null==(t=e.changedTouches[0])?void 0:t.clientX;null==a||null==r||40>Math.abs(r-a)||T(r<a?1:-1)},children:[(null==G?void 0:G.image)&&A[G.image]?(0,r.jsx)("img",{src:A[G.image],alt:null!=(o=null!=(l=G.caption)?l:null==(n=G.cover)?void 0:n.text)?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:"이미지 불러오는 중"}),(null==G?void 0:G.cover)&&(G.cover.text||G.cover.sub)&&(0,r.jsxs)("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/70 to-transparent p-4 text-white",children:[(0,r.jsx)("p",{className:"break-words text-lg font-semibold",children:G.cover.text}),G.cover.sub&&(0,r.jsx)("p",{className:"break-words text-sm opacity-90",children:G.cover.sub})]}),D.length>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button","aria-label":"이전 장",disabled:0===v,onClick:()=>T(-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:v>=D.length-1,onClick:()=>T(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:"›"})]})]}),D.length>1&&(0,r.jsx)("div",{"aria-label":"장 표시",className:"flex justify-center gap-1.5 py-2",children:D.map((e,t)=>(0,r.jsx)("span",{"data-dot":t===v?"on":"off",className:"h-1.5 w-1.5 rounded-full ".concat(t===v?"bg-primary":"bg-muted-foreground/40")},t))}),(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:K})," ",x.caption.hook]}),x.caption.body&&(k?(0,r.jsx)("p",{className:"whitespace-pre-wrap break-words",children:x.caption.body}):(0,r.jsx)("button",{type:"button",onClick:()=>C(!0),className:"text-muted-foreground",children:"더 보기"})),B&&(0,r.jsx)("p",{className:"break-words text-primary",children:B}),x.location&&(0,r.jsxs)("p",{className:"text-xs text-muted-foreground",children:["\uD83D\uDCCD ",x.location]})]}),N&&(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:x.cover.text,onChange:e=>f({...x,cover:{...x.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:x.cover.sub,onChange:e=>f({...x,cover:{...x.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:x.caption.hook,onChange:e=>f({...x,caption:{...x.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:x.caption.body,rows:4,onChange:e=>f({...x,caption:{...x.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:B,onChange:e=>f({...x,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=x.location)?c:"",onChange:e=>f({...x,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:x.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=>F(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:()=>W(t,-1),className:"rounded border px-2 py-0.5 disabled:opacity-40",children:"앞으로"}),(0,r.jsx)("button",{type:"button",disabled:t===x.slides.length-1,onClick:()=>W(t,1),className:"rounded border px-2 py-0.5 disabled:opacity-40",children:"뒤로"}),(0,r.jsx)("button",{type:"button",onClick:()=>F(t,{include:!e.include}),className:"rounded border px-2 py-0.5",children:e.include?"빼기":"되살리기"})]})]},e.image))})]}),(R||U)&&(0,r.jsx)("p",{role:U?"alert":"status",className:"px-3 pb-2 text-sm ".concat(U?"text-red-600":"text-muted-foreground"),children:U||R}),(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:S,onClick:()=>y(e=>!e),className:"rounded-lg border px-3 py-2 text-sm disabled:opacity-50",children:N?"편집 닫기":"편집"}),(0,r.jsx)("button",{type:"button",disabled:S||!P,onClick:()=>{V()},className:"rounded-lg border px-3 py-2 text-sm disabled:opacity-50",children:"수정 저장"}),(0,r.jsx)("button",{type:"button",disabled:S,onClick:()=>{z()},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:S,onClick:()=>{J()},className:"ml-auto rounded-lg px-3 py-2 text-sm text-muted-foreground disabled:opacity-50",children:"거절"})]})]})}function k(){let e,{client:t}=(0,o.Q)(),a=(0,s.useMemo)(()=>(function(e){var t,a;let r=(null!=(t=e.baseUrl)?t:"").replace(/\/+$/,""),s=null!=(a=e.fetchImpl)?a:fetch;async function n(t,a){let n={...a,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},l=e.client?await e.client.fetchResponse(t,n):await s("".concat(r).concat(t),n),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 N(l.status,e)}return o}return{list:()=>n(y),decide:(e,t,a)=>n("".concat(y,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)),{method:"POST",body:JSON.stringify({decision:a})}),saveFeedDraft:(e,t,a)=>n("".concat(y,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t),"/feed-draft"),{method:"PUT",body:JSON.stringify(a)}),feedMedia:async(t,a,n)=>{let l="".concat(y,"/").concat(encodeURIComponent(t),"/").concat(encodeURIComponent(a),"/media?path=").concat(encodeURIComponent(n)),o={headers:e.authHeader?{authorization:e.authHeader}:{}},c=e.client?await e.client.fetchResponse(l,o):await s("".concat(r).concat(l),o);if(!c.ok)throw new N(c.status,"media-failed");return c.blob()}}})({client:t}),[t]),[n,l]=(0,s.useState)([]),[c,i]=(0,s.useState)(""),[d,u]=(0,s.useState)(!1),m=(0,s.useRef)((e=0,{begin:()=>e+=1,isLatest:t=>t===e})).current,p=(0,s.useCallback)(async()=>{let e=m.begin();try{let t=await a.list();if(!m.isLatest(e))return;l(t.items),i("")}catch(t){m.isLatest(e)&&i(j(t))}},[a,m]);async function h(e,t){if("rejected"!==t||window.confirm("".concat(v(e).title," 실행을 거절할까요?"))){u(!0),i(""),m.begin();try{await a.decide(e.graphId,e.runId,t),await p()}catch(e){i(j(e))}finally{u(!1)}}}(0,s.useEffect)(()=>{p();let e=window.setInterval(()=>{p()},3e4);return()=>window.clearInterval(e)},[p]);let b=n.filter(e=>!!e.feed),x=n.filter(e=>!e.feed);return n.length||c?(0,r.jsxs)(r.Fragment,{children:[b.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를 눌러야만 올라갑니다."}),b.map(e=>(0,r.jsx)(w,{item:e,api:a,onDecided:()=>{m.begin(),p()}},"".concat(e.graphId,"/").concat(e.runId)))]}),(x.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}),x.map(e=>{let t=v(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:d,onClick:()=>{h(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:d,onClick:()=>{h(e,"rejected")},className:"rounded-lg border px-4 py-2 text-sm disabled:opacity-50",children:"거절"})]})]},"".concat(e.graphId,"/").concat(e.runId))})]})]}):null}function C(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k,{}),(0,r.jsx)(f,{})]})}}},e=>{e.O(0,[2330,8519,2367,6725,7358],()=>e(e.s=1812)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
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))]})}},19057:(e,t,s)=>{Promise.resolve().then(s.bind(s,30968))},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,{})}},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=19057)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7081],{10292:(e,t,a)=>{Promise.resolve().then(a.bind(a,80191))},19528:(e,t,a)=>{"use strict";a.d(t,{Er:()=>r,cj:()=>c,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))}},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=10292)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2580],{871:(e,r,a)=>{Promise.resolve().then(a.bind(a,72361))},7509:(e,r,a)=>{"use strict";a.d(r,{U:()=>g});var t=a(41121),n=a(91269),s=a(38519),i=a(72030),o=a(59062);function l(e){let{items:r}=e;return 0===r.length?(0,t.jsx)("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No control signals matched the current filter."}):(0,t.jsx)("ul",{className:"space-y-2",children:r.map((e,r)=>{var a,n,s,i,o;let l=[(null==(a=e.scope)?void 0:a.surface)&&"surface=".concat(e.scope.surface),(null==(n=e.scope)?void 0:n.channel)&&"channel=".concat(e.scope.channel),(null==(s=e.scope)?void 0:s.sessionId)&&"session=".concat(e.scope.sessionId)].filter(Boolean).join(" \xb7 ")||"unscoped";return(0,t.jsxs)("li",{className:"rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,t.jsxs)("div",{className:"text-sm font-medium",children:[e.kind," \xb7 ",e.urgency]}),(0,t.jsxs)("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:[function(e){let r=Date.now()-new Date(e).getTime();return r<6e4?"just now":r<36e5?"".concat(Math.floor(r/6e4),"m ago"):r<864e5?"".concat(Math.floor(r/36e5),"h ago"):"".concat(Math.floor(r/864e5),"d ago")}(e.createdAt)," \xb7 ",null!=(i=e.source)?i:"unknown"," \xb7 ",l]}),(0,t.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted p-2 text-[11px]",children:JSON.stringify(null!=(o=e.payload)?o:{},null,2)})]},r)})})}let d=["background","quick-pass","normal","priority","critical"];class c{async list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;Object.entries(e).forEach(e=>{let[a,t]=e;t&&r.set(a,t)});let a=r.toString();return this.client.fetchJson("/v1/control-signals".concat(a?"?".concat(a):""))}emit(e){return this.client.fetchJson("/v1/control-signals",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}constructor(e){this.client=e}}var u=a(66062),p=a(51215);function g(){var e,r,a,g;let{client:m}=(0,s.Q)(),x=(0,n.useMemo)(()=>new c(m),[m]),[v,h]=(0,n.useState)({items:[]}),[b,f]=(0,n.useState)(!1),[y,j]=(0,n.useState)(""),[N,k]=(0,n.useState)(""),[w,S]=(0,n.useState)(""),[z,C]=(0,n.useState)(""),[_,O]=(0,n.useState)(""),[E,J]=(0,n.useState)(""),[P,R]=(0,n.useState)("normal"),[$,D]=(0,n.useState)("operator"),[I,M]=(0,n.useState)(""),[U,q]=(0,n.useState)(""),[A,B]=(0,n.useState)(""),[F,Q]=(0,n.useState)(""),[T,Y]=(0,n.useState)(!1),K=(0,n.useCallback)(async()=>{(0,p.cY)("webterm.control.list.refresh",{kind:y,surface:N,minUrgency:w,sessionId:z,limit:_}),f(!0);try{let e=await x.list({kind:y||void 0,surface:N||void 0,minUrgency:w||void 0,sessionId:z||void 0,limit:_||void 0});h(e)}catch(e){u.oR.error("signals list failed: ".concat(e instanceof Error?e.message:e))}finally{f(!1)}},[x,y,N,w,z,_]);(0,n.useEffect)(()=>{K()},[K]);let L=async e=>{if(e.preventDefault(),!E.trim())return void u.oR.error("kind required");let r={};if(F.trim())try{r=JSON.parse(F)}catch(e){u.oR.error("payload must be valid JSON");return}let a={kind:E.trim(),urgency:P,source:$.trim()||"operator",mayPreempt:T,payload:r,scope:{...I?{surface:I}:{},...U?{channel:U}:{},...A?{sessionId:A}:{}}};(0,p.cY)("webterm.control.emit",{kind:a.kind,urgency:a.urgency});try{f(!0),await x.emit(a),u.oR.success("signal emitted"),Q(""),await K()}catch(e){u.oR.error("emit failed: ".concat(e instanceof Error?e.message:e))}finally{f(!1)}},V=null!=(e=v.countsByKind)?e:{};return(0,t.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-4",children:[(0,t.jsxs)("header",{className:"space-y-2",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Control signals"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,t.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["total ",null!=(r=v.total)?r:0]}),(0,t.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["latest ",null!=(a=v.latest)?a:"-"]}),Object.entries(V).map(e=>{let[r,a]=e;return(0,t.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:[r," ",a]},r)})]})]}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),K()},className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,t.jsx)(o.p,{value:y,onChange:e=>j(e.target.value),placeholder:"kind",className:"flex-1 min-w-[140px]"}),(0,t.jsx)(o.p,{value:N,onChange:e=>k(e.target.value),placeholder:"surface",className:"flex-1 min-w-[140px]"}),(0,t.jsxs)("select",{value:w,onChange:e=>S(e.target.value),className:"h-9 flex-1 min-w-[170px] rounded-md border border-input bg-background px-2 text-sm",children:[(0,t.jsx)("option",{value:"",children:"min urgency (any)"}),d.map(e=>(0,t.jsx)("option",{value:e,children:e},e))]}),(0,t.jsx)(o.p,{value:z,onChange:e=>C(e.target.value),placeholder:"session id",className:"flex-1 min-w-[140px]"}),(0,t.jsx)(o.p,{value:_,onChange:e=>O(e.target.value),placeholder:"limit",type:"number",className:"w-[100px]"}),(0,t.jsx)(i.$,{type:"submit",size:"sm",disabled:b,children:"Filter"})]}),(0,t.jsxs)("form",{onSubmit:L,className:"space-y-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,t.jsx)("h2",{className:"text-sm font-semibold",children:"Emit a signal"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(o.p,{value:E,onChange:e=>J(e.target.value),placeholder:"kind (required)",className:"flex-1 min-w-[140px]"}),(0,t.jsx)("select",{value:P,onChange:e=>{let r=e.target.value;"string"==typeof r&&d.includes(r)&&R(r)},className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:d.map(e=>(0,t.jsx)("option",{value:e,children:e},e))}),(0,t.jsx)(o.p,{value:$,onChange:e=>D(e.target.value),placeholder:"source",className:"flex-1 min-w-[120px]"}),(0,t.jsx)(o.p,{value:I,onChange:e=>M(e.target.value),placeholder:"scope.surface",className:"flex-1 min-w-[120px]"}),(0,t.jsx)(o.p,{value:U,onChange:e=>q(e.target.value),placeholder:"scope.channel",className:"flex-1 min-w-[120px]"}),(0,t.jsx)(o.p,{value:A,onChange:e=>B(e.target.value),placeholder:"scope.session",className:"flex-1 min-w-[120px]"}),(0,t.jsxs)("label",{className:"flex items-center gap-1.5 text-xs",children:[(0,t.jsx)("input",{type:"checkbox",checked:T,onChange:e=>Y(e.target.checked)}),"mayPreempt"]})]}),(0,t.jsx)("textarea",{value:F,onChange:e=>Q(e.target.value),placeholder:'payload JSON (optional, e.g. {"reason":"manual"})',rows:3,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs"}),(0,t.jsx)(i.$,{type:"submit",size:"sm",disabled:b,children:"Emit"})]}),(0,t.jsx)(l,{items:null!=(g=v.items)?g:[]})]})}},59062:(e,r,a)=>{"use strict";a.d(r,{p:()=>i});var t=a(41121);a(91269);var n=a(94114),s=a(82157);function i(e){let{className:r,type:a,...i}=e;return(0,t.jsx)(n.p,{type:a,"data-slot":"input",className:(0,s.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",r),...i})}},72030:(e,r,a)=>{"use strict";a.d(r,{$:()=>l});var t=a(41121),n=a(72524),s=a(49155),i=a(82157);let o=(0,s.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:r,variant:a="default",size:s="default",...l}=e;return(0,t.jsx)(n.$,{"data-slot":"button",className:(0,i.cn)(o({variant:a,size:s,className:r})),...l})}},72361:(e,r,a)=>{"use strict";a.r(r),a.d(r,{default:()=>s});var t=a(41121),n=a(7509);function s(){return(0,t.jsx)(n.U,{})}},82157:(e,r,a)=>{"use strict";a.d(r,{cn:()=>s});var t=a(3511),n=a(97043);function s(){for(var e=arguments.length,r=Array(e),a=0;a<e;a++)r[a]=arguments[a];return(0,n.QP)((0,t.$)(r))}}},e=>{e.O(0,[2977,216,6062,4114,8519,2367,6725,7358],()=>e(e.s=871)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6348],{6015:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var n=s(91269),r=s(95817),a=s(83026),i=s(37963),l=s(98883),o=class extends i.Q{#e;#t=void 0;#s;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#a()}mutate(e,t){return this.#n=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#r(){let e=this.#s?.state??(0,r.$)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#a(e){a.jG.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,s,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,s,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(24818);function d(e,t){let s=(0,c.jE)(t),[r]=n.useState(()=>new o(s,e));n.useEffect(()=>{r.setOptions(e)},[r,e]);let i=n.useSyncExternalStore(n.useCallback(e=>r.subscribe(a.jG.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),d=n.useCallback((e,t)=>{r.mutate(e,t).catch(l.lQ)},[r]);if(i.error&&(0,l.GU)(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:d,mutateAsync:i.mutate}}},11635:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(89117).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},42310:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(89117).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},51215:(e,t,s)=>{"use strict";let n;s.d(t,{cY:()=>d,x8:()=>l});let r={debug:0,info:1,warn:2,error:3},a="/v1/debug-logs/batch",i=null;function l(e){i=e}class o{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(r[function(e){let t=e.slice(e.lastIndexOf(".")+1).toLowerCase();return/^(error|exception|crash|fail|failed)$/.test(t)?"error":/^(warn|degraded|timeout)$/.test(t)?"warn":/^(boot|ready|start|begin|open|ok|done|resolve|end|stop|close)$/.test(t)?"info":"debug"}(e.category)]<r[this.minLevel])){if(this.queue.push(e),this.queue.length>500){let e=this.queue.length-500;this.droppedByCap+=e,this.queue.splice(0,e)}null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},100))}}async flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.inFlight||0===this.queue.length)return;let e=this.queue.slice(0,100);this.inFlight=!0;let t=!1,s=JSON.stringify({records:e});try{var n,r;t=await (n=this.fetchFn(s),r=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(r,"ms"))),r);n.then(t=>{clearTimeout(s),e(t)},e=>{clearTimeout(s),t(e)})}))}catch(e){t=!1}finally{this.inFlight=!1}if(!t){if(this.consecutiveFailures+=1,this.consecutiveFailures>=2&&i)try{await i(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let a=this.lastOkAt;this.lastOkAt=Date.now();let l=this.consecutiveFailures;this.consecutiveFailures=0,this.queue.splice(0,e.length),this.wasFailing&&(this.wasFailing=!1,this.queue.push({ts:new Date().toISOString(),category:"pwa.debug-forwarder.recovered",event:"recovered",data:{consecutiveFailures:l,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches,pending:this.queue.length,previousOkAt:a},source:{platform:"pwa"}})),this.queue.length>0&&null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},100))}scheduleRetry(){if(null!==this.timer||0===this.queue.length)return;let e=Math.min(100*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(a,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",s=1e4){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,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(a,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function d(e,t){if("undefined"==typeof console)return;let s=new Date().toISOString();if(void 0!==t){let n="";try{let e=new WeakSet;n=JSON.stringify(t,(t,s)=>{if("bigint"==typeof s)return"".concat(s.toString(),"n");if("function"==typeof s)return"[fn ".concat(s.name||"anon","]");if(s&&"object"==typeof s){if(e.has(s))return"[circular]";e.add(s)}return s})}catch(e){n="[unserializable: ".concat(String(e),"]")}n&&n.length>800&&(n=n.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(n),t),u(s,e,n)}else console.debug("[".concat(s,"] ").concat(e)),u(s,e,void 0)}function u(e,t,s){let r,a=function(){if(void 0!==n)return n;let e=function(){try{let e="off"!==window.localStorage.getItem("elanous.pwa.debug.forward"),t=window.localStorage.getItem("elanous.pwa.debug.forwardLevel");return{forward:e,level:"info"===t||"warn"===t||"error"===t?t:"debug"}}catch(e){return{forward:!0,level:"debug"}}}();if(!e.forward)return n=null,null;let t=new o(c,e.level);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return n=t,t}();if(!a)return;let i=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{r=JSON.parse(s)}catch(e){r=s}a.push({ts:e,category:t,event:i,...void 0!==r?{data:r}:{},source:{platform:"pwa"}})}},67842:(e,t,s)=>{"use strict";s.d(t,{AF:()=>n});let n={all:["nexus"],health:()=>[...n.all,"health"],snapshot:()=>[...n.all,"snapshot"],tabs:e=>e?[...n.all,"tabs",{kind:e}]:[...n.all,"tabs"],tab:e=>[...n.all,"tab",e],templates:()=>[...n.all,"templates"],template:e=>[...n.all,"template",e],config:()=>[...n.all,"config"],switches:()=>[...n.all,"switches"],switch:e=>[...n.all,"switch",e],secrets:()=>[...n.all,"secrets"],bindingChannels:()=>[...n.all,"bindings","channels"],bindings:e=>[...n.all,"bindings",e],binding:(e,t)=>[...n.all,"binding",e,t],logsTail:(e,t)=>t?[...n.all,"logs",e,{lines:t}]:[...n.all,"logs",e],workflows:()=>[...n.all,"workflows"],workflow:e=>[...n.all,"workflow",e],workflowRun:e=>[...n.all,"workflow-run",e],workflowRuns:()=>[...n.all,"workflow-runs"],pendingApprovals:()=>[...n.all,"workflow-pending-approvals"],platforms:()=>[...n.all,"platforms"],providers:()=>[...n.all,"providers"],worktrees:()=>[...n.all,"worktrees"],designCheck:()=>[...n.all,"design-check"],designPreviews:()=>[...n.all,"design-previews"],designPreview:e=>[...n.all,"design-preview",e],registryCatalog:()=>[...n.all,"registry-catalog"],resolvedView:()=>[...n.all,"resolved-view"]};n.snapshot(),n.tabs(),n.health(),n.snapshot(),n.config(),n.switches()},82301:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var n=s(41121),r=s(93981),a=s(11635);let i=(0,s(89117).A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);var l=s(42310),o=s(99608),c=s(91269),d=s(91514),u=s(42012),h=s(24818),m=s(6015),p=s(67842),g=s(42375);function f(e){let{available:t,declared:s,onPick:r,pendingId:a,previews:i,onPreview:l}=e,{systems:o,themes:c}=function(e){let t=[],s=[];for(let n of e)("design-system"===n.source?t:s).push(n);return{systems:t,themes:s}}(t);return(0,n.jsxs)("div",{className:"space-y-4",children:[o.length>0&&(0,n.jsx)(x,{title:"Design systems",hint:"Web \xb7 copies tokens.css and DESIGN.md into design/system/",items:o,declared:s,onPick:r,pendingId:a,previews:i,onPreview:l}),c.length>0&&(0,n.jsx)(x,{title:"Terminal themes",hint:"One line in DESIGN.md",items:c,declared:s,onPick:r,pendingId:a,previews:i,onPreview:l})]})}function x(e){let{title:t,hint:s,items:r,declared:a,onPick:i,pendingId:l,previews:o,onPreview:c}=e;return(0,n.jsxs)("section",{className:"space-y-2","aria-label":t,children:[(0,n.jsxs)("h3",{className:"flex items-baseline gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[t,(0,n.jsxs)("span",{className:"normal-case tracking-normal",children:[r.length," \xb7 ",s]})]}),(0,n.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>(0,n.jsx)(b,{direction:e,chosen:e.id===a,onPick:i,pending:l===e.id,busy:null!==l,hasPreview:(null==o?void 0:o.has(e.id))===!0&&void 0!==c,onPreview:c},e.id))})]})}function b(e){var t,s,r,i,l,o,c,d,u;let{direction:h,chosen:m,onPick:p,pending:g,busy:f,hasPreview:x,onPreview:b}=e,y=null!=(r=h.swatch.bg)?r:h.isDark?"#111111":"#ffffff",v=null!=(i=h.swatch.fg)?i:h.swatch.text,w=null!=(o=null!=(l=null==(t=h.typography)?void 0:t.display)?l:null==(s=h.typography)?void 0:s.body)?o:null;return(0,n.jsxs)("li",{"data-direction":h.id,"data-direction-id":h.id,className:"flex flex-col gap-2 rounded-md border p-3 text-sm ".concat(m?"border-primary ring-1 ring-primary":""),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5","aria-hidden":!0,children:[[y,v,h.swatch.accent].map((e,t)=>(0,n.jsx)("span",{className:"h-5 w-5 rounded-full border",style:{backgroundColor:e,borderColor:h.swatch.muted}},t)),h.category&&(0,n.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:h.category})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"truncate font-medium",children:null!=(c=h.label)?c:h.id}),(0,n.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(0,n.jsx)("code",{children:h.id}),w?" \xb7 ".concat(w):""]}),(0,n.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:h.mood})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,n.jsx)("button",{type:"button",onClick:()=>null==b?void 0:b(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Preview ".concat(null!=(d=h.label)?d:h.id),children:"Preview"}),m?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:[(0,n.jsx)(a.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Selected"]}):(0,n.jsx)("button",{type:"button",disabled:f,onClick:()=>p(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(null!=(u=h.label)?u:h.id),children:g?"Selecting…":"Select"})]})]})}let y=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function v(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function w(e,t){if("undefined"==typeof document)return t;let s=document.getElementById(e);return s&&"value"in s&&"string"==typeof s.value?s.value:t}function k(e){let{onCreate:t,onSelect:s,pending:r,result:a,error:i}=e,[l,o]=(0,c.useState)("url"),[d,u]=(0,c.useState)(""),[h,m]=(0,c.useState)(""),[p,g]=(0,c.useState)(""),f=v(h).filter(e=>y.test(e)),x=v(h).length,b=x>=2&&x<=6&&p.trim().length>0&&f.length===x;return(0,n.jsxs)("section",{className:"rounded-md border p-3","aria-label":"Make my system","data-make-my-system":"",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Make my system"}),(0,n.jsxs)("div",{className:"flex gap-1",role:"tablist",children:[(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"url"===l,className:"rounded-md px-2 py-1 text-xs ".concat("url"===l?"bg-muted":""),onClick:()=>o("url"),children:"From a website"}),(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"colors"===l,className:"rounded-md px-2 py-1 text-xs ".concat("colors"===l?"bg-muted":""),onClick:()=>o("colors"),children:"From colors"})]})]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Reference, not a copy — logos, names, images and text are not taken."}),"url"===l?(0,n.jsxs)("form",{className:"mt-2 flex flex-col gap-2 sm:flex-row",onSubmit:e=>{e.preventDefault();let s=d.trim();s&&!r&&t({kind:"url",url:s})},children:[(0,n.jsx)("label",{className:"sr-only",htmlFor:"make-system-url",children:"Website URL"}),(0,n.jsx)("input",{id:"make-system-url",type:"url",value:d,disabled:r,placeholder:"https://example.com",onChange:e=>u(e.target.value),className:"min-w-0 flex-1 rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=w("make-system-url",d).trim();e&&!r&&t({kind:"url",url:e})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}):(0,n.jsxs)("form",{className:"mt-2 space-y-2",onSubmit:e=>{e.preventDefault(),b&&!r&&t({kind:"palette",colors:f,id:p.trim()})},children:[(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-colors",children:"2–6 colors"}),(0,n.jsx)("input",{id:"make-system-colors",value:h,disabled:r,placeholder:"#f4efe6, #1f3a2e, #c8553d",onChange:e=>m(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),f.length>0&&(0,n.jsx)("ul",{className:"flex gap-1","aria-label":"Color preview",children:f.map(e=>(0,n.jsx)("li",{className:"h-6 w-6 rounded-sm border",style:{backgroundColor:e},title:e},e))}),(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-id",children:"id"}),(0,n.jsx)("input",{id:"make-system-id",value:p,disabled:r,placeholder:"stumptowncoffee",onChange:e=>g(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=v(w("make-system-colors",h)).filter(e=>y.test(e)),s=w("make-system-id",p).trim();r||e.length<2||e.length>6||0===s.length||t({kind:"palette",colors:e,id:s})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}),r&&(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Measuring…"}),i&&(0,n.jsx)("p",{className:"mt-2 text-sm text-error",role:"alert",children:i}),a&&(0,n.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,n.jsxs)("p",{children:["Made ",a.id," — ",a.tokens.length," tokens \xb7 ",a.unread," unread"]}),a.warnings.map(e=>(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e)),(0,n.jsx)("button",{type:"button",onClick:()=>s(a.id),className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted",children:"Select it"})]})]})}let j={missing:"Missing",declared:"Declared",available:"Not declared"},N={missing:"bg-error/10 text-error",declared:"bg-green-600/10 text-green-700",available:"bg-muted text-muted-foreground"},S={missing:r.A,declared:a.A,available:i};function C(){return(0,d.Qj)()?(0,n.jsx)(M,{}):(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Design check"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to see this repository's craft rulebooks."})]})}function M(){let{data:e,isLoading:t,error:s,refetch:a,isFetching:i}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designCheck(),queryFn:()=>s.getDesignCheck(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}();return(0,n.jsxs)("div",{className:"mx-auto max-w-3xl space-y-4 p-6",children:[(0,n.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(l.A,{className:"h-5 w-5","aria-hidden":!0}),"Design check"]}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Craft rulebooks declared by this repository's ",(0,n.jsx)("code",{children:"DESIGN.md"}),"."]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void a(),className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm hover:bg-muted","aria-label":"Refresh design check",children:[(0,n.jsx)(o.A,{className:"h-4 w-4 ".concat(i?"animate-spin":""),"aria-hidden":!0}),"Refresh"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),s&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["Could not reach the daemon: ",s instanceof Error?s.message:String(s)]}),e&&!1===e.ok&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/5 p-4",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(r.A,{className:"h-4 w-4 text-warning","aria-hidden":!0}),"Design check blocked"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:function(e,t){switch(e){case"no-repository":return"The daemon is not running inside a git checkout, so there is no DESIGN.md to check.";case"craft-directory":return"elanous's craft rulebook directory could not be read: ".concat(null!=t?t:"(unknown path)");case"design-document":return"This repository has no readable DESIGN.md: ".concat(null!=t?t:"(unknown path)");default:return"The design check is blocked (".concat(e,").")}}(e.blockedOn,e.path)})]}),e&&!0===e.ok&&(0,n.jsx)(O,{data:e})]})}function O(e){let{data:t}=e,s=function(e){let t=new Set(e.unavailableRulebooks),s=new Map;for(let t of e.availableRulebooks)s.set(t,"available");for(let n of e.declaredRulebooks)s.set(n,t.has(n)?"missing":"declared");let n={missing:0,declared:1,available:2};return[...s.entries()].map(e=>{let[t,s]=e;return{name:t,status:s}}).sort((e,t)=>n[e.status]-n[t.status]||e.name.localeCompare(t.name))}(t),r=t.unavailableRulebooks.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"rounded-md p-3 text-sm ".concat(r?"bg-error/10 text-error":"bg-green-600/10 text-green-700"),children:r?"".concat(r," declared rulebook").concat(1===r?"":"s"," could not be found."):"All ".concat(t.declaredRulebooks.length," declared rulebook").concat(1===t.declaredRulebooks.length?"":"s"," resolve.")}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,n.jsxs)("div",{className:"truncate sm:col-span-2",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Repository: "}),(0,n.jsxs)("dd",{className:"inline",children:[(0,n.jsx)("code",{children:t.repoRoot}),t.repoSource&&(0,n.jsxs)("span",{className:"ml-1",children:["(","config"===t.repoSource?"harness.defaultRepo":"daemon folder",")"]})]})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Document: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.documentPath})})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Rulebooks: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.craftDirectory})})]})]}),(0,n.jsx)(F,{data:t}),0===s.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"elanous ships no craft rulebooks and this document declares none."}):(0,n.jsx)("ul",{className:"divide-y rounded-md border",children:s.map(e=>{let t=S[e.status];return(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,n.jsx)("code",{children:e.name})]}),(0,n.jsx)("span",{className:"shrink-0 rounded-full px-2 py-0.5 text-xs ".concat(N[e.status]),children:j[e.status]})]},e.name)})})]})}function F(e){var t,s,r,a;let{data:i}=e,l=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.setDesignDirection(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),o=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.createDesignSystem(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),x=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreviews(),queryFn:()=>s.listDesignPreviews(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}(),[b,y]=(0,c.useState)(null),[v,w]=(0,c.useState)(null),j=i.directions;if((0,c.useEffect)(()=>{if(!v||!j)return;let e=document.querySelector('[data-direction-id="'.concat(v.replace(/"/g,""),'"]'));null==e||e.scrollIntoView({block:"nearest"})},[v,j]),!j)return null;let N=l.isPending&&null!=(s=l.variables)?s:null;return(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"Design direction"}),(0,n.jsx)(k,{pending:o.isPending,result:null!=(r=o.data)?r:null,error:o.isError?function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"bad-url":return"That address is not an http or https URL.";case"bad-id":return"The id may only use lowercase letters, digits, and hyphens.";case"id-taken":return"That id is already taken.";case"extract-failed":return"The page could not be measured.";case"no-colors":return"Give between 2 and 6 colors.";case"busy":return"Another system is being made — wait for it to finish.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can make a system — sign in first.";return"Could not make the system: ".concat(e instanceof Error?e.message:String(e))}}(o.error):null,onCreate:e=>{o.mutate(e,{onSuccess:e=>w(e.id)})},onSelect:e=>{w(e),l.mutate(e)}}),j.unavailable&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:["Declared direction ",(0,n.jsx)("code",{children:j.unavailable})," is not registered."]}),null===j.declared&&!j.unavailable&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"None declared — pick one below."}),l.isError&&(0,n.jsx)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"unknown-direction":return"The daemon does not know this direction.";case"no-repository":return"The daemon has no repository to write to (set harness.defaultRepo).";case"conflicting-system-file":return"design/system/ already holds a file the daemon will not overwrite.";case"cannot-read":return"The DESIGN.md could not be read.";case"cannot-write":return"The DESIGN.md could not be written.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can pick a direction — sign in first.";return"Could not set the direction: ".concat(e instanceof Error?e.message:String(e))}}(l.error)}),b&&(0,n.jsx)(A,{system:b,onClose:()=>y(null),onSelect:()=>l.mutate(b),selecting:N===b,busy:null!==N,alreadySelected:j.declared===b}),(0,n.jsx)(f,{available:j.available,declared:j.declared,pendingId:N,previews:new Set((null!=(a=null==(t=x.data)?void 0:t.previews)?a:[]).map(e=>e.system)),onPreview:e=>y(e),onPick:e=>l.mutate(e)})]})}function A(e){let{system:t,onClose:s,onSelect:r,selecting:a,busy:i,alreadySelected:l}=e,o=function(e){let t=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreview(null!=e?e:""),queryFn:()=>t.getDesignPreview(e),enabled:null!==e&&""!==e})}(t);return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"text-sm font-medium",children:["Preview \xb7 ",(0,n.jsx)("code",{children:t})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,n.jsx)("span",{className:"text-xs text-primary",children:"Selected"}):(0,n.jsx)("button",{type:"button",disabled:i,onClick:r,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(t),children:a?"Selecting…":"Select"}),(0,n.jsx)("button",{type:"button",onClick:s,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Close preview",children:"Close"})]})]}),o.isLoading&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading preview…"}),o.isError&&(0,n.jsxs)("p",{className:"text-sm text-error",children:["Could not load the preview: ",o.error instanceof Error?o.error.message:String(o.error)]}),o.data&&(0,n.jsx)("iframe",{sandbox:"",srcDoc:o.data.html,title:"Preview \xb7 ".concat(t),className:"h-80 w-full rounded-md border bg-white"})]})}function E(){return(0,n.jsx)(C,{})}},90417:(e,t,s)=>{Promise.resolve().then(s.bind(s,82301))},91514:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>d,tI:()=>o});var n=s(41121),r=s(91269),a=s(19855),i=s(24818);let l=(0,r.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,d=(0,r.useMemo)(()=>null!=s?s:new a.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,n.jsx)(l.Provider,{value:t,children:(0,n.jsx)(i.Ht,{client:d,children:c})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,r.useContext)(l)}},91644:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>i,SI:()=>o,dJ:()=>l});let n="elanous:auth-required",r=null,a=!1;function i(e){null===r&&(r=e,window.dispatchEvent(new CustomEvent(n,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(n,s),null===r||a||e({path:r}),()=>t.removeEventListener(n,s)}function o(){a=!0}},93981:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(89117).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},99608:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(89117).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])}},e=>{e.O(0,[920,6998,2375,2367,6725,7358],()=>e(e.s=90417)),_N_E=e.O()}]);
|