just-bash 2.15.0-executor.0 → 2.15.1-executor.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,10 +1,19 @@
1
1
  /**
2
2
  * Executor SDK lazy initialization.
3
3
  * Separated from Bash.ts so the browser bundle never sees these imports.
4
- * Only loaded at runtime behind a __BROWSER__ guard.
4
+ * Only loaded at runtime behind a dynamic import.
5
5
  */
6
6
  import type { ExecutorConfig, ExecutorSDKHandle } from "./Bash.js";
7
7
  export declare function initExecutorSDK(setup: (sdk: ExecutorSDKHandle) => Promise<void>, approval: ExecutorConfig["onToolApproval"] | undefined, fs: import("./fs/interface.js").IFileSystem, getCwd: () => string, getEnv: () => Map<string, string>, getLimits: () => import("./limits.js").ExecutionLimits | undefined): Promise<{
8
8
  sdk: ExecutorSDKHandle;
9
- invokeTool: (path: string, argsJson: string) => Promise<string>;
9
+ /**
10
+ * Execute code through the SDK pipeline.
11
+ * The SDK creates the toolInvoker per-execution and passes it to our
12
+ * CodeExecutor, which runs the code in QuickJS with the tools proxy.
13
+ */
14
+ executeViaSdk: (code: string) => Promise<{
15
+ result: unknown;
16
+ error?: string;
17
+ logs?: string[];
18
+ }>;
10
19
  }>;
@@ -43,6 +43,11 @@ export interface InterpreterOptions {
43
43
  jsBootstrapCode?: string;
44
44
  /** Tool invoker for executor mode (js-exec) */
45
45
  executorInvokeTool?: (path: string, argsJson: string) => Promise<string>;
46
+ executorExecFn?: (code: string) => Promise<{
47
+ result: unknown;
48
+ error?: string;
49
+ logs?: string[];
50
+ }>;
46
51
  }
47
52
  export declare class Interpreter {
48
53
  private ctx;
@@ -346,4 +346,9 @@ export interface InterpreterContext {
346
346
  * When present, js-exec sets up a `tools` proxy.
347
347
  */
348
348
  executorInvokeTool?: (path: string, argsJson: string) => Promise<string>;
349
+ executorExecFn?: (code: string) => Promise<{
350
+ result: unknown;
351
+ error?: string;
352
+ logs?: string[];
353
+ }>;
349
354
  }
package/dist/types.d.ts CHANGED
@@ -188,6 +188,17 @@ export interface CommandContext {
188
188
  * The function receives (path, argsJson) and returns a JSON result string.
189
189
  */
190
190
  executorInvokeTool?: (path: string, argsJson: string) => Promise<string>;
191
+ /**
192
+ * When set, js-exec routes execution through this function instead of
193
+ * running code directly. Used by the @executor/sdk integration — the
194
+ * SDK creates the toolInvoker (with all discovered sources) and calls
195
+ * our CodeExecutor which runs the code in QuickJS.
196
+ */
197
+ executorExecFn?: (code: string) => Promise<{
198
+ result: unknown;
199
+ error?: string;
200
+ logs?: string[];
201
+ }>;
191
202
  }
192
203
  export interface Command {
193
204
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "just-bash",
3
- "version": "2.15.0-executor.0",
3
+ "version": "2.15.1-executor.0",
4
4
  "description": "A simulated bash environment with virtual filesystem",
5
5
  "repository": {
6
6
  "type": "git",