@posthog/agent 2.3.658 → 2.3.670

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.
@@ -9471,7 +9471,7 @@ var import_zod4 = require("zod");
9471
9471
  // package.json
9472
9472
  var package_default = {
9473
9473
  name: "@posthog/agent",
9474
- version: "2.3.658",
9474
+ version: "2.3.670",
9475
9475
  repository: "https://github.com/PostHog/code",
9476
9476
  description: "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
9477
9477
  exports: {
@@ -14415,7 +14415,10 @@ async function withTimeout(operation, timeoutMs) {
14415
14415
  var IS_ROOT = typeof process !== "undefined" && (process.geteuid?.() ?? process.getuid?.()) === 0;
14416
14416
  var ALLOW_BYPASS = !IS_ROOT || !!process.env.IS_SANDBOX;
14417
14417
  function isCloudRun(meta) {
14418
- return !!process.env.IS_SANDBOX || !!meta?.taskRunId;
14418
+ if (meta?.environment) {
14419
+ return meta.environment === "cloud";
14420
+ }
14421
+ return !!process.env.IS_SANDBOX;
14419
14422
  }
14420
14423
  function resolveGithubToken() {
14421
14424
  return readGithubTokenFromEnv();
@@ -19503,6 +19506,10 @@ function buildConfigArgs(options) {
19503
19506
  if (options.reasoningEffort) {
19504
19507
  args2.push("-c", `model_reasoning_effort="${options.reasoningEffort}"`);
19505
19508
  }
19509
+ if (options.additionalDirectories?.length) {
19510
+ const escaped = options.additionalDirectories.map((p) => `"${p.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`).join(",");
19511
+ args2.push("-c", `sandbox_workspace_write.writable_roots=[${escaped}]`);
19512
+ }
19506
19513
  if (options.instructions) {
19507
19514
  const escaped = options.instructions.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/"/g, '\\"');
19508
19515
  args2.push("-c", `instructions="${escaped}"`);
@@ -23956,6 +23963,7 @@ var AgentServer = class {
23956
23963
  sessionId: payload.run_id,
23957
23964
  taskRunId: payload.run_id,
23958
23965
  taskId: payload.task_id,
23966
+ environment: "cloud",
23959
23967
  systemPrompt: sessionSystemPrompt,
23960
23968
  ...this.config.model && { model: this.config.model },
23961
23969
  allowedDomains: this.config.allowedDomains,