akanjs 3.2.0-rc.20 → 3.2.0-rc.21
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 +32 -0
- package/common/index.ts +2 -0
- package/common/mcpExposure.ts +12 -2
- package/fetch/client/fetchClient.ts +2 -2
- package/package.json +1 -1
- package/server/mcp/AgentTools.ts +1 -0
- package/service/agentLoop/agentLoop.ts +49 -6
- package/service/agentLoop/agentLoopTypes.ts +25 -3
- package/service/agentLoop/loopCompaction.ts +8 -2
- package/service/agentLoop/loopRequest.ts +34 -1
- package/service/agentLoop/loopToolkits.ts +107 -0
- package/service/predefinedAdaptor/agentTools.adaptor.ts +3 -2
- package/service/predefinedAdaptor/llm.adaptor.ts +2 -0
- package/signal/index.ts +1 -0
- package/signal/mcp/McpDocument.ts +8 -1
- package/signal/serializer/fetch.serializer.ts +12 -5
- package/signal/slice.ts +22 -19
- package/signal/types.ts +17 -5
- package/types/common/index.d.ts +1 -1
- package/types/common/mcpExposure.d.ts +7 -2
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +8 -8
- package/types/server/logging/rotatingLogWriter.d.ts +1 -1
- package/types/service/agentLoop/agentLoopTypes.d.ts +24 -2
- package/types/service/agentLoop/loopCompaction.d.ts +1 -1
- package/types/service/agentLoop/loopRequest.d.ts +1 -1
- package/types/service/agentLoop/loopToolkits.d.ts +14 -0
- package/types/service/predefinedAdaptor/agentTools.adaptor.d.ts +3 -2
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +2 -0
- package/types/signal/index.d.ts +1 -1
- package/types/signal/mcp/McpDocument.d.ts +2 -0
- package/types/signal/slice.d.ts +15 -13
- package/types/signal/types.d.ts +16 -5
- package/types/ui/index.d.ts +1 -1
- package/types/vendor/use-agentic/AgentClientTools.d.ts +19 -0
- package/types/vendor/use-agentic/index.d.ts +1 -0
- package/ui/index.ts +4 -0
- package/vendor/use-agentic/AgentClientTools.ts +33 -0
- package/vendor/use-agentic/CHANGELOG.md +16 -1
- package/vendor/use-agentic/index.ts +1 -0
package/signal/slice.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Any, type Assign, type MergeAllKeyOfObjects, SLICE_DICT_SHAPE, SLICE_META } from "akanjs/base";
|
|
2
|
-
import { applyMixins } from "akanjs/common";
|
|
2
|
+
import { applyMixins, type McpShelf, narrowestMcpShelf } from "akanjs/common";
|
|
3
3
|
import { type FilterInstance, FilterQueryError, resolveFilterQuery } from "akanjs/document";
|
|
4
4
|
import { type Adaptor, type AdaptorCls, dangerouslyAdapt, type ServiceModel } from "akanjs/service";
|
|
5
5
|
import { Exception } from "./exception";
|
|
@@ -45,10 +45,10 @@ export type SliceCls<
|
|
|
45
45
|
|
|
46
46
|
/** `root` is absent: it rides on the root slice itself. */
|
|
47
47
|
export interface ResolvedSliceMcp {
|
|
48
|
-
get:
|
|
49
|
-
create:
|
|
50
|
-
update:
|
|
51
|
-
remove:
|
|
48
|
+
get: McpShelf;
|
|
49
|
+
create: McpShelf;
|
|
50
|
+
update: McpShelf;
|
|
51
|
+
remove: McpShelf;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/** Which generated verbs the server mounts: a verb whose guards resolve to none (or `false`) has no route at all. */
|
|
@@ -75,12 +75,13 @@ interface RootSliceOption {
|
|
|
75
75
|
};
|
|
76
76
|
/**
|
|
77
77
|
* Keyed like `guards`, for the root slice and generated CRUD only; `create`/`update`/`remove` fall back to `cru`
|
|
78
|
-
* and a bare
|
|
79
|
-
*
|
|
78
|
+
* and a bare value sets every key; `"agent"` lists it to the in-process agent only. Curation, not authorization: HTTP
|
|
79
|
+
* is unchanged. Omitted, each key takes the narrowest a lib slice passed here set, while `guards` are always this
|
|
80
|
+
* slice's own.
|
|
80
81
|
*/
|
|
81
82
|
mcp?:
|
|
82
|
-
|
|
|
83
|
-
| { root?:
|
|
83
|
+
| McpShelf
|
|
84
|
+
| { root?: McpShelf; get?: McpShelf; cru?: McpShelf; create?: McpShelf; update?: McpShelf; remove?: McpShelf };
|
|
84
85
|
prefix?: string;
|
|
85
86
|
}
|
|
86
87
|
|
|
@@ -180,31 +181,33 @@ export function slice<
|
|
|
180
181
|
remove: removeGuards.length > 0,
|
|
181
182
|
};
|
|
182
183
|
const mcpOption =
|
|
183
|
-
typeof option.mcp === "
|
|
184
|
-
|
|
184
|
+
typeof option.mcp === "object" || option.mcp === undefined
|
|
185
|
+
? option.mcp
|
|
186
|
+
: { root: option.mcp, get: option.mcp, cru: option.mcp };
|
|
187
|
+
const cruMcp = mcpOption?.cru ?? true;
|
|
185
188
|
const mcp: ResolvedSliceMcp = mcpOption
|
|
186
189
|
? {
|
|
187
|
-
get: mcpOption.get
|
|
190
|
+
get: mcpOption.get ?? true,
|
|
188
191
|
create: mcpOption.create ?? cruMcp,
|
|
189
192
|
update: mcpOption.update ?? cruMcp,
|
|
190
193
|
remove: mcpOption.remove ?? cruMcp,
|
|
191
194
|
}
|
|
192
195
|
: {
|
|
193
|
-
get: libSlices.
|
|
194
|
-
create: libSlices.
|
|
195
|
-
update: libSlices.
|
|
196
|
-
remove: libSlices.
|
|
196
|
+
get: narrowestMcpShelf(libSlices.map((libSlice) => libSlice.mcp.get)),
|
|
197
|
+
create: narrowestMcpShelf(libSlices.map((libSlice) => libSlice.mcp.create)),
|
|
198
|
+
update: narrowestMcpShelf(libSlices.map((libSlice) => libSlice.mcp.update)),
|
|
199
|
+
remove: narrowestMcpShelf(libSlices.map((libSlice) => libSlice.mcp.remove)),
|
|
197
200
|
};
|
|
198
201
|
const rootMcp = mcpOption
|
|
199
|
-
? mcpOption.root
|
|
200
|
-
: libSlices.
|
|
202
|
+
? (mcpOption.root ?? true)
|
|
203
|
+
: narrowestMcpShelf(libSlices.map((libSlice) => libSlice[SLICE_META][""]?.signalOption.mcp ?? true));
|
|
201
204
|
const srvKeys = [
|
|
202
205
|
...new Set([...Object.keys(srv.srvMap), ...libSlices.flatMap((libSlice) => Object.keys(libSlice.srv.srvMap))]),
|
|
203
206
|
];
|
|
204
207
|
|
|
205
208
|
const rootSlice =
|
|
206
209
|
rootGuards &&
|
|
207
|
-
init({ guards: rootGuards, ...(rootMcp ? {} : { mcp:
|
|
210
|
+
init({ guards: rootGuards, ...(rootMcp === true ? {} : { mcp: rootMcp }) })
|
|
208
211
|
.search<"queryKey", string>("queryKey", String)
|
|
209
212
|
.search<"args", unknown[]>("args", Any)
|
|
210
213
|
.exec((queryKey, args) => {
|
package/signal/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DefaultPrimitiveName, UnCls } from "akanjs/base";
|
|
2
|
+
import type { McpShelf } from "akanjs/common";
|
|
2
3
|
import type { AkanJob, ServiceModel } from "akanjs/service";
|
|
3
4
|
import type { RateLimitBudget } from "./endpointRateLimit";
|
|
4
5
|
import type { GuardCls } from "./guard";
|
|
@@ -119,8 +120,11 @@ export interface SignalOption<Response = any, Nullable extends boolean = false,
|
|
|
119
120
|
/** HTTP verb of a `mutation`, `POST` unless named; every other endpoint type ignores it. */
|
|
120
121
|
method?: HttpMutationMethod;
|
|
121
122
|
fileUpload?: boolean;
|
|
122
|
-
/**
|
|
123
|
-
|
|
123
|
+
/**
|
|
124
|
+
* `false` keeps it out of the MCP catalogue (default `true`), and `"agent"` keeps it off `/mcp` while the in-process
|
|
125
|
+
* agent (`AgentToolsRole`, `agentService.loop`) still lists it; curation, not authorization — HTTP still serves it.
|
|
126
|
+
*/
|
|
127
|
+
mcp?: McpShelf;
|
|
124
128
|
/**
|
|
125
129
|
* Overrides what the key implies for a `mutation`'s MCP `destructiveHint`: `true` for one no verb gives away, such as
|
|
126
130
|
* `archiveOrder`, `false` for a `drop…` that loses nothing. `agentService.loop` refuses a destructive tool unless
|
|
@@ -155,8 +159,8 @@ interface SerializedSignalOption {
|
|
|
155
159
|
guards?: string[];
|
|
156
160
|
method?: HttpMutationMethod;
|
|
157
161
|
fileUpload?: boolean;
|
|
158
|
-
/** Only ever `false`, when declared. Resolved here because the API explorer holds guard names, not classes. */
|
|
159
|
-
mcp?: false;
|
|
162
|
+
/** Only ever `false` or `"agent"`, when declared. Resolved here because the API explorer holds guard names, not classes. */
|
|
163
|
+
mcp?: false | "agent";
|
|
160
164
|
/** Only ever `false`, when a guard declares `static agents = false` (a person-only act). */
|
|
161
165
|
agents?: false;
|
|
162
166
|
}
|
|
@@ -211,7 +215,7 @@ export interface SerializedSignal {
|
|
|
211
215
|
updateGuards?: string[];
|
|
212
216
|
removeGuards?: string[];
|
|
213
217
|
/** Generated CRUD verbs kept off the agent shelf, carried here because `FetchClient.getBaseEndpoint` synthesizes them. */
|
|
214
|
-
mcp?:
|
|
218
|
+
mcp?: SerializedSignalShelf;
|
|
215
219
|
/** Generated CRUD verbs the server does not mount at all, so no client synthesizes them. */
|
|
216
220
|
crud?: SerializedSignalMcp;
|
|
217
221
|
/** Which generated CRUD verbs a person-only guard protects, by the same verb map; only the `false` keys travel. */
|
|
@@ -220,6 +224,14 @@ export interface SerializedSignal {
|
|
|
220
224
|
origin?: string[];
|
|
221
225
|
}
|
|
222
226
|
|
|
227
|
+
/** The generated CRUD verbs not on `/mcp`, by the same verb map; `"agent"` ones are still listed to the in-process agent. */
|
|
228
|
+
export interface SerializedSignalShelf {
|
|
229
|
+
get?: false | "agent";
|
|
230
|
+
create?: false | "agent";
|
|
231
|
+
update?: false | "agent";
|
|
232
|
+
remove?: false | "agent";
|
|
233
|
+
}
|
|
234
|
+
|
|
223
235
|
/** Keyed by generated verb, mirroring the `guards` map `slice()` takes. The root slice's own flag rides on `slice[""]`. */
|
|
224
236
|
export interface SerializedSignalMcp {
|
|
225
237
|
get?: false;
|
package/types/common/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export { type LogContextReader, type LogContextSnapshot, type LogFlightRecorder,
|
|
|
41
41
|
export { type MarkdownBlock, MarkdownBlocks, type MarkdownItem } from "./markdownBlocks.d.ts";
|
|
42
42
|
export { type MarkdownSpan, MarkdownSpans } from "./markdownSpans.d.ts";
|
|
43
43
|
export { type Align, MarkdownTable, type TableBlock } from "./markdownTable.d.ts";
|
|
44
|
-
export { isMcpDescribableArg, type McpExposureEndpoint, type McpExposureOption, mcpBaseVerbOf, mcpHintsOf, mcpRefusalOf, } from "./mcpExposure.d.ts";
|
|
44
|
+
export { isMcpDescribableArg, type McpExposureEndpoint, type McpExposureOption, type McpShelf, mcpBaseVerbOf, mcpHintsOf, mcpRefusalOf, narrowestMcpShelf, } from "./mcpExposure.d.ts";
|
|
45
45
|
export { MCP_FAILURE_META, type McpFailure } from "./mcpFailure.d.ts";
|
|
46
46
|
export { deepObjectify, objectify, plainFieldsOf } from "./objectify.d.ts";
|
|
47
47
|
export { pathGet, pathGetLoose, pathSet, toPathSegments } from "./objectPath.d.ts";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** `"agent"` lists it to the in-process agent (`AgentToolsRole`, `agentService.loop`) and keeps it off `/mcp`. */
|
|
2
|
+
export type McpShelf = boolean | "agent";
|
|
3
|
+
export declare const narrowestMcpShelf: (shelves: readonly McpShelf[]) => McpShelf;
|
|
1
4
|
export interface McpExposureEndpoint {
|
|
2
5
|
type: string;
|
|
3
6
|
returns: {
|
|
@@ -12,7 +15,7 @@ export interface McpExposureEndpoint {
|
|
|
12
15
|
}[];
|
|
13
16
|
guards?: string[];
|
|
14
17
|
fileUpload?: boolean;
|
|
15
|
-
mcp?:
|
|
18
|
+
mcp?: McpShelf;
|
|
16
19
|
/** `false` when a guard declares `static agents = false`: no model may ever pass, whatever else the guards say. */
|
|
17
20
|
agents?: boolean;
|
|
18
21
|
destructive?: boolean;
|
|
@@ -24,6 +27,8 @@ export interface McpExposureOption {
|
|
|
24
27
|
readOnly?: boolean;
|
|
25
28
|
/** MCP Apps: judges what a rendered view may call, which lifts the two refusals that only curate a model's shelf. */
|
|
26
29
|
view?: boolean;
|
|
30
|
+
/** The in-process agent catalogue, which also lists an endpoint declared `mcp: "agent"`. */
|
|
31
|
+
agent?: boolean;
|
|
27
32
|
}
|
|
28
33
|
/** `Any` publishes as the empty schema, which tells a model nothing, so it is left out. */
|
|
29
34
|
export declare const isMcpDescribableArg: (arg: {
|
|
@@ -40,4 +45,4 @@ export declare const mcpHintsOf: (key: string, endpoint: {
|
|
|
40
45
|
idempotentHint: boolean;
|
|
41
46
|
openWorldHint: boolean;
|
|
42
47
|
};
|
|
43
|
-
export declare const mcpRefusalOf: (endpoint: McpExposureEndpoint, { refName, key, readOnly, view }: McpExposureOption) => string | null;
|
|
48
|
+
export declare const mcpRefusalOf: (endpoint: McpExposureEndpoint, { refName, key, readOnly, view, agent }: McpExposureOption) => string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const baseDictionary: import("./dictInfo.d.ts").ServiceDictInfo<[string, string], "ping" | "pingBody" | "pingParam" | "pingQuery" | "wsPing" | "pubsubPing", "payloadTooLarge" | "tooManyRequests" | "gatewayTimeout" | "documentNotFound" | "serverUnreachable" | "serverUnavailable" | "unexpectedResponse" | "immutableField" | "invalidArgument" | "requiredArgument" | "invalidField" | "relationNotFound" | "idempotencyInFlight" | "endpointClosed" | "mutationInApp" | "mutationInRender" | "readOnlyDeployment", "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "
|
|
1
|
+
export declare const baseDictionary: import("./dictInfo.d.ts").ServiceDictInfo<[string, string], "ping" | "pingBody" | "pingParam" | "pingQuery" | "wsPing" | "pubsubPing", "payloadTooLarge" | "tooManyRequests" | "gatewayTimeout" | "documentNotFound" | "serverUnreachable" | "serverUnavailable" | "unexpectedResponse" | "immutableField" | "invalidArgument" | "requiredArgument" | "invalidField" | "relationNotFound" | "idempotencyInFlight" | "endpointClosed" | "mutationInApp" | "mutationInRender" | "readOnlyDeployment", "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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">;
|
|
@@ -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" | "save" | "refresh" | "password" | "
|
|
3
|
+
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "save" | "refresh" | "password" | "
|
|
8
|
-
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "
|
|
9
|
-
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "
|
|
10
|
-
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "
|
|
11
|
-
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "
|
|
12
|
-
loading: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "unauthorized" | "edit" | "ok" | "retry" | "approve" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "
|
|
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" | "
|
|
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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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" | "agent" | "view" | "remove" | "skip" | "success" | "save" | "refresh" | "password" | "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";
|
|
@@ -19,5 +19,5 @@ export declare class RotatingLogWriter {
|
|
|
19
19
|
static sanitizeFilePart(value: string): string;
|
|
20
20
|
write(processKey: string, chunk: string): void;
|
|
21
21
|
close(): Promise<void>;
|
|
22
|
-
static fileMode(value?: string | undefined, warn?: typeof RotatingLogWriter.__#
|
|
22
|
+
static fileMode(value?: string | undefined, warn?: typeof RotatingLogWriter.__#153@#defaultWarn): number;
|
|
23
23
|
}
|
|
@@ -9,6 +9,11 @@ export type AgentLoopApprove = (call: AgentWireToolCall, state: {
|
|
|
9
9
|
tainted: boolean;
|
|
10
10
|
tool: AgentTool;
|
|
11
11
|
}) => PromiseOrObject<AgentLoopApproval>;
|
|
12
|
+
/** `description` is the one line the model reads, in `openToolkit`'s own description, to decide whether to open it. */
|
|
13
|
+
export interface AgentLoopToolkit {
|
|
14
|
+
description: string;
|
|
15
|
+
tools: readonly string[];
|
|
16
|
+
}
|
|
12
17
|
export interface AgentLoopBudget {
|
|
13
18
|
/** Input and output tokens summed over this run's model calls, compactions included. */
|
|
14
19
|
tokens?: number;
|
|
@@ -20,10 +25,13 @@ export interface AgentLoopBudget {
|
|
|
20
25
|
*/
|
|
21
26
|
wallMs?: number;
|
|
22
27
|
}
|
|
23
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* `awaiting`: `approve` deferred a call, and a resume with the messages `onMessage` stored asks it again; or a client
|
|
30
|
+
* tool was called, and a resume with its result appended runs on from it.
|
|
31
|
+
*/
|
|
24
32
|
export type AgentLoopStop = "end" | "maxRounds" | "budget" | "aborted" | "length" | "quota" | "unauthorized" | "awaiting";
|
|
25
33
|
export interface AgentLoopOptions {
|
|
26
|
-
/** Tool names; the run sees only those the account
|
|
34
|
+
/** Tool names; the run sees only those `AgentToolsRole` lists to the account: `/mcp`'s, plus `mcp: "agent"` ones. */
|
|
27
35
|
allow: readonly string[];
|
|
28
36
|
/** The transcript so far, ending in a user message for a new ask or in unanswered calls for a resumed run. */
|
|
29
37
|
messages: AgentWireMessage[];
|
|
@@ -35,6 +43,19 @@ export interface AgentLoopOptions {
|
|
|
35
43
|
model?: string;
|
|
36
44
|
maxRounds?: number;
|
|
37
45
|
budget?: AgentLoopBudget;
|
|
46
|
+
/**
|
|
47
|
+
* Named groups of `allow` the model adds with `openToolkit({ name })`, a tool this run lists beside them; a tool in no
|
|
48
|
+
* toolkit is listed every round. An opened toolkit's tools are listed from the next round on, `allow` still capping
|
|
49
|
+
* them, and stay open across a resume and a compaction. `openToolkit` is never asked about and counts as no tool call.
|
|
50
|
+
*/
|
|
51
|
+
toolkits?: Record<string, AgentLoopToolkit>;
|
|
52
|
+
/**
|
|
53
|
+
* The tools of a screen a connected browser has open (`AgentClientTools.list()` in `akanjs/ui`): client input,
|
|
54
|
+
* listed beside the endpoint tools and never run here. `approve` is still asked. An allowed call ends the run as
|
|
55
|
+
* `awaiting` with `client: true`; append the browser's result, or an error when no page answers, and resume. A name
|
|
56
|
+
* an endpoint tool or `openToolkit` holds is dropped.
|
|
57
|
+
*/
|
|
58
|
+
clientTools?: AgentTool[];
|
|
38
59
|
/** Summarizes all but the last `keep` messages (6) once the transcript is estimated at `at` tokens. */
|
|
39
60
|
compact?: {
|
|
40
61
|
at: number;
|
|
@@ -93,6 +114,7 @@ export type AgentLoopEvent = {
|
|
|
93
114
|
} | {
|
|
94
115
|
type: "awaiting";
|
|
95
116
|
call: AgentWireToolCall;
|
|
117
|
+
client?: true;
|
|
96
118
|
} | {
|
|
97
119
|
type: "done";
|
|
98
120
|
stop: AgentLoopStop;
|
|
@@ -7,5 +7,5 @@ export declare class LoopCompaction {
|
|
|
7
7
|
static tokensOf(messages: readonly AgentWireMessage[]): number;
|
|
8
8
|
static cutAt(messages: readonly AgentWireMessage[], keep: number): number;
|
|
9
9
|
static digest(messages: readonly AgentWireMessage[], budget?: number): string;
|
|
10
|
-
static message(summary: string, tainted?: boolean): AgentWireMessage;
|
|
10
|
+
static message(summary: string, tainted?: boolean, toolkits?: string[]): AgentWireMessage;
|
|
11
11
|
}
|
|
@@ -2,5 +2,5 @@ import type { AgentLoopRequest } from "./agentLoopTypes.d.ts";
|
|
|
2
2
|
export declare class LoopRequest {
|
|
3
3
|
#private;
|
|
4
4
|
static readonly maxWallMs: number;
|
|
5
|
-
static assertValid({ allow, messages, maxRounds, budget, compact }: AgentLoopRequest): void;
|
|
5
|
+
static assertValid({ allow, messages, maxRounds, budget, compact, toolkits, clientTools }: AgentLoopRequest): void;
|
|
6
6
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AgentTool } from "../predefinedAdaptor/agentTools.adaptor";
|
|
2
|
+
import type { AgentWireMessage, AgentWireToolCall, AgentWireToolResult } from "../predefinedAdaptor/llm.adaptor";
|
|
3
|
+
import type { AgentLoopToolkit } from "./agentLoopTypes.d.ts";
|
|
4
|
+
export declare class LoopToolkits {
|
|
5
|
+
#private;
|
|
6
|
+
static readonly toolName = "openToolkit";
|
|
7
|
+
constructor(kits: Record<string, AgentLoopToolkit> | undefined);
|
|
8
|
+
get opened(): string[];
|
|
9
|
+
isMeta(name: string): boolean;
|
|
10
|
+
listed(visible: AgentTool[]): AgentTool[];
|
|
11
|
+
refusalOf(name: string): string | null;
|
|
12
|
+
open({ id, name, args }: AgentWireToolCall): AgentWireToolResult;
|
|
13
|
+
restore(messages: readonly AgentWireMessage[]): void;
|
|
14
|
+
}
|
|
@@ -16,8 +16,9 @@ export interface AgentTool extends AgentWireTool {
|
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
18
|
* The `/mcp` tool catalogue run in-process as a given account, with the same refusals, masking and error text and
|
|
19
|
-
* `origin` "mcp"
|
|
20
|
-
* only: a page's `page().app()` tool is listed
|
|
19
|
+
* `origin` "mcp", plus every endpoint declared `mcp: "agent"`, which `/mcp` never lists. Built from the DI registry,
|
|
20
|
+
* so a batch server without `/mcp` has it too. Covers the endpoint tools only: a page's `page().app()` tool is listed
|
|
21
|
+
* on `/mcp` but absent here, and `callAs` answers it as an unknown tool.
|
|
21
22
|
* Security: `account` is put on the call after the middleware chain, unchecked — pass one the server resolved, never
|
|
22
23
|
* client input, and resolve a stored one again before reusing it, as a revoked session is not noticed here. Its
|
|
23
24
|
* `machine` field is removed, since only a verified machine token may set one. Both methods throw `InjectError`
|
|
@@ -54,6 +54,8 @@ export interface AgentWireMessage {
|
|
|
54
54
|
* Absent on a summary, nothing judged what it replaced, so a resumed run with `untrusted` counts it as tainted.
|
|
55
55
|
*/
|
|
56
56
|
tainted?: boolean;
|
|
57
|
+
/** On a summary `agentService.loop` wrote: the toolkits its run had opened, which the messages it replaced recorded. */
|
|
58
|
+
toolkits?: string[];
|
|
57
59
|
}
|
|
58
60
|
export interface AgentWireTool {
|
|
59
61
|
name: string;
|
package/types/signal/index.d.ts
CHANGED
|
@@ -31,4 +31,4 @@ export { DatabaseSignal, ServiceSignal, SignalRegistry } from "./signalRegistry.
|
|
|
31
31
|
export { type ResolvedSliceCrud, type ResolvedSliceMcp, type Slice, type SliceCls, type SliceDictArgShape, type SliceDictShape, slice, } from "./slice.d.ts";
|
|
32
32
|
export { buildSlice, type LiveSliceOption, type ResolvedLiveSliceOption, type SliceBuilder, SliceInfo, type SliceInfoArgNames, type SliceInfoArgs, type SliceInfoFilter, type SliceInfoFull, type SliceInfoInput, type SliceInfoInsight, type SliceInfoInternalArgs, type SliceInfoLight, type SliceInfoParts, type SliceInfoRefName, type SliceInfoServerArgs, type SliceInfoSrvs, } from "./sliceInfo.d.ts";
|
|
33
33
|
export { type CanonicalLineMode, getCanonicalLineMode, getCurrentTrace, getFlightThresholdMs, getTraceSnapshot, isDebugHeaderAllowed, isFlightRecorderEnabled, isLocalDevRuntime, isLogContextEnabled, isTraceEnabled, runTraced, runWithTrace, SignalTrace, type SpanRecord, setCanonicalLineMode, setFlightRecorderEnabled, setFlightThresholdMs, setLogContextEnabled, setTraceEnabled, type TraceMode, type TraceOrigin, type TraceOutcome, traceAggregator, traceCache, traceDataLoaderBatch, traceDbQuery, traceSpan, } from "./trace.d.ts";
|
|
34
|
-
export { type ArgType, argTypes, type CnstCapitalizedRefName, type CnstDefault, type CnstDefaultInput, type CnstDefaultState, type CnstFull, type CnstInput, type CnstInsight, type CnstLight, type CnstOf, type CnstPurifiedInput, type CnstRefName, type CnstStateInsight, type CnstStateLight, type DbDoc, type DbFilter, type DbOf, type DbQuery, type DbSort, type EndpointErrorKey, type EndpointErrors, type HttpMutationMethod, type LiveEndpointOption, type LiveEventPayload, type SerializedArg, type SerializedEndpoint, type SerializedFilter, type SerializedReturns, type SerializedSignal, type SerializedSignalMcp, type SerializedSlice, type SignalOption, type SignalType, type SlceCnstCapitalizedRefName, type SlceCnstDefault, type SlceCnstDefaultInput, type SlceCnstDefaultState, type SlceCnstFull, type SlceCnstInput, type SlceCnstInsight, type SlceCnstLight, type SlceCnstPurifiedInput, type SlceCnstRefName, type SlceCnstStateInsight, type SlceCnstStateLight, type SlceDbFilter, type SlceDbQuery, type SlceDbSort, type SlceSrv, type SrvMap, type SrvOf, type SrvRefName, type WebsocketAuthAck, type WebsocketMessageData, type WebsocketPublishData, type WebsocketReqData, type WebsocketResData, type WebsocketResyncData, type WebsocketRoomCursor, type WebsocketSubscribeAck, } from "./types.d.ts";
|
|
34
|
+
export { type ArgType, argTypes, type CnstCapitalizedRefName, type CnstDefault, type CnstDefaultInput, type CnstDefaultState, type CnstFull, type CnstInput, type CnstInsight, type CnstLight, type CnstOf, type CnstPurifiedInput, type CnstRefName, type CnstStateInsight, type CnstStateLight, type DbDoc, type DbFilter, type DbOf, type DbQuery, type DbSort, type EndpointErrorKey, type EndpointErrors, type HttpMutationMethod, type LiveEndpointOption, type LiveEventPayload, type SerializedArg, type SerializedEndpoint, type SerializedFilter, type SerializedReturns, type SerializedSignal, type SerializedSignalMcp, type SerializedSignalShelf, type SerializedSlice, type SignalOption, type SignalType, type SlceCnstCapitalizedRefName, type SlceCnstDefault, type SlceCnstDefaultInput, type SlceCnstDefaultState, type SlceCnstFull, type SlceCnstInput, type SlceCnstInsight, type SlceCnstLight, type SlceCnstPurifiedInput, type SlceCnstRefName, type SlceCnstStateInsight, type SlceCnstStateLight, type SlceDbFilter, type SlceDbQuery, type SlceDbSort, type SlceSrv, type SrvMap, type SrvOf, type SrvRefName, type WebsocketAuthAck, type WebsocketMessageData, type WebsocketPublishData, type WebsocketReqData, type WebsocketResData, type WebsocketResyncData, type WebsocketRoomCursor, type WebsocketSubscribeAck, } from "./types.d.ts";
|
|
@@ -20,6 +20,8 @@ export interface McpDocumentOptions {
|
|
|
20
20
|
* refusal still holds.
|
|
21
21
|
*/
|
|
22
22
|
apps?: boolean;
|
|
23
|
+
/** The in-process agent's catalogue (`AgentToolsRole`), which also lists an endpoint declared `mcp: "agent"`. */
|
|
24
|
+
agent?: boolean;
|
|
23
25
|
}
|
|
24
26
|
export type McpOutputSchemaMode = "full" | "shallow" | "none";
|
|
25
27
|
export interface McpExposedEndpoint {
|
package/types/signal/slice.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type Assign, type MergeAllKeyOfObjects, SLICE_DICT_SHAPE, SLICE_META } from "akanjs/base";
|
|
2
|
+
import { type McpShelf } from "akanjs/common";
|
|
2
3
|
import { type FilterInstance } from "akanjs/document";
|
|
3
4
|
import { type Adaptor, type AdaptorCls, type ServiceModel } from "akanjs/service";
|
|
4
5
|
import type { GuardCls } from "./guard.d.ts";
|
|
@@ -34,10 +35,10 @@ export type SliceCls<SrvModule extends ServiceModel = ServiceModel, SliceInfoObj
|
|
|
34
35
|
};
|
|
35
36
|
/** `root` is absent: it rides on the root slice itself. */
|
|
36
37
|
export interface ResolvedSliceMcp {
|
|
37
|
-
get:
|
|
38
|
-
create:
|
|
39
|
-
update:
|
|
40
|
-
remove:
|
|
38
|
+
get: McpShelf;
|
|
39
|
+
create: McpShelf;
|
|
40
|
+
update: McpShelf;
|
|
41
|
+
remove: McpShelf;
|
|
41
42
|
}
|
|
42
43
|
/** Which generated verbs the server mounts: a verb whose guards resolve to none (or `false`) has no route at all. */
|
|
43
44
|
export interface ResolvedSliceCrud {
|
|
@@ -62,16 +63,17 @@ interface RootSliceOption {
|
|
|
62
63
|
};
|
|
63
64
|
/**
|
|
64
65
|
* Keyed like `guards`, for the root slice and generated CRUD only; `create`/`update`/`remove` fall back to `cru`
|
|
65
|
-
* and a bare
|
|
66
|
-
*
|
|
66
|
+
* and a bare value sets every key; `"agent"` lists it to the in-process agent only. Curation, not authorization: HTTP
|
|
67
|
+
* is unchanged. Omitted, each key takes the narrowest a lib slice passed here set, while `guards` are always this
|
|
68
|
+
* slice's own.
|
|
67
69
|
*/
|
|
68
|
-
mcp?:
|
|
69
|
-
root?:
|
|
70
|
-
get?:
|
|
71
|
-
cru?:
|
|
72
|
-
create?:
|
|
73
|
-
update?:
|
|
74
|
-
remove?:
|
|
70
|
+
mcp?: McpShelf | {
|
|
71
|
+
root?: McpShelf;
|
|
72
|
+
get?: McpShelf;
|
|
73
|
+
cru?: McpShelf;
|
|
74
|
+
create?: McpShelf;
|
|
75
|
+
update?: McpShelf;
|
|
76
|
+
remove?: McpShelf;
|
|
75
77
|
};
|
|
76
78
|
prefix?: string;
|
|
77
79
|
}
|