akanjs 3.0.0-alpha.42 → 3.0.0-alpha.44
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/dictionary/base.dictionary.ts +13 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db-shm +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-shm +0 -0
- package/package.json +1 -1
- package/service/agent.service.ts +19 -1
- package/store/agent/AgentPrompts.ts +14 -3
- package/store/agent/StoreSurfaceSource.ts +0 -61
- package/store/agent/index.ts +0 -1
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +8 -8
- package/types/service/agent.service.d.ts +8 -0
- package/types/store/agent/AgentPrompts.d.ts +1 -1
- package/types/store/agent/index.d.ts +0 -1
- package/types/ui/Agent/Bubble.d.ts +8 -2
- package/types/ui/Agent/Chat.d.ts +9 -7
- package/types/ui/Agent/Composer.d.ts +23 -0
- package/types/ui/Agent/Launcher.d.ts +16 -0
- package/types/ui/Agent/Menu.d.ts +12 -7
- package/types/ui/Agent/Zone.d.ts +5 -3
- package/types/ui/Agent/agentSessionOf.d.ts +18 -0
- package/types/ui/Agent/attachment.d.ts +11 -0
- package/types/ui/Agent/index.d.ts +1 -1
- package/types/ui/Agent/sessionHistory.d.ts +4 -2
- package/types/ui/Agent/useChatAttachments.d.ts +24 -0
- package/types/ui/Agent/useChatVoice.d.ts +30 -0
- package/types/ui/Agent/useDraftRecall.d.ts +14 -0
- package/types/ui/Agent/useSlashMenu.d.ts +24 -0
- package/types/ui/Agent/voice.d.ts +5 -0
- package/types/vendor/use-agentic/AgentSession.d.ts +3 -2
- package/types/vendor/use-agentic/Transcript.d.ts +18 -0
- package/types/vendor/use-agentic/index.d.ts +1 -0
- package/ui/Agent/Bubble.tsx +48 -27
- package/ui/Agent/Chat.tsx +210 -269
- package/ui/Agent/Composer.tsx +77 -0
- package/ui/Agent/Launcher.tsx +57 -0
- package/ui/Agent/Menu.tsx +32 -38
- package/ui/Agent/Zone.tsx +41 -13
- package/ui/Agent/agentSessionOf.ts +41 -0
- package/ui/Agent/attachment.ts +20 -0
- package/ui/Agent/sessionHistory.ts +6 -3
- package/ui/Agent/useChatAttachments.ts +84 -0
- package/ui/Agent/useChatVoice.ts +129 -0
- package/ui/Agent/useDraftRecall.ts +42 -0
- package/ui/Agent/useSlashMenu.ts +58 -0
- package/ui/Agent/voice.ts +9 -0
- package/vendor/use-agentic/AgentSession.ts +28 -12
- package/vendor/use-agentic/Transcript.ts +50 -0
- package/vendor/use-agentic/WIRE.md +7 -0
- package/vendor/use-agentic/index.ts +1 -0
- package/store/agent/StateWait.ts +0 -139
- package/types/store/agent/StateWait.d.ts +0 -36
|
@@ -60,6 +60,19 @@ export const baseDictionary = serviceDictionary(["en", "ko"])
|
|
|
60
60
|
agentAttachRemove: ["Remove attachment", "첨부 제거"],
|
|
61
61
|
agentAttachTooLarge: ["{name} is too large to attach.", "{name}은(는) 용량이 너무 커서 첨부할 수 없습니다."],
|
|
62
62
|
agentAttachUnsupported: ["{name} cannot be attached here.", "{name}은(는) 여기에 첨부할 수 없습니다."],
|
|
63
|
+
agentAttachDuplicate: ["{name} is already attached.", "{name}은(는) 이미 첨부되어 있습니다."],
|
|
64
|
+
agentAttachTooMany: [
|
|
65
|
+
"One message can carry {count} files at most.",
|
|
66
|
+
"한 메시지에는 파일을 최대 {count}개까지 첨부할 수 있습니다.",
|
|
67
|
+
],
|
|
68
|
+
agentAttachTooMuch: [
|
|
69
|
+
"{name} would make this message too large to send.",
|
|
70
|
+
"{name}을(를) 더하면 메시지가 너무 커서 보낼 수 없습니다.",
|
|
71
|
+
],
|
|
72
|
+
agentAnswerNeeded: ["Type an answer to the question above.", "위 질문에 대한 답을 입력하세요."],
|
|
73
|
+
agentToolDone: ["Done", "완료"],
|
|
74
|
+
agentToolFailed: ["Failed", "실패"],
|
|
75
|
+
agentToolRunning: ["Running", "실행 중"],
|
|
63
76
|
agentContinue: ["This is taking a while. Keep going?", "시간이 걸리고 있습니다. 계속할까요?"],
|
|
64
77
|
agentKeepGoing: ["Keep going", "계속하기"],
|
|
65
78
|
agentCmdNew: ["Start a new conversation", "새 대화 시작"],
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/service/agent.service.ts
CHANGED
|
@@ -12,11 +12,29 @@ export class AgentService extends serve("agent" as const, ({ plug }) => ({
|
|
|
12
12
|
llm: plug(LlmAdaptorRole),
|
|
13
13
|
})) {
|
|
14
14
|
async runTurn(request: LlmTurnRequest, onDelta?: (delta: string) => void) {
|
|
15
|
-
const
|
|
15
|
+
const prepared = AgentService.readable(AgentService.explained(request), this.llm.accepts);
|
|
16
|
+
const answer = await this.llm.chat(prepared, onDelta);
|
|
16
17
|
if (!answer) throw new Err("agent.error.llmUnavailable");
|
|
17
18
|
return { text: answer.text ?? "", toolCalls: answer.toolCalls ?? [], stop: answer.stop };
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Folds a failed turn into the message text. `error` is a field only this wire has, so a provider mapping reads
|
|
23
|
+
* `text` and drops it — leaving the model an assistant turn that says nothing, with no hint that the attempt
|
|
24
|
+
* failed, and every reason to make the same one again. Done here rather than per adaptor because every adaptor
|
|
25
|
+
* would otherwise have to remember, and forgetting is silent.
|
|
26
|
+
*/
|
|
27
|
+
static explained(request: LlmTurnRequest): LlmTurnRequest {
|
|
28
|
+
if (!request.messages.some((message) => message.error)) return request;
|
|
29
|
+
return { ...request, messages: request.messages.map((message) => AgentService.explainedMessage(message)) };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
private static explainedMessage(message: AgentWireMessage): AgentWireMessage {
|
|
33
|
+
const { error, ...rest } = message;
|
|
34
|
+
if (!error) return message;
|
|
35
|
+
return { ...rest, text: [message.text, `[The turn failed: ${error}]`].filter(Boolean).join("\n\n") };
|
|
36
|
+
}
|
|
37
|
+
|
|
20
38
|
/**
|
|
21
39
|
* Replaces every attachment the provider cannot read with a note naming it, so no adaptor has to think about
|
|
22
40
|
* attachments it does not support and none can lose one quietly. The model has to be *told*, not merely spared:
|
|
@@ -49,11 +49,22 @@ export class AgentPrompts {
|
|
|
49
49
|
return this.list().find((prompt) => prompt.name === name) ?? null;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
/** `/name arg1
|
|
52
|
+
/** `/name arg1 "an arg with spaces"` — positional because a prompt's arguments are flat strings by protocol. */
|
|
53
53
|
static parseCommand(draft: string): { name: string; args: string[] } | null {
|
|
54
|
-
const match = /^\/([A-Za-z0-9_-]+)(?:\s+(
|
|
54
|
+
const match = /^\/([A-Za-z0-9_-]+)(?:\s+([\s\S]*))?$/.exec(draft.trim());
|
|
55
55
|
if (!match) return null;
|
|
56
|
-
return { name: match[1], args: match[2]
|
|
56
|
+
return { name: match[1], args: AgentPrompts.#args(match[2] ?? "") };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whitespace separates arguments, and quotes are how a sentence stays one of them — a prompt taking a single
|
|
61
|
+
* `String` is the common case, and splitting "plan the week" into three arguments fills the second parameter
|
|
62
|
+
* with the second word.
|
|
63
|
+
*/
|
|
64
|
+
static #args(rest: string): string[] {
|
|
65
|
+
const args: string[] = [];
|
|
66
|
+
for (const token of rest.matchAll(/"([^"]*)"|'([^']*)'|(\S+)/g)) args.push(token[1] ?? token[2] ?? token[3]);
|
|
67
|
+
return args;
|
|
57
68
|
}
|
|
58
69
|
|
|
59
70
|
/** The messages a prompt returns become the user's turn, the way an MCP client sends a `prompts/get` result. */
|
|
@@ -4,7 +4,6 @@ import { AgentBridge } from "./AgentBridge";
|
|
|
4
4
|
import { ScreenReader } from "./ScreenReader";
|
|
5
5
|
import { ScreenSettle } from "./ScreenSettle";
|
|
6
6
|
import { ScreenTarget } from "./ScreenTarget";
|
|
7
|
-
import { StateWait } from "./StateWait";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* The tools every akan screen has whatever it declares: where it can go, what it is rendering, what one of the
|
|
@@ -39,7 +38,6 @@ export class StoreSurfaceSource implements SurfaceSource {
|
|
|
39
38
|
StoreSurfaceSource.#goBack(),
|
|
40
39
|
StoreSurfaceSource.#readScreen(viewKey),
|
|
41
40
|
this.#readState(viewKey),
|
|
42
|
-
this.#waitFor(viewKey),
|
|
43
41
|
StoreSurfaceSource.#highlight(viewKey),
|
|
44
42
|
];
|
|
45
43
|
this.#builtins.set(viewKey, builtins);
|
|
@@ -192,65 +190,6 @@ export class StoreSurfaceSource implements SurfaceSource {
|
|
|
192
190
|
};
|
|
193
191
|
}
|
|
194
192
|
|
|
195
|
-
/**
|
|
196
|
-
* The wait that costs no model turns.
|
|
197
|
-
*
|
|
198
|
-
* An agent that started something slow has one way to learn it finished: ask again, and again, a full round trip
|
|
199
|
-
* per look. That burns the turn budget in seconds and reads to the user as a loop. This parks the call instead —
|
|
200
|
-
* the session already awaits `run`, so the turn simply takes as long as the work does, and the change report
|
|
201
|
-
* that follows carries whatever landed while it waited.
|
|
202
|
-
*
|
|
203
|
-
* It watches a published state key rather than sleeping for a fixed span. A bare sleep would only make the
|
|
204
|
-
* polling slower, and a screen that can report progress at all reports it into the store; a screen that reports
|
|
205
|
-
* none publishes a key with `st.expose`, which is worth doing anyway, since the key is then readable too.
|
|
206
|
-
*/
|
|
207
|
-
#waitFor(viewKey: string): ToolEntry {
|
|
208
|
-
return {
|
|
209
|
-
name: "waitFor",
|
|
210
|
-
description:
|
|
211
|
-
"Wait here until one of this page's state keys settles, instead of asking again and again. Use it after starting something slow — a generation, an upload, a long job — whenever a state key reports how it is going: the turn pauses with no model round trip and resumes the moment the key moves. Keys are listed in the state context block. Returns what the key holds when the wait ends.",
|
|
212
|
-
parameters: {
|
|
213
|
-
type: "object",
|
|
214
|
-
properties: {
|
|
215
|
-
key: { type: "string", description: "The state key to watch, spelled as the state context block lists it." },
|
|
216
|
-
equals: {
|
|
217
|
-
type: "string",
|
|
218
|
-
description:
|
|
219
|
-
"Wait until the key reads exactly this, compared as text. Omit to wait until it changes from whatever it holds now.",
|
|
220
|
-
},
|
|
221
|
-
timeoutSeconds: {
|
|
222
|
-
type: "number",
|
|
223
|
-
description: `How long to wait before answering with the key's current value. Default ${StateWait.defaultSeconds}, maximum ${StateWait.maxSeconds}. Running out is not a failure — call waitFor again to keep waiting.`,
|
|
224
|
-
},
|
|
225
|
-
},
|
|
226
|
-
required: ["key"],
|
|
227
|
-
additionalProperties: false,
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
effect: "state",
|
|
231
|
-
run: async (args) => {
|
|
232
|
-
this.#bridge ??= AgentBridge.of();
|
|
233
|
-
const key = typeof args.key === "string" ? args.key.trim() : "";
|
|
234
|
-
if (!key) throw new Error("waitFor needs a key to watch.");
|
|
235
|
-
const live = this.#bridge.readableKeys(viewKey);
|
|
236
|
-
if (!live.includes(key))
|
|
237
|
-
throw new Error(
|
|
238
|
-
`No state key named ${key} is read by this screen. ${
|
|
239
|
-
live.length
|
|
240
|
-
? `Keys here: ${live.join(", ")}.`
|
|
241
|
-
: "This screen reads no state keys, so there is nothing to wait for."
|
|
242
|
-
}`,
|
|
243
|
-
);
|
|
244
|
-
return await new StateWait(this.#bridge, {
|
|
245
|
-
key,
|
|
246
|
-
viewKey,
|
|
247
|
-
equals: typeof args.equals === "string" ? args.equals : null,
|
|
248
|
-
seconds: args.timeoutSeconds,
|
|
249
|
-
}).run();
|
|
250
|
-
},
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
193
|
/**
|
|
255
194
|
* The ring goes on once the scroll lands, not when it starts: a smooth scroll across a long page takes most of a
|
|
256
195
|
* second, and a flash begun at the top is already fading by the time the user's eye arrives. Settles on the
|
package/store/agent/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ export * from "./AgentPrompts";
|
|
|
7
7
|
export * from "./ScreenReader";
|
|
8
8
|
export * from "./ScreenSettle";
|
|
9
9
|
export * from "./ScreenTarget";
|
|
10
|
-
export * from "./StateWait";
|
|
11
10
|
export * from "./StoreCatalogue";
|
|
12
11
|
export * from "./StoreSurfaceSource";
|
|
13
12
|
export * from "./storeSurface";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const baseDictionary: import("./dictInfo.d.ts").ServiceDictInfo<[string, string], "ping" | "pingBody" | "pingParam" | "pingQuery" | "wsPing" | "pubsubPing", never, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view">;
|
|
1
|
+
export declare const baseDictionary: import("./dictInfo.d.ts").ServiceDictInfo<[string, string], "ping" | "pingBody" | "pingParam" | "pingQuery" | "wsPing" | "pubsubPing", never, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view">;
|
|
@@ -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" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view">, never>;
|
|
3
|
+
base: import("./locale.d.ts").DictModule<import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view">, never>;
|
|
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.deepseekRequestFailed">;
|
|
6
6
|
};
|
|
7
|
-
export declare const Err: import("./trans.d.ts").ErrConstructor<"agent.error.llmUnavailable" | "agent.error.deepseekRequestFailed">, translate: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
-
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
-
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
-
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
-
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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" | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, __Error_Key__: "agent.error.llmUnavailable" | "agent.error.deepseekRequestFailed";
|
|
7
|
+
export declare const Err: import("./trans.d.ts").ErrConstructor<"agent.error.llmUnavailable" | "agent.error.deepseekRequestFailed">, translate: (lang: "en" | "ko" | "zhChs" | "zhCht" | "ja", key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
+
info: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
+
success: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
+
error: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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
|
+
warning: (key: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | 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" | "zhChs" | "zhCht" | "ja") => object, getAllDictionary: () => import("./trans.d.ts").RootDictionary, __Dict_Key__: import("./locale.d.ts").ServiceTranslatorKey<"base", BaseEndpoint, "error" | "remove" | "save" | "refresh" | "password" | "stop" | "send" | "skip" | "agent" | "ok" | "connecting" | "new" | "somethingWrong" | "connected" | "serverDisconnected" | "refreshing" | "tryReconnecting" | "serverHasProblem" | "checkServerStatus" | "success" | "failed" | "processing" | "processed" | "noData" | "invalidValueError" | "emailInvalidError" | "phoneInvalidError" | "cancel" | "unauthorized" | "agentIntro" | "agentPlaceholder" | "agentClear" | "agentQuestion" | "agentAnswer" | "agentListen" | "agentVoiceFailed" | "agentAttach" | "agentAttachRemove" | "agentAttachTooLarge" | "agentAttachUnsupported" | "agentAttachDuplicate" | "agentAttachTooMany" | "agentAttachTooMuch" | "agentAnswerNeeded" | "agentToolDone" | "agentToolFailed" | "agentToolRunning" | "agentContinue" | "agentKeepGoing" | "agentCmdNew" | "agentCmdRetry" | "agentCmdCompact" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "agentNothingToCompact" | "agentCompacted" | "agentSummary" | "agentBusy" | "agentCopied" | "agentCopyFailed" | "agentToolsHead" | "agentToolsState" | "approve" | "decline" | "confirmClose" | "textTooShortError" | "textTooLongError" | "selectTooShortError" | "selectTooLongError" | "numberTooSmallError" | "numberTooBigError" | "passwordNotMatchError" | "selectDateError" | "priceUnit" | "passwordConfirm" | "noOptions" | "addModel" | "createModel" | "createSuccess" | "updateModel" | "removeModel" | "updateSuccess" | "removeSuccess" | "sureToRemove" | "irreversibleOps" | "typeNameToRemove" | "yesRemove" | "removeMsg" | "confirmMsg" | "perPage" | "cardView" | "tableView" | "exportCsv" | "exportJson" | "actions" | "edit" | "view"> | import("./locale.d.ts").ScalarTranslatorKey<"agentTurn", AgentTurn, never> | `agentStop.${string}` | `agentStop.${string}.desc` | import("./locale.d.ts").ServiceTranslatorKey<"agent", AgentEndpoint, never>, __Error_Key__: "agent.error.llmUnavailable" | "agent.error.deepseekRequestFailed";
|
|
@@ -8,6 +8,14 @@ export declare class AgentService extends AgentService_base {
|
|
|
8
8
|
toolCalls: import("./predefinedAdaptor.d.ts").AgentWireToolCall[];
|
|
9
9
|
stop: "end" | "toolUse";
|
|
10
10
|
}>;
|
|
11
|
+
/**
|
|
12
|
+
* Folds a failed turn into the message text. `error` is a field only this wire has, so a provider mapping reads
|
|
13
|
+
* `text` and drops it — leaving the model an assistant turn that says nothing, with no hint that the attempt
|
|
14
|
+
* failed, and every reason to make the same one again. Done here rather than per adaptor because every adaptor
|
|
15
|
+
* would otherwise have to remember, and forgetting is silent.
|
|
16
|
+
*/
|
|
17
|
+
static explained(request: LlmTurnRequest): LlmTurnRequest;
|
|
18
|
+
private static explainedMessage;
|
|
11
19
|
/**
|
|
12
20
|
* Replaces every attachment the provider cannot read with a note naming it, so no adaptor has to think about
|
|
13
21
|
* attachments it does not support and none can lose one quietly. The model has to be *told*, not merely spared:
|
|
@@ -20,7 +20,7 @@ export declare class AgentPrompts {
|
|
|
20
20
|
constructor(signals: Record<string, SerializedSignal>);
|
|
21
21
|
list(): AgentPrompt[];
|
|
22
22
|
find(name: string): AgentPrompt | null;
|
|
23
|
-
/** `/name arg1
|
|
23
|
+
/** `/name arg1 "an arg with spaces"` — positional because a prompt's arguments are flat strings by protocol. */
|
|
24
24
|
static parseCommand(draft: string): {
|
|
25
25
|
name: string;
|
|
26
26
|
args: string[];
|
|
@@ -5,7 +5,6 @@ export * from "./AgentPrompts.d.ts";
|
|
|
5
5
|
export * from "./ScreenReader.d.ts";
|
|
6
6
|
export * from "./ScreenSettle.d.ts";
|
|
7
7
|
export * from "./ScreenTarget.d.ts";
|
|
8
|
-
export * from "./StateWait.d.ts";
|
|
9
8
|
export * from "./StoreCatalogue.d.ts";
|
|
10
9
|
export * from "./StoreSurfaceSource.d.ts";
|
|
11
10
|
export * from "./storeSurface.d.ts";
|
|
@@ -13,5 +13,11 @@ interface BubbleProps {
|
|
|
13
13
|
*/
|
|
14
14
|
results?: ReadonlyMap<string, ToolCallResult>;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Memoized because the transcript re-renders on every streamed delta and on every keystroke in the composer, and
|
|
18
|
+
* a settled bubble re-parses its markdown for nothing each time. The props are compared by identity, so the caller
|
|
19
|
+
* hands the same `results` map and `progress` value to every row — which is why only the rows that actually
|
|
20
|
+
* changed re-render.
|
|
21
|
+
*/
|
|
22
|
+
declare const _default: import("react").MemoExoticComponent<({ className, message, progress, results }: BubbleProps) => import("react/jsx-runtime").JSX.Element>;
|
|
23
|
+
export default _default;
|
package/types/ui/Agent/Chat.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type AgentRunner, type CompactOptions } from "../../vendor/use-agentic.d.ts";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import type { AttachReader } from "./attachment.d.ts";
|
|
4
|
+
import type { PersistOption } from "./sessionHistory.d.ts";
|
|
5
|
+
import type { VoiceEngine } from "./voice.d.ts";
|
|
6
6
|
export interface ChatProps {
|
|
7
7
|
className?: string;
|
|
8
8
|
title?: string;
|
|
@@ -21,6 +21,8 @@ export interface ChatProps {
|
|
|
21
21
|
persist?: PersistOption;
|
|
22
22
|
/** Renders in the page flow instead of floating above it — a zone chat that lives inside its own section. */
|
|
23
23
|
inline?: boolean;
|
|
24
|
+
/** `false` gives the browser its own Cmd/Ctrl+L back, for an app whose shell already spends that chord. */
|
|
25
|
+
shortcut?: boolean;
|
|
24
26
|
/**
|
|
25
27
|
* Reads a file the user attached into an attachment, or answers `null` to leave it to the built-in reader
|
|
26
28
|
* (images as bytes, text as text). This is where an app puts what needs a parser — a PDF's text, a spreadsheet's
|
|
@@ -38,10 +40,10 @@ export interface ChatProps {
|
|
|
38
40
|
/**
|
|
39
41
|
* The user-facing half of the in-page agent: one floating chat wired to the same surface the dock inspects.
|
|
40
42
|
* The conversation loop runs in this browser session — every tool call executes here, gated by the approval
|
|
41
|
-
* card — and the session lives in a ref, so it survives reopening the panel and dies with the page
|
|
42
|
-
*
|
|
43
|
-
* loop while keeping this UI.
|
|
43
|
+
* card — and the session lives in a ref, so it survives reopening the panel and dies with the page unless
|
|
44
|
+
* `persist` keeps it. An enclosing AgentProvider's session wins, which is how an app isolates a surface or swaps
|
|
45
|
+
* the loop while keeping this UI.
|
|
44
46
|
*/
|
|
45
|
-
export declare const DefaultChat: ({ className, title, instructions, runner, maxTurns, compact, defaultOpen, persist, inline, attach, voice, }: ChatProps) => ReactNode;
|
|
47
|
+
export declare const DefaultChat: ({ className, title, instructions, runner, maxTurns, compact, defaultOpen, persist, inline, shortcut, attach, voice, }: ChatProps) => ReactNode;
|
|
46
48
|
declare const _default: import("react").ComponentType<ChatProps>;
|
|
47
49
|
export default _default;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { KeyboardEvent, Ref } from "react";
|
|
2
|
+
import type { AgentSession, MessageAttachment } from "../../vendor/use-agentic.d.ts";
|
|
3
|
+
interface ComposerProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
session: AgentSession;
|
|
6
|
+
draft: string;
|
|
7
|
+
attached: readonly MessageAttachment[];
|
|
8
|
+
/** Absent when the screen cannot listen — the same rule as publishing no tool for a control that is not drawn. */
|
|
9
|
+
mic?: {
|
|
10
|
+
listening: boolean;
|
|
11
|
+
onToggle: () => void;
|
|
12
|
+
};
|
|
13
|
+
onDraft: (text: string) => void;
|
|
14
|
+
onKeyDown: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
15
|
+
onFiles: (files: File[]) => void;
|
|
16
|
+
onRemoveFile: (idx: number) => void;
|
|
17
|
+
onSend: () => void;
|
|
18
|
+
onStop: () => void;
|
|
19
|
+
inputRef?: Ref<HTMLInputElement>;
|
|
20
|
+
}
|
|
21
|
+
/** What the user writes with: the staged files above, and the controls that send or stop below them. */
|
|
22
|
+
export declare const Composer: ({ className, session, draft, attached, mic, onDraft, onKeyDown, onFiles, onRemoveFile, onSend, onStop, inputRef, }: ComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Ref } from "react";
|
|
2
|
+
interface LauncherProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
label: string;
|
|
5
|
+
/** The chord that opens the chat, shown on hover. Null until the platform is known, which needs the client. */
|
|
6
|
+
hotkey?: {
|
|
7
|
+
label: string;
|
|
8
|
+
keys: string;
|
|
9
|
+
} | null;
|
|
10
|
+
/** Messages that arrived while the panel was closed, so a finished turn is not silent. */
|
|
11
|
+
unread: number;
|
|
12
|
+
onOpen: () => void;
|
|
13
|
+
buttonRef?: Ref<HTMLButtonElement>;
|
|
14
|
+
}
|
|
15
|
+
export declare const Launcher: ({ className, label, hotkey, unread, onOpen, buttonRef }: LauncherProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
package/types/ui/Agent/Menu.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface MenuRow {
|
|
2
|
+
name: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
/** The argument names a prompt takes, shown so a user knows what to type after the name. */
|
|
5
|
+
hint?: string;
|
|
6
|
+
pick: () => void;
|
|
7
|
+
}
|
|
3
8
|
interface MenuProps {
|
|
4
9
|
className?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
rows: MenuRow[];
|
|
11
|
+
/** Index the arrows are on. Enter picks it and Tab completes its name, so it has to be visible. */
|
|
12
|
+
selected: number;
|
|
13
|
+
onPick: (row: MenuRow) => void;
|
|
9
14
|
}
|
|
10
15
|
/** The `/` menu: this chat's own commands first, then the app's `prompt()` endpoints. */
|
|
11
|
-
export default function Menu({ className,
|
|
16
|
+
export default function Menu({ className, rows, selected, onPick }: MenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
17
|
export {};
|
package/types/ui/Agent/Zone.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { type AgentRunner } from "../../vendor/use-agentic.d.ts";
|
|
3
|
-
import {
|
|
2
|
+
import { type AgentRunner, type CompactOptions } from "../../vendor/use-agentic.d.ts";
|
|
3
|
+
import type { PersistOption } from "./sessionHistory.d.ts";
|
|
4
4
|
export interface ZoneProps {
|
|
5
5
|
className?: string;
|
|
6
6
|
/** Names the zone; the scope id and the `data-agent-zone` container both derive from it. */
|
|
@@ -10,6 +10,8 @@ export interface ZoneProps {
|
|
|
10
10
|
instructions?: string;
|
|
11
11
|
runner?: AgentRunner;
|
|
12
12
|
maxTurns?: number;
|
|
13
|
+
/** When this zone's conversation summarizes itself — same contract as the chat's own `compact`. */
|
|
14
|
+
compact?: CompactOptions;
|
|
13
15
|
/** Keeps this zone's transcript across reloads, keyed by the zone's scope path. */
|
|
14
16
|
persist?: PersistOption;
|
|
15
17
|
children: ReactNode;
|
|
@@ -20,4 +22,4 @@ export interface ZoneProps {
|
|
|
20
22
|
* zones are views, never walls. An `Agent.Chat` mounted inside binds to this session automatically, so two zones
|
|
21
23
|
* on one screen run two conversations in parallel, each seeing only its own subtree.
|
|
22
24
|
*/
|
|
23
|
-
export declare const Zone: ({ className, id, label, instructions, runner, maxTurns, persist, children }: ZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const Zone: ({ className, id, label, instructions, runner, maxTurns, compact, persist, children, }: ZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type AgentRunner, AgentSession, type CompactOptions } from "../../vendor/use-agentic.d.ts";
|
|
2
|
+
import { type PersistOption } from "./sessionHistory.d.ts";
|
|
3
|
+
export interface AgentSessionSetup {
|
|
4
|
+
/** Read per call rather than captured, so text the session builds follows a language switched mid-conversation. */
|
|
5
|
+
l: (key: string) => string;
|
|
6
|
+
/** The zone's scope path, empty for the root agent — it picks both the surface view and the persistence key. */
|
|
7
|
+
view?: string[];
|
|
8
|
+
runner?: AgentRunner;
|
|
9
|
+
instructions?: string;
|
|
10
|
+
maxTurns?: number;
|
|
11
|
+
compact?: CompactOptions;
|
|
12
|
+
persist?: PersistOption;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The one place a chat session is wired to the akan runtime. Chat and Zone both build one, and building it twice
|
|
16
|
+
* is how a zone came to be the only surface with no `compact` option — an option added on one side of a copy.
|
|
17
|
+
*/
|
|
18
|
+
export declare const agentSessionOf: ({ l, view, runner, instructions, maxTurns, compact, persist, }: AgentSessionSetup) => AgentSession;
|
|
@@ -7,6 +7,13 @@ export type AttachReader = (file: File) => Promise<MessageAttachment | null>;
|
|
|
7
7
|
* the user learns which file it was.
|
|
8
8
|
*/
|
|
9
9
|
export declare const maxAttachmentBytes: number;
|
|
10
|
+
/**
|
|
11
|
+
* Ceilings for one message rather than one file. The bytes ride inside a single turn's JSON, so what a provider
|
|
12
|
+
* refuses is the sum — and a count cap keeps a whole folder dropped onto the panel from becoming one request that
|
|
13
|
+
* cannot be sent and cannot be edited down without starting over.
|
|
14
|
+
*/
|
|
15
|
+
export declare const maxMessageAttachmentBytes: number;
|
|
16
|
+
export declare const maxMessageAttachments = 5;
|
|
10
17
|
export type AttachFailure = "tooLarge" | "unsupported";
|
|
11
18
|
export declare class Attachment {
|
|
12
19
|
#private;
|
|
@@ -20,4 +27,8 @@ export declare class Attachment {
|
|
|
20
27
|
*/
|
|
21
28
|
static read(file: File, attach?: AttachReader): Promise<MessageAttachment | AttachFailure>;
|
|
22
29
|
static failure(value: MessageAttachment | AttachFailure): value is AttachFailure;
|
|
30
|
+
/** What this attachment costs the request: base64 carries three bytes per four characters, less its padding. */
|
|
31
|
+
static bytesOf(attachment: MessageAttachment): number;
|
|
32
|
+
/** Same name and same size is the same file picked twice — the shape a re-drop or a double paste produces. */
|
|
33
|
+
static same(one: MessageAttachment, other: MessageAttachment): boolean;
|
|
23
34
|
}
|
|
@@ -13,5 +13,5 @@ export declare const Agent: {
|
|
|
13
13
|
StateKey: typeof StateKey;
|
|
14
14
|
Tool: typeof Tool;
|
|
15
15
|
Transcript: typeof Transcript;
|
|
16
|
-
Zone: ({ className, id, label, instructions, runner, maxTurns, persist, children }: import("./Zone.d.ts").ZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
Zone: ({ className, id, label, instructions, runner, maxTurns, compact, persist, children, }: import("./Zone.d.ts").ZoneProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SessionHistory } from "../../vendor/use-agentic.d.ts";
|
|
2
2
|
export type PersistOption = boolean | {
|
|
3
3
|
storage?: "session" | "local";
|
|
4
4
|
key?: string;
|
|
@@ -7,6 +7,8 @@ export type PersistOption = boolean | {
|
|
|
7
7
|
* Maps the `persist` prop onto a `SessionHistory` over web storage. Session storage is the default on purpose:
|
|
8
8
|
* surviving a refresh is the whole ask, and a transcript that dies with the tab never lingers on a shared machine
|
|
9
9
|
* or collides across tabs. `"local"` is the explicit opt-up. The envelope is versioned so a wire change discards
|
|
10
|
-
* stale transcripts instead of replaying them, and only the newest messages are kept under the cap
|
|
10
|
+
* stale transcripts instead of replaying them, and only the newest messages are kept under the cap — which is
|
|
11
|
+
* why the cap is applied *before* the pairing repair: the window it keeps can start between a tool call and the
|
|
12
|
+
* result answering it, and a transcript restored in that state is refused by the provider on its first turn.
|
|
11
13
|
*/
|
|
12
14
|
export declare const sessionHistoryOf: (persist: PersistOption | undefined, pathKey?: string) => SessionHistory | undefined;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type DragEventHandler } from "react";
|
|
2
|
+
import type { AgentSession, MessageAttachment } from "../../vendor/use-agentic.d.ts";
|
|
3
|
+
import { type AttachReader } from "./attachment.d.ts";
|
|
4
|
+
interface ChatAttachmentsSetup {
|
|
5
|
+
session: AgentSession;
|
|
6
|
+
attach?: AttachReader;
|
|
7
|
+
l: (key: string, param?: Record<string, string | number>) => string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* What the composer is holding, and the ceilings it holds it under. Staged files are mirrored in a ref because a
|
|
11
|
+
* multi-file drop reads them one at a time: the cap has to see what the previous file of the same drop added, and
|
|
12
|
+
* React state inside that loop is still the value the render started with.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useChatAttachments: ({ session, attach, l }: ChatAttachmentsSetup) => {
|
|
15
|
+
attached: MessageAttachment[];
|
|
16
|
+
dragging: boolean;
|
|
17
|
+
dropProps: {
|
|
18
|
+
[key: string]: DragEventHandler<HTMLElement>;
|
|
19
|
+
};
|
|
20
|
+
add: (files: File[]) => Promise<void>;
|
|
21
|
+
clear: () => void;
|
|
22
|
+
remove: (idx: number) => void;
|
|
23
|
+
};
|
|
24
|
+
export {};
|