agent-relay 6.0.20 → 6.0.22

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 (82) hide show
  1. package/dist/index.cjs +875 -104
  2. package/dist/src/cli/commands/agent-management.d.ts +1 -0
  3. package/dist/src/cli/commands/agent-management.d.ts.map +1 -1
  4. package/dist/src/cli/commands/agent-management.js +46 -6
  5. package/dist/src/cli/commands/agent-management.js.map +1 -1
  6. package/dist/src/cli/commands/core.d.ts.map +1 -1
  7. package/dist/src/cli/commands/core.js +2 -0
  8. package/dist/src/cli/commands/core.js.map +1 -1
  9. package/dist/src/cli/lib/broker-lifecycle.d.ts +2 -0
  10. package/dist/src/cli/lib/broker-lifecycle.d.ts.map +1 -1
  11. package/dist/src/cli/lib/broker-lifecycle.js +263 -69
  12. package/dist/src/cli/lib/broker-lifecycle.js.map +1 -1
  13. package/dist/src/cost/pricing.d.ts.map +1 -1
  14. package/dist/src/cost/pricing.js +5 -3
  15. package/dist/src/cost/pricing.js.map +1 -1
  16. package/node_modules/@relaycast/sdk/dist/agent.d.ts +16 -1
  17. package/node_modules/@relaycast/sdk/dist/agent.d.ts.map +1 -1
  18. package/node_modules/@relaycast/sdk/dist/agent.js +143 -3
  19. package/node_modules/@relaycast/sdk/dist/agent.js.map +1 -1
  20. package/node_modules/@relaycast/sdk/dist/communicate/index.d.ts +3 -0
  21. package/node_modules/@relaycast/sdk/dist/communicate/index.d.ts.map +1 -0
  22. package/node_modules/@relaycast/sdk/dist/communicate/index.js +2 -0
  23. package/node_modules/@relaycast/sdk/dist/communicate/index.js.map +1 -0
  24. package/node_modules/@relaycast/sdk/dist/communicate/relay.d.ts +13 -0
  25. package/node_modules/@relaycast/sdk/dist/communicate/relay.d.ts.map +1 -0
  26. package/node_modules/@relaycast/sdk/dist/communicate/relay.js +73 -0
  27. package/node_modules/@relaycast/sdk/dist/communicate/relay.js.map +1 -0
  28. package/node_modules/@relaycast/sdk/dist/communicate/types.d.ts +23 -0
  29. package/node_modules/@relaycast/sdk/dist/communicate/types.d.ts.map +1 -0
  30. package/node_modules/@relaycast/sdk/dist/communicate/types.js +2 -0
  31. package/node_modules/@relaycast/sdk/dist/communicate/types.js.map +1 -0
  32. package/node_modules/@relaycast/sdk/dist/errors.d.ts +1 -1
  33. package/node_modules/@relaycast/sdk/dist/errors.d.ts.map +1 -1
  34. package/node_modules/@relaycast/sdk/dist/errors.js +10 -0
  35. package/node_modules/@relaycast/sdk/dist/errors.js.map +1 -1
  36. package/node_modules/@relaycast/sdk/dist/event-id.d.ts +2 -0
  37. package/node_modules/@relaycast/sdk/dist/event-id.d.ts.map +1 -0
  38. package/node_modules/@relaycast/sdk/dist/event-id.js +50 -0
  39. package/node_modules/@relaycast/sdk/dist/event-id.js.map +1 -0
  40. package/node_modules/@relaycast/sdk/dist/index.d.ts +9 -2
  41. package/node_modules/@relaycast/sdk/dist/index.d.ts.map +1 -1
  42. package/node_modules/@relaycast/sdk/dist/index.js +4 -1
  43. package/node_modules/@relaycast/sdk/dist/index.js.map +1 -1
  44. package/node_modules/@relaycast/sdk/dist/setup-errors.d.ts +55 -0
  45. package/node_modules/@relaycast/sdk/dist/setup-errors.d.ts.map +1 -0
  46. package/node_modules/@relaycast/sdk/dist/setup-errors.js +73 -0
  47. package/node_modules/@relaycast/sdk/dist/setup-errors.js.map +1 -0
  48. package/node_modules/@relaycast/sdk/dist/setup-types.d.ts +54 -0
  49. package/node_modules/@relaycast/sdk/dist/setup-types.d.ts.map +1 -0
  50. package/node_modules/@relaycast/sdk/dist/setup-types.js +2 -0
  51. package/node_modules/@relaycast/sdk/dist/setup-types.js.map +1 -0
  52. package/node_modules/@relaycast/sdk/dist/setup.d.ts +41 -0
  53. package/node_modules/@relaycast/sdk/dist/setup.d.ts.map +1 -0
  54. package/node_modules/@relaycast/sdk/dist/setup.js +320 -0
  55. package/node_modules/@relaycast/sdk/dist/setup.js.map +1 -0
  56. package/node_modules/@relaycast/sdk/dist/subscription.d.ts +5 -0
  57. package/node_modules/@relaycast/sdk/dist/subscription.d.ts.map +1 -0
  58. package/node_modules/@relaycast/sdk/dist/subscription.js +2 -0
  59. package/node_modules/@relaycast/sdk/dist/subscription.js.map +1 -0
  60. package/node_modules/@relaycast/sdk/dist/types.d.ts +1 -0
  61. package/node_modules/@relaycast/sdk/dist/types.d.ts.map +1 -1
  62. package/node_modules/@relaycast/sdk/dist/version.d.ts +1 -1
  63. package/node_modules/@relaycast/sdk/dist/version.js +1 -1
  64. package/node_modules/@relaycast/sdk/dist/ws.d.ts +1 -0
  65. package/node_modules/@relaycast/sdk/dist/ws.d.ts.map +1 -1
  66. package/node_modules/@relaycast/sdk/dist/ws.js +3 -0
  67. package/node_modules/@relaycast/sdk/dist/ws.js.map +1 -1
  68. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/event-id.d.ts +2 -0
  69. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/event-id.d.ts.map +1 -0
  70. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/event-id.js +50 -0
  71. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/event-id.js.map +1 -0
  72. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/events.d.ts +95 -0
  73. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/events.d.ts.map +1 -1
  74. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/events.js +10 -0
  75. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/events.js.map +1 -1
  76. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/index.d.ts +1 -0
  77. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/index.d.ts.map +1 -1
  78. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/index.js +1 -0
  79. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/dist/index.js.map +1 -1
  80. package/node_modules/@relaycast/sdk/node_modules/@relaycast/types/package.json +1 -1
  81. package/node_modules/@relaycast/sdk/package.json +7 -2
  82. package/package.json +9 -9
package/dist/index.cjs CHANGED
@@ -21052,7 +21052,7 @@ var require_package = __commonJS({
21052
21052
  "node_modules/@slack/web-api/package.json"(exports2, module2) {
21053
21053
  module2.exports = {
21054
21054
  name: "@slack/web-api",
21055
- version: "7.15.2",
21055
+ version: "7.16.0",
21056
21056
  description: "Official library for using the Slack Platform's Web API",
21057
21057
  author: "Slack Technologies, LLC",
21058
21058
  license: "MIT",
@@ -21104,7 +21104,7 @@ var require_package = __commonJS({
21104
21104
  "@slack/types": "^2.21.0",
21105
21105
  "@types/node": ">=18",
21106
21106
  "@types/retry": "0.12.0",
21107
- axios: "^1.15.0",
21107
+ axios: "^1.16.0",
21108
21108
  eventemitter3: "^5.0.1",
21109
21109
  "form-data": "^4.0.4",
21110
21110
  "is-electron": "2.2.2",
@@ -32456,6 +32456,456 @@ var require_src = __commonJS({
32456
32456
  }
32457
32457
  });
32458
32458
 
32459
+ // node_modules/axios/node_modules/agent-base/dist/src/promisify.js
32460
+ var require_promisify = __commonJS({
32461
+ "node_modules/axios/node_modules/agent-base/dist/src/promisify.js"(exports2) {
32462
+ "use strict";
32463
+ Object.defineProperty(exports2, "__esModule", { value: true });
32464
+ function promisify4(fn2) {
32465
+ return function(req, opts) {
32466
+ return new Promise((resolve4, reject) => {
32467
+ fn2.call(this, req, opts, (err, rtn) => {
32468
+ if (err) {
32469
+ reject(err);
32470
+ } else {
32471
+ resolve4(rtn);
32472
+ }
32473
+ });
32474
+ });
32475
+ };
32476
+ }
32477
+ exports2.default = promisify4;
32478
+ }
32479
+ });
32480
+
32481
+ // node_modules/axios/node_modules/agent-base/dist/src/index.js
32482
+ var require_src2 = __commonJS({
32483
+ "node_modules/axios/node_modules/agent-base/dist/src/index.js"(exports2, module2) {
32484
+ "use strict";
32485
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
32486
+ return mod && mod.__esModule ? mod : { "default": mod };
32487
+ };
32488
+ var events_1 = require("events");
32489
+ var debug_1 = __importDefault(require_src());
32490
+ var promisify_1 = __importDefault(require_promisify());
32491
+ var debug = debug_1.default("agent-base");
32492
+ function isAgent(v2) {
32493
+ return Boolean(v2) && typeof v2.addRequest === "function";
32494
+ }
32495
+ function isSecureEndpoint() {
32496
+ const { stack } = new Error();
32497
+ if (typeof stack !== "string")
32498
+ return false;
32499
+ return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
32500
+ }
32501
+ function createAgent(callback, opts) {
32502
+ return new createAgent.Agent(callback, opts);
32503
+ }
32504
+ (function(createAgent2) {
32505
+ class Agent extends events_1.EventEmitter {
32506
+ constructor(callback, _opts) {
32507
+ super();
32508
+ let opts = _opts;
32509
+ if (typeof callback === "function") {
32510
+ this.callback = callback;
32511
+ } else if (callback) {
32512
+ opts = callback;
32513
+ }
32514
+ this.timeout = null;
32515
+ if (opts && typeof opts.timeout === "number") {
32516
+ this.timeout = opts.timeout;
32517
+ }
32518
+ this.maxFreeSockets = 1;
32519
+ this.maxSockets = 1;
32520
+ this.maxTotalSockets = Infinity;
32521
+ this.sockets = {};
32522
+ this.freeSockets = {};
32523
+ this.requests = {};
32524
+ this.options = {};
32525
+ }
32526
+ get defaultPort() {
32527
+ if (typeof this.explicitDefaultPort === "number") {
32528
+ return this.explicitDefaultPort;
32529
+ }
32530
+ return isSecureEndpoint() ? 443 : 80;
32531
+ }
32532
+ set defaultPort(v2) {
32533
+ this.explicitDefaultPort = v2;
32534
+ }
32535
+ get protocol() {
32536
+ if (typeof this.explicitProtocol === "string") {
32537
+ return this.explicitProtocol;
32538
+ }
32539
+ return isSecureEndpoint() ? "https:" : "http:";
32540
+ }
32541
+ set protocol(v2) {
32542
+ this.explicitProtocol = v2;
32543
+ }
32544
+ callback(req, opts, fn2) {
32545
+ throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`');
32546
+ }
32547
+ /**
32548
+ * Called by node-core's "_http_client.js" module when creating
32549
+ * a new HTTP request with this Agent instance.
32550
+ *
32551
+ * @api public
32552
+ */
32553
+ addRequest(req, _opts) {
32554
+ const opts = Object.assign({}, _opts);
32555
+ if (typeof opts.secureEndpoint !== "boolean") {
32556
+ opts.secureEndpoint = isSecureEndpoint();
32557
+ }
32558
+ if (opts.host == null) {
32559
+ opts.host = "localhost";
32560
+ }
32561
+ if (opts.port == null) {
32562
+ opts.port = opts.secureEndpoint ? 443 : 80;
32563
+ }
32564
+ if (opts.protocol == null) {
32565
+ opts.protocol = opts.secureEndpoint ? "https:" : "http:";
32566
+ }
32567
+ if (opts.host && opts.path) {
32568
+ delete opts.path;
32569
+ }
32570
+ delete opts.agent;
32571
+ delete opts.hostname;
32572
+ delete opts._defaultAgent;
32573
+ delete opts.defaultPort;
32574
+ delete opts.createConnection;
32575
+ req._last = true;
32576
+ req.shouldKeepAlive = false;
32577
+ let timedOut = false;
32578
+ let timeoutId = null;
32579
+ const timeoutMs = opts.timeout || this.timeout;
32580
+ const onerror = (err) => {
32581
+ if (req._hadError)
32582
+ return;
32583
+ req.emit("error", err);
32584
+ req._hadError = true;
32585
+ };
32586
+ const ontimeout = () => {
32587
+ timeoutId = null;
32588
+ timedOut = true;
32589
+ const err = new Error(`A "socket" was not created for HTTP request before ${timeoutMs}ms`);
32590
+ err.code = "ETIMEOUT";
32591
+ onerror(err);
32592
+ };
32593
+ const callbackError = (err) => {
32594
+ if (timedOut)
32595
+ return;
32596
+ if (timeoutId !== null) {
32597
+ clearTimeout(timeoutId);
32598
+ timeoutId = null;
32599
+ }
32600
+ onerror(err);
32601
+ };
32602
+ const onsocket = (socket) => {
32603
+ if (timedOut)
32604
+ return;
32605
+ if (timeoutId != null) {
32606
+ clearTimeout(timeoutId);
32607
+ timeoutId = null;
32608
+ }
32609
+ if (isAgent(socket)) {
32610
+ debug("Callback returned another Agent instance %o", socket.constructor.name);
32611
+ socket.addRequest(req, opts);
32612
+ return;
32613
+ }
32614
+ if (socket) {
32615
+ socket.once("free", () => {
32616
+ this.freeSocket(socket, opts);
32617
+ });
32618
+ req.onSocket(socket);
32619
+ return;
32620
+ }
32621
+ const err = new Error(`no Duplex stream was returned to agent-base for \`${req.method} ${req.path}\``);
32622
+ onerror(err);
32623
+ };
32624
+ if (typeof this.callback !== "function") {
32625
+ onerror(new Error("`callback` is not defined"));
32626
+ return;
32627
+ }
32628
+ if (!this.promisifiedCallback) {
32629
+ if (this.callback.length >= 3) {
32630
+ debug("Converting legacy callback function to promise");
32631
+ this.promisifiedCallback = promisify_1.default(this.callback);
32632
+ } else {
32633
+ this.promisifiedCallback = this.callback;
32634
+ }
32635
+ }
32636
+ if (typeof timeoutMs === "number" && timeoutMs > 0) {
32637
+ timeoutId = setTimeout(ontimeout, timeoutMs);
32638
+ }
32639
+ if ("port" in opts && typeof opts.port !== "number") {
32640
+ opts.port = Number(opts.port);
32641
+ }
32642
+ try {
32643
+ debug("Resolving socket for %o request: %o", opts.protocol, `${req.method} ${req.path}`);
32644
+ Promise.resolve(this.promisifiedCallback(req, opts)).then(onsocket, callbackError);
32645
+ } catch (err) {
32646
+ Promise.reject(err).catch(callbackError);
32647
+ }
32648
+ }
32649
+ freeSocket(socket, opts) {
32650
+ debug("Freeing socket %o %o", socket.constructor.name, opts);
32651
+ socket.destroy();
32652
+ }
32653
+ destroy() {
32654
+ debug("Destroying agent %o", this.constructor.name);
32655
+ }
32656
+ }
32657
+ createAgent2.Agent = Agent;
32658
+ createAgent2.prototype = createAgent2.Agent.prototype;
32659
+ })(createAgent || (createAgent = {}));
32660
+ module2.exports = createAgent;
32661
+ }
32662
+ });
32663
+
32664
+ // node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js
32665
+ var require_parse_proxy_response = __commonJS({
32666
+ "node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
32667
+ "use strict";
32668
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
32669
+ return mod && mod.__esModule ? mod : { "default": mod };
32670
+ };
32671
+ Object.defineProperty(exports2, "__esModule", { value: true });
32672
+ var debug_1 = __importDefault(require_src());
32673
+ var debug = debug_1.default("https-proxy-agent:parse-proxy-response");
32674
+ function parseProxyResponse(socket) {
32675
+ return new Promise((resolve4, reject) => {
32676
+ let buffersLength = 0;
32677
+ const buffers = [];
32678
+ function read() {
32679
+ const b2 = socket.read();
32680
+ if (b2)
32681
+ ondata(b2);
32682
+ else
32683
+ socket.once("readable", read);
32684
+ }
32685
+ function cleanup() {
32686
+ socket.removeListener("end", onend);
32687
+ socket.removeListener("error", onerror);
32688
+ socket.removeListener("close", onclose);
32689
+ socket.removeListener("readable", read);
32690
+ }
32691
+ function onclose(err) {
32692
+ debug("onclose had error %o", err);
32693
+ }
32694
+ function onend() {
32695
+ debug("onend");
32696
+ }
32697
+ function onerror(err) {
32698
+ cleanup();
32699
+ debug("onerror %o", err);
32700
+ reject(err);
32701
+ }
32702
+ function ondata(b2) {
32703
+ buffers.push(b2);
32704
+ buffersLength += b2.length;
32705
+ const buffered = Buffer.concat(buffers, buffersLength);
32706
+ const endOfHeaders = buffered.indexOf("\r\n\r\n");
32707
+ if (endOfHeaders === -1) {
32708
+ debug("have not received end of HTTP headers yet...");
32709
+ read();
32710
+ return;
32711
+ }
32712
+ const firstLine = buffered.toString("ascii", 0, buffered.indexOf("\r\n"));
32713
+ const statusCode = +firstLine.split(" ")[1];
32714
+ debug("got proxy server response: %o", firstLine);
32715
+ resolve4({
32716
+ statusCode,
32717
+ buffered
32718
+ });
32719
+ }
32720
+ socket.on("error", onerror);
32721
+ socket.on("close", onclose);
32722
+ socket.on("end", onend);
32723
+ read();
32724
+ });
32725
+ }
32726
+ exports2.default = parseProxyResponse;
32727
+ }
32728
+ });
32729
+
32730
+ // node_modules/axios/node_modules/https-proxy-agent/dist/agent.js
32731
+ var require_agent = __commonJS({
32732
+ "node_modules/axios/node_modules/https-proxy-agent/dist/agent.js"(exports2) {
32733
+ "use strict";
32734
+ var __awaiter = exports2 && exports2.__awaiter || function(thisArg, _arguments, P2, generator) {
32735
+ function adopt(value) {
32736
+ return value instanceof P2 ? value : new P2(function(resolve4) {
32737
+ resolve4(value);
32738
+ });
32739
+ }
32740
+ return new (P2 || (P2 = Promise))(function(resolve4, reject) {
32741
+ function fulfilled(value) {
32742
+ try {
32743
+ step(generator.next(value));
32744
+ } catch (e) {
32745
+ reject(e);
32746
+ }
32747
+ }
32748
+ function rejected(value) {
32749
+ try {
32750
+ step(generator["throw"](value));
32751
+ } catch (e) {
32752
+ reject(e);
32753
+ }
32754
+ }
32755
+ function step(result) {
32756
+ result.done ? resolve4(result.value) : adopt(result.value).then(fulfilled, rejected);
32757
+ }
32758
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32759
+ });
32760
+ };
32761
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
32762
+ return mod && mod.__esModule ? mod : { "default": mod };
32763
+ };
32764
+ Object.defineProperty(exports2, "__esModule", { value: true });
32765
+ var net_1 = __importDefault(require("net"));
32766
+ var tls_1 = __importDefault(require("tls"));
32767
+ var url_1 = __importDefault(require("url"));
32768
+ var assert_1 = __importDefault(require("assert"));
32769
+ var debug_1 = __importDefault(require_src());
32770
+ var agent_base_1 = require_src2();
32771
+ var parse_proxy_response_1 = __importDefault(require_parse_proxy_response());
32772
+ var debug = debug_1.default("https-proxy-agent:agent");
32773
+ var HttpsProxyAgent = class extends agent_base_1.Agent {
32774
+ constructor(_opts) {
32775
+ let opts;
32776
+ if (typeof _opts === "string") {
32777
+ opts = url_1.default.parse(_opts);
32778
+ } else {
32779
+ opts = _opts;
32780
+ }
32781
+ if (!opts) {
32782
+ throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");
32783
+ }
32784
+ debug("creating new HttpsProxyAgent instance: %o", opts);
32785
+ super(opts);
32786
+ const proxy = Object.assign({}, opts);
32787
+ this.secureProxy = opts.secureProxy || isHTTPS(proxy.protocol);
32788
+ proxy.host = proxy.hostname || proxy.host;
32789
+ if (typeof proxy.port === "string") {
32790
+ proxy.port = parseInt(proxy.port, 10);
32791
+ }
32792
+ if (!proxy.port && proxy.host) {
32793
+ proxy.port = this.secureProxy ? 443 : 80;
32794
+ }
32795
+ if (this.secureProxy && !("ALPNProtocols" in proxy)) {
32796
+ proxy.ALPNProtocols = ["http 1.1"];
32797
+ }
32798
+ if (proxy.host && proxy.path) {
32799
+ delete proxy.path;
32800
+ delete proxy.pathname;
32801
+ }
32802
+ this.proxy = proxy;
32803
+ }
32804
+ /**
32805
+ * Called when the node-core HTTP client library is creating a
32806
+ * new HTTP request.
32807
+ *
32808
+ * @api protected
32809
+ */
32810
+ callback(req, opts) {
32811
+ return __awaiter(this, void 0, void 0, function* () {
32812
+ const { proxy, secureProxy } = this;
32813
+ let socket;
32814
+ if (secureProxy) {
32815
+ debug("Creating `tls.Socket`: %o", proxy);
32816
+ socket = tls_1.default.connect(proxy);
32817
+ } else {
32818
+ debug("Creating `net.Socket`: %o", proxy);
32819
+ socket = net_1.default.connect(proxy);
32820
+ }
32821
+ const headers = Object.assign({}, proxy.headers);
32822
+ const hostname3 = `${opts.host}:${opts.port}`;
32823
+ let payload = `CONNECT ${hostname3} HTTP/1.1\r
32824
+ `;
32825
+ if (proxy.auth) {
32826
+ headers["Proxy-Authorization"] = `Basic ${Buffer.from(proxy.auth).toString("base64")}`;
32827
+ }
32828
+ let { host, port, secureEndpoint } = opts;
32829
+ if (!isDefaultPort(port, secureEndpoint)) {
32830
+ host += `:${port}`;
32831
+ }
32832
+ headers.Host = host;
32833
+ headers.Connection = "close";
32834
+ for (const name of Object.keys(headers)) {
32835
+ payload += `${name}: ${headers[name]}\r
32836
+ `;
32837
+ }
32838
+ const proxyResponsePromise = parse_proxy_response_1.default(socket);
32839
+ socket.write(`${payload}\r
32840
+ `);
32841
+ const { statusCode, buffered } = yield proxyResponsePromise;
32842
+ if (statusCode === 200) {
32843
+ req.once("socket", resume);
32844
+ if (opts.secureEndpoint) {
32845
+ debug("Upgrading socket connection to TLS");
32846
+ const servername = opts.servername || opts.host;
32847
+ return tls_1.default.connect(Object.assign(Object.assign({}, omit2(opts, "host", "hostname", "path", "port")), {
32848
+ socket,
32849
+ servername
32850
+ }));
32851
+ }
32852
+ return socket;
32853
+ }
32854
+ socket.destroy();
32855
+ const fakeSocket = new net_1.default.Socket({ writable: false });
32856
+ fakeSocket.readable = true;
32857
+ req.once("socket", (s3) => {
32858
+ debug("replaying proxy buffer for failed request");
32859
+ assert_1.default(s3.listenerCount("data") > 0);
32860
+ s3.push(buffered);
32861
+ s3.push(null);
32862
+ });
32863
+ return fakeSocket;
32864
+ });
32865
+ }
32866
+ };
32867
+ exports2.default = HttpsProxyAgent;
32868
+ function resume(socket) {
32869
+ socket.resume();
32870
+ }
32871
+ function isDefaultPort(port, secure) {
32872
+ return Boolean(!secure && port === 80 || secure && port === 443);
32873
+ }
32874
+ function isHTTPS(protocol) {
32875
+ return typeof protocol === "string" ? /^https:?$/i.test(protocol) : false;
32876
+ }
32877
+ function omit2(obj, ...keys) {
32878
+ const ret = {};
32879
+ let key;
32880
+ for (key in obj) {
32881
+ if (!keys.includes(key)) {
32882
+ ret[key] = obj[key];
32883
+ }
32884
+ }
32885
+ return ret;
32886
+ }
32887
+ }
32888
+ });
32889
+
32890
+ // node_modules/axios/node_modules/https-proxy-agent/dist/index.js
32891
+ var require_dist3 = __commonJS({
32892
+ "node_modules/axios/node_modules/https-proxy-agent/dist/index.js"(exports2, module2) {
32893
+ "use strict";
32894
+ var __importDefault = exports2 && exports2.__importDefault || function(mod) {
32895
+ return mod && mod.__esModule ? mod : { "default": mod };
32896
+ };
32897
+ var agent_1 = __importDefault(require_agent());
32898
+ function createHttpsProxyAgent(opts) {
32899
+ return new agent_1.default(opts);
32900
+ }
32901
+ (function(createHttpsProxyAgent2) {
32902
+ createHttpsProxyAgent2.HttpsProxyAgent = agent_1.default;
32903
+ createHttpsProxyAgent2.prototype = agent_1.default.prototype;
32904
+ })(createHttpsProxyAgent || (createHttpsProxyAgent = {}));
32905
+ module2.exports = createHttpsProxyAgent;
32906
+ }
32907
+ });
32908
+
32459
32909
  // node_modules/follow-redirects/debug.js
32460
32910
  var require_debug = __commonJS({
32461
32911
  "node_modules/follow-redirects/debug.js"(exports2, module2) {
@@ -32994,6 +33444,7 @@ var require_axios = __commonJS({
32994
33444
  var FormData$1 = require_form_data();
32995
33445
  var crypto3 = require("crypto");
32996
33446
  var url2 = require("url");
33447
+ var HttpsProxyAgent = require_dist3();
32997
33448
  var http2 = require("http");
32998
33449
  var https3 = require("https");
32999
33450
  var http22 = require("http2");
@@ -33346,29 +33797,29 @@ var require_axios = __commonJS({
33346
33797
  return !!(thing && isFunction$1(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]);
33347
33798
  }
33348
33799
  var toJSONObject = (obj) => {
33349
- const stack = new Array(10);
33350
- const visit = (source, i) => {
33800
+ const visited = /* @__PURE__ */ new WeakSet();
33801
+ const visit = (source) => {
33351
33802
  if (isObject3(source)) {
33352
- if (stack.indexOf(source) >= 0) {
33803
+ if (visited.has(source)) {
33353
33804
  return;
33354
33805
  }
33355
33806
  if (isBuffer(source)) {
33356
33807
  return source;
33357
33808
  }
33358
33809
  if (!("toJSON" in source)) {
33359
- stack[i] = source;
33810
+ visited.add(source);
33360
33811
  const target = isArray(source) ? [] : {};
33361
33812
  forEach(source, (value, key) => {
33362
- const reducedValue = visit(value, i + 1);
33813
+ const reducedValue = visit(value);
33363
33814
  !isUndefined(reducedValue) && (target[key] = reducedValue);
33364
33815
  });
33365
- stack[i] = void 0;
33816
+ visited.delete(source);
33366
33817
  return target;
33367
33818
  }
33368
33819
  }
33369
33820
  return source;
33370
33821
  };
33371
- return visit(obj, 0);
33822
+ return visit(obj);
33372
33823
  };
33373
33824
  var isAsyncFn = kindOfTest("AsyncFunction");
33374
33825
  var isThenable = (thing) => thing && (isObject3(thing) || isFunction$1(thing)) && isFunction$1(thing.then) && isFunction$1(thing.catch);
@@ -33480,8 +33931,6 @@ var require_axios = __commonJS({
33480
33931
  });
33481
33932
  return parsed;
33482
33933
  };
33483
- var $internals = /* @__PURE__ */ Symbol("internals");
33484
- var INVALID_HEADER_VALUE_CHARS_RE = /[^\x09\x20-\x7E\x80-\xFF]/g;
33485
33934
  function trimSPorHTAB(str) {
33486
33935
  let start = 0;
33487
33936
  let end = str.length;
@@ -33501,12 +33950,27 @@ var require_axios = __commonJS({
33501
33950
  }
33502
33951
  return start === 0 && end === str.length ? str : str.slice(start, end);
33503
33952
  }
33953
+ var INVALID_UNICODE_HEADER_VALUE_CHARS = new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+", "g");
33954
+ var INVALID_BYTE_STRING_HEADER_VALUE_CHARS = new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+", "g");
33955
+ function sanitizeValue(value, invalidChars) {
33956
+ if (utils$1.isArray(value)) {
33957
+ return value.map((item) => sanitizeValue(item, invalidChars));
33958
+ }
33959
+ return trimSPorHTAB(String(value).replace(invalidChars, ""));
33960
+ }
33961
+ var sanitizeHeaderValue = (value) => sanitizeValue(value, INVALID_UNICODE_HEADER_VALUE_CHARS);
33962
+ var sanitizeByteStringHeaderValue = (value) => sanitizeValue(value, INVALID_BYTE_STRING_HEADER_VALUE_CHARS);
33963
+ function toByteStringHeaderObject(headers) {
33964
+ const byteStringHeaders = /* @__PURE__ */ Object.create(null);
33965
+ utils$1.forEach(headers.toJSON(), (value, header) => {
33966
+ byteStringHeaders[header] = sanitizeByteStringHeaderValue(value);
33967
+ });
33968
+ return byteStringHeaders;
33969
+ }
33970
+ var $internals = /* @__PURE__ */ Symbol("internals");
33504
33971
  function normalizeHeader(header) {
33505
33972
  return header && String(header).trim().toLowerCase();
33506
33973
  }
33507
- function sanitizeHeaderValue(str) {
33508
- return trimSPorHTAB(str.replace(INVALID_HEADER_VALUE_CHARS_RE, ""));
33509
- }
33510
33974
  function normalizeValue(value) {
33511
33975
  if (value === false || value == null) {
33512
33976
  return value;
@@ -34199,7 +34663,7 @@ var require_axios = __commonJS({
34199
34663
  }
34200
34664
  return !isNumericKey;
34201
34665
  }
34202
- if (!target[name] || !utils$1.isObject(target[name])) {
34666
+ if (!utils$1.hasOwnProp(target, name) || !utils$1.isObject(target[name])) {
34203
34667
  target[name] = [];
34204
34668
  }
34205
34669
  const result = buildPath(path29, value, target[name], index);
@@ -34444,12 +34908,12 @@ var require_axios = __commonJS({
34444
34908
  function getEnv(key) {
34445
34909
  return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
34446
34910
  }
34447
- var VERSION = "1.16.0";
34911
+ var VERSION = "1.16.1";
34448
34912
  function parseProtocol(url3) {
34449
34913
  const match = /^([-+\w]{1,25}):(?:\/\/)?/.exec(url3);
34450
34914
  return match && match[1] || "";
34451
34915
  }
34452
- var DATA_URL_PATTERN = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
34916
+ var DATA_URL_PATTERN = /^([^,;]+\/[^,;]+)?((?:;[^,;=]+=[^,;]+)*)(;base64)?,([\s\S]*)$/;
34453
34917
  function fromDataURI(uri, asBlob, options) {
34454
34918
  const _Blob = options && options.Blob || platform2.classes.Blob;
34455
34919
  const protocol = parseProtocol(uri);
@@ -34462,10 +34926,17 @@ var require_axios = __commonJS({
34462
34926
  if (!match) {
34463
34927
  throw new AxiosError("Invalid URL", AxiosError.ERR_INVALID_URL);
34464
34928
  }
34465
- const mime = match[1];
34466
- const isBase64 = match[2];
34467
- const body = match[3];
34468
- const buffer = Buffer.from(decodeURIComponent(body), isBase64 ? "base64" : "utf8");
34929
+ const type = match[1];
34930
+ const params = match[2];
34931
+ const encoding = match[3] ? "base64" : "utf8";
34932
+ const body = match[4];
34933
+ let mime;
34934
+ if (type) {
34935
+ mime = params ? type + params : type;
34936
+ } else if (params) {
34937
+ mime = "text/plain" + params;
34938
+ }
34939
+ const buffer = Buffer.from(decodeURIComponent(body), encoding);
34469
34940
  if (asBlob) {
34470
34941
  if (!_Blob) {
34471
34942
  throw new AxiosError("Blob is not supported", AxiosError.ERR_NOT_SUPPORT);
@@ -34903,6 +35374,9 @@ var require_axios = __commonJS({
34903
35374
  let bytesNotified = 0;
34904
35375
  const _speedometer = speedometer(50, 250);
34905
35376
  return throttle((e) => {
35377
+ if (!e || typeof e.loaded !== "number") {
35378
+ return;
35379
+ }
34906
35380
  const rawLoaded = e.loaded;
34907
35381
  const total = e.lengthComputable ? e.total : void 0;
34908
35382
  const loaded = total != null ? Math.min(rawLoaded, total) : rawLoaded;
@@ -35031,6 +35505,23 @@ var require_axios = __commonJS({
35031
35505
  }
35032
35506
  var kAxiosSocketListener = /* @__PURE__ */ Symbol("axios.http.socketListener");
35033
35507
  var kAxiosCurrentReq = /* @__PURE__ */ Symbol("axios.http.currentReq");
35508
+ var kAxiosInstalledTunnel = /* @__PURE__ */ Symbol("axios.http.installedTunnel");
35509
+ var tunnelingAgentCache = /* @__PURE__ */ new Map();
35510
+ var tunnelingAgentCacheUser = /* @__PURE__ */ new WeakMap();
35511
+ function getTunnelingAgent(agentOptions, userHttpsAgent) {
35512
+ const key = agentOptions.protocol + "//" + agentOptions.hostname + ":" + (agentOptions.port || "") + "#" + (agentOptions.auth || "");
35513
+ const cache = userHttpsAgent ? tunnelingAgentCacheUser.get(userHttpsAgent) || tunnelingAgentCacheUser.set(userHttpsAgent, /* @__PURE__ */ new Map()).get(userHttpsAgent) : tunnelingAgentCache;
35514
+ let agent = cache.get(key);
35515
+ if (agent) return agent;
35516
+ const merged = userHttpsAgent && userHttpsAgent.options ? {
35517
+ ...userHttpsAgent.options,
35518
+ ...agentOptions
35519
+ } : agentOptions;
35520
+ agent = new HttpsProxyAgent(merged);
35521
+ agent[kAxiosInstalledTunnel] = true;
35522
+ cache.set(key, agent);
35523
+ return agent;
35524
+ }
35034
35525
  var supportedProtocols = platform2.protocols.map((protocol) => {
35035
35526
  return protocol + ":";
35036
35527
  });
@@ -35128,7 +35619,7 @@ var require_axios = __commonJS({
35128
35619
  options.beforeRedirects.config(options, responseDetails, requestDetails);
35129
35620
  }
35130
35621
  }
35131
- function setProxy(options, configProxy, location, isRedirect) {
35622
+ function setProxy(options, configProxy, location, isRedirect, configHttpsAgent) {
35132
35623
  let proxy = configProxy;
35133
35624
  if (!proxy && proxy !== false) {
35134
35625
  const proxyUrl = getProxyForUrl(location);
@@ -35145,6 +35636,9 @@ var require_axios = __commonJS({
35145
35636
  }
35146
35637
  }
35147
35638
  }
35639
+ if (isRedirect && options.agent && options.agent[kAxiosInstalledTunnel]) {
35640
+ options.agent = void 0;
35641
+ }
35148
35642
  if (proxy) {
35149
35643
  const isProxyURL = proxy instanceof URL;
35150
35644
  const readProxyField = (key) => isProxyURL || utils$1.hasOwnProp(proxy, key) ? proxy[key] : void 0;
@@ -35166,31 +35660,59 @@ var require_axios = __commonJS({
35166
35660
  proxy
35167
35661
  });
35168
35662
  }
35169
- const base643 = Buffer.from(proxyAuth, "utf8").toString("base64");
35170
- options.headers["Proxy-Authorization"] = "Basic " + base643;
35171
35663
  }
35172
- let hasUserHostHeader = false;
35173
- for (const name of Object.keys(options.headers)) {
35174
- if (name.toLowerCase() === "host") {
35175
- hasUserHostHeader = true;
35176
- break;
35664
+ const targetIsHttps = isHttps.test(options.protocol);
35665
+ if (targetIsHttps) {
35666
+ if (!(configHttpsAgent instanceof HttpsProxyAgent)) {
35667
+ const proxyHost = readProxyField("hostname") || readProxyField("host");
35668
+ const proxyPort = readProxyField("port");
35669
+ const rawProxyProtocol = readProxyField("protocol");
35670
+ const normalizedProtocol = rawProxyProtocol ? rawProxyProtocol.includes(":") ? rawProxyProtocol : `${rawProxyProtocol}:` : "http:";
35671
+ const proxyHostForURL = proxyHost && proxyHost.includes(":") && !proxyHost.startsWith("[") ? `[${proxyHost}]` : proxyHost;
35672
+ const proxyURL = new URL(`${normalizedProtocol}//${proxyHostForURL}${proxyPort ? ":" + proxyPort : ""}`);
35673
+ const agentOptions = {
35674
+ protocol: proxyURL.protocol,
35675
+ hostname: proxyURL.hostname.replace(/^\[|\]$/g, ""),
35676
+ port: proxyURL.port,
35677
+ auth: proxyAuth && typeof proxyAuth === "string" ? proxyAuth : void 0
35678
+ };
35679
+ if (proxyURL.protocol === "https:") {
35680
+ agentOptions.ALPNProtocols = ["http/1.1"];
35681
+ }
35682
+ const tunnelingAgent = getTunnelingAgent(agentOptions, configHttpsAgent);
35683
+ options.agent = tunnelingAgent;
35684
+ if (options.agents) {
35685
+ options.agents.https = tunnelingAgent;
35686
+ }
35687
+ }
35688
+ } else {
35689
+ if (proxyAuth) {
35690
+ const base643 = Buffer.from(proxyAuth, "utf8").toString("base64");
35691
+ options.headers["Proxy-Authorization"] = "Basic " + base643;
35692
+ }
35693
+ let hasUserHostHeader = false;
35694
+ for (const name of Object.keys(options.headers)) {
35695
+ if (name.toLowerCase() === "host") {
35696
+ hasUserHostHeader = true;
35697
+ break;
35698
+ }
35699
+ }
35700
+ if (!hasUserHostHeader) {
35701
+ options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
35702
+ }
35703
+ const proxyHost = readProxyField("hostname") || readProxyField("host");
35704
+ options.hostname = proxyHost;
35705
+ options.host = proxyHost;
35706
+ options.port = readProxyField("port");
35707
+ options.path = location;
35708
+ const proxyProtocol = readProxyField("protocol");
35709
+ if (proxyProtocol) {
35710
+ options.protocol = proxyProtocol.includes(":") ? proxyProtocol : `${proxyProtocol}:`;
35177
35711
  }
35178
- }
35179
- if (!hasUserHostHeader) {
35180
- options.headers.host = options.hostname + (options.port ? ":" + options.port : "");
35181
- }
35182
- const proxyHost = readProxyField("hostname") || readProxyField("host");
35183
- options.hostname = proxyHost;
35184
- options.host = proxyHost;
35185
- options.port = readProxyField("port");
35186
- options.path = location;
35187
- const proxyProtocol = readProxyField("protocol");
35188
- if (proxyProtocol) {
35189
- options.protocol = proxyProtocol.includes(":") ? proxyProtocol : `${proxyProtocol}:`;
35190
35712
  }
35191
35713
  }
35192
35714
  options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
35193
- setProxy(redirectOptions, configProxy, redirectOptions.href, true);
35715
+ setProxy(redirectOptions, configProxy, redirectOptions.href, true, configHttpsAgent);
35194
35716
  };
35195
35717
  }
35196
35718
  var isHttpAdapterSupported = typeof process !== "undefined" && utils$1.kindOf(process) === "process";
@@ -35495,7 +36017,7 @@ var require_axios = __commonJS({
35495
36017
  const options = Object.assign(/* @__PURE__ */ Object.create(null), {
35496
36018
  path: path$1,
35497
36019
  method,
35498
- headers: headers.toJSON(),
36020
+ headers: toByteStringHeaderObject(headers),
35499
36021
  agents: {
35500
36022
  http: config2.httpAgent,
35501
36023
  https: config2.httpsAgent
@@ -35524,12 +36046,14 @@ var require_axios = __commonJS({
35524
36046
  } else {
35525
36047
  options.hostname = parsed.hostname.startsWith("[") ? parsed.hostname.slice(1, -1) : parsed.hostname;
35526
36048
  options.port = parsed.port;
35527
- setProxy(options, config2.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path);
36049
+ setProxy(options, config2.proxy, protocol + "//" + parsed.hostname + (parsed.port ? ":" + parsed.port : "") + options.path, false, config2.httpsAgent);
35528
36050
  }
35529
36051
  let transport;
35530
36052
  let isNativeTransport = false;
35531
36053
  const isHttpsRequest = isHttps.test(options.protocol);
35532
- options.agent = isHttpsRequest ? config2.httpsAgent : config2.httpAgent;
36054
+ if (options.agent == null) {
36055
+ options.agent = isHttpsRequest ? config2.httpsAgent : config2.httpAgent;
36056
+ }
35533
36057
  if (isHttp2) {
35534
36058
  transport = http2Transport;
35535
36059
  } else {
@@ -36051,7 +36575,7 @@ var require_axios = __commonJS({
36051
36575
  };
36052
36576
  requestData === void 0 && requestHeaders.setContentType(null);
36053
36577
  if ("setRequestHeader" in request) {
36054
- utils$1.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
36578
+ utils$1.forEach(toByteStringHeaderObject(requestHeaders), function setRequestHeader(val, key) {
36055
36579
  request.setRequestHeader(key, val);
36056
36580
  });
36057
36581
  }
@@ -36094,41 +36618,41 @@ var require_axios = __commonJS({
36094
36618
  });
36095
36619
  };
36096
36620
  var composeSignals = (signals2, timeout) => {
36097
- const {
36098
- length
36099
- } = signals2 = signals2 ? signals2.filter(Boolean) : [];
36100
- if (timeout || length) {
36101
- let controller = new AbortController();
36102
- let aborted2;
36103
- const onabort = function(reason) {
36104
- if (!aborted2) {
36105
- aborted2 = true;
36106
- unsubscribe();
36107
- const err = reason instanceof Error ? reason : this.reason;
36108
- controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
36109
- }
36110
- };
36111
- let timer = timeout && setTimeout(() => {
36112
- timer = null;
36113
- onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
36114
- }, timeout);
36115
- const unsubscribe = () => {
36116
- if (signals2) {
36117
- timer && clearTimeout(timer);
36118
- timer = null;
36119
- signals2.forEach((signal2) => {
36120
- signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
36121
- });
36122
- signals2 = null;
36123
- }
36124
- };
36125
- signals2.forEach((signal2) => signal2.addEventListener("abort", onabort));
36126
- const {
36127
- signal
36128
- } = controller;
36129
- signal.unsubscribe = () => utils$1.asap(unsubscribe);
36130
- return signal;
36621
+ signals2 = signals2 ? signals2.filter(Boolean) : [];
36622
+ if (!timeout && !signals2.length) {
36623
+ return;
36131
36624
  }
36625
+ const controller = new AbortController();
36626
+ let aborted2 = false;
36627
+ const onabort = function(reason) {
36628
+ if (!aborted2) {
36629
+ aborted2 = true;
36630
+ unsubscribe();
36631
+ const err = reason instanceof Error ? reason : this.reason;
36632
+ controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));
36633
+ }
36634
+ };
36635
+ let timer = timeout && setTimeout(() => {
36636
+ timer = null;
36637
+ onabort(new AxiosError(`timeout of ${timeout}ms exceeded`, AxiosError.ETIMEDOUT));
36638
+ }, timeout);
36639
+ const unsubscribe = () => {
36640
+ if (!signals2) {
36641
+ return;
36642
+ }
36643
+ timer && clearTimeout(timer);
36644
+ timer = null;
36645
+ signals2.forEach((signal2) => {
36646
+ signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
36647
+ });
36648
+ signals2 = null;
36649
+ };
36650
+ signals2.forEach((signal2) => signal2.addEventListener("abort", onabort));
36651
+ const {
36652
+ signal
36653
+ } = controller;
36654
+ signal.unsubscribe = () => utils$1.asap(unsubscribe);
36655
+ return signal;
36132
36656
  };
36133
36657
  var streamChunk = function* (chunk, chunkSize) {
36134
36658
  let len = chunk.byteLength;
@@ -36223,8 +36747,7 @@ var require_axios = __commonJS({
36223
36747
  }
36224
36748
  };
36225
36749
  var factory = (env) => {
36226
- var _utils$global;
36227
- const globalObject = (_utils$global = utils$1.global) !== null && _utils$global !== void 0 ? _utils$global : globalThis;
36750
+ const globalObject = utils$1.global !== void 0 && utils$1.global !== null ? utils$1.global : globalThis;
36228
36751
  const {
36229
36752
  ReadableStream: ReadableStream2,
36230
36753
  TextEncoder: TextEncoder2
@@ -36377,7 +36900,7 @@ var require_axios = __commonJS({
36377
36900
  ...fetchOptions,
36378
36901
  signal: composedSignal,
36379
36902
  method: method.toUpperCase(),
36380
- headers: headers.normalize().toJSON(),
36903
+ headers: toByteStringHeaderObject(headers.normalize()),
36381
36904
  body: data,
36382
36905
  duplex: "half",
36383
36906
  credentials: isCredentialsSupported ? withCredentials : void 0
@@ -37369,7 +37892,7 @@ var require_priority_queue = __commonJS({
37369
37892
  });
37370
37893
 
37371
37894
  // node_modules/p-queue/dist/index.js
37372
- var require_dist3 = __commonJS({
37895
+ var require_dist4 = __commonJS({
37373
37896
  "node_modules/p-queue/dist/index.js"(exports2) {
37374
37897
  "use strict";
37375
37898
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -37991,6 +38514,7 @@ var require_file_upload = __commonJS({
37991
38514
  blocks: options.blocks,
37992
38515
  channel_id: (_a3 = options.channels) !== null && _a3 !== void 0 ? _a3 : options.channel_id,
37993
38516
  filename: (_b = options.filename) !== null && _b !== void 0 ? _b : fileName,
38517
+ highlight_type: options.highlight_type,
37994
38518
  initial_comment: options.initial_comment,
37995
38519
  snippet_type: options.snippet_type,
37996
38520
  title: (_d = (_c = options.title) !== null && _c !== void 0 ? _c : options.filename) !== null && _d !== void 0 ? _d : fileName,
@@ -38089,12 +38613,12 @@ var require_file_upload = __commonJS({
38089
38613
  function getAllFileUploadsToComplete(fileUploads) {
38090
38614
  const toComplete = {};
38091
38615
  for (const upload of fileUploads) {
38092
- const { blocks, channel_id, thread_ts, initial_comment, file_id, title } = upload;
38616
+ const { blocks, channel_id, thread_ts, highlight_type, initial_comment, file_id, title } = upload;
38093
38617
  if (file_id) {
38094
38618
  const compareString = `:::${channel_id}:::${thread_ts}:::${initial_comment}:::${JSON.stringify(blocks)}`;
38095
38619
  if (!Object.prototype.hasOwnProperty.call(toComplete, compareString)) {
38096
38620
  toComplete[compareString] = {
38097
- files: [{ id: file_id, title }],
38621
+ files: [{ id: file_id, title, highlight_type }],
38098
38622
  channel_id,
38099
38623
  blocks,
38100
38624
  initial_comment
@@ -38112,7 +38636,8 @@ var require_file_upload = __commonJS({
38112
38636
  } else {
38113
38637
  toComplete[compareString].files.push({
38114
38638
  id: file_id,
38115
- title
38639
+ title,
38640
+ highlight_type
38116
38641
  });
38117
38642
  }
38118
38643
  } else {
@@ -38749,7 +39274,7 @@ var require_views = __commonJS({
38749
39274
  });
38750
39275
 
38751
39276
  // node_modules/@slack/types/dist/index.js
38752
- var require_dist4 = __commonJS({
39277
+ var require_dist5 = __commonJS({
38753
39278
  "node_modules/@slack/types/dist/index.js"(exports2) {
38754
39279
  "use strict";
38755
39280
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m2, k2, k22) {
@@ -40414,7 +40939,7 @@ var require_methods = __commonJS({
40414
40939
  }
40415
40940
  };
40416
40941
  exports2.Methods = Methods;
40417
- __exportStar(require_dist4(), exports2);
40942
+ __exportStar(require_dist5(), exports2);
40418
40943
  }
40419
40944
  });
40420
40945
 
@@ -40547,7 +41072,7 @@ var require_WebClient = __commonJS({
40547
41072
  var form_data_1 = __importDefault(require_form_data());
40548
41073
  var is_electron_1 = __importDefault(require_is_electron());
40549
41074
  var is_stream_1 = __importDefault(require_is_stream());
40550
- var p_queue_1 = __importDefault(require_dist3());
41075
+ var p_queue_1 = __importDefault(require_dist4());
40551
41076
  var p_retry_1 = __importStar(require_p_retry());
40552
41077
  var chat_stream_1 = require_chat_stream();
40553
41078
  var errors_1 = require_errors2();
@@ -41148,7 +41673,7 @@ var require_WebClient = __commonJS({
41148
41673
  });
41149
41674
 
41150
41675
  // node_modules/@slack/web-api/dist/index.js
41151
- var require_dist5 = __commonJS({
41676
+ var require_dist6 = __commonJS({
41152
41677
  "node_modules/@slack/web-api/dist/index.js"(exports2) {
41153
41678
  "use strict";
41154
41679
  var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m2, k2, k22) {
@@ -41218,7 +41743,7 @@ var import_web_api, SlackWebApiClient;
41218
41743
  var init_local_runtime2 = __esm({
41219
41744
  "packages/slack-primitive/src/local-runtime.ts"() {
41220
41745
  "use strict";
41221
- import_web_api = __toESM(require_dist5(), 1);
41746
+ import_web_api = __toESM(require_dist6(), 1);
41222
41747
  init_adapter2();
41223
41748
  init_types2();
41224
41749
  SlackWebApiClient = class extends BaseSlackAdapter {
@@ -43070,6 +43595,7 @@ __export(index_exports, {
43070
43595
  findGitRoot: () => findGitRoot,
43071
43596
  findLocalSdkWorkspace: () => findLocalSdkWorkspace,
43072
43597
  findPersona: () => findPersona,
43598
+ findPrUrl: () => findPrUrl,
43073
43599
  findRelayPtyBinary: () => findRelayPtyBinary,
43074
43600
  followLogs: () => followLogs,
43075
43601
  formatDryRunReport: () => formatDryRunReport,
@@ -49602,8 +50128,8 @@ var jsonSchemas = {
49602
50128
  var CLIVersions = {
49603
50129
  /** Claude Code v2.1.72 */
49604
50130
  CLAUDE: "2.1.72",
49605
- /** Codex CLI v0.124.0 */
49606
- CODEX: "0.124.0",
50131
+ /** Codex CLI v0.130.0 */
50132
+ CODEX: "0.130.0",
49607
50133
  /** Gemini CLI v0.39.1 */
49608
50134
  GEMINI: "0.39.1",
49609
50135
  /** Cursor v2026.02.27-e7d2ef6 */
@@ -49636,7 +50162,9 @@ var ClaudeModels = {
49636
50162
  HAIKU: "haiku"
49637
50163
  };
49638
50164
  var CodexModels = {
49639
- /** GPT-5.4 — Frontier model for complex coding, research, and real-world work. (default) */
50165
+ /** GPT-5.5 — Frontier model for complex coding, research, and real-world work. (default) */
50166
+ GPT_5_5: "gpt-5.5",
50167
+ /** GPT-5.4 — More affordable model for complex coding and professional work. */
49640
50168
  GPT_5_4: "gpt-5.4",
49641
50169
  /** GPT-5.3 Codex — Frontier agentic coding model */
49642
50170
  GPT_5_3_CODEX: "gpt-5.3-codex",
@@ -49940,6 +50468,8 @@ var OpencodeModels = {
49940
50468
  OPENAI_GPT_5_4: "openai/gpt-5.4",
49941
50469
  /** GPT-5.4 Pro */
49942
50470
  OPENAI_GPT_5_4_PRO: "openai/gpt-5.4-pro",
50471
+ /** GPT-5.5 */
50472
+ OPENAI_GPT_5_5: "openai/gpt-5.5",
49943
50473
  /** O1 */
49944
50474
  OPENAI_O1: "openai/o1",
49945
50475
  /** O1 Mini */
@@ -49973,7 +50503,8 @@ var CLAUDE_MODEL_OPTIONS = [
49973
50503
  { value: "haiku", label: "Haiku" }
49974
50504
  ];
49975
50505
  var CODEX_MODEL_OPTIONS = [
49976
- { value: "gpt-5.4", label: "GPT-5.4 \u2014 Frontier model for complex coding, research, and real-world work.", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
50506
+ { value: "gpt-5.5", label: "GPT-5.5 \u2014 Frontier model for complex coding, research, and real-world work.", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "medium" },
50507
+ { value: "gpt-5.4", label: "GPT-5.4 \u2014 More affordable model for complex coding and professional work.", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
49977
50508
  { value: "gpt-5.3-codex", label: "GPT-5.3 Codex \u2014 Frontier agentic coding model", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
49978
50509
  { value: "gpt-5.3-codex-spark", label: "GPT-5.3 Codex Spark \u2014 Ultra-fast coding model", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
49979
50510
  { value: "gpt-5.2-codex", label: "GPT-5.2 Codex \u2014 Frontier agentic coding model", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
@@ -50129,6 +50660,7 @@ var OPENCODE_MODEL_OPTIONS = [
50129
50660
  { value: "openai/gpt-5.3-codex-spark", label: "GPT-5.3 Codex Spark" },
50130
50661
  { value: "openai/gpt-5.4", label: "GPT-5.4" },
50131
50662
  { value: "openai/gpt-5.4-pro", label: "GPT-5.4 Pro" },
50663
+ { value: "openai/gpt-5.5", label: "GPT-5.5" },
50132
50664
  { value: "openai/o1", label: "O1" },
50133
50665
  { value: "openai/o1-mini", label: "O1 Mini" },
50134
50666
  { value: "openai/o1-preview", label: "O1 Preview" },
@@ -50146,7 +50678,8 @@ var CLAUDE_MODEL_METADATA = {
50146
50678
  "haiku": { value: "haiku", label: "Haiku" }
50147
50679
  };
50148
50680
  var CODEX_MODEL_METADATA = {
50149
- "gpt-5.4": { value: "gpt-5.4", label: "GPT-5.4 \u2014 Frontier model for complex coding, research, and real-world work.", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
50681
+ "gpt-5.5": { value: "gpt-5.5", label: "GPT-5.5 \u2014 Frontier model for complex coding, research, and real-world work.", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "medium" },
50682
+ "gpt-5.4": { value: "gpt-5.4", label: "GPT-5.4 \u2014 More affordable model for complex coding and professional work.", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
50150
50683
  "gpt-5.3-codex": { value: "gpt-5.3-codex", label: "GPT-5.3 Codex \u2014 Frontier agentic coding model", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
50151
50684
  "gpt-5.3-codex-spark": { value: "gpt-5.3-codex-spark", label: "GPT-5.3 Codex Spark \u2014 Ultra-fast coding model", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
50152
50685
  "gpt-5.2-codex": { value: "gpt-5.2-codex", label: "GPT-5.2 Codex \u2014 Frontier agentic coding model", reasoningEfforts: ["low", "medium", "high", "xhigh"], defaultReasoningEffort: "xhigh" },
@@ -50302,6 +50835,7 @@ var OPENCODE_MODEL_METADATA = {
50302
50835
  "openai/gpt-5.3-codex-spark": { value: "openai/gpt-5.3-codex-spark", label: "GPT-5.3 Codex Spark" },
50303
50836
  "openai/gpt-5.4": { value: "openai/gpt-5.4", label: "GPT-5.4" },
50304
50837
  "openai/gpt-5.4-pro": { value: "openai/gpt-5.4-pro", label: "GPT-5.4 Pro" },
50838
+ "openai/gpt-5.5": { value: "openai/gpt-5.5", label: "GPT-5.5" },
50305
50839
  "openai/o1": { value: "openai/o1", label: "O1" },
50306
50840
  "openai/o1-mini": { value: "openai/o1-mini", label: "O1 Mini" },
50307
50841
  "openai/o1-preview": { value: "openai/o1-preview", label: "O1 Preview" },
@@ -50389,7 +50923,7 @@ var CLIRegistry = {
50389
50923
  codex: {
50390
50924
  name: "Codex CLI",
50391
50925
  package: "@openai/codex",
50392
- version: "0.124.0",
50926
+ version: "0.130.0",
50393
50927
  install: "npm install -g @openai/codex",
50394
50928
  npmLink: "https://www.npmjs.com/package/@openai/codex"
50395
50929
  },
@@ -50438,7 +50972,7 @@ var CLIRegistry = {
50438
50972
  };
50439
50973
  var DefaultModels = {
50440
50974
  claude: "sonnet",
50441
- codex: "gpt-5.4",
50975
+ codex: "gpt-5.5",
50442
50976
  gemini: "gemini-3.1-pro-preview",
50443
50977
  cursor: "composer-2-fast",
50444
50978
  droid: "opus-4.6-fast",
@@ -50446,7 +50980,7 @@ var DefaultModels = {
50446
50980
  };
50447
50981
 
50448
50982
  // node_modules/@relaycast/sdk/dist/version.js
50449
- var SDK_VERSION = "1.1.5";
50983
+ var SDK_VERSION = "1.1.7";
50450
50984
 
50451
50985
  // node_modules/@relaycast/sdk/node_modules/zod/v4/classic/external.js
50452
50986
  var external_exports2 = {};
@@ -65436,6 +65970,7 @@ var ChannelMessagePayloadSchema = CoreMessagePayloadSchema.extend({
65436
65970
  attachments: external_exports2.array(FileAttachmentSchema)
65437
65971
  });
65438
65972
  var MessageCreatedEventSchema = external_exports2.object({
65973
+ id: external_exports2.string().uuid(),
65439
65974
  type: external_exports2.literal("message.created"),
65440
65975
  channel: external_exports2.string(),
65441
65976
  message: ChannelMessagePayloadSchema
@@ -65446,6 +65981,7 @@ var MessageUpdatedEventSchema = external_exports2.object({
65446
65981
  message: CoreMessagePayloadSchema
65447
65982
  });
65448
65983
  var ThreadReplyEventSchema = external_exports2.object({
65984
+ id: external_exports2.string().uuid(),
65449
65985
  type: external_exports2.literal("thread.reply"),
65450
65986
  channel: external_exports2.string(),
65451
65987
  parent_id: external_exports2.string(),
@@ -65464,11 +66000,13 @@ var ReactionRemovedEventSchema = external_exports2.object({
65464
66000
  agent_name: external_exports2.string()
65465
66001
  });
65466
66002
  var DmReceivedEventSchema = external_exports2.object({
66003
+ id: external_exports2.string().uuid(),
65467
66004
  type: external_exports2.literal("dm.received"),
65468
66005
  conversation_id: external_exports2.string(),
65469
66006
  message: CoreMessagePayloadSchema
65470
66007
  });
65471
66008
  var GroupDmReceivedEventSchema = external_exports2.object({
66009
+ id: external_exports2.string().uuid(),
65472
66010
  type: external_exports2.literal("group_dm.received"),
65473
66011
  conversation_id: external_exports2.string(),
65474
66012
  message: CoreMessagePayloadSchema
@@ -65599,6 +66137,12 @@ var ServerEventSchema = external_exports2.discriminatedUnion("type", [
65599
66137
  CommandInvokedEventSchema,
65600
66138
  PongEventSchema
65601
66139
  ]);
66140
+ var RelaycastMessageEventSchema = external_exports2.discriminatedUnion("type", [
66141
+ MessageCreatedEventSchema,
66142
+ ThreadReplyEventSchema,
66143
+ DmReceivedEventSchema,
66144
+ GroupDmReceivedEventSchema
66145
+ ]);
65602
66146
  var WsClientEventSchema = external_exports2.discriminatedUnion("type", [
65603
66147
  // Server events
65604
66148
  MessageCreatedEventSchema,
@@ -66147,6 +66691,9 @@ var WsClient = class {
66147
66691
  off(event, handler) {
66148
66692
  this.handlers.get(event)?.delete(handler);
66149
66693
  }
66694
+ get connected() {
66695
+ return this.isOpen;
66696
+ }
66150
66697
  emit(event, data) {
66151
66698
  this.handlers.get(event)?.forEach((h) => h(data));
66152
66699
  this.handlers.get("*")?.forEach((h) => h(data));
@@ -66213,6 +66760,55 @@ var WsClient = class {
66213
66760
  }
66214
66761
  };
66215
66762
 
66763
+ // node_modules/@relaycast/sdk/dist/event-id.js
66764
+ function hashStringParts(parts) {
66765
+ const input = JSON.stringify(parts);
66766
+ let h1 = 3735928559;
66767
+ let h2 = 1103547991;
66768
+ let h3 = 3235826430;
66769
+ let h4 = 2654435769;
66770
+ for (let i = 0; i < input.length; i += 1) {
66771
+ const code = input.charCodeAt(i);
66772
+ h1 = Math.imul(h1 ^ code, 2654435761);
66773
+ h2 = Math.imul(h2 ^ code, 1597334677);
66774
+ h3 = Math.imul(h3 ^ code, 2246822507);
66775
+ h4 = Math.imul(h4 ^ code, 3266489909);
66776
+ }
66777
+ h1 = Math.imul(h1 ^ h1 >>> 16, 2246822507) ^ Math.imul(h2 ^ h2 >>> 13, 3266489909);
66778
+ h2 = Math.imul(h2 ^ h2 >>> 16, 2246822507) ^ Math.imul(h3 ^ h3 >>> 13, 3266489909);
66779
+ h3 = Math.imul(h3 ^ h3 >>> 16, 2246822507) ^ Math.imul(h4 ^ h4 >>> 13, 3266489909);
66780
+ h4 = Math.imul(h4 ^ h4 >>> 16, 2246822507) ^ Math.imul(h1 ^ h1 >>> 13, 3266489909);
66781
+ return [h1 >>> 0, h2 >>> 0, h3 >>> 0, h4 >>> 0];
66782
+ }
66783
+ function formatUuidFromWords(words) {
66784
+ const bytes = new Uint8Array(16);
66785
+ for (let i = 0; i < words.length; i += 1) {
66786
+ const word = words[i];
66787
+ const offset = i * 4;
66788
+ bytes[offset] = word >>> 24 & 255;
66789
+ bytes[offset + 1] = word >>> 16 & 255;
66790
+ bytes[offset + 2] = word >>> 8 & 255;
66791
+ bytes[offset + 3] = word & 255;
66792
+ }
66793
+ bytes[6] = bytes[6] & 15 | 80;
66794
+ bytes[8] = bytes[8] & 63 | 128;
66795
+ const hex3 = [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
66796
+ return [
66797
+ hex3.slice(0, 8),
66798
+ hex3.slice(8, 12),
66799
+ hex3.slice(12, 16),
66800
+ hex3.slice(16, 20),
66801
+ hex3.slice(20, 32)
66802
+ ].join("-");
66803
+ }
66804
+ function stableRelaycastEventId(...parts) {
66805
+ const normalized = parts.map((part) => part?.trim()).filter((part) => typeof part === "string" && part.length > 0);
66806
+ if (normalized.length === 0) {
66807
+ return formatUuidFromWords(hashStringParts(["relaycast", "empty-event"]));
66808
+ }
66809
+ return formatUuidFromWords(hashStringParts(["relaycast", ...normalized]));
66810
+ }
66811
+
66216
66812
  // node_modules/@relaycast/sdk/dist/agent.js
66217
66813
  function stripHash(channel) {
66218
66814
  return channel.startsWith("#") ? channel.slice(1) : channel;
@@ -66241,6 +66837,21 @@ function idempotencyHeaders(opts) {
66241
66837
  }
66242
66838
  };
66243
66839
  }
66840
+ function normalizeSubscriptionChannel(channel) {
66841
+ const trimmed = channel.trim();
66842
+ if (trimmed === "@self")
66843
+ return trimmed;
66844
+ return stripHash(trimmed);
66845
+ }
66846
+ function ensureRelaycastMessageEventId(event) {
66847
+ if (typeof event.id === "string" && event.id.length > 0) {
66848
+ return event;
66849
+ }
66850
+ return {
66851
+ ...event,
66852
+ id: stableRelaycastEventId(event.message.id)
66853
+ };
66854
+ }
66244
66855
  var AgentClient = class {
66245
66856
  client;
66246
66857
  ws = null;
@@ -66248,6 +66859,9 @@ var AgentClient = class {
66248
66859
  autoHeartbeatTimer = null;
66249
66860
  pendingHeartbeat = null;
66250
66861
  wsOptions;
66862
+ manualSubscriptions = /* @__PURE__ */ new Set();
66863
+ managedSubscriptions = /* @__PURE__ */ new Map();
66864
+ activeWsChannels = /* @__PURE__ */ new Set();
66251
66865
  constructor(client, options = {}) {
66252
66866
  this.client = client;
66253
66867
  this.autoHeartbeatMs = normalizeAutoHeartbeatMs(options.autoHeartbeatMs);
@@ -66305,12 +66919,15 @@ var AgentClient = class {
66305
66919
  void this.presence.markOnline().catch(() => {
66306
66920
  });
66307
66921
  this.startAutoHeartbeat();
66922
+ this.syncDesiredSubscriptions({ resetRemoteState: true });
66308
66923
  });
66309
66924
  this.ws.on("close", () => {
66310
66925
  this.stopAutoHeartbeat();
66926
+ this.activeWsChannels.clear();
66311
66927
  });
66312
66928
  this.ws.on("permanently_disconnected", () => {
66313
66929
  this.stopAutoHeartbeat();
66930
+ this.activeWsChannels.clear();
66314
66931
  });
66315
66932
  this.ws.connect();
66316
66933
  }
@@ -66324,18 +66941,80 @@ var AgentClient = class {
66324
66941
  await this.pendingHeartbeat;
66325
66942
  this.pendingHeartbeat = null;
66326
66943
  }
66944
+ for (const subscription of this.managedSubscriptions.values()) {
66945
+ for (const stop of subscription.stops) {
66946
+ stop();
66947
+ }
66948
+ }
66949
+ this.managedSubscriptions.clear();
66950
+ this.manualSubscriptions.clear();
66327
66951
  if (this.ws) {
66328
66952
  this.ws.disconnect();
66329
66953
  this.ws = null;
66330
66954
  }
66955
+ this.activeWsChannels.clear();
66331
66956
  await this.client.post("/v1/agents/disconnect", {}).catch(() => {
66332
66957
  });
66333
66958
  }
66334
- subscribe(channels) {
66335
- this.ws?.subscribe(channels);
66959
+ subscribe(channels, onMessage) {
66960
+ const normalized = [...new Set(channels.map(normalizeSubscriptionChannel).filter(Boolean))];
66961
+ if (normalized.length === 0) {
66962
+ if (onMessage) {
66963
+ return { channels: [], unsubscribe() {
66964
+ } };
66965
+ }
66966
+ return;
66967
+ }
66968
+ if (!onMessage) {
66969
+ for (const channel of normalized) {
66970
+ this.manualSubscriptions.add(channel);
66971
+ }
66972
+ this.syncDesiredSubscriptions();
66973
+ return;
66974
+ }
66975
+ this.connect();
66976
+ const key = /* @__PURE__ */ Symbol("relaycast.subscription");
66977
+ const channelSet = new Set(normalized);
66978
+ const invoke = (event) => {
66979
+ if (!this.matchesSubscription(channelSet, event)) {
66980
+ return;
66981
+ }
66982
+ void Promise.resolve().then(() => onMessage(ensureRelaycastMessageEventId(event))).catch((err) => {
66983
+ console.error("[relaycast] Subscription handler failed", err);
66984
+ });
66985
+ };
66986
+ const stops = [
66987
+ this.on.messageCreated((event) => invoke(event)),
66988
+ this.on.threadReply((event) => invoke(event)),
66989
+ this.on.dmReceived((event) => invoke(event)),
66990
+ this.on.groupDmReceived((event) => invoke(event))
66991
+ ];
66992
+ this.managedSubscriptions.set(key, {
66993
+ channels: channelSet,
66994
+ handler: onMessage,
66995
+ stops
66996
+ });
66997
+ this.syncDesiredSubscriptions();
66998
+ return {
66999
+ channels: Object.freeze([...normalized]),
67000
+ unsubscribe: () => {
67001
+ const current = this.managedSubscriptions.get(key);
67002
+ if (!current)
67003
+ return;
67004
+ this.managedSubscriptions.delete(key);
67005
+ for (const stop of current.stops) {
67006
+ stop();
67007
+ }
67008
+ this.syncDesiredSubscriptions();
67009
+ }
67010
+ };
66336
67011
  }
66337
67012
  unsubscribe(channels) {
66338
- this.ws?.unsubscribe(channels);
67013
+ const normalized = [...new Set(channels.map(normalizeSubscriptionChannel).filter(Boolean))];
67014
+ for (const channel of normalized) {
67015
+ this.manualSubscriptions.delete(channel);
67016
+ }
67017
+ this.syncDesiredSubscriptions();
66339
67018
  }
66340
67019
  onEvent(eventType, handler) {
66341
67020
  if (!this.ws) {
@@ -66399,6 +67078,9 @@ var AgentClient = class {
66399
67078
  };
66400
67079
  return this.client.post(`/v1/channels/${encodeURIComponent(name)}/messages`, body, idempotencyHeaders(opts));
66401
67080
  }
67081
+ post(channel, text, opts) {
67082
+ return this.send(channel, text, opts);
67083
+ }
66402
67084
  async messages(channel, opts) {
66403
67085
  const name = stripHash(channel);
66404
67086
  const query = {};
@@ -66461,6 +67143,58 @@ var AgentClient = class {
66461
67143
  addParticipant: (conversationId, agent) => this.client.post(`/v1/dm/${encodeURIComponent(conversationId)}/participants`, { agentName: agent }),
66462
67144
  removeParticipant: (conversationId, agent) => this.client.delete(`/v1/dm/${encodeURIComponent(conversationId)}/participants/${encodeURIComponent(agent)}`)
66463
67145
  };
67146
+ matchesSubscription(channels, event) {
67147
+ switch (event.type) {
67148
+ case "dm.received":
67149
+ case "group_dm.received":
67150
+ return channels.has("@self");
67151
+ case "message.created":
67152
+ case "thread.reply":
67153
+ return channels.has(stripHash(event.channel));
67154
+ default:
67155
+ return false;
67156
+ }
67157
+ }
67158
+ desiredWsChannels() {
67159
+ const desired = /* @__PURE__ */ new Set();
67160
+ for (const channel of this.manualSubscriptions) {
67161
+ if (channel !== "@self") {
67162
+ desired.add(channel);
67163
+ }
67164
+ }
67165
+ for (const subscription of this.managedSubscriptions.values()) {
67166
+ for (const channel of subscription.channels) {
67167
+ if (channel !== "@self") {
67168
+ desired.add(channel);
67169
+ }
67170
+ }
67171
+ }
67172
+ return desired;
67173
+ }
67174
+ syncDesiredSubscriptions(options = {}) {
67175
+ if (!this.ws) {
67176
+ return;
67177
+ }
67178
+ const desired = this.desiredWsChannels();
67179
+ if (!this.ws.connected) {
67180
+ if (options.resetRemoteState) {
67181
+ this.activeWsChannels.clear();
67182
+ }
67183
+ return;
67184
+ }
67185
+ if (options.resetRemoteState) {
67186
+ this.activeWsChannels.clear();
67187
+ }
67188
+ const toSubscribe = [...desired].filter((channel) => !this.activeWsChannels.has(channel));
67189
+ const toUnsubscribe = [...this.activeWsChannels].filter((channel) => !desired.has(channel));
67190
+ if (toSubscribe.length > 0) {
67191
+ this.ws.subscribe(toSubscribe);
67192
+ }
67193
+ if (toUnsubscribe.length > 0) {
67194
+ this.ws.unsubscribe(toUnsubscribe);
67195
+ }
67196
+ this.activeWsChannels = desired;
67197
+ }
66464
67198
  // === Channels ===
66465
67199
  channels = {
66466
67200
  create: (data) => this.client.post("/v1/channels", data),
@@ -66557,6 +67291,10 @@ var RAW_CODE_MAP = {
66557
67291
  agent_already_exists: "name_conflict",
66558
67292
  not_found: "not_found",
66559
67293
  agent_not_found: "not_found",
67294
+ rate_limit_exceeded: "rate_limited",
67295
+ backpressure: "backpressure",
67296
+ queue_overloaded: "backpressure",
67297
+ workspace_stream_backpressure: "backpressure",
66560
67298
  unauthorized: "unauthorized",
66561
67299
  workspace_mismatch: "workspace_mismatch",
66562
67300
  workspace_not_found: "workspace_mismatch"
@@ -66572,12 +67310,18 @@ function normalizeRelayErrorCode(rawCode, statusCode) {
66572
67310
  if (statusCode === 404) {
66573
67311
  return "not_found";
66574
67312
  }
67313
+ if (statusCode === 429) {
67314
+ return "rate_limited";
67315
+ }
66575
67316
  if (statusCode === 409) {
66576
67317
  return "name_conflict";
66577
67318
  }
66578
67319
  return "transport_error";
66579
67320
  }
66580
67321
  function relayErrorRetryable(code, statusCode) {
67322
+ if (code === "rate_limited" || code === "backpressure") {
67323
+ return true;
67324
+ }
66581
67325
  if (code !== "transport_error") {
66582
67326
  return false;
66583
67327
  }
@@ -78611,6 +79355,14 @@ function runVerification(check2, output, stepName, injectedTaskText, options = {
78611
79355
  }
78612
79356
  break;
78613
79357
  }
79358
+ case "pr_url": {
79359
+ const found = findPrUrl(output, check2.value, injectedTaskText);
79360
+ if (!found) {
79361
+ const repoQualifier = check2.value ? ` for repository "${check2.value}"` : "";
79362
+ return fail(`Verification failed for "${stepName}": step output does not contain a GitHub PR URL${repoQualifier}. Workers must open a pull request and include the URL in their output before reporting completion.`);
79363
+ }
79364
+ break;
79365
+ }
78614
79366
  default:
78615
79367
  break;
78616
79368
  }
@@ -78663,6 +79415,24 @@ function checkOutputContains(output, token, injectedTaskText) {
78663
79415
  }
78664
79416
  return stripInjectedTaskEcho(output, injectedTaskText).includes(token);
78665
79417
  }
79418
+ var PR_URL_PATTERN = /https?:\/\/github\.com\/([\w.-]+)\/([\w.-]+)\/pull\/(\d+)\b/gi;
79419
+ function findPrUrl(output, repoQualifier, injectedTaskText) {
79420
+ const sanitized = stripInjectedTaskEcho(output, injectedTaskText);
79421
+ const qualifier = repoQualifier?.trim().toLowerCase();
79422
+ PR_URL_PATTERN.lastIndex = 0;
79423
+ let match;
79424
+ while (match = PR_URL_PATTERN.exec(sanitized)) {
79425
+ if (!qualifier) {
79426
+ return match[0];
79427
+ }
79428
+ const owner = match[1]?.toLowerCase();
79429
+ const repo = match[2]?.toLowerCase();
79430
+ if (`${owner}/${repo}` === qualifier) {
79431
+ return match[0];
79432
+ }
79433
+ }
79434
+ return null;
79435
+ }
78666
79436
  var DEFAULT_CUSTOM_VERIFY_TIMEOUT_MS = parseInt(process.env.CUSTOM_VERIFY_TIMEOUT_MS ?? "30000", 10);
78667
79437
  var REGEX_PREFIX = "regex:";
78668
79438
  function execCustomVerification(command, cwd, timeoutMs = DEFAULT_CUSTOM_VERIFY_TIMEOUT_MS) {
@@ -93531,6 +94301,7 @@ init_dist2();
93531
94301
  findGitRoot,
93532
94302
  findLocalSdkWorkspace,
93533
94303
  findPersona,
94304
+ findPrUrl,
93534
94305
  findRelayPtyBinary,
93535
94306
  followLogs,
93536
94307
  formatDryRunReport,
@@ -93666,5 +94437,5 @@ mime-types/index.js:
93666
94437
  *)
93667
94438
 
93668
94439
  axios/dist/node/axios.cjs:
93669
- (*! Axios v1.16.0 Copyright (c) 2026 Matt Zabriskie and contributors *)
94440
+ (*! Axios v1.16.1 Copyright (c) 2026 Matt Zabriskie and contributors *)
93670
94441
  */