@dxos/app-framework 0.14.0 → 0.16.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 (129) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/lib/App.mjs +1 -2
  3. package/dist/lib/Hooks.mjs +1 -2
  4. package/dist/lib/chunk-App.mjs +11 -0
  5. package/dist/lib/chunk-App.mjs.map +1 -0
  6. package/dist/lib/chunk-Cli.mjs +8 -0
  7. package/dist/lib/chunk-Cli.mjs.map +1 -0
  8. package/dist/lib/chunk-Devtools.mjs +112 -0
  9. package/dist/lib/chunk-Devtools.mjs.map +1 -0
  10. package/dist/lib/chunk-Hooks2.mjs +35 -0
  11. package/dist/lib/chunk-Hooks2.mjs.map +1 -0
  12. package/dist/lib/chunk-PluginManagerProvider.mjs +12 -0
  13. package/dist/lib/chunk-PluginManagerProvider.mjs.map +1 -0
  14. package/dist/lib/chunk-ProcessManagerPlugin.mjs +3 -3
  15. package/dist/lib/chunk-ProcessManagerPlugin.mjs.map +1 -1
  16. package/dist/lib/chunk-Role.mjs +19 -0
  17. package/dist/lib/chunk-Role.mjs.map +1 -0
  18. package/dist/lib/chunk-SharedPackages.mjs +11 -0
  19. package/dist/lib/chunk-SharedPackages.mjs.map +1 -0
  20. package/dist/lib/chunk-Surface.mjs.map +1 -1
  21. package/dist/lib/chunk-Surface2.mjs +37 -0
  22. package/dist/lib/chunk-Surface2.mjs.map +1 -0
  23. package/dist/lib/chunk-SurfaceManager.mjs +3 -3
  24. package/dist/lib/chunk-SurfaceManager.mjs.map +1 -1
  25. package/dist/lib/chunk-activation-event.mjs +86 -0
  26. package/dist/lib/chunk-activation-event.mjs.map +1 -0
  27. package/dist/lib/chunk-activation-events.mjs +66 -0
  28. package/dist/lib/chunk-activation-events.mjs.map +1 -0
  29. package/dist/lib/chunk-capabilities.mjs +202 -0
  30. package/dist/lib/chunk-capabilities.mjs.map +1 -0
  31. package/dist/lib/chunk-capability-manager.mjs +203 -0
  32. package/dist/lib/chunk-capability-manager.mjs.map +1 -0
  33. package/dist/lib/chunk-capability2.mjs +2 -2
  34. package/dist/lib/chunk-capability2.mjs.map +1 -1
  35. package/dist/lib/chunk-history-tracker.mjs +1 -1
  36. package/dist/lib/chunk-hooks.mjs +5 -5
  37. package/dist/lib/chunk-hooks.mjs.map +1 -1
  38. package/dist/lib/chunk-plugin-asset-cache.mjs +28 -0
  39. package/dist/lib/chunk-plugin-asset-cache.mjs.map +1 -0
  40. package/dist/lib/chunk-plugin-manager.mjs +68 -35
  41. package/dist/lib/chunk-plugin-manager.mjs.map +1 -1
  42. package/dist/lib/chunk-plugin-manager2.mjs +22 -0
  43. package/dist/lib/chunk-plugin-manager2.mjs.map +1 -0
  44. package/dist/lib/chunk-plugin-manifest.mjs +126 -0
  45. package/dist/lib/chunk-plugin-manifest.mjs.map +1 -0
  46. package/dist/lib/chunk-plugin.mjs +354 -0
  47. package/dist/lib/chunk-plugin.mjs.map +1 -0
  48. package/dist/lib/chunk-process-manager-capability.mjs +11 -10
  49. package/dist/lib/chunk-process-manager-capability.mjs.map +1 -1
  50. package/dist/lib/chunk-registry.mjs.map +1 -1
  51. package/dist/lib/chunk-undo-mapping.mjs +47 -0
  52. package/dist/lib/{plugin-process-manager/history/undo-mapping.mjs.map → chunk-undo-mapping.mjs.map} +1 -1
  53. package/dist/lib/chunk-undo-registry.mjs +22 -0
  54. package/dist/lib/{plugin-process-manager/history/undo-registry.mjs.map → chunk-undo-registry.mjs.map} +1 -1
  55. package/dist/lib/chunk-url-loader.mjs +345 -0
  56. package/dist/lib/chunk-url-loader.mjs.map +1 -0
  57. package/dist/lib/cli.mjs +3 -3
  58. package/dist/lib/cli.mjs.map +1 -1
  59. package/dist/lib/common/Role.mjs +1 -19
  60. package/dist/lib/common/activation-events.mjs +1 -57
  61. package/dist/lib/common/capabilities.mjs +1 -202
  62. package/dist/lib/config.mjs +1 -2
  63. package/dist/lib/core/activation-event.mjs +1 -86
  64. package/dist/lib/core/capability-manager.mjs +1 -203
  65. package/dist/lib/core/capability.mjs +1 -2
  66. package/dist/lib/core/plugin-asset-cache.mjs +1 -28
  67. package/dist/lib/core/plugin-manager.mjs +2 -19
  68. package/dist/lib/core/plugin-manifest.mjs +1 -126
  69. package/dist/lib/core/plugin.mjs +1 -354
  70. package/dist/lib/core/registry.mjs +1 -2
  71. package/dist/lib/core/url-loader.mjs +1 -345
  72. package/dist/lib/index.mjs +19 -19
  73. package/dist/lib/ns/App.mjs +2 -11
  74. package/dist/lib/ns/Cli.mjs +2 -8
  75. package/dist/lib/ns/Devtools.mjs +1 -112
  76. package/dist/lib/ns/Hooks.mjs +2 -35
  77. package/dist/lib/ns/PluginManagerProvider.mjs +2 -12
  78. package/dist/lib/ns/SharedPackages.mjs +2 -11
  79. package/dist/lib/ns/Surface.mjs +2 -35
  80. package/dist/lib/ns/Translations.mjs +1 -2
  81. package/dist/lib/plugin-cli.mjs +2 -4
  82. package/dist/lib/plugin-cli.mjs.map +1 -1
  83. package/dist/lib/plugin-process-manager/ProcessManagerPlugin.mjs +1 -2
  84. package/dist/lib/plugin-process-manager/history/history-tracker.mjs +1 -2
  85. package/dist/lib/plugin-process-manager/history/undo-mapping.mjs +1 -47
  86. package/dist/lib/plugin-process-manager/history/undo-registry.mjs +1 -22
  87. package/dist/lib/testing/react.mjs +1 -1
  88. package/dist/lib/testing/react.mjs.map +1 -1
  89. package/dist/lib/testing.mjs +5 -5
  90. package/dist/lib/testing.mjs.map +1 -1
  91. package/dist/lib/vite-plugin.mjs +3 -3
  92. package/dist/lib/vite-plugin.mjs.map +1 -1
  93. package/dist/types/src/common/activation-events.d.ts +8 -0
  94. package/dist/types/src/common/activation-events.d.ts.map +1 -1
  95. package/dist/types/src/core/plugin-manager/manager-state.d.ts.map +1 -1
  96. package/dist/types/src/core/plugin-manager/module-loader.d.ts +0 -10
  97. package/dist/types/src/core/plugin-manager/module-loader.d.ts.map +1 -1
  98. package/dist/types/src/core/plugin-manager/plugin-manager.d.ts.map +1 -1
  99. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -1
  100. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
  101. package/dist/types/src/ui/hooks/useApp.d.ts.map +1 -1
  102. package/dist/types/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +32 -32
  104. package/src/common/activation-events.ts +9 -0
  105. package/src/core/plugin-manager/manager-state.ts +14 -12
  106. package/src/core/plugin-manager/module-loader.ts +43 -7
  107. package/src/core/plugin-manager/plugin-manager.ts +2 -1
  108. package/src/plugin-process-manager/process-manager-capability.test.ts +66 -1
  109. package/src/plugin-process-manager/process-manager-capability.ts +22 -2
  110. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +9 -7
  111. package/src/ui/hooks/useApp.tsx +2 -1
  112. package/src/vite-plugin/boot-loader/loader-app/boot-loader.css +19 -1
  113. package/dist/lib/common/Role.mjs.map +0 -1
  114. package/dist/lib/common/activation-events.mjs.map +0 -1
  115. package/dist/lib/common/capabilities.mjs.map +0 -1
  116. package/dist/lib/core/activation-event.mjs.map +0 -1
  117. package/dist/lib/core/capability-manager.mjs.map +0 -1
  118. package/dist/lib/core/plugin-asset-cache.mjs.map +0 -1
  119. package/dist/lib/core/plugin-manager.mjs.map +0 -1
  120. package/dist/lib/core/plugin-manifest.mjs.map +0 -1
  121. package/dist/lib/core/plugin.mjs.map +0 -1
  122. package/dist/lib/core/url-loader.mjs.map +0 -1
  123. package/dist/lib/ns/App.mjs.map +0 -1
  124. package/dist/lib/ns/Cli.mjs.map +0 -1
  125. package/dist/lib/ns/Devtools.mjs.map +0 -1
  126. package/dist/lib/ns/Hooks.mjs.map +0 -1
  127. package/dist/lib/ns/PluginManagerProvider.mjs.map +0 -1
  128. package/dist/lib/ns/SharedPackages.mjs.map +0 -1
  129. package/dist/lib/ns/Surface.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,78 @@
1
1
  # @dxos/app-framework
2
2
 
3
+ ## 0.16.0
4
+
5
+ ### Patch Changes
6
+
7
+ - @dxos/echo@0.16.0
8
+ - @dxos/compute@0.16.0
9
+ - @dxos/compute-runtime@0.16.0
10
+ - @dxos/operation@0.16.0
11
+ - @dxos/async@0.16.0
12
+ - @dxos/context@0.16.0
13
+ - @dxos/debug@0.16.0
14
+ - @dxos/effect@0.16.0
15
+ - @dxos/errors@0.16.0
16
+ - @dxos/graph@0.16.0
17
+ - @dxos/invariant@0.16.0
18
+ - @dxos/keys@0.16.0
19
+ - @dxos/log@0.16.0
20
+ - @dxos/util@0.16.0
21
+ - @dxos/web-context@0.16.0
22
+ - @dxos/web-context-react@0.16.0
23
+ - @dxos/edge-client@0.16.0
24
+ - @dxos/protocols@0.16.0
25
+ - @dxos/react-error-boundary@0.16.0
26
+ - @dxos/react-hooks@0.16.0
27
+ - @dxos/ui-theme@0.16.0
28
+
29
+ ## 0.15.0
30
+
31
+ ### Patch Changes
32
+
33
+ - b82150a: An operation invoked with `on: 'edge'` now runs as one request to EDGE's operation host (`POST /functions/dxn:<key>`) instead of spawning a process there, so a call such as the Brain panel's `InspectBrain` poll no longer creates a Durable Object per invocation. `RemoteOperationInvoker.invoke` takes the space per call and carries input and output in their wire form, which the invoker encodes and decodes with the operation's schemas. `@dxos/plugin-routine` provides the EDGE invoker once for the application instead of per space, and `EdgeOperationInvoker` presents the current identity on every call.
34
+ - Updated dependencies [5490cbc]
35
+ - Updated dependencies [9b2a2c0]
36
+ - Updated dependencies [94ec06d]
37
+ - Updated dependencies [419bf9a]
38
+ - Updated dependencies [3aed53a]
39
+ - Updated dependencies [ed8df23]
40
+ - Updated dependencies [0f6457d]
41
+ - Updated dependencies [94d4f85]
42
+ - Updated dependencies [b6ae19d]
43
+ - Updated dependencies [d84f9b8]
44
+ - Updated dependencies [b82150a]
45
+ - Updated dependencies [0420f87]
46
+ - Updated dependencies [1e9c017]
47
+ - Updated dependencies [16bde33]
48
+ - Updated dependencies [5e3e00c]
49
+ - Updated dependencies [ef9aea9]
50
+ - Updated dependencies [37edd53]
51
+ - Updated dependencies [7b47951]
52
+ - Updated dependencies [e398906]
53
+ - Updated dependencies [2b6a93a]
54
+ - @dxos/compute-runtime@0.15.0
55
+ - @dxos/echo@0.15.0
56
+ - @dxos/compute@0.15.0
57
+ - @dxos/edge-client@0.15.0
58
+ - @dxos/protocols@0.15.0
59
+ - @dxos/async@0.15.0
60
+ - @dxos/operation@0.15.0
61
+ - @dxos/effect@0.15.0
62
+ - @dxos/graph@0.15.0
63
+ - @dxos/react-error-boundary@0.15.0
64
+ - @dxos/react-hooks@0.15.0
65
+ - @dxos/util@0.15.0
66
+ - @dxos/context@0.15.0
67
+ - @dxos/debug@0.15.0
68
+ - @dxos/errors@0.15.0
69
+ - @dxos/invariant@0.15.0
70
+ - @dxos/keys@0.15.0
71
+ - @dxos/log@0.15.0
72
+ - @dxos/web-context@0.15.0
73
+ - @dxos/web-context-react@0.15.0
74
+ - @dxos/ui-theme@0.15.0
75
+
3
76
  ## 0.14.0
4
77
 
5
78
  ### Patch Changes
package/dist/lib/App.mjs CHANGED
@@ -1,2 +1 @@
1
- import { D as bootLoader, E as App } from "./chunk-hooks.mjs";
2
- export { App, bootLoader };
1
+ export { E as App, D as bootLoader } from "./chunk-hooks.mjs";
@@ -1,2 +1 @@
1
- import { C as pluginSlugOf, O as useActivationSignal, S as StartupTimeoutError, T as useApp, _ as useOptionalCapabilities, a as useSpaceService, b as STARTUP_ACTIVATED_EVENT, c as useAtomCapability, d as useCapability, f as useOperation, g as useOptionalAtomCapabilityState, h as useOptionalAtomCapability, i as useSpaceCallback, l as useAtomCapabilityState, m as useOperationInvoker, n as useSettingsState, o as LoadingState, p as useOperationHandler, r as useProcessManagerRuntime, s as useLoading, t as useSurface, u as useCapabilities, v as useOptionalCapability, w as pluginSlugOfKey, x as STARTUP_FAILED_EVENT, y as FIRST_INTERACTIVE_EVENT } from "./chunk-hooks.mjs";
2
- export { FIRST_INTERACTIVE_EVENT, LoadingState, STARTUP_ACTIVATED_EVENT, STARTUP_FAILED_EVENT, StartupTimeoutError, pluginSlugOf, pluginSlugOfKey, useActivationSignal, useApp, useAtomCapability, useAtomCapabilityState, useCapabilities, useCapability, useLoading, useOperation, useOperationHandler, useOperationInvoker, useOptionalAtomCapability, useOptionalAtomCapabilityState, useOptionalCapabilities, useOptionalCapability, useProcessManagerRuntime, useSettingsState, useSpaceCallback, useSpaceService, useSurface };
1
+ export { y as FIRST_INTERACTIVE_EVENT, o as LoadingState, b as STARTUP_ACTIVATED_EVENT, x as STARTUP_FAILED_EVENT, S as StartupTimeoutError, C as pluginSlugOf, w as pluginSlugOfKey, O as useActivationSignal, T as useApp, c as useAtomCapability, l as useAtomCapabilityState, u as useCapabilities, d as useCapability, s as useLoading, f as useOperation, p as useOperationHandler, m as useOperationInvoker, h as useOptionalAtomCapability, g as useOptionalAtomCapabilityState, _ as useOptionalCapabilities, v as useOptionalCapability, r as useProcessManagerRuntime, n as useSettingsState, i as useSpaceCallback, a as useSpaceService, t as useSurface } from "./chunk-hooks.mjs";
@@ -0,0 +1,11 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { D as bootLoader, E as App } from "./chunk-hooks.mjs";
3
+ //#region src/App.ts
4
+ var App_exports = /* @__PURE__ */ __exportAll({
5
+ Root: () => App,
6
+ bootLoader: () => bootLoader
7
+ });
8
+ //#endregion
9
+ export { App_exports as t };
10
+
11
+ //# sourceMappingURL=chunk-App.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-App.mjs","names":[],"sources":["../../src/App.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport { App as Root, bootLoader } from './ui/components/App/index.ts';\nexport type { AppProps as RootProps } from './ui/components/App/index.ts';\n"],"mappings":""}
@@ -0,0 +1,8 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { createCliApp } from "./cli.mjs";
3
+ //#region src/Cli.ts
4
+ var Cli_exports = /* @__PURE__ */ __exportAll({ createCliApp: () => createCliApp });
5
+ //#endregion
6
+ export { Cli_exports as t };
7
+
8
+ //# sourceMappingURL=chunk-Cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Cli.mjs","names":[],"sources":["../../src/Cli.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from './cli/index.ts';\n"],"mappings":""}
@@ -0,0 +1,112 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { l as OperationInvoker, s as OperationHandler } from "./chunk-capabilities.mjs";
3
+ import { DXN } from "@dxos/keys";
4
+ import * as Schema from "effect/Schema";
5
+ import * as Result from "effect/Result";
6
+ import * as SchemaIssue from "effect/SchemaIssue";
7
+ import * as SchemaAST from "@dxos/effect/SchemaAST";
8
+ //#region src/Devtools.ts
9
+ var Devtools_exports = /* @__PURE__ */ __exportAll({ setup: () => setup });
10
+ /**
11
+ * Module ids are `org.dxos.plugin.<slug>.module.<name>`; the plugin id is everything before
12
+ * `.module.`. Returns undefined for ids that do not follow the convention.
13
+ */
14
+ var pluginIdOf = (moduleId) => {
15
+ const index = moduleId.indexOf(".module.");
16
+ return index === -1 ? void 0 : moduleId.slice(0, index);
17
+ };
18
+ /** Rendered types carry the field's description annotation, which can be a paragraph. */
19
+ var MAX_TYPE_LENGTH = 60;
20
+ /**
21
+ * Top-level fields of a struct schema, so `operations()` says what an operation takes rather than
22
+ * only what it is called. Non-struct schemas (`Schema.Void`, unions) have no field list.
23
+ */
24
+ var formatIssue = SchemaIssue.makeFormatterStandardSchemaV1();
25
+ var fieldsOf = (schema) => {
26
+ const ast = schema?.ast;
27
+ if (!ast || !SchemaAST.isObjects(ast)) return;
28
+ return SchemaAST.getPropertySignatures(ast).map((property) => {
29
+ const type = String(property.type);
30
+ return {
31
+ name: String(property.name),
32
+ optional: SchemaAST.isOptional(property.type),
33
+ type: type.length > MAX_TYPE_LENGTH ? `${type.slice(0, MAX_TYPE_LENGTH)}…` : type
34
+ };
35
+ });
36
+ };
37
+ /**
38
+ * Attaches the plugin/operation console API to `globalThis.composer`.
39
+ *
40
+ * Lives at the framework level rather than in a devtools plugin so it is present in any app and
41
+ * does not depend on which plugins happen to be enabled — inspecting a broken plugin set is
42
+ * exactly when this is wanted.
43
+ */
44
+ var setup = (manager) => {
45
+ const listOperations = (pluginId) => {
46
+ const byModule = manager.registry.get(manager.capabilities.atomByModule(OperationHandler));
47
+ return Object.entries(byModule).flatMap(([moduleId, sets]) => {
48
+ const owner = pluginIdOf(moduleId);
49
+ if (pluginId && owner !== pluginId) return [];
50
+ return sets.flatMap((set) => set.definitions().map((definition) => ({
51
+ key: definition.meta.key,
52
+ name: definition.meta.name,
53
+ description: definition.meta.description,
54
+ pluginId: owner,
55
+ moduleId,
56
+ input: fieldsOf(definition.input),
57
+ output: fieldsOf(definition.output)
58
+ })));
59
+ });
60
+ };
61
+ const normalizeKey = (key) => {
62
+ if (!DXN.isDXN(key)) return key;
63
+ try {
64
+ return DXN.getName(key);
65
+ } catch {
66
+ return key;
67
+ }
68
+ };
69
+ const findDefinition = (key) => {
70
+ const wanted = normalizeKey(key);
71
+ for (const set of manager.capabilities.getAll(OperationHandler)) {
72
+ const definition = set.definitions().find((candidate) => normalizeKey(candidate.meta.key) === wanted);
73
+ if (definition) return definition;
74
+ }
75
+ };
76
+ const composer = globalThis.composer ??= {};
77
+ composer.manager = manager;
78
+ composer.plugins = () => {
79
+ const core = new Set(manager.getCore());
80
+ const enabled = new Set(manager.getEnabled());
81
+ const active = new Set(manager.getActive());
82
+ return manager.getPlugins().map((plugin) => {
83
+ const id = plugin.meta.profile.key;
84
+ return {
85
+ id,
86
+ name: plugin.meta.profile.name,
87
+ description: plugin.meta.profile.description,
88
+ core: core.has(id),
89
+ enabled: enabled.has(id),
90
+ active: plugin.modules.some((module) => active.has(module.id)),
91
+ moduleIds: plugin.modules.map((module) => module.id)
92
+ };
93
+ });
94
+ };
95
+ composer.operations = listOperations;
96
+ composer.invoke = async (key, input, options) => {
97
+ const definition = findDefinition(key);
98
+ if (!definition) throw new Error(`Unknown operation: ${key} (try composer.operations())`);
99
+ const validation = Schema.decodeUnknownResult(Schema.make(SchemaAST.toType(definition.input.ast)), { errors: "all" })(input);
100
+ if (Result.isFailure(validation)) {
101
+ const issues = formatIssue(validation.failure.issue).issues.map((issue) => `${issue.path?.join(".") || "(root)"}: ${issue.message}`).join("; ");
102
+ throw new Error(`Invalid input for ${key} — ${issues}`);
103
+ }
104
+ const { data, error } = await manager.capabilities.get(OperationInvoker).invokePromise(definition, input, options);
105
+ if (error) throw error;
106
+ return data;
107
+ };
108
+ };
109
+ //#endregion
110
+ export { setup as n, Devtools_exports as t };
111
+
112
+ //# sourceMappingURL=chunk-Devtools.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Devtools.mjs","names":["Capabilities.OperationHandler","Capabilities.OperationInvoker"],"sources":["../../src/Devtools.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Result from 'effect/Result';\nimport * as Schema from 'effect/Schema';\nimport * as SchemaIssue from 'effect/SchemaIssue';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport * as SchemaAST from '@dxos/effect/SchemaAST';\nimport { DXN } from '@dxos/keys';\n\nimport * as Capabilities from './common/capabilities.ts';\nimport { type PluginManager } from './core/index.ts';\n\n/** Summary of one registered plugin. */\nexport type PluginInfo = {\n id: string;\n name?: string;\n description?: string;\n /** Core plugins cannot be disabled. */\n core: boolean;\n enabled: boolean;\n /** At least one of the plugin's modules has activated. */\n active: boolean;\n moduleIds: string[];\n};\n\n/** One top-level field of an operation's input or output. */\nexport type OperationField = {\n name: string;\n optional: boolean;\n /** Rendered type, truncated — enough to choose a value, not a substitute for the schema. */\n type: string;\n};\n\n/** Summary of one operation, enumerated without loading its handler. */\nexport type OperationInfo = {\n key: string;\n name?: string;\n description?: string;\n /** Derived from the contributing module id; absent when the operation came from outside a plugin. */\n pluginId?: string;\n moduleId?: string;\n /** Top-level input fields. Absent when the input is not a struct (e.g. `Schema.Void`). */\n input?: OperationField[];\n /** Top-level output fields. Absent when the output is not a struct. */\n output?: OperationField[];\n};\n\n/**\n * `globalThis.composer` — the app-layer console namespace, the counterpart to `__DXOS__`/`dxos`\n * (client and ECHO). Populated as the app boots, so every member is optional; the declaration buys\n * type-checking at call sites, not a presence guarantee.\n *\n * An interface rather than a type alias so apps can declaration-merge their own debug hooks onto it\n * — a second `declare global { var composer }` elsewhere would collide with this one instead.\n */\nexport interface ComposerDevtools {\n manager?: PluginManager.PluginManager;\n plugins?: () => PluginInfo[];\n operations?: (pluginId?: string) => OperationInfo[];\n invoke?: (key: string, input?: unknown, options?: Operation.InvokeOptions) => Promise<unknown>;\n [key: string]: unknown;\n}\n\ndeclare global {\n // eslint-disable-next-line no-var\n var composer: ComposerDevtools | undefined;\n}\n\n/**\n * Module ids are `org.dxos.plugin.<slug>.module.<name>`; the plugin id is everything before\n * `.module.`. Returns undefined for ids that do not follow the convention.\n */\nconst pluginIdOf = (moduleId: string): string | undefined => {\n const index = moduleId.indexOf('.module.');\n return index === -1 ? undefined : moduleId.slice(0, index);\n};\n\n/** Rendered types carry the field's description annotation, which can be a paragraph. */\nconst MAX_TYPE_LENGTH = 60;\n\n/**\n * Top-level fields of a struct schema, so `operations()` says what an operation takes rather than\n * only what it is called. Non-struct schemas (`Schema.Void`, unions) have no field list.\n */\nconst formatIssue = SchemaIssue.makeFormatterStandardSchemaV1();\n\nconst fieldsOf = (schema: Schema.Top | undefined): OperationField[] | undefined => {\n const ast = schema?.ast;\n if (!ast || !SchemaAST.isObjects(ast)) {\n return undefined;\n }\n return SchemaAST.getPropertySignatures(ast).map((property) => {\n const type = String(property.type);\n return {\n name: String(property.name),\n optional: SchemaAST.isOptional(property.type),\n type: type.length > MAX_TYPE_LENGTH ? `${type.slice(0, MAX_TYPE_LENGTH)}…` : type,\n };\n });\n};\n\n/**\n * Attaches the plugin/operation console API to `globalThis.composer`.\n *\n * Lives at the framework level rather than in a devtools plugin so it is present in any app and\n * does not depend on which plugins happen to be enabled — inspecting a broken plugin set is\n * exactly when this is wanted.\n */\nexport const setup = (manager: PluginManager.PluginManager): void => {\n const listOperations = (pluginId?: string): OperationInfo[] => {\n const byModule = manager.registry.get(manager.capabilities.atomByModule(Capabilities.OperationHandler));\n return Object.entries(byModule).flatMap(([moduleId, sets]) => {\n const owner = pluginIdOf(moduleId);\n if (pluginId && owner !== pluginId) {\n return [];\n }\n // `definitions()` is the enumerate-without-loading path; `getHandlers()` would pull every\n // lazily-imported handler module just to list them.\n return sets.flatMap((set) =>\n set.definitions().map((definition) => ({\n key: definition.meta.key,\n name: definition.meta.name,\n description: definition.meta.description,\n pluginId: owner,\n moduleId,\n input: fieldsOf(definition.input),\n output: fieldsOf(definition.output),\n })),\n );\n });\n };\n\n // Definitions carry DXN-form keys, so accept either that or the bare NSID — same normalization\n // the handler sets apply, so whatever `operations()` prints can be pasted straight into `invoke`.\n // `isDXN` is only a `dxn:` prefix check, so a hand-typed `dxn:` would throw out of `getName` and\n // abort the whole lookup; fall back to the raw key and let it miss as \"Unknown operation\".\n const normalizeKey = (key: string): string => {\n if (!DXN.isDXN(key)) {\n return key;\n }\n try {\n return DXN.getName(key);\n } catch {\n return key;\n }\n };\n\n const findDefinition = (key: string): Operation.Definition.Any | undefined => {\n const wanted = normalizeKey(key);\n for (const set of manager.capabilities.getAll(Capabilities.OperationHandler)) {\n const definition = set.definitions().find((candidate) => normalizeKey(candidate.meta.key) === wanted);\n if (definition) {\n return definition;\n }\n }\n return undefined;\n };\n\n const composer: ComposerDevtools = (globalThis.composer ??= {});\n composer.manager = manager;\n\n composer.plugins = () => {\n const core = new Set(manager.getCore());\n const enabled = new Set(manager.getEnabled());\n const active = new Set(manager.getActive());\n return manager.getPlugins().map((plugin) => {\n const id = plugin.meta.profile.key;\n return {\n id,\n name: plugin.meta.profile.name,\n description: plugin.meta.profile.description,\n core: core.has(id),\n enabled: enabled.has(id),\n active: plugin.modules.some((module) => active.has(module.id)),\n moduleIds: plugin.modules.map((module) => module.id),\n };\n });\n };\n\n composer.operations = listOperations;\n\n composer.invoke = async (key, input, options) => {\n const definition = findDefinition(key);\n if (!definition) {\n throw new Error(`Unknown operation: ${key} (try composer.operations())`);\n }\n\n // `invokePromise` does not validate its input: a payload missing a required field comes back\n // as `{ data: undefined }` with no error, and the operation quietly does nothing. Validating\n // here turns that silent no-op into the error the caller expected — the whole point of an\n // operation carrying a schema.\n // Validated against the TYPE side: callers pass decoded values, so decoding the codec would\n // report a materialized `Ref` as malformed at a path no caller can address.\n const validation = Schema.decodeUnknownResult(\n Schema.make<Schema.Codec<unknown, unknown>>(SchemaAST.toType(definition.input.ast)),\n {\n errors: 'all',\n },\n )(input);\n if (Result.isFailure(validation)) {\n // The flattened formatter over the tree one: the tree renders the whole schema before reaching\n // the offending field, burying `id: is missing` under a paragraph of unrelated shape.\n const issues = formatIssue(validation.failure.issue)\n .issues.map((issue) => `${issue.path?.join('.') || '(root)'}: ${issue.message}`)\n .join('; ');\n throw new Error(`Invalid input for ${key} — ${issues}`);\n }\n\n const invoker = manager.capabilities.get(Capabilities.OperationInvoker);\n // Forwarded as given: a database-backed operation resolves its space from `options.spaceId`,\n // which a caller on the debug port has no other way to supply.\n const { data, error } = await invoker.invokePromise(definition, input as never, options);\n if (error) {\n throw error;\n }\n return data;\n };\n};\n"],"mappings":";;;;;;;;;;;;;AA6EA,IAAM,cAAc,aAAyC;CAC3D,MAAM,QAAQ,SAAS,QAAQ,UAAU;CACzC,OAAO,UAAU,KAAK,KAAA,IAAY,SAAS,MAAM,GAAG,KAAK;AAC3D;;AAGA,IAAM,kBAAkB;;;;;AAMxB,IAAM,cAAc,YAAY,8BAA8B;AAE9D,IAAM,YAAY,WAAiE;CACjF,MAAM,MAAM,QAAQ;CACpB,IAAI,CAAC,OAAO,CAAC,UAAU,UAAU,GAAG,GAClC;CAEF,OAAO,UAAU,sBAAsB,GAAG,CAAC,CAAC,KAAK,aAAa;EAC5D,MAAM,OAAO,OAAO,SAAS,IAAI;EACjC,OAAO;GACL,MAAM,OAAO,SAAS,IAAI;GAC1B,UAAU,UAAU,WAAW,SAAS,IAAI;GAC5C,MAAM,KAAK,SAAS,kBAAkB,GAAG,KAAK,MAAM,GAAG,eAAe,EAAE,KAAK;EAC/E;CACF,CAAC;AACH;;;;;;;;AASA,IAAa,SAAS,YAA+C;CACnE,MAAM,kBAAkB,aAAuC;EAC7D,MAAM,WAAW,QAAQ,SAAS,IAAI,QAAQ,aAAa,aAAaA,gBAA6B,CAAC;EACtG,OAAO,OAAO,QAAQ,QAAQ,CAAC,CAAC,SAAS,CAAC,UAAU,UAAU;GAC5D,MAAM,QAAQ,WAAW,QAAQ;GACjC,IAAI,YAAY,UAAU,UACxB,OAAO,CAAC;GAIV,OAAO,KAAK,SAAS,QACnB,IAAI,YAAY,CAAC,CAAC,KAAK,gBAAgB;IACrC,KAAK,WAAW,KAAK;IACrB,MAAM,WAAW,KAAK;IACtB,aAAa,WAAW,KAAK;IAC7B,UAAU;IACV;IACA,OAAO,SAAS,WAAW,KAAK;IAChC,QAAQ,SAAS,WAAW,MAAM;GACpC,EAAE,CACJ;EACF,CAAC;CACH;CAMA,MAAM,gBAAgB,QAAwB;EAC5C,IAAI,CAAC,IAAI,MAAM,GAAG,GAChB,OAAO;EAET,IAAI;GACF,OAAO,IAAI,QAAQ,GAAG;EACxB,QAAQ;GACN,OAAO;EACT;CACF;CAEA,MAAM,kBAAkB,QAAsD;EAC5E,MAAM,SAAS,aAAa,GAAG;EAC/B,KAAK,MAAM,OAAO,QAAQ,aAAa,OAAOA,gBAA6B,GAAG;GAC5E,MAAM,aAAa,IAAI,YAAY,CAAC,CAAC,MAAM,cAAc,aAAa,UAAU,KAAK,GAAG,MAAM,MAAM;GACpG,IAAI,YACF,OAAO;EAEX;CAEF;CAEA,MAAM,WAA8B,WAAW,aAAa,CAAC;CAC7D,SAAS,UAAU;CAEnB,SAAS,gBAAgB;EACvB,MAAM,OAAO,IAAI,IAAI,QAAQ,QAAQ,CAAC;EACtC,MAAM,UAAU,IAAI,IAAI,QAAQ,WAAW,CAAC;EAC5C,MAAM,SAAS,IAAI,IAAI,QAAQ,UAAU,CAAC;EAC1C,OAAO,QAAQ,WAAW,CAAC,CAAC,KAAK,WAAW;GAC1C,MAAM,KAAK,OAAO,KAAK,QAAQ;GAC/B,OAAO;IACL;IACA,MAAM,OAAO,KAAK,QAAQ;IAC1B,aAAa,OAAO,KAAK,QAAQ;IACjC,MAAM,KAAK,IAAI,EAAE;IACjB,SAAS,QAAQ,IAAI,EAAE;IACvB,QAAQ,OAAO,QAAQ,MAAM,WAAW,OAAO,IAAI,OAAO,EAAE,CAAC;IAC7D,WAAW,OAAO,QAAQ,KAAK,WAAW,OAAO,EAAE;GACrD;EACF,CAAC;CACH;CAEA,SAAS,aAAa;CAEtB,SAAS,SAAS,OAAO,KAAK,OAAO,YAAY;EAC/C,MAAM,aAAa,eAAe,GAAG;EACrC,IAAI,CAAC,YACH,MAAM,IAAI,MAAM,sBAAsB,IAAI,6BAA6B;EASzE,MAAM,aAAa,OAAO,oBACxB,OAAO,KAAqC,UAAU,OAAO,WAAW,MAAM,GAAG,CAAC,GAClF,EACE,QAAQ,MACV,CACF,CAAC,CAAC,KAAK;EACP,IAAI,OAAO,UAAU,UAAU,GAAG;GAGhC,MAAM,SAAS,YAAY,WAAW,QAAQ,KAAK,CAAA,CAChD,OAAO,KAAK,UAAU,GAAG,MAAM,MAAM,KAAK,GAAG,KAAK,SAAS,IAAI,MAAM,SAAS,CAAA,CAC9E,KAAK,IAAI;GACZ,MAAM,IAAI,MAAM,qBAAqB,IAAI,KAAK,QAAQ;EACxD;EAKA,MAAM,EAAE,MAAM,UAAU,MAHR,QAAQ,aAAa,IAAIC,gBAGX,CAAA,CAAQ,cAAc,YAAY,OAAgB,OAAO;EACvF,IAAI,OACF,MAAM;EAER,OAAO;CACT;AACF"}
@@ -0,0 +1,35 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { C as pluginSlugOf, O as useActivationSignal, S as StartupTimeoutError, T as useApp, _ as useOptionalCapabilities, a as useSpaceService, b as STARTUP_ACTIVATED_EVENT, c as useAtomCapability, d as useCapability, f as useOperation, g as useOptionalAtomCapabilityState, h as useOptionalAtomCapability, i as useSpaceCallback, l as useAtomCapabilityState, m as useOperationInvoker, n as useSettingsState, o as LoadingState, p as useOperationHandler, r as useProcessManagerRuntime, s as useLoading, t as useSurface, u as useCapabilities, v as useOptionalCapability, w as pluginSlugOfKey, x as STARTUP_FAILED_EVENT, y as FIRST_INTERACTIVE_EVENT } from "./chunk-hooks.mjs";
3
+ //#region src/Hooks.ts
4
+ var Hooks_exports = /* @__PURE__ */ __exportAll({
5
+ FIRST_INTERACTIVE_EVENT: () => FIRST_INTERACTIVE_EVENT,
6
+ LoadingState: () => LoadingState,
7
+ STARTUP_ACTIVATED_EVENT: () => STARTUP_ACTIVATED_EVENT,
8
+ STARTUP_FAILED_EVENT: () => STARTUP_FAILED_EVENT,
9
+ StartupTimeoutError: () => StartupTimeoutError,
10
+ pluginSlugOf: () => pluginSlugOf,
11
+ pluginSlugOfKey: () => pluginSlugOfKey,
12
+ useActivationSignal: () => useActivationSignal,
13
+ useApp: () => useApp,
14
+ useAtomCapability: () => useAtomCapability,
15
+ useAtomCapabilityState: () => useAtomCapabilityState,
16
+ useCapabilities: () => useCapabilities,
17
+ useCapability: () => useCapability,
18
+ useLoading: () => useLoading,
19
+ useOperation: () => useOperation,
20
+ useOperationHandler: () => useOperationHandler,
21
+ useOperationInvoker: () => useOperationInvoker,
22
+ useOptionalAtomCapability: () => useOptionalAtomCapability,
23
+ useOptionalAtomCapabilityState: () => useOptionalAtomCapabilityState,
24
+ useOptionalCapabilities: () => useOptionalCapabilities,
25
+ useOptionalCapability: () => useOptionalCapability,
26
+ useProcessManagerRuntime: () => useProcessManagerRuntime,
27
+ useSettingsState: () => useSettingsState,
28
+ useSpaceCallback: () => useSpaceCallback,
29
+ useSpaceService: () => useSpaceService,
30
+ useSurface: () => useSurface
31
+ });
32
+ //#endregion
33
+ export { Hooks_exports as t };
34
+
35
+ //# sourceMappingURL=chunk-Hooks2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Hooks2.mjs","names":[],"sources":["../../src/Hooks.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from './ui/hooks/index.ts';\n"],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { PluginManagerProvider, useOptionalPluginManager, usePluginManager } from "./PluginManagerProvider.mjs";
3
+ //#region src/PluginManagerProvider.ts
4
+ var PluginManagerProvider_exports = /* @__PURE__ */ __exportAll({
5
+ Root: () => PluginManagerProvider,
6
+ useOptionalPluginManager: () => useOptionalPluginManager,
7
+ usePluginManager: () => usePluginManager
8
+ });
9
+ //#endregion
10
+ export { PluginManagerProvider_exports as t };
11
+
12
+ //# sourceMappingURL=chunk-PluginManagerProvider.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-PluginManagerProvider.mjs","names":[],"sources":["../../src/PluginManagerProvider.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport {\n PluginManagerProvider as Root,\n useOptionalPluginManager,\n usePluginManager,\n} from './ui/components/PluginManager/index.ts';\n"],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
2
  import { y as lazyModule } from "./chunk-capability.mjs";
3
- import { addModule, define, make as make$1, makeMeta } from "./core/plugin.mjs";
4
- import { AtomRegistry, HistoryTracker, LayerSpec, OperationHandler, OperationHandlers, OperationInvoker, ProcessManager, ProcessManagerRuntime, RemoteTraceMonitor, ServiceResolver, TraceSink, UndoMapping, UndoRegistry } from "./common/capabilities.mjs";
5
- import { Startup } from "./common/activation-events.mjs";
3
+ import { d as define, u as addModule, v as make$1, y as makeMeta } from "./chunk-plugin.mjs";
4
+ import { _ as ServiceResolver, a as LayerSpec, b as UndoRegistry, c as OperationHandlers, d as ProcessManager, f as ProcessManagerRuntime, g as RemoteTraceMonitor, l as OperationInvoker, r as HistoryTracker, s as OperationHandler, t as AtomRegistry, v as TraceSink, y as UndoMapping } from "./chunk-capabilities.mjs";
5
+ import { a as Startup } from "./chunk-activation-events.mjs";
6
6
  import * as Effect from "effect/Effect";
7
7
  import { DXN } from "@dxos/keys";
8
8
  import * as Layer from "effect/Layer";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-ProcessManagerPlugin.mjs","names":[],"sources":["../../src/plugin-process-manager/meta.ts","../../src/plugin-process-manager/idb-key-value-store.ts","../../src/plugin-process-manager/ProcessManagerPlugin.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { DXN } from '@dxos/keys';\n\nimport { Plugin } from '../core/index.ts';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.processManager'),\n name: 'Process Manager Plugin',\n author: 'DXOS',\n description:\n 'Hosts the process-manager runtime that composes contributed layer specs into a service resolver, exposes the operation invoker built on top of it, and registers undo/history tracking.',\n tags: ['system'],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as KeyValueStore from 'effect/persistence/KeyValueStore';\nimport * as idb from 'idb-keyval';\n\nconst DB_NAME = 'dxos-process-manager';\nconst STORE_NAME = 'keyval';\n\nconst idbError = (method: string, key: string, cause: unknown) =>\n new KeyValueStore.KeyValueStoreError({ message: String(cause), method, key, cause });\n\n/**\n * KeyValueStore layer backed by IndexedDB via idb-keyval.\n * Uses a dedicated IDB database (dxos-process-manager) so process records\n * survive page reloads without consuming the 5 MB localStorage quota.\n * Falls back to an in-memory store in environments without IndexedDB (e.g. Node.js tests).\n */\nexport const layerIdb: Layer.Layer<KeyValueStore.KeyValueStore> =\n typeof globalThis.indexedDB !== 'undefined'\n ? Layer.sync(KeyValueStore.KeyValueStore, () => {\n const store = idb.createStore(DB_NAME, STORE_NAME);\n return KeyValueStore.makeStringOnly({\n get: (key) =>\n Effect.tryPromise({\n try: () => idb.get<string>(key, store),\n catch: (err) => idbError('get', key, err),\n }),\n\n set: (key, value) =>\n Effect.tryPromise({\n try: () => idb.set(key, value, store),\n catch: (err) => idbError('set', key, err),\n }),\n\n remove: (key) =>\n Effect.tryPromise({\n try: () => idb.del(key, store),\n catch: (err) => idbError('remove', key, err),\n }),\n\n clear: Effect.tryPromise({\n try: () => idb.clear(store),\n catch: (err) => idbError('clear', '', err),\n }),\n\n size: Effect.tryPromise({\n try: () => idb.keys(store).then((ks) => ks.length),\n catch: (err) => idbError('size', '', err),\n }),\n });\n })\n : KeyValueStore.layerMemory;\n","//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { ActivationEvents, Capabilities } from '../common/index.ts';\nimport { Capability, Plugin } from '../core/index.ts';\nimport { meta } from './meta.ts';\n\nexport { meta };\nexport { layerIdb as storageLayer } from './idb-key-value-store.ts';\n\nconst ProcessManagerCapability = Capability.lazyModule(\n 'ProcessManager',\n {\n // Event-mode on Startup: the body snapshots multi capabilities (LayerSpec, TraceSink,\n // OperationHandler), so it must run after the full registry is in — the Startup wave\n // fires post-registration and pulls all inactive multi providers first. A streaming\n // dependency round could otherwise run it before later plugins' specs contribute.\n activatesOn: ActivationEvents.Startup,\n requires: [\n Capabilities.AtomRegistry,\n Capabilities.LayerSpec,\n Capabilities.TraceSink,\n Capabilities.OperationHandler,\n Capabilities.RemoteTraceMonitor,\n ],\n provides: [\n Capabilities.ProcessManagerRuntime,\n Capabilities.ServiceResolver,\n Capabilities.ProcessManager,\n Capabilities.OperationInvoker,\n Capabilities.OperationHandlers,\n ],\n },\n () => import('./process-manager-capability.ts'),\n);\n\nconst HistoryCapabilities = Capability.lazyModule(\n 'HistoryCapabilities',\n {\n requires: [Capabilities.UndoMapping, Capabilities.OperationInvoker],\n provides: [Capabilities.UndoRegistry, Capabilities.HistoryTracker],\n },\n () => import('./history/capability.ts'),\n);\n\nexport const make = Plugin.define(meta).pipe(\n Plugin.addModule(ProcessManagerCapability),\n Plugin.addModule(HistoryCapabilities),\n Plugin.make,\n);\n"],"mappings":";;;;;;;;;;;AAQA,IAAa,OAAO,SAAgB;CAClC,KAAK,IAAI,KAAK,gCAAgC;CAC9C,MAAM;CACN,QAAQ;CACR,aACE;CACF,MAAM,CAAC,QAAQ;AACjB,CAAC;;;ACND,IAAM,UAAU;AAChB,IAAM,aAAa;AAEnB,IAAM,YAAY,QAAgB,KAAa,UAC7C,IAAI,cAAc,mBAAmB;CAAE,SAAS,OAAO,KAAK;CAAG;CAAQ;CAAK;AAAM,CAAC;;;;;;;AAQrF,IAAa,WACX,OAAO,WAAW,cAAc,cAC5B,MAAM,KAAK,cAAc,qBAAqB;CAC5C,MAAM,QAAQ,IAAI,YAAY,SAAS,UAAU;CACjD,OAAO,cAAc,eAAe;EAClC,MAAM,QACJ,OAAO,WAAW;GAChB,WAAW,IAAI,IAAY,KAAK,KAAK;GACrC,QAAQ,QAAQ,SAAS,OAAO,KAAK,GAAG;EAC1C,CAAC;EAEH,MAAM,KAAK,UACT,OAAO,WAAW;GAChB,WAAW,IAAI,IAAI,KAAK,OAAO,KAAK;GACpC,QAAQ,QAAQ,SAAS,OAAO,KAAK,GAAG;EAC1C,CAAC;EAEH,SAAS,QACP,OAAO,WAAW;GAChB,WAAW,IAAI,IAAI,KAAK,KAAK;GAC7B,QAAQ,QAAQ,SAAS,UAAU,KAAK,GAAG;EAC7C,CAAC;EAEH,OAAO,OAAO,WAAW;GACvB,WAAW,IAAI,MAAM,KAAK;GAC1B,QAAQ,QAAQ,SAAS,SAAS,IAAI,GAAG;EAC3C,CAAC;EAED,MAAM,OAAO,WAAW;GACtB,WAAW,IAAI,KAAK,KAAK,CAAC,CAAC,MAAM,OAAO,GAAG,MAAM;GACjD,QAAQ,QAAQ,SAAS,QAAQ,IAAI,GAAG;EAC1C,CAAC;CACH,CAAC;AACH,CAAC,IACD,cAAc;;;;;;;;AC1CpB,IAAM,2BAA2B,WAC/B,kBACA;CAKE,aAAa;CACb,UAAU;EACR;EACA;EACA;EACA;EACA;CACF;CACA,UAAU;EACR;EACA;EACA;EACA;EACA;CACF;AACF,SACM,OAAO,yCACf;AAEA,IAAM,sBAAsB,WAC1B,uBACA;CACE,UAAU,CAAC,aAA0B,gBAA6B;CAClE,UAAU,CAAC,cAA2B,cAA2B;AACnE,SACM,OAAO,0BACf;AAEA,IAAa,OAAO,OAAc,IAAI,CAAC,CAAC,KACtC,UAAiB,wBAAwB,GACzC,UAAiB,mBAAmB,GACpC,MACF"}
1
+ {"version":3,"file":"chunk-ProcessManagerPlugin.mjs","names":["Plugin.makeMeta","Capability.lazyModule","ActivationEvents.Startup","Capabilities.AtomRegistry","Capabilities.LayerSpec","Capabilities.TraceSink","Capabilities.OperationHandler","Capabilities.RemoteTraceMonitor","Capabilities.ProcessManagerRuntime","Capabilities.ServiceResolver","Capabilities.ProcessManager","Capabilities.OperationInvoker","Capabilities.OperationHandlers","Capabilities.UndoMapping","Capabilities.UndoRegistry","Capabilities.HistoryTracker","Plugin.define","Plugin.addModule","Plugin.make"],"sources":["../../src/plugin-process-manager/meta.ts","../../src/plugin-process-manager/idb-key-value-store.ts","../../src/plugin-process-manager/ProcessManagerPlugin.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { DXN } from '@dxos/keys';\n\nimport { Plugin } from '../core/index.ts';\n\nexport const meta = Plugin.makeMeta({\n key: DXN.make('org.dxos.plugin.processManager'),\n name: 'Process Manager Plugin',\n author: 'DXOS',\n description:\n 'Hosts the process-manager runtime that composes contributed layer specs into a service resolver, exposes the operation invoker built on top of it, and registers undo/history tracking.',\n tags: ['system'],\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as KeyValueStore from 'effect/persistence/KeyValueStore';\nimport * as idb from 'idb-keyval';\n\nconst DB_NAME = 'dxos-process-manager';\nconst STORE_NAME = 'keyval';\n\nconst idbError = (method: string, key: string, cause: unknown) =>\n new KeyValueStore.KeyValueStoreError({ message: String(cause), method, key, cause });\n\n/**\n * KeyValueStore layer backed by IndexedDB via idb-keyval.\n * Uses a dedicated IDB database (dxos-process-manager) so process records\n * survive page reloads without consuming the 5 MB localStorage quota.\n * Falls back to an in-memory store in environments without IndexedDB (e.g. Node.js tests).\n */\nexport const layerIdb: Layer.Layer<KeyValueStore.KeyValueStore> =\n typeof globalThis.indexedDB !== 'undefined'\n ? Layer.sync(KeyValueStore.KeyValueStore, () => {\n const store = idb.createStore(DB_NAME, STORE_NAME);\n return KeyValueStore.makeStringOnly({\n get: (key) =>\n Effect.tryPromise({\n try: () => idb.get<string>(key, store),\n catch: (err) => idbError('get', key, err),\n }),\n\n set: (key, value) =>\n Effect.tryPromise({\n try: () => idb.set(key, value, store),\n catch: (err) => idbError('set', key, err),\n }),\n\n remove: (key) =>\n Effect.tryPromise({\n try: () => idb.del(key, store),\n catch: (err) => idbError('remove', key, err),\n }),\n\n clear: Effect.tryPromise({\n try: () => idb.clear(store),\n catch: (err) => idbError('clear', '', err),\n }),\n\n size: Effect.tryPromise({\n try: () => idb.keys(store).then((ks) => ks.length),\n catch: (err) => idbError('size', '', err),\n }),\n });\n })\n : KeyValueStore.layerMemory;\n","//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { ActivationEvents, Capabilities } from '../common/index.ts';\nimport { Capability, Plugin } from '../core/index.ts';\nimport { meta } from './meta.ts';\n\nexport { meta };\nexport { layerIdb as storageLayer } from './idb-key-value-store.ts';\n\nconst ProcessManagerCapability = Capability.lazyModule(\n 'ProcessManager',\n {\n // Event-mode on Startup: the body snapshots multi capabilities (LayerSpec, TraceSink,\n // OperationHandler), so it must run after the full registry is in — the Startup wave\n // fires post-registration and pulls all inactive multi providers first. A streaming\n // dependency round could otherwise run it before later plugins' specs contribute.\n activatesOn: ActivationEvents.Startup,\n requires: [\n Capabilities.AtomRegistry,\n Capabilities.LayerSpec,\n Capabilities.TraceSink,\n Capabilities.OperationHandler,\n Capabilities.RemoteTraceMonitor,\n ],\n provides: [\n Capabilities.ProcessManagerRuntime,\n Capabilities.ServiceResolver,\n Capabilities.ProcessManager,\n Capabilities.OperationInvoker,\n Capabilities.OperationHandlers,\n ],\n },\n () => import('./process-manager-capability.ts'),\n);\n\nconst HistoryCapabilities = Capability.lazyModule(\n 'HistoryCapabilities',\n {\n requires: [Capabilities.UndoMapping, Capabilities.OperationInvoker],\n provides: [Capabilities.UndoRegistry, Capabilities.HistoryTracker],\n },\n () => import('./history/capability.ts'),\n);\n\nexport const make = Plugin.define(meta).pipe(\n Plugin.addModule(ProcessManagerCapability),\n Plugin.addModule(HistoryCapabilities),\n Plugin.make,\n);\n"],"mappings":";;;;;;;;;;;AAQA,IAAa,OAAOA,SAAgB;CAClC,KAAK,IAAI,KAAK,gCAAgC;CAC9C,MAAM;CACN,QAAQ;CACR,aACE;CACF,MAAM,CAAC,QAAQ;AACjB,CAAC;;;ACND,IAAM,UAAU;AAChB,IAAM,aAAa;AAEnB,IAAM,YAAY,QAAgB,KAAa,UAC7C,IAAI,cAAc,mBAAmB;CAAE,SAAS,OAAO,KAAK;CAAG;CAAQ;CAAK;AAAM,CAAC;;;;;;;AAQrF,IAAa,WACX,OAAO,WAAW,cAAc,cAC5B,MAAM,KAAK,cAAc,qBAAqB;CAC5C,MAAM,QAAQ,IAAI,YAAY,SAAS,UAAU;CACjD,OAAO,cAAc,eAAe;EAClC,MAAM,QACJ,OAAO,WAAW;GAChB,WAAW,IAAI,IAAY,KAAK,KAAK;GACrC,QAAQ,QAAQ,SAAS,OAAO,KAAK,GAAG;EAC1C,CAAC;EAEH,MAAM,KAAK,UACT,OAAO,WAAW;GAChB,WAAW,IAAI,IAAI,KAAK,OAAO,KAAK;GACpC,QAAQ,QAAQ,SAAS,OAAO,KAAK,GAAG;EAC1C,CAAC;EAEH,SAAS,QACP,OAAO,WAAW;GAChB,WAAW,IAAI,IAAI,KAAK,KAAK;GAC7B,QAAQ,QAAQ,SAAS,UAAU,KAAK,GAAG;EAC7C,CAAC;EAEH,OAAO,OAAO,WAAW;GACvB,WAAW,IAAI,MAAM,KAAK;GAC1B,QAAQ,QAAQ,SAAS,SAAS,IAAI,GAAG;EAC3C,CAAC;EAED,MAAM,OAAO,WAAW;GACtB,WAAW,IAAI,KAAK,KAAK,CAAC,CAAC,MAAM,OAAO,GAAG,MAAM;GACjD,QAAQ,QAAQ,SAAS,QAAQ,IAAI,GAAG;EAC1C,CAAC;CACH,CAAC;AACH,CAAC,IACD,cAAc;;;;;;;;AC1CpB,IAAM,2BAA2BC,WAC/B,kBACA;CAKE,aAAaC;CACb,UAAU;EACRC;EACAC;EACAC;EACAC;EACAC;CACF;CACA,UAAU;EACRC;EACAC;EACAC;EACAC;EACAC;CACF;AACF,SACM,OAAO,yCACf;AAEA,IAAM,sBAAsBX,WAC1B,uBACA;CACE,UAAU,CAACY,aAA0BF,gBAA6B;CAClE,UAAU,CAACG,cAA2BC,cAA2B;AACnE,SACM,OAAO,0BACf;AAEA,IAAa,OAAOC,OAAc,IAAI,CAAC,CAAC,KACtCC,UAAiB,wBAAwB,GACzCA,UAAiB,mBAAmB,GACpCC,MACF"}
@@ -0,0 +1,19 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ //#region src/common/Role.ts
3
+ var Role_exports = /* @__PURE__ */ __exportAll({ make: () => make });
4
+ /**
5
+ * Mints a typed role token. The NSID is validated at compile time via
6
+ * {@link DXN.Name}: the final segment must be camelCase (no hyphens).
7
+ * Dynamic NSIDs (template-literal / runtime strings) are validated at runtime.
8
+ *
9
+ * Identity is structural; all tokens with the same `role` string are
10
+ * interchangeable at runtime.
11
+ */
12
+ var make = (nsid) => {
13
+ if (typeof nsid !== "string" || !/^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\.[a-zA-Z][a-zA-Z0-9]{0,62})$/.test(nsid)) throw new Error(`Invalid role NSID: "${nsid}". Must be a dotted name with a camelCase final segment (no hyphens in the last segment).`);
14
+ return { role: nsid };
15
+ };
16
+ //#endregion
17
+ export { make as n, Role_exports as t };
18
+
19
+ //# sourceMappingURL=chunk-Role.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Role.mjs","names":[],"sources":["../../src/common/Role.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport type { DXN } from '@dxos/keys';\n\n/**\n * A typed role token. Carries a role NSID for runtime dispatch plus a phantom\n * data type so consumers using `type={SomeToken}` and providers using\n * `AppSurface.object(SomeToken, ...)` share a single type-level contract.\n *\n * Mint via {@link make}. The `role` field holds the bare NSID (e.g.\n * `org.dxos.role.article`) — the dispatch key, `data-role` attribute value,\n * and what `.role` comparisons inside matched components see.\n */\nexport type Role<TData> = {\n readonly role: string;\n /** Covariant phantom; never accessed at runtime. */\n readonly _phantom?: TData;\n};\n\n/**\n * Narrow data type carried by a role token.\n */\nexport type Data<T> = T extends Role<infer D> ? D : never;\n\n/**\n * Mints a typed role token. The NSID is validated at compile time via\n * {@link DXN.Name}: the final segment must be camelCase (no hyphens).\n * Dynamic NSIDs (template-literal / runtime strings) are validated at runtime.\n *\n * Identity is structural; all tokens with the same `role` string are\n * interchangeable at runtime.\n */\nexport const make: {\n <TData = unknown, T extends string = string>(\n nsid: [DXN.Name<T>] extends [never] ? `Invalid NSID \"${T}\": final segment must be camelCase (no hyphens)` : T,\n ): Role<TData>;\n} = <TData>(nsid: string): Role<TData> => {\n // Runtime guard for dynamic NSIDs that bypass the compile-time DXN.Name<T> check.\n if (\n typeof nsid !== 'string' ||\n !/^[a-zA-Z]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(\\.[a-zA-Z][a-zA-Z0-9]{0,62})$/.test(\n nsid,\n )\n ) {\n throw new Error(\n `Invalid role NSID: \"${nsid}\". Must be a dotted name with a camelCase final segment (no hyphens in the last segment).`,\n );\n }\n return { role: nsid };\n};\n"],"mappings":";;;;;;;;;;;AAoCA,IAAa,QAID,SAA8B;CAExC,IACE,OAAO,SAAS,YAChB,CAAC,0HAA0H,KACzH,IACF,GAEA,MAAM,IAAI,MACR,uBAAuB,KAAK,0FAC9B;CAEF,OAAO,EAAE,MAAM,KAAK;AACtB"}
@@ -0,0 +1,11 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { DEFAULT_PACKAGES, isSharedPackage } from "./vite-plugin/packages.mjs";
3
+ //#region src/SharedPackages.ts
4
+ var SharedPackages_exports = /* @__PURE__ */ __exportAll({
5
+ DEFAULT_PACKAGES: () => DEFAULT_PACKAGES,
6
+ isSharedPackage: () => isSharedPackage
7
+ });
8
+ //#endregion
9
+ export { SharedPackages_exports as t };
10
+
11
+ //# sourceMappingURL=chunk-SharedPackages.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-SharedPackages.mjs","names":[],"sources":["../../src/SharedPackages.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from './vite-plugin/packages.ts';\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-Surface.mjs","names":[],"sources":["../../src/ui/components/Surface/types.ts","../../src/ui/components/Surface/Surface.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport type { ComponentType, FC, PropsWithChildren, ReactNode } from 'react';\n\nimport type { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { MakeOptional } from '@dxos/util';\nimport * as Position from '@dxos/util/Position';\n\nimport * as Role from '../../../common/Role.ts';\n\n/**\n * One entry in a {@link Filter} — a role NSID plus the guard that validates the\n * data shape when the Surface dispatcher is matching that role.\n */\nexport type Binding = {\n readonly role: string;\n readonly guard: (data: unknown) => boolean;\n};\n\n/**\n * Typed filter binding for {@link create}. Combines one or more `(role, guard)`\n * pairs so a provider can register against multiple roles while keeping the\n * role and its data shape in a single expression.\n */\nexport type Filter<TData> = {\n readonly bindings: ReadonlyArray<Binding>;\n /** Covariant phantom; never accessed at runtime. */\n readonly _phantom?: TData;\n};\n\n/**\n * Runtime guard for {@link Filter}. Distinguishes new-style filter bindings from\n * legacy predicate filters.\n */\nexport const isFilter = (value: unknown): value is Filter<any> =>\n typeof value === 'object' && value !== null && Array.isArray((value as { bindings?: unknown }).bindings);\n\n/**\n * Creates a {@link Filter} from a role token and an optional guard.\n *\n * When `guard` is omitted the filter matches any data at the token's role\n * (role-only dispatch). Pass a guard to add runtime data-shape validation on\n * top of the role match.\n *\n * This is the framework-level primitive; `@dxos/app-toolkit` builds richer\n * domain-aware helpers (ECHO schema checks, literal matching, etc.) on top of it.\n */\nexport const makeFilter = <TData>(token: Role.Role<TData>, guard?: (data: TData) => boolean): Filter<TData> => {\n const boundGuard =\n guard == null\n ? () => true\n : (data: unknown): boolean => {\n try {\n return guard(data as TData);\n } catch (err) {\n log.catch(err);\n return false;\n }\n };\n return { bindings: [{ role: token.role, guard: boundGuard }] };\n};\n\n/**\n * Typed Surface consumer props — carries the role/data-shape contract via a\n * {@link Role.Role}. The `type` prop is required; the string `role` prop has\n * been removed from the consumer-facing API.\n */\nexport type Props<T extends Record<string, any> = Record<string, unknown>> = {\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: FC<{ error: Error; data?: any }>;\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n} & MakeOptional<CoreProps<T>, 'id' | 'data'>;\n\n/**\n * Typed Surface consumer props — carries the role/data-shape contract via a\n * {@link Role.Role}. Available as a typed overload of the Surface component so\n * ad-hoc `type` fields on arbitrary spread props don't conflict with the\n * untyped consumer form.\n */\nexport type TypedProps<TToken extends Role.Role<any>> = {\n fallback?: FC<{ error: Error; data?: any }>;\n placeholder?: ReactNode;\n id?: string;\n type: TToken;\n data?: Role.Data<TToken>;\n limit?: number | undefined;\n} & {\n /**\n * Additional pass-through props. Known prop names are excluded so the\n * catch-all doesn't widen `data` / `type` / etc. to `any` at the intersection.\n */\n [K in keyof Record<string, any>]: K extends 'fallback' | 'placeholder' | 'id' | 'type' | 'data' | 'limit'\n ? never\n : any;\n};\n\n/**\n * NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.\n * The `type` prop is the only way to set the role; it is required here and\n * optional in {@link Props} via MakeOptional.\n */\nexport type CoreProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{\n /**\n * ID for debugging.\n */\n id: string;\n\n /**\n * The role token defining how the data should be rendered.\n */\n type: Role.Role<T>;\n\n /**\n * The data to be rendered by the surface.\n * NOTE: This must be a stable value.\n */\n data: T;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n}>;\n\nexport type ComponentProps<T extends Record<string, any> = Record<string, any>> = {\n /**\n * The resolved role NSID string (e.g. `org.dxos.role.article`). Present on\n * matched components only — multi-role containers can branch on this value\n * by comparing against a token's `.role` (e.g. `role === AppSurface.Section.role`).\n */\n role: string;\n} & PropsWithChildren<{\n id: string;\n data: T;\n limit?: number | undefined;\n}> &\n Record<string, any>;\n\n/**\n * React component used to render a surface once is has matched.\n */\nexport type ComponentFunction<T extends Record<string, any> = Record<string, any>> = (\n props: ComponentProps<T>,\n) => ReactNode;\n\n/**\n * Definition of when a React component surface should be rendered.\n *\n * The optional `filter` receives the consumer-supplied `role` as its second\n * argument so a single definition can encode role-specific guards (used by the\n * {@link Filter}-based `create` overload).\n *\n * @internal The `role` field is populated by the framework from the filter\n * bindings and is not authored directly.\n */\nexport type ReactDefinition<T extends Record<string, any> = any> = Readonly<{\n kind: 'react';\n id: string;\n role: string | string[];\n position?: Position.Position;\n component: ComponentType<any>;\n /** Maps the surface props onto the component's props; see {@link TypedReactDefinition.props}. */\n props?: (props: ComponentProps<T>) => Record<string, any>;\n filter?: (data: Record<string, unknown>, role?: string) => data is T;\n}>;\n\n/**\n * Definition of when a Web Component surface should be rendered.\n *\n * @internal The `role` field is populated by the framework from the filter\n * bindings and is not authored directly.\n */\nexport type WebComponentDefinition<T extends Record<string, any> = any> = Readonly<{\n kind: 'web-component';\n id: string;\n role: string | string[];\n position?: Position.Position;\n /**\n * The tag name of the Web Component to render.\n * The Web Component will receive the same props as React surfaces via properties/attributes.\n */\n tagName: string;\n filter?: (data: Record<string, unknown>, role?: string) => data is T;\n}>;\n\n/**\n * Definition of when a surface (React or Web Component) should be rendered.\n */\nexport type Definition<T extends Record<string, any> = any> = ReactDefinition<T> | WebComponentDefinition<T>;\n\n/**\n * Typed React surface definition — role is derived from the filter's bindings.\n */\nexport type TypedReactDefinition<\n T extends Record<string, any> = any,\n P extends Record<string, any> = ComponentProps<T>,\n Id extends string = string,\n> = Readonly<{\n id: [DXN.Path<Id>] extends [never]\n ? `Invalid id \"${Id}\": final segment must be camelCase — letters and digits, starting with a letter`\n : Id;\n filter: Filter<T>;\n position?: Position.Position;\n /**\n * Accepts any component type (not just a function) so a container re-exported through a\n * `lazy()` barrel as `ComponentType<any>` can be registered without a cast.\n */\n component: ComponentType<P>;\n /**\n * Maps the surface props onto the component's own props, so a plain container can be registered\n * directly instead of being wrapped in an adapter that unpacks `data`.\n *\n * Prefer this over an inline `component: ({ data }) => <Container … />`: the mapper's input type\n * derives from the same `filter` that defines the surface's data shape, so the unpacking is\n * checked against the filter rather than restated by hand.\n *\n * @example\n * Surface.create({\n * id: 'defaultPluginSettings',\n * filter: AppSurface.settings(AppSurface.Article),\n * component: DefaultSettings,\n * props: ({ data: { subject } }) => ({ subject }),\n * });\n */\n props?: (props: ComponentProps<T>) => P;\n}>;\n\n/**\n * Typed Web Component surface definition.\n */\nexport type TypedWebComponentDefinition<T extends Record<string, any> = any, Id extends string = string> = Readonly<{\n id: [DXN.Path<Id>] extends [never]\n ? `Invalid id \"${Id}\": final segment must be camelCase — letters and digits, starting with a letter`\n : Id;\n filter: Filter<T>;\n tagName: string;\n position?: Position.Position;\n}>;\n\nconst expandBindings = <T extends Record<string, any>>(\n filter: Filter<T>,\n): { role: string | string[]; guard: (data: Record<string, unknown>, role?: string) => data is T } => {\n const bindings = filter.bindings;\n const roles = Array.from(new Set(bindings.map((binding) => binding.role)));\n const guard = (data: Record<string, unknown>, role?: string): data is T => {\n if (role != null) {\n // Multiple bindings may share a role (e.g. via `oneOf` of same-role filters);\n // the role matches if ANY of them passes.\n return bindings.some((entry) => entry.role === role && entry.guard(data));\n }\n return bindings.some((entry) => entry.guard(data));\n };\n return { role: roles.length === 1 ? roles[0] : roles, guard };\n};\n\n/**\n * Creates a React surface definition from a typed filter.\n */\nexport function create<\n T extends Record<string, any> = any,\n P extends Record<string, any> = ComponentProps<T>,\n const Id extends string = string,\n>(definition: TypedReactDefinition<T, P, Id>): ReactDefinition<T>;\nexport function create<\n T extends Record<string, any> = any,\n P extends Record<string, any> = ComponentProps<T>,\n const Id extends string = string,\n>(definition: TypedReactDefinition<T, P, Id>): ReactDefinition<T> {\n const { id, filter, component, props, position } = definition;\n const { role, guard } = expandBindings(filter);\n return { kind: 'react', id, role, position, component, props, filter: guard };\n}\n\n/**\n * Creates a Web Component surface definition from a typed filter.\n */\nexport function createWeb<T extends Record<string, any> = any, const Id extends string = string>(\n definition: TypedWebComponentDefinition<T, Id>,\n): WebComponentDefinition<T>;\nexport function createWeb<T extends Record<string, any> = any, const Id extends string = string>(\n definition: TypedWebComponentDefinition<T, Id>,\n): WebComponentDefinition<T> {\n const { id, filter, tagName, position } = definition;\n const { role, guard } = expandBindings(filter);\n return { kind: 'web-component', id, role, position, tagName, filter: guard };\n}\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { Role } from '../../../common/index.ts';\nimport { SurfaceContext } from './context.ts';\nimport { SurfaceComponent, useIsSurfaceAvailable } from './SurfaceComponent.tsx';\nimport {\n type MountedSurface,\n getMountedSurfaces,\n getSelectedSurfaceRole,\n isSurfaceDebugEnabled,\n setSelectedSurfaceRole,\n setSurfaceDebug,\n useMountedSurfaces,\n useSelectedSurfaceRole,\n} from './SurfaceDebug.tsx';\nimport { type SurfaceMetric, surfaceMetrics, useSurfaceMetrics } from './SurfaceMetrics.ts';\nimport {\n SurfaceProfilerProvider,\n aggregateSurfaceProfilerStats,\n useSurfaceProfilerCallback,\n useSurfaceProfilerClear,\n useSurfaceProfilerEntries,\n useSurfaceProfilerSnapshot,\n useSurfaceProfilerStats,\n} from './SurfaceProfilerContext.tsx';\nimport {\n type Binding as SurfaceBindingType,\n type ComponentProps as SurfaceComponentPropsType,\n type Definition as SurfaceDefinition,\n type Filter as SurfaceFilterType,\n type TypedProps as SurfaceTypedProps,\n create as createSurface,\n createWeb as createWebSurface,\n isFilter as isFilterFn,\n makeFilter as makeFilterFn,\n} from './types.ts';\n\nexport type Definition = SurfaceDefinition;\nexport const create = createSurface;\nexport const createWeb = createWebSurface;\n\nexport type Context = SurfaceContext;\nexport const Context = SurfaceContext;\n\nexport const Surface = SurfaceComponent;\nexport const useIsAvailable = useIsSurfaceAvailable;\n\nexport type Binding = SurfaceBindingType;\nexport type Filter<TData> = SurfaceFilterType<TData>;\nexport const makeFilter = makeFilterFn;\nexport const isFilter = isFilterFn;\n\nexport type TypedProps<TToken extends Role.Role<any>> = SurfaceTypedProps<TToken>;\n\n/** Props a matched surface component receives, and the input to a definition's `props` mapper. */\nexport type ComponentProps<T extends Record<string, any> = Record<string, any>> = SurfaceComponentPropsType<T>;\n\nexport const isDebugEnabled = isSurfaceDebugEnabled;\nexport const setDebug = setSurfaceDebug;\n\nexport const ProfilerProvider = SurfaceProfilerProvider;\nexport const useProfilerCallback = useSurfaceProfilerCallback;\nexport const useProfilerEntries = useSurfaceProfilerEntries;\nexport const useProfilerStats = useSurfaceProfilerStats;\nexport const useProfilerSnapshot = useSurfaceProfilerSnapshot;\nexport const aggregateProfilerStats = aggregateSurfaceProfilerStats;\nexport const useProfilerClear = useSurfaceProfilerClear;\n\nexport type Metric = SurfaceMetric;\nexport const useMetrics = useSurfaceMetrics;\nexport const clearMetrics = () => surfaceMetrics.clear();\nexport type Mounted = MountedSurface;\n/** The surfaces mounted right now (dev builds, or under a profiler provider), without subscribing. */\nexport const getMounted = getMountedSurfaces;\n/** The mounted surfaces, updated on mount and unmount. */\nexport const useMounted = useMountedSurfaces;\n/** Selects a role's mounted surfaces for the highlight overlay and the Surfaces card. */\nexport const select = setSelectedSurfaceRole;\nexport const getSelected = getSelectedSurfaceRole;\nexport const useSelected = useSelectedSurfaceRole;\n/** The current metrics without subscribing; see `useProfilerSnapshot`. */\nexport const getMetrics = (): SurfaceMetric[] => [...surfaceMetrics.getSnapshot()];\n"],"mappings":";;;;;;;;;AAqCA,IAAa,cAAY,UACvB,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAS,MAAiC,QAAQ;;;;;;;;;;;AAYzG,IAAa,gBAAqB,OAAyB,UAAoD;CAC7G,MAAM,aACJ,SAAS,aACC,QACL,SAA2B;EAC1B,IAAI;GACF,OAAO,MAAM,IAAa;EAC5B,SAAS,KAAK;GACZ,IAAI,MAAM,KAAE,KAAA,GAAA;IAAA,YAAA;IAAA,GAAA;IAAA,GAAA;IAAA,GAAA,KAAA;GAAA,CAAC;GACb,OAAO;EACT;CACF;CACN,OAAO,EAAE,UAAU,CAAC;EAAE,MAAM,MAAM;EAAM,OAAO;CAAW,CAAC,EAAE;AAC/D;AA2LA,IAAM,kBACJ,WACoG;CACpG,MAAM,WAAW,OAAO;CACxB,MAAM,QAAQ,MAAM,KAAK,IAAI,IAAI,SAAS,KAAK,YAAY,QAAQ,IAAI,CAAC,CAAC;CACzE,MAAM,SAAS,MAA+B,SAA6B;EACzE,IAAI,QAAQ,MAGV,OAAO,SAAS,MAAM,UAAU,MAAM,SAAS,QAAQ,MAAM,MAAM,IAAI,CAAC;EAE1E,OAAO,SAAS,MAAM,UAAU,MAAM,MAAM,IAAI,CAAC;CACnD;CACA,OAAO;EAAE,MAAM,MAAM,WAAW,IAAI,MAAM,KAAK;EAAO;CAAM;AAC9D;AAUA,SAAgB,SAId,YAAgE;CAChE,MAAM,EAAE,IAAI,QAAQ,WAAW,OAAO,aAAa;CACnD,MAAM,EAAE,MAAM,UAAU,eAAe,MAAM;CAC7C,OAAO;EAAE,MAAM;EAAS;EAAI;EAAM;EAAU;EAAW;EAAO,QAAQ;CAAM;AAC9E;AAQA,SAAgB,YACd,YAC2B;CAC3B,MAAM,EAAE,IAAI,QAAQ,SAAS,aAAa;CAC1C,MAAM,EAAE,MAAM,UAAU,eAAe,MAAM;CAC7C,OAAO;EAAE,MAAM;EAAiB;EAAI;EAAM;EAAU;EAAS,QAAQ;CAAM;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChQA,IAAa,SAAS;AACtB,IAAa,YAAY;AAGzB,IAAa,UAAU;AAEvB,IAAa,UAAU;AACvB,IAAa,iBAAiB;AAI9B,IAAa,aAAa;AAC1B,IAAa,WAAW;AAOxB,IAAa,iBAAiB;AAC9B,IAAa,WAAW;AAExB,IAAa,mBAAmB;AAChC,IAAa,sBAAsB;AACnC,IAAa,qBAAqB;AAClC,IAAa,mBAAmB;AAChC,IAAa,sBAAsB;AACnC,IAAa,yBAAyB;AACtC,IAAa,mBAAmB;AAGhC,IAAa,aAAa;AAC1B,IAAa,qBAAqB,eAAe,MAAM;;AAGvD,IAAa,aAAa;;AAE1B,IAAa,aAAa;;AAE1B,IAAa,SAAS;AACtB,IAAa,cAAc;AAC3B,IAAa,cAAc;;AAE3B,IAAa,mBAAoC,CAAC,GAAG,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"chunk-Surface.mjs","names":["isFilter","makeFilter","create","createWeb","createSurface","createWebSurface","makeFilterFn","isFilterFn"],"sources":["../../src/ui/components/Surface/types.ts","../../src/ui/components/Surface/Surface.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport type { ComponentType, FC, PropsWithChildren, ReactNode } from 'react';\n\nimport type { DXN } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { MakeOptional } from '@dxos/util';\nimport * as Position from '@dxos/util/Position';\n\nimport * as Role from '../../../common/Role.ts';\n\n/**\n * One entry in a {@link Filter} — a role NSID plus the guard that validates the\n * data shape when the Surface dispatcher is matching that role.\n */\nexport type Binding = {\n readonly role: string;\n readonly guard: (data: unknown) => boolean;\n};\n\n/**\n * Typed filter binding for {@link create}. Combines one or more `(role, guard)`\n * pairs so a provider can register against multiple roles while keeping the\n * role and its data shape in a single expression.\n */\nexport type Filter<TData> = {\n readonly bindings: ReadonlyArray<Binding>;\n /** Covariant phantom; never accessed at runtime. */\n readonly _phantom?: TData;\n};\n\n/**\n * Runtime guard for {@link Filter}. Distinguishes new-style filter bindings from\n * legacy predicate filters.\n */\nexport const isFilter = (value: unknown): value is Filter<any> =>\n typeof value === 'object' && value !== null && Array.isArray((value as { bindings?: unknown }).bindings);\n\n/**\n * Creates a {@link Filter} from a role token and an optional guard.\n *\n * When `guard` is omitted the filter matches any data at the token's role\n * (role-only dispatch). Pass a guard to add runtime data-shape validation on\n * top of the role match.\n *\n * This is the framework-level primitive; `@dxos/app-toolkit` builds richer\n * domain-aware helpers (ECHO schema checks, literal matching, etc.) on top of it.\n */\nexport const makeFilter = <TData>(token: Role.Role<TData>, guard?: (data: TData) => boolean): Filter<TData> => {\n const boundGuard =\n guard == null\n ? () => true\n : (data: unknown): boolean => {\n try {\n return guard(data as TData);\n } catch (err) {\n log.catch(err);\n return false;\n }\n };\n return { bindings: [{ role: token.role, guard: boundGuard }] };\n};\n\n/**\n * Typed Surface consumer props — carries the role/data-shape contract via a\n * {@link Role.Role}. The `type` prop is required; the string `role` prop has\n * been removed from the consumer-facing API.\n */\nexport type Props<T extends Record<string, any> = Record<string, unknown>> = {\n /**\n * If specified, the Surface will be wrapped in an error boundary.\n * The fallback component will be rendered if an error occurs.\n */\n fallback?: FC<{ error: Error; data?: any }>;\n\n /**\n * If specified, the Surface will be wrapped in a suspense boundary.\n * The placeholder component will be rendered while the surface component is loading.\n */\n placeholder?: ReactNode;\n} & MakeOptional<CoreProps<T>, 'id' | 'data'>;\n\n/**\n * Typed Surface consumer props — carries the role/data-shape contract via a\n * {@link Role.Role}. Available as a typed overload of the Surface component so\n * ad-hoc `type` fields on arbitrary spread props don't conflict with the\n * untyped consumer form.\n */\nexport type TypedProps<TToken extends Role.Role<any>> = {\n fallback?: FC<{ error: Error; data?: any }>;\n placeholder?: ReactNode;\n id?: string;\n type: TToken;\n data?: Role.Data<TToken>;\n limit?: number | undefined;\n} & {\n /**\n * Additional pass-through props. Known prop names are excluded so the\n * catch-all doesn't widen `data` / `type` / etc. to `any` at the intersection.\n */\n [K in keyof Record<string, any>]: K extends 'fallback' | 'placeholder' | 'id' | 'type' | 'data' | 'limit'\n ? never\n : any;\n};\n\n/**\n * NOTE: If `[key: string]: unknown` is included in shared types, when re-used other fields become unknown as well.\n * The `type` prop is the only way to set the role; it is required here and\n * optional in {@link Props} via MakeOptional.\n */\nexport type CoreProps<T extends Record<string, any> = Record<string, unknown>> = PropsWithChildren<{\n /**\n * ID for debugging.\n */\n id: string;\n\n /**\n * The role token defining how the data should be rendered.\n */\n type: Role.Role<T>;\n\n /**\n * The data to be rendered by the surface.\n * NOTE: This must be a stable value.\n */\n data: T;\n\n /**\n * If more than one component is resolved, the limit determines how many are rendered.\n */\n limit?: number | undefined;\n}>;\n\nexport type ComponentProps<T extends Record<string, any> = Record<string, any>> = {\n /**\n * The resolved role NSID string (e.g. `org.dxos.role.article`). Present on\n * matched components only — multi-role containers can branch on this value\n * by comparing against a token's `.role` (e.g. `role === AppSurface.Section.role`).\n */\n role: string;\n} & PropsWithChildren<{\n id: string;\n data: T;\n limit?: number | undefined;\n}> &\n Record<string, any>;\n\n/**\n * React component used to render a surface once is has matched.\n */\nexport type ComponentFunction<T extends Record<string, any> = Record<string, any>> = (\n props: ComponentProps<T>,\n) => ReactNode;\n\n/**\n * Definition of when a React component surface should be rendered.\n *\n * The optional `filter` receives the consumer-supplied `role` as its second\n * argument so a single definition can encode role-specific guards (used by the\n * {@link Filter}-based `create` overload).\n *\n * @internal The `role` field is populated by the framework from the filter\n * bindings and is not authored directly.\n */\nexport type ReactDefinition<T extends Record<string, any> = any> = Readonly<{\n kind: 'react';\n id: string;\n role: string | string[];\n position?: Position.Position;\n component: ComponentType<any>;\n /** Maps the surface props onto the component's props; see {@link TypedReactDefinition.props}. */\n props?: (props: ComponentProps<T>) => Record<string, any>;\n filter?: (data: Record<string, unknown>, role?: string) => data is T;\n}>;\n\n/**\n * Definition of when a Web Component surface should be rendered.\n *\n * @internal The `role` field is populated by the framework from the filter\n * bindings and is not authored directly.\n */\nexport type WebComponentDefinition<T extends Record<string, any> = any> = Readonly<{\n kind: 'web-component';\n id: string;\n role: string | string[];\n position?: Position.Position;\n /**\n * The tag name of the Web Component to render.\n * The Web Component will receive the same props as React surfaces via properties/attributes.\n */\n tagName: string;\n filter?: (data: Record<string, unknown>, role?: string) => data is T;\n}>;\n\n/**\n * Definition of when a surface (React or Web Component) should be rendered.\n */\nexport type Definition<T extends Record<string, any> = any> = ReactDefinition<T> | WebComponentDefinition<T>;\n\n/**\n * Typed React surface definition — role is derived from the filter's bindings.\n */\nexport type TypedReactDefinition<\n T extends Record<string, any> = any,\n P extends Record<string, any> = ComponentProps<T>,\n Id extends string = string,\n> = Readonly<{\n id: [DXN.Path<Id>] extends [never]\n ? `Invalid id \"${Id}\": final segment must be camelCase — letters and digits, starting with a letter`\n : Id;\n filter: Filter<T>;\n position?: Position.Position;\n /**\n * Accepts any component type (not just a function) so a container re-exported through a\n * `lazy()` barrel as `ComponentType<any>` can be registered without a cast.\n */\n component: ComponentType<P>;\n /**\n * Maps the surface props onto the component's own props, so a plain container can be registered\n * directly instead of being wrapped in an adapter that unpacks `data`.\n *\n * Prefer this over an inline `component: ({ data }) => <Container … />`: the mapper's input type\n * derives from the same `filter` that defines the surface's data shape, so the unpacking is\n * checked against the filter rather than restated by hand.\n *\n * @example\n * Surface.create({\n * id: 'defaultPluginSettings',\n * filter: AppSurface.settings(AppSurface.Article),\n * component: DefaultSettings,\n * props: ({ data: { subject } }) => ({ subject }),\n * });\n */\n props?: (props: ComponentProps<T>) => P;\n}>;\n\n/**\n * Typed Web Component surface definition.\n */\nexport type TypedWebComponentDefinition<T extends Record<string, any> = any, Id extends string = string> = Readonly<{\n id: [DXN.Path<Id>] extends [never]\n ? `Invalid id \"${Id}\": final segment must be camelCase — letters and digits, starting with a letter`\n : Id;\n filter: Filter<T>;\n tagName: string;\n position?: Position.Position;\n}>;\n\nconst expandBindings = <T extends Record<string, any>>(\n filter: Filter<T>,\n): { role: string | string[]; guard: (data: Record<string, unknown>, role?: string) => data is T } => {\n const bindings = filter.bindings;\n const roles = Array.from(new Set(bindings.map((binding) => binding.role)));\n const guard = (data: Record<string, unknown>, role?: string): data is T => {\n if (role != null) {\n // Multiple bindings may share a role (e.g. via `oneOf` of same-role filters);\n // the role matches if ANY of them passes.\n return bindings.some((entry) => entry.role === role && entry.guard(data));\n }\n return bindings.some((entry) => entry.guard(data));\n };\n return { role: roles.length === 1 ? roles[0] : roles, guard };\n};\n\n/**\n * Creates a React surface definition from a typed filter.\n */\nexport function create<\n T extends Record<string, any> = any,\n P extends Record<string, any> = ComponentProps<T>,\n const Id extends string = string,\n>(definition: TypedReactDefinition<T, P, Id>): ReactDefinition<T>;\nexport function create<\n T extends Record<string, any> = any,\n P extends Record<string, any> = ComponentProps<T>,\n const Id extends string = string,\n>(definition: TypedReactDefinition<T, P, Id>): ReactDefinition<T> {\n const { id, filter, component, props, position } = definition;\n const { role, guard } = expandBindings(filter);\n return { kind: 'react', id, role, position, component, props, filter: guard };\n}\n\n/**\n * Creates a Web Component surface definition from a typed filter.\n */\nexport function createWeb<T extends Record<string, any> = any, const Id extends string = string>(\n definition: TypedWebComponentDefinition<T, Id>,\n): WebComponentDefinition<T>;\nexport function createWeb<T extends Record<string, any> = any, const Id extends string = string>(\n definition: TypedWebComponentDefinition<T, Id>,\n): WebComponentDefinition<T> {\n const { id, filter, tagName, position } = definition;\n const { role, guard } = expandBindings(filter);\n return { kind: 'web-component', id, role, position, tagName, filter: guard };\n}\n","//\n// Copyright 2025 DXOS.org\n//\n\nimport { Role } from '../../../common/index.ts';\nimport { SurfaceContext } from './context.ts';\nimport { SurfaceComponent, useIsSurfaceAvailable } from './SurfaceComponent.tsx';\nimport {\n type MountedSurface,\n getMountedSurfaces,\n getSelectedSurfaceRole,\n isSurfaceDebugEnabled,\n setSelectedSurfaceRole,\n setSurfaceDebug,\n useMountedSurfaces,\n useSelectedSurfaceRole,\n} from './SurfaceDebug.tsx';\nimport { type SurfaceMetric, surfaceMetrics, useSurfaceMetrics } from './SurfaceMetrics.ts';\nimport {\n SurfaceProfilerProvider,\n aggregateSurfaceProfilerStats,\n useSurfaceProfilerCallback,\n useSurfaceProfilerClear,\n useSurfaceProfilerEntries,\n useSurfaceProfilerSnapshot,\n useSurfaceProfilerStats,\n} from './SurfaceProfilerContext.tsx';\nimport {\n type Binding as SurfaceBindingType,\n type ComponentProps as SurfaceComponentPropsType,\n type Definition as SurfaceDefinition,\n type Filter as SurfaceFilterType,\n type TypedProps as SurfaceTypedProps,\n create as createSurface,\n createWeb as createWebSurface,\n isFilter as isFilterFn,\n makeFilter as makeFilterFn,\n} from './types.ts';\n\nexport type Definition = SurfaceDefinition;\nexport const create = createSurface;\nexport const createWeb = createWebSurface;\n\nexport type Context = SurfaceContext;\nexport const Context = SurfaceContext;\n\nexport const Surface = SurfaceComponent;\nexport const useIsAvailable = useIsSurfaceAvailable;\n\nexport type Binding = SurfaceBindingType;\nexport type Filter<TData> = SurfaceFilterType<TData>;\nexport const makeFilter = makeFilterFn;\nexport const isFilter = isFilterFn;\n\nexport type TypedProps<TToken extends Role.Role<any>> = SurfaceTypedProps<TToken>;\n\n/** Props a matched surface component receives, and the input to a definition's `props` mapper. */\nexport type ComponentProps<T extends Record<string, any> = Record<string, any>> = SurfaceComponentPropsType<T>;\n\nexport const isDebugEnabled = isSurfaceDebugEnabled;\nexport const setDebug = setSurfaceDebug;\n\nexport const ProfilerProvider = SurfaceProfilerProvider;\nexport const useProfilerCallback = useSurfaceProfilerCallback;\nexport const useProfilerEntries = useSurfaceProfilerEntries;\nexport const useProfilerStats = useSurfaceProfilerStats;\nexport const useProfilerSnapshot = useSurfaceProfilerSnapshot;\nexport const aggregateProfilerStats = aggregateSurfaceProfilerStats;\nexport const useProfilerClear = useSurfaceProfilerClear;\n\nexport type Metric = SurfaceMetric;\nexport const useMetrics = useSurfaceMetrics;\nexport const clearMetrics = () => surfaceMetrics.clear();\nexport type Mounted = MountedSurface;\n/** The surfaces mounted right now (dev builds, or under a profiler provider), without subscribing. */\nexport const getMounted = getMountedSurfaces;\n/** The mounted surfaces, updated on mount and unmount. */\nexport const useMounted = useMountedSurfaces;\n/** Selects a role's mounted surfaces for the highlight overlay and the Surfaces card. */\nexport const select = setSelectedSurfaceRole;\nexport const getSelected = getSelectedSurfaceRole;\nexport const useSelected = useSelectedSurfaceRole;\n/** The current metrics without subscribing; see `useProfilerSnapshot`. */\nexport const getMetrics = (): SurfaceMetric[] => [...surfaceMetrics.getSnapshot()];\n"],"mappings":";;;;;;;;;AAqCA,IAAaA,cAAY,UACvB,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAS,MAAiC,QAAQ;;;;;;;;;;;AAYzG,IAAaC,gBAAqB,OAAyB,UAAoD;CAC7G,MAAM,aACJ,SAAS,aACC,QACL,SAA2B;EAC1B,IAAI;GACF,OAAO,MAAM,IAAa;EAC5B,SAAS,KAAK;GACZ,IAAI,MAAM,KAAE,KAAA,GAAA;IAAA,YAAA;IAAA,GAAA;IAAA,GAAA;IAAA,GAAA,KAAA;GAAA,CAAC;GACb,OAAO;EACT;CACF;CACN,OAAO,EAAE,UAAU,CAAC;EAAE,MAAM,MAAM;EAAM,OAAO;CAAW,CAAC,EAAE;AAC/D;AA2LA,IAAM,kBACJ,WACoG;CACpG,MAAM,WAAW,OAAO;CACxB,MAAM,QAAQ,MAAM,KAAK,IAAI,IAAI,SAAS,KAAK,YAAY,QAAQ,IAAI,CAAC,CAAC;CACzE,MAAM,SAAS,MAA+B,SAA6B;EACzE,IAAI,QAAQ,MAGV,OAAO,SAAS,MAAM,UAAU,MAAM,SAAS,QAAQ,MAAM,MAAM,IAAI,CAAC;EAE1E,OAAO,SAAS,MAAM,UAAU,MAAM,MAAM,IAAI,CAAC;CACnD;CACA,OAAO;EAAE,MAAM,MAAM,WAAW,IAAI,MAAM,KAAK;EAAO;CAAM;AAC9D;AAUA,SAAgBC,SAId,YAAgE;CAChE,MAAM,EAAE,IAAI,QAAQ,WAAW,OAAO,aAAa;CACnD,MAAM,EAAE,MAAM,UAAU,eAAe,MAAM;CAC7C,OAAO;EAAE,MAAM;EAAS;EAAI;EAAM;EAAU;EAAW;EAAO,QAAQ;CAAM;AAC9E;AAQA,SAAgBC,YACd,YAC2B;CAC3B,MAAM,EAAE,IAAI,QAAQ,SAAS,aAAa;CAC1C,MAAM,EAAE,MAAM,UAAU,eAAe,MAAM;CAC7C,OAAO;EAAE,MAAM;EAAiB;EAAI;EAAM;EAAU;EAAS,QAAQ;CAAM;AAC7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChQA,IAAa,SAASC;AACtB,IAAa,YAAYC;AAGzB,IAAa,UAAU;AAEvB,IAAa,UAAU;AACvB,IAAa,iBAAiB;AAI9B,IAAa,aAAaC;AAC1B,IAAa,WAAWC;AAOxB,IAAa,iBAAiB;AAC9B,IAAa,WAAW;AAExB,IAAa,mBAAmB;AAChC,IAAa,sBAAsB;AACnC,IAAa,qBAAqB;AAClC,IAAa,mBAAmB;AAChC,IAAa,sBAAsB;AACnC,IAAa,yBAAyB;AACtC,IAAa,mBAAmB;AAGhC,IAAa,aAAa;AAC1B,IAAa,qBAAqB,eAAe,MAAM;;AAGvD,IAAa,aAAa;;AAE1B,IAAa,aAAa;;AAE1B,IAAa,SAAS;AACtB,IAAa,cAAc;AAC3B,IAAa,cAAc;;AAE3B,IAAa,mBAAoC,CAAC,GAAG,eAAe,YAAY,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { d as SurfaceManagerProvider, f as useSurfaceManager, t as SurfaceManager } from "./chunk-SurfaceManager.mjs";
3
+ import { C as useProfilerSnapshot, S as useProfilerEntries, T as useSelected, _ as useIsAvailable, a as aggregateProfilerStats, b as useProfilerCallback, c as createWeb, d as getSelected, f as isDebugEnabled, g as setDebug, h as select, l as getMetrics, m as makeFilter, n as ProfilerProvider, o as clearMetrics, p as isFilter, r as Surface, s as create, t as Context, u as getMounted, v as useMetrics, w as useProfilerStats, x as useProfilerClear, y as useMounted } from "./chunk-Surface.mjs";
4
+ //#region src/Surface.ts
5
+ var Surface_exports = /* @__PURE__ */ __exportAll({
6
+ Context: () => Context,
7
+ Manager: () => SurfaceManager,
8
+ ManagerProvider: () => SurfaceManagerProvider,
9
+ ProfilerProvider: () => ProfilerProvider,
10
+ Surface: () => Surface,
11
+ aggregateProfilerStats: () => aggregateProfilerStats,
12
+ clearMetrics: () => clearMetrics,
13
+ create: () => create,
14
+ createWeb: () => createWeb,
15
+ getMetrics: () => getMetrics,
16
+ getMounted: () => getMounted,
17
+ getSelected: () => getSelected,
18
+ isDebugEnabled: () => isDebugEnabled,
19
+ isFilter: () => isFilter,
20
+ makeFilter: () => makeFilter,
21
+ select: () => select,
22
+ setDebug: () => setDebug,
23
+ useIsAvailable: () => useIsAvailable,
24
+ useMetrics: () => useMetrics,
25
+ useMounted: () => useMounted,
26
+ useProfilerCallback: () => useProfilerCallback,
27
+ useProfilerClear: () => useProfilerClear,
28
+ useProfilerEntries: () => useProfilerEntries,
29
+ useProfilerSnapshot: () => useProfilerSnapshot,
30
+ useProfilerStats: () => useProfilerStats,
31
+ useSelected: () => useSelected,
32
+ useSurfaceManager: () => useSurfaceManager
33
+ });
34
+ //#endregion
35
+ export { Surface_exports as t };
36
+
37
+ //# sourceMappingURL=chunk-Surface2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Surface2.mjs","names":[],"sources":["../../src/Surface.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nexport * from './ui/components/Surface/Surface.ts';\nexport {\n SurfaceManager as Manager,\n SurfaceManagerProvider as ManagerProvider,\n useSurfaceManager,\n} from './ui/components/Surface/index.ts';\nexport type {\n SurfaceProfilerEntry as ProfilerEntry,\n SurfaceProfilerStats as ProfilerStats,\n} from './ui/components/Surface/index.ts';\n"],"mappings":""}
@@ -1,6 +1,6 @@
1
- import { eventKey, isAllOf, isOneOf } from "./core/activation-event.mjs";
2
- import { ReactSurface } from "./common/capabilities.mjs";
3
- import { SurfacesRequested } from "./common/activation-events.mjs";
1
+ import { a as eventKey, c as isOneOf, s as isAllOf } from "./chunk-activation-event.mjs";
2
+ import { h as ReactSurface } from "./chunk-capabilities.mjs";
3
+ import { o as SurfacesRequested } from "./chunk-activation-events.mjs";
4
4
  import { useOptionalPluginManager } from "./PluginManagerProvider.mjs";
5
5
  import { Fragment, Profiler, Suspense, createContext, createElement, memo, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";
6
6
  import { useAtomValue } from "@effect/atom-react/Hooks";