akanjs 3.0.0-alpha.41 → 3.0.0-alpha.43
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/agent.dictionary.ts +4 -4
- package/dictionary/base.dictionary.ts +17 -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/service/predefinedAdaptor/deepseekLlm.ts +33 -4
- package/service/predefinedAdaptor/llm.adaptor.ts +11 -2
- package/signal/agentTurnStream.ts +13 -1
- package/store/agent/AgentPrompts.ts +14 -3
- 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/service/predefinedAdaptor/deepseekLlm.d.ts +6 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +11 -2
- package/types/signal/agentTurnStream.d.ts +8 -0
- package/types/store/agent/AgentPrompts.d.ts +1 -1
- package/types/ui/Agent/Bubble.d.ts +8 -2
- package/types/ui/Agent/Chat.d.ts +15 -8
- 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 +19 -2
- package/types/vendor/use-agentic/Compaction.d.ts +45 -0
- package/types/vendor/use-agentic/Transcript.d.ts +18 -0
- package/types/vendor/use-agentic/index.d.ts +2 -0
- package/types/vendor/use-agentic/types.d.ts +13 -1
- package/ui/Agent/Bubble.tsx +58 -28
- package/ui/Agent/Chat.tsx +216 -262
- package/ui/Agent/ChatCommands.ts +11 -1
- 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/fetchRunner.ts +17 -3
- 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/ui/Load/Units.tsx +2 -2
- package/vendor/use-agentic/AgentSession.ts +124 -13
- package/vendor/use-agentic/Compaction.ts +110 -0
- package/vendor/use-agentic/Transcript.ts +50 -0
- package/vendor/use-agentic/WIRE.md +13 -1
- package/vendor/use-agentic/httpRunner.ts +21 -5
- package/vendor/use-agentic/index.ts +2 -0
- package/vendor/use-agentic/types.ts +11 -1
|
@@ -21,11 +21,11 @@ export const agentDictionary = serviceDictionary(["en", "ko"])
|
|
|
21
21
|
}))
|
|
22
22
|
.error({
|
|
23
23
|
llmUnavailable: [
|
|
24
|
-
"The agent
|
|
25
|
-
"
|
|
24
|
+
"The agent is unavailable — this app has no language model configured",
|
|
25
|
+
"에이전트를 사용할 수 없습니다. 이 앱에 언어 모델이 설정되어 있지 않습니다",
|
|
26
26
|
],
|
|
27
27
|
deepseekRequestFailed: [
|
|
28
|
-
"DeepSeek
|
|
29
|
-
"DeepSeek
|
|
28
|
+
"DeepSeek refused this turn with status {status}. Reason: {reason}",
|
|
29
|
+
"DeepSeek가 이번 턴을 거절했습니다 (status {status}). 사유: {reason}",
|
|
30
30
|
],
|
|
31
31
|
});
|
|
@@ -60,10 +60,24 @@ 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", "새 대화 시작"],
|
|
66
79
|
agentCmdRetry: ["Send the last message again", "마지막 메시지 다시 보내기"],
|
|
80
|
+
agentCmdCompact: ["Summarize the conversation so far", "지금까지의 대화 요약하기"],
|
|
67
81
|
agentCmdCopy: ["Copy this conversation", "이 대화 복사"],
|
|
68
82
|
agentCmdHelp: ["What you can do here", "여기서 할 수 있는 것"],
|
|
69
83
|
agentCmdTools: ["List this screen's tools", "이 화면의 툴 목록"],
|
|
@@ -76,6 +90,9 @@ export const baseDictionary = serviceDictionary(["en", "ko"])
|
|
|
76
90
|
"에이전트는 혼자 결정하면 안 되는 일을 하기 전에 물어보며, 중지는 진행 중인 턴을 끝냅니다.",
|
|
77
91
|
],
|
|
78
92
|
agentNothingToRetry: ["There is no message to send again.", "다시 보낼 메시지가 없습니다."],
|
|
93
|
+
agentNothingToCompact: ["There is nothing to summarize yet.", "아직 요약할 대화가 없습니다."],
|
|
94
|
+
agentCompacted: ["Summarized the conversation so far.", "지금까지의 대화를 요약했습니다."],
|
|
95
|
+
agentSummary: ["Summary of the earlier conversation", "이전 대화 요약"],
|
|
79
96
|
agentBusy: ["A turn is still running. Stop it first.", "진행 중인 턴이 있습니다. 먼저 중지하세요."],
|
|
80
97
|
agentCopied: ["Conversation copied to the clipboard.", "대화를 클립보드에 복사했습니다."],
|
|
81
98
|
agentCopyFailed: ["Could not reach the clipboard.", "클립보드에 접근할 수 없습니다."],
|
|
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:
|
|
@@ -54,8 +54,9 @@ export class DeepseekLlm
|
|
|
54
54
|
const body = await this.#apiStream("/chat/completions", DeepseekLlm.requestBody(this.#model, request, true));
|
|
55
55
|
return await DeepseekLlm.consumeStream(body, onDelta);
|
|
56
56
|
} catch (error) {
|
|
57
|
+
|
|
57
58
|
this.logger.error(`DeepSeek turn failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
58
|
-
|
|
59
|
+
throw error;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -67,7 +68,7 @@ export class DeepseekLlm
|
|
|
67
68
|
|
|
68
69
|
signal: AbortSignal.timeout(120_000),
|
|
69
70
|
});
|
|
70
|
-
if (!response.ok) throw
|
|
71
|
+
if (!response.ok) throw await DeepseekLlm.refusal(response);
|
|
71
72
|
return (await response.json()) as T;
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -78,11 +79,31 @@ export class DeepseekLlm
|
|
|
78
79
|
body: JSON.stringify(body),
|
|
79
80
|
signal: AbortSignal.timeout(120_000),
|
|
80
81
|
});
|
|
81
|
-
if (!response.ok || !response.body)
|
|
82
|
-
throw new Err("agent.error.deepseekRequestFailed", { status: String(response.status) });
|
|
82
|
+
if (!response.ok || !response.body) throw await DeepseekLlm.refusal(response);
|
|
83
83
|
return response.body;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
+
/**
|
|
87
|
+
* The dialect answers a refusal as `{ error: { message } }`, and that sentence is the useful half — a request
|
|
88
|
+
* past the context window says exactly which limit it passed. Carried on the `Err` so the chat can print it.
|
|
89
|
+
*/
|
|
90
|
+
static async refusal(response: Response): Promise<Error> {
|
|
91
|
+
return new Err("agent.error.deepseekRequestFailed", {
|
|
92
|
+
status: String(response.status),
|
|
93
|
+
reason: await DeepseekLlm.reasonOf(response),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static async reasonOf(response: Response): Promise<string> {
|
|
98
|
+
try {
|
|
99
|
+
const body = (await response.json()) as { error?: { message?: unknown } | string };
|
|
100
|
+
const message = typeof body.error === "string" ? body.error : body.error?.message;
|
|
101
|
+
if (typeof message === "string" && message) return message;
|
|
102
|
+
} catch {
|
|
103
|
+
}
|
|
104
|
+
return response.statusText || "no reason given";
|
|
105
|
+
}
|
|
106
|
+
|
|
86
107
|
/**
|
|
87
108
|
* The dialect streams `data: {chunk}` SSE lines ending with `data: [DONE]`. Tool calls arrive fragmented — the
|
|
88
109
|
* first fragment of an index carries id/name, later ones append to the arguments string — so they are assembled
|
|
@@ -175,6 +196,14 @@ export class DeepseekLlm
|
|
|
175
196
|
}
|
|
176
197
|
|
|
177
198
|
static providerMessages(message: AgentWireMessage): DeepseekMessage[] {
|
|
199
|
+
|
|
200
|
+
if (message.summary)
|
|
201
|
+
return [
|
|
202
|
+
{
|
|
203
|
+
role: "system" as const,
|
|
204
|
+
content: `Summary of the earlier conversation, standing in for the messages it replaced:\n\n${message.text ?? ""}`,
|
|
205
|
+
},
|
|
206
|
+
];
|
|
178
207
|
if (message.role === "tool")
|
|
179
208
|
return (message.toolResults ?? []).map((result) => ({
|
|
180
209
|
role: "tool" as const,
|
|
@@ -37,6 +37,11 @@ export interface AgentWireMessage {
|
|
|
37
37
|
toolCalls?: AgentWireToolCall[];
|
|
38
38
|
toolResults?: AgentWireToolResult[];
|
|
39
39
|
error?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Stands in for the messages the client's own compaction replaced. It arrives with the user's role because the
|
|
42
|
+
* wire has no other, but it is history rather than an ask, so a provider mapping frames it as one.
|
|
43
|
+
*/
|
|
44
|
+
summary?: boolean;
|
|
40
45
|
}
|
|
41
46
|
|
|
42
47
|
export interface AgentWireTool {
|
|
@@ -68,8 +73,12 @@ export interface LlmTurnAnswer {
|
|
|
68
73
|
/**
|
|
69
74
|
* The provider seam for one stateless agent turn: the whole transcript in, one assistant answer out. The server
|
|
70
75
|
* relays — it never executes a client tool — so this is the only surface a provider integration fills. An
|
|
71
|
-
* implementation is an `adapt()` class in a lib's `srvkit
|
|
72
|
-
*
|
|
76
|
+
* implementation is an `adapt()` class in a lib's `srvkit/`.
|
|
77
|
+
*
|
|
78
|
+
* `null` means this provider is not configured, and the caller turns it into the one sentence that says so. A
|
|
79
|
+
* failure the provider explained is logged and **thrown** instead, as an `Err` whose text the chat prints: a
|
|
80
|
+
* refused turn and an unconfigured app are different things to be told, and collapsing both into `null` left a
|
|
81
|
+
* user reading "no model is configured" about a conversation that had merely outgrown the context window.
|
|
73
82
|
*/
|
|
74
83
|
export interface LlmAdaptor {
|
|
75
84
|
/**
|
|
@@ -16,6 +16,18 @@ export class AgentTurnStream {
|
|
|
16
16
|
return !!request.headers.get("accept")?.includes("text/event-stream");
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* A domain `Err` carries its dictionary key as the message and the values its text interpolates as `data`, so
|
|
21
|
+
* both travel: the key alone would reach the chat as `agent.error.…` with its placeholders unfilled.
|
|
22
|
+
*/
|
|
23
|
+
static failure(error: unknown): { message: string; data?: Record<string, string | number> } {
|
|
24
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
25
|
+
const data = (error as { data?: unknown } | null)?.data;
|
|
26
|
+
return data && typeof data === "object" && !Array.isArray(data)
|
|
27
|
+
? { message, data: data as Record<string, string | number> }
|
|
28
|
+
: { message };
|
|
29
|
+
}
|
|
30
|
+
|
|
19
31
|
static response(run: (onDelta: (delta: string) => void) => Promise<StreamedTurn>): Response {
|
|
20
32
|
const encoder = new TextEncoder();
|
|
21
33
|
const stream = new ReadableStream<Uint8Array>({
|
|
@@ -35,7 +47,7 @@ export class AgentTurnStream {
|
|
|
35
47
|
send({ type: "done", stop: turn.stop === "toolUse" || toolCalls.length ? "toolUse" : "end" });
|
|
36
48
|
} catch (error) {
|
|
37
49
|
|
|
38
|
-
send({ type: "error",
|
|
50
|
+
send({ type: "error", ...AgentTurnStream.failure(error) });
|
|
39
51
|
} finally {
|
|
40
52
|
controller.close();
|
|
41
53
|
}
|
|
@@ -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. */
|
|
@@ -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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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" | "agentCmdCopy" | "agentCmdHelp" | "agentCmdTools" | "agentHelpIntro" | "agentHelpNote" | "agentNothingToRetry" | "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:
|
|
@@ -34,6 +34,12 @@ declare const DeepseekLlm_base: import("..").AdaptorCls<{}, {
|
|
|
34
34
|
export declare class DeepseekLlm extends DeepseekLlm_base implements LlmAdaptor {
|
|
35
35
|
#private;
|
|
36
36
|
chat(request: LlmTurnRequest, onDelta?: (delta: string) => void): Promise<LlmTurnAnswer | null>;
|
|
37
|
+
/**
|
|
38
|
+
* The dialect answers a refusal as `{ error: { message } }`, and that sentence is the useful half — a request
|
|
39
|
+
* past the context window says exactly which limit it passed. Carried on the `Err` so the chat can print it.
|
|
40
|
+
*/
|
|
41
|
+
static refusal(response: Response): Promise<Error>;
|
|
42
|
+
static reasonOf(response: Response): Promise<string>;
|
|
37
43
|
/**
|
|
38
44
|
* The dialect streams `data: {chunk}` SSE lines ending with `data: [DONE]`. Tool calls arrive fragmented — the
|
|
39
45
|
* first fragment of an index carries id/name, later ones append to the arguments string — so they are assembled
|
|
@@ -34,6 +34,11 @@ export interface AgentWireMessage {
|
|
|
34
34
|
toolCalls?: AgentWireToolCall[];
|
|
35
35
|
toolResults?: AgentWireToolResult[];
|
|
36
36
|
error?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Stands in for the messages the client's own compaction replaced. It arrives with the user's role because the
|
|
39
|
+
* wire has no other, but it is history rather than an ask, so a provider mapping frames it as one.
|
|
40
|
+
*/
|
|
41
|
+
summary?: boolean;
|
|
37
42
|
}
|
|
38
43
|
export interface AgentWireTool {
|
|
39
44
|
name: string;
|
|
@@ -60,8 +65,12 @@ export interface LlmTurnAnswer {
|
|
|
60
65
|
/**
|
|
61
66
|
* The provider seam for one stateless agent turn: the whole transcript in, one assistant answer out. The server
|
|
62
67
|
* relays — it never executes a client tool — so this is the only surface a provider integration fills. An
|
|
63
|
-
* implementation is an `adapt()` class in a lib's `srvkit
|
|
64
|
-
*
|
|
68
|
+
* implementation is an `adapt()` class in a lib's `srvkit/`.
|
|
69
|
+
*
|
|
70
|
+
* `null` means this provider is not configured, and the caller turns it into the one sentence that says so. A
|
|
71
|
+
* failure the provider explained is logged and **thrown** instead, as an `Err` whose text the chat prints: a
|
|
72
|
+
* refused turn and an unconfigured app are different things to be told, and collapsing both into `null` left a
|
|
73
|
+
* user reading "no model is configured" about a conversation that had merely outgrown the context window.
|
|
65
74
|
*/
|
|
66
75
|
export interface LlmAdaptor {
|
|
67
76
|
/**
|
|
@@ -11,6 +11,14 @@ interface StreamedTurn {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare class AgentTurnStream {
|
|
13
13
|
static wants(request: Bun.BunRequest): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* A domain `Err` carries its dictionary key as the message and the values its text interpolates as `data`, so
|
|
16
|
+
* both travel: the key alone would reach the chat as `agent.error.…` with its placeholders unfilled.
|
|
17
|
+
*/
|
|
18
|
+
static failure(error: unknown): {
|
|
19
|
+
message: string;
|
|
20
|
+
data?: Record<string, string | number>;
|
|
21
|
+
};
|
|
14
22
|
static response(run: (onDelta: (delta: string) => void) => Promise<StreamedTurn>): Response;
|
|
15
23
|
}
|
|
16
24
|
export {};
|
|
@@ -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[];
|
|
@@ -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
|
-
import { type AgentRunner } from "../../vendor/use-agentic.d.ts";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { type AgentRunner, type CompactOptions } from "../../vendor/use-agentic.d.ts";
|
|
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;
|
|
@@ -11,11 +11,18 @@ export interface ChatProps {
|
|
|
11
11
|
/** Swap the transport; the default drives the app's `runAgentTurn` endpoint. */
|
|
12
12
|
runner?: AgentRunner;
|
|
13
13
|
maxTurns?: number;
|
|
14
|
+
/**
|
|
15
|
+
* When the conversation summarizes itself to stay inside the model's window — `at` estimated tokens, `keep`
|
|
16
|
+
* messages left verbatim below the summary. Tune it per provider; `{ at: 0 }` turns it off.
|
|
17
|
+
*/
|
|
18
|
+
compact?: CompactOptions;
|
|
14
19
|
defaultOpen?: boolean;
|
|
15
20
|
/** Keeps the transcript across reloads — sessionStorage by default, `{ storage: "local" }` to outlive the tab. */
|
|
16
21
|
persist?: PersistOption;
|
|
17
22
|
/** Renders in the page flow instead of floating above it — a zone chat that lives inside its own section. */
|
|
18
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;
|
|
19
26
|
/**
|
|
20
27
|
* Reads a file the user attached into an attachment, or answers `null` to leave it to the built-in reader
|
|
21
28
|
* (images as bytes, text as text). This is where an app puts what needs a parser — a PDF's text, a spreadsheet's
|
|
@@ -33,10 +40,10 @@ export interface ChatProps {
|
|
|
33
40
|
/**
|
|
34
41
|
* The user-facing half of the in-page agent: one floating chat wired to the same surface the dock inspects.
|
|
35
42
|
* The conversation loop runs in this browser session — every tool call executes here, gated by the approval
|
|
36
|
-
* card — and the session lives in a ref, so it survives reopening the panel and dies with the page
|
|
37
|
-
*
|
|
38
|
-
* 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.
|
|
39
46
|
*/
|
|
40
|
-
export declare const DefaultChat: ({ className, title, instructions, runner, maxTurns, 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;
|
|
41
48
|
declare const _default: import("react").ComponentType<ChatProps>;
|
|
42
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 {};
|