switchroom 0.16.29 → 0.16.46
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 +101 -84
- package/dist/auth-broker/index.js +100 -83
- package/dist/cli/autoaccept-poll.js +8 -8
- package/dist/cli/drive-write-pretool.mjs +10 -10
- package/dist/cli/notion-write-pretool.mjs +102 -85
- package/dist/cli/skill-validate-pretool.mjs +91 -91
- package/dist/cli/switchroom.js +62124 -60406
- package/dist/cli/ui/index.html +877 -214
- package/dist/host-control/main.js +1000 -256
- package/dist/vault/approvals/kernel-server.js +141 -121
- package/dist/vault/broker/server.js +163 -143
- package/examples/minimal.yaml +1 -1
- package/examples/switchroom.yaml +1 -1
- package/package.json +3 -2
- package/profiles/_shared/agent-self-service.md.hbs +7 -2
- package/profiles/_shared/reply-discipline.md.hbs +9 -0
- package/skills/switchroom-status/SKILL.md +1 -1
- package/telegram-plugin/auth-snapshot-format.ts +173 -67
- package/telegram-plugin/auto-fallback-fleet.ts +3 -6
- package/telegram-plugin/bridge/bridge.ts +2 -1
- package/telegram-plugin/card-format.ts +59 -3
- package/telegram-plugin/credits-watch.ts +4 -7
- package/telegram-plugin/dist/bridge/bridge.js +132 -114
- package/telegram-plugin/dist/gateway/gateway.js +4456 -1591
- package/telegram-plugin/dist/server.js +180 -163
- package/telegram-plugin/format.ts +551 -20
- package/telegram-plugin/gateway/approval-card.ts +7 -14
- package/telegram-plugin/gateway/approvals-commands.ts +6 -9
- package/telegram-plugin/gateway/auth-command.ts +35 -38
- package/telegram-plugin/gateway/boot-card.ts +7 -2
- package/telegram-plugin/gateway/chat-id-fallback.ts +46 -0
- package/telegram-plugin/gateway/config-approval-handler.ts +6 -9
- package/telegram-plugin/gateway/diff-preview-card.ts +3 -6
- package/telegram-plugin/gateway/gateway.ts +1524 -129
- package/telegram-plugin/gateway/ipc-protocol.ts +66 -2
- package/telegram-plugin/gateway/ipc-server.ts +91 -1
- package/telegram-plugin/gateway/linear-activity.ts +2 -5
- package/telegram-plugin/gateway/model-command.ts +173 -19
- package/telegram-plugin/gateway/obligation-turn-end.ts +27 -0
- package/telegram-plugin/gateway/permission-card-store.ts +104 -0
- package/telegram-plugin/gateway/permission-timeout.ts +25 -6
- package/telegram-plugin/gateway/status-pin-store.ts +302 -0
- package/telegram-plugin/gateway/turns-jsonl-rotate.ts +30 -0
- package/telegram-plugin/gateway/unhandled-rejection-policy.ts +12 -1
- package/telegram-plugin/gateway/vault-grant-inbound-builders.ts +35 -0
- package/telegram-plugin/gateway/vault-request-access-card.ts +61 -0
- package/telegram-plugin/history.ts +17 -7
- package/telegram-plugin/hooks/tool-label-pretool.d.mts +12 -0
- package/telegram-plugin/hooks/tool-label-pretool.mjs +54 -16
- package/telegram-plugin/idle-footer.ts +2 -2
- package/telegram-plugin/issues-card.ts +12 -7
- package/telegram-plugin/model-unavailable.ts +3 -6
- package/telegram-plugin/operator-events.ts +4 -6
- package/telegram-plugin/package.json +1 -1
- package/telegram-plugin/quota-check.ts +2 -2
- package/telegram-plugin/quota-watch.ts +7 -10
- package/telegram-plugin/server.ts +3 -1
- package/telegram-plugin/session-tail.ts +47 -1
- package/telegram-plugin/status-pin-driver.ts +102 -0
- package/telegram-plugin/status-pin.ts +76 -0
- package/telegram-plugin/stream-reply-handler.ts +33 -2
- package/telegram-plugin/subagent-watcher.ts +6 -3
- package/telegram-plugin/tests/always-allow-grant.test.ts +34 -2
- package/telegram-plugin/tests/auth-command-format2.test.ts +6 -2
- package/telegram-plugin/tests/auth-command-vernacular.test.ts +18 -0
- package/telegram-plugin/tests/auth-snapshot-format.test.ts +204 -45
- package/telegram-plugin/tests/card-format.test.ts +79 -0
- package/telegram-plugin/tests/chat-id-fallback.test.ts +74 -0
- package/telegram-plugin/tests/claude-code-event-contract.test.ts +151 -0
- package/telegram-plugin/tests/codespan-escaping-golden.test.ts +166 -0
- package/telegram-plugin/tests/credits-watch.test.ts +18 -0
- package/telegram-plugin/tests/format-consistency.test.ts +223 -0
- package/telegram-plugin/tests/formatting-parse-regression.test.ts +272 -0
- package/telegram-plugin/tests/formatting-torture-set.ts +218 -0
- package/telegram-plugin/tests/history.test.ts +38 -2
- package/telegram-plugin/tests/idle-footer.test.ts +53 -9
- package/telegram-plugin/tests/ipc-server-validate-rollout-status.test.ts +66 -0
- package/telegram-plugin/tests/issues-card.test.ts +24 -0
- package/telegram-plugin/tests/model-command.test.ts +213 -47
- package/telegram-plugin/tests/obligation-turn-end.test.ts +76 -0
- package/telegram-plugin/tests/paragraph-normalizer.test.ts +384 -3
- package/telegram-plugin/tests/permission-card-single-edit.test.ts +66 -0
- package/telegram-plugin/tests/permission-card-store.test.ts +83 -0
- package/telegram-plugin/tests/permission-timeout.test.ts +37 -6
- package/telegram-plugin/tests/permission-verdict-resume-guard.test.ts +23 -6
- package/telegram-plugin/tests/quota-check.test.ts +9 -2
- package/telegram-plugin/tests/quota-watch.test.ts +7 -7
- package/telegram-plugin/tests/rich-markdown-oracle.ts +469 -0
- package/telegram-plugin/tests/rollout-status-wiring.test.ts +81 -0
- package/telegram-plugin/tests/session-tail.test.ts +91 -0
- package/telegram-plugin/tests/status-pin-boot-recovery.test.ts +294 -0
- package/telegram-plugin/tests/status-pin-service-message-suppression.test.ts +210 -0
- package/telegram-plugin/tests/status-pin-store.test.ts +450 -0
- package/telegram-plugin/tests/status-pin.test.ts +202 -0
- package/telegram-plugin/tests/status-vocabulary-unification.test.ts +125 -0
- package/telegram-plugin/tests/stream-reply-handler.test.ts +39 -0
- package/telegram-plugin/tests/telegram-format.test.ts +121 -8
- package/telegram-plugin/tests/text-voice-scrub.test.ts +142 -22
- package/telegram-plugin/tests/tool-activity-summary.test.ts +88 -25
- package/telegram-plugin/tests/tts-normalize.test.ts +242 -0
- package/telegram-plugin/tests/turns-jsonl-rotate.test.ts +39 -0
- package/telegram-plugin/tests/unhandled-rejection-policy.test.ts +12 -0
- package/telegram-plugin/tests/vault-grant-inbound-builders.test.ts +54 -0
- package/telegram-plugin/tests/vault-request-access-card.test.ts +94 -0
- package/telegram-plugin/tests/vault-request-access-tool.test.ts +24 -0
- package/telegram-plugin/tests/voice-normalize-text.test.ts +256 -0
- package/telegram-plugin/tests/voice-ondemand.test.ts +299 -0
- package/telegram-plugin/tests/voice-out-one-send.test.ts +153 -0
- package/telegram-plugin/tests/voice-presynth.test.ts +437 -0
- package/telegram-plugin/tests/voice-synthesize-sidecar.test.ts +352 -0
- package/telegram-plugin/tests/voice-transcribe-sidecar.test.ts +332 -0
- package/telegram-plugin/tests/voice-transcribe.test.ts +188 -0
- package/telegram-plugin/tests/worker-activity-feed.test.ts +77 -10
- package/telegram-plugin/text-voice-scrub.ts +68 -18
- package/telegram-plugin/tool-activity-summary.ts +31 -116
- package/telegram-plugin/tts-normalize.ts +377 -0
- package/telegram-plugin/uat/driver.ts +474 -17
- package/telegram-plugin/uat/scenarios/jtbd-model-litellm-sr-dm.test.ts +34 -14
- package/telegram-plugin/uat/scenarios/jtbd-multipart-render-dm.test.ts +169 -0
- package/telegram-plugin/uat/scenarios/jtbd-narration-intent-dm.test.ts +134 -0
- package/telegram-plugin/uat/scenarios/jtbd-rich-formatting-render-dm.test.ts +254 -0
- package/telegram-plugin/uat/scenarios/jtbd-status-phase-transitions-dm.test.ts +109 -0
- package/telegram-plugin/uat/uat-driver.test.ts +297 -0
- package/telegram-plugin/voice-normalize-text.ts +340 -0
- package/telegram-plugin/voice-ondemand.ts +289 -0
- package/telegram-plugin/voice-presynth.ts +242 -0
- package/telegram-plugin/voice-synthesize-sidecar.ts +259 -0
- package/telegram-plugin/voice-synthesize.ts +128 -0
- package/telegram-plugin/voice-transcribe-sidecar.ts +176 -0
- package/telegram-plugin/worker-activity-feed.ts +22 -5
|
@@ -46,7 +46,7 @@ var __export = (target, all) => {
|
|
|
46
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
47
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
48
48
|
|
|
49
|
-
// node_modules
|
|
49
|
+
// node_modules/yaml/dist/nodes/identity.js
|
|
50
50
|
var require_identity = __commonJS((exports) => {
|
|
51
51
|
var ALIAS = Symbol.for("yaml.alias");
|
|
52
52
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -100,7 +100,7 @@ var require_identity = __commonJS((exports) => {
|
|
|
100
100
|
exports.isSeq = isSeq;
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
// node_modules
|
|
103
|
+
// node_modules/yaml/dist/visit.js
|
|
104
104
|
var require_visit = __commonJS((exports) => {
|
|
105
105
|
var identity = require_identity();
|
|
106
106
|
var BREAK = Symbol("break visit");
|
|
@@ -255,7 +255,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
255
255
|
exports.visitAsync = visitAsync;
|
|
256
256
|
});
|
|
257
257
|
|
|
258
|
-
// node_modules
|
|
258
|
+
// node_modules/yaml/dist/doc/directives.js
|
|
259
259
|
var require_directives = __commonJS((exports) => {
|
|
260
260
|
var identity = require_identity();
|
|
261
261
|
var visit = require_visit();
|
|
@@ -407,7 +407,7 @@ var require_directives = __commonJS((exports) => {
|
|
|
407
407
|
exports.Directives = Directives;
|
|
408
408
|
});
|
|
409
409
|
|
|
410
|
-
// node_modules
|
|
410
|
+
// node_modules/yaml/dist/doc/anchors.js
|
|
411
411
|
var require_anchors = __commonJS((exports) => {
|
|
412
412
|
var identity = require_identity();
|
|
413
413
|
var visit = require_visit();
|
|
@@ -469,7 +469,7 @@ var require_anchors = __commonJS((exports) => {
|
|
|
469
469
|
exports.findNewAnchor = findNewAnchor;
|
|
470
470
|
});
|
|
471
471
|
|
|
472
|
-
// node_modules
|
|
472
|
+
// node_modules/yaml/dist/doc/applyReviver.js
|
|
473
473
|
var require_applyReviver = __commonJS((exports) => {
|
|
474
474
|
function applyReviver(reviver, obj, key, val) {
|
|
475
475
|
if (val && typeof val === "object") {
|
|
@@ -516,7 +516,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
|
516
516
|
exports.applyReviver = applyReviver;
|
|
517
517
|
});
|
|
518
518
|
|
|
519
|
-
// node_modules
|
|
519
|
+
// node_modules/yaml/dist/nodes/toJS.js
|
|
520
520
|
var require_toJS = __commonJS((exports) => {
|
|
521
521
|
var identity = require_identity();
|
|
522
522
|
function toJS(value, arg, ctx) {
|
|
@@ -543,7 +543,7 @@ var require_toJS = __commonJS((exports) => {
|
|
|
543
543
|
exports.toJS = toJS;
|
|
544
544
|
});
|
|
545
545
|
|
|
546
|
-
// node_modules
|
|
546
|
+
// node_modules/yaml/dist/nodes/Node.js
|
|
547
547
|
var require_Node = __commonJS((exports) => {
|
|
548
548
|
var applyReviver = require_applyReviver();
|
|
549
549
|
var identity = require_identity();
|
|
@@ -580,7 +580,7 @@ var require_Node = __commonJS((exports) => {
|
|
|
580
580
|
exports.NodeBase = NodeBase;
|
|
581
581
|
});
|
|
582
582
|
|
|
583
|
-
// node_modules
|
|
583
|
+
// node_modules/yaml/dist/nodes/Alias.js
|
|
584
584
|
var require_Alias = __commonJS((exports) => {
|
|
585
585
|
var anchors = require_anchors();
|
|
586
586
|
var visit = require_visit();
|
|
@@ -688,7 +688,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
688
688
|
exports.Alias = Alias;
|
|
689
689
|
});
|
|
690
690
|
|
|
691
|
-
// node_modules
|
|
691
|
+
// node_modules/yaml/dist/nodes/Scalar.js
|
|
692
692
|
var require_Scalar = __commonJS((exports) => {
|
|
693
693
|
var identity = require_identity();
|
|
694
694
|
var Node = require_Node();
|
|
@@ -716,7 +716,7 @@ var require_Scalar = __commonJS((exports) => {
|
|
|
716
716
|
exports.isScalarValue = isScalarValue;
|
|
717
717
|
});
|
|
718
718
|
|
|
719
|
-
// node_modules
|
|
719
|
+
// node_modules/yaml/dist/doc/createNode.js
|
|
720
720
|
var require_createNode = __commonJS((exports) => {
|
|
721
721
|
var Alias = require_Alias();
|
|
722
722
|
var identity = require_identity();
|
|
@@ -788,7 +788,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
788
788
|
exports.createNode = createNode;
|
|
789
789
|
});
|
|
790
790
|
|
|
791
|
-
// node_modules
|
|
791
|
+
// node_modules/yaml/dist/nodes/Collection.js
|
|
792
792
|
var require_Collection = __commonJS((exports) => {
|
|
793
793
|
var createNode = require_createNode();
|
|
794
794
|
var identity = require_identity();
|
|
@@ -903,7 +903,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
903
903
|
exports.isEmptyPath = isEmptyPath;
|
|
904
904
|
});
|
|
905
905
|
|
|
906
|
-
// node_modules
|
|
906
|
+
// node_modules/yaml/dist/stringify/stringifyComment.js
|
|
907
907
|
var require_stringifyComment = __commonJS((exports) => {
|
|
908
908
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
909
909
|
function indentComment(comment, indent) {
|
|
@@ -920,7 +920,7 @@ var require_stringifyComment = __commonJS((exports) => {
|
|
|
920
920
|
exports.stringifyComment = stringifyComment;
|
|
921
921
|
});
|
|
922
922
|
|
|
923
|
-
// node_modules
|
|
923
|
+
// node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
924
924
|
var require_foldFlowLines = __commonJS((exports) => {
|
|
925
925
|
var FOLD_FLOW = "flow";
|
|
926
926
|
var FOLD_BLOCK = "block";
|
|
@@ -1057,7 +1057,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1057
1057
|
exports.foldFlowLines = foldFlowLines;
|
|
1058
1058
|
});
|
|
1059
1059
|
|
|
1060
|
-
// node_modules
|
|
1060
|
+
// node_modules/yaml/dist/stringify/stringifyString.js
|
|
1061
1061
|
var require_stringifyString = __commonJS((exports) => {
|
|
1062
1062
|
var Scalar = require_Scalar();
|
|
1063
1063
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -1355,7 +1355,7 @@ ${indent}`);
|
|
|
1355
1355
|
exports.stringifyString = stringifyString;
|
|
1356
1356
|
});
|
|
1357
1357
|
|
|
1358
|
-
// node_modules
|
|
1358
|
+
// node_modules/yaml/dist/stringify/stringify.js
|
|
1359
1359
|
var require_stringify = __commonJS((exports) => {
|
|
1360
1360
|
var anchors = require_anchors();
|
|
1361
1361
|
var identity = require_identity();
|
|
@@ -1476,7 +1476,7 @@ ${ctx.indent}${str}`;
|
|
|
1476
1476
|
exports.stringify = stringify;
|
|
1477
1477
|
});
|
|
1478
1478
|
|
|
1479
|
-
// node_modules
|
|
1479
|
+
// node_modules/yaml/dist/stringify/stringifyPair.js
|
|
1480
1480
|
var require_stringifyPair = __commonJS((exports) => {
|
|
1481
1481
|
var identity = require_identity();
|
|
1482
1482
|
var Scalar = require_Scalar();
|
|
@@ -1612,7 +1612,7 @@ ${ctx.indent}`;
|
|
|
1612
1612
|
exports.stringifyPair = stringifyPair;
|
|
1613
1613
|
});
|
|
1614
1614
|
|
|
1615
|
-
// node_modules
|
|
1615
|
+
// node_modules/yaml/dist/log.js
|
|
1616
1616
|
var require_log = __commonJS((exports) => {
|
|
1617
1617
|
var node_process = __require("process");
|
|
1618
1618
|
function debug(logLevel, ...messages) {
|
|
@@ -1631,7 +1631,7 @@ var require_log = __commonJS((exports) => {
|
|
|
1631
1631
|
exports.warn = warn;
|
|
1632
1632
|
});
|
|
1633
1633
|
|
|
1634
|
-
// node_modules
|
|
1634
|
+
// node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
1635
1635
|
var require_merge = __commonJS((exports) => {
|
|
1636
1636
|
var identity = require_identity();
|
|
1637
1637
|
var Scalar = require_Scalar();
|
|
@@ -1685,7 +1685,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
1685
1685
|
exports.merge = merge;
|
|
1686
1686
|
});
|
|
1687
1687
|
|
|
1688
|
-
// node_modules
|
|
1688
|
+
// node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
1689
1689
|
var require_addPairToJSMap = __commonJS((exports) => {
|
|
1690
1690
|
var log = require_log();
|
|
1691
1691
|
var merge = require_merge();
|
|
@@ -1746,7 +1746,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
1746
1746
|
exports.addPairToJSMap = addPairToJSMap;
|
|
1747
1747
|
});
|
|
1748
1748
|
|
|
1749
|
-
// node_modules
|
|
1749
|
+
// node_modules/yaml/dist/nodes/Pair.js
|
|
1750
1750
|
var require_Pair = __commonJS((exports) => {
|
|
1751
1751
|
var createNode = require_createNode();
|
|
1752
1752
|
var stringifyPair = require_stringifyPair();
|
|
@@ -1784,7 +1784,7 @@ var require_Pair = __commonJS((exports) => {
|
|
|
1784
1784
|
exports.createPair = createPair;
|
|
1785
1785
|
});
|
|
1786
1786
|
|
|
1787
|
-
// node_modules
|
|
1787
|
+
// node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
1788
1788
|
var require_stringifyCollection = __commonJS((exports) => {
|
|
1789
1789
|
var identity = require_identity();
|
|
1790
1790
|
var stringify = require_stringify();
|
|
@@ -1936,7 +1936,7 @@ ${indent}${end}`;
|
|
|
1936
1936
|
exports.stringifyCollection = stringifyCollection;
|
|
1937
1937
|
});
|
|
1938
1938
|
|
|
1939
|
-
// node_modules
|
|
1939
|
+
// node_modules/yaml/dist/nodes/YAMLMap.js
|
|
1940
1940
|
var require_YAMLMap = __commonJS((exports) => {
|
|
1941
1941
|
var stringifyCollection = require_stringifyCollection();
|
|
1942
1942
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -2063,7 +2063,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
2063
2063
|
exports.findPair = findPair;
|
|
2064
2064
|
});
|
|
2065
2065
|
|
|
2066
|
-
// node_modules
|
|
2066
|
+
// node_modules/yaml/dist/schema/common/map.js
|
|
2067
2067
|
var require_map = __commonJS((exports) => {
|
|
2068
2068
|
var identity = require_identity();
|
|
2069
2069
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2082,7 +2082,7 @@ var require_map = __commonJS((exports) => {
|
|
|
2082
2082
|
exports.map = map;
|
|
2083
2083
|
});
|
|
2084
2084
|
|
|
2085
|
-
// node_modules
|
|
2085
|
+
// node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
2086
2086
|
var require_YAMLSeq = __commonJS((exports) => {
|
|
2087
2087
|
var createNode = require_createNode();
|
|
2088
2088
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -2175,7 +2175,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
2175
2175
|
exports.YAMLSeq = YAMLSeq;
|
|
2176
2176
|
});
|
|
2177
2177
|
|
|
2178
|
-
// node_modules
|
|
2178
|
+
// node_modules/yaml/dist/schema/common/seq.js
|
|
2179
2179
|
var require_seq = __commonJS((exports) => {
|
|
2180
2180
|
var identity = require_identity();
|
|
2181
2181
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -2194,7 +2194,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
2194
2194
|
exports.seq = seq;
|
|
2195
2195
|
});
|
|
2196
2196
|
|
|
2197
|
-
// node_modules
|
|
2197
|
+
// node_modules/yaml/dist/schema/common/string.js
|
|
2198
2198
|
var require_string = __commonJS((exports) => {
|
|
2199
2199
|
var stringifyString = require_stringifyString();
|
|
2200
2200
|
var string = {
|
|
@@ -2210,7 +2210,7 @@ var require_string = __commonJS((exports) => {
|
|
|
2210
2210
|
exports.string = string;
|
|
2211
2211
|
});
|
|
2212
2212
|
|
|
2213
|
-
// node_modules
|
|
2213
|
+
// node_modules/yaml/dist/schema/common/null.js
|
|
2214
2214
|
var require_null = __commonJS((exports) => {
|
|
2215
2215
|
var Scalar = require_Scalar();
|
|
2216
2216
|
var nullTag = {
|
|
@@ -2225,7 +2225,7 @@ var require_null = __commonJS((exports) => {
|
|
|
2225
2225
|
exports.nullTag = nullTag;
|
|
2226
2226
|
});
|
|
2227
2227
|
|
|
2228
|
-
// node_modules
|
|
2228
|
+
// node_modules/yaml/dist/schema/core/bool.js
|
|
2229
2229
|
var require_bool = __commonJS((exports) => {
|
|
2230
2230
|
var Scalar = require_Scalar();
|
|
2231
2231
|
var boolTag = {
|
|
@@ -2246,7 +2246,7 @@ var require_bool = __commonJS((exports) => {
|
|
|
2246
2246
|
exports.boolTag = boolTag;
|
|
2247
2247
|
});
|
|
2248
2248
|
|
|
2249
|
-
// node_modules
|
|
2249
|
+
// node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
2250
2250
|
var require_stringifyNumber = __commonJS((exports) => {
|
|
2251
2251
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
2252
2252
|
if (typeof value === "bigint")
|
|
@@ -2270,7 +2270,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
2270
2270
|
exports.stringifyNumber = stringifyNumber;
|
|
2271
2271
|
});
|
|
2272
2272
|
|
|
2273
|
-
// node_modules
|
|
2273
|
+
// node_modules/yaml/dist/schema/core/float.js
|
|
2274
2274
|
var require_float = __commonJS((exports) => {
|
|
2275
2275
|
var Scalar = require_Scalar();
|
|
2276
2276
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2313,7 +2313,7 @@ var require_float = __commonJS((exports) => {
|
|
|
2313
2313
|
exports.floatNaN = floatNaN;
|
|
2314
2314
|
});
|
|
2315
2315
|
|
|
2316
|
-
// node_modules
|
|
2316
|
+
// node_modules/yaml/dist/schema/core/int.js
|
|
2317
2317
|
var require_int = __commonJS((exports) => {
|
|
2318
2318
|
var stringifyNumber = require_stringifyNumber();
|
|
2319
2319
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2355,7 +2355,7 @@ var require_int = __commonJS((exports) => {
|
|
|
2355
2355
|
exports.intOct = intOct;
|
|
2356
2356
|
});
|
|
2357
2357
|
|
|
2358
|
-
// node_modules
|
|
2358
|
+
// node_modules/yaml/dist/schema/core/schema.js
|
|
2359
2359
|
var require_schema = __commonJS((exports) => {
|
|
2360
2360
|
var map = require_map();
|
|
2361
2361
|
var _null = require_null();
|
|
@@ -2380,7 +2380,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
2380
2380
|
exports.schema = schema;
|
|
2381
2381
|
});
|
|
2382
2382
|
|
|
2383
|
-
// node_modules
|
|
2383
|
+
// node_modules/yaml/dist/schema/json/schema.js
|
|
2384
2384
|
var require_schema2 = __commonJS((exports) => {
|
|
2385
2385
|
var Scalar = require_Scalar();
|
|
2386
2386
|
var map = require_map();
|
|
@@ -2444,7 +2444,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
2444
2444
|
exports.schema = schema;
|
|
2445
2445
|
});
|
|
2446
2446
|
|
|
2447
|
-
// node_modules
|
|
2447
|
+
// node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
2448
2448
|
var require_binary = __commonJS((exports) => {
|
|
2449
2449
|
var node_buffer = __require("buffer");
|
|
2450
2450
|
var Scalar = require_Scalar();
|
|
@@ -2499,7 +2499,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
2499
2499
|
exports.binary = binary;
|
|
2500
2500
|
});
|
|
2501
2501
|
|
|
2502
|
-
// node_modules
|
|
2502
|
+
// node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
2503
2503
|
var require_pairs = __commonJS((exports) => {
|
|
2504
2504
|
var identity = require_identity();
|
|
2505
2505
|
var Pair = require_Pair();
|
|
@@ -2574,7 +2574,7 @@ ${cn.comment}` : item.comment;
|
|
|
2574
2574
|
exports.resolvePairs = resolvePairs;
|
|
2575
2575
|
});
|
|
2576
2576
|
|
|
2577
|
-
// node_modules
|
|
2577
|
+
// node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
2578
2578
|
var require_omap = __commonJS((exports) => {
|
|
2579
2579
|
var identity = require_identity();
|
|
2580
2580
|
var toJS = require_toJS();
|
|
@@ -2646,7 +2646,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
2646
2646
|
exports.omap = omap;
|
|
2647
2647
|
});
|
|
2648
2648
|
|
|
2649
|
-
// node_modules
|
|
2649
|
+
// node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
2650
2650
|
var require_bool2 = __commonJS((exports) => {
|
|
2651
2651
|
var Scalar = require_Scalar();
|
|
2652
2652
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -2675,7 +2675,7 @@ var require_bool2 = __commonJS((exports) => {
|
|
|
2675
2675
|
exports.trueTag = trueTag;
|
|
2676
2676
|
});
|
|
2677
2677
|
|
|
2678
|
-
// node_modules
|
|
2678
|
+
// node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
2679
2679
|
var require_float2 = __commonJS((exports) => {
|
|
2680
2680
|
var Scalar = require_Scalar();
|
|
2681
2681
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2721,7 +2721,7 @@ var require_float2 = __commonJS((exports) => {
|
|
|
2721
2721
|
exports.floatNaN = floatNaN;
|
|
2722
2722
|
});
|
|
2723
2723
|
|
|
2724
|
-
// node_modules
|
|
2724
|
+
// node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
2725
2725
|
var require_int2 = __commonJS((exports) => {
|
|
2726
2726
|
var stringifyNumber = require_stringifyNumber();
|
|
2727
2727
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2797,7 +2797,7 @@ var require_int2 = __commonJS((exports) => {
|
|
|
2797
2797
|
exports.intOct = intOct;
|
|
2798
2798
|
});
|
|
2799
2799
|
|
|
2800
|
-
// node_modules
|
|
2800
|
+
// node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
2801
2801
|
var require_set = __commonJS((exports) => {
|
|
2802
2802
|
var identity = require_identity();
|
|
2803
2803
|
var Pair = require_Pair();
|
|
@@ -2880,7 +2880,7 @@ var require_set = __commonJS((exports) => {
|
|
|
2880
2880
|
exports.set = set;
|
|
2881
2881
|
});
|
|
2882
2882
|
|
|
2883
|
-
// node_modules
|
|
2883
|
+
// node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
2884
2884
|
var require_timestamp = __commonJS((exports) => {
|
|
2885
2885
|
var stringifyNumber = require_stringifyNumber();
|
|
2886
2886
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -2962,7 +2962,7 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
2962
2962
|
exports.timestamp = timestamp;
|
|
2963
2963
|
});
|
|
2964
2964
|
|
|
2965
|
-
// node_modules
|
|
2965
|
+
// node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
2966
2966
|
var require_schema3 = __commonJS((exports) => {
|
|
2967
2967
|
var map = require_map();
|
|
2968
2968
|
var _null = require_null();
|
|
@@ -3003,7 +3003,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
3003
3003
|
exports.schema = schema;
|
|
3004
3004
|
});
|
|
3005
3005
|
|
|
3006
|
-
// node_modules
|
|
3006
|
+
// node_modules/yaml/dist/schema/tags.js
|
|
3007
3007
|
var require_tags = __commonJS((exports) => {
|
|
3008
3008
|
var map = require_map();
|
|
3009
3009
|
var _null = require_null();
|
|
@@ -3094,7 +3094,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
3094
3094
|
exports.getTags = getTags;
|
|
3095
3095
|
});
|
|
3096
3096
|
|
|
3097
|
-
// node_modules
|
|
3097
|
+
// node_modules/yaml/dist/schema/Schema.js
|
|
3098
3098
|
var require_Schema = __commonJS((exports) => {
|
|
3099
3099
|
var identity = require_identity();
|
|
3100
3100
|
var map = require_map();
|
|
@@ -3124,7 +3124,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
3124
3124
|
exports.Schema = Schema;
|
|
3125
3125
|
});
|
|
3126
3126
|
|
|
3127
|
-
// node_modules
|
|
3127
|
+
// node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
3128
3128
|
var require_stringifyDocument = __commonJS((exports) => {
|
|
3129
3129
|
var identity = require_identity();
|
|
3130
3130
|
var stringify = require_stringify();
|
|
@@ -3204,7 +3204,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
3204
3204
|
exports.stringifyDocument = stringifyDocument;
|
|
3205
3205
|
});
|
|
3206
3206
|
|
|
3207
|
-
// node_modules
|
|
3207
|
+
// node_modules/yaml/dist/doc/Document.js
|
|
3208
3208
|
var require_Document = __commonJS((exports) => {
|
|
3209
3209
|
var Alias = require_Alias();
|
|
3210
3210
|
var Collection = require_Collection();
|
|
@@ -3439,7 +3439,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
3439
3439
|
exports.Document = Document;
|
|
3440
3440
|
});
|
|
3441
3441
|
|
|
3442
|
-
// node_modules
|
|
3442
|
+
// node_modules/yaml/dist/errors.js
|
|
3443
3443
|
var require_errors = __commonJS((exports) => {
|
|
3444
3444
|
class YAMLError extends Error {
|
|
3445
3445
|
constructor(name, pos, code, message) {
|
|
@@ -3504,7 +3504,7 @@ ${pointer}
|
|
|
3504
3504
|
exports.prettifyError = prettifyError;
|
|
3505
3505
|
});
|
|
3506
3506
|
|
|
3507
|
-
// node_modules
|
|
3507
|
+
// node_modules/yaml/dist/compose/resolve-props.js
|
|
3508
3508
|
var require_resolve_props = __commonJS((exports) => {
|
|
3509
3509
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
3510
3510
|
let spaceBefore = false;
|
|
@@ -3634,7 +3634,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
3634
3634
|
exports.resolveProps = resolveProps;
|
|
3635
3635
|
});
|
|
3636
3636
|
|
|
3637
|
-
// node_modules
|
|
3637
|
+
// node_modules/yaml/dist/compose/util-contains-newline.js
|
|
3638
3638
|
var require_util_contains_newline = __commonJS((exports) => {
|
|
3639
3639
|
function containsNewline(key) {
|
|
3640
3640
|
if (!key)
|
|
@@ -3674,7 +3674,7 @@ var require_util_contains_newline = __commonJS((exports) => {
|
|
|
3674
3674
|
exports.containsNewline = containsNewline;
|
|
3675
3675
|
});
|
|
3676
3676
|
|
|
3677
|
-
// node_modules
|
|
3677
|
+
// node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
3678
3678
|
var require_util_flow_indent_check = __commonJS((exports) => {
|
|
3679
3679
|
var utilContainsNewline = require_util_contains_newline();
|
|
3680
3680
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -3689,7 +3689,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
|
|
|
3689
3689
|
exports.flowIndentCheck = flowIndentCheck;
|
|
3690
3690
|
});
|
|
3691
3691
|
|
|
3692
|
-
// node_modules
|
|
3692
|
+
// node_modules/yaml/dist/compose/util-map-includes.js
|
|
3693
3693
|
var require_util_map_includes = __commonJS((exports) => {
|
|
3694
3694
|
var identity = require_identity();
|
|
3695
3695
|
function mapIncludes(ctx, items, search) {
|
|
@@ -3702,7 +3702,7 @@ var require_util_map_includes = __commonJS((exports) => {
|
|
|
3702
3702
|
exports.mapIncludes = mapIncludes;
|
|
3703
3703
|
});
|
|
3704
3704
|
|
|
3705
|
-
// node_modules
|
|
3705
|
+
// node_modules/yaml/dist/compose/resolve-block-map.js
|
|
3706
3706
|
var require_resolve_block_map = __commonJS((exports) => {
|
|
3707
3707
|
var Pair = require_Pair();
|
|
3708
3708
|
var YAMLMap = require_YAMLMap();
|
|
@@ -3809,7 +3809,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
3809
3809
|
exports.resolveBlockMap = resolveBlockMap;
|
|
3810
3810
|
});
|
|
3811
3811
|
|
|
3812
|
-
// node_modules
|
|
3812
|
+
// node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
3813
3813
|
var require_resolve_block_seq = __commonJS((exports) => {
|
|
3814
3814
|
var YAMLSeq = require_YAMLSeq();
|
|
3815
3815
|
var resolveProps = require_resolve_props();
|
|
@@ -3857,7 +3857,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
3857
3857
|
exports.resolveBlockSeq = resolveBlockSeq;
|
|
3858
3858
|
});
|
|
3859
3859
|
|
|
3860
|
-
// node_modules
|
|
3860
|
+
// node_modules/yaml/dist/compose/resolve-end.js
|
|
3861
3861
|
var require_resolve_end = __commonJS((exports) => {
|
|
3862
3862
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
3863
3863
|
let comment = "";
|
|
@@ -3897,7 +3897,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
3897
3897
|
exports.resolveEnd = resolveEnd;
|
|
3898
3898
|
});
|
|
3899
3899
|
|
|
3900
|
-
// node_modules
|
|
3900
|
+
// node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
3901
3901
|
var require_resolve_flow_collection = __commonJS((exports) => {
|
|
3902
3902
|
var identity = require_identity();
|
|
3903
3903
|
var Pair = require_Pair();
|
|
@@ -4088,7 +4088,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
4088
4088
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
4089
4089
|
});
|
|
4090
4090
|
|
|
4091
|
-
// node_modules
|
|
4091
|
+
// node_modules/yaml/dist/compose/compose-collection.js
|
|
4092
4092
|
var require_compose_collection = __commonJS((exports) => {
|
|
4093
4093
|
var identity = require_identity();
|
|
4094
4094
|
var Scalar = require_Scalar();
|
|
@@ -4150,7 +4150,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
4150
4150
|
exports.composeCollection = composeCollection;
|
|
4151
4151
|
});
|
|
4152
4152
|
|
|
4153
|
-
// node_modules
|
|
4153
|
+
// node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4154
4154
|
var require_resolve_block_scalar = __commonJS((exports) => {
|
|
4155
4155
|
var Scalar = require_Scalar();
|
|
4156
4156
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -4343,7 +4343,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
4343
4343
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
4344
4344
|
});
|
|
4345
4345
|
|
|
4346
|
-
// node_modules
|
|
4346
|
+
// node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
4347
4347
|
var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
4348
4348
|
var Scalar = require_Scalar();
|
|
4349
4349
|
var resolveEnd = require_resolve_end();
|
|
@@ -4559,7 +4559,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
4559
4559
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
4560
4560
|
});
|
|
4561
4561
|
|
|
4562
|
-
// node_modules
|
|
4562
|
+
// node_modules/yaml/dist/compose/compose-scalar.js
|
|
4563
4563
|
var require_compose_scalar = __commonJS((exports) => {
|
|
4564
4564
|
var identity = require_identity();
|
|
4565
4565
|
var Scalar = require_Scalar();
|
|
@@ -4637,7 +4637,7 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
4637
4637
|
exports.composeScalar = composeScalar;
|
|
4638
4638
|
});
|
|
4639
4639
|
|
|
4640
|
-
// node_modules
|
|
4640
|
+
// node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
4641
4641
|
var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
4642
4642
|
function emptyScalarPosition(offset, before, pos) {
|
|
4643
4643
|
if (before) {
|
|
@@ -4664,7 +4664,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
|
4664
4664
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
4665
4665
|
});
|
|
4666
4666
|
|
|
4667
|
-
// node_modules
|
|
4667
|
+
// node_modules/yaml/dist/compose/compose-node.js
|
|
4668
4668
|
var require_compose_node = __commonJS((exports) => {
|
|
4669
4669
|
var Alias = require_Alias();
|
|
4670
4670
|
var identity = require_identity();
|
|
@@ -4767,7 +4767,7 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
4767
4767
|
exports.composeNode = composeNode;
|
|
4768
4768
|
});
|
|
4769
4769
|
|
|
4770
|
-
// node_modules
|
|
4770
|
+
// node_modules/yaml/dist/compose/compose-doc.js
|
|
4771
4771
|
var require_compose_doc = __commonJS((exports) => {
|
|
4772
4772
|
var Document = require_Document();
|
|
4773
4773
|
var composeNode = require_compose_node();
|
|
@@ -4807,7 +4807,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
4807
4807
|
exports.composeDoc = composeDoc;
|
|
4808
4808
|
});
|
|
4809
4809
|
|
|
4810
|
-
// node_modules
|
|
4810
|
+
// node_modules/yaml/dist/compose/composer.js
|
|
4811
4811
|
var require_composer = __commonJS((exports) => {
|
|
4812
4812
|
var node_process = __require("process");
|
|
4813
4813
|
var directives = require_directives();
|
|
@@ -4996,7 +4996,7 @@ ${end.comment}` : end.comment;
|
|
|
4996
4996
|
exports.Composer = Composer;
|
|
4997
4997
|
});
|
|
4998
4998
|
|
|
4999
|
-
// node_modules
|
|
4999
|
+
// node_modules/yaml/dist/parse/cst-scalar.js
|
|
5000
5000
|
var require_cst_scalar = __commonJS((exports) => {
|
|
5001
5001
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
5002
5002
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -5186,7 +5186,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
5186
5186
|
exports.setScalarValue = setScalarValue;
|
|
5187
5187
|
});
|
|
5188
5188
|
|
|
5189
|
-
// node_modules
|
|
5189
|
+
// node_modules/yaml/dist/parse/cst-stringify.js
|
|
5190
5190
|
var require_cst_stringify = __commonJS((exports) => {
|
|
5191
5191
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
5192
5192
|
function stringifyToken(token) {
|
|
@@ -5244,7 +5244,7 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
5244
5244
|
exports.stringify = stringify;
|
|
5245
5245
|
});
|
|
5246
5246
|
|
|
5247
|
-
// node_modules
|
|
5247
|
+
// node_modules/yaml/dist/parse/cst-visit.js
|
|
5248
5248
|
var require_cst_visit = __commonJS((exports) => {
|
|
5249
5249
|
var BREAK = Symbol("break visit");
|
|
5250
5250
|
var SKIP = Symbol("skip children");
|
|
@@ -5303,7 +5303,7 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
5303
5303
|
exports.visit = visit;
|
|
5304
5304
|
});
|
|
5305
5305
|
|
|
5306
|
-
// node_modules
|
|
5306
|
+
// node_modules/yaml/dist/parse/cst.js
|
|
5307
5307
|
var require_cst = __commonJS((exports) => {
|
|
5308
5308
|
var cstScalar = require_cst_scalar();
|
|
5309
5309
|
var cstStringify = require_cst_stringify();
|
|
@@ -5404,7 +5404,7 @@ var require_cst = __commonJS((exports) => {
|
|
|
5404
5404
|
exports.tokenType = tokenType;
|
|
5405
5405
|
});
|
|
5406
5406
|
|
|
5407
|
-
// node_modules
|
|
5407
|
+
// node_modules/yaml/dist/parse/lexer.js
|
|
5408
5408
|
var require_lexer = __commonJS((exports) => {
|
|
5409
5409
|
var cst = require_cst();
|
|
5410
5410
|
function isEmpty(ch) {
|
|
@@ -5990,7 +5990,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
5990
5990
|
exports.Lexer = Lexer;
|
|
5991
5991
|
});
|
|
5992
5992
|
|
|
5993
|
-
// node_modules
|
|
5993
|
+
// node_modules/yaml/dist/parse/line-counter.js
|
|
5994
5994
|
var require_line_counter = __commonJS((exports) => {
|
|
5995
5995
|
class LineCounter {
|
|
5996
5996
|
constructor() {
|
|
@@ -6018,7 +6018,7 @@ var require_line_counter = __commonJS((exports) => {
|
|
|
6018
6018
|
exports.LineCounter = LineCounter;
|
|
6019
6019
|
});
|
|
6020
6020
|
|
|
6021
|
-
// node_modules
|
|
6021
|
+
// node_modules/yaml/dist/parse/parser.js
|
|
6022
6022
|
var require_parser = __commonJS((exports) => {
|
|
6023
6023
|
var node_process = __require("process");
|
|
6024
6024
|
var cst = require_cst();
|
|
@@ -6867,7 +6867,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
6867
6867
|
exports.Parser = Parser;
|
|
6868
6868
|
});
|
|
6869
6869
|
|
|
6870
|
-
// node_modules
|
|
6870
|
+
// node_modules/yaml/dist/public-api.js
|
|
6871
6871
|
var require_public_api = __commonJS((exports) => {
|
|
6872
6872
|
var composer = require_composer();
|
|
6873
6873
|
var Document = require_Document();
|
|
@@ -6961,6 +6961,55 @@ var require_public_api = __commonJS((exports) => {
|
|
|
6961
6961
|
exports.stringify = stringify;
|
|
6962
6962
|
});
|
|
6963
6963
|
|
|
6964
|
+
// node_modules/yaml/dist/index.js
|
|
6965
|
+
var require_dist = __commonJS((exports) => {
|
|
6966
|
+
var composer = require_composer();
|
|
6967
|
+
var Document = require_Document();
|
|
6968
|
+
var Schema = require_Schema();
|
|
6969
|
+
var errors = require_errors();
|
|
6970
|
+
var Alias = require_Alias();
|
|
6971
|
+
var identity = require_identity();
|
|
6972
|
+
var Pair = require_Pair();
|
|
6973
|
+
var Scalar = require_Scalar();
|
|
6974
|
+
var YAMLMap = require_YAMLMap();
|
|
6975
|
+
var YAMLSeq = require_YAMLSeq();
|
|
6976
|
+
var cst = require_cst();
|
|
6977
|
+
var lexer = require_lexer();
|
|
6978
|
+
var lineCounter = require_line_counter();
|
|
6979
|
+
var parser = require_parser();
|
|
6980
|
+
var publicApi = require_public_api();
|
|
6981
|
+
var visit = require_visit();
|
|
6982
|
+
exports.Composer = composer.Composer;
|
|
6983
|
+
exports.Document = Document.Document;
|
|
6984
|
+
exports.Schema = Schema.Schema;
|
|
6985
|
+
exports.YAMLError = errors.YAMLError;
|
|
6986
|
+
exports.YAMLParseError = errors.YAMLParseError;
|
|
6987
|
+
exports.YAMLWarning = errors.YAMLWarning;
|
|
6988
|
+
exports.Alias = Alias.Alias;
|
|
6989
|
+
exports.isAlias = identity.isAlias;
|
|
6990
|
+
exports.isCollection = identity.isCollection;
|
|
6991
|
+
exports.isDocument = identity.isDocument;
|
|
6992
|
+
exports.isMap = identity.isMap;
|
|
6993
|
+
exports.isNode = identity.isNode;
|
|
6994
|
+
exports.isPair = identity.isPair;
|
|
6995
|
+
exports.isScalar = identity.isScalar;
|
|
6996
|
+
exports.isSeq = identity.isSeq;
|
|
6997
|
+
exports.Pair = Pair.Pair;
|
|
6998
|
+
exports.Scalar = Scalar.Scalar;
|
|
6999
|
+
exports.YAMLMap = YAMLMap.YAMLMap;
|
|
7000
|
+
exports.YAMLSeq = YAMLSeq.YAMLSeq;
|
|
7001
|
+
exports.CST = cst;
|
|
7002
|
+
exports.Lexer = lexer.Lexer;
|
|
7003
|
+
exports.LineCounter = lineCounter.LineCounter;
|
|
7004
|
+
exports.Parser = parser.Parser;
|
|
7005
|
+
exports.parse = publicApi.parse;
|
|
7006
|
+
exports.parseAllDocuments = publicApi.parseAllDocuments;
|
|
7007
|
+
exports.parseDocument = publicApi.parseDocument;
|
|
7008
|
+
exports.stringify = publicApi.stringify;
|
|
7009
|
+
exports.visit = visit.visit;
|
|
7010
|
+
exports.visitAsync = visit.visitAsync;
|
|
7011
|
+
});
|
|
7012
|
+
|
|
6964
7013
|
// telegram-plugin/secret-detect/suppressor.ts
|
|
6965
7014
|
function isSuppressed(text, start, end) {
|
|
6966
7015
|
const left = Math.max(0, start - WINDOW);
|
|
@@ -7001,7 +7050,7 @@ function deriveSlug(inputs, existing) {
|
|
|
7001
7050
|
return `${base}_${n}`;
|
|
7002
7051
|
}
|
|
7003
7052
|
|
|
7004
|
-
// node_modules
|
|
7053
|
+
// node_modules/boundary/lib/index.js
|
|
7005
7054
|
var require_lib = __commonJS((exports2) => {
|
|
7006
7055
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7007
7056
|
exports2.binarySearch = exports2.upperBound = exports2.lowerBound = exports2.compare = undefined;
|
|
@@ -7048,7 +7097,7 @@ var require_lib = __commonJS((exports2) => {
|
|
|
7048
7097
|
exports2.binarySearch = binarySearch;
|
|
7049
7098
|
});
|
|
7050
7099
|
|
|
7051
|
-
// node_modules
|
|
7100
|
+
// node_modules/structured-source/lib/structured-source.js
|
|
7052
7101
|
var require_structured_source = __commonJS((exports2) => {
|
|
7053
7102
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
7054
7103
|
exports2.StructuredSource = undefined;
|
|
@@ -7103,13 +7152,13 @@ var require_structured_source = __commonJS((exports2) => {
|
|
|
7103
7152
|
}
|
|
7104
7153
|
exports2.StructuredSource = StructuredSource;
|
|
7105
7154
|
});
|
|
7106
|
-
// node_modules
|
|
7155
|
+
// node_modules/@secretlint/core/module/SecretLintSourceCodeImpl.js
|
|
7107
7156
|
var import_structured_source;
|
|
7108
7157
|
var init_SecretLintSourceCodeImpl = __esm(() => {
|
|
7109
7158
|
import_structured_source = __toESM(require_structured_source(), 1);
|
|
7110
7159
|
});
|
|
7111
7160
|
|
|
7112
|
-
// node_modules
|
|
7161
|
+
// node_modules/@secretlint/core/module/helper/promise-event-emitter.js
|
|
7113
7162
|
class EventEmitter {
|
|
7114
7163
|
#listeners = new Map;
|
|
7115
7164
|
on(type, listener) {
|
|
@@ -7148,9 +7197,9 @@ class EventEmitter {
|
|
|
7148
7197
|
return Array.from(this.#listeners.get(type) ?? []);
|
|
7149
7198
|
}
|
|
7150
7199
|
}
|
|
7151
|
-
// node_modules
|
|
7200
|
+
// node_modules/@secretlint/core/module/RuleContext.js
|
|
7152
7201
|
var init_RuleContext = () => {};
|
|
7153
|
-
// node_modules
|
|
7202
|
+
// node_modules/@secretlint/profiler/module/index.js
|
|
7154
7203
|
class SecretLintProfiler {
|
|
7155
7204
|
perf;
|
|
7156
7205
|
entries = [];
|
|
@@ -7207,7 +7256,7 @@ class SecretLintProfiler {
|
|
|
7207
7256
|
}
|
|
7208
7257
|
}
|
|
7209
7258
|
|
|
7210
|
-
// node_modules
|
|
7259
|
+
// node_modules/@secretlint/profiler/module/node.js
|
|
7211
7260
|
import perf_hooks from "node:perf_hooks";
|
|
7212
7261
|
|
|
7213
7262
|
class NullPerformanceObserver {
|
|
@@ -7222,19 +7271,19 @@ var init_node = __esm(() => {
|
|
|
7222
7271
|
});
|
|
7223
7272
|
});
|
|
7224
7273
|
|
|
7225
|
-
// node_modules
|
|
7274
|
+
// node_modules/@secretlint/core/module/RunningEvents.js
|
|
7226
7275
|
var init_RunningEvents = __esm(() => {
|
|
7227
7276
|
init_node();
|
|
7228
7277
|
});
|
|
7229
7278
|
|
|
7230
|
-
// node_modules
|
|
7279
|
+
// node_modules/@secretlint/core/module/RulePresetContext.js
|
|
7231
7280
|
var init_RulePresetContext = __esm(() => {
|
|
7232
7281
|
init_RuleContext();
|
|
7233
7282
|
});
|
|
7234
|
-
// node_modules
|
|
7283
|
+
// node_modules/@secretlint/core/module/messages/index.js
|
|
7235
7284
|
var init_messages = () => {};
|
|
7236
7285
|
|
|
7237
|
-
// node_modules
|
|
7286
|
+
// node_modules/ms/index.js
|
|
7238
7287
|
var require_ms = __commonJS((exports2, module) => {
|
|
7239
7288
|
var s = 1000;
|
|
7240
7289
|
var m = s * 60;
|
|
@@ -7344,7 +7393,7 @@ var require_ms = __commonJS((exports2, module) => {
|
|
|
7344
7393
|
}
|
|
7345
7394
|
});
|
|
7346
7395
|
|
|
7347
|
-
// node_modules
|
|
7396
|
+
// node_modules/debug/src/common.js
|
|
7348
7397
|
var require_common = __commonJS((exports2, module) => {
|
|
7349
7398
|
function setup(env) {
|
|
7350
7399
|
createDebug.debug = createDebug;
|
|
@@ -7519,7 +7568,7 @@ var require_common = __commonJS((exports2, module) => {
|
|
|
7519
7568
|
module.exports = setup;
|
|
7520
7569
|
});
|
|
7521
7570
|
|
|
7522
|
-
// node_modules
|
|
7571
|
+
// node_modules/debug/src/browser.js
|
|
7523
7572
|
var require_browser = __commonJS((exports2, module) => {
|
|
7524
7573
|
exports2.formatArgs = formatArgs;
|
|
7525
7574
|
exports2.save = save;
|
|
@@ -7679,7 +7728,7 @@ var require_browser = __commonJS((exports2, module) => {
|
|
|
7679
7728
|
};
|
|
7680
7729
|
});
|
|
7681
7730
|
|
|
7682
|
-
// node_modules
|
|
7731
|
+
// node_modules/has-flag/index.js
|
|
7683
7732
|
var require_has_flag = __commonJS((exports2, module) => {
|
|
7684
7733
|
module.exports = (flag, argv = process.argv) => {
|
|
7685
7734
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
@@ -7689,7 +7738,7 @@ var require_has_flag = __commonJS((exports2, module) => {
|
|
|
7689
7738
|
};
|
|
7690
7739
|
});
|
|
7691
7740
|
|
|
7692
|
-
// node_modules
|
|
7741
|
+
// node_modules/supports-color/index.js
|
|
7693
7742
|
var require_supports_color = __commonJS((exports2, module) => {
|
|
7694
7743
|
var os = __require("os");
|
|
7695
7744
|
var tty = __require("tty");
|
|
@@ -7788,7 +7837,7 @@ var require_supports_color = __commonJS((exports2, module) => {
|
|
|
7788
7837
|
};
|
|
7789
7838
|
});
|
|
7790
7839
|
|
|
7791
|
-
// node_modules
|
|
7840
|
+
// node_modules/debug/src/node.js
|
|
7792
7841
|
var require_node = __commonJS((exports2, module) => {
|
|
7793
7842
|
var tty = __require("tty");
|
|
7794
7843
|
var util3 = __require("util");
|
|
@@ -7959,7 +8008,7 @@ var require_node = __commonJS((exports2, module) => {
|
|
|
7959
8008
|
};
|
|
7960
8009
|
});
|
|
7961
8010
|
|
|
7962
|
-
// node_modules
|
|
8011
|
+
// node_modules/debug/src/index.js
|
|
7963
8012
|
var require_src = __commonJS((exports2, module) => {
|
|
7964
8013
|
if (typeof process === "undefined" || process.type === "renderer" || false || process.__nwjs) {
|
|
7965
8014
|
module.exports = require_browser();
|
|
@@ -7968,7 +8017,7 @@ var require_src = __commonJS((exports2, module) => {
|
|
|
7968
8017
|
}
|
|
7969
8018
|
});
|
|
7970
8019
|
|
|
7971
|
-
// node_modules
|
|
8020
|
+
// node_modules/@secretlint/core/module/index.js
|
|
7972
8021
|
var import_debug, debug;
|
|
7973
8022
|
var init_module = __esm(() => {
|
|
7974
8023
|
init_SecretLintSourceCodeImpl();
|
|
@@ -7981,7 +8030,7 @@ var init_module = __esm(() => {
|
|
|
7981
8030
|
debug = import_debug.default("@secretlint/core");
|
|
7982
8031
|
});
|
|
7983
8032
|
|
|
7984
|
-
// node_modules
|
|
8033
|
+
// node_modules/@secretlint/secretlint-rule-preset-recommend/module/index.js
|
|
7985
8034
|
function requireLodash_uniq() {
|
|
7986
8035
|
if (hasRequiredLodash_uniq)
|
|
7987
8036
|
return lodash_uniq;
|
|
@@ -9037,7 +9086,7 @@ function requireLodash_sortby() {
|
|
|
9037
9086
|
return value;
|
|
9038
9087
|
}
|
|
9039
9088
|
if (value == null) {
|
|
9040
|
-
return
|
|
9089
|
+
return identity;
|
|
9041
9090
|
}
|
|
9042
9091
|
if (typeof value == "object") {
|
|
9043
9092
|
return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
@@ -9083,7 +9132,7 @@ function requireLodash_sortby() {
|
|
|
9083
9132
|
}
|
|
9084
9133
|
function baseOrderBy(collection, iteratees, orders) {
|
|
9085
9134
|
var index = -1;
|
|
9086
|
-
iteratees = arrayMap(iteratees.length ? iteratees : [
|
|
9135
|
+
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
|
|
9087
9136
|
var result = baseMap(collection, function(value, key, collection2) {
|
|
9088
9137
|
var criteria = arrayMap(iteratees, function(iteratee) {
|
|
9089
9138
|
return iteratee(value);
|
|
@@ -9518,7 +9567,7 @@ function requireLodash_sortby() {
|
|
|
9518
9567
|
function keys(object) {
|
|
9519
9568
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
9520
9569
|
}
|
|
9521
|
-
function
|
|
9570
|
+
function identity(value) {
|
|
9522
9571
|
return value;
|
|
9523
9572
|
}
|
|
9524
9573
|
function property(path) {
|
|
@@ -9664,7 +9713,14 @@ var init_secretlint_source = __esm(() => {
|
|
|
9664
9713
|
init_suppressor();
|
|
9665
9714
|
});
|
|
9666
9715
|
|
|
9667
|
-
//
|
|
9716
|
+
// src/util/atomic.ts
|
|
9717
|
+
import { closeSync as closeSync2, constants, fsyncSync, openSync as openSync2, renameSync, rmSync, writeSync } from "node:fs";
|
|
9718
|
+
var TMP_OPEN_FLAGS;
|
|
9719
|
+
var init_atomic = __esm(() => {
|
|
9720
|
+
TMP_OPEN_FLAGS = constants.O_WRONLY | constants.O_CREAT | constants.O_EXCL | (constants.O_NOFOLLOW ?? 0);
|
|
9721
|
+
});
|
|
9722
|
+
|
|
9723
|
+
// node_modules/commander/lib/error.js
|
|
9668
9724
|
var require_error = __commonJS((exports2) => {
|
|
9669
9725
|
class CommanderError extends Error {
|
|
9670
9726
|
constructor(exitCode, code, message) {
|
|
@@ -9688,7 +9744,7 @@ var require_error = __commonJS((exports2) => {
|
|
|
9688
9744
|
exports2.InvalidArgumentError = InvalidArgumentError;
|
|
9689
9745
|
});
|
|
9690
9746
|
|
|
9691
|
-
// node_modules
|
|
9747
|
+
// node_modules/commander/lib/argument.js
|
|
9692
9748
|
var require_argument = __commonJS((exports2) => {
|
|
9693
9749
|
var { InvalidArgumentError } = require_error();
|
|
9694
9750
|
|
|
@@ -9767,7 +9823,7 @@ var require_argument = __commonJS((exports2) => {
|
|
|
9767
9823
|
exports2.humanReadableArgName = humanReadableArgName;
|
|
9768
9824
|
});
|
|
9769
9825
|
|
|
9770
|
-
// node_modules
|
|
9826
|
+
// node_modules/commander/lib/help.js
|
|
9771
9827
|
var require_help = __commonJS((exports2) => {
|
|
9772
9828
|
var { humanReadableArgName } = require_argument();
|
|
9773
9829
|
|
|
@@ -10117,7 +10173,7 @@ ${itemIndentStr}`);
|
|
|
10117
10173
|
exports2.stripColor = stripColor;
|
|
10118
10174
|
});
|
|
10119
10175
|
|
|
10120
|
-
// node_modules
|
|
10176
|
+
// node_modules/commander/lib/option.js
|
|
10121
10177
|
var require_option = __commonJS((exports2) => {
|
|
10122
10178
|
var { InvalidArgumentError } = require_error();
|
|
10123
10179
|
|
|
@@ -10295,7 +10351,7 @@ var require_option = __commonJS((exports2) => {
|
|
|
10295
10351
|
exports2.DualOptions = DualOptions;
|
|
10296
10352
|
});
|
|
10297
10353
|
|
|
10298
|
-
// node_modules
|
|
10354
|
+
// node_modules/commander/lib/suggestSimilar.js
|
|
10299
10355
|
var require_suggestSimilar = __commonJS((exports2) => {
|
|
10300
10356
|
var maxDistance = 3;
|
|
10301
10357
|
function editDistance(a, b) {
|
|
@@ -10368,7 +10424,7 @@ var require_suggestSimilar = __commonJS((exports2) => {
|
|
|
10368
10424
|
exports2.suggestSimilar = suggestSimilar;
|
|
10369
10425
|
});
|
|
10370
10426
|
|
|
10371
|
-
// node_modules
|
|
10427
|
+
// node_modules/commander/lib/command.js
|
|
10372
10428
|
var require_command = __commonJS((exports2) => {
|
|
10373
10429
|
var EventEmitter2 = __require("node:events").EventEmitter;
|
|
10374
10430
|
var childProcess = __require("node:child_process");
|
|
@@ -11678,7 +11734,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
11678
11734
|
exports2.useColor = useColor;
|
|
11679
11735
|
});
|
|
11680
11736
|
|
|
11681
|
-
// node_modules
|
|
11737
|
+
// node_modules/commander/index.js
|
|
11682
11738
|
var require_commander = __commonJS((exports2) => {
|
|
11683
11739
|
var { Argument } = require_argument();
|
|
11684
11740
|
var { Command } = require_command();
|
|
@@ -11704,57 +11760,12 @@ import { existsSync as existsSync9 } from "node:fs";
|
|
|
11704
11760
|
import { join as join6, resolve as resolve7 } from "node:path";
|
|
11705
11761
|
|
|
11706
11762
|
// src/config/loader.ts
|
|
11763
|
+
var import_yaml2 = __toESM(require_dist(), 1);
|
|
11707
11764
|
import { readFileSync as readFileSync2, existsSync as existsSync3 } from "node:fs";
|
|
11708
11765
|
import { homedir } from "node:os";
|
|
11709
11766
|
import { resolve as resolve3 } from "node:path";
|
|
11710
11767
|
|
|
11711
|
-
// node_modules
|
|
11712
|
-
var composer = require_composer();
|
|
11713
|
-
var Document = require_Document();
|
|
11714
|
-
var Schema = require_Schema();
|
|
11715
|
-
var errors = require_errors();
|
|
11716
|
-
var Alias = require_Alias();
|
|
11717
|
-
var identity = require_identity();
|
|
11718
|
-
var Pair = require_Pair();
|
|
11719
|
-
var Scalar = require_Scalar();
|
|
11720
|
-
var YAMLMap = require_YAMLMap();
|
|
11721
|
-
var YAMLSeq = require_YAMLSeq();
|
|
11722
|
-
var cst = require_cst();
|
|
11723
|
-
var lexer = require_lexer();
|
|
11724
|
-
var lineCounter = require_line_counter();
|
|
11725
|
-
var parser = require_parser();
|
|
11726
|
-
var publicApi = require_public_api();
|
|
11727
|
-
var visit = require_visit();
|
|
11728
|
-
var $Composer = composer.Composer;
|
|
11729
|
-
var $Document = Document.Document;
|
|
11730
|
-
var $Schema = Schema.Schema;
|
|
11731
|
-
var $YAMLError = errors.YAMLError;
|
|
11732
|
-
var $YAMLParseError = errors.YAMLParseError;
|
|
11733
|
-
var $YAMLWarning = errors.YAMLWarning;
|
|
11734
|
-
var $Alias = Alias.Alias;
|
|
11735
|
-
var $isAlias = identity.isAlias;
|
|
11736
|
-
var $isCollection = identity.isCollection;
|
|
11737
|
-
var $isDocument = identity.isDocument;
|
|
11738
|
-
var $isMap = identity.isMap;
|
|
11739
|
-
var $isNode = identity.isNode;
|
|
11740
|
-
var $isPair = identity.isPair;
|
|
11741
|
-
var $isScalar = identity.isScalar;
|
|
11742
|
-
var $isSeq = identity.isSeq;
|
|
11743
|
-
var $Pair = Pair.Pair;
|
|
11744
|
-
var $Scalar = Scalar.Scalar;
|
|
11745
|
-
var $YAMLMap = YAMLMap.YAMLMap;
|
|
11746
|
-
var $YAMLSeq = YAMLSeq.YAMLSeq;
|
|
11747
|
-
var $Lexer = lexer.Lexer;
|
|
11748
|
-
var $LineCounter = lineCounter.LineCounter;
|
|
11749
|
-
var $Parser = parser.Parser;
|
|
11750
|
-
var $parse = publicApi.parse;
|
|
11751
|
-
var $parseAllDocuments = publicApi.parseAllDocuments;
|
|
11752
|
-
var $parseDocument = publicApi.parseDocument;
|
|
11753
|
-
var $stringify = publicApi.stringify;
|
|
11754
|
-
var $visit = visit.visit;
|
|
11755
|
-
var $visitAsync = visit.visitAsync;
|
|
11756
|
-
|
|
11757
|
-
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
11768
|
+
// node_modules/zod/v3/external.js
|
|
11758
11769
|
var exports_external = {};
|
|
11759
11770
|
__export(exports_external, {
|
|
11760
11771
|
void: () => voidType,
|
|
@@ -11866,7 +11877,7 @@ __export(exports_external, {
|
|
|
11866
11877
|
BRAND: () => BRAND
|
|
11867
11878
|
});
|
|
11868
11879
|
|
|
11869
|
-
// node_modules
|
|
11880
|
+
// node_modules/zod/v3/helpers/util.js
|
|
11870
11881
|
var util;
|
|
11871
11882
|
(function(util2) {
|
|
11872
11883
|
util2.assertEqual = (_) => {};
|
|
@@ -11997,7 +12008,7 @@ var getParsedType = (data) => {
|
|
|
11997
12008
|
}
|
|
11998
12009
|
};
|
|
11999
12010
|
|
|
12000
|
-
// node_modules
|
|
12011
|
+
// node_modules/zod/v3/ZodError.js
|
|
12001
12012
|
var ZodIssueCode = util.arrayToEnum([
|
|
12002
12013
|
"invalid_type",
|
|
12003
12014
|
"invalid_literal",
|
|
@@ -12116,7 +12127,7 @@ ZodError.create = (issues) => {
|
|
|
12116
12127
|
return error;
|
|
12117
12128
|
};
|
|
12118
12129
|
|
|
12119
|
-
// node_modules
|
|
12130
|
+
// node_modules/zod/v3/locales/en.js
|
|
12120
12131
|
var errorMap = (issue, _ctx) => {
|
|
12121
12132
|
let message;
|
|
12122
12133
|
switch (issue.code) {
|
|
@@ -12219,7 +12230,7 @@ var errorMap = (issue, _ctx) => {
|
|
|
12219
12230
|
};
|
|
12220
12231
|
var en_default = errorMap;
|
|
12221
12232
|
|
|
12222
|
-
// node_modules
|
|
12233
|
+
// node_modules/zod/v3/errors.js
|
|
12223
12234
|
var overrideErrorMap = en_default;
|
|
12224
12235
|
function setErrorMap(map) {
|
|
12225
12236
|
overrideErrorMap = map;
|
|
@@ -12227,7 +12238,7 @@ function setErrorMap(map) {
|
|
|
12227
12238
|
function getErrorMap() {
|
|
12228
12239
|
return overrideErrorMap;
|
|
12229
12240
|
}
|
|
12230
|
-
// node_modules
|
|
12241
|
+
// node_modules/zod/v3/helpers/parseUtil.js
|
|
12231
12242
|
var makeIssue = (params) => {
|
|
12232
12243
|
const { data, path, errorMaps, issueData } = params;
|
|
12233
12244
|
const fullPath = [...path, ...issueData.path || []];
|
|
@@ -12333,14 +12344,14 @@ var isAborted = (x) => x.status === "aborted";
|
|
|
12333
12344
|
var isDirty = (x) => x.status === "dirty";
|
|
12334
12345
|
var isValid = (x) => x.status === "valid";
|
|
12335
12346
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
12336
|
-
// node_modules
|
|
12347
|
+
// node_modules/zod/v3/helpers/errorUtil.js
|
|
12337
12348
|
var errorUtil;
|
|
12338
12349
|
(function(errorUtil2) {
|
|
12339
12350
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
12340
12351
|
errorUtil2.toString = (message) => typeof message === "string" ? message : message?.message;
|
|
12341
12352
|
})(errorUtil || (errorUtil = {}));
|
|
12342
12353
|
|
|
12343
|
-
// node_modules
|
|
12354
|
+
// node_modules/zod/v3/types.js
|
|
12344
12355
|
class ParseInputLazyPath {
|
|
12345
12356
|
constructor(parent, value, path, key) {
|
|
12346
12357
|
this._cachedPath = [];
|
|
@@ -15921,19 +15932,30 @@ var TelegramChannelSchema = exports_external.object({
|
|
|
15921
15932
|
stream_mode: exports_external.enum(["pty", "checklist"]).optional().describe("How live progress is streamed to Telegram during a turn. " + "'pty' (default) surfaces text snapshots of Claude Code's TUI — " + "compatible but can flicker as Ink re-renders. 'checklist' drives " + "a structured progress card from session-tail events — stable " + "order, per-tool status emojis, fires only on semantic transitions."),
|
|
15922
15933
|
stream_throttle_ms: exports_external.number().int().nonnegative().optional().describe("Throttle window in ms between successive in-place stream edits " + "during a turn. Lower = more responsive stream, higher = fewer API " + "calls. Floored at 250 by draft-stream itself. Default 400 ms for DMs " + "and 1000 ms for groups/forums (respects Telegram's ~1 edit/sec/message " + "practical ceiling). Override per-agent if a particular agent needs " + "snappier or quieter streaming."),
|
|
15923
15934
|
clear_status_on_completion: exports_external.boolean().optional().describe("When true, the live activity/status feed (the in-place 'what it's " + "doing' message — Reading X, Searching the web for Y, …) is DELETED " + "when the turn's final answer lands, so only the reply remains. " + "Default false: the status message is left in the chat as a record " + "(its last step marked done) — no post-then-delete. Per-agent " + "override; cascades defaults → profile → agent (per-key)."),
|
|
15935
|
+
pin_status_while_working: exports_external.boolean().optional().describe("When true (default), the framework SILENTLY pins the already-" + "rendered status message while its work is in-flight and auto-unpins " + "it on completion — the per-turn activity/status message (foreground) " + "and the '\uD83D\uDEE0 Worker' background-worker message. Keeps in-flight work " + "in view when the conversation scrolls past it (fast turns, stacked " + "background workers, long turns). No new surface is rendered; it pins " + "a message the chat already owns. The pin never buzzes the device. " + "The ONE sanctioned pin under chat-is-the-single-source-of-truth. " + "Set false to disable. Per-agent override; cascades defaults → " + "profile → agent (per-key)."),
|
|
15924
15936
|
hotReloadStable: exports_external.boolean().optional().describe("If true, the stable workspace prefix (AGENTS.md, SOUL.md, USER.md, " + "IDENTITY.md, TOOLS.md) is re-injected on every turn via " + "the UserPromptSubmit hook instead of baked into --append-system-prompt " + "at session start. Lets workspace edits propagate without a restart. " + "Costs ~5-10% per-turn latency/spend since the stable prefix is no " + "longer prompt-cached."),
|
|
15925
15937
|
inject_on_change: exports_external.boolean().optional().describe("Context-efficiency gate for per-turn hook injection (default true). " + "When true (the default), the turn-pacing directive and dynamic " + "workspace content are only re-emitted when their content changes or " + "the session_id changes — suppressing redundant injection that " + "otherwise triples compaction frequency. Set to false to revert to " + "the legacy always-emit behaviour (every turn injects the full " + "content regardless of whether it changed)."),
|
|
15926
15938
|
orphan_promotion_ms: exports_external.number().int().nonnegative().optional().describe("How long (ms) a parent turn waits for a sub-agent JSONL watcher " + "to deliver sub_agent_started before the heartbeat promotes the spawn " + "to a synthesised 'running' row. Default 5000. Set to 0 to disable " + "orphan promotion entirely."),
|
|
15927
15939
|
cold_sub_agent_threshold_ms: exports_external.number().int().nonnegative().optional().describe("JSONL-cold threshold (ms). When a running sub-agent emits no events " + "for this long, the heartbeat synthesises a turn_end for it so the " + "deferred-completion path can proceed. Default 30000. Set to 0 to " + "disable the synthetic close."),
|
|
15928
15940
|
deferred_completion_timeout_ms: exports_external.number().int().nonnegative().optional().describe("Force-close timeout (ms) for deferred sub-agent completion. After " + "the parent turn_end arrives while sub-agents are still running, the " + "card is force-closed after this many ms even if sub-agents never " + "finish. Watcher-disconnect safety net. Default 180000 (3 min)."),
|
|
15941
|
+
approval_timeout_minutes: exports_external.number().int().nonnegative().optional().describe("Operator approval-card lifetime (minutes) for the tool-use 'Allow " + "once' card and the vault grant decision wait. After this long with " + "no operator tap, the card auto-denies (a TIMEOUT, not a denial — the " + "agent is told not to retry). Default 60. hostd-gated verbs " + "(mcp__hostd__*) keep their own longer window; the hostd " + "config-propose card is not governed by this key."),
|
|
15929
15942
|
sub_agent_tick_interval_ms: exports_external.number().int().nonnegative().optional().describe("Heartbeat tick interval (ms) for sub-agent rendering. Forces a " + "re-render of the elapsed-time counter while sub-agents are running, " + "even during silent stretches between tool calls. Default 10000 (10 s). " + "Set to 0 to disable the elapsed-ticker path."),
|
|
15930
15943
|
edit_budget_threshold: exports_external.number().int().nonnegative().optional().describe("Telegram API edit budget per minute before the progress-card driver " + "falls back to a slower coalesce window. When a chat accumulates more " + "than this many card edits in the trailing 60 s, the driver switches " + "to a wider coalesce interval until the rate drops back. Default 18. " + "Increase if your gateway frequently bumps the Telegram edit-rate ceiling " + "with many parallel sub-agents; decrease for a more conservative buffer."),
|
|
15931
15944
|
stickers: exports_external.record(exports_external.string(), exports_external.string()).optional().describe("Sticker aliases for the `send_sticker` MCP tool (#576). Maps a " + "short alias name (e.g. 'happy', 'thinking') to a Telegram file_id. " + "Operator-curated — capture file_ids from inbound stickers the user " + "sends and add them here. The agent calls send_sticker(chat_id, " + "alias='happy') and the gateway resolves to the file_id at send " + "time. Aliases enable persona-flavored expressiveness without " + "exposing raw file_ids in the agent prompt. Personal-assistant / " + "health-coach personas benefit; coding agents typically don't " + "configure any."),
|
|
15932
15945
|
voice_in: exports_external.object({
|
|
15933
15946
|
enabled: exports_external.boolean().optional().describe("Master switch for voice-message transcription."),
|
|
15934
15947
|
provider: exports_external.enum(["openai"]).optional().describe("Transcription provider. Only 'openai' (Whisper API) supported in the spike (#578); " + "Groq/Deepgram/local-whisper-cli are follow-up choices."),
|
|
15935
|
-
language: exports_external.string().optional().describe("Optional ISO-639-1 language hint (e.g. 'en', 'fr'). Skips Whisper's auto-detection.")
|
|
15936
|
-
|
|
15948
|
+
language: exports_external.string().optional().describe("Optional ISO-639-1 language hint (e.g. 'en', 'fr'). Skips Whisper's auto-detection."),
|
|
15949
|
+
api_key: exports_external.string().optional().describe("Transcription-provider API key, as a `vault:<key>` reference " + "(e.g. 'vault:openai/api-key' — the default if omitted). The " + "gateway resolves it through the vault broker at use-time and " + "never writes the resolved value to disk or the agent prompt. " + "`switchroom enable voice-in` vault-stores the key and writes " + "this reference for you. A literal key is accepted but " + "discouraged — keep secrets in the vault.")
|
|
15950
|
+
}).optional().describe("Inbound voice-message transcription (#578). When enabled, voice/audio " + "messages from allowlisted users are downloaded, transcribed via the " + "configured provider, and surface to the agent as the user's text. " + "The provider API key is a `vault:` reference (`api_key`, default " + "`vault:openai/api-key`) resolved through the vault broker at " + "use-time — opt-in third-party key, honest-exception per the " + "subscription-honest outcome. Off by default — opt-in per agent. " + "Cascades from defaults.channels.telegram.voice_in. " + "(Migrated from per-agent root in #596 — see consistency unification.)"),
|
|
15951
|
+
voice_out: exports_external.object({
|
|
15952
|
+
enabled: exports_external.boolean().optional().describe("Master switch for spoken-reply (TTS) voice notes."),
|
|
15953
|
+
engine: exports_external.enum(["kokoro", "openai"]).default("kokoro").describe("Synthesis engine. 'kokoro' = local voice sidecar (POST /tts, " + "subscription-honest, no third-party key); 'openai' = OpenAI TTS " + "cloud (honest-exception, requires an `api_key` vault ref). " + "'kokoro' is only active when the host voice verdict is local " + "(SWITCHROOM_VOICE_ENGINE === 'local'); otherwise voice-out is a " + "no-op and replies stay text-only."),
|
|
15954
|
+
voice: exports_external.string().optional().describe("Engine-specific voice id (e.g. a Kokoro voice name or an OpenAI " + "voice like 'alloy'). Optional — the sidecar/engine has its own " + "default when omitted."),
|
|
15955
|
+
reply_mode: exports_external.enum(["voice+text", "voice-only", "on-demand"]).default("voice+text").describe("How the spoken reply accompanies the text. 'voice+text' sends " + "both the normal text reply and a voice note; 'voice-only' sends " + "the voice note and suppresses the text body. 'on-demand' sends " + "the text reply with a single '\uD83D\uDD0A Listen' inline button and " + "synthesizes NO audio until the user taps it — zero GPU/sidecar " + "work unless requested, which keeps the voice pipeline " + "subscription-honest and visible (nothing is generated behind the " + "user's back). The Listen button is injected ONLY when the reply " + "carries no agent-authored buttons, to avoid colliding with the " + "single_use keyboard-strip that protects agent buttons from " + "double-fire. In every mode the text reply is ALWAYS still sent " + "when synthesis fails or the reply exceeds max_chars — the user's " + "answer is never dropped silently."),
|
|
15956
|
+
max_chars: exports_external.number().int().positive().optional().describe("Per-voice-note chunk size (chars). Default 600; clamped to the " + "engine's hard cap (1200). A reply LONGER than this is NOT truncated " + "to text — it's split on sentence/paragraph boundaries and spoken " + "across several sequential voice notes, so the full answer is heard " + "even when the user can't read the screen (driving / cycling). Lower " + "it for snappier individual notes; raise it (up to 1200) for fewer, " + "longer notes."),
|
|
15957
|
+
api_key: exports_external.string().optional().describe("OpenAI TTS API key as a `vault:<key>` reference (only used when " + "engine='openai'; default 'vault:openai/api-key'). Resolved through " + "the vault broker at use-time and never written to disk or the agent " + "prompt. Ignored for engine='kokoro' (the sidecar needs no key).")
|
|
15958
|
+
}).optional().describe("Outbound spoken replies via TTS (PR-C2). When enabled, the gateway " + "synthesizes the agent's text reply into an OGG/Opus voice note and " + "sends it alongside (or instead of) the text, per reply_mode. The " + "'kokoro' engine uses the local voice sidecar (POST /tts) and is only " + "active when the host voice verdict is local; the 'openai' engine is " + "an honest-exception cloud path gated on an `api_key` vault ref. Voice " + "is best-effort and fully non-fatal — any TTS error falls back to the " + "text reply. Off by default — opt-in per agent. " + "Cascades from defaults.channels.telegram.voice_out."),
|
|
15937
15959
|
telegraph: exports_external.object({
|
|
15938
15960
|
enabled: exports_external.boolean().optional().describe("Master switch for Telegraph Instant View publishing."),
|
|
15939
15961
|
threshold: exports_external.number().int().positive().optional().describe("Char count above which a reply is published to Telegraph instead of " + "HTML-chunked into multiple Telegram messages. Default 3000 (≈3 chunks)."),
|
|
@@ -16177,7 +16199,7 @@ var AgentSchema = exports_external.object({
|
|
|
16177
16199
|
secrets: exports_external.array(exports_external.string().regex(/^[a-zA-Z0-9_\-/]+$/, "Secret key names must contain only alphanumeric characters, underscores, hyphens, and forward slashes")).optional(),
|
|
16178
16200
|
reactions: ReactionsSchema,
|
|
16179
16201
|
reaction_dispatch: ReactionDispatchSchema,
|
|
16180
|
-
model: exports_external.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._\-/\[\]:]*$/, "Model name must be alphanumeric with ._-/[]: only (no spaces or shell specials)").optional().describe("Claude model override (e.g., 'claude-sonnet-
|
|
16202
|
+
model: exports_external.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._\-/\[\]:]*$/, "Model name must be alphanumeric with ._-/[]: only (no spaces or shell specials)").optional().describe("Claude model override (e.g., 'claude-sonnet-5')"),
|
|
16181
16203
|
thinking_effort: exports_external.enum(["low", "medium", "high", "xhigh", "max"]).optional().describe("Adaptive-thinking effort level passed as --effort to the claude CLI. " + "Per-agent override wins over defaults.thinking_effort. " + "lower = faster/cheaper, higher = more reasoning. Omit to use Claude's default."),
|
|
16182
16204
|
permission_mode: exports_external.enum(["acceptEdits", "auto", "bypassPermissions", "default", "dontAsk", "plan"]).optional().describe("Permission mode passed as --permission-mode to the claude CLI. " + "Per-agent override wins over defaults.permission_mode. " + "Warning: bypassPermissions and dontAsk skip all safety checks — use only in trusted sandboxes."),
|
|
16183
16205
|
fallback_model: exports_external.string().regex(/^[a-zA-Z0-9][a-zA-Z0-9._\-/\[\]:]*$/, "Fallback model name must be alphanumeric with ._-/[]: only").optional().describe("Fallback model passed as --fallback-model to the claude CLI. " + "Per-agent override wins over defaults.fallback_model. " + "Used when the primary model is overloaded. Note: only functional in --print (non-interactive) mode per Claude CLI docs; silently no-ops in interactive sessions."),
|
|
@@ -16308,6 +16330,11 @@ var HostControlConfigSchema = exports_external.object({
|
|
|
16308
16330
|
var WebServiceConfigSchema = exports_external.object({
|
|
16309
16331
|
managed: exports_external.boolean().default(false).describe("Whether `switchroom update` refreshes the web-service container " + "(dashboard + GitHub-webhook receiver) via `switchroom webd " + "install`. Default: false — existing installs run the web server " + "as the legacy `switchroom-web.service` systemd unit and must not " + "be surprised by a container takeover of host loopback 127.0.0.1:" + "8080 mid-update. Set true ONLY after cutting over to the " + "container (stop+disable the systemd unit, `switchroom webd " + "install`). The container runs in its own compose project " + "(`switchroom-web`), separate from the agent fleet, with " + "network_mode: host so it keeps owning loopback:8080 for the " + "cloudflared tunnel + tailscale serve consumers.")
|
|
16310
16332
|
});
|
|
16333
|
+
var FleetHealthConfigSchema = exports_external.object({
|
|
16334
|
+
owner_agent: exports_external.string().regex(/^[a-z0-9][a-z0-9_-]{0,50}$/, {
|
|
16335
|
+
message: "owner_agent must match the standard agent-name pattern"
|
|
16336
|
+
}).optional().describe("The admin agent that runs the Fleet Health sensor + deep-dive crons " + "(RFC fleet-health.md). Default unset → the feature is inert: no crons " + "are scheduled and the admin page renders its empty state. The named " + "agent must be admin: true. A dedicated owner (not any admin) keeps " + "the fleet-health work attributable, its memory scoped, and its token " + "spend accountable. The detection runs ONLY as operator-set schedules " + "on this agent — never a self-authored loop (on-leash, " + "no-self-escalation).")
|
|
16337
|
+
});
|
|
16311
16338
|
var HostdConfigSchema = exports_external.object({
|
|
16312
16339
|
config_edit_enabled: exports_external.boolean().default(false).describe("Opt-in toggle for the `config_propose_edit` hostd verb (RFC " + "admin-agent-config-edit §3). Default false — the verb returns " + "`E_CONFIG_EDIT_DISABLED` until the operator explicitly flips " + "this to true. When true, admin agents can propose unified-diff " + "patches against " + "`/state/config/switchroom.yaml`, gated by an operator approval " + "card in the primary chat. Same trust posture as `update_apply` " + "and `agent_restart`: the human-in-the-loop tap is the security " + "boundary, not the agent's judgement."),
|
|
16313
16340
|
config_edit_rate_per_hour: exports_external.number().int().min(1).max(20).default(3).describe("Per-requesting-agent rate cap for `config_propose_edit` cards " + "(RFC admin-agent-config-edit §5). Default 3 cards/hour; min 1, " + "max 20. ENFORCED server-side: a caller exceeding this in a sliding " + "1-hour window is rejected with `E_RATE_LIMITED` (carrying a " + "`retry_after` fix) instead of posting another operator approval " + "card — so a looping agent is throttled rather than spamming the chat.")
|
|
@@ -16356,6 +16383,7 @@ var SwitchroomConfigSchema = exports_external.object({
|
|
|
16356
16383
|
quota: QuotaConfigSchema.optional().describe("Optional weekly/monthly USD spend budgets rendered in the session " + "greeting. Usage is read from ccusage at runtime; no network calls."),
|
|
16357
16384
|
host_control: HostControlConfigSchema.default({}).describe("Host-control daemon configuration. Defaults to enabled=true since " + "RFC C Phase 2 (reference/rfcs/host-control-daemon.md). Omit the block " + "to accept defaults; set `enabled: false` only on legacy systemd-" + "mode installs (removal tracked as RFC C Phase 3)."),
|
|
16358
16385
|
hostd: HostdConfigSchema.default({}).describe("hostd verb-level knobs (RFC admin-agent-config-edit). Distinct " + "from `host_control:` which governs whether the daemon runs at " + "all. Scopes the opt-in flag and rate cap for the " + "`config_propose_edit` verb (disabled by default)."),
|
|
16386
|
+
fleet_health: FleetHealthConfigSchema.default({}).describe("Fleet Health — job-spec-anchored, operator-facing issue tracker (RFC " + "fleet-health.md, serves fleet-stays-healthy). Assigns the owner agent " + "that runs the nightly model-free sensor + weekly deep-dive. Default " + "unset owner_agent → inert; the admin page renders an empty state."),
|
|
16359
16387
|
web_service: WebServiceConfigSchema.default({}).describe("Web-service container (dashboard + GitHub-webhook receiver) config. " + "Defaults to managed=false so existing systemd-mode installs are " + "untouched. Set managed: true after cutting over to the " + "`switchroom-web` container — then `switchroom update` keeps it " + "refreshed. See `switchroom webd install`."),
|
|
16360
16388
|
google_accounts: exports_external.record(exports_external.string().regex(/^[^@\s:]+@[^@\s:]+\.[^@\s:]+$/, {
|
|
16361
16389
|
message: "Account key must be a Google account email like 'alice@example.com' (colons not allowed)"
|
|
@@ -16447,6 +16475,7 @@ function resolveDualPath(pathStr) {
|
|
|
16447
16475
|
}
|
|
16448
16476
|
|
|
16449
16477
|
// src/config/overlay-loader.ts
|
|
16478
|
+
var import_yaml = __toESM(require_dist(), 1);
|
|
16450
16479
|
import { existsSync as existsSync2, readFileSync, readdirSync, statSync } from "node:fs";
|
|
16451
16480
|
import { basename, resolve as resolve2 } from "node:path";
|
|
16452
16481
|
|
|
@@ -16522,7 +16551,7 @@ function applyAgentOverlays(config) {
|
|
|
16522
16551
|
for (const file of files) {
|
|
16523
16552
|
try {
|
|
16524
16553
|
const raw = readFileSync(file, "utf-8");
|
|
16525
|
-
const parsed =
|
|
16554
|
+
const parsed = import_yaml.parse(raw);
|
|
16526
16555
|
const doc = OverlayDocSchema.parse(parsed);
|
|
16527
16556
|
const title = deriveOverlayTitle(raw, basename(file));
|
|
16528
16557
|
for (const entry of doc.schedule ?? []) {
|
|
@@ -16563,7 +16592,7 @@ function applyAgentOverlays(config) {
|
|
|
16563
16592
|
for (const file of skillFiles) {
|
|
16564
16593
|
try {
|
|
16565
16594
|
const raw = readFileSync(file, "utf-8");
|
|
16566
|
-
const parsed =
|
|
16595
|
+
const parsed = import_yaml.parse(raw);
|
|
16567
16596
|
const doc = OverlayDocSchema.parse(parsed);
|
|
16568
16597
|
for (const skillName of doc.skills ?? []) {
|
|
16569
16598
|
if (seen.has(skillName))
|
|
@@ -17080,7 +17109,7 @@ function loadConfig(configPath) {
|
|
|
17080
17109
|
}
|
|
17081
17110
|
let parsed;
|
|
17082
17111
|
try {
|
|
17083
|
-
parsed =
|
|
17112
|
+
parsed = import_yaml2.parse(raw);
|
|
17084
17113
|
} catch (err) {
|
|
17085
17114
|
throw new ConfigError(`Invalid YAML in ${filePath}`, [
|
|
17086
17115
|
` ${err.message}`
|
|
@@ -17445,7 +17474,7 @@ function deniedResponse(request_id, error, duration_ms = 0) {
|
|
|
17445
17474
|
// src/analytics/error-friction.ts
|
|
17446
17475
|
import { createHash as createHash2 } from "node:crypto";
|
|
17447
17476
|
|
|
17448
|
-
// node_modules
|
|
17477
|
+
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
17449
17478
|
import { dirname, posix, sep } from "path";
|
|
17450
17479
|
function createModulerModifier() {
|
|
17451
17480
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
@@ -17481,7 +17510,7 @@ function normalizeWindowsPath(path) {
|
|
|
17481
17510
|
return path.replace(/^[A-Z]:/, "").replace(/\\/g, "/");
|
|
17482
17511
|
}
|
|
17483
17512
|
|
|
17484
|
-
// node_modules
|
|
17513
|
+
// node_modules/@posthog/core/dist/featureFlagUtils.mjs
|
|
17485
17514
|
var normalizeFlagsResponse = (flagsResponse) => {
|
|
17486
17515
|
if ("flags" in flagsResponse) {
|
|
17487
17516
|
const featureFlags = getFlagValuesFromFlags(flagsResponse.flags);
|
|
@@ -17552,7 +17581,7 @@ var parsePayload = (response) => {
|
|
|
17552
17581
|
}
|
|
17553
17582
|
};
|
|
17554
17583
|
|
|
17555
|
-
// node_modules
|
|
17584
|
+
// node_modules/@posthog/core/dist/gzip.mjs
|
|
17556
17585
|
function isGzipSupported() {
|
|
17557
17586
|
return "CompressionStream" in globalThis;
|
|
17558
17587
|
}
|
|
@@ -17572,7 +17601,7 @@ async function gzipCompress(input, isDebug = true) {
|
|
|
17572
17601
|
}
|
|
17573
17602
|
}
|
|
17574
17603
|
|
|
17575
|
-
// node_modules
|
|
17604
|
+
// node_modules/@posthog/core/dist/vendor/uuidv7.mjs
|
|
17576
17605
|
/*! For license information please see uuidv7.mjs.LICENSE.txt */
|
|
17577
17606
|
var DIGITS = "0123456789abcdef";
|
|
17578
17607
|
|
|
@@ -17750,7 +17779,7 @@ var defaultGenerator;
|
|
|
17750
17779
|
var uuidv7 = () => uuidv7obj().toString();
|
|
17751
17780
|
var uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator)).generate();
|
|
17752
17781
|
|
|
17753
|
-
// node_modules
|
|
17782
|
+
// node_modules/@posthog/core/dist/types.mjs
|
|
17754
17783
|
var types_PostHogPersistedProperty = /* @__PURE__ */ function(PostHogPersistedProperty) {
|
|
17755
17784
|
PostHogPersistedProperty["AnonymousId"] = "anonymous_id";
|
|
17756
17785
|
PostHogPersistedProperty["DistinctId"] = "distinct_id";
|
|
@@ -17783,7 +17812,7 @@ var types_PostHogPersistedProperty = /* @__PURE__ */ function(PostHogPersistedPr
|
|
|
17783
17812
|
return PostHogPersistedProperty;
|
|
17784
17813
|
}({});
|
|
17785
17814
|
|
|
17786
|
-
// node_modules
|
|
17815
|
+
// node_modules/@posthog/core/dist/utils/bot-detection.mjs
|
|
17787
17816
|
var DEFAULT_BLOCKED_UA_STRS = [
|
|
17788
17817
|
"amazonbot",
|
|
17789
17818
|
"amazonproductbot",
|
|
@@ -17872,7 +17901,7 @@ var isBlockedUA = function(ua, customBlockedUserAgents = []) {
|
|
|
17872
17901
|
return uaLower.indexOf(blockedUaLower) !== -1;
|
|
17873
17902
|
});
|
|
17874
17903
|
};
|
|
17875
|
-
// node_modules
|
|
17904
|
+
// node_modules/@posthog/core/dist/utils/type-utils.mjs
|
|
17876
17905
|
var nativeIsArray = Array.isArray;
|
|
17877
17906
|
var ObjProto = Object.prototype;
|
|
17878
17907
|
var type_utils_hasOwnProperty = ObjProto.hasOwnProperty;
|
|
@@ -17909,7 +17938,7 @@ function isInstanceOf(candidate, base) {
|
|
|
17909
17938
|
}
|
|
17910
17939
|
}
|
|
17911
17940
|
|
|
17912
|
-
// node_modules
|
|
17941
|
+
// node_modules/@posthog/core/dist/utils/number-utils.mjs
|
|
17913
17942
|
function clampToRange(value, min, max, logger, fallbackValue) {
|
|
17914
17943
|
if (min > max) {
|
|
17915
17944
|
logger.warn("min cannot be greater than max.");
|
|
@@ -17929,7 +17958,7 @@ function clampToRange(value, min, max, logger, fallbackValue) {
|
|
|
17929
17958
|
return clampToRange(fallbackValue || max, min, max, logger);
|
|
17930
17959
|
}
|
|
17931
17960
|
|
|
17932
|
-
// node_modules
|
|
17961
|
+
// node_modules/@posthog/core/dist/utils/bucketed-rate-limiter.mjs
|
|
17933
17962
|
var ONE_DAY_IN_MS = 86400000;
|
|
17934
17963
|
|
|
17935
17964
|
class BucketedRateLimiter {
|
|
@@ -17973,7 +18002,7 @@ class BucketedRateLimiter {
|
|
|
17973
18002
|
this._buckets = {};
|
|
17974
18003
|
}
|
|
17975
18004
|
}
|
|
17976
|
-
// node_modules
|
|
18005
|
+
// node_modules/@posthog/core/dist/utils/promise-queue.mjs
|
|
17977
18006
|
class PromiseQueue {
|
|
17978
18007
|
add(promise) {
|
|
17979
18008
|
const promiseUUID = uuidv7();
|
|
@@ -17999,7 +18028,7 @@ class PromiseQueue {
|
|
|
17999
18028
|
this.promiseByIds = {};
|
|
18000
18029
|
}
|
|
18001
18030
|
}
|
|
18002
|
-
// node_modules
|
|
18031
|
+
// node_modules/@posthog/core/dist/utils/logger.mjs
|
|
18003
18032
|
function createConsole(consoleLike = console) {
|
|
18004
18033
|
const lockedMethods = {
|
|
18005
18034
|
log: consoleLike.log.bind(consoleLike),
|
|
@@ -18037,7 +18066,7 @@ var passThrough = (fn) => fn();
|
|
|
18037
18066
|
function createLogger(prefix, maybeCall = passThrough) {
|
|
18038
18067
|
return _createLogger(prefix, maybeCall, createConsole());
|
|
18039
18068
|
}
|
|
18040
|
-
// node_modules
|
|
18069
|
+
// node_modules/@posthog/core/dist/utils/user-agent-utils.mjs
|
|
18041
18070
|
var MOBILE = "Mobile";
|
|
18042
18071
|
var IOS = "iOS";
|
|
18043
18072
|
var ANDROID = "Android";
|
|
@@ -18294,7 +18323,7 @@ var osMatchers = [
|
|
|
18294
18323
|
]
|
|
18295
18324
|
];
|
|
18296
18325
|
|
|
18297
|
-
// node_modules
|
|
18326
|
+
// node_modules/@posthog/core/dist/utils/index.mjs
|
|
18298
18327
|
var STRING_FORMAT = "utf8";
|
|
18299
18328
|
function assert(truthyValue, message) {
|
|
18300
18329
|
if (!truthyValue || typeof truthyValue != "string" || isEmpty(truthyValue))
|
|
@@ -18342,7 +18371,7 @@ function allSettled(promises) {
|
|
|
18342
18371
|
reason
|
|
18343
18372
|
}))));
|
|
18344
18373
|
}
|
|
18345
|
-
// node_modules
|
|
18374
|
+
// node_modules/@posthog/core/dist/eventemitter.mjs
|
|
18346
18375
|
class SimpleEventEmitter {
|
|
18347
18376
|
constructor() {
|
|
18348
18377
|
this.events = {};
|
|
@@ -18364,7 +18393,7 @@ class SimpleEventEmitter {
|
|
|
18364
18393
|
}
|
|
18365
18394
|
}
|
|
18366
18395
|
|
|
18367
|
-
// node_modules
|
|
18396
|
+
// node_modules/@posthog/core/dist/posthog-core-stateless.mjs
|
|
18368
18397
|
class PostHogFetchHttpError extends Error {
|
|
18369
18398
|
constructor(response, reqByteLength) {
|
|
18370
18399
|
super("HTTP error while fetching PostHog: status=" + response.status + ", reqByteLength=" + reqByteLength), this.response = response, this.reqByteLength = reqByteLength, this.name = "PostHogFetchHttpError";
|
|
@@ -19079,7 +19108,7 @@ class PostHogCoreStateless {
|
|
|
19079
19108
|
return this.shutdownPromise;
|
|
19080
19109
|
}
|
|
19081
19110
|
}
|
|
19082
|
-
// node_modules
|
|
19111
|
+
// node_modules/@posthog/core/dist/error-tracking/index.mjs
|
|
19083
19112
|
var exports_error_tracking = {};
|
|
19084
19113
|
__export(exports_error_tracking, {
|
|
19085
19114
|
winjsStackLineParser: () => winjsStackLineParser,
|
|
@@ -19103,7 +19132,7 @@ __export(exports_error_tracking, {
|
|
|
19103
19132
|
DOMExceptionCoercer: () => DOMExceptionCoercer
|
|
19104
19133
|
});
|
|
19105
19134
|
|
|
19106
|
-
// node_modules
|
|
19135
|
+
// node_modules/@posthog/core/dist/error-tracking/chunk-ids.mjs
|
|
19107
19136
|
var parsedStackResults;
|
|
19108
19137
|
var lastKeysCount;
|
|
19109
19138
|
var cachedFilenameChunkIds;
|
|
@@ -19142,7 +19171,7 @@ function getFilenameToChunkIdMap(stackParser) {
|
|
|
19142
19171
|
return cachedFilenameChunkIds;
|
|
19143
19172
|
}
|
|
19144
19173
|
|
|
19145
|
-
// node_modules
|
|
19174
|
+
// node_modules/@posthog/core/dist/error-tracking/error-properties-builder.mjs
|
|
19146
19175
|
var MAX_CAUSE_RECURSION = 4;
|
|
19147
19176
|
|
|
19148
19177
|
class ErrorPropertiesBuilder {
|
|
@@ -19264,7 +19293,7 @@ class ErrorPropertiesBuilder {
|
|
|
19264
19293
|
return context;
|
|
19265
19294
|
}
|
|
19266
19295
|
}
|
|
19267
|
-
// node_modules
|
|
19296
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/base.mjs
|
|
19268
19297
|
var UNKNOWN_FUNCTION = "?";
|
|
19269
19298
|
function createFrame(platform, filename, func, lineno, colno) {
|
|
19270
19299
|
const frame = {
|
|
@@ -19280,7 +19309,7 @@ function createFrame(platform, filename, func, lineno, colno) {
|
|
|
19280
19309
|
return frame;
|
|
19281
19310
|
}
|
|
19282
19311
|
|
|
19283
|
-
// node_modules
|
|
19312
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/safari.mjs
|
|
19284
19313
|
var extractSafariExtensionDetails = (func, filename) => {
|
|
19285
19314
|
const isSafariExtension = func.indexOf("safari-extension") !== -1;
|
|
19286
19315
|
const isSafariWebExtension = func.indexOf("safari-web-extension") !== -1;
|
|
@@ -19293,7 +19322,7 @@ var extractSafariExtensionDetails = (func, filename) => {
|
|
|
19293
19322
|
];
|
|
19294
19323
|
};
|
|
19295
19324
|
|
|
19296
|
-
// node_modules
|
|
19325
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/chrome.mjs
|
|
19297
19326
|
var chromeRegexNoFnName = /^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i;
|
|
19298
19327
|
var chromeRegex = /^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i;
|
|
19299
19328
|
var chromeEvalRegex = /\((\S*)(?::(\d+))(?::(\d+))\)/;
|
|
@@ -19319,7 +19348,7 @@ var chromeStackLineParser = (line, platform) => {
|
|
|
19319
19348
|
}
|
|
19320
19349
|
};
|
|
19321
19350
|
|
|
19322
|
-
// node_modules
|
|
19351
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/gecko.mjs
|
|
19323
19352
|
var geckoREgex = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i;
|
|
19324
19353
|
var geckoEvalRegex = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i;
|
|
19325
19354
|
var geckoStackLineParser = (line, platform) => {
|
|
@@ -19342,14 +19371,14 @@ var geckoStackLineParser = (line, platform) => {
|
|
|
19342
19371
|
}
|
|
19343
19372
|
};
|
|
19344
19373
|
|
|
19345
|
-
// node_modules
|
|
19374
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/winjs.mjs
|
|
19346
19375
|
var winjsRegex = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i;
|
|
19347
19376
|
var winjsStackLineParser = (line, platform) => {
|
|
19348
19377
|
const parts = winjsRegex.exec(line);
|
|
19349
19378
|
return parts ? createFrame(platform, parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined) : undefined;
|
|
19350
19379
|
};
|
|
19351
19380
|
|
|
19352
|
-
// node_modules
|
|
19381
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/opera.mjs
|
|
19353
19382
|
var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i;
|
|
19354
19383
|
var opera10StackLineParser = (line, platform) => {
|
|
19355
19384
|
const parts = opera10Regex.exec(line);
|
|
@@ -19361,7 +19390,7 @@ var opera11StackLineParser = (line, platform) => {
|
|
|
19361
19390
|
return parts ? createFrame(platform, parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;
|
|
19362
19391
|
};
|
|
19363
19392
|
|
|
19364
|
-
// node_modules
|
|
19393
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/node.mjs
|
|
19365
19394
|
var FILENAME_MATCH = /^\s*[-]{4,}$/;
|
|
19366
19395
|
var FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
|
|
19367
19396
|
var nodeStackLineParser = (line, platform) => {
|
|
@@ -19430,7 +19459,7 @@ function _parseIntOrUndefined(input) {
|
|
|
19430
19459
|
return parseInt(input || "", 10) || undefined;
|
|
19431
19460
|
}
|
|
19432
19461
|
|
|
19433
|
-
// node_modules
|
|
19462
|
+
// node_modules/@posthog/core/dist/error-tracking/parsers/index.mjs
|
|
19434
19463
|
var WEBPACK_ERROR_REGEXP = /\(error: (.*)\)/;
|
|
19435
19464
|
var STACKTRACE_FRAME_LIMIT = 50;
|
|
19436
19465
|
function reverseAndStripFrames(stack) {
|
|
@@ -19461,8 +19490,8 @@ function createStackParser(platform, ...parsers) {
|
|
|
19461
19490
|
continue;
|
|
19462
19491
|
const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, "$1") : line;
|
|
19463
19492
|
if (!cleanedLine.match(/\S*Error: /)) {
|
|
19464
|
-
for (const
|
|
19465
|
-
const frame =
|
|
19493
|
+
for (const parser of parsers) {
|
|
19494
|
+
const frame = parser(cleanedLine, platform);
|
|
19466
19495
|
if (frame) {
|
|
19467
19496
|
frames.push(frame);
|
|
19468
19497
|
break;
|
|
@@ -19475,7 +19504,7 @@ function createStackParser(platform, ...parsers) {
|
|
|
19475
19504
|
return reverseAndStripFrames(frames);
|
|
19476
19505
|
};
|
|
19477
19506
|
}
|
|
19478
|
-
// node_modules
|
|
19507
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/dom-exception-coercer.mjs
|
|
19479
19508
|
class DOMExceptionCoercer {
|
|
19480
19509
|
match(err) {
|
|
19481
19510
|
return this.isDOMException(err) || this.isDOMError(err);
|
|
@@ -19505,7 +19534,7 @@ class DOMExceptionCoercer {
|
|
|
19505
19534
|
return isBuiltin(err, "DOMError");
|
|
19506
19535
|
}
|
|
19507
19536
|
}
|
|
19508
|
-
// node_modules
|
|
19537
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/error-coercer.mjs
|
|
19509
19538
|
class ErrorCoercer {
|
|
19510
19539
|
match(err) {
|
|
19511
19540
|
return isPlainError(err);
|
|
@@ -19532,7 +19561,7 @@ class ErrorCoercer {
|
|
|
19532
19561
|
return err.stacktrace || err.stack || undefined;
|
|
19533
19562
|
}
|
|
19534
19563
|
}
|
|
19535
|
-
// node_modules
|
|
19564
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/error-event-coercer.mjs
|
|
19536
19565
|
class ErrorEventCoercer {
|
|
19537
19566
|
constructor() {}
|
|
19538
19567
|
match(err) {
|
|
@@ -19550,7 +19579,7 @@ class ErrorEventCoercer {
|
|
|
19550
19579
|
return exceptionLike;
|
|
19551
19580
|
}
|
|
19552
19581
|
}
|
|
19553
|
-
// node_modules
|
|
19582
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/string-coercer.mjs
|
|
19554
19583
|
var ERROR_TYPES_PATTERN = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;
|
|
19555
19584
|
|
|
19556
19585
|
class StringCoercer {
|
|
@@ -19580,7 +19609,7 @@ class StringCoercer {
|
|
|
19580
19609
|
];
|
|
19581
19610
|
}
|
|
19582
19611
|
}
|
|
19583
|
-
// node_modules
|
|
19612
|
+
// node_modules/@posthog/core/dist/error-tracking/types.mjs
|
|
19584
19613
|
var severityLevels = [
|
|
19585
19614
|
"fatal",
|
|
19586
19615
|
"error",
|
|
@@ -19590,7 +19619,7 @@ var severityLevels = [
|
|
|
19590
19619
|
"debug"
|
|
19591
19620
|
];
|
|
19592
19621
|
|
|
19593
|
-
// node_modules
|
|
19622
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/utils.mjs
|
|
19594
19623
|
function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
19595
19624
|
const keys = Object.keys(err);
|
|
19596
19625
|
keys.sort();
|
|
@@ -19607,7 +19636,7 @@ function extractExceptionKeysForMessage(err, maxLength = 40) {
|
|
|
19607
19636
|
return "";
|
|
19608
19637
|
}
|
|
19609
19638
|
|
|
19610
|
-
// node_modules
|
|
19639
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/object-coercer.mjs
|
|
19611
19640
|
class ObjectCoercer {
|
|
19612
19641
|
match(candidate) {
|
|
19613
19642
|
return typeof candidate == "object" && candidate !== null;
|
|
@@ -19660,7 +19689,7 @@ class ObjectCoercer {
|
|
|
19660
19689
|
}
|
|
19661
19690
|
}
|
|
19662
19691
|
}
|
|
19663
|
-
// node_modules
|
|
19692
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/event-coercer.mjs
|
|
19664
19693
|
class EventCoercer {
|
|
19665
19694
|
match(err) {
|
|
19666
19695
|
return isEvent(err);
|
|
@@ -19675,7 +19704,7 @@ class EventCoercer {
|
|
|
19675
19704
|
};
|
|
19676
19705
|
}
|
|
19677
19706
|
}
|
|
19678
|
-
// node_modules
|
|
19707
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/primitive-coercer.mjs
|
|
19679
19708
|
class PrimitiveCoercer {
|
|
19680
19709
|
match(candidate) {
|
|
19681
19710
|
return isPrimitive(candidate);
|
|
@@ -19689,7 +19718,7 @@ class PrimitiveCoercer {
|
|
|
19689
19718
|
};
|
|
19690
19719
|
}
|
|
19691
19720
|
}
|
|
19692
|
-
// node_modules
|
|
19721
|
+
// node_modules/@posthog/core/dist/error-tracking/coercers/promise-rejection-event.mjs
|
|
19693
19722
|
class PromiseRejectionEventCoercer {
|
|
19694
19723
|
match(err) {
|
|
19695
19724
|
return isBuiltin(err, "PromiseRejectionEvent") || this.isCustomEventWrappingRejection(err);
|
|
@@ -19725,7 +19754,7 @@ class PromiseRejectionEventCoercer {
|
|
|
19725
19754
|
return error;
|
|
19726
19755
|
}
|
|
19727
19756
|
}
|
|
19728
|
-
// node_modules
|
|
19757
|
+
// node_modules/@posthog/core/dist/error-tracking/utils.mjs
|
|
19729
19758
|
class ReduceableCache {
|
|
19730
19759
|
constructor(_maxSize) {
|
|
19731
19760
|
this._maxSize = _maxSize;
|
|
@@ -19750,7 +19779,7 @@ class ReduceableCache {
|
|
|
19750
19779
|
}
|
|
19751
19780
|
}
|
|
19752
19781
|
}
|
|
19753
|
-
// node_modules
|
|
19782
|
+
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/context-lines.node.mjs
|
|
19754
19783
|
import { createReadStream } from "node:fs";
|
|
19755
19784
|
import { createInterface } from "node:readline";
|
|
19756
19785
|
var LRU_FILE_CONTENTS_CACHE = new exports_error_tracking.ReduceableCache(25);
|
|
@@ -19968,7 +19997,7 @@ function snipLine(line, colno) {
|
|
|
19968
19997
|
return newLine;
|
|
19969
19998
|
}
|
|
19970
19999
|
|
|
19971
|
-
// node_modules
|
|
20000
|
+
// node_modules/posthog-node/dist/extensions/error-tracking/autocapture.mjs
|
|
19972
20001
|
function makeUncaughtExceptionHandler(captureFn, onFatalFn) {
|
|
19973
20002
|
let calledFatalError = false;
|
|
19974
20003
|
return Object.assign((error) => {
|
|
@@ -20000,7 +20029,7 @@ function addUnhandledRejectionListener(captureFn) {
|
|
|
20000
20029
|
}));
|
|
20001
20030
|
}
|
|
20002
20031
|
|
|
20003
|
-
// node_modules
|
|
20032
|
+
// node_modules/posthog-node/dist/extensions/error-tracking/index.mjs
|
|
20004
20033
|
var SHUTDOWN_TIMEOUT = 2000;
|
|
20005
20034
|
|
|
20006
20035
|
class ErrorTracking {
|
|
@@ -20069,10 +20098,10 @@ class ErrorTracking {
|
|
|
20069
20098
|
}
|
|
20070
20099
|
}
|
|
20071
20100
|
|
|
20072
|
-
// node_modules
|
|
20101
|
+
// node_modules/posthog-node/dist/version.mjs
|
|
20073
20102
|
var version = "5.29.2";
|
|
20074
20103
|
|
|
20075
|
-
// node_modules
|
|
20104
|
+
// node_modules/posthog-node/dist/types.mjs
|
|
20076
20105
|
var FeatureFlagError2 = {
|
|
20077
20106
|
ERRORS_WHILE_COMPUTING: "errors_while_computing_flags",
|
|
20078
20107
|
FLAG_MISSING: "flag_missing",
|
|
@@ -20080,7 +20109,7 @@ var FeatureFlagError2 = {
|
|
|
20080
20109
|
UNKNOWN_ERROR: "unknown_error"
|
|
20081
20110
|
};
|
|
20082
20111
|
|
|
20083
|
-
// node_modules
|
|
20112
|
+
// node_modules/posthog-node/dist/extensions/feature-flags/crypto.mjs
|
|
20084
20113
|
async function hashSHA1(text) {
|
|
20085
20114
|
const subtle = globalThis.crypto?.subtle;
|
|
20086
20115
|
if (!subtle)
|
|
@@ -20090,7 +20119,7 @@ async function hashSHA1(text) {
|
|
|
20090
20119
|
return hashArray.map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
20091
20120
|
}
|
|
20092
20121
|
|
|
20093
|
-
// node_modules
|
|
20122
|
+
// node_modules/posthog-node/dist/extensions/feature-flags/feature-flags.mjs
|
|
20094
20123
|
var SIXTY_SECONDS = 60000;
|
|
20095
20124
|
var LONG_SCALE = 1152921504606847000;
|
|
20096
20125
|
var NULL_VALUES_ALLOWED_OPERATORS = [
|
|
@@ -20964,7 +20993,7 @@ function relativeDateParseForFeatureFlagMatching(value) {
|
|
|
20964
20993
|
}
|
|
20965
20994
|
}
|
|
20966
20995
|
|
|
20967
|
-
// node_modules
|
|
20996
|
+
// node_modules/posthog-node/dist/storage-memory.mjs
|
|
20968
20997
|
class PostHogMemoryStorage {
|
|
20969
20998
|
getProperty(key) {
|
|
20970
20999
|
return this._memoryStorage[key];
|
|
@@ -20977,7 +21006,7 @@ class PostHogMemoryStorage {
|
|
|
20977
21006
|
}
|
|
20978
21007
|
}
|
|
20979
21008
|
|
|
20980
|
-
// node_modules
|
|
21009
|
+
// node_modules/posthog-node/dist/client.mjs
|
|
20981
21010
|
var MINIMUM_POLLING_INTERVAL = 100;
|
|
20982
21011
|
var THIRTY_SECONDS = 30000;
|
|
20983
21012
|
var MAX_CACHE_SIZE = 50000;
|
|
@@ -21271,14 +21300,14 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
21271
21300
|
else {
|
|
21272
21301
|
requestId = flagsResponse.requestId;
|
|
21273
21302
|
evaluatedAt = flagsResponse.evaluatedAt;
|
|
21274
|
-
const
|
|
21303
|
+
const errors2 = [];
|
|
21275
21304
|
if (flagsResponse.errorsWhileComputingFlags)
|
|
21276
|
-
|
|
21305
|
+
errors2.push(FeatureFlagError2.ERRORS_WHILE_COMPUTING);
|
|
21277
21306
|
if (flagsResponse.quotaLimited?.includes("feature_flags"))
|
|
21278
|
-
|
|
21307
|
+
errors2.push(FeatureFlagError2.QUOTA_LIMITED);
|
|
21279
21308
|
const flagDetail = flagsResponse.flags[key];
|
|
21280
21309
|
if (flagDetail === undefined)
|
|
21281
|
-
|
|
21310
|
+
errors2.push(FeatureFlagError2.FLAG_MISSING);
|
|
21282
21311
|
else {
|
|
21283
21312
|
flagId = flagDetail.metadata?.id;
|
|
21284
21313
|
flagVersion = flagDetail.metadata?.version;
|
|
@@ -21297,8 +21326,8 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
21297
21326
|
payload: parsedPayload
|
|
21298
21327
|
};
|
|
21299
21328
|
}
|
|
21300
|
-
if (
|
|
21301
|
-
featureFlagError =
|
|
21329
|
+
if (errors2.length > 0)
|
|
21330
|
+
featureFlagError = errors2.join(",");
|
|
21302
21331
|
}
|
|
21303
21332
|
}
|
|
21304
21333
|
if (sendFeatureFlagEvents) {
|
|
@@ -21765,7 +21794,7 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
21765
21794
|
}
|
|
21766
21795
|
}
|
|
21767
21796
|
|
|
21768
|
-
// node_modules
|
|
21797
|
+
// node_modules/posthog-node/dist/extensions/context/context.mjs
|
|
21769
21798
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
21770
21799
|
|
|
21771
21800
|
class PostHogContext {
|
|
@@ -21796,7 +21825,7 @@ class PostHogContext {
|
|
|
21796
21825
|
}
|
|
21797
21826
|
}
|
|
21798
21827
|
|
|
21799
|
-
// node_modules
|
|
21828
|
+
// node_modules/posthog-node/dist/extensions/sentry-integration.mjs
|
|
21800
21829
|
var NAME = "posthog-node";
|
|
21801
21830
|
function createEventProcessor(_posthog, { organization, projectId, prefix, severityAllowList = [
|
|
21802
21831
|
"error"
|
|
@@ -21864,7 +21893,7 @@ class PostHogSentryIntegration {
|
|
|
21864
21893
|
};
|
|
21865
21894
|
}
|
|
21866
21895
|
}
|
|
21867
|
-
// node_modules
|
|
21896
|
+
// node_modules/posthog-node/dist/entrypoints/index.node.mjs
|
|
21868
21897
|
ErrorTracking.errorPropertiesBuilder = new exports_error_tracking.ErrorPropertiesBuilder([
|
|
21869
21898
|
new exports_error_tracking.EventCoercer,
|
|
21870
21899
|
new exports_error_tracking.ErrorCoercer,
|
|
@@ -22584,16 +22613,18 @@ function detectInstallType() {
|
|
|
22584
22613
|
}
|
|
22585
22614
|
}
|
|
22586
22615
|
|
|
22587
|
-
// src/
|
|
22588
|
-
|
|
22589
|
-
|
|
22616
|
+
// src/cli/release-yaml.ts
|
|
22617
|
+
var import_yaml3 = __toESM(require_dist(), 1);
|
|
22618
|
+
|
|
22619
|
+
// src/cli/rollout.ts
|
|
22620
|
+
init_atomic();
|
|
22590
22621
|
|
|
22591
22622
|
// src/cli/resolve-version.ts
|
|
22592
22623
|
import { existsSync as existsSync6, readFileSync as readFileSync4 } from "node:fs";
|
|
22593
22624
|
import { dirname as dirname4, join as join2 } from "node:path";
|
|
22594
22625
|
|
|
22595
22626
|
// src/build-info.ts
|
|
22596
|
-
var VERSION = "0.16.
|
|
22627
|
+
var VERSION = "0.16.46";
|
|
22597
22628
|
|
|
22598
22629
|
// src/cli/resolve-version.ts
|
|
22599
22630
|
function readPackageVersion() {
|
|
@@ -22696,15 +22727,85 @@ function parseAuditLine(line) {
|
|
|
22696
22727
|
entry.failed_step = o.failed_step;
|
|
22697
22728
|
if (typeof o.failed_agent === "string")
|
|
22698
22729
|
entry.failed_agent = o.failed_agent;
|
|
22730
|
+
if (typeof o.agent === "string")
|
|
22731
|
+
entry.agent = o.agent;
|
|
22732
|
+
if (typeof o.n === "number")
|
|
22733
|
+
entry.n = o.n;
|
|
22734
|
+
if (typeof o.m === "number")
|
|
22735
|
+
entry.m = o.m;
|
|
22699
22736
|
if (typeof o.prior_pin === "string")
|
|
22700
22737
|
entry.prior_pin = o.prior_pin;
|
|
22701
22738
|
return entry;
|
|
22702
22739
|
}
|
|
22740
|
+
function latestRolloutRowForRequest(raw, requestId) {
|
|
22741
|
+
const ROLLOUT_OPS = new Set(["rollout", "rollout_orphaned"]);
|
|
22742
|
+
let latest = null;
|
|
22743
|
+
for (const line of raw.split(`
|
|
22744
|
+
`)) {
|
|
22745
|
+
const e = parseAuditLine(line);
|
|
22746
|
+
if (e === null)
|
|
22747
|
+
continue;
|
|
22748
|
+
if (e.request_id !== requestId)
|
|
22749
|
+
continue;
|
|
22750
|
+
if (!ROLLOUT_OPS.has(e.op))
|
|
22751
|
+
continue;
|
|
22752
|
+
latest = e;
|
|
22753
|
+
}
|
|
22754
|
+
return latest;
|
|
22755
|
+
}
|
|
22756
|
+
|
|
22757
|
+
// src/setup/hindsight.ts
|
|
22758
|
+
var HINDSIGHT_CONSUMER_NAME = "hindsight";
|
|
22759
|
+
var HINDSIGHT_IMAGE_REPO = "ghcr.io/switchroom/switchroom-hindsight";
|
|
22760
|
+
var HINDSIGHT_IMAGE = `${HINDSIGHT_IMAGE_REPO}:latest`;
|
|
22761
|
+
var HINDSIGHT_BROKER_SOCK_VOLUME = `auth-broker-${HINDSIGHT_CONSUMER_NAME}-sock`;
|
|
22762
|
+
var HINDSIGHT_HEALTHCHECK_PY = 'import urllib.request,sys; sys.exit(0 if urllib.request.urlopen("http://localhost:8888/health",timeout=4).getcode()==200 else 1)';
|
|
22763
|
+
var HINDSIGHT_HEALTHCHECK_CMD = `python3 -c '${HINDSIGHT_HEALTHCHECK_PY}'`;
|
|
22703
22764
|
|
|
22704
22765
|
// src/cli/rollout.ts
|
|
22705
22766
|
function isVersionAssertable(target) {
|
|
22706
22767
|
return /^v?\d+\.\d+\.\d+$/.test(target.trim());
|
|
22707
22768
|
}
|
|
22769
|
+
var ROLLOUT_PHASE_SENTINEL = "SWITCHROOM_ROLLOUT_PHASE:";
|
|
22770
|
+
function parseRolloutPhaseLine(line) {
|
|
22771
|
+
const trimmed = line.trim();
|
|
22772
|
+
if (!trimmed.startsWith(ROLLOUT_PHASE_SENTINEL))
|
|
22773
|
+
return null;
|
|
22774
|
+
let obj;
|
|
22775
|
+
try {
|
|
22776
|
+
obj = JSON.parse(trimmed.slice(ROLLOUT_PHASE_SENTINEL.length));
|
|
22777
|
+
} catch {
|
|
22778
|
+
return null;
|
|
22779
|
+
}
|
|
22780
|
+
if (typeof obj !== "object" || obj === null)
|
|
22781
|
+
return null;
|
|
22782
|
+
const o = obj;
|
|
22783
|
+
const PHASES = new Set([
|
|
22784
|
+
"apply",
|
|
22785
|
+
"canary-start",
|
|
22786
|
+
"canary-pass",
|
|
22787
|
+
"canary-fail",
|
|
22788
|
+
"agent-start",
|
|
22789
|
+
"agent-done",
|
|
22790
|
+
"persist-pin",
|
|
22791
|
+
"hostd-web-deferred"
|
|
22792
|
+
]);
|
|
22793
|
+
if (typeof o.phase !== "string" || !PHASES.has(o.phase))
|
|
22794
|
+
return null;
|
|
22795
|
+
if (typeof o.target !== "string")
|
|
22796
|
+
return null;
|
|
22797
|
+
const out = {
|
|
22798
|
+
phase: o.phase,
|
|
22799
|
+
target: o.target
|
|
22800
|
+
};
|
|
22801
|
+
if (typeof o.agent === "string")
|
|
22802
|
+
out.agent = o.agent;
|
|
22803
|
+
if (typeof o.n === "number")
|
|
22804
|
+
out.n = o.n;
|
|
22805
|
+
if (typeof o.m === "number")
|
|
22806
|
+
out.m = o.m;
|
|
22807
|
+
return out;
|
|
22808
|
+
}
|
|
22708
22809
|
var ROLLOUT_RESULT_SENTINEL = "SWITCHROOM_ROLLOUT_RESULT:";
|
|
22709
22810
|
function parseRolloutResultLine(stdout) {
|
|
22710
22811
|
const lines = stdout.split(`
|
|
@@ -22722,7 +22823,7 @@ function parseRolloutResultLine(stdout) {
|
|
|
22722
22823
|
return null;
|
|
22723
22824
|
}
|
|
22724
22825
|
|
|
22725
|
-
// node_modules
|
|
22826
|
+
// node_modules/commander/esm.mjs
|
|
22726
22827
|
var import__3 = __toESM(require_commander(), 1);
|
|
22727
22828
|
|
|
22728
22829
|
// src/cli/update.ts
|
|
@@ -22735,6 +22836,19 @@ import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
|
22735
22836
|
// src/agents/tmux.ts
|
|
22736
22837
|
var MAX_BYTES = 10 * 1024 * 1024;
|
|
22737
22838
|
|
|
22839
|
+
// src/agents/singleton-reconcile.ts
|
|
22840
|
+
var import_yaml4 = __toESM(require_dist(), 1);
|
|
22841
|
+
var CORE_SINGLETON_SERVICES = [
|
|
22842
|
+
"vault-broker",
|
|
22843
|
+
"approval-kernel",
|
|
22844
|
+
"switchroom-auth-broker"
|
|
22845
|
+
];
|
|
22846
|
+
var VOICE_SIDECAR_SERVICE = "voice-sidecar";
|
|
22847
|
+
var SINGLETON_SERVICES = [
|
|
22848
|
+
...CORE_SINGLETON_SERVICES,
|
|
22849
|
+
VOICE_SIDECAR_SERVICE
|
|
22850
|
+
];
|
|
22851
|
+
|
|
22738
22852
|
// src/agents/lifecycle.ts
|
|
22739
22853
|
function containerName(name) {
|
|
22740
22854
|
return `switchroom-${name}`;
|
|
@@ -22809,6 +22923,7 @@ function getAllAgentStatuses(config) {
|
|
|
22809
22923
|
}
|
|
22810
22924
|
|
|
22811
22925
|
// src/cli/update.ts
|
|
22926
|
+
init_atomic();
|
|
22812
22927
|
var DEFAULT_COMPOSE_PATH = join3(homedir3(), ".switchroom", "compose", "docker-compose.yml");
|
|
22813
22928
|
var UPDATE_RESULT_SENTINEL = "SWITCHROOM_UPDATE_RESULT:";
|
|
22814
22929
|
function parseUpdateResultLine(stdout) {
|
|
@@ -22831,6 +22946,7 @@ function parseUpdateResultLine(stdout) {
|
|
|
22831
22946
|
}
|
|
22832
22947
|
|
|
22833
22948
|
// src/host-control/config-edit-validator.ts
|
|
22949
|
+
var import_yaml5 = __toESM(require_dist(), 1);
|
|
22834
22950
|
import { mkdtempSync, writeFileSync as writeFileSync2, rmSync as rmSync2, existsSync as existsSync7, readFileSync as readFileSync5 } from "node:fs";
|
|
22835
22951
|
import { tmpdir } from "node:os";
|
|
22836
22952
|
import { join as join4, isAbsolute as isAbsolute2, normalize, basename as basename2 } from "node:path";
|
|
@@ -22855,6 +22971,33 @@ function isTargetPathHeader(headerPath, targetBasename) {
|
|
|
22855
22971
|
return false;
|
|
22856
22972
|
return norm === targetBasename || basename2(norm) === targetBasename;
|
|
22857
22973
|
}
|
|
22974
|
+
function normalizeDiffHeadersToBasename(unifiedDiff, targetBasename) {
|
|
22975
|
+
const rewriteHeaderLine = (line, marker) => {
|
|
22976
|
+
const rest = line.slice(marker.length);
|
|
22977
|
+
const tabIdx = rest.indexOf("\t");
|
|
22978
|
+
const pathPart = (tabIdx === -1 ? rest : rest.slice(0, tabIdx)).trim();
|
|
22979
|
+
const tail = tabIdx === -1 ? "" : rest.slice(tabIdx);
|
|
22980
|
+
if (pathPart === "/dev/null")
|
|
22981
|
+
return line;
|
|
22982
|
+
let prefix = "";
|
|
22983
|
+
let p = pathPart;
|
|
22984
|
+
if (p.startsWith("a/") || p.startsWith("b/")) {
|
|
22985
|
+
prefix = p.slice(0, 2);
|
|
22986
|
+
p = p.slice(2);
|
|
22987
|
+
}
|
|
22988
|
+
const newPath = `${prefix}${targetBasename}`;
|
|
22989
|
+
return `${marker}${newPath}${tail}`;
|
|
22990
|
+
};
|
|
22991
|
+
return unifiedDiff.split(`
|
|
22992
|
+
`).map((ln) => {
|
|
22993
|
+
if (ln.startsWith("--- "))
|
|
22994
|
+
return rewriteHeaderLine(ln, "--- ");
|
|
22995
|
+
if (ln.startsWith("+++ "))
|
|
22996
|
+
return rewriteHeaderLine(ln, "+++ ");
|
|
22997
|
+
return ln;
|
|
22998
|
+
}).join(`
|
|
22999
|
+
`);
|
|
23000
|
+
}
|
|
22858
23001
|
function validateShape(unifiedDiff, targetPath) {
|
|
22859
23002
|
const byteLen = Buffer.byteLength(unifiedDiff, "utf8");
|
|
22860
23003
|
if (byteLen > MAX_PATCH_BYTES) {
|
|
@@ -22929,11 +23072,12 @@ function applyPatch(unifiedDiff, configPath, gitBin) {
|
|
|
22929
23072
|
const liveContent = readFileSync5(configPath, "utf8");
|
|
22930
23073
|
const scratchDir = mkdtempSync(join4(tmpdir(), "config-propose-edit-"));
|
|
22931
23074
|
try {
|
|
22932
|
-
const
|
|
22933
|
-
const scratchFile = join4(scratchDir,
|
|
23075
|
+
const targetBasename = configPath.split("/").pop() ?? "switchroom.yaml";
|
|
23076
|
+
const scratchFile = join4(scratchDir, targetBasename);
|
|
22934
23077
|
writeFileSync2(scratchFile, liveContent);
|
|
23078
|
+
const normalizedDiff = normalizeDiffHeadersToBasename(unifiedDiff, targetBasename);
|
|
22935
23079
|
const patchFile = join4(scratchDir, "proposal.patch");
|
|
22936
|
-
writeFileSync2(patchFile,
|
|
23080
|
+
writeFileSync2(patchFile, normalizedDiff);
|
|
22937
23081
|
const bin = gitBin ?? "git";
|
|
22938
23082
|
const baseArgs = [
|
|
22939
23083
|
"apply",
|
|
@@ -22972,7 +23116,7 @@ function applyPatch(unifiedDiff, configPath, gitBin) {
|
|
|
22972
23116
|
function failsafeParse(source) {
|
|
22973
23117
|
let doc;
|
|
22974
23118
|
try {
|
|
22975
|
-
doc =
|
|
23119
|
+
doc = import_yaml5.parseDocument(source, { merge: false, strict: true });
|
|
22976
23120
|
} catch (err2) {
|
|
22977
23121
|
return {
|
|
22978
23122
|
ok: false,
|
|
@@ -22988,25 +23132,25 @@ function failsafeParse(source) {
|
|
|
22988
23132
|
};
|
|
22989
23133
|
}
|
|
22990
23134
|
let rejection = null;
|
|
22991
|
-
|
|
23135
|
+
import_yaml5.visit(doc, (_key, node, _path) => {
|
|
22992
23136
|
if (rejection)
|
|
22993
|
-
return
|
|
22994
|
-
if (
|
|
23137
|
+
return import_yaml5.visit.BREAK;
|
|
23138
|
+
if (import_yaml5.isAlias(node)) {
|
|
22995
23139
|
rejection = {
|
|
22996
23140
|
ok: false,
|
|
22997
23141
|
code: "E_YAML_UNSAFE_CONSTRUCT",
|
|
22998
23142
|
detail: "YAML aliases (`*name`) are not allowed"
|
|
22999
23143
|
};
|
|
23000
|
-
return
|
|
23144
|
+
return import_yaml5.visit.BREAK;
|
|
23001
23145
|
}
|
|
23002
|
-
if (
|
|
23146
|
+
if (import_yaml5.isNode(node)) {
|
|
23003
23147
|
if (node.anchor) {
|
|
23004
23148
|
rejection = {
|
|
23005
23149
|
ok: false,
|
|
23006
23150
|
code: "E_YAML_UNSAFE_CONSTRUCT",
|
|
23007
23151
|
detail: `YAML anchors (\`&${node.anchor}\`) are not allowed`
|
|
23008
23152
|
};
|
|
23009
|
-
return
|
|
23153
|
+
return import_yaml5.visit.BREAK;
|
|
23010
23154
|
}
|
|
23011
23155
|
const tag = node.tag;
|
|
23012
23156
|
if (typeof tag === "string" && tag.startsWith("!")) {
|
|
@@ -23015,18 +23159,18 @@ function failsafeParse(source) {
|
|
|
23015
23159
|
code: "E_YAML_UNSAFE_CONSTRUCT",
|
|
23016
23160
|
detail: `YAML explicit tags (\`${tag}\`) are not allowed`
|
|
23017
23161
|
};
|
|
23018
|
-
return
|
|
23162
|
+
return import_yaml5.visit.BREAK;
|
|
23019
23163
|
}
|
|
23020
23164
|
}
|
|
23021
|
-
if (
|
|
23165
|
+
if (import_yaml5.isPair(node)) {
|
|
23022
23166
|
const k = node.key;
|
|
23023
|
-
if (
|
|
23167
|
+
if (import_yaml5.isScalar(k) && k.value === "<<") {
|
|
23024
23168
|
rejection = {
|
|
23025
23169
|
ok: false,
|
|
23026
23170
|
code: "E_YAML_UNSAFE_CONSTRUCT",
|
|
23027
23171
|
detail: "YAML merge keys (`<<:`) are not allowed"
|
|
23028
23172
|
};
|
|
23029
|
-
return
|
|
23173
|
+
return import_yaml5.visit.BREAK;
|
|
23030
23174
|
}
|
|
23031
23175
|
}
|
|
23032
23176
|
return;
|
|
@@ -23162,7 +23306,7 @@ function validateConfigEdit(opts) {
|
|
|
23162
23306
|
let beforeData = {};
|
|
23163
23307
|
try {
|
|
23164
23308
|
const beforeRaw = existsSync7(opts.configPath) ? readFileSync5(opts.configPath, "utf8") : "";
|
|
23165
|
-
const beforeDoc =
|
|
23309
|
+
const beforeDoc = import_yaml5.parseDocument(beforeRaw, { merge: false, strict: false });
|
|
23166
23310
|
beforeData = beforeDoc.toJS();
|
|
23167
23311
|
} catch {
|
|
23168
23312
|
beforeData = {};
|
|
@@ -23176,8 +23320,8 @@ function assertSelfScopedAllowEdit(beforeContent, afterContent, caller) {
|
|
|
23176
23320
|
let before;
|
|
23177
23321
|
let after;
|
|
23178
23322
|
try {
|
|
23179
|
-
before = toObject(
|
|
23180
|
-
after = toObject(
|
|
23323
|
+
before = toObject(import_yaml5.parseDocument(beforeContent, { merge: false, strict: false }).toJS());
|
|
23324
|
+
after = toObject(import_yaml5.parseDocument(afterContent, { merge: false, strict: false }).toJS());
|
|
23181
23325
|
} catch (e) {
|
|
23182
23326
|
return { ok: false, detail: `self-scope: config did not parse (${e.message})` };
|
|
23183
23327
|
}
|
|
@@ -23236,6 +23380,7 @@ function stripCallerAllow(cfg, caller) {
|
|
|
23236
23380
|
}
|
|
23237
23381
|
|
|
23238
23382
|
// src/host-control/config-blast-radius.ts
|
|
23383
|
+
var import_yaml6 = __toESM(require_dist(), 1);
|
|
23239
23384
|
function toObject2(v) {
|
|
23240
23385
|
return v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
23241
23386
|
}
|
|
@@ -23284,8 +23429,8 @@ function classifyBlastRadius(beforeYaml, afterYaml) {
|
|
|
23284
23429
|
let before;
|
|
23285
23430
|
let after;
|
|
23286
23431
|
try {
|
|
23287
|
-
before = toObject2(
|
|
23288
|
-
after = toObject2(
|
|
23432
|
+
before = toObject2(import_yaml6.parse(beforeYaml));
|
|
23433
|
+
after = toObject2(import_yaml6.parse(afterYaml));
|
|
23289
23434
|
} catch {
|
|
23290
23435
|
return { agents: [], fleetWide: true, changedPaths: ["<unparseable>"] };
|
|
23291
23436
|
}
|
|
@@ -23314,6 +23459,43 @@ function classifyBlastRadius(beforeYaml, afterYaml) {
|
|
|
23314
23459
|
};
|
|
23315
23460
|
}
|
|
23316
23461
|
|
|
23462
|
+
// src/host-control/render-rollout-status.ts
|
|
23463
|
+
function phaseLine(s) {
|
|
23464
|
+
switch (s.phase) {
|
|
23465
|
+
case "apply":
|
|
23466
|
+
return "applying — regenerating compose";
|
|
23467
|
+
case "canary-start":
|
|
23468
|
+
return `canary — restarting ${s.agent ?? "canary agent"}`;
|
|
23469
|
+
case "canary-pass":
|
|
23470
|
+
return `canary passed (${s.agent ?? "canary"}) — rolling the rest`;
|
|
23471
|
+
case "canary-fail":
|
|
23472
|
+
return `canary failed (${s.agent ?? "canary"})`;
|
|
23473
|
+
case "agent-start":
|
|
23474
|
+
return `agent ${s.n ?? "?"}/${s.m ?? "?"} — restarting ${s.agent ?? ""}`.trim();
|
|
23475
|
+
case "agent-done":
|
|
23476
|
+
return `agent ${s.n ?? "?"}/${s.m ?? "?"} — ${s.agent ?? ""} done`.trim();
|
|
23477
|
+
case "persist-pin":
|
|
23478
|
+
return "persisting pin";
|
|
23479
|
+
case "hostd-web-deferred":
|
|
23480
|
+
return "hostd/web refresh deferred (run host-side)";
|
|
23481
|
+
default:
|
|
23482
|
+
return "starting";
|
|
23483
|
+
}
|
|
23484
|
+
}
|
|
23485
|
+
function renderRolloutStatus(s) {
|
|
23486
|
+
const head = `Rollout → ${s.target}`;
|
|
23487
|
+
const rolledCount = s.rolled?.length ?? 0;
|
|
23488
|
+
if (s.terminal === "completed") {
|
|
23489
|
+
return `✅ ${head} — done. Rolled ${rolledCount} agent(s): ${(s.rolled ?? []).join(", ") || "none"}.`;
|
|
23490
|
+
}
|
|
23491
|
+
if (s.terminal === "error") {
|
|
23492
|
+
const where = s.failedStep ? ` at ${s.failedStep}${s.failedAgent ? ` (${s.failedAgent} → ${s.got ?? "unreachable"})` : ""}` : "";
|
|
23493
|
+
return `❌ ${head} — STOPPED${where}. ` + `Rolled before stop: ${(s.rolled ?? []).join(", ") || "none"}.`;
|
|
23494
|
+
}
|
|
23495
|
+
const progress = rolledCount > 0 ? ` · ${rolledCount} rolled` : "";
|
|
23496
|
+
return `⏳ ${head} — ${phaseLine(s)}${progress}`;
|
|
23497
|
+
}
|
|
23498
|
+
|
|
23317
23499
|
// src/scheduler/dispatch.ts
|
|
23318
23500
|
import { createHash as createHash4 } from "node:crypto";
|
|
23319
23501
|
function collectScheduleEntries(config) {
|
|
@@ -23424,7 +23606,7 @@ function readCachedInstallType(bindRoot) {
|
|
|
23424
23606
|
} catch {}
|
|
23425
23607
|
return payload;
|
|
23426
23608
|
}
|
|
23427
|
-
var CONFIG_APPROVAL_TIMEOUT_MS =
|
|
23609
|
+
var CONFIG_APPROVAL_TIMEOUT_MS = 60 * 60 * 1000;
|
|
23428
23610
|
function defaultApprovalId() {
|
|
23429
23611
|
return randomBytes(4).toString("hex");
|
|
23430
23612
|
}
|
|
@@ -23467,6 +23649,9 @@ class HostdServer {
|
|
|
23467
23649
|
auditChainState;
|
|
23468
23650
|
idempotencyKeys = new Map;
|
|
23469
23651
|
fleetMutationInFlight = null;
|
|
23652
|
+
get rolloutNarrator() {
|
|
23653
|
+
return this.opts.rolloutNarrator;
|
|
23654
|
+
}
|
|
23470
23655
|
constructor(opts) {
|
|
23471
23656
|
this.opts = opts;
|
|
23472
23657
|
}
|
|
@@ -23636,8 +23821,8 @@ class HostdServer {
|
|
|
23636
23821
|
this.idempotencyKeys.clear();
|
|
23637
23822
|
}
|
|
23638
23823
|
onConnection(socket, bindPath) {
|
|
23639
|
-
const
|
|
23640
|
-
if (!
|
|
23824
|
+
const identity = socketPathToIdentity(bindPath);
|
|
23825
|
+
if (!identity) {
|
|
23641
23826
|
socket.end();
|
|
23642
23827
|
return;
|
|
23643
23828
|
}
|
|
@@ -23656,7 +23841,7 @@ class HostdServer {
|
|
|
23656
23841
|
return;
|
|
23657
23842
|
const line = buf.slice(0, nl);
|
|
23658
23843
|
buf = buf.slice(nl + 1);
|
|
23659
|
-
this.handleLine(line,
|
|
23844
|
+
this.handleLine(line, identity, socket).catch((err2) => {
|
|
23660
23845
|
process.stderr.write(`hostd: handler error: ${err2.message}
|
|
23661
23846
|
`);
|
|
23662
23847
|
socket.end();
|
|
@@ -23779,6 +23964,9 @@ class HostdServer {
|
|
|
23779
23964
|
case "get_status": {
|
|
23780
23965
|
const entry = this.statusByRequestId.get(req.args.target_request_id);
|
|
23781
23966
|
if (!entry) {
|
|
23967
|
+
if (callerAdmin && this.rolloutRowExistsInLog(req.args.target_request_id)) {
|
|
23968
|
+
return null;
|
|
23969
|
+
}
|
|
23782
23970
|
return `get_status: request_id not found or not visible to caller "${caller.name}"`;
|
|
23783
23971
|
}
|
|
23784
23972
|
const ownCall = entry.caller.kind === caller.kind && ("name" in entry.caller && "name" in caller ? entry.caller.name === caller.name : true);
|
|
@@ -24530,7 +24718,12 @@ class HostdServer {
|
|
|
24530
24718
|
});
|
|
24531
24719
|
}
|
|
24532
24720
|
spawnRollout(args, entry) {
|
|
24533
|
-
|
|
24721
|
+
const onLine = (line) => {
|
|
24722
|
+
const phase = parseRolloutPhaseLine(line);
|
|
24723
|
+
if (phase)
|
|
24724
|
+
this.onRolloutPhase(entry, phase);
|
|
24725
|
+
};
|
|
24726
|
+
this.runSwitchroom(args, { SWITCHROOM_HOSTD_CONTEXT: "1" }, onLine).then((res) => {
|
|
24534
24727
|
entry.exit_code = res.exit_code;
|
|
24535
24728
|
entry.finished_at = Date.now();
|
|
24536
24729
|
entry.stdout_tail = tail(res.stdout);
|
|
@@ -24559,27 +24752,111 @@ class HostdServer {
|
|
|
24559
24752
|
delete entry.prior_pin;
|
|
24560
24753
|
}).finally(() => {
|
|
24561
24754
|
this.writeTerminalAudit(entry);
|
|
24755
|
+
this.pushRolloutTerminal(entry);
|
|
24756
|
+
try {
|
|
24757
|
+
this.rolloutNarrator?.onTerminal(entry);
|
|
24758
|
+
} catch (e) {
|
|
24759
|
+
process.stderr.write(`hostd: rollout narrator onTerminal threw (non-fatal): ${e.message}
|
|
24760
|
+
`);
|
|
24761
|
+
}
|
|
24562
24762
|
if (this.fleetMutationInFlight && this.fleetMutationInFlight.request_id === entry.request_id) {
|
|
24563
24763
|
this.fleetMutationInFlight = null;
|
|
24564
24764
|
}
|
|
24565
24765
|
});
|
|
24566
24766
|
}
|
|
24767
|
+
pushRolloutTerminal(entry) {
|
|
24768
|
+
if (!this.opts.rolloutRelay)
|
|
24769
|
+
return;
|
|
24770
|
+
if (entry.caller.kind !== "agent")
|
|
24771
|
+
return;
|
|
24772
|
+
try {
|
|
24773
|
+
const text = renderRolloutStatus({
|
|
24774
|
+
target: entry.pin ?? "",
|
|
24775
|
+
rolled: entry.rolled,
|
|
24776
|
+
terminal: entry.result === "completed" ? "completed" : "error",
|
|
24777
|
+
...entry.failed_step ? { failedStep: entry.failed_step } : {},
|
|
24778
|
+
...entry.failed_agent ? { failedAgent: entry.failed_agent } : {},
|
|
24779
|
+
...entry.got !== undefined ? { got: entry.got } : {}
|
|
24780
|
+
});
|
|
24781
|
+
this.opts.rolloutRelay.postTerminal({
|
|
24782
|
+
requestId: entry.request_id,
|
|
24783
|
+
agentName: entry.caller.name,
|
|
24784
|
+
text
|
|
24785
|
+
});
|
|
24786
|
+
} catch (e) {
|
|
24787
|
+
process.stderr.write(`hostd: rollout terminal push failed (non-fatal): ${e.message}
|
|
24788
|
+
`);
|
|
24789
|
+
}
|
|
24790
|
+
}
|
|
24567
24791
|
handleGetStatus(req, _caller, started) {
|
|
24568
24792
|
const entry = this.statusByRequestId.get(req.args.target_request_id);
|
|
24569
24793
|
if (!entry) {
|
|
24794
|
+
const fromLog = this.rolloutStatusFromLog(req.request_id, req.args.target_request_id, started);
|
|
24795
|
+
if (fromLog)
|
|
24796
|
+
return fromLog;
|
|
24570
24797
|
const legacy = `get_status: internal: entry missing despite gate accept`;
|
|
24571
24798
|
const built = err("E_INTERNAL", "entry missing despite gate accept").op("get_status").build(req.request_id, Date.now() - started);
|
|
24572
24799
|
return { ...built, error: legacy };
|
|
24573
24800
|
}
|
|
24574
24801
|
return this.statusEntryToResponse(req.request_id, entry);
|
|
24575
24802
|
}
|
|
24803
|
+
rolloutRowExistsInLog(targetRequestId) {
|
|
24804
|
+
const path2 = this.auditLogPath();
|
|
24805
|
+
if (!existsSync8(path2))
|
|
24806
|
+
return false;
|
|
24807
|
+
try {
|
|
24808
|
+
const raw = readFileSync6(path2, "utf-8");
|
|
24809
|
+
return latestRolloutRowForRequest(raw, targetRequestId) !== null;
|
|
24810
|
+
} catch {
|
|
24811
|
+
return false;
|
|
24812
|
+
}
|
|
24813
|
+
}
|
|
24814
|
+
rolloutStatusFromLog(responseRequestId, targetRequestId, started) {
|
|
24815
|
+
const path2 = this.auditLogPath();
|
|
24816
|
+
if (!existsSync8(path2))
|
|
24817
|
+
return null;
|
|
24818
|
+
let raw;
|
|
24819
|
+
try {
|
|
24820
|
+
raw = readFileSync6(path2, "utf-8");
|
|
24821
|
+
} catch {
|
|
24822
|
+
return null;
|
|
24823
|
+
}
|
|
24824
|
+
const row = latestRolloutRowForRequest(raw, targetRequestId);
|
|
24825
|
+
if (!row)
|
|
24826
|
+
return null;
|
|
24827
|
+
const isTerminal = row.phase === "terminal";
|
|
24828
|
+
const payload = JSON.stringify({
|
|
24829
|
+
rolled: row.rolled ?? [],
|
|
24830
|
+
...row.phase && !isTerminal ? { phase: row.phase } : {},
|
|
24831
|
+
...row.n !== undefined ? { n: row.n } : {},
|
|
24832
|
+
...row.m !== undefined ? { m: row.m } : {},
|
|
24833
|
+
...row.agent ? { agent: row.agent } : {},
|
|
24834
|
+
...row.failed_step ? { failedStep: row.failed_step } : {},
|
|
24835
|
+
...row.failed_agent ? { failedAgent: row.failed_agent } : {},
|
|
24836
|
+
...row.pin ? { pin: row.pin } : {},
|
|
24837
|
+
...row.prior_pin ? { prior_pin: row.prior_pin } : {}
|
|
24838
|
+
});
|
|
24839
|
+
return {
|
|
24840
|
+
v: 1,
|
|
24841
|
+
request_id: responseRequestId,
|
|
24842
|
+
result: row.result,
|
|
24843
|
+
exit_code: row.exit_code,
|
|
24844
|
+
duration_ms: Date.now() - started,
|
|
24845
|
+
payload
|
|
24846
|
+
};
|
|
24847
|
+
}
|
|
24576
24848
|
statusEntryToResponse(request_id, entry) {
|
|
24577
|
-
const rolloutPayload = entry.op === "rollout" && (entry.rolled !== undefined || entry.failed_step !== undefined || entry.failed_agent !== undefined) ? JSON.stringify({
|
|
24849
|
+
const rolloutPayload = entry.op === "rollout" && (entry.rolled !== undefined || entry.failed_step !== undefined || entry.failed_agent !== undefined || entry.current_phase !== undefined) ? JSON.stringify({
|
|
24578
24850
|
rolled: entry.rolled ?? [],
|
|
24851
|
+
...entry.current_phase ? { phase: entry.current_phase } : {},
|
|
24852
|
+
...entry.phase_n !== undefined ? { n: entry.phase_n } : {},
|
|
24853
|
+
...entry.phase_m !== undefined ? { m: entry.phase_m } : {},
|
|
24854
|
+
...entry.phase_agent ? { agent: entry.phase_agent } : {},
|
|
24579
24855
|
...entry.failed_step ? { failedStep: entry.failed_step } : {},
|
|
24580
24856
|
...entry.failed_agent ? { failedAgent: entry.failed_agent } : {},
|
|
24581
24857
|
...entry.got !== undefined ? { got: entry.got } : {},
|
|
24582
|
-
...entry.pin ? { pin: entry.pin } : {}
|
|
24858
|
+
...entry.pin ? { pin: entry.pin } : {},
|
|
24859
|
+
...entry.prior_pin ? { prior_pin: entry.prior_pin } : {}
|
|
24583
24860
|
}) : undefined;
|
|
24584
24861
|
const updatePayload = entry.op === "update_apply" && (entry.deferred !== undefined || entry.channel !== undefined || entry.pin !== undefined) ? {
|
|
24585
24862
|
...entry.deferred !== undefined ? { deferred: entry.deferred } : {},
|
|
@@ -24681,7 +24958,36 @@ class HostdServer {
|
|
|
24681
24958
|
...entry.prior_pin ? { prior_pin: entry.prior_pin } : {}
|
|
24682
24959
|
});
|
|
24683
24960
|
}
|
|
24684
|
-
|
|
24961
|
+
onRolloutPhase(entry, phase) {
|
|
24962
|
+
entry.current_phase = phase.phase;
|
|
24963
|
+
entry.phase_n = phase.n;
|
|
24964
|
+
entry.phase_m = phase.m;
|
|
24965
|
+
entry.phase_agent = phase.agent;
|
|
24966
|
+
this.writePhaseAudit(entry, phase);
|
|
24967
|
+
try {
|
|
24968
|
+
this.rolloutNarrator?.onPhase(entry, phase);
|
|
24969
|
+
} catch (e) {
|
|
24970
|
+
process.stderr.write(`hostd: rollout narrator onPhase threw (non-fatal): ${e.message}
|
|
24971
|
+
`);
|
|
24972
|
+
}
|
|
24973
|
+
}
|
|
24974
|
+
async writePhaseAudit(entry, phase) {
|
|
24975
|
+
await this.appendAuditRow({
|
|
24976
|
+
ts: new Date().toISOString(),
|
|
24977
|
+
op: entry.op,
|
|
24978
|
+
phase: phase.phase,
|
|
24979
|
+
caller: entry.caller.kind === "agent" ? { kind: "agent", name: entry.caller.name } : { kind: "operator" },
|
|
24980
|
+
request_id: entry.request_id,
|
|
24981
|
+
result: "started",
|
|
24982
|
+
exit_code: null,
|
|
24983
|
+
duration_ms: Date.now() - entry.started_at,
|
|
24984
|
+
...entry.pin ? { pin: entry.pin } : {},
|
|
24985
|
+
...phase.agent !== undefined ? { agent: phase.agent } : {},
|
|
24986
|
+
...phase.n !== undefined ? { n: phase.n } : {},
|
|
24987
|
+
...phase.m !== undefined ? { m: phase.m } : {}
|
|
24988
|
+
});
|
|
24989
|
+
}
|
|
24990
|
+
runSwitchroom(args, extraEnv, onStdoutLine) {
|
|
24685
24991
|
return new Promise((resolve7, reject) => {
|
|
24686
24992
|
const bin = this.opts.switchroomBin ?? "switchroom";
|
|
24687
24993
|
const child = spawn2(bin, args, {
|
|
@@ -24690,14 +24996,49 @@ class HostdServer {
|
|
|
24690
24996
|
});
|
|
24691
24997
|
let stdout = "";
|
|
24692
24998
|
let stderr = "";
|
|
24999
|
+
let lineBuf = "";
|
|
25000
|
+
const drainLines = (flush) => {
|
|
25001
|
+
if (!onStdoutLine)
|
|
25002
|
+
return;
|
|
25003
|
+
let nl;
|
|
25004
|
+
while ((nl = lineBuf.indexOf(`
|
|
25005
|
+
`)) !== -1) {
|
|
25006
|
+
const line = lineBuf.slice(0, nl);
|
|
25007
|
+
lineBuf = lineBuf.slice(nl + 1);
|
|
25008
|
+
try {
|
|
25009
|
+
onStdoutLine(line);
|
|
25010
|
+
} catch (e) {
|
|
25011
|
+
process.stderr.write(`hostd: rollout stdout-tap threw (non-fatal): ${e.message}
|
|
25012
|
+
`);
|
|
25013
|
+
}
|
|
25014
|
+
}
|
|
25015
|
+
if (flush && lineBuf.length > 0) {
|
|
25016
|
+
const line = lineBuf;
|
|
25017
|
+
lineBuf = "";
|
|
25018
|
+
try {
|
|
25019
|
+
onStdoutLine(line);
|
|
25020
|
+
} catch (e) {
|
|
25021
|
+
process.stderr.write(`hostd: rollout stdout-tap threw (non-fatal): ${e.message}
|
|
25022
|
+
`);
|
|
25023
|
+
}
|
|
25024
|
+
}
|
|
25025
|
+
};
|
|
24693
25026
|
child.stdout.on("data", (d) => {
|
|
24694
|
-
|
|
25027
|
+
const s = d.toString("utf8");
|
|
25028
|
+
stdout += s;
|
|
25029
|
+
if (onStdoutLine) {
|
|
25030
|
+
lineBuf += s;
|
|
25031
|
+
drainLines(false);
|
|
25032
|
+
}
|
|
24695
25033
|
});
|
|
24696
25034
|
child.stderr.on("data", (d) => {
|
|
24697
25035
|
stderr += d.toString("utf8");
|
|
24698
25036
|
});
|
|
24699
25037
|
child.on("error", (err2) => reject(err2));
|
|
24700
|
-
child.on("close", (code) =>
|
|
25038
|
+
child.on("close", (code) => {
|
|
25039
|
+
drainLines(true);
|
|
25040
|
+
resolve7({ exit_code: code ?? -1, stdout, stderr });
|
|
25041
|
+
});
|
|
24701
25042
|
});
|
|
24702
25043
|
}
|
|
24703
25044
|
}
|
|
@@ -24929,6 +25270,395 @@ class SocketApprovalGateway {
|
|
|
24929
25270
|
}
|
|
24930
25271
|
}
|
|
24931
25272
|
|
|
25273
|
+
// src/host-control/rollout-relay.ts
|
|
25274
|
+
import { connect as connect2 } from "node:net";
|
|
25275
|
+
|
|
25276
|
+
class SocketRolloutRelay {
|
|
25277
|
+
opts;
|
|
25278
|
+
constructor(opts) {
|
|
25279
|
+
this.opts = opts;
|
|
25280
|
+
}
|
|
25281
|
+
postTerminal(notice) {
|
|
25282
|
+
const log = this.opts.log ?? (() => {});
|
|
25283
|
+
let sockPath;
|
|
25284
|
+
try {
|
|
25285
|
+
sockPath = this.opts.resolveGatewaySocket(notice.agentName);
|
|
25286
|
+
} catch (e) {
|
|
25287
|
+
log(`resolveGatewaySocket threw for ${notice.agentName}: ${e.message}`);
|
|
25288
|
+
return;
|
|
25289
|
+
}
|
|
25290
|
+
if (sockPath === null) {
|
|
25291
|
+
log(`no reachable gateway socket for ${notice.agentName}; dropping terminal ping`);
|
|
25292
|
+
return;
|
|
25293
|
+
}
|
|
25294
|
+
try {
|
|
25295
|
+
const client2 = connect2({ path: sockPath });
|
|
25296
|
+
client2.setTimeout(5000);
|
|
25297
|
+
const done = () => {
|
|
25298
|
+
try {
|
|
25299
|
+
client2.destroy();
|
|
25300
|
+
} catch {}
|
|
25301
|
+
};
|
|
25302
|
+
client2.on("connect", () => {
|
|
25303
|
+
try {
|
|
25304
|
+
client2.write(JSON.stringify({
|
|
25305
|
+
type: "rollout_status_post",
|
|
25306
|
+
requestId: notice.requestId,
|
|
25307
|
+
agentName: notice.agentName,
|
|
25308
|
+
text: notice.text
|
|
25309
|
+
}) + `
|
|
25310
|
+
`);
|
|
25311
|
+
client2.end();
|
|
25312
|
+
} catch (e) {
|
|
25313
|
+
log(`rollout terminal write failed (requestId=${notice.requestId}): ${e.message}`);
|
|
25314
|
+
done();
|
|
25315
|
+
}
|
|
25316
|
+
});
|
|
25317
|
+
client2.on("timeout", () => {
|
|
25318
|
+
log(`rollout terminal connect timed out (requestId=${notice.requestId})`);
|
|
25319
|
+
done();
|
|
25320
|
+
});
|
|
25321
|
+
client2.on("error", (e) => {
|
|
25322
|
+
log(`rollout terminal socket error (requestId=${notice.requestId}): ${e.message}`);
|
|
25323
|
+
done();
|
|
25324
|
+
});
|
|
25325
|
+
client2.on("close", () => {});
|
|
25326
|
+
} catch (e) {
|
|
25327
|
+
log(`rollout terminal connect threw (requestId=${notice.requestId}): ${e.message}`);
|
|
25328
|
+
}
|
|
25329
|
+
}
|
|
25330
|
+
}
|
|
25331
|
+
|
|
25332
|
+
// src/host-control/rollout-narration-relay.ts
|
|
25333
|
+
import { connect as connect3 } from "node:net";
|
|
25334
|
+
var DEFAULT_POST_REPLY_TIMEOUT_MS = 5000;
|
|
25335
|
+
|
|
25336
|
+
class SocketRolloutNarrationRelay {
|
|
25337
|
+
opts;
|
|
25338
|
+
constructor(opts) {
|
|
25339
|
+
this.opts = opts;
|
|
25340
|
+
}
|
|
25341
|
+
post(args) {
|
|
25342
|
+
const log = this.opts.log ?? (() => {});
|
|
25343
|
+
let sockPath;
|
|
25344
|
+
try {
|
|
25345
|
+
sockPath = this.opts.resolveGatewaySocket(args.agentName);
|
|
25346
|
+
} catch (e) {
|
|
25347
|
+
log(`narration resolveGatewaySocket threw: ${e.message}`);
|
|
25348
|
+
return Promise.resolve(null);
|
|
25349
|
+
}
|
|
25350
|
+
if (sockPath === null) {
|
|
25351
|
+
log(`narration post: no reachable gateway for ${args.agentName}`);
|
|
25352
|
+
return Promise.resolve(null);
|
|
25353
|
+
}
|
|
25354
|
+
return new Promise((resolve7) => {
|
|
25355
|
+
let settled = false;
|
|
25356
|
+
const finish = (v) => {
|
|
25357
|
+
if (settled)
|
|
25358
|
+
return;
|
|
25359
|
+
settled = true;
|
|
25360
|
+
try {
|
|
25361
|
+
client2.destroy();
|
|
25362
|
+
} catch {}
|
|
25363
|
+
resolve7(v);
|
|
25364
|
+
};
|
|
25365
|
+
let client2;
|
|
25366
|
+
try {
|
|
25367
|
+
client2 = connect3({ path: sockPath });
|
|
25368
|
+
} catch (e) {
|
|
25369
|
+
log(`narration post connect threw: ${e.message}`);
|
|
25370
|
+
resolve7(null);
|
|
25371
|
+
return;
|
|
25372
|
+
}
|
|
25373
|
+
client2.setTimeout(this.opts.postReplyTimeoutMs ?? DEFAULT_POST_REPLY_TIMEOUT_MS);
|
|
25374
|
+
let buffer = "";
|
|
25375
|
+
client2.on("connect", () => {
|
|
25376
|
+
try {
|
|
25377
|
+
client2.write(JSON.stringify({
|
|
25378
|
+
type: "rollout_status_post",
|
|
25379
|
+
requestId: args.requestId,
|
|
25380
|
+
agentName: args.agentName,
|
|
25381
|
+
text: args.text
|
|
25382
|
+
}) + `
|
|
25383
|
+
`);
|
|
25384
|
+
} catch (e) {
|
|
25385
|
+
log(`narration post write failed: ${e.message}`);
|
|
25386
|
+
finish(null);
|
|
25387
|
+
}
|
|
25388
|
+
});
|
|
25389
|
+
client2.on("data", (chunk2) => {
|
|
25390
|
+
buffer += chunk2.toString("utf8");
|
|
25391
|
+
const lines = buffer.split(`
|
|
25392
|
+
`);
|
|
25393
|
+
buffer = lines.pop() ?? "";
|
|
25394
|
+
for (const line of lines) {
|
|
25395
|
+
if (!line.trim())
|
|
25396
|
+
continue;
|
|
25397
|
+
let obj;
|
|
25398
|
+
try {
|
|
25399
|
+
obj = JSON.parse(line);
|
|
25400
|
+
} catch {
|
|
25401
|
+
continue;
|
|
25402
|
+
}
|
|
25403
|
+
if (obj.type === "rollout_status_posted" && obj.requestId === args.requestId) {
|
|
25404
|
+
if (obj.ok === true && typeof obj.messageId === "number") {
|
|
25405
|
+
finish(obj.messageId);
|
|
25406
|
+
} else {
|
|
25407
|
+
log(`narration post rejected by gateway (requestId=${args.requestId}): ${typeof obj.reason === "string" ? obj.reason : "no message_id"}`);
|
|
25408
|
+
finish(null);
|
|
25409
|
+
}
|
|
25410
|
+
return;
|
|
25411
|
+
}
|
|
25412
|
+
}
|
|
25413
|
+
});
|
|
25414
|
+
client2.on("timeout", () => {
|
|
25415
|
+
log(`narration post reply timed out (requestId=${args.requestId})`);
|
|
25416
|
+
finish(null);
|
|
25417
|
+
});
|
|
25418
|
+
client2.on("error", (e) => {
|
|
25419
|
+
log(`narration post socket error (requestId=${args.requestId}): ${e.message}`);
|
|
25420
|
+
finish(null);
|
|
25421
|
+
});
|
|
25422
|
+
client2.on("close", () => finish(null));
|
|
25423
|
+
});
|
|
25424
|
+
}
|
|
25425
|
+
edit(args) {
|
|
25426
|
+
const log = this.opts.log ?? (() => {});
|
|
25427
|
+
let sockPath;
|
|
25428
|
+
try {
|
|
25429
|
+
sockPath = this.opts.resolveGatewaySocket(args.agentName);
|
|
25430
|
+
} catch (e) {
|
|
25431
|
+
log(`narration edit resolveGatewaySocket threw: ${e.message}`);
|
|
25432
|
+
return;
|
|
25433
|
+
}
|
|
25434
|
+
if (sockPath === null)
|
|
25435
|
+
return;
|
|
25436
|
+
try {
|
|
25437
|
+
const client2 = connect3({ path: sockPath });
|
|
25438
|
+
client2.setTimeout(5000);
|
|
25439
|
+
const done = () => {
|
|
25440
|
+
try {
|
|
25441
|
+
client2.destroy();
|
|
25442
|
+
} catch {}
|
|
25443
|
+
};
|
|
25444
|
+
client2.on("connect", () => {
|
|
25445
|
+
try {
|
|
25446
|
+
client2.write(JSON.stringify({
|
|
25447
|
+
type: "rollout_status_edit",
|
|
25448
|
+
requestId: args.requestId,
|
|
25449
|
+
agentName: args.agentName,
|
|
25450
|
+
messageId: args.messageId,
|
|
25451
|
+
text: args.text
|
|
25452
|
+
}) + `
|
|
25453
|
+
`);
|
|
25454
|
+
client2.end();
|
|
25455
|
+
} catch (e) {
|
|
25456
|
+
log(`narration edit write failed: ${e.message}`);
|
|
25457
|
+
done();
|
|
25458
|
+
}
|
|
25459
|
+
});
|
|
25460
|
+
client2.on("timeout", done);
|
|
25461
|
+
client2.on("error", (e) => {
|
|
25462
|
+
log(`narration edit socket error: ${e.message}`);
|
|
25463
|
+
done();
|
|
25464
|
+
});
|
|
25465
|
+
client2.on("close", () => {});
|
|
25466
|
+
} catch (e) {
|
|
25467
|
+
log(`narration edit connect threw: ${e.message}`);
|
|
25468
|
+
}
|
|
25469
|
+
}
|
|
25470
|
+
}
|
|
25471
|
+
|
|
25472
|
+
// src/host-control/rollout-narrator.ts
|
|
25473
|
+
var DEFAULT_DEBOUNCE_MS = 1500;
|
|
25474
|
+
var MAX_POST_ATTEMPTS = 2;
|
|
25475
|
+
|
|
25476
|
+
class LogTailRolloutNarrator {
|
|
25477
|
+
relay;
|
|
25478
|
+
opts;
|
|
25479
|
+
states = new Map;
|
|
25480
|
+
constructor(relay, opts = {}) {
|
|
25481
|
+
this.relay = relay;
|
|
25482
|
+
this.opts = opts;
|
|
25483
|
+
}
|
|
25484
|
+
static seqFor(phase) {
|
|
25485
|
+
switch (phase.phase) {
|
|
25486
|
+
case "apply":
|
|
25487
|
+
return 0;
|
|
25488
|
+
case "canary-start":
|
|
25489
|
+
return 2 * 1 + 0;
|
|
25490
|
+
case "canary-pass":
|
|
25491
|
+
case "canary-fail":
|
|
25492
|
+
return 2 * 1 + 1;
|
|
25493
|
+
case "persist-pin":
|
|
25494
|
+
return 2 * 1 + 1;
|
|
25495
|
+
case "agent-start":
|
|
25496
|
+
return 2 * (phase.n ?? 1) + 0;
|
|
25497
|
+
case "agent-done":
|
|
25498
|
+
return 2 * (phase.n ?? 1) + 1;
|
|
25499
|
+
case "hostd-web-deferred":
|
|
25500
|
+
return Number.MAX_SAFE_INTEGER - 1;
|
|
25501
|
+
default:
|
|
25502
|
+
return 0;
|
|
25503
|
+
}
|
|
25504
|
+
}
|
|
25505
|
+
onPhase(entry, phase) {
|
|
25506
|
+
try {
|
|
25507
|
+
const st = this.ensureState(entry);
|
|
25508
|
+
if (st.frozen)
|
|
25509
|
+
return;
|
|
25510
|
+
const seq = LogTailRolloutNarrator.seqFor(phase);
|
|
25511
|
+
if (seq < st.lastAppliedSeq)
|
|
25512
|
+
return;
|
|
25513
|
+
st.lastAppliedSeq = seq;
|
|
25514
|
+
st.render = {
|
|
25515
|
+
...st.render,
|
|
25516
|
+
target: phase.target,
|
|
25517
|
+
phase: phase.phase,
|
|
25518
|
+
...phase.n !== undefined ? { n: phase.n } : {},
|
|
25519
|
+
...phase.m !== undefined ? { m: phase.m } : {},
|
|
25520
|
+
...phase.agent !== undefined ? { agent: phase.agent } : {},
|
|
25521
|
+
rolled: entry.rolled
|
|
25522
|
+
};
|
|
25523
|
+
this.scheduleRenderOrPost(entry.request_id);
|
|
25524
|
+
} catch (e) {
|
|
25525
|
+
this.opts.log?.(`onPhase threw (non-fatal): ${e.message}`);
|
|
25526
|
+
}
|
|
25527
|
+
}
|
|
25528
|
+
onTerminal(entry) {
|
|
25529
|
+
try {
|
|
25530
|
+
const st = this.ensureState(entry);
|
|
25531
|
+
st.render = {
|
|
25532
|
+
target: entry.pin ?? st.render.target,
|
|
25533
|
+
rolled: entry.rolled ?? st.render.rolled,
|
|
25534
|
+
terminal: entry.result === "completed" ? "completed" : "error",
|
|
25535
|
+
...entry.failed_step ? { failedStep: entry.failed_step } : {},
|
|
25536
|
+
...entry.failed_agent ? { failedAgent: entry.failed_agent } : {},
|
|
25537
|
+
...entry.got !== undefined ? { got: entry.got } : {}
|
|
25538
|
+
};
|
|
25539
|
+
st.frozen = true;
|
|
25540
|
+
if (st.timer) {
|
|
25541
|
+
clearTimeout(st.timer);
|
|
25542
|
+
st.timer = null;
|
|
25543
|
+
}
|
|
25544
|
+
this.flush(entry.request_id, true);
|
|
25545
|
+
setTimeout(() => this.states.delete(entry.request_id), 1e4).unref?.();
|
|
25546
|
+
} catch (e) {
|
|
25547
|
+
this.opts.log?.(`onTerminal threw (non-fatal): ${e.message}`);
|
|
25548
|
+
}
|
|
25549
|
+
}
|
|
25550
|
+
ensureState(entry) {
|
|
25551
|
+
let st = this.states.get(entry.request_id);
|
|
25552
|
+
if (!st) {
|
|
25553
|
+
const agentName = entry.caller.kind === "agent" ? entry.caller.name : "";
|
|
25554
|
+
st = {
|
|
25555
|
+
agentName,
|
|
25556
|
+
lastAppliedSeq: -1,
|
|
25557
|
+
messageId: null,
|
|
25558
|
+
posting: false,
|
|
25559
|
+
postAttempts: 0,
|
|
25560
|
+
postFailed: false,
|
|
25561
|
+
render: { target: entry.pin ?? "" },
|
|
25562
|
+
frozen: false,
|
|
25563
|
+
timer: null,
|
|
25564
|
+
pendingEditAfterPost: false
|
|
25565
|
+
};
|
|
25566
|
+
this.states.set(entry.request_id, st);
|
|
25567
|
+
}
|
|
25568
|
+
return st;
|
|
25569
|
+
}
|
|
25570
|
+
scheduleRenderOrPost(requestId) {
|
|
25571
|
+
const st = this.states.get(requestId);
|
|
25572
|
+
if (!st)
|
|
25573
|
+
return;
|
|
25574
|
+
if (st.agentName.length === 0)
|
|
25575
|
+
return;
|
|
25576
|
+
if (st.messageId !== null) {
|
|
25577
|
+
this.scheduleDebouncedEdit(requestId);
|
|
25578
|
+
return;
|
|
25579
|
+
}
|
|
25580
|
+
if (st.posting) {
|
|
25581
|
+
st.pendingEditAfterPost = true;
|
|
25582
|
+
return;
|
|
25583
|
+
}
|
|
25584
|
+
if (st.postFailed)
|
|
25585
|
+
return;
|
|
25586
|
+
this.tryPost(requestId, false);
|
|
25587
|
+
}
|
|
25588
|
+
tryPost(requestId, terminal) {
|
|
25589
|
+
const st = this.states.get(requestId);
|
|
25590
|
+
if (!st)
|
|
25591
|
+
return false;
|
|
25592
|
+
if (st.messageId !== null || st.posting)
|
|
25593
|
+
return false;
|
|
25594
|
+
if (st.postAttempts >= MAX_POST_ATTEMPTS)
|
|
25595
|
+
return false;
|
|
25596
|
+
if (st.postFailed && !terminal)
|
|
25597
|
+
return false;
|
|
25598
|
+
st.posting = true;
|
|
25599
|
+
st.postAttempts += 1;
|
|
25600
|
+
const text = renderRolloutStatus(st.render);
|
|
25601
|
+
this.relay.post({ requestId, agentName: st.agentName, text }).then((mid) => {
|
|
25602
|
+
st.posting = false;
|
|
25603
|
+
if (mid === null) {
|
|
25604
|
+
st.postFailed = true;
|
|
25605
|
+
this.opts.log?.(`rollout narration post returned no message_id (requestId=${requestId}); backing off re-posts`);
|
|
25606
|
+
return;
|
|
25607
|
+
}
|
|
25608
|
+
st.messageId = mid;
|
|
25609
|
+
st.postFailed = false;
|
|
25610
|
+
if (st.pendingEditAfterPost) {
|
|
25611
|
+
st.pendingEditAfterPost = false;
|
|
25612
|
+
this.flush(requestId, false);
|
|
25613
|
+
}
|
|
25614
|
+
}).catch((e) => {
|
|
25615
|
+
st.posting = false;
|
|
25616
|
+
st.postFailed = true;
|
|
25617
|
+
this.opts.log?.(`rollout narration post failed (non-fatal): ${e.message}`);
|
|
25618
|
+
});
|
|
25619
|
+
return true;
|
|
25620
|
+
}
|
|
25621
|
+
scheduleDebouncedEdit(requestId) {
|
|
25622
|
+
const st = this.states.get(requestId);
|
|
25623
|
+
if (!st)
|
|
25624
|
+
return;
|
|
25625
|
+
if (st.timer)
|
|
25626
|
+
return;
|
|
25627
|
+
const ms = this.opts.debounceMs ?? DEFAULT_DEBOUNCE_MS;
|
|
25628
|
+
st.timer = setTimeout(() => {
|
|
25629
|
+
st.timer = null;
|
|
25630
|
+
this.flush(requestId, true);
|
|
25631
|
+
}, ms);
|
|
25632
|
+
st.timer.unref?.();
|
|
25633
|
+
}
|
|
25634
|
+
flush(requestId, immediate) {
|
|
25635
|
+
const st = this.states.get(requestId);
|
|
25636
|
+
if (!st)
|
|
25637
|
+
return;
|
|
25638
|
+
if (st.agentName.length === 0)
|
|
25639
|
+
return;
|
|
25640
|
+
if (!immediate) {
|
|
25641
|
+
this.scheduleDebouncedEdit(requestId);
|
|
25642
|
+
return;
|
|
25643
|
+
}
|
|
25644
|
+
if (st.messageId === null) {
|
|
25645
|
+
if (st.posting) {
|
|
25646
|
+
st.pendingEditAfterPost = true;
|
|
25647
|
+
return;
|
|
25648
|
+
}
|
|
25649
|
+
this.tryPost(requestId, true);
|
|
25650
|
+
return;
|
|
25651
|
+
}
|
|
25652
|
+
const text = renderRolloutStatus(st.render);
|
|
25653
|
+
this.relay.edit({
|
|
25654
|
+
requestId,
|
|
25655
|
+
agentName: st.agentName,
|
|
25656
|
+
messageId: st.messageId,
|
|
25657
|
+
text
|
|
25658
|
+
});
|
|
25659
|
+
}
|
|
25660
|
+
}
|
|
25661
|
+
|
|
24932
25662
|
// src/host-control/release-watcher.ts
|
|
24933
25663
|
class ReleaseWatcher {
|
|
24934
25664
|
opts;
|
|
@@ -25194,14 +25924,26 @@ async function main() {
|
|
|
25194
25924
|
process.exit(2);
|
|
25195
25925
|
}
|
|
25196
25926
|
const agentsDir = process.env.SWITCHROOM_AGENTS_DIR ?? join6(homedir4(), ".switchroom", "agents");
|
|
25927
|
+
const resolveGatewaySocket = (agentName) => {
|
|
25928
|
+
const sock = resolve7(agentsDir, agentName, "telegram", "gateway.sock");
|
|
25929
|
+
return existsSync9(sock) ? sock : null;
|
|
25930
|
+
};
|
|
25197
25931
|
const approvalGateway = new SocketApprovalGateway({
|
|
25198
|
-
resolveGatewaySocket
|
|
25199
|
-
const sock = resolve7(agentsDir, agentName, "telegram", "gateway.sock");
|
|
25200
|
-
return existsSync9(sock) ? sock : null;
|
|
25201
|
-
},
|
|
25932
|
+
resolveGatewaySocket,
|
|
25202
25933
|
log: (m) => process.stderr.write(`hostd: approval-gateway — ${m}
|
|
25203
25934
|
`)
|
|
25204
25935
|
});
|
|
25936
|
+
const rolloutRelay = new SocketRolloutRelay({
|
|
25937
|
+
resolveGatewaySocket,
|
|
25938
|
+
log: (m) => process.stderr.write(`hostd: rollout-relay — ${m}
|
|
25939
|
+
`)
|
|
25940
|
+
});
|
|
25941
|
+
const rolloutNarrator = new LogTailRolloutNarrator(new SocketRolloutNarrationRelay({
|
|
25942
|
+
resolveGatewaySocket,
|
|
25943
|
+
log: (m) => process.stderr.write(`hostd: rollout-narration — ${m}
|
|
25944
|
+
`)
|
|
25945
|
+
}), { log: (m) => process.stderr.write(`hostd: rollout-narration — ${m}
|
|
25946
|
+
`) });
|
|
25205
25947
|
const server = new HostdServer({
|
|
25206
25948
|
homeDir: homedir4(),
|
|
25207
25949
|
agentUids,
|
|
@@ -25216,7 +25958,9 @@ async function main() {
|
|
|
25216
25958
|
}
|
|
25217
25959
|
} : {}
|
|
25218
25960
|
},
|
|
25219
|
-
approvalGateway
|
|
25961
|
+
approvalGateway,
|
|
25962
|
+
rolloutRelay,
|
|
25963
|
+
rolloutNarrator
|
|
25220
25964
|
});
|
|
25221
25965
|
await server.start();
|
|
25222
25966
|
const paths = server.getBoundPaths();
|