@integrity-labs/agt-cli 0.28.1260 → 0.28.1261

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 (35) hide show
  1. package/dist/{api-client-PXVHBJBB.js → api-client-2YLFNHFZ.js} +3 -3
  2. package/dist/bin/agt.js +7 -7
  3. package/dist/{chunk-UKZ3NXB7.js → chunk-335HKIDZ.js} +2 -2
  4. package/dist/{chunk-7EEU3X3T.js → chunk-6NHFZYUP.js} +3 -3
  5. package/dist/{chunk-E7DKUEXC.js → chunk-I2NQQOMD.js} +3 -3
  6. package/dist/{chunk-LLVL6LIB.js → chunk-JYSPPCHG.js} +2 -2
  7. package/dist/{chunk-UQLSI3C7.js → chunk-QFLR5EFT.js} +97 -5
  8. package/dist/chunk-QFLR5EFT.js.map +1 -0
  9. package/dist/{chunk-NABJJPLW.js → chunk-ZEJUBTXJ.js} +441 -254
  10. package/dist/chunk-ZEJUBTXJ.js.map +1 -0
  11. package/dist/{claude-code-updater-OXTQF5E5.js → claude-code-updater-B2BWPRFE.js} +3 -3
  12. package/dist/{claude-pair-runtime-BBOAF76W.js → claude-pair-runtime-FNDHAPXR.js} +3 -3
  13. package/dist/lib/manager-worker.js +580 -427
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +93 -1
  16. package/dist/mcp/index.js +93 -1
  17. package/dist/mcp/origami.js +93 -1
  18. package/dist/mcp/slack-channel.js +93 -1
  19. package/dist/mcp/telegram-channel.js +93 -1
  20. package/dist/{persistent-session-XPDKIBEM.js → persistent-session-LHQLLU4U.js} +4 -4
  21. package/dist/{responsiveness-probe-4B6Y2446.js → responsiveness-probe-KDSNPKUY.js} +4 -4
  22. package/dist/{session-auth-dead-4C7AK3A6.js → session-auth-dead-3IHR4M2B.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-NABJJPLW.js.map +0 -1
  25. package/dist/chunk-UQLSI3C7.js.map +0 -1
  26. /package/dist/{api-client-PXVHBJBB.js.map → api-client-2YLFNHFZ.js.map} +0 -0
  27. /package/dist/{chunk-UKZ3NXB7.js.map → chunk-335HKIDZ.js.map} +0 -0
  28. /package/dist/{chunk-7EEU3X3T.js.map → chunk-6NHFZYUP.js.map} +0 -0
  29. /package/dist/{chunk-E7DKUEXC.js.map → chunk-I2NQQOMD.js.map} +0 -0
  30. /package/dist/{chunk-LLVL6LIB.js.map → chunk-JYSPPCHG.js.map} +0 -0
  31. /package/dist/{claude-code-updater-OXTQF5E5.js.map → claude-code-updater-B2BWPRFE.js.map} +0 -0
  32. /package/dist/{claude-pair-runtime-BBOAF76W.js.map → claude-pair-runtime-FNDHAPXR.js.map} +0 -0
  33. /package/dist/{persistent-session-XPDKIBEM.js.map → persistent-session-LHQLLU4U.js.map} +0 -0
  34. /package/dist/{responsiveness-probe-4B6Y2446.js.map → responsiveness-probe-KDSNPKUY.js.map} +0 -0
  35. /package/dist/{session-auth-dead-4C7AK3A6.js.map → session-auth-dead-3IHR4M2B.js.map} +0 -0
@@ -44457,7 +44457,10 @@ var GITHUB_EVENT_RULES = {
44457
44457
  pull_request_review: { actions: ["submitted"] },
44458
44458
  check_suite: { actions: ["completed"] },
44459
44459
  issues: { actions: ["opened", "closed"] },
44460
- issue_comment: { actions: ["created"] }
44460
+ issue_comment: { actions: ["created"] },
44461
+ // ENG-12123 (CS-2564): a deployment's status changed. GitHub sends one
44462
+ // deployment_status event per state change, always with action `created`.
44463
+ deployment_status: { actions: ["created"] }
44461
44464
  };
44462
44465
  var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
44463
44466
  var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
@@ -44480,6 +44483,28 @@ var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
44480
44483
  "startup_failure"
44481
44484
  ]);
44482
44485
  var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
44486
+ var DEPLOYMENT_STATES = /* @__PURE__ */ new Set(["success", "failure", "error", "pending", "in_progress", "queued", "inactive"]);
44487
+ var ENVIRONMENT_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._/:-]{0,63}$/;
44488
+ var ACTIONS_RUN_PATH = /^\/([^/]+)\/([^/]+)\/actions\/runs\/([1-9][0-9]{0,18})(?:\/job\/([1-9][0-9]{0,18}))?\/?$/;
44489
+ function githubActionsRunUrl(v, repo) {
44490
+ const s = str(v);
44491
+ if (s === null || s.length > 500)
44492
+ return null;
44493
+ let u;
44494
+ try {
44495
+ u = new URL(s);
44496
+ } catch {
44497
+ return null;
44498
+ }
44499
+ if (u.protocol !== "https:" || u.username || u.password || u.port || u.hostname !== "github.com")
44500
+ return null;
44501
+ const m = ACTIONS_RUN_PATH.exec(u.pathname);
44502
+ if (!m)
44503
+ return null;
44504
+ if (`${m[1]}/${m[2]}`.toLowerCase() !== repo.toLowerCase())
44505
+ return null;
44506
+ return `https://github.com/${repo}/actions/runs/${m[3]}${m[4] ? `/job/${m[4]}` : ""}`;
44507
+ }
44483
44508
  function asDict(v) {
44484
44509
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
44485
44510
  }
@@ -44625,6 +44650,36 @@ function extractGithubFacts(event, payload) {
44625
44650
  summary: `Issue #${n2} ${action} in ${repo}`
44626
44651
  };
44627
44652
  }
44653
+ if (event === "deployment_status") {
44654
+ const status = asDict(root["deployment_status"]);
44655
+ const deployment = asDict(root["deployment"]);
44656
+ if (!status || !deployment)
44657
+ return null;
44658
+ const state = inSet(status["state"], DEPLOYMENT_STATES);
44659
+ const environment = shaped(status["environment"], ENVIRONMENT_TOKEN) ?? shaped(deployment["environment"], ENVIRONMENT_TOKEN);
44660
+ details.push(["Environment", environment ?? "(name withheld: not a plain token)"]);
44661
+ details.push(["State", state ?? "unknown"]);
44662
+ const deploymentId = posInt(deployment["id"]);
44663
+ if (deploymentId !== null)
44664
+ details.push(["Deployment id", String(deploymentId)]);
44665
+ const sha = shaped(str(deployment["sha"])?.toLowerCase(), SHA);
44666
+ if (sha)
44667
+ details.push(["Commit", sha]);
44668
+ const creator = shaped(asDict(status["creator"])?.["login"], LOGIN);
44669
+ if (creator)
44670
+ details.push(["Status set by", creator]);
44671
+ const link = githubActionsRunUrl(status["log_url"], repo) ?? githubActionsRunUrl(status["target_url"], repo);
44672
+ return {
44673
+ event,
44674
+ action,
44675
+ repo,
44676
+ subject: null,
44677
+ url: link ?? `${base}/deployments`,
44678
+ sender,
44679
+ details,
44680
+ summary: `Deployment to ${environment ?? "an environment"} ${state ?? "updated"} in ${repo}`
44681
+ };
44682
+ }
44628
44683
  const issue2 = asDict(root["issue"]);
44629
44684
  const n = issue2 ? posInt(issue2["number"]) : null;
44630
44685
  if (!issue2 || n === null)
@@ -44801,6 +44856,43 @@ var FLAG_REGISTRY = [
44801
44856
  flagType: "boolean",
44802
44857
  defaultValue: false
44803
44858
  },
44859
+ {
44860
+ key: "scratch-sweep-held",
44861
+ description: "ENG-11877: stops ALL scratch sweeping for an agent, including the existing tree rule, for files someone has asked to keep. Resolved per agent by the manager. Sticky on the host: once seen it is written to a marker outside scratch, which keeps the agent held until heartbeats that evaluated it find the flag off for 10 minutes, so a restart or a failed flag read cannot let a sweep through. A host only honours it once its CLI has the reader: check reach before relying on it. Off is the safe default for everyone else.",
44862
+ sensitive: true,
44863
+ flagType: "boolean",
44864
+ defaultValue: false,
44865
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
44866
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
44867
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
44868
+ since: "0.28.999999"
44869
+ },
44870
+ {
44871
+ key: "scratch-sweep-per-file",
44872
+ description: "ENG-11877: also expire old files inside scratch folders still in use, instead of keeping a whole folder while anything in it is fresh. IRREVERSIBLE on its first pass: every file unchanged for 7 days goes, customer documents included, so arm it per agent and read scratch-sweep-dry-run first. Off = the tree rule only.",
44873
+ sensitive: true,
44874
+ // CodeRabbit on #7378: `sensitive` only forces a confirmation; it does not say
44875
+ // WHO. Its first pass irreversibly deletes old customer files, and arming it is
44876
+ // Brad's rollout decision (ENG-11877), so an org owner/admin must not be able to
44877
+ // switch it on for their own agents. Only the cross-org admin route can write it.
44878
+ platformAdminOnly: true,
44879
+ flagType: "boolean",
44880
+ defaultValue: false,
44881
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
44882
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
44883
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
44884
+ since: "0.28.999999"
44885
+ },
44886
+ {
44887
+ key: "scratch-sweep-dry-run",
44888
+ description: "ENG-11877: count what scratch-sweep-per-file would remove and log it to manager.log every 6 hours ([scratch] [sweep-dry-run]). Metadata only: never opens a file, never logs a name, removes nothing extra.",
44889
+ flagType: "boolean",
44890
+ defaultValue: false,
44891
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
44892
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
44893
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
44894
+ since: "0.28.999999"
44895
+ },
44804
44896
  {
44805
44897
  key: "broker-read-jobs",
44806
44898
  description: `Slow broker READ tools finish in a background job (ENG-11476, ADR-0129). When on for an org, an opted-in read tool (Pronto Xi first) that misses an 18s grace window answers "still running, call again with the same arguments" and finishes in the broker-read-job worker instead of timing out. Off = today's synchronous call, so false is the safe value. Evaluated in the API per org, team and agent.`,
package/dist/mcp/index.js CHANGED
@@ -30139,7 +30139,10 @@ var GITHUB_EVENT_RULES = {
30139
30139
  pull_request_review: { actions: ["submitted"] },
30140
30140
  check_suite: { actions: ["completed"] },
30141
30141
  issues: { actions: ["opened", "closed"] },
30142
- issue_comment: { actions: ["created"] }
30142
+ issue_comment: { actions: ["created"] },
30143
+ // ENG-12123 (CS-2564): a deployment's status changed. GitHub sends one
30144
+ // deployment_status event per state change, always with action `created`.
30145
+ deployment_status: { actions: ["created"] }
30143
30146
  };
30144
30147
  var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
30145
30148
  var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
@@ -30162,6 +30165,28 @@ var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
30162
30165
  "startup_failure"
30163
30166
  ]);
30164
30167
  var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
30168
+ var DEPLOYMENT_STATES = /* @__PURE__ */ new Set(["success", "failure", "error", "pending", "in_progress", "queued", "inactive"]);
30169
+ var ENVIRONMENT_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._/:-]{0,63}$/;
30170
+ var ACTIONS_RUN_PATH = /^\/([^/]+)\/([^/]+)\/actions\/runs\/([1-9][0-9]{0,18})(?:\/job\/([1-9][0-9]{0,18}))?\/?$/;
30171
+ function githubActionsRunUrl(v, repo) {
30172
+ const s = str(v);
30173
+ if (s === null || s.length > 500)
30174
+ return null;
30175
+ let u;
30176
+ try {
30177
+ u = new URL(s);
30178
+ } catch {
30179
+ return null;
30180
+ }
30181
+ if (u.protocol !== "https:" || u.username || u.password || u.port || u.hostname !== "github.com")
30182
+ return null;
30183
+ const m = ACTIONS_RUN_PATH.exec(u.pathname);
30184
+ if (!m)
30185
+ return null;
30186
+ if (`${m[1]}/${m[2]}`.toLowerCase() !== repo.toLowerCase())
30187
+ return null;
30188
+ return `https://github.com/${repo}/actions/runs/${m[3]}${m[4] ? `/job/${m[4]}` : ""}`;
30189
+ }
30165
30190
  function asDict(v) {
30166
30191
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
30167
30192
  }
@@ -30307,6 +30332,36 @@ function extractGithubFacts(event, payload) {
30307
30332
  summary: `Issue #${n2} ${action} in ${repo}`
30308
30333
  };
30309
30334
  }
30335
+ if (event === "deployment_status") {
30336
+ const status = asDict(root["deployment_status"]);
30337
+ const deployment = asDict(root["deployment"]);
30338
+ if (!status || !deployment)
30339
+ return null;
30340
+ const state = inSet(status["state"], DEPLOYMENT_STATES);
30341
+ const environment = shaped(status["environment"], ENVIRONMENT_TOKEN) ?? shaped(deployment["environment"], ENVIRONMENT_TOKEN);
30342
+ details.push(["Environment", environment ?? "(name withheld: not a plain token)"]);
30343
+ details.push(["State", state ?? "unknown"]);
30344
+ const deploymentId = posInt(deployment["id"]);
30345
+ if (deploymentId !== null)
30346
+ details.push(["Deployment id", String(deploymentId)]);
30347
+ const sha = shaped(str(deployment["sha"])?.toLowerCase(), SHA);
30348
+ if (sha)
30349
+ details.push(["Commit", sha]);
30350
+ const creator = shaped(asDict(status["creator"])?.["login"], LOGIN);
30351
+ if (creator)
30352
+ details.push(["Status set by", creator]);
30353
+ const link = githubActionsRunUrl(status["log_url"], repo) ?? githubActionsRunUrl(status["target_url"], repo);
30354
+ return {
30355
+ event,
30356
+ action,
30357
+ repo,
30358
+ subject: null,
30359
+ url: link ?? `${base}/deployments`,
30360
+ sender,
30361
+ details,
30362
+ summary: `Deployment to ${environment ?? "an environment"} ${state ?? "updated"} in ${repo}`
30363
+ };
30364
+ }
30310
30365
  const issue2 = asDict(root["issue"]);
30311
30366
  const n = issue2 ? posInt(issue2["number"]) : null;
30312
30367
  if (!issue2 || n === null)
@@ -30483,6 +30538,43 @@ var FLAG_REGISTRY = [
30483
30538
  flagType: "boolean",
30484
30539
  defaultValue: false
30485
30540
  },
30541
+ {
30542
+ key: "scratch-sweep-held",
30543
+ description: "ENG-11877: stops ALL scratch sweeping for an agent, including the existing tree rule, for files someone has asked to keep. Resolved per agent by the manager. Sticky on the host: once seen it is written to a marker outside scratch, which keeps the agent held until heartbeats that evaluated it find the flag off for 10 minutes, so a restart or a failed flag read cannot let a sweep through. A host only honours it once its CLI has the reader: check reach before relying on it. Off is the safe default for everyone else.",
30544
+ sensitive: true,
30545
+ flagType: "boolean",
30546
+ defaultValue: false,
30547
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
30548
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
30549
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
30550
+ since: "0.28.999999"
30551
+ },
30552
+ {
30553
+ key: "scratch-sweep-per-file",
30554
+ description: "ENG-11877: also expire old files inside scratch folders still in use, instead of keeping a whole folder while anything in it is fresh. IRREVERSIBLE on its first pass: every file unchanged for 7 days goes, customer documents included, so arm it per agent and read scratch-sweep-dry-run first. Off = the tree rule only.",
30555
+ sensitive: true,
30556
+ // CodeRabbit on #7378: `sensitive` only forces a confirmation; it does not say
30557
+ // WHO. Its first pass irreversibly deletes old customer files, and arming it is
30558
+ // Brad's rollout decision (ENG-11877), so an org owner/admin must not be able to
30559
+ // switch it on for their own agents. Only the cross-org admin route can write it.
30560
+ platformAdminOnly: true,
30561
+ flagType: "boolean",
30562
+ defaultValue: false,
30563
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
30564
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
30565
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
30566
+ since: "0.28.999999"
30567
+ },
30568
+ {
30569
+ key: "scratch-sweep-dry-run",
30570
+ description: "ENG-11877: count what scratch-sweep-per-file would remove and log it to manager.log every 6 hours ([scratch] [sweep-dry-run]). Metadata only: never opens a file, never logs a name, removes nothing extra.",
30571
+ flagType: "boolean",
30572
+ defaultValue: false,
30573
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
30574
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
30575
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
30576
+ since: "0.28.999999"
30577
+ },
30486
30578
  {
30487
30579
  key: "broker-read-jobs",
30488
30580
  description: `Slow broker READ tools finish in a background job (ENG-11476, ADR-0129). When on for an org, an opted-in read tool (Pronto Xi first) that misses an 18s grace window answers "still running, call again with the same arguments" and finishes in the broker-read-job worker instead of timing out. Off = today's synchronous call, so false is the safe value. Evaluated in the API per org, team and agent.`,
@@ -43941,7 +43941,10 @@ var GITHUB_EVENT_RULES = {
43941
43941
  pull_request_review: { actions: ["submitted"] },
43942
43942
  check_suite: { actions: ["completed"] },
43943
43943
  issues: { actions: ["opened", "closed"] },
43944
- issue_comment: { actions: ["created"] }
43944
+ issue_comment: { actions: ["created"] },
43945
+ // ENG-12123 (CS-2564): a deployment's status changed. GitHub sends one
43946
+ // deployment_status event per state change, always with action `created`.
43947
+ deployment_status: { actions: ["created"] }
43945
43948
  };
43946
43949
  var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
43947
43950
  var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
@@ -43964,6 +43967,28 @@ var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
43964
43967
  "startup_failure"
43965
43968
  ]);
43966
43969
  var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
43970
+ var DEPLOYMENT_STATES = /* @__PURE__ */ new Set(["success", "failure", "error", "pending", "in_progress", "queued", "inactive"]);
43971
+ var ENVIRONMENT_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._/:-]{0,63}$/;
43972
+ var ACTIONS_RUN_PATH = /^\/([^/]+)\/([^/]+)\/actions\/runs\/([1-9][0-9]{0,18})(?:\/job\/([1-9][0-9]{0,18}))?\/?$/;
43973
+ function githubActionsRunUrl(v, repo) {
43974
+ const s = str(v);
43975
+ if (s === null || s.length > 500)
43976
+ return null;
43977
+ let u;
43978
+ try {
43979
+ u = new URL(s);
43980
+ } catch {
43981
+ return null;
43982
+ }
43983
+ if (u.protocol !== "https:" || u.username || u.password || u.port || u.hostname !== "github.com")
43984
+ return null;
43985
+ const m = ACTIONS_RUN_PATH.exec(u.pathname);
43986
+ if (!m)
43987
+ return null;
43988
+ if (`${m[1]}/${m[2]}`.toLowerCase() !== repo.toLowerCase())
43989
+ return null;
43990
+ return `https://github.com/${repo}/actions/runs/${m[3]}${m[4] ? `/job/${m[4]}` : ""}`;
43991
+ }
43967
43992
  function asDict(v) {
43968
43993
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
43969
43994
  }
@@ -44109,6 +44134,36 @@ function extractGithubFacts(event, payload) {
44109
44134
  summary: `Issue #${n2} ${action} in ${repo}`
44110
44135
  };
44111
44136
  }
44137
+ if (event === "deployment_status") {
44138
+ const status = asDict(root["deployment_status"]);
44139
+ const deployment = asDict(root["deployment"]);
44140
+ if (!status || !deployment)
44141
+ return null;
44142
+ const state = inSet(status["state"], DEPLOYMENT_STATES);
44143
+ const environment = shaped(status["environment"], ENVIRONMENT_TOKEN) ?? shaped(deployment["environment"], ENVIRONMENT_TOKEN);
44144
+ details.push(["Environment", environment ?? "(name withheld: not a plain token)"]);
44145
+ details.push(["State", state ?? "unknown"]);
44146
+ const deploymentId = posInt(deployment["id"]);
44147
+ if (deploymentId !== null)
44148
+ details.push(["Deployment id", String(deploymentId)]);
44149
+ const sha = shaped(str(deployment["sha"])?.toLowerCase(), SHA);
44150
+ if (sha)
44151
+ details.push(["Commit", sha]);
44152
+ const creator = shaped(asDict(status["creator"])?.["login"], LOGIN);
44153
+ if (creator)
44154
+ details.push(["Status set by", creator]);
44155
+ const link = githubActionsRunUrl(status["log_url"], repo) ?? githubActionsRunUrl(status["target_url"], repo);
44156
+ return {
44157
+ event,
44158
+ action,
44159
+ repo,
44160
+ subject: null,
44161
+ url: link ?? `${base}/deployments`,
44162
+ sender,
44163
+ details,
44164
+ summary: `Deployment to ${environment ?? "an environment"} ${state ?? "updated"} in ${repo}`
44165
+ };
44166
+ }
44112
44167
  const issue2 = asDict(root["issue"]);
44113
44168
  const n = issue2 ? posInt(issue2["number"]) : null;
44114
44169
  if (!issue2 || n === null)
@@ -44285,6 +44340,43 @@ var FLAG_REGISTRY = [
44285
44340
  flagType: "boolean",
44286
44341
  defaultValue: false
44287
44342
  },
44343
+ {
44344
+ key: "scratch-sweep-held",
44345
+ description: "ENG-11877: stops ALL scratch sweeping for an agent, including the existing tree rule, for files someone has asked to keep. Resolved per agent by the manager. Sticky on the host: once seen it is written to a marker outside scratch, which keeps the agent held until heartbeats that evaluated it find the flag off for 10 minutes, so a restart or a failed flag read cannot let a sweep through. A host only honours it once its CLI has the reader: check reach before relying on it. Off is the safe default for everyone else.",
44346
+ sensitive: true,
44347
+ flagType: "boolean",
44348
+ defaultValue: false,
44349
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
44350
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
44351
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
44352
+ since: "0.28.999999"
44353
+ },
44354
+ {
44355
+ key: "scratch-sweep-per-file",
44356
+ description: "ENG-11877: also expire old files inside scratch folders still in use, instead of keeping a whole folder while anything in it is fresh. IRREVERSIBLE on its first pass: every file unchanged for 7 days goes, customer documents included, so arm it per agent and read scratch-sweep-dry-run first. Off = the tree rule only.",
44357
+ sensitive: true,
44358
+ // CodeRabbit on #7378: `sensitive` only forces a confirmation; it does not say
44359
+ // WHO. Its first pass irreversibly deletes old customer files, and arming it is
44360
+ // Brad's rollout decision (ENG-11877), so an org owner/admin must not be able to
44361
+ // switch it on for their own agents. Only the cross-org admin route can write it.
44362
+ platformAdminOnly: true,
44363
+ flagType: "boolean",
44364
+ defaultValue: false,
44365
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
44366
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
44367
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
44368
+ since: "0.28.999999"
44369
+ },
44370
+ {
44371
+ key: "scratch-sweep-dry-run",
44372
+ description: "ENG-11877: count what scratch-sweep-per-file would remove and log it to manager.log every 6 hours ([scratch] [sweep-dry-run]). Metadata only: never opens a file, never logs a name, removes nothing extra.",
44373
+ flagType: "boolean",
44374
+ defaultValue: false,
44375
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
44376
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
44377
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
44378
+ since: "0.28.999999"
44379
+ },
44288
44380
  {
44289
44381
  key: "broker-read-jobs",
44290
44382
  description: `Slow broker READ tools finish in a background job (ENG-11476, ADR-0129). When on for an org, an opted-in read tool (Pronto Xi first) that misses an 18s grace window answers "still running, call again with the same arguments" and finishes in the broker-read-job worker instead of timing out. Off = today's synchronous call, so false is the safe value. Evaluated in the API per org, team and agent.`,
@@ -38796,7 +38796,10 @@ var GITHUB_EVENT_RULES = {
38796
38796
  pull_request_review: { actions: ["submitted"] },
38797
38797
  check_suite: { actions: ["completed"] },
38798
38798
  issues: { actions: ["opened", "closed"] },
38799
- issue_comment: { actions: ["created"] }
38799
+ issue_comment: { actions: ["created"] },
38800
+ // ENG-12123 (CS-2564): a deployment's status changed. GitHub sends one
38801
+ // deployment_status event per state change, always with action `created`.
38802
+ deployment_status: { actions: ["created"] }
38800
38803
  };
38801
38804
  var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
38802
38805
  var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
@@ -38819,6 +38822,28 @@ var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
38819
38822
  "startup_failure"
38820
38823
  ]);
38821
38824
  var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
38825
+ var DEPLOYMENT_STATES = /* @__PURE__ */ new Set(["success", "failure", "error", "pending", "in_progress", "queued", "inactive"]);
38826
+ var ENVIRONMENT_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._/:-]{0,63}$/;
38827
+ var ACTIONS_RUN_PATH = /^\/([^/]+)\/([^/]+)\/actions\/runs\/([1-9][0-9]{0,18})(?:\/job\/([1-9][0-9]{0,18}))?\/?$/;
38828
+ function githubActionsRunUrl(v, repo) {
38829
+ const s = str(v);
38830
+ if (s === null || s.length > 500)
38831
+ return null;
38832
+ let u;
38833
+ try {
38834
+ u = new URL(s);
38835
+ } catch {
38836
+ return null;
38837
+ }
38838
+ if (u.protocol !== "https:" || u.username || u.password || u.port || u.hostname !== "github.com")
38839
+ return null;
38840
+ const m = ACTIONS_RUN_PATH.exec(u.pathname);
38841
+ if (!m)
38842
+ return null;
38843
+ if (`${m[1]}/${m[2]}`.toLowerCase() !== repo.toLowerCase())
38844
+ return null;
38845
+ return `https://github.com/${repo}/actions/runs/${m[3]}${m[4] ? `/job/${m[4]}` : ""}`;
38846
+ }
38822
38847
  function asDict(v) {
38823
38848
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
38824
38849
  }
@@ -38964,6 +38989,36 @@ function extractGithubFacts(event, payload) {
38964
38989
  summary: `Issue #${n2} ${action} in ${repo}`
38965
38990
  };
38966
38991
  }
38992
+ if (event === "deployment_status") {
38993
+ const status = asDict(root["deployment_status"]);
38994
+ const deployment = asDict(root["deployment"]);
38995
+ if (!status || !deployment)
38996
+ return null;
38997
+ const state = inSet(status["state"], DEPLOYMENT_STATES);
38998
+ const environment = shaped(status["environment"], ENVIRONMENT_TOKEN) ?? shaped(deployment["environment"], ENVIRONMENT_TOKEN);
38999
+ details.push(["Environment", environment ?? "(name withheld: not a plain token)"]);
39000
+ details.push(["State", state ?? "unknown"]);
39001
+ const deploymentId = posInt(deployment["id"]);
39002
+ if (deploymentId !== null)
39003
+ details.push(["Deployment id", String(deploymentId)]);
39004
+ const sha = shaped(str(deployment["sha"])?.toLowerCase(), SHA);
39005
+ if (sha)
39006
+ details.push(["Commit", sha]);
39007
+ const creator = shaped(asDict(status["creator"])?.["login"], LOGIN);
39008
+ if (creator)
39009
+ details.push(["Status set by", creator]);
39010
+ const link = githubActionsRunUrl(status["log_url"], repo) ?? githubActionsRunUrl(status["target_url"], repo);
39011
+ return {
39012
+ event,
39013
+ action,
39014
+ repo,
39015
+ subject: null,
39016
+ url: link ?? `${base}/deployments`,
39017
+ sender,
39018
+ details,
39019
+ summary: `Deployment to ${environment ?? "an environment"} ${state ?? "updated"} in ${repo}`
39020
+ };
39021
+ }
38967
39022
  const issue2 = asDict(root["issue"]);
38968
39023
  const n = issue2 ? posInt(issue2["number"]) : null;
38969
39024
  if (!issue2 || n === null)
@@ -39140,6 +39195,43 @@ var FLAG_REGISTRY = [
39140
39195
  flagType: "boolean",
39141
39196
  defaultValue: false
39142
39197
  },
39198
+ {
39199
+ key: "scratch-sweep-held",
39200
+ description: "ENG-11877: stops ALL scratch sweeping for an agent, including the existing tree rule, for files someone has asked to keep. Resolved per agent by the manager. Sticky on the host: once seen it is written to a marker outside scratch, which keeps the agent held until heartbeats that evaluated it find the flag off for 10 minutes, so a restart or a failed flag read cannot let a sweep through. A host only honours it once its CLI has the reader: check reach before relying on it. Off is the safe default for everyone else.",
39201
+ sensitive: true,
39202
+ flagType: "boolean",
39203
+ defaultValue: false,
39204
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
39205
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
39206
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
39207
+ since: "0.28.999999"
39208
+ },
39209
+ {
39210
+ key: "scratch-sweep-per-file",
39211
+ description: "ENG-11877: also expire old files inside scratch folders still in use, instead of keeping a whole folder while anything in it is fresh. IRREVERSIBLE on its first pass: every file unchanged for 7 days goes, customer documents included, so arm it per agent and read scratch-sweep-dry-run first. Off = the tree rule only.",
39212
+ sensitive: true,
39213
+ // CodeRabbit on #7378: `sensitive` only forces a confirmation; it does not say
39214
+ // WHO. Its first pass irreversibly deletes old customer files, and arming it is
39215
+ // Brad's rollout decision (ENG-11877), so an org owner/admin must not be able to
39216
+ // switch it on for their own agents. Only the cross-org admin route can write it.
39217
+ platformAdminOnly: true,
39218
+ flagType: "boolean",
39219
+ defaultValue: false,
39220
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
39221
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
39222
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
39223
+ since: "0.28.999999"
39224
+ },
39225
+ {
39226
+ key: "scratch-sweep-dry-run",
39227
+ description: "ENG-11877: count what scratch-sweep-per-file would remove and log it to manager.log every 6 hours ([scratch] [sweep-dry-run]). Metadata only: never opens a file, never logs a name, removes nothing extra.",
39228
+ flagType: "boolean",
39229
+ defaultValue: false,
39230
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
39231
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
39232
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
39233
+ since: "0.28.999999"
39234
+ },
39143
39235
  {
39144
39236
  key: "broker-read-jobs",
39145
39237
  description: `Slow broker READ tools finish in a background job (ENG-11476, ADR-0129). When on for an org, an opted-in read tool (Pronto Xi first) that misses an 18s grace window answers "still running, call again with the same arguments" and finishes in the broker-read-job worker instead of timing out. Off = today's synchronous call, so false is the safe value. Evaluated in the API per org, team and agent.`,
@@ -39242,7 +39242,10 @@ var GITHUB_EVENT_RULES = {
39242
39242
  pull_request_review: { actions: ["submitted"] },
39243
39243
  check_suite: { actions: ["completed"] },
39244
39244
  issues: { actions: ["opened", "closed"] },
39245
- issue_comment: { actions: ["created"] }
39245
+ issue_comment: { actions: ["created"] },
39246
+ // ENG-12123 (CS-2564): a deployment's status changed. GitHub sends one
39247
+ // deployment_status event per state change, always with action `created`.
39248
+ deployment_status: { actions: ["created"] }
39246
39249
  };
39247
39250
  var GITHUB_WEBHOOK_EVENTS = Object.keys(GITHUB_EVENT_RULES);
39248
39251
  var REPO_FULL_NAME = /^[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})\/[A-Za-z0-9._-]{1,100}$/;
@@ -39265,6 +39268,28 @@ var CHECK_CONCLUSIONS = /* @__PURE__ */ new Set([
39265
39268
  "startup_failure"
39266
39269
  ]);
39267
39270
  var ISSUE_STATE_REASONS = /* @__PURE__ */ new Set(["completed", "not_planned", "reopened", "duplicate"]);
39271
+ var DEPLOYMENT_STATES = /* @__PURE__ */ new Set(["success", "failure", "error", "pending", "in_progress", "queued", "inactive"]);
39272
+ var ENVIRONMENT_TOKEN = /^[A-Za-z0-9][A-Za-z0-9._/:-]{0,63}$/;
39273
+ var ACTIONS_RUN_PATH = /^\/([^/]+)\/([^/]+)\/actions\/runs\/([1-9][0-9]{0,18})(?:\/job\/([1-9][0-9]{0,18}))?\/?$/;
39274
+ function githubActionsRunUrl(v, repo) {
39275
+ const s = str(v);
39276
+ if (s === null || s.length > 500)
39277
+ return null;
39278
+ let u;
39279
+ try {
39280
+ u = new URL(s);
39281
+ } catch {
39282
+ return null;
39283
+ }
39284
+ if (u.protocol !== "https:" || u.username || u.password || u.port || u.hostname !== "github.com")
39285
+ return null;
39286
+ const m = ACTIONS_RUN_PATH.exec(u.pathname);
39287
+ if (!m)
39288
+ return null;
39289
+ if (`${m[1]}/${m[2]}`.toLowerCase() !== repo.toLowerCase())
39290
+ return null;
39291
+ return `https://github.com/${repo}/actions/runs/${m[3]}${m[4] ? `/job/${m[4]}` : ""}`;
39292
+ }
39268
39293
  function asDict(v) {
39269
39294
  return v !== null && typeof v === "object" && !Array.isArray(v) ? v : null;
39270
39295
  }
@@ -39410,6 +39435,36 @@ function extractGithubFacts(event, payload) {
39410
39435
  summary: `Issue #${n2} ${action} in ${repo}`
39411
39436
  };
39412
39437
  }
39438
+ if (event === "deployment_status") {
39439
+ const status = asDict(root["deployment_status"]);
39440
+ const deployment = asDict(root["deployment"]);
39441
+ if (!status || !deployment)
39442
+ return null;
39443
+ const state = inSet(status["state"], DEPLOYMENT_STATES);
39444
+ const environment = shaped(status["environment"], ENVIRONMENT_TOKEN) ?? shaped(deployment["environment"], ENVIRONMENT_TOKEN);
39445
+ details.push(["Environment", environment ?? "(name withheld: not a plain token)"]);
39446
+ details.push(["State", state ?? "unknown"]);
39447
+ const deploymentId = posInt(deployment["id"]);
39448
+ if (deploymentId !== null)
39449
+ details.push(["Deployment id", String(deploymentId)]);
39450
+ const sha = shaped(str(deployment["sha"])?.toLowerCase(), SHA);
39451
+ if (sha)
39452
+ details.push(["Commit", sha]);
39453
+ const creator = shaped(asDict(status["creator"])?.["login"], LOGIN);
39454
+ if (creator)
39455
+ details.push(["Status set by", creator]);
39456
+ const link = githubActionsRunUrl(status["log_url"], repo) ?? githubActionsRunUrl(status["target_url"], repo);
39457
+ return {
39458
+ event,
39459
+ action,
39460
+ repo,
39461
+ subject: null,
39462
+ url: link ?? `${base}/deployments`,
39463
+ sender,
39464
+ details,
39465
+ summary: `Deployment to ${environment ?? "an environment"} ${state ?? "updated"} in ${repo}`
39466
+ };
39467
+ }
39413
39468
  const issue2 = asDict(root["issue"]);
39414
39469
  const n = issue2 ? posInt(issue2["number"]) : null;
39415
39470
  if (!issue2 || n === null)
@@ -39586,6 +39641,43 @@ var FLAG_REGISTRY = [
39586
39641
  flagType: "boolean",
39587
39642
  defaultValue: false
39588
39643
  },
39644
+ {
39645
+ key: "scratch-sweep-held",
39646
+ description: "ENG-11877: stops ALL scratch sweeping for an agent, including the existing tree rule, for files someone has asked to keep. Resolved per agent by the manager. Sticky on the host: once seen it is written to a marker outside scratch, which keeps the agent held until heartbeats that evaluated it find the flag off for 10 minutes, so a restart or a failed flag read cannot let a sweep through. A host only honours it once its CLI has the reader: check reach before relying on it. Off is the safe default for everyone else.",
39647
+ sensitive: true,
39648
+ flagType: "boolean",
39649
+ defaultValue: false,
39650
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
39651
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
39652
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
39653
+ since: "0.28.999999"
39654
+ },
39655
+ {
39656
+ key: "scratch-sweep-per-file",
39657
+ description: "ENG-11877: also expire old files inside scratch folders still in use, instead of keeping a whole folder while anything in it is fresh. IRREVERSIBLE on its first pass: every file unchanged for 7 days goes, customer documents included, so arm it per agent and read scratch-sweep-dry-run first. Off = the tree rule only.",
39658
+ sensitive: true,
39659
+ // CodeRabbit on #7378: `sensitive` only forces a confirmation; it does not say
39660
+ // WHO. Its first pass irreversibly deletes old customer files, and arming it is
39661
+ // Brad's rollout decision (ENG-11877), so an org owner/admin must not be able to
39662
+ // switch it on for their own agents. Only the cross-org admin route can write it.
39663
+ platformAdminOnly: true,
39664
+ flagType: "boolean",
39665
+ defaultValue: false,
39666
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
39667
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
39668
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
39669
+ since: "0.28.999999"
39670
+ },
39671
+ {
39672
+ key: "scratch-sweep-dry-run",
39673
+ description: "ENG-11877: count what scratch-sweep-per-file would remove and log it to manager.log every 6 hours ([scratch] [sweep-dry-run]). Metadata only: never opens a file, never logs a name, removes nothing extra.",
39674
+ flagType: "boolean",
39675
+ defaultValue: false,
39676
+ // No published agt-cli has this reader yet, and a guessed floor would report reach
39677
+ // on hosts that can't act on it. So this reads as "no host yet" on purpose, the
39678
+ // safe direction. ENG-11877 re-pins it from the published dist after merge.
39679
+ since: "0.28.999999"
39680
+ },
39589
39681
  {
39590
39682
  key: "broker-read-jobs",
39591
39683
  description: `Slow broker READ tools finish in a background job (ENG-11476, ADR-0129). When on for an org, an opted-in read tool (Pronto Xi first) that misses an 18s grace window answers "still running, call again with the same arguments" and finishes in the broker-read-job worker instead of timing out. Off = today's synchronous call, so false is the safe value. Evaluated in the API per org, team and agent.`,
@@ -68,12 +68,12 @@ import {
68
68
  writeDirectChatSessionState,
69
69
  writeEgressAllowlist,
70
70
  writePersistentClaudeWrapper
71
- } from "./chunk-E7DKUEXC.js";
72
- import "./chunk-LLVL6LIB.js";
71
+ } from "./chunk-I2NQQOMD.js";
72
+ import "./chunk-JYSPPCHG.js";
73
73
  import "./chunk-HYQ7VOC3.js";
74
74
  import "./chunk-6HBXEJHO.js";
75
75
  import "./chunk-XWVM4KPK.js";
76
- import "./chunk-UQLSI3C7.js";
76
+ import "./chunk-QFLR5EFT.js";
77
77
  import "./chunk-AIUIMEUS.js";
78
78
  import "./chunk-DGUM43GV.js";
79
79
  export {
@@ -147,4 +147,4 @@ export {
147
147
  writeEgressAllowlist,
148
148
  writePersistentClaudeWrapper
149
149
  };
150
- //# sourceMappingURL=persistent-session-XPDKIBEM.js.map
150
+ //# sourceMappingURL=persistent-session-LHQLLU4U.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  paneLogPath
3
- } from "./chunk-E7DKUEXC.js";
4
- import "./chunk-LLVL6LIB.js";
3
+ } from "./chunk-I2NQQOMD.js";
4
+ import "./chunk-JYSPPCHG.js";
5
5
  import "./chunk-HYQ7VOC3.js";
6
6
  import "./chunk-6HBXEJHO.js";
7
7
  import "./chunk-XWVM4KPK.js";
8
- import "./chunk-UQLSI3C7.js";
8
+ import "./chunk-QFLR5EFT.js";
9
9
  import "./chunk-AIUIMEUS.js";
10
10
  import "./chunk-DGUM43GV.js";
11
11
 
@@ -804,4 +804,4 @@ export {
804
804
  readAndResetSlackReplyBindingClassifications,
805
805
  readAndResetSlackReplyTargetClassifications
806
806
  };
807
- //# sourceMappingURL=responsiveness-probe-4B6Y2446.js.map
807
+ //# sourceMappingURL=responsiveness-probe-KDSNPKUY.js.map