@fraziym/axoniz 0.1.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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/agents/definition.d.ts +15 -0
- package/dist/agents/definition.d.ts.map +1 -0
- package/dist/agents/definition.js +41 -0
- package/dist/agents/definition.js.map +1 -0
- package/dist/agents/index.d.ts +12 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +11 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/registry.d.ts +17 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +23 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/specialized.d.ts +31 -0
- package/dist/agents/specialized.d.ts.map +1 -0
- package/dist/agents/specialized.js +75 -0
- package/dist/agents/specialized.js.map +1 -0
- package/dist/awareness/index.d.ts +14 -0
- package/dist/awareness/index.d.ts.map +1 -0
- package/dist/awareness/index.js +22 -0
- package/dist/awareness/index.js.map +1 -0
- package/dist/awareness/service.d.ts +180 -0
- package/dist/awareness/service.d.ts.map +1 -0
- package/dist/awareness/service.js +789 -0
- package/dist/awareness/service.js.map +1 -0
- package/dist/cli/entry.d.ts +13 -0
- package/dist/cli/entry.d.ts.map +1 -0
- package/dist/cli/entry.js +35 -0
- package/dist/cli/entry.js.map +1 -0
- package/dist/comms/telegram.d.ts +41 -0
- package/dist/comms/telegram.d.ts.map +1 -0
- package/dist/comms/telegram.js +332 -0
- package/dist/comms/telegram.js.map +1 -0
- package/dist/core/agent.d.ts +252 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1399 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/auth.d.ts +23 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +113 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/authority.d.ts +118 -0
- package/dist/core/authority.d.ts.map +1 -0
- package/dist/core/authority.js +402 -0
- package/dist/core/authority.js.map +1 -0
- package/dist/core/backend/async_queue.d.ts +17 -0
- package/dist/core/backend/async_queue.d.ts.map +1 -0
- package/dist/core/backend/async_queue.js +66 -0
- package/dist/core/backend/async_queue.js.map +1 -0
- package/dist/core/backend/index.d.ts +24 -0
- package/dist/core/backend/index.d.ts.map +1 -0
- package/dist/core/backend/index.js +128 -0
- package/dist/core/backend/index.js.map +1 -0
- package/dist/core/backend/llama_server.d.ts +39 -0
- package/dist/core/backend/llama_server.d.ts.map +1 -0
- package/dist/core/backend/llama_server.js +182 -0
- package/dist/core/backend/llama_server.js.map +1 -0
- package/dist/core/backend/llamacpp.d.ts +40 -0
- package/dist/core/backend/llamacpp.d.ts.map +1 -0
- package/dist/core/backend/llamacpp.js +200 -0
- package/dist/core/backend/llamacpp.js.map +1 -0
- package/dist/core/backend/lmstudio.d.ts +53 -0
- package/dist/core/backend/lmstudio.d.ts.map +1 -0
- package/dist/core/backend/lmstudio.js +274 -0
- package/dist/core/backend/lmstudio.js.map +1 -0
- package/dist/core/backend/ollama.d.ts +25 -0
- package/dist/core/backend/ollama.d.ts.map +1 -0
- package/dist/core/backend/ollama.js +86 -0
- package/dist/core/backend/ollama.js.map +1 -0
- package/dist/core/backend/openai.d.ts +27 -0
- package/dist/core/backend/openai.d.ts.map +1 -0
- package/dist/core/backend/openai.js +84 -0
- package/dist/core/backend/openai.js.map +1 -0
- package/dist/core/backend/types.d.ts +73 -0
- package/dist/core/backend/types.d.ts.map +1 -0
- package/dist/core/backend/types.js +137 -0
- package/dist/core/backend/types.js.map +1 -0
- package/dist/core/chat_store.d.ts +77 -0
- package/dist/core/chat_store.d.ts.map +1 -0
- package/dist/core/chat_store.js +332 -0
- package/dist/core/chat_store.js.map +1 -0
- package/dist/core/cli.d.ts +82 -0
- package/dist/core/cli.d.ts.map +1 -0
- package/dist/core/cli.js +602 -0
- package/dist/core/cli.js.map +1 -0
- package/dist/core/config.d.ts +127 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +295 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/debug.d.ts +8 -0
- package/dist/core/debug.d.ts.map +1 -0
- package/dist/core/debug.js +8 -0
- package/dist/core/debug.js.map +1 -0
- package/dist/core/downloader.d.ts +31 -0
- package/dist/core/downloader.d.ts.map +1 -0
- package/dist/core/downloader.js +180 -0
- package/dist/core/downloader.js.map +1 -0
- package/dist/core/errors.d.ts +80 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +134 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/extras.d.ts +160 -0
- package/dist/core/extras.d.ts.map +1 -0
- package/dist/core/extras.js +553 -0
- package/dist/core/extras.js.map +1 -0
- package/dist/core/health.d.ts +27 -0
- package/dist/core/health.d.ts.map +1 -0
- package/dist/core/health.js +96 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/history.d.ts +50 -0
- package/dist/core/history.d.ts.map +1 -0
- package/dist/core/history.js +276 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/intelligence/ast_index.d.ts +255 -0
- package/dist/core/intelligence/ast_index.d.ts.map +1 -0
- package/dist/core/intelligence/ast_index.js +1369 -0
- package/dist/core/intelligence/ast_index.js.map +1 -0
- package/dist/core/intelligence/confidence.d.ts +113 -0
- package/dist/core/intelligence/confidence.d.ts.map +1 -0
- package/dist/core/intelligence/confidence.js +298 -0
- package/dist/core/intelligence/confidence.js.map +1 -0
- package/dist/core/intelligence/context_compressor.d.ts +80 -0
- package/dist/core/intelligence/context_compressor.d.ts.map +1 -0
- package/dist/core/intelligence/context_compressor.js +245 -0
- package/dist/core/intelligence/context_compressor.js.map +1 -0
- package/dist/core/intelligence/daemon.d.ts +247 -0
- package/dist/core/intelligence/daemon.d.ts.map +1 -0
- package/dist/core/intelligence/daemon.js +842 -0
- package/dist/core/intelligence/daemon.js.map +1 -0
- package/dist/core/intelligence/index.d.ts +60 -0
- package/dist/core/intelligence/index.d.ts.map +1 -0
- package/dist/core/intelligence/index.js +101 -0
- package/dist/core/intelligence/index.js.map +1 -0
- package/dist/core/intelligence/predictor.d.ts +246 -0
- package/dist/core/intelligence/predictor.d.ts.map +1 -0
- package/dist/core/intelligence/predictor.js +590 -0
- package/dist/core/intelligence/predictor.js.map +1 -0
- package/dist/core/intelligence/reflex.d.ts +84 -0
- package/dist/core/intelligence/reflex.d.ts.map +1 -0
- package/dist/core/intelligence/reflex.js +344 -0
- package/dist/core/intelligence/reflex.js.map +1 -0
- package/dist/core/intelligence/self_correction.d.ts +121 -0
- package/dist/core/intelligence/self_correction.d.ts.map +1 -0
- package/dist/core/intelligence/self_correction.js +327 -0
- package/dist/core/intelligence/self_correction.js.map +1 -0
- package/dist/core/intelligence/skill_distiller.d.ts +100 -0
- package/dist/core/intelligence/skill_distiller.d.ts.map +1 -0
- package/dist/core/intelligence/skill_distiller.js +246 -0
- package/dist/core/intelligence/skill_distiller.js.map +1 -0
- package/dist/core/intelligence/swarm.d.ts +330 -0
- package/dist/core/intelligence/swarm.d.ts.map +1 -0
- package/dist/core/intelligence/swarm.js +1064 -0
- package/dist/core/intelligence/swarm.js.map +1 -0
- package/dist/core/intelligence/trajectory.d.ts +107 -0
- package/dist/core/intelligence/trajectory.d.ts.map +1 -0
- package/dist/core/intelligence/trajectory.js +330 -0
- package/dist/core/intelligence/trajectory.js.map +1 -0
- package/dist/core/logger.d.ts +111 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +640 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/loop.d.ts +123 -0
- package/dist/core/loop.d.ts.map +1 -0
- package/dist/core/loop.js +423 -0
- package/dist/core/loop.js.map +1 -0
- package/dist/core/memory.d.ts +81 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +328 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/metrics.d.ts +29 -0
- package/dist/core/metrics.d.ts.map +1 -0
- package/dist/core/metrics.js +109 -0
- package/dist/core/metrics.js.map +1 -0
- package/dist/core/models.d.ts +51 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/models.js +146 -0
- package/dist/core/models.js.map +1 -0
- package/dist/core/optimizer.d.ts +34 -0
- package/dist/core/optimizer.d.ts.map +1 -0
- package/dist/core/optimizer.js +131 -0
- package/dist/core/optimizer.js.map +1 -0
- package/dist/core/persona.d.ts +35 -0
- package/dist/core/persona.d.ts.map +1 -0
- package/dist/core/persona.js +126 -0
- package/dist/core/persona.js.map +1 -0
- package/dist/core/rate_limit.d.ts +23 -0
- package/dist/core/rate_limit.d.ts.map +1 -0
- package/dist/core/rate_limit.js +62 -0
- package/dist/core/rate_limit.js.map +1 -0
- package/dist/core/runner.d.ts +63 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/runner.js +671 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/core/stream_parser.d.ts +43 -0
- package/dist/core/stream_parser.d.ts.map +1 -0
- package/dist/core/stream_parser.js +140 -0
- package/dist/core/stream_parser.js.map +1 -0
- package/dist/core/tool_schemas.d.ts +26 -0
- package/dist/core/tool_schemas.d.ts.map +1 -0
- package/dist/core/tool_schemas.js +124 -0
- package/dist/core/tool_schemas.js.map +1 -0
- package/dist/core/which.d.ts +2 -0
- package/dist/core/which.d.ts.map +1 -0
- package/dist/core/which.js +35 -0
- package/dist/core/which.js.map +1 -0
- package/dist/goals/index.d.ts +9 -0
- package/dist/goals/index.d.ts.map +1 -0
- package/dist/goals/index.js +17 -0
- package/dist/goals/index.js.map +1 -0
- package/dist/goals/service.d.ts +115 -0
- package/dist/goals/service.d.ts.map +1 -0
- package/dist/goals/service.js +415 -0
- package/dist/goals/service.js.map +1 -0
- package/dist/goals/types.d.ts +47 -0
- package/dist/goals/types.d.ts.map +1 -0
- package/dist/goals/types.js +66 -0
- package/dist/goals/types.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/autonomous_startup.d.ts +51 -0
- package/dist/integrations/autonomous_startup.d.ts.map +1 -0
- package/dist/integrations/autonomous_startup.js +419 -0
- package/dist/integrations/autonomous_startup.js.map +1 -0
- package/dist/integrations/goose.d.ts +105 -0
- package/dist/integrations/goose.d.ts.map +1 -0
- package/dist/integrations/goose.js +408 -0
- package/dist/integrations/goose.js.map +1 -0
- package/dist/integrations/index.d.ts +21 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +17 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/mcp.d.ts +73 -0
- package/dist/integrations/mcp.d.ts.map +1 -0
- package/dist/integrations/mcp.js +307 -0
- package/dist/integrations/mcp.js.map +1 -0
- package/dist/integrations/mempalace.d.ts +18 -0
- package/dist/integrations/mempalace.d.ts.map +1 -0
- package/dist/integrations/mempalace.js +25 -0
- package/dist/integrations/mempalace.js.map +1 -0
- package/dist/integrations/multi_agent.d.ts +82 -0
- package/dist/integrations/multi_agent.d.ts.map +1 -0
- package/dist/integrations/multi_agent.js +280 -0
- package/dist/integrations/multi_agent.js.map +1 -0
- package/dist/integrations/unified_memory.d.ts +415 -0
- package/dist/integrations/unified_memory.d.ts.map +1 -0
- package/dist/integrations/unified_memory.js +1489 -0
- package/dist/integrations/unified_memory.js.map +1 -0
- package/dist/roles/beru.yaml +48 -0
- package/dist/sidecar/client.d.ts +63 -0
- package/dist/sidecar/client.d.ts.map +1 -0
- package/dist/sidecar/client.js +222 -0
- package/dist/sidecar/client.js.map +1 -0
- package/dist/sidecar/index.d.ts +7 -0
- package/dist/sidecar/index.d.ts.map +1 -0
- package/dist/sidecar/index.js +6 -0
- package/dist/sidecar/index.js.map +1 -0
- package/dist/startup.d.ts +22 -0
- package/dist/startup.d.ts.map +1 -0
- package/dist/startup.js +194 -0
- package/dist/startup.js.map +1 -0
- package/dist/tools/_internal.d.ts +90 -0
- package/dist/tools/_internal.d.ts.map +1 -0
- package/dist/tools/_internal.js +375 -0
- package/dist/tools/_internal.js.map +1 -0
- package/dist/tools/_smoke.d.ts +2 -0
- package/dist/tools/_smoke.d.ts.map +1 -0
- package/dist/tools/_smoke.js +203 -0
- package/dist/tools/_smoke.js.map +1 -0
- package/dist/tools/axodex_tools.d.ts +51 -0
- package/dist/tools/axodex_tools.d.ts.map +1 -0
- package/dist/tools/axodex_tools.js +181 -0
- package/dist/tools/axodex_tools.js.map +1 -0
- package/dist/tools/code_tools.d.ts +33 -0
- package/dist/tools/code_tools.d.ts.map +1 -0
- package/dist/tools/code_tools.js +191 -0
- package/dist/tools/code_tools.js.map +1 -0
- package/dist/tools/computer_tools.d.ts +59 -0
- package/dist/tools/computer_tools.d.ts.map +1 -0
- package/dist/tools/computer_tools.js +348 -0
- package/dist/tools/computer_tools.js.map +1 -0
- package/dist/tools/file_tools.d.ts +51 -0
- package/dist/tools/file_tools.d.ts.map +1 -0
- package/dist/tools/file_tools.js +424 -0
- package/dist/tools/file_tools.js.map +1 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +13 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/shell_tools.d.ts +39 -0
- package/dist/tools/shell_tools.d.ts.map +1 -0
- package/dist/tools/shell_tools.js +163 -0
- package/dist/tools/shell_tools.js.map +1 -0
- package/dist/tools/web_tools.d.ts +31 -0
- package/dist/tools/web_tools.d.ts.map +1 -0
- package/dist/tools/web_tools.js +117 -0
- package/dist/tools/web_tools.js.map +1 -0
- package/dist/voice/index.d.ts +41 -0
- package/dist/voice/index.d.ts.map +1 -0
- package/dist/voice/index.js +58 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/light_daemon.d.ts +197 -0
- package/dist/voice/light_daemon.d.ts.map +1 -0
- package/dist/voice/light_daemon.js +746 -0
- package/dist/voice/light_daemon.js.map +1 -0
- package/dist/voice/setup.d.ts +63 -0
- package/dist/voice/setup.d.ts.map +1 -0
- package/dist/voice/setup.js +443 -0
- package/dist/voice/setup.js.map +1 -0
- package/dist/voice/stt.d.ts +148 -0
- package/dist/voice/stt.d.ts.map +1 -0
- package/dist/voice/stt.js +361 -0
- package/dist/voice/stt.js.map +1 -0
- package/dist/voice/tts.d.ts +168 -0
- package/dist/voice/tts.d.ts.map +1 -0
- package/dist/voice/tts.js +698 -0
- package/dist/voice/tts.js.map +1 -0
- package/dist/voice/voice_loop.d.ts +101 -0
- package/dist/voice/voice_loop.d.ts.map +1 -0
- package/dist/voice/voice_loop.js +463 -0
- package/dist/voice/voice_loop.js.map +1 -0
- package/dist/voice/wake_word.d.ts +153 -0
- package/dist/voice/wake_word.d.ts.map +1 -0
- package/dist/voice/wake_word.js +458 -0
- package/dist/voice/wake_word.js.map +1 -0
- package/dist/voice/wav.d.ts +99 -0
- package/dist/voice/wav.d.ts.map +1 -0
- package/dist/voice/wav.js +306 -0
- package/dist/voice/wav.js.map +1 -0
- package/dist/web/broker.d.ts +33 -0
- package/dist/web/broker.d.ts.map +1 -0
- package/dist/web/broker.js +58 -0
- package/dist/web/broker.js.map +1 -0
- package/dist/web/open_browser.d.ts +2 -0
- package/dist/web/open_browser.d.ts.map +1 -0
- package/dist/web/open_browser.js +42 -0
- package/dist/web/open_browser.js.map +1 -0
- package/dist/web/server.d.ts +54 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +831 -0
- package/dist/web/server.js.map +1 -0
- package/dist/web/static/app.js +4121 -0
- package/dist/web/static/index.html +2281 -0
- package/dist/web/static/js/MODULE_SUMMARY.md +124 -0
- package/dist/web/static/js/a11y.js +165 -0
- package/dist/web/static/js/admin.js +2145 -0
- package/dist/web/static/js/assistant.js +475 -0
- package/dist/web/static/js/calendar/reminders.js +114 -0
- package/dist/web/static/js/calendar/utils.js +166 -0
- package/dist/web/static/js/calendar.js +3348 -0
- package/dist/web/static/js/censor.js +356 -0
- package/dist/web/static/js/chat.js +4546 -0
- package/dist/web/static/js/chatRenderer.js +2294 -0
- package/dist/web/static/js/chatStream.js +276 -0
- package/dist/web/static/js/codeRunner.js +398 -0
- package/dist/web/static/js/color/hex.js +14 -0
- package/dist/web/static/js/colorPicker.js +453 -0
- package/dist/web/static/js/compare/icons.js +77 -0
- package/dist/web/static/js/compare/index.js +1482 -0
- package/dist/web/static/js/compare/models.js +104 -0
- package/dist/web/static/js/compare/panes.js +817 -0
- package/dist/web/static/js/compare/probe.js +78 -0
- package/dist/web/static/js/compare/scoreboard.js +223 -0
- package/dist/web/static/js/compare/selector.js +1335 -0
- package/dist/web/static/js/compare/state.js +58 -0
- package/dist/web/static/js/compare/stream.js +695 -0
- package/dist/web/static/js/compare/vote.js +254 -0
- package/dist/web/static/js/cookbook-diagnosis.js +694 -0
- package/dist/web/static/js/cookbook-hwfit.js +1888 -0
- package/dist/web/static/js/cookbook.js +2093 -0
- package/dist/web/static/js/cookbookDownload.js +633 -0
- package/dist/web/static/js/cookbookProgressSignal.js +29 -0
- package/dist/web/static/js/cookbookRunning.js +3506 -0
- package/dist/web/static/js/cookbookServe.js +2128 -0
- package/dist/web/static/js/document.js +9731 -0
- package/dist/web/static/js/documentLibrary.js +3376 -0
- package/dist/web/static/js/dragSort.js +265 -0
- package/dist/web/static/js/editor/ai-inpaint.js +374 -0
- package/dist/web/static/js/editor/ai-models.js +273 -0
- package/dist/web/static/js/editor/ai-rembg.js +230 -0
- package/dist/web/static/js/editor/ai-tool-runner.js +147 -0
- package/dist/web/static/js/editor/ai-tools-misc.js +216 -0
- package/dist/web/static/js/editor/build/controls.js +366 -0
- package/dist/web/static/js/editor/build/popups.js +112 -0
- package/dist/web/static/js/editor/build/right-panel.js +200 -0
- package/dist/web/static/js/editor/build/toolbar.js +73 -0
- package/dist/web/static/js/editor/build/topbar.js +131 -0
- package/dist/web/static/js/editor/build/transform-popup.js +109 -0
- package/dist/web/static/js/editor/canvas-coords.js +21 -0
- package/dist/web/static/js/editor/canvas-events.js +197 -0
- package/dist/web/static/js/editor/canvas-transforms.js +132 -0
- package/dist/web/static/js/editor/checkerboard.js +24 -0
- package/dist/web/static/js/editor/clipboard-and-drop.js +133 -0
- package/dist/web/static/js/editor/composite-helpers.js +83 -0
- package/dist/web/static/js/editor/filters/blur.js +118 -0
- package/dist/web/static/js/editor/filters/edge-feather.js +70 -0
- package/dist/web/static/js/editor/fx/adj-popup.js +677 -0
- package/dist/web/static/js/editor/fx/filter-string.js +38 -0
- package/dist/web/static/js/editor/fx/histogram.js +67 -0
- package/dist/web/static/js/editor/fx/pixel-pass.js +249 -0
- package/dist/web/static/js/editor/harmonize-masks.js +116 -0
- package/dist/web/static/js/editor/history-panel.js +176 -0
- package/dist/web/static/js/editor/keyboard-shortcuts.js +271 -0
- package/dist/web/static/js/editor/layer-helpers.js +131 -0
- package/dist/web/static/js/editor/layer-panel.js +600 -0
- package/dist/web/static/js/editor/mask-utils.js +91 -0
- package/dist/web/static/js/editor/shortcuts-popover.js +149 -0
- package/dist/web/static/js/editor/slider-ux.js +191 -0
- package/dist/web/static/js/editor/snap.js +107 -0
- package/dist/web/static/js/editor/state.js +257 -0
- package/dist/web/static/js/editor/stroke-pipeline.js +162 -0
- package/dist/web/static/js/editor/stroke-tool-sliders.js +64 -0
- package/dist/web/static/js/editor/tools/clone.js +81 -0
- package/dist/web/static/js/editor/tools/crop.js +137 -0
- package/dist/web/static/js/editor/tools/flood-fill.js +72 -0
- package/dist/web/static/js/editor/tools/lasso-mask.js +171 -0
- package/dist/web/static/js/editor/tools/lasso.js +65 -0
- package/dist/web/static/js/editor/tools/move.js +79 -0
- package/dist/web/static/js/editor/tools/stroke.js +123 -0
- package/dist/web/static/js/editor/tools/transform-drag.js +174 -0
- package/dist/web/static/js/editor/tools/transform-handles.js +271 -0
- package/dist/web/static/js/editor/tools/transform-session.js +381 -0
- package/dist/web/static/js/editor/tools/wand.js +46 -0
- package/dist/web/static/js/editor/wire-import.js +148 -0
- package/dist/web/static/js/editor/wire-inpaint-controls.js +164 -0
- package/dist/web/static/js/editor/wire-merge-buttons.js +103 -0
- package/dist/web/static/js/editor/wire-selection-controls.js +170 -0
- package/dist/web/static/js/editor/wire-topbar-menus.js +174 -0
- package/dist/web/static/js/editor/wire-topbar-overflow.js +49 -0
- package/dist/web/static/js/editor/wire-topbar.js +188 -0
- package/dist/web/static/js/emailInbox.js +1245 -0
- package/dist/web/static/js/emailLibrary/replyRecipients.js +27 -0
- package/dist/web/static/js/emailLibrary/signatureFold.js +339 -0
- package/dist/web/static/js/emailLibrary/state.js +34 -0
- package/dist/web/static/js/emailLibrary/utils.js +202 -0
- package/dist/web/static/js/emailLibrary.js +5217 -0
- package/dist/web/static/js/emojiPicker.js +311 -0
- package/dist/web/static/js/escMenuStack.js +102 -0
- package/dist/web/static/js/fileHandler.js +295 -0
- package/dist/web/static/js/gallery.js +2835 -0
- package/dist/web/static/js/galleryEditor.js +3798 -0
- package/dist/web/static/js/group.js +955 -0
- package/dist/web/static/js/init.js +405 -0
- package/dist/web/static/js/keyboard-shortcuts.js +292 -0
- package/dist/web/static/js/langIcons.js +187 -0
- package/dist/web/static/js/markdown/tableRow.js +19 -0
- package/dist/web/static/js/markdown.js +806 -0
- package/dist/web/static/js/memory.js +1418 -0
- package/dist/web/static/js/modalManager.js +1552 -0
- package/dist/web/static/js/modalSnap.js +782 -0
- package/dist/web/static/js/model/matchKey.js +19 -0
- package/dist/web/static/js/modelPicker.js +695 -0
- package/dist/web/static/js/modelSort.js +33 -0
- package/dist/web/static/js/models.js +642 -0
- package/dist/web/static/js/notes.js +5054 -0
- package/dist/web/static/js/package.json +1 -0
- package/dist/web/static/js/platform.js +47 -0
- package/dist/web/static/js/presets.js +1110 -0
- package/dist/web/static/js/providers.js +93 -0
- package/dist/web/static/js/rag.js +177 -0
- package/dist/web/static/js/research/jobs.js +335 -0
- package/dist/web/static/js/research/panel.js +1233 -0
- package/dist/web/static/js/researchSynapse.js +225 -0
- package/dist/web/static/js/search-chat.js +201 -0
- package/dist/web/static/js/search.js +52 -0
- package/dist/web/static/js/section-management.js +260 -0
- package/dist/web/static/js/sessions.js +3108 -0
- package/dist/web/static/js/settings.js +4991 -0
- package/dist/web/static/js/sidebar-layout.js +573 -0
- package/dist/web/static/js/signature.js +504 -0
- package/dist/web/static/js/skills.js +1908 -0
- package/dist/web/static/js/slashAutocomplete.js +267 -0
- package/dist/web/static/js/slashCommands.js +6099 -0
- package/dist/web/static/js/spinner.js +406 -0
- package/dist/web/static/js/storage.js +123 -0
- package/dist/web/static/js/tasks.js +2699 -0
- package/dist/web/static/js/theme.js +2086 -0
- package/dist/web/static/js/tileManager.js +386 -0
- package/dist/web/static/js/tourAutoplay.js +133 -0
- package/dist/web/static/js/tourHints.js +179 -0
- package/dist/web/static/js/tts-ai.js +521 -0
- package/dist/web/static/js/ui.js +1288 -0
- package/dist/web/static/js/util/ordinal.js +13 -0
- package/dist/web/static/js/voiceRecorder.js +283 -0
- package/dist/web/static/js/windowDrag.js +326 -0
- package/dist/web/static/js/windowResize.js +233 -0
- package/dist/web/static/landing.html +824 -0
- package/dist/web/static/lib/docx.umd.min.js +20116 -0
- package/dist/web/static/lib/highlight.min.js +1213 -0
- package/dist/web/static/lib/html2pdf.bundle.min.js +3 -0
- package/dist/web/static/lib/mammoth.browser.min.js +21 -0
- package/dist/web/static/lib/qrcode.min.js +8 -0
- package/dist/web/static/lib/xlsx.full.min.js +24 -0
- package/dist/web/static/login.html +582 -0
- package/dist/web/static/manifest.json +15 -0
- package/dist/web/static/style.css +35733 -0
- package/dist/web/static/sw.js +144 -0
- package/dist/workflows/engine.d.ts +162 -0
- package/dist/workflows/engine.d.ts.map +1 -0
- package/dist/workflows/engine.js +625 -0
- package/dist/workflows/engine.js.map +1 -0
- package/dist/workflows/index.d.ts +8 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +14 -0
- package/dist/workflows/index.js.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
// static/js/spinner.js
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ASCII Spinner Module for AI thinking/processing status
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
class Spinner {
|
|
8
|
+
constructor(message = "AI is processing", style = "right", animation = "spinner") {
|
|
9
|
+
// Different animation frames
|
|
10
|
+
this.animations = {
|
|
11
|
+
spinner: ['|', '/', '-', '\\'],
|
|
12
|
+
wave: ['▁▂▃', '▂▃▄', '▃▄▅', '▄▅▆', '▅▆▅', '▆▅▄', '▅▄▃', '▄▃▂', '▃▂▁']
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
this.animation = animation;
|
|
16
|
+
this.frames = this.animations[animation] || this.animations.spinner;
|
|
17
|
+
this.message = message;
|
|
18
|
+
this.style = style; // "left", "right", or "clean"
|
|
19
|
+
this.isRunning = false;
|
|
20
|
+
this.currentFrame = 0;
|
|
21
|
+
this.intervalId = null;
|
|
22
|
+
this.rafId = null;
|
|
23
|
+
this.element = null;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Create and return the spinner HTML element
|
|
28
|
+
*/
|
|
29
|
+
createElement() {
|
|
30
|
+
if (this.animation === 'sinewave') {
|
|
31
|
+
return this._createSineWaveElement();
|
|
32
|
+
}
|
|
33
|
+
if (this.animation === 'whirlpool') {
|
|
34
|
+
return this._createWhirlpoolElement();
|
|
35
|
+
}
|
|
36
|
+
const span = document.createElement('span');
|
|
37
|
+
span.className = 'ai-spinner';
|
|
38
|
+
span.style.cssText = 'font-family: monospace; white-space: pre;';
|
|
39
|
+
this.element = span;
|
|
40
|
+
this.updateDisplay();
|
|
41
|
+
return span;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
_createSineWaveElement() {
|
|
45
|
+
const wrapper = document.createElement('span');
|
|
46
|
+
wrapper.className = 'ai-spinner ai-spinner-sinewave';
|
|
47
|
+
wrapper.style.cssText = 'font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;';
|
|
48
|
+
|
|
49
|
+
const canvas = document.createElement('canvas');
|
|
50
|
+
canvas.width = 50;
|
|
51
|
+
canvas.height = 18;
|
|
52
|
+
canvas.style.cssText = 'display: inline-block; vertical-align: middle;';
|
|
53
|
+
|
|
54
|
+
const msgSpan = document.createElement('span');
|
|
55
|
+
msgSpan.textContent = this.message;
|
|
56
|
+
this._msgSpan = msgSpan;
|
|
57
|
+
|
|
58
|
+
if (this.style === 'left') {
|
|
59
|
+
wrapper.appendChild(canvas);
|
|
60
|
+
wrapper.appendChild(msgSpan);
|
|
61
|
+
} else if (this.style === 'right') {
|
|
62
|
+
wrapper.appendChild(msgSpan);
|
|
63
|
+
wrapper.appendChild(canvas);
|
|
64
|
+
} else {
|
|
65
|
+
wrapper.appendChild(msgSpan);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
this._canvas = canvas;
|
|
69
|
+
this._ctx = canvas.getContext('2d');
|
|
70
|
+
this._waveT = 0;
|
|
71
|
+
this._wavePrev = performance.now();
|
|
72
|
+
this.element = wrapper;
|
|
73
|
+
return wrapper;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
_drawSineWave() {
|
|
77
|
+
const ctx = this._ctx;
|
|
78
|
+
const W = this._canvas.width;
|
|
79
|
+
const H = this._canvas.height;
|
|
80
|
+
const midY = H / 2;
|
|
81
|
+
const AMP = 7;
|
|
82
|
+
const CYCLES = 2.5;
|
|
83
|
+
const PAD = 3;
|
|
84
|
+
const trackW = W - 2 * PAD;
|
|
85
|
+
const BASE_SPEED = 0.44;
|
|
86
|
+
const MIN_SPEED = 0.4;
|
|
87
|
+
const MAX_SPEED = 2.5;
|
|
88
|
+
|
|
89
|
+
const now = performance.now();
|
|
90
|
+
const dt = (now - this._wavePrev) / 1000;
|
|
91
|
+
this._wavePrev = now;
|
|
92
|
+
|
|
93
|
+
const dotPhase = 0.5 * CYCLES * 2 * Math.PI + this._waveT;
|
|
94
|
+
const norm = (1 + Math.sin(dotPhase)) / 2;
|
|
95
|
+
const speedMul = MIN_SPEED + (MAX_SPEED - MIN_SPEED) * Math.pow(norm, 1.3);
|
|
96
|
+
this._waveT += dt * BASE_SPEED * speedMul * CYCLES * 2 * Math.PI;
|
|
97
|
+
|
|
98
|
+
ctx.clearRect(0, 0, W, H);
|
|
99
|
+
|
|
100
|
+
// wave line
|
|
101
|
+
ctx.beginPath();
|
|
102
|
+
for (let i = 0; i <= 80; i++) {
|
|
103
|
+
const frac = i / 80;
|
|
104
|
+
const x = PAD + frac * trackW;
|
|
105
|
+
const phase = frac * CYCLES * 2 * Math.PI + this._waveT;
|
|
106
|
+
const y = midY + Math.sin(phase) * AMP;
|
|
107
|
+
if (i === 0) ctx.moveTo(x, y);
|
|
108
|
+
else ctx.lineTo(x, y);
|
|
109
|
+
}
|
|
110
|
+
ctx.strokeStyle = 'rgba(156, 222, 242, 0.5)';
|
|
111
|
+
ctx.lineWidth = 1.5;
|
|
112
|
+
ctx.stroke();
|
|
113
|
+
|
|
114
|
+
// dot
|
|
115
|
+
const cx = W / 2;
|
|
116
|
+
const cPhase = 0.5 * CYCLES * 2 * Math.PI + this._waveT;
|
|
117
|
+
const cy = midY + Math.sin(cPhase) * AMP;
|
|
118
|
+
ctx.beginPath();
|
|
119
|
+
ctx.arc(cx, cy, 1.5, 0, Math.PI * 2);
|
|
120
|
+
ctx.fillStyle = 'rgba(156, 222, 242, 0.9)';
|
|
121
|
+
ctx.fill();
|
|
122
|
+
|
|
123
|
+
if (this.isRunning) {
|
|
124
|
+
this.rafId = requestAnimationFrame(() => this._drawSineWave());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
_createWhirlpoolElement() {
|
|
129
|
+
const wrapper = document.createElement('span');
|
|
130
|
+
wrapper.className = 'ai-spinner ai-spinner-whirlpool';
|
|
131
|
+
wrapper.style.cssText = 'font-family: monospace; white-space: pre; display: inline-flex; align-items: center; gap: 6px;';
|
|
132
|
+
|
|
133
|
+
const size = this._wpSize || 18;
|
|
134
|
+
const canvas = document.createElement('canvas');
|
|
135
|
+
canvas.width = size;
|
|
136
|
+
canvas.height = size;
|
|
137
|
+
canvas.style.cssText = 'display: inline-block; vertical-align: middle;';
|
|
138
|
+
|
|
139
|
+
const msgSpan = document.createElement('span');
|
|
140
|
+
msgSpan.textContent = this.message;
|
|
141
|
+
this._msgSpan = msgSpan;
|
|
142
|
+
|
|
143
|
+
if (this.style === 'left') {
|
|
144
|
+
wrapper.appendChild(canvas);
|
|
145
|
+
wrapper.appendChild(msgSpan);
|
|
146
|
+
} else if (this.style === 'right') {
|
|
147
|
+
wrapper.appendChild(msgSpan);
|
|
148
|
+
wrapper.appendChild(canvas);
|
|
149
|
+
} else {
|
|
150
|
+
wrapper.appendChild(canvas);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
this._wpCanvas = canvas;
|
|
154
|
+
this._wpCtx = canvas.getContext('2d');
|
|
155
|
+
this._wpFrame = 60;
|
|
156
|
+
this.element = wrapper;
|
|
157
|
+
return wrapper;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
_drawWhirlpool() {
|
|
161
|
+
const ctx = this._wpCtx;
|
|
162
|
+
const W = this._wpCanvas.width;
|
|
163
|
+
const H = this._wpCanvas.height;
|
|
164
|
+
const cx = W / 2, cy = H / 2;
|
|
165
|
+
const maxR = Math.min(W, H) / 2 - 1;
|
|
166
|
+
const lw = W > 30 ? 3 : W > 20 ? 2 : 1.5;
|
|
167
|
+
const TOTAL_TURNS = 4;
|
|
168
|
+
const TAIL_LEN = 0.45;
|
|
169
|
+
const SPIN_SPEED = 0.08;
|
|
170
|
+
const LAYERS = 12;
|
|
171
|
+
const STEPS = 50;
|
|
172
|
+
const t = this._wpFrame;
|
|
173
|
+
|
|
174
|
+
// Colors from CSS vars — read ONCE and cache. Calling getComputedStyle every
|
|
175
|
+
// frame forces a full style recalc per frame, which janks/freezes the canvas
|
|
176
|
+
// animation badly when it's painting over a heavy photo. (Theme changes are
|
|
177
|
+
// rare; the spinner is short-lived, so a stale cache is fine.)
|
|
178
|
+
if (!this._wpColors) {
|
|
179
|
+
const s = getComputedStyle(document.documentElement);
|
|
180
|
+
this._wpColors = {
|
|
181
|
+
fg: s.getPropertyValue('--red').trim() || s.getPropertyValue('--fg').trim() || '#9cdef2',
|
|
182
|
+
track: s.getPropertyValue('--border').trim() || '#355a66',
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
const fg = this._wpColors.fg;
|
|
186
|
+
const track = this._wpColors.track;
|
|
187
|
+
|
|
188
|
+
function spiralPoint(frac, rot) {
|
|
189
|
+
const r = maxR * (1 - frac);
|
|
190
|
+
const angle = frac * TOTAL_TURNS * Math.PI * 2 + rot;
|
|
191
|
+
return { x: cx + Math.cos(angle) * r, y: cy + Math.sin(angle) * r };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
ctx.clearRect(0, 0, W, H);
|
|
195
|
+
|
|
196
|
+
// track ring
|
|
197
|
+
ctx.beginPath();
|
|
198
|
+
ctx.arc(cx, cy, maxR - lw / 2, 0, Math.PI * 2);
|
|
199
|
+
ctx.strokeStyle = track;
|
|
200
|
+
ctx.lineWidth = lw;
|
|
201
|
+
ctx.globalAlpha = 0.35;
|
|
202
|
+
ctx.stroke();
|
|
203
|
+
ctx.globalAlpha = 1;
|
|
204
|
+
|
|
205
|
+
const headPos = (t * 0.008) % 1;
|
|
206
|
+
|
|
207
|
+
// overlapping sub-paths for smooth fade
|
|
208
|
+
ctx.lineCap = 'round';
|
|
209
|
+
ctx.lineJoin = 'round';
|
|
210
|
+
for (let layer = LAYERS - 1; layer >= 0; layer--) {
|
|
211
|
+
const endFrac = (layer + 1) / LAYERS;
|
|
212
|
+
const stepsForLayer = Math.ceil(STEPS * endFrac);
|
|
213
|
+
const alpha = Math.pow(1 - endFrac, 2) * 0.7;
|
|
214
|
+
|
|
215
|
+
ctx.beginPath();
|
|
216
|
+
let started = false;
|
|
217
|
+
let prevPos = -1;
|
|
218
|
+
for (let i = 0; i <= stepsForLayer; i++) {
|
|
219
|
+
const frac = i / STEPS;
|
|
220
|
+
let pos = headPos - frac * TAIL_LEN;
|
|
221
|
+
if (pos < 0) pos += 1;
|
|
222
|
+
if (started && prevPos < 0.3 && pos > 0.7) {
|
|
223
|
+
ctx.stroke();
|
|
224
|
+
ctx.beginPath();
|
|
225
|
+
started = false;
|
|
226
|
+
}
|
|
227
|
+
const pt = spiralPoint(pos, t * SPIN_SPEED);
|
|
228
|
+
if (!started) { ctx.moveTo(pt.x, pt.y); started = true; }
|
|
229
|
+
else ctx.lineTo(pt.x, pt.y);
|
|
230
|
+
prevPos = pos;
|
|
231
|
+
}
|
|
232
|
+
ctx.strokeStyle = fg;
|
|
233
|
+
ctx.lineWidth = lw * 0.8;
|
|
234
|
+
ctx.globalAlpha = alpha;
|
|
235
|
+
ctx.stroke();
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// bright dot at head
|
|
239
|
+
const head = spiralPoint(headPos, t * SPIN_SPEED);
|
|
240
|
+
ctx.beginPath();
|
|
241
|
+
ctx.arc(head.x, head.y, Math.max(1, lw * 0.45), 0, Math.PI * 2);
|
|
242
|
+
ctx.fillStyle = fg;
|
|
243
|
+
ctx.globalAlpha = 0.9;
|
|
244
|
+
ctx.fill();
|
|
245
|
+
ctx.globalAlpha = 1;
|
|
246
|
+
|
|
247
|
+
this._wpFrame++;
|
|
248
|
+
if (!this.isRunning) return;
|
|
249
|
+
// Leak-safe self-terminate: stop once our element WAS in the DOM and then
|
|
250
|
+
// got removed (e.g. a loading row replaced by results). But keep spinning
|
|
251
|
+
// before it's first appended — start() runs synchronously, before the
|
|
252
|
+
// caller inserts the element, so it isn't connected on frame 1.
|
|
253
|
+
const connected = !!(this.element && this.element.isConnected);
|
|
254
|
+
if (connected) this._wpWasConnected = true;
|
|
255
|
+
if (connected || !this._wpWasConnected) {
|
|
256
|
+
this.rafId = requestAnimationFrame(() => this._drawWhirlpool());
|
|
257
|
+
} else {
|
|
258
|
+
this.isRunning = false;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Update the spinner display
|
|
264
|
+
*/
|
|
265
|
+
updateDisplay() {
|
|
266
|
+
if (!this.element) return;
|
|
267
|
+
|
|
268
|
+
const frame = this.frames[this.currentFrame % this.frames.length];
|
|
269
|
+
|
|
270
|
+
let display = '';
|
|
271
|
+
if (this.style === "left") {
|
|
272
|
+
display = `${frame} ${this.message}`;
|
|
273
|
+
} else if (this.style === "right") {
|
|
274
|
+
display = `${this.message} ${frame}`;
|
|
275
|
+
} else { // clean
|
|
276
|
+
display = this.message;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
this.element.innerHTML = display;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Start the spinner animation
|
|
284
|
+
*/
|
|
285
|
+
start(speed = 150) {
|
|
286
|
+
if (this.isRunning) return;
|
|
287
|
+
this.isRunning = true;
|
|
288
|
+
|
|
289
|
+
if (this.animation === 'sinewave') {
|
|
290
|
+
this._wavePrev = performance.now();
|
|
291
|
+
this._drawSineWave();
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (this.animation === 'whirlpool') {
|
|
296
|
+
this._wpFrame = 60;
|
|
297
|
+
this._drawWhirlpool();
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
this.currentFrame = 0;
|
|
302
|
+
this.intervalId = setInterval(() => {
|
|
303
|
+
this.currentFrame++;
|
|
304
|
+
this.updateDisplay();
|
|
305
|
+
}, speed);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Stop the spinner
|
|
310
|
+
*/
|
|
311
|
+
stop() {
|
|
312
|
+
this.isRunning = false;
|
|
313
|
+
if (this.intervalId) {
|
|
314
|
+
clearInterval(this.intervalId);
|
|
315
|
+
this.intervalId = null;
|
|
316
|
+
}
|
|
317
|
+
if (this.rafId) {
|
|
318
|
+
cancelAnimationFrame(this.rafId);
|
|
319
|
+
this.rafId = null;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/**
|
|
324
|
+
* Update the message while spinner is running
|
|
325
|
+
*/
|
|
326
|
+
updateMessage(newMessage) {
|
|
327
|
+
this.message = newMessage;
|
|
328
|
+
if ((this.animation === 'sinewave' || this.animation === 'whirlpool') && this._msgSpan) {
|
|
329
|
+
this._msgSpan.textContent = newMessage;
|
|
330
|
+
} else {
|
|
331
|
+
this.updateDisplay();
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Update the spinner label text
|
|
337
|
+
*/
|
|
338
|
+
updateLabel(newMessage) {
|
|
339
|
+
this.message = newMessage;
|
|
340
|
+
if (this._msgSpan) {
|
|
341
|
+
this._msgSpan.textContent = newMessage;
|
|
342
|
+
} else {
|
|
343
|
+
this.updateDisplay();
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Destroy the spinner and clean up
|
|
349
|
+
*/
|
|
350
|
+
destroy() {
|
|
351
|
+
this.stop();
|
|
352
|
+
if (this.element && this.element.parentNode) {
|
|
353
|
+
this.element.parentNode.removeChild(this.element);
|
|
354
|
+
}
|
|
355
|
+
this.element = null;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Create a new spinner instance
|
|
361
|
+
*/
|
|
362
|
+
export function create(message, style = "right", animation = "wave") {
|
|
363
|
+
return new Spinner(message, style, animation);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Create a standalone whirlpool circle spinner (replaces CSS .spinner)
|
|
368
|
+
* Returns { element, start(), stop(), destroy() }
|
|
369
|
+
*/
|
|
370
|
+
export function createWhirlpool(size = 24) {
|
|
371
|
+
const sp = new Spinner('', 'clean', 'whirlpool');
|
|
372
|
+
sp._wpSize = size;
|
|
373
|
+
const el = sp.createElement();
|
|
374
|
+
// wrap in a div matching .spinner layout
|
|
375
|
+
const wrap = document.createElement('div');
|
|
376
|
+
wrap.className = 'spinner-whirlpool';
|
|
377
|
+
wrap.style.cssText = `width:${size}px;height:${size}px;margin:8px auto;`;
|
|
378
|
+
wrap.appendChild(el);
|
|
379
|
+
sp.start();
|
|
380
|
+
return { element: wrap, stop: () => sp.stop(), destroy: () => sp.destroy() };
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* A consistent inline loading row for list/library empty-states: a label plus
|
|
385
|
+
* the whirlpool spinner. Returns a detached element; the spinner self-stops
|
|
386
|
+
* once the element leaves the DOM (see _drawWhirlpool), so callers can just
|
|
387
|
+
* replace it with results — no manual cleanup needed.
|
|
388
|
+
*/
|
|
389
|
+
export function createLoadingRow(text = 'Loading…', size = 16) {
|
|
390
|
+
const sp = new Spinner('', 'clean', 'whirlpool');
|
|
391
|
+
sp._wpSize = size;
|
|
392
|
+
const canvas = sp.createElement();
|
|
393
|
+
const row = document.createElement('div');
|
|
394
|
+
row.className = 'lib-loading-row';
|
|
395
|
+
const label = document.createElement('span');
|
|
396
|
+
label.textContent = text;
|
|
397
|
+
row.appendChild(label);
|
|
398
|
+
row.appendChild(canvas);
|
|
399
|
+
sp.start();
|
|
400
|
+
return row;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
export { Spinner };
|
|
404
|
+
|
|
405
|
+
const spinnerModule = { create, createWhirlpool, createLoadingRow, Spinner };
|
|
406
|
+
export default spinnerModule;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
// static/js/storage.js
|
|
2
|
+
// Centralized localStorage access with key constants and JSON parse safety
|
|
3
|
+
|
|
4
|
+
// ── Key constants ──
|
|
5
|
+
export const KEYS = {
|
|
6
|
+
THEME: 'zero-theme',
|
|
7
|
+
TOGGLES: 'zero-toggles',
|
|
8
|
+
SIDEBAR_COLLAPSED: 'sidebar-collapsed',
|
|
9
|
+
SIDEBAR_WIDTH: 'sidebar-width',
|
|
10
|
+
SIDEBAR_SIDE: 'sidebar-side',
|
|
11
|
+
CURRENT_SESSION: 'currentSessionId',
|
|
12
|
+
COMPARE_SAVE: 'compare-save-results',
|
|
13
|
+
COMPARE_CHAT: 'compare-continue-chat',
|
|
14
|
+
COMPARE_BLIND: 'compare-blind',
|
|
15
|
+
COMPARE_RANDOM: 'compare-randomize',
|
|
16
|
+
MODELS_EXPANDED: 'zero-model-expanded',
|
|
17
|
+
MODEL_ENDPOINTS: 'zero-model-endpoints',
|
|
18
|
+
MODEL_SELECTED: 'zero-selected-model',
|
|
19
|
+
SORT_ORDER: 'zero-sessions-sort',
|
|
20
|
+
CHAT_SEARCH_SCOPE: 'zero-search-scope',
|
|
21
|
+
INCOGNITO: 'zero-incognito',
|
|
22
|
+
RAG_ACTIVE: 'zero-rag-active',
|
|
23
|
+
MCP_ACTIVE: 'zero-mcp-active',
|
|
24
|
+
SECTION_ORDER: 'sidebar-section-order',
|
|
25
|
+
ADMIN_LAST_TAB: 'admin-last-tab',
|
|
26
|
+
DENSITY: 'zero-density'
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Safely get and parse a JSON value from localStorage.
|
|
31
|
+
* Returns fallback on any error.
|
|
32
|
+
*/
|
|
33
|
+
export function getJSON(key, fallback) {
|
|
34
|
+
try {
|
|
35
|
+
const raw = localStorage.getItem(key);
|
|
36
|
+
if (raw === null) return fallback !== undefined ? fallback : null;
|
|
37
|
+
return JSON.parse(raw);
|
|
38
|
+
} catch (e) {
|
|
39
|
+
console.warn('[Storage] Failed to parse key "' + key + '":', e.message);
|
|
40
|
+
return fallback !== undefined ? fallback : null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Set a JSON-serialized value in localStorage.
|
|
46
|
+
*/
|
|
47
|
+
export function setJSON(key, value) {
|
|
48
|
+
try {
|
|
49
|
+
localStorage.setItem(key, JSON.stringify(value));
|
|
50
|
+
} catch (e) {
|
|
51
|
+
console.warn('[Storage] Failed to set key "' + key + '":', e.message);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Get a raw string value from localStorage.
|
|
57
|
+
*/
|
|
58
|
+
export function get(key, fallback) {
|
|
59
|
+
try {
|
|
60
|
+
const val = localStorage.getItem(key);
|
|
61
|
+
return val !== null ? val : (fallback !== undefined ? fallback : null);
|
|
62
|
+
} catch (e) {
|
|
63
|
+
return fallback !== undefined ? fallback : null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Set a raw string value in localStorage.
|
|
69
|
+
*/
|
|
70
|
+
export function set(key, value) {
|
|
71
|
+
try {
|
|
72
|
+
localStorage.setItem(key, value);
|
|
73
|
+
} catch (e) {
|
|
74
|
+
console.warn('[Storage] Failed to set key "' + key + '":', e.message);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Remove a key from localStorage.
|
|
80
|
+
*/
|
|
81
|
+
export function remove(key) {
|
|
82
|
+
try {
|
|
83
|
+
localStorage.removeItem(key);
|
|
84
|
+
} catch (e) {
|
|
85
|
+
// Ignore removal errors
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ── Toggle state helpers ──
|
|
90
|
+
|
|
91
|
+
export function loadToggleState() {
|
|
92
|
+
return getJSON(KEYS.TOGGLES, {});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function saveToggleState(state) {
|
|
96
|
+
setJSON(KEYS.TOGGLES, state);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function getToggle(name, fallback) {
|
|
100
|
+
const state = loadToggleState();
|
|
101
|
+
return state[name] !== undefined ? state[name] : (fallback !== undefined ? fallback : false);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export function setToggle(name, value) {
|
|
105
|
+
const state = loadToggleState();
|
|
106
|
+
state[name] = value;
|
|
107
|
+
saveToggleState(state);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const Storage = {
|
|
111
|
+
KEYS,
|
|
112
|
+
getJSON,
|
|
113
|
+
setJSON,
|
|
114
|
+
get,
|
|
115
|
+
set,
|
|
116
|
+
remove,
|
|
117
|
+
loadToggleState,
|
|
118
|
+
saveToggleState,
|
|
119
|
+
getToggle,
|
|
120
|
+
setToggle
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default Storage;
|