akanjs 3.2.0-rc.10 → 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.
- package/CHANGELOG.md +35 -0
- package/base/base.ts +2 -1
- package/client/clientRuntime.ts +1 -0
- package/client/cn.ts +2 -2
- package/client/frameConfig.ts +1 -0
- package/client/index.ts +248 -26
- package/client/locale.ts +1 -0
- package/client/rscNavigation.ts +1 -0
- package/common/CodeTranscript.ts +1 -1
- package/common/mcpExposure.ts +5 -2
- package/constant/constantRegistry.ts +4 -8
- package/constant/crystalize.ts +1 -2
- package/constant/getDefault.ts +1 -1
- package/constant/immerify.ts +1 -1
- package/constant/index.ts +78 -21
- package/constant/purify.ts +4 -9
- package/constant/serialize.ts +4 -2
- package/constant/types.ts +1 -0
- package/constant/via.ts +1 -2
- package/dictionary/agent.dictionary.ts +4 -0
- package/dictionary/locale.ts +1 -1
- package/document/databaseRegistry.ts +2 -1
- package/document/documentSchema.ts +1 -0
- package/document/filterMeta.ts +4 -1
- package/document/into.ts +2 -1
- package/document/loaderInfo.ts +2 -1
- package/document/types.ts +1 -1
- package/fetch/client/fetchClient.ts +3 -3
- package/fetch/client/httpClient.ts +2 -0
- package/fetch/client/wsClient.ts +1 -0
- package/package.json +1 -1
- package/server/agentHooks.ts +16 -0
- package/server/akanOption.ts +13 -1
- package/server/akanServer.ts +2 -9
- package/server/console.ts +3 -2
- package/server/index.ts +257 -17
- package/server/logging/logControlSocket.ts +42 -3
- package/server/mcp/AgentTools.ts +1 -0
- package/server/rscClient.tsx +14 -8
- package/server/sitemap.ts +1 -0
- package/service/agent.service.ts +14 -2
- package/service/agentAccounts.ts +19 -0
- package/service/agentLoop/agentLoop.ts +344 -0
- package/service/agentLoop/agentLoopTypes.ts +90 -0
- package/service/agentLoop/deltaStream.ts +40 -0
- package/service/agentLoop/loopCompaction.ts +129 -0
- package/service/agentLoop/loopRequest.ts +29 -0
- package/service/agentLoop/loopToolOutput.ts +54 -0
- package/service/agentLoop/loopTranscript.ts +102 -0
- package/{signal → service}/agentMeter.ts +2 -1
- package/{signal → service}/agentRelayPolicy.ts +11 -3
- package/service/index.ts +4 -0
- package/service/injectInfo.ts +2 -1
- package/service/predefinedAdaptor/agentTools.adaptor.ts +2 -0
- package/service/predefinedAdaptor/anthropicLlm.ts +18 -11
- package/service/predefinedAdaptor/llm.adaptor.ts +5 -0
- package/service/predefinedAdaptor/openaiDialect.ts +46 -18
- package/service/predefinedAdaptor/openaiLlm.ts +1 -1
- package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +3 -3
- package/service/predefinedAdaptor/sql/driver/postgres.ts +1 -1
- package/service/predefinedAdaptor/sseData.ts +14 -0
- package/service/serviceRegistry.ts +1 -0
- package/signal/agent.signal.ts +8 -4
- package/signal/index.ts +312 -32
- package/signal/resolveFieldContext.ts +34 -0
- package/signal/serializer/fetch.serializer.ts +10 -10
- package/signal/signalContext.ts +4 -31
- package/signal/trace.ts +3 -0
- package/signal/types.ts +7 -0
- package/store/baseSt.ts +1 -0
- package/store/index.ts +125 -18
- package/store/stateBuilder.ts +2 -0
- package/types/base/base.d.ts +2 -1
- package/types/client/clientRuntime.d.ts +1 -0
- package/types/client/cn.d.ts +2 -2
- package/types/client/frameConfig.d.ts +1 -0
- package/types/client/index.d.ts +25 -26
- package/types/client/locale.d.ts +1 -0
- package/types/client/rscNavigation.d.ts +1 -0
- package/types/common/CodeTranscript.d.ts +1 -1
- package/types/common/mcpExposure.d.ts +2 -0
- package/types/constant/constantRegistry.d.ts +3 -1
- package/types/constant/crystalize.d.ts +1 -1
- package/types/constant/getDefault.d.ts +1 -1
- package/types/constant/immerify.d.ts +1 -1
- package/types/constant/index.d.ts +21 -21
- package/types/constant/purify.d.ts +2 -1
- package/types/constant/serialize.d.ts +1 -1
- package/types/constant/types.d.ts +1 -0
- package/types/dictionary/agent.dictionary.d.ts +1 -1
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +9 -9
- package/types/dictionary/locale.d.ts +1 -1
- package/types/document/databaseRegistry.d.ts +2 -1
- package/types/document/documentSchema.d.ts +1 -0
- package/types/document/filterMeta.d.ts +4 -1
- package/types/document/into.d.ts +1 -1
- package/types/document/loaderInfo.d.ts +2 -1
- package/types/document/types.d.ts +1 -1
- package/types/fetch/client/fetchClient.d.ts +2 -1
- package/types/fetch/client/httpClient.d.ts +2 -0
- package/types/fetch/client/wsClient.d.ts +1 -0
- package/types/server/agentHooks.d.ts +4 -0
- package/types/server/akanOption.d.ts +7 -1
- package/types/server/console.d.ts +3 -2
- package/types/server/index.d.ts +17 -17
- package/types/server/logging/rotatingLogWriter.d.ts +1 -1
- package/types/server/sitemap.d.ts +1 -0
- package/types/service/agent.service.d.ts +3 -0
- package/types/service/agentAccounts.d.ts +8 -0
- package/types/service/agentLoop/agentLoop.d.ts +31 -0
- package/types/service/agentLoop/agentLoopTypes.d.ts +104 -0
- package/types/service/agentLoop/deltaStream.d.ts +3 -0
- package/types/service/agentLoop/loopCompaction.d.ts +11 -0
- package/types/service/agentLoop/loopRequest.d.ts +6 -0
- package/types/service/agentLoop/loopToolOutput.d.ts +7 -0
- package/types/service/agentLoop/loopTranscript.d.ts +12 -0
- package/types/{signal → service}/agentMeter.d.ts +1 -1
- package/types/{signal → service}/agentRelayPolicy.d.ts +12 -2
- package/types/service/index.d.ts +4 -0
- package/types/service/injectInfo.d.ts +2 -1
- package/types/service/predefinedAdaptor/agentTools.adaptor.d.ts +2 -0
- package/types/service/predefinedAdaptor/anthropicLlm.d.ts +1 -1
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +5 -0
- package/types/service/predefinedAdaptor/openaiDialect.d.ts +2 -1
- package/types/service/predefinedAdaptor/sql/driver/bunSqlite.d.ts +1 -14
- package/types/service/predefinedAdaptor/sql/driver/postgres.d.ts +0 -8
- package/types/service/predefinedAdaptor/sseData.d.ts +5 -0
- package/types/service/serviceRegistry.d.ts +1 -0
- package/types/signal/index.d.ts +32 -32
- package/types/signal/resolveFieldContext.d.ts +15 -0
- package/types/signal/serializer/fetch.serializer.d.ts +3 -1
- package/types/signal/signalContext.d.ts +1 -13
- package/types/signal/trace.d.ts +3 -0
- package/types/signal/types.d.ts +7 -0
- package/types/store/baseSt.d.ts +1 -0
- package/types/store/index.d.ts +17 -17
- package/types/store/stateBuilder.d.ts +2 -0
- package/types/ui/Reference/origin.d.ts +1 -0
- package/types/ui/recipe/buttonRecipe.d.ts +2 -2
- package/ui/Reference/origin.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -12,6 +12,35 @@
|
|
|
12
12
|
|
|
13
13
|
**Upgrading.** A usage hook receives failed and aborted turns. Before, a streamed turn whose reader left ran to its end and was billed as finished; it now stops early and is billed at its estimate. To bill as before, bill every report except `outcome === "failed"`. Billing only `ok` would leave a stopped turn unbilled while the provider charged for it. Read `estimated` to treat estimated counts differently.
|
|
14
14
|
|
|
15
|
+
- e9a2c7f: `this.agentService.loop(request)` runs a model over the `/mcp` tool catalogue in-process until it answers. It needs no browser, so a queued task, a scheduled run or a reply to a mention can use it.
|
|
16
|
+
|
|
17
|
+
- **Events.** It returns an async iterable of `text`, `toolCall`, `toolResult`, `usage`, `compacted` and `awaiting` events. The stream ends with exactly one `done { stop, rounds }` or `error`. `stop` is one of `end`, `maxRounds`, `budget`, `aborted`, `length`, `quota`, `unauthorized` or `awaiting`. The loop waits for the consumer at every event.
|
|
18
|
+
- **Accounts.** A request carries either `account`, a snapshot the server resolved, or `principal`, a stored id. A new `option.setAgentAccountResolver((principal) => account | null)` resolves the principal at the start and before every round. If it resolves to `null`, the run ends as `"unauthorized"`, as does a missing or falsy `account`: there is no anonymous run. The model is offered `allow` ∩ what the account sees on `/mcp`, and a call to a name that round did not list is answered as an unknown tool, neither asked about nor run. A request with no `allow` array is an `error`.
|
|
19
|
+
- **Approval and taint.**
|
|
20
|
+
- `untrusted(result)` marks a result as untrusted. Every later call reaches `approve(call, { tainted, tool })` with `tainted` set. `approve` returns `"allow"`, `"defer"` or `{ deny }`.
|
|
21
|
+
- Without `approve`, a `needsConfirm` tool is refused, and so is every write once the run is tainted. `AgentToolsRole`'s `listAs` now marks a mutation MCP calls destructive as `needsConfirm`. `purge`, `destroy`, `erase`, `wipe`, `drop`, `cancel`, `bulkRemove` and `bulkDelete` keys now count alongside `remove` and `delete`, which also changes those tools' `destructiveHint` on `/mcp`, and a new `destructive` endpoint option overrides the key.
|
|
22
|
+
- `"defer"` holds the whole batch, emits `awaiting`, and ends the run.
|
|
23
|
+
- **Resume.**
|
|
24
|
+
- `onMessage` is awaited for each message the run appends.
|
|
25
|
+
- Calling `loop` again with the stored messages asks `approve` again about any trailing calls nothing answered, and rebuilds the taint from the stored results.
|
|
26
|
+
- `compact { at, keep }` summarizes the head of the transcript. The `compacted` event names how many messages the summary replaced.
|
|
27
|
+
- A summary or tool message now carries `tainted`, new and optional on `AgentWireMessage`, so a resumed transcript stays tainted. Store each whole. A summary with no marker counts as tainted to a run with `untrusted`, as what it replaced cannot be judged.
|
|
28
|
+
- A batch's results reach `onMessage` even when the consumer stops reading or a later call throws, so a resume runs only calls that never started.
|
|
29
|
+
- **Metering.**
|
|
30
|
+
- Each model call is its own turn for the request policy, the quota and the usage hook. That includes compactions.
|
|
31
|
+
- `AgentTurnContext` gains `loop { id, round }` and `meta`, which is copied from the request.
|
|
32
|
+
- A loop turn has empty headers and a `null` ip. The relay's default size caps do not apply to loop rounds.
|
|
33
|
+
- **Limits.**
|
|
34
|
+
- The run is bounded by `maxRounds` (default 12), `budget { tokens, toolCalls, wallMs }` and `signal`. A limit that is not a valid number is an `error` before any model call.
|
|
35
|
+
- `wallMs` and `signal` also end a run waiting on a tool or on `approve`. `callAs` cannot cancel a call, so the run stops waiting and answers it with an error saying it may still finish. A resume does not run it again, and the endpoint runs on with its outcome unreported.
|
|
36
|
+
- There is no preamble unless `preamble` gives one. With no `instructions` either, a short neutral prompt stands in, as each adaptor's own fallback is about a screen.
|
|
37
|
+
- A tool result is capped at 20,000 characters, as the browser caps it. `untrusted` sees it before the cap.
|
|
38
|
+
- **Moved.** `AgentMeter` and `AgentRelayPolicy` now live in `akanjs/service`, and `akanjs/signal` still re-exports them.
|
|
39
|
+
|
|
40
|
+
- **Streams.** An error frame inside a provider's stream now fails the turn instead of reading as a finished answer. A stream that ends with no terminal event, or with tool arguments that do not parse, now stops as `length`, so those calls do not run with empty arguments and a half answer is not reported as finished. Parallel calls from a gateway that omits or reuses `index` now stay separate. This also applies to the in-page chat.
|
|
41
|
+
|
|
42
|
+
The `AgentTurnContext` fields are optional and the moved classes are still exported from `akanjs/signal`, so no upgrade step is needed.
|
|
43
|
+
|
|
15
44
|
- eb88032: A service can now run the `/mcp` tool catalogue in-process, as a given account, with `plug(AgentToolsRole)`.
|
|
16
45
|
|
|
17
46
|
- **`listAs(account, { allow })`** returns the tools that account may see on `/mcp`, with the same names, descriptions, input schemas and guard filtering. Each tool also carries `readOnly`. `allow` narrows the list by tool name and never widens it.
|
|
@@ -310,11 +339,14 @@
|
|
|
310
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.
|
|
311
340
|
|
|
312
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.
|
|
313
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`.
|
|
314
344
|
|
|
315
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.
|
|
316
346
|
|
|
317
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.
|
|
318
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`.
|
|
319
351
|
|
|
320
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.
|
|
@@ -404,6 +436,8 @@
|
|
|
404
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.
|
|
405
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.
|
|
406
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.
|
|
407
441
|
- 9b5bcee: Every SSR page now loads 72K less framework JavaScript (22K less after Brotli).
|
|
408
442
|
|
|
409
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.
|
|
@@ -497,6 +531,7 @@
|
|
|
497
531
|
- `invalidConfig`: a `transformEnv` callback returns something other than the env object.
|
|
498
532
|
- `notRegistered`: no WebSocket adaptor is registered.
|
|
499
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.
|
|
500
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:
|
|
501
536
|
|
|
502
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<
|
package/client/clientRuntime.ts
CHANGED
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({
|
package/client/frameConfig.ts
CHANGED
|
@@ -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
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
|
|
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
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
package/client/rscNavigation.ts
CHANGED
|
@@ -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,
|
package/common/CodeTranscript.ts
CHANGED
package/common/mcpExposure.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface McpExposureEndpoint {
|
|
|
9
9
|
mcp?: boolean;
|
|
10
10
|
/** `false` when a guard declares `static agents = false`: no model may ever pass, whatever else the guards say. */
|
|
11
11
|
agents?: boolean;
|
|
12
|
+
destructive?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export interface McpExposureOption {
|
|
@@ -33,9 +34,11 @@ export const mcpBaseVerbOf = (refName: string, key: string) => {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
/** Hints never stand in for a guard; `openWorldHint` is false: every endpoint reaches this app's own database. */
|
|
36
|
-
export const mcpHintsOf = (key: string, endpoint: { type: string }) => {
|
|
37
|
+
export const mcpHintsOf = (key: string, endpoint: { type: string; destructive?: boolean }) => {
|
|
37
38
|
const readOnly = endpoint.type === "query";
|
|
38
|
-
const destructive =
|
|
39
|
+
const destructive =
|
|
40
|
+
!readOnly &&
|
|
41
|
+
(endpoint.destructive ?? /^(remove|delete|purge|destroy|erase|wipe|drop|cancel|bulkRemove|bulkDelete)/.test(key));
|
|
39
42
|
return {
|
|
40
43
|
readOnlyHint: readOnly,
|
|
41
44
|
destructiveHint: destructive,
|
|
@@ -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
|
-
|
|
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>();
|
package/constant/crystalize.ts
CHANGED
|
@@ -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;
|
package/constant/getDefault.ts
CHANGED
package/constant/immerify.ts
CHANGED
|
@@ -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
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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";
|
package/constant/purify.ts
CHANGED
|
@@ -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
|
-
|
|
18
|
-
|
|
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
|
package/constant/serialize.ts
CHANGED
|
@@ -10,9 +10,11 @@ import {
|
|
|
10
10
|
PrimitiveRegistry,
|
|
11
11
|
type PrimitiveScalar,
|
|
12
12
|
} from "akanjs/base";
|
|
13
|
-
|
|
14
|
-
import {
|
|
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) {}
|