akanjs 3.2.0-rc.11 → 3.2.0-rc.13
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/ARCHITECTURE.md +17 -17
- package/CHANGELOG.md +24 -0
- package/base/base.ts +2 -1
- package/client/clientRuntime.ts +1 -0
- package/client/cn.ts +2 -2
- package/client/csrTypes.ts +2 -0
- package/client/frameConfig.ts +1 -0
- package/client/index.ts +249 -26
- package/client/locale.ts +1 -0
- package/client/route/RouteDefinition.ts +24 -7
- package/client/route/routeArgs.ts +7 -0
- package/client/router.ts +12 -2
- package/client/rscNavigation.ts +1 -0
- package/common/CodeTranscript.ts +1 -1
- 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/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/akanApp.ts +103 -1270
- package/server/akanServer.ts +1 -1
- package/server/console.ts +3 -2
- package/server/gateway/childSupervisor.ts +325 -0
- package/server/gateway/devHostChannel.ts +40 -0
- package/server/gateway/gatewayChildren.ts +135 -0
- package/server/gateway/gatewayConfig.ts +182 -0
- package/server/gateway/gatewayHttpProxy.ts +231 -0
- package/server/gateway/gatewayLogging.ts +111 -0
- package/server/gateway/gatewayRooms.ts +134 -0
- package/server/gateway/gatewayStatus.ts +116 -0
- package/server/gateway/gatewayStatusPage.ts +54 -0
- package/server/gateway/gatewayWebSocketRelay.ts +149 -0
- package/server/index.ts +257 -17
- package/server/logging/logControlSocket.ts +42 -3
- package/server/mcp/McpDispatcher.ts +6 -24
- package/server/rscClient.tsx +14 -8
- package/server/sitemap.ts +1 -0
- package/service/injectInfo.ts +2 -1
- package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +3 -3
- package/service/predefinedAdaptor/sql/driver/postgres.ts +1 -1
- package/service/serviceRegistry.ts +1 -0
- package/signal/SignalFailure.ts +21 -0
- package/signal/agentTurnStream.ts +5 -2
- package/signal/index.ts +298 -30
- package/signal/resolveFieldContext.ts +34 -0
- package/signal/serializer/fetch.serializer.ts +7 -10
- package/signal/signalContext.ts +4 -31
- package/signal/trace.ts +3 -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/csrTypes.d.ts +2 -0
- 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/route/RouteDefinition.d.ts +2 -2
- package/types/client/route/routeArgs.d.ts +6 -0
- package/types/client/router.d.ts +2 -1
- package/types/client/rscNavigation.d.ts +1 -0
- package/types/common/CodeTranscript.d.ts +1 -1
- 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/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +8 -8
- 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/akanApp.d.ts +2 -20
- package/types/server/console.d.ts +3 -2
- package/types/server/gateway/childSupervisor.d.ts +33 -0
- package/types/server/gateway/devHostChannel.d.ts +13 -0
- package/types/server/gateway/gatewayChildren.d.ts +47 -0
- package/types/server/gateway/gatewayConfig.d.ts +82 -0
- package/types/server/gateway/gatewayHttpProxy.d.ts +22 -0
- package/types/server/gateway/gatewayLogging.d.ts +16 -0
- package/types/server/gateway/gatewayRooms.d.ts +22 -0
- package/types/server/gateway/gatewayStatus.d.ts +62 -0
- package/types/server/gateway/gatewayStatusPage.d.ts +9 -0
- package/types/server/gateway/gatewayWebSocketRelay.d.ts +17 -0
- 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/injectInfo.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/serviceRegistry.d.ts +1 -0
- package/types/signal/SignalFailure.d.ts +1 -0
- package/types/signal/agentTurnStream.d.ts +1 -0
- package/types/signal/index.d.ts +31 -30
- 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/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/Agent/Chat.d.ts +5 -2
- package/types/ui/Agent/ChatHeader.d.ts +13 -0
- package/types/ui/Agent/ChatPendingCards.d.ts +23 -0
- package/types/ui/Reference/origin.d.ts +1 -0
- package/types/ui/overlayLayer.d.ts +6 -1
- package/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +4 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/relaunch.d.ts +1 -0
- package/types/vendor/@akanjs/native/plugins/external-view/src/index.d.ts +14 -10
- package/types/vendor/use-agentic/failureCode.d.ts +4 -0
- package/types/vendor/use-agentic/types.d.ts +6 -0
- package/types/webkit/CsrGuards.d.ts +2 -0
- package/ui/Agent/Chat.tsx +96 -116
- package/ui/Agent/ChatHeader.tsx +59 -0
- package/ui/Agent/ChatPendingCards.tsx +49 -0
- package/ui/Agent/fetchRunner.ts +8 -1
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Dialog/LegacyModal.tsx +1 -1
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/Popconfirm.tsx +1 -1
- package/ui/Reference/origin.ts +1 -0
- package/ui/overlayLayer.ts +22 -1
- package/vendor/@akanjs/native/CHANGELOG.md +6 -1
- package/vendor/@akanjs/native/native/desktop/src/external.rs +213 -111
- package/vendor/@akanjs/native/native/desktop/src/lib.rs +12 -4
- package/vendor/@akanjs/native/native/desktop/src/linux/external.rs +275 -0
- package/vendor/@akanjs/native/native/desktop/src/linux/mod.rs +1 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/native-plugins.ts +5 -3
- package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +25 -1
- package/vendor/@akanjs/native/packages/desktop/src/deeplinks.ts +2 -2
- package/vendor/@akanjs/native/packages/desktop/src/host.ts +2 -2
- package/vendor/@akanjs/native/packages/desktop/src/relaunch.ts +8 -3
- package/vendor/@akanjs/native/plugins/app/src/desktop.ts +2 -2
- package/vendor/@akanjs/native/plugins/autostart/src/desktop.ts +2 -1
- package/vendor/@akanjs/native/plugins/external-view/native-plugin.json +4 -1
- package/vendor/@akanjs/native/plugins/external-view/src/index.ts +14 -10
- package/vendor/use-agentic/AgentSession.ts +11 -11
- package/vendor/use-agentic/CHANGELOG.md +6 -0
- package/vendor/use-agentic/Compaction.ts +2 -1
- package/vendor/use-agentic/ToolRunner.ts +3 -15
- package/vendor/use-agentic/Transcript.ts +6 -3
- package/vendor/use-agentic/WIRE.md +12 -1
- package/vendor/use-agentic/failureCode.ts +44 -0
- package/vendor/use-agentic/httpRunner.ts +14 -3
- package/vendor/use-agentic/types.ts +6 -0
- package/webkit/CsrGuards.ts +7 -2
- package/webkit/useLocation.ts +3 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { AgentEndpoint, AgentTurn, BaseEndpoint } from "akanjs/signal";
|
|
2
2
|
export declare const dictionary: {
|
|
3
|
-
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
3
|
+
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new">, "base.error.documentNotFound" | "base.error.gatewayTimeout" | "base.error.payloadTooLarge" | "base.error.tooManyRequests" | "base.error.serverUnavailable" | "base.error.serverUnreachable" | "base.error.idempotencyInFlight" | "base.error.unexpectedResponse" | "base.error.mutationInApp" | "base.error.mutationInRender" | "base.error.immutableField" | "base.error.invalidArgument" | "base.error.requiredArgument" | "base.error.invalidField" | "base.error.relationNotFound" | "base.error.endpointClosed" | "base.error.readOnlyDeployment">;
|
|
4
4
|
agentTurn: import("./locale.d.ts").DictModule<import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc`, never>;
|
|
5
5
|
agent: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, "agent.error.llmUnavailable" | "agent.error.llmRequestFailed" | "agent.error.contextOverflow" | "agent.error.quotaExceeded" | "agent.error.requestRefused" | "agent.error.accountResolverMissing">;
|
|
6
6
|
};
|
|
7
|
-
export declare const Err: import("./trans.d.ts").ErrConstructor<"base.error.documentNotFound" | "base.error.gatewayTimeout" | "base.error.payloadTooLarge" | "base.error.tooManyRequests" | "base.error.serverUnavailable" | "base.error.serverUnreachable" | "base.error.idempotencyInFlight" | "base.error.unexpectedResponse" | "base.error.mutationInApp" | "base.error.mutationInRender" | "base.error.immutableField" | "base.error.invalidArgument" | "base.error.requiredArgument" | "base.error.invalidField" | "base.error.relationNotFound" | "base.error.endpointClosed" | "base.error.readOnlyDeployment" | "agent.error.llmUnavailable" | "agent.error.llmRequestFailed" | "agent.error.contextOverflow" | "agent.error.quotaExceeded" | "agent.error.requestRefused" | "agent.error.accountResolverMissing">, translate: (lang: "en" | "ko" | (string & {}) | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
8
|
-
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
9
|
-
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
10
|
-
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
11
|
-
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
12
|
-
loading: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
13
|
-
}, getDictionary: (lang: "en" | "ko" | (string & {}) | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "
|
|
7
|
+
export declare const Err: import("./trans.d.ts").ErrConstructor<"base.error.documentNotFound" | "base.error.gatewayTimeout" | "base.error.payloadTooLarge" | "base.error.tooManyRequests" | "base.error.serverUnavailable" | "base.error.serverUnreachable" | "base.error.idempotencyInFlight" | "base.error.unexpectedResponse" | "base.error.mutationInApp" | "base.error.mutationInRender" | "base.error.immutableField" | "base.error.invalidArgument" | "base.error.requiredArgument" | "base.error.invalidField" | "base.error.relationNotFound" | "base.error.endpointClosed" | "base.error.readOnlyDeployment" | "agent.error.llmUnavailable" | "agent.error.llmRequestFailed" | "agent.error.contextOverflow" | "agent.error.quotaExceeded" | "agent.error.requestRefused" | "agent.error.accountResolverMissing">, translate: (lang: "en" | "ko" | (string & {}) | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, data?: import("./trans.d.ts").TranslationData) => string, msg: {
|
|
8
|
+
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
9
|
+
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
10
|
+
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
11
|
+
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
12
|
+
loading: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, option?: import("./trans.d.ts").TransMessageOption) => void;
|
|
13
|
+
}, getDictionary: (lang: "en" | "ko" | (string & {}) | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "agent" | "stop" | "connecting" | "send" | "cancel" | "copy" | "createModel" | "updateModel" | "removeModel" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "cameraPromptHeader" | "cameraPromptPhoto" | "cameraPromptPicture" | "cameraPromptCancel" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "pageLoadFailed" | "loadFailed" | "pageNotFound" | "goBack" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentToolCard" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachReading" | "agentReferenceRemove" | "agentReferenceFailed" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentQueue" | "agentQueuePlaceholder" | "agentQueued" | "agentQueueEdit" | "agentQueueCancel" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentToolResult" | "agentTokens" | "agentTokensOf" | "agentCompactsAt" | "agentSummarizing" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "noSelection" | "addModel" | "createSuccess" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "draftConflict" | "draftApplied" | "draftRestore" | "draftDiscard" | "draftStartOver" | "new"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, __Error_Key__: "base.error.documentNotFound" | "base.error.gatewayTimeout" | "base.error.payloadTooLarge" | "base.error.tooManyRequests" | "base.error.serverUnavailable" | "base.error.serverUnreachable" | "base.error.idempotencyInFlight" | "base.error.unexpectedResponse" | "base.error.mutationInApp" | "base.error.mutationInRender" | "base.error.immutableField" | "base.error.invalidArgument" | "base.error.requiredArgument" | "base.error.invalidField" | "base.error.relationNotFound" | "base.error.endpointClosed" | "base.error.readOnlyDeployment" | "agent.error.llmUnavailable" | "agent.error.llmRequestFailed" | "agent.error.contextOverflow" | "agent.error.quotaExceeded" | "agent.error.requestRefused" | "agent.error.accountResolverMissing";
|
|
@@ -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.d.ts";
|
|
5
5
|
import type { DictArgNames, DictEndpointShape, DictFilterQuery, DictFilterSort, DictSliceShape } from "./dictShape.d.ts";
|
|
6
6
|
interface Trans {
|
|
7
7
|
t: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConstantCls } from "akanjs/constant";
|
|
2
|
-
import type { DatabaseCls
|
|
2
|
+
import type { DatabaseCls } from "./by.d.ts";
|
|
3
|
+
import type { ExtractQuery, ExtractSort, FilterCls, FilterInstance } from "./filterMeta.d.ts";
|
|
3
4
|
import type { ModelCls } from "./loaderInfo.d.ts";
|
|
4
5
|
export interface DatabaseModel<T extends string = string, Input = any, Doc = any, Model = any, Obj = any, Insight = any, Filter extends FilterInstance = any, _Query extends ExtractQuery<Filter> = ExtractQuery<Filter>, _Sort extends ExtractSort<Filter> = ExtractSort<Filter>> {
|
|
5
6
|
refName: T;
|
|
@@ -32,4 +32,5 @@ export declare class DocumentSchema<Doc = unknown> {
|
|
|
32
32
|
export type SchemaOf<Mdl = unknown, Doc = unknown> = DocumentSchema<Doc> & {
|
|
33
33
|
readonly __model?: Mdl;
|
|
34
34
|
};
|
|
35
|
+
/** @deprecated Construct `new DocumentSchema()`. */
|
|
35
36
|
export declare const getDefaultSchemaOptions: <_TSchema, TDocument>() => DocumentSchema<TDocument>;
|
|
@@ -3,6 +3,7 @@ import { AkanError, FILTER_DICT_SHAPE, FILTER_META } from "akanjs/base";
|
|
|
3
3
|
import { type BaseObject, type ConstantFieldType, type ConstantFieldTypeInput, type DocumentModel, type FieldToValue, type PlainTypeToFieldType, type QueryOf, type Serialized } from "akanjs/constant";
|
|
4
4
|
import { type DocumentQuery, type DocumentQueryHelper } from "./documentQuery.d.ts";
|
|
5
5
|
import type { ConstantFilterMeta } from "./types.d.ts";
|
|
6
|
+
/** @deprecated Unused by akanjs; `getFilterMeta(ref, { allowEmpty: true }) !== undefined` answers the same. */
|
|
6
7
|
export declare const isFilterModel: (filterRef: Cls<unknown, {
|
|
7
8
|
[FILTER_META]?: ConstantFilterMeta;
|
|
8
9
|
}>) => boolean;
|
|
@@ -11,11 +12,13 @@ export declare const getFilterMeta: <AllowEmpty extends boolean = false>(filterR
|
|
|
11
12
|
}> | FilterCls, { allowEmpty }?: {
|
|
12
13
|
allowEmpty?: AllowEmpty;
|
|
13
14
|
}) => AllowEmpty extends true ? ConstantFilterMeta | undefined : ConstantFilterMeta;
|
|
15
|
+
/** @internal */
|
|
14
16
|
export declare const setFilterMeta: (filterRef: Cls<unknown, {
|
|
15
17
|
[FILTER_META]?: ConstantFilterMeta;
|
|
16
18
|
sortField: Set<string>;
|
|
17
19
|
}>, filterMeta: ConstantFilterMeta, ...libFilterMetas: ConstantFilterMeta[]) => void;
|
|
18
20
|
export declare const getFilterInfoByKey: <ArgNames extends string[] = [], Args extends any[] = any[], Model = any>(modelRef: FilterCls, key: string) => FilterInfo<ArgNames, Args, Model>;
|
|
21
|
+
/** @deprecated Unused by akanjs; declare the query in the filter class built with `from(model, (filter) => …)`. */
|
|
19
22
|
export declare const setFilterInfoByKey: <ArgNames extends string[] = [], Args extends any[] = any[], Model = any>(modelRef: Cls<Model>, key: string, filterInfo: FilterInfo<ArgNames, Args, Model>) => void;
|
|
20
23
|
export declare const getFilterSortByKey: (modelRef: FilterCls, key: string) => unknown;
|
|
21
24
|
export declare const fillMissingFilterArgs: (filterInfo: FilterInfo, args: unknown[]) => any[];
|
|
@@ -34,7 +37,7 @@ export interface FilterArgInfo {
|
|
|
34
37
|
maxItems: number;
|
|
35
38
|
}
|
|
36
39
|
export declare const DEFAULT_FILTER_ARG_MAX_ITEMS = 1000;
|
|
37
|
-
/** Unwraps a filter arg's declaration the way `EndpointInfo.getArgInfo` unwraps an endpoint's. */
|
|
40
|
+
/** @internal Unwraps a filter arg's declaration the way `EndpointInfo.getArgInfo` unwraps an endpoint's. */
|
|
38
41
|
export declare const getFilterArgInfo: (arg: FilterInfo["args"][number]) => FilterArgInfo;
|
|
39
42
|
export declare const getFilterArgInfos: (filterInfo: FilterInfo) => FilterArgInfo[];
|
|
40
43
|
/** A caller named a filter that does not exist, or gave it arguments it cannot take. Its callers answer 400. */
|
package/types/document/into.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type Cls, type PromiseOrObject } from "akanjs/base";
|
|
2
2
|
import type { DocumentModel, QueryOf } from "akanjs/constant";
|
|
3
|
-
import type { FilterCls, FilterQueryOf, FilterSortOf } from ".";
|
|
4
3
|
import type { CacheDatabase, QueryMethodPart } from "./database.d.ts";
|
|
5
4
|
import type { DataLoader } from "./dataLoader.d.ts";
|
|
6
5
|
import type { DocumentQuery, DocumentScopeOptions, DocumentTouchOptions, DocumentUpdateInput, DocumentUpdateOptions } from "./documentQuery.d.ts";
|
|
6
|
+
import type { FilterCls, FilterQueryOf, FilterSortOf } from "./filterMeta.d.ts";
|
|
7
7
|
import { type LoaderBuilder, type ModelCls } from "./loaderInfo.d.ts";
|
|
8
8
|
import type { DocumentProjection } from "./types.d.ts";
|
|
9
9
|
export type CRUDEventType = "create" | "update" | "remove";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Cls, LOADER_META } from "akanjs/base";
|
|
2
2
|
import type { QueryOf } from "akanjs/constant";
|
|
3
|
-
import type { Loader
|
|
3
|
+
import type { Loader } from "./dataLoader.d.ts";
|
|
4
|
+
import type { SchemaOf } from "./documentSchema.d.ts";
|
|
4
5
|
type LoaderType = "field" | "arrayField" | "query";
|
|
5
6
|
export type ModelCls<Statics = Record<never, never>, LoaderMap extends {
|
|
6
7
|
[key: string]: LoaderInfo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EnumInstance, GetStateObject } from "akanjs/base";
|
|
2
|
-
import type { FilterInfo } from ".";
|
|
2
|
+
import type { FilterInfo } from "./filterMeta.d.ts";
|
|
3
3
|
export type DataInputOf<Input = any, Obj = any> = {
|
|
4
4
|
[K in keyof Input as Input[K] extends (...args: any[]) => any ? never : K]: Input[K] extends any[] ? Input[K] | undefined : Input[K];
|
|
5
5
|
} & Partial<Obj>;
|
|
@@ -86,6 +86,7 @@ export declare class FetchClient {
|
|
|
86
86
|
};
|
|
87
87
|
/** For calls neither the caller nor the endpoint budgets; `false` waits as long as the runtime will (minutes). */
|
|
88
88
|
setTimeout(timeout?: number | false): void;
|
|
89
|
+
/** @deprecated Every `Err` is `akanjs/common`'s, which a restored error already is; drop the call. */
|
|
89
90
|
setErrorConstructor(ErrorCls?: ErrorConstructor): void;
|
|
90
91
|
applySignal(serializedSignal: {
|
|
91
92
|
[key: string]: SerializedSignal;
|
|
@@ -137,7 +138,7 @@ export declare class FetchClient {
|
|
|
137
138
|
origin?: string;
|
|
138
139
|
connect?: boolean;
|
|
139
140
|
base?: FetchProxy;
|
|
140
|
-
Err?: ErrorConstructor;
|
|
141
|
+
/** @deprecated Every `Err` is `akanjs/common`'s, which a restored error already is. */ Err?: ErrorConstructor;
|
|
141
142
|
/** This app's own default request budget, for calls no endpoint and no caller gave one. */
|
|
142
143
|
timeout?: number | false;
|
|
143
144
|
}): {
|
|
@@ -5,6 +5,7 @@ export interface HttpClientOptions {
|
|
|
5
5
|
headers?: Record<string, string>;
|
|
6
6
|
/** Milliseconds before the request is abandoned; `false` waits as long as the browser will. */
|
|
7
7
|
timeout?: number | false;
|
|
8
|
+
/** @deprecated Every `Err` is `akanjs/common`'s, which a restored error already is. */
|
|
8
9
|
ErrorCls?: ErrorConstructor;
|
|
9
10
|
}
|
|
10
11
|
interface FetchOptions extends Pick<HttpClientOptions, "headers" | "timeout"> {
|
|
@@ -19,6 +20,7 @@ export declare class HttpClient {
|
|
|
19
20
|
readonly baseUrl: string;
|
|
20
21
|
private ErrorCls?;
|
|
21
22
|
constructor(baseUrl: string, options?: HttpClientOptions);
|
|
23
|
+
/** @deprecated Every `Err` is `akanjs/common`'s, which a restored error already is; drop the call. */
|
|
22
24
|
setErrorConstructor(ErrorCls?: ErrorConstructor): void;
|
|
23
25
|
/** The budget every call that names none takes. `false` waits as long as the runtime will. */
|
|
24
26
|
setTimeout(timeout?: number | false): void;
|
|
@@ -49,6 +49,7 @@ export declare class WsClient {
|
|
|
49
49
|
readonly url: string;
|
|
50
50
|
connected: boolean;
|
|
51
51
|
constructor(url: string, ErrorCls?: ErrorConstructor | undefined);
|
|
52
|
+
/** @deprecated Every `Err` is `akanjs/common`'s, which a restored error already is; drop the call. */
|
|
52
53
|
setErrorConstructor(ErrorCls?: ErrorConstructor): void;
|
|
53
54
|
/** Merged over what was set before; read at the next connect and the next drop. */
|
|
54
55
|
configure(options: WsClientOptions): this;
|
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
import "./lifecycle/loadBuildEnv";
|
|
2
2
|
import { Logger } from "akanjs/common";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
serverPath?: string;
|
|
6
|
-
runtimeDir?: string;
|
|
7
|
-
port?: number;
|
|
8
|
-
wsBasePort?: number;
|
|
9
|
-
openapi?: boolean;
|
|
10
|
-
/** Signal endpoint mount, `/api` by default; handed down as `AKAN_API_PREFIX` (CSR/mobile follow akan.config.ts). */
|
|
11
|
-
prefix?: string;
|
|
12
|
-
/** Where the websocket upgrade sits under `prefix`, `/ws` by default. Handed down as `AKAN_WS_PREFIX`. */
|
|
13
|
-
websocketPrefix?: string;
|
|
14
|
-
/** Boot only these modules and what they reach; omitted or empty mounts every enabled one. `AKAN_MODULES`. */
|
|
15
|
-
modules?: string[];
|
|
16
|
-
/** Mount all but these and whatever reaches them, applied after `modules`. `AKAN_DISABLE_MODULES`. */
|
|
17
|
-
disableModules?: string[];
|
|
18
|
-
/** Like `disableModules`, by owning lib. `AKAN_DISABLE_LIBS`. */
|
|
19
|
-
disableLibs?: string[];
|
|
20
|
-
/** In-process replica; default on for one env-set traffic replica, off if `replica` is passed or AKAN_SOLO=false. */
|
|
21
|
-
solo?: boolean;
|
|
22
|
-
}
|
|
3
|
+
import { type AkanAppOptions } from "./gateway/gatewayConfig.d.ts";
|
|
4
|
+
export type { AkanAppOptions } from "./gateway/gatewayConfig.d.ts";
|
|
23
5
|
export declare class AkanApp {
|
|
24
6
|
#private;
|
|
25
7
|
readonly logger: Logger;
|
|
@@ -12,9 +12,9 @@ export interface AkanConsoleOptions {
|
|
|
12
12
|
/** Where the running server keeps `akan-control.sock`; the console is its own process and has to be told. */
|
|
13
13
|
runtimeDir?: string;
|
|
14
14
|
}
|
|
15
|
-
/** `level=warn grep="payment failed" endpoint=mutation:*` → a query object the socket parses. */
|
|
15
|
+
/** @internal `level=warn grep="payment failed" endpoint=mutation:*` → a query object the socket parses. */
|
|
16
16
|
export declare const parseAkanConsoleQuery: (args: string) => Record<string, string>;
|
|
17
|
-
/** Attaches to the running server's control socket, not the console's own `listen: false` server. */
|
|
17
|
+
/** @internal Attaches to the running server's control socket, not the console's own `listen: false` server. */
|
|
18
18
|
export declare const createAkanConsoleLogCommands: (appName: string, runtimeDir: string) => Record<string, AkanConsoleCommand>;
|
|
19
19
|
export interface AkanConsoleContext extends Record<string, unknown> {
|
|
20
20
|
server: AkanServer;
|
|
@@ -28,5 +28,6 @@ export interface AkanConsoleContext extends Record<string, unknown> {
|
|
|
28
28
|
}
|
|
29
29
|
export declare const assertAkanConsoleAllowed: (env?: Partial<Pick<BaseEnv, "environment" | "operationMode">>) => void;
|
|
30
30
|
export declare const getAkanConsoleMethods: (value: unknown) => string[];
|
|
31
|
+
/** @internal */
|
|
31
32
|
export declare const createAkanConsoleContext: (server: AkanServer, globals?: Record<string, unknown>) => AkanConsoleContext;
|
|
32
33
|
export declare const startAkanConsole: (server: AkanServer, options?: AkanConsoleOptions) => Promise<void>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Logger } from "akanjs/common";
|
|
2
|
+
import type { AkanIpcMessage } from "akanjs/service";
|
|
3
|
+
import type { BuilderMessage } from "../artifact.d.ts";
|
|
4
|
+
import type { DevHostChannel } from "./devHostChannel.d.ts";
|
|
5
|
+
import type { ChildState, GatewayChildren } from "./gatewayChildren.d.ts";
|
|
6
|
+
import { GatewayConfig } from "./gatewayConfig.d.ts";
|
|
7
|
+
import type { GatewayLogging } from "./gatewayLogging.d.ts";
|
|
8
|
+
import type { GatewayRooms } from "./gatewayRooms.d.ts";
|
|
9
|
+
type ChildMessageHandler = (idx: number, message: AkanIpcMessage | BuilderMessage, proc?: Bun.Subprocess<"ignore", "pipe", "pipe">) => void;
|
|
10
|
+
interface ChildSupervisorParts {
|
|
11
|
+
config: GatewayConfig;
|
|
12
|
+
children: GatewayChildren;
|
|
13
|
+
rooms: GatewayRooms;
|
|
14
|
+
logging: GatewayLogging;
|
|
15
|
+
host: DevHostChannel;
|
|
16
|
+
logger: Logger;
|
|
17
|
+
onMessage: ChildMessageHandler;
|
|
18
|
+
}
|
|
19
|
+
export declare class ChildSupervisor {
|
|
20
|
+
#private;
|
|
21
|
+
constructor({ config, children, rooms, logging, host, logger, onMessage }: ChildSupervisorParts);
|
|
22
|
+
prepareRuntimeDir(): Promise<void>;
|
|
23
|
+
spawn(idx: number): void;
|
|
24
|
+
scheduleRestart(child: ChildState, proc: Bun.Subprocess<"ignore", "pipe", "pipe">, reason: string): void;
|
|
25
|
+
markReady(idx: number, message: Extract<AkanIpcMessage, {
|
|
26
|
+
type: "ready";
|
|
27
|
+
}>): void;
|
|
28
|
+
markHealthy(idx: number): void;
|
|
29
|
+
checkHealth(): void;
|
|
30
|
+
crashLoopDetail(): string | null;
|
|
31
|
+
stopAll(signal: string): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Logger } from "akanjs/common";
|
|
2
|
+
import type { BuilderRequest, BuilderResponse } from "../artifact.d.ts";
|
|
3
|
+
import type { GatewayChildren } from "./gatewayChildren.d.ts";
|
|
4
|
+
export declare class DevHostChannel {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(children: GatewayChildren, logger: Logger);
|
|
7
|
+
reportBackendBuildStatus({ ok, message }: {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
message: string;
|
|
10
|
+
}): void;
|
|
11
|
+
forwardBuilderReq(childIdx: number, message: BuilderRequest): void;
|
|
12
|
+
forwardBuilderRes(message: BuilderResponse): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Logger } from "akanjs/common";
|
|
2
|
+
import type { AkanChildRole, AkanChildStatus, AkanIpcMessage, AkanMetricsReport, AkanUpstream } from "akanjs/service";
|
|
3
|
+
import type { RestartSchedule } from "../../common/restartSchedule.d.ts";
|
|
4
|
+
import type { BuilderMessage } from "../artifact.d.ts";
|
|
5
|
+
export interface ChildState {
|
|
6
|
+
idx: number;
|
|
7
|
+
role: AkanChildRole;
|
|
8
|
+
proc: Bun.Subprocess<"ignore", "pipe", "pipe">;
|
|
9
|
+
ready: boolean;
|
|
10
|
+
status: AkanChildStatus;
|
|
11
|
+
pid?: number;
|
|
12
|
+
upstream?: AkanUpstream;
|
|
13
|
+
wsUpstream?: Extract<AkanUpstream, {
|
|
14
|
+
type: "tcp";
|
|
15
|
+
}>;
|
|
16
|
+
healthPath?: string;
|
|
17
|
+
metrics: AkanMetricsReport;
|
|
18
|
+
/** Monotonic (`performance.now()`) so sleep/wake wall-clock jumps cannot fake a health timeout. */
|
|
19
|
+
lastPongAtMono?: number;
|
|
20
|
+
restart: RestartSchedule;
|
|
21
|
+
restartCount: number;
|
|
22
|
+
restartPending: boolean;
|
|
23
|
+
lastExitCode?: number | null;
|
|
24
|
+
lastRestartAt?: number;
|
|
25
|
+
lastRestartReason?: string;
|
|
26
|
+
lastErrorMessage?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare class GatewayChildren {
|
|
29
|
+
#private;
|
|
30
|
+
constructor(logger: Logger);
|
|
31
|
+
get stopping(): boolean;
|
|
32
|
+
markStopping(): void;
|
|
33
|
+
get size(): number;
|
|
34
|
+
get(idx: number): ChildState | undefined;
|
|
35
|
+
set(idx: number, child: ChildState): void;
|
|
36
|
+
values(): MapIterator<ChildState>;
|
|
37
|
+
clear(): void;
|
|
38
|
+
invalidateFederation(): void;
|
|
39
|
+
isUnavailable(child: ChildState): boolean;
|
|
40
|
+
federationCandidates(): ChildState[];
|
|
41
|
+
pickFederationChild(): ChildState | null;
|
|
42
|
+
updateMetrics(childIdx: number, metrics: AkanMetricsReport): void;
|
|
43
|
+
fanoutToFederation(message: AkanIpcMessage | BuilderMessage, exceptIdx?: number): void;
|
|
44
|
+
fanoutToAll(message: AkanIpcMessage): void;
|
|
45
|
+
fanoutToBatch(message: AkanIpcMessage): void;
|
|
46
|
+
send(child: ChildState, message: AkanIpcMessage | BuilderMessage): boolean;
|
|
47
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { AkanChildRole, AkanUpstream } from "akanjs/service";
|
|
2
|
+
import type { RestartPolicy } from "../../common/restartSchedule.d.ts";
|
|
3
|
+
export interface AkanAppOptions {
|
|
4
|
+
replica?: number | string;
|
|
5
|
+
serverPath?: string;
|
|
6
|
+
runtimeDir?: string;
|
|
7
|
+
port?: number;
|
|
8
|
+
wsBasePort?: number;
|
|
9
|
+
openapi?: boolean;
|
|
10
|
+
/** Signal endpoint mount, `/api` by default; handed down as `AKAN_API_PREFIX` (CSR/mobile follow akan.config.ts). */
|
|
11
|
+
prefix?: string;
|
|
12
|
+
/** Where the websocket upgrade sits under `prefix`, `/ws` by default. Handed down as `AKAN_WS_PREFIX`. */
|
|
13
|
+
websocketPrefix?: string;
|
|
14
|
+
/** Boot only these modules and what they reach; omitted or empty mounts every enabled one. `AKAN_MODULES`. */
|
|
15
|
+
modules?: string[];
|
|
16
|
+
/** Mount all but these and whatever reaches them, applied after `modules`. `AKAN_DISABLE_MODULES`. */
|
|
17
|
+
disableModules?: string[];
|
|
18
|
+
/** Like `disableModules`, by owning lib. `AKAN_DISABLE_LIBS`. */
|
|
19
|
+
disableLibs?: string[];
|
|
20
|
+
/** In-process replica; default on for one env-set traffic replica, off if `replica` is passed or AKAN_SOLO=false. */
|
|
21
|
+
solo?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface AkanReplicaConfig {
|
|
24
|
+
federation: number;
|
|
25
|
+
batch: number;
|
|
26
|
+
all: number;
|
|
27
|
+
total: number;
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
export interface GatewayUpstream {
|
|
31
|
+
http: Extract<AkanUpstream, {
|
|
32
|
+
type: "unix";
|
|
33
|
+
}>;
|
|
34
|
+
ws?: Extract<AkanUpstream, {
|
|
35
|
+
type: "tcp";
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
export declare class GatewayConfig {
|
|
39
|
+
#private;
|
|
40
|
+
static readonly devMaxChildBootFailures = 3;
|
|
41
|
+
readonly devHosted: boolean;
|
|
42
|
+
readonly childRestartPolicy: RestartPolicy;
|
|
43
|
+
readonly healthTimeoutMs: number;
|
|
44
|
+
readonly upstreamWaitMs: number;
|
|
45
|
+
/** Child stderr is mostly bundler/runtime noise, kept to the log file; with none it may be a crash's only trace. */
|
|
46
|
+
readonly printChildStderr: boolean;
|
|
47
|
+
readonly serverPath: string;
|
|
48
|
+
readonly artifactDir: string;
|
|
49
|
+
readonly replica: AkanReplicaConfig;
|
|
50
|
+
readonly runtimeDir: string;
|
|
51
|
+
readonly socketRunId: string;
|
|
52
|
+
readonly port: number;
|
|
53
|
+
readonly wsBasePort: number;
|
|
54
|
+
readonly openapi?: boolean;
|
|
55
|
+
readonly prefix: string;
|
|
56
|
+
readonly websocketPrefix: string;
|
|
57
|
+
readonly web: import("../../index.d.ts").AkanWebConfig;
|
|
58
|
+
readonly modules: string[];
|
|
59
|
+
readonly disableModules: string[];
|
|
60
|
+
readonly disableLibs: string[];
|
|
61
|
+
readonly solo: boolean;
|
|
62
|
+
constructor(serverPath: string, options: AkanAppOptions);
|
|
63
|
+
static childShutdownWaitMs(): number;
|
|
64
|
+
childEnv(idx: number, role: AkanChildRole): {
|
|
65
|
+
AKAN_DISABLE_LIBS?: string | undefined;
|
|
66
|
+
AKAN_DISABLE_MODULES?: string | undefined;
|
|
67
|
+
AKAN_MODULES?: string | undefined;
|
|
68
|
+
AKAN_OPENAPI?: string | undefined;
|
|
69
|
+
PORT: string;
|
|
70
|
+
NODE_ENV: string;
|
|
71
|
+
AKAN_REPLICA: string;
|
|
72
|
+
AKAN_REPLICA_IDX: string;
|
|
73
|
+
AKAN_APP_DIR: string;
|
|
74
|
+
SERVER_MODE: AkanChildRole;
|
|
75
|
+
AKAN_API_PREFIX: string;
|
|
76
|
+
AKAN_WS_PREFIX: string;
|
|
77
|
+
};
|
|
78
|
+
roleOf(idx: number): AkanChildRole;
|
|
79
|
+
childUpstreamOf(idx: number, role: AkanChildRole): GatewayUpstream;
|
|
80
|
+
isWebSocketPath(pathname: string): boolean;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Logger } from "akanjs/common";
|
|
2
|
+
import { ServerLimits } from "../routing/serverLimits.d.ts";
|
|
3
|
+
import type { ChildSupervisor } from "./childSupervisor.d.ts";
|
|
4
|
+
import type { GatewayChildren } from "./gatewayChildren.d.ts";
|
|
5
|
+
import { GatewayConfig } from "./gatewayConfig.d.ts";
|
|
6
|
+
import type { GatewayStatus } from "./gatewayStatus.d.ts";
|
|
7
|
+
import type { GatewayWsData } from "./gatewayWebSocketRelay.d.ts";
|
|
8
|
+
interface GatewayHttpProxyParts {
|
|
9
|
+
config: GatewayConfig;
|
|
10
|
+
children: GatewayChildren;
|
|
11
|
+
supervisor: ChildSupervisor;
|
|
12
|
+
status: GatewayStatus;
|
|
13
|
+
limits: ServerLimits;
|
|
14
|
+
logger: Logger;
|
|
15
|
+
}
|
|
16
|
+
export declare class GatewayHttpProxy {
|
|
17
|
+
#private;
|
|
18
|
+
constructor({ config, children, supervisor, status, limits, logger }: GatewayHttpProxyParts);
|
|
19
|
+
serveImmutableArtifact(req: Request, url: URL): Promise<Response | null>;
|
|
20
|
+
proxyHttp(req: Request, server: Bun.Server<GatewayWsData>): Promise<Response>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Logger } from "akanjs/common";
|
|
2
|
+
import type { AkanChildRole } from "akanjs/service";
|
|
3
|
+
import { LogHub } from "../logging/logHub.d.ts";
|
|
4
|
+
import { LogStreamRoute } from "../logging/logStreamRoute.d.ts";
|
|
5
|
+
import type { GatewayChildren } from "./gatewayChildren.d.ts";
|
|
6
|
+
import type { GatewayConfig } from "./gatewayConfig.d.ts";
|
|
7
|
+
export declare class GatewayLogging {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(config: GatewayConfig, children: GatewayChildren, logger: Logger);
|
|
10
|
+
get hub(): LogHub | null;
|
|
11
|
+
get stream(): LogStreamRoute | null;
|
|
12
|
+
start(): Promise<void>;
|
|
13
|
+
stop(): Promise<void>;
|
|
14
|
+
writeChildLine(idx: number, role: AkanChildRole, pid: number | null, type: "stdout" | "stderr", line: string): void;
|
|
15
|
+
writeChildStderrBlock(idx: number, role: AkanChildRole, pid: number | null, lines: string[]): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Logger } from "akanjs/common";
|
|
2
|
+
import type { AkanIpcMessage } from "akanjs/service";
|
|
3
|
+
import type { GatewayChildren } from "./gatewayChildren.d.ts";
|
|
4
|
+
export declare class GatewayRooms {
|
|
5
|
+
#private;
|
|
6
|
+
constructor(children: GatewayChildren, logger: Logger);
|
|
7
|
+
get roomCount(): number;
|
|
8
|
+
get socketCount(): number;
|
|
9
|
+
roomCountOf(childIdx: number): number;
|
|
10
|
+
deliverPubsub(originIdx: number, message: Extract<AkanIpcMessage, {
|
|
11
|
+
type: "pubsub.publish";
|
|
12
|
+
}>): void;
|
|
13
|
+
addRoomMembership(childIdx: number, roomId: string, socketId?: string): void;
|
|
14
|
+
removeRoomMembership(childIdx: number, roomId: string, socketId?: string): void;
|
|
15
|
+
replaceRoomSnapshot(childIdx: number, rooms: string[]): void;
|
|
16
|
+
removeChildRooms(childIdx: number): void;
|
|
17
|
+
setLiveModels(childIdx: number, models: string[]): void;
|
|
18
|
+
fanoutLiveChange(originIdx: number, message: Extract<AkanIpcMessage, {
|
|
19
|
+
type: "live.change";
|
|
20
|
+
}>): void;
|
|
21
|
+
requestRoomSnapshots(): void;
|
|
22
|
+
}
|