@tai42/studio-sdk 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +15 -0
- package/README.md +318 -0
- package/SECURITY.md +51 -0
- package/dist/components/badge.d.ts +13 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +14 -0
- package/dist/components/badge.js.map +1 -0
- package/dist/components/checkbox.d.ts +24 -0
- package/dist/components/checkbox.d.ts.map +1 -0
- package/dist/components/checkbox.js +31 -0
- package/dist/components/checkbox.js.map +1 -0
- package/dist/components/code-block.d.ts +7 -0
- package/dist/components/code-block.d.ts.map +1 -0
- package/dist/components/code-block.js +23 -0
- package/dist/components/code-block.js.map +1 -0
- package/dist/components/completion-input.d.ts +31 -0
- package/dist/components/completion-input.d.ts.map +1 -0
- package/dist/components/completion-input.js +61 -0
- package/dist/components/completion-input.js.map +1 -0
- package/dist/components/components.css +2212 -0
- package/dist/components/confirm-dialog.d.ts +40 -0
- package/dist/components/confirm-dialog.d.ts.map +1 -0
- package/dist/components/confirm-dialog.js +11 -0
- package/dist/components/confirm-dialog.js.map +1 -0
- package/dist/components/control-styles.d.ts +12 -0
- package/dist/components/control-styles.d.ts.map +1 -0
- package/dist/components/control-styles.js +14 -0
- package/dist/components/control-styles.js.map +1 -0
- package/dist/components/copy-field.d.ts +8 -0
- package/dist/components/copy-field.d.ts.map +1 -0
- package/dist/components/copy-field.js +106 -0
- package/dist/components/copy-field.js.map +1 -0
- package/dist/components/dialog.d.ts +21 -0
- package/dist/components/dialog.d.ts.map +1 -0
- package/dist/components/dialog.js +25 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/drawer.d.ts +22 -0
- package/dist/components/drawer.d.ts.map +1 -0
- package/dist/components/drawer.js +32 -0
- package/dist/components/drawer.js.map +1 -0
- package/dist/components/error-boundary.d.ts +33 -0
- package/dist/components/error-boundary.d.ts.map +1 -0
- package/dist/components/error-boundary.js +36 -0
- package/dist/components/error-boundary.js.map +1 -0
- package/dist/components/extension-combo-builder.d.ts +70 -0
- package/dist/components/extension-combo-builder.d.ts.map +1 -0
- package/dist/components/extension-combo-builder.js +154 -0
- package/dist/components/extension-combo-builder.js.map +1 -0
- package/dist/components/extension-grouping.d.ts +65 -0
- package/dist/components/extension-grouping.d.ts.map +1 -0
- package/dist/components/extension-grouping.js +78 -0
- package/dist/components/extension-grouping.js.map +1 -0
- package/dist/components/extension-picker.d.ts +35 -0
- package/dist/components/extension-picker.d.ts.map +1 -0
- package/dist/components/extension-picker.js +31 -0
- package/dist/components/extension-picker.js.map +1 -0
- package/dist/components/external-link.d.ts +19 -0
- package/dist/components/external-link.d.ts.map +1 -0
- package/dist/components/external-link.js +12 -0
- package/dist/components/external-link.js.map +1 -0
- package/dist/components/field.d.ts +64 -0
- package/dist/components/field.d.ts.map +1 -0
- package/dist/components/field.js +56 -0
- package/dist/components/field.js.map +1 -0
- package/dist/components/fleet-report.d.ts +39 -0
- package/dist/components/fleet-report.d.ts.map +1 -0
- package/dist/components/fleet-report.js +50 -0
- package/dist/components/fleet-report.js.map +1 -0
- package/dist/components/fonts.css +22 -0
- package/dist/components/icons.d.ts +142 -0
- package/dist/components/icons.d.ts.map +1 -0
- package/dist/components/icons.js +139 -0
- package/dist/components/icons.js.map +1 -0
- package/dist/components/inputs.d.ts +52 -0
- package/dist/components/inputs.d.ts.map +1 -0
- package/dist/components/inputs.js +35 -0
- package/dist/components/inputs.js.map +1 -0
- package/dist/components/json-diff.d.ts +40 -0
- package/dist/components/json-diff.d.ts.map +1 -0
- package/dist/components/json-diff.js +119 -0
- package/dist/components/json-diff.js.map +1 -0
- package/dist/components/json-tree.d.ts +8 -0
- package/dist/components/json-tree.d.ts.map +1 -0
- package/dist/components/json-tree.js +70 -0
- package/dist/components/json-tree.js.map +1 -0
- package/dist/components/modal-focus.d.ts +15 -0
- package/dist/components/modal-focus.d.ts.map +1 -0
- package/dist/components/modal-focus.js +136 -0
- package/dist/components/modal-focus.js.map +1 -0
- package/dist/components/page-header.d.ts +56 -0
- package/dist/components/page-header.d.ts.map +1 -0
- package/dist/components/page-header.js +24 -0
- package/dist/components/page-header.js.map +1 -0
- package/dist/components/primitives.d.ts +186 -0
- package/dist/components/primitives.d.ts.map +1 -0
- package/dist/components/primitives.js +204 -0
- package/dist/components/primitives.js.map +1 -0
- package/dist/components/progress-bar.d.ts +29 -0
- package/dist/components/progress-bar.d.ts.map +1 -0
- package/dist/components/progress-bar.js +48 -0
- package/dist/components/progress-bar.js.map +1 -0
- package/dist/components/radio-group.d.ts +37 -0
- package/dist/components/radio-group.d.ts.map +1 -0
- package/dist/components/radio-group.js +56 -0
- package/dist/components/radio-group.js.map +1 -0
- package/dist/components/reveal-input.d.ts +13 -0
- package/dist/components/reveal-input.d.ts.map +1 -0
- package/dist/components/reveal-input.js +31 -0
- package/dist/components/reveal-input.js.map +1 -0
- package/dist/components/scroll-region.d.ts +85 -0
- package/dist/components/scroll-region.d.ts.map +1 -0
- package/dist/components/scroll-region.js +574 -0
- package/dist/components/scroll-region.js.map +1 -0
- package/dist/components/select.d.ts +53 -0
- package/dist/components/select.d.ts.map +1 -0
- package/dist/components/select.js +33 -0
- package/dist/components/select.js.map +1 -0
- package/dist/components/table.d.ts +59 -0
- package/dist/components/table.d.ts.map +1 -0
- package/dist/components/table.js +20 -0
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +15 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/tabs.js +13 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tags.d.ts +46 -0
- package/dist/components/tags.d.ts.map +1 -0
- package/dist/components/tags.js +68 -0
- package/dist/components/tags.js.map +1 -0
- package/dist/components/tokens.css +392 -0
- package/dist/components/tokens.d.ts +15 -0
- package/dist/components/tokens.d.ts.map +1 -0
- package/dist/components/tokens.js +101 -0
- package/dist/components/tokens.js.map +1 -0
- package/dist/components/tool-picker.d.ts +24 -0
- package/dist/components/tool-picker.d.ts.map +1 -0
- package/dist/components/tool-picker.js +97 -0
- package/dist/components/tool-picker.js.map +1 -0
- package/dist/components/tooltip.d.ts +17 -0
- package/dist/components/tooltip.d.ts.map +1 -0
- package/dist/components/tooltip.js +18 -0
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/version-history-panel.d.ts +71 -0
- package/dist/components/version-history-panel.d.ts.map +1 -0
- package/dist/components/version-history-panel.js +148 -0
- package/dist/components/version-history-panel.js.map +1 -0
- package/dist/download.d.ts +7 -0
- package/dist/download.d.ts.map +1 -0
- package/dist/download.js +18 -0
- package/dist/download.js.map +1 -0
- package/dist/element-slot.d.ts +4 -0
- package/dist/element-slot.d.ts.map +1 -0
- package/dist/element-slot.js +20 -0
- package/dist/element-slot.js.map +1 -0
- package/dist/elicitation/ElicitationForm.d.ts +34 -0
- package/dist/elicitation/ElicitationForm.d.ts.map +1 -0
- package/dist/elicitation/ElicitationForm.js +24 -0
- package/dist/elicitation/ElicitationForm.js.map +1 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +15 -0
- package/dist/errors.js.map +1 -0
- package/dist/extension-combos.d.ts +13 -0
- package/dist/extension-combos.d.ts.map +1 -0
- package/dist/extension-combos.js +9 -0
- package/dist/extension-combos.js.map +1 -0
- package/dist/hooks/useApi.d.ts +1222 -0
- package/dist/hooks/useApi.d.ts.map +1 -0
- package/dist/hooks/useApi.js +22 -0
- package/dist/hooks/useApi.js.map +1 -0
- package/dist/hooks/useAuth.d.ts +13 -0
- package/dist/hooks/useAuth.d.ts.map +1 -0
- package/dist/hooks/useAuth.js +53 -0
- package/dist/hooks/useAuth.js.map +1 -0
- package/dist/hooks/useBreakpoint.d.ts +10 -0
- package/dist/hooks/useBreakpoint.d.ts.map +1 -0
- package/dist/hooks/useBreakpoint.js +66 -0
- package/dist/hooks/useBreakpoint.js.map +1 -0
- package/dist/hooks/useCapabilities.d.ts +88 -0
- package/dist/hooks/useCapabilities.d.ts.map +1 -0
- package/dist/hooks/useCapabilities.js +203 -0
- package/dist/hooks/useCapabilities.js.map +1 -0
- package/dist/hooks/useSse.d.ts +13 -0
- package/dist/hooks/useSse.d.ts.map +1 -0
- package/dist/hooks/useSse.js +298 -0
- package/dist/hooks/useSse.js.map +1 -0
- package/dist/hooks/useTheme.d.ts +20 -0
- package/dist/hooks/useTheme.d.ts.map +1 -0
- package/dist/hooks/useTheme.js +97 -0
- package/dist/hooks/useTheme.js.map +1 -0
- package/dist/hooks/useUnauthorized.d.ts +3 -0
- package/dist/hooks/useUnauthorized.d.ts.map +1 -0
- package/dist/hooks/useUnauthorized.js +18 -0
- package/dist/hooks/useUnauthorized.js.map +1 -0
- package/dist/host.d.ts +11 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +10 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +118 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +91 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation/context.d.ts +25 -0
- package/dist/navigation/context.d.ts.map +1 -0
- package/dist/navigation/context.js +45 -0
- package/dist/navigation/context.js.map +1 -0
- package/dist/navigation/index.d.ts +4 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +2 -0
- package/dist/navigation/index.js.map +1 -0
- package/dist/navigation/types.d.ts +97 -0
- package/dist/navigation/types.d.ts.map +1 -0
- package/dist/navigation/types.js +16 -0
- package/dist/navigation/types.js.map +1 -0
- package/dist/plugin/host-state.d.ts +45 -0
- package/dist/plugin/host-state.d.ts.map +1 -0
- package/dist/plugin/host-state.js +62 -0
- package/dist/plugin/host-state.js.map +1 -0
- package/dist/plugin/registry.d.ts +35 -0
- package/dist/plugin/registry.d.ts.map +1 -0
- package/dist/plugin/registry.js +129 -0
- package/dist/plugin/registry.js.map +1 -0
- package/dist/plugin/types.d.ts +165 -0
- package/dist/plugin/types.d.ts.map +1 -0
- package/dist/plugin/types.js +2 -0
- package/dist/plugin/types.js.map +1 -0
- package/dist/plugin/version.d.ts +34 -0
- package/dist/plugin/version.d.ts.map +1 -0
- package/dist/plugin/version.js +37 -0
- package/dist/plugin/version.js.map +1 -0
- package/dist/query-keys.d.ts +31 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +31 -0
- package/dist/query-keys.js.map +1 -0
- package/dist/schema-editor/SchemaEditor.d.ts +43 -0
- package/dist/schema-editor/SchemaEditor.d.ts.map +1 -0
- package/dist/schema-editor/SchemaEditor.js +106 -0
- package/dist/schema-editor/SchemaEditor.js.map +1 -0
- package/dist/schema-editor/index.d.ts +10 -0
- package/dist/schema-editor/index.d.ts.map +1 -0
- package/dist/schema-editor/index.js +8 -0
- package/dist/schema-editor/index.js.map +1 -0
- package/dist/schema-editor/lint.d.ts +37 -0
- package/dist/schema-editor/lint.d.ts.map +1 -0
- package/dist/schema-editor/lint.js +49 -0
- package/dist/schema-editor/lint.js.map +1 -0
- package/dist/schema-form/SchemaForm.d.ts +70 -0
- package/dist/schema-form/SchemaForm.d.ts.map +1 -0
- package/dist/schema-form/SchemaForm.js +13 -0
- package/dist/schema-form/SchemaForm.js.map +1 -0
- package/dist/schema-form/array-field.d.ts +20 -0
- package/dist/schema-form/array-field.d.ts.map +1 -0
- package/dist/schema-form/array-field.js +39 -0
- package/dist/schema-form/array-field.js.map +1 -0
- package/dist/schema-form/classify.d.ts +87 -0
- package/dist/schema-form/classify.d.ts.map +1 -0
- package/dist/schema-form/classify.js +199 -0
- package/dist/schema-form/classify.js.map +1 -0
- package/dist/schema-form/context.d.ts +4 -0
- package/dist/schema-form/context.d.ts.map +1 -0
- package/dist/schema-form/context.js +14 -0
- package/dist/schema-form/context.js.map +1 -0
- package/dist/schema-form/default-value.d.ts +8 -0
- package/dist/schema-form/default-value.d.ts.map +1 -0
- package/dist/schema-form/default-value.js +64 -0
- package/dist/schema-form/default-value.js.map +1 -0
- package/dist/schema-form/enum-field.d.ts +19 -0
- package/dist/schema-form/enum-field.d.ts.map +1 -0
- package/dist/schema-form/enum-field.js +26 -0
- package/dist/schema-form/enum-field.js.map +1 -0
- package/dist/schema-form/field-group.d.ts +9 -0
- package/dist/schema-form/field-group.d.ts.map +1 -0
- package/dist/schema-form/field-group.js +32 -0
- package/dist/schema-form/field-group.js.map +1 -0
- package/dist/schema-form/field-node.d.ts +24 -0
- package/dist/schema-form/field-node.d.ts.map +1 -0
- package/dist/schema-form/field-node.js +51 -0
- package/dist/schema-form/field-node.js.map +1 -0
- package/dist/schema-form/index.d.ts +13 -0
- package/dist/schema-form/index.d.ts.map +1 -0
- package/dist/schema-form/index.js +11 -0
- package/dist/schema-form/index.js.map +1 -0
- package/dist/schema-form/media-field.d.ts +24 -0
- package/dist/schema-form/media-field.d.ts.map +1 -0
- package/dist/schema-form/media-field.js +169 -0
- package/dist/schema-form/media-field.js.map +1 -0
- package/dist/schema-form/media.d.ts +40 -0
- package/dist/schema-form/media.d.ts.map +1 -0
- package/dist/schema-form/media.js +65 -0
- package/dist/schema-form/media.js.map +1 -0
- package/dist/schema-form/object-fields.d.ts +20 -0
- package/dist/schema-form/object-fields.d.ts.map +1 -0
- package/dist/schema-form/object-fields.js +24 -0
- package/dist/schema-form/object-fields.js.map +1 -0
- package/dist/schema-form/resolve.d.ts +41 -0
- package/dist/schema-form/resolve.d.ts.map +1 -0
- package/dist/schema-form/resolve.js +102 -0
- package/dist/schema-form/resolve.js.map +1 -0
- package/dist/schema-form/string-field.d.ts +20 -0
- package/dist/schema-form/string-field.d.ts.map +1 -0
- package/dist/schema-form/string-field.js +68 -0
- package/dist/schema-form/string-field.js.map +1 -0
- package/dist/schema-form/styles.d.ts +18 -0
- package/dist/schema-form/styles.d.ts.map +1 -0
- package/dist/schema-form/styles.js +18 -0
- package/dist/schema-form/styles.js.map +1 -0
- package/dist/schema-form/types.d.ts +67 -0
- package/dist/schema-form/types.d.ts.map +1 -0
- package/dist/schema-form/types.js +10 -0
- package/dist/schema-form/types.js.map +1 -0
- package/dist/schema-form/union-field.d.ts +24 -0
- package/dist/schema-form/union-field.d.ts.map +1 -0
- package/dist/schema-form/union-field.js +55 -0
- package/dist/schema-form/union-field.js.map +1 -0
- package/dist/schema-form/union.d.ts +4 -0
- package/dist/schema-form/union.d.ts.map +1 -0
- package/dist/schema-form/union.js +68 -0
- package/dist/schema-form/union.js.map +1 -0
- package/dist/schema-form/unsupported-notice.d.ts +18 -0
- package/dist/schema-form/unsupported-notice.d.ts.map +1 -0
- package/dist/schema-form/unsupported-notice.js +8 -0
- package/dist/schema-form/unsupported-notice.js.map +1 -0
- package/dist/schema-form/validate.d.ts +18 -0
- package/dist/schema-form/validate.d.ts.map +1 -0
- package/dist/schema-form/validate.js +162 -0
- package/dist/schema-form/validate.js.map +1 -0
- package/dist/structured-output/StructuredOutput.d.ts +27 -0
- package/dist/structured-output/StructuredOutput.d.ts.map +1 -0
- package/dist/structured-output/StructuredOutput.js +41 -0
- package/dist/structured-output/StructuredOutput.js.map +1 -0
- package/dist/testing.d.ts +80 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +207 -0
- package/dist/testing.js.map +1 -0
- package/package.json +101 -0
- package/src/components/badge.tsx +31 -0
- package/src/components/checkbox.tsx +93 -0
- package/src/components/code-block.tsx +37 -0
- package/src/components/completion-input.tsx +137 -0
- package/src/components/components.css +2212 -0
- package/src/components/confirm-dialog.tsx +77 -0
- package/src/components/control-styles.ts +14 -0
- package/src/components/copy-field.tsx +178 -0
- package/src/components/dialog.tsx +76 -0
- package/src/components/drawer.tsx +83 -0
- package/src/components/error-boundary.tsx +56 -0
- package/src/components/extension-combo-builder.tsx +305 -0
- package/src/components/extension-grouping.ts +116 -0
- package/src/components/extension-picker.tsx +97 -0
- package/src/components/external-link.tsx +40 -0
- package/src/components/field.tsx +169 -0
- package/src/components/fleet-report.tsx +136 -0
- package/src/components/fonts.css +22 -0
- package/src/components/icons.tsx +504 -0
- package/src/components/inputs.tsx +125 -0
- package/src/components/json-diff.tsx +192 -0
- package/src/components/json-tree.tsx +129 -0
- package/src/components/modal-focus.ts +150 -0
- package/src/components/page-header.tsx +107 -0
- package/src/components/primitives.tsx +489 -0
- package/src/components/progress-bar.tsx +100 -0
- package/src/components/radio-group.tsx +160 -0
- package/src/components/reveal-input.tsx +87 -0
- package/src/components/scroll-region.tsx +703 -0
- package/src/components/select.tsx +149 -0
- package/src/components/table.tsx +94 -0
- package/src/components/tabs.tsx +51 -0
- package/src/components/tags.tsx +137 -0
- package/src/components/tokens.css +392 -0
- package/src/components/tokens.ts +102 -0
- package/src/components/tool-picker.tsx +175 -0
- package/src/components/tooltip.tsx +46 -0
- package/src/components/version-history-panel.tsx +407 -0
- package/src/css.d.ts +2 -0
- package/src/download.ts +17 -0
- package/src/element-slot.ts +22 -0
- package/src/elicitation/ElicitationForm.tsx +87 -0
- package/src/errors.ts +12 -0
- package/src/extension-combos.ts +18 -0
- package/src/hooks/useApi.ts +27 -0
- package/src/hooks/useAuth.ts +67 -0
- package/src/hooks/useBreakpoint.ts +78 -0
- package/src/hooks/useCapabilities.ts +242 -0
- package/src/hooks/useSse.ts +314 -0
- package/src/hooks/useTheme.ts +133 -0
- package/src/hooks/useUnauthorized.ts +20 -0
- package/src/host.ts +15 -0
- package/src/index.ts +267 -0
- package/src/navigation/context.tsx +90 -0
- package/src/navigation/index.ts +9 -0
- package/src/navigation/types.ts +90 -0
- package/src/plugin/host-state.ts +93 -0
- package/src/plugin/registry.ts +174 -0
- package/src/plugin/types.ts +178 -0
- package/src/plugin/version.ts +44 -0
- package/src/query-keys.ts +34 -0
- package/src/schema-editor/SchemaEditor.tsx +186 -0
- package/src/schema-editor/index.ts +9 -0
- package/src/schema-editor/lint.ts +70 -0
- package/src/schema-form/SchemaForm.tsx +107 -0
- package/src/schema-form/array-field.tsx +110 -0
- package/src/schema-form/classify.ts +302 -0
- package/src/schema-form/context.ts +17 -0
- package/src/schema-form/default-value.ts +65 -0
- package/src/schema-form/enum-field.tsx +65 -0
- package/src/schema-form/field-group.tsx +71 -0
- package/src/schema-form/field-node.tsx +161 -0
- package/src/schema-form/index.ts +12 -0
- package/src/schema-form/media-field.tsx +281 -0
- package/src/schema-form/media.ts +69 -0
- package/src/schema-form/object-fields.tsx +74 -0
- package/src/schema-form/resolve.ts +114 -0
- package/src/schema-form/string-field.tsx +161 -0
- package/src/schema-form/styles.ts +20 -0
- package/src/schema-form/types.ts +71 -0
- package/src/schema-form/union-field.tsx +122 -0
- package/src/schema-form/union.ts +78 -0
- package/src/schema-form/unsupported-notice.tsx +39 -0
- package/src/schema-form/validate.ts +183 -0
- package/src/structured-output/StructuredOutput.tsx +81 -0
- package/src/testing.ts +235 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,6BAA6B,CAAC;AAGrC,YAAY,EACV,aAAa,EACb,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACpF,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACxD,YAAY,EAAE,SAAS,EAAE,MAAM,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/dist/index.js
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @tai42/studio-sdk — the PLUGIN SURFACE: everything a Studio plugin (and every
|
|
3
|
+
* feature) is allowed to touch.
|
|
4
|
+
*
|
|
5
|
+
* 1. The STUDIO-PLUGIN API a plugin implements: the `PluginContext` its `register`
|
|
6
|
+
* entry receives, the contribution types, and the compatibility gate.
|
|
7
|
+
* 2. The design system + hooks every feature (and every plugin) builds on.
|
|
8
|
+
*
|
|
9
|
+
* The host registry (`loadPlugin`/`getContributions`) is DELIBERATELY absent here
|
|
10
|
+
* so the served plugin asset cannot forge, wipe, or enumerate the registry; it is
|
|
11
|
+
* exported only from `@tai42/studio-sdk/host`, which the host bundle imports. See
|
|
12
|
+
* SECURITY.md for the trust boundary.
|
|
13
|
+
*
|
|
14
|
+
* The three shared modules (react, react-dom, @tai42/studio-sdk) are singletons
|
|
15
|
+
* across the plugin boundary; this package imports nothing internal at runtime
|
|
16
|
+
* (the `ApiClient`/`Interaction` types are type-only imports).
|
|
17
|
+
*/
|
|
18
|
+
// The design system, delivered by the BARREL so each host app loads it once and a
|
|
19
|
+
// plugin never ships its own copy. These are bare side-effect imports, so they
|
|
20
|
+
// survive bundling only while this module is itself listed in the package's
|
|
21
|
+
// `sideEffects` (both `./dist/index.js` and `./src/index.ts` — `files` ships src
|
|
22
|
+
// too). Without that entry webpack and Vite treat the barrel as side-effect-free
|
|
23
|
+
// and drop all three, and a published consumer gets zero CSS; `sideEffects` is
|
|
24
|
+
// kept honest against these lines by `package-side-effects.test.ts`.
|
|
25
|
+
import './components/tokens.css';
|
|
26
|
+
import './components/fonts.css';
|
|
27
|
+
import './components/components.css';
|
|
28
|
+
export { STUDIO_PLUGIN_API_VERSION, checkPluginApiVersion } from './plugin/version';
|
|
29
|
+
// -- Hooks -------------------------------------------------------------------
|
|
30
|
+
export { ApiProvider, useApi } from './hooks/useApi';
|
|
31
|
+
export { UnauthorizedProvider, useOnUnauthorized } from './hooks/useUnauthorized';
|
|
32
|
+
export { AuthProvider, useAuth } from './hooks/useAuth';
|
|
33
|
+
export { CapabilityProvider, useCapabilities, useCanWrite, isFullProjection, coversAnyRoute, coversRoute, coversWrite, } from './hooks/useCapabilities';
|
|
34
|
+
export { ThemeProvider, useTheme } from './hooks/useTheme';
|
|
35
|
+
export { useBreakpoint } from './hooks/useBreakpoint';
|
|
36
|
+
export { useInteractionsStream } from './hooks/useSse';
|
|
37
|
+
// -- Navigation (shell ⇄ feature route-token contract) -----------------------
|
|
38
|
+
export { NavigationProvider, AppLink, useAppNavigate, useResolvePath } from './navigation';
|
|
39
|
+
// -- Utilities ---------------------------------------------------------------
|
|
40
|
+
export { errorMessage } from './errors';
|
|
41
|
+
export { downloadBlob } from './download';
|
|
42
|
+
// -- Cross-feature query keys ------------------------------------------------
|
|
43
|
+
export { toolsListKey, extensionsQueryKey, subMcpKey, tokensPayloadKey } from './query-keys';
|
|
44
|
+
// -- Extension-combo editing helpers -----------------------------------------
|
|
45
|
+
export { comboElementNames, extensionElementName } from './extension-combos';
|
|
46
|
+
// -- Design system -----------------------------------------------------------
|
|
47
|
+
export { Button, Card, Skeleton, EmptyState, ErrorState, Spinner } from './components/primitives';
|
|
48
|
+
export { PageHeader, Page, Stack } from './components/page-header';
|
|
49
|
+
export { ErrorBoundary } from './components/error-boundary';
|
|
50
|
+
export { Field, useFieldControl } from './components/field';
|
|
51
|
+
export { TextInput, Textarea, NumberInput } from './components/inputs';
|
|
52
|
+
export { Select } from './components/select';
|
|
53
|
+
export { Checkbox } from './components/checkbox';
|
|
54
|
+
export { RadioGroup } from './components/radio-group';
|
|
55
|
+
export { Badge } from './components/badge';
|
|
56
|
+
export { Tabs } from './components/tabs';
|
|
57
|
+
export { Dialog } from './components/dialog';
|
|
58
|
+
export { ConfirmDialog } from './components/confirm-dialog';
|
|
59
|
+
export { Drawer } from './components/drawer';
|
|
60
|
+
export { Tooltip } from './components/tooltip';
|
|
61
|
+
export { Table, THead, TBody, TR, TH, TD } from './components/table';
|
|
62
|
+
export { ScrollRegion, useOverflowRegion, useProseScrollRegions } from './components/scroll-region';
|
|
63
|
+
export { JsonTree } from './components/json-tree';
|
|
64
|
+
export { JsonDiff, diffJson } from './components/json-diff';
|
|
65
|
+
export { TagChips, TagsInput } from './components/tags';
|
|
66
|
+
export { CodeBlock } from './components/code-block';
|
|
67
|
+
export { FleetReport } from './components/fleet-report';
|
|
68
|
+
export { ExternalLinkButton, isSafeHttpUrl } from './components/external-link';
|
|
69
|
+
// The URL half of the link-safety pair: `isSafeHttpUrl` answers yes/no, this one
|
|
70
|
+
// hands back the parsed URL, so a caller that needs the URL does not re-parse it.
|
|
71
|
+
export { safeHttpUrl } from './components/primitives';
|
|
72
|
+
export { ToolPicker } from './components/tool-picker';
|
|
73
|
+
export { ExtensionPicker } from './components/extension-picker';
|
|
74
|
+
export { ExtensionComboBuilder } from './components/extension-combo-builder';
|
|
75
|
+
export { baseNameOf, groupIntoFamilies, groupByKind, kindVariant, NON_STACKABLE_KIND, } from './components/extension-grouping';
|
|
76
|
+
export { VersionHistoryPanel } from './components/version-history-panel';
|
|
77
|
+
export { RevealInput } from './components/reveal-input';
|
|
78
|
+
export { CopyField } from './components/copy-field';
|
|
79
|
+
export { TOKEN_NAMES } from './components/tokens';
|
|
80
|
+
// -- Iconography (the only sanctioned marks; Unicode glyphs are banned) -------
|
|
81
|
+
export { NAV_ICONS, DashboardIcon, ToolsIcon, AgentsIcon, PresetsIcon, ExtensionsIcon, TemplatesIcon, ConnectorsIcon, HooksIcon, StorageIcon, SchedulingIcon, InteractionsIcon, NotificationsIcon, MarketplaceIcon, ManifestIcon, SettingsIcon, SystemIcon, SearchIcon, SignOutIcon, MenuIcon, CloseIcon, FilterIcon, ArrowLeftIcon, ArrowUpIcon, ArrowDownIcon, ChevronDownIcon, ChevronRightIcon, CheckIcon, MinusIcon, CopyIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, SortAscIcon, SortDescIcon, SunIcon, MoonIcon, MonitorIcon, CheckCircleIcon, AlertTriangleIcon, XCircleIcon, PendingIcon, } from './components/icons';
|
|
82
|
+
// -- Schema-driven forms -----------------------------------------------------
|
|
83
|
+
export { SchemaForm, defaultValueForSchema, validateAgainstSchema, resolveRef, } from './schema-form';
|
|
84
|
+
// -- Schema-editor (validated JSON-Schema authoring control) -----------------
|
|
85
|
+
export { SchemaEditor, lintSchemaText } from './schema-editor';
|
|
86
|
+
// -- MCP context widgets (elicitation / progress / completions / output) -----
|
|
87
|
+
export { ProgressBar } from './components/progress-bar';
|
|
88
|
+
export { CompletionInput } from './components/completion-input';
|
|
89
|
+
export { ElicitationForm } from './elicitation/ElicitationForm';
|
|
90
|
+
export { StructuredOutput } from './structured-output/StructuredOutput';
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,kFAAkF;AAClF,+EAA+E;AAC/E,4EAA4E;AAC5E,iFAAiF;AACjF,iFAAiF;AACjF,+EAA+E;AAC/E,qEAAqE;AACrE,OAAO,yBAAyB,CAAC;AACjC,OAAO,wBAAwB,CAAC;AAChC,OAAO,6BAA6B,CAAC;AAmBrC,OAAO,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGpF,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAClF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,WAAW,GACZ,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,aAAa,E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EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,gFAAgF;AAChF,OAAO,EACL,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,SAAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,EACR,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,WAAW,EACX,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAG5B,+EAA+E;AAC/E,OAAO,EACL,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,UAAU,GACX,MAAM,eAAe,CAAC;AAUvB,+EAA+E;AAC/E,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG/D,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type AriaAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { NavigationContextValue, RouteSearch, RouteToken } from './types';
|
|
3
|
+
export declare function NavigationProvider({ value, children, }: {
|
|
4
|
+
value: NavigationContextValue;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): ReactNode;
|
|
7
|
+
/** Imperative navigation to a shell route token with its typed search params. */
|
|
8
|
+
export declare function useAppNavigate(): NavigationContextValue['navigate'];
|
|
9
|
+
/** Resolve a token + search to the href the shell would route to. */
|
|
10
|
+
export declare function useResolvePath(): NavigationContextValue['resolvePath'];
|
|
11
|
+
export interface AppLinkProps<T extends RouteToken> {
|
|
12
|
+
to: T;
|
|
13
|
+
search?: RouteSearch<T>;
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
className?: string;
|
|
16
|
+
'aria-label'?: string;
|
|
17
|
+
'aria-current'?: AriaAttributes['aria-current'];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A real anchor (so middle-click / open-in-new-tab keep working) that drives a
|
|
21
|
+
* client-side transition on plain left-click. Modified clicks (new tab/window,
|
|
22
|
+
* download) fall through to the browser's default handling.
|
|
23
|
+
*/
|
|
24
|
+
export declare function AppLink<T extends RouteToken>({ to, search, children, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, }: AppLinkProps<T>): ReactNode;
|
|
25
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/navigation/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAU/E,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,EAAE,sBAAsB,CAAC;IAC9B,QAAQ,EAAE,SAAS,CAAC;CACrB,GAAG,SAAS,CAEZ;AAYD,iFAAiF;AACjF,wBAAgB,cAAc,IAAI,sBAAsB,CAAC,UAAU,CAAC,CAEnE;AAED,qEAAqE;AACrE,wBAAgB,cAAc,IAAI,sBAAsB,CAAC,aAAa,CAAC,CAEtE;AAED,MAAM,WAAW,YAAY,CAAC,CAAC,SAAS,UAAU;IAChD,EAAE,EAAE,CAAC,CAAC;IACN,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CACjD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,EAC5C,EAAE,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,cAAc,EAAE,WAAW,GAC5B,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,SAAS,CAkB7B"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createContext, createElement, useCallback, useContext, } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Shell-provided navigation. The context has no default: a feature rendered
|
|
4
|
+
* outside the shell's {@link NavigationProvider} is a wiring bug, so
|
|
5
|
+
* {@link useNavigation} raises loudly rather than silently no-op'ing a
|
|
6
|
+
* transition.
|
|
7
|
+
*/
|
|
8
|
+
const NavigationContext = createContext(null);
|
|
9
|
+
export function NavigationProvider({ value, children, }) {
|
|
10
|
+
return createElement(NavigationContext.Provider, { value }, children);
|
|
11
|
+
}
|
|
12
|
+
function useNavigation() {
|
|
13
|
+
const ctx = useContext(NavigationContext);
|
|
14
|
+
if (ctx === null) {
|
|
15
|
+
throw new Error('useNavigation must be used within a <NavigationProvider> (the shell provides it).');
|
|
16
|
+
}
|
|
17
|
+
return ctx;
|
|
18
|
+
}
|
|
19
|
+
/** Imperative navigation to a shell route token with its typed search params. */
|
|
20
|
+
export function useAppNavigate() {
|
|
21
|
+
return useNavigation().navigate;
|
|
22
|
+
}
|
|
23
|
+
/** Resolve a token + search to the href the shell would route to. */
|
|
24
|
+
export function useResolvePath() {
|
|
25
|
+
return useNavigation().resolvePath;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A real anchor (so middle-click / open-in-new-tab keep working) that drives a
|
|
29
|
+
* client-side transition on plain left-click. Modified clicks (new tab/window,
|
|
30
|
+
* download) fall through to the browser's default handling.
|
|
31
|
+
*/
|
|
32
|
+
export function AppLink({ to, search, children, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, }) {
|
|
33
|
+
const { navigate, resolvePath } = useNavigation();
|
|
34
|
+
const href = resolvePath(to, search);
|
|
35
|
+
const onClick = useCallback((event) => {
|
|
36
|
+
if (event.defaultPrevented)
|
|
37
|
+
return;
|
|
38
|
+
if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
|
|
39
|
+
return;
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
navigate(to, search);
|
|
42
|
+
}, [navigate, to, search]);
|
|
43
|
+
return createElement('a', { href, className, 'aria-label': ariaLabel, 'aria-current': ariaCurrent, onClick }, children);
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/navigation/context.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,GAIX,MAAM,OAAO,CAAC;AAIf;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG,aAAa,CAAgC,IAAI,CAAC,CAAC;AAE7E,MAAM,UAAU,kBAAkB,CAAC,EACjC,KAAK,EACL,QAAQ,GAIT;IACC,OAAO,aAAa,CAAC,iBAAiB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;AACxE,CAAC;AAED,SAAS,aAAa;IACpB,MAAM,GAAG,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC1C,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,mFAAmF,CACpF,CAAC;IACJ,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc;IAC5B,OAAO,aAAa,EAAE,CAAC,QAAQ,CAAC;AAClC,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,cAAc;IAC5B,OAAO,aAAa,EAAE,CAAC,WAAW,CAAC;AACrC,CAAC;AAWD;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAuB,EAC5C,EAAE,EACF,MAAM,EACN,QAAQ,EACR,SAAS,EACT,YAAY,EAAE,SAAS,EACvB,cAAc,EAAE,WAAW,GACX;IAChB,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE,CAAC;IAClD,MAAM,IAAI,GAAG,WAAW,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,KAAoC,EAAE,EAAE;QACvC,IAAI,KAAK,CAAC,gBAAgB;YAAE,OAAO;QACnC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM;YACxF,OAAO;QACT,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;IACvB,CAAC,EACD,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,CACvB,CAAC;IACF,OAAO,aAAa,CAClB,GAAG,EACH,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,EAClF,QAAQ,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { NavigationProvider, AppLink, useAppNavigate, useResolvePath } from './context';
|
|
2
|
+
export type { AppLinkProps } from './context';
|
|
3
|
+
export type { RouteToken, RouteSearch, RouteSearchByToken, PageProps, NavigationContextValue, } from './types';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxF,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell ⇄ feature navigation contract.
|
|
3
|
+
*
|
|
4
|
+
* Routing is SHELL-owned: feature packages never see path strings and never
|
|
5
|
+
* define routes. They navigate through named ROUTE TOKENS — the keys of
|
|
6
|
+
* {@link RouteSearchByToken} — which the shell resolves to real paths. A token
|
|
7
|
+
* is an opaque, compile-time handle: renaming or removing one here is a type
|
|
8
|
+
* error at every call site, exactly the property free-form path strings lack.
|
|
9
|
+
*
|
|
10
|
+
* This contract lives in the SDK because it is the ONLY internal module a feature
|
|
11
|
+
* may import (a feature importing the shell is a boundary violation). The shell
|
|
12
|
+
* supplies the runtime resolution via {@link NavigationContextValue}; features
|
|
13
|
+
* consume it type-safely.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Every top-level route the shell owns, mapped to its typed search parameters.
|
|
17
|
+
* A route with no parameters maps to the empty object. Detail views are driven
|
|
18
|
+
* by a search parameter (e.g. the selected tool / connection), keeping the route
|
|
19
|
+
* map flat — one entry per feature surface, matching the shell route map.
|
|
20
|
+
*/
|
|
21
|
+
export interface RouteSearchByToken {
|
|
22
|
+
login: Record<string, never>;
|
|
23
|
+
tools: {
|
|
24
|
+
tool?: string;
|
|
25
|
+
tags?: string[];
|
|
26
|
+
};
|
|
27
|
+
agents: Record<string, never>;
|
|
28
|
+
presets: {
|
|
29
|
+
preset?: string;
|
|
30
|
+
};
|
|
31
|
+
extensions: Record<string, never>;
|
|
32
|
+
interactions: Record<string, never>;
|
|
33
|
+
notifications: Record<string, never>;
|
|
34
|
+
connectors: {
|
|
35
|
+
connection?: string;
|
|
36
|
+
};
|
|
37
|
+
hooks: Record<string, never>;
|
|
38
|
+
templates: {
|
|
39
|
+
template?: string;
|
|
40
|
+
};
|
|
41
|
+
storage: {
|
|
42
|
+
filter?: string;
|
|
43
|
+
};
|
|
44
|
+
manifest: Record<string, never>;
|
|
45
|
+
settings: Record<string, never>;
|
|
46
|
+
system: Record<string, never>;
|
|
47
|
+
scheduling: Record<string, never>;
|
|
48
|
+
observability: {
|
|
49
|
+
tab?: 'dashboard' | 'tracing';
|
|
50
|
+
from?: string;
|
|
51
|
+
to?: string;
|
|
52
|
+
tags?: string[];
|
|
53
|
+
status?: 'error' | 'success';
|
|
54
|
+
minCost?: number;
|
|
55
|
+
maxCost?: number;
|
|
56
|
+
minTokens?: number;
|
|
57
|
+
maxTokens?: number;
|
|
58
|
+
minLatencyMs?: number;
|
|
59
|
+
maxLatencyMs?: number;
|
|
60
|
+
sort?: 'createdAt' | 'cost' | 'latencyMs' | 'totalTokens';
|
|
61
|
+
dir?: 'asc' | 'desc';
|
|
62
|
+
trace?: string;
|
|
63
|
+
};
|
|
64
|
+
marketplace: {
|
|
65
|
+
tab?: 'browse' | 'installed';
|
|
66
|
+
q?: string;
|
|
67
|
+
kind?: string;
|
|
68
|
+
category?: string;
|
|
69
|
+
tags?: string[];
|
|
70
|
+
sort?: 'downloads' | 'updated' | 'name' | 'relevance';
|
|
71
|
+
plugin?: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** An opaque, typed handle to a shell route. */
|
|
75
|
+
export type RouteToken = keyof RouteSearchByToken;
|
|
76
|
+
/** The search parameters a given route token accepts. */
|
|
77
|
+
export type RouteSearch<T extends RouteToken> = RouteSearchByToken[T];
|
|
78
|
+
/**
|
|
79
|
+
* Props the shell passes to a feature's page component: the route's typed search
|
|
80
|
+
* parameters. Features type their exported page as `PageProps<'tools'>` and read
|
|
81
|
+
* `search` — they receive route state as data, never by importing the router.
|
|
82
|
+
*/
|
|
83
|
+
export interface PageProps<T extends RouteToken> {
|
|
84
|
+
search: RouteSearch<T>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* The runtime navigation surface the shell provides through
|
|
88
|
+
* {@link NavigationProvider}. `navigate` performs a client-side transition;
|
|
89
|
+
* `resolvePath` produces the href a link should point at (so an AppLink is a real
|
|
90
|
+
* anchor — middle-click / open-in-new-tab work — while still driving a
|
|
91
|
+
* client-side transition on plain click).
|
|
92
|
+
*/
|
|
93
|
+
export interface NavigationContextValue {
|
|
94
|
+
navigate: <T extends RouteToken>(token: T, search?: RouteSearch<T>) => void;
|
|
95
|
+
resolvePath: <T extends RouteToken>(token: T, search?: RouteSearch<T>) => string;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAC7B,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC1C,MAAM,EAAE,MAAM,CAAC,M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never see path strings and never
|
|
5
|
+
* define routes. They navigate through named ROUTE TOKENS — the keys of
|
|
6
|
+
* {@link RouteSearchByToken} — which the shell resolves to real paths. A token
|
|
7
|
+
* is an opaque, compile-time handle: renaming or removing one here is a type
|
|
8
|
+
* error at every call site, exactly the property free-form path strings lack.
|
|
9
|
+
*
|
|
10
|
+
* This contract lives in the SDK because it is the ONLY internal module a feature
|
|
11
|
+
* may import (a feature importing the shell is a boundary violation). The shell
|
|
12
|
+
* supplies the runtime resolution via {@link NavigationContextValue}; features
|
|
13
|
+
* consume it type-safely.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/navigation/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { PluginContributions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* The plugin load pass's public state, mirrored for feature pages to read. It is
|
|
4
|
+
* the shape the app shell's loader store already exposes: `status` gates when the
|
|
5
|
+
* contributions are complete, and the error fields carry the loud failures.
|
|
6
|
+
*/
|
|
7
|
+
export interface PluginLoaderState {
|
|
8
|
+
/** `idle` before the first pass, `loading` while it runs, `ready` once done. */
|
|
9
|
+
readonly status: 'idle' | 'loading' | 'ready';
|
|
10
|
+
/** Names of plugins whose bundle imported and registered successfully. */
|
|
11
|
+
readonly loaded: readonly string[];
|
|
12
|
+
/** Plugin name → loud error message (version mismatch / load failure). */
|
|
13
|
+
readonly errors: Readonly<Record<string, string>>;
|
|
14
|
+
/** A registry-listing failure that is NOT a 401 (surfaced loudly, never hidden). */
|
|
15
|
+
readonly registryError: string | null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The host loader pushes every load-pass transition here (it stays the single
|
|
19
|
+
* driver); every subscriber is notified so feature pages re-render off it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setPluginHostState(state: PluginLoaderState): void;
|
|
22
|
+
/** The current mirrored host state — the snapshot {@link usePluginContributions} reads. */
|
|
23
|
+
export declare function getPluginHostState(): PluginLoaderState;
|
|
24
|
+
/**
|
|
25
|
+
* Subscribe to host-state transitions; returns the unsubscribe function
|
|
26
|
+
* `useSyncExternalStore` requires so a subscriber detaches on unmount.
|
|
27
|
+
*/
|
|
28
|
+
export declare function subscribePluginHost(listener: () => void): () => void;
|
|
29
|
+
/** Tests reset the module-level host state between cases. */
|
|
30
|
+
export declare function __resetPluginHostState(): void;
|
|
31
|
+
/** What {@link usePluginContributions} returns: the load status and the registry. */
|
|
32
|
+
export interface PluginContributionsSnapshot {
|
|
33
|
+
/** The load pass's status; contributions are only complete once it is `'ready'`. */
|
|
34
|
+
readonly status: PluginLoaderState['status'];
|
|
35
|
+
/** The committed contributions, meaningful only when `status === 'ready'`. */
|
|
36
|
+
readonly contributions: PluginContributions;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Subscribe to the plugin host state and read the committed contributions. The
|
|
40
|
+
* status drives re-renders as the load pass advances; `contributions` is only
|
|
41
|
+
* meaningful once `status === 'ready'` (before then the pass has committed
|
|
42
|
+
* nothing, so callers render their non-plugin content).
|
|
43
|
+
*/
|
|
44
|
+
export declare function usePluginContributions(): PluginContributionsSnapshot;
|
|
45
|
+
//# sourceMappingURL=host-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-state.d.ts","sourceRoot":"","sources":["../../src/plugin/host-state.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAGnD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,gFAAgF;IAChF,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;IAC9C,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClD,oFAAoF;IACpF,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAYD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAGjE;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,IAAI,iBAAiB,CAEtD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAKpE;AAED,6DAA6D;AAC7D,wBAAgB,sBAAsB,IAAI,IAAI,CAG7C;AAED,qFAAqF;AACrF,MAAM,WAAW,2BAA2B;IAC1C,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC7C,8EAA8E;IAC9E,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,2BAA2B,CAGpE"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The plugin host-readiness store: a host-driven mirror of the plugin load pass's
|
|
3
|
+
* public state that feature pages subscribe to. The app shell's loader is the
|
|
4
|
+
* single driver — it calls {@link setPluginHostState} on every transition — and a
|
|
5
|
+
* feature page reads the current status plus the committed contributions through
|
|
6
|
+
* {@link usePluginContributions}, without importing the app shell (the dependency
|
|
7
|
+
* points the other way).
|
|
8
|
+
*
|
|
9
|
+
* This module reads the contribution registry ({@link getContributions}), so it is
|
|
10
|
+
* part of the HOST-ONLY surface (`@tai42/studio-sdk/host`), never the plugin surface:
|
|
11
|
+
* a served plugin bundle can neither drive this store nor enumerate the registry
|
|
12
|
+
* through it. See SECURITY.md for the trust boundary.
|
|
13
|
+
*/
|
|
14
|
+
import { useSyncExternalStore } from 'react';
|
|
15
|
+
import { getContributions } from './registry';
|
|
16
|
+
const INITIAL_HOST_STATE = {
|
|
17
|
+
status: 'idle',
|
|
18
|
+
loaded: [],
|
|
19
|
+
errors: {},
|
|
20
|
+
registryError: null,
|
|
21
|
+
};
|
|
22
|
+
let hostState = INITIAL_HOST_STATE;
|
|
23
|
+
const listeners = new Set();
|
|
24
|
+
/**
|
|
25
|
+
* The host loader pushes every load-pass transition here (it stays the single
|
|
26
|
+
* driver); every subscriber is notified so feature pages re-render off it.
|
|
27
|
+
*/
|
|
28
|
+
export function setPluginHostState(state) {
|
|
29
|
+
hostState = state;
|
|
30
|
+
for (const listener of listeners)
|
|
31
|
+
listener();
|
|
32
|
+
}
|
|
33
|
+
/** The current mirrored host state — the snapshot {@link usePluginContributions} reads. */
|
|
34
|
+
export function getPluginHostState() {
|
|
35
|
+
return hostState;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Subscribe to host-state transitions; returns the unsubscribe function
|
|
39
|
+
* `useSyncExternalStore` requires so a subscriber detaches on unmount.
|
|
40
|
+
*/
|
|
41
|
+
export function subscribePluginHost(listener) {
|
|
42
|
+
listeners.add(listener);
|
|
43
|
+
return () => {
|
|
44
|
+
listeners.delete(listener);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Tests reset the module-level host state between cases. */
|
|
48
|
+
export function __resetPluginHostState() {
|
|
49
|
+
hostState = INITIAL_HOST_STATE;
|
|
50
|
+
listeners.clear();
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Subscribe to the plugin host state and read the committed contributions. The
|
|
54
|
+
* status drives re-renders as the load pass advances; `contributions` is only
|
|
55
|
+
* meaningful once `status === 'ready'` (before then the pass has committed
|
|
56
|
+
* nothing, so callers render their non-plugin content).
|
|
57
|
+
*/
|
|
58
|
+
export function usePluginContributions() {
|
|
59
|
+
const status = useSyncExternalStore(subscribePluginHost, () => getPluginHostState().status);
|
|
60
|
+
return { status, contributions: getContributions() };
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=host-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-state.js","sourceRoot":"","sources":["../../src/plugin/host-state.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAC;AAG7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAkB9C,MAAM,kBAAkB,GAAsB;IAC5C,MAAM,EAAE,MAAM;IACd,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,EAAE;IACV,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,IAAI,SAAS,GAAsB,kBAAkB,CAAC;AACtD,MAAM,SAAS,GAAG,IAAI,GAAG,EAAc,CAAC;AAExC;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB;IACzD,SAAS,GAAG,KAAK,CAAC;IAClB,KAAK,MAAM,QAAQ,IAAI,SAAS;QAAE,QAAQ,EAAE,CAAC;AAC/C,CAAC;AAED,2FAA2F;AAC3F,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAoB;IACtD,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxB,OAAO,GAAG,EAAE;QACV,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC7B,CAAC,CAAC;AACJ,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,sBAAsB;IACpC,SAAS,GAAG,kBAAkB,CAAC;IAC/B,SAAS,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC;AAUD;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB;IACpC,MAAM,MAAM,GAAG,oBAAoB,CAAC,mBAAmB,EAAE,GAAG,EAAE,CAAC,kBAAkB,EAAE,CAAC,MAAM,CAAC,CAAC;IAC5F,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The in-memory registry the shell reads, plus {@link loadPlugin} — the one entry
|
|
3
|
+
* through which a plugin bundle's `register(context)` contributes to it. This module
|
|
4
|
+
* is bundled only into the served `@tai42/studio-sdk/host` singleton (external across
|
|
5
|
+
* the plugin boundary, like react and react-dom), so the module-level registry is
|
|
6
|
+
* the SAME instance every host caller — the shell and the feature panels — sees. The
|
|
7
|
+
* plugin surface (`@tai42/studio-sdk`) does not include it, so a plugin cannot reach it.
|
|
8
|
+
*/
|
|
9
|
+
import type { PluginContributions, PluginEntry } from './types';
|
|
10
|
+
/**
|
|
11
|
+
* Load one plugin: call its `register` entry with a context bound to `pluginId`,
|
|
12
|
+
* then commit everything it staged into the global registry.
|
|
13
|
+
*
|
|
14
|
+
* Contributions are STAGED into local arrays (identity captured in the closure,
|
|
15
|
+
* never read from ambient state) and only committed after `entry` settles
|
|
16
|
+
* successfully. `entry` is AWAITED before commit, so a synchronous or an `async`
|
|
17
|
+
* entry is fully done first: a post-`await` throw skips the commit (atomicity
|
|
18
|
+
* holds for async too) and a post-`await` registration cannot slip past the batch.
|
|
19
|
+
* The seal is set after `entry` has SETTLED — for a sync entry, after it returns
|
|
20
|
+
* and the `await` continuation runs; for an async entry, after its returned promise
|
|
21
|
+
* resolves. A registration attempted from that point on (a deferred timer, a
|
|
22
|
+
* callback scheduled after settle) throws loudly instead of pushing into an
|
|
23
|
+
* orphaned staged array that never commits. Registrations made during `entry`'s
|
|
24
|
+
* synchronous body — including a microtask it enqueues then, which runs before the
|
|
25
|
+
* `await` continuation — are still captured and committed with the batch. A
|
|
26
|
+
* `register` that throws commits nothing and leaves the registry untouched.
|
|
27
|
+
* Duplicate guards run against BOTH the staged contributions and what is already
|
|
28
|
+
* committed, and fail loudly.
|
|
29
|
+
*/
|
|
30
|
+
export declare function loadPlugin(pluginId: string, entry: PluginEntry): Promise<void>;
|
|
31
|
+
/** The shell reads this after loading every installed plugin bundle. */
|
|
32
|
+
export declare function getContributions(): PluginContributions;
|
|
33
|
+
/** Tests reset the module-level registry between cases. */
|
|
34
|
+
export declare function __resetContributions(): void;
|
|
35
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/plugin/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAIV,mBAAmB,EACnB,WAAW,EAMZ,MAAM,SAAS,CAAC;AAOjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkHpF;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,IAAI,mBAAmB,CAEtD;AAED,2DAA2D;AAC3D,wBAAgB,oBAAoB,IAAI,IAAI,CAK3C"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
const toolPanels = new Map();
|
|
2
|
+
const pages = [];
|
|
3
|
+
const settingsTabs = [];
|
|
4
|
+
const navEntries = [];
|
|
5
|
+
/**
|
|
6
|
+
* Load one plugin: call its `register` entry with a context bound to `pluginId`,
|
|
7
|
+
* then commit everything it staged into the global registry.
|
|
8
|
+
*
|
|
9
|
+
* Contributions are STAGED into local arrays (identity captured in the closure,
|
|
10
|
+
* never read from ambient state) and only committed after `entry` settles
|
|
11
|
+
* successfully. `entry` is AWAITED before commit, so a synchronous or an `async`
|
|
12
|
+
* entry is fully done first: a post-`await` throw skips the commit (atomicity
|
|
13
|
+
* holds for async too) and a post-`await` registration cannot slip past the batch.
|
|
14
|
+
* The seal is set after `entry` has SETTLED — for a sync entry, after it returns
|
|
15
|
+
* and the `await` continuation runs; for an async entry, after its returned promise
|
|
16
|
+
* resolves. A registration attempted from that point on (a deferred timer, a
|
|
17
|
+
* callback scheduled after settle) throws loudly instead of pushing into an
|
|
18
|
+
* orphaned staged array that never commits. Registrations made during `entry`'s
|
|
19
|
+
* synchronous body — including a microtask it enqueues then, which runs before the
|
|
20
|
+
* `await` continuation — are still captured and committed with the batch. A
|
|
21
|
+
* `register` that throws commits nothing and leaves the registry untouched.
|
|
22
|
+
* Duplicate guards run against BOTH the staged contributions and what is already
|
|
23
|
+
* committed, and fail loudly.
|
|
24
|
+
*/
|
|
25
|
+
export async function loadPlugin(pluginId, entry) {
|
|
26
|
+
const stagedPages = [];
|
|
27
|
+
const stagedToolPanels = new Map();
|
|
28
|
+
const stagedSettingsTabs = [];
|
|
29
|
+
const stagedTabIds = new Set();
|
|
30
|
+
const stagedNavEntries = [];
|
|
31
|
+
let sealed = false;
|
|
32
|
+
const context = {
|
|
33
|
+
registerPage(contribution) {
|
|
34
|
+
if (sealed) {
|
|
35
|
+
throw new Error('registration is closed: a plugin must register during register(), not after it resolves');
|
|
36
|
+
}
|
|
37
|
+
const staged = stagedPages.some((p) => p.path === contribution.path);
|
|
38
|
+
const committed = pages.some((p) => p.pluginId === pluginId && p.path === contribution.path);
|
|
39
|
+
if (staged || committed) {
|
|
40
|
+
// A duplicate path within one plugin is an author mistake that would
|
|
41
|
+
// leave one page unreachable — fail loudly, as registerToolPanel does.
|
|
42
|
+
throw new Error(`plugin “${pluginId}” already registered a page at “${contribution.path}”`);
|
|
43
|
+
}
|
|
44
|
+
stagedPages.push({ ...contribution, pluginId });
|
|
45
|
+
},
|
|
46
|
+
registerToolPanel(contribution) {
|
|
47
|
+
if (sealed) {
|
|
48
|
+
throw new Error('registration is closed: a plugin must register during register(), not after it resolves');
|
|
49
|
+
}
|
|
50
|
+
if (stagedToolPanels.has(contribution.toolName) || toolPanels.has(contribution.toolName)) {
|
|
51
|
+
throw new Error(`a tool panel is already registered for ${contribution.toolName}`);
|
|
52
|
+
}
|
|
53
|
+
stagedToolPanels.set(contribution.toolName, contribution);
|
|
54
|
+
},
|
|
55
|
+
registerSettingsTab(contribution) {
|
|
56
|
+
if (sealed) {
|
|
57
|
+
throw new Error('registration is closed: a plugin must register during register(), not after it resolves');
|
|
58
|
+
}
|
|
59
|
+
const committed = settingsTabs.some((t) => t.pluginId === pluginId && t.id === contribution.id);
|
|
60
|
+
if (stagedTabIds.has(contribution.id) || committed) {
|
|
61
|
+
// A duplicate tab id within one plugin would leave one tab unreachable —
|
|
62
|
+
// fail loudly, mirroring the page-path guard.
|
|
63
|
+
throw new Error(`plugin “${pluginId}” already registered a settings tab “${contribution.id}”`);
|
|
64
|
+
}
|
|
65
|
+
stagedTabIds.add(contribution.id);
|
|
66
|
+
stagedSettingsTabs.push({ ...contribution, pluginId });
|
|
67
|
+
},
|
|
68
|
+
registerNavEntry(contribution) {
|
|
69
|
+
if (sealed) {
|
|
70
|
+
throw new Error('registration is closed: a plugin must register during register(), not after it resolves');
|
|
71
|
+
}
|
|
72
|
+
const staged = stagedNavEntries.some((e) => e.path === contribution.path);
|
|
73
|
+
const committed = navEntries.some((e) => e.pluginId === pluginId && e.path === contribution.path);
|
|
74
|
+
if (staged || committed) {
|
|
75
|
+
// A duplicate nav path within one plugin is an author mistake — two
|
|
76
|
+
// entries pointing at the same page — so fail loudly like the page guard.
|
|
77
|
+
throw new Error(`plugin “${pluginId}” already registered a nav entry at “${contribution.path}”`);
|
|
78
|
+
}
|
|
79
|
+
stagedNavEntries.push({ ...contribution, pluginId });
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
try {
|
|
83
|
+
await entry(context);
|
|
84
|
+
}
|
|
85
|
+
finally {
|
|
86
|
+
// Whether `entry` resolved or threw, no further registration is valid — seal
|
|
87
|
+
// so a deferred call fails loudly rather than pushing into an orphaned array.
|
|
88
|
+
sealed = true;
|
|
89
|
+
}
|
|
90
|
+
// Every nav entry must link to a page THIS plugin registers — staged in this
|
|
91
|
+
// call or already committed. A nav entry with no matching page is a guaranteed
|
|
92
|
+
// dead link (the plugin page surface renders "Page not found"), so reject it
|
|
93
|
+
// loudly. This throws BEFORE the commit loops, so it propagates out of
|
|
94
|
+
// `loadPlugin` and NOTHING (pages, panels, tabs, nav) commits — atomicity holds.
|
|
95
|
+
for (const navEntry of stagedNavEntries) {
|
|
96
|
+
const hasPage = stagedPages.some((p) => p.path === navEntry.path) ||
|
|
97
|
+
pages.some((p) => p.pluginId === pluginId && p.path === navEntry.path);
|
|
98
|
+
if (!hasPage) {
|
|
99
|
+
throw new Error(`plugin “${pluginId}” registered a nav entry at “${navEntry.path}” but no page at that path`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
// `entry` resolved without throwing: commit the staged contributions as one
|
|
103
|
+
// batch, so the registry only ever holds a plugin's complete set — never a
|
|
104
|
+
// partial set left behind by a mid-registration failure.
|
|
105
|
+
for (const page of stagedPages) {
|
|
106
|
+
pages.push(page);
|
|
107
|
+
}
|
|
108
|
+
for (const [toolName, contribution] of stagedToolPanels) {
|
|
109
|
+
toolPanels.set(toolName, contribution);
|
|
110
|
+
}
|
|
111
|
+
for (const tab of stagedSettingsTabs) {
|
|
112
|
+
settingsTabs.push(tab);
|
|
113
|
+
}
|
|
114
|
+
for (const navEntry of stagedNavEntries) {
|
|
115
|
+
navEntries.push(navEntry);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/** The shell reads this after loading every installed plugin bundle. */
|
|
119
|
+
export function getContributions() {
|
|
120
|
+
return { toolPanels, pages, settingsTabs, navEntries };
|
|
121
|
+
}
|
|
122
|
+
/** Tests reset the module-level registry between cases. */
|
|
123
|
+
export function __resetContributions() {
|
|
124
|
+
toolPanels.clear();
|
|
125
|
+
pages.length = 0;
|
|
126
|
+
settingsTabs.length = 0;
|
|
127
|
+
navEntries.length = 0;
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=registry.js.map
|