@almadar/runtime 6.31.0 → 6.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,14 +1,16 @@
1
- import { B as BindingContext, E as EvaluationContextExtensions, P as PatternProps, a as EffectHandlers, b as EffectContext, c as ExecutionEnvironment, d as EffectResult, T as TraitDefinition } from './types-D-9feVsj.js';
2
- export { e as Effect, f as EventListener, H as HANDLER_MANIFEST, I as IEventBus, R as RuntimeConfig, g as RuntimeEvent, h as TraitState, i as TransitionObserver, j as TransitionResult, U as Unsubscribe } from './types-D-9feVsj.js';
3
- import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital, P as PersistenceAdapter } from './OrbitalServerRuntime-DpAwIrmv.js';
4
- export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, e as InMemoryPersistence, O as OrbitalEventRequest, f as OrbitalEventResponse, g as OrbitalServerRuntimeConfig, h as PreprocessOptions, i as PreprocessResult, j as PreprocessedSchema, k as ProcessEventOptions, R as RegisteredOrbital, l as RuntimeOrbital, m as RuntimeOrbitalSchema, n as RuntimeTrait, o as StateMachineManager, p as collectDeclaredConfigDefaults, q as collectDeclaredEntityDefaults, r as createInitialTraitState, s as findInitialState, t as findTransition, u as getIsolatedCollectionName, v as getNamespacedEvent, w as isBrowser, x as isElectron, y as isNamespacedEvent, z as isNode, A as normalizeCallSiteConfigToValues, B as normalizeEventKey, C as parseNamespacedEvent, D as preprocessSchema, F as processEvent } from './OrbitalServerRuntime-DpAwIrmv.js';
1
+ import { B as BindingContext, f as EvaluationContextExtensions, P as PatternProps, E as EffectHandlers, g as EffectContext, h as ExecutionEnvironment, i as EffectResult, T as TraitDefinition } from './types-ConZnrpe.js';
2
+ export { j as BrowserFileMeta, k as BrowserFilePickerOptions, l as BrowserGeolocationOptions, m as BrowserGeolocationPosition, C as ConfigContext, n as Effect, a as EventListener, H as HANDLER_MANIFEST, I as IEventBus, b as RuntimeConfig, R as RuntimeEvent, d as TraitState, c as TransitionObserver, e as TransitionResult, U as Unsubscribe } from './types-ConZnrpe.js';
3
+ import { U as UnifiedLoaderOptions, S as SchemaLoader, I as ImportChainLike, L as LoadResult, a as LoadedSchema, b as LoadedOrbital, P as PersistenceAdapter } from './OrbitalServerRuntime-Cep380it.js';
4
+ export { E as EntitySharingMap, c as EventBus, d as EventNamespaceMap, e as InMemoryPersistence, O as OrbitalEventRequest, f as OrbitalEventResponse, g as OrbitalServerRuntimeConfig, h as PreprocessOptions, i as PreprocessResult, j as PreprocessedSchema, k as ProcessEventOptions, R as RegisteredOrbital, l as RuntimeOrbital, m as RuntimeOrbitalSchema, n as RuntimeTrait, o as StateMachineManager, p as collectDeclaredConfigDefaults, q as collectDeclaredEntityDefaults, r as createInitialTraitState, s as findInitialState, t as findTransition, u as getIsolatedCollectionName, v as getNamespacedEvent, w as isBrowser, x as isElectron, y as isNamespacedEvent, z as isNode, A as normalizeEventKey, B as parseNamespacedEvent, C as preprocessSchema, D as processEvent } from './OrbitalServerRuntime-Cep380it.js';
5
5
  import { EvaluationContext, SExpressionEvaluator } from '@almadar/evaluator';
6
6
  export { EvaluationContext, createMinimalContext } from '@almadar/evaluator';
7
- import { EventPayload, EntityField, EntityRow, ServiceParams, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
8
- export { EntityField } from '@almadar/core';
7
+ import { TraitConfigObject, EventPayload, PatternConfig, EntityField, EntityRow, ServiceParams, PayloadField, OrbitalDefinition, OrbitalSchema } from '@almadar/core';
8
+ export { EntityField, normalizeCallSiteConfigToValues } from '@almadar/core';
9
9
  export { ServerBridgeConfig, ServerBridgeState } from './ServerBridge.js';
10
10
  export { OsHandlerContext, OsHandlerResult } from './createOsHandlers.js';
11
+ export { MultiSourceSlotManager, PERF_NAMESPACE, PerfDetail, PerfDetailValue, PerfEntry, PreparedPreviewSchema, RendererContractViolationError, ResolvedPageTraits, SlotContent, SlotContentValidationError, SlotManager, SlotSource, VerificationBus, adjustSchemaForMockData, aggregateSlotContent, assertIsMultiSourceSlotManager, assertIsSlotManager, bindEventBus, bindTraitStateGetter, buildMockData, buildOrbitalsByTrait, clearPerf, collectEmbeddedTraits, collectTraitRefsFromResolvedTrait, createSlotSetter, ensureVerificationApi, getOrbitalVerification, perfEnd, perfStart, perfStore, perfTime, prepareSchemaForPreview, pushPerfEntry, validateSlotContent, wrapCallbackForEvent } from './ui/index.js';
11
12
  import 'express';
13
+ import '@almadar/core/patterns';
12
14
 
13
15
  /**
14
16
  * Unified Schema Loader
@@ -242,6 +244,23 @@ declare function isValidDurationString(interval: string): boolean;
242
244
  * @packageDocumentation
243
245
  */
244
246
 
247
+ /**
248
+ * Call-site payload capture grammar. Mirrors the Rust orbital-core
249
+ * `CALLSITE_PAYLOAD_PREFIX` (`@callsitePayload.`). A composed trait's call-site
250
+ * config value of this form is a snapshot of the COMPOSING effect's triggering
251
+ * event payload, captured at the call site — deliberately distinct from
252
+ * `@payload.` so it is never evaluated in the child's own INIT scope.
253
+ */
254
+ declare const CALLSITE_PAYLOAD_PREFIX = "@callsitePayload.";
255
+ /**
256
+ * Resolve call-site payload captures in a child trait's call-site config
257
+ * against the COMPOSING effect's triggering event payload. Each value of the
258
+ * form `@callsitePayload.<field>` becomes the literal read from `payload`
259
+ * (snapshot semantics — the child sees a plain value, never a payload ref).
260
+ * Non-capture entries pass through untouched. Returns a new object; the input
261
+ * is not mutated.
262
+ */
263
+ declare function resolveCallSitePayloadCaptures(config: TraitConfigObject, payload: EventPayload | undefined): TraitConfigObject;
245
264
  /**
246
265
  * Interpolate binding references in props.
247
266
  *
@@ -448,7 +467,7 @@ interface ClientEventBus {
448
467
  */
449
468
  interface SlotSetter {
450
469
  /** Accumulate a pattern into the pending slot map */
451
- addPattern: (slot: string, pattern: unknown, props?: PatternProps) => void;
470
+ addPattern: (slot: string, pattern: PatternConfig, props?: PatternProps) => void;
452
471
  /** Mark a slot for clearing */
453
472
  clearSlot: (slot: string) => void;
454
473
  }
@@ -504,10 +523,10 @@ interface CreateClientEffectHandlersOptions {
504
523
  declare function createClientEffectHandlers(options: CreateClientEffectHandlersOptions): EffectHandlers;
505
524
 
506
525
  /**
507
- * MockPersistenceAdapter - In-memory data store with faker-based mock generation
526
+ * MockPersistenceAdapter - In-memory data store with seeded mock generation
508
527
  *
509
528
  * Provides a stateful mock data layer that implements PersistenceAdapter.
510
- * Uses @faker-js/faker for realistic data generation based on field types.
529
+ * Uses a lightweight seeded PRNG so the client bundle does not pull in faker.
511
530
  *
512
531
  * @packageDocumentation
513
532
  */
@@ -522,7 +541,7 @@ type NamedEntityField = EntityField & {
522
541
  interface EntitySchema {
523
542
  name: string;
524
543
  fields: NamedEntityField[];
525
- /** Pre-authored instance data from the schema (used instead of faker generation) */
544
+ /** Pre-authored instance data from the schema (used instead of generated mocks) */
526
545
  seedData?: EntityRow[];
527
546
  }
528
547
  interface MockPersistenceConfig {
@@ -534,7 +553,7 @@ interface MockPersistenceConfig {
534
553
  debug?: boolean;
535
554
  }
536
555
  /**
537
- * In-memory mock data store with CRUD operations and faker-based seeding.
556
+ * In-memory mock data store with CRUD operations and seeded mock generation.
538
557
  */
539
558
  declare class MockPersistenceAdapter implements PersistenceAdapter {
540
559
  private stores;
@@ -542,9 +561,9 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
542
561
  private idCounters;
543
562
  private config;
544
563
  constructor(config?: MockPersistenceConfig);
545
- /** Re-anchor faker's PRNG to the configured seed. Called before every
564
+ /** Re-anchor the PRNG to the configured seed. Called before every
546
565
  * re-seed loop so identical reseed sequences produce identical rows
547
- * (timestamps + faker-generated fields). Without this, the first
566
+ * (timestamps + generated fields). Without this, the first
548
567
  * reseed produces row set A, the second produces row set B, and
549
568
  * diff observers see all rows as "changed" between frames. */
550
569
  resetFakerSeed(): void;
@@ -553,7 +572,7 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
553
572
  /**
554
573
  * Register an entity schema and seed mock data.
555
574
  * If the schema has seedData, those instances are used directly.
556
- * Otherwise, random mock data is generated with faker.
575
+ * Otherwise, random mock data is generated with the seeded PRNG.
557
576
  */
558
577
  registerEntity(schema: EntitySchema, seedCount?: number): void;
559
578
  /**
@@ -605,7 +624,7 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
605
624
  private generateArrayValue;
606
625
  /**
607
626
  * Generate a single object value with each declared property populated
608
- * by faker. Walks `properties` and recursively delegates to
627
+ * by the seeded PRNG. Walks `properties` and recursively delegates to
609
628
  * `generateFieldValue` per property so nested objects-of-arrays-of-objects
610
629
  * compose correctly.
611
630
  */
@@ -613,7 +632,7 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
613
632
  /**
614
633
  * Generate a string value based on the field's declared schema metadata.
615
634
  * Reads `values` (enum) first, then `format` (email/url/phone/uuid/date/
616
- * datetime), then falls back to faker.lorem.words. No field-name heuristics
635
+ * datetime), then falls back to randomWords. No field-name heuristics
617
636
  * — the schema is the source of truth. If a caller needs a real email, they
618
637
  * declare `format: "email"`; if they need an enum, they declare `values: [...]`.
619
638
  */
@@ -644,7 +663,7 @@ declare class MockPersistenceAdapter implements PersistenceAdapter {
644
663
  * Clear all data for an entity.
645
664
  */
646
665
  clear(entityName: string): void;
647
- /** Clear all data + re-anchor faker so the next seed loop reproduces
666
+ /** Clear all data + re-anchor the PRNG so the next seed loop reproduces
648
667
  * identical rows. Hermetic-frame mode calls this between every step
649
668
  * via OrbitalServerRuntime.resetMockPersistence. */
650
669
  clearAll(): void;
@@ -1031,4 +1050,4 @@ declare namespace index {
1031
1050
  export { type index_ComposeBehaviorsInput as ComposeBehaviorsInput, type index_ComposeBehaviorsResult as ComposeBehaviorsResult, type index_EventWiringEntry as EventWiringEntry, type index_LayoutStrategy as LayoutStrategy, type index_PipeStep as PipeStep, index_applyEventWiring as applyEventWiring, index_composeBehaviors as composeBehaviors, index_detectLayoutStrategy as detectLayoutStrategy, index_pipeBehaviors as pipeBehaviors };
1032
1051
  }
1033
1052
 
1034
- export { BindingContext, type ClientEventBus, type ComposeBehaviorsInput, type ComposeBehaviorsResult, type CreateClientEffectHandlersOptions, type CreateServerEffectHandlersOptions, type CronFields, EffectContext, EffectExecutor, type EffectExecutorOptions, EffectHandlers, EffectResult, type EntitySchema, type EventWiringEntry, ExecutionEnvironment, ImportChainLike, type LayoutStrategy, LoadResult, LoadedOrbital, LoadedSchema, MockPersistenceAdapter, type MockPersistenceConfig, type PayloadMismatch, type PayloadValidationFailure, PersistenceAdapter, type PipeStep, SchemaLoader, type ServerEffectResult, type SlotSetter, type TickHandle, TickScheduler, TraitDefinition, UnifiedLoaderOptions, applyEventWiring, buildEmitsFromTraits, composeBehaviors, index as composition, containsBindings, createClientEffectHandlers, createContextFromBindings, createMockPersistence, createServerEffectHandlers, createTestExecutor, createTickScheduler, createUnifiedLoader, cronMatches, cronMinuteKey, detectLayoutStrategy, extractBindings, formatPayloadValidationError, interpolateProps, interpolateValue, isValidCronExpression, isValidDurationString, parseCron, parseCronField, parseDurationString, pipeBehaviors, validateEventPayload, validatePayloadShapes };
1053
+ export { BindingContext, CALLSITE_PAYLOAD_PREFIX, type ClientEventBus, type ComposeBehaviorsInput, type ComposeBehaviorsResult, type CreateClientEffectHandlersOptions, type CreateServerEffectHandlersOptions, type CronFields, EffectContext, EffectExecutor, type EffectExecutorOptions, EffectHandlers, EffectResult, type EntitySchema, type EventWiringEntry, ExecutionEnvironment, ImportChainLike, type LayoutStrategy, LoadResult, LoadedOrbital, LoadedSchema, MockPersistenceAdapter, type MockPersistenceConfig, type PayloadMismatch, type PayloadValidationFailure, PersistenceAdapter, type PipeStep, SchemaLoader, type ServerEffectResult, type SlotSetter, type TickHandle, TickScheduler, TraitDefinition, UnifiedLoaderOptions, applyEventWiring, buildEmitsFromTraits, composeBehaviors, index as composition, containsBindings, createClientEffectHandlers, createContextFromBindings, createMockPersistence, createServerEffectHandlers, createTestExecutor, createTickScheduler, createUnifiedLoader, cronMatches, cronMinuteKey, detectLayoutStrategy, extractBindings, formatPayloadValidationError, interpolateProps, interpolateValue, isValidCronExpression, isValidDurationString, parseCron, parseCronField, parseDurationString, pipeBehaviors, resolveCallSitePayloadCaptures, validateEventPayload, validatePayloadShapes };
package/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
- import { EffectExecutor, createContextFromBindings } from './chunk-YFH577FH.js';
2
- export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes } from './chunk-YFH577FH.js';
1
+ import { EffectExecutor, createContextFromBindings } from './chunk-JZDLN2FS.js';
2
+ export { CALLSITE_PAYLOAD_PREFIX, EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMinimalContext, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, resolveCallSitePayloadCaptures, validateEventPayload, validatePayloadShapes } from './chunk-JZDLN2FS.js';
3
3
  export { cronMatches, cronMinuteKey, isValidCronExpression, parseCron, parseCronField } from './chunk-OU3ITB5S.js';
4
+ import './chunk-OQJIK6PZ.js';
5
+ export { PERF_NAMESPACE, RendererContractViolationError, adjustSchemaForMockData, aggregateSlotContent, assertIsMultiSourceSlotManager, assertIsSlotManager, bindEventBus, bindTraitStateGetter, buildMockData, buildOrbitalsByTrait, clearPerf, createSlotSetter, ensureVerificationApi, getOrbitalVerification, perfEnd, perfStart, perfStore, perfTime, prepareSchemaForPreview, pushPerfEntry, validateSlotContent, wrapCallbackForEvent } from './chunk-O5VGKPTG.js';
6
+ export { collectEmbeddedTraits, collectTraitRefsFromResolvedTrait } from './chunk-SCRAHWOC.js';
4
7
  import { __export } from './chunk-MLKGABMK.js';
5
8
  import { createLogger } from '@almadar/logger';
6
9
  import { evaluate } from '@almadar/evaluator';
@@ -87,7 +90,54 @@ function createClientEffectHandlers(options) {
87
90
  }),
88
91
  sendServer: sendServer ?? ((event, payload) => {
89
92
  sendServerEvent(orbitalName, event, payload);
90
- })
93
+ }),
94
+ // === Browser device handlers (client host path) ===
95
+ // Each throws when the underlying API is unavailable so the executor's
96
+ // runSubstrate wrapper fires `emit.failure` with `{ error }`.
97
+ browserOpenFilePicker: async (options2) => {
98
+ if (typeof window === "undefined" || !("showOpenFilePicker" in window)) {
99
+ throw new Error("File picker API is not available in this environment");
100
+ }
101
+ const host = window;
102
+ const pickerOptions = {};
103
+ if (options2?.multiple === true) pickerOptions.multiple = true;
104
+ if (typeof options2?.accept === "string" && options2.accept.length > 0) {
105
+ pickerOptions.types = [{ accept: { [options2.accept]: [] } }];
106
+ }
107
+ const handles = await host.showOpenFilePicker(pickerOptions);
108
+ const files = await Promise.all(handles.map(async (handle) => {
109
+ const file = await handle.getFile();
110
+ return { name: file.name, size: file.size, type: file.type, lastModified: file.lastModified };
111
+ }));
112
+ return { files };
113
+ },
114
+ browserClipboardRead: async () => {
115
+ if (typeof navigator === "undefined" || !navigator.clipboard) {
116
+ throw new Error("Clipboard API is not available in this environment");
117
+ }
118
+ const text = await navigator.clipboard.readText();
119
+ return { text };
120
+ },
121
+ browserClipboardWrite: async (text) => {
122
+ if (typeof navigator === "undefined" || !navigator.clipboard) {
123
+ throw new Error("Clipboard API is not available in this environment");
124
+ }
125
+ await navigator.clipboard.writeText(text);
126
+ return { text };
127
+ },
128
+ browserGeolocationCurrent: async (options2) => {
129
+ if (typeof navigator === "undefined" || !navigator.geolocation) {
130
+ throw new Error("Geolocation API is not available in this environment");
131
+ }
132
+ const position = await new Promise((resolve, reject) => {
133
+ navigator.geolocation.getCurrentPosition(resolve, reject, options2);
134
+ });
135
+ return {
136
+ latitude: position.coords.latitude,
137
+ longitude: position.coords.longitude,
138
+ accuracy: position.coords.accuracy
139
+ };
140
+ }
91
141
  };
92
142
  }
93
143
  var effectLog = createLogger("almadar:runtime:effects");
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Lightweight seeded pseudo-random generator for mock data.
3
+ *
4
+ * Replaces @faker-js/faker in browser-facing code so the client bundle does
5
+ * not pay the ~3.7 MB faker cost. The API surface is intentionally narrow:
6
+ * only the helpers actually used by MockPersistenceAdapter.
7
+ */
8
+ /** Re-seed the generator. Same signature as `faker.seed()`. */
9
+ declare function seedRandom(value: number | undefined): void;
10
+ /** Integer in [min, max]. */
11
+ declare function randomInt({ min, max }: {
12
+ min: number;
13
+ max: number;
14
+ }): number;
15
+ /** Float in [min, max] with fixed fraction digits. */
16
+ declare function randomFloat({ min, max, fractionDigits, }: {
17
+ min: number;
18
+ max: number;
19
+ fractionDigits?: number;
20
+ }): number;
21
+ /** True/false with 50% probability. */
22
+ declare function randomBoolean(): boolean;
23
+ /** Pick one element from an array. */
24
+ declare function randomArrayElement<T>(array: ReadonlyArray<T>): T;
25
+ /** Return a shallow-shuffled copy of the array (Fisher-Yates). */
26
+ declare function shuffleArray<T>(array: ReadonlyArray<T>): T[];
27
+ /** ISO-8601 date string roughly `years` in the past. */
28
+ declare function randomPastDate({ years }?: {
29
+ years?: number;
30
+ }): Date;
31
+ /** ISO-8601 date string within the last `days`. */
32
+ declare function randomRecentDate({ days }?: {
33
+ days?: number;
34
+ }): Date;
35
+ /** Any date in the last ~100 years. */
36
+ declare function randomAnytimeDate(): Date;
37
+ /** A few random words. */
38
+ declare function randomWords(count: number): string;
39
+ /** A short sentence. */
40
+ declare function randomSentence(): string;
41
+ /** UUID v4-like string (random, not strictly compliant). */
42
+ declare function randomUuid(): string;
43
+ /** Random hex color (#rrggbb). */
44
+ declare function randomColor(): string;
45
+ /** Random password of the given length. */
46
+ declare function randomPassword(length?: number): string;
47
+ /** Random email address. */
48
+ declare function randomEmail(): string;
49
+ /** Random URL. */
50
+ declare function randomUrl(): string;
51
+ /** Random phone number. */
52
+ declare function randomPhone(): string;
53
+
54
+ export { randomAnytimeDate, randomArrayElement, randomBoolean, randomColor, randomEmail, randomFloat, randomInt, randomPassword, randomPastDate, randomPhone, randomRecentDate, randomSentence, randomUrl, randomUuid, randomWords, seedRandom, shuffleArray };
@@ -0,0 +1,2 @@
1
+ export { randomAnytimeDate, randomArrayElement, randomBoolean, randomColor, randomEmail, randomFloat, randomInt, randomPassword, randomPastDate, randomPhone, randomRecentDate, randomSentence, randomUrl, randomUuid, randomWords, seedRandom, shuffleArray } from './chunk-OQJIK6PZ.js';
2
+ import './chunk-MLKGABMK.js';
@@ -221,6 +221,20 @@ interface EffectHandlers {
221
221
  osWatchEnv?: (variable: string, emit?: OsEmitConfig) => void;
222
222
  /** Configure debounce for an OS event type */
223
223
  osDebounce?: (ms: number, eventType: string) => void;
224
+ /** browser/open-file-picker — resolves with `{ files }` inside `result` */
225
+ browserOpenFilePicker?: (options?: BrowserFilePickerOptions) => Promise<{
226
+ files: BrowserFileMeta[];
227
+ }>;
228
+ /** browser/clipboard-read — resolves with `{ text }` inside `result` */
229
+ browserClipboardRead?: () => Promise<{
230
+ text: string;
231
+ }>;
232
+ /** browser/clipboard-write — resolves with `{ text }` (echo) inside `result` */
233
+ browserClipboardWrite?: (text: string) => Promise<{
234
+ text: string;
235
+ }>;
236
+ /** browser/geolocation-current — resolves with the position inside `result` */
237
+ browserGeolocationCurrent?: (options?: BrowserGeolocationOptions) => Promise<BrowserGeolocationPosition>;
224
238
  /** compose/compose-all — compose multiple orbitals into one schema */
225
239
  substrateComposeAll?: (config: {
226
240
  appName: string;
@@ -244,6 +258,32 @@ interface EffectHandlers {
244
258
  * operators meaningfully fire.
245
259
  */
246
260
  type OsEmitConfig = Pick<_almadar_core.EmitConfig, 'on_message' | 'failure'>;
261
+ /** Options for `browser/open-file-picker`. */
262
+ interface BrowserFilePickerOptions {
263
+ /** Allow selecting multiple files. */
264
+ multiple?: boolean;
265
+ /** MIME type filter (e.g. "image/*"). Best-effort; host may ignore. */
266
+ accept?: string;
267
+ }
268
+ /** Metadata for a file chosen via `browser/open-file-picker`. */
269
+ interface BrowserFileMeta {
270
+ name: string;
271
+ size: number;
272
+ type: string;
273
+ lastModified: number;
274
+ }
275
+ /** Options for `browser/geolocation-current` (subset of PositionOptions). */
276
+ interface BrowserGeolocationOptions {
277
+ enableHighAccuracy?: boolean;
278
+ timeout?: number;
279
+ maximumAge?: number;
280
+ }
281
+ /** Position returned by `browser/geolocation-current`. */
282
+ interface BrowserGeolocationPosition {
283
+ latitude: number;
284
+ longitude: number;
285
+ accuracy: number;
286
+ }
247
287
  /**
248
288
  * Context for resolving bindings like @entity.field, @payload.value
249
289
  */
@@ -393,4 +433,4 @@ interface TransitionObserver {
393
433
  */
394
434
  declare const HANDLER_MANIFEST: Record<ExecutionEnvironment, string[]>;
395
435
 
396
- export { type BindingContext as B, type ConfigContext as C, type EvaluationContextExtensions as E, HANDLER_MANIFEST as H, type IEventBus as I, type PatternProps as P, type RuntimeConfig as R, type TraitDefinition as T, type Unsubscribe as U, type EffectHandlers as a, type EffectContext as b, type ExecutionEnvironment as c, type EffectResult as d, type Effect as e, type EventListener as f, type RuntimeEvent as g, type TraitState as h, type TransitionObserver as i, type TransitionResult as j };
436
+ export { type BindingContext as B, type ConfigContext as C, type EffectHandlers as E, HANDLER_MANIFEST as H, type IEventBus as I, type PatternProps as P, type RuntimeEvent as R, type TraitDefinition as T, type Unsubscribe as U, type EventListener as a, type RuntimeConfig as b, type TransitionObserver as c, type TraitState as d, type TransitionResult as e, type EvaluationContextExtensions as f, type EffectContext as g, type ExecutionEnvironment as h, type EffectResult as i, type BrowserFileMeta as j, type BrowserFilePickerOptions as k, type BrowserGeolocationOptions as l, type BrowserGeolocationPosition as m, type Effect as n };