@securitydept/client 0.3.0-beta.1 → 0.3.0-beta.11

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