@ekairos/dataset 1.22.47-beta.development.0 → 1.22.49-beta.development.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.
@@ -1,4 +1,5 @@
1
1
  import { readFileSync } from "node:fs";
2
+ import { createRequire } from "node:module";
2
3
  import { dirname, join } from "node:path";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { runDatasetSandboxCommandStep, writeDatasetSandboxFilesStep } from "../sandbox/steps.js";
@@ -15,10 +16,16 @@ const PYTHON_SCRIPT_FILES = [
15
16
  "preview_tail_csv.py",
16
17
  "preview_tail_excel.py",
17
18
  ];
19
+ const require = createRequire(import.meta.url);
18
20
  function resolveScriptPath(scriptName) {
19
- // Prefer local scripts in src/ (tests/dev), and after build the scripts are copied to dist/
20
- // at the same relative path, so this works in both environments.
21
- return join(dirname(fileURLToPath(import.meta.url)), "scripts", scriptName);
21
+ try {
22
+ return require.resolve(`@ekairos/dataset/file/scripts/${scriptName}`);
23
+ }
24
+ catch {
25
+ // Prefer local scripts in src/ (tests/dev), and after build the scripts are copied to dist/
26
+ // at the same relative path, so this works in both environments.
27
+ return join(dirname(fileURLToPath(import.meta.url)), "scripts", scriptName);
28
+ }
22
29
  }
23
30
  const preparedSandboxIds = new Set();
24
31
  const sandboxSetupPromises = new Map();
@@ -156,7 +163,7 @@ export async function generateFilePreview(env, sandboxId, sandboxFilePath, datas
156
163
  return context;
157
164
  }
158
165
  async function runScript(env, sandboxId, scriptName, args, description) {
159
- const scriptPath = `/vercel/sandbox/lib/domain/dataset/file/scripts/${scriptName}`;
166
+ const scriptPath = `${SANDBOX_SCRIPT_DIRECTORY}/${scriptName}`;
160
167
  const command = `python ${scriptPath} ${args.join(" ")}`;
161
168
  let scriptContent = "";
162
169
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekairos/dataset",
3
- "version": "1.22.47-beta.development.0",
3
+ "version": "1.22.49-beta.development.0",
4
4
  "description": "Pulzar Dataset Tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -54,9 +54,9 @@
54
54
  "test:ai-sdk:instant": "vitest run -c vitest.codex.config.mts src/tests/materializeDataset.ai-sdk.instant.test.ts"
55
55
  },
56
56
  "dependencies": {
57
- "@ekairos/domain": "^1.22.47-beta.development.0",
58
- "@ekairos/events": "^1.22.47-beta.development.0",
59
- "@ekairos/sandbox": "^1.22.47-beta.development.0",
57
+ "@ekairos/domain": "^1.22.49-beta.development.0",
58
+ "@ekairos/events": "^1.22.49-beta.development.0",
59
+ "@ekairos/sandbox": "^1.22.49-beta.development.0",
60
60
  "@instantdb/admin": "0.22.158",
61
61
  "@instantdb/core": "0.22.142",
62
62
  "ai": "^5.0.44",