@cef-ai/cli 0.2.1 → 0.2.3

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.
@@ -1,13 +1,5 @@
1
1
  import vm from 'vm';
2
- import ts from 'typescript';
3
- const TS_COMPILE_OPTIONS = {
4
- target: ts.ScriptTarget.ES2022,
5
- module: ts.ModuleKind.ES2022,
6
- strict: false,
7
- noImplicitAny: false,
8
- removeComments: false,
9
- esModuleInterop: true,
10
- };
2
+ import { transpileTypeScript } from '../transpile.js';
11
3
  export class AgentRouter {
12
4
  tasks = new Map(); // key: agentAlias/taskAlias
13
5
  agentTasks = new Map(); // agentAlias -> [taskAlias, ...]
@@ -70,9 +62,6 @@ export class AgentRouter {
70
62
  this.tasks.set(key, { agentAlias, taskAlias, compiledJs });
71
63
  }
72
64
  transpile(tsCode) {
73
- const result = ts.transpileModule(tsCode, {
74
- compilerOptions: TS_COMPILE_OPTIONS,
75
- });
76
- return result.outputText;
65
+ return transpileTypeScript(tsCode);
77
66
  }
78
67
  }
@@ -1,5 +1,5 @@
1
1
  import vm from 'vm';
2
- import ts from 'typescript';
2
+ import { transpileTypeScript } from '../transpile.js';
3
3
  import { LogCollector } from './log-collector.js';
4
4
  import { AgentRouter } from './agent-router.js';
5
5
  import { CubbyManager } from './cubby-manager.js';
@@ -68,9 +68,7 @@ export class LocalRuntime {
68
68
  });
69
69
  const context = this.buildContextForExecution(executionId, undefined, undefined);
70
70
  // Transpile and run engagement code in the background
71
- const jsCode = ts.transpileModule(engagement.tsCode ?? '', {
72
- compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.ES2022 },
73
- }).outputText;
71
+ const jsCode = transpileTypeScript(engagement.tsCode ?? '');
74
72
  const event = { payload: { ...payload, streamId } };
75
73
  const sandbox = {
76
74
  event,
@@ -0,0 +1 @@
1
+ export declare function transpileTypeScript(code: string): string;
@@ -0,0 +1,9 @@
1
+ import { transformSync } from 'esbuild';
2
+ export function transpileTypeScript(code) {
3
+ const result = transformSync(code, {
4
+ loader: 'ts',
5
+ target: 'es2022',
6
+ format: 'esm',
7
+ });
8
+ return result.code;
9
+ }
@@ -1,6 +1,6 @@
1
1
  CEF_AUTH_TOKEN=your-token-here
2
- CEF_ORCHESTRATOR_URL=https://compute-1.devnet.ddc-dragon.com/orchestrator
3
- CEF_ROB_API_URL=https://api.rob.dev.cere.io/rms-node-backend
2
+ CEF_ORCHESTRATOR_URL=https://orchestrator.compute.test.ddcdragon.com
3
+ CEF_ROB_API_URL=https://rob.compute.test.ddcdragon.com/rms-node-backend
4
4
 
5
5
  # For E2E tests only (npm run test:e2e): agent service public key the token can use
6
6
  # CEF_E2E_AGENT_SERVICE_PUB_KEY=0x...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cef-ai/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "CEF AI command-line interface",
5
5
  "type": "module",
6
6
  "bin": {
@@ -29,7 +29,7 @@
29
29
  "cere"
30
30
  ],
31
31
  "scripts": {
32
- "build": "tsc",
32
+ "build": "tsc && cp -r src/commands/dev/static dist/commands/dev/static",
33
33
  "prepublishOnly": "npm run build",
34
34
  "test": "vitest run",
35
35
  "test:watch": "vitest",
@@ -42,6 +42,7 @@
42
42
  },
43
43
  "dependencies": {
44
44
  "better-sqlite3": "^12.8.0",
45
+ "esbuild": "^0.25.0",
45
46
  "chalk": "^5.6.2",
46
47
  "commander": "^14.0.3",
47
48
  "dotenv": "^16.4.5",
@@ -49,18 +50,18 @@
49
50
  "sqlite-vec": "^0.1.9",
50
51
  "typescript": "^5.4.5",
51
52
  "ws": "^8.20.0",
52
- "yaml": "^2.4.5"
53
+ "yaml": "^2.8.3"
53
54
  },
54
55
  "devDependencies": {
55
56
  "@eslint/js": "^9.15.0",
56
57
  "@types/better-sqlite3": "^7.6.13",
57
58
  "@types/node": "^20.14.0",
58
59
  "@types/ws": "^8.18.1",
59
- "@vitest/coverage-v8": "^1.6.0",
60
+ "@vitest/coverage-v8": "^4.1.0",
60
61
  "eslint": "^9.15.0",
61
62
  "tsx": "^4.15.7",
62
63
  "typescript-eslint": "^8.15.0",
63
- "vitest": "^1.6.0"
64
+ "vitest": "^4.1.0"
64
65
  },
65
66
  "engines": {
66
67
  "node": ">=18.0.0"
@@ -1 +0,0 @@
1
- export declare function getDevUiHtml(): string;