@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,225 @@
|
|
|
1
|
+
// static/js/researchSynapse.js
|
|
2
|
+
//
|
|
3
|
+
// Live SVG visualization of a deep-research run: central query node with
|
|
4
|
+
// sub-question branches and source leaves that pop in as rounds progress.
|
|
5
|
+
// Driven imperatively by chat.js when SSE research_progress events arrive.
|
|
6
|
+
|
|
7
|
+
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
8
|
+
|
|
9
|
+
const PHASE_LABEL = {
|
|
10
|
+
probing: 'verifying model',
|
|
11
|
+
planning: 'planning strategy',
|
|
12
|
+
searching: 'searching',
|
|
13
|
+
reading: 'reading sources',
|
|
14
|
+
analyzing: 'analyzing findings',
|
|
15
|
+
writing: 'writing report',
|
|
16
|
+
error: 'error',
|
|
17
|
+
done: 'complete',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function rand(a, b) { return Math.random() * (b - a) + a; }
|
|
21
|
+
function pick(arr) { return arr[Math.floor(Math.random() * arr.length)]; }
|
|
22
|
+
|
|
23
|
+
export default function createResearchSynapse(container, opts = {}) {
|
|
24
|
+
const W = 520, H = 220;
|
|
25
|
+
const cx = W / 2, cy = H / 2;
|
|
26
|
+
|
|
27
|
+
const wrap = document.createElement('div');
|
|
28
|
+
wrap.className = 'research-synapse' + (opts.compact ? ' research-synapse-compact' : '');
|
|
29
|
+
wrap.innerHTML = `
|
|
30
|
+
<div class="rs-stage">
|
|
31
|
+
<svg viewBox="0 0 ${W} ${H}" preserveAspectRatio="xMidYMid meet">
|
|
32
|
+
<g class="rs-edges"></g>
|
|
33
|
+
<g class="rs-nodes"></g>
|
|
34
|
+
<circle class="rs-pulse" cx="${cx}" cy="${cy}" r="6"></circle>
|
|
35
|
+
</svg>
|
|
36
|
+
</div>
|
|
37
|
+
<div class="rs-meta">
|
|
38
|
+
<span class="rs-status">starting…</span>
|
|
39
|
+
<span class="rs-sep">·</span>
|
|
40
|
+
<span class="rs-round">round <b>0</b></span>
|
|
41
|
+
<span class="rs-sep">·</span>
|
|
42
|
+
<span class="rs-sources"><b>0</b> sources</span>
|
|
43
|
+
<span class="rs-sep">·</span>
|
|
44
|
+
<span class="rs-timer">00:00</span>
|
|
45
|
+
</div>
|
|
46
|
+
`;
|
|
47
|
+
container.appendChild(wrap);
|
|
48
|
+
|
|
49
|
+
const svg = wrap.querySelector('svg');
|
|
50
|
+
const edgesG = wrap.querySelector('.rs-edges');
|
|
51
|
+
const nodesG = wrap.querySelector('.rs-nodes');
|
|
52
|
+
const statusE = wrap.querySelector('.rs-status');
|
|
53
|
+
const roundE = wrap.querySelector('.rs-round b');
|
|
54
|
+
const srcE = wrap.querySelector('.rs-sources b');
|
|
55
|
+
const timerE = wrap.querySelector('.rs-timer');
|
|
56
|
+
|
|
57
|
+
// ── root (query) ───────────────────────────────────────────────
|
|
58
|
+
const root = document.createElementNS(SVG_NS, 'circle');
|
|
59
|
+
root.setAttribute('cx', cx); root.setAttribute('cy', cy);
|
|
60
|
+
root.setAttribute('r', 11);
|
|
61
|
+
root.setAttribute('class', 'rs-node rs-node-root');
|
|
62
|
+
nodesG.appendChild(root);
|
|
63
|
+
const rootLabel = document.createElementNS(SVG_NS, 'text');
|
|
64
|
+
rootLabel.setAttribute('x', cx);
|
|
65
|
+
rootLabel.setAttribute('y', cy + 28);
|
|
66
|
+
rootLabel.setAttribute('text-anchor', 'middle');
|
|
67
|
+
rootLabel.setAttribute('class', 'rs-label');
|
|
68
|
+
rootLabel.textContent = _trunc(opts.query || 'query', 28);
|
|
69
|
+
nodesG.appendChild(rootLabel);
|
|
70
|
+
|
|
71
|
+
const subs = []; // { x, y, count }
|
|
72
|
+
let sourceCount = 0;
|
|
73
|
+
let lastRound = 0;
|
|
74
|
+
let completed = false;
|
|
75
|
+
|
|
76
|
+
// ── timer ──────────────────────────────────────────────────────
|
|
77
|
+
const startedAt = opts.startedAt || Date.now();
|
|
78
|
+
let timerInterval = setInterval(() => {
|
|
79
|
+
const elapsed = Math.floor((Date.now() - startedAt) / 1000);
|
|
80
|
+
timerE.textContent =
|
|
81
|
+
String(Math.floor(elapsed / 60)).padStart(2, '0') + ':' +
|
|
82
|
+
String(elapsed % 60).padStart(2, '0');
|
|
83
|
+
}, 1000);
|
|
84
|
+
|
|
85
|
+
// ── helpers ────────────────────────────────────────────────────
|
|
86
|
+
function _trunc(s, n) {
|
|
87
|
+
if (!s) return '';
|
|
88
|
+
s = String(s).replace(/\s+/g, ' ').trim();
|
|
89
|
+
return s.length > n ? s.slice(0, n - 1) + '…' : s;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function _addSub(label) {
|
|
93
|
+
if (subs.length >= 10) return; // cap visual clutter
|
|
94
|
+
// Spread subs around a circle; reserve slight offset so first sub doesn't
|
|
95
|
+
// sit directly above the root label.
|
|
96
|
+
const slot = subs.length;
|
|
97
|
+
const totalSlots = Math.max(6, subs.length + 1);
|
|
98
|
+
const angle = (slot / totalSlots) * Math.PI * 2 - Math.PI / 2;
|
|
99
|
+
const r = 78;
|
|
100
|
+
const x = cx + Math.cos(angle) * r;
|
|
101
|
+
const y = cy + Math.sin(angle) * r;
|
|
102
|
+
|
|
103
|
+
const edge = document.createElementNS(SVG_NS, 'line');
|
|
104
|
+
edge.setAttribute('x1', cx); edge.setAttribute('y1', cy);
|
|
105
|
+
edge.setAttribute('x2', x); edge.setAttribute('y2', y);
|
|
106
|
+
edge.setAttribute('class', 'rs-edge rs-edge-firing');
|
|
107
|
+
edgesG.appendChild(edge);
|
|
108
|
+
setTimeout(() => edge.classList.remove('rs-edge-firing'), 1100);
|
|
109
|
+
|
|
110
|
+
const n = document.createElementNS(SVG_NS, 'circle');
|
|
111
|
+
n.setAttribute('cx', x); n.setAttribute('cy', y); n.setAttribute('r', 7);
|
|
112
|
+
n.setAttribute('class', 'rs-node rs-node-sub rs-node-new');
|
|
113
|
+
nodesG.appendChild(n);
|
|
114
|
+
|
|
115
|
+
if (label) {
|
|
116
|
+
const t = document.createElementNS(SVG_NS, 'text');
|
|
117
|
+
// Position label outside the circle on the same angle
|
|
118
|
+
const lx = cx + Math.cos(angle) * (r + 14);
|
|
119
|
+
const ly = cy + Math.sin(angle) * (r + 14);
|
|
120
|
+
t.setAttribute('x', lx); t.setAttribute('y', ly + 3);
|
|
121
|
+
t.setAttribute('text-anchor', Math.cos(angle) > 0.15 ? 'start' :
|
|
122
|
+
Math.cos(angle) < -0.15 ? 'end' : 'middle');
|
|
123
|
+
t.setAttribute('class', 'rs-label rs-label-sub');
|
|
124
|
+
t.textContent = _trunc(label, 14);
|
|
125
|
+
nodesG.appendChild(t);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
subs.push({ x, y, count: 0 });
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function _addLeaf() {
|
|
132
|
+
if (!subs.length) _addSub('');
|
|
133
|
+
// Always attach the new source to the CURRENT round's sub (i.e. the
|
|
134
|
+
// most-recently-added one). That gives a clean per-round attribution
|
|
135
|
+
// — 10 sources across 3 rounds ends up as 10/10/10 across the three
|
|
136
|
+
// sub-nodes, not a random scatter.
|
|
137
|
+
const sub = subs[subs.length - 1];
|
|
138
|
+
sub.count++;
|
|
139
|
+
// Lay leaves out in concentric arcs around the sub: 6 per ring fanned
|
|
140
|
+
// across ~140°, then a second ring further out for the next 6, etc.
|
|
141
|
+
// Keeps things readable past 10+ leaves per sub.
|
|
142
|
+
const baseAngle = Math.atan2(sub.y - cy, sub.x - cx);
|
|
143
|
+
const idx = sub.count - 1;
|
|
144
|
+
const perRing = 6;
|
|
145
|
+
const ring = Math.floor(idx / perRing);
|
|
146
|
+
const slot = idx % perRing;
|
|
147
|
+
const arcSpan = 2.4;
|
|
148
|
+
const angle = baseAngle + (slot - (perRing - 1) / 2) * (arcSpan / perRing) + rand(-0.05, 0.05);
|
|
149
|
+
const r = 26 + ring * 14 + rand(-1.5, 1.5);
|
|
150
|
+
const lx = sub.x + Math.cos(angle) * r;
|
|
151
|
+
const ly = sub.y + Math.sin(angle) * r;
|
|
152
|
+
|
|
153
|
+
const edge = document.createElementNS(SVG_NS, 'line');
|
|
154
|
+
edge.setAttribute('x1', sub.x); edge.setAttribute('y1', sub.y);
|
|
155
|
+
edge.setAttribute('x2', lx); edge.setAttribute('y2', ly);
|
|
156
|
+
edge.setAttribute('class', 'rs-edge rs-edge-firing');
|
|
157
|
+
edgesG.appendChild(edge);
|
|
158
|
+
setTimeout(() => edge.classList.remove('rs-edge-firing'), 1100);
|
|
159
|
+
|
|
160
|
+
const leaf = document.createElementNS(SVG_NS, 'circle');
|
|
161
|
+
leaf.setAttribute('cx', lx); leaf.setAttribute('cy', ly);
|
|
162
|
+
leaf.setAttribute('r', 4);
|
|
163
|
+
leaf.setAttribute('class', 'rs-node rs-node-leaf rs-node-new');
|
|
164
|
+
nodesG.appendChild(leaf);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ── public API ─────────────────────────────────────────────────
|
|
168
|
+
return {
|
|
169
|
+
element: wrap,
|
|
170
|
+
|
|
171
|
+
/** Reflect a phase change in the status text + side effects. */
|
|
172
|
+
setPhase(phase, extra = {}) {
|
|
173
|
+
if (completed) return;
|
|
174
|
+
const label = PHASE_LABEL[phase] || phase || '';
|
|
175
|
+
let txt = label;
|
|
176
|
+
if (phase === 'searching' && extra.queries) txt += ` · ${extra.queries} queries`;
|
|
177
|
+
else if (phase === 'reading' && extra.title) txt = `reading: ${_trunc(extra.title, 32)}`;
|
|
178
|
+
else if (phase === 'analyzing' && extra.total_findings) txt += ` · ${extra.total_findings} findings`;
|
|
179
|
+
statusE.textContent = txt;
|
|
180
|
+
// Visual cue per phase
|
|
181
|
+
if (phase === 'error') wrap.classList.add('rs-error');
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
/** Bump the round counter — adds a sub-question node when round grows. */
|
|
185
|
+
setRound(round, opts = {}) {
|
|
186
|
+
if (completed) return;
|
|
187
|
+
if (typeof round !== 'number' || round < 1) return;
|
|
188
|
+
if (round > lastRound) {
|
|
189
|
+
// Add one sub-question node per new round we see
|
|
190
|
+
for (let i = lastRound; i < round && subs.length < 10; i++) {
|
|
191
|
+
_addSub(opts.label || `R${i + 1}`);
|
|
192
|
+
}
|
|
193
|
+
lastRound = round;
|
|
194
|
+
roundE.textContent = round;
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
|
|
198
|
+
/** Update the total source count — adds leaf nodes for any new sources. */
|
|
199
|
+
setSourceCount(total) {
|
|
200
|
+
if (completed) return;
|
|
201
|
+
if (typeof total !== 'number' || total <= sourceCount) return;
|
|
202
|
+
const delta = Math.min(total - sourceCount, 6); // animate at most 6 at a time
|
|
203
|
+
for (let i = 0; i < delta; i++) {
|
|
204
|
+
// Stagger leaves slightly so they don't all pop on the same frame
|
|
205
|
+
setTimeout(_addLeaf, i * 110);
|
|
206
|
+
}
|
|
207
|
+
sourceCount = total;
|
|
208
|
+
srcE.textContent = total;
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/** Mark the run as done — freezes the pulse and tints the graph green. */
|
|
212
|
+
complete() {
|
|
213
|
+
if (completed) return;
|
|
214
|
+
completed = true;
|
|
215
|
+
wrap.classList.add('rs-complete');
|
|
216
|
+
statusE.textContent = 'complete';
|
|
217
|
+
if (timerInterval) { clearInterval(timerInterval); timerInterval = null; }
|
|
218
|
+
},
|
|
219
|
+
|
|
220
|
+
destroy() {
|
|
221
|
+
if (timerInterval) { clearInterval(timerInterval); timerInterval = null; }
|
|
222
|
+
if (wrap.parentNode) wrap.parentNode.removeChild(wrap);
|
|
223
|
+
},
|
|
224
|
+
};
|
|
225
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// Search Chat Module — Ctrl+K command palette for searching conversations
|
|
2
|
+
|
|
3
|
+
import uiModule from './ui.js';
|
|
4
|
+
import sessionModule from './sessions.js';
|
|
5
|
+
|
|
6
|
+
let API_BASE = '';
|
|
7
|
+
let debounceTimer = null;
|
|
8
|
+
let selectedIndex = -1;
|
|
9
|
+
let results = [];
|
|
10
|
+
|
|
11
|
+
function el(id) { return document.getElementById(id); }
|
|
12
|
+
|
|
13
|
+
export function openSearch() {
|
|
14
|
+
const overlay = el('search-overlay');
|
|
15
|
+
if (!overlay) return;
|
|
16
|
+
overlay.classList.remove('hidden');
|
|
17
|
+
const input = el('search-input');
|
|
18
|
+
if (input) {
|
|
19
|
+
input.value = '';
|
|
20
|
+
input.focus();
|
|
21
|
+
}
|
|
22
|
+
selectedIndex = -1;
|
|
23
|
+
results = [];
|
|
24
|
+
el('search-results').innerHTML = '';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function closeSearch() {
|
|
28
|
+
const overlay = el('search-overlay');
|
|
29
|
+
if (!overlay) return;
|
|
30
|
+
overlay.classList.add('hidden');
|
|
31
|
+
el('search-results').innerHTML = '';
|
|
32
|
+
selectedIndex = -1;
|
|
33
|
+
results = [];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function isOpen() {
|
|
37
|
+
const overlay = el('search-overlay');
|
|
38
|
+
return overlay && !overlay.classList.contains('hidden');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
var escapeHtml = uiModule.esc;
|
|
42
|
+
|
|
43
|
+
function highlightMatch(text, query) {
|
|
44
|
+
if (!query) return escapeHtml(text);
|
|
45
|
+
const escaped = escapeHtml(text);
|
|
46
|
+
const regex = new RegExp('(' + query.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + ')', 'gi');
|
|
47
|
+
return escaped.replace(regex, '<mark class="search-highlight">$1</mark>');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function formatTimestamp(iso) {
|
|
51
|
+
if (!iso) return '';
|
|
52
|
+
const d = new Date(iso);
|
|
53
|
+
const now = new Date();
|
|
54
|
+
const diff = now - d;
|
|
55
|
+
if (diff < 86400000) {
|
|
56
|
+
return d.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
|
|
57
|
+
}
|
|
58
|
+
if (diff < 604800000) {
|
|
59
|
+
return d.toLocaleDateString([], { weekday: 'short', hour: '2-digit', minute: '2-digit' });
|
|
60
|
+
}
|
|
61
|
+
return d.toLocaleDateString([], { month: 'short', day: 'numeric', year: 'numeric' });
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function renderResults(data, query) {
|
|
65
|
+
results = data;
|
|
66
|
+
selectedIndex = -1;
|
|
67
|
+
const container = el('search-results');
|
|
68
|
+
if (!container) return;
|
|
69
|
+
|
|
70
|
+
if (!data || data.length === 0) {
|
|
71
|
+
container.innerHTML = query
|
|
72
|
+
? '<div class="search-empty">No results found</div>'
|
|
73
|
+
: '';
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// Group by session
|
|
78
|
+
const grouped = {};
|
|
79
|
+
for (const r of data) {
|
|
80
|
+
if (!grouped[r.session_id]) {
|
|
81
|
+
grouped[r.session_id] = { name: r.session_name, items: [] };
|
|
82
|
+
}
|
|
83
|
+
grouped[r.session_id].items.push(r);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let html = '';
|
|
87
|
+
let idx = 0;
|
|
88
|
+
for (const [sessionId, group] of Object.entries(grouped)) {
|
|
89
|
+
html += `<div class="search-group-header">${escapeHtml(group.name)}</div>`;
|
|
90
|
+
for (const item of group.items) {
|
|
91
|
+
const roleLabel = item.role === 'user' ? 'You' : 'AI';
|
|
92
|
+
html += `<div class="search-result-item" data-index="${idx}" data-session="${escapeHtml(sessionId)}">
|
|
93
|
+
<div class="search-result-role">${roleLabel}</div>
|
|
94
|
+
<div class="search-result-snippet">${highlightMatch(item.content_snippet, query)}</div>
|
|
95
|
+
<div class="search-result-time">${formatTimestamp(item.timestamp)}</div>
|
|
96
|
+
</div>`;
|
|
97
|
+
idx++;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
container.innerHTML = html;
|
|
101
|
+
|
|
102
|
+
// Click handlers
|
|
103
|
+
container.querySelectorAll('.search-result-item').forEach(item => {
|
|
104
|
+
item.addEventListener('click', () => {
|
|
105
|
+
const sid = item.dataset.session;
|
|
106
|
+
navigateToSession(sid);
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function navigateToSession(sessionId) {
|
|
112
|
+
closeSearch();
|
|
113
|
+
if (sessionModule && sessionModule.selectSession) {
|
|
114
|
+
sessionModule.selectSession(sessionId);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function updateSelection() {
|
|
119
|
+
const container = el('search-results');
|
|
120
|
+
if (!container) return;
|
|
121
|
+
const items = container.querySelectorAll('.search-result-item');
|
|
122
|
+
items.forEach((item, i) => {
|
|
123
|
+
item.classList.toggle('selected', i === selectedIndex);
|
|
124
|
+
});
|
|
125
|
+
// Scroll selected into view
|
|
126
|
+
if (selectedIndex >= 0 && items[selectedIndex]) {
|
|
127
|
+
items[selectedIndex].scrollIntoView({ block: 'nearest' });
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function handleKeydown(e) {
|
|
132
|
+
if (!isOpen()) return;
|
|
133
|
+
|
|
134
|
+
const container = el('search-results');
|
|
135
|
+
const items = container ? container.querySelectorAll('.search-result-item') : [];
|
|
136
|
+
const count = items.length;
|
|
137
|
+
|
|
138
|
+
if (e.key === 'ArrowDown') {
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
selectedIndex = count > 0 ? Math.min(selectedIndex + 1, count - 1) : -1;
|
|
141
|
+
updateSelection();
|
|
142
|
+
} else if (e.key === 'ArrowUp') {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
selectedIndex = Math.max(selectedIndex - 1, 0);
|
|
145
|
+
updateSelection();
|
|
146
|
+
} else if (e.key === 'Enter') {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
if (selectedIndex >= 0 && items[selectedIndex]) {
|
|
149
|
+
const sid = items[selectedIndex].dataset.session;
|
|
150
|
+
navigateToSession(sid);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function handleInput(e) {
|
|
156
|
+
const query = e.target.value.trim();
|
|
157
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
158
|
+
|
|
159
|
+
if (!query) {
|
|
160
|
+
renderResults([], '');
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
debounceTimer = setTimeout(async () => {
|
|
165
|
+
try {
|
|
166
|
+
const res = await fetch(`${API_BASE}/api/search?q=${encodeURIComponent(query)}&limit=20`);
|
|
167
|
+
if (!res.ok) return;
|
|
168
|
+
const data = await res.json();
|
|
169
|
+
renderResults(data, query);
|
|
170
|
+
} catch (err) {
|
|
171
|
+
console.error('Search error:', err);
|
|
172
|
+
}
|
|
173
|
+
}, 300);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function init(apiBase) {
|
|
177
|
+
API_BASE = apiBase || '';
|
|
178
|
+
|
|
179
|
+
const input = el('search-input');
|
|
180
|
+
if (input) {
|
|
181
|
+
input.addEventListener('input', handleInput);
|
|
182
|
+
input.addEventListener('keydown', handleKeydown);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Close on overlay click (not popup click)
|
|
186
|
+
const overlay = el('search-overlay');
|
|
187
|
+
if (overlay) {
|
|
188
|
+
overlay.addEventListener('click', (e) => {
|
|
189
|
+
if (e.target === overlay) closeSearch();
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const searchChatModule = {
|
|
195
|
+
init,
|
|
196
|
+
openSearch,
|
|
197
|
+
closeSearch,
|
|
198
|
+
isOpen,
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
export default searchChatModule;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// static/js/search.js
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Search settings management — reads active provider from admin settings.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
let API_BASE = '';
|
|
8
|
+
let _provider = 'searxng';
|
|
9
|
+
let _loaded = false;
|
|
10
|
+
|
|
11
|
+
export function init(apiBase) {
|
|
12
|
+
API_BASE = apiBase;
|
|
13
|
+
// Fetch provider on init so it's ready when chat needs it
|
|
14
|
+
_fetchProvider();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function _fetchProvider() {
|
|
18
|
+
try {
|
|
19
|
+
const res = await fetch((API_BASE || '') + '/api/auth/settings', { credentials: 'same-origin' });
|
|
20
|
+
const s = await res.json();
|
|
21
|
+
_provider = s.search_provider || 'searxng';
|
|
22
|
+
_loaded = true;
|
|
23
|
+
} catch (e) { /* keep default */ }
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function getCurrentProvider() {
|
|
27
|
+
return _provider;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const _labels = {
|
|
31
|
+
searxng: 'SearXNG', brave: 'Brave', duckduckgo: 'DuckDuckGo',
|
|
32
|
+
google_pse: 'Google', tavily: 'Tavily', serper: 'Serper',
|
|
33
|
+
disabled: 'search (disabled)',
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export function getProviderLabel() {
|
|
37
|
+
return _labels[_provider] || _provider;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Re-fetch after admin saves new settings */
|
|
41
|
+
export function refresh() {
|
|
42
|
+
_fetchProvider();
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const searchModule = {
|
|
46
|
+
init,
|
|
47
|
+
getCurrentProvider,
|
|
48
|
+
getProviderLabel,
|
|
49
|
+
refresh
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export default searchModule;
|