@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,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers that translate between the editor's adjustment-slider
|
|
3
|
+
* UI and CSS `filter` strings / canvas-filter multipliers.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Build a CSS `filter` string from a layer's `adjustments` object.
|
|
8
|
+
* Returns '' when every value is at identity so the composite path
|
|
9
|
+
* can skip the filter entirely.
|
|
10
|
+
*
|
|
11
|
+
* @param {{
|
|
12
|
+
* brightness?: number, contrast?: number,
|
|
13
|
+
* saturation?: number, hue?: number,
|
|
14
|
+
* }|null|undefined} adj
|
|
15
|
+
*/
|
|
16
|
+
export function layerFilterString(adj) {
|
|
17
|
+
if (!adj) return '';
|
|
18
|
+
const parts = [];
|
|
19
|
+
if (adj.brightness !== undefined && adj.brightness !== 1) parts.push(`brightness(${adj.brightness})`);
|
|
20
|
+
if (adj.contrast !== undefined && adj.contrast !== 1) parts.push(`contrast(${adj.contrast})`);
|
|
21
|
+
if (adj.saturation !== undefined && adj.saturation !== 1) parts.push(`saturate(${adj.saturation})`);
|
|
22
|
+
if (adj.hue !== undefined && adj.hue !== 0) parts.push(`hue-rotate(${adj.hue}deg)`);
|
|
23
|
+
return parts.join(' ');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Convert a stored filter multiplier (brightness/contrast/saturation
|
|
29
|
+
* are 0..2 with 1.0 = identity; hue is degrees, -180..+180) into the
|
|
30
|
+
* UI slider's -100..+100 (or -180..+180 for hue) range.
|
|
31
|
+
*/
|
|
32
|
+
export function fxFilterToSlider(key, value) {
|
|
33
|
+
if (key === 'brightness' || key === 'contrast' || key === 'saturation') {
|
|
34
|
+
return Math.round(((value ?? 1) - 1) * 100);
|
|
35
|
+
}
|
|
36
|
+
if (key === 'hue') return Math.round(value ?? 0);
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draw a luminance histogram of a layer's pixels onto the given
|
|
3
|
+
* canvas. Sampling is capped at ~400×400 so the call stays cheap on
|
|
4
|
+
* very large images.
|
|
5
|
+
*
|
|
6
|
+
* If the layer has a staged Levels adjustment
|
|
7
|
+
* (`layer._stagedAdj.params` with `inBlack` / `inWhite`), the two
|
|
8
|
+
* endpoint markers are drawn over the bars.
|
|
9
|
+
*
|
|
10
|
+
* @param {HTMLCanvasElement} canvas The histogram canvas to render into.
|
|
11
|
+
* @param {{
|
|
12
|
+
* canvas: HTMLCanvasElement,
|
|
13
|
+
* _stagedAdj?: {params?: {inBlack?: number, inWhite?: number}}
|
|
14
|
+
* }} layer Source layer.
|
|
15
|
+
*/
|
|
16
|
+
export function drawHistogram(canvas, layer) {
|
|
17
|
+
if (!canvas) return;
|
|
18
|
+
const w = canvas.width, h = canvas.height;
|
|
19
|
+
const ctx = canvas.getContext('2d');
|
|
20
|
+
ctx.clearRect(0, 0, w, h);
|
|
21
|
+
|
|
22
|
+
// Down-sample huge images so the histogram stays interactive on 8k+
|
|
23
|
+
// photos. ~400×400 is enough to characterise the distribution.
|
|
24
|
+
const src = layer.canvas;
|
|
25
|
+
const sw = src.width, sh = src.height;
|
|
26
|
+
const maxSamples = 400;
|
|
27
|
+
const sampleW = Math.min(maxSamples, sw);
|
|
28
|
+
const sampleH = Math.min(maxSamples, sh);
|
|
29
|
+
const tmp = document.createElement('canvas');
|
|
30
|
+
tmp.width = sampleW; tmp.height = sampleH;
|
|
31
|
+
const tctx = tmp.getContext('2d');
|
|
32
|
+
tctx.drawImage(src, 0, 0, sampleW, sampleH);
|
|
33
|
+
const img = tctx.getImageData(0, 0, sampleW, sampleH).data;
|
|
34
|
+
|
|
35
|
+
const hist = new Uint32Array(256);
|
|
36
|
+
for (let i = 0; i < img.length; i += 4) {
|
|
37
|
+
if (img[i + 3] < 8) continue; // skip near-transparent
|
|
38
|
+
// Rec. 709 luminance — common choice for histograms in photo editors.
|
|
39
|
+
const Y = (0.2126 * img[i] + 0.7152 * img[i + 1] + 0.0722 * img[i + 2]) | 0;
|
|
40
|
+
hist[Math.min(255, Y)]++;
|
|
41
|
+
}
|
|
42
|
+
let peak = 1;
|
|
43
|
+
for (let i = 0; i < 256; i++) if (hist[i] > peak) peak = hist[i];
|
|
44
|
+
|
|
45
|
+
// Background.
|
|
46
|
+
ctx.fillStyle = 'rgba(255,255,255,0.05)';
|
|
47
|
+
ctx.fillRect(0, 0, w, h);
|
|
48
|
+
|
|
49
|
+
// Bars. sqrt-scaled so the long tails (specular highlights, deep
|
|
50
|
+
// shadows) stay visible even when the central mass dominates.
|
|
51
|
+
ctx.fillStyle = 'rgba(255,255,255,0.55)';
|
|
52
|
+
for (let i = 0; i < 256; i++) {
|
|
53
|
+
const x = (i / 256) * w;
|
|
54
|
+
const bh = Math.pow(hist[i] / peak, 0.5) * h;
|
|
55
|
+
ctx.fillRect(x, h - bh, w / 256 + 0.5, bh);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Endpoint markers (input black / input white) from a staged Levels
|
|
59
|
+
// adjustment, if one is in flight.
|
|
60
|
+
const p = layer._stagedAdj?.params;
|
|
61
|
+
if (p) {
|
|
62
|
+
ctx.fillStyle = 'rgba(0,0,0,0.9)';
|
|
63
|
+
ctx.fillRect((p.inBlack / 256) * w, 0, 1, h);
|
|
64
|
+
ctx.fillStyle = 'rgba(255,255,255,0.9)';
|
|
65
|
+
ctx.fillRect((p.inWhite / 256) * w, 0, 1, h);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply a Brightness/Contrast, Hue/Saturation, Levels, or Color Balance
|
|
3
|
+
* adjustment to a source canvas and return a fresh canvas with the
|
|
4
|
+
* result. Pure pixel math — no DOM, no module state.
|
|
5
|
+
*
|
|
6
|
+
* Used by the editor's per-layer FX stack: each `adjLayer` calls
|
|
7
|
+
* `applyAdjustment(prevCanvas, adjLayer)` and the result feeds the
|
|
8
|
+
* next layer in the stack.
|
|
9
|
+
*
|
|
10
|
+
* Adjustment shape:
|
|
11
|
+
* { type: 'brightness-contrast', params: { brightness, contrast } }
|
|
12
|
+
* { type: 'hue-saturation', params: { hue, saturation } }
|
|
13
|
+
* { type: 'levels', params: { inBlack, inWhite, gamma, outBlack, outWhite } }
|
|
14
|
+
* { type: 'color-balance', params: { shadows, midtones, highlights } }
|
|
15
|
+
*/
|
|
16
|
+
export function applyAdjustment(srcCanvas, adj) {
|
|
17
|
+
const w = srcCanvas.width, h = srcCanvas.height;
|
|
18
|
+
const out = document.createElement('canvas');
|
|
19
|
+
out.width = w; out.height = h;
|
|
20
|
+
const octx = out.getContext('2d');
|
|
21
|
+
|
|
22
|
+
// B/C and H/S can use the fast browser-native CSS filter pipeline.
|
|
23
|
+
if (adj.type === 'brightness-contrast') {
|
|
24
|
+
const p = adj.params;
|
|
25
|
+
octx.filter = `brightness(${p.brightness}) contrast(${p.contrast})`;
|
|
26
|
+
octx.drawImage(srcCanvas, 0, 0);
|
|
27
|
+
octx.filter = 'none';
|
|
28
|
+
return out;
|
|
29
|
+
}
|
|
30
|
+
if (adj.type === 'hue-saturation') {
|
|
31
|
+
const p = adj.params;
|
|
32
|
+
octx.filter = `saturate(${p.saturation}) hue-rotate(${p.hue}deg)`;
|
|
33
|
+
octx.drawImage(srcCanvas, 0, 0);
|
|
34
|
+
octx.filter = 'none';
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Levels + Color Balance need per-pixel math.
|
|
39
|
+
octx.drawImage(srcCanvas, 0, 0);
|
|
40
|
+
const img = octx.getImageData(0, 0, w, h);
|
|
41
|
+
const d = img.data;
|
|
42
|
+
|
|
43
|
+
if (adj.type === 'levels') {
|
|
44
|
+
const l = adj.params;
|
|
45
|
+
const inLow = Math.max(0, Math.min(254, l.inBlack));
|
|
46
|
+
const inHigh = Math.max(inLow + 1, Math.min(255, l.inWhite));
|
|
47
|
+
const gamma = Math.max(0.1, l.gamma || 1);
|
|
48
|
+
const outLow = Math.max(0, Math.min(255, l.outBlack));
|
|
49
|
+
const outHigh = Math.max(outLow, Math.min(255, l.outWhite));
|
|
50
|
+
const inv = 1.0 / gamma;
|
|
51
|
+
const span = (outHigh - outLow);
|
|
52
|
+
const lut = new Uint8ClampedArray(256);
|
|
53
|
+
for (let v = 0; v < 256; v++) {
|
|
54
|
+
let t = (v - inLow) / (inHigh - inLow);
|
|
55
|
+
if (t < 0) t = 0; else if (t > 1) t = 1;
|
|
56
|
+
t = Math.pow(t, inv);
|
|
57
|
+
lut[v] = Math.round(t * span + outLow);
|
|
58
|
+
}
|
|
59
|
+
for (let i = 0; i < d.length; i += 4) {
|
|
60
|
+
d[i] = lut[d[i]]; d[i+1] = lut[d[i+1]]; d[i+2] = lut[d[i+2]];
|
|
61
|
+
}
|
|
62
|
+
octx.putImageData(img, 0, 0);
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (adj.type === 'color-balance') {
|
|
67
|
+
const cb = adj.params;
|
|
68
|
+
const scale = 0.6;
|
|
69
|
+
const s = cb.shadows, m = cb.midtones, hi = cb.highlights;
|
|
70
|
+
const sR = s.r*scale, sG = s.g*scale, sB = s.b*scale;
|
|
71
|
+
const mR = m.r*scale, mG = m.g*scale, mB = m.b*scale;
|
|
72
|
+
const hR = hi.r*scale, hG = hi.g*scale, hB = hi.b*scale;
|
|
73
|
+
// Bell-curve tone weights so each pixel's shift is proportional to
|
|
74
|
+
// how "shadow", "midtone", or "highlight" its luminance is.
|
|
75
|
+
const wS = new Float32Array(256), wM = new Float32Array(256), wH = new Float32Array(256);
|
|
76
|
+
const sig = 0.25;
|
|
77
|
+
for (let v = 0; v < 256; v++) {
|
|
78
|
+
const t = v / 255;
|
|
79
|
+
wS[v] = Math.exp(-(t*t) / (2*sig*sig));
|
|
80
|
+
wM[v] = Math.exp(-((t-0.5)*(t-0.5)) / (2*sig*sig));
|
|
81
|
+
wH[v] = Math.exp(-((1-t)*(1-t)) / (2*sig*sig));
|
|
82
|
+
}
|
|
83
|
+
for (let i = 0; i < d.length; i += 4) {
|
|
84
|
+
let r = d[i], g = d[i+1], b = d[i+2];
|
|
85
|
+
const Y = (0.2126*r + 0.7152*g + 0.0722*b) | 0;
|
|
86
|
+
const ws = wS[Y], wm = wM[Y], wh = wH[Y];
|
|
87
|
+
r += sR*ws + mR*wm + hR*wh;
|
|
88
|
+
g += sG*ws + mG*wm + hG*wh;
|
|
89
|
+
b += sB*ws + mB*wm + hB*wh;
|
|
90
|
+
d[i] = r < 0 ? 0 : r > 255 ? 255 : r;
|
|
91
|
+
d[i+1] = g < 0 ? 0 : g > 255 ? 255 : g;
|
|
92
|
+
d[i+2] = b < 0 ? 0 : b > 255 ? 255 : b;
|
|
93
|
+
}
|
|
94
|
+
octx.putImageData(img, 0, 0);
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Apply a combined Levels + Color Balance pass to a layer in-place via
|
|
104
|
+
* its `layer.adjustments` field. Cached on `layer._adjCache` keyed by
|
|
105
|
+
* `cacheKey` so repeated composite passes don't re-run the math.
|
|
106
|
+
*
|
|
107
|
+
* Returns the cached output canvas.
|
|
108
|
+
*
|
|
109
|
+
* @param {{
|
|
110
|
+
* canvas: HTMLCanvasElement,
|
|
111
|
+
* adjustments: object,
|
|
112
|
+
* _adjCache?: HTMLCanvasElement,
|
|
113
|
+
* _adjCacheKey?: string,
|
|
114
|
+
* }} layer
|
|
115
|
+
* @param {string} cacheKey Stable signature of `layer.adjustments`.
|
|
116
|
+
*/
|
|
117
|
+
export function renderLayerPixelAdjustments(layer, cacheKey) {
|
|
118
|
+
const adj = layer.adjustments;
|
|
119
|
+
if (layer._adjCache && layer._adjCacheKey === cacheKey) return layer._adjCache;
|
|
120
|
+
if (!layer._adjCache) {
|
|
121
|
+
layer._adjCache = document.createElement('canvas');
|
|
122
|
+
}
|
|
123
|
+
const out = layer._adjCache;
|
|
124
|
+
out.width = layer.canvas.width;
|
|
125
|
+
out.height = layer.canvas.height;
|
|
126
|
+
const octx = out.getContext('2d');
|
|
127
|
+
octx.clearRect(0, 0, out.width, out.height);
|
|
128
|
+
octx.drawImage(layer.canvas, 0, 0);
|
|
129
|
+
const img = octx.getImageData(0, 0, out.width, out.height);
|
|
130
|
+
const d = img.data;
|
|
131
|
+
|
|
132
|
+
// Single 256-entry LUT for the Levels portion (applied per R/G/B
|
|
133
|
+
// channel identically — luma-style isn't right when colour balance
|
|
134
|
+
// follows, per-channel is fine here).
|
|
135
|
+
const l = adj.levels || { inBlack: 0, inWhite: 255, gamma: 1, outBlack: 0, outWhite: 255 };
|
|
136
|
+
const inLow = Math.max(0, Math.min(254, l.inBlack));
|
|
137
|
+
const inHigh = Math.max(inLow + 1, Math.min(255, l.inWhite));
|
|
138
|
+
const gamma = Math.max(0.1, l.gamma || 1);
|
|
139
|
+
const outLow = Math.max(0, Math.min(255, l.outBlack));
|
|
140
|
+
const outHigh = Math.max(outLow, Math.min(255, l.outWhite));
|
|
141
|
+
const inv = 1.0 / gamma;
|
|
142
|
+
const span = (outHigh - outLow);
|
|
143
|
+
const lut = new Uint8ClampedArray(256);
|
|
144
|
+
for (let v = 0; v < 256; v++) {
|
|
145
|
+
let t = (v - inLow) / (inHigh - inLow);
|
|
146
|
+
if (t < 0) t = 0; else if (t > 1) t = 1;
|
|
147
|
+
t = Math.pow(t, inv);
|
|
148
|
+
lut[v] = Math.round(t * span + outLow);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// Color Balance bell-curve weights (see applyAdjustment).
|
|
152
|
+
const cb = adj.colorBalance || { shadows: {r:0,g:0,b:0}, midtones: {r:0,g:0,b:0}, highlights: {r:0,g:0,b:0} };
|
|
153
|
+
const s = cb.shadows || {r:0,g:0,b:0};
|
|
154
|
+
const m = cb.midtones || {r:0,g:0,b:0};
|
|
155
|
+
const h = cb.highlights || {r:0,g:0,b:0};
|
|
156
|
+
const scale = 0.6;
|
|
157
|
+
const sR = s.r * scale, sG = s.g * scale, sB = s.b * scale;
|
|
158
|
+
const mR = m.r * scale, mG = m.g * scale, mB = m.b * scale;
|
|
159
|
+
const hR = h.r * scale, hG = h.g * scale, hB = h.b * scale;
|
|
160
|
+
|
|
161
|
+
const wS = new Float32Array(256);
|
|
162
|
+
const wM = new Float32Array(256);
|
|
163
|
+
const wH = new Float32Array(256);
|
|
164
|
+
for (let v = 0; v < 256; v++) {
|
|
165
|
+
const t = v / 255;
|
|
166
|
+
const dS = t, wsig = 0.25;
|
|
167
|
+
const dM = t - 0.5;
|
|
168
|
+
const dH = 1 - t;
|
|
169
|
+
wS[v] = Math.exp(-(dS * dS) / (2 * wsig * wsig));
|
|
170
|
+
wM[v] = Math.exp(-(dM * dM) / (2 * wsig * wsig));
|
|
171
|
+
wH[v] = Math.exp(-(dH * dH) / (2 * wsig * wsig));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
for (let i = 0; i < d.length; i += 4) {
|
|
175
|
+
let r = lut[d[i]];
|
|
176
|
+
let g = lut[d[i + 1]];
|
|
177
|
+
let b = lut[d[i + 2]];
|
|
178
|
+
const Y = (0.2126 * r + 0.7152 * g + 0.0722 * b) | 0;
|
|
179
|
+
const ws = wS[Y], wm = wM[Y], wh = wH[Y];
|
|
180
|
+
r += sR * ws + mR * wm + hR * wh;
|
|
181
|
+
g += sG * ws + mG * wm + hG * wh;
|
|
182
|
+
b += sB * ws + mB * wm + hB * wh;
|
|
183
|
+
d[i] = r < 0 ? 0 : r > 255 ? 255 : r;
|
|
184
|
+
d[i + 1] = g < 0 ? 0 : g > 255 ? 255 : g;
|
|
185
|
+
d[i + 2] = b < 0 ? 0 : b > 255 ? 255 : b;
|
|
186
|
+
}
|
|
187
|
+
octx.putImageData(img, 0, 0);
|
|
188
|
+
layer._adjCacheKey = cacheKey;
|
|
189
|
+
return out;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Walk the layer's `adjLayers` stack (skipping the one currently being
|
|
195
|
+
* edited, if any) plus an optional staged preview adjustment, producing
|
|
196
|
+
* a final canvas the composite step can paint. The result is memoised
|
|
197
|
+
* on `layer._adjFinal` keyed by a signature of all adjLayer params +
|
|
198
|
+
* staged + editing id, so repeated composite passes are O(1) when
|
|
199
|
+
* nothing has changed.
|
|
200
|
+
*
|
|
201
|
+
* If the stack is empty AND nothing is staged, returns the layer's own
|
|
202
|
+
* canvas unchanged (no allocation).
|
|
203
|
+
*
|
|
204
|
+
* @param {{
|
|
205
|
+
* canvas: HTMLCanvasElement,
|
|
206
|
+
* adjLayers?: Array<{id: string, type: string, params: object, visible: boolean, opacity: number}>,
|
|
207
|
+
* _stagedAdj?: {type: string, params: object} | null,
|
|
208
|
+
* _editingAdjId?: string | null,
|
|
209
|
+
* _adjFinal?: HTMLCanvasElement,
|
|
210
|
+
* _adjFinalKey?: string,
|
|
211
|
+
* }} layer
|
|
212
|
+
* @returns {HTMLCanvasElement}
|
|
213
|
+
*/
|
|
214
|
+
export function renderLayerWithAdjLayers(layer) {
|
|
215
|
+
const editingId = layer._editingAdjId || null;
|
|
216
|
+
const stack = (layer.adjLayers || []).filter(a => a.visible && a.id !== editingId);
|
|
217
|
+
const staged = layer._stagedAdj;
|
|
218
|
+
if (stack.length === 0 && !staged) {
|
|
219
|
+
layer._adjFinalKey = '';
|
|
220
|
+
return layer.canvas;
|
|
221
|
+
}
|
|
222
|
+
const sig = stack.map(a => `${a.id}:${a.visible?1:0}:${a.opacity}:${a.type}:${JSON.stringify(a.params)}`).join('|') +
|
|
223
|
+
(staged ? `|S:${staged.type}:${JSON.stringify(staged.params)}` : '') +
|
|
224
|
+
(editingId ? `|E:${editingId}` : '');
|
|
225
|
+
if (layer._adjFinal && layer._adjFinalKey === sig) return layer._adjFinal;
|
|
226
|
+
let cur = layer.canvas;
|
|
227
|
+
const w = layer.canvas.width, h = layer.canvas.height;
|
|
228
|
+
for (const adj of stack) {
|
|
229
|
+
const adjOut = applyAdjustment(cur, adj);
|
|
230
|
+
if (adj.opacity >= 0.999) {
|
|
231
|
+
cur = adjOut;
|
|
232
|
+
} else {
|
|
233
|
+
const blend = document.createElement('canvas');
|
|
234
|
+
blend.width = w; blend.height = h;
|
|
235
|
+
const bctx = blend.getContext('2d');
|
|
236
|
+
bctx.drawImage(cur, 0, 0);
|
|
237
|
+
bctx.globalAlpha = adj.opacity;
|
|
238
|
+
bctx.drawImage(adjOut, 0, 0);
|
|
239
|
+
bctx.globalAlpha = 1;
|
|
240
|
+
cur = blend;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (staged) {
|
|
244
|
+
cur = applyAdjustment(cur, staged);
|
|
245
|
+
}
|
|
246
|
+
layer._adjFinal = cur;
|
|
247
|
+
layer._adjFinalKey = sig;
|
|
248
|
+
return cur;
|
|
249
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mask builders used by the AI Harmonize pipeline.
|
|
3
|
+
*
|
|
4
|
+
* - `layerUnionAlpha` — union of every non-base layer's alpha, as a
|
|
5
|
+
* binary (0/255) mask. Used as the substrate
|
|
6
|
+
* for both seam and body masks.
|
|
7
|
+
* - `seamMask` — feathered band along the alpha edges of all
|
|
8
|
+
* non-base layers. White = "blend here",
|
|
9
|
+
* black = "leave alone". Returned as base64
|
|
10
|
+
* PNG (so it can be POST'd to the diffusion
|
|
11
|
+
* endpoint as JSON).
|
|
12
|
+
* - `layerBodyMask` — feathered FULL shape of every non-base layer.
|
|
13
|
+
* White = "AI may redraw this pixel using the
|
|
14
|
+
* existing pixels as a starting point";
|
|
15
|
+
* black = "preserve exactly". Returned as base64.
|
|
16
|
+
*
|
|
17
|
+
* Each helper takes the visible layer list + the doc dimensions; no
|
|
18
|
+
* module state.
|
|
19
|
+
*
|
|
20
|
+
* @typedef {{ visible: boolean, id: string, canvas: HTMLCanvasElement, offset: {x: number, y: number} }} HarmLayer
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Build a binary alpha mask = the UNION of every non-base visible
|
|
25
|
+
* layer's pixels. Returns null when fewer than 2 visible layers exist
|
|
26
|
+
* or when the non-base layers are entirely transparent.
|
|
27
|
+
*
|
|
28
|
+
* @param {number} w / h Canvas dimensions in pixels.
|
|
29
|
+
* @param {HarmLayer[]} layers All layers in stack order; the
|
|
30
|
+
* first VISIBLE layer is treated as
|
|
31
|
+
* the base / background.
|
|
32
|
+
* @returns {HTMLCanvasElement|null}
|
|
33
|
+
*/
|
|
34
|
+
export function layerUnionAlpha(w, h, layers) {
|
|
35
|
+
const visible = layers.filter(l => l.visible);
|
|
36
|
+
if (visible.length < 2) return null;
|
|
37
|
+
const bgId = visible[0].id;
|
|
38
|
+
const alphaCanvas = document.createElement('canvas');
|
|
39
|
+
alphaCanvas.width = w; alphaCanvas.height = h;
|
|
40
|
+
const actx = alphaCanvas.getContext('2d');
|
|
41
|
+
let hasFg = false;
|
|
42
|
+
for (const layer of visible) {
|
|
43
|
+
if (layer.id === bgId) continue;
|
|
44
|
+
const off = layer.offset || { x: 0, y: 0 };
|
|
45
|
+
actx.drawImage(layer.canvas, off.x, off.y);
|
|
46
|
+
hasFg = true;
|
|
47
|
+
}
|
|
48
|
+
if (!hasFg) return null;
|
|
49
|
+
const src = actx.getImageData(0, 0, w, h);
|
|
50
|
+
const bin = document.createElement('canvas');
|
|
51
|
+
bin.width = w; bin.height = h;
|
|
52
|
+
const bctx = bin.getContext('2d');
|
|
53
|
+
const binImg = bctx.createImageData(w, h);
|
|
54
|
+
let any = false;
|
|
55
|
+
for (let i = 0; i < src.data.length; i += 4) {
|
|
56
|
+
const v = src.data[i + 3] > 0 ? 255 : 0;
|
|
57
|
+
if (v) any = true;
|
|
58
|
+
binImg.data[i] = binImg.data[i + 1] = binImg.data[i + 2] = v;
|
|
59
|
+
binImg.data[i + 3] = 255;
|
|
60
|
+
}
|
|
61
|
+
if (!any) return null;
|
|
62
|
+
bctx.putImageData(binImg, 0, 0);
|
|
63
|
+
return bin;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Build a feathered seam mask along the alpha edges of all non-base
|
|
69
|
+
* visible layers. Returns base64-encoded PNG (no `data:` prefix), or
|
|
70
|
+
* null if there's nothing to harmonize.
|
|
71
|
+
*/
|
|
72
|
+
export function seamMask(w, h, layers, featherPx = 12) {
|
|
73
|
+
const bin = layerUnionAlpha(w, h, layers);
|
|
74
|
+
if (!bin) return null;
|
|
75
|
+
const blur = document.createElement('canvas');
|
|
76
|
+
blur.width = w; blur.height = h;
|
|
77
|
+
const blctx = blur.getContext('2d');
|
|
78
|
+
blctx.filter = `blur(${featherPx}px)`;
|
|
79
|
+
blctx.drawImage(bin, 0, 0);
|
|
80
|
+
blctx.filter = 'none';
|
|
81
|
+
const blurred = blctx.getImageData(0, 0, w, h);
|
|
82
|
+
const mask = blctx.createImageData(w, h);
|
|
83
|
+
// Triangular weight peaked at mid-grey — picks out the alpha-edge band.
|
|
84
|
+
for (let i = 0; i < blurred.data.length; i += 4) {
|
|
85
|
+
const v = blurred.data[i];
|
|
86
|
+
const dist = Math.abs(v - 128);
|
|
87
|
+
const wt = Math.max(0, 255 - dist * 2);
|
|
88
|
+
mask.data[i] = mask.data[i + 1] = mask.data[i + 2] = wt;
|
|
89
|
+
mask.data[i + 3] = 255;
|
|
90
|
+
}
|
|
91
|
+
blctx.putImageData(mask, 0, 0);
|
|
92
|
+
const soft = document.createElement('canvas');
|
|
93
|
+
soft.width = w; soft.height = h;
|
|
94
|
+
const sctx = soft.getContext('2d');
|
|
95
|
+
sctx.filter = `blur(${Math.max(2, Math.floor(featherPx / 4))}px)`;
|
|
96
|
+
sctx.drawImage(blur, 0, 0);
|
|
97
|
+
sctx.filter = 'none';
|
|
98
|
+
return soft.toDataURL('image/png').split(',')[1];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Build a feathered FULL-shape mask of every non-base visible layer.
|
|
104
|
+
* Returns base64-encoded PNG, or null if there are no non-base layers.
|
|
105
|
+
*/
|
|
106
|
+
export function layerBodyMask(w, h, layers, featherPx = 12) {
|
|
107
|
+
const bin = layerUnionAlpha(w, h, layers);
|
|
108
|
+
if (!bin) return null;
|
|
109
|
+
const soft = document.createElement('canvas');
|
|
110
|
+
soft.width = w; soft.height = h;
|
|
111
|
+
const sctx = soft.getContext('2d');
|
|
112
|
+
sctx.filter = `blur(${featherPx}px)`;
|
|
113
|
+
sctx.drawImage(bin, 0, 0);
|
|
114
|
+
sctx.filter = 'none';
|
|
115
|
+
return soft.toDataURL('image/png').split(',')[1];
|
|
116
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* History-panel subsystem — the floating frosted list of labeled
|
|
3
|
+
* undo/redo entries that hangs off the topbar History button.
|
|
4
|
+
*
|
|
5
|
+
* Same docking pattern as the FX adjustment popups: drag the head to
|
|
6
|
+
* reposition, click the minimise button to dock into the modalManager
|
|
7
|
+
* chip chain, click the chip to restore. Esc closes.
|
|
8
|
+
*
|
|
9
|
+
* @param {{
|
|
10
|
+
* undo: () => void,
|
|
11
|
+
* redo: () => void,
|
|
12
|
+
* }} deps
|
|
13
|
+
*
|
|
14
|
+
* @returns {{
|
|
15
|
+
* toggleHistoryPanel: () => void,
|
|
16
|
+
* refreshHistoryPanelIfOpen: () => void,
|
|
17
|
+
* jumpToHistory: (offset: number) => void,
|
|
18
|
+
* }}
|
|
19
|
+
*/
|
|
20
|
+
import { state } from './state.js';
|
|
21
|
+
import modalManager from '../modalManager.js';
|
|
22
|
+
import { HISTORY_ICON, relTime } from './layer-helpers.js';
|
|
23
|
+
import { historyPanelHTML } from './build/popups.js';
|
|
24
|
+
|
|
25
|
+
export function createHistoryPanel({ undo, redo }) {
|
|
26
|
+
function jumpToHistory(offset) {
|
|
27
|
+
if (offset === 0) return;
|
|
28
|
+
if (offset < 0) {
|
|
29
|
+
for (let i = 0; i < -offset; i++) undo();
|
|
30
|
+
} else {
|
|
31
|
+
for (let i = 0; i < offset; i++) redo();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function closeHistoryPanel() {
|
|
36
|
+
if (state.historyPanelEl) {
|
|
37
|
+
if (state.historyPanelEl._escHandler) {
|
|
38
|
+
document.removeEventListener('keydown', state.historyPanelEl._escHandler, true);
|
|
39
|
+
}
|
|
40
|
+
if (state.historyPanelEl._awayHandler) {
|
|
41
|
+
document.removeEventListener('pointerdown', state.historyPanelEl._awayHandler, true);
|
|
42
|
+
}
|
|
43
|
+
state.historyPanelEl.remove();
|
|
44
|
+
state.historyPanelEl = null;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function minimiseHistoryPanel() {
|
|
49
|
+
if (!state.historyPanelEl) return;
|
|
50
|
+
const panel = state.historyPanelEl;
|
|
51
|
+
const r = panel.getBoundingClientRect();
|
|
52
|
+
panel._stashLeft = r.left;
|
|
53
|
+
panel._stashTop = r.top;
|
|
54
|
+
panel.style.display = 'none';
|
|
55
|
+
state.historyPanelEl = null;
|
|
56
|
+
const modalId = panel._modalId || 'ge-history-panel-min';
|
|
57
|
+
panel._modalId = modalId;
|
|
58
|
+
modalManager.register(modalId, {
|
|
59
|
+
label: 'History',
|
|
60
|
+
icon: HISTORY_ICON,
|
|
61
|
+
restoreFn: () => {
|
|
62
|
+
panel.style.left = panel._stashLeft + 'px';
|
|
63
|
+
panel.style.top = panel._stashTop + 'px';
|
|
64
|
+
panel.style.display = '';
|
|
65
|
+
state.historyPanelEl = panel;
|
|
66
|
+
refreshHistoryPanelIfOpen();
|
|
67
|
+
},
|
|
68
|
+
closeFn: () => {
|
|
69
|
+
panel.remove();
|
|
70
|
+
modalManager.unregister(modalId);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
modalManager.minimize(modalId);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function toggleHistoryPanel() {
|
|
77
|
+
if (state.historyPanelEl) { closeHistoryPanel(); return; }
|
|
78
|
+
const panel = document.createElement('div');
|
|
79
|
+
panel.id = 'ge-history-panel';
|
|
80
|
+
panel.className = 'ge-frosted';
|
|
81
|
+
panel.innerHTML = historyPanelHTML(HISTORY_ICON);
|
|
82
|
+
document.body.appendChild(panel);
|
|
83
|
+
state.historyPanelEl = panel;
|
|
84
|
+
const btn = document.getElementById('ge-history-btn');
|
|
85
|
+
if (btn) {
|
|
86
|
+
const r = btn.getBoundingClientRect();
|
|
87
|
+
panel.style.top = (r.bottom + 6) + 'px';
|
|
88
|
+
panel.style.left = Math.max(8, r.left) + 'px';
|
|
89
|
+
}
|
|
90
|
+
panel.querySelector('.ge-adj-min').addEventListener('click', minimiseHistoryPanel);
|
|
91
|
+
// Click anywhere outside the panel (or trigger button) closes it.
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
const onAway = (ev) => {
|
|
94
|
+
if (!state.historyPanelEl) return;
|
|
95
|
+
if (state.historyPanelEl.contains(ev.target)) return;
|
|
96
|
+
if (btn && (ev.target === btn || btn.contains(ev.target))) return;
|
|
97
|
+
closeHistoryPanel();
|
|
98
|
+
document.removeEventListener('pointerdown', onAway, true);
|
|
99
|
+
};
|
|
100
|
+
document.addEventListener('pointerdown', onAway, true);
|
|
101
|
+
panel._awayHandler = onAway;
|
|
102
|
+
}, 0);
|
|
103
|
+
|
|
104
|
+
const head = panel.querySelector('[data-history-drag]');
|
|
105
|
+
head.addEventListener('pointerdown', (e) => {
|
|
106
|
+
if (e.target.closest('button')) return;
|
|
107
|
+
e.preventDefault();
|
|
108
|
+
const startX = e.clientX, startY = e.clientY;
|
|
109
|
+
const r0 = panel.getBoundingClientRect();
|
|
110
|
+
head.setPointerCapture(e.pointerId);
|
|
111
|
+
head.style.cursor = 'grabbing';
|
|
112
|
+
const onMove = (ev) => {
|
|
113
|
+
const nx = Math.max(0, Math.min(window.innerWidth - 60, r0.left + (ev.clientX - startX)));
|
|
114
|
+
const ny = Math.max(0, Math.min(window.innerHeight - 30, r0.top + (ev.clientY - startY)));
|
|
115
|
+
panel.style.left = nx + 'px';
|
|
116
|
+
panel.style.top = ny + 'px';
|
|
117
|
+
};
|
|
118
|
+
const onUp = () => {
|
|
119
|
+
head.releasePointerCapture(e.pointerId);
|
|
120
|
+
head.style.cursor = '';
|
|
121
|
+
head.removeEventListener('pointermove', onMove);
|
|
122
|
+
head.removeEventListener('pointerup', onUp);
|
|
123
|
+
};
|
|
124
|
+
head.addEventListener('pointermove', onMove);
|
|
125
|
+
head.addEventListener('pointerup', onUp);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const onKey = (ev) => {
|
|
129
|
+
if (ev.key === 'Escape') {
|
|
130
|
+
ev.preventDefault();
|
|
131
|
+
ev.stopPropagation();
|
|
132
|
+
closeHistoryPanel();
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
document.addEventListener('keydown', onKey, true);
|
|
136
|
+
panel._escHandler = onKey;
|
|
137
|
+
|
|
138
|
+
refreshHistoryPanelIfOpen();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function refreshHistoryPanelIfOpen() {
|
|
142
|
+
if (!state.historyPanelEl) return;
|
|
143
|
+
const list = state.historyPanelEl.querySelector('#ge-history-list');
|
|
144
|
+
if (!list) return;
|
|
145
|
+
// Chronological order — oldest at top, latest at bottom. Past
|
|
146
|
+
// (undo) states first, then Current, then future (redo) states.
|
|
147
|
+
const rows = [];
|
|
148
|
+
for (let i = 0; i < state.undoStack.length; i++) {
|
|
149
|
+
const s = state.undoStack[i];
|
|
150
|
+
rows.push({ offset: -(state.undoStack.length - i), label: s._label || 'Edit', ts: s._ts });
|
|
151
|
+
}
|
|
152
|
+
rows.push({ offset: 0, label: 'Current', ts: Date.now(), current: true });
|
|
153
|
+
for (let i = state.redoStack.length - 1; i >= 0; i--) {
|
|
154
|
+
const s = state.redoStack[i];
|
|
155
|
+
rows.push({ offset: (state.redoStack.length - i), label: s._label || 'Edit', ts: s._ts, future: true });
|
|
156
|
+
}
|
|
157
|
+
list.innerHTML = rows.map(r => `
|
|
158
|
+
<button class="ge-history-row${r.current ? ' current' : ''}${r.future ? ' future' : ''}" data-offset="${r.offset}">
|
|
159
|
+
<span class="ge-history-row-dot"></span>
|
|
160
|
+
<span class="ge-history-row-label">${(r.label || '').replace(/[<>&]/g,'')}</span>
|
|
161
|
+
<span class="ge-history-row-time">${relTime(r.ts)}</span>
|
|
162
|
+
</button>
|
|
163
|
+
`).join('');
|
|
164
|
+
list.querySelectorAll('.ge-history-row').forEach(btn => {
|
|
165
|
+
btn.addEventListener('click', () => {
|
|
166
|
+
const off = parseInt(btn.dataset.offset, 10);
|
|
167
|
+
jumpToHistory(off);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
// Scroll the current marker into view.
|
|
171
|
+
const cur = list.querySelector('.current');
|
|
172
|
+
if (cur) cur.scrollIntoView({ block: 'center' });
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return { toggleHistoryPanel, refreshHistoryPanelIfOpen, jumpToHistory };
|
|
176
|
+
}
|