@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,356 @@
|
|
|
1
|
+
// static/js/censor.js
|
|
2
|
+
/**
|
|
3
|
+
* Sensitive Information Censor Module
|
|
4
|
+
* Detects emails, passwords, API keys, tokens, etc. in chat responses
|
|
5
|
+
* and blurs them. Click to reveal individual items.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
let _enabled = true;
|
|
9
|
+
let _observer = null;
|
|
10
|
+
const PREF_KEY = 'zero-sensitive-blur';
|
|
11
|
+
export const _prefEnabled = () => {
|
|
12
|
+
try {
|
|
13
|
+
return localStorage.getItem(PREF_KEY) === 'on';
|
|
14
|
+
} catch (_) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Patterns that indicate sensitive data
|
|
20
|
+
const PATTERNS = [
|
|
21
|
+
// Emails
|
|
22
|
+
{ re: /\b[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}\b/g, label: 'email' },
|
|
23
|
+
// API key prefixes (common services)
|
|
24
|
+
{ re: /\b(sk-[a-zA-Z0-9]{20,}|pk-[a-zA-Z0-9]{20,}|ghp_[a-zA-Z0-9]{36,}|gho_[a-zA-Z0-9]{36,}|glpat-[a-zA-Z0-9\-_]{20,}|xox[bpras]-[a-zA-Z0-9\-]{10,}|npm_[a-zA-Z0-9]{36,}|AKIA[A-Z0-9]{12,})\b/g, label: 'api-key' },
|
|
25
|
+
// Bearer tokens
|
|
26
|
+
{ re: /Bearer\s+[A-Za-z0-9._\-]{20,}/g, label: 'token' },
|
|
27
|
+
// Generic tokens/secrets in key=value or key: value patterns
|
|
28
|
+
// Credentials with delimiters (key: value, key=value, key value)
|
|
29
|
+
{ re: /(?:password|passwd|secret|api[_\-]?key|access[_\-]?token|auth[_\-]?token|private[_\-]?key|client[_\-]?secret)[\s]*[:=]\s*["']?[^\s"'<]{4,}["']?/gi, label: 'credential' },
|
|
30
|
+
// Credentials in tabular/label-value format (Password xyzABC123)
|
|
31
|
+
{ re: /(?:password|passwd|secret|api[_\-]?key|access[_\-]?token|auth[_\-]?token|private[_\-]?key|client[_\-]?secret)\s{2,}[^\s<]{4,}/gi, label: 'credential' },
|
|
32
|
+
// Value after a line starting with password-like label
|
|
33
|
+
{ re: /(?:^|\n)\s*(?:password|passwd|secret|api[_\-]?key|token|private[_\-]?key)[\t ]*\n\s*([^\s<]{4,})/gim, label: 'credential' },
|
|
34
|
+
// SSH / PEM private keys (inline)
|
|
35
|
+
{ re: /-----BEGIN\s[\w\s]*PRIVATE KEY-----[\s\S]*?-----END\s[\w\s]*PRIVATE KEY-----/g, label: 'private-key' },
|
|
36
|
+
// Long hex strings (32+ chars) that look like hashes/tokens
|
|
37
|
+
{ re: /\b[0-9a-f]{32,}\b/gi, label: 'hash' },
|
|
38
|
+
// JWT tokens (three dot-separated base64 segments)
|
|
39
|
+
{ re: /\beyJ[A-Za-z0-9_\-]{10,}\.eyJ[A-Za-z0-9_\-]{10,}\.[A-Za-z0-9_\-]{10,}\b/g, label: 'jwt' },
|
|
40
|
+
// IP addresses with ports (internal networks)
|
|
41
|
+
{ re: /\b(?:10\.\d{1,3}|172\.(?:1[6-9]|2\d|3[01])|192\.168)\.\d{1,3}\.\d{1,3}(?::\d+)?\b/g, label: 'internal-ip' },
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export function init() {
|
|
45
|
+
// Load enabled state from feature flags
|
|
46
|
+
_loadState();
|
|
47
|
+
window.addEventListener('zero-sensitive-blur-change', (e) => {
|
|
48
|
+
setEnabled(e.detail?.enabled !== false);
|
|
49
|
+
});
|
|
50
|
+
// Set up click handler for reveals (delegated)
|
|
51
|
+
document.addEventListener('click', (e) => {
|
|
52
|
+
const el = e.target.closest('.censored-item');
|
|
53
|
+
if (!el) return;
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
el.classList.toggle('revealed');
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function _loadState() {
|
|
61
|
+
// Check admin feature flag
|
|
62
|
+
fetch('/api/auth/features', { credentials: 'same-origin' })
|
|
63
|
+
.then(r => r.json())
|
|
64
|
+
.then(features => {
|
|
65
|
+
_enabled = features.sensitive_filter !== false && _prefEnabled();
|
|
66
|
+
// Start observer after loading state
|
|
67
|
+
_startObserver();
|
|
68
|
+
})
|
|
69
|
+
.catch(() => {
|
|
70
|
+
// Default: enabled
|
|
71
|
+
_enabled = _prefEnabled();
|
|
72
|
+
_startObserver();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _startObserver() {
|
|
77
|
+
if (_observer) return;
|
|
78
|
+
// Observe chat-history, compare panes, and split panes for new messages
|
|
79
|
+
_observer = new MutationObserver((mutations) => {
|
|
80
|
+
if (!_enabled) return;
|
|
81
|
+
for (const mutation of mutations) {
|
|
82
|
+
for (const node of mutation.addedNodes) {
|
|
83
|
+
if (node.nodeType !== 1) continue;
|
|
84
|
+
// Process any .body elements within newly added nodes
|
|
85
|
+
if (node.classList && node.classList.contains('body')) {
|
|
86
|
+
_scheduleProcess(node);
|
|
87
|
+
} else if (node.querySelectorAll) {
|
|
88
|
+
node.querySelectorAll('.msg .body, .msg-ai .body').forEach(b => _scheduleProcess(b));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// Observe the entire main area for new messages
|
|
95
|
+
const targets = [
|
|
96
|
+
document.getElementById('chat-container'),
|
|
97
|
+
document.getElementById('chat-history'),
|
|
98
|
+
].filter(Boolean);
|
|
99
|
+
|
|
100
|
+
targets.forEach(t => {
|
|
101
|
+
_observer.observe(t, { childList: true, subtree: true });
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Debounce processing — content may still be streaming
|
|
106
|
+
const _pending = new WeakSet();
|
|
107
|
+
function _scheduleProcess(el) {
|
|
108
|
+
if (_pending.has(el)) return;
|
|
109
|
+
_pending.add(el);
|
|
110
|
+
// Wait for streaming to settle — process after a short delay
|
|
111
|
+
// Re-process periodically during streaming
|
|
112
|
+
let attempts = 0;
|
|
113
|
+
const maxAttempts = 30;
|
|
114
|
+
const interval = setInterval(() => {
|
|
115
|
+
_processElement(el);
|
|
116
|
+
attempts++;
|
|
117
|
+
if (attempts >= maxAttempts) clearInterval(interval);
|
|
118
|
+
}, 2000);
|
|
119
|
+
// Also process once immediately (catches non-streaming content)
|
|
120
|
+
setTimeout(() => _processElement(el), 100);
|
|
121
|
+
// Final pass after streaming likely done
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
clearInterval(interval);
|
|
124
|
+
_processElement(el);
|
|
125
|
+
_pending.delete(el);
|
|
126
|
+
}, 60000);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Labels that indicate the NEXT value should be censored
|
|
130
|
+
const SENSITIVE_LABELS = /^(?:password|passwd|secret|api[_\-]?key|access[_\-]?token|auth[_\-]?token|private[_\-]?key|client[_\-]?secret|token|credentials?)$/i;
|
|
131
|
+
|
|
132
|
+
function _processElement(el) {
|
|
133
|
+
if (!_enabled || !el) return;
|
|
134
|
+
if (el.closest && el.closest('.setup-guide-no-censor')) return;
|
|
135
|
+
|
|
136
|
+
// --- Pass 1: Pattern-based censoring on text nodes ---
|
|
137
|
+
const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null);
|
|
138
|
+
const textNodes = [];
|
|
139
|
+
let node;
|
|
140
|
+
while ((node = walker.nextNode())) {
|
|
141
|
+
if (node.parentElement.closest('.setup-guide-no-censor')) continue;
|
|
142
|
+
if (node.parentElement.closest('pre:not(.censored-item), .censored-item')) continue;
|
|
143
|
+
textNodes.push(node);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
for (const textNode of textNodes) {
|
|
147
|
+
const text = textNode.textContent;
|
|
148
|
+
if (!text || text.trim().length < 4) continue;
|
|
149
|
+
|
|
150
|
+
const matches = [];
|
|
151
|
+
for (const pattern of PATTERNS) {
|
|
152
|
+
pattern.re.lastIndex = 0;
|
|
153
|
+
let m;
|
|
154
|
+
while ((m = pattern.re.exec(text)) !== null) {
|
|
155
|
+
matches.push({ start: m.index, end: m.index + m[0].length, text: m[0], label: pattern.label });
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
if (matches.length === 0) continue;
|
|
159
|
+
|
|
160
|
+
matches.sort((a, b) => a.start - b.start);
|
|
161
|
+
const deduped = [matches[0]];
|
|
162
|
+
for (let i = 1; i < matches.length; i++) {
|
|
163
|
+
const prev = deduped[deduped.length - 1];
|
|
164
|
+
if (matches[i].start < prev.end) {
|
|
165
|
+
if (matches[i].end > prev.end) prev.end = matches[i].end;
|
|
166
|
+
} else {
|
|
167
|
+
deduped.push(matches[i]);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const frag = document.createDocumentFragment();
|
|
172
|
+
let lastIdx = 0;
|
|
173
|
+
for (const match of deduped) {
|
|
174
|
+
if (match.start > lastIdx) {
|
|
175
|
+
frag.appendChild(document.createTextNode(text.slice(lastIdx, match.start)));
|
|
176
|
+
}
|
|
177
|
+
const span = document.createElement('span');
|
|
178
|
+
span.className = 'censored-item';
|
|
179
|
+
span.dataset.type = match.label;
|
|
180
|
+
span.title = 'Click to reveal ' + match.label;
|
|
181
|
+
span.textContent = match.text;
|
|
182
|
+
frag.appendChild(span);
|
|
183
|
+
lastIdx = match.end;
|
|
184
|
+
}
|
|
185
|
+
if (lastIdx < text.length) {
|
|
186
|
+
frag.appendChild(document.createTextNode(text.slice(lastIdx)));
|
|
187
|
+
}
|
|
188
|
+
textNode.parentNode.replaceChild(frag, textNode);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// --- Pass 2: Context-aware label/value censoring ---
|
|
192
|
+
// Finds elements where text matches a sensitive label, then censors
|
|
193
|
+
// the adjacent sibling or next text content as a value.
|
|
194
|
+
_contextCensor(el);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function _contextCensor(el) {
|
|
198
|
+
// Strategy 1: Walk all elements looking for sensitive labels
|
|
199
|
+
const allElements = el.querySelectorAll('td, th, dt, dd, span, strong, b, em, li, p, div');
|
|
200
|
+
for (let i = 0; i < allElements.length; i++) {
|
|
201
|
+
const elem = allElements[i];
|
|
202
|
+
if (elem.closest('.setup-guide-no-censor')) continue;
|
|
203
|
+
if (elem.closest('.censored-item, pre')) continue;
|
|
204
|
+
const txt = (elem.textContent || '').trim();
|
|
205
|
+
if (!SENSITIVE_LABELS.test(txt)) continue;
|
|
206
|
+
|
|
207
|
+
// Found a label — censor value via multiple strategies
|
|
208
|
+
let censored = false;
|
|
209
|
+
|
|
210
|
+
// A) Next text sibling node (e.g. <strong>Password</strong> value123)
|
|
211
|
+
let sibling = elem.nextSibling;
|
|
212
|
+
while (sibling && !censored) {
|
|
213
|
+
if (sibling.nodeType === 3) { // text node
|
|
214
|
+
const val = sibling.textContent.trim();
|
|
215
|
+
if (val.length >= 4 && !SENSITIVE_LABELS.test(val)) {
|
|
216
|
+
const span = document.createElement('span');
|
|
217
|
+
span.className = 'censored-item';
|
|
218
|
+
span.dataset.type = 'credential';
|
|
219
|
+
span.title = 'Click to reveal credential';
|
|
220
|
+
span.textContent = sibling.textContent;
|
|
221
|
+
sibling.parentNode.replaceChild(span, sibling);
|
|
222
|
+
censored = true;
|
|
223
|
+
}
|
|
224
|
+
} else if (sibling.nodeType === 1 && !sibling.closest('.censored-item')) {
|
|
225
|
+
// Element sibling — censor its text
|
|
226
|
+
const val = sibling.textContent.trim();
|
|
227
|
+
if (val.length >= 4 && !SENSITIVE_LABELS.test(val)) {
|
|
228
|
+
_censorAllText(sibling);
|
|
229
|
+
censored = true;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
sibling = censored ? null : sibling.nextSibling;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// B) Parent's next element sibling (for <td>/<dd> pairs)
|
|
236
|
+
if (!censored) {
|
|
237
|
+
const parent = elem.parentElement;
|
|
238
|
+
if (parent) {
|
|
239
|
+
const nextEl = parent.nextElementSibling;
|
|
240
|
+
if (nextEl && !nextEl.closest('.censored-item')) {
|
|
241
|
+
const val = nextEl.textContent.trim();
|
|
242
|
+
if (val.length >= 2 && !SENSITIVE_LABELS.test(val)) {
|
|
243
|
+
_censorAllText(nextEl);
|
|
244
|
+
censored = true;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// C) Same parent, next text node after this element
|
|
251
|
+
if (!censored && elem.parentElement) {
|
|
252
|
+
const parent = elem.parentElement;
|
|
253
|
+
let found = false;
|
|
254
|
+
for (let c = 0; c < parent.childNodes.length; c++) {
|
|
255
|
+
const child = parent.childNodes[c];
|
|
256
|
+
if (child === elem) { found = true; continue; }
|
|
257
|
+
if (!found) continue;
|
|
258
|
+
if (child.nodeType === 3 && child.textContent.trim().length >= 4) {
|
|
259
|
+
const val = child.textContent.trim();
|
|
260
|
+
if (!SENSITIVE_LABELS.test(val)) {
|
|
261
|
+
const span = document.createElement('span');
|
|
262
|
+
span.className = 'censored-item';
|
|
263
|
+
span.dataset.type = 'credential';
|
|
264
|
+
span.title = 'Click to reveal credential';
|
|
265
|
+
span.textContent = child.textContent;
|
|
266
|
+
child.parentNode.replaceChild(span, child);
|
|
267
|
+
break;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// Strategy 2: Full-text scan for label-value patterns across lines
|
|
275
|
+
// Get the full text, find patterns like "Password\n value" or "Password: value"
|
|
276
|
+
const fullText = el.textContent || '';
|
|
277
|
+
const labelValueRe = /(?:password|passwd|secret|api[_\-]?key|access[_\-]?token|private[_\-]?key|client[_\-]?secret|token|auth[_\-]?token)\s*[:\s]\s*(\S{4,})/gi;
|
|
278
|
+
let m;
|
|
279
|
+
while ((m = labelValueRe.exec(fullText)) !== null) {
|
|
280
|
+
const value = m[1];
|
|
281
|
+
// Find and censor this value string in text nodes
|
|
282
|
+
_censorValueInElement(el, value);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
function _censorValueInElement(el, value) {
|
|
287
|
+
if (!value || value.length < 4) return;
|
|
288
|
+
const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null);
|
|
289
|
+
let node;
|
|
290
|
+
while ((node = walker.nextNode())) {
|
|
291
|
+
if (node.parentElement.closest('.setup-guide-no-censor')) continue;
|
|
292
|
+
if (node.parentElement.closest('pre:not(.censored-item), .censored-item')) continue;
|
|
293
|
+
const idx = node.textContent.indexOf(value);
|
|
294
|
+
if (idx < 0) continue;
|
|
295
|
+
// Split text node and wrap the value
|
|
296
|
+
const before = node.textContent.slice(0, idx);
|
|
297
|
+
const after = node.textContent.slice(idx + value.length);
|
|
298
|
+
const frag = document.createDocumentFragment();
|
|
299
|
+
if (before) frag.appendChild(document.createTextNode(before));
|
|
300
|
+
const span = document.createElement('span');
|
|
301
|
+
span.className = 'censored-item';
|
|
302
|
+
span.dataset.type = 'credential';
|
|
303
|
+
span.title = 'Click to reveal credential';
|
|
304
|
+
span.textContent = value;
|
|
305
|
+
frag.appendChild(span);
|
|
306
|
+
if (after) frag.appendChild(document.createTextNode(after));
|
|
307
|
+
node.parentNode.replaceChild(frag, node);
|
|
308
|
+
return; // One replacement per call to avoid walker issues
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function _censorAllText(el) {
|
|
313
|
+
// Wrap all text content in a censored span
|
|
314
|
+
if (el.querySelector('.censored-item')) return;
|
|
315
|
+
const walker = document.createTreeWalker(el, NodeFilter.SHOW_TEXT, null);
|
|
316
|
+
const nodes = [];
|
|
317
|
+
let n;
|
|
318
|
+
while ((n = walker.nextNode())) {
|
|
319
|
+
if (n.parentElement.closest('.setup-guide-no-censor')) continue;
|
|
320
|
+
if (n.parentElement.closest('.censored-item, pre')) continue;
|
|
321
|
+
if (n.textContent.trim().length >= 2) nodes.push(n);
|
|
322
|
+
}
|
|
323
|
+
for (const tn of nodes) {
|
|
324
|
+
const span = document.createElement('span');
|
|
325
|
+
span.className = 'censored-item';
|
|
326
|
+
span.dataset.type = 'credential';
|
|
327
|
+
span.title = 'Click to reveal credential';
|
|
328
|
+
span.textContent = tn.textContent;
|
|
329
|
+
tn.parentNode.replaceChild(span, tn);
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/** Manually censor a specific element (for dynamically loaded content) */
|
|
334
|
+
export function censorElement(el) {
|
|
335
|
+
if (!_enabled) return;
|
|
336
|
+
_processElement(el);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/** Toggle censoring on/off (client-side) */
|
|
340
|
+
export function setEnabled(enabled) {
|
|
341
|
+
_enabled = enabled;
|
|
342
|
+
if (!enabled) {
|
|
343
|
+
// Reveal all currently censored items
|
|
344
|
+
document.querySelectorAll('.censored-item').forEach(el => el.classList.add('revealed'));
|
|
345
|
+
} else {
|
|
346
|
+
document.querySelectorAll('.censored-item').forEach(el => el.classList.remove('revealed'));
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function isEnabled() {
|
|
351
|
+
return _enabled;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const censorModule = { init, censorElement, setEnabled, isEnabled };
|
|
355
|
+
|
|
356
|
+
export default censorModule;
|