@molecule/app-angular 3.7.1 → 3.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@ AUTO-GENERATED — DO NOT EDIT THIS FILE.
3
3
  Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
4
4
  Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
5
5
  To change this document, edit the module-level JSDoc in src/index.ts.
6
- Generated: 2026-11-16T14:06:29.917Z
6
+ Generated: 2026-11-18T16:19:43.667Z
7
7
  -->
8
8
 
9
9
  # @molecule/app-angular
@@ -142,55 +142,143 @@ interface AuthClient<
142
142
  T = UserProfile,
143
143
  TRegister extends RegisterExtraShape<TRegister> = Record<never, never>,
144
144
  > {
145
- /** Returns the current authentication state snapshot. */
145
+ /**
146
+ * Returns the current authentication state snapshot.
147
+ *
148
+ * READING the state starts the client's one session restore when nobody has called
149
+ * {@link initialize} yet — lazily and exactly once, sharing the promise an explicit
150
+ * `initialize()` returns. A hook (`useAuth()`), a subscriber, `isAuthenticated()` and
151
+ * `getUser()` are reads too, so a client whose entry file dropped the template's
152
+ * `authClient.initialize()` line still restores instead of reporting `'loading'`
153
+ * forever.
154
+ */
146
155
  getState(): AuthState<T>
147
156
 
148
- /** Returns whether the user is currently authenticated. */
157
+ /**
158
+ * Returns whether the user is currently authenticated.
159
+ */
149
160
  isAuthenticated(): boolean
150
161
 
151
- /** Gets the current user. */
162
+ /**
163
+ * Gets the current user.
164
+ */
152
165
  getUser(): T | null
153
166
 
154
- /** Optional ownership marker for the current session. */
167
+ /**
168
+ * Optional ownership marker for the current session. Compare values only within
169
+ * this client: replacing or ending a session changes it, including re-adopting
170
+ * the same token and user. Profile updates and same-session refreshes keep it.
171
+ * Consumers can use it to discard stale async work without treating editable
172
+ * user fields as an immutable account identifier. Providers without this
173
+ * capability require the consumer's own stable identity check.
174
+ */
155
175
  getSessionRevision?(): number
156
176
 
157
177
  /** Updates the cached user object (state + persistent storage) without hitting the network. */
158
178
  setUser(user: T | null): void
159
179
 
160
- /** Gets the current access token. */
180
+ /**
181
+ * Gets the current access token.
182
+ */
161
183
  getAccessToken(): string | null
162
184
 
163
- /** Stores the access token in the configured token storage adapter (in a browser, Web Storage; `'memory'` where no browser store exists). */
185
+ /**
186
+ * Stores the access token in the configured token storage adapter (in a
187
+ * browser, Web Storage; `'memory'` where no browser store exists). Use this
188
+ * to seed the token after an out-of-band exchange (e.g. the OAuth
189
+ * code→token redirect) instead of writing to `localStorage` directly,
190
+ * which would violate the storage contract and make a stored bearer token
191
+ * JS-readable (XSS-exfiltratable). Pass `null` to clear it.
192
+ *
193
+ * Passing `null` does not by itself sign a signed-in client out: use
194
+ * {@link logout} to end a session, or {@link setUser} with `null` for
195
+ * local-only sign-out. A non-null token on a client that is not signed in is
196
+ * the first or second half of the app's own sign-in pair: together with
197
+ * {@link setUser} it adopts the session (see there). Prefer {@link setSession}
198
+ * with the token and user, or {@link login} / {@link register} for a
199
+ * credential exchange.
200
+ */
164
201
  setAccessToken(token: string | null): void
165
202
 
166
- /** Adopts a session an out-of-band exchange already established: stores the access token (and the refresh token when given), caches the user, and sets the COMPLET… */
203
+ /**
204
+ * Adopts a session an out-of-band exchange already established: stores the
205
+ * access token (and the refresh token when given), caches the user, and
206
+ * sets the COMPLETE state — `initialized`, `authenticated`, `status:
207
+ * 'authenticated'`, no error — in one update, with one subscriber
208
+ * notification. Every hook reading the shared client sees the user as
209
+ * signed in immediately.
210
+ *
211
+ * This is the way to seed an OAuth/custom sign-in. The field-setter pair
212
+ * ({@link setAccessToken} then {@link setUser}, or the reverse) on a client
213
+ * that is not signed in adopts the session the same way.
214
+ */
167
215
  setSession(session: AuthSessionSeed<T>): void
168
216
 
169
- /** Gets the refresh token. */
217
+ /**
218
+ * Gets the refresh token.
219
+ */
170
220
  getRefreshToken(): string | null
171
221
 
172
- /** Logs in with credentials. */
222
+ /**
223
+ * Logs in with credentials.
224
+ */
173
225
  login(credentials: LoginCredentials): Promise<AuthResult<T>>
174
226
 
175
- /** Logs out the current user. */
227
+ /**
228
+ * Logs out the current user. The server request is best-effort: a missing
229
+ * logout route (404), any other HTTP failure, or a network error never makes
230
+ * this method reject. It always clears the access token, refresh token and
231
+ * cached user, stops automatic refresh, and publishes one settled
232
+ * `authenticated: false`, `status: 'unauthenticated'` transition. Every pending
233
+ * session operation loses ownership; a persistent marker prevents reload from
234
+ * restoring an older session, and late credentials are revoked best-effort.
235
+ *
236
+ * When the API has no logout route, set {@link AuthClientConfigOptions.logoutEndpoint}
237
+ * to `null` (or `''`) to skip the request. Local sign-out still happens.
238
+ */
176
239
  logout(): Promise<void>
177
240
 
178
- /** Registers a new user. */
241
+ /**
242
+ * Registers a new user. Accepts the base fields plus the app's own fields
243
+ * (`TRegister`) at the top level — see {@link RegisterData}.
244
+ */
179
245
  register(data: RegisterData<TRegister>): Promise<AuthResult<T>>
180
246
 
181
- /** Exchanges a stored refresh token, or re-reads `currentUserEndpoint` with the existing access token/session cookie when the API has no refresh credential. */
247
+ /**
248
+ * Exchanges a stored refresh token, or re-reads `currentUserEndpoint` with the
249
+ * existing access token/session cookie when the API has no refresh credential.
250
+ * That fallback maps, stores and publishes the server user without renewing
251
+ * the access token. Failures reject. A 401/403 ends the session, as does an
252
+ * additional {@link AuthClientConfigOptions.currentUserRejectionStatuses}
253
+ * code from the fallback. Transient failures retain it as unavailable. Use {@link updateProfile} for a profile
254
+ * save, or {@link setUser} with the canonical row from an app-owned mutation.
255
+ */
182
256
  refresh(): Promise<AuthResult<T>>
183
257
 
184
- /** Requests a password reset. */
258
+ /**
259
+ * Requests a password reset.
260
+ */
185
261
  requestPasswordReset(data: PasswordResetRequest): Promise<void>
186
262
 
187
- /** Confirms a password reset. */
263
+ /**
264
+ * Confirms a password reset.
265
+ */
188
266
  confirmPasswordReset(data: PasswordResetConfirm): Promise<void>
189
267
 
190
- /** Updates the current user's profile. */
268
+ /**
269
+ * Updates the current user's profile.
270
+ * Returns the saved profile: the answer applied onto the signed-in user field
271
+ * by field, with or without an `id` — a field it carries replaces the value
272
+ * (`null` clears it), one it omits or leaves `undefined` is kept, so a field
273
+ * cleared by omission must arrive as `null`. A non-object answer is returned
274
+ * as it came. An answer for a replaced or ended session leaves the current one
275
+ * untouched.
276
+ */
191
277
  updateProfile(data: Partial<T>): Promise<T>
192
278
 
193
- /** Changes the current user's password. */
279
+ /**
280
+ * Changes the current user's password.
281
+ */
194
282
  changePassword(oldPassword: string, newPassword: string): Promise<void>
195
283
 
196
284
  /** Initializes auth state (e.g., from stored tokens). */
@@ -202,24 +290,48 @@ interface AuthClient<
202
290
  /** Resolves when the session restore started by `initialize()` has settled — the point after which the client knows whether this visitor is signed in. */
203
291
  whenRestored?(): Promise<void>
204
292
 
205
- /** Subscribes to auth state changes. */
293
+ /**
294
+ * Subscribes to auth state changes.
295
+ */
206
296
  subscribe(callback: (state: AuthState<T>) => void): () => void
207
297
 
208
- /** Subscribes to auth state changes (alias for subscribe). */
298
+ /**
299
+ * Subscribes to auth state changes (alias for subscribe).
300
+ */
209
301
  onAuthChange(callback: (state: AuthState<T>) => void): () => void
210
302
 
211
- /** Gets the current access token (alias for getAccessToken). */
303
+ /**
304
+ * Gets the current access token (alias for getAccessToken).
305
+ */
212
306
  getToken?(): string | null
213
307
 
214
- /** Adds an auth event listener. */
308
+ /**
309
+ * Adds an auth event listener.
310
+ *
311
+ * The listener is typed by this client's profile: one signature,
312
+ * `AuthEventListener<T>`, so an inline arrow is contextually typed and `event`
313
+ * is never implicitly `any`. A client whose profile extends
314
+ * {@link UserProfile} also accepts a default {@link AuthEventListener}: when
315
+ * `T` extends `UserProfile`, `AuthEvent<T>` is assignable to
316
+ * `AuthEvent<UserProfile>`, so a listener that takes the wider default event
317
+ * accepts every event this client emits and keeps compiling. (`UserProfile`
318
+ * is the wider type here — it has fewer required fields — and the assignable
319
+ * direction runs from the client's `AuthEvent<T>` to the listener's
320
+ * `AuthEvent<UserProfile>`.) A profile that does not extend `UserProfile`
321
+ * (no `id`) rejects the default listener: an `AuthEvent<UserProfile>` would
322
+ * promise an `id` the runtime user does not have, and the narrower-typed
323
+ * event is not assignable to it.
324
+ */
215
325
  addEventListener(listener: AuthEventListener<T>): () => void
216
326
 
217
- /** Destroys the auth client. */
327
+ /**
328
+ * Destroys the auth client.
329
+ */
218
330
  destroy(): void
219
331
  }
220
332
  ```
221
333
 
222
- _(Member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-auth/dist/types.d.ts`.)_
334
+ _(The 4 longest member comments are shortened to their first sentence to fit; the full declaration is in `node_modules/@molecule/app-auth/dist/types.d.ts`.)_
223
335
 
224
336
  #### `EditorProvider`
225
337
 
@@ -460,6 +572,15 @@ interface FormOptions<T extends FormValuesConstraint<T>> {
460
572
  HTTP client interface.
461
573
 
462
574
  All HTTP providers must implement this interface.
575
+ An explicit text, blob or arraybuffer parser determines the data type even when
576
+ a JSON generic is supplied. Keep JSON as the default for mutations returning a
577
+ record. A successful DELETE with no body already resolves with null data.
578
+
579
+ Every verb also takes a URL alone, through a signature with the same three parameters on every
580
+ verb, so a verb chosen at runtime (`client[verb](url)`) type-checks and a wrapper can implement
581
+ a verb with an arrow (`get: (url, config) => inner.get(url, config)`). With a body or a config,
582
+ choose the verb through `request({ method, url, data })` instead: the second argument is the
583
+ body for post/put/patch but the config for get/delete, so one call cannot serve both.
463
584
 
464
585
  ```typescript
465
586
  interface HttpClient {
@@ -477,11 +598,33 @@ interface HttpClient {
477
598
  * Makes a generic HTTP request. `data` is a field of THIS config object — the same body
478
599
  * `post(url, data, config)` takes as its second argument.
479
600
  */
601
+ request<T = unknown>(
602
+ config: FullRequestConfig & { responseType: 'text' },
603
+ ): Promise<HttpResponse<string>>
604
+ request<T = unknown>(
605
+ config: FullRequestConfig & { responseType: 'blob' },
606
+ ): Promise<HttpResponse<Blob>>
607
+ request<T = unknown>(
608
+ config: FullRequestConfig & { responseType: 'arraybuffer' },
609
+ ): Promise<HttpResponse<ArrayBuffer>>
480
610
  request<T = unknown>(config: FullRequestConfig): Promise<HttpResponse<T>>
481
611
 
482
612
  /**
483
613
  * Makes a GET request.
484
614
  */
615
+ get<T = unknown>(
616
+ url: string,
617
+ config: RequestConfig & { responseType: 'text' },
618
+ ): Promise<HttpResponse<string>>
619
+ get<T = unknown>(
620
+ url: string,
621
+ config: RequestConfig & { responseType: 'blob' },
622
+ ): Promise<HttpResponse<Blob>>
623
+ get<T = unknown>(
624
+ url: string,
625
+ config: RequestConfig & { responseType: 'arraybuffer' },
626
+ ): Promise<HttpResponse<ArrayBuffer>>
627
+ get<T = unknown>(url: string, config?: undefined, unused?: undefined): Promise<HttpResponse<T>>
485
628
  get<T = unknown>(url: string, config?: RequestConfig): Promise<HttpResponse<T>>
486
629
 
487
630
  /**
@@ -489,23 +632,84 @@ interface HttpClient {
489
632
  * `data` itself, so `post(url, { data: body })` sends `{"data":body}` — pass `body` directly.
490
633
  * A config (headers, params) is the THIRD argument.
491
634
  */
635
+ post<T = unknown>(
636
+ url: string,
637
+ data: unknown,
638
+ config: RequestConfig & { responseType: 'text' },
639
+ ): Promise<HttpResponse<string>>
640
+ post<T = unknown>(
641
+ url: string,
642
+ data: unknown,
643
+ config: RequestConfig & { responseType: 'blob' },
644
+ ): Promise<HttpResponse<Blob>>
645
+ post<T = unknown>(
646
+ url: string,
647
+ data: unknown,
648
+ config: RequestConfig & { responseType: 'arraybuffer' },
649
+ ): Promise<HttpResponse<ArrayBuffer>>
650
+ post<T = unknown>(url: string, data?: undefined, config?: undefined): Promise<HttpResponse<T>>
492
651
  post<T = unknown>(url: string, data?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>
493
652
 
494
653
  /**
495
654
  * Makes a PUT request. `data` is the request BODY (second argument) — never `{ data: body }`,
496
655
  * which sends `{"data":body}`; a config is the THIRD argument.
497
656
  */
657
+ put<T = unknown>(
658
+ url: string,
659
+ data: unknown,
660
+ config: RequestConfig & { responseType: 'text' },
661
+ ): Promise<HttpResponse<string>>
662
+ put<T = unknown>(
663
+ url: string,
664
+ data: unknown,
665
+ config: RequestConfig & { responseType: 'blob' },
666
+ ): Promise<HttpResponse<Blob>>
667
+ put<T = unknown>(
668
+ url: string,
669
+ data: unknown,
670
+ config: RequestConfig & { responseType: 'arraybuffer' },
671
+ ): Promise<HttpResponse<ArrayBuffer>>
672
+ put<T = unknown>(url: string, data?: undefined, config?: undefined): Promise<HttpResponse<T>>
498
673
  put<T = unknown>(url: string, data?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>
499
674
 
500
675
  /**
501
676
  * Makes a PATCH request. `data` is the request BODY (second argument) — never `{ data: body }`,
502
677
  * which sends `{"data":body}`; a config is the THIRD argument.
503
678
  */
679
+ patch<T = unknown>(
680
+ url: string,
681
+ data: unknown,
682
+ config: RequestConfig & { responseType: 'text' },
683
+ ): Promise<HttpResponse<string>>
684
+ patch<T = unknown>(
685
+ url: string,
686
+ data: unknown,
687
+ config: RequestConfig & { responseType: 'blob' },
688
+ ): Promise<HttpResponse<Blob>>
689
+ patch<T = unknown>(
690
+ url: string,
691
+ data: unknown,
692
+ config: RequestConfig & { responseType: 'arraybuffer' },
693
+ ): Promise<HttpResponse<ArrayBuffer>>
694
+ patch<T = unknown>(url: string, data?: undefined, config?: undefined): Promise<HttpResponse<T>>
504
695
  patch<T = unknown>(url: string, data?: unknown, config?: RequestConfig): Promise<HttpResponse<T>>
505
696
 
506
697
  /**
507
698
  * Makes a DELETE request.
508
699
  */
700
+ delete<T = unknown>(
701
+ url: string,
702
+ config: RequestConfig & { responseType: 'text' },
703
+ ): Promise<HttpResponse<string>>
704
+ delete<T = unknown>(
705
+ url: string,
706
+ config: RequestConfig & { responseType: 'blob' },
707
+ ): Promise<HttpResponse<Blob>>
708
+ delete<T = unknown>(
709
+ url: string,
710
+ config: RequestConfig & { responseType: 'arraybuffer' },
711
+ ): Promise<HttpResponse<ArrayBuffer>>
712
+ delete<T = unknown>(url: string, config?: undefined, unused?: undefined): Promise<HttpResponse<T>>
509
713
  delete<T = unknown>(url: string, config?: RequestConfig): Promise<HttpResponse<T>>
510
714
 
511
715
  /**
@@ -1371,7 +1575,10 @@ Result returned by {@link useAIModels}: every field as a signal.
1371
1575
 
1372
1576
  ```typescript
1373
1577
  interface UseAIModelsResult {
1374
- /** Available models, or an empty array while loading. */
1578
+ /**
1579
+ * Available models, or an empty array while loading or after a failed fetch. The list keeps its identity
1580
+ * until the catalog changes, the empty one included, so it can key a computed or an effect.
1581
+ */
1375
1582
  readonly models: Signal<AppModelDefinition[]>
1376
1583
  /**
1377
1584
  * Per-mode server default model ids for the requester's tier, or `undefined`
@@ -2930,13 +3137,12 @@ interface MoleculeModuleConfig {
2930
3137
  auth?: AuthClient<unknown>
2931
3138
  /**
2932
3139
  * Hold bootstrap (and so every page's first render) until `auth` has decided the
2933
- * session. After a full page load a returning visitor's session is restored by one
2934
- * request, and until it answers `MoleculeAuthService.user` is `null` everywhere — a
2935
- * public page's signed-in action (`if (!user) return`, a redirect to `/login`) then
2936
- * treats a signed-in visitor as signed out. With this set, Angular's app initializer
3140
+ * session. A token-only or cookie-only restore makes a current-user request.
3141
+ * Until it answers, a public page's signed-in action (`if (!user) return`, a
3142
+ * redirect to `/login`) can treat a signed-in visitor as signed out. Angular's app initializer
2937
3143
  * waits only while status is `'loading'`, so a cached session can render while its
2938
3144
  * verification continues in the background. `'unavailable'` also renders and may have a
2939
- * null user. Without a session hint, an anonymous visitor settles in microtasks without
3145
+ * null user. A visitor with no session candidate settles synchronously without
2940
3146
  * a request. Ignored without `auth`.
2941
3147
  */
2942
3148
  awaitSession?: boolean
@@ -4359,8 +4565,9 @@ signed out, or `'unavailable'`), and the `[slot=fallback]` content until
4359
4565
  then. It never redirects. An unavailable session is unconfirmed and may
4360
4566
  still have `user === null`; handle that status separately from sign-out.
4361
4567
 
4362
- After a full page load a returning visitor's session is restored by one
4363
- request. Until it answers, `useAuth().user` is `null` everywhere, so a
4568
+ With the bundled JWT client, a stored token and cached user restore synchronously.
4569
+ Token-only and cookie-only sessions need an asynchronous current-user request.
4570
+ Until it answers, `useAuth().user` is `null` everywhere, so a
4364
4571
  public page that renders a signed-in action at once lets that action run
4365
4572
  against "signed out": a Follow button whose handler starts with
4366
4573
  `if (!user) return` ignores the click, one that redirects to `/login` signs
@@ -4368,7 +4575,7 @@ the visitor out of the flow. Wrapping the routes (or passing `awaitSession`
4368
4575
  to `provideMolecule`) makes every page's first render read the restored user
4369
4576
  when restoration succeeds.
4370
4577
 
4371
- A visitor with no session to restore settles in microtasks without a
4578
+ A visitor with no session candidate settles synchronously without a
4372
4579
  request. Must render inside the auth registration (`provideMolecule` with
4373
4580
  `auth`). A client that nobody initialized starts its restore on this first
4374
4581
  read. The bundled JWT client bounds each auth request (default 10 seconds)
@@ -20,7 +20,10 @@ export declare function resetAIModelsCache(): void;
20
20
  * Result returned by {@link useAIModels}: every field as a signal.
21
21
  */
22
22
  export interface UseAIModelsResult {
23
- /** Available models, or an empty array while loading. */
23
+ /**
24
+ * Available models, or an empty array while loading or after a failed fetch. The list keeps its identity
25
+ * until the catalog changes, the empty one included, so it can key a computed or an effect.
26
+ */
24
27
  readonly models: Signal<AppModelDefinition[]>;
25
28
  /**
26
29
  * Per-mode server default model ids for the requester's tier, or `undefined`
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-models.d.ts","sourceRoot":"","sources":["../../src/hooks/use-ai-models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAwC,KAAK,MAAM,EAAqB,MAAM,eAAe,CAAA;AAEpG,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAIvF,OAAO,EAAE,KAAK,WAAW,EAAmB,MAAM,oBAAoB,CAAA;AA+FtE;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CASzC;AAcD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,QAAQ,CAA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O,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IACjC,+CAA+C;IAC/C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,CAAA;CACrC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,iBAAiB,CAmD1F"}
@@ -12,6 +12,12 @@ import { computed, DestroyRef, effect, inject, signal, untracked } from '@angula
12
12
  import { loadAIModelCatalog, pickFreeTierModel } from '@molecule/app-ai-models';
13
13
  import { readMaybeSignal } from '../maybe-signal.js';
14
14
  import { useHttpClient } from './use-http.js';
15
+ /**
16
+ * The list returned while the catalog loads or after it fails. One module-level array, like the catalog's
17
+ * own lists, which every caller on a scope shares: a new `[]` per read would change the identity of an
18
+ * unchanged catalog.
19
+ */
20
+ const NO_MODELS = [];
15
21
  /** One cache entry per scope — `''` for the unscoped catalog, else the projectId. */
16
22
  const caches = new Map();
17
23
  /**
@@ -154,7 +160,7 @@ export function useAIModels(projectId) {
154
160
  destroyRef.onDestroy(() => {
155
161
  listenersFor(scope).delete(listener);
156
162
  });
157
- const models = computed(() => snapshot().models ?? [], /* @ts-ignore */
163
+ const models = computed(() => snapshot().models ?? NO_MODELS, /* @ts-ignore */
158
164
  ...(ngDevMode ? [{ debugName: "models" }] : /* istanbul ignore next */ []));
159
165
  return {
160
166
  models,
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-models.js","sourceRoot":"","sources":["../../src/hooks/use-ai-models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAe,MAAM,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAGpG,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAG/E,OAAO,EAAoB,eAAe,EAAE,MAAM,oBA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AQ,EAAE,CAAC,QAAQ,CAAC;QAC7C,aAAa,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC,CAAC;QAC1D,OAAO,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;QAChE,KAAK,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC;KACxC,CAAA;AACH,CAAC"}
@@ -5,8 +5,9 @@ import * as i0 from "@angular/core";
5
5
  * then. It never redirects. An unavailable session is unconfirmed and may
6
6
  * still have `user === null`; handle that status separately from sign-out.
7
7
  *
8
- * After a full page load a returning visitor's session is restored by one
9
- * request. Until it answers, `useAuth().user` is `null` everywhere, so a
8
+ * With the bundled JWT client, a stored token and cached user restore synchronously.
9
+ * Token-only and cookie-only sessions need an asynchronous current-user request.
10
+ * Until it answers, `useAuth().user` is `null` everywhere, so a
10
11
  * public page that renders a signed-in action at once lets that action run
11
12
  * against "signed out": a Follow button whose handler starts with
12
13
  * `if (!user) return` ignores the click, one that redirects to `/login` signs
@@ -14,7 +15,7 @@ import * as i0 from "@angular/core";
14
15
  * to `provideMolecule`) makes every page's first render read the restored user
15
16
  * when restoration succeeds.
16
17
  *
17
- * A visitor with no session to restore settles in microtasks without a
18
+ * A visitor with no session candidate settles synchronously without a
18
19
  * request. Must render inside the auth registration (`provideMolecule` with
19
20
  * `auth`). A client that nobody initialized starts its restore on this first
20
21
  * read. The bundled JWT client bounds each auth request (default 10 seconds)
@@ -1 +1 @@
1
- {"version":3,"file":"session-ready.d.ts","sourceRoot":"","sources":["../src/session-ready.ts"],"names":[],"mappings":";AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAWa,YAAY;IACvB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,0EAAmB;yCAFvB,YAAY;2CAAZ,YAAY;CAGxB"}
1
+ {"version":3,"file":"session-ready.d.ts","sourceRoot":"","sources":["../src/session-ready.ts"],"names":[],"mappings":";AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,qBAWa,YAAY;IACvB,gFAAgF;IAChF,QAAQ,CAAC,MAAM,0EAAmB;yCAFvB,YAAY;2CAAZ,YAAY;CAGxB"}
@@ -21,8 +21,9 @@ function SessionReady_Conditional_1_Template(rf, ctx) { if (rf & 1) {
21
21
  * then. It never redirects. An unavailable session is unconfirmed and may
22
22
  * still have `user === null`; handle that status separately from sign-out.
23
23
  *
24
- * After a full page load a returning visitor's session is restored by one
25
- * request. Until it answers, `useAuth().user` is `null` everywhere, so a
24
+ * With the bundled JWT client, a stored token and cached user restore synchronously.
25
+ * Token-only and cookie-only sessions need an asynchronous current-user request.
26
+ * Until it answers, `useAuth().user` is `null` everywhere, so a
26
27
  * public page that renders a signed-in action at once lets that action run
27
28
  * against "signed out": a Follow button whose handler starts with
28
29
  * `if (!user) return` ignores the click, one that redirects to `/login` signs
@@ -30,7 +31,7 @@ function SessionReady_Conditional_1_Template(rf, ctx) { if (rf & 1) {
30
31
  * to `provideMolecule`) makes every page's first render read the restored user
31
32
  * when restoration succeeds.
32
33
  *
33
- * A visitor with no session to restore settles in microtasks without a
34
+ * A visitor with no session candidate settles synchronously without a
34
35
  * request. Must render inside the auth registration (`provideMolecule` with
35
36
  * `auth`). A client that nobody initialized starts its restore on this first
36
37
  * read. The bundled JWT client bounds each auth request (default 10 seconds)
@@ -75,5 +76,5 @@ export class SessionReady {
75
76
  `,
76
77
  }]
77
78
  }], null, null); })();
78
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SessionReady, { className: "SessionReady", filePath: "session-ready.ts", lineNumber: 56 }); })();
79
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SessionReady, { className: "SessionReady", filePath: "session-ready.ts", lineNumber: 57 }); })();
79
80
  //# sourceMappingURL=session-ready.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-ready.js","sourceRoot":"","sources":["../src/session-ready.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;;;;;IAwCvC,kBAAuC;;;IAEvC,qBAAc;;AAxCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAYH,MAAM,OAAO,YAAY;IAXzB;QAYE,gFAAgF;QACvE,WAAM,GAAG,OAAO,EAAE,CAAC,MAAM,CAAA;KACnC;6GAHY,YAAY;oEAAZ,YAAY;;YALnB,AAFF,oEAA8B,8CAErB;;YAFT,oDAIC;;;iFAGQ,YAAY;cAXxB,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;GAMT;aACF;;kFACY,YAAY"}
1
+ {"version":3,"file":"session-ready.js","sourceRoot":"","sources":["../src/session-ready.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;;;;;IAyCvC,kBAAuC;;;IAEvC,qBAAc;;AAzCpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAYH,MAAM,OAAO,YAAY;IAXzB;QAYE,gFAAgF;QACvE,WAAM,GAAG,OAAO,EAAE,CAAC,MAAM,CAAA;KACnC;6GAHY,YAAY;oEAAZ,YAAY;;YALnB,AAFF,oEAA8B,8CAErB;;YAFT,oDAIC;;;iFAGQ,YAAY;cAXxB,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,QAAQ,EAAE;;;;;;GAMT;aACF;;kFACY,YAAY"}
package/dist/types.d.ts CHANGED
@@ -24,13 +24,12 @@ export interface MoleculeModuleConfig {
24
24
  auth?: AuthClient<unknown>;
25
25
  /**
26
26
  * Hold bootstrap (and so every page's first render) until `auth` has decided the
27
- * session. After a full page load a returning visitor's session is restored by one
28
- * request, and until it answers `MoleculeAuthService.user` is `null` everywhere — a
29
- * public page's signed-in action (`if (!user) return`, a redirect to `/login`) then
30
- * treats a signed-in visitor as signed out. With this set, Angular's app initializer
27
+ * session. A token-only or cookie-only restore makes a current-user request.
28
+ * Until it answers, a public page's signed-in action (`if (!user) return`, a
29
+ * redirect to `/login`) can treat a signed-in visitor as signed out. Angular's app initializer
31
30
  * waits only while status is `'loading'`, so a cached session can render while its
32
31
  * verification continues in the background. `'unavailable'` also renders and may have a
33
- * null user. Without a session hint, an anonymous visitor settles in microtasks without
32
+ * null user. A visitor with no session candidate settles synchronously without
34
33
  * a request. Ignored without `auth`.
35
34
  */
36
35
  awaitSession?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAA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AW,EACX,aAAa,EACb,WAAW,EACX,MAAM,EACN,aAAa,EACb,eAAe,EACf,KAAK,EACL,WAAW,EACX,KAAK,EACL,aAAa,EACb,iBAAiB,GAClB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@molecule/app-angular",
3
- "version": "3.7.1",
3
+ "version": "3.7.2",
4
4
  "description": "Angular framework bindings for molecule.dev",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -60,7 +60,7 @@
60
60
  "@angular/compiler-cli": "22.2.3",
61
61
  "@angular/core": "22.2.3",
62
62
  "@angular/platform-browser": "22.2.3",
63
- "@molecule/app-ai-chat": "1.8.0",
63
+ "@molecule/app-ai-chat": "1.8.1",
64
64
  "@molecule/app-ai-models": "1.4.4",
65
65
  "@molecule/app-framework-conformance": "0.0.0",
66
66
  "@molecule/app-utilities": "1.0.7",