@aotui/runtime 1.0.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/dist/adapters/aotui-driven-source.d.ts +106 -0
- package/dist/adapters/aotui-driven-source.js +549 -0
- package/dist/adapters/aotui-driven-source.js.map +1 -0
- package/dist/adapters/bridge/index.d.ts +94 -0
- package/dist/adapters/bridge/index.js +199 -0
- package/dist/adapters/bridge/index.js.map +1 -0
- package/dist/adapters/index.d.ts +7 -0
- package/dist/adapters/index.js +8 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/session/index.d.ts +7 -0
- package/dist/adapters/session/index.js +2 -0
- package/dist/adapters/session/index.js.map +1 -0
- package/dist/adapters/session/session.d.ts +46 -0
- package/dist/adapters/session/session.js +76 -0
- package/dist/adapters/session/session.js.map +1 -0
- package/dist/adapters/session/types.d.ts +52 -0
- package/dist/adapters/session/types.js +7 -0
- package/dist/adapters/session/types.js.map +1 -0
- package/dist/adapters/system-instruction.d.ts +9 -0
- package/dist/adapters/system-instruction.js +434 -0
- package/dist/adapters/system-instruction.js.map +1 -0
- package/dist/benchmarks/dom-engine-comparison.d.ts +1 -0
- package/dist/benchmarks/dom-engine-comparison.js +84 -0
- package/dist/benchmarks/dom-engine-comparison.js.map +1 -0
- package/dist/benchmarks/shadow-dom-check.d.ts +1 -0
- package/dist/benchmarks/shadow-dom-check.js +44 -0
- package/dist/benchmarks/shadow-dom-check.js.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +314 -0
- package/dist/cli.js.map +1 -0
- package/dist/engine/app/config.d.ts +81 -0
- package/dist/engine/app/config.js +32 -0
- package/dist/engine/app/config.js.map +1 -0
- package/dist/engine/app/index.d.ts +14 -0
- package/dist/engine/app/index.js +33 -0
- package/dist/engine/app/index.js.map +1 -0
- package/dist/engine/app/manager.d.ts +194 -0
- package/dist/engine/app/manager.js +340 -0
- package/dist/engine/app/manager.js.map +1 -0
- package/dist/engine/app/registry.d.ts +138 -0
- package/dist/engine/app/registry.js +473 -0
- package/dist/engine/app/registry.js.map +1 -0
- package/dist/engine/app/worker-app-host.service.d.ts +62 -0
- package/dist/engine/app/worker-app-host.service.js +189 -0
- package/dist/engine/app/worker-app-host.service.js.map +1 -0
- package/dist/engine/app/worker-host.d.ts +139 -0
- package/dist/engine/app/worker-host.js +397 -0
- package/dist/engine/app/worker-host.js.map +1 -0
- package/dist/engine/app/worker-pool.d.ts +45 -0
- package/dist/engine/app/worker-pool.js +122 -0
- package/dist/engine/app/worker-pool.js.map +1 -0
- package/dist/engine/app/worker-sandbox.d.ts +152 -0
- package/dist/engine/app/worker-sandbox.js +290 -0
- package/dist/engine/app/worker-sandbox.js.map +1 -0
- package/dist/engine/core/desktop-logger.d.ts +69 -0
- package/dist/engine/core/desktop-logger.js +124 -0
- package/dist/engine/core/desktop-logger.js.map +1 -0
- package/dist/engine/core/desktop.d.ts +208 -0
- package/dist/engine/core/desktop.js +351 -0
- package/dist/engine/core/desktop.js.map +1 -0
- package/dist/engine/core/index.d.ts +12 -0
- package/dist/engine/core/index.js +28 -0
- package/dist/engine/core/index.js.map +1 -0
- package/dist/engine/core/llm-output-channel.d.ts +45 -0
- package/dist/engine/core/llm-output-channel.js +122 -0
- package/dist/engine/core/llm-output-channel.js.map +1 -0
- package/dist/engine/core/manager.d.ts +59 -0
- package/dist/engine/core/manager.js +131 -0
- package/dist/engine/core/manager.js.map +1 -0
- package/dist/engine/core/operation-log-buffer.d.ts +79 -0
- package/dist/engine/core/operation-log-buffer.js +108 -0
- package/dist/engine/core/operation-log-buffer.js.map +1 -0
- package/dist/engine/core/operation-log-formatter.d.ts +44 -0
- package/dist/engine/core/operation-log-formatter.js +180 -0
- package/dist/engine/core/operation-log-formatter.js.map +1 -0
- package/dist/engine/core/services/lock.service.d.ts +33 -0
- package/dist/engine/core/services/lock.service.js +99 -0
- package/dist/engine/core/services/lock.service.js.map +1 -0
- package/dist/engine/core/signal-bus.d.ts +84 -0
- package/dist/engine/core/signal-bus.js +160 -0
- package/dist/engine/core/signal-bus.js.map +1 -0
- package/dist/engine/core/signal-service.d.ts +42 -0
- package/dist/engine/core/signal-service.js +58 -0
- package/dist/engine/core/signal-service.js.map +1 -0
- package/dist/engine/system/dispatcher.d.ts +18 -0
- package/dist/engine/system/dispatcher.js +48 -0
- package/dist/engine/system/dispatcher.js.map +1 -0
- package/dist/engine/system/index.d.ts +10 -0
- package/dist/engine/system/index.js +20 -0
- package/dist/engine/system/index.js.map +1 -0
- package/dist/engine/system/operations/index.d.ts +26 -0
- package/dist/engine/system/operations/index.js +38 -0
- package/dist/engine/system/operations/index.js.map +1 -0
- package/dist/engine/system/operations/registry.d.ts +62 -0
- package/dist/engine/system/operations/registry.js +101 -0
- package/dist/engine/system/operations/registry.js.map +1 -0
- package/dist/engine/system/operations/system/close-app.d.ts +13 -0
- package/dist/engine/system/operations/system/close-app.js +43 -0
- package/dist/engine/system/operations/system/close-app.js.map +1 -0
- package/dist/engine/system/operations/system/dismount-view.d.ts +13 -0
- package/dist/engine/system/operations/system/dismount-view.js +48 -0
- package/dist/engine/system/operations/system/dismount-view.js.map +1 -0
- package/dist/engine/system/operations/system/index.d.ts +6 -0
- package/dist/engine/system/operations/system/index.js +7 -0
- package/dist/engine/system/operations/system/index.js.map +1 -0
- package/dist/engine/system/operations/system/open-app.d.ts +13 -0
- package/dist/engine/system/operations/system/open-app.js +43 -0
- package/dist/engine/system/operations/system/open-app.js.map +1 -0
- package/dist/engine/system/registry.d.ts +36 -0
- package/dist/engine/system/registry.js +101 -0
- package/dist/engine/system/registry.js.map +1 -0
- package/dist/engine/view/index.d.ts +13 -0
- package/dist/engine/view/index.js +20 -0
- package/dist/engine/view/index.js.map +1 -0
- package/dist/engine/view/manager.d.ts +42 -0
- package/dist/engine/view/manager.js +57 -0
- package/dist/engine/view/manager.js.map +1 -0
- package/dist/engine/view/snapshot/builder.d.ts +34 -0
- package/dist/engine/view/snapshot/builder.js +119 -0
- package/dist/engine/view/snapshot/builder.js.map +1 -0
- package/dist/engine/view/snapshot/formatter.d.ts +76 -0
- package/dist/engine/view/snapshot/formatter.js +297 -0
- package/dist/engine/view/snapshot/formatter.js.map +1 -0
- package/dist/engine/view/snapshot/index.d.ts +8 -0
- package/dist/engine/view/snapshot/index.js +8 -0
- package/dist/engine/view/snapshot/index.js.map +1 -0
- package/dist/engine/view/snapshot/templates.d.ts +41 -0
- package/dist/engine/view/snapshot/templates.js +317 -0
- package/dist/engine/view/snapshot/templates.js.map +1 -0
- package/dist/engine/view/transformer/__tests__/visitors/test-utils.d.ts +1 -0
- package/dist/engine/view/transformer/__tests__/visitors/test-utils.js +14 -0
- package/dist/engine/view/transformer/__tests__/visitors/test-utils.js.map +1 -0
- package/dist/engine/view/transformer/helpers.d.ts +19 -0
- package/dist/engine/view/transformer/helpers.js +32 -0
- package/dist/engine/view/transformer/helpers.js.map +1 -0
- package/dist/engine/view/transformer/index.d.ts +40 -0
- package/dist/engine/view/transformer/index.js +38 -0
- package/dist/engine/view/transformer/index.js.map +1 -0
- package/dist/engine/view/transformer/pure.d.ts +17 -0
- package/dist/engine/view/transformer/pure.js +124 -0
- package/dist/engine/view/transformer/pure.js.map +1 -0
- package/dist/engine/view/transformer/types.d.ts +31 -0
- package/dist/engine/view/transformer/types.js +16 -0
- package/dist/engine/view/transformer/types.js.map +1 -0
- package/dist/engine/view/transformer/visitors/application.visitor.d.ts +8 -0
- package/dist/engine/view/transformer/visitors/application.visitor.js +37 -0
- package/dist/engine/view/transformer/visitors/application.visitor.js.map +1 -0
- package/dist/engine/view/transformer/visitors/html.visitor.d.ts +8 -0
- package/dist/engine/view/transformer/visitors/html.visitor.js +161 -0
- package/dist/engine/view/transformer/visitors/html.visitor.js.map +1 -0
- package/dist/engine/view/transformer/visitors/index.d.ts +12 -0
- package/dist/engine/view/transformer/visitors/index.js +27 -0
- package/dist/engine/view/transformer/visitors/index.js.map +1 -0
- package/dist/engine/view/transformer/visitors/interface.d.ts +53 -0
- package/dist/engine/view/transformer/visitors/interface.js +8 -0
- package/dist/engine/view/transformer/visitors/interface.js.map +1 -0
- package/dist/engine/view/transformer/visitors/operation.visitor.d.ts +9 -0
- package/dist/engine/view/transformer/visitors/operation.visitor.js +122 -0
- package/dist/engine/view/transformer/visitors/operation.visitor.js.map +1 -0
- package/dist/engine/view/transformer/visitors/view-link.visitor.d.ts +15 -0
- package/dist/engine/view/transformer/visitors/view-link.visitor.js +98 -0
- package/dist/engine/view/transformer/visitors/view-link.visitor.js.map +1 -0
- package/dist/engine/view/transformer/visitors/view.visitor.d.ts +8 -0
- package/dist/engine/view/transformer/visitors/view.visitor.js +43 -0
- package/dist/engine/view/transformer/visitors/view.visitor.js.map +1 -0
- package/dist/engine/view/types.d.ts +70 -0
- package/dist/engine/view/types.js +17 -0
- package/dist/engine/view/types.js.map +1 -0
- package/dist/facades/facades.d.ts +40 -0
- package/dist/facades/facades.js +66 -0
- package/dist/facades/facades.js.map +1 -0
- package/dist/facades/index.d.ts +13 -0
- package/dist/facades/index.js +15 -0
- package/dist/facades/index.js.map +1 -0
- package/dist/factory/createKernel.d.ts +37 -0
- package/dist/factory/createKernel.js +42 -0
- package/dist/factory/createKernel.js.map +1 -0
- package/dist/factory/index.d.ts +9 -0
- package/dist/factory/index.js +10 -0
- package/dist/factory/index.js.map +1 -0
- package/dist/index.d.ts +35 -0
- package/dist/index.js +69 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/browser.d.ts +20 -0
- package/dist/internal/browser.js +20 -0
- package/dist/internal/browser.js.map +1 -0
- package/dist/kernel/index.d.ts +120 -0
- package/dist/kernel/index.js +328 -0
- package/dist/kernel/index.js.map +1 -0
- package/dist/spi/app/aoapp.d.ts +86 -0
- package/dist/spi/app/aoapp.js +39 -0
- package/dist/spi/app/aoapp.js.map +1 -0
- package/dist/spi/app/app-config.interface.d.ts +9 -0
- package/dist/spi/app/app-config.interface.js +2 -0
- package/dist/spi/app/app-config.interface.js.map +1 -0
- package/dist/spi/app/app-factory.interface.d.ts +78 -0
- package/dist/spi/app/app-factory.interface.js +49 -0
- package/dist/spi/app/app-factory.interface.js.map +1 -0
- package/dist/spi/app/app-kernel.interface.d.ts +139 -0
- package/dist/spi/app/app-kernel.interface.js +2 -0
- package/dist/spi/app/app-kernel.interface.js.map +1 -0
- package/dist/spi/app/app.interface.d.ts +84 -0
- package/dist/spi/app/app.interface.js +8 -0
- package/dist/spi/app/app.interface.js.map +1 -0
- package/dist/spi/app/index.d.ts +26 -0
- package/dist/spi/app/index.js +13 -0
- package/dist/spi/app/index.js.map +1 -0
- package/dist/spi/app/public-types.d.ts +309 -0
- package/dist/spi/app/public-types.js +17 -0
- package/dist/spi/app/public-types.js.map +1 -0
- package/dist/spi/app/ref-exporter.interface.d.ts +23 -0
- package/dist/spi/app/ref-exporter.interface.js +10 -0
- package/dist/spi/app/ref-exporter.interface.js.map +1 -0
- package/dist/spi/app/store.interface.d.ts +45 -0
- package/dist/spi/app/store.interface.js +11 -0
- package/dist/spi/app/store.interface.js.map +1 -0
- package/dist/spi/app/view-context-core.interface.d.ts +50 -0
- package/dist/spi/app/view-context-core.interface.js +8 -0
- package/dist/spi/app/view-context-core.interface.js.map +1 -0
- package/dist/spi/app/view-context-ext.interface.d.ts +79 -0
- package/dist/spi/app/view-context-ext.interface.js +19 -0
- package/dist/spi/app/view-context-ext.interface.js.map +1 -0
- package/dist/spi/app/view-factory.interface.d.ts +46 -0
- package/dist/spi/app/view-factory.interface.js +2 -0
- package/dist/spi/app/view-factory.interface.js.map +1 -0
- package/dist/spi/app/view-link.types.d.ts +136 -0
- package/dist/spi/app/view-link.types.js +19 -0
- package/dist/spi/app/view-link.types.js.map +1 -0
- package/dist/spi/app/view-tree.interface.d.ts +254 -0
- package/dist/spi/app/view-tree.interface.js +13 -0
- package/dist/spi/app/view-tree.interface.js.map +1 -0
- package/dist/spi/app/view.interface.d.ts +122 -0
- package/dist/spi/app/view.interface.js +15 -0
- package/dist/spi/app/view.interface.js.map +1 -0
- package/dist/spi/bridge/bridge.interface.d.ts +118 -0
- package/dist/spi/bridge/bridge.interface.js +32 -0
- package/dist/spi/bridge/bridge.interface.js.map +1 -0
- package/dist/spi/bridge/index.d.ts +8 -0
- package/dist/spi/bridge/index.js +9 -0
- package/dist/spi/bridge/index.js.map +1 -0
- package/dist/spi/component-factory.interface.d.ts +123 -0
- package/dist/spi/component-factory.interface.js +15 -0
- package/dist/spi/component-factory.interface.js.map +1 -0
- package/dist/spi/config/define-config.d.ts +31 -0
- package/dist/spi/config/define-config.js +72 -0
- package/dist/spi/config/define-config.js.map +1 -0
- package/dist/spi/config/domains/bridge.config.d.ts +21 -0
- package/dist/spi/config/domains/bridge.config.js +10 -0
- package/dist/spi/config/domains/bridge.config.js.map +1 -0
- package/dist/spi/config/domains/lock.config.d.ts +20 -0
- package/dist/spi/config/domains/lock.config.js +10 -0
- package/dist/spi/config/domains/lock.config.js.map +1 -0
- package/dist/spi/config/domains/logger.config.d.ts +28 -0
- package/dist/spi/config/domains/logger.config.js +11 -0
- package/dist/spi/config/domains/logger.config.js.map +1 -0
- package/dist/spi/config/domains/snapshot.config.d.ts +20 -0
- package/dist/spi/config/domains/snapshot.config.js +10 -0
- package/dist/spi/config/domains/snapshot.config.js.map +1 -0
- package/dist/spi/config/domains/transform.config.d.ts +28 -0
- package/dist/spi/config/domains/transform.config.js +11 -0
- package/dist/spi/config/domains/transform.config.js.map +1 -0
- package/dist/spi/config/domains/worker.config.d.ts +54 -0
- package/dist/spi/config/domains/worker.config.js +15 -0
- package/dist/spi/config/domains/worker.config.js.map +1 -0
- package/dist/spi/config/index.d.ts +16 -0
- package/dist/spi/config/index.js +18 -0
- package/dist/spi/config/index.js.map +1 -0
- package/dist/spi/config/types.d.ts +38 -0
- package/dist/spi/config/types.js +7 -0
- package/dist/spi/config/types.js.map +1 -0
- package/dist/spi/config/validate.d.ts +12 -0
- package/dist/spi/config/validate.js +90 -0
- package/dist/spi/config/validate.js.map +1 -0
- package/dist/spi/core/errors.d.ts +117 -0
- package/dist/spi/core/errors.js +233 -0
- package/dist/spi/core/errors.js.map +1 -0
- package/dist/spi/core/id-factory.d.ts +85 -0
- package/dist/spi/core/id-factory.js +119 -0
- package/dist/spi/core/id-factory.js.map +1 -0
- package/dist/spi/core/index.d.ts +21 -0
- package/dist/spi/core/index.js +25 -0
- package/dist/spi/core/index.js.map +1 -0
- package/dist/spi/core/llm-output.d.ts +74 -0
- package/dist/spi/core/llm-output.js +12 -0
- package/dist/spi/core/llm-output.js.map +1 -0
- package/dist/spi/core/operation-log.d.ts +133 -0
- package/dist/spi/core/operation-log.js +13 -0
- package/dist/spi/core/operation-log.js.map +1 -0
- package/dist/spi/core/operations.d.ts +198 -0
- package/dist/spi/core/operations.js +13 -0
- package/dist/spi/core/operations.js.map +1 -0
- package/dist/spi/core/signals.d.ts +16 -0
- package/dist/spi/core/signals.js +7 -0
- package/dist/spi/core/signals.js.map +1 -0
- package/dist/spi/core/snapshot.d.ts +77 -0
- package/dist/spi/core/snapshot.js +18 -0
- package/dist/spi/core/snapshot.js.map +1 -0
- package/dist/spi/core/tool-call.d.ts +60 -0
- package/dist/spi/core/tool-call.js +10 -0
- package/dist/spi/core/tool-call.js.map +1 -0
- package/dist/spi/core/types.d.ts +68 -0
- package/dist/spi/core/types.js +8 -0
- package/dist/spi/core/types.js.map +1 -0
- package/dist/spi/index.d.ts +31 -0
- package/dist/spi/index.js +57 -0
- package/dist/spi/index.js.map +1 -0
- package/dist/spi/runtime/app-host.interface.d.ts +142 -0
- package/dist/spi/runtime/app-host.interface.js +10 -0
- package/dist/spi/runtime/app-host.interface.js.map +1 -0
- package/dist/spi/runtime/app-installer.interface.d.ts +33 -0
- package/dist/spi/runtime/app-installer.interface.js +2 -0
- package/dist/spi/runtime/app-installer.interface.js.map +1 -0
- package/dist/spi/runtime/context.interface.d.ts +10 -0
- package/dist/spi/runtime/context.interface.js +2 -0
- package/dist/spi/runtime/context.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-context.interface.d.ts +45 -0
- package/dist/spi/runtime/desktop-context.interface.js +10 -0
- package/dist/spi/runtime/desktop-context.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-dom.interface.d.ts +48 -0
- package/dist/spi/runtime/desktop-dom.interface.js +13 -0
- package/dist/spi/runtime/desktop-dom.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-lifecycle.interface.d.ts +23 -0
- package/dist/spi/runtime/desktop-lifecycle.interface.js +2 -0
- package/dist/spi/runtime/desktop-lifecycle.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-lock.interface.d.ts +50 -0
- package/dist/spi/runtime/desktop-lock.interface.js +2 -0
- package/dist/spi/runtime/desktop-lock.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-manager.interface.d.ts +22 -0
- package/dist/spi/runtime/desktop-manager.interface.js +13 -0
- package/dist/spi/runtime/desktop-manager.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-repository.interface.d.ts +8 -0
- package/dist/spi/runtime/desktop-repository.interface.js +2 -0
- package/dist/spi/runtime/desktop-repository.interface.js.map +1 -0
- package/dist/spi/runtime/desktop-state-accessor.interface.d.ts +22 -0
- package/dist/spi/runtime/desktop-state-accessor.interface.js +2 -0
- package/dist/spi/runtime/desktop-state-accessor.interface.js.map +1 -0
- package/dist/spi/runtime/dispatcher.interface.d.ts +34 -0
- package/dist/spi/runtime/dispatcher.interface.js +10 -0
- package/dist/spi/runtime/dispatcher.interface.js.map +1 -0
- package/dist/spi/runtime/index.d.ts +28 -0
- package/dist/spi/runtime/index.js +11 -0
- package/dist/spi/runtime/index.js.map +1 -0
- package/dist/spi/runtime/kernel.interface.d.ts +221 -0
- package/dist/spi/runtime/kernel.interface.js +7 -0
- package/dist/spi/runtime/kernel.interface.js.map +1 -0
- package/dist/spi/runtime/llm-output-channel.interface.d.ts +81 -0
- package/dist/spi/runtime/llm-output-channel.interface.js +12 -0
- package/dist/spi/runtime/llm-output-channel.interface.js.map +1 -0
- package/dist/spi/runtime/signal.interface.d.ts +80 -0
- package/dist/spi/runtime/signal.interface.js +9 -0
- package/dist/spi/runtime/signal.interface.js.map +1 -0
- package/dist/spi/runtime/snapshot.interface.d.ts +126 -0
- package/dist/spi/runtime/snapshot.interface.js +14 -0
- package/dist/spi/runtime/snapshot.interface.js.map +1 -0
- package/dist/spi/runtime/transformer.interface.d.ts +47 -0
- package/dist/spi/runtime/transformer.interface.js +10 -0
- package/dist/spi/runtime/transformer.interface.js.map +1 -0
- package/dist/spi/runtime/worker-message.interface.d.ts +80 -0
- package/dist/spi/runtime/worker-message.interface.js +49 -0
- package/dist/spi/runtime/worker-message.interface.js.map +1 -0
- package/dist/spi/runtime/worker-runtime.interface.d.ts +177 -0
- package/dist/spi/runtime/worker-runtime.interface.js +14 -0
- package/dist/spi/runtime/worker-runtime.interface.js.map +1 -0
- package/dist/spi/worker-protocol/index.d.ts +26 -0
- package/dist/spi/worker-protocol/index.js +29 -0
- package/dist/spi/worker-protocol/index.js.map +1 -0
- package/dist/spi/worker-protocol/messages.d.ts +257 -0
- package/dist/spi/worker-protocol/messages.js +42 -0
- package/dist/spi/worker-protocol/messages.js.map +1 -0
- package/dist/spi/worker-protocol/types.d.ts +12 -0
- package/dist/spi/worker-protocol/types.js +16 -0
- package/dist/spi/worker-protocol/types.js.map +1 -0
- package/dist/worker-runtime/app-kernel/AppKernel.d.ts +178 -0
- package/dist/worker-runtime/app-kernel/AppKernel.js +622 -0
- package/dist/worker-runtime/app-kernel/AppKernel.js.map +1 -0
- package/dist/worker-runtime/app-kernel/index.d.ts +23 -0
- package/dist/worker-runtime/app-kernel/index.js +23 -0
- package/dist/worker-runtime/app-kernel/index.js.map +1 -0
- package/dist/worker-runtime/app-kernel/view-registry.d.ts +85 -0
- package/dist/worker-runtime/app-kernel/view-registry.js +119 -0
- package/dist/worker-runtime/app-kernel/view-registry.js.map +1 -0
- package/dist/worker-runtime/app-kernel/view-tree.d.ts +222 -0
- package/dist/worker-runtime/app-kernel/view-tree.js +682 -0
- package/dist/worker-runtime/app-kernel/view-tree.js.map +1 -0
- package/dist/worker-runtime/index.d.ts +16 -0
- package/dist/worker-runtime/index.js +731 -0
- package/dist/worker-runtime/index.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPI App Layer - Public Types for App Developers
|
|
3
|
+
*
|
|
4
|
+
* [P4/P5 FIX] 类型定义碎片化修复
|
|
5
|
+
*
|
|
6
|
+
* 这些接口是 App 开发者可见的公共 API。
|
|
7
|
+
* SDK 应该 re-export 这些类型,而不是定义自己的版本。
|
|
8
|
+
*
|
|
9
|
+
* 设计原则:
|
|
10
|
+
* 1. 使用 string 替代 Branded Types (AppID, ViewID 等) - 降低开发者心智负担
|
|
11
|
+
* 2. 只暴露 App 开发者需要的最小接口 - 接口隔离原则 (ISP)
|
|
12
|
+
* 3. 作为 SSOT (Single Source of Truth) - SDK 和应用层都从这里导入
|
|
13
|
+
*
|
|
14
|
+
* @module @aotui/runtime/spi/app/public-types
|
|
15
|
+
*/
|
|
16
|
+
import type { IView } from './view.interface.js';
|
|
17
|
+
/**
|
|
18
|
+
* View 元数据接口 - App 开发者的公共 API
|
|
19
|
+
*
|
|
20
|
+
* 这是 App 开发者通过 `useViewContext()` 获取的上下文类型。
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* function MyComponent() {
|
|
25
|
+
* const ctx = useViewContext();
|
|
26
|
+
* console.log('Current view:', ctx.viewId);
|
|
27
|
+
* console.log('Desktop:', ctx.desktopId);
|
|
28
|
+
*
|
|
29
|
+
* // 标记 View 需要更新
|
|
30
|
+
* ctx.markDirty();
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export interface IViewMeta {
|
|
35
|
+
/** 当前 View 的唯一标识符 */
|
|
36
|
+
readonly viewId: string;
|
|
37
|
+
/**
|
|
38
|
+
* 当前View的类型 (用于Tool聚合)
|
|
39
|
+
*
|
|
40
|
+
* @optional
|
|
41
|
+
*/
|
|
42
|
+
readonly viewType?: string;
|
|
43
|
+
/** 父 App 的唯一标识符 */
|
|
44
|
+
readonly appId: string;
|
|
45
|
+
/** Desktop 的唯一标识符 (用于加载相关数据,如历史记录) */
|
|
46
|
+
readonly desktopId: string;
|
|
47
|
+
/**
|
|
48
|
+
* 标记 View 为 dirty,触发 UpdateSignal
|
|
49
|
+
*
|
|
50
|
+
* 数据链路: markDirty() → Preact render → MutationObserver → UpdateSignal
|
|
51
|
+
*/
|
|
52
|
+
markDirty(): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Ref 注册表接口 - App 开发者的公共 API
|
|
56
|
+
*
|
|
57
|
+
* 用于 `useArrayRef` 等 Hooks 内部注册数据引用。
|
|
58
|
+
* App 开发者通常不直接使用此接口,而是通过 Hooks。
|
|
59
|
+
*
|
|
60
|
+
* @internal 主要供 SDK Hooks 使用
|
|
61
|
+
*/
|
|
62
|
+
export interface IRefRegistry {
|
|
63
|
+
/**
|
|
64
|
+
* 注册数据引用
|
|
65
|
+
*
|
|
66
|
+
* @param refId - 引用 ID (View 内唯一)
|
|
67
|
+
* @param data - 绑定的数据对象
|
|
68
|
+
*/
|
|
69
|
+
registerRef(refId: string, data: object): void;
|
|
70
|
+
/**
|
|
71
|
+
* 注销数据引用
|
|
72
|
+
*
|
|
73
|
+
* @param refId - 要注销的引用 ID
|
|
74
|
+
*/
|
|
75
|
+
unregisterRef(refId: string): void;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Type Tool 定义
|
|
79
|
+
*
|
|
80
|
+
* Type Tool 是绑定到 View Type 而非 View 实例的工具。
|
|
81
|
+
* 例如: FileDetail 类型的所有 View 共享同一组 LSP tools。
|
|
82
|
+
*/
|
|
83
|
+
export interface TypeToolDefinition {
|
|
84
|
+
/** 工具描述,发送给 LLM */
|
|
85
|
+
description: string;
|
|
86
|
+
/** 参数定义 (可选) */
|
|
87
|
+
params?: unknown;
|
|
88
|
+
/** 工具处理函数 */
|
|
89
|
+
handler: (args: Record<string, unknown>) => Promise<unknown>;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Type Tool 注册表接口
|
|
93
|
+
*
|
|
94
|
+
* [RFC-020] Type Tool Aggregation
|
|
95
|
+
*
|
|
96
|
+
* **设计背景**:
|
|
97
|
+
* - 原方案使用 DOM 事件注册,但 LinkedOM 的事件冒泡机制不可靠
|
|
98
|
+
* - 改为直接 API 调用,与 IRefRegistry 架构一致
|
|
99
|
+
*
|
|
100
|
+
* **核心价值**:
|
|
101
|
+
* - 避免重复注册: 10个 FileDetailView 只注册 8 个 LSP tools (不是 80 个)
|
|
102
|
+
* - 动态加载: 根据条件 (如 activeFiles.length > 0) 注册/注销
|
|
103
|
+
* - 职责分离: Root View 管理 Type Tools, Child View 专注业务逻辑
|
|
104
|
+
*
|
|
105
|
+
* **使用场景**:
|
|
106
|
+
* ```tsx
|
|
107
|
+
* // WorkspaceContent.tsx (Root View)
|
|
108
|
+
* const hasFiles = activeFiles.length > 0;
|
|
109
|
+
*
|
|
110
|
+
* useViewTypeTool('FileDetail', 'lsp_hover', {
|
|
111
|
+
* description: `Get type info for: ${activeFiles.join(', ')}`,
|
|
112
|
+
* params: lspHoverParams,
|
|
113
|
+
* enabled: hasFiles // 条件注册
|
|
114
|
+
* }, handler);
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @internal 主要供 SDK Hooks (useViewTypeTool) 使用
|
|
118
|
+
*/
|
|
119
|
+
export interface ITypeToolRegistry {
|
|
120
|
+
/**
|
|
121
|
+
* 注册 Type Tool
|
|
122
|
+
*
|
|
123
|
+
* **重要**: 同一个 (viewType, toolName) 组合只能注册一次。
|
|
124
|
+
* 重复注册会抛出错误,确保工具定义的唯一性。
|
|
125
|
+
*
|
|
126
|
+
* @param viewType - View 类型 (e.g., "FileDetail", "SearchResult")
|
|
127
|
+
* @param toolName - 工具名称 (e.g., "lsp_hover", "close_search_view")
|
|
128
|
+
* @param toolDef - 工具定义 (description, params, handler)
|
|
129
|
+
*
|
|
130
|
+
* @throws Error 如果该 Type Tool 已被注册
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* registry.registerTypeTool('FileDetail', 'lsp_hover', {
|
|
135
|
+
* description: 'Get type information at cursor position',
|
|
136
|
+
* params: defineParams({ line: { type: 'number', required: true } }),
|
|
137
|
+
* handler: async ({ line }) => { ... }
|
|
138
|
+
* });
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
registerTypeTool(viewType: string, toolName: string, toolDef: TypeToolDefinition): void;
|
|
142
|
+
/**
|
|
143
|
+
* 注销 Type Tool
|
|
144
|
+
*
|
|
145
|
+
* 通常在组件卸载或条件不满足时调用。
|
|
146
|
+
* 如果工具不存在,静默忽略 (幂等操作)。
|
|
147
|
+
*
|
|
148
|
+
* @param viewType - View 类型
|
|
149
|
+
* @param toolName - 工具名称
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* // useEffect cleanup
|
|
154
|
+
* return () => {
|
|
155
|
+
* registry.unregisterTypeTool('FileDetail', 'lsp_hover');
|
|
156
|
+
* };
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
unregisterTypeTool(viewType: string, toolName: string): void;
|
|
160
|
+
/**
|
|
161
|
+
* 获取所有已注册的 Type Tools
|
|
162
|
+
*
|
|
163
|
+
* **内部使用**: 供 Worker Runtime 生成 Snapshot 时调用。
|
|
164
|
+
* App 开发者通常不需要直接调用此方法。
|
|
165
|
+
*
|
|
166
|
+
* @returns Map<viewType, Map<toolName, toolDef>>
|
|
167
|
+
*
|
|
168
|
+
* @internal
|
|
169
|
+
*/
|
|
170
|
+
getAllTypeTools(): Map<string, Map<string, TypeToolDefinition>>;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* ViewLink 注册选项
|
|
174
|
+
*/
|
|
175
|
+
export interface RegisterLinkOptions {
|
|
176
|
+
/**
|
|
177
|
+
* LinkID 前缀 (用于列表)
|
|
178
|
+
*
|
|
179
|
+
* SDK 会自动生成: `${prefix}_${index}`
|
|
180
|
+
* 不提供时使用 viewType 作为前缀
|
|
181
|
+
*/
|
|
182
|
+
prefix?: string;
|
|
183
|
+
/**
|
|
184
|
+
* 显示标签
|
|
185
|
+
*/
|
|
186
|
+
label?: string;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* ViewLink 注册表接口 - App 开发者的公共 API
|
|
190
|
+
*
|
|
191
|
+
* [RFC-006] ViewLink 机制,用于创建可导航的子 View 链接。
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```tsx
|
|
195
|
+
* function TopicList() {
|
|
196
|
+
* const topics = [...];
|
|
197
|
+
* return (
|
|
198
|
+
* <ul>
|
|
199
|
+
* {topics.map(topic => (
|
|
200
|
+
* <li key={topic.id}>
|
|
201
|
+
* <ViewLink
|
|
202
|
+
* uniqueId={topic.id}
|
|
203
|
+
* view={TopicDetailView}
|
|
204
|
+
* props={{ topicId: topic.id }}
|
|
205
|
+
* >
|
|
206
|
+
* {topic.title}
|
|
207
|
+
* </ViewLink>
|
|
208
|
+
* </li>
|
|
209
|
+
* ))}
|
|
210
|
+
* </ul>
|
|
211
|
+
* );
|
|
212
|
+
* }
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
export interface IViewLinkRegistry {
|
|
216
|
+
/**
|
|
217
|
+
* 注册一个 ViewLink
|
|
218
|
+
*
|
|
219
|
+
* @param uniqueId - 业务唯一标识 (跨快照稳定)
|
|
220
|
+
* @param viewType - View 类型名称
|
|
221
|
+
* @param factory - View 工厂函数
|
|
222
|
+
* @param props - 传递给 View 的 Props
|
|
223
|
+
* @param options - 注册选项
|
|
224
|
+
* @returns 分配的 LinkID
|
|
225
|
+
*/
|
|
226
|
+
registerLink?(uniqueId: string, viewType: string, factory: (viewId: string, props?: Record<string, unknown>) => IView, props?: Record<string, unknown>, options?: RegisterLinkOptions): string;
|
|
227
|
+
/**
|
|
228
|
+
* 注销一个 ViewLink
|
|
229
|
+
*
|
|
230
|
+
* @param linkId - 要注销的 LinkID
|
|
231
|
+
*/
|
|
232
|
+
unregisterLink?(linkId: string): void;
|
|
233
|
+
/**
|
|
234
|
+
* 获取已绑定的 ViewID (如果有)
|
|
235
|
+
*
|
|
236
|
+
* @param viewType - View 类型名称
|
|
237
|
+
* @param uniqueId - 业务唯一标识
|
|
238
|
+
* @returns ViewID 或 undefined
|
|
239
|
+
*/
|
|
240
|
+
getBoundViewId?(viewType: string, uniqueId: string): string | undefined;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @deprecated 使用 IViewLinkRegistry 替代
|
|
244
|
+
*/
|
|
245
|
+
export type IMountableViewRegistry = IViewLinkRegistry;
|
|
246
|
+
import type { OperationResult } from '../core/operations.js';
|
|
247
|
+
/**
|
|
248
|
+
* 简化的 Operation Handler 类型
|
|
249
|
+
*
|
|
250
|
+
* 用于内部 Context 注册,不包含类型推断。
|
|
251
|
+
* 公共 API 请使用 `OperationHandler` from '@aotui/sdk'。
|
|
252
|
+
*/
|
|
253
|
+
export type SimpleOperationHandler = (args: Record<string, unknown>) => Promise<OperationResult> | OperationResult;
|
|
254
|
+
/**
|
|
255
|
+
* Operation 注册表接口 - App 开发者的公共 API
|
|
256
|
+
*
|
|
257
|
+
* 用于 SDK Hooks 内部注册操作处理器。
|
|
258
|
+
* App 开发者通常不直接使用此接口,而是通过 Hooks。
|
|
259
|
+
*
|
|
260
|
+
* @internal 主要供 SDK Hooks 使用
|
|
261
|
+
*/
|
|
262
|
+
export interface IOperationRegistry {
|
|
263
|
+
/**
|
|
264
|
+
* 注册 Operation handler
|
|
265
|
+
*
|
|
266
|
+
* @param name - 操作名称
|
|
267
|
+
* @param handler - 操作处理函数
|
|
268
|
+
*/
|
|
269
|
+
registerOperation(name: string, handler: SimpleOperationHandler): void;
|
|
270
|
+
/**
|
|
271
|
+
* 注销 Operation handler
|
|
272
|
+
*
|
|
273
|
+
* @param name - 要注销的操作名称
|
|
274
|
+
*/
|
|
275
|
+
unregisterOperation(name: string): void;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* 动态子视图注册表接口
|
|
279
|
+
*
|
|
280
|
+
* 用于动态创建和销毁子 View。
|
|
281
|
+
*
|
|
282
|
+
* @internal 主要供 SDK 内部使用
|
|
283
|
+
*/
|
|
284
|
+
export interface IDynamicViewRegistry {
|
|
285
|
+
/**
|
|
286
|
+
* 注册动态子视图
|
|
287
|
+
*
|
|
288
|
+
* @param view - IView 实例
|
|
289
|
+
* @returns 分配的 ViewID
|
|
290
|
+
*/
|
|
291
|
+
registerChildView(view: IView): string;
|
|
292
|
+
/**
|
|
293
|
+
* 注销动态子视图
|
|
294
|
+
*
|
|
295
|
+
* @param viewId - 要注销的 ViewID
|
|
296
|
+
*/
|
|
297
|
+
unregisterChildView(viewId: string): void;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* 应用配置接口
|
|
301
|
+
*
|
|
302
|
+
* 通过 `useAppEnv` Hook 获取环境变量。
|
|
303
|
+
*/
|
|
304
|
+
export interface IAppConfig {
|
|
305
|
+
/** 环境变量 */
|
|
306
|
+
env?: Record<string, string | number | boolean>;
|
|
307
|
+
/** 初始状态 */
|
|
308
|
+
initialState?: Record<string, unknown>;
|
|
309
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPI App Layer - Public Types for App Developers
|
|
3
|
+
*
|
|
4
|
+
* [P4/P5 FIX] 类型定义碎片化修复
|
|
5
|
+
*
|
|
6
|
+
* 这些接口是 App 开发者可见的公共 API。
|
|
7
|
+
* SDK 应该 re-export 这些类型,而不是定义自己的版本。
|
|
8
|
+
*
|
|
9
|
+
* 设计原则:
|
|
10
|
+
* 1. 使用 string 替代 Branded Types (AppID, ViewID 等) - 降低开发者心智负担
|
|
11
|
+
* 2. 只暴露 App 开发者需要的最小接口 - 接口隔离原则 (ISP)
|
|
12
|
+
* 3. 作为 SSOT (Single Source of Truth) - SDK 和应用层都从这里导入
|
|
13
|
+
*
|
|
14
|
+
* @module @aotui/runtime/spi/app/public-types
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=public-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-types.js","sourceRoot":"","sources":["../../../src/spi/app/public-types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref Exporter Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for registering and exporting Refs between SDK and Runtime.
|
|
5
|
+
* This replaces the global __AOTUI_REF_REGISTRY__ with an explicit interface.
|
|
6
|
+
*
|
|
7
|
+
* [RFC-002] Ref Registry Refactoring
|
|
8
|
+
*/
|
|
9
|
+
export interface IRefExporter {
|
|
10
|
+
/**
|
|
11
|
+
* Register a Ref data object
|
|
12
|
+
* @param viewId The View ID
|
|
13
|
+
* @param refId The Ref ID (unique within the View)
|
|
14
|
+
* @param data The data object
|
|
15
|
+
*/
|
|
16
|
+
registerRef(viewId: string, refId: string, data: object): void;
|
|
17
|
+
/**
|
|
18
|
+
* Unregister a Ref
|
|
19
|
+
* @param viewId The View ID
|
|
20
|
+
* @param refId The Ref ID
|
|
21
|
+
*/
|
|
22
|
+
unregisterRef(viewId: string, refId: string): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ref Exporter Interface
|
|
3
|
+
*
|
|
4
|
+
* Defines the contract for registering and exporting Refs between SDK and Runtime.
|
|
5
|
+
* This replaces the global __AOTUI_REF_REGISTRY__ with an explicit interface.
|
|
6
|
+
*
|
|
7
|
+
* [RFC-002] Ref Registry Refactoring
|
|
8
|
+
*/
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=ref-exporter.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref-exporter.interface.js","sourceRoot":"","sources":["../../../src/spi/app/ref-exporter.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPI Layer - App Context
|
|
3
|
+
*
|
|
4
|
+
* App 运行上下文定义。
|
|
5
|
+
*
|
|
6
|
+
* [C3 简化] 移除了 IAppStore/IAppStoreFactory。
|
|
7
|
+
* AOTUI 是 de-visualized TUI,App 无独立状态。
|
|
8
|
+
* 业务数据持久化由 Product Layer 负责。
|
|
9
|
+
*/
|
|
10
|
+
import type { DesktopID, AppID } from '../core/types.js';
|
|
11
|
+
/**
|
|
12
|
+
* App 运行上下文
|
|
13
|
+
*
|
|
14
|
+
* 在 App.onOpen() 时由 Desktop 创建并传入。
|
|
15
|
+
* 提供 App 运行所需的环境信息和能力。
|
|
16
|
+
*
|
|
17
|
+
* [设计说明]
|
|
18
|
+
* - AOTUI App 的状态 = DOM 内容,由 Desktop.serialize() 管理
|
|
19
|
+
* - 业务数据持久化由 Product Layer 负责 (如 messageService)
|
|
20
|
+
* - 不再提供 per-app store,简化 API
|
|
21
|
+
*/
|
|
22
|
+
export interface AppContext {
|
|
23
|
+
/** 所属 Desktop ID */
|
|
24
|
+
readonly desktopId: DesktopID;
|
|
25
|
+
/** 当前 App ID */
|
|
26
|
+
readonly appId: AppID;
|
|
27
|
+
/**
|
|
28
|
+
* [Option D] 标记该 App 需要更新
|
|
29
|
+
*
|
|
30
|
+
* 不立即触发 UpdateSignal,而是等待 DOM_UPDATE 到达后才发送。
|
|
31
|
+
* 这解决了 signal 变化 → notifyUpdate → snapshot 读取旧 DOM 的竞态问题。
|
|
32
|
+
*
|
|
33
|
+
* [Approach D] 同时触发 forceRender 回调进行同步渲染。
|
|
34
|
+
*/
|
|
35
|
+
markDirty(): void;
|
|
36
|
+
/**
|
|
37
|
+
* [Approach D] 注册渲染回调
|
|
38
|
+
*
|
|
39
|
+
* ViewBasedApp 在 onOpen 时注册此回调,当 markDirty() 被调用时
|
|
40
|
+
* Worker 会同步调用此回调以强制 Preact 重渲染。
|
|
41
|
+
*
|
|
42
|
+
* @param callback 渲染回调函数 (通常是 renderAllViews)
|
|
43
|
+
*/
|
|
44
|
+
onRender(callback: () => void): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.interface.js","sourceRoot":"","sources":["../../../src/spi/app/store.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Level 1: ViewContext Core Contract
|
|
3
|
+
*
|
|
4
|
+
* Defines the minimal contract between Runtime and App (SDK).
|
|
5
|
+
* This is the stable foundation for cross-boundary communication.
|
|
6
|
+
*/
|
|
7
|
+
import type { AppID, DesktopID, ViewID } from '../core/types.js';
|
|
8
|
+
import type { AppLaunchConfig } from './app-config.interface.js';
|
|
9
|
+
export interface IViewContextCore {
|
|
10
|
+
/** The App ID this view belongs to */
|
|
11
|
+
readonly appId: AppID;
|
|
12
|
+
/** The Desktop ID (used for loading related data, e.g. history) */
|
|
13
|
+
readonly desktopId: DesktopID;
|
|
14
|
+
/** This View's unique ID */
|
|
15
|
+
readonly viewId: ViewID;
|
|
16
|
+
/**
|
|
17
|
+
* The DOM container for this View.
|
|
18
|
+
*
|
|
19
|
+
* Created by the App within its DOM tree. The View renders its content into this container.
|
|
20
|
+
* Ensures "One App = One DOM".
|
|
21
|
+
*/
|
|
22
|
+
readonly container: HTMLElement;
|
|
23
|
+
/**
|
|
24
|
+
* The App's Document object.
|
|
25
|
+
*
|
|
26
|
+
* SDK uses this to create DOM elements, ensuring they belong to the correct Document.
|
|
27
|
+
* Solves cross-Document operation issues (e.g. linkedom).
|
|
28
|
+
*/
|
|
29
|
+
readonly document: Document;
|
|
30
|
+
/**
|
|
31
|
+
* App 启动配置
|
|
32
|
+
*
|
|
33
|
+
* 由 Runtime 在 App 启动时注入,包含环境变量和初始状态。
|
|
34
|
+
* SDK 通过此字段显式获取配置,而非依赖 globalThis。
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```tsx
|
|
38
|
+
* const ctx = useViewContext();
|
|
39
|
+
* const topicId = ctx.appConfig?.env?.AOTUI_TopicID;
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
readonly appConfig?: AppLaunchConfig;
|
|
43
|
+
/**
|
|
44
|
+
* Ref Exporter (Refactoring: Explicit Dependency)
|
|
45
|
+
*
|
|
46
|
+
* Allows SDK to register refs to the Runtime without relying on globals.
|
|
47
|
+
* [RFC-002] Ref Registry Refactoring
|
|
48
|
+
*/
|
|
49
|
+
readonly refExporter?: import('./ref-exporter.interface.js').IRefExporter;
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-context-core.interface.js","sourceRoot":"","sources":["../../../src/spi/app/view-context-core.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Level 3: ViewContext Extension Contract
|
|
3
|
+
*
|
|
4
|
+
* [RFC-006] ViewLink/View ID 解耦设计
|
|
5
|
+
*
|
|
6
|
+
* Defines extension capabilities for advanced features (e.g., Mountable Views, Re-indexing).
|
|
7
|
+
* These are optional capabilities that a Context implementation MAY support.
|
|
8
|
+
*/
|
|
9
|
+
import type { ViewID } from '../core/types.js';
|
|
10
|
+
import type { IView } from './view.interface.js';
|
|
11
|
+
/**
|
|
12
|
+
* ViewLink 注册选项
|
|
13
|
+
*/
|
|
14
|
+
export interface RegisterLinkOptions {
|
|
15
|
+
/**
|
|
16
|
+
* LinkID 前缀 (用于列表)
|
|
17
|
+
*
|
|
18
|
+
* SDK 会自动生成: `${prefix}_${index}`
|
|
19
|
+
* 不提供时使用 viewType 作为前缀
|
|
20
|
+
*/
|
|
21
|
+
prefix?: string;
|
|
22
|
+
/**
|
|
23
|
+
* 显示标签
|
|
24
|
+
*/
|
|
25
|
+
label?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Extension for ViewLink mechanism (Mountable Views).
|
|
29
|
+
*
|
|
30
|
+
* [RFC-006] 重新设计的 ViewLink API:
|
|
31
|
+
* - registerLink: 注册 ViewLink (返回 linkId)
|
|
32
|
+
* - unregisterLink: 注销 ViewLink
|
|
33
|
+
* - 保留旧 API 用于向后兼容
|
|
34
|
+
*/
|
|
35
|
+
export interface IViewContextMountable {
|
|
36
|
+
/**
|
|
37
|
+
* 注册一个 ViewLink
|
|
38
|
+
*
|
|
39
|
+
* @param uniqueId - 业务唯一标识 (跨快照稳定)
|
|
40
|
+
* @param viewType - View 类型名称 (IViewFactory.displayName)
|
|
41
|
+
* @param factory - View 工厂函数
|
|
42
|
+
* @param props - 传递给 View 的 Props
|
|
43
|
+
* @param options - 注册选项
|
|
44
|
+
* @returns 分配的 LinkID (父 View 内唯一)
|
|
45
|
+
*/
|
|
46
|
+
registerLink(uniqueId: string, viewType: string, factory: (viewId: string, props?: Record<string, unknown>) => IView, props?: Record<string, unknown>, options?: RegisterLinkOptions): string;
|
|
47
|
+
/**
|
|
48
|
+
* 注销一个 ViewLink
|
|
49
|
+
*
|
|
50
|
+
* @param linkId - 要注销的 LinkID
|
|
51
|
+
*/
|
|
52
|
+
unregisterLink(linkId: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* 获取已绑定的 ViewID (如果有)
|
|
55
|
+
*
|
|
56
|
+
* 用于 ViewLink 渲染时检查是否已有 mount 的 View
|
|
57
|
+
*
|
|
58
|
+
* @param viewType - View 类型名称
|
|
59
|
+
* @param uniqueId - 业务唯一标识
|
|
60
|
+
* @returns ViewID 或 undefined
|
|
61
|
+
*/
|
|
62
|
+
getBoundViewId(viewType: string, uniqueId: string): ViewID | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use registerLink instead
|
|
65
|
+
*/
|
|
66
|
+
registerMountableView(factory: (viewId: string, props?: Record<string, unknown>) => IView, props?: Record<string, unknown>, label?: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* @deprecated Use unregisterLink instead
|
|
69
|
+
*/
|
|
70
|
+
unregisterMountableView(viewId: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* @deprecated No longer supported in V2
|
|
73
|
+
*/
|
|
74
|
+
subscribeToReindex(callback: (idMapping: Map<string, string>) => void): () => void;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Type guard to check if a context supports Mountable View extensions.
|
|
78
|
+
*/
|
|
79
|
+
export declare function hasMountableSupport(ctx: unknown): ctx is IViewContextMountable;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Level 3: ViewContext Extension Contract
|
|
3
|
+
*
|
|
4
|
+
* [RFC-006] ViewLink/View ID 解耦设计
|
|
5
|
+
*
|
|
6
|
+
* Defines extension capabilities for advanced features (e.g., Mountable Views, Re-indexing).
|
|
7
|
+
* These are optional capabilities that a Context implementation MAY support.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Type guard to check if a context supports Mountable View extensions.
|
|
11
|
+
*/
|
|
12
|
+
export function hasMountableSupport(ctx) {
|
|
13
|
+
return (typeof ctx === 'object' &&
|
|
14
|
+
ctx !== null &&
|
|
15
|
+
typeof ctx.registerLink === 'function' &&
|
|
16
|
+
typeof ctx.unregisterLink === 'function' &&
|
|
17
|
+
typeof ctx.getBoundViewId === 'function');
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=view-context-ext.interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-context-ext.interface.js","sourceRoot":"","sources":["../../../src/spi/app/view-context-ext.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA0GH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC5C,OAAO,CACH,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,OAAQ,GAAW,CAAC,YAAY,KAAK,UAAU;QAC/C,OAAQ,GAAW,CAAC,cAAc,KAAK,UAAU;QACjD,OAAQ,GAAW,CAAC,cAAc,KAAK,UAAU,CACpD,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPI Layer - IViewFactory Interface
|
|
3
|
+
*
|
|
4
|
+
* View Factory 接口,由 SDK 提供,
|
|
5
|
+
* 用于创建 IView 实例。
|
|
6
|
+
*
|
|
7
|
+
* [方案 B] 从 SDK 提升到 SPI 层,使 Runtime 可以引用此类型
|
|
8
|
+
* 而不依赖 SDK 具体实现。
|
|
9
|
+
*
|
|
10
|
+
* @module @aotui/runtime/spi/app
|
|
11
|
+
*/
|
|
12
|
+
import type { IView } from './view.interface.js';
|
|
13
|
+
/**
|
|
14
|
+
* View Factory Interface
|
|
15
|
+
*
|
|
16
|
+
* 工厂函数,用于创建 IView 实例。
|
|
17
|
+
* SDK 返回符合此接口的工厂。
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* // SDK 端
|
|
22
|
+
* const ChatView = (viewId: string) => new ChatViewImpl(viewId);
|
|
23
|
+
*
|
|
24
|
+
* // Runtime 端
|
|
25
|
+
* const view: IView = ChatView('view_0');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export interface IViewFactory {
|
|
29
|
+
/**
|
|
30
|
+
* 创建 View 实例
|
|
31
|
+
* @param viewId - View 唯一标识符
|
|
32
|
+
* @param props - 可选的初始属性
|
|
33
|
+
* @returns IView 实例
|
|
34
|
+
*/
|
|
35
|
+
(viewId: string, props?: Record<string, unknown>): IView;
|
|
36
|
+
/**
|
|
37
|
+
* View 显示名称
|
|
38
|
+
* 用于 ViewTree 输出和调试信息
|
|
39
|
+
*/
|
|
40
|
+
displayName?: string;
|
|
41
|
+
/**
|
|
42
|
+
* 可选:统一工厂接口
|
|
43
|
+
* 与直接调用等价:factory.create(id) === factory(id)
|
|
44
|
+
*/
|
|
45
|
+
create?: (viewId: string, props?: Record<string, unknown>) => IView;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-factory.interface.js","sourceRoot":"","sources":["../../../src/spi/app/view-factory.interface.ts"],"names":[],"mappings":""}
|