@tonk/cli 0.2.5 → 0.2.7
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/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +8 -6
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/hello.d.ts.map +1 -1
- package/dist/commands/hello.js +12 -0
- package/dist/commands/hello.js.map +1 -1
- package/dist/commands/kill.d.ts.map +1 -1
- package/dist/commands/kill.js +24 -0
- package/dist/commands/kill.js.map +1 -1
- package/dist/commands/ls.d.ts.map +1 -1
- package/dist/commands/ls.js +18 -0
- package/dist/commands/ls.js.map +1 -1
- package/dist/commands/proxy.d.ts.map +1 -1
- package/dist/commands/proxy.js +18 -0
- package/dist/commands/proxy.js.map +1 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +18 -0
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +25 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +19 -0
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/worker/commands.d.ts +42 -0
- package/dist/commands/worker/commands.d.ts.map +1 -0
- package/dist/commands/worker/commands.js +906 -0
- package/dist/commands/worker/commands.js.map +1 -0
- package/dist/commands/worker/index.d.ts +7 -0
- package/dist/commands/worker/index.d.ts.map +1 -0
- package/dist/commands/worker/index.js +30 -0
- package/dist/commands/worker/index.js.map +1 -0
- package/dist/commands/worker/utils/config.d.ts +26 -0
- package/dist/commands/worker/utils/config.d.ts.map +1 -0
- package/dist/commands/worker/utils/config.js +197 -0
- package/dist/commands/worker/utils/config.js.map +1 -0
- package/dist/commands/worker/utils/display.d.ts +6 -0
- package/dist/commands/worker/utils/display.d.ts.map +1 -0
- package/dist/commands/worker/utils/display.js +32 -0
- package/dist/commands/worker/utils/display.js.map +1 -0
- package/dist/commands/worker/utils/finder.d.ts +12 -0
- package/dist/commands/worker/utils/finder.d.ts.map +1 -0
- package/dist/commands/worker/utils/finder.js +60 -0
- package/dist/commands/worker/utils/finder.js.map +1 -0
- package/dist/commands/worker.d.ts +3 -0
- package/dist/commands/worker.d.ts.map +1 -0
- package/dist/commands/worker.js +527 -0
- package/dist/commands/worker.js.map +1 -0
- package/dist/lib/workerManager.d.ts +60 -0
- package/dist/lib/workerManager.d.ts.map +1 -0
- package/dist/lib/workerManager.js +406 -0
- package/dist/lib/workerManager.js.map +1 -0
- package/dist/tonk.js +10 -0
- package/dist/tonk.js.map +1 -1
- package/dist/types/worker.d.ts +102 -0
- package/dist/types/worker.d.ts.map +1 -0
- package/dist/types/worker.js +7 -0
- package/dist/types/worker.js.map +1 -0
- package/dist/types/workerConfig.d.ts +164 -0
- package/dist/types/workerConfig.d.ts.map +1 -0
- package/dist/types/workerConfig.js +80 -0
- package/dist/types/workerConfig.js.map +1 -0
- package/dist/utils/analytics.d.ts +26 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +155 -0
- package/dist/utils/analytics.js.map +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import envPaths from 'env-paths';
|
|
4
|
+
import http from 'node:http';
|
|
5
|
+
import https from 'node:https';
|
|
6
|
+
import { exec } from 'node:child_process';
|
|
7
|
+
import { promisify } from 'node:util';
|
|
8
|
+
/**
|
|
9
|
+
* Implementation of the WorkerManager interface
|
|
10
|
+
*/
|
|
11
|
+
export class TonkWorkerManager {
|
|
12
|
+
workersPath;
|
|
13
|
+
constructor() {
|
|
14
|
+
// Create paths for Tonk daemon home
|
|
15
|
+
const paths = envPaths('tonk', { suffix: '' });
|
|
16
|
+
const tonkHome = paths.data;
|
|
17
|
+
this.workersPath = path.join(tonkHome, 'workers');
|
|
18
|
+
// Ensure workers directory exists
|
|
19
|
+
if (!fs.existsSync(this.workersPath)) {
|
|
20
|
+
fs.mkdirSync(this.workersPath, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Register a new worker
|
|
25
|
+
*/
|
|
26
|
+
async register(options) {
|
|
27
|
+
// Generate a unique ID for the worker
|
|
28
|
+
const workerId = this.generateWorkerId(options.name);
|
|
29
|
+
// Parse environment variables
|
|
30
|
+
const env = {};
|
|
31
|
+
if (options.env && Array.isArray(options.env)) {
|
|
32
|
+
options.env.forEach((envVar) => {
|
|
33
|
+
const [key, value] = envVar.split('=');
|
|
34
|
+
if (key && value) {
|
|
35
|
+
env[key] = value;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
let workerConfig = {
|
|
40
|
+
...(options.config && typeof options.config === 'object'
|
|
41
|
+
? options.config
|
|
42
|
+
: {}),
|
|
43
|
+
type: options.type || 'custom',
|
|
44
|
+
};
|
|
45
|
+
// Create worker object
|
|
46
|
+
const worker = {
|
|
47
|
+
id: workerId,
|
|
48
|
+
name: options.name,
|
|
49
|
+
description: options.description || '',
|
|
50
|
+
endpoint: options.endpoint,
|
|
51
|
+
protocol: options.protocol || 'http',
|
|
52
|
+
status: {
|
|
53
|
+
active: false,
|
|
54
|
+
lastSeen: null,
|
|
55
|
+
},
|
|
56
|
+
env,
|
|
57
|
+
config: workerConfig,
|
|
58
|
+
createdAt: Date.now(),
|
|
59
|
+
updatedAt: Date.now(),
|
|
60
|
+
};
|
|
61
|
+
// Save worker to file
|
|
62
|
+
const workerFilePath = path.join(this.workersPath, `${workerId}.json`);
|
|
63
|
+
fs.writeFileSync(workerFilePath, JSON.stringify(worker, null, 2));
|
|
64
|
+
return worker;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Register a worker from a YAML configuration file
|
|
68
|
+
*/
|
|
69
|
+
async registerFromYamlConfig(yamlConfig) {
|
|
70
|
+
// Generate a unique ID for the worker
|
|
71
|
+
const workerId = this.generateWorkerId(yamlConfig.name);
|
|
72
|
+
// Create worker object from YAML config
|
|
73
|
+
const worker = {
|
|
74
|
+
id: workerId,
|
|
75
|
+
name: yamlConfig.name,
|
|
76
|
+
description: yamlConfig.description || '',
|
|
77
|
+
endpoint: yamlConfig.endpoint,
|
|
78
|
+
protocol: yamlConfig.protocol || 'http',
|
|
79
|
+
status: {
|
|
80
|
+
active: false,
|
|
81
|
+
lastSeen: null,
|
|
82
|
+
},
|
|
83
|
+
env: yamlConfig.process?.env || {},
|
|
84
|
+
config: {
|
|
85
|
+
type: yamlConfig.type || 'custom',
|
|
86
|
+
version: yamlConfig.version,
|
|
87
|
+
healthCheck: yamlConfig.healthCheck,
|
|
88
|
+
process: yamlConfig.process,
|
|
89
|
+
...yamlConfig.config,
|
|
90
|
+
},
|
|
91
|
+
createdAt: Date.now(),
|
|
92
|
+
updatedAt: Date.now(),
|
|
93
|
+
};
|
|
94
|
+
// Save worker to file
|
|
95
|
+
const workerFilePath = path.join(this.workersPath, `${workerId}.json`);
|
|
96
|
+
fs.writeFileSync(workerFilePath, JSON.stringify(worker, null, 2));
|
|
97
|
+
return worker;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get a worker by ID
|
|
101
|
+
*/
|
|
102
|
+
async get(id) {
|
|
103
|
+
const workerFilePath = path.join(this.workersPath, `${id}.json`);
|
|
104
|
+
if (!fs.existsSync(workerFilePath)) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
const fileContent = fs.readFileSync(workerFilePath, 'utf-8');
|
|
108
|
+
return JSON.parse(fileContent);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Find a worker by name or ID
|
|
112
|
+
* If the identifier matches an ID exactly, returns that worker
|
|
113
|
+
* Otherwise, searches for a worker with a matching name
|
|
114
|
+
*/
|
|
115
|
+
async findByNameOrId(identifier) {
|
|
116
|
+
// First try to get by ID (exact match)
|
|
117
|
+
const workerById = await this.get(identifier);
|
|
118
|
+
if (workerById) {
|
|
119
|
+
return workerById;
|
|
120
|
+
}
|
|
121
|
+
// If not found by ID, try to find by name
|
|
122
|
+
const workers = await this.list();
|
|
123
|
+
const matchingWorker = workers.find(worker => worker.name.toLowerCase() === identifier.toLowerCase());
|
|
124
|
+
return matchingWorker || null;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* List all registered workers
|
|
128
|
+
*/
|
|
129
|
+
async list() {
|
|
130
|
+
const workerFiles = fs
|
|
131
|
+
.readdirSync(this.workersPath)
|
|
132
|
+
.filter(file => file.endsWith('.json'));
|
|
133
|
+
if (workerFiles.length === 0) {
|
|
134
|
+
return [];
|
|
135
|
+
}
|
|
136
|
+
return workerFiles.map(file => {
|
|
137
|
+
const filePath = path.join(this.workersPath, file);
|
|
138
|
+
const fileContent = fs.readFileSync(filePath, 'utf-8');
|
|
139
|
+
return JSON.parse(fileContent);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Update a worker
|
|
144
|
+
*/
|
|
145
|
+
async update(id, updates) {
|
|
146
|
+
const worker = await this.get(id);
|
|
147
|
+
if (!worker) {
|
|
148
|
+
throw new Error(`Worker with ID '${id}' not found.`);
|
|
149
|
+
}
|
|
150
|
+
// Update worker properties
|
|
151
|
+
const updatedWorker = {
|
|
152
|
+
...worker,
|
|
153
|
+
...updates,
|
|
154
|
+
updatedAt: Date.now(),
|
|
155
|
+
};
|
|
156
|
+
// Save updated worker
|
|
157
|
+
const workerFilePath = path.join(this.workersPath, `${id}.json`);
|
|
158
|
+
fs.writeFileSync(workerFilePath, JSON.stringify(updatedWorker, null, 2));
|
|
159
|
+
return updatedWorker;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Remove a worker
|
|
163
|
+
*/
|
|
164
|
+
async remove(id) {
|
|
165
|
+
const workerFilePath = path.join(this.workersPath, `${id}.json`);
|
|
166
|
+
if (!fs.existsSync(workerFilePath)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
// Get worker details before removing
|
|
170
|
+
const worker = await this.get(id);
|
|
171
|
+
if (!worker) {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
// Try to stop and delete from PM2 if it's running
|
|
175
|
+
const execAsync = promisify(exec);
|
|
176
|
+
try {
|
|
177
|
+
// Check if worker is running in PM2
|
|
178
|
+
const { stdout } = await execAsync('pm2 list');
|
|
179
|
+
if (stdout.includes(`${worker.id}`)) {
|
|
180
|
+
// Stop the worker with PM2 first
|
|
181
|
+
await execAsync(`pm2 stop ${worker.id}`);
|
|
182
|
+
// Then delete it from PM2
|
|
183
|
+
await execAsync(`pm2 delete ${worker.id}`);
|
|
184
|
+
console.log(`Worker '${worker.name}' stopped and removed from PM2.`);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.error(`Error stopping worker in PM2:`, error);
|
|
189
|
+
// Continue with removal even if PM2 operations fail
|
|
190
|
+
}
|
|
191
|
+
// Remove worker file
|
|
192
|
+
fs.unlinkSync(workerFilePath);
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Start a worker
|
|
197
|
+
* @param id Worker ID to start
|
|
198
|
+
*/
|
|
199
|
+
async start(id) {
|
|
200
|
+
const worker = await this.get(id);
|
|
201
|
+
if (!worker) {
|
|
202
|
+
throw new Error(`Worker with ID '${id}' not found.`);
|
|
203
|
+
}
|
|
204
|
+
const execAsync = promisify(exec);
|
|
205
|
+
try {
|
|
206
|
+
// Check if worker is already running in PM2
|
|
207
|
+
const { stdout } = await execAsync('pm2 list');
|
|
208
|
+
if (stdout.includes(`${worker.id}`)) {
|
|
209
|
+
console.log(`Worker '${worker.name}' is already running. Restarting...`);
|
|
210
|
+
await execAsync(`pm2 restart ${worker.id}`);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
// Prepare environment variables
|
|
214
|
+
const envVars = Object.entries(worker.env)
|
|
215
|
+
.map(([key, value]) => `${key}=${value}`)
|
|
216
|
+
.join(' ');
|
|
217
|
+
// Ensure log directory exists
|
|
218
|
+
const logDir = envPaths('tonk', { suffix: '' }).log;
|
|
219
|
+
if (!fs.existsSync(logDir)) {
|
|
220
|
+
fs.mkdirSync(logDir, { recursive: true });
|
|
221
|
+
}
|
|
222
|
+
// Add log configuration
|
|
223
|
+
const logConfig = `--log ${path.join(logDir, `${worker.id}.log`)}`;
|
|
224
|
+
const errorLogConfig = `--error ${path.join(logDir, `${worker.id}-error.log`)}`;
|
|
225
|
+
// Handle different worker types
|
|
226
|
+
if (worker.config.type === 'npm') {
|
|
227
|
+
// For npm-based workers, we directly use the package name as the command
|
|
228
|
+
const packageName = worker.name;
|
|
229
|
+
// Strip scope from package name for display purposes (e.g., @tonk/worker -> worker)
|
|
230
|
+
const commandName = packageName.replace(/^@[^/]+\//, '');
|
|
231
|
+
try {
|
|
232
|
+
// Start the npm package with PM2 using the package name as the command
|
|
233
|
+
// and 'start' as the argument
|
|
234
|
+
const startCmd = `${envVars} pm2 start "${commandName} start" --name ${worker.id} ${logConfig} ${errorLogConfig}`;
|
|
235
|
+
await execAsync(startCmd);
|
|
236
|
+
console.log(`Started npm worker '${packageName}' with command: ${commandName} start`);
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
console.error(`Error starting npm worker:`, error);
|
|
240
|
+
throw error;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
// For traditional workers with process configuration
|
|
245
|
+
if (!worker.config.process || !worker.config.process.file) {
|
|
246
|
+
throw new Error(`Worker '${worker.name}' does not have a valid process configuration.`);
|
|
247
|
+
}
|
|
248
|
+
// Start the worker with PM2
|
|
249
|
+
const cwd = worker.config.process.cwd || '.';
|
|
250
|
+
const instances = worker.config.process.instances || 1;
|
|
251
|
+
const watch = worker.config.process.watch ? '--watch' : '';
|
|
252
|
+
const maxMemory = worker.config.process.max_memory_restart
|
|
253
|
+
? `--max-memory-restart ${worker.config.process.max_memory_restart}`
|
|
254
|
+
: '';
|
|
255
|
+
// Prepare the command to start the worker
|
|
256
|
+
let startCmd = '';
|
|
257
|
+
// Ensure we have a valid file path
|
|
258
|
+
if (!worker.config.process.file ||
|
|
259
|
+
worker.config.process.file.trim() === '') {
|
|
260
|
+
throw new Error(`Worker '${worker.name}' has an empty file path.`);
|
|
261
|
+
}
|
|
262
|
+
const filePath = worker.config.process.file;
|
|
263
|
+
const args = worker.config.process.args || '';
|
|
264
|
+
// Check if the file path is relative or absolute
|
|
265
|
+
const absoluteFilePath = path.join(cwd, filePath);
|
|
266
|
+
// Make the file executable if it exists
|
|
267
|
+
if (fs.existsSync(absoluteFilePath)) {
|
|
268
|
+
// First make the file executable, then start it with PM2
|
|
269
|
+
startCmd = `cd ${cwd} && chmod +x "${filePath}" && ${envVars} pm2 start "./${filePath} ${args ? args : ''}" --name ${worker.id} --instances ${instances} ${watch} ${maxMemory} ${logConfig} ${errorLogConfig}`;
|
|
270
|
+
}
|
|
271
|
+
await execAsync(startCmd);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// Update worker status
|
|
275
|
+
await this.update(id, {
|
|
276
|
+
status: {
|
|
277
|
+
active: true,
|
|
278
|
+
lastSeen: Date.now(),
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
return true;
|
|
282
|
+
}
|
|
283
|
+
catch (error) {
|
|
284
|
+
console.error(`Error starting worker '${worker.name}':`, error);
|
|
285
|
+
// Log detailed error information
|
|
286
|
+
if (error instanceof Error) {
|
|
287
|
+
console.error(`Error message: ${error.message}`);
|
|
288
|
+
console.error(`Stack trace: ${error.stack}`);
|
|
289
|
+
}
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Stop a worker
|
|
295
|
+
*/
|
|
296
|
+
async stop(id) {
|
|
297
|
+
const worker = await this.get(id);
|
|
298
|
+
if (!worker) {
|
|
299
|
+
throw new Error(`Worker with ID '${id}' not found.`);
|
|
300
|
+
}
|
|
301
|
+
const execAsync = promisify(exec);
|
|
302
|
+
try {
|
|
303
|
+
console.log(`Stopping worker '${worker.name}'...`);
|
|
304
|
+
// Check if worker is running in PM2
|
|
305
|
+
const { stdout } = await execAsync('pm2 list');
|
|
306
|
+
if (stdout.includes(`${worker.id}`)) {
|
|
307
|
+
// Stop the worker with PM2
|
|
308
|
+
await execAsync(`pm2 stop ${worker.id}`);
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
console.log(`Worker '${worker.name}' is not running.`);
|
|
312
|
+
}
|
|
313
|
+
// Update worker status
|
|
314
|
+
await this.update(id, {
|
|
315
|
+
status: {
|
|
316
|
+
active: false,
|
|
317
|
+
lastSeen: worker.status.lastSeen,
|
|
318
|
+
},
|
|
319
|
+
});
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
catch (error) {
|
|
323
|
+
console.error(`Error stopping worker:`, error);
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Check worker health
|
|
329
|
+
*/
|
|
330
|
+
async checkHealth(id) {
|
|
331
|
+
const worker = await this.get(id);
|
|
332
|
+
if (!worker) {
|
|
333
|
+
throw new Error(`Worker with ID '${id}' not found.`);
|
|
334
|
+
}
|
|
335
|
+
// If no health check configured, just ping the endpoint
|
|
336
|
+
const healthCheckEndpoint = worker.config.healthCheck?.endpoint || worker.endpoint;
|
|
337
|
+
const healthCheckTimeout = worker.config.healthCheck?.timeout || 5000;
|
|
338
|
+
try {
|
|
339
|
+
// Perform health check based on protocol
|
|
340
|
+
if (worker.protocol === 'http' || worker.protocol === 'https') {
|
|
341
|
+
const isHealthy = await this.httpHealthCheck(healthCheckEndpoint, worker.protocol, healthCheckTimeout);
|
|
342
|
+
// Update worker status
|
|
343
|
+
await this.update(id, {
|
|
344
|
+
status: {
|
|
345
|
+
active: isHealthy,
|
|
346
|
+
lastSeen: isHealthy ? Date.now() : worker.status.lastSeen,
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
return isHealthy;
|
|
350
|
+
}
|
|
351
|
+
// For other protocols, we'll need to implement specific health checks
|
|
352
|
+
// For now, just return false for unsupported protocols
|
|
353
|
+
console.log(`Health check for protocol '${worker.protocol}' not implemented.`);
|
|
354
|
+
return false;
|
|
355
|
+
}
|
|
356
|
+
catch (error) {
|
|
357
|
+
console.error(`Error checking worker health:`, error);
|
|
358
|
+
// Update worker status to inactive
|
|
359
|
+
await this.update(id, {
|
|
360
|
+
status: {
|
|
361
|
+
active: false,
|
|
362
|
+
lastSeen: worker.status.lastSeen,
|
|
363
|
+
},
|
|
364
|
+
});
|
|
365
|
+
return false;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Generate a worker ID
|
|
370
|
+
*/
|
|
371
|
+
generateWorkerId(name) {
|
|
372
|
+
// Normalize the name: lowercase and replace non-alphanumeric chars with hyphens
|
|
373
|
+
let normalizedName = name.toLowerCase().replace(/[^a-z0-9]/g, '-');
|
|
374
|
+
// Ensure the name doesn't start with a hyphen (would cause issues with PM2)
|
|
375
|
+
normalizedName = normalizedName.replace(/^-+/, '');
|
|
376
|
+
// If after normalization the name is empty, use a default prefix
|
|
377
|
+
if (!normalizedName) {
|
|
378
|
+
normalizedName = 'worker';
|
|
379
|
+
}
|
|
380
|
+
const timestamp = Date.now().toString(36);
|
|
381
|
+
return `${normalizedName}-${timestamp}`;
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Perform HTTP health check
|
|
385
|
+
*/
|
|
386
|
+
httpHealthCheck(endpoint, protocol, timeout) {
|
|
387
|
+
return new Promise(resolve => {
|
|
388
|
+
const client = protocol === 'https' ? https : http;
|
|
389
|
+
const req = client.get(endpoint, res => {
|
|
390
|
+
// Consider 2xx status codes as healthy
|
|
391
|
+
const isHealthy = res.statusCode !== undefined &&
|
|
392
|
+
res.statusCode >= 200 &&
|
|
393
|
+
res.statusCode < 300;
|
|
394
|
+
resolve(isHealthy);
|
|
395
|
+
});
|
|
396
|
+
req.on('error', () => {
|
|
397
|
+
resolve(false);
|
|
398
|
+
});
|
|
399
|
+
req.setTimeout(timeout, () => {
|
|
400
|
+
req.destroy();
|
|
401
|
+
resolve(false);
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
//# sourceMappingURL=workerManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerManager.js","sourceRoot":"","sources":["../../src/lib/workerManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAMjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,OAAO,iBAAiB;IACpB,WAAW,CAAS;IAE5B;QACE,oCAAoC;QACpC,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAC,MAAM,EAAE,EAAE,EAAC,CAAC,CAAC;QAC7C,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC;QAC5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;QAElD,kCAAkC;QAClC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC;YACrC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,EAAC,SAAS,EAAE,IAAI,EAAC,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,OAAkC;QAC/C,sCAAs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,SAAS,GACb,GAAG,CAAC,UAAU,KAAK,SAAS;oBAC5B,GAAG,CAAC,UAAU,IAAI,GAAG;oBACrB,GAAG,CAAC,UAAU,GAAG,GAAG,CAAC;gBACvB,OAAO,CAAC,SAAS,CAAC,CAAC;YACrB,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;gBACnB,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,EAAE;gBAC3B,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,OAAO,CAAC,KAAK,CAAC,CAAC;YACjB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/dist/tonk.js
CHANGED
|
@@ -7,11 +7,13 @@ import { startCommand } from './commands/start.js';
|
|
|
7
7
|
import { killCommand } from './commands/kill.js';
|
|
8
8
|
import { pushCommand } from './commands/push.js';
|
|
9
9
|
import { proxyCommand } from './commands/proxy.js';
|
|
10
|
+
import { workerCommand } from './commands/worker/index.js';
|
|
10
11
|
import { createServer } from '@tonk/server';
|
|
11
12
|
import chalk from 'chalk';
|
|
12
13
|
import envPaths from 'env-paths';
|
|
13
14
|
import fs from 'node:fs';
|
|
14
15
|
import path from 'node:path';
|
|
16
|
+
import { shutdownAnalytics, trackCommand, trackCommandError, trackCommandSuccess } from './utils/analytics.js';
|
|
15
17
|
const program = new Command();
|
|
16
18
|
// Main program setup
|
|
17
19
|
program
|
|
@@ -31,8 +33,11 @@ program.addCommand(psCommand);
|
|
|
31
33
|
program.addCommand(lsCommand);
|
|
32
34
|
program.addCommand(killCommand);
|
|
33
35
|
program.addCommand(proxyCommand);
|
|
36
|
+
program.addCommand(workerCommand);
|
|
34
37
|
const startServer = async () => {
|
|
38
|
+
const startTime = Date.now();
|
|
35
39
|
try {
|
|
40
|
+
trackCommand('daemon', {});
|
|
36
41
|
// Create paths for Tonk daemon home
|
|
37
42
|
const paths = envPaths('tonk', { suffix: '' });
|
|
38
43
|
const tonkHome = paths.data;
|
|
@@ -55,11 +60,14 @@ const startServer = async () => {
|
|
|
55
60
|
};
|
|
56
61
|
// Start the server
|
|
57
62
|
const server = await createServer(serverConfig);
|
|
63
|
+
const duration = Date.now() - startTime;
|
|
64
|
+
trackCommandSuccess('daemon', duration);
|
|
58
65
|
// Handle process termination
|
|
59
66
|
const cleanup = async () => {
|
|
60
67
|
console.log(chalk.yellow('\nShutting down server...'));
|
|
61
68
|
try {
|
|
62
69
|
await server.stop();
|
|
70
|
+
await shutdownAnalytics();
|
|
63
71
|
console.log(chalk.green('Server shutdown complete.'));
|
|
64
72
|
// Force exit after brief delay to ensure any pending operations complete
|
|
65
73
|
setTimeout(() => process.exit(0), 500);
|
|
@@ -74,6 +82,8 @@ const startServer = async () => {
|
|
|
74
82
|
process.on('SIGTERM', cleanup);
|
|
75
83
|
}
|
|
76
84
|
catch (error) {
|
|
85
|
+
const duration = Date.now() - startTime;
|
|
86
|
+
trackCommandError('daemon', error, duration);
|
|
77
87
|
console.error(chalk.red('Failed to start TonkServer daemon:'), error);
|
|
78
88
|
process.exit(1);
|
|
79
89
|
}
|
package/dist/tonk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tonk.js","sourceRoot":"","sources":["../src/tonk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,oBAAoB,CAAC;A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C,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;YACzC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,GAAG,CAAC,CAAC;gBACxD,2BAA2B;gBAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QAC9B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QACxC,iBAAiB,CAAC,QAAQ,EAAE,KAAc,EAAE,QAAQ,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAAC,EAAE,KAAK,CAAC,CAAC;QACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;IACzD,WAAW,EAAE,CAAC;AAChB,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Worker specification for Tonk
|
|
3
|
+
*
|
|
4
|
+
* This file defines the standard format for worker definitions in Tonk.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Worker status information
|
|
8
|
+
*/
|
|
9
|
+
export interface WorkerStatus {
|
|
10
|
+
/** Whether the worker is currently active */
|
|
11
|
+
active: boolean;
|
|
12
|
+
/** Timestamp of when the worker was last seen (null if never) */
|
|
13
|
+
lastSeen: number | null;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Worker health check configuration
|
|
17
|
+
*/
|
|
18
|
+
export interface WorkerHealthCheck {
|
|
19
|
+
/** Endpoint to ping for health check */
|
|
20
|
+
endpoint: string;
|
|
21
|
+
/** Method to use for health check (GET, POST, etc.) */
|
|
22
|
+
method: string;
|
|
23
|
+
/** Interval in milliseconds between health checks */
|
|
24
|
+
interval: number;
|
|
25
|
+
/** Timeout in milliseconds for health check */
|
|
26
|
+
timeout: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Worker definition
|
|
30
|
+
*/
|
|
31
|
+
export interface Worker {
|
|
32
|
+
/** Unique identifier for the worker */
|
|
33
|
+
id: string;
|
|
34
|
+
/** Human-readable name of the worker */
|
|
35
|
+
name: string;
|
|
36
|
+
/** Description of the worker's purpose */
|
|
37
|
+
description: string;
|
|
38
|
+
/** Endpoint URL/path where the worker can be reached */
|
|
39
|
+
endpoint: string;
|
|
40
|
+
/** Protocol used by the worker (http, ws, tcp, etc.) */
|
|
41
|
+
protocol: string;
|
|
42
|
+
/** Current status of the worker */
|
|
43
|
+
status: WorkerStatus;
|
|
44
|
+
/** Environment variables required by the worker */
|
|
45
|
+
env: Record<string, string>;
|
|
46
|
+
/** Additional configuration options for the worker */
|
|
47
|
+
config: {
|
|
48
|
+
/** Optional health check configuration */
|
|
49
|
+
healthCheck?: WorkerHealthCheck;
|
|
50
|
+
/** Optional worker type (e.g., "obsidian", "rag", "custom") */
|
|
51
|
+
type?: string;
|
|
52
|
+
/** Optional worker version */
|
|
53
|
+
version?: string;
|
|
54
|
+
/** Any other configuration options */
|
|
55
|
+
[key: string]: any;
|
|
56
|
+
};
|
|
57
|
+
/** Timestamp of when the worker was created */
|
|
58
|
+
createdAt: number;
|
|
59
|
+
/** Timestamp of when the worker was last updated */
|
|
60
|
+
updatedAt: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Worker registration options
|
|
64
|
+
*/
|
|
65
|
+
export interface WorkerRegistrationOptions {
|
|
66
|
+
/** Name of the worker */
|
|
67
|
+
name: string;
|
|
68
|
+
/** Description of the worker */
|
|
69
|
+
description?: string;
|
|
70
|
+
/** Endpoint URL/path of the worker */
|
|
71
|
+
endpoint: string;
|
|
72
|
+
/** Protocol used by the worker */
|
|
73
|
+
protocol?: string;
|
|
74
|
+
/** Environment variables in KEY=VALUE format */
|
|
75
|
+
env?: string[];
|
|
76
|
+
/** Path to configuration file */
|
|
77
|
+
config?: string;
|
|
78
|
+
/** Worker type */
|
|
79
|
+
type?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Worker manager interface
|
|
83
|
+
*/
|
|
84
|
+
export interface WorkerManager {
|
|
85
|
+
/** Register a new worker */
|
|
86
|
+
register(options: WorkerRegistrationOptions): Promise<Worker>;
|
|
87
|
+
/** Get a worker by ID */
|
|
88
|
+
get(id: string): Promise<Worker | null>;
|
|
89
|
+
/** List all registered workers */
|
|
90
|
+
list(): Promise<Worker[]>;
|
|
91
|
+
/** Update a worker */
|
|
92
|
+
update(id: string, updates: Partial<Worker>): Promise<Worker>;
|
|
93
|
+
/** Remove a worker */
|
|
94
|
+
remove(id: string): Promise<boolean>;
|
|
95
|
+
/** Start a worker */
|
|
96
|
+
start(id: string): Promise<boolean>;
|
|
97
|
+
/** Stop a worker */
|
|
98
|
+
stop(id: string): Promise<boolean>;
|
|
99
|
+
/** Check worker health */
|
|
100
|
+
checkHealth(id: string): Promise<boolean>;
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/types/worker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,6CA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