@mcpview/compose 0.0.0-stage → 0.11.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 +268 -0
- package/LICENSE +21 -0
- package/README.md +524 -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 +592 -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 +887 -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 +58 -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 +595 -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 +892 -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,150 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Manifest parsing and validation.
|
|
4
|
+
*
|
|
5
|
+
* Reads static MCP server manifests from JSON files.
|
|
6
|
+
* No server startup needed — manifests are generated at build time.
|
|
7
|
+
*
|
|
8
|
+
* @module runtime/manifest
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.validateManifest = validateManifest;
|
|
12
|
+
exports.parseManifest = parseManifest;
|
|
13
|
+
exports.loadManifest = loadManifest;
|
|
14
|
+
exports.loadManifests = loadManifests;
|
|
15
|
+
const types_js_1 = require("./types.js");
|
|
16
|
+
/**
|
|
17
|
+
* Validate a raw object as a manifest. Returns errors if invalid.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const { valid, errors } = validateManifest(data);
|
|
22
|
+
* if (!valid) console.error(errors);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
function validateManifest(data) {
|
|
26
|
+
const errors = [];
|
|
27
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
28
|
+
return { valid: false, errors: ["Manifest must be a non-null object"] };
|
|
29
|
+
}
|
|
30
|
+
const obj = data;
|
|
31
|
+
if (typeof obj.name !== "string" || obj.name.trim() === "") {
|
|
32
|
+
errors.push("Manifest must have a non-empty 'name' string");
|
|
33
|
+
}
|
|
34
|
+
if (!obj.transport || typeof obj.transport !== "object") {
|
|
35
|
+
errors.push("Manifest must have a 'transport' object");
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const transport = obj.transport;
|
|
39
|
+
if (transport.protocol !== undefined &&
|
|
40
|
+
transport.protocol !== "auto" &&
|
|
41
|
+
transport.protocol !== "stateless-2026-07-28" &&
|
|
42
|
+
transport.protocol !== "streamable-http") {
|
|
43
|
+
errors.push('transport.protocol must be "auto", "stateless-2026-07-28", or "streamable-http" if provided');
|
|
44
|
+
}
|
|
45
|
+
if (transport.type === "stdio") {
|
|
46
|
+
if (typeof transport.command !== "string" || transport.command.trim() === "") {
|
|
47
|
+
errors.push("transport.command must be a non-empty string for stdio transport");
|
|
48
|
+
}
|
|
49
|
+
if (transport.args !== undefined && !Array.isArray(transport.args)) {
|
|
50
|
+
errors.push("transport.args must be an array if provided");
|
|
51
|
+
}
|
|
52
|
+
if (transport.env !== undefined &&
|
|
53
|
+
(typeof transport.env !== "object" || transport.env === null)) {
|
|
54
|
+
errors.push("transport.env must be an object if provided");
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
else if (transport.type === "http") {
|
|
58
|
+
if (typeof transport.url !== "string" || transport.url.trim() === "") {
|
|
59
|
+
errors.push("transport.url must be a non-empty string for http transport");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
errors.push(`transport.type must be "stdio" or "http", got "${String(transport.type)}"`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (!Array.isArray(obj.tools)) {
|
|
67
|
+
errors.push("Manifest must have a 'tools' array");
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
for (let i = 0; i < obj.tools.length; i++) {
|
|
71
|
+
const tool = obj.tools[i];
|
|
72
|
+
if (!tool || typeof tool !== "object") {
|
|
73
|
+
errors.push(`tools[${i}] must be an object`);
|
|
74
|
+
}
|
|
75
|
+
else if (typeof tool.name !== "string" || tool.name.trim() === "") {
|
|
76
|
+
errors.push(`tools[${i}] must have a non-empty 'name' string`);
|
|
77
|
+
}
|
|
78
|
+
else if (tool.appCallable !== undefined && typeof tool.appCallable !== "boolean") {
|
|
79
|
+
errors.push(`tools[${i}].appCallable must be a boolean if provided`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { valid: errors.length === 0, errors };
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Parse a JSON string into a validated McpManifest.
|
|
87
|
+
*
|
|
88
|
+
* @param json - Raw JSON string
|
|
89
|
+
* @param filePath - Optional file path for error messages
|
|
90
|
+
* @returns Parsed manifest
|
|
91
|
+
* @throws RuntimeError on invalid JSON or validation failure
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const manifest = parseManifest('{"name":"pg","command":"pg-mcp","tools":[{"name":"query"}]}');
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
function parseManifest(json, filePath) {
|
|
99
|
+
let data;
|
|
100
|
+
try {
|
|
101
|
+
data = JSON.parse(json);
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
throw {
|
|
105
|
+
code: types_js_1.RuntimeErrorCode.MANIFEST_PARSE_ERROR,
|
|
106
|
+
message: `Invalid JSON${filePath ? ` in ${filePath}` : ""}: ${e instanceof Error ? e.message : String(e)}`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const validation = validateManifest(data);
|
|
110
|
+
if (!validation.valid) {
|
|
111
|
+
throw {
|
|
112
|
+
code: types_js_1.RuntimeErrorCode.MANIFEST_PARSE_ERROR,
|
|
113
|
+
message: `Invalid manifest${filePath ? ` in ${filePath}` : ""}: ${validation.errors.join("; ")}`,
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
return data;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Load a manifest from a file path.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```typescript
|
|
123
|
+
* const manifest = await loadManifest("./manifests/postgres.json");
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
async function loadManifest(path) {
|
|
127
|
+
const json = await Deno.readTextFile(path);
|
|
128
|
+
return parseManifest(json, path);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Load all manifests from a directory (all `.json` files).
|
|
132
|
+
*
|
|
133
|
+
* @returns Map keyed by manifest name
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const manifests = await loadManifests("./manifests/");
|
|
138
|
+
* // manifests.get("postgres") → McpManifest
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
async function loadManifests(dirPath) {
|
|
142
|
+
const manifests = new Map();
|
|
143
|
+
for await (const entry of Deno.readDir(dirPath)) {
|
|
144
|
+
if (!entry.isFile || !entry.name.endsWith(".json"))
|
|
145
|
+
continue;
|
|
146
|
+
const manifest = await loadManifest(`${dirPath}/${entry.name}`);
|
|
147
|
+
manifests.set(manifest.name, manifest);
|
|
148
|
+
}
|
|
149
|
+
return manifests;
|
|
150
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime module — dashboard composition from manifests + templates.
|
|
3
|
+
*
|
|
4
|
+
* Handles I/O: reading manifests/templates, starting MCP servers,
|
|
5
|
+
* calling tools, and feeding results into the core pipeline.
|
|
6
|
+
*
|
|
7
|
+
* @module runtime
|
|
8
|
+
*/
|
|
9
|
+
import "../../_dnt.polyfills.js";
|
|
10
|
+
export type { ComposeRequest, ComposeResult, DashboardTemplate, HttpTransport, McpCluster, McpConnection, McpHttpProtocol, McpListedResource, McpListedTool, McpListResourcesResult, McpListToolsResult, McpManifest, McpReadResourceResult, McpToolDeclaration, McpTransport, RuntimeError, StdioTransport, TemplateSource, TemplateToolCall, } from "./types.js";
|
|
11
|
+
export type { ComposedDashboardCsp, ComposedDashboardHandle, ComposedDashboardPanel, ComposedDashboardTool, ServeComposedDashboardOptions, } from "./host-dashboard-types.js";
|
|
12
|
+
export { RuntimeErrorCode } from "./types.js";
|
|
13
|
+
export { loadManifest, loadManifests, parseManifest, validateManifest } from "./manifest.js";
|
|
14
|
+
export { injectArgs, loadTemplate, parseTemplate, parseTemplateJson, validateTemplate, } from "./template.js";
|
|
15
|
+
export { connectHttp, createCluster, startServer } from "./cluster.js";
|
|
16
|
+
export { composeDashboard, composeDashboardFromFiles } from "./compose.js";
|
|
17
|
+
export { composeAndServeDashboard, serveComposedDashboard } from "./host-dashboard.js";
|
|
18
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,yBAAyB,CAAC;AAEjC,YAAY,EACV,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,UAAU,EACV,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,WAAW,EACX,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAG7F,OAAO,EACL,UAAU,EACV,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGvE,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Runtime module — dashboard composition from manifests + templates.
|
|
4
|
+
*
|
|
5
|
+
* Handles I/O: reading manifests/templates, starting MCP servers,
|
|
6
|
+
* calling tools, and feeding results into the core pipeline.
|
|
7
|
+
*
|
|
8
|
+
* @module runtime
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.serveComposedDashboard = exports.composeAndServeDashboard = exports.composeDashboardFromFiles = exports.composeDashboard = exports.startServer = exports.createCluster = exports.connectHttp = exports.validateTemplate = exports.parseTemplateJson = exports.parseTemplate = exports.loadTemplate = exports.injectArgs = exports.validateManifest = exports.parseManifest = exports.loadManifests = exports.loadManifest = exports.RuntimeErrorCode = void 0;
|
|
12
|
+
// Types
|
|
13
|
+
require("../../_dnt.polyfills.js");
|
|
14
|
+
var types_js_1 = require("./types.js");
|
|
15
|
+
Object.defineProperty(exports, "RuntimeErrorCode", { enumerable: true, get: function () { return types_js_1.RuntimeErrorCode; } });
|
|
16
|
+
// Manifest
|
|
17
|
+
var manifest_js_1 = require("./manifest.js");
|
|
18
|
+
Object.defineProperty(exports, "loadManifest", { enumerable: true, get: function () { return manifest_js_1.loadManifest; } });
|
|
19
|
+
Object.defineProperty(exports, "loadManifests", { enumerable: true, get: function () { return manifest_js_1.loadManifests; } });
|
|
20
|
+
Object.defineProperty(exports, "parseManifest", { enumerable: true, get: function () { return manifest_js_1.parseManifest; } });
|
|
21
|
+
Object.defineProperty(exports, "validateManifest", { enumerable: true, get: function () { return manifest_js_1.validateManifest; } });
|
|
22
|
+
// Template
|
|
23
|
+
var template_js_1 = require("./template.js");
|
|
24
|
+
Object.defineProperty(exports, "injectArgs", { enumerable: true, get: function () { return template_js_1.injectArgs; } });
|
|
25
|
+
Object.defineProperty(exports, "loadTemplate", { enumerable: true, get: function () { return template_js_1.loadTemplate; } });
|
|
26
|
+
Object.defineProperty(exports, "parseTemplate", { enumerable: true, get: function () { return template_js_1.parseTemplate; } });
|
|
27
|
+
Object.defineProperty(exports, "parseTemplateJson", { enumerable: true, get: function () { return template_js_1.parseTemplateJson; } });
|
|
28
|
+
Object.defineProperty(exports, "validateTemplate", { enumerable: true, get: function () { return template_js_1.validateTemplate; } });
|
|
29
|
+
// Cluster
|
|
30
|
+
var cluster_js_1 = require("./cluster.js");
|
|
31
|
+
Object.defineProperty(exports, "connectHttp", { enumerable: true, get: function () { return cluster_js_1.connectHttp; } });
|
|
32
|
+
Object.defineProperty(exports, "createCluster", { enumerable: true, get: function () { return cluster_js_1.createCluster; } });
|
|
33
|
+
Object.defineProperty(exports, "startServer", { enumerable: true, get: function () { return cluster_js_1.startServer; } });
|
|
34
|
+
// Compose (main entry points)
|
|
35
|
+
var compose_js_1 = require("./compose.js");
|
|
36
|
+
Object.defineProperty(exports, "composeDashboard", { enumerable: true, get: function () { return compose_js_1.composeDashboard; } });
|
|
37
|
+
Object.defineProperty(exports, "composeDashboardFromFiles", { enumerable: true, get: function () { return compose_js_1.composeDashboardFromFiles; } });
|
|
38
|
+
// Interactive local MCP Apps host
|
|
39
|
+
var host_dashboard_js_1 = require("./host-dashboard.js");
|
|
40
|
+
Object.defineProperty(exports, "composeAndServeDashboard", { enumerable: true, get: function () { return host_dashboard_js_1.composeAndServeDashboard; } });
|
|
41
|
+
Object.defineProperty(exports, "serveComposedDashboard", { enumerable: true, get: function () { return host_dashboard_js_1.serveComposedDashboard; } });
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dashboard template parsing, validation, and arg injection.
|
|
3
|
+
*
|
|
4
|
+
* Canonical agent-authored templates are JSON. YAML remains supported for existing human-authored
|
|
5
|
+
* dashboards. Both define which MCP servers to start, which tools to call, and how to arrange the
|
|
6
|
+
* resulting UIs.
|
|
7
|
+
* Runtime args are injected via `{{placeholder}}` syntax.
|
|
8
|
+
*
|
|
9
|
+
* @module runtime/template
|
|
10
|
+
*/
|
|
11
|
+
import type { DashboardTemplate, McpManifest, TemplateSource, TemplateToolCall } from "./types.js";
|
|
12
|
+
/**
|
|
13
|
+
* Validate a template against available manifests.
|
|
14
|
+
*
|
|
15
|
+
* Checks that each source references an existing manifest
|
|
16
|
+
* and each tool call references a tool in that manifest.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const { valid, errors } = validateTemplate(template, manifests);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateTemplate(template: DashboardTemplate, manifests: Map<string, McpManifest>): {
|
|
24
|
+
valid: boolean;
|
|
25
|
+
errors: string[];
|
|
26
|
+
};
|
|
27
|
+
/** Resolve the stable component identity used by slots, routes, and layout areas. */
|
|
28
|
+
export declare function resolveTemplateComponentId(source: TemplateSource, _sourceIndex: number, call: TemplateToolCall, callIndex: number): string;
|
|
29
|
+
/**
|
|
30
|
+
* Parse a YAML string into a DashboardTemplate.
|
|
31
|
+
*
|
|
32
|
+
* @param yaml - Raw YAML string
|
|
33
|
+
* @param filePath - Optional file path for error messages
|
|
34
|
+
* @returns Parsed template
|
|
35
|
+
* @throws RuntimeError on invalid YAML or structure
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const template = parseTemplate(`
|
|
40
|
+
* name: My Dashboard
|
|
41
|
+
* sources:
|
|
42
|
+
* - manifest: postgres
|
|
43
|
+
* calls:
|
|
44
|
+
* - tool: query
|
|
45
|
+
* orchestration:
|
|
46
|
+
* layout: split
|
|
47
|
+
* `);
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function parseTemplate(yaml: string, filePath?: string): DashboardTemplate;
|
|
51
|
+
/** Parse the canonical agent-facing JSON dashboard manifest. */
|
|
52
|
+
export declare function parseTemplateJson(json: string, filePath?: string): DashboardTemplate;
|
|
53
|
+
/**
|
|
54
|
+
* Load a template from a file path.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const template = await loadTemplate("./dashboards/sales.yaml");
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function loadTemplate(path: string): Promise<DashboardTemplate>;
|
|
62
|
+
/**
|
|
63
|
+
* Inject runtime args into tool call arguments.
|
|
64
|
+
*
|
|
65
|
+
* Replaces `{{key}}` placeholders in string values with the corresponding
|
|
66
|
+
* runtime arg. If the entire value is a `{{key}}` placeholder, the replacement
|
|
67
|
+
* preserves the original type. Partial placeholders produce string concatenation.
|
|
68
|
+
*
|
|
69
|
+
* Does not mutate the input — returns new TemplateToolCall objects.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```typescript
|
|
73
|
+
* const calls = [{ tool: "query", args: { id: "{{customer_id}}" } }];
|
|
74
|
+
* const result = injectArgs(calls, { customer_id: "C-123" });
|
|
75
|
+
* // result[0].args.id === "C-123"
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export declare function injectArgs(calls: TemplateToolCall[], args: Record<string, unknown>): TemplateToolCall[];
|
|
79
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/src/runtime/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAKnG;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,iBAAiB,EAC3B,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAClC;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAwFtC;AAED,qFAAqF;AACrF,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,gBAAgB,EACtB,SAAS,EAAE,MAAM,GAChB,MAAM,CAKR;AA6ED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAchF;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAapF;AAED;;;;;;;GAOG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAK3E;AAgBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CACxB,KAAK,EAAE,gBAAgB,EAAE,EACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,gBAAgB,EAAE,CAWpB"}
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dashboard template parsing, validation, and arg injection.
|
|
4
|
+
*
|
|
5
|
+
* Canonical agent-authored templates are JSON. YAML remains supported for existing human-authored
|
|
6
|
+
* dashboards. Both define which MCP servers to start, which tools to call, and how to arrange the
|
|
7
|
+
* resulting UIs.
|
|
8
|
+
* Runtime args are injected via `{{placeholder}}` syntax.
|
|
9
|
+
*
|
|
10
|
+
* @module runtime/template
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.validateTemplate = validateTemplate;
|
|
14
|
+
exports.resolveTemplateComponentId = resolveTemplateComponentId;
|
|
15
|
+
exports.parseTemplate = parseTemplate;
|
|
16
|
+
exports.parseTemplateJson = parseTemplateJson;
|
|
17
|
+
exports.loadTemplate = loadTemplate;
|
|
18
|
+
exports.injectArgs = injectArgs;
|
|
19
|
+
const mod_js_1 = require("../../deps/jsr.io/@std/yaml/1.3.0/mod.js");
|
|
20
|
+
const types_js_1 = require("./types.js");
|
|
21
|
+
const layout_js_1 = require("../core/types/layout.js");
|
|
22
|
+
/**
|
|
23
|
+
* Validate a template against available manifests.
|
|
24
|
+
*
|
|
25
|
+
* Checks that each source references an existing manifest
|
|
26
|
+
* and each tool call references a tool in that manifest.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const { valid, errors } = validateTemplate(template, manifests);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
function validateTemplate(template, manifests) {
|
|
34
|
+
const errors = [];
|
|
35
|
+
if (!template.name || typeof template.name !== "string") {
|
|
36
|
+
errors.push("Template must have a non-empty 'name'");
|
|
37
|
+
}
|
|
38
|
+
if (!Array.isArray(template.sources) || template.sources.length === 0) {
|
|
39
|
+
errors.push("Template must have at least one source");
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
const componentIds = new Map();
|
|
43
|
+
for (let i = 0; i < template.sources.length; i++) {
|
|
44
|
+
const source = template.sources[i];
|
|
45
|
+
const manifest = manifests.get(source.manifest);
|
|
46
|
+
if (!manifest) {
|
|
47
|
+
errors.push(`sources[${i}].manifest "${source.manifest}" not found in available manifests`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (!Array.isArray(source.calls) || source.calls.length === 0) {
|
|
51
|
+
errors.push(`sources[${i}] must have at least one tool call`);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
const toolNames = new Set(manifest.tools.map((t) => t.name));
|
|
55
|
+
const occurrences = new Map();
|
|
56
|
+
for (const call of source.calls) {
|
|
57
|
+
occurrences.set(call.tool, (occurrences.get(call.tool) ?? 0) + 1);
|
|
58
|
+
}
|
|
59
|
+
for (let j = 0; j < source.calls.length; j++) {
|
|
60
|
+
const call = source.calls[j];
|
|
61
|
+
if (!toolNames.has(call.tool)) {
|
|
62
|
+
errors.push(`sources[${i}].calls[${j}].tool "${call.tool}" not found in manifest "${source.manifest}"`);
|
|
63
|
+
}
|
|
64
|
+
if ((occurrences.get(call.tool) ?? 0) > 1 && !call.id) {
|
|
65
|
+
errors.push(`sources[${i}].calls[${j}] repeats tool "${call.tool}" and requires a stable 'id'`);
|
|
66
|
+
}
|
|
67
|
+
const componentId = resolveTemplateComponentId(source, i, call, j);
|
|
68
|
+
const previous = componentIds.get(componentId);
|
|
69
|
+
if (previous) {
|
|
70
|
+
errors.push(`Duplicate component id "${componentId}" at sources[${i}].calls[${j}]; already used by ${previous}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
componentIds.set(componentId, `sources[${i}].calls[${j}]`);
|
|
74
|
+
}
|
|
75
|
+
validateSurface(call.surface ?? source.surface, `sources[${i}]${call.surface ? `.calls[${j}]` : ""}.surface`, errors);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (!template.orchestration || typeof template.orchestration !== "object") {
|
|
80
|
+
errors.push("Template must have an 'orchestration' object");
|
|
81
|
+
}
|
|
82
|
+
else if (!(0, layout_js_1.isValidLayout)(template.orchestration.layout)) {
|
|
83
|
+
errors.push(`orchestration.layout "${template.orchestration.layout}" is not a valid layout`);
|
|
84
|
+
}
|
|
85
|
+
if (template.orchestration?.portSync !== undefined) {
|
|
86
|
+
if (!Array.isArray(template.orchestration.portSync)) {
|
|
87
|
+
errors.push("orchestration.portSync must be an array");
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
for (let index = 0; index < template.orchestration.portSync.length; index++) {
|
|
91
|
+
const rule = template.orchestration.portSync[index];
|
|
92
|
+
for (const field of ["event", "action"]) {
|
|
93
|
+
if (typeof rule?.[field] !== "string" || !rule[field].trim()) {
|
|
94
|
+
errors.push(`orchestration.portSync[${index}].${field} must be a non-empty string`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return { valid: errors.length === 0, errors };
|
|
101
|
+
}
|
|
102
|
+
/** Resolve the stable component identity used by slots, routes, and layout areas. */
|
|
103
|
+
function resolveTemplateComponentId(source, _sourceIndex, call, callIndex) {
|
|
104
|
+
if (call.id)
|
|
105
|
+
return call.id;
|
|
106
|
+
if (source.calls.length === 1 && source.id)
|
|
107
|
+
return source.id;
|
|
108
|
+
if (source.id)
|
|
109
|
+
return `${source.id}/${call.tool}-${callIndex + 1}`;
|
|
110
|
+
return `${source.manifest}:${call.tool}`;
|
|
111
|
+
}
|
|
112
|
+
function validateSurface(surface, path, errors) {
|
|
113
|
+
if (surface === undefined)
|
|
114
|
+
return;
|
|
115
|
+
if (!surface || typeof surface !== "object") {
|
|
116
|
+
errors.push(`${path} must be an object`);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const layout = surface.layout;
|
|
120
|
+
if (!layout || !["stack", "row", "grid"].includes(layout.type)) {
|
|
121
|
+
errors.push(`${path}.layout.type must be stack, row, or grid`);
|
|
122
|
+
}
|
|
123
|
+
else {
|
|
124
|
+
if (layout.columns !== undefined &&
|
|
125
|
+
(!Number.isInteger(layout.columns) || layout.columns < 1 || layout.columns > 12)) {
|
|
126
|
+
errors.push(`${path}.layout.columns must be an integer from 1 to 12`);
|
|
127
|
+
}
|
|
128
|
+
if (layout.type !== "grid" && layout.columns !== undefined) {
|
|
129
|
+
errors.push(`${path}.layout.columns is valid only for grid layouts`);
|
|
130
|
+
}
|
|
131
|
+
if (layout.gap !== undefined && !["none", "xs", "sm", "md", "lg"].includes(layout.gap)) {
|
|
132
|
+
errors.push(`${path}.layout.gap must be none, xs, sm, md, or lg`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (!Array.isArray(surface.components) || surface.components.length === 0) {
|
|
136
|
+
errors.push(`${path}.components must contain at least one component`);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const ids = new Set();
|
|
140
|
+
for (let index = 0; index < surface.components.length; index++) {
|
|
141
|
+
const component = surface.components[index];
|
|
142
|
+
const componentPath = `${path}.components[${index}]`;
|
|
143
|
+
if (!component || typeof component !== "object") {
|
|
144
|
+
errors.push(`${componentPath} must be an object`);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
if (!validIdentifier(component.id)) {
|
|
148
|
+
errors.push(`${componentPath}.id is invalid`);
|
|
149
|
+
}
|
|
150
|
+
else if (ids.has(component.id)) {
|
|
151
|
+
errors.push(`${componentPath}.id duplicates ${JSON.stringify(component.id)}`);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
ids.add(component.id);
|
|
155
|
+
}
|
|
156
|
+
if (!validIdentifier(component.component)) {
|
|
157
|
+
errors.push(`${componentPath}.component is invalid`);
|
|
158
|
+
}
|
|
159
|
+
if (component.area !== undefined &&
|
|
160
|
+
(typeof component.area !== "string" || !/^[A-Za-z][A-Za-z0-9_-]*$/.test(component.area))) {
|
|
161
|
+
errors.push(`${componentPath}.area is invalid`);
|
|
162
|
+
}
|
|
163
|
+
if (component.props !== undefined && !isJsonValue(component.props)) {
|
|
164
|
+
errors.push(`${componentPath}.props must contain only JSON values`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function validIdentifier(value) {
|
|
169
|
+
return typeof value === "string" && /^[A-Za-z0-9][A-Za-z0-9._:/-]*$/.test(value);
|
|
170
|
+
}
|
|
171
|
+
function isJsonValue(value) {
|
|
172
|
+
if (value === null || typeof value === "string" || typeof value === "boolean" ||
|
|
173
|
+
(typeof value === "number" && Number.isFinite(value)))
|
|
174
|
+
return true;
|
|
175
|
+
if (Array.isArray(value))
|
|
176
|
+
return value.every(isJsonValue);
|
|
177
|
+
if (value && typeof value === "object")
|
|
178
|
+
return Object.values(value).every(isJsonValue);
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Parse a YAML string into a DashboardTemplate.
|
|
183
|
+
*
|
|
184
|
+
* @param yaml - Raw YAML string
|
|
185
|
+
* @param filePath - Optional file path for error messages
|
|
186
|
+
* @returns Parsed template
|
|
187
|
+
* @throws RuntimeError on invalid YAML or structure
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```typescript
|
|
191
|
+
* const template = parseTemplate(`
|
|
192
|
+
* name: My Dashboard
|
|
193
|
+
* sources:
|
|
194
|
+
* - manifest: postgres
|
|
195
|
+
* calls:
|
|
196
|
+
* - tool: query
|
|
197
|
+
* orchestration:
|
|
198
|
+
* layout: split
|
|
199
|
+
* `);
|
|
200
|
+
* ```
|
|
201
|
+
*/
|
|
202
|
+
function parseTemplate(yaml, filePath) {
|
|
203
|
+
let data;
|
|
204
|
+
try {
|
|
205
|
+
data = (0, mod_js_1.parse)(yaml);
|
|
206
|
+
}
|
|
207
|
+
catch (e) {
|
|
208
|
+
throw {
|
|
209
|
+
code: types_js_1.RuntimeErrorCode.TEMPLATE_PARSE_ERROR,
|
|
210
|
+
message: `Invalid YAML${filePath ? ` in ${filePath}` : ""}: ${e instanceof Error ? e.message : String(e)}`,
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
return templateObject(data, "YAML", filePath);
|
|
214
|
+
}
|
|
215
|
+
/** Parse the canonical agent-facing JSON dashboard manifest. */
|
|
216
|
+
function parseTemplateJson(json, filePath) {
|
|
217
|
+
let data;
|
|
218
|
+
try {
|
|
219
|
+
data = JSON.parse(json);
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
throw {
|
|
223
|
+
code: types_js_1.RuntimeErrorCode.TEMPLATE_PARSE_ERROR,
|
|
224
|
+
message: `Invalid JSON${filePath ? ` in ${filePath}` : ""}: ${error instanceof Error ? error.message : String(error)}`,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
return templateObject(data, "JSON", filePath);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Load a template from a file path.
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* const template = await loadTemplate("./dashboards/sales.yaml");
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
async function loadTemplate(path) {
|
|
238
|
+
const text = await Deno.readTextFile(path);
|
|
239
|
+
return path.toLowerCase().endsWith(".json")
|
|
240
|
+
? parseTemplateJson(text, path)
|
|
241
|
+
: parseTemplate(text, path);
|
|
242
|
+
}
|
|
243
|
+
function templateObject(data, format, filePath) {
|
|
244
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) {
|
|
245
|
+
throw {
|
|
246
|
+
code: types_js_1.RuntimeErrorCode.TEMPLATE_PARSE_ERROR,
|
|
247
|
+
message: `Template must be a ${format} object${filePath ? ` (${filePath})` : ""}`,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return data;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Inject runtime args into tool call arguments.
|
|
254
|
+
*
|
|
255
|
+
* Replaces `{{key}}` placeholders in string values with the corresponding
|
|
256
|
+
* runtime arg. If the entire value is a `{{key}}` placeholder, the replacement
|
|
257
|
+
* preserves the original type. Partial placeholders produce string concatenation.
|
|
258
|
+
*
|
|
259
|
+
* Does not mutate the input — returns new TemplateToolCall objects.
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* ```typescript
|
|
263
|
+
* const calls = [{ tool: "query", args: { id: "{{customer_id}}" } }];
|
|
264
|
+
* const result = injectArgs(calls, { customer_id: "C-123" });
|
|
265
|
+
* // result[0].args.id === "C-123"
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
function injectArgs(calls, args) {
|
|
269
|
+
return calls.map((call) => {
|
|
270
|
+
if (!call.args)
|
|
271
|
+
return call;
|
|
272
|
+
const injected = {};
|
|
273
|
+
for (const [key, value] of Object.entries(call.args)) {
|
|
274
|
+
injected[key] = injectValue(value, args);
|
|
275
|
+
}
|
|
276
|
+
return { ...call, args: injected };
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Inject args into a single value. Handles full and partial placeholders.
|
|
281
|
+
*/
|
|
282
|
+
function injectValue(value, args) {
|
|
283
|
+
if (typeof value !== "string")
|
|
284
|
+
return value;
|
|
285
|
+
// Full placeholder: "{{key}}" → preserve original type
|
|
286
|
+
const fullMatch = value.match(/^\{\{(\w+)\}\}$/);
|
|
287
|
+
if (fullMatch) {
|
|
288
|
+
const key = fullMatch[1];
|
|
289
|
+
return key in args ? args[key] : value;
|
|
290
|
+
}
|
|
291
|
+
// Partial placeholders: "prefix-{{key}}-suffix" → string interpolation
|
|
292
|
+
return value.replace(/\{\{(\w+)\}\}/g, (_match, key) => {
|
|
293
|
+
return key in args ? String(args[key]) : `{{${key}}}`;
|
|
294
|
+
});
|
|
295
|
+
}
|