@hyperwindmill/caretaker-cli 0.28.0 → 0.30.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.
Files changed (62) hide show
  1. package/dist/agents/dispatch.d.ts.map +1 -1
  2. package/dist/agents/dispatch.js +4 -1
  3. package/dist/cli/web/scheduler/telegram.d.ts +27 -0
  4. package/dist/cli/web/scheduler/telegram.d.ts.map +1 -1
  5. package/dist/cli/web/scheduler/telegram.js +133 -78
  6. package/dist/cli/web/scheduler/telegram_media.d.ts +73 -0
  7. package/dist/cli/web/scheduler/telegram_media.d.ts.map +1 -0
  8. package/dist/cli/web/scheduler/telegram_media.js +90 -0
  9. package/dist/cli/web/scheduler/telegram_window.d.ts +68 -0
  10. package/dist/cli/web/scheduler/telegram_window.d.ts.map +1 -0
  11. package/dist/cli/web/scheduler/telegram_window.js +144 -0
  12. package/dist/cli/web/server.d.ts.map +1 -1
  13. package/dist/cli/web/server.js +29 -7
  14. package/dist/cli/web/session_scope.d.ts +11 -0
  15. package/dist/cli/web/session_scope.d.ts.map +1 -0
  16. package/dist/cli/web/session_scope.js +13 -0
  17. package/dist/cli/web/turn_guard.d.ts +9 -0
  18. package/dist/cli/web/turn_guard.d.ts.map +1 -0
  19. package/dist/cli/web/turn_guard.js +18 -0
  20. package/dist/cli/web/voice_builtin.d.ts +3 -0
  21. package/dist/cli/web/voice_builtin.d.ts.map +1 -0
  22. package/dist/cli/web/voice_builtin.js +55 -0
  23. package/dist/cli/web/voice_proxy.d.ts +33 -1
  24. package/dist/cli/web/voice_proxy.d.ts.map +1 -1
  25. package/dist/cli/web/voice_proxy.js +173 -27
  26. package/dist/commands/loader.js +2 -2
  27. package/dist/harness/tools/builtin/index.d.ts.map +1 -1
  28. package/dist/harness/tools/builtin/index.js +4 -0
  29. package/dist/harness/tools/builtin/set_workspace.d.ts +3 -0
  30. package/dist/harness/tools/builtin/set_workspace.d.ts.map +1 -0
  31. package/dist/harness/tools/builtin/set_workspace.js +49 -0
  32. package/dist/plugins/manifest.d.ts +1 -1
  33. package/dist/plugins/manifest.js +1 -1
  34. package/dist/session/store.d.ts +6 -0
  35. package/dist/session/store.d.ts.map +1 -1
  36. package/dist/session/store.js +8 -0
  37. package/dist/session/types.d.ts +4 -0
  38. package/dist/session/types.d.ts.map +1 -1
  39. package/dist/voice/pocket/catalog.d.ts +24 -0
  40. package/dist/voice/pocket/catalog.d.ts.map +1 -0
  41. package/dist/voice/pocket/catalog.js +152 -0
  42. package/dist/voice/pocket/engine.d.ts +17 -0
  43. package/dist/voice/pocket/engine.d.ts.map +1 -0
  44. package/dist/voice/pocket/engine.js +145 -0
  45. package/dist/voice/pocket/inference.d.ts +36 -0
  46. package/dist/voice/pocket/inference.d.ts.map +1 -0
  47. package/dist/voice/pocket/inference.js +228 -0
  48. package/dist/voice/pocket/install.d.ts +54 -0
  49. package/dist/voice/pocket/install.d.ts.map +1 -0
  50. package/dist/voice/pocket/install.js +275 -0
  51. package/dist/voice/pocket/tokenizer.d.ts +42 -0
  52. package/dist/voice/pocket/tokenizer.d.ts.map +1 -0
  53. package/dist/voice/pocket/tokenizer.js +279 -0
  54. package/dist/voice/pocket/voices.d.ts +9 -0
  55. package/dist/voice/pocket/voices.d.ts.map +1 -0
  56. package/dist/voice/pocket/voices.js +88 -0
  57. package/dist/voice/pronunciation.d.ts +16 -0
  58. package/dist/voice/pronunciation.d.ts.map +1 -0
  59. package/dist/voice/pronunciation.js +51 -0
  60. package/dist/webview/standalone.js +1508 -701
  61. package/dist/webview/standalone.js.map +4 -4
  62. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
1
  import { loadConfig } from '../../store/json.js';
2
2
  import { decrypt, isEncrypted } from '../../lib/encryption.js';
3
+ import { applyPronunciation, dictionaryFor, synthesisLanguage } from '../../voice/pronunciation.js';
3
4
  export function voiceClientConfig(config) {
4
5
  const voice = config.voice;
5
6
  if (!voice)
@@ -7,10 +8,14 @@ export function voiceClientConfig(config) {
7
8
  const out = {
8
9
  enabled: voice.enabled === true,
9
10
  configured: typeof voice.endpoint === 'string' && voice.endpoint.trim().length > 0,
10
- canSpeak: typeof voice.ttsModel === 'string' && voice.ttsModel.trim().length > 0,
11
+ canSpeak: voice.ttsEngine === 'builtin'
12
+ ? typeof voice.ttsLanguage === 'string' && voice.ttsLanguage.length > 0
13
+ : typeof voice.ttsModel === 'string' && voice.ttsModel.trim().length > 0,
11
14
  };
12
15
  if (voice.lang)
13
16
  out.lang = voice.lang;
17
+ if (Number.isFinite(voice.playbackBufferMs))
18
+ out.playbackBufferMs = voice.playbackBufferMs;
14
19
  return out;
15
20
  }
16
21
  /** Resolve the usable voice config, or a reason it cannot be used. Shared with
@@ -96,41 +101,182 @@ export function registerVoiceProxy(app) {
96
101
  });
97
102
  });
98
103
  app.post('/api/voice/speak', async (c) => {
99
- const resolved = await resolveVoice();
104
+ const resolved = await resolveSynthesis();
100
105
  if ('error' in resolved)
101
106
  return c.text(resolved.error, 503);
102
- const { voice } = resolved;
103
- if (!voice.ttsModel)
104
- return c.text('No synthesis model configured.', 400);
105
- const { text } = await c.req.json();
106
- if (!text || text.trim().length === 0)
107
+ const body = await c.req.json().catch(() => ({}));
108
+ const text = body.text;
109
+ if (typeof text !== 'string' || text.trim().length === 0)
107
110
  return c.text('No text to speak.', 400);
108
- const payload = { model: voice.ttsModel, input: text };
109
- if (voice.ttsVoice)
110
- payload.voice = voice.ttsVoice;
111
- if (Number.isFinite(voice.ttsSpeed) && voice.ttsSpeed > 0) {
112
- payload.speed = voice.ttsSpeed;
111
+ if (text.length > MAX_SPEAK_CHARS)
112
+ return c.text('Text is too long to speak.', 400);
113
+ return synthesize(resolved.voice, text, c.req.raw.signal);
114
+ });
115
+ // Listen: synthesize with the form's unsaved settings. Credentials never
116
+ // come from the view; mergePreview keeps the saved ones (see its comment).
117
+ app.post('/api/voice/preview', async (c) => {
118
+ const resolved = await resolveSynthesis();
119
+ if ('error' in resolved)
120
+ return c.text(resolved.error, 503);
121
+ const body = await c.req.json().catch(() => null);
122
+ const parsed = parsePreviewBody(body);
123
+ if (typeof parsed === 'string')
124
+ return c.text(parsed, 400);
125
+ const voice = mergePreview(resolved.voice, parsed.settings);
126
+ return synthesize(voice, parsed.text, c.req.raw.signal);
127
+ });
128
+ }
129
+ const MAX_SPEAK_CHARS = 20_000;
130
+ const MAX_PREVIEW_CHARS = 2_000;
131
+ const MAX_DICTIONARY_ROWS = 500;
132
+ /** Validate the preview body; returns the parsed request or an error message. */
133
+ function parsePreviewBody(body) {
134
+ if (!body || typeof body !== 'object')
135
+ return 'Expected a JSON body.';
136
+ const { text, settings } = body;
137
+ if (typeof text !== 'string' || text.trim().length === 0)
138
+ return 'No text to speak.';
139
+ if (text.length > MAX_PREVIEW_CHARS)
140
+ return 'Text is too long for a preview.';
141
+ if (!settings || typeof settings !== 'object' || Array.isArray(settings)) {
142
+ return 'Expected a "settings" object.';
143
+ }
144
+ const s = settings;
145
+ const optString = (k) => s[k] === undefined || typeof s[k] === 'string';
146
+ for (const k of ['ttsLanguage', 'ttsVoice', 'ttsModel', 'ttsEndpoint']) {
147
+ if (!optString(k))
148
+ return `"${k}" must be a string.`;
149
+ }
150
+ if (s.ttsEngine !== undefined && s.ttsEngine !== 'endpoint' && s.ttsEngine !== 'builtin') {
151
+ return '"ttsEngine" must be "endpoint" or "builtin".';
152
+ }
153
+ if (s.ttsSpeed !== undefined && (typeof s.ttsSpeed !== 'number' || !Number.isFinite(s.ttsSpeed))) {
154
+ return '"ttsSpeed" must be a number.';
155
+ }
156
+ if (s.pronunciationEnabled !== undefined && typeof s.pronunciationEnabled !== 'boolean') {
157
+ return '"pronunciationEnabled" must be a boolean.';
158
+ }
159
+ if (s.pronunciation !== undefined) {
160
+ if (!Array.isArray(s.pronunciation) || s.pronunciation.length > MAX_DICTIONARY_ROWS) {
161
+ return '"pronunciation" must be a list of at most 500 entries.';
113
162
  }
114
- let upstream;
163
+ const ok = s.pronunciation.every((e) => e && typeof e.term === 'string' && typeof e.say === 'string');
164
+ if (!ok)
165
+ return 'Each pronunciation entry needs a string "term" and "say".';
166
+ }
167
+ return { text, settings: s };
168
+ }
169
+ /** The saved voice config if synthesis can run: voice enabled, and (for the
170
+ * endpoint engine) some endpoint to talk to. The built-in engine needs none. */
171
+ export async function resolveSynthesis() {
172
+ const voice = (await loadConfig()).voice;
173
+ if (!voice || voice.enabled !== true) {
174
+ return { error: 'Voice mode is disabled. Enable it in Settings → Voice.' };
175
+ }
176
+ if (voice.ttsEngine !== 'builtin' && !voice.endpoint?.trim() && !voice.ttsEndpoint?.trim()) {
177
+ return { error: 'No voice endpoint configured. Set one in Settings → Voice.' };
178
+ }
179
+ return { voice };
180
+ }
181
+ /** Same server: scheme, host and port. A different path or a trailing slash is
182
+ * not a different host, so it keeps the saved key. */
183
+ export function sameHost(a, b) {
184
+ const origin = (u) => {
185
+ const t = (u ?? '').trim();
115
186
  try {
116
- const target = ttsTarget(voice);
117
- upstream = await fetch(url(target.endpoint, '/audio/speech'), {
118
- method: 'POST',
119
- headers: { ...authHeaders(target.apiKey), 'content-type': 'application/json' },
120
- body: JSON.stringify(payload),
121
- });
187
+ return new URL(t).origin;
122
188
  }
123
- catch (err) {
124
- return c.text(`Could not reach the voice endpoint: ${err}`, 502);
189
+ catch {
190
+ return t.replace(/\/+$/, '');
125
191
  }
126
- if (!upstream.ok) {
127
- return c.body(await upstream.arrayBuffer(), upstream.status, {
128
- 'content-type': upstream.headers.get('content-type') ?? 'text/plain',
129
- });
192
+ };
193
+ return origin(a) === origin(b);
194
+ }
195
+ export const KEY_WITHHELD_HINT = 'The endpoint changed: enter the API key again, or save first, to use it with the new endpoint.';
196
+ /** The key to send to `endpoint` for a request built from the settings form. A key
197
+ * typed in the form is the user's own, for that endpoint. The stored key (the form
198
+ * round-trips its encrypted blob) goes only to the host it was saved for;
199
+ * otherwise it is withheld and the request goes without a key. */
200
+ export function formKeyFor(endpoint, formKey, saved) {
201
+ if (!formKey)
202
+ return { key: null, withheld: false };
203
+ if (!isEncrypted(formKey))
204
+ return { key: formKey, withheld: false };
205
+ const pairs = [
206
+ [saved?.apiKey, saved?.endpoint],
207
+ [saved?.ttsApiKey, saved?.ttsEndpoint],
208
+ ];
209
+ return pairs.some(([k, ep]) => k === formKey && sameHost(ep, endpoint))
210
+ ? { key: formKey, withheld: false }
211
+ : { key: null, withheld: true };
212
+ }
213
+ /** Overlay the form's unsaved synthesis settings on the saved config. The saved
214
+ * `ttsApiKey` is dropped when the previewed `ttsEndpoint` is on another host than
215
+ * the saved one, so editing the URL can never send the stored key to a new host. */
216
+ export function mergePreview(saved, s) {
217
+ const merged = {
218
+ ...saved,
219
+ ttsEngine: s.ttsEngine,
220
+ ttsLanguage: s.ttsLanguage,
221
+ ttsVoice: s.ttsVoice,
222
+ ttsModel: s.ttsModel,
223
+ ttsSpeed: s.ttsSpeed,
224
+ ttsEndpoint: s.ttsEndpoint,
225
+ pronunciationEnabled: s.pronunciationEnabled,
226
+ };
227
+ if (!sameHost(s.ttsEndpoint, saved.ttsEndpoint))
228
+ delete merged.ttsApiKey;
229
+ if (s.pronunciation) {
230
+ const code = synthesisLanguage(merged);
231
+ if (code)
232
+ merged.pronunciation = { ...saved.pronunciation, [code]: s.pronunciation };
233
+ }
234
+ return merged;
235
+ }
236
+ let builtinSpeaker = null;
237
+ /** The built-in engine registers itself here; null unregisters. */
238
+ export function setBuiltinSpeaker(fn) {
239
+ builtinSpeaker = fn;
240
+ }
241
+ /** Synthesize `text` with the configured engine, dictionary applied, streaming
242
+ * the audio back. Failures are Responses (status + readable body), not throws. */
243
+ export async function synthesize(voice, text, signal) {
244
+ const code = voice.pronunciationEnabled ? synthesisLanguage(voice) : null;
245
+ const input = code ? applyPronunciation(text, dictionaryFor(voice, code)) : text;
246
+ if (voice.ttsEngine === 'builtin') {
247
+ if (!builtinSpeaker) {
248
+ return new Response('The built-in voice engine is not available.', { status: 503 });
130
249
  }
131
- return c.body(await upstream.arrayBuffer(), 200, {
132
- 'content-type': upstream.headers.get('content-type') ?? 'audio/mpeg',
250
+ return builtinSpeaker(voice, input, signal);
251
+ }
252
+ if (!voice.ttsModel)
253
+ return new Response('No synthesis model configured.', { status: 400 });
254
+ const payload = { model: voice.ttsModel, input };
255
+ if (voice.ttsVoice)
256
+ payload.voice = voice.ttsVoice;
257
+ if (Number.isFinite(voice.ttsSpeed) && voice.ttsSpeed > 0) {
258
+ payload.speed = voice.ttsSpeed;
259
+ }
260
+ let upstream;
261
+ try {
262
+ const target = ttsTarget(voice);
263
+ upstream = await fetch(url(target.endpoint, '/audio/speech'), {
264
+ method: 'POST',
265
+ headers: { ...authHeaders(target.apiKey), 'content-type': 'application/json' },
266
+ body: JSON.stringify(payload),
267
+ signal,
133
268
  });
269
+ }
270
+ catch (err) {
271
+ return new Response(`Could not reach the voice endpoint: ${err}`, { status: 502 });
272
+ }
273
+ // Stream through; failures are propagated verbatim (a wrong model id must
274
+ // surface as the provider's own message).
275
+ return new Response(upstream.body, {
276
+ status: upstream.status,
277
+ headers: {
278
+ 'content-type': upstream.headers.get('content-type') ?? (upstream.ok ? 'audio/mpeg' : 'text/plain'),
279
+ },
134
280
  });
135
281
  }
136
282
  /**
@@ -3,8 +3,8 @@
3
3
  // — same model as skills. No separate store; the plugin record is the
4
4
  // source of truth.
5
5
  //
6
- // Names are scoped: a plugin named "contract-workflow" with
7
- // `commands/contract-writing.md` registers as `/contract-writing`. On a
6
+ // Names are scoped: a plugin named "release-tools" with
7
+ // `commands/changelog.md` registers as `/changelog`. On a
8
8
  // collision (two active plugins both define `/foo`), the first plugin
9
9
  // listed in `agent.plugins` wins; the duplicate is dropped silently and
10
10
  // the user can disambiguate by removing the conflicting plugin from the
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/harness/tools/builtin/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,C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,EAChB,cAAc,EACd,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AAEzB,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CA+D7D;AAED,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,cAAc,EACd,aAAa,EACb,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,uBAAuB,EACvB,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,cAAc,GACf,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/harness/tools/builtin/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,EAAE,QAAQ,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mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,eAAe,EACf,cAAc,EACd,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,cAAc,GACf,CAAC"}
@@ -18,6 +18,7 @@ import { listSkillsTool } from './list_skills.js';
18
18
  import { readSkillTool } from './read_skill.js';
19
19
  import { listAgentsTool } from './list_agents.js';
20
20
  import { invokeAgentTool } from './invoke_agent.js';
21
+ import { setWorkspaceTool } from './set_workspace.js';
21
22
  import { listCommandsTool } from './list_commands.js';
22
23
  import { invokeCommandTool } from './invoke_command.js';
23
24
  import { getAgentContextTool } from './get_agent_context.js';
@@ -49,6 +50,9 @@ export function registerBuiltins(registry) {
49
50
  // more than one agent configured — they're useless otherwise).
50
51
  registry.register(listAgentsTool);
51
52
  registry.register(invokeAgentTool);
53
+ // Session workspace switch (opt-in via allowedTools like any capability
54
+ // tool; session-bound, so not part of a served mcp__* namespace).
55
+ registry.register(setWorkspaceTool);
52
56
  // Slash commands as tools — same gating as skills (auto-included when
53
57
  // the agent has at least one plugin active).
54
58
  registry.register(listCommandsTool);
@@ -0,0 +1,3 @@
1
+ import type { Tool } from '../types.js';
2
+ export declare const setWorkspaceTool: Tool;
3
+ //# sourceMappingURL=set_workspace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set_workspace.d.ts","sourceRoot":"","sources":["../../../../src/harness/tools/builtin/set_workspace.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,IAAI,EAAc,MAAM,aAAa,CAAC;AAEpD,eAAO,MAAM,gBAAgB,EAAE,IAoC9B,CAAC"}
@@ -0,0 +1,49 @@
1
+ // Move the current chat session into one of the configured projects.
2
+ //
3
+ // Session-bound on purpose: it needs ctx.sessionId to persist the override,
4
+ // which is why it is a plain builtin and not part of a served mcp__* namespace
5
+ // (those are context-free). The switch mutates ctx.workingDir in place, so
6
+ // file/shell tools later in the same turn already resolve against the new
7
+ // directory; the prelude (AGENTS.md, project memories) is built once per run
8
+ // and picks the project up from the next turn, when the web server's chat
9
+ // controller reads the override back from the session meta.
10
+ // See docs/superpowers/specs/2026-11-07-desktop-assistant-design.md
11
+ import { stat } from 'node:fs/promises';
12
+ import { loadConfig } from '../../../store/json.js';
13
+ import { updateSessionWorkspace } from '../../../session/store.js';
14
+ import { projectWorkingDir } from '../../../lib/task_git.js';
15
+ export const setWorkspaceTool = {
16
+ name: 'set_workspace',
17
+ description: "Switch this chat session's working directory to one of the configured projects for the rest of the session. " +
18
+ 'Call mcp__task__project_list first to get the project_id.',
19
+ parameters: {
20
+ type: 'object',
21
+ properties: {
22
+ project_id: { type: 'string', description: 'Id of the project to switch to (from project_list).' },
23
+ },
24
+ required: ['project_id'],
25
+ },
26
+ dangerous: true,
27
+ execute: async (args, ctx) => {
28
+ const agentId = ctx.callerAgent?.id;
29
+ if (!ctx.sessionId || !agentId) {
30
+ return { content: 'Error: no chat session to switch — set_workspace only works inside a saved chat session.' };
31
+ }
32
+ const projectId = String(args.project_id ?? '');
33
+ const project = ((await loadConfig()).projects ?? []).find((p) => p.id === projectId);
34
+ if (!project) {
35
+ return { content: `Error: unknown project "${projectId}". Call mcp__task__project_list for the valid ids.` };
36
+ }
37
+ const dir = projectWorkingDir(project);
38
+ const isDir = dir ? await stat(dir).then((s) => s.isDirectory(), () => false) : false;
39
+ if (!isDir) {
40
+ return { content: `Error: project "${project.name}" has no directory on disk (${dir || 'no working dir configured'}).` };
41
+ }
42
+ ctx.workingDir = dir;
43
+ await updateSessionWorkspace({ agentId, id: ctx.sessionId }, { workingDir: dir, projectId: project.id });
44
+ return {
45
+ content: `Switched to project "${project.name}" (${dir}). File and shell tools already use it; ` +
46
+ 'project context files (AGENTS.md) and project memories apply from the next turn.',
47
+ };
48
+ },
49
+ };
@@ -3,7 +3,7 @@ import type { AgentSpec, CommandSpec, McpServerSpec, PluginManifestKind, SkillSp
3
3
  /**
4
4
  * Read `<pluginRoot>/.mcp.json` and return the declared MCP server specs.
5
5
  * Two shapes are observed in the wild and both are accepted:
6
- * - `{ "mcpServers": { name: { … } } }` (lh-youtrack, official spec)
6
+ * - `{ "mcpServers": { name: { … } } }` (official spec)
7
7
  * - `{ name: { … } }` (claude-plugins-official examples)
8
8
  *
9
9
  * Returns `undefined` when the file is absent, malformed, or contains zero
@@ -73,7 +73,7 @@ function parseMcpServersMap(raw) {
73
73
  /**
74
74
  * Read `<pluginRoot>/.mcp.json` and return the declared MCP server specs.
75
75
  * Two shapes are observed in the wild and both are accepted:
76
- * - `{ "mcpServers": { name: { … } } }` (lh-youtrack, official spec)
76
+ * - `{ "mcpServers": { name: { … } } }` (official spec)
77
77
  * - `{ name: { … } }` (claude-plugins-official examples)
78
78
  *
79
79
  * Returns `undefined` when the file is absent, malformed, or contains zero
@@ -46,6 +46,12 @@ export declare function updateTitle(meta: Pick<SessionMetaRecord, 'agentId' | 'i
46
46
  /** Persist the Claude Code session id by appending a fresh meta line
47
47
  * (readSession picks the latest meta; listForAgent keeps using the first). */
48
48
  export declare function updateClaudeSessionId(meta: Pick<SessionMetaRecord, 'agentId' | 'id'>, claudeSessionId: string): Promise<void>;
49
+ /** Persist a session-level workspace override (`set_workspace`). Appends a
50
+ * new session_meta record, latest wins — same pattern as claudeSessionId. */
51
+ export declare function updateSessionWorkspace(meta: Pick<SessionMetaRecord, 'agentId' | 'id'>, ws: {
52
+ workingDir: string;
53
+ projectId: string;
54
+ }): Promise<void>;
49
55
  export declare function updateAcpSessionId(meta: Pick<SessionMetaRecord, 'agentId' | 'id'>, acpSessionId: string): Promise<void>;
50
56
  export declare function deleteSession(agentId: string, sessionId: string): Promise<void>;
51
57
  export declare function userMessage(content: string, opts?: {
@@ -1 +1 @@
1
- {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/session/store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a,CAWf;AAID,eAAO,MAAM,YAAY;;;;CAA2C,CAAC"}
@@ -211,6 +211,14 @@ export async function updateClaudeSessionId(meta, claudeSessionId) {
211
211
  const path = sessionPath(meta.agentId, meta.id);
212
212
  await appendFile(path, serialize(record), { mode: 0o600 });
213
213
  }
214
+ /** Persist a session-level workspace override (`set_workspace`). Appends a
215
+ * new session_meta record, latest wins — same pattern as claudeSessionId. */
216
+ export async function updateSessionWorkspace(meta, ws) {
217
+ const current = await readSession(meta.agentId, meta.id);
218
+ const record = { ...current.meta, workingDir: ws.workingDir, projectId: ws.projectId };
219
+ const path = sessionPath(meta.agentId, meta.id);
220
+ await appendFile(path, serialize(record), { mode: 0o600 });
221
+ }
214
222
  export async function updateAcpSessionId(meta, acpSessionId) {
215
223
  const current = await readSession(meta.agentId, meta.id);
216
224
  const record = { ...current.meta, acpSessionId };
@@ -35,6 +35,10 @@ export interface SessionMetaRecord {
35
35
  taskId?: string;
36
36
  projectId?: string;
37
37
  taskRole?: 'developer' | 'planner' | 'reviewer';
38
+ /** Session-level working-dir override written by the `set_workspace` tool
39
+ * (together with `projectId`). Honoured per turn by the web server's chat
40
+ * controller; absent ⇒ the agent's own workingDir. */
41
+ workingDir?: string;
38
42
  }
39
43
  export type Role = 'user' | 'assistant' | 'tool';
40
44
  export interface ToolAttachmentRecord {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/session/types.ts"],"names":[],"mappings":"AAWA,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElE,MAAM,MAAM,c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AAC,EAAE,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;IAChD;;2DAEuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,IAAI,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAEjD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,CAAC,EAAE,CAAC,CAAC;IACL,IAAI,EAAE,SAAS,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IACX;;2DAEuD;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,WAAW,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACrC;mEAC+D;IAC/D,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,aAAa,CAAC;AAE9D,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B"}
@@ -0,0 +1,24 @@
1
+ export type PocketLanguage = 'english' | 'french' | 'german' | 'spanish' | 'portuguese' | 'italian' | 'dutch';
2
+ export declare const POCKET_BASE_URL = "https://huggingface.co/Alias-Alias/pocket-3-3-0-tts-onnx/resolve";
3
+ export declare const POCKET_REVISION = "71a4d6d11a76e26b98709fa163477c77d16bdbdb";
4
+ export type BundleFile = {
5
+ name: string;
6
+ sha256: string;
7
+ bytes: number;
8
+ };
9
+ export declare const POCKET_LANGUAGES: Readonly<Record<PocketLanguage, {
10
+ code: string;
11
+ dir: string;
12
+ nativeVoice: string;
13
+ files: readonly BundleFile[];
14
+ }>>;
15
+ export declare const POCKET_VOICES: readonly string[];
16
+ export declare const ORT_VERSION = "1.31.1";
17
+ export declare const ORT_TARBALLS: Readonly<Record<'node' | 'common', {
18
+ url: string;
19
+ integrity: string;
20
+ }>>;
21
+ export declare const POCKET_SAMPLE_RATE = 24000;
22
+ export type InferenceSource = 'npm-pocket-tts' | 'own-loop';
23
+ export declare const INFERENCE_SOURCE: InferenceSource;
24
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/voice/pocket/catalog.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,YAAY,GACZ,SAAS,GACT,OAAO,CAAC;AAEZ,eAAO,MAAM,eAAe,qEACwC,CAAC;AACrE,eAAO,MAAM,eAAe,6CAA6C,CAAC;AAE1E,MAAM,MAAM,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAMzE,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CACrC,MAAM,CACJ,cAAc,EACd;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CACjF,CA2GF,CAAC;AAGF,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAS1C,CAAC;AAEF,eAAO,MAAM,WAAW,WAAW,CAAC;AAIpC,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,GAAG,QAAQ,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAWhG,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG,UAAU,CAAC;AAC5D,eAAO,MAAM,gBAAgB,EAAE,eAA4B,CAAC"}
@@ -0,0 +1,152 @@
1
+ // Pinned catalog for the built-in Pocket TTS engine: model bundles (Hugging Face), the
2
+ // ONNX runtime (npm registry tarballs) and the choice of who drives the graphs.
3
+ //
4
+ // INFERENCE_SOURCE = 'own-loop'. The npm `pocket-tts` package (1.0.0, MIT) was read, not
5
+ // run, and fails all three conditions. (1) It targets a different export, the community
6
+ // `KevinAHM/pocket-tts-onnx` repo (tokenizer.model, bos_before_voice.npy, a mimi encoder),
7
+ // not the schema-3 bundles of `Alias-Alias/pocket-3-3-0-tts-onnx` (explicit state_N /
8
+ // next_state_N tensors, tokenizer.json, voices.bin). (2) Local mode requires a reference
9
+ // WAV and encodes it (cloning); it never reads voices.bin or built-in voices. (3) It loads
10
+ // the runtime with a bare `import("onnxruntime-node")` (local/runtime.js) and exposes no
11
+ // way to pass a session factory or module, so it could not see our downloaded runtime.
12
+ // We therefore drive the four graphs ourselves; see the engine, which sits behind the
13
+ // small interface of the spec so the source can still be swapped.
14
+ export const POCKET_BASE_URL = 'https://huggingface.co/Alias-Alias/pocket-3-3-0-tts-onnx/resolve';
15
+ export const POCKET_REVISION = '71a4d6d11a76e26b98709fa163477c77d16bdbdb';
16
+ // `dir` is the bundle's subdirectory in the repo (also its language code). `nativeVoice`
17
+ // is the voice suggested first in the UI. The bundles ship no per-language native voices:
18
+ // every language carries the same eight official voices (each with a language-specific
19
+ // state in its own voices.bin), so the default is one shared voice.
20
+ export const POCKET_LANGUAGES = {
21
+ english: {
22
+ code: 'en',
23
+ dir: 'en',
24
+ nativeVoice: 'alba',
25
+ files: [
26
+ { name: 'bundle.json', sha256: 'ccbb828d6dceee19688ee6eee884bb8de16edcc0f21fac5ed713a8739d978b2e', bytes: 13438 },
27
+ { name: 'tokenizer.json', sha256: 'f498428e1eafee50492f7be13dc9bfafcfc12e508cd0eb1b01c92ecd5d8c6687', bytes: 245020 },
28
+ { name: 'voices.bin', sha256: '720343118b8ec5177397d3898d43b0d13c7948f76794956610e5f0e795100cf1', bytes: 52404520 },
29
+ { name: 'text_conditioner_int8.onnx', sha256: 'a060f0926e87a12309c54a681dde9daba8e32821e1e2348224fd6c30a3a7a28b', bytes: 16388338 },
30
+ { name: 'flow_lm_main_int8.onnx', sha256: 'c9328891492caaa7580284d81d47d01679f570f297023d68fc4c7ce503113dc8', bytes: 76397201 },
31
+ { name: 'flow_lm_flow_int8.onnx', sha256: '7edfcbccb1d40a84b2b59ac1e921963287471ff0cb266603d7fd4282a131d716', bytes: 10040048 },
32
+ { name: 'mimi_decoder_int8.onnx', sha256: 'b27d1c38b96947a08bc54a7b660b553866a47b3b368b2170b89b09f5c7f35b56', bytes: 22638621 },
33
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
34
+ ],
35
+ },
36
+ french: {
37
+ code: 'fr',
38
+ dir: 'fr',
39
+ nativeVoice: 'alba',
40
+ files: [
41
+ { name: 'bundle.json', sha256: '0894c2fc533b0a94d1f120fa9f959f4125ccff2443ac5362925989a5fcdd7fae', bytes: 13638 },
42
+ { name: 'tokenizer.json', sha256: '6211acffe9cb95172f71f0051f18e26ea305b2b32ea00b331ee976551c70887f', bytes: 246403 },
43
+ { name: 'voices.bin', sha256: 'a43532290caa733c6670bc52427f0ed9f709c43867049f3e511f85568fcf9c5c', bytes: 52404520 },
44
+ { name: 'text_conditioner_int8.onnx', sha256: '6127b51df140da0123123aa929a9453fc9a63a7cfebdc33f8a1f3fb46c5f2139', bytes: 16388338 },
45
+ { name: 'flow_lm_main_int8.onnx', sha256: '1c6611cc3d524843e990e3abfdc15ce84f16f7a9250b5970b0255df4759fe70b', bytes: 76397201 },
46
+ { name: 'flow_lm_flow_int8.onnx', sha256: '8c72996bdcae9ea4a981b6afc0a40986523525aaa5491c09ef9546c14becd272', bytes: 10040048 },
47
+ { name: 'mimi_decoder_int8.onnx', sha256: 'd7b00abae02b2916f0be6d42bfbe14e87e0b4f1aaa25b1d5778a1f128edb6bb6', bytes: 22638621 },
48
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
49
+ ],
50
+ },
51
+ german: {
52
+ code: 'de',
53
+ dir: 'de',
54
+ nativeVoice: 'alba',
55
+ files: [
56
+ { name: 'bundle.json', sha256: '7e43fa70568f3a1800a7dfeab6b3f97e2b5f1ff682c11db9cf22103d53f5fea5', bytes: 13623 },
57
+ { name: 'tokenizer.json', sha256: '2d77849811e3d1b6ae80e5b11b203f57e1847901104d8a0573b34f46f8dddb53', bytes: 245966 },
58
+ { name: 'voices.bin', sha256: 'a45485ca28c8f046f6e45089d7b01ea45e9a2d36f1ac4cb0947a956b27f4a70d', bytes: 52404520 },
59
+ { name: 'text_conditioner_int8.onnx', sha256: '0479f6bc635fedf130086c357d013a6a0c54568b301d9b255ffd67d732965378', bytes: 16388338 },
60
+ { name: 'flow_lm_main_int8.onnx', sha256: '96cb9a628438ca4b26d7ed3160d79bd8ad2e0f097d08a8faea95e00c944ea84e', bytes: 76397201 },
61
+ { name: 'flow_lm_flow_int8.onnx', sha256: '6198087a456287420d14b98083cd534bee3e92fa107dca1324f03a27c65c8315', bytes: 10040048 },
62
+ { name: 'mimi_decoder_int8.onnx', sha256: '3d0f9574384d73c91404514b933e239333d9580bc42c8fcc161e5402ff67d6b9', bytes: 22638621 },
63
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
64
+ ],
65
+ },
66
+ spanish: {
67
+ code: 'es',
68
+ dir: 'es',
69
+ nativeVoice: 'alba',
70
+ files: [
71
+ { name: 'bundle.json', sha256: '196151a61b907afb2b0ccb4570a4c39993de69d705b371d38ae459120f6aac23', bytes: 13654 },
72
+ { name: 'tokenizer.json', sha256: '9ade09bbdc64ab2b59952b90773fa0890b780ece4fd5aef0d36a00c6ad5f0531', bytes: 246610 },
73
+ { name: 'voices.bin', sha256: '49a8e4d3562074a1e8d041edb4fad3877b327daf4cd898893ff10273216ae178', bytes: 52404520 },
74
+ { name: 'text_conditioner_int8.onnx', sha256: '8e98c0abd4ba06fde1db0decb75e3b211e6097ba15854fc9266aa1d16feaeae4', bytes: 16388338 },
75
+ { name: 'flow_lm_main_int8.onnx', sha256: 'f37c8b4a2409de010f638529daf947b863396a78b8b659a77ed6e35362174629', bytes: 76397201 },
76
+ { name: 'flow_lm_flow_int8.onnx', sha256: 'b3f028c3cdd909ffa10dffa8055edc9147f273e43bda852733e6a4a36cc3d292', bytes: 10040048 },
77
+ { name: 'mimi_decoder_int8.onnx', sha256: 'f2f1b6e380a6388557768534d24036cb8b549b9f4eb49bedbb7ed3c4fb06336a', bytes: 22638621 },
78
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
79
+ ],
80
+ },
81
+ portuguese: {
82
+ code: 'pt',
83
+ dir: 'pt',
84
+ nativeVoice: 'alba',
85
+ files: [
86
+ { name: 'bundle.json', sha256: '4b23a635bd375e5d476416cc960ad7488aabd4441aea2861eaf54d98734ea34b', bytes: 13624 },
87
+ { name: 'tokenizer.json', sha256: 'b33e269f7f042a763080d71ba087d74d2f6759674b238a723c028e436b1a25ab', bytes: 247014 },
88
+ { name: 'voices.bin', sha256: '402d569dcb5d25c5b93cae6995d6d4d499cf1bfc591ed8edf2ce50547a8b3651', bytes: 52404520 },
89
+ { name: 'text_conditioner_int8.onnx', sha256: '22ee9182a3dadc37ba06cdf3ff9c0e0ac0622f006a2eb29d2f5e0a13ba642d3e', bytes: 16388338 },
90
+ { name: 'flow_lm_main_int8.onnx', sha256: '15357eb39cbd574bc4193fef960d6b332a861c84bfcf99e9417316bac129d1d8', bytes: 76397201 },
91
+ { name: 'flow_lm_flow_int8.onnx', sha256: 'f2e2a3da0fb5c1e6b472f1921459f7e6c051fa54c25e08186b46d559d620b379', bytes: 10040048 },
92
+ { name: 'mimi_decoder_int8.onnx', sha256: '6974a4330bbbfe91fcc46084b26e769c8eefd6121bd3ad42e84861f9f05854b2', bytes: 22638621 },
93
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
94
+ ],
95
+ },
96
+ italian: {
97
+ code: 'it',
98
+ dir: 'it',
99
+ nativeVoice: 'alba',
100
+ files: [
101
+ { name: 'bundle.json', sha256: '5dce446b175a8b9fd8766bde7ce3ee15fb396f2228b77777028c26eb88acfc4f', bytes: 13624 },
102
+ { name: 'tokenizer.json', sha256: '4bc1c0d4d54f9480183e94c94cfabf74fd89b0912537d4ef607d1982c4a381ec', bytes: 246586 },
103
+ { name: 'voices.bin', sha256: 'cf8f292f5d91d887f8370ebbd4329928421a87f564d475f53a7d456bf144acac', bytes: 52404520 },
104
+ { name: 'text_conditioner_int8.onnx', sha256: 'f716f278fa279495889fbe8f4426da68d4ca5112b962121991ec8fed002ff090', bytes: 16388338 },
105
+ { name: 'flow_lm_main_int8.onnx', sha256: '80c1ebae13a0033f7746f2b7a886e3d7fa3523c9d7be2122bec9412ad82c46b8', bytes: 76397201 },
106
+ { name: 'flow_lm_flow_int8.onnx', sha256: 'b4da5f938b81d895eee0a8c6267162c6466382b761114affb96049db9e649431', bytes: 10040048 },
107
+ { name: 'mimi_decoder_int8.onnx', sha256: 'c258c72d1b8079eb16a08fc9c6a255e918d897f53f784abcb5eaae2f3a0e9344', bytes: 22638621 },
108
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
109
+ ],
110
+ },
111
+ dutch: {
112
+ code: 'nl',
113
+ dir: 'nl',
114
+ nativeVoice: 'alba',
115
+ files: [
116
+ { name: 'bundle.json', sha256: '48581badbfe176db6df37ac0f784893fe2c681ae1e845263c4cd36106d8c1705', bytes: 13624 },
117
+ { name: 'tokenizer.json', sha256: 'e6f610b98c427641b4ab0e1024dca7843e3d6b620871a14b204932e42c5a1736', bytes: 245206 },
118
+ { name: 'voices.bin', sha256: '1e7f812d5824a931fef68337291896bd88521c9f031d545877e7f46b144ed38c', bytes: 52404520 },
119
+ { name: 'text_conditioner_int8.onnx', sha256: '3bd2960e2ea136a8f870149f4238789f6dbcc54c1b643a4639b7be028e52fbb2', bytes: 16388338 },
120
+ { name: 'flow_lm_main_int8.onnx', sha256: 'b6ae39189f6881ec0d87fa50ac690db239c6759c110e179714752b8b5d36e75c', bytes: 76397201 },
121
+ { name: 'flow_lm_flow_int8.onnx', sha256: 'd0b3e7da6ef29c0c0a2e6f721b9c3b3835b93c3f3f2854f5882e11222f7450ea', bytes: 10040048 },
122
+ { name: 'mimi_decoder_int8.onnx', sha256: '2cf5feebf7ba7486491c87a49036b0afae3093546aff3f5a46ec5e967b6c3ca5', bytes: 22638621 },
123
+ { name: 'LICENSE-upstream.txt', sha256: '23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3', bytes: 1023 },
124
+ ],
125
+ },
126
+ };
127
+ // Built-in voice names stored in every bundle's voices.bin (bundle.json `predefined_voices`).
128
+ export const POCKET_VOICES = [
129
+ 'alba',
130
+ 'azelma',
131
+ 'cosette',
132
+ 'eponine',
133
+ 'fantine',
134
+ 'javert',
135
+ 'jean',
136
+ 'marius',
137
+ ];
138
+ export const ORT_VERSION = '1.31.1';
139
+ // The node package bundles the native binding for every platform (~115 MB compressed);
140
+ // `postinstall` only fetches optional CUDA binaries and is never run.
141
+ export const ORT_TARBALLS = {
142
+ node: {
143
+ url: 'https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.31.1.tgz',
144
+ integrity: 'sha512-ijnSghbDHVWaQ2nDPmVccPlCHI8kH1Mx1aJ4a/qzRP16bBcVs4E3EqZQKZCkhWnbqN1tuQWxagimFtDpbPYYQw==',
145
+ },
146
+ common: {
147
+ url: 'https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.31.1.tgz',
148
+ integrity: 'sha512-F+nnYNiQtmNJ95V6R/isBJqiVpdANCrsMEg1OaF+Bkbl3GAtzWLR7Ng17Ld0QtYtYJyotOHPJzOQn1Y6PLZjpg==',
149
+ },
150
+ };
151
+ export const POCKET_SAMPLE_RATE = 24000;
152
+ export const INFERENCE_SOURCE = 'own-loop';
@@ -0,0 +1,17 @@
1
+ import type { BuiltinSpeaker } from '../../cli/web/voice_proxy.js';
2
+ import { type PocketLanguage } from './catalog.js';
3
+ import { type OrtModule, type PocketModel } from './inference.js';
4
+ export type { PocketModel } from './inference.js';
5
+ export type ModelLoader = (lang: PocketLanguage) => Promise<PocketModel>;
6
+ export declare const PCM_CONTENT_TYPE = "audio/pcm;rate=24000;channels=1";
7
+ /** True once the native runtime is loaded into this process (its files are then in use). */
8
+ export declare const runtimeLoaded: () => boolean;
9
+ /** onnxruntime-node from the downloaded runtime. Throws a readable error when it is
10
+ * missing or cannot load on this system (the reason is kept for `runtimeLoadError`). */
11
+ export declare function loadOnnxRuntime(): OrtModule;
12
+ /** Why the installed runtime cannot load, probing it once if never tried. */
13
+ export declare function runtimeLoadError(): string | undefined;
14
+ export declare function setModelLoaderForTest(l: ModelLoader | null): void;
15
+ export declare function releasePocketModels(): Promise<void>;
16
+ export declare const speakBuiltin: BuiltinSpeaker;
17
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../src/voice/pocket/engine.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAuD,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AACxG,OAAO,EAAqB,KAAK,SAAS,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGrF,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAEzE,eAAO,MAAM,gBAAgB,oCAAoD,CAAC;AAKlF,4FAA4F;AAC5F,eAAO,MAAM,aAAa,eAAqB,CAAC;AAEhD;yFACyF;AACzF,wBAAgB,eAAe,IAAI,SAAS,CAY3C;AAED,6EAA6E;AAC7E,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,SAAS,CASrD;AASD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAEjE;AA4BD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAIzD;AAaD,eAAO,MAAM,YAAY,EAAE,cAsD1B,CAAC"}