@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,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editor keyboard shortcuts — bound to `document` so shortcuts work
|
|
3
|
+
* without first clicking into the canvas. Gated by `state.editorOpen`
|
|
4
|
+
* so they don't leak into chat input when the editor is closed.
|
|
5
|
+
*
|
|
6
|
+
* Covers:
|
|
7
|
+
* ? toggle the shortcuts cheatsheet
|
|
8
|
+
* Enter confirm in-progress transform
|
|
9
|
+
* Esc cancel transform / lasso / crop (in priority order)
|
|
10
|
+
* Ctrl+Z undo (Shift adds redo)
|
|
11
|
+
* Ctrl+Shift+D deselect (clears wand + lasso)
|
|
12
|
+
* Ctrl+S save (Shift = save as / export to gallery)
|
|
13
|
+
* Ctrl+Shift+T open resize popup
|
|
14
|
+
* Ctrl+Alt+T start free transform
|
|
15
|
+
* Ctrl+Alt+I invert wand / lasso selection
|
|
16
|
+
* Ctrl+Alt+J new empty layer
|
|
17
|
+
* Ctrl+Alt+A select all canvas (lasso polygon = full bounds)
|
|
18
|
+
* Ctrl+C/X copy / cut wand or lasso selection (image clipboard
|
|
19
|
+
* + internal clipboard)
|
|
20
|
+
* Ctrl+V (handled by the paste event listener)
|
|
21
|
+
* Tool keys (V, B, E, L, …) → toolbar click
|
|
22
|
+
* [ / ] shrink / grow brush size proportionally
|
|
23
|
+
* D, C, M (when lasso has 3+ points) → delete / copy / convert mask
|
|
24
|
+
* Delete / Backspace (wand or lasso) → delete pixels
|
|
25
|
+
*
|
|
26
|
+
* @param {{
|
|
27
|
+
* toolbar: HTMLDivElement,
|
|
28
|
+
* toolKeyMap: Record<string, string>,
|
|
29
|
+
* composite: () => void,
|
|
30
|
+
* saveState: (label?: string) => void,
|
|
31
|
+
* undo: () => void,
|
|
32
|
+
* redo: () => void,
|
|
33
|
+
* toggleShortcuts: (show?: boolean) => void,
|
|
34
|
+
* confirmTransform: () => void,
|
|
35
|
+
* cancelTransform: () => void,
|
|
36
|
+
* startTransform: () => void,
|
|
37
|
+
* resizeCustomPrompt: () => void,
|
|
38
|
+
* addEmptyLayer: () => void,
|
|
39
|
+
* brushSizeSync: (source: HTMLInputElement | null) => void,
|
|
40
|
+
* invertSelection: () => boolean,
|
|
41
|
+
* wandDeleteSelection: () => void,
|
|
42
|
+
* wandCopyToNewLayer: () => void,
|
|
43
|
+
* lassoDeleteSelection: () => void,
|
|
44
|
+
* lassoCopyToLayer: () => void,
|
|
45
|
+
* lassoToMask: () => void,
|
|
46
|
+
* buildLassoMask: (w: number, h: number, offX: number, offY: number, feather: number, grow: number) => HTMLCanvasElement,
|
|
47
|
+
* drawLassoOverlay: () => void,
|
|
48
|
+
* activeLayer: () => object | null,
|
|
49
|
+
* uiModule: object,
|
|
50
|
+
* }} deps
|
|
51
|
+
*/
|
|
52
|
+
import { state } from './state.js';
|
|
53
|
+
import { isAltGrEvent } from '../platform.js';
|
|
54
|
+
|
|
55
|
+
export function wireKeyboardShortcuts(deps) {
|
|
56
|
+
const {
|
|
57
|
+
toolbar, toolKeyMap,
|
|
58
|
+
composite, saveState, undo, redo,
|
|
59
|
+
toggleShortcuts, confirmTransform, cancelTransform, startTransform,
|
|
60
|
+
resizeCustomPrompt, addEmptyLayer, brushSizeSync,
|
|
61
|
+
invertSelection,
|
|
62
|
+
wandDeleteSelection, wandCopyToNewLayer,
|
|
63
|
+
lassoDeleteSelection, lassoCopyToLayer, lassoToMask,
|
|
64
|
+
buildLassoMask, drawLassoOverlay,
|
|
65
|
+
activeLayer, uiModule,
|
|
66
|
+
} = deps;
|
|
67
|
+
|
|
68
|
+
document.addEventListener('keydown', (e) => {
|
|
69
|
+
if (!state.editorOpen) return;
|
|
70
|
+
// `?` toggles the cheatsheet. Don't fire while typing in a text
|
|
71
|
+
// field — the user might be typing a prompt with a `?`.
|
|
72
|
+
if (e.key === '?' && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA') {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
toggleShortcuts();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (e.key === 'Enter' && state.transformActive) {
|
|
78
|
+
e.preventDefault();
|
|
79
|
+
confirmTransform();
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (e.key === 'Escape') return;
|
|
83
|
+
// Skip the Ctrl+Alt editor chords for an AltGr keystroke (see platform.js);
|
|
84
|
+
// only the chord block is skipped, so the layout-character handlers below
|
|
85
|
+
// still act — AltGr+5 / AltGr+8 stay as the [ ] brush-size shortcut on
|
|
86
|
+
// AZERTY / QWERTZ.
|
|
87
|
+
if ((e.ctrlKey || e.metaKey) && !isAltGrEvent(e)) {
|
|
88
|
+
if (e.key === 'z') { e.preventDefault(); if (e.shiftKey) redo(); else undo(); }
|
|
89
|
+
// Ctrl+Shift+D = Deselect: clears the wand selection (and
|
|
90
|
+
// lasso if active) without affecting layers.
|
|
91
|
+
if (e.shiftKey && (e.key === 'D' || e.key === 'd')) {
|
|
92
|
+
if (state.wandMask || state.lassoPoints.length) {
|
|
93
|
+
e.preventDefault();
|
|
94
|
+
if (state.wandMask) {
|
|
95
|
+
saveState();
|
|
96
|
+
state.wandMask = null;
|
|
97
|
+
state.wandLayerId = null;
|
|
98
|
+
state.wandLastSeed = null;
|
|
99
|
+
}
|
|
100
|
+
if (state.lassoPoints.length) {
|
|
101
|
+
state.lassoPoints = [];
|
|
102
|
+
state.lassoActive = false;
|
|
103
|
+
}
|
|
104
|
+
composite();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
// Save shortcuts — match the hints shown in the Save dropdown.
|
|
108
|
+
if ((e.key === 's' || e.key === 'S') && !e.altKey) {
|
|
109
|
+
e.preventDefault();
|
|
110
|
+
document.getElementById(e.shiftKey ? 'ge-export-gallery' : 'ge-save')?.click();
|
|
111
|
+
}
|
|
112
|
+
if (e.shiftKey && e.key === 'T') { e.preventDefault(); resizeCustomPrompt(); }
|
|
113
|
+
if (e.altKey && e.key === 't') { e.preventDefault(); startTransform(); }
|
|
114
|
+
// Ctrl+Alt+I — invert current selection. Uses e.code so
|
|
115
|
+
// Alt-modified key values (e.g. `ˆ` on Mac with Option+I)
|
|
116
|
+
// don't break the match.
|
|
117
|
+
if (e.altKey && e.code === 'KeyI') {
|
|
118
|
+
if (invertSelection()) {
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// Ctrl+Alt+J — new empty layer.
|
|
124
|
+
if (e.altKey && e.code === 'KeyJ') {
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
e.stopPropagation();
|
|
127
|
+
addEmptyLayer();
|
|
128
|
+
}
|
|
129
|
+
// Wand selection: Delete = erase pixels. Ctrl+X = cut to
|
|
130
|
+
// clipboard + new layer + erase. Ctrl+C = copy.
|
|
131
|
+
// (Legacy `&& !_wandActive` clause referenced an undeclared
|
|
132
|
+
// variable — removed; the wand is selection-only and has no
|
|
133
|
+
// "active drag" state.)
|
|
134
|
+
if (state.wandMask) {
|
|
135
|
+
if (e.key === 'Delete' || e.key === 'Backspace') {
|
|
136
|
+
e.preventDefault();
|
|
137
|
+
wandDeleteSelection();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
if ((e.ctrlKey || e.metaKey) && (e.key === 'x' || e.key === 'c')) {
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
const isCut = e.key === 'x';
|
|
143
|
+
const src = state.layers.find(l => l.id === state.wandLayerId);
|
|
144
|
+
if (!src) return;
|
|
145
|
+
// Clip source by wand mask into a temp canvas.
|
|
146
|
+
const w = src.canvas.width, h = src.canvas.height;
|
|
147
|
+
const tmp = document.createElement('canvas');
|
|
148
|
+
tmp.width = w; tmp.height = h;
|
|
149
|
+
const tCtx = tmp.getContext('2d');
|
|
150
|
+
tCtx.drawImage(src.canvas, 0, 0);
|
|
151
|
+
tCtx.globalCompositeOperation = 'destination-in';
|
|
152
|
+
tCtx.drawImage(state.wandMask, 0, 0);
|
|
153
|
+
state.internalClipboard = tmp;
|
|
154
|
+
tmp.toBlob(blob => {
|
|
155
|
+
if (blob && navigator.clipboard?.write) {
|
|
156
|
+
navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]).then(() => {
|
|
157
|
+
uiModule.showToast(isCut ? 'Cut to clipboard' : 'Copied to clipboard');
|
|
158
|
+
}).catch(() => uiModule.showToast(isCut ? 'Cut (editor only)' : 'Copied (editor only)'));
|
|
159
|
+
}
|
|
160
|
+
}, 'image/png');
|
|
161
|
+
if (isCut) {
|
|
162
|
+
// Cut also moves the selection to a new layer + erases source.
|
|
163
|
+
wandCopyToNewLayer();
|
|
164
|
+
wandDeleteSelection();
|
|
165
|
+
}
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if ((e.key === 'x' || e.key === 'c') && state.lassoPoints.length >= 3) {
|
|
170
|
+
e.preventDefault();
|
|
171
|
+
const layer = activeLayer();
|
|
172
|
+
if (!layer) return;
|
|
173
|
+
const off = state.layerOffsets.get(layer.id) || { x: 0, y: 0 };
|
|
174
|
+
const feather = parseInt(document.getElementById('ge-lasso-feather')?.value || '0');
|
|
175
|
+
const grow = parseInt(document.getElementById('ge-lasso-grow')?.value || '0');
|
|
176
|
+
const w = layer.canvas.width, h = layer.canvas.height;
|
|
177
|
+
const mask = buildLassoMask(w, h, off.x, off.y, feather, grow);
|
|
178
|
+
const srcData = layer.ctx.getImageData(0, 0, w, h);
|
|
179
|
+
const maskData = mask.getContext('2d').getImageData(0, 0, w, h);
|
|
180
|
+
// Build clipped image.
|
|
181
|
+
const tmp = document.createElement('canvas');
|
|
182
|
+
tmp.width = w; tmp.height = h;
|
|
183
|
+
const tCtx = tmp.getContext('2d');
|
|
184
|
+
const outData = tCtx.createImageData(w, h);
|
|
185
|
+
for (let i = 0; i < w * h; i++) {
|
|
186
|
+
const mv = maskData.data[i * 4] / 255;
|
|
187
|
+
if (mv > 0) {
|
|
188
|
+
outData.data[i*4] = srcData.data[i*4];
|
|
189
|
+
outData.data[i*4+1] = srcData.data[i*4+1];
|
|
190
|
+
outData.data[i*4+2] = srcData.data[i*4+2];
|
|
191
|
+
outData.data[i*4+3] = Math.round(srcData.data[i*4+3] * mv);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
tCtx.putImageData(outData, 0, 0);
|
|
195
|
+
state.internalClipboard = tmp;
|
|
196
|
+
const isCut = e.key === 'x';
|
|
197
|
+
tmp.toBlob(blob => {
|
|
198
|
+
if (blob && navigator.clipboard?.write) {
|
|
199
|
+
navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })]).then(() => {
|
|
200
|
+
uiModule.showToast(isCut ? 'Cut to clipboard' : 'Copied to clipboard');
|
|
201
|
+
}).catch(() => uiModule.showToast(isCut ? 'Cut (editor only)' : 'Copied (editor only)'));
|
|
202
|
+
}
|
|
203
|
+
}, 'image/png');
|
|
204
|
+
if (e.key === 'x') {
|
|
205
|
+
const savedPts = [...state.lassoPoints];
|
|
206
|
+
state.lassoPoints = savedPts;
|
|
207
|
+
lassoDeleteSelection();
|
|
208
|
+
} else {
|
|
209
|
+
state.lassoPoints = [];
|
|
210
|
+
composite();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// Ctrl+C with no active selection → copy the entire active layer
|
|
214
|
+
// to the system clipboard as a PNG. Gives a "just copy this image"
|
|
215
|
+
// shortcut without having to lasso-select-all first. The
|
|
216
|
+
// selection-aware Ctrl+C paths above run first (wand + lasso),
|
|
217
|
+
// so this only fires when neither is active.
|
|
218
|
+
if (e.key === 'c' && !e.shiftKey && !state.wandMask && state.lassoPoints.length < 3) {
|
|
219
|
+
const layer = activeLayer();
|
|
220
|
+
if (layer && layer.canvas && layer.canvas.width > 0) {
|
|
221
|
+
e.preventDefault();
|
|
222
|
+
layer.canvas.toBlob(blob => {
|
|
223
|
+
if (blob && navigator.clipboard?.write) {
|
|
224
|
+
navigator.clipboard.write([new ClipboardItem({ 'image/png': blob })])
|
|
225
|
+
.then(() => uiModule.showToast('Layer copied to clipboard'))
|
|
226
|
+
.catch(() => uiModule.showToast('Copy failed (clipboard permission denied?)'));
|
|
227
|
+
}
|
|
228
|
+
}, 'image/png');
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Ctrl+Alt+A = select all canvas.
|
|
233
|
+
if (e.altKey && e.key === 'a' && state.imgWidth > 0 && state.imgHeight > 0) {
|
|
234
|
+
e.preventDefault();
|
|
235
|
+
state.lassoPoints = [
|
|
236
|
+
{ x: 0, y: 0 }, { x: state.imgWidth, y: 0 },
|
|
237
|
+
{ x: state.imgWidth, y: state.imgHeight }, { x: 0, y: state.imgHeight },
|
|
238
|
+
];
|
|
239
|
+
state.lassoActive = false;
|
|
240
|
+
composite();
|
|
241
|
+
drawLassoOverlay();
|
|
242
|
+
uiModule.showToast('All selected — Ctrl+C to copy, Del to delete');
|
|
243
|
+
}
|
|
244
|
+
// Ctrl+V handled by the paste event listener.
|
|
245
|
+
if (e.key === 'v') { /* no-op here */ }
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
// Tool shortcuts (only when not typing in an input).
|
|
249
|
+
if (e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return;
|
|
250
|
+
const toolId = toolKeyMap[e.key.toLowerCase()];
|
|
251
|
+
if (toolId) {
|
|
252
|
+
const toolBtn = toolbar.querySelector(`[data-tool="${toolId}"]`);
|
|
253
|
+
if (toolBtn) toolBtn.click();
|
|
254
|
+
}
|
|
255
|
+
// Bracket keys for brush size — ±10% multiplier mirrors the
|
|
256
|
+
// exponential slider curve so each press feels the same at any
|
|
257
|
+
// size.
|
|
258
|
+
if (e.key === '[' || e.key === ']') {
|
|
259
|
+
const factor = e.key === '[' ? 0.9 : 1.1;
|
|
260
|
+
state.brushSize = Math.max(1, Math.min(800, Math.round(state.brushSize * factor)));
|
|
261
|
+
try { brushSizeSync(null); } catch {}
|
|
262
|
+
}
|
|
263
|
+
// Lasso shortcuts (when selection exists).
|
|
264
|
+
if (state.lassoPoints.length >= 3) {
|
|
265
|
+
if (e.key === 'Delete' || e.key === 'Backspace') { e.preventDefault(); lassoDeleteSelection(); }
|
|
266
|
+
if (e.key === 'd') { e.preventDefault(); lassoDeleteSelection(); }
|
|
267
|
+
if (e.key === 'c') { e.preventDefault(); lassoCopyToLayer(); }
|
|
268
|
+
if (e.key === 'm') { e.preventDefault(); lassoToMask(); }
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers + constants for layers and adjustment sub-layers.
|
|
3
|
+
*
|
|
4
|
+
* Everything in this module is stateless — feed in a layer object and
|
|
5
|
+
* get back a value. The legacy gallery editor's module-level helpers
|
|
6
|
+
* re-export from here so existing call sites keep working unchanged.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/** True if the layer has at least one FX/adjustment sub-layer. */
|
|
10
|
+
export function layerHasAdjustments(layer) {
|
|
11
|
+
return !!(layer && layer.adjLayers && layer.adjLayers.length > 0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* True if the layer carries a non-identity Levels OR Color-Balance
|
|
17
|
+
* adjustment that needs the per-pixel pass (vs the cheap CSS-filter
|
|
18
|
+
* path for plain B/C/H/S).
|
|
19
|
+
*/
|
|
20
|
+
export function layerNeedsPixelPass(layer) {
|
|
21
|
+
if (!layer || !layer.adjustments) return false;
|
|
22
|
+
const a = layer.adjustments;
|
|
23
|
+
if (a.levels && (a.levels.inBlack !== 0 || a.levels.inWhite !== 255 ||
|
|
24
|
+
a.levels.gamma !== 1 ||
|
|
25
|
+
a.levels.outBlack !== 0 || a.levels.outWhite !== 255)) return true;
|
|
26
|
+
if (a.colorBalance) {
|
|
27
|
+
for (const tone of ['shadows', 'midtones', 'highlights']) {
|
|
28
|
+
const v = a.colorBalance[tone];
|
|
29
|
+
if (v && (v.r || v.g || v.b)) return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Compact hash of a layer's Levels + Color-Balance values. Used to
|
|
38
|
+
* key the per-pixel adjustment cache so we can skip recomputing when
|
|
39
|
+
* nothing changed.
|
|
40
|
+
*/
|
|
41
|
+
export function adjustmentsKey(adj) {
|
|
42
|
+
const l = adj.levels || {};
|
|
43
|
+
const cb = adj.colorBalance || {};
|
|
44
|
+
const s = cb.shadows || {}, m = cb.midtones || {}, h = cb.highlights || {};
|
|
45
|
+
return [
|
|
46
|
+
l.inBlack|0, l.inWhite|0, l.gamma || 1, l.outBlack|0, l.outWhite|0,
|
|
47
|
+
s.r|0, s.g|0, s.b|0, m.r|0, m.g|0, m.b|0, h.r|0, h.g|0, h.b|0,
|
|
48
|
+
].join('|');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
/** Identity params for each adjustment type. */
|
|
53
|
+
export function defaultAdjParams(type) {
|
|
54
|
+
switch (type) {
|
|
55
|
+
case 'brightness-contrast': return { brightness: 1, contrast: 1 };
|
|
56
|
+
case 'hue-saturation': return { hue: 0, saturation: 1 };
|
|
57
|
+
case 'levels': return { inBlack: 0, inWhite: 255, gamma: 1.0, outBlack: 0, outWhite: 255 };
|
|
58
|
+
case 'color-balance': return {
|
|
59
|
+
shadows: { r: 0, g: 0, b: 0 },
|
|
60
|
+
midtones: { r: 0, g: 0, b: 0 },
|
|
61
|
+
highlights: { r: 0, g: 0, b: 0 },
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
/** Human-readable name for an adjustment type. */
|
|
69
|
+
export function adjLayerLabel(type) {
|
|
70
|
+
return {
|
|
71
|
+
'brightness-contrast': 'Brightness/Contrast',
|
|
72
|
+
'hue-saturation': 'Hue/Saturation',
|
|
73
|
+
'levels': 'Levels',
|
|
74
|
+
'color-balance': 'Color Balance',
|
|
75
|
+
}[type] || type;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Per-type SVG icon strings. Used in popup title bars, the minimised
|
|
81
|
+
* FX-dock chips, and the layer-panel sub-row name so the same glyph
|
|
82
|
+
* shows up everywhere a given adjustment type appears.
|
|
83
|
+
*/
|
|
84
|
+
export const ADJ_ICONS = {
|
|
85
|
+
'brightness-contrast': '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 3a9 9 0 0 1 0 18Z" fill="currentColor" stroke="none"/></svg>',
|
|
86
|
+
'hue-saturation': '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="9" cy="12" r="4"/><circle cx="15" cy="9.5" r="4"/><circle cx="15" cy="14.5" r="4"/></svg>',
|
|
87
|
+
'levels': '<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><rect x="3" y="14" width="3" height="6" rx="0.5"/><rect x="8" y="9" width="3" height="11" rx="0.5"/><rect x="13" y="11" width="3" height="9" rx="0.5"/><rect x="18" y="6" width="3" height="14" rx="0.5"/></svg>',
|
|
88
|
+
'color-balance': '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="9"/><path d="M12 3v18M3 12a9 9 0 0 1 9-9v18a9 9 0 0 1-9-9z" fill="currentColor" stroke="none"/></svg>',
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
/** SVG used in the topbar/history button glyphs. */
|
|
93
|
+
export const HISTORY_ICON = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M1 4v6h6"/><path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"/><polyline points="12 7 12 12 16 14"/></svg>';
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
/** Quick downsampled-alpha check: are there any opaque pixels on this canvas? */
|
|
97
|
+
export function isMaskCanvasEmpty(canvas) {
|
|
98
|
+
if (!canvas) return true;
|
|
99
|
+
try {
|
|
100
|
+
const w = canvas.width, h = canvas.height;
|
|
101
|
+
if (!w || !h) return true;
|
|
102
|
+
const sw = Math.min(200, w), sh = Math.min(200, h);
|
|
103
|
+
const tmp = document.createElement('canvas');
|
|
104
|
+
tmp.width = sw; tmp.height = sh;
|
|
105
|
+
tmp.getContext('2d').drawImage(canvas, 0, 0, sw, sh);
|
|
106
|
+
const d = tmp.getContext('2d').getImageData(0, 0, sw, sh).data;
|
|
107
|
+
for (let i = 3; i < d.length; i += 4) if (d[i] > 0) return false;
|
|
108
|
+
return true;
|
|
109
|
+
} catch { return false; }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
/** Same as `isMaskCanvasEmpty` but accepts a layer wrapper. */
|
|
114
|
+
export function isLayerEmpty(layer) {
|
|
115
|
+
if (!layer || !layer.canvas) return true;
|
|
116
|
+
return isMaskCanvasEmpty(layer.canvas);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Compact "now / 30s / 12m / 4h" relative-time string. Used in the
|
|
122
|
+
* editor's history panel labels.
|
|
123
|
+
*/
|
|
124
|
+
export function relTime(ts) {
|
|
125
|
+
if (!ts) return '';
|
|
126
|
+
const dt = (Date.now() - ts) / 1000;
|
|
127
|
+
if (dt < 5) return 'now';
|
|
128
|
+
if (dt < 60) return Math.round(dt) + 's';
|
|
129
|
+
if (dt < 3600) return Math.round(dt / 60) + 'm';
|
|
130
|
+
return Math.round(dt / 3600) + 'h';
|
|
131
|
+
}
|