@pellux/goodvibes-sdk 0.18.19 → 0.18.20

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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/repl/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAGnF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAmBjD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAwND,wBAAgB,cAAc,CAC5B,aAAa,EAAE,iBAAiB,EAChC,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,eAAe,GACvB,IAAI,CA6EN"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/tools/repl/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAGnF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAmBjD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAsMD,wBAAgB,cAAc,CAC5B,aAAa,EAAE,iBAAiB,EAChC,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,eAAe,GACvB,IAAI,CA6EN"}
@@ -1,6 +1,5 @@
1
1
  import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
- import { mkdtempSync, rmSync } from 'node:fs';
4
3
  import ts from 'typescript';
5
4
  import { executeSandboxCommand } from '../../runtime/sandbox/backend.js';
6
5
  import {} from '../../runtime/sandbox/manager.js';
@@ -81,33 +80,16 @@ async function evalTypeScript(expression, bindings, configManager, sandboxSessio
81
80
  }).outputText;
82
81
  return evalJavaScriptInSandbox(transpiled, bindings, launchPlan, configManager, sandboxSessionRegistry, sessionId);
83
82
  }
84
- function evalPython(expression, workspaceRoot, surfaceRoot, configManager, sandboxSessionRegistry, launchPlan, sessionId) {
85
- const replTempBase = join(workspaceRoot, '.goodvibes', surfaceRoot, 'repl-temp');
86
- mkdirSync(replTempBase, { recursive: true });
87
- const tempRoot = mkdtempSync(join(replTempBase, 'gv-repl-py-'));
88
- const venvPath = join(tempRoot, 'venv');
89
- const pythonLaunchPlan = launchPlan.backend === 'local' ? {
90
- ...createLocalExecPlan(tempRoot),
91
- workspaceRoot: tempRoot,
92
- } : launchPlan;
93
- const create = sessionId
94
- ? sandboxSessionRegistry.execute(sessionId, 'python3', ['-m', 'venv', venvPath], configManager, { cwd: tempRoot })
95
- : executeSandboxCommand(pythonLaunchPlan, 'python3', ['-m', 'venv', venvPath], { cwd: tempRoot });
96
- if (create.status !== 0) {
97
- rmSync(tempRoot, { recursive: true, force: true });
98
- throw new Error(create.stderr || create.stdout || 'Failed to create ephemeral Python venv.');
99
- }
100
- const pythonBin = join(venvPath, 'bin', 'python');
83
+ function evalPython(expression, workspaceRoot, configManager, sandboxSessionRegistry, launchPlan, sessionId) {
101
84
  const run = sessionId
102
- ? sandboxSessionRegistry.execute(sessionId, pythonBin, ['-I', '-S', '-c', `import json\nresult = (${expression})\nprint(json.dumps(result))`], configManager, {
103
- cwd: tempRoot,
85
+ ? sandboxSessionRegistry.execute(sessionId, 'python3', ['-I', '-S', '-c', `import json\nresult = (${expression})\nprint(json.dumps(result))`], configManager, {
86
+ cwd: workspaceRoot,
104
87
  timeoutMs: 5000,
105
88
  })
106
- : executeSandboxCommand(pythonLaunchPlan, pythonBin, ['-I', '-S', '-c', `import json\nresult = (${expression})\nprint(json.dumps(result))`], {
107
- cwd: tempRoot,
89
+ : executeSandboxCommand(launchPlan, 'python3', ['-I', '-S', '-c', `import json\nresult = (${expression})\nprint(json.dumps(result))`], {
90
+ cwd: workspaceRoot,
108
91
  timeoutMs: 5000,
109
92
  });
110
- rmSync(tempRoot, { recursive: true, force: true });
111
93
  if (run.status !== 0) {
112
94
  throw new Error((run.stderr || run.stdout || 'Python eval failed.').trim());
113
95
  }
@@ -217,7 +199,7 @@ export function createReplTool(configManager, sandboxSessionRegistry, options) {
217
199
  rendered = await evalTypeScript(input.expression, input.bindings ?? {}, configManager, sandboxSessionRegistry, sandboxSession.launchPlan ?? localExecPlan, sandboxSession.id);
218
200
  break;
219
201
  case 'python':
220
- rendered = evalPython(input.expression, input.workspaceRoot, surfaceRoot, configManager, sandboxSessionRegistry, sandboxSession.launchPlan ?? localExecPlan, sandboxSession.id);
202
+ rendered = evalPython(input.expression, input.workspaceRoot, configManager, sandboxSessionRegistry, sandboxSession.launchPlan ?? localExecPlan, sandboxSession.id);
221
203
  break;
222
204
  case 'sql':
223
205
  rendered = await evalSql(input.expression, configManager, sandboxSessionRegistry, sandboxSession.launchPlan ?? localExecPlan, sandboxSession.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-sdk",
3
- "version": "0.18.19",
3
+ "version": "0.18.20",
4
4
  "description": "Umbrella GoodVibes SDK with operator, peer, daemon, transport, and runtime-specific integration layers.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",