@molecule/app-svelte 3.14.1 → 3.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +246 -284
- package/dist/ai-models.d.ts +2 -0
- package/dist/ai-models.d.ts.map +1 -0
- package/dist/ai-models.js +1 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +5 -0
- package/dist/chat-context.d.ts +13 -0
- package/dist/chat-context.d.ts.map +1 -0
- package/dist/chat-context.js +23 -0
- package/dist/chat-provider.d.ts +5 -0
- package/dist/chat-provider.d.ts.map +1 -0
- package/dist/chat-provider.js +5 -0
- package/dist/chat-types.d.ts +9 -0
- package/dist/chat-types.d.ts.map +1 -0
- package/dist/chat-types.js +1 -0
- package/dist/context.d.ts +59 -13
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +44 -26
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -2
- package/dist/hooks/useAIModels.d.ts +1 -1
- package/dist/hooks/useAIModels.js +1 -1
- package/dist/hooks/usePush.d.ts +1 -1
- package/dist/hooks/usePush.js +1 -1
- package/dist/hooks/useTranslation.d.ts +9 -4
- package/dist/hooks/useTranslation.d.ts.map +1 -1
- package/dist/hooks/useTranslation.js +10 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/legacy-ai-models.d.ts +17 -0
- package/dist/legacy-ai-models.d.ts.map +1 -0
- package/dist/legacy-ai-models.js +11 -0
- package/dist/legacy-chat.d.ts +77 -0
- package/dist/legacy-chat.d.ts.map +1 -0
- package/dist/legacy-chat.js +51 -0
- package/dist/legacy-push.d.ts +22 -0
- package/dist/legacy-push.d.ts.map +1 -0
- package/dist/legacy-push.js +11 -0
- package/dist/link/Link.svelte +18 -8
- package/dist/link/Link.svelte.d.ts +7 -1
- package/dist/link/Link.svelte.d.ts.map +1 -1
- package/dist/link/types.d.ts +5 -1
- package/dist/link/types.d.ts.map +1 -1
- package/dist/providers/ChatProvider.svelte +1 -1
- package/dist/providers/ChatProvider.svelte.d.ts +1 -1
- package/dist/providers/ChatProvider.svelte.d.ts.map +1 -1
- package/dist/providers/providers.d.ts +0 -4
- package/dist/providers/providers.d.ts.map +1 -1
- package/dist/providers/providers.js +0 -5
- package/dist/providers/services.js +2 -1
- package/dist/push.d.ts +3 -0
- package/dist/push.d.ts.map +1 -0
- package/dist/push.js +2 -0
- package/dist/stores/chat.d.ts +1 -1
- package/dist/stores/chat.js +2 -2
- package/dist/stores/index.d.ts +0 -2
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +0 -2
- package/dist/stores/push.d.ts +1 -1
- package/dist/stores/push.js +1 -1
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +20 -5
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-
|
|
6
|
+
Generated: 2026-11-27T22:16:41.504Z
|
|
7
7
|
-->
|
|
8
8
|
|
|
9
9
|
# @molecule/app-svelte
|
|
@@ -1209,31 +1209,6 @@ interface Theme {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
```
|
|
1211
1211
|
|
|
1212
|
-
#### `UseAIModelsResult`
|
|
1213
|
-
|
|
1214
|
-
Result returned by `useAIModels`.
|
|
1215
|
-
|
|
1216
|
-
```typescript
|
|
1217
|
-
interface UseAIModelsResult {
|
|
1218
|
-
/**
|
|
1219
|
-
* Available models, or an empty array while loading or after a failed fetch, as a readable store. The list
|
|
1220
|
-
* keeps its identity until the catalog changes, the empty one included.
|
|
1221
|
-
*/
|
|
1222
|
-
models: Readable<AppModelDefinition[]>
|
|
1223
|
-
/**
|
|
1224
|
-
* Per-mode server default model ids for the requester's tier, or `undefined`
|
|
1225
|
-
* while loading or on servers that don't provide them.
|
|
1226
|
-
*/
|
|
1227
|
-
defaults: Readable<AppModeModelDefaults | undefined>
|
|
1228
|
-
/** The single model marked `freeTier: true`, or `undefined`. */
|
|
1229
|
-
freeTierModel: Readable<AppModelDefinition | undefined>
|
|
1230
|
-
/** `true` while the initial fetch is in flight. */
|
|
1231
|
-
loading: Readable<boolean>
|
|
1232
|
-
/** Error from the initial fetch, or `null`. */
|
|
1233
|
-
error: Readable<Error | null>
|
|
1234
|
-
}
|
|
1235
|
-
```
|
|
1236
|
-
|
|
1237
1212
|
#### `UseAuthOptions`
|
|
1238
1213
|
|
|
1239
1214
|
Options for {@link useAuth}.
|
|
@@ -1815,51 +1790,6 @@ interface UsePromiseState<T> {
|
|
|
1815
1790
|
}
|
|
1816
1791
|
```
|
|
1817
1792
|
|
|
1818
|
-
#### `UsePushResult`
|
|
1819
|
-
|
|
1820
|
-
Hook return type.
|
|
1821
|
-
|
|
1822
|
-
```typescript
|
|
1823
|
-
interface UsePushResult {
|
|
1824
|
-
/** The last permission status a check or request reported, null until one runs. */
|
|
1825
|
-
permission: Readable<PermissionStatus | null>
|
|
1826
|
-
/** The token register() resolved, null until a registration. */
|
|
1827
|
-
token: Readable<PushToken | null>
|
|
1828
|
-
/** Reads the permission status from the provider. */
|
|
1829
|
-
checkPermission: () => Promise<PermissionStatus>
|
|
1830
|
-
/** Asks the user for permission and stores the answer. */
|
|
1831
|
-
requestPermission: () => Promise<PermissionStatus>
|
|
1832
|
-
/** Registers for push and stores the token. */
|
|
1833
|
-
register: (options?: PushRegisterOptions) => Promise<PushToken>
|
|
1834
|
-
/** Unregisters and clears the token. */
|
|
1835
|
-
unregister: () => Promise<void>
|
|
1836
|
-
/** Subscribes a notification listener; returns its unsubscribe. */
|
|
1837
|
-
onNotificationReceived: (listener: NotificationReceivedListener) => () => void
|
|
1838
|
-
/** Subscribes a notification-action listener; returns its unsubscribe. */
|
|
1839
|
-
onNotificationAction: (listener: NotificationActionListener) => () => void
|
|
1840
|
-
/** Subscribes a token-change listener; returns its unsubscribe. */
|
|
1841
|
-
onTokenChange: (listener: TokenChangeListener) => () => void
|
|
1842
|
-
/** Sets the badge count. */
|
|
1843
|
-
setBadge: (count: number) => Promise<void>
|
|
1844
|
-
/** Clears the badge. */
|
|
1845
|
-
clearBadge: () => Promise<void>
|
|
1846
|
-
}
|
|
1847
|
-
```
|
|
1848
|
-
|
|
1849
|
-
#### `UsePushOptions`
|
|
1850
|
-
|
|
1851
|
-
Options for the usePush hook (e.g. check permission on mount).
|
|
1852
|
-
|
|
1853
|
-
```typescript
|
|
1854
|
-
interface UsePushOptions {
|
|
1855
|
-
/**
|
|
1856
|
-
* Whether to check permission status on mount, and again when the flag turns
|
|
1857
|
-
* on later on the same component.
|
|
1858
|
-
*/
|
|
1859
|
-
checkOnMount?: boolean
|
|
1860
|
-
}
|
|
1861
|
-
```
|
|
1862
|
-
|
|
1863
1793
|
#### `UseRouterResult`
|
|
1864
1794
|
|
|
1865
1795
|
What {@link useRouter} returns.
|
|
@@ -2210,7 +2140,11 @@ Props for `Link`. Every other anchor attribute (`class`, `target`, `rel`,
|
|
|
2210
2140
|
|
|
2211
2141
|
```typescript
|
|
2212
2142
|
interface LinkProps extends Omit<HTMLAnchorAttributes, 'href' | 'children'> {
|
|
2213
|
-
/**
|
|
2143
|
+
/**
|
|
2144
|
+
* Destination: an app path (`/settings?tab=billing#plan`) or a URL. An app path's `href` is the
|
|
2145
|
+
* one the router writes for it (`routerLinkHref`), base path included; a URL's is the URL as
|
|
2146
|
+
* written.
|
|
2147
|
+
*/
|
|
2214
2148
|
to: string
|
|
2215
2149
|
/**
|
|
2216
2150
|
* Replace the current history entry instead of pushing one. When omitted, a
|
|
@@ -2474,16 +2408,6 @@ interface LoggerProviderProps extends ProviderProps {
|
|
|
2474
2408
|
}
|
|
2475
2409
|
```
|
|
2476
2410
|
|
|
2477
|
-
#### `ChatProviderProps`
|
|
2478
|
-
|
|
2479
|
-
Props for the `ChatProvider` component.
|
|
2480
|
-
|
|
2481
|
-
```typescript
|
|
2482
|
-
interface ChatProviderProps extends ProviderProps {
|
|
2483
|
-
provider: ChatProvider
|
|
2484
|
-
}
|
|
2485
|
-
```
|
|
2486
|
-
|
|
2487
2411
|
#### `WorkspaceProviderProps`
|
|
2488
2412
|
|
|
2489
2413
|
Props for the `WorkspaceProvider` component.
|
|
@@ -2580,17 +2504,6 @@ URL query string parameter map (single values or arrays for repeated keys).
|
|
|
2580
2504
|
type QueryParams = Record<string, string | string[] | undefined>
|
|
2581
2505
|
```
|
|
2582
2506
|
|
|
2583
|
-
#### `AgentIdentity`
|
|
2584
|
-
|
|
2585
|
-
Display identity for the AI coding agent and the host product, used to
|
|
2586
|
-
interpolate the `{{agentName}}` / `{{productName}}` tokens in shared chat/IDE
|
|
2587
|
-
copy. A consuming app sets these to its own agent + product brand names; the
|
|
2588
|
-
shared packages fall back to {@link DEFAULT_AGENT_IDENTITY} when it does not.
|
|
2589
|
-
|
|
2590
|
-
```typescript
|
|
2591
|
-
type AgentIdentity = ChatAgentIdentity
|
|
2592
|
-
```
|
|
2593
|
-
|
|
2594
2507
|
#### `MaybeReadable`
|
|
2595
2508
|
|
|
2596
2509
|
A plain value or a readable store of one (a store of `undefined` stands for
|
|
@@ -2735,9 +2648,7 @@ Two compatible call forms:
|
|
|
2735
2648
|
English `defaultValue`, with optional `count` for pluralization.
|
|
2736
2649
|
|
|
2737
2650
|
```typescript
|
|
2738
|
-
type UseTFunction =
|
|
2739
|
-
(key: string, fallback: string, options?: UseTShorthandOptions): string
|
|
2740
|
-
}
|
|
2651
|
+
type UseTFunction = TranslateFunctionWithFallback
|
|
2741
2652
|
```
|
|
2742
2653
|
|
|
2743
2654
|
#### `VerifyPaymentReturnStatus`
|
|
@@ -2748,49 +2659,102 @@ How far the return-page verification has got.
|
|
|
2748
2659
|
type VerifyPaymentReturnStatus = 'idle' | 'verifying' | 'verified' | 'failed'
|
|
2749
2660
|
```
|
|
2750
2661
|
|
|
2751
|
-
#### `
|
|
2662
|
+
#### `UseAIModelsResult` _(deprecated)_
|
|
2752
2663
|
|
|
2753
|
-
|
|
2664
|
+
> **Deprecated:** Import UseAIModelsResult from `@molecule/app-svelte/ai-models`.
|
|
2665
|
+
|
|
2666
|
+
Compatibility alias for `UseAIModelsResult`.
|
|
2754
2667
|
|
|
2755
2668
|
```typescript
|
|
2756
|
-
type
|
|
2757
|
-
initialize: () => Promise<void>
|
|
2758
|
-
}
|
|
2669
|
+
type UseAIModelsResult = feature.UseAIModelsResult
|
|
2759
2670
|
```
|
|
2760
2671
|
|
|
2761
|
-
#### `
|
|
2672
|
+
#### `AgentIdentity` _(deprecated)_
|
|
2762
2673
|
|
|
2763
|
-
|
|
2674
|
+
> **Deprecated:** Import AgentIdentity from `@molecule/app-ai-chat`.
|
|
2675
|
+
|
|
2676
|
+
Compatibility alias for `AgentIdentity`.
|
|
2764
2677
|
|
|
2765
2678
|
```typescript
|
|
2766
|
-
type
|
|
2679
|
+
type AgentIdentity = feature.AgentIdentity
|
|
2680
|
+
```
|
|
2681
|
+
|
|
2682
|
+
#### `ChatProviderProps` _(deprecated)_
|
|
2683
|
+
|
|
2684
|
+
> **Deprecated:** Import ChatProviderProps from `@molecule/app-svelte/chat`.
|
|
2685
|
+
|
|
2686
|
+
Compatibility alias for `ChatProviderProps`.
|
|
2687
|
+
|
|
2688
|
+
```typescript
|
|
2689
|
+
type ChatProviderProps = feature.ChatProviderProps
|
|
2690
|
+
```
|
|
2691
|
+
|
|
2692
|
+
#### `SendMessageOptions` _(deprecated)_
|
|
2693
|
+
|
|
2694
|
+
> **Deprecated:** Import SendMessageOptions from `@molecule/app-svelte/chat`.
|
|
2695
|
+
|
|
2696
|
+
Compatibility alias for `SendMessageOptions`.
|
|
2697
|
+
|
|
2698
|
+
```typescript
|
|
2699
|
+
type SendMessageOptions = feature.SendMessageOptions
|
|
2700
|
+
```
|
|
2701
|
+
|
|
2702
|
+
#### `UseChatOptions` _(deprecated)_
|
|
2703
|
+
|
|
2704
|
+
> **Deprecated:** Import UseChatOptions from `@molecule/app-svelte/chat`.
|
|
2705
|
+
|
|
2706
|
+
Compatibility alias for `UseChatOptions`.
|
|
2707
|
+
|
|
2708
|
+
```typescript
|
|
2709
|
+
type UseChatOptions = feature.UseChatOptions
|
|
2767
2710
|
```
|
|
2768
2711
|
|
|
2769
|
-
#### `
|
|
2712
|
+
#### `UseChatResult` _(deprecated)_
|
|
2713
|
+
|
|
2714
|
+
> **Deprecated:** Import UseChatResult from `@molecule/app-svelte/chat`.
|
|
2770
2715
|
|
|
2771
|
-
|
|
2716
|
+
Compatibility alias for `UseChatResult`.
|
|
2772
2717
|
|
|
2773
2718
|
```typescript
|
|
2774
|
-
type
|
|
2719
|
+
type UseChatResult = feature.UseChatResult
|
|
2775
2720
|
```
|
|
2776
2721
|
|
|
2777
|
-
#### `
|
|
2722
|
+
#### `UsePushOptions` _(deprecated)_
|
|
2778
2723
|
|
|
2779
|
-
|
|
2724
|
+
> **Deprecated:** Import UsePushOptions from `@molecule/app-svelte/push`.
|
|
2725
|
+
|
|
2726
|
+
Compatibility alias for `UsePushOptions`.
|
|
2780
2727
|
|
|
2781
2728
|
```typescript
|
|
2782
|
-
type
|
|
2729
|
+
type UsePushOptions = feature.UsePushOptions
|
|
2783
2730
|
```
|
|
2784
2731
|
|
|
2785
|
-
#### `
|
|
2732
|
+
#### `UsePushResult` _(deprecated)_
|
|
2733
|
+
|
|
2734
|
+
> **Deprecated:** Import UsePushResult from `@molecule/app-svelte/push`.
|
|
2786
2735
|
|
|
2787
|
-
|
|
2788
|
-
and the session's controls as plain functions (stable for the component's life).
|
|
2736
|
+
Compatibility alias for `UsePushResult`.
|
|
2789
2737
|
|
|
2790
2738
|
```typescript
|
|
2791
|
-
type
|
|
2792
|
-
|
|
2793
|
-
|
|
2739
|
+
type UsePushResult = feature.UsePushResult
|
|
2740
|
+
```
|
|
2741
|
+
|
|
2742
|
+
#### `CapacitorAppStore`
|
|
2743
|
+
|
|
2744
|
+
Return type for the Capacitor app store.
|
|
2745
|
+
|
|
2746
|
+
```typescript
|
|
2747
|
+
type CapacitorAppStore = Readable<CapacitorAppState> & {
|
|
2748
|
+
initialize: () => Promise<void>
|
|
2749
|
+
}
|
|
2750
|
+
```
|
|
2751
|
+
|
|
2752
|
+
#### `ChangePasswordStore`
|
|
2753
|
+
|
|
2754
|
+
Change password store type.
|
|
2755
|
+
|
|
2756
|
+
```typescript
|
|
2757
|
+
type ChangePasswordStore = PromiseStore<void, [string, string]>
|
|
2794
2758
|
```
|
|
2795
2759
|
|
|
2796
2760
|
#### `LoginStore`
|
|
@@ -2952,16 +2916,6 @@ function setLoggerContext(provider: LoggerProvider): void
|
|
|
2952
2916
|
|
|
2953
2917
|
- `provider` — The logger provider to store in Svelte context.
|
|
2954
2918
|
|
|
2955
|
-
#### `setChatContext(provider)`
|
|
2956
|
-
|
|
2957
|
-
Sets the AI chat context.
|
|
2958
|
-
|
|
2959
|
-
```typescript
|
|
2960
|
-
function setChatContext(provider: ChatProvider): void
|
|
2961
|
-
```
|
|
2962
|
-
|
|
2963
|
-
- `provider` — The chat provider to store in Svelte context.
|
|
2964
|
-
|
|
2965
2919
|
#### `setWorkspaceContext(provider)`
|
|
2966
2920
|
|
|
2967
2921
|
Sets the IDE workspace context.
|
|
@@ -3075,16 +3029,6 @@ function getLoggerProvider(): LoggerProvider
|
|
|
3075
3029
|
|
|
3076
3030
|
**Returns:** The logger provider instance.
|
|
3077
3031
|
|
|
3078
|
-
#### `useChatProvider()`
|
|
3079
|
-
|
|
3080
|
-
Gets the AI chat provider from Svelte context (`setMoleculeContext({ chat })`).
|
|
3081
|
-
|
|
3082
|
-
```typescript
|
|
3083
|
-
function useChatProvider(): ChatProvider
|
|
3084
|
-
```
|
|
3085
|
-
|
|
3086
|
-
**Returns:** The chat provider instance.
|
|
3087
|
-
|
|
3088
3032
|
#### `useWorkspaceProvider()`
|
|
3089
3033
|
|
|
3090
3034
|
Gets the IDE workspace provider from Svelte context
|
|
@@ -3169,6 +3113,29 @@ function useRouterInstance(): Router
|
|
|
3169
3113
|
|
|
3170
3114
|
**Returns:** The router instance.
|
|
3171
3115
|
|
|
3116
|
+
#### `useLinkRouter(path)`
|
|
3117
|
+
|
|
3118
|
+
The router a link navigates through, under React's hook name: the router set
|
|
3119
|
+
in context, or `null` for a URL outside the app when none is. The browser, or
|
|
3120
|
+
on a device the URL handler, opens such a URL, so a link to it renders in an
|
|
3121
|
+
app with no router (a widget, a static page). A link to an app path still
|
|
3122
|
+
fails without one: that is how an app that forgot to mount its router finds
|
|
3123
|
+
out.
|
|
3124
|
+
|
|
3125
|
+
`Link` uses it. With a destination it answers for that one and follows it
|
|
3126
|
+
while the component lives. Without one (the destination is a `$state` prop of
|
|
3127
|
+
a runes component, which is no store) it returns a function to call with the
|
|
3128
|
+
destination wherever it is known; call it during component initialisation,
|
|
3129
|
+
which reads the context once.
|
|
3130
|
+
|
|
3131
|
+
```typescript
|
|
3132
|
+
function useLinkRouter(path: MaybeReadable<string>): Readable<Router | null>
|
|
3133
|
+
```
|
|
3134
|
+
|
|
3135
|
+
- `path` — The link's destination: an app path or a URL, or a readable store of one.
|
|
3136
|
+
|
|
3137
|
+
**Returns:** A readable store of the router the link navigates through, or `null` for a URL outside the app with no router in context.
|
|
3138
|
+
|
|
3172
3139
|
#### `useHttpClient()`
|
|
3173
3140
|
|
|
3174
3141
|
Gets the HTTP client from Svelte context under the React hook's name.
|
|
@@ -3239,36 +3206,6 @@ function toReadable<T>(value: MaybeReadable<T>): Readable<T>
|
|
|
3239
3206
|
|
|
3240
3207
|
**Returns:** A readable store of the value.
|
|
3241
3208
|
|
|
3242
|
-
#### `resetAIModelsCache()`
|
|
3243
|
-
|
|
3244
|
-
Test-only: drops every cached model list so the next `useAIModels` call
|
|
3245
|
-
refetches. Exposed for unit tests; do not call from production code.
|
|
3246
|
-
|
|
3247
|
-
```typescript
|
|
3248
|
-
function resetAIModelsCache(): void
|
|
3249
|
-
```
|
|
3250
|
-
|
|
3251
|
-
#### `useAIModels(projectId)`
|
|
3252
|
-
|
|
3253
|
-
Subscribes to the cached AI model catalog, React's `useAIModels` in Svelte's
|
|
3254
|
-
idiom: call it during component init under `setMoleculeContext({ http })`.
|
|
3255
|
-
The first mount of a scope triggers a single `GET /ai/models` fetch;
|
|
3256
|
-
subsequent mounts return the cached result, and a scope whose fetch failed
|
|
3257
|
-
does not refetch on a later mount.
|
|
3258
|
-
|
|
3259
|
-
The project id may be a plain value or a readable store of one (a store
|
|
3260
|
-
holding `undefined` means the unscoped catalog): setting it resubscribes to
|
|
3261
|
-
the new scope's cache and fetches it if nobody has yet, on the same
|
|
3262
|
-
component, the way React's re-render does.
|
|
3263
|
-
|
|
3264
|
-
```typescript
|
|
3265
|
-
function useAIModels(projectId?: MaybeReadable<string | undefined>): UseAIModelsResult
|
|
3266
|
-
```
|
|
3267
|
-
|
|
3268
|
-
- `projectId` — Optional project scope: includes that project's custom ("bring your own AI") models on servers that support them (or a store of it).
|
|
3269
|
-
|
|
3270
|
-
**Returns:** Models, free-tier model, loading flag, and error, as stores.
|
|
3271
|
-
|
|
3272
3209
|
#### `useAsyncState(initialState)`
|
|
3273
3210
|
|
|
3274
3211
|
State that accepts Promises and partial updates, React's `useAsyncState` in
|
|
@@ -3817,24 +3754,6 @@ function usePromise<T, A extends unknown[]>(
|
|
|
3817
3754
|
|
|
3818
3755
|
**Returns:** A readable store of the [state, wrappedFunction] tuple.
|
|
3819
3756
|
|
|
3820
|
-
#### `usePush(options)`
|
|
3821
|
-
|
|
3822
|
-
Push notification state and actions, React's `usePush` in Svelte's idiom:
|
|
3823
|
-
called during component init, `permission` and `token` are readable stores
|
|
3824
|
-
the hook's own actions update, and the rest are plain functions.
|
|
3825
|
-
|
|
3826
|
-
Uses module-level `getProvider()` — push is a singleton, not
|
|
3827
|
-
context-provided. The provider's listeners are caller-managed: the returned
|
|
3828
|
-
`on*` unsubscribes are the caller's to call, like React's.
|
|
3829
|
-
|
|
3830
|
-
```typescript
|
|
3831
|
-
function usePush(options?: MaybeReadable<UsePushOptions | undefined>): UsePushResult
|
|
3832
|
-
```
|
|
3833
|
-
|
|
3834
|
-
- `options` — Hook options (or a store of them): setting `checkOnMount` later runs its check on the same component, the way React's re-render re-runs its effect.
|
|
3835
|
-
|
|
3836
|
-
**Returns:** Push notification state and action methods
|
|
3837
|
-
|
|
3838
3757
|
#### `useRouter()`
|
|
3839
3758
|
|
|
3840
3759
|
Routing state and navigation, React's `useRouter` in Svelte's idiom: call it
|
|
@@ -4153,6 +4072,17 @@ function useThemeColors(): Readable<Theme['colors']>
|
|
|
4153
4072
|
|
|
4154
4073
|
**Returns:** A readable store of the current theme's colors.
|
|
4155
4074
|
|
|
4075
|
+
#### `useRichTranslation()`
|
|
4076
|
+
|
|
4077
|
+
Reads rich catalog messages from the active provider. Call the returned
|
|
4078
|
+
translation function in render so it follows locale and catalog changes.
|
|
4079
|
+
|
|
4080
|
+
```typescript
|
|
4081
|
+
function useRichTranslation(): RichTranslateFunction
|
|
4082
|
+
```
|
|
4083
|
+
|
|
4084
|
+
**Returns:** The locale-reactive rich translation function.
|
|
4085
|
+
|
|
4156
4086
|
#### `useTranslation()`
|
|
4157
4087
|
|
|
4158
4088
|
Internationalization, React's `useTranslation` in Svelte's idiom: call it
|
|
@@ -4361,25 +4291,6 @@ function createChangePasswordStore(): ChangePasswordStore
|
|
|
4361
4291
|
|
|
4362
4292
|
**Returns:** Change password promise store
|
|
4363
4293
|
|
|
4364
|
-
#### `useChat(options)`
|
|
4365
|
-
|
|
4366
|
-
AI chat with streaming: the transcript, loading and error state, mode, and
|
|
4367
|
-
the controls (send, abort, queue edits, history). Call it during component
|
|
4368
|
-
init.
|
|
4369
|
-
|
|
4370
|
-
The options may be a plain value or a readable store of one (a store holding
|
|
4371
|
-
`undefined` means no options): a new `endpoint` switches conversation and a
|
|
4372
|
-
new `projectId` moves to that project's transcript, on the same component,
|
|
4373
|
-
the way React re-renders `useChat`.
|
|
4374
|
-
|
|
4375
|
-
```typescript
|
|
4376
|
-
function useChat(options: UseChatOptions | Readable<UseChatOptions>): UseChatResult
|
|
4377
|
-
```
|
|
4378
|
-
|
|
4379
|
-
- `options` — Chat options (or a store of them): endpoint, project id, history loading, callbacks.
|
|
4380
|
-
|
|
4381
|
-
**Returns:** Each state field as a readable store, and the chat controls.
|
|
4382
|
-
|
|
4383
4294
|
#### `createDeviceStores()`
|
|
4384
4295
|
|
|
4385
4296
|
Create device stores from the module-level device provider.
|
|
@@ -4716,28 +4627,6 @@ function createPromiseStore<T, A extends unknown[]>(
|
|
|
4716
4627
|
|
|
4717
4628
|
**Returns:** Promise store with subscribe, call, cancel, and reset
|
|
4718
4629
|
|
|
4719
|
-
#### `createPushStores()`
|
|
4720
|
-
|
|
4721
|
-
Create push notification stores from the module-level push provider.
|
|
4722
|
-
|
|
4723
|
-
```typescript
|
|
4724
|
-
function createPushStores(): {
|
|
4725
|
-
permission: Readable<PermissionStatus | null>
|
|
4726
|
-
token: Readable<PushToken | null>
|
|
4727
|
-
checkPermission: () => Promise<PermissionStatus>
|
|
4728
|
-
requestPermission: () => Promise<PermissionStatus>
|
|
4729
|
-
register: (options?: PushRegisterOptions) => Promise<PushToken>
|
|
4730
|
-
unregister: () => Promise<void>
|
|
4731
|
-
onNotificationReceived: (listener: NotificationReceivedListener) => () => void
|
|
4732
|
-
onNotificationAction: (listener: NotificationActionListener) => () => void
|
|
4733
|
-
onTokenChange: (listener: TokenChangeListener) => () => void
|
|
4734
|
-
setBadge: (count: number) => Promise<void>
|
|
4735
|
-
clearBadge: () => Promise<void>
|
|
4736
|
-
}
|
|
4737
|
-
```
|
|
4738
|
-
|
|
4739
|
-
**Returns:** Push notification stores and actions
|
|
4740
|
-
|
|
4741
4630
|
#### `createRouterStores()`
|
|
4742
4631
|
|
|
4743
4632
|
Create router stores from the router in context.
|
|
@@ -4980,30 +4869,144 @@ const RoutedView: LegacyComponentType
|
|
|
4980
4869
|
const SessionReady: LegacyComponentType
|
|
4981
4870
|
```
|
|
4982
4871
|
|
|
4983
|
-
#### `
|
|
4872
|
+
#### `resetAIModelsCache` _(deprecated)_
|
|
4873
|
+
|
|
4874
|
+
> **Deprecated:** Import resetAIModelsCache from `@molecule/app-svelte/ai-models`.
|
|
4875
|
+
|
|
4876
|
+
Compatibility alias for `resetAIModelsCache`.
|
|
4877
|
+
|
|
4878
|
+
```typescript
|
|
4879
|
+
const resetAIModelsCache: typeof feature.resetAIModelsCache
|
|
4880
|
+
```
|
|
4881
|
+
|
|
4882
|
+
#### `useAIModels` _(deprecated)_
|
|
4883
|
+
|
|
4884
|
+
> **Deprecated:** Import useAIModels from `@molecule/app-svelte/ai-models`.
|
|
4885
|
+
|
|
4886
|
+
Compatibility alias for `useAIModels`.
|
|
4887
|
+
|
|
4888
|
+
```typescript
|
|
4889
|
+
const useAIModels: typeof feature.useAIModels
|
|
4890
|
+
```
|
|
4891
|
+
|
|
4892
|
+
#### `ChatProvider` _(deprecated)_
|
|
4984
4893
|
|
|
4985
|
-
|
|
4894
|
+
> **Deprecated:** Import ChatProvider from `@molecule/app-svelte/chat`.
|
|
4895
|
+
|
|
4896
|
+
Compatibility alias for `ChatProvider`.
|
|
4986
4897
|
|
|
4987
4898
|
```typescript
|
|
4988
|
-
const
|
|
4899
|
+
const ChatProvider: typeof feature.ChatProvider
|
|
4989
4900
|
```
|
|
4990
4901
|
|
|
4991
|
-
#### `
|
|
4902
|
+
#### `DEFAULT_AGENT_IDENTITY` _(deprecated)_
|
|
4903
|
+
|
|
4904
|
+
> **Deprecated:** Import DEFAULT_AGENT_IDENTITY from `@molecule/app-ai-chat`.
|
|
4992
4905
|
|
|
4993
|
-
|
|
4906
|
+
Compatibility alias for `DEFAULT_AGENT_IDENTITY`.
|
|
4994
4907
|
|
|
4995
4908
|
```typescript
|
|
4996
|
-
const
|
|
4909
|
+
const DEFAULT_AGENT_IDENTITY: typeof feature.DEFAULT_AGENT_IDENTITY
|
|
4997
4910
|
```
|
|
4998
4911
|
|
|
4999
|
-
#### `
|
|
4912
|
+
#### `DEFAULT_AGENT_NAME` _(deprecated)_
|
|
4913
|
+
|
|
4914
|
+
> **Deprecated:** Import DEFAULT_AGENT_NAME from `@molecule/app-ai-chat`.
|
|
4915
|
+
|
|
4916
|
+
Compatibility alias for `DEFAULT_AGENT_NAME`.
|
|
4917
|
+
|
|
4918
|
+
```typescript
|
|
4919
|
+
const DEFAULT_AGENT_NAME: typeof feature.DEFAULT_AGENT_NAME
|
|
4920
|
+
```
|
|
4921
|
+
|
|
4922
|
+
#### `DEFAULT_PRODUCT_NAME` _(deprecated)_
|
|
4923
|
+
|
|
4924
|
+
> **Deprecated:** Import DEFAULT_PRODUCT_NAME from `@molecule/app-ai-chat`.
|
|
4925
|
+
|
|
4926
|
+
Compatibility alias for `DEFAULT_PRODUCT_NAME`.
|
|
4927
|
+
|
|
4928
|
+
```typescript
|
|
4929
|
+
const DEFAULT_PRODUCT_NAME: typeof feature.DEFAULT_PRODUCT_NAME
|
|
4930
|
+
```
|
|
4931
|
+
|
|
4932
|
+
#### `convergeHistory` _(deprecated)_
|
|
4933
|
+
|
|
4934
|
+
> **Deprecated:** Import convergeHistory from `@molecule/app-svelte/chat`.
|
|
4935
|
+
|
|
4936
|
+
Compatibility alias for `convergeHistory`.
|
|
4937
|
+
|
|
4938
|
+
```typescript
|
|
4939
|
+
const convergeHistory: typeof feature.convergeHistory
|
|
4940
|
+
```
|
|
4941
|
+
|
|
4942
|
+
#### `localOnlyMessages` _(deprecated)_
|
|
4943
|
+
|
|
4944
|
+
> **Deprecated:** Import localOnlyMessages from `@molecule/app-svelte/chat`.
|
|
5000
4945
|
|
|
5001
|
-
|
|
5002
|
-
{@link DEFAULT_PRODUCT_NAME}) the shared packages use until a consuming app
|
|
5003
|
-
passes its own.
|
|
4946
|
+
Compatibility alias for `localOnlyMessages`.
|
|
5004
4947
|
|
|
5005
4948
|
```typescript
|
|
5006
|
-
const
|
|
4949
|
+
const localOnlyMessages: typeof feature.localOnlyMessages
|
|
4950
|
+
```
|
|
4951
|
+
|
|
4952
|
+
#### `resetChatStoresForTests` _(deprecated)_
|
|
4953
|
+
|
|
4954
|
+
> **Deprecated:** Import resetChatStoresForTests from `@molecule/app-svelte/chat`.
|
|
4955
|
+
|
|
4956
|
+
Compatibility alias for `resetChatStoresForTests`.
|
|
4957
|
+
|
|
4958
|
+
```typescript
|
|
4959
|
+
const resetChatStoresForTests: typeof feature.resetChatStoresForTests
|
|
4960
|
+
```
|
|
4961
|
+
|
|
4962
|
+
#### `setChatContext` _(deprecated)_
|
|
4963
|
+
|
|
4964
|
+
> **Deprecated:** Import setChatContext from `@molecule/app-svelte/chat`.
|
|
4965
|
+
|
|
4966
|
+
Compatibility alias for `setChatContext`.
|
|
4967
|
+
|
|
4968
|
+
```typescript
|
|
4969
|
+
const setChatContext: typeof feature.setChatContext
|
|
4970
|
+
```
|
|
4971
|
+
|
|
4972
|
+
#### `useChat` _(deprecated)_
|
|
4973
|
+
|
|
4974
|
+
> **Deprecated:** Import useChat from `@molecule/app-svelte/chat`.
|
|
4975
|
+
|
|
4976
|
+
Compatibility alias for `useChat`.
|
|
4977
|
+
|
|
4978
|
+
```typescript
|
|
4979
|
+
const useChat: typeof feature.useChat
|
|
4980
|
+
```
|
|
4981
|
+
|
|
4982
|
+
#### `useChatProvider` _(deprecated)_
|
|
4983
|
+
|
|
4984
|
+
> **Deprecated:** Import useChatProvider from `@molecule/app-svelte/chat`.
|
|
4985
|
+
|
|
4986
|
+
Compatibility alias for `useChatProvider`.
|
|
4987
|
+
|
|
4988
|
+
```typescript
|
|
4989
|
+
const useChatProvider: typeof feature.useChatProvider
|
|
4990
|
+
```
|
|
4991
|
+
|
|
4992
|
+
#### `createPushStores` _(deprecated)_
|
|
4993
|
+
|
|
4994
|
+
> **Deprecated:** Import createPushStores from `@molecule/app-svelte/push`.
|
|
4995
|
+
|
|
4996
|
+
Compatibility alias for `createPushStores`.
|
|
4997
|
+
|
|
4998
|
+
```typescript
|
|
4999
|
+
const createPushStores: typeof feature.createPushStores
|
|
5000
|
+
```
|
|
5001
|
+
|
|
5002
|
+
#### `usePush` _(deprecated)_
|
|
5003
|
+
|
|
5004
|
+
> **Deprecated:** Import usePush from `@molecule/app-svelte/push`.
|
|
5005
|
+
|
|
5006
|
+
Compatibility alias for `usePush`.
|
|
5007
|
+
|
|
5008
|
+
```typescript
|
|
5009
|
+
const usePush: typeof feature.usePush
|
|
5007
5010
|
```
|
|
5008
5011
|
|
|
5009
5012
|
#### `MoleculeProvider`
|
|
@@ -5086,14 +5089,6 @@ Provider for logging, as `@molecule/app-react`'s `LoggerProvider`.
|
|
|
5086
5089
|
const LoggerProvider: LegacyComponentType
|
|
5087
5090
|
```
|
|
5088
5091
|
|
|
5089
|
-
#### `ChatProvider`
|
|
5090
|
-
|
|
5091
|
-
Provider for AI chat, as `@molecule/app-react`'s `ChatProvider`.
|
|
5092
|
-
|
|
5093
|
-
```typescript
|
|
5094
|
-
const ChatProvider: LegacyComponentType
|
|
5095
|
-
```
|
|
5096
|
-
|
|
5097
5092
|
#### `WorkspaceProvider`
|
|
5098
5093
|
|
|
5099
5094
|
Provider for the IDE workspace, as `@molecule/app-react`'s `WorkspaceProvider`.
|
|
@@ -5118,43 +5113,6 @@ Provider for the live preview, as `@molecule/app-react`'s `PreviewProvider`.
|
|
|
5118
5113
|
const PreviewProvider: LegacyComponentType
|
|
5119
5114
|
```
|
|
5120
5115
|
|
|
5121
|
-
#### `convergeHistory`
|
|
5122
|
-
|
|
5123
|
-
Converges the local transcript with authoritative server history. See
|
|
5124
|
-
`convergeHistory` in `@molecule/app-ai-chat`.
|
|
5125
|
-
|
|
5126
|
-
```typescript
|
|
5127
|
-
const convergeHistory: typeof coreConvergeHistory
|
|
5128
|
-
```
|
|
5129
|
-
|
|
5130
|
-
- `prev` — The local transcript.
|
|
5131
|
-
- `history` — The server's history.
|
|
5132
|
-
|
|
5133
|
-
**Returns:** The converged transcript.
|
|
5134
|
-
|
|
5135
|
-
#### `localOnlyMessages`
|
|
5136
|
-
|
|
5137
|
-
The local messages server history does not carry yet. See
|
|
5138
|
-
`localOnlyMessages` in `@molecule/app-ai-chat`.
|
|
5139
|
-
|
|
5140
|
-
```typescript
|
|
5141
|
-
const localOnlyMessages: typeof coreLocalOnlyMessages
|
|
5142
|
-
```
|
|
5143
|
-
|
|
5144
|
-
- `prev` — The local transcript.
|
|
5145
|
-
- `history` — The server's history.
|
|
5146
|
-
|
|
5147
|
-
**Returns:** The local-only messages.
|
|
5148
|
-
|
|
5149
|
-
#### `resetChatStoresForTests`
|
|
5150
|
-
|
|
5151
|
-
Clears every chat session store. Tests only: each test starts with no
|
|
5152
|
-
transcript, queue or stream left by the previous one.
|
|
5153
|
-
|
|
5154
|
-
```typescript
|
|
5155
|
-
const resetChatStoresForTests: typeof coreResetChatStoresForTests
|
|
5156
|
-
```
|
|
5157
|
-
|
|
5158
5116
|
## Injection Notes
|
|
5159
5117
|
|
|
5160
5118
|
### Requirements
|
|
@@ -5168,8 +5126,8 @@ Peer dependencies:
|
|
|
5168
5126
|
- `@molecule/app-device` ^1.0.1
|
|
5169
5127
|
- `@molecule/app-forms` ^2.4.0
|
|
5170
5128
|
- `@molecule/app-http` ^1.0.1
|
|
5171
|
-
- `@molecule/app-i18n` ^1.0
|
|
5172
|
-
- `@molecule/app-ide` ^1.0
|
|
5129
|
+
- `@molecule/app-i18n` ^1.4.0
|
|
5130
|
+
- `@molecule/app-ide` ^1.1.0 _(optional)_
|
|
5173
5131
|
- `@molecule/app-live-preview` ^1.0.1 _(optional)_
|
|
5174
5132
|
- `@molecule/app-logger` ^1.0.1
|
|
5175
5133
|
- `@molecule/app-platform` ^1.0.1
|
|
@@ -5178,7 +5136,7 @@ Peer dependencies:
|
|
|
5178
5136
|
- `@molecule/app-routing-sveltekit` >=3.0.0 _(optional)_
|
|
5179
5137
|
- `@molecule/app-state` ^1.2.0
|
|
5180
5138
|
- `@molecule/app-storage` ^1.1.1
|
|
5181
|
-
- `@molecule/app-theme` ^1.0.
|
|
5139
|
+
- `@molecule/app-theme` ^1.0.2
|
|
5182
5140
|
- `@molecule/app-ui` ^1.0.1
|
|
5183
5141
|
- `@molecule/app-utilities` ^1.0.1
|
|
5184
5142
|
- `@molecule/app-version` ^1.0.1
|
|
@@ -5226,6 +5184,10 @@ Peer dependencies:
|
|
|
5226
5184
|
placed it. Nothing renders on the server; `target` replaces the body and `null` renders
|
|
5227
5185
|
nothing until a target exists.
|
|
5228
5186
|
|
|
5187
|
+
Use `@molecule/app-svelte/chat`, `@molecule/app-svelte/ai-models`, and
|
|
5188
|
+
`@molecule/app-svelte/push` for those features. The corresponding exports at the
|
|
5189
|
+
package root are deprecated.
|
|
5190
|
+
|
|
5229
5191
|
## Translations
|
|
5230
5192
|
|
|
5231
5193
|
Translation strings are provided by `@molecule/app-locales-svelte`.
|