@markusylisiurunen/tau 0.3.55 → 0.3.57
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/dist/core/auth/credential_store.js +1 -9
- package/dist/core/auth/credential_store.js.map +1 -1
- package/dist/core/cli.js +3 -0
- package/dist/core/cli.js.map +1 -1
- package/dist/core/config/runtime.js +4 -4
- package/dist/core/config/runtime.js.map +1 -1
- package/dist/core/config/runtime_config_snapshot.js +1 -1
- package/dist/core/config/runtime_config_snapshot.js.map +1 -1
- package/dist/core/history/history_manager.js +35 -25
- package/dist/core/history/history_manager.js.map +1 -1
- package/dist/core/models/catalog.js +11 -45
- package/dist/core/models/catalog.js.map +1 -1
- package/dist/core/models/cli.js +49 -0
- package/dist/core/models/cli.js.map +1 -0
- package/dist/core/models/remote_catalog.js +394 -0
- package/dist/core/models/remote_catalog.js.map +1 -0
- package/dist/core/personas.js +3 -3
- package/dist/core/static/tau_docs/getting-started.md +5 -1
- package/dist/core/static/tau_docs/history.md +1 -1
- package/dist/core/static/tau_docs/models.md +12 -2
- package/dist/core/static/tau_docs/node-sdk.md +7 -1
- package/dist/core/static/tau_docs/security.md +5 -0
- package/dist/core/static/tau_docs/telegram.md +2 -2
- package/dist/core/static/tau_docs/tui.md +2 -2
- package/dist/core/telegram/adapter.js +2 -2
- package/dist/core/telegram/adapter.js.map +1 -1
- package/dist/core/telegram/local_session_client.js +2 -1
- package/dist/core/telegram/local_session_client.js.map +1 -1
- package/dist/core/telegram/tts.js +3 -4
- package/dist/core/telegram/tts.js.map +1 -1
- package/dist/core/utils/gemini_speech.js +435 -150
- package/dist/core/utils/gemini_speech.js.map +1 -1
- package/dist/core/utils/model_stream.js +0 -10
- package/dist/core/utils/model_stream.js.map +1 -1
- package/dist/core/utils/openai_transcription.js +164 -23
- package/dist/core/utils/openai_transcription.js.map +1 -1
- package/dist/core/utils/speech_to_text.js +1 -0
- package/dist/core/utils/speech_to_text.js.map +1 -1
- package/dist/core/version.js +2 -1
- package/dist/core/version.js.map +1 -1
- package/dist/execution/execution_environment.js.map +1 -1
- package/dist/execution/tool_backend_execution_environment.js +2 -1
- package/dist/execution/tool_backend_execution_environment.js.map +1 -1
- package/dist/history/worker/index.js +22 -7
- package/dist/history/worker/index.js.map +1 -1
- package/dist/host/execution_runtime.js +3 -1
- package/dist/host/execution_runtime.js.map +1 -1
- package/dist/host/local_session_host.js +37 -11
- package/dist/host/local_session_host.js.map +1 -1
- package/dist/main.js +74 -8
- package/dist/main.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/local_client.d.ts +4 -1
- package/dist/sdk/local_client.js +35 -9
- package/dist/sdk/local_client.js.map +1 -1
- package/dist/sdk/types.d.ts +14 -0
- package/dist/tui/session_chat_controller.js +3 -0
- package/dist/tui/session_chat_controller.js.map +1 -1
- package/dist/tui/speech_playback.js +145 -82
- package/dist/tui/speech_playback.js.map +1 -1
- package/package.json +4 -4
- package/dist/core/models/tau_extensions.js +0 -27
- package/dist/core/models/tau_extensions.js.map +0 -1
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { chmodSync, mkdirSync, readFileSync, renameSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { getBuiltinModelDataGeneratedAt, getBuiltinModels, getBuiltinProviders, } from "@earendil-works/pi-ai/providers/all";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { PI_AI_VERSION } from "../version.js";
|
|
7
|
+
const CACHE_VERSION = 1;
|
|
8
|
+
const REFRESH_INTERVAL_MS = 4 * 60 * 60 * 1000;
|
|
9
|
+
const REQUEST_TIMEOUT_MS = 15_000;
|
|
10
|
+
const REFRESH_CONCURRENCY = 6;
|
|
11
|
+
const LOCK_TIMEOUT_MS = 30_000;
|
|
12
|
+
const LOCK_RETRY_MS = 20;
|
|
13
|
+
const LOCK_STALE_MS = 60_000;
|
|
14
|
+
const PRIVATE_DIRECTORY_MODE = 0o700;
|
|
15
|
+
const PRIVATE_FILE_MODE = 0o600;
|
|
16
|
+
const activeRefreshesByPath = new Map();
|
|
17
|
+
const CostRatesSchema = z
|
|
18
|
+
.object({
|
|
19
|
+
input: z.number().finite(),
|
|
20
|
+
output: z.number().finite(),
|
|
21
|
+
cacheRead: z.number().finite(),
|
|
22
|
+
cacheWrite: z.number().finite(),
|
|
23
|
+
})
|
|
24
|
+
.passthrough();
|
|
25
|
+
const ModelSchema = z
|
|
26
|
+
.object({
|
|
27
|
+
id: z.string().min(1),
|
|
28
|
+
name: z.string().min(1),
|
|
29
|
+
api: z.string().min(1),
|
|
30
|
+
provider: z.string().min(1),
|
|
31
|
+
baseUrl: z.string(),
|
|
32
|
+
reasoning: z.boolean(),
|
|
33
|
+
thinkingLevelMap: z.record(z.string(), z.string().nullable()).optional(),
|
|
34
|
+
input: z.array(z.enum(["text", "image"])),
|
|
35
|
+
cost: CostRatesSchema.extend({
|
|
36
|
+
tiers: z
|
|
37
|
+
.array(CostRatesSchema.extend({
|
|
38
|
+
inputTokensAbove: z.number().int().nonnegative(),
|
|
39
|
+
}))
|
|
40
|
+
.optional(),
|
|
41
|
+
}),
|
|
42
|
+
contextWindow: z.number().int().positive(),
|
|
43
|
+
maxTokens: z.number().int().positive(),
|
|
44
|
+
samplingParams: z.record(z.string(), z.unknown()).optional(),
|
|
45
|
+
headers: z.record(z.string(), z.string()).optional(),
|
|
46
|
+
compat: z.unknown().optional(),
|
|
47
|
+
})
|
|
48
|
+
.passthrough();
|
|
49
|
+
const StoredProviderSchema = z.object({
|
|
50
|
+
models: z.array(ModelSchema),
|
|
51
|
+
checkedAt: z.number().nonnegative(),
|
|
52
|
+
lastModified: z.number().nonnegative(),
|
|
53
|
+
etag: z.string().optional(),
|
|
54
|
+
});
|
|
55
|
+
const StoreSchema = z.object({
|
|
56
|
+
version: z.literal(CACHE_VERSION),
|
|
57
|
+
providers: z.record(z.string(), StoredProviderSchema),
|
|
58
|
+
});
|
|
59
|
+
export function getDefaultModelCatalogStorePath(home) {
|
|
60
|
+
return join(home, ".config", "tau", "models-store.json");
|
|
61
|
+
}
|
|
62
|
+
function cloneModel(model) {
|
|
63
|
+
return structuredClone(model);
|
|
64
|
+
}
|
|
65
|
+
function emptyDocument() {
|
|
66
|
+
return { version: CACHE_VERSION, providers: {} };
|
|
67
|
+
}
|
|
68
|
+
function parseStoreDocument(raw) {
|
|
69
|
+
let value;
|
|
70
|
+
try {
|
|
71
|
+
value = JSON.parse(raw);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return emptyDocument();
|
|
75
|
+
}
|
|
76
|
+
const parsed = StoreSchema.safeParse(value);
|
|
77
|
+
return parsed.success ? parsed.data : emptyDocument();
|
|
78
|
+
}
|
|
79
|
+
function readStoreDocument(path) {
|
|
80
|
+
try {
|
|
81
|
+
return parseStoreDocument(readFileSync(path, "utf8"));
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
if (error.code === "ENOENT") {
|
|
85
|
+
return emptyDocument();
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function acquireLock(path) {
|
|
91
|
+
const startedAt = Date.now();
|
|
92
|
+
while (true) {
|
|
93
|
+
try {
|
|
94
|
+
mkdirSync(path, { mode: PRIVATE_DIRECTORY_MODE });
|
|
95
|
+
return () => rmSync(path, { recursive: true, force: true });
|
|
96
|
+
}
|
|
97
|
+
catch (error) {
|
|
98
|
+
if (error.code !== "EEXIST")
|
|
99
|
+
throw error;
|
|
100
|
+
try {
|
|
101
|
+
if (Date.now() - statSync(path).mtimeMs >= LOCK_STALE_MS) {
|
|
102
|
+
rmSync(path, { recursive: true, force: true });
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch { }
|
|
107
|
+
if (Date.now() - startedAt >= LOCK_TIMEOUT_MS) {
|
|
108
|
+
throw new Error(`timed out waiting for model catalog store lock '${path}'`);
|
|
109
|
+
}
|
|
110
|
+
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_MS));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
function saveStoreDocument(path, document) {
|
|
115
|
+
const directory = dirname(path);
|
|
116
|
+
mkdirSync(directory, { recursive: true, mode: PRIVATE_DIRECTORY_MODE });
|
|
117
|
+
chmodSync(directory, PRIVATE_DIRECTORY_MODE);
|
|
118
|
+
const temporaryPath = `${path}.${process.pid}.${randomUUID()}.tmp`;
|
|
119
|
+
try {
|
|
120
|
+
writeFileSync(temporaryPath, `${JSON.stringify(document, null, 2)}\n`, {
|
|
121
|
+
encoding: "utf8",
|
|
122
|
+
flag: "wx",
|
|
123
|
+
mode: PRIVATE_FILE_MODE,
|
|
124
|
+
});
|
|
125
|
+
renameSync(temporaryPath, path);
|
|
126
|
+
chmodSync(path, PRIVATE_FILE_MODE);
|
|
127
|
+
}
|
|
128
|
+
finally {
|
|
129
|
+
rmSync(temporaryPath, { force: true });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function hasSameProviderRevision(current, expected) {
|
|
133
|
+
return (current?.checkedAt === expected?.checkedAt &&
|
|
134
|
+
current?.lastModified === expected?.lastModified &&
|
|
135
|
+
current?.etag === expected?.etag);
|
|
136
|
+
}
|
|
137
|
+
class FileRemoteModelCatalogStore {
|
|
138
|
+
path;
|
|
139
|
+
constructor(path) {
|
|
140
|
+
this.path = path;
|
|
141
|
+
}
|
|
142
|
+
read() {
|
|
143
|
+
return readStoreDocument(this.path);
|
|
144
|
+
}
|
|
145
|
+
async apply(updates) {
|
|
146
|
+
if (updates.length === 0) {
|
|
147
|
+
return { document: this.read(), skippedProviders: new Set() };
|
|
148
|
+
}
|
|
149
|
+
mkdirSync(dirname(this.path), { recursive: true, mode: PRIVATE_DIRECTORY_MODE });
|
|
150
|
+
const release = await acquireLock(`${this.path}.lock`);
|
|
151
|
+
try {
|
|
152
|
+
const document = this.read();
|
|
153
|
+
const skippedProviders = new Set();
|
|
154
|
+
let changed = false;
|
|
155
|
+
for (const update of updates) {
|
|
156
|
+
const current = document.providers[update.provider];
|
|
157
|
+
if (!hasSameProviderRevision(current, update.expected)) {
|
|
158
|
+
const incomingIsNewer = update.type === "replace" &&
|
|
159
|
+
current !== undefined &&
|
|
160
|
+
update.entry.lastModified > current.lastModified;
|
|
161
|
+
if (!incomingIsNewer) {
|
|
162
|
+
skippedProviders.add(update.provider);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
document.providers[update.provider] =
|
|
167
|
+
update.type === "replace"
|
|
168
|
+
? structuredClone(update.entry)
|
|
169
|
+
: { ...structuredClone(current), checkedAt: update.checkedAt };
|
|
170
|
+
changed = true;
|
|
171
|
+
}
|
|
172
|
+
if (changed)
|
|
173
|
+
saveStoreDocument(this.path, document);
|
|
174
|
+
return { document, skippedProviders };
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
release();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function parseProviderCatalog(provider, value) {
|
|
182
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
183
|
+
throw new Error(`invalid model catalog for provider '${provider}'`);
|
|
184
|
+
}
|
|
185
|
+
const models = [];
|
|
186
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
187
|
+
const parsed = ModelSchema.safeParse(entry);
|
|
188
|
+
if (!parsed.success || parsed.data.id !== key || parsed.data.provider !== provider) {
|
|
189
|
+
throw new Error(`invalid model catalog entry '${provider}/${key}'`);
|
|
190
|
+
}
|
|
191
|
+
models.push(parsed.data);
|
|
192
|
+
}
|
|
193
|
+
return models;
|
|
194
|
+
}
|
|
195
|
+
function activeModels(entry, builtinGeneratedAt) {
|
|
196
|
+
if (!entry || entry.lastModified <= builtinGeneratedAt)
|
|
197
|
+
return [];
|
|
198
|
+
return entry.models;
|
|
199
|
+
}
|
|
200
|
+
function createSnapshot(document, builtinGeneratedAt) {
|
|
201
|
+
const snapshot = new Map();
|
|
202
|
+
for (const [provider, entry] of Object.entries(document.providers)) {
|
|
203
|
+
const models = activeModels(entry, builtinGeneratedAt);
|
|
204
|
+
if (models.length > 0)
|
|
205
|
+
snapshot.set(provider, models.map(cloneModel));
|
|
206
|
+
}
|
|
207
|
+
return snapshot;
|
|
208
|
+
}
|
|
209
|
+
function getDefaultProviderIds() {
|
|
210
|
+
return getBuiltinProviders().filter((provider) => getBuiltinModels(provider).length > 0);
|
|
211
|
+
}
|
|
212
|
+
function getUserAgent() {
|
|
213
|
+
return `pi/${PI_AI_VERSION} (${process.platform}; node/${process.version}; ${process.arch})`;
|
|
214
|
+
}
|
|
215
|
+
function formatError(error) {
|
|
216
|
+
if (error instanceof Error)
|
|
217
|
+
return error;
|
|
218
|
+
return new Error(String(error));
|
|
219
|
+
}
|
|
220
|
+
async function mapConcurrent(values, concurrency, worker) {
|
|
221
|
+
const results = new Array(values.length);
|
|
222
|
+
let nextIndex = 0;
|
|
223
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, values.length) }, async () => {
|
|
224
|
+
while (nextIndex < values.length) {
|
|
225
|
+
const index = nextIndex++;
|
|
226
|
+
results[index] = await worker(values[index]);
|
|
227
|
+
}
|
|
228
|
+
}));
|
|
229
|
+
return results;
|
|
230
|
+
}
|
|
231
|
+
export class RemoteModelCatalog {
|
|
232
|
+
path;
|
|
233
|
+
store;
|
|
234
|
+
fetch;
|
|
235
|
+
now;
|
|
236
|
+
providerIds;
|
|
237
|
+
builtinGeneratedAt;
|
|
238
|
+
baseUrl;
|
|
239
|
+
requestTimeoutMs;
|
|
240
|
+
refreshIntervalMs;
|
|
241
|
+
constructor(options) {
|
|
242
|
+
this.path = options.path;
|
|
243
|
+
this.store = new FileRemoteModelCatalogStore(options.path);
|
|
244
|
+
this.fetch = options.fetch ?? fetch;
|
|
245
|
+
this.now = options.now ?? Date.now;
|
|
246
|
+
this.providerIds = options.providerIds ?? getDefaultProviderIds();
|
|
247
|
+
const builtinGeneratedAt = options.builtinGeneratedAt ?? getBuiltinModelDataGeneratedAt();
|
|
248
|
+
if (builtinGeneratedAt === undefined) {
|
|
249
|
+
throw new Error("pi-ai built-in model catalog is missing its generation timestamp");
|
|
250
|
+
}
|
|
251
|
+
this.builtinGeneratedAt = builtinGeneratedAt;
|
|
252
|
+
this.baseUrl = options.baseUrl ?? "https://pi.dev";
|
|
253
|
+
this.requestTimeoutMs = options.requestTimeoutMs ?? REQUEST_TIMEOUT_MS;
|
|
254
|
+
this.refreshIntervalMs = options.refreshIntervalMs ?? REFRESH_INTERVAL_MS;
|
|
255
|
+
}
|
|
256
|
+
snapshot() {
|
|
257
|
+
return createSnapshot(this.store.read(), this.builtinGeneratedAt);
|
|
258
|
+
}
|
|
259
|
+
refresh(options = {}) {
|
|
260
|
+
let active = activeRefreshesByPath.get(this.path);
|
|
261
|
+
if (!active) {
|
|
262
|
+
const controller = new AbortController();
|
|
263
|
+
let created;
|
|
264
|
+
const promise = this.runRefresh({ force: options.force, signal: controller.signal }).finally(() => {
|
|
265
|
+
if (activeRefreshesByPath.get(this.path) === created) {
|
|
266
|
+
activeRefreshesByPath.delete(this.path);
|
|
267
|
+
}
|
|
268
|
+
});
|
|
269
|
+
created = { controller, consumers: new Set(), promise };
|
|
270
|
+
activeRefreshesByPath.set(this.path, created);
|
|
271
|
+
active = created;
|
|
272
|
+
}
|
|
273
|
+
return this.observeRefresh(active, options.signal);
|
|
274
|
+
}
|
|
275
|
+
observeRefresh(active, signal) {
|
|
276
|
+
const consumer = Symbol();
|
|
277
|
+
active.consumers.add(consumer);
|
|
278
|
+
let released = false;
|
|
279
|
+
const release = () => {
|
|
280
|
+
if (released)
|
|
281
|
+
return false;
|
|
282
|
+
released = true;
|
|
283
|
+
active.consumers.delete(consumer);
|
|
284
|
+
if (active.consumers.size === 0 &&
|
|
285
|
+
activeRefreshesByPath.get(this.path) === active &&
|
|
286
|
+
!active.controller.signal.aborted) {
|
|
287
|
+
active.controller.abort();
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
return false;
|
|
291
|
+
};
|
|
292
|
+
if (!signal) {
|
|
293
|
+
return active.promise.finally(() => {
|
|
294
|
+
release();
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
return new Promise((resolve, reject) => {
|
|
298
|
+
const rejectAfterRelease = () => {
|
|
299
|
+
const abortedOperation = release();
|
|
300
|
+
const rejectWithReason = () => reject(signal.reason);
|
|
301
|
+
if (abortedOperation) {
|
|
302
|
+
void active.promise.then(rejectWithReason, rejectWithReason);
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
rejectWithReason();
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
if (signal.aborted) {
|
|
309
|
+
rejectAfterRelease();
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const onAbort = () => rejectAfterRelease();
|
|
313
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
314
|
+
void active.promise.then((result) => {
|
|
315
|
+
if (released)
|
|
316
|
+
return;
|
|
317
|
+
signal.removeEventListener("abort", onAbort);
|
|
318
|
+
release();
|
|
319
|
+
resolve(result);
|
|
320
|
+
}, (error) => {
|
|
321
|
+
if (released)
|
|
322
|
+
return;
|
|
323
|
+
signal.removeEventListener("abort", onAbort);
|
|
324
|
+
release();
|
|
325
|
+
reject(error);
|
|
326
|
+
});
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
async runRefresh(options) {
|
|
330
|
+
const stored = this.store.read();
|
|
331
|
+
const results = new Map();
|
|
332
|
+
const updates = await mapConcurrent(this.providerIds, REFRESH_CONCURRENCY, async (provider) => {
|
|
333
|
+
const entry = stored.providers[provider];
|
|
334
|
+
const models = activeModels(entry, this.builtinGeneratedAt);
|
|
335
|
+
if (!options.force &&
|
|
336
|
+
entry?.checkedAt !== undefined &&
|
|
337
|
+
this.now() - entry.checkedAt < this.refreshIntervalMs) {
|
|
338
|
+
results.set(provider, { status: "fresh", modelCount: models.length });
|
|
339
|
+
return undefined;
|
|
340
|
+
}
|
|
341
|
+
try {
|
|
342
|
+
options.signal?.throwIfAborted();
|
|
343
|
+
const timeoutSignal = AbortSignal.timeout(this.requestTimeoutMs);
|
|
344
|
+
const signal = options.signal
|
|
345
|
+
? AbortSignal.any([options.signal, timeoutSignal])
|
|
346
|
+
: timeoutSignal;
|
|
347
|
+
const response = await this.fetch(new URL(`/api/models/providers/${encodeURIComponent(provider)}`, this.baseUrl), {
|
|
348
|
+
headers: {
|
|
349
|
+
accept: "application/json",
|
|
350
|
+
"User-Agent": getUserAgent(),
|
|
351
|
+
...(entry?.models.length && entry.etag ? { "If-None-Match": entry.etag } : {}),
|
|
352
|
+
},
|
|
353
|
+
signal,
|
|
354
|
+
});
|
|
355
|
+
const checkedAt = this.now();
|
|
356
|
+
if (response.status === 304 && entry) {
|
|
357
|
+
results.set(provider, { status: "unchanged", modelCount: models.length });
|
|
358
|
+
return { type: "revalidate", provider, expected: entry, checkedAt };
|
|
359
|
+
}
|
|
360
|
+
if (!response.ok) {
|
|
361
|
+
throw new Error(`model catalog request failed with status ${response.status}`);
|
|
362
|
+
}
|
|
363
|
+
const refreshed = parseProviderCatalog(provider, await response.json());
|
|
364
|
+
const lastModified = Date.parse(response.headers.get("last-modified") ?? "");
|
|
365
|
+
if (Number.isNaN(lastModified) || lastModified < 0) {
|
|
366
|
+
throw new Error("model catalog response is missing a valid Last-Modified header");
|
|
367
|
+
}
|
|
368
|
+
const etag = response.headers.get("etag");
|
|
369
|
+
const nextEntry = {
|
|
370
|
+
models: refreshed,
|
|
371
|
+
checkedAt,
|
|
372
|
+
lastModified,
|
|
373
|
+
...(etag ? { etag } : {}),
|
|
374
|
+
};
|
|
375
|
+
results.set(provider, { status: "updated", modelCount: refreshed.length });
|
|
376
|
+
return { type: "replace", provider, expected: entry, entry: nextEntry };
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
results.set(provider, { status: "failed", error: formatError(error) });
|
|
380
|
+
return undefined;
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
const applied = await this.store.apply(updates.filter((update) => update !== undefined));
|
|
384
|
+
for (const provider of applied.skippedProviders) {
|
|
385
|
+
const models = activeModels(applied.document.providers[provider], this.builtinGeneratedAt);
|
|
386
|
+
results.set(provider, { status: "unchanged", modelCount: models.length });
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
providers: results,
|
|
390
|
+
snapshot: createSnapshot(applied.document, this.builtinGeneratedAt),
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
//# sourceMappingURL=remote_catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remote_catalog.js","sourceRoot":"","sources":["../../../src/core/models/remote_catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,UAAU,EACV,MAAM,EACN,QAAQ,EACR,aAAa,GACd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,OAAO,EACL,8BAA8B,EAC9B,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,mBAAmB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAC/C,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAClC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,eAAe,GAAG,MAAM,CAAC;AAC/B,MAAM,aAAa,GAAG,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,EAAE,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO;YACL,SAAS,EAAE,OAAO;YAClB,QAAQ,EAAE,cAAc,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,kBAAkB,CAAC;SACpE,CAAC;IACJ,CAAC;CACF"}
|
package/dist/core/personas.js
CHANGED
|
@@ -172,10 +172,10 @@ const CODER_SYSTEM_PROMPT = [
|
|
|
172
172
|
].join("\n\n");
|
|
173
173
|
const PERSONA_SPECS = [
|
|
174
174
|
{
|
|
175
|
-
id: "gemini-3.
|
|
176
|
-
description: "Gemini 3.
|
|
175
|
+
id: "gemini-3.7-flash",
|
|
176
|
+
description: "Gemini 3.7 Flash",
|
|
177
177
|
provider: "google",
|
|
178
|
-
modelId: "gemini-3.
|
|
178
|
+
modelId: "gemini-3.7-flash",
|
|
179
179
|
allowedReasoningLevels: ["low", "medium", "high"],
|
|
180
180
|
settings: { reasoning: "medium" },
|
|
181
181
|
skills: "*",
|
|
@@ -30,7 +30,11 @@ command -v tau
|
|
|
30
30
|
npm list -g @markusylisiurunen/tau --depth=0
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
The built-in documentation is packaged with Tau. Upgrading the package upgrades the documentation read by `tau_docs` on that host.
|
|
33
|
+
The built-in documentation is packaged with Tau. Upgrading the package upgrades the documentation read by `tau_docs` on that host. Tau also refreshes compatible model metadata asynchronously when a model-owning host starts. To force that refresh without upgrading Tau, run:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
tau models refresh
|
|
37
|
+
```
|
|
34
38
|
|
|
35
39
|
## Set up a provider
|
|
36
40
|
|
|
@@ -120,7 +120,7 @@ Remote replication is local-first:
|
|
|
120
120
|
|
|
121
121
|
A service outage does not block session execution or local transcript capture. Pending operations remain durable and are retried when replication is scheduled again, including after host restart or later history activity. The remote service applies operations idempotently. Tau preserves operation order within each session while processing separate session lanes independently.
|
|
122
122
|
|
|
123
|
-
A permanent operation-domain rejection, such as conflicting immutable session metadata, quarantines only that session's replication lane. Its pending operations and diagnostic remain in local SQLite, later operations for that session stay blocked, and unrelated sessions continue replicating. Transient transport, authentication, rate-limit, and service failures do not quarantine a lane; they leave endpoint replication pending for a later retry. Both kinds of failure produce a structured `history_replication_failed` host
|
|
123
|
+
A permanent operation-domain rejection, such as conflicting immutable session metadata, quarantines only that session's replication lane. Its pending operations and diagnostic remain in local SQLite, later operations for that session stay blocked, and unrelated sessions continue replicating. Transient transport, authentication, rate-limit, and service failures do not quarantine a lane; they leave endpoint replication pending for a later retry. Both kinds of failure produce a structured `history_replication_failed` host diagnostic without exposing the API key. Headless Tau commands write that diagnostic to stderr, the TUI presents a concise nonfatal footer notice without writing through the active renderer, and an in-process SDK host delivers it only through `onDiagnostic` when configured.
|
|
124
124
|
|
|
125
125
|
Local entries retain their complete captured payloads. For remote replication, an entry larger than 1 MiB keeps its identity and metadata but middle-truncates oversized content, arguments, or results with an explicit marker. Remote history is therefore useful for retrieval, but the host's local entry can contain details that the shared copy intentionally omits.
|
|
126
126
|
|
|
@@ -2,16 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
A model definition tells Tau how to call a provider model and how to reason about its capabilities, limits, and cost. A persona selects one provider and model, while credentials authorize the resulting request. Keeping those layers separate makes it possible to update model metadata without rewriting persona behavior.
|
|
4
4
|
|
|
5
|
-
Tau ships a versioned catalog and lets the execution environment overlay it with `models.json`. The effective catalog for a session therefore depends on
|
|
5
|
+
Tau ships a versioned catalog, refreshes compatible model metadata from `pi.dev`, and lets the execution environment overlay it with `models.json`. The effective catalog for a session therefore depends on the installed Tau version, the host's cached remote catalog, and the session working directory.
|
|
6
6
|
|
|
7
7
|
## Providers, models, and personas
|
|
8
8
|
|
|
9
9
|
A **provider** owns authentication and one or more request APIs. A **model** is addressed by a provider ID and an exact model ID, such as `openai/gpt-5.6-sol`. A [persona](personas.md) binds that pair to a system prompt, settings, tools, skills, and subagents.
|
|
10
10
|
|
|
11
|
-
The bundled catalog comes from Tau's model runtime
|
|
11
|
+
The bundled catalog comes from Tau's model runtime. It supplies known provider IDs, bundled model IDs, request API names, endpoints, capability flags, token limits, and pricing. Bundled does not mean currently usable: a provider may still lack credentials, an account may not expose a model, or a configured endpoint may reject it. See [credentials](credentials.md).
|
|
12
12
|
|
|
13
13
|
Tau applies `models.json` overlays before resolving built-in or custom personas. A bundled persona therefore uses overridden metadata when its provider and model are patched.
|
|
14
14
|
|
|
15
|
+
## Remote catalog
|
|
16
|
+
|
|
17
|
+
A model-owning Tau host restores provider catalogs from `~/.config/tau/models-store.json` during startup, then checks `pi.dev` asynchronously when the cache is older than four hours. This is a startup freshness check, not a recurring timer. Set `TAU_OFFLINE` to skip the automatic network check.
|
|
18
|
+
|
|
19
|
+
Tau requests one catalog shard for every provider included in its installed `pi-ai` version. Each request has a 15-second timeout and is independent: successful shards are cached even when another provider fails, while failed providers retain their previous valid shard or fall back to bundled metadata. Run `tau models refresh` on the host to bypass the freshness window and force a best-effort refresh. The command exits nonzero if any provider fails after preserving successful updates.
|
|
20
|
+
|
|
21
|
+
Remote data replaces complete matching `pi-ai` model records and may add model IDs. Execution-environment `models.json` remains the highest-precedence layer. Tau identifies the installed `pi-ai` version to `pi.dev` so the service can select compatible records. Cached data older than the catalog bundled into `pi-ai` is ignored.
|
|
22
|
+
|
|
23
|
+
A session captures the available remote catalog when it is created. A background refresh does not change that session. Run `/reload` to adopt the latest host cache; ordinary persona switching keeps the session's captured catalog.
|
|
24
|
+
|
|
15
25
|
## Where `models.json` is loaded
|
|
16
26
|
|
|
17
27
|
Tau uses the same level discovery as runtime configuration:
|
|
@@ -42,6 +42,8 @@ type TauSdkClientOptions = {
|
|
|
42
42
|
persona?: string;
|
|
43
43
|
reasoning?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max";
|
|
44
44
|
noAgentContextFiles?: boolean;
|
|
45
|
+
refreshModelCatalog?: boolean;
|
|
46
|
+
onDiagnostic?: (diagnostic: TauSdkHostDiagnostic) => void;
|
|
45
47
|
connectTimeoutMs?: number;
|
|
46
48
|
initialize?: { client: { name: string; version: string } };
|
|
47
49
|
clientTools?: TauSdkClientTool[];
|
|
@@ -50,7 +52,11 @@ type TauSdkClientOptions = {
|
|
|
50
52
|
|
|
51
53
|
`persona`, `reasoning`, and `noAgentContextFiles` configure sessions created by this owned host. `connectTimeoutMs` defaults to 5,000 ms. Default initialization metadata is `{ client: { name: "tau-sdk", version: "1" } }`.
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
The in-process host does not write asynchronous diagnostics to stdout or stderr. Set `onDiagnostic` to receive structured host diagnostics such as retryable history replication failures and route them through the embedding application's logging or presentation owner.
|
|
56
|
+
|
|
57
|
+
By default, creating an in-process client starts one asynchronous model-catalog freshness check against `pi.dev`. The host restores `~/.config/tau/models-store.json` first, does not refresh on a recurring timer, and keeps each session on its captured catalog until `session.reload()`. Set `refreshModelCatalog: false` to disable this client's automatic check, or set `TAU_OFFLINE` to disable automatic checks process-wide. Both controls preserve an existing cache and do not prevent an explicit `tau models refresh`. See [models](models.md) for precedence and [security](security.md) for the trust boundary.
|
|
58
|
+
|
|
59
|
+
Closing this client shuts down its host after persisting live sessions. It also cancels and awaits a client-owned catalog refresh; a refresh shared with another in-process client continues until its final owner closes.
|
|
54
60
|
|
|
55
61
|
### Connect to `tau serve`
|
|
56
62
|
|
|
@@ -39,6 +39,10 @@ Project configuration cannot define a command client-tool executable. It can onl
|
|
|
39
39
|
|
|
40
40
|
Prompt templates are inserted into the editor for review rather than submitted automatically. Leading `<system>` blocks, persona prompts, model notices, and committed session messages are model-facing and may become durable session content. Do not place secrets in instructions, prompts, or model notices.
|
|
41
41
|
|
|
42
|
+
## Trust remote model metadata as routing configuration
|
|
43
|
+
|
|
44
|
+
A model-owning Tau host refreshes compatible provider catalogs from `pi.dev` and caches them in `~/.config/tau/models-store.json`. This is a trusted software-update channel, not informational discovery: a remote model record can replace its API adapter, endpoint, headers, compatibility behavior, limits, and pricing before execution-environment `models.json` overlays are applied. Compromise or misconfiguration of that service could redirect provider requests and credentials. Set `TAU_OFFLINE` to disable automatic catalog requests, and use a reviewed `models.json` overlay when a provider must stay on a fixed endpoint.
|
|
45
|
+
|
|
42
46
|
## Keep secrets with the process that needs them
|
|
43
47
|
|
|
44
48
|
Most model and service credentials belong to the host because the host performs model calls, web search, history replication, and host-tool Nook requests. TUI speech credentials and command client-tool credentials belong to the client. Telegram bot, transcription, and voice-response credentials belong to the Telegram runner. Hosted-environment bridge and API credentials belong to host startup.
|
|
@@ -174,6 +178,7 @@ Unknown configuration fields are stripped, so syntactically valid JSON can still
|
|
|
174
178
|
Tau's durable files are implementation-owned recovery state, not configuration surfaces. Do not directly edit or casually delete:
|
|
175
179
|
|
|
176
180
|
- `~/.config/tau/auth.json`;
|
|
181
|
+
- `~/.config/tau/models-store.json`;
|
|
177
182
|
- files under `~/.config/tau/sessions`;
|
|
178
183
|
- `~/.config/tau/history.sqlite` and its SQLite side files;
|
|
179
184
|
- Telegram runner session and project-preference state;
|
|
@@ -269,9 +269,9 @@ Telegram accepts photos and documents identified as images, PDF, `.txt`, `.md`,
|
|
|
269
269
|
|
|
270
270
|
Limits are:
|
|
271
271
|
|
|
272
|
-
- at most
|
|
272
|
+
- at most 32 attachments per turn
|
|
273
273
|
- at most 20 MiB per file
|
|
274
|
-
- at most
|
|
274
|
+
- at most 100 MiB total per turn
|
|
275
275
|
|
|
276
276
|
An attachment-only DM queues files for the next text or voice/audio turn; it does not run the agent by itself. Unsupported, oversized, or failed downloads are skipped with a warning. Treat every attachment as untrusted input even though its path is local.
|
|
277
277
|
|
|
@@ -195,7 +195,7 @@ The TUI also advertises diff review as a client tool unless `--no-client-tools`
|
|
|
195
195
|
|
|
196
196
|
`/listen` and Ctrl+Y are currently macOS-only. Recording uses local `ffmpeg` with the AVFoundation audio input and stops when Ctrl+Y is pressed again, when Escape is pressed, or after five minutes. Startup fails if the microphone produces no audio within 15 seconds. The transcript is inserted at the cursor for review and is not submitted automatically.
|
|
197
197
|
|
|
198
|
-
If transcription fails, Tau retains the local WAV and reports its path. Run `/listen retry` to transcribe the same audio again with the current provider and conversation context, or `/listen discard` to delete it. A replacement recording deletes the retained file only after the new capture starts producing audio. Tau keeps at most one failed recording, and exiting leaves that file at the reported path for manual recovery. Gemini transcription makes one request to Gemini 3.7 Flash. OpenAI transcription
|
|
198
|
+
If transcription fails, Tau retains the local WAV and reports its path. Run `/listen retry` to transcribe the same audio again with the current provider and conversation context, or `/listen discard` to delete it. A replacement recording deletes the retained file only after the new capture starts producing audio. Tau keeps at most one failed recording, and exiting leaves that file at the reported path for manual recovery. Gemini transcription makes one request to Gemini 3.7 Flash. OpenAI live transcription sends the recent context to GPT-5.6 Luna to extract spelling hints while recording begins, then streams the buffered and subsequent audio to `gpt-live-transcribe` with English and Finnish language hints; hint extraction failure does not fail transcription. OpenAI uploads a retained recording with its recent context to `gpt-transcribe` on retry.
|
|
199
199
|
|
|
200
200
|
Install `ffmpeg` and configure a speech-to-text provider:
|
|
201
201
|
|
|
@@ -205,7 +205,7 @@ brew install ffmpeg
|
|
|
205
205
|
|
|
206
206
|
OpenAI is the default and needs `OPENAI_API_KEY` or `apiKeys.openai`. Set `speechToText.provider` to `gemini` to use `GEMINI_API_KEY` or `apiKeys.google`, or to `mistral` to use `MISTRAL_API_KEY` or `apiKeys.mistral`. These settings and credentials are read by the TUI process, including during remote attachment.
|
|
207
207
|
|
|
208
|
-
`/speak` is also macOS-only. It rewrites the last assistant response for speech,
|
|
208
|
+
`/speak` is also macOS-only. It rewrites the last assistant response for speech, streams audio from Gemini, and plays it through the local `ffplay` command included with `ffmpeg`. It requires `GEMINI_API_KEY` or `apiKeys.google`, runs only while the session is idle, and can be stopped with Escape. Longer responses are divided into balanced segments targeting at most two minutes of generated speech each. Speech source and rewritten text are limited to 10,000 Unicode characters, and generation stops after 32 MiB of raw audio.
|
|
209
209
|
|
|
210
210
|
## Reload the right component
|
|
211
211
|
|
|
@@ -34,9 +34,9 @@ const TELEGRAM_TYPING_REFRESH_MS = 4000;
|
|
|
34
34
|
const ABORTED = Symbol("aborted");
|
|
35
35
|
const TIMED_OUT = Symbol("timed-out");
|
|
36
36
|
const CALLBACK_ACTION_PREFIX = "tau:action:";
|
|
37
|
-
const MAX_TELEGRAM_ATTACHMENTS_PER_TURN =
|
|
37
|
+
const MAX_TELEGRAM_ATTACHMENTS_PER_TURN = 32;
|
|
38
38
|
const MAX_TELEGRAM_ATTACHMENT_FILE_BYTES = 20 * 1024 * 1024;
|
|
39
|
-
const MAX_TELEGRAM_ATTACHMENT_TOTAL_BYTES =
|
|
39
|
+
const MAX_TELEGRAM_ATTACHMENT_TOTAL_BYTES = 100 * 1024 * 1024;
|
|
40
40
|
const MAX_TELEGRAM_VOICE_BYTES = 50 * 1024 * 1024;
|
|
41
41
|
const TELEGRAM_TTS_JOB_TIMEOUT_MS = 5 * 60_000;
|
|
42
42
|
const MAX_TELEGRAM_GROUP_PENDING_MESSAGES = 50;
|