@ankhorage/runtime 5.4.8 → 5.5.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/RuntimeRendererConfig.d.ts +2 -0
  4. package/dist/RuntimeRendererConfig.d.ts.map +1 -1
  5. package/dist/RuntimeRendererConfig.js +1 -0
  6. package/dist/RuntimeRendererConfig.js.map +1 -1
  7. package/dist/RuntimeScreen.d.ts.map +1 -1
  8. package/dist/RuntimeScreen.js +2 -1
  9. package/dist/RuntimeScreen.js.map +1 -1
  10. package/dist/executeRuntimeFlowCapabilityAsync.d.ts +5 -0
  11. package/dist/executeRuntimeFlowCapabilityAsync.d.ts.map +1 -0
  12. package/dist/executeRuntimeFlowCapabilityAsync.js +246 -0
  13. package/dist/executeRuntimeFlowCapabilityAsync.js.map +1 -0
  14. package/dist/index.d.ts +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/dist/runtimeCapabilityExecutor.d.ts +2 -0
  18. package/dist/runtimeCapabilityExecutor.d.ts.map +1 -1
  19. package/dist/runtimeCapabilityExecutor.js +8 -5
  20. package/dist/runtimeCapabilityExecutor.js.map +1 -1
  21. package/dist/types/runtimeFlow.d.ts +22 -0
  22. package/dist/types/runtimeFlow.d.ts.map +1 -0
  23. package/dist/types/runtimeFlow.js +2 -0
  24. package/dist/types/runtimeFlow.js.map +1 -0
  25. package/package.json +3 -2
  26. package/paradox/badges/npm.svg +3 -3
  27. package/paradox/components.md +1 -1
  28. package/paradox/diagrams/architecture-overview.mmd +20 -0
  29. package/paradox/diagrams/export-graph.mmd +11 -0
  30. package/paradox/diagrams/module-relationships.mmd +16 -0
  31. package/paradox/exports.json +108 -10
  32. package/paradox/exports.md +33 -9
  33. package/paradox/index.html +393 -53
  34. package/paradox/paradox.json +1095 -161
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhorage/runtime
2
2
 
3
+ ## 5.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 927d4b2: Add generated-app Flow start, status, cancellation, approval, and event actions through an injected remote Runtime port.
8
+
9
+ ## 5.4.9
10
+
11
+ ### Patch Changes
12
+
13
+ - 5326767: Update dependencies: `@ankhorage/data-sources`.
14
+
3
15
  ## 5.4.8
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Ankhorage Runtime
5
5
 
6
- ![license: MIT](./paradox/badges/license.svg) ![npm: v5.4.8](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![paradox: warnings](./paradox/badges/docs.svg)
6
+ ![license: MIT](./paradox/badges/license.svg) ![npm: v5.5.0](./paradox/badges/npm.svg) ![runtime: bun](./paradox/badges/runtime.svg) ![typescript: strict](./paradox/badges/typescript.svg) ![eslint: checked](./paradox/badges/eslint.svg) ![prettier: checked](./paradox/badges/prettier.svg) ![build: checked](./paradox/badges/build.svg) ![tests: checked](./paradox/badges/tests.svg) ![paradox: warnings](./paradox/badges/docs.svg)
7
7
 
8
8
  Renders Ankhorage application manifests and resolves their runtime bindings, capabilities, events, media, screens, and state.
9
9
 
@@ -6,6 +6,7 @@ import type { RuntimeEventCapabilityResolver } from './runtimeActionRegistry.js'
6
6
  import type { RuntimeBindingResultCache, RuntimeBindingResultWriter, RuntimeCapabilityExecutor } from './runtimeBindings.js';
7
7
  import type { RuntimeEventOperationLifecycle, RuntimeEventOperationState } from './runtimeEventOperationLifecycle.js';
8
8
  import type { RuntimeMediaAssetResolver } from './runtimeMedia.js';
9
+ import type { RuntimeFlowPort } from './types/runtimeFlow.js';
9
10
  export type { RuntimeNodePropsResolver, RuntimeResolveNodePropsArgs, } from '@ankhorage/contracts/runtime';
10
11
  export interface RuntimeRendererWrapArgs {
11
12
  node: UiNode;
@@ -27,6 +28,7 @@ export interface RuntimeRendererConfig {
27
28
  resultSlots?: RuntimeBindingResultCache;
28
29
  writeResultSlot?: RuntimeBindingResultWriter;
29
30
  executeCapability?: RuntimeCapabilityExecutor;
31
+ flowPort?: RuntimeFlowPort;
30
32
  resolveEventCapability?: RuntimeEventCapabilityResolver;
31
33
  onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;
32
34
  eventOperationLifecycle?: RuntimeEventOperationLifecycle;
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeRendererConfig.d.ts","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,oBAAoB,EACpB,SAAS,EACT,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAA6B,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAC;AACjF,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,8BAA8B,EAC9B,0BAA0B,EAC3B,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAEnE,YAAY,EACV,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IA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AED,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,qBAAqB,GAAG,SAAS,EAC9C,eAAe,EAAE,qBAAqB,GAAG,SAAS,GACjD,qBAAqB,CAsCvB;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAQA;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,CAEhE"}
@@ -44,6 +44,7 @@ export function mergeRuntimeRendererConfig(localConfig, inheritedConfig) {
44
44
  resultSlots,
45
45
  writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,
46
46
  executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,
47
+ flowPort: localConfig?.flowPort ?? inheritedConfig?.flowPort,
47
48
  resolveEventCapability: localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,
48
49
  onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,
49
50
  eventOperationLifecycle: localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeRendererConfig.js","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],"mappings":";AAUA,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA+ClD,MAAM,6BAA6B,GAA0B,EAAE,CAAC;AAEhE,MAAM,4BAA4B,GAAG,aAAa,CAChD,6BAA6B,CAC9B,CAAC;AAEF,MAAM,UAAU,8BAA8B,CAC5C,aAAiD,EACjD,aAAiD;IAEjD,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,IAAI,CAAC,aAAa,EAAE,CAAC;QACnB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,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,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE3C,OAAO;QACL,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n ComponentDataBindingRegistry,\n DataSourceDiagnostic,\n DbAdapter,\n DbRealtimeAdapter,\n MediaAssetRegistry,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport type { RuntimeNodePropsResolver } from '@ankhorage/contracts/runtime';\nimport React, { createContext, use } from 'react';\n\nimport type { ComponentRegistry } from './registry.js';\nimport type { RuntimeEventCapabilityResolver } from './runtimeActionRegistry.js';\nimport type {\n RuntimeBindingResultCache,\n RuntimeBindingResultWriter,\n RuntimeCapabilityExecutor,\n} from './runtimeBindings.js';\nimport type {\n RuntimeEventOperationLifecycle,\n RuntimeEventOperationState,\n} from './runtimeEventOperationLifecycle.js';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia.js';\n\nexport type {\n RuntimeNodePropsResolver,\n RuntimeResolveNodePropsArgs,\n} from '@ankhorage/contracts/runtime';\n\nexport interface RuntimeRendererWrapArgs {\n node: UiNode;\n rendered: React.ReactNode;\n isRoot: boolean;\n}\n\nexport interface RuntimeRendererConfig {\n disableActions?: boolean;\n registry?: ComponentRegistry;\n wrapNode?: (args: RuntimeRendererWrapArgs) => React.ReactNode;\n resolveNodeProps?: RuntimeNodePropsResolver;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n mediaAssets?: MediaAssetRegistry;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n stateAdapter?: StateAdapter;\n bindingContext?: Record<string, unknown>;\n dataBindings?: ComponentDataBindingRegistry;\n resultSlots?: RuntimeBindingResultCache;\n writeResultSlot?: RuntimeBindingResultWriter;\n executeCapability?: RuntimeCapabilityExecutor;\n resolveEventCapability?: RuntimeEventCapabilityResolver;\n onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;\n eventOperationLifecycle?: RuntimeEventOperationLifecycle;\n eventOperationState?: RuntimeEventOperationState;\n}\n\nconst EMPTY_RUNTIME_RENDERER_CONFIG: RuntimeRendererConfig = {};\n\nconst RuntimeRendererConfigContext = createContext<RuntimeRendererConfig>(\n EMPTY_RUNTIME_RENDERER_CONFIG,\n);\n\nexport function composeRuntimeRendererWrapNode(\n innerWrapNode?: RuntimeRendererConfig['wrapNode'],\n outerWrapNode?: RuntimeRendererConfig['wrapNode'],\n): RuntimeRendererConfig['wrapNode'] {\n if (!innerWrapNode) {\n return outerWrapNode;\n }\n\n if (!outerWrapNode) {\n return innerWrapNode;\n }\n\n return (args) => outerWrapNode({ ...args, rendered: innerWrapNode(args) });\n}\n\nexport function composeRuntimeNodePropsResolver(\n localResolver?: RuntimeRendererConfig['resolveNodeProps'],\n inheritedResolver?: RuntimeRendererConfig['resolveNodeProps'],\n): RuntimeRendererConfig['resolveNodeProps'] {\n if (!localResolver) {\n return inheritedResolver;\n }\n\n if (!inheritedResolver) {\n return localResolver;\n }\n\n return (args) => {\n const inheritedProps = inheritedResolver(args);\n return localResolver({ ...args, props: inheritedProps });\n };\n}\n\nexport function mergeRuntimeRendererConfig(\n localConfig: RuntimeRendererConfig | undefined,\n inheritedConfig: RuntimeRendererConfig | undefined,\n): RuntimeRendererConfig {\n if (!localConfig && !inheritedConfig) {\n return EMPTY_RUNTIME_RENDERER_CONFIG;\n }\n\n const bindingContext = mergeRecordConfig(\n inheritedConfig?.bindingContext,\n localConfig?.bindingContext,\n );\n const resultSlots = mergeRecordConfig(inheritedConfig?.resultSlots, localConfig?.resultSlots);\n\n return {\n disableActions:\n localConfig?.disableActions === true || inheritedConfig?.disableActions === true,\n registry: localConfig?.registry ?? inheritedConfig?.registry,\n wrapNode: composeRuntimeRendererWrapNode(localConfig?.wrapNode, inheritedConfig?.wrapNode),\n resolveNodeProps: composeRuntimeNodePropsResolver(\n localConfig?.resolveNodeProps,\n inheritedConfig?.resolveNodeProps,\n ),\n resolveMediaAsset: localConfig?.resolveMediaAsset ?? inheritedConfig?.resolveMediaAsset,\n mediaAssets: localConfig?.mediaAssets ?? inheritedConfig?.mediaAssets,\n dbAdapter: localConfig?.dbAdapter ?? inheritedConfig?.dbAdapter,\n dbRealtimeAdapter: localConfig?.dbRealtimeAdapter ?? inheritedConfig?.dbRealtimeAdapter,\n stateAdapter: localConfig?.stateAdapter ?? inheritedConfig?.stateAdapter,\n bindingContext,\n dataBindings: localConfig?.dataBindings ?? inheritedConfig?.dataBindings,\n resultSlots,\n writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,\n executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,\n resolveEventCapability:\n localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,\n onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,\n eventOperationLifecycle:\n localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,\n eventOperationState: localConfig?.eventOperationState ?? inheritedConfig?.eventOperationState,\n };\n}\n\nexport function RuntimeRendererConfigProvider(props: {\n value: RuntimeRendererConfig;\n children: React.ReactNode;\n}) {\n const { value, children } = props;\n const inheritedConfig = use(RuntimeRendererConfigContext);\n const mergedConfig = mergeRuntimeRendererConfig(value, inheritedConfig);\n\n return (\n <RuntimeRendererConfigContext value={mergedConfig}>{children}</RuntimeRendererConfigContext>\n );\n}\n\nexport function useRuntimeRendererConfig(): RuntimeRendererConfig {\n return use(RuntimeRendererConfigContext);\n}\n\nfunction mergeRecordConfig<TValue>(\n inherited: Readonly<Record<string, TValue>> | undefined,\n local: Readonly<Record<string, TValue>> | undefined,\n): Record<string, TValue> | undefined {\n if (!inherited && !local) return undefined;\n\n return {\n ...(inherited ?? {}),\n ...(local ?? {}),\n };\n}\n"]}
1
+ {"version":3,"file":"RuntimeRendererConfig.js","sourceRoot":"","sources":["../src/RuntimeRendererConfig.tsx"],"names":[],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F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,KAG7C;IACC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAClC,MAAM,eAAe,GAAG,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,0BAA0B,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAExE,OAAO,CACL,KAAC,4BAA4B,IAAC,KAAK,EAAE,YAAY,YAAG,QAAQ,GAAgC,CAC7F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,GAAG,CAAC,4BAA4B,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CACxB,SAAuD,EACvD,KAAmD;IAEnD,IAAI,CAAC,SAAS,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAE3C,OAAO;QACL,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;QACpB,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;KACjB,CAAC;AACJ,CAAC","sourcesContent":["import type {\n ComponentDataBindingRegistry,\n DataSourceDiagnostic,\n DbAdapter,\n DbRealtimeAdapter,\n MediaAssetRegistry,\n StateAdapter,\n UiNode,\n} from '@ankhorage/contracts';\nimport type { RuntimeNodePropsResolver } from '@ankhorage/contracts/runtime';\nimport React, { createContext, use } from 'react';\n\nimport type { ComponentRegistry } from './registry.js';\nimport type { RuntimeEventCapabilityResolver } from './runtimeActionRegistry.js';\nimport type {\n RuntimeBindingResultCache,\n RuntimeBindingResultWriter,\n RuntimeCapabilityExecutor,\n} from './runtimeBindings.js';\nimport type {\n RuntimeEventOperationLifecycle,\n RuntimeEventOperationState,\n} from './runtimeEventOperationLifecycle.js';\nimport type { RuntimeMediaAssetResolver } from './runtimeMedia.js';\nimport type { RuntimeFlowPort } from './types/runtimeFlow.js';\n\nexport type {\n RuntimeNodePropsResolver,\n RuntimeResolveNodePropsArgs,\n} from '@ankhorage/contracts/runtime';\n\nexport interface RuntimeRendererWrapArgs {\n node: UiNode;\n rendered: React.ReactNode;\n isRoot: boolean;\n}\n\nexport interface RuntimeRendererConfig {\n disableActions?: boolean;\n registry?: ComponentRegistry;\n wrapNode?: (args: RuntimeRendererWrapArgs) => React.ReactNode;\n resolveNodeProps?: RuntimeNodePropsResolver;\n resolveMediaAsset?: RuntimeMediaAssetResolver;\n mediaAssets?: MediaAssetRegistry;\n dbAdapter?: DbAdapter;\n dbRealtimeAdapter?: DbRealtimeAdapter;\n stateAdapter?: StateAdapter;\n bindingContext?: Record<string, unknown>;\n dataBindings?: ComponentDataBindingRegistry;\n resultSlots?: RuntimeBindingResultCache;\n writeResultSlot?: RuntimeBindingResultWriter;\n executeCapability?: RuntimeCapabilityExecutor;\n flowPort?: RuntimeFlowPort;\n resolveEventCapability?: RuntimeEventCapabilityResolver;\n onDiagnostics?: (diagnostics: readonly DataSourceDiagnostic[]) => void;\n eventOperationLifecycle?: RuntimeEventOperationLifecycle;\n eventOperationState?: RuntimeEventOperationState;\n}\n\nconst EMPTY_RUNTIME_RENDERER_CONFIG: RuntimeRendererConfig = {};\n\nconst RuntimeRendererConfigContext = createContext<RuntimeRendererConfig>(\n EMPTY_RUNTIME_RENDERER_CONFIG,\n);\n\nexport function composeRuntimeRendererWrapNode(\n innerWrapNode?: RuntimeRendererConfig['wrapNode'],\n outerWrapNode?: RuntimeRendererConfig['wrapNode'],\n): RuntimeRendererConfig['wrapNode'] {\n if (!innerWrapNode) {\n return outerWrapNode;\n }\n\n if (!outerWrapNode) {\n return innerWrapNode;\n }\n\n return (args) => outerWrapNode({ ...args, rendered: innerWrapNode(args) });\n}\n\nexport function composeRuntimeNodePropsResolver(\n localResolver?: RuntimeRendererConfig['resolveNodeProps'],\n inheritedResolver?: RuntimeRendererConfig['resolveNodeProps'],\n): RuntimeRendererConfig['resolveNodeProps'] {\n if (!localResolver) {\n return inheritedResolver;\n }\n\n if (!inheritedResolver) {\n return localResolver;\n }\n\n return (args) => {\n const inheritedProps = inheritedResolver(args);\n return localResolver({ ...args, props: inheritedProps });\n };\n}\n\nexport function mergeRuntimeRendererConfig(\n localConfig: RuntimeRendererConfig | undefined,\n inheritedConfig: RuntimeRendererConfig | undefined,\n): RuntimeRendererConfig {\n if (!localConfig && !inheritedConfig) {\n return EMPTY_RUNTIME_RENDERER_CONFIG;\n }\n\n const bindingContext = mergeRecordConfig(\n inheritedConfig?.bindingContext,\n localConfig?.bindingContext,\n );\n const resultSlots = mergeRecordConfig(inheritedConfig?.resultSlots, localConfig?.resultSlots);\n\n return {\n disableActions:\n localConfig?.disableActions === true || inheritedConfig?.disableActions === true,\n registry: localConfig?.registry ?? inheritedConfig?.registry,\n wrapNode: composeRuntimeRendererWrapNode(localConfig?.wrapNode, inheritedConfig?.wrapNode),\n resolveNodeProps: composeRuntimeNodePropsResolver(\n localConfig?.resolveNodeProps,\n inheritedConfig?.resolveNodeProps,\n ),\n resolveMediaAsset: localConfig?.resolveMediaAsset ?? inheritedConfig?.resolveMediaAsset,\n mediaAssets: localConfig?.mediaAssets ?? inheritedConfig?.mediaAssets,\n dbAdapter: localConfig?.dbAdapter ?? inheritedConfig?.dbAdapter,\n dbRealtimeAdapter: localConfig?.dbRealtimeAdapter ?? inheritedConfig?.dbRealtimeAdapter,\n stateAdapter: localConfig?.stateAdapter ?? inheritedConfig?.stateAdapter,\n bindingContext,\n dataBindings: localConfig?.dataBindings ?? inheritedConfig?.dataBindings,\n resultSlots,\n writeResultSlot: localConfig?.writeResultSlot ?? inheritedConfig?.writeResultSlot,\n executeCapability: localConfig?.executeCapability ?? inheritedConfig?.executeCapability,\n flowPort: localConfig?.flowPort ?? inheritedConfig?.flowPort,\n resolveEventCapability:\n localConfig?.resolveEventCapability ?? inheritedConfig?.resolveEventCapability,\n onDiagnostics: localConfig?.onDiagnostics ?? inheritedConfig?.onDiagnostics,\n eventOperationLifecycle:\n localConfig?.eventOperationLifecycle ?? inheritedConfig?.eventOperationLifecycle,\n eventOperationState: localConfig?.eventOperationState ?? inheritedConfig?.eventOperationState,\n };\n}\n\nexport function RuntimeRendererConfigProvider(props: {\n value: RuntimeRendererConfig;\n children: React.ReactNode;\n}) {\n const { value, children } = props;\n const inheritedConfig = use(RuntimeRendererConfigContext);\n const mergedConfig = mergeRuntimeRendererConfig(value, inheritedConfig);\n\n return (\n <RuntimeRendererConfigContext value={mergedConfig}>{children}</RuntimeRendererConfigContext>\n );\n}\n\nexport function useRuntimeRendererConfig(): RuntimeRendererConfig {\n return use(RuntimeRendererConfigContext);\n}\n\nfunction mergeRecordConfig<TValue>(\n inherited: Readonly<Record<string, TValue>> | undefined,\n local: Readonly<Record<string, TValue>> | undefined,\n): Record<string, TValue> | undefined {\n if (!inherited && !local) return undefined;\n\n return {\n ...(inherited ?? {}),\n ...(local ?? {}),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeScreen.d.ts","sourceRoot":"","sources":["../src/RuntimeScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA4CtD"}
1
+ {"version":3,"file":"RuntimeScreen.d.ts","sourceRoot":"","sources":["../src/RuntimeScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAQvD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;IAC/B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,qBA6CtD"}
@@ -17,8 +17,9 @@ export function RuntimeScreen(props) {
17
17
  const executeCapability = React.useMemo(() => composeRuntimeCapabilityExecutor({
18
18
  apiCapabilityExecutor,
19
19
  capabilityExecutor: runtimeConfig.executeCapability,
20
+ flowPort: runtimeConfig.flowPort,
20
21
  stateAdapter,
21
- }), [apiCapabilityExecutor, runtimeConfig.executeCapability, stateAdapter]);
22
+ }), [apiCapabilityExecutor, runtimeConfig.executeCapability, runtimeConfig.flowPort, stateAdapter]);
22
23
  const screenOperationLoaders = useRuntimeScreenOperationLoaders({
23
24
  bindingContext: runtimeConfig.bindingContext,
24
25
  executeCapability,
@@ -1 +1 @@
1
- {"version":3,"file":"RuntimeScreen.js","sourceRoot":"","sources":["../src/RuntimeScreen.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAA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C,CAAC;IAEH,OAAO,CACL,KAAC,eAAe,IAEd,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,MAAM,QACN,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,QAAQ,CAAC,YAAY,EACnC,WAAW,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EACnC,WAAW,EAAE,sBAAsB,CAAC,WAAW,EAC/C,iBAAiB,EAAE,iBAAiB,IAR/B,GAAG,MAAM,CAAC,EAAE,IAAI,sBAAsB,CAAC,aAAa,EAAE,CAS3D,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { AppManifest, ScreenSpec, StateAdapter } from '@ankhorage/contracts';\nimport React from 'react';\n\nimport { useOptionalManifestContext } from './ManifestContext.js';\nimport type { ComponentRegistry } from './registry.js';\nimport { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities.js';\nimport { composeRuntimeCapabilityExecutor } from './runtimeCapabilityExecutor.js';\nimport { RuntimeRenderer } from './RuntimeRenderer.js';\nimport { useRuntimeRendererConfig } from './RuntimeRendererConfig.js';\nimport { useRuntimeScreenOperationLoaders } from './runtimeScreenLoaders.js';\nimport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter.js';\n\nexport interface RuntimeScreenProps {\n readonly manifest: AppManifest;\n readonly screen: ScreenSpec;\n readonly registry?: ComponentRegistry;\n readonly stateAdapter?: StateAdapter;\n}\n\nexport function RuntimeScreen(props: RuntimeScreenProps) {\n const { manifest, screen, registry, stateAdapter: injectedStateAdapter } = props;\n const runtimeConfig = useRuntimeRendererConfig();\n const manifestContext = useOptionalManifestContext();\n const fallbackStateAdapter = React.useMemo(\n () => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined),\n [manifest.state?.provider],\n );\n const stateAdapter =\n injectedStateAdapter ?? manifestContext?.stateAdapter ?? fallbackStateAdapter;\n const apiCapabilityExecutor = React.useMemo(\n () => createRuntimeApiCapabilityExecutor({ apis: manifest.infra.apis ?? {} }),\n [manifest.infra.apis],\n );\n const executeCapability = React.useMemo(\n () =>\n composeRuntimeCapabilityExecutor({\n apiCapabilityExecutor,\n capabilityExecutor: runtimeConfig.executeCapability,\n stateAdapter,\n }),\n [apiCapabilityExecutor, runtimeConfig.executeCapability, stateAdapter],\n );\n const screenOperationLoaders = useRuntimeScreenOperationLoaders({\n bindingContext: runtimeConfig.bindingContext,\n executeCapability,\n resultSlots: runtimeConfig.resultSlots,\n onDiagnostics: runtimeConfig.onDiagnostics,\n screen,\n });\n\n return (\n <RuntimeRenderer\n key={`${screen.id}:${screenOperationLoaders.renderVersion}`}\n node={screen.root}\n isRoot\n registry={registry}\n stateAdapter={stateAdapter}\n dataBindings={manifest.dataBindings}\n mediaAssets={manifest.media?.assets}\n resultSlots={screenOperationLoaders.resultSlots}\n executeCapability={executeCapability}\n />\n );\n}\n"]}
1
+ {"version":3,"file":"RuntimeScreen.js","sourceRoot":"","sources":["../src/RuntimeScreen.tsx"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AAElE,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAS3E,MAAM,UAAU,aAAa,CAAC,KAAyB;IACrD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC;IACjF,MAAM,aAAa,GAAG,wBAAwB,EAAE,CAAC;IACjD,MAAM,eAA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,EACnC,WAAW,EAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,EACnC,WAAW,EAAE,sBAAsB,CAAC,WAAW,EAC/C,iBAAiB,EAAE,iBAAiB,IAR/B,GAAG,MAAM,CAAC,EAAE,IAAI,sBAAsB,CAAC,aAAa,EAAE,CAS3D,CACH,CAAC;AACJ,CAAC","sourcesContent":["import type { AppManifest, ScreenSpec, StateAdapter } from '@ankhorage/contracts';\nimport React from 'react';\n\nimport { useOptionalManifestContext } from './ManifestContext.js';\nimport type { ComponentRegistry } from './registry.js';\nimport { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities.js';\nimport { composeRuntimeCapabilityExecutor } from './runtimeCapabilityExecutor.js';\nimport { RuntimeRenderer } from './RuntimeRenderer.js';\nimport { useRuntimeRendererConfig } from './RuntimeRendererConfig.js';\nimport { useRuntimeScreenOperationLoaders } from './runtimeScreenLoaders.js';\nimport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter.js';\n\nexport interface RuntimeScreenProps {\n readonly manifest: AppManifest;\n readonly screen: ScreenSpec;\n readonly registry?: ComponentRegistry;\n readonly stateAdapter?: StateAdapter;\n}\n\nexport function RuntimeScreen(props: RuntimeScreenProps) {\n const { manifest, screen, registry, stateAdapter: injectedStateAdapter } = props;\n const runtimeConfig = useRuntimeRendererConfig();\n const manifestContext = useOptionalManifestContext();\n const fallbackStateAdapter = React.useMemo(\n () => (manifest.state?.provider === 'legend' ? createRuntimeMemoryStateAdapter() : undefined),\n [manifest.state?.provider],\n );\n const stateAdapter =\n injectedStateAdapter ?? manifestContext?.stateAdapter ?? fallbackStateAdapter;\n const apiCapabilityExecutor = React.useMemo(\n () => createRuntimeApiCapabilityExecutor({ apis: manifest.infra.apis ?? {} }),\n [manifest.infra.apis],\n );\n const executeCapability = React.useMemo(\n () =>\n composeRuntimeCapabilityExecutor({\n apiCapabilityExecutor,\n capabilityExecutor: runtimeConfig.executeCapability,\n flowPort: runtimeConfig.flowPort,\n stateAdapter,\n }),\n [apiCapabilityExecutor, runtimeConfig.executeCapability, runtimeConfig.flowPort, stateAdapter],\n );\n const screenOperationLoaders = useRuntimeScreenOperationLoaders({\n bindingContext: runtimeConfig.bindingContext,\n executeCapability,\n resultSlots: runtimeConfig.resultSlots,\n onDiagnostics: runtimeConfig.onDiagnostics,\n screen,\n });\n\n return (\n <RuntimeRenderer\n key={`${screen.id}:${screenOperationLoaders.renderVersion}`}\n node={screen.root}\n isRoot\n registry={registry}\n stateAdapter={stateAdapter}\n dataBindings={manifest.dataBindings}\n mediaAssets={manifest.media?.assets}\n resultSlots={screenOperationLoaders.resultSlots}\n executeCapability={executeCapability}\n />\n );\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { RuntimeCapabilityExecutionArgs, RuntimeCapabilityExecutionResult } from './runtimeBindings.js';
2
+ import type { RuntimeFlowPort } from './types/runtimeFlow.js';
3
+ /*** Executes supported Flow actions through the host-owned remote Flow port. */
4
+ export declare function executeRuntimeFlowCapabilityAsync(args: RuntimeCapabilityExecutionArgs, flowPort: RuntimeFlowPort | undefined): Promise<RuntimeCapabilityExecutionResult>;
5
+ //# sourceMappingURL=executeRuntimeFlowCapabilityAsync.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeRuntimeFlowCapabilityAsync.d.ts","sourceRoot":"","sources":["../src/executeRuntimeFlowCapabilityAsync.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAA2B,MAAM,wBAAwB,CAAC;AAEvF,gFAAgF;AAChF,wBAAsB,iCAAiC,CACrD,IAAI,EAAE,8BAA8B,EACpC,QAAQ,EAAE,eAAe,GAAG,SAAS,GACpC,OAAO,CAAC,gCAAgC,CAAC,CAc3C"}
@@ -0,0 +1,246 @@
1
+ import { isSerializableValue, } from '@ankhorage/contracts';
2
+ import { isRecord } from '@ankhorage/utility/object';
3
+ /*** Executes supported Flow actions through the host-owned remote Flow port. */
4
+ export async function executeRuntimeFlowCapabilityAsync(args, flowPort) {
5
+ if (flowPort === undefined)
6
+ return missingFlowPortResult(args.capability);
7
+ try {
8
+ if (args.capability === 'flow.start')
9
+ return await startFlowAsync(args.input, flowPort);
10
+ if (args.capability === 'flow.status')
11
+ return await readFlowStatusAsync(args.input, flowPort);
12
+ if (args.capability === 'flow.cancel')
13
+ return await cancelFlowAsync(args.input, flowPort);
14
+ if (args.capability === 'flow.approval')
15
+ return await resolveFlowApprovalAsync(args.input, flowPort);
16
+ if (args.capability === 'flow.events')
17
+ return await readFlowEventsAsync(args.input, flowPort);
18
+ return unsupportedFlowCapabilityResult(args.capability);
19
+ }
20
+ catch (error) {
21
+ return flowRequestErrorResult(error);
22
+ }
23
+ }
24
+ /*** Starts one published Flow revision after validating its portable binding input. */
25
+ async function startFlowAsync(input, flowPort) {
26
+ const request = resolveFlowStartRequest(input);
27
+ if (request === undefined)
28
+ return invalidFlowInputResult('flow.start');
29
+ const run = await flowPort.startAsync(request);
30
+ if (run.flow.id !== request.flow.id || run.flow.version !== request.flow.version)
31
+ return flowRevisionMismatchResult();
32
+ return successfulFlowResult(run);
33
+ }
34
+ /*** Reads the current snapshot for a previously started Flow run. */
35
+ async function readFlowStatusAsync(input, flowPort) {
36
+ const runId = resolveRunId(input);
37
+ if (runId === undefined)
38
+ return invalidFlowInputResult('flow.status');
39
+ return foundFlowResult(await flowPort.statusAsync(runId), 'Flow run');
40
+ }
41
+ /*** Requests cancellation through the remote owner rather than executing a local Flow engine. */
42
+ async function cancelFlowAsync(input, flowPort) {
43
+ const runId = resolveRunId(input);
44
+ if (runId === undefined)
45
+ return invalidFlowInputResult('flow.cancel');
46
+ return foundFlowResult(await flowPort.cancelAsync(runId), 'Flow run');
47
+ }
48
+ /*** Resolves one pending human approval through the authenticated remote Flow adapter. */
49
+ async function resolveFlowApprovalAsync(input, flowPort) {
50
+ const request = resolveApprovalRequest(input);
51
+ if (request === undefined)
52
+ return invalidFlowInputResult('flow.approval');
53
+ return foundFlowResult(await flowPort.resolveApprovalAsync(request), 'Flow approval');
54
+ }
55
+ /*** Reads resumable, redaction-safe Flow events after the supplied cursor. */
56
+ async function readFlowEventsAsync(input, flowPort) {
57
+ const request = resolveEventsRequest(input);
58
+ if (request === undefined)
59
+ return invalidFlowInputResult('flow.events');
60
+ return successfulFlowResult(await flowPort.eventsAsync(request));
61
+ }
62
+ /*** Narrows authored flow-start bindings to the released Flow trigger request shape. */
63
+ function resolveFlowStartRequest(input) {
64
+ if (!isRecord(input))
65
+ return undefined;
66
+ const { flow, idempotencyKey, input: flowInput, triggerId } = input;
67
+ if (!isFlowDefinitionRef(flow) ||
68
+ !isNonEmptyString(idempotencyKey) ||
69
+ !isNonEmptyString(triggerId) ||
70
+ (flowInput !== undefined && !isFlowInput(flowInput)))
71
+ return undefined;
72
+ return {
73
+ flow,
74
+ idempotencyKey,
75
+ ...(flowInput === undefined ? {} : { input: flowInput }),
76
+ triggerId,
77
+ };
78
+ }
79
+ /*** Narrows status and cancellation actions to one stable Flow run identity. */
80
+ function resolveRunId(input) {
81
+ return isRecord(input) && isNonEmptyString(input.runId) ? input.runId : undefined;
82
+ }
83
+ /*** Narrows a portable approval decision without accepting server-owned actor identity. */
84
+ function resolveApprovalRequest(input) {
85
+ if (!isRecord(input) ||
86
+ !isNonEmptyString(input.approvalId) ||
87
+ typeof input.approved !== 'boolean')
88
+ return undefined;
89
+ return { approvalId: input.approvalId, approved: input.approved };
90
+ }
91
+ /*** Narrows a resumable event cursor and optional run filter. */
92
+ function resolveEventsRequest(input) {
93
+ if (!isRecord(input) || !isEventCursor(input.afterId))
94
+ return undefined;
95
+ if (input.runId !== undefined && !isNonEmptyString(input.runId))
96
+ return undefined;
97
+ return input.runId === undefined
98
+ ? { afterId: input.afterId }
99
+ : { afterId: input.afterId, runId: input.runId };
100
+ }
101
+ /*** Confirms a published immutable Flow definition reference before calling the host port. */
102
+ function isFlowDefinitionRef(value) {
103
+ return (isRecord(value) &&
104
+ isNonEmptyString(value.id) &&
105
+ typeof value.version === 'number' &&
106
+ Number.isSafeInteger(value.version) &&
107
+ value.version > 0);
108
+ }
109
+ /*** Confirms Flow's public inline input envelope without re-declaring its DTO locally. */
110
+ function isFlowInput(value) {
111
+ return (isRecord(value) &&
112
+ Object.values(value).every((entry) => isRecord(entry) &&
113
+ entry.kind === 'inline' &&
114
+ 'value' in entry &&
115
+ isTransportSerializableValue(entry.value)));
116
+ }
117
+ /*** Accepts a nonnegative integer event position so subscriptions can resume deterministically. */
118
+ function isEventCursor(value) {
119
+ return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;
120
+ }
121
+ /*** Rejects empty identifiers before a host adapter can issue a remote request. */
122
+ function isNonEmptyString(value) {
123
+ return typeof value === 'string' && value.trim().length > 0;
124
+ }
125
+ /*** Preserves Flow DTOs as runtime binding data after a successful remote operation. */
126
+ function successfulFlowResult(data) {
127
+ return isTransportSerializableValue(data)
128
+ ? { data, ok: true }
129
+ : {
130
+ diagnostics: [
131
+ {
132
+ code: 'invalid-provider-response',
133
+ message: 'The Flow provider returned a non-serializable response.',
134
+ severity: 'error',
135
+ },
136
+ ],
137
+ ok: false,
138
+ };
139
+ }
140
+ /*** Accepts only recursive values that retain their exact meaning across the Flow transport. */
141
+ function isTransportSerializableValue(value) {
142
+ return hasFiniteSerializableNumbers(value, new Set()) && isSerializableValue(value);
143
+ }
144
+ /*** Rejects non-finite numbers and cyclic objects that JSON transport cannot preserve. */
145
+ function hasFiniteSerializableNumbers(value, ancestors) {
146
+ if (typeof value === 'number')
147
+ return Number.isFinite(value);
148
+ if (value === null || typeof value !== 'object')
149
+ return true;
150
+ if (ancestors.has(value))
151
+ return false;
152
+ ancestors.add(value);
153
+ const valid = Array.isArray(value)
154
+ ? value.every((entry) => hasFiniteSerializableNumbers(entry, ancestors))
155
+ : Object.values(value).every((entry) => hasFiniteSerializableNumbers(entry, ancestors));
156
+ ancestors.delete(value);
157
+ return valid;
158
+ }
159
+ /*** Converts an absent Flow resource into a bindable not-found diagnostic. */
160
+ function foundFlowResult(data, resource) {
161
+ return data === undefined
162
+ ? {
163
+ diagnostics: [
164
+ {
165
+ code: 'flow-resource-not-found',
166
+ message: `${resource} was not found.`,
167
+ severity: 'error',
168
+ },
169
+ ],
170
+ ok: false,
171
+ }
172
+ : successfulFlowResult(data);
173
+ }
174
+ /*** Reports that the host has not configured the remote Flow capability boundary. */
175
+ function missingFlowPortResult(capability) {
176
+ return {
177
+ diagnostics: [
178
+ {
179
+ code: 'missing-adapter',
180
+ message: `Capability '${capability}' requires a configured RuntimeFlowPort.`,
181
+ severity: 'error',
182
+ },
183
+ ],
184
+ ok: false,
185
+ };
186
+ }
187
+ /*** Keeps malformed authored Flow inputs from reaching the remote provider boundary. */
188
+ function invalidFlowInputResult(capability) {
189
+ return {
190
+ diagnostics: [
191
+ {
192
+ code: 'invalid-input',
193
+ message: `Capability '${capability}' received an invalid Flow request.`,
194
+ severity: 'error',
195
+ },
196
+ ],
197
+ ok: false,
198
+ };
199
+ }
200
+ /*** Refuses Flow-prefixed actions that are not part of Runtime's released generated-app contract. */
201
+ function unsupportedFlowCapabilityResult(capability) {
202
+ return {
203
+ diagnostics: [
204
+ {
205
+ code: 'missing-operation',
206
+ message: `Flow capability '${capability}' is not supported by Runtime.`,
207
+ severity: 'error',
208
+ },
209
+ ],
210
+ ok: false,
211
+ };
212
+ }
213
+ /*** Converts untrusted host failures to fixed public categories without exposing adapter details. */
214
+ function flowRequestErrorResult(error) {
215
+ const errorCode = isRecord(error) ? error.code : undefined;
216
+ const safeErrors = [
217
+ { code: 'permission-denied', message: 'Flow access was denied.' },
218
+ { code: 'timeout', message: 'The Flow request timed out.' },
219
+ { code: 'unauthenticated', message: 'Flow authentication is required.' },
220
+ { code: 'offline', message: 'The Flow service is unavailable.' },
221
+ { code: 'not-found', message: 'The Flow resource was not found.' },
222
+ { code: 'rate-limited', message: 'The Flow request was rate limited.' },
223
+ { code: 'cancelled', message: 'The Flow request was cancelled.' },
224
+ ];
225
+ const exposed = safeErrors.find(({ code }) => code === errorCode);
226
+ const diagnostic = {
227
+ code: exposed?.code ?? 'flow-request-failed',
228
+ message: exposed?.message ?? 'The Flow request could not be completed.',
229
+ severity: 'error',
230
+ };
231
+ return { diagnostics: [diagnostic], ok: false };
232
+ }
233
+ /*** Refuses a successful provider response that does not match the requested immutable revision. */
234
+ function flowRevisionMismatchResult() {
235
+ return {
236
+ diagnostics: [
237
+ {
238
+ code: 'flow-revision-mismatch',
239
+ message: 'The Flow provider returned a different published revision.',
240
+ severity: 'error',
241
+ },
242
+ ],
243
+ ok: false,
244
+ };
245
+ }
246
+ //# sourceMappingURL=executeRuntimeFlowCapabilityAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeRuntimeFlowCapabilityAsync.js","sourceRoot":"","sources":["../src/executeRuntimeFlowCapabilityAsync.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAQrD,gFAAgF;AAChF,MAAM,CAAC,KAAK,UAAU,iCAAiC,CACrD,IAAoC,EACpC,QAAqC;IAErC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAE1E,IAAI,CAAC;QACH,IAAI,IAAI,CAAC,UAAU,KAAK,YAAY;YAAE,OAAO,MAAM,cAAc,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACxF,IAAI,IAAI,CAAC,UAAU,KAAK,aAAa;YAAE,OAAO,MAAM,mBAAmB,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC9F,IAAI,IAAI,CAAC,UAAU,KAAK,aAAa;YAAE,OAAO,MAAM,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QAC1F,IAAI,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S,EAAE,OAAO,EAAE,kCAAkC,EAAE;QAChE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,kCAAkC,EAAE;QAClE,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,oCAAoC,EAAE;QACvE,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,iCAAiC,EAAE;KACzD,CAAC;IACX,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IAClE,MAAM,UAAU,GAAyB;QACvC,IAAI,EAAE,OAAO,EAAE,IAAI,IAAI,qBAAqB;QAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,0CAA0C;QACvE,QAAQ,EAAE,OAAO;KAClB,CAAC;IACF,OAAO,EAAE,WAAW,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC;AAClD,CAAC;AAED,oGAAoG;AACpG,SAAS,0BAA0B;IACjC,OAAO;QACL,WAAW,EAAE;YACX;gBACE,IAAI,EAAE,wBAAwB;gBAC9B,OAAO,EAAE,4DAA4D;gBACrE,QAAQ,EAAE,OAAO;aAClB;SACF;QACD,EAAE,EAAE,KAAK;KACV,CAAC;AACJ,CAAC","sourcesContent":["import {\n type DataSourceDiagnostic,\n isSerializableValue,\n type SerializableValue,\n} from '@ankhorage/contracts';\nimport type {\n FlowApprovalRequest,\n FlowDefinitionRef,\n FlowRunSnapshot,\n} from '@ankhorage/contracts/flow';\nimport type { FlowRunEvent } from '@ankhorage/flow';\nimport { isRecord } from '@ankhorage/utility/object';\n\nimport type {\n RuntimeCapabilityExecutionArgs,\n RuntimeCapabilityExecutionResult,\n} from './runtimeBindings.js';\nimport type { RuntimeFlowPort, RuntimeFlowStartRequest } from './types/runtimeFlow.js';\n\n/*** Executes supported Flow actions through the host-owned remote Flow port. */\nexport async function executeRuntimeFlowCapabilityAsync(\n args: RuntimeCapabilityExecutionArgs,\n flowPort: RuntimeFlowPort | undefined,\n): Promise<RuntimeCapabilityExecutionResult> {\n if (flowPort === undefined) return missingFlowPortResult(args.capability);\n\n try {\n if (args.capability === 'flow.start') return await startFlowAsync(args.input, flowPort);\n if (args.capability === 'flow.status') return await readFlowStatusAsync(args.input, flowPort);\n if (args.capability === 'flow.cancel') return await cancelFlowAsync(args.input, flowPort);\n if (args.capability === 'flow.approval')\n return await resolveFlowApprovalAsync(args.input, flowPort);\n if (args.capability === 'flow.events') return await readFlowEventsAsync(args.input, flowPort);\n return unsupportedFlowCapabilityResult(args.capability);\n } catch (error) {\n return flowRequestErrorResult(error);\n }\n}\n\n/*** Starts one published Flow revision after validating its portable binding input. */\nasync function startFlowAsync(\n input: RuntimeCapabilityExecutionArgs['input'],\n flowPort: RuntimeFlowPort,\n): Promise<RuntimeCapabilityExecutionResult> {\n const request = resolveFlowStartRequest(input);\n if (request === undefined) return invalidFlowInputResult('flow.start');\n const run = await flowPort.startAsync(request);\n if (run.flow.id !== request.flow.id || run.flow.version !== request.flow.version)\n return flowRevisionMismatchResult();\n return successfulFlowResult(run);\n}\n\n/*** Reads the current snapshot for a previously started Flow run. */\nasync function readFlowStatusAsync(\n input: RuntimeCapabilityExecutionArgs['input'],\n flowPort: RuntimeFlowPort,\n): Promise<RuntimeCapabilityExecutionResult> {\n const runId = resolveRunId(input);\n if (runId === undefined) return invalidFlowInputResult('flow.status');\n return foundFlowResult(await flowPort.statusAsync(runId), 'Flow run');\n}\n\n/*** Requests cancellation through the remote owner rather than executing a local Flow engine. */\nasync function cancelFlowAsync(\n input: RuntimeCapabilityExecutionArgs['input'],\n flowPort: RuntimeFlowPort,\n): Promise<RuntimeCapabilityExecutionResult> {\n const runId = resolveRunId(input);\n if (runId === undefined) return invalidFlowInputResult('flow.cancel');\n return foundFlowResult(await flowPort.cancelAsync(runId), 'Flow run');\n}\n\n/*** Resolves one pending human approval through the authenticated remote Flow adapter. */\nasync function resolveFlowApprovalAsync(\n input: RuntimeCapabilityExecutionArgs['input'],\n flowPort: RuntimeFlowPort,\n): Promise<RuntimeCapabilityExecutionResult> {\n const request = resolveApprovalRequest(input);\n if (request === undefined) return invalidFlowInputResult('flow.approval');\n return foundFlowResult(await flowPort.resolveApprovalAsync(request), 'Flow approval');\n}\n\n/*** Reads resumable, redaction-safe Flow events after the supplied cursor. */\nasync function readFlowEventsAsync(\n input: RuntimeCapabilityExecutionArgs['input'],\n flowPort: RuntimeFlowPort,\n): Promise<RuntimeCapabilityExecutionResult> {\n const request = resolveEventsRequest(input);\n if (request === undefined) return invalidFlowInputResult('flow.events');\n return successfulFlowResult(await flowPort.eventsAsync(request));\n}\n\n/*** Narrows authored flow-start bindings to the released Flow trigger request shape. */\nfunction resolveFlowStartRequest(\n input: RuntimeCapabilityExecutionArgs['input'],\n): RuntimeFlowStartRequest | undefined {\n if (!isRecord(input)) return undefined;\n const { flow, idempotencyKey, input: flowInput, triggerId } = input;\n if (\n !isFlowDefinitionRef(flow) ||\n !isNonEmptyString(idempotencyKey) ||\n !isNonEmptyString(triggerId) ||\n (flowInput !== undefined && !isFlowInput(flowInput))\n )\n return undefined;\n return {\n flow,\n idempotencyKey,\n ...(flowInput === undefined ? {} : { input: flowInput }),\n triggerId,\n };\n}\n\n/*** Narrows status and cancellation actions to one stable Flow run identity. */\nfunction resolveRunId(input: RuntimeCapabilityExecutionArgs['input']): string | undefined {\n return isRecord(input) && isNonEmptyString(input.runId) ? input.runId : undefined;\n}\n\n/*** Narrows a portable approval decision without accepting server-owned actor identity. */\nfunction resolveApprovalRequest(\n input: RuntimeCapabilityExecutionArgs['input'],\n): { readonly approvalId: string; readonly approved: boolean } | undefined {\n if (\n !isRecord(input) ||\n !isNonEmptyString(input.approvalId) ||\n typeof input.approved !== 'boolean'\n )\n return undefined;\n return { approvalId: input.approvalId, approved: input.approved };\n}\n\n/*** Narrows a resumable event cursor and optional run filter. */\nfunction resolveEventsRequest(\n input: RuntimeCapabilityExecutionArgs['input'],\n): { readonly afterId: number; readonly runId?: string } | undefined {\n if (!isRecord(input) || !isEventCursor(input.afterId)) return undefined;\n if (input.runId !== undefined && !isNonEmptyString(input.runId)) return undefined;\n return input.runId === undefined\n ? { afterId: input.afterId }\n : { afterId: input.afterId, runId: input.runId };\n}\n\n/*** Confirms a published immutable Flow definition reference before calling the host port. */\nfunction isFlowDefinitionRef(value: unknown): value is FlowDefinitionRef {\n return (\n isRecord(value) &&\n isNonEmptyString(value.id) &&\n typeof value.version === 'number' &&\n Number.isSafeInteger(value.version) &&\n value.version > 0\n );\n}\n\n/*** Confirms Flow's public inline input envelope without re-declaring its DTO locally. */\nfunction isFlowInput(value: unknown): value is RuntimeFlowStartRequest['input'] {\n return (\n isRecord(value) &&\n Object.values(value).every(\n (entry) =>\n isRecord(entry) &&\n entry.kind === 'inline' &&\n 'value' in entry &&\n isTransportSerializableValue(entry.value),\n )\n );\n}\n\n/*** Accepts a nonnegative integer event position so subscriptions can resume deterministically. */\nfunction isEventCursor(value: unknown): value is number {\n return typeof value === 'number' && Number.isSafeInteger(value) && value >= 0;\n}\n\n/*** Rejects empty identifiers before a host adapter can issue a remote request. */\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\n/*** Preserves Flow DTOs as runtime binding data after a successful remote operation. */\nfunction successfulFlowResult(\n data: FlowRunSnapshot | FlowApprovalRequest | readonly FlowRunEvent[],\n): RuntimeCapabilityExecutionResult {\n return isTransportSerializableValue(data)\n ? { data, ok: true }\n : {\n diagnostics: [\n {\n code: 'invalid-provider-response',\n message: 'The Flow provider returned a non-serializable response.',\n severity: 'error',\n },\n ],\n ok: false,\n };\n}\n\n/*** Accepts only recursive values that retain their exact meaning across the Flow transport. */\nfunction isTransportSerializableValue(value: unknown): value is SerializableValue {\n return hasFiniteSerializableNumbers(value, new Set<object>()) && isSerializableValue(value);\n}\n\n/*** Rejects non-finite numbers and cyclic objects that JSON transport cannot preserve. */\nfunction hasFiniteSerializableNumbers(value: unknown, ancestors: Set<object>): boolean {\n if (typeof value === 'number') return Number.isFinite(value);\n if (value === null || typeof value !== 'object') return true;\n if (ancestors.has(value)) return false;\n ancestors.add(value);\n const valid = Array.isArray(value)\n ? value.every((entry) => hasFiniteSerializableNumbers(entry, ancestors))\n : Object.values(value).every((entry) => hasFiniteSerializableNumbers(entry, ancestors));\n ancestors.delete(value);\n return valid;\n}\n\n/*** Converts an absent Flow resource into a bindable not-found diagnostic. */\nfunction foundFlowResult(\n data: FlowRunSnapshot | FlowApprovalRequest | undefined,\n resource: string,\n): RuntimeCapabilityExecutionResult {\n return data === undefined\n ? {\n diagnostics: [\n {\n code: 'flow-resource-not-found',\n message: `${resource} was not found.`,\n severity: 'error',\n },\n ],\n ok: false,\n }\n : successfulFlowResult(data);\n}\n\n/*** Reports that the host has not configured the remote Flow capability boundary. */\nfunction missingFlowPortResult(capability: string): RuntimeCapabilityExecutionResult {\n return {\n diagnostics: [\n {\n code: 'missing-adapter',\n message: `Capability '${capability}' requires a configured RuntimeFlowPort.`,\n severity: 'error',\n },\n ],\n ok: false,\n };\n}\n\n/*** Keeps malformed authored Flow inputs from reaching the remote provider boundary. */\nfunction invalidFlowInputResult(capability: string): RuntimeCapabilityExecutionResult {\n return {\n diagnostics: [\n {\n code: 'invalid-input',\n message: `Capability '${capability}' received an invalid Flow request.`,\n severity: 'error',\n },\n ],\n ok: false,\n };\n}\n\n/*** Refuses Flow-prefixed actions that are not part of Runtime's released generated-app contract. */\nfunction unsupportedFlowCapabilityResult(capability: string): RuntimeCapabilityExecutionResult {\n return {\n diagnostics: [\n {\n code: 'missing-operation',\n message: `Flow capability '${capability}' is not supported by Runtime.`,\n severity: 'error',\n },\n ],\n ok: false,\n };\n}\n\n/*** Converts untrusted host failures to fixed public categories without exposing adapter details. */\nfunction flowRequestErrorResult(error: unknown): RuntimeCapabilityExecutionResult {\n const errorCode = isRecord(error) ? error.code : undefined;\n const safeErrors = [\n { code: 'permission-denied', message: 'Flow access was denied.' },\n { code: 'timeout', message: 'The Flow request timed out.' },\n { code: 'unauthenticated', message: 'Flow authentication is required.' },\n { code: 'offline', message: 'The Flow service is unavailable.' },\n { code: 'not-found', message: 'The Flow resource was not found.' },\n { code: 'rate-limited', message: 'The Flow request was rate limited.' },\n { code: 'cancelled', message: 'The Flow request was cancelled.' },\n ] as const;\n const exposed = safeErrors.find(({ code }) => code === errorCode);\n const diagnostic: DataSourceDiagnostic = {\n code: exposed?.code ?? 'flow-request-failed',\n message: exposed?.message ?? 'The Flow request could not be completed.',\n severity: 'error',\n };\n return { diagnostics: [diagnostic], ok: false };\n}\n\n/*** Refuses a successful provider response that does not match the requested immutable revision. */\nfunction flowRevisionMismatchResult(): RuntimeCapabilityExecutionResult {\n return {\n diagnostics: [\n {\n code: 'flow-revision-mismatch',\n message: 'The Flow provider returned a different published revision.',\n severity: 'error',\n },\n ],\n ok: false,\n };\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -28,4 +28,5 @@ export type { RuntimeScreenOperationLoaderExecutionResult, RuntimeScreenOperatio
28
28
  export { createPendingRuntimeScreenOperationLoaderState, createRuntimeScreenLoaderRequestKey, createRuntimeScreenOperationLoaderRequestLifecycle, executeRuntimeScreenOperationLoaders, resolveScreenOperationLoaders, useRuntimeScreenOperationLoaders, } from './runtimeScreenLoaders.js';
29
29
  export type { RuntimeMemoryStateAdapterOptions } from './runtimeStateAdapter.js';
30
30
  export { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter.js';
31
+ export type { RuntimeFlowPort, RuntimeFlowStartRequest } from './types/runtimeFlow.js';
31
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,0BAA0B,EAC1B,kCAAkC,GACnC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mDAAmD,CAAC;AAC3D,O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8BAA8B,EAC9B,0BAA0B,EAG1B,6BAA6B,EAG7B,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,OAAO,EACL,8CAA8C,EAC9C,mCAAmC,EACnC,kDAAkD,EAClD,oCAAoC,EACpC,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export type {\n RuntimeContextCapabilityId,\n RuntimeContextCapabilityResolution,\n} from './capabilities/resolveRuntimeContextCapability.js';\nexport {\n isRuntimeContextCapabilityOutputPath,\n resolveRuntimeContextCapability,\n} from './capabilities/resolveRuntimeContextCapability.js';\nexport {\n ManifestContext,\n ManifestProvider,\n useManifest,\n useManifestContext,\n useOptionalManifestContext,\n} from './ManifestContext.js';\nexport type { ComponentRegistry } from './registry.js';\nexport { createComponentRegistry } from './registry.js';\nexport type {\n RuntimeActionRegistry,\n RuntimeActionResolutionArgs,\n RuntimeActionResolutionScope,\n RuntimeComponentEventDispatchArgs,\n RuntimeEventCapabilityResolver,\n RuntimeEventPropWrapArgs,\n} from './runtimeActionRegistry.js';\nexport {\n createComponentEventFromHandlerArgs,\n createRuntimeActionRegistry,\n dispatchRuntimeComponentEvent,\n resolveRuntimeActionValue,\n wrapRuntimeEventProps,\n} from './runtimeActionRegistry.js';\nexport type { RuntimeApiCapabilityExecutorOptions } from './runtimeApiCapabilities.js';\nexport { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities.js';\nexport type {\n RuntimeAuthoringBounds,\n RuntimeAuthoringComponentIdentity,\n RuntimeAuthoringGestureDisposition,\n RuntimeAuthoringMode,\n RuntimeAuthoringOverlayAdapter,\n RuntimeAuthoringOverlayNodeArgs,\n} from './runtimeAuthoringOverlay.js';\nexport { createRuntimeAuthoringOverlayConfig } from './runtimeAuthoringOverlay.js';\nexport type {\n RuntimeBindingResolutionArgs,\n RuntimeBindingResolutionContext,\n RuntimeBindingResolutionResult,\n RuntimeBindingResultCache,\n RuntimeBindingResultWriter,\n RuntimeCapabilityExecutionArgs,\n RuntimeCapabilityExecutionResult,\n RuntimeCapabilityExecutor,\n} from './runtimeBindings.js';\nexport {\n applyRuntimeBindingDataPath,\n executeRuntimeBindingInvocation,\n resolveBindingInputMap,\n resolveBindingInputMapSync,\n resolveRuntimeBindingExpression,\n resolveRuntimeBindingExpressionSync,\n resolveRuntimeBindings,\n resolveRuntimeBindingsAsync,\n resolveRuntimeBindingValue,\n resolveRuntimeBindingValueSync,\n} from './runtimeBindings.js';\nexport type { RuntimeCapabilityExecutorComposition } from './runtimeCapabilityExecutor.js';\nexport { composeRuntimeCapabilityExecutor } from './runtimeCapabilityExecutor.js';\nexport {\n dispatchRuntimeComponentEventWithReporting,\n type RuntimeEventDiagnosticsReporter,\n} from './runtimeEventExecution.js';\nexport type {\n RuntimeEventOperationInvocation,\n RuntimeEventOperationLifecycle,\n RuntimeEventOperationState,\n RuntimeEventOperationStatus,\n} from './runtimeEventOperationLifecycle.js';\nexport {\n createRuntimeEventOperationBindingContext,\n createRuntimeEventOperationLifecycle,\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n resolveRuntimeEventOperationErrorMessage,\n} from './runtimeEventOperationLifecycle.js';\nexport type {\n RuntimeActionDescriptor,\n RuntimeAdapterDescriptor,\n RuntimeBindingDescriptor,\n RuntimeDiagnostic,\n RuntimeManifest,\n RuntimeManifestConfig,\n RuntimeManifestInput,\n} from './runtimeManifest.js';\nexport type {\n RuntimeMediaAssetResolver,\n RuntimeMediaAssetResolverArgs,\n RuntimeResolvedMediaValue,\n} from './runtimeMedia.js';\nexport type { RuntimeRendererProps } from './RuntimeRenderer.js';\nexport { RuntimeRenderer } from './RuntimeRenderer.js';\nexport {\n composeRuntimeNodePropsResolver,\n composeRuntimeRendererWrapNode,\n mergeRuntimeRendererConfig,\n type RuntimeNodePropsResolver,\n type RuntimeRendererConfig,\n RuntimeRendererConfigProvider,\n type RuntimeRendererWrapArgs,\n type RuntimeResolveNodePropsArgs,\n useRuntimeRendererConfig,\n} from './RuntimeRendererConfig.js';\nexport { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState.js';\nexport type { RuntimeScreenProps } from './RuntimeScreen.js';\nexport { RuntimeScreen } from './RuntimeScreen.js';\nexport type {\n RuntimeScreenOperationLoaderExecutionResult,\n RuntimeScreenOperationLoaderState,\n} from './runtimeScreenLoaders.js';\nexport {\n createPendingRuntimeScreenOperationLoaderState,\n createRuntimeScreenLoaderRequestKey,\n createRuntimeScreenOperationLoaderRequestLifecycle,\n executeRuntimeScreenOperationLoaders,\n resolveScreenOperationLoaders,\n useRuntimeScreenOperationLoaders,\n} from './runtimeScreenLoaders.js';\nexport type { RuntimeMemoryStateAdapterOptions } from './runtimeStateAdapter.js';\nexport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oCAAoC,EACpC,+BAA+B,GAChC,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AASxD,OAAO,EACL,mCAAmC,EACnC,2BAA2B,EAC3B,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAC;AASjF,OAAO,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAC;AAWnF,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,0BAA0B,EAC1B,+BAA+B,EAC/B,mCAAmC,EACnC,sBAAsB,EACtB,2BAA2B,EAC3B,0BAA0B,EAC1B,8BAA8B,GAC/B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gCAAgC,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EACL,0CAA0C,GAE3C,MAAM,4BAA4B,CAAC;AAOpC,OAAO,EACL,yCAAyC,EACzC,oCAAoC,EACpC,kCAAkC,EAClC,wCAAwC,GACzC,MAAM,qCAAqC,CAAC;AAgB7C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,0BAA0B,EAG1B,6BAA6B,EAG7B,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,mCAAmC,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKnD,OAAO,EACL,8CAA8C,EAC9C,mCAAmC,EACnC,kDAAkD,EAClD,oCAAoC,EACpC,6BAA6B,EAC7B,gCAAgC,GACjC,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAAE,+BAA+B,EAAE,MAAM,0BAA0B,CAAC","sourcesContent":["export type {\n RuntimeContextCapabilityId,\n RuntimeContextCapabilityResolution,\n} from './capabilities/resolveRuntimeContextCapability.js';\nexport {\n isRuntimeContextCapabilityOutputPath,\n resolveRuntimeContextCapability,\n} from './capabilities/resolveRuntimeContextCapability.js';\nexport {\n ManifestContext,\n ManifestProvider,\n useManifest,\n useManifestContext,\n useOptionalManifestContext,\n} from './ManifestContext.js';\nexport type { ComponentRegistry } from './registry.js';\nexport { createComponentRegistry } from './registry.js';\nexport type {\n RuntimeActionRegistry,\n RuntimeActionResolutionArgs,\n RuntimeActionResolutionScope,\n RuntimeComponentEventDispatchArgs,\n RuntimeEventCapabilityResolver,\n RuntimeEventPropWrapArgs,\n} from './runtimeActionRegistry.js';\nexport {\n createComponentEventFromHandlerArgs,\n createRuntimeActionRegistry,\n dispatchRuntimeComponentEvent,\n resolveRuntimeActionValue,\n wrapRuntimeEventProps,\n} from './runtimeActionRegistry.js';\nexport type { RuntimeApiCapabilityExecutorOptions } from './runtimeApiCapabilities.js';\nexport { createRuntimeApiCapabilityExecutor } from './runtimeApiCapabilities.js';\nexport type {\n RuntimeAuthoringBounds,\n RuntimeAuthoringComponentIdentity,\n RuntimeAuthoringGestureDisposition,\n RuntimeAuthoringMode,\n RuntimeAuthoringOverlayAdapter,\n RuntimeAuthoringOverlayNodeArgs,\n} from './runtimeAuthoringOverlay.js';\nexport { createRuntimeAuthoringOverlayConfig } from './runtimeAuthoringOverlay.js';\nexport type {\n RuntimeBindingResolutionArgs,\n RuntimeBindingResolutionContext,\n RuntimeBindingResolutionResult,\n RuntimeBindingResultCache,\n RuntimeBindingResultWriter,\n RuntimeCapabilityExecutionArgs,\n RuntimeCapabilityExecutionResult,\n RuntimeCapabilityExecutor,\n} from './runtimeBindings.js';\nexport {\n applyRuntimeBindingDataPath,\n executeRuntimeBindingInvocation,\n resolveBindingInputMap,\n resolveBindingInputMapSync,\n resolveRuntimeBindingExpression,\n resolveRuntimeBindingExpressionSync,\n resolveRuntimeBindings,\n resolveRuntimeBindingsAsync,\n resolveRuntimeBindingValue,\n resolveRuntimeBindingValueSync,\n} from './runtimeBindings.js';\nexport type { RuntimeCapabilityExecutorComposition } from './runtimeCapabilityExecutor.js';\nexport { composeRuntimeCapabilityExecutor } from './runtimeCapabilityExecutor.js';\nexport {\n dispatchRuntimeComponentEventWithReporting,\n type RuntimeEventDiagnosticsReporter,\n} from './runtimeEventExecution.js';\nexport type {\n RuntimeEventOperationInvocation,\n RuntimeEventOperationLifecycle,\n RuntimeEventOperationState,\n RuntimeEventOperationStatus,\n} from './runtimeEventOperationLifecycle.js';\nexport {\n createRuntimeEventOperationBindingContext,\n createRuntimeEventOperationLifecycle,\n IDLE_RUNTIME_EVENT_OPERATION_STATE,\n resolveRuntimeEventOperationErrorMessage,\n} from './runtimeEventOperationLifecycle.js';\nexport type {\n RuntimeActionDescriptor,\n RuntimeAdapterDescriptor,\n RuntimeBindingDescriptor,\n RuntimeDiagnostic,\n RuntimeManifest,\n RuntimeManifestConfig,\n RuntimeManifestInput,\n} from './runtimeManifest.js';\nexport type {\n RuntimeMediaAssetResolver,\n RuntimeMediaAssetResolverArgs,\n RuntimeResolvedMediaValue,\n} from './runtimeMedia.js';\nexport type { RuntimeRendererProps } from './RuntimeRenderer.js';\nexport { RuntimeRenderer } from './RuntimeRenderer.js';\nexport {\n composeRuntimeNodePropsResolver,\n composeRuntimeRendererWrapNode,\n mergeRuntimeRendererConfig,\n type RuntimeNodePropsResolver,\n type RuntimeRendererConfig,\n RuntimeRendererConfigProvider,\n type RuntimeRendererWrapArgs,\n type RuntimeResolveNodePropsArgs,\n useRuntimeRendererConfig,\n} from './RuntimeRendererConfig.js';\nexport { shouldRenderRuntimeRepeatEmptyState } from './runtimeRepeatEmptyState.js';\nexport type { RuntimeScreenProps } from './RuntimeScreen.js';\nexport { RuntimeScreen } from './RuntimeScreen.js';\nexport type {\n RuntimeScreenOperationLoaderExecutionResult,\n RuntimeScreenOperationLoaderState,\n} from './runtimeScreenLoaders.js';\nexport {\n createPendingRuntimeScreenOperationLoaderState,\n createRuntimeScreenLoaderRequestKey,\n createRuntimeScreenOperationLoaderRequestLifecycle,\n executeRuntimeScreenOperationLoaders,\n resolveScreenOperationLoaders,\n useRuntimeScreenOperationLoaders,\n} from './runtimeScreenLoaders.js';\nexport type { RuntimeMemoryStateAdapterOptions } from './runtimeStateAdapter.js';\nexport { createRuntimeMemoryStateAdapter } from './runtimeStateAdapter.js';\nexport type { RuntimeFlowPort, RuntimeFlowStartRequest } from './types/runtimeFlow.js';\n"]}
@@ -1,8 +1,10 @@
1
1
  import type { StateAdapter } from '@ankhorage/contracts';
2
2
  import type { RuntimeCapabilityExecutor } from './runtimeBindings.js';
3
+ import type { RuntimeFlowPort } from './types/runtimeFlow.js';
3
4
  export interface RuntimeCapabilityExecutorComposition {
4
5
  readonly apiCapabilityExecutor: RuntimeCapabilityExecutor;
5
6
  readonly capabilityExecutor?: RuntimeCapabilityExecutor;
7
+ readonly flowPort?: RuntimeFlowPort;
6
8
  readonly stateAdapter?: StateAdapter;
7
9
  }
8
10
  /*** Keeps local state mutations while preferring the configured host executor for API capabilities. */
@@ -1 +1 @@
1
- {"version":3,"file":"runtimeCapabilityExecutor.d.ts","sourceRoot":"","sources":["../src/runtimeCapabilityExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsC,MAAM,sBAAsB,CAAC;AAG7F,OAAO,KAAK,EAGV,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAE9B,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,qBAAqB,EAAE,yBAAyB,CAAC;IAC1D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IACxD,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC;AAED,uGAAuG;AACvG,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,oCAAoC,GAChD,yBAAyB,CAS3B"}
1
+ {"version":3,"file":"runtimeCapabilityExecutor.d.ts","sourceRoot":"","sources":["../src/runtimeCapabilityExecutor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAsC,MAAM,sBAAsB,CAAC;AAI7F,OAAO,KAAK,EAGV,yBAAyB,EAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,qBAAqB,EAAE,yBAAyB,CAAC;IAC1D,QAAQ,CAAC,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IACxD,QAAQ,CAAC,QAAQ,CAAC,EAAE,eAAe,CAAC;IACpC,QAAQ,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC;CACtC;AAED,uGAAuG;AACvG,wBAAgB,gCAAgC,CAC9C,WAAW,EAAE,oCAAoC,GAChD,yBAAyB,CAW3B"}
@@ -1,13 +1,16 @@
1
1
  import { isRecord } from '@ankhorage/utility/object';
2
+ import { executeRuntimeFlowCapabilityAsync } from './executeRuntimeFlowCapabilityAsync.js';
2
3
  /*** Keeps local state mutations while preferring the configured host executor for API capabilities. */
3
4
  export function composeRuntimeCapabilityExecutor(composition) {
4
5
  return async (args) => args.capability.startsWith('api.')
5
6
  ? executeApiCapabilityAsync(args, composition)
6
- : args.capability === 'state.set'
7
- ? executeStateSetCapabilityAsync(args, composition.stateAdapter)
8
- : args.capability === 'state.update'
9
- ? executeStateUpdateCapabilityAsync(args, composition.stateAdapter)
10
- : executeApplicationCapabilityAsync(args, composition.capabilityExecutor);
7
+ : args.capability.startsWith('flow.')
8
+ ? executeRuntimeFlowCapabilityAsync(args, composition.flowPort)
9
+ : args.capability === 'state.set'
10
+ ? executeStateSetCapabilityAsync(args, composition.stateAdapter)
11
+ : args.capability === 'state.update'
12
+ ? executeStateUpdateCapabilityAsync(args, composition.stateAdapter)
13
+ : executeApplicationCapabilityAsync(args, composition.capabilityExecutor);
11
14
  }
12
15
  /*** Uses the host API executor when supplied, falling back to the manifest executor. */
13
16
  function executeApiCapabilityAsync(args, composition) {