@debugbundle/cli 1.11.0 → 1.13.0

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 (3) hide show
  1. package/README.md +13 -0
  2. package/dist/main.cjs +721 -120
  3. package/package.json +1 -1
package/dist/main.cjs CHANGED
@@ -10041,7 +10041,7 @@ var require_agent = __commonJS({
10041
10041
  function defaultFactory(origin, opts) {
10042
10042
  return opts && opts.connections === 1 ? new Client(origin, opts) : new Pool(origin, opts);
10043
10043
  }
10044
- var Agent2 = class extends DispatcherBase {
10044
+ var Agent3 = class extends DispatcherBase {
10045
10045
  constructor({ factory = defaultFactory, maxOrigins = Infinity, connect, ...options } = {}) {
10046
10046
  if (typeof factory !== "function") {
10047
10047
  throw new InvalidArgumentError("factory must be a function.");
@@ -10155,7 +10155,7 @@ var require_agent = __commonJS({
10155
10155
  return allClientStats;
10156
10156
  }
10157
10157
  };
10158
- module2.exports = Agent2;
10158
+ module2.exports = Agent3;
10159
10159
  }
10160
10160
  });
10161
10161
 
@@ -10946,7 +10946,7 @@ var require_proxy_agent = __commonJS({
10946
10946
  "../../node_modules/.pnpm/undici@8.5.0/node_modules/undici/lib/dispatcher/proxy-agent.js"(exports2, module2) {
10947
10947
  "use strict";
10948
10948
  var { kProxy, kClose, kDestroy, kDispatch } = require_symbols();
10949
- var Agent2 = require_agent();
10949
+ var Agent3 = require_agent();
10950
10950
  var Pool = require_pool();
10951
10951
  var DispatcherBase = require_dispatcher_base();
10952
10952
  var { InvalidArgumentError, RequestAbortedError, SecureProxyConnectionError } = require_errors();
@@ -11082,7 +11082,7 @@ var require_proxy_agent = __commonJS({
11082
11082
  } else {
11083
11083
  this[kClient] = clientFactory(url, { connect });
11084
11084
  }
11085
- this[kAgent] = new Agent2({
11085
+ this[kAgent] = new Agent3({
11086
11086
  ...opts,
11087
11087
  factory,
11088
11088
  connect: async (opts2, callback) => {
@@ -11221,7 +11221,7 @@ var require_env_http_proxy_agent = __commonJS({
11221
11221
  var DispatcherBase = require_dispatcher_base();
11222
11222
  var { kClose, kDestroy, kClosed, kDestroyed, kDispatch, kNoProxyAgent, kHttpProxyAgent, kHttpsProxyAgent } = require_symbols();
11223
11223
  var ProxyAgent = require_proxy_agent();
11224
- var Agent2 = require_agent();
11224
+ var Agent3 = require_agent();
11225
11225
  var DEFAULT_PORTS = {
11226
11226
  "http:": 80,
11227
11227
  "https:": 443
@@ -11234,7 +11234,7 @@ var require_env_http_proxy_agent = __commonJS({
11234
11234
  super();
11235
11235
  this.#opts = opts;
11236
11236
  const { httpProxy, httpsProxy, noProxy, ...agentOpts } = opts;
11237
- this[kNoProxyAgent] = new Agent2(agentOpts);
11237
+ this[kNoProxyAgent] = new Agent3(agentOpts);
11238
11238
  const HTTP_PROXY = httpProxy ?? process.env.http_proxy ?? process.env.HTTP_PROXY;
11239
11239
  if (HTTP_PROXY) {
11240
11240
  this[kHttpProxyAgent] = new ProxyAgent({ ...agentOpts, uri: HTTP_PROXY });
@@ -13993,7 +13993,7 @@ var require_mock_agent = __commonJS({
13993
13993
  "../../node_modules/.pnpm/undici@8.5.0/node_modules/undici/lib/mock/mock-agent.js"(exports2, module2) {
13994
13994
  "use strict";
13995
13995
  var { kClients } = require_symbols();
13996
- var Agent2 = require_agent();
13996
+ var Agent3 = require_agent();
13997
13997
  var {
13998
13998
  kAgent,
13999
13999
  kMockAgentSet,
@@ -14031,7 +14031,7 @@ var require_mock_agent = __commonJS({
14031
14031
  if (opts?.agent && typeof opts.agent.dispatch !== "function") {
14032
14032
  throw new InvalidArgumentError("Argument opts.agent must implement Agent");
14033
14033
  }
14034
- const agent = opts?.agent ? opts.agent : new Agent2(opts);
14034
+ const agent = opts?.agent ? opts.agent : new Agent3(opts);
14035
14035
  this[kAgent] = agent;
14036
14036
  this[kClients] = agent[kClients];
14037
14037
  this[kOptions] = mockOptions;
@@ -14653,7 +14653,7 @@ var require_snapshot_recorder = __commonJS({
14653
14653
  var require_snapshot_agent = __commonJS({
14654
14654
  "../../node_modules/.pnpm/undici@8.5.0/node_modules/undici/lib/mock/snapshot-agent.js"(exports2, module2) {
14655
14655
  "use strict";
14656
- var Agent2 = require_agent();
14656
+ var Agent3 = require_agent();
14657
14657
  var MockAgent = require_mock_agent();
14658
14658
  var { SnapshotRecorder } = require_snapshot_recorder();
14659
14659
  var { InvalidArgumentError, UndiciError } = require_errors();
@@ -14706,7 +14706,7 @@ var require_snapshot_agent = __commonJS({
14706
14706
  });
14707
14707
  this[kSnapshotLoaded] = false;
14708
14708
  if (this[kSnapshotMode] === "record" || this[kSnapshotMode] === "update" || this[kSnapshotMode] === "playback" && opts.excludeUrls && opts.excludeUrls.length > 0) {
14709
- this[kRealAgent] = new Agent2(opts);
14709
+ this[kRealAgent] = new Agent3(opts);
14710
14710
  }
14711
14711
  if ((this[kSnapshotMode] === "playback" || this[kSnapshotMode] === "update") && this[kSnapshotPath]) {
14712
14712
  this.loadSnapshots().catch(() => {
@@ -14955,10 +14955,10 @@ var require_global2 = __commonJS({
14955
14955
  var globalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.2");
14956
14956
  var legacyGlobalDispatcher = /* @__PURE__ */ Symbol.for("undici.globalDispatcher.1");
14957
14957
  var { InvalidArgumentError } = require_errors();
14958
- var Agent2 = require_agent();
14958
+ var Agent3 = require_agent();
14959
14959
  var Dispatcher1Wrapper = require_dispatcher1_wrapper();
14960
14960
  if (getGlobalDispatcher() === void 0) {
14961
- setGlobalDispatcher(new Agent2());
14961
+ setGlobalDispatcher(new Agent3());
14962
14962
  }
14963
14963
  function setGlobalDispatcher(agent) {
14964
14964
  if (!agent || typeof agent.dispatch !== "function") {
@@ -15431,8 +15431,8 @@ var require_dump = __commonJS({
15431
15431
  var require_dns = __commonJS({
15432
15432
  "../../node_modules/.pnpm/undici@8.5.0/node_modules/undici/lib/interceptor/dns.js"(exports2, module2) {
15433
15433
  "use strict";
15434
- var { isIP: isIP2 } = require("node:net");
15435
- var { lookup } = require("node:dns");
15434
+ var { isIP: isIP3 } = require("node:net");
15435
+ var { lookup: lookup2 } = require("node:dns");
15436
15436
  var DecoratorHandler = require_decorator_handler();
15437
15437
  var { InvalidArgumentError, InformationalError } = require_errors();
15438
15438
  var maxInt = Math.pow(2, 31) - 1;
@@ -15622,7 +15622,7 @@ var require_dns = __commonJS({
15622
15622
  }
15623
15623
  }
15624
15624
  #defaultLookup(origin, opts, cb) {
15625
- lookup(
15625
+ lookup2(
15626
15626
  origin.hostname,
15627
15627
  {
15628
15628
  all: true,
@@ -15840,7 +15840,7 @@ var require_dns = __commonJS({
15840
15840
  return dispatch(origDispatchOpts, handler7);
15841
15841
  }
15842
15842
  const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin);
15843
- if (isIP2(origin.hostname) !== 0) {
15843
+ if (isIP3(origin.hostname) !== 0) {
15844
15844
  return dispatch(origDispatchOpts, handler7);
15845
15845
  }
15846
15846
  instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {
@@ -25618,7 +25618,7 @@ var require_undici = __commonJS({
25618
25618
  var Pool = require_pool();
25619
25619
  var BalancedPool = require_balanced_pool();
25620
25620
  var RoundRobinPool = require_round_robin_pool();
25621
- var Agent2 = require_agent();
25621
+ var Agent3 = require_agent();
25622
25622
  var Dispatcher1Wrapper = require_dispatcher1_wrapper();
25623
25623
  var ProxyAgent = require_proxy_agent();
25624
25624
  var Socks5ProxyAgent = require_socks5_proxy_agent();
@@ -25646,7 +25646,7 @@ var require_undici = __commonJS({
25646
25646
  module2.exports.Pool = Pool;
25647
25647
  module2.exports.BalancedPool = BalancedPool;
25648
25648
  module2.exports.RoundRobinPool = RoundRobinPool;
25649
- module2.exports.Agent = Agent2;
25649
+ module2.exports.Agent = Agent3;
25650
25650
  module2.exports.Dispatcher1Wrapper = Dispatcher1Wrapper;
25651
25651
  module2.exports.ProxyAgent = ProxyAgent;
25652
25652
  module2.exports.Socks5ProxyAgent = Socks5ProxyAgent;
@@ -26224,7 +26224,7 @@ var require_codegen = __commonJS({
26224
26224
  return `${this.lhs} ${this.op}= ${this.rhs};` + _n;
26225
26225
  }
26226
26226
  };
26227
- var Label = class extends Node {
26227
+ var Label2 = class extends Node {
26228
26228
  constructor(label) {
26229
26229
  super();
26230
26230
  this.label = label;
@@ -26655,7 +26655,7 @@ var require_codegen = __commonJS({
26655
26655
  }
26656
26656
  // `label` statement
26657
26657
  label(label) {
26658
- return this._leafNode(new Label(label));
26658
+ return this._leafNode(new Label2(label));
26659
26659
  }
26660
26660
  // `break` statement
26661
26661
  break(label) {
@@ -29507,7 +29507,7 @@ var require_fast_uri = __commonJS({
29507
29507
  query: void 0,
29508
29508
  fragment: void 0
29509
29509
  };
29510
- let isIP2 = false;
29510
+ let isIP3 = false;
29511
29511
  if (options.reference === "suffix") {
29512
29512
  if (options.scheme) {
29513
29513
  uri = options.scheme + ":" + uri;
@@ -29532,9 +29532,9 @@ var require_fast_uri = __commonJS({
29532
29532
  if (ipv4result === false) {
29533
29533
  const ipv6result = normalizeIPv6(parsed.host);
29534
29534
  parsed.host = ipv6result.host.toLowerCase();
29535
- isIP2 = ipv6result.isIPV6;
29535
+ isIP3 = ipv6result.isIPV6;
29536
29536
  } else {
29537
- isIP2 = true;
29537
+ isIP3 = true;
29538
29538
  }
29539
29539
  }
29540
29540
  if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) {
@@ -29551,7 +29551,7 @@ var require_fast_uri = __commonJS({
29551
29551
  }
29552
29552
  const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
29553
29553
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
29554
- if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP2 === false && nonSimpleDomain(parsed.host)) {
29554
+ if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP3 === false && nonSimpleDomain(parsed.host)) {
29555
29555
  try {
29556
29556
  parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
29557
29557
  } catch (e) {
@@ -42498,7 +42498,7 @@ var require_mime_types = __commonJS({
42498
42498
  exports2.contentType = contentType;
42499
42499
  exports2.extension = extension;
42500
42500
  exports2.extensions = /* @__PURE__ */ Object.create(null);
42501
- exports2.lookup = lookup;
42501
+ exports2.lookup = lookup2;
42502
42502
  exports2.types = /* @__PURE__ */ Object.create(null);
42503
42503
  populateMaps(exports2.extensions, exports2.types);
42504
42504
  function charset(type) {
@@ -42540,7 +42540,7 @@ var require_mime_types = __commonJS({
42540
42540
  }
42541
42541
  return exts[0];
42542
42542
  }
42543
- function lookup(path) {
42543
+ function lookup2(path) {
42544
42544
  if (!path || typeof path !== "string") {
42545
42545
  return false;
42546
42546
  }
@@ -52293,7 +52293,7 @@ var require_mime_types2 = __commonJS({
52293
52293
  exports2.contentType = contentType;
52294
52294
  exports2.extension = extension;
52295
52295
  exports2.extensions = /* @__PURE__ */ Object.create(null);
52296
- exports2.lookup = lookup;
52296
+ exports2.lookup = lookup2;
52297
52297
  exports2.types = /* @__PURE__ */ Object.create(null);
52298
52298
  exports2._extensionConflicts = [];
52299
52299
  populateMaps(exports2.extensions, exports2.types);
@@ -52336,7 +52336,7 @@ var require_mime_types2 = __commonJS({
52336
52336
  }
52337
52337
  return exts[0];
52338
52338
  }
52339
- function lookup(path) {
52339
+ function lookup2(path) {
52340
52340
  if (!path || typeof path !== "string") {
52341
52341
  return false;
52342
52342
  }
@@ -59524,7 +59524,7 @@ var require_redis_errors = __commonJS({
59524
59524
  // ../../node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js
59525
59525
  var require_lib2 = __commonJS({
59526
59526
  "../../node_modules/.pnpm/cluster-key-slot@1.1.2/node_modules/cluster-key-slot/lib/index.js"(exports2, module2) {
59527
- var lookup = [
59527
+ var lookup2 = [
59528
59528
  0,
59529
59529
  4129,
59530
59530
  8258,
@@ -59824,11 +59824,11 @@ var require_lib2 = __commonJS({
59824
59824
  start = i;
59825
59825
  }
59826
59826
  } else if (char !== 125) {
59827
- resultHash = lookup[(char ^ resultHash >> 8) & 255] ^ resultHash << 8;
59827
+ resultHash = lookup2[(char ^ resultHash >> 8) & 255] ^ resultHash << 8;
59828
59828
  } else if (i - 1 !== start) {
59829
59829
  return resultHash & 16383;
59830
59830
  }
59831
- result = lookup[(char ^ result >> 8) & 255] ^ result << 8;
59831
+ result = lookup2[(char ^ result >> 8) & 255] ^ result << 8;
59832
59832
  }
59833
59833
  return result & 16383;
59834
59834
  };
@@ -73259,6 +73259,91 @@ var PROJECT_COLOR_TAG_VALUES = [
73259
73259
  ];
73260
73260
  var ProjectColorTagSchema = external_exports.enum(PROJECT_COLOR_TAG_VALUES);
73261
73261
 
73262
+ // ../../packages/shared-types/src/analytics-flows.ts
73263
+ var AnalyticsFlowKeySchema = external_exports.string().trim().regex(/^[a-z][a-z0-9_.-]{0,63}$/);
73264
+ var AnalyticsFlowOriginSchema = external_exports.string().max(255).refine((value) => {
73265
+ try {
73266
+ const url = new URL(value);
73267
+ return url.origin === value && !url.username && !url.password && (url.protocol === "https:" || url.protocol === "http:" && ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname));
73268
+ } catch {
73269
+ return false;
73270
+ }
73271
+ }, "Use an exact HTTPS origin (HTTP is allowed for localhost).");
73272
+ var AnalyticsFlowDefinitionInputSchema = external_exports.object({
73273
+ flow_key: AnalyticsFlowKeySchema,
73274
+ display_name: external_exports.string().trim().min(1).max(120),
73275
+ kind: external_exports.enum(["acquisition", "activation"]),
73276
+ timeout_minutes: external_exports.number().int().min(10).max(1440).default(60),
73277
+ steps: external_exports.array(
73278
+ external_exports.object({
73279
+ step_key: AnalyticsFlowKeySchema,
73280
+ display_name: external_exports.string().trim().min(1).max(120),
73281
+ origin: AnalyticsFlowOriginSchema
73282
+ }).strict()
73283
+ ).min(2).max(8)
73284
+ }).strict().refine(
73285
+ (value) => new Set(value.steps.map((step) => step.step_key)).size === value.steps.length,
73286
+ "Step keys must be unique."
73287
+ );
73288
+ var AnalyticsFlowDefinitionSchema = AnalyticsFlowDefinitionInputSchema.innerType().extend({
73289
+ id: external_exports.string().uuid(),
73290
+ project_id: external_exports.string().uuid(),
73291
+ version: external_exports.number().int().positive(),
73292
+ archived_at: external_exports.string().datetime().nullable()
73293
+ }).refine(
73294
+ (value) => new Set(value.steps.map((step) => step.step_key)).size === value.steps.length,
73295
+ "Step keys must be unique."
73296
+ );
73297
+ var Count = external_exports.number().int().nonnegative();
73298
+ var AnalyticsFlowReportSchema = external_exports.object({
73299
+ flow: AnalyticsFlowDefinitionSchema,
73300
+ window: external_exports.object({
73301
+ from: external_exports.string().datetime(),
73302
+ to: external_exports.string().datetime(),
73303
+ previous_from: external_exports.string().datetime()
73304
+ }),
73305
+ starts: Count,
73306
+ previous_starts: Count,
73307
+ completions: Count,
73308
+ steps: external_exports.array(
73309
+ external_exports.object({
73310
+ step_key: AnalyticsFlowKeySchema,
73311
+ display_name: external_exports.string(),
73312
+ reached: Count,
73313
+ previous_reached: Count,
73314
+ unlinked: Count,
73315
+ dropoff: Count,
73316
+ average_seconds: external_exports.number().nonnegative().nullable()
73317
+ })
73318
+ ).min(2).max(8),
73319
+ sources: external_exports.array(
73320
+ external_exports.object({ source: external_exports.string(), campaign: external_exports.string(), starts: Count, completions: Count })
73321
+ ).max(50),
73322
+ coverage: external_exports.object({
73323
+ observation: external_exports.literal("explicit_integration_signals"),
73324
+ incomplete: external_exports.literal(true),
73325
+ sources_truncated: external_exports.boolean()
73326
+ })
73327
+ });
73328
+ var AnalyticsFlowsResponseSchema = external_exports.object({
73329
+ flows: external_exports.array(AnalyticsFlowDefinitionSchema).max(100)
73330
+ });
73331
+ var AnalyticsFlowResponseSchema = external_exports.object({ flow: AnalyticsFlowDefinitionSchema });
73332
+ var Secret = external_exports.string().regex(/^[A-Za-z0-9_-]{43}$/);
73333
+ var Label = external_exports.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._~+-]{0,99}$/);
73334
+ var Context = external_exports.object({ context: Secret, consent: external_exports.boolean().optional() });
73335
+ var AnalyticsFlowCaptureSchemas = {
73336
+ start: Context.extend({
73337
+ step_key: AnalyticsFlowKeySchema,
73338
+ source: Label.optional(),
73339
+ campaign: Label.optional()
73340
+ }).strict(),
73341
+ step: Context.extend({ step_key: AnalyticsFlowKeySchema }).strict(),
73342
+ handoff: Context.extend({ step_key: AnalyticsFlowKeySchema, token: Secret }).strict(),
73343
+ arrive: Context.extend({ token: Secret }).strict(),
73344
+ withdraw: Context.strict()
73345
+ };
73346
+
73262
73347
  // ../../packages/shared-types/src/index.ts
73263
73348
  var SeveritySchema = external_exports.enum(["low", "medium", "high", "critical"]);
73264
73349
  var BundleSdkSchema = external_exports.object({
@@ -73853,6 +73938,7 @@ function buildCliReference() {
73853
73938
  "## Notifications",
73854
73939
  "",
73855
73940
  "- `debugbundle alert list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
73941
+ "- `debugbundle alert groups --project-id <id> [--limit <n>] [--cursor <cursor>] [--auth-file <path>] [--json]` lists safe alert delivery and email digest groups; `debugbundle alert group <direct|email_digest> <group-id> --project-id <id> [--cursor <cursor>] --json` pages their incident IDs.",
73856
73942
  "- `debugbundle alert create --project-id <id> --channel <channel> --condition <condition> [--service-id <id>] [--severity-min <level>] [--cooldown <seconds>] --config-json <json> [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
73857
73943
  "- `debugbundle alert update <alert-id> --project-id <id> [--service-id <id|null>] [--channel <channel>] [--condition <condition>] [--severity-min <level|null>] [--cooldown <seconds>] [--config-json <json|null>] [--is-enabled <true|false>] [--auth-file <path>] [--json]`",
73858
73944
  "- `debugbundle alert delete <alert-id> --project-id <id> [--auth-file <path>] [--json]`",
@@ -74006,7 +74092,7 @@ function buildMcpReference() {
74006
74092
  "",
74007
74093
  "## Notification Tools",
74008
74094
  "",
74009
- "- `list_alerts`, `create_alert`, `update_alert`, `delete_alert` \u2014 manage incident alert rules.",
74095
+ "- `list_alerts`, `create_alert`, `update_alert`, `delete_alert` \u2014 manage incident alert rules. `list_alert_groups` and `get_alert_group` inspect project-scoped delivery groups without raw payloads or destination secrets.",
74010
74096
  "- `list_webhooks`, `create_webhook`, `update_webhook`, `delete_webhook` \u2014 manage signed webhook destinations.",
74011
74097
  "- `test_webhook`, `list_webhook_deliveries` \u2014 validate webhook delivery and inspect delivery history.",
74012
74098
  "",
@@ -82199,7 +82285,7 @@ async function agentReadCommand(input3, dependencies = {}) {
82199
82285
  }
82200
82286
 
82201
82287
  // src/clean-command.ts
82202
- var import_promises10 = require("node:fs/promises");
82288
+ var import_promises11 = require("node:fs/promises");
82203
82289
  var import_node_path11 = require("node:path");
82204
82290
 
82205
82291
  // src/cli-fs-helpers.ts
@@ -82215,7 +82301,7 @@ function resolveWorkspacePath(rootDirectory, targetPath) {
82215
82301
  }
82216
82302
 
82217
82303
  // src/local-retrieval-store.ts
82218
- var import_promises8 = require("node:fs/promises");
82304
+ var import_promises9 = require("node:fs/promises");
82219
82305
  var import_node_path9 = require("node:path");
82220
82306
 
82221
82307
  // ../../packages/retrieval-client/src/mutation-outcome.ts
@@ -93841,8 +93927,8 @@ function applySSRFProtection(dispatcher2) {
93841
93927
  return dispatcher2;
93842
93928
  }
93843
93929
  function createSSRFProtectedDispatcher() {
93844
- const Agent2 = getAgent();
93845
- return applySSRFProtection(new Agent2());
93930
+ const Agent3 = getAgent();
93931
+ return applySSRFProtection(new Agent3());
93846
93932
  }
93847
93933
  var dispatcher;
93848
93934
  async function fetchRequest(provider, url, options) {
@@ -99578,6 +99664,88 @@ var CLAIM_DUE_AVAILABILITY_CHECKS_QUERY = `
99578
99664
  c.consecutive_successes
99579
99665
  `;
99580
99666
 
99667
+ // ../../packages/storage/src/alert-outbound-guard.ts
99668
+ var import_promises8 = require("node:dns/promises");
99669
+ var import_node_net2 = require("node:net");
99670
+ var import_undici3 = __toESM(require_undici(), 1);
99671
+ var blockedAddresses2 = new import_node_net2.BlockList();
99672
+ for (const [address, prefix] of [
99673
+ ["0.0.0.0", 8],
99674
+ ["10.0.0.0", 8],
99675
+ ["100.64.0.0", 10],
99676
+ ["127.0.0.0", 8],
99677
+ ["169.254.0.0", 16],
99678
+ ["172.16.0.0", 12],
99679
+ ["192.0.0.0", 24],
99680
+ ["192.0.2.0", 24],
99681
+ ["192.88.99.0", 24],
99682
+ ["192.168.0.0", 16],
99683
+ ["198.18.0.0", 15],
99684
+ ["198.51.100.0", 24],
99685
+ ["203.0.113.0", 24],
99686
+ ["224.0.0.0", 4],
99687
+ ["240.0.0.0", 4]
99688
+ ]) blockedAddresses2.addSubnet(address, prefix);
99689
+ for (const [address, prefix] of [
99690
+ ["::", 128],
99691
+ ["::1", 128],
99692
+ ["64:ff9b::", 96],
99693
+ ["100::", 64],
99694
+ ["2001::", 23],
99695
+ ["2001:db8::", 32],
99696
+ ["2002::", 16],
99697
+ ["fc00::", 7],
99698
+ ["fe80::", 10],
99699
+ ["ff00::", 8]
99700
+ ]) blockedAddresses2.addSubnet(address, prefix, "ipv6");
99701
+ function blocked() {
99702
+ return new Error("alert_target_blocked");
99703
+ }
99704
+ function assertPublicAddress(address, family) {
99705
+ if (family !== 4 && family !== 6 || (0, import_node_net2.isIP)(address) !== family || blockedAddresses2.check(address, family === 4 ? "ipv4" : "ipv6")) {
99706
+ throw blocked();
99707
+ }
99708
+ }
99709
+ function assertPublicHostname(hostname2) {
99710
+ const normalized = hostname2.toLowerCase().replace(/\.$/, "");
99711
+ if (!normalized.includes(".") || [".local", ".internal", ".localhost"].some((suffix) => normalized.endsWith(suffix))) {
99712
+ throw blocked();
99713
+ }
99714
+ }
99715
+ async function resolveAlertOutboundAddress(hostname2, resolve4 = import_promises8.lookup) {
99716
+ const literalFamily = (0, import_node_net2.isIP)(hostname2);
99717
+ if (literalFamily) {
99718
+ assertPublicAddress(hostname2, literalFamily);
99719
+ return { address: hostname2, family: literalFamily };
99720
+ }
99721
+ assertPublicHostname(hostname2);
99722
+ let answers;
99723
+ try {
99724
+ answers = await resolve4(hostname2, { all: true, verbatim: true });
99725
+ } catch {
99726
+ throw blocked();
99727
+ }
99728
+ if (answers.length === 0) throw blocked();
99729
+ for (const answer of answers) assertPublicAddress(answer.address, answer.family);
99730
+ const first = answers[0];
99731
+ return { address: first.address, family: first.family };
99732
+ }
99733
+ var outboundAgent = new import_undici3.Agent({
99734
+ connections: 4,
99735
+ maxOrigins: 128,
99736
+ connect: {
99737
+ lookup(hostname2, options, callback) {
99738
+ resolveAlertOutboundAddress(hostname2).then(
99739
+ ({ address, family }) => {
99740
+ if (options.all) callback(null, [{ address, family }]);
99741
+ else callback(null, address, family);
99742
+ },
99743
+ () => callback(blocked(), "")
99744
+ );
99745
+ }
99746
+ }
99747
+ });
99748
+
99581
99749
  // ../../packages/storage/src/auth-rate-limiter.ts
99582
99750
  var import_ioredis = __toESM(require_built3(), 1);
99583
99751
 
@@ -100097,6 +100265,11 @@ function normalizeInstalledJavaEvent(candidate) {
100097
100265
  };
100098
100266
  }
100099
100267
 
100268
+ // ../../packages/event-normalizer/src/java-stderr.ts
100269
+ function isJavaRedirectedStderrLogger(candidate) {
100270
+ return typeof candidate === "string" && candidate.length <= 256 && (candidate === "stderr" || candidate === "org.jboss.stdio" || candidate.startsWith("org.jboss.stdio."));
100271
+ }
100272
+
100100
100273
  // ../../packages/event-normalizer/src/java-timer-message.ts
100101
100274
  var TIMER_DIAGNOSTIC = /^WFLYEJB002(?:0|2):[^\n]*\[id=[^\]\n]*\btimedObjectId=/;
100102
100275
  var JAVA_TIMER_DATE = /\b(previousRun|initialExpiration|nextExpiration)=((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)\s+(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+[A-Za-z][A-Za-z0-9:+-]{0,15}\s+\d{4})\b/g;
@@ -100586,12 +100759,22 @@ function getRequestResponseStatus(payload2) {
100586
100759
  const status = payload2?.["response_status"];
100587
100760
  return typeof status === "number" && Number.isFinite(status) ? status : null;
100588
100761
  }
100589
- function classifyEvent(eventType, logLevel, probeActivationId, payload2, capturePreset = "minimal", immediateClientErrorStatuses = [], immediateClientErrorPathRules = []) {
100762
+ function isJavaStackContinuation(payload2) {
100763
+ const message3 = payload2?.["message"];
100764
+ if (typeof message3 !== "string" || message3.length > 16384 || /[\r\n]/.test(message3)) return false;
100765
+ const attributes = payload2?.["attributes"];
100766
+ if (attributes === null || typeof attributes !== "object" || Array.isArray(attributes)) return false;
100767
+ if (!isJavaRedirectedStderrLogger(attributes["logger"])) return false;
100768
+ if ("throwable" in attributes && attributes.throwable !== null) return false;
100769
+ return /^\s*(?:at\s+[\w.$/]+\([^\r\n]*\)|\.\.\.\s+\d+\s+more|(?:Caused by|Suppressed):\s+[\w.$/]+(?:Exception|Error|Throwable)(?::[^\r\n]*|\s|$))\s*$/.test(message3);
100770
+ }
100771
+ function classifyEvent(eventType, logLevel, probeActivationId, payload2, capturePreset = "minimal", immediateClientErrorStatuses = [], immediateClientErrorPathRules = [], runtime) {
100590
100772
  switch (eventType) {
100591
100773
  case "backend_exception":
100592
100774
  case "frontend_exception":
100593
100775
  return "incident_signal";
100594
100776
  case "log_event":
100777
+ if (runtime === "java" && isJavaStackContinuation(payload2)) return "context_signal";
100595
100778
  if (logLevel !== void 0 && INCIDENT_LOG_LEVELS.has(logLevel)) {
100596
100779
  return "incident_signal";
100597
100780
  }
@@ -100635,8 +100818,52 @@ function defineStorageSchemaMigration(input3) {
100635
100818
  };
100636
100819
  }
100637
100820
 
100638
- // ../../packages/storage/src/browser-recovery-schema.ts
100821
+ // ../../packages/storage/src/analytics-flow-schema.ts
100639
100822
  var statements = [
100823
+ `CREATE TABLE IF NOT EXISTS analytics_flow_definitions (
100824
+ id uuid PRIMARY KEY, project_id uuid NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
100825
+ flow_key text NOT NULL, version integer NOT NULL DEFAULT 1, definition jsonb NOT NULL,
100826
+ archived_at timestamptz, created_at timestamptz NOT NULL, updated_at timestamptz NOT NULL,
100827
+ UNIQUE(project_id, flow_key)
100828
+ )`,
100829
+ `CREATE TABLE IF NOT EXISTS analytics_flow_runs (
100830
+ id uuid PRIMARY KEY, flow_id uuid NOT NULL REFERENCES analytics_flow_definitions(id) ON DELETE CASCADE,
100831
+ version integer NOT NULL, context_hash text NOT NULL UNIQUE, origin text NOT NULL,
100832
+ start_index integer NOT NULL, last_index integer NOT NULL,
100833
+ source text NOT NULL DEFAULT 'unknown', campaign text NOT NULL DEFAULT '',
100834
+ started_at timestamptz NOT NULL, last_step_at timestamptz NOT NULL, expires_at timestamptz NOT NULL,
100835
+ CHECK (start_index BETWEEN 0 AND 7 AND last_index BETWEEN start_index AND 7),
100836
+ CHECK (expires_at > started_at AND expires_at <= started_at + interval '24 hours')
100837
+ )`,
100838
+ `CREATE INDEX IF NOT EXISTS analytics_flow_runs_expiry_idx ON analytics_flow_runs(expires_at, id)`,
100839
+ `CREATE TABLE IF NOT EXISTS analytics_flow_handoffs (
100840
+ id uuid PRIMARY KEY, run_id uuid NOT NULL REFERENCES analytics_flow_runs(id) ON DELETE CASCADE,
100841
+ token_hash text NOT NULL UNIQUE, step_index integer NOT NULL, expires_at timestamptz NOT NULL,
100842
+ redeemed_context_hash text, UNIQUE(run_id, step_index)
100843
+ )`,
100844
+ `CREATE INDEX IF NOT EXISTS analytics_flow_handoffs_expiry_idx ON analytics_flow_handoffs(expires_at, id)`,
100845
+ `CREATE TABLE IF NOT EXISTS analytics_flow_rollups (
100846
+ flow_id uuid NOT NULL REFERENCES analytics_flow_definitions(id) ON DELETE CASCADE,
100847
+ version integer NOT NULL, cohort_date date NOT NULL, step_index integer NOT NULL,
100848
+ source text NOT NULL, campaign text NOT NULL, reached bigint NOT NULL DEFAULT 0,
100849
+ unlinked bigint NOT NULL DEFAULT 0, elapsed_ms double precision NOT NULL DEFAULT 0,
100850
+ elapsed_count bigint NOT NULL DEFAULT 0,
100851
+ PRIMARY KEY(flow_id, version, cohort_date, step_index, source, campaign)
100852
+ )`,
100853
+ `CREATE INDEX IF NOT EXISTS analytics_flow_rollups_expiry_idx ON analytics_flow_rollups(cohort_date, flow_id)`
100854
+ ];
100855
+ var ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS = statements.map(
100856
+ (statement) => statement.replaceAll(" IF NOT EXISTS", "")
100857
+ );
100858
+ var migration = {
100859
+ id: "202610030001_add_public_analytics_flows",
100860
+ description: "Add customer project flow definitions, bounded continuity and aggregate reports.",
100861
+ statements
100862
+ };
100863
+ var ANALYTICS_FLOW_SCHEMA_MIGRATIONS = [defineStorageSchemaMigration(migration)];
100864
+
100865
+ // ../../packages/storage/src/browser-recovery-schema.ts
100866
+ var statements2 = [
100640
100867
  `ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS coalescing_key text`,
100641
100868
  `CREATE INDEX IF NOT EXISTS alert_deliveries_coalescing_idx ON alert_deliveries (alert_id, coalescing_key, created_at) WHERE coalescing_key IS NOT NULL`,
100642
100869
  `CREATE TABLE IF NOT EXISTS browser_recovery_events (
@@ -100658,10 +100885,10 @@ var BROWSER_RECOVERY_MIGRATIONS = [
100658
100885
  defineStorageSchemaMigration({
100659
100886
  id: "202609220001_add_browser_recovery_context",
100660
100887
  description: "Index browser recovery context and separate burst suppression from alert cooldown identity",
100661
- statements
100888
+ statements: statements2
100662
100889
  })
100663
100890
  ];
100664
- var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS = statements.filter((statement) => !statement.startsWith("ALTER TABLE")).map((statement) => statement.replaceAll(" IF NOT EXISTS", ""));
100891
+ var BROWSER_RECOVERY_BOOTSTRAP_STATEMENTS = statements2.filter((statement) => !statement.startsWith("ALTER TABLE")).map((statement) => statement.replaceAll(" IF NOT EXISTS", ""));
100665
100892
 
100666
100893
  // ../../packages/storage/src/availability-check-bootstrap-statements.ts
100667
100894
  var AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS = [
@@ -102225,6 +102452,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
102225
102452
  severity_lifecycle_scope text,
102226
102453
  cooldown_seconds integer NOT NULL DEFAULT 0,
102227
102454
  config jsonb NOT NULL DEFAULT '{}'::jsonb,
102455
+ signing_secret text,
102456
+ webhook_payload_version smallint NOT NULL DEFAULT 0 CHECK (webhook_payload_version IN (0, 1)),
102228
102457
  is_enabled boolean NOT NULL DEFAULT true,
102229
102458
  created_at timestamptz NOT NULL DEFAULT now(),
102230
102459
  updated_at timestamptz NOT NULL DEFAULT now(),
@@ -102271,6 +102500,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
102271
102500
  dedupe_key text NOT NULL,
102272
102501
  notification_key text NOT NULL DEFAULT '',
102273
102502
  coalescing_key text,
102503
+ evaluation_job_id text,
102274
102504
  channel text NOT NULL,
102275
102505
  status text NOT NULL,
102276
102506
  payload jsonb NOT NULL,
@@ -102289,6 +102519,21 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
102289
102519
  CREATE INDEX alert_deliveries_alert_notification_idx
102290
102520
  ON alert_deliveries (alert_id, notification_key, created_at DESC)
102291
102521
  `,
102522
+ `
102523
+ CREATE TABLE alert_delivery_members (
102524
+ id uuid PRIMARY KEY,
102525
+ delivery_id uuid NOT NULL REFERENCES alert_deliveries(id) ON DELETE CASCADE,
102526
+ incident_id uuid NOT NULL,
102527
+ condition_type text NOT NULL,
102528
+ dedupe_key text NOT NULL,
102529
+ created_at timestamptz NOT NULL DEFAULT now(),
102530
+ UNIQUE (delivery_id, incident_id, condition_type, dedupe_key)
102531
+ )
102532
+ `,
102533
+ `
102534
+ CREATE INDEX alert_delivery_members_delivery_created_idx
102535
+ ON alert_delivery_members (delivery_id, created_at ASC, id ASC)
102536
+ `,
102292
102537
  `
102293
102538
  CREATE TABLE alert_email_digests (
102294
102539
  id uuid PRIMARY KEY,
@@ -102618,7 +102863,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS2 = [
102618
102863
  ...OPENAI_OAUTH_BOOTSTRAP_STATEMENTS,
102619
102864
  ...AVAILABILITY_CHECK_BOOTSTRAP_STATEMENTS,
102620
102865
  ...ANALYTICS_BOOTSTRAP_STATEMENTS,
102621
- ...WORKER_JOB_BOOTSTRAP_STATEMENTS
102866
+ ...WORKER_JOB_BOOTSTRAP_STATEMENTS,
102867
+ ...ANALYTICS_FLOW_BOOTSTRAP_STATEMENTS
102622
102868
  ];
102623
102869
 
102624
102870
  // ../../packages/storage/src/migrations.ts
@@ -104783,6 +105029,45 @@ var STORAGE_SCHEMA_MIGRATIONS = [
104783
105029
  id: "202609160001_add_browser_resource_routes",
104784
105030
  description: "Retain sanitized browser resource routes independently of raw event sampling.",
104785
105031
  statements: ["ALTER TABLE incident_events ADD COLUMN IF NOT EXISTS resource_route text"]
105032
+ }),
105033
+ defineStorageSchemaMigration({
105034
+ id: "202609240001_add_alert_delivery_members",
105035
+ description: "Retain incident identities represented by one coherent alert delivery.",
105036
+ statements: [
105037
+ `
105038
+ CREATE TABLE IF NOT EXISTS alert_delivery_members (
105039
+ id uuid PRIMARY KEY,
105040
+ delivery_id uuid NOT NULL REFERENCES alert_deliveries(id) ON DELETE CASCADE,
105041
+ incident_id uuid NOT NULL,
105042
+ condition_type text NOT NULL,
105043
+ dedupe_key text NOT NULL,
105044
+ created_at timestamptz NOT NULL DEFAULT now(),
105045
+ UNIQUE (delivery_id, incident_id, condition_type, dedupe_key)
105046
+ )
105047
+ `,
105048
+ `
105049
+ CREATE INDEX IF NOT EXISTS alert_delivery_members_delivery_created_idx
105050
+ ON alert_delivery_members (delivery_id, created_at ASC, id ASC)
105051
+ `
105052
+ ]
105053
+ }),
105054
+ defineStorageSchemaMigration({
105055
+ id: "202609240002_add_alert_webhook_signing_secret",
105056
+ description: "Store custom alert-webhook signing secrets separately from readable rule config.",
105057
+ statements: ["ALTER TABLE alert_rules ADD COLUMN IF NOT EXISTS signing_secret text"]
105058
+ }),
105059
+ defineStorageSchemaMigration({
105060
+ id: "202609250001_add_alert_evaluation_owner",
105061
+ description: "Bind direct alert retries to the durable evaluation job that created the intent.",
105062
+ statements: ["ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS evaluation_job_id text"]
105063
+ }),
105064
+ defineStorageSchemaMigration({
105065
+ id: "202609250002_version_alert_webhook_payloads",
105066
+ description: "Preserve legacy custom webhook bodies while enforcing signatures for every delivery.",
105067
+ statements: [
105068
+ "ALTER TABLE alert_rules ADD COLUMN IF NOT EXISTS webhook_payload_version smallint NOT NULL DEFAULT 0 CHECK (webhook_payload_version IN (0, 1))",
105069
+ "UPDATE alert_rules SET webhook_payload_version = 1 WHERE channel = 'webhook' AND signing_secret IS NOT NULL"
105070
+ ]
104786
105071
  })
104787
105072
  ];
104788
105073
 
@@ -104793,7 +105078,8 @@ var STORAGE_SCHEMA_MIGRATIONS2 = [
104793
105078
  ...AVAILABILITY_CHECK_STORAGE_SCHEMA_MIGRATIONS,
104794
105079
  ...ANALYTICS_STORAGE_SCHEMA_MIGRATIONS,
104795
105080
  ...OPENAI_OAUTH_STORAGE_SCHEMA_MIGRATIONS,
104796
- ...WORKER_JOB_SCHEMA_MIGRATIONS
105081
+ ...WORKER_JOB_SCHEMA_MIGRATIONS,
105082
+ ...ANALYTICS_FLOW_SCHEMA_MIGRATIONS
104797
105083
  ].sort((left, right) => left.id.localeCompare(right.id));
104798
105084
 
104799
105085
  // src/local-retrieval-store.ts
@@ -104808,7 +105094,7 @@ function projectLocalEvidence(value) {
104808
105094
  return projected.value;
104809
105095
  }
104810
105096
  async function readLocalArtifact(path, dependencies) {
104811
- const readFile = dependencies?.readFile ?? import_promises8.readFile;
105097
+ const readFile = dependencies?.readFile ?? import_promises9.readFile;
104812
105098
  const raw = await readFile(path, "utf8");
104813
105099
  if (Buffer.byteLength(raw, "utf8") > MAX_ARTIFACT_BYTES) {
104814
105100
  throw createReadError(503, "privacy_projection_unavailable");
@@ -104827,7 +105113,7 @@ function createReadError(status, code) {
104827
105113
  return new RetrievalApiError(status, code);
104828
105114
  }
104829
105115
  async function readJsonFile(path, dependencies) {
104830
- const readFile = dependencies?.readFile ?? import_promises8.readFile;
105116
+ const readFile = dependencies?.readFile ?? import_promises9.readFile;
104831
105117
  try {
104832
105118
  return JSON.parse(await readFile(path, "utf8"));
104833
105119
  } catch (error2) {
@@ -104997,7 +105283,7 @@ async function readLocalState(dependencies) {
104997
105283
  }
104998
105284
  async function writeLocalState(state, dependencies) {
104999
105285
  const rootDirectory = getWorkspaceRoot(dependencies);
105000
- const writeFile = dependencies?.writeFile ?? import_promises8.writeFile;
105286
+ const writeFile = dependencies?.writeFile ?? import_promises9.writeFile;
105001
105287
  await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(state, null, 2)}
105002
105288
  `, "utf8");
105003
105289
  }
@@ -105086,7 +105372,7 @@ async function reopenLocalIncident(input3, dependencies) {
105086
105372
  }
105087
105373
 
105088
105374
  // src/cloud-artifact-cache.ts
105089
- var import_promises9 = require("node:fs/promises");
105375
+ var import_promises10 = require("node:fs/promises");
105090
105376
  var import_node_path10 = require("node:path");
105091
105377
 
105092
105378
  // src/retrieval-source.ts
@@ -105219,9 +105505,9 @@ async function pruneCloudArtifactCache(input3, dependencies) {
105219
105505
  };
105220
105506
  }
105221
105507
  async function pruneExpiredArtifactsInDirectory(directoryPath, now, olderThanMs, dependencies) {
105222
- const readdir = dependencies?.readdir ?? import_promises9.readdir;
105223
- const rm = dependencies?.rm ?? import_promises9.rm;
105224
- const stat = dependencies?.stat ?? import_promises9.stat;
105508
+ const readdir = dependencies?.readdir ?? import_promises10.readdir;
105509
+ const rm = dependencies?.rm ?? import_promises10.rm;
105510
+ const stat = dependencies?.stat ?? import_promises10.stat;
105225
105511
  let fileNames;
105226
105512
  try {
105227
105513
  fileNames = await readdir(directoryPath);
@@ -105263,8 +105549,8 @@ async function pruneExpiredArtifactsInDirectory(directoryPath, now, olderThanMs,
105263
105549
  );
105264
105550
  }
105265
105551
  async function updateCachedArtifactStatus(filePath, input3, dependencies) {
105266
- const readFile = dependencies?.readFile ?? import_promises9.readFile;
105267
- const writeFile = dependencies?.writeFile ?? import_promises9.writeFile;
105552
+ const readFile = dependencies?.readFile ?? import_promises10.readFile;
105553
+ const writeFile = dependencies?.writeFile ?? import_promises10.writeFile;
105268
105554
  let payload2;
105269
105555
  try {
105270
105556
  const raw = await readFile(filePath, "utf8");
@@ -105298,8 +105584,8 @@ function applyIncidentStatusToPayload(payload2, incidentId, incident) {
105298
105584
  return nextPayload;
105299
105585
  }
105300
105586
  async function persistCloudArtifact(directoryPath, fileName, payload2, dependencies) {
105301
- const mkdir5 = dependencies?.mkdir ?? import_promises9.mkdir;
105302
- const writeFile = dependencies?.writeFile ?? import_promises9.writeFile;
105587
+ const mkdir5 = dependencies?.mkdir ?? import_promises10.mkdir;
105588
+ const writeFile = dependencies?.writeFile ?? import_promises10.writeFile;
105303
105589
  await mkdir5(directoryPath, { recursive: true });
105304
105590
  await writeFile((0, import_node_path10.join)(directoryPath, fileName), `${JSON.stringify(payload2, null, 2)}
105305
105591
  `, "utf8");
@@ -105341,9 +105627,9 @@ function parseOlderThan(value) {
105341
105627
  return Number.parseInt(match[1], 10) * 24 * 60 * 60 * 1e3;
105342
105628
  }
105343
105629
  async function cleanProcessedEventFiles(input3, dependencies) {
105344
- const readdir = dependencies.readdir ?? import_promises10.readdir;
105345
- const rm = dependencies.rm ?? import_promises10.rm;
105346
- const stat = dependencies.stat ?? import_promises10.stat;
105630
+ const readdir = dependencies.readdir ?? import_promises11.readdir;
105631
+ const rm = dependencies.rm ?? import_promises11.rm;
105632
+ const stat = dependencies.stat ?? import_promises11.stat;
105347
105633
  const rootDirectory = (dependencies.cwd ?? process.cwd)();
105348
105634
  const eventsDirectoryPath = (0, import_node_path11.join)(rootDirectory, LOCAL_EVENTS_DIRECTORY_PATH);
105349
105635
  const state = await readLocalState(dependencies);
@@ -105378,9 +105664,9 @@ async function cleanProcessedEventFiles(input3, dependencies) {
105378
105664
  return { removed, retained };
105379
105665
  }
105380
105666
  async function cleanRelaySpoolFiles(input3, dependencies) {
105381
- const readdir = dependencies.readdir ?? import_promises10.readdir;
105382
- const rm = dependencies.rm ?? import_promises10.rm;
105383
- const stat = dependencies.stat ?? import_promises10.stat;
105667
+ const readdir = dependencies.readdir ?? import_promises11.readdir;
105668
+ const rm = dependencies.rm ?? import_promises11.rm;
105669
+ const stat = dependencies.stat ?? import_promises11.stat;
105384
105670
  const rootDirectory = (dependencies.cwd ?? process.cwd)();
105385
105671
  const spoolDirectoryPath = (0, import_node_path11.join)(rootDirectory, LOCAL_RELAY_SPOOL_DIRECTORY_PATH);
105386
105672
  let spoolFileNames;
@@ -105431,7 +105717,7 @@ function sortLocalIncidentRemovalPriority(left, right) {
105431
105717
  return left.incident_id.localeCompare(right.incident_id);
105432
105718
  }
105433
105719
  async function applyLocalIncidentRetention(dependencies) {
105434
- const rm = dependencies.rm ?? import_promises10.rm;
105720
+ const rm = dependencies.rm ?? import_promises11.rm;
105435
105721
  const rootDirectory = (dependencies.cwd ?? process.cwd)();
105436
105722
  const state = await readLocalState(dependencies);
105437
105723
  const incidents = Object.values(state.incidents);
@@ -105464,7 +105750,7 @@ async function countLocalIncidents(dependencies) {
105464
105750
  return Object.keys((await readLocalState(dependencies)).incidents).length;
105465
105751
  }
105466
105752
  async function countDirectoryFiles(directoryPath, dependencies, extension) {
105467
- const readdir = dependencies.readdir ?? import_promises10.readdir;
105753
+ const readdir = dependencies.readdir ?? import_promises11.readdir;
105468
105754
  const rootDirectory = (dependencies.cwd ?? process.cwd)();
105469
105755
  try {
105470
105756
  return (await readdir((0, import_node_path11.join)(rootDirectory, directoryPath))).filter((fileName) => fileName.endsWith(extension)).length;
@@ -105482,8 +105768,8 @@ async function countRelaySpoolEventFiles(dependencies) {
105482
105768
  return countDirectoryFiles(LOCAL_RELAY_SPOOL_DIRECTORY_PATH, dependencies, ".events.json");
105483
105769
  }
105484
105770
  async function resetRuntimeData(dependencies) {
105485
- const mkdir5 = dependencies.mkdir ?? import_promises10.mkdir;
105486
- const rm = dependencies.rm ?? import_promises10.rm;
105771
+ const mkdir5 = dependencies.mkdir ?? import_promises11.mkdir;
105772
+ const rm = dependencies.rm ?? import_promises11.rm;
105487
105773
  const rootDirectory = (dependencies.cwd ?? process.cwd)();
105488
105774
  const [processedEventFilesRemoved, relaySpoolFilesRemoved, cloudCacheFilesRemoved, localIncidentCount] = await Promise.all([
105489
105775
  countProcessedAndUnprocessedEventFiles(dependencies),
@@ -105575,7 +105861,7 @@ async function cleanCommand(input3, dependencies = {}) {
105575
105861
  };
105576
105862
  }
105577
105863
  async function countProcessedAndUnprocessedEventFiles(dependencies) {
105578
- const readdir = dependencies.readdir ?? import_promises10.readdir;
105864
+ const readdir = dependencies.readdir ?? import_promises11.readdir;
105579
105865
  const rootDirectory = (dependencies.cwd ?? process.cwd)();
105580
105866
  try {
105581
105867
  return (await readdir((0, import_node_path11.join)(rootDirectory, LOCAL_EVENTS_DIRECTORY_PATH))).filter((fileName) => fileName.endsWith(".events.json")).length;
@@ -105591,7 +105877,7 @@ async function countCloudArtifactCache(dependencies) {
105591
105877
  }
105592
105878
 
105593
105879
  // src/connect-command.ts
105594
- var import_promises13 = require("node:fs/promises");
105880
+ var import_promises14 = require("node:fs/promises");
105595
105881
  var import_node_path14 = require("node:path");
105596
105882
 
105597
105883
  // ../../packages/project-management-client/src/index.ts
@@ -105978,7 +106264,7 @@ function createTokenManagementApi(client) {
105978
106264
  }
105979
106265
 
105980
106266
  // src/auth-state.ts
105981
- var import_promises11 = require("node:fs/promises");
106267
+ var import_promises12 = require("node:fs/promises");
105982
106268
  var import_node_os2 = require("node:os");
105983
106269
  var import_node_path12 = require("node:path");
105984
106270
  var CliAuthStateSchema = external_exports.object({
@@ -106003,7 +106289,7 @@ function buildTokenPreview(token) {
106003
106289
  }
106004
106290
  async function readCliAuthState(input3, dependencies) {
106005
106291
  const authFilePath = input3.authFilePath ?? getDefaultAuthFilePath();
106006
- const readFile = dependencies?.readFile ?? ((filePath) => (0, import_promises11.readFile)(filePath, "utf8"));
106292
+ const readFile = dependencies?.readFile ?? ((filePath) => (0, import_promises12.readFile)(filePath, "utf8"));
106007
106293
  let rawAuthState;
106008
106294
  try {
106009
106295
  rawAuthState = await readFile(authFilePath);
@@ -106027,8 +106313,8 @@ async function readCliAuthState(input3, dependencies) {
106027
106313
  }
106028
106314
  async function persistCliAuthState(input3, dependencies) {
106029
106315
  const authFilePath = input3.authFilePath ?? getDefaultAuthFilePath();
106030
- const mkdir5 = dependencies?.mkdir ?? import_promises11.mkdir;
106031
- const writeFile = dependencies?.writeFile ?? import_promises11.writeFile;
106316
+ const mkdir5 = dependencies?.mkdir ?? import_promises12.mkdir;
106317
+ const writeFile = dependencies?.writeFile ?? import_promises12.writeFile;
106032
106318
  await mkdir5((0, import_node_path12.dirname)(authFilePath), { recursive: true });
106033
106319
  await writeFile(`${authFilePath}`, `${JSON.stringify(input3.authState, null, 2)}
106034
106320
  `, "utf8");
@@ -106056,16 +106342,43 @@ var AlertSchema = external_exports.object({
106056
106342
  severity_lifecycle_scope: AlertSeverityLifecycleScopeSchema.nullable().optional().default(null),
106057
106343
  cooldown_seconds: external_exports.number().int().min(0),
106058
106344
  config: external_exports.record(external_exports.string(), external_exports.unknown()),
106345
+ signing_secret: external_exports.string().optional(),
106059
106346
  is_enabled: external_exports.boolean(),
106060
106347
  created_at: external_exports.string(),
106061
106348
  updated_at: external_exports.string()
106062
106349
  }).strict();
106063
106350
  var AlertListResponseSchema = external_exports.object({
106064
- alerts: external_exports.array(AlertSchema)
106351
+ alerts: external_exports.array(AlertSchema.omit({ signing_secret: true }).strict())
106065
106352
  }).strict();
106066
106353
  var AlertResponseSchema = external_exports.object({
106067
106354
  alert: AlertSchema
106068
106355
  }).strict();
106356
+ var AlertGroupSummarySchema = external_exports.object({
106357
+ group_id: external_exports.string().uuid(),
106358
+ kind: external_exports.enum(["direct", "email_digest"]),
106359
+ project_id: external_exports.string().uuid(),
106360
+ alert_id: external_exports.string().uuid().nullable(),
106361
+ root_incident_id: external_exports.string().uuid().nullable(),
106362
+ channel: AlertChannelSchema,
106363
+ status: external_exports.enum(["pending", "delivered", "failed"]),
106364
+ member_count: external_exports.number().int().min(0),
106365
+ created_at: external_exports.string(),
106366
+ delivered_at: external_exports.string().nullable()
106367
+ }).strict();
106368
+ var AlertGroupMemberSchema = external_exports.object({
106369
+ incident_id: external_exports.string().uuid(),
106370
+ condition_type: external_exports.string(),
106371
+ created_at: external_exports.string()
106372
+ }).strict();
106373
+ var AlertGroupListResponseSchema = external_exports.object({
106374
+ groups: external_exports.array(AlertGroupSummarySchema),
106375
+ next_cursor: external_exports.string().nullable()
106376
+ }).strict();
106377
+ var AlertGroupResponseSchema = external_exports.object({
106378
+ group: AlertGroupSummarySchema,
106379
+ members: external_exports.array(AlertGroupMemberSchema),
106380
+ next_cursor: external_exports.string().nullable()
106381
+ }).strict();
106069
106382
  var ApiErrorResponseSchema4 = external_exports.object({
106070
106383
  error: external_exports.string()
106071
106384
  }).strict();
@@ -106128,6 +106441,28 @@ function createAlertApi(client) {
106128
106441
  })
106129
106442
  );
106130
106443
  },
106444
+ async listAlertGroups(input3) {
106445
+ const response = await client.request({
106446
+ method: "GET",
106447
+ path: `/v1/alert-groups${buildQuery({ project_id: input3.projectId, limit: input3.limit, cursor: input3.cursor })}`,
106448
+ bearerToken: input3.bearerToken
106449
+ });
106450
+ if (response.status < 200 || response.status >= 300) parseApiError4(response.status, response.body);
106451
+ const parsed = AlertGroupListResponseSchema.safeParse(response.body);
106452
+ if (!parsed.success) throw new AlertApiError(response.status, "invalid_response_shape");
106453
+ return parsed.data;
106454
+ },
106455
+ async getAlertGroup(input3) {
106456
+ const response = await client.request({
106457
+ method: "GET",
106458
+ path: `/v1/alert-groups/${input3.kind}/${encodeURIComponent(input3.groupId)}${buildQuery({ project_id: input3.projectId, limit: input3.limit, cursor: input3.cursor })}`,
106459
+ bearerToken: input3.bearerToken
106460
+ });
106461
+ if (response.status < 200 || response.status >= 300) parseApiError4(response.status, response.body);
106462
+ const parsed = AlertGroupResponseSchema.safeParse(response.body);
106463
+ if (!parsed.success) throw new AlertApiError(response.status, "invalid_response_shape");
106464
+ return parsed.data;
106465
+ },
106131
106466
  async createAlert(input3) {
106132
106467
  const body = {
106133
106468
  project_id: input3.projectId,
@@ -106135,6 +106470,9 @@ function createAlertApi(client) {
106135
106470
  condition_type: input3.conditionType,
106136
106471
  config: input3.config
106137
106472
  };
106473
+ if (input3.channel === "webhook") {
106474
+ body.signing = "hmac_sha256_v1";
106475
+ }
106138
106476
  if (input3.serviceId !== void 0) {
106139
106477
  body.service_id = input3.serviceId;
106140
106478
  }
@@ -106182,6 +106520,9 @@ function createAlertApi(client) {
106182
106520
  if (input3.config !== void 0) {
106183
106521
  body.config = input3.config;
106184
106522
  }
106523
+ if (input3.rotateSigningSecret === true) {
106524
+ body.rotate_signing_secret = true;
106525
+ }
106185
106526
  if (input3.isEnabled !== void 0) {
106186
106527
  body.is_enabled = input3.isEnabled;
106187
106528
  }
@@ -107561,12 +107902,12 @@ async function readConnectionConfig(rootDirectory, readFile) {
107561
107902
 
107562
107903
  // src/interactive-auth.ts
107563
107904
  var import_node_process = require("node:process");
107564
- var import_promises12 = require("node:readline/promises");
107905
+ var import_promises13 = require("node:readline/promises");
107565
107906
  function isInteractiveTerminal() {
107566
107907
  return import_node_process.stdin.isTTY === true && import_node_process.stdout.isTTY === true;
107567
107908
  }
107568
107909
  async function promptForInteractiveLoginSelection() {
107569
- const readlineInterface = (0, import_promises12.createInterface)({
107910
+ const readlineInterface = (0, import_promises13.createInterface)({
107570
107911
  input: import_node_process.stdin,
107571
107912
  output: import_node_process.stdout
107572
107913
  });
@@ -108171,9 +108512,9 @@ function buildValidationFailureResult(input3) {
108171
108512
  }
108172
108513
  async function connectCommand(input3, dependencies = {}) {
108173
108514
  const cwd = dependencies.cwd ?? (() => process.cwd());
108174
- const readFile = dependencies.readFile ?? ((path) => (0, import_promises13.readFile)(path, "utf8"));
108175
- const stat = dependencies.stat ?? import_promises13.stat;
108176
- const writeFile = dependencies.writeFile ?? import_promises13.writeFile;
108515
+ const readFile = dependencies.readFile ?? ((path) => (0, import_promises14.readFile)(path, "utf8"));
108516
+ const stat = dependencies.stat ?? import_promises14.stat;
108517
+ const writeFile = dependencies.writeFile ?? import_promises14.writeFile;
108177
108518
  const readAuthState = dependencies.readAuthState ?? ((authInput) => readCliAuthState(authInput));
108178
108519
  const createHttpClient = dependencies.createHttpClient ?? ((clientInput) => {
108179
108520
  const httpClientDependencies = {};
@@ -108380,7 +108721,7 @@ var legacy_skill_hashes_default = {
108380
108721
  };
108381
108722
 
108382
108723
  // src/agent-setup.ts
108383
- var import_promises14 = require("node:readline/promises");
108724
+ var import_promises15 = require("node:readline/promises");
108384
108725
  var import_node_process2 = require("node:process");
108385
108726
  var MANAGED_AGENTS_START = "<!-- debugbundle:start -->";
108386
108727
  var MANAGED_AGENTS_END = "<!-- debugbundle:end -->";
@@ -108418,7 +108759,7 @@ async function chooseAgents(root, input3, dependencies) {
108418
108759
  let answer;
108419
108760
  if (dependencies.promptUser) answer = await dependencies.promptUser(prompt);
108420
108761
  else {
108421
- const terminal = (0, import_promises14.createInterface)({ input: import_node_process2.stdin, output: import_node_process2.stdout });
108762
+ const terminal = (0, import_promises15.createInterface)({ input: import_node_process2.stdin, output: import_node_process2.stdout });
108422
108763
  try {
108423
108764
  answer = await terminal.question(prompt);
108424
108765
  } finally {
@@ -108470,7 +108811,7 @@ function localScaffoldFailure(error2, json2 = false) {
108470
108811
  }
108471
108812
 
108472
108813
  // src/doctor-command.ts
108473
- var import_promises15 = require("node:fs/promises");
108814
+ var import_promises16 = require("node:fs/promises");
108474
108815
  var import_node_path15 = require("node:path");
108475
108816
  var HealthResponseSchema = external_exports.object({
108476
108817
  status: external_exports.literal("ok")
@@ -108618,7 +108959,7 @@ function buildPrivacyPreview() {
108618
108959
  "body.otp",
108619
108960
  "context.apiKey"
108620
108961
  ];
108621
- const sampleEventClass = classifyEvent(sampleEvent.event_type, void 0, void 0, sampleEvent.payload);
108962
+ const sampleEventClass = classifyEvent(sampleEvent.event_type, void 0, void 0, sampleEvent.payload, "minimal", [], [], sampleEvent.service.runtime);
108622
108963
  return {
108623
108964
  policy_version: TELEMETRY_PRIVACY_POLICY_VERSION,
108624
108965
  rule_families: ["sensitive_keys", "credential_text", "urls", "private_keys", "payment_cards"],
@@ -109014,13 +109355,13 @@ async function runDoctorCommand(input3, dependencies = {}) {
109014
109355
  const now = dependencies.now ?? (() => /* @__PURE__ */ new Date());
109015
109356
  const fetchImpl = dependencies.fetchImpl ?? nodeFetch;
109016
109357
  const readAuthStateImpl = dependencies.readAuthState ?? readCliAuthState;
109017
- const readdir = dependencies.readdir ?? import_promises15.readdir;
109358
+ const readdir = dependencies.readdir ?? import_promises16.readdir;
109018
109359
  const readFile = dependencies.readFile ?? (async (filePath) => {
109019
109360
  const content = await readManaged(rootDirectory, (0, import_node_path15.relative)(rootDirectory, filePath));
109020
109361
  if (content === void 0) throw Object.assign(new Error("Missing local scaffold file."), { code: "ENOENT" });
109021
109362
  return content;
109022
109363
  });
109023
- const stat = dependencies.stat ?? import_promises15.stat;
109364
+ const stat = dependencies.stat ?? import_promises16.stat;
109024
109365
  const rootDirectory = await projectRoot(cwd());
109025
109366
  const currentTime = now();
109026
109367
  const { check: profileCheck, profile, validationErrors } = await loadProfile(rootDirectory, { readFile, stat });
@@ -109066,7 +109407,7 @@ async function doctorCommand(input3, dependencies = {}) {
109066
109407
 
109067
109408
  // src/ingest-command.ts
109068
109409
  var import_node_crypto13 = require("node:crypto");
109069
- var import_promises17 = require("node:fs/promises");
109410
+ var import_promises18 = require("node:fs/promises");
109070
109411
  var import_node_path17 = require("node:path");
109071
109412
 
109072
109413
  // ../../packages/log-parser/src/project-id.ts
@@ -109386,7 +109727,7 @@ function parseLogFile(content, input3) {
109386
109727
 
109387
109728
  // src/process-command.ts
109388
109729
  var import_node_crypto12 = require("node:crypto");
109389
- var import_promises16 = require("node:fs/promises");
109730
+ var import_promises17 = require("node:fs/promises");
109390
109731
  var import_node_path16 = require("node:path");
109391
109732
 
109392
109733
  // ../../packages/shared-types/src/browser-recovery.ts
@@ -110927,7 +111268,10 @@ function classifyEnvelope(envelope, capturePreset) {
110927
111268
  envelope.event_type === "log_event" ? envelope.payload.level : void 0,
110928
111269
  envelope.event_type === "probe_event" ? envelope.payload.activation_id : void 0,
110929
111270
  envelope.payload,
110930
- capturePreset
111271
+ capturePreset,
111272
+ [],
111273
+ [],
111274
+ envelope.service.runtime
110931
111275
  );
110932
111276
  }
110933
111277
  function isIncidentSignalEnvelope(envelope, capturePreset) {
@@ -111245,11 +111589,11 @@ function serializeState(state) {
111245
111589
  }
111246
111590
  async function processCommand(input3, dependencies = {}) {
111247
111591
  const cwd = dependencies.cwd ?? (() => process.cwd());
111248
- const mkdir5 = dependencies.mkdir ?? import_promises16.mkdir;
111249
- const readFile = dependencies.readFile ?? ((filePath) => (0, import_promises16.readFile)(filePath, "utf8"));
111250
- const readdir = dependencies.readdir ?? import_promises16.readdir;
111251
- const stat = dependencies.stat ?? import_promises16.stat;
111252
- const writeFile = dependencies.writeFile ?? ((filePath, content) => (0, import_promises16.writeFile)(filePath, content, "utf8"));
111592
+ const mkdir5 = dependencies.mkdir ?? import_promises17.mkdir;
111593
+ const readFile = dependencies.readFile ?? ((filePath) => (0, import_promises17.readFile)(filePath, "utf8"));
111594
+ const readdir = dependencies.readdir ?? import_promises17.readdir;
111595
+ const stat = dependencies.stat ?? import_promises17.stat;
111596
+ const writeFile = dependencies.writeFile ?? ((filePath, content) => (0, import_promises17.writeFile)(filePath, content, "utf8"));
111253
111597
  const rootDirectory = cwd();
111254
111598
  const eventsDirectoryPath = (0, import_node_path16.join)(rootDirectory, LOCAL_EVENTS_DIRECTORY_PATH2);
111255
111599
  const statePath = (0, import_node_path16.join)(rootDirectory, LOCAL_STATE_FILE_PATH);
@@ -111539,11 +111883,11 @@ async function ingestCommand(input3, dependencies = {}) {
111539
111883
  };
111540
111884
  }
111541
111885
  const cwd = dependencies.cwd ?? (() => process.cwd());
111542
- const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0, import_promises17.mkdir)(path, options));
111886
+ const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0, import_promises18.mkdir)(path, options));
111543
111887
  const processLocalEvents = dependencies.processCommand ?? processCommand;
111544
- const readFile = dependencies.readFile ?? (async (path) => (0, import_promises17.readFile)(path, "utf8"));
111545
- const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises17.rename)(sourcePath, destinationPath));
111546
- const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises17.writeFile)(path, content, "utf8"));
111888
+ const readFile = dependencies.readFile ?? (async (path) => (0, import_promises18.readFile)(path, "utf8"));
111889
+ const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises18.rename)(sourcePath, destinationPath));
111890
+ const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises18.writeFile)(path, content, "utf8"));
111547
111891
  try {
111548
111892
  const rootDirectory = cwd();
111549
111893
  const profile = await readProfile(rootDirectory, readFile);
@@ -111600,7 +111944,7 @@ async function ingestCommand(input3, dependencies = {}) {
111600
111944
  }
111601
111945
 
111602
111946
  // src/watch-command.ts
111603
- var import_promises18 = require("node:fs/promises");
111947
+ var import_promises19 = require("node:fs/promises");
111604
111948
  var import_node_path18 = require("node:path");
111605
111949
  function normalizeBaseUrl5(baseUrl) {
111606
111950
  return baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
@@ -111644,18 +111988,18 @@ async function watchCommand(input3, dependencies = {}) {
111644
111988
  };
111645
111989
  }
111646
111990
  const cwd = dependencies.cwd ?? (() => process.cwd());
111647
- const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0, import_promises18.mkdir)(path, options));
111991
+ const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0, import_promises19.mkdir)(path, options));
111648
111992
  const pollIntervalMs = dependencies.pollIntervalMs ?? 1e3;
111649
111993
  const processLocalEvents = dependencies.processCommand ?? processCommand;
111650
- const readFile = dependencies.readFile ?? (async (path) => (0, import_promises18.readFile)(path));
111994
+ const readFile = dependencies.readFile ?? (async (path) => (0, import_promises19.readFile)(path));
111651
111995
  const readEnv = dependencies.readEnv ?? ((name) => process.env[name]);
111652
- const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises18.rename)(sourcePath, destinationPath));
111996
+ const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises19.rename)(sourcePath, destinationPath));
111653
111997
  const fetchDependencies = dependencies.fetchImpl === void 0 ? void 0 : { fetchImpl: dependencies.fetchImpl };
111654
111998
  const sendEvents = dependencies.sendEvents ?? ((requestInput) => sendEventsToApi(requestInput, fetchDependencies));
111655
111999
  const signal = dependencies.signal;
111656
112000
  const sleep = dependencies.sleep ?? (async (milliseconds) => new Promise((resolve4) => setTimeout(resolve4, milliseconds)));
111657
- const stat = dependencies.stat ?? import_promises18.stat;
111658
- const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises18.writeFile)(path, content, "utf8"));
112001
+ const stat = dependencies.stat ?? import_promises19.stat;
112002
+ const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises19.writeFile)(path, content, "utf8"));
111659
112003
  try {
111660
112004
  const rootDirectory = cwd();
111661
112005
  const profile = await readProfile(rootDirectory, async (path) => (await readFile(path)).toString("utf8"));
@@ -111777,7 +112121,7 @@ async function watchCommand(input3, dependencies = {}) {
111777
112121
  }
111778
112122
 
111779
112123
  // src/setup-command.ts
111780
- var import_promises20 = require("node:fs/promises");
112124
+ var import_promises21 = require("node:fs/promises");
111781
112125
  var import_node_path21 = require("node:path");
111782
112126
 
111783
112127
  // src/setup-service-discovery.ts
@@ -112453,10 +112797,10 @@ async function resolveRelaySetup(rootDirectory, services, selectedTargetNames, r
112453
112797
  }
112454
112798
 
112455
112799
  // src/setup-target-selection.ts
112456
- var import_promises19 = require("node:readline/promises");
112800
+ var import_promises20 = require("node:readline/promises");
112457
112801
  var import_node_process3 = require("node:process");
112458
112802
  function defaultPromptUser(prompt) {
112459
- const terminal = (0, import_promises19.createInterface)({ input: import_node_process3.stdin, output: import_node_process3.stdout });
112803
+ const terminal = (0, import_promises20.createInterface)({ input: import_node_process3.stdin, output: import_node_process3.stdout });
112460
112804
  return terminal.question(prompt).finally(() => {
112461
112805
  terminal.close();
112462
112806
  });
@@ -112776,12 +113120,12 @@ async function buildProfile(rootDirectory, dependencies) {
112776
113120
  async function setupCommand(input3, dependencies = {}) {
112777
113121
  const cwd = dependencies.cwd ?? (() => process.cwd());
112778
113122
  const mkdir5 = dependencies.mkdir ?? (async (path, options) => {
112779
- await (0, import_promises20.mkdir)(path, options);
113123
+ await (0, import_promises21.mkdir)(path, options);
112780
113124
  });
112781
- const readFile = dependencies.readFile ?? (async (path) => (0, import_promises20.readFile)(path, "utf8"));
112782
- const readdir = dependencies.readdir ?? (async (path) => (0, import_promises20.readdir)(path));
112783
- const stat = dependencies.stat ?? (async (path) => (0, import_promises20.stat)(path));
112784
- const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises20.writeFile)(path, content, "utf8"));
113125
+ const readFile = dependencies.readFile ?? (async (path) => (0, import_promises21.readFile)(path, "utf8"));
113126
+ const readdir = dependencies.readdir ?? (async (path) => (0, import_promises21.readdir)(path));
113127
+ const stat = dependencies.stat ?? (async (path) => (0, import_promises21.stat)(path));
113128
+ const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises21.writeFile)(path, content, "utf8"));
112785
113129
  const now = dependencies.now ?? (() => /* @__PURE__ */ new Date());
112786
113130
  try {
112787
113131
  const rootDirectory = await projectRoot(cwd());
@@ -114128,7 +114472,7 @@ function formatCloudResult(input3, exitCode, checks, errors, incidentId, verific
114128
114472
 
114129
114473
  // src/verify-command.ts
114130
114474
  var import_node_crypto14 = require("node:crypto");
114131
- var import_promises21 = require("node:fs/promises");
114475
+ var import_promises22 = require("node:fs/promises");
114132
114476
  var import_node_path22 = require("node:path");
114133
114477
  function localFailureStepName(checks) {
114134
114478
  let hasLocalProcessing = false;
@@ -114345,14 +114689,14 @@ async function writeVerificationEventBatch(input3, dependencies) {
114345
114689
  async function verifyLocalCommand(input3, dependencies = {}) {
114346
114690
  const cwd = dependencies.cwd ?? (() => process.cwd());
114347
114691
  const mkdir5 = dependencies.mkdir ?? (async (path, options) => {
114348
- await (0, import_promises21.mkdir)(path, options);
114692
+ await (0, import_promises22.mkdir)(path, options);
114349
114693
  });
114350
114694
  const now = dependencies.now ?? (() => /* @__PURE__ */ new Date());
114351
114695
  const processLocal = dependencies.processCommand ?? processCommand;
114352
114696
  const readVerifiedLocalState = dependencies.readLocalState ?? readLocalState;
114353
114697
  const readVerifiedLocalBundle = dependencies.getLocalBundle ?? getLocalBundle;
114354
- const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises21.rename)(sourcePath, destinationPath));
114355
- const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises21.writeFile)(path, content, "utf8"));
114698
+ const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises22.rename)(sourcePath, destinationPath));
114699
+ const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises22.writeFile)(path, content, "utf8"));
114356
114700
  const checks = [];
114357
114701
  function finalize(exitCode, errors, incidentId) {
114358
114702
  return formatResult(input3, exitCode, checks, errors, incidentId);
@@ -114373,7 +114717,7 @@ async function verifyLocalCommand(input3, dependencies = {}) {
114373
114717
  });
114374
114718
  try {
114375
114719
  const rootDirectory = cwd();
114376
- const profile = await readProfile(rootDirectory, async (path) => (0, import_promises21.readFile)(path, "utf8"));
114720
+ const profile = await readProfile(rootDirectory, async (path) => (0, import_promises22.readFile)(path, "utf8"));
114377
114721
  const projectId = buildProjectId(profile);
114378
114722
  const verificationNow = now();
114379
114723
  const runId = verificationNow.toISOString().replace(/[-:.TZ]/g, "").slice(0, 14);
@@ -114998,6 +115342,10 @@ var CLI_USAGE_LINES = [
114998
115342
  " debugbundle analytics saved-funnels create --project <id> --key <key> --name <name> --steps-json <json> [--auth-file <path>] [--json]",
114999
115343
  " debugbundle analytics saved-funnels update <key> --project <id> [--name <name>] [--steps-json <json>] [--auth-file <path>] [--json]",
115000
115344
  " debugbundle analytics saved-funnels archive <key> --project <id> [--auth-file <path>] [--json]",
115345
+ " debugbundle analytics flows list --project <id> [--auth-file <path>] [--json]",
115346
+ " debugbundle analytics flows save --project <id> --definition-json <json> [--auth-file <path>] [--json]",
115347
+ " debugbundle analytics flows report --project <id> --key <key> [--window <7d|30d|90d>] [--auth-file <path>] [--json]",
115348
+ " debugbundle analytics flows archive --project <id> --key <key> [--auth-file <path>] [--json]",
115001
115349
  " debugbundle analytics summary --project <id> [--from <ISO8601>] [--to <ISO8601>] [--last <duration>] [--granularity <hour|day>] [--service <name>] [--environment <name>] [--limit <n>] [--auth-file <path>] [--json]",
115002
115350
  " debugbundle analytics routes --project <id> [--from <ISO8601>] [--to <ISO8601>] [--last <duration>] [--granularity <hour|day>] [--service <name>] [--environment <name>] [--limit <n>] [--auth-file <path>] [--json]",
115003
115351
  " debugbundle analytics journeys --project <id> [--from <ISO8601>] [--to <ISO8601>] [--last <duration>] [--granularity <hour|day>] [--service <name>] [--environment <name>] [--limit <n>] [--auth-file <path>] [--json]",
@@ -115039,8 +115387,10 @@ var CLI_USAGE_LINES = [
115039
115387
  " debugbundle token member create --label <label> [--auth-file <path>] [--json]",
115040
115388
  " debugbundle token member revoke <token-id> [--auth-file <path>] [--json]",
115041
115389
  " debugbundle alert list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]",
115390
+ " debugbundle alert groups --project-id <id> [--limit <n>] [--cursor <cursor>] [--auth-file <path>] [--json]",
115391
+ " debugbundle alert group <direct|email_digest> <group-id> --project-id <id> [--limit <n>] [--cursor <cursor>] [--auth-file <path>] [--json]",
115042
115392
  " debugbundle alert create --project-id <id> --channel <channel> --condition <condition> [--service-id <id>] [--severity-min <level>] [--severity-lifecycle-scope <new_incident|incident_regressed|both>] [--cooldown <seconds>] --config-json <json> [--is-enabled <true|false>] [--auth-file <path>] [--json]",
115043
- " debugbundle alert update <alert-id> --project-id <id> [--service-id <id|null>] [--channel <channel>] [--condition <condition>] [--severity-min <level|null>] [--severity-lifecycle-scope <new_incident|incident_regressed|both|null>] [--cooldown <seconds>] [--config-json <json|null>] [--is-enabled <true|false>] [--auth-file <path>] [--json]",
115393
+ " debugbundle alert update <alert-id> --project-id <id> [--service-id <id|null>] [--channel <channel>] [--condition <condition>] [--severity-min <level|null>] [--severity-lifecycle-scope <new_incident|incident_regressed|both|null>] [--cooldown <seconds>] [--config-json <json|null>] [--rotate-signing-secret <true|false>] [--is-enabled <true|false>] [--auth-file <path>] [--json]",
115044
115394
  " Email config supports aggregation_window_seconds (1-300, default 10); other channels support cooldown_scope (incident or project, isolated by environment/severity).",
115045
115395
  " debugbundle alert delete <alert-id> --project-id <id> [--auth-file <path>] [--json]",
115046
115396
  " debugbundle slack list --project-id <id> [--auth-file <path>] [--json]",
@@ -115099,7 +115449,7 @@ function formatUsage() {
115099
115449
  }
115100
115450
 
115101
115451
  // src/validate-command.ts
115102
- var import_promises22 = require("node:fs/promises");
115452
+ var import_promises23 = require("node:fs/promises");
115103
115453
  var import_node_path23 = require("node:path");
115104
115454
  var SUGGESTED_ACTIONS2 = [
115105
115455
  "Run debugbundle setup if .debugbundle/profile.json is missing.",
@@ -115214,14 +115564,14 @@ async function fixMissingFile(rootDirectory, filePath, buildContent, dependencie
115214
115564
  async function runValidateCommand(input3, dependencies = {}) {
115215
115565
  const cwd = dependencies.cwd ?? (() => process.cwd());
115216
115566
  const mkdir5 = dependencies.mkdir ?? (async (path, options) => {
115217
- await (0, import_promises22.mkdir)(path, options);
115567
+ await (0, import_promises23.mkdir)(path, options);
115218
115568
  });
115219
115569
  const readFile = dependencies.readFile ?? (async (filePath) => {
115220
115570
  const content = await readManaged(rootDirectory, (0, import_node_path23.relative)(rootDirectory, filePath));
115221
115571
  if (content === void 0) throw Object.assign(new Error("Missing local scaffold file."), { code: "ENOENT" });
115222
115572
  return content;
115223
115573
  });
115224
- const stat = dependencies.stat ?? import_promises22.stat;
115574
+ const stat = dependencies.stat ?? import_promises23.stat;
115225
115575
  const rootDirectory = await projectRoot(cwd());
115226
115576
  for (const file of [PROFILE_FILE_PATH, CONNECTION_FILE_PATH, GITIGNORE_FILE_PATH]) await safePath(rootDirectory, file);
115227
115577
  const profileValidation = await validateProfile(rootDirectory, { readFile, stat });
@@ -117046,6 +117396,103 @@ async function getAnalyticsJourneySampleWithAuthCommand(input3, dependencies) {
117046
117396
  });
117047
117397
  }
117048
117398
 
117399
+ // src/analytics-flow-commands.ts
117400
+ var AnalyticsFlowApiError = class extends Error {
117401
+ constructor(status, message3) {
117402
+ super(message3);
117403
+ this.status = status;
117404
+ }
117405
+ };
117406
+ function createAnalyticsFlowApi(http) {
117407
+ const path = (input3) => `/v1/projects/${encodeURIComponent(input3.projectId)}/analytics/flows`;
117408
+ async function request(input3, schema) {
117409
+ const response = await http.request(input3);
117410
+ if (response.status !== 200) {
117411
+ const error2 = external_exports.object({ error: external_exports.string() }).safeParse(response.body);
117412
+ throw new AnalyticsFlowApiError(
117413
+ response.status,
117414
+ error2.success ? error2.data.error : "Flow request failed."
117415
+ );
117416
+ }
117417
+ const parsed = schema.safeParse(response.body);
117418
+ if (!parsed.success) throw new AnalyticsFlowApiError(500, "Invalid flow response.");
117419
+ return parsed.data;
117420
+ }
117421
+ return {
117422
+ list: (input3) => request(
117423
+ { method: "GET", path: path(input3), bearerToken: input3.bearerToken },
117424
+ AnalyticsFlowsResponseSchema
117425
+ ),
117426
+ save: (input3) => {
117427
+ const definition = AnalyticsFlowDefinitionInputSchema.parse(input3.definition);
117428
+ return request(
117429
+ {
117430
+ method: "PUT",
117431
+ path: `${path(input3)}/${definition.flow_key}`,
117432
+ bearerToken: input3.bearerToken,
117433
+ body: definition
117434
+ },
117435
+ AnalyticsFlowResponseSchema
117436
+ );
117437
+ },
117438
+ archive: (input3) => request(
117439
+ {
117440
+ method: "DELETE",
117441
+ path: `${path(input3)}/${encodeURIComponent(AnalyticsFlowKeySchema.parse(input3.flowKey))}`,
117442
+ bearerToken: input3.bearerToken
117443
+ },
117444
+ external_exports.object({ archived: external_exports.literal(true) })
117445
+ ),
117446
+ report: (input3) => request(
117447
+ {
117448
+ method: "GET",
117449
+ path: `${path(input3)}/${encodeURIComponent(input3.flowKey)}/report?window=${input3.window ?? "30d"}`,
117450
+ bearerToken: input3.bearerToken
117451
+ },
117452
+ AnalyticsFlowReportSchema
117453
+ )
117454
+ };
117455
+ }
117456
+ async function analyticsFlowWithAuthCommand(input3, dependencies) {
117457
+ return runAuthenticatedCliCommand(input3, {
117458
+ dependencies,
117459
+ async createApi(authInput, deps) {
117460
+ const authState = await (deps?.readAuthState ?? readCliAuthState)(authInput);
117461
+ return {
117462
+ authState,
117463
+ api: createAnalyticsFlowApi(
117464
+ (deps?.createHttpClient ?? createCliHttpClient)({ baseUrl: authState.base_url })
117465
+ )
117466
+ };
117467
+ },
117468
+ async runCommand(auth, api) {
117469
+ try {
117470
+ const scope = { projectId: input3.projectId, bearerToken: auth.bearer_token };
117471
+ let result;
117472
+ if (input3.action === "list") result = await api.list(scope);
117473
+ else if (input3.action === "save")
117474
+ result = await api.save({
117475
+ ...scope,
117476
+ definition: AnalyticsFlowDefinitionInputSchema.parse(input3.definition)
117477
+ });
117478
+ else {
117479
+ const item = { ...scope, flowKey: AnalyticsFlowKeySchema.parse(input3.flowKey) };
117480
+ result = input3.action === "archive" ? await api.archive(item) : await api.report({
117481
+ ...item,
117482
+ ...input3.window === void 0 ? {} : { window: input3.window }
117483
+ });
117484
+ }
117485
+ return { exitCode: 0, output: JSON.stringify(result, null, input3.json ? void 0 : 2) };
117486
+ } catch (error2) {
117487
+ return {
117488
+ exitCode: error2 instanceof AnalyticsFlowApiError ? error2.status === 401 ? 2 : error2.status === 404 ? 3 : [400, 403, 409].includes(error2.status) ? 4 : 1 : 1,
117489
+ output: error2 instanceof Error ? error2.message : "Flow request failed."
117490
+ };
117491
+ }
117492
+ }
117493
+ });
117494
+ }
117495
+
117049
117496
  // src/management-analytics-command-handlers.ts
117050
117497
  function readFloatOption(parsedArgv, optionName) {
117051
117498
  const rawValue = readStringOption(parsedArgv, optionName);
@@ -117252,6 +117699,42 @@ function buildAnalyticsSettingsUpdate(parsedArgv) {
117252
117699
  }
117253
117700
  async function handleAnalyticsCommand(parsedArgv, dependencies) {
117254
117701
  const resource = requirePositional(parsedArgv, 1, "analytics resource");
117702
+ if (resource === "flows") {
117703
+ const action2 = requirePositional(parsedArgv, 2, "flows action");
117704
+ if (!["list", "save", "archive", "report"].includes(action2))
117705
+ throw new CliInputError("Unknown analytics flows command.");
117706
+ expectNoUnknownOptions(parsedArgv, [
117707
+ "project",
117708
+ "project-id",
117709
+ "key",
117710
+ "definition-json",
117711
+ "window",
117712
+ "auth-file",
117713
+ "json"
117714
+ ]);
117715
+ ensureNoExtraPositionals(parsedArgv, 3);
117716
+ const projectId = readProjectOption(parsedArgv);
117717
+ if (!projectId) throw new CliInputError("Missing required option --project.");
117718
+ const flowKey = readStringOption(parsedArgv, "key");
117719
+ if ((action2 === "report" || action2 === "archive") && !flowKey)
117720
+ throw new CliInputError("Missing required option --key.");
117721
+ const window2 = readStringOption(parsedArgv, "window");
117722
+ if (window2 !== void 0 && window2 !== "7d" && window2 !== "30d" && window2 !== "90d")
117723
+ throw new CliInputError("Invalid value for --window.");
117724
+ const definition = action2 === "save" ? AnalyticsFlowDefinitionInputSchema.safeParse(
117725
+ readJsonOption(parsedArgv, "definition-json")
117726
+ ) : void 0;
117727
+ if (definition && !definition.success) throw new CliInputError("Invalid flow definition.");
117728
+ return await (dependencies.analyticsFlowCommand ?? analyticsFlowWithAuthCommand)(
117729
+ appendCommonAuthOptions(parsedArgv, {
117730
+ action: action2,
117731
+ projectId,
117732
+ ...flowKey === void 0 ? {} : { flowKey },
117733
+ ...window2 === void 0 ? {} : { window: window2 },
117734
+ ...definition?.success ? { definition: definition.data } : {}
117735
+ })
117736
+ );
117737
+ }
117255
117738
  if (resource === "summary" || resource === "routes" || resource === "journeys" || resource === "devices" || resource === "referrers" || resource === "actions" || resource === "funnels") {
117256
117739
  expectNoUnknownOptions(parsedArgv, [
117257
117740
  "project",
@@ -122317,6 +122800,78 @@ async function listAlertsWithAuthCommand(input3, dependencies) {
122317
122800
  }
122318
122801
  });
122319
122802
  }
122803
+ async function listAlertGroupsCommand(input3, api) {
122804
+ try {
122805
+ const result = await api.listAlertGroups({
122806
+ bearerToken: input3.bearerToken,
122807
+ projectId: input3.projectId,
122808
+ ...input3.limit === void 0 ? {} : { limit: input3.limit },
122809
+ ...input3.cursor === void 0 ? {} : { cursor: input3.cursor }
122810
+ });
122811
+ const lines = result.groups.map(
122812
+ (group) => `${group.group_id} | ${group.kind} | ${group.channel} | ${group.status} | incidents=${group.member_count} | root=${group.root_incident_id ?? "none"} | ${group.created_at}`
122813
+ );
122814
+ return {
122815
+ exitCode: 0,
122816
+ output: input3.json ? JSON.stringify(result) : [
122817
+ ...lines.length === 0 ? ["No alert groups found."] : lines,
122818
+ ...result.next_cursor === null ? [] : [`Next cursor: ${result.next_cursor}`]
122819
+ ].join("\n")
122820
+ };
122821
+ } catch (error2) {
122822
+ return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
122823
+ }
122824
+ }
122825
+ async function listAlertGroupsWithAuthCommand(input3, dependencies) {
122826
+ return runAuthenticatedCliCommand(input3, {
122827
+ createApi: createAuthenticatedAlertApi,
122828
+ dependencies,
122829
+ runCommand: (authState, api) => listAlertGroupsCommand({
122830
+ bearerToken: authState.bearer_token,
122831
+ projectId: input3.projectId,
122832
+ ...input3.limit === void 0 ? {} : { limit: input3.limit },
122833
+ ...input3.cursor === void 0 ? {} : { cursor: input3.cursor },
122834
+ ...input3.json === void 0 ? {} : { json: input3.json }
122835
+ }, api)
122836
+ });
122837
+ }
122838
+ async function getAlertGroupCommand(input3, api) {
122839
+ try {
122840
+ const result = await api.getAlertGroup({
122841
+ bearerToken: input3.bearerToken,
122842
+ projectId: input3.projectId,
122843
+ kind: input3.kind,
122844
+ groupId: input3.groupId,
122845
+ ...input3.limit === void 0 ? {} : { limit: input3.limit },
122846
+ ...input3.cursor === void 0 ? {} : { cursor: input3.cursor }
122847
+ });
122848
+ return {
122849
+ exitCode: 0,
122850
+ output: input3.json ? JSON.stringify(result) : [
122851
+ `${result.group.group_id} | ${result.group.kind} | ${result.group.channel} | ${result.group.status} | incidents=${result.group.member_count}`,
122852
+ ...result.members.map((member) => `${member.incident_id} | ${member.condition_type} | ${member.created_at}`),
122853
+ ...result.next_cursor === null ? [] : [`Next cursor: ${result.next_cursor}`]
122854
+ ].join("\n")
122855
+ };
122856
+ } catch (error2) {
122857
+ return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
122858
+ }
122859
+ }
122860
+ async function getAlertGroupWithAuthCommand(input3, dependencies) {
122861
+ return runAuthenticatedCliCommand(input3, {
122862
+ createApi: createAuthenticatedAlertApi,
122863
+ dependencies,
122864
+ runCommand: (authState, api) => getAlertGroupCommand({
122865
+ bearerToken: authState.bearer_token,
122866
+ projectId: input3.projectId,
122867
+ kind: input3.kind,
122868
+ groupId: input3.groupId,
122869
+ ...input3.limit === void 0 ? {} : { limit: input3.limit },
122870
+ ...input3.cursor === void 0 ? {} : { cursor: input3.cursor },
122871
+ ...input3.json === void 0 ? {} : { json: input3.json }
122872
+ }, api)
122873
+ });
122874
+ }
122320
122875
  async function createAlertCommand(input3, api) {
122321
122876
  try {
122322
122877
  const requestInput = {
@@ -122344,7 +122899,10 @@ async function createAlertCommand(input3, api) {
122344
122899
  const alert = await api.createAlert(requestInput);
122345
122900
  return {
122346
122901
  exitCode: 0,
122347
- output: input3.json ? JSON.stringify({ alert }) : `Alert created: ${alert.alert_id}`
122902
+ output: input3.json ? JSON.stringify({ alert }) : [
122903
+ `Alert created: ${alert.alert_id}`,
122904
+ ...alert.signing_secret === void 0 ? [] : [`Signing secret (shown once): ${alert.signing_secret}`]
122905
+ ].join("\n")
122348
122906
  };
122349
122907
  } catch (error2) {
122350
122908
  return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
@@ -122414,13 +122972,19 @@ async function updateAlertCommand(input3, api) {
122414
122972
  if (input3.config !== void 0) {
122415
122973
  requestInput.config = input3.config;
122416
122974
  }
122975
+ if (input3.rotateSigningSecret === true) {
122976
+ requestInput.rotateSigningSecret = true;
122977
+ }
122417
122978
  if (input3.isEnabled !== void 0) {
122418
122979
  requestInput.isEnabled = input3.isEnabled;
122419
122980
  }
122420
122981
  const alert = await api.updateAlert(requestInput);
122421
122982
  return {
122422
122983
  exitCode: 0,
122423
- output: input3.json ? JSON.stringify({ alert }) : `Alert updated: ${alert.alert_id}`
122984
+ output: input3.json ? JSON.stringify({ alert }) : [
122985
+ `Alert updated: ${alert.alert_id}`,
122986
+ ...alert.signing_secret === void 0 ? [] : [`Signing secret (shown once): ${alert.signing_secret}`]
122987
+ ].join("\n")
122424
122988
  };
122425
122989
  } catch (error2) {
122426
122990
  return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
@@ -122457,6 +123021,9 @@ async function updateAlertWithAuthCommand(input3, dependencies) {
122457
123021
  if (input3.config !== void 0) {
122458
123022
  commandInput.config = input3.config;
122459
123023
  }
123024
+ if (input3.rotateSigningSecret === true) {
123025
+ commandInput.rotateSigningSecret = true;
123026
+ }
122460
123027
  if (input3.isEnabled !== void 0) {
122461
123028
  commandInput.isEnabled = input3.isEnabled;
122462
123029
  }
@@ -123351,6 +123918,36 @@ async function handleWebhookCommand(parsedArgv, dependencies) {
123351
123918
  }
123352
123919
  async function handleAlertCommand(parsedArgv, dependencies) {
123353
123920
  const action = requirePositional(parsedArgv, 1, "action");
123921
+ if (action === "groups" || action === "group") {
123922
+ expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id", "limit", "cursor"]);
123923
+ ensureNoExtraPositionals(parsedArgv, action === "groups" ? 2 : 4);
123924
+ const projectId = readStringOption(parsedArgv, "project-id");
123925
+ if (projectId === void 0) throw new CliInputError("Missing required option --project-id.");
123926
+ const limit = readLimitOption(parsedArgv);
123927
+ const cursor = readStringOption(parsedArgv, "cursor");
123928
+ if (action === "groups") {
123929
+ return await (dependencies.listAlertGroupsCommand ?? listAlertGroupsWithAuthCommand)(
123930
+ appendCommonAuthOptions(parsedArgv, {
123931
+ projectId,
123932
+ ...limit === void 0 ? {} : { limit },
123933
+ ...cursor === void 0 ? {} : { cursor }
123934
+ })
123935
+ );
123936
+ }
123937
+ const kind = requirePositional(parsedArgv, 2, "kind");
123938
+ if (kind !== "direct" && kind !== "email_digest") {
123939
+ throw new CliInputError("Alert group kind must be direct or email_digest.");
123940
+ }
123941
+ return await (dependencies.getAlertGroupCommand ?? getAlertGroupWithAuthCommand)(
123942
+ appendCommonAuthOptions(parsedArgv, {
123943
+ projectId,
123944
+ kind,
123945
+ groupId: requirePositional(parsedArgv, 3, "group-id"),
123946
+ ...limit === void 0 ? {} : { limit },
123947
+ ...cursor === void 0 ? {} : { cursor }
123948
+ })
123949
+ );
123950
+ }
123354
123951
  if (action === "list") {
123355
123952
  expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id", "limit"]);
123356
123953
  ensureNoExtraPositionals(parsedArgv, 2);
@@ -123438,6 +124035,7 @@ async function handleAlertCommand(parsedArgv, dependencies) {
123438
124035
  "severity-lifecycle-scope",
123439
124036
  "cooldown",
123440
124037
  "config-json",
124038
+ "rotate-signing-secret",
123441
124039
  "is-enabled"
123442
124040
  ]);
123443
124041
  ensureNoExtraPositionals(parsedArgv, 3);
@@ -123477,11 +124075,14 @@ async function handleAlertCommand(parsedArgv, dependencies) {
123477
124075
  if (config2 !== void 0) {
123478
124076
  input3.config = config2;
123479
124077
  }
124078
+ if (readBooleanStringOption(parsedArgv, "rotate-signing-secret") === true) {
124079
+ input3.rotateSigningSecret = true;
124080
+ }
123480
124081
  const isEnabled = readBooleanStringOption(parsedArgv, "is-enabled");
123481
124082
  if (isEnabled !== void 0) {
123482
124083
  input3.isEnabled = isEnabled;
123483
124084
  }
123484
- if (input3.serviceId === void 0 && input3.channel === void 0 && input3.conditionType === void 0 && input3.severityMin === void 0 && input3.severityLifecycleScope === void 0 && input3.cooldownSeconds === void 0 && input3.config === void 0 && input3.isEnabled === void 0) {
124085
+ if (input3.serviceId === void 0 && input3.channel === void 0 && input3.conditionType === void 0 && input3.severityMin === void 0 && input3.severityLifecycleScope === void 0 && input3.cooldownSeconds === void 0 && input3.config === void 0 && input3.rotateSigningSecret === void 0 && input3.isEnabled === void 0) {
123485
124086
  throw new CliInputError("At least one alert field must be provided.");
123486
124087
  }
123487
124088
  return await (dependencies.updateAlertCommand ?? updateAlertWithAuthCommand)(input3);
@@ -123739,7 +124340,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
123739
124340
  // package.json
123740
124341
  var package_default = {
123741
124342
  name: "@debugbundle/cli",
123742
- version: "1.11.0",
124343
+ version: "1.13.0",
123743
124344
  private: false,
123744
124345
  description: "Command-line interface for DebugBundle",
123745
124346
  license: "Apache-2.0",