@jingyi0605/codingns4dsh 0.2.1-beta.12 → 0.2.1-beta.14
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/README.en.md +5 -5
- package/README.md +6 -9
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts +1 -1
- package/data/build/dist/bootstrap/dsh-connection-adapter.d.ts.map +1 -1
- package/data/build/dist/bootstrap/index.d.ts +1 -1
- package/data/build/dist/bootstrap/index.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.d.ts.map +1 -1
- package/data/build/dist/client/account-bar.js +24 -70
- package/data/build/dist/client/account-bar.js.map +1 -1
- package/data/build/dist/client/adapter-catalog-watch.d.ts +1 -1
- package/data/build/dist/client/adapter-catalog-watch.d.ts.map +1 -1
- package/data/build/dist/client/adapter-catalog-watch.js +2 -2
- package/data/build/dist/client/adapter-catalog-watch.js.map +1 -1
- package/data/build/dist/client/bundle.js +40225 -25580
- package/data/build/dist/client/bundle.js.map +1 -1
- package/data/build/dist/client/cli-management-dialog.d.ts +21 -0
- package/data/build/dist/client/cli-management-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-dialog.js +215 -0
- package/data/build/dist/client/cli-management-dialog.js.map +1 -0
- package/data/build/dist/client/cli-management-terminal.d.ts +9 -0
- package/data/build/dist/client/cli-management-terminal.d.ts.map +1 -0
- package/data/build/dist/client/cli-management-terminal.js +30 -0
- package/data/build/dist/client/cli-management-terminal.js.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts +9 -0
- package/data/build/dist/client/cli-settings-dialog.d.ts.map +1 -0
- package/data/build/dist/client/cli-settings-dialog.js +45 -0
- package/data/build/dist/client/cli-settings-dialog.js.map +1 -0
- package/data/build/dist/client/cli-settings-rpc.js +1 -1
- package/data/build/dist/client/cli-settings-rpc.js.map +1 -1
- package/data/build/dist/client/cli-slots.d.ts +4 -0
- package/data/build/dist/client/cli-slots.d.ts.map +1 -1
- package/data/build/dist/client/cli-slots.js +26 -10
- package/data/build/dist/client/cli-slots.js.map +1 -1
- package/data/build/dist/client/client.editor-engine.js +4 -1
- package/data/build/dist/client/client.editor-engine.js.map +1 -1
- package/data/build/dist/client/client.model-catalog-cache.js +9 -1
- package/data/build/dist/client/client.model-catalog-cache.js.map +1 -1
- package/data/build/dist/client/client.native-workspace-store.js +9 -15
- package/data/build/dist/client/client.native-workspace-store.js.map +1 -1
- package/data/build/dist/client/client.primitives-adapter.js +53 -0
- package/data/build/dist/client/client.primitives-adapter.js.map +1 -1
- package/data/build/dist/client/client.session-translation.js +16 -0
- package/data/build/dist/client/client.session-translation.js.map +1 -1
- package/data/build/dist/client/client.transport.js +487 -44
- package/data/build/dist/client/client.transport.js.map +1 -1
- package/data/build/dist/client/conversation-translation-settings.d.ts +2 -1
- package/data/build/dist/client/conversation-translation-settings.d.ts.map +1 -1
- package/data/build/dist/client/conversation-translation-settings.js +7 -5
- package/data/build/dist/client/conversation-translation-settings.js.map +1 -1
- package/data/build/dist/client/desktop-assistant.js +595 -152
- package/data/build/dist/client/editor-engine.d.ts +1 -1
- package/data/build/dist/client/editor-engine.d.ts.map +1 -1
- package/data/build/dist/client/editor-engine.js +4 -1
- package/data/build/dist/client/editor-engine.js.map +1 -1
- package/data/build/dist/client/features/cli-adapters.d.ts +3 -1
- package/data/build/dist/client/features/cli-adapters.d.ts.map +1 -1
- package/data/build/dist/client/features/cli-adapters.js +183 -105
- package/data/build/dist/client/features/cli-adapters.js.map +1 -1
- package/data/build/dist/client/features/file-management.d.ts.map +1 -1
- package/data/build/dist/client/features/file-management.js +2 -0
- package/data/build/dist/client/features/file-management.js.map +1 -1
- package/data/build/dist/client/features/index.d.ts.map +1 -1
- package/data/build/dist/client/features/index.js +2 -0
- package/data/build/dist/client/features/index.js.map +1 -1
- package/data/build/dist/client/features/mobile-access.d.ts.map +1 -1
- package/data/build/dist/client/features/mobile-access.js +7 -0
- package/data/build/dist/client/features/mobile-access.js.map +1 -1
- package/data/build/dist/client/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/client/features/peer-host.js +3 -0
- package/data/build/dist/client/features/peer-host.js.map +1 -1
- package/data/build/dist/client/features/quick-apps.d.ts +3 -0
- package/data/build/dist/client/features/quick-apps.d.ts.map +1 -0
- package/data/build/dist/client/features/quick-apps.js +14 -0
- package/data/build/dist/client/features/quick-apps.js.map +1 -0
- package/data/build/dist/client/features/workspace-session-enhancement.d.ts.map +1 -1
- package/data/build/dist/client/features/workspace-session-enhancement.js +6 -0
- package/data/build/dist/client/features/workspace-session-enhancement.js.map +1 -1
- package/data/build/dist/client/git-management.d.ts.map +1 -1
- package/data/build/dist/client/git-management.js +11 -30
- package/data/build/dist/client/git-management.js.map +1 -1
- package/data/build/dist/client/git-panel-styles.d.ts +4 -0
- package/data/build/dist/client/git-panel-styles.d.ts.map +1 -1
- package/data/build/dist/client/git-panel-styles.js +14 -0
- package/data/build/dist/client/git-panel-styles.js.map +1 -1
- package/data/build/dist/client/html-workspace-files.d.ts +4 -0
- package/data/build/dist/client/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/client/html-workspace-files.js +114 -0
- package/data/build/dist/client/html-workspace-files.js.map +1 -0
- package/data/build/dist/client/locale.d.ts.map +1 -1
- package/data/build/dist/client/locale.js +14 -0
- package/data/build/dist/client/locale.js.map +1 -1
- package/data/build/dist/client/locales/cliManagement.d.ts +3 -0
- package/data/build/dist/client/locales/cliManagement.d.ts.map +1 -0
- package/data/build/dist/client/locales/cliManagement.js +155 -0
- package/data/build/dist/client/locales/cliManagement.js.map +1 -0
- package/data/build/dist/client/locales/fileWorkspace.d.ts.map +1 -1
- package/data/build/dist/client/locales/fileWorkspace.js +4 -0
- package/data/build/dist/client/locales/fileWorkspace.js.map +1 -1
- package/data/build/dist/client/locales/panels.js +2 -2
- package/data/build/dist/client/locales/panels.js.map +1 -1
- package/data/build/dist/client/locales/quickApps.d.ts +132 -0
- package/data/build/dist/client/locales/quickApps.d.ts.map +1 -0
- package/data/build/dist/client/locales/quickApps.js +154 -0
- package/data/build/dist/client/locales/quickApps.js.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts +14 -0
- package/data/build/dist/client/mobile-team-panel-dom.d.ts.map +1 -0
- package/data/build/dist/client/mobile-team-panel-dom.js +164 -0
- package/data/build/dist/client/mobile-team-panel-dom.js.map +1 -0
- package/data/build/dist/client/native-model-translation-menu.d.ts.map +1 -1
- package/data/build/dist/client/native-model-translation-menu.js +3 -1
- package/data/build/dist/client/native-model-translation-menu.js.map +1 -1
- package/data/build/dist/client/provider-icons.d.ts.map +1 -1
- package/data/build/dist/client/provider-icons.js +3 -1
- package/data/build/dist/client/provider-icons.js.map +1 -1
- package/data/build/dist/client/quick-apps/browser-storage.d.ts +24 -0
- package/data/build/dist/client/quick-apps/browser-storage.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/browser-storage.js +114 -0
- package/data/build/dist/client/quick-apps/browser-storage.js.map +1 -0
- package/data/build/dist/client/quick-apps/client.d.ts +31 -0
- package/data/build/dist/client/quick-apps/client.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/client.js +68 -0
- package/data/build/dist/client/quick-apps/client.js.map +1 -0
- package/data/build/dist/client/quick-apps/document.d.ts +26 -0
- package/data/build/dist/client/quick-apps/document.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/document.js +110 -0
- package/data/build/dist/client/quick-apps/document.js.map +1 -0
- package/data/build/dist/client/quick-apps/file-picker.d.ts +14 -0
- package/data/build/dist/client/quick-apps/file-picker.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/file-picker.js +51 -0
- package/data/build/dist/client/quick-apps/file-picker.js.map +1 -0
- package/data/build/dist/client/quick-apps/launcher.d.ts +7 -0
- package/data/build/dist/client/quick-apps/launcher.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/launcher.js +252 -0
- package/data/build/dist/client/quick-apps/launcher.js.map +1 -0
- package/data/build/dist/client/quick-apps/presentation.d.ts +16 -0
- package/data/build/dist/client/quick-apps/presentation.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/presentation.js +31 -0
- package/data/build/dist/client/quick-apps/presentation.js.map +1 -0
- package/data/build/dist/client/quick-apps/reorder-animation.d.ts +6 -0
- package/data/build/dist/client/quick-apps/reorder-animation.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/reorder-animation.js +50 -0
- package/data/build/dist/client/quick-apps/reorder-animation.js.map +1 -0
- package/data/build/dist/client/quick-apps/reorder.d.ts +26 -0
- package/data/build/dist/client/quick-apps/reorder.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/reorder.js +128 -0
- package/data/build/dist/client/quick-apps/reorder.js.map +1 -0
- package/data/build/dist/client/quick-apps/styles.d.ts +3 -0
- package/data/build/dist/client/quick-apps/styles.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/styles.js +143 -0
- package/data/build/dist/client/quick-apps/styles.js.map +1 -0
- package/data/build/dist/client/quick-apps/ui.d.ts +20 -0
- package/data/build/dist/client/quick-apps/ui.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/ui.js +21 -0
- package/data/build/dist/client/quick-apps/ui.js.map +1 -0
- package/data/build/dist/client/quick-apps/viewer.d.ts +16 -0
- package/data/build/dist/client/quick-apps/viewer.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/viewer.js +165 -0
- package/data/build/dist/client/quick-apps/viewer.js.map +1 -0
- package/data/build/dist/client/quick-apps/workspace-picker.d.ts +19 -0
- package/data/build/dist/client/quick-apps/workspace-picker.d.ts.map +1 -0
- package/data/build/dist/client/quick-apps/workspace-picker.js +30 -0
- package/data/build/dist/client/quick-apps/workspace-picker.js.map +1 -0
- package/data/build/dist/client/session-translation-chat.d.ts +1 -1
- package/data/build/dist/client/session-translation-chat.d.ts.map +1 -1
- package/data/build/dist/client/session-translation-chat.js +26 -22
- package/data/build/dist/client/session-translation-chat.js.map +1 -1
- package/data/build/dist/client/sidebar-footer-style.d.ts +13 -0
- package/data/build/dist/client/sidebar-footer-style.d.ts.map +1 -0
- package/data/build/dist/client/sidebar-footer-style.js +54 -0
- package/data/build/dist/client/sidebar-footer-style.js.map +1 -0
- package/data/build/dist/client/style.css +219 -219
- package/data/build/dist/client/terminal/model.d.ts.map +1 -1
- package/data/build/dist/client/terminal/model.js +2 -1
- package/data/build/dist/client/terminal/model.js.map +1 -1
- package/data/build/dist/client/workspace-session-rightbar-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-rightbar-dom.js +12 -21
- package/data/build/dist/client/workspace-session-rightbar-dom.js.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts +3 -0
- package/data/build/dist/client/workspace-session-visibility-dom.d.ts.map +1 -1
- package/data/build/dist/client/workspace-session-visibility-dom.js +5 -4
- package/data/build/dist/client/workspace-session-visibility-dom.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts +4 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js +8 -0
- package/data/build/dist/dsh-capabilities/client/composer-slot-selectors.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts +18 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js +21 -0
- package/data/build/dist/dsh-capabilities/client/primitives-adapter.js.map +1 -1
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts +18 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js +11 -0
- package/data/build/dist/dsh-capabilities/client/quick-app-footer-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts +8 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +100 -0
- package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts +3 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js +22 -0
- package/data/build/dist/dsh-capabilities/client/sidebar-footer-icon-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts +52 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js +109 -0
- package/data/build/dist/dsh-capabilities/host/agent-team-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts +11 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js +97 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-credentials.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts +36 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js +164 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-https-provider.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts +44 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js +240 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-lan-ports.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts +37 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js +35 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-origin-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts +13 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js +30 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts +21 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js +132 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-proxy-provider.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts +10 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.js +33 -0
- package/data/build/dist/dsh-capabilities/host/quick-app-transport.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts +7 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js +18 -0
- package/data/build/dist/dsh-capabilities/host/session-performance-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts +13 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.d.ts.map +1 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js +24 -0
- package/data/build/dist/dsh-capabilities/host/workspace-directory-adapter.js.map +1 -0
- package/data/build/dist/dsh-capabilities/matrix.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/matrix.js +16 -8
- package/data/build/dist/dsh-capabilities/matrix.js.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.d.ts +1 -0
- package/data/build/dist/dsh-capabilities/routes.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/routes.js +27 -6
- package/data/build/dist/dsh-capabilities/routes.js.map +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts +1 -1
- package/data/build/dist/dsh-capabilities/types.d.ts.map +1 -1
- package/data/build/dist/dsh-capabilities/types.js.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js +6 -3
- package/data/build/dist/host/cli-adapters/acp-cli-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/binary-detection.js +7 -3
- package/data/build/dist/host/cli-adapters/binary-detection.js.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/claude-driver.js +183 -20
- package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts +18 -0
- package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-driver.js +110 -11
- package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts +91 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js +8 -0
- package/data/build/dist/host/cli-adapters/codex-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts +16 -0
- package/data/build/dist/host/cli-adapters/codex-performance.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js +81 -0
- package/data/build/dist/host/cli-adapters/codex-performance.js.map +1 -0
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js +11 -1
- package/data/build/dist/host/cli-adapters/command-code-acp-loader.js.map +1 -1
- package/data/build/dist/host/cli-adapters/command-code-driver.js +3 -2
- package/data/build/dist/host/cli-adapters/command-code-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts +3 -1
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js +41 -4
- package/data/build/dist/host/cli-adapters/desktop-app-runtime.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js +19 -5
- package/data/build/dist/host/cli-adapters/dsh-message-projector.js.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js +3 -2
- package/data/build/dist/host/cli-adapters/dsh-virtual-providers.js.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/feature.js +164 -34
- package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/gemini-driver.js +4 -2
- package/data/build/dist/host/cli-adapters/gemini-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts +6 -0
- package/data/build/dist/host/cli-adapters/grok-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-driver.js +327 -30
- package/data/build/dist/host/cli-adapters/grok-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts +123 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js +48 -0
- package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts +45 -0
- package/data/build/dist/host/cli-adapters/grok-usage.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js +197 -0
- package/data/build/dist/host/cli-adapters/grok-usage.js.map +1 -0
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +20 -3
- package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
- package/data/build/dist/host/cli-adapters/management-installation.d.ts +5 -0
- package/data/build/dist/host/cli-adapters/management-installation.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-installation.js +131 -0
- package/data/build/dist/host/cli-adapters/management-installation.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts +37 -0
- package/data/build/dist/host/cli-adapters/management-methods.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-methods.js +144 -0
- package/data/build/dist/host/cli-adapters/management-methods.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts +7 -0
- package/data/build/dist/host/cli-adapters/management-process.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management-process.js +62 -0
- package/data/build/dist/host/cli-adapters/management-process.js.map +1 -0
- package/data/build/dist/host/cli-adapters/management.d.ts +32 -0
- package/data/build/dist/host/cli-adapters/management.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/management.js +177 -0
- package/data/build/dist/host/cli-adapters/management.js.map +1 -0
- package/data/build/dist/host/cli-adapters/mcode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/mcode-driver.js +11 -4
- package/data/build/dist/host/cli-adapters/mcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts +1 -0
- package/data/build/dist/host/cli-adapters/model-catalog.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/model-catalog.js +62 -0
- package/data/build/dist/host/cli-adapters/model-catalog.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js +11 -3
- package/data/build/dist/host/cli-adapters/native-subagent-dispatch.js.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts +7 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/native-team-subagent.js +4 -2
- package/data/build/dist/host/cli-adapters/native-team-subagent.js.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts +22 -0
- package/data/build/dist/host/cli-adapters/opencode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/opencode-driver.js +105 -17
- package/data/build/dist/host/cli-adapters/opencode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.d.ts +2 -0
- package/data/build/dist/host/cli-adapters/process-utils.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/process-utils.js +16 -11
- package/data/build/dist/host/cli-adapters/process-utils.js.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts +7 -1
- package/data/build/dist/host/cli-adapters/registry.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/registry.js +98 -30
- package/data/build/dist/host/cli-adapters/registry.js.map +1 -1
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts +74 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js +83 -0
- package/data/build/dist/host/cli-adapters/session-performance-projection.js.map +1 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js +4 -0
- package/data/build/dist/host/cli-adapters/standard-stream-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts +3 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/stream-normalizer.js +2 -0
- package/data/build/dist/host/cli-adapters/stream-normalizer.js.map +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool.js +1 -1
- package/data/build/dist/host/cli-adapters/subagent-tool.js.map +1 -1
- package/data/build/dist/host/cli-adapters/team-input.d.ts +17 -0
- package/data/build/dist/host/cli-adapters/team-input.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/team-input.js +67 -0
- package/data/build/dist/host/cli-adapters/team-input.js.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts +34 -0
- package/data/build/dist/host/cli-adapters/update-check.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/update-check.js +263 -0
- package/data/build/dist/host/cli-adapters/update-check.js.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-driver.d.ts.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js +6 -1
- package/data/build/dist/host/cli-adapters/zcode-driver.js.map +1 -1
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts +8 -0
- package/data/build/dist/host/cli-adapters/zcode-update.d.ts.map +1 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js +149 -0
- package/data/build/dist/host/cli-adapters/zcode-update.js.map +1 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts +14 -0
- package/data/build/dist/host/cli-bridge/bridge-holder.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-holder.js +53 -6
- package/data/build/dist/host/cli-bridge/bridge-holder.js.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts +4 -0
- package/data/build/dist/host/cli-bridge/bridge-server.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/bridge-server.js +34 -6
- package/data/build/dist/host/cli-bridge/bridge-server.js.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/command-code-mod.js +43 -0
- package/data/build/dist/host/cli-bridge/command-code-mod.js.map +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js +1 -1
- package/data/build/dist/host/cli-bridge/dispatch.js.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/injections.d.ts.map +1 -1
- package/data/build/dist/host/cli-bridge/injections.js +23 -7
- package/data/build/dist/host/cli-bridge/injections.js.map +1 -1
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js +22 -3
- package/data/build/dist/host/cli-bridge/mcp-stdio-entry.js.map +1 -1
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts +11 -0
- package/data/build/dist/host/cli-bridge/team-adapters.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js +22 -0
- package/data/build/dist/host/cli-bridge/team-adapters.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts +28 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js +208 -0
- package/data/build/dist/host/cli-bridge/team-dispatch.js.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts +3 -0
- package/data/build/dist/host/cli-bridge/team-tool.d.ts.map +1 -0
- package/data/build/dist/host/cli-bridge/team-tool.js +18 -0
- package/data/build/dist/host/cli-bridge/team-tool.js.map +1 -0
- package/data/build/dist/host/features/file-management.d.ts.map +1 -1
- package/data/build/dist/host/features/file-management.js +8 -0
- package/data/build/dist/host/features/file-management.js.map +1 -1
- package/data/build/dist/host/features/index.d.ts.map +1 -1
- package/data/build/dist/host/features/index.js +2 -0
- package/data/build/dist/host/features/index.js.map +1 -1
- package/data/build/dist/host/features/lan-access-dsh.js +1 -1
- package/data/build/dist/host/features/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/features/peer-host.d.ts.map +1 -1
- package/data/build/dist/host/features/peer-host.js +7 -0
- package/data/build/dist/host/features/peer-host.js.map +1 -1
- package/data/build/dist/host/features/quick-apps.d.ts +4 -0
- package/data/build/dist/host/features/quick-apps.d.ts.map +1 -0
- package/data/build/dist/host/features/quick-apps.js +158 -0
- package/data/build/dist/host/features/quick-apps.js.map +1 -0
- package/data/build/dist/host/features/session-prompt-translation.d.ts +1 -1
- package/data/build/dist/host/features/session-prompt-translation.d.ts.map +1 -1
- package/data/build/dist/host/features/session-prompt-translation.js +13 -4
- package/data/build/dist/host/features/session-prompt-translation.js.map +1 -1
- package/data/build/dist/host/features/session-translation-protection.d.ts +6 -0
- package/data/build/dist/host/features/session-translation-protection.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-protection.js +21 -0
- package/data/build/dist/host/features/session-translation-protection.js.map +1 -1
- package/data/build/dist/host/features/session-translation-recovery.d.ts +3 -2
- package/data/build/dist/host/features/session-translation-recovery.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-recovery.js +6 -3
- package/data/build/dist/host/features/session-translation-recovery.js.map +1 -1
- package/data/build/dist/host/features/session-translation-service.d.ts +3 -0
- package/data/build/dist/host/features/session-translation-service.d.ts.map +1 -1
- package/data/build/dist/host/features/session-translation-service.js +14 -8
- package/data/build/dist/host/features/session-translation-service.js.map +1 -1
- package/data/build/dist/host/features/types.d.ts +10 -0
- package/data/build/dist/host/features/types.d.ts.map +1 -1
- package/data/build/dist/host/html-workspace-files.d.ts +3 -0
- package/data/build/dist/host/html-workspace-files.d.ts.map +1 -0
- package/data/build/dist/host/html-workspace-files.js +135 -0
- package/data/build/dist/host/html-workspace-files.js.map +1 -0
- package/data/build/dist/host/index.d.ts.map +1 -1
- package/data/build/dist/host/index.js +27 -2
- package/data/build/dist/host/index.js.map +1 -1
- package/data/build/dist/host/lan-access-dsh.d.ts +5 -1
- package/data/build/dist/host/lan-access-dsh.d.ts.map +1 -1
- package/data/build/dist/host/lan-access-dsh.js +43 -2
- package/data/build/dist/host/lan-access-dsh.js.map +1 -1
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts +5 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.d.ts.map +1 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.js +27 -0
- package/data/build/dist/host/modules/peer-host/quick-app-gateway.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/browse.d.ts +5 -0
- package/data/build/dist/host/modules/quick-apps/browse.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/browse.js +37 -0
- package/data/build/dist/host/modules/quick-apps/browse.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.d.ts +4 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.js +39 -0
- package/data/build/dist/host/modules/quick-apps/code-revision.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/documents.d.ts +14 -0
- package/data/build/dist/host/modules/quick-apps/documents.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/documents.js +87 -0
- package/data/build/dist/host/modules/quick-apps/documents.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/errors.d.ts +8 -0
- package/data/build/dist/host/modules/quick-apps/errors.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/errors.js +15 -0
- package/data/build/dist/host/modules/quick-apps/errors.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/file-api.d.ts +30 -0
- package/data/build/dist/host/modules/quick-apps/file-api.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/file-api.js +149 -0
- package/data/build/dist/host/modules/quick-apps/file-api.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/launches.d.ts +35 -0
- package/data/build/dist/host/modules/quick-apps/launches.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/launches.js +80 -0
- package/data/build/dist/host/modules/quick-apps/launches.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/paths.d.ts +14 -0
- package/data/build/dist/host/modules/quick-apps/paths.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/paths.js +72 -0
- package/data/build/dist/host/modules/quick-apps/paths.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/registry.d.ts +30 -0
- package/data/build/dist/host/modules/quick-apps/registry.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/registry.js +186 -0
- package/data/build/dist/host/modules/quick-apps/registry.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/remote.d.ts +38 -0
- package/data/build/dist/host/modules/quick-apps/remote.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/remote.js +238 -0
- package/data/build/dist/host/modules/quick-apps/remote.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/service.d.ts +27 -0
- package/data/build/dist/host/modules/quick-apps/service.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/service.js +174 -0
- package/data/build/dist/host/modules/quick-apps/service.js.map +1 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.d.ts +8 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.d.ts.map +1 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.js +190 -0
- package/data/build/dist/host/modules/quick-apps/static-handler.js.map +1 -0
- package/data/build/dist/host/native-session-bridge.d.ts +5 -0
- package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
- package/data/build/dist/host/native-session-bridge.js +3 -0
- package/data/build/dist/host/native-session-bridge.js.map +1 -1
- package/data/build/dist/host/rpc.d.ts.map +1 -1
- package/data/build/dist/host/rpc.js +8 -3
- package/data/build/dist/host/rpc.js.map +1 -1
- package/data/build/dist/host/session-migration-repair.js +48 -35
- package/data/build/dist/host/session-migration-repair.js.map +1 -1
- package/data/build/dist/host/settings.d.ts.map +1 -1
- package/data/build/dist/host/settings.js +13 -0
- package/data/build/dist/host/settings.js.map +1 -1
- package/data/build/dist/host/workspace-file-mutations.d.ts +2 -0
- package/data/build/dist/host/workspace-file-mutations.d.ts.map +1 -0
- package/data/build/dist/host/workspace-file-mutations.js +15 -0
- package/data/build/dist/host/workspace-file-mutations.js.map +1 -0
- package/data/build/dist/shared/cli-provider-route.d.ts +7 -0
- package/data/build/dist/shared/cli-provider-route.d.ts.map +1 -0
- package/data/build/dist/shared/cli-provider-route.js +13 -0
- package/data/build/dist/shared/cli-provider-route.js.map +1 -0
- package/data/build/dist/shared/codex-performance.d.ts +3 -0
- package/data/build/dist/shared/codex-performance.d.ts.map +1 -0
- package/data/build/dist/shared/codex-performance.js +2 -0
- package/data/build/dist/shared/codex-performance.js.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts +14 -0
- package/data/build/dist/shared/contracts/agent-team.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/agent-team.js +48 -0
- package/data/build/dist/shared/contracts/agent-team.js.map +1 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts +35 -0
- package/data/build/dist/shared/contracts/cli-adapter.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/cli-management.d.ts +29 -0
- package/data/build/dist/shared/contracts/cli-management.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/cli-management.js +2 -0
- package/data/build/dist/shared/contracts/cli-management.js.map +1 -0
- package/data/build/dist/shared/contracts/config.d.ts +2 -0
- package/data/build/dist/shared/contracts/config.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/config.js.map +1 -1
- package/data/build/dist/shared/contracts/errors.d.ts +2 -2
- package/data/build/dist/shared/contracts/errors.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/quick-apps.d.ts +68 -0
- package/data/build/dist/shared/contracts/quick-apps.d.ts.map +1 -0
- package/data/build/dist/shared/contracts/quick-apps.js +4 -0
- package/data/build/dist/shared/contracts/quick-apps.js.map +1 -0
- package/data/build/dist/shared/contracts/session-translation.d.ts +8 -3
- package/data/build/dist/shared/contracts/session-translation.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/session-translation.js +14 -0
- package/data/build/dist/shared/contracts/session-translation.js.map +1 -1
- package/data/build/dist/shared/contracts/version.d.ts +9 -15
- package/data/build/dist/shared/contracts/version.d.ts.map +1 -1
- package/data/build/dist/shared/contracts/version.js +8 -14
- package/data/build/dist/shared/contracts/version.js.map +1 -1
- package/data/build/dist/shared/peer-host-http-routes.d.ts +4 -0
- package/data/build/dist/shared/peer-host-http-routes.d.ts.map +1 -1
- package/data/build/dist/shared/peer-host-http-routes.js +4 -0
- package/data/build/dist/shared/peer-host-http-routes.js.map +1 -1
- package/data/build/dist/shared/quick-app-browser-storage.d.ts +33 -0
- package/data/build/dist/shared/quick-app-browser-storage.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-browser-storage.js +33 -0
- package/data/build/dist/shared/quick-app-browser-storage.js.map +1 -0
- package/data/build/dist/shared/quick-app-proxy-path.d.ts +6 -0
- package/data/build/dist/shared/quick-app-proxy-path.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-proxy-path.js +18 -0
- package/data/build/dist/shared/quick-app-proxy-path.js.map +1 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.d.ts +9 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.d.ts.map +1 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.js +186 -0
- package/data/build/dist/shared/quick-app-storage-bootstrap.js.map +1 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts +7 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.d.ts.map +1 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.js +10 -0
- package/data/build/dist/shared/quick-apps-bootstrap-locale.js.map +1 -0
- package/data/build/dist/shared/request-performance.d.ts +15 -0
- package/data/build/dist/shared/request-performance.d.ts.map +1 -0
- package/data/build/dist/shared/request-performance.js +3 -0
- package/data/build/dist/shared/request-performance.js.map +1 -0
- package/package.json +32 -32
- package/profile/README.md +2 -2
- package/profile/package.json +3 -3
- package/profile/version.json +3 -3
- package/version.json +3 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { QuickAppLaunch, QuickAppLaunches } from './launches.js';
|
|
2
|
+
export declare function readVersionedText(path: string): Promise<{
|
|
3
|
+
content: string;
|
|
4
|
+
version: string;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function tooLarge(): never;
|
|
7
|
+
/** Global physical-file ordering with per-service pending work for lifecycle cleanup. */
|
|
8
|
+
export declare class QuickAppFileApi {
|
|
9
|
+
private readonly launches;
|
|
10
|
+
private readonly mutations;
|
|
11
|
+
constructor(launches: QuickAppLaunches);
|
|
12
|
+
private target;
|
|
13
|
+
read(launch: QuickAppLaunch, path: string): Promise<{
|
|
14
|
+
content: string;
|
|
15
|
+
version: string;
|
|
16
|
+
}>;
|
|
17
|
+
list(launch: QuickAppLaunch, path: string): Promise<{
|
|
18
|
+
items: readonly {
|
|
19
|
+
name: string;
|
|
20
|
+
kind: string;
|
|
21
|
+
}[];
|
|
22
|
+
}>;
|
|
23
|
+
mutate(launch: QuickAppLaunch, method: 'PUT' | 'DELETE', path: string, content: string, ifMatch?: string, ifNoneMatch?: string, signal?: AbortSignal): Promise<{
|
|
24
|
+
ok: true;
|
|
25
|
+
version?: string;
|
|
26
|
+
}>;
|
|
27
|
+
drain(): Promise<void>;
|
|
28
|
+
get pending(): number;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=file-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-api.d.ts","sourceRoot":"","sources":["../../../../../../src/host/modules/quick-apps/file-api.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAMrE,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBnG;AAED,wBAAgB,QAAQ,IAAI,KAAK,CAAoF;AAErH,yFAAyF;AACzF,qBAAa,eAAe;IAEd,OAAO,CAAC,QAAQ,CAAC,QAAQ;IADrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA8B;gBAC3B,QAAQ,EAAE,gBAAgB;YAEzC,MAAM;IAQd,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAKzF,IAAI,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,SAAS;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,EAAE,CAAA;KAAE,CAAC;IAUzG,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,GAAG,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAgD9L,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAC5B,IAAI,OAAO,IAAI,MAAM,CAA+B;CACrD"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { constants } from 'node:fs';
|
|
3
|
+
import { link, open, opendir, rename, stat, unlink } from 'node:fs/promises';
|
|
4
|
+
import { basename, dirname, join } from 'node:path';
|
|
5
|
+
import { QUICK_APP_LIMITS } from '../../../shared/contracts/quick-apps.js';
|
|
6
|
+
import { appPath, publicPath, resolveAppPath, withinScope } from './paths.js';
|
|
7
|
+
import { conflict, deny, QuickAppError } from './errors.js';
|
|
8
|
+
import { serializeWorkspaceMutation } from '../../workspace-file-mutations.js';
|
|
9
|
+
export async function readVersionedText(path) {
|
|
10
|
+
const file = await open(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
11
|
+
try {
|
|
12
|
+
const info = await file.stat();
|
|
13
|
+
if (!info.isFile())
|
|
14
|
+
deny('Only regular text files are supported.');
|
|
15
|
+
if (info.size > QUICK_APP_LIMITS.textBytes)
|
|
16
|
+
tooLarge();
|
|
17
|
+
const bytes = Buffer.alloc(QUICK_APP_LIMITS.textBytes + 1);
|
|
18
|
+
let length = 0;
|
|
19
|
+
while (length < bytes.length) {
|
|
20
|
+
const read = await file.read(bytes, length, bytes.length - length, length);
|
|
21
|
+
if (!read.bytesRead)
|
|
22
|
+
break;
|
|
23
|
+
length += read.bytesRead;
|
|
24
|
+
}
|
|
25
|
+
if (length > QUICK_APP_LIMITS.textBytes)
|
|
26
|
+
tooLarge();
|
|
27
|
+
const after = await file.stat();
|
|
28
|
+
if (after.mtimeMs !== info.mtimeMs || after.ctimeMs !== info.ctimeMs || after.size !== info.size)
|
|
29
|
+
conflict();
|
|
30
|
+
let content;
|
|
31
|
+
try {
|
|
32
|
+
content = new TextDecoder('utf-8', { fatal: true }).decode(bytes.subarray(0, length));
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
deny('The file is not UTF-8 text.');
|
|
36
|
+
}
|
|
37
|
+
const version = `"${createHash('sha256').update(bytes.subarray(0, length)).update(`${info.ino}:${info.mtimeMs}:${info.ctimeMs}`).digest('hex')}"`;
|
|
38
|
+
return { content, version };
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
await file.close();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
export function tooLarge() { throw new QuickAppError(413, 'QUICK_APP_TOO_LARGE', 'The text limit is 4 MiB.'); }
|
|
45
|
+
/** Global physical-file ordering with per-service pending work for lifecycle cleanup. */
|
|
46
|
+
export class QuickAppFileApi {
|
|
47
|
+
launches;
|
|
48
|
+
mutations = new Set();
|
|
49
|
+
constructor(launches) {
|
|
50
|
+
this.launches = launches;
|
|
51
|
+
}
|
|
52
|
+
async target(launch, operation, path, missing = false) {
|
|
53
|
+
await this.launches.validateWorkspace(launch);
|
|
54
|
+
await launch.validateCode?.();
|
|
55
|
+
this.launches.authorize(launch);
|
|
56
|
+
const normalized = appPath(path);
|
|
57
|
+
if (!publicPath(normalized) || !launch.permissions[operation].some(scope => withinScope(scope, normalized)))
|
|
58
|
+
deny();
|
|
59
|
+
return resolveAppPath(launch.workspaceRoot, normalized, missing);
|
|
60
|
+
}
|
|
61
|
+
async read(launch, path) {
|
|
62
|
+
const result = await readVersionedText(await this.target(launch, 'read', path));
|
|
63
|
+
this.launches.authorize(launch);
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
async list(launch, path) {
|
|
67
|
+
const directory = await opendir(await this.target(launch, 'read', path));
|
|
68
|
+
const items = [];
|
|
69
|
+
for await (const item of directory) {
|
|
70
|
+
this.launches.authorize(launch);
|
|
71
|
+
if (items.length >= 1000)
|
|
72
|
+
throw new QuickAppError(413, 'QUICK_APP_TOO_LARGE', 'Directory listing exceeds 1000 entries.');
|
|
73
|
+
if (!item.isSymbolicLink() && publicPath(item.name) && (item.isFile() || item.isDirectory()))
|
|
74
|
+
items.push({ name: item.name, kind: item.isFile() ? 'file' : 'directory' });
|
|
75
|
+
}
|
|
76
|
+
return { items };
|
|
77
|
+
}
|
|
78
|
+
async mutate(launch, method, path, content, ifMatch, ifNoneMatch, signal) {
|
|
79
|
+
if (Buffer.byteLength(content) > QUICK_APP_LIMITS.textBytes)
|
|
80
|
+
tooLarge();
|
|
81
|
+
const create = method === 'PUT' && ifNoneMatch === '*';
|
|
82
|
+
if ((create && ifMatch !== undefined) || (!create && (!ifMatch || ifMatch === '*' || ifNoneMatch !== undefined))) {
|
|
83
|
+
throw new QuickAppError(428, 'QUICK_APP_PRECONDITION_REQUIRED', 'Use the exact If-Match version, or If-None-Match: * to create a new file.');
|
|
84
|
+
}
|
|
85
|
+
const operation = method === 'DELETE' ? 'delete' : 'write';
|
|
86
|
+
const key = await this.target(launch, operation, path, create);
|
|
87
|
+
const next = serializeWorkspaceMutation(key, async () => {
|
|
88
|
+
signal?.throwIfAborted();
|
|
89
|
+
const target = await this.target(launch, operation, path, create);
|
|
90
|
+
if (target !== key)
|
|
91
|
+
deny();
|
|
92
|
+
if (!create && (await readVersionedText(target)).version !== ifMatch)
|
|
93
|
+
conflict();
|
|
94
|
+
if (method === 'DELETE') {
|
|
95
|
+
await this.target(launch, operation, path);
|
|
96
|
+
if ((await readVersionedText(target)).version !== ifMatch)
|
|
97
|
+
conflict();
|
|
98
|
+
signal?.throwIfAborted();
|
|
99
|
+
this.launches.authorize(launch);
|
|
100
|
+
await unlink(target);
|
|
101
|
+
return { ok: true };
|
|
102
|
+
}
|
|
103
|
+
// Parent directories must already exist. Never recursively create through an unvalidated ancestor.
|
|
104
|
+
const temporary = join(dirname(target), `.${basename(target)}.quickapp-${randomUUID()}`);
|
|
105
|
+
const mode = create ? 0o600 : (await stat(target)).mode & 0o777;
|
|
106
|
+
const file = await open(temporary, constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | constants.O_NOFOLLOW, mode);
|
|
107
|
+
try {
|
|
108
|
+
await file.writeFile(content, 'utf8');
|
|
109
|
+
await file.sync();
|
|
110
|
+
await file.close();
|
|
111
|
+
await this.target(launch, operation, path, create);
|
|
112
|
+
if (!create && (await readVersionedText(target)).version !== ifMatch)
|
|
113
|
+
conflict();
|
|
114
|
+
signal?.throwIfAborted();
|
|
115
|
+
this.launches.authorize(launch);
|
|
116
|
+
if (create) {
|
|
117
|
+
try {
|
|
118
|
+
await link(temporary, target);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (error.code === 'EEXIST')
|
|
122
|
+
conflict();
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
// Removing the temporary hard link changes ctime. Return the version only after that cleanup.
|
|
126
|
+
await unlink(temporary);
|
|
127
|
+
}
|
|
128
|
+
else
|
|
129
|
+
await rename(temporary, target);
|
|
130
|
+
return { ok: true, version: (await readVersionedText(target)).version };
|
|
131
|
+
}
|
|
132
|
+
finally {
|
|
133
|
+
await file.close().catch(() => undefined);
|
|
134
|
+
await unlink(temporary).catch(error => { if (error.code !== 'ENOENT')
|
|
135
|
+
throw error; });
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
this.mutations.add(next);
|
|
139
|
+
try {
|
|
140
|
+
return await next;
|
|
141
|
+
}
|
|
142
|
+
finally {
|
|
143
|
+
this.mutations.delete(next);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async drain() { await Promise.allSettled(this.mutations); }
|
|
147
|
+
get pending() { return this.mutations.size; }
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=file-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-api.js","sourceRoot":"","sources":["../../../../../../src/host/modules/quick-apps/file-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAC5E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAC1E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7E,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAA;AAE9E,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,IAAY;IAClD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;IACxE,IAAI,CAAC;QACH,MAAM,IAAI,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,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { QuickApp, QuickAppPermissions } from '../../../shared/contracts/quick-apps.js';
|
|
2
|
+
import { type QuickAppRegistry } from './registry.js';
|
|
3
|
+
export interface QuickAppLaunch {
|
|
4
|
+
readonly id: string;
|
|
5
|
+
readonly app: QuickApp;
|
|
6
|
+
readonly principal: string;
|
|
7
|
+
readonly workspaceRoot: string;
|
|
8
|
+
readonly workspaceReference: string;
|
|
9
|
+
permissions: QuickAppPermissions;
|
|
10
|
+
readonly expiresAt: number;
|
|
11
|
+
readonly credentialDigest: Buffer;
|
|
12
|
+
readonly abort: AbortController;
|
|
13
|
+
dispose: () => Promise<void>;
|
|
14
|
+
validateCode?: () => Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare class QuickAppLaunches {
|
|
17
|
+
private readonly registry;
|
|
18
|
+
private readonly now;
|
|
19
|
+
private readonly launches;
|
|
20
|
+
private stopped;
|
|
21
|
+
constructor(registry: QuickAppRegistry, now?: () => number);
|
|
22
|
+
create(app: QuickApp, principal: string, permissions: QuickAppPermissions): Promise<{
|
|
23
|
+
launch: QuickAppLaunch;
|
|
24
|
+
credential: string;
|
|
25
|
+
}>;
|
|
26
|
+
authorize(launch: QuickAppLaunch, credential?: string): void;
|
|
27
|
+
validateWorkspace(launch: QuickAppLaunch): Promise<void>;
|
|
28
|
+
requireOwner(id: string, principal: string): QuickAppLaunch;
|
|
29
|
+
revoke(id: string): Promise<void>;
|
|
30
|
+
revokeApp(id: string): Promise<void>;
|
|
31
|
+
prune(): Promise<void>;
|
|
32
|
+
dispose(): Promise<void>;
|
|
33
|
+
get size(): number;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=launches.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launches.d.ts","sourceRoot":"","sources":["../../../../../../src/host/modules/quick-apps/launches.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,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AE,SAAS,EAAE,MAAM,GAAG,cAAc;IAKrD,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjC,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IACpC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IACtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAC9B,IAAI,IAAI,IAAI,MAAM,CAA8B;CACjD"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { createHash, randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
|
|
2
|
+
import { realpath } from 'node:fs/promises';
|
|
3
|
+
import { QUICK_APP_LIMITS } from '../../../shared/contracts/quick-apps.js';
|
|
4
|
+
import { quickAppDefinitionKey } from './registry.js';
|
|
5
|
+
import { deny, QuickAppError } from './errors.js';
|
|
6
|
+
export class QuickAppLaunches {
|
|
7
|
+
registry;
|
|
8
|
+
now;
|
|
9
|
+
launches = new Map();
|
|
10
|
+
stopped = false;
|
|
11
|
+
constructor(registry, now = Date.now) {
|
|
12
|
+
this.registry = registry;
|
|
13
|
+
this.now = now;
|
|
14
|
+
}
|
|
15
|
+
async create(app, principal, permissions) {
|
|
16
|
+
const workspaceReference = this.registry.root(app);
|
|
17
|
+
const workspaceRoot = await realpath(workspaceReference);
|
|
18
|
+
await this.prune();
|
|
19
|
+
if (this.stopped)
|
|
20
|
+
throw new QuickAppError(410, 'QUICK_APP_REVOKED', 'Quick Apps is disabled.');
|
|
21
|
+
if (this.launches.size >= QUICK_APP_LIMITS.launches)
|
|
22
|
+
throw new QuickAppError(429, 'QUICK_APP_LIMIT', 'Too many active launches.');
|
|
23
|
+
const credential = randomBytes(32).toString('base64url');
|
|
24
|
+
const launch = { id: randomUUID(), app: structuredClone(app), principal, workspaceRoot, workspaceReference,
|
|
25
|
+
permissions: structuredClone(permissions), expiresAt: this.now() + QUICK_APP_LIMITS.lifetimeMs,
|
|
26
|
+
credentialDigest: digest(credential), abort: new AbortController(), dispose: async () => undefined };
|
|
27
|
+
this.launches.set(launch.id, launch);
|
|
28
|
+
return { launch, credential };
|
|
29
|
+
}
|
|
30
|
+
authorize(launch, credential) {
|
|
31
|
+
if (credential !== undefined && !timingSafeEqual(launch.credentialDigest, digest(credential)))
|
|
32
|
+
throw new QuickAppError(401, 'QUICK_APP_UNAUTHENTICATED', 'App authentication required.');
|
|
33
|
+
if (this.stopped || this.launches.get(launch.id) !== launch || launch.abort.signal.aborted)
|
|
34
|
+
throw new QuickAppError(410, 'QUICK_APP_REVOKED', 'This launch has been revoked.');
|
|
35
|
+
if (launch.expiresAt <= this.now()) {
|
|
36
|
+
void this.revoke(launch.id).catch(() => undefined);
|
|
37
|
+
throw new QuickAppError(410, 'QUICK_APP_LAUNCH_EXPIRED', 'This launch has expired.');
|
|
38
|
+
}
|
|
39
|
+
let current;
|
|
40
|
+
try {
|
|
41
|
+
current = this.registry.get(launch.app.id);
|
|
42
|
+
this.registry.root(current);
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
void this.revoke(launch.id).catch(() => undefined);
|
|
46
|
+
throw new QuickAppError(410, 'QUICK_APP_REVOKED', 'The shortcut was removed.');
|
|
47
|
+
}
|
|
48
|
+
if (quickAppDefinitionKey(current) !== quickAppDefinitionKey(launch.app) || this.registry.root(current) !== launch.workspaceReference) {
|
|
49
|
+
void this.revoke(launch.id).catch(() => undefined);
|
|
50
|
+
throw new QuickAppError(410, 'QUICK_APP_REVOKED', 'The shortcut or workspace changed.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
async validateWorkspace(launch) {
|
|
54
|
+
this.authorize(launch);
|
|
55
|
+
if (await realpath(launch.workspaceReference) !== launch.workspaceRoot) {
|
|
56
|
+
void this.revoke(launch.id).catch(() => undefined);
|
|
57
|
+
throw new QuickAppError(410, 'QUICK_APP_REVOKED', 'The workspace location changed.');
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
requireOwner(id, principal) {
|
|
61
|
+
const launch = this.launches.get(id);
|
|
62
|
+
if (!launch || launch.principal !== principal)
|
|
63
|
+
deny();
|
|
64
|
+
return launch;
|
|
65
|
+
}
|
|
66
|
+
async revoke(id) {
|
|
67
|
+
const launch = this.launches.get(id);
|
|
68
|
+
if (!launch)
|
|
69
|
+
return;
|
|
70
|
+
this.launches.delete(id);
|
|
71
|
+
launch.abort.abort();
|
|
72
|
+
await launch.dispose();
|
|
73
|
+
}
|
|
74
|
+
async revokeApp(id) { await Promise.all([...this.launches.values()].filter(launch => launch.app.id === id).map(launch => this.revoke(launch.id))); }
|
|
75
|
+
async prune() { await Promise.all([...this.launches.values()].filter(launch => launch.expiresAt <= this.now()).map(launch => this.revoke(launch.id))); }
|
|
76
|
+
async dispose() { this.stopped = true; await Promise.all([...this.launches.keys()].map(id => this.revoke(id))); }
|
|
77
|
+
get size() { return this.launches.size; }
|
|
78
|
+
}
|
|
79
|
+
function digest(value) { return createHash('sha256').update(value).digest(); }
|
|
80
|
+
//# sourceMappingURL=launches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launches.js","sourceRoot":"","sources":["../../../../../../src/host/modules/quick-apps/launches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClF,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAE3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAA;AAC1E,OAAO,EAAE,qBAAqB,EAAyB,MAAM,eAAe,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAgBjD,MAAM,OAAO,gBAAgB;IAGE;IAA6C;IAFzD,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAA;IACrD,OAAO,GAAG,KAAK,CAAA;IACvB,YAA6B,QAA0B,EAAmB,MAAM,IAAI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** Paths have one representation on every platform; no URL decoding in filesystem code. */
|
|
2
|
+
export declare function appPath(value: unknown, allowRoot?: boolean): string;
|
|
3
|
+
export declare function insidePath(root: string, path: string): boolean;
|
|
4
|
+
export declare function withinScope(scope: string, path: string): boolean;
|
|
5
|
+
export declare function publicPath(path: string): boolean;
|
|
6
|
+
/** Reject all symlinks, including in-root aliases; this also keeps mutation queue keys unique. */
|
|
7
|
+
export declare function resolveAppPath(workspace: string, path: string, allowMissingLeaf?: boolean): Promise<string>;
|
|
8
|
+
/** Inspect the raw request target before WHATWG URL can erase traversal segments. */
|
|
9
|
+
export declare function decodeResourceTarget(target: string): {
|
|
10
|
+
path: string;
|
|
11
|
+
query: string;
|
|
12
|
+
trailingSlash: boolean;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../../../../../src/host/modules/quick-apps/paths.ts"],"names":[],"mappings":"AAIA,2FAA2F;AAC3F,wBAAgB,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,UAAO,GAAG,MAAM,CAKhE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAG9D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhE;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAGhD;AAED,kGAAkG;AAClG,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,gBAAgB,UAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,CAkB/G;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAU5G"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { lstat, realpath } from 'node:fs/promises';
|
|
2
|
+
import { isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
3
|
+
import { deny } from './errors.js';
|
|
4
|
+
/** Paths have one representation on every platform; no URL decoding in filesystem code. */
|
|
5
|
+
export function appPath(value, allowRoot = true) {
|
|
6
|
+
if (typeof value !== 'string' || value.length > 2048 || /[\\\x00-\x1f\x7f:%?#]/u.test(value))
|
|
7
|
+
deny('Invalid relative path.');
|
|
8
|
+
if (value === '.' || value === '') {
|
|
9
|
+
if (allowRoot)
|
|
10
|
+
return '';
|
|
11
|
+
deny();
|
|
12
|
+
}
|
|
13
|
+
if (value.startsWith('/') || value.endsWith('/') || value.split('/').some(part => part === '' || part === '.' || part === '..' || /[. ]$/u.test(part)))
|
|
14
|
+
deny('Invalid relative path.');
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
export function insidePath(root, path) {
|
|
18
|
+
const suffix = relative(root, path);
|
|
19
|
+
return suffix === '' || (!isAbsolute(suffix) && suffix !== '..' && !suffix.startsWith(`..${sep}`));
|
|
20
|
+
}
|
|
21
|
+
export function withinScope(scope, path) {
|
|
22
|
+
return scope === '' || path === scope || path.startsWith(`${scope}/`);
|
|
23
|
+
}
|
|
24
|
+
export function publicPath(path) {
|
|
25
|
+
return !path.split('/').some(part => part.startsWith('.') || /^(?:node_modules|id_rsa|id_ed25519)$/iu.test(part)
|
|
26
|
+
|| /(?:\.(?:pem|key|p12|pfx)|(?:^|[-_.])(?:credentials|secrets?)(?:\.|$))/iu.test(part));
|
|
27
|
+
}
|
|
28
|
+
/** Reject all symlinks, including in-root aliases; this also keeps mutation queue keys unique. */
|
|
29
|
+
export async function resolveAppPath(workspace, path, allowMissingLeaf = false) {
|
|
30
|
+
const root = await realpath(workspace);
|
|
31
|
+
const normalized = appPath(path);
|
|
32
|
+
let current = root;
|
|
33
|
+
const parts = normalized === '' ? [] : normalized.split('/');
|
|
34
|
+
for (let index = 0; index < parts.length; index++) {
|
|
35
|
+
current = join(current, parts[index]);
|
|
36
|
+
try {
|
|
37
|
+
const info = await lstat(current);
|
|
38
|
+
if (info.isSymbolicLink())
|
|
39
|
+
deny('Symbolic links are not served by Quick Apps.');
|
|
40
|
+
if (index < parts.length - 1 && !info.isDirectory())
|
|
41
|
+
deny();
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (allowMissingLeaf && index === parts.length - 1 && error.code === 'ENOENT')
|
|
45
|
+
break;
|
|
46
|
+
throw error;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!insidePath(root, resolve(current)))
|
|
50
|
+
deny();
|
|
51
|
+
return current;
|
|
52
|
+
}
|
|
53
|
+
/** Inspect the raw request target before WHATWG URL can erase traversal segments. */
|
|
54
|
+
export function decodeResourceTarget(target) {
|
|
55
|
+
if (!target.startsWith('/') || target.startsWith('//') || /[\\#\x00-\x20\x7f]/u.test(target))
|
|
56
|
+
deny('Invalid HTTP request target.');
|
|
57
|
+
const split = target.indexOf('?');
|
|
58
|
+
const raw = split < 0 ? target : target.slice(0, split);
|
|
59
|
+
const query = split < 0 ? '' : target.slice(split);
|
|
60
|
+
if (/%(?:2f|5c|25)/iu.test(raw))
|
|
61
|
+
deny('Ambiguous URL encoding.');
|
|
62
|
+
let decoded;
|
|
63
|
+
try {
|
|
64
|
+
decoded = decodeURIComponent(raw);
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
deny('Malformed URL encoding.');
|
|
68
|
+
}
|
|
69
|
+
const trailingSlash = decoded.endsWith('/');
|
|
70
|
+
return { path: appPath(decoded.slice(1, trailingSlash ? -1 : undefined)), query, trailingSlash };
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../../../../../src/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CAAC,yBAAyB,CAAC,CAAA;IAAC,CAAC;IACnF,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC3C,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA;AAClG,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { QuickApp, QuickAppAvailability, QuickAppPermissions } from '../../../shared/contracts/quick-apps.js';
|
|
2
|
+
export interface QuickAppStorage {
|
|
3
|
+
read(): readonly QuickApp[];
|
|
4
|
+
write(apps: readonly QuickApp[]): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export declare class QuickAppRegistry {
|
|
7
|
+
readonly storage: QuickAppStorage;
|
|
8
|
+
readonly workspaceRoot: (id: string) => string | null;
|
|
9
|
+
readonly hostId: string;
|
|
10
|
+
private readonly remoteValidate?;
|
|
11
|
+
private pending;
|
|
12
|
+
private stopped;
|
|
13
|
+
constructor(storage: QuickAppStorage, workspaceRoot: (id: string) => string | null, hostId?: string, remoteValidate?: ((app: QuickApp) => Promise<void>) | undefined);
|
|
14
|
+
list(): readonly QuickApp[];
|
|
15
|
+
get(id: string): QuickApp;
|
|
16
|
+
root(app: QuickApp): string;
|
|
17
|
+
validate(app: QuickApp): Promise<void>;
|
|
18
|
+
availability(app: QuickApp, htmlAvailable: boolean): Promise<QuickAppAvailability>;
|
|
19
|
+
upsert(input: unknown, expectedRevision: number): Promise<QuickApp>;
|
|
20
|
+
remove(id: string, expectedRevision: number): Promise<void>;
|
|
21
|
+
reorder(input: unknown): Promise<readonly QuickApp[]>;
|
|
22
|
+
revokeWorkspaceAccess(id: string, expectedRevision: number): Promise<QuickApp>;
|
|
23
|
+
dispose(): Promise<void>;
|
|
24
|
+
private serialize;
|
|
25
|
+
}
|
|
26
|
+
/** Ordering revisions protect metadata writes without changing launch files or permissions. */
|
|
27
|
+
export declare function quickAppDefinitionKey(app: QuickApp): string;
|
|
28
|
+
export declare function parseDefinition(input: unknown): Omit<QuickApp, 'revision'>;
|
|
29
|
+
export declare function parsePermissions(value: unknown): QuickAppPermissions;
|
|
30
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../../src/host/modules/quick-apps/registry.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAKlH,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,SAAS,QAAQ,EAAE,CAAA;IAC3B,KAAK,CAAC,IAAI,EAAE,SAAS,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChD;AAED,qBAAa,gBAAgB;IAGf,QAAQ,CAAC,OAAO,EAAE,eAAe;IAAE,QAAQ,CAAC,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI;IAAE,QAAQ,CAAC,MAAM;IACnH,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAHlC,OAAO,CAAC,OAAO,CAAsC;IACrD,OAAO,CAAC,OAAO,CAAQ;gBACF,OAAO,EAAE,eAAe,EAAW,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,EAAW,MAAM,SAAU,EAC5G,cAAc,CAAC,GAAE,CAAC,GAAG,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,aAAA;IAEpE,IAAI,IAAI,SAAS,QAAQ,EAAE;IAC3B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ;IAKzB,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,MAAM;IAMrB,QAAQ,CAAC,GAAG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