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.
@@ -0,0 +1,98 @@
1
+ import { TandemError, isEphemeral } from 'tandem-kit-core';
2
+ export class FakeTransport {
3
+ log = [];
4
+ sent = [];
5
+ calls = [];
6
+ streams = 0;
7
+ afters = [];
8
+ failSend = null;
9
+ existing = new Set();
10
+ extras = [];
11
+ deleted = [];
12
+ listed = [];
13
+ capabilities = {};
14
+ seq = 0;
15
+ buffer = [];
16
+ wake = null;
17
+ dropping = false;
18
+ active = 0;
19
+ emit(type, fields = {}) {
20
+ const event = { type, ts: '2026-01-01T00:00:00.000Z', ...fields };
21
+ if (!isEphemeral(type)) {
22
+ event.seq = ++this.seq;
23
+ this.log.push(event);
24
+ }
25
+ if (this.active) {
26
+ this.buffer.push(event);
27
+ this.wake?.();
28
+ }
29
+ }
30
+ dropStream() {
31
+ this.dropping = true;
32
+ this.wake?.();
33
+ }
34
+ info = async () => ({ models: [{ id: 'm1', label: 'M1' }], efforts: ['low'] });
35
+ sessions = async () => ({ sessions: this.listed });
36
+ deleteSession = async (id) => void this.deleted.push(id);
37
+ createSession = async () => {
38
+ this.calls.push('create');
39
+ this.existing.add('s1');
40
+ return this.summary('s1');
41
+ };
42
+ session = async (id) => {
43
+ if (!this.existing.has(id))
44
+ throw new TandemError(404, 'not_found', 'no such session');
45
+ return this.summary(id);
46
+ };
47
+ send = async (_id, text, extras) => {
48
+ if (this.failSend)
49
+ throw this.failSend;
50
+ this.sent.push(text);
51
+ if (extras)
52
+ this.extras.push(extras);
53
+ this.emit('user', { text });
54
+ this.emit('turn_started', { turn: this.sent.length });
55
+ return { seq: this.seq };
56
+ };
57
+ interrupt = async () => void this.calls.push('interrupt');
58
+ compact = async () => void this.calls.push('compact');
59
+ settings = async (_id, s) => void this.calls.push(`settings:${JSON.stringify(s)}`);
60
+ approve = async (_id, a, r) => void this.calls.push(`approve:${a}:${r.allow}`);
61
+ answer = async (_id, q, a) => void this.calls.push(`answer:${q}:${JSON.stringify(a)}`);
62
+ applyProposal = async (id, options) => void this.calls.push(`apply_proposal:${id}${options?.edit ? `:${JSON.stringify(options.edit)}` : ''}`);
63
+ discardProposal = async (id) => void this.calls.push(`discard_proposal:${id}`);
64
+ events = async (_id, after = 0) => ({ events: this.log.filter((e) => (e.seq ?? 0) > after), last_seq: this.seq });
65
+ async *sessionEvents(_id, after = 0, signal) {
66
+ this.streams += 1;
67
+ this.afters.push(after);
68
+ this.active += 1;
69
+ this.dropping = false;
70
+ this.buffer = [];
71
+ try {
72
+ for (const event of this.log.filter((e) => (e.seq ?? 0) > after))
73
+ yield event;
74
+ this.buffer = this.buffer.filter((e) => e.seq === undefined || e.seq > this.log.at(-1).seq);
75
+ while (!signal?.aborted && !this.dropping) {
76
+ const event = this.buffer.shift();
77
+ if (event) {
78
+ yield event;
79
+ continue;
80
+ }
81
+ await new Promise((resolve) => {
82
+ this.wake = resolve;
83
+ signal?.addEventListener('abort', () => resolve(), { once: true });
84
+ });
85
+ this.wake = null;
86
+ }
87
+ }
88
+ finally {
89
+ this.active -= 1;
90
+ }
91
+ }
92
+ finish(extra = {}) {
93
+ this.emit('turn_finished', { turn: this.sent.length, is_error: false, interrupted: false, ...extra });
94
+ }
95
+ summary(id) {
96
+ return { id, status: 'idle', harness: 'fake', settings: { model: null, effort: null, permission_mode: 'ask' }, last_seq: this.seq, turn: 0, pending: [] };
97
+ }
98
+ }
@@ -0,0 +1,29 @@
1
+ import type { Attachment, Focus } from './types.js';
2
+ export declare function focusLine(focus: Focus): string;
3
+ export declare function encodeFocus(focus: Focus | Focus[] | null | undefined, text: string): string;
4
+ export declare function decodeFocus(text: string): {
5
+ focus: string | null;
6
+ text: string;
7
+ };
8
+ export interface AttachmentNote {
9
+ name: string;
10
+ type: string;
11
+ size: number;
12
+ ref: string | null;
13
+ inline: boolean;
14
+ }
15
+ export interface SentAttachment {
16
+ attachment: Attachment;
17
+ ref?: string | null;
18
+ inline: boolean;
19
+ }
20
+ export declare function encodeAttachments(text: string, sent: SentAttachment[]): string;
21
+ export interface DecodedMessage {
22
+ focus: string | null;
23
+ references: string[];
24
+ attachments: AttachmentNote[];
25
+ text: string;
26
+ }
27
+ export declare function decodeMessage(raw: string): DecodedMessage;
28
+ export declare const kindOfType: (type: string, name?: string) => Attachment["kind"];
29
+ export declare function bytesText(bytes: number): string;
@@ -0,0 +1,61 @@
1
+ const PREAMBLE = /^((?:\[focus: [^\]\n]*\]\n)+)\n/;
2
+ const LINE = /^\[focus: ([^\]\n]*)\]$/;
3
+ const oneLine = (text) => text.replace(/\s+/g, ' ').replace(/[\[\]]/g, '').trim();
4
+ export function focusLine(focus) {
5
+ const label = oneLine(focus.label);
6
+ const detail = focus.text ? oneLine(focus.text) : '';
7
+ return `[focus: ${detail ? `${label} - ${detail}` : label}]`;
8
+ }
9
+ export function encodeFocus(focus, text) {
10
+ const list = (Array.isArray(focus) ? focus : focus ? [focus] : []).filter((f) => f && oneLine(f.label));
11
+ if (!list.length)
12
+ return text;
13
+ return `${list.map((f) => `${focusLine(f)}\n`).join('')}\n${text}`;
14
+ }
15
+ export function decodeFocus(text) {
16
+ const match = PREAMBLE.exec(text);
17
+ if (!match)
18
+ return { focus: null, text };
19
+ const lines = match[1].trim().split('\n').map((line) => LINE.exec(line)?.[1] ?? '');
20
+ return { focus: lines.join('; '), text: text.slice(match[0].length) };
21
+ }
22
+ const escapeAttr = (value) => value.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
23
+ const unescapeAttr = (value) => value.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&amp;/g, '&');
24
+ const escapeBody = (value) => value.replace(/<\/attachment>/g, '<\\/attachment>');
25
+ export function encodeAttachments(text, sent) {
26
+ let out = text;
27
+ for (const { attachment, ref, inline } of sent) {
28
+ const head = `<attachment name="${escapeAttr(attachment.name)}" type="${escapeAttr(attachment.type)}" size="${attachment.size}"${ref ? ` ref="${escapeAttr(ref)}"` : ''}`;
29
+ const block = inline && typeof attachment.text === 'string' ? `${head}>\n${escapeBody(attachment.text)}\n</attachment>` : `${head}/>`;
30
+ out = out ? `${out}\n\n${block}` : block;
31
+ }
32
+ return out;
33
+ }
34
+ const TRAILING = /(?:^|\n\n)<attachment name="([^"]*)" type="([^"]*)" size="(\d+)"(?: ref="([^"]*)")?(?:\/>|>\n((?:(?!<\/attachment>)[\s\S])*)\n<\/attachment>)$/;
35
+ export function decodeMessage(raw) {
36
+ const { focus, text: afterFocus } = decodeFocus(raw);
37
+ let text = afterFocus;
38
+ const attachments = [];
39
+ for (;;) {
40
+ const match = TRAILING.exec(text);
41
+ if (!match)
42
+ break;
43
+ attachments.unshift({ name: unescapeAttr(match[1]), type: unescapeAttr(match[2]), size: Number(match[3]), ref: match[4] ? unescapeAttr(match[4]) : null, inline: match[5] !== undefined });
44
+ text = text.slice(0, match.index);
45
+ }
46
+ return { focus, references: focus ? focus.split('; ') : [], attachments, text };
47
+ }
48
+ export const kindOfType = (type, name = '') => {
49
+ if (type.startsWith('image/'))
50
+ return 'image';
51
+ if (type.startsWith('text/') || /(json|xml|yaml|javascript|typescript|csv|markdown|toml|x-sh)$/.test(type) || /\.(txt|md|markdown|json|csv|ya?ml|toml|xml|html?|css|[cm]?[jt]sx?|py|rb|go|rs|java|sh|sql|log|ini|env)$/i.test(name))
52
+ return 'text';
53
+ return 'file';
54
+ };
55
+ export function bytesText(bytes) {
56
+ if (bytes < 1024)
57
+ return `${bytes} B`;
58
+ if (bytes < 1024 * 1024)
59
+ return `${+(bytes / 1024).toFixed(1)} kB`;
60
+ return `${+(bytes / 1024 / 1024).toFixed(1)} MB`;
61
+ }
@@ -0,0 +1,88 @@
1
+ import type { SessionState } from 'tandem-kit-core';
2
+ import { type Labels } from './labels.js';
3
+ import { type ToolClassifier } from './tools.js';
4
+ import type { ChatItem, QuestionOption, QuestionSpec, ToolCall } from './types.js';
5
+ export declare const tokensShort: (n: number) => string;
6
+ export declare function elapsedText(ms: number, labels?: Labels): string;
7
+ export declare function stepsSummary(allCalls: ToolCall[], options?: {
8
+ live?: boolean;
9
+ labels?: Labels;
10
+ kind?: ToolClassifier;
11
+ }): string;
12
+ export declare function activityOf(call: ToolCall | null, labels?: Labels, kind?: ToolClassifier): string | null;
13
+ export declare function runningCall(items: ChatItem[]): ToolCall | null;
14
+ /** milliseconds the agent has worked on the current turn: it stands still while a question or approval waits on the person. null outside a turn */
15
+ export declare function turnElapsedMs(state: {
16
+ turnStartedAt: number | null;
17
+ turnWaitedMs: number;
18
+ waitingSince: number | null;
19
+ }, now?: number): number | null;
20
+ export interface WorkingOptions {
21
+ labels?: Labels;
22
+ kind?: ToolClassifier;
23
+ /** `kind` names what the call does in general words, `summary` adds the call's own summary, a function says it your way (null falls back to `kind`) */
24
+ detail?: 'kind' | 'summary' | ((call: ToolCall) => string | null);
25
+ /** which elapsed time ends the line: the running call's or the thinking's own, the whole turn's (standing while the agent waits on you), or none */
26
+ time?: 'call' | 'turn' | 'none';
27
+ /** keep the line up while a question or approval waits on the person */
28
+ whileWaiting?: boolean;
29
+ }
30
+ export declare function workingLabel(state: {
31
+ thinkingSince: number | null;
32
+ items: ChatItem[];
33
+ activeTurn: boolean;
34
+ turnStartedAt?: number | null;
35
+ turnWaitedMs?: number;
36
+ waitingSince?: number | null;
37
+ session?: {
38
+ pending: unknown[];
39
+ };
40
+ }, now?: number, options?: WorkingOptions): string | null;
41
+ export declare const dollarsText: (n: number, labels?: Labels) => string;
42
+ export declare function costLabel(usage: SessionState['usage'], live: boolean, labels?: Labels): string | null;
43
+ export interface UsageLimits {
44
+ /** most agent steps in a turn */
45
+ max_steps?: number;
46
+ /** most output tokens in a turn */
47
+ max_output_tokens?: number;
48
+ /** most seconds of wall-clock time in a turn */
49
+ max_wall_s?: number;
50
+ }
51
+ export interface UsageLabel {
52
+ text: string;
53
+ near: boolean;
54
+ parts: {
55
+ text: string;
56
+ near: boolean;
57
+ }[];
58
+ }
59
+ export declare function usageLabel(usage: SessionState['usage'], limits?: UsageLimits, labels?: Labels): UsageLabel | null;
60
+ export interface ContextLabel {
61
+ text: string;
62
+ percent: number;
63
+ }
64
+ export declare function contextLabel(context: SessionState['context'], labels?: Labels): ContextLabel | null;
65
+ export declare function noticeText(item: Extract<ChatItem, {
66
+ kind: 'notice';
67
+ }>, labels?: Labels): string;
68
+ export declare function turnText(item: Extract<ChatItem, {
69
+ kind: 'turn';
70
+ }>, labels?: Labels): string;
71
+ export declare function compactionText(item: Extract<ChatItem, {
72
+ kind: 'compaction';
73
+ }>, labels?: Labels): string;
74
+ export declare const optionLabel: (option: string | QuestionOption) => string;
75
+ export declare const optionNote: (option: string | QuestionOption) => string;
76
+ export declare function answerFor(question: QuestionSpec, picked: string[], other?: string): string;
77
+ export interface QuestionDraft {
78
+ picked: string[];
79
+ other: string;
80
+ }
81
+ export declare function answersComplete(questions: QuestionSpec[], drafts: QuestionDraft[]): boolean;
82
+ export declare function answersFrom(questions: QuestionSpec[], drafts: QuestionDraft[]): Record<string, string>;
83
+ export type TimeFormat = 'time' | 'relative' | 'datetime';
84
+ export declare function formatTime(at: number, mode?: TimeFormat, options?: {
85
+ locale?: string;
86
+ now?: number;
87
+ labels?: Labels;
88
+ }): string;
@@ -0,0 +1,174 @@
1
+ import { defaultLabels } from "./labels.js";
2
+ import { shortToolName, toolKind as defaultKind, visibleCalls } from "./tools.js";
3
+ export const tokensShort = (n) => (n >= 1e6 ? `${+(n / 1e6).toFixed(1)}M` : n >= 1000 ? `${Math.round(n / 1000)}k` : String(n));
4
+ export function elapsedText(ms, labels = defaultLabels) {
5
+ const s = Math.max(0, Math.floor(ms / 1000));
6
+ if (s < 60)
7
+ return labels.elapsedSeconds(s);
8
+ if (s < 3600)
9
+ return labels.elapsedMinutes(Math.floor(s / 60), s % 60);
10
+ return labels.elapsedHours(Math.floor(s / 3600), Math.floor((s % 3600) / 60));
11
+ }
12
+ export function stepsSummary(allCalls, options = {}) {
13
+ const labels = options.labels ?? defaultLabels;
14
+ const kind = options.kind ?? defaultKind;
15
+ const calls = visibleCalls(allCalls);
16
+ const count = (k) => calls.filter((c) => kind(c.name) === k).length;
17
+ const edited = new Set(calls.filter((c) => kind(c.name) === 'edit').map((c) => c.summary || c.id)).size;
18
+ const parts = [];
19
+ if (count('read'))
20
+ parts.push(labels.stepsLooked(count('read')));
21
+ if (edited)
22
+ parts.push(labels.stepsEdited(edited));
23
+ if (count('run'))
24
+ parts.push(labels.stepsRan(count('run')));
25
+ if (count('tool'))
26
+ parts.push(labels.stepsUsed(count('tool')));
27
+ const text = parts.length ? parts.join(', ') : labels.stepsNone;
28
+ return options.live ? labels.stepsWorking(text) : `${text.charAt(0).toUpperCase()}${text.slice(1)}`;
29
+ }
30
+ export function activityOf(call, labels = defaultLabels, kind = defaultKind) {
31
+ if (!call)
32
+ return null;
33
+ const k = kind(call.name);
34
+ if (k === 'read')
35
+ return labels.activityRead;
36
+ if (k === 'edit') {
37
+ const file = String(call.input.file_path ?? call.input.notebook_path ?? '');
38
+ return labels.activityEdit(file ? (file.split('/').pop() ?? file) : null);
39
+ }
40
+ if (k === 'run')
41
+ return labels.activityCommand;
42
+ return labels.activityTool(shortToolName(call.name));
43
+ }
44
+ export function runningCall(items) {
45
+ for (let i = items.length - 1; i >= 0; i -= 1) {
46
+ const item = items[i];
47
+ if (item.kind !== 'steps')
48
+ continue;
49
+ for (let j = item.calls.length - 1; j >= 0; j -= 1) {
50
+ const call = item.calls[j];
51
+ if (call.status === 'running' && !call.hidden)
52
+ return call;
53
+ }
54
+ }
55
+ return null;
56
+ }
57
+ /** milliseconds the agent has worked on the current turn: it stands still while a question or approval waits on the person. null outside a turn */
58
+ export function turnElapsedMs(state, now = Date.now()) {
59
+ if (!state.turnStartedAt)
60
+ return null;
61
+ const waiting = state.waitingSince === null ? 0 : Math.max(0, now - state.waitingSince);
62
+ return Math.max(0, now - state.turnStartedAt - state.turnWaitedMs - waiting);
63
+ }
64
+ export function workingLabel(state, now = Date.now(), options = {}) {
65
+ const labels = options.labels ?? defaultLabels;
66
+ const time = options.time ?? 'call';
67
+ const turn = turnElapsedMs({ turnStartedAt: state.turnStartedAt ?? null, turnWaitedMs: state.turnWaitedMs ?? 0, waitingSince: state.waitingSince ?? null }, now);
68
+ const clock = (own) => (time === 'none' ? null : elapsedText(time === 'turn' && turn !== null ? turn : own, labels));
69
+ if (state.session?.pending.length) {
70
+ if (!options.whileWaiting)
71
+ return null;
72
+ const elapsed = clock(0);
73
+ return elapsed === null || time !== 'turn' ? labels.waitingForYou : labels.waitingForYouFor(elapsed);
74
+ }
75
+ if (typeof state.thinkingSince === 'number') {
76
+ const elapsed = clock(now - state.thinkingSince);
77
+ return elapsed === null ? labels.thinking : labels.thinkingFor(elapsed);
78
+ }
79
+ const call = runningCall(state.items);
80
+ if (!call)
81
+ return null;
82
+ const detail = options.detail ?? 'kind';
83
+ const own = typeof detail === 'function' ? detail(call) : null;
84
+ const what = own ?? (detail === 'summary' ? labels.activitySummary(shortToolName(call.name), call.summary) : activityOf(call, labels, options.kind));
85
+ if (!what)
86
+ return null;
87
+ const elapsed = clock(now - call.startedAt);
88
+ return elapsed === null ? what : labels.activityFor(what, elapsed);
89
+ }
90
+ export const dollarsText = (n, labels = defaultLabels) => (n > 0 && n < 0.005 ? labels.underACent : labels.dollars(n.toFixed(2)));
91
+ export function costLabel(usage, live, labels = defaultLabels) {
92
+ const cost = usage?.cost_usd;
93
+ if (typeof cost !== 'number')
94
+ return null;
95
+ return live ? labels.costSoFar(dollarsText(cost, labels)) : labels.costSpent(dollarsText(cost, labels));
96
+ }
97
+ export function usageLabel(usage, limits = {}, labels = defaultLabels) {
98
+ if (!usage)
99
+ return null;
100
+ const parts = [];
101
+ const near = (used, max) => Boolean(max) && used >= max * 0.8;
102
+ parts.push({ text: labels.usageSteps(usage.steps, limits.max_steps), near: near(usage.steps, limits.max_steps) });
103
+ if (usage.output_tokens) {
104
+ parts.push({ text: labels.usageTokens(tokensShort(usage.output_tokens), limits.max_output_tokens ? tokensShort(limits.max_output_tokens) : undefined), near: near(usage.output_tokens, limits.max_output_tokens) });
105
+ }
106
+ parts.push({ text: labels.usageTime(elapsedText(usage.elapsed_s * 1000, labels), limits.max_wall_s ? elapsedText(limits.max_wall_s * 1000, labels) : undefined), near: near(usage.elapsed_s, limits.max_wall_s) });
107
+ return { text: parts.map((p) => p.text).join(' · '), near: parts.some((p) => p.near), parts };
108
+ }
109
+ export function contextLabel(context, labels = defaultLabels) {
110
+ if (!context || typeof context.tokens !== 'number' || !context.max)
111
+ return null;
112
+ const k = (n) => (n >= 10000 ? `${Math.round(n / 1000)}k` : n >= 1000 ? `${(n / 1000).toFixed(1)}k` : String(n));
113
+ return { text: labels.contextOf(k(context.tokens), k(context.max)), percent: Math.min(100, Math.round((context.tokens / context.max) * 100)) };
114
+ }
115
+ export function noticeText(item, labels = defaultLabels) {
116
+ if (item.limit) {
117
+ const { name, value } = item.limit;
118
+ const shown = name === 'max_output_tokens' ? tokensShort(Number(value)) : name === 'max_wall_s' ? elapsedText(Number(value) * 1000, labels) : String(value);
119
+ return labels.limitStopped(name, shown);
120
+ }
121
+ if (item.ended)
122
+ return labels.sessionForceStopped(item.ended.reason, item.ended.wasBusy) ?? labels.sessionEnded(item.ended.reason);
123
+ return item.text;
124
+ }
125
+ export function turnText(item, labels = defaultLabels) {
126
+ if (item.tone === 'muted')
127
+ return labels.turnStopped;
128
+ return item.error ? labels.turnStoppedWith(item.error) : labels.turnStoppedError;
129
+ }
130
+ export function compactionText(item, labels = defaultLabels) {
131
+ if (item.status === 'running')
132
+ return labels.compactionRunning;
133
+ if (item.status === 'failed')
134
+ return labels.compactionFailed;
135
+ return labels.compactionDone(item.pre ? tokensShort(item.pre) : null, item.post ? tokensShort(item.post) : null);
136
+ }
137
+ export const optionLabel = (option) => (typeof option === 'string' ? option : option.label);
138
+ export const optionNote = (option) => (typeof option === 'string' ? '' : (option.description ?? ''));
139
+ export function answerFor(question, picked, other = '') {
140
+ const labels = [...picked];
141
+ const extra = other.trim();
142
+ if (extra)
143
+ labels.push(extra);
144
+ return question.multiSelect ? labels.join(', ') : (labels.at(-1) ?? '');
145
+ }
146
+ export function answersComplete(questions, drafts) {
147
+ return questions.every((q, i) => answerFor(q, drafts[i]?.picked ?? [], drafts[i]?.other ?? '').length > 0);
148
+ }
149
+ export function answersFrom(questions, drafts) {
150
+ return Object.fromEntries(questions.map((q, i) => [q.question, answerFor(q, drafts[i]?.picked ?? [], drafts[i]?.other ?? '')]));
151
+ }
152
+ export function formatTime(at, mode = 'time', options = {}) {
153
+ if (!at)
154
+ return '';
155
+ const labels = options.labels ?? defaultLabels;
156
+ const now = options.now ?? Date.now();
157
+ if (mode === 'relative') {
158
+ const minutes = Math.floor(Math.max(0, now - at) / 60000);
159
+ if (minutes < 1)
160
+ return labels.justNow;
161
+ if (minutes < 60)
162
+ return labels.minutesAgo(minutes);
163
+ if (minutes < 1440)
164
+ return labels.hoursAgo(Math.floor(minutes / 60));
165
+ return labels.daysAgo(Math.floor(minutes / 1440));
166
+ }
167
+ try {
168
+ const format = new Intl.DateTimeFormat(options.locale, mode === 'datetime' ? { dateStyle: 'medium', timeStyle: 'short' } : { hour: 'numeric', minute: '2-digit' });
169
+ return format.format(at);
170
+ }
171
+ catch {
172
+ return new Date(at).toISOString();
173
+ }
174
+ }
@@ -0,0 +1,13 @@
1
+ export * from './chats.js';
2
+ export * from './commands.js';
3
+ export * from './controller.js';
4
+ export * from './focus.js';
5
+ export * from './format.js';
6
+ export * from './labels.js';
7
+ export * from './locales.js';
8
+ export * from './queue.js';
9
+ export * from './reduce.js';
10
+ export * from './store.js';
11
+ export * from './tools.js';
12
+ export * from './transport.js';
13
+ export * from './types.js';
@@ -0,0 +1,13 @@
1
+ export * from "./chats.js";
2
+ export * from "./commands.js";
3
+ export * from "./controller.js";
4
+ export * from "./focus.js";
5
+ export * from "./format.js";
6
+ export * from "./labels.js";
7
+ export * from "./locales.js";
8
+ export * from "./queue.js";
9
+ export * from "./reduce.js";
10
+ export * from "./store.js";
11
+ export * from "./tools.js";
12
+ export * from "./transport.js";
13
+ export * from "./types.js";
@@ -0,0 +1,156 @@
1
+ export interface Labels {
2
+ placeholder: string;
3
+ send: string;
4
+ stop: string;
5
+ queue: string;
6
+ queued: (count: number) => string;
7
+ sendNow: string;
8
+ removeQueued: string;
9
+ empty: string;
10
+ you: string;
11
+ agent: string;
12
+ newChat: string;
13
+ chats: string;
14
+ compact: string;
15
+ clear: string;
16
+ plan: string;
17
+ model: string;
18
+ modelDefault: string;
19
+ effort: string;
20
+ permissions: string;
21
+ permissionMode: (mode: string) => string;
22
+ allow: string;
23
+ allowAlways: string;
24
+ deny: string;
25
+ approvePlan: string;
26
+ rejectPlan: string;
27
+ approvalTitle: (tool: string) => string;
28
+ approvalAllowed: string;
29
+ approvalAlways: string;
30
+ approvalDenied: string;
31
+ approvalExpired: string;
32
+ planTitle: string;
33
+ denyReason: string;
34
+ questionTitle: string;
35
+ questionOther: string;
36
+ questionSubmit: string;
37
+ questionSkip: string;
38
+ questionAnswered: string;
39
+ questionSkipped: string;
40
+ questionExpired: string;
41
+ changeTitle: (actor: string, version: number) => string;
42
+ rejectedTitle: string;
43
+ clashTitle: string;
44
+ clashKeep: string;
45
+ clashUse: string;
46
+ clashKept: string;
47
+ clashDropped: string;
48
+ proposalTitle: string;
49
+ proposalApply: string;
50
+ proposalDiscard: string;
51
+ proposalApplied: string;
52
+ proposalDiscarded: string;
53
+ proposalRefused: string;
54
+ proposalEdited: string;
55
+ showSteps: string;
56
+ hideSteps: string;
57
+ stepsLooked: (n: number) => string;
58
+ stepsEdited: (n: number) => string;
59
+ stepsRan: (n: number) => string;
60
+ stepsUsed: (n: number) => string;
61
+ stepsNone: string;
62
+ stepsWorking: (summary: string) => string;
63
+ callRunning: string;
64
+ callFailed: string;
65
+ callDeclined: string;
66
+ callStopped: string;
67
+ stepFailed: string;
68
+ imageAlt: string;
69
+ imageEnlarge: string;
70
+ imageShrink: string;
71
+ thinking: string;
72
+ thinkingFor: (elapsed: string) => string;
73
+ activityRead: string;
74
+ activityEdit: (file: string | null) => string;
75
+ activityCommand: string;
76
+ activityTool: (name: string) => string;
77
+ activityFor: (what: string, elapsed: string) => string;
78
+ activitySummary: (name: string, summary: string) => string;
79
+ waitingForYou: string;
80
+ waitingForYouFor: (elapsed: string) => string;
81
+ elapsedSeconds: (s: number) => string;
82
+ elapsedMinutes: (m: number, s: number) => string;
83
+ elapsedHours: (h: number, m: number) => string;
84
+ usageSteps: (used: number, max?: number) => string;
85
+ usageTokens: (used: string, max?: string) => string;
86
+ usageTime: (used: string, max?: string) => string;
87
+ costSpent: (dollars: string) => string;
88
+ costSoFar: (dollars: string) => string;
89
+ underACent: string;
90
+ dollars: (amount: string) => string;
91
+ contextOf: (used: string, max: string) => string;
92
+ contextCompacting: string;
93
+ compactionRunning: string;
94
+ compactionDone: (pre: string | null, post: string | null) => string;
95
+ compactionFailed: string;
96
+ turnStopped: string;
97
+ turnStoppedError: string;
98
+ turnStoppedWith: (error: string) => string;
99
+ limitStopped: (name: string, value: string) => string;
100
+ sessionResumed: string;
101
+ sessionEnded: (reason: string) => string;
102
+ sessionForceStopped: (reason: string, wasBusy: boolean | null) => string | null;
103
+ jumpToLatest: string;
104
+ connecting: string;
105
+ reconnecting: string;
106
+ offline: string;
107
+ focusRemove: string;
108
+ focusLabel: string;
109
+ copy: string;
110
+ copied: string;
111
+ unknownCommand: (name: string) => string;
112
+ helpTitle: string;
113
+ title: string;
114
+ open: string;
115
+ close: string;
116
+ collapse: string;
117
+ expand: string;
118
+ resize: string;
119
+ chatTitle: (n: number) => string;
120
+ chatList: string;
121
+ noChats: string;
122
+ renameChat: string;
123
+ renameChatPrompt: string;
124
+ deleteChat: string;
125
+ closeChat: string;
126
+ retry: string;
127
+ edit: string;
128
+ remove: string;
129
+ messageActions: string;
130
+ editing: string;
131
+ cancelEdit: string;
132
+ attach: string;
133
+ removeAttachment: (name: string) => string;
134
+ attachmentUnsupported: (name: string) => string;
135
+ attachmentTooLarge: (name: string, max: string) => string;
136
+ attachmentLimit: (max: number) => string;
137
+ dropFiles: string;
138
+ attachments: string;
139
+ references: string;
140
+ removeReference: (label: string) => string;
141
+ mention: string;
142
+ noMentions: string;
143
+ suggestions: string;
144
+ voice: string;
145
+ unread: (n: number) => string;
146
+ justNow: string;
147
+ minutesAgo: (n: number) => string;
148
+ hoursAgo: (n: number) => string;
149
+ daysAgo: (n: number) => string;
150
+ announceWorking: string;
151
+ announceReply: (text: string) => string;
152
+ announceApproval: string;
153
+ announceQuestion: string;
154
+ }
155
+ export declare const defaultLabels: Labels;
156
+ export declare function createLabels(overrides?: Partial<Labels>): Labels;