akanjs 3.2.0-rc.11 → 3.2.0-rc.12

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 (91) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/base/base.ts +2 -1
  3. package/client/clientRuntime.ts +1 -0
  4. package/client/cn.ts +2 -2
  5. package/client/frameConfig.ts +1 -0
  6. package/client/index.ts +248 -26
  7. package/client/locale.ts +1 -0
  8. package/client/rscNavigation.ts +1 -0
  9. package/common/CodeTranscript.ts +1 -1
  10. package/constant/constantRegistry.ts +4 -8
  11. package/constant/crystalize.ts +1 -2
  12. package/constant/getDefault.ts +1 -1
  13. package/constant/immerify.ts +1 -1
  14. package/constant/index.ts +78 -21
  15. package/constant/purify.ts +4 -9
  16. package/constant/serialize.ts +4 -2
  17. package/constant/types.ts +1 -0
  18. package/constant/via.ts +1 -2
  19. package/dictionary/locale.ts +1 -1
  20. package/document/databaseRegistry.ts +2 -1
  21. package/document/documentSchema.ts +1 -0
  22. package/document/filterMeta.ts +4 -1
  23. package/document/into.ts +2 -1
  24. package/document/loaderInfo.ts +2 -1
  25. package/document/types.ts +1 -1
  26. package/fetch/client/fetchClient.ts +3 -3
  27. package/fetch/client/httpClient.ts +2 -0
  28. package/fetch/client/wsClient.ts +1 -0
  29. package/package.json +1 -1
  30. package/server/console.ts +3 -2
  31. package/server/index.ts +257 -17
  32. package/server/logging/logControlSocket.ts +42 -3
  33. package/server/rscClient.tsx +14 -8
  34. package/server/sitemap.ts +1 -0
  35. package/service/injectInfo.ts +2 -1
  36. package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +3 -3
  37. package/service/predefinedAdaptor/sql/driver/postgres.ts +1 -1
  38. package/service/serviceRegistry.ts +1 -0
  39. package/signal/index.ts +298 -30
  40. package/signal/resolveFieldContext.ts +34 -0
  41. package/signal/serializer/fetch.serializer.ts +7 -10
  42. package/signal/signalContext.ts +4 -31
  43. package/signal/trace.ts +3 -0
  44. package/store/baseSt.ts +1 -0
  45. package/store/index.ts +125 -18
  46. package/store/stateBuilder.ts +2 -0
  47. package/types/base/base.d.ts +2 -1
  48. package/types/client/clientRuntime.d.ts +1 -0
  49. package/types/client/cn.d.ts +2 -2
  50. package/types/client/frameConfig.d.ts +1 -0
  51. package/types/client/index.d.ts +25 -26
  52. package/types/client/locale.d.ts +1 -0
  53. package/types/client/rscNavigation.d.ts +1 -0
  54. package/types/common/CodeTranscript.d.ts +1 -1
  55. package/types/constant/constantRegistry.d.ts +3 -1
  56. package/types/constant/crystalize.d.ts +1 -1
  57. package/types/constant/getDefault.d.ts +1 -1
  58. package/types/constant/immerify.d.ts +1 -1
  59. package/types/constant/index.d.ts +21 -21
  60. package/types/constant/purify.d.ts +2 -1
  61. package/types/constant/serialize.d.ts +1 -1
  62. package/types/constant/types.d.ts +1 -0
  63. package/types/dictionary/base.dictionary.d.ts +1 -1
  64. package/types/dictionary/dictionary.d.ts +8 -8
  65. package/types/dictionary/locale.d.ts +1 -1
  66. package/types/document/databaseRegistry.d.ts +2 -1
  67. package/types/document/documentSchema.d.ts +1 -0
  68. package/types/document/filterMeta.d.ts +4 -1
  69. package/types/document/into.d.ts +1 -1
  70. package/types/document/loaderInfo.d.ts +2 -1
  71. package/types/document/types.d.ts +1 -1
  72. package/types/fetch/client/fetchClient.d.ts +2 -1
  73. package/types/fetch/client/httpClient.d.ts +2 -0
  74. package/types/fetch/client/wsClient.d.ts +1 -0
  75. package/types/server/console.d.ts +3 -2
  76. package/types/server/index.d.ts +17 -17
  77. package/types/server/sitemap.d.ts +1 -0
  78. package/types/service/injectInfo.d.ts +2 -1
  79. package/types/service/predefinedAdaptor/sql/driver/bunSqlite.d.ts +1 -14
  80. package/types/service/predefinedAdaptor/sql/driver/postgres.d.ts +0 -8
  81. package/types/service/serviceRegistry.d.ts +1 -0
  82. package/types/signal/index.d.ts +31 -30
  83. package/types/signal/resolveFieldContext.d.ts +15 -0
  84. package/types/signal/serializer/fetch.serializer.d.ts +3 -1
  85. package/types/signal/signalContext.d.ts +1 -13
  86. package/types/signal/trace.d.ts +3 -0
  87. package/types/store/baseSt.d.ts +1 -0
  88. package/types/store/index.d.ts +17 -17
  89. package/types/store/stateBuilder.d.ts +2 -0
  90. package/types/ui/Reference/origin.d.ts +1 -0
  91. package/ui/Reference/origin.ts +1 -0
package/CHANGELOG.md CHANGED
@@ -339,11 +339,14 @@
339
339
  `akan lint`'s `akan.service.call-in-loop` fix and the agent guidelines name `create<Model>Many` as the way to write a set once.
340
340
 
341
341
  - 73f8830: An error an endpoint declares in `errors` and throws with that status under 500 is now logged at debug, as a returned call is, rather than as an ERROR line. A public endpoint that answers a bad token with a declared 404 no longer sends every probe, token scan or mistyped webhook URL to real-error alerts. Undeclared errors, a declared key thrown with another status, and every 5xx still log as errors.
342
+ - 5691327: `setErrorConstructor` on `FetchClient`, `HttpClient` and `WsClient`, `HttpClientOptions.ErrorCls` and `FetchClient.build`'s `Err` option are deprecated. Every dictionary's `Err` is `akanjs/common`'s `Err`, which a restored error already is, so they change nothing. They keep working. A generated `lib/sig.ts` no longer calls `fetch.setErrorConstructor(Err)`, and a generated `lib/useClient.ts` no longer passes `{ Err: pageProto.Err }`; `akan sync` rewrites both. No upgrade step is needed.
342
343
  - 958f175: A dev server now answers only the host names it can be reached under locally. Under `akan start`, or on a local dev runtime, with `AKAN_ALLOWED_HOSTS` unset, it answers `localhost` and `*.localhost`, IPv4 and IPv6 addresses (a phone on the LAN included), and the app's own hosts: its route domains and `<app>-<environment>.<serveDomain>`. A request under any other `Host`, the HMR socket and the `/_akan/*` dev routes included, gets a 403 that names `AKAN_ALLOWED_HOSTS`. To open a dev server under another name, such as a container's service name or a forwarded editor URL, list every `host:port` it should answer there; a set list replaces the default, as before. A deployed server with the variable unset still answers every `Host`.
343
344
 
344
345
  `akan tunnel` and `akan start --share` keep working: the tunnel agent now dials the local app under the app's own address and leaves the public host name in `x-forwarded-host`, which is where the app already reads it. A redirect a page raises during SSR now sends a same-origin target as a relative `Location`, so a tunnel or proxy caller lands on the host it used rather than the one the server was dialed as; a target on another origin stays absolute.
345
346
 
346
347
  - 9f30e93: A dev page no longer loses its styles after a stylesheet change arrives together with a pages rebuild. The most common case was the first save after `akan start` released its builder for being idle: the waking builder announces a new pages bundle and a new stylesheet at once, and the SSR worker that had started importing the bundle put the old stylesheet back when the import finished. Pages kept linking that stylesheet, whose file the dev server had already deleted, so they rendered unstyled with a 404 until `akan start` was restarted. The same update also reaches an SSR worker that is still booting after a recycle, which used to keep the stylesheet it was started with.
348
+ - ad09fac: Exports that nothing in akanjs, its tests or a consumer workspace uses are now marked. Thirteen that no code calls at all are `@deprecated` and leave in a later minor: `MAX_INT` (write `2 ** 31 - 1`), `isFilterModel` (`getFilterMeta(ref, { allowEmpty: true }) !== undefined`), `setFilterInfoByKey` (declare the query with `from(model, (filter) => …)`), `getDefaultSchemaOptions` (`new DocumentSchema()`), `runWithTrace` (`runTraced`, only where the caller owns the trace, since it finalizes it), `traceDbQuery` (`getCurrentTrace()?.countDbQuery(ms)`), `isSitemapPath` (`getSitemapBasePath(pathname, basePaths, headerBasePath) !== undefined`), `useRscNavigation` (`navigateRsc`, `clearRscNavigationCache`, `isRscNavigationFromCache`), `getSearchParam` and `getBaseSearchParam` (read `searchParams[key]`, taking the first value of an array), `dictionaryContext`, `groupByOwner` and `ServiceRegistry`. Eleven that only their own file uses, such as the console helpers in `akanjs/server` and `getClientRuntime` in `akanjs/client`, are `@internal`: they are not meant for use outside akanjs and may stop being exported in a later minor.
349
+ - ae045d8: No non-test file in an `akanjs` facet imports its own facet's barrel any more; each imports the sibling file that declares what it uses. Four value imports in `constant/` went through its barrel, so loading one of those files loaded the whole facet first. `ResolveFieldContext` moved to `signal/resolveFieldContext.ts`, and `akanjs/signal` still exports it. Every public import is unchanged.
347
350
  - d9eaacc: A query takes `signal` in its `FetchPolicy`, joined with its deadline: an abort rejects the call with the signal's reason, stops the request, and ends the retries, including one waiting between tries. A signal already aborted sends nothing, over HTTP, inside a server render or through an MCP App view's host. A signal from `AbortSignal.timeout` rejects with the slow-server error (`base.error.gatewayTimeout`, 408), as the query's own deadline does. A mutation ignores it, since one already sent may have run. In an MCP App view an abort, or the query's own deadline running out, also asks the host to cancel the call it relayed (`notifications/cancelled`); a mutation that runs out of time is only given up on. A custom `FetchBridge` receives the signal as `signal`.
348
351
 
349
352
  A slice's list loads (`init`, `refresh`, `setPage`, `setLimit`, `setSort`, `setQueryArgs`, `loadMore`) abort the request a newer load of the same slice supersedes, instead of letting it run to the end and dropping its answer. The superseded load writes nothing and shows no error, and so does one aborted by a `signal` its caller passed, which resolves; `init` still applies its `default` at once unless the signal was already aborted, and an `init` aborted mid-flight, or one with nothing to change, leaves a loaded-more list whole, so the next refresh still reloads every row shown. A caller's `AbortSignal.timeout` is the exception: the load rejects with the slow-server error and shows it, as a query does. A store action that rejects with the abort of a signal it was given no longer shows an error toast, whatever reason that signal was aborted with, except an app or server error (one with a dictionary key or a status) and a timeout, which still show.
@@ -433,6 +436,8 @@
433
436
  - **Native and CSR boots keep their locale paths.** Their routes match on the `/:lang` segment, so a `?csr=true` request without one is redirected to the default locale's prefixed path. An Android app link limited to a basePath lists the default locale's unprefixed path as well as its prefixed one, so links from before the switch still open the app.
434
437
  - `akan preview` keeps an unprefixed path unprefixed under `"as-needed"`, except with `--csr`. The value reaches bundles as `AKAN_PUBLIC_LOCALE_PREFIX`, and the image env carries it when it is `"as-needed"`. `LocalePath` (`akanjs/common`) and a fourth `localePrefix` argument to `getPathInfo` build the same URLs in app code.
435
438
 
439
+ - dfc3564: A server stopped while its log control socket was still starting no longer leaves that socket listening. `akan logs` then found a socket nothing owned, and it kept serving a closed log hub until the process exited. Starts and stops on one control socket path now take turns, so a start whose log hub was closed meanwhile binds nothing or closes what it bound before a restart's open looks, and the restarted server gets its own socket. A socket that fails after binding is closed before the error surfaces. Stopping a control socket that never bound no longer unlinks the live socket of another server in the same runtime folder.
440
+ - d12f556: `akanjs/signal`, `akanjs/client`, `akanjs/server`, `akanjs/constant` and `akanjs/store` now list every export by name instead of re-exporting whole files with `export *`. They export exactly the names they did before. A new export in one of those facets' files is no longer exported from `akanjs/<facet>` until its facet's `index.ts` names it. Files under `server/` and `client/native/` stay importable by their own subpath, as before.
436
441
  - 9b5bcee: Every SSR page now loads 72K less framework JavaScript (22K less after Brotli).
437
442
 
438
443
  - **`akan build` narrows the vendor entries to the names the page code imports.** The `akanjs/*` and `tailwind-merge` entries in the page's import map used to re-export a whole facet. Each one now exports only the names the built route bundles import, lazy chunks included. On the minimal app, the framework floor, meaning the runtime plus the vendor entries every page loads, drops from 630.2K raw / 189.4K br to 558.4K raw / 167.4K br. `akan start` keeps whole facets, so a newly saved import never misses a name.
@@ -526,6 +531,7 @@
526
531
  - `invalidConfig`: a `transformEnv` callback returns something other than the env object.
527
532
  - `notRegistered`: no WebSocket adaptor is registered.
528
533
 
534
+ - b0ccf6f: The browser's RSC client now throws coded errors instead of bare `Error`s, so a caller can branch on `error.code`. A route the server has no page for is `routeNotFound` (404), as a missing WebSocket route already is. A response with no RSC payload is `rscFetchFailed` (502). A patch missing its parts, or a full fallback that answers with a patch, is `invalidRscResponse`, the code `rscClientFetch` already throws for the latter. The redirect marker, which only a log line receives, is `rscRedirectStarted`. Each error keeps its `name` and its message, except the fallback's message, which is now `[rscClient] fallback is a patch`. The error-code reference lists the new codes.
529
535
  - 9055634: Partial RSC commit can now patch a real page, and it patches cleanly. It is still off by default behind `AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`. With the flag on:
530
536
 
531
537
  - **Which pages render their head through `AkanRouteHead`.** Every page whose head is plain `title`, `meta` and `link` tags now renders it through a client component instead of plain head tags. That way any page can be the one a patch starts from. Patches still only land on pages that set `.config({ rscPatchHeadSafe: true })`.
package/base/base.ts CHANGED
@@ -1,5 +1,6 @@
1
- import type { CLIENT_VALUE, Cls, DEFAULT_VALUE, PURIFIED_VALUE, SERVER_VALUE } from ".";
2
1
  import { Float, Int } from "./primitiveRegistry";
2
+ import type { CLIENT_VALUE, DEFAULT_VALUE, PURIFIED_VALUE, SERVER_VALUE } from "./symbols";
3
+ import type { Cls } from "./types";
3
4
 
4
5
  class EnumPrototype {}
5
6
  export type EnumInstance<RefName extends string = string, T = string | number> = Cls<
@@ -98,6 +98,7 @@ export const registerClientRuntime = <Runtime>(
98
98
  return runtime;
99
99
  };
100
100
 
101
+ /** @internal */
101
102
  export const getClientRuntime = () => {
102
103
  if (!state.runtime) throw missingRuntimeError();
103
104
  return state.runtime;
package/client/cn.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type ClassNameValue, extendTailwindMerge } from "tailwind-merge";
2
2
 
3
- /** Registered with tailwind-merge so `cn("bg-primary", "bg-open")` resolves to `"bg-open"` instead of keeping both. */
3
+ /** @internal Registered with tailwind-merge so `cn("bg-primary", "bg-open")` resolves to `"bg-open"` instead of keeping both. */
4
4
  export const colorTokens = [
5
5
  "background",
6
6
  "foreground",
@@ -33,7 +33,7 @@ export const colorTokens = [
33
33
  "ring",
34
34
  ];
35
35
 
36
- /** `--radius-box` / `--radius-field`; unregistered, `cn("rounded-field", "rounded-full")` would keep both. */
36
+ /** @internal `--radius-box` / `--radius-field`; unregistered, `cn("rounded-field", "rounded-full")` would keep both. */
37
37
  export const radiusTokens = ["box", "field"];
38
38
 
39
39
  const twMerge = extendTailwindMerge({
@@ -91,6 +91,7 @@ const isValidInsetValue = (value: unknown): value is NonNullable<PageConfig["top
91
91
  return Object.entries(value).every(([key, px]) => responsiveInsetKeys.has(key) && isInsetPx(px));
92
92
  };
93
93
 
94
+ /** @internal */
94
95
  export const isResponsiveInset = (inset: PageConfig["topInset"]): inset is ResponsiveInset => isRecord(inset);
95
96
 
96
97
  /** The inset at each breakpoint, each one the nearest declared value at or below it. */
package/client/index.ts CHANGED
@@ -1,32 +1,254 @@
1
- export * from "./clientRuntime";
2
- export * from "./cn";
3
- export * from "./cookie";
4
- export * from "./createFont";
5
- export * from "./csrLocation";
6
- export * from "./csrTypes";
7
- export * from "./decorators";
8
- export * from "./device";
9
- export * from "./frameConfig";
10
- export * from "./href";
11
- export * from "./locale";
12
- export * from "./makePageProto";
13
- export * from "./mcpView";
14
- export * from "./nativeHost";
1
+ export {
2
+ type ClientRuntime,
3
+ Err,
4
+ fetch,
5
+ getClientRuntime,
6
+ isClientRuntimeRegistered,
7
+ msg,
8
+ registerClientRuntime,
9
+ sig,
10
+ usePage,
11
+ } from "./clientRuntime";
12
+ export { cn, colorTokens, radiusTokens } from "./cn";
13
+ export {
14
+ authTokenKey,
15
+ cookieJar,
16
+ cookies,
17
+ type GetOption,
18
+ getAccount,
19
+ getAuthToken,
20
+ getCookie,
21
+ getHeader,
22
+ getSessionClaims,
23
+ getStoredAuthToken,
24
+ headers,
25
+ initAuth,
26
+ removeCookie,
27
+ resetAuth,
28
+ setAuth,
29
+ setCookie,
30
+ } from "./cookie";
31
+ export { createFont, Inter, Nanum_Gothic_Coding, Noto_Sans_KR, Roboto } from "./createFont";
32
+ export { CsrLocation, csrLocation } from "./csrLocation";
33
+ export {
34
+ type AkanHeadSnapshotNode,
35
+ type AkanHeadSnapshotV1,
36
+ type AnimatedDivProps,
37
+ type ContainerTransition,
38
+ type CsrContextType,
39
+ type CsrNavigationKind,
40
+ type CsrNavigationPhase,
41
+ type CsrPageType,
42
+ type CsrStackAccount,
43
+ type CsrStackEntry,
44
+ type CsrState,
45
+ type CsrTransitionStyles,
46
+ csrContext,
47
+ DEFAULT_BOTTOM_INSET,
48
+ DEFAULT_TOP_INSET,
49
+ type FrameContentViewportState,
50
+ type FrameLayer,
51
+ type FrameLayerZIndex,
52
+ type FrameLayoutState,
53
+ type FramePlatformProfile,
54
+ type FrameSlotBucket,
55
+ type FrameSlotRegistration,
56
+ type FrameSlotRole,
57
+ type FrameSlotScope,
58
+ type FrameSlotType,
59
+ type FrameSnapshot,
60
+ type FrameViewportState,
61
+ type GenerateHead,
62
+ type Head,
63
+ type HeadProps,
64
+ type History,
65
+ type KeyboardAccessoryFrameState,
66
+ type KeyboardFrameState,
67
+ type LayoutErrorProps,
68
+ type LayoutErrorRender,
69
+ type LayoutFallbackRoute,
70
+ type LayoutLoadingProps,
71
+ type LayoutLoadingRender,
72
+ type LayoutModule,
73
+ type LayoutNotFoundProps,
74
+ type LayoutNotFoundRender,
75
+ type LayoutProps,
76
+ type LayoutRender,
77
+ type Location,
78
+ type LocationState,
79
+ type NavigationIntent,
80
+ type PageActivity,
81
+ type PageActivityState,
82
+ type PageConfig,
83
+ type PageLoadingProps,
84
+ type PageLoadingRender,
85
+ type PageModule,
86
+ type PageProps,
87
+ type PageRender,
88
+ type PageSafeAreaConfig,
89
+ type PageState,
90
+ type PageTransition,
91
+ type PathContextType,
92
+ type PathRoute,
93
+ pageActivityContext,
94
+ pathContext,
95
+ type ResolvedHead,
96
+ type ResolveHead,
97
+ type ResolveHeadResult,
98
+ type ResponsiveInset,
99
+ type Route,
100
+ type RouteGuard,
101
+ type RouteGuardProps,
102
+ type RouteGuide,
103
+ type RouteModule,
104
+ type RouteRender,
105
+ type RouterProps,
106
+ type RouteState,
107
+ type RouteViewport,
108
+ type SafeAreaTransition,
109
+ type SsrRenderMode,
110
+ type TransitionAction,
111
+ type TransitionActionContext,
112
+ type TransitionPlan,
113
+ type TransitionStyle,
114
+ type UseCsrTransition,
115
+ useCsr,
116
+ usePathCtx,
117
+ type WebAppManifest,
118
+ type WebAppManifestIcon,
119
+ } from "./csrTypes";
120
+ export { Toast } from "./decorators";
121
+ export { Device, debugFrame, isMobileDevice, isNativeTarget } from "./device";
122
+ export {
123
+ breakpointQuery,
124
+ type DevicePlatform,
125
+ defaultPageState,
126
+ getExplicitPageConfigKeys,
127
+ type InsetBreakpoint,
128
+ insetAt,
129
+ insetBreakpoints,
130
+ insetsByBreakpoint,
131
+ isResponsiveInset,
132
+ mergePageConfigs,
133
+ type ResolvePageStateOptions,
134
+ readCssSafeAreaInsets,
135
+ resolvePageState,
136
+ type SafeAreaInsets,
137
+ type TailwindBreakpoint,
138
+ validatePageConfig,
139
+ } from "./frameConfig";
140
+ export { Href } from "./href";
141
+ export { dictionaryContext } from "./locale";
142
+ export {
143
+ type ErrPayload,
144
+ makePageProto,
145
+ type PageErrConstructor,
146
+ type PageErrInstance,
147
+ type TransMessageOption,
148
+ } from "./makePageProto";
149
+ export { isMcpView } from "./mcpView";
150
+ export { desktopPlatform, isNativeApp, isNativeShell, nativePlatform, openExternalUrl } from "./nativeHost";
15
151
  export {
16
152
  type NavigationAttempt,
17
153
  type NavigationGuard,
18
154
  type NavigationKind,
19
155
  NavigationRefused,
20
156
  } from "./navigationGuards";
21
- export * from "./resolveServerUrl";
22
- export * from "./route";
23
- export * from "./router";
24
- export * from "./rscNavigation";
25
- export * from "./sharedContext";
26
- export * from "./storage";
27
- export * from "./transitionTypes";
28
- export * from "./translator";
29
- export * from "./types";
30
- export * from "./useClient";
31
- export * from "./viewportMeta";
32
- export * from "./webManifest";
157
+ export { resolveServerUrl } from "./resolveServerUrl";
158
+ export {
159
+ assertGuardOnChain,
160
+ isRouteDefinition,
161
+ LayoutDefinition,
162
+ type LayoutExtra,
163
+ layout,
164
+ PageDefinition,
165
+ page,
166
+ type ResolvedRouteModule,
167
+ type ResolveRouteModuleOption,
168
+ RootLayoutDefinition,
169
+ RouteArgError,
170
+ type RouteArgInfo,
171
+ type RouteArgInput,
172
+ type RouteArgOption,
173
+ RouteArgPending,
174
+ type RouteArgResolveOption,
175
+ type RouteArgsShape,
176
+ type RouteArgType,
177
+ type RouteArgValue,
178
+ type RouteBaseArgs,
179
+ RouteDefinition,
180
+ RouteGuards,
181
+ RouteHead,
182
+ type RouteKind,
183
+ type RouteModuleSource,
184
+ type RoutePromptArgument,
185
+ type RoutePromptMeta,
186
+ type RouteSearchType,
187
+ resolveRouteModule,
188
+ rootLayout,
189
+ routeArgsMarker,
190
+ routeDefinitionMarker,
191
+ } from "./route";
192
+ export {
193
+ AkanNotFoundError,
194
+ AkanRedirectError,
195
+ type DeepLinkOptions,
196
+ getPathInfo,
197
+ isRouteControl,
198
+ normalizeDeepLinkHref,
199
+ type RedirectMethod,
200
+ type RedirectOptions,
201
+ type RedirectStatus,
202
+ type RouteManifest,
203
+ type RouteOptions,
204
+ type RouterInstance,
205
+ router,
206
+ } from "./router";
207
+ export {
208
+ clearRscNavigationCache,
209
+ isRscNavigationFromCache,
210
+ navigateRsc,
211
+ type PrefetchPriority,
212
+ prefetchRsc,
213
+ refreshRsc,
214
+ useRscNavigation,
215
+ } from "./rscNavigation";
216
+ export { sharedContext } from "./sharedContext";
217
+ export { secretStorage, storage } from "./storage";
218
+ export { type TransitionType, transitionTypes } from "./transitionTypes";
219
+ export { type AllDictionary, type Dictionary, Translator } from "./translator";
220
+ export {
221
+ type DataAction,
222
+ type DataColumn,
223
+ type DataMenu,
224
+ type DataMenuItem,
225
+ type DataTool,
226
+ type Font,
227
+ getFontFaces,
228
+ getFontFallbackName,
229
+ getFontStyles,
230
+ getFontVariableName,
231
+ getOptimizedFontSrc,
232
+ isFontOptimizationEnabled,
233
+ isFontPreloadEnabled,
234
+ loadFonts,
235
+ type MenuItem,
236
+ type ModelDashboardProps,
237
+ type ModelEditProps,
238
+ type ModelInsightProps,
239
+ type ModelProps,
240
+ type ModelsProps,
241
+ type ModelViewProps,
242
+ type ReactFont,
243
+ type ReactFontCategory,
244
+ type ReactFontDeclaration,
245
+ type ReactFontDisplay,
246
+ type ReactFontFace,
247
+ type ReactFontPath,
248
+ type ReactFontStyle,
249
+ type ReactFontSubset,
250
+ type RootLayoutProps,
251
+ type UserMenuItem,
252
+ } from "./types";
253
+ export { type ThemeColorTag, ViewportMeta } from "./viewportMeta";
254
+ export { getWebManifestBasePath, toManifestJson, webManifestHref } from "./webManifest";
package/client/locale.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  "use client";
2
2
  import { sharedContext } from "./sharedContext";
3
3
 
4
+ /** @deprecated Nothing in akanjs provides or reads it; removed in a later minor. */
4
5
  export const dictionaryContext = sharedContext<{ [key: string]: { [key: string]: string } }>("dictionary", {});
@@ -38,6 +38,7 @@ export const refreshRsc = () => {
38
38
  return globalThis.__AKAN_RSC_REFRESH__?.();
39
39
  };
40
40
 
41
+ /** @deprecated Not a hook; import `navigateRsc`, `clearRscNavigationCache` and `isRscNavigationFromCache`. */
41
42
  export const useRscNavigation = () => ({
42
43
  clearCache: clearRscNavigationCache,
43
44
  isFromCache: isRscNavigationFromCache,
@@ -7,7 +7,7 @@ import type {
7
7
  CodeAgentSubagent,
8
8
  CodeAgentToolOutcome,
9
9
  CodeAgentToolSummary,
10
- } from "akanjs/common";
10
+ } from "./codeAgentWire";
11
11
 
12
12
  export type CodeTranscriptPart =
13
13
  | { kind: "user"; id: string; text: string; images?: number }
@@ -8,16 +8,12 @@ import {
8
8
  type PrimitiveValue,
9
9
  } from "akanjs/base";
10
10
  import { capitalize, lowerlize } from "akanjs/common";
11
- import {
12
- type ConstantCls,
13
- type ConstantModelRef,
14
- deserialize,
15
- type FieldObject,
16
- type PurifiedModel,
17
- serialize,
18
- } from ".";
11
+ import type { FieldObject } from "./fieldInfo";
12
+ import type { PurifiedModel } from "./purify";
19
13
  import { RefNameClaims, type RefNameOwner } from "./refNameClaims";
14
+ import { deserialize, serialize } from "./serialize";
20
15
  import type { ConstantType, DefaultOf, DocumentModel, QueryOf } from "./types";
16
+ import type { ConstantCls, ConstantModelRef } from "./via";
21
17
 
22
18
  export class ConstantRegistry {
23
19
  static database = new Map<string, ConstantModel>();
@@ -6,9 +6,8 @@ import {
6
6
  PrimitiveRegistry,
7
7
  type PrimitiveScalar,
8
8
  } from "akanjs/base";
9
-
10
- import type { FieldProps } from ".";
11
9
  import { ConstantRegistry } from "./constantRegistry";
10
+ import type { FieldProps } from "./fieldInfo";
12
11
 
13
12
  export type CrystalizeFunc<Model> = (self: GetStateObject<Model>, isChild?: boolean) => Model;
14
13
  export type Converter = (value: unknown) => unknown;
@@ -1,5 +1,5 @@
1
1
  import { DEFAULT_VALUE, FIELD_META, type PrimitiveScalar } from "akanjs/base";
2
- import type { FieldObject } from ".";
2
+ import type { FieldObject } from "./fieldInfo";
3
3
  import type { DefaultOf } from "./types";
4
4
 
5
5
  export interface DefaultPlan {
@@ -1,7 +1,7 @@
1
1
  import { FIELD_META } from "akanjs/base";
2
2
  import { plainFieldsOf } from "akanjs/common";
3
3
  import { immerable } from "immer";
4
- import type { ConstantModelRef } from ".";
4
+ import type { ConstantModelRef } from "./via";
5
5
 
6
6
  export const immerify = <T extends object>(modelRef: ConstantModelRef, objOrArr: T): T => {
7
7
  if (Array.isArray(objOrArr)) return objOrArr.map((val) => immerify(modelRef, val as object)) as T;
package/constant/index.ts CHANGED
@@ -1,21 +1,78 @@
1
- export * from "./cascadePaths";
2
- export * from "./constantRegistry";
3
- export * from "./crystalize";
4
- export * from "./dateSlot";
5
- export * from "./fieldInfo";
6
- export * from "./fieldPlan";
7
- export * from "./fieldQueryMeta";
8
- export * from "./getDefault";
9
- export * from "./hydrationPlan";
10
- export * from "./immerify";
11
- export * from "./inputParser";
12
- export * from "./invalidInputError";
13
- export * from "./labelOf";
14
- export * from "./mask";
15
- export * from "./purify";
16
- export * from "./requestValue";
17
- export * from "./serialize";
18
- export * from "./textFieldPathSet";
19
- export * from "./textFieldPaths";
20
- export * from "./types";
21
- export * from "./via";
1
+ export { type CascadeAction, CascadePaths, type CascadeWithPath, cascadeActions } from "./cascadePaths";
2
+ export {
3
+ type ConstantModel,
4
+ type ConstantOriginKind,
5
+ ConstantRegistry,
6
+ type ScalarConstantModel,
7
+ } from "./constantRegistry";
8
+ export { type Converter, type CrystalizeFunc, converterOf, crystalize, withSharedInstances } from "./crystalize";
9
+ export { dateAccessorOf, dateSlotOf, isDateSlotField, toDateValue } from "./dateSlot";
10
+ export {
11
+ ConstantField,
12
+ type ConstantFieldKind,
13
+ type ConstantFieldProps,
14
+ type ConstantFieldType,
15
+ type ConstantFieldTypeInput,
16
+ type ExtractFieldInfoObject,
17
+ type FieldBuilder,
18
+ type FieldInfoObject,
19
+ type FieldInfoObjectToFieldObject,
20
+ type FieldObject,
21
+ type FieldPreset,
22
+ type FieldProps,
23
+ type FieldResolver,
24
+ type FieldToValue,
25
+ field,
26
+ fieldPresets,
27
+ type ParamFieldType,
28
+ type PlainTypeToFieldType,
29
+ resolve,
30
+ } from "./fieldInfo";
31
+ export { FieldPlan, type FieldPlanEntry, type FieldPlanKind } from "./fieldPlan";
32
+ export { type FieldQueryMeta, fieldQueryMetaOf } from "./fieldQueryMeta";
33
+ export { type DefaultPlan, defaultPlanOf, freshPrimitiveValue, getDefault } from "./getDefault";
34
+ export { HydrationPlan } from "./hydrationPlan";
35
+ export { immerify } from "./immerify";
36
+ export { InputParser } from "./inputParser";
37
+ export { InvalidInputError } from "./invalidInputError";
38
+ export { labelOf } from "./labelOf";
39
+ export { agentRead, leakingFieldsOf, type MaskModel, mask, maskFieldsOf, stripSecrets } from "./mask";
40
+ export { makePurify, type PurifiedModel, type PurifyFunc, type PurifyFuncV2, type UploadableClientArg } from "./purify";
41
+ export { RequestValue } from "./requestValue";
42
+ export { deserialize, type Serialized, serialize } from "./serialize";
43
+ export { TextFieldPathSet } from "./textFieldPathSet";
44
+ export { TextFieldPaths, type TextFieldRole, textFieldRoles } from "./textFieldPaths";
45
+ export {
46
+ BaseInsight,
47
+ BaseObject,
48
+ type ConstantType,
49
+ DEFAULT_PAGE_SIZE,
50
+ type DefaultOf,
51
+ type DefaultOfSchema,
52
+ type DocumentModel,
53
+ type FieldState,
54
+ type GetPlainObject,
55
+ MAX_INT,
56
+ MAX_PAGE_SIZE,
57
+ type NonFunctionalKeys,
58
+ type ProtoAppInfo,
59
+ type ProtoFile,
60
+ type ProtoLightFile,
61
+ type ProtoPatch,
62
+ type QueryOf,
63
+ Responsive,
64
+ resolvePageLimit,
65
+ resolvePageSkip,
66
+ responsiveWidths,
67
+ type ServerArgModel,
68
+ unsetDate,
69
+ } from "./types";
70
+ export {
71
+ type ConstantCls,
72
+ type ConstantMethods,
73
+ type ConstantModelRef,
74
+ type ConstantStatics,
75
+ type DatabaseConstantStatics,
76
+ type DocumentConstantModelRef,
77
+ via,
78
+ } from "./via";
@@ -12,15 +12,10 @@ import {
12
12
  type PrimitiveScalar,
13
13
  } from "akanjs/base";
14
14
  import { Logger } from "akanjs/common";
15
-
16
- import {
17
- type BaseObject,
18
- type ConstantModelRef,
19
- ConstantRegistry,
20
- type DefaultOf,
21
- type DefaultOfSchema,
22
- type FieldProps,
23
- } from ".";
15
+ import { ConstantRegistry } from "./constantRegistry";
16
+ import type { FieldProps } from "./fieldInfo";
17
+ import type { BaseObject, DefaultOf, DefaultOfSchema } from "./types";
18
+ import type { ConstantModelRef } from "./via";
24
19
 
25
20
  type Purified<O> = O extends BaseObject
26
21
  ? string
@@ -10,9 +10,11 @@ import {
10
10
  PrimitiveRegistry,
11
11
  type PrimitiveScalar,
12
12
  } from "akanjs/base";
13
-
14
- import { type ConstantCls, type ConstantModelRef, ConstantRegistry, type FieldProps, withSharedInstances } from ".";
13
+ import { ConstantRegistry } from "./constantRegistry";
14
+ import { withSharedInstances } from "./crystalize";
15
+ import type { FieldProps } from "./fieldInfo";
15
16
  import { FieldPlan } from "./fieldPlan";
17
+ import type { ConstantCls, ConstantModelRef } from "./via";
16
18
 
17
19
  export type Serialized<O> = O extends (infer V)[]
18
20
  ? Serialized<V>[]
package/constant/types.ts CHANGED
@@ -139,6 +139,7 @@ export type NonFunctionalKeys<T> = {
139
139
  }[keyof T];
140
140
 
141
141
  export const unsetDate = dayjs(new Date("0000"));
142
+ /** @deprecated Unused by akanjs; write the int32 bound `2 ** 31 - 1` where it is meant. */
142
143
  export const MAX_INT = 2147483647;
143
144
 
144
145
  export class Responsive extends enumOf("responsive", ["xl", "lg", "md", "sm", "xs"] as const) {}
package/constant/via.ts CHANGED
@@ -13,8 +13,6 @@ import {
13
13
  } from "akanjs/base";
14
14
  import { applyMixins, plainFieldsOf } from "akanjs/common";
15
15
  import { immerable } from "immer";
16
-
17
- import { getDefault } from ".";
18
16
  import { CascadePaths } from "./cascadePaths";
19
17
  import { ConstantRegistry } from "./constantRegistry";
20
18
  import { dateAccessorOf, isDateSlotField } from "./dateSlot";
@@ -30,6 +28,7 @@ import {
30
28
  resolve,
31
29
  } from "./fieldInfo";
32
30
  import { FieldPlan } from "./fieldPlan";
31
+ import { getDefault } from "./getDefault";
33
32
  import { HydrationPlan } from "./hydrationPlan";
34
33
  import { makePurify, type PurifiedModel, type PurifyFunc } from "./purify";
35
34
  import { TextFieldPaths } from "./textFieldPaths";
@@ -1,7 +1,7 @@
1
1
  import type { GetStateObject, MergedValues } from "akanjs/base";
2
2
  import type { BaseInsight, BaseObject } from "akanjs/constant";
3
3
  import type { SliceInfo, SliceInfoArgNames, SliceInfoRefName } from "akanjs/signal";
4
- import type { ModelDictInfo, ScalarDictInfo, ServiceDictInfo } from ".";
4
+ import type { ModelDictInfo, ScalarDictInfo, ServiceDictInfo } from "./dictInfo";
5
5
  import type { DictArgNames, DictEndpointShape, DictFilterQuery, DictFilterSort, DictSliceShape } from "./dictShape";
6
6
 
7
7
  interface Trans {
@@ -1,5 +1,6 @@
1
1
  import type { ConstantCls } from "akanjs/constant";
2
- import type { DatabaseCls, ExtractQuery, ExtractSort, FilterCls, FilterInstance } from ".";
2
+ import type { DatabaseCls } from "./by";
3
+ import type { ExtractQuery, ExtractSort, FilterCls, FilterInstance } from "./filterMeta";
3
4
  import type { ModelCls } from "./loaderInfo";
4
5
 
5
6
  export interface DatabaseModel<
@@ -105,4 +105,5 @@ export class DocumentSchema<Doc = unknown> {
105
105
 
106
106
  export type SchemaOf<Mdl = unknown, Doc = unknown> = DocumentSchema<Doc> & { readonly __model?: Mdl };
107
107
 
108
+ /** @deprecated Construct `new DocumentSchema()`. */
108
109
  export const getDefaultSchemaOptions = <_TSchema, TDocument>() => new DocumentSchema<TDocument>();