elanous 0.2.10 → 0.2.12
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/-6XrAoD3eU7NyMHAE4xPS/_buildManifest.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1147-466ec15afacc1a65.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1159-0c5ef8bc21cb6afb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1394-ee3795b112907122.js +1 -0
- package/apps/pwa/out/_next/static/chunks/1452.93700483b9d4fc61.js +9 -0
- package/apps/pwa/out/_next/static/chunks/{6062-73e68343a9814f6a.js → 1829-b453a1b22d3999bb.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/2176-c379e3ebce874151.js +1 -0
- package/apps/pwa/out/_next/static/chunks/2426.8c6ee0c668d53def.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3170-7ec60a56fa0e4728.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3278-ae6ef084769f6195.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3454-988a53dac60a1763.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3638-aa80b4641ea439db.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3735-fe3402553ac1c9c6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/3869-3cd46526879f454c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/390.c373e31b3b9d0c41.js +5 -0
- package/apps/pwa/out/_next/static/chunks/3992-2e522a8ac5f2afde.js +25 -0
- package/apps/pwa/out/_next/static/chunks/4215-c9d91dd644ec1719.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4508-5d0161d1e724d735.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4685-c3c1c625b71accd1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4733-623a79345b171e1c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/4883.3bd969ea1d3aaaff.js +2 -0
- package/apps/pwa/out/_next/static/chunks/5532.6899a12958a89b72.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{8067-87ce253ec2f23697.js → 5845-e6c003ce8d5fd36a.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/5978-b27004c677119115.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{8046cadf-211ca3c0e00f2b72.js → 5cd7e3a9-404fd6b8d0ecd44c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/6048-4c5c33579bc4ef78.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6303-422dbf0f67c72aac.js +1 -0
- package/apps/pwa/out/_next/static/chunks/6751-bb3595948b2e311b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7274-19b7279f18b47ab3.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7277-0b2fc7c16ba2d64b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{4323.c5dfb6f503304775.js → 7334.a6679d9168f37aa8.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/7551-a0e0707b79164ddd.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7758-0b018a9e4fc56200.js +1 -0
- package/apps/pwa/out/_next/static/chunks/7777-79f845045aa1ed86.js +1 -0
- package/apps/pwa/out/_next/static/chunks/79f8be9e-957d68913b590b08.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8025-cc24ee5d8f2fb6f8.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8039-df92e08fede5de8f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8206-c6684dcde12be721.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8421-1c4acfb1395a0edf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8605-0259994816604c49.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8725.bf46bb1395dd0fa2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8734-252d511cd276c0dc.js +1 -0
- package/apps/pwa/out/_next/static/chunks/8834-ca1cb09c1cb1a6bf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{2415.ed6428ff334c7ce2.js → 9269.d2a4795bc6812717.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/9538-2816b90923606459.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9656-c1540088f5859c80.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9906-482c6619b3fdda20.js +1 -0
- package/apps/pwa/out/_next/static/chunks/9920-5cfdc5e8fd209825.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/_not-found/page-d16993889b125c42.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-cb169620945d1952.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-cefe8169e36cf62a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/board/page-d2e35228bc497119.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/{page-54b32bd27726588d.js → page-5c05b0da4bc1392c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/page-e0ccdb576812b523.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/chat/page-813c4a52c9d05ca8.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/consult/page-4731f2c215358937.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/control/page-a022b257950f39e6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-a2ffc717e04b8b0a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/editor/page-b59ee4e70fc18fcf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/exec/page-a67e11ba962337b5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/field/page-c172dabd796eb7a3.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/healthz/route-d16993889b125c42.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/inside/page-1efd0cb9e0ed9d13.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/intake/page-d5dc7ff69a37b4cf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/layout-e71c84189e8c683e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/live/page-1d6a533ce5a6efcb.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/market/page-dfca9b7d2de0b135.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-793fa536b3a6ef37.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/morning/page-6dd3bfbbde2a5c2c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/not-found-490653e8d4cc8852.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-77447356baad75d2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-29e961191f6057df.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-c822f55b884d9104.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-fa4ccfc432424e52.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/outputs/page-6d604227e1664b71.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/page-9c7e8f744a765daf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-4048543b4b7ad5e0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-4c3a3126abed551a.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/sessions/page-64b0aecb1ca75e75.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-4292d0149020e8a7.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/page-db14d0be7f1c460c.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-e5d8072cd7cfef73.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/layout-d16993889b125c42.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/setup/page-9547b5cec7cf76bf.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/share/page-e6dcb83265530636.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-45248f08d6aecae5.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-2cddeb9e2aeedc55.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/term/page-e297866051595d81.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/today/page-baba2e047872fb0f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/page-e895da4ec9cac345.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/vault/page-4344faf20216233b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-698bb29f11864b89.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-bd6a6dc1ddc273f2.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-2e9e2fb01c9da1c9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-d62ceb13411ebba4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{2ea96958-e8c7e112de50b067.js → f48170cc-d05d28bf87a43bf4.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/framework-172630e6aa5e2d7f.js +1 -0
- package/apps/pwa/out/_next/static/chunks/main-app-f0fe2d7477845181.js +1 -0
- package/apps/pwa/out/_next/static/chunks/main-fc98ac70b44eccb0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/pages/_app-5bd7f10271f72413.js +1 -0
- package/apps/pwa/out/_next/static/chunks/pages/_error-97d0d85ea05fef9b.js +1 -0
- package/apps/pwa/out/_next/static/chunks/webpack-9e4d02d567b98240.js +1 -0
- package/apps/pwa/out/_next/static/css/128fb7fb670b2fbf.css +1 -0
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +23 -23
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +23 -23
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +23 -23
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +22 -22
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +22 -22
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +22 -22
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +23 -23
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +23 -23
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +23 -23
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +23 -23
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +23 -23
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +23 -23
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +22 -22
- package/apps/pwa/out/inside/index.html +1 -0
- package/apps/pwa/out/inside/index.txt +31 -0
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +23 -23
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +23 -23
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +22 -22
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +22 -22
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +23 -23
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +23 -23
- package/apps/pwa/out/ops/checklist/index.html +1 -1
- package/apps/pwa/out/ops/checklist/index.txt +22 -22
- package/apps/pwa/out/ops/release/index.html +1 -1
- package/apps/pwa/out/ops/release/index.txt +22 -22
- package/apps/pwa/out/ops/seats/index.html +1 -1
- package/apps/pwa/out/ops/seats/index.txt +22 -22
- package/apps/pwa/out/outputs/index.html +1 -0
- package/apps/pwa/out/outputs/index.txt +30 -0
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +23 -23
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +23 -23
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +22 -22
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +23 -23
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +23 -23
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +23 -23
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +23 -23
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +23 -23
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +22 -22
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +23 -23
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +23 -24
- package/apps/pwa/out/today/index.html +1 -1
- package/apps/pwa/out/today/index.txt +23 -23
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +23 -23
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +23 -23
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +23 -23
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +23 -23
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +23 -24
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +23 -23
- package/graphs/context/nightly-condense.yaml +21 -0
- package/graphs/context/recipes.yaml +12 -0
- package/graphs/demo/inside-seed.yaml +20 -0
- package/graphs/demo/recipes.yaml +12 -0
- package/graphs/drafts/draft-cleanup.yaml +19 -0
- package/graphs/drafts/recipes.yaml +23 -0
- package/graphs/intake/intake-daily.yaml +2 -1
- package/graphs/ops/recipes.yaml +3 -0
- package/graphs/ops/secret-exposure.yaml +24 -0
- package/graphs/release/recipes.yaml +3 -0
- package/graphs/release/release-loop.yaml +4 -1
- package/graphs/video/explainer-line.yaml +2 -2
- package/package.json +2 -1
- package/plugins/card-followup/examples/sample-card.png +0 -0
- package/plugins/elanous-hwp/README.md +25 -0
- package/plugins/elanous-hwp/cli.ts +22 -0
- package/plugins/elanous-hwp/converter.ts +237 -0
- package/plugins/elanous-hwp/fixtures/fixed-controls.hwpx +0 -0
- package/plugins/elanous-hwp/fixtures/fixed-table-controls.hwpx +0 -0
- package/plugins/elanous-hwp/fixtures/fixed.hwpx +0 -0
- package/plugins/elanous-hwp/plugin.json +16 -0
- package/plugins/elanous-hwp/plugin.ts +40 -0
- package/scripts/ci-public-export-leak-gate.ts +75 -14
- package/scripts/ci-public-leak-gate.ts +44 -9
- package/scripts/context-hooks/claude-stop.sh +4 -0
- package/scripts/context-hooks/emit.ts +24 -0
- package/scripts/context-hooks/post-tool-use.sh +4 -0
- package/scripts/coord-channel-watch.sh +12 -0
- package/scripts/coord-requests-bridge.ts +143 -0
- package/scripts/field-feed/lib.ts +4 -0
- package/scripts/fleet/node-setup.sh +20 -3
- package/scripts/homebrew-formula-bump.ts +69 -0
- package/scripts/lib/telegram-inject-args.ts +31 -0
- package/scripts/marketing/measure-site-numbers.ts +169 -0
- package/scripts/measure-gate-shards.ts +309 -0
- package/scripts/measure-pod-memory-by-goal.ts +130 -0
- package/scripts/mission-request-judge.ts +31 -1
- package/scripts/morning-report.ts +2 -2
- package/scripts/opportunity-scan.ts +1 -1
- package/scripts/release-loop/auto-approve-node.ts +21 -4
- package/scripts/release-loop/checklist-gate-node.ts +2 -1
- package/scripts/release-loop/cut-branch.ts +84 -0
- package/scripts/release-loop/gate-node.ts +22 -15
- package/scripts/release-loop/mac-smoke-node.ts +229 -0
- package/scripts/release-loop/node-verdict.ts +3 -3
- package/scripts/release-loop/ops-upgrade-node.ts +47 -6
- package/scripts/release-loop/publish-node.ts +4 -1
- package/scripts/release-loop/tui-node-checks.ts +42 -0
- package/scripts/release-loop/tui-sim-node.ts +32 -8
- package/scripts/release-loop/unattended-release.ts +5 -3
- package/scripts/release-loop/version-node.ts +74 -13
- package/scripts/signal-digest-cycle.ts +2 -7
- package/scripts/signal-digest-photo.ts +11 -0
- package/scripts/tech1-public-measure.ts +94 -0
- package/scripts/telegram-inject.ts +14 -6
- package/scripts/test-diet/node.ts +1 -1
- package/scripts/test-diet/remeasure-list.ts +112 -0
- package/scripts/tui-regress.ts +2 -2
- package/scripts/ux/demo-rehearsal.ts +247 -0
- package/scripts/ux/demo-seed.ts +108 -0
- package/scripts/ux/lib/rehearsal-verdict.ts +80 -0
- package/skills/diagram-master/SKILL.md +366 -0
- package/skills/diagram-master/references/engines/excalidraw/color-palette.md +67 -0
- package/skills/diagram-master/references/engines/excalidraw/element-templates.md +182 -0
- package/skills/diagram-master/references/engines/excalidraw/json-schema.md +71 -0
- package/skills/diagram-master/references/engines/excalidraw/render_excalidraw.py +189 -0
- package/skills/diagram-master/references/engines/excalidraw/render_template.html +57 -0
- package/skills/diagram-master/references/engines/matplotlib/matplotlib-patterns.md +235 -0
- package/skills/diagram-master/references/engines/matplotlib/render_matplotlib.py +184 -0
- package/skills/diagram-master/references/engines/mermaid/domain-templates.md +435 -0
- package/skills/diagram-master/references/engines/mermaid/render_mermaid.py +116 -0
- package/skills/diagram-master/references/engines/mermaid/syntax-reference.md +2247 -0
- package/skills/diagram-master/references/engines/nanobannana/render_nanobannana2.py +168 -0
- package/skills/diagram-master/references/engines/svg/color-palette.md +188 -0
- package/skills/diagram-master/references/engines/svg/html-base-template.html +332 -0
- package/skills/diagram-master/references/engines/svg/interactivity-patterns.md +435 -0
- package/skills/diagram-master/references/engines/svg/render_interactive_svg.py +212 -0
- package/skills/diagram-master/references/engines/svg/svg-element-templates.md +349 -0
- package/skills/diagram-master/references/examples/README.md +69 -0
- package/skills/diagram-master/references/examples/ref_grid_architecture.png +0 -0
- package/skills/diagram-master/references/examples/ref_layered_flow.png +0 -0
- package/skills/diagram-master/references/pyproject.toml +16 -0
- package/skills/diagram-master/references/quality-checklist.md +33 -0
- package/skills/diagram-master/references/routing-guide.md +164 -0
- package/skills/diagram-master/references/uv.lock +1356 -0
- package/skills/google-workspace/SKILL.md +33 -0
- package/skills/google-workspace/scripts/gws-safe.sh +177 -0
- package/skills/grill-me/SKILL.md +1 -1
- package/skills/lecture-note-digitizer/SKILL.md +926 -0
- package/skills/lecture-note-digitizer/references/convert_to_pdf.py +30 -0
- package/skills/lecture-note-digitizer/references/extract_slide_diagram.py +73 -0
- package/skills/lecture-note-digitizer/references/html-template.md +167 -0
- package/skills/lecture-note-digitizer/references/katex-style-guide.md +165 -0
- package/skills/omni-crawl/SKILL.md +21 -11
- package/skills/omni-crawl/scripts/main.ts +6 -6
- package/skills/omni-crawl/src/router.ts +3 -3
- package/skills/omni-digest/SKILL.md +17 -9
- package/skills/omni-digest/digest.md +2 -2
- package/skills/omni-digest/src/fetch.ts +30 -3
- package/skills/pitch-deck/SKILL.md +2 -2
- package/skills/pitch-deck/template.html +2 -2
- package/skills/youtube-master/SKILL.md +163 -0
- package/skills/youtube-master/package-lock.json +558 -0
- package/skills/youtube-master/package.json +13 -0
- package/skills/youtube-master/references/study-note-template.md +124 -0
- package/skills/youtube-master/scripts/main.ts +435 -0
- package/skills/youtube-master/scripts/transcribe-local.ts +24 -0
- package/skills/youtube-master/src/audio.ts +63 -0
- package/skills/youtube-master/src/domain-staging.ts +50 -0
- package/skills/youtube-master/src/env.ts +36 -0
- package/skills/youtube-master/src/obsidian.ts +155 -0
- package/skills/youtube-master/src/router.ts +110 -0
- package/skills/youtube-master/src/stt.ts +199 -0
- package/skills/youtube-master/src/study-note.ts +175 -0
- package/skills/youtube-master/src/summarize.ts +358 -0
- package/skills/youtube-master/src/transcript.ts +76 -0
- package/skills/youtube-master/src/types.ts +91 -0
- package/skills/youtube-master/src/util.ts +93 -0
- package/skills/youtube-master/src/youtube.ts +70 -0
- package/skills/youtube-master/tsconfig.json +13 -0
- package/src/acp/server.ts +5 -2
- package/src/agent-mission/driver.ts +215 -23
- package/src/agent-mission/pty-decision.ts +71 -0
- package/src/agent-mission/review-loop.ts +30 -0
- package/src/autopilot/build/llm-conflict-merge.ts +16 -3
- package/src/autopilot/pty-control-loop.ts +4 -1
- package/src/autopilot/tool-registry.ts +2 -0
- package/src/boot/daemon-prompt-turn.ts +5 -0
- package/src/boot/daemon-runtime.ts +9 -3
- package/src/boot/daemon-tools/web-search.ts +3 -0
- package/src/card-followup/core.ts +109 -0
- package/src/chat/index.ts +2 -0
- package/src/cli/drive-input-jail.ts +101 -0
- package/src/cli/hooks-cli.ts +17 -3
- package/src/cli/make-cli.ts +43 -0
- package/src/cli/persona-cli.ts +98 -9
- package/src/cli/plugin-cli.ts +31 -22
- package/src/cli/pod-cli.ts +36 -9
- package/src/cli/pod-memory-advice.ts +35 -0
- package/src/cli/pr-cli.ts +51 -15
- package/src/cli/pty-drive-cli.ts +41 -7
- package/src/cli/pty-drive-verdict.ts +40 -0
- package/src/cli/release-cli.ts +63 -10
- package/src/cli/setup-cli.ts +43 -1
- package/src/cli/skills-cli.ts +17 -1
- package/src/context-bus/claude-hooks-install.ts +10 -0
- package/src/context-bus/context-now-surfaces.ts +65 -0
- package/src/context-bus/context-now.ts +104 -0
- package/src/context-bus/coord-events.ts +2 -2
- package/src/context-bus/external-events.ts +52 -0
- package/src/context-bus/long-term-memory.ts +108 -0
- package/src/context-bus/nightly-condense.ts +153 -0
- package/src/context-bus/session-events.ts +35 -0
- package/src/dashboard/dashboard-status-lines.ts +2 -0
- package/src/dashboard/index.ts +17 -4
- package/src/dashboard/slash-runtime/dashboard-handlers.ts +31 -1
- package/src/decisions/decision-cards.ts +10 -3
- package/src/decisions/decision-ledger.ts +13 -5
- package/src/discord/sprint21-runtime.ts +5 -1
- package/src/discord-self-message.ts +32 -0
- package/src/discord-slash-wire.ts +5 -1
- package/src/discord.ts +17 -1
- package/src/domains/core-tools.ts +3 -2
- package/src/domains/outbound-alert.ts +105 -32
- package/src/domains/outbound-log-probe.ts +8 -0
- package/src/domains/telegram-kind-route.ts +51 -13
- package/src/exec-requests/default-outputs.ts +25 -0
- package/src/exec-requests/planner.ts +10 -2
- package/src/exec-requests/runner.ts +20 -6
- package/src/exec-requests/store.ts +3 -0
- package/src/execution-loop/launch-gate.ts +109 -0
- package/src/field/field-reel.ts +5 -1
- package/src/field-note/index.ts +201 -0
- package/src/field-note/telegram.ts +142 -0
- package/src/field-note/transcribe.ts +248 -0
- package/src/graph-kinds/registry.ts +3 -3
- package/src/graph-runner/graph-cli.ts +61 -1
- package/src/graph-runner/graph-grow-llm.ts +47 -0
- package/src/graph-runner/graph-grow.ts +50 -0
- package/src/graph-runner/runner.ts +329 -33
- package/src/grok/agent-search.ts +8 -2
- package/src/guardian/secret-exposure-scan.ts +101 -0
- package/src/harness/harness-cli-command.ts +375 -13
- package/src/harness/harness-pod-dispatch.ts +43 -23
- package/src/harness/harness-seams.ts +38 -4
- package/src/harness/harness-stop.ts +23 -4
- package/src/harness/launch-registry.ts +91 -0
- package/src/harness/process-garbage.ts +5 -3
- package/src/hooks/consult-intake.ts +153 -0
- package/src/hooks/dispatch.ts +82 -0
- package/src/hooks/expose.ts +254 -0
- package/src/hooks/github-shadow.ts +108 -0
- package/src/hooks/providers.ts +71 -5
- package/src/hooks/queue.ts +1 -1
- package/src/hooks/receiver.ts +94 -16
- package/src/index.ts +76 -14
- package/src/intake-plane/categorize.ts +18 -46
- package/src/intake-plane/discord-seat-work.ts +38 -2
- package/src/intake-plane/front-route-classifier.ts +33 -39
- package/src/intake-plane/persona-answer.ts +30 -0
- package/src/intake-plane/runtime-callables.ts +8 -1
- package/src/intake-plane/telegram-seat-work.ts +36 -2
- package/src/intake-plane/wish-card.ts +33 -0
- package/src/intake-plane/wish-folder.ts +67 -0
- package/src/intent-gate/gate.ts +30 -10
- package/src/live/detail-switch.ts +5 -0
- package/src/llm/difficulty.ts +57 -0
- package/src/llm/judge-layer.ts +101 -0
- package/src/llm/mission-router.ts +33 -19
- package/src/loops/contract/examples/cmo-seat.loop.yaml +51 -0
- package/src/loops/contract/examples/orchestrator.loop.yaml +57 -0
- package/src/loops/contract/examples/steward.loop.yaml +50 -0
- package/src/loops/contract/loop-agent.schema.json +138 -0
- package/src/loops/contract/validate.ts +64 -0
- package/src/loops/registry.ts +20 -6
- package/src/market/signed-index.ts +4 -0
- package/src/maturity/bot-command-maturity.ts +45 -0
- package/src/maturity/feature-maturity.ts +27 -4
- package/src/model-tier/index.ts +2 -2
- package/src/model-tier/tier-resolver.ts +20 -20
- package/src/model-tier/types.ts +6 -6
- package/src/mss/logging/log-store.ts +15 -0
- package/src/nexus/api/config-model-tier.ts +5 -4
- package/src/nexus/api/fabric-plans.ts +53 -0
- package/src/nexus/api/harness-api.ts +5 -1
- package/src/nexus/api/health.ts +2 -0
- package/src/nexus/api/http-server.ts +67 -8
- package/src/nexus/api/inside-events.ts +226 -0
- package/src/nexus/api/meta-api.ts +21 -8
- package/src/nexus/api/missions.ts +6 -1
- package/src/nexus/api/ops-seats.ts +33 -0
- package/src/nexus/api/outbound-report.ts +40 -7
- package/src/nexus/api/outputs-route.ts +44 -0
- package/src/nexus/api/personas.ts +95 -53
- package/src/nexus/api/seat-requests.ts +44 -2
- package/src/nexus/api/sessions-store.ts +17 -38
- package/src/nexus/api/sub-seat-charters.ts +34 -0
- package/src/nexus/api/tabs-mutations.ts +3 -1
- package/src/nexus/api/task-cards-api.ts +19 -0
- package/src/nexus/api/trace.ts +18 -6
- package/src/nexus/api/workflow-history.ts +88 -0
- package/src/nexus/api/workflow-run-event-bridge.ts +1 -0
- package/src/nexus/api/workflows.ts +132 -6
- package/src/nexus/index.ts +2 -0
- package/src/nexus/kinds/webterm.ts +2 -1
- package/src/nexus/outbound/delivery-ledger.ts +17 -8
- package/src/nexus/outbound/router.ts +8 -3
- package/src/nexus/webterm/pty.ts +6 -2
- package/src/onboarding/cli-auth-status.ts +80 -0
- package/src/onboarding/voice-ai.ts +3 -3
- package/src/org/seat-budget.ts +48 -0
- package/src/org/stall-escalation.ts +63 -0
- package/src/outputs/ledger.ts +120 -0
- package/src/persona/persona-todo.ts +79 -0
- package/src/persona/presets.ts +123 -2
- package/src/persona/team-set.ts +155 -0
- package/src/plugins/install/plugin-install.ts +14 -0
- package/src/plugins/maker/market-bundle.ts +110 -0
- package/src/plugins/maker/plugin-maker.ts +254 -11
- package/src/plugins/maker/wizard-generate.ts +103 -0
- package/src/pod-lease/admission.ts +150 -0
- package/src/pod-lease/dependency-state.ts +85 -0
- package/src/pod-lease/host-lease.ts +127 -0
- package/src/project/project-suggestion.ts +16 -0
- package/src/project/session-context.ts +24 -0
- package/src/release-loop/checklist.ts +17 -5
- package/src/release-loop/feature-store.ts +29 -13
- package/src/release-loop/landed-but-yellow.ts +48 -0
- package/src/release-loop/next-md-merge.ts +58 -0
- package/src/release-loop/release-note.ts +59 -4
- package/src/seat-dispatch/seat-ask.ts +130 -0
- package/src/seat-dispatch/seat-questions.ts +100 -0
- package/src/seat-loop/seat-loop.ts +709 -29
- package/src/seat-loop/seat-report.ts +37 -2
- package/src/self-dev/dev-cli.ts +4 -1
- package/src/self-dev/dev-pipeline.ts +37 -1
- package/src/self-dev/draft-sweep.ts +79 -40
- package/src/self-dev/draft-triage-rules.ts +62 -7
- package/src/self-dev/fabric-plan-core.ts +297 -0
- package/src/self-dev/orchestrate.ts +36 -4
- package/src/self-dev/release-path-guard.ts +62 -0
- package/src/self-dev/shard-aggregate.ts +230 -0
- package/src/self-dev/shard-placement.ts +60 -0
- package/src/self-dev/shard-plan.ts +48 -0
- package/src/self-dev/shard-pod-run.ts +77 -0
- package/src/self-dev/shard-run.ts +105 -0
- package/src/self-implement/budget-gate.ts +29 -12
- package/src/self-implement/gate-baseline.ts +1 -1
- package/src/self-implement/gate-candidate-ranking.ts +60 -0
- package/src/self-implement/gate-cli.ts +40 -1
- package/src/self-implement/gate-scope.ts +44 -13
- package/src/self-implement/graph-variant.ts +171 -0
- package/src/self-implement/harness-policy-gates.ts +1 -1
- package/src/self-implement/headless-elanous-driver.ts +27 -3
- package/src/self-implement/host-regate.ts +22 -1
- package/src/self-implement/importer-test-index.ts +2 -1
- package/src/self-implement/l8-merge-queue.ts +130 -0
- package/src/self-implement/orchestrator.ts +257 -9
- package/src/self-implement/route-consumer-test-index.ts +122 -0
- package/src/self-implement/seams.ts +72 -11
- package/src/self-implement/test-seams.ts +2 -0
- package/src/self-implement/uncommitted-work.ts +59 -0
- package/src/session/index.ts +36 -13
- package/src/skills/gift-install.ts +215 -0
- package/src/skills/tools/web-search.ts +4 -1
- package/src/steward/launch.ts +42 -26
- package/src/steward/steward-cards.ts +17 -9
- package/src/steward/triage.ts +46 -14
- package/src/task-cards/card-cli.ts +25 -1
- package/src/task-orchestrator/mission.ts +5 -0
- package/src/task-orchestrator/store.ts +12 -3
- package/src/task-orchestrator/surfaces/pod-command-job.ts +43 -17
- package/src/task-orchestrator/surfaces/pod-lease.ts +156 -19
- package/src/task-orchestrator/surfaces/pod-pool.ts +127 -26
- package/src/task-orchestrator/surfaces/self-implement-pod.ts +222 -40
- package/src/task-orchestrator/surfaces/self-implement.ts +15 -2
- package/src/task-orchestrator/types.ts +2 -0
- package/src/telegram-card-followup.ts +16 -96
- package/src/telegram-commands.ts +31 -1
- package/src/telegram-project-command.ts +145 -0
- package/src/telegram-report.ts +21 -17
- package/src/telegram.ts +61 -8
- package/src/tool-runtime/self-cognition-runtimes.ts +13 -3
- package/src/user-config.ts +110 -24
- package/src/version/packed-revision.json +1 -1
- package/src/web-search/grok.ts +7 -1
- package/src/web-search/index.ts +28 -1
- package/src/web-search/provider.ts +4 -0
- package/src/web-search/x-intent.ts +5 -0
- package/src/workflow-runtime/executor.ts +277 -47
- package/src/workflow-runtime/index.ts +1 -0
- package/src/workflow-runtime/nodes/subworkflow.ts +60 -0
- package/src/workflow-runtime/plugin-kind-node.ts +1 -1
- package/src/workflow-runtime/schema.ts +79 -4
- package/src/workflow-runtime/types.ts +35 -4
- package/apps/pwa/out/_next/static/2DsiDfDCks44g1cPUMhiW/_buildManifest.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1105-c473ed46272fba79.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1377-1efeffbbac0963ff.js +0 -1
- package/apps/pwa/out/_next/static/chunks/1470.98a6ab61ccb4131c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/216-5acd01cbde4acda7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2330-c2f07246c8788af1.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2375-cb6debea56cce4fb.js +0 -1
- package/apps/pwa/out/_next/static/chunks/24-e6d28380efab7faf.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2977-e38442e86289f1d3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/2982-2a2df543be3d2e5a.js +0 -25
- package/apps/pwa/out/_next/static/chunks/3403.4bc97b4066945a94.js +0 -5
- package/apps/pwa/out/_next/static/chunks/3615-740dd270764ffa24.js +0 -1
- package/apps/pwa/out/_next/static/chunks/371-4ad6af55dad02ced.js +0 -1
- package/apps/pwa/out/_next/static/chunks/3734-1015fe991eb9b7e7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/4114-3e63117452378807.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5012-a7fe6f3c8b6fe45a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5609-012bb3557211f07e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5783-ef40ebfc91d55230.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5791-bb82743fa6299562.js +0 -1
- package/apps/pwa/out/_next/static/chunks/62-ff227c3edb8b248b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6320-baac91d68843a9a6.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6725-68ab7cc0b1faf00d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/6998-a654fe5c58271600.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7633-1b3709b0854c9412.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7647.2fcd30d894d5ee30.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7673-2eda1507d38dadb8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7951-8b03dbb10b24cd06.js +0 -1
- package/apps/pwa/out/_next/static/chunks/7990-e12efba616f46e03.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8142-744998d65d7bb17e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8195-6fde3d7a39859206.js +0 -10
- package/apps/pwa/out/_next/static/chunks/8619-4365e03a2862830f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/8894-b5fb36bab837cd29.js +0 -1
- package/apps/pwa/out/_next/static/chunks/920-f7dceb78f1c585ef.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9454-84d0d5d77446bd92.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9651-3cd291a6fa1370d2.js +0 -1
- package/apps/pwa/out/_next/static/chunks/988-5f92e7ab7ccea3dd.js +0 -1
- package/apps/pwa/out/_next/static/chunks/9989-5582582f06429840.js +0 -1
- package/apps/pwa/out/_next/static/chunks/ae787e4c-f2998de7f1ba72a4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/_not-found/page-859cea1570b6227a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/approvals/page-d2253d7e58ef1890.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/page-5441d4a9ab35e518.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-d9b12d680922d980.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/bots/page-e268d6d145827a22.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/chat/page-f8116559c7424da7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/consult/page-1085399fd0f32112.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-1df686a14f65895a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-54e1f966ab60a4dc.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/editor/page-7ed95f296f5ee8e9.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/exec/page-11edac668d77e5c3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/field/page-59e2b9a22cd5a6d5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/healthz/route-859cea1570b6227a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/intake/page-2976df21ad74ab48.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/layout-34d211a67f16d510.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-8ff652d5d950639b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/market/page-b31610deda76337b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-6cb0e1bbefe5fb3d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/morning/page-a286a152cf584576.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-d9237581e7003bcb.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-83274e761643fdd2.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/page-ceee6cfb1d4e6d68.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-9c9f8bb3e4a64091.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-c17217603ea3426a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/page-efb6177cbf1e8a51.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/reflection/page-d307523703bc4df3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/page-462f4e4bab45ce7d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/page-8990e96f33af3837.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-e168fa1030af0548.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/page-1233e05a4068bc9c.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/page-13a1840b1fac337a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/layout-859cea1570b6227a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/page-64a29fc80b11ab55.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/share/page-68e787339a16b3dc.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-4fddc90b23feb215.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-886ba8260dc79c79.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/term/page-0f26507a1722e40b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-109d4ccd42259c9d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/trace/page-f5c2a4e510726774.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/page-b2e0039416f42522.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-26102fd7350f171e.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-708948bc8a802794.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workspace/page-5e5611620f78fb0b.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/page-139ba5c367bbf60a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/framework-ea806bb57f2b8923.js +0 -1
- package/apps/pwa/out/_next/static/chunks/main-8d2302399c2c8f87.js +0 -1
- package/apps/pwa/out/_next/static/chunks/main-app-202b4e81f33895ea.js +0 -1
- package/apps/pwa/out/_next/static/chunks/pages/_app-b10928c60f0b8488.js +0 -1
- package/apps/pwa/out/_next/static/chunks/pages/_error-689039227d443fab.js +0 -1
- package/apps/pwa/out/_next/static/chunks/webpack-e5bea36f183b25e6.js +0 -1
- package/apps/pwa/out/_next/static/css/43feca5fd387dcbd.css +0 -1
- /package/apps/pwa/out/_next/static/{2DsiDfDCks44g1cPUMhiW → -6XrAoD3eU7NyMHAE4xPS}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8894],{7329:(e,t,s)=>{s.d(t,{X:()=>i});var a=s(91269);let r=null,n=[],l=[];function i(e){let[t,s]=(0,a.useState)(()=>r&&Date.now()-r.at<3e5?r.providers:n),[i,d]=(0,a.useState)(()=>r&&Date.now()-r.at<3e5?r.models:l),[o,c]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),x=(0,a.useCallback)(async()=>{c(!0),m(null);try{let t=await e.getRegistryCatalog(),a=t.providers.map(e=>({id:e.id,displayName:e.displayName,aliases:e.aliases,modelPrefixes:e.modelPrefixes,apiKeyEnv:e.apiKeyEnv,endpointPattern:e.endpointPattern,capabilities:e.capabilities,builtIn:e.builtIn})),n=t.models.map(e=>({id:e.id,provider:e.provider,displayName:e.displayName,...void 0!==e.family?{family:e.family}:{},...void 0!==e.familyShortcut?{familyShortcut:e.familyShortcut}:{},...void 0!==e.contextSize?{contextSize:e.contextSize}:{},...void 0!==e.outputMaxTokens?{outputMaxTokens:e.outputMaxTokens}:{},...void 0!==e.vision?{vision:e.vision}:{},...void 0!==e.reasoning?{reasoning:e.reasoning}:{},...void 0!==e.toolCalling?{toolCalling:e.toolCalling}:{},...void 0!==e.pricing?{pricing:e.pricing}:{},...void 0!==e.deprecated?{deprecated:e.deprecated}:{},...void 0!==e.releaseDate?{releaseDate:e.releaseDate}:{},...void 0!==e.kind?{kind:e.kind}:{}}));r={at:Date.now(),providers:a,models:n},s(a),d(n)}catch(e){m(e instanceof Error?e.message:String(e))}finally{c(!1)}},[e]);(0,a.useEffect)(()=>{if(r&&Date.now()-r.at<3e5){s(r.providers),d(r.models);return}x()},[x]);let h=(0,a.useCallback)(async()=>{r=null,await x()},[x]),p=(0,a.useMemo)(()=>t.map(e=>e.id),[t]),b=(0,a.useMemo)(()=>{let e=new Map;for(let t of i){let s=e.get(t.provider);s?s.push(t):e.set(t.provider,[t])}return t=>{var s;return t?null!=(s=e.get(t))?s:[]:i}},[i]);return{providers:t,providerIds:p,models:i,modelsByProvider:b,loading:o,error:u,reload:h}}},11635:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(89117).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},19286:(e,t,s)=>{s.d(t,{Q:()=>c});var a=s(41121),r=s(91269),n=s(72030),l=s(59062),i=s(91514),d=s(42375);function o(e){if(e instanceof d.Iu&&e.body&&"object"==typeof e.body){var t;let s=e.body;return[null!=(t=s.reason)?t:s.error,s.path].filter(Boolean).join(": ")}return e instanceof Error?e.message:String(e)}function c(){let e=(0,i.Qj)(),[t,s]=(0,r.useState)(!1),[d,c]=(0,r.useState)(null),[u,m]=(0,r.useState)({vault:"",selection:"custom",dirs:""}),{vault:x,selection:h,dirs:p}=u,[b,f]=(0,r.useState)(!0),[g,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(""),[N,k]=(0,r.useState)(""),[w,S]=(0,r.useState)("");(0,r.useEffect)(()=>{s(!0)},[]);let C=(0,r.useCallback)(async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";if(e){f(!0);try{let s=await e.getObsidianSkills();c(s),m(e=>({vault:"skills"===t?e.vault:s.obsidian.vault,selection:"vault"===t?e.selection:s.skills.activeSet,dirs:"vault"===t?e.dirs:s.skills.dirs.join("\n")})),y("")}catch(e){y(o(e))}finally{f(!1)}}},[e]);(0,r.useEffect)(()=>{t&&e&&C()},[t,e,C]);let U=async()=>{if(e){j(!0),k("");try{var t;let s=await e.setObsidian({vault:x.trim()});await C("vault"),k(null!=(t=s.warning)?t:"Vault saved.")}catch(e){k(o(e))}finally{j(!1)}}},E=async()=>{if(e){j(!0),S("");try{await e.setSkills("custom"===h?{dirs:p.split("\n").map(e=>e.trim()).filter(Boolean)}:{activeSet:h}),await C("skills"),S("Skills saved.")}catch(e){S(o(e))}finally{j(!1)}}};return t&&e?(0,a.jsxs)("section",{className:"space-y-4 rounded border border-border bg-card p-4","data-testid":"obsidian-skills-card",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Obsidian & Skills"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Choose directories on the machine running NEXUS."})]}),(0,a.jsx)(n.$,{size:"sm",variant:"outline",onClick:()=>void C("all"),disabled:b||g,children:"Refresh"})]}),b&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading paths…"}),v&&(0,a.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:v}),d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{htmlFor:"obsidian-vault",className:"text-sm font-medium",children:"Obsidian vault path"}),(0,a.jsx)(l.p,{id:"obsidian-vault",value:x,onChange:e=>{m(t=>({...t,vault:e.target.value})),k("")},placeholder:"/absolute/path/to/vault"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"vault-validation",children:x===d.obsidian.vault?d.obsidian.looksLikeVault?"Vault found (.obsidian detected)":d.obsidian.exists?"Directory found; .obsidian not detected":"Directory not found":"Save to validate this path on the NEXUS host."}),(0,a.jsx)(n.$,{size:"sm",onClick:()=>void U(),disabled:g||!x.trim(),children:"Save vault"}),N&&(0,a.jsx)("p",{role:"status",className:"text-xs","data-testid":"vault-feedback",children:N})]}),(0,a.jsxs)("div",{className:"space-y-2 border-t border-border pt-3",children:[(0,a.jsx)("label",{htmlFor:"skills-preset",className:"text-sm font-medium",children:"Skills source"}),(0,a.jsxs)("select",{id:"skills-preset",value:h,onChange:e=>{m(t=>({...t,selection:e.target.value})),S("")},className:"flex h-9 w-full rounded-md border border-input bg-background px-3 text-sm",children:[d.skills.presets.map(e=>{var t;return(0,a.jsxs)("option",{value:e.key,children:[e.label," — ",null!=(t=e.dir)?t:"(no path)"," ",e.exists?"✓":"(missing)"]},e.key)}),(0,a.jsx)("option",{value:"custom",children:"Custom directories"})]}),"custom"===h&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("label",{htmlFor:"skills-dirs",className:"block text-xs text-muted-foreground",children:"One absolute directory per line"}),(0,a.jsx)("textarea",{id:"skills-dirs",value:p,onChange:e=>{m(t=>({...t,dirs:e.target.value})),S("")},rows:3,className:"w-full rounded-md border border-input bg-background px-3 py-2 font-mono text-xs",placeholder:"/absolute/path/to/skills"})]}),(0,a.jsx)(n.$,{size:"sm",onClick:()=>void E(),disabled:g,children:"Save skills"}),w&&(0,a.jsx)("p",{role:"status",className:"text-xs","data-testid":"skills-feedback",children:w})]})]})]}):null}},28725:(e,t,s)=>{s.d(t,{MQ:()=>n,OY:()=>a,fG:()=>r});let a="elanous:nav-prefs";function r(e){try{return"1"===window.localStorage.getItem(e)}catch(e){return!1}}function n(e,t){try{t?window.localStorage.setItem(e,"1"):window.localStorage.removeItem(e)}catch(e){}try{window.dispatchEvent(new Event(a))}catch(e){}}},38894:(e,t,s)=>{s.d(t,{O:()=>e3});var a=s(41121),r=s(91269),n=s(38519),l=s(94936),i=s(72030),d=s(59062),o=s(66062);let c="pushcut-webhook",u="pushcut";async function m(e,t){return e.fetchJson("/v1/config/secrets",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c,value:t})})}async function x(e){return e.fetchJson("/v1/registry/bindings?channel=".concat(u))}async function h(e,t){var s;let a=null!=(s=t.method)?s:"POST",r={};return void 0!==t.sessionId&&(r.sessionId=t.sessionId),void 0!==t.label&&(r.label=t.label),void 0!==t.meta&&(r.meta=t.meta),void 0!==t.mergeMeta&&(r.mergeMeta=t.mergeMeta),e.fetchJson("/v1/registry/bindings/".concat(u,"/").concat(encodeURIComponent(t.token)),{method:a,headers:{"content-type":"application/json"},body:JSON.stringify(r)})}async function p(e,t){return e.fetchJson("/v1/registry/bindings/".concat(u,"/").concat(encodeURIComponent(t)),{method:"DELETE"})}var b=s(51215);let f="elanous.pwa.pushSubscriptionId",g="elanous.pwa.pushSubscriptionLabel";function j(){let e="Notification"in window&&"serviceWorker"in navigator&&"PushManager"in window,t=null,s=null;try{t=window.localStorage.getItem(f),s=window.localStorage.getItem(g)}catch(e){}return{supported:e,permission:e?Notification.permission:"unknown",cachedId:t,cachedLabel:s}}async function v(e){var t,s;let a,r;if(!("Notification"in window)||!("serviceWorker"in navigator)||!("PushManager"in window))return{status:"unsupported",reason:"Notification/PushManager API absent"};if(!e.baseUrl)return{status:"error",reason:"daemon baseUrl not configured"};if("granted"!==await Notification.requestPermission())return(0,b.cY)("pwa.push.permission-denied"),{status:"permission-denied"};let n=e.baseUrl.replace(/\/$/,"");try{let e=await fetch("".concat(n,"/v1/push/vapid-public-key"));if(!e.ok)throw Error("HTTP ".concat(e.status));let t=await e.json();if(!t.publicKey)throw Error("missing publicKey in response");a=t.publicKey}catch(e){return{status:"error",reason:"vapid fetch: ".concat(e instanceof Error?e.message:String(e))}}let l=await navigator.serviceWorker.ready;try{r=await l.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let t="=".repeat((4-e.length%4)%4),s=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),a=new Uint8Array(s.length);for(let e=0;e<s.length;e+=1)a[e]=s.charCodeAt(e);return a}(a)})}catch(e){return{status:"error",reason:"subscribe: ".concat(e instanceof Error?e.message:String(e))}}let i=r.toJSON(),d=null!=(s=e.label)?s:"".concat(null!=(t=navigator.userAgent.split(" ")[0])?t:"browser"," ").concat(new Date().toISOString().slice(0,10));try{let t=await fetch("".concat(n,"/v1/push/subscribe"),{method:"POST",headers:{"content-type":"application/json",...e.token?{authorization:"Bearer ".concat(e.token)}:{}},body:JSON.stringify({subscription:i,label:d})});if(!t.ok){let e=await t.text();try{await r.unsubscribe()}catch(e){}return{status:"error",reason:"subscribe POST: ".concat(t.status," ").concat(e.slice(0,200))}}let s=await t.json();if(!s.id){try{await r.unsubscribe()}catch(e){}return{status:"error",reason:"daemon did not return subscription id"}}try{window.localStorage.setItem(f,s.id),window.localStorage.setItem(g,d)}catch(e){}return(0,b.cY)("pwa.push.enabled",{id:s.id,label:d}),{status:"enabled",id:s.id}}catch(e){try{await r.unsubscribe()}catch(e){}return{status:"error",reason:e instanceof Error?e.message:String(e)}}}async function y(e){let t=null;try{t=window.localStorage.getItem(f)}catch(e){}if(!t)return{status:"not-subscribed"};try{if("serviceWorker"in navigator){let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();t&&await t.unsubscribe()}}catch(e){}if(e.baseUrl)try{await fetch("".concat(e.baseUrl.replace(/\/$/,""),"/v1/push/subscribe/").concat(encodeURIComponent(t)),{method:"DELETE",...e.token?{headers:{authorization:"Bearer ".concat(e.token)}}:{}})}catch(e){(0,b.cY)("pwa.push.disable.daemon-failed",{reason:e instanceof Error?e.message:String(e)})}try{window.localStorage.removeItem(f),window.localStorage.removeItem(g)}catch(e){}return{status:"disabled"}}var N=s(91514);let k=[{value:"none",label:"none — auto-detect / Quick Setup 안내"},{value:"codex",label:"codex — OpenAI Codex (OAuth or OPENAI_API_KEY)"},{value:"claude-code",label:"claude-code — Anthropic (claude-code CLI 인증)"},{value:"gemini",label:"gemini — Google (GEMINI_API_KEY)"}];function w(){let e=(0,N.Qj)(),[t,s]=(0,r.useState)({status:"idle"}),[n,l]=(0,r.useState)({status:"idle"}),[d,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{o(!0)},[]);let c=(0,r.useCallback)(async()=>{if(e){s({status:"loading"});try{let t=await e.getChatBackendDetection();s({status:"ok",snapshot:t})}catch(e){s({status:"error",error:e.message})}}},[e]),u=(0,r.useCallback)(async t=>{if(e){l({status:"mutating",target:t});try{await e.putSwitch("global.chat.defaultBackend",{value:t}),await c(),l({status:"idle"})}catch(e){l({status:"error",error:e.message})}}},[e,c]);return((0,r.useEffect)(()=>{c()},[c]),d&&e)?(0,a.jsxs)("section",{"data-testid":"quick-setup-card",className:"rounded border border-border bg-card p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2 flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"Quick Setup — chat 백엔드"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"chat 탭이 사용할 LLM 백엔드 1개만 셋업하면 됩니다. 데스크탑 NEXUS TUI Settings 탭과 같은 안내."})]}),(0,a.jsx)(i.$,{"data-testid":"quick-setup-refresh",variant:"outline",size:"sm",disabled:"loading"===t.status,onClick:()=>void c(),"aria-label":"detection 재실행",title:"env / OAuth 재감지 (TUI 의 r 키 mirror)",children:"loading"===t.status?"…":"Refresh"})]}),"idle"===t.status&&(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"대기 중…"}),"loading"===t.status&&(0,a.jsx)("p",{"data-testid":"quick-setup-loading",className:"text-xs text-muted-foreground",children:"detection 진행 중…"}),"error"===t.status&&(0,a.jsx)("p",{"data-testid":"quick-setup-error",className:"text-xs text-destructive",children:t.error}),"ok"===t.status&&(0,a.jsx)(S,{snapshot:t.snapshot,swap:n,onSwap:u})]}):null}function S(e){let{snapshot:t,swap:s,onSwap:r}=e,n="none"!==t.detection.backend;return(0,a.jsxs)("div",{className:"space-y-3 text-xs",children:[(0,a.jsx)("div",{"data-testid":"quick-setup-status",children:n?(0,a.jsxs)("span",{children:["현재 wired \xb7"," ",(0,a.jsx)("code",{className:"rounded bg-muted px-1 font-mono",children:t.detection.backend})," ",(0,a.jsxs)("span",{className:"text-muted-foreground",children:["(",t.detection.source,")"]})]}):(0,a.jsx)("span",{className:"text-muted-foreground",children:"현재 wired \xb7 (없음 — 아래 3 provider 중 1개 셋업)"})}),(0,a.jsx)("ul",{className:"space-y-2","data-testid":"quick-setup-entries",children:t.entries.map(e=>(0,a.jsx)(C,{entry:e,wired:t.detection.backend===e.provider},e.provider))}),(0,a.jsxs)("div",{className:"space-y-1 border-t border-border/40 pt-2",children:[(0,a.jsx)("label",{className:"block text-[11px] text-muted-foreground",htmlFor:"quick-setup-swap",children:"Backend swap (`global.chat.defaultBackend` 변경)"}),(0,a.jsx)("select",{id:"quick-setup-swap","data-testid":"quick-setup-swap",value:t.detection.backend,disabled:"mutating"===s.status,onChange:e=>r(e.target.value),className:"flex h-8 w-full rounded-md border border-input bg-background px-2 py-1 text-xs shadow-xs focus:outline-none focus:ring-2 focus:ring-ring",children:k.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"mutating"===s.status&&(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["적용 중 (target: ",(0,a.jsx)("code",{children:s.target}),")…"]}),"error"===s.status&&(0,a.jsxs)("p",{"data-testid":"quick-setup-swap-error",className:"text-[11px] text-destructive",children:["swap 실패 \xb7 ",s.error]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"새 chat 탭부터 적용 \xb7 기존 chat 인스턴스는 per-tab override 또는 재시작 시 반영. 변경은 즉시 NEXUS daemon 의 UserConfig 에 저장."})]}),(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["Grok \xb7 중국 4종 (kimi/qwen/glm/deepseek) 등은 NEXUS chat 우선순위 외 — daemon 탭 또는 ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"elanous legacy"})," ","에서 사용."]})]})}function C(e){let{entry:t,wired:s}=e;return(0,a.jsxs)("li",{"data-testid":"quick-setup-provider-".concat(t.provider),"data-wired":s?"true":"false",className:"rounded border border-border/60 bg-background p-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 font-medium",children:[(0,a.jsx)("span",{"aria-hidden":"true",children:s?"▶":" "}),(0,a.jsx)("span",{children:t.label})]}),(0,a.jsx)("ul",{className:"mt-1 space-y-1",children:t.paths.map(e=>(0,a.jsxs)("li",{"data-testid":"quick-setup-path-".concat(t.provider,"-").concat(e.tag),"data-detected":e.detected?"true":"false",className:"flex gap-2",children:[(0,a.jsx)("span",{"aria-label":e.detected?"detected":"missing",children:e.detected?"✓":"◯"}),(0,a.jsx)("span",{className:"font-mono text-[11px] text-muted-foreground",children:e.tag}),(0,a.jsx)("span",{className:"text-[11px]",children:e.hint})]},e.tag))})]})}var U=s(19286),E=s(83023),M=s(7632);let P="global.nexus.firstBootGuideShown";function A(){let e=(0,N.Qj)(),[t,s]=(0,r.useState)({status:"idle"}),[n,l]=(0,r.useState)(!1),[d,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{o(!0)},[]);let c=(0,r.useCallback)(async()=>{if(e){s({status:"loading"});try{let t=await e.getSwitch(P),a=!0===t.switch.value;s({status:a?"hidden":"shown"})}catch(e){s({status:"error",error:e.message})}}},[e]),u=(0,r.useCallback)(async()=>{if(e){l(!0);try{await e.putSwitch(P,{value:!0}),s({status:"hidden"})}catch(e){s({status:"error",error:e.message})}finally{l(!1)}}},[e]);return((0,r.useEffect)(()=>{c()},[c]),d&&e&&"shown"===t.status)?(0,a.jsxs)("section",{"data-testid":"welcome-card",className:"rounded border border-primary/30 bg-primary/5 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2 flex items-start justify-between gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"✦ Welcome to elanous NEXUS"}),(0,a.jsx)(i.$,{"data-testid":"welcome-card-dismiss",variant:"ghost",size:"sm",disabled:n,onClick:()=>void u(),"aria-label":"환영 카드 닫기",children:n?"…":"Got it"})]}),(0,a.jsxs)("div",{className:"space-y-2 text-xs text-muted-foreground",children:[(0,a.jsx)("p",{children:"모바일 / iOS / 원격에서도 같은 NEXUS 에 접속 — 데스크탑 TUI 와 이 PWA 는 같은 daemon 의 두 surface (UserConfig SSoT 공유)."}),(0,a.jsxs)("p",{children:["Chat 백엔드를 셋업하지 않았다면 위의 ",(0,a.jsx)("strong",{children:"Quick Setup"})," ","카드에서 1개만 선택하면 됩니다."]}),(0,a.jsxs)("p",{children:["Telegram \xb7 Discord allowlist \xb7 자동 부팅 (launchd / systemd) 등"," ",(0,a.jsx)("em",{children:"advanced 셋업"}),"은 데스크탑에서"," ",(0,a.jsx)("span",{className:"font-mono",children:"elanous legacy"})," →"," ",(0,a.jsx)("span",{className:"font-mono",children:"/setup"})," wizard 에서 셋업 (NEXUS 미mirror 영역)."]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-mono",children:"[Got it]"})," ","한 번 누르면 다음부터 안 보입니다 (TUI 와 동기화)."]})]})]}):null}let z=[{area:"Chat 백엔드",status:"✓ NEXUS native",location:"PWA Quick Setup card"},{area:"Telegram bot token",status:"✓ NEXUS native",location:"PWA Secret modal"},{area:"Discord bot token",status:"✓ NEXUS native",location:"PWA Secret modal"},{area:"Telegram allowlist",status:"◯ Wizard 전용",location:"desktop",cmd:"elanous legacy → /setup"},{area:"Discord guild \xb7 voice",status:"◯ Wizard 전용",location:"desktop",cmd:"elanous legacy → /setup"},{area:"OS 자동 부팅",status:"◯ NEXUS subcommand",location:"desktop",cmd:"elanous nexus install --launchd"}];function I(){return(0,a.jsxs)("section",{"data-testid":"advanced-setup-map",className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Advanced setup map"}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs",children:[(0,a.jsx)("p",{className:"mb-2 text-muted-foreground",children:"NEXUS native 셋업 영역은 PWA 에서 직접 \xb7 그 외 advanced 셋업은 desktop wizard 또는 NEXUS subcommand 에서."}),(0,a.jsxs)("table",{className:"w-full text-left text-[11px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-border text-muted-foreground",children:[(0,a.jsx)("th",{className:"py-1 pr-2 font-medium",children:"영역"}),(0,a.jsx)("th",{className:"py-1 pr-2 font-medium",children:"상태"}),(0,a.jsx)("th",{className:"py-1 font-medium",children:"셋업 위치"})]})}),(0,a.jsx)("tbody",{children:z.map(e=>(0,a.jsxs)("tr",{"data-testid":"advanced-setup-row-".concat(e.area),className:"border-b border-border/50 last:border-0",children:[(0,a.jsx)("td",{className:"py-1.5 pr-2 font-medium",children:e.area}),(0,a.jsx)("td",{className:"py-1.5 pr-2 font-mono text-[10px]",children:e.status}),(0,a.jsxs)("td",{className:"py-1.5 text-muted-foreground",children:[e.location,e.cmd&&(0,a.jsxs)(a.Fragment,{children:[" \xb7 ",(0,a.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[10px]",children:e.cmd})]})]})]},e.area))})]})]})]})}function T(){let e=(0,N.Qj)(),[t,s]=(0,r.useState)({status:"idle"}),[n,l]=(0,r.useState)(!1),[d,o]=(0,r.useState)(!1);(0,r.useEffect)(()=>{o(!0)},[]);let c=(0,r.useCallback)(async()=>{if(e){s({status:"minting"}),l(!1);try{let t=await e.mintConnectToken();s({status:"shown",token:t.token,hint:t.hint})}catch(e){s({status:"error",error:e.message})}}},[e]),u=(0,r.useCallback)(async()=>{if("shown"===t.status)try{await navigator.clipboard.writeText(t.token),l(!0),setTimeout(()=>l(!1),2e3)}catch(e){s({status:"error",error:"clipboard: ".concat(e.message)})}},[t]);return d&&e?(0,a.jsxs)("section",{"data-testid":"connect-token-card",className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"연결 토큰 만들기 (다른 기기용)"}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs space-y-2",children:[(0,a.jsxs)("p",{className:"text-muted-foreground",children:["다른 머신에서 ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"elanous nexus connect <host>"})," 시 paste 할 bearer token 을 발급. 한 번 paste 하면 그 머신의 bookmark 에 영구 저장 — 매번 재발급할 필요 없음."]}),"idle"===t.status&&(0,a.jsx)(i.$,{size:"sm",onClick:()=>void c(),"data-testid":"connect-token-generate",children:"Generate connect token"}),"minting"===t.status&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Minting…"}),"shown"===t.status&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("code",{className:"block break-all rounded bg-muted p-2 font-mono text-[11px] select-all","data-testid":"connect-token-value",children:t.token}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(i.$,{size:"sm",onClick:()=>void u(),"data-testid":"connect-token-copy",children:n?"✓ Copied":"Copy to clipboard"}),(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>s({status:"idle"}),"data-testid":"connect-token-hide",children:"Hide"})]}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground",children:t.hint})]}),"error"===t.status&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("p",{className:"text-rose-500",children:["발급 실패: ",t.error]}),(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>s({status:"idle"}),children:"Reset"})]})]})]}):null}var L=s(99608),R=s(67089),D=s(11635),$=s(89117);let O=(0,$.A)("circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var B=s(42012),Y=s(67842);function Q(){return(0,N.Qj)()?(0,a.jsx)(_,{}):null}function _(){var e;let{data:t,isLoading:s,error:r,refetch:n,isFetching:l}=function(){let e=(0,N.M1)();return(0,B.I)({queryKey:Y.AF.platforms(),queryFn:()=>e.getPlatforms(),refetchInterval:3e4})}(),i=null!=(e=null==t?void 0:t.platforms)?e:[],d=i.filter(e=>"connected"===e.status).length;return(0,a.jsxs)("section",{className:"space-y-2","data-testid":"platform-connections-card",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Platform connections"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsx)("span",{"data-testid":"platform-summary",children:t?"".concat(d," of ").concat(i.length," connected"):s?"loading…":""}),(0,a.jsx)("button",{type:"button",onClick:()=>n(),disabled:l,"aria-label":"Refresh platform connection status",className:"rounded p-1 hover:bg-surface-elevated disabled:opacity-50",children:(0,a.jsx)(L.A,{className:"h-3 w-3 ".concat(l?"animate-spin":"")})})]})]}),r&&(0,a.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-error",children:[(0,a.jsx)(R.A,{className:"h-3 w-3"}),r instanceof Error?r.message:"Failed to load platform list"]}),s&&!t&&(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Querying /v1/platforms…"}),t&&(0,a.jsx)("ul",{className:"space-y-1.5",role:"list",children:i.map(e=>(0,a.jsx)(W,{entry:e},e.id))})]})}function W(e){let{entry:t}=e,s="connected"===t.status;return(0,a.jsxs)("li",{"data-testid":"platform-row-".concat(t.id),"data-status":t.status,className:"flex items-start gap-3 rounded-md border border-border bg-surface px-3 py-2",children:[(0,a.jsx)("div",{className:"mt-0.5 flex-shrink-0",children:s?(0,a.jsx)(D.A,{className:"h-4 w-4 text-green-600","aria-label":"connected"}):(0,a.jsx)(O,{className:"h-4 w-4 text-muted-foreground","aria-label":"not configured"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,a.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,a.jsx)("span",{className:"text-[12px] font-medium",children:t.label}),(0,a.jsx)("span",{className:"rounded-full px-1.5 py-0.5 text-[9px] font-medium uppercase tracking-wider ".concat(s?"bg-green-600/10 text-green-700":"bg-muted text-muted-foreground"),children:s?"connected":"not configured"})]}),(0,a.jsx)("div",{className:"text-[11px] text-muted-foreground",children:t.detail}),!s&&t.hint&&(0,a.jsx)("div",{className:"text-[10px] italic text-muted-foreground/80",children:t.hint})]})]})}var F=s(76582);function V(){var e,t;let s=(0,N.Qj)(),[n,l]=(0,r.useState)({status:"idle"}),[d,o]=(0,r.useState)({status:"idle"}),[c,u]=(0,r.useState)(!1);(0,r.useEffect)(()=>{u(!0)},[]);let m=(0,r.useCallback)(async()=>{if(s){l({status:"loading"});try{var e,t,a;let r=await fetch("".concat(s.baseUrl,"/v1/hitl/audit/recent?channel=pushcut&limit=").concat(1),{credentials:"include"}),n=await r.json();if(!r.ok||!n.ok)return void l({status:"error",error:null!=(t=n.error)?t:"HTTP ".concat(r.status),fetchedAt:Date.now()});let i=null==(e=n.entries)?void 0:e[n.entries.length-1];l({status:"ok",count:null!=(a=n.count)?a:0,lastEntry:i,fetchedAt:Date.now()})}catch(e){l({status:"error",error:e.message,fetchedAt:Date.now()})}}},[s]),x=(0,r.useCallback)(async()=>{if(s){o({status:"sending"});try{var e,t;let a=await fetch("".concat(s.baseUrl,"/v1/hitl/test-pushcut"),{method:"POST",credentials:"include",headers:{"content-type":"application/json"},body:JSON.stringify({})}),r=await a.json();a.ok&&r.ok?(o({status:"ok",banner:"✓ sent → ".concat(null!=(e=r.notificationName)?e:"(unknown)")}),m()):o({status:"error",banner:"✗ ".concat(null!=(t=r.reason)?t:"HTTP ".concat(a.status)).concat(r.hint?" \xb7 ".concat(r.hint):"")})}catch(e){o({status:"error",banner:"✗ ".concat(e.message)})}}},[s,m]);if((0,r.useEffect)(()=>{m()},[m]),!c||!s)return null;let h=n.lastEntry,p=h?(t=Date.now()-h.ts)<0?"just now":t<6e4?"".concat(Math.floor(t/1e3),"s ago"):t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):"".concat(Math.floor(t/864e5),"d ago"):"(no Pushcut deliveries recorded yet)";return(0,a.jsxs)("section",{"data-testid":"pushcut-settings-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2 flex items-start justify-between gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83D\uDCF2 Pushcut HITL channel"}),(0,a.jsx)(i.$,{"data-testid":"pushcut-settings-refresh",variant:"ghost",size:"sm",onClick:()=>void m(),"aria-label":"Refresh Pushcut status",children:"↻"})]}),(0,a.jsxs)("dl",{className:"grid grid-cols-[max-content_1fr] gap-x-3 gap-y-1 text-xs",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Last delivery"}),(0,a.jsx)("dd",{"data-testid":"pushcut-last-delivery",className:"font-mono",children:"loading"===n.status?"…":p}),h?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Last answer"}),(0,a.jsxs)("dd",{className:"font-mono",children:[h.answer?"yes":"no"," \xb7 ",h.elapsedMs,"ms"]}),(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Last requestId"}),(0,a.jsx)("dd",{className:"font-mono break-all",children:h.requestId})]}):null,(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Total recorded"}),(0,a.jsx)("dd",{className:"font-mono",children:"ok"===n.status?null!=(e=n.count)?e:0:"—"})]}),"error"===n.status?(0,a.jsxs)("p",{className:"mt-2 text-xs text-destructive",children:["audit fetch failed: ",n.error]}):null,(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,a.jsx)(i.$,{"data-testid":"pushcut-test-button",variant:"outline",size:"sm",disabled:"sending"===d.status,onClick:()=>void x(),children:"sending"===d.status?"…":"Test notification"}),d.banner?(0,a.jsx)("span",{"data-testid":"pushcut-test-banner",className:"ok"===d.status?"text-xs text-emerald-600 font-mono":"text-xs text-destructive font-mono",children:d.banner}):null]}),(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-muted-foreground",children:["Audit log: ",(0,a.jsx)("span",{className:"font-mono",children:"$ELANOUS_DIR/hitl-log.jsonl"})," ","(rotates at 100 MB \xb7 cv-3 β-4)"]})]})}var K=s(82736);let H=[{value:"fixed",label:"고정 (Fixed)",blurb:"입력 바 위에 항상 표시. 키보드 위주 dogfood 에 좋음."},{value:"popup",label:"팝업 (Popup)",blurb:"턴이 끝날 때마다 잠깐 (~6초) 나타나고 자동 dismiss. 모바일 화면 절약."},{value:"off",label:"끔 (Off)",blurb:"완전 숨김. 입력만으로 진행하고 싶을 때."}];function q(){let[e,t]=(0,r.useState)("fixed"),[s,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>(n(!0),t((0,K.sY)()),(0,K.u9)(t)),[]),(0,a.jsxs)("section",{"data-testid":"intent-panel-settings",className:"rounded-lg border bg-card p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"space-y-1",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Intent Panel"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Showroom 의 intent 6-button 패널 표시 방식을 선택합니다."})]}),(0,a.jsx)("div",{role:"radiogroup","aria-label":"intent panel display mode",className:"mt-3 space-y-2",children:H.map(r=>{let n=s&&e===r.value;return(0,a.jsxs)("label",{"data-testid":"intent-panel-mode-".concat(r.value),className:"flex cursor-pointer items-start gap-3 rounded-md border border-border/60 p-3 hover:border-border","data-active":n?"true":"false",children:[(0,a.jsx)("input",{type:"radio",name:"intent-panel-display-mode",value:r.value,checked:n,onChange:()=>{var e;return e=r.value,void((0,K._n)(e),t(e))},className:"mt-0.5 h-4 w-4"}),(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:r.label}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:r.blurb})]})]},r.value)})})]})}var X=s(80777);function G(){let[e,t]=(0,r.useState)(X.kv),[s,n]=(0,r.useState)(!1);return(0,r.useEffect)(()=>(n(!0),t((0,X.Vm)()),(0,X.$L)(t)),[]),(0,a.jsxs)("section",{"data-testid":"chat-routing-settings",className:"rounded-lg border bg-card p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"space-y-1",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Chat input classification"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"입력 중 자동 분류를 켜거나 끕니다. 전송은 기존 ACP 경로를 유지합니다."})]}),(0,a.jsx)("div",{className:"mt-3 space-y-2",children:(0,a.jsxs)("label",{"data-testid":"chat-routing-auto",className:"flex cursor-pointer items-start gap-3 rounded-md border border-border/60 p-3 hover:border-border","data-active":s&&e.autoRouting?"true":"false",children:[(0,a.jsx)("input",{type:"checkbox",checked:s?e.autoRouting:X.kv.autoRouting,onChange:e=>{var s;return s=e.target.checked,void((0,X.Kz)(s),t(e=>({...e,autoRouting:s})))},className:"mt-0.5 h-4 w-4"}),(0,a.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:"Automatic routing"}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"입력 중 mission router 가 plan / build / review / research / quick / vision 으로 자동 분류합니다. OFF (default) 시 분류 요청을 보내지 않습니다."})]})]})})]})}function J(){var e,t,s,l;let{connection:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=(0,r.useContext)(n.C),o=null!=(t=null!=(e=null==i?void 0:i.baseUrl)?e:null==d?void 0:d.config.baseUrl)?t:"",c=null!=(l=null!=(s=null==i?void 0:i.token)?s:null==d?void 0:d.config.token)?l:"",[u,m]=(0,r.useState)(null),[x,h]=(0,r.useState)(!1),[p,b]=(0,r.useState)("");(0,r.useEffect)(()=>{if(m(null),b(""),!o)return;let e=new AbortController;return(async()=>{try{let t=await fetch("".concat(o.replace(/\/$/,""),"/v1/config/chat-fast-path"),{signal:e.signal,credentials:"same-origin",...c?{headers:{authorization:"Bearer ".concat(c)}}:{}});if(!t.ok)throw Error("HTTP ".concat(t.status));let s=await t.json();e.signal.aborted||m(s.enabled)}catch(t){e.signal.aborted||b(t instanceof Error?t.message:String(t))}})(),()=>e.abort()},[o,c]);let f=async e=>{h(!0),b("");try{let t=await fetch("".concat(o.replace(/\/$/,""),"/v1/config/chat-fast-path"),{method:"PUT",credentials:"same-origin",headers:{"content-type":"application/json",...c?{authorization:"Bearer ".concat(c)}:{}},body:JSON.stringify({enabled:e})});if(!t.ok)throw Error("HTTP ".concat(t.status));let s=await t.json();m(s.enabled)}catch(e){b(e instanceof Error?e.message:String(e))}finally{h(!1)}};return(0,a.jsxs)("section",{className:"space-y-3 rounded-lg border border-border bg-card p-4","data-testid":"fast-reply-card",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"짧은 물음은 빠르게"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:'인사\xb7짧은 물음은 도구 없이 먼저 답합니다 — 확인이 필요하면 "확인해 볼까요?"'}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("input",{type:"checkbox",checked:null!=u&&u,disabled:null===u||x,onChange:e=>{f(e.target.checked)},"aria-label":"빠른 답변 켜기/끄기"}),null===u?"불러오는 중":u?"켜짐":"꺼짐"]}),p&&(0,a.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:p})]})}function Z(e){let t=Object.entries(e);return 0===t.length?"—":t.map(e=>{let[t,s]=e;return"".concat(t,":").concat(s)}).join(" \xb7 ")}function ee(){let{config:e}=(0,n.Q)(),[t,s]=(0,r.useState)({ocr:{total:0,failures:0,byProvider:{},byPolishMode:{}},save:{total:0,failures:0,byPolishMode:{}},client:{cancel:0,edit:0,discard:0},startedAt:"",ts:""}),[l,d]=(0,r.useState)(!1),[o,c]=(0,r.useState)(null),[u,m]=(0,r.useState)(!1),x=(0,r.useCallback)(async()=>{if(e.baseUrl){m(!0);try{let t=await fetch("".concat(e.baseUrl,"/v1/metrics/notes-from-image"),{...e.token?{headers:{authorization:"Bearer ".concat(e.token)}}:{}});if(!t.ok)return void c("HTTP ".concat(t.status));let a=await t.json();s(a.snapshot),d(a.wired),c(null),(0,b.cY)("notes-metrics.snapshot",{wired:a.wired,ocrTotal:a.snapshot.ocr.total,saveTotal:a.snapshot.save.total})}catch(e){c(String(e instanceof Error?e.message:e))}finally{m(!1)}}},[e.baseUrl,e.token]);(0,r.useEffect)(()=>{x();let e=setInterval(()=>{x()},1e4);return()=>clearInterval(e)},[x]);let h=t.ocr.total-t.ocr.failures,p=t.save.total-t.save.failures;return(0,a.jsxs)("section",{"data-testid":"notes-metrics-card",className:"rounded-lg border border-border bg-card p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-3 flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-heading text-sm font-medium",children:"카메라 노트 metric"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"카메라 → markdown 노트 파이프라인 사용량 (daemon 재시작 시 0 으로 리셋)."})]}),(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>void x(),disabled:u,"aria-label":"refresh notes metrics",children:(0,a.jsx)(L.A,{className:u?"h-3.5 w-3.5 animate-spin":"h-3.5 w-3.5"})})]}),!l&&(0,a.jsx)("p",{"data-testid":"notes-metrics-not-wired",className:"mb-3 rounded bg-muted/50 px-2 py-1 text-xs text-muted-foreground",children:"collector 미wire — runNexus 재기동 후 측정 시작."}),o&&(0,a.jsxs)("p",{"data-testid":"notes-metrics-error",className:"mb-3 text-xs text-destructive",children:["metric fetch 실패: ",o]}),(0,a.jsxs)("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs",children:[(0,a.jsx)("dt",{className:"text-muted-foreground",children:"OCR 총 / 성공 / 실패"}),(0,a.jsxs)("dd",{"data-testid":"notes-metrics-ocr",children:[t.ocr.total," / ",h," / ",t.ocr.failures]}),(0,a.jsx)("dt",{className:"text-muted-foreground",children:"OCR provider"}),(0,a.jsx)("dd",{"data-testid":"notes-metrics-ocr-providers",children:Z(t.ocr.byProvider)}),(0,a.jsx)("dt",{className:"text-muted-foreground",children:"OCR polishMode"}),(0,a.jsx)("dd",{"data-testid":"notes-metrics-ocr-polish",children:Z(t.ocr.byPolishMode)}),(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Save 총 / 성공 / 실패"}),(0,a.jsxs)("dd",{"data-testid":"notes-metrics-save",children:[t.save.total," / ",p," / ",t.save.failures]}),(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Save polishMode"}),(0,a.jsx)("dd",{"data-testid":"notes-metrics-save-polish",children:Z(t.save.byPolishMode)}),(0,a.jsx)("dt",{className:"text-muted-foreground",children:"Client cancel \xb7 edit \xb7 discard"}),(0,a.jsxs)("dd",{"data-testid":"notes-metrics-client",children:[t.client.cancel," \xb7 ",t.client.edit," \xb7 ",t.client.discard]})]}),t.startedAt&&l&&(0,a.jsxs)("p",{className:"mt-3 text-[10px] text-muted-foreground",children:["since ",t.startedAt]})]})}var et=s(95939);function es(){let[e,t]=(0,r.useState)(et.hn);(0,r.useEffect)(()=>{t((0,et.hn)())},[]);let s=e=>{t((0,et.qv)(e)),(0,b.cY)("settings.ocr-prefs.update",e)};return(0,a.jsxs)("section",{"data-testid":"ocr-prefs-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83D\uDCF7 OCR 기본 설정"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"사진 → 노트 모달의 초기 토글 상태. 매번 같은 옵션을 켜고 있다면 default 로 저장."})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-md border border-input bg-background px-3 py-2 text-xs",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{children:"LLM 비전 default"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"\xb7 더 정확하지만 느림 + 비쌈"})]}),(0,a.jsx)("input",{type:"checkbox","data-testid":"ocr-prefs-llm-vision",checked:e.defaultUseLlmVision,onChange:e=>s({defaultUseLlmVision:e.target.checked}),"aria-label":"LLM 비전 default"})]}),(0,a.jsxs)("label",{className:"flex items-center justify-between gap-3 rounded-md border border-input bg-background px-3 py-2 text-xs",children:[(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{children:"손글씨 default"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"\xb7 handwriting strength 자동 추가"})]}),(0,a.jsx)("input",{type:"checkbox","data-testid":"ocr-prefs-handwriting",checked:e.defaultPreferHandwriting,onChange:e=>s({defaultPreferHandwriting:e.target.checked}),"aria-label":"손글씨 default"})]})]}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{t((0,et.sg)()),(0,b.cY)("settings.ocr-prefs.reset")},className:"text-xs text-muted-foreground","data-testid":"ocr-prefs-reset",children:"기본값으로 리셋"})})]})}let ea=["lm-studio","vllm","ollama","anthropic-openai-wrap"],er={"lm-studio":"http://localhost:1234",vllm:"http://localhost:8000",ollama:"http://localhost:11434","anthropic-openai-wrap":"https://api.anthropic.com"};function en(){let{client:e,config:t}=(0,n.Q)(),[s,l]=(0,r.useState)({status:"idle"}),[c,u]=(0,r.useState)(0),[m,x]=(0,r.useState)(!1),[h,p]=(0,r.useState)(""),[b,f]=(0,r.useState)("anthropic-openai-wrap"),[g,j]=(0,r.useState)(er["anthropic-openai-wrap"]),[v,y]=(0,r.useState)(""),[N,k]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!t.baseUrl)return void l({status:"idle"});let s=!1;return l({status:"loading"}),(async()=>{try{let t=await e.getLlmHosts();s||l({status:"ok",data:t})}catch(e){s||l({status:"error",error:e instanceof Error?e.message:String(e)})}})(),()=>{s=!0}},[e,t.baseUrl,c]);let w=(0,r.useCallback)(()=>u(e=>e+1),[]),S=(0,r.useCallback)(e=>{f(e),j(er[e])},[]),C=(0,r.useCallback)(async()=>{let t=h.trim(),a=g.trim(),r=v.trim();if(!t||!a)return void o.oR.error("name + endpoint 필수");if("anthropic-openai-wrap"===b&&!r)return void o.oR.error("Anthropic 은 apiKey 필수");k(!0);try{var n,l;let i=[...(null!=(l=null==(n=s.data)?void 0:n.hosts)?l:[]).filter(e=>e.name!==t).map(e=>{let t={name:e.name,kind:e.kind,endpoint:e.endpoint};return e.apiKey&&"[redacted]"!==e.apiKey&&(t.apiKey=e.apiKey),t}),{name:t,kind:b,endpoint:a,...r?{apiKey:r}:{}}];await e.setLlmHosts(i),o.oR.success("host '".concat(t,"' 추가됨")),p(""),y(""),x(!1),w()}catch(e){o.oR.error("추가 실패: ".concat(e instanceof Error?e.message:String(e)))}finally{k(!1)}},[e,h,b,g,v,s.data,w]),U=(0,r.useCallback)(async t=>{k(!0);try{var a,r;let n=(null!=(r=null==(a=s.data)?void 0:a.hosts)?r:[]).filter(e=>e.name!==t).map(e=>{let t={name:e.name,kind:e.kind,endpoint:e.endpoint};return e.apiKey&&"[redacted]"!==e.apiKey&&(t.apiKey=e.apiKey),t});await e.setLlmHosts(n),o.oR.success("host '".concat(t,"' 제거됨")),w()}catch(e){o.oR.error("제거 실패: ".concat(e instanceof Error?e.message:String(e)))}finally{k(!1)}},[e,s.data,w]),E=(0,r.useCallback)(async()=>{k(!0);try{await e.clearLlmHosts(),o.oR.success("env / legacy 로 환원"),w()}catch(e){o.oR.error("reset 실패: ".concat(e instanceof Error?e.message:String(e)))}finally{k(!1)}},[e,w]);if(!t.baseUrl)return null;let M=s.data,P=(null==M?void 0:M.source)==="override"?"bg-fuchsia-100 text-fuchsia-700 dark:bg-fuchsia-900 dark:text-fuchsia-200":(null==M?void 0:M.source)==="env"?"bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-200":"bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-300";return(0,a.jsxs)("section",{className:"space-y-2","data-testid":"llm-hosts-card",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"LLM Hosts"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[M&&(0,a.jsx)("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium uppercase ".concat(P),"data-testid":"llm-hosts-source-badge",children:M.source}),(0,a.jsx)("span",{"data-testid":"llm-hosts-count",children:M?"".concat(M.count," host").concat(1===M.count?"":"s"):"loading"===s.status?"loading…":""}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:w,disabled:"loading"===s.status||N,"data-testid":"llm-hosts-refresh",children:"Refresh"})]})]}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs space-y-2",children:[(null==M?void 0:M.deprecations)&&M.deprecations.length>0&&(0,a.jsxs)("div",{className:"rounded border border-amber-300 bg-amber-50 p-2 text-[11px] text-amber-800 dark:border-amber-700 dark:bg-amber-900/30 dark:text-amber-200","data-testid":"llm-hosts-deprecations",children:[(0,a.jsx)("p",{className:"font-medium",children:"호환성 경고 \xb7 다음 release 에서 제거 예정"}),(0,a.jsx)("ul",{className:"ml-4 list-disc",children:M.deprecations.map(e=>(0,a.jsx)("li",{className:"font-mono text-[10px]",children:e},e))})]}),"error"===s.status&&(0,a.jsxs)("p",{className:"text-rose-500","data-testid":"llm-hosts-error",children:["조회 실패 \xb7 ",s.error]}),"loading"===s.status&&!M&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Probing /v1/llm/hosts…"}),M&&0===M.hosts.length&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"No hosts configured. Add one below to enable a remote LLM provider (e.g. Anthropic / Gemini API direct)."}),M&&M.hosts.length>0&&(0,a.jsx)("ul",{className:"space-y-1","data-testid":"llm-hosts-list",children:M.hosts.map(e=>(0,a.jsxs)("li",{className:"flex items-center gap-2 rounded border border-border bg-muted/30 px-2 py-1","data-testid":"llm-host-row-".concat(e.name),children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 font-mono text-[11px] font-medium",children:[(0,a.jsx)("span",{children:e.name}),(0,a.jsx)("span",{className:"rounded bg-muted px-1 text-[9px] uppercase text-muted-foreground",children:e.kind}),"[redacted]"===e.apiKey&&(0,a.jsx)("span",{className:"rounded bg-emerald-100 px-1 text-[9px] uppercase text-emerald-700 dark:bg-emerald-900 dark:text-emerald-200",title:"apiKey configured (server-side, not echoed)","data-testid":"llm-host-key-badge-".concat(e.name),children:"key"})]}),(0,a.jsx)("div",{className:"truncate font-mono text-[10px] text-muted-foreground",children:e.endpoint})]}),"override"===M.source&&(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>{U(e.name)},disabled:N,"data-testid":"llm-host-remove-".concat(e.name),children:"Remove"})]},e.name))}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 pt-1",children:[(0,a.jsx)(i.$,{size:"sm",onClick:()=>x(e=>!e),disabled:N,"data-testid":"llm-hosts-add-toggle",children:m?"Cancel add":"Add host"}),(null==M?void 0:M.source)==="override"&&(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>{E()},disabled:N,"data-testid":"llm-hosts-reset",children:"Reset to env/legacy"})]}),m&&(0,a.jsxs)("div",{className:"mt-2 space-y-1.5 rounded border border-dashed border-border p-2","data-testid":"llm-hosts-add-form",children:[(0,a.jsx)(d.p,{value:h,placeholder:"name (e.g. anthropic-cloud)",onChange:e=>p(e.target.value),"data-testid":"llm-hosts-add-name",className:"text-[11px]"}),(0,a.jsx)("select",{value:b,onChange:e=>S(e.target.value),className:"flex h-8 w-full rounded-md border border-input bg-background px-2 text-xs","data-testid":"llm-hosts-add-kind",children:ea.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(d.p,{value:g,placeholder:"endpoint URL",onChange:e=>j(e.target.value),"data-testid":"llm-hosts-add-endpoint",className:"text-[11px]"}),"anthropic-openai-wrap"===b&&(0,a.jsx)(d.p,{type:"password",value:v,placeholder:"apiKey (sk-ant-…)",onChange:e=>y(e.target.value),"data-testid":"llm-hosts-add-apikey",className:"text-[11px]"}),(0,a.jsx)(i.$,{size:"sm",onClick:()=>{C()},disabled:N||!h.trim()||!g.trim(),"data-testid":"llm-hosts-add-submit",children:N?"Saving…":"Save"})]})]}),(0,a.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["In-memory override \xb7 daemon restart reverts to ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"ELANOUS_LLM_HOSTS"})," env / legacy single host. Permanent change → set the env var in ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:".zshrc"})," or ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"launchctl setenv"}),". PUT replaces the full list, so re-add Anthropic/Gemini hosts in one go (existing apiKeys appear as ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"[redacted]"})," and aren’t round-trippable)."]})]})}var el=s(75761);function ei(){var e,t;let[s,n]=(0,r.useState)(el.lu);(0,r.useEffect)(()=>{n((0,el.lu)())},[]);let l=s.speakingThresholdMultiplier===el.Qc.speakingThresholdMultiplier;return(0,a.jsxs)("section",{"data-testid":"voice-prefs-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83C\uDF99️ Voice barge-in 튜닝"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"BI-2 ducking 강도 — TTS 재생 중 자기-에코 false-fire 를 막는 RMS multiplier. 변경은 voice toggle off → on 또는 새로고침 시 적용."})]}),(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"rounded-md border border-input bg-background px-3 py-2",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs",children:[(0,a.jsx)("span",{className:"font-medium",children:"speaking threshold multiplier"}),(0,a.jsx)("span",{className:"rounded bg-muted px-2 py-0.5 font-mono text-[11px]","data-testid":"voice-prefs-multiplier-value",children:(e=s.speakingThresholdMultiplier,"".concat(e.toFixed(1),"\xd7"))})]}),(0,a.jsx)("input",{type:"range",min:el.u4,max:el.M_,step:.1,value:s.speakingThresholdMultiplier,onChange:e=>{var t;return t={speakingThresholdMultiplier:Number(e.target.value)},void(n((0,el.ik)(t)),(0,b.cY)("settings.voice-prefs.update",t))},"data-testid":"voice-prefs-multiplier-slider","aria-label":"Speaking threshold multiplier","aria-valuemin":el.u4,"aria-valuemax":el.M_,"aria-valuenow":s.speakingThresholdMultiplier,className:"w-full"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] text-muted-foreground","data-testid":"voice-prefs-hint",children:(t=s.speakingThresholdMultiplier)<=1.2?"거의 ducking 없음 — 자기-에코 false-fire 가능":t<=1.7?"약한 ducking — 강한 AEC 환경 + 빠른 cut-in":t<=2.5?"기본값 — 대부분 환경에서 균형":t<=3.5?"강한 ducking — 시끄러운 환경 / 민감한 마이크":"매우 강한 ducking — 자기-에코가 심한 환경"})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{n((0,el.KS)()),(0,b.cY)("settings.voice-prefs.reset")},disabled:l,className:"text-xs text-muted-foreground","data-testid":"voice-prefs-reset",children:["기본값으로 리셋 (",el.Qc.speakingThresholdMultiplier.toFixed(1),"\xd7)"]})})]})}var ed=s(11116),eo=s(59836),ec=s(36247);function eu(e){let{currentTier:t,nextTier:s,currentTierMonthlyUsd:n,nextTierMonthlyUsd:l,monthSoFarUsd:d,onConfirm:o,onCancel:c}=e,u=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;null==(e=u.current)||e.focus()},[]);let m=eo.YS[t],x=eo.YS[s],h=l>n,p=h?'Switch to "'.concat(eo.LW[s],'" tier?'):'Switch to "'.concat(eo.LW[s],'" tier (cheaper)'),b=l-n,f=b>=0?"+".concat((0,eo.Bg)(Math.abs(b))):"-".concat((0,eo.Bg)(Math.abs(b)));return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"tier-confirm-title","aria-describedby":"tier-confirm-summary","data-testid":"tier-change-confirm-modal",onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),c())},children:(0,a.jsxs)("div",{className:"w-full max-w-md rounded-lg border bg-white p-4 shadow-xl dark:bg-zinc-900 ".concat(h?"border-amber-300 dark:border-amber-700":"border-emerald-300 dark:border-emerald-700"),children:[(0,a.jsxs)("h2",{id:"tier-confirm-title",className:"mb-2 text-sm font-medium ".concat(h?"text-amber-700 dark:text-amber-300":"text-emerald-700 dark:text-emerald-300"),children:[h?"⚠️":"✓"," ",p]}),(0,a.jsx)("p",{id:"tier-confirm-summary",className:"mb-3 text-xs text-zinc-700 dark:text-zinc-300",children:x.rationale}),(0,a.jsxs)("dl",{className:"mb-4 space-y-1.5 text-xs",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("dt",{className:"text-zinc-500 dark:text-zinc-400",children:"Month so far"}),(0,a.jsx)("dd",{className:"font-mono tabular-nums text-zinc-900 dark:text-zinc-100","data-testid":"tier-confirm-month-so-far",children:(0,eo.Bg)(d).replace("/mo","")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("dt",{className:"text-zinc-500 dark:text-zinc-400",children:["At current tier (",eo.LW[t],")"]}),(0,a.jsx)("dd",{className:"font-mono tabular-nums text-zinc-900 dark:text-zinc-100","data-testid":"tier-confirm-current-projected",children:(0,eo.Bg)(n)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between rounded px-2 py-1 ".concat(h?"bg-amber-50 dark:bg-amber-950/40":"bg-emerald-50 dark:bg-emerald-950/40"),children:[(0,a.jsxs)("dt",{className:h?"text-amber-700 dark:text-amber-300":"text-emerald-700 dark:text-emerald-300",children:["At new tier (",eo.LW[s],")"]}),(0,a.jsxs)("dd",{className:"font-mono tabular-nums ".concat(h?"text-amber-900 dark:text-amber-100":"text-emerald-900 dark:text-emerald-100"),"data-testid":"tier-confirm-next-projected",children:[(0,eo.Bg)(l),(0,a.jsxs)("span",{className:"ml-1 text-[10px] opacity-70","data-testid":"tier-confirm-delta",children:["(",f,")"]})]})]})]}),(0,a.jsxs)("p",{className:"mb-3 text-[11px] text-zinc-500 dark:text-zinc-400","data-testid":"tier-confirm-rate-line",children:["Per-call: $",m.usdPerMinAudio.toFixed(3),"/min → $",(x.usdPerMinAudio+x.loadedExtraUsdPerMin).toFixed(3),"/min"]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:c,"data-testid":"tier-confirm-cancel",children:"Cancel"}),(0,a.jsx)(i.$,{ref:u,type:"button",size:"sm",onClick:o,"data-testid":"tier-confirm-confirm",className:h?"bg-amber-600 text-white hover:bg-amber-700":"bg-emerald-600 text-white hover:bg-emerald-700",children:h?"Confirm switch":"Switch"})]})]})})}let em=eo.Ql.length;function ex(){let{config:e}=(0,n.Q)(),t=(0,r.useMemo)(()=>({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}),[e.baseUrl,e.token]),[s,l]=(0,r.useState)(ec.Ij),[d,o]=(0,r.useState)(null),[c,u]=(0,r.useState)("idle"),[m]=(0,r.useState)(0);(0,r.useEffect)(()=>{l((0,ec.Ij)());let e=!1;return(async()=>{let s=await (0,ed.ee)(t);!e&&s&&(l(s),u("synced"))})(),()=>{e=!0}},[t]);let x=(0,ec.gF)(s),h=eo.YS[x],p=void 0===s.stt,f=(0,eo.K0)(null!=d?d:x),g=(0,r.useMemo)(()=>{let e={};for(let t of eo.Ql)e[t]=(0,eo.nX)(t,s.audioMinPerDay);return e},[s.audioMinPerDay]),j=e=>{l((0,ec.Pz)({stt:e})),u("syncing"),(0,b.cY)("settings.model-tier.update",{stt:e}),(0,ed.ZB)(t,e).then(u)};return(0,a.jsxs)("section",{"data-testid":"voice-model-tier-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83C\uDF9A️ Voice transcription quality"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Pick how accurate vs. cheap the speech-to-text should be — elanous picks the model. Switching takes effect on the next voice call."})]}),(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"rounded-md border border-input bg-background px-3 py-2",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs",children:[(0,a.jsxs)("span",{className:"font-medium",children:[eo.LW[x],p&&(0,a.jsx)("span",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground","data-testid":"voice-model-tier-default-badge",children:"Smart default"}),"syncing"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-600","data-testid":"voice-model-tier-sync-status",children:"Syncing…"}),"synced"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-600","data-testid":"voice-model-tier-sync-status",children:"Synced"}),"offline"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600","data-testid":"voice-model-tier-sync-status",title:"Daemon unreachable — change saved locally \xb7 will sync when daemon comes back",children:"Offline"}),"error"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-600","data-testid":"voice-model-tier-sync-status",title:"Daemon refused the write — local copy still has your choice",children:"Sync error"})]}),(0,a.jsx)("span",{className:"rounded bg-muted px-2 py-0.5 font-mono text-[11px]","data-testid":"voice-model-tier-cost",children:s.audioMinPerDay>0?(0,eo.Bg)(g[x]):"".concat((h.usdPerMinAudio+h.loadedExtraUsdPerMin).toFixed(3),"/min")})]}),(0,a.jsx)("input",{type:"range",min:0,max:em-1,step:1,value:f,onChange:e=>{let t=function(e){let t=Math.max(0,Math.min(em-1,Math.round(e)));return eo.Ql[t]}(Number(e.target.value));if(t!==x){if(function(e){let{currentTier:t,nextTier:s,currentTierMonthlyUsd:a,nextTierMonthlyUsd:r,audioMinPerDay:n}=e;if(t===s)return!1;let l=r-a;if(l<0)return!1;if(n>0)return l>=1;let i=eo.YS[t].usdPerMinAudio+eo.YS[t].loadedExtraUsdPerMin,d=eo.YS[s].usdPerMinAudio+eo.YS[s].loadedExtraUsdPerMin;return 0===i?d>0:d>=5*i}({currentTier:x,nextTier:t,currentTierMonthlyUsd:g[x],nextTierMonthlyUsd:g[t],audioMinPerDay:s.audioMinPerDay}))return void o(t);j(t)}},"data-testid":"voice-model-tier-slider","aria-label":"Voice transcription tier","aria-valuemin":0,"aria-valuemax":em-1,"aria-valuenow":f,"aria-valuetext":eo.LW[x],className:"w-full"}),(0,a.jsx)("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground","data-testid":"voice-model-tier-tick-labels",children:eo.Ql.map(e=>(0,a.jsx)("span",{className:e===x?"font-semibold text-foreground":void 0,children:eo.LW[e]},e))}),(0,a.jsx)("p",{className:"mt-2 text-[11px] text-muted-foreground","data-testid":"voice-model-tier-rationale",children:h.rationale}),(0,a.jsxs)("p",{className:"mt-1 text-[10px] text-muted-foreground/80","data-testid":"voice-model-tier-model-id",children:["Model: ",(0,a.jsx)("span",{className:"font-mono",children:h.model}),"wip"===h.status&&(0,a.jsx)("span",{className:"ml-1 rounded bg-amber-500/10 px-1 py-0.5 text-amber-600",children:"WIP \xb7 install local binary first"})]})]})}),(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,a.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l((0,ec.Pv)()),o(null),u("syncing"),(0,b.cY)("settings.model-tier.reset"),(0,ed.ZB)(t,null).then(u)},disabled:p,className:"text-xs text-muted-foreground","data-testid":"voice-model-tier-reset",children:["Reset to default (",eo.LW[eo.j$],")"]}),s.audioMinPerDay>0&&(0,a.jsxs)("span",{className:"text-[10px] text-muted-foreground","data-testid":"voice-model-tier-usage-hint",children:["~",s.audioMinPerDay.toFixed(0)," min/day \xb7 14-day rolling avg"]})]}),d&&(0,a.jsx)(eu,{currentTier:x,nextTier:d,currentTierMonthlyUsd:g[x],nextTierMonthlyUsd:g[d],monthSoFarUsd:m,onConfirm:()=>{d&&j(d),o(null)},onCancel:()=>{o(null),(0,b.cY)("settings.model-tier.cancel",{from:x})}})]})}let eh=eo.Ql.length;function ep(e){return"string"==typeof e&&(0,eo.D9)(e)?e:"anthropic"}function eb(){let{config:e}=(0,n.Q)(),t=(0,r.useMemo)(()=>({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}),[e.baseUrl,e.token]),[s,l]=(0,r.useState)(ec.Ij),[d,o]=(0,r.useState)(()=>ep(e.provider)),[c,u]=(0,r.useState)("idle");(0,r.useEffect)(()=>{l((0,ec.Ij)());let e=!1;return(async()=>{let s=await (0,ed.ee)(t);!e&&s&&(l(s),u("synced"))})(),()=>{e=!0}},[t]),(0,r.useEffect)(()=>{o(ep(e.provider))},[e.provider]);let m=(0,ec.oA)(s),x=void 0===s.llm,h=(0,eo.K0)(m),p=(0,eo.f7)(d,m);return(0,a.jsxs)("section",{"data-testid":"llm-model-tier-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83E\uDDE0 AI assistant quality"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Pick how careful vs. fast the model should think. elanous chooses the right model on your active provider \xb7 the slider stays the same across providers."})]}),(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"rounded-md border border-input bg-background px-3 py-2",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs",children:[(0,a.jsxs)("span",{className:"font-medium",children:[eo.LW[m],x&&(0,a.jsx)("span",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground","data-testid":"llm-model-tier-default-badge",children:"Smart default"}),"syncing"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-600","data-testid":"llm-model-tier-sync-status",children:"Syncing…"}),"synced"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-600","data-testid":"llm-model-tier-sync-status",children:"Synced"}),"offline"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600","data-testid":"llm-model-tier-sync-status",title:"Daemon unreachable",children:"Offline"}),"error"===c&&(0,a.jsx)("span",{className:"ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-600","data-testid":"llm-model-tier-sync-status",title:"Daemon refused the write",children:"Sync error"})]}),(0,a.jsx)("span",{className:"rounded bg-muted px-2 py-0.5 font-mono text-[11px]","data-testid":"llm-model-tier-provider",children:eo.T0[d]})]}),(0,a.jsx)("input",{type:"range",min:0,max:eh-1,step:1,value:h,onChange:e=>{let s=function(e){let t=Math.max(0,Math.min(eh-1,Math.round(e)));return eo.Ql[t]}(Number(e.target.value));s!==m&&(l((0,ec.Pz)({llm:s})),u("syncing"),(0,b.cY)("settings.model-tier.llm.update",{llm:s}),(0,ed.tM)(t,s).then(u))},"data-testid":"llm-model-tier-slider","aria-label":"AI assistant tier","aria-valuemin":0,"aria-valuemax":eh-1,"aria-valuenow":h,"aria-valuetext":eo.LW[m],className:"w-full"}),(0,a.jsx)("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground","data-testid":"llm-model-tier-tick-labels",children:eo.Ql.map(e=>(0,a.jsx)("span",{className:e===m?"font-semibold text-foreground":void 0,children:eo.LW[e]},e))}),(0,a.jsx)("p",{className:"mt-2 text-[11px] text-muted-foreground","data-testid":"llm-model-tier-rationale",children:p.rationale}),(0,a.jsxs)("p",{className:"mt-1 text-[10px] text-muted-foreground/80","data-testid":"llm-model-tier-model-id",children:["Model: ",(0,a.jsx)("span",{className:"font-mono",children:p.model}),p.reasoningLevel&&(0,a.jsxs)("span",{className:"ml-1 text-muted-foreground",children:["\xb7 reasoning: ",(0,a.jsx)("span",{className:"font-mono",children:p.reasoningLevel})]}),"wip"===p.status&&(0,a.jsx)("span",{className:"ml-1 rounded bg-amber-500/10 px-1 py-0.5 text-amber-600",children:"WIP \xb7 install local runtime first"})]})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{l((0,ec.Pz)({llm:void 0})),u("syncing"),(0,b.cY)("settings.model-tier.llm.reset"),(0,ed.tM)(t,null).then(u)},disabled:x,className:"text-xs text-muted-foreground","data-testid":"llm-model-tier-reset",children:["Reset to default (",eo.LW[eo.j$],")"]})})]})}let ef=eo.Ql.length;function eg(){var e;let{config:t}=(0,n.Q)(),s=(0,r.useMemo)(()=>({baseUrl:t.baseUrl,...t.token?{token:t.token}:{}}),[t.baseUrl,t.token]),[l,d]=(0,r.useState)(ec.Ij),[o,c]=(0,r.useState)("idle");(0,r.useEffect)(()=>{d((0,ec.Ij)());let e=!1;return(async()=>{let t=await (0,ed.ee)(s);!e&&t&&(d(t),c("synced"))})(),()=>{e=!0}},[s]);let u=(0,ec.Md)(l),m=eo.eP[u],x=void 0===l.tts,h=(0,eo.K0)(u),p=!Number.isFinite(e=m.usdPerCharacter)||e<=0?"free":"$".concat((1e6*e).toFixed(0),"/M chars");return(0,a.jsxs)("section",{"data-testid":"tts-model-tier-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83D\uDD0A Voice playback quality"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Pick text-to-speech quality vs. cost. Voice identity (Rachel \xb7 SoYoung \xb7 custom) lives in a separate picker (Phase 2 M2-2b)."})]}),(0,a.jsx)("div",{className:"space-y-3",children:(0,a.jsxs)("div",{className:"rounded-md border border-input bg-background px-3 py-2",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between text-xs",children:[(0,a.jsxs)("span",{className:"font-medium",children:[eo.LW[u],x&&(0,a.jsx)("span",{className:"ml-2 rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground","data-testid":"tts-model-tier-default-badge",children:"Smart default"}),"syncing"===o&&(0,a.jsx)("span",{className:"ml-2 rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-600","data-testid":"tts-model-tier-sync-status",children:"Syncing…"}),"synced"===o&&(0,a.jsx)("span",{className:"ml-2 rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-600","data-testid":"tts-model-tier-sync-status",children:"Synced"}),"offline"===o&&(0,a.jsx)("span",{className:"ml-2 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600","data-testid":"tts-model-tier-sync-status",children:"Offline"}),"error"===o&&(0,a.jsx)("span",{className:"ml-2 rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-600","data-testid":"tts-model-tier-sync-status",children:"Sync error"})]}),(0,a.jsx)("span",{className:"rounded bg-muted px-2 py-0.5 font-mono text-[11px]","data-testid":"tts-model-tier-rate",children:p})]}),(0,a.jsx)("input",{type:"range",min:0,max:ef-1,step:1,value:h,onChange:e=>{let t=function(e){let t=Math.max(0,Math.min(ef-1,Math.round(e)));return eo.Ql[t]}(Number(e.target.value));t!==u&&(d((0,ec.Pz)({tts:t})),c("syncing"),(0,b.cY)("settings.model-tier.tts.update",{tts:t}),(0,ed.pP)(s,t).then(c))},"data-testid":"tts-model-tier-slider","aria-label":"Voice playback tier","aria-valuemin":0,"aria-valuemax":ef-1,"aria-valuenow":h,"aria-valuetext":eo.LW[u],className:"w-full"}),(0,a.jsx)("div",{className:"mt-1 flex justify-between text-[10px] text-muted-foreground","data-testid":"tts-model-tier-tick-labels",children:eo.Ql.map(e=>(0,a.jsx)("span",{className:e===u?"font-semibold text-foreground":void 0,children:eo.LW[e]},e))}),(0,a.jsx)("p",{className:"mt-2 text-[11px] text-muted-foreground","data-testid":"tts-model-tier-rationale",children:m.rationale}),(0,a.jsxs)("p",{className:"mt-1 text-[10px] text-muted-foreground/80","data-testid":"tts-model-tier-model-id",children:["Provider: ",(0,a.jsx)("span",{className:"font-mono",children:m.provider}),(0,a.jsx)("span",{className:"ml-1",children:"\xb7"}),(0,a.jsxs)("span",{className:"ml-1",children:["Model: ",(0,a.jsx)("span",{className:"font-mono",children:m.model})]})]})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsxs)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>{d((0,ec.Pz)({tts:void 0})),c("syncing"),(0,b.cY)("settings.model-tier.tts.reset"),(0,ed.pP)(s,null).then(c)},disabled:x,className:"text-xs text-muted-foreground","data-testid":"tts-model-tier-reset",children:["Reset to default (",eo.LW[eo.j$],")"]})})]})}let ej=null;async function ev(e){var t;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e.baseUrl)return null;let a=null!=(t=s.now)?t:Date.now();if(!s.bypassMemo&&ej&&a-ej.fetchedAt<6e4)return ej.lib;try{let t=e.baseUrl.replace(/\/$/,"")+"/v1/elevenlabs/voices",s={};e.token&&(s.authorization="Bearer ".concat(e.token));let r=await fetch(t,{headers:s});if(!r.ok)return null;let n=await r.json(),l={voices:Array.isArray(n.voices)?n.voices:[],configured:!0===n.configured,fromCache:!0===n.fromCache};return ej={fetchedAt:a,lib:l},l}catch(e){return null}}let ey="elanous.tts-voice.recent";function eN(){if("undefined"==typeof localStorage)return[];try{let e=localStorage.getItem(ey);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>"string"==typeof e&&e.length>0).slice(0,5)}catch(e){return[]}}let ek=[{key:"default",label:"Default",hint:"Fallback when a specific context isn't set"},{key:"chat",label:"Chat reply",hint:"Used by the PWA / TUI chat surface"},{key:"digest",label:"Morning digest",hint:"Daily summary read-back (P2-D7)"},{key:"alert",label:"Push alerts",hint:"Urgency-driven voice for push notifications"},{key:"discord",label:"Discord bot",hint:"X9 Discord voice channel + DM voice replies"}],ew="elanous.tts-voice-map";function eS(){if("undefined"==typeof localStorage)return{};try{let e=localStorage.getItem(ew);if(!e)return{};let t=JSON.parse(e),s={};for(let e of ek){let a=t[e.key];"string"==typeof a&&a.trim().length>0&&(s[e.key]=a.trim())}return s}catch(e){return{}}}function eC(e){return[e.gender,e.accent,e.category].filter(Boolean).join(" \xb7 ")||"voice"}function eU(){var e;let{config:t}=(0,n.Q)(),s=(0,r.useMemo)(()=>({baseUrl:t.baseUrl,...t.token?{token:t.token}:{}}),[t.baseUrl,t.token]),[l,o]=(0,r.useState)(eS),[c,u]=(0,r.useState)("idle"),[m,x]=(0,r.useState)(null),[h,p]=(0,r.useState)(""),[f,g]=(0,r.useState)(null),[j,v]=(0,r.useState)(eN),y=(0,r.useRef)(null),[N,k]=(0,r.useState)(null);(0,r.useEffect)(()=>{o(eS()),v(eN());let e=!1;return(async()=>{let t=await ev(s);e||(x(t),u(null===t?"offline":"synced"))})(),()=>{e=!0}},[s]);let w=(0,r.useMemo)(()=>{let e=new Map;if(m)for(let t of m.voices)e.set(t.id,t);return e},[m]),S=(0,r.useMemo)(()=>{if(!m)return[];var e=m.voices;let t=h.trim().toLowerCase();return t?e.filter(e=>[e.name,e.category,e.accent,e.gender,e.age,e.description,e.language,e.id].filter(Boolean).join(" ").toLowerCase().includes(t)):[...e]},[m,h]),C=async(e,t)=>{let a=(null!=t?t:"").trim(),r={...l};a?r[e]=a:delete r[e],o(r);if("undefined"!=typeof localStorage)try{localStorage.setItem(ew,JSON.stringify(r))}catch(e){}a&&(!function(e){if("undefined"==typeof localStorage||!e||"string"!=typeof e)return;let t=e.trim();if(!t)return;let s=eN().filter(e=>e!==t),a=[t,...s].slice(0,5);try{localStorage.setItem(ey,JSON.stringify(a))}catch(e){}}(a),v(eN())),u("syncing"),(0,b.cY)("settings.tts-voice.apply",{context:e,voiceId:a||null}),u(await (0,ed.D4)(s,{[e]:a||null}))},U=async()=>{if(o({}),"undefined"!=typeof localStorage)try{localStorage.removeItem(ew)}catch(e){}u("syncing"),(0,b.cY)("settings.tts-voice.reset-all"),u(await (0,ed.D4)(s,{default:null,chat:null,digest:null,alert:null,discord:null}))},E=e=>{if(!e.previewUrl)return;y.current&&(y.current.pause(),y.current.src="");let t=new Audio(e.previewUrl);y.current=t,k(e.id),t.addEventListener("ended",()=>k(t=>t===e.id?null:t)),t.addEventListener("error",()=>k(t=>t===e.id?null:t)),t.play().catch(()=>k(t=>t===e.id?null:t)),(0,b.cY)("settings.tts-voice.preview",{voiceId:e.id})},M=()=>{y.current&&(y.current.pause(),y.current.src="",y.current=null),k(null)},P=Object.keys(l).length>0,A=null!==m&&m.voices.length>0;return(0,a.jsxs)("section",{"data-testid":"tts-voice-id-picker-card",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2 flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"\uD83D\uDDE3️ Voice identity (per context)"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Pick a different voice per surface (chat / morning digest / alerts / Discord). Browse the ElevenLabs library or paste a voice id directly."})]}),"syncing"===c&&(0,a.jsx)("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-600","data-testid":"tts-voice-sync-status",children:"Syncing…"}),"synced"===c&&(0,a.jsx)("span",{className:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-600","data-testid":"tts-voice-sync-status",children:"Synced"}),"offline"===c&&(0,a.jsx)("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600","data-testid":"tts-voice-sync-status",title:"Daemon unreachable",children:"Offline"}),"error"===c&&(0,a.jsx)("span",{className:"rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-600","data-testid":"tts-voice-sync-status",children:"Sync error"})]}),m&&!m.configured&&(0,a.jsxs)("div",{className:"mb-3 rounded bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300","data-testid":"tts-voice-library-unconfigured",children:["ElevenLabs API key not set — set ",(0,a.jsx)("code",{className:"font-mono",children:"ELEVENLABS_API_KEY"})," in your env or store via ",(0,a.jsx)("code",{className:"font-mono",children:"elanous config set-secret elevenlabs.apiKey <key>"})," ","to browse the 10k+ voice library."]}),(0,a.jsx)("div",{className:"space-y-2","data-testid":"tts-voice-rows",children:ek.map(e=>{let t=l[e.key],s=t?w.get(t):void 0;return(0,a.jsxs)("div",{className:"rounded-md border border-input bg-background px-3 py-2",children:[(0,a.jsxs)("div",{className:"mb-1 flex items-baseline justify-between gap-2 text-xs",children:[(0,a.jsx)("span",{className:"font-medium","data-testid":"tts-voice-row-".concat(e.key,"-label"),children:e.label}),s&&(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground","data-testid":"tts-voice-row-".concat(e.key,"-current-name"),children:[s.name," ",(0,a.jsxs)("span",{className:"opacity-60",children:["\xb7 ",eC(s)]})]}),t&&!s&&(0,a.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground","data-testid":"tts-voice-row-".concat(e.key,"-current"),children:t})]}),(0,a.jsx)("p",{className:"mb-1 text-[10px] text-muted-foreground",children:e.hint}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.p,{defaultValue:null!=t?t:"",onBlur:s=>{let a=s.target.value.trim();a!==(null!=t?t:"")&&C(e.key,a||null)},placeholder:"Voice id (paste) or use Browse →",className:"text-xs","data-testid":"tts-voice-row-".concat(e.key,"-input")}),(0,a.jsx)(i.$,{type:"button",size:"sm",variant:f===e.key?"default":"outline",onClick:()=>g(f===e.key?null:e.key),disabled:!A,className:"text-xs","data-testid":"tts-voice-row-".concat(e.key,"-browse"),title:A?"Browse library":"Library not loaded yet",children:"Browse"}),(null==s?void 0:s.previewUrl)&&(0,a.jsx)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>N===s.id?M():E(s),className:"text-xs","data-testid":"tts-voice-row-".concat(e.key,"-preview"),children:N===s.id?"⏸":"▶"}),(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:()=>C(e.key,null),disabled:!t,className:"text-xs text-muted-foreground","data-testid":"tts-voice-row-".concat(e.key,"-clear"),children:"Clear"})]})]},e.key)})}),null!==f&&A&&(0,a.jsxs)("div",{className:"mt-3 rounded-md border border-input bg-background p-2","data-testid":"tts-voice-library-catalog",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center justify-between gap-2",children:[(0,a.jsx)(d.p,{value:h,onChange:e=>p(e.target.value),placeholder:"Search voices (name \xb7 accent \xb7 gender \xb7 description)",className:"text-xs","data-testid":"tts-voice-library-search"}),(0,a.jsx)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>g(null),className:"text-xs text-muted-foreground","data-testid":"tts-voice-library-close",children:"Close"})]}),j.length>0&&!h&&(0,a.jsxs)("div",{className:"mb-2","data-testid":"tts-voice-recent-row",children:[(0,a.jsx)("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:"Recently used"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:j.map(e=>{let t=w.get(e);return t?(0,a.jsx)("button",{type:"button",className:"rounded border border-border/40 bg-muted/30 px-2 py-1 text-[11px] hover:bg-muted",onClick:()=>f&&C(f,e),"data-testid":"tts-voice-recent-".concat(e),children:t.name},e):null})})]}),(0,a.jsxs)("p",{className:"mb-1 text-[10px] uppercase tracking-wider text-muted-foreground",children:[S.length," voice",1===S.length?"":"s",h&&' matching "'.concat(h,'"')]}),(0,a.jsxs)("div",{className:"max-h-64 space-y-1 overflow-y-auto pr-1","data-testid":"tts-voice-library-list",children:[S.slice(0,50).map(e=>{let t=N===e.id;return(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded border border-border/40 bg-muted/20 px-2 py-1 text-xs","data-testid":"tts-voice-library-row-".concat(e.id),children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("div",{className:"truncate font-medium",children:e.name}),(0,a.jsxs)("div",{className:"truncate text-[10px] text-muted-foreground",children:[eC(e),e.description&&(0,a.jsxs)("span",{children:[" \xb7 ",e.description]})]})]}),e.previewUrl&&(0,a.jsx)(i.$,{type:"button",size:"sm",variant:"ghost",onClick:()=>t?M():E(e),className:"text-xs","data-testid":"tts-voice-library-preview-".concat(e.id),children:t?"⏸":"▶"}),(0,a.jsx)(i.$,{type:"button",size:"sm",onClick:()=>f&&C(f,e.id),className:"text-xs","data-testid":"tts-voice-library-apply-".concat(e.id),children:"Apply"})]},e.id)}),S.length>50&&(0,a.jsxs)("p",{className:"text-center text-[10px] text-muted-foreground",children:["Showing first 50 of ",S.length," \xb7 refine the search to see more"]}),0===S.length&&(0,a.jsxs)("p",{className:"px-2 py-4 text-center text-[11px] text-muted-foreground",children:['No voices match "',h,'"']})]})]}),(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between gap-2",children:[(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:U,disabled:!P,className:"text-xs text-muted-foreground","data-testid":"tts-voice-reset-all",children:"Reset all"}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground/80",children:A?"".concat(null!=(e=null==m?void 0:m.voices.length)?e:0," voices \xb7 library cache via daemon"):"Paste voice id manually until daemon library is reachable"})]})]})}let eE={casual_chat:{id:"casual_chat",label:"Casual chat",icon:"\uD83D\uDCAC",description:"Day-to-day messaging \xb7 cheap STT / LLM \xb7 no read-back.",tiers:{stt:"budget",llm:"budget",tts:"budget"}},meeting:{id:"meeting",label:"Meeting notes",icon:"\uD83D\uDCCB",description:"Balanced accuracy for transcripts \xb7 standard LLM summarization.",tiers:{stt:"balanced",llm:"balanced",tts:"balanced"},monthlyUsdCap:5},medical_dictation:{id:"medical_dictation",label:"Medical / legal dictation",icon:"\uD83C\uDFE5",description:"Loaded STT (timestamps + jargon adaptation) \xb7 Best LLM \xb7 ElevenLabs voice.",tiers:{stt:"loaded",llm:"best",tts:"best"},monthlyUsdCap:20},live_caption:{id:"live_caption",label:"Live captioning",icon:"\uD83C\uDFAC",description:"Low-latency STT \xb7 LLM disabled \xb7 no read-back.",tiers:{stt:"balanced",llm:"budget",tts:"budget"}},sleep_mode:{id:"sleep_mode",label:"Sleep mode",icon:"\uD83C\uDF19",description:"Cost zero \xb7 local-only models \xb7 no API calls.",tiers:{stt:"budget",llm:"budget",tts:"budget"},monthlyUsdCap:0}},eM=["casual_chat","meeting","medical_dictation","live_caption","sleep_mode"],eP="elanous.active-preset";function eA(){if("undefined"!=typeof localStorage)try{let e=localStorage.getItem(eP);if(!e)return;return eM.includes(e)?e:void 0}catch(e){return}}function ez(e){if("undefined"!=typeof localStorage)try{null===e?localStorage.removeItem(eP):localStorage.setItem(eP,e)}catch(e){}}function eI(){let{config:e}=(0,n.Q)(),t=(0,r.useMemo)(()=>({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}),[e.baseUrl,e.token]),[s,l]=(0,r.useState)(eA),[d,o]=(0,r.useState)("idle"),[c,u]=(0,r.useState)(null);(0,r.useEffect)(()=>{l(eA())},[]);let m=async e=>{u(e.id),o("syncing"),(0,b.cY)("settings.preset.apply",{id:e.id}),ez(e.id),l(e.id),o(await (0,ed.F$)(t,{id:e.id,tiers:e.tiers,...e.ttsVoice?{ttsVoice:e.ttsVoice}:{},...void 0!==e.monthlyUsdCap?{monthlyUsdCap:e.monthlyUsdCap}:{}})),u(null)},x=async()=>{o("syncing"),(0,b.cY)("settings.preset.clear"),ez(null),l(void 0),o(await (0,ed.F$)(t,null))};return(0,a.jsxs)("section",{"data-testid":"preset-card-grid",className:"rounded border border-border/60 bg-card/40 p-4 shadow-sm",children:[(0,a.jsxs)("header",{className:"mb-2 flex items-start justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold",children:"⚡ Quick presets"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"One-click bundles for common use cases — applies STT, LLM, TTS, voice id, and budget cap together. You can still fine-tune any slider after applying."})]}),"syncing"===d&&(0,a.jsx)("span",{className:"rounded bg-blue-500/10 px-1.5 py-0.5 text-[10px] text-blue-600","data-testid":"preset-sync-status",children:"Syncing…"}),"synced"===d&&(0,a.jsx)("span",{className:"rounded bg-emerald-500/10 px-1.5 py-0.5 text-[10px] text-emerald-600","data-testid":"preset-sync-status",children:"Synced"}),"offline"===d&&(0,a.jsx)("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600","data-testid":"preset-sync-status",children:"Offline"}),"error"===d&&(0,a.jsx)("span",{className:"rounded bg-red-500/10 px-1.5 py-0.5 text-[10px] text-red-600","data-testid":"preset-sync-status",children:"Sync error"})]}),s&&(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between rounded bg-emerald-500/5 px-3 py-2 text-xs","data-testid":"preset-active-banner",children:[(0,a.jsxs)("span",{className:"text-emerald-700 dark:text-emerald-300",children:["✓ Active preset: ",(0,a.jsx)("strong",{children:eE[s].label})]}),(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:x,className:"text-[11px] text-muted-foreground","data-testid":"preset-clear-active",children:"Clear preset"})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3","data-testid":"preset-card-list",children:eM.map(e=>{let t=eE[e],r=s===e,n=c===e;return(0,a.jsxs)("button",{type:"button",onClick:()=>m(t),disabled:n,className:"rounded-md border px-3 py-2 text-left transition-colors ".concat(r?"border-emerald-500 bg-emerald-500/5":"border-border/60 bg-background hover:bg-muted/40"),"data-testid":"preset-card-".concat(e),children:[(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,a.jsxs)("span",{className:"text-sm font-semibold",children:[t.icon," ",t.label]}),r&&(0,a.jsx)("span",{className:"text-[10px] text-emerald-600",children:"active"}),n&&(0,a.jsx)("span",{className:"text-[10px] text-blue-600",children:"applying…"})]}),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:t.description}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1 text-[9px] text-muted-foreground",children:[t.tiers.stt&&(0,a.jsxs)("span",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:["stt:",t.tiers.stt]}),t.tiers.llm&&(0,a.jsxs)("span",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:["llm:",t.tiers.llm]}),t.tiers.tts&&(0,a.jsxs)("span",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:["tts:",t.tiers.tts]}),void 0!==t.monthlyUsdCap&&(0,a.jsxs)("span",{className:"rounded bg-muted px-1 py-0.5 font-mono",children:["cap:$",t.monthlyUsdCap]})]})]},e)})})]})}var eT=s(67770);let eL=(0,$.A)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var eR=s(34182);let eD=(0,$.A)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var e$=s(7329);let eO={skills:"\uD83D\uDEE0️",toolRestrictions:"\uD83D\uDD12",structuredOutput:"\uD83D\uDCCB",thinkingControl:"\uD83D\uDCAD",effortControl:"⚙️",sessionResume:"↩️",mcp:"\uD83E\uDDE9",hooks:"\uD83E\uDE9D",agents:"\uD83E\uDD16",envInjection:"\uD83D\uDD11",costControl:"\uD83D\uDCB0",fallbackModel:"\uD83D\uDD01",sandbox:"\uD83E\uDDF1",multiHostFanout:"\uD83C\uDF10"};function eB(){let{client:e,config:t}=(0,n.Q)(),s=(0,e$.X)(e),[l,i]=(0,r.useState)({}),[d,o]=(0,r.useState)({state:"idle"}),[c,u]=(0,r.useState)("list"),m=(0,r.useMemo)(()=>{let e=s.providers[0];return e?Object.keys(e.capabilities).sort():[]},[s.providers]);(0,r.useEffect)(()=>{if(s.providers.length>0&&0===Object.keys(l).length){let e={};for(let t of s.providers)e[t.id]=!1;i(e)}},[s.providers,l]);let x=(0,r.useCallback)(e=>{i(t=>({...t,[e]:!t[e]}))},[]),h=(0,r.useCallback)(async()=>{o({state:"running"});try{var e,a;let r="".concat(null!=(a=null==(e=t.baseUrl)?void 0:e.replace(/\/$/,""))?a:"","/v1/registry/discovery"),n={};t.token&&(n.authorization="Bearer ".concat(t.token));let l=await fetch(r,{method:"POST",headers:n});if(!l.ok)return void o({state:"error",detail:"HTTP ".concat(l.status)});await s.reload(),o({state:"ok"})}catch(e){o({state:"error",detail:e instanceof Error?e.message:String(e)})}},[t.baseUrl,t.token,s]);return(0,a.jsxs)("section",{className:"space-y-2","data-testid":"llm-catalog-card",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"LLM Catalog"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsx)("span",{"data-testid":"llm-catalog-summary",children:s.loading?"loading…":"".concat(s.providers.length," providers \xb7 ").concat(s.models.length," models")}),(0,a.jsx)("button",{type:"button",onClick:()=>u(e=>"list"===e?"matrix":"list"),"aria-label":"Toggle view: list vs capability matrix","data-testid":"llm-catalog-view-toggle",className:"rounded px-1.5 py-0.5 text-[10px] uppercase font-medium hover:bg-surface-elevated",children:"list"===c?"matrix":"list"}),(0,a.jsx)("button",{type:"button",onClick:h,disabled:"running"===d.state||s.loading,"aria-label":"Run discovery refresh","data-testid":"llm-catalog-refresh",className:"rounded p-1 hover:bg-surface-elevated disabled:opacity-50",children:(0,a.jsx)(L.A,{className:"h-3 w-3 ".concat("running"===d.state?"animate-spin":"")})})]})]}),s.error&&(0,a.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-error","data-testid":"llm-catalog-error",children:[(0,a.jsx)(R.A,{className:"h-3 w-3"}),s.error]}),"error"===d.state&&(0,a.jsxs)("p",{className:"flex items-center gap-1 text-[11px] text-error",children:[(0,a.jsx)(R.A,{className:"h-3 w-3"}),"discovery failed \xb7 ",d.detail]}),"ok"===d.state&&(0,a.jsx)("p",{className:"text-[11px] text-emerald-600 dark:text-emerald-400",children:"discovery complete — catalog refreshed"}),s.loading&&0===s.providers.length&&(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"Querying /v1/registry/catalog…"}),s.providers.length>0&&"matrix"===c&&(0,a.jsx)("div",{className:"overflow-x-auto rounded-md border border-border","data-testid":"llm-catalog-matrix",children:(0,a.jsxs)("table",{className:"min-w-full text-[10px]",children:[(0,a.jsx)("thead",{className:"bg-surface-elevated",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"sticky left-0 z-10 bg-surface-elevated px-2 py-1 text-left font-medium",children:"Provider"}),m.map(e=>{var t;return(0,a.jsx)("th",{className:"px-1.5 py-1 text-center font-medium uppercase text-muted-foreground",title:e,children:null!=(t=eO[e])?t:e.slice(0,3)},e)})]})}),(0,a.jsx)("tbody",{children:s.providers.map(e=>(0,a.jsxs)("tr",{className:"border-t border-border/40","data-testid":"llm-catalog-matrix-row-".concat(e.id),children:[(0,a.jsx)("td",{className:"sticky left-0 z-10 bg-card px-2 py-1 font-mono text-[10px]",children:e.id}),m.map(t=>{let s=e.capabilities[t];return(0,a.jsx)("td",{className:"px-1.5 py-1 text-center",title:"".concat(e.id," \xb7 ").concat(t,": ").concat(s?"yes":"no"),children:s?(0,a.jsx)(eT.A,{className:"mx-auto h-3 w-3 text-emerald-600 dark:text-emerald-400"}):(0,a.jsx)(eL,{className:"mx-auto h-3 w-3 text-muted-foreground/50"})},t)})]},e.id))})]})}),s.providers.length>0&&"list"===c&&(0,a.jsx)("ul",{className:"space-y-1 rounded-md border border-border","data-testid":"llm-catalog-provider-list",children:s.providers.map(e=>{var t;let r=s.modelsByProvider(e.id),n=null!=(t=l[e.id])&&t,i=Object.entries(e.capabilities).filter(e=>{let[,t]=e;return!0===t}).map(e=>{let[t]=e;return t});return(0,a.jsxs)("li",{className:"border-b border-border/40 last:border-0","data-testid":"llm-catalog-provider-".concat(e.id),children:[(0,a.jsxs)("button",{type:"button",onClick:()=>x(e.id),"aria-expanded":n,className:"flex w-full items-start justify-between gap-2 px-2 py-1.5 text-left hover:bg-surface-elevated","data-testid":"llm-catalog-provider-toggle-".concat(e.id),children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1 space-y-0.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 text-[12px] font-medium",children:[n?(0,a.jsx)(eR.A,{className:"h-3 w-3"}):(0,a.jsx)(eD,{className:"h-3 w-3"}),(0,a.jsx)("span",{children:e.displayName}),(0,a.jsx)("span",{className:"rounded bg-muted px-1 font-mono text-[9px] uppercase text-muted-foreground",children:e.id})]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-0.5 pl-4 text-[10px] text-muted-foreground",children:i.map(e=>{var t;return(0,a.jsxs)("span",{className:"rounded bg-surface-elevated px-1",title:e,children:[null!=(t=eO[e])?t:"\xb7"," ",e]},e)})})]}),(0,a.jsxs)("span",{className:"shrink-0 rounded bg-muted px-1 text-[10px] text-muted-foreground",children:[r.length," model",1===r.length?"":"s"]})]}),n&&(0,a.jsxs)("ul",{className:"border-t border-border/40 bg-surface-elevated/50 px-2 py-1","data-testid":"llm-catalog-models-".concat(e.id),children:[0===r.length&&(0,a.jsx)("li",{className:"py-1 text-[10px] text-muted-foreground",children:"no models registered for this provider"}),r.map(e=>(0,a.jsxs)("li",{className:"flex items-center justify-between gap-2 py-0.5 font-mono text-[10px]","data-testid":"llm-catalog-model-".concat(e.id),children:[(0,a.jsx)("span",{className:"truncate",title:e.id,children:e.id}),(0,a.jsxs)("span",{className:"shrink-0 text-muted-foreground",children:[e.contextSize?"".concat(Math.round(e.contextSize/1e3),"k ctx"):"—",e.pricing?" \xb7 $".concat(e.pricing.inputPerMTok,"/$").concat(e.pricing.outputPerMTok):""]})]},e.id))]})]},e.id)})})]})}var eY=s(23934);function eQ(e){let{status:t,percent:s,monthlyUsdCap:n,monthSoFarUsd:l,recommendedFallback:d,notifyAtPct:o,onApply:c,onAdjustCap:u,onDismiss:m}=e,[x,h]=(0,r.useState)("switch"),p=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;null==(e=p.current)||e.focus()},[]);let b="cap-exceeded"===t,f=eo.LW[d],g=(0,eo.Bg)(l).replace("/mo",""),j=(0,eo.Bg)(n).replace("/mo","");return(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true","aria-labelledby":"budget-threshold-title","aria-describedby":"budget-threshold-summary","data-testid":"budget-threshold-modal","data-status":t,onKeyDown:e=>{"Escape"===e.key&&(e.stopPropagation(),m())},children:(0,a.jsxs)("div",{className:"w-full max-w-md rounded-lg border bg-white p-4 shadow-xl dark:bg-zinc-900 ".concat(b?"border-rose-300 dark:border-rose-700":"border-amber-300 dark:border-amber-700"),children:[(0,a.jsxs)("h2",{id:"budget-threshold-title",className:"mb-2 text-sm font-medium ".concat(b?"text-rose-700 dark:text-rose-300":"text-amber-700 dark:text-amber-300"),children:["\uD83D\uDCB0 You've used ",g," of ",j," monthly cap (",Math.round(s),"%)"]}),(0,a.jsx)("p",{id:"budget-threshold-summary",className:"mb-3 text-xs text-zinc-600 dark:text-zinc-400","data-testid":"budget-threshold-summary",children:b?"You've passed the cap. elanous recommends falling back to ".concat(f," tier for the rest of this month."):"You're past the ".concat(o,"% threshold. elanous can switch to ").concat(f," tier to slow the burn.")}),(0,a.jsxs)("fieldset",{className:"mb-4 space-y-1.5 text-xs","data-testid":"budget-threshold-choices",children:[(0,a.jsx)("legend",{className:"sr-only",children:"Auto-fallback options"}),(0,a.jsx)(e_,{id:"switch",label:"Switch to ".concat(f," tier for the rest of this month"),checked:"switch"===x,onSelect:()=>h("switch")}),(0,a.jsx)(e_,{id:"continue",label:"Continue at current tier (may exceed cap)",checked:"continue"===x,onSelect:()=>h("continue")}),(0,a.jsx)(e_,{id:"local-only",label:"Use local-only models (cost = $0)",checked:"local-only"===x,onSelect:()=>h("local-only")})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(i.$,{type:"button",variant:"ghost",size:"sm",onClick:u,"data-testid":"budget-threshold-adjust-cap",children:"Adjust cap"}),(0,a.jsx)(i.$,{ref:p,type:"button",size:"sm",onClick:()=>c(x,d),"data-testid":"budget-threshold-apply",className:b?"bg-rose-600 text-white hover:bg-rose-700":"bg-amber-600 text-white hover:bg-amber-700",children:"Apply"})]})]})})}function e_(e){let{id:t,label:s,checked:r,onSelect:n}=e;return(0,a.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1 ".concat(r?"bg-zinc-100 dark:bg-zinc-800":"hover:bg-zinc-50 dark:hover:bg-zinc-800/50"),"data-testid":"budget-threshold-choice-".concat(t),children:[(0,a.jsx)("input",{type:"radio",name:"budget-threshold-choice",value:t,checked:r,onChange:n,className:"h-3 w-3"}),(0,a.jsx)("span",{className:"text-zinc-700 dark:text-zinc-200",children:s})]})}function eW(e){var t,s;let{pollMs:l=6e4,onAdjustCap:i}=e,{config:d}=(0,n.Q)(),[c,u]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!d.baseUrl)return;let e=!1,t=async()=>{let t=await (0,eY.gh)({baseUrl:d.baseUrl,...d.token?{token:d.token}:{}});e||u(t)};if(t(),l<=0)return()=>{e=!0};let s=setInterval(()=>{t()},l);return()=>{e=!0,clearInterval(s)}},[d.baseUrl,d.token,l]);let m=(0,r.useCallback)(async(e,t)=>{if(!c)return;if("continue"===e){(0,eY.s0)(c.monthYYYYMM,"ok"===c.status?"warning":c.status),u({...c,status:"ok"}),o.oR.message("Continuing at current tier — elanous will nag again at next threshold.");return}let s=await (0,eY.iQ)({baseUrl:d.baseUrl,...d.token?{token:d.token}:{}},t);"synced"===s?o.oR.success("Switched STT/LLM/TTS to ".concat(t,".")):"offline"===s?o.oR.error("Daemon offline — change saved locally, will sync when online."):o.oR.error("Budget fallback failed: ".concat(s,".")),(0,eY.s0)(c.monthYYYYMM,"ok"===c.status?"warning":c.status),u({...c,status:"ok"})},[d.baseUrl,d.token,c]),x=(0,r.useCallback)(()=>{c&&((0,eY.s0)(c.monthYYYYMM,"ok"===c.status?"warning":c.status),u({...c,status:"ok"}))},[c]),h=(0,r.useCallback)(()=>{i&&i(),x()},[i,x]);return c&&(0,eY.Vl)(c)?(0,a.jsx)(eQ,{status:c.status,percent:null!=(t=c.percent)?t:0,monthlyUsdCap:null!=(s=c.monthlyUsdCap)?s:0,monthSoFarUsd:c.monthSoFarUsd,recommendedFallback:c.recommendedFallback,notifyAtPct:c.notifyAtPct,onApply:(e,t)=>{m(e,t)},onAdjustCap:h,onDismiss:x}):null}let eF={embedding:"RAG retrieval \xb7 similarity. Most users never touch this.",vision:"OCR \xb7 screenshot analysis \xb7 note-from-image."};function eV(){let{config:e}=(0,n.Q)(),t=(0,r.useMemo)(()=>({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}),[e.baseUrl,e.token]),[s,l]=(0,r.useState)(ec.Ij),[d,o]=(0,r.useState)("idle"),[c,u]=(0,r.useState)("idle");(0,r.useEffect)(()=>{l((0,ec.Ij)());let e=!1;return(async()=>{let s=await (0,ed.ee)(t);!e&&s&&l(s)})(),()=>{e=!0}},[t]);let m=async(e,s)=>{(0,b.cY)("pwa.settings.tier.embedding-vision","selected ".concat(e,"=").concat(s)),"embedding"===e?(o("syncing"),o(await (0,ed.zs)(t,s)),l(e=>({...e,embedding:s}))):(u("syncing"),u(await (0,ed.We)(t,s)),l(e=>({...e,vision:s})))},x=e=>{let t="embedding"===e?(0,ec.ew)(s):(0,ec.lH)(s),r="embedding"===e?!!s.embedding:!!s.vision,n="embedding"===e?d:c;return(0,a.jsxs)("div",{className:"space-y-1.5","data-testid":"embedding-vision-row-".concat(e),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-xs font-medium uppercase tracking-wide text-zinc-500 dark:text-zinc-400",children:"embedding"===e?"Embedding":"Vision"}),(0,a.jsx)("span",{className:"text-[10px] text-zinc-400 dark:text-zinc-500",children:r?"Saved \xb7 ".concat(n):"Smart default"})]}),(0,a.jsx)("p",{className:"text-[11px] text-zinc-500 dark:text-zinc-400",children:eF[e]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-1",children:eo.Ql.map(s=>(0,a.jsx)(i.$,{size:"sm",variant:s===t?"default":"outline",onClick:()=>{m(e,s)},"data-testid":"embedding-vision-".concat(e,"-").concat(s),className:"text-[11px]",children:eo.LW[s]},s))})]})};return(0,a.jsxs)("section",{className:"space-y-4 rounded-md border border-border bg-card p-4","data-testid":"embedding-vision-card",children:[(0,a.jsxs)("header",{className:"space-y-1",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Embedding \xb7 Vision tier"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Phase 3 scaffolding — model selection for RAG embedding + image vision. Resolvers wired; call-site integration follows as RAG / vision pipelines come online."})]}),x("embedding"),x("vision")]})}var eK=s(82157);function eH(){let e=(0,N.Qj)(),[t,s]=(0,r.useState)(!1),[n,l]=(0,r.useState)({status:"idle"}),[d,o]=(0,r.useState)({});(0,r.useEffect)(()=>{s(!0)},[]);let c=(0,r.useCallback)(async()=>{if(e){l({status:"loading"});try{let t=await e.getPersonas();l({status:"ok",personas:t.personas}),o({})}catch(e){l({status:"error",message:e.message})}}},[e]);(0,r.useEffect)(()=>{t&&e&&c()},[t,e,c]);let u=(0,r.useCallback)((e,t,s)=>{o(a=>{var r;return{...a,[e]:{personaId:e,draft:s,dirty:s!==(null!=t?t:""),saving:!1,...(null==(r=a[e])?void 0:r.error)?{error:void 0}:{}}}})},[]),m=(0,r.useCallback)(async t=>{if(!e)return;let s=d[t];if(s){o(e=>({...e,[t]:{...s,saving:!0,error:void 0}}));try{let a=await e.patchPersonaDescription(t,s.draft);l(e=>"ok"!==e.status?e:{status:"ok",personas:e.personas.map(e=>e.personaId===t?a.persona:e)}),o(e=>{let{[t]:s,...a}=e;return a})}catch(e){o(a=>({...a,[t]:{...s,saving:!1,error:e.message}}))}}},[e,d]);return t&&e?(0,a.jsxs)("section",{id:"personas","data-testid":"persona-card",className:"space-y-3 rounded border border-border bg-card p-4",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Personas"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"4 인격 yaml file 의 description 편집. 빈 string 으로 저장하면 clear."})]}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:c,disabled:"loading"===n.status,children:"Refresh"})]}),"idle"===n.status||"loading"===n.status?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading personas…"}):null,"error"===n.status?(0,a.jsxs)("p",{className:"text-xs text-destructive",children:["persona 로드 실패: ",n.message]}):null,"ok"===n.status&&0===n.personas.length?(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["~/.elanous/personas/ 에 yaml file 이 없음. yaml seed:"," ",(0,a.jsx)("span",{className:"font-mono",children:"personas/*.yaml"})," 복사 후 refresh."]}):null,"ok"===n.status&&n.personas.length>0?(0,a.jsx)("ul",{className:"flex flex-col gap-3",children:n.personas.map(e=>(0,a.jsx)(eq,{persona:e,edit:d[e.personaId],onDraftChange:u,onSave:m},e.personaId))}):null,(0,a.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["Note: ⚗ Auto describer 와 orchestrator routing 은"," ",(0,a.jsx)("a",{href:"https://github.com/ElanvitalAI/elanous/blob/main/내부 문서 `RESEARCH-hermes-pr27572-triage-orchestrator-deferred-2026-05-19`",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"Hermes PR #27572 research"})," ","채택 시 활성화 예정."]})]}):null}function eq(e){var t,s,r,n;let{persona:l,edit:d,onDraftChange:o,onSave:c}=e,u=null!=(t=l.description)?t:"",m=null!=(s=null==d?void 0:d.draft)?s:u,x=null!=(r=null==d?void 0:d.dirty)&&r,h=null!=(n=null==d?void 0:d.saving)&&n,p=280-m.length<0;return(0,a.jsxs)("li",{className:"flex flex-col gap-2 rounded border border-border bg-background p-3","data-testid":"persona-row-".concat(l.personaId),children:[(0,a.jsxs)("header",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l.brandColor?(0,a.jsx)("span",{className:"inline-block h-3 w-3 rounded",style:{backgroundColor:l.brandColor},"aria-hidden":!0}):null,(0,a.jsx)("span",{className:"text-sm font-medium",children:l.displayName}),(0,a.jsx)("span",{className:"font-mono text-[10px] text-muted-foreground",children:l.personaId})]}),l.primaryModel?(0,a.jsx)("span",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",children:l.primaryModel}):null]}),(0,a.jsx)("textarea",{value:m,onChange:e=>o(l.personaId,u,e.target.value),rows:2,maxLength:560,placeholder:"이 persona 가 무엇을 잘 하는지 1-2 문장으로 적어주세요.",disabled:h,"data-testid":"persona-description-".concat(l.personaId),className:(0,eK.cn)("w-full resize-none rounded border border-input bg-transparent px-2.5 py-1.5 text-xs","focus-visible:border-ring focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50",p&&"border-destructive")}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("span",{className:(0,eK.cn)("font-mono text-[10px]",p?"text-destructive":"text-muted-foreground"),children:[m.length," / ",280]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(null==d?void 0:d.error)?(0,a.jsx)("span",{className:"text-[10px] text-destructive",children:d.error}):null,(0,a.jsx)(i.$,{size:"sm",onClick:()=>c(l.personaId),disabled:!x||h||p,"data-testid":"persona-save-".concat(l.personaId),children:h?"저장중…":"저장"})]})]})]})}let eX="2026-10-03T01:25:39.350Z",eG="2740cab";function eJ(e){try{return new Date(e).toLocaleString("ko-KR",{timeZone:"Asia/Seoul",year:"2-digit",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}catch(t){return e}}function eZ(){let[e,t]=(0,r.useState)(null);(0,r.useEffect)(()=>{let e=!1;return fetch("/v1/health").then(e=>e.ok?e.json():null).then(s=>{!e&&s&&"number"==typeof s.startedAt&&t({startedAt:s.startedAt,sha:"string"==typeof s.daemonSha?s.daemonSha:""})}).catch(()=>{}),()=>{e=!0}},[]);let s=eG&&"unknown"!==eG?eG:"",n=(null==e?void 0:e.sha)&&"unknown"!==e.sha?e.sha:"",l=!!n&&!!s&&n!==s;return(0,a.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border bg-card p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-base font-semibold",children:"빌드 정보"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"배포 최신 여부 판별 — 새로고침 후 시각/SHA 가 안 바뀌면 옛 캐시."})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("div",{className:"rounded-xl bg-muted/40 p-3",children:[(0,a.jsx)("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"PWA 프론트 빌드"}),(0,a.jsxs)("div",{className:"mt-1 font-mono text-sm",children:[eX?eJ(eX):"—",s?" \xb7 ".concat(s):""]})]}),(0,a.jsxs)("div",{className:"rounded-xl bg-muted/40 p-3",children:[(0,a.jsx)("div",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:"데몬(백엔드) 시작"}),(0,a.jsxs)("div",{className:"mt-1 font-mono text-sm ".concat(l?"text-amber-500":""),children:[e?eJ(new Date(e.startedAt).toISOString()):"…",n?" \xb7 ".concat(n):""]}),l&&(0,a.jsx)("div",{className:"mt-1 text-[11px] text-amber-500",children:"프론트/데몬 SHA 불일치 — 재빌드\xb7재시작 필요"})]})]})]})}var e0=s(11980),e1=s(28725);function e2(){let{read:e=e1.fG,write:t=e1.MQ}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[s,n]=(0,r.useState)(!1),[l,i]=(0,r.useState)(!1);(0,r.useEffect)(()=>{n(e(e0.f4)),i(e(e0.vm))},[e]);let d=e=>e0.Ue.filter(t=>t.visibility===e).map(e=>e.label).join(" \xb7 "),o=(e,s,a)=>{a(s),t(e,s)};return(0,a.jsxs)("section",{className:"space-y-3 rounded-2xl border border-border bg-card p-4","aria-label":"메뉴",children:[(0,a.jsx)("h2",{className:"text-base font-semibold",children:"메뉴"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"메뉴에는 주요 탭만 보입니다. Labs(베타)와 숨긴 탭은 이 기기에서만 켤 수 있고, 숨긴 탭도 주소로는 열립니다."}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm",children:[(0,a.jsx)("input",{type:"checkbox","data-elanous-action":"menu-show-labs",checked:s,onChange:e=>o(e0.f4,e.target.checked,n)}),(0,a.jsxs)("span",{children:["Labs 탭 보기 ",(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",d("labs"),")"]})]})]}),(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm",children:[(0,a.jsx)("input",{type:"checkbox","data-elanous-action":"menu-show-hidden",checked:l,onChange:e=>o(e0.vm,e.target.checked,i)}),(0,a.jsxs)("span",{children:["숨긴 탭 보기 ",(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",d("hidden"),")"]})]})]})]})}let e5=["","claude","gemini","grok","codex"];function e3(){var e,t,s,b,f,g;let{config:N,setConfig:k,client:S,sessionId:C}=(0,n.Q)();(0,r.useEffect)(()=>{if("#bearer-token"!==window.location.hash)return;let e=window.setTimeout(()=>{let e=document.getElementById("bearer-token");null==e||e.scrollIntoView({block:"center"}),null==e||e.focus()},50);return()=>window.clearTimeout(e)},[]);let{theme:P,setTheme:z}=(0,l.D)(),[L,R]=(0,r.useState)({status:"idle"}),[D,$]=(0,r.useState)({status:"idle"}),[O,B]=(0,r.useState)({status:"idle"}),[Y,_]=(0,r.useState)(0),[W,K]=(0,r.useState)({status:"idle"}),[H,X]=(0,r.useState)(0),[Z,et]=(0,r.useState)({status:"idle"}),[ea,er]=(0,r.useState)(0),[el,ed]=(0,r.useState)(()=>({supported:!1,permission:"unknown",cachedId:null,cachedLabel:null})),[eo,ec]=(0,r.useState)(!1),[eu,em]=(0,r.useState)(null);(0,r.useEffect)(()=>{ed(j())},[]);let eh=(0,r.useCallback)(()=>{ed(j())},[]),ep=(0,r.useCallback)(async()=>{ec(!0),em(null);try{let e=await v({baseUrl:N.baseUrl,...N.token?{token:N.token}:{}});"enabled"===e.status?o.oR.success("Notifications enabled"):"permission-denied"===e.status?o.oR.error("Permission denied — enable in browser/iOS settings"):"unsupported"===e.status?o.oR.error("Push not supported: ".concat(e.reason)):(em(e.reason),o.oR.error("Enable failed: ".concat(e.reason)))}finally{ec(!1),eh()}},[N.baseUrl,N.token,eh]),ef=(0,r.useCallback)(async()=>{ec(!0);try{await y({baseUrl:N.baseUrl,...N.token?{token:N.token}:{}}),o.oR.success("Notifications disabled")}finally{ec(!1),eh()}},[N.baseUrl,N.token,eh]),ej=(0,r.useCallback)(async()=>{if(N.baseUrl)try{var e,t;let s=await fetch("".concat(N.baseUrl.replace(/\/$/,""),"/v1/push/test"),{method:"POST",...N.token?{headers:{authorization:"Bearer ".concat(N.token)}}:{}});if(!s.ok)return void o.oR.error("Test failed: HTTP ".concat(s.status));let a=await s.json();o.oR.success("Test sent: ".concat(null!=(e=a.delivered)?e:0," / ").concat(null!=(t=a.attempted)?t:0," delivered"))}catch(e){o.oR.error("Test failed: ".concat(e instanceof Error?e.message:String(e)))}},[N.baseUrl,N.token]),[ev,ey]=(0,r.useState)(""),[eN,ek]=(0,r.useState)(""),[ew,eS]=(0,r.useState)(""),[eC,eE]=(0,r.useState)(null),[eM,eP]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(!N.baseUrl)return void R({status:"idle"});let e=!1,t=new AbortController,s=Date.now();return R({status:"loading"}),(async()=>{try{let a=await fetch("".concat(N.baseUrl.replace(/\/$/,""),"/v1/health"),{signal:t.signal});if(e)return;let r=Date.now()-s;if(!a.ok)return void R({status:"error",error:"HTTP ".concat(a.status),latencyMs:r,checkedAt:Date.now()});let n=await a.json();R({status:n.ok?"ok":"error",..."number"==typeof n.sessions?{sessions:n.sessions}:{},latencyMs:r,checkedAt:Date.now(),...n.ok?{}:{error:"health.ok=false"}})}catch(t){if(e)return;R({status:"error",error:t instanceof Error?t.message:String(t),latencyMs:Date.now()-s,checkedAt:Date.now()})}})(),()=>{e=!0,t.abort()}},[N.baseUrl]),(0,r.useEffect)(()=>{if("ok"!==L.status||!N.baseUrl)return void $({status:"idle"});let e=!1,t=new AbortController;return $({status:"loading"}),(async()=>{try{var s,a;let r=await fetch("".concat(N.baseUrl.replace(/\/$/,""),"/v1/tools"),{signal:t.signal,credentials:"same-origin",mode:"same-origin",...N.token?{headers:{authorization:"Bearer ".concat(N.token)}}:{}});if(e)return;if(!r.ok)return void $({status:"error",error:"HTTP ".concat(r.status)});let n=await r.json(),l=(null!=(s=n.specs)?s:[]).map(e=>{var t;return"string"==typeof e?{name:e,description:""}:{name:e.name,description:null!=(t=e.description)?t:""}});$({status:"ok",kind:null!=(a=n.kind)?a:"none",specs:l})}catch(t){if(e)return;$({status:"error",error:t instanceof Error?t.message:String(t)})}})(),()=>{e=!0,t.abort()}},[L.status,L.checkedAt,N.baseUrl,N.token]),(0,r.useEffect)(()=>{if("ok"!==L.status||!N.baseUrl)return void B({status:"idle"});let e=!1,t=new AbortController;return B({status:"loading"}),(async()=>{try{var s;let a=await fetch("".concat(N.baseUrl.replace(/\/$/,""),"/v1/diag/auth-trace"),{signal:t.signal,credentials:"same-origin",mode:"same-origin",...N.token?{headers:{authorization:"Bearer ".concat(N.token)}}:{}});if(e)return;if(!a.ok)return void B({status:"error",error:"HTTP ".concat(a.status)});let r=await a.json();B({status:"ok",entries:null!=(s=r.entries)?s:[],fetchedAt:Date.now()})}catch(t){if(e)return;B({status:"error",error:t instanceof Error?t.message:String(t)})}})(),()=>{e=!0,t.abort()}},[L.status,L.checkedAt,N.baseUrl,N.token,Y]),(0,r.useEffect)(()=>{if("ok"!==L.status||!N.baseUrl||!C)return void K({status:"idle"});let e=!1,t=null,s=new AbortController;return K({status:"loading"}),(async()=>{try{let a="".concat(N.baseUrl.replace(/\/$/,""),"/v1/turns/last/screenshot?session=").concat(encodeURIComponent(C)),r=await fetch(a,{signal:s.signal,...N.token?{headers:{authorization:"Bearer ".concat(N.token)}}:{}});if(e)return;if(404===r.status)return void K({status:"none",fetchedAt:Date.now()});if(!r.ok)return void K({status:"error",error:"HTTP ".concat(r.status)});let n=await r.blob();if(e)return;t=URL.createObjectURL(n),K({status:"ok",objectUrl:t,fetchedAt:Date.now()})}catch(t){if(e)return;K({status:"error",error:t instanceof Error?t.message:String(t)})}})(),()=>{e=!0,s.abort(),t&&URL.revokeObjectURL(t)}},[L.status,N.baseUrl,N.token,C,H]),(0,r.useEffect)(()=>{if("ok"!==L.status||!N.baseUrl)return void et({status:"idle"});let e=!1;return et(e=>({...e,status:"loading"})),(async()=>{try{let t=await x(S);if(e)return;et(e=>({status:"ok",bindings:t.bindings,...e.secretRef?{secretRef:e.secretRef}:{},...e.pendingSecretValue?{pendingSecretValue:e.pendingSecretValue}:{}}))}catch(s){if(e)return;let t=s instanceof Error?s.message:String(s);t.includes("404")||t.includes("Not Found")?et({status:"nexus-missing"}):et({status:"error",error:t})}})(),()=>{e=!0}},[S,L.status,N.baseUrl,ea]);let eA=(0,r.useCallback)(()=>{er(e=>e+1)},[]),ez=(0,r.useCallback)(async()=>{eP(!0);try{let e=function(){let e=new Uint8Array(16);return crypto.getRandomValues(e),Array.from(e,e=>e.toString(16).padStart(2,"0")).join("")}(),t=await m(S,e);et(s=>({...s,secretRef:t.ref,pendingSecretValue:e})),o.oR.success("Pushcut secret rotated \xb7 copy + paste into iPhone Shortcut")}catch(t){let e=t instanceof Error?t.message:String(t);o.oR.error("secret rotate failed: ".concat(e))}finally{eP(!1)}},[S]),eT=(0,r.useCallback)(async()=>{if(!ev.trim())return void o.oR.error("token required");let e=eN.trim()||C;if(!e)return void o.oR.error("sessionId required (auto-fill: open this session in /term first)");eE("__new__");try{await h(S,{token:ev.trim(),sessionId:e,...ew.trim()?{label:ew.trim()}:{}}),o.oR.success("binding saved"),ey(""),ek(""),eS(""),eA()}catch(e){o.oR.error("binding save failed: ".concat(e instanceof Error?e.message:String(e)))}finally{eE(null)}},[S,ev,eN,ew,C,eA]),eL=(0,r.useCallback)(async e=>{eE(e);try{await p(S,e),o.oR.success("binding deleted: ".concat(e.slice(0,8),"…")),eA()}catch(e){o.oR.error("delete failed: ".concat(e instanceof Error?e.message:String(e)))}finally{eE(null)}},[S,eA]),eR=e=>"number"!=typeof e?"—":"".concat(e," ms"),eD=e=>{if(!e)return"";let t=Math.floor((Date.now()-e)/1e3);return t<5?"just now":t<60?"".concat(t,"s ago"):"".concat(Math.floor(t/60),"m ago")};return(0,a.jsxs)("div",{className:"mx-auto max-w-2xl space-y-8 p-6",children:[(0,a.jsx)(eW,{}),(0,a.jsxs)("header",{className:"space-y-1",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Settings"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Daemon connection, provider default, theme. Stored in localStorage."})]}),(0,a.jsx)(A,{}),(0,a.jsx)(w,{}),(0,a.jsx)(U.Q,{}),(0,a.jsx)(E.lN,{}),(0,a.jsx)(M.Q,{}),(0,a.jsx)("div",{id:"channels",className:"scroll-mt-8","aria-hidden":!0}),(0,a.jsx)(Q,{}),(0,a.jsx)(F.W,{}),(0,a.jsx)("div",{id:"advanced",className:"scroll-mt-8","aria-hidden":!0}),(0,a.jsx)(eB,{}),(0,a.jsx)(en,{}),(0,a.jsx)(V,{}),(0,a.jsx)(G,{}),(0,a.jsx)(J,{}),(0,a.jsx)(q,{}),(0,a.jsx)(ee,{}),(0,a.jsx)(es,{}),(0,a.jsx)("div",{id:"voice",className:"scroll-mt-8","aria-hidden":!0}),(0,a.jsx)(ei,{}),(0,a.jsx)(eI,{}),(0,a.jsx)(ex,{}),(0,a.jsx)(eb,{}),(0,a.jsx)(eg,{}),(0,a.jsx)(eU,{}),(0,a.jsx)(eV,{}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"데몬 연결"}),(0,a.jsxs)("label",{className:"block space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Base URL"}),(0,a.jsx)(d.p,{value:N.baseUrl,placeholder:"http://localhost:31415",onChange:e=>k({baseUrl:e.target.value})})]}),(0,a.jsxs)("label",{className:"block space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"연결 토큰"}),(0,a.jsx)(d.p,{id:"bearer-token",type:"password",value:N.token,placeholder:"다른 기기에서 만든 연결 토큰을 붙여 넣으세요",onChange:e=>k({token:e.target.value})})]}),(0,a.jsxs)("label",{className:"block space-y-1",children:[(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"Default provider"}),(0,a.jsx)("select",{value:N.provider,className:"flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-xs focus:outline-none focus:ring-2 focus:ring-ring",onChange:e=>k({provider:e.target.value}),children:e5.map(e=>(0,a.jsx)("option",{value:e,children:e||"(none — server default)"},e))})]})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Daemon health"}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>{k({baseUrl:N.baseUrl})},disabled:!N.baseUrl,children:"Recheck"})]}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs",children:["idle"===L.status&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Set Base URL above to probe."}),"loading"===L.status&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Probing…"}),"ok"===L.status&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-emerald-500","aria-hidden":!0}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:"Reachable"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:eR(L.latencyMs)}),(0,a.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:eD(L.checkedAt)})]}),"number"==typeof L.sessions&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Active sessions: ",(0,a.jsx)("span",{className:"font-mono text-foreground",children:L.sessions})]})]}),"error"===L.status&&(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block h-2 w-2 rounded-full bg-rose-500","aria-hidden":!0}),(0,a.jsx)("span",{className:"font-medium text-rose-600 dark:text-rose-400",children:"Unreachable"}),(0,a.jsx)("span",{className:"text-muted-foreground",children:eR(L.latencyMs)}),(0,a.jsx)("span",{className:"ml-auto text-[10px] text-muted-foreground",children:eD(L.checkedAt)})]}),(0,a.jsx)("p",{className:"break-all font-mono text-[11px] text-muted-foreground",children:L.error}),(0,a.jsxs)("p",{className:"text-[11px] text-muted-foreground",children:["Verify Base URL \xb7 daemon running (",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"elanous serve --status"}),") \xb7 network reachable from this device."]})]})]})]}),(0,a.jsx)("div",{id:"tools",className:"scroll-mt-8","aria-hidden":!0}),("ok"===D.status||"error"===D.status)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"LLM tool surface"}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs",children:["ok"===D.status&&"none"===D.kind&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Tools 미설정 — `elanous serve --tools readonly` 또는 `webterm` 으로 활성화."}),"ok"===D.status&&D.kind&&"none"!==D.kind&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block h-2 w-2 rounded-full ".concat("webterm"===D.kind?"bg-amber-500":"bg-emerald-500"),"aria-hidden":!0}),(0,a.jsx)("span",{className:"font-medium text-foreground",children:"kind:"}),(0,a.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono",children:D.kind}),"webterm"===D.kind&&(0,a.jsx)("span",{className:"text-[10px] text-amber-600 dark:text-amber-400",children:"(write-capable)"})]}),D.specs&&D.specs.length>0&&(0,a.jsx)("ul",{className:"flex flex-wrap gap-1",children:D.specs.map(e=>(0,a.jsx)("li",{title:e.description,className:"rounded border border-border bg-muted/50 px-1.5 py-0.5 font-mono text-[10px]",children:e.name},e.name))})]}),"error"===D.status&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:[(0,a.jsx)("span",{className:"text-rose-500",children:"tool surface 조회 실패"})," \xb7 ",D.error]})]})]}),("ok"===O.status||"error"===O.status)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Auth trace"}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>_(e=>e+1),children:"Refresh"})]}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs",children:["error"===O.status&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:[(0,a.jsx)("span",{className:"text-rose-500",children:"auth-trace 조회 실패"})," \xb7 ",O.error]}),"ok"===O.status&&(null!=(b=null==(e=O.entries)?void 0:e.length)?b:0)===0&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"아직 auth 결정 없음. /v1/* 호출이 한 번도 없었다는 뜻."}),"ok"===O.status&&O.entries&&O.entries.length>0&&(0,a.jsx)("div",{className:"max-h-64 overflow-auto font-mono text-[10px]",children:(0,a.jsxs)("table",{className:"w-full",children:[(0,a.jsx)("thead",{className:"sticky top-0 bg-card text-muted-foreground",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-1 text-left",children:"time"}),(0,a.jsx)("th",{className:"px-1 text-left",children:"path"}),(0,a.jsx)("th",{className:"px-1 text-left",children:"ok"}),(0,a.jsx)("th",{className:"px-1 text-left",children:"reason"}),(0,a.jsx)("th",{className:"px-1 text-left",children:"sfs"}),(0,a.jsx)("th",{className:"px-1 text-left",children:"origin"}),(0,a.jsx)("th",{className:"px-1 text-left",children:"host"})]})}),(0,a.jsx)("tbody",{children:O.entries.slice().reverse().slice(0,30).map((e,t)=>{var s,r,n;return(0,a.jsxs)("tr",{className:"border-t border-border/50",children:[(0,a.jsx)("td",{className:"px-1 whitespace-nowrap",children:new Date(e.ts).toLocaleTimeString()}),(0,a.jsx)("td",{className:"px-1 truncate max-w-[120px]",children:e.path}),(0,a.jsx)("td",{className:"px-1 ".concat(e.ok?"text-emerald-500":"text-rose-500"),children:e.ok?"Y":"N"}),(0,a.jsx)("td",{className:"px-1 truncate max-w-[140px]",children:e.reason}),(0,a.jsx)("td",{className:"px-1 truncate max-w-[80px]",children:null!=(s=e.sfs)?s:"∅"}),(0,a.jsx)("td",{className:"px-1 truncate max-w-[140px]",children:null!=(r=e.origin)?r:"∅"}),(0,a.jsx)("td",{className:"px-1 truncate max-w-[140px]",children:null!=(n=e.host)?n:"∅"})]},"".concat(e.ts,"-").concat(t))})})]})})]})]}),C&&"webterm"===D.kind&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Last screenshot"}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:()=>X(e=>e+1),disabled:"loading"===W.status||!N.baseUrl,children:"Refresh"})]}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs",children:["loading"===W.status&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Probing…"}),"none"===W.status&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["아직 agent 가 screenshot 을 호출한 적 없음. ",(0,a.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5",children:"WebTerminalScreenshot"})," tool 실행 후 Refresh."]}),"ok"===W.status&&W.objectUrl&&(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("p",{className:"text-muted-foreground",children:["Most recent ",(0,a.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5",children:"tool_result"})," image in this session."]}),(0,a.jsx)("img",{src:W.objectUrl,alt:"Last screenshot",className:"max-w-full rounded border border-border bg-black"})]}),"error"===W.status&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:[(0,a.jsx)("span",{className:"text-rose-500",children:"screenshot 조회 실패"})," \xb7 ",W.error]})]})]}),("idle"!==Z.status||"ok"===L.status)&&(0,a.jsxs)("section",{className:"space-y-3","data-testid":"pushcut-section",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Pushcut webhook"}),(0,a.jsx)(i.$,{variant:"outline",size:"sm",onClick:eA,disabled:"loading"===Z.status||!N.baseUrl,"data-testid":"pushcut-refresh",children:"Refresh"})]}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs space-y-3",children:["loading"===Z.status&&(0,a.jsx)("p",{className:"text-muted-foreground",children:"Probing…"}),"nexus-missing"===Z.status&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:["NEXUS endpoints not reachable. ",(0,a.jsx)("code",{className:"rounded bg-muted px-1.5 py-0.5",children:"elanous nexus"})," 로 띄우면 secret + binding 관리가 활성됩니다.",(0,a.jsxs)("span",{className:"block mt-1 text-[10px]",children:["(현재 daemon 만 단독 실행 중인 경우 — 본 섹션은 NEXUS HTTP 의 ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"/v1/registry/bindings"})," + ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"/v1/config/secrets"})," 의존)"]})]}),"error"===Z.status&&(0,a.jsxs)("p",{className:"text-muted-foreground",children:[(0,a.jsx)("span",{className:"text-rose-500",children:"조회 실패"})," \xb7 ",Z.error]}),("ok"===Z.status||Z.secretRef)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-medium",children:"HMAC secret"}),(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>{ez()},disabled:eM||!N.baseUrl,"data-testid":"pushcut-rotate-secret",children:eM?"Rotating…":"Rotate"})]}),Z.secretRef&&(0,a.jsxs)("p",{className:"font-mono text-[10px] text-muted-foreground",children:["ref: ",(0,a.jsx)("span",{className:"text-foreground",children:Z.secretRef})," \xb7 id: ",(0,a.jsx)("span",{className:"text-foreground",children:c})]}),Z.pendingSecretValue&&(0,a.jsxs)("div",{className:"rounded border border-amber-300 bg-amber-50 px-2 py-1.5 dark:border-amber-700 dark:bg-amber-950",children:[(0,a.jsx)("p",{className:"text-[10px] font-semibold text-amber-700 dark:text-amber-200",children:"Copy now — only shown once"}),(0,a.jsx)("code",{className:"block break-all font-mono text-[11px] text-amber-900 dark:text-amber-100 select-all","data-testid":"pushcut-secret-value",children:Z.pendingSecretValue}),(0,a.jsxs)("p",{className:"mt-1 text-[10px] text-amber-700 dark:text-amber-300",children:["Paste into iPhone “elanous-camera” Pushcut Shortcut Header ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:"X-Pushcut-Sig"})," recipe."]})]})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("span",{className:"font-medium",children:"Bindings (token → session)"}),(0,a.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:[null!=(f=null==(t=Z.bindings)?void 0:t.length)?f:0," active"]})]}),(null!=(g=null==(s=Z.bindings)?void 0:s.length)?g:0)===0&&"ok"===Z.status&&(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground",children:"No bindings yet. Add one below — the daemon will route Pushcut webhooks for that token to the chosen session."}),Z.bindings&&Z.bindings.length>0&&(0,a.jsx)("ul",{className:"space-y-1","data-testid":"pushcut-bindings-list",children:Z.bindings.map(e=>{var t,s;return(0,a.jsxs)("li",{className:"flex items-center gap-2 rounded border border-border bg-muted/30 px-2 py-1",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0 space-y-0.5",children:[(0,a.jsx)("div",{className:"font-mono text-[11px] font-medium truncate",children:null!=(t=e.label)?t:"(no label)"}),(0,a.jsxs)("div",{className:"font-mono text-[10px] text-muted-foreground truncate",children:["token: ",e.key.length>16?"".concat(e.key.slice(0,8),"…").concat(e.key.slice(-4)):e.key]}),(0,a.jsxs)("div",{className:"font-mono text-[10px] text-muted-foreground truncate",children:["session: ",null!=(s=e.sessionId)?s:"(unset)"]})]}),(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>{eL(e.key)},disabled:eC===e.key,"data-testid":"pushcut-delete-".concat(e.key),children:eC===e.key?"Deleting…":"Delete"})]},e.key)})}),(0,a.jsxs)("div",{className:"space-y-1.5 rounded border border-dashed border-border p-2 mt-2",children:[(0,a.jsx)("p",{className:"text-[10px] font-medium text-muted-foreground",children:"Add binding"}),(0,a.jsx)(d.p,{value:ev,placeholder:"token (webhook URL key)",onChange:e=>ey(e.target.value),"data-testid":"pushcut-add-token",className:"text-[11px]"}),(0,a.jsx)(d.p,{value:eN,placeholder:C?"sessionId (default: ".concat(C.slice(0,12),"…)"):"sessionId",onChange:e=>ek(e.target.value),"data-testid":"pushcut-add-session",className:"text-[11px]"}),(0,a.jsx)(d.p,{value:ew,placeholder:"label (e.g. iPhone 15)",onChange:e=>eS(e.target.value),"data-testid":"pushcut-add-label",className:"text-[11px]"}),(0,a.jsx)(i.$,{size:"sm",onClick:()=>{eT()},disabled:"__new__"===eC||!ev.trim(),"data-testid":"pushcut-add-submit",children:"__new__"===eC?"Saving…":"Add"})]})]})]})]}),(0,a.jsxs)("p",{className:"text-[10px] text-muted-foreground",children:["Channel: ",(0,a.jsx)("code",{className:"rounded bg-muted px-1",children:u})," \xb7 powered by NEXUS subsystem registry (PR τ #1698) + secret backend (PR σ #1696). Webhook receiver lands in a follow-up daemon-side PR."]})]}),(0,a.jsx)("div",{id:"ios",className:"scroll-mt-8","aria-hidden":!0}),el.supported&&(0,a.jsxs)("section",{className:"space-y-3","data-testid":"webpush-section",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Notifications"}),(0,a.jsxs)("div",{className:"rounded-md border border-border bg-card p-3 text-xs space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"inline-block h-2 w-2 rounded-full ".concat(el.cachedId?"bg-emerald-500":"denied"===el.permission?"bg-rose-500":"bg-muted-foreground"),"aria-hidden":!0}),(0,a.jsx)("span",{className:"font-medium",children:el.cachedId?"Subscribed":"denied"===el.permission?"Permission denied":"Not subscribed"}),el.cachedLabel&&(0,a.jsx)("span",{className:"ml-auto font-mono text-[10px] text-muted-foreground",children:el.cachedLabel})]}),"denied"===el.permission&&(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"Browser/iOS denied notification permission. Enable in Settings → Safari → Notifications, then reload."}),eu&&(0,a.jsx)("p",{className:"text-[10px] text-rose-500 break-all","data-testid":"webpush-error",children:eu}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[!el.cachedId&&(0,a.jsx)(i.$,{size:"sm",onClick:()=>{ep()},disabled:eo||!N.baseUrl||"denied"===el.permission,"data-testid":"webpush-enable",children:eo?"Enabling…":"Enable notifications"}),el.cachedId&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>{ef()},disabled:eo,"data-testid":"webpush-disable",children:eo?"Disabling…":"Disable"}),(0,a.jsx)(i.$,{size:"sm",variant:"outline",onClick:()=>{ej()},disabled:eo||!N.baseUrl,"data-testid":"webpush-test",children:"Send test"})]})]}),(0,a.jsx)("p",{className:"text-[10px] text-muted-foreground",children:"Push 알림은 PWA 가 닫혀 있어도 도착합니다 — agent turn 완료 \xb7 녹화 종료 등. iOS 16.4+ home-screen installed PWA 만 작동 (Pushcut 가 fallback)."})]})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Session"}),(0,a.jsx)("div",{className:"rounded-md border border-border bg-card px-3 py-2 font-mono text-xs",children:C||"(no session yet)"}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["A new session id is allocated on first load. Use Chat’s",(0,a.jsx)("code",{className:"mx-1 rounded bg-muted px-1.5 py-0.5",children:":fork"}),"meta-command to start fresh once U-3 ships."]})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h2",{className:"text-sm font-medium",children:"Theme"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:l.z.map(e=>(0,a.jsx)(i.$,{variant:e===P?"default":"outline",size:"sm",onClick:()=>z(e),children:e},e))})]}),(0,a.jsx)(eH,{}),(0,a.jsx)(I,{}),(0,a.jsx)(T,{}),(0,a.jsx)(e2,{}),(0,a.jsx)(eZ,{}),(0,a.jsx)(i.$,{onClick:()=>o.oR.success("Settings saved"),children:"Saved"})]})}},67089:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(89117).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},76582:(e,t,s)=>{s.d(t,{W:()=>o});var a=s(41121),r=s(91269),n=s(72030),l=s(59062),i=s(91514);let d=["telegram","discord"];function o(){let{client:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,i.Qj)(),s=null!=e?e:t,[o,c]=(0,r.useState)([]),[u,m]=(0,r.useState)({}),[x,h]=(0,r.useState)({}),[p,b]=(0,r.useState)({}),[f,g]=(0,r.useState)(null),[j,v]=(0,r.useState)({}),[y,N]=(0,r.useState)("");(0,r.useEffect)(()=>{if(!s)return;let e=!1;return s.getChannelBots().then(t=>{let{platforms:s}=t;e||(c(s),h(e=>{let t={...e};for(let e of s)Object.hasOwn(t,e.platform)||(t[e.platform]=e.allowedUsers.join(", "));return t}))}).catch(()=>{e||N("봇 상태를 불러오지 못했습니다.")}),()=>{e=!0}},[s]);let k=async e=>{var t;if(!s)return;g(e),N("");let a=null==(t=u[e])?void 0:t.trim(),r=Object.hasOwn(x,e)?x[e].split(",").map(e=>e.trim()).filter(Boolean):void 0;m(t=>({...t,[e]:""}));try{let t=await s.setChannelBot({platform:e,...a?{token:a}:{},...void 0!==r?{allowedUsers:r}:{}});t.botName&&b(s=>({...s,[e]:t.botName})),v(s=>({...s,[e]:t.restartNeeded}));try{let e=await s.getChannelBots();c(e.platforms)}catch(e){N("저장됐지만 봇 상태를 다시 불러오지 못했습니다.")}}catch(t){N("".concat(e," 저장에 실패했습니다. 토큰과 허용 사용자 ID를 확인하세요."))}finally{g(null)}};return s?(0,a.jsxs)("section",{className:"space-y-4 rounded border border-border bg-card p-4","data-testid":"channel-bot-setup-card",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"봇 연결"}),d.map(e=>{var t,s;let r=o.find(t=>t.platform===e);return(0,a.jsxs)("div",{className:"space-y-2 border-t border-border pt-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium capitalize",children:e}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:(null==r?void 0:r.configured)?"연결됨 (".concat(r.source,")"):"미연결"}),p[e]&&(0,a.jsxs)("p",{className:"text-xs",children:["봇 이름: ",p[e]]}),(0,a.jsx)("label",{htmlFor:"".concat(e,"-bot-token"),className:"block text-xs",children:"봇 토큰"}),(0,a.jsx)(l.p,{id:"".concat(e,"-bot-token"),type:"password",autoComplete:"off",value:null!=(t=u[e])?t:"",onChange:t=>m(s=>({...s,[e]:t.target.value}))}),(0,a.jsx)("label",{htmlFor:"".concat(e,"-allowed-users"),className:"block text-xs",children:"허용 사용자 ID (쉼표로 구분)"}),(0,a.jsx)(l.p,{id:"".concat(e,"-allowed-users"),value:null!=(s=x[e])?s:"",onChange:t=>h(s=>({...s,[e]:t.target.value}))}),(0,a.jsx)(n.$,{type:"button",size:"sm",disabled:null!==f,onClick:()=>void k(e),children:"확인하고 저장"}),j[e]&&(0,a.jsx)("p",{role:"status",className:"text-xs",children:"봇을 재시작해야 반영됩니다"})]},e)}),y&&(0,a.jsx)("p",{role:"alert",className:"text-xs text-destructive",children:y})]}):null}},82736:(e,t,s)=>{s.d(t,{GZ:()=>i,_n:()=>u,gu:()=>o,mB:()=>d,sY:()=>c,u9:()=>m});let a="elanous.showroom.intentPanel.collapsed",r="elanous.showroom.intentPanel.displayMode",n="fixed",l=new Set(["fixed","popup","off"]);function i(){try{return"true"===window.localStorage.getItem(a)}catch(e){return!1}}function d(e){try{e?window.localStorage.setItem(a,"true"):window.localStorage.removeItem(a),window.dispatchEvent(new StorageEvent("storage",{key:a,newValue:e?"true":null}))}catch(e){}}function o(e){let t=t=>{(t.key===a||null===t.key)&&e(i())};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}function c(){try{let e=window.localStorage.getItem(r);if(e&&l.has(e))return e;return n}catch(e){return n}}function u(e){try{e===n?window.localStorage.removeItem(r):window.localStorage.setItem(r,e),window.dispatchEvent(new StorageEvent("storage",{key:r,newValue:e===n?null:e}))}catch(e){}}function m(e){let t=t=>{(t.key===r||null===t.key)&&e(c())};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}}},94936:(e,t,s)=>{s.d(t,{D:()=>h,ThemeProvider:()=>x,z:()=>i});var a=s(41121),r=s(91269),n=s(51215),l=s(91514);let i=["catppuccin-mocha","mocha-pastel-accent","catppuccin-latte","rose-pine-dawn","nord-light","elanous-pastel-default"],d="elanous.pwa.theme",o="dashboard.theme.active",c="catppuccin-mocha";function u(e){return"string"==typeof e&&i.includes(e)}let m=(0,r.createContext)(null);function x(e){let{children:t}=e,s=(0,l.Qj)(),[x,h]=(0,r.useState)(c),p=(0,r.useRef)(0),b=(0,r.useCallback)(e=>{h(e),document.documentElement.dataset.theme=e},[]);(0,r.useEffect)(()=>{let e=localStorage.getItem(d),t=u(e)?e:c;b(t),(0,n.cY)("webterm.provider.theme.init",{theme:t})},[b]),(0,r.useEffect)(()=>{if(!s)return;let e=!0,t=p.current;return s.getSwitch(o).then(s=>{let{switch:a}=s;e&&t===p.current&&u(a.value)&&(b(a.value),localStorage.setItem(d,a.value))}).catch(()=>void 0),()=>{e=!1}},[b,s]);let f=(0,r.useCallback)(e=>{u(e)&&(p.current+=1,b(e),localStorage.setItem(d,e),(0,n.cY)("webterm.provider.theme.set",{theme:e}),null==s||s.putSwitch(o,{value:e}).catch(()=>void 0))},[b,s]);return(0,a.jsx)(m.Provider,{value:{theme:x,setTheme:f,themes:i},children:t})}function h(){let e=(0,r.useContext)(m);if(!e)throw Error("useTheme must be used inside <ThemeProvider>");return e}},99608:(e,t,s)=>{s.d(t,{A:()=>a});let a=(0,s(89117).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[920],{10283:(t,e,s)=>{s.d(e,{II:()=>l,cc:()=>c,v_:()=>h});var i=s(71761),r=s(98936),n=s(52845),a=s(68202),o=s(98883);function u(t){return Math.min(1e3*2**t,3e4)}function h(t){return(t??"online")!=="online"||r.t.isOnline()}var c=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function l(t){let e,s=!1,l=0,d=(0,n.T)(),f=()=>i.m.isFocused()&&("always"===t.networkMode||r.t.isOnline())&&t.canRun(),p=()=>h(t.networkMode)&&t.canRun(),y=t=>{"pending"===d.status&&(e?.(),d.resolve(t))},m=t=>{"pending"===d.status&&(e?.(),d.reject(t))},v=()=>new Promise(s=>{e=t=>{("pending"!==d.status||f())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,"pending"===d.status&&t.onContinue?.()}),b=()=>{let e;if("pending"!==d.status)return;let i=0===l?t.initialPromise:void 0;try{e=i??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(y).catch(e=>{if("pending"!==d.status)return;let i=t.retry??3*!a.H.isServer(),r=t.retryDelay??u,n="function"==typeof r?r(l,e):r,h=!0===i||"number"==typeof i&&l<i||"function"==typeof i&&i(l,e);if(s||!h)return void m(e);l++,t.onFail?.(l,e),(0,o.yy)(n).then(()=>f()?void 0:v()).then(()=>{s?m(e):b()})})};return{promise:d,status:()=>d.status,cancel:e=>{if("pending"===d.status){let s=new c(e);m(s),t.onCancel?.(s)}},continue:()=>(e?.(),d),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:p,start:()=>(p()?b():v().then(b),d)}}},19855:(t,e,s)=>{s.d(e,{E:()=>f});var i=s(98883),r=s(96917),n=s(83026),a=s(37963),o=class extends a.Q{constructor(t={}){super(),this.config=t,this.#t=new Map}#t;build(t,e,s){let n=e.queryKey,a=e.queryHash??(0,i.F$)(n,e),o=this.get(a);return o||(o=new r.X({client:t,queryKey:n,queryHash:a,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(n)}),this.add(o)),o}add(t){this.#t.has(t.queryHash)||(this.#t.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){let e=this.#t.get(t.queryHash);e&&(t.destroy(),e===t&&this.#t.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){n.jG.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#t.get(t)}getAll(){return[...this.#t.values()]}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.MK)(e,t))}findAll(t={}){let e=this.getAll();return Object.keys(t).length>0?e.filter(e=>(0,i.MK)(t,e)):e}notify(t){n.jG.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){n.jG.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){n.jG.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},u=s(95817),h=class extends a.Q{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#s=new Map,this.#i=0}#e;#s;#i;build(t,e,s){let i=new u.s({client:t,mutationCache:this,mutationId:++this.#i,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#e.add(t);let e=c(t);if("string"==typeof e){let s=this.#s.get(e);s?s.push(t):this.#s.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){let e=c(t);if("string"==typeof e){let s=this.#s.get(e);if(s)if(s.length>1){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#s.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){let e=c(t);if("string"!=typeof e)return!0;{let s=this.#s.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}}runNext(t){let e=c(t);if("string"!=typeof e)return Promise.resolve();{let s=this.#s.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}}clear(){n.jG.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#s.clear()})}getAll(){return Array.from(this.#e)}find(t){let e={exact:!0,...t};return this.getAll().find(t=>(0,i.nJ)(e,t))}findAll(t={}){return this.getAll().filter(e=>(0,i.nJ)(t,e))}notify(t){n.jG.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){let t=this.getAll().filter(t=>t.state.isPaused);return n.jG.batch(()=>Promise.all(t.map(t=>t.continue().catch(i.lQ))))}};function c(t){return t.options.scope?.id}var l=s(71761),d=s(98936),f=class{#r;#n;#a;#o;#u;#h;#c;#l;constructor(t={}){this.#r=t.queryCache||new o,this.#n=t.mutationCache||new h,this.#a=t.defaultOptions||{},this.#o=new Map,this.#u=new Map,this.#h=0}mount(){this.#h++,1===this.#h&&(this.#c=l.m.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onFocus())}),this.#l=d.t.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#r.onOnline())}))}unmount(){this.#h--,0===this.#h&&(this.#c?.(),this.#c=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#r.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#n.findAll({...t,status:"pending"}).length}getQueryData(t){let e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state.data}ensureQueryData(t){let e=this.defaultQueryOptions(t),s=this.#r.build(this,e),r=s.state.data;return void 0===r?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime((0,i.d2)(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return this.#r.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){let r=this.defaultQueryOptions({queryKey:t}),n=this.#r.get(r.queryHash),a=n?.state.data,o=(0,i.Zw)(e,a);if(void 0!==o)return this.#r.build(this,r).setData(o,{...s,manual:!0})}setQueriesData(t,e,s){return n.jG.batch(()=>this.#r.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){let e=this.defaultQueryOptions({queryKey:t});return this.#r.get(e.queryHash)?.state}removeQueries(t){let e=this.#r;n.jG.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){let s=this.#r;return n.jG.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){let s={revert:!0,...e};return Promise.all(n.jG.batch(()=>this.#r.findAll(t).map(t=>t.cancel(s)))).then(i.lQ).catch(i.lQ)}invalidateQueries(t,e={}){return n.jG.batch(()=>(this.#r.findAll(t).forEach(t=>{t.invalidate()}),t?.refetchType==="none")?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e))}refetchQueries(t,e={}){let s={...e,cancelRefetch:e.cancelRefetch??!0};return Promise.all(n.jG.batch(()=>this.#r.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(i.lQ)),"paused"===t.state.fetchStatus?Promise.resolve():e}))).then(i.lQ)}fetchQuery(t){let e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);let s=this.#r.build(this,e);return s.isStaleByTime((0,i.d2)(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(i.lQ).catch(i.lQ)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(i.lQ).catch(i.lQ)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return d.t.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#r}getMutationCache(){return this.#n}getDefaultOptions(){return this.#a}setDefaultOptions(t){this.#a=t}setQueryDefaults(t,e){this.#o.set((0,i.EN)(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){let e=[...this.#o.values()],s={};return e.forEach(e=>{(0,i.Cp)(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#u.set((0,i.EN)(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){let e=[...this.#u.values()],s={};return e.forEach(e=>{(0,i.Cp)(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;let e={...this.#a.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=(0,i.F$)(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===i.hT&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#a.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#r.clear(),this.#n.clear()}}},24818:(t,e,s)=>{s.d(e,{Ht:()=>o,jE:()=>a});var i=s(91269),r=s(41121),n=i.createContext(void 0),a=t=>{let e=i.useContext(n);if(t)return t;if(!e)throw Error("No QueryClient set, use QueryClientProvider to set one");return e},o=t=>{let{client:e,children:s}=t;return i.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(n.Provider,{value:e,children:s})}},33800:(t,e,s)=>{s.d(e,{Zq:()=>n,zs:()=>r});var i={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},r=new class{#d=i;#f=!1;setTimeoutProvider(t){this.#d=t}setTimeout(t,e){return this.#d.setTimeout(t,e)}clearTimeout(t){this.#d.clearTimeout(t)}setInterval(t,e){return this.#d.setInterval(t,e)}clearInterval(t){this.#d.clearInterval(t)}};function n(t){setTimeout(t,0)}},37963:(t,e,s)=>{s.d(e,{Q:()=>i});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},52845:(t,e,s)=>{s.d(e,{T:()=>i});function i(){let t,e,s=new Promise((s,i)=>{t=s,e=i});function i(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},s.reject=t=>{i({status:"rejected",reason:t}),e(t)},s}},68202:(t,e,s)=>{s.d(e,{H:()=>r});var i=s(98883),r=(()=>{let t=()=>i.S$;return{isServer:()=>t(),setIsServer(e){t=e}}})()},71761:(t,e,s)=>{s.d(e,{m:()=>r});var i=s(37963),r=new class extends i.Q{#p;#y;#m;constructor(){super(),this.#m=t=>{if("undefined"!=typeof window&&window.addEventListener){let e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#y||this.setEventListener(this.#m)}onUnsubscribe(){this.hasListeners()||(this.#y?.(),this.#y=void 0)}setEventListener(t){this.#m=t,this.#y?.(),this.#y=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#p!==t&&(this.#p=t,this.onFocus())}onFocus(){let t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#p?this.#p:globalThis.document?.visibilityState!=="hidden"}}},83026:(t,e,s)=>{s.d(e,{jG:()=>r});var i=s(33800).Zq,r=function(){let t=[],e=0,s=t=>{t()},r=t=>{t()},n=i,a=i=>{e?t.push(i):n(()=>{s(i)})};return{batch:i=>{let a;e++;try{a=i()}finally{--e||(()=>{let e=t;t=[],e.length&&n(()=>{r(()=>{e.forEach(t=>{s(t)})})})})()}return a},batchCalls:t=>(...e)=>{a(()=>{t(...e)})},schedule:a,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{r=t},setScheduler:t=>{n=t}}}()},95817:(t,e,s)=>{s.d(e,{$:()=>o,s:()=>a});var i=s(83026),r=s(98651),n=s(10283),a=class extends r.k{#v;#b;#n;#g;constructor(t){super(),this.#v=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#b=[],this.state=t.state||o(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#b.includes(t)||(this.#b.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#b=this.#b.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#b.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#g?.continue()??this.execute(this.state.variables)}async execute(t){let e=()=>{this.#C({type:"continue"})},s={client:this.#v,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#g=(0,n.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(t,s):Promise.reject(Error("No mutationFn found")),onFail:(t,e)=>{this.#C({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#C({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let i="pending"===this.state.status,r=!this.#g.canStart();try{if(i)e();else{this.#C({type:"pending",variables:t,isPaused:r}),this.#n.config.onMutate&&await this.#n.config.onMutate(t,this,s);let e=await this.options.onMutate?.(t,s);e!==this.state.context&&this.#C({type:"pending",context:e,variables:t,isPaused:r})}let n=await this.#g.start();return await this.#n.config.onSuccess?.(n,t,this.state.context,this,s),await this.options.onSuccess?.(n,t,this.state.context,s),await this.#n.config.onSettled?.(n,null,this.state.variables,this.state.context,this,s),await this.options.onSettled?.(n,null,t,this.state.context,s),this.#C({type:"success",data:n}),n}catch(e){try{await this.#n.config.onError?.(e,t,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onError?.(e,t,this.state.context,s)}catch(t){Promise.reject(t)}try{await this.#n.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this,s)}catch(t){Promise.reject(t)}try{await this.options.onSettled?.(void 0,e,t,this.state.context,s)}catch(t){Promise.reject(t)}throw this.#C({type:"error",error:e}),e}finally{this.#n.runNext(this)}}#C(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),i.jG.batch(()=>{this.#b.forEach(e=>{e.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function o(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},96917:(t,e,s)=>{s.d(e,{X:()=>u,k:()=>h});var i=s(98883),r=s(83026),n=s(10283),a=s(98651);function o(t,{pages:e,pageParams:s}){let i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}var u=class extends a.k{#w;#O;#q;#S;#v;#g;#a;#P;constructor(t){super(),this.#P=!1,this.#a=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#v=t.client,this.#S=this.#v.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#O=l(this.options),this.state=t.state??this.#O,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#w}get promise(){return this.#g?.promise}setOptions(t){if(this.options={...this.#a,...t},t?._type&&(this.#w=t._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let t=l(this.options);void 0!==t.data&&(this.setState(c(t.data,t.dataUpdatedAt)),this.#O=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#S.remove(this)}setData(t,e){let s=(0,i.pl)(this.state.data,t,this.options);return this.#C({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t){this.#C({type:"setState",state:t})}cancel(t){let e=this.#g?.promise;return this.#g?.cancel(t),e?e.then(i.lQ).catch(i.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#O}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>!1!==(0,i.nU)(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.hT||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===(0,i.d2)(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!(0,i.j3)(this.state.dataUpdatedAt,t))}onFocus(){let t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#g?.continue()}onOnline(){let t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#g?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#S.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#g&&(this.#P||this.#F()?this.#g.cancel({revert:!0}):this.#g.cancelRetry()),this.scheduleGc()),this.#S.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}#F(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#C({type:"invalidate"})}async fetch(t,e){var s;if("idle"!==this.state.fetchStatus&&this.#g?.status()!=="rejected"){if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#g)return this.#g.continueRetry(),this.#g.promise}if(t&&this.setOptions(t),!this.options.queryFn){let t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}let r=new AbortController,a=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#P=!0,r.signal)})},u=()=>{let t=(0,i.ZM)(this.options,e),s=(()=>{let t={client:this.#v,queryKey:this.queryKey,meta:this.meta};return a(t),t})();return(this.#P=!1,this.options.persister)?this.options.persister(t,s,this):t(s)},h=(()=>{let t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#v,state:this.state,fetchFn:u};return a(t),t})(),c="infinite"===this.#w?(s=this.options.pages,{onFetch:(t,e)=>{let r=t.options,n=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],u=t.state.data?.pageParams||[],h={pages:[],pageParams:[]},c=0,l=async()=>{let e=!1,l=(0,i.ZM)(t.options,t.fetchOptions),d=async(s,r,n)=>{if(e)return Promise.reject(t.signal.reason);if(null==r&&s.pages.length)return Promise.resolve(s);let a=(()=>{let s={client:t.client,queryKey:t.queryKey,pageParam:r,direction:n?"backward":"forward",meta:t.options.meta};return(0,i.ox)(s,()=>t.signal,()=>e=!0),s})(),o=await l(a),{maxPages:u}=t.options,h=n?i.ZZ:i.y9;return{pages:h(s.pages,o,u),pageParams:h(s.pageParams,r,u)}};if(n&&a.length){let t="backward"===n,e={pages:a,pageParams:u},s=(t?function(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}:o)(r,e);h=await d(e,s,t)}else{let t=s??a.length;do{let t=0===c?u[0]??r.initialPageParam:o(r,h);if(c>0&&null==t)break;h=await d(h,t),c++}while(c<t)}return h};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},e):t.fetchFn=l}}):this.options.behavior;c?.onFetch(h,this),this.#q=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==h.fetchOptions?.meta)&&this.#C({type:"fetch",meta:h.fetchOptions?.meta}),this.#g=(0,n.II)({initialPromise:e?.initialPromise,fn:h.fetchFn,onCancel:t=>{t instanceof n.cc&&t.revert&&this.setState({...this.#q,fetchStatus:"idle"}),r.abort()},onFail:(t,e)=>{this.#C({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#C({type:"pause"})},onContinue:()=>{this.#C({type:"continue"})},retry:h.options.retry,retryDelay:h.options.retryDelay,networkMode:h.options.networkMode,canRun:()=>!0});try{let t=await this.#g.start();if(void 0===t)throw Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#S.config.onSuccess?.(t,this),this.#S.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof n.cc){if(t.silent)return this.#g.promise;else if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#C({type:"error",error:t}),this.#S.config.onError?.(t,this),this.#S.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#C(t){let e=e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...h(e.data,this.options),fetchMeta:t.meta??null};case"success":let s={...e,...c(t.data,t.dataUpdatedAt),dataUpdateCount:e.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#q=t.manual?s:void 0,s;case"error":let i=t.error;return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}};this.state=e(this.state),r.jG.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#S.notify({query:this,type:"updated",action:t})})}};function h(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,n.v_)(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function c(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function l(t){let e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}},98651:(t,e,s)=>{s.d(e,{k:()=>a});var i=s(33800),r=s(68202),n=s(98883),a=class{#Q;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.gn)(this.gcTime)&&(this.#Q=i.zs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(r.H.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#Q&&(i.zs.clearTimeout(this.#Q),this.#Q=void 0)}}},98883:(t,e,s)=>{s.d(e,{Cp:()=>y,EN:()=>p,F$:()=>f,GU:()=>Q,MK:()=>l,S$:()=>r,ZM:()=>F,ZZ:()=>S,Zw:()=>a,d2:()=>h,f8:()=>v,gn:()=>o,hT:()=>P,j3:()=>u,lQ:()=>n,nJ:()=>d,nU:()=>c,ox:()=>j,pl:()=>O,y9:()=>q,yy:()=>w});var i=s(33800),r="undefined"==typeof window||"Deno"in globalThis;function n(){}function a(t,e){return"function"==typeof t?t(e):t}function o(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function h(t,e){return"function"==typeof t?t(e):t}function c(t,e){return"function"==typeof t?t(e):t}function l(t,e){let{type:s="all",exact:i,fetchStatus:r,predicate:n,queryKey:a,stale:o}=t;if(a){if(i){if(e.queryHash!==f(a,e.options))return!1}else if(!y(e.queryKey,a))return!1}if("all"!==s){let t=e.isActive();if("active"===s&&!t||"inactive"===s&&t)return!1}return("boolean"!=typeof o||e.isStale()===o)&&(!r||r===e.state.fetchStatus)&&(!n||!!n(e))}function d(t,e){let{exact:s,status:i,predicate:r,mutationKey:n}=t;if(n){if(!e.options.mutationKey)return!1;if(s){if(p(e.options.mutationKey)!==p(n))return!1}else if(!y(e.options.mutationKey,n))return!1}return(!i||e.state.status===i)&&(!r||!!r(e))}function f(t,e){return(e?.queryKeyHashFn||p)(t)}function p(t){return JSON.stringify(t,(t,e)=>g(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function y(t,e){return t===e||typeof t==typeof e&&!!t&&!!e&&"object"==typeof t&&"object"==typeof e&&Object.keys(e).every(s=>y(t[s],e[s]))}var m=Object.prototype.hasOwnProperty;function v(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(let s in t)if(t[s]!==e[s])return!1;return!0}function b(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function g(t){if(!C(t))return!1;let e=t.constructor;if(void 0===e)return!0;let s=e.prototype;return!!C(s)&&!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype}function C(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t){return new Promise(e=>{i.zs.setTimeout(e,t)})}function O(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?function t(e,s,i=0){if(e===s)return e;if(i>500)return s;let r=b(e)&&b(s);if(!r&&!(g(e)&&g(s)))return s;let n=(r?e:Object.keys(e)).length,a=r?s:Object.keys(s),o=a.length,u=r?Array(o):{},h=0;for(let c=0;c<o;c++){let o=r?c:a[c],l=e[o],d=s[o];if(l===d){u[o]=l,(r?c<n:m.call(e,o))&&h++;continue}if(null===l||null===d||"object"!=typeof l||"object"!=typeof d){u[o]=d;continue}let f=t(l,d,i+1);u[o]=f,f===l&&h++}return n===o&&h===n?e:u}(t,e):e}function q(t,e,s=0){let i=[...t,e];return s&&i.length>s?i.slice(1):i}function S(t,e,s=0){let i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var P=Symbol();function F(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==P?t.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${t.queryHash}'`))}function Q(t,e){return"function"==typeof t?t(...e):!!t}function j(t,e,s){let i,r=!1;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??=e(),r||(r=!0,i.aborted?s():i.addEventListener("abort",s,{once:!0})),i)}),t}},98936:(t,e,s)=>{s.d(e,{t:()=>r});var i=s(37963),r=new class extends i.Q{#j=!0;#y;#m;constructor(){super(),this.#m=t=>{if("undefined"!=typeof window&&window.addEventListener){let e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#y||this.setEventListener(this.#m)}onUnsubscribe(){this.hasListeners()||(this.#y?.(),this.#y=void 0)}setEventListener(t){this.#m=t,this.#y?.(),this.#y=t(this.setOnline.bind(this))}setOnline(t){this.#j!==t&&(this.#j=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#j}}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9454],{6284:(e,l,o)=>{o.d(l,{dY:()=>n,EX:()=>r});let t={pwaRoute:{"/":{pwa:"stable"},"/404":{pwa:"stable"},"/setup":{pwa:"stable"},"/setup/done":{pwa:"stable"},"/consult":{pwa:"stable"},"/chat":{pwa:"stable"},"/today":{pwa:"stable"},"/term":{pwa:"stable"},"/live":{pwa:"stable"},"/market":{pwa:"stable"},"/sessions":{pwa:"stable"},"/settings":{pwa:"beta"},"/editor":{pwa:"beta"},"/intake":{pwa:"beta"},"/trace":{pwa:"beta"},"/board":{pwa:"beta"},"/autopilot":{pwa:"beta"},"/missions/[id]":{pwa:"beta"},"/tasks":{pwa:"beta"},"/workspace":{pwa:"beta"},"/reflection":{pwa:"beta"},"/vault":{pwa:"beta"},"/observatory":{pwa:"beta"},"/exec":{pwa:"beta"},"/field":{pwa:"beta"},"/showroom":{pwa:"beta"},"/workflows":{pwa:"beta"},"/approvals":{pwa:"tool"},"/worktrees":{pwa:"tool"},"/design-check":{pwa:"tool"},"/control":{pwa:"tool"},"/scheduler":{pwa:"ops"},"/ops/release":{pwa:"ops"},"/ops/seats":{pwa:"ops"},"/ops/checklist":{pwa:"ops"},"/dashboard":{pwa:"ops"},"/bots":{pwa:"ops"},"/botlab":{pwa:"ops"},"/morning":{pwa:"broken"},"/settings/devices":{pwa:"broken"},"/workflows/chat-ui":{pwa:"broken"},"/share":{pwa:"system"}}},a=Object.fromEntries(Object.entries(t.pwaRoute).map(e=>{let[l,o]=e;return[l,o.pwa]}));function i(e){var l;let o=(null==(l=e.split(/[?#]/,1)[0])?void 0:l.replace(/\/+$/,""))||"/";return Object.prototype.hasOwnProperty.call(a,o)?o:o.startsWith("/missions/")&&-1===o.slice(10).indexOf("/")?"/missions/[id]":o}function n(e){let l=i(e);return Object.prototype.hasOwnProperty.call(a,l)?a[l]:void 0}function r(e,l,o){let a=i(l);if("general"===e&&(null==o?void 0:o.showBeta)&&"beta"===n(a))return!0;let r=function(e,l){var o;if(!Object.prototype.hasOwnProperty.call(t.pwaRoute,e))return;let a=t.pwaRoute[e];return null!=(o=a.pwa)?o:"desktop"===l?a.pwa:void 0}(a,"pwa");return!!r&&("owner"===e||"system"!==r&&("/settings"===a||"stable"===r||"contributor"===e&&("beta"===r||"tool"===r)))}},11980:(e,l,o)=>{o.d(l,{Hw:()=>x,vm:()=>L,f4:()=>j,OE:()=>E,Ue:()=>P,Ye:()=>R});var t=o(8542),a=o(42859),i=o(68634),n=o(87216),r=o(42310),s=o(31159),p=o(2961),c=o(62480),b=o(59573),d=o(95895),h=o(7347),u=o(49454),w=o(84081),f=o(49559),g=o(26882),k=o(6381),v=o(31014),m=o(4790),y=o(34881),A=o(33011),O=o(58291),C=o(70765),T=o(6284);let x=[{id:"today",label:"오늘",icon:t.A,bottomTab:!0},{id:"talk",label:"대화",icon:a.A,bottomTab:!0},{id:"work",label:"일",icon:i.A,bottomTab:!0},{id:"make",label:"만들기",icon:n.A,bottomTab:!0},{id:"files",label:"자료",icon:r.A,bottomTab:!1},{id:"settings",label:"설정",icon:s.A,bottomTab:!1},{id:"ops",label:"운영\uD83D\uDD12",icon:p.A,bottomTab:!1}];function R(e,l){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"owner",t=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=arguments.length>4?arguments[4]:void 0,i=e=>{var l;return null!=(l=e.visibility)?l:"public"},n=e.filter(e=>"ops"===e.group?t:(0,T.EX)(o,e.href,a));return{main:n.filter(e=>"ops"===e.group||"public"===i(e)),labs:l.showLabs?n.filter(e=>"ops"!==e.group&&"labs"===i(e)):[],hidden:l.showHidden?n.filter(e=>"ops"!==e.group&&"hidden"===i(e)):[]}}let j="elanous.nav.showLabs",L="elanous.nav.showHidden",E=[{href:"/share",category:"system-share-target",reason:"운영체제가 공유 동작으로 호출하는 Share Target 진입점."},{href:"/missions",category:"dynamic-route-parent",reason:"`[id]`를 받는 동적 주소이며 부모 경로 자체는 없다."},{href:"/setup",category:"provider-onboarding",reason:"LLM provider 온보딩 진입점."},{href:"/setup/done",category:"provider-onboarding-complete",reason:"LLM provider 온보딩 완료 화면."},{href:"/settings/devices",category:"settings-subpage",reason:"Settings 아래 Device fleet 하위 화면."},{href:"/workflows",category:"workflow-legacy-redirect",reason:"기존 워크플로 링크를 /editor?mode=workflow 로 전달한다."},{href:"/workflows/chat-ui",category:"workflow-subflow",reason:"Workflows에서 여는 hosted chat 하위 흐름."},{href:"/",category:"root-welcome",reason:"첫 방문자를 위한 루트 welcome 화면."},{href:"/404",category:"error-page",reason:"오류 페이지."},{href:"/consult",category:"contact-form",reason:"AX 도입 상담\xb7과정 문의를 접수하는 입력 화면(CS1 \xb7 #22436)."},{href:"/morning",category:"unwired-screen",reason:"부르는 백엔드가 아직 없는 미배선 화면."},{href:"/botlab",category:"diagnostic-readonly",reason:"봇 화면 \xab벽\xbb을 한 자리에서 보는 읽기 진단 화면(#15390 \xb7 봇 운영자용)."}],P=[{group:"today",href:"/today",label:"오늘",hint:"결정 대기 \xb7 맡긴 일 \xb7 최근 대화",icon:t.A,kind:null},{group:"today",href:"/approvals",label:"승인 대기",hint:"아이디어 PR 요약 \xb7 승인하고 머지",icon:c.A,kind:null},{group:"today",href:"/intake",label:"넣기",hint:"넣으면 흡수 \xb7 작업 \xb7 그래프로 (URL \xb7 미션 \xb7 메모)",icon:t.A,kind:null},{group:"talk",href:"/chat",label:"채팅",hint:"채팅 (스트리밍 \xb7 multimodal \xb7 mic)",icon:a.A,kind:"chat"},{group:"talk",href:"/exec",label:"COO 에게 맡기기",hint:"COO 에게 맡기기 \xb7 맡긴 일",icon:b.A,kind:null},{group:"work",href:"/autopilot",label:"미션",hint:"미션 \xb7 작업 (미션 계보\xb7골 던지기\xb7작업 보드\xb7자율행동)",icon:i.A,kind:null,activeAlso:["/tasks","/missions"]},{group:"work",href:"/scheduler",label:"예약",hint:"예약 잡 종합 현황 (크론\xb7데몬\xb7launchd)",icon:d.A,kind:null},{group:"work",href:"/live",label:"Live",hint:"런이 판단\xb7기획하는 신호 (진짜 수 \xb7 쇼 모드)",icon:h.A,kind:null},{group:"work",href:"/trace",label:"Trace",hint:"렌즈를 좁혀 런을 따라간다 (플릿 → 런 → 판단)",icon:u.A,kind:null},{group:"make",href:"/term",label:"터미널",hint:"터미널 + agent dock",icon:n.A,kind:"term"},{group:"make",href:"/editor",label:"편집기",hint:"워크플로 \xb7 실행 그래프 작성\xb7편집",icon:w.A,kind:null,visibility:"labs",activeAlso:["/workflows"]},{group:"make",href:"/design-check",label:"디자인",hint:"디자인 시스템 고르기 \xb7 시안 \xb7 URL 로 내 시스템",icon:f.A,kind:null},{group:"make",href:"/workspace",label:"여러 탭",hint:"여러 탭 동시 보기",icon:g.A,kind:null,visibility:"labs"},{group:"files",href:"/vault",label:"Obsidian 노트",hint:"Vault — Obsidian 노트 (브라우저\xb7에디터\xb7검색\xb7그래프)",icon:r.A,kind:null},{group:"files",href:"/field",label:"현장 올리기",hint:"현장 올리기 \xb7 사진과 메모",icon:t.A,kind:null},{group:"files",href:"/market",label:"마켓",hint:"플러그인 찾아보기 \xb7 상세 \xb7 설치됨",icon:k.A,kind:null},{group:"settings",href:"/settings",label:"설정",hint:"환경 + provider + theme",icon:s.A,kind:"settings"},{group:"ops",href:"/ops/release",label:"릴리스",hint:"판 진행 노드 줄 \xb7 로그 꼬리",icon:w.A,kind:null},{group:"ops",href:"/ops/checklist",label:"판별 피처",hint:"확인표 칸 목록 \xb7 상태 \xb7 담당 \xb7 근거",icon:c.A,kind:null},{group:"ops",href:"/ops/seats",label:"자리 현황",hint:"자리별 지금 일 \xb7 착지 \xb7 막힘 \xb7 결정 대기(?capture=public 공개 시연)",icon:v.A,kind:null},{group:"ops",href:"/bots",label:"봇",hint:"봇 신원 + 공통 명령 카탈로그 (읽기 전용)",icon:b.A,kind:null,visibility:"hidden"},{group:"ops",href:"/observatory",label:"관측",hint:"subject 관측 (talk \xb7 screen \xb7 agent)",icon:m.A,kind:null,visibility:"hidden"},{group:"ops",href:"/worktrees",label:"작업 트리",hint:"격리 작업 트리 목록\xb7상태",icon:w.A,kind:null,visibility:"hidden"},{group:"ops",href:"/control",label:"제어",hint:"데몬 제어 패널",icon:p.A,kind:"control",visibility:"hidden"},{group:"work",href:"/tasks",label:"Tasks",hint:"작업 보드 (Missions 안 ② 작업)",icon:y.A,kind:"tasks",visibility:"hidden"},{group:"work",href:"/board",label:"보드",hint:"태스크 카드 흐름 (스튜어드 → 실행 → 착지 → 릴리스)",icon:y.A,kind:null,visibility:"labs"},{group:"work",href:"/sessions",label:"Sessions",hint:"세션 카드 데크 (스와이프 결정)",icon:A.A,kind:null,visibility:"hidden"},{group:"today",href:"/reflection",label:"Reflection",hint:"오늘의 회고 (5분 갱신)",icon:O.A,kind:null,visibility:"hidden"},...[].map(e=>({...e,group:"files"})),{group:"make",href:"/showroom",label:"Showroom",hint:"multi-agent 동시 비교 (broadcast \xb7 CV-3)",icon:C.A,kind:null,visibility:"labs"}]},67842:(e,l,o)=>{o.d(l,{AF:()=>t});let t={all:["nexus"],health:()=>[...t.all,"health"],snapshot:()=>[...t.all,"snapshot"],tabs:e=>e?[...t.all,"tabs",{kind:e}]:[...t.all,"tabs"],tab:e=>[...t.all,"tab",e],templates:()=>[...t.all,"templates"],template:e=>[...t.all,"template",e],config:()=>[...t.all,"config"],switches:()=>[...t.all,"switches"],switch:e=>[...t.all,"switch",e],secrets:()=>[...t.all,"secrets"],bindingChannels:()=>[...t.all,"bindings","channels"],bindings:e=>[...t.all,"bindings",e],binding:(e,l)=>[...t.all,"binding",e,l],logsTail:(e,l)=>l?[...t.all,"logs",e,{lines:l}]:[...t.all,"logs",e],workflows:()=>[...t.all,"workflows"],workflow:e=>[...t.all,"workflow",e],workflowRun:e=>[...t.all,"workflow-run",e],workflowRuns:()=>[...t.all,"workflow-runs"],pendingApprovals:()=>[...t.all,"workflow-pending-approvals"],platforms:()=>[...t.all,"platforms"],providers:()=>[...t.all,"providers"],worktrees:()=>[...t.all,"worktrees"],designCheck:()=>[...t.all,"design-check"],designPreviews:()=>[...t.all,"design-previews"],designPreview:e=>[...t.all,"design-preview",e],registryCatalog:()=>[...t.all,"registry-catalog"],resolvedView:()=>[...t.all,"resolved-view"]};t.snapshot(),t.tabs(),t.health(),t.snapshot(),t.config(),t.switches()},91514:(e,l,o)=>{o.d(l,{M1:()=>p,Qj:()=>c,tI:()=>s});var t=o(41121),a=o(91269),i=o(19855),n=o(24818);let r=(0,a.createContext)(null);function s(e){let{client:l,queryClient:o,defaultStaleTimeMs:s,children:p}=e,c=(0,a.useMemo)(()=>null!=o?o:new i.E({defaultOptions:{queries:{staleTime:null!=s?s:2e3,refetchOnWindowFocus:!1}}}),[o,s]);return(0,t.jsx)(r.Provider,{value:l,children:(0,t.jsx)(n.Ht,{client:c,children:p})})}function p(){let e=(0,a.useContext)(r);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function c(){return(0,a.useContext)(r)}}}]);
|