lsh-framework 0.8.2 → 0.9.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.
- package/README.md +75 -1
- package/dist/cli.js +14 -10
- package/dist/daemon/lshd.js +23 -13
- package/dist/lib/api-error-handler.js +16 -14
- package/dist/lib/base-command-registrar.js +6 -5
- package/dist/lib/daemon-client.js +13 -9
- package/dist/lib/database-persistence.js +8 -8
- package/dist/lib/env-validator.js +0 -3
- package/dist/lib/logger.js +0 -1
- package/dist/lib/secrets-manager.js +254 -153
- package/dist/lib/zsh-import-manager.js +17 -9
- package/dist/pipeline/job-tracker.js +1 -1
- package/dist/pipeline/mcli-bridge.js +11 -5
- package/dist/pipeline/workflow-engine.js +10 -7
- package/dist/services/cron/cron-registrar.js +27 -22
- package/dist/services/daemon/daemon-registrar.js +27 -13
- package/dist/services/secrets/secrets.js +37 -28
- package/dist/services/supabase/supabase-registrar.js +40 -33
- package/package.json +2 -1
|
@@ -89,9 +89,10 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
89
89
|
{ flags: '-s, --search <query>', description: 'Search history entries' }
|
|
90
90
|
],
|
|
91
91
|
action: async (options) => {
|
|
92
|
+
const opts = options;
|
|
92
93
|
const persistence = new DatabasePersistence();
|
|
93
|
-
if (
|
|
94
|
-
const count = parseInt(
|
|
94
|
+
if (opts.list) {
|
|
95
|
+
const count = parseInt(opts.count);
|
|
95
96
|
const entries = await persistence.getHistoryEntries(count);
|
|
96
97
|
this.logInfo(`Recent ${entries.length} history entries:`);
|
|
97
98
|
entries.forEach((entry, index) => {
|
|
@@ -100,9 +101,9 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
100
101
|
this.logInfo(`${index + 1}. [${timestamp}] ${entry.command}${exitCode}`);
|
|
101
102
|
});
|
|
102
103
|
}
|
|
103
|
-
else if (
|
|
104
|
+
else if (opts.search) {
|
|
104
105
|
const entries = await persistence.getHistoryEntries(100);
|
|
105
|
-
const filtered = entries.filter(entry => entry.command.toLowerCase().includes(
|
|
106
|
+
const filtered = entries.filter(entry => entry.command.toLowerCase().includes(opts.search.toLowerCase()));
|
|
106
107
|
this.logInfo(`Found ${filtered.length} matching entries:`);
|
|
107
108
|
filtered.forEach((entry, index) => {
|
|
108
109
|
const timestamp = new Date(entry.timestamp).toLocaleString();
|
|
@@ -126,33 +127,34 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
126
127
|
{ flags: '-e, --export', description: 'Export configuration to JSON', defaultValue: false }
|
|
127
128
|
],
|
|
128
129
|
action: async (options) => {
|
|
130
|
+
const opts = options;
|
|
129
131
|
const configManager = new CloudConfigManager();
|
|
130
|
-
if (
|
|
132
|
+
if (opts.list) {
|
|
131
133
|
const config = configManager.getAll();
|
|
132
134
|
this.logInfo('Current configuration:');
|
|
133
135
|
config.forEach(item => {
|
|
134
136
|
this.logInfo(` ${item.key}: ${JSON.stringify(item.value)}`);
|
|
135
137
|
});
|
|
136
138
|
}
|
|
137
|
-
else if (
|
|
138
|
-
const value = configManager.get(
|
|
139
|
+
else if (opts.get) {
|
|
140
|
+
const value = configManager.get(opts.get);
|
|
139
141
|
if (value !== undefined) {
|
|
140
|
-
this.logInfo(`${
|
|
142
|
+
this.logInfo(`${opts.get}: ${JSON.stringify(value)}`);
|
|
141
143
|
}
|
|
142
144
|
else {
|
|
143
|
-
this.logWarning(`Configuration key '${
|
|
145
|
+
this.logWarning(`Configuration key '${opts.get}' not found`);
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
|
-
else if (
|
|
147
|
-
const [key, value] =
|
|
148
|
+
else if (opts.set) {
|
|
149
|
+
const [key, value] = opts.set;
|
|
148
150
|
configManager.set(key, value);
|
|
149
151
|
this.logSuccess(`Configuration '${key}' set to: ${value}`);
|
|
150
152
|
}
|
|
151
|
-
else if (
|
|
152
|
-
configManager.delete(
|
|
153
|
-
this.logSuccess(`Configuration '${
|
|
153
|
+
else if (opts.delete) {
|
|
154
|
+
configManager.delete(opts.delete);
|
|
155
|
+
this.logSuccess(`Configuration '${opts.delete}' deleted`);
|
|
154
156
|
}
|
|
155
|
-
else if (
|
|
157
|
+
else if (opts.export) {
|
|
156
158
|
const exported = configManager.export();
|
|
157
159
|
this.logInfo(exported);
|
|
158
160
|
}
|
|
@@ -170,8 +172,9 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
170
172
|
{ flags: '-h, --history', description: 'List job history', defaultValue: false }
|
|
171
173
|
],
|
|
172
174
|
action: async (options) => {
|
|
175
|
+
const opts = options;
|
|
173
176
|
const persistence = new DatabasePersistence();
|
|
174
|
-
if (
|
|
177
|
+
if (opts.list) {
|
|
175
178
|
const jobs = await persistence.getActiveJobs();
|
|
176
179
|
this.logInfo(`Active jobs (${jobs.length}):`);
|
|
177
180
|
jobs.forEach(job => {
|
|
@@ -179,7 +182,7 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
179
182
|
this.logInfo(`${job.job_id}: ${job.command} (${job.status}) - Started: ${started}`);
|
|
180
183
|
});
|
|
181
184
|
}
|
|
182
|
-
else if (
|
|
185
|
+
else if (opts.history) {
|
|
183
186
|
this.logInfo('Job history feature not yet implemented');
|
|
184
187
|
}
|
|
185
188
|
else {
|
|
@@ -196,17 +199,18 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
196
199
|
{ flags: '-t, --table <name>', description: 'Show rows from specific table only' }
|
|
197
200
|
],
|
|
198
201
|
action: async (options) => {
|
|
202
|
+
const opts = options;
|
|
199
203
|
const persistence = new DatabasePersistence();
|
|
200
|
-
const limit = parseInt(
|
|
204
|
+
const limit = parseInt(opts.limit);
|
|
201
205
|
// Test connection first
|
|
202
206
|
const isConnected = await persistence.testConnection();
|
|
203
207
|
if (!isConnected) {
|
|
204
208
|
throw new Error('Cannot fetch rows - database not available');
|
|
205
209
|
}
|
|
206
|
-
if (
|
|
210
|
+
if (opts.table) {
|
|
207
211
|
// Show rows from specific table
|
|
208
|
-
this.logInfo(`Latest ${limit} entries from table '${
|
|
209
|
-
const rows = await persistence.getLatestRowsFromTable(
|
|
212
|
+
this.logInfo(`Latest ${limit} entries from table '${opts.table}':`);
|
|
213
|
+
const rows = await persistence.getLatestRowsFromTable(opts.table, limit);
|
|
210
214
|
if (rows.length === 0) {
|
|
211
215
|
this.logInfo('No entries found.');
|
|
212
216
|
}
|
|
@@ -252,13 +256,14 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
252
256
|
{ flags: '--dataset <name>', description: 'Dataset name for new job' }
|
|
253
257
|
],
|
|
254
258
|
action: async (options) => {
|
|
255
|
-
|
|
259
|
+
const opts = options;
|
|
260
|
+
if (opts.list) {
|
|
256
261
|
let query = supabaseClient.getClient()
|
|
257
262
|
.from('ml_training_jobs')
|
|
258
263
|
.select('*')
|
|
259
264
|
.order('created_at', { ascending: false });
|
|
260
|
-
if (
|
|
261
|
-
query = query.eq('status',
|
|
265
|
+
if (opts.status) {
|
|
266
|
+
query = query.eq('status', opts.status);
|
|
262
267
|
}
|
|
263
268
|
const { data: jobs, error } = await query.limit(20);
|
|
264
269
|
if (error) {
|
|
@@ -273,16 +278,16 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
273
278
|
this.logInfo(` Dataset: ${job.dataset_name}`);
|
|
274
279
|
});
|
|
275
280
|
}
|
|
276
|
-
else if (
|
|
277
|
-
if (!
|
|
281
|
+
else if (opts.create) {
|
|
282
|
+
if (!opts.modelType || !opts.dataset) {
|
|
278
283
|
throw new Error('Both --model-type and --dataset are required to create a job');
|
|
279
284
|
}
|
|
280
285
|
const { data, error } = await supabaseClient.getClient()
|
|
281
286
|
.from('ml_training_jobs')
|
|
282
287
|
.insert({
|
|
283
|
-
job_name:
|
|
284
|
-
model_type:
|
|
285
|
-
dataset_name:
|
|
288
|
+
job_name: opts.create,
|
|
289
|
+
model_type: opts.modelType,
|
|
290
|
+
dataset_name: opts.dataset,
|
|
286
291
|
status: 'pending',
|
|
287
292
|
created_at: new Date().toISOString()
|
|
288
293
|
})
|
|
@@ -290,7 +295,7 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
290
295
|
if (error) {
|
|
291
296
|
throw new Error(`Failed to create training job: ${error.message}`);
|
|
292
297
|
}
|
|
293
|
-
this.logSuccess(`Created training job: ${
|
|
298
|
+
this.logSuccess(`Created training job: ${opts.create}`);
|
|
294
299
|
this.logInfo(JSON.stringify(data, null, 2));
|
|
295
300
|
}
|
|
296
301
|
else {
|
|
@@ -307,12 +312,13 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
307
312
|
{ flags: '--deployed', description: 'Filter by deployed models only', defaultValue: false }
|
|
308
313
|
],
|
|
309
314
|
action: async (options) => {
|
|
310
|
-
|
|
315
|
+
const opts = options;
|
|
316
|
+
if (opts.list) {
|
|
311
317
|
let query = supabaseClient.getClient()
|
|
312
318
|
.from('ml_models')
|
|
313
319
|
.select('*')
|
|
314
320
|
.order('created_at', { ascending: false });
|
|
315
|
-
if (
|
|
321
|
+
if (opts.deployed) {
|
|
316
322
|
query = query.eq('deployed', true);
|
|
317
323
|
}
|
|
318
324
|
const { data: models, error } = await query.limit(20);
|
|
@@ -342,7 +348,8 @@ export class SupabaseCommandRegistrar extends BaseCommandRegistrar {
|
|
|
342
348
|
{ flags: '-l, --list', description: 'List feature definitions', defaultValue: false }
|
|
343
349
|
],
|
|
344
350
|
action: async (options) => {
|
|
345
|
-
|
|
351
|
+
const opts = options;
|
|
352
|
+
if (opts.list) {
|
|
346
353
|
const { data: features, error } = await supabaseClient.getClient()
|
|
347
354
|
.from('ml_features')
|
|
348
355
|
.select('*')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lsh-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Encrypted secrets manager with automatic rotation, team sync, and multi-environment support. Built on a powerful shell with daemon scheduling and CI/CD integration.",
|
|
5
5
|
"main": "dist/app.js",
|
|
6
6
|
"bin": {
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"ioredis": "^5.8.0",
|
|
107
107
|
"jsonwebtoken": "^9.0.2",
|
|
108
108
|
"lodash": "^4.17.21",
|
|
109
|
+
"lsh-framework": "^0.8.2",
|
|
109
110
|
"node-cron": "^3.0.3",
|
|
110
111
|
"node-fetch": "^3.3.2",
|
|
111
112
|
"ora": "^8.0.1",
|