ltcai 10.0.0 → 10.2.0
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/README.md +48 -32
- package/docs/CHANGELOG.md +156 -0
- package/docs/COMMUNITY_AND_PLUGINS.md +1 -1
- package/docs/DEVELOPMENT.md +1 -1
- package/docs/HYBRID_CLOUD_KG_STREAMING.md +101 -0
- package/docs/ONBOARDING.md +1 -1
- package/docs/OPERATIONS.md +1 -1
- package/docs/TRUST_MODEL.md +1 -1
- package/docs/WHY_LATTICE.md +1 -1
- package/docs/kg-schema.md +1 -1
- package/lattice_brain/__init__.py +1 -1
- package/lattice_brain/archive.py +5 -4
- package/lattice_brain/conversations.py +14 -3
- package/lattice_brain/embeddings.py +12 -2
- package/lattice_brain/graph/_kg_common.py +5 -5
- package/lattice_brain/graph/_kg_fsutil.py +4 -3
- package/lattice_brain/graph/discovery.py +4 -3
- package/lattice_brain/graph/discovery_index.py +0 -1
- package/lattice_brain/graph/documents.py +3 -2
- package/lattice_brain/graph/fusion.py +4 -0
- package/lattice_brain/graph/ingest.py +12 -2
- package/lattice_brain/graph/projection.py +3 -2
- package/lattice_brain/graph/provenance.py +5 -3
- package/lattice_brain/graph/rerank.py +4 -1
- package/lattice_brain/graph/retrieval.py +0 -1
- package/lattice_brain/graph/retrieval_docgen.py +0 -1
- package/lattice_brain/graph/retrieval_reads.py +0 -1
- package/lattice_brain/graph/retrieval_vector.py +0 -1
- package/lattice_brain/graph/schema.py +4 -3
- package/lattice_brain/graph/store.py +18 -4
- package/lattice_brain/graph/write_master.py +46 -1
- package/lattice_brain/ingestion.py +4 -1
- package/lattice_brain/portability.py +5 -2
- package/lattice_brain/quality.py +12 -5
- package/lattice_brain/quiet.py +43 -0
- package/lattice_brain/runtime/agent_runtime.py +12 -8
- package/lattice_brain/runtime/hooks.py +2 -1
- package/lattice_brain/runtime/multi_agent.py +2 -3
- package/lattice_brain/sensitivity.py +94 -0
- package/lattice_brain/storage/base.py +30 -2
- package/lattice_brain/storage/migration.py +3 -2
- package/lattice_brain/storage/postgres.py +2 -2
- package/lattice_brain/storage/sqlite.py +6 -4
- package/lattice_brain/workflow.py +4 -2
- package/latticeai/__init__.py +1 -1
- package/latticeai/api/admin.py +1 -1
- package/latticeai/api/agents.py +4 -2
- package/latticeai/api/auth.py +5 -1
- package/latticeai/api/automation_intelligence.py +2 -1
- package/latticeai/api/browser.py +3 -2
- package/latticeai/api/chat.py +28 -17
- package/latticeai/api/chat_agent_http.py +22 -8
- package/latticeai/api/chat_contracts.py +4 -0
- package/latticeai/api/chat_documents.py +6 -2
- package/latticeai/api/chat_hybrid.py +82 -0
- package/latticeai/api/computer_use.py +8 -3
- package/latticeai/api/knowledge_graph.py +1 -1
- package/latticeai/api/mcp.py +4 -4
- package/latticeai/api/models.py +5 -2
- package/latticeai/api/network_boundary.py +220 -0
- package/latticeai/api/permissions.py +0 -1
- package/latticeai/api/realtime.py +1 -1
- package/latticeai/api/security_dashboard.py +1 -1
- package/latticeai/api/setup.py +16 -3
- package/latticeai/api/static_routes.py +2 -1
- package/latticeai/api/tools.py +12 -8
- package/latticeai/api/voice_capture.py +3 -1
- package/latticeai/api/workflow_designer.py +1 -1
- package/latticeai/api/workspace.py +1 -2
- package/latticeai/app_factory.py +131 -78
- package/latticeai/cli/entrypoint.py +6 -4
- package/latticeai/core/agent.py +55 -495
- package/latticeai/core/agent_eval.py +2 -2
- package/latticeai/core/agent_helpers.py +493 -0
- package/latticeai/core/agent_prompts.py +0 -1
- package/latticeai/core/agent_registry.py +3 -1
- package/latticeai/core/agent_state.py +41 -0
- package/latticeai/core/audit.py +1 -1
- package/latticeai/core/builtin_hooks.py +2 -1
- package/latticeai/core/config.py +0 -1
- package/latticeai/core/embedding_providers.py +12 -1
- package/latticeai/core/file_generation.py +3 -0
- package/latticeai/core/invitations.py +4 -1
- package/latticeai/core/io_utils.py +3 -1
- package/latticeai/core/legacy_compatibility.py +1 -2
- package/latticeai/core/local_embeddings.py +12 -1
- package/latticeai/core/marketplace.py +1 -2
- package/latticeai/core/mcp_registry.py +0 -1
- package/latticeai/core/model_compat.py +1 -1
- package/latticeai/core/model_resolution.py +1 -1
- package/latticeai/core/network_boundary.py +168 -0
- package/latticeai/core/oidc.py +3 -0
- package/latticeai/core/permission_mode.py +6 -6
- package/latticeai/core/plugins.py +3 -2
- package/latticeai/core/policy.py +0 -1
- package/latticeai/core/quiet.py +84 -0
- package/latticeai/core/realtime.py +3 -2
- package/latticeai/core/run_store.py +4 -2
- package/latticeai/core/security.py +4 -0
- package/latticeai/core/users.py +5 -3
- package/latticeai/core/workspace_graph_trace.py +3 -0
- package/latticeai/core/workspace_os.py +65 -273
- package/latticeai/core/workspace_os_constants.py +126 -0
- package/latticeai/core/workspace_os_state.py +180 -0
- package/latticeai/core/workspace_os_utils.py +3 -1
- package/latticeai/core/workspace_permissions.py +1 -0
- package/latticeai/core/workspace_snapshots.py +3 -1
- package/latticeai/core/workspace_timeline.py +3 -1
- package/latticeai/integrations/telegram_bot.py +25 -16
- package/latticeai/models/router.py +6 -3
- package/latticeai/runtime/access_runtime.py +3 -1
- package/latticeai/runtime/audit_runtime.py +3 -2
- package/latticeai/runtime/chat_wiring.py +4 -1
- package/latticeai/runtime/history_runtime.py +1 -1
- package/latticeai/runtime/lifespan_runtime.py +3 -1
- package/latticeai/runtime/network_boundary_wiring.py +124 -0
- package/latticeai/runtime/persistence_runtime.py +3 -1
- package/latticeai/runtime/router_registration.py +11 -1
- package/latticeai/services/architecture_readiness.py +1 -2
- package/latticeai/services/change_proposals.py +2 -1
- package/latticeai/services/cloud_egress_audit.py +85 -0
- package/latticeai/services/cloud_extraction.py +129 -0
- package/latticeai/services/cloud_streaming.py +266 -0
- package/latticeai/services/cloud_token_guard.py +84 -0
- package/latticeai/services/command_center.py +2 -1
- package/latticeai/services/folder_watch.py +3 -0
- package/latticeai/services/funnel_metrics.py +3 -1
- package/latticeai/services/hybrid_chat.py +265 -0
- package/latticeai/services/hybrid_context.py +228 -0
- package/latticeai/services/hybrid_policy.py +178 -0
- package/latticeai/services/memory_service.py +1 -1
- package/latticeai/services/model_catalog.py +10 -1
- package/latticeai/services/model_engines.py +35 -14
- package/latticeai/services/model_loading.py +3 -2
- package/latticeai/services/model_runtime.py +68 -17
- package/latticeai/services/multimodal_streaming.py +123 -0
- package/latticeai/services/network_boundary_service.py +154 -0
- package/latticeai/services/openai_compatible_adapter.py +100 -0
- package/latticeai/services/p_reinforce.py +4 -0
- package/latticeai/services/platform_runtime.py +9 -4
- package/latticeai/services/process_audit.py +0 -1
- package/latticeai/services/product_readiness.py +1 -1
- package/latticeai/services/run_executor.py +3 -2
- package/latticeai/services/search_service.py +1 -4
- package/latticeai/services/setup_detection.py +2 -1
- package/latticeai/services/tool_dispatch.py +7 -2
- package/latticeai/services/upload_service.py +2 -1
- package/latticeai/setup/auto_setup.py +10 -7
- package/latticeai/setup/wizard.py +15 -11
- package/latticeai/tools/__init__.py +3 -3
- package/latticeai/tools/commands.py +7 -7
- package/latticeai/tools/computer.py +3 -2
- package/latticeai/tools/documents.py +10 -9
- package/latticeai/tools/filesystem.py +7 -4
- package/latticeai/tools/knowledge.py +2 -0
- package/latticeai/tools/local_files.py +1 -1
- package/latticeai/tools/network.py +2 -1
- package/package.json +5 -3
- package/scripts/bench_agent_smoke.py +0 -1
- package/scripts/bench_models.py +0 -1
- package/scripts/brain_quality_eval.py +7 -2
- package/scripts/bump_version.py +2 -1
- package/scripts/check_current_release_docs.mjs +1 -1
- package/scripts/migrate_brain_storage.py +5 -1
- package/scripts/profile_kg.py +2 -7
- package/scripts/verify_hf_model_registry.py +2 -2
- package/src-tauri/Cargo.lock +1 -1
- package/src-tauri/Cargo.toml +1 -1
- package/src-tauri/tauri.conf.json +1 -1
- package/static/app/asset-manifest.json +37 -37
- package/static/app/assets/{Act-BtCREeN1.js → Act-CbdGD-2i.js} +1 -1
- package/static/app/assets/{AdminConsole-TPeeN18T.js → AdminConsole-LgCkXpnf.js} +1 -1
- package/static/app/assets/{Brain-BKs6JAp0.js → Brain-CoPGJI1L.js} +1 -1
- package/static/app/assets/{BrainHome-BPGOvSd6.js → BrainHome-gVnaxSwp.js} +1 -1
- package/static/app/assets/{BrainSignals-CtzQZ15J.js → BrainSignals-ChxAYHtj.js} +1 -1
- package/static/app/assets/{Capture-1_NaHWqB.js → Capture-DBtgkHZg.js} +1 -1
- package/static/app/assets/{CommandPalette-pqvQOXe4.js → CommandPalette-Ovtv5I0Y.js} +1 -1
- package/static/app/assets/{Library-DhvoPvC7.js → Library-CBia2Fvm.js} +1 -1
- package/static/app/assets/{LivingBrain-DlQ20Q75.js → LivingBrain-CNz-6NSd.js} +1 -1
- package/static/app/assets/{ProductFlow-BZvGDRi_.js → ProductFlow-ePX-Y73J.js} +1 -1
- package/static/app/assets/{ReviewCard-BWgI0D2s.js → ReviewCard-C4mpvkwH.js} +1 -1
- package/static/app/assets/System-BvWNK1zc.js +1 -0
- package/static/app/assets/{activity-Dlfk8YC7.js → activity-CiauPV_3.js} +1 -1
- package/static/app/assets/{bot-CDvUB76P.js → bot-Dwct-Q1x.js} +1 -1
- package/static/app/assets/{brain-xczrohrt.js → brain-BKDW1F0T.js} +1 -1
- package/static/app/assets/{button-SOdH3Oyf.js → button-CCB9Kuw7.js} +1 -1
- package/static/app/assets/{circle-pause-CG1ythH4.js → circle-pause-DNa8WHC5.js} +1 -1
- package/static/app/assets/{circle-play-HXwvjS6W.js → circle-play-8jmxn5mf.js} +1 -1
- package/static/app/assets/{cpu-B0d-rGyk.js → cpu-mxvF3V1I.js} +1 -1
- package/static/app/assets/{download-BGIkTQL6.js → download--SmCcx0p.js} +1 -1
- package/static/app/assets/{folder-open-Dst_Z0_K.js → folder-open-D4Wy5roo.js} +1 -1
- package/static/app/assets/{hard-drive-D53MsWkV.js → hard-drive-BwQcSPlS.js} +1 -1
- package/static/app/assets/index-CQWdDU3z.css +2 -0
- package/static/app/assets/{index-C_IrlQMV.js → index-DDV2YZwM.js} +3 -3
- package/static/app/assets/{input-C5m0riF6.js → input-DFhSjmLS.js} +1 -1
- package/static/app/assets/{network-C5a-E5iS.js → network-Bts7VO94.js} +1 -1
- package/static/app/assets/{primitives-vNXYf58F.js → primitives-BuSMEJY8.js} +1 -1
- package/static/app/assets/search-DZzxhWaQ.js +1 -0
- package/static/app/assets/{shield-alert-Cc-WVXqN.js → shield-alert-BfTO6X_G.js} +1 -1
- package/static/app/assets/{textarea-BkZ0EqVO.js → textarea-BjctW1oh.js} +1 -1
- package/static/app/assets/{useFocusTrap-CTtKbAOU.js → useFocusTrap-CE43-LrA.js} +1 -1
- package/static/app/assets/{useQuery-Dx1fi4Wu.js → useQuery-Bv3ejLL5.js} +1 -1
- package/static/app/assets/{users-BFpQXtEF.js → users-CsNqLZAj.js} +1 -1
- package/static/app/assets/{utils-BA_lmW3J.js → utils-KFFdVG_t.js} +2 -2
- package/static/app/assets/workspace-wdCvdyPF.js +1 -0
- package/static/app/index.html +4 -4
- package/static/sw.js +1 -1
- package/static/app/assets/System-CSMdYLMy.js +0 -1
- package/static/app/assets/index-FxDusbr0.css +0 -2
- package/static/app/assets/search-DhbSgW6m.js +0 -1
- package/static/app/assets/workspace-DBPB0jkX.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,_ as t,b as n,d as r,g as i,h as a,m as o,p as s,t as c,y as l}from"./utils-BA_lmW3J.js";import{i as u,r as d,t as f}from"./LivingBrain-DlQ20Q75.js";import{n as p,t as m}from"./input-C5m0riF6.js";import{t as h}from"./cpu-B0d-rGyk.js";import{b as g,c as _}from"./index-C_IrlQMV.js";import"./brain-xczrohrt.js";import{t as v}from"./button-SOdH3Oyf.js";var y=i(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),b=i(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),x=i(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),S=i(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),C=e(n());a({ko:{"flow.analysis.fact.computer":`컴퓨터`,"flow.analysis.fact.memory":`메모리`,"flow.analysis.fact.graphics":`그래픽`,"flow.analysis.fact.support":`로컬 지원`,"flow.analysis.fact.models":`모델`,"flow.analysis.checking":`확인 중`,"flow.analysis.fact.computerDetail":`운영체제와 칩`,"flow.analysis.fact.memoryDetail":`로컬 사고를 위한 여유 공간`,"flow.analysis.fact.graphicsDetail":`로컬 가속 지원`,"flow.analysis.fact.supportDetail":`설치된 모델 도우미`,"flow.analysis.fact.modelsDetail":`설치된 로컬 Brain`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`감지됨`,"flow.analysis.localReady":`로컬 가속 준비됨`,"flow.analysis.standardLocal":`표준 로컬 모드`,"flow.analysis.supportReady":`준비됨`,"flow.analysis.supportInstall":`준비 예정`,"flow.analysis.modelsInstalled":`{count}개 이미 설치됨`,"flow.analysis.noModels":`아직 설치된 모델 없음`,"flow.analysis.readyDetail":`로컬 Digital Brain 사용 준비 완료`,"flow.analysis.memoryReadyDetail":`추천 모델에 충분한 컨텍스트`,"flow.analysis.graphicsReadyDetail":`Lattice가 가장 좋은 경로를 선택합니다.`,"flow.analysis.supportReadyDetail":`설치된 모델 도우미가 감지되었습니다.`,"flow.analysis.supportInstallDetail":`Lattice가 필요한 항목을 추가합니다.`,"flow.analysis.modelsReadyDetail":`즉시 로드할 수 있는 모델이 있습니다.`,"flow.analysis.modelsInstallDetail":`Lattice가 첫 설치를 안내합니다.`,"flow.recommend.reason.best":`최적 경험`,"flow.recommend.reason.faster":`빠른 선택`,"flow.recommend.reason.advanced":`고급 선택`,"flow.recommend.reason.default":`추천`,"flow.recommend.sizeReady":`준비됨`,"flow.recommend.fallbackName":`추천 Brain`,"flow.install.stage.download":`모델 파일을 받는 중입니다.`,"flow.install.stage.validate":`Brain이 응답할 수 있는지 확인 중입니다.`,"flow.install.stage.load":`Brain을 불러오는 중입니다.`,"flow.install.stage.error":`확인이 필요한 일이 있습니다.`,"flow.install.step.install":`준비`,"flow.install.step.download":`다운로드`,"flow.install.step.ready":`로컬 확인`,"flow.install.step.validate":`확인`,"flow.install.step.load":`로드`,"flow.analysis.hardware.icon.chip":`🖥️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚡`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`📦`,"flow.analysis.hardware.label.chip":`컴퓨터 (운영체제와 칩)`,"flow.analysis.hardware.label.ram":`메모리 (생각할 작업 공간, RAM)`,"flow.analysis.hardware.label.gpu":`그래픽 (계산을 도와주는 GPU)`,"flow.analysis.hardware.label.support":`로컬 지원 (모델 실행 도우미)`,"flow.analysis.hardware.label.models":`모델 (설치된 AI Brain)`,"flow.recommend.timeEstimate":`다운로드 약 {download} · 첫 응답 약 {response}초`,"flow.recommend.timeEstimate.ready":`다운로드 불필요 · 첫 응답 약 {response}초`,"flow.recommend.timeEstimate.unknown":`다운로드 시간 미확인 · 첫 응답 약 {response}초`,"flow.recommend.timeNote":`네트워크 속도에 따라 달라질 수 있어요.`,"flow.recommend.minutes":`{count}분`,"flow.recommend.comparison.faster":`(더 빠름)`,"flow.recommend.comparison.advanced":`(더 강력함)`,"flow.recommend.choose":`이 모델 선택`,"flow.recommend.primaryNote":`약 {time} 후 사용 준비 완료`,"flow.recommend.primaryNote.ready":`다운로드 없이 바로 사용 준비 완료`,"flow.recommend.primaryNote.unknown":`다운로드 시간 확인 후 사용 준비`,"flow.recommend.nextHint":`선택하면 다운로드와 준비 화면으로 넘어가고, 끝나면 바로 Brain이 열립니다.`,"flow.recommend.nextHint.ready":`선택하면 준비 확인 화면으로 넘어가고, 끝나면 바로 Brain이 열립니다.`,"flow.install.expectedTitle":`예상 진행`,"flow.install.expected":`약 {download} 다운로드 후 약 {response}초 안에 첫 응답`,"flow.install.expected.ready":`다운로드 없이 약 {response}초 안에 첫 응답`,"flow.install.expected.unknown":`다운로드 후 약 {response}초 안에 첫 응답`,"flow.install.timelineStep.download":`모델 다운로드`,"flow.install.timelineStep.ready":`로컬 모델 확인`,"flow.install.timelineStep.validate":`응답 확인`,"flow.install.timelineStep.load":`Brain에 로드`,"flow.install.timelineApprox":`약 {time}`,"flow.install.timelineQuick":`잠깐`,"flow.install.expectedCompletion":`끝나면 바로 Brain이 열립니다.`,"flow.shell":`내 로컬 AI 브레인 만들기`,"flow.wake.aria":`Brain 깨우기`,"flow.wake.title":`내 지식이 살아나는 Brain을 시작하세요.`,"flow.wake.body":`Lattice AI는 이 컴퓨터 안에서 내 대화, 문서, 결정이 오래 남는 작업 기억이 되게 합니다. 모델은 바꿔도 Brain은 계속 내 것입니다.`,"flow.wake.value.aria":`Brain 시작 가치`,"flow.wake.value.local.k":`완전 로컬`,"flow.wake.value.local.v":`지식과 대화는 이 컴퓨터에서 먼저 정리됩니다.`,"flow.wake.value.instant.k":`바로 이해`,"flow.wake.value.instant.v":`복잡한 설정 대신 3단계로 첫 대화를 엽니다.`,"flow.wake.value.brain.k":`지속되는 Brain`,"flow.wake.value.brain.v":`모델을 바꿔도 내 기억과 그래프는 이어집니다.`,"flow.wake.plan.aria":`Brain 시작 단계`,"flow.wake.step.identity":`주인 확인`,"flow.wake.step.check":`컴퓨터 확인`,"flow.wake.step.voice":`목소리 선택`,"flow.wake.primary":`Brain 지금 깨우기`,"flow.wake.existing":`기존 Brain 열기`,"flow.wake.startNote":`평균 2분 안에 첫 대화 시작 · 로컬 우선 · 사용자가 제어`,"flow.login.title":`이 Brain의 주인을 정합니다.`,"flow.login.body":`프로필은 로컬 Brain의 소유권을 묶는 기준입니다. 기존 Brain이 있으면 새로 만들기 전에 먼저 안전하게 확인합니다.`,"flow.name":`이름`,"flow.name.placeholder":`나`,"flow.email":`이메일`,"flow.email.placeholder":`you@local`,"flow.password":`비밀번호`,"flow.password.placeholder":`로컬 Brain 비밀번호`,"flow.login.busy":`Brain 여는 중...`,"flow.login.submit":`내 Brain 시작하기`,"flow.login.note":`이 프로필은 내 AI 브레인의 주인입니다. 기존 Brain과 다른 이메일이면 새로 만들지 않고 먼저 확인합니다.`,"flow.login.passwordLocal":`이 비밀번호는 이 컴퓨터의 Brain 전용입니다. 클라우드로 전송되지 않습니다.`,"flow.login.missing":`이름과 이메일, 비밀번호를 입력하면 기존 Brain을 안전하게 확인합니다.`,"flow.login.otherEmail":`이 컴퓨터의 기존 Brain과 다른 이메일입니다. 오타인지 확인해 주세요.`,"flow.login.wrongPassword":`기존 Brain 이메일은 맞지만 비밀번호가 다릅니다. 비밀번호를 다시 확인해 주세요.`,"flow.login.unavailable":`로컬 프로필을 열 수 없습니다. 이메일과 비밀번호를 확인해 주세요.`,"flow.promise.memory.k":`오래 남는 지식`,"flow.promise.memory.v":`내 일이 장기 기억이 됩니다.`,"flow.promise.model.k":`교체 가능한 모델`,"flow.promise.model.v":`모델은 목소리이고, 자산은 Brain입니다.`,"flow.promise.ownership.k":`사용자 소유`,"flow.promise.ownership.v":`백업, 복원, 이동을 직접 결정합니다.`,"flow.promise.aria":`Lattice AI 제품 약속`,"flow.analysis.title":`이 컴퓨터에 맞는 Brain 경험을 확인합니다.`,"flow.analysis.body":`스펙 점수가 아니라, 이 Mac에서 어떤 로컬 AI 브레인 경험이 편한지 보여드립니다. 확인은 로컬 상태를 읽는 것이고, 클라우드 모델은 선택 사항입니다.`,"flow.analysis.finding":`가장 편한 설정을 찾는 중...`,"flow.analysis.ready":`추천 모델을 바로 시작할 수 있게 준비했습니다.`,"flow.analysis.wait":`잠시만 기다리면 자동으로 정리됩니다.`,"flow.analysis.error":`Lattice가 이 컴퓨터를 끝까지 확인하지 못했습니다. 그래도 안전한 기본값으로 계속할 수 있습니다.`,"flow.analysis.continue":`추천 모델 보기`,"flow.analysis.bestFit":`{model}이 이 컴퓨터에 가장 잘 맞습니다.`,"flow.analysis.privateRecommended":`이 컴퓨터에는 개인 로컬 Brain을 추천합니다.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux 컴퓨터`,"flow.recommend.title":`추천대로 시작하세요.`,"flow.recommend.environment.apple":`컴퓨터 준비 완료: 로컬 MLX 지원(Apple Silicon, {ram}GB RAM 감지)`,"flow.recommend.environment.standard":`권장: 가벼운 로컬 모델로 시작하세요({ram}GB RAM 감지)`,"flow.recommend.body":`모델은 Brain의 현재 목소리입니다. 추천, 빠른 선택, 강한 선택만 먼저 보여드려 바로 결정할 수 있게 합니다.`,"flow.recommend.primary":`추천으로 바로 시작`,"flow.recommend.unsupported":`이 컴퓨터에서 추가 확인이 필요합니다`,"flow.recommend.back":`뒤로`,"flow.recommend.skip":`모델 없이 Brain 열기`,"flow.recommend.hint":`잘 모르겠다면 추천대로 시작하면 됩니다.`,"flow.recommend.loading":`이 컴퓨터에 맞는 모델을 확인하는 중...`,"flow.recommend.unavailable.aria":`로컬 모델 준비 상태`,"flow.recommend.unavailable.title":`지금은 이 컴퓨터에서 바로 쓸 로컬 모델을 준비하지 못했습니다.`,"flow.recommend.unavailable.probe":`Lattice가 이 컴퓨터의 로컬 환경을 확인하지 못했습니다. 네트워크와 로컬 서비스 상태를 확인한 뒤 다시 시도해 주세요.`,"flow.recommend.unavailable.empty":`이 컴퓨터에서 바로 실행할 수 있는 추천 모델을 찾지 못했습니다. 다시 확인하거나, 모델 없이 Brain을 먼저 열 수 있습니다.`,"flow.recommend.unavailable.retry":`다시 확인`,"flow.recommend.unavailable.hint":`모델은 나중에 라이브러리에서 언제든 추가할 수 있습니다.`,"flow.recommend.rank.best":`추천`,"flow.recommend.rank.faster":`빠른 선택`,"flow.recommend.rank.advanced":`고급 선택`,"flow.recommend.rank.choice":`선택 {index}`,"flow.install.title":`모델을 설치하고 시작합니다.`,"flow.install.title.ready":`모델을 준비하고 시작합니다.`,"flow.install.body":`이 모델이 Brain의 로컬 목소리가 됩니다. 다운로드는 사용자가 시작할 때만 진행되고, 실행과 기억은 이 컴퓨터에서 유지됩니다.`,"flow.install.body.ready":`이 모델이 Brain의 로컬 목소리가 됩니다. 이미 준비된 모델은 외부 다운로드 없이 응답 확인과 로드만 진행합니다.`,"flow.install.wait":`Brain이 사용할 모델을 기다리고 있습니다.`,"flow.install.prepare":`Brain 준비 중입니다.`,"flow.install.done":`Brain이 준비되었습니다.`,"flow.install.note":`큰 모델은 다운로드에 몇 분 이상 걸릴 수 있습니다. 진행률은 모델 런타임이 알려주는 만큼 표시하고, 멈춘 것처럼 보여도 현재 단계가 유지됩니다.`,"flow.install.note.ready":`로컬 응답 확인은 보통 잠깐이면 끝납니다. 실패하면 다른 모델을 고르거나 나중에 다시 시도할 수 있습니다.`,"flow.install.retry":`다른 모델을 고르거나 다시 시도할 수 있습니다.`,"flow.install.back":`다른 모델 고르기`,"flow.install.start":`다운로드하고 시작하기`,"flow.install.startReady":`준비하고 시작하기`,"flow.install.busy":`모델 준비 중...`,"flow.install.enter":`Brain으로 들어가기`,"flow.install.later":`나중에 하기`,"flow.install.local":`모델 다운로드와 외부 통신은 사용자가 시작할 때만 진행됩니다.`,"flow.install.local.ready":`이 선택은 외부 다운로드 없이 로컬 준비 상태만 확인합니다.`,"flow.consent.title":`다운로드 전 확인`,"flow.consent.readyTitle":`로컬 준비 상태`,"flow.consent.body":`시작하면 아래 모델 파일을 외부 저장소에서 받아 이 컴퓨터에 저장합니다.`,"flow.consent.ready":`이미 준비된 모델입니다. 시작해도 외부 다운로드를 요청하지 않고 로컬에서 응답 가능 여부만 확인합니다.`,"flow.consent.state":`다운로드 필요`,"flow.consent.stateReady":`없음`,"flow.consent.size":`다운로드 크기`,"flow.consent.sizeUnknown":`런타임 확인 후 표시`,"flow.consent.location":`저장 위치`,"flow.consent.external":`외부 접속 대상`,"flow.consent.externalUnknown":`런타임 확인 후 표시`,"flow.consent.externalNone":`선택 전 외부 접속 없음`},en:{"flow.analysis.fact.computer":`Computer`,"flow.analysis.fact.memory":`Memory`,"flow.analysis.fact.graphics":`Graphics`,"flow.analysis.fact.support":`Local Support`,"flow.analysis.fact.models":`Models`,"flow.analysis.checking":`Checking`,"flow.analysis.fact.computerDetail":`Operating system and chip`,"flow.analysis.fact.memoryDetail":`Available room for local thinking`,"flow.analysis.fact.graphicsDetail":`Local acceleration support`,"flow.analysis.fact.supportDetail":`Installed model helpers`,"flow.analysis.fact.modelsDetail":`Installed local Brains`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`Detected`,"flow.analysis.localReady":`Local acceleration ready`,"flow.analysis.standardLocal":`Standard local mode`,"flow.analysis.supportReady":`Ready`,"flow.analysis.supportInstall":`Will be prepared`,"flow.analysis.modelsInstalled":`{count} already installed`,"flow.analysis.noModels":`None installed yet`,"flow.analysis.readyDetail":`Ready for local Digital Brain use`,"flow.analysis.memoryReadyDetail":`Enough context for the recommended model`,"flow.analysis.graphicsReadyDetail":`Lattice will choose the best available path`,"flow.analysis.supportReadyDetail":`Installed model helpers detected`,"flow.analysis.supportInstallDetail":`Lattice will add what is needed`,"flow.analysis.modelsReadyDetail":`One can be loaded immediately`,"flow.analysis.modelsInstallDetail":`Lattice will guide the first install`,"flow.recommend.reason.best":`Best Experience`,"flow.recommend.reason.faster":`Faster`,"flow.recommend.reason.advanced":`Advanced`,"flow.recommend.reason.default":`Recommended`,"flow.recommend.sizeReady":`ready`,"flow.recommend.fallbackName":`Recommended Brain`,"flow.install.stage.download":`Getting the model files.`,"flow.install.stage.validate":`Checking that the Brain can answer.`,"flow.install.stage.load":`Loading the Brain.`,"flow.install.stage.error":`Something needs attention.`,"flow.install.step.install":`Install`,"flow.install.step.download":`Download`,"flow.install.step.ready":`Local check`,"flow.install.step.validate":`Validate`,"flow.install.step.load":`Load`,"flow.analysis.hardware.icon.chip":`🖥️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚡`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`📦`,"flow.analysis.hardware.label.chip":`Computer (operating system and chip)`,"flow.analysis.hardware.label.ram":`Memory (working space to think, RAM)`,"flow.analysis.hardware.label.gpu":`Graphics (the GPU that speeds up math)`,"flow.analysis.hardware.label.support":`Local support (helpers that run models)`,"flow.analysis.hardware.label.models":`Models (AI Brains already installed)`,"flow.recommend.timeEstimate":`Download about {download} · first reply about {response}s`,"flow.recommend.timeEstimate.ready":`No download needed · first reply about {response}s`,"flow.recommend.timeEstimate.unknown":`Download time unknown · first reply about {response}s`,"flow.recommend.timeNote":`Actual time depends on your network speed.`,"flow.recommend.minutes":`{count} min`,"flow.recommend.comparison.faster":`(faster)`,"flow.recommend.comparison.advanced":`(more capable)`,"flow.recommend.choose":`Choose this model`,"flow.recommend.primaryNote":`Ready to use in about {time}`,"flow.recommend.primaryNote.ready":`Ready with no download`,"flow.recommend.primaryNote.unknown":`Ready after download time is confirmed`,"flow.recommend.nextHint":`Choosing takes you to download and setup, then your Brain opens automatically.`,"flow.recommend.nextHint.ready":`Choosing takes you to a readiness check, then your Brain opens automatically.`,"flow.install.expectedTitle":`What to expect`,"flow.install.expected":`About {download} to download, then a first reply within about {response}s`,"flow.install.expected.ready":`No download — first reply within about {response}s`,"flow.install.expected.unknown":`After download, a first reply within about {response}s`,"flow.install.timelineStep.download":`Download model`,"flow.install.timelineStep.ready":`Check local model`,"flow.install.timelineStep.validate":`Check the reply`,"flow.install.timelineStep.load":`Load into Brain`,"flow.install.timelineApprox":`about {time}`,"flow.install.timelineQuick":`moment`,"flow.install.expectedCompletion":`When it finishes, your Brain opens right away.`,"flow.shell":`Create your local AI Brain`,"flow.wake.aria":`Wake your Brain`,"flow.wake.title":`Start the Brain where your knowledge comes alive.`,"flow.wake.body":`Lattice AI turns your conversations, documents, and decisions into durable working memory on this computer. Models can change while your Brain remains yours.`,"flow.wake.value.aria":`Brain startup value`,"flow.wake.value.local.k":`Fully local`,"flow.wake.value.local.v":`Knowledge and conversations are organized on this computer first.`,"flow.wake.value.instant.k":`Clear start`,"flow.wake.value.instant.v":`Open the first conversation in three guided steps.`,"flow.wake.value.brain.k":`Durable Brain`,"flow.wake.value.brain.v":`Your memories and graph continue even when models change.`,"flow.wake.plan.aria":`Brain start steps`,"flow.wake.step.identity":`Confirm owner`,"flow.wake.step.check":`Check computer`,"flow.wake.step.voice":`Choose voice`,"flow.wake.primary":`Wake Brain`,"flow.wake.existing":`Open existing Brain`,"flow.wake.startNote":`First conversation in about 2 minutes · local-first · user controlled`,"flow.login.title":`Choose the owner of this Brain.`,"flow.login.body":`Your profile anchors ownership of the local Brain. If a Brain already exists here, Lattice checks safely before creating anything new.`,"flow.name":`Name`,"flow.name.placeholder":`You`,"flow.email":`Email`,"flow.email.placeholder":`you@local`,"flow.password":`Password`,"flow.password.placeholder":`Local Brain password`,"flow.login.busy":`Opening Brain...`,"flow.login.submit":`Start my Brain`,"flow.login.note":`This profile owns your AI Brain. If the email differs from this computer's Brain, Lattice checks before creating anything new.`,"flow.login.passwordLocal":`This password is only for the Brain on this computer. It is not sent to the cloud.`,"flow.login.missing":`Enter your name, email, and password so Lattice can safely check your Brain.`,"flow.login.otherEmail":`This email differs from the Brain on this computer. Please check for a typo.`,"flow.login.wrongPassword":`The email matches this Brain, but the password is different. Please check it again.`,"flow.login.unavailable":`Could not open the local profile. Check your email and password.`,"flow.promise.memory.k":`Durable knowledge`,"flow.promise.memory.v":`Your work becomes long-term memory.`,"flow.promise.model.k":`Replaceable models`,"flow.promise.model.v":`The model is the voice; the Brain is the asset.`,"flow.promise.ownership.k":`User owned`,"flow.promise.ownership.v":`You decide when to back up, restore, or move it.`,"flow.promise.aria":`Lattice AI product promise`,"flow.analysis.title":`Checking the Brain experience for this computer.`,"flow.analysis.body":`This is not a spec score. Lattice reads local capability and explains which local AI Brain experience will feel comfortable on this Mac. Cloud models remain optional.`,"flow.analysis.finding":`Finding the easiest setup...`,"flow.analysis.ready":`Your recommended model is ready to start.`,"flow.analysis.wait":`This will be summarized automatically in a moment.`,"flow.analysis.error":`Lattice could not finish checking this computer. You can still continue with a safe default.`,"flow.analysis.continue":`View recommended models`,"flow.analysis.bestFit":`{model} looks like the best fit.`,"flow.analysis.privateRecommended":`A private local Brain is recommended for this computer.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux computer`,"flow.recommend.title":`Start with the recommendation.`,"flow.recommend.environment.apple":`Computer ready: local MLX supported (Apple Silicon, {ram}GB RAM detected)`,"flow.recommend.environment.standard":`Recommended: start with a lighter local model ({ram}GB RAM detected)`,"flow.recommend.body":`The model is your Brain's current voice. Lattice shows the recommendation, a faster choice, and a stronger choice first so you can decide quickly.`,"flow.recommend.primary":`Start with recommendation`,"flow.recommend.unsupported":`This computer needs one more check`,"flow.recommend.back":`Back`,"flow.recommend.skip":`Open Brain without a model`,"flow.recommend.hint":`If unsure, start with the recommendation.`,"flow.recommend.loading":`Checking which model fits this computer...`,"flow.recommend.unavailable.aria":`Local model readiness`,"flow.recommend.unavailable.title":`A local model isn't ready to run on this computer yet.`,"flow.recommend.unavailable.probe":`Lattice couldn't check this computer's local environment. Check your network and local services, then try again.`,"flow.recommend.unavailable.empty":`No recommended model can run on this computer right now. Try checking again, or open your Brain without a model first.`,"flow.recommend.unavailable.retry":`Check again`,"flow.recommend.unavailable.hint":`You can add a model anytime later from the library.`,"flow.recommend.rank.best":`Best Experience`,"flow.recommend.rank.faster":`Faster`,"flow.recommend.rank.advanced":`Advanced`,"flow.recommend.rank.choice":`Choice {index}`,"flow.install.title":`Install the model and start.`,"flow.install.title.ready":`Prepare the model and start.`,"flow.install.body":`This model becomes your Brain's local voice. Download starts only when you choose it; execution and memory stay on this computer.`,"flow.install.body.ready":`This model becomes your Brain's local voice. Because it is already ready, Lattice only checks the reply path and loads it locally.`,"flow.install.wait":`Waiting for the model your Brain will use.`,"flow.install.prepare":`Preparing your Brain.`,"flow.install.done":`Your Brain is ready.`,"flow.install.note":`Large models can take several minutes to download. Progress is shown when the model runtime reports it; a steady stage still means work is continuing.`,"flow.install.note.ready":`The local reply check usually takes a moment. If it fails, choose another model or try again later.`,"flow.install.retry":`Choose another model or try again.`,"flow.install.back":`Choose another model`,"flow.install.start":`Download and start`,"flow.install.startReady":`Check and start`,"flow.install.busy":`Preparing model...`,"flow.install.enter":`Enter Brain`,"flow.install.later":`Do later`,"flow.install.local":`Downloads and external communication start only when you choose them.`,"flow.install.local.ready":`This choice checks local readiness without starting an external download.`,"flow.consent.title":`Before downloading`,"flow.consent.readyTitle":`Local readiness`,"flow.consent.body":`Starting will fetch these model files from an external repository and store them on this computer.`,"flow.consent.ready":`This model is already ready. Starting checks whether it can answer locally without requesting an external download.`,"flow.consent.state":`Download needed`,"flow.consent.stateReady":`No`,"flow.consent.size":`Download size`,"flow.consent.sizeUnknown":`Reported by runtime`,"flow.consent.location":`Storage location`,"flow.consent.external":`External target`,"flow.consent.externalUnknown":`Reported by runtime`,"flow.consent.externalNone":`No external connection before selection`}});function ee(e){let t=j(e?.models),n=[...c(t.recommended),...c(t.catalog)],r=j(e?.recommendations?.recommendations),i=c(r.models),a=j(r.top_pick),o=new Map;for(let e of[...i,...n]){let t=String(e.id||e.model_id||e.recommended_load_id||``);t&&o.set(t,{...o.get(t)||{},...e})}a.id&&!o.has(String(a.id))&&o.set(String(a.id),a);let s=Array.from(o.values()).map(E).filter(e=>e.id),l=s.filter(e=>e.supported),u=l.length?l:s,d=(e=>u.find(t=>t.id===String(e)))(a.id)||(e=>u.find(t=>e.test(`${t.name} ${t.id}`)))(/gemma.*12|12b/i)||u[0],f=u.find(e=>e.id!==d?.id&&/qwen|8b|7b/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id),p=u.find(e=>e.id!==d?.id&&e.id!==f?.id&&/26b|32b|70b|advanced/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id&&e.id!==f?.id);return[d?{...d,role:`best`,reason:d.reason||`best`}:null,f?{...f,role:`faster`,reason:f.reason||`faster`}:null,p?{...p,role:`advanced`,reason:p.reason||`advanced`}:null].filter(Boolean)}function w(e){let{analysis:t,endpoints:n}=e;if(!n)return{status:`loading`,recommendations:[],reason:null,failedEndpoints:[]};let r=Object.keys(n).filter(e=>!n[e]);if(!(n.recommendations||n.models))return{status:`unavailable`,recommendations:[],reason:`probe_failed`,failedEndpoints:r};let i=ee(t).filter(e=>e.supported);return i.length?{status:`ready`,recommendations:i,reason:null,failedEndpoints:r}:{status:`unavailable`,recommendations:[],reason:`no_supported_model`,failedEndpoints:r}}function T(){return{id:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,loadId:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,engine:`local_mlx`,name:`Qwen3-VL 8B`,shortName:`Qwen 3`,family:`Qwen 3`,size:``,role:`best`,reason:`best`,supported:!0,downloadRequired:!1,downloadSize:``,storageLocation:`~/.latticeai/models`,externalHost:``,estimatedDownloadMinutes:0,estimatedFirstResponseSeconds:5,parameterBillions:8}}function E(e){let t=j(e.runtime_compatibility),n=String(e.id||e.model_id||e.recommended_load_id||``),r=String(e.recommended_load_id||e.load_id||n),i=String(e.display_name||e.name||n||`recommended_brain`),a=e.load_status!==`unsupported`&&e.load_status!==`runtime_update_needed`&&e.status!==`not_recommended`&&t.supported!==!1,o=!!e.download_required,s=o?String(e.download_size||e.size||``):``,c=D(`${i} ${n}`);return{id:n,loadId:r,engine:String(e.recommended_engine||e.engine||`local_mlx`),name:i,shortName:A(i||n),family:A(String(e.family||i||`local_brain`)),size:String(e.size||``),role:`best`,reason:String(e.reason||``),supported:a,downloadRequired:o,downloadSize:s,storageLocation:String(e.storage_location||e.local_path||`~/.latticeai/models`),externalHost:o?k(e):``,estimatedDownloadMinutes:o?ne(s):0,estimatedFirstResponseSeconds:O(c),parameterBillions:c}}function te(e){let t=String(e||``).match(/([\d.]+)\s*(t|g|m)?b?/i);if(!t)return null;let n=Number(t[1]);if(!Number.isFinite(n)||n<=0)return null;let r=(t[2]||`g`).toLowerCase();return r===`t`?n*1024*1024:r===`m`?n:n*1024}function ne(e){let t=te(e);if(t===null)return null;let n=t/(15/8)/60;return Math.max(1,Math.round(n))}function D(e){let t=String(e||``).match(/(\d{1,3}(?:\.\d)?)\s*b\b/i);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function O(e){return e===null?8:e<=9?5:e<=16?10:e<=40?18:30}function k(e){let t=String(e.source_url||e.download_url||e.repository||e.provider||e.id||``);return t?/huggingface|hf\\.co|mlx-community/i.test(t)?`huggingface`:/ollama/i.test(t)?`ollama`:t.replace(/^https?:\/\//,``).split(`/`)[0]||t:``}function A(e){return String(e||`recommended_brain`).replace(/^mlx-community\//i,``).replace(/[-_]?Instruct/gi,``).replace(/[-_]?4bit/gi,``).replace(/Qwen3[-_ ]?VL/gi,`Qwen 3`).replace(/Qwen3/gi,`Qwen 3`).replace(/Gemma[-_ ]?4/gi,`Gemma 4`).replace(/A4B/gi,``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim()}function j(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var M=l();function N({model:e}){let n=t(e=>e.language),r=e.downloadRequired?[{label:o(n,`flow.consent.size`),value:e.downloadSize||o(n,`flow.consent.sizeUnknown`)},{label:o(n,`flow.consent.location`),value:e.storageLocation},{label:o(n,`flow.consent.external`),value:e.externalHost||o(n,`flow.consent.externalUnknown`)}]:[{label:o(n,`flow.consent.state`),value:o(n,`flow.consent.stateReady`)},{label:o(n,`flow.consent.location`),value:e.storageLocation},{label:o(n,`flow.consent.external`),value:o(n,`flow.consent.externalNone`)}],i=e.downloadRequired?`flow.consent.title`:`flow.consent.readyTitle`;return(0,M.jsxs)(`section`,{className:`ritual-consent-panel`,"aria-label":o(n,i),children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`strong`,{children:o(n,i)}),(0,M.jsx)(`p`,{children:e.downloadRequired?o(n,`flow.consent.body`):o(n,`flow.consent.ready`)})]}),(0,M.jsx)(`dl`,{children:r.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:e.value})]},e.label))})]})}function P({model:e,onBack:n,onComplete:i,onLater:a}){let s=t(e=>e.language),[c,l]=C.useState(!1),[u,d]=C.useState(`idle`),[m,h]=C.useState(0),[g,_]=C.useState(o(s,`flow.install.wait`)),[y,b]=C.useState(null);async function x(){l(!0),b(null),d(`install`),h(8),_(o(s,`flow.install.prepare`));let t=await r.streamModelPrepare({model:e.loadId,engine:e.engine||`local_mlx`,allow_download:e.downloadRequired},{onProgress:e=>{let t=L(String(e.stage||``));d(t),h(Number(e.percent||R(t))),_(z(e,t,s))},onDone:()=>{d(`done`),h(100),_(o(s,`flow.install.done`))},onError:e=>{d(`error`),b(U(e))}});l(!1),t.ok?(d(`done`),h(100),_(o(s,`flow.install.done`)),window.setTimeout(i,700)):(d(`error`),b(U(t.data)))}let S=u===`download`?`thinking`:u===`validate`?`recalling`:u===`load`?`synthesizing`:u===`done`?`idle`:`listening`;return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(s,e.downloadRequired?`flow.install.title`:`flow.install.title.ready`)}),(0,M.jsxs)(`div`,{className:`ritual-subtitle`,children:[(0,M.jsx)(`strong`,{children:e.shortName}),` — `,e.reason,`.`,(0,M.jsx)(`br`,{}),o(s,e.downloadRequired?`flow.install.body`:`flow.install.body.ready`)]}),(0,M.jsxs)(`section`,{className:`ritual-card ritual-expected-card`,"aria-label":o(s,`flow.install.expectedTitle`),children:[(0,M.jsx)(`div`,{className:`ritual-fact-label`,children:o(s,`flow.install.expectedTitle`)}),(0,M.jsx)(`div`,{className:`ritual-time-estimate ritual-expected-line`,children:F(e,s)}),(0,M.jsx)(`ol`,{className:`ritual-timeline`,children:I(e,s).map(e=>(0,M.jsxs)(`li`,{className:`ritual-timeline-step`,children:[(0,M.jsx)(`span`,{className:`ritual-timeline-name`,children:e.name}),(0,M.jsx)(`span`,{className:`ritual-timeline-time`,children:e.time})]},e.key))}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(s,`flow.install.expectedCompletion`)})]}),(0,M.jsx)(`div`,{className:`ritual-install-brain`,children:(0,M.jsx)(f,{state:S,intensity:u===`download`||u===`load`?.96:.82,size:`normal`})}),(0,M.jsx)(N,{model:e}),(0,M.jsxs)(`div`,{className:`ritual-progress`,children:[(0,M.jsx)(`div`,{className:`ritual-stage-list`,children:[`install`,`download`,`validate`,`load`].map(t=>(0,M.jsxs)(`div`,{className:`ritual-stage ${H(u,t)}`,children:[(0,M.jsx)(p,{className:`ritual-stage-icon`}),(0,M.jsx)(`span`,{children:B(t,s,e)})]},t))}),(0,M.jsx)(`div`,{className:`ritual-bar`,children:(0,M.jsx)(`span`,{className:`ritual-bar-fill ${V(m)}`})})]}),(0,M.jsx)(`div`,{className:`ritual-status`,children:g}),(0,M.jsx)(`div`,{className:`ritual-card ritual-status-card`,children:o(s,e.downloadRequired?`flow.install.note`:`flow.install.note.ready`)}),y&&(0,M.jsxs)(`div`,{className:`ritual-card ritual-error-card ritual-install-error`,role:`alert`,children:[y,(0,M.jsx)(`div`,{className:`ritual-error-detail`,children:o(s,`flow.install.retry`)})]}),(0,M.jsxs)(`div`,{className:`ritual-button-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:n,disabled:c,children:o(s,`flow.install.back`)}),(0,M.jsx)(v,{variant:`outline`,onClick:a,disabled:c,children:o(s,`flow.install.later`)}),u===`done`?(0,M.jsx)(v,{onClick:i,children:o(s,`flow.install.enter`)}):(0,M.jsx)(v,{onClick:x,disabled:c||!e.supported,children:c?o(s,`flow.install.busy`):o(s,e.downloadRequired?`flow.install.start`:`flow.install.startReady`)})]}),(0,M.jsx)(`div`,{className:`ritual-local-note`,children:o(s,e.downloadRequired?`flow.install.local`:`flow.install.local.ready`)})]})}function F(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?o(t,`flow.install.expected.ready`,{response:n}):e.estimatedDownloadMinutes===null?o(t,`flow.install.expected.unknown`,{response:n}):o(t,`flow.install.expected`,{download:o(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes}),response:n})}function I(e,t){let n=e.downloadRequired&&e.estimatedDownloadMinutes?o(t,`flow.install.timelineApprox`,{time:o(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes})}):o(t,`flow.install.timelineQuick`);return[{key:`download`,name:o(t,e.downloadRequired?`flow.install.timelineStep.download`:`flow.install.timelineStep.ready`),time:n},{key:`validate`,name:o(t,`flow.install.timelineStep.validate`),time:o(t,`flow.install.timelineQuick`)},{key:`load`,name:o(t,`flow.install.timelineStep.load`),time:o(t,`flow.install.timelineApprox`,{time:`${e.estimatedFirstResponseSeconds}s`})}]}function L(e){return/download|pull|weights/i.test(e)?`download`:/smoke|validate|verify|test/i.test(e)?`validate`:/load|ready/i.test(e)?`load`:/done|complete/i.test(e)?`done`:`install`}function R(e){return e===`install`?20:e===`download`?55:e===`validate`?82:e===`load`?94:e===`done`?100:8}function z(e,t,n){let r={install:o(n,`flow.install.prepare`),download:o(n,`flow.install.stage.download`),validate:o(n,`flow.install.stage.validate`),load:o(n,`flow.install.stage.load`),done:o(n,`flow.install.done`),idle:o(n,`flow.install.wait`),error:o(n,`flow.install.stage.error`)}[t];return W(String(e.user_message||e.message||r))}function B(e,t,n){return e===`download`&&!n.downloadRequired?o(t,`flow.install.step.ready`):o(t,`flow.install.step.${e}`)}function V(e){return`progress-${Math.max(0,Math.min(100,Math.round(e/10)*10))}`}function H(e,t){let n=[`idle`,`install`,`download`,`validate`,`load`,`done`],r=n.indexOf(e),i=n.indexOf(t);return e===`error`?`is-error`:e===`done`||r>i?`is-done`:e===t?`is-active`:``}function U(e){let t=j(e),n=c(t.recovery_guidance).map(W).filter(Boolean);return[W(String(t.user_message||t.reason||t.error||`The selected model could not be loaded.`)),...n.slice(0,2)].join(` `)}function W(e){return String(e||``).replace(/gemma4_unified/gi,`this model format`).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|huggingface|hugging face/gi,`local model support`).replace(/runtime/gi,`model support`).replace(/No module named ['\"][^'\"]+['\"]/gi,`A local support component is missing`).replace(/\s+/g,` `).trim()}function G(){let e=t(e=>e.language),n=t(e=>e.setLanguage);return(0,M.jsx)(`div`,{className:`language-switcher ritual-language`,"aria-label":o(e,`language.label`),children:[`ko`,`en`].map(t=>(0,M.jsx)(`button`,{type:`button`,className:e===t?`is-active`:``,onClick:()=>n(t),"aria-pressed":e===t,children:s[t]},t))})}var K=`lattice.productFlow.user`;function q(){try{let e=localStorage.getItem(K);return e?JSON.parse(e):null}catch{}return null}function J({onSuccess:e}){let n=t(e=>e.language),[i,a]=C.useState(()=>q()?.email||`you@local`),[s,c]=C.useState(``),[l,u]=C.useState(()=>q()?.name||`You`),[d,f]=C.useState(!1),[p,h]=C.useState(null);async function g(t){t.preventDefault();let a=i.trim(),c=s.trim(),u=l.trim()||a.split(`@`)[0]||`You`;if(!a||!c){h(o(n,`flow.login.missing`));return}f(!0),h(null);let d=q(),p=await r.login(a,c);if(!p.ok){if((await r.profile()).ok&&(!d?.email||d.email===a)){try{localStorage.setItem(K,JSON.stringify({email:a,name:u}))}catch{}f(!1),e();return}if(d?.email&&d.email!==a){f(!1),h(o(n,`flow.login.otherEmail`));return}if(d?.email===a){f(!1),h(o(n,`flow.login.wrongPassword`));return}(await r.register({email:a,password:c,name:u,nickname:u})).ok&&(p=await r.login(a,c))}if(!p.ok){f(!1),h(o(n,`flow.login.unavailable`));return}try{localStorage.setItem(K,JSON.stringify({email:a,name:u}))}catch{}f(!1),e()}return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(n,`flow.login.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(n,`flow.login.body`)}),(0,M.jsx)(Y,{}),(0,M.jsxs)(`form`,{onSubmit:g,className:`ritual-card ritual-form`,children:[(0,M.jsxs)(`div`,{className:`ritual-field-stack`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-field-label`,children:o(n,`flow.name`)}),(0,M.jsx)(m,{value:l,onChange:e=>u(e.target.value),placeholder:o(n,`flow.name.placeholder`),autoComplete:`name`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-field-label`,children:o(n,`flow.email`)}),(0,M.jsx)(m,{value:i,onChange:e=>a(e.target.value),type:`email`,placeholder:o(n,`flow.email.placeholder`),autoComplete:`email`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-field-label`,children:o(n,`flow.password`)}),(0,M.jsx)(m,{value:s,onChange:e=>c(e.target.value),type:`password`,placeholder:o(n,`flow.password.placeholder`),autoComplete:`current-password`})]})]}),p&&(0,M.jsx)(`div`,{className:`ritual-error`,role:`alert`,children:p}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(n,`flow.login.passwordLocal`)}),(0,M.jsx)(v,{type:`submit`,disabled:d||!i.trim()||!s.trim(),className:`ritual-full-button`,children:d?o(n,`flow.login.busy`):o(n,`flow.login.submit`)}),(0,M.jsx)(`div`,{className:`ritual-note`,children:o(n,`flow.login.note`)})]})]})}function Y(){let e=t(e=>e.language);return(0,M.jsxs)(`div`,{className:`ritual-promise`,"aria-label":o(e,`flow.promise.aria`),children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:o(e,`flow.promise.memory.k`)}),(0,M.jsx)(`strong`,{children:o(e,`flow.promise.memory.v`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:o(e,`flow.promise.model.k`)}),(0,M.jsx)(`strong`,{children:o(e,`flow.promise.model.v`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:o(e,`flow.promise.ownership.k`)}),(0,M.jsx)(`strong`,{children:o(e,`flow.promise.ownership.v`)})]})]})}function X({status:e,reason:n,recommendations:r,analysis:i,onBack:a,onRetry:s,onSkipModel:c,onSelect:l}){let f=t(e=>e.language);if(e===`loading`)return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(f,`flow.recommend.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(f,`flow.recommend.body`)}),(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,role:`status`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,M.jsx)(`span`,{children:o(f,`flow.recommend.loading`)})]}),(0,M.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:a,children:o(f,`flow.recommend.back`)}),(0,M.jsx)(v,{variant:`outline`,onClick:c,children:o(f,`flow.recommend.skip`)})]})]});if(e===`unavailable`){let e=n===`no_supported_model`?`flow.recommend.unavailable.empty`:`flow.recommend.unavailable.probe`;return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(f,`flow.recommend.title`)}),(0,M.jsx)(`section`,{className:`ritual-card ritual-error-card ritual-unavailable-card`,role:`alert`,"aria-label":o(f,`flow.recommend.unavailable.aria`),children:(0,M.jsxs)(`div`,{className:`ritual-inline-row`,children:[(0,M.jsx)(_,{className:`ritual-core-icon`,"aria-hidden":`true`}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-strong-text`,children:o(f,`flow.recommend.unavailable.title`)}),(0,M.jsx)(`div`,{className:`ritual-muted-text`,children:o(f,e)})]})]})}),(0,M.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:s,children:[(0,M.jsx)(d,{size:16}),` `,o(f,`flow.recommend.unavailable.retry`)]}),(0,M.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:c,children:o(f,`flow.recommend.skip`)})]}),(0,M.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:a,children:o(f,`flow.recommend.back`)}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(f,`flow.recommend.unavailable.hint`)})]})]})}let p=r;function m(e,t){if(!e)return(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,M.jsx)(`span`,{children:o(t,`flow.analysis.checking`)})]});let n=j(e.recommendations?.recommendations),r=j(e.setup?.environment),i=j(e.recommendations?.profile),a={...r,...i},s=Number(n.ram_gb||Number(a.ram_mb||0)/1024||0);return n.apple_silicon||String(a.arch||``).includes(`arm`)?(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-success`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot is-success`}),(0,M.jsx)(`span`,{children:o(t,`flow.recommend.environment.apple`,{ram:Math.round(s)})})]}):(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-warning`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot is-warning`}),(0,M.jsx)(`span`,{children:o(t,`flow.recommend.environment.standard`,{ram:Math.round(s)})})]})}return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(f,`flow.recommend.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(f,`flow.recommend.body`)}),m(i,f),(0,M.jsxs)(`div`,{className:`ritual-model-list`,children:[p[0]?.supported?(0,M.jsxs)(`div`,{className:`ritual-primary-cta`,children:[(0,M.jsxs)(v,{onClick:()=>l(p[0]),className:`ritual-primary-model-button`,children:[o(f,`flow.recommend.primary`),` `,(0,M.jsx)(u,{size:16})]}),(0,M.jsx)(`div`,{className:`ritual-time-estimate ritual-primary-note`,children:ie(p[0],f)}),(0,M.jsx)(`div`,{className:`ritual-muted-hint ritual-next-hint`,children:o(f,p[0].downloadRequired?`flow.recommend.nextHint`:`flow.recommend.nextHint.ready`)})]}):null,p.slice(0,3).map((e,t)=>{let n=e.role===`best`?x:e.role===`faster`?S:y;return(0,M.jsxs)(`button`,{className:`ritual-model-card`,onClick:()=>e.supported&&l(e),disabled:!e.supported,children:[(0,M.jsxs)(`div`,{className:`ritual-model-heading`,children:[(0,M.jsx)(n,{size:16}),(0,M.jsx)(`div`,{className:`role`,children:ae(e.role,t,f)})]}),(0,M.jsx)(`div`,{className:`name`,children:e.shortName}),(0,M.jsxs)(`div`,{className:`reason`,children:[e.reason,` · `,e.size||o(f,`flow.recommend.sizeReady`),Q(e.role,f)?(0,M.jsxs)(`span`,{className:`ritual-model-comparison`,children:[` `,Q(e.role,f)]}):null]}),(0,M.jsx)(`div`,{className:`ritual-model-stats`,children:(0,M.jsx)(`span`,{className:`ritual-time-estimate`,children:re(e,f)})}),e.supported?(0,M.jsxs)(`span`,{className:`ritual-model-choose`,children:[o(f,`flow.recommend.choose`),` `,(0,M.jsx)(u,{size:14})]}):(0,M.jsx)(`div`,{className:`ritual-model-warning`,children:o(f,`flow.recommend.unsupported`)})]},`${e.role}-${e.id}`)}),(0,M.jsx)(`div`,{className:`ritual-time-note`,children:o(f,`flow.recommend.timeNote`)})]}),(0,M.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:a,children:o(f,`flow.recommend.back`)}),(0,M.jsx)(v,{variant:`outline`,onClick:c,children:o(f,`flow.recommend.skip`)}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(f,`flow.recommend.hint`)})]})]})}function Z(e,t){return o(t,`flow.recommend.minutes`,{count:e})}function re(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?o(t,`flow.recommend.timeEstimate.ready`,{response:n}):e.estimatedDownloadMinutes===null?o(t,`flow.recommend.timeEstimate.unknown`,{response:n}):o(t,`flow.recommend.timeEstimate`,{download:Z(e.estimatedDownloadMinutes,t),response:n})}function ie(e,t){return!e.downloadRequired||e.estimatedDownloadMinutes===0?o(t,`flow.recommend.primaryNote.ready`):e.estimatedDownloadMinutes===null?o(t,`flow.recommend.primaryNote.unknown`):o(t,`flow.recommend.primaryNote`,{time:Z(e.estimatedDownloadMinutes,t)})}function Q(e,t){return e===`faster`?o(t,`flow.recommend.comparison.faster`):e===`advanced`?o(t,`flow.recommend.comparison.advanced`):``}function ae(e,t,n){return e===`best`?o(n,`flow.recommend.rank.best`):e===`faster`?o(n,`flow.recommend.rank.faster`):e===`advanced`?o(n,`flow.recommend.rank.advanced`):o(n,`flow.recommend.rank.choice`,{index:t+1})}function oe({onComplete:e}){let n=t(e=>e.language),[i,a]=C.useState(`wake`),[s,c]=C.useState(null),[l,u]=C.useState(null),[d,p]=C.useState(0),[m,h]=C.useState(null),g=C.useMemo(()=>w({analysis:s,endpoints:l}),[s,l]);C.useEffect(()=>{let e=!1;async function t(){let[t,n,i,a]=await Promise.all([r.setupScan(),r.modelRecommendations(`local_mlx`),r.models(),r.sysinfo()]);e||(c({setup:t.ok?t.data:null,recommendations:n.ok?n.data:null,models:i.ok?i.data:null,sysinfo:a.ok?a.data:null}),u({setup:t.ok,recommendations:n.ok,models:i.ok,sysinfo:a.ok}))}return t(),()=>{e=!0}},[d]);let _=C.useCallback(()=>{c(null),u(null),p(e=>e+1)},[]);return(0,M.jsx)(`div`,{className:`ritual-shell`,"aria-label":o(n,`flow.shell`),children:(0,M.jsxs)(`div`,{className:`ritual-container`,children:[(0,M.jsx)(G,{}),(0,M.jsxs)(`div`,{className:`ritual-brain`,children:[(0,M.jsx)(f,{state:ce(i),intensity:i===`install`?.92:.7,size:`large`,showLabel:!1}),(0,M.jsx)(`div`,{className:`ritual-edition`,title:o(n,`brain.edition.tip`),children:o(n,`brain.edition`)})]}),i===`wake`&&(0,M.jsx)(se,{onWake:()=>a(`login`),onUseExisting:()=>$(e)}),i===`login`&&(0,M.jsx)(J,{onSuccess:()=>a(`recommend`)}),i===`recommend`&&(0,M.jsx)(X,{status:g.status,reason:g.reason,recommendations:g.recommendations,analysis:s,onBack:()=>a(`login`),onRetry:_,onSkipModel:()=>$(e),onSelect:e=>{h(e),a(`install`)}}),i===`install`&&(0,M.jsx)(P,{model:m||g.recommendations[0]||T(),onBack:()=>a(`recommend`),onComplete:()=>$(e),onLater:()=>$(e)})]})})}function se({onWake:e,onUseExisting:n}){let r=t(e=>e.language),i=[{icon:b,label:o(r,`flow.wake.value.local.k`),body:o(r,`flow.wake.value.local.v`)},{icon:S,label:o(r,`flow.wake.value.instant.k`),body:o(r,`flow.wake.value.instant.v`)},{icon:h,label:o(r,`flow.wake.value.brain.k`),body:o(r,`flow.wake.value.brain.v`)}];return(0,M.jsxs)(`section`,{className:`ritual-wake`,"aria-label":o(r,`flow.wake.aria`),children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(r,`flow.wake.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(r,`flow.wake.body`)}),(0,M.jsx)(`div`,{className:`ritual-value-grid`,"aria-label":o(r,`flow.wake.value.aria`),children:i.map(e=>{let t=e.icon;return(0,M.jsxs)(`div`,{className:`ritual-value-card`,children:[(0,M.jsxs)(`div`,{className:`ritual-value-label`,children:[(0,M.jsx)(t,{size:14}),` `,e.label]}),(0,M.jsx)(`div`,{className:`ritual-value-body`,children:e.body})]},e.label)})}),(0,M.jsxs)(`div`,{className:`ritual-wake-plan`,"aria-label":o(r,`flow.wake.plan.aria`),children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:`1`}),(0,M.jsx)(`strong`,{children:o(r,`flow.wake.step.identity`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:`2`}),(0,M.jsx)(`strong`,{children:o(r,`flow.wake.step.check`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:`3`}),(0,M.jsx)(`strong`,{children:o(r,`flow.wake.step.voice`)})]})]}),(0,M.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:e,children:[o(r,`flow.wake.primary`),` `,(0,M.jsx)(u,{size:18})]}),(0,M.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:n,children:o(r,`flow.wake.existing`)})]}),(0,M.jsx)(`div`,{className:`ritual-start-note`,children:o(r,`flow.wake.startNote`)})]})}function $(e){g(),e()}function ce(e){return e===`wake`?`idle`:e===`analysis`?`listening`:e===`recommend`?`recalling`:e===`install`?`thinking`:`idle`}export{oe as ProductFlow};
|
|
1
|
+
import{S as e,_ as t,b as n,d as r,g as i,h as a,m as o,p as s,t as c,y as l}from"./utils-KFFdVG_t.js";import{i as u,r as d,t as f}from"./LivingBrain-CNz-6NSd.js";import{n as p,t as m}from"./input-DFhSjmLS.js";import{t as h}from"./cpu-mxvF3V1I.js";import{b as g,c as _}from"./index-DDV2YZwM.js";import"./brain-BKDW1F0T.js";import{t as v}from"./button-CCB9Kuw7.js";var y=i(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),b=i(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),x=i(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),S=i(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),C=e(n());a({ko:{"flow.analysis.fact.computer":`컴퓨터`,"flow.analysis.fact.memory":`메모리`,"flow.analysis.fact.graphics":`그래픽`,"flow.analysis.fact.support":`로컬 지원`,"flow.analysis.fact.models":`모델`,"flow.analysis.checking":`확인 중`,"flow.analysis.fact.computerDetail":`운영체제와 칩`,"flow.analysis.fact.memoryDetail":`로컬 사고를 위한 여유 공간`,"flow.analysis.fact.graphicsDetail":`로컬 가속 지원`,"flow.analysis.fact.supportDetail":`설치된 모델 도우미`,"flow.analysis.fact.modelsDetail":`설치된 로컬 Brain`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`감지됨`,"flow.analysis.localReady":`로컬 가속 준비됨`,"flow.analysis.standardLocal":`표준 로컬 모드`,"flow.analysis.supportReady":`준비됨`,"flow.analysis.supportInstall":`준비 예정`,"flow.analysis.modelsInstalled":`{count}개 이미 설치됨`,"flow.analysis.noModels":`아직 설치된 모델 없음`,"flow.analysis.readyDetail":`로컬 Digital Brain 사용 준비 완료`,"flow.analysis.memoryReadyDetail":`추천 모델에 충분한 컨텍스트`,"flow.analysis.graphicsReadyDetail":`Lattice가 가장 좋은 경로를 선택합니다.`,"flow.analysis.supportReadyDetail":`설치된 모델 도우미가 감지되었습니다.`,"flow.analysis.supportInstallDetail":`Lattice가 필요한 항목을 추가합니다.`,"flow.analysis.modelsReadyDetail":`즉시 로드할 수 있는 모델이 있습니다.`,"flow.analysis.modelsInstallDetail":`Lattice가 첫 설치를 안내합니다.`,"flow.recommend.reason.best":`최적 경험`,"flow.recommend.reason.faster":`빠른 선택`,"flow.recommend.reason.advanced":`고급 선택`,"flow.recommend.reason.default":`추천`,"flow.recommend.sizeReady":`준비됨`,"flow.recommend.fallbackName":`추천 Brain`,"flow.install.stage.download":`모델 파일을 받는 중입니다.`,"flow.install.stage.validate":`Brain이 응답할 수 있는지 확인 중입니다.`,"flow.install.stage.load":`Brain을 불러오는 중입니다.`,"flow.install.stage.error":`확인이 필요한 일이 있습니다.`,"flow.install.step.install":`준비`,"flow.install.step.download":`다운로드`,"flow.install.step.ready":`로컬 확인`,"flow.install.step.validate":`확인`,"flow.install.step.load":`로드`,"flow.analysis.hardware.icon.chip":`🖥️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚡`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`📦`,"flow.analysis.hardware.label.chip":`컴퓨터 (운영체제와 칩)`,"flow.analysis.hardware.label.ram":`메모리 (생각할 작업 공간, RAM)`,"flow.analysis.hardware.label.gpu":`그래픽 (계산을 도와주는 GPU)`,"flow.analysis.hardware.label.support":`로컬 지원 (모델 실행 도우미)`,"flow.analysis.hardware.label.models":`모델 (설치된 AI Brain)`,"flow.recommend.timeEstimate":`다운로드 약 {download} · 첫 응답 약 {response}초`,"flow.recommend.timeEstimate.ready":`다운로드 불필요 · 첫 응답 약 {response}초`,"flow.recommend.timeEstimate.unknown":`다운로드 시간 미확인 · 첫 응답 약 {response}초`,"flow.recommend.timeNote":`네트워크 속도에 따라 달라질 수 있어요.`,"flow.recommend.minutes":`{count}분`,"flow.recommend.comparison.faster":`(더 빠름)`,"flow.recommend.comparison.advanced":`(더 강력함)`,"flow.recommend.choose":`이 모델 선택`,"flow.recommend.primaryNote":`약 {time} 후 사용 준비 완료`,"flow.recommend.primaryNote.ready":`다운로드 없이 바로 사용 준비 완료`,"flow.recommend.primaryNote.unknown":`다운로드 시간 확인 후 사용 준비`,"flow.recommend.nextHint":`선택하면 다운로드와 준비 화면으로 넘어가고, 끝나면 바로 Brain이 열립니다.`,"flow.recommend.nextHint.ready":`선택하면 준비 확인 화면으로 넘어가고, 끝나면 바로 Brain이 열립니다.`,"flow.install.expectedTitle":`예상 진행`,"flow.install.expected":`약 {download} 다운로드 후 약 {response}초 안에 첫 응답`,"flow.install.expected.ready":`다운로드 없이 약 {response}초 안에 첫 응답`,"flow.install.expected.unknown":`다운로드 후 약 {response}초 안에 첫 응답`,"flow.install.timelineStep.download":`모델 다운로드`,"flow.install.timelineStep.ready":`로컬 모델 확인`,"flow.install.timelineStep.validate":`응답 확인`,"flow.install.timelineStep.load":`Brain에 로드`,"flow.install.timelineApprox":`약 {time}`,"flow.install.timelineQuick":`잠깐`,"flow.install.expectedCompletion":`끝나면 바로 Brain이 열립니다.`,"flow.shell":`내 로컬 AI 브레인 만들기`,"flow.wake.aria":`Brain 깨우기`,"flow.wake.title":`내 지식이 살아나는 Brain을 시작하세요.`,"flow.wake.body":`Lattice AI는 이 컴퓨터 안에서 내 대화, 문서, 결정이 오래 남는 작업 기억이 되게 합니다. 모델은 바꿔도 Brain은 계속 내 것입니다.`,"flow.wake.value.aria":`Brain 시작 가치`,"flow.wake.value.local.k":`완전 로컬`,"flow.wake.value.local.v":`지식과 대화는 이 컴퓨터에서 먼저 정리됩니다.`,"flow.wake.value.instant.k":`바로 이해`,"flow.wake.value.instant.v":`복잡한 설정 대신 3단계로 첫 대화를 엽니다.`,"flow.wake.value.brain.k":`지속되는 Brain`,"flow.wake.value.brain.v":`모델을 바꿔도 내 기억과 그래프는 이어집니다.`,"flow.wake.plan.aria":`Brain 시작 단계`,"flow.wake.step.identity":`주인 확인`,"flow.wake.step.check":`컴퓨터 확인`,"flow.wake.step.voice":`목소리 선택`,"flow.wake.primary":`Brain 지금 깨우기`,"flow.wake.existing":`기존 Brain 열기`,"flow.wake.startNote":`평균 2분 안에 첫 대화 시작 · 로컬 우선 · 사용자가 제어`,"flow.login.title":`이 Brain의 주인을 정합니다.`,"flow.login.body":`프로필은 로컬 Brain의 소유권을 묶는 기준입니다. 기존 Brain이 있으면 새로 만들기 전에 먼저 안전하게 확인합니다.`,"flow.name":`이름`,"flow.name.placeholder":`나`,"flow.email":`이메일`,"flow.email.placeholder":`you@local`,"flow.password":`비밀번호`,"flow.password.placeholder":`로컬 Brain 비밀번호`,"flow.login.busy":`Brain 여는 중...`,"flow.login.submit":`내 Brain 시작하기`,"flow.login.note":`이 프로필은 내 AI 브레인의 주인입니다. 기존 Brain과 다른 이메일이면 새로 만들지 않고 먼저 확인합니다.`,"flow.login.passwordLocal":`이 비밀번호는 이 컴퓨터의 Brain 전용입니다. 클라우드로 전송되지 않습니다.`,"flow.login.missing":`이름과 이메일, 비밀번호를 입력하면 기존 Brain을 안전하게 확인합니다.`,"flow.login.otherEmail":`이 컴퓨터의 기존 Brain과 다른 이메일입니다. 오타인지 확인해 주세요.`,"flow.login.wrongPassword":`기존 Brain 이메일은 맞지만 비밀번호가 다릅니다. 비밀번호를 다시 확인해 주세요.`,"flow.login.unavailable":`로컬 프로필을 열 수 없습니다. 이메일과 비밀번호를 확인해 주세요.`,"flow.promise.memory.k":`오래 남는 지식`,"flow.promise.memory.v":`내 일이 장기 기억이 됩니다.`,"flow.promise.model.k":`교체 가능한 모델`,"flow.promise.model.v":`모델은 목소리이고, 자산은 Brain입니다.`,"flow.promise.ownership.k":`사용자 소유`,"flow.promise.ownership.v":`백업, 복원, 이동을 직접 결정합니다.`,"flow.promise.aria":`Lattice AI 제품 약속`,"flow.analysis.title":`이 컴퓨터에 맞는 Brain 경험을 확인합니다.`,"flow.analysis.body":`스펙 점수가 아니라, 이 Mac에서 어떤 로컬 AI 브레인 경험이 편한지 보여드립니다. 확인은 로컬 상태를 읽는 것이고, 클라우드 모델은 선택 사항입니다.`,"flow.analysis.finding":`가장 편한 설정을 찾는 중...`,"flow.analysis.ready":`추천 모델을 바로 시작할 수 있게 준비했습니다.`,"flow.analysis.wait":`잠시만 기다리면 자동으로 정리됩니다.`,"flow.analysis.error":`Lattice가 이 컴퓨터를 끝까지 확인하지 못했습니다. 그래도 안전한 기본값으로 계속할 수 있습니다.`,"flow.analysis.continue":`추천 모델 보기`,"flow.analysis.bestFit":`{model}이 이 컴퓨터에 가장 잘 맞습니다.`,"flow.analysis.privateRecommended":`이 컴퓨터에는 개인 로컬 Brain을 추천합니다.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux 컴퓨터`,"flow.recommend.title":`추천대로 시작하세요.`,"flow.recommend.environment.apple":`컴퓨터 준비 완료: 로컬 MLX 지원(Apple Silicon, {ram}GB RAM 감지)`,"flow.recommend.environment.standard":`권장: 가벼운 로컬 모델로 시작하세요({ram}GB RAM 감지)`,"flow.recommend.body":`모델은 Brain의 현재 목소리입니다. 추천, 빠른 선택, 강한 선택만 먼저 보여드려 바로 결정할 수 있게 합니다.`,"flow.recommend.primary":`추천으로 바로 시작`,"flow.recommend.unsupported":`이 컴퓨터에서 추가 확인이 필요합니다`,"flow.recommend.back":`뒤로`,"flow.recommend.skip":`모델 없이 Brain 열기`,"flow.recommend.hint":`잘 모르겠다면 추천대로 시작하면 됩니다.`,"flow.recommend.loading":`이 컴퓨터에 맞는 모델을 확인하는 중...`,"flow.recommend.unavailable.aria":`로컬 모델 준비 상태`,"flow.recommend.unavailable.title":`지금은 이 컴퓨터에서 바로 쓸 로컬 모델을 준비하지 못했습니다.`,"flow.recommend.unavailable.probe":`Lattice가 이 컴퓨터의 로컬 환경을 확인하지 못했습니다. 네트워크와 로컬 서비스 상태를 확인한 뒤 다시 시도해 주세요.`,"flow.recommend.unavailable.empty":`이 컴퓨터에서 바로 실행할 수 있는 추천 모델을 찾지 못했습니다. 다시 확인하거나, 모델 없이 Brain을 먼저 열 수 있습니다.`,"flow.recommend.unavailable.retry":`다시 확인`,"flow.recommend.unavailable.hint":`모델은 나중에 라이브러리에서 언제든 추가할 수 있습니다.`,"flow.recommend.rank.best":`추천`,"flow.recommend.rank.faster":`빠른 선택`,"flow.recommend.rank.advanced":`고급 선택`,"flow.recommend.rank.choice":`선택 {index}`,"flow.install.title":`모델을 설치하고 시작합니다.`,"flow.install.title.ready":`모델을 준비하고 시작합니다.`,"flow.install.body":`이 모델이 Brain의 로컬 목소리가 됩니다. 다운로드는 사용자가 시작할 때만 진행되고, 실행과 기억은 이 컴퓨터에서 유지됩니다.`,"flow.install.body.ready":`이 모델이 Brain의 로컬 목소리가 됩니다. 이미 준비된 모델은 외부 다운로드 없이 응답 확인과 로드만 진행합니다.`,"flow.install.wait":`Brain이 사용할 모델을 기다리고 있습니다.`,"flow.install.prepare":`Brain 준비 중입니다.`,"flow.install.done":`Brain이 준비되었습니다.`,"flow.install.note":`큰 모델은 다운로드에 몇 분 이상 걸릴 수 있습니다. 진행률은 모델 런타임이 알려주는 만큼 표시하고, 멈춘 것처럼 보여도 현재 단계가 유지됩니다.`,"flow.install.note.ready":`로컬 응답 확인은 보통 잠깐이면 끝납니다. 실패하면 다른 모델을 고르거나 나중에 다시 시도할 수 있습니다.`,"flow.install.retry":`다른 모델을 고르거나 다시 시도할 수 있습니다.`,"flow.install.back":`다른 모델 고르기`,"flow.install.start":`다운로드하고 시작하기`,"flow.install.startReady":`준비하고 시작하기`,"flow.install.busy":`모델 준비 중...`,"flow.install.enter":`Brain으로 들어가기`,"flow.install.later":`나중에 하기`,"flow.install.local":`모델 다운로드와 외부 통신은 사용자가 시작할 때만 진행됩니다.`,"flow.install.local.ready":`이 선택은 외부 다운로드 없이 로컬 준비 상태만 확인합니다.`,"flow.consent.title":`다운로드 전 확인`,"flow.consent.readyTitle":`로컬 준비 상태`,"flow.consent.body":`시작하면 아래 모델 파일을 외부 저장소에서 받아 이 컴퓨터에 저장합니다.`,"flow.consent.ready":`이미 준비된 모델입니다. 시작해도 외부 다운로드를 요청하지 않고 로컬에서 응답 가능 여부만 확인합니다.`,"flow.consent.state":`다운로드 필요`,"flow.consent.stateReady":`없음`,"flow.consent.size":`다운로드 크기`,"flow.consent.sizeUnknown":`런타임 확인 후 표시`,"flow.consent.location":`저장 위치`,"flow.consent.external":`외부 접속 대상`,"flow.consent.externalUnknown":`런타임 확인 후 표시`,"flow.consent.externalNone":`선택 전 외부 접속 없음`},en:{"flow.analysis.fact.computer":`Computer`,"flow.analysis.fact.memory":`Memory`,"flow.analysis.fact.graphics":`Graphics`,"flow.analysis.fact.support":`Local Support`,"flow.analysis.fact.models":`Models`,"flow.analysis.checking":`Checking`,"flow.analysis.fact.computerDetail":`Operating system and chip`,"flow.analysis.fact.memoryDetail":`Available room for local thinking`,"flow.analysis.fact.graphicsDetail":`Local acceleration support`,"flow.analysis.fact.supportDetail":`Installed model helpers`,"flow.analysis.fact.modelsDetail":`Installed local Brains`,"flow.analysis.apple":`Apple Silicon Mac`,"flow.analysis.detected":`Detected`,"flow.analysis.localReady":`Local acceleration ready`,"flow.analysis.standardLocal":`Standard local mode`,"flow.analysis.supportReady":`Ready`,"flow.analysis.supportInstall":`Will be prepared`,"flow.analysis.modelsInstalled":`{count} already installed`,"flow.analysis.noModels":`None installed yet`,"flow.analysis.readyDetail":`Ready for local Digital Brain use`,"flow.analysis.memoryReadyDetail":`Enough context for the recommended model`,"flow.analysis.graphicsReadyDetail":`Lattice will choose the best available path`,"flow.analysis.supportReadyDetail":`Installed model helpers detected`,"flow.analysis.supportInstallDetail":`Lattice will add what is needed`,"flow.analysis.modelsReadyDetail":`One can be loaded immediately`,"flow.analysis.modelsInstallDetail":`Lattice will guide the first install`,"flow.recommend.reason.best":`Best Experience`,"flow.recommend.reason.faster":`Faster`,"flow.recommend.reason.advanced":`Advanced`,"flow.recommend.reason.default":`Recommended`,"flow.recommend.sizeReady":`ready`,"flow.recommend.fallbackName":`Recommended Brain`,"flow.install.stage.download":`Getting the model files.`,"flow.install.stage.validate":`Checking that the Brain can answer.`,"flow.install.stage.load":`Loading the Brain.`,"flow.install.stage.error":`Something needs attention.`,"flow.install.step.install":`Install`,"flow.install.step.download":`Download`,"flow.install.step.ready":`Local check`,"flow.install.step.validate":`Validate`,"flow.install.step.load":`Load`,"flow.analysis.hardware.icon.chip":`🖥️`,"flow.analysis.hardware.icon.ram":`🧠`,"flow.analysis.hardware.icon.gpu":`⚡`,"flow.analysis.hardware.icon.support":`🧩`,"flow.analysis.hardware.icon.models":`📦`,"flow.analysis.hardware.label.chip":`Computer (operating system and chip)`,"flow.analysis.hardware.label.ram":`Memory (working space to think, RAM)`,"flow.analysis.hardware.label.gpu":`Graphics (the GPU that speeds up math)`,"flow.analysis.hardware.label.support":`Local support (helpers that run models)`,"flow.analysis.hardware.label.models":`Models (AI Brains already installed)`,"flow.recommend.timeEstimate":`Download about {download} · first reply about {response}s`,"flow.recommend.timeEstimate.ready":`No download needed · first reply about {response}s`,"flow.recommend.timeEstimate.unknown":`Download time unknown · first reply about {response}s`,"flow.recommend.timeNote":`Actual time depends on your network speed.`,"flow.recommend.minutes":`{count} min`,"flow.recommend.comparison.faster":`(faster)`,"flow.recommend.comparison.advanced":`(more capable)`,"flow.recommend.choose":`Choose this model`,"flow.recommend.primaryNote":`Ready to use in about {time}`,"flow.recommend.primaryNote.ready":`Ready with no download`,"flow.recommend.primaryNote.unknown":`Ready after download time is confirmed`,"flow.recommend.nextHint":`Choosing takes you to download and setup, then your Brain opens automatically.`,"flow.recommend.nextHint.ready":`Choosing takes you to a readiness check, then your Brain opens automatically.`,"flow.install.expectedTitle":`What to expect`,"flow.install.expected":`About {download} to download, then a first reply within about {response}s`,"flow.install.expected.ready":`No download — first reply within about {response}s`,"flow.install.expected.unknown":`After download, a first reply within about {response}s`,"flow.install.timelineStep.download":`Download model`,"flow.install.timelineStep.ready":`Check local model`,"flow.install.timelineStep.validate":`Check the reply`,"flow.install.timelineStep.load":`Load into Brain`,"flow.install.timelineApprox":`about {time}`,"flow.install.timelineQuick":`moment`,"flow.install.expectedCompletion":`When it finishes, your Brain opens right away.`,"flow.shell":`Create your local AI Brain`,"flow.wake.aria":`Wake your Brain`,"flow.wake.title":`Start the Brain where your knowledge comes alive.`,"flow.wake.body":`Lattice AI turns your conversations, documents, and decisions into durable working memory on this computer. Models can change while your Brain remains yours.`,"flow.wake.value.aria":`Brain startup value`,"flow.wake.value.local.k":`Fully local`,"flow.wake.value.local.v":`Knowledge and conversations are organized on this computer first.`,"flow.wake.value.instant.k":`Clear start`,"flow.wake.value.instant.v":`Open the first conversation in three guided steps.`,"flow.wake.value.brain.k":`Durable Brain`,"flow.wake.value.brain.v":`Your memories and graph continue even when models change.`,"flow.wake.plan.aria":`Brain start steps`,"flow.wake.step.identity":`Confirm owner`,"flow.wake.step.check":`Check computer`,"flow.wake.step.voice":`Choose voice`,"flow.wake.primary":`Wake Brain`,"flow.wake.existing":`Open existing Brain`,"flow.wake.startNote":`First conversation in about 2 minutes · local-first · user controlled`,"flow.login.title":`Choose the owner of this Brain.`,"flow.login.body":`Your profile anchors ownership of the local Brain. If a Brain already exists here, Lattice checks safely before creating anything new.`,"flow.name":`Name`,"flow.name.placeholder":`You`,"flow.email":`Email`,"flow.email.placeholder":`you@local`,"flow.password":`Password`,"flow.password.placeholder":`Local Brain password`,"flow.login.busy":`Opening Brain...`,"flow.login.submit":`Start my Brain`,"flow.login.note":`This profile owns your AI Brain. If the email differs from this computer's Brain, Lattice checks before creating anything new.`,"flow.login.passwordLocal":`This password is only for the Brain on this computer. It is not sent to the cloud.`,"flow.login.missing":`Enter your name, email, and password so Lattice can safely check your Brain.`,"flow.login.otherEmail":`This email differs from the Brain on this computer. Please check for a typo.`,"flow.login.wrongPassword":`The email matches this Brain, but the password is different. Please check it again.`,"flow.login.unavailable":`Could not open the local profile. Check your email and password.`,"flow.promise.memory.k":`Durable knowledge`,"flow.promise.memory.v":`Your work becomes long-term memory.`,"flow.promise.model.k":`Replaceable models`,"flow.promise.model.v":`The model is the voice; the Brain is the asset.`,"flow.promise.ownership.k":`User owned`,"flow.promise.ownership.v":`You decide when to back up, restore, or move it.`,"flow.promise.aria":`Lattice AI product promise`,"flow.analysis.title":`Checking the Brain experience for this computer.`,"flow.analysis.body":`This is not a spec score. Lattice reads local capability and explains which local AI Brain experience will feel comfortable on this Mac. Cloud models remain optional.`,"flow.analysis.finding":`Finding the easiest setup...`,"flow.analysis.ready":`Your recommended model is ready to start.`,"flow.analysis.wait":`This will be summarized automatically in a moment.`,"flow.analysis.error":`Lattice could not finish checking this computer. You can still continue with a safe default.`,"flow.analysis.continue":`View recommended models`,"flow.analysis.bestFit":`{model} looks like the best fit.`,"flow.analysis.privateRecommended":`A private local Brain is recommended for this computer.`,"flow.analysis.os.windows":`Windows PC`,"flow.analysis.os.linux":`Linux computer`,"flow.recommend.title":`Start with the recommendation.`,"flow.recommend.environment.apple":`Computer ready: local MLX supported (Apple Silicon, {ram}GB RAM detected)`,"flow.recommend.environment.standard":`Recommended: start with a lighter local model ({ram}GB RAM detected)`,"flow.recommend.body":`The model is your Brain's current voice. Lattice shows the recommendation, a faster choice, and a stronger choice first so you can decide quickly.`,"flow.recommend.primary":`Start with recommendation`,"flow.recommend.unsupported":`This computer needs one more check`,"flow.recommend.back":`Back`,"flow.recommend.skip":`Open Brain without a model`,"flow.recommend.hint":`If unsure, start with the recommendation.`,"flow.recommend.loading":`Checking which model fits this computer...`,"flow.recommend.unavailable.aria":`Local model readiness`,"flow.recommend.unavailable.title":`A local model isn't ready to run on this computer yet.`,"flow.recommend.unavailable.probe":`Lattice couldn't check this computer's local environment. Check your network and local services, then try again.`,"flow.recommend.unavailable.empty":`No recommended model can run on this computer right now. Try checking again, or open your Brain without a model first.`,"flow.recommend.unavailable.retry":`Check again`,"flow.recommend.unavailable.hint":`You can add a model anytime later from the library.`,"flow.recommend.rank.best":`Best Experience`,"flow.recommend.rank.faster":`Faster`,"flow.recommend.rank.advanced":`Advanced`,"flow.recommend.rank.choice":`Choice {index}`,"flow.install.title":`Install the model and start.`,"flow.install.title.ready":`Prepare the model and start.`,"flow.install.body":`This model becomes your Brain's local voice. Download starts only when you choose it; execution and memory stay on this computer.`,"flow.install.body.ready":`This model becomes your Brain's local voice. Because it is already ready, Lattice only checks the reply path and loads it locally.`,"flow.install.wait":`Waiting for the model your Brain will use.`,"flow.install.prepare":`Preparing your Brain.`,"flow.install.done":`Your Brain is ready.`,"flow.install.note":`Large models can take several minutes to download. Progress is shown when the model runtime reports it; a steady stage still means work is continuing.`,"flow.install.note.ready":`The local reply check usually takes a moment. If it fails, choose another model or try again later.`,"flow.install.retry":`Choose another model or try again.`,"flow.install.back":`Choose another model`,"flow.install.start":`Download and start`,"flow.install.startReady":`Check and start`,"flow.install.busy":`Preparing model...`,"flow.install.enter":`Enter Brain`,"flow.install.later":`Do later`,"flow.install.local":`Downloads and external communication start only when you choose them.`,"flow.install.local.ready":`This choice checks local readiness without starting an external download.`,"flow.consent.title":`Before downloading`,"flow.consent.readyTitle":`Local readiness`,"flow.consent.body":`Starting will fetch these model files from an external repository and store them on this computer.`,"flow.consent.ready":`This model is already ready. Starting checks whether it can answer locally without requesting an external download.`,"flow.consent.state":`Download needed`,"flow.consent.stateReady":`No`,"flow.consent.size":`Download size`,"flow.consent.sizeUnknown":`Reported by runtime`,"flow.consent.location":`Storage location`,"flow.consent.external":`External target`,"flow.consent.externalUnknown":`Reported by runtime`,"flow.consent.externalNone":`No external connection before selection`}});function ee(e){let t=j(e?.models),n=[...c(t.recommended),...c(t.catalog)],r=j(e?.recommendations?.recommendations),i=c(r.models),a=j(r.top_pick),o=new Map;for(let e of[...i,...n]){let t=String(e.id||e.model_id||e.recommended_load_id||``);t&&o.set(t,{...o.get(t)||{},...e})}a.id&&!o.has(String(a.id))&&o.set(String(a.id),a);let s=Array.from(o.values()).map(E).filter(e=>e.id),l=s.filter(e=>e.supported),u=l.length?l:s,d=(e=>u.find(t=>t.id===String(e)))(a.id)||(e=>u.find(t=>e.test(`${t.name} ${t.id}`)))(/gemma.*12|12b/i)||u[0],f=u.find(e=>e.id!==d?.id&&/qwen|8b|7b/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id),p=u.find(e=>e.id!==d?.id&&e.id!==f?.id&&/26b|32b|70b|advanced/i.test(`${e.name} ${e.id}`))||u.find(e=>e.id!==d?.id&&e.id!==f?.id);return[d?{...d,role:`best`,reason:d.reason||`best`}:null,f?{...f,role:`faster`,reason:f.reason||`faster`}:null,p?{...p,role:`advanced`,reason:p.reason||`advanced`}:null].filter(Boolean)}function w(e){let{analysis:t,endpoints:n}=e;if(!n)return{status:`loading`,recommendations:[],reason:null,failedEndpoints:[]};let r=Object.keys(n).filter(e=>!n[e]);if(!(n.recommendations||n.models))return{status:`unavailable`,recommendations:[],reason:`probe_failed`,failedEndpoints:r};let i=ee(t).filter(e=>e.supported);return i.length?{status:`ready`,recommendations:i,reason:null,failedEndpoints:r}:{status:`unavailable`,recommendations:[],reason:`no_supported_model`,failedEndpoints:r}}function T(){return{id:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,loadId:`mlx-community/Qwen3-VL-8B-Instruct-4bit`,engine:`local_mlx`,name:`Qwen3-VL 8B`,shortName:`Qwen 3`,family:`Qwen 3`,size:``,role:`best`,reason:`best`,supported:!0,downloadRequired:!1,downloadSize:``,storageLocation:`~/.latticeai/models`,externalHost:``,estimatedDownloadMinutes:0,estimatedFirstResponseSeconds:5,parameterBillions:8}}function E(e){let t=j(e.runtime_compatibility),n=String(e.id||e.model_id||e.recommended_load_id||``),r=String(e.recommended_load_id||e.load_id||n),i=String(e.display_name||e.name||n||`recommended_brain`),a=e.load_status!==`unsupported`&&e.load_status!==`runtime_update_needed`&&e.status!==`not_recommended`&&t.supported!==!1,o=!!e.download_required,s=o?String(e.download_size||e.size||``):``,c=D(`${i} ${n}`);return{id:n,loadId:r,engine:String(e.recommended_engine||e.engine||`local_mlx`),name:i,shortName:A(i||n),family:A(String(e.family||i||`local_brain`)),size:String(e.size||``),role:`best`,reason:String(e.reason||``),supported:a,downloadRequired:o,downloadSize:s,storageLocation:String(e.storage_location||e.local_path||`~/.latticeai/models`),externalHost:o?k(e):``,estimatedDownloadMinutes:o?ne(s):0,estimatedFirstResponseSeconds:O(c),parameterBillions:c}}function te(e){let t=String(e||``).match(/([\d.]+)\s*(t|g|m)?b?/i);if(!t)return null;let n=Number(t[1]);if(!Number.isFinite(n)||n<=0)return null;let r=(t[2]||`g`).toLowerCase();return r===`t`?n*1024*1024:r===`m`?n:n*1024}function ne(e){let t=te(e);if(t===null)return null;let n=t/(15/8)/60;return Math.max(1,Math.round(n))}function D(e){let t=String(e||``).match(/(\d{1,3}(?:\.\d)?)\s*b\b/i);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}function O(e){return e===null?8:e<=9?5:e<=16?10:e<=40?18:30}function k(e){let t=String(e.source_url||e.download_url||e.repository||e.provider||e.id||``);return t?/huggingface|hf\\.co|mlx-community/i.test(t)?`huggingface`:/ollama/i.test(t)?`ollama`:t.replace(/^https?:\/\//,``).split(`/`)[0]||t:``}function A(e){return String(e||`recommended_brain`).replace(/^mlx-community\//i,``).replace(/[-_]?Instruct/gi,``).replace(/[-_]?4bit/gi,``).replace(/Qwen3[-_ ]?VL/gi,`Qwen 3`).replace(/Qwen3/gi,`Qwen 3`).replace(/Gemma[-_ ]?4/gi,`Gemma 4`).replace(/A4B/gi,``).replace(/[-_]+/g,` `).replace(/\s+/g,` `).trim()}function j(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:{}}var M=l();function N({model:e}){let n=t(e=>e.language),r=e.downloadRequired?[{label:o(n,`flow.consent.size`),value:e.downloadSize||o(n,`flow.consent.sizeUnknown`)},{label:o(n,`flow.consent.location`),value:e.storageLocation},{label:o(n,`flow.consent.external`),value:e.externalHost||o(n,`flow.consent.externalUnknown`)}]:[{label:o(n,`flow.consent.state`),value:o(n,`flow.consent.stateReady`)},{label:o(n,`flow.consent.location`),value:e.storageLocation},{label:o(n,`flow.consent.external`),value:o(n,`flow.consent.externalNone`)}],i=e.downloadRequired?`flow.consent.title`:`flow.consent.readyTitle`;return(0,M.jsxs)(`section`,{className:`ritual-consent-panel`,"aria-label":o(n,i),children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`strong`,{children:o(n,i)}),(0,M.jsx)(`p`,{children:e.downloadRequired?o(n,`flow.consent.body`):o(n,`flow.consent.ready`)})]}),(0,M.jsx)(`dl`,{children:r.map(e=>(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`dt`,{children:e.label}),(0,M.jsx)(`dd`,{children:e.value})]},e.label))})]})}function P({model:e,onBack:n,onComplete:i,onLater:a}){let s=t(e=>e.language),[c,l]=C.useState(!1),[u,d]=C.useState(`idle`),[m,h]=C.useState(0),[g,_]=C.useState(o(s,`flow.install.wait`)),[y,b]=C.useState(null);async function x(){l(!0),b(null),d(`install`),h(8),_(o(s,`flow.install.prepare`));let t=await r.streamModelPrepare({model:e.loadId,engine:e.engine||`local_mlx`,allow_download:e.downloadRequired},{onProgress:e=>{let t=L(String(e.stage||``));d(t),h(Number(e.percent||R(t))),_(z(e,t,s))},onDone:()=>{d(`done`),h(100),_(o(s,`flow.install.done`))},onError:e=>{d(`error`),b(U(e))}});l(!1),t.ok?(d(`done`),h(100),_(o(s,`flow.install.done`)),window.setTimeout(i,700)):(d(`error`),b(U(t.data)))}let S=u===`download`?`thinking`:u===`validate`?`recalling`:u===`load`?`synthesizing`:u===`done`?`idle`:`listening`;return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(s,e.downloadRequired?`flow.install.title`:`flow.install.title.ready`)}),(0,M.jsxs)(`div`,{className:`ritual-subtitle`,children:[(0,M.jsx)(`strong`,{children:e.shortName}),` — `,e.reason,`.`,(0,M.jsx)(`br`,{}),o(s,e.downloadRequired?`flow.install.body`:`flow.install.body.ready`)]}),(0,M.jsxs)(`section`,{className:`ritual-card ritual-expected-card`,"aria-label":o(s,`flow.install.expectedTitle`),children:[(0,M.jsx)(`div`,{className:`ritual-fact-label`,children:o(s,`flow.install.expectedTitle`)}),(0,M.jsx)(`div`,{className:`ritual-time-estimate ritual-expected-line`,children:F(e,s)}),(0,M.jsx)(`ol`,{className:`ritual-timeline`,children:I(e,s).map(e=>(0,M.jsxs)(`li`,{className:`ritual-timeline-step`,children:[(0,M.jsx)(`span`,{className:`ritual-timeline-name`,children:e.name}),(0,M.jsx)(`span`,{className:`ritual-timeline-time`,children:e.time})]},e.key))}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(s,`flow.install.expectedCompletion`)})]}),(0,M.jsx)(`div`,{className:`ritual-install-brain`,children:(0,M.jsx)(f,{state:S,intensity:u===`download`||u===`load`?.96:.82,size:`normal`})}),(0,M.jsx)(N,{model:e}),(0,M.jsxs)(`div`,{className:`ritual-progress`,children:[(0,M.jsx)(`div`,{className:`ritual-stage-list`,children:[`install`,`download`,`validate`,`load`].map(t=>(0,M.jsxs)(`div`,{className:`ritual-stage ${H(u,t)}`,children:[(0,M.jsx)(p,{className:`ritual-stage-icon`}),(0,M.jsx)(`span`,{children:B(t,s,e)})]},t))}),(0,M.jsx)(`div`,{className:`ritual-bar`,children:(0,M.jsx)(`span`,{className:`ritual-bar-fill ${V(m)}`})})]}),(0,M.jsx)(`div`,{className:`ritual-status`,children:g}),(0,M.jsx)(`div`,{className:`ritual-card ritual-status-card`,children:o(s,e.downloadRequired?`flow.install.note`:`flow.install.note.ready`)}),y&&(0,M.jsxs)(`div`,{className:`ritual-card ritual-error-card ritual-install-error`,role:`alert`,children:[y,(0,M.jsx)(`div`,{className:`ritual-error-detail`,children:o(s,`flow.install.retry`)})]}),(0,M.jsxs)(`div`,{className:`ritual-button-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:n,disabled:c,children:o(s,`flow.install.back`)}),(0,M.jsx)(v,{variant:`outline`,onClick:a,disabled:c,children:o(s,`flow.install.later`)}),u===`done`?(0,M.jsx)(v,{onClick:i,children:o(s,`flow.install.enter`)}):(0,M.jsx)(v,{onClick:x,disabled:c||!e.supported,children:c?o(s,`flow.install.busy`):o(s,e.downloadRequired?`flow.install.start`:`flow.install.startReady`)})]}),(0,M.jsx)(`div`,{className:`ritual-local-note`,children:o(s,e.downloadRequired?`flow.install.local`:`flow.install.local.ready`)})]})}function F(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?o(t,`flow.install.expected.ready`,{response:n}):e.estimatedDownloadMinutes===null?o(t,`flow.install.expected.unknown`,{response:n}):o(t,`flow.install.expected`,{download:o(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes}),response:n})}function I(e,t){let n=e.downloadRequired&&e.estimatedDownloadMinutes?o(t,`flow.install.timelineApprox`,{time:o(t,`flow.recommend.minutes`,{count:e.estimatedDownloadMinutes})}):o(t,`flow.install.timelineQuick`);return[{key:`download`,name:o(t,e.downloadRequired?`flow.install.timelineStep.download`:`flow.install.timelineStep.ready`),time:n},{key:`validate`,name:o(t,`flow.install.timelineStep.validate`),time:o(t,`flow.install.timelineQuick`)},{key:`load`,name:o(t,`flow.install.timelineStep.load`),time:o(t,`flow.install.timelineApprox`,{time:`${e.estimatedFirstResponseSeconds}s`})}]}function L(e){return/download|pull|weights/i.test(e)?`download`:/smoke|validate|verify|test/i.test(e)?`validate`:/load|ready/i.test(e)?`load`:/done|complete/i.test(e)?`done`:`install`}function R(e){return e===`install`?20:e===`download`?55:e===`validate`?82:e===`load`?94:e===`done`?100:8}function z(e,t,n){let r={install:o(n,`flow.install.prepare`),download:o(n,`flow.install.stage.download`),validate:o(n,`flow.install.stage.validate`),load:o(n,`flow.install.stage.load`),done:o(n,`flow.install.done`),idle:o(n,`flow.install.wait`),error:o(n,`flow.install.stage.error`)}[t];return W(String(e.user_message||e.message||r))}function B(e,t,n){return e===`download`&&!n.downloadRequired?o(t,`flow.install.step.ready`):o(t,`flow.install.step.${e}`)}function V(e){return`progress-${Math.max(0,Math.min(100,Math.round(e/10)*10))}`}function H(e,t){let n=[`idle`,`install`,`download`,`validate`,`load`,`done`],r=n.indexOf(e),i=n.indexOf(t);return e===`error`?`is-error`:e===`done`||r>i?`is-done`:e===t?`is-active`:``}function U(e){let t=j(e),n=c(t.recovery_guidance).map(W).filter(Boolean);return[W(String(t.user_message||t.reason||t.error||`The selected model could not be loaded.`)),...n.slice(0,2)].join(` `)}function W(e){return String(e||``).replace(/gemma4_unified/gi,`this model format`).replace(/mlx[-_ ]?vlm|mlx[-_ ]?lm|local_mlx|\bmlx\b|\bgguf\b|\bollama\b|huggingface|hugging face/gi,`local model support`).replace(/runtime/gi,`model support`).replace(/No module named ['\"][^'\"]+['\"]/gi,`A local support component is missing`).replace(/\s+/g,` `).trim()}function G(){let e=t(e=>e.language),n=t(e=>e.setLanguage);return(0,M.jsx)(`div`,{className:`language-switcher ritual-language`,"aria-label":o(e,`language.label`),children:[`ko`,`en`].map(t=>(0,M.jsx)(`button`,{type:`button`,className:e===t?`is-active`:``,onClick:()=>n(t),"aria-pressed":e===t,children:s[t]},t))})}var K=`lattice.productFlow.user`;function q(){try{let e=localStorage.getItem(K);return e?JSON.parse(e):null}catch{}return null}function J({onSuccess:e}){let n=t(e=>e.language),[i,a]=C.useState(()=>q()?.email||`you@local`),[s,c]=C.useState(``),[l,u]=C.useState(()=>q()?.name||`You`),[d,f]=C.useState(!1),[p,h]=C.useState(null);async function g(t){t.preventDefault();let a=i.trim(),c=s.trim(),u=l.trim()||a.split(`@`)[0]||`You`;if(!a||!c){h(o(n,`flow.login.missing`));return}f(!0),h(null);let d=q(),p=await r.login(a,c);if(!p.ok){if((await r.profile()).ok&&(!d?.email||d.email===a)){try{localStorage.setItem(K,JSON.stringify({email:a,name:u}))}catch{}f(!1),e();return}if(d?.email&&d.email!==a){f(!1),h(o(n,`flow.login.otherEmail`));return}if(d?.email===a){f(!1),h(o(n,`flow.login.wrongPassword`));return}(await r.register({email:a,password:c,name:u,nickname:u})).ok&&(p=await r.login(a,c))}if(!p.ok){f(!1),h(o(n,`flow.login.unavailable`));return}try{localStorage.setItem(K,JSON.stringify({email:a,name:u}))}catch{}f(!1),e()}return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(n,`flow.login.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(n,`flow.login.body`)}),(0,M.jsx)(Y,{}),(0,M.jsxs)(`form`,{onSubmit:g,className:`ritual-card ritual-form`,children:[(0,M.jsxs)(`div`,{className:`ritual-field-stack`,children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-field-label`,children:o(n,`flow.name`)}),(0,M.jsx)(m,{value:l,onChange:e=>u(e.target.value),placeholder:o(n,`flow.name.placeholder`),autoComplete:`name`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-field-label`,children:o(n,`flow.email`)}),(0,M.jsx)(m,{value:i,onChange:e=>a(e.target.value),type:`email`,placeholder:o(n,`flow.email.placeholder`),autoComplete:`email`})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-field-label`,children:o(n,`flow.password`)}),(0,M.jsx)(m,{value:s,onChange:e=>c(e.target.value),type:`password`,placeholder:o(n,`flow.password.placeholder`),autoComplete:`current-password`})]})]}),p&&(0,M.jsx)(`div`,{className:`ritual-error`,role:`alert`,children:p}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(n,`flow.login.passwordLocal`)}),(0,M.jsx)(v,{type:`submit`,disabled:d||!i.trim()||!s.trim(),className:`ritual-full-button`,children:d?o(n,`flow.login.busy`):o(n,`flow.login.submit`)}),(0,M.jsx)(`div`,{className:`ritual-note`,children:o(n,`flow.login.note`)})]})]})}function Y(){let e=t(e=>e.language);return(0,M.jsxs)(`div`,{className:`ritual-promise`,"aria-label":o(e,`flow.promise.aria`),children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:o(e,`flow.promise.memory.k`)}),(0,M.jsx)(`strong`,{children:o(e,`flow.promise.memory.v`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:o(e,`flow.promise.model.k`)}),(0,M.jsx)(`strong`,{children:o(e,`flow.promise.model.v`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:o(e,`flow.promise.ownership.k`)}),(0,M.jsx)(`strong`,{children:o(e,`flow.promise.ownership.v`)})]})]})}function X({status:e,reason:n,recommendations:r,analysis:i,onBack:a,onRetry:s,onSkipModel:c,onSelect:l}){let f=t(e=>e.language);if(e===`loading`)return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(f,`flow.recommend.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(f,`flow.recommend.body`)}),(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,role:`status`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,M.jsx)(`span`,{children:o(f,`flow.recommend.loading`)})]}),(0,M.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:a,children:o(f,`flow.recommend.back`)}),(0,M.jsx)(v,{variant:`outline`,onClick:c,children:o(f,`flow.recommend.skip`)})]})]});if(e===`unavailable`){let e=n===`no_supported_model`?`flow.recommend.unavailable.empty`:`flow.recommend.unavailable.probe`;return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(f,`flow.recommend.title`)}),(0,M.jsx)(`section`,{className:`ritual-card ritual-error-card ritual-unavailable-card`,role:`alert`,"aria-label":o(f,`flow.recommend.unavailable.aria`),children:(0,M.jsxs)(`div`,{className:`ritual-inline-row`,children:[(0,M.jsx)(_,{className:`ritual-core-icon`,"aria-hidden":`true`}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-strong-text`,children:o(f,`flow.recommend.unavailable.title`)}),(0,M.jsx)(`div`,{className:`ritual-muted-text`,children:o(f,e)})]})]})}),(0,M.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:s,children:[(0,M.jsx)(d,{size:16}),` `,o(f,`flow.recommend.unavailable.retry`)]}),(0,M.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:c,children:o(f,`flow.recommend.skip`)})]}),(0,M.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:a,children:o(f,`flow.recommend.back`)}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(f,`flow.recommend.unavailable.hint`)})]})]})}let p=r;function m(e,t){if(!e)return(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-loading`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot pulsing`}),(0,M.jsx)(`span`,{children:o(t,`flow.analysis.checking`)})]});let n=j(e.recommendations?.recommendations),r=j(e.setup?.environment),i=j(e.recommendations?.profile),a={...r,...i},s=Number(n.ram_gb||Number(a.ram_mb||0)/1024||0);return n.apple_silicon||String(a.arch||``).includes(`arm`)?(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-success`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot is-success`}),(0,M.jsx)(`span`,{children:o(t,`flow.recommend.environment.apple`,{ram:Math.round(s)})})]}):(0,M.jsxs)(`div`,{className:`ritual-scan-banner is-warning`,children:[(0,M.jsx)(`span`,{className:`ritual-scan-dot is-warning`}),(0,M.jsx)(`span`,{children:o(t,`flow.recommend.environment.standard`,{ram:Math.round(s)})})]})}return(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(f,`flow.recommend.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(f,`flow.recommend.body`)}),m(i,f),(0,M.jsxs)(`div`,{className:`ritual-model-list`,children:[p[0]?.supported?(0,M.jsxs)(`div`,{className:`ritual-primary-cta`,children:[(0,M.jsxs)(v,{onClick:()=>l(p[0]),className:`ritual-primary-model-button`,children:[o(f,`flow.recommend.primary`),` `,(0,M.jsx)(u,{size:16})]}),(0,M.jsx)(`div`,{className:`ritual-time-estimate ritual-primary-note`,children:ie(p[0],f)}),(0,M.jsx)(`div`,{className:`ritual-muted-hint ritual-next-hint`,children:o(f,p[0].downloadRequired?`flow.recommend.nextHint`:`flow.recommend.nextHint.ready`)})]}):null,p.slice(0,3).map((e,t)=>{let n=e.role===`best`?x:e.role===`faster`?S:y;return(0,M.jsxs)(`button`,{className:`ritual-model-card`,onClick:()=>e.supported&&l(e),disabled:!e.supported,children:[(0,M.jsxs)(`div`,{className:`ritual-model-heading`,children:[(0,M.jsx)(n,{size:16}),(0,M.jsx)(`div`,{className:`role`,children:ae(e.role,t,f)})]}),(0,M.jsx)(`div`,{className:`name`,children:e.shortName}),(0,M.jsxs)(`div`,{className:`reason`,children:[e.reason,` · `,e.size||o(f,`flow.recommend.sizeReady`),Q(e.role,f)?(0,M.jsxs)(`span`,{className:`ritual-model-comparison`,children:[` `,Q(e.role,f)]}):null]}),(0,M.jsx)(`div`,{className:`ritual-model-stats`,children:(0,M.jsx)(`span`,{className:`ritual-time-estimate`,children:re(e,f)})}),e.supported?(0,M.jsxs)(`span`,{className:`ritual-model-choose`,children:[o(f,`flow.recommend.choose`),` `,(0,M.jsx)(u,{size:14})]}):(0,M.jsx)(`div`,{className:`ritual-model-warning`,children:o(f,`flow.recommend.unsupported`)})]},`${e.role}-${e.id}`)}),(0,M.jsx)(`div`,{className:`ritual-time-note`,children:o(f,`flow.recommend.timeNote`)})]}),(0,M.jsxs)(`div`,{className:`ritual-action-row`,children:[(0,M.jsx)(v,{variant:`ghost`,onClick:a,children:o(f,`flow.recommend.back`)}),(0,M.jsx)(v,{variant:`outline`,onClick:c,children:o(f,`flow.recommend.skip`)}),(0,M.jsx)(`div`,{className:`ritual-muted-hint`,children:o(f,`flow.recommend.hint`)})]})]})}function Z(e,t){return o(t,`flow.recommend.minutes`,{count:e})}function re(e,t){let n=e.estimatedFirstResponseSeconds;return!e.downloadRequired||e.estimatedDownloadMinutes===0?o(t,`flow.recommend.timeEstimate.ready`,{response:n}):e.estimatedDownloadMinutes===null?o(t,`flow.recommend.timeEstimate.unknown`,{response:n}):o(t,`flow.recommend.timeEstimate`,{download:Z(e.estimatedDownloadMinutes,t),response:n})}function ie(e,t){return!e.downloadRequired||e.estimatedDownloadMinutes===0?o(t,`flow.recommend.primaryNote.ready`):e.estimatedDownloadMinutes===null?o(t,`flow.recommend.primaryNote.unknown`):o(t,`flow.recommend.primaryNote`,{time:Z(e.estimatedDownloadMinutes,t)})}function Q(e,t){return e===`faster`?o(t,`flow.recommend.comparison.faster`):e===`advanced`?o(t,`flow.recommend.comparison.advanced`):``}function ae(e,t,n){return e===`best`?o(n,`flow.recommend.rank.best`):e===`faster`?o(n,`flow.recommend.rank.faster`):e===`advanced`?o(n,`flow.recommend.rank.advanced`):o(n,`flow.recommend.rank.choice`,{index:t+1})}function oe({onComplete:e}){let n=t(e=>e.language),[i,a]=C.useState(`wake`),[s,c]=C.useState(null),[l,u]=C.useState(null),[d,p]=C.useState(0),[m,h]=C.useState(null),g=C.useMemo(()=>w({analysis:s,endpoints:l}),[s,l]);C.useEffect(()=>{let e=!1;async function t(){let[t,n,i,a]=await Promise.all([r.setupScan(),r.modelRecommendations(`local_mlx`),r.models(),r.sysinfo()]);e||(c({setup:t.ok?t.data:null,recommendations:n.ok?n.data:null,models:i.ok?i.data:null,sysinfo:a.ok?a.data:null}),u({setup:t.ok,recommendations:n.ok,models:i.ok,sysinfo:a.ok}))}return t(),()=>{e=!0}},[d]);let _=C.useCallback(()=>{c(null),u(null),p(e=>e+1)},[]);return(0,M.jsx)(`div`,{className:`ritual-shell`,"aria-label":o(n,`flow.shell`),children:(0,M.jsxs)(`div`,{className:`ritual-container`,children:[(0,M.jsx)(G,{}),(0,M.jsxs)(`div`,{className:`ritual-brain`,children:[(0,M.jsx)(f,{state:ce(i),intensity:i===`install`?.92:.7,size:`large`,showLabel:!1}),(0,M.jsx)(`div`,{className:`ritual-edition`,title:o(n,`brain.edition.tip`),children:o(n,`brain.edition`)})]}),i===`wake`&&(0,M.jsx)(se,{onWake:()=>a(`login`),onUseExisting:()=>$(e)}),i===`login`&&(0,M.jsx)(J,{onSuccess:()=>a(`recommend`)}),i===`recommend`&&(0,M.jsx)(X,{status:g.status,reason:g.reason,recommendations:g.recommendations,analysis:s,onBack:()=>a(`login`),onRetry:_,onSkipModel:()=>$(e),onSelect:e=>{h(e),a(`install`)}}),i===`install`&&(0,M.jsx)(P,{model:m||g.recommendations[0]||T(),onBack:()=>a(`recommend`),onComplete:()=>$(e),onLater:()=>$(e)})]})})}function se({onWake:e,onUseExisting:n}){let r=t(e=>e.language),i=[{icon:b,label:o(r,`flow.wake.value.local.k`),body:o(r,`flow.wake.value.local.v`)},{icon:S,label:o(r,`flow.wake.value.instant.k`),body:o(r,`flow.wake.value.instant.v`)},{icon:h,label:o(r,`flow.wake.value.brain.k`),body:o(r,`flow.wake.value.brain.v`)}];return(0,M.jsxs)(`section`,{className:`ritual-wake`,"aria-label":o(r,`flow.wake.aria`),children:[(0,M.jsx)(`div`,{className:`ritual-title`,children:o(r,`flow.wake.title`)}),(0,M.jsx)(`div`,{className:`ritual-subtitle`,children:o(r,`flow.wake.body`)}),(0,M.jsx)(`div`,{className:`ritual-value-grid`,"aria-label":o(r,`flow.wake.value.aria`),children:i.map(e=>{let t=e.icon;return(0,M.jsxs)(`div`,{className:`ritual-value-card`,children:[(0,M.jsxs)(`div`,{className:`ritual-value-label`,children:[(0,M.jsx)(t,{size:14}),` `,e.label]}),(0,M.jsx)(`div`,{className:`ritual-value-body`,children:e.body})]},e.label)})}),(0,M.jsxs)(`div`,{className:`ritual-wake-plan`,"aria-label":o(r,`flow.wake.plan.aria`),children:[(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:`1`}),(0,M.jsx)(`strong`,{children:o(r,`flow.wake.step.identity`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:`2`}),(0,M.jsx)(`strong`,{children:o(r,`flow.wake.step.check`)})]}),(0,M.jsxs)(`div`,{children:[(0,M.jsx)(`span`,{children:`3`}),(0,M.jsx)(`strong`,{children:o(r,`flow.wake.step.voice`)})]})]}),(0,M.jsxs)(`div`,{className:`ritual-button-row ritual-button-row-primary`,children:[(0,M.jsxs)(`button`,{type:`button`,className:`ritual-full-button ritual-full-button-primary`,onClick:e,children:[o(r,`flow.wake.primary`),` `,(0,M.jsx)(u,{size:18})]}),(0,M.jsx)(`button`,{type:`button`,className:`ritual-secondary-button`,onClick:n,children:o(r,`flow.wake.existing`)})]}),(0,M.jsx)(`div`,{className:`ritual-start-note`,children:o(r,`flow.wake.startNote`)})]})}function $(e){g(),e()}function ce(e){return e===`wake`?`idle`:e===`analysis`?`listening`:e===`recommend`?`recalling`:e===`install`?`thinking`:`idle`}export{oe as ProductFlow};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{S as e,_ as t,b as n,d as r,g as i,m as a,o,y as s}from"./utils-
|
|
1
|
+
import{S as e,_ as t,b as n,d as r,g as i,m as a,o,y as s}from"./utils-KFFdVG_t.js";import{r as c}from"./useQuery-Bv3ejLL5.js";import{t as l}from"./workspace-wdCvdyPF.js";import{a as u,t as d,v as f}from"./primitives-BuSMEJY8.js";import{t as p}from"./input-DFhSjmLS.js";import{d as m}from"./index-DDV2YZwM.js";import{t as h}from"./button-CCB9Kuw7.js";var g=i(`file-exclamation-point`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),_=i(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),v=e(n()),y=400,b=40,x=400;function S(e){return new TextEncoder().encode(e).length}async function C(e){let t=globalThis.crypto?.subtle;if(!t)return``;let n=await t.digest(`SHA-256`,new TextEncoder().encode(e));return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function w(e,t,n){let r=[`--- a/${n}`,`+++ b/${n}`],i=e.length?e.split(`
|
|
2
2
|
`):[],a=t.length?t.split(`
|
|
3
3
|
`):[];if(i.length>x||a.length>x)return[...r,...i.map(e=>`-${e}`),...a.map(e=>`+${e}`)].slice(0,y);let o=i.length,s=a.length,c=Array.from({length:o+1},()=>new Uint32Array(s+1));for(let e=o-1;e>=0;--e)for(let t=s-1;t>=0;--t)c[e][t]=i[e]===a[t]?c[e+1][t+1]+1:Math.max(c[e+1][t],c[e][t+1]);let l=[],u=0,d=0;for(;u<o&&d<s;)i[u]===a[d]?(u+=1,d+=1):c[u+1][d]>=c[u][d+1]?(l.push(`-${i[u]}`),u+=1):(l.push(`+${a[d]}`),d+=1);for(;u<o;)l.push(`-${i[u++]}`);for(;d<s;)l.push(`+${a[d++]}`);return l.length?[...r,...l].slice(0,y):[]}async function T(e){let t=await r.proposalDetail(e);if(!t.ok)throw Error(t.error||`HTTP ${t.status}`);let n=t.data,i=o(n.payload)?n.payload:{},a=typeof i.path==`string`?i.path:``,s=typeof n.kind==`string`&&n.kind?n.kind:`file_update`;if(!a)throw Error(`proposal payload has no path`);let c=typeof i.new_content==`string`?i.new_content:``,l=await r.readWorkspaceFile(a);if(!l.ok&&l.status!==404)throw Error(l.error||`HTTP ${l.status}`);let u=l.ok,d=l.ok?l.data.content:``;if(s===`file_update`&&u&&d===c)return await r.rejectProposal(e,`rebase: content already applied`),`already_applied`;if(s===`file_delete`&&!u)return await r.rejectProposal(e,`rebase: file already deleted`),`already_applied`;let f=s===`file_delete`?``:c,p=w(d,f,a),m=u?await C(d):``,h=await r.createReviewItem({title:typeof n.title==`string`&&n.title?n.title:a,summary:typeof n.summary==`string`?n.summary:``,source:`change_proposal`,kind:s,payload:{path:a,diff:p,...s===`file_delete`?{}:{new_content:c},tier:s===`file_delete`?`large`:p.length<=b?`small`:`large`,before_bytes:S(d),after_bytes:S(f),...m||!u?{base_exists:u,base_sha256:m}:{}},provenance:{proposed_by:`user_rebase`,reason:`rebased_from:${e}`,source_detail:`proposal_conflict_rebase`}});if(!h.ok)throw Error(h.error||`HTTP ${h.status}`);let g=String(h.data.id||``);return await r.rejectProposal(e,g?`rebased_to:${g}`:`rebased`),`rebased`}var E=s();function D({language:e,itemId:t,onResolved:n}){let r=c(),[i,o]=v.useState(null),s=l({mutationFn:()=>T(t),onSuccess:async e=>{o(e),await Promise.all([r.invalidateQueries({queryKey:[`pendingProposals`]}),r.invalidateQueries({queryKey:[`proposalCounts`]}),r.invalidateQueries({queryKey:[`automationReviews`]}),r.invalidateQueries({queryKey:[`reviewItems`]})]),n?.(e)}});return(0,E.jsxs)(`div`,{className:`proposal-conflict-note`,role:`alert`,"data-testid":`proposal-conflict-note`,children:[(0,E.jsxs)(`div`,{className:`proposal-conflict-head`,children:[(0,E.jsx)(g,{className:`h-4 w-4`,"aria-hidden":`true`}),(0,E.jsx)(`strong`,{children:a(e,`proposals.conflict.title`)})]}),(0,E.jsx)(`p`,{children:a(e,`proposals.conflict.detail`)}),i===`rebased`?(0,E.jsx)(`p`,{className:`proposal-conflict-done`,role:`status`,children:a(e,`proposals.conflict.rebased`)}):i===`already_applied`?(0,E.jsx)(`p`,{className:`proposal-conflict-done`,role:`status`,children:a(e,`proposals.conflict.alreadyApplied`)}):(0,E.jsxs)(`button`,{type:`button`,className:`proposal-conflict-rebase`,disabled:s.isPending,onClick:()=>s.mutate(),children:[(0,E.jsx)(m,{className:`h-3.5 w-3.5`,"aria-hidden":`true`}),s.isPending?a(e,`proposals.conflict.rebasing`):a(e,`proposals.conflict.rebase`)]}),s.isError?(0,E.jsx)(`small`,{className:`proposal-conflict-error`,children:a(e,`proposals.conflict.failed`,{reason:s.error instanceof Error?s.error.message:String(s.error)})}):null]})}var O=[{id:`pending`,labelKey:`review.filter.status.pending`},{id:`snoozed`,labelKey:`review.filter.status.snoozed`},{id:`all`,labelKey:`review.filter.status.all`},{id:`approved`,labelKey:`review.filter.status.approved`},{id:`dismissed`,labelKey:`review.filter.status.dismissed`}],k=[{id:`all`,labelKey:`review.filter.source.all`},{id:`workflow_run`,labelKey:`review.filter.source.workflow_run`},{id:`trigger`,labelKey:`review.filter.source.trigger`},{id:`kg_change_digest`,labelKey:`review.filter.source.kg_change_digest`},{id:`chat_followup`,labelKey:`review.filter.source.chat_followup`},{id:`agent_followup`,labelKey:`review.filter.source.agent_followup`},{id:`change_proposal`,labelKey:`review.filter.source.change_proposal`}];function A(e){return e===`pending`?`warning`:e===`snoozed`?`muted`:e===`approved`?`success`:e===`dismissed`?`danger`:`muted`}var j={pending:`review.itemStatus.pending`,snoozed:`review.itemStatus.snoozed`,approved:`review.itemStatus.approved`,dismissed:`review.itemStatus.dismissed`};function M(e,t){let n=j[t];return n?a(e,n):t}var N={workflow_run:`review.source.workflow_run`,trigger:`review.source.trigger`,kg_change_digest:`review.source.kg_change_digest`,chat_followup:`review.source.chat_followup`,agent_followup:`review.source.agent_followup`,change_proposal:`review.source.change_proposal`};function P(e,t){let n=t?N[t]:void 0;return n?a(e,n):t||a(e,`review.source.automation`)}function F(e,t,n){let r=t.source_detail;if(r!=null&&String(r).trim())return String(r);let i=t.trigger_id;return i!=null&&String(i).trim()?String(i):P(e,n)}var I={read:`review.risk.read`,write:`review.risk.write`,write_scoped:`review.risk.write_scoped`,exec:`review.risk.exec`,destructive:`review.risk.destructive`};function L(e,t){let n=typeof t==`string`?t.trim():``;if(!n)return``;let r=I[n];return r?a(e,r):n}var R={read:`review.change.read`,additive:`review.change.additive`,mutation:`review.change.mutation`,destructive:`review.change.destructive`,exec:`review.change.exec`};function z(e,t){let n=typeof t==`string`?t.trim():``;if(!n)return``;let r=R[n];return r?a(e,r):n}function B(){let e=new Date;return e.setDate(e.getDate()+1),e.toISOString()}function V(e,t){if(!t)return a(e,`review.snoozed.badge`);let n=new Date(t);return Number.isNaN(n.getTime())?a(e,`review.snoozed.until`,{value:t}):a(e,`review.snoozed.until`,{value:new Intl.DateTimeFormat(e===`ko`?`ko-KR`:`en-US`,{dateStyle:`medium`,timeStyle:`short`}).format(n)})}function H(e){return e.effective_status===`pending`||e.effective_status===`snoozed`}function U(e){let t=e.payload||{},n=e.provenance||{};return!!(t.last_run_id||n.run_id)}var W=24;function G({language:e,diff:t,path:n,className:r=``}){if(!t.length)return null;let i=t.slice(0,W),o=t.length-i.length;return(0,E.jsxs)(`figure`,{className:`m-0 grid gap-1 ${r}`,children:[(0,E.jsxs)(`figcaption`,{className:`flex flex-wrap items-baseline gap-2 text-xs text-muted-foreground`,children:[(0,E.jsx)(`strong`,{className:`font-medium text-foreground`,children:a(e,`proposals.diff.header`)}),n?(0,E.jsx)(`code`,{className:`break-all`,children:n}):null]}),(0,E.jsx)(`pre`,{className:`pending-proposal-diff`,"aria-label":a(e,`proposals.diff`),children:i.map((e,t)=>(0,E.jsx)(`span`,{className:`block ${K(e)}`,children:e||` `},t))}),o>0?(0,E.jsx)(`small`,{className:`text-xs text-muted-foreground`,children:a(e,`proposals.diff.more`,{count:o})}):null]})}function K(e){return/^\+(?!\+\+)/.test(e)?`text-success`:/^-(?!--)/.test(e)?`text-destructive`:``}function q({item:e,feedback:n,onAction:r}){let i=t(e=>e.mode),o=t(e=>e.language),[s,c]=v.useState(``),l=e.provenance||{},g=e.payload||{},_=U(e),y=e.effective_status===`snoozed`,b=H(e),x=e.source===`change_proposal`,S=e.source!==`chat_followup`&&e.source!==`agent_followup`&&!x,C=Array.isArray(g.diff)?g.diff:[],w=String(g.tier||`small`),T=typeof g.path==`string`&&g.path.trim()?g.path:void 0,O=L(o,l.risk),k=z(o,l.change_class),j=typeof l.tool==`string`&&l.tool.trim()?l.tool:``,N=typeof l.proposed_by==`string`&&l.proposed_by.trim()?l.proposed_by:``;return(0,E.jsxs)(`div`,{className:`rounded-lg border border-border bg-background/55 p-4`,children:[(0,E.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`div`,{className:`font-medium`,children:e.title}),e.summary?(0,E.jsx)(`p`,{className:`mt-1 text-sm leading-6 text-muted-foreground`,children:e.summary}):null]}),(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,E.jsx)(f,{variant:`muted`,children:P(o,e.source)}),x?(0,E.jsx)(f,{variant:`muted`,children:a(o,e.kind===`file_delete`?`proposals.kind.delete`:w===`large`?`proposals.tier.large`:`proposals.tier.small`)}):null,(0,E.jsx)(f,{variant:A(e.effective_status),children:M(o,e.effective_status)})]})]}),x&&C.length>0?(0,E.jsx)(G,{language:o,diff:C,path:T,className:`mt-3`}):null,y?(0,E.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center justify-between gap-3 rounded-md border border-border bg-muted/24 p-3 text-sm`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(`div`,{className:`font-medium`,children:V(o,e.snoozed_until)}),(0,E.jsx)(`p`,{className:`mt-1 text-muted-foreground`,children:a(o,`review.snoozed.detail`)})]}),(0,E.jsxs)(h,{size:`sm`,variant:`outline`,onClick:()=>r(e,`unsnooze`),disabled:!b,children:[(0,E.jsx)(m,{className:`h-3.5 w-3.5`}),` `,a(o,`review.unsnooze`)]})]}):null,O||k||j||N?(0,E.jsxs)(`div`,{className:`mt-3 grid gap-2`,children:[k||O?(0,E.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[k?(0,E.jsx)(f,{variant:`muted`,children:k}):null,O?(0,E.jsx)(f,{variant:`muted`,children:O}):null]}):null,j?(0,E.jsxs)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`font-medium text-foreground`,children:a(o,`review.summary.tool`)}),` · `,j]}):null,N?(0,E.jsxs)(`p`,{className:`m-0 text-sm text-muted-foreground`,children:[(0,E.jsx)(`span`,{className:`font-medium text-foreground`,children:a(o,`review.summary.proposedBy`)}),` · `,N]}):null]}):null,i===`basic`?null:(0,E.jsxs)(`details`,{className:`mt-3 rounded-md border border-border`,children:[(0,E.jsx)(`summary`,{className:`cursor-pointer select-none p-3 text-sm font-medium text-muted-foreground`,children:a(o,`review.technical.title`)}),(0,E.jsx)(`div`,{className:`p-3 pt-0`,children:(0,E.jsx)(u,{data:{workflow:l.workflow_id,trigger:l.trigger_id,run:g.last_run_id||l.run_id,...x?{path:g.path}:{},source_detail:F(o,l,e.source),snoozed_until:e.snoozed_until,created_at:e.created_at,updated_at:e.updated_at},limit:x?12:8})})]}),b?(0,E.jsxs)(`div`,{className:`mt-4 grid gap-2`,children:[(0,E.jsx)(`p`,{className:`text-xs leading-5 text-muted-foreground`,children:a(o,S?`review.runNow.detail`:x?`review.proposal.detail`:e.source===`agent_followup`?`review.agent.detail`:`review.chat.detail`)}),x?(0,E.jsx)(p,{value:s,onChange:e=>c(e.target.value),placeholder:a(o,`review.proposal.rejectReason`),"aria-label":a(o,`review.proposal.rejectReason`)}):null,(0,E.jsxs)(`div`,{className:`flex flex-wrap gap-2`,"aria-label":a(o,`review.actions.aria`),children:[S?(0,E.jsx)(d,{label:a(o,`review.runNow`),successLabel:_?a(o,`review.regenerated`):a(o,`review.executed`),action:()=>r(e,`run_now`,_),invalidate:[]}):null,(0,E.jsx)(d,{label:a(o,x?`proposals.approve`:`review.approve`),action:()=>r(e,`approve`),invalidate:[]}),y?null:(0,E.jsx)(d,{label:a(o,`review.snoozeDay`),action:()=>r(e,`snooze`),invalidate:[]}),(0,E.jsx)(d,{label:a(o,x?`proposals.reject`:`review.dismiss`),action:()=>r(e,`dismiss`,!1,x?s:void 0),invalidate:[],variant:`destructive`})]})]}):null,n?.conflict&&x?(0,E.jsx)(D,{language:o,itemId:e.id}):n?(0,E.jsxs)(`p`,{className:`mt-2 text-xs ${n.tone===`error`?`text-warning`:`text-success`}`,children:[n.message,` - `,a(o,`review.feedback.open`),n.detail&&n.detail!==n.message?(0,E.jsx)(`span`,{className:`mt-0.5 block text-[11px] opacity-75`,children:n.detail}):null]}):null]})}export{O as a,k as i,q as n,D as o,B as r,_ as s,G as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,_ as t,b as n,c as r,d as i,g as a,m as o,o as s,t as c,y as l}from"./utils-KFFdVG_t.js";import{r as u,t as d}from"./useQuery-Bv3ejLL5.js";import{t as f}from"./workspace-wdCvdyPF.js";import{_ as p,a as m,c as h,d as g,g as _,h as v,i as y,l as b,m as x,n as S,p as C,r as w,s as T,t as E,u as D,v as O}from"./primitives-BuSMEJY8.js";import{t as k}from"./input-DFhSjmLS.js";import{t as A}from"./network-Bts7VO94.js";import{t as j}from"./shield-alert-BfTO6X_G.js";import{t as M}from"./users-CsNqLZAj.js";import{g as N,i as P,l as F,t as I}from"./index-DDV2YZwM.js";import{t as L}from"./button-CCB9Kuw7.js";var R=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),z=e(n()),B=l(),V={low:`success`,medium:`warning`,high:`danger`};function ee(e,t){return t===`ko`&&e.label_ko||e.label}function H(e,t){return t===`ko`&&e.summary_ko||e.summary}function te(e,t){return t===`ko`&&e.warning_ko||e.warning||``}function ne(){let e=u(),n=t(e=>e.language),[r,a]=z.useState(null),[s,c]=z.useState(!1),[l,m]=z.useState(``),h=d({queryKey:[`networkBoundary`],queryFn:i.networkBoundary}),g=f({mutationFn:e=>i.setNetworkBoundary(e.mode,e.ack),onSuccess:t=>{t.ok&&(e.invalidateQueries({queryKey:[`networkBoundary`]}),a(null),c(!1))}}),y=f({mutationFn:e=>i.setHybridPolicy(e),onSuccess:()=>e.invalidateQueries({queryKey:[`networkBoundary`]})}),b=f({mutationFn:e=>i.previewCloudContext(e)}),[S,T]=z.useState([]),E=f({mutationFn:e=>i.setNodeSensitivity(e.nodeId,e.localOnly),onSuccess:(e,t)=>{e.ok&&T(e=>t.localOnly?[...e,t.nodeId]:e.filter(e=>e!==t.nodeId))}}),D=h.data?.ok?h.data.data:void 0,k=D?.catalog??[],A=D?.mode??``,M=r??A,N=k.find(e=>e.id===M),P=!!N?.requires_ack&&M!==A,F=P&&!s,I=M===A,ne=D?.policy??{},U=b.data?.ok?b.data.data:void 0;return h.isLoading?(0,B.jsxs)(C,{children:[(0,B.jsx)(_,{children:(0,B.jsx)(p,{children:o(n,`system.network.title`)})}),(0,B.jsx)(x,{children:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(n,`ui.loading`)})})]}):!D||k.length===0?(0,B.jsxs)(C,{children:[(0,B.jsx)(_,{children:(0,B.jsx)(p,{children:o(n,`system.network.title`)})}),(0,B.jsx)(x,{children:(0,B.jsx)(w,{title:o(n,`ui.requestUnavailable`),detail:h.data?.error})})]}):(0,B.jsxs)(C,{"data-testid":`network-boundary-panel`,children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(p,{className:`flex items-center gap-2`,children:[(0,B.jsx)(R,{className:`h-4 w-4`,"aria-hidden":`true`}),o(n,`system.network.title`)]}),(0,B.jsx)(v,{children:o(n,`system.network.hint`)})]}),(0,B.jsxs)(x,{className:`space-y-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[o(n,`system.network.current`),`:`,` `,(0,B.jsx)(`strong`,{"data-testid":`network-boundary-active`,children:n===`ko`&&D.label_ko||D.label})]}),(0,B.jsx)(`div`,{className:`space-y-2`,role:`radiogroup`,"aria-label":o(n,`system.network.title`),children:k.map(e=>{let t=e.id===M;return(0,B.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,"data-testid":`network-boundary-option-${e.id}`,onClick:()=>{a(e.id),c(!1),g.reset()},className:`w-full rounded-md border p-3 text-left transition ${t?`border-primary bg-accent`:`border-border hover:bg-accent/50`}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`strong`,{className:`text-sm`,children:ee(e,n)}),(0,B.jsx)(O,{variant:V[e.risk]||`warning`,children:o(n,`system.permission.risk.${e.risk}`)}),e.id===A?(0,B.jsx)(O,{variant:`muted`,children:o(n,`system.network.current`)}):null]}),(0,B.jsx)(`p`,{className:`mt-1 block text-xs text-muted-foreground`,children:H(e,n)})]},e.id)})}),P?(0,B.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border bg-muted p-3`,children:[(0,B.jsxs)(`p`,{className:`flex items-start gap-2 text-xs`,children:[(0,B.jsx)(j,{className:`mt-0.5 h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,B.jsx)(`span`,{children:N?te(N,n):``})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,B.jsx)(`input`,{type:`checkbox`,"data-testid":`network-boundary-ack`,checked:s,onChange:e=>c(e.target.checked)}),o(n,`system.network.ack`)]})]}):null,(0,B.jsx)(L,{"data-testid":`network-boundary-apply`,disabled:I||F||g.isPending,onClick:()=>g.mutate({mode:M,ack:s}),children:o(n,`system.network.apply`)}),g.data&&!g.data.ok?(0,B.jsx)(w,{title:o(n,`ui.requestUnavailable`),detail:g.data.error}):null,g.data?.ok?(0,B.jsx)(O,{variant:`success`,"data-testid":`network-boundary-applied`,children:o(n,`ui.requestCompleted`)}):null,(0,B.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border p-3`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium`,children:o(n,`system.network.preview.title`)}),(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(n,`system.network.preview.hint`)}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(`input`,{type:`text`,"data-testid":`network-boundary-probe`,value:l,onChange:e=>m(e.target.value),placeholder:o(n,`system.network.preview.placeholder`),className:`min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-1 text-xs`}),(0,B.jsx)(L,{variant:`outline`,"data-testid":`network-boundary-preview`,disabled:!l.trim()||b.isPending,onClick:()=>b.mutate(l.trim()),children:o(n,`system.network.preview.run`)})]}),U?(0,B.jsxs)(`div`,{className:`space-y-1`,"data-testid":`network-boundary-preview-result`,children:[U.allows_cloud?null:(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(n,`system.network.preview.localOnly`)}),U.would_block?(0,B.jsx)(O,{variant:`danger`,children:o(n,`system.network.preview.blocked`)}):null,U.titles.length===0?(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(n,`system.network.preview.empty`)}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[o(n,`system.network.preview.count`,{count:U.titles.length}),` · `,o(n,`system.network.preview.tokens`,{tokens:U.token_estimate})]}),(0,B.jsx)(`ul`,{className:`space-y-0.5`,children:U.titles.map((e,t)=>{let r=U.node_ids[t],i=r?S.includes(r):!1;return(0,B.jsxs)(`li`,{className:`flex items-start justify-between gap-2 text-xs`,children:[(0,B.jsxs)(`span`,{className:i?`line-through opacity-60`:void 0,children:[`· `,e]}),r?(0,B.jsx)(`button`,{type:`button`,"data-testid":`network-boundary-hold-${t}`,className:`shrink-0 underline underline-offset-2 opacity-80 hover:opacity-100`,disabled:E.isPending,onClick:()=>E.mutate({nodeId:r,localOnly:!i}),children:o(n,i?`system.network.preview.release`:`system.network.preview.hold`)}):null]},`${r||e}-${t}`)})})]})]}):null,b.data&&!b.data.ok?(0,B.jsx)(w,{title:o(n,`ui.requestUnavailable`),detail:b.data.error}):null]}),D.allows_cloud?(0,B.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border p-3`,"data-testid":`network-boundary-policy`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium`,children:o(n,`system.network.policy.title`)}),(0,B.jsxs)(`label`,{className:`flex items-start gap-2 text-xs`,children:[(0,B.jsx)(`input`,{type:`checkbox`,"data-testid":`network-boundary-auto-commit`,checked:!!ne.auto_commit,disabled:y.isPending,onChange:e=>y.mutate({auto_commit:e.target.checked})}),(0,B.jsxs)(`span`,{children:[o(n,`system.network.policy.autoCommit`),(0,B.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:o(n,`system.network.policy.autoCommitHint`)})]})]}),(0,B.jsxs)(`label`,{className:`flex items-start gap-2 text-xs`,children:[(0,B.jsx)(`input`,{type:`checkbox`,"data-testid":`network-boundary-multimodal`,checked:!!ne.allow_multimodal,disabled:y.isPending,onChange:e=>y.mutate({allow_multimodal:e.target.checked})}),(0,B.jsxs)(`span`,{children:[o(n,`system.network.policy.multimodal`),(0,B.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground`,children:o(n,`system.network.policy.multimodalHint`)})]})]})]}):null,(0,B.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium`,children:o(n,`system.network.guards`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(n,`system.network.guards.detail`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(n,`system.network.preview.autoHeld`)})]})]})]})}var U={low:`success`,medium:`warning`,high:`danger`};function re(e,t){return t===`ko`&&e.label_ko||e.label}function W(e,t){return t===`ko`&&e.summary_ko||e.summary}function G(e,t){return t===`ko`&&e.warning_ko||e.warning||``}function ie(){let e=u(),n=t(e=>e.language),[r,a]=z.useState(null),[s,c]=z.useState(!1),l=d({queryKey:[`permissionMode`],queryFn:i.permissionMode}),m=f({mutationFn:e=>i.setPermissionMode(e.mode,e.ack),onSuccess:t=>{t.ok&&(e.invalidateQueries({queryKey:[`permissionMode`]}),a(null),c(!1))}}),h=l.data?.ok?l.data.data:void 0,g=h?.catalog??[],y=h?.mode??``,b=r??y,S=g.find(e=>e.id===b),T=!!S?.requires_ack&&b!==y,E=T&&!s,D=b===y;return l.isLoading?(0,B.jsxs)(C,{children:[(0,B.jsx)(_,{children:(0,B.jsx)(p,{children:o(n,`system.permission.title`)})}),(0,B.jsx)(x,{children:(0,B.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:o(n,`ui.loading`)})})]}):!h||g.length===0?(0,B.jsxs)(C,{children:[(0,B.jsx)(_,{children:(0,B.jsx)(p,{children:o(n,`system.permission.title`)})}),(0,B.jsx)(x,{children:(0,B.jsx)(w,{title:o(n,`ui.requestUnavailable`),detail:l.data?.error})})]}):(0,B.jsxs)(C,{"data-testid":`permission-mode-panel`,children:[(0,B.jsxs)(_,{children:[(0,B.jsx)(p,{children:o(n,`system.permission.title`)}),(0,B.jsx)(v,{children:o(n,`system.permission.hint`)})]}),(0,B.jsxs)(x,{className:`space-y-3`,children:[(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[o(n,`system.permission.current`),`:`,` `,(0,B.jsx)(`strong`,{"data-testid":`permission-mode-active`,children:n===`ko`&&h.label_ko||h.label})]}),(0,B.jsx)(`div`,{className:`space-y-2`,role:`radiogroup`,"aria-label":o(n,`system.permission.title`),children:g.map(e=>{let t=e.id===b;return(0,B.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,"data-testid":`permission-mode-option-${e.id}`,onClick:()=>{a(e.id),c(!1),m.reset()},className:`w-full rounded-md border p-3 text-left transition ${t?`border-primary bg-accent`:`border-border hover:bg-accent/50`}`,children:[(0,B.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(`strong`,{className:`text-sm`,children:re(e,n)}),(0,B.jsx)(O,{variant:U[e.risk]||`warning`,children:o(n,`system.permission.risk.${e.risk}`)}),e.id===y?(0,B.jsx)(O,{variant:`muted`,children:o(n,`system.permission.current`)}):null]}),(0,B.jsx)(`p`,{className:`mt-1 block text-xs text-muted-foreground`,children:W(e,n)})]},e.id)})}),T?(0,B.jsxs)(`div`,{className:`space-y-2 rounded-md border border-border bg-muted p-3`,children:[(0,B.jsxs)(`p`,{className:`flex items-start gap-2 text-xs`,children:[(0,B.jsx)(j,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,B.jsx)(`span`,{children:S?G(S,n):``})]}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 text-xs`,children:[(0,B.jsx)(`input`,{type:`checkbox`,"data-testid":`permission-mode-ack`,checked:s,onChange:e=>c(e.target.checked)}),o(n,`system.permission.ack`)]})]}):null,(0,B.jsx)(L,{"data-testid":`permission-mode-apply`,disabled:D||E||m.isPending,onClick:()=>m.mutate({mode:b,ack:s}),children:o(n,`system.permission.apply`)}),m.data&&!m.data.ok?(0,B.jsx)(w,{title:o(n,`ui.requestUnavailable`),detail:m.data.error}):null,m.data?.ok?(0,B.jsx)(O,{variant:`success`,"data-testid":`permission-mode-applied`,children:o(n,`ui.requestCompleted`)}):null,(0,B.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,B.jsx)(`p`,{className:`text-xs font-medium`,children:o(n,`system.permission.guards`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:o(n,`system.permission.guards.detail`)})]})]})]})}var K=[{id:`account`,labelKey:`system.tab.account`},{id:`workspaces`,labelKey:`system.tab.workspaces`},{id:`snapshots`,labelKey:`system.tab.snapshots`},{id:`activity`,labelKey:`system.tab.activity`},{id:`network`,labelKey:`system.tab.network`},{id:`settings`,labelKey:`system.tab.settings`},{id:`admin`,labelKey:`system.tab.admin`}];function q({initialTab:e}){let n=t(e=>e.mode),r=t(e=>e.language),[i,a]=z.useState(e||`account`);z.useEffect(()=>{K.some(t=>t.id===e)&&a(e)},[e]);let s=e=>{a(e),P(`/`+{account:`account`,workspaces:`workspace-admin`,snapshots:`snapshots`,activity:`activity`,network:`network`,settings:`settings`,admin:`system-admin`}[e])};return(0,B.jsxs)(`div`,{className:`product-page settings-page space-y-5`,children:[(0,B.jsxs)(`header`,{className:`page-hero`,children:[(0,B.jsxs)(`div`,{className:`page-kicker`,children:[(0,B.jsx)(F,{className:`h-4 w-4`}),` `,o(r,`system.kicker`)]}),(0,B.jsx)(`h1`,{className:`page-title`,children:o(r,`system.title`)}),(0,B.jsx)(`p`,{className:`page-copy`,children:o(r,`system.body`)})]}),(0,B.jsx)(g,{tabs:(n===`basic`?K.filter(e=>e.id===`account`||e.id===`workspaces`||e.id===`snapshots`||e.id===`settings`):K).map(e=>({id:e.id,label:o(r,e.labelKey)})),value:i,onChange:e=>s(e)}),i===`account`?(0,B.jsx)(J,{}):null,i===`workspaces`?(0,B.jsx)(Y,{}):null,i===`snapshots`?(0,B.jsx)(X,{}):null,i===`activity`?(0,B.jsx)(Z,{}):null,i===`network`?(0,B.jsx)(ae,{}):null,i===`settings`?(0,B.jsx)(oe,{}):null,i===`admin`?(0,B.jsx)(me,{}):null]})}function J(){let e=u(),n=t(e=>e.language),r=t(e=>e.setWorkspaceId),a=d({queryKey:[`profile`],queryFn:i.profile}),s=d({queryKey:[`sso`],queryFn:i.ssoConfig}),[c,l]=z.useState(``),[g,y]=z.useState(``),[b,w]=z.useState(``),[T,O]=z.useState(``),[A,j]=z.useState(``),M=e=>{e.ok&&(I(),r(null))},P=f({mutationFn:()=>i.login(c,g),onSuccess:M}),F=f({mutationFn:()=>i.register({email:c,password:g,name:b,nickname:T}),onSuccess:M}),R=f({mutationFn:()=>i.updateProfile({name:b,nickname:T}),onSuccess:()=>e.invalidateQueries({queryKey:[`profile`]})}),V=f({mutationFn:()=>i.changePassword(g,A)});return(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,B.jsx)(S,{title:o(n,`system.account.profile`),result:a.data,children:e=>(0,B.jsx)(m,{data:e})}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(p,{className:`flex items-center gap-2`,children:[(0,B.jsx)(N,{className:`h-4 w-4`}),` `,o(n,`system.account.title`)]}),(0,B.jsx)(v,{children:o(n,`system.account.detail`)})]}),(0,B.jsxs)(x,{className:`grid gap-3`,children:[(0,B.jsx)(k,{value:c,onChange:e=>l(e.target.value),placeholder:o(n,`system.account.email`)}),(0,B.jsx)(k,{type:`password`,value:g,onChange:e=>y(e.target.value),placeholder:o(n,`system.account.password`)}),(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,B.jsx)(k,{value:b,onChange:e=>w(e.target.value),placeholder:o(n,`system.account.name`)}),(0,B.jsx)(k,{value:T,onChange:e=>O(e.target.value),placeholder:o(n,`system.account.nickname`)})]}),(0,B.jsx)(k,{type:`password`,value:A,onChange:e=>j(e.target.value),placeholder:o(n,`system.account.newPassword`)}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(L,{onClick:()=>P.mutate(),disabled:!c||!g||P.isPending,children:o(n,`system.account.login`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>F.mutate(),disabled:!c||!g||F.isPending,children:o(n,`system.account.register`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>R.mutate(),disabled:R.isPending,children:o(n,`system.account.save`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>V.mutate(),disabled:!g||!A||V.isPending,children:o(n,`system.account.changePassword`)}),(0,B.jsx)(E,{label:o(n,`system.account.logout`),action:()=>i.logout(),onSuccess:M})]}),[P.data,F.data,R.data,V.data].filter(Boolean).map((e,t)=>(0,B.jsx)(h,{result:e,successLabel:o(n,`system.account.requestDone`)},t))]})]}),(0,B.jsx)(S,{title:o(n,`system.account.signInOptions`),result:s.data,className:`xl:col-span-2`,children:e=>(0,B.jsx)(D,{value:e})})]})}function Y(){let e=u(),n=t(e=>e.language),{setWorkspaceId:r}=t(),a=d({queryKey:[`workspaceRegistry`],queryFn:i.workspaceRegistry}),s=d({queryKey:[`invitations`],queryFn:i.invitations}),[l,m]=z.useState(``),[h,g]=z.useState(``),[b,w]=z.useState(``),T=f({mutationFn:()=>i.createOrg(l),onSuccess:()=>e.invalidateQueries({queryKey:[`workspaceRegistry`]})}),D=f({mutationFn:()=>i.createInvitation({email:h||null,role:`member`,expires_hours:168}),onSuccess:()=>e.invalidateQueries({queryKey:[`invitations`]})}),O=f({mutationFn:()=>i.acceptInvitation(b),onSuccess:()=>e.invalidateQueries({queryKey:[`workspaceRegistry`]})}),A=c(a.data?.data?.workspaces);return(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.1fr_0.9fr]`,children:[(0,B.jsx)(S,{title:o(n,`system.workspace.yours`),result:a.data,children:()=>(0,B.jsx)(`div`,{className:`grid gap-2`,children:A.map(e=>{let t=String(e.workspace_id||e.id);return(0,B.jsx)(`div`,{className:`rounded-md border border-border p-3`,children:(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.name||t)}),(0,B.jsxs)(`div`,{className:`text-sm text-muted-foreground`,children:[String(e.type||``),` · `,String(e.your_role||e.role||``)]})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(L,{variant:`outline`,onClick:()=>r(t),children:o(n,`system.workspace.use`)}),(0,B.jsx)(E,{label:o(n,`system.workspace.activate`),action:()=>i.activateWorkspace(t),invalidate:[`workspaceRegistry`]}),(0,B.jsx)(E,{label:o(n,`system.workspace.archive`),action:()=>i.archiveWorkspace(t),invalidate:[`workspaceRegistry`],variant:`destructive`})]})]})},t)})})}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(p,{className:`flex items-center gap-2`,children:[(0,B.jsx)(M,{className:`h-4 w-4`}),` `,o(n,`system.workspace.organizations`)]}),(0,B.jsx)(v,{children:o(n,`system.workspace.organizationsHint`)})]}),(0,B.jsxs)(x,{className:`grid gap-3`,children:[(0,B.jsx)(k,{value:l,onChange:e=>m(e.target.value),placeholder:o(n,`system.workspace.orgPlaceholder`)}),(0,B.jsx)(L,{disabled:!l.trim()||T.isPending,onClick:()=>T.mutate(),children:o(n,`system.workspace.createOrg`)}),(0,B.jsx)(k,{value:h,onChange:e=>g(e.target.value),placeholder:o(n,`system.workspace.inviteeEmail`)}),(0,B.jsx)(L,{variant:`outline`,disabled:D.isPending,onClick:()=>D.mutate(),children:o(n,`system.workspace.createInvite`)}),(0,B.jsx)(k,{value:b,onChange:e=>w(e.target.value),placeholder:o(n,`system.workspace.inviteToken`)}),(0,B.jsx)(L,{variant:`outline`,disabled:!b.trim()||O.isPending,onClick:()=>O.mutate(),children:o(n,`system.workspace.acceptInvite`)}),(0,B.jsx)(S,{title:o(n,`system.workspace.invitations`),result:s.data,children:e=>(0,B.jsx)(y,{items:e.invitations,titleKey:`token`,metaKey:`role`})})]})]})]})}function X(){let e=t(e=>e.language),n=d({queryKey:[`snapshots`],queryFn:i.snapshots}),r=d({queryKey:[`timeMachine`],queryFn:i.timeMachine}),[a,s]=z.useState(``),[l,u]=z.useState(``),[m,g]=z.useState(``),b=f({mutationFn:()=>i.createSnapshot(a||o(e,`system.snapshots.defaultName`))}),w=f({mutationFn:()=>i.compareSnapshots(l,m)}),T=c(n.data?.data?.snapshots);return(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,B.jsx)(S,{title:o(e,`system.snapshots.title`),result:n.data,children:()=>(0,B.jsx)(`div`,{className:`space-y-2`,children:T.map(t=>{let n=String(t.id||t.snapshot_id);return(0,B.jsxs)(`div`,{className:`rounded-md border border-border p-3`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(t.name||n)}),(0,B.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-2`,children:[(0,B.jsx)(E,{label:o(e,`system.snapshots.export`),action:()=>i.exportSnapshot(n)}),(0,B.jsx)(E,{label:o(e,`system.snapshots.mergeRestore`),action:()=>i.restoreSnapshot(n),variant:`outline`})]})]},n)})})}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsx)(p,{children:o(e,`system.snapshots.actions`)}),(0,B.jsx)(v,{children:o(e,`system.snapshots.actionsHint`)})]}),(0,B.jsxs)(x,{className:`grid gap-3`,children:[(0,B.jsx)(k,{value:a,onChange:e=>s(e.target.value),placeholder:o(e,`system.snapshots.namePlaceholder`)}),(0,B.jsx)(L,{onClick:()=>b.mutate(),disabled:b.isPending,children:o(e,`system.snapshots.create`)}),(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,B.jsx)(k,{value:l,onChange:e=>u(e.target.value),placeholder:o(e,`system.snapshots.beforeId`)}),(0,B.jsx)(k,{value:m,onChange:e=>g(e.target.value),placeholder:o(e,`system.snapshots.afterId`)})]}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>w.mutate(),disabled:!l||!m||w.isPending,children:o(e,`system.snapshots.compare`)}),w.data?(0,B.jsx)(h,{result:w.data,successLabel:o(e,`system.snapshots.compareDone`)}):null]})]}),(0,B.jsx)(S,{title:o(e,`system.snapshots.timeline`),result:r.data,className:`xl:col-span-2`,children:e=>(0,B.jsx)(y,{items:e.events||e,titleKey:`event`,metaKey:`type`,limit:14})})]})}function Z(){let e=t(e=>e.language),n=d({queryKey:[`realtimeFeed`],queryFn:i.realtimeFeed}),r=d({queryKey:[`presence`],queryFn:i.presence});return(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,B.jsx)(S,{title:o(e,`system.activity.feed`),result:n.data,children:e=>(0,B.jsx)(y,{items:e.events,titleKey:`event_type`,metaKey:`area`,limit:14})}),(0,B.jsx)(S,{title:o(e,`system.activity.presence`),result:r.data,children:e=>(0,B.jsx)(se,{data:e})})]})}function ae(){let e=u(),n=t(e=>e.language),r=d({queryKey:[`networkIdentity`],queryFn:i.networkIdentity}),a=d({queryKey:[`networkPeers`],queryFn:i.networkPeers}),[s,l]=z.useState(``),[m,g]=z.useState(``),[y,b]=z.useState(``),w=f({mutationFn:()=>i.pairPeer({name:s,base_url:m,public_key:y}),onSuccess:()=>e.invalidateQueries({queryKey:[`networkPeers`]})});return(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[0.8fr_1.2fr]`,children:[(0,B.jsx)(S,{title:o(n,`system.network.identity`),result:r.data,children:e=>(0,B.jsx)(ce,{data:e})}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsxs)(p,{className:`flex items-center gap-2`,children:[(0,B.jsx)(A,{className:`h-4 w-4`}),` `,o(n,`system.network.pair`)]}),(0,B.jsx)(v,{children:o(n,`system.network.pairHint`)})]}),(0,B.jsxs)(x,{className:`grid gap-3`,children:[(0,B.jsx)(k,{value:s,onChange:e=>l(e.target.value),placeholder:o(n,`system.network.deviceName`)}),(0,B.jsx)(k,{value:m,onChange:e=>g(e.target.value),placeholder:o(n,`system.network.address`)}),(0,B.jsx)(k,{value:y,onChange:e=>b(e.target.value),placeholder:o(n,`system.network.publicKey`)}),(0,B.jsx)(L,{disabled:!s||!m||!y||w.isPending,onClick:()=>w.mutate(),children:o(n,`system.network.pair`)}),w.data?(0,B.jsx)(h,{result:w.data,successLabel:o(n,`system.network.pairDone`)}):null]})]}),(0,B.jsx)(S,{title:o(n,`system.network.peers`),result:a.data,className:`xl:col-span-2`,children:e=>(0,B.jsx)(`div`,{className:`grid gap-2`,children:c(e.peers).map(e=>{let r=String(e.peer_id||e.id);return(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-md border border-border p-3`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`div`,{className:`font-medium`,children:String(e.name||r)}),(0,B.jsx)(`div`,{className:`text-sm text-muted-foreground`,children:String(e.base_url||``)})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(E,{label:o(n,`system.network.pushWorkspace`),action:()=>i.pushPeer(r,t.getState().workspaceId)}),(0,B.jsx)(E,{label:o(n,`system.network.unpair`),action:()=>i.unpairPeer(r),invalidate:[`networkPeers`],variant:`destructive`})]})]},r)})})})]})}function oe(){let e=u(),{theme:n,setTheme:r,mode:a,setMode:s}=t(),c=t(e=>e.language),l=d({queryKey:[`health`],queryFn:i.health}),m=d({queryKey:[`sysinfo`],queryFn:i.sysinfo}),g=d({queryKey:[`computerMemory`],queryFn:i.computerMemory}),y=d({queryKey:[`brainStorage`],queryFn:i.brainStorage}),w=d({queryKey:[`backupHealth`],queryFn:i.backupHealth}),[T,O]=z.useState(``),[A,j]=z.useState(`lattice_brain`),[M,N]=z.useState(!1),[P,F]=z.useState(``),[I,R]=z.useState(``),[V,ee]=z.useState(``),[H,te]=z.useState(!1),[U,re]=z.useState(!1),W=f({mutationFn:e=>i.dockerPostgres({consent:e,dry_run:!e,port:5432})}),G=f({mutationFn:()=>i.migratePostgres({dsn:T,schema_name:A||`lattice_brain`,dry_run:!0})}),K=f({mutationFn:()=>i.brainArchive({path:P.trim()||null,passphrase:V}),onSuccess:()=>e.invalidateQueries({queryKey:[`backupHealth`]})}),q=f({mutationFn:()=>i.brainArchiveInspect({path:I,passphrase:V||null})}),J=f({mutationFn:()=>i.brainArchiveVerify({path:I,passphrase:V})}),Y=f({mutationFn:()=>i.brainArchiveRestore({path:I,passphrase:V,dry_run:!0,confirm:!1})}),X=f({mutationFn:()=>i.brainArchiveRestore({path:I,passphrase:V,dry_run:!1,confirm:H}),onSuccess:()=>{e.invalidateQueries({queryKey:[`brainStorage`]}),e.invalidateQueries({queryKey:[`backupHealth`]})}}),Z=f({mutationFn:()=>i.brainArchiveImport({path:I,passphrase:V,dry_run:!0,confirm:!1})}),ae=f({mutationFn:()=>i.brainArchiveImport({path:I,passphrase:V,dry_run:!1,confirm:U}),onSuccess:()=>{e.invalidateQueries({queryKey:[`brainStorage`]}),e.invalidateQueries({queryKey:[`backupHealth`]})}});return(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-3`,children:[(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsx)(p,{children:o(c,`system.panel.appearance`)}),(0,B.jsx)(v,{children:o(c,`system.panel.appearance.hint`)})]}),(0,B.jsxs)(x,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(L,{variant:n===`dark`?`default`:`outline`,onClick:()=>r(`dark`),children:o(c,`system.theme.dark`)}),(0,B.jsx)(L,{variant:n===`light`?`default`:`outline`,onClick:()=>r(`light`),children:o(c,`system.theme.light`)})]})]}),(0,B.jsxs)(C,{children:[(0,B.jsxs)(_,{children:[(0,B.jsx)(p,{children:o(c,`system.panel.detailLevel`)}),(0,B.jsx)(v,{children:o(c,`system.panel.detailLevel.hint`)})]}),(0,B.jsx)(x,{className:`flex flex-wrap gap-2`,children:[`basic`,`advanced`,`admin`].map(e=>(0,B.jsx)(L,{variant:a===e?`default`:`outline`,onClick:()=>s(e),children:o(c,`shell.mode.${e}`)},e))})]}),(0,B.jsx)(ie,{}),(0,B.jsx)(ne,{}),(0,B.jsx)(S,{title:a===`basic`?o(c,`system.panel.brainStatus`):o(c,`system.panel.serverHealth`),result:l.data,children:e=>(0,B.jsx)(le,{data:e})}),(0,B.jsx)(S,{title:a===`basic`?o(c,`system.panel.readiness`):o(c,`system.panel.hostTelemetry`),result:m.data,children:e=>a===`basic`?(0,B.jsx)(b,{stats:[{label:o(c,`system.stat.cpu`),value:`${String(e.cpu_pct||`0`)}%`},{label:o(c,`system.stat.memory`),value:`${String(e.ram_pct||`0`)}%`},{label:o(c,`system.stat.gpu`),value:`${String(e.gpu_mem_pct||`0`)}%`},{label:o(c,`system.stat.localStatus`),value:o(c,`system.stat.ready`)}]}):(0,B.jsx)(D,{value:e})}),(0,B.jsx)(S,{title:a===`basic`?o(c,`system.storage.title`):o(c,`system.panel.brainStorage`),result:y.data,className:`xl:col-span-3`,children:e=>(0,B.jsx)(ue,{data:e,mode:a,language:c})}),a===`basic`?null:(0,B.jsx)(S,{title:o(c,`system.backup.health`),result:w.data,className:`xl:col-span-3`,children:e=>(0,B.jsx)(de,{data:e})}),a===`basic`?null:(0,B.jsxs)(C,{className:`xl:col-span-3`,children:[(0,B.jsxs)(_,{children:[(0,B.jsx)(p,{children:o(c,`system.archive.title`)}),(0,B.jsx)(v,{children:o(c,`system.archive.detail`)})]}),(0,B.jsxs)(x,{className:`grid gap-3`,children:[(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_1fr]`,children:[(0,B.jsx)(k,{value:P,onChange:e=>F(e.target.value),placeholder:o(c,`system.archive.exportPath`)}),(0,B.jsx)(k,{value:I,onChange:e=>R(e.target.value),placeholder:o(c,`system.archive.restorePath`)})]}),(0,B.jsx)(k,{type:`password`,value:V,onChange:e=>ee(e.target.value),placeholder:o(c,`system.archive.passphrase`)}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(L,{onClick:()=>K.mutate(),disabled:!V||K.isPending,children:o(c,`system.archive.export`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>q.mutate(),disabled:!I||q.isPending,children:o(c,`system.archive.inspect`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>J.mutate(),disabled:!I||!V||J.isPending,children:o(c,`system.archive.verify`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>Y.mutate(),disabled:!I||!V||Y.isPending,children:o(c,`system.archive.restoreDryRun`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>Z.mutate(),disabled:!I||!V||Z.isPending,children:o(c,`system.archive.importDryRun`)}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:H,onChange:e=>te(e.target.checked)}),o(c,`system.archive.confirmRestore`)]}),(0,B.jsx)(L,{variant:`destructive`,onClick:()=>X.mutate(),disabled:!I||!V||!H||X.isPending,children:o(c,`system.archive.restore`)}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:U,onChange:e=>re(e.target.checked)}),o(c,`system.archive.confirmImport`)]}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>ae.mutate(),disabled:!I||!V||!U||ae.isPending,children:o(c,`system.archive.import`)})]}),[K.data,q.data,J.data,Y.data,X.data,Z.data,ae.data].filter(Boolean).map((e,t)=>(0,B.jsx)(h,{result:e,successLabel:o(c,`system.archive.requestDone`)},t))]})]}),a===`basic`?null:(0,B.jsxs)(C,{className:`xl:col-span-3`,children:[(0,B.jsxs)(_,{children:[(0,B.jsx)(p,{children:o(c,`system.scale.title`)}),(0,B.jsx)(v,{children:o(c,`system.scale.detail`)})]}),(0,B.jsxs)(x,{className:`grid gap-3`,children:[(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-[1fr_220px]`,children:[(0,B.jsx)(k,{value:T,onChange:e=>O(e.target.value),placeholder:o(c,`system.scale.dsn`)}),(0,B.jsx)(k,{value:A,onChange:e=>j(e.target.value),placeholder:o(c,`system.scale.schema`)})]}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(L,{variant:`outline`,onClick:()=>W.mutate(!1),disabled:W.isPending,children:o(c,`system.scale.dockerPlan`)}),(0,B.jsxs)(`label`,{className:`flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm`,children:[(0,B.jsx)(`input`,{type:`checkbox`,checked:M,onChange:e=>N(e.target.checked)}),o(c,`system.scale.dockerConsent`)]}),(0,B.jsx)(L,{onClick:()=>W.mutate(!0),disabled:!M||W.isPending,children:o(c,`system.scale.dockerStart`)}),(0,B.jsx)(L,{variant:`outline`,onClick:()=>G.mutate(),disabled:!T||G.isPending,children:o(c,`system.scale.migrationPlan`)})]}),W.data?(0,B.jsx)(h,{result:W.data,successLabel:o(c,`system.scale.dockerDone`)}):null,G.data?(0,B.jsx)(h,{result:G.data,successLabel:o(c,`system.scale.migrationDone`)}):null]})]}),a===`basic`?null:(0,B.jsx)(S,{title:o(c,`system.computerMemory.title`),result:g.data,className:`xl:col-span-3`,children:e=>(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(D,{value:e}),(0,B.jsxs)(`div`,{className:`flex gap-2`,children:[(0,B.jsx)(E,{label:o(c,`system.computerMemory.enable`),action:()=>i.setComputerMemory(!0),invalidate:[`computerMemory`]}),(0,B.jsx)(E,{label:o(c,`system.computerMemory.disable`),action:()=>i.setComputerMemory(!1),invalidate:[`computerMemory`],variant:`destructive`})]})]})})]})}function Q(e,t,n=o(e,`system.value.notReported`)){return t==null||t===``?n:typeof t==`boolean`?o(e,t?`system.value.enabled`:`system.value.disabled`):String(t)}function se({data:e}){let n=t(e=>e.language),r=c(e.presence||e.clients||e);return r.length?(0,B.jsx)(y,{items:r,titleKey:`user`,metaKey:`workspace_id`}):(0,B.jsx)(w,{title:o(n,`system.presence.empty`),detail:o(n,`system.presence.emptyDetail`)})}function ce({data:e}){let n=t(e=>e.mode),i=t(e=>e.language),a=Q(i,e.public_key,``);return n===`basic`?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)($,{title:o(i,`system.device.thisMac`),status:o(i,`system.value.trusted`),detail:o(i,`system.device.thisMacDetail`)}),(0,B.jsx)(O,{variant:`muted`,children:Q(i,e.algorithm,o(i,`system.value.localIdentity`))})]}):(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(O,{variant:`success`,children:o(i,`system.value.localDevice`)}),(0,B.jsx)(O,{variant:`muted`,children:Q(i,e.algorithm,o(i,`system.value.identityKey`))})]}),(0,B.jsx)(m,{data:{device_id:e.device_id||e.id||o(i,`system.value.notReported`),fingerprint:e.fingerprint||o(i,`system.value.notReported`),public_key:a?r(a.replace(/\s+/g,` `),72):o(i,`system.value.notReported`)}})]})}function le({data:e}){let n=t(e=>e.mode),r=t(e=>e.language);return n===`basic`?(0,B.jsx)($,{title:o(r,`system.health.title`),status:o(r,`system.health.ok`),detail:o(r,`system.health.detail`)}):(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(b,{stats:[{label:o(r,`system.health.status`),value:e.status||e.ok||o(r,`system.value.reported`)},{label:o(r,`system.health.version`),value:e.version||o(r,`system.value.notReported`)},{label:o(r,`system.health.mode`),value:e.mode||e.environment||o(r,`system.value.local`)},{label:o(r,`system.health.port`),value:e.port||e.backend_port||o(r,`system.value.configured`)}]}),(0,B.jsx)(D,{value:e})]})}function ue({data:e,mode:t=`advanced`,language:n=`en`}){let r=s(e.active)?e.active:e,i=s(e.postgres)?e.postgres:{},a=s(e.backup_health)?e.backup_health:{},c=r.vector_search||r.vector||e.vector_search||e.sqlite_vec,l=!!(i.available||i.connected||i.enabled),u=!!c&&String(c).toLowerCase()!==`not reported`;return t===`basic`?(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)($,{title:o(n,`system.storage.local.title`),status:o(n,`system.storage.local.badge`),detail:o(n,`system.storage.local.detail`)}),(0,B.jsx)($,{title:o(n,`system.storage.search.title`),status:u?o(n,`system.storage.search.on`):o(n,`system.storage.search.pending`),detail:u?o(n,`system.storage.search.detailOn`):o(n,`system.storage.search.detailPending`)})]}):(0,B.jsxs)(`div`,{className:`space-y-4`,children:[(0,B.jsx)(b,{stats:[{label:o(n,`system.storage.activeEngine`),value:r.engine||e.engine||o(n,`system.storage.sqlite`)},{label:o(n,`system.storage.sqliteDefault`),value:r.engine===`postgres`?o(n,`system.value.scaleMode`):o(n,`system.value.enabled`)},{label:o(n,`system.storage.vector`),value:c||o(n,`system.value.notReported`)},{label:o(n,`system.storage.postgres`),value:l?o(n,`system.value.available`):o(n,`system.value.optional`)}]}),(0,B.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,B.jsx)($,{title:o(n,`system.storage.sqlite`),status:r.available===!1?o(n,`system.value.unavailable`):o(n,`system.value.default`),detail:Q(n,r.reason||r.path||e.path,o(n,`system.storage.sqliteDetail`))}),(0,B.jsx)($,{title:o(n,`system.storage.vector`),status:Q(n,c,o(n,`system.value.reported`)),detail:Q(n,r.vector_reason||r.sqlite_vec_reason||e.vector_reason,o(n,`system.storage.vectorDetail`))}),(0,B.jsx)($,{title:o(n,`system.storage.postgres`),status:l?o(n,`system.value.available`):o(n,`system.value.notEnabled`),detail:Q(n,i.reason||i.dsn||i.status,o(n,`system.storage.postgresDetail`))})]}),Object.keys(a).length?(0,B.jsx)(D,{value:{backup_health:a}}):null]})}function de({data:e}){let n=t(e=>e.language);return(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(b,{stats:[{label:o(n,`system.backup.available`),value:e.available===!1?o(n,`system.value.no`):o(n,`system.value.yes`)},{label:o(n,`system.backup.backups`),value:e.count||e.backups||0},{label:o(n,`system.backup.encrypted`),value:e.encrypted_archives||0},{label:o(n,`system.backup.zip`),value:e.zip_backups||0}]}),(0,B.jsx)(m,{data:{directory:e.directory||o(n,`system.value.notReported`),latest:e.latest||o(n,`system.value.noneReported`),last_verified:e.last_verified||e.verified_at||o(n,`system.value.notReported`),failure:e.error||e.reason||o(n,`system.value.noneReported`)}})]})}function $({title:e,status:t,detail:n}){let r=/unavailable|failed|denied|disabled|not enabled|사용 불가|실패|거부|비활성|활성화되지 않음/i.test(t)?`warning`:`success`;return(0,B.jsxs)(`div`,{className:`rounded-md border border-border bg-background p-3`,children:[(0,B.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,B.jsx)(`div`,{className:`font-medium`,children:e}),(0,B.jsx)(O,{variant:r,children:t})]}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:n})]})}function fe({data:e}){let n=t(e=>e.language),r=s(e.startup)?e.startup:{},i=s(e.privacy)?e.privacy:{},a=s(e.storage)?e.storage:{},c=s(e.backup)?e.backup:{},l=s(e.device_identity)?e.device_identity:{},u=s(e.permissions)?e.permissions:{};return(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(b,{stats:[{label:o(n,`system.hardening.version`),value:e.version||o(n,`system.value.reported`)},{label:o(n,`system.hardening.localOnly`),value:i.local_only_default??r.local_only_default??o(n,`system.value.reported`)},{label:o(n,`system.hardening.storage`),value:s(a.active)?a.active.engine:o(n,`system.value.reported`)},{label:o(n,`system.hardening.backups`),value:c.count||c.available||o(n,`system.value.reported`)}]}),(0,B.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,B.jsx)($,{title:o(n,`system.hardening.startup`),status:o(n,r.network_exposed?`system.value.networkExposed`:`system.value.localOnly`),detail:o(n,`system.hardening.startupDetail`)}),(0,B.jsx)($,{title:o(n,`system.hardening.integrations`),status:o(n,i.local_only_default===!1?`system.value.reviewRequired`:`system.value.optIn`),detail:o(n,`system.hardening.integrationsDetail`)}),(0,B.jsx)($,{title:o(n,`system.hardening.identity`),status:Q(n,l.algorithm||l.fingerprint,o(n,`system.value.reported`)),detail:Q(n,l.storage,o(n,`system.hardening.identityStorage`))}),(0,B.jsx)($,{title:o(n,`system.hardening.permissions`),status:o(n,u.destructive_restore_requires_confirmation===!1?`system.value.reviewRequired`:`system.value.guarded`),detail:o(n,`system.hardening.permissionsDetail`)})]})]})}function pe({data:e}){let n=t(e=>e.language),r=s(e.cards)?e.cards:{},i=s(e.severity_counts)?e.severity_counts:{};return(0,B.jsxs)(`div`,{className:`space-y-3`,children:[(0,B.jsx)(b,{stats:[{label:o(n,`system.security.eventsToday`),value:r.events_today||0},{label:o(n,`system.security.highRisk`),value:r.high_risk_events||i.high||0},{label:o(n,`system.security.review`),value:r.review_required||0},{label:o(n,`system.security.riskRate`),value:e.risk_rate||0}]}),(0,B.jsx)(D,{value:{severity_counts:i,sensitive_fields:e.field_counts||{}}})]})}function me(){let e=t(e=>e.mode),n=t(e=>e.language),r=d({queryKey:[`adminSummary`],queryFn:i.adminSummary}),a=d({queryKey:[`adminUsers`],queryFn:i.adminUsers}),s=d({queryKey:[`adminAudit`],queryFn:()=>i.adminAudit()}),c=d({queryKey:[`adminRoles`],queryFn:i.adminRoles}),l=d({queryKey:[`adminPolicies`],queryFn:i.adminPolicies}),u=d({queryKey:[`adminProductHardening`],queryFn:i.adminProductHardening}),f=d({queryKey:[`adminSecurity`],queryFn:i.adminSecurity}),p=d({queryKey:[`vpcStatus`],queryFn:i.vpcStatus});return e===`admin`?(0,B.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-2`,children:[(0,B.jsx)(S,{title:o(n,`system.admin.summary`),result:r.data,children:e=>(0,B.jsx)(m,{data:e})}),(0,B.jsx)(S,{title:o(n,`system.admin.users`),result:a.data,children:e=>(0,B.jsx)(y,{items:e,titleKey:`email`,metaKey:`role`})}),(0,B.jsx)(S,{title:o(n,`system.admin.audit`),result:s.data,children:e=>(0,B.jsx)(y,{items:e.recent_events||e,titleKey:`act`,metaKey:`sev`})}),(0,B.jsx)(S,{title:o(n,`system.admin.roles`),result:c.data,children:e=>(0,B.jsx)(y,{items:e.roles||e,titleKey:`role`,metaKey:`members`})}),(0,B.jsx)(S,{title:o(n,`system.admin.policies`),result:l.data,children:e=>(0,B.jsx)(y,{items:e.policies||e,titleKey:`label`,metaKey:`enforced`})}),(0,B.jsx)(S,{title:o(n,`system.admin.hardening`),result:u.data,children:e=>(0,B.jsx)(fe,{data:e})}),(0,B.jsx)(S,{title:o(n,`system.admin.security`),result:f.data,children:e=>(0,B.jsx)(pe,{data:e})}),(0,B.jsx)(S,{title:o(n,`system.admin.vpc`),result:p.data,className:`xl:col-span-2`,children:e=>(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(O,{variant:`muted`,children:o(n,`system.admin.communityUnavailable`)}),(0,B.jsx)(D,{value:e})]})})]}):(0,B.jsx)(T,{title:o(n,`system.admin.controls`),detail:o(n,`system.admin.controlsDetail`),target:`admin`})}export{q as SystemPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./utils-
|
|
1
|
+
import{g as e}from"./utils-KFFdVG_t.js";var t=e(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./utils-
|
|
1
|
+
import{g as e}from"./utils-KFFdVG_t.js";var t=e(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]);export{t};
|