@dxos/app-framework 0.9.1-main.c7dcc2e112 → 0.10.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 (116) hide show
  1. package/dist/lib/browser/{capability-Z4MRP3CP.mjs → capability-S44TE2H7.mjs} +6 -6
  2. package/dist/lib/browser/{chunk-DFVSOBV2.mjs → chunk-KRJ4KK2W.mjs} +24 -5
  3. package/dist/lib/browser/{chunk-DFVSOBV2.mjs.map → chunk-KRJ4KK2W.mjs.map} +3 -3
  4. package/dist/lib/browser/{chunk-3UTDRCKX.mjs → chunk-LUH4Y5F2.mjs} +2 -2
  5. package/dist/lib/browser/{chunk-37PG7XJC.mjs → chunk-NKVRSMFN.mjs} +2 -2
  6. package/dist/lib/browser/{chunk-37PG7XJC.mjs.map → chunk-NKVRSMFN.mjs.map} +1 -1
  7. package/dist/lib/browser/{chunk-S2ZBYQPI.mjs → chunk-OO53M5UK.mjs} +2 -2
  8. package/dist/lib/browser/{chunk-CMINFVA5.mjs → chunk-OPTS3ZSN.mjs} +1 -1
  9. package/dist/lib/browser/{chunk-CMINFVA5.mjs.map → chunk-OPTS3ZSN.mjs.map} +2 -2
  10. package/dist/lib/browser/{chunk-SWECIICH.mjs → chunk-U5MESPM5.mjs} +6 -6
  11. package/dist/lib/browser/chunk-U5MESPM5.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-W4BHZING.mjs → chunk-UGYCLOXE.mjs} +3 -3
  13. package/dist/lib/browser/cli/index.mjs +5 -5
  14. package/dist/lib/browser/common/activation-events.mjs +4 -4
  15. package/dist/lib/browser/common/capabilities.mjs +5 -5
  16. package/dist/lib/browser/core/capability.mjs +1 -1
  17. package/dist/lib/browser/core/plugin-manager.mjs +3 -3
  18. package/dist/lib/browser/core/plugin.mjs +2 -2
  19. package/dist/lib/browser/core/url-loader.mjs +3 -3
  20. package/dist/lib/browser/index.mjs +7 -7
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/{process-manager-capability-RDROCCQD.mjs → process-manager-capability-QK4BMKMN.mjs} +6 -6
  23. package/dist/lib/browser/testing/index.mjs +7 -7
  24. package/dist/lib/browser/testing/react.mjs +6 -6
  25. package/dist/lib/browser/testing/react.mjs.map +2 -2
  26. package/dist/lib/browser/ui/index.mjs +9 -7
  27. package/dist/lib/node-esm/{capability-34Z6NPVR.mjs → capability-3YRF77LV.mjs} +6 -6
  28. package/dist/lib/node-esm/{chunk-WERVO5EK.mjs → chunk-4SE7SX7N.mjs} +2 -2
  29. package/dist/lib/node-esm/{chunk-H7T7XXLS.mjs → chunk-DRT75WGD.mjs} +6 -6
  30. package/dist/lib/node-esm/chunk-DRT75WGD.mjs.map +7 -0
  31. package/dist/lib/node-esm/{chunk-TEQSMP2O.mjs → chunk-FKMVORZN.mjs} +2 -2
  32. package/dist/lib/node-esm/{chunk-AIDZMJ3U.mjs → chunk-GLH4LGHZ.mjs} +1 -1
  33. package/dist/lib/node-esm/{chunk-AIDZMJ3U.mjs.map → chunk-GLH4LGHZ.mjs.map} +2 -2
  34. package/dist/lib/node-esm/{chunk-ZRTG4TSS.mjs → chunk-IL7O7IRX.mjs} +3 -3
  35. package/dist/lib/node-esm/{chunk-A4O42ZO3.mjs → chunk-ND2HETHD.mjs} +24 -5
  36. package/dist/lib/node-esm/{chunk-A4O42ZO3.mjs.map → chunk-ND2HETHD.mjs.map} +3 -3
  37. package/dist/lib/node-esm/{chunk-LUK3FCTH.mjs → chunk-XSZMX53L.mjs} +2 -2
  38. package/dist/lib/node-esm/{chunk-LUK3FCTH.mjs.map → chunk-XSZMX53L.mjs.map} +1 -1
  39. package/dist/lib/node-esm/cli/index.mjs +5 -5
  40. package/dist/lib/node-esm/common/activation-events.mjs +4 -4
  41. package/dist/lib/node-esm/common/capabilities.mjs +5 -5
  42. package/dist/lib/node-esm/core/capability.mjs +1 -1
  43. package/dist/lib/node-esm/core/plugin-manager.mjs +3 -3
  44. package/dist/lib/node-esm/core/plugin.mjs +2 -2
  45. package/dist/lib/node-esm/core/url-loader.mjs +3 -3
  46. package/dist/lib/node-esm/index.mjs +7 -7
  47. package/dist/lib/node-esm/meta.json +1 -1
  48. package/dist/lib/node-esm/{process-manager-capability-6OCXSKUW.mjs → process-manager-capability-5S7WZ2JR.mjs} +6 -6
  49. package/dist/lib/node-esm/testing/index.mjs +7 -7
  50. package/dist/lib/node-esm/testing/react.mjs +6 -6
  51. package/dist/lib/node-esm/testing/react.mjs.map +2 -2
  52. package/dist/lib/node-esm/ui/index.mjs +9 -7
  53. package/dist/plugin/node-esm/index.mjs +9 -11
  54. package/dist/plugin/node-esm/index.mjs.map +3 -3
  55. package/dist/plugin/node-esm/meta.json +1 -1
  56. package/dist/types/src/common/capabilities.d.ts +2 -2
  57. package/dist/types/src/common/capabilities.d.ts.map +1 -1
  58. package/dist/types/src/core/capability.d.ts +3 -1
  59. package/dist/types/src/core/capability.d.ts.map +1 -1
  60. package/dist/types/src/core/plugin.d.ts +8 -0
  61. package/dist/types/src/core/plugin.d.ts.map +1 -1
  62. package/dist/types/src/plugin-process-manager/history/capability.d.ts +1 -3
  63. package/dist/types/src/plugin-process-manager/history/capability.d.ts.map +1 -1
  64. package/dist/types/src/plugin-process-manager/meta.d.ts +4 -0
  65. package/dist/types/src/plugin-process-manager/meta.d.ts.map +1 -1
  66. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts +1 -4
  67. package/dist/types/src/plugin-process-manager/process-manager-capability.d.ts.map +1 -1
  68. package/dist/types/src/testing/react.d.ts.map +1 -1
  69. package/dist/types/src/ui/components/App/App.stories.d.ts +2 -2
  70. package/dist/types/src/ui/components/App/App.stories.d.ts.map +1 -1
  71. package/dist/types/src/ui/components/Surface/SurfaceComponent.d.ts.map +1 -1
  72. package/dist/types/src/ui/components/Surface/SurfaceComponent.stories.d.ts.map +1 -1
  73. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts +1 -1
  74. package/dist/types/src/ui/components/Surface/SurfaceProfilerContext.d.ts.map +1 -1
  75. package/dist/types/src/ui/components/Surface/context.d.ts.map +1 -1
  76. package/dist/types/src/ui/components/Surface/index.d.ts +1 -1
  77. package/dist/types/src/ui/components/Surface/index.d.ts.map +1 -1
  78. package/dist/types/src/ui/components/Surface/types.d.ts +2 -2
  79. package/dist/types/src/ui/components/Surface/types.d.ts.map +1 -1
  80. package/dist/types/src/ui/hooks/useCapabilities.d.ts +6 -0
  81. package/dist/types/src/ui/hooks/useCapabilities.d.ts.map +1 -1
  82. package/dist/types/src/vite-plugin/import-map/index.d.ts.map +1 -1
  83. package/dist/types/src/vite-plugin/packages.d.ts.map +1 -1
  84. package/dist/types/tsconfig.tsbuildinfo +1 -1
  85. package/docs/registry-spec.md +26 -26
  86. package/package.json +44 -38
  87. package/src/common/capabilities.ts +2 -2
  88. package/src/core/capability.ts +3 -2
  89. package/src/testing/react.tsx +1 -1
  90. package/src/ui/components/App/App.stories.tsx +2 -2
  91. package/src/ui/components/Surface/SurfaceComponent.stories.tsx +11 -8
  92. package/src/ui/components/Surface/SurfaceComponent.tsx +6 -5
  93. package/src/ui/components/Surface/SurfaceProfilerContext.tsx +1 -1
  94. package/src/ui/components/Surface/context.ts +0 -1
  95. package/src/ui/components/Surface/index.ts +2 -2
  96. package/src/ui/components/Surface/types.test.ts +4 -2
  97. package/src/ui/components/Surface/types.ts +4 -4
  98. package/src/ui/hooks/useCapabilities.ts +25 -0
  99. package/src/vite-plugin/boot-loader/BootLoader.solid-stories.tsx +11 -11
  100. package/src/vite-plugin/boot-loader/loader.ts +3 -3
  101. package/src/vite-plugin/composer/index.ts +1 -1
  102. package/src/vite-plugin/import-map/index.ts +23 -7
  103. package/src/vite-plugin/packages.ts +0 -1
  104. package/tsconfig.json +5 -2
  105. package/dist/lib/browser/chunk-SWECIICH.mjs.map +0 -7
  106. package/dist/lib/node-esm/chunk-H7T7XXLS.mjs.map +0 -7
  107. /package/dist/lib/browser/{capability-Z4MRP3CP.mjs.map → capability-S44TE2H7.mjs.map} +0 -0
  108. /package/dist/lib/browser/{chunk-3UTDRCKX.mjs.map → chunk-LUH4Y5F2.mjs.map} +0 -0
  109. /package/dist/lib/browser/{chunk-S2ZBYQPI.mjs.map → chunk-OO53M5UK.mjs.map} +0 -0
  110. /package/dist/lib/browser/{chunk-W4BHZING.mjs.map → chunk-UGYCLOXE.mjs.map} +0 -0
  111. /package/dist/lib/browser/{process-manager-capability-RDROCCQD.mjs.map → process-manager-capability-QK4BMKMN.mjs.map} +0 -0
  112. /package/dist/lib/node-esm/{capability-34Z6NPVR.mjs.map → capability-3YRF77LV.mjs.map} +0 -0
  113. /package/dist/lib/node-esm/{chunk-WERVO5EK.mjs.map → chunk-4SE7SX7N.mjs.map} +0 -0
  114. /package/dist/lib/node-esm/{chunk-TEQSMP2O.mjs.map → chunk-FKMVORZN.mjs.map} +0 -0
  115. /package/dist/lib/node-esm/{chunk-ZRTG4TSS.mjs.map → chunk-IL7O7IRX.mjs.map} +0 -0
  116. /package/dist/lib/node-esm/{process-manager-capability-6OCXSKUW.mjs.map → process-manager-capability-5S7WZ2JR.mjs.map} +0 -0
@@ -31,13 +31,13 @@ and will be renamed to a final namespace before promotion (see [Versioning](#ver
31
31
 
32
32
  The machine-readable lexicons are the canonical definition:
33
33
 
34
- - **Lexicon JSON** — `packages/sdk/edge-protocol/lexicons/org.dxos.experimental/*.json` (edge repo).
34
+ - **Lexicon JSON** — `packages/core/protocols/src/lexicons/org.dxos.experimental/*.json` (dxos repo).
35
35
  These are the source of truth.
36
- - **Effect-Schema validators** — `packages/sdk/edge-protocol/src/registry.ts`
37
- (edge repo). Decoders used at the indexing/validation seam to reject malformed records before they
38
- enter the store. These mirror the JSON lexicons and live alongside them in the protocol package.
39
- - **`PluginView`** `packages/core/protocols/src/edge/registry.ts` (dxos repo). The catalog shape
40
- the indexer serves to Composer.
36
+ - **`PluginView` + view schemas** — `packages/core/protocols/src/edge/registry.ts` (dxos repo). The
37
+ catalog shape the indexer serves to Composer, plus the shared profile/release view schemas.
38
+ - **Effect-Schema validators** `packages/services/registry-service/src/registry/atproto/schema.ts`
39
+ (edge repo). Indexer-side decoders that extend the view schemas with the raw ATProto record fields
40
+ (`pluginKey`, `manifestHash`), used to reject malformed records before they enter the store.
41
41
  - **CLI writers** — `packages/plugins/plugin-registry/src/commands/registry/` (dxos repo). The `dx`
42
42
  CLI assembles record bodies and writes them via XRPC.
43
43
  - **App-view / indexer** — `packages/services/registry-service/src/registry/atproto/{indexer,curator,backfill}.ts`
@@ -59,7 +59,7 @@ The machine-readable lexicons are the canonical definition:
59
59
  └─────────────┘
60
60
  ```
61
61
 
62
- 1. A publisher writes `package.profile` / `package.release` records (and a one-time
62
+ 1. A publisher writes `plugin.profile` / `plugin.release` records (and a one-time
63
63
  `publisher.profile`) to their own PDS using the `dx` CLI.
64
64
  2. A verifier writes `publisher.verification` records, one per trusted DID, to their own PDS.
65
65
  3. The indexer learns the verified-DID set, then ingests matching records from verified publishers —
@@ -73,8 +73,8 @@ The machine-readable lexicons are the canonical definition:
73
73
  | ---------------------------------------------- | ----------------- | --------- | -------------------------------------- |
74
74
  | `org.dxos.experimental.publisher.profile` | `self` | publisher | Identity-level publisher metadata. |
75
75
  | `org.dxos.experimental.publisher.verification` | `<verified DID>` | verifier | A trust attestation about a publisher. |
76
- | `org.dxos.experimental.package.profile` | `<key>` | publisher | Plugin metadata (one per key per DID). |
77
- | `org.dxos.experimental.package.release` | `<key>:<version>` | publisher | A versioned artifact of a package. |
76
+ | `org.dxos.experimental.plugin.profile` | `<key>` | publisher | Plugin metadata (one per key per DID). |
77
+ | `org.dxos.experimental.plugin.release` | `<key>:<version>` | publisher | A versioned artifact of a plugin. |
78
78
 
79
79
  All record bodies carry a `$type` field set to the NSID (standard ATProto convention; stamped by
80
80
  the CLI on write). All records live in the author's own repo and are therefore mutable by that
@@ -111,7 +111,7 @@ policy applied at indexing time, not a write-time restriction (see [Trust model]
111
111
 
112
112
  Written by `dx registry verify`.
113
113
 
114
- ### `package.profile`
114
+ ### `plugin.profile`
115
115
 
116
116
  Mutable metadata for a discoverable plugin. `rkey = <key>` (reverse-domain NSID, e.g.
117
117
  `org.dxos.plugin.excalidraw`). The `key` field is the plugin's globally-unique identifier and
@@ -134,16 +134,16 @@ matches the `key` in `dx.config.ts`.
134
134
  Written by `dx registry publish` (from the manifest emitted by `composerPlugin` reading `dx.config.ts`)
135
135
  or `dx registry publish-package`.
136
136
 
137
- ### `package.release`
137
+ ### `plugin.release`
138
138
 
139
- A record for one version of a package. `rkey = <key>:<version>`. Conceptually append-only: a new
139
+ A record for one version of a plugin. `rkey = <key>:<version>`. Conceptually append-only: a new
140
140
  version is a new record, and the registry treats the first release seen per `(did, key, version)`
141
141
  as canonical — but the author technically retains write access to it (see
142
142
  [Integrity & tamper detection](#integrity--tamper-detection)).
143
143
 
144
144
  | Field | Required | Type | Constraints | Notes |
145
145
  | -------------- | -------- | ----------------- | ----------- | ----------------------------------------------------------------------------------------------------------------- |
146
- | `package` | yes | string | ≤63 chars | Key of the parent `package.profile` authored by the same DID. |
146
+ | `pluginKey` | yes | string | ≤63 chars | Key of the parent `plugin.profile` authored by the same DID. |
147
147
  | `version` | yes | string | ≤32 chars | Semver subset without build metadata; pre-release suffixes allowed (`1.2.3-rc.1`). Taken from `package.json`. |
148
148
  | `moduleUrl` | yes | string (uri) | non-empty | HTTPS URL of the module entrypoint / `manifest.json`. v0 trusts the publisher; content addressing is a follow-on. |
149
149
  | `manifestHash` | no | string | ≤256 chars | Integrity hash of the module manifest, e.g. `sha256-<base64>`. |
@@ -162,7 +162,7 @@ makes the catalog trustworthy is the **indexing policy**, not a write gate:
162
162
 
163
163
  - **Today (single verifier).** The indexer is configured with one trusted verifier DID
164
164
  (`REGISTRY_CURATOR_DID`) and honors `publisher.verification` records **only** from that DID. The
165
- verified-DID set is the set of `subject`s across that verifier's records. A `package.*` or
165
+ verified-DID set is the set of `subject`s across that verifier's records. A `plugin.*` or
166
166
  `publisher.profile` record is indexed only if its author DID is in the verified set. This is a
167
167
  deliberate moderation simplification while the registry is young — not a protocol restriction.
168
168
  - **Revocation.** Deleting the verification record removes the publisher from the verified set on the
@@ -179,7 +179,7 @@ until a trusted verifier vouches for them.
179
179
  ## Integrity & tamper detection
180
180
 
181
181
  Immutability is an **app-view guarantee, not an AT Protocol one.** Like every AT Protocol repo, a
182
- publisher owns their PDS records and can mutate or delete any of them — including `package.release` —
182
+ publisher owns their PDS records and can mutate or delete any of them — including `plugin.release` —
183
183
  and no protocol mechanism makes a record cryptographically immutable. Enforcement therefore lives at
184
184
  the **registry app-view** (the edge service that indexes the firehose and serves the catalog to
185
185
  Composer): the PDS is the mutable source, and the app-view is the canonical, immutable view of what
@@ -199,7 +199,7 @@ What the app-view enforces:
199
199
 
200
200
  What stays mutable (the AT Protocol layer):
201
201
 
202
- - The PDS `package.release` record is written with `putRecord` (upsert), and the publisher can change
202
+ - The PDS `plugin.release` record is written with `putRecord` (upsert), and the publisher can change
203
203
  its `moduleUrl` / `manifestHash` at will. That is fine — the app-view's pin means such a change is not
204
204
  re-served (the PDS is the mutable source; the app-view is the canonical view).
205
205
 
@@ -217,9 +217,9 @@ publisher-trusted at the record level (the hosted bundle itself is already immut
217
217
 
218
218
  - **Bootstrap / backfill.** On first run (and periodically), the indexer walks the verifier's repo
219
219
  for verification records to compute the verified-DID set, then lists each verified publisher's repo
220
- for `package.*` records (`runBackfill`). The catalog (`GET /registry/plugins`) collects releases
221
- per `(authorDid, package-key)` — grouped by the release's `package` field, **not** by parsing the
222
- rkey — newest-first, anchored by `at://<authorDid>/org.dxos.experimental.package.profile/<key>`.
220
+ for `plugin.*` records (`runBackfill`). The catalog (`GET /registry/plugins`) collects releases
221
+ per `(authorDid, pluginKey)` — grouped by the release's `pluginKey` field, **not** by parsing the
222
+ rkey — newest-first, anchored by `at://<authorDid>/org.dxos.experimental.plugin.profile/<key>`.
223
223
  - **Live updates.** The indexer subscribes to the Jetstream firehose; commits for the four NSIDs are
224
224
  validated (Effect-Schema) and written/deleted in DO storage, keyed by `record:<nsid>|<did>|<rkey>`.
225
225
  - **Validation seam.** Malformed records are rejected at ingestion against the Effect-Schema mirrors
@@ -257,7 +257,7 @@ works if it was built against an SDK compatible with what Composer ships. DXOS s
257
257
  **Mechanism — the manifest dependency snapshot.** The build (`composerPlugin`) auto-populates a
258
258
  `dependencies` map into the plugin's `manifest.json`: every declared dependency resolved to its
259
259
  concrete installed version (`{ "@dxos/app-framework": "0.8.3", "react": "19.2.0", … }`). This flows
260
- into the `package.release` record and the catalog (`PluginRelease.dependencies`). The host computes
260
+ into the `plugin.release` record and the catalog (`PluginRelease.dependencies`). The host computes
261
261
  compatibility from the **subset it shares with the plugin** — the externalized `@dxos/*` packages —
262
262
  comparing each against its own shipped version under a policy (pre-1.0: **same minor**; post-1.0:
263
263
  caret). The remaining (bundled) deps are recorded for transparency/audit. A release with no
@@ -296,9 +296,9 @@ runtime sandbox surface is defined. (rkey conventions now match emdash, includin
296
296
  ## Schema reconciliation
297
297
 
298
298
  The JSON lexicons, the Effect-Schema validators, `PluginView`, and the CLI previously had field-level
299
- drift on `package.profile`. All items listed here are resolved.
299
+ drift on `plugin.profile`. All items listed here are resolved.
300
300
 
301
- - **`slug` → `key`** — the identity field on `package.profile` is now named `key` everywhere: the
301
+ - **`slug` → `key`** — the identity field on `plugin.profile` is now named `key` everywhere: the
302
302
  lexicon, the Effect-Schema validator, `PluginProfileSchema` in `@dxos/protocols`, the CLI flags
303
303
  (`--key`), and the runtime `Plugin.Meta.profile.key`.
304
304
  - **`homepage` → `homePage`** — camelCase alignment across the lexicon, validator, `PluginProfileSchema`,
@@ -308,12 +308,12 @@ drift on `package.profile`. All items listed here are resolved.
308
308
  - **`screenshots`** — unified as `{ light?, dark? }[]` (object-only form) across `dx.config.ts`,
309
309
  `PluginProfileSchema`, the validator, and the indexer projection. Plain URL strings are no longer
310
310
  accepted at authoring time; use `{ dark: 'url' }` or `{ light: 'url', dark: 'url' }`.
311
- - **`dependsOn`** — added to `package.profile` (author-declared runtime plugin deps, NSIDs),
311
+ - **`dependsOn`** — added to `plugin.profile` (author-declared runtime plugin deps, NSIDs),
312
312
  `PluginProfileSchema`, the validator, and `dx.config.ts`.
313
- - **`spec`** — added to `package.profile` (relative path to a bundled MDL spec),
313
+ - **`spec`** — added to `plugin.profile` (relative path to a bundled MDL spec),
314
314
  `PluginProfileSchema`, the validator, and `dx.config.ts`.
315
- - **`dependencies`** (SDK-compat snapshot on `package.release`) — `composerPlugin` emits the full
316
- resolved dependency map into `manifest.json`; the CLI writes it into the `package.release` record;
315
+ - **`dependencies`** (SDK-compat snapshot on `plugin.release`) — `composerPlugin` emits the full
316
+ resolved dependency map into `manifest.json`; the CLI writes it into the `plugin.release` record;
317
317
  the validator preserves it in storage; `PluginReleaseSchema` in `@dxos/protocols` types it.
318
318
 
319
319
  ## Open questions & follow-ons
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/app-framework",
3
- "version": "0.9.1-main.c7dcc2e112",
3
+ "version": "0.10.0",
4
4
  "description": "A framework for building applications from composible plugins.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -17,8 +17,13 @@
17
17
  "source": "./src/index.ts",
18
18
  "browser": "./dist/lib/browser/index.mjs",
19
19
  "node": "./dist/lib/node-esm/index.mjs",
20
+ "workerd": "./dist/lib/browser/index.mjs",
20
21
  "types": "./dist/types/src/index.d.ts"
21
22
  },
23
+ "./workerd": {
24
+ "types": "./dist/types/src/index.d.ts",
25
+ "default": "./dist/lib/browser/index.mjs"
26
+ },
22
27
  "./ActivationEvent": {
23
28
  "source": "./src/core/activation-event.ts",
24
29
  "browser": "./dist/lib/browser/activation-event/index.mjs",
@@ -101,58 +106,59 @@
101
106
  "@babel/preset-typescript": "^7.27.1",
102
107
  "@effect-atom/atom": "^0.5.3",
103
108
  "@effect/cli": "0.75.2",
104
- "@effect/platform": "0.96.1",
109
+ "@effect/platform": "0.96.2",
105
110
  "babel-preset-solid": "^1.9.9",
106
111
  "cjs-module-lexer": "^2.2.0",
107
112
  "esbuild": "0.28.1",
108
113
  "idb-keyval": "^6.2.1",
109
114
  "solid-js": "^1.9.11",
110
- "@dxos/async": "0.9.1-main.c7dcc2e112",
111
- "@dxos/compute-runtime": "0.9.1-main.c7dcc2e112",
112
- "@dxos/compute": "0.9.1-main.c7dcc2e112",
113
- "@dxos/context": "0.9.1-main.c7dcc2e112",
114
- "@dxos/debug": "0.9.1-main.c7dcc2e112",
115
- "@dxos/edge-client": "0.9.1-main.c7dcc2e112",
116
- "@dxos/effect": "0.9.1-main.c7dcc2e112",
117
- "@dxos/errors": "0.9.1-main.c7dcc2e112",
118
- "@dxos/operation": "0.9.1-main.c7dcc2e112",
119
- "@dxos/invariant": "0.9.1-main.c7dcc2e112",
120
- "@dxos/keys": "0.9.1-main.c7dcc2e112",
121
- "@dxos/log": "0.9.1-main.c7dcc2e112",
122
- "@dxos/protocols": "0.9.1-main.c7dcc2e112",
123
- "@dxos/react-error-boundary": "0.9.1-main.c7dcc2e112",
124
- "@dxos/react-hooks": "0.9.1-main.c7dcc2e112",
125
- "@dxos/react-ui": "0.9.1-main.c7dcc2e112",
126
- "@dxos/util": "0.9.1-main.c7dcc2e112",
127
- "@dxos/ui-theme": "0.9.1-main.c7dcc2e112",
128
- "@dxos/web-context": "0.9.1-main.c7dcc2e112",
129
- "@dxos/web-context-react": "0.9.1-main.c7dcc2e112"
115
+ "@dxos/async": "0.10.0",
116
+ "@dxos/compute-runtime": "0.10.0",
117
+ "@dxos/debug": "0.10.0",
118
+ "@dxos/effect": "0.10.0",
119
+ "@dxos/edge-client": "0.10.0",
120
+ "@dxos/errors": "0.10.0",
121
+ "@dxos/keys": "0.10.0",
122
+ "@dxos/log": "0.10.0",
123
+ "@dxos/invariant": "0.10.0",
124
+ "@dxos/operation": "0.10.0",
125
+ "@dxos/protocols": "0.10.0",
126
+ "@dxos/react-error-boundary": "0.10.0",
127
+ "@dxos/react-hooks": "0.10.0",
128
+ "@dxos/react-ui": "0.10.0",
129
+ "@dxos/react-ui-list": "0.10.0",
130
+ "@dxos/ui-theme": "0.10.0",
131
+ "@dxos/util": "0.10.0",
132
+ "@dxos/web-context": "0.10.0",
133
+ "@dxos/web-context-react": "0.10.0",
134
+ "@dxos/compute": "0.10.0",
135
+ "@dxos/context": "0.10.0"
130
136
  },
131
137
  "devDependencies": {
132
138
  "@effect-atom/atom-react": "^0.5.0",
133
- "@effect/platform": "0.96.1",
139
+ "@effect/platform": "0.96.2",
134
140
  "@effect/vitest": "0.29.0",
135
- "@testing-library/react": "^16.3.0",
136
- "@types/react": "~19.2.7",
137
- "effect": "3.21.3",
138
- "react": "~19.2.3",
139
- "react-dom": "~19.2.3",
141
+ "@testing-library/react": "^16.3.2",
142
+ "@types/react": "~19.2.17",
143
+ "effect": "3.21.4",
144
+ "react": "~19.2.7",
145
+ "react-dom": "~19.2.7",
140
146
  "typedoc": "0.28.1",
141
147
  "vite": "^8.0.16",
142
148
  "vite-plugin-solid": "^2.11.12",
143
- "@dxos/brand": "0.9.1-main.c7dcc2e112",
144
- "@dxos/echo-client": "0.9.1-main.c7dcc2e112",
145
- "@dxos/random": "0.9.1-main.c7dcc2e112",
146
- "@dxos/test-utils": "0.9.1-main.c7dcc2e112",
147
- "@dxos/storybook-utils": "0.9.1-main.c7dcc2e112"
149
+ "@dxos/brand": "0.10.0",
150
+ "@dxos/echo-client": "0.10.0",
151
+ "@dxos/storybook-utils": "0.10.0",
152
+ "@dxos/test-utils": "0.10.0",
153
+ "@dxos/random": "0.10.0"
148
154
  },
149
155
  "peerDependencies": {
150
156
  "@effect-atom/atom-react": "^0.5.0",
151
- "@effect/platform": "0.96.1",
152
- "@testing-library/react": "^16.3.0",
153
- "effect": "3.21.3",
154
- "react": "~19.2.3",
155
- "react-dom": "~19.2.3"
157
+ "@effect/platform": "0.96.2",
158
+ "@testing-library/react": "^16.3.2",
159
+ "effect": "3.21.4",
160
+ "react": "~19.2.7",
161
+ "react-dom": "~19.2.7"
156
162
  },
157
163
  "publishConfig": {
158
164
  "access": "public"
@@ -13,9 +13,9 @@ import type * as Runtime$ from 'effect/Runtime';
13
13
  import type { FC, PropsWithChildren } from 'react';
14
14
 
15
15
  import type {
16
+ OperationHandlerSet,
16
17
  LayerSpec as LayerSpec$,
17
18
  Operation as Operation$,
18
- OperationHandlerSet,
19
19
  Process as Process$,
20
20
  ServiceResolver as ServiceResolver$,
21
21
  Trace as Trace$,
@@ -147,7 +147,7 @@ export const TraceSink = Capability$.make<TraceSinkFactory>('org.dxos.app-framew
147
147
  * const resolver = yield* Capability.get(Capabilities.ServiceResolver);
148
148
  * yield* effect.pipe(
149
149
  * Effect.provide(
150
- * ServiceResolver.provide({ space }, Database.Service, Feed.FeedService).pipe(
150
+ * ServiceResolver.provide({ space }, Database.Service).pipe(
151
151
  * Layer.provide(Layer.succeed(ServiceResolver.ServiceResolver, resolver)),
152
152
  * ),
153
153
  * ),
@@ -143,13 +143,14 @@ export type ModuleReturn = void | Any | Any[] | readonly Any[] | [Any, ...Any[]]
143
143
 
144
144
  /**
145
145
  * Helper to define the implementation of a capability.
146
+ * Returns the opaque base type so callers cannot discriminate on capability kind,
147
+ * keeping d.ts emit portable across packages.
146
148
  */
147
- // TODO(dmaretskyi): Make the return type non-generic so capabilities are non-discernable.
148
149
  export const contributes = <I extends InterfaceDef<any>>(
149
150
  interfaceDef: I,
150
151
  implementation: Capability<InterfaceDef.Implementation<I>>['implementation'],
151
152
  deactivate?: Capability<InterfaceDef.Implementation<I>>['deactivate'],
152
- ): Capability<I> => {
153
+ ): Any => {
153
154
  return {
154
155
  interface: interfaceDef,
155
156
  implementation,
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { RegistryContext } from '@effect-atom/atom-react';
6
- import { render as rtlRender, type RenderOptions, type RenderResult } from '@testing-library/react';
6
+ import { type RenderOptions, type RenderResult, render as rtlRender } from '@testing-library/react';
7
7
  import React, { type FC, Fragment, type PropsWithChildren, type ReactNode } from 'react';
8
8
 
9
9
  import { ContextProtocolProvider } from '@dxos/web-context-react';
@@ -50,9 +50,9 @@ const TestPlugin = Plugin.define<{ error?: boolean }>(
50
50
  Plugin.make,
51
51
  );
52
52
 
53
- type DefaultStoryProps = { plugins?: Plugin.Plugin[] };
53
+ type StoryArgs = { plugins?: Plugin.Plugin[] };
54
54
 
55
- const DefaultStory = ({ plugins }: DefaultStoryProps) => {
55
+ const DefaultStory = ({ plugins }: StoryArgs) => {
56
56
  const App = useApp({ plugins });
57
57
 
58
58
  return <App />;
@@ -6,7 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useCallback, useEffect, useRef, useState } from 'react';
7
7
 
8
8
  import { random } from '@dxos/random';
9
- import { List, ListItem, Panel, Toolbar } from '@dxos/react-ui';
9
+ import { Panel, Toolbar } from '@dxos/react-ui';
10
+ import { Listbox } from '@dxos/react-ui-list';
10
11
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
12
  import { type ColorStyles, getHashStyles, mx } from '@dxos/ui-theme';
12
13
 
@@ -112,13 +113,15 @@ const DefaultStory = () => {
112
113
  <Panel.Content className='grid grid-cols-2 h-full gap-4 overflow-hidden'>
113
114
  <SurfaceComponent type={ItemRole} data={selected ? { id: selected } : undefined} limit={1} ref={ref} />
114
115
  <div className='overflow-y-auto h-full'>
115
- <List>
116
- {surfaces.map((surface) => (
117
- <ListItem.Root key={surface.id} id={surface.id}>
118
- <ListItem.Heading classNames='flex items-center'>{surface.id}</ListItem.Heading>
119
- </ListItem.Root>
120
- ))}
121
- </List>
116
+ <Listbox.Root>
117
+ <Listbox.Content aria-label='Surfaces'>
118
+ {surfaces.map((surface) => (
119
+ <Listbox.Item key={surface.id} id={surface.id}>
120
+ <Listbox.ItemLabel classNames='flex items-center'>{surface.id}</Listbox.ItemLabel>
121
+ </Listbox.Item>
122
+ ))}
123
+ </Listbox.Content>
124
+ </Listbox.Root>
122
125
  </div>
123
126
  </Panel.Content>
124
127
  </Panel.Root>
@@ -20,11 +20,11 @@ import React, {
20
20
  import { log } from '@dxos/log';
21
21
  import { ErrorBoundary } from '@dxos/react-error-boundary';
22
22
  import { useDefaultValue } from '@dxos/react-hooks';
23
- import { byPosition } from '@dxos/util';
23
+ import { Position } from '@dxos/util';
24
24
 
25
25
  import { Capabilities } from '../../../common';
26
26
  import { type CapabilityManager } from '../../../core';
27
- import { usePluginManager } from '../PluginManager/PluginManagerProvider';
27
+ import { usePluginManager } from '../PluginManager';
28
28
  import { SurfaceContext } from './context';
29
29
  import { SurfaceInfo } from './SurfaceInfo';
30
30
  import { useSurfaceProfilerCallback } from './SurfaceProfilerContext';
@@ -37,7 +37,7 @@ import {
37
37
  type WebComponentDefinition,
38
38
  } from './types';
39
39
 
40
- const DEBUG = import.meta.env.VITE_DEBUG;
40
+ const DEBUG = import.meta.env?.VITE_DEBUG;
41
41
 
42
42
  const DEFAULT_PLACEHOLDER = <Fragment />;
43
43
 
@@ -270,7 +270,7 @@ const findCandidates = (surfaces: Definition[], { role, data }: { role: string;
270
270
  Array.isArray(definition.role) ? definition.role.includes(role) : definition.role === role,
271
271
  )
272
272
  .filter(({ filter }) => (filter ? filter(data ?? {}, role) : true))
273
- .toSorted(byPosition);
273
+ .toSorted(Position.compare);
274
274
  };
275
275
 
276
276
  /**
@@ -281,7 +281,7 @@ export const useSurfaces = () => {
281
281
  const surfacesByModule = useAtomValue(manager.capabilities.atomByModule(Capabilities.ReactSurface));
282
282
  return useMemo(() => {
283
283
  const result: Definition[] = [];
284
- for (const [moduleId, surfaces] of Object.entries(surfacesByModule)) {
284
+ for (const [_moduleId, surfaces] of Object.entries(surfacesByModule)) {
285
285
  for (const def of surfaces.flat()) {
286
286
  result.push(def);
287
287
  }
@@ -304,6 +304,7 @@ export function isSurfaceAvailable<TToken extends RoleToken<any>>(
304
304
  if (effectiveRole == null) {
305
305
  return false;
306
306
  }
307
+
307
308
  const surfaces = capabilityManager.getAll(Capabilities.ReactSurface);
308
309
  const candidates = findCandidates(surfaces.flat(), {
309
310
  role: effectiveRole,
@@ -4,8 +4,8 @@
4
4
 
5
5
  import React, {
6
6
  type Context,
7
- type PropsWithChildren,
8
7
  type ProfilerOnRenderCallback,
8
+ type PropsWithChildren,
9
9
  createContext,
10
10
  useContext,
11
11
  useMemo,
@@ -11,5 +11,4 @@ export type SurfaceContext = {
11
11
  data?: Record<string, any>;
12
12
  };
13
13
 
14
- // TODO(burdon): Use @radix-ui/react-context
15
14
  export const SurfaceContext: Context<SurfaceContext | undefined> = createContext<SurfaceContext | undefined>(undefined);
@@ -15,10 +15,10 @@ import {
15
15
  useSurfaceProfilerStats,
16
16
  } from './SurfaceProfilerContext';
17
17
  import {
18
- type Definition as SurfaceDefinition,
19
- type RoleToken as SurfaceRoleToken,
20
18
  type SurfaceBinding as SurfaceBindingType,
19
+ type Definition as SurfaceDefinition,
21
20
  type SurfaceFilter as SurfaceFilterType,
21
+ type RoleToken as SurfaceRoleToken,
22
22
  type TokenData as SurfaceTokenData,
23
23
  type TypedProps as SurfaceTypedProps,
24
24
  create as createSurface,
@@ -4,6 +4,8 @@
4
4
 
5
5
  import { describe, test } from 'vitest';
6
6
 
7
+ import { Position } from '@dxos/util';
8
+
7
9
  import { type CapabilityManager } from '../../../core';
8
10
  import { isSurfaceAvailable } from './SurfaceComponent';
9
11
  import { type RoleToken, type SurfaceFilter, create, isSurfaceFilter, makeFilter, makeType } from './types';
@@ -76,8 +78,8 @@ describe('create', () => {
76
78
  test('passes position through untouched', ({ expect }) => {
77
79
  const token = makeType<Record<string, any>>('org.dxos.test.role.r');
78
80
  const filter: SurfaceFilter<Record<string, any>> = { bindings: [{ role: token.role, guard: () => true }] };
79
- const def = create({ id: 'pos', filter, component: () => null, position: 'last' });
80
- expect(def.position).toBe('last');
81
+ const def = create({ id: 'pos', filter, component: () => null, position: Position.last });
82
+ expect(def.position).toBe(Position.last);
81
83
  });
82
84
  });
83
85
 
@@ -214,7 +214,7 @@ export type ReactDefinition<T extends Record<string, any> = any> = Readonly<{
214
214
  kind: 'react';
215
215
  id: string;
216
216
  role: string | string[];
217
- position?: Position;
217
+ position?: Position.Position;
218
218
  component: ComponentFunction<T>;
219
219
  filter?: (data: Record<string, unknown>, role?: string) => data is T;
220
220
  }>;
@@ -229,7 +229,7 @@ export type WebComponentDefinition<T extends Record<string, any> = any> = Readon
229
229
  kind: 'web-component';
230
230
  id: string;
231
231
  role: string | string[];
232
- position?: Position;
232
+ position?: Position.Position;
233
233
  /**
234
234
  * The tag name of the Web Component to render.
235
235
  * The Web Component will receive the same props as React surfaces via properties/attributes.
@@ -250,7 +250,7 @@ export type TypedReactDefinition<T extends Record<string, any> = any> = Readonly
250
250
  id: string;
251
251
  filter: SurfaceFilter<T>;
252
252
  component: ComponentFunction<T>;
253
- position?: Position;
253
+ position?: Position.Position;
254
254
  }>;
255
255
 
256
256
  /**
@@ -260,7 +260,7 @@ export type TypedWebComponentDefinition<T extends Record<string, any> = any> = R
260
260
  id: string;
261
261
  filter: SurfaceFilter<T>;
262
262
  tagName: string;
263
- position?: Position;
263
+ position?: Position.Position;
264
264
  }>;
265
265
 
266
266
  const expandBindings = <T extends Record<string, any>>(
@@ -15,6 +15,9 @@ import { useOptionalPluginManager, usePluginManager } from '../components';
15
15
  /** Stable empty result for capability lookups made outside a plugin manager. */
16
16
  const emptyCapabilities = Atom.make(() => [] as const);
17
17
 
18
+ /** Stable atom yielding `undefined`, used as the fallback for optional atom-capability lookups. */
19
+ const emptyAtomValue = Atom.make(() => undefined);
20
+
18
21
  /**
19
22
  * Hook to request capabilities from the plugin context.
20
23
  * @returns An array of capabilities.
@@ -84,6 +87,28 @@ export const useAtomCapabilityState = <T>(
84
87
  return [value, update];
85
88
  };
86
89
 
90
+ /**
91
+ * Tolerant variant of {@link useAtomCapabilityState}: returns `[undefined, noop]` when the atom
92
+ * capability is not registered (e.g. the contributing plugin is not installed) rather than
93
+ * throwing. The updater is a no-op while the capability is absent.
94
+ */
95
+ export const useOptionalAtomCapabilityState = <T>(
96
+ atomCapability: Capability.InterfaceDef<Atom.Writable<T>>,
97
+ ): [T | undefined, (fn: (current: T) => T) => void] => {
98
+ const registry = useOptionalCapability(Capabilities.AtomRegistry);
99
+ const atom = useOptionalCapability(atomCapability);
100
+ const value = useAtomValue(atom ?? emptyAtomValue);
101
+ const update = useCallback(
102
+ (fn: (current: T) => T) => {
103
+ if (registry && atom) {
104
+ registry.set(atom, fn(registry.get(atom)));
105
+ }
106
+ },
107
+ [registry, atom],
108
+ );
109
+ return [value, update];
110
+ };
111
+
87
112
  /**
88
113
  * Hook to get the operation invoker capability.
89
114
  */
@@ -148,12 +148,12 @@ const LoaderHarness = () => {
148
148
  {/* Float the controls above the loader's `z-index: 10` fixed backdrop. */}
149
149
  <div
150
150
  style={{
151
- position: 'fixed',
152
- top: '12px',
153
- left: '12px',
151
+ 'position': 'fixed',
152
+ 'top': '12px',
153
+ 'left': '12px',
154
154
  'z-index': 9999,
155
- display: 'flex',
156
- gap: '12px',
155
+ 'display': 'flex',
156
+ 'gap': '12px',
157
157
  'align-items': 'center',
158
158
  }}
159
159
  >
@@ -161,20 +161,20 @@ const LoaderHarness = () => {
161
161
  type='button'
162
162
  onClick={advance}
163
163
  style={{
164
- padding: '6px 14px',
164
+ 'padding': '6px 14px',
165
165
  'font-size': '13px',
166
166
  'font-weight': '600',
167
- color: '#fff',
168
- background: '#017ab7',
169
- border: 'none',
167
+ 'color': '#fff',
168
+ 'background': '#017ab7',
169
+ 'border': 'none',
170
170
  'border-radius': '6px',
171
- cursor: 'pointer',
171
+ 'cursor': 'pointer',
172
172
  'box-shadow': '0 1px 3px rgba(0,0,0,0.25)',
173
173
  }}
174
174
  >
175
175
  {sim() === 'creep' ? 'Start progress' : 'Finish + reset'}
176
176
  </button>
177
- <span style={{ 'font-family': 'ui-sans-serif, system-ui, sans-serif', 'font-size': '12px', color: '#888' }}>
177
+ <span style={{ 'font-family': 'ui-sans-serif, system-ui, sans-serif', 'font-size': '12px', 'color': '#888' }}>
178
178
  {sim()}
179
179
  </span>
180
180
  </div>
@@ -8,7 +8,7 @@ import * as babel from '@babel/core';
8
8
  import babelPresetTypeScript from '@babel/preset-typescript';
9
9
  // @ts-ignore — babel-preset-solid ships no .d.ts.
10
10
  import babelPresetSolid from 'babel-preset-solid';
11
- import { build, type Plugin as EsbuildPlugin } from 'esbuild';
11
+ import { type Plugin as EsbuildPlugin, build } from 'esbuild';
12
12
  import { basename, dirname } from 'node:path';
13
13
  import { fileURLToPath } from 'node:url';
14
14
  import { type Plugin } from 'vite';
@@ -181,8 +181,8 @@ export const bootLoaderPlugin = ({ status, markSvg, include = ['index.html'] }:
181
181
  tag: 'div',
182
182
  injectTo: 'body-prepend',
183
183
  attrs: {
184
- id: rootId,
185
- role: 'status',
184
+ 'id': rootId,
185
+ 'role': 'status',
186
186
  'aria-live': 'polite',
187
187
  'aria-label': 'Initializing',
188
188
  },
@@ -6,7 +6,7 @@ import { readFileSync } from 'node:fs';
6
6
  import { join } from 'node:path';
7
7
  import { type Plugin as VitePlugin } from 'vite';
8
8
 
9
- import { PLUGIN_DEV_SERVER_PORT, Plugin } from '../../core';
9
+ import { Plugin, PLUGIN_DEV_SERVER_PORT } from '../../core';
10
10
  import { findDxConfigFile, loadDxConfig } from '../load';
11
11
  import { type BuildMeta, ENTRY_FILENAME, MANIFEST_ASSET_NAME, serializeManifest, toBuildMeta } from '../manifest';
12
12
  import { DEFAULT_PACKAGES, isSharedPackage } from '../packages';