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.
@@ -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 (options.list) {
94
- const count = parseInt(options.count);
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 (options.search) {
104
+ else if (opts.search) {
104
105
  const entries = await persistence.getHistoryEntries(100);
105
- const filtered = entries.filter(entry => entry.command.toLowerCase().includes(options.search.toLowerCase()));
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 (options.list) {
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 (options.get) {
138
- const value = configManager.get(options.get);
139
+ else if (opts.get) {
140
+ const value = configManager.get(opts.get);
139
141
  if (value !== undefined) {
140
- this.logInfo(`${options.get}: ${JSON.stringify(value)}`);
142
+ this.logInfo(`${opts.get}: ${JSON.stringify(value)}`);
141
143
  }
142
144
  else {
143
- this.logWarning(`Configuration key '${options.get}' not found`);
145
+ this.logWarning(`Configuration key '${opts.get}' not found`);
144
146
  }
145
147
  }
146
- else if (options.set) {
147
- const [key, value] = options.set;
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 (options.delete) {
152
- configManager.delete(options.delete);
153
- this.logSuccess(`Configuration '${options.delete}' deleted`);
153
+ else if (opts.delete) {
154
+ configManager.delete(opts.delete);
155
+ this.logSuccess(`Configuration '${opts.delete}' deleted`);
154
156
  }
155
- else if (options.export) {
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 (options.list) {
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 (options.history) {
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(options.limit);
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 (options.table) {
210
+ if (opts.table) {
207
211
  // Show rows from specific table
208
- this.logInfo(`Latest ${limit} entries from table '${options.table}':`);
209
- const rows = await persistence.getLatestRowsFromTable(options.table, limit);
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
- if (options.list) {
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 (options.status) {
261
- query = query.eq('status', options.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 (options.create) {
277
- if (!options.modelType || !options.dataset) {
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: options.create,
284
- model_type: options.modelType,
285
- dataset_name: options.dataset,
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: ${options.create}`);
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
- if (options.list) {
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 (options.deployed) {
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
- if (options.list) {
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.8.2",
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",