@maudecode/talaria-web 0.0.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/contract_versions.json +18 -0
- package/dist/api/auth-raw.d.ts +9 -0
- package/dist/api/auth-raw.js +134 -0
- package/dist/api/auth-raw.js.map +1 -0
- package/dist/api/automation-raw.d.ts +16 -0
- package/dist/api/automation-raw.js +340 -0
- package/dist/api/automation-raw.js.map +1 -0
- package/dist/api/automation-router.d.ts +788 -0
- package/dist/api/automation-router.js +248 -0
- package/dist/api/automation-router.js.map +1 -0
- package/dist/api/chat-router.d.ts +375 -0
- package/dist/api/chat-router.js +446 -0
- package/dist/api/chat-router.js.map +1 -0
- package/dist/api/git-router.d.ts +681 -0
- package/dist/api/git-router.js +275 -0
- package/dist/api/git-router.js.map +1 -0
- package/dist/api/raw-routes.d.ts +10 -0
- package/dist/api/raw-routes.js +466 -0
- package/dist/api/raw-routes.js.map +1 -0
- package/dist/api/router.d.ts +226 -0
- package/dist/api/router.js +331 -0
- package/dist/api/router.js.map +1 -0
- package/dist/api/session-visibility.d.ts +12 -0
- package/dist/api/session-visibility.js +51 -0
- package/dist/api/session-visibility.js.map +1 -0
- package/dist/api/sessions-router.d.ts +1728 -0
- package/dist/api/sessions-router.js +815 -0
- package/dist/api/sessions-router.js.map +1 -0
- package/dist/api/settings-router.d.ts +592 -0
- package/dist/api/settings-router.js +474 -0
- package/dist/api/settings-router.js.map +1 -0
- package/dist/api/sse-routes.d.ts +51 -0
- package/dist/api/sse-routes.js +602 -0
- package/dist/api/sse-routes.js.map +1 -0
- package/dist/api/tools-raw.d.ts +5 -0
- package/dist/api/tools-raw.js +291 -0
- package/dist/api/tools-raw.js.map +1 -0
- package/dist/api/tools-router.d.ts +494 -0
- package/dist/api/tools-router.js +349 -0
- package/dist/api/tools-router.js.map +1 -0
- package/dist/app.d.ts +4787 -0
- package/dist/app.js +453 -0
- package/dist/app.js.map +1 -0
- package/dist/auth/cookies.d.ts +17 -0
- package/dist/auth/cookies.js +42 -0
- package/dist/auth/cookies.js.map +1 -0
- package/dist/auth/crypto.d.ts +9 -0
- package/dist/auth/crypto.js +38 -0
- package/dist/auth/crypto.js.map +1 -0
- package/dist/auth/gate.d.ts +39 -0
- package/dist/auth/gate.js +406 -0
- package/dist/auth/gate.js.map +1 -0
- package/dist/auth/oidc.d.ts +138 -0
- package/dist/auth/oidc.js +836 -0
- package/dist/auth/oidc.js.map +1 -0
- package/dist/auth/passkeys.d.ts +49 -0
- package/dist/auth/passkeys.js +310 -0
- package/dist/auth/passkeys.js.map +1 -0
- package/dist/auth/store.d.ts +116 -0
- package/dist/auth/store.js +485 -0
- package/dist/auth/store.js.map +1 -0
- package/dist/bin/talaria-web-mcp.d.ts +2 -0
- package/dist/bin/talaria-web-mcp.js +12 -0
- package/dist/bin/talaria-web-mcp.js.map +1 -0
- package/dist/bin/talaria-web.d.ts +2 -0
- package/dist/bin/talaria-web.js +87 -0
- package/dist/bin/talaria-web.js.map +1 -0
- package/dist/cli/ctl.d.ts +58 -0
- package/dist/cli/ctl.js +643 -0
- package/dist/cli/ctl.js.map +1 -0
- package/dist/cli/dotenv.d.ts +30 -0
- package/dist/cli/dotenv.js +115 -0
- package/dist/cli/dotenv.js.map +1 -0
- package/dist/cli/launcher.d.ts +49 -0
- package/dist/cli/launcher.js +213 -0
- package/dist/cli/launcher.js.map +1 -0
- package/dist/cli/supervise.d.ts +10 -0
- package/dist/cli/supervise.js +33 -0
- package/dist/cli/supervise.js.map +1 -0
- package/dist/cli/web-root.d.ts +2 -0
- package/dist/cli/web-root.js +23 -0
- package/dist/cli/web-root.js.map +1 -0
- package/dist/config/agent-config.d.ts +109 -0
- package/dist/config/agent-config.js +632 -0
- package/dist/config/agent-config.js.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.js +105 -0
- package/dist/config.js.map +1 -0
- package/dist/fs/atomic.d.ts +7 -0
- package/dist/fs/atomic.js +68 -0
- package/dist/fs/atomic.js.map +1 -0
- package/dist/http/addresses.d.ts +5 -0
- package/dist/http/addresses.js +68 -0
- package/dist/http/addresses.js.map +1 -0
- package/dist/http/capped.d.ts +2 -0
- package/dist/http/capped.js +22 -0
- package/dist/http/capped.js.map +1 -0
- package/dist/http/context.d.ts +281 -0
- package/dist/http/context.js +327 -0
- package/dist/http/context.js.map +1 -0
- package/dist/http/csp.d.ts +11 -0
- package/dist/http/csp.js +51 -0
- package/dist/http/csp.js.map +1 -0
- package/dist/http/origin.d.ts +39 -0
- package/dist/http/origin.js +183 -0
- package/dist/http/origin.js.map +1 -0
- package/dist/http/pinned.d.ts +18 -0
- package/dist/http/pinned.js +62 -0
- package/dist/http/pinned.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +29 -0
- package/dist/mcp/server.js +221 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/onboarding.d.ts +57 -0
- package/dist/onboarding.js +381 -0
- package/dist/onboarding.js.map +1 -0
- package/dist/profiles/profiles.d.ts +96 -0
- package/dist/profiles/profiles.js +476 -0
- package/dist/profiles/profiles.js.map +1 -0
- package/dist/projects.d.ts +36 -0
- package/dist/projects.js +102 -0
- package/dist/projects.js.map +1 -0
- package/dist/providers/catalog.d.ts +118 -0
- package/dist/providers/catalog.js +868 -0
- package/dist/providers/catalog.js.map +1 -0
- package/dist/providers/env-file.d.ts +6 -0
- package/dist/providers/env-file.js +106 -0
- package/dist/providers/env-file.js.map +1 -0
- package/dist/providers/runtime-env.d.ts +20 -0
- package/dist/providers/runtime-env.js +85 -0
- package/dist/providers/runtime-env.js.map +1 -0
- package/dist/providers/tables.d.ts +54 -0
- package/dist/providers/tables.js +54 -0
- package/dist/providers/tables.js.map +1 -0
- package/dist/redact.d.ts +23 -0
- package/dist/redact.js +337 -0
- package/dist/redact.js.map +1 -0
- package/dist/release.d.ts +16 -0
- package/dist/release.js +114 -0
- package/dist/release.js.map +1 -0
- package/dist/runtime.d.ts +21 -0
- package/dist/runtime.js +680 -0
- package/dist/runtime.js.map +1 -0
- package/dist/server.d.ts +20 -0
- package/dist/server.js +90 -0
- package/dist/server.js.map +1 -0
- package/dist/sessions/anchor.d.ts +43 -0
- package/dist/sessions/anchor.js +311 -0
- package/dist/sessions/anchor.js.map +1 -0
- package/dist/sessions/cli-sessions.d.ts +27 -0
- package/dist/sessions/cli-sessions.js +158 -0
- package/dist/sessions/cli-sessions.js.map +1 -0
- package/dist/sessions/completions.d.ts +62 -0
- package/dist/sessions/completions.js +332 -0
- package/dist/sessions/completions.js.map +1 -0
- package/dist/sessions/drafts.d.ts +26 -0
- package/dist/sessions/drafts.js +117 -0
- package/dist/sessions/drafts.js.map +1 -0
- package/dist/sessions/events.d.ts +32 -0
- package/dist/sessions/events.js +80 -0
- package/dist/sessions/events.js.map +1 -0
- package/dist/sessions/export.d.ts +4 -0
- package/dist/sessions/export.js +186 -0
- package/dist/sessions/export.js.map +1 -0
- package/dist/sessions/gateway-watcher.d.ts +58 -0
- package/dist/sessions/gateway-watcher.js +199 -0
- package/dist/sessions/gateway-watcher.js.map +1 -0
- package/dist/sessions/journal.d.ts +103 -0
- package/dist/sessions/journal.js +543 -0
- package/dist/sessions/journal.js.map +1 -0
- package/dist/sessions/list.d.ts +130 -0
- package/dist/sessions/list.js +846 -0
- package/dist/sessions/list.js.map +1 -0
- package/dist/sessions/merge.d.ts +57 -0
- package/dist/sessions/merge.js +517 -0
- package/dist/sessions/merge.js.map +1 -0
- package/dist/sessions/pending.d.ts +69 -0
- package/dist/sessions/pending.js +271 -0
- package/dist/sessions/pending.js.map +1 -0
- package/dist/sessions/reasoning-titles.d.ts +31 -0
- package/dist/sessions/reasoning-titles.js +143 -0
- package/dist/sessions/reasoning-titles.js.map +1 -0
- package/dist/sessions/relay.d.ts +131 -0
- package/dist/sessions/relay.js +577 -0
- package/dist/sessions/relay.js.map +1 -0
- package/dist/sessions/service.d.ts +189 -0
- package/dist/sessions/service.js +1344 -0
- package/dist/sessions/service.js.map +1 -0
- package/dist/sessions/session.d.ts +131 -0
- package/dist/sessions/session.js +505 -0
- package/dist/sessions/session.js.map +1 -0
- package/dist/sessions/shares.d.ts +31 -0
- package/dist/sessions/shares.js +267 -0
- package/dist/sessions/shares.js.map +1 -0
- package/dist/sessions/state-db.d.ts +52 -0
- package/dist/sessions/state-db.js +641 -0
- package/dist/sessions/state-db.js.map +1 -0
- package/dist/sessions/state-saved.d.ts +13 -0
- package/dist/sessions/state-saved.js +47 -0
- package/dist/sessions/state-saved.js.map +1 -0
- package/dist/sessions/store.d.ts +124 -0
- package/dist/sessions/store.js +790 -0
- package/dist/sessions/store.js.map +1 -0
- package/dist/sessions/streams.d.ts +90 -0
- package/dist/sessions/streams.js +200 -0
- package/dist/sessions/streams.js.map +1 -0
- package/dist/sessions/titles.d.ts +17 -0
- package/dist/sessions/titles.js +231 -0
- package/dist/sessions/titles.js.map +1 -0
- package/dist/sessions/todo.d.ts +8 -0
- package/dist/sessions/todo.js +72 -0
- package/dist/sessions/todo.js.map +1 -0
- package/dist/sessions/turn-context.d.ts +27 -0
- package/dist/sessions/turn-context.js +136 -0
- package/dist/sessions/turn-context.js.map +1 -0
- package/dist/sessions/turn.d.ts +178 -0
- package/dist/sessions/turn.js +1357 -0
- package/dist/sessions/turn.js.map +1 -0
- package/dist/sessions/window.d.ts +10 -0
- package/dist/sessions/window.js +151 -0
- package/dist/sessions/window.js.map +1 -0
- package/dist/settings.d.ts +57 -0
- package/dist/settings.js +481 -0
- package/dist/settings.js.map +1 -0
- package/dist/sidecar/client.d.ts +75 -0
- package/dist/sidecar/client.js +252 -0
- package/dist/sidecar/client.js.map +1 -0
- package/dist/sidecar/discover.d.ts +22 -0
- package/dist/sidecar/discover.js +146 -0
- package/dist/sidecar/discover.js.map +1 -0
- package/dist/sidecar/fake.d.ts +37 -0
- package/dist/sidecar/fake.js +79 -0
- package/dist/sidecar/fake.js.map +1 -0
- package/dist/spa.d.ts +42 -0
- package/dist/spa.js +145 -0
- package/dist/spa.js.map +1 -0
- package/dist/startup.d.ts +19 -0
- package/dist/startup.js +44 -0
- package/dist/startup.js.map +1 -0
- package/dist/test/harness.d.ts +41 -0
- package/dist/test/harness.js +123 -0
- package/dist/test/harness.js.map +1 -0
- package/dist/text/diff.d.ts +16 -0
- package/dist/text/diff.js +122 -0
- package/dist/text/diff.js.map +1 -0
- package/dist/text/markdown.d.ts +8 -0
- package/dist/text/markdown.js +185 -0
- package/dist/text/markdown.js.map +1 -0
- package/dist/tools/crons.d.ts +51 -0
- package/dist/tools/crons.js +317 -0
- package/dist/tools/crons.js.map +1 -0
- package/dist/tools/extensions.d.ts +92 -0
- package/dist/tools/extensions.js +1096 -0
- package/dist/tools/extensions.js.map +1 -0
- package/dist/tools/health.d.ts +21 -0
- package/dist/tools/health.js +334 -0
- package/dist/tools/health.js.map +1 -0
- package/dist/tools/hygiene.d.ts +29 -0
- package/dist/tools/hygiene.js +112 -0
- package/dist/tools/hygiene.js.map +1 -0
- package/dist/tools/insights.d.ts +3 -0
- package/dist/tools/insights.js +92 -0
- package/dist/tools/insights.js.map +1 -0
- package/dist/tools/kanban.d.ts +25 -0
- package/dist/tools/kanban.js +79 -0
- package/dist/tools/kanban.js.map +1 -0
- package/dist/tools/mcp-health.d.ts +28 -0
- package/dist/tools/mcp-health.js +207 -0
- package/dist/tools/mcp-health.js.map +1 -0
- package/dist/tools/mcp.d.ts +34 -0
- package/dist/tools/mcp.js +269 -0
- package/dist/tools/mcp.js.map +1 -0
- package/dist/tools/memory.d.ts +20 -0
- package/dist/tools/memory.js +216 -0
- package/dist/tools/memory.js.map +1 -0
- package/dist/tools/skills.d.ts +43 -0
- package/dist/tools/skills.js +193 -0
- package/dist/tools/skills.js.map +1 -0
- package/dist/tools/terminal.d.ts +96 -0
- package/dist/tools/terminal.js +324 -0
- package/dist/tools/terminal.js.map +1 -0
- package/dist/tools/updates.d.ts +151 -0
- package/dist/tools/updates.js +1151 -0
- package/dist/tools/updates.js.map +1 -0
- package/dist/util.d.ts +6 -0
- package/dist/util.js +40 -0
- package/dist/util.js.map +1 -0
- package/dist/workspace/fs.d.ts +61 -0
- package/dist/workspace/fs.js +555 -0
- package/dist/workspace/fs.js.map +1 -0
- package/dist/workspace/git.d.ts +204 -0
- package/dist/workspace/git.js +1236 -0
- package/dist/workspace/git.js.map +1 -0
- package/dist/workspace/media.d.ts +47 -0
- package/dist/workspace/media.js +448 -0
- package/dist/workspace/media.js.map +1 -0
- package/dist/workspace/paths.d.ts +6 -0
- package/dist/workspace/paths.js +41 -0
- package/dist/workspace/paths.js.map +1 -0
- package/dist/workspace/rollback.d.ts +29 -0
- package/dist/workspace/rollback.js +337 -0
- package/dist/workspace/rollback.js.map +1 -0
- package/dist/workspace/unzip.d.ts +9 -0
- package/dist/workspace/unzip.js +61 -0
- package/dist/workspace/unzip.js.map +1 -0
- package/dist/workspace/upload.d.ts +40 -0
- package/dist/workspace/upload.js +215 -0
- package/dist/workspace/upload.js.map +1 -0
- package/dist/workspace/workspaces.d.ts +84 -0
- package/dist/workspace/workspaces.js +663 -0
- package/dist/workspace/workspaces.js.map +1 -0
- package/dist/workspace/worktrees.d.ts +14 -0
- package/dist/workspace/worktrees.js +171 -0
- package/dist/workspace/worktrees.js.map +1 -0
- package/dist/workspace/zip.d.ts +16 -0
- package/dist/workspace/zip.js +205 -0
- package/dist/workspace/zip.js.map +1 -0
- package/package.json +54 -0
- package/sidecar/agent_dependency.json +11 -0
- package/sidecar/scripts/record-fixtures.py +72 -0
- package/sidecar/scripts/replay_sidecar.py +113 -0
- package/sidecar/scripts/test.sh +22 -0
- package/sidecar/talaria_sidecar/__init__.py +10 -0
- package/sidecar/talaria_sidecar/__main__.py +46 -0
- package/sidecar/talaria_sidecar/errors.py +41 -0
- package/sidecar/talaria_sidecar/home.py +103 -0
- package/sidecar/talaria_sidecar/methods/__init__.py +37 -0
- package/sidecar/talaria_sidecar/methods/aux.py +160 -0
- package/sidecar/talaria_sidecar/methods/chat.py +791 -0
- package/sidecar/talaria_sidecar/methods/commands.py +340 -0
- package/sidecar/talaria_sidecar/methods/config.py +131 -0
- package/sidecar/talaria_sidecar/methods/cron.py +558 -0
- package/sidecar/talaria_sidecar/methods/gateway.py +106 -0
- package/sidecar/talaria_sidecar/methods/goals.py +225 -0
- package/sidecar/talaria_sidecar/methods/kanban.py +723 -0
- package/sidecar/talaria_sidecar/methods/mcp.py +65 -0
- package/sidecar/talaria_sidecar/methods/process.py +155 -0
- package/sidecar/talaria_sidecar/methods/profiles.py +254 -0
- package/sidecar/talaria_sidecar/methods/providers.py +241 -0
- package/sidecar/talaria_sidecar/methods/runtime.py +68 -0
- package/sidecar/talaria_sidecar/methods/skills.py +262 -0
- package/sidecar/talaria_sidecar/methods/state_db.py +418 -0
- package/sidecar/talaria_sidecar/methods/stt.py +131 -0
- package/sidecar/talaria_sidecar/methods/text.py +85 -0
- package/sidecar/talaria_sidecar/methods/usage.py +59 -0
- package/sidecar/talaria_sidecar/methods/worktree.py +71 -0
- package/sidecar/talaria_sidecar/rpc.py +218 -0
- package/sidecar/talaria_sidecar/runtime.py +330 -0
- package/static/brand/apple-touch-icon.png +0 -0
- package/static/brand/brandmark.svg +12 -0
- package/static/brand/favicon-192.png +0 -0
- package/static/brand/favicon-32.png +0 -0
- package/static/brand/favicon-512.png +0 -0
- package/static/brand/favicon-512.svg +14 -0
- package/static/brand/favicon-dark.svg +14 -0
- package/static/brand/favicon-light.svg +14 -0
- package/static/brand/favicon.ico +0 -0
- package/static/brand/favicon.svg +14 -0
- package/static/dist/FILES.txt +515 -0
- package/static/dist/assets/AppShell-gs0grlbs.js +1 -0
- package/static/dist/assets/ChatPage-gi1xlz52.js +18 -0
- package/static/dist/assets/ChatPage-gmu5c7lf.css +1 -0
- package/static/dist/assets/HubRoute-qs9vzuh0.js +2 -0
- package/static/dist/assets/InterVariable-nonokl6i.woff2 +0 -0
- package/static/dist/assets/KaTeX_AMS-Regular-e1why8ff.woff2 +0 -0
- package/static/dist/assets/KaTeX_AMS-Regular-mec5w1mt.woff +0 -0
- package/static/dist/assets/KaTeX_AMS-Regular-mos1wgtv.ttf +0 -0
- package/static/dist/assets/KaTeX_Caligraphic-Bold-axibvb5b.ttf +0 -0
- package/static/dist/assets/KaTeX_Caligraphic-Bold-eccvbn5c.woff +0 -0
- package/static/dist/assets/KaTeX_Caligraphic-Bold-n63xiolk.woff2 +0 -0
- package/static/dist/assets/KaTeX_Caligraphic-Regular-c5dvswgu.ttf +0 -0
- package/static/dist/assets/KaTeX_Caligraphic-Regular-iz5gexw5.woff +0 -0
- package/static/dist/assets/KaTeX_Caligraphic-Regular-npwmqylf.woff2 +0 -0
- package/static/dist/assets/KaTeX_Fraktur-Bold-ftsn4fxp.ttf +0 -0
- package/static/dist/assets/KaTeX_Fraktur-Bold-gokmhdpe.woff +0 -0
- package/static/dist/assets/KaTeX_Fraktur-Bold-ikhebgtj.woff2 +0 -0
- package/static/dist/assets/KaTeX_Fraktur-Regular-hzce8q9o.ttf +0 -0
- package/static/dist/assets/KaTeX_Fraktur-Regular-i0egury6.woff2 +0 -0
- package/static/dist/assets/KaTeX_Fraktur-Regular-okwm110b.woff +0 -0
- package/static/dist/assets/KaTeX_Main-Bold-c5g2m5kh.ttf +0 -0
- package/static/dist/assets/KaTeX_Main-Bold-ktk38ybk.woff2 +0 -0
- package/static/dist/assets/KaTeX_Main-Bold-ureqgmzo.woff +0 -0
- package/static/dist/assets/KaTeX_Main-BoldItalic-bd0upj71.woff +0 -0
- package/static/dist/assets/KaTeX_Main-BoldItalic-oj033t4i.woff2 +0 -0
- package/static/dist/assets/KaTeX_Main-BoldItalic-opttanob.ttf +0 -0
- package/static/dist/assets/KaTeX_Main-Italic-2p4bq1jf.woff2 +0 -0
- package/static/dist/assets/KaTeX_Main-Italic-dj86j9xo.ttf +0 -0
- package/static/dist/assets/KaTeX_Main-Italic-esmxqs8d.woff +0 -0
- package/static/dist/assets/KaTeX_Main-Regular-c978jrkj.ttf +0 -0
- package/static/dist/assets/KaTeX_Main-Regular-hbkzldb8.woff2 +0 -0
- package/static/dist/assets/KaTeX_Main-Regular-n865mmt0.woff +0 -0
- package/static/dist/assets/KaTeX_Math-BoldItalic-cbkxiib1.woff +0 -0
- package/static/dist/assets/KaTeX_Math-BoldItalic-hcom2j4y.ttf +0 -0
- package/static/dist/assets/KaTeX_Math-BoldItalic-jdo1yxu8.woff2 +0 -0
- package/static/dist/assets/KaTeX_Math-Italic-b5lfnctb.ttf +0 -0
- package/static/dist/assets/KaTeX_Math-Italic-cz4b2ure.woff2 +0 -0
- package/static/dist/assets/KaTeX_Math-Italic-lo894bvj.woff +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Bold-h55uj19s.ttf +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Bold-m9bkcp3c.woff +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Bold-otxc8itm.woff2 +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Italic-bp85cocg.ttf +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Italic-g42k16nn.woff +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Italic-k4kksncm.woff2 +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Regular-evq9548m.ttf +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Regular-izeggh93.woff +0 -0
- package/static/dist/assets/KaTeX_SansSerif-Regular-ltw53ck4.woff2 +0 -0
- package/static/dist/assets/KaTeX_Script-Regular-k8v4ghws.ttf +0 -0
- package/static/dist/assets/KaTeX_Script-Regular-o2nd302f.woff +0 -0
- package/static/dist/assets/KaTeX_Script-Regular-oybd33cp.woff2 +0 -0
- package/static/dist/assets/KaTeX_Size1-Regular-cjccv44r.woff2 +0 -0
- package/static/dist/assets/KaTeX_Size1-Regular-k13yopgz.woff +0 -0
- package/static/dist/assets/KaTeX_Size1-Regular-naiuhmx7.ttf +0 -0
- package/static/dist/assets/KaTeX_Size2-Regular-cnnxwlt7.woff +0 -0
- package/static/dist/assets/KaTeX_Size2-Regular-hlh6jazj.ttf +0 -0
- package/static/dist/assets/KaTeX_Size2-Regular-onxq3bzc.woff2 +0 -0
- package/static/dist/assets/KaTeX_Size3-Regular-i00haf83.woff +0 -0
- package/static/dist/assets/KaTeX_Size3-Regular-nk2kx36d.ttf +0 -0
- package/static/dist/assets/KaTeX_Size4-Regular-effsfy3y.woff +0 -0
- package/static/dist/assets/KaTeX_Size4-Regular-myjqyche.ttf +0 -0
- package/static/dist/assets/KaTeX_Size4-Regular-nv9nppzf.woff2 +0 -0
- package/static/dist/assets/KaTeX_Typewriter-Regular-iqvr3vwu.woff2 +0 -0
- package/static/dist/assets/KaTeX_Typewriter-Regular-kzj4h457.woff +0 -0
- package/static/dist/assets/KaTeX_Typewriter-Regular-owzsy8p5.ttf +0 -0
- package/static/dist/assets/Markdown-bt9bqd6a.js +598 -0
- package/static/dist/assets/Markdown-lwviulmg.css +1 -0
- package/static/dist/assets/RightPanel-dn19xu42.js +1 -0
- package/static/dist/assets/Select-y7wtf85g.js +1 -0
- package/static/dist/assets/SessionListPanel-igwdj9xr.js +1 -0
- package/static/dist/assets/SettingsLayout-n6mu0ghg.js +1 -0
- package/static/dist/assets/States-oil2issf.js +1 -0
- package/static/dist/assets/Toaster-jtn59pjm.js +1 -0
- package/static/dist/assets/_app-k4jrkgfa.js +1 -0
- package/static/dist/assets/_app.ext._extensionId-mmf1mepm.js +1 -0
- package/static/dist/assets/_app.index-mb41nf00.js +1 -0
- package/static/dist/assets/_app.insights-mz5cep8m.js +1 -0
- package/static/dist/assets/_app.kanban-ocgw506i.js +1 -0
- package/static/dist/assets/_app.logs-lstmoju6.js +1 -0
- package/static/dist/assets/_app.memory-dishj9ra.js +1 -0
- package/static/dist/assets/_app.profiles-dynpvsio.js +1 -0
- package/static/dist/assets/_app.session._sessionId-kevi4qd2.js +1 -0
- package/static/dist/assets/_app.settings-c2czm9v4.js +1 -0
- package/static/dist/assets/_app.settings._section-exwflld7.js +1 -0
- package/static/dist/assets/_app.skills-j5jh2nug.js +1 -0
- package/static/dist/assets/_app.tasks-b99d98fo.js +2 -0
- package/static/dist/assets/_app.todos-ma8urvn3.js +1 -0
- package/static/dist/assets/_app.workspaces-l86cxeod.js +1 -0
- package/static/dist/assets/abap-ij37pki6.js +1 -0
- package/static/dist/assets/abnfDiagram-VCTEODGH-hvrr25lb.js +1 -0
- package/static/dist/assets/actionscript-3-dz7y3j1x.js +1 -0
- package/static/dist/assets/ada-k9zgv987.js +1 -0
- package/static/dist/assets/andromeeda-c2n0n86o.js +1 -0
- package/static/dist/assets/angular-html-nu6l31w3.js +1 -0
- package/static/dist/assets/angular-ts-fbx4f8mm.js +1 -0
- package/static/dist/assets/apache-binppq6z.js +1 -0
- package/static/dist/assets/apex-h8illjly.js +1 -0
- package/static/dist/assets/apl-bx2xr7dh.js +1 -0
- package/static/dist/assets/applescript-h0ok5sww.js +1 -0
- package/static/dist/assets/ara-dlpjioua.js +1 -0
- package/static/dist/assets/arc-7popfhbk.js +1 -0
- package/static/dist/assets/architecture-7GRP2DOG-mqft9w2p.js +1 -0
- package/static/dist/assets/architectureDiagram-5GKGNRK7-b3r0z8sq.js +36 -0
- package/static/dist/assets/array-f36850hm.js +1 -0
- package/static/dist/assets/asciidoc-lx0cuujr.js +1 -0
- package/static/dist/assets/asm-j5diz3sz.js +1 -0
- package/static/dist/assets/astro-g77i97cb.js +1 -0
- package/static/dist/assets/aurora-x-h2hngdsl.js +1 -0
- package/static/dist/assets/awk-fecghegf.js +1 -0
- package/static/dist/assets/ayu-dark-nvvuggz9.js +1 -0
- package/static/dist/assets/ayu-light-k5fxgplt.js +1 -0
- package/static/dist/assets/ayu-mirage-gltrvhcx.js +1 -0
- package/static/dist/assets/ballerina-hk9oga18.js +1 -0
- package/static/dist/assets/bat-ghs7lag5.js +1 -0
- package/static/dist/assets/beancount-pc6q2dmq.js +1 -0
- package/static/dist/assets/berry-l96jp8n4.js +1 -0
- package/static/dist/assets/bibtex-jxn7maz2.js +1 -0
- package/static/dist/assets/bicep-i1yv3ngd.js +1 -0
- package/static/dist/assets/bird2-k3aagqn0.js +1 -0
- package/static/dist/assets/blade-boo0u92y.js +1 -0
- package/static/dist/assets/blockDiagram-I7D4REHJ-hd3gw0cj.js +129 -0
- package/static/dist/assets/bsl-f8m1ja7w.js +1 -0
- package/static/dist/assets/c-cat0w3sc.js +1 -0
- package/static/dist/assets/c3-j6ile59o.js +1 -0
- package/static/dist/assets/c4Diagram-7LVT6UL2-jlmbjiji.js +38 -0
- package/static/dist/assets/cadence-e3x2pgsu.js +1 -0
- package/static/dist/assets/cairo-mblac9dt.js +1 -0
- package/static/dist/assets/catppuccin-frappe-dj7qsd4s.js +1 -0
- package/static/dist/assets/catppuccin-latte-oh2bx7qn.js +1 -0
- package/static/dist/assets/catppuccin-macchiato-m3xyazph.js +1 -0
- package/static/dist/assets/catppuccin-mocha-m3rjj89j.js +1 -0
- package/static/dist/assets/channel-ix8cxdld.js +1 -0
- package/static/dist/assets/chunk-2Q5K7J3B-k08c29qw.js +1 -0
- package/static/dist/assets/chunk-4HAMMTFA-oydbpsin.js +62 -0
- package/static/dist/assets/chunk-5VM5RSS4-br0zxsux.js +15 -0
- package/static/dist/assets/chunk-75Z2AOVW-j633otj1.js +2 -0
- package/static/dist/assets/chunk-DU6HZSFF-ods2l027.js +128 -0
- package/static/dist/assets/chunk-F27PBJKO-ln4n2cwt.js +1 -0
- package/static/dist/assets/chunk-FOHPRMQF-opuflp73.js +161 -0
- package/static/dist/assets/chunk-GMAD6QVW-fpz133eh.js +72 -0
- package/static/dist/assets/chunk-GVQU2GXP-abs9ixiy.js +1 -0
- package/static/dist/assets/chunk-IMKFNOWR-j9vukdy1.js +231 -0
- package/static/dist/assets/chunk-JWPE2WC7-mw03m5s9.js +1 -0
- package/static/dist/assets/chunk-L3NEJ4N5-cfyw87r3.js +1 -0
- package/static/dist/assets/chunk-OSK3NFVY-baja78wr.js +10 -0
- package/static/dist/assets/chunk-P2QGCYS3-g66xby8h.js +1 -0
- package/static/dist/assets/chunk-POPQ4Y6H-osqu864t.js +1 -0
- package/static/dist/assets/chunk-PWAF6VOD-egejasv1.js +1 -0
- package/static/dist/assets/chunk-SHT3W25Y-l014h8zz.js +168 -0
- package/static/dist/assets/chunk-SVP7TREG-n3z10bp3.js +88 -0
- package/static/dist/assets/chunk-TICWLB2K-bzozkjc0.js +206 -0
- package/static/dist/assets/chunk-XXDRQBXY-n40pf9vy.js +1 -0
- package/static/dist/assets/chunk-Y2CYZVJY-n9gs7k4d.js +1 -0
- package/static/dist/assets/clarity-bdn1d8fx.js +1 -0
- package/static/dist/assets/classDiagram-ZZMXUADV-c210y3il.js +1 -0
- package/static/dist/assets/classDiagram-v2-VYDZK3BY-c210y3il.js +1 -0
- package/static/dist/assets/clojure-n5b9o4lq.js +1 -0
- package/static/dist/assets/cmake-f68p68h5.js +1 -0
- package/static/dist/assets/cobol-go622aep.js +1 -0
- package/static/dist/assets/codeowners-lgfjmw2s.js +1 -0
- package/static/dist/assets/codeql-cojlysyb.js +1 -0
- package/static/dist/assets/coffee-jwo1xjhq.js +1 -0
- package/static/dist/assets/common-lisp-ko58h8pe.js +1 -0
- package/static/dist/assets/copied-cjsttec1.js +1 -0
- package/static/dist/assets/coq-gns70ukp.js +1 -0
- package/static/dist/assets/cose-bilkent-JH36ORCC-eclcy6ja.js +1 -0
- package/static/dist/assets/cpp-nre7j0kq.js +1 -0
- package/static/dist/assets/crystal-lviso2je.js +1 -0
- package/static/dist/assets/csharp-kkz9hcxp.js +1 -0
- package/static/dist/assets/css-ywz9j4hb.js +1 -0
- package/static/dist/assets/csv-ol0sxk26.js +1 -0
- package/static/dist/assets/cue-h5naoluy.js +1 -0
- package/static/dist/assets/cynefin-OW5HDTMX-elpt7h1j.js +1 -0
- package/static/dist/assets/cynefinDiagram-5FMLGOSQ-5mzl5pi2.js +62 -0
- package/static/dist/assets/cypher-j2an42no.js +1 -0
- package/static/dist/assets/cytoscape.esm-bqu53u12.js +321 -0
- package/static/dist/assets/d-crxkca3p.js +1 -0
- package/static/dist/assets/dagre-GXQ25YYZ-ihwlhmfl.js +4 -0
- package/static/dist/assets/dagre-lkoknbjn.js +1 -0
- package/static/dist/assets/dark-plus-kin19s9x.js +1 -0
- package/static/dist/assets/dart-nsg0xvqh.js +1 -0
- package/static/dist/assets/dax-f82777dv.js +1 -0
- package/static/dist/assets/defaultLocale-eeoev87l.js +1 -0
- package/static/dist/assets/desktop-nvg88bea.js +1 -0
- package/static/dist/assets/diagram-S7CK7UJ4-4z90agaz.js +30 -0
- package/static/dist/assets/diagram-UQ7AKVKN-eifw0lg7.js +41 -0
- package/static/dist/assets/diagram-VSXAHHWV-ksh3sjqv.js +3 -0
- package/static/dist/assets/diagram-VX7I27RA-ett72f71.js +24 -0
- package/static/dist/assets/diagram-Z3DM3KII-l8scp8nu.js +24 -0
- package/static/dist/assets/diff-c5xjoml2.js +1 -0
- package/static/dist/assets/dist-c4c2m3kv.js +1 -0
- package/static/dist/assets/docker-s0pf2u92.js +1 -0
- package/static/dist/assets/dotenv-d2gvqxc1.js +1 -0
- package/static/dist/assets/dracula-eicfho73.js +1 -0
- package/static/dist/assets/dracula-soft-doslejd2.js +1 -0
- package/static/dist/assets/dream-maker-mz8d3pqb.js +1 -0
- package/static/dist/assets/ebnfDiagram-PWID7BFC-f0pxcmit.js +1 -0
- package/static/dist/assets/edge-dvv35byi.js +1 -0
- package/static/dist/assets/elixir-i2f1ki1g.js +1 -0
- package/static/dist/assets/elm-cpepyjm4.js +1 -0
- package/static/dist/assets/emacs-lisp-lhl63kmy.js +1 -0
- package/static/dist/assets/endpoints-ipnv1hd4.js +64 -0
- package/static/dist/assets/erDiagram-RLTQ6QDP-f47m5xh0.js +99 -0
- package/static/dist/assets/erb-idlyfheg.js +1 -0
- package/static/dist/assets/erlang-kbk8e1kh.js +1 -0
- package/static/dist/assets/eventmodeling-NTZA5JFV-d9b5a0ia.js +1 -0
- package/static/dist/assets/everforest-dark-cv4maom7.js +1 -0
- package/static/dist/assets/everforest-light-njdw7fx6.js +1 -0
- package/static/dist/assets/fennel-mm8r79co.js +1 -0
- package/static/dist/assets/fish-em0xdaat.js +1 -0
- package/static/dist/assets/flowDiagram-HODETNUW-kfxxsyrk.js +1 -0
- package/static/dist/assets/fluent-kzq1mil2.js +1 -0
- package/static/dist/assets/fortran-fixed-form-lwddxd99.js +1 -0
- package/static/dist/assets/fortran-free-form-jao3bzvo.js +1 -0
- package/static/dist/assets/fsharp-ouam7w4k.js +1 -0
- package/static/dist/assets/ganttDiagram-EL5Y4UJY-bmktjdi0.js +292 -0
- package/static/dist/assets/gdresource-gawivel9.js +1 -0
- package/static/dist/assets/gdscript-kcamxf4c.js +1 -0
- package/static/dist/assets/gdshader-hx54new5.js +1 -0
- package/static/dist/assets/genie-i5n3m91v.js +1 -0
- package/static/dist/assets/gherkin-lxn181dy.js +1 -0
- package/static/dist/assets/git-commit-e6qgtuh5.js +1 -0
- package/static/dist/assets/git-rebase-d9lpfpbn.js +1 -0
- package/static/dist/assets/gitGraph-4MIJSDKK-j2ueg258.js +1 -0
- package/static/dist/assets/gitGraphDiagram-WWUBYQGX-ms6586v9.js +106 -0
- package/static/dist/assets/github-dark-default-m0qs6qki.js +1 -0
- package/static/dist/assets/github-dark-dimmed-g0vz4qee.js +1 -0
- package/static/dist/assets/github-dark-high-contrast-hugubo52.js +1 -0
- package/static/dist/assets/github-dark-ljlyim8s.js +1 -0
- package/static/dist/assets/github-light-default-fgfak5mv.js +1 -0
- package/static/dist/assets/github-light-high-contrast-hka6wb3r.js +1 -0
- package/static/dist/assets/github-light-jhyi45t4.js +1 -0
- package/static/dist/assets/gleam-ix1dym3g.js +1 -0
- package/static/dist/assets/glimmer-js-39i0urfb.js +1 -0
- package/static/dist/assets/glimmer-ts-gdtd6n73.js +1 -0
- package/static/dist/assets/glsl-o1djm5pp.js +1 -0
- package/static/dist/assets/gn-cbzhsgl9.js +1 -0
- package/static/dist/assets/gnuplot-dr8f9gvm.js +1 -0
- package/static/dist/assets/go-enhtrrw8.js +1 -0
- package/static/dist/assets/graphlib-mrng1xrk.js +1 -0
- package/static/dist/assets/graphql-kj6rz55t.js +1 -0
- package/static/dist/assets/groovy-jff59t9e.js +1 -0
- package/static/dist/assets/gruvbox-dark-hard-lgsj7y5r.js +1 -0
- package/static/dist/assets/gruvbox-dark-medium-ezt86wrc.js +1 -0
- package/static/dist/assets/gruvbox-dark-soft-1a3jfdlm.js +1 -0
- package/static/dist/assets/gruvbox-light-hard-d82lddjc.js +1 -0
- package/static/dist/assets/gruvbox-light-medium-d3ffitv3.js +1 -0
- package/static/dist/assets/gruvbox-light-soft-e5gf7i2q.js +1 -0
- package/static/dist/assets/hack-pe1qqr2i.js +1 -0
- package/static/dist/assets/haml-cknnbcqs.js +1 -0
- package/static/dist/assets/handlebars-hwq64orh.js +1 -0
- package/static/dist/assets/haskell-o7nor2z2.js +1 -0
- package/static/dist/assets/haxe-4rwdh42h.js +1 -0
- package/static/dist/assets/hcl-nnng763h.js +1 -0
- package/static/dist/assets/highlighted-body-KPVGNVTW-ev52d2si.js +1 -0
- package/static/dist/assets/hjson-kscwmuzk.js +1 -0
- package/static/dist/assets/hlsl-kopkvwox.js +1 -0
- package/static/dist/assets/horizon-bright-gn4aqinx.js +1 -0
- package/static/dist/assets/horizon-h5nzrwlb.js +1 -0
- package/static/dist/assets/houston-kifsbmbx.js +1 -0
- package/static/dist/assets/html-derivative-h2i2pyjc.js +1 -0
- package/static/dist/assets/html-ha05xtvt.js +1 -0
- package/static/dist/assets/http-cf94zu27.js +1 -0
- package/static/dist/assets/hurl-lslax568.js +1 -0
- package/static/dist/assets/hxml-g52gxet6.js +1 -0
- package/static/dist/assets/hy-jc9www1l.js +1 -0
- package/static/dist/assets/imba-n9x1ej2f.js +1 -0
- package/static/dist/assets/index-bz7g7rhx.css +2 -0
- package/static/dist/assets/index-hywfjw88.js +11 -0
- package/static/dist/assets/info-A6RAGUB7-j717vyt7.js +1 -0
- package/static/dist/assets/infoDiagram-27XIBGKW-dsbpib36.js +2 -0
- package/static/dist/assets/ini-hg6eosim.js +1 -0
- package/static/dist/assets/init-ljpdkjra.js +1 -0
- package/static/dist/assets/ishikawaDiagram-5VMMS53U-n0sz3i2d.js +70 -0
- package/static/dist/assets/java-ndjf2o89.js +1 -0
- package/static/dist/assets/javascript-coftlwy3.js +1 -0
- package/static/dist/assets/jinja-etei9wy7.js +1 -0
- package/static/dist/assets/jison-hyekgft1.js +1 -0
- package/static/dist/assets/journeyDiagram-3NMN7TZE-mcxz1mme.js +139 -0
- package/static/dist/assets/json-lok0yaho.js +1 -0
- package/static/dist/assets/json5-e4tr07tg.js +1 -0
- package/static/dist/assets/jsonc-jbmkhoep.js +1 -0
- package/static/dist/assets/jsonl-j35ke6at.js +1 -0
- package/static/dist/assets/jsonnet-iewuy86o.js +1 -0
- package/static/dist/assets/jssm-m1449zlc.js +1 -0
- package/static/dist/assets/jsx-b64w0nbx.js +1 -0
- package/static/dist/assets/jsx-runtime-eu92a5pu.js +1 -0
- package/static/dist/assets/julia-jxxzz2yn.js +1 -0
- package/static/dist/assets/just-mc29iw9t.js +1 -0
- package/static/dist/assets/kanagawa-dragon-i9mmmgud.js +1 -0
- package/static/dist/assets/kanagawa-lotus-ev5oro17.js +1 -0
- package/static/dist/assets/kanagawa-wave-i06560uw.js +1 -0
- package/static/dist/assets/kanban-definition-UXKFOSKX-n6hq2lyc.js +89 -0
- package/static/dist/assets/kdl-kgzv1x9e.js +1 -0
- package/static/dist/assets/kotlin-nmx05b3f.js +1 -0
- package/static/dist/assets/kusto-fawmdms4.js +1 -0
- package/static/dist/assets/laserwave-goebpayr.js +1 -0
- package/static/dist/assets/latex-pafa03ft.js +1 -0
- package/static/dist/assets/lazyRouteComponent-faquioun.js +1 -0
- package/static/dist/assets/lean-jom31nm3.js +1 -0
- package/static/dist/assets/less-mwvscr3d.js +1 -0
- package/static/dist/assets/light-plus-mws1g85f.js +1 -0
- package/static/dist/assets/line-h5xq20s4.js +1 -0
- package/static/dist/assets/linear-becwlnhk.js +1 -0
- package/static/dist/assets/link-ib4prsn5.js +1 -0
- package/static/dist/assets/liquid-hz5c2pov.js +1 -0
- package/static/dist/assets/llvm-j5wmr3g9.js +1 -0
- package/static/dist/assets/log-eur4gurm.js +1 -0
- package/static/dist/assets/login-mvjys1ol.js +1 -0
- package/static/dist/assets/logo-j3h8r0pu.js +1 -0
- package/static/dist/assets/lua-leyf8mlb.js +1 -0
- package/static/dist/assets/luau-im5d6q8k.js +1 -0
- package/static/dist/assets/make-npl27xqy.js +1 -0
- package/static/dist/assets/markdown-fibv6lrm.js +1 -0
- package/static/dist/assets/marko-cn1fzpdv.js +1 -0
- package/static/dist/assets/matchContext-f8oy3lo7.js +1 -0
- package/static/dist/assets/material-theme-darker-dhm8zmok.js +1 -0
- package/static/dist/assets/material-theme-gdimc61s.js +1 -0
- package/static/dist/assets/material-theme-lighter-c1fszbb2.js +1 -0
- package/static/dist/assets/material-theme-ocean-iakojpmy.js +1 -0
- package/static/dist/assets/material-theme-palenight-hgxmykmi.js +1 -0
- package/static/dist/assets/matlab-o6nvvbf2.js +1 -0
- package/static/dist/assets/mdc-huhy88df.js +1 -0
- package/static/dist/assets/mdx-mmgeh26h.js +1 -0
- package/static/dist/assets/mermaid-HWGCJPDP-gmnkgf1n.js +1 -0
- package/static/dist/assets/mermaid-f9ad87lb.js +1 -0
- package/static/dist/assets/mermaid-parser.core-n9cuu5ue.js +7 -0
- package/static/dist/assets/min-dark-e5sicuw2.js +1 -0
- package/static/dist/assets/min-light-gst87fvf.js +1 -0
- package/static/dist/assets/mindmap-definition-YA3MSWOX-gta3u7z4.js +96 -0
- package/static/dist/assets/mipsasm-etoqqos6.js +1 -0
- package/static/dist/assets/mojo-fyyk0b1z.js +1 -0
- package/static/dist/assets/monokai-jl389a9o.js +1 -0
- package/static/dist/assets/moonbit-je86hbgx.js +1 -0
- package/static/dist/assets/move-g7w7k042.js +1 -0
- package/static/dist/assets/narrat-d1cszt6i.js +1 -0
- package/static/dist/assets/nextflow-fpd3eqgm.js +1 -0
- package/static/dist/assets/nextflow-groovy-nc95p6pm.js +1 -0
- package/static/dist/assets/nginx-e7lvhsmn.js +1 -0
- package/static/dist/assets/night-owl-light-b2j1bc8t.js +1 -0
- package/static/dist/assets/night-owl-nm3cgqfv.js +1 -0
- package/static/dist/assets/nim-dun5d8mk.js +1 -0
- package/static/dist/assets/nix-sxazvl0w.js +1 -0
- package/static/dist/assets/nord-jiiendyo.js +1 -0
- package/static/dist/assets/not-found-ccnnac39.js +1 -0
- package/static/dist/assets/nushell-nbi9xmdg.js +1 -0
- package/static/dist/assets/objective-c-oshe4ycx.js +1 -0
- package/static/dist/assets/objective-cpp-go29ofq1.js +1 -0
- package/static/dist/assets/ocaml-56kivtnr.js +1 -0
- package/static/dist/assets/odin-g772bhi5.js +1 -0
- package/static/dist/assets/onboarding-l6quy6gz.js +1 -0
- package/static/dist/assets/one-dark-pro-ext74l87.js +1 -0
- package/static/dist/assets/one-light-o5mlsn8i.js +1 -0
- package/static/dist/assets/openscad-e9e9mfyg.js +1 -0
- package/static/dist/assets/ordinal-d88pfdla.js +1 -0
- package/static/dist/assets/packet-AYTQ26CC-bpzuq5n6.js +1 -0
- package/static/dist/assets/pascal-dmg2rs6d.js +1 -0
- package/static/dist/assets/passkeys-ktie3sr0.js +1 -0
- package/static/dist/assets/path-b509aej0.js +1 -0
- package/static/dist/assets/pegDiagram-XKGWAZYB-juye13e5.js +1 -0
- package/static/dist/assets/perl-bj3oqtet.js +1 -0
- package/static/dist/assets/php-buzp12r0.js +1 -0
- package/static/dist/assets/pie-WAS4IAKB-odhb8buq.js +1 -0
- package/static/dist/assets/pieDiagram-E7YTZNPT-mgb14ksh.js +39 -0
- package/static/dist/assets/pkl-co2grztk.js +1 -0
- package/static/dist/assets/plastic-mm7c7uq7.js +1 -0
- package/static/dist/assets/plsql-l0i9f33n.js +1 -0
- package/static/dist/assets/po-f3ga9osn.js +1 -0
- package/static/dist/assets/poimandres-mnwq5v4d.js +1 -0
- package/static/dist/assets/polar-ldicpe6g.js +1 -0
- package/static/dist/assets/postcss-fgpvnt75.js +1 -0
- package/static/dist/assets/powerquery-mflxo46x.js +1 -0
- package/static/dist/assets/powershell-oado4mxi.js +1 -0
- package/static/dist/assets/prepaint-f14kbd49.js +21 -0
- package/static/dist/assets/prisma-go1e7wq8.js +1 -0
- package/static/dist/assets/prolog-cbjal8aj.js +1 -0
- package/static/dist/assets/proto-lrhov7xc.js +1 -0
- package/static/dist/assets/pug-mjad7he9.js +1 -0
- package/static/dist/assets/puppet-h22szrmn.js +1 -0
- package/static/dist/assets/purescript-dwpj7hdb.js +1 -0
- package/static/dist/assets/python-b767fgue.js +1 -0
- package/static/dist/assets/qml-d1gdp10s.js +1 -0
- package/static/dist/assets/qmldir-lsawched.js +1 -0
- package/static/dist/assets/qss-lyvmg4f4.js +1 -0
- package/static/dist/assets/quadrantDiagram-AXDQQJYC-cg36naog.js +7 -0
- package/static/dist/assets/r-o3r9c7ao.js +1 -0
- package/static/dist/assets/racket-nbfqjw5h.js +1 -0
- package/static/dist/assets/radar-RG4KPBEZ-lgzfpnef.js +1 -0
- package/static/dist/assets/railroad-74A4TZTK-gmglc3ua.js +1 -0
- package/static/dist/assets/railroad-abnf-HS5TGJTU-5mjl5wpv.js +1 -0
- package/static/dist/assets/railroad-ebnf-LZEXJU2U-bfram8v8.js +1 -0
- package/static/dist/assets/railroad-peg-WCYAUIDC-nwfczn88.js +1 -0
- package/static/dist/assets/railroadDiagram-O6MQD6OU-cmxwjt73.js +1 -0
- package/static/dist/assets/raku-hcy6uwm6.js +1 -0
- package/static/dist/assets/razor-ilc585yr.js +1 -0
- package/static/dist/assets/red-if4jt303.js +1 -0
- package/static/dist/assets/refresh-cw-mf192q3f.js +1 -0
- package/static/dist/assets/reg-ivi9d1my.js +1 -0
- package/static/dist/assets/regexp-mpjtcvwm.js +1 -0
- package/static/dist/assets/rel-gqpkg3ta.js +1 -0
- package/static/dist/assets/requirementDiagram-BXWQKSXE-ir0s2mek.js +84 -0
- package/static/dist/assets/riscv-j1f2yjp2.js +1 -0
- package/static/dist/assets/rolldown-runtime-b9miacsj.js +1 -0
- package/static/dist/assets/ron-bjqasg78.js +1 -0
- package/static/dist/assets/root-mbklpuv4.js +1 -0
- package/static/dist/assets/rose-pine-dawn-nlpzqzob.js +1 -0
- package/static/dist/assets/rose-pine-grpwpg67.js +1 -0
- package/static/dist/assets/rose-pine-moon-b9yyevxr.js +1 -0
- package/static/dist/assets/rosmsg-hv3wcot6.js +1 -0
- package/static/dist/assets/rough.esm-on4k4je3.js +1 -0
- package/static/dist/assets/rst-jrkwjdyi.js +1 -0
- package/static/dist/assets/ruby-n4tjcbpz.js +1 -0
- package/static/dist/assets/rust-jqduclx1.js +1 -0
- package/static/dist/assets/sankeyDiagram-P5KCCOFB-jo7jcdq0.js +40 -0
- package/static/dist/assets/sas-hjo6y93k.js +1 -0
- package/static/dist/assets/sass-m1yncbwu.js +1 -0
- package/static/dist/assets/saved-g777hp1t.js +1 -0
- package/static/dist/assets/scala-l9ahg4e9.js +1 -0
- package/static/dist/assets/scheme-mlodf39l.js +1 -0
- package/static/dist/assets/scss-ncidjv48.js +1 -0
- package/static/dist/assets/sdbl-bwg2t5pt.js +1 -0
- package/static/dist/assets/search-i2kfogyx.js +1 -0
- package/static/dist/assets/sequenceDiagram-WJ2MYXX4-n0pf6xk5.js +162 -0
- package/static/dist/assets/settings_section_extensions_title-hgvh507l.js +1 -0
- package/static/dist/assets/shaderlab-be89ch6g.js +1 -0
- package/static/dist/assets/share._token-il3y6js2.js +2 -0
- package/static/dist/assets/shellscript-m8whjpqd.js +1 -0
- package/static/dist/assets/shellsession-i5bj6syz.js +1 -0
- package/static/dist/assets/sizeCapture-INFHLROL-g612l48j.js +1 -0
- package/static/dist/assets/slack-dark-ny9l0r7b.js +1 -0
- package/static/dist/assets/slack-ochin-g98102hs.js +1 -0
- package/static/dist/assets/sliders-horizontal-kd99ffvl.js +1 -0
- package/static/dist/assets/smalltalk-g9lpwisn.js +1 -0
- package/static/dist/assets/snazzy-light-dlu9q2m5.js +1 -0
- package/static/dist/assets/solarized-dark-mx1nd4sm.js +1 -0
- package/static/dist/assets/solarized-light-mqzd33fz.js +1 -0
- package/static/dist/assets/solidity-ih313ji4.js +1 -0
- package/static/dist/assets/soy-hhh36ysq.js +1 -0
- package/static/dist/assets/sparql-pewjbauq.js +1 -0
- package/static/dist/assets/splunk-d8q89juf.js +1 -0
- package/static/dist/assets/sql-j21bzcl6.js +1 -0
- package/static/dist/assets/src-hjyib4mu.js +1 -0
- package/static/dist/assets/ssh-config-fzxlymn8.js +1 -0
- package/static/dist/assets/stata-bbu2onh1.js +1 -0
- package/static/dist/assets/stateDiagram-D77RDMKH-olbrwyv9.js +1 -0
- package/static/dist/assets/stateDiagram-v2-MP3YSRHH-dnzlmdpu.js +1 -0
- package/static/dist/assets/stylus-hifjg0ye.js +1 -0
- package/static/dist/assets/surrealql-l5vczuco.js +1 -0
- package/static/dist/assets/svelte-idn422g6.js +1 -0
- package/static/dist/assets/swift-n11rc3v3.js +1 -0
- package/static/dist/assets/swimlanes-42K2YHIH-od14zrw6.js +1 -0
- package/static/dist/assets/swimlanesDiagram-VR7AAH4N-ck0eqqdp.js +8 -0
- package/static/dist/assets/synthwave-84-clkt7319.js +1 -0
- package/static/dist/assets/system-verilog-l8k1po2l.js +1 -0
- package/static/dist/assets/systemd-d1zoxedb.js +1 -0
- package/static/dist/assets/talonscript-j9gt5qb1.js +1 -0
- package/static/dist/assets/tasl-meer3lyk.js +1 -0
- package/static/dist/assets/tcl-jdc54rsg.js +1 -0
- package/static/dist/assets/templ-e22qou3c.js +1 -0
- package/static/dist/assets/terraform-oav3wzsy.js +1 -0
- package/static/dist/assets/tex-deqpc5ee.js +1 -0
- package/static/dist/assets/timeline-definition-24CTP7MA-l0qokmnb.js +120 -0
- package/static/dist/assets/todoStore-la6uyqzj.js +1 -0
- package/static/dist/assets/tokyo-night-cnyqlmc2.js +1 -0
- package/static/dist/assets/toml-jj1ee1k1.js +1 -0
- package/static/dist/assets/trash-bxz1k9cw.js +1 -0
- package/static/dist/assets/treeView-Q6P3EWNA-hma3ip8m.js +1 -0
- package/static/dist/assets/treemap-WGGIJYW6-bghjng5m.js +1 -0
- package/static/dist/assets/ts-tags-ctnibc27.js +1 -0
- package/static/dist/assets/tsv-cxbgj4wh.js +1 -0
- package/static/dist/assets/tsx-i163n32g.js +1 -0
- package/static/dist/assets/turtle-g1kfgpwv.js +1 -0
- package/static/dist/assets/twig-x0fi7wm8.js +1 -0
- package/static/dist/assets/typescript-g18c34xz.js +1 -0
- package/static/dist/assets/typespec-hokgy7ic.js +1 -0
- package/static/dist/assets/typst-l6lt2vta.js +1 -0
- package/static/dist/assets/untitled-nfaw0q7m.js +1 -0
- package/static/dist/assets/useForm-k7fj2zsr.js +1 -0
- package/static/dist/assets/useLocale-evhacmv2.js +1 -0
- package/static/dist/assets/useParams-gpbjxj8s.js +1 -0
- package/static/dist/assets/useSearch-bhdptos7.js +1 -0
- package/static/dist/assets/useSelector-f2aak1ol.js +1 -0
- package/static/dist/assets/v-lwnsi8rl.js +1 -0
- package/static/dist/assets/vala-db1h2kp7.js +1 -0
- package/static/dist/assets/vb-nrezymby.js +1 -0
- package/static/dist/assets/vennDiagram-4TSXK5OY-bo97zf3z.js +34 -0
- package/static/dist/assets/verilog-jworpiw4.js +1 -0
- package/static/dist/assets/vesper-o1vwtlg2.js +1 -0
- package/static/dist/assets/vhdl-gnn4vfnm.js +1 -0
- package/static/dist/assets/viml-ogfqutxv.js +1 -0
- package/static/dist/assets/vitesse-black-b5y62t71.js +1 -0
- package/static/dist/assets/vitesse-dark-fj1ju380.js +1 -0
- package/static/dist/assets/vitesse-light-bjycd3ha.js +1 -0
- package/static/dist/assets/vue-html-nskj3du0.js +1 -0
- package/static/dist/assets/vue-mwu5l1bb.js +1 -0
- package/static/dist/assets/vue-vine-cqe77smq.js +1 -0
- package/static/dist/assets/vyper-jsmo764l.js +1 -0
- package/static/dist/assets/wardley-WFR3VGLG-pbjl6jav.js +1 -0
- package/static/dist/assets/wardleyDiagram-VM6X3IG4-bmy9i09l.js +78 -0
- package/static/dist/assets/wasm-g1zrybde.js +1 -0
- package/static/dist/assets/wasm-gezzbmz0.js +1 -0
- package/static/dist/assets/wenyan-lgcd7t1n.js +1 -0
- package/static/dist/assets/wgsl-gotoh48n.js +1 -0
- package/static/dist/assets/wikitext-j1379ez7.js +1 -0
- package/static/dist/assets/wit-neu67rwu.js +1 -0
- package/static/dist/assets/wolfram-mbb1p6oi.js +1 -0
- package/static/dist/assets/xml-gau7gvrv.js +1 -0
- package/static/dist/assets/xsl-ew09zq8b.js +1 -0
- package/static/dist/assets/xychartDiagram-S5SC5T6Z-eercu0mc.js +7 -0
- package/static/dist/assets/yaml-ofnrxtvf.js +1 -0
- package/static/dist/assets/zenscript-ge1h0r83.js +1 -0
- package/static/dist/assets/zig-ik06evde.js +1 -0
- package/static/dist/extension-sdk.js +1 -0
- package/static/dist/index.html +1 -0
- package/static/dist/manifest.webmanifest +29 -0
- package/static/dist/sw.js +944 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
/** Browser extension registry: manifest scan, user overrides, sidecar consent, gallery install (Python `api/extensions.py`, `api/extension_manifests.py`). */
|
|
2
|
+
import { readCapped } from '../http/capped.js';
|
|
3
|
+
import { FileExistsError, makeAnchoredDir, openAnchoredCreateFd, openAnchoredFd, openAnchoredWriteFd, rmdirAnchored, unlinkAnchored, withAnchoredDir } from '../workspace/fs.js';
|
|
4
|
+
import { resolvePathLikePython } from '../workspace/paths.js';
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
6
|
+
import { closeSync, existsSync, fstatSync, lstatSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
|
|
7
|
+
import { dirname, join, relative, resolve, sep } from 'node:path';
|
|
8
|
+
import { atomicWriteText } from '../fs/atomic.js';
|
|
9
|
+
import { readZip } from '../workspace/unzip.js';
|
|
10
|
+
import { isDict } from '../config/agent-config.js';
|
|
11
|
+
import { str } from '../util.js';
|
|
12
|
+
export class ExtensionError extends Error {
|
|
13
|
+
status;
|
|
14
|
+
constructor(message, status = 400) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.status = status;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const EXTENSION_ROUTE_PREFIX = '/extensions/';
|
|
20
|
+
export const EXTENSION_PANEL_SANDBOX_CSP = "sandbox allow-scripts allow-forms allow-popups allow-downloads allow-modals; frame-ancestors 'self'";
|
|
21
|
+
const ID_RE = /^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/;
|
|
22
|
+
const SETTINGS_KEY_RE = /^[A-Za-z][A-Za-z0-9._-]{0,63}$/;
|
|
23
|
+
const SETTING_TYPES = new Set(['boolean', 'string', 'number', 'integer', 'enum']);
|
|
24
|
+
const MAX_STATE_ENTRIES = 512;
|
|
25
|
+
const MAX_URL_LIST = 32;
|
|
26
|
+
const MAX_MANIFEST_BYTES = 64 * 1024;
|
|
27
|
+
const MAX_STATE_BYTES = 32 * 1024;
|
|
28
|
+
const MAX_ZIP_BYTES = 32 * 1024 * 1024;
|
|
29
|
+
const MAX_INSTALL_MANIFEST_BYTES = 128 * 1024;
|
|
30
|
+
const REGISTRY_URL = 'https://hermes-webui.github.io/hermes-webui-extensions/registry.json';
|
|
31
|
+
const ALLOWED_DOWNLOAD_HOSTS = new Set(['hermes-webui.github.io']);
|
|
32
|
+
const REGISTRY_TTL_MS = 300_000;
|
|
33
|
+
const LOOPBACK_HOSTS = new Set(['127.0.0.1', 'localhost', '::1']);
|
|
34
|
+
const ALLOWED_ASSET_PREFIXES = ['/extensions/', '/static/'];
|
|
35
|
+
const ALLOWED_DOTFILES = new Set(['.gitkeep', '.gitignore', '.gitattributes', '.env.example']);
|
|
36
|
+
export const EXTENSION_MIME = { css: 'text/css', js: 'application/javascript', html: 'text/html', svg: 'image/svg+xml', png: 'image/png', jpg: 'image/jpeg', jpeg: 'image/jpeg', ico: 'image/x-icon', gif: 'image/gif', webp: 'image/webp', woff: 'font/woff', woff2: 'font/woff2', ttf: 'font/ttf', otf: 'font/otf', wasm: 'application/wasm' };
|
|
37
|
+
const TEXT_MIME = new Set(['text/css', 'application/javascript', 'text/html', 'image/svg+xml', 'text/plain']);
|
|
38
|
+
export const validId = (v) => typeof v === 'string' && ID_RE.test(v.trim());
|
|
39
|
+
const warn = (d, code, source) => { if (d && !d.warnings.some((w) => w.code === code && w.source === source))
|
|
40
|
+
d.warnings.push({ code, source }); };
|
|
41
|
+
export function fullyUnquote(path) {
|
|
42
|
+
let prev = path;
|
|
43
|
+
for (let i = 0; i < 10; i += 1) {
|
|
44
|
+
let cur;
|
|
45
|
+
try {
|
|
46
|
+
cur = decodeURIComponent(prev);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return prev;
|
|
50
|
+
}
|
|
51
|
+
if (cur === prev)
|
|
52
|
+
return cur;
|
|
53
|
+
prev = cur;
|
|
54
|
+
}
|
|
55
|
+
return prev;
|
|
56
|
+
}
|
|
57
|
+
export function isSafeRelativePath(rel) {
|
|
58
|
+
if (!rel || rel.includes('\0') || rel.includes('\\'))
|
|
59
|
+
return false;
|
|
60
|
+
return rel.split('/').every((s) => s && s !== '.' && s !== '..' && !s.startsWith('.'));
|
|
61
|
+
}
|
|
62
|
+
function isSafeArchiveMember(rel) {
|
|
63
|
+
if (!rel || rel.includes('\0') || rel.includes('\\'))
|
|
64
|
+
return false;
|
|
65
|
+
const parts = rel.split('/');
|
|
66
|
+
const leaf = parts[parts.length - 1] ?? '';
|
|
67
|
+
if (!parts.slice(0, -1).every((s) => s && s !== '.' && s !== '..' && !s.startsWith('.')))
|
|
68
|
+
return false;
|
|
69
|
+
if (!leaf || leaf === '.' || leaf === '..')
|
|
70
|
+
return false;
|
|
71
|
+
return !leaf.startsWith('.') || ALLOWED_DOTFILES.has(leaf);
|
|
72
|
+
}
|
|
73
|
+
/** Python `_is_safe_asset_url`: `urlsplit` semantics — the raw path (no dot-segment resolution) must start with an allowed prefix. */
|
|
74
|
+
function isSafeAssetUrl(value) {
|
|
75
|
+
if (!value || /[\0\r\n"'<>\\]/.test(value))
|
|
76
|
+
return false;
|
|
77
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(value) || value.startsWith('//') || value.includes('#'))
|
|
78
|
+
return false;
|
|
79
|
+
const path = value.split('?')[0] ?? '';
|
|
80
|
+
const decoded = fullyUnquote(path);
|
|
81
|
+
for (const prefix of ALLOWED_ASSET_PREFIXES)
|
|
82
|
+
if (decoded.startsWith(prefix))
|
|
83
|
+
return isSafeRelativePath(decoded.slice(prefix.length));
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Python `_normalize_loopback_sidecar_origin` (`urlsplit`, not WHATWG): scheme + literal loopback host + optional
|
|
88
|
+
* numeric port, nothing else — no path (not even `/`), no query, no fragment, no userinfo, no host aliases.
|
|
89
|
+
*/
|
|
90
|
+
export function normalizeLoopbackOrigin(value) {
|
|
91
|
+
if (typeof value !== 'string')
|
|
92
|
+
return null;
|
|
93
|
+
const origin = value.trim();
|
|
94
|
+
if (!origin || /[\0\r\n"'<>\\]/.test(origin))
|
|
95
|
+
return null;
|
|
96
|
+
const m = /^(https?):\/\/([^/?#]*)$/i.exec(origin);
|
|
97
|
+
if (!m)
|
|
98
|
+
return null;
|
|
99
|
+
const scheme = (m[1] ?? '').toLowerCase();
|
|
100
|
+
const netloc = m[2] ?? '';
|
|
101
|
+
if (!netloc || netloc.includes('@'))
|
|
102
|
+
return null;
|
|
103
|
+
const hostPort = /^(\[[^\]]*\]|[^:]*)(?::(.*))?$/.exec(netloc);
|
|
104
|
+
if (!hostPort)
|
|
105
|
+
return null;
|
|
106
|
+
const host = (hostPort[1] ?? '').replace(/^\[|\]$/g, '').toLowerCase();
|
|
107
|
+
if (!LOOPBACK_HOSTS.has(host))
|
|
108
|
+
return null;
|
|
109
|
+
const portRaw = hostPort[2];
|
|
110
|
+
let port = null;
|
|
111
|
+
if (portRaw !== undefined && portRaw !== '') {
|
|
112
|
+
if (!/^\d+$/.test(portRaw))
|
|
113
|
+
return null;
|
|
114
|
+
const n = Number.parseInt(portRaw, 10);
|
|
115
|
+
if (n < 0 || n > 65535)
|
|
116
|
+
return null;
|
|
117
|
+
port = String(n);
|
|
118
|
+
}
|
|
119
|
+
const display = host.includes(':') ? `[${host}]` : host;
|
|
120
|
+
return `${scheme}://${display}${port !== null ? `:${port}` : ''}`;
|
|
121
|
+
}
|
|
122
|
+
function normalizeHealthPath(value) {
|
|
123
|
+
if (typeof value !== 'string')
|
|
124
|
+
return null;
|
|
125
|
+
const path = value.trim();
|
|
126
|
+
if (!path.startsWith('/') || path.startsWith('//') || /[\0\r\n"'<>\\?#\s]/.test(path))
|
|
127
|
+
return null;
|
|
128
|
+
const decoded = fullyUnquote(path);
|
|
129
|
+
if (/[\0\r\n"'<>\\?#\s]/.test(decoded) || !decoded.startsWith('/') || decoded.startsWith('//'))
|
|
130
|
+
return null;
|
|
131
|
+
const segments = decoded.split('/').slice(1);
|
|
132
|
+
return segments.length && segments.every((s) => s && s !== '.' && s !== '..') ? decoded : null;
|
|
133
|
+
}
|
|
134
|
+
export function normalizeProxyPath(value) {
|
|
135
|
+
if (value === null || value === undefined || value === '')
|
|
136
|
+
return '/';
|
|
137
|
+
const raw = str(value);
|
|
138
|
+
if (raw.startsWith('/'))
|
|
139
|
+
return null;
|
|
140
|
+
const candidate = `/${raw}`;
|
|
141
|
+
const decoded = fullyUnquote(candidate);
|
|
142
|
+
if (/[?#\s]/.test(decoded) || !decoded.startsWith('/') || decoded.startsWith('//'))
|
|
143
|
+
return null;
|
|
144
|
+
const segments = decoded.split('/').slice(1);
|
|
145
|
+
return segments.length && segments.every((s) => s && s !== '.' && s !== '..') ? candidate : null;
|
|
146
|
+
}
|
|
147
|
+
const text = (v, max = 160) => (typeof v === 'string' ? v.replaceAll(/[\x00-\x1f\x7f]/g, '').trim().slice(0, max) : '');
|
|
148
|
+
const entryText = (e, k) => (typeof e[k] === 'string' ? e[k].trim() : '');
|
|
149
|
+
const storageOwned = (e) => isDict(e.permissions) && isDict(e.permissions.storage) && e.permissions.storage.owned === true;
|
|
150
|
+
function settingsSchema(entry) {
|
|
151
|
+
if (!storageOwned(entry))
|
|
152
|
+
return [];
|
|
153
|
+
const raw = Array.isArray(entry.settings_schema) ? entry.settings_schema : [];
|
|
154
|
+
const out = [];
|
|
155
|
+
const seen = new Set();
|
|
156
|
+
for (const field of raw) {
|
|
157
|
+
if (!isDict(field) || field.sensitive === true || typeof field.key !== 'string' || typeof field.type !== 'string')
|
|
158
|
+
continue;
|
|
159
|
+
const key = field.key.trim();
|
|
160
|
+
const type = field.type.trim().toLowerCase();
|
|
161
|
+
if (!SETTINGS_KEY_RE.test(key) || !SETTING_TYPES.has(type) || seen.has(key))
|
|
162
|
+
continue;
|
|
163
|
+
let options = null;
|
|
164
|
+
if (type === 'enum') {
|
|
165
|
+
if (!Array.isArray(field.options) || !field.options.length)
|
|
166
|
+
continue;
|
|
167
|
+
options = [];
|
|
168
|
+
let ok = true;
|
|
169
|
+
for (const o of field.options) {
|
|
170
|
+
let value;
|
|
171
|
+
let label;
|
|
172
|
+
if (typeof o === 'string') {
|
|
173
|
+
value = o.trim();
|
|
174
|
+
label = value;
|
|
175
|
+
}
|
|
176
|
+
else if (isDict(o) && typeof o.value === 'string') {
|
|
177
|
+
value = o.value.trim();
|
|
178
|
+
label = text(o.label) || value;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
ok = false;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
if (!value || options.some((x) => x.value === value)) {
|
|
185
|
+
ok = false;
|
|
186
|
+
break;
|
|
187
|
+
}
|
|
188
|
+
options.push({ value, label });
|
|
189
|
+
}
|
|
190
|
+
if (!ok)
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
const hasDefault = 'default' in field;
|
|
194
|
+
const d = field.default;
|
|
195
|
+
let def;
|
|
196
|
+
if (type === 'boolean') {
|
|
197
|
+
if (hasDefault && typeof d !== 'boolean')
|
|
198
|
+
continue;
|
|
199
|
+
def = hasDefault ? d : false;
|
|
200
|
+
}
|
|
201
|
+
else if (type === 'string') {
|
|
202
|
+
if (hasDefault && typeof d !== 'string')
|
|
203
|
+
continue;
|
|
204
|
+
def = hasDefault ? d : '';
|
|
205
|
+
}
|
|
206
|
+
else if (type === 'number') {
|
|
207
|
+
if (hasDefault && !(typeof d === 'number' && Number.isFinite(d)))
|
|
208
|
+
continue;
|
|
209
|
+
def = hasDefault ? d : 0;
|
|
210
|
+
}
|
|
211
|
+
else if (type === 'integer') {
|
|
212
|
+
if (hasDefault && !Number.isInteger(d))
|
|
213
|
+
continue;
|
|
214
|
+
def = hasDefault ? d : 0;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
const values = (options ?? []).map((o) => o.value);
|
|
218
|
+
if (hasDefault && !(typeof d === 'string' && values.includes(d)))
|
|
219
|
+
continue;
|
|
220
|
+
def = hasDefault ? d : values[0];
|
|
221
|
+
}
|
|
222
|
+
seen.add(key);
|
|
223
|
+
const row = { key, type, label: text(field.label) || key, description: text(field.description, 300), default: def };
|
|
224
|
+
if (options)
|
|
225
|
+
row.options = options;
|
|
226
|
+
out.push(row);
|
|
227
|
+
}
|
|
228
|
+
return out;
|
|
229
|
+
}
|
|
230
|
+
function manifestEntries(manifest) {
|
|
231
|
+
const list = isDict(manifest) ? manifest.extensions : Array.isArray(manifest) ? manifest : [];
|
|
232
|
+
return Array.isArray(list) ? list.filter(isDict) : [];
|
|
233
|
+
}
|
|
234
|
+
function sidecarFromEntry(entry, d) {
|
|
235
|
+
const raw = entry.sidecar;
|
|
236
|
+
if (raw === null || raw === undefined)
|
|
237
|
+
return null;
|
|
238
|
+
const src = 'manifest:sidecars';
|
|
239
|
+
if (!isDict(raw)) {
|
|
240
|
+
warn(d, 'sidecar_invalid', src);
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
if (raw.type !== 'loopback') {
|
|
244
|
+
warn(d, 'sidecar_type_unsupported', src);
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
const origin = normalizeLoopbackOrigin(raw.origin);
|
|
248
|
+
if (!origin) {
|
|
249
|
+
warn(d, 'sidecar_origin_rejected', src);
|
|
250
|
+
return null;
|
|
251
|
+
}
|
|
252
|
+
let healthPath = '/health';
|
|
253
|
+
if ('health_path' in raw) {
|
|
254
|
+
const hp = normalizeHealthPath(raw.health_path);
|
|
255
|
+
if (!hp) {
|
|
256
|
+
warn(d, 'sidecar_health_path_rejected', src);
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
healthPath = hp;
|
|
260
|
+
}
|
|
261
|
+
let proxyAuth = 'legacy';
|
|
262
|
+
if (raw.proxy_auth !== null && raw.proxy_auth !== undefined) {
|
|
263
|
+
if (raw.proxy_auth !== 'legacy' && raw.proxy_auth !== 'token-v1') {
|
|
264
|
+
warn(d, 'sidecar_proxy_auth_unsupported', src);
|
|
265
|
+
return null;
|
|
266
|
+
}
|
|
267
|
+
proxyAuth = raw.proxy_auth;
|
|
268
|
+
}
|
|
269
|
+
return { id: entryText(entry, 'id'), name: entryText(entry, 'name'), type: 'loopback', origin, health_path: healthPath, health_url: `${origin}${healthPath}`, proxy_auth: proxyAuth };
|
|
270
|
+
}
|
|
271
|
+
export class ExtensionService {
|
|
272
|
+
deps;
|
|
273
|
+
registryCache = null;
|
|
274
|
+
registryInflight = null;
|
|
275
|
+
/** Read/validate/write of the state file runs one transaction at a time: `setConsent` awaits the sidecar probe mid-transaction. */
|
|
276
|
+
stateLock = Promise.resolve();
|
|
277
|
+
constructor(deps) {
|
|
278
|
+
this.deps = deps;
|
|
279
|
+
}
|
|
280
|
+
get defaultRoot() { return join(this.deps.stateDir, 'extensions'); }
|
|
281
|
+
get stateFile() { return join(this.deps.stateDir, 'extension-overrides.json'); }
|
|
282
|
+
get installFile() { return join(this.deps.stateDir, 'extension-install-manifest.json'); }
|
|
283
|
+
root() {
|
|
284
|
+
const raw = (this.deps.env.HERMES_WEBUI_EXTENSION_DIR ?? '').trim();
|
|
285
|
+
if (raw) {
|
|
286
|
+
const r = resolve(raw.replace(/^~(?=$|\/)/, this.deps.env.HOME ?? ''));
|
|
287
|
+
return existsSync(r) && statSync(r).isDirectory() ? r : null;
|
|
288
|
+
}
|
|
289
|
+
try {
|
|
290
|
+
return existsSync(this.defaultRoot) && statSync(this.defaultRoot).isDirectory() && !lstatSync(this.defaultRoot).isSymbolicLink() ? resolve(this.defaultRoot) : null;
|
|
291
|
+
}
|
|
292
|
+
catch {
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
writableRoot() {
|
|
297
|
+
if ((this.deps.env.HERMES_WEBUI_EXTENSION_DIR ?? '').trim())
|
|
298
|
+
return this.root();
|
|
299
|
+
try {
|
|
300
|
+
mkdirSync(this.defaultRoot, { recursive: true });
|
|
301
|
+
return lstatSync(this.defaultRoot).isSymbolicLink() ? null : resolve(this.defaultRoot);
|
|
302
|
+
}
|
|
303
|
+
catch {
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
loadState(d) {
|
|
308
|
+
const empty = { version: 1, disabled_extensions: [], sidecar_proxy_consents: {} };
|
|
309
|
+
const src = 'extension_state';
|
|
310
|
+
let parsed;
|
|
311
|
+
try {
|
|
312
|
+
if (!existsSync(this.stateFile) || !statSync(this.stateFile).isFile())
|
|
313
|
+
return empty;
|
|
314
|
+
const raw = readFileSync(this.stateFile);
|
|
315
|
+
if (raw.length > MAX_STATE_BYTES) {
|
|
316
|
+
warn(d, 'extension_state_oversized', src);
|
|
317
|
+
return empty;
|
|
318
|
+
}
|
|
319
|
+
parsed = JSON.parse(raw.toString('utf8'));
|
|
320
|
+
}
|
|
321
|
+
catch {
|
|
322
|
+
warn(d, 'extension_state_unreadable', src);
|
|
323
|
+
return empty;
|
|
324
|
+
}
|
|
325
|
+
if (!isDict(parsed)) {
|
|
326
|
+
warn(d, 'extension_state_invalid', src);
|
|
327
|
+
return empty;
|
|
328
|
+
}
|
|
329
|
+
const disabledRaw = parsed.disabled_extensions ?? [];
|
|
330
|
+
if (!Array.isArray(disabledRaw)) {
|
|
331
|
+
warn(d, 'extension_state_invalid', src);
|
|
332
|
+
return empty;
|
|
333
|
+
}
|
|
334
|
+
let invalid = false;
|
|
335
|
+
const disabled = [];
|
|
336
|
+
// Python `_MAX_DISABLED_EXTENSION_IDS` / `_MAX_SIDECAR_PROXY_CONSENTS`: the state file is read up to 512 entries each.
|
|
337
|
+
for (const v of disabledRaw) {
|
|
338
|
+
if (!validId(v)) {
|
|
339
|
+
invalid = true;
|
|
340
|
+
continue;
|
|
341
|
+
}
|
|
342
|
+
if (disabled.includes(v.trim()))
|
|
343
|
+
continue;
|
|
344
|
+
disabled.push(v.trim());
|
|
345
|
+
if (disabled.length >= MAX_STATE_ENTRIES) {
|
|
346
|
+
warn(d, 'extension_state_truncated', src);
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
let consents = {};
|
|
351
|
+
const rawConsents = parsed.sidecar_proxy_consents ?? {};
|
|
352
|
+
let consentsInvalid = false;
|
|
353
|
+
if (rawConsents !== null) {
|
|
354
|
+
if (!isDict(rawConsents)) {
|
|
355
|
+
invalid = true;
|
|
356
|
+
consentsInvalid = true;
|
|
357
|
+
}
|
|
358
|
+
else {
|
|
359
|
+
for (const [id, origin] of Object.entries(rawConsents)) {
|
|
360
|
+
const norm = validId(id) ? normalizeLoopbackOrigin(origin) : null;
|
|
361
|
+
if (!norm) {
|
|
362
|
+
invalid = true;
|
|
363
|
+
consentsInvalid = true;
|
|
364
|
+
continue;
|
|
365
|
+
}
|
|
366
|
+
if (id.trim() in consents)
|
|
367
|
+
continue;
|
|
368
|
+
consents[id.trim()] = norm;
|
|
369
|
+
if (Object.keys(consents).length >= MAX_STATE_ENTRIES) {
|
|
370
|
+
warn(d, 'extension_state_truncated', src);
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (consentsInvalid)
|
|
377
|
+
consents = {};
|
|
378
|
+
if (invalid)
|
|
379
|
+
warn(d, 'extension_state_invalid_entries', src);
|
|
380
|
+
return { version: 1, disabled_extensions: disabled, sidecar_proxy_consents: consents };
|
|
381
|
+
}
|
|
382
|
+
writeState(state) {
|
|
383
|
+
mkdirSync(this.deps.stateDir, { recursive: true });
|
|
384
|
+
atomicWriteText(this.stateFile, JSON.stringify({ version: 1, disabled_extensions: [...new Set(state.disabled_extensions.filter(validId))].sort(), sidecar_proxy_consents: state.sidecar_proxy_consents }, null, 2));
|
|
385
|
+
}
|
|
386
|
+
loadInstallManifest() {
|
|
387
|
+
const empty = { version: 1, installed: {} };
|
|
388
|
+
try {
|
|
389
|
+
if (!existsSync(this.installFile))
|
|
390
|
+
return empty;
|
|
391
|
+
const raw = readFileSync(this.installFile);
|
|
392
|
+
if (raw.length > MAX_INSTALL_MANIFEST_BYTES)
|
|
393
|
+
return empty;
|
|
394
|
+
const parsed = JSON.parse(raw.toString('utf8'));
|
|
395
|
+
if (!isDict(parsed) || !isDict(parsed.installed))
|
|
396
|
+
return empty;
|
|
397
|
+
const installed = {};
|
|
398
|
+
for (const [id, entry] of Object.entries(parsed.installed)) {
|
|
399
|
+
if (!validId(id) || !isDict(entry) || !Array.isArray(entry.files))
|
|
400
|
+
continue;
|
|
401
|
+
installed[id] = { version: str(entry.version ?? 'unknown'), files: entry.files.filter((f) => typeof f === 'string'), installed_at: str(entry.installed_at) };
|
|
402
|
+
if (Object.keys(installed).length >= 256)
|
|
403
|
+
break;
|
|
404
|
+
}
|
|
405
|
+
return { version: 1, installed };
|
|
406
|
+
}
|
|
407
|
+
catch {
|
|
408
|
+
return empty;
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
writeInstallManifest(manifest) {
|
|
412
|
+
mkdirSync(this.deps.stateDir, { recursive: true });
|
|
413
|
+
atomicWriteText(this.installFile, JSON.stringify(manifest, null, 2));
|
|
414
|
+
}
|
|
415
|
+
manifestPath(root) {
|
|
416
|
+
const raw = (this.deps.env.HERMES_WEBUI_EXTENSION_MANIFEST ?? '').trim();
|
|
417
|
+
if (!raw)
|
|
418
|
+
return [null, 'not_configured'];
|
|
419
|
+
if (raw.startsWith('/') || raw.startsWith('~'))
|
|
420
|
+
return [null, 'invalid_path'];
|
|
421
|
+
const rel = fullyUnquote(raw);
|
|
422
|
+
if (!isSafeRelativePath(rel))
|
|
423
|
+
return [null, 'invalid_path'];
|
|
424
|
+
const manifest = resolve(root, rel);
|
|
425
|
+
if (!manifest.startsWith(root + sep))
|
|
426
|
+
return [null, 'invalid_path'];
|
|
427
|
+
// Python `(root / rel).resolve().relative_to(root)`: a symlinked manifest that leaves the root is rejected too.
|
|
428
|
+
const real = resolvePathLikePython(manifest);
|
|
429
|
+
const rootReal = resolvePathLikePython(root);
|
|
430
|
+
if (real !== rootReal && !real.startsWith(rootReal + sep))
|
|
431
|
+
return [null, 'invalid_path'];
|
|
432
|
+
return [manifest, 'configured'];
|
|
433
|
+
}
|
|
434
|
+
galleryManifest(root, d) {
|
|
435
|
+
const installed = this.loadInstallManifest().installed;
|
|
436
|
+
const entries = [];
|
|
437
|
+
for (const id of Object.keys(installed).sort()) {
|
|
438
|
+
if (!validId(id))
|
|
439
|
+
continue;
|
|
440
|
+
const file = join(root, id, 'manifest.json');
|
|
441
|
+
let manifest;
|
|
442
|
+
try {
|
|
443
|
+
if (!existsSync(file) || !statSync(file).isFile()) {
|
|
444
|
+
warn(d, 'gallery_manifest_missing', 'gallery');
|
|
445
|
+
continue;
|
|
446
|
+
}
|
|
447
|
+
const raw = readFileSync(file);
|
|
448
|
+
if (raw.length > MAX_MANIFEST_BYTES) {
|
|
449
|
+
warn(d, 'gallery_manifest_oversized', 'gallery');
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
manifest = JSON.parse(raw.toString('utf8'));
|
|
453
|
+
}
|
|
454
|
+
catch {
|
|
455
|
+
warn(d, 'gallery_manifest_malformed', 'gallery');
|
|
456
|
+
continue;
|
|
457
|
+
}
|
|
458
|
+
const withBase = (entry) => {
|
|
459
|
+
const copy = { ...entry };
|
|
460
|
+
for (const key of ['scripts', 'stylesheets'])
|
|
461
|
+
if (Array.isArray(copy[key]))
|
|
462
|
+
copy[key] = copy[key].map((v) => (typeof v === 'string' && v.trim() && !/^[a-z]+:|^\/\/|^\//i.test(v.trim()) ? `${id}/${v.trim()}` : v));
|
|
463
|
+
return copy;
|
|
464
|
+
};
|
|
465
|
+
if (isDict(manifest)) {
|
|
466
|
+
const top = { id };
|
|
467
|
+
for (const key of ['name', 'enabled', 'scripts', 'stylesheets', 'sidecar', 'permissions', 'settings_schema'])
|
|
468
|
+
if (key in manifest)
|
|
469
|
+
top[key] = manifest[key];
|
|
470
|
+
if (['scripts', 'stylesheets', 'sidecar', 'permissions', 'settings_schema'].some((k) => k in top))
|
|
471
|
+
entries.push(withBase(top));
|
|
472
|
+
}
|
|
473
|
+
for (const entry of manifestEntries(manifest)) {
|
|
474
|
+
const copy = withBase(entry);
|
|
475
|
+
if (!validId(copy.id))
|
|
476
|
+
copy.id = id;
|
|
477
|
+
entries.push(copy);
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
return entries.length ? { extensions: entries } : null;
|
|
481
|
+
}
|
|
482
|
+
loadManifest(root, d) {
|
|
483
|
+
const [file, pathStatus] = this.manifestPath(root);
|
|
484
|
+
const status = { configured: pathStatus !== 'not_configured', loaded: false, status: pathStatus, _asset_base: '', entry_count: 0, script_count: 0, stylesheet_count: 0, sidecar_count: 0 };
|
|
485
|
+
if (!file) {
|
|
486
|
+
if (pathStatus === 'invalid_path')
|
|
487
|
+
warn(d, 'manifest_invalid_path', 'manifest');
|
|
488
|
+
else if (pathStatus === 'not_configured') {
|
|
489
|
+
const gallery = this.galleryManifest(root, d);
|
|
490
|
+
if (gallery)
|
|
491
|
+
return [gallery, { ...status, loaded: true, status: 'gallery_installed' }];
|
|
492
|
+
}
|
|
493
|
+
return [null, status];
|
|
494
|
+
}
|
|
495
|
+
try {
|
|
496
|
+
if (!existsSync(file) || !statSync(file).isFile()) {
|
|
497
|
+
status.status = 'missing';
|
|
498
|
+
warn(d, 'manifest_missing', 'manifest');
|
|
499
|
+
return [null, status];
|
|
500
|
+
}
|
|
501
|
+
const raw = readFileSync(file);
|
|
502
|
+
if (raw.length > MAX_MANIFEST_BYTES) {
|
|
503
|
+
status.status = 'oversized';
|
|
504
|
+
warn(d, 'manifest_oversized', 'manifest');
|
|
505
|
+
return [null, status];
|
|
506
|
+
}
|
|
507
|
+
const manifest = JSON.parse(raw.toString('utf8'));
|
|
508
|
+
const relParent = relative(root, dirname(file)).split(sep).join('/');
|
|
509
|
+
return [manifest, { ...status, loaded: true, status: 'loaded', _asset_base: relParent === '' || relParent === '.' ? '' : relParent }];
|
|
510
|
+
}
|
|
511
|
+
catch (error) {
|
|
512
|
+
status.status = error instanceof SyntaxError ? 'malformed' : 'unreadable';
|
|
513
|
+
warn(d, error instanceof SyntaxError ? 'manifest_malformed' : 'manifest_unreadable', 'manifest');
|
|
514
|
+
return [null, status];
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
extensionState(manifest, disabled, d, consentIds) {
|
|
518
|
+
const extensions = [];
|
|
519
|
+
const knownIds = new Set();
|
|
520
|
+
const manifestDisabled = new Set();
|
|
521
|
+
let invalid = false;
|
|
522
|
+
let duplicate = false;
|
|
523
|
+
for (const entry of manifestEntries(manifest)) {
|
|
524
|
+
const raw = entryText(entry, 'id');
|
|
525
|
+
if (!validId(raw)) {
|
|
526
|
+
invalid = true;
|
|
527
|
+
continue;
|
|
528
|
+
}
|
|
529
|
+
if (knownIds.has(raw)) {
|
|
530
|
+
duplicate = true;
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
knownIds.add(raw);
|
|
534
|
+
const manifestEnabled = entry.enabled !== false;
|
|
535
|
+
const userDisabled = disabled.has(raw);
|
|
536
|
+
if (!manifestEnabled)
|
|
537
|
+
manifestDisabled.add(raw);
|
|
538
|
+
extensions.push({
|
|
539
|
+
id: raw, name: entryText(entry, 'name') || raw, manifest_enabled: manifestEnabled, user_enabled: manifestEnabled ? !userDisabled : false, user_disabled: userDisabled,
|
|
540
|
+
effective_enabled: manifestEnabled && !userDisabled, can_toggle: manifestEnabled, reload_required: true, storage_owned: storageOwned(entry), settings_schema: settingsSchema(entry),
|
|
541
|
+
status: !manifestEnabled ? 'manifest_disabled' : userDisabled ? 'user_disabled' : 'enabled',
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
if (invalid)
|
|
545
|
+
warn(d, 'manifest_extension_id_invalid', 'manifest:extensions');
|
|
546
|
+
if (duplicate)
|
|
547
|
+
warn(d, 'manifest_extension_id_duplicate', 'manifest:extensions');
|
|
548
|
+
if ([...disabled, ...consentIds].some((id) => !knownIds.has(id)))
|
|
549
|
+
warn(d, 'extension_state_unknown_ids', 'extension_state');
|
|
550
|
+
return { extensions, knownIds, manifestDisabled };
|
|
551
|
+
}
|
|
552
|
+
async sidecarRecords(manifest, disabled, state, d) {
|
|
553
|
+
const counts = new Map();
|
|
554
|
+
const byId = new Map();
|
|
555
|
+
for (const entry of manifestEntries(manifest)) {
|
|
556
|
+
const id = entryText(entry, 'id');
|
|
557
|
+
if (!validId(id))
|
|
558
|
+
continue;
|
|
559
|
+
counts.set(id, (counts.get(id) ?? 0) + 1);
|
|
560
|
+
if (byId.has(id))
|
|
561
|
+
continue;
|
|
562
|
+
const manifestEnabled = entry.enabled !== false;
|
|
563
|
+
const effective = manifestEnabled && !disabled.has(id);
|
|
564
|
+
byId.set(id, { id, name: entryText(entry, 'name'), manifest_enabled: manifestEnabled, user_disabled: disabled.has(id), effective_enabled: effective, sidecar: effective ? sidecarFromEntry(entry, d) : null, approved_origin: state.sidecar_proxy_consents[id] ?? null });
|
|
565
|
+
}
|
|
566
|
+
const records = [];
|
|
567
|
+
const authEnabled = await this.deps.isAuthEnabled();
|
|
568
|
+
for (const [id, item] of byId) {
|
|
569
|
+
const sidecar = item.sidecar;
|
|
570
|
+
if (!sidecar)
|
|
571
|
+
continue;
|
|
572
|
+
const available = Boolean(item.effective_enabled) && counts.get(id) === 1;
|
|
573
|
+
const approved = item.approved_origin;
|
|
574
|
+
const proxy = { available, consented: available && approved === sidecar.origin, consent_required: available && approved !== sidecar.origin, path: `/api/extensions/${id}/sidecar/`, origin_changed: Boolean(available && approved && approved !== sidecar.origin) };
|
|
575
|
+
if (sidecar.proxy_auth === 'token-v1') {
|
|
576
|
+
proxy.proxy_auth = 'token-v1';
|
|
577
|
+
proxy.posture = available ? (authEnabled ? 'protected' : 'local_unprotected') : null;
|
|
578
|
+
}
|
|
579
|
+
item.duplicate_id = (counts.get(id) ?? 0) > 1;
|
|
580
|
+
item.proxy = proxy;
|
|
581
|
+
if (records.length < MAX_URL_LIST) {
|
|
582
|
+
const pub = { ...sidecar };
|
|
583
|
+
Reflect.deleteProperty(pub, 'proxy_auth');
|
|
584
|
+
records.push({ ...pub, proxy });
|
|
585
|
+
}
|
|
586
|
+
else
|
|
587
|
+
warn(d, 'sidecar_list_truncated', 'manifest:sidecars');
|
|
588
|
+
}
|
|
589
|
+
return { records, byId };
|
|
590
|
+
}
|
|
591
|
+
assetUrl(value, base) {
|
|
592
|
+
if (typeof value !== 'string' || !value.trim())
|
|
593
|
+
return '';
|
|
594
|
+
const item = value.trim();
|
|
595
|
+
if (/^[a-z][a-z0-9+.-]*:/i.test(item) || item.startsWith('//') || item.startsWith('/'))
|
|
596
|
+
return item;
|
|
597
|
+
const b = base.replace(/^\/+|\/+$/g, '');
|
|
598
|
+
return EXTENSION_ROUTE_PREFIX + (b ? `${b}/${item}` : item);
|
|
599
|
+
}
|
|
600
|
+
appendUrl(urls, value, source, d, dedupe) {
|
|
601
|
+
const v = value.trim();
|
|
602
|
+
if (!v)
|
|
603
|
+
return true;
|
|
604
|
+
if (!isSafeAssetUrl(v)) {
|
|
605
|
+
warn(d, 'asset_url_rejected', source);
|
|
606
|
+
return true;
|
|
607
|
+
}
|
|
608
|
+
if (dedupe && urls.includes(v))
|
|
609
|
+
return true;
|
|
610
|
+
if (urls.length >= MAX_URL_LIST) {
|
|
611
|
+
warn(d, 'asset_url_list_truncated', source);
|
|
612
|
+
return false;
|
|
613
|
+
}
|
|
614
|
+
urls.push(v);
|
|
615
|
+
return true;
|
|
616
|
+
}
|
|
617
|
+
envUrls(envName, existing, d) {
|
|
618
|
+
const urls = [...(existing ?? [])];
|
|
619
|
+
for (const item of (this.deps.env[envName] ?? '').split(','))
|
|
620
|
+
if (!this.appendUrl(urls, item, envName, d, existing !== null))
|
|
621
|
+
break;
|
|
622
|
+
return urls;
|
|
623
|
+
}
|
|
624
|
+
async manifestUrls(manifest, status, disabled, state, d) {
|
|
625
|
+
const scripts = [];
|
|
626
|
+
const stylesheets = [];
|
|
627
|
+
const base = str(status._asset_base);
|
|
628
|
+
const entries = [];
|
|
629
|
+
if (isDict(manifest))
|
|
630
|
+
entries.push(manifest);
|
|
631
|
+
for (const e of manifestEntries(manifest)) {
|
|
632
|
+
const id = entryText(e, 'id');
|
|
633
|
+
if (e.enabled !== false && !(validId(id) && disabled.has(id)))
|
|
634
|
+
entries.push(e);
|
|
635
|
+
}
|
|
636
|
+
status.entry_count = entries.length;
|
|
637
|
+
let scriptsFull = false;
|
|
638
|
+
let stylesFull = false;
|
|
639
|
+
for (const entry of entries) {
|
|
640
|
+
if (!scriptsFull)
|
|
641
|
+
for (const v of Array.isArray(entry.scripts) ? entry.scripts : [])
|
|
642
|
+
if (!this.appendUrl(scripts, this.assetUrl(v, base), 'manifest:scripts', d, true)) {
|
|
643
|
+
scriptsFull = true;
|
|
644
|
+
break;
|
|
645
|
+
}
|
|
646
|
+
if (!stylesFull)
|
|
647
|
+
for (const v of Array.isArray(entry.stylesheets) ? entry.stylesheets : [])
|
|
648
|
+
if (!this.appendUrl(stylesheets, this.assetUrl(v, base), 'manifest:stylesheets', d, true)) {
|
|
649
|
+
stylesFull = true;
|
|
650
|
+
break;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
const { records } = await this.sidecarRecords(manifest, disabled, state, d);
|
|
654
|
+
Object.assign(status, { loaded: true, status: str(status.status) || 'loaded', script_count: scripts.length, stylesheet_count: stylesheets.length, sidecar_count: records.length });
|
|
655
|
+
return { scripts, stylesheets, sidecars: records };
|
|
656
|
+
}
|
|
657
|
+
/** Python `get_extension_status`. */
|
|
658
|
+
/** Python `get_extension_config()["enabled"]` for the bootstrap feature flag: a valid root with a loadable manifest. */
|
|
659
|
+
/** Python `get_extension_config()["enabled"]`: true whenever the extension root directory exists (a manifest is optional). */
|
|
660
|
+
enabledSync() {
|
|
661
|
+
return this.root() !== null;
|
|
662
|
+
}
|
|
663
|
+
async status() {
|
|
664
|
+
const d = { warnings: [] };
|
|
665
|
+
const envDir = (this.deps.env.HERMES_WEBUI_EXTENSION_DIR ?? '').trim();
|
|
666
|
+
const root = this.root();
|
|
667
|
+
const state = this.loadState(d);
|
|
668
|
+
const disabled = new Set(state.disabled_extensions);
|
|
669
|
+
const manifestConfigured = Boolean((this.deps.env.HERMES_WEBUI_EXTENSION_MANIFEST ?? '').trim());
|
|
670
|
+
if (envDir && !root)
|
|
671
|
+
warn(d, 'extension_dir_unavailable', 'extension_dir');
|
|
672
|
+
if (!root) {
|
|
673
|
+
return { enabled: false, extension_dir_configured: true, extension_dir_valid: false, script_urls: [], stylesheet_urls: [], sidecars: [], counts: { script_urls: 0, stylesheet_urls: 0, sidecars: 0, manifest_extensions: 0, user_disabled: 0 }, manifest: { configured: manifestConfigured, loaded: false, status: manifestConfigured ? 'extension_disabled' : 'not_configured', entry_count: 0, script_count: 0, stylesheet_count: 0, sidecar_count: 0 }, extensions: [], warnings: d.warnings };
|
|
674
|
+
}
|
|
675
|
+
const [manifest, status] = this.loadManifest(root, d);
|
|
676
|
+
const consentIds = new Set(Object.keys(state.sidecar_proxy_consents));
|
|
677
|
+
const ext = manifest !== null ? this.extensionState(manifest, disabled, d, consentIds) : { extensions: [], knownIds: new Set(), manifestDisabled: new Set() };
|
|
678
|
+
const urls = manifest !== null ? await this.manifestUrls(manifest, status, disabled, state, d) : { scripts: [], stylesheets: [], sidecars: [] };
|
|
679
|
+
const scriptUrls = this.envUrls('HERMES_WEBUI_EXTENSION_SCRIPT_URLS', urls.scripts.length ? urls.scripts : null, d);
|
|
680
|
+
const stylesheetUrls = this.envUrls('HERMES_WEBUI_EXTENSION_STYLESHEET_URLS', urls.stylesheets.length ? urls.stylesheets : null, d);
|
|
681
|
+
const publicStatus = Object.fromEntries(Object.entries(status).filter(([k]) => !k.startsWith('_')));
|
|
682
|
+
return {
|
|
683
|
+
enabled: true, extension_dir_configured: true, extension_dir_valid: true, script_urls: scriptUrls, stylesheet_urls: stylesheetUrls, sidecars: urls.sidecars,
|
|
684
|
+
counts: { script_urls: scriptUrls.length, stylesheet_urls: stylesheetUrls.length, sidecars: urls.sidecars.length, manifest_extensions: ext.extensions.length, user_disabled: [...disabled].filter((id) => ext.knownIds.has(id)).length },
|
|
685
|
+
manifest: publicStatus, extensions: ext.extensions, gallery_installed: this.loadInstallManifest().installed, warnings: d.warnings,
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
loaded(root, d) {
|
|
689
|
+
const state = this.loadState(d);
|
|
690
|
+
const [manifest, status] = this.loadManifest(root, d);
|
|
691
|
+
if (manifest === null || status.loaded !== true)
|
|
692
|
+
throw new ExtensionError('Extension manifest is not loaded', 409);
|
|
693
|
+
return { manifest, state, disabled: new Set(state.disabled_extensions) };
|
|
694
|
+
}
|
|
695
|
+
mutateState(fn) {
|
|
696
|
+
const run = this.stateLock.catch(() => undefined).then(fn);
|
|
697
|
+
this.stateLock = run;
|
|
698
|
+
return run;
|
|
699
|
+
}
|
|
700
|
+
setEnabled(idRaw, enabled) {
|
|
701
|
+
if (!validId(idRaw))
|
|
702
|
+
throw new ExtensionError('Invalid extension id', 400);
|
|
703
|
+
if (typeof enabled !== 'boolean')
|
|
704
|
+
throw new ExtensionError('enabled must be a boolean', 400);
|
|
705
|
+
return this.mutateState(async () => this.setEnabledLocked(idRaw.trim(), enabled));
|
|
706
|
+
}
|
|
707
|
+
async setEnabledLocked(id, enabled) {
|
|
708
|
+
const root = this.root();
|
|
709
|
+
if (!root)
|
|
710
|
+
throw new ExtensionError('Extensions are not configured', 404);
|
|
711
|
+
const d = { warnings: [] };
|
|
712
|
+
const { manifest, state, disabled } = this.loaded(root, d);
|
|
713
|
+
const ext = this.extensionState(manifest, disabled, d, new Set(Object.keys(state.sidecar_proxy_consents)));
|
|
714
|
+
if (!ext.knownIds.has(id))
|
|
715
|
+
throw new ExtensionError('Extension not found', 404);
|
|
716
|
+
if (ext.manifestDisabled.has(id))
|
|
717
|
+
throw new ExtensionError('Extension is disabled by its manifest', 409);
|
|
718
|
+
if (enabled)
|
|
719
|
+
disabled.delete(id);
|
|
720
|
+
else
|
|
721
|
+
disabled.add(id);
|
|
722
|
+
this.writeState({ disabled_extensions: [...disabled], sidecar_proxy_consents: Object.fromEntries(Object.entries(state.sidecar_proxy_consents).filter(([k]) => ext.knownIds.has(k))) });
|
|
723
|
+
return this.status();
|
|
724
|
+
}
|
|
725
|
+
setConsent(idRaw, approved) {
|
|
726
|
+
if (!validId(idRaw))
|
|
727
|
+
throw new ExtensionError('Invalid extension id', 400);
|
|
728
|
+
if (typeof approved !== 'boolean')
|
|
729
|
+
throw new ExtensionError('approved must be a boolean', 400);
|
|
730
|
+
return this.mutateState(() => this.setConsentLocked(idRaw.trim(), approved));
|
|
731
|
+
}
|
|
732
|
+
async setConsentLocked(id, approved) {
|
|
733
|
+
const root = this.root();
|
|
734
|
+
if (!root)
|
|
735
|
+
throw new ExtensionError('Extensions are not configured', 404);
|
|
736
|
+
const d = { warnings: [] };
|
|
737
|
+
const { manifest, state, disabled } = this.loaded(root, d);
|
|
738
|
+
const consents = { ...state.sidecar_proxy_consents };
|
|
739
|
+
const ext = this.extensionState(manifest, disabled, d, new Set(Object.keys(consents)));
|
|
740
|
+
if (!ext.knownIds.has(id))
|
|
741
|
+
throw new ExtensionError('Extension not found', 404);
|
|
742
|
+
const { byId } = await this.sidecarRecords(manifest, disabled, state, d);
|
|
743
|
+
const item = byId.get(id) ?? {};
|
|
744
|
+
const sidecar = item.sidecar;
|
|
745
|
+
const proxy = (item.proxy ?? {});
|
|
746
|
+
if (approved) {
|
|
747
|
+
if (!sidecar || proxy.available !== true)
|
|
748
|
+
throw new ExtensionError('Extension sidecar proxy is unavailable', 409);
|
|
749
|
+
if (sidecar.proxy_auth === 'token-v1')
|
|
750
|
+
throw new ExtensionError('Sidecar token-v1 proxy auth is not available in this release.', 409);
|
|
751
|
+
consents[id] = str(sidecar.origin);
|
|
752
|
+
}
|
|
753
|
+
else
|
|
754
|
+
Reflect.deleteProperty(consents, id);
|
|
755
|
+
this.writeState({ disabled_extensions: [...disabled], sidecar_proxy_consents: Object.fromEntries(Object.entries(consents).filter(([k]) => ext.knownIds.has(k))) });
|
|
756
|
+
return this.status();
|
|
757
|
+
}
|
|
758
|
+
/** Python `resolve_extension_sidecar_proxy_target` (legacy proxy auth only). */
|
|
759
|
+
async proxyTarget(idRaw, proxyPath, query) {
|
|
760
|
+
if (!validId(idRaw))
|
|
761
|
+
throw new ExtensionError('Invalid extension id', 400);
|
|
762
|
+
const normalized = normalizeProxyPath(proxyPath);
|
|
763
|
+
if (normalized === null)
|
|
764
|
+
throw new ExtensionError('Invalid sidecar proxy path', 400);
|
|
765
|
+
const root = this.root();
|
|
766
|
+
if (!root)
|
|
767
|
+
throw new ExtensionError('Extensions are not configured', 404);
|
|
768
|
+
const id = idRaw.trim();
|
|
769
|
+
const d = { warnings: [] };
|
|
770
|
+
const { manifest, state, disabled } = this.loaded(root, d);
|
|
771
|
+
const ext = this.extensionState(manifest, disabled, d, new Set(Object.keys(state.sidecar_proxy_consents)));
|
|
772
|
+
if (!ext.knownIds.has(id))
|
|
773
|
+
throw new ExtensionError('Extension not found', 404);
|
|
774
|
+
const { byId } = await this.sidecarRecords(manifest, disabled, state, d);
|
|
775
|
+
const item = byId.get(id) ?? {};
|
|
776
|
+
const sidecar = item.sidecar;
|
|
777
|
+
const proxy = (item.proxy ?? {});
|
|
778
|
+
if (!sidecar || proxy.available !== true)
|
|
779
|
+
throw new ExtensionError('Extension sidecar proxy is unavailable', 409);
|
|
780
|
+
if (proxy.consented !== true)
|
|
781
|
+
throw new ExtensionError('Extension sidecar proxy consent required', 403);
|
|
782
|
+
if (sidecar.proxy_auth === 'token-v1')
|
|
783
|
+
throw new ExtensionError('Sidecar token-v1 proxy auth is not available in this release.', 403);
|
|
784
|
+
const origin = str(sidecar.origin);
|
|
785
|
+
return { origin, upstream_url: `${origin}${normalized}${query ? `?${query}` : ''}` };
|
|
786
|
+
}
|
|
787
|
+
/** Python `_build_gallery_opener` (`_AllowlistRedirectHandler`): redirects are followed only onto https gallery hosts. */
|
|
788
|
+
async galleryFetch(url, timeoutMs) {
|
|
789
|
+
let current = url;
|
|
790
|
+
let res = await this.deps.fetch(current, { redirect: 'manual', signal: AbortSignal.timeout(timeoutMs) });
|
|
791
|
+
for (let hop = 0; res.status >= 300 && res.status < 400 && hop < 3; hop += 1) {
|
|
792
|
+
const location = res.headers.get('location') ?? '';
|
|
793
|
+
let next = null;
|
|
794
|
+
try {
|
|
795
|
+
next = new URL(location, current);
|
|
796
|
+
}
|
|
797
|
+
catch {
|
|
798
|
+
next = null;
|
|
799
|
+
}
|
|
800
|
+
if (next?.protocol !== 'https:' || !ALLOWED_DOWNLOAD_HOSTS.has(next.hostname))
|
|
801
|
+
throw new ExtensionError('Download redirected to disallowed host');
|
|
802
|
+
current = next.href;
|
|
803
|
+
res = await this.deps.fetch(current, { redirect: 'manual', signal: AbortSignal.timeout(timeoutMs) });
|
|
804
|
+
}
|
|
805
|
+
return res;
|
|
806
|
+
}
|
|
807
|
+
async registry() {
|
|
808
|
+
const now = Date.now();
|
|
809
|
+
if (this.registryCache && now - this.registryCache.at < REGISTRY_TTL_MS)
|
|
810
|
+
return { entries: this.registryCache.entries };
|
|
811
|
+
if (this.registryInflight)
|
|
812
|
+
return this.registryCache ? { entries: this.registryCache.entries } : { entries: [], error: 'registry_unavailable' };
|
|
813
|
+
this.registryInflight = (async () => {
|
|
814
|
+
const res = await this.galleryFetch(REGISTRY_URL, 10_000);
|
|
815
|
+
if (!res.ok)
|
|
816
|
+
throw new Error(`registry ${String(res.status)}`);
|
|
817
|
+
const raw = await readCapped(res, 2 * 1024 * 1024);
|
|
818
|
+
if (!raw)
|
|
819
|
+
throw new Error('registry too large');
|
|
820
|
+
const data = JSON.parse(raw.toString('utf8'));
|
|
821
|
+
const entries = Array.isArray(data) ? data : isDict(data) ? (Array.isArray(data.extensions) ? data.extensions : Array.isArray(data.entries) ? data.entries : []) : [];
|
|
822
|
+
this.registryCache = { at: now, entries };
|
|
823
|
+
return entries;
|
|
824
|
+
})();
|
|
825
|
+
try {
|
|
826
|
+
return { entries: await this.registryInflight };
|
|
827
|
+
}
|
|
828
|
+
catch {
|
|
829
|
+
return { entries: [], error: 'registry_unavailable' };
|
|
830
|
+
}
|
|
831
|
+
finally {
|
|
832
|
+
this.registryInflight = null;
|
|
833
|
+
}
|
|
834
|
+
}
|
|
835
|
+
async install(idRaw, downloadUrl, sha256) {
|
|
836
|
+
if (!validId(idRaw))
|
|
837
|
+
throw new ExtensionError('Invalid extension id');
|
|
838
|
+
const id = idRaw.trim();
|
|
839
|
+
if (typeof downloadUrl !== 'string' || !downloadUrl.startsWith('https://'))
|
|
840
|
+
throw new ExtensionError('Invalid download URL');
|
|
841
|
+
let host = '';
|
|
842
|
+
try {
|
|
843
|
+
host = new URL(downloadUrl).hostname;
|
|
844
|
+
}
|
|
845
|
+
catch {
|
|
846
|
+
host = '';
|
|
847
|
+
}
|
|
848
|
+
if (!ALLOWED_DOWNLOAD_HOSTS.has(host))
|
|
849
|
+
throw new ExtensionError('Invalid download URL');
|
|
850
|
+
if (typeof sha256 !== 'string' || !/^[0-9a-f]{64}$/.test(sha256))
|
|
851
|
+
throw new ExtensionError('Invalid sha256');
|
|
852
|
+
const root = this.writableRoot();
|
|
853
|
+
if (!root)
|
|
854
|
+
throw new ExtensionError('Extensions not configured', 404);
|
|
855
|
+
let raw;
|
|
856
|
+
try {
|
|
857
|
+
const res = await this.galleryFetch(downloadUrl, 30_000);
|
|
858
|
+
if (!res.ok)
|
|
859
|
+
throw new Error(`download ${String(res.status)}`);
|
|
860
|
+
const capped = await readCapped(res, MAX_ZIP_BYTES);
|
|
861
|
+
if (!capped)
|
|
862
|
+
throw new ExtensionError('Download too large');
|
|
863
|
+
raw = capped;
|
|
864
|
+
}
|
|
865
|
+
catch (error) {
|
|
866
|
+
throw new ExtensionError(error instanceof ExtensionError ? error.message : 'Download failed', error instanceof ExtensionError ? error.status : 502);
|
|
867
|
+
}
|
|
868
|
+
if (createHash('sha256').update(raw).digest('hex') !== sha256)
|
|
869
|
+
throw new ExtensionError('SHA-256 mismatch');
|
|
870
|
+
let entries;
|
|
871
|
+
try {
|
|
872
|
+
entries = readZip(raw);
|
|
873
|
+
}
|
|
874
|
+
catch {
|
|
875
|
+
throw new ExtensionError('Invalid zip archive');
|
|
876
|
+
}
|
|
877
|
+
const files = entries.filter((e) => e.name && !e.isDir);
|
|
878
|
+
if (files.reduce((acc, e) => acc + e.size, 0) > MAX_ZIP_BYTES * 10)
|
|
879
|
+
throw new ExtensionError('Archive uncompressed size exceeds limit');
|
|
880
|
+
if (files.length > 1024)
|
|
881
|
+
throw new ExtensionError('Archive contains too many files');
|
|
882
|
+
const prefix = files.every((e) => e.name.startsWith(`${id}/`)) ? `${id}/` : '';
|
|
883
|
+
const stripped = (name) => (prefix && name.startsWith(prefix) ? name.slice(prefix.length) : name);
|
|
884
|
+
const anchor = resolvePathLikePython(root);
|
|
885
|
+
const extDir = resolve(anchor, id);
|
|
886
|
+
for (const e of files) {
|
|
887
|
+
const decoded = fullyUnquote(stripped(e.name));
|
|
888
|
+
if (!decoded || !isSafeArchiveMember(decoded))
|
|
889
|
+
throw new ExtensionError('Unsafe archive member');
|
|
890
|
+
const target = resolve(extDir, decoded);
|
|
891
|
+
if (!target.startsWith(anchor + sep) || !target.startsWith(extDir + sep))
|
|
892
|
+
throw new ExtensionError('Zip-slip detected');
|
|
893
|
+
}
|
|
894
|
+
let version = 'unknown';
|
|
895
|
+
for (const vfile of ['extension.json', 'manifest.json']) {
|
|
896
|
+
const entry = entries.find((e) => e.name === prefix + vfile);
|
|
897
|
+
if (!entry)
|
|
898
|
+
continue;
|
|
899
|
+
try {
|
|
900
|
+
const m = JSON.parse(entry.read().toString('utf8'));
|
|
901
|
+
if (isDict(m) && typeof m.version === 'string') {
|
|
902
|
+
version = m.version;
|
|
903
|
+
break;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
catch { /* ignore */ }
|
|
907
|
+
}
|
|
908
|
+
try {
|
|
909
|
+
if (lstatSync(extDir).isSymbolicLink())
|
|
910
|
+
throw new ExtensionError('Extension directory is a symlink', 400);
|
|
911
|
+
}
|
|
912
|
+
catch (error) {
|
|
913
|
+
if (error instanceof ExtensionError)
|
|
914
|
+
throw error;
|
|
915
|
+
}
|
|
916
|
+
try {
|
|
917
|
+
makeAnchoredDir(anchor, extDir);
|
|
918
|
+
}
|
|
919
|
+
catch {
|
|
920
|
+
throw new ExtensionError('Extension directory is a symlink', 400);
|
|
921
|
+
}
|
|
922
|
+
const written = [];
|
|
923
|
+
const rollback = () => {
|
|
924
|
+
for (const p of written) {
|
|
925
|
+
try {
|
|
926
|
+
unlinkAnchored(anchor, p);
|
|
927
|
+
}
|
|
928
|
+
catch { /* gone */ }
|
|
929
|
+
}
|
|
930
|
+
try {
|
|
931
|
+
rmdirAnchored(anchor, extDir);
|
|
932
|
+
}
|
|
933
|
+
catch { /* not empty, or gone */ }
|
|
934
|
+
};
|
|
935
|
+
try {
|
|
936
|
+
// Every destination is created or truncated through the anchored walk from the extension root, so a symlink
|
|
937
|
+
// already inside the extension (or a parent swapped mid-extraction) can never redirect a write outside it.
|
|
938
|
+
for (const e of files) {
|
|
939
|
+
const dest = resolve(extDir, fullyUnquote(stripped(e.name)));
|
|
940
|
+
let fd;
|
|
941
|
+
try {
|
|
942
|
+
fd = openAnchoredCreateFd(anchor, dest);
|
|
943
|
+
}
|
|
944
|
+
catch (error) {
|
|
945
|
+
if (!(error instanceof FileExistsError))
|
|
946
|
+
throw error;
|
|
947
|
+
fd = openAnchoredWriteFd(anchor, dest);
|
|
948
|
+
}
|
|
949
|
+
try {
|
|
950
|
+
writeFileSync(fd, e.read());
|
|
951
|
+
}
|
|
952
|
+
finally {
|
|
953
|
+
closeSync(fd);
|
|
954
|
+
}
|
|
955
|
+
written.push(dest);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
catch {
|
|
959
|
+
rollback();
|
|
960
|
+
throw new ExtensionError('Extraction failed', 500);
|
|
961
|
+
}
|
|
962
|
+
try {
|
|
963
|
+
const manifest = this.loadInstallManifest();
|
|
964
|
+
const record = { version, files: written.map((p) => relative(extDir, p).split(sep).join('/')), installed_at: new Date().toISOString() };
|
|
965
|
+
const next = { version: 1, installed: { ...manifest.installed, [id]: record } };
|
|
966
|
+
if (Buffer.byteLength(JSON.stringify(next, null, 2)) > MAX_INSTALL_MANIFEST_BYTES)
|
|
967
|
+
throw new ExtensionError('Install manifest would exceed size limit');
|
|
968
|
+
this.writeInstallManifest(next);
|
|
969
|
+
}
|
|
970
|
+
catch (error) {
|
|
971
|
+
rollback();
|
|
972
|
+
throw error instanceof ExtensionError ? error : new ExtensionError('Failed to record install', 500);
|
|
973
|
+
}
|
|
974
|
+
return { installed: true, id, version };
|
|
975
|
+
}
|
|
976
|
+
uninstall(idRaw) {
|
|
977
|
+
if (!validId(idRaw))
|
|
978
|
+
throw new ExtensionError('Invalid extension id');
|
|
979
|
+
const id = idRaw.trim();
|
|
980
|
+
const root = this.root();
|
|
981
|
+
if (!root)
|
|
982
|
+
throw new ExtensionError('Extensions not configured', 404);
|
|
983
|
+
const manifest = this.loadInstallManifest();
|
|
984
|
+
const entry = manifest.installed[id];
|
|
985
|
+
if (!entry)
|
|
986
|
+
throw new ExtensionError('Extension not installed', 404);
|
|
987
|
+
const anchor = resolvePathLikePython(root);
|
|
988
|
+
const extDir = resolve(anchor, id);
|
|
989
|
+
for (const rel of entry.files) {
|
|
990
|
+
if (!isSafeArchiveMember(rel))
|
|
991
|
+
continue;
|
|
992
|
+
const target = resolve(extDir, rel);
|
|
993
|
+
if (!target.startsWith(extDir + sep))
|
|
994
|
+
continue;
|
|
995
|
+
try {
|
|
996
|
+
unlinkAnchored(anchor, target);
|
|
997
|
+
}
|
|
998
|
+
catch { /* gone */ }
|
|
999
|
+
}
|
|
1000
|
+
// Prune now-empty directories, enumerating and removing each through the anchored walk so a directory replaced by
|
|
1001
|
+
// a symlink is skipped rather than followed into its target.
|
|
1002
|
+
const prune = (dir) => {
|
|
1003
|
+
let subdirs;
|
|
1004
|
+
try {
|
|
1005
|
+
subdirs = withAnchoredDir(anchor, dir, (child) => readdirSync(child('.'), { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => e.name));
|
|
1006
|
+
}
|
|
1007
|
+
catch {
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
for (const name of subdirs)
|
|
1011
|
+
prune(join(dir, name));
|
|
1012
|
+
try {
|
|
1013
|
+
rmdirAnchored(anchor, dir);
|
|
1014
|
+
}
|
|
1015
|
+
catch { /* not empty, or gone */ }
|
|
1016
|
+
};
|
|
1017
|
+
prune(extDir);
|
|
1018
|
+
Reflect.deleteProperty(manifest.installed, id);
|
|
1019
|
+
this.writeInstallManifest(manifest);
|
|
1020
|
+
return { uninstalled: true, id };
|
|
1021
|
+
}
|
|
1022
|
+
/** Python `serve_extension_static`: bytes, MIME, sandbox CSP for HTML; null means 404. */
|
|
1023
|
+
staticFile(rel) {
|
|
1024
|
+
const root = this.root();
|
|
1025
|
+
if (!root || !isSafeRelativePath(rel))
|
|
1026
|
+
return null;
|
|
1027
|
+
// Python `serve_extension_static`: an anchored, symlink-free open so a link inside the extension dir cannot expose its target.
|
|
1028
|
+
const anchor = resolvePathLikePython(root);
|
|
1029
|
+
let file = resolve(anchor, rel);
|
|
1030
|
+
if (!file.startsWith(anchor + sep))
|
|
1031
|
+
return null;
|
|
1032
|
+
// Python `(root / rel).resolve()`: a symlinked asset is served when its target stays inside the root, never otherwise.
|
|
1033
|
+
const real = resolvePathLikePython(file);
|
|
1034
|
+
if (real !== file) {
|
|
1035
|
+
if (!real.startsWith(anchor + sep))
|
|
1036
|
+
return null;
|
|
1037
|
+
file = real;
|
|
1038
|
+
}
|
|
1039
|
+
let fd;
|
|
1040
|
+
try {
|
|
1041
|
+
fd = openAnchoredFd(anchor, file, { wantDir: false });
|
|
1042
|
+
}
|
|
1043
|
+
catch {
|
|
1044
|
+
return null;
|
|
1045
|
+
}
|
|
1046
|
+
try {
|
|
1047
|
+
if (!fstatSync(fd).isFile())
|
|
1048
|
+
return null;
|
|
1049
|
+
const ext = file.slice(file.lastIndexOf('.') + 1).toLowerCase();
|
|
1050
|
+
const ct = EXTENSION_MIME[ext] ?? 'text/plain';
|
|
1051
|
+
return { body: readFileSync(fd), contentType: TEXT_MIME.has(ct) ? `${ct}; charset=utf-8` : ct, html: ct === 'text/html' };
|
|
1052
|
+
}
|
|
1053
|
+
catch {
|
|
1054
|
+
return null;
|
|
1055
|
+
}
|
|
1056
|
+
finally {
|
|
1057
|
+
closeSync(fd);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
/** Python `api/extension_manifests.build_manifests` (extension entries only; dashboard plugins were dropped). */
|
|
1061
|
+
async manifests() {
|
|
1062
|
+
const status = await this.status();
|
|
1063
|
+
const manifests = [];
|
|
1064
|
+
const seen = new Set();
|
|
1065
|
+
const ID = /^[a-z][a-z0-9_-]{0,63}$/;
|
|
1066
|
+
for (const entry of status.extensions) {
|
|
1067
|
+
const id = text(entry.id, 64);
|
|
1068
|
+
if (!ID.test(id) || seen.has(id))
|
|
1069
|
+
continue;
|
|
1070
|
+
seen.add(id);
|
|
1071
|
+
const rawManifest = isDict(entry.manifest) ? entry.manifest : entry;
|
|
1072
|
+
const warnings = [];
|
|
1073
|
+
let panel = null;
|
|
1074
|
+
const rawPanel = rawManifest.panel;
|
|
1075
|
+
if (rawPanel !== null && rawPanel !== undefined) {
|
|
1076
|
+
if (typeof rawPanel !== 'string' || !/^[A-Za-z0-9._/-]{1,300}$/.test(rawPanel) || rawPanel.split('/').includes('..') || rawPanel.startsWith('/'))
|
|
1077
|
+
warnings.push('panel_path_rejected');
|
|
1078
|
+
else if (!rawPanel.toLowerCase().endsWith('.html'))
|
|
1079
|
+
warnings.push('panel_not_html');
|
|
1080
|
+
else
|
|
1081
|
+
panel = `extensions/${id}/${rawPanel.replace(/^[./]+/, '')}`;
|
|
1082
|
+
}
|
|
1083
|
+
const scripts = Array.isArray(entry.scripts) ? entry.scripts : Array.isArray(rawManifest.scripts) ? rawManifest.scripts : [];
|
|
1084
|
+
const stylesheets = Array.isArray(entry.stylesheets) ? entry.stylesheets : Array.isArray(rawManifest.stylesheets) ? rawManifest.stylesheets : [];
|
|
1085
|
+
const legacy = Boolean((scripts.length || stylesheets.length) && !panel);
|
|
1086
|
+
const rawNav = isDict(rawManifest.nav) ? rawManifest.nav : {};
|
|
1087
|
+
const nav = panel ? { label: text(rawNav.label, 40) || text(entry.name ?? rawManifest.name, 40) || id, ...(text(rawNav.icon, 40) ? { icon: text(rawNav.icon, 40) } : {}) } : null;
|
|
1088
|
+
const permissions = isDict(entry.permissions) ? Object.fromEntries(Object.entries(entry.permissions).map(([k, v]) => [k, Boolean(v)])) : {};
|
|
1089
|
+
const enabledFlag = entry.effective_enabled ?? entry.enabled ?? true;
|
|
1090
|
+
const caps = (Array.isArray(rawManifest.capabilities) ? rawManifest.capabilities : []).filter((c) => typeof c === 'string' && ['settings', 'storage', 'sidecar', 'lifecycle', 'theme', 'tts', 'navigate', 'toast', 'session'].includes(c));
|
|
1091
|
+
manifests.push({ id, name: text(entry.name ?? rawManifest.name, 80) || id, version: text(entry.version ?? rawManifest.version, 40), description: text(entry.description ?? rawManifest.description, 300), source: entry.gallery_installed || entry.source === 'gallery' ? 'gallery' : 'manifest', enabled: Boolean(enabledFlag) && !legacy, panel, nav, capabilities: [...new Set(caps)], permissions, settings_schema: Array.isArray(entry.settings_schema) ? entry.settings_schema : [], theme: null, tts: null, sidecar: null, legacy_injection: legacy, warnings });
|
|
1092
|
+
}
|
|
1093
|
+
return { protocol_version: 1, manifests };
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
//# sourceMappingURL=extensions.js.map
|