@jini-ai/admin 0.3.10 → 0.4.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/CHANGELOG.md +64 -0
- package/README.md +71 -37
- package/dist/agent-plugins/adapters/http.d.ts +7 -0
- package/dist/agent-plugins/adapters/http.js +15 -0
- package/dist/agent-plugins/adapters/memory.d.ts +8 -0
- package/dist/agent-plugins/adapters/memory.js +25 -0
- package/dist/agent-plugins/agent-plugins.module.d.ts +51 -0
- package/dist/agent-plugins/agent-plugins.module.js +6 -0
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.d.ts +12 -0
- package/dist/agent-plugins/conformance/agent-plugins-api.conformance.js +47 -0
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.d.ts +20 -0
- package/dist/agent-plugins/controllers/agent-plugin-files.controller.js +43 -0
- package/dist/agent-plugins/controllers/agent-plugins.controller.d.ts +25 -0
- package/dist/agent-plugins/controllers/agent-plugins.controller.js +91 -0
- package/dist/agent-plugins/index.d.ts +9 -0
- package/dist/agent-plugins/index.js +9 -0
- package/dist/agent-plugins/messages.en.d.ts +23 -0
- package/dist/agent-plugins/messages.en.js +14 -0
- package/dist/agent-plugins/models.d.ts +57 -0
- package/dist/agent-plugins/models.js +2 -0
- package/dist/agent-plugins/package-file-tree.d.ts +111 -0
- package/dist/agent-plugins/package-file-tree.js +188 -0
- package/dist/agent-plugins/ports.d.ts +18 -0
- package/dist/agent-plugins/ports.js +3 -0
- package/dist/agent-plugins/react/components/AgentPluginFileContent.d.ts +5 -0
- package/dist/agent-plugins/react/components/AgentPluginFileContent.js +9 -0
- package/dist/agent-plugins/react/components/AgentPluginFileTree.d.ts +9 -0
- package/dist/agent-plugins/react/components/AgentPluginFileTree.js +7 -0
- package/dist/agent-plugins/react/components/AgentPluginInspector.d.ts +3 -0
- package/dist/agent-plugins/react/components/AgentPluginInspector.js +11 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.d.ts +6 -0
- package/dist/agent-plugins/react/components/AgentPluginListPanel.js +10 -0
- package/dist/agent-plugins/react/components/AgentPluginRow.d.ts +5 -0
- package/dist/agent-plugins/react/components/AgentPluginRow.js +8 -0
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.d.ts +90 -0
- package/dist/agent-plugins/react/hooks/AgentPluginInspector.hooks.js +74 -0
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.d.ts +67 -0
- package/dist/agent-plugins/react/hooks/AgentPluginPanel.hooks.js +50 -0
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.d.ts +55 -0
- package/dist/agent-plugins/react/hooks/AgentPluginRow.hooks.js +6 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.d.ts +64 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPage.hooks.js +39 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.d.ts +7 -0
- package/dist/agent-plugins/react/hooks/AgentPluginsPorts.hooks.js +10 -0
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.d.ts +6 -0
- package/dist/agent-plugins/react/hooks/MarketplaceTab.hooks.js +3 -0
- package/dist/agent-plugins/react/index.d.ts +245 -0
- package/dist/agent-plugins/react/index.js +13 -0
- package/dist/agent-plugins/react/pages/AgentPluginsPage.d.ts +4 -0
- package/dist/agent-plugins/react/pages/AgentPluginsPage.js +12 -0
- package/dist/agent-plugins/react/tabs/DownloadedTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/DownloadedTab.js +5 -0
- package/dist/agent-plugins/react/tabs/InstalledTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/InstalledTab.js +5 -0
- package/dist/agent-plugins/react/tabs/MarketplaceTab.d.ts +4 -0
- package/dist/agent-plugins/react/tabs/MarketplaceTab.js +10 -0
- package/dist/agent-plugins/rules.d.ts +33 -0
- package/dist/agent-plugins/rules.js +51 -0
- package/dist/browser/index.d.ts +1 -0
- package/dist/browser/index.js +1 -0
- package/dist/browser/navigation.d.ts +19 -4
- package/dist/browser/navigation.js +8 -8
- package/dist/browser/shell-navigation.d.ts +12 -0
- package/dist/browser/shell-navigation.js +16 -0
- package/dist/contracts/credential-management.d.ts +8 -0
- package/dist/contracts/credential-management.js +3 -0
- package/dist/contracts/media-picker.d.ts +17 -0
- package/dist/contracts/media-picker.js +5 -0
- package/dist/contracts/playground-render-target.d.ts +18 -0
- package/dist/contracts/playground-render-target.js +3 -0
- package/dist/core/entities/rules.d.ts +138 -0
- package/dist/core/entities/rules.js +344 -0
- package/dist/core/gated/types.d.ts +8 -4
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +1 -0
- package/dist/core/manifest/rules.d.ts +24 -6
- package/dist/core/manifest/rules.js +12 -11
- package/dist/core/module/controller-store.d.ts +22 -0
- package/dist/core/module/controller-store.js +32 -0
- package/dist/core/module/create-admin.d.ts +41 -0
- package/dist/core/module/create-admin.js +187 -0
- package/dist/core/module/define-admin-module.d.ts +4 -0
- package/dist/core/module/define-admin-module.js +5 -0
- package/dist/core/module/index.d.ts +7 -0
- package/dist/core/module/index.js +4 -0
- package/dist/core/module/token.d.ts +19 -0
- package/dist/core/module/token.js +4 -0
- package/dist/core/module/types.d.ts +79 -0
- package/dist/core/module/types.js +2 -0
- package/dist/core/permissions/rules.d.ts +4 -1
- package/dist/core/permissions/rules.js +1 -1
- package/dist/core/ports/analytics.d.ts +1 -1
- package/dist/core/ports/auth.d.ts +2 -2
- package/dist/core/ports/comments.d.ts +9 -6
- package/dist/core/ports/database.d.ts +13 -10
- package/dist/core/ports/entities.d.ts +302 -0
- package/dist/core/ports/entities.js +47 -0
- package/dist/core/ports/forms.d.ts +19 -7
- package/dist/core/ports/identity.d.ts +42 -17
- package/dist/core/ports/index.d.ts +2 -0
- package/dist/core/ports/integrations.d.ts +9 -4
- package/dist/core/ports/media.d.ts +16 -7
- package/dist/core/ports/members.d.ts +7 -3
- package/dist/core/ports/menus.d.ts +46 -0
- package/dist/core/ports/menus.js +43 -0
- package/dist/core/ports/plugins.d.ts +3 -2
- package/dist/core/ports/recovery.d.ts +10 -6
- package/dist/core/ports/redirects.d.ts +17 -7
- package/dist/core/ports/seo.d.ts +12 -6
- package/dist/core/ports/shell.d.ts +41 -0
- package/dist/core/ports/shell.js +2 -0
- package/dist/core/ports/workspace.d.ts +3 -3
- package/dist/core/routing/rules.d.ts +17 -4
- package/dist/core/routing/rules.js +4 -4
- package/dist/core/transport/errors.d.ts +13 -4
- package/dist/core/transport/errors.js +4 -4
- package/dist/core/transport/http.d.ts +26 -16
- package/dist/core/transport/http.js +59 -21
- package/dist/core/transport/types.d.ts +26 -14
- package/dist/core/transport/types.js +9 -7
- package/dist/media/adapters/http.d.ts +27 -0
- package/dist/media/adapters/http.js +44 -0
- package/dist/media/adapters/memory.d.ts +11 -0
- package/dist/media/adapters/memory.js +139 -0
- package/dist/media/conformance/media-api.conformance.d.ts +7 -0
- package/dist/media/conformance/media-api.conformance.js +69 -0
- package/dist/media/controllers/edit-media.controller.d.ts +24 -0
- package/dist/media/controllers/edit-media.controller.js +69 -0
- package/dist/media/controllers/library.controller.d.ts +47 -0
- package/dist/media/controllers/library.controller.js +173 -0
- package/dist/media/controllers/providers.controller.d.ts +30 -0
- package/dist/media/controllers/providers.controller.js +76 -0
- package/dist/media/html-attributes.d.ts +82 -0
- package/dist/media/html-attributes.js +204 -0
- package/dist/media/index.d.ts +12 -0
- package/dist/media/index.js +9 -0
- package/dist/media/media.module.d.ts +83 -0
- package/dist/media/media.module.js +43 -0
- package/dist/media/messages.en.d.ts +24 -0
- package/dist/media/messages.en.js +24 -0
- package/dist/media/models.d.ts +72 -0
- package/dist/media/models.js +2 -0
- package/dist/media/ports.d.ts +75 -0
- package/dist/media/ports.js +7 -0
- package/dist/media/react/components/EditMediaPanel.d.ts +3 -0
- package/dist/media/react/components/EditMediaPanel.js +10 -0
- package/dist/media/react/components/MediaCard.d.ts +5 -0
- package/dist/media/react/components/MediaCard.js +17 -0
- package/dist/media/react/components/MediaDialog.d.ts +3 -0
- package/dist/media/react/components/MediaDialog.js +8 -0
- package/dist/media/react/components/MediaGrid.d.ts +4 -0
- package/dist/media/react/components/MediaGrid.js +8 -0
- package/dist/media/react/components/MediaIcons.d.ts +14 -0
- package/dist/media/react/components/MediaIcons.js +39 -0
- package/dist/media/react/components/MediaLightbox.d.ts +5 -0
- package/dist/media/react/components/MediaLightbox.js +12 -0
- package/dist/media/react/components/MediaPicker.d.ts +3 -0
- package/dist/media/react/components/MediaPicker.js +10 -0
- package/dist/media/react/components/MediaPurgeDialog.d.ts +4 -0
- package/dist/media/react/components/MediaPurgeDialog.js +9 -0
- package/dist/media/react/components/UploadButton.d.ts +3 -0
- package/dist/media/react/components/UploadButton.js +8 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.d.ts +84 -0
- package/dist/media/react/hooks/EditMediaPanel.hooks.js +105 -0
- package/dist/media/react/hooks/LibraryTab.hooks.d.ts +103 -0
- package/dist/media/react/hooks/LibraryTab.hooks.js +164 -0
- package/dist/media/react/hooks/MediaCard.hooks.d.ts +83 -0
- package/dist/media/react/hooks/MediaCard.hooks.js +66 -0
- package/dist/media/react/hooks/MediaDialog.hooks.d.ts +10 -0
- package/dist/media/react/hooks/MediaDialog.hooks.js +20 -0
- package/dist/media/react/hooks/MediaGrid.hooks.d.ts +29 -0
- package/dist/media/react/hooks/MediaGrid.hooks.js +6 -0
- package/dist/media/react/hooks/MediaLightbox.hooks.d.ts +27 -0
- package/dist/media/react/hooks/MediaLightbox.hooks.js +64 -0
- package/dist/media/react/hooks/MediaPage.hooks.d.ts +68 -0
- package/dist/media/react/hooks/MediaPage.hooks.js +68 -0
- package/dist/media/react/hooks/MediaPicker.hooks.d.ts +26 -0
- package/dist/media/react/hooks/MediaPicker.hooks.js +25 -0
- package/dist/media/react/hooks/MediaPorts.hooks.d.ts +9 -0
- package/dist/media/react/hooks/MediaPorts.hooks.js +10 -0
- package/dist/media/react/hooks/MediaPurgeDialog.hooks.d.ts +22 -0
- package/dist/media/react/hooks/MediaPurgeDialog.hooks.js +6 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.d.ts +55 -0
- package/dist/media/react/hooks/ProvidersTab.hooks.js +124 -0
- package/dist/media/react/hooks/UploadButton.hooks.d.ts +48 -0
- package/dist/media/react/hooks/UploadButton.hooks.js +118 -0
- package/dist/media/react/index.d.ts +373 -0
- package/dist/media/react/index.js +73 -0
- package/dist/media/react/pages/MediaPage.d.ts +4 -0
- package/dist/media/react/pages/MediaPage.js +9 -0
- package/dist/media/react/tabs/LibraryTab.d.ts +4 -0
- package/dist/media/react/tabs/LibraryTab.js +14 -0
- package/dist/media/react/tabs/ProvidersTab.d.ts +4 -0
- package/dist/media/react/tabs/ProvidersTab.js +10 -0
- package/dist/media/rules.d.ts +86 -0
- package/dist/media/rules.js +134 -0
- package/dist/media/styles.d.ts +4 -0
- package/dist/media/styles.js +5 -0
- package/dist/playground/adapters/http.d.ts +8 -0
- package/dist/playground/adapters/http.js +4 -0
- package/dist/playground/adapters/memory.d.ts +10 -0
- package/dist/playground/adapters/memory.js +30 -0
- package/dist/playground/conformance/playground-api.conformance.d.ts +6 -0
- package/dist/playground/conformance/playground-api.conformance.js +37 -0
- package/dist/playground/controllers/playground.controller.d.ts +16 -0
- package/dist/playground/controllers/playground.controller.js +21 -0
- package/dist/playground/index.d.ts +7 -0
- package/dist/playground/index.js +5 -0
- package/dist/playground/messages.en.d.ts +9 -0
- package/dist/playground/messages.en.js +2 -0
- package/dist/playground/models.d.ts +4 -0
- package/dist/playground/models.js +2 -0
- package/dist/playground/playground.module.d.ts +31 -0
- package/dist/playground/playground.module.js +5 -0
- package/dist/playground/ports.d.ts +5 -0
- package/dist/playground/ports.js +2 -0
- package/dist/playground/react/components/Canvas.d.ts +3 -0
- package/dist/playground/react/components/Canvas.js +9 -0
- package/dist/playground/react/hooks/Canvas.hooks.d.ts +7 -0
- package/dist/playground/react/hooks/Canvas.hooks.js +18 -0
- package/dist/playground/react/hooks/PlaygroundPage.hooks.d.ts +8 -0
- package/dist/playground/react/hooks/PlaygroundPage.hooks.js +2 -0
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.d.ts +4 -0
- package/dist/playground/react/hooks/PlaygroundPorts.hooks.js +6 -0
- package/dist/playground/react/index.d.ts +136 -0
- package/dist/playground/react/index.js +10 -0
- package/dist/playground/react/pages/PlaygroundPage.d.ts +4 -0
- package/dist/playground/react/pages/PlaygroundPage.js +11 -0
- package/dist/playground/react/tabs/CanvasTab.d.ts +4 -0
- package/dist/playground/react/tabs/CanvasTab.js +5 -0
- package/dist/playground/rules.d.ts +4 -0
- package/dist/playground/rules.js +2 -0
- package/dist/react/OverlayHost.d.ts +3 -0
- package/dist/react/OverlayHost.hooks.d.ts +9 -0
- package/dist/react/OverlayHost.hooks.js +9 -0
- package/dist/react/OverlayHost.js +7 -0
- package/dist/react/bind-react.d.ts +46 -0
- package/dist/react/bind-react.js +28 -0
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.d.ts +7 -1
- package/dist/react/components/ConfirmButton/ConfirmButton.hooks.js +2 -2
- package/dist/react/components/ConfirmButton/ConfirmButton.js +1 -1
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.d.ts +17 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.hooks.js +3 -3
- package/dist/react/components/ConfirmDialog/ConfirmDialog.js +5 -5
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.d.ts +6 -2
- package/dist/react/components/InteractiveHtmlEditor/InteractiveHtmlEditor.js +7 -8
- package/dist/react/components/RowMenu/RowMenu.d.ts +5 -1
- package/dist/react/components/RowMenu/RowMenu.hooks.d.ts +8 -2
- package/dist/react/components/RowMenu/RowMenu.hooks.js +4 -4
- package/dist/react/components/RowMenu/RowMenu.js +6 -6
- package/dist/react/components/Sidebar.d.ts +1 -1
- package/dist/react/components/Sidebar.js +103 -7
- package/dist/react/entities/EntityCell.d.ts +10 -0
- package/dist/react/entities/EntityCell.js +18 -0
- package/dist/react/entities/EntityDetail.d.ts +3 -0
- package/dist/react/entities/EntityDetail.js +21 -0
- package/dist/react/entities/EntityEdit.d.ts +13 -0
- package/dist/react/entities/EntityEdit.js +45 -0
- package/dist/react/entities/EntityField.d.ts +20 -0
- package/dist/react/entities/EntityField.js +31 -0
- package/dist/react/entities/EntityIndex.d.ts +3 -0
- package/dist/react/entities/EntityIndex.js +10 -0
- package/dist/react/entities/EntityList.d.ts +7 -0
- package/dist/react/entities/EntityList.js +52 -0
- package/dist/react/entities/contribution.d.ts +26 -0
- package/dist/react/entities/contribution.js +78 -0
- package/dist/react/entities/index.d.ts +10 -0
- package/dist/react/entities/index.js +7 -0
- package/dist/react/entities/rules.d.ts +179 -0
- package/dist/react/entities/rules.js +224 -0
- package/dist/react/entities/types.d.ts +45 -0
- package/dist/react/entities/types.js +5 -0
- package/dist/react/entities/use-entity-edit.d.ts +35 -0
- package/dist/react/entities/use-entity-edit.js +98 -0
- package/dist/react/entities/use-entity-read.d.ts +22 -0
- package/dist/react/entities/use-entity-read.js +27 -0
- package/dist/react/hooks/use-nav-sections.d.ts +12 -3
- package/dist/react/hooks/use-nav-sections.js +14 -14
- package/dist/react/hooks/use-sidebar-rail.d.ts +7 -1
- package/dist/react/hooks/use-sidebar-rail.js +11 -11
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.js +5 -2
- package/dist/react/overlays.d.ts +38 -0
- package/dist/react/overlays.js +46 -0
- package/dist/react/shell/AdminShell.d.ts +9 -0
- package/dist/react/shell/AdminShell.hooks.d.ts +15 -0
- package/dist/react/shell/AdminShell.hooks.js +27 -0
- package/dist/react/shell/AdminShell.js +46 -0
- package/dist/react/shell/index.d.ts +7 -0
- package/dist/react/shell/index.js +5 -0
- package/dist/react/shell/model.d.ts +25 -0
- package/dist/react/shell/model.js +29 -0
- package/dist/react/shell/theme-ports.d.ts +28 -0
- package/dist/react/shell/theme-ports.js +2 -0
- package/dist/react/shell/types.d.ts +99 -0
- package/dist/react/shell/types.js +2 -0
- package/dist/react/shell/use-admin-shell-session.d.ts +13 -0
- package/dist/react/shell/use-admin-shell-session.js +81 -0
- package/dist/react/shell/use-admin-theme.d.ts +16 -0
- package/dist/react/shell/use-admin-theme.js +57 -0
- package/dist/react/types.d.ts +6 -4
- package/dist/react/types.js +2 -2
- package/dist/react/use-controller.d.ts +16 -0
- package/dist/react/use-controller.js +18 -0
- package/dist/security/adapters/http.d.ts +16 -0
- package/dist/security/adapters/http.js +94 -0
- package/dist/security/adapters/memory.d.ts +15 -0
- package/dist/security/adapters/memory.js +60 -0
- package/dist/security/conformance/security-api.conformance.d.ts +10 -0
- package/dist/security/conformance/security-api.conformance.js +48 -0
- package/dist/security/controllers/access-tokens.controller.d.ts +44 -0
- package/dist/security/controllers/access-tokens.controller.js +112 -0
- package/dist/security/controllers/other-credentials.controller.d.ts +30 -0
- package/dist/security/controllers/other-credentials.controller.js +74 -0
- package/dist/security/controllers/root-key.controller.d.ts +35 -0
- package/dist/security/controllers/root-key.controller.js +90 -0
- package/dist/security/index.d.ts +9 -0
- package/dist/security/index.js +9 -0
- package/dist/security/messages.en.d.ts +12 -0
- package/dist/security/messages.en.js +2 -0
- package/dist/security/models.d.ts +112 -0
- package/dist/security/models.js +2 -0
- package/dist/security/ports.d.ts +58 -0
- package/dist/security/ports.js +5 -0
- package/dist/security/react/components/CredentialEditor.d.ts +3 -0
- package/dist/security/react/components/CredentialEditor.js +8 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.d.ts +94 -0
- package/dist/security/react/hooks/AccessTokensTab.hooks.js +36 -0
- package/dist/security/react/hooks/CredentialEditor.hooks.d.ts +49 -0
- package/dist/security/react/hooks/CredentialEditor.hooks.js +14 -0
- package/dist/security/react/hooks/RootKeyTab.hooks.d.ts +29 -0
- package/dist/security/react/hooks/RootKeyTab.hooks.js +19 -0
- package/dist/security/react/hooks/SecurityPage.hooks.d.ts +17 -0
- package/dist/security/react/hooks/SecurityPage.hooks.js +12 -0
- package/dist/security/react/hooks/SecurityPorts.hooks.d.ts +9 -0
- package/dist/security/react/hooks/SecurityPorts.hooks.js +6 -0
- package/dist/security/react/index.d.ts +215 -0
- package/dist/security/react/index.js +10 -0
- package/dist/security/react/pages/SecurityPage.d.ts +4 -0
- package/dist/security/react/pages/SecurityPage.js +10 -0
- package/dist/security/react/tabs/AccessTokensTab.d.ts +4 -0
- package/dist/security/react/tabs/AccessTokensTab.js +10 -0
- package/dist/security/react/tabs/RootKeyTab.d.ts +4 -0
- package/dist/security/react/tabs/RootKeyTab.js +9 -0
- package/dist/security/rules.d.ts +57 -0
- package/dist/security/rules.js +63 -0
- package/dist/security/security.module.d.ts +45 -0
- package/dist/security/security.module.js +5 -0
- package/dist/source-control/adapters/http.d.ts +6 -0
- package/dist/source-control/adapters/http.js +13 -0
- package/dist/source-control/adapters/memory.d.ts +9 -0
- package/dist/source-control/adapters/memory.js +35 -0
- package/dist/source-control/conformance/source-control-api.conformance.d.ts +10 -0
- package/dist/source-control/conformance/source-control-api.conformance.js +48 -0
- package/dist/source-control/controllers/source-control.controller.d.ts +26 -0
- package/dist/source-control/controllers/source-control.controller.js +70 -0
- package/dist/source-control/index.d.ts +8 -0
- package/dist/source-control/index.js +6 -0
- package/dist/source-control/messages.en.d.ts +11 -0
- package/dist/source-control/messages.en.js +2 -0
- package/dist/source-control/models.d.ts +70 -0
- package/dist/source-control/models.js +2 -0
- package/dist/source-control/ports.d.ts +23 -0
- package/dist/source-control/ports.js +3 -0
- package/dist/source-control/react/components/SourceControlCredentialFields.d.ts +5 -0
- package/dist/source-control/react/components/SourceControlCredentialFields.js +8 -0
- package/dist/source-control/react/components/SourceControlProviderRow.d.ts +5 -0
- package/dist/source-control/react/components/SourceControlProviderRow.js +7 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.d.ts +45 -0
- package/dist/source-control/react/hooks/ProvidersTab.hooks.js +20 -0
- package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.d.ts +43 -0
- package/dist/source-control/react/hooks/SourceControlCredentialFields.hooks.js +9 -0
- package/dist/source-control/react/hooks/SourceControlPage.hooks.d.ts +17 -0
- package/dist/source-control/react/hooks/SourceControlPage.hooks.js +5 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.d.ts +9 -0
- package/dist/source-control/react/hooks/SourceControlPorts.hooks.js +6 -0
- package/dist/source-control/react/index.d.ts +156 -0
- package/dist/source-control/react/index.js +10 -0
- package/dist/source-control/react/pages/SourceControlPage.d.ts +4 -0
- package/dist/source-control/react/pages/SourceControlPage.js +11 -0
- package/dist/source-control/react/tabs/ProvidersTab.d.ts +4 -0
- package/dist/source-control/react/tabs/ProvidersTab.js +10 -0
- package/dist/source-control/rules.d.ts +32 -0
- package/dist/source-control/rules.js +35 -0
- package/dist/source-control/source-control.module.d.ts +36 -0
- package/dist/source-control/source-control.module.js +6 -0
- package/package.json +207 -4
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { bindReact } from '../../react/bind-react.js';
|
|
2
|
+
import { agentPluginsModule } from '../agent-plugins.module.js';
|
|
3
|
+
import { AgentPluginsPortsContext } from './hooks/AgentPluginsPorts.hooks.js';
|
|
4
|
+
import { agentPluginsMessagesEn as m } from '../messages.en.js';
|
|
5
|
+
export { useAgentPluginsPorts } from './hooks/AgentPluginsPorts.hooks.js';
|
|
6
|
+
/** Host-owned bundled policy copy. All page/tab loaders remain lazy. */
|
|
7
|
+
export function agentPlugins(_required, { uninstallNotice = m.uninstallUnavailable } = {}) {
|
|
8
|
+
const tabs = { ...agentPluginsModule.pages.agentPlugins.tabs, installed: { ...agentPluginsModule.pages.agentPlugins.tabs.installed, params: { uninstallNotice } }, downloaded: { ...agentPluginsModule.pages.agentPlugins.tabs.downloaded, params: { uninstallNotice } } };
|
|
9
|
+
const module = { ...agentPluginsModule, pages: { agentPlugins: { ...agentPluginsModule.pages.agentPlugins, tabs } } };
|
|
10
|
+
const react = bindReact({ module, views: { agentPlugins: { page: () => import('./pages/AgentPluginsPage.js'), tabs: { installed: () => import('./tabs/InstalledTab.js'), downloaded: () => import('./tabs/DownloadedTab.js'), marketplace: () => import('./tabs/MarketplaceTab.js') } } } }, { context: AgentPluginsPortsContext });
|
|
11
|
+
return Object.assign(module, { react });
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Suspense } from 'react';
|
|
3
|
+
import { ConfirmDialog, Notice, Spinner, Tabs } from '@jini-ai/ui-kit/react';
|
|
4
|
+
import { AgentPluginsPageContext, useAgentPluginsPage } from '../hooks/AgentPluginsPage.hooks.js';
|
|
5
|
+
import { AgentPluginInspector } from '../components/AgentPluginInspector.js';
|
|
6
|
+
import { agentPluginsMessagesEn as m } from '../../messages.en.js';
|
|
7
|
+
export function AgentPluginsPage(props, _optional = {}) {
|
|
8
|
+
const vm = useAgentPluginsPage(props);
|
|
9
|
+
return _jsxs("section", { "data-jini-part": "agent-plugins.page", children: [_jsx("h1", { children: props.description.label }), vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs(AgentPluginsPageContext.Provider, { value: vm.scope, children: [_jsx("p", { children: m.description }), _jsx(Tabs, { label: "Agent Plugin views", value: vm.activeId, items: vm.items, onValueChange: vm.onValueChange }), _jsx(Suspense, { fallback: _jsx(Spinner, { label: m.loading }), children: vm.ActiveTab && _jsx(vm.ActiveTab, { params: vm.params, permissions: vm.permissions }) }), vm.inspector && _jsx(AgentPluginInspector, { pluginId: vm.inspector.pluginId, name: vm.inspector.name, permissions: vm.permissions, onClose: vm.closeInspector }, vm.inspector.pluginId), vm.confirmation && _jsx(ConfirmDialog, { open: true, title: vm.confirmation.title, body: vm.confirmation.body, consequence: "Stops this package\u2019s skills on the next assistant run.", confirmLabel: vm.confirmation.confirmLabel, cancelLabel: "Cancel", tone: "warning", pending: vm.confirming, agentMayConfirm: false, onConfirm: vm.confirm, onCancel: vm.cancel, errorLabel: m.actionError })] })] });
|
|
10
|
+
}
|
|
11
|
+
export default AgentPluginsPage;
|
|
12
|
+
//# sourceMappingURL=AgentPluginsPage.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AgentPluginListPanel } from '../components/AgentPluginListPanel.js';
|
|
3
|
+
export function DownloadedTab(props, _optional = {}) { return _jsx(AgentPluginListPanel, { props: props, mode: "downloaded" }); }
|
|
4
|
+
export default DownloadedTab;
|
|
5
|
+
//# sourceMappingURL=DownloadedTab.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { AgentPluginListPanel } from '../components/AgentPluginListPanel.js';
|
|
3
|
+
export function InstalledTab(props, _optional = {}) { return _jsx(AgentPluginListPanel, { props: props, mode: "installed" }); }
|
|
4
|
+
export default InstalledTab;
|
|
5
|
+
//# sourceMappingURL=InstalledTab.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Notice } from '@jini-ai/ui-kit/react';
|
|
3
|
+
import { useMarketplaceTab } from '../hooks/MarketplaceTab.hooks.js';
|
|
4
|
+
import { agentPluginsMessagesEn as m } from '../../messages.en.js';
|
|
5
|
+
export function MarketplaceTab(props, _optional = {}) {
|
|
6
|
+
const vm = useMarketplaceTab(props);
|
|
7
|
+
return vm.denied ? _jsx(Notice, { tone: "danger", children: m.denied }) : _jsxs("section", { "aria-label": "Agent Plugin Marketplace", children: [_jsx("h2", { children: m.marketplaceTitle }), _jsx("p", { children: m.marketplaceDescription }), _jsx("p", { children: m.marketplaceHint }), _jsx("a", { href: vm.specUrl, target: "_blank", rel: "noreferrer", children: "Read the package format" })] });
|
|
8
|
+
}
|
|
9
|
+
export default MarketplaceTab;
|
|
10
|
+
//# sourceMappingURL=MarketplaceTab.js.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AgentPluginSummary, AgentPluginFiles, AgentPluginPackageFile, AgentPluginDisableRequest } from './models.js';
|
|
2
|
+
export declare const AGENT_PLUGINS_READ = "admin.plugins.read";
|
|
3
|
+
export declare const AGENT_PLUGINS_WRITE = "admin.plugins.enable";
|
|
4
|
+
export declare const AGENT_PLUGINS_SPEC_URL = "https://agent-plugins.org/specification";
|
|
5
|
+
export declare function humanizeAgentPluginId({ pluginId }: {
|
|
6
|
+
pluginId: string;
|
|
7
|
+
}, _optional?: {}): string;
|
|
8
|
+
/** Only wire metadata enters snapshots; never leak lifecycle paths or extra server properties. */
|
|
9
|
+
export declare function agentPluginSummary({ row }: {
|
|
10
|
+
row: AgentPluginSummary;
|
|
11
|
+
}, _optional?: {}): AgentPluginSummary;
|
|
12
|
+
export declare function agentPluginFilesSnapshot({ listing }: {
|
|
13
|
+
listing: AgentPluginFiles;
|
|
14
|
+
}, _optional?: {}): AgentPluginFiles;
|
|
15
|
+
export declare function selectAgentPluginFile({ files, path }: {
|
|
16
|
+
files: readonly AgentPluginPackageFile[];
|
|
17
|
+
path: string;
|
|
18
|
+
}, _optional?: {}): AgentPluginPackageFile | null;
|
|
19
|
+
export declare function agentPluginFileNotice({ file }: {
|
|
20
|
+
file: AgentPluginPackageFile;
|
|
21
|
+
}, _optional?: {}): string | null;
|
|
22
|
+
/** Confirmation names the target and workspace effect; Turn off never implies file deletion. */
|
|
23
|
+
export declare function agentPluginDisableCopy({ pluginId, variant }: AgentPluginDisableRequest, _optional?: {}): {
|
|
24
|
+
title: string;
|
|
25
|
+
confirmLabel: string;
|
|
26
|
+
body: string;
|
|
27
|
+
};
|
|
28
|
+
export type AgentPluginGlyphKind = 'compliance' | 'deploy' | 'design' | 'integration' | 'content' | 'package';
|
|
29
|
+
/** Whole words, strongest evidence first: id, keywords, skills. Never guess a category. */
|
|
30
|
+
export declare function agentPluginGlyphKind({ plugin }: {
|
|
31
|
+
plugin: AgentPluginSummary;
|
|
32
|
+
}, _optional?: {}): AgentPluginGlyphKind;
|
|
33
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { buildPackageFileTree, firstPackageFilePath } from './package-file-tree.js';
|
|
2
|
+
export const AGENT_PLUGINS_READ = 'admin.plugins.read';
|
|
3
|
+
export const AGENT_PLUGINS_WRITE = 'admin.plugins.enable';
|
|
4
|
+
export const AGENT_PLUGINS_SPEC_URL = 'https://agent-plugins.org/specification';
|
|
5
|
+
// Closed vocabulary: no heuristic can distinguish an acronym from a real word reliably.
|
|
6
|
+
const acronyms = new Set(['ai', 'api', 'cli', 'css', 'html', 'http', 'id', 'io', 'json', 'mcp', 'rss', 'sdk', 'seo', 'sql', 'ui', 'url', 'ux', 'yaml']);
|
|
7
|
+
export function humanizeAgentPluginId({ pluginId }, _optional = {}) {
|
|
8
|
+
return pluginId.split('-').filter(Boolean).map(part => acronyms.has(part.toLowerCase()) ? part.toUpperCase() : part.charAt(0).toUpperCase() + part.slice(1)).join(' ');
|
|
9
|
+
}
|
|
10
|
+
/** Only wire metadata enters snapshots; never leak lifecycle paths or extra server properties. */
|
|
11
|
+
export function agentPluginSummary({ row }, _optional = {}) {
|
|
12
|
+
return Object.freeze({ pluginId: row.pluginId, version: row.version ?? null, description: row.description ?? null, keywords: Object.freeze([...row.keywords]), skills: Object.freeze(row.skills.map(s => Object.freeze({ name: s.name, summary: s.summary }))), mcpServerIds: Object.freeze([...row.mcpServerIds]), enabled: row.enabled });
|
|
13
|
+
}
|
|
14
|
+
export function agentPluginFilesSnapshot({ listing }, _optional = {}) {
|
|
15
|
+
return Object.freeze({ pluginId: listing.pluginId, files: Object.freeze(listing.files.map(f => Object.freeze({ relativePath: f.relativePath, sizeBytes: f.sizeBytes, content: f.content, omitted: f.omitted }))), truncated: listing.truncated, limits: Object.freeze({ maxFiles: listing.limits.maxFiles, maxEntries: listing.limits.maxEntries, maxFileBytes: listing.limits.maxFileBytes, maxTotalBytes: listing.limits.maxTotalBytes }) });
|
|
16
|
+
}
|
|
17
|
+
export function selectAgentPluginFile({ files, path }, _optional = {}) {
|
|
18
|
+
const selected = files.find(f => f.relativePath === path);
|
|
19
|
+
if (selected)
|
|
20
|
+
return selected;
|
|
21
|
+
const first = firstPackageFilePath({ nodes: buildPackageFileTree({ paths: files.map(f => f.relativePath) }) });
|
|
22
|
+
return files.find(f => f.relativePath === first) ?? files[0] ?? null;
|
|
23
|
+
}
|
|
24
|
+
const omissions = { binary: 'Binary file — not shown.', 'too-large': 'Too large to show here.', symlink: 'Symbolic link — not followed.', unreadable: 'This file could not be read.' };
|
|
25
|
+
export function agentPluginFileNotice({ file }, _optional = {}) {
|
|
26
|
+
return file.omitted === null && file.content !== null ? null : omissions[file.omitted ?? 'unreadable'] ?? omissions.unreadable;
|
|
27
|
+
}
|
|
28
|
+
/** Confirmation names the target and workspace effect; Turn off never implies file deletion. */
|
|
29
|
+
export function agentPluginDisableCopy({ pluginId, variant }, _optional = {}) {
|
|
30
|
+
const name = humanizeAgentPluginId({ pluginId });
|
|
31
|
+
return { title: variant === 'remove' ? `Turn off ${name}?` : `Disable ${name} for this workspace?`, confirmLabel: variant === 'remove' ? 'Turn off' : 'Disable', body: 'Its skills stop reaching the assistant on the next run. The package stays on disk, remains listed on both tabs, and can be enabled again.' };
|
|
32
|
+
}
|
|
33
|
+
const vocabulary = [
|
|
34
|
+
['compliance', ['compliance', 'privacy', 'gdpr', 'ccpa', 'cpra', 'consent', 'security', 'audit', 'wcag', 'accessibility']],
|
|
35
|
+
['deploy', ['deploy', 'deployment', 'hosting', 'release', 'ship', 'production', 'ci', 'fly']],
|
|
36
|
+
['design', ['design', 'ui', 'ux', 'uiux', 'theme', 'brand', 'visual']],
|
|
37
|
+
['integration', ['mcp', 'integration', 'connector', 'webhook', 'api']],
|
|
38
|
+
['content', ['docs', 'documentation', 'content', 'writing', 'copy', 'blog']],
|
|
39
|
+
];
|
|
40
|
+
/** Whole words, strongest evidence first: id, keywords, skills. Never guess a category. */
|
|
41
|
+
export function agentPluginGlyphKind({ plugin }, _optional = {}) {
|
|
42
|
+
const tokens = (values) => new Set(values.flatMap(s => s.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)));
|
|
43
|
+
for (const tier of [[plugin.pluginId], plugin.keywords, plugin.skills.map(s => s.name)]) {
|
|
44
|
+
const words = tokens(tier);
|
|
45
|
+
const match = vocabulary.find(([, values]) => values.some(v => words.has(v)));
|
|
46
|
+
if (match)
|
|
47
|
+
return match[0];
|
|
48
|
+
}
|
|
49
|
+
return 'package';
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=rules.js.map
|
package/dist/browser/index.d.ts
CHANGED
package/dist/browser/index.js
CHANGED
|
@@ -11,14 +11,21 @@
|
|
|
11
11
|
/** Fires on `navigate()`. `pushState` does not emit `popstate`, so subscribers need this too. */
|
|
12
12
|
export declare const NAVIGATION_EVENT = "jini:admin-navigate";
|
|
13
13
|
/** The current route path, read from the address bar. */
|
|
14
|
-
export declare function readRoutePath(
|
|
14
|
+
export declare function readRoutePath({ window }: {
|
|
15
|
+
readonly window: Pick<Window, 'location'>;
|
|
16
|
+
}, { base }?: {
|
|
17
|
+
readonly base?: string;
|
|
18
|
+
}): string;
|
|
15
19
|
/**
|
|
16
20
|
* Navigates without a page load.
|
|
17
21
|
*
|
|
18
22
|
* Takes a *route path*, not a URL — passing `/admin/settings` here would produce
|
|
19
23
|
* `/admin/admin/settings`, which is exactly the class of mistake `adminHref` prevents.
|
|
20
24
|
*/
|
|
21
|
-
export declare function navigate(routePath
|
|
25
|
+
export declare function navigate({ routePath, window }: {
|
|
26
|
+
readonly routePath: string;
|
|
27
|
+
readonly window: Pick<Window, 'location' | 'history' | 'dispatchEvent'>;
|
|
28
|
+
}, options?: {
|
|
22
29
|
readonly replace?: boolean;
|
|
23
30
|
readonly base?: string;
|
|
24
31
|
}): void;
|
|
@@ -33,7 +40,15 @@ export declare function navigate(routePath: string, options?: {
|
|
|
33
40
|
*
|
|
34
41
|
* @returns a teardown function.
|
|
35
42
|
*/
|
|
36
|
-
export declare function installInternalLinkInterceptor(
|
|
43
|
+
export declare function installInternalLinkInterceptor({ window, document }: {
|
|
44
|
+
readonly window: Pick<Window, 'location' | 'history' | 'dispatchEvent'>;
|
|
45
|
+
readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
|
|
46
|
+
}, { base }?: {
|
|
47
|
+
readonly base?: string;
|
|
48
|
+
}): () => void;
|
|
37
49
|
/** Subscribes to route changes from both `popstate` and programmatic `navigate()`. */
|
|
38
|
-
export declare function subscribeToRoute(
|
|
50
|
+
export declare function subscribeToRoute({ window, onChange }: {
|
|
51
|
+
readonly window: Pick<Window, 'addEventListener' | 'removeEventListener'>;
|
|
52
|
+
readonly onChange: () => void;
|
|
53
|
+
}): () => void;
|
|
39
54
|
//# sourceMappingURL=navigation.d.ts.map
|
|
@@ -12,8 +12,8 @@ import { DEFAULT_ADMIN_BASE, adminHref, currentRoutePath, stripTrailingSlash } f
|
|
|
12
12
|
/** Fires on `navigate()`. `pushState` does not emit `popstate`, so subscribers need this too. */
|
|
13
13
|
export const NAVIGATION_EVENT = 'jini:admin-navigate';
|
|
14
14
|
/** The current route path, read from the address bar. */
|
|
15
|
-
export function readRoutePath(base = DEFAULT_ADMIN_BASE) {
|
|
16
|
-
return currentRoutePath(window.location.pathname, base);
|
|
15
|
+
export function readRoutePath({ window }, { base = DEFAULT_ADMIN_BASE } = {}) {
|
|
16
|
+
return currentRoutePath({ pathname: window.location.pathname }, { base });
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Navigates without a page load.
|
|
@@ -21,9 +21,9 @@ export function readRoutePath(base = DEFAULT_ADMIN_BASE) {
|
|
|
21
21
|
* Takes a *route path*, not a URL — passing `/admin/settings` here would produce
|
|
22
22
|
* `/admin/admin/settings`, which is exactly the class of mistake `adminHref` prevents.
|
|
23
23
|
*/
|
|
24
|
-
export function navigate(routePath, options = {}) {
|
|
24
|
+
export function navigate({ routePath, window }, options = {}) {
|
|
25
25
|
const base = options.base ?? DEFAULT_ADMIN_BASE;
|
|
26
|
-
const url = adminHref(routePath, base);
|
|
26
|
+
const url = adminHref({ routePath }, { base });
|
|
27
27
|
/*
|
|
28
28
|
* Navigating to where you already are is a no-op, not a history entry. Without this, clicking
|
|
29
29
|
* the already-active sidebar link five times pushes five identical entries and Back appears
|
|
@@ -41,7 +41,7 @@ export function navigate(routePath, options = {}) {
|
|
|
41
41
|
* same-path/different-query navigation is a real one.
|
|
42
42
|
*/
|
|
43
43
|
const target = new URL(url, window.location.href);
|
|
44
|
-
const isCurrent = stripTrailingSlash(target.pathname) === stripTrailingSlash(window.location.pathname) &&
|
|
44
|
+
const isCurrent = stripTrailingSlash({ pathname: target.pathname }) === stripTrailingSlash({ pathname: window.location.pathname }) &&
|
|
45
45
|
target.search === window.location.search &&
|
|
46
46
|
target.hash === window.location.hash;
|
|
47
47
|
if (isCurrent)
|
|
@@ -63,7 +63,7 @@ export function navigate(routePath, options = {}) {
|
|
|
63
63
|
*
|
|
64
64
|
* @returns a teardown function.
|
|
65
65
|
*/
|
|
66
|
-
export function installInternalLinkInterceptor(base = DEFAULT_ADMIN_BASE) {
|
|
66
|
+
export function installInternalLinkInterceptor({ window, document }, { base = DEFAULT_ADMIN_BASE } = {}) {
|
|
67
67
|
const onClick = (event) => {
|
|
68
68
|
// Anything but an unmodified primary click is the browser's to handle: cmd/ctrl-click opens a
|
|
69
69
|
// tab, shift-click a window, alt-click downloads.
|
|
@@ -96,13 +96,13 @@ export function installInternalLinkInterceptor(base = DEFAULT_ADMIN_BASE) {
|
|
|
96
96
|
// `url.hash` is carried through: an in-page fragment (`/admin/settings#seo-defaults`) is not a
|
|
97
97
|
// routing concern, but dropping it silently loses the anchor. It never reaches the matcher —
|
|
98
98
|
// the route snapshot is path + query only — so preserving it cannot affect routing.
|
|
99
|
-
navigate(`${currentRoutePath(url.pathname, base)}${url.search}${url.hash}
|
|
99
|
+
navigate({ window, routePath: `${currentRoutePath({ pathname: url.pathname }, { base })}${url.search}${url.hash}` }, { base });
|
|
100
100
|
};
|
|
101
101
|
document.addEventListener('click', onClick);
|
|
102
102
|
return () => document.removeEventListener('click', onClick);
|
|
103
103
|
}
|
|
104
104
|
/** Subscribes to route changes from both `popstate` and programmatic `navigate()`. */
|
|
105
|
-
export function subscribeToRoute(onChange) {
|
|
105
|
+
export function subscribeToRoute({ window, onChange }) {
|
|
106
106
|
window.addEventListener('popstate', onChange);
|
|
107
107
|
window.addEventListener(NAVIGATION_EVENT, onChange);
|
|
108
108
|
return () => {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AdminShellNavigationPort } from '../core/ports/shell.js';
|
|
2
|
+
/**
|
|
3
|
+
* Adapt the existing browser router to the shell's object-based navigation port.
|
|
4
|
+
* @param args Required live browser location, history/event port and document port; the admin mount path is supplied on each port call.
|
|
5
|
+
* @returns A query-preserving History API adapter. Construct only in a browser host.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createAdminShellNavigation(args: {
|
|
8
|
+
readonly location: Pick<Location, 'pathname' | 'search'>;
|
|
9
|
+
readonly window: Pick<Window, 'location' | 'history' | 'dispatchEvent' | 'addEventListener' | 'removeEventListener'>;
|
|
10
|
+
readonly document: Pick<Document, 'addEventListener' | 'removeEventListener'>;
|
|
11
|
+
}): AdminShellNavigationPort;
|
|
12
|
+
//# sourceMappingURL=shell-navigation.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { currentRoutePath } from '../core/routing/rules.js';
|
|
2
|
+
import { installInternalLinkInterceptor, navigate, subscribeToRoute } from './navigation.js';
|
|
3
|
+
/**
|
|
4
|
+
* Adapt the existing browser router to the shell's object-based navigation port.
|
|
5
|
+
* @param args Required live browser location, history/event port and document port; the admin mount path is supplied on each port call.
|
|
6
|
+
* @returns A query-preserving History API adapter. Construct only in a browser host.
|
|
7
|
+
*/
|
|
8
|
+
export function createAdminShellNavigation(args) {
|
|
9
|
+
return {
|
|
10
|
+
readRoute: ({ base }) => `${currentRoutePath({ pathname: args.location.pathname }, { base })}${args.location.search}`,
|
|
11
|
+
subscribe: ({ onChange }) => subscribeToRoute({ window: args.window, onChange }),
|
|
12
|
+
navigate: ({ base, routePath }, options = {}) => navigate({ routePath, window: args.window }, { base, ...options }),
|
|
13
|
+
installLinkInterceptor: ({ base }) => installInternalLinkInterceptor({ window: args.window, document: args.document }, { base }),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=shell-navigation.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Optional navigation to the host's single named-credential management home. */
|
|
2
|
+
export interface CredentialManagementPort {
|
|
3
|
+
open(required: {
|
|
4
|
+
kind: 'source-control';
|
|
5
|
+
}, optional?: Record<string, never>): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const credentialManagementToken: import("../core/module/token.js").AdminPortToken<CredentialManagementPort, "admin.credentials.management">;
|
|
8
|
+
//# sourceMappingURL=credential-management.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Data returned across tab boundaries. Consumers need no media implementation import. */
|
|
2
|
+
export interface MediaAsset {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly title: string;
|
|
5
|
+
readonly alt: string;
|
|
6
|
+
readonly contentType: string | null;
|
|
7
|
+
readonly publicUrl: string | null;
|
|
8
|
+
}
|
|
9
|
+
export interface MediaPickerPort {
|
|
10
|
+
pick(required: {
|
|
11
|
+
accept: readonly string[];
|
|
12
|
+
}, optional?: {
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}): Promise<MediaAsset | null>;
|
|
15
|
+
}
|
|
16
|
+
export declare const mediaPickerToken: import("../core/module/token.js").AdminPortToken<MediaPickerPort, "admin.media.picker">;
|
|
17
|
+
//# sourceMappingURL=media-picker.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Opaque headlessly; browser hosts publish an actual portal container, never an id or flag. */
|
|
2
|
+
export interface PlaygroundTargetSnapshot {
|
|
3
|
+
readonly target: object | null;
|
|
4
|
+
}
|
|
5
|
+
export interface PlaygroundRenderTargetPort {
|
|
6
|
+
getSnapshot(required?: Record<string, never>, optional?: Record<string, never>): PlaygroundTargetSnapshot;
|
|
7
|
+
subscribe(required: {
|
|
8
|
+
listener: () => void;
|
|
9
|
+
}, optional?: Record<string, never>): () => void;
|
|
10
|
+
/** A lease belongs to its publisher; releasing a stale lease cannot erase the current node. */
|
|
11
|
+
register(required: {
|
|
12
|
+
target: object;
|
|
13
|
+
}, optional?: Record<string, never>): {
|
|
14
|
+
release(required?: Record<string, never>, optional?: Record<string, never>): void;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare const playgroundRenderTargetToken: import("../core/module/token.js").AdminPortToken<PlaygroundRenderTargetPort, "admin.playground.render-target">;
|
|
18
|
+
//# sourceMappingURL=playground-render-target.d.ts.map
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file The runtime half of `AdminEntityPort`: registration, descriptor validation, and the one
|
|
3
|
+
* erasure a screen generic over all entities needs.
|
|
4
|
+
*
|
|
5
|
+
* `core/ports/entities.ts` is types only, like every other port. Everything here is the code those
|
|
6
|
+
* types cannot be: checks that a descriptor is internally consistent, and the single cast that
|
|
7
|
+
* turns a descriptor-generic port into the shape a screen can hold.
|
|
8
|
+
*
|
|
9
|
+
* ## Why any of this is runtime rather than type-level
|
|
10
|
+
*
|
|
11
|
+
* Two of the descriptor's own promises are not expressible in the type system:
|
|
12
|
+
*
|
|
13
|
+
* - `titleField` names a `text` field on this same descriptor. Encoding that needs a conditional
|
|
14
|
+
* type heavy enough to make every descriptor's error message unreadable — and a typo here is not
|
|
15
|
+
* cosmetic: it makes every relation picker pointing at this entity render `undefined` for every
|
|
16
|
+
* row, which looks like missing data rather than a typo.
|
|
17
|
+
* - `relation.target` names another *registered* entity. A descriptor cannot know what it will be
|
|
18
|
+
* registered beside, so this can only be checked once the registry is assembled.
|
|
19
|
+
*
|
|
20
|
+
* Both are therefore checked at composition time, where they fail once, at startup, naming the
|
|
21
|
+
* problem — rather than at render time, silently, as blank cells.
|
|
22
|
+
*/
|
|
23
|
+
import type { AdminEntityDescriptor, AdminEntityField, AdminEntityPort, AdminEntityRegistry, AdminErasedEntityPort } from '../ports/entities.js';
|
|
24
|
+
/**
|
|
25
|
+
* A row that does not match the descriptor its port advertises.
|
|
26
|
+
*
|
|
27
|
+
* This is the failure `eraseEntityPort`'s cast makes possible: the cast is sound in the direction
|
|
28
|
+
* that matters (a typed row *is* a bag of unknowns), and unsound only if an adapter lies about its
|
|
29
|
+
* own descriptor. Nothing in the type system catches that, so this is what does — as a report, not
|
|
30
|
+
* an exception: a mistyped field is a fidelity problem, and throwing on a read would take a
|
|
31
|
+
* mostly-working screen down over one bad cell.
|
|
32
|
+
*/
|
|
33
|
+
export interface AdminEntityRowViolation {
|
|
34
|
+
/** `descriptor.name` of the port that produced the row. */
|
|
35
|
+
readonly entity: string;
|
|
36
|
+
readonly operation: 'list' | 'get' | 'create' | 'update';
|
|
37
|
+
/** The offending row's `id`, or `'<no id>'` when that is itself what is wrong. */
|
|
38
|
+
readonly rowId: string;
|
|
39
|
+
/** Declared field name, `'id'`, or the undeclared key that appeared. */
|
|
40
|
+
readonly field: string;
|
|
41
|
+
readonly problem: 'missing-required' | 'wrong-type' | 'undeclared-field';
|
|
42
|
+
/** One sentence naming what was expected and what arrived. Safe to log verbatim. */
|
|
43
|
+
readonly detail: string;
|
|
44
|
+
}
|
|
45
|
+
export interface AdminEntityErasureOptions {
|
|
46
|
+
/**
|
|
47
|
+
* Where descriptor-conformance violations are reported.
|
|
48
|
+
*
|
|
49
|
+
* **Omit it and no row checking runs at all** — that is the zero-cost default, and it is why this
|
|
50
|
+
* package emits no diagnostics of its own (nothing here writes to `console`; a host owns its
|
|
51
|
+
* reporting the same way it owns its transport). A host wires this under its own development
|
|
52
|
+
* flag and gets adapter drift surfaced the moment it happens; production pays nothing.
|
|
53
|
+
*/
|
|
54
|
+
readonly onViolation?: (violation: AdminEntityRowViolation) => void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Whether `value` is a legal runtime value for `field`.
|
|
58
|
+
*
|
|
59
|
+
* Exported because an EDITOR needs exactly this judgement and must not re-derive it. A generic form
|
|
60
|
+
* that decides for itself what an `integer` accepts will drift from what the conformance walk
|
|
61
|
+
* below rejects, and the two disagreeing is worse than either being wrong alone: the form saves a
|
|
62
|
+
* value the port then reports as a violation, so the write succeeds and the diagnostic blames the
|
|
63
|
+
* adapter. `1.5` in an `integer` and `Infinity` in a `real` are both reachable from a plain
|
|
64
|
+
* `<input type="number">` — `step` constrains the spinner, not the parsed value — so this is not a
|
|
65
|
+
* theoretical seam. One function, both callers.
|
|
66
|
+
*
|
|
67
|
+
* @param field The declared field the value is destined for.
|
|
68
|
+
* @param value The candidate value, typically a form draft entry or an adapter-returned cell.
|
|
69
|
+
* @returns `null` when it conforms, otherwise a one-phrase reason naming what arrived instead.
|
|
70
|
+
* Phrased to complete the sentence "declared `<kind>`; ...".
|
|
71
|
+
* @complexity Time O(1) for every kind but `json`; see {@link describeNonJsonValue} for that one.
|
|
72
|
+
* @overallScore 100
|
|
73
|
+
*/
|
|
74
|
+
export declare function describeAdminEntityFieldMismatch(field: AdminEntityField, value: unknown): string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Erases a port's descriptor generic so a screen can hold ports for different entities in one
|
|
77
|
+
* collection.
|
|
78
|
+
*
|
|
79
|
+
* The `as unknown as` below is unavoidable and is the only one in this port. `create` and `update`
|
|
80
|
+
* take the row type as a *parameter*, so `AdminEntityPort<SpecificDescriptor>` is contravariant in
|
|
81
|
+
* it and is genuinely not assignable to any common supertype. The cast is sound in the direction
|
|
82
|
+
* that gets exercised — a typed row is a bag of unknowns — and unsound only if the adapter's rows
|
|
83
|
+
* do not match the descriptor it advertises, which is precisely what `options.onViolation` is here
|
|
84
|
+
* to surface.
|
|
85
|
+
*
|
|
86
|
+
* @param port A port whose rows are typed by its own descriptor.
|
|
87
|
+
* @param options Wire `onViolation` to have every row checked against the descriptor on the way
|
|
88
|
+
* out; omit it for zero added cost.
|
|
89
|
+
* @returns The same port, typed as {@link AdminErasedEntityPort}; a fresh wrapper object when
|
|
90
|
+
* `onViolation` is set, and the original object when it is not.
|
|
91
|
+
* @complexity Time O(1) to erase; O(rows × fields) per call when checking is on.
|
|
92
|
+
* @overallScore 100
|
|
93
|
+
*/
|
|
94
|
+
export declare function eraseEntityPort<D extends AdminEntityDescriptor>(port: AdminEntityPort<D>, options?: AdminEntityErasureOptions): AdminErasedEntityPort;
|
|
95
|
+
/**
|
|
96
|
+
* Assembles entity ports into a registry, validating every descriptor first.
|
|
97
|
+
*
|
|
98
|
+
* Same ergonomics as `createAdminClient`: one object literal, `TPorts` inferred, host-owned and
|
|
99
|
+
* Jini-shipped entries indistinguishable. Registering an entity is one line.
|
|
100
|
+
*
|
|
101
|
+
* **No key is reserved.** `createAdminClient` reserves `'transport'` because it merges the
|
|
102
|
+
* transport into the same object it returns; this returns nothing but the ports, so there is
|
|
103
|
+
* nothing an entity named `transport` could shadow. The returned object has a `null` prototype, so
|
|
104
|
+
* a lookup by an attacker- or URL-supplied name (`'constructor'`, `'__proto__'`) resolves to
|
|
105
|
+
* `undefined` rather than walking to `Object.prototype` and yielding a truthy non-port.
|
|
106
|
+
*
|
|
107
|
+
* Deliberately takes no erasure options: a registry holds ports with their row types intact, and
|
|
108
|
+
* checking only becomes possible once those types are erased. `onViolation` therefore belongs to
|
|
109
|
+
* {@link getErasedEntityPort}/{@link listErasedEntityPorts}, at the point the guarantee is dropped.
|
|
110
|
+
*
|
|
111
|
+
* @param ports Entity name -> port. Each key must equal that port's `descriptor.name`.
|
|
112
|
+
* @returns A frozen, null-prototype registry preserving each port's own type.
|
|
113
|
+
* @throws {Error} listing *every* problem found, not just the first — a descriptor with three
|
|
114
|
+
* typos should take one round trip to fix, not three.
|
|
115
|
+
* @complexity Time O(entities × fields); space O(entities).
|
|
116
|
+
* @overallScore 100
|
|
117
|
+
*/
|
|
118
|
+
export declare function createAdminEntityRegistry<TPorts extends Record<string, AdminEntityPort<AdminEntityDescriptor>>>(ports: TPorts): AdminEntityRegistry<TPorts>;
|
|
119
|
+
/**
|
|
120
|
+
* Every registered port, erased, in registration order — what a screen that renders any entity
|
|
121
|
+
* iterates.
|
|
122
|
+
*
|
|
123
|
+
* @complexity Time O(entities); space O(entities).
|
|
124
|
+
* @overallScore 100
|
|
125
|
+
*/
|
|
126
|
+
export declare function listErasedEntityPorts(registry: Readonly<Record<string, AdminEntityPort<AdminEntityDescriptor>>>, options?: AdminEntityErasureOptions): readonly AdminErasedEntityPort[];
|
|
127
|
+
/**
|
|
128
|
+
* The erased port registered under `name`, or `null`.
|
|
129
|
+
*
|
|
130
|
+
* `name` is routinely a URL segment, so this never trusts a bare property read: the registry's null
|
|
131
|
+
* prototype already stops `'constructor'` resolving to something truthy, and `Object.hasOwn` holds
|
|
132
|
+
* that guarantee even for a caller that hands in a plain object literal instead.
|
|
133
|
+
*
|
|
134
|
+
* @complexity Time O(1) for the lookup, O(1) for the erasure.
|
|
135
|
+
* @overallScore 100
|
|
136
|
+
*/
|
|
137
|
+
export declare function getErasedEntityPort(registry: Readonly<Record<string, AdminEntityPort<AdminEntityDescriptor>>>, name: string, options?: AdminEntityErasureOptions): AdminErasedEntityPort | null;
|
|
138
|
+
//# sourceMappingURL=rules.d.ts.map
|