@celljs/ta-host 4.16.0 → 4.17.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 (75) hide show
  1. package/esm/node/app-commands.d.ts +111 -0
  2. package/esm/node/app-commands.js +629 -0
  3. package/esm/node/delegate-extension.d.ts +11 -0
  4. package/esm/node/delegate-extension.js +33 -0
  5. package/esm/node/directory-relocator.d.ts +49 -0
  6. package/esm/node/directory-relocator.js +267 -0
  7. package/esm/node/extension-providers.d.ts +16 -1
  8. package/esm/node/extension-providers.js +23 -3
  9. package/esm/node/index.d.ts +6 -0
  10. package/esm/node/index.js +6 -0
  11. package/esm/node/keep-awake.d.ts +5 -1
  12. package/esm/node/keep-awake.js +18 -2
  13. package/esm/node/message-page.d.ts +6 -1
  14. package/esm/node/message-page.js +50 -2
  15. package/esm/node/package-hosts.d.ts +6 -0
  16. package/esm/node/package-hosts.js +35 -0
  17. package/esm/node/package-webhooks.d.ts +26 -0
  18. package/esm/node/package-webhooks.js +101 -0
  19. package/esm/node/page-book.d.ts +48 -0
  20. package/esm/node/page-book.js +117 -0
  21. package/esm/node/relay-bridge.d.ts +2 -0
  22. package/esm/node/relay-bridge.js +35 -1
  23. package/esm/node/rooms-bridge.d.ts +3 -0
  24. package/esm/node/rooms-bridge.js +4 -0
  25. package/esm/node/session-info-util.d.ts +3 -1
  26. package/esm/node/session-info-util.js +32 -6
  27. package/esm/node/ta-server-impl.d.ts +5 -1
  28. package/esm/node/ta-server-impl.js +22 -0
  29. package/esm/node/ta-session-factory.d.ts +13 -1
  30. package/esm/node/ta-session-factory.js +39 -4
  31. package/esm/node/ta-session.d.ts +2 -0
  32. package/esm/node/ta-session.js +1 -0
  33. package/esm/node/team/team-calls.js +22 -0
  34. package/esm/node/voice-bridge.d.ts +68 -0
  35. package/esm/node/voice-bridge.js +273 -0
  36. package/esm/node/voices-file.d.ts +33 -0
  37. package/esm/node/voices-file.js +89 -0
  38. package/lib/node/app-commands.d.ts +112 -0
  39. package/lib/node/app-commands.js +633 -0
  40. package/lib/node/delegate-extension.d.ts +12 -0
  41. package/lib/node/delegate-extension.js +37 -0
  42. package/lib/node/directory-relocator.d.ts +50 -0
  43. package/lib/node/directory-relocator.js +270 -0
  44. package/lib/node/extension-providers.d.ts +16 -1
  45. package/lib/node/extension-providers.js +23 -3
  46. package/lib/node/index.d.ts +6 -0
  47. package/lib/node/index.js +6 -0
  48. package/lib/node/keep-awake.d.ts +5 -1
  49. package/lib/node/keep-awake.js +18 -2
  50. package/lib/node/message-page.d.ts +6 -1
  51. package/lib/node/message-page.js +50 -2
  52. package/lib/node/package-hosts.d.ts +6 -0
  53. package/lib/node/package-hosts.js +35 -0
  54. package/lib/node/package-webhooks.d.ts +27 -0
  55. package/lib/node/package-webhooks.js +104 -0
  56. package/lib/node/page-book.d.ts +49 -0
  57. package/lib/node/page-book.js +120 -0
  58. package/lib/node/relay-bridge.d.ts +2 -0
  59. package/lib/node/relay-bridge.js +34 -0
  60. package/lib/node/rooms-bridge.d.ts +3 -0
  61. package/lib/node/rooms-bridge.js +4 -0
  62. package/lib/node/session-info-util.d.ts +3 -1
  63. package/lib/node/session-info-util.js +31 -5
  64. package/lib/node/ta-server-impl.d.ts +5 -1
  65. package/lib/node/ta-server-impl.js +22 -0
  66. package/lib/node/ta-session-factory.d.ts +13 -1
  67. package/lib/node/ta-session-factory.js +38 -3
  68. package/lib/node/ta-session.d.ts +2 -0
  69. package/lib/node/ta-session.js +1 -0
  70. package/lib/node/team/team-calls.js +22 -0
  71. package/lib/node/voice-bridge.d.ts +69 -0
  72. package/lib/node/voice-bridge.js +274 -0
  73. package/lib/node/voices-file.d.ts +34 -0
  74. package/lib/node/voices-file.js +93 -0
  75. package/package.json +10 -10
@@ -0,0 +1,274 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var VoiceBridge_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.TaVoiceServerImpl = exports.VoiceBridge = exports.VOICE_BRIDGE = void 0;
14
+ const ai_coding_agent_1 = require("@celljs/ai-coding-agent");
15
+ const core_1 = require("@celljs/core");
16
+ const rpc_1 = require("@celljs/rpc");
17
+ const node_1 = require("@celljs/rpc/lib/node");
18
+ const ta_brand_1 = require("@celljs/ta-harness/lib/node/ta-brand");
19
+ const ta_protocol_1 = require("@celljs/ta-protocol");
20
+ const ta_errors_1 = require("./ta-errors");
21
+ const voices_file_1 = require("./voices-file");
22
+ exports.VOICE_BRIDGE = Symbol('VoiceBridge');
23
+ /** The voices a connection may have open at once: a call each, of a page or two. */
24
+ const MAX_PER_CONNECTION = 2;
25
+ /** The longest a reading may be, in characters: a reply read out is cut there. */
26
+ const MAX_SAY = 4000;
27
+ /** The most audio a page may send at once (base64 of about 2 s at 24 kHz). */
28
+ const MAX_AUDIO = 160 * 1024;
29
+ /**
30
+ * The voice services of calls (docs/design/ta-voice.md): the types packages register, voices.json, and the voices
31
+ * pages open, each of its connection and closed with it. A page never gets a key: its audio comes here.
32
+ */
33
+ let VoiceBridge = VoiceBridge_1 = class VoiceBridge {
34
+ constructor() {
35
+ this.types = new Map();
36
+ this.open = new Map();
37
+ this.nextId = 0;
38
+ /** For the server side of packages (TaExtensionHost.voices). */
39
+ this.extensionVoices = {
40
+ registerType: (type, definition) => {
41
+ this.types.set(type, definition);
42
+ return () => {
43
+ if (this.types.get(type) === definition) {
44
+ this.types.delete(type);
45
+ }
46
+ };
47
+ },
48
+ };
49
+ }
50
+ get file() {
51
+ var _a;
52
+ var _b, _c;
53
+ (_b = this.filed) !== null && _b !== void 0 ? _b : (this.filed = new voices_file_1.VoicesFile((_c = (_a = this.codingAgentOptions) === null || _a === void 0 ? void 0 : _a.agentDir) !== null && _c !== void 0 ? _c : ta_brand_1.TaBrand.agentDir()));
54
+ return this.filed;
55
+ }
56
+ list() {
57
+ var _a;
58
+ const { config } = this.file.safeRead();
59
+ const services = ((_a = config.services) !== null && _a !== void 0 ? _a : []).map(service => {
60
+ const name = service.name ? { name: service.name } : {};
61
+ const definition = this.types.get(service.type);
62
+ if (!definition) {
63
+ return { id: service.id, type: service.type, unavailable: true, ...name };
64
+ }
65
+ // What the page sees of it: never a password or a key.
66
+ const secret = new Set(definition.options.filter(option => option.secret).map(option => option.key));
67
+ const options = Object.fromEntries(Object.entries(service.options).filter(([key]) => !secret.has(key)));
68
+ return { id: service.id, type: service.type, where: VoiceBridge_1.where(definition, service.options), options, ...name };
69
+ });
70
+ const types = [...this.types].map(([type, { title, hint, icon, options, speaks }]) => ({
71
+ type,
72
+ title,
73
+ ...(hint ? { hint } : {}),
74
+ ...(icon ? { icon } : {}),
75
+ options,
76
+ speaks,
77
+ }));
78
+ const use = config.use && services.some(service => service.id === config.use) ? { use: config.use } : {};
79
+ return { services, types, file: this.file.file, ...use };
80
+ }
81
+ /** Opens a service of the type once before it is kept, so that a wrong key is said now. */
82
+ async add(type, options, name) {
83
+ const filled = await this.tried(type, options);
84
+ const id = this.file.add(type, filled, (name === null || name === void 0 ? void 0 : name.trim()) || undefined);
85
+ if (!this.file.safeRead().config.use) {
86
+ this.file.use(id);
87
+ }
88
+ return id;
89
+ }
90
+ /** Its fields as the form gave them, a secret left empty kept as it was; tried before it is written. */
91
+ async update(id, options, name) {
92
+ var _a;
93
+ var _b, _c;
94
+ const service = this.file.services().find(each => each.id === id);
95
+ if (!service) {
96
+ throw ta_errors_1.TaErrors.invalidArgument(`There is no voice service ${id}.`, 'Read the services again with listVoices.');
97
+ }
98
+ const secrets = new Set(((_b = (_a = this.types.get(service.type)) === null || _a === void 0 ? void 0 : _a.options) !== null && _b !== void 0 ? _b : []).filter(option => option.secret).map(option => option.key));
99
+ const given = { ...(options !== null && options !== void 0 ? options : {}) };
100
+ for (const key of secrets) {
101
+ if (!String((_c = given[key]) !== null && _c !== void 0 ? _c : '').trim() && service.options[key] !== undefined) {
102
+ given[key] = service.options[key];
103
+ }
104
+ }
105
+ const filled = await this.tried(service.type, given);
106
+ this.file.update(id, filled, (name === null || name === void 0 ? void 0 : name.trim()) || undefined);
107
+ }
108
+ /** The fields of a form of the type, needed ones checked, then opened once and closed: what is kept. */
109
+ async tried(type, options) {
110
+ const definition = this.types.get(type);
111
+ if (!definition) {
112
+ throw ta_errors_1.TaErrors.invalidArgument(`There is no voice service of type ${type}.`, 'Turn on the package that adds it.');
113
+ }
114
+ const filled = {};
115
+ for (const option of definition.options) {
116
+ const value = typeof (options === null || options === void 0 ? void 0 : options[option.key]) === 'string' ? String(options[option.key]).trim() : '';
117
+ if (!value && !option.optional) {
118
+ throw ta_errors_1.TaErrors.invalidArgument(`${option.key} is needed.`, 'Fill in every field that is not optional.');
119
+ }
120
+ if (value) {
121
+ filled[option.key] = value;
122
+ }
123
+ }
124
+ const engine = await definition.open(filled, { language: 'zh-CN' }, VoiceBridge_1.SILENT);
125
+ engine.close();
126
+ return filled;
127
+ }
128
+ remove(id) {
129
+ this.file.remove(id);
130
+ }
131
+ choose(id) {
132
+ this.file.use(id !== null && id !== void 0 ? id : undefined);
133
+ }
134
+ async openFor(connection, language) {
135
+ var _a;
136
+ const service = this.file.inUse();
137
+ if (!service) {
138
+ throw ta_errors_1.TaErrors.invalidArgument('No voice service is chosen for calls.', 'Choose one in Settings → Voice, or call with the voice of the device.');
139
+ }
140
+ const definition = this.types.get(service.type);
141
+ if (!definition) {
142
+ throw ta_errors_1.TaErrors.invalidArgument(`The voice service ${(_a = service.name) !== null && _a !== void 0 ? _a : service.id} is of type ${service.type}.`, 'Turn on the package that adds it.');
143
+ }
144
+ if ([...this.open.values()].filter(voice => voice.connection === connection).length >= MAX_PER_CONNECTION) {
145
+ throw ta_errors_1.TaErrors.invalidArgument('This page has calls open already.', 'Hang up a call first.');
146
+ }
147
+ const id = `v${++this.nextId}`;
148
+ const tell = (event) => {
149
+ if (!connection.closed) {
150
+ connection
151
+ .client(ta_protocol_1.TaClient)
152
+ .onVoiceEvent(event)
153
+ .catch(() => undefined);
154
+ }
155
+ };
156
+ const engine = await definition.open(service.options, { language: String(language || 'zh-CN') }, {
157
+ speech: () => tell({ voiceId: id, type: 'speech' }),
158
+ text: (text, final) => tell({ voiceId: id, type: 'text', text, final }),
159
+ audio: (pcm, say) => tell({ voiceId: id, type: 'audio', say, data: Buffer.from(pcm).toString('base64') }),
160
+ said: say => tell({ voiceId: id, type: 'said', say }),
161
+ closed: error => {
162
+ const voice = this.open.get(id);
163
+ if (voice && !voice.closed) {
164
+ voice.closed = true;
165
+ this.open.delete(id);
166
+ tell({ voiceId: id, type: 'closed', ...(error ? { error } : {}) });
167
+ }
168
+ },
169
+ });
170
+ const voice = { id, connection, engine, speaks: definition.speaks && !!engine.say, nextSay: 0, closed: false };
171
+ this.open.set(id, voice);
172
+ connection.onClose(() => this.close(connection, id));
173
+ return { voiceId: id, inputRate: engine.inputRate, outputRate: engine.outputRate, speaks: voice.speaks };
174
+ }
175
+ send(connection, id, audio) {
176
+ if (typeof audio !== 'string' || audio.length > MAX_AUDIO) {
177
+ throw ta_errors_1.TaErrors.invalidArgument('The audio is too long.', 'Send it in pieces of about 100 ms.');
178
+ }
179
+ this.require(connection, id).engine.send(Buffer.from(audio, 'base64'));
180
+ }
181
+ say(connection, id, text) {
182
+ const voice = this.require(connection, id);
183
+ if (!voice.speaks || !voice.engine.say) {
184
+ throw ta_errors_1.TaErrors.invalidArgument('This voice service does not read text.', 'Read with the voice of the device.');
185
+ }
186
+ const say = ++voice.nextSay;
187
+ voice.engine.say(String(text !== null && text !== void 0 ? text : '').slice(0, MAX_SAY), say);
188
+ return say;
189
+ }
190
+ hush(connection, id) {
191
+ this.require(connection, id).engine.hush();
192
+ }
193
+ close(connection, id) {
194
+ const voice = this.open.get(id);
195
+ if (!voice || voice.connection !== connection || voice.closed) {
196
+ return;
197
+ }
198
+ voice.closed = true;
199
+ this.open.delete(id);
200
+ try {
201
+ voice.engine.close();
202
+ }
203
+ catch (_a) {
204
+ // Closed already.
205
+ }
206
+ }
207
+ require(connection, id) {
208
+ const voice = this.open.get(id);
209
+ if (!voice || voice.connection !== connection) {
210
+ throw ta_errors_1.TaErrors.invalidArgument(`There is no voice ${id} open.`, 'Open it again with openVoice.');
211
+ }
212
+ return voice;
213
+ }
214
+ static where(definition, options) {
215
+ try {
216
+ return definition.where(options);
217
+ }
218
+ catch (_a) {
219
+ return '';
220
+ }
221
+ }
222
+ };
223
+ exports.VoiceBridge = VoiceBridge;
224
+ /** What trying a service hears: nothing is told. */
225
+ VoiceBridge.SILENT = { speech() { }, text() { }, audio() { }, said() { }, closed() { } };
226
+ __decorate([
227
+ (0, core_1.Value)(ai_coding_agent_1.CODING_AGENT_OPTIONS),
228
+ __metadata("design:type", Object)
229
+ ], VoiceBridge.prototype, "codingAgentOptions", void 0);
230
+ exports.VoiceBridge = VoiceBridge = VoiceBridge_1 = __decorate([
231
+ (0, core_1.Component)(exports.VOICE_BRIDGE)
232
+ ], VoiceBridge);
233
+ /** The voices for pages (TaVoiceServer), each of the connection that opened it. */
234
+ let TaVoiceServerImpl = class TaVoiceServerImpl {
235
+ listVoices() {
236
+ return ta_errors_1.TaErrors.guard(() => this.bridge.list());
237
+ }
238
+ addVoice(type, options, name) {
239
+ return ta_errors_1.TaErrors.guard(() => this.bridge.add(type, options !== null && options !== void 0 ? options : {}, name !== null && name !== void 0 ? name : undefined));
240
+ }
241
+ updateVoice(id, options, name) {
242
+ return ta_errors_1.TaErrors.guard(() => this.bridge.update(id, options !== null && options !== void 0 ? options : {}, name !== null && name !== void 0 ? name : undefined));
243
+ }
244
+ removeVoice(id) {
245
+ return ta_errors_1.TaErrors.guard(() => this.bridge.remove(id));
246
+ }
247
+ chooseVoice(id) {
248
+ return ta_errors_1.TaErrors.guard(() => this.bridge.choose(id !== null && id !== void 0 ? id : null));
249
+ }
250
+ openVoice(options) {
251
+ return ta_errors_1.TaErrors.guard(() => this.bridge.openFor(node_1.RpcContext.requireConnection(), options === null || options === void 0 ? void 0 : options.language));
252
+ }
253
+ sendVoice(voiceId, audio) {
254
+ return ta_errors_1.TaErrors.guard(() => this.bridge.send(node_1.RpcContext.requireConnection(), voiceId, audio));
255
+ }
256
+ sayVoice(voiceId, text) {
257
+ return ta_errors_1.TaErrors.guard(() => this.bridge.say(node_1.RpcContext.requireConnection(), voiceId, text));
258
+ }
259
+ hushVoice(voiceId) {
260
+ return ta_errors_1.TaErrors.guard(() => this.bridge.hush(node_1.RpcContext.requireConnection(), voiceId));
261
+ }
262
+ closeVoice(voiceId) {
263
+ return ta_errors_1.TaErrors.guard(() => this.bridge.close(node_1.RpcContext.requireConnection(), voiceId));
264
+ }
265
+ };
266
+ exports.TaVoiceServerImpl = TaVoiceServerImpl;
267
+ __decorate([
268
+ (0, core_1.Autowired)(exports.VOICE_BRIDGE),
269
+ __metadata("design:type", VoiceBridge)
270
+ ], TaVoiceServerImpl.prototype, "bridge", void 0);
271
+ exports.TaVoiceServerImpl = TaVoiceServerImpl = __decorate([
272
+ (0, rpc_1.Rpc)(ta_protocol_1.TaVoiceServer)
273
+ ], TaVoiceServerImpl);
274
+ //# sourceMappingURL=voice-bridge.js.map
@@ -0,0 +1,34 @@
1
+ /** A service of voices.json: a type a package registered, and the options of its form. */
2
+ export interface VoiceServiceEntry {
3
+ id: string;
4
+ type: string;
5
+ name?: string;
6
+ options: Record<string, unknown>;
7
+ }
8
+ export interface VoicesConfig {
9
+ services?: VoiceServiceEntry[];
10
+ /** The service calls use; none: the voice of the device. */
11
+ use?: string;
12
+ }
13
+ /** voices.json of the agent directory (docs/design/ta-voice.md 3): its keys stay there, written 0600. */
14
+ export declare class VoicesFile {
15
+ readonly file: string;
16
+ constructor(agentDir: string);
17
+ read(): VoicesConfig;
18
+ /** What reads, or nothing with why it does not parse. */
19
+ safeRead(): {
20
+ config: VoicesConfig;
21
+ error?: string;
22
+ };
23
+ services(): VoiceServiceEntry[];
24
+ /** The service in use, if it is still there. */
25
+ inUse(): VoiceServiceEntry | undefined;
26
+ /** Its id: the type with a number when there is one of it already. */
27
+ add(type: string, options: Record<string, unknown>, name?: string): string;
28
+ /** Its options and name, the rest as it was; throws for one that is not there. */
29
+ update(id: string, options: Record<string, unknown>, name?: string): void;
30
+ remove(id: string): void;
31
+ use(id: string | undefined): void;
32
+ protected write(config: VoicesConfig): void;
33
+ }
34
+ //# sourceMappingURL=voices-file.d.ts.map
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VoicesFile = void 0;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_path_1 = require("node:path");
6
+ /** voices.json of the agent directory (docs/design/ta-voice.md 3): its keys stay there, written 0600. */
7
+ class VoicesFile {
8
+ constructor(agentDir) {
9
+ this.file = (0, node_path_1.join)(agentDir, 'voices.json');
10
+ }
11
+ read() {
12
+ let text;
13
+ try {
14
+ text = (0, node_fs_1.readFileSync)(this.file, 'utf8');
15
+ }
16
+ catch (_a) {
17
+ return {};
18
+ }
19
+ const config = JSON.parse(text);
20
+ const services = Array.isArray(config === null || config === void 0 ? void 0 : config.services)
21
+ ? config.services.filter(service => service && typeof service.id === 'string' && typeof service.type === 'string' && typeof service.options === 'object')
22
+ : [];
23
+ return { services, ...(typeof (config === null || config === void 0 ? void 0 : config.use) === 'string' ? { use: config.use } : {}) };
24
+ }
25
+ /** What reads, or nothing with why it does not parse. */
26
+ safeRead() {
27
+ try {
28
+ return { config: this.read() };
29
+ }
30
+ catch (error) {
31
+ return { config: {}, error: error instanceof Error ? error.message : String(error) };
32
+ }
33
+ }
34
+ services() {
35
+ var _a;
36
+ return (_a = this.safeRead().config.services) !== null && _a !== void 0 ? _a : [];
37
+ }
38
+ /** The service in use, if it is still there. */
39
+ inUse() {
40
+ const { services = [], use } = this.safeRead().config;
41
+ return use ? services.find(service => service.id === use) : undefined;
42
+ }
43
+ /** Its id: the type with a number when there is one of it already. */
44
+ add(type, options, name) {
45
+ var _a;
46
+ const config = this.read();
47
+ const services = (_a = config.services) !== null && _a !== void 0 ? _a : [];
48
+ const stem = type.replace(/[^a-z0-9-]/gi, '').toLowerCase() || 'voice';
49
+ let id = stem;
50
+ for (let n = 2; services.some(service => service.id === id); n++) {
51
+ id = `${stem}-${n}`;
52
+ }
53
+ services.push({ id, type, ...(name ? { name } : {}), options });
54
+ this.write({ ...config, services });
55
+ return id;
56
+ }
57
+ /** Its options and name, the rest as it was; throws for one that is not there. */
58
+ update(id, options, name) {
59
+ var _a;
60
+ const config = this.read();
61
+ const services = (_a = config.services) !== null && _a !== void 0 ? _a : [];
62
+ const at = services.findIndex(service => service.id === id);
63
+ if (at < 0) {
64
+ throw new Error(`There is no voice service ${id} in voices.json.`);
65
+ }
66
+ const { name: _, ...kept } = services[at];
67
+ services[at] = { ...kept, ...(name ? { name } : {}), options };
68
+ this.write({ ...config, services });
69
+ }
70
+ remove(id) {
71
+ var _a;
72
+ const config = this.read();
73
+ const services = ((_a = config.services) !== null && _a !== void 0 ? _a : []).filter(service => service.id !== id);
74
+ this.write({ services, ...(config.use && config.use !== id ? { use: config.use } : {}) });
75
+ }
76
+ use(id) {
77
+ var _a, _b;
78
+ const config = this.read();
79
+ if (id !== undefined && !((_a = config.services) !== null && _a !== void 0 ? _a : []).some(service => service.id === id)) {
80
+ throw new Error(`There is no voice service ${id} in voices.json.`);
81
+ }
82
+ this.write({ services: (_b = config.services) !== null && _b !== void 0 ? _b : [], ...(id ? { use: id } : {}) });
83
+ }
84
+ write(config) {
85
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(this.file), { recursive: true });
86
+ const temporary = `${this.file}.${process.pid}.tmp`;
87
+ (0, node_fs_1.writeFileSync)(temporary, `${JSON.stringify(config, null, 2)}\n`, { mode: 0o600 });
88
+ (0, node_fs_1.chmodSync)(temporary, 0o600);
89
+ (0, node_fs_1.renameSync)(temporary, this.file);
90
+ }
91
+ }
92
+ exports.VoicesFile = VoicesFile;
93
+ //# sourceMappingURL=voices-file.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-host",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
4
4
  "description": "ta serve: pi sessions for many clients over WebSocket",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -34,15 +34,15 @@
34
34
  "watch": "tsc -b -w --preserveWatchOutput"
35
35
  },
36
36
  "dependencies": {
37
- "@celljs/ai-agent": "4.16.0",
38
- "@celljs/ai-coding-agent": "4.16.0",
39
- "@celljs/core": "4.16.0",
40
- "@celljs/rpc": "4.16.0",
41
- "@celljs/ta-exec": "4.16.0",
42
- "@celljs/ta-harness": "4.16.0",
43
- "@celljs/ta-protocol": "4.16.0",
44
- "@celljs/ta-relay": "4.16.0",
45
- "@celljs/web": "4.16.0",
37
+ "@celljs/ai-agent": "4.17.0",
38
+ "@celljs/ai-coding-agent": "4.17.0",
39
+ "@celljs/core": "4.17.0",
40
+ "@celljs/rpc": "4.17.0",
41
+ "@celljs/ta-exec": "4.17.0",
42
+ "@celljs/ta-harness": "4.17.0",
43
+ "@celljs/ta-protocol": "4.17.0",
44
+ "@celljs/ta-relay": "4.17.0",
45
+ "@celljs/web": "4.17.0",
46
46
  "@earendil-works/pi-coding-agent": "^1.5.2"
47
47
  },
48
48
  "devDependencies": {