@mcpview/compose 0.0.0-stage → 0.10.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/CHANGELOG.md +242 -0
- package/LICENSE +21 -0
- package/README.md +494 -2
- package/esm/_dnt.polyfills.d.ts +18 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -0
- package/esm/_dnt.polyfills.js +15 -0
- package/esm/_dnt.shims.d.ts +2 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +57 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts +33 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_chars.js +48 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts +106 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.js +636 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts +67 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_loader_state.js +1393 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts +44 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_schema.js +117 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/binary.js +103 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/bool.js +32 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/float.js +96 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/int.js +159 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/map.js +14 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/merge.js +10 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/nil.js +22 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/omap.js +29 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.js +19 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.js +30 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/seq.js +10 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/set.js +14 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/str.js +9 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.js +81 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts +3 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.js +20 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts +32 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_type.js +6 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts +4 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/_utils.js +13 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts +51 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/mod.js +53 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts +79 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/parse.js +91 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts +108 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/stringify.js +33 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/types.d.ts +111 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/types.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/yaml/1.3.0/types.js +104 -0
- package/esm/mod.d.ts +49 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +42 -0
- package/esm/package.json +3 -0
- package/esm/src/core/collector/collector.d.ts +58 -0
- package/esm/src/core/collector/collector.d.ts.map +1 -0
- package/esm/src/core/collector/collector.js +60 -0
- package/esm/src/core/collector/extractor.d.ts +33 -0
- package/esm/src/core/collector/extractor.d.ts.map +1 -0
- package/esm/src/core/collector/extractor.js +53 -0
- package/esm/src/core/collector/mod.d.ts +9 -0
- package/esm/src/core/collector/mod.d.ts.map +1 -0
- package/esm/src/core/collector/mod.js +7 -0
- package/esm/src/core/components/components.d.ts +4 -0
- package/esm/src/core/components/components.d.ts.map +1 -0
- package/esm/src/core/components/components.js +28 -0
- package/esm/src/core/components/mod.d.ts +2 -0
- package/esm/src/core/components/mod.d.ts.map +1 -0
- package/esm/src/core/components/mod.js +1 -0
- package/esm/src/core/composer/composer.d.ts +35 -0
- package/esm/src/core/composer/composer.d.ts.map +1 -0
- package/esm/src/core/composer/composer.js +72 -0
- package/esm/src/core/composer/mod.d.ts +7 -0
- package/esm/src/core/composer/mod.d.ts.map +1 -0
- package/esm/src/core/composer/mod.js +6 -0
- package/esm/src/core/mod.d.ts +15 -0
- package/esm/src/core/mod.d.ts.map +1 -0
- package/esm/src/core/mod.js +16 -0
- package/esm/src/core/sync/mod.d.ts +9 -0
- package/esm/src/core/sync/mod.d.ts.map +1 -0
- package/esm/src/core/sync/mod.js +7 -0
- package/esm/src/core/sync/resolver.d.ts +51 -0
- package/esm/src/core/sync/resolver.d.ts.map +1 -0
- package/esm/src/core/sync/resolver.js +88 -0
- package/esm/src/core/sync/validator.d.ts +39 -0
- package/esm/src/core/sync/validator.d.ts.map +1 -0
- package/esm/src/core/sync/validator.js +65 -0
- package/esm/src/core/types/components.d.ts +46 -0
- package/esm/src/core/types/components.d.ts.map +1 -0
- package/esm/src/core/types/components.js +2 -0
- package/esm/src/core/types/descriptor.d.ts +47 -0
- package/esm/src/core/types/descriptor.d.ts.map +1 -0
- package/esm/src/core/types/descriptor.js +6 -0
- package/esm/src/core/types/errors.d.ts +69 -0
- package/esm/src/core/types/errors.d.ts.map +1 -0
- package/esm/src/core/types/errors.js +32 -0
- package/esm/src/core/types/layout.d.ts +100 -0
- package/esm/src/core/types/layout.d.ts.map +1 -0
- package/esm/src/core/types/layout.js +49 -0
- package/esm/src/core/types/mcp-apps.d.ts +56 -0
- package/esm/src/core/types/mcp-apps.d.ts.map +1 -0
- package/esm/src/core/types/mcp-apps.js +16 -0
- package/esm/src/core/types/mod.d.ts +17 -0
- package/esm/src/core/types/mod.d.ts.map +1 -0
- package/esm/src/core/types/mod.js +7 -0
- package/esm/src/core/types/orchestration.d.ts +37 -0
- package/esm/src/core/types/orchestration.d.ts.map +1 -0
- package/esm/src/core/types/orchestration.js +6 -0
- package/esm/src/core/types/resources.d.ts +37 -0
- package/esm/src/core/types/resources.d.ts.map +1 -0
- package/esm/src/core/types/resources.js +1 -0
- package/esm/src/core/types/sync-rules.d.ts +80 -0
- package/esm/src/core/types/sync-rules.d.ts.map +1 -0
- package/esm/src/core/types/sync-rules.js +6 -0
- package/esm/src/deploy/mod.d.ts +12 -0
- package/esm/src/deploy/mod.d.ts.map +1 -0
- package/esm/src/deploy/mod.js +11 -0
- package/esm/src/deploy/types.d.ts +119 -0
- package/esm/src/deploy/types.d.ts.map +1 -0
- package/esm/src/deploy/types.js +19 -0
- package/esm/src/host/components-contract.d.ts +6 -0
- package/esm/src/host/components-contract.d.ts.map +1 -0
- package/esm/src/host/components-contract.js +5 -0
- package/esm/src/host/mod.d.ts +15 -0
- package/esm/src/host/mod.d.ts.map +1 -0
- package/esm/src/host/mod.js +14 -0
- package/esm/src/host/renderer/css/base.d.ts +23 -0
- package/esm/src/host/renderer/css/base.d.ts.map +1 -0
- package/esm/src/host/renderer/css/base.js +48 -0
- package/esm/src/host/renderer/css/layouts.d.ts +31 -0
- package/esm/src/host/renderer/css/layouts.d.ts.map +1 -0
- package/esm/src/host/renderer/css/layouts.js +129 -0
- package/esm/src/host/renderer/html-generator.d.ts +36 -0
- package/esm/src/host/renderer/html-generator.d.ts.map +1 -0
- package/esm/src/host/renderer/html-generator.js +227 -0
- package/esm/src/host/renderer/js/event-bus.d.ts +33 -0
- package/esm/src/host/renderer/js/event-bus.d.ts.map +1 -0
- package/esm/src/host/renderer/js/event-bus.js +591 -0
- package/esm/src/host/renderer/mod.d.ts +9 -0
- package/esm/src/host/renderer/mod.d.ts.map +1 -0
- package/esm/src/host/renderer/mod.js +7 -0
- package/esm/src/host/renderer/options.d.ts +126 -0
- package/esm/src/host/renderer/options.d.ts.map +1 -0
- package/esm/src/host/renderer/options.js +1 -0
- package/esm/src/host/serve.d.ts +55 -0
- package/esm/src/host/serve.d.ts.map +1 -0
- package/esm/src/host/serve.js +89 -0
- package/esm/src/host/types.d.ts +42 -0
- package/esm/src/host/types.d.ts.map +1 -0
- package/esm/src/host/types.js +9 -0
- package/esm/src/runtime/cluster.d.ts +92 -0
- package/esm/src/runtime/cluster.d.ts.map +1 -0
- package/esm/src/runtime/cluster.js +859 -0
- package/esm/src/runtime/compose.d.ts +67 -0
- package/esm/src/runtime/compose.d.ts.map +1 -0
- package/esm/src/runtime/compose.js +288 -0
- package/esm/src/runtime/host-dashboard-types.d.ts +79 -0
- package/esm/src/runtime/host-dashboard-types.d.ts.map +1 -0
- package/esm/src/runtime/host-dashboard-types.js +9 -0
- package/esm/src/runtime/host-dashboard.d.ts +29 -0
- package/esm/src/runtime/host-dashboard.d.ts.map +1 -0
- package/esm/src/runtime/host-dashboard.js +559 -0
- package/esm/src/runtime/manifest.d.ts +58 -0
- package/esm/src/runtime/manifest.d.ts.map +1 -0
- package/esm/src/runtime/manifest.js +144 -0
- package/esm/src/runtime/mod.d.ts +18 -0
- package/esm/src/runtime/mod.d.ts.map +1 -0
- package/esm/src/runtime/mod.js +21 -0
- package/esm/src/runtime/template.d.ts +79 -0
- package/esm/src/runtime/template.d.ts.map +1 -0
- package/esm/src/runtime/template.js +287 -0
- package/esm/src/runtime/types.d.ts +345 -0
- package/esm/src/runtime/types.d.ts.map +1 -0
- package/esm/src/runtime/types.js +28 -0
- package/esm/src/sdk/compose-events.d.ts +130 -0
- package/esm/src/sdk/compose-events.d.ts.map +1 -0
- package/esm/src/sdk/compose-events.js +127 -0
- package/esm/src/sdk/composition-validator.d.ts +97 -0
- package/esm/src/sdk/composition-validator.d.ts.map +1 -0
- package/esm/src/sdk/composition-validator.js +178 -0
- package/esm/src/sdk/mcp-sdk.d.ts +92 -0
- package/esm/src/sdk/mcp-sdk.d.ts.map +1 -0
- package/esm/src/sdk/mcp-sdk.js +54 -0
- package/esm/src/sdk/mod.d.ts +15 -0
- package/esm/src/sdk/mod.d.ts.map +1 -0
- package/esm/src/sdk/mod.js +10 -0
- package/esm/src/sdk/ui-meta-builder.d.ts +99 -0
- package/esm/src/sdk/ui-meta-builder.d.ts.map +1 -0
- package/esm/src/sdk/ui-meta-builder.js +53 -0
- package/esm/src/version.d.ts +30 -0
- package/esm/src/version.d.ts.map +1 -0
- package/esm/src/version.js +29 -0
- package/package.json +55 -4
- package/script/_dnt.polyfills.d.ts +18 -0
- package/script/_dnt.polyfills.d.ts.map +1 -0
- package/script/_dnt.polyfills.js +16 -0
- package/script/_dnt.shims.d.ts +2 -0
- package/script/_dnt.shims.d.ts.map +1 -0
- package/script/_dnt.shims.js +60 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts +33 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_chars.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_chars.js +55 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts +106 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_dumper_state.js +640 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts +67 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_loader_state.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_loader_state.js +1397 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts +44 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_schema.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_schema.js +121 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/binary.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/binary.js +106 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/bool.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/bool.js +35 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/float.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/float.js +99 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/int.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/int.js +162 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/map.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/map.js +17 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/merge.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/merge.js +13 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/nil.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/nil.js +25 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/omap.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/omap.js +32 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/pairs.js +22 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/regexp.js +33 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/seq.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/seq.js +13 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/set.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/set.js +17 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/str.js +12 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/timestamp.js +84 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts +3 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type/undefined.js +23 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts +32 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_type.js +7 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts +4 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_utils.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/_utils.js +18 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts +51 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/mod.js +69 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts +79 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/parse.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/parse.js +95 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts +108 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/stringify.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/stringify.js +36 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/types.d.ts +111 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/types.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/yaml/1.3.0/types.js +108 -0
- package/script/mod.d.ts +49 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +60 -0
- package/script/package.json +3 -0
- package/script/src/core/collector/collector.d.ts +58 -0
- package/script/src/core/collector/collector.d.ts.map +1 -0
- package/script/src/core/collector/collector.js +63 -0
- package/script/src/core/collector/extractor.d.ts +33 -0
- package/script/src/core/collector/extractor.d.ts.map +1 -0
- package/script/src/core/collector/extractor.js +56 -0
- package/script/src/core/collector/mod.d.ts +9 -0
- package/script/src/core/collector/mod.d.ts.map +1 -0
- package/script/src/core/collector/mod.js +12 -0
- package/script/src/core/components/components.d.ts +4 -0
- package/script/src/core/components/components.d.ts.map +1 -0
- package/script/src/core/components/components.js +31 -0
- package/script/src/core/components/mod.d.ts +2 -0
- package/script/src/core/components/mod.d.ts.map +1 -0
- package/script/src/core/components/mod.js +5 -0
- package/script/src/core/composer/composer.d.ts +35 -0
- package/script/src/core/composer/composer.d.ts.map +1 -0
- package/script/src/core/composer/composer.js +75 -0
- package/script/src/core/composer/mod.d.ts +7 -0
- package/script/src/core/composer/mod.d.ts.map +1 -0
- package/script/src/core/composer/mod.js +10 -0
- package/script/src/core/mod.d.ts +15 -0
- package/script/src/core/mod.d.ts.map +1 -0
- package/script/src/core/mod.js +30 -0
- package/script/src/core/sync/mod.d.ts +9 -0
- package/script/src/core/sync/mod.d.ts.map +1 -0
- package/script/src/core/sync/mod.js +12 -0
- package/script/src/core/sync/resolver.d.ts +51 -0
- package/script/src/core/sync/resolver.d.ts.map +1 -0
- package/script/src/core/sync/resolver.js +91 -0
- package/script/src/core/sync/validator.d.ts +39 -0
- package/script/src/core/sync/validator.d.ts.map +1 -0
- package/script/src/core/sync/validator.js +68 -0
- package/script/src/core/types/components.d.ts +46 -0
- package/script/src/core/types/components.d.ts.map +1 -0
- package/script/src/core/types/components.js +3 -0
- package/script/src/core/types/descriptor.d.ts +47 -0
- package/script/src/core/types/descriptor.d.ts.map +1 -0
- package/script/src/core/types/descriptor.js +7 -0
- package/script/src/core/types/errors.d.ts +69 -0
- package/script/src/core/types/errors.d.ts.map +1 -0
- package/script/src/core/types/errors.js +35 -0
- package/script/src/core/types/layout.d.ts +100 -0
- package/script/src/core/types/layout.d.ts.map +1 -0
- package/script/src/core/types/layout.js +55 -0
- package/script/src/core/types/mcp-apps.d.ts +56 -0
- package/script/src/core/types/mcp-apps.d.ts.map +1 -0
- package/script/src/core/types/mcp-apps.js +17 -0
- package/script/src/core/types/mod.d.ts +17 -0
- package/script/src/core/types/mod.d.ts.map +1 -0
- package/script/src/core/types/mod.js +15 -0
- package/script/src/core/types/orchestration.d.ts +37 -0
- package/script/src/core/types/orchestration.d.ts.map +1 -0
- package/script/src/core/types/orchestration.js +7 -0
- package/script/src/core/types/resources.d.ts +37 -0
- package/script/src/core/types/resources.d.ts.map +1 -0
- package/script/src/core/types/resources.js +2 -0
- package/script/src/core/types/sync-rules.d.ts +80 -0
- package/script/src/core/types/sync-rules.d.ts.map +1 -0
- package/script/src/core/types/sync-rules.js +7 -0
- package/script/src/deploy/mod.d.ts +12 -0
- package/script/src/deploy/mod.d.ts.map +1 -0
- package/script/src/deploy/mod.js +15 -0
- package/script/src/deploy/types.d.ts +119 -0
- package/script/src/deploy/types.d.ts.map +1 -0
- package/script/src/deploy/types.js +22 -0
- package/script/src/host/components-contract.d.ts +6 -0
- package/script/src/host/components-contract.d.ts.map +1 -0
- package/script/src/host/components-contract.js +8 -0
- package/script/src/host/mod.d.ts +15 -0
- package/script/src/host/mod.d.ts.map +1 -0
- package/script/src/host/mod.js +21 -0
- package/script/src/host/renderer/css/base.d.ts +23 -0
- package/script/src/host/renderer/css/base.d.ts.map +1 -0
- package/script/src/host/renderer/css/base.js +51 -0
- package/script/src/host/renderer/css/layouts.d.ts +31 -0
- package/script/src/host/renderer/css/layouts.d.ts.map +1 -0
- package/script/src/host/renderer/css/layouts.js +132 -0
- package/script/src/host/renderer/html-generator.d.ts +36 -0
- package/script/src/host/renderer/html-generator.d.ts.map +1 -0
- package/script/src/host/renderer/html-generator.js +231 -0
- package/script/src/host/renderer/js/event-bus.d.ts +33 -0
- package/script/src/host/renderer/js/event-bus.d.ts.map +1 -0
- package/script/src/host/renderer/js/event-bus.js +594 -0
- package/script/src/host/renderer/mod.d.ts +9 -0
- package/script/src/host/renderer/mod.d.ts.map +1 -0
- package/script/src/host/renderer/mod.js +12 -0
- package/script/src/host/renderer/options.d.ts +126 -0
- package/script/src/host/renderer/options.d.ts.map +1 -0
- package/script/src/host/renderer/options.js +2 -0
- package/script/src/host/serve.d.ts +55 -0
- package/script/src/host/serve.d.ts.map +1 -0
- package/script/src/host/serve.js +92 -0
- package/script/src/host/types.d.ts +42 -0
- package/script/src/host/types.d.ts.map +1 -0
- package/script/src/host/types.js +10 -0
- package/script/src/runtime/cluster.d.ts +92 -0
- package/script/src/runtime/cluster.d.ts.map +1 -0
- package/script/src/runtime/cluster.js +864 -0
- package/script/src/runtime/compose.d.ts +67 -0
- package/script/src/runtime/compose.d.ts.map +1 -0
- package/script/src/runtime/compose.js +292 -0
- package/script/src/runtime/host-dashboard-types.d.ts +79 -0
- package/script/src/runtime/host-dashboard-types.d.ts.map +1 -0
- package/script/src/runtime/host-dashboard-types.js +10 -0
- package/script/src/runtime/host-dashboard.d.ts +29 -0
- package/script/src/runtime/host-dashboard.d.ts.map +1 -0
- package/script/src/runtime/host-dashboard.js +563 -0
- package/script/src/runtime/manifest.d.ts +58 -0
- package/script/src/runtime/manifest.d.ts.map +1 -0
- package/script/src/runtime/manifest.js +150 -0
- package/script/src/runtime/mod.d.ts +18 -0
- package/script/src/runtime/mod.d.ts.map +1 -0
- package/script/src/runtime/mod.js +41 -0
- package/script/src/runtime/template.d.ts +79 -0
- package/script/src/runtime/template.d.ts.map +1 -0
- package/script/src/runtime/template.js +295 -0
- package/script/src/runtime/types.d.ts +345 -0
- package/script/src/runtime/types.d.ts.map +1 -0
- package/script/src/runtime/types.js +31 -0
- package/script/src/sdk/compose-events.d.ts +130 -0
- package/script/src/sdk/compose-events.d.ts.map +1 -0
- package/script/src/sdk/compose-events.js +154 -0
- package/script/src/sdk/composition-validator.d.ts +97 -0
- package/script/src/sdk/composition-validator.d.ts.map +1 -0
- package/script/src/sdk/composition-validator.js +181 -0
- package/script/src/sdk/mcp-sdk.d.ts +92 -0
- package/script/src/sdk/mcp-sdk.d.ts.map +1 -0
- package/script/src/sdk/mcp-sdk.js +57 -0
- package/script/src/sdk/mod.d.ts +15 -0
- package/script/src/sdk/mod.d.ts.map +1 -0
- package/script/src/sdk/mod.js +18 -0
- package/script/src/sdk/ui-meta-builder.d.ts +99 -0
- package/script/src/sdk/ui-meta-builder.d.ts.map +1 -0
- package/script/src/sdk/ui-meta-builder.js +56 -0
- package/script/src/version.d.ts +30 -0
- package/script/src/version.d.ts.map +1 -0
- package/script/src/version.js +33 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { type SchemaType } from "./_schema.js";
|
|
2
|
+
import type { StyleVariant } from "./_type.js";
|
|
3
|
+
export type { SchemaType, StyleVariant };
|
|
4
|
+
/** Options for {@linkcode stringify}. */
|
|
5
|
+
export type StringifyOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* Indentation width to use (in spaces).
|
|
8
|
+
*
|
|
9
|
+
* @default {2}
|
|
10
|
+
*/
|
|
11
|
+
indent?: number;
|
|
12
|
+
/**
|
|
13
|
+
* When true, adds an indentation level to array elements.
|
|
14
|
+
*
|
|
15
|
+
* @default {true}
|
|
16
|
+
*/
|
|
17
|
+
arrayIndent?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Do not throw on invalid types (like function in the safe schema) and skip
|
|
20
|
+
* pairs and single values with such types.
|
|
21
|
+
*
|
|
22
|
+
* @default {false}
|
|
23
|
+
*/
|
|
24
|
+
skipInvalid?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Specifies level of nesting, when to switch from block to flow style for
|
|
27
|
+
* collections. `-1` means block style everywhere.
|
|
28
|
+
*
|
|
29
|
+
* @default {-1}
|
|
30
|
+
*/
|
|
31
|
+
flowLevel?: number;
|
|
32
|
+
/** Each tag may have own set of styles. - "tag" => "style" map. */
|
|
33
|
+
styles?: Record<string, StyleVariant>;
|
|
34
|
+
/**
|
|
35
|
+
* Name of the schema to use.
|
|
36
|
+
*
|
|
37
|
+
* @default {"default"}
|
|
38
|
+
*/
|
|
39
|
+
schema?: SchemaType;
|
|
40
|
+
/**
|
|
41
|
+
* If true, sort keys when dumping YAML in ascending, ASCII character order.
|
|
42
|
+
* If a function, use the function to sort the keys.
|
|
43
|
+
* If a function is specified, the function must return a negative value
|
|
44
|
+
* if first argument is less than second argument, zero if they're equal
|
|
45
|
+
* and a positive value otherwise.
|
|
46
|
+
*
|
|
47
|
+
* @default {false}
|
|
48
|
+
*/
|
|
49
|
+
sortKeys?: boolean | ((a: string, b: string, depth: number) => number);
|
|
50
|
+
/**
|
|
51
|
+
* Set max line width.
|
|
52
|
+
*
|
|
53
|
+
* @default {80}
|
|
54
|
+
*/
|
|
55
|
+
lineWidth?: number;
|
|
56
|
+
/**
|
|
57
|
+
* If false, don't convert duplicate objects into references.
|
|
58
|
+
*
|
|
59
|
+
* @default {true}
|
|
60
|
+
*/
|
|
61
|
+
useAnchors?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* If false don't try to be compatible with older yaml versions.
|
|
64
|
+
* Currently: don't quote "yes", "no" and so on,
|
|
65
|
+
* as required for YAML 1.1.
|
|
66
|
+
*
|
|
67
|
+
* @default {true}
|
|
68
|
+
*/
|
|
69
|
+
compatMode?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* If true flow sequences will be condensed, omitting the
|
|
72
|
+
* space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`.
|
|
73
|
+
* Can be useful when using yaml for pretty URL query params
|
|
74
|
+
* as spaces are %-encoded.
|
|
75
|
+
*
|
|
76
|
+
* @default {false}
|
|
77
|
+
*/
|
|
78
|
+
condenseFlow?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Strings will be quoted using this quoting style.
|
|
81
|
+
* If you specify single quotes, double quotes will still be used
|
|
82
|
+
* for non-printable characters.
|
|
83
|
+
*
|
|
84
|
+
* @default {`'`}
|
|
85
|
+
*/
|
|
86
|
+
quoteStyle?: "'" | '"';
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Converts a JavaScript object or value to a YAML document string.
|
|
90
|
+
*
|
|
91
|
+
* @example Usage
|
|
92
|
+
* ```ts
|
|
93
|
+
* import { stringify } from "@std/yaml/stringify";
|
|
94
|
+
* import { assertEquals } from "@std/assert";
|
|
95
|
+
*
|
|
96
|
+
* const data = { id: 1, name: "Alice" };
|
|
97
|
+
* const yaml = stringify(data);
|
|
98
|
+
*
|
|
99
|
+
* assertEquals(yaml, "id: 1\nname: Alice\n");
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @throws {TypeError} If `data` contains invalid types.
|
|
103
|
+
* @param data The data to serialize.
|
|
104
|
+
* @param options The options for serialization.
|
|
105
|
+
* @returns A YAML string.
|
|
106
|
+
*/
|
|
107
|
+
export declare function stringify(data: unknown, options?: StringifyOptions): string;
|
|
108
|
+
//# sourceMappingURL=stringify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringify.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.3.0/stringify.ts"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,CAAC;AAEzC,yCAAyC;AACzC,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IACtC;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACvE;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;CACxB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,gBAAqB,GAC7B,MAAM,CAMR"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Ported from js-yaml v3.13.1:
|
|
2
|
+
// https://github.com/nodeca/js-yaml/commit/665aadda42349dcae869f12040d9b10ef18d12da
|
|
3
|
+
// Copyright 2011-2015 by Vitaly Puzrin. All rights reserved. MIT license.
|
|
4
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
5
|
+
// This module is browser compatible.
|
|
6
|
+
import { DumperState } from "./_dumper_state.js";
|
|
7
|
+
import { SCHEMA_MAP } from "./_schema.js";
|
|
8
|
+
/**
|
|
9
|
+
* Converts a JavaScript object or value to a YAML document string.
|
|
10
|
+
*
|
|
11
|
+
* @example Usage
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { stringify } from "@std/yaml/stringify";
|
|
14
|
+
* import { assertEquals } from "@std/assert";
|
|
15
|
+
*
|
|
16
|
+
* const data = { id: 1, name: "Alice" };
|
|
17
|
+
* const yaml = stringify(data);
|
|
18
|
+
*
|
|
19
|
+
* assertEquals(yaml, "id: 1\nname: Alice\n");
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @throws {TypeError} If `data` contains invalid types.
|
|
23
|
+
* @param data The data to serialize.
|
|
24
|
+
* @param options The options for serialization.
|
|
25
|
+
* @returns A YAML string.
|
|
26
|
+
*/
|
|
27
|
+
export function stringify(data, options = {}) {
|
|
28
|
+
const state = new DumperState({
|
|
29
|
+
...options,
|
|
30
|
+
schema: SCHEMA_MAP.get(options.schema),
|
|
31
|
+
});
|
|
32
|
+
return state.stringify(data);
|
|
33
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the YAML parser.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Position information for error reporting.
|
|
8
|
+
*
|
|
9
|
+
* `line` and `column` are 1-indexed; `offset` is the 0-indexed character
|
|
10
|
+
* offset into the source string.
|
|
11
|
+
*/
|
|
12
|
+
export interface YamlPosition {
|
|
13
|
+
/** Line number (1-indexed). */
|
|
14
|
+
readonly line: number;
|
|
15
|
+
/** Column number (1-indexed). */
|
|
16
|
+
readonly column: number;
|
|
17
|
+
/** Character offset in the input (0-indexed). */
|
|
18
|
+
readonly offset: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Error thrown when YAML parsing fails.
|
|
22
|
+
*
|
|
23
|
+
* Subclass of {@linkcode SyntaxError}, so existing
|
|
24
|
+
* `instanceof SyntaxError` checks keep working. Carries structured
|
|
25
|
+
* position information so consumers do not have to parse the message.
|
|
26
|
+
*
|
|
27
|
+
* @example Usage
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { parse, YamlSyntaxError } from "@std/yaml";
|
|
30
|
+
* import { assertInstanceOf } from "@std/assert";
|
|
31
|
+
*
|
|
32
|
+
* try {
|
|
33
|
+
* parse(`"`);
|
|
34
|
+
* } catch (error) {
|
|
35
|
+
* assertInstanceOf(error, YamlSyntaxError);
|
|
36
|
+
* assertInstanceOf(error, SyntaxError);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare class YamlSyntaxError extends SyntaxError {
|
|
41
|
+
/**
|
|
42
|
+
* The line number where the error occurred (1-indexed).
|
|
43
|
+
*
|
|
44
|
+
* @example Usage
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
47
|
+
* import { assertEquals } from "@std/assert";
|
|
48
|
+
*
|
|
49
|
+
* const error = new YamlSyntaxError("Test", { line: 5, column: 10, offset: 50 });
|
|
50
|
+
* assertEquals(error.line, 5);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
readonly line: number;
|
|
54
|
+
/**
|
|
55
|
+
* The column number where the error occurred (1-indexed).
|
|
56
|
+
*
|
|
57
|
+
* @example Usage
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
60
|
+
* import { assertEquals } from "@std/assert";
|
|
61
|
+
*
|
|
62
|
+
* const error = new YamlSyntaxError("Test", { line: 5, column: 10, offset: 50 });
|
|
63
|
+
* assertEquals(error.column, 10);
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
readonly column: number;
|
|
67
|
+
/**
|
|
68
|
+
* The character offset where the error occurred (0-indexed).
|
|
69
|
+
*
|
|
70
|
+
* @example Usage
|
|
71
|
+
* ```ts
|
|
72
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
73
|
+
* import { assertEquals } from "@std/assert";
|
|
74
|
+
*
|
|
75
|
+
* const error = new YamlSyntaxError("Test", { line: 5, column: 10, offset: 50 });
|
|
76
|
+
* assertEquals(error.offset, 50);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
readonly offset: number;
|
|
80
|
+
/**
|
|
81
|
+
* A formatted snippet of the source around the error, including a caret
|
|
82
|
+
* line indicating the column. Undefined when the source is empty.
|
|
83
|
+
*
|
|
84
|
+
* @example Usage
|
|
85
|
+
* ```ts
|
|
86
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
87
|
+
* import { assertEquals } from "@std/assert";
|
|
88
|
+
*
|
|
89
|
+
* const snippet = " foo: bar\n ^";
|
|
90
|
+
* const error = new YamlSyntaxError(
|
|
91
|
+
* "Test",
|
|
92
|
+
* { line: 1, column: 6, offset: 5 },
|
|
93
|
+
* snippet,
|
|
94
|
+
* );
|
|
95
|
+
* assertEquals(error.snippet, snippet);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
readonly snippet?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Constructs a new YamlSyntaxError.
|
|
101
|
+
*
|
|
102
|
+
* The constructed `message` is `${message} at line ${line}, column ${column}`,
|
|
103
|
+
* with `:\n${snippet}` appended when a snippet is provided.
|
|
104
|
+
*
|
|
105
|
+
* @param message The error message describing the syntax issue.
|
|
106
|
+
* @param position The position in the YAML source where the error occurred.
|
|
107
|
+
* @param snippet Optional formatted snippet of the source around the error.
|
|
108
|
+
*/
|
|
109
|
+
constructor(message: string, position: YamlPosition, snippet?: string);
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/yaml/1.3.0/types.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,+BAA+B;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iCAAiC;IACjC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,eAAgB,SAAQ,WAAW;IAC9C;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;;;;;;;OAiBG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;OASG;gBACS,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,MAAM;CAWtE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Copyright 2018-2026 the Deno authors. MIT license.
|
|
2
|
+
// This module is browser compatible.
|
|
3
|
+
/**
|
|
4
|
+
* Error thrown when YAML parsing fails.
|
|
5
|
+
*
|
|
6
|
+
* Subclass of {@linkcode SyntaxError}, so existing
|
|
7
|
+
* `instanceof SyntaxError` checks keep working. Carries structured
|
|
8
|
+
* position information so consumers do not have to parse the message.
|
|
9
|
+
*
|
|
10
|
+
* @example Usage
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { parse, YamlSyntaxError } from "@std/yaml";
|
|
13
|
+
* import { assertInstanceOf } from "@std/assert";
|
|
14
|
+
*
|
|
15
|
+
* try {
|
|
16
|
+
* parse(`"`);
|
|
17
|
+
* } catch (error) {
|
|
18
|
+
* assertInstanceOf(error, YamlSyntaxError);
|
|
19
|
+
* assertInstanceOf(error, SyntaxError);
|
|
20
|
+
* }
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export class YamlSyntaxError extends SyntaxError {
|
|
24
|
+
/**
|
|
25
|
+
* The line number where the error occurred (1-indexed).
|
|
26
|
+
*
|
|
27
|
+
* @example Usage
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
30
|
+
* import { assertEquals } from "@std/assert";
|
|
31
|
+
*
|
|
32
|
+
* const error = new YamlSyntaxError("Test", { line: 5, column: 10, offset: 50 });
|
|
33
|
+
* assertEquals(error.line, 5);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
line;
|
|
37
|
+
/**
|
|
38
|
+
* The column number where the error occurred (1-indexed).
|
|
39
|
+
*
|
|
40
|
+
* @example Usage
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
43
|
+
* import { assertEquals } from "@std/assert";
|
|
44
|
+
*
|
|
45
|
+
* const error = new YamlSyntaxError("Test", { line: 5, column: 10, offset: 50 });
|
|
46
|
+
* assertEquals(error.column, 10);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
column;
|
|
50
|
+
/**
|
|
51
|
+
* The character offset where the error occurred (0-indexed).
|
|
52
|
+
*
|
|
53
|
+
* @example Usage
|
|
54
|
+
* ```ts
|
|
55
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
56
|
+
* import { assertEquals } from "@std/assert";
|
|
57
|
+
*
|
|
58
|
+
* const error = new YamlSyntaxError("Test", { line: 5, column: 10, offset: 50 });
|
|
59
|
+
* assertEquals(error.offset, 50);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
offset;
|
|
63
|
+
/**
|
|
64
|
+
* A formatted snippet of the source around the error, including a caret
|
|
65
|
+
* line indicating the column. Undefined when the source is empty.
|
|
66
|
+
*
|
|
67
|
+
* @example Usage
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { YamlSyntaxError } from "@std/yaml";
|
|
70
|
+
* import { assertEquals } from "@std/assert";
|
|
71
|
+
*
|
|
72
|
+
* const snippet = " foo: bar\n ^";
|
|
73
|
+
* const error = new YamlSyntaxError(
|
|
74
|
+
* "Test",
|
|
75
|
+
* { line: 1, column: 6, offset: 5 },
|
|
76
|
+
* snippet,
|
|
77
|
+
* );
|
|
78
|
+
* assertEquals(error.snippet, snippet);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
snippet;
|
|
82
|
+
/**
|
|
83
|
+
* Constructs a new YamlSyntaxError.
|
|
84
|
+
*
|
|
85
|
+
* The constructed `message` is `${message} at line ${line}, column ${column}`,
|
|
86
|
+
* with `:\n${snippet}` appended when a snippet is provided.
|
|
87
|
+
*
|
|
88
|
+
* @param message The error message describing the syntax issue.
|
|
89
|
+
* @param position The position in the YAML source where the error occurred.
|
|
90
|
+
* @param snippet Optional formatted snippet of the source around the error.
|
|
91
|
+
*/
|
|
92
|
+
constructor(message, position, snippet) {
|
|
93
|
+
let fullMessage = `${message} at line ${position.line}, column ${position.column}`;
|
|
94
|
+
if (snippet)
|
|
95
|
+
fullMessage += `:\n${snippet}`;
|
|
96
|
+
super(fullMessage);
|
|
97
|
+
this.name = "YamlSyntaxError";
|
|
98
|
+
this.line = position.line;
|
|
99
|
+
this.column = position.column;
|
|
100
|
+
this.offset = position.offset;
|
|
101
|
+
if (snippet !== undefined)
|
|
102
|
+
this.snippet = snippet;
|
|
103
|
+
}
|
|
104
|
+
}
|
package/esm/mod.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mcp-compose — MCP Apps UI Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Lightweight library for composing and synchronizing multiple MCP Apps UIs
|
|
5
|
+
* into composite dashboards.
|
|
6
|
+
*
|
|
7
|
+
* Pipeline: Collector -> Composer -> Renderer
|
|
8
|
+
*
|
|
9
|
+
* @module mcp-compose
|
|
10
|
+
*
|
|
11
|
+
* @example Basic usage
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { createCollector, buildCompositeUi, renderComposite } from "@mcpview/compose";
|
|
14
|
+
*
|
|
15
|
+
* // 1. Collect UI resources from MCP tool results
|
|
16
|
+
* const collector = createCollector();
|
|
17
|
+
* collector.collect("postgres:query", toolResult1, { query: "SELECT *" });
|
|
18
|
+
* collector.collect("viz:render", toolResult2);
|
|
19
|
+
*
|
|
20
|
+
* // 2. Compose into a descriptor
|
|
21
|
+
* const descriptor = buildCompositeUi(collector.getResources(), {
|
|
22
|
+
* layout: "split",
|
|
23
|
+
* sync: [{ from: "postgres:query", event: "filter", to: "viz:render", action: "update" }],
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // 3. Render to HTML
|
|
27
|
+
* const html = renderComposite(descriptor);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
import "./_dnt.polyfills.js";
|
|
31
|
+
export type { AdvertisedComponentCatalog, CollectedUiResource, ComponentSurface, ComponentSurfaceItem, ComponentSurfaceLayout, ComponentSurfaceResolution, CompositeUiDescriptor, JsonValue, McpToolResult, McpUiCsp, McpUiPermissions, McpUiResourceMeta, McpUiToolMeta, ReadyComponentSurface, ResolvedSyncRule, SurfaceGap, SurfaceLayoutType, UiLayout, UiOrchestration, UiPortSyncRule, UiSyncRule, UnresolvedComponentSurface, ValidationIssue, ValidationResult, ViewComponentDescriptor, ViewComponentEventPorts, } from "./src/core/types/mod.js";
|
|
32
|
+
export { ErrorCode, isValidLayout, UI_LAYOUT_PRESETS } from "./src/core/types/mod.js";
|
|
33
|
+
export { createCollector, extractUiMeta } from "./src/core/collector/mod.js";
|
|
34
|
+
export type { UiCollector } from "./src/core/collector/mod.js";
|
|
35
|
+
export { resolveSyncRules, validateSyncRules } from "./src/core/sync/mod.js";
|
|
36
|
+
export type { ResolutionResult } from "./src/core/sync/mod.js";
|
|
37
|
+
export { buildCompositeUi } from "./src/core/composer/mod.js";
|
|
38
|
+
export { resolveComponentSurface } from "./src/core/components/mod.js";
|
|
39
|
+
export { renderComposite } from "./src/host/renderer/mod.js";
|
|
40
|
+
export { createMcpSdkCollector } from "./src/sdk/mod.js";
|
|
41
|
+
export type { McpSdkCallToolResult, McpSdkCollector } from "./src/sdk/mod.js";
|
|
42
|
+
export { uiMeta } from "./src/sdk/mod.js";
|
|
43
|
+
export type { UiMetaOptions, UiMetaResult, UiMetaUi } from "./src/sdk/mod.js";
|
|
44
|
+
export { validateComposition } from "./src/sdk/mod.js";
|
|
45
|
+
export type { CompositionIssue, CompositionIssueCode, CompositionValidationResult, } from "./src/sdk/mod.js";
|
|
46
|
+
export { COMPOSE_EVENT_METHOD, composeEvents } from "./src/sdk/mod.js";
|
|
47
|
+
export type { ComposeEventHandler, ComposeEventPayload, ComposeEvents, ComposeSource, ComposeTarget, } from "./src/sdk/mod.js";
|
|
48
|
+
export type { CompositeUiHost, HostConfig } from "./src/host/mod.js";
|
|
49
|
+
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAGH,OAAO,qBAAqB,CAAC;AAE7B,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,iBAAiB,EACjB,QAAQ,EACR,eAAe,EACf,cAAc,EACd,UAAU,EACV,0BAA0B,EAC1B,eAAe,EACf,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC7E,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC7E,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,YAAY,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACvE,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
package/esm/mod.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* mcp-compose — MCP Apps UI Orchestrator
|
|
3
|
+
*
|
|
4
|
+
* Lightweight library for composing and synchronizing multiple MCP Apps UIs
|
|
5
|
+
* into composite dashboards.
|
|
6
|
+
*
|
|
7
|
+
* Pipeline: Collector -> Composer -> Renderer
|
|
8
|
+
*
|
|
9
|
+
* @module mcp-compose
|
|
10
|
+
*
|
|
11
|
+
* @example Basic usage
|
|
12
|
+
* ```typescript
|
|
13
|
+
* import { createCollector, buildCompositeUi, renderComposite } from "@mcpview/compose";
|
|
14
|
+
*
|
|
15
|
+
* // 1. Collect UI resources from MCP tool results
|
|
16
|
+
* const collector = createCollector();
|
|
17
|
+
* collector.collect("postgres:query", toolResult1, { query: "SELECT *" });
|
|
18
|
+
* collector.collect("viz:render", toolResult2);
|
|
19
|
+
*
|
|
20
|
+
* // 2. Compose into a descriptor
|
|
21
|
+
* const descriptor = buildCompositeUi(collector.getResources(), {
|
|
22
|
+
* layout: "split",
|
|
23
|
+
* sync: [{ from: "postgres:query", event: "filter", to: "viz:render", action: "update" }],
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // 3. Render to HTML
|
|
27
|
+
* const html = renderComposite(descriptor);
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
// Core — types, collector, sync, composer, renderer
|
|
31
|
+
import "./_dnt.polyfills.js";
|
|
32
|
+
export { ErrorCode, isValidLayout, UI_LAYOUT_PRESETS } from "./src/core/types/mod.js";
|
|
33
|
+
export { createCollector, extractUiMeta } from "./src/core/collector/mod.js";
|
|
34
|
+
export { resolveSyncRules, validateSyncRules } from "./src/core/sync/mod.js";
|
|
35
|
+
export { buildCompositeUi } from "./src/core/composer/mod.js";
|
|
36
|
+
export { resolveComponentSurface } from "./src/core/components/mod.js";
|
|
37
|
+
export { renderComposite } from "./src/host/renderer/mod.js";
|
|
38
|
+
// SDK — MCP client adapters (optional convenience wrappers)
|
|
39
|
+
export { createMcpSdkCollector } from "./src/sdk/mod.js";
|
|
40
|
+
export { uiMeta } from "./src/sdk/mod.js";
|
|
41
|
+
export { validateComposition } from "./src/sdk/mod.js";
|
|
42
|
+
export { COMPOSE_EVENT_METHOD, composeEvents } from "./src/sdk/mod.js";
|
package/esm/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI resource collector — inspects MCP tool results and accumulates UI resources.
|
|
3
|
+
*
|
|
4
|
+
* @module collector/collector
|
|
5
|
+
*/
|
|
6
|
+
import type { CollectedUiResource } from "../types/resources.js";
|
|
7
|
+
import type { ComponentSurface } from "../types/components.js";
|
|
8
|
+
/**
|
|
9
|
+
* Collector interface for accumulating UI resources from MCP tool results.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const collector = createCollector();
|
|
14
|
+
* collector.collect("postgres:query", toolResult);
|
|
15
|
+
* collector.collect("viz:render", vizResult);
|
|
16
|
+
* const resources = collector.getResources();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export interface UiCollector {
|
|
20
|
+
/** Inspect a tool result and collect any UI resource. Returns the resource or `null`. */
|
|
21
|
+
collect(toolName: string, result: unknown, context?: Record<string, unknown>, options?: {
|
|
22
|
+
readonly componentId?: string;
|
|
23
|
+
readonly surface?: ComponentSurface;
|
|
24
|
+
}): CollectedUiResource | null;
|
|
25
|
+
/** Get all collected resources in slot order. */
|
|
26
|
+
getResources(): CollectedUiResource[];
|
|
27
|
+
/** Reset collected resources. */
|
|
28
|
+
clear(): void;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a new UI resource collector.
|
|
32
|
+
*
|
|
33
|
+
* The collector inspects MCP tool call results for `_meta.ui.resourceUri`
|
|
34
|
+
* and accumulates them with auto-incrementing slot indices.
|
|
35
|
+
*
|
|
36
|
+
* @returns A new `UiCollector` instance
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const collector = createCollector();
|
|
41
|
+
*
|
|
42
|
+
* const r1 = collector.collect("postgres:query", {
|
|
43
|
+
* content: [{ type: "text", text: "OK" }],
|
|
44
|
+
* _meta: { ui: { resourceUri: "ui://pg/table/1" } },
|
|
45
|
+
* });
|
|
46
|
+
* // r1 === { source: "postgres:query", resourceUri: "ui://pg/table/1", slot: 0 }
|
|
47
|
+
*
|
|
48
|
+
* const r2 = collector.collect("viz:render", {
|
|
49
|
+
* content: [{ type: "text", text: "Chart" }],
|
|
50
|
+
* _meta: { ui: { resourceUri: "ui://viz/chart/2" } },
|
|
51
|
+
* });
|
|
52
|
+
* // r2.slot === 1
|
|
53
|
+
*
|
|
54
|
+
* collector.getResources().length; // 2
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare function createCollector(): UiCollector;
|
|
58
|
+
//# sourceMappingURL=collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collector.d.ts","sourceRoot":"","sources":["../../../../src/src/core/collector/collector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG/D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,OAAO,CACL,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;KACrC,GACA,mBAAmB,GAAG,IAAI,CAAC;IAE9B,iDAAiD;IACjD,YAAY,IAAI,mBAAmB,EAAE,CAAC;IAEtC,iCAAiC;IACjC,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,eAAe,IAAI,WAAW,CAuC7C"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI resource collector — inspects MCP tool results and accumulates UI resources.
|
|
3
|
+
*
|
|
4
|
+
* @module collector/collector
|
|
5
|
+
*/
|
|
6
|
+
import { extractUiMeta } from "./extractor.js";
|
|
7
|
+
/**
|
|
8
|
+
* Create a new UI resource collector.
|
|
9
|
+
*
|
|
10
|
+
* The collector inspects MCP tool call results for `_meta.ui.resourceUri`
|
|
11
|
+
* and accumulates them with auto-incrementing slot indices.
|
|
12
|
+
*
|
|
13
|
+
* @returns A new `UiCollector` instance
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const collector = createCollector();
|
|
18
|
+
*
|
|
19
|
+
* const r1 = collector.collect("postgres:query", {
|
|
20
|
+
* content: [{ type: "text", text: "OK" }],
|
|
21
|
+
* _meta: { ui: { resourceUri: "ui://pg/table/1" } },
|
|
22
|
+
* });
|
|
23
|
+
* // r1 === { source: "postgres:query", resourceUri: "ui://pg/table/1", slot: 0 }
|
|
24
|
+
*
|
|
25
|
+
* const r2 = collector.collect("viz:render", {
|
|
26
|
+
* content: [{ type: "text", text: "Chart" }],
|
|
27
|
+
* _meta: { ui: { resourceUri: "ui://viz/chart/2" } },
|
|
28
|
+
* });
|
|
29
|
+
* // r2.slot === 1
|
|
30
|
+
*
|
|
31
|
+
* collector.getResources().length; // 2
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export function createCollector() {
|
|
35
|
+
let resources = [];
|
|
36
|
+
return {
|
|
37
|
+
collect(toolName, result, context, options) {
|
|
38
|
+
const meta = extractUiMeta(result);
|
|
39
|
+
if (!meta?.resourceUri) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
const resource = {
|
|
43
|
+
...(options?.componentId === undefined ? {} : { componentId: options.componentId }),
|
|
44
|
+
source: toolName,
|
|
45
|
+
resourceUri: meta.resourceUri,
|
|
46
|
+
context,
|
|
47
|
+
...(options?.surface === undefined ? {} : { surface: options.surface }),
|
|
48
|
+
slot: resources.length,
|
|
49
|
+
};
|
|
50
|
+
resources.push(resource);
|
|
51
|
+
return resource;
|
|
52
|
+
},
|
|
53
|
+
getResources() {
|
|
54
|
+
return [...resources];
|
|
55
|
+
},
|
|
56
|
+
clear() {
|
|
57
|
+
resources = [];
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UI metadata extractor — extracts `_meta.ui` from MCP tool results.
|
|
3
|
+
*
|
|
4
|
+
* @module collector/extractor
|
|
5
|
+
*/
|
|
6
|
+
import type { McpUiToolMeta } from "../types/mcp-apps.js";
|
|
7
|
+
/**
|
|
8
|
+
* Extract UI metadata from an MCP tool call result.
|
|
9
|
+
*
|
|
10
|
+
* Looks for `_meta.ui.resourceUri` in the result object.
|
|
11
|
+
* Returns `null` if the result is not an object, has no `_meta`,
|
|
12
|
+
* or has no `ui.resourceUri`.
|
|
13
|
+
*
|
|
14
|
+
* @param result - Raw MCP tool call result (unknown shape)
|
|
15
|
+
* @returns Extracted UI metadata, or `null` if none found
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const meta = extractUiMeta({
|
|
20
|
+
* content: [{ type: "text", text: "OK" }],
|
|
21
|
+
* _meta: { ui: { resourceUri: "ui://pg/table/1" } },
|
|
22
|
+
* });
|
|
23
|
+
* // meta === { resourceUri: "ui://pg/table/1" }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example No UI metadata
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const meta = extractUiMeta({ content: [{ type: "text", text: "OK" }] });
|
|
29
|
+
* // meta === null
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function extractUiMeta(result: unknown): McpUiToolMeta | null;
|
|
33
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../../../src/src/core/collector/extractor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CA6BnE"}
|