elanous 0.2.14 → 0.2.15
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/LZcstaO9_NXypPFmujolv/_buildManifest.js +1 -0
- package/apps/pwa/out/_next/static/chunks/{1307-6e7e0377c1db0bdc.js → 1307-33ffcc49ab45123b.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/5977-c952712c87a1f757.js +1 -0
- package/apps/pwa/out/_next/static/chunks/899-46946fe8363e1262.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/approvals/{page-74383f890f075511.js → page-0e2c57fe6add4b2a.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/autopilot/{page-7b2b4f378354869a.js → page-e05a77df7e005b04.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-f544338193a9a762.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/botlab/page-5491c115b1f9a923.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/bots/{page-1512d91c7491ed62.js → page-b8c49f6b4fa2df91.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ceo/page-96398e364fbd4548.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/chat/{page-a627db94ec6904a0.js → page-976813c91d7394ea.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/consult/{page-fb260b9283dbf646.js → page-28b9448091776c06.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-1d4901eb7c2d8822.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-72d3e7ff35a8c954.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/editor/{page-fed69f9759d248d0.js → page-60c7a8e1a4fe62ce.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/exec/{page-15374909d8f1aebd.js → page-2a52b316cb143d9c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/field/{page-012a742f81218b01.js → page-c3ce483c8d5db370.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-13c7b53e0c2519a9.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/intake/{page-99effd9d893a43dc.js → page-96f074f6538e8a2c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/{layout-938de57ae0315e46.js → layout-e97be5334d83a9f5.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-65e484302921a932.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/loops/page-34d08facaf08f556.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/market/{page-629e1ede482ec6eb.js → page-955ec2da3be4c560.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-9f88fbc15d9058d1.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/morning/{page-27e99b4e54a849d4.js → page-c1343f9499d86f3f.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-8739a2e0ae793130.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-c9fc5706b8abaa11.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/checklist/{page-32cde713be47cddb.js → page-d23b12bb92242558.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-8d47f45a0dc044ac.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-c7fea475488201a8.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/outputs/{page-04250f0e2c0d03df.js → page-e2ee2896811e98d0.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/page-83b19dae8619de05.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/reflection/{page-e64caff084f7ce21.js → page-5efbf81124c474ae.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/scheduler/{page-db07eaffba0df7e3.js → page-85f1a1fc0a82738c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/sessions/{page-8ac8d71c2adf9c8a.js → page-da6c08aae0f92768.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-06ee266953d9c879.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/settings/{page-86f91034bd5cabe5.js → page-153c2b3bcc89e8de.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/done/{page-94dc383d3d54db1a.js → page-87a11e6a05f15199.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/setup/{page-b3759cc14da80908.js → page-7d4182964407c09c.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/share/{page-ce4d8a1215ce53a3.js → page-0d6d23b40263a7ea.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-7e8c39241f8eb6d0.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-008c1a96618a4887.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/term/{page-274703bc41b71333.js → page-f5597e894c02cd33.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-0337fdf7fb5e37b6.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/trace/{page-35bdeae2e2c17147.js → page-73735b64bfe1ae67.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/vault/{page-3b7e821dc492bdfd.js → page-8fcec4c9ea2e7f70.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-f7e631e9b4daf66e.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-4881b8f9f63694b4.js +1 -0
- package/apps/pwa/out/_next/static/chunks/app/workspace/{page-2f810b18d89ecba6.js → page-9817c7f9007466cc.js} +1 -1
- package/apps/pwa/out/_next/static/chunks/app/worktrees/{page-134c1bc762aee62c.js → page-97f9f43172a3a90e.js} +1 -1
- package/apps/pwa/out/_next/static/css/1f7c958c41ffa3b9.css +1 -0
- package/apps/pwa/out/approvals/index.html +1 -1
- package/apps/pwa/out/approvals/index.txt +14 -14
- package/apps/pwa/out/autopilot/index.html +1 -1
- package/apps/pwa/out/autopilot/index.txt +14 -14
- package/apps/pwa/out/board/index.html +1 -1
- package/apps/pwa/out/board/index.txt +14 -14
- package/apps/pwa/out/botlab/index.html +1 -1
- package/apps/pwa/out/botlab/index.txt +14 -14
- package/apps/pwa/out/bots/index.html +1 -1
- package/apps/pwa/out/bots/index.txt +14 -14
- package/apps/pwa/out/ceo/index.html +1 -0
- package/apps/pwa/out/ceo/index.txt +33 -0
- package/apps/pwa/out/chat/index.html +1 -1
- package/apps/pwa/out/chat/index.txt +14 -14
- package/apps/pwa/out/consult/index.html +1 -1
- package/apps/pwa/out/consult/index.txt +14 -14
- package/apps/pwa/out/control/index.html +1 -1
- package/apps/pwa/out/control/index.txt +14 -14
- package/apps/pwa/out/design-check/index.html +1 -1
- package/apps/pwa/out/design-check/index.txt +14 -14
- package/apps/pwa/out/editor/index.html +1 -1
- package/apps/pwa/out/editor/index.txt +14 -14
- package/apps/pwa/out/exec/index.html +1 -1
- package/apps/pwa/out/exec/index.txt +14 -14
- package/apps/pwa/out/field/index.html +1 -1
- package/apps/pwa/out/field/index.txt +14 -14
- package/apps/pwa/out/healthz +1 -1
- package/apps/pwa/out/index.html +1 -1
- package/apps/pwa/out/index.txt +14 -14
- package/apps/pwa/out/inside/index.html +1 -1
- package/apps/pwa/out/inside/index.txt +14 -14
- package/apps/pwa/out/intake/index.html +1 -1
- package/apps/pwa/out/intake/index.txt +14 -14
- package/apps/pwa/out/live/index.html +1 -1
- package/apps/pwa/out/live/index.txt +14 -14
- package/apps/pwa/out/loops/index.html +1 -1
- package/apps/pwa/out/loops/index.txt +14 -14
- package/apps/pwa/out/market/index.html +1 -1
- package/apps/pwa/out/market/index.txt +14 -14
- package/apps/pwa/out/missions/placeholder/index.html +1 -1
- package/apps/pwa/out/missions/placeholder/index.txt +14 -14
- package/apps/pwa/out/morning/index.html +1 -1
- package/apps/pwa/out/morning/index.txt +14 -14
- package/apps/pwa/out/observatory/index.html +1 -1
- package/apps/pwa/out/observatory/index.txt +14 -14
- package/apps/pwa/out/ops/checklist/index.html +1 -1
- package/apps/pwa/out/ops/checklist/index.txt +14 -14
- package/apps/pwa/out/ops/release/index.html +1 -1
- package/apps/pwa/out/ops/release/index.txt +14 -14
- package/apps/pwa/out/ops/seats/index.html +1 -1
- package/apps/pwa/out/ops/seats/index.txt +14 -14
- package/apps/pwa/out/outputs/index.html +1 -1
- package/apps/pwa/out/outputs/index.txt +14 -14
- package/apps/pwa/out/reflection/index.html +1 -1
- package/apps/pwa/out/reflection/index.txt +15 -15
- package/apps/pwa/out/scheduler/index.html +1 -1
- package/apps/pwa/out/scheduler/index.txt +14 -14
- package/apps/pwa/out/sessions/index.html +1 -1
- package/apps/pwa/out/sessions/index.txt +14 -14
- package/apps/pwa/out/settings/devices/index.html +1 -1
- package/apps/pwa/out/settings/devices/index.txt +14 -14
- package/apps/pwa/out/settings/index.html +1 -1
- package/apps/pwa/out/settings/index.txt +14 -14
- package/apps/pwa/out/setup/done/index.html +1 -1
- package/apps/pwa/out/setup/done/index.txt +14 -14
- package/apps/pwa/out/setup/index.html +1 -1
- package/apps/pwa/out/setup/index.txt +14 -14
- package/apps/pwa/out/share/index.html +1 -1
- package/apps/pwa/out/share/index.txt +14 -14
- package/apps/pwa/out/showroom/index.html +1 -1
- package/apps/pwa/out/showroom/index.txt +14 -14
- package/apps/pwa/out/tasks/index.html +1 -1
- package/apps/pwa/out/tasks/index.txt +14 -14
- package/apps/pwa/out/term/index.html +1 -1
- package/apps/pwa/out/term/index.txt +14 -14
- package/apps/pwa/out/today/index.html +1 -1
- package/apps/pwa/out/today/index.txt +14 -14
- package/apps/pwa/out/trace/index.html +1 -1
- package/apps/pwa/out/trace/index.txt +14 -14
- package/apps/pwa/out/vault/index.html +1 -1
- package/apps/pwa/out/vault/index.txt +14 -14
- package/apps/pwa/out/workflows/chat-ui/index.html +1 -1
- package/apps/pwa/out/workflows/chat-ui/index.txt +14 -14
- package/apps/pwa/out/workflows/index.html +1 -1
- package/apps/pwa/out/workflows/index.txt +14 -14
- package/apps/pwa/out/workspace/index.html +1 -1
- package/apps/pwa/out/workspace/index.txt +14 -14
- package/apps/pwa/out/worktrees/index.html +1 -1
- package/apps/pwa/out/worktrees/index.txt +14 -14
- package/graphs/heal/heal-loop.yaml +1 -1
- package/graphs/implement-loop.yaml +1 -1
- package/graphs/release/recipes.yaml +3 -0
- package/graphs/release/release-loop.yaml +4 -2
- package/package.json +1 -1
- package/scripts/brand/check.ts +7 -5
- package/scripts/ci-typecheck-changed.ts +50 -18
- package/scripts/docs/generate-graph-anatomy.ts +315 -0
- package/scripts/expose-rubric-suggest.ts +18 -12
- package/scripts/lecture-note/node.ts +31 -11
- package/scripts/lessons/handbook-page.ts +30 -3
- package/scripts/marketing/generate-ax-brief.ts +140 -0
- package/scripts/marketing/generate-feature-map.ts +118 -0
- package/scripts/release-loop/checklist-gate-node.ts +53 -14
- package/scripts/release-loop/gate-node.ts +80 -14
- package/scripts/release-loop/vault-note-node.ts +240 -8
- package/scripts/release-story/draft.ts +57 -9
- package/scripts/rhythm/daily.ts +263 -76
- package/scripts/rhythm/weekly.ts +30 -9
- package/scripts/smart-merge/resync-shadow.ts +147 -0
- package/src/agent-env/profile.ts +161 -0
- package/src/agent-substrate/pr-reviewer.ts +2 -0
- package/src/ask-user-question/pending-questions.ts +5 -0
- package/src/auth/github-app-token.ts +112 -13
- package/src/autopilot/build/llm-conflict-merge.ts +32 -6
- package/src/briefing/brief-items.ts +121 -0
- package/src/claims/claims-render.ts +14 -5
- package/src/cli/agent-env-cli.ts +21 -0
- package/src/cli/decisions-cli.ts +9 -0
- package/src/cli/doctor-cli.ts +23 -1
- package/src/cli/doctor-node-modules.ts +147 -0
- package/src/cli/intake-cli.ts +46 -17
- package/src/cli/pod-cli.ts +2 -0
- package/src/cli/release-cli.ts +61 -27
- package/src/cli/seat-requests-cli.ts +52 -0
- package/src/context-bus/context-now-public.ts +16 -6
- package/src/context-bus/context-now.ts +3 -1
- package/src/context-bus/coord-events.ts +6 -4
- package/src/decisions/decision-cards.ts +33 -7
- package/src/decisions/proact-meter.ts +286 -0
- package/src/decisions/proact1-lite.ts +86 -0
- package/src/decisions/web-push-decision-cards.ts +1 -1
- package/src/domains/alert-audit.ts +271 -0
- package/src/domains/core-tools.ts +4 -3
- package/src/domains/ops-facts-tool.ts +31 -1
- package/src/harness/harness-cli-command.ts +111 -15
- package/src/harness/harness-incidents.ts +2 -0
- package/src/harness/harness-pod-dispatch.ts +100 -11
- package/src/harness/harness-queue.ts +380 -50
- package/src/harness/helper-repair.ts +87 -0
- package/src/harness/helper-scan.ts +16 -4
- package/src/harness/launch-stamp.ts +236 -0
- package/src/harness/ledger-write-guard-child.fixture.ts +12 -0
- package/src/harness/ledger-write-guard.ts +35 -0
- package/src/harness/pod-memory-policy.ts +15 -0
- package/src/harness/repository-name.ts +55 -0
- package/src/hq/fence-audit.ts +90 -0
- package/src/hq/hq.ts +62 -4
- package/src/hq/lease.ts +4 -4
- package/src/hq/move-plan.ts +126 -0
- package/src/hq/promote.ts +31 -0
- package/src/index.ts +77 -7
- package/src/intake-plane/check.ts +63 -0
- package/src/intake-plane/digest.ts +37 -15
- package/src/intake-plane/front-classifier.ts +6 -0
- package/src/intake-plane/items.ts +3 -2
- package/src/intake-plane/lens.ts +177 -0
- package/src/intake-plane/route.ts +145 -1
- package/src/launch-head/seat-goal-queue-lock.fixture.ts +15 -0
- package/src/launch-head/seat-goal-queue.ts +198 -0
- package/src/loops/budget.ts +36 -5
- package/src/loops/checker.ts +2 -2
- package/src/loops/orchestrator/author-depth.ts +65 -9
- package/src/loops/orchestrator/author-input-check.ts +8 -3
- package/src/loops/orchestrator/author-ledger.ts +3 -1
- package/src/loops/orchestrator/seat-share.ts +56 -0
- package/src/loops/orchestrator/tick.ts +11 -4
- package/src/loops/orchestrator/traffic.ts +117 -11
- package/src/loops/registry.ts +142 -61
- package/src/maturity/feature-maturity.ts +2 -1
- package/src/maturity/tui-slash-availability.ts +31 -0
- package/src/mss/logging/log-store.ts +35 -4
- package/src/nexus/api/http-server.ts +28 -14
- package/src/nexus/api/loop-edges.ts +173 -0
- package/src/nexus/api/schedules-read.ts +13 -0
- package/src/nexus/api/seat-requests.ts +79 -56
- package/src/prompt-enhance/enhance.ts +6 -1
- package/src/release-loop/auto-start.ts +6 -3
- package/src/release-loop/checklist.ts +13 -4
- package/src/release-loop/feature-store.ts +58 -31
- package/src/release-loop/merged-pr-checklist.ts +125 -0
- package/src/release-loop/placement.ts +86 -26
- package/src/seat-dispatch/seat-request-eligibility.ts +19 -0
- package/src/seat-dispatch/seat-request-ledger.ts +133 -0
- package/src/seat-loop/seat-loop.ts +126 -10
- package/src/self-dev/dev-pipeline.ts +8 -4
- package/src/self-dev/draft-sweep.ts +90 -10
- package/src/self-dev/draft-triage-rules.ts +25 -8
- package/src/self-dev/orchestrate.ts +15 -1
- package/src/self-dev/review-provider-fallback.ts +6 -1
- package/src/self-dev/run-supervisor.ts +49 -2
- package/src/self-implement/frozen-merges.ts +3 -2
- package/src/self-implement/goal-author.ts +43 -5
- package/src/self-implement/goal-clarification-escalation.ts +5 -0
- package/src/self-implement/heal-intake.ts +120 -2
- package/src/self-implement/host-regate.ts +9 -2
- package/src/self-implement/l8-merge-queue.ts +132 -0
- package/src/self-implement/orchestrator.ts +187 -40
- package/src/self-implement/pipeline-shape.ts +1 -1
- package/src/self-implement/revert-guard.ts +42 -7
- package/src/self-implement/run-ledger.ts +2 -0
- package/src/self-implement/run-status-mapping.ts +2 -0
- package/src/self-implement/seams.ts +1 -1
- package/src/self-implement/self-implement-cli.ts +1 -0
- package/src/self-implement/speed-claims.ts +338 -0
- package/src/steward/triage.ts +74 -3
- package/src/steward/working-backwards.ts +4 -1
- package/src/task-orchestrator/surfaces/pod-artifact-return.ts +63 -48
- package/src/task-orchestrator/surfaces/pod-command-job.ts +84 -9
- package/src/task-orchestrator/surfaces/pod-failure-reason.ts +48 -0
- package/src/task-orchestrator/surfaces/pod-pool.ts +60 -8
- package/src/task-orchestrator/surfaces/self-implement-pod.ts +147 -36
- package/src/task-orchestrator/surfaces/self-implement.ts +5 -1
- package/src/telegram.ts +25 -4
- package/src/user-config.ts +29 -5
- package/src/version/packed-revision.json +1 -1
- package/src/workflow-runtime/nodes/bash.ts +9 -1
- package/apps/pwa/out/_next/static/chunks/4562-071d8bac44a01069.js +0 -1
- package/apps/pwa/out/_next/static/chunks/5977-2df489622a52a33a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/board/page-c496bb16da85385f.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/botlab/page-1abfe3aec3be6bdc.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/control/page-e6b84ab07d3567d5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/design-check/page-61ec1d2e92bdd50a.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/inside/page-fd7e200d4d83fbd7.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/live/page-d47266766766d227.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/loops/page-160089123a40dd91.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/missions/[id]/page-2ce5471926761fdd.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/not-found-e995d30f6800b6bf.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/observatory/page-39f89c53038a51d4.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/release/page-e7e10cd3386222e5.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/ops/seats/page-5a753bb4ec0cc511.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/page-341480ed8e3c1ea8.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/settings/devices/page-e1e47d8d940aba3d.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/showroom/page-58043db78ba519ae.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/tasks/page-357750dfb91bf960.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/today/page-194dce4a83143fce.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/chat-ui/page-16bef3da05a900c3.js +0 -1
- package/apps/pwa/out/_next/static/chunks/app/workflows/page-f8da5dc6f3752276.js +0 -1
- package/apps/pwa/out/_next/static/css/2e33713c444d5b39.css +0 -1
- package/apps/pwa/out/_next/static/x6mjI6vqOkVVu0jFuDkz1/_buildManifest.js +0 -1
- /package/apps/pwa/out/_next/static/{x6mjI6vqOkVVu0jFuDkz1 → LZcstaO9_NXypPFmujolv}/_ssgManifest.js +0 -0
package/src/user-config.ts
CHANGED
|
@@ -3097,6 +3097,8 @@ export interface IntakeSurfaceConfig {
|
|
|
3097
3097
|
}
|
|
3098
3098
|
|
|
3099
3099
|
export interface IntakeConfig {
|
|
3100
|
+
/** Maximum immediately scheduled Telegram absorption links per KST day. */
|
|
3101
|
+
eventMax?: number;
|
|
3100
3102
|
telegram: IntakeSurfaceConfig;
|
|
3101
3103
|
discord: IntakeSurfaceConfig;
|
|
3102
3104
|
approvals?: { repo?: string };
|
|
@@ -3484,10 +3486,13 @@ export interface OrchestratorLoopConfig {
|
|
|
3484
3486
|
/** Per-seat release gate; absent seats retain the spawn-budget default. */
|
|
3485
3487
|
releaseGate?: Partial<Record<OrchestratorSeat, number>>;
|
|
3486
3488
|
trafficMode: 'shadow' | 'live';
|
|
3489
|
+
idleRequest?: 'off' | 'shadow' | 'live';
|
|
3490
|
+
/** FINISH-RATE — the queue tick reads finish metrics before launching; shadow logs the hold only, on holds (default shadow). */
|
|
3491
|
+
finishGate?: 'off' | 'shadow' | 'on';
|
|
3487
3492
|
}
|
|
3488
3493
|
|
|
3489
3494
|
export const ORCHESTRATOR_DEFAULTS: OrchestratorLoopConfig = {
|
|
3490
|
-
mode: 'shadow', seatTrees: {}, seatCaps: { TC: 8, UX: 6, MK: 6, OP: 4 }, trafficMode: 'shadow',
|
|
3495
|
+
mode: 'shadow', seatTrees: {}, seatCaps: { TC: 8, UX: 6, MK: 6, OP: 4 }, trafficMode: 'shadow', idleRequest: 'shadow', finishGate: 'shadow',
|
|
3491
3496
|
};
|
|
3492
3497
|
|
|
3493
3498
|
export function parseOrchestratorLoopConfig(raw: unknown): OrchestratorLoopConfig {
|
|
@@ -3510,7 +3515,9 @@ export function parseOrchestratorLoopConfig(raw: unknown): OrchestratorLoopConfi
|
|
|
3510
3515
|
}
|
|
3511
3516
|
const mode = value.mode === 'off' || value.mode === 'live' ? value.mode : 'shadow';
|
|
3512
3517
|
return { mode, seatTrees, seatCaps, ...(Object.keys(releaseGate).length ? { releaseGate } : {}),
|
|
3513
|
-
trafficMode: value.trafficMode === 'live' ? 'live' : 'shadow'
|
|
3518
|
+
trafficMode: value.trafficMode === 'live' ? 'live' : 'shadow',
|
|
3519
|
+
idleRequest: value.idleRequest === 'off' || value.idleRequest === 'live' ? value.idleRequest : 'shadow',
|
|
3520
|
+
finishGate: value.finishGate === 'off' || value.finishGate === 'on' ? value.finishGate : 'shadow' };
|
|
3514
3521
|
}
|
|
3515
3522
|
|
|
3516
3523
|
export type StewardLoopMode = 'off' | 'shadow' | 'live' | 'rescue';
|
|
@@ -3566,6 +3573,8 @@ export interface HqConfig {
|
|
|
3566
3573
|
standby?: string;
|
|
3567
3574
|
/** Lease TTL in seconds (default 1500 = 25 min). */
|
|
3568
3575
|
ttlSeconds?: number;
|
|
3576
|
+
/** Arbiter silence threshold (default 3); applying promotion requires explicit opt-in. */
|
|
3577
|
+
autoPromote?: { enabled?: boolean; streak?: number };
|
|
3569
3578
|
/** Roles that may still run when this host is fenced only for lack of quorum (never when a newer generation exists). Absent = none. */
|
|
3570
3579
|
failOpenRoles?: HqFenceRole[];
|
|
3571
3580
|
/** Per-host nexus health URL over the tailnet (default https://<host>.<tailnetDomain>:31415/v1/health). */
|
|
@@ -3601,9 +3610,9 @@ export interface UserConfig {
|
|
|
3601
3610
|
loops?: { owners?: Record<string, EventSeat>; defaultOwner?: EventSeat; orchestrator?: OrchestratorLoopConfig; steward?: { mode?: StewardLoopMode; linearTeam?: string; roles?: Record<string, { maxConcurrent?: number }>; budget?: number; tracks?: Record<string, string>; alertAfterFailures?: number; launch?: 'off' | 'shadow' | 'live'; maxParallel?: number; podPool?: string }; seat?: SeatLoopConfig; persona?: PersonaLoopConfig };
|
|
3602
3611
|
/** 🔐 Pod 의 Grok API 키 과금은 명시 opt-in 만. 생략·잘못된 값은 false.
|
|
3603
3612
|
* budgetGate 와 같은 `harness` 객체다 — 중복 선언이면 뒤 타입이 앞을 지운다. */
|
|
3604
|
-
harness?: { revertGuard?: { depth: number }; pod?: { grokApiKeyOptIn: boolean }; budgetGate?: HarnessBudgetGateConfig; exposeGate?: 'warn' | 'strict'; difficultyPlacement?: boolean; defaultRepo?: string; substrate?: 'local' | 'pod'; podPool?: string; worktreeAddTimeoutSec?: number; queue?: { seatCap?: Partial<Record<'OP' | 'TC' | 'MK' | 'UX', number>> } };
|
|
3613
|
+
harness?: { revertGuard?: { depth: number }; pod?: { grokApiKeyOptIn: boolean }; budgetGate?: HarnessBudgetGateConfig; exposeGate?: 'warn' | 'strict'; difficultyPlacement?: boolean; defaultRepo?: string; /** Optional GitHub repository name (owner/repo), distinct from the local defaultRepo path. */ repo?: string; substrate?: 'local' | 'pod'; podPool?: string; worktreeAddTimeoutSec?: number; queue?: { seatCap?: Partial<Record<'OP' | 'TC' | 'MK' | 'UX', number>> }; /** `harness say` 문장을 Pod 안에서 저작부터 돌릴지. 생략·false = 끔(호스트가 저작). */ authorOnPod?: boolean };
|
|
3605
3614
|
/** ☸️ Pod 실행 칸 — `pool` = 기존 기본 풀(`컨텍스트[@ssh호스트][:상한][#k3d-레지스트리:포트]` 쉼표 · 앞이 우선). harness 실행은 인자·ELANOUS_POD_POOL·harness.podPool 다음으로 읽는다. */
|
|
3606
|
-
pod?: { pool?: string; /** 호스트 Git 미러 디렉터리 — Pod Job 에 읽기 전용으로 마운트한다. */ hostMirror?: string; /** 원격 그라운딩 엔드포인트(호스트 nexus · tailnet 주소) — Pod 가 토큰으로 «질의→인용»만 묻는다(P13). */ groundingUrl?: string; /** 읽기 전용 Pod lease 권장에 쓰는 계정별 동시 수. */ lease?: { perAccount?: number }; /** 실측 권고를 Pod 발사 기본값으로 쓸지 (기본 off). */ memory?: { adviseDefaults?: boolean } };
|
|
3615
|
+
pod?: { pool?: string; /** 호스트 Git 미러 디렉터리 — Pod Job 에 읽기 전용으로 마운트한다. */ hostMirror?: string; /** 원격 그라운딩 엔드포인트(호스트 nexus · tailnet 주소) — Pod 가 토큰으로 «질의→인용»만 묻는다(P13). */ groundingUrl?: string; /** 읽기 전용 Pod lease 권장에 쓰는 계정별 동시 수. */ lease?: { perAccount?: number }; /** 실측 권고를 Pod 발사 기본값으로 쓸지 (기본 off). */ memory?: { adviseDefaults?: boolean }; /** 명령 Job 자식 로그(child.log) 상한 바이트. 양의 정수만. 넘으면 끝부분 우선. */ childLogMaxBytes?: number };
|
|
3607
3616
|
skillRouter: SkillRouterConfig;
|
|
3608
3617
|
llm: LLMConfig;
|
|
3609
3618
|
skills: SkillsConfig;
|
|
@@ -3962,7 +3971,7 @@ function defaultConfig(): UserConfig {
|
|
|
3962
3971
|
},
|
|
3963
3972
|
},
|
|
3964
3973
|
voice: { stt: {}, tts: {}, vad: {}, chat: {}, discord: {}, telegram: {}, pwa: {} },
|
|
3965
|
-
intake: { telegram: {}, discord: {} },
|
|
3974
|
+
intake: { eventMax: 10, telegram: {}, discord: {} },
|
|
3966
3975
|
dashboard: {
|
|
3967
3976
|
promptBank: { ...DASHBOARD_PROMPT_BANK_DEFAULTS },
|
|
3968
3977
|
foldMode: 'task-unit',
|
|
@@ -4564,6 +4573,13 @@ export function parseHqConfig(raw: unknown): HqConfig | undefined {
|
|
|
4564
4573
|
}
|
|
4565
4574
|
if (typeof r.ttlSeconds === 'number' && Number.isFinite(r.ttlSeconds) && r.ttlSeconds > 0) out.ttlSeconds = r.ttlSeconds;
|
|
4566
4575
|
if (typeof r.probeTimeoutSeconds === 'number' && Number.isFinite(r.probeTimeoutSeconds) && r.probeTimeoutSeconds > 0) out.probeTimeoutSeconds = r.probeTimeoutSeconds;
|
|
4576
|
+
if (r.autoPromote && typeof r.autoPromote === 'object' && !Array.isArray(r.autoPromote)) {
|
|
4577
|
+
const auto = r.autoPromote as Record<string, unknown>;
|
|
4578
|
+
const setting: NonNullable<HqConfig['autoPromote']> = {};
|
|
4579
|
+
if (typeof auto.enabled === 'boolean') setting.enabled = auto.enabled;
|
|
4580
|
+
if (typeof auto.streak === 'number' && Number.isSafeInteger(auto.streak) && auto.streak > 0) setting.streak = auto.streak;
|
|
4581
|
+
if (Object.keys(setting).length) out.autoPromote = setting;
|
|
4582
|
+
}
|
|
4567
4583
|
if (Array.isArray(r.failOpenRoles)) out.failOpenRoles = r.failOpenRoles.filter((v): v is HqFenceRole => HQ_FENCE_ROLES.includes(v as HqFenceRole));
|
|
4568
4584
|
if (r.healthUrls && typeof r.healthUrls === 'object' && !Array.isArray(r.healthUrls)) {
|
|
4569
4585
|
out.healthUrls = Object.fromEntries(Object.entries(r.healthUrls as Record<string, unknown>).filter((e): e is [string, string] => typeof e[1] === 'string'));
|
|
@@ -4698,6 +4714,7 @@ export function buildUserConfig(path: string = defaultPath()): UserConfig {
|
|
|
4698
4714
|
pod: {
|
|
4699
4715
|
...(typeof legacyPod.pool === 'string' && legacyPod.pool.trim() ? { pool: legacyPod.pool.trim() } : {}),
|
|
4700
4716
|
...(typeof legacyPod.hostMirror === 'string' && legacyPod.hostMirror.trim() ? { hostMirror: legacyPod.hostMirror.trim() } : {}),
|
|
4717
|
+
...(typeof legacyPod.childLogMaxBytes === 'number' && Number.isSafeInteger(legacyPod.childLogMaxBytes) && legacyPod.childLogMaxBytes > 0 ? { childLogMaxBytes: legacyPod.childLogMaxBytes } : {}),
|
|
4701
4718
|
...(typeof legacyPod.groundingUrl === 'string' ? { groundingUrl: legacyPod.groundingUrl } : {}),
|
|
4702
4719
|
memory: { adviseDefaults: Boolean(legacyPod.memory && typeof legacyPod.memory === 'object' && !Array.isArray(legacyPod.memory)
|
|
4703
4720
|
&& (legacyPod.memory as Record<string, unknown>).adviseDefaults === true) },
|
|
@@ -4730,6 +4747,9 @@ export function buildUserConfig(path: string = defaultPath()): UserConfig {
|
|
|
4730
4747
|
? { worktreeAddTimeoutSec: harness.worktreeAddTimeoutSec } : {}),
|
|
4731
4748
|
...(typeof harness.defaultRepo === 'string' && isAbsolute(harness.defaultRepo)
|
|
4732
4749
|
? { defaultRepo: harness.defaultRepo } : {}),
|
|
4750
|
+
...(typeof harness.repo === 'string' && harness.repo.trim()
|
|
4751
|
+
? { repo: harness.repo.trim() } : {}),
|
|
4752
|
+
...(harness.authorOnPod === true ? { authorOnPod: true } : {}),
|
|
4733
4753
|
budgetGate: parseHarnessBudgetGate(
|
|
4734
4754
|
rawObj.harness && typeof rawObj.harness === 'object' && !Array.isArray(rawObj.harness)
|
|
4735
4755
|
? (rawObj.harness as Record<string, unknown>).budgetGate
|
|
@@ -5266,6 +5286,7 @@ export function buildUserConfig(path: string = defaultPath()): UserConfig {
|
|
|
5266
5286
|
},
|
|
5267
5287
|
},
|
|
5268
5288
|
intake: {
|
|
5289
|
+
eventMax: typeof intake.eventMax === 'number' && Number.isSafeInteger(intake.eventMax) && intake.eventMax >= 0 ? intake.eventMax : 10,
|
|
5269
5290
|
telegram: {
|
|
5270
5291
|
...(normalizeIntakeAmbientCaptureMode(intakeTelegram.ambientCapture) !== undefined
|
|
5271
5292
|
? { ambientCapture: normalizeIntakeAmbientCaptureMode(intakeTelegram.ambientCapture)! }
|
|
@@ -5972,8 +5993,10 @@ export function saveUserConfig(
|
|
|
5972
5993
|
revertGuard: cfg.harness?.revertGuard ?? rawHarness.revertGuard,
|
|
5973
5994
|
difficultyPlacement: cfg.harness?.difficultyPlacement ?? rawHarness.difficultyPlacement,
|
|
5974
5995
|
defaultRepo: cfg.harness?.defaultRepo ?? rawHarness.defaultRepo,
|
|
5996
|
+
repo: cfg.harness?.repo,
|
|
5975
5997
|
substrate: cfg.harness?.substrate,
|
|
5976
5998
|
podPool: cfg.harness?.podPool,
|
|
5999
|
+
authorOnPod: cfg.harness?.authorOnPod === true ? true : undefined,
|
|
5977
6000
|
queue: cfg.harness?.queue ?? rawHarness.queue,
|
|
5978
6001
|
}),
|
|
5979
6002
|
...rawRest,
|
|
@@ -6208,6 +6231,7 @@ export function saveUserConfig(
|
|
|
6208
6231
|
}),
|
|
6209
6232
|
}),
|
|
6210
6233
|
}),
|
|
6234
|
+
intake: { ...(rawRest.intake && typeof rawRest.intake === 'object' ? rawRest.intake as Record<string, unknown> : {}), ...cfg.intake },
|
|
6211
6235
|
dashboard: stripUndef({
|
|
6212
6236
|
views: cfg.dashboard.views,
|
|
6213
6237
|
theme: cfg.dashboard.theme,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"commit":"
|
|
1
|
+
{"commit":"f89d24931e428797960330ae109e8919ee784a15"}
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
import type { BashNode, NodeExecContext, NodeOutput, WorkflowDeps } from '../types.js';
|
|
9
9
|
import { interpolate } from '../variables.js';
|
|
10
10
|
|
|
11
|
+
/** Keep the start of stderr and its real error line. Bun prints the source frame first. */
|
|
12
|
+
export function formatBashStderr(stderr: string): string {
|
|
13
|
+
const head = 200;
|
|
14
|
+
const tail = 800;
|
|
15
|
+
if (stderr.length <= head + tail) return stderr;
|
|
16
|
+
return `${stderr.slice(0, head)}…${stderr.slice(-tail)}`;
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
export async function executeBashNode(
|
|
12
20
|
node: BashNode,
|
|
13
21
|
ctx: NodeExecContext,
|
|
@@ -30,7 +38,7 @@ export async function executeBashNode(
|
|
|
30
38
|
return {
|
|
31
39
|
ok: false,
|
|
32
40
|
output: r.stdout, // surface partial output for $node.output access
|
|
33
|
-
error: `bash exit ${r.exitCode}${r.stderr ? `: ${r.stderr
|
|
41
|
+
error: `bash exit ${r.exitCode}${r.stderr ? `: ${formatBashStderr(r.stderr)}` : ''}`,
|
|
34
42
|
durationMs: Date.now() - startedAt,
|
|
35
43
|
};
|
|
36
44
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4562],{12958:(e,t,n)=>{n.d(t,{a:()=>o});var r=n(55539),a=n(46124),s=n(74780);let l=e=>JSON.stringify([e.graphId,e.runId]);function o(e){let{client:t,approvals:n,onDecided:o,onPendingChange:i}=e,c=(0,a.useMemo)(()=>(0,s.ll)({client:t}),[t]),[d,u]=(0,a.useState)([]),[m,p]=(0,a.useState)({}),[h,f]=(0,a.useState)(null),[g,x]=(0,a.useState)(""),b=(0,a.useRef)(0),v=n.map(l).join("|");function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:m;u(e),i(n.filter(n=>!t[l(n)]&&e.some(e=>l(e)===l(n))).length)}async function w(e,t){let r=l(e);if(h||m[r]||!n.some(e=>l(e)===r)||!d.some(e=>l(e)===r))return;let a=b.current;f(r),x("");try{if(await c.decide(e.graphId,e.runId,t),b.current!==a)return;let n={...m,[r]:t};p(n),y(d,n),o();let s=await c.list();b.current===a&&y(s.items,n)}catch(e){b.current===a&&x((0,s.LP)(e,"decide"))}finally{b.current===a&&f(null)}}return((0,a.useEffect)(()=>{let e=++b.current;return(u([]),x(""),v)?(c.list().then(t=>{b.current===e&&y(t.items)}).catch(t=>{b.current===e&&x((0,s.LP)(t,"list"))}),()=>{b.current+=1}):(i(0),()=>{b.current+=1})},[c,v]),0===n.length)?null:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("h3",{className:"font-semibold",children:"게시 승인"}),g&&(0,r.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:g}),(0,r.jsx)("ul",{className:"space-y-2",children:n.map(e=>{let t=l(e),n=d.some(e=>l(e)===t);return(0,r.jsxs)("li",{className:"rounded-lg border border-border bg-background px-4 py-3 text-sm",children:[(0,r.jsx)("p",{children:e.message}),m[t]?(0,r.jsx)("p",{className:"mt-2 text-muted-foreground",children:"approved"===m[t]?"승인됨":"보류됨"}):n?(0,r.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,r.jsx)("button",{type:"button",disabled:null!==h,onClick:()=>void w(e,"approved"),className:"rounded-lg bg-primary px-3 py-1 text-primary-foreground disabled:opacity-50",children:"승인"}),(0,r.jsx)("button",{type:"button",disabled:null!==h,onClick:()=>void w(e,"rejected"),className:"rounded-lg border border-border px-3 py-1 disabled:opacity-50",children:"보류"})]}):(0,r.jsx)("p",{className:"mt-2 text-muted-foreground",children:"대기 중인 승인이 아닙니다."})]},t)})})]})}},43537:(e,t,n)=>{function r(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function a(e){return"string"==typeof e}function s(e){return a(e)&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,3})?Z$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString().slice(0,19)===e.slice(0,19)}function l(e){return r(e)&&a(e.nodeId)&&(null===e.ok||"boolean"==typeof e.ok)&&a(e.summary)}function o(e){return r(e)&&a(e.runId)&&a(e.status)&&a(e.startedAt)&&(null===e.version||a(e.version))&&Array.isArray(e.path)&&e.path.every(a)&&Array.isArray(e.nodes)&&e.nodes.every(l)}function i(e){return r(e)&&a(e.id)&&a(e.title)&&a(e.status)&&(void 0===e.owner||a(e.owner))&&a(e.updatedAt)&&(void 0===e.evidence||a(e.evidence))}n.d(t,{HG:()=>g,Kh:()=>f,Nn:()=>p,oc:()=>h});let c=e=>Number.isInteger(e)&&e>=0;function d(e){return r(e)&&a(e.id)&&a(e.title)&&(null===e.open||c(e.open))&&(null===e.landed||c(e.landed))&&(null===e.blocked||Array.isArray(e.blocked)&&e.blocked.every(e=>r(e)&&a(e.id)&&a(e.title)))}function u(e){return r(e)&&["OP","MK","TC","UX"].includes(e.seat)&&(void 0===e.role||a(e.role))&&(null===e.now||r(e.now)&&a(e.now.text)&&a(e.now.at))&&(null===e.landed||Array.isArray(e.landed)&&e.landed.every(e=>r(e)&&c(e.pr)&&a(e.title)&&a(e.at)&&(null===e.checklistId||a(e.checklistId))))&&(null===e.blocked||Array.isArray(e.blocked)&&e.blocked.every(e=>r(e)&&a(e.id)&&a(e.title)&&"red"===e.status))&&(null===e.pendingDecisions||c(e.pendingDecisions))&&(null===e.checklist||r(e.checklist)&&["green","yellow","red","done"].every(t=>c(e.checklist[t])))&&(void 0===e.subSeats||null===e.subSeats||Array.isArray(e.subSeats)&&e.subSeats.every(d))}async function m(e,t,n){try{let r=await e.fetchResponse(t,{method:"GET"});if(403===r.status)return{kind:"forbidden"};if(!r.ok)return{kind:"error",status:r.status};let a=n(await r.json());return null===a?{kind:"error",status:r.status}:{kind:"ready",data:a}}catch(e){return{kind:"error",status:0}}}function p(e,t){return m(e,"/v1/ops/seats".concat(t?"?date=".concat(encodeURIComponent(t)):""),e=>r(e)&&a(e.date)&&Array.isArray(e.seats)&&e.seats.every(u)&&new Set(e.seats.map(e=>e.seat)).size===e.seats.length?{date:e.date,seats:e.seats}:null)}function h(e,t){return m(e,"/v1/ops/release/runs".concat(t?"?version=".concat(encodeURIComponent(t)):""),e=>Array.isArray(e)&&e.every(o)?e:null)}function f(e,t,n){return m(e,"/v1/ops/release/runs/".concat(encodeURIComponent(t),"/nodes/").concat(encodeURIComponent(n),"/log"),e=>r(e)&&a(e.log)?{log:e.log}:null)}function g(e,t){return m(e,"/v1/ops/checklist?version=".concat(encodeURIComponent(t)),e=>{var t,n,l,o;if(!(r(e)&&a(e.version)&&(void 0===e.codename||a(e.codename))&&Array.isArray(e.items)&&e.items.every(i)&&["green","yellow","red","done"].every(t=>void 0===e[t]||Number.isInteger(e[t])&&e[t]>=0)&&(void 0===e.blocked||Array.isArray(e.blocked)&&e.blocked.every(a))&&(void 0===e.byOwner||r(e.byOwner)&&Object.values(e.byOwner).every(e=>Number.isInteger(e)&&e>=0))&&(void 0===e.history||Array.isArray(e.history))))return null;let c={green:0,yellow:0,red:0,done:0};for(let t of e.items)t.status in c&&c[t.status]++;return{version:e.version,...void 0!==e.codename?{codename:e.codename}:{},schedule:r(e.schedule)&&s(e.schedule.cutAt)&&(null===e.schedule.landBy||s(e.schedule.landBy))?{cutAt:e.schedule.cutAt,landBy:e.schedule.landBy}:null,items:e.items,green:null!=(t=e.green)?t:c.green,yellow:null!=(n=e.yellow)?n:c.yellow,red:null!=(l=e.red)?l:c.red,done:null!=(o=e.done)?o:c.done,...void 0!==e.blocked?{blocked:e.blocked}:{},...void 0!==e.byOwner?{byOwner:e.byOwner}:{},...void 0!==e.history?{history:e.history}:{}}})}},74780:(e,t,n)=>{function r(e){return{slides:e.slides.map(e=>{let{image:t,caption:n,include:r}=e;return{image:t,caption:n,include:r}}),caption:{hook:e.caption.hook,body:e.caption.body},hashtags:[...e.hashtags],cover:{text:e.cover.text,sub:e.cover.sub},location:e.location}}n.d(t,{$Y:()=>l,LP:()=>i,Mz:()=>r,ll:()=>d,rH:()=>o});class a extends Error{constructor(e,t){super(t),this.status=e,this.name="GraphApprovalsApiError"}}let s={list:"목록을 보려면",decide:"승인하려면",save:"초안을 저장하려면"},l="/app/settings/#bearer-token";function o(e){return e instanceof a&&(401===e.status||403===e.status)}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"decide";return e instanceof a?401===e.status||403===e.status?"".concat(s[t]," 이 기기를 데몬에 연결해야 합니다 — 설정 › 데몬 연결 › 연결 토큰 칸에 토큰을 넣어 주세요."):404===e.status?"이 실행을 찾지 못했습니다. 목록을 다시 확인해 주세요.":409===e.status?"이미 결정된 실행입니다. 목록을 다시 확인해 주세요.":400===e.status?"결정 내용을 확인한 뒤 다시 시도해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요.":e instanceof TypeError?"서버에 연결하지 못했습니다. 연결 상태를 확인해 주세요.":"승인 요청을 처리하지 못했습니다. 잠시 뒤 다시 시도해 주세요."}let c="/v1/graph-approvals";function d(e){var t,n;let r=(null!=(t=e.baseUrl)?t:"").replace(/\/+$/,""),s=null!=(n=e.fetchImpl)?n:fetch;async function l(t,n){let l={...n,headers:{"content-type":"application/json",...e.authHeader?{authorization:e.authHeader}:{}}},o=e.client?await e.client.fetchResponse(t,l):await s("".concat(r).concat(t),l),i=await o.json().catch(()=>null);if(!o.ok){let e=i&&"object"==typeof i&&"error"in i&&"string"==typeof i.error?i.error:"request-failed";throw new a(o.status,e)}return i}return{list:()=>l(c),decide:(e,t,n)=>l("".concat(c,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t)),{method:"POST",body:JSON.stringify({decision:n})}),saveFeedDraft:(e,t,n)=>l("".concat(c,"/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(t),"/feed-draft"),{method:"PUT",body:JSON.stringify(n)}),feedMedia:async(t,n,l)=>{let o="".concat(c,"/").concat(encodeURIComponent(t),"/").concat(encodeURIComponent(n),"/media?path=").concat(encodeURIComponent(l)),i={headers:e.authHeader?{authorization:e.authHeader}:{}},d=e.client?await e.client.fetchResponse(o,i):await s("".concat(r).concat(o),i);if(!d.ok)throw new a(d.status,"media-failed");return d.blob()}}}},94562:(e,t,n)=>{n.d(t,{ChatPanel:()=>eZ});var r=n(55539),a=n(46124),s=n(92156),l=n(94226),o=n(16190),i=n(46586),c=n(71923),d=n(15151),u=n(43537),m=n(37768);function p(){let{client:e}=(0,d.Q)(),[t,n]=(0,a.useState)([]);if((0,a.useEffect)(()=>{if("undefined"==typeof document)return;let t=!0,r=!1,a=async()=>{if(!t||r||document.hidden)return;r=!0;let a=new Intl.DateTimeFormat("sv-SE",{timeZone:"Asia/Seoul"}).format(new Date),s=await (0,u.Nn)(e,a);r=!1,t&&n((0,m.z)("ready"===s.kind?s.data:null,Date.now()))};n([]),a();let s=globalThis.setInterval(()=>{a()},6e4),l=()=>{document.hidden||a()};return document.addEventListener("visibilitychange",l),()=>{t=!1,globalThis.clearInterval(s),document.removeEventListener("visibilitychange",l)}},[e]),0===t.length)return null;let s=t.map(e=>{let{seat:t,text:n,ago:r}=e;return"".concat(t," ").concat(n," \xb7 ").concat(r)}).join(" | ");return(0,r.jsx)("div",{role:"status","aria-label":"지금 자리들이 하는 일",title:s,className:"h-8 min-h-8 min-w-0 shrink-0 overflow-hidden text-ellipsis whitespace-nowrap border-b border-border bg-background px-3 text-xs leading-8 text-muted-foreground",children:t.map((e,t)=>{let{seat:n,text:a,ago:s}=e;return(0,r.jsxs)("span",{children:[t>0&&" | ",n," ",a," \xb7 ",s]},n)})})}var h=n(3180),f=n(72215);function g(){let{client:e}=(0,d.Q)(),[t,n]=(0,a.useState)(!1),[s,l]=(0,a.useState)(!1),[o,i]=(0,a.useState)(""),c=(0,a.useRef)(!1),u=(0,a.useRef)(0),m=(0,a.useRef)(!1);(0,a.useEffect)(()=>(n("speechSynthesis"in window&&"undefined"!=typeof SpeechSynthesisUtterance),()=>{u.current++,m.current&&"speechSynthesis"in window&&window.speechSynthesis.cancel()}),[]);let p=async()=>{if(c.current||!t)return;c.current=!0;let n=++u.current;l(!0),i(""),m.current&&window.speechSynthesis.cancel(),m.current=!1;try{let t=await e.fetchResponse("/v1/context/now?format=voice",{method:"GET"});if(!t.ok)throw Error("HTTP ".concat(t.status));let r=await t.json();if(!r||"object"!=typeof r||!("text"in r)||"string"!=typeof r.text||!r.text.trim())throw Error("invalid voice summary");if(n!==u.current)return;let a=new SpeechSynthesisUtterance(r.text);a.lang="ko-KR",a.onend=()=>{n===u.current&&(m.current=!1)},a.onerror=()=>{n===u.current&&(m.current=!1)},m.current=!0,window.speechSynthesis.speak(a),(0,f.cY)("chat.now.speak",{outcome:"spoken"})}catch(e){if(n!==u.current)return;m.current=!1,i("지금 상황을 읽지 못했습니다. 다시 시도해 주세요."),(0,f.cY)("chat.now.speak",{outcome:"error",reason:String(e)})}finally{n===u.current&&(c.current=!1,l(!1))}};return(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1",children:[(0,r.jsxs)("button",{type:"button","data-elanous-action":"chat-now-speak","aria-label":"지금 상황 듣기",title:t?"지금 상황 두 문장 듣기":"이 브라우저는 음성 읽기를 지원하지 않습니다",disabled:!t||s,onClick:()=>void p(),className:"inline-flex min-h-9 items-center gap-1.5 rounded-full border border-border bg-background px-3 text-xs font-medium text-foreground hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",children:[(0,r.jsx)(h.A,{className:"h-4 w-4","aria-hidden":"true"}),(0,r.jsx)("span",{children:"지금 상황 듣기"})]}),o&&(0,r.jsx)("span",{role:"alert",className:"text-xs text-rose-600",children:o})]})}var x=n(12958),b=n(74780);function v(){let{client:e}=(0,d.Q)(),t=(0,a.useMemo)(()=>(0,b.ll)({client:e}),[e]),[n,s]=(0,a.useState)({client:e,items:[],pending:0,expanded:!1}),l=(0,a.useRef)(e);l.current=e;let o=(0,a.useRef)(!1),i=(0,a.useRef)(0),c=n.client===e?n:null,u=(0,a.useCallback)(async()=>{if(!o.current||l.current!==e||"undefined"!=typeof document&&document.hidden)return;let n=++i.current;try{let r=await t.list();if(!o.current||l.current!==e||i.current!==n)return;s(t=>l.current===e&&i.current===n?{client:e,items:r.items,pending:r.items.length,expanded:r.items.length>0&&t.client===e&&t.expanded}:t)}catch(t){if(!o.current||l.current!==e||i.current!==n)return;s(t=>l.current===e&&i.current===n?{client:e,items:[],pending:0,expanded:!1}:t)}},[t,e]);return((0,a.useEffect)(()=>{o.current=!0,s({client:e,items:[],pending:0,expanded:!1}),u();let t=globalThis.setInterval(()=>{u()},3e4),n=()=>{document.hidden||u()};return"undefined"!=typeof document&&document.addEventListener("visibilitychange",n),()=>{o.current=!1,i.current+=1,globalThis.clearInterval(t),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",n)}},[e,u]),(0,a.useEffect)(()=>{var e,t;(0,f.cY)("chat.approvals",{pending:null!=(e=null==c?void 0:c.pending)?e:0,expanded:null!=(t=null==c?void 0:c.expanded)&&t})},[null==c?void 0:c.pending,null==c?void 0:c.expanded]),null==c?void 0:c.pending)?(0,r.jsxs)("div",{className:"shrink-0 border-b border-border bg-background px-3 py-1.5 text-sm",children:[(0,r.jsxs)("button",{type:"button","aria-expanded":c.expanded,"aria-controls":"chat-approvals-panel",onClick:()=>s(t=>t.client===e?{...t,expanded:!t.expanded}:t),className:"rounded-full border border-border bg-muted px-3 py-1 font-medium text-foreground hover:bg-muted/70",children:["승인 대기 ",c.pending]}),c.expanded&&(0,r.jsx)("div",{id:"chat-approvals-panel",className:"mt-2 max-h-[min(50vh,24rem)] overflow-y-auto rounded-lg border border-border p-3",children:(0,r.jsx)(x.a,{client:e,approvals:c.items,onDecided:()=>{u()},onPendingChange:t=>{l.current===e&&s(n=>n.client===e?{...n,pending:t,...0===t?{items:[],expanded:!1}:{}}:n)}})})]}):null}async function y(e){let t=await e.fetchResponse("/v1/decisions?status=open");if(!t.ok)throw Error("decisions list failed: ".concat(t.status));return(await t.json()).decisions}async function w(e,t,n){let r=await e.fetchResponse("/v1/decisions/".concat(encodeURIComponent(t),"/decide"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({choice:n})});if(!r.ok)throw Error("decision failed: ".concat(r.status))}function j(){var e;let{client:t}=(0,d.Q)(),[n,s]=(0,a.useState)({client:t,items:[],expanded:!1,decided:{},busy:null}),l=(0,a.useRef)(t);l.current=t;let o=(0,a.useRef)(!1),i=(0,a.useRef)(0),c=(0,a.useRef)(null),u=n.client===t?n:null,m=(0,a.useCallback)(async()=>{if(!o.current||l.current!==t||"undefined"!=typeof document&&document.hidden)return;let e=++i.current;try{let n=await y(t);if(!o.current||l.current!==t||i.current!==e)return;s(e=>e.client===t?{...e,items:[...n,...e.items.filter(t=>e.decided[t.id]&&!n.some(e=>e.id===t.id))],expanded:e.expanded&&(n.length>0||e.items.some(t=>e.decided[t.id]))}:e)}catch(n){if(!o.current||l.current!==t||i.current!==e)return;s(e=>e.client===t?{...e,items:[],expanded:!1}:e)}},[t]);(0,a.useEffect)(()=>{o.current=!0,c.current=null,s({client:t,items:[],expanded:!1,decided:{},busy:null}),m();let e=globalThis.setInterval(()=>{m()},3e4),n=()=>{document.hidden||m()};return"undefined"!=typeof document&&document.addEventListener("visibilitychange",n),()=>{o.current=!1,c.current=null,i.current+=1,globalThis.clearInterval(e),"undefined"!=typeof document&&document.removeEventListener("visibilitychange",n)}},[t,m]);let p=async(e,r)=>{if(!c.current&&!n.busy&&!n.decided[e.id]){c.current=e.id,s(n=>n.client===t?{...n,busy:e.id}:n);try{if(await w(t,e.id,r.id),!o.current||l.current!==t)return;c.current=null,s(n=>n.client===t?{...n,busy:null,decided:{...n.decided,[e.id]:r.label}}:n),await m()}catch(e){o.current&&l.current===t&&(c.current=null,s(e=>e.client===t?{...e,busy:null}:e))}}},h=null!=(e=null==u?void 0:u.items.filter(e=>!u.decided[e.id]).length)?e:0;return u&&(h||u.expanded&&u.items.some(e=>u.decided[e.id]))?(0,r.jsxs)("div",{className:"shrink-0 border-b border-border bg-background px-3 py-1.5 text-sm",children:[(0,r.jsxs)("button",{type:"button","aria-expanded":u.expanded,"aria-controls":"chat-decisions-panel",onClick:()=>s(e=>e.client===t?{...e,expanded:!e.expanded}:e),className:"rounded-full border border-border bg-muted px-3 py-1 font-medium text-foreground hover:bg-muted/70",children:["대표 결정 ",h]}),u.expanded&&(0,r.jsx)("ul",{id:"chat-decisions-panel",className:"mt-2 max-h-[min(50vh,24rem)] space-y-2 overflow-y-auto rounded-lg border border-border p-3",children:u.items.map(e=>(0,r.jsxs)("li",{className:"rounded-lg border border-border p-3",children:[(0,r.jsx)("h3",{className:"font-semibold",children:e.title}),(0,r.jsx)("p",{className:"truncate text-muted-foreground",title:e.situation,children:e.situation}),u.decided[e.id]?(0,r.jsxs)("p",{role:"status",children:["결정함 — ",u.decided[e.id]]}):(0,r.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:e.options.map(t=>(0,r.jsxs)("button",{type:"button",disabled:!!u.busy,onClick:()=>{p(e,t)},className:"rounded-md border border-border px-2 py-1 hover:bg-muted disabled:opacity-50",children:[t.label,"option"in e.recommendation&&e.recommendation.option===t.id&&(0,r.jsx)("span",{className:"ml-1 text-primary",children:"추천"})]},t.id))})]},e.id))})]}):null}var k=n(84968),N=n(9851);function S(e){let{queue:t,onRemove:n,onClear:a}=e;return 0===t.length?null:(0,r.jsxs)("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5 border-t border-border bg-background px-3 py-2","aria-label":"보낼 차례",children:[t.map((e,t)=>(0,r.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border bg-muted px-2 py-1 text-xs",children:[(0,r.jsxs)("span",{className:"max-w-[160px] truncate",title:e.text,children:[t+1," \xb7 ",Array.from(e.text).slice(0,20).join("")]}),(0,r.jsx)("button",{type:"button",onClick:()=>n(e.id),"aria-label":"".concat(t+1,"번 지우기"),className:"rounded-full px-1 hover:bg-background",children:"\xd7"})]},e.id)),(0,r.jsx)("button",{type:"button",onClick:a,className:"rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted",children:"모두 지우기"})]})}function C(e){let t={files:[],tooLarge:0,tooMany:0};for(let n of e)n.file.size>0x1400000?t.tooLarge+=1:t.files.length>=10?t.tooMany+=1:t.files.push(n);return t}function I(e){return!!(e&&Array.from(e.types).includes("Files"))}function A(){return(0,r.jsx)("div",{role:"status","aria-label":"여기에 놓으면 첨부","data-elanous-chat-drop-overlay":"",className:"pointer-events-none absolute inset-0 z-30 flex items-center justify-center bg-background/80 backdrop-blur-sm",children:(0,r.jsxs)("div",{className:"mx-4 rounded-2xl border-2 border-dashed border-primary/60 bg-card/90 px-8 py-6 text-center shadow-lg",children:[(0,r.jsx)("p",{className:"text-lg font-semibold text-foreground",children:"여기에 놓으면 첨부"}),(0,r.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["파일 ",10,"개까지 \xb7 큰 파일은 빠집니다"]})]})})}function E(e,t,n){if("drop"===t||"end"===t||!n)return{visible:!1,depth:0};let r="enter"===t?e.depth+1:Math.max(0,e.depth-1);return{visible:r>0,depth:r}}var R=n(64667),D=n(44373),T=n(8114);function q(e){let{segmentKey:t,value:n,glyph:a}=e,s=function(e){var t;let n=/(\d{1,3})\s*%/.exec(e);if(!n)return null;let r=Number.parseInt(null!=(t=n[1])?t:"",10);return Number.isFinite(r)?Math.max(0,Math.min(100,r)):null}(n);if(null===s)return(0,r.jsxs)("span",{"data-elanous-hud-key":t,"data-elanous-hud-gauge":"false",className:"inline-flex items-center gap-1 font-mono text-[11px] text-muted-foreground",children:[a?(0,r.jsx)("span",{"aria-hidden":"true",children:a}):null,(0,r.jsx)("span",{children:n})]});let{bar:l,text:o}=s>=80?{bar:"bg-pink-400",text:"text-pink-300"}:s>=60?{bar:"bg-amber-400",text:"text-amber-300"}:{bar:"bg-emerald-500",text:"text-emerald-300"};return(0,r.jsxs)("span",{"data-elanous-hud-key":t,"data-elanous-hud-gauge":"true","data-elanous-hud-percent":String(s),className:"inline-flex items-center gap-1.5 font-mono text-[11px]",children:[a?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:a}):null,(0,r.jsx)("span",{role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"".concat(t," ").concat(s,"%"),className:"relative h-2 w-20 overflow-hidden rounded bg-muted/30",children:(0,r.jsx)("span",{"aria-hidden":"true",style:{width:"".concat(s,"%")},className:(0,D.cn)("block h-full",l)})}),(0,r.jsx)("span",{className:(0,D.cn)("tabular-nums",o),children:n})]})}let L=new Set(["variant","workspace","model","token-gauge","ctx","agent-activity","agents"]),U=new Set(["token-gauge","ctx"]),O={normal:"text-foreground",warn:"text-amber-300",danger:"text-pink-300",success:"text-emerald-300",info:"text-sky-300",muted:"text-muted-foreground"};function M(e){var t,n;let{segment:a}=e;if(U.has(a.key))return(0,r.jsx)(q,{segmentKey:a.key,value:a.value,...void 0!==a.glyph?{glyph:a.glyph}:{}});let s=a.tone?O[a.tone]:O.normal;return(0,r.jsxs)("span",{"data-elanous-hud-key":a.key,"data-elanous-hud-tone":null!=(t=a.tone)?t:"normal","data-elanous-hud-priority":String(null!=(n=a.priority)?n:50),className:(0,D.cn)("inline-flex items-center gap-1 font-mono text-[11px]",s),children:[a.glyph?(0,r.jsx)("span",{"aria-hidden":"true",children:a.glyph}):null,(0,r.jsx)("span",{children:a.value})]})}function F(e){let{segments:t,row:n,className:a}=e;return 0===t.length?null:(0,r.jsx)("div",{"data-elanous-hud-row":n,className:(0,D.cn)("flex flex-wrap items-center gap-x-3 gap-y-1",a),children:t.map((e,t)=>(0,r.jsxs)("span",{className:"flex items-center gap-x-3",children:[t>0?(0,r.jsx)("span",{"aria-hidden":"true",className:"text-muted-foreground",children:"\xb7"}):null,(0,r.jsx)(M,{segment:e})]},e.key))})}function P(e){let{segments:t}=e;if(0===t.length)return null;let{top:n,bottom:a}=function(e){let t=[],n=[];for(let r of e)L.has(r.key)?t.push(r):n.push(r);return{top:t,bottom:n}}(t);return(0,r.jsxs)("div",{"data-elanous-hud":"strip",role:"status","aria-label":"HUD status",className:"flex flex-col gap-0.5 border-b border-border/40 bg-muted/10 px-3 py-1.5",children:[(0,r.jsx)(F,{segments:n,row:"top"}),(0,r.jsx)(F,{segments:a,row:"bottom",className:"hidden sm:flex"})]})}let Y=[];function _(){return Y}function J(){let e=(0,a.useSyncExternalStore)(T.er,T.Wl,_);return(0,r.jsx)(P,{segments:e})}function z(e,t){if("string"!=typeof e)return t;let n=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.\d+)?(?:Z|[+-](\d{2}):(\d{2}))$/.exec(e);if(!n)return t;let[,r,a,s,l,o,i,c,d]=n,u=Number(r),m=Number(a),p=Number(s),h=[31,u%4==0&&(u%100!=0||u%400==0)?29:28,31,30,31,30,31,31,30,31,30,31][m-1];if(p<1||void 0===h||p>h||Number(l)>23||Number(o)>59||Number(i)>59||void 0!==c&&(Number(c)>23||Number(d)>59))return t;let f=Date.parse(e);return Number.isFinite(f)?f:t}var $=n(5997),Q=n(65194),K=n(67903),B=n(36898),G=n(56360),H=n(76573),W=n(75342),Z=n(14222);let V={idle:"음성 대기",connecting:"데몬 연결 중…",listening:"듣는 중",processing:"생각 중…",speaking:"말하는 중",error:"음성 오류"},X={idle:"마이크를 켜서 대화를 시작하세요.",connecting:"잠시만 기다려주세요.",listening:"문장이 끝나면 자동으로 전송됩니다.",processing:"서버가 응답을 생성하는 중입니다.",speaking:"음성 응답을 재생하는 중입니다.",error:"아래 메시지를 확인하고 다시 시도하세요."},ee={idle:"bg-slate-400",connecting:"bg-amber-500",listening:"bg-emerald-500",processing:"bg-sky-500",speaking:"bg-fuchsia-500",error:"bg-rose-600"};function et(e){let{active:t,phase:n,errorMsg:a,onToggle:s,ttsSupported:i=!1,ttsMuted:c=!1,onTtsToggle:d,onInterrupt:u}=e,m="speaking"===n&&"function"==typeof u;return(0,r.jsxs)("div",{"data-elanous-voice-overlay":!0,"aria-hidden":!t,className:(0,D.cn)("pointer-events-none absolute inset-0 z-10 flex items-center justify-center transition-opacity duration-300",t?"pointer-events-auto opacity-100":"opacity-0"),children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-background/60 backdrop-blur-md"}),(0,r.jsxs)("div",{className:"relative mx-4 flex w-full max-w-sm flex-col items-center gap-5 rounded-xl border border-border bg-card px-6 py-7 text-center shadow-xl",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,r.jsx)("span",{className:(0,D.cn)("h-2.5 w-2.5 rounded-full",ee[n],("listening"===n||"speaking"===n||"connecting"===n)&&"animate-pulse"),"aria-hidden":!0}),(0,r.jsx)("span",{className:"font-medium tracking-wide",children:V[n]})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground",children:X[n]}),(0,r.jsx)("button",{type:"button",onClick:m?u:s,"data-elanous-action":m?"voice-overlay-interrupt":"voice-overlay-toggle",className:(0,D.cn)("inline-flex h-16 w-16 items-center justify-center rounded-full text-white transition-colors",m?"bg-amber-500 hover:bg-amber-400 animate-pulse":"connecting"===n||"processing"===n?"bg-sky-500 hover:bg-sky-400":"error"===n?"bg-rose-600 hover:bg-rose-500":"bg-rose-500 hover:bg-rose-400"),"aria-label":m?"끼어들기":"마이크 끄기",children:m?(0,r.jsx)(G.A,{className:"h-7 w-7"}):"connecting"===n||"processing"===n?(0,r.jsx)(H.A,{className:"h-7 w-7 animate-spin"}):"error"===n?(0,r.jsx)(W.A,{className:"h-7 w-7"}):(0,r.jsx)(l.A,{className:"h-7 w-7"})}),a&&(0,r.jsx)("p",{className:"max-w-xs text-xs text-rose-500",children:a}),(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[i&&d&&(0,r.jsxs)("button",{type:"button",onClick:d,"data-elanous-action":"voice-overlay-tts-toggle",className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground","aria-label":c?"음성 응답 켜기":"음성 응답 끄기","aria-pressed":!c,children:[c?(0,r.jsx)(Z.A,{className:"h-3.5 w-3.5"}):(0,r.jsx)(h.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:c?"음성 응답 OFF":"음성 응답 ON"})]}),(0,r.jsxs)("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground","aria-label":"음성 닫고 텍스트로 돌아가기",children:[(0,r.jsx)(o.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{children:"음성 끄기"})]})]})]})]})}function en(e){let{open:t,onClose:n,lines:s}=e,[l,o]=(0,a.useState)(""),i=(0,a.useMemo)(()=>{if(!l.trim())return null;try{return RegExp(l,"i")}catch(e){return null}},[l]),c=(0,a.useMemo)(()=>l.trim().toLowerCase(),[l]),d=(0,a.useMemo)(()=>{let e=s.length>200?s.slice(s.length-200):s;return i?e.filter(e=>i.test(e.category)||i.test(e.event)):c?e.filter(e=>e.category.toLowerCase().includes(c)||e.event.toLowerCase().includes(c)):e},[s,i,c]);return(0,r.jsx)("div",{"data-elanous-debug-tap-drawer":t?"open":"closed",className:(0,D.cn)("fixed bottom-0 left-0 right-0 z-50 transition-transform duration-200 ease-out","pointer-events-none",t?"translate-y-0":"translate-y-full"),role:"region","aria-label":"Debug Tap Drawer","aria-hidden":!t,children:(0,r.jsxs)("div",{className:(0,D.cn)("pointer-events-auto mx-auto flex max-h-[60vh] w-full max-w-[1100px] flex-col","rounded-t-md border border-b-0 border-border bg-card shadow-xl"),children:[(0,r.jsxs)("header",{className:"flex items-center justify-between gap-2 border-b border-border/60 px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Debug Tap"}),(0,r.jsxs)("span",{className:"text-[10px] text-muted-foreground/70","data-elanous-debug-tap-count":d.length,"data-elanous-debug-tap-total":s.length,children:[d.length,"/",s.length]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"text",placeholder:"regex filter…",value:l,onChange:e=>o(e.target.value),spellCheck:!1,autoComplete:"off",className:(0,D.cn)("w-40 rounded border border-border bg-background px-2 py-1 text-[11px] font-mono","focus:outline-none focus:ring-1 focus:ring-primary"),"data-elanous-debug-tap-filter":"","aria-label":"Filter debug lines"}),(0,r.jsx)("button",{type:"button",onClick:n,className:"rounded px-2 py-1 text-xs text-muted-foreground hover:bg-muted hover:text-foreground","aria-label":"Close debug drawer","data-elanous-debug-tap-close":"",children:"✕"})]})]}),(0,r.jsx)("ul",{className:"flex-1 overflow-y-auto px-3 py-2 text-[11px] font-mono","data-elanous-debug-tap-list":"",children:0===d.length?(0,r.jsx)("li",{className:"italic text-muted-foreground/60",children:0===s.length?"(no debug lines yet)":"(no matches for filter)"}):d.map((e,t)=>(0,r.jsx)(er,{line:e},"".concat(e.loggedAt,"-").concat(e.seq,"-").concat(t)))})]})})}function er(e){let{line:t}=e,n=new Date(t.loggedAt).toISOString().slice(11,23);return(0,r.jsxs)("li",{"data-elanous-debug-tap-line":"","data-elanous-category":t.category,"data-elanous-event":t.event,className:"py-0.5",children:[(0,r.jsxs)("span",{className:"text-muted-foreground/70",children:["[",n,"]"]})," ",(0,r.jsxs)("span",{className:"text-amber-400",children:["[",t.category,"]"]})," ",(0,r.jsx)("span",{className:"text-foreground",children:t.event}),void 0!==t.data&&(0,r.jsxs)("details",{className:"ml-4 text-muted-foreground",children:[(0,r.jsx)("summary",{className:"cursor-pointer select-none text-[10px]",children:"data"}),(0,r.jsx)("pre",{className:"m-0 mt-1 whitespace-pre-wrap break-all text-[10px] text-muted-foreground/80",children:function(e){try{return JSON.stringify(e,null,2)}catch(t){return String(e)}}(t.data)})]})]})}var ea=n(60516),es=n(56974),el=n(87969),eo=n(25042),ei=n(9734),ec=n(30158),ed=n(2021);let eu="Other";function em(e){let{request:t,onSubmit:n,onCancel:a,onChatAboutThis:s}=e;return(0,r.jsx)(eo.lG,{open:null!==t,onOpenChange:e=>{e||a()},children:(0,r.jsx)(eo.Cf,{className:"max-w-2xl",children:t?(0,r.jsx)(ep,{request:t,onSubmit:n,onCancel:a,onChatAboutThis:s}):null})})}function ep(e){let{request:t,onSubmit:n,onCancel:s,onChatAboutThis:l}=e,[o,i]=(0,a.useState)(()=>Object.fromEntries(t.questions.map(e=>[e.id,new Set]))),[c,d]=(0,a.useState)({}),[u,m]=(0,a.useState)({}),p=1===t.questions.length?t.questions[0].header:"Pick options",h=(0,a.useMemo)(()=>{for(let n of t.questions){var e;let t=null!=(e=o[n.id])?e:new Set,r=eg(n,o,u);if(0===t.size&&!r)return!1}return!0},[t.questions,o,u]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eo.c7,{children:[(0,r.jsx)(eo.L3,{children:p}),1===t.questions.length?(0,r.jsx)(eo.rr,{children:t.questions[0].question}):(0,r.jsxs)(eo.rr,{children:[t.questions.length," questions"]})]}),(0,r.jsx)(ed.F,{className:"max-h-[60vh] pr-2",children:(0,r.jsx)("div",{className:"flex flex-col gap-6 py-2",children:t.questions.map(e=>{var t;return(0,r.jsx)(eh,{question:e,isSelected:t=>{var n,r,a;return n=e.id,null!=(a=null==(r=o[n])?void 0:r.has(t))&&a},onToggle:t=>{i(n=>{var r;let a={...n},s=new Set(null!=(r=a[e.id])?r:[]);return e.multiSelect?s.has(t)?s.delete(t):s.add(t):(s.clear(),s.add(t),m(t=>({...t,[e.id]:!1}))),a[e.id]=s,a})},otherActive:eg(e,o,u),onToggleOther:()=>{e.multiSelect?m(t=>{var n;return{...t,[e.id]:!(null!=(n=t[e.id])&&n)}}):i(t=>{let n={...t};return n[e.id]=new Set([eu]),n})},otherText:null!=(t=c[e.id])?t:"",onOtherText:t=>d(n=>({...n,[e.id]:t}))},e.id)})})}),(0,r.jsxs)(eo.Es,{className:"flex-wrap gap-2 sm:justify-between",children:[(0,r.jsx)(ei.$,{variant:"ghost",onClick:l,"aria-label":"Chat about this",children:"\uD83D\uDCAC Chat about this"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(ei.$,{variant:"outline",onClick:s,children:"Cancel"}),(0,r.jsx)(ei.$,{onClick:function(){let e={},r={};for(let n of t.questions){var a,s;let t=Array.from(null!=(a=o[n.id])?a:[]);if(eg(n,o,u)&&!t.includes(eu)&&t.push(eu),0!==t.length&&(n.multiSelect?e[n.id]=t:e[n.id]=t[0],t.includes(eu))){let e=(null!=(s=c[n.id])?s:"").trim();e.length>0&&(r[n.id]=e)}}let l={answers:e};Object.keys(r).length>0&&(l.otherText=r),n(l)},disabled:!h,children:"Submit"})]})]})]})}function eh(e){var t,n;let{question:a}=e;return(0,r.jsxs)("section",{className:"flex flex-col gap-2",children:[""!==e.question.id?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"rounded-full bg-primary/15 px-2 py-0.5 text-xs font-medium text-primary",children:a.header}),a.multiSelect?(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"multi-select"}):null]}):null,(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[a.options.map(t=>{var n;return(0,r.jsx)(ef,{multi:null!=(n=a.multiSelect)&&n,option:t,selected:e.isSelected(t.label),onToggle:()=>e.onToggle(t.label)},t.label)}),null==(t=a.includeOther)||t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ef,{multi:null!=(n=a.multiSelect)&&n,option:{label:"Other",description:"Type your own response"},selected:e.otherActive,onToggle:e.onToggleOther}),e.otherActive?(0,r.jsx)(ec.p,{value:e.otherText,onChange:t=>e.onOtherText(t.target.value),placeholder:"Type your own response","aria-label":"Other response",className:"ml-8"}):null]}):null]})]})}function ef(e){let{multi:t,option:n,selected:a,onToggle:s}=e;return(0,r.jsxs)("button",{type:"button",role:t?"checkbox":"radio","aria-checked":a,onClick:s,className:"\n flex items-start gap-3 rounded-md border p-3 text-left\n transition-colors\n ".concat(a?"border-primary bg-primary/10":"border-border hover:bg-muted/40","\n "),children:[(0,r.jsx)("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center ".concat(t?"rounded":"rounded-full"," border ").concat(a?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40"),"aria-hidden":"true",children:a?t?"✓":"●":null}),(0,r.jsxs)("span",{className:"flex flex-col gap-0.5",children:[(0,r.jsx)("span",{className:"font-medium",children:n.label}),(0,r.jsx)("span",{className:"text-sm text-muted-foreground",children:n.description}),n.preview?(0,r.jsx)("span",{className:"mt-1 rounded bg-muted/40 px-2 py-1 text-xs font-mono text-muted-foreground",children:n.preview}):null]})]})}function eg(e,t,n){var r,a,s;return e.multiSelect?null!=(a=n[e.id])&&a:null!=(s=null==(r=t[e.id])?void 0:r.has(eu))&&s}function ex(e){if(void 0===e)return"";if("string"==typeof e)return e;try{var t;return null!=(t=JSON.stringify(e,null,2))?t:""}catch(e){return""}}function eb(e){let{request:t,receivedAt:n,onChoose:s,onCancel:l}=e,[o,i]=(0,a.useState)(()=>Date.now());(0,a.useEffect)(()=>{if(!t)return;i(Date.now());let e=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(e)},[t]);let c=t?ex(t.toolCall.rawInput):"",d=t?function(e){if(e&&"object"==typeof e&&!Array.isArray(e)){for(let t of["file_path","filePath","path","command","cmd"])if("string"==typeof e[t])return e[t].slice(0,80)}return ex(e).replace(/\s+/g," ").slice(0,80)}(t.toolCall.rawInput):"",u=Math.max(0,Math.ceil((n+6e4-o)/1e3));return(0,r.jsx)(eo.lG,{open:null!==t,onOpenChange:e=>{!e&&t&&l(t)},children:(0,r.jsx)(eo.Cf,{className:"max-w-lg",children:t&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(eo.c7,{children:[(0,r.jsx)(eo.L3,{children:"이 작업을 실행할까요?"}),(0,r.jsxs)(eo.rr,{children:["도구: ",t.toolCall.title]})]}),d&&(0,r.jsx)("p",{className:"truncate font-mono text-sm",title:d,children:d}),c&&(0,r.jsxs)("details",{className:"text-sm",children:[(0,r.jsx)("summary",{className:"cursor-pointer",children:"자세히"}),(0,r.jsx)("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all rounded bg-muted p-2",children:c})]}),(0,r.jsxs)("p",{className:"text-xs text-muted-foreground","aria-live":"off",children:["남은 시간: ",u,"초"]}),(0,r.jsxs)(eo.Es,{className:"flex-wrap gap-2",children:[(0,r.jsx)(ei.$,{onClick:()=>s(t,"allow_once"),children:"이번만 허용"}),(0,r.jsx)(ei.$,{variant:"outline",onClick:()=>s(t,"allow_always"),children:"이 도구는 항상 허용"}),(0,r.jsx)(ei.$,{variant:"outline",onClick:()=>s(t,"reject_once"),children:"거절"})]})]})})})}let ev={outcome:{outcome:"cancelled"}},ey=["allow_once","allow_always","reject_once","reject_always"],ew="unverified";var ej=n(60750),ek=n(67327);function eN(e,t){var n;return"error"!==t.kind?null:null!=(n=function(e){if(!e||"object"!=typeof e)return null;let{error:t,message:n,holder:r}=e;return"turn_busy"!==t?null:{message:"string"==typeof n?n:"This session is currently receiving input. Please try again when that turn finishes.",holder:"string"==typeof r&&r.trim()?r:null}}(t.payload))?n:e}var eS=n(61897);function eC(e){return"string"==typeof e.mediaType&&e.mediaType.toLowerCase().startsWith("image/")}async function eI(e,t){let n=e.downloadUrl.startsWith("http")?e.downloadUrl:"".concat(t.baseUrl.replace(/\/$/,"")).concat(e.downloadUrl),r={};t.token&&(r.authorization="Bearer ".concat(t.token));let a=await fetch(n,{headers:r});if(!a.ok)throw Error("fetch attachment ".concat(e.id," failed: ").concat(a.status));return function(e){let t=new Uint8Array(e),n="";for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}(await a.arrayBuffer())}async function eA(e,t,n){if(0===t.length)return null;let r=[];for(let a of(e.length>0&&r.push({type:"text",text:e}),t))if(eC(a))try{let e=await eI(a,n);r.push({type:"image",mimeType:a.mediaType,data:e})}catch(t){let e=t instanceof Error?t.message:String(t);r.push({type:"text",text:"[image fetch failed: ".concat(a.filename," — ").concat(e,"]")})}else r.push({type:"resource_link",uri:a.path?"file://".concat(a.path):a.downloadUrl,mimeType:a.mediaType,name:a.filename});return r}let eE="elanous.pwa.pendingCardFollowups";function eR(e,t){try{var n;let r=JSON.parse(null!=(n=e.getItem(eE))?n:"[]");if(!Array.isArray(r))return[];return r.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.sessionId&&e.sessionId.length>0&&"string"==typeof e.id&&e.id.length>0&&"number"==typeof e.startedAt&&Number.isFinite(e.startedAt)&&e.startedAt<=t&&t-e.startedAt<9e5)}catch(e){return[]}}function eD(e,t){try{t.length?e.setItem(eE,JSON.stringify(t)):e.removeItem(eE)}catch(e){}}function eT(){try{return window.localStorage}catch(e){return}}async function eq(e,t,n,r){let a=await e.fetchResponse("/v1/card-followup",{...r?{signal:r}:{},method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({attachmentId:t,...void 0===n?{}:{context:n}})});if(!a.ok)throw Error("card followup start failed: ".concat(a.status));let s=await a.json();if("string"!=typeof s.id||!s.id)throw Error("card followup start returned no id");return s.id}async function eL(e,t){let n,{intervalMs:r=3e3,signal:a,onStatus:s,startedAt:l}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=void 0===l?6e5:Math.max(0,l+9e5-Date.now()),i=Date.now()+o,c={status:"failed"},d=new AbortController,u=a?AbortSignal.any([a,d.signal]):d.signal,m=!1,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise((n,r)=>{let s;if(u.aborted){var l;r(null!=(l=null==a?void 0:a.reason)?l:Error("aborted"));return}let o="undefined"==typeof document?void 0:document,i=()=>{clearTimeout(s),null==o||o.removeEventListener("visibilitychange",c),u.removeEventListener("abort",d)},c=()=>{(null==o?void 0:o.visibilityState)!=="hidden"&&(i(),n())},d=()=>{var e;i(),r(null!=(e=null==a?void 0:a.reason)?e:Error("aborted"))};s=setTimeout(()=>{i(),n()},e),t&&(null==o||o.addEventListener("visibilitychange",c)),u.addEventListener("abort",d,{once:!0})})},h=async()=>{for(;Date.now()<i;){var n,l;if(null==a?void 0:a.aborted)throw null!=(n=a.reason)?n:Error("aborted");if("undefined"!=typeof document&&"hidden"===document.visibilityState){await p(i-Date.now(),!0);continue}let o=await e.fetchResponse("/v1/card-followup/".concat(encodeURIComponent(t)),{signal:u});if(!o.ok)throw Error("card followup poll failed: ".concat(o.status));let d=await o.json();if(null==a?void 0:a.aborted)throw null!=(l=a.reason)?l:Error("aborted");if(m)return c;if(null==s||s(d.status),"done"===d.status||"not-card"===d.status||"failed"===d.status)return d;await p(Math.min(Math.max(0,r),Math.max(0,i-Date.now())))}return null==s||s("failed"),c};try{return await Promise.race([h(),new Promise(e=>{n=setTimeout(()=>{m=!0,d.abort(),null==s||s("failed"),e(c)},o)})])}finally{clearTimeout(n)}}function eU(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{compact:n}=(0,c.K)(),[u,m]=(0,a.useState)(!1),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!u)return;let e=e=>{h.current&&h.current.contains(e.target)||m(!1)},t=e=>{"Escape"===e.key&&m(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[u]),(0,a.useEffect)(()=>{n||m(!1)},[n]);let{client:x,config:b,sessionId:y,setSessionId:w}=(0,d.Q)(),[q,L]=(0,a.useState)([]),[U,O]=(0,a.useState)(),[M,F]=(0,a.useState)(!1),[P,Y]=(0,a.useState)([]),_=(0,a.useRef)([]),G=(0,a.useRef)(y),H=(0,a.useRef)(y),W=(0,a.useRef)(null),Z=(0,a.useRef)(0),V=(0,a.useRef)(0),X=(0,a.useRef)(!1),[ee,er]=(0,a.useState)(null),eo=G.current!==y&&W.current!==y?[]:P;(0,a.useLayoutEffect)(()=>{H.current=y,G.current!==y&&(W.current!==y&&(Z.current++,_.current=[],Y([]),L([]),eg.current&&F(!1)),G.current=y,W.current=null)},[y]);let ei=e=>{_.current=e,Y(e)},[ec,ed]=(0,a.useState)(null),[eu,ep]=(0,a.useState)(null),[eh,ef]=(0,a.useState)([]),eg=(0,a.useRef)(null),ex=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{var e;ex.current!==H.current&&(null==(e=eg.current)||e.abort())},[y]),(0,a.useEffect)(()=>()=>{var e;null==(e=eg.current)||e.abort()},[]);let[eI,eE]=(0,a.useState)({visible:!1,depth:0});(0,a.useEffect)(()=>{let e=()=>eE(e=>E(e,"end",!1));return window.addEventListener("dragend",e),()=>window.removeEventListener("dragend",e)},[]);let eU=(0,a.useRef)(!1),eO=(0,a.useRef)(null),eM=(0,a.useRef)(null),[eF,eP]=(0,a.useState)(null),eY=(0,a.useMemo)(()=>{try{let e=new URLSearchParams(window.location.search);return"on"===e.get("debug-tap")}catch(e){return!1}},[]),[e_,eJ]=(0,a.useState)(eY),ez=(0,a.useMemo)(()=>{let e=[];for(let t of q)if(Array.isArray(t.blocks)){for(let n of t.blocks)if("debug_session"===n.kind)for(let t of n.lines)e.push({seq:t.seq,category:t.category,event:t.event,...void 0!==t.data?{data:t.data}:{},loggedAt:t.loggedAt})}return e},[q]),e$=(0,a.useRef)(async()=>{}),eQ=(0,a.useRef)(!1);eQ.current=M;let eK=(0,a.useRef)(async()=>{}),eB=x.voiceWsUrl(),eG=(0,a.useCallback)(e=>{let t=e.trim();if(t){if(eQ.current)return void(0,f.cY)("chat.voice.skip-pending",{len:t.length});(0,f.cY)("chat.voice.auto-send",{len:t.length}),e$.current(t)}},[]),eH=(0,es.sS)({wsUrl:eB,...b.token?{token:b.token}:{},onTranscript:eG}),eW=!!b.baseUrl;eK.current=()=>eH.toggle();let[eZ,eV]=(0,a.useState)(!1),eX=(0,el.$)({enabled:eH.active&&!eZ,language:"ko-KR"}),e0=(0,a.useCallback)(()=>{null==eu||eu.abort(),(0,f.cY)("webterm.chat.stop",{had:!!eu})},[eu]);(0,a.useEffect)(()=>{if(!eu)return;let e=e=>{var t;if("Escape"!==e.key)return;let n=e.target,r=null==n||null==(t=n.tagName)?void 0:t.toLowerCase();"input"===r||"textarea"===r||null!=n&&n.isContentEditable||(e.preventDefault(),e0())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eu,e0]),(0,a.useEffect)(()=>{let e=e=>{"m"===e.key.toLowerCase()&&e.shiftKey&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),(0,f.cY)("chat.voice.shortcut.toggle"),eK.current())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let e1=(0,a.useCallback)(e=>{ef(t=>[...t,...e]),(0,f.cY)("webterm.chat.attach.queue",{added:e.length,filenames:e.map(e=>e.filename)})},[]),e2=async e=>{let{files:t,tooLarge:n,tooMany:r}=e;if(n&&ek.oR.error("".concat(n," files exceed the 20 MB attachment limit")),r&&ek.oR.error("".concat(r," files exceed the 10-file attachment limit")),0===t.length)return;if(!b.baseUrl)return void ek.oR.error("Daemon URL 미설정 — Settings 에서 입력");let a=await (0,eS.K)(t,{baseUrl:b.baseUrl,...b.token?{token:b.token}:{}}),s=a.filter(e=>e.ok).map(e=>e.meta),l=a.filter(e=>!e.ok);s.length&&(e1(s),ek.oR.success(1===s.length?"\uD83D\uDCCE ".concat(s[0].filename):"\uD83D\uDCCE ".concat(s.length," files attached"))),l.length&&ek.oR.error(1===l.length?"업로드 실패: ".concat(l[0].reason.slice(0,80)):"".concat(l.length," 파일 업로드 실패"))};(0,a.useEffect)(()=>{try{let e=window.sessionStorage.getItem("elanous.pwa.shareAttachments");if(!e)return;window.sessionStorage.removeItem("elanous.pwa.shareAttachments");let t=JSON.parse(e);if(!Array.isArray(t)||0===t.length)return;ef(e=>[...e,...t]);let n=1===t.length?"1 file shared from another app":"".concat(t.length," files shared from another app");ek.oR.success(n),(0,f.cY)("pwa.chat.share-attachments.consume",{count:t.length})}catch(e){(0,f.cY)("pwa.chat.share-attachments.parse-failed",{reason:e instanceof Error?e.message:String(e)})}},[]),(0,a.useEffect)(()=>{if(!y)return;let e=!0;return(async()=>{try{let t=await x.fetchJson("/v1/sessions/store/".concat(encodeURIComponent(y),"?ifExists=1"));if(!e||!(null==t?void 0:t.messages)||0===t.messages.length)return;L(e=>e.some(e=>!e.id.startsWith("m-card-resume-"))?e:[...function(e,t){let n,r,a=[],s=[];for(let o of e){var l;if("tool"===o.role){for(let e of(0===s.length&&(r=o.ts),function(e,t){let n,r=function(e,t){var n,r;let a,s=String(null!=(n=e.toolName)?n:"");try{a=JSON.parse(String(null!=(r=e.toolResult)?r:""))}catch(e){a=void 0}let l=a&&"object"==typeof a&&!Array.isArray(a)?a:void 0,o=null==l?void 0:l._meta,i=o&&"object"==typeof o&&!Array.isArray(o)?o.ui:void 0,c=i&&"object"==typeof i&&!Array.isArray(i)?i.resourceUri:void 0,d=null==l?void 0:l["ui/resourceUri"],u="string"==typeof c?c:"string"==typeof d?d:void 0;return void 0!==u&&""!==u.trim()?{kind:"mcp_app",toolId:t,toolName:s,screenUrl:u,...void 0!==a?{toolResult:a}:{}}:{kind:"tool_use",id:t,name:s,status:"done",...void 0!==l&&void 0!==e.toolArgs?{args:{raw:String(e.toolArgs)}}:{}}}(e,t);try{var a;n=JSON.parse(String(null!=(a=e.toolResult)?a:""))}catch(e){n=void 0}let s=(0,T.uS)(n).map(e=>({kind:"image",...e})),l=[];return(0,T.ki)(l,null!=n?n:e.toolResult),[...s,r,...l]}(o,"restore-tool-".concat(s.length,"-").concat(a.length))))"image"===e.kind&&s.some(t=>"image"===t.kind&&t.src===e.src)||s.push(e);continue}if("user"!==o.role&&"assistant"!==o.role)continue;let e=String(null!=(l=o.content)?l:""),i=String(null!=e?e:"").split("\n").filter(e=>!/^\[tool_(use|result)\]$/.test(e.trim())).join("\n"),c="assistant"===o.role?"assistant":"user";if(""===i.trim()){s.length>0&&"assistant"===c&&(a.push({id:"restore-".concat(a.length),role:c,text:"",blocks:s,timestamp:z(r,t+a.length)}),s=[],r=void 0);continue}let d=i!==e,u=void 0!==n&&n.role===c&&n.text===i&&(d||n.wasStripped)&&0===s.length;if(n={role:c,text:i,wasStripped:d},u)continue;let m=s.length>0&&"assistant"===c?[...s,{kind:"text",text:i}]:void 0,p=z(void 0!==m?r:o.ts,t+a.length);void 0!==m&&(s=[],r=void 0),a.push({id:"restore-".concat(a.length),role:c,text:i,...void 0!==m?{blocks:m}:{},timestamp:p})}return s.length>0&&a.push({id:"restore-".concat(a.length),role:"assistant",text:"",blocks:s,timestamp:z(r,t+a.length)}),a}(t.messages,Date.now()),...e])}catch(e){}})(),()=>{e=!1}},[y,x]);let e3=(0,a.useCallback)(e=>{ef(t=>t.filter(t=>t.id!==e))},[]),e5={client:x,sessionId:y,provider:b.provider,setSessionId:w,daemon:{baseUrl:b.baseUrl,...b.token?{token:b.token}:{}},messages:q},e4=e=>{L(t=>[...t,e])},e6=async(e,t,n,r,a)=>{var s;let l=await eL(x,e,{signal:r.signal,...void 0===a?{}:{startedAt:a},onStatus:e=>(0,f.cY)("pwa.chat.card-followup",{phase:"poll",status:e})});if(r.signal.aborted||H.current!==t)return"terminal";let o=eT();return(o&&function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Date.now();eD(e,eR(e,r).filter(e=>e.sessionId!==t||e.id!==n))}(o,t,e),"not-card"===l.status)?(L(e=>e.filter(e=>e.id!==n)),(0,f.cY)("pwa.chat.card-followup",{phase:"fallback",status:l.status}),"not-card"):("done"===l.status&&(null==(s=l.replies)?void 0:s.length)===3&&l.replies.every(e=>"string"==typeof e)?(L(e=>[...e.filter(e=>e.id!==n),...l.replies.map((e,t)=>({id:"".concat(n,"-").concat(t),role:"assistant",text:e,timestamp:Date.now(),meta:{provider:b.provider}}))]),(0,f.cY)("pwa.chat.card-followup",{phase:"complete",status:"done"})):(L(e=>e.map(e=>e.id===n?{...e,text:"명함 정리에 실패했습니다 — 다시 보내 주세요"}:e)),(0,f.cY)("pwa.chat.card-followup",{phase:"complete",status:"failed"})),"terminal")};(0,a.useEffect)(()=>{if(!y)return;let e=eT();if(!e)return;let t=(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=eR(e,n);return eD(e,r),r.filter(e=>e.sessionId===t)})(e,y).map(e=>{let{id:t,startedAt:n}=e,r=new AbortController,a="m-card-resume-".concat(t);return L(e=>e.some(e=>e.id===a)?e:[...e,{id:a,role:"assistant",text:"명함 읽는 중… 조사 중…",timestamp:n,meta:{provider:b.provider}}]),e6(t,y,a,r,n).catch(()=>{r.signal.aborted||H.current!==y||L(e=>e.map(e=>e.id===a?{...e,text:"명함 정리에 실패했습니다 — 다시 보내 주세요"}:e))}),r});return()=>{t.forEach(e=>e.abort())}},[x,y]);let e8=async function(e){let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];ed(e=>eN(e,{kind:"turn-begin"})),(0,f.cY)("webterm.chat.input",{len:e.length,attachCount:eh.length});let r=n?[]:eh;n||ef([]);let a=n?{ok:!1}:function(e,t){if(1!==t.length||!t[0]||!eC(t[0])||!t[0].id)return{ok:!1};let n=e.trim();if(!n)return{ok:!0,attachmentId:t[0].id};let r=n.replace(/메일\s*초안/g,"메일초안").split(/[\s,]+/).filter(Boolean);return!r.length||r.some(e=>!/^(?:명함|전략|메일초안|crm)$/i.test(e))?{ok:!1}:{ok:!0,attachmentId:t[0].id,context:n}}(e,r),s=!1;if(a.ok){let n=H.current;if(!n){var l;W.current=n=(0,$.f6)(),H.current=n,null==(l=t.onSessionAdopt)||l.call(t,n),w(n)}let o=new AbortController;eg.current=o,ex.current=n,s=!0,e.length>0&&e4((0,T.tw)(e)),e4((0,T.$Q)("\uD83D\uDCCE attached: ".concat(r.map(e=>e.filename).join(", "))));let i="m-card-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,6));e4({id:i,role:"assistant",text:"명함 읽는 중… 조사 중…",timestamp:Date.now(),meta:{provider:b.provider}}),F(!0),(0,f.cY)("pwa.chat.card-followup",{phase:"start",status:"judging"});try{let e=await eq(x,a.attachmentId,a.context,o.signal);if(o.signal.aborted||H.current!==n)return;let t=eT(),r=Date.now();t&&function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),r=eR(e,n).filter(e=>e.sessionId!==t.sessionId||e.id!==t.id);if(!t.sessionId||!t.id||!Number.isFinite(t.startedAt)||t.startedAt>n||n-t.startedAt>=9e5)return eD(e,r);eD(e,[...r,t])}(t,{sessionId:n,id:e,startedAt:r});let s=await e6(e,n,i,o,r);if("terminal"===s||o.signal.aborted||H.current!==n)return}catch(e){if(o.signal.aborted||H.current!==n)return;L(e=>e.map(e=>e.id===i?{...e,text:"명함 정리에 실패했습니다 — 다시 보내 주세요"}:e)),(0,f.cY)("pwa.chat.card-followup",{phase:"complete",status:"failed"});return}finally{eg.current===o&&(eg.current=null),o.signal.aborted||H.current!==n||(F(!1),ed(e=>eN(e,{kind:"turn-end"})))}}let o=r.filter(eC),i=r.filter(e=>!eC(e)),c=function(e){if(!e)return!0;let t=e.toLowerCase();return!!("auto"===t||t.startsWith("anthropic")||"anthropic"===t||t.startsWith("codex")||"openai-codex"===t||t.startsWith("openai")||"openai"===t||t.startsWith("gemini")||"gemini"===t||t.startsWith("grok")||"grok"===t||t.startsWith("local"))}(b.provider),d=o.length>0&&c;o.length>0&&!c&&ek.oR.warning("이 모델은 이미지 입력을 지원하지 않습니다 — ".concat(o.length,"개 이미지가 무시됩니다. (vision 모델로 전환 후 재첨부)"));let u=i.map(e=>e.path?"[attached] ".concat(e.path):"").filter(e=>e.length>0),m=u.length>0?"".concat(u.join("\n"),"\n\n").concat(e).trimEnd():e,p=null;if(d&&b.baseUrl)try{p=await eA(m,o,{baseUrl:b.baseUrl,token:b.token})}catch(t){let e=t instanceof Error?t.message:String(t);(0,f.cY)("webterm.chat.attach.contentblock.error",{msg:e}),ek.oR.error("이미지 첨부 변환 실패 — 텍스트만 전송: ".concat(e)),p=null}!s&&(e.length>0&&e4((0,T.tw)(e)),r.length>0&&e4((0,T.$Q)("\uD83D\uDCCE attached: ".concat(r.map(e=>e.filename).join(", ")))));let h=e?await (0,T.yN)(e,e5):null;if(h){if("__CLEAR__"===h.text)L([]);else{let e=(0,T.$Q)(h.text);h.harnessAsk&&(e.blocks=[{kind:"harness_ask",acceptanceId:h.harnessAsk.acceptanceId}]),e4(e)}h.newSessionId&&(Z.current++,ei([]),G.current=h.newSessionId,H.current=h.newSessionId,w(h.newSessionId));return}if(!b.baseUrl)return void e4((0,T.$Q)("error: daemon baseUrl not configured. Visit /settings."));F(!0),eU.current=!0;let g="m-stream-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,6));e4({id:g,role:"assistant",text:"",timestamp:Date.now(),meta:{provider:b.provider}});let v=new AbortController;ep(v);let j=0,k=eM.current,N=!!(k&&y&&b.baseUrl),S=null;(0,f.cY)("webterm.chat.runturn.path",{useAcpPath:N,hasAcp:!!k,hasSession:!!y});let C=e=>{L(t=>t.map(t=>t.id===g?{...t,text:e}:t)),e.length>j&&(eX.pushText(e.slice(j)),j=e.length)},I=e=>{L(t=>t.map(t=>t.id===g?{...t,blocks:e}:t))};try{N&&(S=x.connectAcp({sessionId:y}));let{message:e,newSessionId:t}=N?await (0,T.py)(S,m,{...e5,sessionId:await S.ready||y},{signal:v.signal,...p?{userContent:p}:{},onPartial:C,onPartialBlocks:I}):await (0,T.HD)(m,e5,{signal:v.signal,...p?{userContent:p}:{},...e_?{debugTap:!0}:{},onPartial:C,onPartialBlocks:I,onError:e=>ed(t=>eN(t,{kind:"error",payload:e}))});ed(e=>eN(e,{kind:"turn-end"})),L(t=>t.map(t=>t.id===g?e:t)),t&&t!==y&&H.current===y&&(W.current=t,H.current=t,w(t)),eX.flush()}catch(n){let e=v.signal.aborted,t=n instanceof Error?n.message:String(n);eX.cancel(),e?(L(e=>e.map(e=>e.id===g?{...e,meta:{...e.meta,stopReason:"aborted"}}:e)),(0,f.cY)("webterm.chat.runturn.stream.abort",{reason:t})):(L(e=>e.filter(e=>e.id!==g)),e4((0,T.$Q)("error: ".concat(t))),ek.oR.error("chat failed: ".concat(t)),(0,f.cY)("webterm.chat.runturn.error",{reason:t,useAcpPath:N}))}finally{null==S||S.close(),F(!1),ep(null),eU.current=!1}},e7=async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(X.current||!t&&_.current.length>0){var n,r;if(!t&&(eh.length>0||/^[\s]*[:/]/.test(e))){ek.oR.info("답이 끝난 뒤 보내 주세요"),O(t=>{var n;return{text:e,id:(null!=(n=null==t?void 0:t.id)?n:0)+1}});return}let a=(n=_.current,(r={id:++V.current,text:e}).text.trim()?n.length>=5?{queue:[...n],error:"줄이 찼습니다"}:{queue:[...n,{...r,text:r.text.trim()}]}:{queue:[...n]});a.error?(ek.oR.info(a.error),O(t=>{var n;return{text:e,id:(null!=(n=null==t?void 0:t.id)?n:0)+1}})):ei(a.queue);return}X.current=!0;let a=Z.current,s=H.current;try{await e8(e,t)}finally{X.current=!1,a!==Z.current&&(0,f.cY)("webterm.chat.queue.session-changed",{turnSessionId:s,currentSessionId:H.current}),er({generation:Z.current,sessionId:H.current})}};(0,a.useEffect)(()=>{var e;if(X.current||0===_.current.length||!ee||ee.generation!==Z.current||ee.sessionId!==y)return;let{entry:t,queue:n}={entry:(e=_.current)[0],queue:e.slice(1)};t&&(ei(n),e$.current(t.text,!0))},[ee]),e$.current=e7,(0,a.useEffect)(()=>{ed(e=>eN(e,{kind:"session-change"}))},[y]),(0,a.useEffect)(()=>{if(!y||!b.baseUrl)return;let e=(0,T.lY)(x,y,{isLocalTurnInFlight:()=>eU.current,provider:b.provider,onPlaceholder:e=>{let{sessionId:t}=e;ed(e=>eN(e,{kind:"turn-begin"}));let n="m-obs-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,6)),r={id:n,role:"assistant",text:"",timestamp:Date.now(),meta:{provider:b.provider}};return(0,f.cY)("webterm.chat.observer.placeholder",{id:n,turnSessionId:t}),L(e=>[...e,r]),eO.current=n,n},onPartialBlocks:(e,t)=>{L(n=>n.map(n=>n.id===e?{...n,blocks:t}:n))},onFinalize:(e,t)=>{ed(e=>eN(e,{kind:"turn-end"})),L(n=>n.map(n=>n.id===e?t:n)),eO.current===e&&(eO.current=null)},onError:(e,t)=>{ed(e=>eN(e,{kind:"error",payload:t})),(0,f.cY)("webterm.chat.observer.error",{placeholderId:e,error:t.error}),L(n=>n.map(n=>n.id===e?{...n,meta:{...n.meta,stopReason:t.error}}:n)),eO.current===e&&(eO.current=null)}});return()=>{e()}},[x,y,b.baseUrl,b.provider]),(0,a.useEffect)(()=>{if(!y||!b.baseUrl)return;let e=x.subscribeChatFeedbackEvents(y,{agentStatus:{onFeedback:e=>{L(t=>{if(0===t.length)return t;for(let n=t.length-1;n>=0;n--){if("assistant"!==t[n].role)continue;let r=t[n],a=Array.isArray(r.blocks)?[...r.blocks]:[];if("applied"!==(0,ea.K4)(a,e))break;let s={...r,blocks:a};return[...t.slice(0,n),s,...t.slice(n+1)]}return t})},onError:e=>{(0,f.cY)("webterm.agent-status.error",e)}},hudSegment:{onFeedback:e=>(0,T.Ju)(e),onError:e=>{(0,f.cY)("webterm.hud-segment.error",e)}}});return()=>{e()}},[x,y,b.baseUrl]),(0,a.useEffect)(()=>{if(!y||!b.baseUrl)return;let e=null;try{e=x.connectAcp({sessionId:y,onSession:e=>{if(e&&e!==y){var n;(0,f.cY)("webterm.chat.acp.session-adopt",{previous:y,issued:e}),H.current===y&&(W.current=e,H.current=e,null==(n=t.onSessionAdopt)||n.call(t,e),w(e))}}})}catch(e){(0,f.cY)("webterm.chat.acp.connect-failed",{reason:String(e)});return}eM.current=e,eP(e);let n=e;(0,f.x8)(async e=>{let t=JSON.parse(e);return await n.send("elanous/debug-logs/ingest",{records:t.records}),!0});let r=(0,T.ZH)(e,y,{isLocalTurnInFlight:()=>eU.current,isRemoteSseTurnInFlight:()=>null!==eO.current,onPlaceholder:e=>{let{sessionId:t}=e;ed(e=>eN(e,{kind:"turn-begin"}));let n="m-acp-".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2,6)),r={id:n,role:"assistant",text:"",timestamp:Date.now(),meta:{provider:b.provider}};return(0,f.cY)("webterm.chat.acp.foreign-placeholder",{id:n,turnSessionId:t}),L(e=>[...e,r]),n},onPartialBlocks:(e,t)=>{let n=t.find(e=>"text"===e.kind),r=t.some(e=>"image"===e.kind||"tool_use"===e.kind);L(a=>a.map(a=>a.id===e?{...a,...n?{text:n.text}:{},...r?{blocks:t}:{}}:a))},onFinalize:e=>{(0,f.cY)("webterm.chat.acp.foreign-finalize",{placeholderId:e})}});return()=>{r(),(0,f.x8)(null);try{null==e||e.close()}catch(e){}eM.current===e&&(eM.current=null),eP(null)}},[x,y,b.baseUrl,b.provider]);let e9=function(e){var t;let{acp:n,onComposerPrefill:r}=e,[s,l]=(0,a.useState)(null),o=(0,a.useRef)(null),i=(0,a.useCallback)(e=>{o.current=e,l(e)},[]),c=(0,a.useCallback)(e=>{let t=o.current;t&&(t.resolve(e),i(null))},[i]);(0,a.useEffect)(()=>{if(!n)return;let e=n.onRequest("elanous/ask/request",async e=>{let t=function(e){if(!e||"object"!=typeof e||"string"!=typeof e.id||!e.id||!e.request||"object"!=typeof e.request)return null;let t=e.request;return Array.isArray(t.questions)&&0!==t.questions.length?{id:e.id,request:e.request}:null}(e);if(!t)return{answers:{},cancelled:!0};let n=o.current;return n&&n.resolve({answers:{},cancelled:!0}),await new Promise(e=>{i({request:t.request,resolve:e,askId:t.id})})}),t=n.on("sessionUpdate",()=>{}),r=n.onAny(e=>{var t;if("elanous/ask/cancel"!==e.method||void 0!==e.id)return;let n=(t=e.params)&&"object"==typeof t&&"string"==typeof t.id&&t.id?{id:t.id,..."string"==typeof t.reason?{reason:t.reason}:{}}:null;if(!n)return;let r=o.current;r&&r.askId===n.id&&c({answers:{},cancelled:!0})});return()=>{e(),t(),r();let n=o.current;n&&(n.resolve({answers:{},cancelled:!0}),o.current=null)}},[n,i,c]);let d=(0,a.useCallback)(e=>{c(e)},[c]),u=(0,a.useCallback)(()=>{c({answers:{},cancelled:!0})},[c]),m=(0,a.useCallback)(()=>{let e=o.current;e&&r&&r(e.request),c({answers:{},cancelled:!0})},[c,r]);return{pendingRequest:null!=(t=null==s?void 0:s.request)?t:null,submit:d,cancel:u,chatAboutThis:m}}({acp:eF,onComposerPrefill:e=>{let t=e.questions[0];if(!t)return;let n="[ Q: ".concat(t.question.trim()," ]\n\n");(0,Q.vn)(n),O(e=>{var t;return{text:n,id:(null!=(t=null==e?void 0:e.id)?t:0)+1}}),ek.oR.info("\uD83D\uDCAC 입력 영역에 질문 prefill 됨 (Chat about this)")}}),te=function(e){var t,n;let{acp:r,sessionId:s}=e,[l,o]=(0,a.useState)(null),i=(0,a.useRef)(null),c=(0,a.useRef)(s);c.current=s;let d=(0,a.useCallback)((e,t,n)=>{let r=i.current;r&&(!n||r.request===n)&&(i.current=null,clearTimeout(r.timer),o(null),(0,f.cY)("pwa.tool-approval.".concat("cancelled"===t?"cancelled":"decided"),{tool:ew,choice:t}),r.resolve(e))},[]);(0,a.useEffect)(()=>{if(!r)return;let e=r.onRequest("session/request_permission",e=>{let t=function(e){try{if(!e||"object"!=typeof e)return null;let t=e.toolCall;if(!t||"object"!=typeof t||"string"!=typeof e.sessionId||!e.sessionId||"string"!=typeof t.toolCallId||!t.toolCallId||"string"!=typeof t.title||!t.title||!Array.isArray(e.options))return null;let n=e.options.map(e=>{if(!e||"object"!=typeof e||"string"!=typeof e.optionId||!e.optionId||"string"!=typeof e.kind||!ey.includes(e.kind))throw Error("invalid option");return{optionId:e.optionId,kind:e.kind}});if(new Set(n.map(e=>e.optionId)).size!==n.length||new Set(n.map(e=>e.kind)).size!==n.length||["allow_once","allow_always","reject_once"].some(e=>!n.some(t=>t.kind===e)))return null;return{sessionId:e.sessionId,toolCall:{toolCallId:t.toolCallId,title:t.title,...void 0!==t.rawInput?{rawInput:t.rawInput}:{}},options:n}}catch(e){return null}}(e);return t&&t.sessionId===c.current?((0,f.cY)("pwa.tool-approval.requested",{tool:ew,choice:null}),d(ev,"cancelled"),new Promise(e=>{let n={request:t,receivedAt:Date.now(),resolve:e,timer:setTimeout(()=>{i.current===n&&d(ev,"cancelled")},6e4)};i.current=n,o(n)})):((0,f.cY)("pwa.tool-approval.cancelled",{tool:ew,choice:"cancelled"}),ev)}),t="function"==typeof r.onState?r.onState(e=>{("CLOSED"===e||"FAILED"===e)&&d(ev,"cancelled")}):()=>{};return()=>{e(),t(),d(ev,"cancelled")}},[r,d]),(0,a.useEffect)(()=>{i.current&&i.current.request.sessionId!==s&&d(ev,"cancelled")},[s,d]);let u=(0,a.useCallback)((e,t)=>{var n;if((null==(n=i.current)?void 0:n.request)!==e)return;let r=e.options.find(e=>e.kind===t);r&&d({outcome:{outcome:"selected",optionId:r.optionId}},t,e)},[d]),m=(0,a.useCallback)(e=>d(ev,"cancelled",e),[d]);return{pendingRequest:null!=(t=null==l?void 0:l.request)?t:null,receivedAt:null!=(n=null==l?void 0:l.receivedAt)?n:0,choose:u,cancel:m}}({acp:eF,sessionId:y}),tt=(0,r.jsxs)("button",{type:"button",onClick:()=>void eH.toggle(),disabled:!eW,title:eW?null!=(e=eH.errorMsg)?e:ej.g[eH.phase]:"daemon URL 미설정 — Settings 에서 Base URL 입력","data-elanous-action":"chat-voice-toggle",className:(0,D.cn)("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors",eH.active?"border-rose-500/40 bg-rose-500/10 text-rose-600 hover:bg-rose-500/20":"border-border bg-background text-foreground hover:bg-muted",!eW&&"cursor-not-allowed opacity-50"),children:[(0,r.jsx)("span",{className:(0,D.cn)("h-2 w-2 rounded-full",ej.x[eH.phase],("listening"===eH.phase||"speaking"===eH.phase)&&"animate-pulse"),"aria-hidden":!0}),eH.active?(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"}):(0,r.jsx)(o.A,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:ej.g[eH.phase]})]});return(0,r.jsxs)("div",{className:"relative flex h-full flex-col",onPaste:e=>{let t=function(e,t){if(!e)return C([]);let n=[];if(e.items.length>0)for(let t of Array.from(e.items)){if("file"!==t.kind)continue;let e=t.getAsFile();e&&n.push(e)}else n.push(...Array.from(e.files));return C(n.map(e=>({file:e,filename:e.name||"paste-".concat(t,".png")})))}(e.clipboardData,Date.now());(0!==t.files.length||0!==t.tooLarge||0!==t.tooMany)&&(e.preventDefault(),e2(t))},onDragEnter:e=>{eE(t=>E(t,"enter",I(e.dataTransfer)))},onDragLeave:e=>{eE(t=>E(t,"leave",I(e.dataTransfer)))},onDragOver:e=>{I(e.dataTransfer)&&e.preventDefault()},onDrop:e=>{var t;eE(t=>E(t,"drop",I(e.dataTransfer)));let n=C((t=e.dataTransfer)?Array.from(t.files,e=>({file:e,filename:e.name})):[]);(0!==n.files.length||0!==n.tooLarge||0!==n.tooMany)&&(e.preventDefault(),e2(n))},children:[eI.visible&&(0,r.jsx)(A,{}),n?(0,r.jsxs)("div",{"data-elanous-chat-compact-header":"",className:"flex h-11 max-h-11 min-w-0 shrink-0 items-center gap-2 border-b border-border bg-background px-3 whitespace-nowrap",children:[t.leading&&(0,r.jsx)("div",{className:"shrink-0",children:t.leading}),(0,r.jsx)("div",{className:"min-w-0 flex-1 [&>div]:min-w-0 [&>div]:max-w-full [&>div>div:first-child]:min-w-0 [&>div>div:first-child]:max-w-full [&>div>div:first-child]:overflow-hidden [&>div>div:first-child>span:last-child]:shrink-0 [&>div>div:first-child_span]:min-w-0 [&>div>div:first-child_span]:truncate [&>div>div[role=menu]]:max-w-[calc(100vw-4rem)]",children:(0,r.jsx)(R.Qh,{sessionId:y,...t.onAttachRequest?{onAttachRequest:t.onAttachRequest}:{},...t.onForgetRequest?{onForgetRequest:t.onForgetRequest}:{}})}),(0,r.jsx)(g,{}),(0,r.jsxs)("div",{ref:h,className:"relative shrink-0",children:[(0,r.jsx)("button",{type:"button","aria-label":"채팅 더보기","aria-expanded":u,"aria-controls":"chat-header-more",onClick:()=>m(e=>!e),className:"inline-flex h-8 w-8 items-center justify-center rounded-lg hover:bg-muted",children:(0,r.jsx)(i.A,{className:"h-5 w-5","aria-hidden":"true"})}),u&&(0,r.jsxs)("div",{id:"chat-header-more",className:"absolute right-0 top-full z-50 mt-1 flex max-w-[calc(100vw-1.5rem)] flex-col gap-2 rounded-lg border border-border bg-popover p-3 shadow-lg",children:[(0,r.jsx)(s.vG,{children:(0,r.jsx)(K.rm,{})}),(0,r.jsx)(s.vG,{children:(0,r.jsx)(B.D,{})}),tt]})]})]}):(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-3 border-b border-border bg-background px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(R.Qh,{sessionId:y,...t.onAttachRequest?{onAttachRequest:t.onAttachRequest}:{},...t.onForgetRequest?{onForgetRequest:t.onForgetRequest}:{}}),(0,r.jsx)(s.vG,{children:(0,r.jsx)(K.rm,{})}),(0,r.jsx)(s.vG,{children:(0,r.jsx)(B.D,{})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(g,{}),tt]})]}),(0,r.jsx)(p,{}),(0,r.jsx)(v,{}),(0,r.jsx)(j,{}),(0,r.jsx)(J,{}),(0,r.jsxs)("div",{className:"relative flex flex-1 min-h-0 flex-col",children:[(0,r.jsx)(k.D,{messages:q,pending:M,...t.tabId?{tabId:t.tabId}:{}}),ec&&(0,r.jsxs)("div",{role:"alert",className:"mx-4 mb-3 flex shrink-0 items-start justify-between gap-3 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-foreground","data-elanous-turn-busy-banner":"",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"font-medium",children:"이 대화는 지금 응답 중입니다"}),(0,r.jsx)("p",{className:"text-muted-foreground",children:ec.message}),(0,r.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:ec.holder?"Current input holder: ".concat(ec.holder):"The current input holder is not available."})]}),(0,r.jsx)("button",{type:"button",onClick:()=>ed(null),className:"rounded px-2 py-1 text-xs text-muted-foreground hover:bg-amber-500/10 hover:text-foreground","aria-label":"응답 중 알림 닫기",children:"Dismiss"})]}),(0,r.jsx)(et,{active:eH.active,phase:eH.phase,errorMsg:eH.errorMsg,onToggle:()=>void eH.toggle(),ttsSupported:eX.supported,ttsMuted:eZ,onTtsToggle:()=>eV(e=>!e),onInterrupt:()=>{try{eX.cancel()}catch(e){}eH.interrupt()}})]}),M&&eu&&(0,r.jsxs)("div",{className:"flex shrink-0 items-center justify-end gap-2 border-t border-border bg-muted/30 px-4 py-1.5 text-xs",children:[(0,r.jsx)("span",{className:"text-muted-foreground",children:"streaming…"}),(0,r.jsx)("button",{type:"button",onClick:e0,className:"rounded border border-border bg-background px-2 py-0.5 font-mono hover:bg-muted","data-elanous-action":"chat-stop",title:"Stop the running turn (Esc)",children:"Stop ⎋"})]}),(0,r.jsx)(S,{queue:eo,onRemove:e=>{var t;return ei((t=_.current,t.filter(t=>t.id!==e)))},onClear:()=>ei([])}),(0,r.jsx)(N.V,{onSubmit:e7,prefill:U,attachments:eh,onAttached:e1,onRemoveAttachment:e3,voice:{active:eH.active,phase:eH.phase,dotColor:ej.x[eH.phase],phaseLabel:ej.g[eH.phase],disabled:!eW,onToggle:()=>void eH.toggle()},...t.tabId?{tabId:t.tabId}:{},onListFiles:eF&&y?async e=>{var t,n;let r=await eF.send("elanous/fs/list",{sessionId:y,query:e,limit:50}),a=(null!=(t=r.entries)?t:[]).filter(e=>"string"==typeof(null==e?void 0:e.name)&&"boolean"==typeof(null==e?void 0:e.isDir)&&"string"==typeof(null==e?void 0:e.relPath)).map(e=>({name:e.name,isDir:e.isDir,relPath:e.relPath}));return{cwd:null!=(n=r.cwd)?n:"",entries:a}}:void 0,onListSkills:eF&&y?async e=>{var t;return{entries:(null!=(t=(await eF.send("elanous/skills/list",{sessionId:y,query:e})).entries)?t:[]).filter(e=>"string"==typeof(null==e?void 0:e.name)&&"string"==typeof(null==e?void 0:e.description)).map(e=>({name:e.name,description:e.description}))}}:void 0}),eY&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(en,{open:e_,onClose:()=>eJ(!1),lines:ez}),!e_&&(0,r.jsxs)("button",{type:"button",onClick:()=>eJ(!0),"data-elanous-debug-tap-reopen":"",className:(0,D.cn)("fixed bottom-3 right-3 z-40 rounded-full border border-border bg-card px-3 py-1.5","text-[11px] font-mono text-muted-foreground shadow hover:bg-muted hover:text-foreground"),"aria-label":"Reopen debug drawer",title:"Reopen Debug Tap drawer",children:["⌁ debug (",ez.length,")"]})]}),(0,r.jsx)(em,{request:e9.pendingRequest,onSubmit:e9.submit,onCancel:e9.cancel,onChatAboutThis:e9.chatAboutThis}),(0,r.jsx)(eb,{request:te.pendingRequest,receivedAt:te.receivedAt,onChoose:te.choose,onCancel:te.cancel})]})}var eO=n(8819),eM=n(21383),eF=n(25503);class eP{list(){return this.client.fetchJson("/v1/projects")}create(e){return this.client.fetchJson("/v1/projects",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e})})}assign(e,t){return this.client.fetchJson("/v1/sessions/store/".concat(encodeURIComponent(e)),{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({projectId:t})})}constructor(e){this.client=e}}let eY="elanous.chat.projectSelection";function e_(e){let{projects:t,selection:n,onChange:s,onCreate:l}=e,[o,i]=(0,a.useState)(!1),[c,d]=(0,a.useState)(""),[u,m]=(0,a.useState)(!1);return(0,r.jsxs)("div",{className:"space-y-2",children:[0===t.length&&!o&&(0,r.jsx)("button",{type:"button",onClick:()=>i(!0),className:"text-sm text-muted-foreground hover:text-foreground",children:"+ 프로젝트 만들기"}),t.length>0&&(0,r.jsxs)("select",{"aria-label":"프로젝트 바꾸기",value:n,onChange:e=>{if("create"===e.target.value)return void i(!0);s(e.target.value)},className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm",children:[(0,r.jsx)("option",{value:"all",children:"모든 대화"}),(0,r.jsx)("option",{value:"none",children:"받은 대화(프로젝트 없음)"}),t.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id)),(0,r.jsx)("option",{value:"create",children:"+ 프로젝트 만들기"})]}),o&&(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=c.trim();t&&l(t).then(()=>{i(!1),d(""),m(!1)}).catch(()=>m(!0))},className:"flex gap-2",children:[(0,r.jsx)("input",{"aria-label":"프로젝트 이름",autoFocus:!0,value:c,maxLength:80,onChange:e=>d(e.target.value),className:"min-w-0 flex-1 rounded-lg border border-border bg-background px-2 py-1 text-sm"}),(0,r.jsx)("button",{type:"submit",className:"rounded-lg border border-border px-2 text-sm",children:"만들기"}),u&&(0,r.jsx)("span",{role:"alert",children:"프로젝트를 만들지 못했습니다"})]})]})}function eJ(e,t){var n,r;return(null==t?void 0:t.trim())||(null==(r=e.lastMsgPreview)||null==(n=r.trim().split(/\r?\n/)[0])?void 0:n.trim())||"대화"}let ez="elanous.chat.pendingProjects";function e$(e){try{return"undefined"==typeof localStorage?null:localStorage.getItem(e)}catch(e){return null}}function eQ(e,t){try{"undefined"!=typeof localStorage&&localStorage.setItem(e,t)}catch(e){}}function eK(e){let{onSelect:t}=e,n=(0,d.Q)(),s=(0,eF.t)({activePoll:!0}),[l,o]=(0,a.useState)({}),[i,c]=(0,a.useState)(""),[u,m]=(0,a.useState)([]),[p,h]=(0,a.useState)("all"),[f,g]=(0,a.useState)([]),[x,b]=(0,a.useState)(()=>{try{var e;let t=JSON.parse(null!=(e=e$(ez))?e:"{}");if(t&&"object"==typeof t&&!Array.isArray(t))return Object.fromEntries(Object.entries(t).filter(e=>{let[t,n]=e;return t&&"string"==typeof n&&n}))}catch(e){}return{}}),[v,y]=(0,a.useState)({}),w=(0,a.useRef)(new Set);(0,a.useEffect)(()=>{var e;h(null!=(e=e$(eY))?e:"all");let t=!0;return new eP(n.client).list().then(e=>{var n;t&&m(null!=(n=e.projects)?n:[])}).catch(()=>{}),()=>{t=!1}},[n.client]),(0,a.useEffect)(()=>{eQ(ez,JSON.stringify(x))},[x]),(0,a.useEffect)(()=>{let e=!0,t=u.length>0&&"all"!==p&&"none"!==p?"?projectId=".concat(encodeURIComponent(p)):"";return n.client.fetchJson("/v1/sessions/store".concat(t)).then(t=>{var n;if(!e)return;let r=null!=(n=t.sessions)?n:[];g(r),o(Object.fromEntries(r.map(e=>[e.id,e.title])))}).catch(()=>{}),()=>{e=!1}},[n.client,s,u,p]),(0,a.useEffect)(()=>{let e=Object.keys(x).filter(e=>s.some(t=>t.id===e)&&!f.some(t=>t.id===e));if(0===e.length)return;let t=!0;for(let r of e)n.client.fetchJson("/v1/sessions/store/".concat(encodeURIComponent(r),"?ifExists=1")).then(e=>{t&&e.meta&&g(t=>t.some(e=>e.id===r)?t:[...t,e.meta])}).catch(()=>{});return()=>{t=!1}},[f,n.client,x,s]),(0,a.useEffect)(()=>{for(let[e,t]of Object.entries(x)){if(!s.some(t=>t.id===e)||w.current.has(e))continue;let r=f.find(t=>t.id===e);if(r){if(r.projectId===t||v[e]===t){b(t=>{let n={...t};return delete n[e],n});continue}w.current.add(e),new eP(n.client).assign(e,t).then(()=>{y(n=>({...n,[e]:t})),g(n=>n.map(n=>n.id===e?{...n,projectId:t}:n)),b(t=>{let n={...t};return delete n[e],n})}).catch(()=>{w.current.delete(e)})}}},[v,f,n.client,x,s]);let j=u.some(e=>e.id===p)||"none"===p?p:"all",k=0===u.length||"all"===j?s:s.filter(e=>x[e.id]?x[e.id]===j:"none"===j?!f.some(t=>t.id===e.id&&t.projectId)&&!v[e.id]:v[e.id]===j||f.some(t=>t.id===e.id&&t.projectId===j)),N=[...k].filter(e=>{var t;return"".concat(eJ(e,l[e.id])," ").concat(null!=(t=e.lastMsgPreview)?t:"").toLocaleLowerCase().includes(i.trim().toLocaleLowerCase())}).sort((e,t)=>Date.parse(t.lastTurnAt)-Date.parse(e.lastTurnAt)),S=()=>{let e=(0,$.Zr)();u.length>0&&"all"!==j&&"none"!==j&&b(t=>({...t,[e]:j})),n.setSessionId(e),null==t||t()};return(0,r.jsxs)("nav",{"aria-label":"대화 목록",className:"flex h-full min-h-0 flex-col bg-background",children:[(0,r.jsxs)("div",{className:"shrink-0 space-y-3 border-b border-border p-3",children:[(0,r.jsx)(e_,{projects:u,selection:j,onChange:e=>{h(e),eQ(eY,e)},onCreate:async e=>{let{project:t}=await new eP(n.client).create(e);m(e=>[...e,t]),h(t.id),eQ(eY,t.id)}}),(0,r.jsxs)("button",{type:"button",onClick:S,className:"flex w-full items-center gap-2 rounded-lg bg-primary px-3 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90",children:[(0,r.jsx)(eO.A,{className:"h-4 w-4","aria-hidden":"true"})," 새 대화"]}),(0,r.jsxs)("label",{className:"flex items-center gap-2 rounded-lg border border-border bg-muted/30 px-2.5 py-2 focus-within:ring-2 focus-within:ring-ring",children:[(0,r.jsx)(eM.A,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,r.jsx)("input",{"aria-label":"대화 검색",type:"search",value:i,onChange:e=>c(e.target.value),placeholder:"대화 검색",className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"})]})]}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-2",children:0===k.length?(0,r.jsxs)("div",{className:"space-y-3 px-2 py-8 text-center text-sm text-muted-foreground",children:[(0,r.jsx)("p",{children:"아직 대화가 없습니다"}),(0,r.jsx)("button",{type:"button",onClick:S,className:"rounded-lg border border-border px-3 py-2 text-foreground hover:bg-muted",children:"+ 새 대화"})]}):0===N.length?(0,r.jsx)("p",{className:"px-2 py-8 text-center text-sm text-muted-foreground",children:"검색 결과가 없습니다"}):(0,r.jsx)("ul",{className:"space-y-1",children:N.map(e=>(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button","aria-current":n.sessionId===e.id?"page":void 0,onClick:()=>{n.setSessionId(e.id),null==t||t()},className:"w-full rounded-lg px-3 py-2.5 text-left transition-colors ".concat(n.sessionId===e.id?"bg-primary/10 text-primary ring-1 ring-inset ring-primary/25":"text-foreground hover:bg-muted"),children:[(0,r.jsx)("span",{className:"block truncate text-sm font-medium",children:eJ(e,l[e.id])}),(0,r.jsxs)("span",{className:"mt-1 block truncate text-xs text-muted-foreground",children:[function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=Date.parse(e);if(!Number.isFinite(n))return"";let r=Math.max(0,Math.floor((t-n)/6e4));if(r<1)return"방금 전";if(r<60)return"".concat(r,"분 전");let a=Math.floor(r/60);if(a<24)return"".concat(a,"시간 전");let s=Math.floor(a/24);return s<7?"".concat(s,"일 전"):new Date(n).toLocaleDateString()}(e.lastTurnAt)," \xb7 ",e.msgCount,"개 메시지"]})]})},e.id))})})]})}var eB=n(35622),eG=n(69147),eH=n(44614),eW=n(3155);function eZ(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{compact:n}=(0,c.K)(),s=(0,eH.tg)(),{client:l,sessionId:o,setSessionId:i}=(0,d.Q)(),[u,m]=(0,a.useState)(o||"default"),[p,h]=(0,a.useState)(!1);(0,a.useEffect)(()=>{if(!p)return;let e=e=>{"Escape"===e.key&&h(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[p]);let f=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(f.current===o){f.current=null;return}f.current=null,m(o||"default")},[o]);let g=(0,a.useRef)(t.sessionId),x=(0,a.useRef)(o),b=null!=(e=null==s?void 0:s.state.activeId)?e:null;(0,a.useEffect)(()=>{let e=t.sessionId;if(s&&t.tabId&&e&&o){var n,r;let a=function(e){if(!e.isActive||e.tabSessionId===e.daemonSessionId)return"none";let t=e.prevTabSessionId!==e.tabSessionId,n=e.prevDaemonSessionId!==e.daemonSessionId;return t||!n?"adopt-tab":"record-global"}({isActive:b===t.tabId,tabSessionId:e,daemonSessionId:o,prevTabSessionId:null!=(n=g.current)?n:e,prevDaemonSessionId:null!=(r=x.current)?r:o});"adopt-tab"===a?i(e):"record-global"===a&&s.updateChatTab(t.tabId,{sessionId:o})}g.current=t.sessionId,x.current=o},[s,b,t.tabId,t.sessionId,o,i]);let v=s&&t.tabId?()=>s.openPicker({kind:"attachToTab",tabId:t.tabId}):void 0,y=s&&t.sessionId?async()=>{let e=(0,eW.hG)(l);await e.forget(t.sessionId)}:void 0,w=(0,r.jsx)("button",{type:"button",onClick:()=>h(!0),"aria-label":"대화 목록","aria-expanded":p,"aria-controls":"chat-conversation-drawer",className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-lg hover:bg-muted",children:(0,r.jsx)(eB.A,{className:"h-4 w-4","aria-hidden":"true"})}),j=(0,r.jsx)(eU,{onSessionAdopt:e=>{f.current=e},...t.showConversationList&&n?{leading:w}:{},...v?{onAttachRequest:v}:{},...y?{onForgetRequest:y}:{},...t.tabId?{tabId:t.tabId}:{}},u);return t.showConversationList?(0,r.jsxs)("div",{className:"flex h-full min-h-0 min-w-0",children:[(0,r.jsx)("aside",{className:n?"hidden":"hidden h-full w-[260px] shrink-0 border-r border-border md:block",children:(0,r.jsx)(eK,{})}),(0,r.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[!n&&(0,r.jsx)("div",{className:"shrink-0 border-b border-border bg-background px-3 py-2 md:hidden",children:(0,r.jsxs)("button",{type:"button",onClick:()=>h(!0),"aria-label":"대화 목록","aria-expanded":p,"aria-controls":"chat-conversation-drawer",className:"inline-flex items-center gap-2 rounded-lg px-2 py-1.5 text-sm font-medium hover:bg-muted",children:[(0,r.jsx)(eB.A,{className:"h-4 w-4","aria-hidden":"true"})," 대화 목록"]})}),(0,r.jsx)("div",{className:"min-h-0 min-w-0 flex-1",children:j})]}),p&&(0,r.jsxs)("div",{className:n?"fixed inset-0 z-50":"fixed inset-0 z-50 md:hidden",children:[(0,r.jsx)("button",{type:"button","aria-label":"대화 목록 닫기",onClick:()=>h(!1),className:"absolute inset-0 bg-black/50"}),(0,r.jsxs)("aside",{id:"chat-conversation-drawer",role:"dialog","aria-modal":"true","aria-label":"대화 목록",className:"relative h-full w-[min(260px,85vw)] bg-background shadow-xl",children:[(0,r.jsx)("button",{type:"button","aria-label":"대화 목록 닫기",onClick:()=>h(!1),className:"absolute right-2 top-2 z-10 rounded p-1 hover:bg-muted",children:(0,r.jsx)(eG.A,{className:"h-4 w-4"})}),(0,r.jsx)(eK,{onSelect:()=>h(!1)})]})]})]}):j}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5977],{48087:(e,l,o)=>{o.d(l,{Hw:()=>x,vm:()=>L,f4:()=>j,OE:()=>E,Ue:()=>P,Ye:()=>R});var t=o(91123),a=o(40828),i=o(22403),n=o(17873),r=o(74227),s=o(94476),p=o(65962),b=o(20931),c=o(35308),d=o(91925),u=o(36744),h=o(46044),w=o(73855),f=o(24982),g=o(32030),k=o(13080),v=o(53987),m=o(26879),y=o(76340),A=o(5500),O=o(31826),C=o(33932),T=o(92161);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:"/inside",category:"beta-direct-link",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:b.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:c.A,kind:null},{group:"work",href:"/autopilot",label:"미션",hint:"미션 \xb7 작업 (미션 계보\xb7골 던지기\xb7작업 보드\xb7자율행동)",icon:i.A,kind:null,activeAlso:["/tasks","/missions"]},{group:"work",href:"/outputs",label:"산출물",hint:"엘라누스가 만든 문서 \xb7 슬라이드 \xb7 보고서 \xb7 영상",icon:d.A,kind:null},{group:"work",href:"/scheduler",label:"예약",hint:"예약 잡 종합 현황 (크론\xb7데몬\xb7launchd)",icon:u.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:w.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:f.A,kind:null,visibility:"labs",activeAlso:["/workflows"]},{group:"make",href:"/design-check",label:"디자인",hint:"디자인 시스템 고르기 \xb7 시안 \xb7 URL 로 내 시스템",icon:g.A,kind:null},{group:"make",href:"/workspace",label:"여러 탭",hint:"여러 탭 동시 보기",icon:d.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:"/loops",label:"루프 현황",hint:"루프\xb7크론 발화 상태 (읽기 전용 \xb7 beta)",icon:h.A,kind:null},{group:"ops",href:"/ops/release",label:"릴리스",hint:"판 진행 노드 줄 \xb7 로그 꼬리",icon:f.A,kind:null},{group:"ops",href:"/ops/checklist",label:"판별 피처",hint:"확인표 칸 목록 \xb7 상태 \xb7 담당 \xb7 근거",icon:b.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:c.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:f.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:"대화 카드",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"}]},65354:(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()},92161:(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"},"/inside":{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"},"/outputs":{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"},"/loops":{pwa:"beta"},"/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)))}},94306:(e,l,o)=>{o.d(l,{M1:()=>p,Qj:()=>b,tI:()=>s});var t=o(55539),a=o(46124),i=o(76642),n=o(50363);let r=(0,a.createContext)(null);function s(e){let{client:l,queryClient:o,defaultStaleTimeMs:s,children:p}=e,b=(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:b,children:p})})}function p(){let e=(0,a.useContext)(r);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function b(){return(0,a.useContext)(r)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7081],{5997:(e,t,n)=>{"use strict";n.d(t,{Zr:()=>o,f6:()=>r,oD:()=>s});let a="elanous.daemon.sessionId";function r(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function s(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=r();return localStorage.setItem(a,t),t}function o(){let e=r();return localStorage.setItem(a,e),e}},7456:(e,t,n)=>{"use strict";n.d(t,{Er:()=>r,cj:()=>c,dc:()=>o,yR:()=>i});let a=/^(oauth\.|harness\.decision|llm\.router)/;function r(e){let t=[],n=e=>{"string"==typeof e&&e.trim()&&!t.includes(e.trim())&&t.push(e.trim())};for(let t of e){var r;let e=null!=(r=t.data)?r:{};if(t.category.startsWith("oauth.")){for(let t of["from","to","name","account"])n(e[t]);if(Array.isArray(e.usage))for(let t of e.usage)n(null==t?void 0:t.name);continue}if(a.test(t.category))for(let t of(n(e.account),["what","why","reason"])){let a=e[t];if("string"==typeof a)for(let e of a.matchAll(/계정\s+([A-Za-z0-9][\w.-]*)/g))n(e[1])}}return t}function s(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){let t=new Map(e.map((e,t)=>[e,"account-".concat(t+1)])),n=e.length?RegExp("(^|[^\\w-])(".concat(e.map(s).sort((e,t)=>t.length-e.length).join("|"),")(?![\\w-])"),"g"):null,a=new Map;return(e,r)=>{let s=e.replace(/\b[a-z0-9-]+\.tail[0-9a-f]+\.ts\.net\b/gi,"tailnet-host").replace(/\bmsb\d+\b/gi,e=>(e=>{let t=e.toLowerCase();a.has(t)||a.set(t,"remote-".concat(a.size+1));let n=a.get(t);return e===e.toUpperCase()?n.toUpperCase():n})(e)).replace(/\bmbp\b/gi,e=>e===e.toUpperCase()?"LOCAL":"local").replace(/\/Users\/[^/\s"']+/g,"~").replace(/(크레딧|credits?|💳)(\s*[:=]?\s*)[\d][\d,.]*/gi,"$1$2•••").replace(/[\d][\d,.]*(\s*)(크레딧|credits?)/gi,"•••$1$2").replace(/\$\s?[\d][\d,.]*/g,"$•••").replace(/(잔량?|remaining|left)(\s*[:=]?\s*)(?:[A-Za-z0-9][\w.-]*\s+)?\d+(?:\.\d+)?\s?%/gi,"$1$2•••");return r&&n&&(s=s.replace(n,(e,n,a)=>{var r;return"".concat(n).concat(null!=(r=t.get(a))?r:"account")})),s}}function l(e,t){if("string"==typeof e)return t(e);if(Array.isArray(e))return e.map(e=>l(e,t));if(e&&"object"==typeof e){let n={};for(let[a,r]of Object.entries(e))"apiEquivalentUsd"===a||"usd"===a||/credit(s|Balance)?$/i.test(a)||(n[a]=l(r,t));return n}return e}function i(e){let t=o(r(e));return e.map(e=>{let n=a.test(e.category);return{...e,event:t(e.event,!1),data:e.data?l(e.data,e=>t(e,n)):e.data}})}function c(e,t){let n=o(t);return l(e,e=>n(e,!0))}},11817:(e,t,n)=>{Promise.resolve().then(n.bind(n,99850))},15151:(e,t,n)=>{"use strict";n.d(t,{C:()=>c,DaemonProvider:()=>d,Q:()=>u});var a=n(55539),r=n(46124),s=n(8101),o=n(5997),l=n(18060),i=n(72215);let c=(0,r.createContext)(null);function d(e){let{children:t}=e,n={baseUrl:"",token:"",provider:""},[d,u]=(0,r.useState)(n),[m,f]=(0,r.useState)(""),[p]=(0,r.useState)(()=>new l.ki(n));(0,r.useEffect)(()=>{let e=(0,s.Fp)();u(e),p.updateConfig(e),f((0,o.oD)()),(0,i.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[p]),(0,r.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();p.updateConfig(t),u(t),(0,i.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&f(t=>t===e.newValue?t:((0,i.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p]);let g=e=>{u(t=>{let n={...t,...e};return(0,s.Qc)(e),p.updateConfig(n),(0,i.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),n})},h=e=>{f(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,i.cY)("webterm.provider.daemon.session-set",{sessionId:e})},x=(0,r.useMemo)(()=>({config:d,setConfig:g,client:p,sessionId:m,setSessionId:h}),[d,p,m]);return(0,a.jsx)(c.Provider,{value:x,children:t})}function u(){let e=(0,r.useContext)(c);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},99850:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>k});var a=n(55539),r=n(7456);function s(e){return e.map(e=>({...(0,r.cj)(e,[]),taskId:e.taskId}))}var o=n(46124),l=n(15151);function i(e){var t;for(let t of[e.sections.triage,e.sections.intake]){let e=null==t?void 0:t.data.title;if("string"==typeof e&&e.trim())return e.trim()}return(null==(t=e.apiTitle)?void 0:t.trim())||e.taskId}var c=n(79247);let d={green:"순항",yellow:"진행 중",red:"막힘",done:"완료"},u=["intake","triage","gates","relations","memory","workspace","run","landing","release"];function m(e){return null==e?"—":"string"==typeof e?e:JSON.stringify(e)}function f(e){let{entry:t}=e;return(0,a.jsxs)("details",{className:"mt-2 text-xs",children:[(0,a.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"JSON"}),(0,a.jsx)("pre",{className:"mt-2 max-h-64 overflow-auto rounded-lg bg-muted p-2 text-xs whitespace-pre-wrap break-all",children:JSON.stringify(t.data,null,2)})]})}function p(e){let{entry:t}=e,n=new Date(t.ts).toISOString();return(0,a.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[(0,a.jsxs)("span",{children:["Owner: ",t.owner]}),(0,a.jsx)("time",{dateTime:n,children:n})]})}function g(e){var t;let{card:n,placements:r}=e,s=null==(t=n.sections.gates)?void 0:t.data;return(0,a.jsxs)("section",{"aria-label":"Task card detail",className:"min-w-0 space-y-4 rounded-2xl border border-border bg-card p-4",children:[(0,a.jsxs)("header",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:i(n)}),(0,a.jsx)("p",{className:"break-all text-xs text-muted-foreground",children:n.taskId})]}),r&&(0,a.jsxs)("p",{className:"overflow-x-auto whitespace-nowrap text-sm","aria-label":"Wish placement and progress",children:["배치 \xb7 ",r.length?r.map(e=>{let{cellId:t,cellTitle:n,version:a,status:r}=e;return"".concat(t," ").concat(n," \xb7 ").concat(a,"판 \xb7 ").concat(d[r])}).join(" / "):"아직 배치되지 않음"]}),s&&(0,a.jsxs)("p",{className:"overflow-x-auto whitespace-nowrap text-sm","aria-label":"Gate decisions",children:["Gate \xb7 budget: ",m(s.budget)," \xb7 location: ",m(s.location)]}),u.map(e=>{let t=n.sections[e];return t?(0,a.jsxs)("section",{"aria-label":"".concat(e," section"),className:"rounded-xl border border-border p-3",children:[(0,a.jsx)("h3",{className:"mb-1 text-sm font-semibold capitalize",children:e}),(0,a.jsx)(p,{entry:t}),(0,a.jsx)(f,{entry:t})]},e):null}),(0,a.jsxs)("section",{"aria-label":"Incidents",className:"space-y-2",children:[(0,a.jsxs)("h3",{className:"text-sm font-semibold",children:["Incidents (",n.incidents.length,")"]}),n.incidents.length?(0,a.jsx)("ol",{className:"space-y-2",children:n.incidents.map(e=>(0,a.jsxs)("li",{className:"rounded-xl border border-border p-3",children:[(0,a.jsx)(p,{entry:e}),(0,a.jsx)(f,{entry:e})]},e.key))}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No incidents."})]})]})}let h=["steward","execution","landing","release","done"],x=new Set(["intake","triage","gates","relations","memory","workspace","run","landing","release","incidents"]);function b(e){let t=[],n=Date.parse(e.createdAt);for(let a of e.sections){let r;if(!x.has(a.key))continue;try{let e=JSON.parse(a.content);r=e&&"object"==typeof e&&!Array.isArray(e)?e:{content:a.content}}catch(e){r={content:a.content}}let s=Date.parse(a.createdAt);t.push({taskId:e.id,section:a.key,key:"".concat(a.key,":").concat(a.createdAt,":").concat(t.length),owner:a.owner,ts:Number.isFinite(s)?s:n,data:r,..."string"==typeof r.runId?{runId:r.runId}:{}})}if(0===t.length&&t.push({taskId:e.id,section:"triage",key:"api:title",owner:"task-card API",ts:n,data:{title:e.title}}),"closed"===e.status){let a=t.filter(e=>"release"===e.section).sort((e,t)=>t.ts-e.ts)[0];t.push({taskId:e.id,section:"release",key:"api:closed",owner:"task-card API",ts:Math.max(n,...t.map(e=>e.ts)),data:{...null==a?void 0:a.data,status:"done"}})}return{...function(e){let t,n=e[0];if(!n)return null;let a={},r=[],s=new Set,o=n.ts,l=-1/0;for(let i of e)if(!(i.taskId!==n.taskId||s.has(i.key)))if(s.add(i.key),o=Math.max(o,i.ts),i.runId&&i.ts>=l&&(t=i.runId,l=i.ts),"incidents"===i.section)r.push(i);else{let e=a[i.section];(!e||i.ts>=e.ts)&&(a[i.section]=i)}return{taskId:n.taskId,sections:a,incidents:r,updatedAt:o,...t?{runId:t}:{}}}(t),apiTitle:e.title}}function y(e){let{cards:t,selectedId:n,onSelect:r,selectedCard:s,detailError:o,placements:l}=e,c=(null==s?void 0:s.taskId)===n?s:null;return(0,a.jsxs)("div",{className:"space-y-4 p-4",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold",children:"보드"}),(0,a.jsx)("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-5",children:h.map(e=>(0,a.jsxs)("section",{"aria-label":"".concat(e," column"),className:"min-w-0 space-y-2 rounded-xl border border-border p-3",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold capitalize",children:e}),t.filter(t=>(function(e){var t;let n=null==(t=e.sections.release)?void 0:t.data;return(null==n?void 0:n.status)==="done"||(null==n?void 0:n.status)==="completed"?"done":n?"release":e.sections.landing?"landing":e.sections.run||e.sections.workspace||e.sections.gates||e.sections.relations||e.sections.memory?"execution":"steward"})(t)===e).map(e=>{var t,s;return(0,a.jsxs)("button",{type:"button",onClick:()=>r(e.taskId),"aria-pressed":n===e.taskId,className:"w-full rounded-lg border border-border bg-card p-3 text-left text-sm hover:bg-accent/40",children:[(0,a.jsx)("span",{className:"block font-medium",children:i(e)}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:(0,a.jsx)("time",{dateTime:new Date(e.updatedAt).toISOString(),title:new Date(e.updatedAt).toLocaleString(),children:(t=function(e){let t=new Map;for(let a of e.incidents){var n;let e=null!=(n=a.data.incidentId)?n:a.data.id,r="string"==typeof e&&e.trim()?e:a.key,s=t.get(r);(!s||a.ts>=s.ts)&&t.set(r,a)}return Array.from(t.values()).filter(e=>"closed"!==e.data.status&&"resolved"!==e.data.status).length}(e),s=Date.now(),[...t>0?["사고 ".concat(t)]:[],...e.runId?["런 ".concat(e.runId.replace(/^run-/,"").slice(0,8))]:[],function(e,t,n){let a=Math.floor((t-e)/6e4);if(!Number.isFinite(a)||a<1)return"방금";if(a<60)return"".concat(a,"분 전");if(a<1440)return"".concat(Math.floor(a/60),"시간 전");let r=new Intl.DateTimeFormat("ko-KR",{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",hour12:!1,...n?{timeZone:n}:{}}).formatToParts(new Date(e)),s=e=>{var t,n;return null!=(n=null==(t=r.find(t=>t.type===e))?void 0:t.value)?n:""};return"".concat(s("month"),"/").concat(s("day")," ").concat(s("hour"),":").concat(s("minute"))}(e.updatedAt,s,void 0)]).join(" \xb7 ")})})]},e.taskId)})]},e))}),n&&(0,a.jsxs)("aside",{className:"max-w-3xl space-y-2","aria-label":"Selected card",children:[(0,a.jsx)("button",{type:"button",onClick:()=>r(null),"aria-label":"Close card detail",className:"text-sm text-muted-foreground",children:"Close"}),c?(0,a.jsx)(g,{card:c,placements:l}):(0,a.jsx)("p",{role:"status",children:null!=o?o:"Loading card detail…"})]})]})}function w(){let{config:e}=(0,l.Q)(),t=(0,o.useMemo)(()=>e.baseUrl?(0,c.xX)({baseUrl:e.baseUrl,...e.token?{token:e.token}:{}}):null,[e.baseUrl,e.token]),[n,i]=(0,o.useState)([]),[d,u]=(0,o.useState)(null),[m,f]=(0,o.useState)(null),[p,g]=(0,o.useState)(void 0),[h,x]=(0,o.useState)(null),[w,k]=(0,o.useState)(null),[v,j]=(0,o.useState)(!1);(0,o.useEffect)(()=>{"public"===new URLSearchParams(window.location.search).get("capture")&&j(!0)},[]);let I=(0,o.useMemo)(()=>v?s(n):n,[n,v]),N=v&&m?s([m])[0]:m,S=v&&p?(0,r.cj)(p,[]):p;return(0,o.useEffect)(()=>{let e=!1;if(i([]),u(null),f(null),g(void 0),x(null),!t)return void k("Connect to NEXUS to load task cards.");k(null);let n=()=>t.getTaskCards().then(t=>{let{cards:n}=t;e||(i(n.map(b)),k(null))}).catch(t=>{e||k(t instanceof c.Iu&&404===t.status?"Task cards are not available yet (pre-E1).":t instanceof Error?t.message:String(t))});n();let a=setInterval(()=>{n()},1e4);return()=>{e=!0,clearInterval(a)}},[t]),(0,o.useEffect)(()=>{if(!t||!d)return;let e=!1;return f(null),g(void 0),x(null),t.getTaskCard(d).then(t=>{let{card:n,placements:a}=t;e||(g(a),f(b(n)))}).catch(t=>{e||x(t instanceof Error?t.message:String(t))}),()=>{e=!0}},[t,d]),(0,a.jsxs)(a.Fragment,{children:[w&&(0,a.jsx)("p",{role:"status",className:"p-4 text-sm text-muted-foreground",children:w}),(0,a.jsx)(y,{cards:I,selectedId:d,selectedCard:N,detailError:h,placements:S,onSelect:e=>{(null===e||d!==e)&&(f(null),g(void 0),x(null),u(e))}})]})}function k(){return(0,a.jsx)(w,{})}}},e=>{e.O(0,[8060,9247,2463,2196,7358],()=>e(e.s=11817)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7955],{66307:(e,t,s)=>{"use strict";s.d(t,{BotlabPageContent:()=>h});var r,l=s(55539),a=s(46124);let o=(null!=(r=s(11041).env.NEXT_PUBLIC_ELANOUS_BOTLAB_HOST)?r:"").trim(),n="elanous.botlab.wallHost",d=/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;function i(e){return e.length>0&&e.length<=253&&d.test(e)}function c(e){var t;let{search:s,remembered:r=null}=e,d=(0,a.useMemo)(()=>(function(e){var t,s;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,l=null;try{l=new URLSearchParams(e).get("host")}catch(e){l=null}let a=null!=(t=null==l?void 0:l.trim())?t:"";if(""!==a&&i(a))return{host:a,source:"query",rejected:null};let n=""===a?null:a,d=null!=(s=null==r?void 0:r.trim())?s:"";return""!==d&&i(d)?{host:d,source:"remembered",rejected:n}:""!==o&&i(o)?{host:o,source:"default",rejected:n}:{host:"",source:"unset",rejected:n}})(s,r),[s,r]),c="unset"===d.source?null:(t=d.host,"https://".concat(t).concat("/bot3/bot-wall.html"));return(0,a.useEffect)(()=>{if("query"===d.source)try{window.localStorage.setItem(n,d.host)}catch(e){}},[d.source,d.host]),(0,l.jsxs)("main",{className:"mx-auto flex w-full max-w-6xl flex-col gap-6 px-6 py-10 sm:px-10","data-testid":"botlab-panel",children:[(0,l.jsxs)("header",{children:[(0,l.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-muted-foreground",children:"Bot screens"}),(0,l.jsx)("h1",{className:"mt-2 text-3xl font-bold",children:"Botlab"}),(0,l.jsxs)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:["Live noVNC screens for the bots, served through Tailscale. One document holds all four sessions, so the VNC password is asked ",(0,l.jsx)("strong",{children:"once"}),", not four times."]}),(0,l.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:"View-only by default. This surface cannot send commands or control the bots."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-4","aria-label":"Wall address",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Wall address"}),(0,l.jsx)("p",{className:"mt-1 break-all font-mono text-xs text-muted-foreground","data-testid":"botlab-wall-url",children:null!=c?c:"(no host configured)"}),(0,l.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"botlab-host-source",children:"query"===d.source?"Host came from the ?host= query parameter (remembered on this device).":"remembered"===d.source?"Host is the one remembered on this device; override it with ?host=<tailnet-name>.":"default"===d.source?"Host is the build default (NEXT_PUBLIC_ELANOUS_BOTLAB_HOST); override it with ?host=<tailnet-name>.":"No wall host is configured. Open this page once with ?host=<the VM tailnet name> — it is remembered on this device."}),null!==d.rejected&&(0,l.jsxs)("p",{role:"alert",className:"mt-2 text-xs text-destructive","data-testid":"botlab-host-rejected",children:["Ignored ?host=",d.rejected," — not a valid hostname."]}),null!==c&&(0,l.jsxs)("p",{className:"mt-3 text-xs text-muted-foreground",children:[(0,l.jsx)("a",{className:"underline",href:c,target:"_blank",rel:"noreferrer","data-testid":"botlab-open-tab",children:"Open the wall in a new tab"})," — ","use this if the embedded frame stays blank."]})]}),null!==c&&(0,l.jsx)("section",{"aria-label":"Bot screen wall",children:(0,l.jsx)("iframe",{src:c,title:"Bot screen wall","data-testid":"botlab-wall-frame",className:"h-[70vh] w-full rounded-xl border border-border bg-background"})}),(0,l.jsxs)("section",{className:"rounded-xl border border-border bg-card p-5","aria-label":"If the wall is blank",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"If the wall stays blank"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"A blank frame is not necessarily a broken bot. There are three separate reasons, with different fixes:"}),(0,l.jsxs)("ol",{className:"mt-3 list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"This device is outside the tailnet."})," The address simply does not exist here. Join the tailnet, or view the screens from a device that is on it."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"Tailscale serve is not published."})," Re-run"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"bash scripts/botlab/deploy-bot-wall.sh"}),", which re-publishes the paths and then verifies each one returns 200."]}),(0,l.jsxs)("li",{children:[(0,l.jsx)("strong",{children:"The wall loaded but did not connect."})," That is a VNC-level failure, not a page failure — the wall itself reports connected/failed counts once you enter the password."]})]}),(0,l.jsx)("p",{className:"mt-3 text-xs text-muted-foreground",children:"The VNC password is deliberately not carried in this page or in the URL: any page a bot browser opens could otherwise reach the local websocket, and websockets have no CORS."})]}),(0,l.jsxs)("section",{className:"rounded-xl border border-dashed border-border p-5","aria-label":"Not wired yet",children:[(0,l.jsx)("h2",{className:"text-sm font-semibold",children:"Not wired yet"}),(0,l.jsxs)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,l.jsxs)("li",{children:["Per-bot cell headers (name \xb7 last round verdict \xb7 whether CDP is alive) need"," ",(0,l.jsx)("code",{className:"font-mono text-xs",children:"browserPort"})," and round results on the daemon's persona route. That route is owned by another track and is not published today."]}),(0,l.jsx)("li",{children:"Running a command from this surface needs a POST route that does not exist yet."})]})]})]})}function h(){let e=window.location.search,t=null;try{t=window.localStorage.getItem(n)}catch(e){t=null}return(0,l.jsx)(c,{search:e,remembered:t})}},73433:(e,t,s)=>{Promise.resolve().then(s.bind(s,66307))}},e=>{e.O(0,[2463,2196,7358],()=>e(e.s=73433)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2580],{5997:(e,t,r)=>{"use strict";r.d(t,{Zr:()=>o,f6:()=>n,oD:()=>s});let a="elanous.daemon.sessionId";function n(){return"undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID?crypto.randomUUID():"s-".concat(Date.now().toString(36),"-").concat(Math.random().toString(36).slice(2,10))}function s(){let e=function(){let e=new URLSearchParams(window.location.search).get("session");return e?(localStorage.setItem(a,e),e):localStorage.getItem(a)}();if(e)return e;let t=n();return localStorage.setItem(a,t),t}function o(){let e=n();return localStorage.setItem(a,e),e}},9734:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var a=r(55539),n=r(89545),s=r(17154),o=r(44373);let i=(0,s.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function l(e){let{className:t,variant:r="default",size:s="default",...l}=e;return(0,a.jsx)(n.$,{"data-slot":"button",className:(0,o.cn)(i({variant:r,size:s,className:t})),...l})}},15151:(e,t,r)=>{"use strict";r.d(t,{C:()=>d,DaemonProvider:()=>c,Q:()=>u});var a=r(55539),n=r(46124),s=r(8101),o=r(5997),i=r(18060),l=r(72215);let d=(0,n.createContext)(null);function c(e){let{children:t}=e,r={baseUrl:"",token:"",provider:""},[c,u]=(0,n.useState)(r),[p,m]=(0,n.useState)(""),[g]=(0,n.useState)(()=>new i.ki(r));(0,n.useEffect)(()=>{let e=(0,s.Fp)();u(e),g.updateConfig(e),m((0,o.oD)()),(0,l.cY)("webterm.provider.daemon.init",{baseUrl:e.baseUrl,hasToken:!!e.token})},[g]),(0,n.useEffect)(()=>{let e=e=>{if("elanous.daemon.token"===e.key||"elanous.nexus.baseUrl"===e.key){let t=(0,s.Fp)();g.updateConfig(t),u(t),(0,l.cY)("webterm.provider.daemon.config-cross-tab",{key:e.key,hasToken:!!t.token});return}"elanous.daemon.sessionId"===e.key&&e.newValue&&m(t=>t===e.newValue?t:((0,l.cY)("webterm.provider.daemon.session-cross-tab",{previous:t||"(empty)",next:e.newValue}),e.newValue))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[g]);let x=e=>{u(t=>{let r={...t,...e};return(0,s.Qc)(e),g.updateConfig(r),(0,l.cY)("webterm.provider.daemon.config-update",{keys:Object.keys(e)}),r})},v=e=>{m(e),localStorage.setItem("elanous.daemon.sessionId",e),(0,l.cY)("webterm.provider.daemon.session-set",{sessionId:e})},f=(0,n.useMemo)(()=>({config:c,setConfig:x,client:g,sessionId:p,setSessionId:v}),[c,g,p]);return(0,a.jsx)(d.Provider,{value:f,children:t})}function u(){let e=(0,n.useContext)(d);if(!e)throw Error("useDaemon must be used inside <DaemonProvider>");return e}},30158:(e,t,r)=>{"use strict";r.d(t,{p:()=>o});var a=r(55539);r(46124);var n=r(8085),s=r(44373);function o(e){let{className:t,type:r,...o}=e;return(0,a.jsx)(n.p,{type:r,"data-slot":"input",className:(0,s.cn)("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...o})}},44373:(e,t,r)=>{"use strict";r.d(t,{cn:()=>s});var a=r(20852),n=r(30984);function s(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,n.QP)((0,a.$)(t))}},65137:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var a=r(55539),n=r(93521);function s(){return(0,a.jsx)(n.U,{})}},69814:(e,t,r)=>{Promise.resolve().then(r.bind(r,65137))},93521:(e,t,r)=>{"use strict";r.d(t,{U:()=>m});var a=r(55539),n=r(46124),s=r(15151),o=r(9734),i=r(30158);function l(e){let{items:t}=e;return 0===t.length?(0,a.jsx)("div",{className:"rounded-lg border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No control signals matched the current filter."}):(0,a.jsx)("ul",{className:"space-y-2",children:t.map((e,t)=>{var r,n,s,o,i;let l=[(null==(r=e.scope)?void 0:r.surface)&&"surface=".concat(e.scope.surface),(null==(n=e.scope)?void 0:n.channel)&&"channel=".concat(e.scope.channel),(null==(s=e.scope)?void 0:s.sessionId)&&"session=".concat(e.scope.sessionId)].filter(Boolean).join(" \xb7 ")||"unscoped";return(0,a.jsxs)("li",{className:"rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsxs)("div",{className:"text-sm font-medium",children:[e.kind," \xb7 ",e.urgency]}),(0,a.jsxs)("div",{className:"mt-0.5 font-mono text-[10px] text-muted-foreground",children:[function(e){let t=Date.now()-new Date(e).getTime();return t<6e4?"just now":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")}(e.createdAt)," \xb7 ",null!=(o=e.source)?o:"unknown"," \xb7 ",l]}),(0,a.jsx)("pre",{className:"mt-2 overflow-x-auto rounded-md bg-muted p-2 text-[11px]",children:JSON.stringify(null!=(i=e.payload)?i:{},null,2)})]},t)})})}let d=["background","quick-pass","normal","priority","critical"];class c{async list(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=new URLSearchParams;Object.entries(e).forEach(e=>{let[r,a]=e;a&&t.set(r,a)});let r=t.toString();return this.client.fetchJson("/v1/control-signals".concat(r?"?".concat(r):""))}emit(e){return this.client.fetchJson("/v1/control-signals",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)})}constructor(e){this.client=e}}var u=r(67327),p=r(72215);function m(){var e,t,r,m;let{client:g}=(0,s.Q)(),x=(0,n.useMemo)(()=>new c(g),[g]),[v,f]=(0,n.useState)({items:[]}),[b,h]=(0,n.useState)(!1),[y,w]=(0,n.useState)(""),[k,j]=(0,n.useState)(""),[N,S]=(0,n.useState)(""),[C,z]=(0,n.useState)(""),[I,E]=(0,n.useState)(""),[U,D]=(0,n.useState)(""),[_,O]=(0,n.useState)("normal"),[P,J]=(0,n.useState)("operator"),[R,Y]=(0,n.useState)(""),[M,V]=(0,n.useState)(""),[$,F]=(0,n.useState)(""),[L,Q]=(0,n.useState)(""),[T,q]=(0,n.useState)(!1),A=(0,n.useCallback)(async()=>{(0,p.cY)("webterm.control.list.refresh",{kind:y,surface:k,minUrgency:N,sessionId:C,limit:I}),h(!0);try{let e=await x.list({kind:y||void 0,surface:k||void 0,minUrgency:N||void 0,sessionId:C||void 0,limit:I||void 0});f(e)}catch(e){u.oR.error("signals list failed: ".concat(e instanceof Error?e.message:e))}finally{h(!1)}},[x,y,k,N,C,I]);(0,n.useEffect)(()=>{A()},[A]);let B=async e=>{if(e.preventDefault(),!U.trim())return void u.oR.error("kind required");let t={};if(L.trim())try{t=JSON.parse(L)}catch(e){u.oR.error("payload must be valid JSON");return}let r={kind:U.trim(),urgency:_,source:P.trim()||"operator",mayPreempt:T,payload:t,scope:{...R?{surface:R}:{},...M?{channel:M}:{},...$?{sessionId:$}:{}}};(0,p.cY)("webterm.control.emit",{kind:r.kind,urgency:r.urgency});try{h(!0),await x.emit(r),u.oR.success("signal emitted"),Q(""),await A()}catch(e){u.oR.error("emit failed: ".concat(e instanceof Error?e.message:e))}finally{h(!1)}},K=null!=(e=v.countsByKind)?e:{};return(0,a.jsxs)("div",{className:"mx-auto max-w-5xl space-y-4 p-4",children:[(0,a.jsxs)("header",{className:"space-y-2",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Control signals"}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["total ",null!=(t=v.total)?t:0]}),(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:["latest ",null!=(r=v.latest)?r:"-"]}),Object.entries(K).map(e=>{let[t,r]=e;return(0,a.jsxs)("span",{className:"rounded-full border border-border px-2 py-0.5",children:[t," ",r]},t)})]})]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),A()},className:"flex flex-wrap items-center gap-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsx)(i.p,{value:y,onChange:e=>w(e.target.value),placeholder:"kind",className:"flex-1 min-w-[140px]"}),(0,a.jsx)(i.p,{value:k,onChange:e=>j(e.target.value),placeholder:"surface",className:"flex-1 min-w-[140px]"}),(0,a.jsxs)("select",{value:N,onChange:e=>S(e.target.value),className:"h-9 flex-1 min-w-[170px] rounded-md border border-input bg-background px-2 text-sm",children:[(0,a.jsx)("option",{value:"",children:"min urgency (any)"}),d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)(i.p,{value:C,onChange:e=>z(e.target.value),placeholder:"session id",className:"flex-1 min-w-[140px]"}),(0,a.jsx)(i.p,{value:I,onChange:e=>E(e.target.value),placeholder:"limit",type:"number",className:"w-[100px]"}),(0,a.jsx)(o.$,{type:"submit",size:"sm",disabled:b,children:"Filter"})]}),(0,a.jsxs)("form",{onSubmit:B,className:"space-y-2 rounded-lg border border-border bg-card p-3 shadow-sm",children:[(0,a.jsx)("h2",{className:"text-sm font-semibold",children:"Emit a signal"}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(i.p,{value:U,onChange:e=>D(e.target.value),placeholder:"kind (required)",className:"flex-1 min-w-[140px]"}),(0,a.jsx)("select",{value:_,onChange:e=>{let t=e.target.value;"string"==typeof t&&d.includes(t)&&O(t)},className:"h-9 rounded-md border border-input bg-background px-2 text-sm",children:d.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsx)(i.p,{value:P,onChange:e=>J(e.target.value),placeholder:"source",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:R,onChange:e=>Y(e.target.value),placeholder:"scope.surface",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:M,onChange:e=>V(e.target.value),placeholder:"scope.channel",className:"flex-1 min-w-[120px]"}),(0,a.jsx)(i.p,{value:$,onChange:e=>F(e.target.value),placeholder:"scope.session",className:"flex-1 min-w-[120px]"}),(0,a.jsxs)("label",{className:"flex items-center gap-1.5 text-xs",children:[(0,a.jsx)("input",{type:"checkbox",checked:T,onChange:e=>q(e.target.checked)}),"mayPreempt"]})]}),(0,a.jsx)("textarea",{value:L,onChange:e=>Q(e.target.value),placeholder:'payload JSON (optional, e.g. {"reason":"manual"})',rows:3,className:"w-full resize-y rounded-md border border-input bg-background px-3 py-2 font-mono text-xs"}),(0,a.jsx)(o.$,{type:"submit",size:"sm",disabled:b,children:"Emit"})]}),(0,a.jsx)(l,{items:null!=(m=v.items)?m:[]})]})}}},e=>{e.O(0,[211,8682,7327,8085,8060,2463,2196,7358],()=>e(e.s=69814)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6348],{3004:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},7006:(e,t,s)=>{Promise.resolve().then(s.bind(s,47106))},18068:(e,t,s)=>{"use strict";s.d(t,{Qb:()=>a,SI:()=>o,dJ:()=>l});let n="elanous:auth-required",r=null,i=!1;function a(e){null===r&&(r=e,window.dispatchEvent(new CustomEvent(n,{detail:{path:e}})))}function l(e){let t=window,s=t=>e(t.detail);return t.addEventListener(n,s),null===r||i||e({path:r}),()=>t.removeEventListener(n,s)}function o(){i=!0}},24231:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).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"}]])},47106:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>E});var n=s(55539),r=s(81694),i=s(3004);let a=(0,s(3704).A)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]);var l=s(74227),o=s(24231),c=s(46124),d=s(94306),u=s(21501),h=s(50363),m=s(67264),p=s(65354),g=s(79247);function f(e){let{available:t,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}=e,{systems:o,themes:c}=function(e){let t=[],s=[];for(let n of e)("design-system"===n.source?t:s).push(n);return{systems:t,themes:s}}(t);return(0,n.jsxs)("div",{className:"space-y-4",children:[o.length>0&&(0,n.jsx)(x,{title:"Design systems",hint:"Web \xb7 copies tokens.css and DESIGN.md into design/system/",items:o,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l}),c.length>0&&(0,n.jsx)(x,{title:"Terminal themes",hint:"One line in DESIGN.md",items:c,declared:s,onPick:r,pendingId:i,previews:a,onPreview:l})]})}function x(e){let{title:t,hint:s,items:r,declared:i,onPick:a,pendingId:l,previews:o,onPreview:c}=e;return(0,n.jsxs)("section",{className:"space-y-2","aria-label":t,children:[(0,n.jsxs)("h3",{className:"flex items-baseline gap-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[t,(0,n.jsxs)("span",{className:"normal-case tracking-normal",children:[r.length," \xb7 ",s]})]}),(0,n.jsx)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3",children:r.map(e=>(0,n.jsx)(b,{direction:e,chosen:e.id===i,onPick:a,pending:l===e.id,busy:null!==l,hasPreview:(null==o?void 0:o.has(e.id))===!0&&void 0!==c,onPreview:c},e.id))})]})}function b(e){var t,s,r,a,l,o,c,d,u;let{direction:h,chosen:m,onPick:p,pending:g,busy:f,hasPreview:x,onPreview:b}=e,y=null!=(r=h.swatch.bg)?r:h.isDark?"#111111":"#ffffff",v=null!=(a=h.swatch.fg)?a:h.swatch.text,w=null!=(o=null!=(l=null==(t=h.typography)?void 0:t.display)?l:null==(s=h.typography)?void 0:s.body)?o:null;return(0,n.jsxs)("li",{"data-direction":h.id,"data-direction-id":h.id,className:"flex flex-col gap-2 rounded-md border p-3 text-sm ".concat(m?"border-primary ring-1 ring-primary":""),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5","aria-hidden":!0,children:[[y,v,h.swatch.accent].map((e,t)=>(0,n.jsx)("span",{className:"h-5 w-5 rounded-full border",style:{backgroundColor:e,borderColor:h.swatch.muted}},t)),h.category&&(0,n.jsx)("span",{className:"ml-auto truncate text-[11px] text-muted-foreground",children:h.category})]}),(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"truncate font-medium",children:null!=(c=h.label)?c:h.id}),(0,n.jsxs)("p",{className:"truncate text-xs text-muted-foreground",children:[(0,n.jsx)("code",{children:h.id}),w?" \xb7 ".concat(w):""]}),(0,n.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:h.mood})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[x&&(0,n.jsx)("button",{type:"button",onClick:()=>null==b?void 0:b(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Preview ".concat(null!=(d=h.label)?d:h.id),children:"Preview"}),m?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-primary",children:[(0,n.jsx)(i.A,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Selected"]}):(0,n.jsx)("button",{type:"button",disabled:f,onClick:()=>p(h.id),className:"self-start rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(null!=(u=h.label)?u:h.id),children:g?"Selecting…":"Select"})]})]})}let y=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;function v(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function w(e,t){if("undefined"==typeof document)return t;let s=document.getElementById(e);return s&&"value"in s&&"string"==typeof s.value?s.value:t}function k(e){let{onCreate:t,onSelect:s,pending:r,result:i,error:a}=e,[l,o]=(0,c.useState)("url"),[d,u]=(0,c.useState)(""),[h,m]=(0,c.useState)(""),[p,g]=(0,c.useState)(""),f=v(h).filter(e=>y.test(e)),x=v(h).length,b=x>=2&&x<=6&&p.trim().length>0&&f.length===x;return(0,n.jsxs)("section",{className:"rounded-md border p-3","aria-label":"Make my system","data-make-my-system":"",children:[(0,n.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,n.jsx)("h3",{className:"text-sm font-medium",children:"Make my system"}),(0,n.jsxs)("div",{className:"flex gap-1",role:"tablist",children:[(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"url"===l,className:"rounded-md px-2 py-1 text-xs ".concat("url"===l?"bg-muted":""),onClick:()=>o("url"),children:"From a website"}),(0,n.jsx)("button",{type:"button",role:"tab","aria-selected":"colors"===l,className:"rounded-md px-2 py-1 text-xs ".concat("colors"===l?"bg-muted":""),onClick:()=>o("colors"),children:"From colors"})]})]}),(0,n.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Reference, not a copy — logos, names, images and text are not taken."}),"url"===l?(0,n.jsxs)("form",{className:"mt-2 flex flex-col gap-2 sm:flex-row",onSubmit:e=>{e.preventDefault();let s=d.trim();s&&!r&&t({kind:"url",url:s})},children:[(0,n.jsx)("label",{className:"sr-only",htmlFor:"make-system-url",children:"Website URL"}),(0,n.jsx)("input",{id:"make-system-url",type:"url",value:d,disabled:r,placeholder:"https://example.com",onChange:e=>u(e.target.value),className:"min-w-0 flex-1 rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=w("make-system-url",d).trim();e&&!r&&t({kind:"url",url:e})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}):(0,n.jsxs)("form",{className:"mt-2 space-y-2",onSubmit:e=>{e.preventDefault(),b&&!r&&t({kind:"palette",colors:f,id:p.trim()})},children:[(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-colors",children:"2–6 colors"}),(0,n.jsx)("input",{id:"make-system-colors",value:h,disabled:r,placeholder:"#f4efe6, #1f3a2e, #c8553d",onChange:e=>m(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),f.length>0&&(0,n.jsx)("ul",{className:"flex gap-1","aria-label":"Color preview",children:f.map(e=>(0,n.jsx)("li",{className:"h-6 w-6 rounded-sm border",style:{backgroundColor:e},title:e},e))}),(0,n.jsx)("label",{className:"block text-xs text-muted-foreground",htmlFor:"make-system-id",children:"id"}),(0,n.jsx)("input",{id:"make-system-id",value:p,disabled:r,placeholder:"stumptowncoffee",onChange:e=>g(e.target.value),className:"w-full rounded-md border bg-transparent px-2 py-1.5 text-sm"}),(0,n.jsx)("button",{type:"button",disabled:r,onClick:()=>{let e=v(w("make-system-colors",h)).filter(e=>y.test(e)),s=w("make-system-id",p).trim();r||e.length<2||e.length>6||0===s.length||t({kind:"palette",colors:e,id:s})},className:"rounded-md border px-3 py-1.5 text-sm hover:bg-muted disabled:opacity-50",children:r?"Measuring…":"Make it"})]}),r&&(0,n.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Measuring…"}),a&&(0,n.jsx)("p",{className:"mt-2 text-sm text-error",role:"alert",children:a}),i&&(0,n.jsxs)("div",{className:"mt-2 space-y-1 text-sm",children:[(0,n.jsxs)("p",{children:["Made ",i.id," — ",i.tokens.length," tokens \xb7 ",i.unread," unread"]}),i.warnings.map(e=>(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e},e)),(0,n.jsx)("button",{type:"button",onClick:()=>s(i.id),className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted",children:"Select it"})]})]})}let j={missing:"Missing",declared:"Declared",available:"Not declared"},N={missing:"bg-error/10 text-error",declared:"bg-green-600/10 text-green-700",available:"bg-muted text-muted-foreground"},S={missing:r.A,declared:i.A,available:a};function C(){return(0,d.Qj)()?(0,n.jsx)(M,{}):(0,n.jsxs)("div",{className:"mx-auto max-w-2xl space-y-2 p-6",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold tracking-tight",children:"Design check"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Connect to a NEXUS daemon to see this repository's craft rulebooks."})]})}function M(){let{data:e,isLoading:t,error:s,refetch:i,isFetching:a}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designCheck(),queryFn:()=>s.getDesignCheck(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}();return(0,n.jsxs)("div",{className:"mx-auto max-w-3xl space-y-4 p-6",children:[(0,n.jsxs)("header",{className:"flex items-start justify-between gap-4",children:[(0,n.jsxs)("div",{className:"space-y-1",children:[(0,n.jsxs)("h1",{className:"flex items-center gap-2 text-xl font-semibold tracking-tight",children:[(0,n.jsx)(l.A,{className:"h-5 w-5","aria-hidden":!0}),"Design check"]}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Craft rulebooks declared by this repository's ",(0,n.jsx)("code",{children:"DESIGN.md"}),"."]})]}),(0,n.jsxs)("button",{type:"button",onClick:()=>void i(),className:"inline-flex items-center gap-1.5 rounded-md border px-2.5 py-1.5 text-sm hover:bg-muted","aria-label":"Refresh design check",children:[(0,n.jsx)(o.A,{className:"h-4 w-4 ".concat(a?"animate-spin":""),"aria-hidden":!0}),"Refresh"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading…"}),s&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-3 text-sm text-error",children:["Could not reach the daemon: ",s instanceof Error?s.message:String(s)]}),e&&!1===e.ok&&(0,n.jsxs)("div",{className:"space-y-2 rounded-md border border-warning/40 bg-warning/5 p-4",children:[(0,n.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium",children:[(0,n.jsx)(r.A,{className:"h-4 w-4 text-warning","aria-hidden":!0}),"Design check blocked"]}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:function(e,t){switch(e){case"no-repository":return"The daemon is not running inside a git checkout, so there is no DESIGN.md to check.";case"craft-directory":return"elanous's craft rulebook directory could not be read: ".concat(null!=t?t:"(unknown path)");case"design-document":return"This repository has no readable DESIGN.md: ".concat(null!=t?t:"(unknown path)");default:return"The design check is blocked (".concat(e,").")}}(e.blockedOn,e.path)})]}),e&&!0===e.ok&&(0,n.jsx)(F,{data:e})]})}function F(e){let{data:t}=e,s=function(e){let t=new Set(e.unavailableRulebooks),s=new Map;for(let t of e.availableRulebooks)s.set(t,"available");for(let n of e.declaredRulebooks)s.set(n,t.has(n)?"missing":"declared");let n={missing:0,declared:1,available:2};return[...s.entries()].map(e=>{let[t,s]=e;return{name:t,status:s}}).sort((e,t)=>n[e.status]-n[t.status]||e.name.localeCompare(t.name))}(t),r=t.unavailableRulebooks.length;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"rounded-md p-3 text-sm ".concat(r?"bg-error/10 text-error":"bg-green-600/10 text-green-700"),children:r?"".concat(r," declared rulebook").concat(1===r?"":"s"," could not be found."):"All ".concat(t.declaredRulebooks.length," declared rulebook").concat(1===t.declaredRulebooks.length?"":"s"," resolve.")}),(0,n.jsxs)("dl",{className:"grid grid-cols-1 gap-1 text-xs text-muted-foreground sm:grid-cols-2",children:[(0,n.jsxs)("div",{className:"truncate sm:col-span-2",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Repository: "}),(0,n.jsxs)("dd",{className:"inline",children:[(0,n.jsx)("code",{children:t.repoRoot}),t.repoSource&&(0,n.jsxs)("span",{className:"ml-1",children:["(","config"===t.repoSource?"harness.defaultRepo":"daemon folder",")"]})]})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Document: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.documentPath})})]}),(0,n.jsxs)("div",{className:"truncate",children:[(0,n.jsx)("dt",{className:"inline font-medium",children:"Rulebooks: "}),(0,n.jsx)("dd",{className:"inline",children:(0,n.jsx)("code",{children:t.craftDirectory})})]})]}),(0,n.jsx)(O,{data:t}),0===s.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"elanous ships no craft rulebooks and this document declares none."}):(0,n.jsx)("ul",{className:"divide-y rounded-md border",children:s.map(e=>{let t=S[e.status];return(0,n.jsxs)("li",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[(0,n.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,n.jsx)(t,{className:"h-4 w-4 shrink-0","aria-hidden":!0}),(0,n.jsx)("code",{children:e.name})]}),(0,n.jsx)("span",{className:"shrink-0 rounded-full px-2 py-0.5 text-xs ".concat(N[e.status]),children:j[e.status]})]},e.name)})})]})}function O(e){var t,s,r,i;let{data:a}=e,l=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.setDesignDirection(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),o=function(){let e=(0,d.M1)(),t=(0,h.jE)();return(0,m.n)({mutationFn:t=>e.createDesignSystem(t),onSuccess:()=>t.invalidateQueries({queryKey:p.AF.designCheck()})})}(),x=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreviews(),queryFn:()=>s.listDesignPreviews(),enabled:null==(e=t.enabled)||e,refetchInterval:3e4})}(),[b,y]=(0,c.useState)(null),[v,w]=(0,c.useState)(null),j=a.directions;if((0,c.useEffect)(()=>{if(!v||!j)return;let e=document.querySelector('[data-direction-id="'.concat(v.replace(/"/g,""),'"]'));null==e||e.scrollIntoView({block:"nearest"})},[v,j]),!j)return null;let N=l.isPending&&null!=(s=l.variables)?s:null;return(0,n.jsxs)("section",{className:"space-y-2",children:[(0,n.jsx)("h2",{className:"text-sm font-medium",children:"Design direction"}),(0,n.jsx)(k,{pending:o.isPending,result:null!=(r=o.data)?r:null,error:o.isError?function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"bad-url":return"That address is not an http or https URL.";case"bad-id":return"The id may only use lowercase letters, digits, and hyphens.";case"id-taken":return"That id is already taken.";case"extract-failed":return"The page could not be measured.";case"no-colors":return"Give between 2 and 6 colors.";case"busy":return"Another system is being made — wait for it to finish.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can make a system — sign in first.";return"Could not make the system: ".concat(e instanceof Error?e.message:String(e))}}(o.error):null,onCreate:e=>{o.mutate(e,{onSuccess:e=>w(e.id)})},onSelect:e=>{w(e),l.mutate(e)}}),j.unavailable&&(0,n.jsxs)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:["Declared direction ",(0,n.jsx)("code",{children:j.unavailable})," is not registered."]}),null===j.declared&&!j.unavailable&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"None declared — pick one below."}),l.isError&&(0,n.jsx)("p",{className:"rounded-md bg-error/10 p-2 text-sm text-error",children:function(e){switch(e instanceof g.Iu&&e.body&&"object"==typeof e.body?e.body.reason:void 0){case"unknown-direction":return"The daemon does not know this direction.";case"no-repository":return"The daemon has no repository to write to (set harness.defaultRepo).";case"conflicting-system-file":return"design/system/ already holds a file the daemon will not overwrite.";case"cannot-read":return"The DESIGN.md could not be read.";case"cannot-write":return"The DESIGN.md could not be written.";default:if(e instanceof g.Iu&&401===e.status)return"Only the owner can pick a direction — sign in first.";return"Could not set the direction: ".concat(e instanceof Error?e.message:String(e))}}(l.error)}),b&&(0,n.jsx)(A,{system:b,onClose:()=>y(null),onSelect:()=>l.mutate(b),selecting:N===b,busy:null!==N,alreadySelected:j.declared===b}),(0,n.jsx)(f,{available:j.available,declared:j.declared,pendingId:N,previews:new Set((null!=(i=null==(t=x.data)?void 0:t.previews)?i:[]).map(e=>e.system)),onPreview:e=>y(e),onPick:e=>l.mutate(e)})]})}function A(e){let{system:t,onClose:s,onSelect:r,selecting:i,busy:a,alreadySelected:l}=e,o=function(e){let t=(0,d.M1)();return(0,u.I)({queryKey:p.AF.designPreview(null!=e?e:""),queryFn:()=>t.getDesignPreview(e),enabled:null!==e&&""!==e})}(t);return(0,n.jsxs)("div",{className:"space-y-2 rounded-md border p-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("p",{className:"text-sm font-medium",children:["Preview \xb7 ",(0,n.jsx)("code",{children:t})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[l?(0,n.jsx)("span",{className:"text-xs text-primary",children:"Selected"}):(0,n.jsx)("button",{type:"button",disabled:a,onClick:r,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted disabled:opacity-50","aria-label":"Select ".concat(t),children:i?"Selecting…":"Select"}),(0,n.jsx)("button",{type:"button",onClick:s,className:"rounded-md border px-2.5 py-1 text-xs hover:bg-muted","aria-label":"Close preview",children:"Close"})]})]}),o.isLoading&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading preview…"}),o.isError&&(0,n.jsxs)("p",{className:"text-sm text-error",children:["Could not load the preview: ",o.error instanceof Error?o.error.message:String(o.error)]}),o.data&&(0,n.jsx)("iframe",{sandbox:"",srcDoc:o.data.html,title:"Preview \xb7 ".concat(t),className:"h-80 w-full rounded-md border bg-white"})]})}function E(){return(0,n.jsx)(C,{})}},65354:(e,t,s)=>{"use strict";s.d(t,{AF:()=>n});let n={all:["nexus"],health:()=>[...n.all,"health"],snapshot:()=>[...n.all,"snapshot"],tabs:e=>e?[...n.all,"tabs",{kind:e}]:[...n.all,"tabs"],tab:e=>[...n.all,"tab",e],templates:()=>[...n.all,"templates"],template:e=>[...n.all,"template",e],config:()=>[...n.all,"config"],switches:()=>[...n.all,"switches"],switch:e=>[...n.all,"switch",e],secrets:()=>[...n.all,"secrets"],bindingChannels:()=>[...n.all,"bindings","channels"],bindings:e=>[...n.all,"bindings",e],binding:(e,t)=>[...n.all,"binding",e,t],logsTail:(e,t)=>t?[...n.all,"logs",e,{lines:t}]:[...n.all,"logs",e],workflows:()=>[...n.all,"workflows"],workflow:e=>[...n.all,"workflow",e],workflowRun:e=>[...n.all,"workflow-run",e],workflowRuns:()=>[...n.all,"workflow-runs"],pendingApprovals:()=>[...n.all,"workflow-pending-approvals"],platforms:()=>[...n.all,"platforms"],providers:()=>[...n.all,"providers"],worktrees:()=>[...n.all,"worktrees"],designCheck:()=>[...n.all,"design-check"],designPreviews:()=>[...n.all,"design-previews"],designPreview:e=>[...n.all,"design-preview",e],registryCatalog:()=>[...n.all,"registry-catalog"],resolvedView:()=>[...n.all,"resolved-view"]};n.snapshot(),n.tabs(),n.health(),n.snapshot(),n.config(),n.switches()},67264:(e,t,s)=>{"use strict";s.d(t,{n:()=>d});var n=s(46124),r=s(17600),i=s(92477),a=s(33814),l=s(40404),o=class extends a.Q{#e;#t=void 0;#s;#n;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),(0,l.f8)(this.options,t)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,l.EN)(t.mutationKey)!==(0,l.EN)(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(e){this.#r(),this.#i(e)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#r(),this.#i()}mutate(e,t){return this.#n=t,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(e)}#r(){let e=this.#s?.state??(0,r.$)();this.#t={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#i(e){i.jG.batch(()=>{if(this.#n&&this.hasListeners()){let t=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type==="success"){try{this.#n.onSuccess?.(e.data,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(e.data,null,t,s,n)}catch(e){Promise.reject(e)}}else if(e?.type==="error"){try{this.#n.onError?.(e.error,t,s,n)}catch(e){Promise.reject(e)}try{this.#n.onSettled?.(void 0,e.error,t,s,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},c=s(50363);function d(e,t){let s=(0,c.jE)(t),[r]=n.useState(()=>new o(s,e));n.useEffect(()=>{r.setOptions(e)},[r,e]);let a=n.useSyncExternalStore(n.useCallback(e=>r.subscribe(i.jG.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),d=n.useCallback((e,t)=>{r.mutate(e,t).catch(l.lQ)},[r]);if(a.error&&(0,l.GU)(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:d,mutateAsync:a.mutate}}},72215:(e,t,s)=>{"use strict";let n;s.d(t,{cY:()=>d,x8:()=>l});let r={debug:0,info:1,warn:2,error:3},i="/v1/debug-logs/batch",a=null;function l(e){a=e}class o{health(){return{pending:this.queue.length,consecutiveFailures:this.consecutiveFailures,lastOkAt:this.lastOkAt,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches}}push(e){if(!(r[function(e){let t=e.slice(e.lastIndexOf(".")+1).toLowerCase();return/^(error|exception|crash|fail|failed)$/.test(t)?"error":/^(warn|degraded|timeout)$/.test(t)?"warn":/^(boot|ready|start|begin|open|ok|done|resolve|end|stop|close)$/.test(t)?"info":"debug"}(e.category)]<r[this.minLevel])){if(this.queue.push(e),this.queue.length>500){let e=this.queue.length-500;this.droppedByCap+=e,this.queue.splice(0,e)}if(this.queue.length>=100&&!this.inFlight){null!==this.timer&&(clearTimeout(this.timer),this.timer=null),this.flush();return}null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}}async flush(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.inFlight||0===this.queue.length)return;let e=this.queue.slice(0,100);this.inFlight=!0;let t=!1,s=JSON.stringify({records:e});try{var n,r;t=await (n=this.fetchFn(s),r=this.postTimeoutMs,new Promise((e,t)=>{let s=setTimeout(()=>t(Error("debug-forward timeout after ".concat(r,"ms"))),r);n.then(t=>{clearTimeout(s),e(t)},e=>{clearTimeout(s),t(e)})}))}catch(e){t=!1}finally{this.inFlight=!1}if(!t){if(this.consecutiveFailures+=1,this.consecutiveFailures>=2&&a)try{await a(JSON.stringify({records:[...e,this.blockedNotice()]}))&&(this.fallbackBatches+=1)}catch(e){}this.wasFailing=!0,this.scheduleRetry();return}let i=this.lastOkAt;this.lastOkAt=Date.now();let l=this.consecutiveFailures;this.consecutiveFailures=0,this.queue.splice(0,e.length),this.wasFailing&&(this.wasFailing=!1,this.queue.push({ts:new Date().toISOString(),category:"pwa.debug-forwarder.recovered",event:"recovered",data:{consecutiveFailures:l,droppedByCap:this.droppedByCap,fallbackBatches:this.fallbackBatches,pending:this.queue.length,previousOkAt:i},source:{platform:"pwa"}})),this.queue.length>0&&null===this.timer&&(this.timer=setTimeout(()=>{this.flush()},this.flushMs))}scheduleRetry(){if(null!==this.timer||0===this.queue.length)return;let e=Math.min(this.flushMs*2**this.consecutiveFailures,3e4);this.timer=setTimeout(()=>{this.flush()},e)}blockedNotice(){return{ts:new Date().toISOString(),category:"pwa.debug-forwarder.http-blocked",event:"http-blocked",data:{consecutiveFailures:this.consecutiveFailures,pending:this.queue.length,droppedByCap:this.droppedByCap,lastOkAt:this.lastOkAt,via:"acp-fallback"},source:{platform:"pwa"}}}beaconFlush(){if(0!==this.queue.length)try{if("undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon){let e=this.queue.slice(0,100),t=new Blob([JSON.stringify({records:e})],{type:"application/json"});navigator.sendBeacon(i,t)&&this.queue.splice(0,e.length)}}catch(e){}}get pending(){return this.queue.length}constructor(e=c,t="debug",s=1e4,n=100){this.fetchFn=e,this.minLevel=t,this.postTimeoutMs=s,this.flushMs=n,this.queue=[],this.timer=null,this.inFlight=!1,this.consecutiveFailures=0,this.lastOkAt=null,this.droppedByCap=0,this.fallbackBatches=0,this.wasFailing=!1}}async function c(e){return(await fetch(i,{method:"POST",headers:{"content-type":"application/json"},body:e,keepalive:!0,..."undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(1e4)}:{}})).ok}function d(e,t){if("undefined"==typeof console)return;let s=new Date().toISOString();if(void 0!==t){let n="";try{let e=new WeakSet;n=JSON.stringify(t,(t,s)=>{if("bigint"==typeof s)return"".concat(s.toString(),"n");if("function"==typeof s)return"[fn ".concat(s.name||"anon","]");if(s&&"object"==typeof s){if(e.has(s))return"[circular]";e.add(s)}return s})}catch(e){n="[unserializable: ".concat(String(e),"]")}n&&n.length>800&&(n=n.slice(0,797)+"..."),console.debug("[".concat(s,"] ").concat(e," ").concat(n),t),u(s,e,n)}else console.debug("[".concat(s,"] ").concat(e)),u(s,e,void 0)}function u(e,t,s){let r,i=function(){if(void 0!==n)return n;let e=function(){try{let e="off"!==window.localStorage.getItem("elanous.pwa.debug.forward"),t=window.localStorage.getItem("elanous.pwa.debug.forwardLevel");return{forward:e,level:"info"===t||"warn"===t||"error"===t?t:"debug"}}catch(e){return{forward:!0,level:"debug"}}}();if(!e.forward)return n=null,null;let t=new o(c,e.level,1e4,1500);try{window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&t.beaconFlush()})}catch(e){}return n=t,t}();if(!i)return;let a=t.slice(t.lastIndexOf(".")+1)||t;if(void 0!==s&&""!==s)try{r=JSON.parse(s)}catch(e){r=s}i.push({ts:e,category:t,event:a,...void 0!==r?{data:r}:{},source:{platform:"pwa"}})}},74227:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])},81694:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(3704).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},94306:(e,t,s)=>{"use strict";s.d(t,{M1:()=>c,Qj:()=>d,tI:()=>o});var n=s(55539),r=s(46124),i=s(76642),a=s(50363);let l=(0,r.createContext)(null);function o(e){let{client:t,queryClient:s,defaultStaleTimeMs:o,children:c}=e,d=(0,r.useMemo)(()=>null!=s?s:new i.E({defaultOptions:{queries:{staleTime:null!=o?o:2e3,refetchOnWindowFocus:!1}}}),[s,o]);return(0,n.jsx)(l.Provider,{value:t,children:(0,n.jsx)(a.Ht,{client:d,children:c})})}function c(){let e=(0,r.useContext)(l);if(!e)throw Error("useNexusClient must be used within <NexusProvider>");return e}function d(){return(0,r.useContext)(l)}}},e=>{e.O(0,[3324,1844,9247,2463,2196,7358],()=>e(e.s=7006)),_N_E=e.O()}]);
|