@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,292 @@
|
|
|
1
|
+
// ============================================
|
|
2
|
+
// Keyboard Shortcuts — dynamic keybinds
|
|
3
|
+
// ============================================
|
|
4
|
+
|
|
5
|
+
import { IS_MAC, isAltGrEvent } from './platform.js';
|
|
6
|
+
|
|
7
|
+
const _defaultKeybinds = {
|
|
8
|
+
search: 'ctrl+k', toggle_sidebar: 'ctrl+alt+b', new_session: 'ctrl+alt+n',
|
|
9
|
+
fav_session: 'ctrl+alt+f', delete_session: 'ctrl+alt+d',
|
|
10
|
+
cancel: 'escape', tts: 'alt+shift+t',
|
|
11
|
+
incognito: 'ctrl+alt+i', settings: 'ctrl+,', focus_input: 'ctrl+/',
|
|
12
|
+
// Open-tool shortcuts (Calendar bound by default; rest unbound).
|
|
13
|
+
open_calendar: 'ctrl+alt+c', open_compare: '', open_cookbook: '',
|
|
14
|
+
open_research: '', open_gallery: '', open_library: '', open_memory: '',
|
|
15
|
+
open_notes: '', open_tasks: '', open_theme: '',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export function _matchesCombo(e, combo, isMac = IS_MAC) {
|
|
19
|
+
if (!combo) return false;
|
|
20
|
+
// Drop AltGr keystrokes so typing characters on non-US layouts can't fire a
|
|
21
|
+
// Ctrl+Alt shortcut — e.g. the destructive delete_session. See platform.js.
|
|
22
|
+
if (isAltGrEvent(e, isMac)) return false;
|
|
23
|
+
const parts = combo.split('+');
|
|
24
|
+
const needCtrl = parts.includes('ctrl');
|
|
25
|
+
const needAlt = parts.includes('alt');
|
|
26
|
+
const needShift = parts.includes('shift');
|
|
27
|
+
const key = parts.filter(p => p !== 'ctrl' && p !== 'alt' && p !== 'shift')[0] || '';
|
|
28
|
+
if (needCtrl !== (e.ctrlKey || e.metaKey)) return false;
|
|
29
|
+
if (needAlt !== e.altKey) return false;
|
|
30
|
+
if (needShift !== e.shiftKey) return false;
|
|
31
|
+
return e.key.toLowerCase() === key;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Initialize keyboard shortcuts.
|
|
36
|
+
* @param {Object} modules - References to app modules and helpers
|
|
37
|
+
* @param {Function} modules.el - Element lookup helper (uiModule.el)
|
|
38
|
+
* @param {Object} modules.Storage - Storage module
|
|
39
|
+
* @param {Object} modules.sessionModule
|
|
40
|
+
* @param {Object} modules.uiModule
|
|
41
|
+
* @param {Object} modules.chatModule
|
|
42
|
+
* @param {Object} modules.adminModule
|
|
43
|
+
* @param {Object} modules.settingsModule
|
|
44
|
+
* @param {Object} modules.searchChatModule
|
|
45
|
+
* @param {Function} modules._closeCompareIfActive
|
|
46
|
+
* @param {Function} modules._deactivateIncognito
|
|
47
|
+
* @param {string} modules.API_BASE
|
|
48
|
+
*/
|
|
49
|
+
export function initKeyboardShortcuts(modules) {
|
|
50
|
+
const {
|
|
51
|
+
el, Storage, sessionModule, uiModule, chatModule,
|
|
52
|
+
adminModule, settingsModule, searchChatModule,
|
|
53
|
+
_closeCompareIfActive, _deactivateIncognito, API_BASE
|
|
54
|
+
} = modules;
|
|
55
|
+
|
|
56
|
+
window._zeroKeybinds = { ..._defaultKeybinds };
|
|
57
|
+
|
|
58
|
+
// Load saved keybinds
|
|
59
|
+
fetch('/api/auth/settings', { credentials: 'same-origin' })
|
|
60
|
+
.then(r => r.json())
|
|
61
|
+
.then(s => { if (s.keybinds) window._zeroKeybinds = { ..._defaultKeybinds, ...s.keybinds }; })
|
|
62
|
+
.catch(() => {});
|
|
63
|
+
|
|
64
|
+
// ── Esc cancels select mode (capture phase, before modal-close) ──
|
|
65
|
+
// Every tool's bulk-select bar has a `*-bulk-cancel` button whose click
|
|
66
|
+
// already runs the correct teardown (clears selection, hides the bar,
|
|
67
|
+
// re-renders). So a single global handler that clicks whichever cancel
|
|
68
|
+
// button is currently visible covers all of them — notes, skills,
|
|
69
|
+
// memory, gallery, sessions, doc library (chats/archive/research/docs),
|
|
70
|
+
// email, cookbook serve — without each module wiring its own listener.
|
|
71
|
+
// Capture phase + stopPropagation so Esc cancels select instead of
|
|
72
|
+
// closing the surrounding modal.
|
|
73
|
+
document.addEventListener('keydown', (e) => {
|
|
74
|
+
if (e.key !== 'Escape') return;
|
|
75
|
+
const cancels = document.querySelectorAll('[id$="-bulk-cancel"]');
|
|
76
|
+
for (const btn of cancels) {
|
|
77
|
+
// Do not rely on offsetParent: visible fixed-position or modal-contained
|
|
78
|
+
// controls can report null. Check the rendered box and hidden ancestors.
|
|
79
|
+
const visible = (() => {
|
|
80
|
+
if (btn.disabled || btn.closest('.hidden,[hidden]')) return false;
|
|
81
|
+
const cs = getComputedStyle(btn);
|
|
82
|
+
if (cs.display === 'none' || cs.visibility === 'hidden' || cs.opacity === '0') return false;
|
|
83
|
+
return btn.offsetWidth > 0 || btn.offsetHeight > 0 || btn.getClientRects().length > 0;
|
|
84
|
+
})();
|
|
85
|
+
if (visible) {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
e.stopImmediatePropagation();
|
|
89
|
+
btn.click();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}, true);
|
|
94
|
+
|
|
95
|
+
// ── "Toggle Window" — close whatever tool window is open, or reopen the
|
|
96
|
+
// last one. Maps each window's modal element to the button/title that
|
|
97
|
+
// opens it (mirrors modalManager's _AUTO_WIRE, plus email's section title).
|
|
98
|
+
const _WINDOW_TRIGGERS = {
|
|
99
|
+
'settings-modal': 'user-bar-settings',
|
|
100
|
+
'theme-modal': 'tool-theme-btn',
|
|
101
|
+
'tasks-modal': 'tool-tasks-btn',
|
|
102
|
+
'notes-panel': 'tool-notes-btn',
|
|
103
|
+
'memory-modal': 'tool-memory-btn',
|
|
104
|
+
'doclib-modal': 'tool-library-btn',
|
|
105
|
+
'gallery-modal': 'tool-gallery-btn',
|
|
106
|
+
'research-overlay': 'tool-research-btn',
|
|
107
|
+
'cookbook-modal': 'tool-cookbook-btn',
|
|
108
|
+
'compare-model-overlay': 'tool-compare-btn',
|
|
109
|
+
'calendar-modal': 'tool-calendar-btn',
|
|
110
|
+
'email-lib-modal': 'email-section-title',
|
|
111
|
+
};
|
|
112
|
+
let _lastWindow = 'settings-modal';
|
|
113
|
+
|
|
114
|
+
const _windowVisible = (id) => {
|
|
115
|
+
const m = document.getElementById(id);
|
|
116
|
+
if (!m || m.classList.contains('hidden')) return false;
|
|
117
|
+
const cs = getComputedStyle(m);
|
|
118
|
+
if (cs.display === 'none' || cs.visibility === 'hidden' || cs.opacity === '0') return false;
|
|
119
|
+
return m.offsetWidth > 0 || m.offsetHeight > 0 || m.getClientRects().length > 0;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const _toggleActiveWindow = () => {
|
|
123
|
+
// Close the first open window (remembering it), else reopen the last one.
|
|
124
|
+
let openId = null;
|
|
125
|
+
for (const id in _WINDOW_TRIGGERS) {
|
|
126
|
+
if (_windowVisible(id)) { openId = id; break; }
|
|
127
|
+
}
|
|
128
|
+
if (openId) {
|
|
129
|
+
_lastWindow = openId;
|
|
130
|
+
const m = document.getElementById(openId);
|
|
131
|
+
const closeBtn = m && m.querySelector('.close-btn, .modal-close, [data-close]');
|
|
132
|
+
if (closeBtn) closeBtn.click();
|
|
133
|
+
else if (openId === 'settings-modal' && settingsModule) settingsModule.close();
|
|
134
|
+
else { const t = el(_WINDOW_TRIGGERS[openId]); if (t) t.click(); }
|
|
135
|
+
} else if (_lastWindow === 'settings-modal') {
|
|
136
|
+
if (settingsModule) settingsModule.open();
|
|
137
|
+
} else {
|
|
138
|
+
const t = el(_WINDOW_TRIGGERS[_lastWindow]);
|
|
139
|
+
if (t) t.click();
|
|
140
|
+
else if (settingsModule) settingsModule.open();
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
document.addEventListener('keydown', (e) => {
|
|
145
|
+
const kb = window._zeroKeybinds;
|
|
146
|
+
|
|
147
|
+
if (_matchesCombo(e, kb.search)) {
|
|
148
|
+
e.preventDefault();
|
|
149
|
+
if (searchChatModule) {
|
|
150
|
+
searchChatModule.isOpen() ? searchChatModule.closeSearch() : searchChatModule.openSearch();
|
|
151
|
+
}
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (_matchesCombo(e, kb.toggle_sidebar)) {
|
|
155
|
+
e.preventDefault();
|
|
156
|
+
var sb = document.getElementById('sidebar');
|
|
157
|
+
var ir = document.getElementById('icon-rail');
|
|
158
|
+
if (sb && !sb.classList.contains('hidden')) {
|
|
159
|
+
sb.classList.add('hidden');
|
|
160
|
+
} else {
|
|
161
|
+
if (ir) ir.classList.remove('rail-hidden');
|
|
162
|
+
if (sb) sb.classList.remove('hidden');
|
|
163
|
+
}
|
|
164
|
+
if (typeof syncRailSide === 'function') syncRailSide();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (_matchesCombo(e, kb.tts)) {
|
|
168
|
+
e.preventDefault();
|
|
169
|
+
var mgr = window.aiTTSManager;
|
|
170
|
+
if (!mgr || !mgr.available) return;
|
|
171
|
+
if (mgr.isPlaying || mgr._processing) { mgr.stop(); return; }
|
|
172
|
+
var allAI = document.querySelectorAll('#chat-history .msg-ai');
|
|
173
|
+
for (var i = allAI.length - 1; i >= 0; i--) {
|
|
174
|
+
var ttsBtn = allAI[i].querySelector('.ai-tts-button');
|
|
175
|
+
if (ttsBtn) { ttsBtn.click(); return; }
|
|
176
|
+
}
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (_matchesCombo(e, kb.fav_session)) {
|
|
180
|
+
e.preventDefault();
|
|
181
|
+
const sid = sessionModule && sessionModule.getCurrentSessionId();
|
|
182
|
+
if (!sid) return;
|
|
183
|
+
const s = sessionModule.getSessions().find(x => x.id === sid);
|
|
184
|
+
if (!s) return;
|
|
185
|
+
const newVal = !s.is_important;
|
|
186
|
+
const fd = new FormData();
|
|
187
|
+
fd.append('important', newVal);
|
|
188
|
+
fetch(`${API_BASE}/api/session/${sid}/important`, { method: 'POST', body: fd });
|
|
189
|
+
s.is_important = newVal;
|
|
190
|
+
sessionModule.renderSessionList();
|
|
191
|
+
uiModule.showToast(newVal ? 'Session favorited' : 'Session unfavorited');
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
if (_matchesCombo(e, kb.delete_session)) {
|
|
195
|
+
e.preventDefault();
|
|
196
|
+
const sid = sessionModule && sessionModule.getCurrentSessionId();
|
|
197
|
+
if (!sid) return;
|
|
198
|
+
const s = sessionModule.getSessions().find(x => x.id === sid);
|
|
199
|
+
if (!s) return;
|
|
200
|
+
if (s.is_important) { uiModule.showToast('Unstar before deleting'); return; }
|
|
201
|
+
uiModule.styledConfirm('Delete this session?', { confirmText: 'Delete', danger: true }).then(ok => {
|
|
202
|
+
if (!ok) return;
|
|
203
|
+
const allSessions = sessionModule.getSessions();
|
|
204
|
+
const idx = allSessions.findIndex(x => x.id === sid);
|
|
205
|
+
const nextSession = allSessions.filter(x => !x.archived && x.id !== sid)[Math.max(0, idx)] ||
|
|
206
|
+
allSessions.find(x => !x.archived && x.id !== sid);
|
|
207
|
+
fetch(`${API_BASE}/api/session/${sid}`, { method: 'DELETE' }).then(async () => {
|
|
208
|
+
await sessionModule.loadSessions();
|
|
209
|
+
if (nextSession) {
|
|
210
|
+
await sessionModule.selectSession(nextSession.id);
|
|
211
|
+
} else {
|
|
212
|
+
sessionModule.setCurrentSessionId(null);
|
|
213
|
+
el('chat-history').innerHTML = '';
|
|
214
|
+
el('current-meta').textContent = 'Zero Chat';
|
|
215
|
+
Storage.remove('lastSessionId');
|
|
216
|
+
if (chatModule && chatModule.showWelcomeScreen) chatModule.showWelcomeScreen();
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
if (_matchesCombo(e, kb.new_session)) {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
if (_closeCompareIfActive()) return;
|
|
225
|
+
_deactivateIncognito();
|
|
226
|
+
const sid = sessionModule && sessionModule.getCurrentSessionId();
|
|
227
|
+
const sessions = sessionModule ? sessionModule.getSessions() : [];
|
|
228
|
+
const cur = sessions.find(s => s.id === sid);
|
|
229
|
+
const name = new Date().toLocaleTimeString();
|
|
230
|
+
const fd = new FormData();
|
|
231
|
+
fd.append('name', name);
|
|
232
|
+
fd.append('endpoint_url', cur ? cur.endpoint_url || '' : '');
|
|
233
|
+
fd.append('model', cur ? cur.model || '' : '');
|
|
234
|
+
if (cur && cur.endpoint_id) fd.append('endpoint_id', cur.endpoint_id);
|
|
235
|
+
fd.append('skip_validation', 'true');
|
|
236
|
+
fetch(`${API_BASE}/api/session`, { method: 'POST', body: fd, credentials: 'same-origin' })
|
|
237
|
+
.then(r => r.ok ? r.json() : null)
|
|
238
|
+
.then(async data => {
|
|
239
|
+
if (data) {
|
|
240
|
+
await sessionModule.loadSessions();
|
|
241
|
+
await sessionModule.selectSession(data.id);
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
if (_matchesCombo(e, kb.cancel)) {
|
|
247
|
+
if (chatModule) chatModule.abortCurrentRequest();
|
|
248
|
+
}
|
|
249
|
+
if (_matchesCombo(e, kb.incognito)) {
|
|
250
|
+
e.preventDefault();
|
|
251
|
+
// Drive the visible button so the real toggle logic runs (visual
|
|
252
|
+
// state, welcome-screen guard, checkbox sync) — flipping the hidden
|
|
253
|
+
// checkbox alone did nothing.
|
|
254
|
+
const btn = el('incognito-btn');
|
|
255
|
+
if (btn) btn.click();
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (_matchesCombo(e, kb.settings)) {
|
|
259
|
+
e.preventDefault();
|
|
260
|
+
_toggleActiveWindow();
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
// Open-tool shortcuts — click the sidebar tool button so each tool's
|
|
264
|
+
// own open/toggle logic runs. Unbound (empty) combos never match.
|
|
265
|
+
const _toolBtns = {
|
|
266
|
+
open_calendar: 'tool-calendar-btn',
|
|
267
|
+
open_compare: 'tool-compare-btn',
|
|
268
|
+
open_cookbook: 'tool-cookbook-btn',
|
|
269
|
+
open_research: 'tool-research-btn',
|
|
270
|
+
open_gallery: 'tool-gallery-btn',
|
|
271
|
+
open_library: 'tool-library-btn',
|
|
272
|
+
open_memory: 'tool-memory-btn',
|
|
273
|
+
open_notes: 'tool-notes-btn',
|
|
274
|
+
open_tasks: 'tool-tasks-btn',
|
|
275
|
+
open_theme: 'tool-theme-btn',
|
|
276
|
+
};
|
|
277
|
+
for (const action in _toolBtns) {
|
|
278
|
+
if (_matchesCombo(e, kb[action])) {
|
|
279
|
+
e.preventDefault();
|
|
280
|
+
const b = el(_toolBtns[action]);
|
|
281
|
+
if (b) b.click();
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
if (_matchesCombo(e, kb.focus_input)) {
|
|
286
|
+
e.preventDefault();
|
|
287
|
+
const inp = el('message');
|
|
288
|
+
if (inp) inp.focus();
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
// static/js/langIcons.js
|
|
2
|
+
// Bold, distinctive icons for document languages / file types. Each icon
|
|
3
|
+
// fills the 24×24 viewBox with a recognisable silhouette — no fragile little
|
|
4
|
+
// inset-on-a-page-outline approach. Designed to read clearly at 12–14px.
|
|
5
|
+
|
|
6
|
+
const ICONS = {
|
|
7
|
+
// Markdown — the official "M↓" logo silhouette, simplified.
|
|
8
|
+
markdown:
|
|
9
|
+
'<rect x="2" y="5" width="20" height="14" rx="2"/>' +
|
|
10
|
+
'<polyline points="6 15 6 9 9 12 12 9 12 15"/>' +
|
|
11
|
+
'<polyline points="16 9 16 15 13 12"/>' +
|
|
12
|
+
'<polyline points="16 15 19 12 16 9"/>',
|
|
13
|
+
// CSV — bold 3-column spreadsheet
|
|
14
|
+
csv:
|
|
15
|
+
'<rect x="3" y="4" width="18" height="16" rx="1.5"/>' +
|
|
16
|
+
'<line x1="3" y1="9" x2="21" y2="9"/>' +
|
|
17
|
+
'<line x1="3" y1="14" x2="21" y2="14"/>' +
|
|
18
|
+
'<line x1="9" y1="4" x2="9" y2="20"/>' +
|
|
19
|
+
'<line x1="15" y1="4" x2="15" y2="20"/>',
|
|
20
|
+
// Python — interlocking double-snake silhouette (simplified)
|
|
21
|
+
python:
|
|
22
|
+
'<path d="M12 2c-3 0-5 1-5 4v3h6v1H4c-1.5 0-3 1-3 4s1.5 4 3 4h3v-3c0-2 2-3 4-3h5c2 0 4-1 4-3V6c0-3-2-4-5-4z"/>' +
|
|
23
|
+
'<circle cx="9" cy="5" r="1" fill="currentColor"/>' +
|
|
24
|
+
'<circle cx="15" cy="19" r="1" fill="currentColor"/>',
|
|
25
|
+
// HTML — bold angle-bracket code: </>
|
|
26
|
+
html:
|
|
27
|
+
'<polyline points="8 5 2 12 8 19"/>' +
|
|
28
|
+
'<polyline points="16 5 22 12 16 19"/>' +
|
|
29
|
+
'<line x1="14" y1="3" x2="10" y2="21"/>',
|
|
30
|
+
// JSON — bold { }
|
|
31
|
+
json:
|
|
32
|
+
'<path d="M9 3c-3 0-3 4-3 6 0 3-3 3-3 3s3 0 3 3 0 6 3 6"/>' +
|
|
33
|
+
'<path d="M15 3c3 0 3 4 3 6 0 3 3 3 3 3s-3 0-3 3 0 6-3 6"/>',
|
|
34
|
+
// JavaScript — JS letters in a rounded badge
|
|
35
|
+
javascript:
|
|
36
|
+
'<rect x="2" y="2" width="20" height="20" rx="2.5"/>' +
|
|
37
|
+
'<path d="M11 11v6c0 1.5-1 2.2-2.3 2.2S6.5 18.5 6.5 17"/>' +
|
|
38
|
+
'<path d="M14 17.5c0 1.2 1.2 1.7 2.5 1.7s2.5-.6 2.5-1.7c0-2.5-5-2.2-5-4.5 0-1.2 1-1.7 2.3-1.7s2.2.6 2.2 1.7"/>',
|
|
39
|
+
// TypeScript — TS in a rounded badge
|
|
40
|
+
typescript:
|
|
41
|
+
'<rect x="2" y="2" width="20" height="20" rx="2.5"/>' +
|
|
42
|
+
'<polyline points="6 11 13 11 9.5 11 9.5 19"/>' +
|
|
43
|
+
'<path d="M14 17.5c0 1.2 1.2 1.7 2.5 1.7s2.5-.6 2.5-1.7c0-2.5-5-2.2-5-4.5 0-1.2 1-1.7 2.3-1.7s2.2.6 2.2 1.7"/>',
|
|
44
|
+
// YAML — bold indented bullet list
|
|
45
|
+
yaml:
|
|
46
|
+
'<circle cx="5" cy="6.5" r="1.2" fill="currentColor"/>' +
|
|
47
|
+
'<line x1="8" y1="6.5" x2="21" y2="6.5"/>' +
|
|
48
|
+
'<circle cx="8" cy="12" r="1.2" fill="currentColor"/>' +
|
|
49
|
+
'<line x1="11" y1="12" x2="21" y2="12"/>' +
|
|
50
|
+
'<circle cx="8" cy="17.5" r="1.2" fill="currentColor"/>' +
|
|
51
|
+
'<line x1="11" y1="17.5" x2="19" y2="17.5"/>',
|
|
52
|
+
// CSS — # symbol big and bold
|
|
53
|
+
css:
|
|
54
|
+
'<line x1="9" y1="3" x2="7" y2="21"/>' +
|
|
55
|
+
'<line x1="17" y1="3" x2="15" y2="21"/>' +
|
|
56
|
+
'<line x1="3" y1="9" x2="21" y2="9"/>' +
|
|
57
|
+
'<line x1="3" y1="15" x2="21" y2="15"/>',
|
|
58
|
+
// Bash / shell — terminal window with > prompt + cursor
|
|
59
|
+
bash:
|
|
60
|
+
'<rect x="2" y="4" width="20" height="16" rx="1.5"/>' +
|
|
61
|
+
'<polyline points="6 10 9 13 6 16"/>' +
|
|
62
|
+
'<line x1="12" y1="16" x2="18" y2="16"/>',
|
|
63
|
+
sh:
|
|
64
|
+
'<rect x="2" y="4" width="20" height="16" rx="1.5"/>' +
|
|
65
|
+
'<polyline points="6 10 9 13 6 16"/>' +
|
|
66
|
+
'<line x1="12" y1="16" x2="18" y2="16"/>',
|
|
67
|
+
// SQL — database cylinder
|
|
68
|
+
sql:
|
|
69
|
+
'<ellipse cx="12" cy="5" rx="9" ry="3"/>' +
|
|
70
|
+
'<path d="M3 5v6c0 1.7 4 3 9 3s9-1.3 9-3V5"/>' +
|
|
71
|
+
'<path d="M3 11v6c0 1.7 4 3 9 3s9-1.3 9-3v-6"/>' +
|
|
72
|
+
'<path d="M3 17v2c0 1.7 4 3 9 3s9-1.3 9-3v-2"/>',
|
|
73
|
+
// PDF — doc with bold "PDF" block
|
|
74
|
+
pdf:
|
|
75
|
+
'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>' +
|
|
76
|
+
'<polyline points="14 2 14 8 20 8"/>' +
|
|
77
|
+
'<path d="M7 14h1.5a1.2 1.2 0 0 1 0 2.4H7"/>' +
|
|
78
|
+
'<path d="M11 14h1.3a1.4 1.4 0 0 1 1.4 1.4v.6a1.4 1.4 0 0 1-1.4 1.4H11z"/>' +
|
|
79
|
+
'<line x1="15.5" y1="14" x2="17.5" y2="14"/>' +
|
|
80
|
+
'<line x1="15.5" y1="15.7" x2="17" y2="15.7"/>' +
|
|
81
|
+
'<line x1="15.5" y1="14" x2="15.5" y2="17.5"/>',
|
|
82
|
+
// Email — bold envelope
|
|
83
|
+
email:
|
|
84
|
+
'<rect x="2" y="4" width="20" height="16" rx="2"/>' +
|
|
85
|
+
'<path d="m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"/>',
|
|
86
|
+
// XML — angle brackets like HTML
|
|
87
|
+
xml:
|
|
88
|
+
'<polyline points="8 5 2 12 8 19"/>' +
|
|
89
|
+
'<polyline points="16 5 22 12 16 19"/>' +
|
|
90
|
+
'<line x1="14" y1="3" x2="10" y2="21"/>',
|
|
91
|
+
// SVG — overlapping geometric shapes
|
|
92
|
+
svg:
|
|
93
|
+
'<circle cx="7" cy="7" r="4"/>' +
|
|
94
|
+
'<rect x="13" y="13" width="8" height="8"/>' +
|
|
95
|
+
'<polygon points="13 3 21 3 17 11"/>',
|
|
96
|
+
// Rust — gear / cog (Rust's mark is a gear with R inside)
|
|
97
|
+
rust:
|
|
98
|
+
'<circle cx="12" cy="12" r="3"/>' +
|
|
99
|
+
'<path d="M12 2v3 M12 19v3 M2 12h3 M19 12h3 M4.93 4.93l2.12 2.12 M16.95 16.95l2.12 2.12 M4.93 19.07l2.12-2.12 M16.95 7.05l2.12-2.12"/>' +
|
|
100
|
+
'<circle cx="12" cy="12" r="8"/>',
|
|
101
|
+
// Go — gopher face (circle with two eyes + smile)
|
|
102
|
+
go:
|
|
103
|
+
'<circle cx="12" cy="12" r="9"/>' +
|
|
104
|
+
'<circle cx="9" cy="10" r="1.4" fill="currentColor"/>' +
|
|
105
|
+
'<circle cx="15" cy="10" r="1.4" fill="currentColor"/>' +
|
|
106
|
+
'<path d="M9 15c.8 1.5 5.2 1.5 6 0"/>',
|
|
107
|
+
// Java — coffee cup with steam (Java = coffee)
|
|
108
|
+
java:
|
|
109
|
+
'<path d="M6 11h11v6a3 3 0 0 1-3 3H9a3 3 0 0 1-3-3z"/>' +
|
|
110
|
+
'<path d="M17 12h1.5a2.5 2.5 0 0 1 0 5H17"/>' +
|
|
111
|
+
'<path d="M9 4c0 1.2-1 1.8-1 3s1 1.8 1 3"/>' +
|
|
112
|
+
'<path d="M13 4c0 1.2-1 1.8-1 3s1 1.8 1 3"/>',
|
|
113
|
+
// C — bold open arc
|
|
114
|
+
c:
|
|
115
|
+
'<path d="M18 7a7 7 0 1 0 0 10"/>',
|
|
116
|
+
// C++ — C + two plus signs
|
|
117
|
+
cpp:
|
|
118
|
+
'<path d="M10 7a5 5 0 1 0 0 10"/>' +
|
|
119
|
+
'<line x1="15" y1="10" x2="15" y2="14"/>' +
|
|
120
|
+
'<line x1="13" y1="12" x2="17" y2="12"/>' +
|
|
121
|
+
'<line x1="20" y1="10" x2="20" y2="14"/>' +
|
|
122
|
+
'<line x1="18" y1="12" x2="22" y2="12"/>',
|
|
123
|
+
// C# — C + sharp (♯)
|
|
124
|
+
csharp:
|
|
125
|
+
'<path d="M10 7a5 5 0 1 0 0 10"/>' +
|
|
126
|
+
'<line x1="17" y1="7" x2="15" y2="17"/>' +
|
|
127
|
+
'<line x1="22" y1="7" x2="20" y2="17"/>' +
|
|
128
|
+
'<line x1="14" y1="11" x2="22.5" y2="11"/>' +
|
|
129
|
+
'<line x1="13.5" y1="13" x2="22" y2="13"/>',
|
|
130
|
+
// Ruby — gem with cut facets
|
|
131
|
+
ruby:
|
|
132
|
+
'<polygon points="12 2 21 9 12 22 3 9"/>' +
|
|
133
|
+
'<line x1="3" y1="9" x2="21" y2="9"/>' +
|
|
134
|
+
'<line x1="8" y1="9" x2="12" y2="22"/>' +
|
|
135
|
+
'<line x1="16" y1="9" x2="12" y2="22"/>' +
|
|
136
|
+
'<line x1="8" y1="9" x2="12" y2="2"/>' +
|
|
137
|
+
'<line x1="16" y1="9" x2="12" y2="2"/>',
|
|
138
|
+
// PHP — stylised elephant (PHP's mascot, simplified)
|
|
139
|
+
php:
|
|
140
|
+
'<path d="M3 14c0-3 3-6 7-6h5c2.5 0 5 1.5 5 4v2c0 2-1.5 3.5-3.5 3.5H17"/>' +
|
|
141
|
+
'<path d="M17 17v2 M7 17v3 M11 17v3"/>' +
|
|
142
|
+
'<path d="M18 12c1 0 1.5-.7 1.5-1.5"/>' +
|
|
143
|
+
'<circle cx="7" cy="11" r="0.6" fill="currentColor"/>',
|
|
144
|
+
// Generic code fallback (used by toml/ini already; left as-is)
|
|
145
|
+
code:
|
|
146
|
+
'<polyline points="8 6 2 12 8 18"/>' +
|
|
147
|
+
'<polyline points="16 6 22 12 16 18"/>',
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const ALIASES = {
|
|
151
|
+
md: 'markdown',
|
|
152
|
+
py: 'python',
|
|
153
|
+
htm: 'html',
|
|
154
|
+
js: 'javascript',
|
|
155
|
+
ts: 'typescript',
|
|
156
|
+
yml: 'yaml',
|
|
157
|
+
shell: 'bash',
|
|
158
|
+
zsh: 'bash',
|
|
159
|
+
'c++': 'cpp',
|
|
160
|
+
'c#': 'csharp',
|
|
161
|
+
rs: 'rust',
|
|
162
|
+
rb: 'ruby',
|
|
163
|
+
toml: 'yaml',
|
|
164
|
+
ini: 'yaml',
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Return SVG markup for the given language/type, or '' if unknown.
|
|
169
|
+
* @param {string} lang language name (case-insensitive)
|
|
170
|
+
* @param {number} [size] pixel width/height of the rendered SVG (default 14)
|
|
171
|
+
* @param {object} [opts] { className, style } extra attrs on the <svg>
|
|
172
|
+
*/
|
|
173
|
+
export function langIcon(lang, size = 14, opts = {}) {
|
|
174
|
+
if (!lang) return '';
|
|
175
|
+
const key = String(lang).toLowerCase();
|
|
176
|
+
const inner = ICONS[key] || ICONS[ALIASES[key]] || '';
|
|
177
|
+
if (!inner) return '';
|
|
178
|
+
const cls = (opts && opts.className) ? ` class="${opts.className}"` : '';
|
|
179
|
+
const style = (opts && opts.style) ? ` style="${opts.style}"` : '';
|
|
180
|
+
return (
|
|
181
|
+
`<svg${cls}${style} width="${size}" height="${size}" viewBox="0 0 24 24" ` +
|
|
182
|
+
`fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">` +
|
|
183
|
+
`${inner}</svg>`
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export default { langIcon };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// static/js/markdown/tableRow.js
|
|
2
|
+
//
|
|
3
|
+
// Pure helper for splitting a markdown table row into cells. No DOM —
|
|
4
|
+
// safe to import anywhere and to unit-test under node.
|
|
5
|
+
|
|
6
|
+
// Split a "| a | b | c |" row into trimmed cell strings.
|
|
7
|
+
//
|
|
8
|
+
// Strip only the optional leading/trailing pipe, then split — filtering out
|
|
9
|
+
// every empty cell (the old behaviour) dropped intentionally-empty interior
|
|
10
|
+
// cells too, so "| a | | c |" collapsed to 2 columns and misaligned with the
|
|
11
|
+
// header.
|
|
12
|
+
export function splitTableRow(row) {
|
|
13
|
+
const text = typeof row === 'string' ? row : '';
|
|
14
|
+
return text
|
|
15
|
+
.replace(/^\s*\|/, '')
|
|
16
|
+
.replace(/\|\s*$/, '')
|
|
17
|
+
.split('|')
|
|
18
|
+
.map((cell) => cell.trim());
|
|
19
|
+
}
|