@despia-native/kernel 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +1414 -0
- package/README.md +17 -2
- package/dist/.dsx-build-stamp.json +7 -0
- package/dist/api-cohort.d.ts +27 -0
- package/dist/api-cohort.d.ts.map +1 -0
- package/dist/api-cohort.js +94 -0
- package/dist/api-cohort.js.map +1 -0
- package/dist/api.d.ts +454 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +2442 -0
- package/dist/api.js.map +1 -0
- package/dist/app-consts.d.ts +10 -0
- package/dist/app-consts.d.ts.map +1 -0
- package/dist/app-consts.js +39 -0
- package/dist/app-consts.js.map +1 -0
- package/dist/app-update.d.ts +12 -0
- package/dist/app-update.d.ts.map +1 -0
- package/dist/app-update.js +32 -0
- package/dist/app-update.js.map +1 -0
- package/dist/aria.d.ts +152 -0
- package/dist/aria.d.ts.map +1 -0
- package/dist/aria.js +524 -0
- package/dist/aria.js.map +1 -0
- package/dist/audio-core.d.ts +260 -0
- package/dist/audio-core.d.ts.map +1 -0
- package/dist/audio-core.js +1440 -0
- package/dist/audio-core.js.map +1 -0
- package/dist/audio-edit.d.ts +100 -0
- package/dist/audio-edit.d.ts.map +1 -0
- package/dist/audio-edit.js +489 -0
- package/dist/audio-edit.js.map +1 -0
- package/dist/audio-mix.d.ts +84 -0
- package/dist/audio-mix.d.ts.map +1 -0
- package/dist/audio-mix.js +393 -0
- package/dist/audio-mix.js.map +1 -0
- package/dist/auth-proof.d.ts +145 -0
- package/dist/auth-proof.d.ts.map +1 -0
- package/dist/auth-proof.js +644 -0
- package/dist/auth-proof.js.map +1 -0
- package/dist/availability-explain.d.ts +3 -0
- package/dist/availability-explain.d.ts.map +1 -0
- package/dist/availability-explain.js +322 -0
- package/dist/availability-explain.js.map +1 -0
- package/dist/availability.d.ts +246 -0
- package/dist/availability.d.ts.map +1 -0
- package/dist/availability.js +615 -0
- package/dist/availability.js.map +1 -0
- package/dist/background.d.ts +116 -0
- package/dist/background.d.ts.map +1 -0
- package/dist/background.js +235 -0
- package/dist/background.js.map +1 -0
- package/dist/boot-tables-flag.d.ts +2 -0
- package/dist/boot-tables-flag.d.ts.map +1 -0
- package/dist/boot-tables-flag.js +16 -0
- package/dist/boot-tables-flag.js.map +1 -0
- package/dist/boot-tables.d.ts +40 -0
- package/dist/boot-tables.d.ts.map +1 -0
- package/dist/boot-tables.js +102 -0
- package/dist/boot-tables.js.map +1 -0
- package/dist/border-edges.d.ts +5 -0
- package/dist/border-edges.d.ts.map +1 -0
- package/dist/border-edges.js +47 -0
- package/dist/border-edges.js.map +1 -0
- package/dist/bus.d.ts +1203 -0
- package/dist/bus.d.ts.map +1 -0
- package/dist/bus.js +2647 -0
- package/dist/bus.js.map +1 -0
- package/dist/calendar-core.d.ts +143 -0
- package/dist/calendar-core.d.ts.map +1 -0
- package/dist/calendar-core.js +372 -0
- package/dist/calendar-core.js.map +1 -0
- package/dist/call-value.d.ts +16 -0
- package/dist/call-value.d.ts.map +1 -0
- package/dist/call-value.js +54 -0
- package/dist/call-value.js.map +1 -0
- package/dist/camera-core.d.ts +222 -0
- package/dist/camera-core.d.ts.map +1 -0
- package/dist/camera-core.js +980 -0
- package/dist/camera-core.js.map +1 -0
- package/dist/canvas-core.d.ts +404 -0
- package/dist/canvas-core.d.ts.map +1 -0
- package/dist/canvas-core.js +2186 -0
- package/dist/canvas-core.js.map +1 -0
- package/dist/capture-core.d.ts +74 -0
- package/dist/capture-core.d.ts.map +1 -0
- package/dist/capture-core.js +158 -0
- package/dist/capture-core.js.map +1 -0
- package/dist/compile/codegen.d.ts +146 -0
- package/dist/compile/codegen.d.ts.map +1 -0
- package/dist/compile/codegen.js +1949 -0
- package/dist/compile/codegen.js.map +1 -0
- package/dist/compile/jstier.d.ts +44 -0
- package/dist/compile/jstier.d.ts.map +1 -0
- package/dist/compile/jstier.js +181 -0
- package/dist/compile/jstier.js.map +1 -0
- package/dist/compile/tier-door.d.ts +41 -0
- package/dist/compile/tier-door.d.ts.map +1 -0
- package/dist/compile/tier-door.js +167 -0
- package/dist/compile/tier-door.js.map +1 -0
- package/dist/compile/tier-realm.d.ts +49 -0
- package/dist/compile/tier-realm.d.ts.map +1 -0
- package/dist/compile/tier-realm.js +368 -0
- package/dist/compile/tier-realm.js.map +1 -0
- package/dist/compile/tier.d.ts +23 -0
- package/dist/compile/tier.d.ts.map +1 -0
- package/dist/compile/tier.js +157 -0
- package/dist/compile/tier.js.map +1 -0
- package/dist/compose-core.d.ts +86 -0
- package/dist/compose-core.d.ts.map +1 -0
- package/dist/compose-core.js +112 -0
- package/dist/compose-core.js.map +1 -0
- package/dist/config-validate.d.ts +31 -0
- package/dist/config-validate.d.ts.map +1 -0
- package/dist/config-validate.js +147 -0
- package/dist/config-validate.js.map +1 -0
- package/dist/config-values.d.ts +106 -0
- package/dist/config-values.d.ts.map +1 -0
- package/dist/config-values.js +340 -0
- package/dist/config-values.js.map +1 -0
- package/dist/contacts-core.d.ts +127 -0
- package/dist/contacts-core.d.ts.map +1 -0
- package/dist/contacts-core.js +211 -0
- package/dist/contacts-core.js.map +1 -0
- package/dist/content-transition.d.ts +58 -0
- package/dist/content-transition.d.ts.map +1 -0
- package/dist/content-transition.js +94 -0
- package/dist/content-transition.js.map +1 -0
- package/dist/controls-core.d.ts +227 -0
- package/dist/controls-core.d.ts.map +1 -0
- package/dist/controls-core.js +652 -0
- package/dist/controls-core.js.map +1 -0
- package/dist/cookies.d.ts +78 -0
- package/dist/cookies.d.ts.map +1 -0
- package/dist/cookies.js +265 -0
- package/dist/cookies.js.map +1 -0
- package/dist/corner-shape-core.d.ts +69 -0
- package/dist/corner-shape-core.d.ts.map +1 -0
- package/dist/corner-shape-core.js +261 -0
- package/dist/corner-shape-core.js.map +1 -0
- package/dist/crypto-core.d.ts +57 -0
- package/dist/crypto-core.d.ts.map +1 -0
- package/dist/crypto-core.js +128 -0
- package/dist/crypto-core.js.map +1 -0
- package/dist/dataviz.d.ts +436 -0
- package/dist/dataviz.d.ts.map +1 -0
- package/dist/dataviz.js +956 -0
- package/dist/dataviz.js.map +1 -0
- package/dist/debug.d.ts +293 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +767 -0
- package/dist/debug.js.map +1 -0
- package/dist/device-ownership.d.ts +50 -0
- package/dist/device-ownership.d.ts.map +1 -0
- package/dist/device-ownership.js +105 -0
- package/dist/device-ownership.js.map +1 -0
- package/dist/effects.d.ts +86 -0
- package/dist/effects.d.ts.map +1 -0
- package/dist/effects.js +98 -0
- package/dist/effects.js.map +1 -0
- package/dist/element.d.ts +108 -0
- package/dist/element.d.ts.map +1 -0
- package/dist/element.js +63 -0
- package/dist/element.js.map +1 -0
- package/dist/file-watch.d.ts +16 -0
- package/dist/file-watch.d.ts.map +1 -0
- package/dist/file-watch.js +49 -0
- package/dist/file-watch.js.map +1 -0
- package/dist/filepaths.d.ts +72 -0
- package/dist/filepaths.d.ts.map +1 -0
- package/dist/filepaths.js +271 -0
- package/dist/filepaths.js.map +1 -0
- package/dist/film.d.ts +264 -0
- package/dist/film.d.ts.map +1 -0
- package/dist/film.js +313 -0
- package/dist/film.js.map +1 -0
- package/dist/fonts.d.ts +66 -0
- package/dist/fonts.d.ts.map +1 -0
- package/dist/fonts.js +135 -0
- package/dist/fonts.js.map +1 -0
- package/dist/forms.d.ts +191 -0
- package/dist/forms.d.ts.map +1 -0
- package/dist/forms.js +663 -0
- package/dist/forms.js.map +1 -0
- package/dist/geo.d.ts +289 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/geo.js +460 -0
- package/dist/geo.js.map +1 -0
- package/dist/handler-announce.d.ts +46 -0
- package/dist/handler-announce.d.ts.map +1 -0
- package/dist/handler-announce.js +96 -0
- package/dist/handler-announce.js.map +1 -0
- package/dist/handoff.d.ts +71 -0
- package/dist/handoff.d.ts.map +1 -0
- package/dist/handoff.js +250 -0
- package/dist/handoff.js.map +1 -0
- package/dist/identity-durability.d.ts +76 -0
- package/dist/identity-durability.d.ts.map +1 -0
- package/dist/identity-durability.js +150 -0
- package/dist/identity-durability.js.map +1 -0
- package/dist/image-core.d.ts +240 -0
- package/dist/image-core.d.ts.map +1 -0
- package/dist/image-core.js +618 -0
- package/dist/image-core.js.map +1 -0
- package/dist/image-schemes.d.ts +10 -0
- package/dist/image-schemes.d.ts.map +1 -0
- package/dist/image-schemes.js +28 -0
- package/dist/image-schemes.js.map +1 -0
- package/dist/index.d.ts +143 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +299 -0
- package/dist/index.js.map +1 -0
- package/dist/ink-core.d.ts +53 -0
- package/dist/ink-core.d.ts.map +1 -0
- package/dist/ink-core.js +119 -0
- package/dist/ink-core.js.map +1 -0
- package/dist/input.d.ts +148 -0
- package/dist/input.d.ts.map +1 -0
- package/dist/input.js +358 -0
- package/dist/input.js.map +1 -0
- package/dist/integrity.d.ts +63 -0
- package/dist/integrity.d.ts.map +1 -0
- package/dist/integrity.js +150 -0
- package/dist/integrity.js.map +1 -0
- package/dist/intents.d.ts +95 -0
- package/dist/intents.d.ts.map +1 -0
- package/dist/intents.js +282 -0
- package/dist/intents.js.map +1 -0
- package/dist/interpolate-core.d.ts +37 -0
- package/dist/interpolate-core.d.ts.map +1 -0
- package/dist/interpolate-core.js +443 -0
- package/dist/interpolate-core.js.map +1 -0
- package/dist/jse/color.d.ts +12 -0
- package/dist/jse/color.d.ts.map +1 -0
- package/dist/jse/color.js +196 -0
- package/dist/jse/color.js.map +1 -0
- package/dist/jse/core.d.ts +54 -0
- package/dist/jse/core.d.ts.map +1 -0
- package/dist/jse/core.js +1519 -0
- package/dist/jse/core.js.map +1 -0
- package/dist/jse/dispatch.d.ts +28 -0
- package/dist/jse/dispatch.d.ts.map +1 -0
- package/dist/jse/dispatch.js +116 -0
- package/dist/jse/dispatch.js.map +1 -0
- package/dist/jse/highlight-grammar.d.ts +15 -0
- package/dist/jse/highlight-grammar.d.ts.map +1 -0
- package/dist/jse/highlight-grammar.js +161 -0
- package/dist/jse/highlight-grammar.js.map +1 -0
- package/dist/jse/highlight-grammars.generated.d.ts +2 -0
- package/dist/jse/highlight-grammars.generated.d.ts.map +1 -0
- package/dist/jse/highlight-grammars.generated.js +4 -0
- package/dist/jse/highlight-grammars.generated.js.map +1 -0
- package/dist/jse/highlight.d.ts +37 -0
- package/dist/jse/highlight.d.ts.map +1 -0
- package/dist/jse/highlight.js +323 -0
- package/dist/jse/highlight.js.map +1 -0
- package/dist/jse/jse.d.ts +674 -0
- package/dist/jse/jse.d.ts.map +1 -0
- package/dist/jse/jse.js +5841 -0
- package/dist/jse/jse.js.map +1 -0
- package/dist/jse/pathmatch.d.ts +10 -0
- package/dist/jse/pathmatch.d.ts.map +1 -0
- package/dist/jse/pathmatch.js +73 -0
- package/dist/jse/pathmatch.js.map +1 -0
- package/dist/jse/regex.d.ts +33 -0
- package/dist/jse/regex.d.ts.map +1 -0
- package/dist/jse/regex.js +375 -0
- package/dist/jse/regex.js.map +1 -0
- package/dist/jse/stdlib.d.ts +8 -0
- package/dist/jse/stdlib.d.ts.map +1 -0
- package/dist/jse/stdlib.js +765 -0
- package/dist/jse/stdlib.js.map +1 -0
- package/dist/jse/tokens.d.ts +102 -0
- package/dist/jse/tokens.d.ts.map +1 -0
- package/dist/jse/tokens.js +982 -0
- package/dist/jse/tokens.js.map +1 -0
- package/dist/jse/values.d.ts +206 -0
- package/dist/jse/values.d.ts.map +1 -0
- package/dist/jse/values.js +846 -0
- package/dist/jse/values.js.map +1 -0
- package/dist/keyboard.d.ts +196 -0
- package/dist/keyboard.d.ts.map +1 -0
- package/dist/keyboard.js +186 -0
- package/dist/keyboard.js.map +1 -0
- package/dist/label-choices.d.ts +3 -0
- package/dist/label-choices.d.ts.map +1 -0
- package/dist/label-choices.js +168 -0
- package/dist/label-choices.js.map +1 -0
- package/dist/language.d.ts +33 -0
- package/dist/language.d.ts.map +1 -0
- package/dist/language.js +50 -0
- package/dist/language.js.map +1 -0
- package/dist/length-units.d.ts +30 -0
- package/dist/length-units.d.ts.map +1 -0
- package/dist/length-units.js +83 -0
- package/dist/length-units.js.map +1 -0
- package/dist/lightsensor.d.ts +48 -0
- package/dist/lightsensor.d.ts.map +1 -0
- package/dist/lightsensor.js +97 -0
- package/dist/lightsensor.js.map +1 -0
- package/dist/link-refresh.d.ts +27 -0
- package/dist/link-refresh.d.ts.map +1 -0
- package/dist/link-refresh.js +166 -0
- package/dist/link-refresh.js.map +1 -0
- package/dist/link.d.ts +57 -0
- package/dist/link.d.ts.map +1 -0
- package/dist/link.js +333 -0
- package/dist/link.js.map +1 -0
- package/dist/linkpreview.d.ts +114 -0
- package/dist/linkpreview.d.ts.map +1 -0
- package/dist/linkpreview.js +439 -0
- package/dist/linkpreview.js.map +1 -0
- package/dist/list-presence.d.ts +32 -0
- package/dist/list-presence.d.ts.map +1 -0
- package/dist/list-presence.js +48 -0
- package/dist/list-presence.js.map +1 -0
- package/dist/live-stream.d.ts +27 -0
- package/dist/live-stream.d.ts.map +1 -0
- package/dist/live-stream.js +274 -0
- package/dist/live-stream.js.map +1 -0
- package/dist/livelogs.d.ts +134 -0
- package/dist/livelogs.d.ts.map +1 -0
- package/dist/livelogs.js +409 -0
- package/dist/livelogs.js.map +1 -0
- package/dist/logs.d.ts +80 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +206 -0
- package/dist/logs.js.map +1 -0
- package/dist/mcp/apps.d.ts +82 -0
- package/dist/mcp/apps.d.ts.map +1 -0
- package/dist/mcp/apps.js +219 -0
- package/dist/mcp/apps.js.map +1 -0
- package/dist/mcp/entities.d.ts +25 -0
- package/dist/mcp/entities.d.ts.map +1 -0
- package/dist/mcp/entities.js +71 -0
- package/dist/mcp/entities.js.map +1 -0
- package/dist/mcp/result.d.ts +73 -0
- package/dist/mcp/result.d.ts.map +1 -0
- package/dist/mcp/result.js +119 -0
- package/dist/mcp/result.js.map +1 -0
- package/dist/mcp/webmcp.d.ts +162 -0
- package/dist/mcp/webmcp.d.ts.map +1 -0
- package/dist/mcp/webmcp.js +214 -0
- package/dist/mcp/webmcp.js.map +1 -0
- package/dist/mcp.d.ts +5 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +14 -0
- package/dist/mcp.js.map +1 -0
- package/dist/media-core.d.ts +191 -0
- package/dist/media-core.d.ts.map +1 -0
- package/dist/media-core.js +446 -0
- package/dist/media-core.js.map +1 -0
- package/dist/media-timeline-core.d.ts +94 -0
- package/dist/media-timeline-core.d.ts.map +1 -0
- package/dist/media-timeline-core.js +620 -0
- package/dist/media-timeline-core.js.map +1 -0
- package/dist/message.d.ts +42 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/message.js +582 -0
- package/dist/message.js.map +1 -0
- package/dist/missing-element.d.ts +29 -0
- package/dist/missing-element.d.ts.map +1 -0
- package/dist/missing-element.js +76 -0
- package/dist/missing-element.js.map +1 -0
- package/dist/motion-core.d.ts +160 -0
- package/dist/motion-core.d.ts.map +1 -0
- package/dist/motion-core.js +752 -0
- package/dist/motion-core.js.map +1 -0
- package/dist/motion-pose.d.ts +65 -0
- package/dist/motion-pose.d.ts.map +1 -0
- package/dist/motion-pose.js +143 -0
- package/dist/motion-pose.js.map +1 -0
- package/dist/motion.d.ts +132 -0
- package/dist/motion.d.ts.map +1 -0
- package/dist/motion.js +260 -0
- package/dist/motion.js.map +1 -0
- package/dist/mount-core.d.ts +203 -0
- package/dist/mount-core.d.ts.map +1 -0
- package/dist/mount-core.js +437 -0
- package/dist/mount-core.js.map +1 -0
- package/dist/net-core.d.ts +110 -0
- package/dist/net-core.d.ts.map +1 -0
- package/dist/net-core.js +225 -0
- package/dist/net-core.js.map +1 -0
- package/dist/notify.d.ts +399 -0
- package/dist/notify.d.ts.map +1 -0
- package/dist/notify.js +964 -0
- package/dist/notify.js.map +1 -0
- package/dist/orientation-binding.d.ts +39 -0
- package/dist/orientation-binding.d.ts.map +1 -0
- package/dist/orientation-binding.js +64 -0
- package/dist/orientation-binding.js.map +1 -0
- package/dist/orientation.d.ts +55 -0
- package/dist/orientation.d.ts.map +1 -0
- package/dist/orientation.js +89 -0
- package/dist/orientation.js.map +1 -0
- package/dist/ota.d.ts +52 -0
- package/dist/ota.d.ts.map +1 -0
- package/dist/ota.js +122 -0
- package/dist/ota.js.map +1 -0
- package/dist/passkeys.d.ts +91 -0
- package/dist/passkeys.d.ts.map +1 -0
- package/dist/passkeys.js +307 -0
- package/dist/passkeys.js.map +1 -0
- package/dist/payment.d.ts +85 -0
- package/dist/payment.d.ts.map +1 -0
- package/dist/payment.js +270 -0
- package/dist/payment.js.map +1 -0
- package/dist/pending-presenter.d.ts +31 -0
- package/dist/pending-presenter.d.ts.map +1 -0
- package/dist/pending-presenter.js +119 -0
- package/dist/pending-presenter.js.map +1 -0
- package/dist/permission-core.d.ts +59 -0
- package/dist/permission-core.d.ts.map +1 -0
- package/dist/permission-core.js +102 -0
- package/dist/permission-core.js.map +1 -0
- package/dist/persist.d.ts +169 -0
- package/dist/persist.d.ts.map +1 -0
- package/dist/persist.js +361 -0
- package/dist/persist.js.map +1 -0
- package/dist/phase-plan.d.ts +114 -0
- package/dist/phase-plan.d.ts.map +1 -0
- package/dist/phase-plan.js +837 -0
- package/dist/phase-plan.js.map +1 -0
- package/dist/playback-core.d.ts +64 -0
- package/dist/playback-core.d.ts.map +1 -0
- package/dist/playback-core.js +176 -0
- package/dist/playback-core.js.map +1 -0
- package/dist/player-sources.d.ts +12 -0
- package/dist/player-sources.d.ts.map +1 -0
- package/dist/player-sources.js +44 -0
- package/dist/player-sources.js.map +1 -0
- package/dist/proxy-denylist.d.ts +11 -0
- package/dist/proxy-denylist.d.ts.map +1 -0
- package/dist/proxy-denylist.js +44 -0
- package/dist/proxy-denylist.js.map +1 -0
- package/dist/public-config.d.ts +20 -0
- package/dist/public-config.d.ts.map +1 -0
- package/dist/public-config.js +109 -0
- package/dist/public-config.js.map +1 -0
- package/dist/qoe-core.d.ts +72 -0
- package/dist/qoe-core.d.ts.map +1 -0
- package/dist/qoe-core.js +113 -0
- package/dist/qoe-core.js.map +1 -0
- package/dist/reactive-request.d.ts +80 -0
- package/dist/reactive-request.d.ts.map +1 -0
- package/dist/reactive-request.js +192 -0
- package/dist/reactive-request.js.map +1 -0
- package/dist/read-cache.d.ts +129 -0
- package/dist/read-cache.d.ts.map +1 -0
- package/dist/read-cache.js +566 -0
- package/dist/read-cache.js.map +1 -0
- package/dist/recorder-core.d.ts +57 -0
- package/dist/recorder-core.d.ts.map +1 -0
- package/dist/recorder-core.js +136 -0
- package/dist/recorder-core.js.map +1 -0
- package/dist/ref.d.ts +41 -0
- package/dist/ref.d.ts.map +1 -0
- package/dist/ref.js +98 -0
- package/dist/ref.js.map +1 -0
- package/dist/refusal.d.ts +82 -0
- package/dist/refusal.d.ts.map +1 -0
- package/dist/refusal.js +218 -0
- package/dist/refusal.js.map +1 -0
- package/dist/region-insets.d.ts +61 -0
- package/dist/region-insets.d.ts.map +1 -0
- package/dist/region-insets.js +67 -0
- package/dist/region-insets.js.map +1 -0
- package/dist/rive-core.d.ts +323 -0
- package/dist/rive-core.d.ts.map +1 -0
- package/dist/rive-core.js +677 -0
- package/dist/rive-core.js.map +1 -0
- package/dist/runner.d.ts +595 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +4094 -0
- package/dist/runner.js.map +1 -0
- package/dist/scene/a11y.d.ts +11 -0
- package/dist/scene/a11y.d.ts.map +1 -0
- package/dist/scene/a11y.js +67 -0
- package/dist/scene/a11y.js.map +1 -0
- package/dist/scene/anim.d.ts +149 -0
- package/dist/scene/anim.d.ts.map +1 -0
- package/dist/scene/anim.js +396 -0
- package/dist/scene/anim.js.map +1 -0
- package/dist/scene/bind.d.ts +33 -0
- package/dist/scene/bind.d.ts.map +1 -0
- package/dist/scene/bind.js +66 -0
- package/dist/scene/bind.js.map +1 -0
- package/dist/scene/collide.d.ts +56 -0
- package/dist/scene/collide.d.ts.map +1 -0
- package/dist/scene/collide.js +146 -0
- package/dist/scene/collide.js.map +1 -0
- package/dist/scene/frame.d.ts +22 -0
- package/dist/scene/frame.d.ts.map +1 -0
- package/dist/scene/frame.js +57 -0
- package/dist/scene/frame.js.map +1 -0
- package/dist/scene/gltf.d.ts +79 -0
- package/dist/scene/gltf.d.ts.map +1 -0
- package/dist/scene/gltf.js +409 -0
- package/dist/scene/gltf.js.map +1 -0
- package/dist/scene/ir.d.ts +293 -0
- package/dist/scene/ir.d.ts.map +1 -0
- package/dist/scene/ir.js +692 -0
- package/dist/scene/ir.js.map +1 -0
- package/dist/scene/math.d.ts +50 -0
- package/dist/scene/math.d.ts.map +1 -0
- package/dist/scene/math.js +180 -0
- package/dist/scene/math.js.map +1 -0
- package/dist/scene/orbit.d.ts +19 -0
- package/dist/scene/orbit.d.ts.map +1 -0
- package/dist/scene/orbit.js +60 -0
- package/dist/scene/orbit.js.map +1 -0
- package/dist/scene/physics.d.ts +228 -0
- package/dist/scene/physics.d.ts.map +1 -0
- package/dist/scene/physics.js +1500 -0
- package/dist/scene/physics.js.map +1 -0
- package/dist/scene/registry.d.ts +85 -0
- package/dist/scene/registry.d.ts.map +1 -0
- package/dist/scene/registry.js +75 -0
- package/dist/scene/registry.js.map +1 -0
- package/dist/scene/skin.d.ts +82 -0
- package/dist/scene/skin.d.ts.map +1 -0
- package/dist/scene/skin.js +351 -0
- package/dist/scene/skin.js.map +1 -0
- package/dist/scene/sprite.d.ts +36 -0
- package/dist/scene/sprite.d.ts.map +1 -0
- package/dist/scene/sprite.js +107 -0
- package/dist/scene/sprite.js.map +1 -0
- package/dist/scene/viewer.d.ts +96 -0
- package/dist/scene/viewer.d.ts.map +1 -0
- package/dist/scene/viewer.js +235 -0
- package/dist/scene/viewer.js.map +1 -0
- package/dist/scoped-slots.d.ts +9 -0
- package/dist/scoped-slots.d.ts.map +1 -0
- package/dist/scoped-slots.js +42 -0
- package/dist/scoped-slots.js.map +1 -0
- package/dist/screen.d.ts +109 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +309 -0
- package/dist/screen.js.map +1 -0
- package/dist/scroll.d.ts +525 -0
- package/dist/scroll.d.ts.map +1 -0
- package/dist/scroll.js +1226 -0
- package/dist/scroll.js.map +1 -0
- package/dist/settings-plane.d.ts +58 -0
- package/dist/settings-plane.d.ts.map +1 -0
- package/dist/settings-plane.js +86 -0
- package/dist/settings-plane.js.map +1 -0
- package/dist/share-inbox.d.ts +56 -0
- package/dist/share-inbox.d.ts.map +1 -0
- package/dist/share-inbox.js +114 -0
- package/dist/share-inbox.js.map +1 -0
- package/dist/shared-transition.d.ts +152 -0
- package/dist/shared-transition.d.ts.map +1 -0
- package/dist/shared-transition.js +257 -0
- package/dist/shared-transition.js.map +1 -0
- package/dist/sheet-content-padding.d.ts +24 -0
- package/dist/sheet-content-padding.d.ts.map +1 -0
- package/dist/sheet-content-padding.js +32 -0
- package/dist/sheet-content-padding.js.map +1 -0
- package/dist/shot-devices.d.ts +36 -0
- package/dist/shot-devices.d.ts.map +1 -0
- package/dist/shot-devices.js +90 -0
- package/dist/shot-devices.js.map +1 -0
- package/dist/shot-guards.d.ts +100 -0
- package/dist/shot-guards.d.ts.map +1 -0
- package/dist/shot-guards.js +260 -0
- package/dist/shot-guards.js.map +1 -0
- package/dist/shot-scope.d.ts +140 -0
- package/dist/shot-scope.d.ts.map +1 -0
- package/dist/shot-scope.js +302 -0
- package/dist/shot-scope.js.map +1 -0
- package/dist/slot-partition.d.ts +9 -0
- package/dist/slot-partition.d.ts.map +1 -0
- package/dist/slot-partition.js +38 -0
- package/dist/slot-partition.js.map +1 -0
- package/dist/snackbar.d.ts +165 -0
- package/dist/snackbar.d.ts.map +1 -0
- package/dist/snackbar.js +220 -0
- package/dist/snackbar.js.map +1 -0
- package/dist/socket.d.ts +96 -0
- package/dist/socket.d.ts.map +1 -0
- package/dist/socket.js +370 -0
- package/dist/socket.js.map +1 -0
- package/dist/spotlight.d.ts +77 -0
- package/dist/spotlight.d.ts.map +1 -0
- package/dist/spotlight.js +174 -0
- package/dist/spotlight.js.map +1 -0
- package/dist/state-primitive.d.ts +37 -0
- package/dist/state-primitive.d.ts.map +1 -0
- package/dist/state-primitive.js +91 -0
- package/dist/state-primitive.js.map +1 -0
- package/dist/store-query.d.ts +25 -0
- package/dist/store-query.d.ts.map +1 -0
- package/dist/store-query.js +88 -0
- package/dist/store-query.js.map +1 -0
- package/dist/store-value.d.ts +48 -0
- package/dist/store-value.d.ts.map +1 -0
- package/dist/store-value.js +264 -0
- package/dist/store-value.js.map +1 -0
- package/dist/store-versioning.d.ts +70 -0
- package/dist/store-versioning.d.ts.map +1 -0
- package/dist/store-versioning.js +188 -0
- package/dist/store-versioning.js.map +1 -0
- package/dist/store.d.ts +282 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/store.js +1144 -0
- package/dist/store.js.map +1 -0
- package/dist/strings.d.ts +141 -0
- package/dist/strings.d.ts.map +1 -0
- package/dist/strings.js +581 -0
- package/dist/strings.js.map +1 -0
- package/dist/telemetry.d.ts +95 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +255 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/transform-core.d.ts +228 -0
- package/dist/transform-core.d.ts.map +1 -0
- package/dist/transform-core.js +921 -0
- package/dist/transform-core.js.map +1 -0
- package/dist/transition-core.d.ts +58 -0
- package/dist/transition-core.d.ts.map +1 -0
- package/dist/transition-core.js +352 -0
- package/dist/transition-core.js.map +1 -0
- package/dist/trim-trailing.d.ts +3 -0
- package/dist/trim-trailing.d.ts.map +1 -0
- package/dist/trim-trailing.js +14 -0
- package/dist/trim-trailing.js.map +1 -0
- package/dist/upload.d.ts +51 -0
- package/dist/upload.d.ts.map +1 -0
- package/dist/upload.js +68 -0
- package/dist/upload.js.map +1 -0
- package/dist/vendor-face.d.ts +44 -0
- package/dist/vendor-face.d.ts.map +1 -0
- package/dist/vendor-face.js +80 -0
- package/dist/vendor-face.js.map +1 -0
- package/dist/vendor-session.d.ts +166 -0
- package/dist/vendor-session.d.ts.map +1 -0
- package/dist/vendor-session.js +423 -0
- package/dist/vendor-session.js.map +1 -0
- package/dist/vendor-surface.d.ts +290 -0
- package/dist/vendor-surface.d.ts.map +1 -0
- package/dist/vendor-surface.js +439 -0
- package/dist/vendor-surface.js.map +1 -0
- package/dist/version-rules.generated.d.ts +17 -0
- package/dist/version-rules.generated.d.ts.map +1 -0
- package/dist/version-rules.generated.js +99 -0
- package/dist/version-rules.generated.js.map +1 -0
- package/dist/view-transition-core.d.ts +99 -0
- package/dist/view-transition-core.d.ts.map +1 -0
- package/dist/view-transition-core.js +127 -0
- package/dist/view-transition-core.js.map +1 -0
- package/dist/view-transition-door.d.ts +26 -0
- package/dist/view-transition-door.d.ts.map +1 -0
- package/dist/view-transition-door.js +88 -0
- package/dist/view-transition-door.js.map +1 -0
- package/dist/window-identity.d.ts +3 -0
- package/dist/window-identity.d.ts.map +1 -0
- package/dist/window-identity.js +27 -0
- package/dist/window-identity.js.map +1 -0
- package/package.json +139 -4
package/dist/logs.js
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
//
|
|
2
|
+
// logs.ts - the DSX log system's kernel core: the structured LOG RING behind `dsx.log`
|
|
3
|
+
// (OpenSource/Conformance/logs/logs.json — the unified console primitive), plus the
|
|
4
|
+
// JSERedact twin (the credential-masking contract shared with Stack.swift / Globals.kt).
|
|
5
|
+
// TS twin of Engine/Swift/Logs.swift and Engine/Kotlin core Logs.kt.
|
|
6
|
+
//
|
|
7
|
+
// `dsx.log` is `console.log` with a home: one formatted line per call, attributed to its
|
|
8
|
+
// source scheme, recorded here (ring, cap 500, always on — appending is nanoseconds and
|
|
9
|
+
// programs, not just testers, read it via `dsx.logs`), and mirrored to the platform
|
|
10
|
+
// console. Logs are NOT errors: nothing here touches the error ledger, the hooks, or the
|
|
11
|
+
// reactive `global.dsx.*` keys. Near-leaf module by design — imports only jse/values.ts,
|
|
12
|
+
// so the console builtin (jse/core.ts), the runner, and the bus can all feed it without
|
|
13
|
+
// cycles.
|
|
14
|
+
//
|
|
15
|
+
import { isDict } from "./jse/values.js";
|
|
16
|
+
class DSXLogBufferImpl {
|
|
17
|
+
static cap = 500;
|
|
18
|
+
entries = [];
|
|
19
|
+
total = 0;
|
|
20
|
+
append(e) {
|
|
21
|
+
this.entries.push(e);
|
|
22
|
+
this.total += 1;
|
|
23
|
+
if (this.entries.length > DSXLogBufferImpl.cap) {
|
|
24
|
+
this.entries.splice(0, this.entries.length - DSXLogBufferImpl.cap);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/** the retained tail, oldest → newest (snapshot) */
|
|
28
|
+
recent() { return [...this.entries]; }
|
|
29
|
+
/** monotonic count of every line ever recorded (survives ring eviction) */
|
|
30
|
+
count() { return this.total; }
|
|
31
|
+
/** dev tooling only — drops the retained tail (the monotonic count stays) */
|
|
32
|
+
clear() { this.entries = []; }
|
|
33
|
+
}
|
|
34
|
+
export const DSXLogs = new DSXLogBufferImpl();
|
|
35
|
+
let logSink = null;
|
|
36
|
+
/** THE DIAGNOSTIC CHANNEL'S SINK (Q7, and LOG-BEACON: a door, never a default). Bound once,
|
|
37
|
+
* at boot, by the platform layer that read the app's declared sink, and ONLY when the author
|
|
38
|
+
* wrote `"sink": "beacon"` or `"endpoint"` on purpose (web: the beacon sink over the S16 signed shape, or the app's own backend; the
|
|
39
|
+
* two native engines have no sink at all and their ring is the whole story). Only ERROR-level
|
|
40
|
+
* entries reach the sink, the ring keeps everything, the sink is for the lines that would
|
|
41
|
+
* otherwise leave nothing when the process dies. Passing null uninstalls it (tests, and the
|
|
42
|
+
* default, which is no sink). */
|
|
43
|
+
export function configureLogSink(next) {
|
|
44
|
+
logSink = next;
|
|
45
|
+
}
|
|
46
|
+
// ── the observability door (LOG-BEACON) ────────────────────────────────────────────────────
|
|
47
|
+
//
|
|
48
|
+
// A built app transmits nothing its author did not choose, so the ONE transmission this
|
|
49
|
+
// framework installs itself, the web log beacon, is opted into rather than opted out of. The
|
|
50
|
+
// law lives here, in the kernel, beside `configureLogSink`, because two lanes read a declared
|
|
51
|
+
// sink value and a second copy of the law would drift from the first: `loadConfig` in the CLI
|
|
52
|
+
// decides what a `despia build` compiles into the bootloader, and `installObservability` in
|
|
53
|
+
// the DOM package decides what the browser does with it. Both call the function below and
|
|
54
|
+
// raise the refusal in their own vocabulary, which is the house shape for a typed error.
|
|
55
|
+
//
|
|
56
|
+
// THE TWO PROPERTIES, and the corpus that pins them is OpenSource/Conformance/logs/logs.json's
|
|
57
|
+
// `sink` section:
|
|
58
|
+
//
|
|
59
|
+
// 1. UNDECLARED IS OFF. No `observability` block, an empty one, or `"sink": "none"` all
|
|
60
|
+
// resolve to `none`, and `none` puts nothing on any wire.
|
|
61
|
+
// 2. UNRECOGNISED REFUSES, AND NEVER FALLS BACK TO SENDING. This resolution used to answer
|
|
62
|
+
// `beacon` for any value it did not recognise, on the theory that a typo must not
|
|
63
|
+
// silently disable observability. That reasoning has the failure backwards: the author
|
|
64
|
+
// who mistypes is the author trying to turn the transmission OFF, and handing them the
|
|
65
|
+
// transmission is the opposite of what they asked for. A configuration value nobody
|
|
66
|
+
// recognises resolves to no behaviour at all: it refuses, loudly, at the earliest of the
|
|
67
|
+
// two lanes that sees it.
|
|
68
|
+
/** Every value `observability.sink` may hold. `beacon` and `endpoint` transmit; `none` does not. */
|
|
69
|
+
export const OBSERVABILITY_SINKS = ["none", "beacon", "endpoint"];
|
|
70
|
+
/** What an app that declared nothing gets: no sink, no transmission. */
|
|
71
|
+
export const DEFAULT_OBSERVABILITY_SINK = "none";
|
|
72
|
+
/** `endpoint`'s `url`: the app's own backend, https, or a path on the app's own origin. Never plain http, never a credential in
|
|
73
|
+
* the URL. The sink sends no cookies (credentials: "omit"); what authenticates the request is the headers the author declares. */
|
|
74
|
+
const ENDPOINT_URL = /^(\/(?!\/)[^\s]*|https:\/\/[^\s/@]+(\/[^\s]*)?)$/;
|
|
75
|
+
/** Resolve a project's declared `observability` block into the sink a build or a boot may
|
|
76
|
+
* install. `undefined` and `null` are "the author declared nothing", which is `none`;
|
|
77
|
+
* anything present and unrecognised is a refusal carrying the sentence both lanes print.
|
|
78
|
+
*
|
|
79
|
+
* `endpoint` is the app's OWN backend receiving its error lines with the headers the author
|
|
80
|
+
* declares and no cookies, the way Article 21.5 states an explicit transport: `{ "sink": "endpoint", "url": "https://api.example.com/v1/errors",
|
|
81
|
+
* "sample": 0.25 }`. `url` is required and is https or a same-origin path; `sample` (the share of error lines sent, 0 < sample
|
|
82
|
+
* <= 1, default 1) bounds the volume. `headers` (optional) is a plain object whose keys and values are all strings, validated for shape
|
|
83
|
+
* only: any key is allowed, no value is inspected, and a front-end value is not a server secret.
|
|
84
|
+
* `url`, `sample` or `headers` on any other sink refuses: a key that would be silently ignored is a
|
|
85
|
+
* setting the author believes is on. */
|
|
86
|
+
export function resolveObservabilitySink(block) {
|
|
87
|
+
if (block === undefined || block === null)
|
|
88
|
+
return { ok: true, sink: DEFAULT_OBSERVABILITY_SINK };
|
|
89
|
+
if (typeof block !== "object" || Array.isArray(block)) {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
refusal: "malformed_block",
|
|
93
|
+
message: `"observability" must be an object like { "sink": "none" }, not ${describe(block)}. ${SINK_VALUES}`,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const b = block;
|
|
97
|
+
const sink = b.sink === undefined ? DEFAULT_OBSERVABILITY_SINK : b.sink;
|
|
98
|
+
if (typeof sink !== "string" || !OBSERVABILITY_SINKS.includes(sink)) {
|
|
99
|
+
return {
|
|
100
|
+
ok: false,
|
|
101
|
+
refusal: "unrecognised_sink",
|
|
102
|
+
message: `"observability": { "sink": ${describe(b.sink)} } names no sink this framework has. ${SINK_VALUES} An unrecognised value refuses here rather than resolving to the one that transmits, because the author most likely to mistype the setting is the author trying to switch the transmission off.`,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (sink !== "endpoint") {
|
|
106
|
+
if (b.url !== undefined || b.sample !== undefined) {
|
|
107
|
+
return { ok: false, refusal: "endpoint_url", message: `"observability": "url" and "sample" belong to { "sink": "endpoint" }, and this block's sink is ${describe(sink)}. ${SINK_VALUES}` };
|
|
108
|
+
}
|
|
109
|
+
if (b.headers !== undefined) {
|
|
110
|
+
return { ok: false, refusal: "endpoint_headers", message: `"observability": "headers" belongs to { "sink": "endpoint" }, and this block's sink is ${describe(sink)}. ${SINK_VALUES}` };
|
|
111
|
+
}
|
|
112
|
+
return { ok: true, sink };
|
|
113
|
+
}
|
|
114
|
+
if (typeof b.url !== "string" || !ENDPOINT_URL.test(b.url)) {
|
|
115
|
+
return { ok: false, refusal: "endpoint_url", message: `"observability": { "sink": "endpoint" } needs "url": an https URL or a path on the app's own origin, not ${describe(b.url)}. ${SINK_VALUES}` };
|
|
116
|
+
}
|
|
117
|
+
if (b.sample !== undefined && (typeof b.sample !== "number" || !Number.isFinite(b.sample) || b.sample <= 0 || b.sample > 1)) {
|
|
118
|
+
return { ok: false, refusal: "sample_range", message: `"observability": "sample" is the share of error lines sent, above 0 and at most 1, not ${describe(b.sample)}.` };
|
|
119
|
+
}
|
|
120
|
+
let headers;
|
|
121
|
+
if (b.headers !== undefined) {
|
|
122
|
+
const h = b.headers;
|
|
123
|
+
const plain = typeof h === "object" && h !== null && !Array.isArray(h)
|
|
124
|
+
&& (Object.getPrototypeOf(h) === Object.prototype || Object.getPrototypeOf(h) === null);
|
|
125
|
+
// Shape only (any name that is a valid HTTP token, any string value without a line break), and the message never repeats
|
|
126
|
+
// what the author wrote: a header value may be a bearer token, and a refusal is printed to build logs.
|
|
127
|
+
const ok = plain && Object.entries(h).every(([name, value]) => HEADER_NAME.test(name) && typeof value === "string" && !/[\r\n]/.test(value));
|
|
128
|
+
if (!ok) {
|
|
129
|
+
return { ok: false, refusal: "endpoint_headers", message: `"observability": "headers" must be a plain object whose names are valid HTTP header names and whose values are strings without a line break, like { "x-api-key": "..." }.` };
|
|
130
|
+
}
|
|
131
|
+
headers = { ...h };
|
|
132
|
+
}
|
|
133
|
+
return headers === undefined
|
|
134
|
+
? { ok: true, sink, url: b.url, sample: typeof b.sample === "number" ? b.sample : 1 }
|
|
135
|
+
: { ok: true, sink, url: b.url, sample: typeof b.sample === "number" ? b.sample : 1, headers };
|
|
136
|
+
}
|
|
137
|
+
/** An HTTP header name is a token (RFC 9110 5.6.2): a name outside it, or a value with CR or LF, is a malformed request. */
|
|
138
|
+
const HEADER_NAME = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
139
|
+
const SINK_VALUES = 'Write "none" (the default: the crash handlers still fill the in-memory ring `dsx.logs` reads, and nothing leaves the device), "beacon" (every error level log line, its message text included, is signed and POSTed to /dsx-internal/logs on this app\'s own origin) or "endpoint" with a "url" (every error level line, or the "sample" share of them, is POSTed to the app\'s own backend with the "headers" the author declares and no cookies).';
|
|
140
|
+
function describe(value) {
|
|
141
|
+
if (typeof value === "string")
|
|
142
|
+
return JSON.stringify(value);
|
|
143
|
+
if (value === null)
|
|
144
|
+
return "null";
|
|
145
|
+
if (Array.isArray(value))
|
|
146
|
+
return "an array";
|
|
147
|
+
return `${typeof value} ${String(value)}`;
|
|
148
|
+
}
|
|
149
|
+
/** Record one log line: the ring + one browser-console mirror line (the web's
|
|
150
|
+
* Xcode/logcat analogue) + the configured sink for an error line. Never throws; message
|
|
151
|
+
* arrives pre-formatted (the house coercions, see formatLogArgs in jse/core.ts). */
|
|
152
|
+
export function reportLog(scheme, level, message) {
|
|
153
|
+
const entry = { scheme, level, message, at: Date.now() };
|
|
154
|
+
DSXLogs.append(entry);
|
|
155
|
+
const line = `[dsx.log] ${scheme}: ${message}`;
|
|
156
|
+
if (level === "error")
|
|
157
|
+
platformConsole?.error?.(line);
|
|
158
|
+
else if (level === "warn")
|
|
159
|
+
platformConsole?.warn?.(line);
|
|
160
|
+
else
|
|
161
|
+
platformConsole?.log?.(line);
|
|
162
|
+
if (level === "error" && logSink) {
|
|
163
|
+
try {
|
|
164
|
+
logSink(entry);
|
|
165
|
+
}
|
|
166
|
+
catch { /* the sink is not allowed to be a second failure */ }
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/** The platform console, taken ONCE through globalThis rather than called by name.
|
|
170
|
+
*
|
|
171
|
+
* This is the DIAGNOSTIC CHANNEL, and it is the one mirror a shipped app has: `dsx.log`
|
|
172
|
+
* writes here, the Studio and `dsx.logs` read the ring back. A production build strips
|
|
173
|
+
* console.* out of the whole runtime (cli build.ts vendors it with esbuild's `drop`), which
|
|
174
|
+
* is right for the hundreds of ad hoc warnings scattered through the renderer and wrong for
|
|
175
|
+
* this one function, so this one function does not spell them: a `drop` rewrites calls on
|
|
176
|
+
* the bare `console` identifier and leaves a call through a binding alone. Optional
|
|
177
|
+
* everywhere because a host runtime is allowed to have no console at all. */
|
|
178
|
+
const platformConsole = typeof globalThis === "object" && typeof globalThis.console === "object" && globalThis.console !== null
|
|
179
|
+
? globalThis.console
|
|
180
|
+
: undefined;
|
|
181
|
+
/** Log redaction — any value whose KEY looks like a credential masks to "•••" before it
|
|
182
|
+
* reaches console/log output. Applied recursively to dicts/arrays at serialization time —
|
|
183
|
+
* the live values in the store are untouched. The key list is part of the cross-platform
|
|
184
|
+
* contract (identical in Stack.swift / Globals.kt; pinned by the logs corpus). */
|
|
185
|
+
export const JSERedact = {
|
|
186
|
+
sensitive: ["token", "secret", "password", "passwd", "authorization",
|
|
187
|
+
"cookie", "apikey", "api_key", "api-key", "bearer",
|
|
188
|
+
"credential", "session_id", "sessionid", "private_key", "privatekey"],
|
|
189
|
+
isSensitive(key) {
|
|
190
|
+
const k = key.toLowerCase();
|
|
191
|
+
return this.sensitive.some((s) => k === s || k.endsWith("_" + s) || (k.endsWith(s) && s.length > 5));
|
|
192
|
+
},
|
|
193
|
+
mask(v) {
|
|
194
|
+
if (Array.isArray(v))
|
|
195
|
+
return v.map((e) => this.mask(e));
|
|
196
|
+
if (isDict(v)) {
|
|
197
|
+
const out = {};
|
|
198
|
+
for (const [k, val] of Object.entries(v)) {
|
|
199
|
+
out[k] = this.isSensitive(k) ? "•••" : this.mask(val);
|
|
200
|
+
}
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
return v;
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
//# sourceMappingURL=logs.js.map
|
package/dist/logs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,wFAAwF;AACxF,qFAAqF;AACrF,0FAA0F;AAC1F,sEAAsE;AACtE,EAAE;AACF,0FAA0F;AAC1F,yFAAyF;AACzF,qFAAqF;AACrF,0FAA0F;AAC1F,0FAA0F;AAC1F,yFAAyF;AACzF,WAAW;AACX,EAAE;AAEF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAazC,MAAM,gBAAgB;IACpB,MAAM,CAAU,GAAG,GAAG,GAAG,CAAC;IAClB,OAAO,GAAkB,EAAE,CAAC;IAC5B,KAAK,GAAG,CAAC,CAAC;IAElB,MAAM,CAAC,CAAc;QACnB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC;QAChB,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC;YAC/C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACrE,CAAC;IACH,CAAC;IACD,oDAAoD;IACpD,MAAM,KAAoB,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACrD,2EAA2E;IAC3E,KAAK,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,6EAA6E;IAC7E,KAAK,KAAW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AAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACvG,CAAC;IACD,IAAI,CAAC,CAAU;QACb,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QACxD,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACd,MAAM,GAAG,GAA6B,EAAE,CAAC;YACzC,KAAK,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACxD,CAAC;YACD,OAAO,GAAG,CAAC;QACb,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/** A JSON-RPC frame in either direction. Loose by design: hosts are not our code. */
|
|
2
|
+
export type AppFrame = {
|
|
3
|
+
jsonrpc?: string;
|
|
4
|
+
id?: string | number;
|
|
5
|
+
method?: string;
|
|
6
|
+
params?: unknown;
|
|
7
|
+
result?: unknown;
|
|
8
|
+
error?: {
|
|
9
|
+
code?: number;
|
|
10
|
+
message?: string;
|
|
11
|
+
data?: unknown;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export type AppToolResult = {
|
|
15
|
+
ok: true;
|
|
16
|
+
result: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
ok: false;
|
|
19
|
+
code: number;
|
|
20
|
+
message: string;
|
|
21
|
+
};
|
|
22
|
+
export type AppToolInput = {
|
|
23
|
+
toolName: string | null;
|
|
24
|
+
arguments: Record<string, unknown>;
|
|
25
|
+
};
|
|
26
|
+
export type AppHostContext = {
|
|
27
|
+
styles?: {
|
|
28
|
+
variables?: Record<string, string>;
|
|
29
|
+
css?: Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
containerDimensions?: {
|
|
32
|
+
width?: number;
|
|
33
|
+
height?: number;
|
|
34
|
+
};
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
export type AppBridgeOptions = {
|
|
38
|
+
/** Send one frame to the host. The DOM binding hands us `postMessage`. */
|
|
39
|
+
send: (frame: AppFrame) => void;
|
|
40
|
+
/** Display modes this view supports. The spec's `appCapabilities`. */
|
|
41
|
+
displayModes?: string[];
|
|
42
|
+
/** Called when the tool result settles (or re-settles on a later result). */
|
|
43
|
+
onData?: (result: unknown) => void;
|
|
44
|
+
/** Called when the tool input settles. */
|
|
45
|
+
onInput?: (input: AppToolInput) => void;
|
|
46
|
+
/** Called with the advisory partial channel. Never authoritative. */
|
|
47
|
+
onPartial?: (partial: unknown) => void;
|
|
48
|
+
/** Called once the handshake completes, with the host's context. */
|
|
49
|
+
onReady?: (context: AppHostContext) => void;
|
|
50
|
+
};
|
|
51
|
+
export type AppBridge = {
|
|
52
|
+
/** Invoke a tool through the host proxy. Resolves a value, never rejects. */
|
|
53
|
+
callTool: (name: string, args?: Record<string, unknown>) => Promise<AppToolResult>;
|
|
54
|
+
/** Feed one host→view frame in. */
|
|
55
|
+
receive: (frame: AppFrame) => void;
|
|
56
|
+
/** Report an observed content size. No-op unless the container is flexible. */
|
|
57
|
+
reportSize: (width: number, height: number) => void;
|
|
58
|
+
/** The handshake completed. */
|
|
59
|
+
isReady: () => boolean;
|
|
60
|
+
/** The handshake was answered with an error. The view still renders. */
|
|
61
|
+
handshakeFailed: () => boolean;
|
|
62
|
+
/** The host's theme table, verbatim. Empty when the host sent none. */
|
|
63
|
+
tokens: () => Record<string, string>;
|
|
64
|
+
/** The host context from the handshake result, or null before it lands. */
|
|
65
|
+
hostContext: () => AppHostContext | null;
|
|
66
|
+
/** The host's own identification, or null. */
|
|
67
|
+
hostInfo: () => Record<string, unknown> | null;
|
|
68
|
+
/** The settled tool result, or null. */
|
|
69
|
+
data: () => unknown;
|
|
70
|
+
/** The settled tool input, or null. */
|
|
71
|
+
input: () => AppToolInput | null;
|
|
72
|
+
/** The advisory partial channel, or null. */
|
|
73
|
+
partial: () => unknown;
|
|
74
|
+
/** How many pre-ready frames were buffered. Diagnostics; the corpus asserts it. */
|
|
75
|
+
bufferedCount: () => number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Create the view-side bridge and immediately emit the initialize request — the spec's
|
|
79
|
+
* ordering is not a suggestion, so there is no "start()" to forget to call.
|
|
80
|
+
*/
|
|
81
|
+
export declare function createAppBridge(options: AppBridgeOptions): AppBridge;
|
|
82
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/mcp/apps.ts"],"names":[],"mappings":"AAwBA,qFAAqF;AACrF,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CAC7D,CAAC;AAEF,MAAM,MAAM,aAAa,GACrB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAC7B;IAAE,EAAE,EAAE,KAAK,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AAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC;IACnF,mCAAmC;IACnC,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnC,+EAA+E;IAC/E,UAAU,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,+BAA+B;IAC/B,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,wEAAwE;IACxE,eAAe,EAAE,MAAM,OAAO,CAAC;IAC/B,uEAAuE;IACvE,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,2EAA2E;IAC3E,WAAW,EAAE,MAAM,cAAc,GAAG,IAAI,CAAC;IACzC,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/C,wCAAwC;IACxC,IAAI,EAAE,MAAM,OAAO,CAAC;IACpB,uCAAuC;IACvC,KAAK,EAAE,MAAM,YAAY,GAAG,IAAI,CAAC;IACjC,6CAA6C;IAC7C,OAAO,EAAE,MAAM,OAAO,CAAC;IACvB,mFAAmF;IACnF,aAAa,EAAE,MAAM,MAAM,CAAC;CAC7B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,SAAS,CAmKpE"}
|
package/dist/mcp/apps.js
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
//
|
|
2
|
+
// apps.ts - the MCP Apps VIEW protocol (architecture/proposals/mcp-apps.md), the half that
|
|
3
|
+
// runs inside the host's sandboxed iframe. PURE: no DOM, no postMessage, no timers — the
|
|
4
|
+
// transport is injected, which is what makes the corpus (Conformance/mcp-apps/apps.json)
|
|
5
|
+
// runnable headless on every runtime that ever needs it. The DOM binding (window
|
|
6
|
+
// postMessage, CSS custom properties, ResizeObserver) lives in @despia-native/dom, exactly the way
|
|
7
|
+
// direct DOM access lives only there.
|
|
8
|
+
//
|
|
9
|
+
// Implements the FINAL extension `modelcontextprotocol/ext-apps`, specification version "2026-01-26":
|
|
10
|
+
// the `ui/initialize` handshake, `ui/notifications/initialized`, the tool-input/tool-result
|
|
11
|
+
// notifications, host-proxied `tools/call`, and `ui/notifications/size-changed`.
|
|
12
|
+
//
|
|
13
|
+
// The laws this file exists to hold, all corpus-pinned:
|
|
14
|
+
// 1. The initialize REQUEST is the first frame out, and `initialized` follows the result.
|
|
15
|
+
// A call issued before that is queued, never dropped and never reordered ahead.
|
|
16
|
+
// 2. Tool data arriving before ready is BUFFERED and replayed in order (Article 7: a host
|
|
17
|
+
// that is out of spec degrades us, it does not brick us).
|
|
18
|
+
// 3. `tool-input-partial` is advisory and never settles the input channel — the spec says
|
|
19
|
+
// a view must not rely on it.
|
|
20
|
+
// 4. First settle wins, per request id; an unmatched or duplicate response is a no-op.
|
|
21
|
+
// 5. Errors are VALUES (error-system.md): a failed call resolves `{ok:false, code, message}`
|
|
22
|
+
// and nothing throws into the view.
|
|
23
|
+
//
|
|
24
|
+
const JSONRPC = "2.0";
|
|
25
|
+
const METHOD_NOT_FOUND = -32601;
|
|
26
|
+
const TRANSPORT_FAILED = -32000;
|
|
27
|
+
/** The notifications a host may push at a view. Anything else is ignored silently. */
|
|
28
|
+
const HOST_NOTIFICATIONS = new Set([
|
|
29
|
+
"ui/notifications/tool-input",
|
|
30
|
+
"ui/notifications/tool-input-partial",
|
|
31
|
+
"ui/notifications/tool-result",
|
|
32
|
+
]);
|
|
33
|
+
const isRecord = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
34
|
+
/**
|
|
35
|
+
* Read a tool-input notification tolerantly. The envelope carries `arguments`, but a host
|
|
36
|
+
* that passes the bare argument dict is read the same way rather than dropped: the
|
|
37
|
+
* fail-open reading costs nothing and a lost input is a blank view.
|
|
38
|
+
*/
|
|
39
|
+
function readInput(params) {
|
|
40
|
+
if (!isRecord(params))
|
|
41
|
+
return { toolName: null, arguments: {} };
|
|
42
|
+
const args = isRecord(params["arguments"]) ? params["arguments"] : null;
|
|
43
|
+
const name = typeof params["toolName"] === "string" ? params["toolName"] : null;
|
|
44
|
+
if (args !== null)
|
|
45
|
+
return { toolName: name, arguments: args };
|
|
46
|
+
// No `arguments` key: the params dict IS the argument dict, minus any envelope key.
|
|
47
|
+
const bare = {};
|
|
48
|
+
for (const [k, v] of Object.entries(params))
|
|
49
|
+
if (k !== "toolName")
|
|
50
|
+
bare[k] = v;
|
|
51
|
+
return { toolName: name, arguments: bare };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Create the view-side bridge and immediately emit the initialize request — the spec's
|
|
55
|
+
* ordering is not a suggestion, so there is no "start()" to forget to call.
|
|
56
|
+
*/
|
|
57
|
+
export function createAppBridge(options) {
|
|
58
|
+
const { send } = options;
|
|
59
|
+
let seq = 0;
|
|
60
|
+
const nextId = () => `dsx-${++seq}`;
|
|
61
|
+
const pending = new Map();
|
|
62
|
+
const queued = [];
|
|
63
|
+
const buffered = [];
|
|
64
|
+
let ready = false;
|
|
65
|
+
let failed = false;
|
|
66
|
+
let context = null;
|
|
67
|
+
let info = null;
|
|
68
|
+
let themeTokens = {};
|
|
69
|
+
let settledData = null;
|
|
70
|
+
let settledInput = null;
|
|
71
|
+
let partialInput = null;
|
|
72
|
+
let lastSize = null;
|
|
73
|
+
// Counted rather than derived from `buffered`, so the diagnostic survives the flush.
|
|
74
|
+
let bufferedSeen = 0;
|
|
75
|
+
const flushQueued = () => {
|
|
76
|
+
while (queued.length > 0)
|
|
77
|
+
send(queued.shift());
|
|
78
|
+
};
|
|
79
|
+
const applyNotification = (frame) => {
|
|
80
|
+
switch (frame.method) {
|
|
81
|
+
case "ui/notifications/tool-input": {
|
|
82
|
+
settledInput = readInput(frame.params);
|
|
83
|
+
partialInput = null; // a settled input closes the advisory channel
|
|
84
|
+
options.onInput?.(settledInput);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
case "ui/notifications/tool-input-partial": {
|
|
88
|
+
if (settledInput !== null)
|
|
89
|
+
return; // law 3: never overwrite the real thing
|
|
90
|
+
partialInput = frame.params ?? null;
|
|
91
|
+
options.onPartial?.(partialInput);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
case "ui/notifications/tool-result": {
|
|
95
|
+
settledData = frame.params ?? null;
|
|
96
|
+
options.onData?.(settledData);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
default:
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const completeHandshake = (frame) => {
|
|
104
|
+
if (frame.error !== undefined) {
|
|
105
|
+
// The host does not speak the extension. We are still a working HTML view, and any
|
|
106
|
+
// data it pushes anyway still renders — Article 7, one layer up.
|
|
107
|
+
failed = true;
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
const result = isRecord(frame.result) ? frame.result : {};
|
|
111
|
+
context = isRecord(result["hostContext"]) ? result["hostContext"] : {};
|
|
112
|
+
info = isRecord(result["hostInfo"]) ? result["hostInfo"] : null;
|
|
113
|
+
const styles = isRecord(context["styles"]) ? context["styles"] : null;
|
|
114
|
+
const vars = styles !== null && isRecord(styles["variables"]) ? styles["variables"] : null;
|
|
115
|
+
themeTokens = {};
|
|
116
|
+
if (vars !== null) {
|
|
117
|
+
for (const [k, v] of Object.entries(vars))
|
|
118
|
+
if (typeof v === "string")
|
|
119
|
+
themeTokens[k] = v;
|
|
120
|
+
}
|
|
121
|
+
ready = true;
|
|
122
|
+
send({ jsonrpc: JSONRPC, method: "ui/notifications/initialized" });
|
|
123
|
+
options.onReady?.(context);
|
|
124
|
+
}
|
|
125
|
+
flushQueued();
|
|
126
|
+
while (buffered.length > 0)
|
|
127
|
+
applyNotification(buffered.shift());
|
|
128
|
+
};
|
|
129
|
+
const handshakeId = nextId();
|
|
130
|
+
pending.set(handshakeId, completeHandshake);
|
|
131
|
+
send({
|
|
132
|
+
jsonrpc: JSONRPC,
|
|
133
|
+
id: handshakeId,
|
|
134
|
+
method: "ui/initialize",
|
|
135
|
+
params: { appCapabilities: { displayModes: options.displayModes ?? ["inline"] } },
|
|
136
|
+
});
|
|
137
|
+
const receive = (frame) => {
|
|
138
|
+
if (!isRecord(frame))
|
|
139
|
+
return;
|
|
140
|
+
// A response settles exactly one outstanding request, exactly once.
|
|
141
|
+
if (frame.id !== undefined && frame.method === undefined) {
|
|
142
|
+
const key = String(frame.id);
|
|
143
|
+
const settle = pending.get(key);
|
|
144
|
+
if (settle === undefined)
|
|
145
|
+
return; // law 4: unmatched or already settled
|
|
146
|
+
pending.delete(key);
|
|
147
|
+
settle(frame);
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (typeof frame.method !== "string")
|
|
151
|
+
return;
|
|
152
|
+
// A host REQUEST we do not implement gets an honest JSON-RPC error, never silence
|
|
153
|
+
// and never a crash. Notifications (no id) are ignored instead — that is the
|
|
154
|
+
// JSON-RPC rule, not a choice.
|
|
155
|
+
if (!HOST_NOTIFICATIONS.has(frame.method)) {
|
|
156
|
+
if (frame.id !== undefined) {
|
|
157
|
+
send({
|
|
158
|
+
jsonrpc: JSONRPC,
|
|
159
|
+
id: frame.id,
|
|
160
|
+
error: { code: METHOD_NOT_FOUND, message: `method not found: ${frame.method}` },
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (!ready && !failed) {
|
|
166
|
+
buffered.push(frame); // law 2
|
|
167
|
+
bufferedSeen += 1;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
applyNotification(frame);
|
|
171
|
+
};
|
|
172
|
+
const callTool = (name, args = {}) => new Promise((resolve) => {
|
|
173
|
+
const id = nextId();
|
|
174
|
+
pending.set(id, (frame) => {
|
|
175
|
+
if (frame.error !== undefined) {
|
|
176
|
+
resolve({
|
|
177
|
+
ok: false,
|
|
178
|
+
code: typeof frame.error.code === "number" ? frame.error.code : TRANSPORT_FAILED,
|
|
179
|
+
message: typeof frame.error.message === "string" ? frame.error.message : "tool call failed",
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
resolve({ ok: true, result: frame.result ?? null });
|
|
184
|
+
});
|
|
185
|
+
const frame = { jsonrpc: JSONRPC, id, method: "tools/call", params: { name, arguments: args } };
|
|
186
|
+
if (ready || failed)
|
|
187
|
+
send(frame);
|
|
188
|
+
else
|
|
189
|
+
queued.push(frame); // law 1: behind the handshake, never ahead of it
|
|
190
|
+
});
|
|
191
|
+
const reportSize = (width, height) => {
|
|
192
|
+
const dims = context?.containerDimensions;
|
|
193
|
+
// Fixed dimensions mean the host owns the box; reporting into it is noise.
|
|
194
|
+
if (dims === undefined)
|
|
195
|
+
return;
|
|
196
|
+
if (typeof dims.width === "number" || typeof dims.height === "number")
|
|
197
|
+
return;
|
|
198
|
+
const key = `${width}x${height}`;
|
|
199
|
+
if (key === lastSize)
|
|
200
|
+
return; // law 6: coalesce repeats
|
|
201
|
+
lastSize = key;
|
|
202
|
+
send({ jsonrpc: JSONRPC, method: "ui/notifications/size-changed", params: { width, height } });
|
|
203
|
+
};
|
|
204
|
+
return {
|
|
205
|
+
callTool,
|
|
206
|
+
receive,
|
|
207
|
+
reportSize,
|
|
208
|
+
isReady: () => ready,
|
|
209
|
+
handshakeFailed: () => failed,
|
|
210
|
+
tokens: () => ({ ...themeTokens }),
|
|
211
|
+
hostContext: () => context,
|
|
212
|
+
hostInfo: () => info,
|
|
213
|
+
data: () => settledData,
|
|
214
|
+
input: () => settledInput,
|
|
215
|
+
partial: () => partialInput,
|
|
216
|
+
bufferedCount: () => bufferedSeen,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=apps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/mcp/apps.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,4FAA4F;A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,EAAE;QACzD,MAAM,IAAI,GAAG,OAAO,EAAE,mBAAmB,CAAC;QAC1C,2EAA2E;QAC3E,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO;QAC/B,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,CAAC,MAAM,KAAK,QAAQ;YAAE,OAAO;QAC9E,MAAM,GAAG,GAAG,GAAG,KAAK,IAAI,MAAM,EAAE,CAAC;QACjC,IAAI,GAAG,KAAK,QAAQ;YAAE,OAAO,CAAC,0BAA0B;QACxD,QAAQ,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,+BAA+B,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;IACjG,CAAC,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,OAAO;QACP,UAAU;QACV,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK;QACpB,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM;QAC7B,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,WAAW,EAAE,CAAC;QAClC,WAAW,EAAE,GAAG,EAAE,CAAC,OAAO;QAC1B,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;QACpB,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW;QACvB,KAAK,EAAE,GAAG,EAAE,CAAC,YAAY;QACzB,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY;QAC3B,aAAa,EAAE,GAAG,EAAE,CAAC,YAAY;KAClC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type EntityRecord = {
|
|
2
|
+
id: string;
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
subtitle: string;
|
|
6
|
+
open: string | null;
|
|
7
|
+
keywords: string[];
|
|
8
|
+
};
|
|
9
|
+
export type EntityDrop = {
|
|
10
|
+
index: number;
|
|
11
|
+
reason: "missing_key" | "missing_title" | "duplicate_key";
|
|
12
|
+
};
|
|
13
|
+
/** The records of one collection, in its own order, and the items dropped with their reason. */
|
|
14
|
+
export declare function entityRecords(as: string, items: ReadonlyArray<Record<string, unknown>>): {
|
|
15
|
+
records: EntityRecord[];
|
|
16
|
+
dropped: EntityDrop[];
|
|
17
|
+
};
|
|
18
|
+
/** Every word of `query` must appear, case-insensitively, in the title, subtitle or keywords. */
|
|
19
|
+
export declare function entitySearch(records: readonly EntityRecord[], query: string): EntityRecord[];
|
|
20
|
+
/** `<as>:<key>` split at the first colon; null when there is no collection name or no key. */
|
|
21
|
+
export declare function parseEntityId(id: string): {
|
|
22
|
+
as: string;
|
|
23
|
+
key: string;
|
|
24
|
+
} | null;
|
|
25
|
+
//# sourceMappingURL=entities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../../src/mcp/entities.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,aAAa,GAAG,eAAe,GAAG,eAAe,CAAA;CAAE,CAAC;AAStG,gGAAgG;AAChG,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,YAAY,EAAE,CAAC;IAAC,OAAO,EAAE,UAAU,EAAE,CAAA;CAAE,CAuB3I;AAED,iGAAiG;AACjG,wBAAgB,YAAY,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAO5F;AAED,8FAA8F;AAC9F,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAI5E"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
//
|
|
2
|
+
// entities.ts - the named entity law (proposals/system-assistants.md P3, ruled),
|
|
3
|
+
// pinned by OpenSource/Conformance/assistants/entities.json on three renderers.
|
|
4
|
+
//
|
|
5
|
+
// An `<entity>` head row names a collection of the app's own records an assistant can find,
|
|
6
|
+
// name and open. The renderer evaluates the row's per-item attributes (each item is `dsx.this`)
|
|
7
|
+
// and hands this fold the fields; the fold decides which records exist, their identifier
|
|
8
|
+
// `<as>:<key>` (the Core/Spotlight encoding, split at the FIRST colon), what is dropped and
|
|
9
|
+
// why, and what a text search answers. Pure: no store, no DOM.
|
|
10
|
+
//
|
|
11
|
+
function text(v) {
|
|
12
|
+
if (v === null || v === undefined)
|
|
13
|
+
return "";
|
|
14
|
+
if (typeof v === "string")
|
|
15
|
+
return v;
|
|
16
|
+
if (typeof v === "number" || typeof v === "boolean")
|
|
17
|
+
return String(v);
|
|
18
|
+
return "";
|
|
19
|
+
}
|
|
20
|
+
/** The records of one collection, in its own order, and the items dropped with their reason. */
|
|
21
|
+
export function entityRecords(as, items) {
|
|
22
|
+
const records = [];
|
|
23
|
+
const dropped = [];
|
|
24
|
+
const seen = new Set();
|
|
25
|
+
items.forEach((item, index) => {
|
|
26
|
+
const key = text(item["key"]).trim();
|
|
27
|
+
if (key === "") {
|
|
28
|
+
dropped.push({ index, reason: "missing_key" });
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const title = text(item["title"]).trim();
|
|
32
|
+
if (title === "") {
|
|
33
|
+
dropped.push({ index, reason: "missing_title" });
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (seen.has(key)) {
|
|
37
|
+
dropped.push({ index, reason: "duplicate_key" });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
seen.add(key);
|
|
41
|
+
const open = text(item["open"]).trim();
|
|
42
|
+
const raw = Array.isArray(item["keywords"]) ? item["keywords"] : [];
|
|
43
|
+
records.push({
|
|
44
|
+
id: `${as}:${key}`,
|
|
45
|
+
key,
|
|
46
|
+
title,
|
|
47
|
+
subtitle: text(item["subtitle"]).trim(),
|
|
48
|
+
open: open.startsWith("/") ? open : null,
|
|
49
|
+
keywords: raw.map((k) => text(k).trim().toLowerCase()).filter((k) => k !== ""),
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
return { records, dropped };
|
|
53
|
+
}
|
|
54
|
+
/** Every word of `query` must appear, case-insensitively, in the title, subtitle or keywords. */
|
|
55
|
+
export function entitySearch(records, query) {
|
|
56
|
+
const words = query.toLowerCase().split(/\s+/).filter((w) => w !== "");
|
|
57
|
+
if (words.length === 0)
|
|
58
|
+
return [...records];
|
|
59
|
+
return records.filter((r) => {
|
|
60
|
+
const hay = `${r.title} ${r.subtitle} ${r.keywords.join(" ")}`.toLowerCase();
|
|
61
|
+
return words.every((w) => hay.includes(w));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** `<as>:<key>` split at the first colon; null when there is no collection name or no key. */
|
|
65
|
+
export function parseEntityId(id) {
|
|
66
|
+
const at = id.indexOf(":");
|
|
67
|
+
if (at <= 0 || at === id.length - 1)
|
|
68
|
+
return null;
|
|
69
|
+
return { as: id.slice(0, at), key: id.slice(at + 1) };
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=entities.js.map
|