@debugbundle/cli 1.11.0 → 1.12.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.
- package/dist/main.cjs +446 -113
- 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
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
14958
|
+
var Agent3 = require_agent();
|
|
14959
14959
|
var Dispatcher1Wrapper = require_dispatcher1_wrapper();
|
|
14960
14960
|
if (getGlobalDispatcher() === void 0) {
|
|
14961
|
-
setGlobalDispatcher(new
|
|
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:
|
|
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
|
-
|
|
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 (
|
|
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
|
|
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 =
|
|
25649
|
+
module2.exports.Agent = Agent3;
|
|
25650
25650
|
module2.exports.Dispatcher1Wrapper = Dispatcher1Wrapper;
|
|
25651
25651
|
module2.exports.ProxyAgent = ProxyAgent;
|
|
25652
25652
|
module2.exports.Socks5ProxyAgent = Socks5ProxyAgent;
|
|
@@ -29507,7 +29507,7 @@ var require_fast_uri = __commonJS({
|
|
|
29507
29507
|
query: void 0,
|
|
29508
29508
|
fragment: void 0
|
|
29509
29509
|
};
|
|
29510
|
-
let
|
|
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
|
-
|
|
29535
|
+
isIP3 = ipv6result.isIPV6;
|
|
29536
29536
|
} else {
|
|
29537
|
-
|
|
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) &&
|
|
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 =
|
|
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
|
|
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 =
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
59831
|
+
result = lookup2[(char ^ result >> 8) & 255] ^ result << 8;
|
|
59832
59832
|
}
|
|
59833
59833
|
return result & 16383;
|
|
59834
59834
|
};
|
|
@@ -73853,6 +73853,7 @@ function buildCliReference() {
|
|
|
73853
73853
|
"## Notifications",
|
|
73854
73854
|
"",
|
|
73855
73855
|
"- `debugbundle alert list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]`",
|
|
73856
|
+
"- `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
73857
|
"- `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
73858
|
"- `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
73859
|
"- `debugbundle alert delete <alert-id> --project-id <id> [--auth-file <path>] [--json]`",
|
|
@@ -74006,7 +74007,7 @@ function buildMcpReference() {
|
|
|
74006
74007
|
"",
|
|
74007
74008
|
"## Notification Tools",
|
|
74008
74009
|
"",
|
|
74009
|
-
"- `list_alerts`, `create_alert`, `update_alert`, `delete_alert` \u2014 manage incident alert rules.",
|
|
74010
|
+
"- `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
74011
|
"- `list_webhooks`, `create_webhook`, `update_webhook`, `delete_webhook` \u2014 manage signed webhook destinations.",
|
|
74011
74012
|
"- `test_webhook`, `list_webhook_deliveries` \u2014 validate webhook delivery and inspect delivery history.",
|
|
74012
74013
|
"",
|
|
@@ -82199,7 +82200,7 @@ async function agentReadCommand(input3, dependencies = {}) {
|
|
|
82199
82200
|
}
|
|
82200
82201
|
|
|
82201
82202
|
// src/clean-command.ts
|
|
82202
|
-
var
|
|
82203
|
+
var import_promises11 = require("node:fs/promises");
|
|
82203
82204
|
var import_node_path11 = require("node:path");
|
|
82204
82205
|
|
|
82205
82206
|
// src/cli-fs-helpers.ts
|
|
@@ -82215,7 +82216,7 @@ function resolveWorkspacePath(rootDirectory, targetPath) {
|
|
|
82215
82216
|
}
|
|
82216
82217
|
|
|
82217
82218
|
// src/local-retrieval-store.ts
|
|
82218
|
-
var
|
|
82219
|
+
var import_promises9 = require("node:fs/promises");
|
|
82219
82220
|
var import_node_path9 = require("node:path");
|
|
82220
82221
|
|
|
82221
82222
|
// ../../packages/retrieval-client/src/mutation-outcome.ts
|
|
@@ -93841,8 +93842,8 @@ function applySSRFProtection(dispatcher2) {
|
|
|
93841
93842
|
return dispatcher2;
|
|
93842
93843
|
}
|
|
93843
93844
|
function createSSRFProtectedDispatcher() {
|
|
93844
|
-
const
|
|
93845
|
-
return applySSRFProtection(new
|
|
93845
|
+
const Agent3 = getAgent();
|
|
93846
|
+
return applySSRFProtection(new Agent3());
|
|
93846
93847
|
}
|
|
93847
93848
|
var dispatcher;
|
|
93848
93849
|
async function fetchRequest(provider, url, options) {
|
|
@@ -99578,6 +99579,88 @@ var CLAIM_DUE_AVAILABILITY_CHECKS_QUERY = `
|
|
|
99578
99579
|
c.consecutive_successes
|
|
99579
99580
|
`;
|
|
99580
99581
|
|
|
99582
|
+
// ../../packages/storage/src/alert-outbound-guard.ts
|
|
99583
|
+
var import_promises8 = require("node:dns/promises");
|
|
99584
|
+
var import_node_net2 = require("node:net");
|
|
99585
|
+
var import_undici3 = __toESM(require_undici(), 1);
|
|
99586
|
+
var blockedAddresses2 = new import_node_net2.BlockList();
|
|
99587
|
+
for (const [address, prefix] of [
|
|
99588
|
+
["0.0.0.0", 8],
|
|
99589
|
+
["10.0.0.0", 8],
|
|
99590
|
+
["100.64.0.0", 10],
|
|
99591
|
+
["127.0.0.0", 8],
|
|
99592
|
+
["169.254.0.0", 16],
|
|
99593
|
+
["172.16.0.0", 12],
|
|
99594
|
+
["192.0.0.0", 24],
|
|
99595
|
+
["192.0.2.0", 24],
|
|
99596
|
+
["192.88.99.0", 24],
|
|
99597
|
+
["192.168.0.0", 16],
|
|
99598
|
+
["198.18.0.0", 15],
|
|
99599
|
+
["198.51.100.0", 24],
|
|
99600
|
+
["203.0.113.0", 24],
|
|
99601
|
+
["224.0.0.0", 4],
|
|
99602
|
+
["240.0.0.0", 4]
|
|
99603
|
+
]) blockedAddresses2.addSubnet(address, prefix);
|
|
99604
|
+
for (const [address, prefix] of [
|
|
99605
|
+
["::", 128],
|
|
99606
|
+
["::1", 128],
|
|
99607
|
+
["64:ff9b::", 96],
|
|
99608
|
+
["100::", 64],
|
|
99609
|
+
["2001::", 23],
|
|
99610
|
+
["2001:db8::", 32],
|
|
99611
|
+
["2002::", 16],
|
|
99612
|
+
["fc00::", 7],
|
|
99613
|
+
["fe80::", 10],
|
|
99614
|
+
["ff00::", 8]
|
|
99615
|
+
]) blockedAddresses2.addSubnet(address, prefix, "ipv6");
|
|
99616
|
+
function blocked() {
|
|
99617
|
+
return new Error("alert_target_blocked");
|
|
99618
|
+
}
|
|
99619
|
+
function assertPublicAddress(address, family) {
|
|
99620
|
+
if (family !== 4 && family !== 6 || (0, import_node_net2.isIP)(address) !== family || blockedAddresses2.check(address, family === 4 ? "ipv4" : "ipv6")) {
|
|
99621
|
+
throw blocked();
|
|
99622
|
+
}
|
|
99623
|
+
}
|
|
99624
|
+
function assertPublicHostname(hostname2) {
|
|
99625
|
+
const normalized = hostname2.toLowerCase().replace(/\.$/, "");
|
|
99626
|
+
if (!normalized.includes(".") || [".local", ".internal", ".localhost"].some((suffix) => normalized.endsWith(suffix))) {
|
|
99627
|
+
throw blocked();
|
|
99628
|
+
}
|
|
99629
|
+
}
|
|
99630
|
+
async function resolveAlertOutboundAddress(hostname2, resolve4 = import_promises8.lookup) {
|
|
99631
|
+
const literalFamily = (0, import_node_net2.isIP)(hostname2);
|
|
99632
|
+
if (literalFamily) {
|
|
99633
|
+
assertPublicAddress(hostname2, literalFamily);
|
|
99634
|
+
return { address: hostname2, family: literalFamily };
|
|
99635
|
+
}
|
|
99636
|
+
assertPublicHostname(hostname2);
|
|
99637
|
+
let answers;
|
|
99638
|
+
try {
|
|
99639
|
+
answers = await resolve4(hostname2, { all: true, verbatim: true });
|
|
99640
|
+
} catch {
|
|
99641
|
+
throw blocked();
|
|
99642
|
+
}
|
|
99643
|
+
if (answers.length === 0) throw blocked();
|
|
99644
|
+
for (const answer of answers) assertPublicAddress(answer.address, answer.family);
|
|
99645
|
+
const first = answers[0];
|
|
99646
|
+
return { address: first.address, family: first.family };
|
|
99647
|
+
}
|
|
99648
|
+
var outboundAgent = new import_undici3.Agent({
|
|
99649
|
+
connections: 4,
|
|
99650
|
+
maxOrigins: 128,
|
|
99651
|
+
connect: {
|
|
99652
|
+
lookup(hostname2, options, callback) {
|
|
99653
|
+
resolveAlertOutboundAddress(hostname2).then(
|
|
99654
|
+
({ address, family }) => {
|
|
99655
|
+
if (options.all) callback(null, [{ address, family }]);
|
|
99656
|
+
else callback(null, address, family);
|
|
99657
|
+
},
|
|
99658
|
+
() => callback(blocked(), "")
|
|
99659
|
+
);
|
|
99660
|
+
}
|
|
99661
|
+
}
|
|
99662
|
+
});
|
|
99663
|
+
|
|
99581
99664
|
// ../../packages/storage/src/auth-rate-limiter.ts
|
|
99582
99665
|
var import_ioredis = __toESM(require_built3(), 1);
|
|
99583
99666
|
|
|
@@ -100097,6 +100180,11 @@ function normalizeInstalledJavaEvent(candidate) {
|
|
|
100097
100180
|
};
|
|
100098
100181
|
}
|
|
100099
100182
|
|
|
100183
|
+
// ../../packages/event-normalizer/src/java-stderr.ts
|
|
100184
|
+
function isJavaRedirectedStderrLogger(candidate) {
|
|
100185
|
+
return typeof candidate === "string" && candidate.length <= 256 && (candidate === "stderr" || candidate === "org.jboss.stdio" || candidate.startsWith("org.jboss.stdio."));
|
|
100186
|
+
}
|
|
100187
|
+
|
|
100100
100188
|
// ../../packages/event-normalizer/src/java-timer-message.ts
|
|
100101
100189
|
var TIMER_DIAGNOSTIC = /^WFLYEJB002(?:0|2):[^\n]*\[id=[^\]\n]*\btimedObjectId=/;
|
|
100102
100190
|
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 +100674,22 @@ function getRequestResponseStatus(payload2) {
|
|
|
100586
100674
|
const status = payload2?.["response_status"];
|
|
100587
100675
|
return typeof status === "number" && Number.isFinite(status) ? status : null;
|
|
100588
100676
|
}
|
|
100589
|
-
function
|
|
100677
|
+
function isJavaStackContinuation(payload2) {
|
|
100678
|
+
const message3 = payload2?.["message"];
|
|
100679
|
+
if (typeof message3 !== "string" || message3.length > 16384 || /[\r\n]/.test(message3)) return false;
|
|
100680
|
+
const attributes = payload2?.["attributes"];
|
|
100681
|
+
if (attributes === null || typeof attributes !== "object" || Array.isArray(attributes)) return false;
|
|
100682
|
+
if (!isJavaRedirectedStderrLogger(attributes["logger"])) return false;
|
|
100683
|
+
if ("throwable" in attributes && attributes.throwable !== null) return false;
|
|
100684
|
+
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);
|
|
100685
|
+
}
|
|
100686
|
+
function classifyEvent(eventType, logLevel, probeActivationId, payload2, capturePreset = "minimal", immediateClientErrorStatuses = [], immediateClientErrorPathRules = [], runtime) {
|
|
100590
100687
|
switch (eventType) {
|
|
100591
100688
|
case "backend_exception":
|
|
100592
100689
|
case "frontend_exception":
|
|
100593
100690
|
return "incident_signal";
|
|
100594
100691
|
case "log_event":
|
|
100692
|
+
if (runtime === "java" && isJavaStackContinuation(payload2)) return "context_signal";
|
|
100595
100693
|
if (logLevel !== void 0 && INCIDENT_LOG_LEVELS.has(logLevel)) {
|
|
100596
100694
|
return "incident_signal";
|
|
100597
100695
|
}
|
|
@@ -102225,6 +102323,8 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
102225
102323
|
severity_lifecycle_scope text,
|
|
102226
102324
|
cooldown_seconds integer NOT NULL DEFAULT 0,
|
|
102227
102325
|
config jsonb NOT NULL DEFAULT '{}'::jsonb,
|
|
102326
|
+
signing_secret text,
|
|
102327
|
+
webhook_payload_version smallint NOT NULL DEFAULT 0 CHECK (webhook_payload_version IN (0, 1)),
|
|
102228
102328
|
is_enabled boolean NOT NULL DEFAULT true,
|
|
102229
102329
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
102230
102330
|
updated_at timestamptz NOT NULL DEFAULT now(),
|
|
@@ -102271,6 +102371,7 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
102271
102371
|
dedupe_key text NOT NULL,
|
|
102272
102372
|
notification_key text NOT NULL DEFAULT '',
|
|
102273
102373
|
coalescing_key text,
|
|
102374
|
+
evaluation_job_id text,
|
|
102274
102375
|
channel text NOT NULL,
|
|
102275
102376
|
status text NOT NULL,
|
|
102276
102377
|
payload jsonb NOT NULL,
|
|
@@ -102289,6 +102390,21 @@ var STORAGE_BOOTSTRAP_STATEMENTS = [
|
|
|
102289
102390
|
CREATE INDEX alert_deliveries_alert_notification_idx
|
|
102290
102391
|
ON alert_deliveries (alert_id, notification_key, created_at DESC)
|
|
102291
102392
|
`,
|
|
102393
|
+
`
|
|
102394
|
+
CREATE TABLE alert_delivery_members (
|
|
102395
|
+
id uuid PRIMARY KEY,
|
|
102396
|
+
delivery_id uuid NOT NULL REFERENCES alert_deliveries(id) ON DELETE CASCADE,
|
|
102397
|
+
incident_id uuid NOT NULL,
|
|
102398
|
+
condition_type text NOT NULL,
|
|
102399
|
+
dedupe_key text NOT NULL,
|
|
102400
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
102401
|
+
UNIQUE (delivery_id, incident_id, condition_type, dedupe_key)
|
|
102402
|
+
)
|
|
102403
|
+
`,
|
|
102404
|
+
`
|
|
102405
|
+
CREATE INDEX alert_delivery_members_delivery_created_idx
|
|
102406
|
+
ON alert_delivery_members (delivery_id, created_at ASC, id ASC)
|
|
102407
|
+
`,
|
|
102292
102408
|
`
|
|
102293
102409
|
CREATE TABLE alert_email_digests (
|
|
102294
102410
|
id uuid PRIMARY KEY,
|
|
@@ -104783,6 +104899,45 @@ var STORAGE_SCHEMA_MIGRATIONS = [
|
|
|
104783
104899
|
id: "202609160001_add_browser_resource_routes",
|
|
104784
104900
|
description: "Retain sanitized browser resource routes independently of raw event sampling.",
|
|
104785
104901
|
statements: ["ALTER TABLE incident_events ADD COLUMN IF NOT EXISTS resource_route text"]
|
|
104902
|
+
}),
|
|
104903
|
+
defineStorageSchemaMigration({
|
|
104904
|
+
id: "202609240001_add_alert_delivery_members",
|
|
104905
|
+
description: "Retain incident identities represented by one coherent alert delivery.",
|
|
104906
|
+
statements: [
|
|
104907
|
+
`
|
|
104908
|
+
CREATE TABLE IF NOT EXISTS alert_delivery_members (
|
|
104909
|
+
id uuid PRIMARY KEY,
|
|
104910
|
+
delivery_id uuid NOT NULL REFERENCES alert_deliveries(id) ON DELETE CASCADE,
|
|
104911
|
+
incident_id uuid NOT NULL,
|
|
104912
|
+
condition_type text NOT NULL,
|
|
104913
|
+
dedupe_key text NOT NULL,
|
|
104914
|
+
created_at timestamptz NOT NULL DEFAULT now(),
|
|
104915
|
+
UNIQUE (delivery_id, incident_id, condition_type, dedupe_key)
|
|
104916
|
+
)
|
|
104917
|
+
`,
|
|
104918
|
+
`
|
|
104919
|
+
CREATE INDEX IF NOT EXISTS alert_delivery_members_delivery_created_idx
|
|
104920
|
+
ON alert_delivery_members (delivery_id, created_at ASC, id ASC)
|
|
104921
|
+
`
|
|
104922
|
+
]
|
|
104923
|
+
}),
|
|
104924
|
+
defineStorageSchemaMigration({
|
|
104925
|
+
id: "202609240002_add_alert_webhook_signing_secret",
|
|
104926
|
+
description: "Store custom alert-webhook signing secrets separately from readable rule config.",
|
|
104927
|
+
statements: ["ALTER TABLE alert_rules ADD COLUMN IF NOT EXISTS signing_secret text"]
|
|
104928
|
+
}),
|
|
104929
|
+
defineStorageSchemaMigration({
|
|
104930
|
+
id: "202609250001_add_alert_evaluation_owner",
|
|
104931
|
+
description: "Bind direct alert retries to the durable evaluation job that created the intent.",
|
|
104932
|
+
statements: ["ALTER TABLE alert_deliveries ADD COLUMN IF NOT EXISTS evaluation_job_id text"]
|
|
104933
|
+
}),
|
|
104934
|
+
defineStorageSchemaMigration({
|
|
104935
|
+
id: "202609250002_version_alert_webhook_payloads",
|
|
104936
|
+
description: "Preserve legacy custom webhook bodies while enforcing signatures for every delivery.",
|
|
104937
|
+
statements: [
|
|
104938
|
+
"ALTER TABLE alert_rules ADD COLUMN IF NOT EXISTS webhook_payload_version smallint NOT NULL DEFAULT 0 CHECK (webhook_payload_version IN (0, 1))",
|
|
104939
|
+
"UPDATE alert_rules SET webhook_payload_version = 1 WHERE channel = 'webhook' AND signing_secret IS NOT NULL"
|
|
104940
|
+
]
|
|
104786
104941
|
})
|
|
104787
104942
|
];
|
|
104788
104943
|
|
|
@@ -104808,7 +104963,7 @@ function projectLocalEvidence(value) {
|
|
|
104808
104963
|
return projected.value;
|
|
104809
104964
|
}
|
|
104810
104965
|
async function readLocalArtifact(path, dependencies) {
|
|
104811
|
-
const readFile = dependencies?.readFile ??
|
|
104966
|
+
const readFile = dependencies?.readFile ?? import_promises9.readFile;
|
|
104812
104967
|
const raw = await readFile(path, "utf8");
|
|
104813
104968
|
if (Buffer.byteLength(raw, "utf8") > MAX_ARTIFACT_BYTES) {
|
|
104814
104969
|
throw createReadError(503, "privacy_projection_unavailable");
|
|
@@ -104827,7 +104982,7 @@ function createReadError(status, code) {
|
|
|
104827
104982
|
return new RetrievalApiError(status, code);
|
|
104828
104983
|
}
|
|
104829
104984
|
async function readJsonFile(path, dependencies) {
|
|
104830
|
-
const readFile = dependencies?.readFile ??
|
|
104985
|
+
const readFile = dependencies?.readFile ?? import_promises9.readFile;
|
|
104831
104986
|
try {
|
|
104832
104987
|
return JSON.parse(await readFile(path, "utf8"));
|
|
104833
104988
|
} catch (error2) {
|
|
@@ -104997,7 +105152,7 @@ async function readLocalState(dependencies) {
|
|
|
104997
105152
|
}
|
|
104998
105153
|
async function writeLocalState(state, dependencies) {
|
|
104999
105154
|
const rootDirectory = getWorkspaceRoot(dependencies);
|
|
105000
|
-
const writeFile = dependencies?.writeFile ??
|
|
105155
|
+
const writeFile = dependencies?.writeFile ?? import_promises9.writeFile;
|
|
105001
105156
|
await writeFile(getStateFilePath(rootDirectory), `${JSON.stringify(state, null, 2)}
|
|
105002
105157
|
`, "utf8");
|
|
105003
105158
|
}
|
|
@@ -105086,7 +105241,7 @@ async function reopenLocalIncident(input3, dependencies) {
|
|
|
105086
105241
|
}
|
|
105087
105242
|
|
|
105088
105243
|
// src/cloud-artifact-cache.ts
|
|
105089
|
-
var
|
|
105244
|
+
var import_promises10 = require("node:fs/promises");
|
|
105090
105245
|
var import_node_path10 = require("node:path");
|
|
105091
105246
|
|
|
105092
105247
|
// src/retrieval-source.ts
|
|
@@ -105219,9 +105374,9 @@ async function pruneCloudArtifactCache(input3, dependencies) {
|
|
|
105219
105374
|
};
|
|
105220
105375
|
}
|
|
105221
105376
|
async function pruneExpiredArtifactsInDirectory(directoryPath, now, olderThanMs, dependencies) {
|
|
105222
|
-
const readdir = dependencies?.readdir ??
|
|
105223
|
-
const rm = dependencies?.rm ??
|
|
105224
|
-
const stat = dependencies?.stat ??
|
|
105377
|
+
const readdir = dependencies?.readdir ?? import_promises10.readdir;
|
|
105378
|
+
const rm = dependencies?.rm ?? import_promises10.rm;
|
|
105379
|
+
const stat = dependencies?.stat ?? import_promises10.stat;
|
|
105225
105380
|
let fileNames;
|
|
105226
105381
|
try {
|
|
105227
105382
|
fileNames = await readdir(directoryPath);
|
|
@@ -105263,8 +105418,8 @@ async function pruneExpiredArtifactsInDirectory(directoryPath, now, olderThanMs,
|
|
|
105263
105418
|
);
|
|
105264
105419
|
}
|
|
105265
105420
|
async function updateCachedArtifactStatus(filePath, input3, dependencies) {
|
|
105266
|
-
const readFile = dependencies?.readFile ??
|
|
105267
|
-
const writeFile = dependencies?.writeFile ??
|
|
105421
|
+
const readFile = dependencies?.readFile ?? import_promises10.readFile;
|
|
105422
|
+
const writeFile = dependencies?.writeFile ?? import_promises10.writeFile;
|
|
105268
105423
|
let payload2;
|
|
105269
105424
|
try {
|
|
105270
105425
|
const raw = await readFile(filePath, "utf8");
|
|
@@ -105298,8 +105453,8 @@ function applyIncidentStatusToPayload(payload2, incidentId, incident) {
|
|
|
105298
105453
|
return nextPayload;
|
|
105299
105454
|
}
|
|
105300
105455
|
async function persistCloudArtifact(directoryPath, fileName, payload2, dependencies) {
|
|
105301
|
-
const mkdir5 = dependencies?.mkdir ??
|
|
105302
|
-
const writeFile = dependencies?.writeFile ??
|
|
105456
|
+
const mkdir5 = dependencies?.mkdir ?? import_promises10.mkdir;
|
|
105457
|
+
const writeFile = dependencies?.writeFile ?? import_promises10.writeFile;
|
|
105303
105458
|
await mkdir5(directoryPath, { recursive: true });
|
|
105304
105459
|
await writeFile((0, import_node_path10.join)(directoryPath, fileName), `${JSON.stringify(payload2, null, 2)}
|
|
105305
105460
|
`, "utf8");
|
|
@@ -105341,9 +105496,9 @@ function parseOlderThan(value) {
|
|
|
105341
105496
|
return Number.parseInt(match[1], 10) * 24 * 60 * 60 * 1e3;
|
|
105342
105497
|
}
|
|
105343
105498
|
async function cleanProcessedEventFiles(input3, dependencies) {
|
|
105344
|
-
const readdir = dependencies.readdir ??
|
|
105345
|
-
const rm = dependencies.rm ??
|
|
105346
|
-
const stat = dependencies.stat ??
|
|
105499
|
+
const readdir = dependencies.readdir ?? import_promises11.readdir;
|
|
105500
|
+
const rm = dependencies.rm ?? import_promises11.rm;
|
|
105501
|
+
const stat = dependencies.stat ?? import_promises11.stat;
|
|
105347
105502
|
const rootDirectory = (dependencies.cwd ?? process.cwd)();
|
|
105348
105503
|
const eventsDirectoryPath = (0, import_node_path11.join)(rootDirectory, LOCAL_EVENTS_DIRECTORY_PATH);
|
|
105349
105504
|
const state = await readLocalState(dependencies);
|
|
@@ -105378,9 +105533,9 @@ async function cleanProcessedEventFiles(input3, dependencies) {
|
|
|
105378
105533
|
return { removed, retained };
|
|
105379
105534
|
}
|
|
105380
105535
|
async function cleanRelaySpoolFiles(input3, dependencies) {
|
|
105381
|
-
const readdir = dependencies.readdir ??
|
|
105382
|
-
const rm = dependencies.rm ??
|
|
105383
|
-
const stat = dependencies.stat ??
|
|
105536
|
+
const readdir = dependencies.readdir ?? import_promises11.readdir;
|
|
105537
|
+
const rm = dependencies.rm ?? import_promises11.rm;
|
|
105538
|
+
const stat = dependencies.stat ?? import_promises11.stat;
|
|
105384
105539
|
const rootDirectory = (dependencies.cwd ?? process.cwd)();
|
|
105385
105540
|
const spoolDirectoryPath = (0, import_node_path11.join)(rootDirectory, LOCAL_RELAY_SPOOL_DIRECTORY_PATH);
|
|
105386
105541
|
let spoolFileNames;
|
|
@@ -105431,7 +105586,7 @@ function sortLocalIncidentRemovalPriority(left, right) {
|
|
|
105431
105586
|
return left.incident_id.localeCompare(right.incident_id);
|
|
105432
105587
|
}
|
|
105433
105588
|
async function applyLocalIncidentRetention(dependencies) {
|
|
105434
|
-
const rm = dependencies.rm ??
|
|
105589
|
+
const rm = dependencies.rm ?? import_promises11.rm;
|
|
105435
105590
|
const rootDirectory = (dependencies.cwd ?? process.cwd)();
|
|
105436
105591
|
const state = await readLocalState(dependencies);
|
|
105437
105592
|
const incidents = Object.values(state.incidents);
|
|
@@ -105464,7 +105619,7 @@ async function countLocalIncidents(dependencies) {
|
|
|
105464
105619
|
return Object.keys((await readLocalState(dependencies)).incidents).length;
|
|
105465
105620
|
}
|
|
105466
105621
|
async function countDirectoryFiles(directoryPath, dependencies, extension) {
|
|
105467
|
-
const readdir = dependencies.readdir ??
|
|
105622
|
+
const readdir = dependencies.readdir ?? import_promises11.readdir;
|
|
105468
105623
|
const rootDirectory = (dependencies.cwd ?? process.cwd)();
|
|
105469
105624
|
try {
|
|
105470
105625
|
return (await readdir((0, import_node_path11.join)(rootDirectory, directoryPath))).filter((fileName) => fileName.endsWith(extension)).length;
|
|
@@ -105482,8 +105637,8 @@ async function countRelaySpoolEventFiles(dependencies) {
|
|
|
105482
105637
|
return countDirectoryFiles(LOCAL_RELAY_SPOOL_DIRECTORY_PATH, dependencies, ".events.json");
|
|
105483
105638
|
}
|
|
105484
105639
|
async function resetRuntimeData(dependencies) {
|
|
105485
|
-
const mkdir5 = dependencies.mkdir ??
|
|
105486
|
-
const rm = dependencies.rm ??
|
|
105640
|
+
const mkdir5 = dependencies.mkdir ?? import_promises11.mkdir;
|
|
105641
|
+
const rm = dependencies.rm ?? import_promises11.rm;
|
|
105487
105642
|
const rootDirectory = (dependencies.cwd ?? process.cwd)();
|
|
105488
105643
|
const [processedEventFilesRemoved, relaySpoolFilesRemoved, cloudCacheFilesRemoved, localIncidentCount] = await Promise.all([
|
|
105489
105644
|
countProcessedAndUnprocessedEventFiles(dependencies),
|
|
@@ -105575,7 +105730,7 @@ async function cleanCommand(input3, dependencies = {}) {
|
|
|
105575
105730
|
};
|
|
105576
105731
|
}
|
|
105577
105732
|
async function countProcessedAndUnprocessedEventFiles(dependencies) {
|
|
105578
|
-
const readdir = dependencies.readdir ??
|
|
105733
|
+
const readdir = dependencies.readdir ?? import_promises11.readdir;
|
|
105579
105734
|
const rootDirectory = (dependencies.cwd ?? process.cwd)();
|
|
105580
105735
|
try {
|
|
105581
105736
|
return (await readdir((0, import_node_path11.join)(rootDirectory, LOCAL_EVENTS_DIRECTORY_PATH))).filter((fileName) => fileName.endsWith(".events.json")).length;
|
|
@@ -105591,7 +105746,7 @@ async function countCloudArtifactCache(dependencies) {
|
|
|
105591
105746
|
}
|
|
105592
105747
|
|
|
105593
105748
|
// src/connect-command.ts
|
|
105594
|
-
var
|
|
105749
|
+
var import_promises14 = require("node:fs/promises");
|
|
105595
105750
|
var import_node_path14 = require("node:path");
|
|
105596
105751
|
|
|
105597
105752
|
// ../../packages/project-management-client/src/index.ts
|
|
@@ -105978,7 +106133,7 @@ function createTokenManagementApi(client) {
|
|
|
105978
106133
|
}
|
|
105979
106134
|
|
|
105980
106135
|
// src/auth-state.ts
|
|
105981
|
-
var
|
|
106136
|
+
var import_promises12 = require("node:fs/promises");
|
|
105982
106137
|
var import_node_os2 = require("node:os");
|
|
105983
106138
|
var import_node_path12 = require("node:path");
|
|
105984
106139
|
var CliAuthStateSchema = external_exports.object({
|
|
@@ -106003,7 +106158,7 @@ function buildTokenPreview(token) {
|
|
|
106003
106158
|
}
|
|
106004
106159
|
async function readCliAuthState(input3, dependencies) {
|
|
106005
106160
|
const authFilePath = input3.authFilePath ?? getDefaultAuthFilePath();
|
|
106006
|
-
const readFile = dependencies?.readFile ?? ((filePath) => (0,
|
|
106161
|
+
const readFile = dependencies?.readFile ?? ((filePath) => (0, import_promises12.readFile)(filePath, "utf8"));
|
|
106007
106162
|
let rawAuthState;
|
|
106008
106163
|
try {
|
|
106009
106164
|
rawAuthState = await readFile(authFilePath);
|
|
@@ -106027,8 +106182,8 @@ async function readCliAuthState(input3, dependencies) {
|
|
|
106027
106182
|
}
|
|
106028
106183
|
async function persistCliAuthState(input3, dependencies) {
|
|
106029
106184
|
const authFilePath = input3.authFilePath ?? getDefaultAuthFilePath();
|
|
106030
|
-
const mkdir5 = dependencies?.mkdir ??
|
|
106031
|
-
const writeFile = dependencies?.writeFile ??
|
|
106185
|
+
const mkdir5 = dependencies?.mkdir ?? import_promises12.mkdir;
|
|
106186
|
+
const writeFile = dependencies?.writeFile ?? import_promises12.writeFile;
|
|
106032
106187
|
await mkdir5((0, import_node_path12.dirname)(authFilePath), { recursive: true });
|
|
106033
106188
|
await writeFile(`${authFilePath}`, `${JSON.stringify(input3.authState, null, 2)}
|
|
106034
106189
|
`, "utf8");
|
|
@@ -106056,16 +106211,43 @@ var AlertSchema = external_exports.object({
|
|
|
106056
106211
|
severity_lifecycle_scope: AlertSeverityLifecycleScopeSchema.nullable().optional().default(null),
|
|
106057
106212
|
cooldown_seconds: external_exports.number().int().min(0),
|
|
106058
106213
|
config: external_exports.record(external_exports.string(), external_exports.unknown()),
|
|
106214
|
+
signing_secret: external_exports.string().optional(),
|
|
106059
106215
|
is_enabled: external_exports.boolean(),
|
|
106060
106216
|
created_at: external_exports.string(),
|
|
106061
106217
|
updated_at: external_exports.string()
|
|
106062
106218
|
}).strict();
|
|
106063
106219
|
var AlertListResponseSchema = external_exports.object({
|
|
106064
|
-
alerts: external_exports.array(AlertSchema)
|
|
106220
|
+
alerts: external_exports.array(AlertSchema.omit({ signing_secret: true }).strict())
|
|
106065
106221
|
}).strict();
|
|
106066
106222
|
var AlertResponseSchema = external_exports.object({
|
|
106067
106223
|
alert: AlertSchema
|
|
106068
106224
|
}).strict();
|
|
106225
|
+
var AlertGroupSummarySchema = external_exports.object({
|
|
106226
|
+
group_id: external_exports.string().uuid(),
|
|
106227
|
+
kind: external_exports.enum(["direct", "email_digest"]),
|
|
106228
|
+
project_id: external_exports.string().uuid(),
|
|
106229
|
+
alert_id: external_exports.string().uuid().nullable(),
|
|
106230
|
+
root_incident_id: external_exports.string().uuid().nullable(),
|
|
106231
|
+
channel: AlertChannelSchema,
|
|
106232
|
+
status: external_exports.enum(["pending", "delivered", "failed"]),
|
|
106233
|
+
member_count: external_exports.number().int().min(0),
|
|
106234
|
+
created_at: external_exports.string(),
|
|
106235
|
+
delivered_at: external_exports.string().nullable()
|
|
106236
|
+
}).strict();
|
|
106237
|
+
var AlertGroupMemberSchema = external_exports.object({
|
|
106238
|
+
incident_id: external_exports.string().uuid(),
|
|
106239
|
+
condition_type: external_exports.string(),
|
|
106240
|
+
created_at: external_exports.string()
|
|
106241
|
+
}).strict();
|
|
106242
|
+
var AlertGroupListResponseSchema = external_exports.object({
|
|
106243
|
+
groups: external_exports.array(AlertGroupSummarySchema),
|
|
106244
|
+
next_cursor: external_exports.string().nullable()
|
|
106245
|
+
}).strict();
|
|
106246
|
+
var AlertGroupResponseSchema = external_exports.object({
|
|
106247
|
+
group: AlertGroupSummarySchema,
|
|
106248
|
+
members: external_exports.array(AlertGroupMemberSchema),
|
|
106249
|
+
next_cursor: external_exports.string().nullable()
|
|
106250
|
+
}).strict();
|
|
106069
106251
|
var ApiErrorResponseSchema4 = external_exports.object({
|
|
106070
106252
|
error: external_exports.string()
|
|
106071
106253
|
}).strict();
|
|
@@ -106128,6 +106310,28 @@ function createAlertApi(client) {
|
|
|
106128
106310
|
})
|
|
106129
106311
|
);
|
|
106130
106312
|
},
|
|
106313
|
+
async listAlertGroups(input3) {
|
|
106314
|
+
const response = await client.request({
|
|
106315
|
+
method: "GET",
|
|
106316
|
+
path: `/v1/alert-groups${buildQuery({ project_id: input3.projectId, limit: input3.limit, cursor: input3.cursor })}`,
|
|
106317
|
+
bearerToken: input3.bearerToken
|
|
106318
|
+
});
|
|
106319
|
+
if (response.status < 200 || response.status >= 300) parseApiError4(response.status, response.body);
|
|
106320
|
+
const parsed = AlertGroupListResponseSchema.safeParse(response.body);
|
|
106321
|
+
if (!parsed.success) throw new AlertApiError(response.status, "invalid_response_shape");
|
|
106322
|
+
return parsed.data;
|
|
106323
|
+
},
|
|
106324
|
+
async getAlertGroup(input3) {
|
|
106325
|
+
const response = await client.request({
|
|
106326
|
+
method: "GET",
|
|
106327
|
+
path: `/v1/alert-groups/${input3.kind}/${encodeURIComponent(input3.groupId)}${buildQuery({ project_id: input3.projectId, limit: input3.limit, cursor: input3.cursor })}`,
|
|
106328
|
+
bearerToken: input3.bearerToken
|
|
106329
|
+
});
|
|
106330
|
+
if (response.status < 200 || response.status >= 300) parseApiError4(response.status, response.body);
|
|
106331
|
+
const parsed = AlertGroupResponseSchema.safeParse(response.body);
|
|
106332
|
+
if (!parsed.success) throw new AlertApiError(response.status, "invalid_response_shape");
|
|
106333
|
+
return parsed.data;
|
|
106334
|
+
},
|
|
106131
106335
|
async createAlert(input3) {
|
|
106132
106336
|
const body = {
|
|
106133
106337
|
project_id: input3.projectId,
|
|
@@ -106135,6 +106339,9 @@ function createAlertApi(client) {
|
|
|
106135
106339
|
condition_type: input3.conditionType,
|
|
106136
106340
|
config: input3.config
|
|
106137
106341
|
};
|
|
106342
|
+
if (input3.channel === "webhook") {
|
|
106343
|
+
body.signing = "hmac_sha256_v1";
|
|
106344
|
+
}
|
|
106138
106345
|
if (input3.serviceId !== void 0) {
|
|
106139
106346
|
body.service_id = input3.serviceId;
|
|
106140
106347
|
}
|
|
@@ -106182,6 +106389,9 @@ function createAlertApi(client) {
|
|
|
106182
106389
|
if (input3.config !== void 0) {
|
|
106183
106390
|
body.config = input3.config;
|
|
106184
106391
|
}
|
|
106392
|
+
if (input3.rotateSigningSecret === true) {
|
|
106393
|
+
body.rotate_signing_secret = true;
|
|
106394
|
+
}
|
|
106185
106395
|
if (input3.isEnabled !== void 0) {
|
|
106186
106396
|
body.is_enabled = input3.isEnabled;
|
|
106187
106397
|
}
|
|
@@ -107561,12 +107771,12 @@ async function readConnectionConfig(rootDirectory, readFile) {
|
|
|
107561
107771
|
|
|
107562
107772
|
// src/interactive-auth.ts
|
|
107563
107773
|
var import_node_process = require("node:process");
|
|
107564
|
-
var
|
|
107774
|
+
var import_promises13 = require("node:readline/promises");
|
|
107565
107775
|
function isInteractiveTerminal() {
|
|
107566
107776
|
return import_node_process.stdin.isTTY === true && import_node_process.stdout.isTTY === true;
|
|
107567
107777
|
}
|
|
107568
107778
|
async function promptForInteractiveLoginSelection() {
|
|
107569
|
-
const readlineInterface = (0,
|
|
107779
|
+
const readlineInterface = (0, import_promises13.createInterface)({
|
|
107570
107780
|
input: import_node_process.stdin,
|
|
107571
107781
|
output: import_node_process.stdout
|
|
107572
107782
|
});
|
|
@@ -108171,9 +108381,9 @@ function buildValidationFailureResult(input3) {
|
|
|
108171
108381
|
}
|
|
108172
108382
|
async function connectCommand(input3, dependencies = {}) {
|
|
108173
108383
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
108174
|
-
const readFile = dependencies.readFile ?? ((path) => (0,
|
|
108175
|
-
const stat = dependencies.stat ??
|
|
108176
|
-
const writeFile = dependencies.writeFile ??
|
|
108384
|
+
const readFile = dependencies.readFile ?? ((path) => (0, import_promises14.readFile)(path, "utf8"));
|
|
108385
|
+
const stat = dependencies.stat ?? import_promises14.stat;
|
|
108386
|
+
const writeFile = dependencies.writeFile ?? import_promises14.writeFile;
|
|
108177
108387
|
const readAuthState = dependencies.readAuthState ?? ((authInput) => readCliAuthState(authInput));
|
|
108178
108388
|
const createHttpClient = dependencies.createHttpClient ?? ((clientInput) => {
|
|
108179
108389
|
const httpClientDependencies = {};
|
|
@@ -108380,7 +108590,7 @@ var legacy_skill_hashes_default = {
|
|
|
108380
108590
|
};
|
|
108381
108591
|
|
|
108382
108592
|
// src/agent-setup.ts
|
|
108383
|
-
var
|
|
108593
|
+
var import_promises15 = require("node:readline/promises");
|
|
108384
108594
|
var import_node_process2 = require("node:process");
|
|
108385
108595
|
var MANAGED_AGENTS_START = "<!-- debugbundle:start -->";
|
|
108386
108596
|
var MANAGED_AGENTS_END = "<!-- debugbundle:end -->";
|
|
@@ -108418,7 +108628,7 @@ async function chooseAgents(root, input3, dependencies) {
|
|
|
108418
108628
|
let answer;
|
|
108419
108629
|
if (dependencies.promptUser) answer = await dependencies.promptUser(prompt);
|
|
108420
108630
|
else {
|
|
108421
|
-
const terminal = (0,
|
|
108631
|
+
const terminal = (0, import_promises15.createInterface)({ input: import_node_process2.stdin, output: import_node_process2.stdout });
|
|
108422
108632
|
try {
|
|
108423
108633
|
answer = await terminal.question(prompt);
|
|
108424
108634
|
} finally {
|
|
@@ -108470,7 +108680,7 @@ function localScaffoldFailure(error2, json2 = false) {
|
|
|
108470
108680
|
}
|
|
108471
108681
|
|
|
108472
108682
|
// src/doctor-command.ts
|
|
108473
|
-
var
|
|
108683
|
+
var import_promises16 = require("node:fs/promises");
|
|
108474
108684
|
var import_node_path15 = require("node:path");
|
|
108475
108685
|
var HealthResponseSchema = external_exports.object({
|
|
108476
108686
|
status: external_exports.literal("ok")
|
|
@@ -108618,7 +108828,7 @@ function buildPrivacyPreview() {
|
|
|
108618
108828
|
"body.otp",
|
|
108619
108829
|
"context.apiKey"
|
|
108620
108830
|
];
|
|
108621
|
-
const sampleEventClass = classifyEvent(sampleEvent.event_type, void 0, void 0, sampleEvent.payload);
|
|
108831
|
+
const sampleEventClass = classifyEvent(sampleEvent.event_type, void 0, void 0, sampleEvent.payload, "minimal", [], [], sampleEvent.service.runtime);
|
|
108622
108832
|
return {
|
|
108623
108833
|
policy_version: TELEMETRY_PRIVACY_POLICY_VERSION,
|
|
108624
108834
|
rule_families: ["sensitive_keys", "credential_text", "urls", "private_keys", "payment_cards"],
|
|
@@ -109014,13 +109224,13 @@ async function runDoctorCommand(input3, dependencies = {}) {
|
|
|
109014
109224
|
const now = dependencies.now ?? (() => /* @__PURE__ */ new Date());
|
|
109015
109225
|
const fetchImpl = dependencies.fetchImpl ?? nodeFetch;
|
|
109016
109226
|
const readAuthStateImpl = dependencies.readAuthState ?? readCliAuthState;
|
|
109017
|
-
const readdir = dependencies.readdir ??
|
|
109227
|
+
const readdir = dependencies.readdir ?? import_promises16.readdir;
|
|
109018
109228
|
const readFile = dependencies.readFile ?? (async (filePath) => {
|
|
109019
109229
|
const content = await readManaged(rootDirectory, (0, import_node_path15.relative)(rootDirectory, filePath));
|
|
109020
109230
|
if (content === void 0) throw Object.assign(new Error("Missing local scaffold file."), { code: "ENOENT" });
|
|
109021
109231
|
return content;
|
|
109022
109232
|
});
|
|
109023
|
-
const stat = dependencies.stat ??
|
|
109233
|
+
const stat = dependencies.stat ?? import_promises16.stat;
|
|
109024
109234
|
const rootDirectory = await projectRoot(cwd());
|
|
109025
109235
|
const currentTime = now();
|
|
109026
109236
|
const { check: profileCheck, profile, validationErrors } = await loadProfile(rootDirectory, { readFile, stat });
|
|
@@ -109066,7 +109276,7 @@ async function doctorCommand(input3, dependencies = {}) {
|
|
|
109066
109276
|
|
|
109067
109277
|
// src/ingest-command.ts
|
|
109068
109278
|
var import_node_crypto13 = require("node:crypto");
|
|
109069
|
-
var
|
|
109279
|
+
var import_promises18 = require("node:fs/promises");
|
|
109070
109280
|
var import_node_path17 = require("node:path");
|
|
109071
109281
|
|
|
109072
109282
|
// ../../packages/log-parser/src/project-id.ts
|
|
@@ -109386,7 +109596,7 @@ function parseLogFile(content, input3) {
|
|
|
109386
109596
|
|
|
109387
109597
|
// src/process-command.ts
|
|
109388
109598
|
var import_node_crypto12 = require("node:crypto");
|
|
109389
|
-
var
|
|
109599
|
+
var import_promises17 = require("node:fs/promises");
|
|
109390
109600
|
var import_node_path16 = require("node:path");
|
|
109391
109601
|
|
|
109392
109602
|
// ../../packages/shared-types/src/browser-recovery.ts
|
|
@@ -110927,7 +111137,10 @@ function classifyEnvelope(envelope, capturePreset) {
|
|
|
110927
111137
|
envelope.event_type === "log_event" ? envelope.payload.level : void 0,
|
|
110928
111138
|
envelope.event_type === "probe_event" ? envelope.payload.activation_id : void 0,
|
|
110929
111139
|
envelope.payload,
|
|
110930
|
-
capturePreset
|
|
111140
|
+
capturePreset,
|
|
111141
|
+
[],
|
|
111142
|
+
[],
|
|
111143
|
+
envelope.service.runtime
|
|
110931
111144
|
);
|
|
110932
111145
|
}
|
|
110933
111146
|
function isIncidentSignalEnvelope(envelope, capturePreset) {
|
|
@@ -111245,11 +111458,11 @@ function serializeState(state) {
|
|
|
111245
111458
|
}
|
|
111246
111459
|
async function processCommand(input3, dependencies = {}) {
|
|
111247
111460
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
111248
|
-
const mkdir5 = dependencies.mkdir ??
|
|
111249
|
-
const readFile = dependencies.readFile ?? ((filePath) => (0,
|
|
111250
|
-
const readdir = dependencies.readdir ??
|
|
111251
|
-
const stat = dependencies.stat ??
|
|
111252
|
-
const writeFile = dependencies.writeFile ?? ((filePath, content) => (0,
|
|
111461
|
+
const mkdir5 = dependencies.mkdir ?? import_promises17.mkdir;
|
|
111462
|
+
const readFile = dependencies.readFile ?? ((filePath) => (0, import_promises17.readFile)(filePath, "utf8"));
|
|
111463
|
+
const readdir = dependencies.readdir ?? import_promises17.readdir;
|
|
111464
|
+
const stat = dependencies.stat ?? import_promises17.stat;
|
|
111465
|
+
const writeFile = dependencies.writeFile ?? ((filePath, content) => (0, import_promises17.writeFile)(filePath, content, "utf8"));
|
|
111253
111466
|
const rootDirectory = cwd();
|
|
111254
111467
|
const eventsDirectoryPath = (0, import_node_path16.join)(rootDirectory, LOCAL_EVENTS_DIRECTORY_PATH2);
|
|
111255
111468
|
const statePath = (0, import_node_path16.join)(rootDirectory, LOCAL_STATE_FILE_PATH);
|
|
@@ -111539,11 +111752,11 @@ async function ingestCommand(input3, dependencies = {}) {
|
|
|
111539
111752
|
};
|
|
111540
111753
|
}
|
|
111541
111754
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
111542
|
-
const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0,
|
|
111755
|
+
const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0, import_promises18.mkdir)(path, options));
|
|
111543
111756
|
const processLocalEvents = dependencies.processCommand ?? processCommand;
|
|
111544
|
-
const readFile = dependencies.readFile ?? (async (path) => (0,
|
|
111545
|
-
const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0,
|
|
111546
|
-
const writeFile = dependencies.writeFile ?? (async (path, content) => (0,
|
|
111757
|
+
const readFile = dependencies.readFile ?? (async (path) => (0, import_promises18.readFile)(path, "utf8"));
|
|
111758
|
+
const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises18.rename)(sourcePath, destinationPath));
|
|
111759
|
+
const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises18.writeFile)(path, content, "utf8"));
|
|
111547
111760
|
try {
|
|
111548
111761
|
const rootDirectory = cwd();
|
|
111549
111762
|
const profile = await readProfile(rootDirectory, readFile);
|
|
@@ -111600,7 +111813,7 @@ async function ingestCommand(input3, dependencies = {}) {
|
|
|
111600
111813
|
}
|
|
111601
111814
|
|
|
111602
111815
|
// src/watch-command.ts
|
|
111603
|
-
var
|
|
111816
|
+
var import_promises19 = require("node:fs/promises");
|
|
111604
111817
|
var import_node_path18 = require("node:path");
|
|
111605
111818
|
function normalizeBaseUrl5(baseUrl) {
|
|
111606
111819
|
return baseUrl.endsWith("/") ? baseUrl.slice(0, -1) : baseUrl;
|
|
@@ -111644,18 +111857,18 @@ async function watchCommand(input3, dependencies = {}) {
|
|
|
111644
111857
|
};
|
|
111645
111858
|
}
|
|
111646
111859
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
111647
|
-
const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0,
|
|
111860
|
+
const mkdir5 = dependencies.mkdir ?? (async (path, options) => (0, import_promises19.mkdir)(path, options));
|
|
111648
111861
|
const pollIntervalMs = dependencies.pollIntervalMs ?? 1e3;
|
|
111649
111862
|
const processLocalEvents = dependencies.processCommand ?? processCommand;
|
|
111650
|
-
const readFile = dependencies.readFile ?? (async (path) => (0,
|
|
111863
|
+
const readFile = dependencies.readFile ?? (async (path) => (0, import_promises19.readFile)(path));
|
|
111651
111864
|
const readEnv = dependencies.readEnv ?? ((name) => process.env[name]);
|
|
111652
|
-
const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0,
|
|
111865
|
+
const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises19.rename)(sourcePath, destinationPath));
|
|
111653
111866
|
const fetchDependencies = dependencies.fetchImpl === void 0 ? void 0 : { fetchImpl: dependencies.fetchImpl };
|
|
111654
111867
|
const sendEvents = dependencies.sendEvents ?? ((requestInput) => sendEventsToApi(requestInput, fetchDependencies));
|
|
111655
111868
|
const signal = dependencies.signal;
|
|
111656
111869
|
const sleep = dependencies.sleep ?? (async (milliseconds) => new Promise((resolve4) => setTimeout(resolve4, milliseconds)));
|
|
111657
|
-
const stat = dependencies.stat ??
|
|
111658
|
-
const writeFile = dependencies.writeFile ?? (async (path, content) => (0,
|
|
111870
|
+
const stat = dependencies.stat ?? import_promises19.stat;
|
|
111871
|
+
const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises19.writeFile)(path, content, "utf8"));
|
|
111659
111872
|
try {
|
|
111660
111873
|
const rootDirectory = cwd();
|
|
111661
111874
|
const profile = await readProfile(rootDirectory, async (path) => (await readFile(path)).toString("utf8"));
|
|
@@ -111777,7 +111990,7 @@ async function watchCommand(input3, dependencies = {}) {
|
|
|
111777
111990
|
}
|
|
111778
111991
|
|
|
111779
111992
|
// src/setup-command.ts
|
|
111780
|
-
var
|
|
111993
|
+
var import_promises21 = require("node:fs/promises");
|
|
111781
111994
|
var import_node_path21 = require("node:path");
|
|
111782
111995
|
|
|
111783
111996
|
// src/setup-service-discovery.ts
|
|
@@ -112453,10 +112666,10 @@ async function resolveRelaySetup(rootDirectory, services, selectedTargetNames, r
|
|
|
112453
112666
|
}
|
|
112454
112667
|
|
|
112455
112668
|
// src/setup-target-selection.ts
|
|
112456
|
-
var
|
|
112669
|
+
var import_promises20 = require("node:readline/promises");
|
|
112457
112670
|
var import_node_process3 = require("node:process");
|
|
112458
112671
|
function defaultPromptUser(prompt) {
|
|
112459
|
-
const terminal = (0,
|
|
112672
|
+
const terminal = (0, import_promises20.createInterface)({ input: import_node_process3.stdin, output: import_node_process3.stdout });
|
|
112460
112673
|
return terminal.question(prompt).finally(() => {
|
|
112461
112674
|
terminal.close();
|
|
112462
112675
|
});
|
|
@@ -112776,12 +112989,12 @@ async function buildProfile(rootDirectory, dependencies) {
|
|
|
112776
112989
|
async function setupCommand(input3, dependencies = {}) {
|
|
112777
112990
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
112778
112991
|
const mkdir5 = dependencies.mkdir ?? (async (path, options) => {
|
|
112779
|
-
await (0,
|
|
112992
|
+
await (0, import_promises21.mkdir)(path, options);
|
|
112780
112993
|
});
|
|
112781
|
-
const readFile = dependencies.readFile ?? (async (path) => (0,
|
|
112782
|
-
const readdir = dependencies.readdir ?? (async (path) => (0,
|
|
112783
|
-
const stat = dependencies.stat ?? (async (path) => (0,
|
|
112784
|
-
const writeFile = dependencies.writeFile ?? (async (path, content) => (0,
|
|
112994
|
+
const readFile = dependencies.readFile ?? (async (path) => (0, import_promises21.readFile)(path, "utf8"));
|
|
112995
|
+
const readdir = dependencies.readdir ?? (async (path) => (0, import_promises21.readdir)(path));
|
|
112996
|
+
const stat = dependencies.stat ?? (async (path) => (0, import_promises21.stat)(path));
|
|
112997
|
+
const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises21.writeFile)(path, content, "utf8"));
|
|
112785
112998
|
const now = dependencies.now ?? (() => /* @__PURE__ */ new Date());
|
|
112786
112999
|
try {
|
|
112787
113000
|
const rootDirectory = await projectRoot(cwd());
|
|
@@ -114128,7 +114341,7 @@ function formatCloudResult(input3, exitCode, checks, errors, incidentId, verific
|
|
|
114128
114341
|
|
|
114129
114342
|
// src/verify-command.ts
|
|
114130
114343
|
var import_node_crypto14 = require("node:crypto");
|
|
114131
|
-
var
|
|
114344
|
+
var import_promises22 = require("node:fs/promises");
|
|
114132
114345
|
var import_node_path22 = require("node:path");
|
|
114133
114346
|
function localFailureStepName(checks) {
|
|
114134
114347
|
let hasLocalProcessing = false;
|
|
@@ -114345,14 +114558,14 @@ async function writeVerificationEventBatch(input3, dependencies) {
|
|
|
114345
114558
|
async function verifyLocalCommand(input3, dependencies = {}) {
|
|
114346
114559
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
114347
114560
|
const mkdir5 = dependencies.mkdir ?? (async (path, options) => {
|
|
114348
|
-
await (0,
|
|
114561
|
+
await (0, import_promises22.mkdir)(path, options);
|
|
114349
114562
|
});
|
|
114350
114563
|
const now = dependencies.now ?? (() => /* @__PURE__ */ new Date());
|
|
114351
114564
|
const processLocal = dependencies.processCommand ?? processCommand;
|
|
114352
114565
|
const readVerifiedLocalState = dependencies.readLocalState ?? readLocalState;
|
|
114353
114566
|
const readVerifiedLocalBundle = dependencies.getLocalBundle ?? getLocalBundle;
|
|
114354
|
-
const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0,
|
|
114355
|
-
const writeFile = dependencies.writeFile ?? (async (path, content) => (0,
|
|
114567
|
+
const rename3 = dependencies.rename ?? (async (sourcePath, destinationPath) => (0, import_promises22.rename)(sourcePath, destinationPath));
|
|
114568
|
+
const writeFile = dependencies.writeFile ?? (async (path, content) => (0, import_promises22.writeFile)(path, content, "utf8"));
|
|
114356
114569
|
const checks = [];
|
|
114357
114570
|
function finalize(exitCode, errors, incidentId) {
|
|
114358
114571
|
return formatResult(input3, exitCode, checks, errors, incidentId);
|
|
@@ -114373,7 +114586,7 @@ async function verifyLocalCommand(input3, dependencies = {}) {
|
|
|
114373
114586
|
});
|
|
114374
114587
|
try {
|
|
114375
114588
|
const rootDirectory = cwd();
|
|
114376
|
-
const profile = await readProfile(rootDirectory, async (path) => (0,
|
|
114589
|
+
const profile = await readProfile(rootDirectory, async (path) => (0, import_promises22.readFile)(path, "utf8"));
|
|
114377
114590
|
const projectId = buildProjectId(profile);
|
|
114378
114591
|
const verificationNow = now();
|
|
114379
114592
|
const runId = verificationNow.toISOString().replace(/[-:.TZ]/g, "").slice(0, 14);
|
|
@@ -115039,8 +115252,10 @@ var CLI_USAGE_LINES = [
|
|
|
115039
115252
|
" debugbundle token member create --label <label> [--auth-file <path>] [--json]",
|
|
115040
115253
|
" debugbundle token member revoke <token-id> [--auth-file <path>] [--json]",
|
|
115041
115254
|
" debugbundle alert list --project-id <id> [--limit <n>] [--auth-file <path>] [--json]",
|
|
115255
|
+
" debugbundle alert groups --project-id <id> [--limit <n>] [--cursor <cursor>] [--auth-file <path>] [--json]",
|
|
115256
|
+
" debugbundle alert group <direct|email_digest> <group-id> --project-id <id> [--limit <n>] [--cursor <cursor>] [--auth-file <path>] [--json]",
|
|
115042
115257
|
" 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]",
|
|
115258
|
+
" 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
115259
|
" Email config supports aggregation_window_seconds (1-300, default 10); other channels support cooldown_scope (incident or project, isolated by environment/severity).",
|
|
115045
115260
|
" debugbundle alert delete <alert-id> --project-id <id> [--auth-file <path>] [--json]",
|
|
115046
115261
|
" debugbundle slack list --project-id <id> [--auth-file <path>] [--json]",
|
|
@@ -115099,7 +115314,7 @@ function formatUsage() {
|
|
|
115099
115314
|
}
|
|
115100
115315
|
|
|
115101
115316
|
// src/validate-command.ts
|
|
115102
|
-
var
|
|
115317
|
+
var import_promises23 = require("node:fs/promises");
|
|
115103
115318
|
var import_node_path23 = require("node:path");
|
|
115104
115319
|
var SUGGESTED_ACTIONS2 = [
|
|
115105
115320
|
"Run debugbundle setup if .debugbundle/profile.json is missing.",
|
|
@@ -115214,14 +115429,14 @@ async function fixMissingFile(rootDirectory, filePath, buildContent, dependencie
|
|
|
115214
115429
|
async function runValidateCommand(input3, dependencies = {}) {
|
|
115215
115430
|
const cwd = dependencies.cwd ?? (() => process.cwd());
|
|
115216
115431
|
const mkdir5 = dependencies.mkdir ?? (async (path, options) => {
|
|
115217
|
-
await (0,
|
|
115432
|
+
await (0, import_promises23.mkdir)(path, options);
|
|
115218
115433
|
});
|
|
115219
115434
|
const readFile = dependencies.readFile ?? (async (filePath) => {
|
|
115220
115435
|
const content = await readManaged(rootDirectory, (0, import_node_path23.relative)(rootDirectory, filePath));
|
|
115221
115436
|
if (content === void 0) throw Object.assign(new Error("Missing local scaffold file."), { code: "ENOENT" });
|
|
115222
115437
|
return content;
|
|
115223
115438
|
});
|
|
115224
|
-
const stat = dependencies.stat ??
|
|
115439
|
+
const stat = dependencies.stat ?? import_promises23.stat;
|
|
115225
115440
|
const rootDirectory = await projectRoot(cwd());
|
|
115226
115441
|
for (const file of [PROFILE_FILE_PATH, CONNECTION_FILE_PATH, GITIGNORE_FILE_PATH]) await safePath(rootDirectory, file);
|
|
115227
115442
|
const profileValidation = await validateProfile(rootDirectory, { readFile, stat });
|
|
@@ -122317,6 +122532,78 @@ async function listAlertsWithAuthCommand(input3, dependencies) {
|
|
|
122317
122532
|
}
|
|
122318
122533
|
});
|
|
122319
122534
|
}
|
|
122535
|
+
async function listAlertGroupsCommand(input3, api) {
|
|
122536
|
+
try {
|
|
122537
|
+
const result = await api.listAlertGroups({
|
|
122538
|
+
bearerToken: input3.bearerToken,
|
|
122539
|
+
projectId: input3.projectId,
|
|
122540
|
+
...input3.limit === void 0 ? {} : { limit: input3.limit },
|
|
122541
|
+
...input3.cursor === void 0 ? {} : { cursor: input3.cursor }
|
|
122542
|
+
});
|
|
122543
|
+
const lines = result.groups.map(
|
|
122544
|
+
(group) => `${group.group_id} | ${group.kind} | ${group.channel} | ${group.status} | incidents=${group.member_count} | root=${group.root_incident_id ?? "none"} | ${group.created_at}`
|
|
122545
|
+
);
|
|
122546
|
+
return {
|
|
122547
|
+
exitCode: 0,
|
|
122548
|
+
output: input3.json ? JSON.stringify(result) : [
|
|
122549
|
+
...lines.length === 0 ? ["No alert groups found."] : lines,
|
|
122550
|
+
...result.next_cursor === null ? [] : [`Next cursor: ${result.next_cursor}`]
|
|
122551
|
+
].join("\n")
|
|
122552
|
+
};
|
|
122553
|
+
} catch (error2) {
|
|
122554
|
+
return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
|
|
122555
|
+
}
|
|
122556
|
+
}
|
|
122557
|
+
async function listAlertGroupsWithAuthCommand(input3, dependencies) {
|
|
122558
|
+
return runAuthenticatedCliCommand(input3, {
|
|
122559
|
+
createApi: createAuthenticatedAlertApi,
|
|
122560
|
+
dependencies,
|
|
122561
|
+
runCommand: (authState, api) => listAlertGroupsCommand({
|
|
122562
|
+
bearerToken: authState.bearer_token,
|
|
122563
|
+
projectId: input3.projectId,
|
|
122564
|
+
...input3.limit === void 0 ? {} : { limit: input3.limit },
|
|
122565
|
+
...input3.cursor === void 0 ? {} : { cursor: input3.cursor },
|
|
122566
|
+
...input3.json === void 0 ? {} : { json: input3.json }
|
|
122567
|
+
}, api)
|
|
122568
|
+
});
|
|
122569
|
+
}
|
|
122570
|
+
async function getAlertGroupCommand(input3, api) {
|
|
122571
|
+
try {
|
|
122572
|
+
const result = await api.getAlertGroup({
|
|
122573
|
+
bearerToken: input3.bearerToken,
|
|
122574
|
+
projectId: input3.projectId,
|
|
122575
|
+
kind: input3.kind,
|
|
122576
|
+
groupId: input3.groupId,
|
|
122577
|
+
...input3.limit === void 0 ? {} : { limit: input3.limit },
|
|
122578
|
+
...input3.cursor === void 0 ? {} : { cursor: input3.cursor }
|
|
122579
|
+
});
|
|
122580
|
+
return {
|
|
122581
|
+
exitCode: 0,
|
|
122582
|
+
output: input3.json ? JSON.stringify(result) : [
|
|
122583
|
+
`${result.group.group_id} | ${result.group.kind} | ${result.group.channel} | ${result.group.status} | incidents=${result.group.member_count}`,
|
|
122584
|
+
...result.members.map((member) => `${member.incident_id} | ${member.condition_type} | ${member.created_at}`),
|
|
122585
|
+
...result.next_cursor === null ? [] : [`Next cursor: ${result.next_cursor}`]
|
|
122586
|
+
].join("\n")
|
|
122587
|
+
};
|
|
122588
|
+
} catch (error2) {
|
|
122589
|
+
return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
|
|
122590
|
+
}
|
|
122591
|
+
}
|
|
122592
|
+
async function getAlertGroupWithAuthCommand(input3, dependencies) {
|
|
122593
|
+
return runAuthenticatedCliCommand(input3, {
|
|
122594
|
+
createApi: createAuthenticatedAlertApi,
|
|
122595
|
+
dependencies,
|
|
122596
|
+
runCommand: (authState, api) => getAlertGroupCommand({
|
|
122597
|
+
bearerToken: authState.bearer_token,
|
|
122598
|
+
projectId: input3.projectId,
|
|
122599
|
+
kind: input3.kind,
|
|
122600
|
+
groupId: input3.groupId,
|
|
122601
|
+
...input3.limit === void 0 ? {} : { limit: input3.limit },
|
|
122602
|
+
...input3.cursor === void 0 ? {} : { cursor: input3.cursor },
|
|
122603
|
+
...input3.json === void 0 ? {} : { json: input3.json }
|
|
122604
|
+
}, api)
|
|
122605
|
+
});
|
|
122606
|
+
}
|
|
122320
122607
|
async function createAlertCommand(input3, api) {
|
|
122321
122608
|
try {
|
|
122322
122609
|
const requestInput = {
|
|
@@ -122344,7 +122631,10 @@ async function createAlertCommand(input3, api) {
|
|
|
122344
122631
|
const alert = await api.createAlert(requestInput);
|
|
122345
122632
|
return {
|
|
122346
122633
|
exitCode: 0,
|
|
122347
|
-
output: input3.json ? JSON.stringify({ alert }) :
|
|
122634
|
+
output: input3.json ? JSON.stringify({ alert }) : [
|
|
122635
|
+
`Alert created: ${alert.alert_id}`,
|
|
122636
|
+
...alert.signing_secret === void 0 ? [] : [`Signing secret (shown once): ${alert.signing_secret}`]
|
|
122637
|
+
].join("\n")
|
|
122348
122638
|
};
|
|
122349
122639
|
} catch (error2) {
|
|
122350
122640
|
return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
|
|
@@ -122414,13 +122704,19 @@ async function updateAlertCommand(input3, api) {
|
|
|
122414
122704
|
if (input3.config !== void 0) {
|
|
122415
122705
|
requestInput.config = input3.config;
|
|
122416
122706
|
}
|
|
122707
|
+
if (input3.rotateSigningSecret === true) {
|
|
122708
|
+
requestInput.rotateSigningSecret = true;
|
|
122709
|
+
}
|
|
122417
122710
|
if (input3.isEnabled !== void 0) {
|
|
122418
122711
|
requestInput.isEnabled = input3.isEnabled;
|
|
122419
122712
|
}
|
|
122420
122713
|
const alert = await api.updateAlert(requestInput);
|
|
122421
122714
|
return {
|
|
122422
122715
|
exitCode: 0,
|
|
122423
|
-
output: input3.json ? JSON.stringify({ alert }) :
|
|
122716
|
+
output: input3.json ? JSON.stringify({ alert }) : [
|
|
122717
|
+
`Alert updated: ${alert.alert_id}`,
|
|
122718
|
+
...alert.signing_secret === void 0 ? [] : [`Signing secret (shown once): ${alert.signing_secret}`]
|
|
122719
|
+
].join("\n")
|
|
122424
122720
|
};
|
|
122425
122721
|
} catch (error2) {
|
|
122426
122722
|
return { exitCode: mapErrorToExitCode20(error2), output: error2 instanceof Error ? error2.message : String(error2) };
|
|
@@ -122457,6 +122753,9 @@ async function updateAlertWithAuthCommand(input3, dependencies) {
|
|
|
122457
122753
|
if (input3.config !== void 0) {
|
|
122458
122754
|
commandInput.config = input3.config;
|
|
122459
122755
|
}
|
|
122756
|
+
if (input3.rotateSigningSecret === true) {
|
|
122757
|
+
commandInput.rotateSigningSecret = true;
|
|
122758
|
+
}
|
|
122460
122759
|
if (input3.isEnabled !== void 0) {
|
|
122461
122760
|
commandInput.isEnabled = input3.isEnabled;
|
|
122462
122761
|
}
|
|
@@ -123351,6 +123650,36 @@ async function handleWebhookCommand(parsedArgv, dependencies) {
|
|
|
123351
123650
|
}
|
|
123352
123651
|
async function handleAlertCommand(parsedArgv, dependencies) {
|
|
123353
123652
|
const action = requirePositional(parsedArgv, 1, "action");
|
|
123653
|
+
if (action === "groups" || action === "group") {
|
|
123654
|
+
expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id", "limit", "cursor"]);
|
|
123655
|
+
ensureNoExtraPositionals(parsedArgv, action === "groups" ? 2 : 4);
|
|
123656
|
+
const projectId = readStringOption(parsedArgv, "project-id");
|
|
123657
|
+
if (projectId === void 0) throw new CliInputError("Missing required option --project-id.");
|
|
123658
|
+
const limit = readLimitOption(parsedArgv);
|
|
123659
|
+
const cursor = readStringOption(parsedArgv, "cursor");
|
|
123660
|
+
if (action === "groups") {
|
|
123661
|
+
return await (dependencies.listAlertGroupsCommand ?? listAlertGroupsWithAuthCommand)(
|
|
123662
|
+
appendCommonAuthOptions(parsedArgv, {
|
|
123663
|
+
projectId,
|
|
123664
|
+
...limit === void 0 ? {} : { limit },
|
|
123665
|
+
...cursor === void 0 ? {} : { cursor }
|
|
123666
|
+
})
|
|
123667
|
+
);
|
|
123668
|
+
}
|
|
123669
|
+
const kind = requirePositional(parsedArgv, 2, "kind");
|
|
123670
|
+
if (kind !== "direct" && kind !== "email_digest") {
|
|
123671
|
+
throw new CliInputError("Alert group kind must be direct or email_digest.");
|
|
123672
|
+
}
|
|
123673
|
+
return await (dependencies.getAlertGroupCommand ?? getAlertGroupWithAuthCommand)(
|
|
123674
|
+
appendCommonAuthOptions(parsedArgv, {
|
|
123675
|
+
projectId,
|
|
123676
|
+
kind,
|
|
123677
|
+
groupId: requirePositional(parsedArgv, 3, "group-id"),
|
|
123678
|
+
...limit === void 0 ? {} : { limit },
|
|
123679
|
+
...cursor === void 0 ? {} : { cursor }
|
|
123680
|
+
})
|
|
123681
|
+
);
|
|
123682
|
+
}
|
|
123354
123683
|
if (action === "list") {
|
|
123355
123684
|
expectNoUnknownOptions(parsedArgv, ["auth-file", "json", "project-id", "limit"]);
|
|
123356
123685
|
ensureNoExtraPositionals(parsedArgv, 2);
|
|
@@ -123438,6 +123767,7 @@ async function handleAlertCommand(parsedArgv, dependencies) {
|
|
|
123438
123767
|
"severity-lifecycle-scope",
|
|
123439
123768
|
"cooldown",
|
|
123440
123769
|
"config-json",
|
|
123770
|
+
"rotate-signing-secret",
|
|
123441
123771
|
"is-enabled"
|
|
123442
123772
|
]);
|
|
123443
123773
|
ensureNoExtraPositionals(parsedArgv, 3);
|
|
@@ -123477,11 +123807,14 @@ async function handleAlertCommand(parsedArgv, dependencies) {
|
|
|
123477
123807
|
if (config2 !== void 0) {
|
|
123478
123808
|
input3.config = config2;
|
|
123479
123809
|
}
|
|
123810
|
+
if (readBooleanStringOption(parsedArgv, "rotate-signing-secret") === true) {
|
|
123811
|
+
input3.rotateSigningSecret = true;
|
|
123812
|
+
}
|
|
123480
123813
|
const isEnabled = readBooleanStringOption(parsedArgv, "is-enabled");
|
|
123481
123814
|
if (isEnabled !== void 0) {
|
|
123482
123815
|
input3.isEnabled = isEnabled;
|
|
123483
123816
|
}
|
|
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) {
|
|
123817
|
+
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
123818
|
throw new CliInputError("At least one alert field must be provided.");
|
|
123486
123819
|
}
|
|
123487
123820
|
return await (dependencies.updateAlertCommand ?? updateAlertWithAuthCommand)(input3);
|
|
@@ -123739,7 +124072,7 @@ async function handleCaptureRuleCommand2(parsedArgv, dependencies) {
|
|
|
123739
124072
|
// package.json
|
|
123740
124073
|
var package_default = {
|
|
123741
124074
|
name: "@debugbundle/cli",
|
|
123742
|
-
version: "1.
|
|
124075
|
+
version: "1.12.0",
|
|
123743
124076
|
private: false,
|
|
123744
124077
|
description: "Command-line interface for DebugBundle",
|
|
123745
124078
|
license: "Apache-2.0",
|