@securitydept/client 0.3.0-beta.3 → 0.3.0-beta.5

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 (58) hide show
  1. package/README.md +6 -0
  2. package/dist/create-Bm-XRA3G.mjs +1573 -0
  3. package/dist/create-Bm-XRA3G.mjs.map +1 -0
  4. package/dist/index-BT-u3qNI.d.mts +133 -0
  5. package/dist/index-Ch8lrE44.d.mts +625 -0
  6. package/dist/index-D5mW18cM.d.mts +1648 -0
  7. package/dist/index.d.mts +3 -353
  8. package/dist/index.mjs +1124 -362
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/router-BJ8LqNJ1.mjs +245 -0
  11. package/dist/router-BJ8LqNJ1.mjs.map +1 -0
  12. package/dist/rx/index.d.mts +69 -0
  13. package/dist/rx/index.mjs +2 -0
  14. package/dist/rx-BoB32Dzg.mjs +1106 -0
  15. package/dist/rx-BoB32Dzg.mjs.map +1 -0
  16. package/dist/server/index.d.mts +21 -0
  17. package/dist/server/index.mjs +29 -0
  18. package/dist/server/index.mjs.map +1 -0
  19. package/dist/test/index.d.mts +102 -0
  20. package/dist/test/index.mjs +270 -0
  21. package/dist/test/index.mjs.map +1 -0
  22. package/dist/uri-string-BfnIT4gJ.mjs +298 -0
  23. package/dist/uri-string-BfnIT4gJ.mjs.map +1 -0
  24. package/dist/web/index.d.mts +82 -364
  25. package/dist/web/index.mjs +329 -428
  26. package/dist/web/index.mjs.map +1 -1
  27. package/dist/webext/index.d.mts +74 -0
  28. package/dist/webext/index.mjs +229 -0
  29. package/dist/webext/index.mjs.map +1 -0
  30. package/package.json +28 -21
  31. package/dist/auth-coordination/index.d.mts +0 -198
  32. package/dist/auth-coordination/index.mjs +0 -107
  33. package/dist/auth-coordination/index.mjs.map +0 -1
  34. package/dist/client-environment-CaumNmir.mjs +0 -812
  35. package/dist/client-environment-CaumNmir.mjs.map +0 -1
  36. package/dist/client-environment-CdHtVxKW.d.mts +0 -401
  37. package/dist/events/index.d.mts +0 -2
  38. package/dist/events/index.mjs +0 -2
  39. package/dist/events-BUlfsRfl.mjs +0 -127
  40. package/dist/events-BUlfsRfl.mjs.map +0 -1
  41. package/dist/index-C4xlKhG7.d.mts +0 -102
  42. package/dist/index-COUt5x9Z.d.mts +0 -39
  43. package/dist/persistence/index.d.mts +0 -3
  44. package/dist/persistence/index.mjs +0 -2
  45. package/dist/persistence/web/index.d.mts +0 -16
  46. package/dist/persistence/web/index.mjs +0 -2
  47. package/dist/persistence-CSB8770k.mjs +0 -108
  48. package/dist/persistence-CSB8770k.mjs.map +0 -1
  49. package/dist/planner-host-BTWie0lo.mjs +0 -197
  50. package/dist/planner-host-BTWie0lo.mjs.map +0 -1
  51. package/dist/planner-host-DN9dRsQx.d.mts +0 -190
  52. package/dist/types-BJqUdH2e.d.mts +0 -32
  53. package/dist/types-BwcnUGNl.d.mts +0 -52
  54. package/dist/web-DQmMqZnR.mjs +0 -51
  55. package/dist/web-DQmMqZnR.mjs.map +0 -1
  56. package/dist/web-router/index.d.mts +0 -259
  57. package/dist/web-router/index.mjs +0 -395
  58. package/dist/web-router/index.mjs.map +0 -1
@@ -0,0 +1,1648 @@
1
+ import { B as SignalOptions, D as TimestampProviderTrait, E as TimeTrait, G as CancellationTokenTrait, Gt as SecuritydeptInjectionToken, I as ResourceSnapshot, K as ClientError, Kt as SecuritydeptInjectorTrait, O as ComputedSignalTrait, Ot as SYMBOL_DISPOSE, R as ResourceTrait, Tt as DisposableTrait, V as WritableSignalTrait, Y as ClientErrorKind, bt as SecuritydeptInjector, ct as EventStreamTrait, et as ErrorPresentationDescriptor, ft as InteropObservableTrait, it as EventObserverTrait, k as ReadableSignalTrait, lt as EventSubjectTrait, nt as ReadErrorPresentationDescriptorOptions, qt as SecuritydeptProvider, rt as UserRecovery, w as IdleCallbackTrait, z as ResourceWhenValueOptions } from "./index-Ch8lrE44.mjs";
2
+ import * as _$arktype from "arktype";
3
+ import * as _$arktype_internal_variants_object_ts0 from "arktype/internal/variants/object.ts";
4
+ import * as _$arktype_internal_variants_string_ts0 from "arktype/internal/variants/string.ts";
5
+ import { StandardSchemaV1 } from "@standard-schema/spec";
6
+
7
+ //#region src/compat/base64.d.ts
8
+ declare const Base64CompatErrorCode: {
9
+ readonly EncoderUnavailable: "compat.base64.encoder_unavailable";
10
+ readonly DecoderUnavailable: "compat.base64.decoder_unavailable";
11
+ };
12
+ type Base64CompatErrorCode = (typeof Base64CompatErrorCode)[keyof typeof Base64CompatErrorCode];
13
+ declare function encodeUint8ArrayToBase64(value: Uint8Array): string;
14
+ declare function decodeBase64ToUint8Array(value: string): Uint8Array;
15
+ //#endregion
16
+ //#region src/compat/generator.d.ts
17
+ declare function promisesToRacedAsyncGenerator<T>(promises: Promise<T>[]): AsyncGenerator<T, void, unknown>;
18
+ //#endregion
19
+ //#region src/page/index.d.ts
20
+ interface PageLifecycleTrait<TResumeEvent = unknown> {
21
+ resume: EventStreamTrait<TResumeEvent>;
22
+ }
23
+ declare const PAGE_LIFECYCLE_TRAIT_TOKEN: SecuritydeptInjectionToken<PageLifecycleTrait<unknown> | null>;
24
+ //#endregion
25
+ //#region src/errors/error-attributes.d.ts
26
+ interface ErrorSummary {
27
+ errorName: string;
28
+ errorKind?: ClientErrorKind;
29
+ errorCode?: string;
30
+ recovery?: UserRecovery;
31
+ }
32
+ /** Extract secret-safe diagnostic attributes without copying runtime messages. */
33
+ declare function describeError(error: unknown): ErrorSummary;
34
+ //#endregion
35
+ //#region src/errors/presentation-descriptor.d.ts
36
+ declare function readErrorPresentationDescriptor(error: unknown, options?: ReadErrorPresentationDescriptorOptions): ErrorPresentationDescriptor;
37
+ //#endregion
38
+ //#region src/std/events/from-abort.d.ts
39
+ type AbortSignalStdSource = Pick<AbortSignal, "aborted" | "reason"> & {
40
+ addEventListener?: (type: "abort", listener: EventListener) => void;
41
+ removeEventListener?: (type: "abort", listener: EventListener) => void;
42
+ };
43
+ /**
44
+ * Adapt an `AbortSignal`-like source into an event stream of abort reasons.
45
+ */
46
+ declare function abortSignalToEventStream(signal: AbortSignalStdSource): EventStreamTrait<unknown>;
47
+ //#endregion
48
+ //#region src/events/create.d.ts
49
+ /**
50
+ * Create a new event stream from a producer function.
51
+ *
52
+ * The producer receives an observer and should call `next()` to emit values,
53
+ * `error()` to signal an error, and `complete()` to signal completion.
54
+ * It may return a teardown function that will be called on unsubscribe.
55
+ */
56
+ declare function createEventStream<T>(producer: (observer: EventObserverTrait<T>) => (() => void) | void): EventStreamTrait<T>;
57
+ declare function createEventSubject<T>(): EventSubjectTrait<T>;
58
+ declare function createEventReplaySubject<T>(bufferSize?: number): EventSubjectTrait<T>;
59
+ declare function createEmptyEventStream<T>(): EventStreamTrait<T>;
60
+ declare function createNeverEventStream<T>(): EventStreamTrait<T>;
61
+ //#endregion
62
+ //#region src/events/interop.d.ts
63
+ type ToEventStreamInput<T> = InteropObservableTrait<T> | Promise<T> | AsyncIterable<T> | PromiseLike<T> | ArrayLike<T> | Iterable<T> | EventStreamTrait<T> | ReadableSignalTrait<T>;
64
+ declare function toEventStream<T>(input: ToEventStreamInput<T>): EventStreamTrait<T>;
65
+ //#endregion
66
+ //#region src/protocol/json-rpc/types.d.ts
67
+ declare const JsonRpcIdSchema: _$arktype.BaseType<string | number, {}>;
68
+ type JsonRpcId = typeof JsonRpcIdSchema.infer;
69
+ declare const JsonRpcErrorPayloadSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
70
+ code: number;
71
+ message: string;
72
+ data?: unknown;
73
+ }, {}>;
74
+ type JsonRpcErrorPayload = typeof JsonRpcErrorPayloadSchema.infer;
75
+ declare const JsonRpcRequestMessageSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
76
+ jsonrpc: "2.0";
77
+ id: string | number;
78
+ method: string;
79
+ params?: unknown;
80
+ }, {}>;
81
+ type JsonRpcRequestMessage = typeof JsonRpcRequestMessageSchema.infer;
82
+ declare const JsonRpcNotificationMessageSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
83
+ jsonrpc: "2.0";
84
+ method: string;
85
+ params?: unknown;
86
+ }, {}>;
87
+ type JsonRpcNotificationMessage = typeof JsonRpcNotificationMessageSchema.infer;
88
+ declare const JsonRpcSuccessResponseMessageSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
89
+ jsonrpc: "2.0";
90
+ id: string | number;
91
+ result: unknown;
92
+ }, {}>;
93
+ type JsonRpcSuccessResponseMessage = typeof JsonRpcSuccessResponseMessageSchema.infer;
94
+ declare const JsonRpcErrorResponseMessageSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
95
+ jsonrpc: "2.0";
96
+ id: string | number;
97
+ error: {
98
+ code: number;
99
+ message: string;
100
+ data?: unknown;
101
+ };
102
+ }, {}>;
103
+ type JsonRpcErrorResponseMessage = typeof JsonRpcErrorResponseMessageSchema.infer;
104
+ declare const JsonRpcMessageSchema: _$arktype_internal_variants_object_ts0.ObjectType<{
105
+ jsonrpc: "2.0";
106
+ id: string | number;
107
+ method: string;
108
+ params?: unknown;
109
+ } | {
110
+ jsonrpc: "2.0";
111
+ method: string;
112
+ params?: unknown;
113
+ } | {
114
+ jsonrpc: "2.0";
115
+ id: string | number;
116
+ result: unknown;
117
+ } | {
118
+ jsonrpc: "2.0";
119
+ id: string | number;
120
+ error: {
121
+ code: number;
122
+ message: string;
123
+ data?: unknown;
124
+ };
125
+ }, {}>;
126
+ type JsonRpcMessage = typeof JsonRpcMessageSchema.infer;
127
+ interface JsonRpcRequestEvent {
128
+ id: JsonRpcId;
129
+ method: string;
130
+ params?: unknown;
131
+ }
132
+ interface JsonRpcNotificationEvent {
133
+ method: string;
134
+ params?: unknown;
135
+ }
136
+ interface JsonRpcRequestOptions {
137
+ timeoutMs?: number;
138
+ }
139
+ interface JsonRpcSendOptions {
140
+ send(message: JsonRpcMessage): void;
141
+ }
142
+ interface CreateJsonRpcClientOptions extends JsonRpcSendOptions {
143
+ time: TimeTrait;
144
+ defaultRequestTimeoutMs?: number;
145
+ }
146
+ interface CreateJsonRpcServerOptions extends JsonRpcSendOptions {}
147
+ interface CreateJsonRpcServerAndClientOptions extends JsonRpcSendOptions {
148
+ time: TimeTrait;
149
+ defaultRequestTimeoutMs?: number;
150
+ }
151
+ interface JsonRpcClientTrait extends DisposableTrait {
152
+ readonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;
153
+ request<TResult = unknown>(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise<TResult>;
154
+ notify(method: string, params?: unknown): void;
155
+ receive(message: unknown): void;
156
+ rejectAllPendingRequests(reason: unknown): void;
157
+ }
158
+ interface JsonRpcServerTrait extends DisposableTrait {
159
+ readonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;
160
+ readonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;
161
+ notify(method: string, params?: unknown): void;
162
+ receive(message: unknown): void;
163
+ respondSuccess(id: JsonRpcId, result: unknown): void;
164
+ respondError(id: JsonRpcId, error: JsonRpcErrorPayload): void;
165
+ }
166
+ interface JsonRpcServerAndClientTrait extends JsonRpcClientTrait, JsonRpcServerTrait {}
167
+ //#endregion
168
+ //#region src/protocol/json-rpc/create.d.ts
169
+ declare function createJsonRpcClient(options: CreateJsonRpcClientOptions): JsonRpcClientTrait;
170
+ declare function createJsonRpcServer(options: CreateJsonRpcServerOptions): JsonRpcServerTrait;
171
+ declare function createJsonRpcServerAndClient(options: CreateJsonRpcServerAndClientOptions): JsonRpcServerAndClientTrait;
172
+ //#endregion
173
+ //#region src/signals/computed.d.ts
174
+ /**
175
+ * Create a lazy computed signal.
176
+ *
177
+ * Dependencies are collected dynamically while `compute()` runs.
178
+ */
179
+ declare function createComputed<T>(compute: () => T, options?: SignalOptions<T>): ComputedSignalTrait<T>;
180
+ //#endregion
181
+ //#region src/signals/error.d.ts
182
+ declare const ResourceErrorCode: {
183
+ readonly ValueUnavailable: "resource.value_unavailable";
184
+ };
185
+ type ResourceErrorCode = (typeof ResourceErrorCode)[keyof typeof ResourceErrorCode];
186
+ interface ResourceValueUnavailableErrorOptions {
187
+ readonly status: string;
188
+ }
189
+ declare class ResourceError extends Error {
190
+ readonly name = "ResourceError";
191
+ readonly code: ResourceErrorCode;
192
+ readonly status?: string;
193
+ constructor(message: string, options: {
194
+ code: ResourceErrorCode;
195
+ status?: string;
196
+ });
197
+ static valueUnavailable(options: ResourceValueUnavailableErrorOptions): ResourceError;
198
+ }
199
+ //#endregion
200
+ //#region src/signals/resource.d.ts
201
+ interface ResourceStreamContext<T, R> {
202
+ readonly request: R;
203
+ readonly previous: ResourceSnapshot<T>;
204
+ }
205
+ interface CreateResourceOptions<T, R = undefined> {
206
+ readonly request?: ReadableSignalTrait<R | undefined> | (() => R | undefined);
207
+ readonly stream: (context: ResourceStreamContext<T, R>) => ToEventStreamInput<T>;
208
+ }
209
+ declare function createResource<T, R = undefined>(options: CreateResourceOptions<T, R>): ResourceTrait<T>;
210
+ //#endregion
211
+ //#region src/signals/resource-snapshot.d.ts
212
+ declare function whenResourceSnapshotValue<T>(snapshotSignal: ReadableSignalTrait<ResourceSnapshot<T>>, options?: ResourceWhenValueOptions): Promise<T>;
213
+ type AnyResourceSnapshotSelector = (value: any) => ReadableSignalTrait<ResourceSnapshot<unknown>>;
214
+ declare function flattenResourceSnapshot<T1, T2>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>): ResourceSnapshot<T2>;
215
+ declare function flattenResourceSnapshot<T1, T2, T3>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>, select2: (value: T2) => ReadableSignalTrait<ResourceSnapshot<T3>>): ResourceSnapshot<T3>;
216
+ declare function flattenResourceSnapshot<T1, T2, T3, T4>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>, select2: (value: T2) => ReadableSignalTrait<ResourceSnapshot<T3>>, select3: (value: T3) => ReadableSignalTrait<ResourceSnapshot<T4>>): ResourceSnapshot<T4>;
217
+ declare function flattenResourceSnapshot<T1, T2, T3, T4, T5>(sourceSnapshot: ResourceSnapshot<T1>, select1: (value: T1) => ReadableSignalTrait<ResourceSnapshot<T2>>, select2: (value: T2) => ReadableSignalTrait<ResourceSnapshot<T3>>, select3: (value: T3) => ReadableSignalTrait<ResourceSnapshot<T4>>, select4: (value: T4) => ReadableSignalTrait<ResourceSnapshot<T5>>): ResourceSnapshot<T5>;
218
+ declare function flattenResourceSnapshot(sourceSnapshot: ResourceSnapshot<unknown>, select: AnyResourceSnapshotSelector, ...selectors: readonly AnyResourceSnapshotSelector[]): ResourceSnapshot<unknown>;
219
+ declare const ResourceSnapshotUpdateKind: {
220
+ readonly Load: "load";
221
+ readonly Resolve: "resolve";
222
+ readonly Fail: "fail";
223
+ readonly FailWithValue: "fail_with_value";
224
+ };
225
+ type ResourceSnapshotUpdateKind = (typeof ResourceSnapshotUpdateKind)[keyof typeof ResourceSnapshotUpdateKind];
226
+ type ResourceSnapshotUpdate<T> = {
227
+ readonly kind: typeof ResourceSnapshotUpdateKind.Load;
228
+ } | {
229
+ readonly kind: typeof ResourceSnapshotUpdateKind.Resolve;
230
+ readonly value: T;
231
+ } | {
232
+ readonly kind: typeof ResourceSnapshotUpdateKind.Fail;
233
+ readonly error: unknown;
234
+ } | {
235
+ readonly kind: typeof ResourceSnapshotUpdateKind.FailWithValue;
236
+ readonly value: T;
237
+ readonly error: unknown;
238
+ };
239
+ declare function reduceResourceSnapshot<T>(previous: ResourceSnapshot<T>, update: ResourceSnapshotUpdate<T>): ResourceSnapshot<T>;
240
+ //#endregion
241
+ //#region src/signals/signal.d.ts
242
+ /**
243
+ * Minimal writable signal implementation.
244
+ * `set()` always publishes a write. Equality-based value-version suppression is
245
+ * handled by the underlying Rx signal for computed dependency validation.
246
+ */
247
+ declare function createSignal<T>(initial: T, options?: SignalOptions<T>): WritableSignalTrait<T>;
248
+ /**
249
+ * Create a read-only view of a writable signal.
250
+ */
251
+ declare function readonlySignal<T>(signal: WritableSignalTrait<T>): ReadableSignalTrait<T>;
252
+ //#endregion
253
+ //#region src/popup/handle.d.ts
254
+ interface PopupMessageChannelTrait<TOutgoing = unknown, TIncoming = unknown> {
255
+ outgoing: EventSubjectTrait<TOutgoing>;
256
+ incoming: EventStreamTrait<TIncoming>;
257
+ }
258
+ interface PopupWindowHandleTrait extends DisposableTrait {
259
+ messaging: PopupMessageChannelTrait;
260
+ readonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;
261
+ close(): void;
262
+ dispose(): void;
263
+ notify(method: string, params?: unknown): Promise<void>;
264
+ }
265
+ interface PopupClientWindowHandleTrait extends PopupWindowHandleTrait {
266
+ readonly failure: ReadableSignalTrait<ClientError | null>;
267
+ readonly isActive: ReadableSignalTrait<boolean>;
268
+ request<TResult = unknown>(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise<TResult>;
269
+ }
270
+ interface PopupServerWindowHandleTrait extends PopupWindowHandleTrait {}
271
+ interface PopupClientWindowHandleOptions {
272
+ close(): void;
273
+ messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
274
+ time: TimeTrait;
275
+ closedStream: EventStreamTrait<boolean>;
276
+ }
277
+ interface PopupServerWindowHandleOptions {
278
+ close(): void;
279
+ messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
280
+ }
281
+ /**
282
+ * popup opener
283
+ */
284
+ declare class PopupClientWindowHandle implements PopupClientWindowHandleTrait {
285
+ readonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
286
+ private disposed;
287
+ private readonly jsonRpc;
288
+ private readonly session;
289
+ private readonly incomingSubscription;
290
+ private readonly closePopup;
291
+ constructor(options: PopupClientWindowHandleOptions);
292
+ get onNotification(): EventStreamTrait<JsonRpcNotificationEvent>;
293
+ get failure(): ReadableSignalTrait<ClientError | null>;
294
+ get isActive(): ReadableSignalTrait<boolean>;
295
+ notify(method: string, params?: unknown): Promise<void>;
296
+ request<TResult = unknown>(method: string, params?: unknown, options?: JsonRpcRequestOptions): Promise<TResult>;
297
+ close(): void;
298
+ dispose(): void;
299
+ [SYMBOL_DISPOSE](): void;
300
+ }
301
+ /**
302
+ * popup target
303
+ */
304
+ declare class PopupServerWindowHandle implements PopupServerWindowHandleTrait {
305
+ readonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;
306
+ private disposed;
307
+ private readonly jsonRpc;
308
+ private readonly session;
309
+ private readonly incomingSubscription;
310
+ private readonly closePopup;
311
+ constructor(options: PopupServerWindowHandleOptions);
312
+ get onNotification(): EventStreamTrait<JsonRpcNotificationEvent>;
313
+ get onRequest(): EventStreamTrait<JsonRpcRequestEvent>;
314
+ notify(method: string, params?: unknown): Promise<void>;
315
+ close(): void;
316
+ dispose(): void;
317
+ [SYMBOL_DISPOSE](): void;
318
+ }
319
+ //#endregion
320
+ //#region src/popup/errors.d.ts
321
+ declare const PopupErrorCode: {
322
+ readonly Blocked: "popup.blocked";
323
+ readonly Closed: "popup.closed_by_user";
324
+ };
325
+ type PopupErrorCode = (typeof PopupErrorCode)[keyof typeof PopupErrorCode];
326
+ declare function readPopupErrorPresentationDescriptor(error: unknown, options?: ReadErrorPresentationDescriptorOptions): ErrorPresentationDescriptor;
327
+ //#endregion
328
+ //#region src/popup/session.d.ts
329
+ interface CreatePopupClientSessionOptions {
330
+ jsonRpc: JsonRpcClientTrait;
331
+ time: TimeTrait;
332
+ closedStream: EventStreamTrait<boolean>;
333
+ readyTimeoutMs?: number;
334
+ heartbeatIntervalMs?: number;
335
+ heartbeatTimeoutMs?: number;
336
+ }
337
+ interface CreatePopupServerSessionOptions {
338
+ jsonRpc: JsonRpcServerTrait;
339
+ }
340
+ //#endregion
341
+ //#region src/popup/index.d.ts
342
+ declare const PopupAttachFailureReason: {
343
+ readonly MissingOpener: "missing_opener";
344
+ readonly MissingOrigin: "missing_origin";
345
+ };
346
+ type PopupAttachFailureReason = (typeof PopupAttachFailureReason)[keyof typeof PopupAttachFailureReason];
347
+ interface PopupAttachSuccess {
348
+ kind: "success";
349
+ handle: PopupServerWindowHandleTrait;
350
+ }
351
+ interface PopupAttachFailure {
352
+ kind: "failure";
353
+ reason: PopupAttachFailureReason;
354
+ error: ClientError;
355
+ }
356
+ type PopupAttachResult = PopupAttachSuccess | PopupAttachFailure;
357
+ interface PopupOpenOptions {
358
+ target?: string;
359
+ width?: number;
360
+ height?: number;
361
+ expectedOrigin?: string;
362
+ }
363
+ interface PopupTrait {
364
+ open(url: string, options?: PopupOpenOptions): PopupClientWindowHandleTrait;
365
+ attach(): PopupAttachResult;
366
+ }
367
+ declare const POPUP_TRAIT_TOKEN: SecuritydeptInjectionToken<PopupTrait | null>;
368
+ //#endregion
369
+ //#region src/validation/schemas/uri.d.ts
370
+ declare const UriStringSchema: _$arktype_internal_variants_string_ts0.StringType<string, {}>;
371
+ declare const BaseURIStringSchema: _$arktype_internal_variants_string_ts0.StringType<string, {}>;
372
+ declare const UriRelativeStringSchema: _$arktype_internal_variants_string_ts0.StringType<string, {}>;
373
+ declare const UriReferenceStringSchema: _$arktype_internal_variants_string_ts0.StringType<string, {}>;
374
+ //#endregion
375
+ //#region src/router/metadata.d.ts
376
+ /** Route-data key holding the SecurityDept metadata blob for a segment. */
377
+ declare const SECURITYDEPT_ROUTE_METADATA_KEY = "__securitydept__";
378
+ /** Serializable SecurityDept route metadata. */
379
+ interface SecuritydeptRouteMetadata<TAuthRequirement extends AuthRequirement = AuthRequirement> {
380
+ requirements?: readonly TAuthRequirement[];
381
+ composition?: RequirementsComposition;
382
+ }
383
+ /** Read SecurityDept route metadata from a route `data` bag. */
384
+ declare function readSecuritydeptRouteMetadata<TAuthRequirement extends AuthRequirement = AuthRequirement>(data: object | undefined): SecuritydeptRouteMetadata<TAuthRequirement> | undefined;
385
+ /** Merge SecurityDept route metadata into a route `data` bag. */
386
+ declare function writeSecuritydeptRouteMetadata<TAuthRequirement extends AuthRequirement = AuthRequirement>(base: object | undefined, patch: SecuritydeptRouteMetadata<TAuthRequirement>): Record<string, unknown>;
387
+ //#endregion
388
+ //#region src/struct/uri-string.d.ts
389
+ /**
390
+ * Thrown when a string cannot be parsed into the requested URI variant.
391
+ */
392
+ declare class UriParseError extends Error {
393
+ readonly input: string;
394
+ readonly kind: string;
395
+ constructor(input: string, kind: string, options?: ErrorOptions);
396
+ }
397
+ /**
398
+ * The relative components of a URL — pathname, search, and hash.
399
+ *
400
+ * All fields use the same format as the native `URL` accessors:
401
+ * - `pathname` starts with `/` (e.g. `"/path"`).
402
+ * - `search` includes the leading `?` when present (e.g. `"?q=1"`).
403
+ * - `hash` includes the leading `#` when present (e.g. `"#section"`).
404
+ */
405
+ interface UriRelativeParts {
406
+ readonly pathname: string;
407
+ readonly search: string;
408
+ readonly hash: string;
409
+ }
410
+ /**
411
+ * Minimal structural type for URI fragment parsing.
412
+ *
413
+ * Matches any value that exposes a URL-style `hash` accessor — for example
414
+ * `URL`, `Location`, or {@link UriReferenceString}.
415
+ */
416
+ interface UriFragmentPart {
417
+ readonly hash: string;
418
+ }
419
+ /**
420
+ * Minimal structural type for URI reference parsing.
421
+ *
422
+ * Matches any value that can be serialized via `toString()` — for example
423
+ * native `URL`, `Location`, or {@link UriReferenceString}.
424
+ */
425
+ interface UriReferenceStringLike {
426
+ toString(): string;
427
+ }
428
+ type UriReferenceStringInput = string | UriReferenceStringLike;
429
+ type UriSearchParamsInit = NonNullable<ConstructorParameters<typeof URLSearchParams>[0]>;
430
+ /**
431
+ * Immutable wrapper around a URI-reference string.
432
+ *
433
+ * A URI-reference (RFC 3986 §4.1) is either an absolute URI or a relative
434
+ * reference. Concrete subclasses {@link UriString} and
435
+ * {@link UriRelativeString} carry the additional type-level guarantee of
436
+ * which variant they hold.
437
+ *
438
+ * Instances created via `UriReferenceString.parse` / `.tryParse` are always
439
+ * one of the two subclasses, so {@link isAbsolute} and {@link isRelative}
440
+ * narrow correctly.
441
+ */
442
+ declare class UriReferenceString {
443
+ /** The original, unmodified input string. */
444
+ protected readonly _raw: string;
445
+ /**
446
+ * Eagerly parsed URL helper.
447
+ *
448
+ * - Absolute URIs: `new URL(raw)`.
449
+ * - Relative URIs: `new URL(raw, RELATIVE_URI_SENTINEL_BASE)`.
450
+ *
451
+ * For relative URIs the scheme and host originate from the sentinel and
452
+ * MUST NOT be used for origin-sensitive operations.
453
+ */
454
+ protected readonly _parsed: URL;
455
+ protected readonly _isAbsolute: boolean;
456
+ protected constructor(raw: string, parsed: URL, isAbsolute: boolean);
457
+ /**
458
+ * Parse any valid URI reference (absolute or relative).
459
+ *
460
+ * The returned instance is always a {@link UriString} or
461
+ * {@link UriRelativeString}.
462
+ *
463
+ * @throws {UriParseError} when the input is not a valid URI reference.
464
+ */
465
+ static parse(input: UriReferenceStringInput): UriReferenceString;
466
+ /**
467
+ * Try to parse a URI reference, returning `null` on failure.
468
+ *
469
+ * The returned instance is always a {@link UriString} or
470
+ * {@link UriRelativeString}.
471
+ */
472
+ static tryParse(input: UriReferenceStringInput): UriReferenceString | null;
473
+ /** Create from a native `URL`. Always produces a {@link UriString}. */
474
+ static fromURL(url: URL): UriString;
475
+ /**
476
+ * Create from the relative components of a URL.
477
+ * Always produces a {@link UriRelativeString}.
478
+ */
479
+ static fromURLRelative(parts: UriRelativeParts): UriRelativeString;
480
+ /** The original input string. */
481
+ get raw(): string;
482
+ get pathname(): string;
483
+ get hash(): string;
484
+ get search(): string;
485
+ get searchParams(): URLSearchParams;
486
+ /** Type-guard: narrows to {@link UriString} when the reference is absolute. */
487
+ isAbsolute(): this is UriString;
488
+ /** Type-guard: narrows to {@link UriRelativeString} when the reference is relative. */
489
+ isRelative(): this is UriRelativeString;
490
+ /** Narrow to {@link UriString} or return `null`. */
491
+ asAbsolute(): UriString | null;
492
+ /** Narrow to {@link UriRelativeString} or return `null`. */
493
+ asRelative(): UriRelativeString | null;
494
+ /**
495
+ * Returns a new instance with `hash` replaced.
496
+ *
497
+ * @param value URL-style hash, including a leading `#` when non-empty.
498
+ */
499
+ setHash(value: string): this;
500
+ /** Returns a new instance with the complete query parameter set replaced. */
501
+ setSearchParams(init?: UriSearchParamsInit): this;
502
+ /**
503
+ * Convert to a native `URL`.
504
+ *
505
+ * A `base` is required when the reference is relative; it is ignored
506
+ * for absolute references.
507
+ *
508
+ * @throws {TypeError} when the reference is relative and no base is provided.
509
+ */
510
+ toURL(base?: string | URL): URL;
511
+ toString(): string;
512
+ valueOf(): string;
513
+ toJSON(): string;
514
+ }
515
+ /**
516
+ * Immutable wrapper around an absolute URI string.
517
+ *
518
+ * An absolute URI (RFC 3986 §4.3) always starts with a scheme component
519
+ * (e.g. `https://example.com/path`).
520
+ */
521
+ declare class UriString extends UriReferenceString {
522
+ protected constructor(raw: string, parsed: URL);
523
+ /**
524
+ * Parse an absolute URI string.
525
+ *
526
+ * @throws {UriParseError} when the input is not a valid absolute URI.
527
+ */
528
+ static parse(input: string): UriString;
529
+ /**
530
+ * Try to parse an absolute URI, returning `null` if the input is not
531
+ * a valid absolute URI.
532
+ */
533
+ static tryParse(input: string | UriString): UriString | null;
534
+ /** Create from a native `URL`, using its `href` as the raw string. */
535
+ static fromURL(url: URL): UriString;
536
+ /**
537
+ * Not supported — relative parts cannot produce an absolute URI.
538
+ *
539
+ * @throws {TypeError} unconditionally.
540
+ */
541
+ static fromURLRelative(_parts: UriRelativeParts): never;
542
+ get host(): string;
543
+ get hostname(): string;
544
+ get origin(): string;
545
+ get password(): string;
546
+ get port(): string;
547
+ get protocol(): string;
548
+ get username(): string;
549
+ /** Convert to a native `URL`. No base is required for absolute URIs. */
550
+ toURL(): URL;
551
+ }
552
+ /**
553
+ * Immutable wrapper around a relative URI reference string.
554
+ *
555
+ * A relative reference (RFC 3986 §4.2) has no scheme and must be resolved
556
+ * against a base URI to obtain an absolute URI.
557
+ *
558
+ * Internally, the raw string is parsed against a sentinel base
559
+ * (`http://localhost`) to enable eager validation and URL-component
560
+ * extraction. The sentinel origin is never leaked through the public API.
561
+ */
562
+ declare class UriRelativeString extends UriReferenceString {
563
+ protected constructor(raw: string, parsed: URL);
564
+ /**
565
+ * Parse a relative URI reference.
566
+ *
567
+ * @throws {UriParseError} when the input is absolute or not a valid
568
+ * relative URI reference.
569
+ */
570
+ static parse(input: string): UriRelativeString;
571
+ /**
572
+ * Try to parse a relative URI reference, returning `null` if the input
573
+ * is an absolute URI or otherwise invalid.
574
+ */
575
+ static tryParse(input: string | UriRelativeString): UriRelativeString | null;
576
+ /**
577
+ * Not supported — a native `URL` is always absolute and cannot be
578
+ * represented as a relative URI reference.
579
+ *
580
+ * @throws {TypeError} unconditionally.
581
+ */
582
+ static fromURL(_url: URL): never;
583
+ /**
584
+ * Create from the relative components of a URL.
585
+ *
586
+ * Concatenates `pathname + search + hash` into a relative URI string.
587
+ */
588
+ static fromURLRelative(parts: UriRelativeParts): UriRelativeString;
589
+ /**
590
+ * Convert to a native `URL` by resolving against the given base.
591
+ *
592
+ * @param base - The base URL to resolve against (required).
593
+ */
594
+ toURL(base: string | URL): URL;
595
+ }
596
+ //#endregion
597
+ //#region src/protocol/compat-fragment.d.ts
598
+ declare const SECURITYDEPT_COMPAT_FRAGMENT_VERSION = "v1";
599
+ type CompatFragmentParameters = Record<string, string>;
600
+ interface CompatFragment {
601
+ payload: string;
602
+ parameters: CompatFragmentParameters;
603
+ }
604
+ interface AppendOrReplaceCompatFragmentOptions {
605
+ payload: string | URLSearchParams | CompatFragmentParameters;
606
+ }
607
+ interface TakeCompatFragmentResult<T> {
608
+ compatFragment: CompatFragment | null;
609
+ fragment: string;
610
+ url: UpdatedUriFragment<T>;
611
+ }
612
+ interface TakeCompatFragmentOptions<T> {
613
+ condition?: (compatFragment: CompatFragment) => boolean;
614
+ update: UpdateUriFragmentHash<T>;
615
+ }
616
+ interface AppendOrReplaceCompatFragmentResult<T> {
617
+ fragment: string;
618
+ url: UpdatedUriFragment<T>;
619
+ }
620
+ type UpdatedUriFragment<T> = T extends string ? string : T;
621
+ type UpdateUriFragmentHash<T> = (input: T, hash: string) => UpdatedUriFragment<T>;
622
+ declare function appendOrReplaceCompatFragment<T extends string | UriFragmentPart>(input: T, options: AppendOrReplaceCompatFragmentOptions, update: UpdateUriFragmentHash<T>): AppendOrReplaceCompatFragmentResult<T>;
623
+ declare function parseCompatFragment(input: string | UriFragmentPart): CompatFragment | null;
624
+ declare function takeCompatFragment<T extends string | UriFragmentPart>(input: T, options: TakeCompatFragmentOptions<T>): TakeCompatFragmentResult<T>;
625
+ declare function isCompatFragmentBlock(block: string): boolean;
626
+ //#endregion
627
+ //#region src/router/router.d.ts
628
+ declare const RouterNavigationIntent: {
629
+ readonly AuthRedirect: "auth_redirect";
630
+ readonly PostAuthRedirect: "post_auth_redirect";
631
+ readonly CallbackCleanup: "callback_cleanup";
632
+ readonly ExternalOpen: "external_open";
633
+ };
634
+ type RouterNavigationIntent = (typeof RouterNavigationIntent)[keyof typeof RouterNavigationIntent];
635
+ declare const RouterNavigationMode: {
636
+ readonly Push: "push";
637
+ readonly Replace: "replace";
638
+ readonly External: "external";
639
+ };
640
+ type RouterNavigationMode = (typeof RouterNavigationMode)[keyof typeof RouterNavigationMode];
641
+ interface RouterNavigationRequest {
642
+ url: UriReferenceString;
643
+ intent: RouterNavigationIntent;
644
+ mode: RouterNavigationMode;
645
+ state?: unknown;
646
+ }
647
+ interface RouterTrait {
648
+ currentUrl(): UriReferenceString | null;
649
+ navigate(request: RouterNavigationRequest): void | Promise<void>;
650
+ }
651
+ interface TakeCompatFragmentFromRouterOptions {
652
+ condition?: (compatFragment: CompatFragment) => boolean;
653
+ }
654
+ declare function takeCompatFragmentFromRouter(router: RouterTrait, options?: TakeCompatFragmentFromRouterOptions): Promise<CompatFragment | null>;
655
+ declare const ROUTER_TRAIT_TOKEN: SecuritydeptInjectionToken<RouterTrait | null>;
656
+ //#endregion
657
+ //#region src/span/types.d.ts
658
+ interface SpanCreateOptions {
659
+ idFactory?: () => string;
660
+ attributes?: Record<string, unknown>;
661
+ mutable?: false;
662
+ }
663
+ interface MutableSpanCreateOptions extends Omit<SpanCreateOptions, "mutable"> {
664
+ mutable: true;
665
+ }
666
+ interface SpanTrait {
667
+ readonly id: string;
668
+ readonly parent?: SpanTrait;
669
+ readonly attributes: Readonly<Record<string, unknown>>;
670
+ fork(options: MutableSpanCreateOptions): MutableSpanTrait;
671
+ fork(options?: SpanCreateOptions): SpanTrait;
672
+ fork(options?: SpanCreateOptions | MutableSpanCreateOptions): SpanTrait | MutableSpanTrait;
673
+ }
674
+ interface MutableSpanTrait extends SpanTrait {
675
+ setAttributes(attributes: Record<string, unknown>): void;
676
+ }
677
+ declare const SPAN_TRAIT_TOKEN: SecuritydeptInjectionToken<SpanTrait>;
678
+ interface OperationSpanTrait extends MutableSpanTrait {
679
+ addEvent(type: string, attributes?: Record<string, unknown>): void;
680
+ recordError(error: unknown, attributes?: Record<string, unknown>): void;
681
+ }
682
+ //#endregion
683
+ //#region src/validation/validator.d.ts
684
+ /**
685
+ * Successful validation result.
686
+ *
687
+ * Contains the parsed, typed output value from the schema.
688
+ */
689
+ interface ValidationSuccess<T> {
690
+ readonly success: true;
691
+ readonly value: T;
692
+ }
693
+ /**
694
+ * Failed validation result.
695
+ *
696
+ * Contains the list of issues reported by the schema.
697
+ */
698
+ interface ValidationFailure {
699
+ readonly success: false;
700
+ readonly issues: ReadonlyArray<StandardSchemaV1.Issue>;
701
+ }
702
+ /**
703
+ * Discriminated union of validation outcomes.
704
+ *
705
+ * Consumers can narrow on `success` to access either the typed value
706
+ * or the issue list.
707
+ */
708
+ type ValidationResult<T> = ValidationSuccess<T> | ValidationFailure;
709
+ type TraitInputValidator = StandardSchemaV1<unknown, unknown>;
710
+ type TraitInputBundledSchema = StandardSchemaV1<unknown, unknown>;
711
+ interface WithTraitInputValidator<TValidator = TraitInputValidator> {
712
+ validators?: TValidator;
713
+ }
714
+ interface ValidateTraitInputOptions {
715
+ value: unknown;
716
+ bundledSchema: TraitInputBundledSchema;
717
+ validator?: TraitInputValidator;
718
+ optional?: boolean;
719
+ onInvalid(failure: ValidationFailure): never;
720
+ }
721
+ declare function formatValidationFailure(failure: ValidationFailure | undefined): string | null;
722
+ declare function throwValidationClientError(options: {
723
+ code: string;
724
+ source: string;
725
+ messagePrefix: string;
726
+ failure?: ValidationFailure;
727
+ }): never;
728
+ /**
729
+ * Validate an unknown input against a `@standard-schema`-compatible schema.
730
+ *
731
+ * This is the foundation-level entry point for SDK validation. It accepts
732
+ * any schema implementing `StandardSchemaV1` and returns a discriminated
733
+ * `ValidationResult`.
734
+ *
735
+ * @example
736
+ * ```ts
737
+ * import { validateWithSchema } from "@securitydept/client";
738
+ * import { z } from "zod";
739
+ *
740
+ * const UserSchema = z.object({ name: z.string() });
741
+ * const result = await validateWithSchema(UserSchema, { name: "Alice" });
742
+ * if (result.success) {
743
+ * console.log(result.value.name);
744
+ * } else {
745
+ * console.error(result.issues);
746
+ * }
747
+ * ```
748
+ */
749
+ declare function validateWithSchema<I, O>(schema: StandardSchemaV1<I, O>, input: unknown): Promise<ValidationResult<O>>;
750
+ /**
751
+ * Validate an unknown input synchronously against a `@standard-schema`-compatible schema.
752
+ *
753
+ * Only use this when you know the schema's validate function returns synchronously.
754
+ * Throws if the schema returns a Promise.
755
+ */
756
+ declare function validateWithSchemaSync<I, O>(schema: StandardSchemaV1<I, O>, input: unknown): ValidationResult<O>;
757
+ declare function validateTraitInput(options: ValidateTraitInputOptions): void;
758
+ //#endregion
759
+ //#region src/std/time.d.ts
760
+ interface TimeTraitStdHost {
761
+ Date: Pick<DateConstructor, "now">;
762
+ setTimeout(handler: () => void, delayMs: number): unknown;
763
+ clearTimeout(handle: unknown): void;
764
+ }
765
+ interface TimeForStdCreateOptions {
766
+ host?: TimeTraitStdHost;
767
+ }
768
+ declare function createTimeForStd(options?: TimeForStdCreateOptions & WithTraitInputValidator<TraitInputValidator>): TimeTrait;
769
+ //#endregion
770
+ //#region src/std/transport/authorization-interceptor.d.ts
771
+ type AuthorizationSignal = ReadableSignalTrait<string | null | undefined> | ResourceTrait<string | null | undefined>;
772
+ type AuthorizationInterceptedFetchPredicate = (input: RequestInfo | URL, init: RequestInit | undefined) => boolean | Promise<boolean>;
773
+ interface CreateAuthorizationInterceptedFetchOptions {
774
+ readonly predicate: AuthorizationInterceptedFetchPredicate;
775
+ readonly authorization: AuthorizationSignal;
776
+ }
777
+ declare function createAuthorizationInterceptedFetch(fetchImpl: typeof fetch, options: CreateAuthorizationInterceptedFetchOptions): typeof fetch;
778
+ //#endregion
779
+ //#region src/transport/types.d.ts
780
+ declare const TransportErrorCode: {
781
+ readonly RequestFailed: "transport.request_failed";
782
+ readonly ResponseDecodeFailed: "transport.response_decode_failed";
783
+ readonly InvalidStdFetchOptions: "transport.invalid_std_fetch_options";
784
+ readonly InvalidAngularOptions: "transport.invalid_angular_options";
785
+ };
786
+ type TransportErrorCode = (typeof TransportErrorCode)[keyof typeof TransportErrorCode];
787
+ /** Neutral HTTP request representation. */
788
+ interface HttpRequest {
789
+ url: string;
790
+ method: string;
791
+ headers: Record<string, string>;
792
+ body?: unknown;
793
+ cancellationToken?: CancellationTokenTrait;
794
+ }
795
+ /** Neutral HTTP response representation. */
796
+ interface HttpResponse {
797
+ status: number;
798
+ headers: Record<string, string>;
799
+ body?: unknown;
800
+ }
801
+ type HttpResponseJsonBody = Record<string, unknown>;
802
+ /** Neutral request executor trait. */
803
+ interface BaseTransportTrait {
804
+ execute(request: HttpRequest): Promise<HttpResponse>;
805
+ }
806
+ declare const TRANSPORT_TRAIT_TOKEN: SecuritydeptInjectionToken<BaseTransportTrait>;
807
+ //#endregion
808
+ //#region src/std/transport/base-transport.d.ts
809
+ declare const FetchTransportRedirectKind: {
810
+ readonly Follow: "follow";
811
+ readonly Manual: "manual";
812
+ };
813
+ type FetchTransportRedirectKind = (typeof FetchTransportRedirectKind)[keyof typeof FetchTransportRedirectKind];
814
+ interface BaseTransportForStdFetchCreateOptions {
815
+ redirect?: FetchTransportRedirectKind;
816
+ fetch?: typeof fetch;
817
+ baseUrl?: string | URL;
818
+ }
819
+ /**
820
+ * Default `BaseTransportTrait` backed by the global `fetch` API.
821
+ *
822
+ * The caller is responsible for ensuring `fetch` is available in the runtime.
823
+ * No polyfill is injected.
824
+ */
825
+ declare function createBaseTransportForStdFetch(options?: BaseTransportForStdFetchCreateOptions & WithTraitInputValidator<TraitInputValidator>): BaseTransportTrait;
826
+ //#endregion
827
+ //#region src/storage/types.d.ts
828
+ declare const StorageChangeEventOrigin: {
829
+ readonly Local: "local";
830
+ readonly External: "external";
831
+ };
832
+ type StorageChangeEventOrigin = (typeof StorageChangeEventOrigin)[keyof typeof StorageChangeEventOrigin];
833
+ interface StorageChangeEvent {
834
+ readonly origin: StorageChangeEventOrigin;
835
+ readonly key: string | null;
836
+ readonly oldValue: string | null;
837
+ readonly newValue: string | null;
838
+ }
839
+ /** Low-level key-value storage trait. */
840
+ interface StorageTrait {
841
+ readonly storageEvent?: EventStreamTrait<StorageChangeEvent>;
842
+ get(key: string): string | null | Promise<string | null>;
843
+ set(key: string, value: string): void | Promise<void>;
844
+ /**
845
+ * Atomically read and remove a record within the store's consistency domain.
846
+ */
847
+ take?(key: string): string | null | Promise<string | null>;
848
+ remove(key: string): void | Promise<void>;
849
+ }
850
+ /** Storage whose operations complete synchronously in the current realm. */
851
+ interface SyncStorageTrait extends StorageTrait {
852
+ get(key: string): string | null;
853
+ set(key: string, value: string): void;
854
+ take?(key: string): string | null;
855
+ remove(key: string): void;
856
+ }
857
+ declare const REALM_STORAGE_TRAIT_TOKEN: SecuritydeptInjectionToken<SyncStorageTrait>;
858
+ declare const PERSISTENT_STORAGE_TRAIT_TOKEN: SecuritydeptInjectionToken<StorageTrait | null>;
859
+ declare const SESSION_STORAGE_TRAIT_TOKEN: SecuritydeptInjectionToken<StorageTrait | null>;
860
+ /** Serialization codec for typed values. */
861
+ interface Codec<T> {
862
+ encode(value: T): string;
863
+ decode(raw: string): T;
864
+ }
865
+ /** Semantic store for long-lived auth state. */
866
+ interface PersistentAuthStore<T> {
867
+ load(): Promise<T | null>;
868
+ save(value: T): Promise<void>;
869
+ clear(): Promise<void>;
870
+ }
871
+ /** Semantic store for recoverable state (survives page reload). */
872
+ interface RecoverableStateStore<T> {
873
+ load(): Promise<T | null>;
874
+ save(value: T): Promise<void>;
875
+ clear(): Promise<void>;
876
+ }
877
+ /** Semantic store for ephemeral flow state (one-time-use). */
878
+ interface EphemeralFlowStore<T> {
879
+ load(): Promise<T | null>;
880
+ save(value: T): Promise<void>;
881
+ consume(): Promise<T | null>;
882
+ clear(): Promise<void>;
883
+ }
884
+ /** Semantic store for keyed ephemeral flow state (one-time-use per key). */
885
+ interface KeyedEphemeralFlowStore<T> {
886
+ load(key: string): Promise<T | null>;
887
+ save(key: string, value: T): Promise<void>;
888
+ take(key: string): Promise<T | null>;
889
+ clear(key: string): Promise<void>;
890
+ }
891
+ /** Versioned storage envelope — first-version migration support. */
892
+ interface StoredEnvelope<T> {
893
+ version: number;
894
+ storedAt: number;
895
+ expiresAt?: number;
896
+ value: T;
897
+ }
898
+ //#endregion
899
+ //#region src/tracing/types.d.ts
900
+ declare const TracingLevel: {
901
+ readonly Debug: "debug";
902
+ readonly Info: "info";
903
+ readonly Warn: "warn";
904
+ readonly Error: "error";
905
+ };
906
+ type TracingLevel = (typeof TracingLevel)[keyof typeof TracingLevel];
907
+ declare const OperationTraceEventType: {
908
+ readonly Started: "operation.started";
909
+ readonly Event: "operation.event";
910
+ readonly Error: "operation.error";
911
+ readonly Ended: "operation.ended";
912
+ };
913
+ type OperationTraceEventType = (typeof OperationTraceEventType)[keyof typeof OperationTraceEventType];
914
+ interface TracingEvent {
915
+ name: string;
916
+ at: number;
917
+ span: SpanTrait;
918
+ level: TracingLevel;
919
+ target: string;
920
+ fields?: Record<string, unknown>;
921
+ }
922
+ interface TracingTrait extends DisposableTrait {
923
+ record(event: TracingEvent): void;
924
+ readonly events: EventStreamTrait<TracingEvent>;
925
+ }
926
+ declare const TRACING_TRAIT_TOKEN: SecuritydeptInjectionToken<TracingTrait>;
927
+ //#endregion
928
+ //#region src/tracing/subscriber/types.d.ts
929
+ interface TracingSubscriberTrait {
930
+ record(event: TracingEvent): void;
931
+ }
932
+ //#endregion
933
+ //#region src/tracing/create.d.ts
934
+ interface TracingCreateOptions {
935
+ subscribers?: readonly TracingSubscriberTrait[];
936
+ }
937
+ declare function createTracing(options?: TracingCreateOptions & WithTraitInputValidator<TraitInputValidator>): TracingTrait;
938
+ //#endregion
939
+ //#region src/environment/types.d.ts
940
+ /**
941
+ * Foundation dependency environment injected into client-side auth runtimes
942
+ * via explicit wiring at the composition root.
943
+ *
944
+ * `transport`, `time`, `realmStorage`, `span`, and `tracing` are the required baseline
945
+ * capabilities. Optional page/router/popup/storage traits stay explicit.
946
+ * Raw host-material inputs such as `window`, `location`, or browser storage
947
+ * handles are intentionally outside this contract and should be resolved by
948
+ * host-specific creators before a `FoundationEnvironment` is assembled.
949
+ */
950
+ interface FoundationEnvironment {
951
+ injector: SecuritydeptInjector;
952
+ transport: BaseTransportTrait;
953
+ time: TimeTrait;
954
+ realmStorage: SyncStorageTrait;
955
+ idleCallback?: IdleCallbackTrait;
956
+ persistentStorage?: StorageTrait;
957
+ sessionStorage?: StorageTrait;
958
+ span: SpanTrait;
959
+ tracing: TracingTrait;
960
+ router?: RouterTrait;
961
+ pageLifecycle?: PageLifecycleTrait;
962
+ popup?: PopupTrait;
963
+ }
964
+ interface ServiceWorkerEnvironment extends FoundationEnvironment {}
965
+ declare const ENVIRONMENT_TOKEN: SecuritydeptInjectionToken<FoundationEnvironment>;
966
+ interface EnvironmentValidators {
967
+ transport?: TraitInputValidator;
968
+ transportForStdFetchCreateOptions?: TraitInputValidator;
969
+ time?: TraitInputValidator;
970
+ timeForStdCreateOptions?: TraitInputValidator;
971
+ realmStorage?: TraitInputValidator;
972
+ idleCallback?: TraitInputValidator;
973
+ persistentStorage?: TraitInputValidator;
974
+ sessionStorage?: TraitInputValidator;
975
+ span?: TraitInputValidator;
976
+ spanCreateOptions?: TraitInputValidator;
977
+ tracing?: TraitInputValidator;
978
+ tracingCreateOptions?: TraitInputValidator;
979
+ router?: TraitInputValidator;
980
+ pageLifecycle?: TraitInputValidator;
981
+ popup?: TraitInputValidator;
982
+ }
983
+ //#endregion
984
+ //#region src/environment/create.d.ts
985
+ interface CreateFoundationEnvironmentOptions {
986
+ providers?: readonly SecuritydeptProvider[];
987
+ transport?: BaseTransportTrait;
988
+ transportForStdFetchCreateOptions?: BaseTransportForStdFetchCreateOptions;
989
+ time?: TimeTrait;
990
+ timeForStdCreateOptions?: TimeForStdCreateOptions;
991
+ realmStorage?: SyncStorageTrait;
992
+ span?: SpanTrait;
993
+ spanCreateOptions?: SpanCreateOptions;
994
+ tracing?: TracingTrait;
995
+ tracingCreateOptions?: TracingCreateOptions;
996
+ idleCallback?: IdleCallbackTrait | null;
997
+ persistentStorage?: StorageTrait | null;
998
+ sessionStorage?: StorageTrait | null;
999
+ router?: RouterTrait | null;
1000
+ pageLifecycle?: PageLifecycleTrait | null;
1001
+ popup?: PopupTrait | null;
1002
+ validators?: EnvironmentValidators;
1003
+ }
1004
+ /**
1005
+ * Create a `FoundationEnvironment` from explicit trait units and defaults.
1006
+ *
1007
+ * This helper owns foundation-wide baseline resolution and trait-graph wiring.
1008
+ *
1009
+ * It may resolve:
1010
+ * - public std adapters such as
1011
+ * `transportForStdFetchCreateOptions -> transport` and `timeForStdCreateOptions -> time`
1012
+ * - public hostless baseline constructors such as
1013
+ * `spanCreateOptions -> span` and `tracingCreateOptions -> tracing`
1014
+ *
1015
+ * Host-material discovery such as resolving `window`, `location`, `history`,
1016
+ * or browser storage handles belongs to explicit host adapters such as
1017
+ * `@securitydept/client/web`, which must first resolve those inputs into
1018
+ * concrete traits before calling this helper.
1019
+ */
1020
+ declare function createFoundationEnvironment(overrides: CreateFoundationEnvironmentOptions): FoundationEnvironment;
1021
+ //#endregion
1022
+ //#region src/auth-coordination/contract.d.ts
1023
+ interface AuthRequirement {
1024
+ /** Unique entity id for this requirement within the plan. */
1025
+ readonly id: string;
1026
+ /** Human-readable label (for logging / debugging). */
1027
+ readonly label?: string;
1028
+ }
1029
+ interface StaticAttrsAuthRequirementInput<TAttributes = Record<string, unknown>> {
1030
+ readonly id?: string;
1031
+ readonly label?: string;
1032
+ readonly attributes?: TAttributes;
1033
+ }
1034
+ declare class StaticAttrsAuthRequirement<TAttributes = Record<string, unknown>> implements AuthRequirement {
1035
+ readonly id: string;
1036
+ readonly label: string | undefined;
1037
+ readonly attributes: TAttributes | undefined;
1038
+ protected constructor(id: string, label: string | undefined, attributes: TAttributes | undefined);
1039
+ static create<TAttributes = Record<string, unknown>>(input?: StaticAttrsAuthRequirementInput<TAttributes>): StaticAttrsAuthRequirement<TAttributes>;
1040
+ static createList<TAttributes = Record<string, unknown>>(inputs: readonly StaticAttrsAuthRequirementInput<TAttributes>[]): readonly StaticAttrsAuthRequirement<TAttributes>[];
1041
+ }
1042
+ /** Outcome of resolving a single requirement. */
1043
+ declare const ResolutionStatus: {
1044
+ readonly Fulfilled: "fulfilled";
1045
+ readonly Failed: "failed";
1046
+ readonly Skipped: "skipped";
1047
+ };
1048
+ type ResolutionStatus = (typeof ResolutionStatus)[keyof typeof ResolutionStatus];
1049
+ /** The resolution result for a single requirement. */
1050
+ interface RequirementResolution {
1051
+ /** The requirement ID this resolution applies to. */
1052
+ requirementId: string;
1053
+ /** Outcome status. */
1054
+ status: ResolutionStatus;
1055
+ /** Optional error or reason for failure/skip. */
1056
+ reason?: string;
1057
+ }
1058
+ /** Overall plan status. */
1059
+ declare const PlanStatus: {
1060
+ /** There are still pending requirements. */readonly Pending: "pending"; /** All requirements have been resolved. */
1061
+ readonly Settled: "settled";
1062
+ };
1063
+ type PlanStatus = (typeof PlanStatus)[keyof typeof PlanStatus];
1064
+ /** Error thrown when a planner contract is violated (e.g. duplicate ids). */
1065
+ declare class RequirementPlannerError extends Error {
1066
+ constructor(message: string);
1067
+ }
1068
+ /** Result of an authentication check. */
1069
+ type AuthenticatedCheck = boolean | Promise<boolean>;
1070
+ /**
1071
+ * Return value of an unauthenticated handler.
1072
+ *
1073
+ * - `true` — the requirement is now satisfied (resolved as fulfilled);
1074
+ * the pipeline records the resolution and may continue.
1075
+ * - `false` — block: the requirement cannot proceed.
1076
+ * - `string` — redirect to the given location.
1077
+ * - A never-settling `Promise` — used when a full-page external redirect has
1078
+ * started; the step intentionally never resolves so the host navigation is
1079
+ * not finalized while the page is leaving.
1080
+ */
1081
+ type UnauthenticatedAction = boolean | string | Promise<boolean | string>;
1082
+ /**
1083
+ * Behaviour evaluation context handed to every behaviour callback.
1084
+ *
1085
+ * Reflects the planner state at the moment the callback is invoked.
1086
+ */
1087
+ type RequirementBehaviourContext<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = {
1088
+ readonly planContext: TPlanContext;
1089
+ readonly environment: FoundationEnvironment; /** The full effective requirement list for the active plan. */
1090
+ readonly requirements: readonly TAuthRequirement[]; /** Resolutions collected so far (in requirement order). */
1091
+ readonly resolutionList: readonly RequirementResolution[];
1092
+ };
1093
+ /** Stream of unauthenticated requirements discovered by the planner. */
1094
+ type RequirementCandidateGenerator<TAuthRequirement extends AuthRequirement = AuthRequirement> = AsyncGenerator<TAuthRequirement, void, unknown>;
1095
+ /**
1096
+ * Context handed to candidate selection.
1097
+ *
1098
+ * `candidateList` is intentionally a stream: selectors that can act on the
1099
+ * first available unauthenticated requirement do not need to wait for all
1100
+ * checks to complete, while chooser-style selectors can still collect the full
1101
+ * stream with `for await`.
1102
+ */
1103
+ type RequirementCandidateSelectionContext<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = RequirementBehaviourContext<TAuthRequirement, TPlanContext> & {
1104
+ /** Requirements not yet satisfied, yielded as their checks complete. */readonly candidateList: RequirementCandidateGenerator<TAuthRequirement>;
1105
+ };
1106
+ /** Decide whether a single requirement is already satisfied. */
1107
+ type CheckAuthenticated<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = (requirement: TAuthRequirement, context: RequirementBehaviourContext<TAuthRequirement, TPlanContext>) => AuthenticatedCheck;
1108
+ /** Decide what to do when a selected requirement is unauthenticated. */
1109
+ type OnUnauthenticated<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = (requirement: TAuthRequirement, context: RequirementBehaviourContext<TAuthRequirement, TPlanContext>) => UnauthenticatedAction;
1110
+ /**
1111
+ * Reduce the candidate set to the single requirement to act on next.
1112
+ *
1113
+ * The default strategy picks the first unauthenticated candidate yielded by the
1114
+ * stream. Chooser-style strategies may collect the full stream when they need
1115
+ * a complete candidate set.
1116
+ */
1117
+ type SelectCandidate<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> = (context: RequirementCandidateSelectionContext<TAuthRequirement, TPlanContext>) => TAuthRequirement | undefined | Promise<TAuthRequirement | undefined>;
1118
+ /** The full behaviour contract resolved by a planner host. */
1119
+ interface RequirementBehaviour<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> {
1120
+ checkAuthenticated: CheckAuthenticated<TAuthRequirement, TPlanContext>;
1121
+ onUnauthenticated: OnUnauthenticated<TAuthRequirement, TPlanContext>;
1122
+ selectCandidate: SelectCandidate<TAuthRequirement, TPlanContext>;
1123
+ }
1124
+ interface RouteStateSnapshotTrait {
1125
+ readonly url: string;
1126
+ }
1127
+ interface RouteBehaviourContextExtra {
1128
+ readonly routeState: RouteStateSnapshotTrait;
1129
+ }
1130
+ declare function isRouteStateSnapshotTrait(value: unknown): value is RouteStateSnapshotTrait;
1131
+ declare function isRouteBehaviourContextExtra(value: unknown): value is RouteBehaviourContextExtra;
1132
+ type RequirementBehaviourWithRouteContext<TAuthRequirement extends AuthRequirement = AuthRequirement> = RequirementBehaviour<TAuthRequirement, RouteBehaviourContextExtra>;
1133
+ /** Outcome of a pipeline step or run. */
1134
+ declare const PipelineOutcome: {
1135
+ /** No candidates remain — the plan is satisfied. */readonly Settled: "settled"; /** A candidate was resolved as fulfilled; more may remain. */
1136
+ readonly Resolved: "resolved"; /** A candidate's handler blocked progress. */
1137
+ readonly Blocked: "blocked"; /** A candidate's handler requested a redirect. */
1138
+ readonly Redirect: "redirect";
1139
+ };
1140
+ type PipelineOutcome = (typeof PipelineOutcome)[keyof typeof PipelineOutcome];
1141
+ /** Result of a single {@link BaseRequirementPlanner.runStep}. */
1142
+ type PipelineStepResult<TAuthRequirement extends AuthRequirement = AuthRequirement> = {
1143
+ outcome: typeof PipelineOutcome.Settled;
1144
+ } | {
1145
+ outcome: typeof PipelineOutcome.Resolved;
1146
+ requirement: TAuthRequirement;
1147
+ } | {
1148
+ outcome: typeof PipelineOutcome.Blocked;
1149
+ requirement: TAuthRequirement;
1150
+ } | {
1151
+ outcome: typeof PipelineOutcome.Redirect;
1152
+ requirement: TAuthRequirement;
1153
+ location: string;
1154
+ };
1155
+ /** Result of {@link BaseRequirementPlanner.runUntilSettled}. */
1156
+ type PipelineRunResult<TAuthRequirement extends AuthRequirement = AuthRequirement> = {
1157
+ outcome: typeof PipelineOutcome.Settled;
1158
+ resolutions: readonly RequirementResolution[];
1159
+ } | {
1160
+ outcome: typeof PipelineOutcome.Blocked;
1161
+ requirement: TAuthRequirement;
1162
+ } | {
1163
+ outcome: typeof PipelineOutcome.Redirect;
1164
+ requirement: TAuthRequirement;
1165
+ location: string;
1166
+ };
1167
+ /**
1168
+ * How a route segment's requirements compose with the inherited parent chain.
1169
+ *
1170
+ * - `inherit` — keep the parent requirements unchanged (segment adds nothing)
1171
+ * - `merge` — inherit parent requirements, then append/override with the
1172
+ * segment's own (same-id entries replace the parent's)
1173
+ * - `replace` — discard the parent chain, use only the segment's requirements
1174
+ */
1175
+ declare const RequirementsComposition: {
1176
+ readonly Inherit: "inherit";
1177
+ readonly Merge: "merge";
1178
+ readonly Replace: "replace";
1179
+ };
1180
+ type RequirementsComposition = (typeof RequirementsComposition)[keyof typeof RequirementsComposition];
1181
+ /** A single node in a matched route chain. */
1182
+ interface RouteTreeSegment<TAuthRequirement extends AuthRequirement = AuthRequirement> {
1183
+ /** Route segment identifier (e.g. route name or path pattern). */
1184
+ routeId: string;
1185
+ /** Auth requirements declared on this route segment. */
1186
+ requirements: readonly TAuthRequirement[];
1187
+ /** Composition strategy against the inherited chain. Defaults to `merge`. */
1188
+ composition?: RequirementsComposition;
1189
+ }
1190
+ /** A requirements declaration annotated with its composition strategy. */
1191
+ interface RouteRequirementsDeclaration<TAuthRequirement extends AuthRequirement = AuthRequirement> {
1192
+ composition: RequirementsComposition;
1193
+ requirements: readonly TAuthRequirement[];
1194
+ }
1195
+ /**
1196
+ * Apply a route requirements declaration onto an effective requirement map.
1197
+ *
1198
+ * Reuse `effective` across a route chain so merge/replace fold in O(total
1199
+ * requirements) without rebuilding parent state each segment. When omitted, a
1200
+ * fresh map is created for one-shot composition.
1201
+ */
1202
+ declare function resolveEffectiveRequirements<TAuthRequirement extends AuthRequirement = AuthRequirement>(child: RouteRequirementsDeclaration<TAuthRequirement>, effective?: Map<string, TAuthRequirement>): Map<string, TAuthRequirement>;
1203
+ //#endregion
1204
+ //#region src/auth-coordination/planner-host.d.ts
1205
+ declare const REQUIREMENT_PLANNER_HOST: SecuritydeptInjectionToken<RequirementPlannerHost<unknown>>;
1206
+ type RequirementPlannerHostBehaviour<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>> = TBehaviour | (() => TBehaviour);
1207
+ interface ProvideRequirementPlannerHostOptions<TBehaviour = Partial<RequirementBehaviour>> {
1208
+ readonly parent?: RequirementPlannerHost<TBehaviour>;
1209
+ readonly environment?: FoundationEnvironment;
1210
+ }
1211
+ interface InjectRequirementPlannerHostOptions {
1212
+ readonly injector: SecuritydeptInjectorTrait;
1213
+ }
1214
+ /**
1215
+ * Default candidate selector: first unauthenticated candidate as soon as it is
1216
+ * discovered.
1217
+ *
1218
+ * If every requirement is already fulfilled the stream completes and the
1219
+ * selector returns `undefined`.
1220
+ */
1221
+ declare function defaultSelectCandidate<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}>(): SelectCandidate<TAuthRequirement, TPlanContext>;
1222
+ /** Options for {@link RequirementPlannerHost.fromBehaviour}. */
1223
+ interface RequirementPlannerHostOptions<TRequirementBehaviour = Partial<RequirementBehaviour>> {
1224
+ /** Parent host to inherit unspecified behaviour from. */
1225
+ parent?: RequirementPlannerHost<TRequirementBehaviour>;
1226
+ environment?: FoundationEnvironment;
1227
+ }
1228
+ /**
1229
+ * A coordination-scope host that resolves behaviour through a parent chain.
1230
+ *
1231
+ * Construct via {@link RequirementPlannerHost.fromBehaviour}. Each behaviour
1232
+ * field is optional at host construction time; missing required behaviour is
1233
+ * resolved from `parent` and fails fast during planner build if no host in the
1234
+ * chain provides it.
1235
+ *
1236
+ * @example
1237
+ * ```ts
1238
+ * const root = RequirementPlannerHost.fromBehaviour({
1239
+ * checkAuthenticated: (req) => isAuthenticated(req),
1240
+ * onUnauthenticated: (req) => `/login/${req.id}`,
1241
+ * });
1242
+ *
1243
+ * // Feature scope overrides only the chooser, inheriting the rest.
1244
+ * const feature = RequirementPlannerHost.fromBehaviour(
1245
+ * { selectCandidate: async (ctx) => showChooser(ctx.candidateList) },
1246
+ * { parent: root },
1247
+ * );
1248
+ * ```
1249
+ */
1250
+ declare class RequirementPlannerHost<TBehaviour = Partial<RequirementBehaviour>> {
1251
+ readonly environment: FoundationEnvironment | undefined;
1252
+ readonly parent: RequirementPlannerHost<TBehaviour> | undefined;
1253
+ /** The parent host, or undefined at the root. */
1254
+ private readonly _behaviour;
1255
+ protected constructor(behaviour: TBehaviour, environment: FoundationEnvironment | undefined, parent: RequirementPlannerHost<TBehaviour> | undefined);
1256
+ /** Create a host scope from a partial behaviour and optional parent. */
1257
+ static fromBehaviour<TBehaviour = Partial<RequirementBehaviour>>(behaviour: TBehaviour, options?: RequirementPlannerHostOptions<TBehaviour>): RequirementPlannerHost<TBehaviour>;
1258
+ resolveBehaviourOptionFor<K extends keyof TBehaviour>(key: K): Promise<TBehaviour[K] | undefined>;
1259
+ resolveBehaviourFor<K extends keyof TBehaviour>(key: K, defaultValue: () => NonNullable<TBehaviour[K]> | Promise<NonNullable<TBehaviour[K]>>): Promise<NonNullable<TBehaviour[K]>>;
1260
+ resolveEnvironmentOption(): Promise<FoundationEnvironment | undefined>;
1261
+ resolveEnvironment(defaultValue: () => FoundationEnvironment | Promise<FoundationEnvironment>): Promise<FoundationEnvironment>;
1262
+ }
1263
+ declare function provideRequirementPlannerHost<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>>(behaviour: RequirementPlannerHostBehaviour<TAuthRequirement, TPlanContext, TBehaviour>, options?: ProvideRequirementPlannerHostOptions<TBehaviour>): SecuritydeptProvider<RequirementPlannerHost<TBehaviour>>;
1264
+ declare function injectRequirementPlannerHost<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>>(options: InjectRequirementPlannerHostOptions): RequirementPlannerHost<TBehaviour> | null;
1265
+ //#endregion
1266
+ //#region src/auth-coordination/planner/base-planner.d.ts
1267
+ /**
1268
+ * Mutable pipeline state for one run: bound behaviour plus requirement list
1269
+ * and evolving resolutions.
1270
+ */
1271
+ interface RequirementPlan<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}> extends Readonly<RequirementBehaviour<TAuthRequirement, TPlanContext>> {
1272
+ readonly planContext: TPlanContext;
1273
+ readonly environment: FoundationEnvironment;
1274
+ readonly requirements: readonly TAuthRequirement[];
1275
+ resolutionList: RequirementResolution[];
1276
+ }
1277
+ /**
1278
+ * Abstract base for all requirement planners.
1279
+ *
1280
+ * Subclasses supply requirements via {@link buildRequirementList}. Pipeline
1281
+ * state lives on {@link RequirementPlan}, produced by {@link buildPlan}.
1282
+ */
1283
+ declare abstract class BaseRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>> {
1284
+ protected readonly host: RequirementPlannerHost<TBehaviour>;
1285
+ protected initialResolutions: readonly RequirementResolution[];
1286
+ abstract get planContext(): TPlanContext;
1287
+ protected constructor(host: RequirementPlannerHost<TBehaviour>, initialResolutions?: readonly RequirementResolution[]);
1288
+ /**
1289
+ * Pipeline step 0: resolve host behaviour and materialize requirements into
1290
+ * a {@link RequirementPlan}.
1291
+ *
1292
+ * Behaviour and the requirement list stay fixed on the returned plan until
1293
+ * the next `buildPlan()` call. Resolve host parent chains (and any
1294
+ * injection-context capture) here — not between async steps.
1295
+ */
1296
+ buildPlan(): Promise<RequirementPlan<TAuthRequirement, TPlanContext>>;
1297
+ /**
1298
+ * Return the effective requirement map for this planner.
1299
+ *
1300
+ * Keys are requirement ids; {@link Map} insertion order defines evaluation
1301
+ * order. Subclasses own deduplication policy when folding multiple sources.
1302
+ */
1303
+ protected abstract buildRequirementList(): Map<string, TAuthRequirement> | Promise<Map<string, TAuthRequirement>>;
1304
+ /**
1305
+ * Materialize the effective requirement list (also invoked by {@link buildPlan}).
1306
+ */
1307
+ resolveRequirementList(): Promise<readonly TAuthRequirement[]>;
1308
+ /**
1309
+ * Pipeline step 1 — one loop iteration: select a candidate, run
1310
+ * `onUnauthenticated`, then reduce `plan` state.
1311
+ */
1312
+ runStep(plan: RequirementPlan<TAuthRequirement, TPlanContext>): Promise<PipelineStepResult<TAuthRequirement>>;
1313
+ protected reduceFromAction(plan: RequirementPlan<TAuthRequirement, TPlanContext>, candidate: TAuthRequirement, action: Exclude<UnauthenticatedAction, Promise<unknown>>): PipelineStepResult<TAuthRequirement>;
1314
+ /**
1315
+ * Run the full pipeline: {@link buildPlan}, step 1, then loop step 2 until
1316
+ * settled or a terminal outcome (`blocked`, `redirect`, or a never-settling
1317
+ * action).
1318
+ */
1319
+ runUntilSettled(): Promise<PipelineRunResult<TAuthRequirement>>;
1320
+ runUntilSettledWithPlan(plan: RequirementPlan<TAuthRequirement, TPlanContext>): Promise<PipelineRunResult<TAuthRequirement>>;
1321
+ private createCandidateStream;
1322
+ private recordFulfilled;
1323
+ }
1324
+ //#endregion
1325
+ //#region src/auth-coordination/planner/merge-planner.d.ts
1326
+ /**
1327
+ * A planner whose effective requirements are the ordered union of its source
1328
+ * planners. Overlapping ids follow Map semantics (later source wins).
1329
+ *
1330
+ * @example
1331
+ * ```ts
1332
+ * const planner = MergeRequirementPlanner.fromPlanners(host, [
1333
+ * sessionPlanner,
1334
+ * oidcPlanner,
1335
+ * ]);
1336
+ * ```
1337
+ */
1338
+ declare class MergeRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>> extends BaseRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour> {
1339
+ private readonly sources;
1340
+ get planContext(): TPlanContext;
1341
+ protected constructor(host: RequirementPlannerHost<TBehaviour>, sources: readonly BaseRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour>[]);
1342
+ /** Create a merge planner from an ordered list of source planners. */
1343
+ static fromPlanners<TAuthRequirement extends AuthRequirement = AuthRequirement, TPlanContext = {}, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>> = Partial<RequirementBehaviour<TAuthRequirement, TPlanContext>>>(host: RequirementPlannerHost<TBehaviour>, planners: readonly BaseRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour>[]): MergeRequirementPlanner<TAuthRequirement, TPlanContext, TBehaviour>;
1344
+ protected buildRequirementList(): Promise<Map<string, TAuthRequirement>>;
1345
+ }
1346
+ //#endregion
1347
+ //#region src/auth-coordination/planner/route-composition-planner.d.ts
1348
+ /**
1349
+ * A planner driven by a matched route chain with composition semantics.
1350
+ *
1351
+ * Construct via {@link fromRouteSegments} for a matched route chain, or
1352
+ * {@link fromRouteTransition} for a transition that preserves shared-prefix
1353
+ * resolutions from the previous planner instance.
1354
+ */
1355
+ declare class RouteCompositionRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>> = Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>>> extends BaseRequirementPlanner<TAuthRequirement, RouteBehaviourContextExtra, TBehaviour> {
1356
+ private readonly _segments;
1357
+ private readonly _effective;
1358
+ private readonly _planContext;
1359
+ protected constructor(host: RequirementPlannerHost<TBehaviour>, segments: readonly RouteTreeSegment<TAuthRequirement>[], routeState: RouteStateSnapshotTrait, preservedResolutions?: readonly RequirementResolution[]);
1360
+ /** Build a planner from a matched route chain. */
1361
+ static fromRouteSegments<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>> = Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>>>(host: RequirementPlannerHost<TBehaviour>, segments: readonly RouteTreeSegment<TAuthRequirement>[], routeState: RouteStateSnapshotTrait): RouteCompositionRequirementPlanner<TAuthRequirement, TBehaviour>;
1362
+ /**
1363
+ * Build a planner for a route transition, preserving resolutions for the
1364
+ * shared requirement prefix carried over from `previousPlan`.
1365
+ */
1366
+ static fromRouteTransition<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>> = Partial<RequirementBehaviourWithRouteContext<TAuthRequirement>>>(host: RequirementPlannerHost<TBehaviour>, currentSegments: readonly RouteTreeSegment<TAuthRequirement>[], routeState: RouteStateSnapshotTrait, previousPlanner: RouteCompositionRequirementPlanner<TAuthRequirement, TBehaviour>, previousPlan: RequirementPlan<TAuthRequirement, RouteBehaviourContextExtra>): RouteCompositionRequirementPlanner<TAuthRequirement, TBehaviour>;
1367
+ get planContext(): RouteBehaviourContextExtra;
1368
+ /** The matched route chain backing this planner. */
1369
+ get segments(): readonly RouteTreeSegment<TAuthRequirement>[];
1370
+ /** The folded effective requirement list (composition applied). */
1371
+ get effectiveRequirements(): readonly TAuthRequirement[];
1372
+ protected buildRequirementList(): Map<string, TAuthRequirement>;
1373
+ }
1374
+ //#endregion
1375
+ //#region src/auth-coordination/planner/static-planner.d.ts
1376
+ /**
1377
+ * A planner whose effective requirement list is a fixed array supplied at
1378
+ * construction time.
1379
+ *
1380
+ * @example
1381
+ * ```ts
1382
+ * const planner = StaticRequirementPlanner.fromRequirements(host, [
1383
+ * StaticAttrsAuthRequirement.create({ id: "session" }),
1384
+ * ] as Readonly<AuthRequirement[]>);
1385
+ * const plan = await planner.buildPlan();
1386
+ * const step = await planner.runStep(plan);
1387
+ * // or: const result = await planner.runUntilSettled();
1388
+ * ```
1389
+ */
1390
+ declare class StaticRequirementPlanner<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement>> = Partial<RequirementBehaviour<TAuthRequirement>>> extends BaseRequirementPlanner<TAuthRequirement, {}, TBehaviour> {
1391
+ private readonly staticRequirements;
1392
+ get planContext(): {};
1393
+ protected constructor(host: RequirementPlannerHost<TBehaviour>, requirements: readonly TAuthRequirement[]);
1394
+ /** Create a static planner from an ordered requirement list. */
1395
+ static fromRequirements<TAuthRequirement extends AuthRequirement = AuthRequirement, TBehaviour extends Partial<RequirementBehaviour<TAuthRequirement>> = Partial<RequirementBehaviour<TAuthRequirement>>>(host: RequirementPlannerHost<TBehaviour>, requirements: readonly TAuthRequirement[]): StaticRequirementPlanner<TAuthRequirement, TBehaviour>;
1396
+ protected buildRequirementList(): Map<string, TAuthRequirement>;
1397
+ }
1398
+ //#endregion
1399
+ //#region src/identity/contracts.d.ts
1400
+ interface IdentityPrincipal {
1401
+ subject: string;
1402
+ displayName: string;
1403
+ picture?: string;
1404
+ issuer?: string;
1405
+ claims?: Record<string, unknown>;
1406
+ }
1407
+ interface ProjectIdentityPrincipalOptions {
1408
+ principal?: IdentityPrincipal | null;
1409
+ fallbackDisplayName?: string;
1410
+ fallbackSubject?: string;
1411
+ fallbackIssuer?: string;
1412
+ fallbackClaims?: Record<string, unknown>;
1413
+ }
1414
+ //#endregion
1415
+ //#region src/identity/parsers.d.ts
1416
+ declare function parseIdentityPrincipal(input: unknown): IdentityPrincipal;
1417
+ declare function parseIdentityPrincipalWire(input: unknown): IdentityPrincipal;
1418
+ declare function projectIdentityPrincipal(options: ProjectIdentityPrincipalOptions): IdentityPrincipal;
1419
+ //#endregion
1420
+ //#region src/identity/schemas.d.ts
1421
+ declare const IdentityPrincipalSchema: _$arktype_internal_variants_object_ts0.ObjectType<(In: {
1422
+ subject: string;
1423
+ displayName?: string | null | undefined;
1424
+ picture?: string | null | undefined;
1425
+ issuer?: string | null | undefined;
1426
+ claims?: object | null | undefined;
1427
+ }) => _$arktype.Out<IdentityPrincipal>, {}>;
1428
+ declare const IdentityPrincipalWireSchema: _$arktype_internal_variants_object_ts0.ObjectType<(In: {
1429
+ subject: string;
1430
+ display_name?: string | null | undefined;
1431
+ picture?: string | null | undefined;
1432
+ issuer?: string | null | undefined;
1433
+ claims?: object | null | undefined;
1434
+ }) => _$arktype.Out<IdentityPrincipal>, {}>;
1435
+ //#endregion
1436
+ //#region src/protocol/jwt/types.d.ts
1437
+ type JwtAudienceClaim = string | readonly string[];
1438
+ interface JwtClaimsSet extends Record<string, unknown> {
1439
+ iss?: string;
1440
+ sub?: string;
1441
+ aud?: JwtAudienceClaim;
1442
+ exp?: number;
1443
+ nbf?: number;
1444
+ iat?: number;
1445
+ jti?: string;
1446
+ }
1447
+ interface DecodeJwtPayloadOptions {
1448
+ /**
1449
+ * Optional label used in error messages. It does not affect parsing.
1450
+ */
1451
+ label?: string;
1452
+ }
1453
+ //#endregion
1454
+ //#region src/protocol/jwt/decode.d.ts
1455
+ declare function decodeJwtPayload(jwt: string, options?: DecodeJwtPayloadOptions): JwtClaimsSet;
1456
+ //#endregion
1457
+ //#region src/protocol/jwt/error.d.ts
1458
+ declare const JwtDecodeErrorCode: {
1459
+ readonly InvalidFormat: "protocol.jwt.invalid_format";
1460
+ readonly InvalidPayload: "protocol.jwt.invalid_payload";
1461
+ readonly InvalidClaim: "protocol.jwt.invalid_claim";
1462
+ };
1463
+ type JwtDecodeErrorCode = (typeof JwtDecodeErrorCode)[keyof typeof JwtDecodeErrorCode];
1464
+ declare class JwtDecodeError extends ClientError {
1465
+ readonly code: JwtDecodeErrorCode;
1466
+ constructor(options: {
1467
+ code: JwtDecodeErrorCode;
1468
+ message: string;
1469
+ cause?: unknown;
1470
+ });
1471
+ }
1472
+ //#endregion
1473
+ //#region src/span/span.d.ts
1474
+ declare function createRootSpan(options?: SpanCreateOptions & WithTraitInputValidator<TraitInputValidator>): SpanTrait;
1475
+ //#endregion
1476
+ //#region src/std/cancellation/abort-signal.d.ts
1477
+ /**
1478
+ * Bridge a web `AbortSignal` back into the foundation cancellation contract.
1479
+ *
1480
+ * This is the canonical consumer-side path for browser hosts that receive an
1481
+ * `AbortSignal` from framework/runtime APIs (for example React Query queryFns)
1482
+ * but need to call SDK surfaces that accept `CancellationTokenTrait`.
1483
+ */
1484
+ declare function abortSignalToCancellationToken(signal: AbortSignal): CancellationTokenTrait;
1485
+ declare function abortSignalToCancellationToken(signal?: undefined): undefined;
1486
+ declare function abortSignalToCancellationToken(signal?: AbortSignal): CancellationTokenTrait | undefined;
1487
+ interface AbortSignalBridge extends DisposableTrait {
1488
+ signal?: AbortSignal;
1489
+ }
1490
+ /**
1491
+ * Bridge foundation cancellation to `AbortSignal` without exposing
1492
+ * `AbortSignal` in core contracts.
1493
+ */
1494
+ declare function cancellationTokenToAbortSignal(token: CancellationTokenTrait): AbortSignalBridge;
1495
+ declare function cancellationTokenToAbortSignal(token?: undefined): undefined;
1496
+ declare function cancellationTokenToAbortSignal(token?: CancellationTokenTrait): AbortSignalBridge | undefined;
1497
+ declare function normalizeAbortError(token: CancellationTokenTrait | undefined, error: unknown): unknown;
1498
+ //#endregion
1499
+ //#region src/storage/ephemeral-flow-store.d.ts
1500
+ interface CreateEphemeralFlowStoreOptions<T> {
1501
+ store: StorageTrait;
1502
+ key: string;
1503
+ codec?: Codec<T>;
1504
+ }
1505
+ interface CreateKeyedEphemeralFlowStoreOptions<T> {
1506
+ store: StorageTrait;
1507
+ keyPrefix: string;
1508
+ codec?: Codec<T>;
1509
+ }
1510
+ /**
1511
+ * Create a typed ephemeral flow-state store backed by a low-level `StorageTrait`.
1512
+ *
1513
+ * Intended for short-lived browser/session coordination state such as pending
1514
+ * redirects or callback fragments.
1515
+ */
1516
+ declare function createEphemeralFlowStore<T>(options: CreateEphemeralFlowStoreOptions<T>): EphemeralFlowStore<T>;
1517
+ /**
1518
+ * Create a typed keyed ephemeral flow-state store backed by a low-level
1519
+ * `StorageTrait`.
1520
+ *
1521
+ * Intended for short-lived browser/session coordination state where multiple
1522
+ * pending records must coexist and be consumed independently.
1523
+ */
1524
+ declare function createKeyedEphemeralFlowStore<T>(options: CreateKeyedEphemeralFlowStoreOptions<T>): KeyedEphemeralFlowStore<T>;
1525
+ //#endregion
1526
+ //#region src/storage/json-codec.d.ts
1527
+ /** Default JSON codec. */
1528
+ declare function createJsonCodec<T>(): Codec<T>;
1529
+ //#endregion
1530
+ //#region src/storage/memory-store.d.ts
1531
+ /** In-memory `SyncStorageTrait` — useful for realm state, tests, and SSR. */
1532
+ declare function createInMemoryRecordStore(): SyncStorageTrait;
1533
+ //#endregion
1534
+ //#region src/struct/async-lock.d.ts
1535
+ declare const OnceAsyncLockState: {
1536
+ readonly Init: "init";
1537
+ readonly Running: "running";
1538
+ readonly Success: "success";
1539
+ readonly Error: "error";
1540
+ };
1541
+ type OnceAsyncLockState = (typeof OnceAsyncLockState)[keyof typeof OnceAsyncLockState];
1542
+ type OnceAsyncLockInit = {
1543
+ readonly state: typeof OnceAsyncLockState.Init;
1544
+ readonly promise?: never;
1545
+ };
1546
+ type OnceAsyncLockRunning = {
1547
+ readonly state: typeof OnceAsyncLockState.Running;
1548
+ readonly promise: Promise<unknown>;
1549
+ };
1550
+ type OnceAsyncLockSuccess<T> = {
1551
+ readonly state: typeof OnceAsyncLockState.Success;
1552
+ readonly data: T;
1553
+ };
1554
+ type OnceAsyncLockError<E> = {
1555
+ readonly state: typeof OnceAsyncLockState.Error;
1556
+ readonly error: E;
1557
+ };
1558
+ type OnceAsyncLock<T, E> = OnceAsyncLockInit | OnceAsyncLockRunning | OnceAsyncLockSuccess<T> | OnceAsyncLockError<E>;
1559
+ type OnceAsyncLockCallable<F extends (...args: any[]) => PromiseLike<any>, E = unknown> = F & OnceAsyncLock<Awaited<ReturnType<F>>, E> & ReadableSignalTrait<OnceAsyncLock<Awaited<ReturnType<F>>, E>>;
1560
+ declare function createOnceAsyncLockCallable<F extends (...args: any[]) => PromiseLike<any>, E = unknown>(fn: F): OnceAsyncLockCallable<F, E>;
1561
+ //#endregion
1562
+ //#region src/tracing/operation-runner.d.ts
1563
+ interface RunOperationEnvironment {
1564
+ environment: {
1565
+ time: TimestampProviderTrait;
1566
+ tracing: TracingTrait;
1567
+ };
1568
+ }
1569
+ interface RunOperationOptionsBase extends RunOperationEnvironment {
1570
+ span: SpanTrait;
1571
+ name: string;
1572
+ target: string;
1573
+ fields?: Record<string, unknown>;
1574
+ idFactory?: () => string;
1575
+ normalizeError?: (error: unknown) => unknown;
1576
+ }
1577
+ interface RunOperationOptions<T> extends RunOperationOptionsBase {
1578
+ execute: (span: OperationSpanTrait) => T;
1579
+ }
1580
+ declare class OperationSpan implements OperationSpanTrait {
1581
+ private readonly _span;
1582
+ private readonly _environment;
1583
+ private readonly _name;
1584
+ private readonly _target;
1585
+ private constructor();
1586
+ static start(options: RunOperationOptionsBase): OperationSpan;
1587
+ get id(): string;
1588
+ get parent(): SpanTrait | undefined;
1589
+ get attributes(): Readonly<Record<string, unknown>>;
1590
+ fork(options: MutableSpanCreateOptions): MutableSpanTrait;
1591
+ fork(options?: SpanCreateOptions): SpanTrait;
1592
+ setAttributes(attributes: Record<string, unknown>): void;
1593
+ addEvent(name: string, fields?: Record<string, unknown>): void;
1594
+ recordError(error: unknown, fields?: Record<string, unknown>): void;
1595
+ recordStarted(): void;
1596
+ recordEnded(outcome: "succeeded" | "failed"): void;
1597
+ private _record;
1598
+ }
1599
+ declare function runOperation<T>(options: RunOperationOptions<T>): T;
1600
+ declare function runOperation<T>(options: RunOperationOptions<Promise<T>>): Promise<T>;
1601
+ //#endregion
1602
+ //#region src/tracing/operation-method.d.ts
1603
+ interface InstrumentMethodThisContext<TArgs extends unknown[]> {
1604
+ args: TArgs;
1605
+ methodName: string;
1606
+ }
1607
+ interface InstrumentMethodResolvedOptions extends Omit<RunOperationOptionsBase, "name"> {
1608
+ name?: string;
1609
+ }
1610
+ type InstrumentMethodThisResolver<TThis extends object, TArgs extends unknown[]> = (this: TThis, context: InstrumentMethodThisContext<TArgs>) => InstrumentMethodResolvedOptions;
1611
+ interface DefineInstrumentMethodDecoratorContext<TFactoryArgs extends unknown[]> {
1612
+ factoryArgs: TFactoryArgs;
1613
+ methodName: string;
1614
+ }
1615
+ type DefineInstrumentMethodDecoratorFactory<TFactoryArgs extends unknown[], TBaseThis extends object = object> = <TThis extends TBaseThis, TArgs extends unknown[]>(context: DefineInstrumentMethodDecoratorContext<TFactoryArgs>) => InstrumentMethodThisResolver<TThis, TArgs>;
1616
+ declare function defineInstrumentMethodDecorator<TFactoryArgs extends unknown[], TBaseThis extends object = object>(factory: DefineInstrumentMethodDecoratorFactory<TFactoryArgs, TBaseThis>): (...factoryArgs: TFactoryArgs) => <TThis extends TBaseThis, TArgs extends unknown[], TReturn>(target: (this: TThis, ...args: TArgs) => TReturn, context: ClassMethodDecoratorContext<TThis, (this: TThis, ...args: TArgs) => TReturn>) => (this: TThis, ...args: TArgs) => TReturn;
1617
+ //#endregion
1618
+ //#region src/tracing/subscriber/console.d.ts
1619
+ declare function createConsoleTracingSubscriber(): TracingSubscriberTrait;
1620
+ //#endregion
1621
+ //#region src/tracing/subscriber/timeline-store.d.ts
1622
+ interface TraceTimelineEntry extends TracingEvent {
1623
+ id: number;
1624
+ recordedAtIso: string;
1625
+ }
1626
+ interface TraceTimelineStore extends TracingSubscriberTrait {
1627
+ get(): readonly TraceTimelineEntry[];
1628
+ subscribe(listener: () => void): () => void;
1629
+ clear(): void;
1630
+ }
1631
+ /**
1632
+ * Create a subscriber-side trace timeline store.
1633
+ *
1634
+ * This store consumes tracing events through `record(event)` and keeps a
1635
+ * bounded local timeline for tests and UI surfaces. It is not the tracing
1636
+ * runtime itself.
1637
+ */
1638
+ declare function createTraceTimelineStore(limit?: number): TraceTimelineStore;
1639
+ //#endregion
1640
+ //#region src/transport/url.d.ts
1641
+ /**
1642
+ * Returns `true` for loopback HTTP URLs that browsers and local tooling often
1643
+ * permit during development flows.
1644
+ */
1645
+ declare function isLoopbackHttpUrl(url: URL): boolean;
1646
+ //#endregion
1647
+ export { REQUIREMENT_PLANNER_HOST as $, isCompatFragmentBlock as $n, CreateJsonRpcClientOptions as $r, REALM_STORAGE_TRAIT_TOKEN as $t, cancellationTokenToAbortSignal as A, decodeBase64ToUint8Array as Ai, validateTraitInput as An, PopupClientWindowHandle as Ar, UnauthenticatedAction as At, IdentityPrincipalWireSchema as B, RouterNavigationRequest as Bn, flattenResourceSnapshot as Br, TracingCreateOptions as Bt, OnceAsyncLockSuccess as C, readErrorPresentationDescriptor as Ci, ValidateTraitInputOptions as Cn, PopupAttachSuccess as Cr, RouteBehaviourContextExtra as Ct, createEphemeralFlowStore as D, PageLifecycleTrait as Di, WithTraitInputValidator as Dn, CreatePopupServerSessionOptions as Dr, SelectCandidate as Dt, createJsonCodec as E, PAGE_LIFECYCLE_TRAIT_TOKEN as Ei, ValidationSuccess as En, CreatePopupClientSessionOptions as Er, RouteTreeSegment as Et, decodeJwtPayload as F, SpanCreateOptions as Fn, PopupWindowHandleTrait as Fr, createFoundationEnvironment as Ft, ProjectIdentityPrincipalOptions as G, AppendOrReplaceCompatFragmentResult as Gn, createResource as Gr, TracingEvent as Gt, parseIdentityPrincipalWire as H, TakeCompatFragmentFromRouterOptions as Hn, whenResourceSnapshotValue as Hr, TracingSubscriberTrait as Ht, DecodeJwtPayloadOptions as I, SpanTrait as In, createSignal as Ir, ENVIRONMENT_TOKEN as It, MergeRequirementPlanner as J, SECURITYDEPT_COMPAT_FRAGMENT_VERSION as Jn, ResourceValueUnavailableErrorOptions as Jr, Codec as Jt, StaticRequirementPlanner as K, CompatFragment as Kn, ResourceError as Kr, TracingLevel as Kt, JwtAudienceClaim as L, ROUTER_TRAIT_TOKEN as Ln, readonlySignal as Lr, EnvironmentValidators as Lt, createRootSpan as M, validateWithSchemaSync as Mn, PopupMessageChannelTrait as Mr, isRouteStateSnapshotTrait as Mt, JwtDecodeError as N, OperationSpanTrait as Nn, PopupServerWindowHandle as Nr, resolveEffectiveRequirements as Nt, createKeyedEphemeralFlowStore as O, promisesToRacedAsyncGenerator as Oi, formatValidationFailure as On, PopupErrorCode as Or, StaticAttrsAuthRequirement as Ot, JwtDecodeErrorCode as P, SPAN_TRAIT_TOKEN as Pn, PopupServerWindowHandleTrait as Pr, CreateFoundationEnvironmentOptions as Pt, ProvideRequirementPlannerHostOptions as Q, appendOrReplaceCompatFragment as Qn, createJsonRpcServerAndClient as Qr, PersistentAuthStore as Qt, JwtClaimsSet as R, RouterNavigationIntent as Rn, ResourceSnapshotUpdate as Rr, FoundationEnvironment as Rt, OnceAsyncLockState as S, abortSignalToEventStream as Si, TraitInputValidator as Sn, PopupAttachResult as Sr, ResolutionStatus as St, createInMemoryRecordStore as T, describeError as Ti, ValidationResult as Tn, PopupTrait as Tr, RouteStateSnapshotTrait as Tt, projectIdentityPrincipal as U, takeCompatFragmentFromRouter as Un, CreateResourceOptions as Ur, OperationTraceEventType as Ut, parseIdentityPrincipal as V, RouterTrait as Vn, reduceResourceSnapshot as Vr, createTracing as Vt, IdentityPrincipal as W, AppendOrReplaceCompatFragmentOptions as Wn, ResourceStreamContext as Wr, TRACING_TRAIT_TOKEN as Wt, RequirementPlan as X, TakeCompatFragmentResult as Xn, createJsonRpcClient as Xr, KeyedEphemeralFlowStore as Xt, BaseRequirementPlanner as Y, TakeCompatFragmentOptions as Yn, createComputed as Yr, EphemeralFlowStore as Yt, InjectRequirementPlannerHostOptions as Z, UpdateUriFragmentHash as Zn, createJsonRpcServer as Zr, PERSISTENT_STORAGE_TRAIT_TOKEN as Zt, OnceAsyncLock as _, createEmptyEventStream as _i, AuthorizationSignal as _n, UriRelativeStringSchema as _r, RequirementCandidateGenerator as _t, createConsoleTracingSubscriber as a, JsonRpcId as ai, StoredEnvelope as an, UriReferenceStringInput as ar, provideRequirementPlannerHost as at, OnceAsyncLockInit as b, createEventSubject as bi, TimeForStdCreateOptions as bn, PopupAttachFailure as br, RequirementResolution as bt, InstrumentMethodResolvedOptions as c, JsonRpcNotificationMessage as ci, FetchTransportRedirectKind as cn, UriRelativeString as cr, CheckAuthenticated as ct, defineInstrumentMethodDecorator as d, JsonRpcRequestOptions as di, HttpRequest as dn, SECURITYDEPT_ROUTE_METADATA_KEY as dr, PipelineRunResult as dt, CreateJsonRpcServerAndClientOptions as ei, RecoverableStateStore as en, parseCompatFragment as er, RequirementPlannerHost as et, OperationSpan as f, JsonRpcServerAndClientTrait as fi, HttpResponse as fn, SecuritydeptRouteMetadata as fr, PipelineStepResult as ft, runOperation as g, toEventStream as gi, AuthorizationInterceptedFetchPredicate as gn, UriReferenceStringSchema as gr, RequirementBehaviourWithRouteContext as gt, RunOperationOptionsBase as h, ToEventStreamInput as hi, TransportErrorCode as hn, BaseURIStringSchema as hr, RequirementBehaviourContext as ht, createTraceTimelineStore as i, JsonRpcErrorResponseMessage as ii, StorageTrait as in, UriReferenceString as ir, injectRequirementPlannerHost as it, normalizeAbortError as j, encodeUint8ArrayToBase64 as ji, validateWithSchema as jn, PopupClientWindowHandleTrait as jr, isRouteBehaviourContextExtra as jt, abortSignalToCancellationToken as k, Base64CompatErrorCode as ki, throwValidationClientError as kn, readPopupErrorPresentationDescriptor as kr, StaticAttrsAuthRequirementInput as kt, InstrumentMethodThisContext as l, JsonRpcRequestEvent as li, createBaseTransportForStdFetch as ln, UriSearchParamsInit as lr, OnUnauthenticated as lt, RunOperationOptions as m, JsonRpcSuccessResponseMessage as mi, TRANSPORT_TRAIT_TOKEN as mn, writeSecuritydeptRouteMetadata as mr, RequirementBehaviour as mt, TraceTimelineEntry as n, JsonRpcClientTrait as ni, StorageChangeEvent as nn, UriFragmentPart as nr, RequirementPlannerHostOptions as nt, DefineInstrumentMethodDecoratorContext as o, JsonRpcMessage as oi, SyncStorageTrait as on, UriReferenceStringLike as or, AuthRequirement as ot, RunOperationEnvironment as p, JsonRpcServerTrait as pi, HttpResponseJsonBody as pn, readSecuritydeptRouteMetadata as pr, PlanStatus as pt, RouteCompositionRequirementPlanner as q, CompatFragmentParameters as qn, ResourceErrorCode as qr, TracingTrait as qt, TraceTimelineStore as r, JsonRpcErrorPayload as ri, StorageChangeEventOrigin as rn, UriParseError as rr, defaultSelectCandidate as rt, DefineInstrumentMethodDecoratorFactory as s, JsonRpcNotificationEvent as si, BaseTransportForStdFetchCreateOptions as sn, UriRelativeParts as sr, AuthenticatedCheck as st, isLoopbackHttpUrl as t, CreateJsonRpcServerOptions as ti, SESSION_STORAGE_TRAIT_TOKEN as tn, takeCompatFragment as tr, RequirementPlannerHostBehaviour as tt, InstrumentMethodThisResolver as u, JsonRpcRequestMessage as ui, BaseTransportTrait as un, UriString as ur, PipelineOutcome as ut, OnceAsyncLockCallable as v, createEventReplaySubject as vi, CreateAuthorizationInterceptedFetchOptions as vn, UriStringSchema as vr, RequirementCandidateSelectionContext as vt, createOnceAsyncLockCallable as w, ErrorSummary as wi, ValidationFailure as wn, PopupOpenOptions as wr, RouteRequirementsDeclaration as wt, OnceAsyncLockRunning as x, createNeverEventStream as xi, createTimeForStd as xn, PopupAttachFailureReason as xr, RequirementsComposition as xt, OnceAsyncLockError as y, createEventStream as yi, createAuthorizationInterceptedFetch as yn, POPUP_TRAIT_TOKEN as yr, RequirementPlannerError as yt, IdentityPrincipalSchema as z, RouterNavigationMode as zn, ResourceSnapshotUpdateKind as zr, ServiceWorkerEnvironment as zt };
1648
+ //# sourceMappingURL=index-D5mW18cM.d.mts.map