tandem-kit-chat 0.0.0 → 0.1.0
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/LICENSE +21 -0
- package/README.md +38 -1
- package/dist/src/chats.d.ts +27 -0
- package/dist/src/chats.js +108 -0
- package/dist/src/commands.d.ts +22 -0
- package/dist/src/commands.js +43 -0
- package/dist/src/controller.d.ts +143 -0
- package/dist/src/controller.js +600 -0
- package/dist/src/fake.d.ts +59 -0
- package/dist/src/fake.js +98 -0
- package/dist/src/focus.d.ts +29 -0
- package/dist/src/focus.js +61 -0
- package/dist/src/format.d.ts +88 -0
- package/dist/src/format.js +174 -0
- package/dist/src/index.d.ts +13 -0
- package/dist/src/index.js +13 -0
- package/dist/src/labels.d.ts +156 -0
- package/dist/src/labels.js +162 -0
- package/dist/src/locales.d.ts +21 -0
- package/dist/src/locales.js +474 -0
- package/dist/src/queue.d.ts +23 -0
- package/dist/src/queue.js +42 -0
- package/dist/src/reduce.d.ts +5 -0
- package/dist/src/reduce.js +318 -0
- package/dist/src/store.d.ts +10 -0
- package/dist/src/store.js +21 -0
- package/dist/src/tools.d.ts +9 -0
- package/dist/src/tools.js +23 -0
- package/dist/src/transport.d.ts +69 -0
- package/dist/src/transport.js +27 -0
- package/dist/src/types.d.ts +191 -0
- package/dist/src/types.js +1 -0
- package/package.json +40 -4
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const plural = (n, one, many) => `${n} ${n === 1 ? one : many}`;
|
|
2
|
+
export const defaultLabels = {
|
|
3
|
+
placeholder: 'Message the agent',
|
|
4
|
+
send: 'Send',
|
|
5
|
+
stop: 'Stop',
|
|
6
|
+
queue: 'Queue',
|
|
7
|
+
queued: (count) => `${count} queued`,
|
|
8
|
+
sendNow: 'Send now',
|
|
9
|
+
removeQueued: 'Remove',
|
|
10
|
+
empty: 'Ask the agent to help.',
|
|
11
|
+
you: 'You',
|
|
12
|
+
agent: 'Agent',
|
|
13
|
+
newChat: 'New chat',
|
|
14
|
+
chats: 'Chats',
|
|
15
|
+
compact: 'Compact',
|
|
16
|
+
clear: 'Clear',
|
|
17
|
+
plan: 'Plan',
|
|
18
|
+
model: 'Model',
|
|
19
|
+
modelDefault: 'Default',
|
|
20
|
+
effort: 'Effort',
|
|
21
|
+
permissions: 'Permissions',
|
|
22
|
+
permissionMode: (mode) => ({ bypass: 'Allow all', ask: 'Ask first', accept_edits: 'Accept edits', plan: 'Plan only' })[mode] ?? mode,
|
|
23
|
+
allow: 'Allow',
|
|
24
|
+
allowAlways: 'Always allow',
|
|
25
|
+
deny: 'Deny',
|
|
26
|
+
approvePlan: 'Approve plan',
|
|
27
|
+
rejectPlan: 'Keep planning',
|
|
28
|
+
approvalTitle: (tool) => `Allow ${tool}?`,
|
|
29
|
+
approvalAllowed: 'Allowed',
|
|
30
|
+
approvalAlways: 'Always allowed',
|
|
31
|
+
approvalDenied: 'Denied',
|
|
32
|
+
approvalExpired: 'No longer waiting',
|
|
33
|
+
planTitle: 'Proposed plan',
|
|
34
|
+
denyReason: 'Tell the agent why (optional)',
|
|
35
|
+
questionTitle: 'The agent asks',
|
|
36
|
+
questionOther: 'Something else',
|
|
37
|
+
questionSubmit: 'Answer',
|
|
38
|
+
questionSkip: 'Skip',
|
|
39
|
+
questionAnswered: 'Answered',
|
|
40
|
+
questionSkipped: 'Skipped',
|
|
41
|
+
questionExpired: 'No longer waiting',
|
|
42
|
+
changeTitle: (actor, version) => `${actor === 'agent' ? 'Agent' : actor === 'human' ? 'You' : actor} changed the document (v${version})`,
|
|
43
|
+
rejectedTitle: 'Change rejected',
|
|
44
|
+
clashTitle: 'Two edits clashed',
|
|
45
|
+
clashKeep: 'Keep mine',
|
|
46
|
+
clashUse: "Use agent's",
|
|
47
|
+
clashKept: 'Kept',
|
|
48
|
+
clashDropped: 'Replaced',
|
|
49
|
+
proposalTitle: 'The agent suggests a change',
|
|
50
|
+
proposalApply: 'Apply',
|
|
51
|
+
proposalDiscard: 'Discard',
|
|
52
|
+
proposalApplied: 'Applied',
|
|
53
|
+
proposalDiscarded: 'Discarded',
|
|
54
|
+
proposalRefused: 'Refused',
|
|
55
|
+
proposalEdited: 'edited',
|
|
56
|
+
showSteps: 'Show steps',
|
|
57
|
+
hideSteps: 'Hide steps',
|
|
58
|
+
stepsLooked: (n) => `looked at ${plural(n, 'thing', 'things')}`,
|
|
59
|
+
stepsEdited: (n) => `edited ${plural(n, 'thing', 'things')}`,
|
|
60
|
+
stepsRan: (n) => `ran ${plural(n, 'command', 'commands')}`,
|
|
61
|
+
stepsUsed: (n) => `used ${plural(n, 'tool', 'tools')}`,
|
|
62
|
+
stepsNone: 'no steps yet',
|
|
63
|
+
stepsWorking: (summary) => `Working: ${summary}`,
|
|
64
|
+
callRunning: 'running',
|
|
65
|
+
callFailed: 'failed',
|
|
66
|
+
callDeclined: 'declined',
|
|
67
|
+
callStopped: 'stopped',
|
|
68
|
+
stepFailed: 'a step failed',
|
|
69
|
+
imageAlt: 'Picture from a tool',
|
|
70
|
+
imageEnlarge: 'Enlarge',
|
|
71
|
+
imageShrink: 'Shrink',
|
|
72
|
+
thinking: 'Thinking',
|
|
73
|
+
thinkingFor: (elapsed) => `Thinking · ${elapsed}`,
|
|
74
|
+
activityRead: 'Reading',
|
|
75
|
+
activityEdit: (file) => (file ? `Editing ${file}` : 'Editing'),
|
|
76
|
+
activityCommand: 'Running a command',
|
|
77
|
+
activityTool: (name) => `Using ${name}`,
|
|
78
|
+
activityFor: (what, elapsed) => `${what} · ${elapsed}`,
|
|
79
|
+
activitySummary: (name, summary) => (summary ? `${name}: ${summary}` : name),
|
|
80
|
+
waitingForYou: 'Waiting for you',
|
|
81
|
+
waitingForYouFor: (elapsed) => `Waiting for you · ${elapsed}`,
|
|
82
|
+
elapsedSeconds: (s) => `${s}s`,
|
|
83
|
+
elapsedMinutes: (m, s) => `${m}m ${s}s`,
|
|
84
|
+
elapsedHours: (h, m) => `${h}h ${m}m`,
|
|
85
|
+
usageSteps: (used, max) => (max ? `${used} of ${max} steps` : plural(used, 'step', 'steps')),
|
|
86
|
+
usageTokens: (used, max) => (max ? `${used} of ${max} tokens` : `${used} tokens`),
|
|
87
|
+
usageTime: (used, max) => (max ? `${used} of ${max}` : used),
|
|
88
|
+
costSpent: (dollars) => `${dollars} spent`,
|
|
89
|
+
costSoFar: (dollars) => `${dollars} so far`,
|
|
90
|
+
underACent: 'under 1¢',
|
|
91
|
+
dollars: (amount) => `$${amount}`,
|
|
92
|
+
contextOf: (used, max) => `${used} of ${max}`,
|
|
93
|
+
contextCompacting: 'compacting',
|
|
94
|
+
compactionRunning: 'Compacting the conversation',
|
|
95
|
+
compactionDone: (pre, post) => (pre && post ? `Conversation compacted (${pre} to ${post})` : 'Conversation compacted'),
|
|
96
|
+
compactionFailed: 'Compaction failed',
|
|
97
|
+
turnStopped: 'Stopped',
|
|
98
|
+
turnStoppedError: 'Stopped because of an error',
|
|
99
|
+
turnStoppedWith: (error) => `Stopped: ${error}`,
|
|
100
|
+
limitStopped: (name, value) => ({
|
|
101
|
+
max_output_tokens: `Stopped at the limit of ${value} tokens`,
|
|
102
|
+
max_wall_s: `Stopped at the time limit of ${value}`,
|
|
103
|
+
max_steps: `Stopped at the limit of ${value} steps`,
|
|
104
|
+
})[name] ?? `Stopped at a limit (${name})`,
|
|
105
|
+
sessionResumed: 'Resumed the earlier conversation',
|
|
106
|
+
sessionEnded: (reason) => `Session ended (${reason})`,
|
|
107
|
+
sessionForceStopped: () => null,
|
|
108
|
+
jumpToLatest: 'Latest',
|
|
109
|
+
connecting: 'Connecting',
|
|
110
|
+
reconnecting: 'Reconnecting',
|
|
111
|
+
offline: 'Offline',
|
|
112
|
+
focusRemove: 'Stop sending this',
|
|
113
|
+
focusLabel: 'Focus',
|
|
114
|
+
copy: 'Copy',
|
|
115
|
+
copied: 'Copied',
|
|
116
|
+
unknownCommand: (name) => `No command called /${name}. Try /help.`,
|
|
117
|
+
helpTitle: 'Commands',
|
|
118
|
+
title: 'Agent',
|
|
119
|
+
open: 'Open chat',
|
|
120
|
+
close: 'Close',
|
|
121
|
+
collapse: 'Collapse',
|
|
122
|
+
expand: 'Expand',
|
|
123
|
+
resize: 'Resize chat',
|
|
124
|
+
chatTitle: (n) => `Chat ${n}`,
|
|
125
|
+
chatList: 'All chats',
|
|
126
|
+
noChats: 'No chats yet',
|
|
127
|
+
renameChat: 'Rename chat',
|
|
128
|
+
renameChatPrompt: 'Chat name',
|
|
129
|
+
deleteChat: 'Delete chat',
|
|
130
|
+
closeChat: 'Close chat',
|
|
131
|
+
retry: 'Try again',
|
|
132
|
+
edit: 'Edit and resend',
|
|
133
|
+
remove: 'Remove from view',
|
|
134
|
+
messageActions: 'Message actions',
|
|
135
|
+
editing: 'Editing a message. Sending it adds a new message.',
|
|
136
|
+
cancelEdit: 'Cancel',
|
|
137
|
+
attach: 'Attach files',
|
|
138
|
+
removeAttachment: (name) => `Remove ${name}`,
|
|
139
|
+
attachmentUnsupported: (name) => `${name} cannot be sent to this agent`,
|
|
140
|
+
attachmentTooLarge: (name, max) => `${name} is larger than ${max}`,
|
|
141
|
+
attachmentLimit: (max) => `At most ${max} files`,
|
|
142
|
+
dropFiles: 'Drop files to attach',
|
|
143
|
+
attachments: 'Attachments',
|
|
144
|
+
references: 'Context',
|
|
145
|
+
removeReference: (label) => `Stop sending ${label}`,
|
|
146
|
+
mention: 'Mention',
|
|
147
|
+
noMentions: 'No matches',
|
|
148
|
+
suggestions: 'Suggested prompts',
|
|
149
|
+
voice: 'Voice input',
|
|
150
|
+
unread: (n) => `${n} new`,
|
|
151
|
+
justNow: 'just now',
|
|
152
|
+
minutesAgo: (n) => `${n}m ago`,
|
|
153
|
+
hoursAgo: (n) => `${n}h ago`,
|
|
154
|
+
daysAgo: (n) => `${n}d ago`,
|
|
155
|
+
announceWorking: 'The agent is working',
|
|
156
|
+
announceReply: (text) => `Agent replied: ${text}`,
|
|
157
|
+
announceApproval: 'The agent is waiting for your approval',
|
|
158
|
+
announceQuestion: 'The agent has a question for you',
|
|
159
|
+
};
|
|
160
|
+
export function createLabels(overrides = {}) {
|
|
161
|
+
return { ...defaultLabels, ...overrides };
|
|
162
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type Labels } from './labels.js';
|
|
2
|
+
export type Direction = 'ltr' | 'rtl';
|
|
3
|
+
export interface LocaleBundle {
|
|
4
|
+
code: string;
|
|
5
|
+
dir?: Direction;
|
|
6
|
+
labels: Partial<Labels>;
|
|
7
|
+
}
|
|
8
|
+
export declare function directionOf(code: string): Direction;
|
|
9
|
+
export declare function defineLocale(bundle: LocaleBundle): LocaleBundle;
|
|
10
|
+
export declare function getLocale(code: string, extra?: Record<string, LocaleBundle>): LocaleBundle | undefined;
|
|
11
|
+
export declare function localeNames(): string[];
|
|
12
|
+
export interface ResolvedLocale {
|
|
13
|
+
code: string;
|
|
14
|
+
dir: Direction;
|
|
15
|
+
labels: Labels;
|
|
16
|
+
}
|
|
17
|
+
export declare function resolveLocale(code: string | undefined, options?: {
|
|
18
|
+
labels?: Partial<Labels>;
|
|
19
|
+
locales?: Record<string, LocaleBundle>;
|
|
20
|
+
dir?: Direction | 'auto';
|
|
21
|
+
}): ResolvedLocale;
|
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { createLabels } from "./labels.js";
|
|
2
|
+
const RTL = new Set(['ar', 'he', 'fa', 'ur', 'ps', 'sd', 'ug', 'yi', 'dv', 'ckb']);
|
|
3
|
+
const registry = new Map();
|
|
4
|
+
const baseOf = (code) => code.toLowerCase().split(/[-_]/)[0] ?? '';
|
|
5
|
+
export function directionOf(code) {
|
|
6
|
+
return RTL.has(baseOf(code)) ? 'rtl' : 'ltr';
|
|
7
|
+
}
|
|
8
|
+
export function defineLocale(bundle) {
|
|
9
|
+
registry.set(bundle.code.toLowerCase(), bundle);
|
|
10
|
+
return bundle;
|
|
11
|
+
}
|
|
12
|
+
export function getLocale(code, extra = {}) {
|
|
13
|
+
const exact = code.toLowerCase().replace('_', '-');
|
|
14
|
+
const own = (table) => {
|
|
15
|
+
for (const [key, bundle] of Object.entries(table))
|
|
16
|
+
if (key.toLowerCase() === exact || bundle.code.toLowerCase() === exact)
|
|
17
|
+
return bundle;
|
|
18
|
+
for (const [key, bundle] of Object.entries(table))
|
|
19
|
+
if (baseOf(key) === baseOf(exact) || baseOf(bundle.code) === baseOf(exact))
|
|
20
|
+
return bundle;
|
|
21
|
+
return undefined;
|
|
22
|
+
};
|
|
23
|
+
return own(extra) ?? registry.get(exact) ?? registry.get(baseOf(exact));
|
|
24
|
+
}
|
|
25
|
+
export function localeNames() {
|
|
26
|
+
return [...registry.keys()].sort();
|
|
27
|
+
}
|
|
28
|
+
export function resolveLocale(code, options = {}) {
|
|
29
|
+
const wanted = code && code.length ? code : 'en';
|
|
30
|
+
const bundle = getLocale(wanted, options.locales);
|
|
31
|
+
const dir = options.dir && options.dir !== 'auto' ? options.dir : (bundle?.dir ?? directionOf(wanted));
|
|
32
|
+
return { code: wanted, dir, labels: createLabels({ ...bundle?.labels, ...options.labels }) };
|
|
33
|
+
}
|
|
34
|
+
defineLocale({ code: 'en', dir: 'ltr', labels: {} });
|
|
35
|
+
const n = (count, one, many) => `${count} ${count === 1 ? one : many}`;
|
|
36
|
+
defineLocale({
|
|
37
|
+
code: 'es',
|
|
38
|
+
labels: {
|
|
39
|
+
placeholder: 'Escribe al agente',
|
|
40
|
+
send: 'Enviar',
|
|
41
|
+
stop: 'Detener',
|
|
42
|
+
queue: 'En cola',
|
|
43
|
+
queued: (count) => `${count} en cola`,
|
|
44
|
+
sendNow: 'Enviar ahora',
|
|
45
|
+
removeQueued: 'Quitar',
|
|
46
|
+
empty: 'Pide ayuda al agente.',
|
|
47
|
+
you: 'Tú',
|
|
48
|
+
agent: 'Agente',
|
|
49
|
+
newChat: 'Nuevo chat',
|
|
50
|
+
chats: 'Chats',
|
|
51
|
+
compact: 'Compactar',
|
|
52
|
+
clear: 'Limpiar',
|
|
53
|
+
plan: 'Plan',
|
|
54
|
+
model: 'Modelo',
|
|
55
|
+
modelDefault: 'Predeterminado',
|
|
56
|
+
effort: 'Esfuerzo',
|
|
57
|
+
permissions: 'Permisos',
|
|
58
|
+
allow: 'Permitir',
|
|
59
|
+
allowAlways: 'Permitir siempre',
|
|
60
|
+
deny: 'Denegar',
|
|
61
|
+
approvalTitle: (tool) => `¿Permitir ${tool}?`,
|
|
62
|
+
approvalAllowed: 'Permitido',
|
|
63
|
+
approvalDenied: 'Denegado',
|
|
64
|
+
questionTitle: 'El agente pregunta',
|
|
65
|
+
questionSubmit: 'Responder',
|
|
66
|
+
questionSkip: 'Omitir',
|
|
67
|
+
showSteps: 'Mostrar pasos',
|
|
68
|
+
hideSteps: 'Ocultar pasos',
|
|
69
|
+
stepsLooked: (c) => `miró ${n(c, 'cosa', 'cosas')}`,
|
|
70
|
+
stepsEdited: (c) => `editó ${n(c, 'cosa', 'cosas')}`,
|
|
71
|
+
stepsRan: (c) => `ejecutó ${n(c, 'comando', 'comandos')}`,
|
|
72
|
+
stepsUsed: (c) => `usó ${n(c, 'herramienta', 'herramientas')}`,
|
|
73
|
+
stepsNone: 'sin pasos todavía',
|
|
74
|
+
stepsWorking: (summary) => `Trabajando: ${summary}`,
|
|
75
|
+
thinking: 'Pensando',
|
|
76
|
+
thinkingFor: (elapsed) => `Pensando · ${elapsed}`,
|
|
77
|
+
turnStopped: 'Detenido',
|
|
78
|
+
connecting: 'Conectando',
|
|
79
|
+
reconnecting: 'Reconectando',
|
|
80
|
+
offline: 'Sin conexión',
|
|
81
|
+
copy: 'Copiar',
|
|
82
|
+
copied: 'Copiado',
|
|
83
|
+
title: 'Agente',
|
|
84
|
+
open: 'Abrir chat',
|
|
85
|
+
close: 'Cerrar',
|
|
86
|
+
collapse: 'Contraer',
|
|
87
|
+
expand: 'Expandir',
|
|
88
|
+
resize: 'Cambiar tamaño',
|
|
89
|
+
chatTitle: (c) => `Chat ${c}`,
|
|
90
|
+
chatList: 'Todos los chats',
|
|
91
|
+
renameChat: 'Renombrar chat',
|
|
92
|
+
deleteChat: 'Eliminar chat',
|
|
93
|
+
retry: 'Reintentar',
|
|
94
|
+
edit: 'Editar y reenviar',
|
|
95
|
+
remove: 'Quitar de la vista',
|
|
96
|
+
attach: 'Adjuntar archivos',
|
|
97
|
+
dropFiles: 'Suelta los archivos para adjuntar',
|
|
98
|
+
suggestions: 'Sugerencias',
|
|
99
|
+
voice: 'Entrada de voz',
|
|
100
|
+
justNow: 'ahora',
|
|
101
|
+
minutesAgo: (c) => `hace ${c} min`,
|
|
102
|
+
hoursAgo: (c) => `hace ${c} h`,
|
|
103
|
+
daysAgo: (c) => `hace ${c} d`,
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
defineLocale({
|
|
107
|
+
code: 'fr',
|
|
108
|
+
labels: {
|
|
109
|
+
placeholder: "Écrire à l'agent",
|
|
110
|
+
send: 'Envoyer',
|
|
111
|
+
stop: 'Arrêter',
|
|
112
|
+
queue: "File d'attente",
|
|
113
|
+
queued: (count) => `${count} en attente`,
|
|
114
|
+
sendNow: 'Envoyer maintenant',
|
|
115
|
+
removeQueued: 'Retirer',
|
|
116
|
+
empty: "Demandez de l'aide à l'agent.",
|
|
117
|
+
you: 'Vous',
|
|
118
|
+
agent: 'Agent',
|
|
119
|
+
newChat: 'Nouvelle discussion',
|
|
120
|
+
chats: 'Discussions',
|
|
121
|
+
compact: 'Compacter',
|
|
122
|
+
clear: 'Effacer',
|
|
123
|
+
plan: 'Plan',
|
|
124
|
+
model: 'Modèle',
|
|
125
|
+
modelDefault: 'Par défaut',
|
|
126
|
+
effort: 'Effort',
|
|
127
|
+
permissions: 'Autorisations',
|
|
128
|
+
allow: 'Autoriser',
|
|
129
|
+
allowAlways: 'Toujours autoriser',
|
|
130
|
+
deny: 'Refuser',
|
|
131
|
+
approvalTitle: (tool) => `Autoriser ${tool} ?`,
|
|
132
|
+
approvalAllowed: 'Autorisé',
|
|
133
|
+
approvalDenied: 'Refusé',
|
|
134
|
+
questionTitle: "L'agent demande",
|
|
135
|
+
questionSubmit: 'Répondre',
|
|
136
|
+
questionSkip: 'Passer',
|
|
137
|
+
showSteps: 'Afficher les étapes',
|
|
138
|
+
hideSteps: 'Masquer les étapes',
|
|
139
|
+
stepsLooked: (c) => `a consulté ${n(c, 'élément', 'éléments')}`,
|
|
140
|
+
stepsEdited: (c) => `a modifié ${n(c, 'élément', 'éléments')}`,
|
|
141
|
+
stepsRan: (c) => `a exécuté ${n(c, 'commande', 'commandes')}`,
|
|
142
|
+
stepsUsed: (c) => `a utilisé ${n(c, 'outil', 'outils')}`,
|
|
143
|
+
stepsNone: "pas encore d'étapes",
|
|
144
|
+
stepsWorking: (summary) => `En cours : ${summary}`,
|
|
145
|
+
thinking: 'Réflexion',
|
|
146
|
+
thinkingFor: (elapsed) => `Réflexion · ${elapsed}`,
|
|
147
|
+
turnStopped: 'Arrêté',
|
|
148
|
+
connecting: 'Connexion',
|
|
149
|
+
reconnecting: 'Reconnexion',
|
|
150
|
+
offline: 'Hors ligne',
|
|
151
|
+
copy: 'Copier',
|
|
152
|
+
copied: 'Copié',
|
|
153
|
+
title: 'Agent',
|
|
154
|
+
open: 'Ouvrir la discussion',
|
|
155
|
+
close: 'Fermer',
|
|
156
|
+
collapse: 'Réduire',
|
|
157
|
+
expand: 'Agrandir',
|
|
158
|
+
resize: 'Redimensionner',
|
|
159
|
+
chatTitle: (c) => `Discussion ${c}`,
|
|
160
|
+
chatList: 'Toutes les discussions',
|
|
161
|
+
renameChat: 'Renommer',
|
|
162
|
+
deleteChat: 'Supprimer la discussion',
|
|
163
|
+
retry: 'Réessayer',
|
|
164
|
+
edit: 'Modifier et renvoyer',
|
|
165
|
+
remove: 'Retirer de la vue',
|
|
166
|
+
attach: 'Joindre des fichiers',
|
|
167
|
+
dropFiles: 'Déposez des fichiers pour les joindre',
|
|
168
|
+
suggestions: 'Suggestions',
|
|
169
|
+
voice: 'Saisie vocale',
|
|
170
|
+
justNow: "à l'instant",
|
|
171
|
+
minutesAgo: (c) => `il y a ${c} min`,
|
|
172
|
+
hoursAgo: (c) => `il y a ${c} h`,
|
|
173
|
+
daysAgo: (c) => `il y a ${c} j`,
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
defineLocale({
|
|
177
|
+
code: 'de',
|
|
178
|
+
labels: {
|
|
179
|
+
placeholder: 'Nachricht an den Agenten',
|
|
180
|
+
send: 'Senden',
|
|
181
|
+
stop: 'Stopp',
|
|
182
|
+
queue: 'Einreihen',
|
|
183
|
+
queued: (count) => `${count} in der Warteschlange`,
|
|
184
|
+
sendNow: 'Jetzt senden',
|
|
185
|
+
removeQueued: 'Entfernen',
|
|
186
|
+
empty: 'Bitte den Agenten um Hilfe.',
|
|
187
|
+
you: 'Du',
|
|
188
|
+
agent: 'Agent',
|
|
189
|
+
newChat: 'Neuer Chat',
|
|
190
|
+
chats: 'Chats',
|
|
191
|
+
compact: 'Komprimieren',
|
|
192
|
+
clear: 'Leeren',
|
|
193
|
+
plan: 'Plan',
|
|
194
|
+
model: 'Modell',
|
|
195
|
+
modelDefault: 'Standard',
|
|
196
|
+
effort: 'Aufwand',
|
|
197
|
+
permissions: 'Berechtigungen',
|
|
198
|
+
allow: 'Erlauben',
|
|
199
|
+
allowAlways: 'Immer erlauben',
|
|
200
|
+
deny: 'Ablehnen',
|
|
201
|
+
approvalTitle: (tool) => `${tool} erlauben?`,
|
|
202
|
+
approvalAllowed: 'Erlaubt',
|
|
203
|
+
approvalDenied: 'Abgelehnt',
|
|
204
|
+
questionTitle: 'Der Agent fragt',
|
|
205
|
+
questionSubmit: 'Antworten',
|
|
206
|
+
questionSkip: 'Überspringen',
|
|
207
|
+
showSteps: 'Schritte anzeigen',
|
|
208
|
+
hideSteps: 'Schritte ausblenden',
|
|
209
|
+
stepsLooked: (c) => `${c === 1 ? 'eine Sache' : `${c} Dinge`} angesehen`,
|
|
210
|
+
stepsEdited: (c) => `${c === 1 ? 'eine Sache' : `${c} Dinge`} bearbeitet`,
|
|
211
|
+
stepsRan: (c) => `${c === 1 ? 'einen Befehl' : `${c} Befehle`} ausgeführt`,
|
|
212
|
+
stepsUsed: (c) => `${c === 1 ? 'ein Werkzeug' : `${c} Werkzeuge`} benutzt`,
|
|
213
|
+
stepsNone: 'noch keine Schritte',
|
|
214
|
+
stepsWorking: (summary) => `Arbeitet: ${summary}`,
|
|
215
|
+
thinking: 'Denkt nach',
|
|
216
|
+
thinkingFor: (elapsed) => `Denkt nach · ${elapsed}`,
|
|
217
|
+
turnStopped: 'Gestoppt',
|
|
218
|
+
connecting: 'Verbinde',
|
|
219
|
+
reconnecting: 'Verbinde neu',
|
|
220
|
+
offline: 'Offline',
|
|
221
|
+
copy: 'Kopieren',
|
|
222
|
+
copied: 'Kopiert',
|
|
223
|
+
title: 'Agent',
|
|
224
|
+
open: 'Chat öffnen',
|
|
225
|
+
close: 'Schließen',
|
|
226
|
+
collapse: 'Einklappen',
|
|
227
|
+
expand: 'Ausklappen',
|
|
228
|
+
resize: 'Größe ändern',
|
|
229
|
+
chatTitle: (c) => `Chat ${c}`,
|
|
230
|
+
chatList: 'Alle Chats',
|
|
231
|
+
renameChat: 'Chat umbenennen',
|
|
232
|
+
deleteChat: 'Chat löschen',
|
|
233
|
+
retry: 'Erneut versuchen',
|
|
234
|
+
edit: 'Bearbeiten und erneut senden',
|
|
235
|
+
remove: 'Aus der Ansicht entfernen',
|
|
236
|
+
attach: 'Dateien anhängen',
|
|
237
|
+
dropFiles: 'Dateien zum Anhängen ablegen',
|
|
238
|
+
suggestions: 'Vorschläge',
|
|
239
|
+
voice: 'Spracheingabe',
|
|
240
|
+
justNow: 'gerade eben',
|
|
241
|
+
minutesAgo: (c) => `vor ${c} Min.`,
|
|
242
|
+
hoursAgo: (c) => `vor ${c} Std.`,
|
|
243
|
+
daysAgo: (c) => `vor ${c} T.`,
|
|
244
|
+
},
|
|
245
|
+
});
|
|
246
|
+
defineLocale({
|
|
247
|
+
code: 'ar',
|
|
248
|
+
dir: 'rtl',
|
|
249
|
+
labels: {
|
|
250
|
+
placeholder: 'اكتب رسالة إلى الوكيل',
|
|
251
|
+
send: 'إرسال',
|
|
252
|
+
stop: 'إيقاف',
|
|
253
|
+
queue: 'إضافة إلى الطابور',
|
|
254
|
+
queued: (count) => `${count} في الانتظار`,
|
|
255
|
+
sendNow: 'أرسل الآن',
|
|
256
|
+
removeQueued: 'إزالة',
|
|
257
|
+
empty: 'اطلب المساعدة من الوكيل.',
|
|
258
|
+
you: 'أنت',
|
|
259
|
+
agent: 'الوكيل',
|
|
260
|
+
newChat: 'محادثة جديدة',
|
|
261
|
+
chats: 'المحادثات',
|
|
262
|
+
compact: 'تلخيص',
|
|
263
|
+
clear: 'مسح',
|
|
264
|
+
plan: 'خطة',
|
|
265
|
+
model: 'النموذج',
|
|
266
|
+
modelDefault: 'افتراضي',
|
|
267
|
+
effort: 'الجهد',
|
|
268
|
+
permissions: 'الأذونات',
|
|
269
|
+
allow: 'سماح',
|
|
270
|
+
allowAlways: 'سماح دائم',
|
|
271
|
+
deny: 'رفض',
|
|
272
|
+
approvalTitle: (tool) => `هل تسمح باستخدام ${tool}؟`,
|
|
273
|
+
approvalAllowed: 'تم السماح',
|
|
274
|
+
approvalDenied: 'تم الرفض',
|
|
275
|
+
questionTitle: 'الوكيل يسأل',
|
|
276
|
+
questionSubmit: 'إجابة',
|
|
277
|
+
questionSkip: 'تخطي',
|
|
278
|
+
showSteps: 'عرض الخطوات',
|
|
279
|
+
hideSteps: 'إخفاء الخطوات',
|
|
280
|
+
stepsLooked: (c) => `اطّلع على ${c} من العناصر`,
|
|
281
|
+
stepsEdited: (c) => `عدّل ${c} من العناصر`,
|
|
282
|
+
stepsRan: (c) => `شغّل ${c} من الأوامر`,
|
|
283
|
+
stepsUsed: (c) => `استخدم ${c} من الأدوات`,
|
|
284
|
+
stepsNone: 'لا توجد خطوات بعد',
|
|
285
|
+
stepsWorking: (summary) => `يعمل: ${summary}`,
|
|
286
|
+
thinking: 'يفكر',
|
|
287
|
+
thinkingFor: (elapsed) => `يفكر · ${elapsed}`,
|
|
288
|
+
turnStopped: 'تم الإيقاف',
|
|
289
|
+
connecting: 'جارٍ الاتصال',
|
|
290
|
+
reconnecting: 'جارٍ إعادة الاتصال',
|
|
291
|
+
offline: 'غير متصل',
|
|
292
|
+
copy: 'نسخ',
|
|
293
|
+
copied: 'تم النسخ',
|
|
294
|
+
title: 'الوكيل',
|
|
295
|
+
open: 'فتح المحادثة',
|
|
296
|
+
close: 'إغلاق',
|
|
297
|
+
collapse: 'طي',
|
|
298
|
+
expand: 'توسيع',
|
|
299
|
+
resize: 'تغيير الحجم',
|
|
300
|
+
chatTitle: (c) => `محادثة ${c}`,
|
|
301
|
+
chatList: 'كل المحادثات',
|
|
302
|
+
renameChat: 'إعادة تسمية',
|
|
303
|
+
deleteChat: 'حذف المحادثة',
|
|
304
|
+
retry: 'حاول مرة أخرى',
|
|
305
|
+
edit: 'تعديل وإعادة الإرسال',
|
|
306
|
+
remove: 'إزالة من العرض',
|
|
307
|
+
attach: 'إرفاق ملفات',
|
|
308
|
+
dropFiles: 'أفلت الملفات لإرفاقها',
|
|
309
|
+
suggestions: 'اقتراحات',
|
|
310
|
+
voice: 'الإدخال الصوتي',
|
|
311
|
+
justNow: 'الآن',
|
|
312
|
+
minutesAgo: (c) => `قبل ${c} د`,
|
|
313
|
+
hoursAgo: (c) => `قبل ${c} س`,
|
|
314
|
+
daysAgo: (c) => `قبل ${c} ي`,
|
|
315
|
+
permissionMode: (mode) => ({ bypass: 'السماح بكل شيء', ask: 'اسأل أولاً', accept_edits: 'قبول التعديلات', plan: 'التخطيط فقط' })[mode] ?? mode,
|
|
316
|
+
approvePlan: 'الموافقة على الخطة',
|
|
317
|
+
rejectPlan: 'متابعة التخطيط',
|
|
318
|
+
approvalAlways: 'تم السماح دائمًا',
|
|
319
|
+
approvalExpired: 'لم يعد في الانتظار',
|
|
320
|
+
planTitle: 'الخطة المقترحة',
|
|
321
|
+
denyReason: 'أخبر الوكيل بالسبب (اختياري)',
|
|
322
|
+
questionOther: 'شيء آخر',
|
|
323
|
+
questionAnswered: 'تمت الإجابة',
|
|
324
|
+
questionSkipped: 'تم التخطي',
|
|
325
|
+
questionExpired: 'لم يعد في الانتظار',
|
|
326
|
+
changeTitle: (actor, version) => `${actor === 'agent' ? 'الوكيل' : actor === 'human' ? 'أنت' : actor} عدّل المستند (الإصدار ${version})`,
|
|
327
|
+
rejectedTitle: 'تم رفض التغيير',
|
|
328
|
+
clashTitle: 'تعارض تعديلان',
|
|
329
|
+
clashKeep: 'إبقاء تعديلي',
|
|
330
|
+
clashUse: 'استخدام تعديل الوكيل',
|
|
331
|
+
clashKept: 'تم الإبقاء',
|
|
332
|
+
clashDropped: 'تم الاستبدال',
|
|
333
|
+
proposalTitle: 'الوكيل يقترح تغييرًا',
|
|
334
|
+
proposalApply: 'تطبيق',
|
|
335
|
+
proposalDiscard: 'تجاهل',
|
|
336
|
+
proposalApplied: 'تم التطبيق',
|
|
337
|
+
proposalDiscarded: 'تم التجاهل',
|
|
338
|
+
proposalRefused: 'تم الرفض',
|
|
339
|
+
proposalEdited: 'معدّل',
|
|
340
|
+
callRunning: 'قيد التنفيذ',
|
|
341
|
+
callFailed: 'فشل',
|
|
342
|
+
callDeclined: 'تم الرفض',
|
|
343
|
+
callStopped: 'تم الإيقاف',
|
|
344
|
+
stepFailed: 'فشلت خطوة',
|
|
345
|
+
imageAlt: 'صورة من أداة',
|
|
346
|
+
imageEnlarge: 'تكبير',
|
|
347
|
+
imageShrink: 'تصغير',
|
|
348
|
+
activityRead: 'يقرأ',
|
|
349
|
+
activityEdit: (file) => (file ? `يعدّل ${file}` : 'يعدّل'),
|
|
350
|
+
activityCommand: 'يشغّل أمرًا',
|
|
351
|
+
activityTool: (name) => `يستخدم ${name}`,
|
|
352
|
+
activityFor: (what, elapsed) => `${what} · ${elapsed}`,
|
|
353
|
+
activitySummary: (name, summary) => (summary ? `${name}: ${summary}` : name),
|
|
354
|
+
waitingForYou: 'بانتظارك',
|
|
355
|
+
waitingForYouFor: (elapsed) => `بانتظارك · ${elapsed}`,
|
|
356
|
+
elapsedSeconds: (s) => `${s} ث`,
|
|
357
|
+
elapsedMinutes: (m, s) => `${m} د ${s} ث`,
|
|
358
|
+
elapsedHours: (h, m) => `${h} س ${m} د`,
|
|
359
|
+
usageSteps: (used, max) => (max ? `${used} من ${max} خطوة` : `${used} خطوة`),
|
|
360
|
+
usageTokens: (used, max) => (max ? `${used} من ${max} رمز` : `${used} رمز`),
|
|
361
|
+
usageTime: (used, max) => (max ? `${used} من ${max}` : used),
|
|
362
|
+
costSpent: (dollars) => `تم إنفاق ${dollars}`,
|
|
363
|
+
costSoFar: (dollars) => `${dollars} حتى الآن`,
|
|
364
|
+
underACent: 'أقل من سنت',
|
|
365
|
+
dollars: (amount) => `$${amount}`,
|
|
366
|
+
contextOf: (used, max) => `${used} من ${max}`,
|
|
367
|
+
contextCompacting: 'جارٍ التلخيص',
|
|
368
|
+
compactionRunning: 'جارٍ تلخيص المحادثة',
|
|
369
|
+
compactionDone: (pre, post) => (pre && post ? `تم تلخيص المحادثة (من ${pre} إلى ${post})` : 'تم تلخيص المحادثة'),
|
|
370
|
+
compactionFailed: 'فشل التلخيص',
|
|
371
|
+
turnStoppedError: 'توقف بسبب خطأ',
|
|
372
|
+
turnStoppedWith: (error) => `توقف: ${error}`,
|
|
373
|
+
limitStopped: (name, value) => ({
|
|
374
|
+
max_output_tokens: `توقف عند حد ${value} رمز`,
|
|
375
|
+
max_wall_s: `توقف عند حد الوقت ${value}`,
|
|
376
|
+
max_steps: `توقف عند حد ${value} خطوة`,
|
|
377
|
+
})[name] ?? `توقف عند حد (${name})`,
|
|
378
|
+
sessionResumed: 'تم استئناف المحادثة السابقة',
|
|
379
|
+
sessionEnded: (reason) => `انتهت الجلسة (${reason})`,
|
|
380
|
+
sessionForceStopped: () => null,
|
|
381
|
+
jumpToLatest: 'الأحدث',
|
|
382
|
+
focusRemove: 'إيقاف إرسال هذا',
|
|
383
|
+
focusLabel: 'التركيز',
|
|
384
|
+
unknownCommand: (name) => `لا يوجد أمر باسم /${name}. جرّب /help.`,
|
|
385
|
+
helpTitle: 'الأوامر',
|
|
386
|
+
noChats: 'لا توجد محادثات بعد',
|
|
387
|
+
renameChatPrompt: 'اسم المحادثة',
|
|
388
|
+
closeChat: 'إغلاق المحادثة',
|
|
389
|
+
messageActions: 'إجراءات الرسالة',
|
|
390
|
+
editing: 'تعديل رسالة. إرسالها يضيف رسالة جديدة.',
|
|
391
|
+
cancelEdit: 'إلغاء',
|
|
392
|
+
removeAttachment: (name) => `إزالة ${name}`,
|
|
393
|
+
attachmentUnsupported: (name) => `لا يمكن إرسال ${name} إلى هذا الوكيل`,
|
|
394
|
+
attachmentTooLarge: (name, max) => `${name} أكبر من ${max}`,
|
|
395
|
+
attachmentLimit: (max) => `${max} ملفات على الأكثر`,
|
|
396
|
+
attachments: 'المرفقات',
|
|
397
|
+
references: 'السياق',
|
|
398
|
+
removeReference: (label) => `إيقاف إرسال ${label}`,
|
|
399
|
+
mention: 'إشارة',
|
|
400
|
+
noMentions: 'لا توجد نتائج',
|
|
401
|
+
unread: (n) => `${n} جديد`,
|
|
402
|
+
announceWorking: 'الوكيل يعمل',
|
|
403
|
+
announceReply: (text) => `ردّ الوكيل: ${text}`,
|
|
404
|
+
announceApproval: 'الوكيل ينتظر موافقتك',
|
|
405
|
+
announceQuestion: 'لدى الوكيل سؤال لك',
|
|
406
|
+
},
|
|
407
|
+
});
|
|
408
|
+
defineLocale({
|
|
409
|
+
code: 'he',
|
|
410
|
+
dir: 'rtl',
|
|
411
|
+
labels: {
|
|
412
|
+
placeholder: 'כתבו לסוכן',
|
|
413
|
+
send: 'שליחה',
|
|
414
|
+
stop: 'עצירה',
|
|
415
|
+
queue: 'הוספה לתור',
|
|
416
|
+
queued: (count) => `${count} בתור`,
|
|
417
|
+
sendNow: 'שלחו עכשיו',
|
|
418
|
+
removeQueued: 'הסרה',
|
|
419
|
+
empty: 'בקשו עזרה מהסוכן.',
|
|
420
|
+
you: 'את/ה',
|
|
421
|
+
agent: 'סוכן',
|
|
422
|
+
newChat: 'שיחה חדשה',
|
|
423
|
+
chats: 'שיחות',
|
|
424
|
+
compact: 'צמצום',
|
|
425
|
+
clear: 'ניקוי',
|
|
426
|
+
plan: 'תוכנית',
|
|
427
|
+
model: 'מודל',
|
|
428
|
+
modelDefault: 'ברירת מחדל',
|
|
429
|
+
effort: 'מאמץ',
|
|
430
|
+
permissions: 'הרשאות',
|
|
431
|
+
allow: 'אישור',
|
|
432
|
+
allowAlways: 'אישור תמיד',
|
|
433
|
+
deny: 'דחייה',
|
|
434
|
+
approvalTitle: (tool) => `לאשר את ${tool}?`,
|
|
435
|
+
approvalAllowed: 'אושר',
|
|
436
|
+
approvalDenied: 'נדחה',
|
|
437
|
+
questionTitle: 'הסוכן שואל',
|
|
438
|
+
questionSubmit: 'מענה',
|
|
439
|
+
questionSkip: 'דילוג',
|
|
440
|
+
showSteps: 'הצגת שלבים',
|
|
441
|
+
hideSteps: 'הסתרת שלבים',
|
|
442
|
+
stepsNone: 'אין שלבים עדיין',
|
|
443
|
+
stepsWorking: (summary) => `עובד: ${summary}`,
|
|
444
|
+
thinking: 'חושב',
|
|
445
|
+
thinkingFor: (elapsed) => `חושב · ${elapsed}`,
|
|
446
|
+
turnStopped: 'נעצר',
|
|
447
|
+
connecting: 'מתחבר',
|
|
448
|
+
reconnecting: 'מתחבר מחדש',
|
|
449
|
+
offline: 'לא מקוון',
|
|
450
|
+
copy: 'העתקה',
|
|
451
|
+
copied: 'הועתק',
|
|
452
|
+
title: 'סוכן',
|
|
453
|
+
open: 'פתיחת השיחה',
|
|
454
|
+
close: 'סגירה',
|
|
455
|
+
collapse: 'כיווץ',
|
|
456
|
+
expand: 'הרחבה',
|
|
457
|
+
resize: 'שינוי גודל',
|
|
458
|
+
chatTitle: (c) => `שיחה ${c}`,
|
|
459
|
+
chatList: 'כל השיחות',
|
|
460
|
+
renameChat: 'שינוי שם',
|
|
461
|
+
deleteChat: 'מחיקת השיחה',
|
|
462
|
+
retry: 'ניסיון חוזר',
|
|
463
|
+
edit: 'עריכה ושליחה מחדש',
|
|
464
|
+
remove: 'הסרה מהתצוגה',
|
|
465
|
+
attach: 'צירוף קבצים',
|
|
466
|
+
dropFiles: 'גררו קבצים לצירוף',
|
|
467
|
+
suggestions: 'הצעות',
|
|
468
|
+
voice: 'קלט קולי',
|
|
469
|
+
justNow: 'הרגע',
|
|
470
|
+
minutesAgo: (c) => `לפני ${c} ד׳`,
|
|
471
|
+
hoursAgo: (c) => `לפני ${c} ש׳`,
|
|
472
|
+
daysAgo: (c) => `לפני ${c} י׳`,
|
|
473
|
+
},
|
|
474
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface QueuedMeta {
|
|
2
|
+
references: unknown[];
|
|
3
|
+
attachments: unknown[];
|
|
4
|
+
}
|
|
5
|
+
export interface QueuedMessage {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
meta?: QueuedMeta;
|
|
9
|
+
}
|
|
10
|
+
export declare class MessageQueue {
|
|
11
|
+
items: QueuedMessage[];
|
|
12
|
+
steerId: string | null;
|
|
13
|
+
private n;
|
|
14
|
+
add(text: string, meta?: QueuedMeta): QueuedMessage;
|
|
15
|
+
remove(id: string): void;
|
|
16
|
+
steer(id: string): QueuedMessage | null;
|
|
17
|
+
next(options?: {
|
|
18
|
+
interrupted?: boolean;
|
|
19
|
+
}): QueuedMessage | null;
|
|
20
|
+
putBack(item: QueuedMessage): void;
|
|
21
|
+
clear(): void;
|
|
22
|
+
get size(): number;
|
|
23
|
+
}
|