@deepseek-harness-tui/dsh-tui 0.8.0 → 0.8.1
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.md +13 -5
- package/cordis.patch.yml +21 -2
- package/cordis.yml +12 -1
- package/ecosystem-spec/registry/contracts/decision-events-v1alpha1.json +13 -0
- package/ecosystem-spec/registry/host-descriptor.tui.example.json +56 -0
- package/ecosystem-spec/registry/permissions-0.1.json +13 -0
- package/ecosystem-spec/registry/registry-0.15.json +57 -0
- package/ecosystem-spec/schemas/conformance-claim.schema.json +15 -0
- package/ecosystem-spec/schemas/effect-ledger-record.schema.json +16 -0
- package/ecosystem-spec/schemas/host-descriptor.schema.json +26 -0
- package/lib/types/cc/figures.d.ts +4 -0
- package/lib/types/cc/figures.d.ts.map +1 -1
- package/lib/types/cc/figures.js +4 -0
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +2 -0
- package/lib/types/components/ExtensionDialog.d.ts +40 -0
- package/lib/types/components/ExtensionDialog.d.ts.map +1 -0
- package/lib/types/components/ExtensionDialog.js +210 -0
- package/lib/types/components/HelpMenu.js +1 -1
- package/lib/types/components/LoadedContextPanel.d.ts +5 -10
- package/lib/types/components/LoadedContextPanel.d.ts.map +1 -1
- package/lib/types/components/LoadedContextPanel.js +7 -18
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +1 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +25 -1
- package/lib/types/components/RewindPicker.d.ts +13 -1
- package/lib/types/components/RewindPicker.d.ts.map +1 -1
- package/lib/types/components/RewindPicker.js +26 -2
- package/lib/types/components/ToolUseLoader.d.ts +8 -3
- package/lib/types/components/ToolUseLoader.d.ts.map +1 -1
- package/lib/types/components/ToolUseLoader.js +43 -9
- package/lib/types/components/messages/AssistantToolUseMessage.d.ts.map +1 -1
- package/lib/types/components/messages/AssistantToolUseMessage.js +1 -1
- package/lib/types/dsh-adapter/channel.d.ts +30 -7
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +503 -21
- package/lib/types/dsh-adapter/command-attribution.d.ts +51 -0
- package/lib/types/dsh-adapter/command-attribution.d.ts.map +1 -0
- package/lib/types/dsh-adapter/command-attribution.js +93 -0
- package/lib/types/dsh-adapter/command-errors.d.ts +42 -0
- package/lib/types/dsh-adapter/command-errors.d.ts.map +1 -0
- package/lib/types/dsh-adapter/command-errors.js +63 -0
- package/lib/types/dsh-adapter/component-identity.d.ts +28 -0
- package/lib/types/dsh-adapter/component-identity.d.ts.map +1 -0
- package/lib/types/dsh-adapter/component-identity.js +108 -0
- package/lib/types/dsh-adapter/contract.d.ts +1 -1
- package/lib/types/dsh-adapter/contract.js +2 -2
- package/lib/types/dsh-adapter/decision-guard.d.ts +84 -0
- package/lib/types/dsh-adapter/decision-guard.d.ts.map +1 -0
- package/lib/types/dsh-adapter/decision-guard.js +354 -0
- package/lib/types/dsh-adapter/dialogs.d.ts +146 -0
- package/lib/types/dsh-adapter/dialogs.d.ts.map +1 -0
- package/lib/types/dsh-adapter/dialogs.js +262 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts +99 -0
- package/lib/types/dsh-adapter/effect-ledger.d.ts.map +1 -0
- package/lib/types/dsh-adapter/effect-ledger.js +231 -0
- package/lib/types/dsh-adapter/extension-events.d.ts +193 -0
- package/lib/types/dsh-adapter/extension-events.d.ts.map +1 -0
- package/lib/types/dsh-adapter/extension-events.js +169 -0
- package/lib/types/dsh-adapter/extensions.d.ts +32 -0
- package/lib/types/dsh-adapter/extensions.d.ts.map +1 -0
- package/lib/types/dsh-adapter/extensions.js +42 -0
- package/lib/types/dsh-adapter/grants.d.ts +25 -0
- package/lib/types/dsh-adapter/grants.d.ts.map +1 -0
- package/lib/types/dsh-adapter/grants.js +184 -0
- package/lib/types/dsh-adapter/host-descriptor.d.ts +24 -0
- package/lib/types/dsh-adapter/host-descriptor.d.ts.map +1 -0
- package/lib/types/dsh-adapter/host-descriptor.js +146 -0
- package/lib/types/dsh-adapter/message-observer.d.ts +178 -0
- package/lib/types/dsh-adapter/message-observer.d.ts.map +1 -0
- package/lib/types/dsh-adapter/message-observer.js +509 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts +103 -0
- package/lib/types/dsh-adapter/plugin-host.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-host.js +270 -0
- package/lib/types/dsh-adapter/plugin-storage.d.ts +113 -0
- package/lib/types/dsh-adapter/plugin-storage.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugin-storage.js +385 -0
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +47 -1
- package/lib/types/dsh-adapter/plugins-info.d.ts +43 -0
- package/lib/types/dsh-adapter/plugins-info.d.ts.map +1 -0
- package/lib/types/dsh-adapter/plugins-info.js +276 -0
- package/lib/types/dsh-adapter/renderers.d.ts +65 -0
- package/lib/types/dsh-adapter/renderers.d.ts.map +1 -0
- package/lib/types/dsh-adapter/renderers.js +138 -0
- package/lib/types/dsh-adapter/sanitize.d.ts +36 -0
- package/lib/types/dsh-adapter/sanitize.d.ts.map +1 -0
- package/lib/types/dsh-adapter/sanitize.js +65 -0
- package/lib/types/dsh-adapter/scenes.d.ts +7 -1
- package/lib/types/dsh-adapter/scenes.d.ts.map +1 -1
- package/lib/types/dsh-adapter/scenes.js +17 -2
- package/lib/types/dsh-adapter/shortcuts.d.ts +109 -0
- package/lib/types/dsh-adapter/shortcuts.d.ts.map +1 -0
- package/lib/types/dsh-adapter/shortcuts.js +268 -0
- package/lib/types/dsh-adapter/status.d.ts +75 -0
- package/lib/types/dsh-adapter/status.d.ts.map +1 -0
- package/lib/types/dsh-adapter/status.js +168 -0
- package/lib/types/extensions.d.ts +8 -0
- package/lib/types/extensions.d.ts.map +1 -0
- package/lib/types/extensions.js +15 -0
- package/lib/types/i18n.d.ts +162 -16
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +53 -5
- package/lib/types/ink/ink.d.ts +11 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +33 -0
- package/lib/types/ink/log-update.d.ts.map +1 -1
- package/lib/types/ink/log-update.js +101 -51
- package/lib/types/ink/output.d.ts +7 -0
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +125 -4
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +14 -6
- package/lib/types/ink/terminal.d.ts.map +1 -1
- package/lib/types/ink/terminal.js +18 -6
- package/lib/types/plugin-host.d.ts +13 -0
- package/lib/types/plugin-host.d.ts.map +1 -0
- package/lib/types/plugin-host.js +17 -0
- package/lib/types/plugin-spec/negotiate.d.ts +11 -0
- package/lib/types/plugin-spec/negotiate.d.ts.map +1 -0
- package/lib/types/plugin-spec/negotiate.js +97 -0
- package/lib/types/plugin-spec/permission-scope.d.ts +32 -0
- package/lib/types/plugin-spec/permission-scope.d.ts.map +1 -0
- package/lib/types/plugin-spec/permission-scope.js +90 -0
- package/lib/types/plugin-spec/registry.d.ts +23 -0
- package/lib/types/plugin-spec/registry.d.ts.map +1 -0
- package/lib/types/plugin-spec/registry.js +157 -0
- package/lib/types/plugin-spec/schema-check.d.ts +17 -0
- package/lib/types/plugin-spec/schema-check.d.ts.map +1 -0
- package/lib/types/plugin-spec/schema-check.js +165 -0
- package/lib/types/plugin-spec/tui-extension.d.ts +16 -0
- package/lib/types/plugin-spec/tui-extension.d.ts.map +1 -0
- package/lib/types/plugin-spec/tui-extension.js +77 -0
- package/lib/types/plugin-spec/types.d.ts +114 -0
- package/lib/types/plugin-spec/types.d.ts.map +1 -0
- package/lib/types/plugin-spec/types.js +10 -0
- package/lib/types/plugin-spec/validate.d.ts +21 -0
- package/lib/types/plugin-spec/validate.d.ts.map +1 -0
- package/lib/types/plugin-spec/validate.js +119 -0
- package/lib/types/screens/Chat.d.ts +14 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +142 -39
- package/lib/types/theme.d.ts +5 -0
- package/lib/types/theme.d.ts.map +1 -1
- package/lib/types/theme.js +15 -0
- package/lib/types/update.d.ts +20 -0
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +54 -7
- package/lib/types/utils/loaded-context.d.ts +8 -3
- package/lib/types/utils/loaded-context.d.ts.map +1 -1
- package/lib/types/utils/loaded-context.js +39 -3
- package/lib/types/utils/modifiers.d.ts.map +1 -1
- package/lib/types/utils/modifiers.js +3 -2
- package/lib/types/working-activity.d.ts +12 -0
- package/lib/types/working-activity.d.ts.map +1 -1
- package/lib/types/working-activity.js +13 -0
- package/node_modules/@dsh-std/command/LICENSE +21 -0
- package/node_modules/@dsh-std/command/README.md +26 -0
- package/node_modules/@dsh-std/command/README.zh.md +28 -0
- package/node_modules/@dsh-std/command/lib/index.d.ts +144 -0
- package/node_modules/@dsh-std/command/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/command/lib/index.js +252 -0
- package/node_modules/@dsh-std/command/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/command/package.json +22 -0
- package/node_modules/@dsh-std/connection/LICENSE +21 -0
- package/node_modules/@dsh-std/connection/README.md +42 -0
- package/node_modules/@dsh-std/connection/README.zh.md +42 -0
- package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
- package/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
- package/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
- package/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/connection/lib/index.js +158 -0
- package/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
- package/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
- package/node_modules/@dsh-std/connection/lib/memory.js +257 -0
- package/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
- package/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
- package/node_modules/@dsh-std/connection/package.json +20 -0
- package/node_modules/@dsh-std/core/LICENSE +21 -0
- package/node_modules/@dsh-std/core/README.md +13 -0
- package/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/core/package.json +21 -0
- package/node_modules/@dsh-std/manifest/LICENSE +21 -0
- package/node_modules/@dsh-std/manifest/README.md +5 -0
- package/node_modules/@dsh-std/manifest/README.zh.md +5 -0
- package/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
- package/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/manifest/lib/index.js +625 -0
- package/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/manifest/package.json +20 -0
- package/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
- package/node_modules/@dsh-std/messages/LICENSE +21 -0
- package/node_modules/@dsh-std/messages/README.md +5 -0
- package/node_modules/@dsh-std/messages/README.zh.md +7 -0
- package/node_modules/@dsh-std/messages/lib/index.d.ts +50 -0
- package/node_modules/@dsh-std/messages/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/messages/lib/index.js +151 -0
- package/node_modules/@dsh-std/messages/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/messages/package.json +20 -0
- package/node_modules/@dsh-std/messages/schema/message-observer-envelope-0.15.schema.json +54 -0
- package/node_modules/@dsh-std/presentation/LICENSE +21 -0
- package/node_modules/@dsh-std/presentation/README.md +26 -0
- package/node_modules/@dsh-std/presentation/README.zh.md +28 -0
- package/node_modules/@dsh-std/presentation/lib/index.d.ts +219 -0
- package/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/index.js +547 -0
- package/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
- package/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
- package/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
- package/node_modules/@dsh-std/presentation/package.json +21 -0
- package/node_modules/@dsh-std/storage/LICENSE +21 -0
- package/node_modules/@dsh-std/storage/README.md +5 -0
- package/node_modules/@dsh-std/storage/README.zh.md +7 -0
- package/node_modules/@dsh-std/storage/lib/index.d.ts +48 -0
- package/node_modules/@dsh-std/storage/lib/index.d.ts.map +1 -0
- package/node_modules/@dsh-std/storage/lib/index.js +104 -0
- package/node_modules/@dsh-std/storage/lib/index.js.map +1 -0
- package/node_modules/@dsh-std/storage/package.json +20 -0
- package/node_modules/@dsh-std/storage/schema/local-storage-0.15.schema.json +56 -0
- package/package.json +105 -70
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.md +42 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/README.zh.md +42 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js +158 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js +257 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/connection/package.json +20 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.md +5 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/README.zh.md +5 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts +182 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js +625 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/package.json +20 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/manifest/schema/dsh-plugin-0.15.schema.json +144 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/LICENSE +21 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.md +26 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/README.zh.md +28 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts +219 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js +547 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/interaction.js +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.d.ts +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/lib/operations.js +2 -0
- package/vendor/dsh-std/packages/command/node_modules/@dsh-std/presentation/package.json +21 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/connection/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/manifest/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/messages/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/LICENSE +21 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.md +42 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/README.zh.md +42 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts +125 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/connection-CdGcSQnu.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts +89 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js +158 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts +24 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js +257 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/memory.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js +226 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/lib/resolve-3X6ausgz.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/connection/package.json +20 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/presentation/node_modules/@dsh-std/core/package.json +21 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/LICENSE +21 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.md +13 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/README.zh.md +13 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts +112 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.d.ts.map +1 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js +424 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/lib/index.js.map +1 -0
- package/vendor/dsh-std/packages/storage/node_modules/@dsh-std/core/package.json +21 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import {\n ProtocolCatalog,\n protocolKey,\n validateApiReference,\n type ApiReference,\n type ProtocolRequirement,\n type ProtocolSupport,\n type VersionRange,\n assertVersionRange,\n parseSemanticVersion,\n} from '@dsh-std/core'\nexport const COMMUNITY_V015_MANIFEST_VERSION = '0.15'\nexport const COMPONENT_API_VERSION = 'manifest.dsh/internal/v1alpha1'\nexport const COMMUNITY_PERMISSION_API_VERSION = 'community.dsh/v1alpha1'\nexport const COMMUNITY_PERMISSION_KIND = 'Permission'\n\nconst COMPONENT_ID = /^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$/u\nconst LOCAL_NAME = /^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)*$/u\n\nexport interface CommunityContractReference extends ApiReference {\n readonly optional?: boolean\n readonly fallback?: string\n}\n\nexport interface CommunityPermissionRequest {\n readonly name: string\n readonly scope: string\n readonly reason?: string\n}\n\nexport interface CommunityCommandContribution {\n readonly id: string\n readonly title: string\n readonly description?: string\n}\n\nexport type CommunitySubscription = string | (ApiReference & { readonly scope?: string })\n\nexport interface CommunityPluginManifestV015 {\n /** Draft schema identifier. It is not fetched while loading the plugin. */\n readonly $schema: string\n readonly manifestVersion: typeof COMMUNITY_V015_MANIFEST_VERSION\n readonly id: string\n readonly name: string\n readonly version: string\n readonly facets: {\n readonly host: { readonly entry: string; readonly apiVersion: string }\n }\n readonly requires: {\n readonly contracts: readonly CommunityContractReference[]\n readonly services?: readonly never[]\n }\n readonly permissions: readonly CommunityPermissionRequest[]\n readonly contributes: {\n readonly commands: readonly CommunityCommandContribution[]\n readonly panels?: readonly never[]\n } & Readonly<Record<string, readonly unknown[]>>\n readonly subscriptions: readonly CommunitySubscription[]\n readonly license?: string\n readonly source?: { readonly repository: string; readonly revision?: string }\n readonly artifact?: { readonly digest: string; readonly algorithm: 'sha256'; readonly path: string }\n readonly compat?: { readonly hosts?: readonly string[] }\n readonly overrides?: readonly {\n readonly target: string\n readonly kind: 'patch' | 'native' | 'build'\n readonly description?: string\n }[]\n}\n\nexport type PluginManifest = CommunityPluginManifestV015\n\nexport interface ComponentRelationships {\n readonly depends?: Readonly<Record<string, VersionRange>>\n readonly recommends?: Readonly<Record<string, VersionRange>>\n readonly conflicts?: Readonly<Record<string, VersionRange>>\n readonly breaks?: Readonly<Record<string, VersionRange>>\n}\n\nexport interface ActivationObject<Spec = unknown> extends ApiReference {\n readonly spec: Spec\n}\n\nexport interface ExtensionMetadata {\n readonly name: string\n readonly labels?: Readonly<Record<string, string>>\n}\n\nexport interface ManifestExtension<Spec = unknown> extends ApiReference {\n readonly metadata: ExtensionMetadata\n readonly spec: Spec\n}\n\nexport interface PermissionRequest<Spec = unknown> extends ApiReference {\n readonly action: string\n readonly optional?: boolean\n readonly reason?: string\n readonly spec?: Spec\n}\n\nexport interface ComponentFacet {\n readonly name: string\n readonly activation?: ActivationObject\n readonly protocols?: {\n readonly requires?: readonly ProtocolRequirement[]\n readonly supports?: readonly ProtocolSupport[]\n }\n readonly extensions?: readonly ManifestExtension[]\n readonly permissions?: readonly PermissionRequest[]\n}\n\nexport interface ComponentManifest {\n /** Host-internal projection. Portable packages publish PluginManifest instead. */\n readonly apiVersion: typeof COMPONENT_API_VERSION\n readonly kind: 'Component'\n readonly metadata: {\n readonly name: string\n readonly version: string\n readonly displayName?: string\n }\n readonly spec: {\n readonly facets: readonly ComponentFacet[]\n readonly relationships?: ComponentRelationships\n }\n}\n\nexport interface FacetIdentity {\n readonly component: string\n readonly version: string\n readonly facet: string\n}\n\nexport interface ManifestObjectDefinition<Spec = unknown> extends ApiReference {\n validateSpec(spec: unknown): Spec\n /** Extension-owned identity validation. Activation definitions leave this undefined. */\n validateMetadata?(metadata: ExtensionMetadata): void\n}\n\nexport interface ManifestValidationIssue {\n readonly code: 'unknown-protocol' | 'unknown-activation' | 'unknown-extension' | 'invalid-activation' | 'invalid-extension'\n readonly severity: 'error' | 'warning'\n readonly path: string\n readonly message: string\n}\n\nexport interface ManifestValidationReport {\n readonly apiVersion: 'manifest.dsh/report/v1alpha1'\n readonly validator: { readonly name: string; readonly version: string }\n readonly source: string\n readonly digest: string\n readonly manifest: { readonly name: string; readonly version: string }\n readonly compatible: boolean\n readonly issues: readonly ManifestValidationIssue[]\n}\n\nexport class ManifestDefinitionCatalog {\n private readonly activations = new Map<string, ManifestObjectDefinition>()\n private readonly extensions = new Map<string, ManifestObjectDefinition>()\n\n constructor(readonly validator = Object.freeze({ name: '@dsh-std/manifest', version: '0.1.0' })) {\n nonEmpty(validator.name, 'validator.name')\n nonEmpty(validator.version, 'validator.version')\n }\n\n registerActivation(definition: ManifestObjectDefinition): () => void {\n return registerDefinition(this.activations, definition, 'activation')\n }\n\n registerExtension(definition: ManifestObjectDefinition): () => void {\n return registerDefinition(this.extensions, definition, 'extension')\n }\n\n activation(reference: ApiReference): ManifestObjectDefinition | undefined {\n return this.activations.get(protocolKey(reference))\n }\n\n extension(reference: ApiReference): ManifestObjectDefinition | undefined {\n return this.extensions.get(protocolKey(reference))\n }\n\n validate(\n manifestValue: ComponentManifest,\n protocols?: ProtocolCatalog,\n options: { readonly source?: string; readonly digest?: string } = {},\n ): ManifestValidationReport {\n const manifest = defineComponentManifest(manifestValue)\n const issues: ManifestValidationIssue[] = []\n for (const [facetIndex, facet] of manifest.spec.facets.entries()) {\n const base = `/spec/facets/${facetIndex}`\n if (facet.activation !== undefined) {\n const definition = this.activation(facet.activation)\n if (definition === undefined) {\n issues.push(issue('unknown-activation', 'warning', `${base}/activation`, 'activation definition is not installed'))\n } else {\n try { definition.validateSpec(facet.activation.spec) } catch (error) {\n issues.push(issue('invalid-activation', 'error', `${base}/activation/spec`, errorMessage(error)))\n }\n }\n }\n for (const direction of ['requires', 'supports'] as const) {\n for (const [index, row] of (facet.protocols?.[direction] ?? []).entries()) {\n if (protocols !== undefined && !protocols.understands(row)) {\n issues.push(issue('unknown-protocol', 'warning', `${base}/protocols/${direction}/${index}`, `protocol ${row.apiVersion} ${row.kind} is unknown`))\n }\n }\n }\n for (const [index, extension] of (facet.extensions ?? []).entries()) {\n const definition = this.extension(extension)\n if (definition === undefined) {\n issues.push(issue('unknown-extension', 'warning', `${base}/extensions/${index}`, 'extension definition is not installed'))\n } else {\n try {\n definition.validateMetadata?.(extension.metadata)\n definition.validateSpec(extension.spec)\n } catch (error) {\n issues.push(issue('invalid-extension', 'error', `${base}/extensions/${index}`, errorMessage(error)))\n }\n }\n }\n }\n return Object.freeze({\n apiVersion: 'manifest.dsh/report/v1alpha1',\n validator: Object.freeze({ ...this.validator }),\n source: options.source ?? 'memory:',\n digest: options.digest ?? manifestDigest(manifest),\n manifest: Object.freeze({ name: manifest.metadata.name, version: manifest.metadata.version }),\n compatible: !issues.some(row => row.severity === 'error'),\n issues: Object.freeze(issues),\n })\n }\n}\n\nexport interface ParseManifestOptions {\n readonly source?: string\n}\n\n/** Parse the package-root dsh-plugin.json without executing plugin code or fetching a schema. */\nexport function parseManifest(source: string, options: ParseManifestOptions = {}): PluginManifest {\n if (typeof source !== 'string') throw new TypeError('manifest source must be a string')\n let value: unknown\n try { value = JSON.parse(source) } catch (error) {\n throw new SyntaxError(`${options.source ?? 'dsh-plugin.json'}: ${errorMessage(error)}`, { cause: error })\n }\n try { return defineManifest(value as PluginManifest) } catch (error) {\n throw new TypeError(`${options.source ?? 'dsh-plugin.json'}: ${errorMessage(error)}`, { cause: error })\n }\n}\n\nexport function defineManifest<const T extends PluginManifest>(manifest: T): T {\n validateManifest(manifest)\n return deepFreeze(structuredClone(manifest))\n}\n\nexport function validateManifest(value: unknown): asserts value is PluginManifest {\n if (!record(value)) throw new TypeError('plugin manifest must be an object')\n if (value.manifestVersion === COMMUNITY_V015_MANIFEST_VERSION) {\n validateCommunityManifest(value)\n return\n }\n throw new TypeError(`unsupported plugin manifest $schema ${JSON.stringify(value.$schema)} and manifestVersion ${JSON.stringify(value.manifestVersion)}`)\n}\n\nfunction validateCommunityManifest(value: Record<string, unknown>): void {\n exact(value, [\n '$schema', 'manifestVersion', 'id', 'name', 'version', 'facets', 'requires', 'permissions',\n 'contributes', 'subscriptions', 'license', 'source', 'artifact', 'compat', 'overrides',\n ], 'community v0.15 plugin manifest')\n validateSchemaIdentifier(value.$schema, 'community v0.15 manifest.$schema')\n if (value.manifestVersion !== COMMUNITY_V015_MANIFEST_VERSION) {\n throw new TypeError(`unsupported Community v0.15 manifestVersion ${JSON.stringify(value.manifestVersion)}`)\n }\n namespaced(value.id, 'community v0.15 manifest.id')\n nonEmpty(value.name, 'community v0.15 manifest.name')\n nonEmpty(value.version, 'community v0.15 manifest.version')\n parseSemanticVersion(value.version as string)\n validateCommunityFacets(value.facets)\n validateCommunityRequirements(value.requires)\n validateCommunityPermissions(value.permissions)\n validateCommunityContributions(value.contributes)\n validateCommunitySubscriptions(value.subscriptions)\n if (value.license !== undefined) nonEmpty(value.license, 'community v0.15 manifest.license')\n if (value.source !== undefined) validateCommunitySource(value.source)\n if (value.artifact !== undefined) validateCommunityArtifact(value.artifact)\n if (value.compat !== undefined) validateCommunityCompat(value.compat)\n if (value.overrides !== undefined) validateCommunityOverrides(value.overrides)\n}\n\n/** Validate a host-internal Component/Facet projection. */\nexport function defineComponentManifest<const T extends ComponentManifest>(manifest: T): T {\n validateComponentManifest(manifest)\n return deepFreeze(structuredClone(manifest))\n}\n\nexport function validateComponentManifest(value: unknown): asserts value is ComponentManifest {\n if (!record(value)) throw new TypeError('component manifest must be an object')\n exact(value, ['apiVersion', 'kind', 'metadata', 'spec'], 'component manifest')\n if (value.apiVersion !== COMPONENT_API_VERSION) throw new TypeError(`unsupported component manifest apiVersion ${JSON.stringify(value.apiVersion)}`)\n if (value.kind !== 'Component') throw new TypeError('component manifest kind must be \"Component\"')\n if (!record(value.metadata)) throw new TypeError('component metadata must be an object')\n exact(value.metadata, ['name', 'version', 'displayName'], 'component metadata')\n namespaced(value.metadata.name, 'component metadata.name')\n nonEmpty(value.metadata.version, 'component metadata.version')\n parseSemanticVersion(value.metadata.version as string)\n if (value.metadata.displayName !== undefined) nonEmpty(value.metadata.displayName, 'component metadata.displayName')\n if (!record(value.spec)) throw new TypeError('component spec must be an object')\n exact(value.spec, ['facets', 'relationships'], 'component spec')\n if (!Array.isArray(value.spec.facets) || value.spec.facets.length === 0) throw new TypeError('component spec.facets must be a non-empty array')\n const names = new Set<string>()\n for (const [index, facet] of value.spec.facets.entries()) {\n validateFacet(facet, index)\n const name = (facet as ComponentFacet).name\n if (names.has(name)) throw new TypeError(`duplicate facet name ${JSON.stringify(name)}`)\n names.add(name)\n }\n if (value.spec.relationships !== undefined) validateRelationships(value.spec.relationships, value.metadata.name as string)\n}\n\n/** Project a supported package manifest version into the common host composition model. */\nexport function projectManifest(manifestValue: PluginManifest): ComponentManifest {\n const manifest = defineManifest(manifestValue)\n return projectCommunityManifest(manifest)\n}\n\nfunction projectCommunityManifest(manifest: CommunityPluginManifestV015): ComponentManifest {\n const extensions: ManifestExtension[] = manifest.contributes.commands.map(row => Object.freeze({\n apiVersion: 'commands.dsh/v1alpha1',\n kind: 'Command',\n metadata: Object.freeze({\n name: localContributionName(row.id),\n labels: Object.freeze({ 'dsh.std/contribution-id': row.id }),\n }),\n spec: Object.freeze({\n title: row.title,\n ...(row.description === undefined ? {} : { description: row.description }),\n }),\n }))\n for (const [point, contributions] of Object.entries(manifest.contributes)) {\n if (!point.startsWith('x-')) continue\n for (const contribution of contributions) {\n if (!record(contribution)\n || typeof contribution.apiVersion !== 'string'\n || typeof contribution.kind !== 'string'\n || typeof contribution.id !== 'string'\n || typeof contribution.name !== 'string'\n || !Object.hasOwn(contribution, 'spec')) continue\n extensions.push(Object.freeze({\n apiVersion: contribution.apiVersion,\n kind: contribution.kind,\n metadata: Object.freeze({\n name: contribution.name,\n labels: Object.freeze({ 'dsh.std/contribution-id': contribution.id }),\n }),\n spec: contribution.spec,\n }))\n }\n }\n const requirements = manifest.requires.contracts.map(communityRequirement)\n const permissions: PermissionRequest[] = manifest.permissions.map(permission => Object.freeze({\n apiVersion: COMMUNITY_PERMISSION_API_VERSION,\n kind: COMMUNITY_PERMISSION_KIND,\n action: permission.name,\n ...(permission.reason === undefined ? {} : { reason: permission.reason }),\n spec: Object.freeze({ scope: permission.scope }),\n }))\n return defineComponentManifest({\n apiVersion: COMPONENT_API_VERSION,\n kind: 'Component',\n metadata: { name: manifest.id, displayName: manifest.name, version: manifest.version },\n spec: {\n facets: [{\n name: 'host',\n activation: {\n apiVersion: 'lifecycle.dsh/v1alpha1',\n kind: 'FacetModule',\n spec: { module: manifest.facets.host.entry },\n },\n ...(requirements.length === 0 ? {} : { protocols: { requires: requirements } }),\n ...(extensions.length === 0 ? {} : { extensions }),\n ...(permissions.length === 0 ? {} : { permissions }),\n }],\n },\n })\n}\n\nfunction communityRequirement(reference: CommunityContractReference): ProtocolRequirement {\n return Object.freeze({\n apiVersion: reference.apiVersion,\n kind: reference.kind,\n ...(reference.optional === undefined ? {} : { optional: reference.optional }),\n ...(reference.fallback === undefined ? {} : { 'x-community-fallback': reference.fallback }),\n })\n}\n\nexport function facetIdentity(manifest: ComponentManifest, facet: ComponentFacet): FacetIdentity {\n if (!(manifest.spec.facets as readonly ComponentFacet[]).includes(facet)) {\n const found = manifest.spec.facets.find(candidate => candidate.name === facet.name)\n if (found === undefined) throw new TypeError(`facet ${JSON.stringify(facet.name)} does not belong to component`)\n }\n return Object.freeze({ component: manifest.metadata.name, version: manifest.metadata.version, facet: facet.name })\n}\n\nexport function facetKey(identity: FacetIdentity): string {\n return `${identity.component}@${identity.version}#${identity.facet}`\n}\n\nexport function findFacet(manifest: ComponentManifest, name: string): ComponentFacet | undefined {\n return manifest.spec.facets.find(facet => facet.name === name)\n}\n\nfunction validateCommunityFacets(value: unknown): void {\n const label = 'community v0.15 manifest.facets'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['host'], label, false)\n if (!record(value.host)) throw new TypeError(`${label}.host must be an object`)\n exact(value.host, ['entry', 'apiVersion'], `${label}.host`, false)\n validatePackageRelative(value.host.entry, `${label}.host.entry`)\n if (typeof value.host.apiVersion !== 'string'\n || !/^v[1-9][0-9]*(?:(?:alpha|beta)[1-9][0-9]*)?$/u.test(value.host.apiVersion)) {\n throw new TypeError(`${label}.host.apiVersion is invalid`)\n }\n}\n\nfunction validateCommunityRequirements(value: unknown): void {\n const label = 'community v0.15 manifest.requires'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['contracts', 'services'], label, false)\n if (!Array.isArray(value.contracts)) throw new TypeError(`${label}.contracts must be an array`)\n const seen = new Set<string>()\n for (const [index, referenceValue] of value.contracts.entries()) {\n const rowLabel = `${label}.contracts[${index}]`\n validateApiReference(referenceValue, rowLabel)\n const reference = referenceValue as unknown as Record<string, unknown>\n exact(reference, ['apiVersion', 'kind', 'optional', 'fallback'], rowLabel, false)\n if (reference.optional !== undefined && typeof reference.optional !== 'boolean') {\n throw new TypeError(`${rowLabel}.optional must be boolean`)\n }\n if (reference.fallback !== undefined) nonEmpty(reference.fallback, `${rowLabel}.fallback`)\n const key = protocolKey(reference as unknown as ApiReference)\n if (seen.has(key)) throw new TypeError(`${label}.contracts contains duplicate contract ${JSON.stringify(key)}`)\n seen.add(key)\n }\n if (value.services !== undefined && (!Array.isArray(value.services) || value.services.length !== 0)) {\n throw new TypeError(`${label}.services must be an empty array in v0.15`)\n }\n}\n\nfunction validateCommunityPermissions(value: unknown): void {\n const label = 'community v0.15 manifest.permissions'\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, permissionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n if (!record(permissionValue)) throw new TypeError(`${rowLabel} must be an object`)\n exact(permissionValue, ['name', 'scope', 'reason'], rowLabel, false)\n capabilityId(permissionValue.name, `${rowLabel}.name`)\n nonEmpty(permissionValue.scope, `${rowLabel}.scope`)\n if (permissionValue.reason !== undefined) nonEmpty(permissionValue.reason, `${rowLabel}.reason`)\n const key = `${String(permissionValue.name)}\\0${String(permissionValue.scope)}`\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate permission ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateCommunityContributions(value: unknown): void {\n const label = 'community v0.15 manifest.contributes'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n const unknown = Object.keys(value).filter(point => point !== 'commands' && point !== 'panels' && !point.startsWith('x-'))\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown contribution point ${JSON.stringify(unknown[0])}`)\n if (!Array.isArray(value.commands)) throw new TypeError(`${label}.commands must be an array`)\n const ids = new Set<string>()\n for (const [index, commandValue] of value.commands.entries()) {\n const rowLabel = `${label}.commands[${index}]`\n if (!record(commandValue)) throw new TypeError(`${rowLabel} must be an object`)\n exact(commandValue, ['id', 'title', 'description'], rowLabel, false)\n namespaced(commandValue.id, `${rowLabel}.id`)\n nonEmpty(commandValue.title, `${rowLabel}.title`)\n if (commandValue.description !== undefined) nonEmpty(commandValue.description, `${rowLabel}.description`)\n if (ids.has(commandValue.id)) throw new TypeError(`${label}.commands contains duplicate id ${JSON.stringify(commandValue.id)}`)\n ids.add(commandValue.id)\n }\n if (value.panels !== undefined && (!Array.isArray(value.panels) || value.panels.length !== 0)) {\n throw new TypeError(`${label}.panels must be an empty array in v0.15`)\n }\n for (const [point, contributions] of Object.entries(value)) {\n if (!point.startsWith('x-')) continue\n if (!Array.isArray(contributions)) throw new TypeError(`${label}.${point} must be an array`)\n }\n}\n\nfunction validateCommunitySubscriptions(value: unknown): void {\n const label = 'community v0.15 manifest.subscriptions'\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, subscriptionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n let key: string\n if (typeof subscriptionValue === 'string') {\n nonEmpty(subscriptionValue, rowLabel)\n key = `legacy\\0${subscriptionValue}`\n } else {\n validateApiReference(subscriptionValue, rowLabel)\n const subscription = subscriptionValue as unknown as Record<string, unknown>\n exact(subscription, ['apiVersion', 'kind', 'scope'], rowLabel, false)\n if (subscription.scope !== undefined) nonEmpty(subscription.scope, `${rowLabel}.scope`)\n key = `${protocolKey(subscription as unknown as ApiReference)}\\0${String(subscription.scope ?? '')}`\n }\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate subscription ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateCommunitySource(value: unknown): void {\n const label = 'community v0.15 manifest.source'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['repository', 'revision'], label, false)\n validateSchemaIdentifier(value.repository, `${label}.repository`)\n if (value.revision !== undefined) nonEmpty(value.revision, `${label}.revision`)\n}\n\nfunction validateCommunityArtifact(value: unknown): void {\n const label = 'community v0.15 manifest.artifact'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['digest', 'algorithm', 'path'], label, false)\n if (value.algorithm !== 'sha256') throw new TypeError(`${label}.algorithm must be \"sha256\"`)\n if (typeof value.digest !== 'string' || !/^sha256:[a-f0-9]{64}$/u.test(value.digest)) {\n throw new TypeError(`${label}.digest must be a SHA-256 digest`)\n }\n validatePackageRelative(value.path, `${label}.path`)\n}\n\nfunction validateCommunityCompat(value: unknown): void {\n const label = 'community v0.15 manifest.compat'\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['hosts'], label, false)\n if (value.hosts === undefined) return\n if (!Array.isArray(value.hosts)) throw new TypeError(`${label}.hosts must be an array`)\n const seen = new Set<string>()\n for (const [index, host] of value.hosts.entries()) {\n nonEmpty(host, `${label}.hosts[${index}]`)\n if (seen.has(host)) throw new TypeError(`${label}.hosts contains duplicate ${JSON.stringify(host)}`)\n seen.add(host)\n }\n}\n\nfunction validateCommunityOverrides(value: unknown): void {\n const label = 'community v0.15 manifest.overrides'\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n for (const [index, overrideValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n if (!record(overrideValue)) throw new TypeError(`${rowLabel} must be an object`)\n exact(overrideValue, ['target', 'kind', 'description'], rowLabel, false)\n nonEmpty(overrideValue.target, `${rowLabel}.target`)\n if (overrideValue.kind !== 'patch' && overrideValue.kind !== 'native' && overrideValue.kind !== 'build') {\n throw new TypeError(`${rowLabel}.kind is invalid`)\n }\n if (overrideValue.description !== undefined) nonEmpty(overrideValue.description, `${rowLabel}.description`)\n }\n}\n\nfunction validatePackageRelative(value: unknown, label: string): asserts value is string {\n nonEmpty(value, label)\n if (value.startsWith('/') || value.startsWith('\\\\') || /^[a-zA-Z]:[\\\\/]/u.test(value)) {\n throw new TypeError(`${label} must be package-relative`)\n }\n const segments = value.replaceAll('\\\\', '/').split('/')\n if (segments.includes('..')) throw new TypeError(`${label} must remain inside the package`)\n}\n\nfunction capabilityId(value: unknown, label: string): asserts value is string {\n if (value === 'commands' || value === 'storage.local' || value === 'messages.observe') return\n if (typeof value !== 'string' || !/^(?:x-[a-z0-9][a-z0-9.-]*\\.)?[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$/u.test(value)) {\n throw new TypeError(`${label} must be a namespaced capability identifier`)\n }\n}\n\nfunction localContributionName(id: string): string {\n const name = id.split('.').at(-1) ?? id\n localName(name, 'contribution local name')\n return name\n}\n\nfunction validateFacet(value: unknown, index: number): void {\n const label = `component spec.facets[${index}]`\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['name', 'activation', 'protocols', 'extensions', 'permissions'], label)\n localName(value.name, `${label}.name`)\n if (value.activation !== undefined) validateActivation(value.activation, `${label}.activation`)\n if (value.protocols !== undefined) validateProtocols(value.protocols, `${label}.protocols`)\n if (value.extensions !== undefined) validateExtensions(value.extensions, `${label}.extensions`)\n if (value.permissions !== undefined) validatePermissions(value.permissions, `${label}.permissions`)\n if (value.activation === undefined && value.protocols === undefined && value.extensions === undefined && value.permissions === undefined) {\n throw new TypeError(`${label} must declare activation, protocols, extensions, or permissions`)\n }\n}\n\nfunction validateActivation(value: unknown, label: string): void {\n validateApiReference(value, label)\n const row = value as unknown as Record<string, unknown>\n exact(row, ['apiVersion', 'kind', 'spec'], label)\n if (!Object.hasOwn(row, 'spec')) throw new TypeError(`${label}.spec is required`)\n}\n\nfunction validateProtocols(value: unknown, label: string): void {\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n exact(value, ['requires', 'supports'], label)\n validateProtocolRows(value.requires, true, `${label}.requires`)\n validateProtocolRows(value.supports, false, `${label}.supports`)\n}\n\nfunction validateProtocolRows(value: unknown, requirement: boolean, label: string): void {\n if (value === undefined) return\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, rowValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n validateApiReference(rowValue, rowLabel)\n const row = rowValue as unknown as Record<string, unknown>\n exact(row, requirement ? ['apiVersion', 'kind', 'optional', 'spec'] : ['apiVersion', 'kind', 'spec'], rowLabel)\n if (requirement && row.optional !== undefined && typeof row.optional !== 'boolean') throw new TypeError(`${rowLabel}.optional must be boolean`)\n const key = protocolKey(row as unknown as ApiReference)\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate protocol ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateExtensions(value: unknown, label: string): void {\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, extensionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n validateApiReference(extensionValue, rowLabel)\n const extension = extensionValue as unknown as Record<string, unknown>\n exact(extension, ['apiVersion', 'kind', 'metadata', 'spec'], rowLabel)\n if (!record(extension.metadata)) throw new TypeError(`${rowLabel}.metadata must be an object`)\n exact(extension.metadata, ['name', 'labels'], `${rowLabel}.metadata`)\n nonEmpty(extension.metadata.name, `${rowLabel}.metadata.name`)\n if (extension.metadata.labels !== undefined) validateLabels(extension.metadata.labels, `${rowLabel}.metadata.labels`)\n if (!Object.hasOwn(extension, 'spec')) throw new TypeError(`${rowLabel}.spec is required`)\n if (Object.hasOwn(extension, 'status')) throw new TypeError(`${rowLabel}.status is runtime-owned`)\n const key = `${protocolKey(extension as unknown as ApiReference)}\\0${String(extension.metadata.name)}`\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate extension ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validatePermissions(value: unknown, label: string): void {\n if (!Array.isArray(value)) throw new TypeError(`${label} must be an array`)\n const seen = new Set<string>()\n for (const [index, permissionValue] of value.entries()) {\n const rowLabel = `${label}[${index}]`\n validateApiReference(permissionValue, rowLabel)\n const permission = permissionValue as unknown as Record<string, unknown>\n exact(permission, ['apiVersion', 'kind', 'action', 'optional', 'reason', 'spec'], rowLabel)\n localName(permission.action, `${rowLabel}.action`)\n if (permission.optional !== undefined && typeof permission.optional !== 'boolean') throw new TypeError(`${rowLabel}.optional must be boolean`)\n if (permission.reason !== undefined) nonEmpty(permission.reason, `${rowLabel}.reason`)\n const key = `${protocolKey(permission as unknown as ApiReference)}\\0${String(permission.action)}`\n if (seen.has(key)) throw new TypeError(`${label} contains duplicate permission ${JSON.stringify(key)}`)\n seen.add(key)\n }\n}\n\nfunction validateRelationships(value: unknown, component: string): void {\n if (!record(value)) throw new TypeError('component relationships must be an object')\n exact(value, ['depends', 'recommends', 'conflicts', 'breaks'], 'component relationships', false)\n for (const kind of ['depends', 'recommends', 'conflicts', 'breaks'] as const) {\n const rows = value[kind]\n if (rows === undefined) continue\n if (!record(rows)) throw new TypeError(`component relationships.${kind} must be an object`)\n for (const [target, range] of Object.entries(rows)) {\n namespaced(target, `component relationships.${kind} target`)\n if (target === component) throw new TypeError(`component cannot declare ${kind} on itself`)\n assertVersionRange(range as VersionRange)\n }\n }\n}\n\nfunction registerDefinition(\n target: Map<string, ManifestObjectDefinition>,\n definition: ManifestObjectDefinition,\n label: string,\n): () => void {\n validateApiReference(definition, `${label} definition`)\n if (typeof definition.validateSpec !== 'function') throw new TypeError(`${label} definition.validateSpec must be a function`)\n const key = protocolKey(definition)\n if (target.has(key)) throw new Error(`${label} definition ${definition.apiVersion} ${definition.kind} is already registered`)\n const stored = Object.freeze({ ...definition })\n target.set(key, stored)\n return () => { if (target.get(key) === stored) target.delete(key) }\n}\n\nfunction issue(\n code: ManifestValidationIssue['code'], severity: ManifestValidationIssue['severity'], path: string, message: string,\n): ManifestValidationIssue {\n return Object.freeze({ code, severity, path, message })\n}\n\nfunction validateLabels(value: unknown, label: string): void {\n if (!record(value)) throw new TypeError(`${label} must be an object`)\n for (const [key, item] of Object.entries(value)) {\n nonEmpty(key, `${label} key`)\n if (typeof item !== 'string') throw new TypeError(`${label}.${key} must be a string`)\n }\n}\n\nfunction namespaced(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || !COMPONENT_ID.test(value)) throw new TypeError(`${label} must be namespaced`)\n}\n\nfunction localName(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || !LOCAL_NAME.test(value)) throw new TypeError(`${label} is invalid`)\n}\n\nfunction nonEmpty(value: unknown, label: string): asserts value is string {\n if (typeof value !== 'string' || value.trim() === '') throw new TypeError(`${label} must be a non-empty string`)\n}\n\nfunction validateSchemaIdentifier(value: unknown, label: string): asserts value is string {\n nonEmpty(value, label)\n try { new URL(value) } catch (error) {\n throw new TypeError(`${label} must be an absolute URI`, { cause: error })\n }\n}\n\nfunction record(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n}\n\nfunction exact(value: Record<string, unknown>, allowed: readonly string[], label: string, extensions = true): void {\n const unknown = Object.keys(value).filter(key => !allowed.includes(key) && !(extensions && key.startsWith('x-')))\n if (unknown.length > 0) throw new TypeError(`${label} contains unknown field ${JSON.stringify(unknown[0])}`)\n}\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value !== 'object' || value === null || Object.isFrozen(value)) return value\n Object.freeze(value)\n for (const child of Object.values(value)) deepFreeze(child)\n return value\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error)\n}\n\nfunction manifestDigest(manifest: ComponentManifest): string {\n const input = canonical(manifest)\n let hash = 2166136261\n for (let index = 0; index < input.length; index += 1) hash = Math.imul(hash ^ input.charCodeAt(index), 16777619)\n return `fnv1a32:${(hash >>> 0).toString(16).padStart(8, '0')}`\n}\n\nfunction canonical(value: unknown): string {\n if (Array.isArray(value)) return `[${value.map(canonical).join(',')}]`\n if (record(value)) {\n return `{${Object.entries(value).sort(([a], [b]) => a.localeCompare(b)).map(([key, item]) => `${JSON.stringify(key)}:${canonical(item)}`).join(',')}}`\n }\n return JSON.stringify(value) ?? 'null'\n}\n"],"mappings":";;AAWA,MAAa,kCAAkC;AAC/C,MAAa,wBAAwB;AACrC,MAAa,mCAAmC;AAChD,MAAa,4BAA4B;AAEzC,MAAM,eAAe;AACrB,MAAM,aAAa;AAyInB,IAAa,4BAAb,MAAuC;CAIhB;CAHrB,8BAA+B,IAAI,IAAsC;CACzE,6BAA8B,IAAI,IAAsC;CAExE,YAAY,YAAqB,OAAO,OAAO;EAAE,MAAM;EAAqB,SAAS;CAAQ,CAAC,GAAG;EAA5E,KAAA,YAAA;EACnB,SAAS,UAAU,MAAM,gBAAgB;EACzC,SAAS,UAAU,SAAS,mBAAmB;CACjD;CAEA,mBAAmB,YAAkD;EACnE,OAAO,mBAAmB,KAAK,aAAa,YAAY,YAAY;CACtE;CAEA,kBAAkB,Y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;CAC/G,OAAO,YAAY,SAAS,EAAA,CAAG,SAAS,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;AAC7D;AAEA,SAAS,UAAU,OAAwB;CACzC,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,IAAI,MAAM,IAAI,SAAS,CAAC,CAAC,KAAK,GAAG,EAAE;CACpE,IAAI,OAAO,KAAK,GACd,OAAO,IAAI,OAAO,QAAQ,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,UAAU,GAAG,KAAK,UAAU,GAAG,EAAE,GAAG,UAAU,IAAI,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;CAEtJ,OAAO,KAAK,UAAU,KAAK,KAAK;AAClC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dsh-std/manifest",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": { "types": "./lib/index.d.ts", "default": "./lib/index.js" },
|
|
10
|
+
"./schema/dsh-plugin-0.15.schema.json": "./schema/dsh-plugin-0.15.schema.json"
|
|
11
|
+
},
|
|
12
|
+
"files": ["lib", "schema"],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"build": "pnpm run typecheck && tsdown",
|
|
15
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
16
|
+
"test": "vitest run"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": { "@dsh-std/core": "workspace:*" },
|
|
19
|
+
"engines": { "node": "^22.19 || >=24" }
|
|
20
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"title": "DSH Plugin Manifest Community Draft v0.15",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"required": ["$schema", "manifestVersion", "id", "name", "version", "facets", "requires", "permissions", "contributes", "subscriptions"],
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": { "type": "string", "format": "uri" },
|
|
9
|
+
"manifestVersion": { "const": "0.15" },
|
|
10
|
+
"id": { "$ref": "#/$defs/namespacedId" },
|
|
11
|
+
"name": { "type": "string", "minLength": 1 },
|
|
12
|
+
"version": { "type": "string", "minLength": 1 },
|
|
13
|
+
"facets": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": ["host"],
|
|
17
|
+
"properties": {
|
|
18
|
+
"host": {
|
|
19
|
+
"type": "object",
|
|
20
|
+
"additionalProperties": false,
|
|
21
|
+
"required": ["entry", "apiVersion"],
|
|
22
|
+
"properties": {
|
|
23
|
+
"entry": { "type": "string", "minLength": 1, "pattern": "^(?![\\\\/])(?![A-Za-z]:[\\\\/])(?!.*(?:^|[\\\\/])\\.\\.(?:[\\\\/]|$)).+$" },
|
|
24
|
+
"apiVersion": { "type": "string", "pattern": "^v[1-9][0-9]*(?:(?:alpha|beta)[1-9][0-9]*)?$" }
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"requires": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"additionalProperties": false,
|
|
32
|
+
"required": ["contracts"],
|
|
33
|
+
"properties": {
|
|
34
|
+
"contracts": { "type": "array", "items": { "$ref": "#/$defs/contract" } },
|
|
35
|
+
"services": { "type": "array", "maxItems": 0 }
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"permissions": { "type": "array", "items": { "$ref": "#/$defs/permission" } },
|
|
39
|
+
"contributes": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"required": ["commands"],
|
|
42
|
+
"properties": {
|
|
43
|
+
"commands": { "type": "array", "items": { "$ref": "#/$defs/command" } },
|
|
44
|
+
"panels": { "type": "array", "maxItems": 0 }
|
|
45
|
+
},
|
|
46
|
+
"patternProperties": { "^x-": { "type": "array" } },
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
},
|
|
49
|
+
"subscriptions": {
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": {
|
|
52
|
+
"oneOf": [
|
|
53
|
+
{ "type": "string", "minLength": 1 },
|
|
54
|
+
{ "$ref": "#/$defs/subscription" }
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"license": { "type": "string", "minLength": 1 },
|
|
59
|
+
"source": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"additionalProperties": false,
|
|
62
|
+
"required": ["repository"],
|
|
63
|
+
"properties": {
|
|
64
|
+
"repository": { "type": "string", "format": "uri" },
|
|
65
|
+
"revision": { "type": "string", "minLength": 1 }
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"artifact": {
|
|
69
|
+
"type": "object",
|
|
70
|
+
"additionalProperties": false,
|
|
71
|
+
"required": ["digest", "algorithm", "path"],
|
|
72
|
+
"properties": {
|
|
73
|
+
"digest": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
|
|
74
|
+
"algorithm": { "const": "sha256" },
|
|
75
|
+
"path": { "type": "string", "minLength": 1 }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"compat": {
|
|
79
|
+
"type": "object",
|
|
80
|
+
"additionalProperties": false,
|
|
81
|
+
"properties": { "hosts": { "type": "array", "items": { "type": "string", "minLength": 1 } } }
|
|
82
|
+
},
|
|
83
|
+
"overrides": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"additionalProperties": false,
|
|
88
|
+
"required": ["target", "kind"],
|
|
89
|
+
"properties": {
|
|
90
|
+
"target": { "type": "string", "minLength": 1 },
|
|
91
|
+
"kind": { "enum": ["patch", "native", "build"] },
|
|
92
|
+
"description": { "type": "string", "minLength": 1 }
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"patternProperties": { "^x-": {} },
|
|
98
|
+
"$defs": {
|
|
99
|
+
"namespacedId": { "type": "string", "pattern": "^[a-z][a-z0-9]*(?:[.-][a-z0-9][a-z0-9-]*)+$" },
|
|
100
|
+
"apiVersion": { "type": "string", "pattern": "^[a-z][a-z0-9.-]*/v[1-9][0-9]*(?:(?:alpha|beta)[1-9][0-9]*)?$" },
|
|
101
|
+
"kind": { "type": "string", "pattern": "^[A-Z][A-Za-z0-9]*$" },
|
|
102
|
+
"contract": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": ["apiVersion", "kind"],
|
|
106
|
+
"properties": {
|
|
107
|
+
"apiVersion": { "$ref": "#/$defs/apiVersion" },
|
|
108
|
+
"kind": { "$ref": "#/$defs/kind" },
|
|
109
|
+
"optional": { "type": "boolean" },
|
|
110
|
+
"fallback": { "type": "string", "minLength": 1 }
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
"permission": {
|
|
114
|
+
"type": "object",
|
|
115
|
+
"additionalProperties": false,
|
|
116
|
+
"required": ["name", "scope"],
|
|
117
|
+
"properties": {
|
|
118
|
+
"name": { "$ref": "#/$defs/namespacedId" },
|
|
119
|
+
"scope": { "type": "string", "minLength": 1 },
|
|
120
|
+
"reason": { "type": "string", "minLength": 1 }
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
"command": {
|
|
124
|
+
"type": "object",
|
|
125
|
+
"additionalProperties": false,
|
|
126
|
+
"required": ["id", "title"],
|
|
127
|
+
"properties": {
|
|
128
|
+
"id": { "$ref": "#/$defs/namespacedId" },
|
|
129
|
+
"title": { "type": "string", "minLength": 1 },
|
|
130
|
+
"description": { "type": "string", "minLength": 1 }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"subscription": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"additionalProperties": false,
|
|
136
|
+
"required": ["apiVersion", "kind"],
|
|
137
|
+
"properties": {
|
|
138
|
+
"apiVersion": { "$ref": "#/$defs/apiVersion" },
|
|
139
|
+
"kind": { "$ref": "#/$defs/kind" },
|
|
140
|
+
"scope": { "type": "string", "minLength": 1 }
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DSH Standard contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @dsh-std/presentation
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
Small, invocation-scoped operations that a runtime facet may request from a connected presentation client.
|
|
6
|
+
|
|
7
|
+
## Contracts
|
|
8
|
+
|
|
9
|
+
`v1alpha1` defines four independent presentation protocols:
|
|
10
|
+
|
|
11
|
+
- `OpenExternal` asks the client to open an HTTP or HTTPS URI.
|
|
12
|
+
- `CopyText` asks the client to copy text to its clipboard.
|
|
13
|
+
- `Notification` asks the client to display informational, warning, or error text.
|
|
14
|
+
- `UserInteraction` carries structured questions, one-invocation approvals, and secret input.
|
|
15
|
+
|
|
16
|
+
A facet declares each required operation in its manifest. A client advertises only the protocols it can perform for the current connection. The runtime admits the command only when all required presentation protocols are available, and it accepts only operations declared by that facet. Operations belong to the active invocation; they are not a global event bus or a persistent client capability.
|
|
17
|
+
|
|
18
|
+
The package provides protocol definitions, invocation-scoped typed client and implementation binders, and request/result validation. The Host binds request identity and origin when it creates a client; consumers supply only operation-specific input. It does not perform UI work. Native applications, terminals, browsers, editors, and automation clients may implement different subsets.
|
|
19
|
+
|
|
20
|
+
Simple operations are available from `@dsh-std/presentation/operations`, while interaction types are available from `@dsh-std/presentation/interaction`. A Host-provided `PresentationDescriptor` is only a projection of active agreements for the current invocation; it is not a separate Snapshot protocol.
|
|
21
|
+
|
|
22
|
+
## Known Limitations and Deferred Work
|
|
23
|
+
|
|
24
|
+
- `OpenExternal` intentionally rejects non-HTTP(S) URI schemes.
|
|
25
|
+
- Clipboard reads, arbitrary UI trees, and file pickers are not defined.
|
|
26
|
+
- Delivery acknowledgement and durable replay are outside `v1alpha1`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @dsh-std/presentation
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
拟议设计见 [Presentation Operations](../../docs/proposals/presentation.zh.md)。
|
|
6
|
+
|
|
7
|
+
运行时插件可以向已连接表现客户端请求的小型、调用作用域内操作。
|
|
8
|
+
|
|
9
|
+
## 协议
|
|
10
|
+
|
|
11
|
+
`v1alpha1` 定义四个彼此独立的表现协议:
|
|
12
|
+
|
|
13
|
+
- `OpenExternal` 请求客户端打开 HTTP 或 HTTPS URI;
|
|
14
|
+
- `CopyText` 请求客户端把文本复制到剪贴板;
|
|
15
|
+
- `Notification` 请求客户端显示信息、警告或错误文本;
|
|
16
|
+
- `UserInteraction` 承载结构化 question、单次 approval 和 secret input。
|
|
17
|
+
|
|
18
|
+
Facet 在清单中声明每项所需操作。客户端只为当前连接声明自己能够执行的协议。仅当全部必需表现协议可用时,运行时才接纳命令;运行时也只接受该 facet 事先声明的操作。操作属于当前调用,不是全局事件总线或持久客户端能力。
|
|
19
|
+
|
|
20
|
+
本包提供 protocol definitions、调用作用域内的类型化 client/implementation binder、请求与结果校验。Host 创建 client 时绑定 request identity 与 origin,Consumer 只提交 operation 自有输入。它不执行 UI 工作;原生应用、终端、浏览器、编辑器和自动化客户端可以实现不同子集。
|
|
21
|
+
|
|
22
|
+
普通操作可以从 `@dsh-std/presentation/operations` 导入,交互协议可以从 `@dsh-std/presentation/interaction` 导入。Host 交给领域调用的 `PresentationDescriptor` 只是当前 invocation active agreements 的投影,不是额外的 Snapshot 协议。
|
|
23
|
+
|
|
24
|
+
## 已知限制与暂缓事项
|
|
25
|
+
|
|
26
|
+
- `OpenExternal` 有意拒绝非 HTTP(S) URI scheme。
|
|
27
|
+
- 协议不定义剪贴板读取、任意 UI tree 或文件选择器。
|
|
28
|
+
- `v1alpha1` 不包含投递确认与持久回放。
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { CapabilityClient, CapabilityHandlerContext, CapabilityImplementation } from "@dsh-std/connection";
|
|
2
|
+
import { ProtocolCatalog, ProtocolDefinition, ProtocolSupport } from "@dsh-std/core";
|
|
3
|
+
//#region src/index.d.ts
|
|
4
|
+
declare const API_VERSION = "presentation.dsh/v1alpha1";
|
|
5
|
+
declare const OPEN_EXTERNAL_KIND = "OpenExternal";
|
|
6
|
+
declare const COPY_TEXT_KIND = "CopyText";
|
|
7
|
+
declare const NOTIFICATION_KIND = "Notification";
|
|
8
|
+
declare const USER_INTERACTION_KIND = "UserInteraction";
|
|
9
|
+
interface PresentationDescriptor {
|
|
10
|
+
/** Endpoint identity selected and authenticated by the Host for this invocation. */
|
|
11
|
+
readonly clientId: string;
|
|
12
|
+
/** Active Presentation agreements projected into this invocation. */
|
|
13
|
+
readonly contracts: readonly ProtocolSupport[];
|
|
14
|
+
}
|
|
15
|
+
interface PresentationRequestContext {
|
|
16
|
+
readonly requestId: string;
|
|
17
|
+
readonly invocationId: string;
|
|
18
|
+
readonly origin: string;
|
|
19
|
+
readonly deadline?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Invocation authority supplied by the Host when it creates scoped clients. */
|
|
22
|
+
interface PresentationInvocationScope {
|
|
23
|
+
readonly invocationId: string;
|
|
24
|
+
readonly origin: string;
|
|
25
|
+
readonly deadline?: string;
|
|
26
|
+
nextRequestId(): string;
|
|
27
|
+
}
|
|
28
|
+
type PresentationResult<T> = {
|
|
29
|
+
readonly status: 'submitted';
|
|
30
|
+
readonly value: T;
|
|
31
|
+
} | {
|
|
32
|
+
readonly status: 'cancelled';
|
|
33
|
+
} | {
|
|
34
|
+
readonly status: 'expired';
|
|
35
|
+
} | {
|
|
36
|
+
readonly status: 'unavailable';
|
|
37
|
+
readonly reason?: string;
|
|
38
|
+
};
|
|
39
|
+
interface OpenExternalRequest extends PresentationRequestContext {
|
|
40
|
+
readonly uri: string;
|
|
41
|
+
}
|
|
42
|
+
type OpenExternalInput = Omit<OpenExternalRequest, keyof PresentationRequestContext>;
|
|
43
|
+
interface OpenExternalReceipt {
|
|
44
|
+
readonly accepted: true;
|
|
45
|
+
}
|
|
46
|
+
interface CopyTextRequest extends PresentationRequestContext {
|
|
47
|
+
readonly text: string;
|
|
48
|
+
readonly sensitivity?: 'public' | 'private';
|
|
49
|
+
}
|
|
50
|
+
type CopyTextInput = Omit<CopyTextRequest, keyof PresentationRequestContext>;
|
|
51
|
+
interface CopyTextReceipt {
|
|
52
|
+
readonly accepted: true;
|
|
53
|
+
}
|
|
54
|
+
interface NotificationRequest extends PresentationRequestContext {
|
|
55
|
+
readonly text: string;
|
|
56
|
+
readonly level?: 'info' | 'warning' | 'error';
|
|
57
|
+
readonly deduplicationKey?: string;
|
|
58
|
+
}
|
|
59
|
+
type NotificationInput = Omit<NotificationRequest, keyof PresentationRequestContext>;
|
|
60
|
+
interface NotificationReceipt {
|
|
61
|
+
readonly accepted: true;
|
|
62
|
+
}
|
|
63
|
+
type UserInteractionOperation = 'question' | 'approval' | 'secret-input';
|
|
64
|
+
interface UserInteractionRequirementSpec {
|
|
65
|
+
readonly operations: readonly UserInteractionOperation[];
|
|
66
|
+
readonly optionalOperations?: readonly UserInteractionOperation[];
|
|
67
|
+
}
|
|
68
|
+
interface UserInteractionLimits {
|
|
69
|
+
readonly maxConcurrentRequests?: number;
|
|
70
|
+
readonly maxFields?: number;
|
|
71
|
+
readonly maxOptionsPerField?: number;
|
|
72
|
+
readonly maxTextLength?: number;
|
|
73
|
+
}
|
|
74
|
+
interface UserInteractionSupportSpec {
|
|
75
|
+
readonly operations: readonly UserInteractionOperation[];
|
|
76
|
+
readonly limits?: UserInteractionLimits;
|
|
77
|
+
}
|
|
78
|
+
interface QuestionOption {
|
|
79
|
+
readonly id: string;
|
|
80
|
+
readonly label: string;
|
|
81
|
+
readonly description?: string;
|
|
82
|
+
}
|
|
83
|
+
interface QuestionFieldBase {
|
|
84
|
+
readonly id: string;
|
|
85
|
+
readonly label: string;
|
|
86
|
+
readonly description?: string;
|
|
87
|
+
readonly required?: boolean;
|
|
88
|
+
}
|
|
89
|
+
interface TextQuestionField extends QuestionFieldBase {
|
|
90
|
+
readonly kind: 'text';
|
|
91
|
+
readonly multiline?: boolean;
|
|
92
|
+
readonly minLength?: number;
|
|
93
|
+
readonly maxLength?: number;
|
|
94
|
+
}
|
|
95
|
+
interface SelectQuestionField extends QuestionFieldBase {
|
|
96
|
+
readonly kind: 'select';
|
|
97
|
+
readonly multiple?: boolean;
|
|
98
|
+
readonly options: readonly QuestionOption[];
|
|
99
|
+
}
|
|
100
|
+
interface ConfirmQuestionField extends QuestionFieldBase {
|
|
101
|
+
readonly kind: 'confirm';
|
|
102
|
+
}
|
|
103
|
+
type QuestionField = TextQuestionField | SelectQuestionField | ConfirmQuestionField;
|
|
104
|
+
interface QuestionRequest extends PresentationRequestContext {
|
|
105
|
+
readonly kind: 'question';
|
|
106
|
+
readonly title?: string;
|
|
107
|
+
readonly description?: string;
|
|
108
|
+
readonly fields: readonly QuestionField[];
|
|
109
|
+
}
|
|
110
|
+
interface QuestionAnswers {
|
|
111
|
+
readonly answers: Readonly<Record<string, string | boolean | readonly string[]>>;
|
|
112
|
+
}
|
|
113
|
+
interface ApprovalDetail {
|
|
114
|
+
readonly label: string;
|
|
115
|
+
readonly value: string;
|
|
116
|
+
readonly sensitivity?: 'public' | 'private';
|
|
117
|
+
}
|
|
118
|
+
interface ApprovalRequest extends PresentationRequestContext {
|
|
119
|
+
readonly kind: 'approval';
|
|
120
|
+
readonly action: string;
|
|
121
|
+
readonly summary: string;
|
|
122
|
+
readonly details?: readonly ApprovalDetail[];
|
|
123
|
+
readonly risk?: 'low' | 'medium' | 'high';
|
|
124
|
+
}
|
|
125
|
+
interface ApprovalValue {
|
|
126
|
+
readonly decision: 'approved' | 'denied';
|
|
127
|
+
}
|
|
128
|
+
interface SecretInputRequest extends PresentationRequestContext {
|
|
129
|
+
readonly kind: 'secret-input';
|
|
130
|
+
readonly label: string;
|
|
131
|
+
readonly description?: string;
|
|
132
|
+
readonly minLength?: number;
|
|
133
|
+
readonly maxLength?: number;
|
|
134
|
+
}
|
|
135
|
+
interface SecretInputValue {
|
|
136
|
+
readonly secret: string;
|
|
137
|
+
}
|
|
138
|
+
type UserInteractionRequest = QuestionRequest | ApprovalRequest | SecretInputRequest;
|
|
139
|
+
type UserInteractionValue = QuestionAnswers | ApprovalValue | SecretInputValue;
|
|
140
|
+
type QuestionInput = Omit<QuestionRequest, keyof PresentationRequestContext>;
|
|
141
|
+
type ApprovalInput = Omit<ApprovalRequest, keyof PresentationRequestContext>;
|
|
142
|
+
type SecretInput = Omit<SecretInputRequest, keyof PresentationRequestContext>;
|
|
143
|
+
interface OpenExternalClient {
|
|
144
|
+
openExternal(input: OpenExternalInput, options?: {
|
|
145
|
+
readonly signal?: AbortSignal;
|
|
146
|
+
}): Promise<PresentationResult<OpenExternalReceipt>>;
|
|
147
|
+
}
|
|
148
|
+
interface CopyTextClient {
|
|
149
|
+
copyText(input: CopyTextInput, options?: {
|
|
150
|
+
readonly signal?: AbortSignal;
|
|
151
|
+
}): Promise<PresentationResult<CopyTextReceipt>>;
|
|
152
|
+
}
|
|
153
|
+
interface NotificationClient {
|
|
154
|
+
notify(input: NotificationInput, options?: {
|
|
155
|
+
readonly signal?: AbortSignal;
|
|
156
|
+
}): Promise<PresentationResult<NotificationReceipt>>;
|
|
157
|
+
}
|
|
158
|
+
interface UserInteractionClient {
|
|
159
|
+
interact(input: QuestionInput, options?: {
|
|
160
|
+
readonly signal?: AbortSignal;
|
|
161
|
+
}): Promise<PresentationResult<QuestionAnswers>>;
|
|
162
|
+
interact(input: ApprovalInput, options?: {
|
|
163
|
+
readonly signal?: AbortSignal;
|
|
164
|
+
}): Promise<PresentationResult<ApprovalValue>>;
|
|
165
|
+
interact(input: SecretInput, options?: {
|
|
166
|
+
readonly signal?: AbortSignal;
|
|
167
|
+
}): Promise<PresentationResult<SecretInputValue>>;
|
|
168
|
+
}
|
|
169
|
+
/** Typed Presentation capabilities available to one domain invocation. */
|
|
170
|
+
interface PresentationClients {
|
|
171
|
+
readonly descriptor: PresentationDescriptor;
|
|
172
|
+
readonly openExternal?: OpenExternalClient;
|
|
173
|
+
readonly copyText?: CopyTextClient;
|
|
174
|
+
readonly notification?: NotificationClient;
|
|
175
|
+
readonly interaction?: UserInteractionClient;
|
|
176
|
+
}
|
|
177
|
+
interface OpenExternalHandler {
|
|
178
|
+
openExternal(request: OpenExternalRequest, context: CapabilityHandlerContext): PresentationResult<OpenExternalReceipt> | Promise<PresentationResult<OpenExternalReceipt>>;
|
|
179
|
+
}
|
|
180
|
+
interface CopyTextHandler {
|
|
181
|
+
copyText(request: CopyTextRequest, context: CapabilityHandlerContext): PresentationResult<CopyTextReceipt> | Promise<PresentationResult<CopyTextReceipt>>;
|
|
182
|
+
}
|
|
183
|
+
interface NotificationHandler {
|
|
184
|
+
notify(request: NotificationRequest, context: CapabilityHandlerContext): PresentationResult<NotificationReceipt> | Promise<PresentationResult<NotificationReceipt>>;
|
|
185
|
+
}
|
|
186
|
+
interface UserInteractionHandler {
|
|
187
|
+
interact(request: QuestionRequest, context: CapabilityHandlerContext): PresentationResult<QuestionAnswers> | Promise<PresentationResult<QuestionAnswers>>;
|
|
188
|
+
interact(request: ApprovalRequest, context: CapabilityHandlerContext): PresentationResult<ApprovalValue> | Promise<PresentationResult<ApprovalValue>>;
|
|
189
|
+
interact(request: SecretInputRequest, context: CapabilityHandlerContext): PresentationResult<SecretInputValue> | Promise<PresentationResult<SecretInputValue>>;
|
|
190
|
+
}
|
|
191
|
+
declare const openExternalProtocol: ProtocolDefinition<unknown, unknown, unknown, unknown>;
|
|
192
|
+
declare const copyTextProtocol: ProtocolDefinition<unknown, unknown, unknown, unknown>;
|
|
193
|
+
declare const notificationProtocol: ProtocolDefinition<unknown, unknown, unknown, unknown>;
|
|
194
|
+
declare const openExternalSupport: ProtocolSupport;
|
|
195
|
+
declare const copyTextSupport: ProtocolSupport;
|
|
196
|
+
declare const notificationSupport: ProtocolSupport;
|
|
197
|
+
declare const userInteractionSupport: (spec: UserInteractionSupportSpec) => ProtocolSupport<UserInteractionSupportSpec>;
|
|
198
|
+
declare const userInteractionProtocol: ProtocolDefinition<UserInteractionRequirementSpec, UserInteractionSupportSpec>;
|
|
199
|
+
declare const protocols: readonly ProtocolDefinition[];
|
|
200
|
+
declare function register(catalog: ProtocolCatalog): () => void;
|
|
201
|
+
declare function openExternalClient(client: CapabilityClient, scope: PresentationInvocationScope): OpenExternalClient;
|
|
202
|
+
declare function copyTextClient(client: CapabilityClient, scope: PresentationInvocationScope): CopyTextClient;
|
|
203
|
+
declare function notificationClient(client: CapabilityClient, scope: PresentationInvocationScope): NotificationClient;
|
|
204
|
+
declare function userInteractionClient(client: CapabilityClient, scope: PresentationInvocationScope): UserInteractionClient;
|
|
205
|
+
declare function presentationClients(descriptor: PresentationDescriptor, client: CapabilityClient, scope: PresentationInvocationScope): PresentationClients;
|
|
206
|
+
declare function openExternalImplementation(participantId: string, handler: OpenExternalHandler): CapabilityImplementation;
|
|
207
|
+
declare function copyTextImplementation(participantId: string, handler: CopyTextHandler): CapabilityImplementation;
|
|
208
|
+
declare function notificationImplementation(participantId: string, handler: NotificationHandler): CapabilityImplementation;
|
|
209
|
+
declare function userInteractionImplementation(participantId: string, spec: UserInteractionSupportSpec, handler: UserInteractionHandler): CapabilityImplementation;
|
|
210
|
+
declare function validatePresentationDescriptor(value: unknown): asserts value is PresentationDescriptor;
|
|
211
|
+
declare function validateOpenExternalRequest(value: unknown): asserts value is OpenExternalRequest;
|
|
212
|
+
declare function validateCopyTextRequest(value: unknown): asserts value is CopyTextRequest;
|
|
213
|
+
declare function validateNotificationRequest(value: unknown): asserts value is NotificationRequest;
|
|
214
|
+
declare function validateUserInteractionRequest(value: unknown): asserts value is UserInteractionRequest;
|
|
215
|
+
declare function validateUserInteractionRequirement(value: unknown): UserInteractionRequirementSpec;
|
|
216
|
+
declare function validateUserInteractionSupport(value: unknown): UserInteractionSupportSpec;
|
|
217
|
+
//#endregion
|
|
218
|
+
export { API_VERSION, ApprovalDetail, ApprovalInput, ApprovalRequest, ApprovalValue, COPY_TEXT_KIND, ConfirmQuestionField, CopyTextClient, CopyTextHandler, CopyTextInput, CopyTextReceipt, CopyTextRequest, NOTIFICATION_KIND, NotificationClient, NotificationHandler, NotificationInput, NotificationReceipt, NotificationRequest, OPEN_EXTERNAL_KIND, OpenExternalClient, OpenExternalHandler, OpenExternalInput, OpenExternalReceipt, OpenExternalRequest, PresentationClients, PresentationDescriptor, PresentationInvocationScope, PresentationRequestContext, PresentationResult, QuestionAnswers, QuestionField, QuestionInput, QuestionOption, QuestionRequest, SecretInput, SecretInputRequest, SecretInputValue, SelectQuestionField, TextQuestionField, USER_INTERACTION_KIND, UserInteractionClient, UserInteractionHandler, UserInteractionLimits, UserInteractionOperation, UserInteractionRequest, UserInteractionRequirementSpec, UserInteractionSupportSpec, UserInteractionValue, copyTextClient, copyTextImplementation, copyTextProtocol, copyTextSupport, notificationClient, notificationImplementation, notificationProtocol, notificationSupport, openExternalClient, openExternalImplementation, openExternalProtocol, openExternalSupport, presentationClients, protocols, register, userInteractionClient, userInteractionImplementation, userInteractionProtocol, userInteractionSupport, validateCopyTextRequest, validateNotificationRequest, validateOpenExternalRequest, validatePresentationDescriptor, validateUserInteractionRequest, validateUserInteractionRequirement, validateUserInteractionSupport };
|
|
219
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;cAgBa;cACA;cACA;cACA;cACA;UAEI;;WAEN;;WAEA,oBAAoB;;UAGd;WACN;WACA;WACA;WACA;;;UAIM;WACN;WACA;WACA;EACT;;KAGU,mBAAmB;WAChB;WAA8B,OAAO;;WACrC;;WACA;;WACA;WAAgC;;UAE9B,4BAA4B;WAClC;;KAGC,oBAAoB,KAAK,2BAA2B;UAE/C;WAA+B;;UAE/B,wBAAwB;WAC9B;WACA;;KAGC,gBAAgB,KAAK,uBAAuB;UAEvC;WAA2B;;UAE3B,4BAA4B;WAClC;WACA;WACA;;KAGC,oBAAoB,KAAK,2BAA2B;UAE/C;WAA+B;;KAEpC;UAEK;WACN,qBAAqB;WACrB,8BAA8B;;UAGxB;WACN;WACA;WACA;WACA;;UAGM;WACN,qBAAqB;WACrB,SAAS;;UAGH;WACN;WACA;WACA;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