@elsium-ai/cli 0.2.3 → 0.3.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 (2) hide show
  1. package/dist/cli.js +66 -1
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -336,13 +336,75 @@ var init_stream = __esm(() => {
336
336
  });
337
337
 
338
338
  // ../core/src/logger.ts
339
- var init_logger = () => {};
339
+ function createLogger(options = {}) {
340
+ const { level = "info", pretty = false, context = {} } = options;
341
+ const minLevel = LOG_LEVELS[level];
342
+ function log(logLevel, message, data) {
343
+ if (LOG_LEVELS[logLevel] < minLevel)
344
+ return;
345
+ const entry = {
346
+ ...context,
347
+ level: logLevel,
348
+ message,
349
+ timestamp: new Date().toISOString(),
350
+ ...data ? { data } : {}
351
+ };
352
+ const output = pretty ? JSON.stringify(entry, null, 2) : JSON.stringify(entry);
353
+ if (logLevel === "error") {
354
+ console.error(output);
355
+ } else if (logLevel === "warn") {
356
+ console.warn(output);
357
+ } else {
358
+ console.log(output);
359
+ }
360
+ }
361
+ return {
362
+ debug: (msg, data) => log("debug", msg, data),
363
+ info: (msg, data) => log("info", msg, data),
364
+ warn: (msg, data) => log("warn", msg, data),
365
+ error: (msg, data) => log("error", msg, data),
366
+ child(childContext) {
367
+ return createLogger({
368
+ level,
369
+ pretty,
370
+ context: { ...context, ...childContext }
371
+ });
372
+ }
373
+ };
374
+ }
375
+ var LOG_LEVELS;
376
+ var init_logger = __esm(() => {
377
+ LOG_LEVELS = {
378
+ debug: 0,
379
+ info: 1,
380
+ warn: 2,
381
+ error: 3
382
+ };
383
+ });
340
384
 
341
385
  // ../core/src/config.ts
342
386
  var init_config = __esm(() => {
343
387
  init_errors();
344
388
  });
345
389
 
390
+ // ../core/src/schema.ts
391
+ var log;
392
+ var init_schema = __esm(() => {
393
+ init_logger();
394
+ log = createLogger();
395
+ });
396
+
397
+ // ../core/src/registry.ts
398
+ var log2, BLOCKED_KEYS;
399
+ var init_registry = __esm(() => {
400
+ init_logger();
401
+ log2 = createLogger();
402
+ BLOCKED_KEYS = new Set(["__proto__", "constructor", "prototype"]);
403
+ });
404
+
405
+ // ../core/src/tokens.ts
406
+ var init_tokens = () => {};
407
+
346
408
  // ../core/src/circuit-breaker.ts
347
409
  var init_circuit_breaker = __esm(() => {
348
410
  init_errors();
@@ -370,6 +432,9 @@ var init_src = __esm(() => {
370
432
  init_stream();
371
433
  init_logger();
372
434
  init_config();
435
+ init_schema();
436
+ init_registry();
437
+ init_tokens();
373
438
  init_utils();
374
439
  init_circuit_breaker();
375
440
  init_dedup();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elsium-ai/cli",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "CLI tool for ElsiumAI projects",
5
5
  "license": "MIT",
6
6
  "author": "Eric Utrera <ebutrera9103@gmail.com>",
@@ -24,8 +24,8 @@
24
24
  "dev": "bun --watch src/cli.ts"
25
25
  },
26
26
  "dependencies": {
27
- "@elsium-ai/core": "^0.2.3",
28
- "@elsium-ai/observe": "^0.2.3"
27
+ "@elsium-ai/core": "^0.3.0",
28
+ "@elsium-ai/observe": "^0.3.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "typescript": "^5.7.0"