elanous 0.2.25 → 0.2.28
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/chunks/{1454-37fd16f479f5554a.js → 1454-29d1d773d5996a49.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/{599-a914cc0468f56143.js → 599-56f2c0a5cc4a7295.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-5ab1e47978577c5e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-24453f6a302816b4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/page-6c131d30bb1cf871.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/{page-b12149c51f7d04b1.js → page-fa46d4588e8442c2.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/page-dc0772b11861af51.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-66ad46ed0279feb9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/chat/page-5159dc8752c6cd29.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/consult/page-c5a2478861c08b87.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/control/page-f722a9dec084e08b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/decisions/{page-305cd294e754906e.js → page-256ffd365d32e100.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/{page-dea4b795741126fd.js → page-e0de78ae7b99f01c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-cfbdc44b708d9801.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/exec/{page-45889e7070d11126.js → page-4c741eb760f2f77c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/field/{page-16a2e893f83ae4d0.js → page-e9ba98f5f1440a21.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-dafc901bb1b72b5f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/intake/{page-56888bc744e08dac.js → page-2f6f303fa114ec24.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/layout-1634081c5272006c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live/{page-952c6ceec6d9de38.js → page-ced0bcfc6542b3fc.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/live-run/{page-6d0202af568f4c63.js → page-bb1f05cd51c38944.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/loops/page-646b50f63b6fe732.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/market/page-db069b48a59c8c00.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/{page-4fb6fc34e20c07b7.js → page-f736324afa2117c1.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/morning/{page-e9502921f4f01b1f.js → page-6f131b51193a36f9.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/{not-found-b6169ea2f09cf287.js → not-found-435f5e2faf02bc01.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/{page-6a14333d1b1b3967.js → page-497e0eedf20e7890.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/{page-8c91a9a66c9ec90a.js → page-a8d28fdf995e16ea.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-8966452228753c5e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-fd5d18656cb432b6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-5663779cb1a37609.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/{page-3d3fc73dd187ed52.js → page-66a67eb19ebd976b.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-3b492aa78cf3c4a6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/scheduler/{page-9c04dac0831c2bbb.js → page-c71267e7681da982.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/page-a21d1e1797172692.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/{page-04de9ca6d52a3893.js → page-cb249e81ed339318.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/{page-62527677bbc2fdc4.js → page-781cfc5114e097da.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/{page-9a2e09c4a311764c.js → page-478157214db6a023.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/{page-bfeb35d69e8b24bb.js → page-86141f12cf090b7f.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/share/{page-89cb33bced824e4a.js → page-7256c73bb1c36751.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-5c738ca7adef3de5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-0138c8091ec17224.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/term/page-cc2f24f16d85e735.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/today/{page-6445ac4cbb8dd869.js → page-979d318a534e92da.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/trace/page-182d394f7e6e096b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/vault/page-21050928a697ed7a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-44b9d807005a9030.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/{page-20162174b77f96cf.js → page-601fb77340e63c9a.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-75d3fb5d47af0edf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/worktrees/{page-05a4b2c9b91034aa.js → page-11bf9e5725a72c22.js} +1 -1
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +13 -13
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +13 -13
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +13 -13
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +13 -13
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +13 -13
- package/apps/pwa/out/ceo/index.html +1 -1
- package/apps/pwa/out/ceo/index.txt +13 -13
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +13 -13
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +13 -13
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +13 -13
- package/apps/pwa/out/decisions/index.html +1 -1
- package/apps/pwa/out/decisions/index.txt +13 -13
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +13 -13
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +13 -13
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +13 -13
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +13 -13
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +13 -13
- package/apps/pwa/out/inside/index.html +1 -1
- package/apps/pwa/out/inside/index.txt +13 -13
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +13 -13
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +13 -13
- package/apps/pwa/out/live-run/index.html +1 -1
- package/apps/pwa/out/live-run/index.txt +13 -13
- package/apps/pwa/out/loops/index.html +1 -1
- package/apps/pwa/out/loops/index.txt +13 -13
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +13 -13
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +13 -13
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +13 -13
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +13 -13
- package/apps/pwa/out/ops/checklist/index.html +1 -1
- package/apps/pwa/out/ops/checklist/index.txt +13 -13
- package/apps/pwa/out/ops/release/index.html +1 -1
- package/apps/pwa/out/ops/release/index.txt +13 -13
- package/apps/pwa/out/ops/seats/index.html +1 -1
- package/apps/pwa/out/ops/seats/index.txt +13 -13
- package/apps/pwa/out/outputs/index.html +1 -1
- package/apps/pwa/out/outputs/index.txt +13 -13
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +14 -14
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +13 -13
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +13 -13
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +13 -13
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +13 -13
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +13 -13
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +13 -13
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +13 -13
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +13 -13
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +13 -13
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +13 -13
- package/apps/pwa/out/today/index.html +1 -1
- package/apps/pwa/out/today/index.txt +13 -13
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +13 -13
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +13 -13
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +13 -13
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +13 -13
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +13 -13
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +13 -13
- package/graphs/implement-loop.yaml +38 -1
- package/graphs/steward/recipes.yaml +6 -0
- package/graphs/steward/release-day.yaml +23 -0
- package/graphs/steward/steward.yaml +9 -1
- package/graphs/work/code-pr.yaml +23 -0
- package/package.json +1 -1
- package/scripts/browser-observe-cycle.ts +76 -2
- package/scripts/ci-typecheck-changed.ts +119 -7
- package/scripts/coord-msg-bridge.ts +209 -0
- package/scripts/coord-post.sh +40 -7
- package/scripts/coord-requests-bridge.ts +10 -5
- package/scripts/detect-test-interference.ts +31 -1
- package/scripts/expose-rubric-suggest.ts +1 -1
- package/scripts/measure-tsc-affected-roots.ts +10 -1
- package/scripts/release-loop/docs-node.ts +51 -22
- package/scripts/release-loop/export-check-node.ts +8 -5
- package/scripts/release-loop/gate-node.ts +37 -4
- package/scripts/release-loop/node-verdict.ts +10 -3
- package/scripts/release-loop/publish-node.ts +3 -0
- package/scripts/release-loop/tui-node-checks.ts +5 -2
- package/scripts/skills/public-check.ts +5 -2
- package/scripts/test-deterministic.ts +520 -37
- package/scripts/ux-sim.ts +7 -1
- package/scripts/verify-kpack6-live.ts +230 -0
- package/src/acp/codex-plugins.ts +17 -0
- package/src/agent/task-notification.ts +32 -2
- package/src/agent-mission/in-agent-plugin.ts +8 -3
- package/src/agent-substrate/review-observation.ts +9 -2
- package/src/agent-substrate/self-review-cli.ts +62 -16
- package/src/boot/daemon-tools/self-implement.ts +72 -4
- package/src/briefing/brief-items.ts +151 -35
- package/src/budget/llm-cost.ts +30 -3
- package/src/budget/usage-outcomes.ts +32 -0
- package/src/claims/claims-ledger.ts +23 -0
- package/src/claims/claims-render.ts +22 -2
- package/src/cli/brief-cli.ts +131 -10
- package/src/cli/claims-cli.ts +24 -4
- package/src/cli/control-cli.ts +29 -0
- package/src/cli/doctor-cli.ts +90 -8
- package/src/cli/msg-cli.ts +177 -11
- package/src/cli/plugin-cli.ts +11 -3
- package/src/cli/pr-cli.ts +133 -18
- package/src/cli/pr-land-overlap-evidence.ts +18 -10
- package/src/cli/pr-land-refusal.ts +20 -0
- package/src/cli/release-cli.ts +34 -5
- package/src/cli/rfc-cli.ts +24 -0
- package/src/cli/seat-cli.ts +121 -0
- package/src/cli/self-utterances-cli.ts +140 -0
- package/src/cli/tailscale-serve.ts +5 -8
- package/src/cli/tasks-cli.ts +528 -31
- package/src/cli/usage-cli.ts +9 -4
- package/src/context-card/cell.ts +40 -0
- package/src/dashboard/boot-timing.ts +35 -0
- package/src/dashboard/first-screen-band.ts +63 -13
- package/src/dashboard/index.ts +94 -27
- package/src/dashboard/input/chat-main-plain-turn-runtime.ts +26 -0
- package/src/dashboard/skill-detection-runtime.ts +24 -4
- package/src/dashboard/slash-runtime/dashboard-handlers.ts +6 -0
- package/src/debug/log.ts +1 -1
- package/src/domains/morning-report.ts +3 -1
- package/src/domains/release-tool.ts +29 -12
- package/src/domains/surface-events.ts +16 -0
- package/src/elanous-config-dir.ts +2 -2
- package/src/fleet/host-doctor.ts +73 -2
- package/src/github/pr-labels.ts +10 -4
- package/src/graph-runner/runner.ts +104 -15
- package/src/harness/harness-clean.ts +21 -3
- package/src/harness/harness-cli-command.ts +68 -10
- package/src/harness/harness-pod-dispatch.ts +11 -4
- package/src/harness/harness-stop.ts +11 -7
- package/src/hq/seats.ts +17 -3
- package/src/index.ts +69 -9
- package/src/instance/current.ts +2 -6
- package/src/instance/resolve.ts +5 -6
- package/src/intelligence-map/model-bench-scores.ts +102 -0
- package/src/llm/openai-sampling-fields.ts +89 -0
- package/src/llm/runtime-model-family.ts +61 -0
- package/src/llm/zai-coding-plan.ts +27 -1
- package/src/llm.ts +13 -89
- package/src/loops/orchestrator/inbox.ts +73 -0
- package/src/loops/orchestrator/resync-shadow.ts +100 -12
- package/src/loops/orchestrator/tick.ts +73 -2
- package/src/machines/machine-ledger.ts +31 -3
- package/src/maturity/cli-maturity.ts +13 -3
- package/src/maturity/feature-maturity.ts +1 -1
- package/src/msg/msg-sse-server.ts +141 -0
- package/src/msg/msg-store.ts +149 -17
- package/src/ops/overview-collect.ts +3 -2
- package/src/ops/overview-owner.ts +29 -0
- package/src/patents/ledger.ts +128 -0
- package/src/plugin-hooks/shell-hook.ts +17 -2
- package/src/plugin-missions/evaluator-runner.ts +18 -2
- package/src/plugins/install/market-fetch.ts +32 -1
- package/src/plugins/install/plugin-install.ts +11 -1
- package/src/pod-lease/admission.ts +116 -41
- package/src/prompt-enhance/enhance.ts +11 -0
- package/src/release-loop/checklist.ts +52 -4
- package/src/release-loop/feature-store.ts +10 -9
- package/src/release-loop/merged-pr-checklist.ts +24 -5
- package/src/release-loop/rubric.ts +70 -0
- package/src/rfc-registry/registry.ts +88 -0
- package/src/seat-dispatch/seat-request-ledger.ts +4 -0
- package/src/seat-loop/knowhow-lint.ts +233 -0
- package/src/seat-loop/seat-loop.ts +5 -1
- package/src/seat-loop/seat-pack.ts +16 -4
- package/src/seat-loop/traffic-signal.ts +7 -0
- package/src/self-dev/ask-launch-flow.ts +48 -8
- package/src/self-dev/ask-path-candidates.ts +69 -14
- package/src/self-dev/decompose-proposal.ts +43 -1
- package/src/self-dev/draft-sweep.ts +23 -14
- package/src/self-dev/graph-journey-nodes.ts +2 -0
- package/src/self-dev/launch-preflight-text.ts +5 -1
- package/src/self-dev/launch-preflight.ts +143 -10
- package/src/self-dev/orchestrate.ts +6 -2
- package/src/self-dev/run-supervisor.ts +35 -1
- package/src/self-implement/gate-cli.ts +6 -2
- package/src/self-implement/goal-author.ts +5 -28
- package/src/self-implement/goal-command-execution.ts +26 -0
- package/src/self-implement/goal-new-paths.ts +4 -5
- package/src/self-implement/graph-authority.ts +17 -3
- package/src/self-implement/graph-yaml.ts +15 -7
- package/src/self-implement/headless-elanous-driver.ts +16 -1
- package/src/self-implement/host-regate.ts +44 -9
- package/src/self-implement/orchestrator.ts +5 -11
- package/src/self-implement/pwa-import-graph.ts +194 -7
- package/src/self-implement/rework-policy.ts +80 -2
- package/src/self-implement/self-implement-runtime.ts +126 -21
- package/src/self-implement/speed-claims.ts +145 -6
- package/src/session/index.ts +14 -4
- package/src/session-runtime/index.ts +55 -11
- package/src/skills/tools/persistent-grounding.ts +59 -4
- package/src/skills/tools/shell.ts +79 -1
- package/src/steward/rejudge-tick.ts +12 -1
- package/src/steward/release-day.ts +158 -0
- package/src/steward/resync-tick.ts +123 -0
- package/src/task-agent/actions.ts +1 -0
- package/src/task-agent/adopt-pr.ts +140 -0
- package/src/task-agent/board.ts +11 -1
- package/src/task-agent/card-evidence.ts +37 -5
- package/src/task-agent/cover.ts +105 -19
- package/src/task-agent/failure-notify.ts +61 -0
- package/src/task-agent/green-sweep.ts +170 -0
- package/src/task-agent/land-worktree.ts +52 -5
- package/src/task-agent/live-move-history.ts +1 -0
- package/src/task-agent/live-moves.ts +56 -17
- package/src/task-agent/parent-host.ts +1 -1
- package/src/task-agent/postland-card.ts +139 -0
- package/src/task-agent/rejudge-on-head.ts +321 -25
- package/src/task-agent/remote-rejudge-bind.ts +62 -0
- package/src/task-agent/repair-branch-cas.ts +182 -0
- package/src/task-agent/repair-cycle.ts +275 -0
- package/src/task-agent/repair-next-move.ts +31 -0
- package/src/task-agent/repair-review.ts +24 -0
- package/src/task-agent/repair-worker.ts +87 -0
- package/src/task-agent/review-result-capture.ts +66 -2
- package/src/task-agent/shadow.ts +150 -29
- package/src/task-agent/task-hand.ts +133 -8
- package/src/task-orchestrator/surfaces/pod-repair-commit.ts +96 -0
- package/src/task-orchestrator/surfaces/self-implement-pod.ts +71 -12
- package/src/telegram.ts +30 -1
- package/src/tool-runtime/tool-search-runtime.ts +25 -0
- package/src/tui.ts +20 -1
- package/src/user-config.ts +11 -60
- package/src/ux-sim/fault-sqlite-busy.ts +50 -0
- package/src/version/packed-revision.json +1 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-9360b1285b2a346e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-f08f6529d09ffae1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-f000d54d258f9ef6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/page-22f674e7e4c2c9d5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-8888733e40cea6d1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/page-9717ec6964b92276.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/consult/page-44eaad486bc98a45.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-97fa6cf3d34c7eb9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-35e05d7450461a67.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-b2638013c0bf7dfd.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/layout-c44f93a41167536f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/loops/page-1b810474507f3702.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-74366ae2693a7d95.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-4e634c5b98fd4e93.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-ed3070d637850548.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-b9cc8a10bc6078b4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-128458c8d86fbb5f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/page-cf0c2b0183991d09.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-b008aff96be56654.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-814394dcbae789b1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/term/page-6a87325c87f09dd2.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/trace/page-852170303c6cd755.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/page-087ceeb975ef272b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-97c7361cc2a19319.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-8c6901833f897496.js +0 -1
- /package/apps/pwa/out/_next/static/{dRS6lEhSRRBr1abbzp7fJ → y1ltt7oCZxVpC6zVPhZ2O}/_buildManifest.js +0 -0
- /package/apps/pwa/out/_next/static/{dRS6lEhSRRBr1abbzp7fJ → y1ltt7oCZxVpC6zVPhZ2O}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3141],{8772:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>I});var n=a(77194),r=a(49954),l=a(59917),s=a(93708),i=a(97514),o=a(6896),d=a(50475),c=a(13083),u=a(9094),x=a(73158),m=a(68969),h=a(35083);let p={PLAN:"text-sky-600 dark:text-sky-400",ROUTE:"text-violet-600 dark:text-violet-400",VERIFY:"text-amber-600 dark:text-amber-400",HEAL:"text-emerald-600 dark:text-emerald-400",ESCALATE:"text-rose-600 dark:text-rose-400",SHIP:"text-green-700 dark:text-green-400 font-semibold"};function g(e){let{board:t,lines:a,mode:r,onSelectRun:l,selectedRunId:s,role:i="owner"}=e,o="max"===r,d="owner"===i,u=t.gauges,{snapshot:x}=t,m=d?0:t.stream.filter(e=>null!=e.why&&(0,c.Yu)(e.why)).length;return(0,n.jsxs)("div",{className:(0,h.cn)("space-y-4",o&&"live-max"),"data-live-mode":r,children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,n.jsx)(v,{label:"LIVE",hint:"도는 런",value:String(u.live),tone:u.live>0?"live":"idle",max:o}),(0,n.jsx)(v,{label:"DECISIONS/MIN",hint:"판단 ".concat(u.decisions,"건"),value:String(u.decisionsPerMin),max:o}),(0,n.jsx)(v,{label:"SHIPPED",hint:"병합\xb7PR",value:String(u.shipped),tone:"ok",max:o}),(0,n.jsx)(v,{label:"SELF-HEAL",hint:u.selfHealRuns?"수리 런 ".concat(u.selfHealRuns):"수리 런 없음",value:null===u.selfHealRate?"—":"".concat(u.selfHealRate,"%"),max:o}),(0,n.jsx)(v,{label:"BURN",hint:"토큰/분",value:f(u.burnTokensPerMin),max:o}),(0,n.jsx)(v,{label:"BLOCKED",hint:"막힌 런",value:String(x.counters.blocked),tone:x.counters.blocked?"bad":"idle",max:o})]}),(0,n.jsxs)("section",{className:"space-y-2","aria-label":"런",children:[(0,n.jsxs)("h2",{className:"text-sm font-medium",children:["런 ",(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["최근 ",x.windowMinutes,"분 \xb7 ",x.runs.length]})]}),0===x.runs.length?(0,n.jsx)("p",{className:"rounded-md border border-dashed p-4 text-sm text-muted-foreground","data-live-empty":!0,children:"지금 이 창에 런 신호가 없습니다 — 텔레그램이나 Intake 로 한 줄 보내면 여기에 런이 뜹니다."}):(0,n.jsx)("ul",{className:"space-y-1.5",children:x.runs.slice(0,12).map(e=>(0,n.jsx)(b,{run:e,round:t.rounds[e.runId],max:o,selected:e.runId===s,onSelect:l,owner:d},e.runId))})]}),(0,n.jsxs)("div",{className:"grid gap-4 lg:grid-cols-5",children:[(0,n.jsxs)("section",{className:"space-y-2 lg:col-span-3","aria-label":"판단 스트림",children:[(0,n.jsxs)("h2",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:["판단 스트림",c.jg.map(e=>(0,n.jsx)("span",{className:(0,h.cn)("text-[11px] lg:text-[10px] font-mono",p[e]),children:e},e))]}),0===t.stream.length?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"이 창에 판단 신호가 없습니다."}):(0,n.jsx)("ul",{className:"max-h-80 space-y-1 overflow-auto rounded-md border p-2 font-mono text-[11px]","data-live-stream":!0,children:t.stream.slice(0,40).map((e,t)=>(0,n.jsxs)("li",{className:(0,h.cn)("leading-relaxed",o&&0===t&&"live-line-in",o&&"SHIP"===e.kind&&"live-ship"),children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[(0,n.jsx)("span",{title:e.ts,children:(0,c.qo)(e.ts)})," "]}),(0,n.jsxs)("span",{className:p[e.kind],children:["[",e.kind,"]"]})," ",d?e.what:(0,c.hS)(e.what.replace(/run-[0-9a-f]{8}-[^\s]*/gi,""),i),e.why&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xb7 왜: ",(0,c.hS)(e.why,i)]}),e.purpose&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xb7 목적: ",e.purpose]}),e.target&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" → ",e.target]})]},"".concat(e.ts,"-").concat(t)))})]}),(0,n.jsxs)("section",{className:"space-y-2 lg:col-span-2","aria-label":"성적표",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"모델 성적표"}),0===t.scorecard.length?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"이 창에 모델 요청이 없습니다."}):(0,n.jsxs)("table",{className:"w-full text-[11px]",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-muted-foreground",children:[(0,n.jsx)("th",{className:"text-left font-normal",children:"모델"}),(0,n.jsx)("th",{className:"text-right font-normal",children:"요청"}),(0,n.jsx)("th",{className:"text-right font-normal",children:"토큰"}),(0,n.jsx)("th",{className:"text-right font-normal",children:"과금"})]})}),(0,n.jsx)("tbody",{children:t.scorecard.slice(0,8).map(e=>{var t;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"truncate",children:e.model}),(0,n.jsx)("td",{className:"text-right tabular-nums",children:e.requests}),(0,n.jsx)("td",{className:"text-right tabular-nums",children:f(e.tokens)}),(0,n.jsx)("td",{className:"text-right text-muted-foreground",children:null!=(t=e.billing)?t:"—"})]},e.model)})})]}),(0,n.jsx)("h2",{className:"pt-2 text-sm font-medium",children:"리뷰 판정"}),(0,n.jsx)(j,{items:x.reviewVerdicts,max:o})]})]}),(0,n.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[d?(0,n.jsxs)("section",{className:"space-y-2","aria-label":"흐르는 로그",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"흐르는 로그"}),(0,n.jsx)("pre",{className:"max-h-60 overflow-auto rounded-md border bg-muted/30 p-2 text-[11px] leading-relaxed","data-live-log":!0,children:a.slice(0,60).join("\n")||"—"})]}):m>0?(0,n.jsxs)("p",{className:"text-xs text-muted-foreground","data-live-folded-errors":!0,children:["오류 ",m,"건 접힘"]}):null,(0,n.jsxs)("section",{className:"space-y-2","aria-label":"빈 칸 표",children:[(0,n.jsxs)("h2",{className:"text-sm font-medium",children:["빈 칸 표 ",(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"판단 로그에 없는 칸"})]}),0===t.missing.length?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"빈 칸 없음."}):(0,n.jsx)("table",{className:"w-full text-[11px]","data-live-missing":!0,children:(0,n.jsx)("tbody",{children:t.missing.slice(0,10).map(e=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"font-mono",children:e.key}),(0,n.jsx)("td",{className:"text-right tabular-nums",children:e.count}),(0,n.jsx)("td",{className:"pl-2 text-muted-foreground",children:e.lacks.join(" \xb7 ")})]},e.key))})})]})]})]})}function f(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(e>=1e5?0:1),"k"):String(e)}function v(e){let{label:t,hint:a,value:r,tone:l="idle",max:s}=e;return(0,n.jsxs)("div",{className:(0,h.cn)("rounded-lg border p-3","live"===l&&"border-primary/50","bad"===l&&"border-error/50","ok"===l&&"border-green-600/40",s&&"live-gauge",s&&"live"===l&&"live-glow"),children:[(0,n.jsx)("div",{className:"font-mono text-[11px] lg:text-[10px] tracking-wider text-muted-foreground",children:t}),(0,n.jsx)("div",{className:(0,h.cn)("text-2xl font-semibold tabular-nums",s&&"live-count"),"data-live-gauge":t,children:r}),(0,n.jsx)("div",{className:"text-[11px] lg:text-[10px] text-muted-foreground",children:a})]})}function b(e){let{run:t,round:a,max:r,selected:l,onSelect:s,owner:i}=e;return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-live-run":t.runId,onClick:()=>null==s?void 0:s(t.runId),className:(0,h.cn)("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-xs hover:bg-muted/40",l&&"ring-1 ring-primary"),children:[(0,n.jsx)("span",{className:"w-24 shrink-0 truncate font-mono text-[11px] text-muted-foreground",children:i?t.runId.replace(/^run-/,"").slice(0,8):"런"}),(0,n.jsx)("span",{className:"flex flex-1 gap-1","aria-label":"단계",children:c.lV.map(e=>{let a=t.stages[e],l=t.current===e;return(0,n.jsx)("span",{title:"".concat(c.fQ[e]," \xb7 ").concat(null!=a?a:"신호 없음"),"data-stage":e,"data-tone":null!=a?a:"none",className:(0,h.cn)("h-2 flex-1 rounded-full bg-muted","info"===a&&"bg-primary/60","ok"===a&&"bg-green-600","bad"===a&&"bg-error",r&&l&&"bad"!==a&&"live-pulse",r&&l&&"bad"===a&&"live-pulse-bad")},e)})}),(0,n.jsx)("span",{className:"w-14 shrink-0 text-right font-mono text-[11px] lg:text-[10px] text-muted-foreground",children:a?"R ".concat(a,"/3"):""}),(0,n.jsx)("span",{className:"w-24 shrink-0 text-right text-[11px]",children:t.blocked?(0,n.jsx)("span",{className:"text-error",children:"막힘"}):"ok"===t.stages.land?(0,n.jsxs)("span",{className:"text-green-700",children:["착지",t.pr?" #".concat(t.pr):""]}):t.current?c.fQ[t.current]:""})]})})}function j(e){let{items:t,max:a}=e,r=Math.max(1,...t.map(e=>e.count));return 0===t.length?(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground",children:"—"}):(0,n.jsx)("ul",{className:"space-y-1",children:t.slice(0,6).map(e=>(0,n.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,n.jsx)("span",{className:"w-24 shrink-0 truncate",children:e.name}),(0,n.jsx)("span",{className:"h-1.5 flex-1 rounded-full bg-muted",children:(0,n.jsx)("span",{className:(0,h.cn)("block h-1.5 rounded-full bg-primary/70",a&&"transition-[width] duration-700"),style:{width:"".concat(e.count/r*100,"%")}})}),(0,n.jsx)("span",{className:"w-8 text-right tabular-nums",children:e.count})]},e.name))})}var N=a(31352),w=a(17996);let y=[15,60,360,1440],k="@active";function S(){return(0,o.Qj)()?(0,n.jsx)(E,{}):(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:"Live"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to watch runs live."})]})}function E(){var e,t,a,h,p,f;let v=(0,m.In)(),[b,j]=(0,r.useState)("practical"),[S,E]=(0,r.useState)(null),[I,C]=(0,r.useState)("all"),[L,R]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{window.localStorage.removeItem("elanous.live.mode")}catch(e){}},[]),(0,r.useEffect)(()=>{if(!S)return;let e=setTimeout(()=>{j("practical"),E(null)},Math.max(0,S-Date.now()));return()=>clearTimeout(e)},[S]);let H=(0,o.M1)(),[D,P]=(0,r.useState)(null),X=e=>{e.on?(j("max"),C(e.scope&&"all"!==e.scope?"run":"all"),E(e.until?Date.parse(e.until):Date.now()+18e5)):(j("practical"),E(null))};(0,r.useEffect)(()=>{let e=!0;return H.getLiveDetail().then(t=>{e&&X(t)}).catch(()=>{}),()=>{e=!1}},[H]);let q=e=>{R(!1),P(null);let t="run"===e&&z?z:"all";H.setLiveDetail({scope:t,ttlMin:30,by:"pwa-live"}).then(X).catch(e=>P(e instanceof Error?e.message:String(e)))},[O,U]=(0,r.useState)(60),[_,B]=(0,r.useState)(""),T=(0,r.useRef)(!1);(0,r.useEffect)(()=>{"max"!==b||T.current||(T.current=!0,B(k),U(1440)),"max"!==b&&(T.current=!1)},[b]);let[z,F]=(0,r.useState)(null),{logs:W,runs:K,instances:V}=(0,d.HI)({store:_||void 0,windowMinutes:O}),[Q,Y]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{Y(Date.now())},[W.dataUpdatedAt]);let[Z,G]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"public"===new URLSearchParams(window.location.search).get("capture")&&G(!0)},[]);let $=null!=(h=null==(e=W.data)?void 0:e.logs)?h:M,J=(0,r.useMemo)(()=>Z?(0,x.yR)($):$,[$,Z]),ee=(0,l.I)({queryKey:["live","shipped",O],queryFn:()=>H.getLiveShipped("".concat(O,"m")),refetchInterval:6e4}),et=(0,r.useMemo)(()=>{var e,t,a;let n=(0,c.Hc)(J,null!=(a=null==(e=K.data)?void 0:e.entries)?a:[],{now:Q,windowMinutes:O}),r=null==(t=ee.data)?void 0:t.merged;if("number"!=typeof r)return n;let l=(0,u.NZ)(J).length;return{...n,gauges:{...n.gauges,shipped:r,selfHealRuns:l,selfHealRate:r>0?Math.round(l/r*100):null}}},[J,K.data,Q,O,ee.data]),ea=O>0?Math.round(J.length/O*10)/10:0,en=Math.round(JSON.stringify(J).length/1024),er=(0,r.useMemo)(()=>J.filter(e=>{var t;return!z||(null==(t=e.data)?void 0:t.runId)===z}).map(e=>(0,c.BP)(e)),[J,z]),el=(null!=(p=null==(t=V.data)?void 0:t.instances)?p:[]).filter(e=>!1!==e.dbExists&&!e.current);return(0,n.jsxs)("div",{className:"mx-auto ".concat("max"===b?"max-w-none space-y-2 p-2":"max-w-6xl space-y-4 p-4 sm:p-6"),children:[(0,n.jsx)("style",{children:A}),(0,n.jsxs)("header",{className:"flex flex-wrap items-center gap-3 ".concat("max"===b?"justify-end":"justify-between"),children:[(0,n.jsxs)("div",{className:"max"===b?"hidden":"",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(s.A,{className:"h-5 w-5","aria-hidden":!0})," Live"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"하니스 런이 판단하고 기획하는 신호 — 보이는 수는 전부 진짜다."})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,n.jsx)("select",{"aria-label":"시간 창",value:O,onChange:e=>U(Number(e.target.value)),className:"rounded-md border bg-background px-2 py-1",children:y.map(e=>(0,n.jsx)("option",{value:e,children:e<60?"".concat(e,"분"):"".concat(e/60,"시간")},e))}),(0,n.jsxs)("select",{"aria-label":"신호 출처",value:_,onChange:e=>B(e.target.value),className:"max-w-48 rounded-md border bg-background px-2 py-1",children:[(0,n.jsx)("option",{value:"",children:"이 인스턴스"}),(0,n.jsx)("option",{value:k,children:"전체(연합 \xb7 최근 24시간에 쓰인 우주)"}),el.map(e=>(0,n.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,n.jsx)("button",{type:"button","data-elanous-action":"live-public-capture","aria-pressed":Z,onClick:()=>G(e=>!e),title:"녹화\xb7스크린샷용 — 계정 이름 → account-N \xb7 크레딧\xb7USD 숨김 \xb7 홈 경로 가림",className:"rounded-md border px-2 py-1 ".concat(Z?"border-emerald-500 text-emerald-600 dark:text-emerald-300":"hover:bg-muted"),children:Z?"● 공개 캡처 켜짐":"공개 캡처"}),"max"===b?(0,n.jsxs)("button",{type:"button","data-elanous-action":"live-max-off",onClick:()=>{P(null),H.setLiveDetail({scope:"all",ttlMin:0,by:"pwa-live"}).then(X).catch(e=>P(e instanceof Error?e.message:String(e))),j("practical"),E(null)},className:"inline-flex items-center gap-1 rounded-md border border-primary px-2 py-1 text-primary hover:bg-muted",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0})," 화려함 MAX 켜짐 \xb7 끄기"]}):(0,n.jsxs)("button",{type:"button","data-elanous-action":"live-max-on",onClick:()=>R(!0),className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 hover:bg-muted",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0})," 화려함 MAX"]})]})]}),L&&(0,n.jsxs)("div",{role:"dialog","aria-label":"화려함 MAX 켜기",className:"space-y-2 rounded-md border border-primary/50 bg-primary/5 p-3 text-sm","data-live-max-confirm":!0,children:[(0,n.jsx)("p",{className:"font-medium",children:"화려함 MAX 를 켤까요?"}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["마케팅(시연\xb7녹화)과 상세 런 디버깅용입니다. 켜면 하니스가 판단마다 \xab왜\xb7목적\xb7보낸 곳\xbb을 추가로 기록합니다(부하가 듭니다) — 30분 뒤 자동으로 꺼지고, 다른 기기에서도 같은 상태로 보입니다. 지금 이 화면이 받는 신호: 분당 ",ea,"건 \xb7 응답 약 ",en,"KB."]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,n.jsx)("button",{type:"button","data-elanous-action":"live-max-all",onClick:()=>q("all"),className:"rounded-md border px-2 py-1 hover:bg-muted",children:"전체로 켜기"}),(0,n.jsx)("button",{type:"button","data-elanous-action":"live-max-run",disabled:!z,onClick:()=>q("run"),className:"rounded-md border px-2 py-1 hover:bg-muted disabled:opacity-50",children:z?"이 런만 켜기":"이 런만 켜기(먼저 런을 고르세요)"}),(0,n.jsx)("button",{type:"button",onClick:()=>R(!1),className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-muted",children:"취소"})]})]}),D&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-xs text-error",children:["MAX 스위치를 못 바꿨다: ",D]}),"max"===b&&(0,n.jsxs)("p",{className:"rounded-md border border-primary/40 px-3 py-1 text-[11px] lg:text-[10px] text-muted-foreground","data-live-cost-badge":!0,children:["화려함 MAX \xb7 범위 ","run"===I&&z?"런 ".concat(z.replace(/^run-/,"").slice(0,8)):"전체"," \xb7 받는 신호 분당 ",ea,"건 \xb7 응답 약 ",en,"KB",S?" \xb7 ".concat(Math.max(0,Math.round((S-Q)/6e4)),"분 뒤 자동 꺼짐"):""," \xb7 하니스 판단 이벤트 ",et.emitted,"건"]}),W.error?(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["신호를 못 읽었다: ",W.error instanceof Error?W.error.message:String(W.error)]}):null,z&&(0,n.jsx)(w.RT,{runId:z,run:null!=(f=et.snapshot.runs.find(e=>e.runId===z))?f:null,lines:er,onClose:()=>F(null)}),"max"===b?(0,n.jsx)(N.xl,{board:et,rows:J,windowMinutes:O,sourceLabel:_===k?"federated":_||"this instance",shippedSource:"number"==typeof(null==(a=ee.data)?void 0:a.merged)?"github":"log",publicCapture:Z,role:v,onSelectRun:e=>F(t=>t===e?null:e)}):(0,n.jsx)(g,{board:et,lines:er,mode:b,role:v,selectedRunId:z,onSelectRun:e=>F(t=>t===e?null:e)}),(0,n.jsxs)("p",{className:"text-[11px] text-muted-foreground ".concat("max"===b?"hidden":""),children:["갱신 5초 \xb7 출처 ",(0,n.jsx)("code",{children:"/v1/logs"})," \xb7 ",(0,n.jsx)("code",{children:"/v1/harness/runs"})," \xb7 비밀처럼 보이는 조각은 가린다."]})]})}let M=[],A="\n@keyframes live-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(99,102,241,0) } 50% { opacity: .55; box-shadow: 0 0 10px 2px rgba(99,102,241,.55) } }\n@keyframes live-pulse-bad { 0%,100% { opacity: 1 } 50% { opacity: .4; box-shadow: 0 0 10px 2px rgba(239,68,68,.6) } }\n@keyframes live-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,0) } 50% { box-shadow: 0 0 18px 2px rgba(99,102,241,.35) } }\n@keyframes live-line-in { from { transform: translateY(-6px); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes live-ship { 0% { background: rgba(34,197,94,.35) } 100% { background: transparent } }\n.live-max .live-pulse { animation: live-pulse 1.4s ease-in-out infinite }\n.live-max .live-pulse-bad { animation: live-pulse-bad 1s ease-in-out infinite }\n.live-max .live-glow { animation: live-glow 2.4s ease-in-out infinite }\n.live-max .live-line-in { animation: live-line-in .45s ease-out }\n.live-max .live-ship { animation: live-ship 2.4s ease-out; font-size: 12px }\n.live-max .live-gauge { background: radial-gradient(120% 120% at 0% 0%, rgba(99,102,241,.10), transparent 60%) }\n.live-max .live-count { text-shadow: 0 0 12px rgba(99,102,241,.45) }\n.live-stage { background: radial-gradient(120% 90% at 50% 0%, rgba(79,70,229,.25), rgba(2,6,23,.98) 60%), #020617; box-shadow: inset 0 0 0 1px rgba(99,102,241,.25) }\n.live-stage .live-line-in { animation: live-line-in .45s ease-out }\n@keyframes live-v5-marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }\n@keyframes live-v5-blink { 0%,100% { opacity: 1 } 50% { opacity: .45 } }\n@keyframes live-v5-hot { 0%,100% { box-shadow: 0 0 14px #a78bfa55, inset 0 0 14px #a78bfa22 } 50% { box-shadow: 0 0 26px #a78bfa99, inset 0 0 22px #a78bfa44 } }\n.live-v5-marquee { animation: live-v5-marquee linear infinite }\n.live-v5-blink { animation: live-v5-blink 1.6s ease-in-out infinite }\n.live-v5-hot { animation: live-v5-hot 1.8s ease-in-out infinite }\n@media (prefers-reduced-motion: reduce) { .live-max *, .live-v5 * { animation: none !important; transition: none !important } }\n";function I(){return(0,n.jsx)(S,{})}},21827:(e,t,a)=>{Promise.resolve().then(a.bind(a,8772))},30728:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(49954);let r=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()},l=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 s={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 i=(0,n.createContext)({}),o=(0,n.forwardRef)((e,t)=>{var a,l,o;let{color:d,size:c,strokeWidth:u,absoluteStrokeWidth:x,className:m="",children:h,iconNode:p,...g}=e,{size:f=24,strokeWidth:v=2,absoluteStrokeWidth:b=!1,color:j="currentColor",className:N=""}=null!=(a=(0,n.useContext)(i))?a:{},w=(null!=x?x:b)?24*Number(null!=u?u:v)/Number(null!=c?c:f):null!=u?u:v;return(0,n.createElement)("svg",{ref:t,...s,width:null!=(l=null!=c?c:f)?l:s.width,height:null!=(o=null!=c?c:f)?o:s.height,stroke:null!=d?d:j,strokeWidth:w,className:r("lucide",N,m),...!h&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(g)&&{"aria-hidden":"true"},...g},[...p.map(e=>{let[t,a]=e;return(0,n.createElement)(t,a)}),...Array.isArray(h)?h:[h]])}),d=(e,t)=>{let a=(0,n.forwardRef)((a,s)=>{let{className:i,...d}=a;return(0,n.createElement)(o,{ref:s,iconNode:t,className:r("lucide-".concat(l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),i),...d})});return a.displayName=l(e),a}},68969:(e,t,a)=>{"use strict";a.d(t,{GC:()=>r,In:()=>d,OG:()=>i});var n=a(49954);let r="elanous.pwa.role",l="elanous:pwa-role";function s(){try{let e=window.localStorage.getItem(r);if("owner"===e||"contributor"===e||"general"===e)return e}catch(e){}return"general"}function i(e){try{window.localStorage.setItem(r,e)}catch(e){}"function"==typeof window.dispatchEvent&&window.dispatchEvent(new Event(l))}function o(e){if("function"!=typeof window.addEventListener)return()=>{};window.addEventListener(l,e);let t=t=>{(t.key===r||null===t.key)&&e()};return window.addEventListener("storage",t),()=>{window.removeEventListener(l,e),window.removeEventListener("storage",t)}}function d(){return(0,n.useSyncExternalStore)(o,s,()=>"general")}},93708:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(30728).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},97514:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(30728).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])}},e=>{e.O(0,[8085,2566,4862,9917,7274,2201,6356,7358],()=>e(e.s=21827)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3141],{8772:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>I});var n=a(77194),r=a(49954),l=a(59917),s=a(93708),i=a(97514),o=a(6896),d=a(50475),c=a(13083),u=a(9094),x=a(73158),m=a(68969),h=a(35083);let p={PLAN:"text-sky-600 dark:text-sky-400",ROUTE:"text-violet-600 dark:text-violet-400",VERIFY:"text-amber-600 dark:text-amber-400",HEAL:"text-emerald-600 dark:text-emerald-400",ESCALATE:"text-rose-600 dark:text-rose-400",SHIP:"text-green-700 dark:text-green-400 font-semibold"};function g(e){let{board:t,lines:a,mode:r,onSelectRun:l,selectedRunId:s,role:i="owner"}=e,o="max"===r,d="owner"===i,u=t.gauges,{snapshot:x}=t,m=d?0:t.stream.filter(e=>null!=e.why&&(0,c.Yu)(e.why)).length;return(0,n.jsxs)("div",{className:(0,h.cn)("space-y-4",o&&"live-max"),"data-live-mode":r,children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-6",children:[(0,n.jsx)(v,{label:"LIVE",hint:"도는 런",value:String(u.live),tone:u.live>0?"live":"idle",max:o}),(0,n.jsx)(v,{label:"DECISIONS/MIN",hint:"판단 ".concat(u.decisions,"건"),value:String(u.decisionsPerMin),max:o}),(0,n.jsx)(v,{label:"SHIPPED",hint:"병합\xb7PR",value:String(u.shipped),tone:"ok",max:o}),(0,n.jsx)(v,{label:"SELF-HEAL",hint:u.selfHealRuns?"수리 런 ".concat(u.selfHealRuns):"수리 런 없음",value:null===u.selfHealRate?"—":"".concat(u.selfHealRate,"%"),max:o}),(0,n.jsx)(v,{label:"BURN",hint:"토큰/분",value:f(u.burnTokensPerMin),max:o}),(0,n.jsx)(v,{label:"BLOCKED",hint:"막힌 런",value:String(x.counters.blocked),tone:x.counters.blocked?"bad":"idle",max:o})]}),(0,n.jsxs)("section",{className:"space-y-2","aria-label":"런",children:[(0,n.jsxs)("h2",{className:"text-sm font-medium",children:["런 ",(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["최근 ",x.windowMinutes,"분 \xb7 ",x.runs.length]})]}),0===x.runs.length?(0,n.jsx)("p",{className:"rounded-md border border-dashed p-4 text-sm text-muted-foreground","data-live-empty":!0,children:"지금 이 창에 런 신호가 없습니다 — 텔레그램이나 Intake 로 한 줄 보내면 여기에 런이 뜹니다."}):(0,n.jsx)("ul",{className:"space-y-1.5",children:x.runs.slice(0,12).map(e=>(0,n.jsx)(b,{run:e,round:t.rounds[e.runId],max:o,selected:e.runId===s,onSelect:l,owner:d},e.runId))})]}),(0,n.jsxs)("div",{className:"grid gap-4 lg:grid-cols-5",children:[(0,n.jsxs)("section",{className:"space-y-2 lg:col-span-3","aria-label":"판단 스트림",children:[(0,n.jsxs)("h2",{className:"flex flex-wrap items-center gap-2 text-sm font-medium",children:["판단 스트림",c.jg.map(e=>(0,n.jsx)("span",{className:(0,h.cn)("text-[11px] lg:text-[10px] font-mono",p[e]),children:e},e))]}),0===t.stream.length?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"이 창에 판단 신호가 없습니다."}):(0,n.jsx)("ul",{className:"max-h-80 space-y-1 overflow-auto rounded-md border p-2 font-mono text-[11px]","data-live-stream":!0,children:t.stream.slice(0,40).map((e,t)=>(0,n.jsxs)("li",{className:(0,h.cn)("leading-relaxed",o&&0===t&&"live-line-in",o&&"SHIP"===e.kind&&"live-ship"),children:[(0,n.jsxs)("span",{className:"text-muted-foreground",children:[(0,n.jsx)("span",{title:e.ts,children:(0,c.qo)(e.ts)})," "]}),(0,n.jsxs)("span",{className:p[e.kind],children:["[",e.kind,"]"]})," ",d?e.what:(0,c.hS)(e.what.replace(/run-[0-9a-f]{8}-[^\s]*/gi,""),i),e.why&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xb7 왜: ",(0,c.hS)(e.why,i)]}),e.purpose&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" \xb7 목적: ",e.purpose]}),e.target&&(0,n.jsxs)("span",{className:"text-muted-foreground",children:[" → ",e.target]})]},"".concat(e.ts,"-").concat(t)))})]}),(0,n.jsxs)("section",{className:"space-y-2 lg:col-span-2","aria-label":"성적표",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"모델 성적표"}),0===t.scorecard.length?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"이 창에 모델 요청이 없습니다."}):(0,n.jsxs)("table",{className:"w-full text-[11px]",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"text-muted-foreground",children:[(0,n.jsx)("th",{className:"text-left font-normal",children:"모델"}),(0,n.jsx)("th",{className:"text-right font-normal",children:"요청"}),(0,n.jsx)("th",{className:"text-right font-normal",children:"토큰"}),(0,n.jsx)("th",{className:"text-right font-normal",children:"과금"})]})}),(0,n.jsx)("tbody",{children:t.scorecard.slice(0,8).map(e=>{var t;return(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"truncate",children:e.model}),(0,n.jsx)("td",{className:"text-right tabular-nums",children:e.requests}),(0,n.jsx)("td",{className:"text-right tabular-nums",children:f(e.tokens)}),(0,n.jsx)("td",{className:"text-right text-muted-foreground",children:null!=(t=e.billing)?t:"—"})]},e.model)})})]}),(0,n.jsx)("h2",{className:"pt-2 text-sm font-medium",children:"리뷰 판정"}),(0,n.jsx)(j,{items:x.reviewVerdicts,max:o})]})]}),(0,n.jsxs)("div",{className:"grid gap-4 lg:grid-cols-2",children:[d?(0,n.jsxs)("section",{className:"space-y-2","aria-label":"흐르는 로그",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"흐르는 로그"}),(0,n.jsx)("pre",{className:"max-h-60 overflow-auto rounded-md border bg-muted/30 p-2 text-[11px] leading-relaxed","data-live-log":!0,children:a.slice(0,60).join("\n")||"—"})]}):m>0?(0,n.jsxs)("p",{className:"text-xs text-muted-foreground","data-live-folded-errors":!0,children:["오류 ",m,"건 접힘"]}):null,(0,n.jsxs)("section",{className:"space-y-2","aria-label":"빈 칸 표",children:[(0,n.jsxs)("h2",{className:"text-sm font-medium",children:["빈 칸 표 ",(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"판단 로그에 없는 칸"})]}),0===t.missing.length?(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"빈 칸 없음."}):(0,n.jsx)("table",{className:"w-full text-[11px]","data-live-missing":!0,children:(0,n.jsx)("tbody",{children:t.missing.slice(0,10).map(e=>(0,n.jsxs)("tr",{children:[(0,n.jsx)("td",{className:"font-mono",children:e.key}),(0,n.jsx)("td",{className:"text-right tabular-nums",children:e.count}),(0,n.jsx)("td",{className:"pl-2 text-muted-foreground",children:e.lacks.join(" \xb7 ")})]},e.key))})})]})]})]})}function f(e){return e>=1e6?"".concat((e/1e6).toFixed(1),"M"):e>=1e3?"".concat((e/1e3).toFixed(e>=1e5?0:1),"k"):String(e)}function v(e){let{label:t,hint:a,value:r,tone:l="idle",max:s}=e;return(0,n.jsxs)("div",{className:(0,h.cn)("rounded-lg border p-3","live"===l&&"border-primary/50","bad"===l&&"border-error/50","ok"===l&&"border-green-600/40",s&&"live-gauge",s&&"live"===l&&"live-glow"),children:[(0,n.jsx)("div",{className:"font-mono text-[11px] lg:text-[10px] tracking-wider text-muted-foreground",children:t}),(0,n.jsx)("div",{className:(0,h.cn)("text-2xl font-semibold tabular-nums",s&&"live-count"),"data-live-gauge":t,children:r}),(0,n.jsx)("div",{className:"text-[11px] lg:text-[10px] text-muted-foreground",children:a})]})}function b(e){let{run:t,round:a,max:r,selected:l,onSelect:s,owner:i}=e;return(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button","data-live-run":t.runId,onClick:()=>null==s?void 0:s(t.runId),className:(0,h.cn)("flex w-full items-center gap-3 rounded-md border px-3 py-2 text-left text-xs hover:bg-muted/40",l&&"ring-1 ring-primary"),children:[(0,n.jsx)("span",{className:"w-24 shrink-0 truncate font-mono text-[11px] text-muted-foreground",children:i?t.runId.replace(/^run-/,"").slice(0,8):"런"}),(0,n.jsx)("span",{className:"flex flex-1 gap-1","aria-label":"단계",children:c.lV.map(e=>{let a=t.stages[e],l=t.current===e;return(0,n.jsx)("span",{title:"".concat(c.fQ[e]," \xb7 ").concat(null!=a?a:"신호 없음"),"data-stage":e,"data-tone":null!=a?a:"none",className:(0,h.cn)("h-2 flex-1 rounded-full bg-muted","info"===a&&"bg-primary/60","ok"===a&&"bg-green-600","bad"===a&&"bg-error",r&&l&&"bad"!==a&&"live-pulse",r&&l&&"bad"===a&&"live-pulse-bad")},e)})}),(0,n.jsx)("span",{className:"w-14 shrink-0 text-right font-mono text-[11px] lg:text-[10px] text-muted-foreground",children:a?"R ".concat(a,"/3"):""}),(0,n.jsx)("span",{className:"w-24 shrink-0 text-right text-[11px]",children:t.blocked?(0,n.jsx)("span",{className:"text-error",children:"막힘"}):"ok"===t.stages.land?(0,n.jsxs)("span",{className:"text-green-700",children:["착지",t.pr?" #".concat(t.pr):""]}):t.current?c.fQ[t.current]:""})]})})}function j(e){let{items:t,max:a}=e,r=Math.max(1,...t.map(e=>e.count));return 0===t.length?(0,n.jsx)("div",{className:"text-[11px] text-muted-foreground",children:"—"}):(0,n.jsx)("ul",{className:"space-y-1",children:t.slice(0,6).map(e=>(0,n.jsxs)("li",{className:"flex items-center gap-2 text-[11px]",children:[(0,n.jsx)("span",{className:"w-24 shrink-0 truncate",children:e.name}),(0,n.jsx)("span",{className:"h-1.5 flex-1 rounded-full bg-muted",children:(0,n.jsx)("span",{className:(0,h.cn)("block h-1.5 rounded-full bg-primary/70",a&&"transition-[width] duration-700"),style:{width:"".concat(e.count/r*100,"%")}})}),(0,n.jsx)("span",{className:"w-8 text-right tabular-nums",children:e.count})]},e.name))})}var N=a(31352),w=a(17996);let y=[15,60,360,1440],k="@active";function S(){return(0,o.Qj)()?(0,n.jsx)(E,{}):(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:"Live"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to watch runs live."})]})}function E(){var e,t,a,h,p,f;let v=(0,m.In)(),[b,j]=(0,r.useState)("practical"),[S,E]=(0,r.useState)(null),[I,C]=(0,r.useState)("all"),[L,R]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{window.localStorage.removeItem("elanous.live.mode")}catch(e){}},[]),(0,r.useEffect)(()=>{if(!S)return;let e=setTimeout(()=>{j("practical"),E(null)},Math.max(0,S-Date.now()));return()=>clearTimeout(e)},[S]);let H=(0,o.M1)(),[D,P]=(0,r.useState)(null),X=e=>{e.on?(j("max"),C(e.scope&&"all"!==e.scope?"run":"all"),E(e.until?Date.parse(e.until):Date.now()+18e5)):(j("practical"),E(null))};(0,r.useEffect)(()=>{let e=!0;return H.getLiveDetail().then(t=>{e&&X(t)}).catch(()=>{}),()=>{e=!1}},[H]);let q=e=>{R(!1),P(null);let t="run"===e&&z?z:"all";H.setLiveDetail({scope:t,ttlMin:30,by:"pwa-live"}).then(X).catch(e=>P(e instanceof Error?e.message:String(e)))},[O,U]=(0,r.useState)(60),[_,B]=(0,r.useState)(""),T=(0,r.useRef)(!1);(0,r.useEffect)(()=>{"max"!==b||T.current||(T.current=!0,B(k),U(1440)),"max"!==b&&(T.current=!1)},[b]);let[z,F]=(0,r.useState)(null),{logs:W,runs:K,instances:V}=(0,d.HI)({store:_||void 0,windowMinutes:O}),[Q,Y]=(0,r.useState)(()=>Date.now());(0,r.useEffect)(()=>{Y(Date.now())},[W.dataUpdatedAt]);let[Z,G]=(0,r.useState)(!1);(0,r.useEffect)(()=>{"public"===new URLSearchParams(window.location.search).get("capture")&&G(!0)},[]);let $=null!=(h=null==(e=W.data)?void 0:e.logs)?h:M,J=(0,r.useMemo)(()=>Z?(0,x.yR)($):$,[$,Z]),ee=(0,l.I)({queryKey:["live","shipped",O],queryFn:()=>H.getLiveShipped("".concat(O,"m")),refetchInterval:6e4}),et=(0,r.useMemo)(()=>{var e,t,a;let n=(0,c.Hc)(J,null!=(a=null==(e=K.data)?void 0:e.entries)?a:[],{now:Q,windowMinutes:O}),r=null==(t=ee.data)?void 0:t.merged;if("number"!=typeof r)return n;let l=(0,u.NZ)(J).length;return{...n,gauges:{...n.gauges,shipped:r,selfHealRuns:l,selfHealRate:r>0?Math.round(l/r*100):null}}},[J,K.data,Q,O,ee.data]),ea=O>0?Math.round(J.length/O*10)/10:0,en=Math.round(JSON.stringify(J).length/1024),er=(0,r.useMemo)(()=>J.filter(e=>{var t;return!z||(null==(t=e.data)?void 0:t.runId)===z}).map(e=>(0,c.BP)(e)),[J,z]),el=(null!=(p=null==(t=V.data)?void 0:t.instances)?p:[]).filter(e=>!1!==e.dbExists&&!e.current);return(0,n.jsxs)("div",{className:"mx-auto ".concat("max"===b?"max-w-none space-y-2 p-2":"max-w-6xl space-y-4 p-4 sm:p-6"),children:[(0,n.jsx)("style",{children:A}),(0,n.jsxs)("header",{className:"flex flex-wrap items-center gap-3 ".concat("max"===b?"justify-end":"justify-between"),children:[(0,n.jsxs)("div",{className:"max"===b?"hidden":"",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(s.A,{className:"h-5 w-5","aria-hidden":!0})," Live"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"하니스 런이 판단하고 기획하는 신호 — 보이는 수는 전부 진짜다."})]}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,n.jsx)("select",{"aria-label":"시간 창",value:O,onChange:e=>U(Number(e.target.value)),className:"rounded-md border bg-background px-2 py-1",children:y.map(e=>(0,n.jsx)("option",{value:e,children:e<60?"".concat(e,"분"):"".concat(e/60,"시간")},e))}),(0,n.jsxs)("select",{"aria-label":"신호 출처",value:_,onChange:e=>B(e.target.value),className:"max-w-48 rounded-md border bg-background px-2 py-1",children:[(0,n.jsx)("option",{value:"",children:"이 인스턴스"}),(0,n.jsx)("option",{value:k,children:"전체(연합 \xb7 최근 24시간에 쓰인 우주)"}),el.map(e=>(0,n.jsx)("option",{value:e.name,children:e.name},e.name))]}),(0,n.jsx)("button",{type:"button","data-elanous-action":"live-public-capture","aria-pressed":Z,onClick:()=>G(e=>!e),title:"녹화\xb7스크린샷용 — 계정 이름 → account-N \xb7 크레딧\xb7USD 숨김 \xb7 홈 경로 가림",className:"rounded-md border px-2 py-1 ".concat(Z?"border-emerald-500 text-emerald-600 dark:text-emerald-300":"hover:bg-muted"),children:Z?"● 공개 캡처 켜짐":"공개 캡처"}),"max"===b?(0,n.jsxs)("button",{type:"button","data-elanous-action":"live-max-off",onClick:()=>{P(null),H.setLiveDetail({scope:"all",ttlMin:0,by:"pwa-live"}).then(X).catch(e=>P(e instanceof Error?e.message:String(e))),j("practical"),E(null)},className:"inline-flex items-center gap-1 rounded-md border border-primary px-2 py-1 text-primary hover:bg-muted",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0})," 화려함 MAX 켜짐 \xb7 끄기"]}):(0,n.jsxs)("button",{type:"button","data-elanous-action":"live-max-on",onClick:()=>R(!0),className:"inline-flex items-center gap-1 rounded-md border px-2 py-1 hover:bg-muted",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0})," 화려함 MAX"]})]})]}),L&&(0,n.jsxs)("div",{role:"dialog","aria-label":"화려함 MAX 켜기",className:"space-y-2 rounded-md border border-primary/50 bg-primary/5 p-3 text-sm","data-live-max-confirm":!0,children:[(0,n.jsx)("p",{className:"font-medium",children:"화려함 MAX 를 켤까요?"}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["마케팅(시연\xb7녹화)과 상세 런 디버깅용입니다. 켜면 하니스가 판단마다 \xab왜\xb7목적\xb7보낸 곳\xbb을 추가로 기록합니다(부하가 듭니다) — 30분 뒤 자동으로 꺼지고, 다른 기기에서도 같은 상태로 보입니다. 지금 이 화면이 받는 신호: 분당 ",ea,"건 \xb7 응답 약 ",en,"KB."]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs",children:[(0,n.jsx)("button",{type:"button","data-elanous-action":"live-max-all",onClick:()=>q("all"),className:"rounded-md border px-2 py-1 hover:bg-muted",children:"전체로 켜기"}),(0,n.jsx)("button",{type:"button","data-elanous-action":"live-max-run",disabled:!z,onClick:()=>q("run"),className:"rounded-md border px-2 py-1 hover:bg-muted disabled:opacity-50",children:z?"이 런만 켜기":"이 런만 켜기(먼저 런을 고르세요)"}),(0,n.jsx)("button",{type:"button",onClick:()=>R(!1),className:"rounded-md px-2 py-1 text-muted-foreground hover:bg-muted",children:"취소"})]})]}),D&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-xs text-error",children:["MAX 스위치를 못 바꿨다: ",D]}),"max"===b&&(0,n.jsxs)("p",{className:"rounded-md border border-primary/40 px-3 py-1 text-[11px] lg:text-[10px] text-muted-foreground","data-live-cost-badge":!0,children:["화려함 MAX \xb7 범위 ","run"===I&&z?"런 ".concat(z.replace(/^run-/,"").slice(0,8)):"전체"," \xb7 받는 신호 분당 ",ea,"건 \xb7 응답 약 ",en,"KB",S?" \xb7 ".concat(Math.max(0,Math.round((S-Q)/6e4)),"분 뒤 자동 꺼짐"):""," \xb7 하니스 판단 이벤트 ",et.emitted,"건"]}),W.error?(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["신호를 못 읽었다: ",W.error instanceof Error?W.error.message:String(W.error)]}):null,z&&(0,n.jsx)(w.RT,{runId:z,run:null!=(f=et.snapshot.runs.find(e=>e.runId===z))?f:null,lines:er,onClose:()=>F(null)}),"max"===b?(0,n.jsx)(N.xl,{board:et,rows:J,windowMinutes:O,sourceLabel:_===k?"federated":_||"this instance",shippedSource:"number"==typeof(null==(a=ee.data)?void 0:a.merged)?"github":"log",publicCapture:Z,role:v,onSelectRun:e=>F(t=>t===e?null:e)}):(0,n.jsx)(g,{board:et,lines:er,mode:b,role:v,selectedRunId:z,onSelectRun:e=>F(t=>t===e?null:e)}),(0,n.jsxs)("p",{className:"text-[11px] text-muted-foreground ".concat("max"===b?"hidden":""),children:["갱신 5초 \xb7 출처 ",(0,n.jsx)("code",{children:"/v1/logs"})," \xb7 ",(0,n.jsx)("code",{children:"/v1/harness/runs"})," \xb7 비밀처럼 보이는 조각은 가린다."]})]})}let M=[],A="\n@keyframes live-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(99,102,241,0) } 50% { opacity: .55; box-shadow: 0 0 10px 2px rgba(99,102,241,.55) } }\n@keyframes live-pulse-bad { 0%,100% { opacity: 1 } 50% { opacity: .4; box-shadow: 0 0 10px 2px rgba(239,68,68,.6) } }\n@keyframes live-glow { 0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,0) } 50% { box-shadow: 0 0 18px 2px rgba(99,102,241,.35) } }\n@keyframes live-line-in { from { transform: translateY(-6px); opacity: 0 } to { transform: none; opacity: 1 } }\n@keyframes live-ship { 0% { background: rgba(34,197,94,.35) } 100% { background: transparent } }\n.live-max .live-pulse { animation: live-pulse 1.4s ease-in-out infinite }\n.live-max .live-pulse-bad { animation: live-pulse-bad 1s ease-in-out infinite }\n.live-max .live-glow { animation: live-glow 2.4s ease-in-out infinite }\n.live-max .live-line-in { animation: live-line-in .45s ease-out }\n.live-max .live-ship { animation: live-ship 2.4s ease-out; font-size: 12px }\n.live-max .live-gauge { background: radial-gradient(120% 120% at 0% 0%, rgba(99,102,241,.10), transparent 60%) }\n.live-max .live-count { text-shadow: 0 0 12px rgba(99,102,241,.45) }\n.live-stage { background: radial-gradient(120% 90% at 50% 0%, rgba(79,70,229,.25), rgba(2,6,23,.98) 60%), #020617; box-shadow: inset 0 0 0 1px rgba(99,102,241,.25) }\n.live-stage .live-line-in { animation: live-line-in .45s ease-out }\n@keyframes live-v5-marquee { from { transform: translateX(0) } to { transform: translateX(-50%) } }\n@keyframes live-v5-blink { 0%,100% { opacity: 1 } 50% { opacity: .45 } }\n@keyframes live-v5-hot { 0%,100% { box-shadow: 0 0 14px #a78bfa55, inset 0 0 14px #a78bfa22 } 50% { box-shadow: 0 0 26px #a78bfa99, inset 0 0 22px #a78bfa44 } }\n.live-v5-marquee { animation: live-v5-marquee linear infinite }\n.live-v5-blink { animation: live-v5-blink 1.6s ease-in-out infinite }\n.live-v5-hot { animation: live-v5-hot 1.8s ease-in-out infinite }\n@media (prefers-reduced-motion: reduce) { .live-max *, .live-v5 * { animation: none !important; transition: none !important } }\n";function I(){return(0,n.jsx)(S,{})}},21050:(e,t,a)=>{Promise.resolve().then(a.bind(a,8772))},30728:(e,t,a)=>{"use strict";a.d(t,{A:()=>d});var n=a(49954);let r=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()},l=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 s={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 i=(0,n.createContext)({}),o=(0,n.forwardRef)((e,t)=>{var a,l,o;let{color:d,size:c,strokeWidth:u,absoluteStrokeWidth:x,className:m="",children:h,iconNode:p,...g}=e,{size:f=24,strokeWidth:v=2,absoluteStrokeWidth:b=!1,color:j="currentColor",className:N=""}=null!=(a=(0,n.useContext)(i))?a:{},w=(null!=x?x:b)?24*Number(null!=u?u:v)/Number(null!=c?c:f):null!=u?u:v;return(0,n.createElement)("svg",{ref:t,...s,width:null!=(l=null!=c?c:f)?l:s.width,height:null!=(o=null!=c?c:f)?o:s.height,stroke:null!=d?d:j,strokeWidth:w,className:r("lucide",N,m),...!h&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(g)&&{"aria-hidden":"true"},...g},[...p.map(e=>{let[t,a]=e;return(0,n.createElement)(t,a)}),...Array.isArray(h)?h:[h]])}),d=(e,t)=>{let a=(0,n.forwardRef)((a,s)=>{let{className:i,...d}=a;return(0,n.createElement)(o,{ref:s,iconNode:t,className:r("lucide-".concat(l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),i),...d})});return a.displayName=l(e),a}},68969:(e,t,a)=>{"use strict";a.d(t,{GC:()=>r,In:()=>d,OG:()=>i});var n=a(49954);let r="elanous.pwa.role",l="elanous:pwa-role";function s(){try{let e=window.localStorage.getItem(r);if("owner"===e||"contributor"===e||"general"===e)return e}catch(e){}return"general"}function i(e){try{window.localStorage.setItem(r,e)}catch(e){}"function"==typeof window.dispatchEvent&&window.dispatchEvent(new Event(l))}function o(e){if("function"!=typeof window.addEventListener)return()=>{};window.addEventListener(l,e);let t=t=>{(t.key===r||null===t.key)&&e()};return window.addEventListener("storage",t),()=>{window.removeEventListener(l,e),window.removeEventListener("storage",t)}}function d(){return(0,n.useSyncExternalStore)(o,s,()=>"general")}},93708:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(30728).A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]])},97514:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});let n=(0,a(30728).A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]])}},e=>{e.O(0,[8085,2566,4862,9917,7274,2201,6356,7358],()=>e(e.s=21050)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[125],{14851:(e,t,n)=>{Promise.resolve().then(n.bind(n,82182))},53648:()=>{},82182:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>T});var a=n(77194),r=n(49954),l=n(98451),s=n(59917),o=n(6896);let i=new Set(["fail","failed","error","blocked","rejected","aborted","unconvergeable","timeout"]);function d(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:900,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4e3,l=e[t],s=e[t+1];if(!l||!s)return a/n;let o=Date.parse(s.at)-Date.parse(l.at);return(Number.isFinite(o)?Math.min(r,Math.max(a,o/60)):a)/Math.max(1,n)}function c(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t+324e5).toISOString().slice(11,19):"—"}function u(e){if(null===e||!Number.isFinite(e)||e<0)return"—";if(e<1e3)return"".concat(Math.round(e),"ms");let t=Math.round(e/1e3);if(t<60)return"".concat(t,"초");let n=Math.floor(t/60);return n<60?"".concat(n,"분 ").concat(t%60,"초"):"".concat(Math.floor(n/60),"시간 ").concat(n%60,"분")}var p=n(80920),m=n(2504);n(46914),n(53006),n(53648);var x=n(17225),h=n(39636);let f="group:",g=e=>e.startsWith(f);function b(e){let t=new Map;for(let n of e.nodes){let e="string"==typeof n.group?n.group.trim():"";e&&t.set(n.node_id,e)}return t}let v={pending:"var(--border, #94a3b8)",running:"#f59e0b",passed:"var(--chart-2, #16a34a)",failed:"var(--destructive, #ef4444)"},y={pending:"대기",running:"도는 중",passed:"통과",failed:"실패"},j={agent:"#3b82f6",gate:"#f59e0b",git:"#10b981",judge:"#a855f7",observe:"#06b6d4",hitl:"#f43f5e",subgraph:"#8b5cf6"},w={pending:"var(--border, #cbd5e1)",running:"#f59e0b",passed:"var(--chart-2, #16a34a)",failed:"var(--destructive, #ef4444)"},N={pending:"대기",running:"도는 중",passed:"통과",failed:"실패"},k={pending:"workflow-node-status",running:"workflow-node-status workflow-node-status-running",passed:"workflow-node-status workflow-node-status-done",failed:"workflow-node-status workflow-node-status-failed"},M=[1,4,16],I={live:function(e){var t;let{data:n}=e;return(0,a.jsxs)("div",{"data-testid":"live-node-".concat(n.label),"data-state":n.state,className:"relative rounded-lg border-2 bg-surface px-3 py-2 shadow-sm transition-opacity duration-300 ".concat(k[n.state]," ").concat("pending"===n.state?n.unrecorded?"opacity-35":"opacity-60":""),style:{width:x.E,height:n.height,borderColor:w[n.state],borderLeft:"5px solid ".concat(null!=(t=j[n.kind])?t:"#64748b"),outline:n.focused?"2px solid var(--accent, #8b5cf6)":void 0,outlineOffset:3},children:[(0,a.jsx)(p.h7,{id:"in",type:"target",position:m.yX.Left,className:"!pointer-events-none !opacity-0"}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-tertiary",children:[(0,a.jsx)("span",{children:"subgraph"===n.kind?"묶음 \xb7 눌러서 펼치기":n.kind}),n.entry&&(0,a.jsx)("span",{className:"rounded bg-success/15 px-1 text-success",children:"시작"}),n.terminal&&(0,a.jsx)("span",{className:"rounded bg-accent/15 px-1 text-accent",children:"끝"}),(0,a.jsx)("span",{className:"ml-auto font-medium",style:{color:w[n.state]},children:n.unrecorded?"기록 없음":N[n.state]})]}),(0,a.jsx)("div",{className:"truncate font-mono text-sm font-semibold text-text-primary",children:g(n.label)?"▣ ".concat(n.label.slice(f.length)):n.label}),(0,a.jsxs)("div",{className:"truncate text-[11px] text-text-tertiary",title:n.recipe,children:[n.recipe," \xb7 최대 ",n.maxVisits,"회"]}),n.visits>1&&(0,a.jsxs)("span",{"data-testid":"visit-badge-".concat(n.label),className:"absolute -right-2 -top-2 rounded-full bg-amber-500 px-1.5 text-xs font-bold text-white shadow",children:["\xd7",n.visits]}),(0,a.jsx)(p.h7,{id:"out",type:"source",position:m.yX.Right,className:"!pointer-events-none !opacity-0"})]})},groupBox:function(e){let{data:t}=e,n=v[t.state];return(0,a.jsx)("div",{"data-testid":"group-box-".concat(t.group),"data-state":t.state,className:"pointer-events-none rounded-xl border-2 border-dashed ".concat(t.unrecorded?"opacity-60":""),style:{width:t.width,height:t.height,borderColor:n,background:"color-mix(in srgb, ".concat(n," 6%, transparent)")},children:(0,a.jsxs)("div",{className:"pointer-events-auto flex items-center gap-2 px-2.5 py-1 text-xs",children:[(0,a.jsx)("span",{className:"font-mono font-semibold text-text-primary",children:t.group}),(0,a.jsx)("span",{className:"text-[11px]",style:{color:n},children:t.unrecorded?"기록 없음":y[t.state]}),(0,a.jsxs)("span",{className:"text-[11px] text-text-tertiary",children:["노드 ",t.memberCount]}),t.onCollapse&&(0,a.jsx)("button",{type:"button",onClick:e=>{var n;e.stopPropagation(),null==(n=t.onCollapse)||n.call(t,t.group)},className:"nodrag ml-auto rounded border border-border bg-background px-1.5 text-[11px] text-text-secondary",children:"접기"})]})})}},S={live:function(e){let{id:t,data:n,markerEnd:r,style:l}=e;if(!(null==n?void 0:n.route))return null;let{route:s}=n,o=h.Bu[s.family],i="back"===s.kind;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.tE,{id:t,path:s.path,markerEnd:r,style:{stroke:o,strokeWidth:n.active?4:n.taken?3:1.5,opacity:n.active||n.taken?1:.22,transition:"opacity 300ms, stroke-width 300ms",...i?{strokeDasharray:"6 4"}:{},...l,...(null==l?void 0:l.stroke)?{opacity:1}:{}}}),n.active&&(0,a.jsxs)("g",{"data-testid":"edge-token-".concat(s.from,"-").concat(s.to),opacity:null==l?void 0:l.opacity,children:[(0,a.jsx)("circle",{r:7,fill:o,opacity:.25,children:(0,a.jsx)("animateMotion",{dur:"".concat(n.tokenMs,"ms"),fill:"freeze",path:s.path})}),(0,a.jsx)("circle",{r:4.5,fill:o,stroke:"var(--background, #fff)",strokeWidth:1.5,children:(0,a.jsx)("animateMotion",{dur:"".concat(n.tokenMs,"ms"),fill:"freeze",path:s.path})})]},n.tokenKey),s.label&&(0,a.jsx)(p.rV,{children:(0,a.jsx)("div",{className:"nodrag nopan pointer-events-none absolute whitespace-nowrap rounded-full border px-1.5 font-mono text-[11px] leading-4",style:{transform:"translate(-50%, -50%) translate(".concat(s.label.x,"px, ").concat(s.label.y,"px)"),width:s.label.width,textAlign:"center",borderColor:o,color:o,background:"var(--background, #fff)",opacity:n.active||n.taken?1:.35,fontWeight:n.active?700:500,...(null==l?void 0:l.opacity)!==void 0?{opacity:l.opacity}:{}},children:s.label.text})})]})}};function C(e){var t,n,l,m,v,y;let{runId:j,initialFolded:w=!1}=e,N=(0,o.M1)(),k=(0,s.I)({queryKey:["harness-run-traversal",j],queryFn:()=>N.getHarnessRunTraversal(j),refetchInterval:e=>{var t;return(null==(t=e.state.data)?void 0:t.status)==="running"&&4e3}}),C=k.data,_=(0,s.I)({queryKey:["run-graph",null==C?void 0:C.graphId],queryFn:()=>N.getRunGraph(C.graphId),enabled:!!(null==C?void 0:C.graphId),retry:!1,staleTime:6e4}),E=(0,r.useMemo)(()=>{var e;return null!=(e=null==C?void 0:C.steps)?e:[]},[C]),T=(0,r.useMemo)(()=>{var e;if(!C)return null;let t=_.data;return t?function(e,t){let n=new Set(e.nodes.map(e=>e.node_id)),a=[...new Set(t.map(e=>e.node))].filter(e=>!n.has(e)),r=t=>e.edges.filter(e=>e.from===t).flatMap(e=>e.map?Object.values(e.map):e.to?[e.to]:[]),l=[];for(let e=1;e<t.length;e+=1){let n=t[e-1].node,a=t[e].node;r(n).includes(a)||l.some(e=>e.from===n&&e.to===a)||l.push({from:n,to:a})}return 0===a.length&&0===l.length?e:{...e,nodes:[...e.nodes,...a.map(e=>({node_id:e,kind:"agent",recipe:"원장에서 본 노드(선언 밖)",max_visits:t.filter(t=>t.node===e).length}))],edges:[...e.edges,...l]}}(t,E):_.isLoading&&C.graphId?null:function(e,t){var n,a,r;let l=[...new Set(t.map(e=>e.node))],s=new Map;for(let e=1;e<t.length;e+=1){let r=t[e-1],l=null!=(n=s.get(r.node))?n:{},o=null!=(a=r.outcome)?a:"pass";Object.values(l).includes(t[e].node)||(l[l[o]?"".concat(o,"\xb7").concat(t[e].node):o]=t[e].node),s.set(r.node,l)}return{id:e,source:"core",editable:!1,entry_node:null!=(r=l[0])?r:"",terminal_nodes:t.length?[t.at(-1).node]:[],nodes:l.map(e=>({node_id:e,kind:"agent",recipe:"원장에서 본 노드",max_visits:t.filter(t=>t.node===e).length})),edges:[...s.entries()].map(e=>{let[t,n]=e;return{from:t,on:"outcome",map:n}})}}(null!=(e=C.graphId)?e:C.runId,E)},[C,_.data,_.isLoading,E]),[O,R]=(0,r.useState)(()=>new Set),F=(0,r.useMemo)(()=>T?[...new Set(b(T).values())]:[],[T]),z=(0,r.useMemo)(()=>T?b(T):new Map,[T]),D=(0,r.useRef)(!1);(0,r.useEffect)(()=>{w&&!D.current&&0!==F.length&&(D.current=!0,R(new Set(F)))},[w,F]);let V=(0,r.useMemo)(()=>T?function(e,t){let n=b(e),a=e=>{let a=n.get(e);return a&&t.has(a)?"".concat(f).concat(a):e};if(![...n.values()].some(e=>t.has(e)))return{graph:e,resolve:a};let r=[],l=new Set;for(let t of e.nodes){let s=a(t.node_id);if(l.has(s))continue;if(l.add(s),s===t.node_id){r.push(t);continue}let o=n.get(t.node_id),i=e.nodes.filter(e=>n.get(e.node_id)===o);r.push({node_id:s,kind:"subgraph",recipe:"묶음 \xb7 노드 ".concat(i.length,"개"),max_visits:Math.max(...i.map(e=>e.max_visits)),group:o})}let s=[];for(let t of e.edges){let e=a(t.from);if(t.map){let n={};for(let[r,l]of Object.entries(t.map)){let t=a(l);t!==e&&(n[r]=t)}Object.keys(n).length&&s.push({from:e,...t.on?{on:t.on}:{},map:n})}else if(t.to){let n=a(t.to);n!==e&&s.push({from:e,to:n})}}let o=[];for(let e of s){let t=o.find(t=>t.from===e.from&&!!t.map==!!e.map&&(e.map||t.to===e.to));if(!t){o.push(e.map?{...e,map:{...e.map}}:e);continue}if(e.map&&t.map)for(let[n,a]of Object.entries(e.map))n in t.map?t.map[n]===a||Object.values(t.map).includes(a)||(t.map["".concat(n,"\xb7").concat(a.replace(f,""))]=a):t.map[n]=a}let i=a(e.entry_node),d=[...new Set(e.terminal_nodes.map(a))];return{graph:{...e,entry_node:i,terminal_nodes:d,nodes:r,edges:o},resolve:a}}(T,O):null,[T,O]),L=(0,r.useMemo)(()=>V?(0,x.h)(V.graph):null,[V]),Z=(0,r.useMemo)(()=>V?E.map(e=>({...e,node:V.resolve(e.node)})):E,[V,E]),A=(0,r.useMemo)(()=>{var e;return null!=(e=null==L?void 0:L.edges.map(e=>({id:e.id,from:e.source,to:e.target,outcomes:e.data.route.outcomes})))?e:[]},[L]),K=(null==C?void 0:C.status)==="running",[q,B]=(0,r.useState)(null),W=null!=q?q:K?"live":"replay",[P,H]=(0,r.useState)(-1),[G,X]=(0,r.useState)(!1),[$,Q]=(0,r.useState)(!1),[U,J]=(0,r.useState)(4),[Y,ee]=(0,r.useState)(null),[et,en]=(0,r.useState)(null),[ea,er]=(0,r.useState)(!0),el=(0,r.useRef)(null),es=(0,r.useRef)(null),[eo,ei]=(0,r.useState)(0),ed=(0,r.useRef)(!1);(0,r.useEffect)(()=>{C&&!ed.current&&0!==E.length&&(ed.current=!0,"running"===C.status?(H(E.length-1),X(null===E.at(-1).outcome)):(H(0),X(!0),Q(!0)))},[C,E]),(0,r.useEffect)(()=>{"live"===W&&0!==E.length&&(H(E.length-1),X(null===E.at(-1).outcome))},[W,E]),(0,r.useEffect)(()=>{if("replay"!==W||!$||0===E.length)return;let e=d(E,P,U),t=window.setTimeout(()=>X(!1),e/2),n=window.setTimeout(()=>{if(P>=E.length-1)return void Q(!1);H(e=>e+1),X(!0)},e);return()=>{window.clearTimeout(t),window.clearTimeout(n)}},[W,$,P,U,E]);let ec=(0,r.useMemo)(()=>new Set(Z.map(e=>e.node)),[Z]),eu=(0,r.useMemo)(()=>{var e;return function(e,t,n,a){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=Object.fromEntries(e.map(e=>[e,"pending"])),s={},o=new Set,d=null,c=Math.min(a,n.length-1);for(let e=0;e<=c;e+=1){var u,p;let a=n[e];if(s[a.node]=(null!=(u=s[a.node])?u:0)+1,l[a.node]=e===c&&r||null===(p=a.outcome)?"running":i.has(p.toLowerCase())?"failed":"passed",e>0){let r=n[e-1],l=function(e,t,n,a){var r;let l=e.filter(e=>e.from===t&&e.to===a);return 0===l.length?null:null!=(r=l.find(e=>null!==n&&e.outcomes.includes(n)))?r:l[0]}(t,r.node,r.outcome,a.node);l&&(o.add(l.id),e===c&&(d=l.id))}}return{nodeState:l,visits:s,takenEdges:o,activeEdge:d,cursor:c}}(null!=(e=null==L?void 0:L.nodes.map(e=>e.id))?e:[],A,Z,P,G)},[L,A,Z,P,G]),ep=(0,r.useCallback)(e=>R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]),em="replay"===W?Math.max(250,.6*d(E,Math.max(0,P-1),U)):1200,ex=(0,r.useMemo)(()=>{var e;return(0,h.d1)((null==L?void 0:L.nodes.some(e=>e.id===et))?et:null,null!=(e=null==L?void 0:L.edges.map(e=>({id:e.id,from:e.source,to:e.target})))?e:[])},[et,L]),eh=(0,r.useMemo)(()=>{if(!L)return[];let e=L.nodes.map(e=>{var t,n;return{...e,type:"live",zIndex:1,...ex&&!ex.nodes.has(e.id)?{style:{...e.style,opacity:h.zZ.dimNode}}:{},data:{...e.data,state:null!=(t=eu.nodeState[e.id])?t:"pending",visits:null!=(n=eu.visits[e.id])?n:0,focused:Y===e.id,unrecorded:!K&&!ec.has(e.id)}}});return[...(function(e,t){let n=new Map;for(let r of e){var a;let e=t.get(r.id);!e||g(r.id)||n.set(e,[...null!=(a=n.get(e))?a:[],r])}return[...n.entries()].map(e=>{let[t,n]=e,a=Math.min(...n.map(e=>e.position.x)),r=Math.min(...n.map(e=>e.position.y)),l=Math.max(...n.map(e=>e.position.x+e.width)),s=Math.max(...n.map(e=>e.position.y+e.height));return{id:"box:".concat(t),group:t,members:n.map(e=>e.id),x:a-18,y:r-18-26,width:l-a+36,height:s-r+36+26}})})(L.nodes.map(e=>({id:e.id,position:e.position,width:x.E,height:e.data.height})),z).map(e=>{var t;return{id:e.id,type:"groupBox",position:{x:e.x,y:e.y},zIndex:0,selectable:!1,draggable:!1,focusable:!1,data:{group:e.group,memberCount:e.members.length,width:e.width,height:e.height,onCollapse:ep,state:(t=e.members.map(e=>{var t;return null!=(t=eu.nodeState[e])?t:"pending"})).includes("running")?"running":t.includes("failed")?"failed":t.includes("passed")?"passed":"pending",unrecorded:!K&&e.members.every(e=>!ec.has(e))}}}),...e]},[L,eu,Y,ex,K,ec,z,ep]),ef=(0,r.useMemo)(()=>{var e;return null!=(e=null==L?void 0:L.edges.map(e=>({...e,type:"live",...(0,h.f_)(ex,e.id),className:(null==ex?void 0:ex.edges.has(e.id))?"wiring-edge-flow":void 0,data:{...e.data,taken:eu.takenEdges.has(e.id),active:eu.activeEdge===e.id,tokenKey:"".concat(e.id,":").concat(eu.cursor),tokenMs:em}})))?e:[]},[L,eu,em,ex]),eg=(0,r.useCallback)(e=>{ee(e);let t=el.current;t&&(e?t.fitView({nodes:[{id:e}],duration:600,maxZoom:1.4,padding:.6}):t.fitView({duration:600,padding:.08,minZoom:.5}))},[]),eb=null!=(n=null==(t=Z[P])?void 0:t.node)?n:null;(0,r.useEffect)(()=>{var e,t;if(!ea||Y||!eb||!L)return;let n=L.nodes.find(e=>e.id===eb),a=el.current;if(!n||!a)return;let r=Math.min(1,Math.max(.78,(null!=(t=null==(e=es.current)?void 0:e.clientWidth)?t:1e3)/900));a.setCenter(n.position.x+x.E/2,n.position.y+n.data.height/2,{zoom:r,duration:400})},[ea,Y,eb,L,eo]);let ev="replay"===W&&!$&&E.length>0&&P===E.length-1;(0,r.useEffect)(()=>{var e,t;if(!ev||!ea||Y||(null!=(t=null==(e=es.current)?void 0:e.clientWidth)?t:1e3)<700)return;let n=window.setTimeout(()=>{var e;null==(e=el.current)||e.fitView({nodes:[...ec].map(e=>({id:e})),duration:800,padding:.08,minZoom:.5})},1200);return()=>window.clearTimeout(n)},[ev,ea,Y,ec]);let ey=e=>{B("replay"),Q(!1),H(e),X(!1)};if(k.isLoading)return(0,a.jsx)("p",{className:"p-4 text-sm text-text-tertiary",children:"런 원장을 읽는 중…"});if(k.isError||!C)return(0,a.jsxs)("p",{role:"alert",className:"p-4 text-sm text-error",children:["이 런의 원장을 읽지 못했습니다 (",j,")."]});let ej=Y?E.map((e,t)=>({step:e,index:t})).filter(e=>{var t;let{step:n}=e;return(null!=(t=null==V?void 0:V.resolve(n.node))?t:n.node)===Y}):[],ew=P>=0?E[P]:void 0;return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full px-2 py-0.5 text-xs font-semibold ".concat(K?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"completed"===C.status?"bg-success/15 text-success":"bg-error/15 text-error"),children:function(e){switch(e){case"running":return"● 도는 중";case"completed":return"완료";case"failed":return"실패";case"abandoned":return"버려짐";case"cancelled":return"취소됨";default:return e}}(C.status)}),(0,a.jsx)("h2",{className:"order-first min-w-0 basis-full truncate text-sm font-semibold text-text-primary sm:order-none sm:basis-0 sm:flex-1",title:null!=(l=C.title)?l:void 0,children:null!=(m=C.title)?m:C.runId}),null!==C.prNumber&&(0,a.jsxs)("span",{className:"text-xs text-text-secondary",children:["PR #",C.prNumber]}),(0,a.jsxs)("span",{className:"font-mono text-[11px] text-text-tertiary",children:[C.runId.slice(0,12)," \xb7 ",null!=(v=C.graphId)?v:"그래프 모름",C.substrate?" \xb7 ".concat(C.substrate):""]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsxs)("div",{role:"group","aria-label":"보기",className:"flex overflow-hidden rounded border border-border",children:[(0,a.jsx)("button",{type:"button",disabled:!K,onClick:()=>{B("live"),Q(!1)},className:"px-2 py-1 ".concat("live"===W?"bg-primary text-primary-foreground":""," disabled:opacity-40"),children:"● 라이브"}),(0,a.jsx)("button",{type:"button",onClick:()=>{B("replay")},className:"px-2 py-1 ".concat("replay"===W?"bg-primary text-primary-foreground":""),children:"리플레이"})]}),"replay"===W&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button","aria-label":$?"일시정지":"재생",onClick:()=>{!$&&P>=E.length-1&&(H(0),X(!0)),Q(!$)},className:"rounded border border-border px-2.5 py-1 font-semibold",children:$?"⏸ 일시정지":"▶ 재생"}),(0,a.jsx)("button",{type:"button",onClick:()=>{H(0),X(!0),Q(!1)},className:"rounded border border-border px-2 py-1",children:"처음"}),(0,a.jsx)("div",{role:"group","aria-label":"속도",className:"flex overflow-hidden rounded border border-border",children:M.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>J(e),"aria-pressed":U===e,className:"px-2 py-1 ".concat(U===e?"bg-accent/20 font-semibold text-text-primary":"text-text-secondary"),children:[e,"\xd7"]},e))}),(0,a.jsx)("input",{type:"range","aria-label":"재생 위치",min:0,max:Math.max(0,E.length-1),value:Math.max(0,P),onChange:e=>ey(Number(e.target.value)),className:"min-w-[120px] flex-1"})]}),(0,a.jsxs)("span",{className:"text-text-tertiary",children:[Math.max(0,P+1),"/",E.length," 단계",ew?" \xb7 ".concat(ew.node," \xd7").concat(ew.visit):""]}),(0,a.jsx)("button",{type:"button",onClick:()=>{er(!1),eg(null)},className:"rounded border border-border px-2 py-1",children:"전체 보기"}),(0,a.jsx)("button",{type:"button","aria-pressed":ea,onClick:()=>{er(!ea),ee(null)},className:"rounded border px-2 py-1 ".concat(ea?"border-primary text-primary":"border-border"),children:"카메라 따라가기"}),F.length>0&&(0,a.jsx)("button",{type:"button","data-testid":"toggle-units",onClick:()=>{ee(null),R(O.size===F.length?new Set:new Set(F))},className:"rounded border border-border px-2 py-1",children:O.size===F.length?"묶음 펼치기 (통합 보기)":"묶음 접기"})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 lg:flex-row",children:[(0,a.jsxs)("section",{ref:es,"aria-label":"실행 그래프",className:"relative h-[60dvh] min-h-[340px] min-w-0 overflow-hidden rounded-lg border border-border bg-surface lg:h-[calc(100dvh-230px)] lg:min-h-[520px] lg:flex-1",children:[0===E.length&&(0,a.jsx)("p",{className:"absolute left-3 top-3 z-10 text-xs text-text-tertiary",children:"아직 노드에 들어가지 않았습니다(원장에 `pipeline-node-entry` 없음)."}),L&&(0,a.jsxs)(p.Gc,{nodes:eh,edges:ef,nodeTypes:I,edgeTypes:S,onInit:e=>{el.current=e,ei(e=>e+1)},onNodeMouseEnter:(e,t)=>{"groupBox"!==t.type&&en(t.id)},onNodeMouseLeave:()=>en(null),onNodeClick:(e,t)=>{if("groupBox"!==t.type){if(g(t.id)){var n;let e=null!=(n=t.data.group)?n:t.id.slice(6);ep(e),ee(null),window.setTimeout(()=>{var t;null==(t=el.current)||t.fitView({nodes:[{id:"box:".concat(e)}],duration:600,maxZoom:1.4,padding:.2})},80);return}eg(Y===t.id?null:t.id)}},onPaneClick:()=>{Y&&eg(null)},fitView:!0,fitViewOptions:{padding:.08,minZoom:.5},minZoom:.2,maxZoom:2,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,edgesFocusable:!1,deleteKeyCode:null,proOptions:{hideAttribution:!0},className:"!bg-surface",children:[(0,a.jsx)(p.VS,{}),(0,a.jsx)(p.H2,{showInteractive:!1})]},"".concat(null!=(y=null==T?void 0:T.id)?y:"graph",":").concat([...O].sort().join(","))),Y&&(0,a.jsxs)("div",{"data-testid":"node-detail",className:"absolute bottom-3 left-3 right-3 z-10 max-h-[45%] overflow-y-auto rounded-lg border border-border bg-background/95 p-3 text-xs shadow-lg backdrop-blur sm:right-auto sm:w-[320px]",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-sm font-semibold text-text-primary",children:Y}),(0,a.jsxs)("span",{className:"text-text-tertiary",children:["방문 ",ej.length,"회"]}),(0,a.jsx)("button",{type:"button",onClick:()=>eg(null),className:"ml-auto rounded border border-border px-1.5",children:"닫기"})]}),0===ej.length&&(0,a.jsx)("p",{className:"text-text-tertiary",children:K?"아직 이 노드에 들어가지 않았습니다.":"기록 없음 — 이 런의 원장에 이 노드의 사건이 없습니다."}),(0,a.jsx)("ul",{className:"space-y-1",children:ej.map(e=>{var t;let{step:n,index:r}=e;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>ey(r),className:"w-full rounded px-1 py-0.5 text-left hover:bg-surface-elevated",children:[(0,a.jsx)("span",{className:"font-mono text-text-secondary",children:c(n.at)})," ",(0,a.jsxs)("span",{className:"font-semibold",children:["\xd7",n.visit]})," ",(0,a.jsx)("span",{className:"fail"===n.outcome?"text-error":null===n.outcome?"text-amber-500":"text-success",children:null!=(t=n.outcome)?t:"도는 중"})," ",(0,a.jsx)("span",{className:"text-text-tertiary",children:u(n.durationMs)}),n.detail&&(0,a.jsx)("span",{className:"block text-text-secondary",children:n.detail})]})},r)})})]})]}),(0,a.jsxs)("aside",{"aria-label":"실행 타임라인",className:"max-h-[420px] overflow-y-auto rounded-lg border border-border bg-surface lg:max-h-[calc(100dvh-230px)] lg:w-[340px] lg:shrink-0",children:[(0,a.jsx)("h3",{className:"sticky top-0 border-b border-border bg-surface px-3 py-2 text-xs font-semibold",children:"타임라인 (KST)"}),(0,a.jsx)("ol",{children:E.map((e,t)=>{var n,r;let l=t>P,s=t===P;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>{var n;ey(t),eg(null!=(n=null==V?void 0:V.resolve(e.node))?n:e.node)},"data-testid":"timeline-step-".concat(t),className:"grid w-full grid-cols-[64px_1fr_auto] items-baseline gap-x-2 border-b border-border/60 px-3 py-1.5 text-left text-xs transition-opacity ".concat(l?"opacity-35":""," ").concat(s?"bg-accent/10":"hover:bg-surface-elevated"),children:[(0,a.jsx)("span",{className:"font-mono text-text-tertiary",children:c(e.at)}),(0,a.jsxs)("span",{className:"font-mono font-semibold text-text-primary",children:[e.node,e.visit>1?" \xd7".concat(e.visit):""]}),(0,a.jsx)("span",{className:"fail"===e.outcome?"text-error":null===e.outcome?"text-amber-500":"text-success",children:null===e.outcome?"도는 중":"fail"===e.outcome?"실패":"통과"}),(0,a.jsx)("span",{className:"text-[11px] text-text-tertiary",children:u(e.durationMs)}),(0,a.jsx)("span",{className:"col-span-2 truncate text-[11px] text-text-secondary",title:null!=(n=e.detail)?n:void 0,children:null!=(r=e.detail)?r:""})]})},t)})})]})]}),(0,a.jsxs)("p",{className:"shrink-0 text-[11px] text-text-tertiary",children:["배선도 디자인: ",(0,a.jsx)("a",{href:"https://malfoy-meme-making.vercel.app/wiring/index.html",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"공냥이 AI 실험실"})]})]})}function _(){return(0,o.Qj)()?(0,a.jsx)(E,{}):(0,a.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"런 장면"}),(0,a.jsx)("p",{className:"text-sm text-text-secondary",children:"데몬에 연결되면 하니스 런 하나가 도는 장면을 그립니다."})]})}function E(){var e;let t=(0,o.M1)(),n=(0,l.useRouter)(),i=(0,l.useSearchParams)(),d=(null==(e=i.get("run"))?void 0:e.trim())||null,u=(0,r.useMemo)(()=>Date.now()-864e5,[]),p=(0,s.I)({queryKey:["harness-runs-since",u],queryFn:()=>t.getHarnessRunsSince(u),refetchInterval:3e4}),m=(0,r.useMemo)(()=>{var e,t;return p.data?function(e,t){let n=e=>(function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,a=(null!=(t=null==e?void 0:e.split("\n").map(e=>e.trim()).find(Boolean))?t:"").replace(/\s*\[truncated[^\]]*\]\s*$/,"").replace(/(?:~|\.{0,2})?\/?(?:[\w.@-]+\/)+([\w.@-]+)/g,"$1");return a.length>n?"".concat(a.slice(0,n-1),"…"):a})(e),a=[...e].sort((e,t)=>{var n,a;return Date.parse(null!=(n=t.lastActivityTimestamp)?n:"")-Date.parse(null!=(a=e.lastActivityTimestamp)?a:"")||0}).map(e=>{var t;return{runId:e.runId,label:n(e.objective)||e.runId,live:!0,at:null!=(t=e.lastActivityTimestamp)?t:null}}),r=new Set(a.map(e=>e.runId));return[...a,...t.filter(e=>!r.has(e.runId)).map(e=>({runId:e.runId,label:n(e.objective)||e.runId,live:!1,at:e.endedAt}))]}(null!=(e=p.data.entries)?e:[],null!=(t=p.data.finished)?t:[]):[]},[p.data]),x=e=>n.replace("/live-run/?run=".concat(encodeURIComponent(e)));return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4",children:[(0,a.jsxs)("header",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h1",{className:"text-base font-semibold text-text-primary",children:"런 장면"}),(0,a.jsx)("span",{className:"text-xs text-text-tertiary",children:"하니스 런 하나가 실제로 밟은 노드\xb7간선 (라이브 \xb7 리플레이)"}),(0,a.jsxs)("label",{className:"flex w-full min-w-0 items-center gap-1 text-xs text-text-secondary sm:ml-auto sm:w-auto sm:min-w-[320px]",children:[(0,a.jsx)("span",{className:"shrink-0",children:"런"}),(0,a.jsxs)("select",{"aria-label":"런 고르기",value:null!=d?d:"",onChange:e=>{e.target.value&&x(e.target.value)},className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1 text-xs text-text-primary",children:[(0,a.jsx)("option",{value:"",children:p.isLoading?"불러오는 중…":m.length?"런을 고르세요":"최근 24시간 런 없음"}),d&&!m.some(e=>e.runId===d)&&(0,a.jsx)("option",{value:d,children:d}),m.some(e=>e.live)&&(0,a.jsx)("optgroup",{label:"도는 중",children:m.filter(e=>e.live).map(e=>(0,a.jsxs)("option",{value:e.runId,children:["● ",e.label]},e.runId))}),m.some(e=>!e.live)&&(0,a.jsx)("optgroup",{label:"끝난 런 (최근 24시간)",children:m.filter(e=>!e.live).map(e=>(0,a.jsxs)("option",{value:e.runId,children:[e.at?"".concat(c(e.at).slice(0,5)," \xb7 "):"",e.label]},e.runId))})]})]})]}),p.isError&&(0,a.jsx)("p",{role:"status",className:"text-xs text-warning",children:"런 목록을 읽지 못했습니다 — 주소에 ?run=<runId> 를 주면 그 런은 그대로 그립니다."}),d?(0,a.jsx)(C,{runId:d,initialFolded:"folded"===i.get("units")},d):(0,a.jsx)("ul",{className:"grid gap-2 sm:grid-cols-2",children:m.slice(0,12).map(e=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>x(e.runId),className:"w-full rounded-lg border border-border bg-surface p-3 text-left hover:bg-surface-elevated",children:[(0,a.jsx)("span",{className:"text-xs font-semibold ".concat(e.live?"text-amber-500":"text-text-tertiary"),children:e.live?"● 도는 중":"끝남 ".concat(e.at?c(e.at):"")}),(0,a.jsx)("span",{className:"mt-1 block truncate text-sm text-text-primary",children:e.label}),(0,a.jsx)("span",{className:"block font-mono text-[11px] text-text-tertiary",children:e.runId})]})},e.runId))})]})}function T(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("p",{className:"p-4 text-sm",children:"런 장면을 불러오는 중…"}),children:(0,a.jsx)(_,{})})}}},e=>{e.O(0,[5225,2609,8411,8604,2566,9917,4089,1729,7247,599,2201,6356,7358],()=>e(e.s=14851)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[125],{48986:(e,t,n)=>{Promise.resolve().then(n.bind(n,82182))},53648:()=>{},82182:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>T});var a=n(77194),r=n(49954),l=n(98451),s=n(59917),o=n(6896);let i=new Set(["fail","failed","error","blocked","rejected","aborted","unconvergeable","timeout"]);function d(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:900,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4e3,l=e[t],s=e[t+1];if(!l||!s)return a/n;let o=Date.parse(s.at)-Date.parse(l.at);return(Number.isFinite(o)?Math.min(r,Math.max(a,o/60)):a)/Math.max(1,n)}function c(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t+324e5).toISOString().slice(11,19):"—"}function u(e){if(null===e||!Number.isFinite(e)||e<0)return"—";if(e<1e3)return"".concat(Math.round(e),"ms");let t=Math.round(e/1e3);if(t<60)return"".concat(t,"초");let n=Math.floor(t/60);return n<60?"".concat(n,"분 ").concat(t%60,"초"):"".concat(Math.floor(n/60),"시간 ").concat(n%60,"분")}var p=n(80920),m=n(2504);n(46914),n(53006),n(53648);var x=n(17225),h=n(39636);let f="group:",g=e=>e.startsWith(f);function b(e){let t=new Map;for(let n of e.nodes){let e="string"==typeof n.group?n.group.trim():"";e&&t.set(n.node_id,e)}return t}let v={pending:"var(--border, #94a3b8)",running:"#f59e0b",passed:"var(--chart-2, #16a34a)",failed:"var(--destructive, #ef4444)"},y={pending:"대기",running:"도는 중",passed:"통과",failed:"실패"},j={agent:"#3b82f6",gate:"#f59e0b",git:"#10b981",judge:"#a855f7",observe:"#06b6d4",hitl:"#f43f5e",subgraph:"#8b5cf6"},w={pending:"var(--border, #cbd5e1)",running:"#f59e0b",passed:"var(--chart-2, #16a34a)",failed:"var(--destructive, #ef4444)"},N={pending:"대기",running:"도는 중",passed:"통과",failed:"실패"},k={pending:"workflow-node-status",running:"workflow-node-status workflow-node-status-running",passed:"workflow-node-status workflow-node-status-done",failed:"workflow-node-status workflow-node-status-failed"},M=[1,4,16],I={live:function(e){var t;let{data:n}=e;return(0,a.jsxs)("div",{"data-testid":"live-node-".concat(n.label),"data-state":n.state,className:"relative rounded-lg border-2 bg-surface px-3 py-2 shadow-sm transition-opacity duration-300 ".concat(k[n.state]," ").concat("pending"===n.state?n.unrecorded?"opacity-35":"opacity-60":""),style:{width:x.E,height:n.height,borderColor:w[n.state],borderLeft:"5px solid ".concat(null!=(t=j[n.kind])?t:"#64748b"),outline:n.focused?"2px solid var(--accent, #8b5cf6)":void 0,outlineOffset:3},children:[(0,a.jsx)(p.h7,{id:"in",type:"target",position:m.yX.Left,className:"!pointer-events-none !opacity-0"}),(0,a.jsxs)("div",{className:"flex items-center gap-1 text-[11px] text-text-tertiary",children:[(0,a.jsx)("span",{children:"subgraph"===n.kind?"묶음 \xb7 눌러서 펼치기":n.kind}),n.entry&&(0,a.jsx)("span",{className:"rounded bg-success/15 px-1 text-success",children:"시작"}),n.terminal&&(0,a.jsx)("span",{className:"rounded bg-accent/15 px-1 text-accent",children:"끝"}),(0,a.jsx)("span",{className:"ml-auto font-medium",style:{color:w[n.state]},children:n.unrecorded?"기록 없음":N[n.state]})]}),(0,a.jsx)("div",{className:"truncate font-mono text-sm font-semibold text-text-primary",children:g(n.label)?"▣ ".concat(n.label.slice(f.length)):n.label}),(0,a.jsxs)("div",{className:"truncate text-[11px] text-text-tertiary",title:n.recipe,children:[n.recipe," \xb7 최대 ",n.maxVisits,"회"]}),n.visits>1&&(0,a.jsxs)("span",{"data-testid":"visit-badge-".concat(n.label),className:"absolute -right-2 -top-2 rounded-full bg-amber-500 px-1.5 text-xs font-bold text-white shadow",children:["\xd7",n.visits]}),(0,a.jsx)(p.h7,{id:"out",type:"source",position:m.yX.Right,className:"!pointer-events-none !opacity-0"})]})},groupBox:function(e){let{data:t}=e,n=v[t.state];return(0,a.jsx)("div",{"data-testid":"group-box-".concat(t.group),"data-state":t.state,className:"pointer-events-none rounded-xl border-2 border-dashed ".concat(t.unrecorded?"opacity-60":""),style:{width:t.width,height:t.height,borderColor:n,background:"color-mix(in srgb, ".concat(n," 6%, transparent)")},children:(0,a.jsxs)("div",{className:"pointer-events-auto flex items-center gap-2 px-2.5 py-1 text-xs",children:[(0,a.jsx)("span",{className:"font-mono font-semibold text-text-primary",children:t.group}),(0,a.jsx)("span",{className:"text-[11px]",style:{color:n},children:t.unrecorded?"기록 없음":y[t.state]}),(0,a.jsxs)("span",{className:"text-[11px] text-text-tertiary",children:["노드 ",t.memberCount]}),t.onCollapse&&(0,a.jsx)("button",{type:"button",onClick:e=>{var n;e.stopPropagation(),null==(n=t.onCollapse)||n.call(t,t.group)},className:"nodrag ml-auto rounded border border-border bg-background px-1.5 text-[11px] text-text-secondary",children:"접기"})]})})}},S={live:function(e){let{id:t,data:n,markerEnd:r,style:l}=e;if(!(null==n?void 0:n.route))return null;let{route:s}=n,o=h.Bu[s.family],i="back"===s.kind;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.tE,{id:t,path:s.path,markerEnd:r,style:{stroke:o,strokeWidth:n.active?4:n.taken?3:1.5,opacity:n.active||n.taken?1:.22,transition:"opacity 300ms, stroke-width 300ms",...i?{strokeDasharray:"6 4"}:{},...l,...(null==l?void 0:l.stroke)?{opacity:1}:{}}}),n.active&&(0,a.jsxs)("g",{"data-testid":"edge-token-".concat(s.from,"-").concat(s.to),opacity:null==l?void 0:l.opacity,children:[(0,a.jsx)("circle",{r:7,fill:o,opacity:.25,children:(0,a.jsx)("animateMotion",{dur:"".concat(n.tokenMs,"ms"),fill:"freeze",path:s.path})}),(0,a.jsx)("circle",{r:4.5,fill:o,stroke:"var(--background, #fff)",strokeWidth:1.5,children:(0,a.jsx)("animateMotion",{dur:"".concat(n.tokenMs,"ms"),fill:"freeze",path:s.path})})]},n.tokenKey),s.label&&(0,a.jsx)(p.rV,{children:(0,a.jsx)("div",{className:"nodrag nopan pointer-events-none absolute whitespace-nowrap rounded-full border px-1.5 font-mono text-[11px] leading-4",style:{transform:"translate(-50%, -50%) translate(".concat(s.label.x,"px, ").concat(s.label.y,"px)"),width:s.label.width,textAlign:"center",borderColor:o,color:o,background:"var(--background, #fff)",opacity:n.active||n.taken?1:.35,fontWeight:n.active?700:500,...(null==l?void 0:l.opacity)!==void 0?{opacity:l.opacity}:{}},children:s.label.text})})]})}};function C(e){var t,n,l,m,v,y;let{runId:j,initialFolded:w=!1}=e,N=(0,o.M1)(),k=(0,s.I)({queryKey:["harness-run-traversal",j],queryFn:()=>N.getHarnessRunTraversal(j),refetchInterval:e=>{var t;return(null==(t=e.state.data)?void 0:t.status)==="running"&&4e3}}),C=k.data,_=(0,s.I)({queryKey:["run-graph",null==C?void 0:C.graphId],queryFn:()=>N.getRunGraph(C.graphId),enabled:!!(null==C?void 0:C.graphId),retry:!1,staleTime:6e4}),E=(0,r.useMemo)(()=>{var e;return null!=(e=null==C?void 0:C.steps)?e:[]},[C]),T=(0,r.useMemo)(()=>{var e;if(!C)return null;let t=_.data;return t?function(e,t){let n=new Set(e.nodes.map(e=>e.node_id)),a=[...new Set(t.map(e=>e.node))].filter(e=>!n.has(e)),r=t=>e.edges.filter(e=>e.from===t).flatMap(e=>e.map?Object.values(e.map):e.to?[e.to]:[]),l=[];for(let e=1;e<t.length;e+=1){let n=t[e-1].node,a=t[e].node;r(n).includes(a)||l.some(e=>e.from===n&&e.to===a)||l.push({from:n,to:a})}return 0===a.length&&0===l.length?e:{...e,nodes:[...e.nodes,...a.map(e=>({node_id:e,kind:"agent",recipe:"원장에서 본 노드(선언 밖)",max_visits:t.filter(t=>t.node===e).length}))],edges:[...e.edges,...l]}}(t,E):_.isLoading&&C.graphId?null:function(e,t){var n,a,r;let l=[...new Set(t.map(e=>e.node))],s=new Map;for(let e=1;e<t.length;e+=1){let r=t[e-1],l=null!=(n=s.get(r.node))?n:{},o=null!=(a=r.outcome)?a:"pass";Object.values(l).includes(t[e].node)||(l[l[o]?"".concat(o,"\xb7").concat(t[e].node):o]=t[e].node),s.set(r.node,l)}return{id:e,source:"core",editable:!1,entry_node:null!=(r=l[0])?r:"",terminal_nodes:t.length?[t.at(-1).node]:[],nodes:l.map(e=>({node_id:e,kind:"agent",recipe:"원장에서 본 노드",max_visits:t.filter(t=>t.node===e).length})),edges:[...s.entries()].map(e=>{let[t,n]=e;return{from:t,on:"outcome",map:n}})}}(null!=(e=C.graphId)?e:C.runId,E)},[C,_.data,_.isLoading,E]),[O,R]=(0,r.useState)(()=>new Set),F=(0,r.useMemo)(()=>T?[...new Set(b(T).values())]:[],[T]),z=(0,r.useMemo)(()=>T?b(T):new Map,[T]),D=(0,r.useRef)(!1);(0,r.useEffect)(()=>{w&&!D.current&&0!==F.length&&(D.current=!0,R(new Set(F)))},[w,F]);let V=(0,r.useMemo)(()=>T?function(e,t){let n=b(e),a=e=>{let a=n.get(e);return a&&t.has(a)?"".concat(f).concat(a):e};if(![...n.values()].some(e=>t.has(e)))return{graph:e,resolve:a};let r=[],l=new Set;for(let t of e.nodes){let s=a(t.node_id);if(l.has(s))continue;if(l.add(s),s===t.node_id){r.push(t);continue}let o=n.get(t.node_id),i=e.nodes.filter(e=>n.get(e.node_id)===o);r.push({node_id:s,kind:"subgraph",recipe:"묶음 \xb7 노드 ".concat(i.length,"개"),max_visits:Math.max(...i.map(e=>e.max_visits)),group:o})}let s=[];for(let t of e.edges){let e=a(t.from);if(t.map){let n={};for(let[r,l]of Object.entries(t.map)){let t=a(l);t!==e&&(n[r]=t)}Object.keys(n).length&&s.push({from:e,...t.on?{on:t.on}:{},map:n})}else if(t.to){let n=a(t.to);n!==e&&s.push({from:e,to:n})}}let o=[];for(let e of s){let t=o.find(t=>t.from===e.from&&!!t.map==!!e.map&&(e.map||t.to===e.to));if(!t){o.push(e.map?{...e,map:{...e.map}}:e);continue}if(e.map&&t.map)for(let[n,a]of Object.entries(e.map))n in t.map?t.map[n]===a||Object.values(t.map).includes(a)||(t.map["".concat(n,"\xb7").concat(a.replace(f,""))]=a):t.map[n]=a}let i=a(e.entry_node),d=[...new Set(e.terminal_nodes.map(a))];return{graph:{...e,entry_node:i,terminal_nodes:d,nodes:r,edges:o},resolve:a}}(T,O):null,[T,O]),L=(0,r.useMemo)(()=>V?(0,x.h)(V.graph):null,[V]),Z=(0,r.useMemo)(()=>V?E.map(e=>({...e,node:V.resolve(e.node)})):E,[V,E]),A=(0,r.useMemo)(()=>{var e;return null!=(e=null==L?void 0:L.edges.map(e=>({id:e.id,from:e.source,to:e.target,outcomes:e.data.route.outcomes})))?e:[]},[L]),K=(null==C?void 0:C.status)==="running",[q,B]=(0,r.useState)(null),W=null!=q?q:K?"live":"replay",[P,H]=(0,r.useState)(-1),[G,X]=(0,r.useState)(!1),[$,Q]=(0,r.useState)(!1),[U,J]=(0,r.useState)(4),[Y,ee]=(0,r.useState)(null),[et,en]=(0,r.useState)(null),[ea,er]=(0,r.useState)(!0),el=(0,r.useRef)(null),es=(0,r.useRef)(null),[eo,ei]=(0,r.useState)(0),ed=(0,r.useRef)(!1);(0,r.useEffect)(()=>{C&&!ed.current&&0!==E.length&&(ed.current=!0,"running"===C.status?(H(E.length-1),X(null===E.at(-1).outcome)):(H(0),X(!0),Q(!0)))},[C,E]),(0,r.useEffect)(()=>{"live"===W&&0!==E.length&&(H(E.length-1),X(null===E.at(-1).outcome))},[W,E]),(0,r.useEffect)(()=>{if("replay"!==W||!$||0===E.length)return;let e=d(E,P,U),t=window.setTimeout(()=>X(!1),e/2),n=window.setTimeout(()=>{if(P>=E.length-1)return void Q(!1);H(e=>e+1),X(!0)},e);return()=>{window.clearTimeout(t),window.clearTimeout(n)}},[W,$,P,U,E]);let ec=(0,r.useMemo)(()=>new Set(Z.map(e=>e.node)),[Z]),eu=(0,r.useMemo)(()=>{var e;return function(e,t,n,a){let r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],l=Object.fromEntries(e.map(e=>[e,"pending"])),s={},o=new Set,d=null,c=Math.min(a,n.length-1);for(let e=0;e<=c;e+=1){var u,p;let a=n[e];if(s[a.node]=(null!=(u=s[a.node])?u:0)+1,l[a.node]=e===c&&r||null===(p=a.outcome)?"running":i.has(p.toLowerCase())?"failed":"passed",e>0){let r=n[e-1],l=function(e,t,n,a){var r;let l=e.filter(e=>e.from===t&&e.to===a);return 0===l.length?null:null!=(r=l.find(e=>null!==n&&e.outcomes.includes(n)))?r:l[0]}(t,r.node,r.outcome,a.node);l&&(o.add(l.id),e===c&&(d=l.id))}}return{nodeState:l,visits:s,takenEdges:o,activeEdge:d,cursor:c}}(null!=(e=null==L?void 0:L.nodes.map(e=>e.id))?e:[],A,Z,P,G)},[L,A,Z,P,G]),ep=(0,r.useCallback)(e=>R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),[]),em="replay"===W?Math.max(250,.6*d(E,Math.max(0,P-1),U)):1200,ex=(0,r.useMemo)(()=>{var e;return(0,h.d1)((null==L?void 0:L.nodes.some(e=>e.id===et))?et:null,null!=(e=null==L?void 0:L.edges.map(e=>({id:e.id,from:e.source,to:e.target})))?e:[])},[et,L]),eh=(0,r.useMemo)(()=>{if(!L)return[];let e=L.nodes.map(e=>{var t,n;return{...e,type:"live",zIndex:1,...ex&&!ex.nodes.has(e.id)?{style:{...e.style,opacity:h.zZ.dimNode}}:{},data:{...e.data,state:null!=(t=eu.nodeState[e.id])?t:"pending",visits:null!=(n=eu.visits[e.id])?n:0,focused:Y===e.id,unrecorded:!K&&!ec.has(e.id)}}});return[...(function(e,t){let n=new Map;for(let r of e){var a;let e=t.get(r.id);!e||g(r.id)||n.set(e,[...null!=(a=n.get(e))?a:[],r])}return[...n.entries()].map(e=>{let[t,n]=e,a=Math.min(...n.map(e=>e.position.x)),r=Math.min(...n.map(e=>e.position.y)),l=Math.max(...n.map(e=>e.position.x+e.width)),s=Math.max(...n.map(e=>e.position.y+e.height));return{id:"box:".concat(t),group:t,members:n.map(e=>e.id),x:a-18,y:r-18-26,width:l-a+36,height:s-r+36+26}})})(L.nodes.map(e=>({id:e.id,position:e.position,width:x.E,height:e.data.height})),z).map(e=>{var t;return{id:e.id,type:"groupBox",position:{x:e.x,y:e.y},zIndex:0,selectable:!1,draggable:!1,focusable:!1,data:{group:e.group,memberCount:e.members.length,width:e.width,height:e.height,onCollapse:ep,state:(t=e.members.map(e=>{var t;return null!=(t=eu.nodeState[e])?t:"pending"})).includes("running")?"running":t.includes("failed")?"failed":t.includes("passed")?"passed":"pending",unrecorded:!K&&e.members.every(e=>!ec.has(e))}}}),...e]},[L,eu,Y,ex,K,ec,z,ep]),ef=(0,r.useMemo)(()=>{var e;return null!=(e=null==L?void 0:L.edges.map(e=>({...e,type:"live",...(0,h.f_)(ex,e.id),className:(null==ex?void 0:ex.edges.has(e.id))?"wiring-edge-flow":void 0,data:{...e.data,taken:eu.takenEdges.has(e.id),active:eu.activeEdge===e.id,tokenKey:"".concat(e.id,":").concat(eu.cursor),tokenMs:em}})))?e:[]},[L,eu,em,ex]),eg=(0,r.useCallback)(e=>{ee(e);let t=el.current;t&&(e?t.fitView({nodes:[{id:e}],duration:600,maxZoom:1.4,padding:.6}):t.fitView({duration:600,padding:.08,minZoom:.5}))},[]),eb=null!=(n=null==(t=Z[P])?void 0:t.node)?n:null;(0,r.useEffect)(()=>{var e,t;if(!ea||Y||!eb||!L)return;let n=L.nodes.find(e=>e.id===eb),a=el.current;if(!n||!a)return;let r=Math.min(1,Math.max(.78,(null!=(t=null==(e=es.current)?void 0:e.clientWidth)?t:1e3)/900));a.setCenter(n.position.x+x.E/2,n.position.y+n.data.height/2,{zoom:r,duration:400})},[ea,Y,eb,L,eo]);let ev="replay"===W&&!$&&E.length>0&&P===E.length-1;(0,r.useEffect)(()=>{var e,t;if(!ev||!ea||Y||(null!=(t=null==(e=es.current)?void 0:e.clientWidth)?t:1e3)<700)return;let n=window.setTimeout(()=>{var e;null==(e=el.current)||e.fitView({nodes:[...ec].map(e=>({id:e})),duration:800,padding:.08,minZoom:.5})},1200);return()=>window.clearTimeout(n)},[ev,ea,Y,ec]);let ey=e=>{B("replay"),Q(!1),H(e),X(!1)};if(k.isLoading)return(0,a.jsx)("p",{className:"p-4 text-sm text-text-tertiary",children:"런 원장을 읽는 중…"});if(k.isError||!C)return(0,a.jsxs)("p",{role:"alert",className:"p-4 text-sm text-error",children:["이 런의 원장을 읽지 못했습니다 (",j,")."]});let ej=Y?E.map((e,t)=>({step:e,index:t})).filter(e=>{var t;let{step:n}=e;return(null!=(t=null==V?void 0:V.resolve(n.node))?t:n.node)===Y}):[],ew=P>=0?E[P]:void 0;return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"rounded-full px-2 py-0.5 text-xs font-semibold ".concat(K?"bg-amber-500/15 text-amber-600 dark:text-amber-400":"completed"===C.status?"bg-success/15 text-success":"bg-error/15 text-error"),children:function(e){switch(e){case"running":return"● 도는 중";case"completed":return"완료";case"failed":return"실패";case"abandoned":return"버려짐";case"cancelled":return"취소됨";default:return e}}(C.status)}),(0,a.jsx)("h2",{className:"order-first min-w-0 basis-full truncate text-sm font-semibold text-text-primary sm:order-none sm:basis-0 sm:flex-1",title:null!=(l=C.title)?l:void 0,children:null!=(m=C.title)?m:C.runId}),null!==C.prNumber&&(0,a.jsxs)("span",{className:"text-xs text-text-secondary",children:["PR #",C.prNumber]}),(0,a.jsxs)("span",{className:"font-mono text-[11px] text-text-tertiary",children:[C.runId.slice(0,12)," \xb7 ",null!=(v=C.graphId)?v:"그래프 모름",C.substrate?" \xb7 ".concat(C.substrate):""]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[(0,a.jsxs)("div",{role:"group","aria-label":"보기",className:"flex overflow-hidden rounded border border-border",children:[(0,a.jsx)("button",{type:"button",disabled:!K,onClick:()=>{B("live"),Q(!1)},className:"px-2 py-1 ".concat("live"===W?"bg-primary text-primary-foreground":""," disabled:opacity-40"),children:"● 라이브"}),(0,a.jsx)("button",{type:"button",onClick:()=>{B("replay")},className:"px-2 py-1 ".concat("replay"===W?"bg-primary text-primary-foreground":""),children:"리플레이"})]}),"replay"===W&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button","aria-label":$?"일시정지":"재생",onClick:()=>{!$&&P>=E.length-1&&(H(0),X(!0)),Q(!$)},className:"rounded border border-border px-2.5 py-1 font-semibold",children:$?"⏸ 일시정지":"▶ 재생"}),(0,a.jsx)("button",{type:"button",onClick:()=>{H(0),X(!0),Q(!1)},className:"rounded border border-border px-2 py-1",children:"처음"}),(0,a.jsx)("div",{role:"group","aria-label":"속도",className:"flex overflow-hidden rounded border border-border",children:M.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>J(e),"aria-pressed":U===e,className:"px-2 py-1 ".concat(U===e?"bg-accent/20 font-semibold text-text-primary":"text-text-secondary"),children:[e,"\xd7"]},e))}),(0,a.jsx)("input",{type:"range","aria-label":"재생 위치",min:0,max:Math.max(0,E.length-1),value:Math.max(0,P),onChange:e=>ey(Number(e.target.value)),className:"min-w-[120px] flex-1"})]}),(0,a.jsxs)("span",{className:"text-text-tertiary",children:[Math.max(0,P+1),"/",E.length," 단계",ew?" \xb7 ".concat(ew.node," \xd7").concat(ew.visit):""]}),(0,a.jsx)("button",{type:"button",onClick:()=>{er(!1),eg(null)},className:"rounded border border-border px-2 py-1",children:"전체 보기"}),(0,a.jsx)("button",{type:"button","aria-pressed":ea,onClick:()=>{er(!ea),ee(null)},className:"rounded border px-2 py-1 ".concat(ea?"border-primary text-primary":"border-border"),children:"카메라 따라가기"}),F.length>0&&(0,a.jsx)("button",{type:"button","data-testid":"toggle-units",onClick:()=>{ee(null),R(O.size===F.length?new Set:new Set(F))},className:"rounded border border-border px-2 py-1",children:O.size===F.length?"묶음 펼치기 (통합 보기)":"묶음 접기"})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 lg:flex-row",children:[(0,a.jsxs)("section",{ref:es,"aria-label":"실행 그래프",className:"relative h-[60dvh] min-h-[340px] min-w-0 overflow-hidden rounded-lg border border-border bg-surface lg:h-[calc(100dvh-230px)] lg:min-h-[520px] lg:flex-1",children:[0===E.length&&(0,a.jsx)("p",{className:"absolute left-3 top-3 z-10 text-xs text-text-tertiary",children:"아직 노드에 들어가지 않았습니다(원장에 `pipeline-node-entry` 없음)."}),L&&(0,a.jsxs)(p.Gc,{nodes:eh,edges:ef,nodeTypes:I,edgeTypes:S,onInit:e=>{el.current=e,ei(e=>e+1)},onNodeMouseEnter:(e,t)=>{"groupBox"!==t.type&&en(t.id)},onNodeMouseLeave:()=>en(null),onNodeClick:(e,t)=>{if("groupBox"!==t.type){if(g(t.id)){var n;let e=null!=(n=t.data.group)?n:t.id.slice(6);ep(e),ee(null),window.setTimeout(()=>{var t;null==(t=el.current)||t.fitView({nodes:[{id:"box:".concat(e)}],duration:600,maxZoom:1.4,padding:.2})},80);return}eg(Y===t.id?null:t.id)}},onPaneClick:()=>{Y&&eg(null)},fitView:!0,fitViewOptions:{padding:.08,minZoom:.5},minZoom:.2,maxZoom:2,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,edgesFocusable:!1,deleteKeyCode:null,proOptions:{hideAttribution:!0},className:"!bg-surface",children:[(0,a.jsx)(p.VS,{}),(0,a.jsx)(p.H2,{showInteractive:!1})]},"".concat(null!=(y=null==T?void 0:T.id)?y:"graph",":").concat([...O].sort().join(","))),Y&&(0,a.jsxs)("div",{"data-testid":"node-detail",className:"absolute bottom-3 left-3 right-3 z-10 max-h-[45%] overflow-y-auto rounded-lg border border-border bg-background/95 p-3 text-xs shadow-lg backdrop-blur sm:right-auto sm:w-[320px]",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono text-sm font-semibold text-text-primary",children:Y}),(0,a.jsxs)("span",{className:"text-text-tertiary",children:["방문 ",ej.length,"회"]}),(0,a.jsx)("button",{type:"button",onClick:()=>eg(null),className:"ml-auto rounded border border-border px-1.5",children:"닫기"})]}),0===ej.length&&(0,a.jsx)("p",{className:"text-text-tertiary",children:K?"아직 이 노드에 들어가지 않았습니다.":"기록 없음 — 이 런의 원장에 이 노드의 사건이 없습니다."}),(0,a.jsx)("ul",{className:"space-y-1",children:ej.map(e=>{var t;let{step:n,index:r}=e;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>ey(r),className:"w-full rounded px-1 py-0.5 text-left hover:bg-surface-elevated",children:[(0,a.jsx)("span",{className:"font-mono text-text-secondary",children:c(n.at)})," ",(0,a.jsxs)("span",{className:"font-semibold",children:["\xd7",n.visit]})," ",(0,a.jsx)("span",{className:"fail"===n.outcome?"text-error":null===n.outcome?"text-amber-500":"text-success",children:null!=(t=n.outcome)?t:"도는 중"})," ",(0,a.jsx)("span",{className:"text-text-tertiary",children:u(n.durationMs)}),n.detail&&(0,a.jsx)("span",{className:"block text-text-secondary",children:n.detail})]})},r)})})]})]}),(0,a.jsxs)("aside",{"aria-label":"실행 타임라인",className:"max-h-[420px] overflow-y-auto rounded-lg border border-border bg-surface lg:max-h-[calc(100dvh-230px)] lg:w-[340px] lg:shrink-0",children:[(0,a.jsx)("h3",{className:"sticky top-0 border-b border-border bg-surface px-3 py-2 text-xs font-semibold",children:"타임라인 (KST)"}),(0,a.jsx)("ol",{children:E.map((e,t)=>{var n,r;let l=t>P,s=t===P;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>{var n;ey(t),eg(null!=(n=null==V?void 0:V.resolve(e.node))?n:e.node)},"data-testid":"timeline-step-".concat(t),className:"grid w-full grid-cols-[64px_1fr_auto] items-baseline gap-x-2 border-b border-border/60 px-3 py-1.5 text-left text-xs transition-opacity ".concat(l?"opacity-35":""," ").concat(s?"bg-accent/10":"hover:bg-surface-elevated"),children:[(0,a.jsx)("span",{className:"font-mono text-text-tertiary",children:c(e.at)}),(0,a.jsxs)("span",{className:"font-mono font-semibold text-text-primary",children:[e.node,e.visit>1?" \xd7".concat(e.visit):""]}),(0,a.jsx)("span",{className:"fail"===e.outcome?"text-error":null===e.outcome?"text-amber-500":"text-success",children:null===e.outcome?"도는 중":"fail"===e.outcome?"실패":"통과"}),(0,a.jsx)("span",{className:"text-[11px] text-text-tertiary",children:u(e.durationMs)}),(0,a.jsx)("span",{className:"col-span-2 truncate text-[11px] text-text-secondary",title:null!=(n=e.detail)?n:void 0,children:null!=(r=e.detail)?r:""})]})},t)})})]})]}),(0,a.jsxs)("p",{className:"shrink-0 text-[11px] text-text-tertiary",children:["배선도 디자인: ",(0,a.jsx)("a",{href:"https://malfoy-meme-making.vercel.app/wiring/index.html",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"공냥이 AI 실험실"})]})]})}function _(){return(0,o.Qj)()?(0,a.jsx)(E,{}):(0,a.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"런 장면"}),(0,a.jsx)("p",{className:"text-sm text-text-secondary",children:"데몬에 연결되면 하니스 런 하나가 도는 장면을 그립니다."})]})}function E(){var e;let t=(0,o.M1)(),n=(0,l.useRouter)(),i=(0,l.useSearchParams)(),d=(null==(e=i.get("run"))?void 0:e.trim())||null,u=(0,r.useMemo)(()=>Date.now()-864e5,[]),p=(0,s.I)({queryKey:["harness-runs-since",u],queryFn:()=>t.getHarnessRunsSince(u),refetchInterval:3e4}),m=(0,r.useMemo)(()=>{var e,t;return p.data?function(e,t){let n=e=>(function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,a=(null!=(t=null==e?void 0:e.split("\n").map(e=>e.trim()).find(Boolean))?t:"").replace(/\s*\[truncated[^\]]*\]\s*$/,"").replace(/(?:~|\.{0,2})?\/?(?:[\w.@-]+\/)+([\w.@-]+)/g,"$1");return a.length>n?"".concat(a.slice(0,n-1),"…"):a})(e),a=[...e].sort((e,t)=>{var n,a;return Date.parse(null!=(n=t.lastActivityTimestamp)?n:"")-Date.parse(null!=(a=e.lastActivityTimestamp)?a:"")||0}).map(e=>{var t;return{runId:e.runId,label:n(e.objective)||e.runId,live:!0,at:null!=(t=e.lastActivityTimestamp)?t:null}}),r=new Set(a.map(e=>e.runId));return[...a,...t.filter(e=>!r.has(e.runId)).map(e=>({runId:e.runId,label:n(e.objective)||e.runId,live:!1,at:e.endedAt}))]}(null!=(e=p.data.entries)?e:[],null!=(t=p.data.finished)?t:[]):[]},[p.data]),x=e=>n.replace("/live-run/?run=".concat(encodeURIComponent(e)));return(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto p-4",children:[(0,a.jsxs)("header",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h1",{className:"text-base font-semibold text-text-primary",children:"런 장면"}),(0,a.jsx)("span",{className:"text-xs text-text-tertiary",children:"하니스 런 하나가 실제로 밟은 노드\xb7간선 (라이브 \xb7 리플레이)"}),(0,a.jsxs)("label",{className:"flex w-full min-w-0 items-center gap-1 text-xs text-text-secondary sm:ml-auto sm:w-auto sm:min-w-[320px]",children:[(0,a.jsx)("span",{className:"shrink-0",children:"런"}),(0,a.jsxs)("select",{"aria-label":"런 고르기",value:null!=d?d:"",onChange:e=>{e.target.value&&x(e.target.value)},className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1 text-xs text-text-primary",children:[(0,a.jsx)("option",{value:"",children:p.isLoading?"불러오는 중…":m.length?"런을 고르세요":"최근 24시간 런 없음"}),d&&!m.some(e=>e.runId===d)&&(0,a.jsx)("option",{value:d,children:d}),m.some(e=>e.live)&&(0,a.jsx)("optgroup",{label:"도는 중",children:m.filter(e=>e.live).map(e=>(0,a.jsxs)("option",{value:e.runId,children:["● ",e.label]},e.runId))}),m.some(e=>!e.live)&&(0,a.jsx)("optgroup",{label:"끝난 런 (최근 24시간)",children:m.filter(e=>!e.live).map(e=>(0,a.jsxs)("option",{value:e.runId,children:[e.at?"".concat(c(e.at).slice(0,5)," \xb7 "):"",e.label]},e.runId))})]})]})]}),p.isError&&(0,a.jsx)("p",{role:"status",className:"text-xs text-warning",children:"런 목록을 읽지 못했습니다 — 주소에 ?run=<runId> 를 주면 그 런은 그대로 그립니다."}),d?(0,a.jsx)(C,{runId:d,initialFolded:"folded"===i.get("units")},d):(0,a.jsx)("ul",{className:"grid gap-2 sm:grid-cols-2",children:m.slice(0,12).map(e=>(0,a.jsx)("li",{children:(0,a.jsxs)("button",{type:"button",onClick:()=>x(e.runId),className:"w-full rounded-lg border border-border bg-surface p-3 text-left hover:bg-surface-elevated",children:[(0,a.jsx)("span",{className:"text-xs font-semibold ".concat(e.live?"text-amber-500":"text-text-tertiary"),children:e.live?"● 도는 중":"끝남 ".concat(e.at?c(e.at):"")}),(0,a.jsx)("span",{className:"mt-1 block truncate text-sm text-text-primary",children:e.label}),(0,a.jsx)("span",{className:"block font-mono text-[11px] text-text-tertiary",children:e.runId})]})},e.runId))})]})}function T(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)("p",{className:"p-4 text-sm",children:"런 장면을 불러오는 중…"}),children:(0,a.jsx)(_,{})})}}},e=>{e.O(0,[5225,2609,8411,8604,2566,9917,4089,1729,7247,599,2201,6356,7358],()=>e(e.s=48986)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9902],{5794:(e,s,r)=>{"use strict";r.d(s,{r:()=>d});var t=r(77194),l=r(64862),n=r.n(l);let a=[{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 d(e){let{active:s}=e;return(0,t.jsxs)("nav",{"aria-label":"Mission Fabric 파이프라인","data-testid":"fabric-stage-header",className:"flex flex-wrap items-center gap-1 text-xs",children:[(0,t.jsx)("span",{className:"mr-1 text-muted-foreground",children:"Missions"}),a.map((e,r)=>(0,t.jsxs)("span",{className:"flex items-center gap-1",children:[(0,t.jsxs)(n(),{href:e.href,"aria-current":e.key===s?"page":void 0,className:["rounded px-2 py-1 ring-1 transition-colors",e.key===s?"bg-primary/15 font-medium text-foreground ring-primary/40":"text-muted-foreground ring-border hover:bg-muted hover:text-foreground"].join(" "),children:[(0,t.jsx)("span",{className:"mr-1",children:e.num}),e.label,(0,t.jsx)("span",{className:"ml-1 text-[10px] opacity-70",children:e.sub})]}),r<a.length-1&&(0,t.jsx)("span",{className:"text-muted-foreground/50","aria-hidden":!0,children:"→"})]},e.key))]})}},29916:(e,s,r)=>{"use strict";r.d(s,{BX:()=>l});let t=new Map;function l(e,s){var r,l;let n=t.get(e);if(!n){let l;try{l=new EventSource(e)}catch(e){return null==(r=s.onConstructError)||r.call(s,e),()=>{}}let a={source:l,subscribers:new Set};l.onmessage=e=>{var s,r;for(let t of[...a.subscribers])null==(s=(r=t.handlers).onMessage)||s.call(r,e)},l.onerror=e=>{var s,r;for(let t of[...a.subscribers])null==(s=(r=t.handlers).onError)||s.call(r,e)},t.set(e,a),n=a}let a=n,d=[];for(let[e,r]of Object.entries(null!=(l=s.events)?l:{})){let s=e=>{r(e)};a.source.addEventListener(e,s),d.push([e,s])}let o={handlers:s};a.subscribers.add(o);let c=!1;return()=>{if(!c){for(let[e,s]of(c=!0,d))try{a.source.removeEventListener(e,s)}catch(e){}if(a.subscribers.delete(o),0===a.subscribers.size){try{a.source.close()}catch(e){}t.get(e)===a&&t.delete(e)}}}}},59016:(e,s,r)=>{"use strict";r.d(s,{D:()=>t,F:()=>l});let t="/loops?view=interact";function l(e){return(null==e?void 0:e.get("view"))==="resources"?"resources":(null==e?void 0:e.get("view"))==="interact"?"interact":"status"}},76923:(e,s,r)=>{"use strict";r.d(s,{LoopsView:()=>k});var t=r(77194),l=r(64862),n=r.n(l),a=r(98451),d=r(5794),o=r(2803),c=r(49954),i=r(8801),x=r(78751);let u={"살아 있음":"bg-emerald-500/15 text-emerald-300 ring-emerald-500/30",늦음:"bg-red-500/15 text-red-300 ring-red-500/30",실패:"bg-red-500/15 text-red-300 ring-red-500/30",꺼짐:"bg-muted text-muted-foreground ring-border","판정 불가":"bg-muted text-muted-foreground ring-border"};function m(e){let{value:s}=e;return(0,t.jsx)("span",{"data-loop-verdict":s,className:"inline-flex shrink-0 rounded-full px-2 py-0.5 text-xs font-semibold ring-1 ".concat(u[s]),children:s})}function h(e){let{rows:s,state:r}=e;return"loading"===r?(0,t.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"루프 현황을 읽는 중…"}):"error"===r?(0,t.jsx)("p",{role:"alert",className:"text-sm text-red-300",children:"루프 현황을 읽지 못했습니다. 일부 레지스트리 조회가 실패했습니다. 데몬 연결을 확인하세요."}):s.length?(0,t.jsxs)("div",{className:"rounded-xl border border-border bg-card",children:[(0,t.jsxs)("table",{className:"hidden w-full table-fixed text-left text-sm md:table",children:[(0,t.jsx)("thead",{className:"border-b border-border text-muted-foreground",children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{scope:"col",className:"w-1/4 px-4 py-3",children:"루프 \xb7 층"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3",children:"주인(자리)"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3",children:"모드"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3",children:"마지막 실행 시각"}),(0,t.jsx)("th",{scope:"col",className:"px-4 py-3",children:"판정"})]})}),(0,t.jsx)("tbody",{children:s.map(e=>{var s;return(0,t.jsxs)("tr",{className:"border-b border-border/60 last:border-0","data-loop-id":e.id,children:[(0,t.jsxs)("th",{scope:"row",className:"break-words px-4 py-3 font-medium",children:[e.name,(0,t.jsx)("span",{className:"block text-xs font-normal text-muted-foreground",children:e.layer})]}),(0,t.jsx)("td",{className:"px-4 py-3",children:e.owner}),(0,t.jsx)("td",{className:"px-4 py-3",children:e.mode}),(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)("time",{dateTime:null!=(s=e.lastRun)?s:void 0,children:e.lastRun?new Date(e.lastRun).toLocaleString("ko-KR"):"기록 없음"})}),(0,t.jsx)("td",{className:"px-4 py-3",children:(0,t.jsx)(m,{value:e.verdict})})]},e.id)})})]}),(0,t.jsx)("ul",{className:"divide-y divide-border/60 md:hidden",children:s.map(e=>{var s;return(0,t.jsxs)("li",{className:"min-w-0 px-3 py-3","data-loop-id":e.id,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("strong",{className:"min-w-0 truncate text-sm",title:e.name,children:e.name}),(0,t.jsx)(m,{value:e.verdict})]}),(0,t.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:e.layer}),(0,t.jsxs)("span",{children:["\xb7 ",e.owner]}),(0,t.jsxs)("span",{children:["\xb7 ",e.mode]}),(0,t.jsxs)("time",{dateTime:null!=(s=e.lastRun)?s:void 0,children:["\xb7 ",e.lastRun?new Date(e.lastRun).toLocaleString("ko-KR"):"기록 없음"]})]})]},e.id)})})]}):(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"등록된 루프\xb7크론이 없습니다."}),(0,t.jsx)("p",{"data-plain-lead":"loop",className:"text-xs text-muted-foreground",children:"루프 = 당번 서는 AI — 정해진 때마다 스스로 깨어 맡은 일을 보고 기록을 남긴다."})]})}function p(){var e,s;let{client:r}=(0,i.Q)(),[l,a]=(0,c.useState)(null);(0,c.useEffect)(()=>{let e=(0,x.Pz)(e=>r.fetchJson(e),e=>{let{rows:s,state:t}=e;return a({client:r,rows:s,state:t})});e.refresh();let s=window.setInterval(()=>void e.refresh(),3e4);return()=>{e.dispose(),window.clearInterval(s)}},[r]);let o=(null==l?void 0:l.client)===r?l:null;return(0,t.jsxs)("main",{className:"mx-auto max-w-[1200px] space-y-5 p-4",children:[(0,t.jsx)(d.r,{active:"scheduler"}),(0,t.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"루프 현황"}),(0,t.jsx)("span",{className:"rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",children:"beta \xb7 운영용"})]}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"데몬의 루프\xb7크론 레지스트리 \xb7 늦음은 마지막 실행 후 주기의 2배 초과"})]}),(0,t.jsx)(n(),{href:"/scheduler",className:"rounded-lg border border-border px-3 py-2 text-sm hover:bg-accent",children:"전체 스케줄 →"})]}),(0,t.jsx)(h,{rows:null!=(e=null==o?void 0:o.rows)?e:[],state:null!=(s=null==o?void 0:o.state)?s:"loading"})]})}var b=r(80920);r(46914);var f=r(51587),j=r(86727);let g={resource:function(e){let{data:s}=e,{label:r,detail:l}=s;return(0,t.jsxs)("div",{className:"relative w-72 rounded-xl border border-sky-400 bg-[#173556] p-3 text-white shadow-md",children:[(0,t.jsx)("strong",{className:"break-words",children:(0,f.t)(r)}),(0,t.jsx)("p",{className:"mt-1 break-words text-xs",children:(0,f.t)(l)})]})}};function v(e){let{snapshot:s}=e,[r,l]=(0,c.useState)(1),n="near"===(0,j.QU)(r),a=s.resource.seats,{nodes:d,edges:o}=function(e,s){let r=e.resource.seats,t=s?r.map(e=>{var s;return"".concat(e.seat," ").concat(e.running,"/").concat(e.cap," \xb7 몫 ").concat(null!=(s=e.baseShare)?s:"못 읽음"," \xb7 발사 상한 ").concat(e.launchCap," \xb7 임대 ").concat(e.borrowed," \xb7 대여 ").concat(e.lent," \xb7 ").concat(e.nextCell?"대기 잡 ".concat(e.nextCell.id," ").concat(e.nextCell.title," (").concat(e.idle?"요청 가능":"대기 중",")"):"다음 잡 판정 없음")}).join(" / "):"자리 ".concat(r.length," \xb7 미배정 런 ").concat(e.resource.unassigned);return{nodes:[{id:j.qn,type:"resource",position:{x:0,y:0},data:{label:"자원 관리 루프",detail:t}}],edges:[]}}(s,n);return(0,t.jsxs)("section",{"aria-label":"자원 LOOP-INTERACT",className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm",children:"자리 \xb7 잡 \xb7 임대 \xb7 대기 — 확대하면 자리 몫과 다음 잡을 볼 수 있습니다."}),(0,t.jsx)("div",{className:"h-[520px] w-full min-w-0 rounded-xl border bg-[#10243b]",children:(0,t.jsxs)(b.Gc,{nodes:d,edges:o,nodeTypes:g,fitView:!0,minZoom:.25,maxZoom:2.5,onInit:e=>l(e.getZoom()),onMove:(e,s)=>l(s.zoom),nodesDraggable:!1,nodesConnectable:!1,edgesReconnectable:!1,deleteKeyCode:null,children:[(0,t.jsx)(b.VS,{}),(0,t.jsx)(b.H2,{showInteractive:!1})]})}),(0,t.jsx)("ul",{"aria-label":"자원 목록",className:"grid gap-2 sm:grid-cols-2",children:a.map(e=>{var s;return(0,t.jsxs)("li",{className:"rounded-lg border p-3",children:[(0,t.jsxs)("strong",{children:[e.seat," ",e.running,"/",e.cap]})," \xb7 몫 ",null!=(s=e.baseShare)?s:"못 읽음"," \xb7 발사 상한 ",e.launchCap," \xb7 ","임대 ",e.borrowed," \xb7 대여 ",e.lent," \xb7 ",e.nextCell?"대기 잡 ".concat((0,f.t)(e.nextCell.id)," \xb7 ").concat((0,f.t)(e.nextCell.title)," \xb7 ").concat(e.idle?"요청 가능":"대기 중"):"다음 잡 판정 없음"]},e.seat)})})]})}function N(){let{client:e}=(0,i.Q)(),[s,r]=(0,c.useState)(null);(0,c.useEffect)(()=>{let s=!0,t=!1,l=async()=>{if(s&&!t&&!document.hidden){t=!0;try{var l;let t=await e.fetchJson("/v1/loops/resources");if(!Array.isArray(null==(l=t.resource)?void 0:l.seats))throw Error("resource observation unavailable");s&&r({source:e,snapshot:t,error:!1})}catch(t){s&&r({source:e,snapshot:null,error:!0})}finally{t=!1}}};l();let n=window.setInterval(()=>{l()},1e4),a=()=>{l()};return document.addEventListener("visibilitychange",a),()=>{s=!1,window.clearInterval(n),document.removeEventListener("visibilitychange",a)}},[e]);let l=(null==s?void 0:s.source)===e?s:null;return(0,t.jsxs)("main",{className:"mx-auto max-w-[1400px] space-y-4 p-4",children:[(0,t.jsxs)("header",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"자원"}),(0,t.jsx)(n(),{href:"/loops?view=interact",className:"rounded-lg border px-3 py-2 text-sm",children:"루프 상호작용 →"})]}),(null==l?void 0:l.error)&&(0,t.jsx)("p",{role:"alert",children:"자원 원천을 읽지 못했습니다"}),!l&&(0,t.jsx)("p",{role:"status",children:"자원을 읽는 중…"}),(null==l?void 0:l.snapshot)&&(0,t.jsx)(v,{snapshot:l.snapshot})]})}var w=r(59016);function y(){return(0,t.jsxs)("main",{className:"mx-auto min-w-0 max-w-[1400px] space-y-4 p-4",children:[(0,t.jsx)(d.r,{active:"scheduler"}),(0,t.jsxs)("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h1",{className:"text-xl font-semibold",children:"루프 상호작용"}),(0,t.jsx)("span",{className:"rounded-full border border-border px-2 py-0.5 text-xs text-muted-foreground",children:"beta \xb7 운영용"})]}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"자리\xb7루프\xb7런 사이에 오간 실제 사건 \xb7 새 사건이 들어오면 다시 읽습니다"})]}),(0,t.jsx)(n(),{href:"/loops",className:"rounded-lg border border-border px-3 py-2 text-sm hover:bg-accent",children:"루프 현황 →"})]}),(0,t.jsx)("div",{className:"min-w-0 rounded-2xl bg-[#0c1828] text-[#f1f5fa]",children:(0,t.jsx)(o.p1,{initialMode:"map"})})]})}function k(){let e=(0,a.useSearchParams)(),s=(0,w.F)(e);return"resources"===s?(0,t.jsx)(N,{}):"interact"===s?(0,t.jsx)(y,{}):(0,t.jsx)(p,{})}},84481:(e,s,r)=>{Promise.resolve().then(r.bind(r,76923))}},e=>{e.O(0,[5225,8604,4862,4089,1729,9638,5785,7477,2803,2201,6356,7358],()=>e(e.s=84481)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2967],{6896:(e,t,n)=>{"use strict";n.d(t,{M1:()=>c,Qj:()=>u,tI:()=>o});var s=n(77194),r=n(49954),l=n(6066),i=n(91403);let a=(0,r.createContext)(null);function o(e){let{client:t,queryClient:n,defaultStaleTimeMs:o,children:c}=e,u=(0,r.useMemo)(()=>null!=n?n:new l.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[n,o]);return(0,s.jsx)(a.Provider,{value:t,children:(0,s.jsx)(i.Ht,{client:u,children:c})})}function c(){let e=(0,r.useContext)(a);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function u(){return(0,r.useContext)(a)}},9606:(e,t,n)=>{Promise.resolve().then(n.bind(n,66806))},35857:(e,t,n)=>{"use strict";let s;n.d(t,{cY:()=>u,x8:()=>a});let r={debug:0,info:1,warn:2,error:3},l="/v1/debug-logs/batch",i=null;function a(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)}if(this.queue.length>=100&&!this.inFlight){null!==this.timer&&(clearTimeout(this.timer),this.timer=null),this.flush();return}null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}}async flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.inFlight||0===this.queue.length)return;let e=this.queue.slice(0,100);this.inFlight=!0;let t=!1,n=JSON.stringify({records:e});try{var s,r;t=await (s=this.fetchFn(n),r=this.postTimeoutMs,new Promise((e,t)=>{let n=setTimeout(()=>t(Error("debug-forward timeout after ".concat(r,"ms"))),r);s.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&&i)try{await i(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let l=this.lastOkAt;this.lastOkAt=Date.now();let a=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:a,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches,pending:this.queue.length,previousOkAt:l},source:{platform:"pwa"}})),this.queue.length>0&&null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}scheduleRetry(){if(null!==this.timer||0===this.queue.length)return;let e=Math.min(this.flushMs*2**this.consecutiveFailures,3e4);this.timer=setTimeout(()=>{this.flush()},e)}blockedNotice(){return{ts:new Date().toISOString(),category:"pwa.debug-forwarder.http-blocked",event:"http-blocked",data:{consecutiveFailures:this.consecutiveFailures,pending:this.queue.length,droppedByCap:this.droppedByCap,lastOkAt:this.lastOkAt,via:"acp-fallback"},source:{platform:"pwa"}}}beaconFlush(){if(0!==this.queue.length)try{if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon){let e=this.queue.slice(0,100),t=new Blob([JSON.stringify({records:e})],{type:"application/json"});navigator.sendBeacon(l,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",n=1e4,s=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=n,this.flushMs=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(l,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function u(e,t){if("undefined"==typeof console)return;let n=new Date().toISOString();if(void 0!==t){let s="";try{let e=new WeakSet;s=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){s="[unserializable: ".concat(String(e),"]")}s&&s.length>800&&(s=s.slice(0,797)+"..."),console.debug("[".concat(n,"] ").concat(e," ").concat(s),t),d(n,e,s)}else console.debug("[".concat(n,"] ").concat(e)),d(n,e,void 0)}function d(e,t,n){let r,l=function(){if(void 0!==s)return s;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 s=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return s=t,t}();if(!l)return;let i=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==n&&""!==n)try{r=JSON.parse(n)}catch(e){r=n}l.push({ts:e,category:t,event:i,...void 0!==r?{data:r}:{},source:{platform:"pwa"}})}},66806:(e,t,n)=>{"use strict";n.d(t,{MarketPanel:()=>p});var s=n(77194),r=n(49954),l=n(6896);let i={resolve:"받는 중",verify:"서명 확인",consent:"권한 동의",credentials:"자격 필요",registered:"등록",done:"완료",failed:"실패"},a={signature:"서명을 확인하지 못했습니다.",scan:"플러그인 파일을 확인하지 못했습니다.","consent-denied":"필요한 권한에 동의하지 않았습니다.",credentials:"연결 정보가 필요합니다.",conflict:"이미 설치된 플러그인입니다.",io:"설치 중 오류가 발생했습니다."};var o=n(45785);function c(e){return e.fields.map(e=>{let{name:t,env:n,set:s}=e;return{name:t,env:n,set:s}})}function u(e){if(e instanceof o.Iu){if(404===e.status)return"설치된 플러그인을 찾을 수 없습니다.";if(401===e.status)return"연결 정보를 관리할 권한이 없습니다.";if(400===e.status)return"선언되지 않은 연결 정보 항목입니다."}return"연결 정보를 불러오거나 저장하지 못했습니다."}function d(e){let{client:t,name:n}=e,[l,i]=(0,r.useState)(null),[a,o]=(0,r.useState)({}),[d,h]=(0,r.useState)([]),[p,m]=(0,r.useState)(null),[f,g]=(0,r.useState)(!1);async function b(e){if(e.preventDefault(),f||!l)return;let{fields:s}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n={};for(let[t,s]of Object.entries(e))s.trim()&&(n[t]=s);for(let e of t)n[e]=null;return{fields:n}}(a,d);if(0!==Object.keys(s).length){g(!0),m(null);try{await t.putPluginCredentials(n,s),o({}),h([]),i(null),i(await t.getPluginCredentials(n))}catch(e){m(u(e))}finally{g(!1)}}}return(0,r.useEffect)(()=>{let e=!0;return i(null),o({}),h([]),m(null),t.getPluginCredentials(n).then(t=>{e&&i(t)}).catch(t=>{e&&m(u(t))}),()=>{e=!1}},[t,n]),(0,s.jsxs)("form",{className:"space-y-3 rounded-lg border border-border p-4",onSubmit:e=>void b(e),children:[(0,s.jsx)("h3",{className:"font-medium",children:"연결 정보"}),p&&(0,s.jsx)("p",{role:"alert",className:"text-sm",children:p}),!l&&!p&&(0,s.jsx)("p",{role:"status",children:"연결 정보를 불러오는 중…"}),l&&0===c(l).length&&(0,s.jsx)("p",{className:"text-sm",children:"입력할 연결 정보가 없습니다."}),l&&c(l).map(e=>{var t;return(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("label",{className:"block text-sm font-medium",htmlFor:"credential-".concat(n,"-").concat(e.name),children:e.name}),(0,s.jsxs)("small",{className:"block text-muted-foreground",children:["환경 변수: ",(0,s.jsx)("code",{children:e.env})]}),(0,s.jsx)("p",{className:"text-sm",role:"status",children:e.set?"✓ 저장됨":"비어 있음"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsx)("input",{id:"credential-".concat(n,"-").concat(e.name),type:"password",autoComplete:"new-password",className:"min-w-0 flex-1 rounded border border-border bg-background px-2 py-1",value:null!=(t=a[e.name])?t:"",disabled:f,onChange:t=>{o(n=>({...n,[e.name]:t.target.value})),h(t=>t.filter(t=>t!==e.name))}}),e.set&&(0,s.jsx)("button",{type:"button",className:"rounded border px-2 py-1 text-sm",disabled:f,onClick:()=>{o(t=>({...t,[e.name]:""})),h(t=>t.includes(e.name)?t:[...t,e.name])},children:d.includes(e.name)?"삭제 예정":"지우기"})]})]},e.name)}),l&&l.fields.length>0&&(0,s.jsx)("button",{type:"submit",disabled:f||0===d.length&&!Object.values(a).some(e=>e.trim()),className:"rounded border px-3 py-1 text-sm",children:f?"저장 중…":"저장"})]})}let h={name:"",description:"",instructions:"",connectorId:"",credentialNames:""};function p(){var e;let t=(0,l.Qj)(),[n,o]=(0,r.useState)("browse"),[c,u]=(0,r.useState)(null),[p,m]=(0,r.useState)([]),[f,g]=(0,r.useState)(null),[b,x]=(0,r.useState)(!1),[j,y]=(0,r.useState)(!1),[v,w]=(0,r.useState)(!1),[N,k]=(0,r.useState)(!1),[S,C]=(0,r.useState)(null),[q,O]=(0,r.useState)(!1),[F,E]=(0,r.useState)([]),[I,P]=(0,r.useState)(null),[B,z]=(0,r.useState)(h),[A,M]=(0,r.useState)(""),[T,D]=(0,r.useState)([]),[L,_]=(0,r.useState)([]),[J,R]=(0,r.useState)(null),[$,W]=(0,r.useState)(!1),[Q,K]=(0,r.useState)(null);async function Z(){if(t&&!$){W(!0),R(null);try{let e=function(e){var t,n;let s=e.name.trim();if(!/^[a-z0-9][a-z0-9-]{1,31}$/.test(s))throw Error("플러그인 이름은 영문 소문자\xb7숫자\xb7하이픈 2~32자로 입력하세요.");if(!e.description.trim())throw Error("플러그인 설명을 입력하세요.");let r=e.connectorId.trim(),l=e.credentialNames.split(",").map(e=>e.trim()).filter(Boolean);if(r&&!/^[a-z0-9][a-z0-9-]{1,31}$/.test(r))throw Error("연결 이름이 올바르지 않습니다.");if(!r&&l.length)throw Error("연결 이름을 먼저 입력하세요.");if(l.some(e=>!/^[A-Za-z_][A-Za-z0-9_-]*$/.test(e))||new Set(l).size!==l.length)throw Error("자격 정보에는 중복 없는 항목 이름만 입력하세요.");let i=null!=(t=e.otherConnectors)?t:[];if(r&&i.some(e=>e.id===r))throw Error("연결 이름이 중복됩니다.");return{name:s,draft:{description:e.description.trim(),...r||i.length?{connectors:[...r?[{id:r,credentials:l.map(e=>({name:e}))}]:[],...i]}:{},skill:{description:null!=(n=e.skillDescription)?n:e.description.trim(),instructions:e.instructions.trim()||e.description.trim(),...e.requires?{requires:e.requires}:{}}}}}(B);if(Q&&Q!==e.name)throw Error("다시 만들 때는 기존 플러그인 이름을 유지하세요. 새 이름으로 만들려면 새 초안을 선택하세요.");await t.saveWizardPlugin({...e,...Q===e.name?{regenerate:!0}:{}}),_((await t.getWizardPlugins()).plugins),D(t=>[...t,{role:"assistant",text:"".concat(e.name," 연구 초안을 저장했습니다. 실행\xb7설치 전 그래프 단계를 구현하고 검증해야 합니다.")}]),K(e.name)}catch(e){R(e instanceof Error?e.message:"플러그인을 저장하지 못했습니다.")}finally{W(!1)}}}async function H(){if(o("wizard"),t)try{_((await t.getWizardPlugins()).plugins),R(null)}catch(e){R("만든 플러그인 목록을 불러오지 못했습니다.")}}async function Y(){if(t){k(!0),C(null);try{if(!(await t.refreshPluginMarket("elanous")).ok)throw Error("공식 마켓을 받지 못했습니다.");u(await t.getPluginsIndex()),x(!1)}catch(e){C("공식 마켓을 받지 못했습니다.")}finally{k(!1)}}}async function G(){if(!t||!f)return;k(!0),E([]),C(null);let e=null;try{await t.installMarketPlugin("".concat(f.plugin.name,"@").concat(f.market.name),f.plugin.capabilities,t=>{let n=function(e){let t;try{t=JSON.parse(e)}catch(e){return null}if(!t||"object"!=typeof t)return null;let n=t.event;if("string"!=typeof n||!Object.hasOwn(i,n))return null;if("failed"===n){var s;let e=t.reason,n=t.detail,r="string"==typeof e&&null!=(s=a[e])?s:a.io;return{step:"실패",reason:"string"==typeof n&&n.trim()?"".concat(r," — ").concat(n.trim()):r}}return"credentials"===n?!0===t.required?{step:"자격 필요",credentialsRequired:!0}:null:{step:i[n]}}(t);n&&(("완료"===n.step||"실패"===n.step)&&(e=n.step),E(e=>[...e,n]))}),e||E(e=>[...e,{step:"실패",reason:"설치가 끝나지 않았습니다."}])}catch(t){e||E(e=>[...e,{step:"실패",reason:"설치 중 오류가 발생했습니다."}])}if("완료"===e)try{m(await t.getInstalledPlugins()),w(!0),y(!1)}catch(e){y(!0),C("설치는 완료됐지만 설치 목록을 불러오지 못했습니다.")}k(!1)}async function U(e){if(t){k(!0),C(null);try{await t.removeMarketPlugin(e)}catch(e){C("플러그인을 제거하지 못했습니다."),k(!1);return}P(null),m(t=>t.filter(t=>t.name!==e));try{m(await t.getInstalledPlugins()),w(!0),y(!1)}catch(e){y(!0),C("플러그인은 제거됐지만 설치 목록을 불러오지 못했습니다.")}finally{k(!1)}}}(0,r.useEffect)(()=>{if(!t)return;let e=!0;return u(null),m([]),g(null),x(!1),y(!1),w(!1),E([]),O(!1),P(null),C(null),_([]),z(h),D([]),K(null),R(null),t.getPluginsIndex().then(t=>{e&&u(t)}).catch(()=>{e&&x(!0)}),t.getInstalledPlugins().then(t=>{e&&(m(t),w(!0))}).catch(()=>{e&&(y(!0),w(!0))}),()=>{e=!1}},[t]);let V=c?c.markets.flatMap(e=>e.plugins.map(t=>({market:e,plugin:t,price:function(e){var t;if("free"===e.model)return"무료";let n=void 0===e.amount?"가격 미정":"".concat(e.amount.toLocaleString("ko-KR")," ").concat(null!=(t=e.currency)?t:"").trim();return"subscription"===e.model&&e.period?"".concat(n," / ").concat(e.period):n}(t.pricing),badge:function(e){switch(e){case"ok":return"✅ 서명 확인";case"missing":return"⚠️ 서명 없음";case"unknown-key":return"⚠️ 알 수 없는 서명 키";case"malformed":return"⚠️ 잘못된 서명";case"stale":return"⚠️ 유효하지 않은 서명"}}(e.signature)}))).sort((e,t)=>("ok"!==e.market.signature)-("ok"!==t.market.signature)||e.plugin.name.localeCompare(t.plugin.name)||e.market.name.localeCompare(t.market.name)):[];return(0,s.jsxs)("main",{className:"mx-auto max-w-5xl space-y-6 p-5 text-foreground","aria-label":"마켓",children:[(0,s.jsxs)("header",{children:[(0,s.jsx)("h1",{className:"text-2xl font-semibold",children:"마켓"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"확인된 플러그인을 살펴보고 설치할 수 있습니다."})]}),(0,s.jsx)("nav",{"aria-label":"마켓 탭",className:"flex flex-wrap gap-2",children:[["browse","찾아보기"],["detail","상세"],["installed","설치됨"],["wizard","플러그인 만들기"]].map(e=>{let[t,r]=e;return(0,s.jsx)("button",{type:"button","aria-current":n===t?"page":void 0,className:"rounded-lg border px-4 py-2 text-sm ".concat(n===t?"border-blue-500 font-semibold":"border-border"),onClick:()=>{"wizard"===t?H():o(t)},children:r},t)})}),!t&&(0,s.jsx)("p",{role:"status",children:"서버 연결이 설정되지 않았습니다. 설정에서 서버 주소를 입력하세요."}),S&&(0,s.jsx)("p",{role:"alert",children:S}),"installed"!==n&&"wizard"!==n&&b&&(0,s.jsx)("p",{role:"alert",children:"마켓을 불러오지 못했습니다."}),"installed"!==n&&"wizard"!==n&&t&&!b&&!c&&(0,s.jsx)("p",{role:"status",children:"마켓을 불러오는 중…"}),"installed"===n&&j&&(0,s.jsx)("p",{role:"alert",children:"설치 목록을 불러오지 못했습니다."}),"installed"===n&&t&&!v&&(0,s.jsx)("p",{role:"status",children:"설치 목록을 불러오는 중…"}),"browse"===n&&c&&(0===c.markets.length?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{children:"아직 받아 둔 마켓이 없습니다."}),(0,s.jsx)("button",{type:"button",disabled:N||!t,className:"rounded border px-3 py-2",onClick:()=>void Y(),children:"공식 마켓 받기"})]}):0===V.length?(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{children:"등록된 플러그인이 없습니다."}),(0,s.jsx)("button",{type:"button",disabled:N||!t,className:"rounded border px-3 py-2",onClick:()=>void Y(),children:"공식 마켓 받기"})]}):(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:V.map(e=>{var t;return(0,s.jsxs)("article",{className:"rounded-xl border border-border p-4 space-y-2",children:[(0,s.jsxs)("h2",{className:"font-semibold",children:[e.plugin.name," ",(0,s.jsxs)("span",{className:"text-xs font-normal",children:["v",e.plugin.version]})]}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:null!=(t=e.plugin.description)?t:"설명이 없습니다."}),(0,s.jsxs)("p",{className:"text-sm",children:[e.price," \xb7 ",(0,s.jsx)("span",{title:e.market.detail,children:e.badge})]}),(0,s.jsx)("button",{type:"button",className:"rounded border px-3 py-1 text-sm",onClick:()=>{g(e),O(!1),E([]),o("detail")},children:"상세 보기"})]},"".concat(e.market.name,"/").concat(e.plugin.name,"/").concat(e.plugin.version))})})),"detail"===n&&!b&&(f?(0,s.jsxs)("section",{className:"space-y-4 rounded-xl border border-border p-5","aria-label":"플러그인 상세",children:[(0,s.jsxs)("h2",{className:"text-xl font-semibold",children:[f.plugin.name," ",(0,s.jsxs)("small",{children:["v",f.plugin.version]})]}),(0,s.jsx)("p",{children:f.plugin.description}),(0,s.jsxs)("p",{children:[f.price," \xb7 ",f.badge]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"권한"}),(0,s.jsx)("ul",{children:f.plugin.capabilities.map(e=>(0,s.jsx)("li",{children:e},e))})]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"연결 정보 항목"}),f.plugin.connectors.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{children:"연결 정보"}),(0,s.jsx)("ul",{children:e.userConfig.map(e=>(0,s.jsxs)("li",{children:[e.label,e.secret?" \xb7 비공개 정보":""]},e.key))})]},e.id))]}),(0,s.jsxs)("section",{children:[(0,s.jsx)("h3",{className:"font-medium",children:"포함된 기능"}),(0,s.jsx)("ul",{children:null==(e=f.plugin.graphs)?void 0:e.map(e=>(0,s.jsx)("li",{children:e},e))})]}),(0,s.jsxs)("p",{children:["파일 확인값: ",(0,s.jsx)("code",{children:f.plugin.sha256.slice(0,12)})]}),q?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)("p",{children:"이 플러그인이 요청하는 권한을 확인하세요."}),(0,s.jsx)("ul",{children:f.plugin.capabilities.map(e=>(0,s.jsx)("li",{children:e},e))}),(0,s.jsx)("button",{type:"button",disabled:N,className:"rounded border px-3 py-1",onClick:()=>void G(),children:"동의하고 설치"}),(0,s.jsx)("button",{type:"button",disabled:N,className:"rounded border px-3 py-1",onClick:()=>O(!1),children:"취소"})]}):(0,s.jsx)("button",{type:"button",disabled:N||"ok"!==f.market.signature,className:"rounded border px-3 py-1",onClick:()=>O(!0),children:"설치"}),F.length>0&&(0,s.jsx)("ol",{"aria-label":"설치 진행",className:"space-y-1",children:F.map((e,t)=>(0,s.jsxs)("li",{role:"실패"===e.step?"alert":void 0,children:[e.step,e.reason?": ".concat(e.reason):"",e.credentialsRequired?" — 이 플러그인은 연결 정보가 필요합니다.":""]},t))}),t&&F.some(e=>e.credentialsRequired)&&(0,s.jsx)(d,{client:t,name:f.plugin.name},"".concat(f.plugin.name,"-").concat(F.some(e=>"완료"===e.step||"등록"===e.step)))]}):(0,s.jsx)("p",{children:"찾아보기에서 플러그인을 선택하세요."})),"wizard"===n&&(0,s.jsxs)("section",{"aria-label":"플러그인 마법사",className:"space-y-5",children:[(0,s.jsx)("h2",{className:"text-xl font-semibold",children:"플러그인 마법사"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"대화로 요청을 정리하고 폼을 다듬어 연구 초안을 만듭니다. 생성된 그래프는 아직 실행\xb7설치할 수 없습니다."}),(0,s.jsx)("ol",{"aria-label":"마법사 대화",className:"space-y-2",children:T.map((e,t)=>(0,s.jsxs)("li",{className:"rounded-lg border border-border p-3",children:[(0,s.jsxs)("strong",{children:["user"===e.role?"나":"마법사",": "]}),e.text]},t))}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,s.jsxs)("label",{className:"flex-1 min-w-48",children:["만들고 싶은 플러그인",(0,s.jsx)("textarea",{className:"mt-1 w-full rounded border border-border bg-background p-2",value:A,onChange:e=>M(e.target.value)})]}),(0,s.jsx)("button",{type:"button",className:"self-end rounded border px-3 py-2",onClick:function(){try{let e=function(e,t){let n=e.trim();if(!n)throw Error("플러그인 설명을 입력하세요.");return t.description?{...t,instructions:"".concat(t.instructions||t.description,"\n").concat(n)}:{...t,description:n,instructions:t.instructions||n}}(A,B);z(e),D(e=>[...e,{role:"user",text:A.trim()},{role:"assistant",text:B.description?"추가 요청을 스킬 지시문에 반영했습니다. 폼을 확인한 뒤 다시 만드세요.":"초안을 폼에 옮겼습니다. 이름과 연결 정보\xb7지시문을 다듬은 뒤 생성하세요."}]),M(""),R(null)}catch(e){R(e instanceof Error?e.message:"초안을 만들지 못했습니다.")}},children:"대화에 추가"})]}),(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,s.jsxs)("label",{children:["이름 (영문 소문자\xb7숫자\xb7하이픈)",(0,s.jsx)("input",{className:"mt-1 w-full rounded border border-border bg-background p-2",value:B.name,onChange:e=>z(t=>({...t,name:e.target.value}))})]}),(0,s.jsxs)("label",{children:["설명",(0,s.jsx)("input",{className:"mt-1 w-full rounded border border-border bg-background p-2",value:B.description,onChange:e=>z(t=>({...t,description:e.target.value}))})]}),(0,s.jsxs)("label",{className:"sm:col-span-2",children:["스킬 지시문",(0,s.jsx)("textarea",{className:"mt-1 w-full rounded border border-border bg-background p-2",value:B.instructions,onChange:e=>z(t=>({...t,instructions:e.target.value}))})]}),(0,s.jsxs)("label",{children:["연결 이름 (선택)",(0,s.jsx)("input",{className:"mt-1 w-full rounded border border-border bg-background p-2",value:B.connectorId,onChange:e=>z(t=>({...t,connectorId:e.target.value}))})]}),(0,s.jsxs)("label",{children:["자격 정보 항목 이름 (쉼표 구분, 값은 입력하지 마세요)",(0,s.jsx)("input",{className:"mt-1 w-full rounded border border-border bg-background p-2",value:B.credentialNames,onChange:e=>z(t=>({...t,credentialNames:e.target.value}))})]})]}),J&&(0,s.jsx)("p",{role:"alert",children:J}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{type:"button",disabled:!t||$,className:"rounded border px-3 py-2",onClick:()=>void Z(),children:$?"저장 중…":Q===B.name?"다시 만들기":"초안 만들기"}),(0,s.jsx)("button",{type:"button",disabled:$,className:"rounded border px-3 py-2",onClick:()=>{z(h),D([]),K(null),R(null)},children:"새 초안"})]}),(0,s.jsxs)("section",{"aria-label":"만든 플러그인",className:"space-y-2",children:[(0,s.jsx)("h3",{className:"font-semibold",children:"만든 플러그인"}),0===L.length?(0,s.jsx)("p",{children:"만든 초안이 없습니다."}):(0,s.jsx)("ul",{className:"space-y-2",children:L.map(e=>(0,s.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded border border-border p-3",children:[(0,s.jsxs)("span",{children:[e.name," \xb7 ",e.description]}),(0,s.jsx)("button",{type:"button",className:"rounded border px-3 py-1",onClick:()=>{var t,n,s,r,l,i,a,o,c,u,d,h;z({name:e.name,description:e.draft.description,instructions:null!=(u=null==(t=e.draft.skill)?void 0:t.instructions)?u:"",connectorId:null!=(d=null==(s=e.draft.connectors)||null==(n=s[0])?void 0:n.id)?d:"",credentialNames:null!=(h=null==(i=e.draft.connectors)||null==(l=i[0])||null==(r=l.credentials)?void 0:r.map(e=>e.name).join(", "))?h:"",...(null==(o=e.draft.skill)||null==(a=o.requires)?void 0:a.length)?{requires:e.draft.skill.requires}:{},...(null==(c=e.draft.skill)?void 0:c.description)&&e.draft.skill.description!==e.draft.description?{skillDescription:e.draft.skill.description}:{},...e.draft.connectors&&e.draft.connectors.length>1?{otherConnectors:e.draft.connectors.slice(1)}:{}}),K(e.name),D([]),R(null)},children:"다듬고 다시 만들기"})]},e.name))})]})]}),"installed"===n&&v&&!j&&(0===p.length?(0,s.jsx)("p",{children:"설치된 플러그인이 없습니다."}):(0,s.jsx)("ul",{className:"space-y-2",children:p.map(e=>(0,s.jsxs)("li",{className:"rounded-lg border border-border p-3",children:[e.name," \xb7 v",e.version," \xb7 설치 시각: ",e.installedAt&&Number.isFinite(Date.parse(e.installedAt))?(0,s.jsx)("time",{dateTime:e.installedAt,children:new Date(e.installedAt).toLocaleString("ko-KR")}):"알 수 없음",I===e.name?(0,s.jsxs)("span",{className:"ml-3",children:["제거할까요? ",(0,s.jsx)("button",{type:"button",disabled:N,onClick:()=>void U(e.name),children:"제거 확인"})," ",(0,s.jsx)("button",{type:"button",onClick:()=>P(null),children:"취소"})]}):(0,s.jsx)("button",{type:"button",disabled:N,className:"ml-3 rounded border px-3 py-1",onClick:()=>P(e.name),children:"제거"}),t&&(0,s.jsxs)("details",{className:"mt-3",children:[(0,s.jsx)("summary",{className:"cursor-pointer",children:"연결 정보"}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)(d,{client:t,name:e.name})})]})]},"".concat(e.market,"/").concat(e.name,"/").concat(e.version)))}))]})}},71350:(e,t,n)=>{"use strict";n.d(t,{Qb:()=>i,SI:()=>o,dJ:()=>a});let s="elanous:auth-required",r=null,l=!1;function i(e){null===r&&(r=e,window.dispatchEvent(new CustomEvent(s,{detail:{path:e}})))}function a(e){let t=window,n=t=>e(t.detail);return t.addEventListener(s,n),null===r||l||e({path:r}),()=>t.removeEventListener(s,n)}function o(){l=!0}}},e=>{e.O(0,[2566,5785,2201,6356,7358],()=>e(e.s=9606)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7398],{22293:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var a=s(77194),i=s(49954),r=s(98451);class n extends Error{constructor(e,t,s){super("mission-room ".concat(e," on ").concat(t)),this.status=e,this.path=t,this.body=s,this.name="MissionRoomApiError"}}var o=s(65449);function l(e){var t;let[s,r]=(0,i.useState)({loading:!0,error:null,state:null}),[n,l]=(0,i.useState)(""),[d,u]=(0,i.useState)(""),[m,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(null),[b,f]=(0,i.useState)(!1),y=(0,i.useRef)(!0);(0,i.useEffect)(()=>()=>{y.current=!1},[]);let g=(0,i.useCallback)(async()=>{r(e=>({...e,loading:!0,error:null}));try{let{state:t}=await e.api.spawn(e.missionId);if(!y.current)return;r({loading:!1,error:null,state:t})}catch(e){if(!y.current)return;r({loading:!1,error:c(e),state:null})}},[e.api,e.missionId]);(0,i.useEffect)(()=>{g()},[g]);let j=(0,i.useCallback)(async()=>{if(n.trim()&&!m){p(!0);try{let t=await e.api.deliberate(e.missionId,n.trim(),d.trim()||void 0);if(!y.current)return;r(e=>e.state?{...e,state:{...e.state,decisions:[...e.state.decisions,t]}}:e),l("")}catch(e){if(!y.current)return;r(t=>({...t,error:c(e)}))}finally{y.current&&p(!1)}}},[e.api,e.missionId,n,d,m]),N=(0,i.useCallback)(async t=>{if(t.trim()&&!x){h(t);try{let s=await e.api.decide(e.missionId,t);if(!y.current)return;r(e=>{if(!e.state)return e;let t=e.state.decisions.slice(),a=t.findIndex(e=>e.ts===s.ts);return a>=0&&(t[a]=s),{...e,state:{...e.state,decisions:t}}})}catch(e){if(!y.current)return;r(t=>({...t,error:c(e)}))}finally{y.current&&h(null)}}},[e.api,e.missionId,x]),v=(0,i.useCallback)(async()=>{if(!b){f(!0);try{var t;let s=await e.api.archive(e.missionId);if(!y.current)return;r(e=>({...e,state:s})),null==(t=e.onArchived)||t.call(e)}catch(e){if(!y.current)return;r(t=>({...t,error:c(e)}))}finally{y.current&&f(!1)}}},[e.api,e.missionId,b,e.onArchived]),w=(null==(t=s.state)?void 0:t.status)==="archived",S=(0,i.useMemo)(()=>s.state?[...s.state.decisions].sort((e,t)=>t.ts-e.ts):[],[s.state]);return s.loading&&!s.state?(0,a.jsx)("div",{className:"p-4 text-sm opacity-70",children:"Loading mission room…"}):(0,a.jsxs)("section",{className:"mission-room-panel flex flex-col gap-4 p-4","data-mission-id":e.missionId,children:[(0,a.jsxs)("header",{className:"flex items-baseline justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e.missionTitle?"".concat(e.missionTitle," \xb7 deliberation"):"Mission Deliberation Room"}),s.state&&(0,a.jsxs)("p",{className:"text-xs opacity-70",children:["tag: ",(0,a.jsx)("code",{children:s.state.missionTag})," \xb7 status:"," ",(0,a.jsx)("span",{className:w?"text-amber-600":"text-emerald-600",children:s.state.status})," \xb7 ","decisions: ",s.state.decisions.length]})]}),!w&&s.state&&(0,a.jsx)("button",{type:"button",className:"text-xs underline opacity-70 hover:opacity-100",disabled:b,onClick:()=>void v(),children:b?"archiving…":"archive room"})]}),s.error&&(0,a.jsx)("div",{role:"alert",className:"rounded border border-rose-400/50 bg-rose-50 px-3 py-2 text-sm text-rose-900",children:s.error}),!w&&(0,a.jsxs)("form",{className:"flex flex-col gap-2 rounded border border-zinc-200 p-3",onSubmit:e=>{e.preventDefault(),j()},children:[(0,a.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"New deliberation"}),(0,a.jsx)("textarea",{className:"min-h-[80px] w-full rounded border border-zinc-300 bg-white p-2 text-sm",placeholder:"Describe the branch you're stuck on…",value:n,onChange:e=>l(e.target.value),disabled:m}),(0,a.jsx)("textarea",{className:"min-h-[40px] w-full rounded border border-zinc-200 bg-zinc-50 p-2 text-xs",placeholder:"Optional mission context (task list digest, etc.)",value:d,onChange:e=>u(e.target.value),disabled:m}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)("button",{type:"submit",className:"rounded bg-zinc-900 px-3 py-1 text-sm text-white disabled:opacity-50",disabled:!n.trim()||m,children:m?"asking lanes…":"ask the lanes"})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[0===S.length&&(0,a.jsx)("p",{className:"text-sm opacity-70",children:"No deliberations yet."}),S.map(e=>(0,a.jsx)(o.l,{decision:e,onDecide:w?void 0:N,decidingChoice:x},e.ts))]})]})}function c(e){if(e instanceof n){let t="object"==typeof e.body&&e.body&&"detail"in e.body?e.body.detail:null;return 404===e.status?"Mission room not found.":409===e.status?t?"Conflict: ".concat(t):"Conflict — room may be archived or no open decision.":401===e.status?"Authentication required.":"Mission room error (".concat(e.status,").")}return e instanceof Error?e.message:String(e)}function d(){var e;let t=(0,r.useParams)(),s=decodeURIComponent(null!=(e=null==t?void 0:t.id)?e:""),o=(0,i.useMemo)(()=>(function(e){var t;let s=e.baseUrl.replace(/\/+$/,""),a=null!=(t=e.fetchImpl)?t:fetch,i=e.authHeader;async function r(e,t){let r={"content-type":"application/json"};i&&(r.authorization=i),(null==t?void 0:t.headers)&&Object.assign(r,t.headers);let o=await a("".concat(s).concat(e),{...t,headers:r}),l=await o.json().catch(()=>null);if(!o.ok)throw new n(o.status,e,l);return l}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"/v1/missions/".concat(encodeURIComponent(e),"/showroom").concat(t)}return{spawn:async e=>await r(o(e)),deliberate:async(e,t,s)=>(await r(o(e,"/deliberate"),{method:"POST",body:JSON.stringify({question:t,...void 0!==s?{missionContext:s}:{}})})).decision,decide:async(e,t)=>(await r(o(e,"/decision"),{method:"POST",body:JSON.stringify({chosen:t})})).decision,archive:async e=>(await r(o(e,"/archive"),{method:"POST"})).state}})({baseUrl:window.location.origin}),[]);return s?(0,a.jsx)(l,{missionId:s,api:o}):(0,a.jsx)("div",{className:"p-4 text-sm",children:"Mission id missing in URL."})}},65449:(e,t,s)=>{"use strict";s.d(t,{l:()=>r});var a=s(77194),i=s(49954);function r(e){let[t,s]=(0,i.useState)("");if("onChoose"in e){let{decision:t,onChoose:s,busy:i}=e;return(0,a.jsxs)("article",{className:"rounded border border-border bg-card p-3","data-decision-card":t.id,children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:t.title}),(0,a.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-muted-foreground",children:t.situation}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:t.options.map(e=>(0,a.jsxs)("button",{type:"button",disabled:i,onClick:()=>s(e),className:"rounded-md border border-border px-2 py-1 text-sm hover:bg-muted disabled:opacity-50",children:[e.label,"option"in t.recommendation&&t.recommendation.option===e.id&&(0,a.jsx)("span",{className:"ml-1 text-primary",children:"추천"})]},e.id))})]})}let{decision:r,onDecide:n,decidingChoice:o}=e,l=r.resolution.status,c="decided"===r.resolution.status?r.resolution.chosen:null;return(0,a.jsxs)("article",{className:"rounded border border-zinc-200 bg-white p-3",children:[(0,a.jsxs)("header",{className:"flex items-baseline justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:r.question}),(0,a.jsx)("time",{className:"shrink-0 text-xs opacity-60",dateTime:new Date(r.ts).toISOString(),children:new Date(r.ts).toLocaleString()})]}),(0,a.jsx)("ul",{className:"mt-2 flex flex-col gap-2",children:r.opinions.map((e,t)=>(0,a.jsxs)("li",{className:"rounded bg-zinc-50 p-2 text-xs",children:[(0,a.jsxs)("div",{className:"font-medium",children:[e.role,e.modelId?(0,a.jsxs)("span",{className:"opacity-60",children:[" \xb7 ",e.modelId]}):null]}),(0,a.jsx)("pre",{className:"mt-1 whitespace-pre-wrap text-xs leading-snug",children:e.text})]},"".concat(e.role,"-").concat(t)))}),(0,a.jsxs)("footer",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("span",{className:"text-xs opacity-70",children:["resolution:"," ","decided"===l?(0,a.jsxs)("span",{className:"font-medium text-emerald-700",children:["decided → ",c]}):(0,a.jsx)("span",{className:"text-amber-700",children:"open"})]}),n&&"open"===l&&(0,a.jsxs)("form",{className:"flex items-center gap-1",onSubmit:e=>{e.preventDefault(),t.trim()&&n(t.trim())},children:[(0,a.jsx)("input",{className:"w-32 rounded border border-zinc-300 px-2 py-0.5 text-xs",placeholder:"chosen…",value:t,onChange:e=>s(e.target.value),disabled:null!==o}),(0,a.jsx)("button",{type:"submit",className:"rounded bg-emerald-700 px-2 py-0.5 text-xs text-white disabled:opacity-50",disabled:!t.trim()||null!==o,children:o===t?"…":"apply"})]})]})]})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7398],{22293:(e,t,s)=>{"use strict";s.d(t,{default:()=>d});var a=s(77194),i=s(49954),r=s(98451);class n extends Error{constructor(e,t,s){super("mission-room ".concat(e," on ").concat(t)),this.status=e,this.path=t,this.body=s,this.name="MissionRoomApiError"}}var o=s(65449);function l(e){var t;let[s,r]=(0,i.useState)({loading:!0,error:null,state:null}),[n,l]=(0,i.useState)(""),[d,u]=(0,i.useState)(""),[m,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(null),[b,f]=(0,i.useState)(!1),y=(0,i.useRef)(!0);(0,i.useEffect)(()=>()=>{y.current=!1},[]);let g=(0,i.useCallback)(async()=>{r(e=>({...e,loading:!0,error:null}));try{let{state:t}=await e.api.spawn(e.missionId);if(!y.current)return;r({loading:!1,error:null,state:t})}catch(e){if(!y.current)return;r({loading:!1,error:c(e),state:null})}},[e.api,e.missionId]);(0,i.useEffect)(()=>{g()},[g]);let j=(0,i.useCallback)(async()=>{if(n.trim()&&!m){p(!0);try{let t=await e.api.deliberate(e.missionId,n.trim(),d.trim()||void 0);if(!y.current)return;r(e=>e.state?{...e,state:{...e.state,decisions:[...e.state.decisions,t]}}:e),l("")}catch(e){if(!y.current)return;r(t=>({...t,error:c(e)}))}finally{y.current&&p(!1)}}},[e.api,e.missionId,n,d,m]),N=(0,i.useCallback)(async t=>{if(t.trim()&&!x){h(t);try{let s=await e.api.decide(e.missionId,t);if(!y.current)return;r(e=>{if(!e.state)return e;let t=e.state.decisions.slice(),a=t.findIndex(e=>e.ts===s.ts);return a>=0&&(t[a]=s),{...e,state:{...e.state,decisions:t}}})}catch(e){if(!y.current)return;r(t=>({...t,error:c(e)}))}finally{y.current&&h(null)}}},[e.api,e.missionId,x]),v=(0,i.useCallback)(async()=>{if(!b){f(!0);try{var t;let s=await e.api.archive(e.missionId);if(!y.current)return;r(e=>({...e,state:s})),null==(t=e.onArchived)||t.call(e)}catch(e){if(!y.current)return;r(t=>({...t,error:c(e)}))}finally{y.current&&f(!1)}}},[e.api,e.missionId,b,e.onArchived]),w=(null==(t=s.state)?void 0:t.status)==="archived",S=(0,i.useMemo)(()=>s.state?[...s.state.decisions].sort((e,t)=>t.ts-e.ts):[],[s.state]);return s.loading&&!s.state?(0,a.jsx)("div",{className:"p-4 text-sm opacity-70",children:"Loading mission room…"}):(0,a.jsxs)("section",{className:"mission-room-panel flex flex-col gap-4 p-4","data-mission-id":e.missionId,children:[(0,a.jsxs)("header",{className:"flex items-baseline justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:e.missionTitle?"".concat(e.missionTitle," \xb7 deliberation"):"Mission Deliberation Room"}),s.state&&(0,a.jsxs)("p",{className:"text-xs opacity-70",children:["tag: ",(0,a.jsx)("code",{children:s.state.missionTag})," \xb7 status:"," ",(0,a.jsx)("span",{className:w?"text-amber-600":"text-emerald-600",children:s.state.status})," \xb7 ","decisions: ",s.state.decisions.length]})]}),!w&&s.state&&(0,a.jsx)("button",{type:"button",className:"text-xs underline opacity-70 hover:opacity-100",disabled:b,onClick:()=>void v(),children:b?"archiving…":"archive room"})]}),s.error&&(0,a.jsx)("div",{role:"alert",className:"rounded border border-rose-400/50 bg-rose-50 px-3 py-2 text-sm text-rose-900",children:s.error}),!w&&(0,a.jsxs)("form",{className:"flex flex-col gap-2 rounded border border-zinc-200 p-3",onSubmit:e=>{e.preventDefault(),j()},children:[(0,a.jsx)("label",{className:"text-xs uppercase tracking-wide opacity-70",children:"New deliberation"}),(0,a.jsx)("textarea",{className:"min-h-[80px] w-full rounded border border-zinc-300 bg-white p-2 text-sm",placeholder:"Describe the branch you're stuck on…",value:n,onChange:e=>l(e.target.value),disabled:m}),(0,a.jsx)("textarea",{className:"min-h-[40px] w-full rounded border border-zinc-200 bg-zinc-50 p-2 text-xs",placeholder:"Optional mission context (task list digest, etc.)",value:d,onChange:e=>u(e.target.value),disabled:m}),(0,a.jsx)("div",{className:"flex justify-end",children:(0,a.jsx)("button",{type:"submit",className:"rounded bg-zinc-900 px-3 py-1 text-sm text-white disabled:opacity-50",disabled:!n.trim()||m,children:m?"asking lanes…":"ask the lanes"})})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[0===S.length&&(0,a.jsx)("p",{className:"text-sm opacity-70",children:"No deliberations yet."}),S.map(e=>(0,a.jsx)(o.l,{decision:e,onDecide:w?void 0:N,decidingChoice:x},e.ts))]})]})}function c(e){if(e instanceof n){let t="object"==typeof e.body&&e.body&&"detail"in e.body?e.body.detail:null;return 404===e.status?"Mission room not found.":409===e.status?t?"Conflict: ".concat(t):"Conflict — room may be archived or no open decision.":401===e.status?"Authentication required.":"Mission room error (".concat(e.status,").")}return e instanceof Error?e.message:String(e)}function d(){var e;let t=(0,r.useParams)(),s=decodeURIComponent(null!=(e=null==t?void 0:t.id)?e:""),o=(0,i.useMemo)(()=>(function(e){var t;let s=e.baseUrl.replace(/\/+$/,""),a=null!=(t=e.fetchImpl)?t:fetch,i=e.authHeader;async function r(e,t){let r={"content-type":"application/json"};i&&(r.authorization=i),(null==t?void 0:t.headers)&&Object.assign(r,t.headers);let o=await a("".concat(s).concat(e),{...t,headers:r}),l=await o.json().catch(()=>null);if(!o.ok)throw new n(o.status,e,l);return l}function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"/v1/missions/".concat(encodeURIComponent(e),"/showroom").concat(t)}return{spawn:async e=>await r(o(e)),deliberate:async(e,t,s)=>(await r(o(e,"/deliberate"),{method:"POST",body:JSON.stringify({question:t,...void 0!==s?{missionContext:s}:{}})})).decision,decide:async(e,t)=>(await r(o(e,"/decision"),{method:"POST",body:JSON.stringify({chosen:t})})).decision,archive:async e=>(await r(o(e,"/archive"),{method:"POST"})).state}})({baseUrl:window.location.origin}),[]);return s?(0,a.jsx)(l,{missionId:s,api:o}):(0,a.jsx)("div",{className:"p-4 text-sm",children:"Mission id missing in URL."})}},54003:(e,t,s)=>{Promise.resolve().then(s.bind(s,22293))},65449:(e,t,s)=>{"use strict";s.d(t,{l:()=>r});var a=s(77194),i=s(49954);function r(e){let[t,s]=(0,i.useState)("");if("onChoose"in e){let{decision:t,onChoose:s,busy:i}=e;return(0,a.jsxs)("article",{className:"rounded border border-border bg-card p-3","data-decision-card":t.id,children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:t.title}),(0,a.jsx)("p",{className:"mt-1 whitespace-pre-wrap text-sm text-muted-foreground",children:t.situation}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:t.options.map(e=>(0,a.jsxs)("button",{type:"button",disabled:i,onClick:()=>s(e),className:"rounded-md border border-border px-2 py-1 text-sm hover:bg-muted disabled:opacity-50",children:[e.label,"option"in t.recommendation&&t.recommendation.option===e.id&&(0,a.jsx)("span",{className:"ml-1 text-primary",children:"추천"})]},e.id))})]})}let{decision:r,onDecide:n,decidingChoice:o}=e,l=r.resolution.status,c="decided"===r.resolution.status?r.resolution.chosen:null;return(0,a.jsxs)("article",{className:"rounded border border-zinc-200 bg-white p-3",children:[(0,a.jsxs)("header",{className:"flex items-baseline justify-between gap-2",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:r.question}),(0,a.jsx)("time",{className:"shrink-0 text-xs opacity-60",dateTime:new Date(r.ts).toISOString(),children:new Date(r.ts).toLocaleString()})]}),(0,a.jsx)("ul",{className:"mt-2 flex flex-col gap-2",children:r.opinions.map((e,t)=>(0,a.jsxs)("li",{className:"rounded bg-zinc-50 p-2 text-xs",children:[(0,a.jsxs)("div",{className:"font-medium",children:[e.role,e.modelId?(0,a.jsxs)("span",{className:"opacity-60",children:[" \xb7 ",e.modelId]}):null]}),(0,a.jsx)("pre",{className:"mt-1 whitespace-pre-wrap text-xs leading-snug",children:e.text})]},"".concat(e.role,"-").concat(t)))}),(0,a.jsxs)("footer",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("span",{className:"text-xs opacity-70",children:["resolution:"," ","decided"===l?(0,a.jsxs)("span",{className:"font-medium text-emerald-700",children:["decided → ",c]}):(0,a.jsx)("span",{className:"text-amber-700",children:"open"})]}),n&&"open"===l&&(0,a.jsxs)("form",{className:"flex items-center gap-1",onSubmit:e=>{e.preventDefault(),t.trim()&&n(t.trim())},children:[(0,a.jsx)("input",{className:"w-32 rounded border border-zinc-300 px-2 py-0.5 text-xs",placeholder:"chosen…",value:t,onChange:e=>s(e.target.value),disabled:null!==o}),(0,a.jsx)("button",{type:"submit",className:"rounded bg-emerald-700 px-2 py-0.5 text-xs text-white disabled:opacity-50",disabled:!t.trim()||null!==o,children:o===t?"…":"apply"})]})]})]})}},98451:(e,t,s)=>{"use strict";var a=s(13979);s.o(a,"useParams")&&s.d(t,{useParams:function(){return a.useParams}}),s.o(a,"usePathname")&&s.d(t,{usePathname:function(){return a.usePathname}}),s.o(a,"useRouter")&&s.d(t,{useRouter:function(){return a.useRouter}}),s.o(a,"useSearchParams")&&s.d(t,{useSearchParams:function(){return a.useSearchParams}})}},e=>{e.O(0,[2201,6356,7358],()=>e(e.s=54003)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9773],{6767:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>h});var n=a(77194),s=a(49954),r=a(77653);class o extends Error{constructor(e,t,a){super("morning-showroom ".concat(e," on ").concat(t)),this.status=e,this.path=t,this.body=a,this.name="MorningShowroomApiError"}}let i={yesterday:"Yesterday",today:"Today",blockers:"Blockers",opportunities:"Opportunities"},d={yesterday:"◐",today:"▶",blockers:"⛔",opportunities:"✦"};function c(e){let[t,a]=(0,s.useState)({kind:"loading"}),[i,d]=(0,s.useState)(0);return(0,s.useEffect)(()=>{var t;let n=!1,s=null!=(t=e.api)?t:function(e){var t;let a=e.baseUrl.replace(/\/+$/,""),n=null!=(t=e.fetchImpl)?t:fetch,s=r.GM;return{async compose(t){let r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader);let i=await n("".concat(a).concat(s),{method:"POST",headers:r,body:JSON.stringify(t)}),d=await i.json().catch(()=>null);if(!i.ok||!(null==d?void 0:d.card))throw new o(i.status,s,d);return d.card}}}({baseUrl:window.location.origin});return a({kind:"loading"}),s.compose(e.request).then(e=>{n||a(0===e.lanes.length?{kind:"empty"}:{kind:"card",card:e})}).catch(()=>{n||a({kind:"unavailable"})}),()=>{n=!0}},[e.api,e.request.date,e.request.windowStart,e.request.windowEnd,i]),(0,n.jsx)(l,{state:t,onRetry:()=>d(e=>e+1)})}function l(e){let{state:t,onRetry:a}=e;return"loading"===t.kind?(0,n.jsx)("div",{className:"p-4 text-sm opacity-70",children:"Morning showroom을 준비하고 있습니다…"}):"unavailable"===t.kind?(0,n.jsxs)("section",{className:"p-4 text-sm","data-testid":"morning-showroom-unavailable",children:[(0,n.jsx)("h2",{className:"font-semibold",children:"Morning showroom이 아직 연결되지 않았습니다."}),(0,n.jsx)("p",{className:"mt-1 opacity-70",children:"다이제스트를 만들 수 있는 곳이 준비되면 이 화면에 표시됩니다."}),(0,n.jsx)("button",{type:"button",className:"mt-3 underline",onClick:a,children:"다시 시도"})]}):"empty"===t.kind?(0,n.jsxs)("section",{className:"p-4 text-sm","data-testid":"morning-showroom-empty",children:[(0,n.jsx)("h2",{className:"font-semibold",children:"아직 보여 줄 Morning showroom 항목이 없습니다."}),(0,n.jsx)("p",{className:"mt-1 opacity-70",children:"오늘의 실행 기록이 쌓이면 이곳에서 아침 다이제스트를 확인할 수 있습니다."}),(0,n.jsx)("button",{type:"button",className:"mt-3 underline","data-testid":"morning-showroom-empty-retry",onClick:a,children:"새로 고침"})]}):(0,n.jsxs)("section",{className:"morning-showroom p-4","data-date":t.card.date,children:[(0,n.jsxs)("header",{className:"mb-3 flex items-baseline justify-between",children:[(0,n.jsxs)("h2",{className:"text-lg font-semibold",children:["Morning showroom \xb7 ",t.card.date]}),(0,n.jsx)("time",{className:"text-xs opacity-60",dateTime:new Date(t.card.createdAt).toISOString(),children:new Date(t.card.createdAt).toLocaleTimeString()})]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:t.card.lanes.map(e=>(0,n.jsx)(m,{lane:e},e.lane))})]})}function m(e){let{lane:t}=e;return(0,n.jsxs)("article",{className:"rounded border border-zinc-200 bg-white p-3","data-lane":t.lane,children:[(0,n.jsxs)("header",{className:"mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,n.jsx)("span",{"aria-hidden":!0,children:d[t.lane]}),(0,n.jsx)("span",{children:i[t.lane]}),t.modelId&&(0,n.jsxs)("span",{className:"ml-auto opacity-60",children:["\xb7 ",t.modelId]})]}),(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-sm leading-snug",children:t.text})]})}function h(){let e=(0,s.useMemo)(()=>{let e=function(){let e=new Date,t=e.getUTCFullYear(),a=String(e.getUTCMonth()+1).padStart(2,"0"),n=String(e.getUTCDate()).padStart(2,"0"),s="".concat(t,"-").concat(a,"-").concat(n),r=new Date(Date.UTC(t,e.getUTCMonth(),e.getUTCDate()-1,22)),o=new Date(Date.UTC(t,e.getUTCMonth(),e.getUTCDate(),8));return{date:s,windowStart:r.toISOString(),windowEnd:o.toISOString()}}();return{date:e.date,windowStart:e.windowStart,windowEnd:e.windowEnd,runs:[],upcoming:[],backlogRecommendations:[]}},[]);return(0,n.jsx)(c,{request:e})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9773],{6767:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>h});var n=a(77194),s=a(49954),r=a(77653);class o extends Error{constructor(e,t,a){super("morning-showroom ".concat(e," on ").concat(t)),this.status=e,this.path=t,this.body=a,this.name="MorningShowroomApiError"}}let i={yesterday:"Yesterday",today:"Today",blockers:"Blockers",opportunities:"Opportunities"},d={yesterday:"◐",today:"▶",blockers:"⛔",opportunities:"✦"};function c(e){let[t,a]=(0,s.useState)({kind:"loading"}),[i,d]=(0,s.useState)(0);return(0,s.useEffect)(()=>{var t;let n=!1,s=null!=(t=e.api)?t:function(e){var t;let a=e.baseUrl.replace(/\/+$/,""),n=null!=(t=e.fetchImpl)?t:fetch,s=r.GM;return{async compose(t){let r={"content-type":"application/json"};e.authHeader&&(r.authorization=e.authHeader);let i=await n("".concat(a).concat(s),{method:"POST",headers:r,body:JSON.stringify(t)}),d=await i.json().catch(()=>null);if(!i.ok||!(null==d?void 0:d.card))throw new o(i.status,s,d);return d.card}}}({baseUrl:window.location.origin});return a({kind:"loading"}),s.compose(e.request).then(e=>{n||a(0===e.lanes.length?{kind:"empty"}:{kind:"card",card:e})}).catch(()=>{n||a({kind:"unavailable"})}),()=>{n=!0}},[e.api,e.request.date,e.request.windowStart,e.request.windowEnd,i]),(0,n.jsx)(l,{state:t,onRetry:()=>d(e=>e+1)})}function l(e){let{state:t,onRetry:a}=e;return"loading"===t.kind?(0,n.jsx)("div",{className:"p-4 text-sm opacity-70",children:"Morning showroom을 준비하고 있습니다…"}):"unavailable"===t.kind?(0,n.jsxs)("section",{className:"p-4 text-sm","data-testid":"morning-showroom-unavailable",children:[(0,n.jsx)("h2",{className:"font-semibold",children:"Morning showroom이 아직 연결되지 않았습니다."}),(0,n.jsx)("p",{className:"mt-1 opacity-70",children:"다이제스트를 만들 수 있는 곳이 준비되면 이 화면에 표시됩니다."}),(0,n.jsx)("button",{type:"button",className:"mt-3 underline",onClick:a,children:"다시 시도"})]}):"empty"===t.kind?(0,n.jsxs)("section",{className:"p-4 text-sm","data-testid":"morning-showroom-empty",children:[(0,n.jsx)("h2",{className:"font-semibold",children:"아직 보여 줄 Morning showroom 항목이 없습니다."}),(0,n.jsx)("p",{className:"mt-1 opacity-70",children:"오늘의 실행 기록이 쌓이면 이곳에서 아침 다이제스트를 확인할 수 있습니다."}),(0,n.jsx)("button",{type:"button",className:"mt-3 underline","data-testid":"morning-showroom-empty-retry",onClick:a,children:"새로 고침"})]}):(0,n.jsxs)("section",{className:"morning-showroom p-4","data-date":t.card.date,children:[(0,n.jsxs)("header",{className:"mb-3 flex items-baseline justify-between",children:[(0,n.jsxs)("h2",{className:"text-lg font-semibold",children:["Morning showroom \xb7 ",t.card.date]}),(0,n.jsx)("time",{className:"text-xs opacity-60",dateTime:new Date(t.card.createdAt).toISOString(),children:new Date(t.card.createdAt).toLocaleTimeString()})]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:t.card.lanes.map(e=>(0,n.jsx)(m,{lane:e},e.lane))})]})}function m(e){let{lane:t}=e;return(0,n.jsxs)("article",{className:"rounded border border-zinc-200 bg-white p-3","data-lane":t.lane,children:[(0,n.jsxs)("header",{className:"mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,n.jsx)("span",{"aria-hidden":!0,children:d[t.lane]}),(0,n.jsx)("span",{children:i[t.lane]}),t.modelId&&(0,n.jsxs)("span",{className:"ml-auto opacity-60",children:["\xb7 ",t.modelId]})]}),(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-sm leading-snug",children:t.text})]})}function h(){let e=(0,s.useMemo)(()=>{let e=function(){let e=new Date,t=e.getUTCFullYear(),a=String(e.getUTCMonth()+1).padStart(2,"0"),n=String(e.getUTCDate()).padStart(2,"0"),s="".concat(t,"-").concat(a,"-").concat(n),r=new Date(Date.UTC(t,e.getUTCMonth(),e.getUTCDate()-1,22)),o=new Date(Date.UTC(t,e.getUTCMonth(),e.getUTCDate(),8));return{date:s,windowStart:r.toISOString(),windowEnd:o.toISOString()}}();return{date:e.date,windowStart:e.windowStart,windowEnd:e.windowEnd,runs:[],upcoming:[],backlogRecommendations:[]}},[]);return(0,n.jsx)(c,{request:e})}},77653:(e,t,a)=>{"use strict";a.d(t,{GM:()=>i,J3:()=>o,WF:()=>n,bR:()=>r,m:()=>d,r5:()=>s});let n="/v1/devices",s="/v1/approvals/merges",r="/v1/templates/capability-preview",o="/v1/idle-nudge/preview",i="/v1/morning-digest/showroom",d="/v1/next-fluent/dispatch"},79380:(e,t,a)=>{Promise.resolve().then(a.bind(a,6767))}},e=>{e.O(0,[2201,6356,7358],()=>e(e.s=79380)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345],{2169:(e,r,t)=>{"use strict";t.d(r,{QL:()=>p,WelcomeHome:()=>j});var n=t(77194),s=t(49954),a=t(64862),l=t.n(a),i=t(98451),o=t(591),d=t(35083),u=t(68969),c=t(9705);let f=["/term","/chat","/intake","/live","/editor","/market","/setup"];var m=t(13868),x=t(39305),h=t(568);let g=[...h.Ue.filter(e=>!(0,h.wu)(e.href)).map(e=>({href:function(e){if(!(h.Ue.some(r=>r.href===e)||h.OE.some(r=>r.href===e)))throw Error("Unknown sidebar route: ".concat(e));return e}(e.href),label:e.label,navigable:!0})),...h.OE.map(e=>({href:e.href,label:e.href,navigable:!1,reason:e.reason}))],b=[...g.filter(e=>e.navigable),{href:"/setup",label:"Setup",navigable:!0}],v=[{href:"/morning",label:"아침 브리핑",navigable:!0},{href:"/settings/devices",label:"기기 목록",navigable:!0},{href:"/workflows/chat-ui",label:"워크플로 채팅",navigable:!0}];function p(e){let{ariaLabel:r,items:t=g}=e;return(0,n.jsx)("section",{"aria-label":r,className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>{var r;return(0,n.jsx)("article",{"data-testid":(r=e.href,"route-guidance-".concat("/"===r?"root":r.slice(1).replaceAll("/","-"))),"data-route-kind":e.navigable?"destination":"reference",className:(0,d.cn)("rounded-2xl border border-border/60 bg-card/60 p-5 shadow-sm",!e.navigable&&"bg-muted/40"),children:e.navigable?(0,n.jsxs)(l(),{href:e.href,className:"font-semibold underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.label," ",(0,n.jsx)("code",{className:"text-xs text-muted-foreground",children:e.href})]}):(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("span",{className:"font-semibold",children:["참고 주소 ",(0,n.jsx)("code",{className:"text-xs text-muted-foreground",children:e.href})]}),(0,n.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e.reason})]})},e.href)})})}function j(){let{role:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null==(0,s.useContext)(o.AppRouterContext)?(0,n.jsx)(N,{role:e}):(0,n.jsx)(w,{role:e})}function w(e){let{role:r}=e,t=(0,i.useRouter)(),a=(0,i.usePathname)(),l=(0,m._r)(),o=null==a||l.isError||l.isPending||l.isLoading?null:(0,x.P)(l.data,a);return(0,s.useEffect)(()=>{"/setup"===o&&t.replace("/setup")},[o,t]),(0,n.jsx)(N,{role:r})}function N(e){var r;let{role:t}=e,s=(0,u.In)(),a=null!=t?t:s,{core:l,more:i}=(r=b.filter(e=>(0,c.EX)(a,e.href)),{core:f.flatMap(e=>r.filter(r=>r.href===e)),more:r.filter(e=>!f.some(r=>r===e.href))});return(0,n.jsx)("main",{"data-testid":"welcome-home",className:"min-h-screen bg-gradient-to-b from-background via-background to-muted/40 px-6 py-12 sm:px-10",children:(0,n.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-10",children:[(0,n.jsxs)("header",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"elanous PWA"}),(0,n.jsx)("h1",{className:"text-3xl font-bold leading-tight sm:text-4xl",children:"웰컴 — 어디부터 시작할까요?"}),(0,n.jsx)("p",{className:"max-w-2xl text-sm text-muted-foreground sm:text-base",children:"처음이라면 아래 핵심 화면에서 시작하세요. 다른 화면은 필요할 때 펼쳐 볼 수 있습니다."})]}),(0,n.jsx)(p,{ariaLabel:"핵심 화면",items:l}),i.length>0&&(0,n.jsxs)("details",{className:"rounded-2xl border border-border/60 bg-card/60 p-5",children:[(0,n.jsxs)("summary",{className:"cursor-pointer font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:["모든 화면 (",i.length,")"]}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(p,{ariaLabel:"나머지 화면",items:i})})]}),v.some(e=>(0,c.EX)(a,e.href))&&(0,n.jsxs)("details",{className:"rounded-2xl border border-border/60 bg-card/60 p-5",children:[(0,n.jsx)("summary",{className:"cursor-pointer font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"고치는 중인 화면"}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(p,{ariaLabel:"고치는 중인 화면",items:v.filter(e=>(0,c.EX)(a,e.href))})})]})]})})}},13868:(e,r,t)=>{"use strict";t.d(r,{_r:()=>a});var n=t(49954),s=t(6896);function a(){let e=(0,s.Qj)(),[r,t]=(0,n.useState)({data:void 0,isError:!1,isPending:!0});return(0,n.useEffect)(()=>{if(!e)return void t({data:void 0,isError:!1,isPending:!0});let r=!0,n=()=>{e.getHealth().then(e=>{r&&t({data:e,isError:!1,isPending:!1})}).catch(()=>{r&&t(e=>({...e,isError:!0,isPending:!1}))})};n();let s=setInterval(n,6e4);return()=>{r=!1,clearInterval(s)}},[e]),{...r,isLoading:r.isPending&&null!==e}}t(28948)},35083:(e,r,t)=>{"use strict";t.d(r,{cn:()=>a});var n=t(44196),s=t(25080);function a(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,s.QP)((0,n.$)(r))}},39305:(e,r,t)=>{"use strict";t.d(r,{C:()=>a,P:()=>s});let n="셋업 모드 — 먼저 LLM 을 정하세요";function s(e,r){return(null==e?void 0:e.setupMode)!==!0||"/"!==r?null:"/setup"}function a(e,r){if((null==e?void 0:e.setupMode)!==!0||"/setup"===r||r.startsWith("/setup/"))return null;let t=e.setupMissing;return t&&t.length>0?"".concat(n," (").concat(t.join(", "),")"):n}},68969:(e,r,t)=>{"use strict";t.d(r,{GC:()=>s,In:()=>d,OG:()=>i});var n=t(49954);let s="elanous.pwa.role",a="elanous:pwa-role";function l(){try{let e=window.localStorage.getItem(s);if("owner"===e||"contributor"===e||"general"===e)return e}catch(e){}return"general"}function i(e){try{window.localStorage.setItem(s,e)}catch(e){}"function"==typeof window.dispatchEvent&&window.dispatchEvent(new Event(a))}function o(e){if("function"!=typeof window.addEventListener)return()=>{};window.addEventListener(a,e);let r=r=>{(r.key===s||null===r.key)&&e()};return window.addEventListener("storage",r),()=>{window.removeEventListener(a,e),window.removeEventListener("storage",r)}}function d(){return(0,n.useSyncExternalStore)(o,l,()=>"general")}},72716:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>l});var n=t(77194),s=t(98451),a=t(2169);function l(){let e=(0,s.usePathname)();return(0,n.jsx)("main",{"data-testid":"not-found",className:"min-h-screen bg-gradient-to-b from-background via-background to-muted/40 px-6 py-12 sm:px-10",children:(0,n.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-10",children:[(0,n.jsxs)("header",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"elanous PWA"}),(0,n.jsx)("h1",{className:"text-3xl font-bold leading-tight sm:text-4xl",children:"여기엔 없습니다"}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:[(0,n.jsx)("code",{children:e||"알 수 없는 주소"})," 주소는 이 앱에 없습니다. 아래에서 지금 갈 수 있는 곳을 선택하거나 참고 주소의 사유를 확인하세요."]})]}),(0,n.jsx)(a.QL,{ariaLabel:"이동 가능한 주소와 참고 주소"})]})})}},
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4345],{2169:(e,r,t)=>{"use strict";t.d(r,{QL:()=>p,WelcomeHome:()=>j});var n=t(77194),s=t(49954),a=t(64862),l=t.n(a),i=t(98451),o=t(591),d=t(35083),u=t(68969),c=t(9705);let f=["/term","/chat","/intake","/live","/editor","/market","/setup"];var m=t(13868),x=t(39305),h=t(568);let g=[...h.Ue.filter(e=>!(0,h.wu)(e.href)).map(e=>({href:function(e){if(!(h.Ue.some(r=>r.href===e)||h.OE.some(r=>r.href===e)))throw Error("Unknown sidebar route: ".concat(e));return e}(e.href),label:e.label,navigable:!0})),...h.OE.map(e=>({href:e.href,label:e.href,navigable:!1,reason:e.reason}))],b=[...g.filter(e=>e.navigable),{href:"/setup",label:"Setup",navigable:!0}],v=[{href:"/morning",label:"아침 브리핑",navigable:!0},{href:"/settings/devices",label:"기기 목록",navigable:!0},{href:"/workflows/chat-ui",label:"워크플로 채팅",navigable:!0}];function p(e){let{ariaLabel:r,items:t=g}=e;return(0,n.jsx)("section",{"aria-label":r,className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>{var r;return(0,n.jsx)("article",{"data-testid":(r=e.href,"route-guidance-".concat("/"===r?"root":r.slice(1).replaceAll("/","-"))),"data-route-kind":e.navigable?"destination":"reference",className:(0,d.cn)("rounded-2xl border border-border/60 bg-card/60 p-5 shadow-sm",!e.navigable&&"bg-muted/40"),children:e.navigable?(0,n.jsxs)(l(),{href:e.href,className:"font-semibold underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.label," ",(0,n.jsx)("code",{className:"text-xs text-muted-foreground",children:e.href})]}):(0,n.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,n.jsxs)("span",{className:"font-semibold",children:["참고 주소 ",(0,n.jsx)("code",{className:"text-xs text-muted-foreground",children:e.href})]}),(0,n.jsx)("p",{className:"text-sm leading-relaxed text-muted-foreground",children:e.reason})]})},e.href)})})}function j(){let{role:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return null==(0,s.useContext)(o.AppRouterContext)?(0,n.jsx)(N,{role:e}):(0,n.jsx)(w,{role:e})}function w(e){let{role:r}=e,t=(0,i.useRouter)(),a=(0,i.usePathname)(),l=(0,m._r)(),o=null==a||l.isError||l.isPending||l.isLoading?null:(0,x.P)(l.data,a);return(0,s.useEffect)(()=>{"/setup"===o&&t.replace("/setup")},[o,t]),(0,n.jsx)(N,{role:r})}function N(e){var r;let{role:t}=e,s=(0,u.In)(),a=null!=t?t:s,{core:l,more:i}=(r=b.filter(e=>(0,c.EX)(a,e.href)),{core:f.flatMap(e=>r.filter(r=>r.href===e)),more:r.filter(e=>!f.some(r=>r===e.href))});return(0,n.jsx)("main",{"data-testid":"welcome-home",className:"min-h-screen bg-gradient-to-b from-background via-background to-muted/40 px-6 py-12 sm:px-10",children:(0,n.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-10",children:[(0,n.jsxs)("header",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"elanous PWA"}),(0,n.jsx)("h1",{className:"text-3xl font-bold leading-tight sm:text-4xl",children:"웰컴 — 어디부터 시작할까요?"}),(0,n.jsx)("p",{className:"max-w-2xl text-sm text-muted-foreground sm:text-base",children:"처음이라면 아래 핵심 화면에서 시작하세요. 다른 화면은 필요할 때 펼쳐 볼 수 있습니다."})]}),(0,n.jsx)(p,{ariaLabel:"핵심 화면",items:l}),i.length>0&&(0,n.jsxs)("details",{className:"rounded-2xl border border-border/60 bg-card/60 p-5",children:[(0,n.jsxs)("summary",{className:"cursor-pointer font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:["모든 화면 (",i.length,")"]}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(p,{ariaLabel:"나머지 화면",items:i})})]}),v.some(e=>(0,c.EX)(a,e.href))&&(0,n.jsxs)("details",{className:"rounded-2xl border border-border/60 bg-card/60 p-5",children:[(0,n.jsx)("summary",{className:"cursor-pointer font-semibold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"고치는 중인 화면"}),(0,n.jsx)("div",{className:"mt-4",children:(0,n.jsx)(p,{ariaLabel:"고치는 중인 화면",items:v.filter(e=>(0,c.EX)(a,e.href))})})]})]})})}},13868:(e,r,t)=>{"use strict";t.d(r,{_r:()=>a});var n=t(49954),s=t(6896);function a(){let e=(0,s.Qj)(),[r,t]=(0,n.useState)({data:void 0,isError:!1,isPending:!0});return(0,n.useEffect)(()=>{if(!e)return void t({data:void 0,isError:!1,isPending:!0});let r=!0,n=()=>{e.getHealth().then(e=>{r&&t({data:e,isError:!1,isPending:!1})}).catch(()=>{r&&t(e=>({...e,isError:!0,isPending:!1}))})};n();let s=setInterval(n,6e4);return()=>{r=!1,clearInterval(s)}},[e]),{...r,isLoading:r.isPending&&null!==e}}t(28948)},35083:(e,r,t)=>{"use strict";t.d(r,{cn:()=>a});var n=t(44196),s=t(25080);function a(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return(0,s.QP)((0,n.$)(r))}},39305:(e,r,t)=>{"use strict";t.d(r,{C:()=>a,P:()=>s});let n="셋업 모드 — 먼저 LLM 을 정하세요";function s(e,r){return(null==e?void 0:e.setupMode)!==!0||"/"!==r?null:"/setup"}function a(e,r){if((null==e?void 0:e.setupMode)!==!0||"/setup"===r||r.startsWith("/setup/"))return null;let t=e.setupMissing;return t&&t.length>0?"".concat(n," (").concat(t.join(", "),")"):n}},50588:(e,r,t)=>{Promise.resolve().then(t.bind(t,72716))},68969:(e,r,t)=>{"use strict";t.d(r,{GC:()=>s,In:()=>d,OG:()=>i});var n=t(49954);let s="elanous.pwa.role",a="elanous:pwa-role";function l(){try{let e=window.localStorage.getItem(s);if("owner"===e||"contributor"===e||"general"===e)return e}catch(e){}return"general"}function i(e){try{window.localStorage.setItem(s,e)}catch(e){}"function"==typeof window.dispatchEvent&&window.dispatchEvent(new Event(a))}function o(e){if("function"!=typeof window.addEventListener)return()=>{};window.addEventListener(a,e);let r=r=>{(r.key===s||null===r.key)&&e()};return window.addEventListener("storage",r),()=>{window.removeEventListener(a,e),window.removeEventListener("storage",r)}}function d(){return(0,n.useSyncExternalStore)(o,l,()=>"general")}},72716:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>l});var n=t(77194),s=t(98451),a=t(2169);function l(){let e=(0,s.usePathname)();return(0,n.jsx)("main",{"data-testid":"not-found",className:"min-h-screen bg-gradient-to-b from-background via-background to-muted/40 px-6 py-12 sm:px-10",children:(0,n.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-10",children:[(0,n.jsxs)("header",{className:"flex flex-col gap-3",children:[(0,n.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"elanous PWA"}),(0,n.jsx)("h1",{className:"text-3xl font-bold leading-tight sm:text-4xl",children:"여기엔 없습니다"}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:[(0,n.jsx)("code",{children:e||"알 수 없는 주소"})," 주소는 이 앱에 없습니다. 아래에서 지금 갈 수 있는 곳을 선택하거나 참고 주소의 사유를 확인하세요."]})]}),(0,n.jsx)(a.QL,{ariaLabel:"이동 가능한 주소와 참고 주소"})]})})}},98451:(e,r,t)=>{"use strict";var n=t(13979);t.o(n,"useParams")&&t.d(r,{useParams:function(){return n.useParams}}),t.o(n,"usePathname")&&t.d(r,{usePathname:function(){return n.usePathname}}),t.o(n,"useRouter")&&t.d(r,{useRouter:function(){return n.useRouter}}),t.o(n,"useSearchParams")&&t.d(r,{useSearchParams:function(){return n.useSearchParams}})}},e=>{e.O(0,[8085,2566,4862,112,9842,2201,6356,7358],()=>e(e.s=50588)),_N_E=e.O()}]);
|