@giselles-ai/sandbox-agent 0.1.12 → 0.1.13

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.
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ declare class Agent {
17
17
  path: string;
18
18
  content: Buffer;
19
19
  }>): this;
20
+ setAgentMd(content: string | Buffer): this;
20
21
  runCommands(commands: Array<{
21
22
  cmd: string;
22
23
  args?: string[];
package/dist/index.js CHANGED
@@ -34,6 +34,13 @@ var Agent = class _Agent {
34
34
  });
35
35
  return this;
36
36
  }
37
+ setAgentMd(content) {
38
+ const buffer = typeof content === "string" ? Buffer.from(content) : content;
39
+ console.log(`[agent] setAgentMd called, content length=${buffer.length}`);
40
+ return this.addFiles([
41
+ { path: "/home/vercel-sandbox/AGENTS.md", content: buffer }
42
+ ]);
43
+ }
37
44
  runCommands(commands) {
38
45
  for (const command of commands) {
39
46
  this._pendingOps.push({
@@ -45,6 +52,9 @@ var Agent = class _Agent {
45
52
  return this;
46
53
  }
47
54
  async prepare() {
55
+ console.log(
56
+ `[agent] prepare called, dirty=${this.dirty}, pendingOps=${this._pendingOps.length}`
57
+ );
48
58
  if (!this.dirty) {
49
59
  return;
50
60
  }
@@ -66,6 +76,7 @@ var Agent = class _Agent {
66
76
  }
67
77
  }
68
78
  const snapshot = await sandbox.snapshot();
79
+ console.log(`[agent] prepare done, new snapshotId=${snapshot.snapshotId}`);
69
80
  this._snapshotId = snapshot.snapshotId;
70
81
  this._pendingOps = [];
71
82
  }
@@ -248,8 +259,6 @@ function createCodexAgent(options = {}) {
248
259
  const browserToolRelayUrl = options.tools?.browser?.relayUrl?.trim();
249
260
  if (browserToolEnabled) {
250
261
  requiredEnv(env, "BROWSER_TOOL_RELAY_URL");
251
- requiredEnv(env, "BROWSER_TOOL_RELAY_SESSION_ID");
252
- requiredEnv(env, "BROWSER_TOOL_RELAY_TOKEN");
253
262
  }
254
263
  if (browserToolEnabled && !browserToolRelayUrl) {
255
264
  throw new Error("tools.browser.relayUrl is empty.");
@@ -261,9 +270,13 @@ function createCodexAgent(options = {}) {
261
270
  if (!browserToolEnabled) {
262
271
  return;
263
272
  }
264
- requiredEnv(env, "VERCEL_OIDC_TOKEN");
265
273
  assertBrowserToolRelayCredentials(_input.input);
266
- await patchCodexConfigTransportEnv(_input.sandbox, env);
274
+ const patchEnv = {
275
+ ...env,
276
+ BROWSER_TOOL_RELAY_SESSION_ID: _input.input.relay_session_id,
277
+ BROWSER_TOOL_RELAY_TOKEN: _input.input.relay_token
278
+ };
279
+ await patchCodexConfigTransportEnv(_input.sandbox, patchEnv);
267
280
  },
268
281
  createCommand({ input }) {
269
282
  const args = ["exec"];
@@ -361,8 +374,6 @@ function createGeminiAgent(options = {}) {
361
374
  const browserToolRelayUrl = options.tools?.browser?.relayUrl?.trim();
362
375
  if (browserToolEnabled) {
363
376
  requiredEnv2(env, "BROWSER_TOOL_RELAY_URL");
364
- requiredEnv2(env, "BROWSER_TOOL_RELAY_SESSION_ID");
365
- requiredEnv2(env, "BROWSER_TOOL_RELAY_TOKEN");
366
377
  }
367
378
  if (browserToolEnabled && !browserToolRelayUrl) {
368
379
  throw new Error("tools.browser.relayUrl is empty.");
@@ -374,9 +385,13 @@ function createGeminiAgent(options = {}) {
374
385
  if (!browserToolEnabled) {
375
386
  return;
376
387
  }
377
- requiredEnv2(env, "VERCEL_OIDC_TOKEN");
378
388
  assertBrowserToolRelayCredentials2(input);
379
- await patchGeminiSettingsTransportEnv(sandbox, env);
389
+ const patchEnv = {
390
+ ...env,
391
+ BROWSER_TOOL_RELAY_SESSION_ID: input.relay_session_id,
392
+ BROWSER_TOOL_RELAY_TOKEN: input.relay_token
393
+ };
394
+ await patchGeminiSettingsTransportEnv(sandbox, patchEnv);
380
395
  },
381
396
  createCommand({ input }) {
382
397
  const args = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giselles-ai/sandbox-agent",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "Apache-2.0",