@crvouga/mockingbird-runtime 0.0.0-reserved → 0.0.1

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 (81) hide show
  1. package/README.md +130 -1
  2. package/dist/adapter-node.d.ts +2521 -0
  3. package/dist/adapter-node.js +6920 -0
  4. package/dist/adapter-node.js.map +7 -0
  5. package/dist/admin-ui.js +25 -0
  6. package/dist/admin-ui.js.map +7 -0
  7. package/dist/chunk-2KDYLZXC.js +118 -0
  8. package/dist/chunk-2KDYLZXC.js.map +7 -0
  9. package/dist/chunk-2Y25NPCV.js +1289 -0
  10. package/dist/chunk-2Y25NPCV.js.map +7 -0
  11. package/dist/chunk-4SAK6MQT.js +246 -0
  12. package/dist/chunk-4SAK6MQT.js.map +7 -0
  13. package/dist/chunk-ANCCZFF2.js +778 -0
  14. package/dist/chunk-ANCCZFF2.js.map +7 -0
  15. package/dist/chunk-EBGYPQPA.js +198 -0
  16. package/dist/chunk-EBGYPQPA.js.map +7 -0
  17. package/dist/chunk-EQLY2YOA.js +274 -0
  18. package/dist/chunk-EQLY2YOA.js.map +7 -0
  19. package/dist/chunk-G62YDIIJ.js +7664 -0
  20. package/dist/chunk-G62YDIIJ.js.map +7 -0
  21. package/dist/chunk-HU6IOAFC.js +437 -0
  22. package/dist/chunk-HU6IOAFC.js.map +7 -0
  23. package/dist/chunk-RNAHPNUJ.js +97 -0
  24. package/dist/chunk-RNAHPNUJ.js.map +7 -0
  25. package/dist/chunk-UP4QOSFD.js +87 -0
  26. package/dist/chunk-UP4QOSFD.js.map +7 -0
  27. package/dist/chunk-XNS34BPF.js +2489 -0
  28. package/dist/chunk-XNS34BPF.js.map +7 -0
  29. package/dist/core.d.ts +356 -0
  30. package/dist/core.js +51 -0
  31. package/dist/core.js.map +7 -0
  32. package/dist/crypto-XS5XCMRJ.js +21 -0
  33. package/dist/crypto-XS5XCMRJ.js.map +7 -0
  34. package/dist/helpers-UD7CG4WQ.js +18 -0
  35. package/dist/helpers-UD7CG4WQ.js.map +7 -0
  36. package/dist/http-codec.d.ts +72 -0
  37. package/dist/http-codec.js +25 -0
  38. package/dist/http-codec.js.map +7 -0
  39. package/dist/http-provider.d.ts +3243 -0
  40. package/dist/http-provider.js +37920 -0
  41. package/dist/http-provider.js.map +7 -0
  42. package/dist/index.d.ts +10 -0
  43. package/dist/index.js +23 -0
  44. package/dist/index.js.map +7 -0
  45. package/dist/mqtt-broker/node.d.ts +632 -0
  46. package/dist/mqtt-broker/node.js +355 -0
  47. package/dist/mqtt-broker/node.js.map +7 -0
  48. package/dist/mqtt-broker.d.ts +990 -0
  49. package/dist/mqtt-broker.js +913 -0
  50. package/dist/mqtt-broker.js.map +7 -0
  51. package/dist/openapi-metadata.d.ts +290 -0
  52. package/dist/openapi-metadata.js +28 -0
  53. package/dist/openapi-metadata.js.map +7 -0
  54. package/dist/openapi.d.ts +252 -0
  55. package/dist/openapi.js +45 -0
  56. package/dist/openapi.js.map +7 -0
  57. package/dist/preview/artifacts.d.ts +19 -0
  58. package/dist/preview/artifacts.js +40 -0
  59. package/dist/preview/artifacts.js.map +7 -0
  60. package/dist/preview/bridge.d.ts +21 -0
  61. package/dist/preview/bridge.js +9 -0
  62. package/dist/preview/bridge.js.map +7 -0
  63. package/dist/preview/harness.d.ts +12 -0
  64. package/dist/preview/harness.js +65 -0
  65. package/dist/preview/harness.js.map +7 -0
  66. package/dist/preview/host.d.ts +30 -0
  67. package/dist/preview/host.js +70 -0
  68. package/dist/preview/host.js.map +7 -0
  69. package/dist/service/admin.d.ts +106 -0
  70. package/dist/service/admin.js +340 -0
  71. package/dist/service/admin.js.map +7 -0
  72. package/dist/service.d.ts +2665 -0
  73. package/dist/service.js +264 -0
  74. package/dist/service.js.map +7 -0
  75. package/dist/sqlite.d.ts +69 -0
  76. package/dist/sqlite.js +19 -0
  77. package/dist/sqlite.js.map +7 -0
  78. package/dist/ui.d.ts +37 -0
  79. package/dist/ui.js +702 -0
  80. package/dist/ui.js.map +7 -0
  81. package/package.json +130 -6
@@ -0,0 +1,264 @@
1
+ import {
2
+ AT_HEADER,
3
+ AwsError,
4
+ AwsProtocolAPI,
5
+ BRANCH_HEADER,
6
+ CHECKPOINT_HEADER,
7
+ Collection,
8
+ DEFAULT_NAMESPACE,
9
+ DroppedConnectionError,
10
+ FAULT_HEADER,
11
+ HttpError,
12
+ IdSequence,
13
+ IdempotencyStore,
14
+ MOCKINGBIRD_HEADER,
15
+ OperationRegistryError,
16
+ OutboxStore,
17
+ PACKAGE_VERSION,
18
+ SNAPSHOT_HEADER,
19
+ STATE_FIELD_KINDS,
20
+ UNRELEASED_VERSION,
21
+ awsList,
22
+ awsMd5,
23
+ awsPage,
24
+ awsParseXml,
25
+ awsRecord,
26
+ awsRequired,
27
+ awsXml,
28
+ awsXmlEscape,
29
+ bodyIssues,
30
+ bootSqlite,
31
+ codePointLength,
32
+ coerce,
33
+ createRuntime,
34
+ createService,
35
+ createWebhookHub,
36
+ decodeAwsQuery,
37
+ defineOperations,
38
+ extractCodes,
39
+ extractLinks,
40
+ faultEffect,
41
+ faultEffects,
42
+ forwardRequestContext,
43
+ idBaseOf,
44
+ inspectState,
45
+ issuesByField,
46
+ jsonRes,
47
+ markMutationAccepted,
48
+ normalizeIdBase,
49
+ opaqueToken,
50
+ outboxAdminRoutes,
51
+ ownedTransport,
52
+ parseForm,
53
+ parseSince,
54
+ putObject,
55
+ recordedIssues,
56
+ requestFingerprint,
57
+ restoreNamespace,
58
+ setIdBase,
59
+ signV4,
60
+ signers,
61
+ snapshotNamespace,
62
+ sortIssues,
63
+ stableStringify,
64
+ unsupportedMediaType,
65
+ verifyOperations,
66
+ webhookAdminRoutes,
67
+ withNamespaceRollback
68
+ } from "./chunk-G62YDIIJ.js";
69
+ import "./chunk-2KDYLZXC.js";
70
+ import {
71
+ ADMIN_CONTROL_PAGES,
72
+ ADMIN_DOCS_URL,
73
+ ADMIN_KEY_HEADER,
74
+ ADMIN_PREFIX,
75
+ ADMIN_ROUTE_REFERENCE,
76
+ CONTROL_HEADERS,
77
+ CONTROL_HEADER_REFERENCE,
78
+ ControlError,
79
+ DEFAULT_JOURNAL_SIZE,
80
+ HEALTH_PATH,
81
+ NAMESPACE_HEADER,
82
+ SNAPSHOT_FORMAT,
83
+ STANDARD_ADMIN_ROUTES,
84
+ STANDARD_FAULT_PRESETS,
85
+ annotateResponse,
86
+ anyCredential,
87
+ assertAdminPrefixAvailable,
88
+ assertAdminUi,
89
+ assertSnapshotDocument,
90
+ basicAuth,
91
+ bearerToken,
92
+ controlHeaders,
93
+ createClock,
94
+ createControlPlane,
95
+ createCredentialRegistry,
96
+ createFaultRegistry,
97
+ createJournal,
98
+ createLatencyRegistry,
99
+ createMetrics,
100
+ createNamespaceControls,
101
+ createRng,
102
+ defineMock,
103
+ deriveClock,
104
+ fromBase64,
105
+ hmac,
106
+ isAdminPath,
107
+ maskCredential,
108
+ matchNamespacePath,
109
+ normalizeBootControls,
110
+ normalizeControls,
111
+ normalizeFault,
112
+ parseControlHeaders,
113
+ parseDuration,
114
+ parseFaultHeader,
115
+ parseInstant,
116
+ resolveAdminPrefix,
117
+ responseNotes,
118
+ restoreClock,
119
+ seedFrom,
120
+ sha,
121
+ sigV4AccessKeyId,
122
+ signSvix,
123
+ signTimestamped,
124
+ signTwilio,
125
+ svixSecretBytes,
126
+ timingSafeEqual,
127
+ toBase64,
128
+ toHex
129
+ } from "./chunk-XNS34BPF.js";
130
+ import {
131
+ requestBaseUrl
132
+ } from "./chunk-2Y25NPCV.js";
133
+ import "./chunk-EQLY2YOA.js";
134
+ import "./chunk-HU6IOAFC.js";
135
+ import "./chunk-4SAK6MQT.js";
136
+ export {
137
+ ADMIN_CONTROL_PAGES,
138
+ ADMIN_DOCS_URL,
139
+ ADMIN_KEY_HEADER,
140
+ ADMIN_PREFIX,
141
+ ADMIN_ROUTE_REFERENCE,
142
+ AT_HEADER,
143
+ AwsError,
144
+ AwsProtocolAPI,
145
+ BRANCH_HEADER,
146
+ CHECKPOINT_HEADER,
147
+ CONTROL_HEADERS,
148
+ CONTROL_HEADER_REFERENCE,
149
+ Collection,
150
+ ControlError,
151
+ DEFAULT_JOURNAL_SIZE,
152
+ DEFAULT_NAMESPACE,
153
+ DroppedConnectionError,
154
+ FAULT_HEADER,
155
+ HEALTH_PATH,
156
+ HttpError,
157
+ IdSequence,
158
+ IdempotencyStore,
159
+ MOCKINGBIRD_HEADER,
160
+ NAMESPACE_HEADER,
161
+ OperationRegistryError,
162
+ OutboxStore,
163
+ PACKAGE_VERSION,
164
+ SNAPSHOT_FORMAT,
165
+ SNAPSHOT_HEADER,
166
+ STANDARD_ADMIN_ROUTES,
167
+ STANDARD_FAULT_PRESETS,
168
+ STATE_FIELD_KINDS,
169
+ UNRELEASED_VERSION,
170
+ annotateResponse,
171
+ anyCredential,
172
+ assertAdminPrefixAvailable,
173
+ assertAdminUi,
174
+ assertSnapshotDocument,
175
+ awsList,
176
+ awsMd5,
177
+ awsPage,
178
+ awsParseXml,
179
+ awsRecord,
180
+ awsRequired,
181
+ awsXml,
182
+ awsXmlEscape,
183
+ basicAuth,
184
+ bearerToken,
185
+ bodyIssues,
186
+ bootSqlite,
187
+ codePointLength,
188
+ coerce,
189
+ controlHeaders,
190
+ createClock,
191
+ createControlPlane,
192
+ createCredentialRegistry,
193
+ createFaultRegistry,
194
+ createJournal,
195
+ createLatencyRegistry,
196
+ createMetrics,
197
+ createNamespaceControls,
198
+ createRng,
199
+ createRuntime,
200
+ createService,
201
+ createWebhookHub,
202
+ decodeAwsQuery,
203
+ defineMock,
204
+ defineOperations,
205
+ deriveClock,
206
+ extractCodes,
207
+ extractLinks,
208
+ faultEffect,
209
+ faultEffects,
210
+ forwardRequestContext,
211
+ fromBase64,
212
+ hmac,
213
+ idBaseOf,
214
+ inspectState,
215
+ isAdminPath,
216
+ issuesByField,
217
+ jsonRes,
218
+ jsonRes as jsonResponse,
219
+ markMutationAccepted,
220
+ maskCredential,
221
+ matchNamespacePath,
222
+ normalizeBootControls,
223
+ normalizeControls,
224
+ normalizeFault,
225
+ normalizeIdBase,
226
+ opaqueToken,
227
+ outboxAdminRoutes,
228
+ ownedTransport,
229
+ parseControlHeaders,
230
+ parseDuration,
231
+ parseFaultHeader,
232
+ parseForm,
233
+ parseInstant,
234
+ parseSince,
235
+ putObject,
236
+ recordedIssues,
237
+ requestBaseUrl,
238
+ requestFingerprint,
239
+ resolveAdminPrefix,
240
+ responseNotes,
241
+ restoreClock,
242
+ restoreNamespace,
243
+ seedFrom,
244
+ setIdBase,
245
+ sha,
246
+ sigV4AccessKeyId,
247
+ signSvix,
248
+ signTimestamped,
249
+ signTwilio,
250
+ signV4,
251
+ signers,
252
+ snapshotNamespace,
253
+ sortIssues,
254
+ stableStringify,
255
+ svixSecretBytes,
256
+ timingSafeEqual,
257
+ toBase64,
258
+ toHex,
259
+ unsupportedMediaType,
260
+ verifyOperations,
261
+ webhookAdminRoutes,
262
+ withNamespaceRollback
263
+ };
264
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,69 @@
1
+ /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
2
+ type SqliteValue = null | number | bigint | string | Uint8Array | boolean;
3
+ /** Mutation counters returned by {@link SqliteStatement.run}. */
4
+ type SqliteRunResult = {
5
+ changes: number;
6
+ lastInsertRowid: number | bigint;
7
+ };
8
+ /**
9
+ * Prepared statement bound to a {@link SqliteClient}.
10
+ *
11
+ * Pass bind values as rest arguments on each call (no sticky `bind()`).
12
+ */
13
+ interface SqliteStatement {
14
+ run(...params: SqliteValue[]): SqliteRunResult;
15
+ all<T = Record<string, unknown>>(...params: SqliteValue[]): T[];
16
+ get<T = Record<string, unknown>>(...params: SqliteValue[]): T | undefined;
17
+ }
18
+ /**
19
+ * Sync SQLite client port owned by Mockingbird.
20
+ *
21
+ * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
22
+ * `bun:sqlite` instances all work when they expose this surface.
23
+ */
24
+ interface SqliteClient {
25
+ exec(sql: string): void;
26
+ prepare(sql: string): SqliteStatement;
27
+ transaction<T>(fn: () => T): T;
28
+ }
29
+
30
+ /** Construct the default in-memory SQLite client (`@crvouga/mockingbird-service-sqlite`). */
31
+ declare const createDefaultSqlite: () => SqliteClient;
32
+ /** Use the injected client, or fall back to {@link createDefaultSqlite}. */
33
+ declare const resolveSqlite: (sqlite?: SqliteClient) => SqliteClient;
34
+
35
+ /** One named, ordered schema change applied exactly once per client. */
36
+ type Migration = {
37
+ /** Stable id stored in `schema_migrations`. Must be unique across the list. */
38
+ id: string;
39
+ sql: string;
40
+ };
41
+ /**
42
+ * Apply pending migrations in order inside a single transaction.
43
+ *
44
+ * Idempotent: already-applied ids are skipped. Re-running with the same list
45
+ * is a no-op after the first successful boot.
46
+ *
47
+ * @throws {Error} If two migrations in the list share an id; nothing is applied.
48
+ */
49
+ declare const migrate: (sqlite: SqliteClient, migrations: readonly Migration[]) => void;
50
+ /**
51
+ * Applied migration ids in application order: by `applied_at`, then `rowid`.
52
+ * `schema_migrations` is a rowid table, so `rowid` follows insertion order and
53
+ * breaks same-second ties in the order the migrations ran.
54
+ */
55
+ declare const listAppliedMigrations: (sqlite: SqliteClient) => string[];
56
+
57
+ /**
58
+ * Core Mockingbird service schema: namespaced JSON records and counters.
59
+ *
60
+ * Applied on every service boot via {@link migrateCore}.
61
+ */
62
+ declare const CORE_MIGRATIONS: readonly Migration[];
63
+ /** Apply {@link CORE_MIGRATIONS}, then rename a database that still uses the former table names. */
64
+ declare const migrateCore: (sqlite: SqliteClient) => void;
65
+ /** Delete every record and sequence belonging to `namespace`. */
66
+ declare const clearNamespace: (sqlite: SqliteClient, namespace: string) => void;
67
+
68
+ export { CORE_MIGRATIONS, clearNamespace, createDefaultSqlite, listAppliedMigrations, migrate, migrateCore, resolveSqlite };
69
+ export type { Migration, SqliteClient, SqliteRunResult, SqliteStatement, SqliteValue };
package/dist/sqlite.js ADDED
@@ -0,0 +1,19 @@
1
+ import {
2
+ CORE_MIGRATIONS,
3
+ clearNamespace,
4
+ createDefaultSqlite,
5
+ listAppliedMigrations,
6
+ migrate,
7
+ migrateCore,
8
+ resolveSqlite
9
+ } from "./chunk-2KDYLZXC.js";
10
+ export {
11
+ CORE_MIGRATIONS,
12
+ clearNamespace,
13
+ createDefaultSqlite,
14
+ listAppliedMigrations,
15
+ migrate,
16
+ migrateCore,
17
+ resolveSqlite
18
+ };
19
+ //# sourceMappingURL=sqlite.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
package/dist/ui.d.ts ADDED
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Cross-browser baseline for every HTML surface this repo serves.
3
+ *
4
+ * `CSS_RESET` is the document sheet. `scopeReset(root)` is the same sheet
5
+ * limited to a widget (`:where` so later component rules still win) and with
6
+ * viewport heights rewritten to the widget's own box.
7
+ *
8
+ * `reset.css` is this string as a stylesheet. The package test fails when the
9
+ * two drift.
10
+ */
11
+ declare const CSS_RESET = "*,\n*::before,\n*::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\n* {\n scrollbar-width: thin;\n scrollbar-color: color-mix(in srgb, CanvasText 35%, Canvas) Canvas;\n}\n\n*::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n}\n\n*::-webkit-scrollbar-track,\n*::-webkit-scrollbar-corner {\n background: Canvas;\n}\n\n*::-webkit-scrollbar-thumb {\n background: color-mix(in srgb, CanvasText 35%, Canvas);\n border: 3px solid Canvas;\n border-radius: 999px;\n}\n\nhtml {\n hanging-punctuation: first allow-end last;\n -webkit-text-size-adjust: none;\n text-size-adjust: none;\n tab-size: 4;\n font-family:\n ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI Variable\", \"Segoe UI\",\n \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\";\n font-size: 16px;\n line-height: 1.5;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-rendering: optimizeLegibility;\n -webkit-tap-highlight-color: transparent;\n scroll-behavior: smooth;\n background: Canvas;\n color: CanvasText;\n}\n\nbody {\n min-height: 100svh;\n line-height: 1.5;\n background: Canvas;\n color: CanvasText;\n}\n\nh1 {\n font-size: 2em;\n}\n\nh2 {\n font-size: 1.5em;\n}\n\nh3 {\n font-size: 1.17em;\n}\n\nh4 {\n font-size: 1em;\n}\n\nh5 {\n font-size: 0.83em;\n}\n\nh6 {\n font-size: 0.67em;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-weight: 700;\n line-height: 1.2;\n text-wrap: balance;\n overflow-wrap: break-word;\n}\n\np,\nli,\nfigcaption,\ndd,\ndt,\nblockquote {\n overflow-wrap: break-word;\n}\n\np,\nli,\nfigcaption,\nblockquote {\n text-wrap: pretty;\n}\n\nul,\nol,\nmenu {\n list-style: none;\n}\n\na {\n color: inherit;\n text-decoration: underline;\n text-decoration-thickness: 1px;\n text-underline-offset: 0.15em;\n text-decoration-skip-ink: auto;\n}\n\nb,\nstrong {\n font-weight: 700;\n}\n\nsmall {\n font-size: 0.875em;\n}\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, \"SF Mono\", SFMono-Regular, Menlo, Consolas, monospace;\n font-size: 1em;\n}\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\nabbr[title] {\n text-decoration: underline dotted;\n text-underline-offset: 0.15em;\n}\n\nmark {\n background: Mark;\n color: MarkText;\n}\n\nhr {\n height: 0;\n border: 0;\n border-top: 1px solid color-mix(in srgb, CanvasText 20%, transparent);\n color: inherit;\n}\n\nimg,\npicture,\nvideo,\ncanvas {\n display: block;\n max-width: 100%;\n}\n\nimg,\nvideo {\n height: auto;\n}\n\nsvg {\n overflow: hidden;\n}\n\niframe {\n border: 0;\n max-width: 100%;\n}\n\ntable {\n border-collapse: collapse;\n border-spacing: 0;\n}\n\nfieldset {\n border: 0;\n min-inline-size: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nbutton,\ninput,\nselect,\ntextarea,\noptgroup {\n font: inherit;\n letter-spacing: inherit;\n color: inherit;\n margin: 0;\n vertical-align: middle;\n}\n\nbutton,\ninput[type=\"button\"],\ninput[type=\"submit\"],\ninput[type=\"reset\"] {\n appearance: none;\n background: none;\n border: 0;\n padding: 0;\n cursor: pointer;\n text-align: center;\n}\n\ninput,\ntextarea,\nselect {\n background-color: Canvas;\n border: 1px solid color-mix(in srgb, CanvasText 28%, transparent);\n border-radius: 0;\n padding: 0.5em 0.65em;\n}\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"],\ninput[type=\"range\"],\ninput[type=\"file\"],\ninput[type=\"color\"],\ninput[type=\"button\"],\ninput[type=\"submit\"],\ninput[type=\"reset\"],\ninput[type=\"image\"],\ninput[type=\"hidden\"] {\n background: none;\n border: 0;\n padding: 0;\n border-radius: 0;\n}\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n accent-color: CanvasText;\n}\n\ninput[type=\"search\"] {\n appearance: none;\n background-color: Canvas;\n border: 1px solid color-mix(in srgb, CanvasText 28%, transparent);\n}\n\ninput[type=\"search\"]::-webkit-search-decoration,\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-results-button,\ninput[type=\"search\"]::-webkit-search-results-decoration {\n -webkit-appearance: none;\n display: none;\n}\n\ninput[type=\"number\"] {\n appearance: textfield;\n background-color: Canvas;\n border: 1px solid color-mix(in srgb, CanvasText 28%, transparent);\n}\n\ninput[type=\"number\"]::-webkit-inner-spin-button,\ninput[type=\"number\"]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ntextarea {\n resize: vertical;\n}\n\n::placeholder {\n opacity: 1;\n color: color-mix(in srgb, CanvasText 45%, transparent);\n}\n\n:focus-visible {\n outline: 2px solid CanvasText;\n outline-offset: 2px;\n}\n\n:focus:not(:focus-visible) {\n outline: none;\n}\n\n:disabled,\n[disabled] {\n cursor: default;\n opacity: 0.6;\n}\n\nlabel,\nsummary,\nselect,\n[role=\"button\"] {\n cursor: pointer;\n}\n\nsummary {\n display: list-item;\n}\n\ndetails {\n display: block;\n}\n\ndialog {\n margin: auto;\n padding: 1rem;\n border: 1px solid color-mix(in srgb, CanvasText 20%, transparent);\n background: Canvas;\n color: CanvasText;\n max-width: calc(100vw - 2rem);\n max-height: calc(100svh - 2rem);\n}\n\ndialog:not([open]) {\n display: none;\n}\n\n::backdrop {\n background: color-mix(in srgb, CanvasText 40%, transparent);\n}\n\n[hidden] {\n display: none !important;\n}\n\n::selection {\n background: Highlight;\n color: HighlightText;\n}\n\n@media (prefers-reduced-motion: reduce) {\n *,\n *::before,\n *::after {\n animation-duration: 0.01ms !important;\n animation-iteration-count: 1 !important;\n transition-duration: 0.01ms !important;\n scroll-behavior: auto !important;\n }\n}\n\n@media (pointer: coarse) {\n input,\n select,\n textarea {\n font-size: max(16px, 1em);\n }\n}";
12
+ /** Scope the reset to `root` without raising specificity above a single element. */
13
+ declare function scopeReset(root: string): string;
14
+
15
+ /** Product code supplies lazy surfaces; the shell knows nothing about their services. */
16
+ type SystemSurface = {
17
+ id: string;
18
+ label: string;
19
+ mount(host: HTMLElement, signal: AbortSignal): Promise<() => void> | (() => void);
20
+ };
21
+ type SystemHarness = {
22
+ show(id: string): Promise<void>;
23
+ active(): string;
24
+ destroy(): void;
25
+ };
26
+ /**
27
+ * One visible surface, with mounted surfaces retained while hidden. Resolving mount means ready;
28
+ * rejecting means failed. Abort and late disposal make teardown safe during asynchronous loading.
29
+ * The reserved System surface is always reachable. URL state is opt-in for embedded hosts.
30
+ */
31
+ declare function mountSystemHarness(host: HTMLElement, surfaces: readonly SystemSurface[], options?: {
32
+ initial?: string;
33
+ syncUrl?: boolean;
34
+ }): SystemHarness;
35
+
36
+ export { CSS_RESET, mountSystemHarness, scopeReset };
37
+ export type { SystemHarness, SystemSurface };