@posthog/agent 2.3.663 → 2.3.675

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.663",
9474
+ version: "2.3.675",
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();
@@ -14633,11 +14636,25 @@ var signedCommitTool = defineLocalTool({
14633
14636
  description: SIGNED_COMMIT_TOOL_DESCRIPTION,
14634
14637
  schema: signedCommitToolSchema,
14635
14638
  alwaysLoad: true,
14636
- isEnabled: (ctx, meta) => isCloudRun(meta) && !!ctx.token,
14637
- handler: (ctx, args2) => runSignedCommitTool(
14638
- { cwd: ctx.cwd, token: ctx.token ?? "", taskId: ctx.taskId },
14639
- args2
14640
- )
14639
+ isEnabled: (_ctx, meta) => isCloudRun(meta),
14640
+ handler: (ctx, args2) => {
14641
+ const token = ctx.token ?? resolveGithubToken();
14642
+ if (!token) {
14643
+ return Promise.resolve({
14644
+ content: [
14645
+ {
14646
+ type: "text",
14647
+ text: `${SIGNED_COMMIT_TOOL_NAME} failed: no GitHub token in env (GH_TOKEN/GITHUB_TOKEN)`
14648
+ }
14649
+ ],
14650
+ isError: true
14651
+ });
14652
+ }
14653
+ return runSignedCommitTool(
14654
+ { cwd: ctx.cwd, token, taskId: ctx.taskId },
14655
+ args2
14656
+ );
14657
+ }
14641
14658
  });
14642
14659
 
14643
14660
  // src/adapters/local-tools/index.ts
@@ -23960,6 +23977,7 @@ var AgentServer = class {
23960
23977
  sessionId: payload.run_id,
23961
23978
  taskRunId: payload.run_id,
23962
23979
  taskId: payload.task_id,
23980
+ environment: "cloud",
23963
23981
  systemPrompt: sessionSystemPrompt,
23964
23982
  ...this.config.model && { model: this.config.model },
23965
23983
  allowedDomains: this.config.allowedDomains,