@blaxel/core 0.2.70 → 0.2.71-dev.105

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 (93) hide show
  1. package/dist/cjs/.tsbuildinfo +1 -1
  2. package/dist/cjs/agents/index.js +2 -19
  3. package/dist/cjs/common/autoload.js +64 -0
  4. package/dist/cjs/common/h2fetch.js +207 -0
  5. package/dist/cjs/common/h2pool.js +137 -0
  6. package/dist/cjs/common/h2warm.js +54 -0
  7. package/dist/cjs/common/settings.js +2 -2
  8. package/dist/cjs/jobs/jobs.js +10 -28
  9. package/dist/cjs/mcp/server.js +4 -65
  10. package/dist/cjs/sandbox/action.js +33 -0
  11. package/dist/cjs/sandbox/drive/drive.js +3 -3
  12. package/dist/cjs/sandbox/filesystem/filesystem.js +1 -2
  13. package/dist/cjs/sandbox/interpreter.js +12 -2
  14. package/dist/cjs/sandbox/process/process.js +2 -2
  15. package/dist/cjs/sandbox/sandbox.js +84 -10
  16. package/dist/cjs/tools/index.js +3 -1
  17. package/dist/cjs/tools/mcpTool.js +15 -43
  18. package/dist/cjs/types/agents/index.d.ts +1 -2
  19. package/dist/cjs/types/common/autoload.d.ts +5 -0
  20. package/dist/cjs/types/common/h2fetch.d.ts +22 -0
  21. package/dist/cjs/types/common/h2pool.d.ts +38 -0
  22. package/dist/cjs/types/common/h2warm.d.ts +2 -0
  23. package/dist/cjs/types/jobs/jobs.d.ts +1 -2
  24. package/dist/cjs/types/sandbox/action.d.ts +8 -1
  25. package/dist/cjs/types/sandbox/client/types.gen.d.ts +11 -0
  26. package/dist/cjs/types/sandbox/interpreter.d.ts +1 -0
  27. package/dist/cjs/types/sandbox/sandbox.d.ts +6 -0
  28. package/dist/cjs/types/sandbox/types.d.ts +2 -0
  29. package/dist/cjs/types/tools/index.d.ts +1 -0
  30. package/dist/cjs-browser/.tsbuildinfo +1 -1
  31. package/dist/cjs-browser/agents/index.js +2 -19
  32. package/dist/cjs-browser/common/autoload.js +64 -0
  33. package/dist/cjs-browser/common/h2fetch.js +4 -0
  34. package/dist/cjs-browser/common/h2pool.js +4 -0
  35. package/dist/cjs-browser/common/h2warm.js +2 -0
  36. package/dist/cjs-browser/common/settings.js +2 -2
  37. package/dist/cjs-browser/jobs/jobs.js +10 -28
  38. package/dist/cjs-browser/mcp/server.js +4 -65
  39. package/dist/cjs-browser/sandbox/action.js +33 -0
  40. package/dist/cjs-browser/sandbox/drive/drive.js +3 -3
  41. package/dist/cjs-browser/sandbox/filesystem/filesystem.js +1 -2
  42. package/dist/cjs-browser/sandbox/interpreter.js +12 -2
  43. package/dist/cjs-browser/sandbox/process/process.js +2 -2
  44. package/dist/cjs-browser/sandbox/sandbox.js +84 -10
  45. package/dist/cjs-browser/tools/index.js +3 -1
  46. package/dist/cjs-browser/tools/mcpTool.js +15 -43
  47. package/dist/cjs-browser/types/agents/index.d.ts +1 -2
  48. package/dist/cjs-browser/types/common/autoload.d.ts +5 -0
  49. package/dist/cjs-browser/types/common/h2fetch.d.ts +22 -0
  50. package/dist/cjs-browser/types/common/h2pool.d.ts +38 -0
  51. package/dist/cjs-browser/types/common/h2warm.d.ts +2 -0
  52. package/dist/cjs-browser/types/jobs/jobs.d.ts +1 -2
  53. package/dist/cjs-browser/types/sandbox/action.d.ts +8 -1
  54. package/dist/cjs-browser/types/sandbox/client/types.gen.d.ts +11 -0
  55. package/dist/cjs-browser/types/sandbox/interpreter.d.ts +1 -0
  56. package/dist/cjs-browser/types/sandbox/sandbox.d.ts +6 -0
  57. package/dist/cjs-browser/types/sandbox/types.d.ts +2 -0
  58. package/dist/cjs-browser/types/tools/index.d.ts +1 -0
  59. package/dist/esm/.tsbuildinfo +1 -1
  60. package/dist/esm/agents/index.js +1 -19
  61. package/dist/esm/common/autoload.js +30 -0
  62. package/dist/esm/common/h2fetch.js +202 -0
  63. package/dist/esm/common/h2pool.js +101 -0
  64. package/dist/esm/common/h2warm.js +48 -0
  65. package/dist/esm/common/settings.js +2 -2
  66. package/dist/esm/jobs/jobs.js +9 -28
  67. package/dist/esm/mcp/server.js +4 -65
  68. package/dist/esm/sandbox/action.js +33 -0
  69. package/dist/esm/sandbox/drive/drive.js +3 -3
  70. package/dist/esm/sandbox/filesystem/filesystem.js +1 -2
  71. package/dist/esm/sandbox/interpreter.js +12 -2
  72. package/dist/esm/sandbox/process/process.js +2 -2
  73. package/dist/esm/sandbox/sandbox.js +51 -10
  74. package/dist/esm/tools/index.js +1 -0
  75. package/dist/esm/tools/mcpTool.js +15 -43
  76. package/dist/esm-browser/.tsbuildinfo +1 -1
  77. package/dist/esm-browser/agents/index.js +1 -19
  78. package/dist/esm-browser/common/autoload.js +30 -0
  79. package/dist/esm-browser/common/h2fetch.js +4 -0
  80. package/dist/esm-browser/common/h2pool.js +4 -0
  81. package/dist/esm-browser/common/h2warm.js +2 -0
  82. package/dist/esm-browser/common/settings.js +2 -2
  83. package/dist/esm-browser/jobs/jobs.js +9 -28
  84. package/dist/esm-browser/mcp/server.js +4 -65
  85. package/dist/esm-browser/sandbox/action.js +33 -0
  86. package/dist/esm-browser/sandbox/drive/drive.js +3 -3
  87. package/dist/esm-browser/sandbox/filesystem/filesystem.js +1 -2
  88. package/dist/esm-browser/sandbox/interpreter.js +12 -2
  89. package/dist/esm-browser/sandbox/process/process.js +2 -2
  90. package/dist/esm-browser/sandbox/sandbox.js +51 -10
  91. package/dist/esm-browser/tools/index.js +1 -0
  92. package/dist/esm-browser/tools/mcpTool.js +15 -43
  93. package/package.json +1 -1
@@ -137,9 +137,16 @@ export type ProcessRequest = {
137
137
  env?: {
138
138
  [key: string]: string;
139
139
  };
140
+ /**
141
+ * Disable scale-to-zero while process runs. Default timeout is 600s (10 minutes). Set timeout to 0 for infinite.
142
+ */
143
+ keepAlive?: boolean;
140
144
  maxRestarts?: number;
141
145
  name?: string;
142
146
  restartOnFailure?: boolean;
147
+ /**
148
+ * Timeout in seconds. When keepAlive is true, defaults to 600s (10 minutes). Set to 0 for infinite (no auto-kill).
149
+ */
143
150
  timeout?: number;
144
151
  waitForCompletion?: boolean;
145
152
  waitForPorts?: Array<number>;
@@ -149,6 +156,10 @@ export type ProcessResponse = {
149
156
  command: string;
150
157
  completedAt: string;
151
158
  exitCode: number;
159
+ /**
160
+ * Whether scale-to-zero is disabled for this process
161
+ */
162
+ keepAlive?: boolean;
152
163
  logs: string;
153
164
  maxRestarts?: number;
154
165
  name: string;
@@ -12,6 +12,7 @@ export declare class CodeInterpreter extends SandboxInstance {
12
12
  safe?: boolean;
13
13
  }): Promise<CodeInterpreter>;
14
14
  get _jupyterUrl(): string;
15
+ private _fetch;
15
16
  static OutputMessage: {
16
17
  new (text: string, timestamp: number | null, isStderr: boolean): {
17
18
  text: string;
@@ -18,12 +18,18 @@ export declare class SandboxInstance {
18
18
  codegen: SandboxCodegen;
19
19
  system: SandboxSystem;
20
20
  drives: SandboxDrive;
21
+ h2Session: any;
21
22
  constructor(sandbox: SandboxConfiguration);
22
23
  get metadata(): import("../client/types.gen.js").Metadata;
23
24
  get status(): import("../client/types.gen.js").Status | undefined;
24
25
  get events(): import("../client/types.gen.js").CoreEvents | undefined;
25
26
  get spec(): import("../client/types.gen.js").SandboxSpec;
26
27
  get lastUsedAt(): string | undefined;
28
+ /**
29
+ * Warm and attach an H2 session based on the sandbox's region.
30
+ * Shared by create(), get(), list(), and update helpers.
31
+ */
32
+ private static attachH2Session;
27
33
  get expiresIn(): number | undefined;
28
34
  wait({ maxWait, interval }?: {
29
35
  maxWait?: number;
@@ -1,3 +1,4 @@
1
+ import type http2 from "http2";
1
2
  import { Port, Sandbox, SandboxLifecycle, VolumeAttachment, SandboxNetwork } from "../client/types.gen";
2
3
  import { PostProcessResponse, ProcessRequest } from "./client";
3
4
  export interface SessionCreateOptions {
@@ -24,6 +25,7 @@ export type SandboxConfiguration = {
24
25
  forceUrl?: string;
25
26
  headers?: Record<string, string>;
26
27
  params?: Record<string, string>;
28
+ h2Session?: http2.ClientHttp2Session | null;
27
29
  } & Sandbox;
28
30
  export type SandboxUpdateMetadata = {
29
31
  labels?: Record<string, string>;
@@ -1,6 +1,7 @@
1
1
  import { Function } from "../client/client.js";
2
2
  import { ToolOptions } from "./mcpTool.js";
3
3
  import { Tool } from "./types.js";
4
+ export { McpTool } from "./mcpTool.js";
4
5
  export type { ToolOptions };
5
6
  export declare const getTool: (name: string, options?: number | ToolOptions) => Promise<Tool[]>;
6
7
  export declare class BLTools {