switchroom 0.15.36 → 0.15.37
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/agent-scheduler/index.js +81 -80
- package/dist/auth-broker/index.js +80 -80
- package/dist/cli/drive-write-pretool.mjs +10 -10
- package/dist/cli/notion-write-pretool.mjs +82 -82
- package/dist/cli/skill-validate-pretool.mjs +72 -72
- package/dist/cli/switchroom.js +371 -357
- package/dist/host-control/main.js +148 -148
- package/dist/vault/approvals/kernel-server.js +82 -82
- package/dist/vault/broker/server.js +83 -83
- package/package.json +1 -1
- package/profiles/_shared/agent-self-service.md.hbs +25 -0
- package/telegram-plugin/bridge/bridge.ts +32 -0
- package/telegram-plugin/dist/bridge/bridge.js +143 -112
- package/telegram-plugin/dist/gateway/gateway.js +813 -378
- package/telegram-plugin/dist/server.js +191 -160
- package/telegram-plugin/gateway/gateway.ts +121 -3
- package/telegram-plugin/gateway/linear-activity.ts +56 -0
- package/telegram-plugin/gateway/linear-auth-watch.ts +102 -0
- package/telegram-plugin/gateway/linear-setup.ts +196 -0
- package/telegram-plugin/tests/linear-agent-activity.test.ts +77 -0
- package/telegram-plugin/tests/linear-agent-setup.test.ts +132 -0
- package/telegram-plugin/tests/linear-auth-watch.test.ts +79 -0
- package/telegram-plugin/tests/linear-create-issue.test.ts +3 -1
|
@@ -66,7 +66,7 @@ var __export = (target, all) => {
|
|
|
66
66
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
67
67
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
68
68
|
|
|
69
|
-
//
|
|
69
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/filter.js
|
|
70
70
|
var require_filter = __commonJS((exports) => {
|
|
71
71
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
72
72
|
exports.matchFilter = matchFilter;
|
|
@@ -430,7 +430,7 @@ var require_filter = __commonJS((exports) => {
|
|
|
430
430
|
};
|
|
431
431
|
});
|
|
432
432
|
|
|
433
|
-
//
|
|
433
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/context.js
|
|
434
434
|
var require_context = __commonJS((exports) => {
|
|
435
435
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
436
436
|
exports.Context = undefined;
|
|
@@ -1457,7 +1457,7 @@ var require_context = __commonJS((exports) => {
|
|
|
1457
1457
|
}
|
|
1458
1458
|
});
|
|
1459
1459
|
|
|
1460
|
-
//
|
|
1460
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/composer.js
|
|
1461
1461
|
var require_composer = __commonJS((exports) => {
|
|
1462
1462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1463
1463
|
exports.Composer = exports.BotError = undefined;
|
|
@@ -1619,7 +1619,7 @@ var require_composer = __commonJS((exports) => {
|
|
|
1619
1619
|
exports.Composer = Composer;
|
|
1620
1620
|
});
|
|
1621
1621
|
|
|
1622
|
-
//
|
|
1622
|
+
// ../../switchroom-sec-1417/node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
|
|
1623
1623
|
var require_ms = __commonJS((exports, module) => {
|
|
1624
1624
|
var s = 1000;
|
|
1625
1625
|
var m = s * 60;
|
|
@@ -1729,7 +1729,7 @@ var require_ms = __commonJS((exports, module) => {
|
|
|
1729
1729
|
}
|
|
1730
1730
|
});
|
|
1731
1731
|
|
|
1732
|
-
//
|
|
1732
|
+
// ../../switchroom-sec-1417/node_modules/.bun/debug@4.4.3/node_modules/debug/src/common.js
|
|
1733
1733
|
var require_common = __commonJS((exports, module) => {
|
|
1734
1734
|
function setup(env) {
|
|
1735
1735
|
createDebug.debug = createDebug;
|
|
@@ -1904,7 +1904,7 @@ var require_common = __commonJS((exports, module) => {
|
|
|
1904
1904
|
module.exports = setup;
|
|
1905
1905
|
});
|
|
1906
1906
|
|
|
1907
|
-
//
|
|
1907
|
+
// ../../switchroom-sec-1417/node_modules/.bun/debug@4.4.3/node_modules/debug/src/browser.js
|
|
1908
1908
|
var require_browser = __commonJS((exports, module) => {
|
|
1909
1909
|
exports.formatArgs = formatArgs;
|
|
1910
1910
|
exports.save = save;
|
|
@@ -2064,7 +2064,7 @@ var require_browser = __commonJS((exports, module) => {
|
|
|
2064
2064
|
};
|
|
2065
2065
|
});
|
|
2066
2066
|
|
|
2067
|
-
//
|
|
2067
|
+
// ../../switchroom-sec-1417/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js
|
|
2068
2068
|
var require_has_flag = __commonJS((exports, module) => {
|
|
2069
2069
|
module.exports = (flag, argv = process.argv) => {
|
|
2070
2070
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -2074,7 +2074,7 @@ var require_has_flag = __commonJS((exports, module) => {
|
|
|
2074
2074
|
};
|
|
2075
2075
|
});
|
|
2076
2076
|
|
|
2077
|
-
//
|
|
2077
|
+
// ../../switchroom-sec-1417/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js
|
|
2078
2078
|
var require_supports_color = __commonJS((exports, module) => {
|
|
2079
2079
|
var os = __require("os");
|
|
2080
2080
|
var tty = __require("tty");
|
|
@@ -2173,7 +2173,7 @@ var require_supports_color = __commonJS((exports, module) => {
|
|
|
2173
2173
|
};
|
|
2174
2174
|
});
|
|
2175
2175
|
|
|
2176
|
-
//
|
|
2176
|
+
// ../../switchroom-sec-1417/node_modules/.bun/debug@4.4.3/node_modules/debug/src/node.js
|
|
2177
2177
|
var require_node = __commonJS((exports, module) => {
|
|
2178
2178
|
var tty = __require("tty");
|
|
2179
2179
|
var util = __require("util");
|
|
@@ -2344,7 +2344,7 @@ var require_node = __commonJS((exports, module) => {
|
|
|
2344
2344
|
};
|
|
2345
2345
|
});
|
|
2346
2346
|
|
|
2347
|
-
//
|
|
2347
|
+
// ../../switchroom-sec-1417/node_modules/.bun/debug@4.4.3/node_modules/debug/src/index.js
|
|
2348
2348
|
var require_src = __commonJS((exports, module) => {
|
|
2349
2349
|
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
2350
2350
|
module.exports = require_browser();
|
|
@@ -2353,7 +2353,7 @@ var require_src = __commonJS((exports, module) => {
|
|
|
2353
2353
|
}
|
|
2354
2354
|
});
|
|
2355
2355
|
|
|
2356
|
-
//
|
|
2356
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/platform.node.js
|
|
2357
2357
|
var require_platform_node = __commonJS((exports) => {
|
|
2358
2358
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2359
2359
|
exports.defaultAdapter = exports.itrToStream = exports.debug = undefined;
|
|
@@ -2393,7 +2393,7 @@ var require_platform_node = __commonJS((exports) => {
|
|
|
2393
2393
|
exports.defaultAdapter = "express";
|
|
2394
2394
|
});
|
|
2395
2395
|
|
|
2396
|
-
//
|
|
2396
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/error.js
|
|
2397
2397
|
var require_error = __commonJS((exports) => {
|
|
2398
2398
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2399
2399
|
exports.HttpError = exports.GrammyError = undefined;
|
|
@@ -2449,10 +2449,10 @@ var require_error = __commonJS((exports) => {
|
|
|
2449
2449
|
}
|
|
2450
2450
|
});
|
|
2451
2451
|
|
|
2452
|
-
//
|
|
2452
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+types@3.26.0/node_modules/@grammyjs/types/mod.js
|
|
2453
2453
|
var exports_mod = {};
|
|
2454
2454
|
|
|
2455
|
-
//
|
|
2455
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/types.node.js
|
|
2456
2456
|
var require_types_node = __commonJS((exports) => {
|
|
2457
2457
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2458
2458
|
if (k2 === undefined)
|
|
@@ -2543,7 +2543,7 @@ var require_types_node = __commonJS((exports) => {
|
|
|
2543
2543
|
}
|
|
2544
2544
|
});
|
|
2545
2545
|
|
|
2546
|
-
//
|
|
2546
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/types.js
|
|
2547
2547
|
var require_types = __commonJS((exports) => {
|
|
2548
2548
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2549
2549
|
if (k2 === undefined)
|
|
@@ -2569,7 +2569,7 @@ var require_types = __commonJS((exports) => {
|
|
|
2569
2569
|
__exportStar(require_types_node(), exports);
|
|
2570
2570
|
});
|
|
2571
2571
|
|
|
2572
|
-
//
|
|
2572
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/payload.js
|
|
2573
2573
|
var require_payload = __commonJS((exports) => {
|
|
2574
2574
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2575
2575
|
exports.requiresFormDataUpload = requiresFormDataUpload;
|
|
@@ -2709,7 +2709,7 @@ content-type:application/octet-stream\r
|
|
|
2709
2709
|
}
|
|
2710
2710
|
});
|
|
2711
2711
|
|
|
2712
|
-
//
|
|
2712
|
+
// ../../switchroom-sec-1417/node_modules/.bun/event-target-shim@5.0.1/node_modules/event-target-shim/dist/event-target-shim.js
|
|
2713
2713
|
var require_event_target_shim = __commonJS((exports, module) => {
|
|
2714
2714
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2715
2715
|
var privateData = new WeakMap;
|
|
@@ -3149,7 +3149,7 @@ var require_event_target_shim = __commonJS((exports, module) => {
|
|
|
3149
3149
|
module.exports.defineEventAttribute = defineEventAttribute;
|
|
3150
3150
|
});
|
|
3151
3151
|
|
|
3152
|
-
//
|
|
3152
|
+
// ../../switchroom-sec-1417/node_modules/.bun/abort-controller@3.0.0/node_modules/abort-controller/dist/abort-controller.js
|
|
3153
3153
|
var require_abort_controller = __commonJS((exports, module) => {
|
|
3154
3154
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3155
3155
|
var eventTargetShim = require_event_target_shim();
|
|
@@ -3229,7 +3229,7 @@ var require_abort_controller = __commonJS((exports, module) => {
|
|
|
3229
3229
|
module.exports.AbortSignal = AbortSignal2;
|
|
3230
3230
|
});
|
|
3231
3231
|
|
|
3232
|
-
//
|
|
3232
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/shim.node.js
|
|
3233
3233
|
var require_shim_node = __commonJS((exports) => {
|
|
3234
3234
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3235
3235
|
exports.fetch = exports.AbortController = undefined;
|
|
@@ -3243,7 +3243,7 @@ var require_shim_node = __commonJS((exports) => {
|
|
|
3243
3243
|
} });
|
|
3244
3244
|
});
|
|
3245
3245
|
|
|
3246
|
-
//
|
|
3246
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/client.js
|
|
3247
3247
|
var require_client = __commonJS((exports) => {
|
|
3248
3248
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3249
3249
|
exports.createRawApi = createRawApi;
|
|
@@ -3423,7 +3423,7 @@ If you want to prevent such mistakes in the future, consider using TypeScript. h
|
|
|
3423
3423
|
var shim_node_js_1 = require_shim_node();
|
|
3424
3424
|
});
|
|
3425
3425
|
|
|
3426
|
-
//
|
|
3426
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/core/api.js
|
|
3427
3427
|
var require_api = __commonJS((exports) => {
|
|
3428
3428
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3429
3429
|
exports.Api = undefined;
|
|
@@ -4041,7 +4041,7 @@ var require_api = __commonJS((exports) => {
|
|
|
4041
4041
|
exports.Api = Api;
|
|
4042
4042
|
});
|
|
4043
4043
|
|
|
4044
|
-
//
|
|
4044
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/bot.js
|
|
4045
4045
|
var require_bot = __commonJS((exports) => {
|
|
4046
4046
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4047
4047
|
exports.Bot = exports.BotError = exports.DEFAULT_UPDATE_TYPES = undefined;
|
|
@@ -4370,7 +4370,7 @@ On the other hand, if you actually know what you're doing and you do need to ins
|
|
|
4370
4370
|
var shim_node_js_1 = require_shim_node();
|
|
4371
4371
|
});
|
|
4372
4372
|
|
|
4373
|
-
//
|
|
4373
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/constants.js
|
|
4374
4374
|
var require_constants = __commonJS((exports) => {
|
|
4375
4375
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4376
4376
|
exports.API_CONSTANTS = undefined;
|
|
@@ -4406,7 +4406,7 @@ var require_constants = __commonJS((exports) => {
|
|
|
4406
4406
|
Object.freeze(exports.API_CONSTANTS);
|
|
4407
4407
|
});
|
|
4408
4408
|
|
|
4409
|
-
//
|
|
4409
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/inline_query.js
|
|
4410
4410
|
var require_inline_query = __commonJS((exports) => {
|
|
4411
4411
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4412
4412
|
exports.InlineQueryResultBuilder = undefined;
|
|
@@ -4604,7 +4604,7 @@ var require_inline_query = __commonJS((exports) => {
|
|
|
4604
4604
|
};
|
|
4605
4605
|
});
|
|
4606
4606
|
|
|
4607
|
-
//
|
|
4607
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/input_media.js
|
|
4608
4608
|
var require_input_media = __commonJS((exports) => {
|
|
4609
4609
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4610
4610
|
exports.InputMediaBuilder = undefined;
|
|
@@ -4627,7 +4627,7 @@ var require_input_media = __commonJS((exports) => {
|
|
|
4627
4627
|
};
|
|
4628
4628
|
});
|
|
4629
4629
|
|
|
4630
|
-
//
|
|
4630
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/keyboard.js
|
|
4631
4631
|
var require_keyboard = __commonJS((exports) => {
|
|
4632
4632
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4633
4633
|
exports.InlineKeyboard = exports.Keyboard = undefined;
|
|
@@ -4985,7 +4985,7 @@ var require_keyboard = __commonJS((exports) => {
|
|
|
4985
4985
|
}
|
|
4986
4986
|
});
|
|
4987
4987
|
|
|
4988
|
-
//
|
|
4988
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/session.js
|
|
4989
4989
|
var require_session = __commonJS((exports) => {
|
|
4990
4990
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4991
4991
|
exports.MemorySessionStorage = undefined;
|
|
@@ -5285,7 +5285,7 @@ var require_session = __commonJS((exports) => {
|
|
|
5285
5285
|
}
|
|
5286
5286
|
});
|
|
5287
5287
|
|
|
5288
|
-
//
|
|
5288
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/frameworks.js
|
|
5289
5289
|
var require_frameworks = __commonJS((exports) => {
|
|
5290
5290
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5291
5291
|
exports.adapters = undefined;
|
|
@@ -5653,7 +5653,7 @@ var require_frameworks = __commonJS((exports) => {
|
|
|
5653
5653
|
};
|
|
5654
5654
|
});
|
|
5655
5655
|
|
|
5656
|
-
//
|
|
5656
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/convenience/webhook.js
|
|
5657
5657
|
var require_webhook = __commonJS((exports) => {
|
|
5658
5658
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5659
5659
|
exports.webhookCallback = webhookCallback;
|
|
@@ -5747,7 +5747,7 @@ var require_webhook = __commonJS((exports) => {
|
|
|
5747
5747
|
}
|
|
5748
5748
|
});
|
|
5749
5749
|
|
|
5750
|
-
//
|
|
5750
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/mod.js
|
|
5751
5751
|
var require_mod = __commonJS((exports) => {
|
|
5752
5752
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
5753
5753
|
if (k2 === undefined)
|
|
@@ -5813,7 +5813,7 @@ var require_mod = __commonJS((exports) => {
|
|
|
5813
5813
|
} });
|
|
5814
5814
|
});
|
|
5815
5815
|
|
|
5816
|
-
//
|
|
5816
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/platform.node.js
|
|
5817
5817
|
var require_platform_node2 = __commonJS((exports) => {
|
|
5818
5818
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5819
5819
|
exports.parentThread = exports.createThread = undefined;
|
|
@@ -5844,7 +5844,7 @@ var require_platform_node2 = __commonJS((exports) => {
|
|
|
5844
5844
|
exports.parentThread = parentThread;
|
|
5845
5845
|
});
|
|
5846
5846
|
|
|
5847
|
-
//
|
|
5847
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/distribute.js
|
|
5848
5848
|
var require_distribute = __commonJS((exports) => {
|
|
5849
5849
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5850
5850
|
exports.distribute = undefined;
|
|
@@ -5889,7 +5889,7 @@ var require_distribute = __commonJS((exports) => {
|
|
|
5889
5889
|
exports.distribute = distribute;
|
|
5890
5890
|
});
|
|
5891
5891
|
|
|
5892
|
-
//
|
|
5892
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/queue.js
|
|
5893
5893
|
var require_queue = __commonJS((exports) => {
|
|
5894
5894
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5895
5895
|
exports.DecayingDeque = undefined;
|
|
@@ -6033,7 +6033,7 @@ var require_queue = __commonJS((exports) => {
|
|
|
6033
6033
|
exports.DecayingDeque = DecayingDeque;
|
|
6034
6034
|
});
|
|
6035
6035
|
|
|
6036
|
-
//
|
|
6036
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/sink.js
|
|
6037
6037
|
var require_sink = __commonJS((exports) => {
|
|
6038
6038
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6039
6039
|
exports.createConcurrentSink = exports.createBatchSink = exports.createSequentialSink = undefined;
|
|
@@ -6078,7 +6078,7 @@ var require_sink = __commonJS((exports) => {
|
|
|
6078
6078
|
exports.createConcurrentSink = createConcurrentSink;
|
|
6079
6079
|
});
|
|
6080
6080
|
|
|
6081
|
-
//
|
|
6081
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/node-shim.js
|
|
6082
6082
|
var require_node_shim = __commonJS((exports) => {
|
|
6083
6083
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6084
6084
|
if (k2 === undefined)
|
|
@@ -6104,7 +6104,7 @@ var require_node_shim = __commonJS((exports) => {
|
|
|
6104
6104
|
__exportStar(require_abort_controller(), exports);
|
|
6105
6105
|
});
|
|
6106
6106
|
|
|
6107
|
-
//
|
|
6107
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/source.js
|
|
6108
6108
|
var require_source = __commonJS((exports) => {
|
|
6109
6109
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6110
6110
|
exports.createSource = undefined;
|
|
@@ -6184,7 +6184,7 @@ var require_source = __commonJS((exports) => {
|
|
|
6184
6184
|
var node_shim_js_1 = require_node_shim();
|
|
6185
6185
|
});
|
|
6186
6186
|
|
|
6187
|
-
//
|
|
6187
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/runner.js
|
|
6188
6188
|
var require_runner = __commonJS((exports) => {
|
|
6189
6189
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6190
6190
|
exports.createRunner = exports.createUpdateFetcher = exports.run = undefined;
|
|
@@ -6336,7 +6336,7 @@ var require_runner = __commonJS((exports) => {
|
|
|
6336
6336
|
}
|
|
6337
6337
|
});
|
|
6338
6338
|
|
|
6339
|
-
//
|
|
6339
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/sequentialize.js
|
|
6340
6340
|
var require_sequentialize = __commonJS((exports) => {
|
|
6341
6341
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6342
6342
|
exports.sequentialize = undefined;
|
|
@@ -6379,7 +6379,7 @@ var require_sequentialize = __commonJS((exports) => {
|
|
|
6379
6379
|
exports.sequentialize = sequentialize;
|
|
6380
6380
|
});
|
|
6381
6381
|
|
|
6382
|
-
//
|
|
6382
|
+
// ../../switchroom-sec-1417/node_modules/.bun/grammy@1.42.0/node_modules/grammy/out/mod.js
|
|
6383
6383
|
var require_mod2 = __commonJS((exports) => {
|
|
6384
6384
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6385
6385
|
if (k2 === undefined)
|
|
@@ -6445,7 +6445,7 @@ var require_mod2 = __commonJS((exports) => {
|
|
|
6445
6445
|
} });
|
|
6446
6446
|
});
|
|
6447
6447
|
|
|
6448
|
-
//
|
|
6448
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/deps.node.js
|
|
6449
6449
|
var require_deps_node = __commonJS((exports) => {
|
|
6450
6450
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6451
6451
|
exports.BotError = exports.Bot = undefined;
|
|
@@ -6458,7 +6458,7 @@ var require_deps_node = __commonJS((exports) => {
|
|
|
6458
6458
|
} });
|
|
6459
6459
|
});
|
|
6460
6460
|
|
|
6461
|
-
//
|
|
6461
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/worker.js
|
|
6462
6462
|
var require_worker = __commonJS((exports) => {
|
|
6463
6463
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6464
6464
|
exports.BotWorker = undefined;
|
|
@@ -6500,7 +6500,7 @@ var require_worker = __commonJS((exports) => {
|
|
|
6500
6500
|
exports.BotWorker = BotWorker;
|
|
6501
6501
|
});
|
|
6502
6502
|
|
|
6503
|
-
//
|
|
6503
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/mod.js
|
|
6504
6504
|
var require_mod3 = __commonJS((exports) => {
|
|
6505
6505
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6506
6506
|
if (k2 === undefined)
|
|
@@ -6587,7 +6587,7 @@ function cleanWorkerResultParagraph(s) {
|
|
|
6587
6587
|
return kept.join(" ").replace(/\s+/g, " ").trim();
|
|
6588
6588
|
}
|
|
6589
6589
|
|
|
6590
|
-
//
|
|
6590
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@grammyjs+runner@2.0.3+c6be0243b1bbec89/node_modules/@grammyjs/runner/out/mod.js
|
|
6591
6591
|
var require_mod4 = __commonJS((exports) => {
|
|
6592
6592
|
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6593
6593
|
if (k2 === undefined)
|
|
@@ -6619,7 +6619,7 @@ var require_mod4 = __commonJS((exports) => {
|
|
|
6619
6619
|
__exportStar(require_worker(), exports);
|
|
6620
6620
|
});
|
|
6621
6621
|
|
|
6622
|
-
//
|
|
6622
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@xterm+headless@6.0.0/node_modules/@xterm/headless/lib-headless/xterm-headless.js
|
|
6623
6623
|
var require_xterm_headless = __commonJS((exports2) => {
|
|
6624
6624
|
(() => {
|
|
6625
6625
|
var e = { 5639: (e2, t2, s2) => {
|
|
@@ -12174,7 +12174,7 @@ ${i3.join(`
|
|
|
12174
12174
|
})();
|
|
12175
12175
|
});
|
|
12176
12176
|
|
|
12177
|
-
//
|
|
12177
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
12178
12178
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
12179
12179
|
const t = typeof data;
|
|
12180
12180
|
switch (t) {
|
|
@@ -12305,7 +12305,7 @@ var init_util = __esm(() => {
|
|
|
12305
12305
|
]);
|
|
12306
12306
|
});
|
|
12307
12307
|
|
|
12308
|
-
//
|
|
12308
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
12309
12309
|
var ZodIssueCode, quotelessJson = (obj) => {
|
|
12310
12310
|
const json = JSON.stringify(obj, null, 2);
|
|
12311
12311
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
@@ -12426,7 +12426,7 @@ var init_ZodError = __esm(() => {
|
|
|
12426
12426
|
};
|
|
12427
12427
|
});
|
|
12428
12428
|
|
|
12429
|
-
//
|
|
12429
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
12430
12430
|
var errorMap = (issue, _ctx) => {
|
|
12431
12431
|
let message;
|
|
12432
12432
|
switch (issue.code) {
|
|
@@ -12533,7 +12533,7 @@ var init_en = __esm(() => {
|
|
|
12533
12533
|
en_default = errorMap;
|
|
12534
12534
|
});
|
|
12535
12535
|
|
|
12536
|
-
//
|
|
12536
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
12537
12537
|
function setErrorMap(map) {
|
|
12538
12538
|
overrideErrorMap = map;
|
|
12539
12539
|
}
|
|
@@ -12546,7 +12546,7 @@ var init_errors = __esm(() => {
|
|
|
12546
12546
|
overrideErrorMap = en_default;
|
|
12547
12547
|
});
|
|
12548
12548
|
|
|
12549
|
-
//
|
|
12549
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
12550
12550
|
function addIssueToContext(ctx, issueData) {
|
|
12551
12551
|
const overrideMap = getErrorMap();
|
|
12552
12552
|
const issue = makeIssue({
|
|
@@ -12651,10 +12651,10 @@ var init_parseUtil = __esm(() => {
|
|
|
12651
12651
|
});
|
|
12652
12652
|
});
|
|
12653
12653
|
|
|
12654
|
-
//
|
|
12654
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js
|
|
12655
12655
|
var init_typeAliases = () => {};
|
|
12656
12656
|
|
|
12657
|
-
//
|
|
12657
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
12658
12658
|
var errorUtil;
|
|
12659
12659
|
var init_errorUtil = __esm(() => {
|
|
12660
12660
|
(function(errorUtil2) {
|
|
@@ -12663,7 +12663,7 @@ var init_errorUtil = __esm(() => {
|
|
|
12663
12663
|
})(errorUtil || (errorUtil = {}));
|
|
12664
12664
|
});
|
|
12665
12665
|
|
|
12666
|
-
//
|
|
12666
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
|
|
12667
12667
|
class ParseInputLazyPath {
|
|
12668
12668
|
constructor(parent, value, path, key) {
|
|
12669
12669
|
this._cachedPath = [];
|
|
@@ -16014,7 +16014,7 @@ var init_types = __esm(() => {
|
|
|
16014
16014
|
NEVER = INVALID;
|
|
16015
16015
|
});
|
|
16016
16016
|
|
|
16017
|
-
//
|
|
16017
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
16018
16018
|
var exports_external = {};
|
|
16019
16019
|
__export(exports_external, {
|
|
16020
16020
|
void: () => voidType,
|
|
@@ -16134,7 +16134,7 @@ var init_external = __esm(() => {
|
|
|
16134
16134
|
init_ZodError();
|
|
16135
16135
|
});
|
|
16136
16136
|
|
|
16137
|
-
//
|
|
16137
|
+
// ../../switchroom-sec-1417/node_modules/.bun/zod@3.25.76/node_modules/zod/index.js
|
|
16138
16138
|
var init_zod = __esm(() => {
|
|
16139
16139
|
init_external();
|
|
16140
16140
|
init_external();
|
|
@@ -16837,7 +16837,7 @@ var init_vault = __esm(() => {
|
|
|
16837
16837
|
};
|
|
16838
16838
|
});
|
|
16839
16839
|
|
|
16840
|
-
//
|
|
16840
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
|
|
16841
16841
|
var require_identity = __commonJS((exports2) => {
|
|
16842
16842
|
var ALIAS = Symbol.for("yaml.alias");
|
|
16843
16843
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -16891,7 +16891,7 @@ var require_identity = __commonJS((exports2) => {
|
|
|
16891
16891
|
exports2.isSeq = isSeq;
|
|
16892
16892
|
});
|
|
16893
16893
|
|
|
16894
|
-
//
|
|
16894
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/visit.js
|
|
16895
16895
|
var require_visit = __commonJS((exports2) => {
|
|
16896
16896
|
var identity = require_identity();
|
|
16897
16897
|
var BREAK = Symbol("break visit");
|
|
@@ -17046,7 +17046,7 @@ var require_visit = __commonJS((exports2) => {
|
|
|
17046
17046
|
exports2.visitAsync = visitAsync;
|
|
17047
17047
|
});
|
|
17048
17048
|
|
|
17049
|
-
//
|
|
17049
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js
|
|
17050
17050
|
var require_directives = __commonJS((exports2) => {
|
|
17051
17051
|
var identity = require_identity();
|
|
17052
17052
|
var visit = require_visit();
|
|
@@ -17198,7 +17198,7 @@ var require_directives = __commonJS((exports2) => {
|
|
|
17198
17198
|
exports2.Directives = Directives;
|
|
17199
17199
|
});
|
|
17200
17200
|
|
|
17201
|
-
//
|
|
17201
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js
|
|
17202
17202
|
var require_anchors = __commonJS((exports2) => {
|
|
17203
17203
|
var identity = require_identity();
|
|
17204
17204
|
var visit = require_visit();
|
|
@@ -17260,7 +17260,7 @@ var require_anchors = __commonJS((exports2) => {
|
|
|
17260
17260
|
exports2.findNewAnchor = findNewAnchor;
|
|
17261
17261
|
});
|
|
17262
17262
|
|
|
17263
|
-
//
|
|
17263
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.js
|
|
17264
17264
|
var require_applyReviver = __commonJS((exports2) => {
|
|
17265
17265
|
function applyReviver(reviver, obj, key, val) {
|
|
17266
17266
|
if (val && typeof val === "object") {
|
|
@@ -17307,7 +17307,7 @@ var require_applyReviver = __commonJS((exports2) => {
|
|
|
17307
17307
|
exports2.applyReviver = applyReviver;
|
|
17308
17308
|
});
|
|
17309
17309
|
|
|
17310
|
-
//
|
|
17310
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js
|
|
17311
17311
|
var require_toJS = __commonJS((exports2) => {
|
|
17312
17312
|
var identity = require_identity();
|
|
17313
17313
|
function toJS(value, arg, ctx) {
|
|
@@ -17334,7 +17334,7 @@ var require_toJS = __commonJS((exports2) => {
|
|
|
17334
17334
|
exports2.toJS = toJS;
|
|
17335
17335
|
});
|
|
17336
17336
|
|
|
17337
|
-
//
|
|
17337
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.js
|
|
17338
17338
|
var require_Node = __commonJS((exports2) => {
|
|
17339
17339
|
var applyReviver = require_applyReviver();
|
|
17340
17340
|
var identity = require_identity();
|
|
@@ -17371,7 +17371,7 @@ var require_Node = __commonJS((exports2) => {
|
|
|
17371
17371
|
exports2.NodeBase = NodeBase;
|
|
17372
17372
|
});
|
|
17373
17373
|
|
|
17374
|
-
//
|
|
17374
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js
|
|
17375
17375
|
var require_Alias = __commonJS((exports2) => {
|
|
17376
17376
|
var anchors = require_anchors();
|
|
17377
17377
|
var visit = require_visit();
|
|
@@ -17479,7 +17479,7 @@ var require_Alias = __commonJS((exports2) => {
|
|
|
17479
17479
|
exports2.Alias = Alias;
|
|
17480
17480
|
});
|
|
17481
17481
|
|
|
17482
|
-
//
|
|
17482
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.js
|
|
17483
17483
|
var require_Scalar = __commonJS((exports2) => {
|
|
17484
17484
|
var identity = require_identity();
|
|
17485
17485
|
var Node = require_Node();
|
|
@@ -17507,7 +17507,7 @@ var require_Scalar = __commonJS((exports2) => {
|
|
|
17507
17507
|
exports2.isScalarValue = isScalarValue;
|
|
17508
17508
|
});
|
|
17509
17509
|
|
|
17510
|
-
//
|
|
17510
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.js
|
|
17511
17511
|
var require_createNode = __commonJS((exports2) => {
|
|
17512
17512
|
var Alias = require_Alias();
|
|
17513
17513
|
var identity = require_identity();
|
|
@@ -17579,7 +17579,7 @@ var require_createNode = __commonJS((exports2) => {
|
|
|
17579
17579
|
exports2.createNode = createNode;
|
|
17580
17580
|
});
|
|
17581
17581
|
|
|
17582
|
-
//
|
|
17582
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.js
|
|
17583
17583
|
var require_Collection = __commonJS((exports2) => {
|
|
17584
17584
|
var createNode = require_createNode();
|
|
17585
17585
|
var identity = require_identity();
|
|
@@ -17694,7 +17694,7 @@ var require_Collection = __commonJS((exports2) => {
|
|
|
17694
17694
|
exports2.isEmptyPath = isEmptyPath;
|
|
17695
17695
|
});
|
|
17696
17696
|
|
|
17697
|
-
//
|
|
17697
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
17698
17698
|
var require_stringifyComment = __commonJS((exports2) => {
|
|
17699
17699
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
17700
17700
|
function indentComment(comment, indent) {
|
|
@@ -17711,7 +17711,7 @@ var require_stringifyComment = __commonJS((exports2) => {
|
|
|
17711
17711
|
exports2.stringifyComment = stringifyComment;
|
|
17712
17712
|
});
|
|
17713
17713
|
|
|
17714
|
-
//
|
|
17714
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
17715
17715
|
var require_foldFlowLines = __commonJS((exports2) => {
|
|
17716
17716
|
var FOLD_FLOW = "flow";
|
|
17717
17717
|
var FOLD_BLOCK = "block";
|
|
@@ -17848,7 +17848,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
17848
17848
|
exports2.foldFlowLines = foldFlowLines;
|
|
17849
17849
|
});
|
|
17850
17850
|
|
|
17851
|
-
//
|
|
17851
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js
|
|
17852
17852
|
var require_stringifyString = __commonJS((exports2) => {
|
|
17853
17853
|
var Scalar = require_Scalar();
|
|
17854
17854
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -18146,7 +18146,7 @@ ${indent}`);
|
|
|
18146
18146
|
exports2.stringifyString = stringifyString;
|
|
18147
18147
|
});
|
|
18148
18148
|
|
|
18149
|
-
//
|
|
18149
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.js
|
|
18150
18150
|
var require_stringify = __commonJS((exports2) => {
|
|
18151
18151
|
var anchors = require_anchors();
|
|
18152
18152
|
var identity = require_identity();
|
|
@@ -18267,7 +18267,7 @@ ${ctx.indent}${str}`;
|
|
|
18267
18267
|
exports2.stringify = stringify;
|
|
18268
18268
|
});
|
|
18269
18269
|
|
|
18270
|
-
//
|
|
18270
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
18271
18271
|
var require_stringifyPair = __commonJS((exports2) => {
|
|
18272
18272
|
var identity = require_identity();
|
|
18273
18273
|
var Scalar = require_Scalar();
|
|
@@ -18403,7 +18403,7 @@ ${ctx.indent}`;
|
|
|
18403
18403
|
exports2.stringifyPair = stringifyPair;
|
|
18404
18404
|
});
|
|
18405
18405
|
|
|
18406
|
-
//
|
|
18406
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/log.js
|
|
18407
18407
|
var require_log = __commonJS((exports2) => {
|
|
18408
18408
|
var node_process = __require("process");
|
|
18409
18409
|
function debug(logLevel, ...messages) {
|
|
@@ -18422,7 +18422,7 @@ var require_log = __commonJS((exports2) => {
|
|
|
18422
18422
|
exports2.warn = warn;
|
|
18423
18423
|
});
|
|
18424
18424
|
|
|
18425
|
-
//
|
|
18425
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
18426
18426
|
var require_merge = __commonJS((exports2) => {
|
|
18427
18427
|
var identity = require_identity();
|
|
18428
18428
|
var Scalar = require_Scalar();
|
|
@@ -18476,7 +18476,7 @@ var require_merge = __commonJS((exports2) => {
|
|
|
18476
18476
|
exports2.merge = merge;
|
|
18477
18477
|
});
|
|
18478
18478
|
|
|
18479
|
-
//
|
|
18479
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
18480
18480
|
var require_addPairToJSMap = __commonJS((exports2) => {
|
|
18481
18481
|
var log = require_log();
|
|
18482
18482
|
var merge = require_merge();
|
|
@@ -18537,7 +18537,7 @@ var require_addPairToJSMap = __commonJS((exports2) => {
|
|
|
18537
18537
|
exports2.addPairToJSMap = addPairToJSMap;
|
|
18538
18538
|
});
|
|
18539
18539
|
|
|
18540
|
-
//
|
|
18540
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.js
|
|
18541
18541
|
var require_Pair = __commonJS((exports2) => {
|
|
18542
18542
|
var createNode = require_createNode();
|
|
18543
18543
|
var stringifyPair = require_stringifyPair();
|
|
@@ -18575,7 +18575,7 @@ var require_Pair = __commonJS((exports2) => {
|
|
|
18575
18575
|
exports2.createPair = createPair;
|
|
18576
18576
|
});
|
|
18577
18577
|
|
|
18578
|
-
//
|
|
18578
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
18579
18579
|
var require_stringifyCollection = __commonJS((exports2) => {
|
|
18580
18580
|
var identity = require_identity();
|
|
18581
18581
|
var stringify = require_stringify();
|
|
@@ -18727,7 +18727,7 @@ ${indent}${end}`;
|
|
|
18727
18727
|
exports2.stringifyCollection = stringifyCollection;
|
|
18728
18728
|
});
|
|
18729
18729
|
|
|
18730
|
-
//
|
|
18730
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
18731
18731
|
var require_YAMLMap = __commonJS((exports2) => {
|
|
18732
18732
|
var stringifyCollection = require_stringifyCollection();
|
|
18733
18733
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -18854,7 +18854,7 @@ var require_YAMLMap = __commonJS((exports2) => {
|
|
|
18854
18854
|
exports2.findPair = findPair;
|
|
18855
18855
|
});
|
|
18856
18856
|
|
|
18857
|
-
//
|
|
18857
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.js
|
|
18858
18858
|
var require_map = __commonJS((exports2) => {
|
|
18859
18859
|
var identity = require_identity();
|
|
18860
18860
|
var YAMLMap = require_YAMLMap();
|
|
@@ -18873,7 +18873,7 @@ var require_map = __commonJS((exports2) => {
|
|
|
18873
18873
|
exports2.map = map;
|
|
18874
18874
|
});
|
|
18875
18875
|
|
|
18876
|
-
//
|
|
18876
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
18877
18877
|
var require_YAMLSeq = __commonJS((exports2) => {
|
|
18878
18878
|
var createNode = require_createNode();
|
|
18879
18879
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -18966,7 +18966,7 @@ var require_YAMLSeq = __commonJS((exports2) => {
|
|
|
18966
18966
|
exports2.YAMLSeq = YAMLSeq;
|
|
18967
18967
|
});
|
|
18968
18968
|
|
|
18969
|
-
//
|
|
18969
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.js
|
|
18970
18970
|
var require_seq = __commonJS((exports2) => {
|
|
18971
18971
|
var identity = require_identity();
|
|
18972
18972
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -18985,7 +18985,7 @@ var require_seq = __commonJS((exports2) => {
|
|
|
18985
18985
|
exports2.seq = seq;
|
|
18986
18986
|
});
|
|
18987
18987
|
|
|
18988
|
-
//
|
|
18988
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.js
|
|
18989
18989
|
var require_string = __commonJS((exports2) => {
|
|
18990
18990
|
var stringifyString = require_stringifyString();
|
|
18991
18991
|
var string = {
|
|
@@ -19001,7 +19001,7 @@ var require_string = __commonJS((exports2) => {
|
|
|
19001
19001
|
exports2.string = string;
|
|
19002
19002
|
});
|
|
19003
19003
|
|
|
19004
|
-
//
|
|
19004
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.js
|
|
19005
19005
|
var require_null = __commonJS((exports2) => {
|
|
19006
19006
|
var Scalar = require_Scalar();
|
|
19007
19007
|
var nullTag = {
|
|
@@ -19016,7 +19016,7 @@ var require_null = __commonJS((exports2) => {
|
|
|
19016
19016
|
exports2.nullTag = nullTag;
|
|
19017
19017
|
});
|
|
19018
19018
|
|
|
19019
|
-
//
|
|
19019
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.js
|
|
19020
19020
|
var require_bool = __commonJS((exports2) => {
|
|
19021
19021
|
var Scalar = require_Scalar();
|
|
19022
19022
|
var boolTag = {
|
|
@@ -19037,7 +19037,7 @@ var require_bool = __commonJS((exports2) => {
|
|
|
19037
19037
|
exports2.boolTag = boolTag;
|
|
19038
19038
|
});
|
|
19039
19039
|
|
|
19040
|
-
//
|
|
19040
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
19041
19041
|
var require_stringifyNumber = __commonJS((exports2) => {
|
|
19042
19042
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
19043
19043
|
if (typeof value === "bigint")
|
|
@@ -19061,7 +19061,7 @@ var require_stringifyNumber = __commonJS((exports2) => {
|
|
|
19061
19061
|
exports2.stringifyNumber = stringifyNumber;
|
|
19062
19062
|
});
|
|
19063
19063
|
|
|
19064
|
-
//
|
|
19064
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.js
|
|
19065
19065
|
var require_float = __commonJS((exports2) => {
|
|
19066
19066
|
var Scalar = require_Scalar();
|
|
19067
19067
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -19104,7 +19104,7 @@ var require_float = __commonJS((exports2) => {
|
|
|
19104
19104
|
exports2.floatNaN = floatNaN;
|
|
19105
19105
|
});
|
|
19106
19106
|
|
|
19107
|
-
//
|
|
19107
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.js
|
|
19108
19108
|
var require_int = __commonJS((exports2) => {
|
|
19109
19109
|
var stringifyNumber = require_stringifyNumber();
|
|
19110
19110
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -19146,7 +19146,7 @@ var require_int = __commonJS((exports2) => {
|
|
|
19146
19146
|
exports2.intOct = intOct;
|
|
19147
19147
|
});
|
|
19148
19148
|
|
|
19149
|
-
//
|
|
19149
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.js
|
|
19150
19150
|
var require_schema = __commonJS((exports2) => {
|
|
19151
19151
|
var map = require_map();
|
|
19152
19152
|
var _null = require_null();
|
|
@@ -19171,7 +19171,7 @@ var require_schema = __commonJS((exports2) => {
|
|
|
19171
19171
|
exports2.schema = schema;
|
|
19172
19172
|
});
|
|
19173
19173
|
|
|
19174
|
-
//
|
|
19174
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.js
|
|
19175
19175
|
var require_schema2 = __commonJS((exports2) => {
|
|
19176
19176
|
var Scalar = require_Scalar();
|
|
19177
19177
|
var map = require_map();
|
|
@@ -19235,7 +19235,7 @@ var require_schema2 = __commonJS((exports2) => {
|
|
|
19235
19235
|
exports2.schema = schema;
|
|
19236
19236
|
});
|
|
19237
19237
|
|
|
19238
|
-
//
|
|
19238
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
19239
19239
|
var require_binary = __commonJS((exports2) => {
|
|
19240
19240
|
var node_buffer = __require("buffer");
|
|
19241
19241
|
var Scalar = require_Scalar();
|
|
@@ -19290,7 +19290,7 @@ var require_binary = __commonJS((exports2) => {
|
|
|
19290
19290
|
exports2.binary = binary;
|
|
19291
19291
|
});
|
|
19292
19292
|
|
|
19293
|
-
//
|
|
19293
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
19294
19294
|
var require_pairs = __commonJS((exports2) => {
|
|
19295
19295
|
var identity = require_identity();
|
|
19296
19296
|
var Pair = require_Pair();
|
|
@@ -19365,7 +19365,7 @@ ${cn.comment}` : item.comment;
|
|
|
19365
19365
|
exports2.resolvePairs = resolvePairs;
|
|
19366
19366
|
});
|
|
19367
19367
|
|
|
19368
|
-
//
|
|
19368
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
19369
19369
|
var require_omap = __commonJS((exports2) => {
|
|
19370
19370
|
var identity = require_identity();
|
|
19371
19371
|
var toJS = require_toJS();
|
|
@@ -19437,7 +19437,7 @@ var require_omap = __commonJS((exports2) => {
|
|
|
19437
19437
|
exports2.omap = omap;
|
|
19438
19438
|
});
|
|
19439
19439
|
|
|
19440
|
-
//
|
|
19440
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
19441
19441
|
var require_bool2 = __commonJS((exports2) => {
|
|
19442
19442
|
var Scalar = require_Scalar();
|
|
19443
19443
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -19466,7 +19466,7 @@ var require_bool2 = __commonJS((exports2) => {
|
|
|
19466
19466
|
exports2.trueTag = trueTag;
|
|
19467
19467
|
});
|
|
19468
19468
|
|
|
19469
|
-
//
|
|
19469
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
19470
19470
|
var require_float2 = __commonJS((exports2) => {
|
|
19471
19471
|
var Scalar = require_Scalar();
|
|
19472
19472
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -19512,7 +19512,7 @@ var require_float2 = __commonJS((exports2) => {
|
|
|
19512
19512
|
exports2.floatNaN = floatNaN;
|
|
19513
19513
|
});
|
|
19514
19514
|
|
|
19515
|
-
//
|
|
19515
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
19516
19516
|
var require_int2 = __commonJS((exports2) => {
|
|
19517
19517
|
var stringifyNumber = require_stringifyNumber();
|
|
19518
19518
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -19588,7 +19588,7 @@ var require_int2 = __commonJS((exports2) => {
|
|
|
19588
19588
|
exports2.intOct = intOct;
|
|
19589
19589
|
});
|
|
19590
19590
|
|
|
19591
|
-
//
|
|
19591
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
19592
19592
|
var require_set = __commonJS((exports2) => {
|
|
19593
19593
|
var identity = require_identity();
|
|
19594
19594
|
var Pair = require_Pair();
|
|
@@ -19671,7 +19671,7 @@ var require_set = __commonJS((exports2) => {
|
|
|
19671
19671
|
exports2.set = set;
|
|
19672
19672
|
});
|
|
19673
19673
|
|
|
19674
|
-
//
|
|
19674
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
19675
19675
|
var require_timestamp = __commonJS((exports2) => {
|
|
19676
19676
|
var stringifyNumber = require_stringifyNumber();
|
|
19677
19677
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -19753,7 +19753,7 @@ var require_timestamp = __commonJS((exports2) => {
|
|
|
19753
19753
|
exports2.timestamp = timestamp;
|
|
19754
19754
|
});
|
|
19755
19755
|
|
|
19756
|
-
//
|
|
19756
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
19757
19757
|
var require_schema3 = __commonJS((exports2) => {
|
|
19758
19758
|
var map = require_map();
|
|
19759
19759
|
var _null = require_null();
|
|
@@ -19794,7 +19794,7 @@ var require_schema3 = __commonJS((exports2) => {
|
|
|
19794
19794
|
exports2.schema = schema;
|
|
19795
19795
|
});
|
|
19796
19796
|
|
|
19797
|
-
//
|
|
19797
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/tags.js
|
|
19798
19798
|
var require_tags = __commonJS((exports2) => {
|
|
19799
19799
|
var map = require_map();
|
|
19800
19800
|
var _null = require_null();
|
|
@@ -19885,7 +19885,7 @@ var require_tags = __commonJS((exports2) => {
|
|
|
19885
19885
|
exports2.getTags = getTags;
|
|
19886
19886
|
});
|
|
19887
19887
|
|
|
19888
|
-
//
|
|
19888
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.js
|
|
19889
19889
|
var require_Schema = __commonJS((exports2) => {
|
|
19890
19890
|
var identity = require_identity();
|
|
19891
19891
|
var map = require_map();
|
|
@@ -19915,7 +19915,7 @@ var require_Schema = __commonJS((exports2) => {
|
|
|
19915
19915
|
exports2.Schema = Schema;
|
|
19916
19916
|
});
|
|
19917
19917
|
|
|
19918
|
-
//
|
|
19918
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
19919
19919
|
var require_stringifyDocument = __commonJS((exports2) => {
|
|
19920
19920
|
var identity = require_identity();
|
|
19921
19921
|
var stringify = require_stringify();
|
|
@@ -19995,7 +19995,7 @@ var require_stringifyDocument = __commonJS((exports2) => {
|
|
|
19995
19995
|
exports2.stringifyDocument = stringifyDocument;
|
|
19996
19996
|
});
|
|
19997
19997
|
|
|
19998
|
-
//
|
|
19998
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/Document.js
|
|
19999
19999
|
var require_Document = __commonJS((exports2) => {
|
|
20000
20000
|
var Alias = require_Alias();
|
|
20001
20001
|
var Collection = require_Collection();
|
|
@@ -20230,7 +20230,7 @@ var require_Document = __commonJS((exports2) => {
|
|
|
20230
20230
|
exports2.Document = Document;
|
|
20231
20231
|
});
|
|
20232
20232
|
|
|
20233
|
-
//
|
|
20233
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/errors.js
|
|
20234
20234
|
var require_errors = __commonJS((exports2) => {
|
|
20235
20235
|
class YAMLError extends Error {
|
|
20236
20236
|
constructor(name, pos, code, message) {
|
|
@@ -20295,7 +20295,7 @@ ${pointer}
|
|
|
20295
20295
|
exports2.prettifyError = prettifyError;
|
|
20296
20296
|
});
|
|
20297
20297
|
|
|
20298
|
-
//
|
|
20298
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.js
|
|
20299
20299
|
var require_resolve_props = __commonJS((exports2) => {
|
|
20300
20300
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
20301
20301
|
let spaceBefore = false;
|
|
@@ -20425,7 +20425,7 @@ var require_resolve_props = __commonJS((exports2) => {
|
|
|
20425
20425
|
exports2.resolveProps = resolveProps;
|
|
20426
20426
|
});
|
|
20427
20427
|
|
|
20428
|
-
//
|
|
20428
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
20429
20429
|
var require_util_contains_newline = __commonJS((exports2) => {
|
|
20430
20430
|
function containsNewline(key) {
|
|
20431
20431
|
if (!key)
|
|
@@ -20465,7 +20465,7 @@ var require_util_contains_newline = __commonJS((exports2) => {
|
|
|
20465
20465
|
exports2.containsNewline = containsNewline;
|
|
20466
20466
|
});
|
|
20467
20467
|
|
|
20468
|
-
//
|
|
20468
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
20469
20469
|
var require_util_flow_indent_check = __commonJS((exports2) => {
|
|
20470
20470
|
var utilContainsNewline = require_util_contains_newline();
|
|
20471
20471
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -20480,7 +20480,7 @@ var require_util_flow_indent_check = __commonJS((exports2) => {
|
|
|
20480
20480
|
exports2.flowIndentCheck = flowIndentCheck;
|
|
20481
20481
|
});
|
|
20482
20482
|
|
|
20483
|
-
//
|
|
20483
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js
|
|
20484
20484
|
var require_util_map_includes = __commonJS((exports2) => {
|
|
20485
20485
|
var identity = require_identity();
|
|
20486
20486
|
function mapIncludes(ctx, items, search) {
|
|
@@ -20493,7 +20493,7 @@ var require_util_map_includes = __commonJS((exports2) => {
|
|
|
20493
20493
|
exports2.mapIncludes = mapIncludes;
|
|
20494
20494
|
});
|
|
20495
20495
|
|
|
20496
|
-
//
|
|
20496
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
20497
20497
|
var require_resolve_block_map = __commonJS((exports2) => {
|
|
20498
20498
|
var Pair = require_Pair();
|
|
20499
20499
|
var YAMLMap = require_YAMLMap();
|
|
@@ -20600,7 +20600,7 @@ var require_resolve_block_map = __commonJS((exports2) => {
|
|
|
20600
20600
|
exports2.resolveBlockMap = resolveBlockMap;
|
|
20601
20601
|
});
|
|
20602
20602
|
|
|
20603
|
-
//
|
|
20603
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
20604
20604
|
var require_resolve_block_seq = __commonJS((exports2) => {
|
|
20605
20605
|
var YAMLSeq = require_YAMLSeq();
|
|
20606
20606
|
var resolveProps = require_resolve_props();
|
|
@@ -20648,7 +20648,7 @@ var require_resolve_block_seq = __commonJS((exports2) => {
|
|
|
20648
20648
|
exports2.resolveBlockSeq = resolveBlockSeq;
|
|
20649
20649
|
});
|
|
20650
20650
|
|
|
20651
|
-
//
|
|
20651
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.js
|
|
20652
20652
|
var require_resolve_end = __commonJS((exports2) => {
|
|
20653
20653
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
20654
20654
|
let comment = "";
|
|
@@ -20688,7 +20688,7 @@ var require_resolve_end = __commonJS((exports2) => {
|
|
|
20688
20688
|
exports2.resolveEnd = resolveEnd;
|
|
20689
20689
|
});
|
|
20690
20690
|
|
|
20691
|
-
//
|
|
20691
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
20692
20692
|
var require_resolve_flow_collection = __commonJS((exports2) => {
|
|
20693
20693
|
var identity = require_identity();
|
|
20694
20694
|
var Pair = require_Pair();
|
|
@@ -20879,7 +20879,7 @@ var require_resolve_flow_collection = __commonJS((exports2) => {
|
|
|
20879
20879
|
exports2.resolveFlowCollection = resolveFlowCollection;
|
|
20880
20880
|
});
|
|
20881
20881
|
|
|
20882
|
-
//
|
|
20882
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.js
|
|
20883
20883
|
var require_compose_collection = __commonJS((exports2) => {
|
|
20884
20884
|
var identity = require_identity();
|
|
20885
20885
|
var Scalar = require_Scalar();
|
|
@@ -20941,7 +20941,7 @@ var require_compose_collection = __commonJS((exports2) => {
|
|
|
20941
20941
|
exports2.composeCollection = composeCollection;
|
|
20942
20942
|
});
|
|
20943
20943
|
|
|
20944
|
-
//
|
|
20944
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
20945
20945
|
var require_resolve_block_scalar = __commonJS((exports2) => {
|
|
20946
20946
|
var Scalar = require_Scalar();
|
|
20947
20947
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -21134,7 +21134,7 @@ var require_resolve_block_scalar = __commonJS((exports2) => {
|
|
|
21134
21134
|
exports2.resolveBlockScalar = resolveBlockScalar;
|
|
21135
21135
|
});
|
|
21136
21136
|
|
|
21137
|
-
//
|
|
21137
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
21138
21138
|
var require_resolve_flow_scalar = __commonJS((exports2) => {
|
|
21139
21139
|
var Scalar = require_Scalar();
|
|
21140
21140
|
var resolveEnd = require_resolve_end();
|
|
@@ -21350,7 +21350,7 @@ var require_resolve_flow_scalar = __commonJS((exports2) => {
|
|
|
21350
21350
|
exports2.resolveFlowScalar = resolveFlowScalar;
|
|
21351
21351
|
});
|
|
21352
21352
|
|
|
21353
|
-
//
|
|
21353
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js
|
|
21354
21354
|
var require_compose_scalar = __commonJS((exports2) => {
|
|
21355
21355
|
var identity = require_identity();
|
|
21356
21356
|
var Scalar = require_Scalar();
|
|
@@ -21428,7 +21428,7 @@ var require_compose_scalar = __commonJS((exports2) => {
|
|
|
21428
21428
|
exports2.composeScalar = composeScalar;
|
|
21429
21429
|
});
|
|
21430
21430
|
|
|
21431
|
-
//
|
|
21431
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
21432
21432
|
var require_util_empty_scalar_position = __commonJS((exports2) => {
|
|
21433
21433
|
function emptyScalarPosition(offset, before, pos) {
|
|
21434
21434
|
if (before) {
|
|
@@ -21455,7 +21455,7 @@ var require_util_empty_scalar_position = __commonJS((exports2) => {
|
|
|
21455
21455
|
exports2.emptyScalarPosition = emptyScalarPosition;
|
|
21456
21456
|
});
|
|
21457
21457
|
|
|
21458
|
-
//
|
|
21458
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js
|
|
21459
21459
|
var require_compose_node = __commonJS((exports2) => {
|
|
21460
21460
|
var Alias = require_Alias();
|
|
21461
21461
|
var identity = require_identity();
|
|
@@ -21558,7 +21558,7 @@ var require_compose_node = __commonJS((exports2) => {
|
|
|
21558
21558
|
exports2.composeNode = composeNode;
|
|
21559
21559
|
});
|
|
21560
21560
|
|
|
21561
|
-
//
|
|
21561
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.js
|
|
21562
21562
|
var require_compose_doc = __commonJS((exports2) => {
|
|
21563
21563
|
var Document = require_Document();
|
|
21564
21564
|
var composeNode = require_compose_node();
|
|
@@ -21598,7 +21598,7 @@ var require_compose_doc = __commonJS((exports2) => {
|
|
|
21598
21598
|
exports2.composeDoc = composeDoc;
|
|
21599
21599
|
});
|
|
21600
21600
|
|
|
21601
|
-
//
|
|
21601
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js
|
|
21602
21602
|
var require_composer2 = __commonJS((exports2) => {
|
|
21603
21603
|
var node_process = __require("process");
|
|
21604
21604
|
var directives = require_directives();
|
|
@@ -21787,7 +21787,7 @@ ${end.comment}` : end.comment;
|
|
|
21787
21787
|
exports2.Composer = Composer;
|
|
21788
21788
|
});
|
|
21789
21789
|
|
|
21790
|
-
//
|
|
21790
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js
|
|
21791
21791
|
var require_cst_scalar = __commonJS((exports2) => {
|
|
21792
21792
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
21793
21793
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -21977,7 +21977,7 @@ var require_cst_scalar = __commonJS((exports2) => {
|
|
|
21977
21977
|
exports2.setScalarValue = setScalarValue;
|
|
21978
21978
|
});
|
|
21979
21979
|
|
|
21980
|
-
//
|
|
21980
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js
|
|
21981
21981
|
var require_cst_stringify = __commonJS((exports2) => {
|
|
21982
21982
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
21983
21983
|
function stringifyToken(token) {
|
|
@@ -22035,7 +22035,7 @@ var require_cst_stringify = __commonJS((exports2) => {
|
|
|
22035
22035
|
exports2.stringify = stringify;
|
|
22036
22036
|
});
|
|
22037
22037
|
|
|
22038
|
-
//
|
|
22038
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js
|
|
22039
22039
|
var require_cst_visit = __commonJS((exports2) => {
|
|
22040
22040
|
var BREAK = Symbol("break visit");
|
|
22041
22041
|
var SKIP = Symbol("skip children");
|
|
@@ -22094,7 +22094,7 @@ var require_cst_visit = __commonJS((exports2) => {
|
|
|
22094
22094
|
exports2.visit = visit;
|
|
22095
22095
|
});
|
|
22096
22096
|
|
|
22097
|
-
//
|
|
22097
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js
|
|
22098
22098
|
var require_cst = __commonJS((exports2) => {
|
|
22099
22099
|
var cstScalar = require_cst_scalar();
|
|
22100
22100
|
var cstStringify = require_cst_stringify();
|
|
@@ -22195,7 +22195,7 @@ var require_cst = __commonJS((exports2) => {
|
|
|
22195
22195
|
exports2.tokenType = tokenType;
|
|
22196
22196
|
});
|
|
22197
22197
|
|
|
22198
|
-
//
|
|
22198
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js
|
|
22199
22199
|
var require_lexer = __commonJS((exports2) => {
|
|
22200
22200
|
var cst = require_cst();
|
|
22201
22201
|
function isEmpty2(ch) {
|
|
@@ -22781,7 +22781,7 @@ var require_lexer = __commonJS((exports2) => {
|
|
|
22781
22781
|
exports2.Lexer = Lexer;
|
|
22782
22782
|
});
|
|
22783
22783
|
|
|
22784
|
-
//
|
|
22784
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js
|
|
22785
22785
|
var require_line_counter = __commonJS((exports2) => {
|
|
22786
22786
|
class LineCounter {
|
|
22787
22787
|
constructor() {
|
|
@@ -22809,7 +22809,7 @@ var require_line_counter = __commonJS((exports2) => {
|
|
|
22809
22809
|
exports2.LineCounter = LineCounter;
|
|
22810
22810
|
});
|
|
22811
22811
|
|
|
22812
|
-
//
|
|
22812
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/parser.js
|
|
22813
22813
|
var require_parser = __commonJS((exports2) => {
|
|
22814
22814
|
var node_process = __require("process");
|
|
22815
22815
|
var cst = require_cst();
|
|
@@ -23658,7 +23658,7 @@ var require_parser = __commonJS((exports2) => {
|
|
|
23658
23658
|
exports2.Parser = Parser;
|
|
23659
23659
|
});
|
|
23660
23660
|
|
|
23661
|
-
//
|
|
23661
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/public-api.js
|
|
23662
23662
|
var require_public_api = __commonJS((exports2) => {
|
|
23663
23663
|
var composer = require_composer2();
|
|
23664
23664
|
var Document = require_Document();
|
|
@@ -23752,7 +23752,7 @@ var require_public_api = __commonJS((exports2) => {
|
|
|
23752
23752
|
exports2.stringify = stringify;
|
|
23753
23753
|
});
|
|
23754
23754
|
|
|
23755
|
-
//
|
|
23755
|
+
// ../../switchroom-sec-1417/node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/index.js
|
|
23756
23756
|
var composer, Document, Schema, errors2, Alias, identity, Pair, Scalar, YAMLMap, YAMLSeq, cst, lexer, lineCounter, parser, publicApi, visit, $Composer, $Document, $Schema, $YAMLError, $YAMLParseError, $YAMLWarning, $Alias, $isAlias, $isCollection, $isDocument, $isMap, $isNode, $isPair, $isScalar, $isSeq, $Pair, $Scalar, $YAMLMap, $YAMLSeq, $Lexer, $LineCounter, $Parser, $parse, $parseAllDocuments, $parseDocument, $stringify, $visit, $visitAsync;
|
|
23757
23757
|
var init_dist = __esm(() => {
|
|
23758
23758
|
composer = require_composer2();
|
|
@@ -26271,7 +26271,7 @@ var init_url_redact = __esm(() => {
|
|
|
26271
26271
|
URL_RE = /\b(?:https?|wss?|ftp):\/\/[^\s<>"']+/gi;
|
|
26272
26272
|
});
|
|
26273
26273
|
|
|
26274
|
-
//
|
|
26274
|
+
// ../../switchroom-sec-1417/node_modules/.bun/boundary@2.0.0/node_modules/boundary/lib/index.js
|
|
26275
26275
|
var require_lib = __commonJS((exports2) => {
|
|
26276
26276
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
26277
26277
|
exports2.binarySearch = exports2.upperBound = exports2.lowerBound = exports2.compare = undefined;
|
|
@@ -26318,7 +26318,7 @@ var require_lib = __commonJS((exports2) => {
|
|
|
26318
26318
|
exports2.binarySearch = binarySearch;
|
|
26319
26319
|
});
|
|
26320
26320
|
|
|
26321
|
-
//
|
|
26321
|
+
// ../../switchroom-sec-1417/node_modules/.bun/structured-source@4.0.0/node_modules/structured-source/lib/structured-source.js
|
|
26322
26322
|
var require_structured_source = __commonJS((exports2) => {
|
|
26323
26323
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
26324
26324
|
exports2.StructuredSource = undefined;
|
|
@@ -26373,13 +26373,13 @@ var require_structured_source = __commonJS((exports2) => {
|
|
|
26373
26373
|
}
|
|
26374
26374
|
exports2.StructuredSource = StructuredSource;
|
|
26375
26375
|
});
|
|
26376
|
-
//
|
|
26376
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/SecretLintSourceCodeImpl.js
|
|
26377
26377
|
var import_structured_source;
|
|
26378
26378
|
var init_SecretLintSourceCodeImpl = __esm(() => {
|
|
26379
26379
|
import_structured_source = __toESM(require_structured_source(), 1);
|
|
26380
26380
|
});
|
|
26381
26381
|
|
|
26382
|
-
//
|
|
26382
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/helper/promise-event-emitter.js
|
|
26383
26383
|
class EventEmitter {
|
|
26384
26384
|
#listeners = new Map;
|
|
26385
26385
|
on(type, listener) {
|
|
@@ -26418,9 +26418,9 @@ class EventEmitter {
|
|
|
26418
26418
|
return Array.from(this.#listeners.get(type) ?? []);
|
|
26419
26419
|
}
|
|
26420
26420
|
}
|
|
26421
|
-
//
|
|
26421
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RuleContext.js
|
|
26422
26422
|
var init_RuleContext = () => {};
|
|
26423
|
-
//
|
|
26423
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/index.js
|
|
26424
26424
|
class SecretLintProfiler {
|
|
26425
26425
|
perf;
|
|
26426
26426
|
entries = [];
|
|
@@ -26477,7 +26477,7 @@ class SecretLintProfiler {
|
|
|
26477
26477
|
}
|
|
26478
26478
|
}
|
|
26479
26479
|
|
|
26480
|
-
//
|
|
26480
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+profiler@12.2.0/node_modules/@secretlint/profiler/module/node.js
|
|
26481
26481
|
import perf_hooks from "node:perf_hooks";
|
|
26482
26482
|
|
|
26483
26483
|
class NullPerformanceObserver {
|
|
@@ -26492,19 +26492,19 @@ var init_node = __esm(() => {
|
|
|
26492
26492
|
});
|
|
26493
26493
|
});
|
|
26494
26494
|
|
|
26495
|
-
//
|
|
26495
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RunningEvents.js
|
|
26496
26496
|
var init_RunningEvents = __esm(() => {
|
|
26497
26497
|
init_node();
|
|
26498
26498
|
});
|
|
26499
26499
|
|
|
26500
|
-
//
|
|
26500
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/RulePresetContext.js
|
|
26501
26501
|
var init_RulePresetContext = __esm(() => {
|
|
26502
26502
|
init_RuleContext();
|
|
26503
26503
|
});
|
|
26504
|
-
//
|
|
26504
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/messages/index.js
|
|
26505
26505
|
var init_messages = () => {};
|
|
26506
26506
|
|
|
26507
|
-
//
|
|
26507
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+core@12.2.0/node_modules/@secretlint/core/module/index.js
|
|
26508
26508
|
var import_debug, debug;
|
|
26509
26509
|
var init_module = __esm(() => {
|
|
26510
26510
|
init_SecretLintSourceCodeImpl();
|
|
@@ -26517,7 +26517,7 @@ var init_module = __esm(() => {
|
|
|
26517
26517
|
debug = import_debug.default("@secretlint/core");
|
|
26518
26518
|
});
|
|
26519
26519
|
|
|
26520
|
-
//
|
|
26520
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@secretlint+secretlint-rule-preset-recommend@12.2.0/node_modules/@secretlint/secretlint-rule-preset-recommend/module/index.js
|
|
26521
26521
|
function requireLodash_uniq() {
|
|
26522
26522
|
if (hasRequiredLodash_uniq)
|
|
26523
26523
|
return lodash_uniq;
|
|
@@ -34459,7 +34459,7 @@ function clear(key) {
|
|
|
34459
34459
|
state.delete(key);
|
|
34460
34460
|
}
|
|
34461
34461
|
|
|
34462
|
-
//
|
|
34462
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
34463
34463
|
import { dirname as dirname2, posix, sep as sep2 } from "path";
|
|
34464
34464
|
function createModulerModifier() {
|
|
34465
34465
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
@@ -34495,7 +34495,7 @@ function normalizeWindowsPath(path) {
|
|
|
34495
34495
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
34496
34496
|
}
|
|
34497
34497
|
|
|
34498
|
-
//
|
|
34498
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
34499
34499
|
var normalizeFlagsResponse = (flagsResponse) => {
|
|
34500
34500
|
if ("flags" in flagsResponse) {
|
|
34501
34501
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -34566,7 +34566,7 @@ var parsePayload = (response) => {
|
|
|
34566
34566
|
}
|
|
34567
34567
|
};
|
|
34568
34568
|
|
|
34569
|
-
//
|
|
34569
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/gzip.mjs
|
|
34570
34570
|
function isGzipSupported() {
|
|
34571
34571
|
return "CompressionStream" in globalThis;
|
|
34572
34572
|
}
|
|
@@ -34586,7 +34586,7 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
34586
34586
|
}
|
|
34587
34587
|
}
|
|
34588
34588
|
|
|
34589
|
-
//
|
|
34589
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
34590
34590
|
/*! For license information please see uuidv7.mjs.LICENSE.txt */
|
|
34591
34591
|
var DIGITS = "0123456789abcdef";
|
|
34592
34592
|
|
|
@@ -34764,7 +34764,7 @@ var defaultGenerator;
|
|
|
34764
34764
|
var uuidv7 = () => uuidv7obj().toString();
|
|
34765
34765
|
var uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator)).generate();
|
|
34766
34766
|
|
|
34767
|
-
//
|
|
34767
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/types.mjs
|
|
34768
34768
|
var types_PostHogPersistedProperty = /* @__PURE__ */ function(PostHogPersistedProperty) {
|
|
34769
34769
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
34770
34770
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -34797,7 +34797,7 @@ var types_PostHogPersistedProperty = /* @__PURE__ */ function(PostHogPersistedPr
|
|
|
34797
34797
|
return PostHogPersistedProperty;
|
|
34798
34798
|
}({});
|
|
34799
34799
|
|
|
34800
|
-
//
|
|
34800
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
34801
34801
|
var DEFAULT_BLOCKED_UA_STRS = [
|
|
34802
34802
|
"amazonbot",
|
|
34803
34803
|
"amazonproductbot",
|
|
@@ -34886,7 +34886,7 @@ var isBlockedUA = function(ua, customBlockedUserAgents = []) {
|
|
|
34886
34886
|
return uaLower.indexOf(blockedUaLower) !== -1;
|
|
34887
34887
|
});
|
|
34888
34888
|
};
|
|
34889
|
-
//
|
|
34889
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
34890
34890
|
var nativeIsArray = Array.isArray;
|
|
34891
34891
|
var ObjProto = Object.prototype;
|
|
34892
34892
|
var type_utils_hasOwnProperty = ObjProto.hasOwnProperty;
|
|
@@ -34923,7 +34923,7 @@ function isInstanceOf(candidate, base) {
|
|
|
34923
34923
|
}
|
|
34924
34924
|
}
|
|
34925
34925
|
|
|
34926
|
-
//
|
|
34926
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
34927
34927
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
34928
34928
|
if (min > max) {
|
|
34929
34929
|
logger.warn("min cannot be greater than max.");
|
|
@@ -34943,7 +34943,7 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
34943
34943
|
return clampToRange(fallbackValue || max, min, max, logger);
|
|
34944
34944
|
}
|
|
34945
34945
|
|
|
34946
|
-
//
|
|
34946
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
34947
34947
|
var ONE_DAY_IN_MS = 86400000;
|
|
34948
34948
|
|
|
34949
34949
|
class BucketedRateLimiter {
|
|
@@ -34987,7 +34987,7 @@ class BucketedRateLimiter {
|
|
|
34987
34987
|
this._buckets = {};
|
|
34988
34988
|
}
|
|
34989
34989
|
}
|
|
34990
|
-
//
|
|
34990
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
34991
34991
|
class PromiseQueue {
|
|
34992
34992
|
add(promise) {
|
|
34993
34993
|
const promiseUUID = uuidv7();
|
|
@@ -35013,7 +35013,7 @@ class PromiseQueue {
|
|
|
35013
35013
|
this.promiseByIds = {};
|
|
35014
35014
|
}
|
|
35015
35015
|
}
|
|
35016
|
-
//
|
|
35016
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/logger.mjs
|
|
35017
35017
|
function createConsole(consoleLike = console) {
|
|
35018
35018
|
const lockedMethods = {
|
|
35019
35019
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -35051,7 +35051,7 @@ var passThrough = (fn) => fn();
|
|
|
35051
35051
|
function createLogger(prefix, maybeCall = passThrough) {
|
|
35052
35052
|
return _createLogger(prefix, maybeCall, createConsole());
|
|
35053
35053
|
}
|
|
35054
|
-
//
|
|
35054
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
35055
35055
|
var MOBILE = "Mobile";
|
|
35056
35056
|
var IOS = "iOS";
|
|
35057
35057
|
var ANDROID = "Android";
|
|
@@ -35308,7 +35308,7 @@ var osMatchers = [
|
|
|
35308
35308
|
]
|
|
35309
35309
|
];
|
|
35310
35310
|
|
|
35311
|
-
//
|
|
35311
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/utils/index.mjs
|
|
35312
35312
|
var STRING_FORMAT = "utf8";
|
|
35313
35313
|
function assert(truthyValue, message) {
|
|
35314
35314
|
if (!truthyValue || typeof truthyValue != "string" || isEmpty(truthyValue))
|
|
@@ -35356,7 +35356,7 @@ function allSettled(promises) {
|
|
|
35356
35356
|
reason
|
|
35357
35357
|
}))));
|
|
35358
35358
|
}
|
|
35359
|
-
//
|
|
35359
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/eventemitter.mjs
|
|
35360
35360
|
class SimpleEventEmitter {
|
|
35361
35361
|
constructor() {
|
|
35362
35362
|
this.events = {};
|
|
@@ -35378,7 +35378,7 @@ class SimpleEventEmitter {
|
|
|
35378
35378
|
}
|
|
35379
35379
|
}
|
|
35380
35380
|
|
|
35381
|
-
//
|
|
35381
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
35382
35382
|
class PostHogFetchHttpError extends Error {
|
|
35383
35383
|
constructor(response, reqByteLength) {
|
|
35384
35384
|
super("HTTP error while fetching PostHog: status=" + response.status + ", reqByteLength=" + reqByteLength), this.response = response, this.reqByteLength = reqByteLength, this.name = "PostHogFetchHttpError";
|
|
@@ -36093,7 +36093,7 @@ class PostHogCoreStateless {
|
|
|
36093
36093
|
return this.shutdownPromise;
|
|
36094
36094
|
}
|
|
36095
36095
|
}
|
|
36096
|
-
//
|
|
36096
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
36097
36097
|
var exports_error_tracking = {};
|
|
36098
36098
|
__export(exports_error_tracking, {
|
|
36099
36099
|
winjsStackLineParser: () => winjsStackLineParser,
|
|
@@ -36117,7 +36117,7 @@ __export(exports_error_tracking, {
|
|
|
36117
36117
|
DOMExceptionCoercer: () => DOMExceptionCoercer
|
|
36118
36118
|
});
|
|
36119
36119
|
|
|
36120
|
-
//
|
|
36120
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
36121
36121
|
var parsedStackResults;
|
|
36122
36122
|
var lastKeysCount;
|
|
36123
36123
|
var cachedFilenameChunkIds;
|
|
@@ -36156,7 +36156,7 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
36156
36156
|
return cachedFilenameChunkIds;
|
|
36157
36157
|
}
|
|
36158
36158
|
|
|
36159
|
-
//
|
|
36159
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
36160
36160
|
var MAX_CAUSE_RECURSION = 4;
|
|
36161
36161
|
|
|
36162
36162
|
class ErrorPropertiesBuilder {
|
|
@@ -36278,7 +36278,7 @@ class ErrorPropertiesBuilder {
|
|
|
36278
36278
|
return context;
|
|
36279
36279
|
}
|
|
36280
36280
|
}
|
|
36281
|
-
//
|
|
36281
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
36282
36282
|
var UNKNOWN_FUNCTION = "?";
|
|
36283
36283
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
36284
36284
|
const frame = {
|
|
@@ -36294,7 +36294,7 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
36294
36294
|
return frame;
|
|
36295
36295
|
}
|
|
36296
36296
|
|
|
36297
|
-
//
|
|
36297
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
36298
36298
|
var extractSafariExtensionDetails = (func, filename) => {
|
|
36299
36299
|
const isSafariExtension = func.indexOf("safari-extension") !== -1;
|
|
36300
36300
|
const isSafariWebExtension = func.indexOf("safari-web-extension") !== -1;
|
|
@@ -36307,7 +36307,7 @@ var extractSafariExtensionDetails = (func, filename) => {
|
|
|
36307
36307
|
];
|
|
36308
36308
|
};
|
|
36309
36309
|
|
|
36310
|
-
//
|
|
36310
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
36311
36311
|
var chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
36312
36312
|
var chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
|
|
36313
36313
|
var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
|
|
@@ -36333,7 +36333,7 @@ var chromeStackLineParser = (line, platform) => {
|
|
|
36333
36333
|
}
|
|
36334
36334
|
};
|
|
36335
36335
|
|
|
36336
|
-
//
|
|
36336
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
36337
36337
|
var geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
36338
36338
|
var geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
36339
36339
|
var geckoStackLineParser = (line, platform) => {
|
|
@@ -36356,14 +36356,14 @@ var geckoStackLineParser = (line, platform) => {
|
|
|
36356
36356
|
}
|
|
36357
36357
|
};
|
|
36358
36358
|
|
|
36359
|
-
//
|
|
36359
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
36360
36360
|
var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
36361
36361
|
var winjsStackLineParser = (line, platform) => {
|
|
36362
36362
|
const parts = winjsRegex.exec(line);
|
|
36363
36363
|
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;
|
|
36364
36364
|
};
|
|
36365
36365
|
|
|
36366
|
-
//
|
|
36366
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
36367
36367
|
var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
36368
36368
|
var opera10StackLineParser = (line, platform) => {
|
|
36369
36369
|
const parts = opera10Regex.exec(line);
|
|
@@ -36375,7 +36375,7 @@ var opera11StackLineParser = (line, platform) => {
|
|
|
36375
36375
|
return parts ? createFrame(platform, parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
|
|
36376
36376
|
};
|
|
36377
36377
|
|
|
36378
|
-
//
|
|
36378
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
36379
36379
|
var FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
36380
36380
|
var FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
36381
36381
|
var nodeStackLineParser = (line, platform) => {
|
|
@@ -36444,7 +36444,7 @@ function _parseIntOrUndefined(input) {
|
|
|
36444
36444
|
return parseInt(input || "", 10) || undefined;
|
|
36445
36445
|
}
|
|
36446
36446
|
|
|
36447
|
-
//
|
|
36447
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
36448
36448
|
var WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
36449
36449
|
var STACKTRACE_FRAME_LIMIT = 50;
|
|
36450
36450
|
function reverseAndStripFrames(stack) {
|
|
@@ -36489,7 +36489,7 @@ function createStackParser(platform, ...parsers) {
|
|
|
36489
36489
|
return reverseAndStripFrames(frames);
|
|
36490
36490
|
};
|
|
36491
36491
|
}
|
|
36492
|
-
//
|
|
36492
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
36493
36493
|
class DOMExceptionCoercer {
|
|
36494
36494
|
match(err) {
|
|
36495
36495
|
return this.isDOMException(err) || this.isDOMError(err);
|
|
@@ -36519,7 +36519,7 @@ class DOMExceptionCoercer {
|
|
|
36519
36519
|
return isBuiltin(err, "DOMError");
|
|
36520
36520
|
}
|
|
36521
36521
|
}
|
|
36522
|
-
//
|
|
36522
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
36523
36523
|
class ErrorCoercer {
|
|
36524
36524
|
match(err) {
|
|
36525
36525
|
return isPlainError(err);
|
|
@@ -36546,7 +36546,7 @@ class ErrorCoercer {
|
|
|
36546
36546
|
return err.stacktrace || err.stack || undefined;
|
|
36547
36547
|
}
|
|
36548
36548
|
}
|
|
36549
|
-
//
|
|
36549
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
36550
36550
|
class ErrorEventCoercer {
|
|
36551
36551
|
constructor() {}
|
|
36552
36552
|
match(err) {
|
|
@@ -36564,7 +36564,7 @@ class ErrorEventCoercer {
|
|
|
36564
36564
|
return exceptionLike;
|
|
36565
36565
|
}
|
|
36566
36566
|
}
|
|
36567
|
-
//
|
|
36567
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
36568
36568
|
var ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
36569
36569
|
|
|
36570
36570
|
class StringCoercer {
|
|
@@ -36594,7 +36594,7 @@ class StringCoercer {
|
|
|
36594
36594
|
];
|
|
36595
36595
|
}
|
|
36596
36596
|
}
|
|
36597
|
-
//
|
|
36597
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
36598
36598
|
var severityLevels = [
|
|
36599
36599
|
"fatal",
|
|
36600
36600
|
"error",
|
|
@@ -36604,7 +36604,7 @@ var severityLevels = [
|
|
|
36604
36604
|
"debug"
|
|
36605
36605
|
];
|
|
36606
36606
|
|
|
36607
|
-
//
|
|
36607
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
36608
36608
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
36609
36609
|
const keys = Object.keys(err);
|
|
36610
36610
|
keys.sort();
|
|
@@ -36621,7 +36621,7 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
36621
36621
|
return "";
|
|
36622
36622
|
}
|
|
36623
36623
|
|
|
36624
|
-
//
|
|
36624
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
36625
36625
|
class ObjectCoercer {
|
|
36626
36626
|
match(candidate) {
|
|
36627
36627
|
return typeof candidate == "object" && candidate !== null;
|
|
@@ -36674,7 +36674,7 @@ class ObjectCoercer {
|
|
|
36674
36674
|
}
|
|
36675
36675
|
}
|
|
36676
36676
|
}
|
|
36677
|
-
//
|
|
36677
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
36678
36678
|
class EventCoercer {
|
|
36679
36679
|
match(err) {
|
|
36680
36680
|
return isEvent(err);
|
|
@@ -36689,7 +36689,7 @@ class EventCoercer {
|
|
|
36689
36689
|
};
|
|
36690
36690
|
}
|
|
36691
36691
|
}
|
|
36692
|
-
//
|
|
36692
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
36693
36693
|
class PrimitiveCoercer {
|
|
36694
36694
|
match(candidate) {
|
|
36695
36695
|
return isPrimitive(candidate);
|
|
@@ -36703,7 +36703,7 @@ class PrimitiveCoercer {
|
|
|
36703
36703
|
};
|
|
36704
36704
|
}
|
|
36705
36705
|
}
|
|
36706
|
-
//
|
|
36706
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
36707
36707
|
class PromiseRejectionEventCoercer {
|
|
36708
36708
|
match(err) {
|
|
36709
36709
|
return isBuiltin(err, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(err);
|
|
@@ -36739,7 +36739,7 @@ class PromiseRejectionEventCoercer {
|
|
|
36739
36739
|
return error;
|
|
36740
36740
|
}
|
|
36741
36741
|
}
|
|
36742
|
-
//
|
|
36742
|
+
// ../../switchroom-sec-1417/node_modules/.bun/@posthog+core@1.25.2/node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
36743
36743
|
class ReduceableCache {
|
|
36744
36744
|
constructor(_maxSize) {
|
|
36745
36745
|
this._maxSize = _maxSize;
|
|
@@ -36764,7 +36764,7 @@ class ReduceableCache {
|
|
|
36764
36764
|
}
|
|
36765
36765
|
}
|
|
36766
36766
|
}
|
|
36767
|
-
//
|
|
36767
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
36768
36768
|
import { createReadStream } from "node:fs";
|
|
36769
36769
|
import { createInterface } from "node:readline";
|
|
36770
36770
|
var LRU_FILE_CONTENTS_CACHE = new exports_error_tracking.ReduceableCache(25);
|
|
@@ -36982,7 +36982,7 @@ function snipLine(line, colno) {
|
|
|
36982
36982
|
return newLine;
|
|
36983
36983
|
}
|
|
36984
36984
|
|
|
36985
|
-
//
|
|
36985
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
36986
36986
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
36987
36987
|
let calledFatalError = false;
|
|
36988
36988
|
return Object.assign((error) => {
|
|
@@ -37014,7 +37014,7 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
37014
37014
|
}));
|
|
37015
37015
|
}
|
|
37016
37016
|
|
|
37017
|
-
//
|
|
37017
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
37018
37018
|
var SHUTDOWN_TIMEOUT = 2000;
|
|
37019
37019
|
|
|
37020
37020
|
class ErrorTracking {
|
|
@@ -37083,10 +37083,10 @@ class ErrorTracking {
|
|
|
37083
37083
|
}
|
|
37084
37084
|
}
|
|
37085
37085
|
|
|
37086
|
-
//
|
|
37086
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/version.mjs
|
|
37087
37087
|
var version = "5.29.2";
|
|
37088
37088
|
|
|
37089
|
-
//
|
|
37089
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/types.mjs
|
|
37090
37090
|
var FeatureFlagError2 = {
|
|
37091
37091
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
37092
37092
|
FLAG_MISSING: "flag_missing",
|
|
@@ -37094,7 +37094,7 @@ var FeatureFlagError2 = {
|
|
|
37094
37094
|
UNKNOWN_ERROR: "unknown_error"
|
|
37095
37095
|
};
|
|
37096
37096
|
|
|
37097
|
-
//
|
|
37097
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
37098
37098
|
async function hashSHA1(text) {
|
|
37099
37099
|
const subtle = globalThis.crypto?.subtle;
|
|
37100
37100
|
if (!subtle)
|
|
@@ -37104,7 +37104,7 @@ async function hashSHA1(text) {
|
|
|
37104
37104
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
37105
37105
|
}
|
|
37106
37106
|
|
|
37107
|
-
//
|
|
37107
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
37108
37108
|
var SIXTY_SECONDS = 60000;
|
|
37109
37109
|
var LONG_SCALE = 1152921504606847000;
|
|
37110
37110
|
var NULL_VALUES_ALLOWED_OPERATORS = [
|
|
@@ -37978,7 +37978,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
37978
37978
|
}
|
|
37979
37979
|
}
|
|
37980
37980
|
|
|
37981
|
-
//
|
|
37981
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/storage-memory.mjs
|
|
37982
37982
|
class PostHogMemoryStorage {
|
|
37983
37983
|
getProperty(key) {
|
|
37984
37984
|
return this._memoryStorage[key];
|
|
@@ -37991,7 +37991,7 @@ class PostHogMemoryStorage {
|
|
|
37991
37991
|
}
|
|
37992
37992
|
}
|
|
37993
37993
|
|
|
37994
|
-
//
|
|
37994
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/client.mjs
|
|
37995
37995
|
var MINIMUM_POLLING_INTERVAL = 100;
|
|
37996
37996
|
var THIRTY_SECONDS = 30000;
|
|
37997
37997
|
var MAX_CACHE_SIZE = 50000;
|
|
@@ -38779,7 +38779,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
38779
38779
|
}
|
|
38780
38780
|
}
|
|
38781
38781
|
|
|
38782
|
-
//
|
|
38782
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/context/context.mjs
|
|
38783
38783
|
import { AsyncLocalStorage as AsyncLocalStorage2 } from "node:async_hooks";
|
|
38784
38784
|
|
|
38785
38785
|
class PostHogContext {
|
|
@@ -38810,7 +38810,7 @@ class PostHogContext {
|
|
|
38810
38810
|
}
|
|
38811
38811
|
}
|
|
38812
38812
|
|
|
38813
|
-
//
|
|
38813
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
38814
38814
|
var NAME = "posthog-node";
|
|
38815
38815
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
38816
38816
|
"error"
|
|
@@ -38878,7 +38878,7 @@ class PostHogSentryIntegration {
|
|
|
38878
38878
|
};
|
|
38879
38879
|
}
|
|
38880
38880
|
}
|
|
38881
|
-
//
|
|
38881
|
+
// ../../switchroom-sec-1417/node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
38882
38882
|
ErrorTracking.errorPropertiesBuilder = new exports_error_tracking.ErrorPropertiesBuilder([
|
|
38883
38883
|
new exports_error_tracking.EventCoercer,
|
|
38884
38884
|
new exports_error_tracking.ErrorCoercer,
|
|
@@ -46206,6 +46206,7 @@ function resolveOutboundTopic(config, event) {
|
|
|
46206
46206
|
}
|
|
46207
46207
|
case "boot":
|
|
46208
46208
|
case "compact-watchdog":
|
|
46209
|
+
case "linear-auth":
|
|
46209
46210
|
if (!inSupergroupMode)
|
|
46210
46211
|
return;
|
|
46211
46212
|
return aliasToId(cfg, ALERTS_ALIAS) ?? cfg.default_topic_id;
|
|
@@ -54460,10 +54461,10 @@ function readTurnActiveMarkerAgeMs(stateDir, now) {
|
|
|
54460
54461
|
}
|
|
54461
54462
|
|
|
54462
54463
|
// ../src/build-info.ts
|
|
54463
|
-
var VERSION = "0.15.
|
|
54464
|
-
var COMMIT_SHA = "
|
|
54465
|
-
var COMMIT_DATE = "2026-06-
|
|
54466
|
-
var LATEST_PR =
|
|
54464
|
+
var VERSION = "0.15.37";
|
|
54465
|
+
var COMMIT_SHA = "bc83a0a6";
|
|
54466
|
+
var COMMIT_DATE = "2026-06-16T10:59:11Z";
|
|
54467
|
+
var LATEST_PR = 2398;
|
|
54467
54468
|
var COMMITS_AHEAD_OF_TAG = 0;
|
|
54468
54469
|
|
|
54469
54470
|
// gateway/boot-version.ts
|
|
@@ -54759,7 +54760,79 @@ init_client2();
|
|
|
54759
54760
|
|
|
54760
54761
|
// ../src/linear/oauth-refresh.ts
|
|
54761
54762
|
var LINEAR_TOKEN_ENDPOINT = "https://api.linear.app/oauth/token";
|
|
54763
|
+
var LINEAR_AUTHORIZE_ENDPOINT = "https://linear.app/oauth/authorize";
|
|
54764
|
+
var LINEAR_AGENT_SCOPES = [
|
|
54765
|
+
"read",
|
|
54766
|
+
"write",
|
|
54767
|
+
"app:assignable",
|
|
54768
|
+
"app:mentionable"
|
|
54769
|
+
];
|
|
54762
54770
|
var DEFAULT_REFRESH_SKEW_SEC = 2 * 3600;
|
|
54771
|
+
function buildLinearAuthorizeUrl(args) {
|
|
54772
|
+
const params = new URLSearchParams({
|
|
54773
|
+
client_id: args.clientId,
|
|
54774
|
+
redirect_uri: args.redirectUri,
|
|
54775
|
+
response_type: "code",
|
|
54776
|
+
scope: (args.scopes ?? LINEAR_AGENT_SCOPES).join(","),
|
|
54777
|
+
actor: "app",
|
|
54778
|
+
prompt: "consent"
|
|
54779
|
+
});
|
|
54780
|
+
if (args.state)
|
|
54781
|
+
params.set("state", args.state);
|
|
54782
|
+
return `${LINEAR_AUTHORIZE_ENDPOINT}?${params.toString()}`;
|
|
54783
|
+
}
|
|
54784
|
+
async function exchangeLinearAuthCode(args, opts = {}) {
|
|
54785
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
54786
|
+
const nowSec = opts.nowSec ?? (() => Math.floor(Date.now() / 1000));
|
|
54787
|
+
const form = new URLSearchParams({
|
|
54788
|
+
grant_type: "authorization_code",
|
|
54789
|
+
code: args.code,
|
|
54790
|
+
client_id: args.clientId,
|
|
54791
|
+
client_secret: args.clientSecret,
|
|
54792
|
+
redirect_uri: args.redirectUri
|
|
54793
|
+
});
|
|
54794
|
+
let resp;
|
|
54795
|
+
try {
|
|
54796
|
+
resp = await fetchImpl(LINEAR_TOKEN_ENDPOINT, {
|
|
54797
|
+
method: "POST",
|
|
54798
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
54799
|
+
body: form.toString()
|
|
54800
|
+
});
|
|
54801
|
+
} catch (err) {
|
|
54802
|
+
return { ok: false, reason: "network", detail: err.message };
|
|
54803
|
+
}
|
|
54804
|
+
if (!resp.ok) {
|
|
54805
|
+
const txt = await resp.text().catch(() => "");
|
|
54806
|
+
const badCode = resp.status === 400 || /invalid_grant|invalid_request/i.test(txt);
|
|
54807
|
+
return {
|
|
54808
|
+
ok: false,
|
|
54809
|
+
reason: badCode ? "bad_code" : "http_error",
|
|
54810
|
+
detail: `HTTP ${resp.status}${txt ? ` ${txt.slice(0, 200)}` : ""}`
|
|
54811
|
+
};
|
|
54812
|
+
}
|
|
54813
|
+
let json;
|
|
54814
|
+
try {
|
|
54815
|
+
json = await resp.json();
|
|
54816
|
+
} catch {
|
|
54817
|
+
return { ok: false, reason: "bad_response", detail: "non-JSON token response" };
|
|
54818
|
+
}
|
|
54819
|
+
const accessToken = json.access_token;
|
|
54820
|
+
if (typeof accessToken !== "string" || accessToken.length === 0) {
|
|
54821
|
+
return { ok: false, reason: "bad_response", detail: "no access_token in response" };
|
|
54822
|
+
}
|
|
54823
|
+
const refreshToken = json.refresh_token;
|
|
54824
|
+
if (typeof refreshToken !== "string" || refreshToken.length === 0) {
|
|
54825
|
+
return { ok: false, reason: "bad_response", detail: "no refresh_token in response (was actor=app + a fresh consent used?)" };
|
|
54826
|
+
}
|
|
54827
|
+
const expiresIn = typeof json.expires_in === "number" ? json.expires_in : 86400;
|
|
54828
|
+
return {
|
|
54829
|
+
ok: true,
|
|
54830
|
+
accessToken,
|
|
54831
|
+
refreshToken,
|
|
54832
|
+
expiresAt: nowSec() + expiresIn,
|
|
54833
|
+
...typeof json.scope === "string" ? { scope: json.scope } : {}
|
|
54834
|
+
};
|
|
54835
|
+
}
|
|
54763
54836
|
async function refreshLinearAppToken(bundle, opts = {}) {
|
|
54764
54837
|
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
54765
54838
|
const nowSec = opts.nowSec ?? (() => Math.floor(Date.now() / 1000));
|
|
@@ -54808,6 +54881,11 @@ async function refreshLinearAppToken(bundle, opts = {}) {
|
|
|
54808
54881
|
...typeof json.scope === "string" ? { scope: json.scope } : {}
|
|
54809
54882
|
};
|
|
54810
54883
|
}
|
|
54884
|
+
function needsRefresh(expiresAt, nowSec, skewSec = DEFAULT_REFRESH_SKEW_SEC) {
|
|
54885
|
+
if (expiresAt == null)
|
|
54886
|
+
return false;
|
|
54887
|
+
return nowSec >= expiresAt - skewSec;
|
|
54888
|
+
}
|
|
54811
54889
|
function parseBundle(raw) {
|
|
54812
54890
|
if (raw == null || raw === "")
|
|
54813
54891
|
return null;
|
|
@@ -54863,6 +54941,17 @@ async function performLinearRefresh(io) {
|
|
|
54863
54941
|
|
|
54864
54942
|
// gateway/linear-activity.ts
|
|
54865
54943
|
var LINEAR_GRAPHQL_ENDPOINT = "https://api.linear.app/graphql";
|
|
54944
|
+
function escapeHtmlMin(s) {
|
|
54945
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
54946
|
+
}
|
|
54947
|
+
function buildLinearAuthDeadMessage(agent, reason) {
|
|
54948
|
+
const a = escapeHtmlMin(agent);
|
|
54949
|
+
const why = reason === "no_bundle" ? `no refresh credentials are stored (<code>linear/${a}/oauth</code> is missing), so its daily-expiring token can't renew` : `its Linear refresh token was revoked`;
|
|
54950
|
+
return `\uD83D\uDD11 <b>Linear auth needs you</b>
|
|
54951
|
+
` + `<b>${a}</b> can't reach Linear \u2014 ${why}. ` + `Its access token will keep failing until you re-authorize.
|
|
54952
|
+
|
|
54953
|
+
` + `Re-auth (actor=app) then run <code>switchroom linear-agent setup --agent ${a} ` + `--token \u2026 --refresh-token \u2026 --client-id \u2026 --client-secret \u2026</code> on the host, ` + `or ask me to walk you through it.`;
|
|
54954
|
+
}
|
|
54866
54955
|
async function defaultResolveLinearToken(agent) {
|
|
54867
54956
|
const key = `linear/${agent}/token`;
|
|
54868
54957
|
const token = readVaultTokenFile(agent) ?? undefined;
|
|
@@ -54899,7 +54988,7 @@ function brokerRefreshIO(agent, fetchImpl) {
|
|
|
54899
54988
|
...fetchImpl ? { fetchImpl } : {}
|
|
54900
54989
|
};
|
|
54901
54990
|
}
|
|
54902
|
-
async function linearPostWithRefresh(body, token, agent, fetchImpl, log, refreshIO) {
|
|
54991
|
+
async function linearPostWithRefresh(body, token, agent, fetchImpl, log, refreshIO, onAuthUnrecoverable) {
|
|
54903
54992
|
const post = (t) => fetchImpl(LINEAR_GRAPHQL_ENDPOINT, {
|
|
54904
54993
|
method: "POST",
|
|
54905
54994
|
headers: { "Content-Type": "application/json", Authorization: t },
|
|
@@ -54914,6 +55003,11 @@ async function linearPostWithRefresh(body, token, agent, fetchImpl, log, refresh
|
|
|
54914
55003
|
if (refreshed.reason === "revoked") {
|
|
54915
55004
|
log(`telegram gateway: linear token REVOKED agent=${agent} \u2014 refresh token is dead; ` + `operator must re-authorize (linear-agent setup --refresh-token \u2026)
|
|
54916
55005
|
`);
|
|
55006
|
+
onAuthUnrecoverable?.({ agent, reason: "revoked", detail: refreshed.detail });
|
|
55007
|
+
} else if (refreshed.reason === "no_bundle") {
|
|
55008
|
+
log(`telegram gateway: linear token DEAD agent=${agent} \u2014 no refresh bundle stored ` + `(linear/${agent}/oauth absent); operator must re-authorize
|
|
55009
|
+
`);
|
|
55010
|
+
onAuthUnrecoverable?.({ agent, reason: "no_bundle", detail: refreshed.detail });
|
|
54917
55011
|
} else {
|
|
54918
55012
|
log(`telegram gateway: linear token refresh failed agent=${agent} reason=${refreshed.reason}
|
|
54919
55013
|
`);
|
|
@@ -54969,7 +55063,7 @@ async function emitLinearAgentActivity(args, deps = {}) {
|
|
|
54969
55063
|
const fetchImpl = deps.fetchImpl ?? fetch;
|
|
54970
55064
|
let resp;
|
|
54971
55065
|
try {
|
|
54972
|
-
({ resp } = await linearPostWithRefresh(JSON.stringify({ query: mutation, variables }), tokenResult.token, agent, fetchImpl, log, deps.refreshIO));
|
|
55066
|
+
({ resp } = await linearPostWithRefresh(JSON.stringify({ query: mutation, variables }), tokenResult.token, agent, fetchImpl, log, deps.refreshIO, deps.onAuthUnrecoverable));
|
|
54973
55067
|
} catch (err) {
|
|
54974
55068
|
return {
|
|
54975
55069
|
content: [{ type: "text", text: `linear_agent_activity failed: request error: ${err.message}` }]
|
|
@@ -55033,7 +55127,7 @@ async function createLinearIssue(args, deps = {}) {
|
|
|
55033
55127
|
const gql = async (query2, variables) => {
|
|
55034
55128
|
let resp;
|
|
55035
55129
|
try {
|
|
55036
|
-
const out = await linearPostWithRefresh(JSON.stringify({ query: query2, variables }), activeToken, agent, fetchImpl, log, deps.refreshIO);
|
|
55130
|
+
const out = await linearPostWithRefresh(JSON.stringify({ query: query2, variables }), activeToken, agent, fetchImpl, log, deps.refreshIO, deps.onAuthUnrecoverable);
|
|
55037
55131
|
resp = out.resp;
|
|
55038
55132
|
activeToken = out.token;
|
|
55039
55133
|
} catch (err) {
|
|
@@ -55102,6 +55196,261 @@ async function createLinearIssue(args, deps = {}) {
|
|
|
55102
55196
|
return { content: [{ type: "text", text: `Filed: ${title} \u2192 ${issue.url}` }] };
|
|
55103
55197
|
}
|
|
55104
55198
|
|
|
55199
|
+
// gateway/linear-setup.ts
|
|
55200
|
+
init_client2();
|
|
55201
|
+
var tokenKey = (agent) => `linear/${agent}/token`;
|
|
55202
|
+
var bundleKey = (agent) => `linear/${agent}/oauth`;
|
|
55203
|
+
function defaultPut(agent, key, value) {
|
|
55204
|
+
const token = readVaultTokenFile(agent) ?? undefined;
|
|
55205
|
+
const opt = token ? { token } : {};
|
|
55206
|
+
return putViaBroker(key, { kind: "string", value }, opt).then((r) => {
|
|
55207
|
+
if (r.kind === "ok")
|
|
55208
|
+
return { kind: "ok" };
|
|
55209
|
+
if (r.kind === "unreachable")
|
|
55210
|
+
return { kind: "unreachable", msg: r.msg };
|
|
55211
|
+
if (r.kind === "not_found")
|
|
55212
|
+
return { kind: "not_found", msg: r.msg };
|
|
55213
|
+
return { kind: "denied", msg: r.msg };
|
|
55214
|
+
});
|
|
55215
|
+
}
|
|
55216
|
+
function text(s) {
|
|
55217
|
+
return { content: [{ type: "text", text: s }] };
|
|
55218
|
+
}
|
|
55219
|
+
function writeGrantGuidance(agent) {
|
|
55220
|
+
return `I need write access to store the Linear credentials. Call:
|
|
55221
|
+
` + `\u2022 vault_request_access(key: "${tokenKey(agent)}", scope: "write", reason: "store Linear app access token")
|
|
55222
|
+
` + `\u2022 vault_request_access(key: "${bundleKey(agent)}", scope: "write", reason: "store Linear OAuth refresh bundle")
|
|
55223
|
+
` + `Once the operator approves both, re-run linear_agent_setup with action "complete" (same code is single-use \u2014 if it expired, re-open the authorize URL first).`;
|
|
55224
|
+
}
|
|
55225
|
+
function durableConfigGuidance(agent) {
|
|
55226
|
+
return `Stored. To make this durable (survive restarts + enable auto-refresh), propose a config edit ` + `(config_propose_edit) that, under agents.${agent}:
|
|
55227
|
+
` + ` \u2022 adds channels.telegram.linear_agent: { enabled: true, token: "vault:${tokenKey(agent)}" }
|
|
55228
|
+
` + ` \u2022 adds "${tokenKey(agent)}" and "${bundleKey(agent)}" to secrets[]
|
|
55229
|
+
` + `Then the operator approves it and you restart to pick up the linear_agent block.`;
|
|
55230
|
+
}
|
|
55231
|
+
async function runLinearAgentSetup(args, deps = {}) {
|
|
55232
|
+
const log = deps.log ?? ((s) => process.stderr.write(s));
|
|
55233
|
+
const agent = deps.agent ?? process.env.SWITCHROOM_AGENT_NAME ?? "-";
|
|
55234
|
+
if (agent === "-" || !/^[a-z][a-z0-9_-]{0,63}$/.test(agent)) {
|
|
55235
|
+
return text(`linear_agent_setup failed: could not resolve a valid agent name (got '${agent}').`);
|
|
55236
|
+
}
|
|
55237
|
+
const action = args.action;
|
|
55238
|
+
if (action !== "authorize_url" && action !== "complete") {
|
|
55239
|
+
return text(`linear_agent_setup failed: action must be "authorize_url" or "complete".`);
|
|
55240
|
+
}
|
|
55241
|
+
const clientId = args.client_id?.trim();
|
|
55242
|
+
const redirectUri = args.redirect_uri?.trim();
|
|
55243
|
+
if (!clientId)
|
|
55244
|
+
return text("linear_agent_setup failed: client_id is required.");
|
|
55245
|
+
if (!redirectUri || !/^https?:\/\//.test(redirectUri)) {
|
|
55246
|
+
return text("linear_agent_setup failed: redirect_uri is required and must be an http(s) URL registered on the Linear OAuth app.");
|
|
55247
|
+
}
|
|
55248
|
+
if (action === "authorize_url") {
|
|
55249
|
+
const url = buildLinearAuthorizeUrl({ clientId, redirectUri });
|
|
55250
|
+
return text(`Open this URL in a browser to authorize <b>${agent}</b> as a Linear app actor (actor=app):
|
|
55251
|
+
|
|
55252
|
+
${url}
|
|
55253
|
+
|
|
55254
|
+
` + `After you approve, Linear redirects to ${redirectUri}?code=\u2026 (it may show a blank/error page \u2014 that's fine). ` + `Copy the code value from the URL bar, then run linear_agent_setup with action "complete", the same client_id + redirect_uri, ` + `your client_secret, and that code.`);
|
|
55255
|
+
}
|
|
55256
|
+
const clientSecret = args.client_secret?.trim();
|
|
55257
|
+
const code = args.code?.trim();
|
|
55258
|
+
if (!clientSecret)
|
|
55259
|
+
return text('linear_agent_setup failed: client_secret is required for action "complete".');
|
|
55260
|
+
if (!code)
|
|
55261
|
+
return text('linear_agent_setup failed: code (from the redirect URL) is required for action "complete".');
|
|
55262
|
+
const exchanged = await exchangeLinearAuthCode({ clientId, clientSecret, code, redirectUri }, deps.fetchImpl ? { fetchImpl: deps.fetchImpl } : {});
|
|
55263
|
+
if (!exchanged.ok) {
|
|
55264
|
+
log(`telegram gateway: linear_agent_setup exchange failed agent=${agent} reason=${exchanged.reason}
|
|
55265
|
+
`);
|
|
55266
|
+
if (exchanged.reason === "bad_code") {
|
|
55267
|
+
return text(`linear_agent_setup failed: Linear rejected the authorization code (expired, already used, or wrong redirect_uri). ` + `Re-run action "authorize_url", open the fresh URL, and copy a new code.`);
|
|
55268
|
+
}
|
|
55269
|
+
return text(`linear_agent_setup failed: token exchange ${exchanged.reason} \u2014 ${exchanged.detail}. Retry shortly.`);
|
|
55270
|
+
}
|
|
55271
|
+
const bundle = serializeBundle({
|
|
55272
|
+
clientId,
|
|
55273
|
+
clientSecret,
|
|
55274
|
+
refreshToken: exchanged.refreshToken,
|
|
55275
|
+
expiresAt: exchanged.expiresAt
|
|
55276
|
+
});
|
|
55277
|
+
const putBundle = deps.putBundle ?? ((a, j) => defaultPut(a, bundleKey(a), j));
|
|
55278
|
+
const putToken = deps.putToken ?? ((a, t2) => defaultPut(a, tokenKey(a), t2));
|
|
55279
|
+
const b = await putBundle(agent, bundle);
|
|
55280
|
+
if (b.kind !== "ok") {
|
|
55281
|
+
if (b.kind === "not_found" || b.kind === "denied") {
|
|
55282
|
+
return text(writeGrantGuidance(agent));
|
|
55283
|
+
}
|
|
55284
|
+
log(`telegram gateway: linear_agent_setup bundle write ${b.kind} agent=${agent}
|
|
55285
|
+
`);
|
|
55286
|
+
return text(`linear_agent_setup failed: couldn't store the refresh bundle (broker ${b.kind}: ${b.msg}).`);
|
|
55287
|
+
}
|
|
55288
|
+
const t = await putToken(agent, exchanged.accessToken);
|
|
55289
|
+
if (t.kind !== "ok") {
|
|
55290
|
+
if (t.kind === "not_found" || t.kind === "denied") {
|
|
55291
|
+
return text(writeGrantGuidance(agent));
|
|
55292
|
+
}
|
|
55293
|
+
log(`telegram gateway: linear_agent_setup token write ${t.kind} agent=${agent}
|
|
55294
|
+
`);
|
|
55295
|
+
return text(`linear_agent_setup failed: couldn't store the access token (broker ${t.kind}: ${t.msg}).`);
|
|
55296
|
+
}
|
|
55297
|
+
const hours = Math.max(1, Math.round((exchanged.expiresAt - Date.now() / 1000) / 3600));
|
|
55298
|
+
log(`telegram gateway: linear_agent_setup stored token+bundle agent=${agent} (expires ~${hours}h)
|
|
55299
|
+
`);
|
|
55300
|
+
return text(`\u2705 Linear app token + refresh bundle stored for ${agent} (access token expires in ~${hours}h; it now auto-renews).
|
|
55301
|
+
|
|
55302
|
+
` + durableConfigGuidance(agent));
|
|
55303
|
+
}
|
|
55304
|
+
|
|
55305
|
+
// gateway/linear-auth-watch.ts
|
|
55306
|
+
async function runLinearAuthCheck(deps) {
|
|
55307
|
+
const log = deps.log ?? (() => {});
|
|
55308
|
+
if (!deps.linearEnabled())
|
|
55309
|
+
return "disabled";
|
|
55310
|
+
let raw;
|
|
55311
|
+
try {
|
|
55312
|
+
raw = await deps.readBundle();
|
|
55313
|
+
} catch (err) {
|
|
55314
|
+
log(`telegram gateway: linear-auth-watch agent=${deps.agent} bundle read error: ${err.message}
|
|
55315
|
+
`);
|
|
55316
|
+
return "refresh_failed";
|
|
55317
|
+
}
|
|
55318
|
+
const bundle = parseBundle(raw);
|
|
55319
|
+
if (!bundle) {
|
|
55320
|
+
log(`telegram gateway: linear-auth-watch agent=${deps.agent} \u2014 no refresh bundle (proactive)
|
|
55321
|
+
`);
|
|
55322
|
+
deps.onAuthDead({ agent: deps.agent, reason: "no_bundle", detail: "proactive watch: linear/<agent>/oauth missing or invalid" });
|
|
55323
|
+
return "no_bundle";
|
|
55324
|
+
}
|
|
55325
|
+
const now = deps.nowSec ? deps.nowSec() : Math.floor(Date.now() / 1000);
|
|
55326
|
+
if (!needsRefresh(bundle.expiresAt, now)) {
|
|
55327
|
+
return "fresh";
|
|
55328
|
+
}
|
|
55329
|
+
const res = await deps.refresh();
|
|
55330
|
+
if (res.ok) {
|
|
55331
|
+
log(`telegram gateway: linear-auth-watch agent=${deps.agent} proactively refreshed (was near expiry)
|
|
55332
|
+
`);
|
|
55333
|
+
return "refreshed";
|
|
55334
|
+
}
|
|
55335
|
+
if (res.reason === "revoked") {
|
|
55336
|
+
log(`telegram gateway: linear-auth-watch agent=${deps.agent} refresh REVOKED (proactive)
|
|
55337
|
+
`);
|
|
55338
|
+
deps.onAuthDead({ agent: deps.agent, reason: "revoked", detail: res.detail });
|
|
55339
|
+
return "revoked";
|
|
55340
|
+
}
|
|
55341
|
+
if (res.reason === "no_bundle") {
|
|
55342
|
+
deps.onAuthDead({ agent: deps.agent, reason: "no_bundle", detail: res.detail });
|
|
55343
|
+
return "no_bundle";
|
|
55344
|
+
}
|
|
55345
|
+
log(`telegram gateway: linear-auth-watch agent=${deps.agent} proactive refresh failed reason=${res.reason}
|
|
55346
|
+
`);
|
|
55347
|
+
return "refresh_failed";
|
|
55348
|
+
}
|
|
55349
|
+
|
|
55350
|
+
// ../src/linear/oauth-refresh.ts
|
|
55351
|
+
var LINEAR_TOKEN_ENDPOINT2 = "https://api.linear.app/oauth/token";
|
|
55352
|
+
var DEFAULT_REFRESH_SKEW_SEC2 = 2 * 3600;
|
|
55353
|
+
async function refreshLinearAppToken2(bundle, opts = {}) {
|
|
55354
|
+
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
55355
|
+
const nowSec = opts.nowSec ?? (() => Math.floor(Date.now() / 1000));
|
|
55356
|
+
const form = new URLSearchParams({
|
|
55357
|
+
grant_type: "refresh_token",
|
|
55358
|
+
refresh_token: bundle.refreshToken,
|
|
55359
|
+
client_id: bundle.clientId,
|
|
55360
|
+
client_secret: bundle.clientSecret
|
|
55361
|
+
});
|
|
55362
|
+
let resp;
|
|
55363
|
+
try {
|
|
55364
|
+
resp = await fetchImpl(LINEAR_TOKEN_ENDPOINT2, {
|
|
55365
|
+
method: "POST",
|
|
55366
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
55367
|
+
body: form.toString()
|
|
55368
|
+
});
|
|
55369
|
+
} catch (err) {
|
|
55370
|
+
return { ok: false, reason: "network", detail: err.message };
|
|
55371
|
+
}
|
|
55372
|
+
if (!resp.ok) {
|
|
55373
|
+
const txt = await resp.text().catch(() => "");
|
|
55374
|
+
const revoked = resp.status === 400 || /invalid_grant|invalid_token/i.test(txt);
|
|
55375
|
+
return {
|
|
55376
|
+
ok: false,
|
|
55377
|
+
reason: revoked ? "revoked" : "http_error",
|
|
55378
|
+
detail: `HTTP ${resp.status}${txt ? ` ${txt.slice(0, 200)}` : ""}`
|
|
55379
|
+
};
|
|
55380
|
+
}
|
|
55381
|
+
let json;
|
|
55382
|
+
try {
|
|
55383
|
+
json = await resp.json();
|
|
55384
|
+
} catch {
|
|
55385
|
+
return { ok: false, reason: "bad_response", detail: "non-JSON token response" };
|
|
55386
|
+
}
|
|
55387
|
+
const accessToken = json.access_token;
|
|
55388
|
+
if (typeof accessToken !== "string" || accessToken.length === 0) {
|
|
55389
|
+
return { ok: false, reason: "bad_response", detail: "no access_token in response" };
|
|
55390
|
+
}
|
|
55391
|
+
const expiresIn = typeof json.expires_in === "number" ? json.expires_in : 86400;
|
|
55392
|
+
const rotated = typeof json.refresh_token === "string" && json.refresh_token.length > 0 ? json.refresh_token : bundle.refreshToken;
|
|
55393
|
+
return {
|
|
55394
|
+
ok: true,
|
|
55395
|
+
accessToken,
|
|
55396
|
+
refreshToken: rotated,
|
|
55397
|
+
expiresAt: nowSec() + expiresIn,
|
|
55398
|
+
...typeof json.scope === "string" ? { scope: json.scope } : {}
|
|
55399
|
+
};
|
|
55400
|
+
}
|
|
55401
|
+
function parseBundle2(raw) {
|
|
55402
|
+
if (raw == null || raw === "")
|
|
55403
|
+
return null;
|
|
55404
|
+
let o;
|
|
55405
|
+
try {
|
|
55406
|
+
o = JSON.parse(raw);
|
|
55407
|
+
} catch {
|
|
55408
|
+
return null;
|
|
55409
|
+
}
|
|
55410
|
+
if (typeof o.client_id === "string" && typeof o.client_secret === "string" && typeof o.refresh_token === "string" && o.client_id.length > 0 && o.client_secret.length > 0 && o.refresh_token.length > 0) {
|
|
55411
|
+
return {
|
|
55412
|
+
clientId: o.client_id,
|
|
55413
|
+
clientSecret: o.client_secret,
|
|
55414
|
+
refreshToken: o.refresh_token,
|
|
55415
|
+
...typeof o.expires_at === "number" ? { expiresAt: o.expires_at } : {}
|
|
55416
|
+
};
|
|
55417
|
+
}
|
|
55418
|
+
return null;
|
|
55419
|
+
}
|
|
55420
|
+
function serializeBundle2(b) {
|
|
55421
|
+
return JSON.stringify({
|
|
55422
|
+
client_id: b.clientId,
|
|
55423
|
+
client_secret: b.clientSecret,
|
|
55424
|
+
refresh_token: b.refreshToken,
|
|
55425
|
+
...b.expiresAt != null ? { expires_at: b.expiresAt } : {}
|
|
55426
|
+
});
|
|
55427
|
+
}
|
|
55428
|
+
async function performLinearRefresh2(io) {
|
|
55429
|
+
const raw = await io.readBundle();
|
|
55430
|
+
const bundle = parseBundle2(raw);
|
|
55431
|
+
if (!bundle) {
|
|
55432
|
+
return { ok: false, reason: "no_bundle", detail: "no/invalid refresh bundle" };
|
|
55433
|
+
}
|
|
55434
|
+
const res = await refreshLinearAppToken2(bundle, {
|
|
55435
|
+
...io.fetchImpl ? { fetchImpl: io.fetchImpl } : {},
|
|
55436
|
+
...io.nowSec ? { nowSec: io.nowSec } : {}
|
|
55437
|
+
});
|
|
55438
|
+
if (!res.ok)
|
|
55439
|
+
return { ok: false, reason: res.reason, detail: res.detail };
|
|
55440
|
+
try {
|
|
55441
|
+
await io.writeBundle(serializeBundle2({
|
|
55442
|
+
clientId: bundle.clientId,
|
|
55443
|
+
clientSecret: bundle.clientSecret,
|
|
55444
|
+
refreshToken: res.refreshToken,
|
|
55445
|
+
expiresAt: res.expiresAt
|
|
55446
|
+
}));
|
|
55447
|
+
await io.writeToken(res.accessToken);
|
|
55448
|
+
} catch (err) {
|
|
55449
|
+
return { ok: false, reason: "persist_failed", detail: err.message };
|
|
55450
|
+
}
|
|
55451
|
+
return { ok: true, accessToken: res.accessToken, expiresAt: res.expiresAt };
|
|
55452
|
+
}
|
|
55453
|
+
|
|
55105
55454
|
// vault-approval-posture.ts
|
|
55106
55455
|
function resolveVaultApprovalPosture(broker) {
|
|
55107
55456
|
if (broker?.approvalAuth === "telegram-id") {
|
|
@@ -55637,10 +55986,10 @@ var GRAMMY_VERSION = (() => {
|
|
|
55637
55986
|
return "unknown";
|
|
55638
55987
|
}
|
|
55639
55988
|
})();
|
|
55640
|
-
var sendMessageDraftFn = !DRAFT_ANSWER_LANE_RETIRED && typeof _rawSendMessageDraft === "function" ? (chatId, draftId,
|
|
55989
|
+
var sendMessageDraftFn = !DRAFT_ANSWER_LANE_RETIRED && typeof _rawSendMessageDraft === "function" ? (chatId, draftId, text2, params) => _rawSendMessageDraft({
|
|
55641
55990
|
chat_id: Number(chatId),
|
|
55642
55991
|
draft_id: draftId,
|
|
55643
|
-
text,
|
|
55992
|
+
text: text2,
|
|
55644
55993
|
...params ?? {}
|
|
55645
55994
|
}) : undefined;
|
|
55646
55995
|
var _rawSendChecklist = bot.api.raw.sendChecklist;
|
|
@@ -56262,9 +56611,9 @@ function postQueuedStatus(chatId, bufferedThread, inFlightThread) {
|
|
|
56262
56611
|
if (queuedStatusMsgIds.has(key))
|
|
56263
56612
|
return;
|
|
56264
56613
|
const otherTopic = inFlightThread != null ? `another topic` : `another conversation`;
|
|
56265
|
-
const
|
|
56614
|
+
const text2 = `\u23F3 Queued \u2014 replying in ${otherTopic} first, then I'll get to this.`;
|
|
56266
56615
|
(async () => {
|
|
56267
|
-
const sent = await swallowingApiCall(() => bot.api.sendMessage(chatId,
|
|
56616
|
+
const sent = await swallowingApiCall(() => bot.api.sendMessage(chatId, text2, { message_thread_id: bufferedThread }), { chat_id: chatId, verb: "queued-status.post", threadId: bufferedThread });
|
|
56268
56617
|
const messageId = sent?.message_id;
|
|
56269
56618
|
if (typeof messageId !== "number")
|
|
56270
56619
|
return;
|
|
@@ -56558,9 +56907,9 @@ async function postCompactCard(occ, cap) {
|
|
|
56558
56907
|
resolvedTopic: resolveAgentOutboundTopic({ kind: "compact-watchdog" }) ?? chatThreadMap.get(chatId),
|
|
56559
56908
|
supergroupChatId: resolveAgentSupergroupChatId()
|
|
56560
56909
|
});
|
|
56561
|
-
const
|
|
56910
|
+
const text2 = `\uD83D\uDDDC\uFE0F <b>Context compaction</b>
|
|
56562
56911
|
` + `Working context hit ~${occ.toLocaleString()} tokens (cap ${cap.toLocaleString()}) \u2014 running <code>/compact</code>. ` + `Older detail moves to Hindsight; I'll confirm here once the context has shrunk (may take a turn or two).`;
|
|
56563
|
-
const sent = await swallowingApiCall(() => bot.api.sendMessage(chatId,
|
|
56912
|
+
const sent = await swallowingApiCall(() => bot.api.sendMessage(chatId, text2, {
|
|
56564
56913
|
parse_mode: "HTML",
|
|
56565
56914
|
...threadId != null ? { message_thread_id: threadId } : {}
|
|
56566
56915
|
}), { chat_id: chatId, verb: "proactiveCompact.start" });
|
|
@@ -56592,19 +56941,19 @@ async function resolveCompactCard(kind, occNow) {
|
|
|
56592
56941
|
clearTimeout(card.timer);
|
|
56593
56942
|
if (kind === "timeout")
|
|
56594
56943
|
compactNotifyState = idleCompactNotifyState();
|
|
56595
|
-
let
|
|
56944
|
+
let text2;
|
|
56596
56945
|
if (kind === "finished") {
|
|
56597
|
-
|
|
56946
|
+
text2 = `\u2705 <b>Context compacted</b>
|
|
56598
56947
|
` + `Working context reduced` + (occNow != null ? ` (~${card.occAtStart.toLocaleString()} \u2192 ` + `~${occNow.toLocaleString()} tokens)` : "") + `. Hindsight retains the detail.`;
|
|
56599
56948
|
} else if (kind === "superseded") {
|
|
56600
|
-
|
|
56949
|
+
text2 = `\u21A9\uFE0F <b>Context compaction superseded</b>
|
|
56601
56950
|
` + `A newer compaction started before this one confirmed.`;
|
|
56602
56951
|
} else {
|
|
56603
|
-
|
|
56952
|
+
text2 = `\u26A0\uFE0F <b>Compaction issued</b>
|
|
56604
56953
|
` + `<code>/compact</code> was requested but the context isn't confirmed reduced yet. Native compaction and Hindsight still apply.`;
|
|
56605
56954
|
}
|
|
56606
56955
|
try {
|
|
56607
|
-
await swallowingApiCall(() => bot.api.editMessageText(card.chatId, card.messageId,
|
|
56956
|
+
await swallowingApiCall(() => bot.api.editMessageText(card.chatId, card.messageId, text2, {
|
|
56608
56957
|
parse_mode: "HTML"
|
|
56609
56958
|
}), { chat_id: card.chatId, verb: `proactiveCompact.${kind}` });
|
|
56610
56959
|
} catch (err) {
|
|
@@ -56662,7 +57011,7 @@ function resolvePermissionCardTargets() {
|
|
|
56662
57011
|
function postPermissionResumeMessage(opts) {
|
|
56663
57012
|
if (process.env.SWITCHROOM_RESUME_MSG === "0")
|
|
56664
57013
|
return;
|
|
56665
|
-
const
|
|
57014
|
+
const text2 = formatPermissionResumeMessage({
|
|
56666
57015
|
agentName: process.env.SWITCHROOM_AGENT_NAME ?? null,
|
|
56667
57016
|
behavior: opts.behavior,
|
|
56668
57017
|
action: opts.action,
|
|
@@ -56670,7 +57019,7 @@ function postPermissionResumeMessage(opts) {
|
|
|
56670
57019
|
});
|
|
56671
57020
|
const targets = resolvePermissionCardTargets();
|
|
56672
57021
|
for (const { chatId, threadId } of targets) {
|
|
56673
|
-
swallowingApiCall(() => bot.api.sendMessage(chatId,
|
|
57022
|
+
swallowingApiCall(() => bot.api.sendMessage(chatId, text2, {
|
|
56674
57023
|
parse_mode: "HTML",
|
|
56675
57024
|
...threadId != null ? { message_thread_id: threadId } : {}
|
|
56676
57025
|
}), { chat_id: chatId, verb: "permission-resume", ...threadId != null ? { threadId } : {} });
|
|
@@ -56712,11 +57061,11 @@ function probeAvailableReactions(chatId) {
|
|
|
56712
57061
|
})();
|
|
56713
57062
|
}
|
|
56714
57063
|
var PHOTO_EXTS = new Set([".jpg", ".jpeg", ".png", ".gif", ".webp"]);
|
|
56715
|
-
function chunk2(
|
|
56716
|
-
if (
|
|
56717
|
-
return [
|
|
57064
|
+
function chunk2(text2, limit, mode) {
|
|
57065
|
+
if (text2.length <= limit)
|
|
57066
|
+
return [text2];
|
|
56718
57067
|
const out = [];
|
|
56719
|
-
let rest =
|
|
57068
|
+
let rest = text2;
|
|
56720
57069
|
while (rest.length > limit) {
|
|
56721
57070
|
let cut = limit;
|
|
56722
57071
|
if (mode === "newline") {
|
|
@@ -56735,20 +57084,20 @@ function chunk2(text, limit, mode) {
|
|
|
56735
57084
|
out.push(rest);
|
|
56736
57085
|
return out;
|
|
56737
57086
|
}
|
|
56738
|
-
function escapeMarkdownV2(
|
|
57087
|
+
function escapeMarkdownV2(text2) {
|
|
56739
57088
|
const specialChars = /[_*\[\]()~`>#+\-=|{}.!\\]/g;
|
|
56740
57089
|
const parts = [];
|
|
56741
57090
|
let last = 0;
|
|
56742
57091
|
const codeRe = /(```[\s\S]*?```|`[^`\n]+`)/g;
|
|
56743
57092
|
let m;
|
|
56744
|
-
while ((m = codeRe.exec(
|
|
57093
|
+
while ((m = codeRe.exec(text2)) !== null) {
|
|
56745
57094
|
if (m.index > last)
|
|
56746
|
-
parts.push(
|
|
57095
|
+
parts.push(text2.slice(last, m.index).replace(specialChars, "\\$&"));
|
|
56747
57096
|
parts.push(m[0]);
|
|
56748
57097
|
last = m.index + m[0].length;
|
|
56749
57098
|
}
|
|
56750
|
-
if (last <
|
|
56751
|
-
parts.push(
|
|
57099
|
+
if (last < text2.length)
|
|
57100
|
+
parts.push(text2.slice(last).replace(specialChars, "\\$&"));
|
|
56752
57101
|
return parts.join("");
|
|
56753
57102
|
}
|
|
56754
57103
|
var typingIntervals = new Map;
|
|
@@ -56839,14 +57188,14 @@ function wrapBootCardApi(threadId) {
|
|
|
56839
57188
|
...threadId != null ? { threadId } : {}
|
|
56840
57189
|
});
|
|
56841
57190
|
return {
|
|
56842
|
-
sendMessage: async (cid,
|
|
56843
|
-
const sent = await robustApiCall(() => lockedBot.api.sendMessage(cid,
|
|
57191
|
+
sendMessage: async (cid, text2, sendOpts) => {
|
|
57192
|
+
const sent = await robustApiCall(() => lockedBot.api.sendMessage(cid, text2, sendOpts), opts(cid));
|
|
56844
57193
|
return sent;
|
|
56845
57194
|
},
|
|
56846
|
-
editMessageText: (cid, mid,
|
|
56847
|
-
editMessageTextStrict: async (cid, mid,
|
|
57195
|
+
editMessageText: (cid, mid, text2, editOpts) => robustApiCall(() => lockedBot.api.editMessageText(cid, mid, text2, editOpts), opts(cid)),
|
|
57196
|
+
editMessageTextStrict: async (cid, mid, text2, editOpts) => {
|
|
56848
57197
|
try {
|
|
56849
|
-
await lockedBot.api.editMessageText(cid, mid,
|
|
57198
|
+
await lockedBot.api.editMessageText(cid, mid, text2, editOpts);
|
|
56850
57199
|
return "edited";
|
|
56851
57200
|
} catch (err) {
|
|
56852
57201
|
const desc = err instanceof import_grammy9.GrammyError ? err.description : err instanceof Error ? err.message : String(err);
|
|
@@ -56864,11 +57213,11 @@ function wrapIssuesCardApi(threadId) {
|
|
|
56864
57213
|
...threadId != null ? { threadId } : {}
|
|
56865
57214
|
});
|
|
56866
57215
|
return {
|
|
56867
|
-
sendMessage: async (cid,
|
|
56868
|
-
const sent = await robustApiCall(() => lockedBot.api.sendMessage(cid,
|
|
57216
|
+
sendMessage: async (cid, text2, sendOpts) => {
|
|
57217
|
+
const sent = await robustApiCall(() => lockedBot.api.sendMessage(cid, text2, sendOpts), opts(cid));
|
|
56869
57218
|
return sent;
|
|
56870
57219
|
},
|
|
56871
|
-
editMessageText: (cid, mid,
|
|
57220
|
+
editMessageText: (cid, mid, text2, editOpts) => robustApiCall(() => lockedBot.api.editMessageText(cid, mid, text2, editOpts), opts(cid)),
|
|
56872
57221
|
deleteMessage: (cid, mid) => robustApiCall(() => lockedBot.api.deleteMessage(cid, mid), opts(cid))
|
|
56873
57222
|
};
|
|
56874
57223
|
}
|
|
@@ -57167,8 +57516,8 @@ var pendingStateReaper = setInterval(() => {
|
|
|
57167
57516
|
}
|
|
57168
57517
|
}, 60000);
|
|
57169
57518
|
pendingStateReaper.unref();
|
|
57170
|
-
function looksLikeAuthCode(
|
|
57171
|
-
const trimmed =
|
|
57519
|
+
function looksLikeAuthCode(text2) {
|
|
57520
|
+
const trimmed = text2.trim();
|
|
57172
57521
|
if (!trimmed || /\s/.test(trimmed))
|
|
57173
57522
|
return false;
|
|
57174
57523
|
if (trimmed.startsWith("session_"))
|
|
@@ -57266,10 +57615,10 @@ function emitGatewayOperatorEvent(event) {
|
|
|
57266
57615
|
}
|
|
57267
57616
|
}
|
|
57268
57617
|
function postLegacyBanner(chatId, threadId, ackMessageId, ageSec, site) {
|
|
57269
|
-
const
|
|
57618
|
+
const text2 = `\uD83C\uDF9B\uFE0F Switchroom restarted \u2014 ready. (took ~${ageSec}s)`;
|
|
57270
57619
|
process.stderr.write(`telegram gateway: ${site}: posting legacy banner chat_id=${chatId}
|
|
57271
57620
|
`);
|
|
57272
|
-
retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chatId,
|
|
57621
|
+
retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chatId, text2, {
|
|
57273
57622
|
parse_mode: "HTML",
|
|
57274
57623
|
link_preview_options: { is_disabled: true },
|
|
57275
57624
|
...tid != null ? { message_thread_id: tid } : {},
|
|
@@ -57281,7 +57630,7 @@ function postLegacyBanner(chatId, threadId, ackMessageId, ageSec, site) {
|
|
|
57281
57630
|
chat_id: chatId,
|
|
57282
57631
|
thread_id: threadId ?? null,
|
|
57283
57632
|
message_ids: [sent.message_id],
|
|
57284
|
-
texts: [
|
|
57633
|
+
texts: [text2],
|
|
57285
57634
|
attachment_kinds: []
|
|
57286
57635
|
});
|
|
57287
57636
|
} catch {}
|
|
@@ -57414,22 +57763,22 @@ startTimer({
|
|
|
57414
57763
|
endTurn(ctx.key);
|
|
57415
57764
|
return;
|
|
57416
57765
|
}
|
|
57417
|
-
let
|
|
57766
|
+
let text2 = null;
|
|
57418
57767
|
const upd = inFlightUpdate;
|
|
57419
57768
|
if (upd != null) {
|
|
57420
57769
|
try {
|
|
57421
57770
|
const st = await hostdGetStatusOnce(getMyAgentName(), upd.requestId);
|
|
57422
57771
|
if (st !== "not-configured" && st !== "unavailable") {
|
|
57423
|
-
|
|
57772
|
+
text2 = formatUpdateStatusLine(st, upd.startedAt, Date.now());
|
|
57424
57773
|
}
|
|
57425
57774
|
} catch {}
|
|
57426
57775
|
}
|
|
57427
|
-
if (
|
|
57776
|
+
if (text2 == null) {
|
|
57428
57777
|
const blockedOnApproval = activeStatusReactions.get(statusKey(ctx.chatId, ctx.threadId))?.isAwaiting() ?? false;
|
|
57429
|
-
|
|
57778
|
+
text2 = formatFrameworkFallbackText(ctx.fallbackKind, ctx.silenceMs, ctx.inFlightTools, blockedOnApproval);
|
|
57430
57779
|
}
|
|
57431
57780
|
try {
|
|
57432
|
-
await robustApiCall(() => bot.api.sendMessage(ctx.chatId,
|
|
57781
|
+
await robustApiCall(() => bot.api.sendMessage(ctx.chatId, text2, {
|
|
57433
57782
|
...ctx.threadId != null ? { message_thread_id: ctx.threadId } : {},
|
|
57434
57783
|
disable_notification: false
|
|
57435
57784
|
}), { chat_id: ctx.chatId, ...ctx.threadId != null ? { threadId: ctx.threadId } : {} });
|
|
@@ -57920,7 +58269,7 @@ var ipcServer = createIpcServer({
|
|
|
57920
58269
|
}
|
|
57921
58270
|
}
|
|
57922
58271
|
pendingPermissions.set(requestId, { tool_name: toolName, description, input_preview: inputPreview, startedAt: Date.now() });
|
|
57923
|
-
const
|
|
58272
|
+
const text2 = formatPermissionCardBody({
|
|
57924
58273
|
toolName,
|
|
57925
58274
|
inputPreview,
|
|
57926
58275
|
description,
|
|
@@ -57931,7 +58280,7 @@ var ipcServer = createIpcServer({
|
|
|
57931
58280
|
const activeTurn = currentTurn;
|
|
57932
58281
|
const targets = resolvePermissionCardTargets();
|
|
57933
58282
|
for (const { chatId, threadId } of targets) {
|
|
57934
|
-
retryWithThreadFallback(robustApiCall, (tid) => bot.api.sendMessage(chatId,
|
|
58283
|
+
retryWithThreadFallback(robustApiCall, (tid) => bot.api.sendMessage(chatId, text2, {
|
|
57935
58284
|
parse_mode: "HTML",
|
|
57936
58285
|
reply_markup: keyboard,
|
|
57937
58286
|
...tid != null ? { message_thread_id: tid } : {}
|
|
@@ -58365,7 +58714,8 @@ var ALLOWED_TOOLS = new Set([
|
|
|
58365
58714
|
"vault_request_access",
|
|
58366
58715
|
"request_secret",
|
|
58367
58716
|
"linear_agent_activity",
|
|
58368
|
-
"linear_create_issue"
|
|
58717
|
+
"linear_create_issue",
|
|
58718
|
+
"linear_agent_setup"
|
|
58369
58719
|
]);
|
|
58370
58720
|
async function executeToolCall(tool, args) {
|
|
58371
58721
|
if (!ALLOWED_TOOLS.has(tool)) {
|
|
@@ -58414,6 +58764,8 @@ async function executeToolCall(tool, args) {
|
|
|
58414
58764
|
return executeLinearAgentActivity(args);
|
|
58415
58765
|
case "linear_create_issue":
|
|
58416
58766
|
return executeLinearCreateIssue(args);
|
|
58767
|
+
case "linear_agent_setup":
|
|
58768
|
+
return executeLinearAgentSetup(args);
|
|
58417
58769
|
default:
|
|
58418
58770
|
throw new Error(`unknown tool: ${tool}`);
|
|
58419
58771
|
}
|
|
@@ -58444,11 +58796,45 @@ async function executeSendChecklist(args) {
|
|
|
58444
58796
|
`);
|
|
58445
58797
|
return { content: [{ type: "text", text: `checklist sent (id: ${sent.message_id})` }] };
|
|
58446
58798
|
}
|
|
58799
|
+
var linearAuthAlertLast = new Map;
|
|
58800
|
+
var LINEAR_AUTH_ALERT_COOLDOWN_MS = 21600000;
|
|
58801
|
+
function notifyLinearAuthDead(info) {
|
|
58802
|
+
if (process.env.SWITCHROOM_LINEAR_AUTH_ALERT === "0")
|
|
58803
|
+
return;
|
|
58804
|
+
const key = `${info.agent}:${info.reason}`;
|
|
58805
|
+
const now = Date.now();
|
|
58806
|
+
const last = linearAuthAlertLast.get(key);
|
|
58807
|
+
if (last != null && now - last < LINEAR_AUTH_ALERT_COOLDOWN_MS)
|
|
58808
|
+
return;
|
|
58809
|
+
(async () => {
|
|
58810
|
+
try {
|
|
58811
|
+
const chatId = loadAccess().allowFrom[0];
|
|
58812
|
+
if (!chatId)
|
|
58813
|
+
return;
|
|
58814
|
+
const threadId = topicForRecipient({
|
|
58815
|
+
recipientChatId: chatId,
|
|
58816
|
+
resolvedTopic: resolveAgentOutboundTopic({ kind: "linear-auth" }) ?? chatThreadMap.get(chatId),
|
|
58817
|
+
supergroupChatId: resolveAgentSupergroupChatId()
|
|
58818
|
+
});
|
|
58819
|
+
const text2 = buildLinearAuthDeadMessage(info.agent, info.reason);
|
|
58820
|
+
await swallowingApiCall(() => bot.api.sendMessage(chatId, text2, {
|
|
58821
|
+
parse_mode: "HTML",
|
|
58822
|
+
...threadId != null ? { message_thread_id: threadId } : {}
|
|
58823
|
+
}), { chat_id: chatId, verb: "linearAuthDead" });
|
|
58824
|
+
linearAuthAlertLast.set(key, now);
|
|
58825
|
+
process.stderr.write(`telegram gateway: linear auth-dead alert sent agent=${info.agent} reason=${info.reason}
|
|
58826
|
+
`);
|
|
58827
|
+
} catch {}
|
|
58828
|
+
})();
|
|
58829
|
+
}
|
|
58447
58830
|
async function executeLinearAgentActivity(args) {
|
|
58448
|
-
return emitLinearAgentActivity(args);
|
|
58831
|
+
return emitLinearAgentActivity(args, { onAuthUnrecoverable: notifyLinearAuthDead });
|
|
58449
58832
|
}
|
|
58450
58833
|
async function executeLinearCreateIssue(args) {
|
|
58451
|
-
return createLinearIssue(args);
|
|
58834
|
+
return createLinearIssue(args, { onAuthUnrecoverable: notifyLinearAuthDead });
|
|
58835
|
+
}
|
|
58836
|
+
async function executeLinearAgentSetup(args) {
|
|
58837
|
+
return runLinearAgentSetup(args);
|
|
58452
58838
|
}
|
|
58453
58839
|
async function executeUpdateChecklist(args) {
|
|
58454
58840
|
const chat_id = args.chat_id;
|
|
@@ -58465,9 +58851,9 @@ async function executeUpdateChecklist(args) {
|
|
|
58465
58851
|
`);
|
|
58466
58852
|
return { content: [{ type: "text", text: `checklist updated (id: ${message_id})` }] };
|
|
58467
58853
|
}
|
|
58468
|
-
function redactOutboundText(
|
|
58469
|
-
const masked = redact2(
|
|
58470
|
-
if (masked !==
|
|
58854
|
+
function redactOutboundText(text2, site) {
|
|
58855
|
+
const masked = redact2(text2);
|
|
58856
|
+
if (masked !== text2) {
|
|
58471
58857
|
process.stderr.write(`telegram gateway: outbound secret masked site=${site}
|
|
58472
58858
|
`);
|
|
58473
58859
|
}
|
|
@@ -58481,12 +58867,12 @@ async function executeReply(args) {
|
|
|
58481
58867
|
const rawText = args.text;
|
|
58482
58868
|
if (rawText == null || rawText === "")
|
|
58483
58869
|
throw new Error("reply: text is required and cannot be empty");
|
|
58484
|
-
let
|
|
58485
|
-
|
|
58870
|
+
let text2 = repairEscapedWhitespace(rawText);
|
|
58871
|
+
text2 = redactOutboundText(text2, "reply");
|
|
58486
58872
|
{
|
|
58487
|
-
const scrub = scrubVoice(
|
|
58873
|
+
const scrub = scrubVoice(text2);
|
|
58488
58874
|
if (scrub.replaced > 0) {
|
|
58489
|
-
|
|
58875
|
+
text2 = scrub.scrubbed;
|
|
58490
58876
|
emitRuntimeMetric({
|
|
58491
58877
|
kind: "voice_scrub_applied",
|
|
58492
58878
|
chatKey: statusKey(chat_id, args.message_thread_id != null ? Number(args.message_thread_id) : undefined),
|
|
@@ -58495,11 +58881,11 @@ async function executeReply(args) {
|
|
|
58495
58881
|
});
|
|
58496
58882
|
}
|
|
58497
58883
|
}
|
|
58498
|
-
process.stderr.write(`telegram channel: reply: invoked chatId=${chat_id} charCount=${
|
|
58884
|
+
process.stderr.write(`telegram channel: reply: invoked chatId=${chat_id} charCount=${text2.length} preview=${JSON.stringify(text2.slice(0, 80))}
|
|
58499
58885
|
`);
|
|
58500
58886
|
{
|
|
58501
58887
|
const replyThreadId = args.message_thread_id != null ? Number(args.message_thread_id) : undefined;
|
|
58502
|
-
const dup = outboundDedup.check(chat_id, replyThreadId,
|
|
58888
|
+
const dup = outboundDedup.check(chat_id, replyThreadId, text2, Date.now(), currentTurn?.registryKey ?? null);
|
|
58503
58889
|
if (dup != null) {
|
|
58504
58890
|
process.stderr.write(`telegram gateway: reply: deduped (#546) chatId=${chat_id} ageMs=${dup.ageMs} preview=${JSON.stringify(dup.preview)}
|
|
58505
58891
|
`);
|
|
@@ -58543,13 +58929,13 @@ async function executeReply(args) {
|
|
|
58543
58929
|
}
|
|
58544
58930
|
const tg = access.telegraph;
|
|
58545
58931
|
const tgThreshold = tg?.threshold ?? 3000;
|
|
58546
|
-
if (tg?.enabled && files.length === 0 &&
|
|
58932
|
+
if (tg?.enabled && files.length === 0 && text2.length > tgThreshold) {
|
|
58547
58933
|
const agentSlug = process.env.SWITCHROOM_AGENT_NAME ?? "switchroom-agent";
|
|
58548
58934
|
const shortName = tg.short_name ?? agentSlug;
|
|
58549
|
-
const url = await publishToTelegraph(
|
|
58935
|
+
const url = await publishToTelegraph(text2, shortName, tg.author_name);
|
|
58550
58936
|
if (url != null) {
|
|
58551
|
-
const title = deriveTelegraphTitle(
|
|
58552
|
-
|
|
58937
|
+
const title = deriveTelegraphTitle(text2);
|
|
58938
|
+
text2 = `<b>${title.replace(/[<>&]/g, (c) => c === "<" ? "<" : c === ">" ? ">" : "&")}</b>
|
|
58553
58939
|
${url}`;
|
|
58554
58940
|
}
|
|
58555
58941
|
}
|
|
@@ -58557,13 +58943,13 @@ ${url}`;
|
|
|
58557
58943
|
let effectiveText;
|
|
58558
58944
|
if (format === "html") {
|
|
58559
58945
|
parseMode = "HTML";
|
|
58560
|
-
effectiveText = markdownToHtml(
|
|
58946
|
+
effectiveText = markdownToHtml(text2);
|
|
58561
58947
|
} else if (format === "markdownv2") {
|
|
58562
58948
|
parseMode = "MarkdownV2";
|
|
58563
|
-
effectiveText = escapeMarkdownV2(
|
|
58949
|
+
effectiveText = escapeMarkdownV2(text2);
|
|
58564
58950
|
} else {
|
|
58565
58951
|
parseMode = undefined;
|
|
58566
|
-
effectiveText =
|
|
58952
|
+
effectiveText = text2;
|
|
58567
58953
|
}
|
|
58568
58954
|
assertAllowedChat(chat_id);
|
|
58569
58955
|
let replyRoutedOriginTurn = null;
|
|
@@ -58920,7 +59306,7 @@ ${url}`;
|
|
|
58920
59306
|
process.stderr.write(`telegram channel: reply: finalized chatId=${chat_id} messageIds=[${sentIds.join(",")}] chunks=${chunks.length}
|
|
58921
59307
|
`);
|
|
58922
59308
|
if (sentIds.length > 0) {
|
|
58923
|
-
outboundDedup.record(chat_id, threadId,
|
|
59309
|
+
outboundDedup.record(chat_id, threadId, text2, Date.now(), currentTurn?.registryKey ?? null);
|
|
58924
59310
|
}
|
|
58925
59311
|
return { content: [{ type: "text", text: result }] };
|
|
58926
59312
|
}
|
|
@@ -59105,12 +59491,12 @@ async function executeProgressUpdate(args) {
|
|
|
59105
59491
|
if (!args.text)
|
|
59106
59492
|
throw new Error("progress_update: text is required");
|
|
59107
59493
|
const chat_id = args.chat_id;
|
|
59108
|
-
let
|
|
59494
|
+
let text2 = args.text;
|
|
59109
59495
|
const threadId = resolveThreadId(chat_id, args.message_thread_id);
|
|
59110
59496
|
const key = statusKey(chat_id, threadId);
|
|
59111
59497
|
assertAllowedChat(chat_id);
|
|
59112
|
-
if (
|
|
59113
|
-
|
|
59498
|
+
if (text2.length > 300) {
|
|
59499
|
+
text2 = text2.slice(0, 299) + "\u2026";
|
|
59114
59500
|
}
|
|
59115
59501
|
const now = Date.now();
|
|
59116
59502
|
const lastSent = progressUpdateLastSent.get(key);
|
|
@@ -59152,7 +59538,7 @@ async function executeProgressUpdate(args) {
|
|
|
59152
59538
|
toolUseIdHint
|
|
59153
59539
|
});
|
|
59154
59540
|
if (subAgent != null && progressDriver != null) {
|
|
59155
|
-
const cardText =
|
|
59541
|
+
const cardText = text2.length > 200 ? text2.slice(0, 199) + "\u2026" : text2;
|
|
59156
59542
|
const result = progressDriver.recordSubAgentNarrative({
|
|
59157
59543
|
chatId: chat_id,
|
|
59158
59544
|
threadId: threadId != null ? String(threadId) : undefined,
|
|
@@ -59177,7 +59563,7 @@ async function executeProgressUpdate(args) {
|
|
|
59177
59563
|
const access = loadAccess();
|
|
59178
59564
|
const configParseMode = access.parseMode ?? "html";
|
|
59179
59565
|
const parseMode = configParseMode === "html" ? "HTML" : undefined;
|
|
59180
|
-
const effectiveText = configParseMode === "html" ? markdownToHtml(
|
|
59566
|
+
const effectiveText = configParseMode === "html" ? markdownToHtml(text2) : text2;
|
|
59181
59567
|
const sendOpts = {
|
|
59182
59568
|
...parseMode ? { parse_mode: parseMode } : {},
|
|
59183
59569
|
...threadId != null ? { message_thread_id: threadId } : {}
|
|
@@ -59188,7 +59574,7 @@ async function executeProgressUpdate(args) {
|
|
|
59188
59574
|
chat_id,
|
|
59189
59575
|
thread_id: threadId ?? null,
|
|
59190
59576
|
message_ids: [sent.message_id],
|
|
59191
|
-
texts: [
|
|
59577
|
+
texts: [text2]
|
|
59192
59578
|
});
|
|
59193
59579
|
}
|
|
59194
59580
|
progressUpdateLastSent.set(key, now);
|
|
@@ -59355,7 +59741,7 @@ async function executeSendGif(rawArgs) {
|
|
|
59355
59741
|
}]
|
|
59356
59742
|
};
|
|
59357
59743
|
}
|
|
59358
|
-
async function publishToTelegraph(
|
|
59744
|
+
async function publishToTelegraph(text2, shortName, authorName) {
|
|
59359
59745
|
const accountPath = join35(STATE_DIR, "telegraph-account.json");
|
|
59360
59746
|
let account = null;
|
|
59361
59747
|
try {
|
|
@@ -59386,8 +59772,8 @@ async function publishToTelegraph(text, shortName, authorName) {
|
|
|
59386
59772
|
`);
|
|
59387
59773
|
}
|
|
59388
59774
|
}
|
|
59389
|
-
const title = deriveTelegraphTitle(
|
|
59390
|
-
const content = markdownToTelegraphNodes(
|
|
59775
|
+
const title = deriveTelegraphTitle(text2);
|
|
59776
|
+
const content = markdownToTelegraphNodes(text2);
|
|
59391
59777
|
const page = await createTelegraphPage({
|
|
59392
59778
|
accessToken: account.accessToken,
|
|
59393
59779
|
title,
|
|
@@ -59399,7 +59785,7 @@ async function publishToTelegraph(text, shortName, authorName) {
|
|
|
59399
59785
|
`);
|
|
59400
59786
|
return null;
|
|
59401
59787
|
}
|
|
59402
|
-
process.stderr.write(`telegram gateway: telegraph published url=${page.value.url} title=${JSON.stringify(title)} chars=${
|
|
59788
|
+
process.stderr.write(`telegram gateway: telegraph published url=${page.value.url} title=${JSON.stringify(title)} chars=${text2.length}
|
|
59403
59789
|
`);
|
|
59404
59790
|
return page.value.url;
|
|
59405
59791
|
}
|
|
@@ -59461,11 +59847,11 @@ async function executeVaultRequestSave(args) {
|
|
|
59461
59847
|
};
|
|
59462
59848
|
pendingVaultRequestSaves.set(stageId, pending2);
|
|
59463
59849
|
sweepPendingVaultRequestSaves();
|
|
59464
|
-
const
|
|
59850
|
+
const text2 = renderVaultRequestSaveCard(pending2, agentSlug);
|
|
59465
59851
|
const threadId = args.message_thread_id != null ? Number(args.message_thread_id) : undefined;
|
|
59466
59852
|
if (threadId != null)
|
|
59467
59853
|
pending2.threadId = threadId;
|
|
59468
|
-
const sent = await retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chat_id,
|
|
59854
|
+
const sent = await retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chat_id, text2, {
|
|
59469
59855
|
parse_mode: "HTML",
|
|
59470
59856
|
reply_markup: buildVaultRequestSaveKeyboard(stageId),
|
|
59471
59857
|
...tid != null && Number.isFinite(tid) ? { message_thread_id: tid } : {}
|
|
@@ -59537,11 +59923,11 @@ async function executeRequestSecret(args) {
|
|
|
59537
59923
|
const pending2 = { agent: agentSlug, chat_id, key, reason, staged_at: Date.now() };
|
|
59538
59924
|
pendingSecretRequests.set(stageId, pending2);
|
|
59539
59925
|
sweepSecretRequests();
|
|
59540
|
-
const
|
|
59926
|
+
const text2 = renderSecretRequestCard(pending2);
|
|
59541
59927
|
const threadId = args.message_thread_id != null ? Number(args.message_thread_id) : undefined;
|
|
59542
59928
|
if (threadId != null)
|
|
59543
59929
|
pending2.threadId = threadId;
|
|
59544
|
-
const sent = await retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chat_id,
|
|
59930
|
+
const sent = await retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chat_id, text2, {
|
|
59545
59931
|
parse_mode: "HTML",
|
|
59546
59932
|
reply_markup: buildSecretRequestKeyboard(stageId),
|
|
59547
59933
|
...tid != null && Number.isFinite(tid) ? { message_thread_id: tid } : {}
|
|
@@ -59782,11 +60168,11 @@ async function executeVaultRequestAccess(args) {
|
|
|
59782
60168
|
};
|
|
59783
60169
|
pendingVaultRequestAccesses.set(stageId, pending2);
|
|
59784
60170
|
sweepPendingVaultRequestAccesses();
|
|
59785
|
-
const
|
|
60171
|
+
const text2 = renderVaultRequestAccessCard(pending2);
|
|
59786
60172
|
const threadId = args.message_thread_id != null ? Number(args.message_thread_id) : undefined;
|
|
59787
60173
|
if (threadId != null)
|
|
59788
60174
|
pending2.threadId = threadId;
|
|
59789
|
-
const sent = await retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chat_id,
|
|
60175
|
+
const sent = await retryWithThreadFallback(robustApiCall, (tid) => lockedBot.api.sendMessage(chat_id, text2, {
|
|
59790
60176
|
parse_mode: "HTML",
|
|
59791
60177
|
reply_markup: buildVaultRequestAccessKeyboard(stageId),
|
|
59792
60178
|
...tid != null && Number.isFinite(tid) ? { message_thread_id: tid } : {}
|
|
@@ -60344,10 +60730,10 @@ function handleSessionEvent(ev) {
|
|
|
60344
60730
|
isPrivateChat: turn.isDm,
|
|
60345
60731
|
threadId: turn.sessionThreadId,
|
|
60346
60732
|
...ANSWER_LANE.usesDraftTransport ? { sendMessageDraft: sendMessageDraftFn, minInitialChars: ANSWER_LANE.minInitialChars } : { minInitialChars: ANSWER_LANE.minInitialChars },
|
|
60347
|
-
sendMessage: async (chatId,
|
|
60733
|
+
sendMessage: async (chatId, text2, params) => {
|
|
60348
60734
|
const tid = params?.message_thread_id;
|
|
60349
60735
|
const silent = params?.purpose !== "materialize";
|
|
60350
|
-
const msg = await robustApiCall(() => bot.api.sendMessage(chatId,
|
|
60736
|
+
const msg = await robustApiCall(() => bot.api.sendMessage(chatId, text2, {
|
|
60351
60737
|
parse_mode: params?.parse_mode,
|
|
60352
60738
|
disable_notification: silent,
|
|
60353
60739
|
...tid != null ? { message_thread_id: tid } : {},
|
|
@@ -60360,9 +60746,9 @@ function handleSessionEvent(ev) {
|
|
|
60360
60746
|
});
|
|
60361
60747
|
return { message_id: msg.message_id };
|
|
60362
60748
|
},
|
|
60363
|
-
editMessageText: (chatId, messageId,
|
|
60749
|
+
editMessageText: (chatId, messageId, text2, params) => {
|
|
60364
60750
|
const tid = params?.message_thread_id;
|
|
60365
|
-
return robustApiCall(() => bot.api.editMessageText(chatId, messageId,
|
|
60751
|
+
return robustApiCall(() => bot.api.editMessageText(chatId, messageId, text2, {
|
|
60366
60752
|
parse_mode: params?.parse_mode,
|
|
60367
60753
|
...tid != null ? { message_thread_id: tid } : {},
|
|
60368
60754
|
...params?.link_preview_options != null ? { link_preview_options: params.link_preview_options } : {}
|
|
@@ -60386,13 +60772,13 @@ function handleSessionEvent(ev) {
|
|
|
60386
60772
|
}
|
|
60387
60773
|
}
|
|
60388
60774
|
},
|
|
60389
|
-
checkDedup: (
|
|
60390
|
-
return outboundDedup.check(turn.sessionChatId, turn.sessionThreadId,
|
|
60775
|
+
checkDedup: (text2) => {
|
|
60776
|
+
return outboundDedup.check(turn.sessionChatId, turn.sessionThreadId, text2, Date.now(), turn.registryKey ?? null) != null;
|
|
60391
60777
|
},
|
|
60392
|
-
recordDedup: (
|
|
60393
|
-
outboundDedup.record(turn.sessionChatId, turn.sessionThreadId,
|
|
60778
|
+
recordDedup: (text2) => {
|
|
60779
|
+
outboundDedup.record(turn.sessionChatId, turn.sessionThreadId, text2, Date.now(), turn.registryKey ?? null);
|
|
60394
60780
|
},
|
|
60395
|
-
recordOutbound: ({ messageId, text }) => {
|
|
60781
|
+
recordOutbound: ({ messageId, text: text2 }) => {
|
|
60396
60782
|
if (!HISTORY_ENABLED)
|
|
60397
60783
|
return;
|
|
60398
60784
|
try {
|
|
@@ -60400,7 +60786,7 @@ function handleSessionEvent(ev) {
|
|
|
60400
60786
|
chat_id: turn.sessionChatId,
|
|
60401
60787
|
thread_id: turn.sessionThreadId ?? null,
|
|
60402
60788
|
message_ids: [messageId],
|
|
60403
|
-
texts: [
|
|
60789
|
+
texts: [text2]
|
|
60404
60790
|
});
|
|
60405
60791
|
} catch {}
|
|
60406
60792
|
}
|
|
@@ -60791,7 +61177,7 @@ function handleSessionEvent(ev) {
|
|
|
60791
61177
|
}
|
|
60792
61178
|
}
|
|
60793
61179
|
}
|
|
60794
|
-
function handlePtyPartial(
|
|
61180
|
+
function handlePtyPartial(text2) {
|
|
60795
61181
|
const turn = currentTurn;
|
|
60796
61182
|
const state4 = {
|
|
60797
61183
|
currentSessionChatId: turn?.sessionChatId ?? null,
|
|
@@ -60802,7 +61188,7 @@ function handlePtyPartial(text) {
|
|
|
60802
61188
|
suppressPtyPreview,
|
|
60803
61189
|
lastPtyPreviewByChat
|
|
60804
61190
|
};
|
|
60805
|
-
handlePtyPartialPure(
|
|
61191
|
+
handlePtyPartialPure(text2, state4, {
|
|
60806
61192
|
bot,
|
|
60807
61193
|
retry: robustApiCall,
|
|
60808
61194
|
renderText: markdownToHtml,
|
|
@@ -60914,10 +61300,10 @@ function gate(ctx) {
|
|
|
60914
61300
|
}
|
|
60915
61301
|
function isMentioned(ctx, extraPatterns) {
|
|
60916
61302
|
const entities = ctx.message?.entities ?? ctx.message?.caption_entities ?? [];
|
|
60917
|
-
const
|
|
61303
|
+
const text2 = ctx.message?.text ?? ctx.message?.caption ?? "";
|
|
60918
61304
|
for (const e of entities) {
|
|
60919
61305
|
if (e.type === "mention") {
|
|
60920
|
-
const mentioned =
|
|
61306
|
+
const mentioned = text2.slice(e.offset, e.offset + e.length);
|
|
60921
61307
|
if (mentioned.toLowerCase() === `@${botUsername}`.toLowerCase())
|
|
60922
61308
|
return true;
|
|
60923
61309
|
}
|
|
@@ -60928,7 +61314,7 @@ function isMentioned(ctx, extraPatterns) {
|
|
|
60928
61314
|
return true;
|
|
60929
61315
|
for (const pat of extraPatterns ?? []) {
|
|
60930
61316
|
try {
|
|
60931
|
-
if (new RegExp(pat, "i").test(
|
|
61317
|
+
if (new RegExp(pat, "i").test(text2))
|
|
60932
61318
|
return true;
|
|
60933
61319
|
} catch {}
|
|
60934
61320
|
}
|
|
@@ -60957,14 +61343,14 @@ function isAuthorizedSender(ctx) {
|
|
|
60957
61343
|
function safeName(s) {
|
|
60958
61344
|
return s?.replace(/[<>\[\]\r\n;]/g, "_");
|
|
60959
61345
|
}
|
|
60960
|
-
async function handleInboundCoalesced(ctx,
|
|
60961
|
-
if (parseInterruptMarker(
|
|
60962
|
-
return handleInbound(ctx,
|
|
61346
|
+
async function handleInboundCoalesced(ctx, text2, downloadImage, attachment) {
|
|
61347
|
+
if (parseInterruptMarker(text2).isInterrupt) {
|
|
61348
|
+
return handleInbound(ctx, text2, downloadImage, attachment);
|
|
60963
61349
|
}
|
|
60964
61350
|
const hasAttachment = downloadImage != null || attachment != null;
|
|
60965
61351
|
const maxAttachments = coalesceMaxAttachments();
|
|
60966
61352
|
if (hasAttachment && ctx.message?.media_group_id != null && maxAttachments <= 1) {
|
|
60967
|
-
return handleInbound(ctx,
|
|
61353
|
+
return handleInbound(ctx, text2, downloadImage, attachment);
|
|
60968
61354
|
}
|
|
60969
61355
|
const from = ctx.from;
|
|
60970
61356
|
if (!from)
|
|
@@ -60972,14 +61358,14 @@ async function handleInboundCoalesced(ctx, text, downloadImage, attachment) {
|
|
|
60972
61358
|
if (hasAttachment) {
|
|
60973
61359
|
const probeKey = inboundCoalesceKey(String(ctx.chat.id), ctx.message?.message_thread_id, String(from.id));
|
|
60974
61360
|
if ((bufferedAttachmentKeys.get(probeKey) ?? 0) >= maxAttachments) {
|
|
60975
|
-
return handleInbound(ctx,
|
|
61361
|
+
return handleInbound(ctx, text2, downloadImage, attachment);
|
|
60976
61362
|
}
|
|
60977
61363
|
}
|
|
60978
61364
|
maybeEarlyAckReaction(ctx, from);
|
|
60979
61365
|
const key = inboundCoalesceKey(String(ctx.chat.id), ctx.message?.message_thread_id, String(from.id));
|
|
60980
|
-
const result = inboundCoalescer.enqueue(key, { text, ctx, downloadImage, attachment });
|
|
61366
|
+
const result = inboundCoalescer.enqueue(key, { text: text2, ctx, downloadImage, attachment });
|
|
60981
61367
|
if (result.bypass)
|
|
60982
|
-
return handleInbound(ctx,
|
|
61368
|
+
return handleInbound(ctx, text2, downloadImage, attachment);
|
|
60983
61369
|
if (hasAttachment)
|
|
60984
61370
|
bufferedAttachmentKeys.set(key, (bufferedAttachmentKeys.get(key) ?? 0) + 1);
|
|
60985
61371
|
}
|
|
@@ -61002,7 +61388,7 @@ function maybeEarlyAckReaction(ctx, from) {
|
|
|
61002
61388
|
]).catch(() => {});
|
|
61003
61389
|
bot.api.sendChatAction(chatId, "typing").catch(() => {});
|
|
61004
61390
|
}
|
|
61005
|
-
async function handleInbound(ctx,
|
|
61391
|
+
async function handleInbound(ctx, text2, downloadImage, attachment, extraAttachments) {
|
|
61006
61392
|
const isTopicMessage = ctx.message?.is_topic_message ?? false;
|
|
61007
61393
|
const messageThreadId = ctx.message?.message_thread_id;
|
|
61008
61394
|
if (TOPIC_ID != null) {
|
|
@@ -61042,7 +61428,7 @@ async function handleInbound(ctx, text, downloadImage, attachment, extraAttachme
|
|
|
61042
61428
|
if (messageThreadId != null)
|
|
61043
61429
|
chatThreadMap.set(chat_id, messageThreadId);
|
|
61044
61430
|
try {
|
|
61045
|
-
const classification = classifyInbound(
|
|
61431
|
+
const classification = classifyInbound(text2);
|
|
61046
61432
|
if (classification.isStatusQuery) {
|
|
61047
61433
|
const priorKey = statusKey(chat_id, messageThreadId);
|
|
61048
61434
|
const priorTurnStartedAt2 = activeTurnStartedAt.get(priorKey);
|
|
@@ -61052,7 +61438,7 @@ async function handleInbound(ctx, text, downloadImage, attachment, extraAttachme
|
|
|
61052
61438
|
chat_id,
|
|
61053
61439
|
message_id: msgId ?? null,
|
|
61054
61440
|
thread_id: messageThreadId ?? null,
|
|
61055
|
-
text_length:
|
|
61441
|
+
text_length: text2.length,
|
|
61056
61442
|
prior_turn_in_flight: priorTurnInFlight,
|
|
61057
61443
|
seconds_since_turn_start: priorTurnStartedAt2 != null ? Math.round((inboundReceivedAt - priorTurnStartedAt2) / 1000) : null
|
|
61058
61444
|
});
|
|
@@ -61061,7 +61447,7 @@ async function handleInbound(ctx, text, downloadImage, attachment, extraAttachme
|
|
|
61061
61447
|
process.stderr.write(`telegram gateway: inbound classifier error: ${err.message}
|
|
61062
61448
|
`);
|
|
61063
61449
|
}
|
|
61064
|
-
const interrupt = parseInterruptMarker(
|
|
61450
|
+
const interrupt = parseInterruptMarker(text2);
|
|
61065
61451
|
let deferInterrupt = false;
|
|
61066
61452
|
if (interrupt.isInterrupt) {
|
|
61067
61453
|
const agentName3 = process.env.SWITCHROOM_AGENT_NAME;
|
|
@@ -61102,9 +61488,9 @@ async function handleInbound(ctx, text, downloadImage, attachment, extraAttachme
|
|
|
61102
61488
|
});
|
|
61103
61489
|
return;
|
|
61104
61490
|
}
|
|
61105
|
-
|
|
61491
|
+
text2 = interrupt.body;
|
|
61106
61492
|
}
|
|
61107
|
-
if (STATUS_QUERY_RE.test(
|
|
61493
|
+
if (STATUS_QUERY_RE.test(text2)) {
|
|
61108
61494
|
try {
|
|
61109
61495
|
const threadKey = messageThreadId != null ? String(messageThreadId) : undefined;
|
|
61110
61496
|
const cardState = progressDriver?.peek(chat_id, threadKey);
|
|
@@ -61120,7 +61506,7 @@ async function handleInbound(ctx, text, downloadImage, attachment, extraAttachme
|
|
|
61120
61506
|
`);
|
|
61121
61507
|
}
|
|
61122
61508
|
}
|
|
61123
|
-
const permMatch = PERMISSION_REPLY_RE.exec(
|
|
61509
|
+
const permMatch = PERMISSION_REPLY_RE.exec(text2);
|
|
61124
61510
|
if (permMatch) {
|
|
61125
61511
|
const behavior = permMatch[1].toLowerCase().startsWith("y") ? "allow" : "deny";
|
|
61126
61512
|
const request_id = permMatch[2].toLowerCase();
|
|
@@ -61145,12 +61531,12 @@ async function handleInbound(ctx, text, downloadImage, attachment, extraAttachme
|
|
|
61145
61531
|
}
|
|
61146
61532
|
const interceptKey = chatKey2(chat_id, messageThreadId);
|
|
61147
61533
|
const pendingAdd = pendingAuthAddFlows.get(interceptKey);
|
|
61148
|
-
if (pendingAdd && looksLikeAuthCode(
|
|
61534
|
+
if (pendingAdd && looksLikeAuthCode(text2)) {
|
|
61149
61535
|
const elapsed = Date.now() - pendingAdd.startedAt;
|
|
61150
61536
|
if (elapsed < REAUTH_INTERCEPT_TTL_MS) {
|
|
61151
61537
|
pendingAuthAddFlows.delete(interceptKey);
|
|
61152
61538
|
try {
|
|
61153
|
-
const credentials = await submitAccountAuthCode(pendingAdd,
|
|
61539
|
+
const credentials = await submitAccountAuthCode(pendingAdd, text2.trim());
|
|
61154
61540
|
try {
|
|
61155
61541
|
await addAccountViaBroker(pendingAdd.label, credentials, { replace: false });
|
|
61156
61542
|
cleanScratchDir(pendingAdd.scratchDir);
|
|
@@ -61170,11 +61556,11 @@ The fleet's active account hasn't changed. Send <code>/auth use ${escapeHtmlForT
|
|
|
61170
61556
|
pendingAuthAddFlows.delete(interceptKey);
|
|
61171
61557
|
}
|
|
61172
61558
|
const pendingReauth = pendingReauthFlows.get(interceptKey);
|
|
61173
|
-
if (pendingReauth && looksLikeAuthCode(
|
|
61559
|
+
if (pendingReauth && looksLikeAuthCode(text2)) {
|
|
61174
61560
|
const elapsed = Date.now() - pendingReauth.startedAt;
|
|
61175
61561
|
if (elapsed < REAUTH_INTERCEPT_TTL_MS) {
|
|
61176
61562
|
pendingReauthFlows.delete(interceptKey);
|
|
61177
|
-
const { result: result2, errorText } = execAuthCode(pendingReauth.agent,
|
|
61563
|
+
const { result: result2, errorText } = execAuthCode(pendingReauth.agent, text2.trim());
|
|
61178
61564
|
if (errorText) {
|
|
61179
61565
|
await switchroomReply(ctx, `<b>auth code failed:</b>
|
|
61180
61566
|
${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
@@ -61202,7 +61588,7 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61202
61588
|
} else {
|
|
61203
61589
|
pendingVaultOps.delete(chat_id);
|
|
61204
61590
|
if (pendingVault.kind === "passphrase") {
|
|
61205
|
-
const passphrase =
|
|
61591
|
+
const passphrase = text2.trim();
|
|
61206
61592
|
if (!passphrase) {
|
|
61207
61593
|
await switchroomReply(ctx, "Passphrase cannot be empty. Try /vault again.", { html: true });
|
|
61208
61594
|
return;
|
|
@@ -61212,7 +61598,7 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61212
61598
|
await deleteSensitiveMessage(chat_id, msgId, "vault passphrase");
|
|
61213
61599
|
await executeVaultOp(ctx, chat_id, pendingVault.op, pendingVault.key, passphrase, undefined);
|
|
61214
61600
|
} else if (pendingVault.kind === "unlock") {
|
|
61215
|
-
const passphrase =
|
|
61601
|
+
const passphrase = text2.trim();
|
|
61216
61602
|
if (!passphrase) {
|
|
61217
61603
|
await switchroomReply(ctx, "Passphrase cannot be empty. Try /vault unlock again.", { html: true });
|
|
61218
61604
|
return;
|
|
@@ -61226,7 +61612,7 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61226
61612
|
await switchroomReply(ctx, `<b>vault unlock failed:</b> ${escapeHtmlForTg(result2.msg ?? "unknown error")}`, { html: true });
|
|
61227
61613
|
}
|
|
61228
61614
|
} else if (pendingVault.kind === "passphrase-for-deferred") {
|
|
61229
|
-
const passphrase =
|
|
61615
|
+
const passphrase = text2.trim();
|
|
61230
61616
|
if (!passphrase) {
|
|
61231
61617
|
await switchroomReply(ctx, "Passphrase cannot be empty. Tap the unlock button again.", { html: true });
|
|
61232
61618
|
return;
|
|
@@ -61236,7 +61622,7 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61236
61622
|
await deleteSensitiveMessage(chat_id, msgId, "vault passphrase");
|
|
61237
61623
|
await executeDeferredSecretSave(ctx, pendingVault.deferKey, passphrase, pendingVault.cardMessageId);
|
|
61238
61624
|
} else if (pendingVault.kind === "passphrase-for-access-approve") {
|
|
61239
|
-
const passphrase =
|
|
61625
|
+
const passphrase = text2.trim();
|
|
61240
61626
|
if (!passphrase) {
|
|
61241
61627
|
await switchroomReply(ctx, "Passphrase cannot be empty. Ask the agent to re-issue the request card.", { html: true });
|
|
61242
61628
|
return;
|
|
@@ -61253,7 +61639,7 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61253
61639
|
await performVaultAccessApproval(ctx, stagedAccess, item.stageId, item.senderId, { kind: "passphrase", passphrase });
|
|
61254
61640
|
}
|
|
61255
61641
|
} else if (pendingVault.kind === "grant-wizard" && pendingVault.awaitingCustomDuration) {
|
|
61256
|
-
const input =
|
|
61642
|
+
const input = text2.trim();
|
|
61257
61643
|
const ttlSeconds = parseGrantDuration(input);
|
|
61258
61644
|
if (ttlSeconds === null) {
|
|
61259
61645
|
pendingVaultOps.set(chat_id, { ...pendingVault, startedAt: Date.now() });
|
|
@@ -61265,15 +61651,15 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61265
61651
|
} else if (pendingVault.kind === "grant-wizard") {
|
|
61266
61652
|
pendingVaultOps.set(chat_id, { ...pendingVault, startedAt: Date.now() });
|
|
61267
61653
|
} else if (pendingVault.kind === "value") {
|
|
61268
|
-
let value =
|
|
61269
|
-
const codeBlockMatch = /^```[\w]*\n?([\s\S]*?)```$/m.exec(
|
|
61654
|
+
let value = text2;
|
|
61655
|
+
const codeBlockMatch = /^```[\w]*\n?([\s\S]*?)```$/m.exec(text2);
|
|
61270
61656
|
if (codeBlockMatch)
|
|
61271
61657
|
value = codeBlockMatch[1];
|
|
61272
61658
|
if (msgId != null)
|
|
61273
61659
|
await deleteSensitiveMessage(chat_id, msgId, "vault secret value");
|
|
61274
61660
|
await executeVaultOp(ctx, chat_id, "set", pendingVault.key, pendingVault.passphrase, value.trim());
|
|
61275
61661
|
} else if (pendingVault.kind === "rename-vault-save") {
|
|
61276
|
-
const newKey =
|
|
61662
|
+
const newKey = text2.trim();
|
|
61277
61663
|
const staged = pendingVaultRequestSaves.get(pendingVault.stageId);
|
|
61278
61664
|
if (!staged) {
|
|
61279
61665
|
await switchroomReply(ctx, "\u231B That save card expired before you renamed. Ask the agent to re-issue.", { html: true });
|
|
@@ -61294,7 +61680,7 @@ ${preBlock(formatSwitchroomOutput(errorText))}`, { html: true });
|
|
|
61294
61680
|
return;
|
|
61295
61681
|
}
|
|
61296
61682
|
}
|
|
61297
|
-
const stagedMatch = /^\s*(stash|ignore|rename|forget)\b\s*(\S+)?/i.exec(
|
|
61683
|
+
const stagedMatch = /^\s*(stash|ignore|rename|forget)\b\s*(\S+)?/i.exec(text2);
|
|
61298
61684
|
if (stagedMatch) {
|
|
61299
61685
|
const staged = secretStaging.latestForChat(chat_id);
|
|
61300
61686
|
if (staged != null) {
|
|
@@ -61340,13 +61726,13 @@ ${preBlock(write.output)}`;
|
|
|
61340
61726
|
}
|
|
61341
61727
|
}
|
|
61342
61728
|
bot.api.sendChatAction(chat_id, "typing", messageThreadId != null ? { message_thread_id: messageThreadId } : {}).catch(() => {});
|
|
61343
|
-
const parsedSteer = parseSteerPrefix(
|
|
61729
|
+
const parsedSteer = parseSteerPrefix(text2);
|
|
61344
61730
|
const isSteerPrefix = parsedSteer.steering;
|
|
61345
|
-
const parsedQueue = isSteerPrefix ? { queued: false, body: parsedSteer.body } : parseQueuePrefix(
|
|
61731
|
+
const parsedQueue = isSteerPrefix ? { queued: false, body: parsedSteer.body } : parseQueuePrefix(text2);
|
|
61346
61732
|
const isQueuedPrefix = parsedQueue.queued;
|
|
61347
|
-
let effectiveText = isSteerPrefix ? parsedSteer.body : isQueuedPrefix ? parsedQueue.body :
|
|
61733
|
+
let effectiveText = isSteerPrefix ? parsedSteer.body : isQueuedPrefix ? parsedQueue.body : text2;
|
|
61348
61734
|
if (armedSecretCaptures.has(chat_id)) {
|
|
61349
|
-
const consumed = await captureProvidedSecret(ctx, chat_id, msgId ?? undefined,
|
|
61735
|
+
const consumed = await captureProvidedSecret(ctx, chat_id, msgId ?? undefined, text2);
|
|
61350
61736
|
if (consumed)
|
|
61351
61737
|
return;
|
|
61352
61738
|
}
|
|
@@ -61516,7 +61902,7 @@ ${preBlock(write.output)}`;
|
|
|
61516
61902
|
chat_id,
|
|
61517
61903
|
message_id: msgId,
|
|
61518
61904
|
thread_id: messageThreadId ?? null,
|
|
61519
|
-
inbound_classified_as_status_query: classifyInbound(
|
|
61905
|
+
inbound_classified_as_status_query: classifyInbound(text2).isStatusQuery
|
|
61520
61906
|
});
|
|
61521
61907
|
const agentDir = resolveAgentDirFromEnv();
|
|
61522
61908
|
if (agentDir != null) {
|
|
@@ -61762,21 +62148,21 @@ function formatSwitchroomOutput(output, maxLen = 4000) {
|
|
|
61762
62148
|
return trimmed.slice(0, maxLen - 20) + `
|
|
61763
62149
|
... (truncated)`;
|
|
61764
62150
|
}
|
|
61765
|
-
function stripAnsi2(
|
|
61766
|
-
return
|
|
62151
|
+
function stripAnsi2(text2) {
|
|
62152
|
+
return text2.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "");
|
|
61767
62153
|
}
|
|
61768
|
-
function escapeHtmlForTg(
|
|
61769
|
-
return
|
|
62154
|
+
function escapeHtmlForTg(text2) {
|
|
62155
|
+
return text2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
61770
62156
|
}
|
|
61771
|
-
function preBlock(
|
|
61772
|
-
return "<pre>" + escapeHtmlForTg(
|
|
62157
|
+
function preBlock(text2) {
|
|
62158
|
+
return "<pre>" + escapeHtmlForTg(text2) + "</pre>";
|
|
61773
62159
|
}
|
|
61774
|
-
async function switchroomReply(ctx,
|
|
62160
|
+
async function switchroomReply(ctx, text2, options = {}) {
|
|
61775
62161
|
const chatId = String(ctx.chat.id);
|
|
61776
62162
|
const baseThreadId = resolveThreadId(chatId, ctx.message?.message_thread_id);
|
|
61777
62163
|
const routedOpts = options.classification ? slashCommandReplyOpts(ctx, options.classification) : {};
|
|
61778
62164
|
const threadId = routedOpts.message_thread_id ?? baseThreadId;
|
|
61779
|
-
await ctx.reply(
|
|
62165
|
+
await ctx.reply(text2, {
|
|
61780
62166
|
...threadId != null ? { message_thread_id: threadId } : {},
|
|
61781
62167
|
...options.html ? { parse_mode: "HTML", link_preview_options: { is_disabled: true } } : {},
|
|
61782
62168
|
...options.reply_markup ? { reply_markup: options.reply_markup } : {}
|
|
@@ -61800,8 +62186,8 @@ function getCommandArgs(ctx) {
|
|
|
61800
62186
|
const fromMatch = typeof ctx.match === "string" ? ctx.match.trim() : "";
|
|
61801
62187
|
if (fromMatch)
|
|
61802
62188
|
return fromMatch;
|
|
61803
|
-
const
|
|
61804
|
-
const m =
|
|
62189
|
+
const text2 = ctx.msg?.text ?? ctx.message?.text ?? "";
|
|
62190
|
+
const m = text2.match(/^\/\S+\s+([\s\S]*)$/);
|
|
61805
62191
|
return m ? m[1].trim() : "";
|
|
61806
62192
|
}
|
|
61807
62193
|
function assertSafeAgentName(name) {
|
|
@@ -61927,6 +62313,40 @@ function resolveAgentSupergroupChatId() {
|
|
|
61927
62313
|
return;
|
|
61928
62314
|
}
|
|
61929
62315
|
}
|
|
62316
|
+
function isSelfLinearAgentEnabled() {
|
|
62317
|
+
const agentName3 = process.env.SWITCHROOM_AGENT_NAME;
|
|
62318
|
+
if (!agentName3)
|
|
62319
|
+
return false;
|
|
62320
|
+
try {
|
|
62321
|
+
const cfg = loadConfig2();
|
|
62322
|
+
const rawAgent = cfg.agents?.[agentName3];
|
|
62323
|
+
if (!rawAgent)
|
|
62324
|
+
return false;
|
|
62325
|
+
const resolved = resolveAgentConfig2(cfg.defaults, cfg.profiles, rawAgent);
|
|
62326
|
+
const la = resolved.channels?.telegram?.linear_agent;
|
|
62327
|
+
return la?.enabled === true;
|
|
62328
|
+
} catch {
|
|
62329
|
+
return false;
|
|
62330
|
+
}
|
|
62331
|
+
}
|
|
62332
|
+
async function runLinearAuthWatch() {
|
|
62333
|
+
const agent = process.env.SWITCHROOM_AGENT_NAME;
|
|
62334
|
+
if (!agent)
|
|
62335
|
+
return;
|
|
62336
|
+
const io = brokerRefreshIO(agent);
|
|
62337
|
+
const status = await runLinearAuthCheck({
|
|
62338
|
+
agent,
|
|
62339
|
+
linearEnabled: isSelfLinearAgentEnabled,
|
|
62340
|
+
readBundle: io.readBundle,
|
|
62341
|
+
refresh: () => performLinearRefresh2(io),
|
|
62342
|
+
onAuthDead: notifyLinearAuthDead,
|
|
62343
|
+
log: (s) => process.stderr.write(s)
|
|
62344
|
+
});
|
|
62345
|
+
if (status !== "disabled" && status !== "fresh") {
|
|
62346
|
+
process.stderr.write(`telegram gateway: linear-auth-watch agent=${agent} status=${status}
|
|
62347
|
+
`);
|
|
62348
|
+
}
|
|
62349
|
+
}
|
|
61930
62350
|
function stampUserRestartReason(reason) {
|
|
61931
62351
|
try {
|
|
61932
62352
|
writeCleanShutdownMarker(GATEWAY_CLEAN_SHUTDOWN_MARKER_PATH, {
|
|
@@ -62039,9 +62459,9 @@ function notifyDetachedFailure(chatId, threadId, label) {
|
|
|
62039
62459
|
return ({ code, tail }) => {
|
|
62040
62460
|
clearRestartMarker();
|
|
62041
62461
|
const snippet = tail ? tail.slice(-800) : "(no output captured)";
|
|
62042
|
-
const
|
|
62462
|
+
const text2 = `\u274C <b>${escapeHtmlForTg(label)} failed</b> (exit ${code}):
|
|
62043
62463
|
` + preBlock(snippet);
|
|
62044
|
-
swallowingApiCall(() => lockedBot.api.sendMessage(chatId,
|
|
62464
|
+
swallowingApiCall(() => lockedBot.api.sendMessage(chatId, text2, {
|
|
62045
62465
|
parse_mode: "HTML",
|
|
62046
62466
|
link_preview_options: { is_disabled: true },
|
|
62047
62467
|
...threadId != null ? { message_thread_id: threadId } : {}
|
|
@@ -62550,7 +62970,7 @@ bot.command("inject", async (ctx) => {
|
|
|
62550
62970
|
await handleInjectCommand(ctx, {
|
|
62551
62971
|
isAuthorized: isAuthorizedSender,
|
|
62552
62972
|
inject: injectSlashCommand,
|
|
62553
|
-
reply: async (ctx2,
|
|
62973
|
+
reply: async (ctx2, text2, opts) => switchroomReply(ctx2, text2, { html: opts?.html }),
|
|
62554
62974
|
getAgentName: getMyAgentName,
|
|
62555
62975
|
getArgs: getCommandArgs,
|
|
62556
62976
|
escapeHtml: escapeHtmlForTg,
|
|
@@ -62603,8 +63023,8 @@ function modelMenuReplyMarkup(reply) {
|
|
|
62603
63023
|
bot.command("model", async (ctx) => {
|
|
62604
63024
|
if (!isAuthorizedSender(ctx))
|
|
62605
63025
|
return;
|
|
62606
|
-
const
|
|
62607
|
-
const parsed = parseModelCommand(
|
|
63026
|
+
const text2 = ctx.message?.text ?? ctx.channelPost?.text ?? "";
|
|
63027
|
+
const parsed = parseModelCommand(text2) ?? { kind: "show" };
|
|
62608
63028
|
const deps = buildModelDeps();
|
|
62609
63029
|
if (parsed.kind === "show" && process.env.SWITCHROOM_MODEL_MENU !== "0") {
|
|
62610
63030
|
const menu = await buildModelMenu(deps);
|
|
@@ -62639,8 +63059,8 @@ function effortMenuReplyMarkup(reply) {
|
|
|
62639
63059
|
bot.command("effort", async (ctx) => {
|
|
62640
63060
|
if (!isAuthorizedSender(ctx))
|
|
62641
63061
|
return;
|
|
62642
|
-
const
|
|
62643
|
-
const parsed = parseEffortCommand(
|
|
63062
|
+
const text2 = ctx.message?.text ?? ctx.channelPost?.text ?? "";
|
|
63063
|
+
const parsed = parseEffortCommand(text2) ?? { kind: "show" };
|
|
62644
63064
|
const deps = buildEffortDeps();
|
|
62645
63065
|
if (parsed.kind === "show") {
|
|
62646
63066
|
const menu = buildEffortMenu(deps);
|
|
@@ -63609,8 +64029,8 @@ bot.command("auth", async (ctx) => {
|
|
|
63609
64029
|
}
|
|
63610
64030
|
return;
|
|
63611
64031
|
}
|
|
63612
|
-
const
|
|
63613
|
-
const parsed = parseAuthCommand(
|
|
64032
|
+
const text2 = ctx.message?.text ?? "";
|
|
64033
|
+
const parsed = parseAuthCommand(text2);
|
|
63614
64034
|
if (!parsed)
|
|
63615
64035
|
return;
|
|
63616
64036
|
const currentAgent = getMyAgentName();
|
|
@@ -64249,14 +64669,14 @@ async function grantWizardStep2(ctx, chatId, agent, wizardMsgId) {
|
|
|
64249
64669
|
}
|
|
64250
64670
|
const selected = new Set;
|
|
64251
64671
|
const kb = buildGrantKeysKeyboard(keys, selected);
|
|
64252
|
-
const
|
|
64672
|
+
const text2 = `<b>Grant capability token \u2014 Step 2/3</b>
|
|
64253
64673
|
|
|
64254
64674
|
Which keys for <code>${escapeHtmlForTg(agent)}</code>?
|
|
64255
64675
|
<i>Tap to toggle; tap Continue when done.</i>`;
|
|
64256
64676
|
if (wizardMsgId != null) {
|
|
64257
|
-
await ctx.api.editMessageText(chatId, wizardMsgId,
|
|
64677
|
+
await ctx.api.editMessageText(chatId, wizardMsgId, text2, { parse_mode: "HTML", reply_markup: kb }).catch(() => {});
|
|
64258
64678
|
} else {
|
|
64259
|
-
const sent = await switchroomReply(ctx,
|
|
64679
|
+
const sent = await switchroomReply(ctx, text2, { html: true, reply_markup: kb });
|
|
64260
64680
|
wizardMsgId = sent?.message_id;
|
|
64261
64681
|
}
|
|
64262
64682
|
pendingVaultOps.set(chatId, {
|
|
@@ -64273,7 +64693,7 @@ async function grantWizardStep3(ctx, chatId, state4) {
|
|
|
64273
64693
|
const kb = buildGrantDurationKeyboard();
|
|
64274
64694
|
const keyList = state4.selectedKeys.map((k) => `\u2022 <code>${escapeHtmlForTg(k)}</code>`).join(`
|
|
64275
64695
|
`);
|
|
64276
|
-
const
|
|
64696
|
+
const text2 = `<b>Grant capability token \u2014 Step 3/3</b>
|
|
64277
64697
|
|
|
64278
64698
|
Keys for <code>${escapeHtmlForTg(state4.agent)}</code>:
|
|
64279
64699
|
${keyList}
|
|
@@ -64281,9 +64701,9 @@ ${keyList}
|
|
|
64281
64701
|
How long should this grant be valid?`;
|
|
64282
64702
|
const msgId = state4.wizardMsgId;
|
|
64283
64703
|
if (msgId != null) {
|
|
64284
|
-
await ctx.api.editMessageText(chatId, msgId,
|
|
64704
|
+
await ctx.api.editMessageText(chatId, msgId, text2, { parse_mode: "HTML", reply_markup: kb }).catch(() => {});
|
|
64285
64705
|
} else {
|
|
64286
|
-
const sent = await switchroomReply(ctx,
|
|
64706
|
+
const sent = await switchroomReply(ctx, text2, { html: true, reply_markup: kb });
|
|
64287
64707
|
state4.wizardMsgId = sent?.message_id;
|
|
64288
64708
|
}
|
|
64289
64709
|
pendingVaultOps.set(chatId, { ...state4, step: "duration" });
|
|
@@ -64293,7 +64713,7 @@ async function grantWizardConfirm(ctx, chatId, state4) {
|
|
|
64293
64713
|
const expiresLabel = formatGrantExpiry(state4.ttlSeconds);
|
|
64294
64714
|
const keyList = state4.selectedKeys.map((k) => `\u2022 <code>${escapeHtmlForTg(k)}</code>`).join(`
|
|
64295
64715
|
`);
|
|
64296
|
-
const
|
|
64716
|
+
const text2 = [
|
|
64297
64717
|
"<b>Confirm grant</b>",
|
|
64298
64718
|
"",
|
|
64299
64719
|
`Agent: <code>${escapeHtmlForTg(state4.agent)}</code>`,
|
|
@@ -64306,9 +64726,9 @@ ${keyList}`,
|
|
|
64306
64726
|
`);
|
|
64307
64727
|
const msgId = state4.wizardMsgId;
|
|
64308
64728
|
if (msgId != null) {
|
|
64309
|
-
await ctx.api.editMessageText(chatId, msgId,
|
|
64729
|
+
await ctx.api.editMessageText(chatId, msgId, text2, { parse_mode: "HTML", reply_markup: kb }).catch(() => {});
|
|
64310
64730
|
} else {
|
|
64311
|
-
const sent = await switchroomReply(ctx,
|
|
64731
|
+
const sent = await switchroomReply(ctx, text2, { html: true, reply_markup: kb });
|
|
64312
64732
|
state4.wizardMsgId = sent?.message_id;
|
|
64313
64733
|
}
|
|
64314
64734
|
const kernelRequestId = await mintGrantWizardKernelRequest(state4.agent, loadAccess().allowFrom, state4.selectedKeys, state4.ttlSeconds ?? null);
|
|
@@ -64778,7 +65198,7 @@ async function handleAuthDashboardCallback(ctx) {
|
|
|
64778
65198
|
const tz = process.env.SWITCHROOM_TIMEZONE ?? process.env.TZ ?? "UTC";
|
|
64779
65199
|
const { renderAuthSnapshotFormat2: renderAuthSnapshotFormat23, buildSnapshotsFromState: buildSnapshotsFromState4, buildSnapshotKeyboard: buildSnapshotKeyboard3 } = await Promise.resolve().then(() => (init_auth_snapshot_format(), exports_auth_snapshot_format));
|
|
64780
65200
|
const snapshots = buildSnapshotsFromState4(state4, quotas);
|
|
64781
|
-
const
|
|
65201
|
+
const text2 = renderAuthSnapshotFormat23(snapshots, {
|
|
64782
65202
|
tz,
|
|
64783
65203
|
now: new Date,
|
|
64784
65204
|
liveProbedAtMs: Date.now()
|
|
@@ -64793,7 +65213,7 @@ async function handleAuthDashboardCallback(ctx) {
|
|
|
64793
65213
|
}));
|
|
64794
65214
|
const msg = ctx.callbackQuery?.message;
|
|
64795
65215
|
if (msg) {
|
|
64796
|
-
await swallowingApiCall(() => bot.api.editMessageText(msg.chat.id, msg.message_id,
|
|
65216
|
+
await swallowingApiCall(() => bot.api.editMessageText(msg.chat.id, msg.message_id, text2, {
|
|
64797
65217
|
parse_mode: "HTML",
|
|
64798
65218
|
reply_markup: { inline_keyboard }
|
|
64799
65219
|
}), { chat_id: String(msg.chat.id), verb: "auth:refresh:edit" });
|
|
@@ -65175,12 +65595,12 @@ bot.command("usage", async (ctx) => {
|
|
|
65175
65595
|
const { renderAuthSnapshotFormat2: renderAuthSnapshotFormat23, buildSnapshotsFromState: buildSnapshotsFromState4 } = await Promise.resolve().then(() => (init_auth_snapshot_format(), exports_auth_snapshot_format));
|
|
65176
65596
|
const tz = process.env.SWITCHROOM_TIMEZONE ?? process.env.TZ ?? "UTC";
|
|
65177
65597
|
const snapshots = buildSnapshotsFromState4(state4, quotas);
|
|
65178
|
-
const
|
|
65598
|
+
const text2 = renderAuthSnapshotFormat23(snapshots, {
|
|
65179
65599
|
tz,
|
|
65180
65600
|
now: new Date,
|
|
65181
65601
|
liveProbedAtMs: Date.now()
|
|
65182
65602
|
});
|
|
65183
|
-
await switchroomReply(ctx,
|
|
65603
|
+
await switchroomReply(ctx, text2, { html: true });
|
|
65184
65604
|
return;
|
|
65185
65605
|
}
|
|
65186
65606
|
}
|
|
@@ -65956,10 +66376,10 @@ bot.on("message:voice", async (ctx) => {
|
|
|
65956
66376
|
if (voiceIn?.enabled && voiceIn?.provider === "openai") {
|
|
65957
66377
|
const transcript = await maybeTranscribeVoice(voice.file_id, voice.mime_type, voiceIn.language);
|
|
65958
66378
|
if (transcript != null) {
|
|
65959
|
-
const
|
|
66379
|
+
const text2 = ctx.message.caption ? `${ctx.message.caption}
|
|
65960
66380
|
|
|
65961
66381
|
[voice transcript] ${transcript}` : `[voice transcript] ${transcript}`;
|
|
65962
|
-
await handleInboundCoalesced(ctx,
|
|
66382
|
+
await handleInboundCoalesced(ctx, text2, undefined, {
|
|
65963
66383
|
kind: "voice",
|
|
65964
66384
|
file_id: voice.file_id,
|
|
65965
66385
|
size: voice.file_size,
|
|
@@ -66045,14 +66465,14 @@ bot.on("message:sticker", async (ctx) => {
|
|
|
66045
66465
|
parts.push(sticker.emoji);
|
|
66046
66466
|
if (sticker.set_name)
|
|
66047
66467
|
parts.push(`from "${sticker.set_name}"`);
|
|
66048
|
-
const
|
|
66049
|
-
await handleInboundCoalesced(ctx,
|
|
66468
|
+
const text2 = parts.length > 0 ? `(sticker \u2014 ${parts.join(" ")})` : "(sticker)";
|
|
66469
|
+
await handleInboundCoalesced(ctx, text2, undefined, { kind: "sticker", file_id: sticker.file_id, size: sticker.file_size });
|
|
66050
66470
|
});
|
|
66051
66471
|
bot.on("message:animation", async (ctx) => {
|
|
66052
66472
|
const animation = ctx.message.animation;
|
|
66053
66473
|
const caption = ctx.message.caption;
|
|
66054
|
-
const
|
|
66055
|
-
await handleInboundCoalesced(ctx,
|
|
66474
|
+
const text2 = caption ? `(gif) ${caption}` : "(gif)";
|
|
66475
|
+
await handleInboundCoalesced(ctx, text2, undefined, {
|
|
66056
66476
|
kind: "animation",
|
|
66057
66477
|
file_id: animation.file_id,
|
|
66058
66478
|
size: animation.file_size,
|
|
@@ -66127,10 +66547,10 @@ bot.on("message:contact", async (ctx) => {
|
|
|
66127
66547
|
const last = safeName(c.last_name) ?? "";
|
|
66128
66548
|
const name = [first, last].filter(Boolean).join(" ") || "?";
|
|
66129
66549
|
const userIdPart = c.user_id != null ? ` user_id=${c.user_id}` : "";
|
|
66130
|
-
const
|
|
66550
|
+
const text2 = `(contact: name="${name}" phone="${phone}"${userIdPart})`;
|
|
66131
66551
|
process.stderr.write(`telegram gateway: inbound contact from chat=${ctx.chat?.id ?? "?"}
|
|
66132
66552
|
`);
|
|
66133
|
-
await handleInbound(ctx,
|
|
66553
|
+
await handleInbound(ctx, text2, undefined);
|
|
66134
66554
|
} catch (err) {
|
|
66135
66555
|
process.stderr.write(`telegram gateway: contact handler error: ${err.message}
|
|
66136
66556
|
`);
|
|
@@ -66142,10 +66562,10 @@ bot.on("message:location", async (ctx) => {
|
|
|
66142
66562
|
const lat = typeof loc.latitude === "number" ? loc.latitude.toFixed(6) : "?";
|
|
66143
66563
|
const lon = typeof loc.longitude === "number" ? loc.longitude.toFixed(6) : "?";
|
|
66144
66564
|
const live = loc.live_period != null ? ` live_period=${loc.live_period}s` : "";
|
|
66145
|
-
const
|
|
66565
|
+
const text2 = `(location: lat=${lat} lon=${lon}${live})`;
|
|
66146
66566
|
process.stderr.write(`telegram gateway: inbound location from chat=${ctx.chat?.id ?? "?"}
|
|
66147
66567
|
`);
|
|
66148
|
-
await handleInbound(ctx,
|
|
66568
|
+
await handleInbound(ctx, text2, undefined);
|
|
66149
66569
|
} catch (err) {
|
|
66150
66570
|
process.stderr.write(`telegram gateway: location handler error: ${err.message}
|
|
66151
66571
|
`);
|
|
@@ -66158,10 +66578,10 @@ bot.on("message:venue", async (ctx) => {
|
|
|
66158
66578
|
const address = safeName(v.address) ?? "?";
|
|
66159
66579
|
const lat = typeof v.location?.latitude === "number" ? v.location.latitude.toFixed(6) : "?";
|
|
66160
66580
|
const lon = typeof v.location?.longitude === "number" ? v.location.longitude.toFixed(6) : "?";
|
|
66161
|
-
const
|
|
66581
|
+
const text2 = `(venue: title="${title}" address="${address}" lat=${lat} lon=${lon})`;
|
|
66162
66582
|
process.stderr.write(`telegram gateway: inbound venue from chat=${ctx.chat?.id ?? "?"}
|
|
66163
66583
|
`);
|
|
66164
|
-
await handleInbound(ctx,
|
|
66584
|
+
await handleInbound(ctx, text2, undefined);
|
|
66165
66585
|
} catch (err) {
|
|
66166
66586
|
process.stderr.write(`telegram gateway: venue handler error: ${err.message}
|
|
66167
66587
|
`);
|
|
@@ -66174,10 +66594,10 @@ bot.on("message:poll", async (ctx) => {
|
|
|
66174
66594
|
const optsCount = Array.isArray(p.options) ? p.options.length : 0;
|
|
66175
66595
|
const optsList = Array.isArray(p.options) ? p.options.slice(0, 10).map((o) => safeName(o.text) ?? "?").join(" | ") : "";
|
|
66176
66596
|
const anon = p.is_anonymous ? " anonymous" : "";
|
|
66177
|
-
const
|
|
66597
|
+
const text2 = `(poll: question="${q}" options=${optsCount}${anon}${optsList ? ` choices=[${optsList}]` : ""})`;
|
|
66178
66598
|
process.stderr.write(`telegram gateway: inbound poll from chat=${ctx.chat?.id ?? "?"}
|
|
66179
66599
|
`);
|
|
66180
|
-
await handleInbound(ctx,
|
|
66600
|
+
await handleInbound(ctx, text2, undefined);
|
|
66181
66601
|
} catch (err) {
|
|
66182
66602
|
process.stderr.write(`telegram gateway: poll handler error: ${err.message}
|
|
66183
66603
|
`);
|
|
@@ -66189,10 +66609,10 @@ bot.on("message:web_app_data", async (ctx) => {
|
|
|
66189
66609
|
const raw = typeof w.data === "string" ? w.data : "";
|
|
66190
66610
|
const data = raw.length > 4096 ? raw.slice(0, 4096) + "\u2026(truncated)" : raw;
|
|
66191
66611
|
const button = safeName(w.button_text) ?? "?";
|
|
66192
|
-
const
|
|
66612
|
+
const text2 = `(web_app_data: button="${button}" data=${JSON.stringify(data)})`;
|
|
66193
66613
|
process.stderr.write(`telegram gateway: inbound web_app_data from chat=${ctx.chat?.id ?? "?"} button="${button}" bytes=${raw.length}
|
|
66194
66614
|
`);
|
|
66195
|
-
await handleInbound(ctx,
|
|
66615
|
+
await handleInbound(ctx, text2, undefined);
|
|
66196
66616
|
} catch (err) {
|
|
66197
66617
|
process.stderr.write(`telegram gateway: web_app_data handler error: ${err.message}
|
|
66198
66618
|
`);
|
|
@@ -66203,10 +66623,10 @@ bot.on("message:users_shared", async (ctx) => {
|
|
|
66203
66623
|
const u = ctx.message.users_shared;
|
|
66204
66624
|
const users = Array.isArray(u.users) ? u.users : [];
|
|
66205
66625
|
const ids = users.map((usr) => String(usr.user_id ?? "?")).join(",");
|
|
66206
|
-
const
|
|
66626
|
+
const text2 = `(users_shared: request_id=${u.request_id ?? "?"} user_ids=[${ids}] count=${users.length})`;
|
|
66207
66627
|
process.stderr.write(`telegram gateway: inbound users_shared from chat=${ctx.chat?.id ?? "?"} count=${users.length}
|
|
66208
66628
|
`);
|
|
66209
|
-
await handleInbound(ctx,
|
|
66629
|
+
await handleInbound(ctx, text2, undefined);
|
|
66210
66630
|
} catch (err) {
|
|
66211
66631
|
process.stderr.write(`telegram gateway: users_shared handler error: ${err.message}
|
|
66212
66632
|
`);
|
|
@@ -66217,10 +66637,10 @@ bot.on("message:chat_shared", async (ctx) => {
|
|
|
66217
66637
|
const c = ctx.message.chat_shared;
|
|
66218
66638
|
const title = safeName(c.title) ?? "";
|
|
66219
66639
|
const titlePart = title ? ` title="${title}"` : "";
|
|
66220
|
-
const
|
|
66640
|
+
const text2 = `(chat_shared: request_id=${c.request_id ?? "?"} chat_id=${c.chat_id ?? "?"}${titlePart})`;
|
|
66221
66641
|
process.stderr.write(`telegram gateway: inbound chat_shared from chat=${ctx.chat?.id ?? "?"} shared_chat_id=${c.chat_id ?? "?"}
|
|
66222
66642
|
`);
|
|
66223
|
-
await handleInbound(ctx,
|
|
66643
|
+
await handleInbound(ctx, text2, undefined);
|
|
66224
66644
|
} catch (err) {
|
|
66225
66645
|
process.stderr.write(`telegram gateway: chat_shared handler error: ${err.message}
|
|
66226
66646
|
`);
|
|
@@ -66401,7 +66821,7 @@ function maybeDispatchReaction(args) {
|
|
|
66401
66821
|
`);
|
|
66402
66822
|
}
|
|
66403
66823
|
}
|
|
66404
|
-
const { text, meta } = buildReactionDispatchInbound({
|
|
66824
|
+
const { text: text2, meta } = buildReactionDispatchInbound({
|
|
66405
66825
|
emoji: args.emoji,
|
|
66406
66826
|
chatId: args.chatId,
|
|
66407
66827
|
messageId: args.messageId,
|
|
@@ -66419,7 +66839,7 @@ function maybeDispatchReaction(args) {
|
|
|
66419
66839
|
user: args.user,
|
|
66420
66840
|
userId: args.userId,
|
|
66421
66841
|
ts,
|
|
66422
|
-
text,
|
|
66842
|
+
text: text2,
|
|
66423
66843
|
meta
|
|
66424
66844
|
};
|
|
66425
66845
|
const delivered = ipcServer.sendToAgent(agentName3, inbound);
|
|
@@ -66439,7 +66859,7 @@ function flushReactionBatch(batch) {
|
|
|
66439
66859
|
return;
|
|
66440
66860
|
}
|
|
66441
66861
|
const head = batch.reactions[batch.reactions.length - 1];
|
|
66442
|
-
const
|
|
66862
|
+
const text2 = buildReactionInboundText(batch);
|
|
66443
66863
|
const meta = buildReactionInboundMeta(batch);
|
|
66444
66864
|
const ts = Date.now();
|
|
66445
66865
|
const inbound = {
|
|
@@ -66450,7 +66870,7 @@ function flushReactionBatch(batch) {
|
|
|
66450
66870
|
user: head.user,
|
|
66451
66871
|
userId: head.userId,
|
|
66452
66872
|
ts,
|
|
66453
|
-
text,
|
|
66873
|
+
text: text2,
|
|
66454
66874
|
meta
|
|
66455
66875
|
};
|
|
66456
66876
|
const delivered = ipcServer.sendToAgent(agentName3, inbound);
|
|
@@ -66988,6 +67408,21 @@ var didOneTimeSetup = false;
|
|
|
66988
67408
|
});
|
|
66989
67409
|
}, QUOTA_WATCH_POLL_MS).unref();
|
|
66990
67410
|
}
|
|
67411
|
+
const LINEAR_AUTH_WATCH_POLL_MS = Number(process.env.SWITCHROOM_LINEAR_AUTH_WATCH_POLL_MS ?? 21600000);
|
|
67412
|
+
if (LINEAR_AUTH_WATCH_POLL_MS > 0) {
|
|
67413
|
+
setTimeout(() => {
|
|
67414
|
+
runLinearAuthWatch().catch((err) => {
|
|
67415
|
+
process.stderr.write(`telegram gateway: linear-auth-watch initial run failed: ${err}
|
|
67416
|
+
`);
|
|
67417
|
+
});
|
|
67418
|
+
}, 35000);
|
|
67419
|
+
setInterval(() => {
|
|
67420
|
+
runLinearAuthWatch().catch((err) => {
|
|
67421
|
+
process.stderr.write(`telegram gateway: linear-auth-watch scheduled run failed: ${err}
|
|
67422
|
+
`);
|
|
67423
|
+
});
|
|
67424
|
+
}, LINEAR_AUTH_WATCH_POLL_MS).unref();
|
|
67425
|
+
}
|
|
66991
67426
|
const RESTART_WATCHDOG_POLL_MS = Number(process.env.SWITCHROOM_RESTART_WATCHDOG_POLL_MS ?? 30000);
|
|
66992
67427
|
const watchdogAgentName = process.env.SWITCHROOM_AGENT_NAME;
|
|
66993
67428
|
const watchdogDockerMode = process.env.SWITCHROOM_RUNTIME === "docker";
|
|
@@ -67022,11 +67457,11 @@ var didOneTimeSetup = false;
|
|
|
67022
67457
|
const orphanStatusEnabled = isOrphanSubagentStatusEnabled(process.env.SWITCHROOM_ORPHAN_SUBAGENT_STATUS);
|
|
67023
67458
|
const workerActivityFeed = createWorkerActivityFeed({
|
|
67024
67459
|
bot: {
|
|
67025
|
-
sendMessage: async (cid,
|
|
67026
|
-
const sent = await robustApiCall(() => lockedBot.api.sendMessage(cid,
|
|
67460
|
+
sendMessage: async (cid, text2, sendOpts) => {
|
|
67461
|
+
const sent = await robustApiCall(() => lockedBot.api.sendMessage(cid, text2, sendOpts), { chat_id: cid, verb: "worker-feed" });
|
|
67027
67462
|
return sent;
|
|
67028
67463
|
},
|
|
67029
|
-
editMessageText: (cid, mid,
|
|
67464
|
+
editMessageText: (cid, mid, text2, editOpts) => robustApiCall(() => lockedBot.api.editMessageText(cid, mid, text2, editOpts), { chat_id: cid, verb: "worker-feed" })
|
|
67030
67465
|
},
|
|
67031
67466
|
log: (msg) => process.stderr.write(`telegram gateway: ${msg}
|
|
67032
67467
|
`)
|