switchroom 0.16.46 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-scheduler/index.js +83 -81
- package/dist/auth-broker/index.js +104 -88
- package/dist/cli/autoaccept-poll.js +8 -8
- package/dist/cli/drive-write-pretool.mjs +10 -15
- package/dist/cli/notion-write-pretool.mjs +85 -83
- package/dist/cli/skill-validate-pretool.mjs +91 -91
- package/dist/cli/switchroom.js +1720 -1392
- package/dist/cli/ui/index.html +84 -12
- package/dist/host-control/main.js +209 -173
- package/dist/vault/approvals/kernel-server.js +86 -83
- package/dist/vault/broker/server.js +284 -139
- package/package.json +3 -3
- package/profiles/_base/cron-session.sh.hbs +1 -1
- package/profiles/_base/start.sh.hbs +54 -3
- package/skills/switchroom-architecture/telegram.md +8 -15
- package/skills/switchroom-cli/SKILL.md +4 -5
- package/skills/telegram-test-harness/SKILL.md +1 -1
- package/telegram-plugin/README.md +18 -29
- package/telegram-plugin/bridge/bridge.ts +1 -41
- package/telegram-plugin/bridge/tool-filter.ts +3 -4
- package/telegram-plugin/dist/bridge/bridge.js +120 -155
- package/telegram-plugin/dist/gateway/gateway.js +1127 -1029
- package/telegram-plugin/dist/server.js +168 -203
- package/telegram-plugin/gateway/busy-key-reaper.ts +113 -0
- package/telegram-plugin/gateway/disconnect-flush.ts +11 -0
- package/telegram-plugin/gateway/escalation-bridge-gate.ts +46 -0
- package/telegram-plugin/gateway/gate-parity-probe.ts +102 -0
- package/telegram-plugin/gateway/gateway.ts +566 -631
- package/telegram-plugin/gateway/inbound-delivery-confirm.ts +89 -7
- package/telegram-plugin/gateway/inbound-spool.ts +108 -10
- package/telegram-plugin/gateway/model-command.ts +51 -3
- package/telegram-plugin/gateway/pending-inbound-buffer.ts +26 -0
- package/telegram-plugin/gateway/represent-guard.ts +28 -11
- package/telegram-plugin/gateway/status-pin-store.ts +124 -45
- package/telegram-plugin/gateway/worker-feed-dispatch.ts +19 -0
- package/telegram-plugin/history.ts +5 -0
- package/telegram-plugin/hooks/silent-end-interrupt-stop.mjs +1 -2
- package/telegram-plugin/hooks/subagent-tracker-pretool.mjs +9 -1
- package/telegram-plugin/registry/subagents-schema.ts +126 -1
- package/telegram-plugin/registry/turns-schema.ts +65 -1
- package/telegram-plugin/session-tail.ts +26 -4
- package/telegram-plugin/slot-banner-driver.ts +42 -2
- package/telegram-plugin/status-query-telemetry.ts +100 -0
- package/telegram-plugin/stream-reply-handler.ts +15 -16
- package/telegram-plugin/subagent-watcher.ts +182 -30
- package/telegram-plugin/tests/buffer-gate-broadened.test.ts +4 -10
- package/telegram-plugin/tests/busy-key-reaper.test.ts +191 -0
- package/telegram-plugin/tests/emission-authority-facade.test.ts +11 -17
- package/telegram-plugin/tests/emission-determinism-wiring.test.ts +5 -26
- package/telegram-plugin/tests/escalation-bridge-gate.test.ts +38 -0
- package/telegram-plugin/tests/gate-parity-probe.test.ts +171 -0
- package/telegram-plugin/tests/gateway-disconnect-flush.test.ts +13 -0
- package/telegram-plugin/tests/gateway-outbound-redact.test.ts +14 -11
- package/telegram-plugin/tests/inbound-delivery-confirm.test.ts +146 -0
- package/telegram-plugin/tests/inbound-spool.test.ts +143 -0
- package/telegram-plugin/tests/model-command.test.ts +54 -1
- package/telegram-plugin/tests/multitopic-routing-wiring.test.ts +5 -11
- package/telegram-plugin/tests/nested-worker-visibility-harness.test.ts +329 -0
- package/telegram-plugin/tests/pending-inbound-buffer.test.ts +53 -0
- package/telegram-plugin/tests/progress-update-redact.test.ts +99 -0
- package/telegram-plugin/tests/registry-turns.test.ts +67 -0
- package/telegram-plugin/tests/represent-guard.test.ts +42 -6
- package/telegram-plugin/tests/resume-inbound-builder.test.ts +1 -0
- package/telegram-plugin/tests/session-tail.test.ts +10 -1
- package/telegram-plugin/tests/slot-banner-boot-recovery.test.ts +246 -0
- package/telegram-plugin/tests/status-pin-boot-recovery.test.ts +0 -14
- package/telegram-plugin/tests/status-pin-store.test.ts +220 -5
- package/telegram-plugin/tests/status-query-telemetry.test.ts +115 -0
- package/telegram-plugin/tests/subagent-nested-dispatch.test.ts +209 -0
- package/telegram-plugin/tests/subagent-tracker-hooks.test.ts +37 -0
- package/telegram-plugin/tests/subagent-watcher-boot-promotion-replay.test.ts +167 -0
- package/telegram-plugin/tests/subagent-watcher-env-thresholds.test.ts +46 -3
- package/telegram-plugin/tests/subagent-watcher-stall-notification.test.ts +70 -0
- package/telegram-plugin/tests/tool-activity-summary.test.ts +16 -0
- package/telegram-plugin/tests/tool-filter.test.ts +1 -3
- package/telegram-plugin/tests/tool-label-pretool.test.ts +1 -4
- package/telegram-plugin/tests/turn-flush-safety.test.ts +222 -1
- package/telegram-plugin/tests/vault-request-access-unlock-resume.test.ts +46 -0
- package/telegram-plugin/tests/worker-activity-feed.test.ts +202 -9
- package/telegram-plugin/tests/worker-feed-dispatch.test.ts +25 -0
- package/telegram-plugin/tests/worker-visibility-prose-silent-harness.test.ts +295 -0
- package/telegram-plugin/tool-activity-summary.ts +19 -0
- package/telegram-plugin/turn-flush-safety.ts +16 -1
- package/telegram-plugin/uat/scenarios/jtbd-answer-pings.test.ts +8 -9
- package/telegram-plugin/uat/scenarios/jtbd-foreground-feed-visibility-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-narration-intent-dm.test.ts +1 -1
- package/telegram-plugin/worker-activity-feed.ts +75 -15
- package/vendor/hindsight-memory/CHANGELOG.md +24 -0
- package/vendor/hindsight-memory/README.md +5 -0
- package/vendor/hindsight-memory/scripts/lib/client.py +31 -1
- package/vendor/hindsight-memory/scripts/lib/config.py +41 -2
- package/vendor/hindsight-memory/scripts/lib/content.py +4 -1
- package/vendor/hindsight-memory/scripts/lib/daemon.py +11 -2
- package/vendor/hindsight-memory/scripts/recall.py +74 -1
- package/vendor/hindsight-memory/scripts/retain.py +8 -1
- package/vendor/hindsight-memory/scripts/tests/test_config_client_casts.py +111 -0
- package/vendor/hindsight-memory/scripts/tests/test_recall_integration.py +85 -1
- package/vendor/hindsight-memory/scripts/tests/test_recall_tag_filters.py +107 -0
- package/vendor/hindsight-memory/settings.json +4 -0
- package/vendor/hindsight-memory/tests/test_client.py +130 -0
- package/vendor/hindsight-memory/tests/test_config.py +47 -0
- package/vendor/hindsight-memory/tests/test_content.py +18 -0
- package/vendor/hindsight-memory/tests/test_hooks.py +62 -0
- package/telegram-plugin/gateway/error-envelope-card.ts +0 -64
- package/telegram-plugin/gateway/resolve-calling-subagent.ts +0 -78
- package/telegram-plugin/silent-reply.ts +0 -58
- package/telegram-plugin/tests/error-envelope-unlock-card.test.ts +0 -79
- package/telegram-plugin/tests/resolve-calling-subagent.test.ts +0 -269
- package/telegram-plugin/tests/silent-reply-guard.test.ts +0 -122
|
@@ -17,7 +17,7 @@ var __export = (target, all) => {
|
|
|
17
17
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
18
18
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
19
19
|
|
|
20
|
-
// node_modules/zod/v3/helpers/util.js
|
|
20
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
21
21
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
22
22
|
const t = typeof data;
|
|
23
23
|
switch (t) {
|
|
@@ -148,7 +148,7 @@ var init_util = __esm(() => {
|
|
|
148
148
|
]);
|
|
149
149
|
});
|
|
150
150
|
|
|
151
|
-
// node_modules/zod/v3/ZodError.js
|
|
151
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
152
152
|
var ZodIssueCode, quotelessJson = (obj) => {
|
|
153
153
|
const json = JSON.stringify(obj, null, 2);
|
|
154
154
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
@@ -269,7 +269,7 @@ var init_ZodError = __esm(() => {
|
|
|
269
269
|
};
|
|
270
270
|
});
|
|
271
271
|
|
|
272
|
-
// node_modules/zod/v3/locales/en.js
|
|
272
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
273
273
|
var errorMap = (issue, _ctx) => {
|
|
274
274
|
let message;
|
|
275
275
|
switch (issue.code) {
|
|
@@ -376,7 +376,7 @@ var init_en = __esm(() => {
|
|
|
376
376
|
en_default = errorMap;
|
|
377
377
|
});
|
|
378
378
|
|
|
379
|
-
// node_modules/zod/v3/errors.js
|
|
379
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
380
380
|
function setErrorMap(map) {
|
|
381
381
|
overrideErrorMap = map;
|
|
382
382
|
}
|
|
@@ -389,7 +389,7 @@ var init_errors = __esm(() => {
|
|
|
389
389
|
overrideErrorMap = en_default;
|
|
390
390
|
});
|
|
391
391
|
|
|
392
|
-
// node_modules/zod/v3/helpers/parseUtil.js
|
|
392
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
393
393
|
function addIssueToContext(ctx, issueData) {
|
|
394
394
|
const overrideMap = getErrorMap();
|
|
395
395
|
const issue = makeIssue({
|
|
@@ -494,10 +494,10 @@ var init_parseUtil = __esm(() => {
|
|
|
494
494
|
});
|
|
495
495
|
});
|
|
496
496
|
|
|
497
|
-
// node_modules/zod/v3/helpers/typeAliases.js
|
|
497
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js
|
|
498
498
|
var init_typeAliases = () => {};
|
|
499
499
|
|
|
500
|
-
// node_modules/zod/v3/helpers/errorUtil.js
|
|
500
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
501
501
|
var errorUtil;
|
|
502
502
|
var init_errorUtil = __esm(() => {
|
|
503
503
|
(function(errorUtil2) {
|
|
@@ -506,7 +506,7 @@ var init_errorUtil = __esm(() => {
|
|
|
506
506
|
})(errorUtil || (errorUtil = {}));
|
|
507
507
|
});
|
|
508
508
|
|
|
509
|
-
// node_modules/zod/v3/types.js
|
|
509
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
|
|
510
510
|
class ParseInputLazyPath {
|
|
511
511
|
constructor(parent, value, path, key) {
|
|
512
512
|
this._cachedPath = [];
|
|
@@ -3857,7 +3857,7 @@ var init_types = __esm(() => {
|
|
|
3857
3857
|
NEVER = INVALID;
|
|
3858
3858
|
});
|
|
3859
3859
|
|
|
3860
|
-
// node_modules/zod/v3/external.js
|
|
3860
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
3861
3861
|
var exports_external = {};
|
|
3862
3862
|
__export(exports_external, {
|
|
3863
3863
|
void: () => voidType,
|
|
@@ -3977,7 +3977,7 @@ var init_external = __esm(() => {
|
|
|
3977
3977
|
init_ZodError();
|
|
3978
3978
|
});
|
|
3979
3979
|
|
|
3980
|
-
// node_modules/zod/index.js
|
|
3980
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/index.js
|
|
3981
3981
|
var init_zod = __esm(() => {
|
|
3982
3982
|
init_external();
|
|
3983
3983
|
init_external();
|
|
@@ -4151,7 +4151,9 @@ var init_schema = __esm(() => {
|
|
|
4151
4151
|
enabled: exports_external.boolean().optional().describe("Master switch for the session-handoff briefing (default true)."),
|
|
4152
4152
|
max_turns_in_briefing: exports_external.number().int().positive().optional().describe("Cap on recent user/assistant turn pairs fed to the summarizer."),
|
|
4153
4153
|
resume_mode: exports_external.enum(["auto", "continue", "handoff", "none"]).optional().describe("How to resume the next session. 'handoff' (default as of #362) " + "never passes --continue; a fresh Claude starts each restart and " + "reads a briefing assembled from recent Telegram messages, Hindsight " + "recall, and today's daily memory file. 'auto' uses --continue when " + "the latest JSONL is smaller than resume_max_bytes, else falls back " + "to the handoff briefing. 'continue' always passes --continue. " + "'none' starts completely fresh every time."),
|
|
4154
|
-
resume_max_bytes: exports_external.number().int().positive().optional().describe("Byte threshold above which 'auto' mode falls back to handoff " + "instead of --continue. Default 2_000_000 (~2MB). Large transcripts " + "can blow out the context window even with prefix caching, and " + "--continue replay is known-fragile at scale.")
|
|
4154
|
+
resume_max_bytes: exports_external.number().int().positive().optional().describe("Byte threshold above which 'auto' mode falls back to handoff " + "instead of --continue. Default 2_000_000 (~2MB). Large transcripts " + "can blow out the context window even with prefix caching, and " + "--continue replay is known-fragile at scale."),
|
|
4155
|
+
session_retention_max_count: exports_external.number().int().nonnegative().optional().describe("Session-JSONL retention (issue #2792): keep at most this many " + "newest session transcripts under .claude/projects; older ones " + "past both this count and the age bound are pruned by the Stop " + "hook. The newest sessions (and the handoff source) are always " + "kept. Default 20; set 0 to disable the count bound."),
|
|
4156
|
+
session_retention_max_age_days: exports_external.number().int().nonnegative().optional().describe("Session-JSONL retention (issue #2792): prune session transcripts " + "older than this many days (a file is deleted only when it is BOTH " + "over the count bound and older than this). Default 30; set 0 to " + "disable the age bound.")
|
|
4155
4157
|
}).optional();
|
|
4156
4158
|
webhookDispatchRule = exports_external.object({
|
|
4157
4159
|
description: exports_external.string().optional(),
|
|
@@ -5081,7 +5083,7 @@ function resolveDualPath(pathStr) {
|
|
|
5081
5083
|
var DEFAULT_STATE_DIR = ".switchroom", LEGACY_STATE_DIR = ".clerk", _legacyStateWarned = false;
|
|
5082
5084
|
var init_paths = () => {};
|
|
5083
5085
|
|
|
5084
|
-
// node_modules/yaml/dist/nodes/identity.js
|
|
5086
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/identity.js
|
|
5085
5087
|
var require_identity = __commonJS((exports) => {
|
|
5086
5088
|
var ALIAS = Symbol.for("yaml.alias");
|
|
5087
5089
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -5135,7 +5137,7 @@ var require_identity = __commonJS((exports) => {
|
|
|
5135
5137
|
exports.isSeq = isSeq;
|
|
5136
5138
|
});
|
|
5137
5139
|
|
|
5138
|
-
// node_modules/yaml/dist/visit.js
|
|
5140
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/visit.js
|
|
5139
5141
|
var require_visit = __commonJS((exports) => {
|
|
5140
5142
|
var identity = require_identity();
|
|
5141
5143
|
var BREAK = Symbol("break visit");
|
|
@@ -5290,7 +5292,7 @@ var require_visit = __commonJS((exports) => {
|
|
|
5290
5292
|
exports.visitAsync = visitAsync;
|
|
5291
5293
|
});
|
|
5292
5294
|
|
|
5293
|
-
// node_modules/yaml/dist/doc/directives.js
|
|
5295
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/directives.js
|
|
5294
5296
|
var require_directives = __commonJS((exports) => {
|
|
5295
5297
|
var identity = require_identity();
|
|
5296
5298
|
var visit = require_visit();
|
|
@@ -5442,7 +5444,7 @@ var require_directives = __commonJS((exports) => {
|
|
|
5442
5444
|
exports.Directives = Directives;
|
|
5443
5445
|
});
|
|
5444
5446
|
|
|
5445
|
-
// node_modules/yaml/dist/doc/anchors.js
|
|
5447
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/anchors.js
|
|
5446
5448
|
var require_anchors = __commonJS((exports) => {
|
|
5447
5449
|
var identity = require_identity();
|
|
5448
5450
|
var visit = require_visit();
|
|
@@ -5504,7 +5506,7 @@ var require_anchors = __commonJS((exports) => {
|
|
|
5504
5506
|
exports.findNewAnchor = findNewAnchor;
|
|
5505
5507
|
});
|
|
5506
5508
|
|
|
5507
|
-
// node_modules/yaml/dist/doc/applyReviver.js
|
|
5509
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/applyReviver.js
|
|
5508
5510
|
var require_applyReviver = __commonJS((exports) => {
|
|
5509
5511
|
function applyReviver(reviver, obj, key, val) {
|
|
5510
5512
|
if (val && typeof val === "object") {
|
|
@@ -5551,7 +5553,7 @@ var require_applyReviver = __commonJS((exports) => {
|
|
|
5551
5553
|
exports.applyReviver = applyReviver;
|
|
5552
5554
|
});
|
|
5553
5555
|
|
|
5554
|
-
// node_modules/yaml/dist/nodes/toJS.js
|
|
5556
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/toJS.js
|
|
5555
5557
|
var require_toJS = __commonJS((exports) => {
|
|
5556
5558
|
var identity = require_identity();
|
|
5557
5559
|
function toJS(value, arg, ctx) {
|
|
@@ -5578,7 +5580,7 @@ var require_toJS = __commonJS((exports) => {
|
|
|
5578
5580
|
exports.toJS = toJS;
|
|
5579
5581
|
});
|
|
5580
5582
|
|
|
5581
|
-
// node_modules/yaml/dist/nodes/Node.js
|
|
5583
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Node.js
|
|
5582
5584
|
var require_Node = __commonJS((exports) => {
|
|
5583
5585
|
var applyReviver = require_applyReviver();
|
|
5584
5586
|
var identity = require_identity();
|
|
@@ -5615,7 +5617,7 @@ var require_Node = __commonJS((exports) => {
|
|
|
5615
5617
|
exports.NodeBase = NodeBase;
|
|
5616
5618
|
});
|
|
5617
5619
|
|
|
5618
|
-
// node_modules/yaml/dist/nodes/Alias.js
|
|
5620
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Alias.js
|
|
5619
5621
|
var require_Alias = __commonJS((exports) => {
|
|
5620
5622
|
var anchors = require_anchors();
|
|
5621
5623
|
var visit = require_visit();
|
|
@@ -5723,7 +5725,7 @@ var require_Alias = __commonJS((exports) => {
|
|
|
5723
5725
|
exports.Alias = Alias;
|
|
5724
5726
|
});
|
|
5725
5727
|
|
|
5726
|
-
// node_modules/yaml/dist/nodes/Scalar.js
|
|
5728
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Scalar.js
|
|
5727
5729
|
var require_Scalar = __commonJS((exports) => {
|
|
5728
5730
|
var identity = require_identity();
|
|
5729
5731
|
var Node = require_Node();
|
|
@@ -5751,7 +5753,7 @@ var require_Scalar = __commonJS((exports) => {
|
|
|
5751
5753
|
exports.isScalarValue = isScalarValue;
|
|
5752
5754
|
});
|
|
5753
5755
|
|
|
5754
|
-
// node_modules/yaml/dist/doc/createNode.js
|
|
5756
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/createNode.js
|
|
5755
5757
|
var require_createNode = __commonJS((exports) => {
|
|
5756
5758
|
var Alias = require_Alias();
|
|
5757
5759
|
var identity = require_identity();
|
|
@@ -5823,7 +5825,7 @@ var require_createNode = __commonJS((exports) => {
|
|
|
5823
5825
|
exports.createNode = createNode;
|
|
5824
5826
|
});
|
|
5825
5827
|
|
|
5826
|
-
// node_modules/yaml/dist/nodes/Collection.js
|
|
5828
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Collection.js
|
|
5827
5829
|
var require_Collection = __commonJS((exports) => {
|
|
5828
5830
|
var createNode = require_createNode();
|
|
5829
5831
|
var identity = require_identity();
|
|
@@ -5938,7 +5940,7 @@ var require_Collection = __commonJS((exports) => {
|
|
|
5938
5940
|
exports.isEmptyPath = isEmptyPath;
|
|
5939
5941
|
});
|
|
5940
5942
|
|
|
5941
|
-
// node_modules/yaml/dist/stringify/stringifyComment.js
|
|
5943
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
5942
5944
|
var require_stringifyComment = __commonJS((exports) => {
|
|
5943
5945
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
5944
5946
|
function indentComment(comment, indent) {
|
|
@@ -5955,7 +5957,7 @@ var require_stringifyComment = __commonJS((exports) => {
|
|
|
5955
5957
|
exports.stringifyComment = stringifyComment;
|
|
5956
5958
|
});
|
|
5957
5959
|
|
|
5958
|
-
// node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
5960
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
5959
5961
|
var require_foldFlowLines = __commonJS((exports) => {
|
|
5960
5962
|
var FOLD_FLOW = "flow";
|
|
5961
5963
|
var FOLD_BLOCK = "block";
|
|
@@ -6092,7 +6094,7 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
6092
6094
|
exports.foldFlowLines = foldFlowLines;
|
|
6093
6095
|
});
|
|
6094
6096
|
|
|
6095
|
-
// node_modules/yaml/dist/stringify/stringifyString.js
|
|
6097
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyString.js
|
|
6096
6098
|
var require_stringifyString = __commonJS((exports) => {
|
|
6097
6099
|
var Scalar = require_Scalar();
|
|
6098
6100
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -6390,7 +6392,7 @@ ${indent}`);
|
|
|
6390
6392
|
exports.stringifyString = stringifyString;
|
|
6391
6393
|
});
|
|
6392
6394
|
|
|
6393
|
-
// node_modules/yaml/dist/stringify/stringify.js
|
|
6395
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringify.js
|
|
6394
6396
|
var require_stringify = __commonJS((exports) => {
|
|
6395
6397
|
var anchors = require_anchors();
|
|
6396
6398
|
var identity = require_identity();
|
|
@@ -6511,7 +6513,7 @@ ${ctx.indent}${str}`;
|
|
|
6511
6513
|
exports.stringify = stringify;
|
|
6512
6514
|
});
|
|
6513
6515
|
|
|
6514
|
-
// node_modules/yaml/dist/stringify/stringifyPair.js
|
|
6516
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
6515
6517
|
var require_stringifyPair = __commonJS((exports) => {
|
|
6516
6518
|
var identity = require_identity();
|
|
6517
6519
|
var Scalar = require_Scalar();
|
|
@@ -6647,7 +6649,7 @@ ${ctx.indent}`;
|
|
|
6647
6649
|
exports.stringifyPair = stringifyPair;
|
|
6648
6650
|
});
|
|
6649
6651
|
|
|
6650
|
-
// node_modules/yaml/dist/log.js
|
|
6652
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/log.js
|
|
6651
6653
|
var require_log = __commonJS((exports) => {
|
|
6652
6654
|
var node_process = __require("process");
|
|
6653
6655
|
function debug(logLevel, ...messages) {
|
|
@@ -6666,7 +6668,7 @@ var require_log = __commonJS((exports) => {
|
|
|
6666
6668
|
exports.warn = warn;
|
|
6667
6669
|
});
|
|
6668
6670
|
|
|
6669
|
-
// node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
6671
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/merge.js
|
|
6670
6672
|
var require_merge = __commonJS((exports) => {
|
|
6671
6673
|
var identity = require_identity();
|
|
6672
6674
|
var Scalar = require_Scalar();
|
|
@@ -6720,7 +6722,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
6720
6722
|
exports.merge = merge;
|
|
6721
6723
|
});
|
|
6722
6724
|
|
|
6723
|
-
// node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
6725
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
6724
6726
|
var require_addPairToJSMap = __commonJS((exports) => {
|
|
6725
6727
|
var log = require_log();
|
|
6726
6728
|
var merge = require_merge();
|
|
@@ -6781,7 +6783,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
6781
6783
|
exports.addPairToJSMap = addPairToJSMap;
|
|
6782
6784
|
});
|
|
6783
6785
|
|
|
6784
|
-
// node_modules/yaml/dist/nodes/Pair.js
|
|
6786
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/Pair.js
|
|
6785
6787
|
var require_Pair = __commonJS((exports) => {
|
|
6786
6788
|
var createNode = require_createNode();
|
|
6787
6789
|
var stringifyPair = require_stringifyPair();
|
|
@@ -6819,7 +6821,7 @@ var require_Pair = __commonJS((exports) => {
|
|
|
6819
6821
|
exports.createPair = createPair;
|
|
6820
6822
|
});
|
|
6821
6823
|
|
|
6822
|
-
// node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
6824
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
6823
6825
|
var require_stringifyCollection = __commonJS((exports) => {
|
|
6824
6826
|
var identity = require_identity();
|
|
6825
6827
|
var stringify = require_stringify();
|
|
@@ -6971,7 +6973,7 @@ ${indent}${end}`;
|
|
|
6971
6973
|
exports.stringifyCollection = stringifyCollection;
|
|
6972
6974
|
});
|
|
6973
6975
|
|
|
6974
|
-
// node_modules/yaml/dist/nodes/YAMLMap.js
|
|
6976
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
6975
6977
|
var require_YAMLMap = __commonJS((exports) => {
|
|
6976
6978
|
var stringifyCollection = require_stringifyCollection();
|
|
6977
6979
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -7098,7 +7100,7 @@ var require_YAMLMap = __commonJS((exports) => {
|
|
|
7098
7100
|
exports.findPair = findPair;
|
|
7099
7101
|
});
|
|
7100
7102
|
|
|
7101
|
-
// node_modules/yaml/dist/schema/common/map.js
|
|
7103
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/map.js
|
|
7102
7104
|
var require_map = __commonJS((exports) => {
|
|
7103
7105
|
var identity = require_identity();
|
|
7104
7106
|
var YAMLMap = require_YAMLMap();
|
|
@@ -7117,7 +7119,7 @@ var require_map = __commonJS((exports) => {
|
|
|
7117
7119
|
exports.map = map;
|
|
7118
7120
|
});
|
|
7119
7121
|
|
|
7120
|
-
// node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
7122
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
7121
7123
|
var require_YAMLSeq = __commonJS((exports) => {
|
|
7122
7124
|
var createNode = require_createNode();
|
|
7123
7125
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -7210,7 +7212,7 @@ var require_YAMLSeq = __commonJS((exports) => {
|
|
|
7210
7212
|
exports.YAMLSeq = YAMLSeq;
|
|
7211
7213
|
});
|
|
7212
7214
|
|
|
7213
|
-
// node_modules/yaml/dist/schema/common/seq.js
|
|
7215
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/seq.js
|
|
7214
7216
|
var require_seq = __commonJS((exports) => {
|
|
7215
7217
|
var identity = require_identity();
|
|
7216
7218
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -7229,7 +7231,7 @@ var require_seq = __commonJS((exports) => {
|
|
|
7229
7231
|
exports.seq = seq;
|
|
7230
7232
|
});
|
|
7231
7233
|
|
|
7232
|
-
// node_modules/yaml/dist/schema/common/string.js
|
|
7234
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/string.js
|
|
7233
7235
|
var require_string = __commonJS((exports) => {
|
|
7234
7236
|
var stringifyString = require_stringifyString();
|
|
7235
7237
|
var string = {
|
|
@@ -7245,7 +7247,7 @@ var require_string = __commonJS((exports) => {
|
|
|
7245
7247
|
exports.string = string;
|
|
7246
7248
|
});
|
|
7247
7249
|
|
|
7248
|
-
// node_modules/yaml/dist/schema/common/null.js
|
|
7250
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/common/null.js
|
|
7249
7251
|
var require_null = __commonJS((exports) => {
|
|
7250
7252
|
var Scalar = require_Scalar();
|
|
7251
7253
|
var nullTag = {
|
|
@@ -7260,7 +7262,7 @@ var require_null = __commonJS((exports) => {
|
|
|
7260
7262
|
exports.nullTag = nullTag;
|
|
7261
7263
|
});
|
|
7262
7264
|
|
|
7263
|
-
// node_modules/yaml/dist/schema/core/bool.js
|
|
7265
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/bool.js
|
|
7264
7266
|
var require_bool = __commonJS((exports) => {
|
|
7265
7267
|
var Scalar = require_Scalar();
|
|
7266
7268
|
var boolTag = {
|
|
@@ -7281,7 +7283,7 @@ var require_bool = __commonJS((exports) => {
|
|
|
7281
7283
|
exports.boolTag = boolTag;
|
|
7282
7284
|
});
|
|
7283
7285
|
|
|
7284
|
-
// node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
7286
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
7285
7287
|
var require_stringifyNumber = __commonJS((exports) => {
|
|
7286
7288
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
7287
7289
|
if (typeof value === "bigint")
|
|
@@ -7305,7 +7307,7 @@ var require_stringifyNumber = __commonJS((exports) => {
|
|
|
7305
7307
|
exports.stringifyNumber = stringifyNumber;
|
|
7306
7308
|
});
|
|
7307
7309
|
|
|
7308
|
-
// node_modules/yaml/dist/schema/core/float.js
|
|
7310
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/float.js
|
|
7309
7311
|
var require_float = __commonJS((exports) => {
|
|
7310
7312
|
var Scalar = require_Scalar();
|
|
7311
7313
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -7348,7 +7350,7 @@ var require_float = __commonJS((exports) => {
|
|
|
7348
7350
|
exports.floatNaN = floatNaN;
|
|
7349
7351
|
});
|
|
7350
7352
|
|
|
7351
|
-
// node_modules/yaml/dist/schema/core/int.js
|
|
7353
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/int.js
|
|
7352
7354
|
var require_int = __commonJS((exports) => {
|
|
7353
7355
|
var stringifyNumber = require_stringifyNumber();
|
|
7354
7356
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -7390,7 +7392,7 @@ var require_int = __commonJS((exports) => {
|
|
|
7390
7392
|
exports.intOct = intOct;
|
|
7391
7393
|
});
|
|
7392
7394
|
|
|
7393
|
-
// node_modules/yaml/dist/schema/core/schema.js
|
|
7395
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/core/schema.js
|
|
7394
7396
|
var require_schema = __commonJS((exports) => {
|
|
7395
7397
|
var map = require_map();
|
|
7396
7398
|
var _null = require_null();
|
|
@@ -7415,7 +7417,7 @@ var require_schema = __commonJS((exports) => {
|
|
|
7415
7417
|
exports.schema = schema;
|
|
7416
7418
|
});
|
|
7417
7419
|
|
|
7418
|
-
// node_modules/yaml/dist/schema/json/schema.js
|
|
7420
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/json/schema.js
|
|
7419
7421
|
var require_schema2 = __commonJS((exports) => {
|
|
7420
7422
|
var Scalar = require_Scalar();
|
|
7421
7423
|
var map = require_map();
|
|
@@ -7479,7 +7481,7 @@ var require_schema2 = __commonJS((exports) => {
|
|
|
7479
7481
|
exports.schema = schema;
|
|
7480
7482
|
});
|
|
7481
7483
|
|
|
7482
|
-
// node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
7484
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
7483
7485
|
var require_binary = __commonJS((exports) => {
|
|
7484
7486
|
var node_buffer = __require("buffer");
|
|
7485
7487
|
var Scalar = require_Scalar();
|
|
@@ -7534,7 +7536,7 @@ var require_binary = __commonJS((exports) => {
|
|
|
7534
7536
|
exports.binary = binary;
|
|
7535
7537
|
});
|
|
7536
7538
|
|
|
7537
|
-
// node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
7539
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
7538
7540
|
var require_pairs = __commonJS((exports) => {
|
|
7539
7541
|
var identity = require_identity();
|
|
7540
7542
|
var Pair = require_Pair();
|
|
@@ -7609,7 +7611,7 @@ ${cn.comment}` : item.comment;
|
|
|
7609
7611
|
exports.resolvePairs = resolvePairs;
|
|
7610
7612
|
});
|
|
7611
7613
|
|
|
7612
|
-
// node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
7614
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
7613
7615
|
var require_omap = __commonJS((exports) => {
|
|
7614
7616
|
var identity = require_identity();
|
|
7615
7617
|
var toJS = require_toJS();
|
|
@@ -7681,7 +7683,7 @@ var require_omap = __commonJS((exports) => {
|
|
|
7681
7683
|
exports.omap = omap;
|
|
7682
7684
|
});
|
|
7683
7685
|
|
|
7684
|
-
// node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
7686
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
7685
7687
|
var require_bool2 = __commonJS((exports) => {
|
|
7686
7688
|
var Scalar = require_Scalar();
|
|
7687
7689
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -7710,7 +7712,7 @@ var require_bool2 = __commonJS((exports) => {
|
|
|
7710
7712
|
exports.trueTag = trueTag;
|
|
7711
7713
|
});
|
|
7712
7714
|
|
|
7713
|
-
// node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
7715
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
7714
7716
|
var require_float2 = __commonJS((exports) => {
|
|
7715
7717
|
var Scalar = require_Scalar();
|
|
7716
7718
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -7756,7 +7758,7 @@ var require_float2 = __commonJS((exports) => {
|
|
|
7756
7758
|
exports.floatNaN = floatNaN;
|
|
7757
7759
|
});
|
|
7758
7760
|
|
|
7759
|
-
// node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
7761
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
7760
7762
|
var require_int2 = __commonJS((exports) => {
|
|
7761
7763
|
var stringifyNumber = require_stringifyNumber();
|
|
7762
7764
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -7832,7 +7834,7 @@ var require_int2 = __commonJS((exports) => {
|
|
|
7832
7834
|
exports.intOct = intOct;
|
|
7833
7835
|
});
|
|
7834
7836
|
|
|
7835
|
-
// node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
7837
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
7836
7838
|
var require_set = __commonJS((exports) => {
|
|
7837
7839
|
var identity = require_identity();
|
|
7838
7840
|
var Pair = require_Pair();
|
|
@@ -7915,7 +7917,7 @@ var require_set = __commonJS((exports) => {
|
|
|
7915
7917
|
exports.set = set;
|
|
7916
7918
|
});
|
|
7917
7919
|
|
|
7918
|
-
// node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
7920
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
7919
7921
|
var require_timestamp = __commonJS((exports) => {
|
|
7920
7922
|
var stringifyNumber = require_stringifyNumber();
|
|
7921
7923
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -7997,7 +7999,7 @@ var require_timestamp = __commonJS((exports) => {
|
|
|
7997
7999
|
exports.timestamp = timestamp;
|
|
7998
8000
|
});
|
|
7999
8001
|
|
|
8000
|
-
// node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
8002
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
8001
8003
|
var require_schema3 = __commonJS((exports) => {
|
|
8002
8004
|
var map = require_map();
|
|
8003
8005
|
var _null = require_null();
|
|
@@ -8038,7 +8040,7 @@ var require_schema3 = __commonJS((exports) => {
|
|
|
8038
8040
|
exports.schema = schema;
|
|
8039
8041
|
});
|
|
8040
8042
|
|
|
8041
|
-
// node_modules/yaml/dist/schema/tags.js
|
|
8043
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/tags.js
|
|
8042
8044
|
var require_tags = __commonJS((exports) => {
|
|
8043
8045
|
var map = require_map();
|
|
8044
8046
|
var _null = require_null();
|
|
@@ -8129,7 +8131,7 @@ var require_tags = __commonJS((exports) => {
|
|
|
8129
8131
|
exports.getTags = getTags;
|
|
8130
8132
|
});
|
|
8131
8133
|
|
|
8132
|
-
// node_modules/yaml/dist/schema/Schema.js
|
|
8134
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/schema/Schema.js
|
|
8133
8135
|
var require_Schema = __commonJS((exports) => {
|
|
8134
8136
|
var identity = require_identity();
|
|
8135
8137
|
var map = require_map();
|
|
@@ -8159,7 +8161,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
8159
8161
|
exports.Schema = Schema;
|
|
8160
8162
|
});
|
|
8161
8163
|
|
|
8162
|
-
// node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
8164
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
8163
8165
|
var require_stringifyDocument = __commonJS((exports) => {
|
|
8164
8166
|
var identity = require_identity();
|
|
8165
8167
|
var stringify = require_stringify();
|
|
@@ -8239,7 +8241,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
8239
8241
|
exports.stringifyDocument = stringifyDocument;
|
|
8240
8242
|
});
|
|
8241
8243
|
|
|
8242
|
-
// node_modules/yaml/dist/doc/Document.js
|
|
8244
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/doc/Document.js
|
|
8243
8245
|
var require_Document = __commonJS((exports) => {
|
|
8244
8246
|
var Alias = require_Alias();
|
|
8245
8247
|
var Collection = require_Collection();
|
|
@@ -8474,7 +8476,7 @@ var require_Document = __commonJS((exports) => {
|
|
|
8474
8476
|
exports.Document = Document;
|
|
8475
8477
|
});
|
|
8476
8478
|
|
|
8477
|
-
// node_modules/yaml/dist/errors.js
|
|
8479
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/errors.js
|
|
8478
8480
|
var require_errors = __commonJS((exports) => {
|
|
8479
8481
|
class YAMLError extends Error {
|
|
8480
8482
|
constructor(name, pos, code, message) {
|
|
@@ -8539,7 +8541,7 @@ ${pointer}
|
|
|
8539
8541
|
exports.prettifyError = prettifyError;
|
|
8540
8542
|
});
|
|
8541
8543
|
|
|
8542
|
-
// node_modules/yaml/dist/compose/resolve-props.js
|
|
8544
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-props.js
|
|
8543
8545
|
var require_resolve_props = __commonJS((exports) => {
|
|
8544
8546
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
8545
8547
|
let spaceBefore = false;
|
|
@@ -8669,7 +8671,7 @@ var require_resolve_props = __commonJS((exports) => {
|
|
|
8669
8671
|
exports.resolveProps = resolveProps;
|
|
8670
8672
|
});
|
|
8671
8673
|
|
|
8672
|
-
// node_modules/yaml/dist/compose/util-contains-newline.js
|
|
8674
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
8673
8675
|
var require_util_contains_newline = __commonJS((exports) => {
|
|
8674
8676
|
function containsNewline(key) {
|
|
8675
8677
|
if (!key)
|
|
@@ -8709,7 +8711,7 @@ var require_util_contains_newline = __commonJS((exports) => {
|
|
|
8709
8711
|
exports.containsNewline = containsNewline;
|
|
8710
8712
|
});
|
|
8711
8713
|
|
|
8712
|
-
// node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
8714
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
8713
8715
|
var require_util_flow_indent_check = __commonJS((exports) => {
|
|
8714
8716
|
var utilContainsNewline = require_util_contains_newline();
|
|
8715
8717
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -8724,7 +8726,7 @@ var require_util_flow_indent_check = __commonJS((exports) => {
|
|
|
8724
8726
|
exports.flowIndentCheck = flowIndentCheck;
|
|
8725
8727
|
});
|
|
8726
8728
|
|
|
8727
|
-
// node_modules/yaml/dist/compose/util-map-includes.js
|
|
8729
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-map-includes.js
|
|
8728
8730
|
var require_util_map_includes = __commonJS((exports) => {
|
|
8729
8731
|
var identity = require_identity();
|
|
8730
8732
|
function mapIncludes(ctx, items, search) {
|
|
@@ -8737,7 +8739,7 @@ var require_util_map_includes = __commonJS((exports) => {
|
|
|
8737
8739
|
exports.mapIncludes = mapIncludes;
|
|
8738
8740
|
});
|
|
8739
8741
|
|
|
8740
|
-
// node_modules/yaml/dist/compose/resolve-block-map.js
|
|
8742
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
8741
8743
|
var require_resolve_block_map = __commonJS((exports) => {
|
|
8742
8744
|
var Pair = require_Pair();
|
|
8743
8745
|
var YAMLMap = require_YAMLMap();
|
|
@@ -8844,7 +8846,7 @@ var require_resolve_block_map = __commonJS((exports) => {
|
|
|
8844
8846
|
exports.resolveBlockMap = resolveBlockMap;
|
|
8845
8847
|
});
|
|
8846
8848
|
|
|
8847
|
-
// node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
8849
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
8848
8850
|
var require_resolve_block_seq = __commonJS((exports) => {
|
|
8849
8851
|
var YAMLSeq = require_YAMLSeq();
|
|
8850
8852
|
var resolveProps = require_resolve_props();
|
|
@@ -8892,7 +8894,7 @@ var require_resolve_block_seq = __commonJS((exports) => {
|
|
|
8892
8894
|
exports.resolveBlockSeq = resolveBlockSeq;
|
|
8893
8895
|
});
|
|
8894
8896
|
|
|
8895
|
-
// node_modules/yaml/dist/compose/resolve-end.js
|
|
8897
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-end.js
|
|
8896
8898
|
var require_resolve_end = __commonJS((exports) => {
|
|
8897
8899
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
8898
8900
|
let comment = "";
|
|
@@ -8932,7 +8934,7 @@ var require_resolve_end = __commonJS((exports) => {
|
|
|
8932
8934
|
exports.resolveEnd = resolveEnd;
|
|
8933
8935
|
});
|
|
8934
8936
|
|
|
8935
|
-
// node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
8937
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
8936
8938
|
var require_resolve_flow_collection = __commonJS((exports) => {
|
|
8937
8939
|
var identity = require_identity();
|
|
8938
8940
|
var Pair = require_Pair();
|
|
@@ -9123,7 +9125,7 @@ var require_resolve_flow_collection = __commonJS((exports) => {
|
|
|
9123
9125
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
9124
9126
|
});
|
|
9125
9127
|
|
|
9126
|
-
// node_modules/yaml/dist/compose/compose-collection.js
|
|
9128
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-collection.js
|
|
9127
9129
|
var require_compose_collection = __commonJS((exports) => {
|
|
9128
9130
|
var identity = require_identity();
|
|
9129
9131
|
var Scalar = require_Scalar();
|
|
@@ -9185,7 +9187,7 @@ var require_compose_collection = __commonJS((exports) => {
|
|
|
9185
9187
|
exports.composeCollection = composeCollection;
|
|
9186
9188
|
});
|
|
9187
9189
|
|
|
9188
|
-
// node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
9190
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
9189
9191
|
var require_resolve_block_scalar = __commonJS((exports) => {
|
|
9190
9192
|
var Scalar = require_Scalar();
|
|
9191
9193
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
@@ -9378,7 +9380,7 @@ var require_resolve_block_scalar = __commonJS((exports) => {
|
|
|
9378
9380
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
9379
9381
|
});
|
|
9380
9382
|
|
|
9381
|
-
// node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
9383
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
9382
9384
|
var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
9383
9385
|
var Scalar = require_Scalar();
|
|
9384
9386
|
var resolveEnd = require_resolve_end();
|
|
@@ -9594,7 +9596,7 @@ var require_resolve_flow_scalar = __commonJS((exports) => {
|
|
|
9594
9596
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
9595
9597
|
});
|
|
9596
9598
|
|
|
9597
|
-
// node_modules/yaml/dist/compose/compose-scalar.js
|
|
9599
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-scalar.js
|
|
9598
9600
|
var require_compose_scalar = __commonJS((exports) => {
|
|
9599
9601
|
var identity = require_identity();
|
|
9600
9602
|
var Scalar = require_Scalar();
|
|
@@ -9672,7 +9674,7 @@ var require_compose_scalar = __commonJS((exports) => {
|
|
|
9672
9674
|
exports.composeScalar = composeScalar;
|
|
9673
9675
|
});
|
|
9674
9676
|
|
|
9675
|
-
// node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
9677
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
9676
9678
|
var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
9677
9679
|
function emptyScalarPosition(offset, before, pos) {
|
|
9678
9680
|
if (before) {
|
|
@@ -9699,7 +9701,7 @@ var require_util_empty_scalar_position = __commonJS((exports) => {
|
|
|
9699
9701
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
9700
9702
|
});
|
|
9701
9703
|
|
|
9702
|
-
// node_modules/yaml/dist/compose/compose-node.js
|
|
9704
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-node.js
|
|
9703
9705
|
var require_compose_node = __commonJS((exports) => {
|
|
9704
9706
|
var Alias = require_Alias();
|
|
9705
9707
|
var identity = require_identity();
|
|
@@ -9802,7 +9804,7 @@ var require_compose_node = __commonJS((exports) => {
|
|
|
9802
9804
|
exports.composeNode = composeNode;
|
|
9803
9805
|
});
|
|
9804
9806
|
|
|
9805
|
-
// node_modules/yaml/dist/compose/compose-doc.js
|
|
9807
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/compose-doc.js
|
|
9806
9808
|
var require_compose_doc = __commonJS((exports) => {
|
|
9807
9809
|
var Document = require_Document();
|
|
9808
9810
|
var composeNode = require_compose_node();
|
|
@@ -9842,7 +9844,7 @@ var require_compose_doc = __commonJS((exports) => {
|
|
|
9842
9844
|
exports.composeDoc = composeDoc;
|
|
9843
9845
|
});
|
|
9844
9846
|
|
|
9845
|
-
// node_modules/yaml/dist/compose/composer.js
|
|
9847
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/compose/composer.js
|
|
9846
9848
|
var require_composer = __commonJS((exports) => {
|
|
9847
9849
|
var node_process = __require("process");
|
|
9848
9850
|
var directives = require_directives();
|
|
@@ -10031,7 +10033,7 @@ ${end.comment}` : end.comment;
|
|
|
10031
10033
|
exports.Composer = Composer;
|
|
10032
10034
|
});
|
|
10033
10035
|
|
|
10034
|
-
// node_modules/yaml/dist/parse/cst-scalar.js
|
|
10036
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-scalar.js
|
|
10035
10037
|
var require_cst_scalar = __commonJS((exports) => {
|
|
10036
10038
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
10037
10039
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -10221,7 +10223,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
10221
10223
|
exports.setScalarValue = setScalarValue;
|
|
10222
10224
|
});
|
|
10223
10225
|
|
|
10224
|
-
// node_modules/yaml/dist/parse/cst-stringify.js
|
|
10226
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-stringify.js
|
|
10225
10227
|
var require_cst_stringify = __commonJS((exports) => {
|
|
10226
10228
|
var stringify = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
10227
10229
|
function stringifyToken(token) {
|
|
@@ -10279,7 +10281,7 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
10279
10281
|
exports.stringify = stringify;
|
|
10280
10282
|
});
|
|
10281
10283
|
|
|
10282
|
-
// node_modules/yaml/dist/parse/cst-visit.js
|
|
10284
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst-visit.js
|
|
10283
10285
|
var require_cst_visit = __commonJS((exports) => {
|
|
10284
10286
|
var BREAK = Symbol("break visit");
|
|
10285
10287
|
var SKIP = Symbol("skip children");
|
|
@@ -10338,7 +10340,7 @@ var require_cst_visit = __commonJS((exports) => {
|
|
|
10338
10340
|
exports.visit = visit;
|
|
10339
10341
|
});
|
|
10340
10342
|
|
|
10341
|
-
// node_modules/yaml/dist/parse/cst.js
|
|
10343
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/cst.js
|
|
10342
10344
|
var require_cst = __commonJS((exports) => {
|
|
10343
10345
|
var cstScalar = require_cst_scalar();
|
|
10344
10346
|
var cstStringify = require_cst_stringify();
|
|
@@ -10439,7 +10441,7 @@ var require_cst = __commonJS((exports) => {
|
|
|
10439
10441
|
exports.tokenType = tokenType;
|
|
10440
10442
|
});
|
|
10441
10443
|
|
|
10442
|
-
// node_modules/yaml/dist/parse/lexer.js
|
|
10444
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/lexer.js
|
|
10443
10445
|
var require_lexer = __commonJS((exports) => {
|
|
10444
10446
|
var cst = require_cst();
|
|
10445
10447
|
function isEmpty(ch) {
|
|
@@ -11025,7 +11027,7 @@ var require_lexer = __commonJS((exports) => {
|
|
|
11025
11027
|
exports.Lexer = Lexer;
|
|
11026
11028
|
});
|
|
11027
11029
|
|
|
11028
|
-
// node_modules/yaml/dist/parse/line-counter.js
|
|
11030
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/line-counter.js
|
|
11029
11031
|
var require_line_counter = __commonJS((exports) => {
|
|
11030
11032
|
class LineCounter {
|
|
11031
11033
|
constructor() {
|
|
@@ -11053,7 +11055,7 @@ var require_line_counter = __commonJS((exports) => {
|
|
|
11053
11055
|
exports.LineCounter = LineCounter;
|
|
11054
11056
|
});
|
|
11055
11057
|
|
|
11056
|
-
// node_modules/yaml/dist/parse/parser.js
|
|
11058
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/parse/parser.js
|
|
11057
11059
|
var require_parser = __commonJS((exports) => {
|
|
11058
11060
|
var node_process = __require("process");
|
|
11059
11061
|
var cst = require_cst();
|
|
@@ -11902,7 +11904,7 @@ var require_parser = __commonJS((exports) => {
|
|
|
11902
11904
|
exports.Parser = Parser;
|
|
11903
11905
|
});
|
|
11904
11906
|
|
|
11905
|
-
// node_modules/yaml/dist/public-api.js
|
|
11907
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/public-api.js
|
|
11906
11908
|
var require_public_api = __commonJS((exports) => {
|
|
11907
11909
|
var composer = require_composer();
|
|
11908
11910
|
var Document = require_Document();
|
|
@@ -11996,7 +11998,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
11996
11998
|
exports.stringify = stringify;
|
|
11997
11999
|
});
|
|
11998
12000
|
|
|
11999
|
-
// node_modules/yaml/dist/index.js
|
|
12001
|
+
// node_modules/.bun/yaml@2.8.3/node_modules/yaml/dist/index.js
|
|
12000
12002
|
var composer, Document, Schema, errors2, Alias, identity, Pair, Scalar, YAMLMap, YAMLSeq, cst, lexer, lineCounter, parser, publicApi, visit, $Composer, $Document, $Schema, $YAMLError, $YAMLParseError, $YAMLWarning, $Alias, $isAlias, $isCollection, $isDocument, $isMap, $isNode, $isPair, $isScalar, $isSeq, $Pair, $Scalar, $YAMLMap, $YAMLSeq, $Lexer, $LineCounter, $Parser, $parse, $parseAllDocuments, $parseDocument, $stringify, $visit, $visitAsync;
|
|
12001
12003
|
var init_dist = __esm(() => {
|
|
12002
12004
|
composer = require_composer();
|
|
@@ -12411,7 +12413,7 @@ var init_loader = __esm(() => {
|
|
|
12411
12413
|
|
|
12412
12414
|
// src/vault/broker/server.ts
|
|
12413
12415
|
import * as net from "node:net";
|
|
12414
|
-
import { mkdirSync as mkdirSync5, chmodSync as chmodSync4, chownSync, existsSync as
|
|
12416
|
+
import { mkdirSync as mkdirSync5, chmodSync as chmodSync4, chownSync, existsSync as existsSync10, readFileSync as readFileSync8, readdirSync as readdirSync3, statSync as statSync5, unlinkSync as unlinkSync6, writeFileSync, renameSync as renameSync6 } from "node:fs";
|
|
12415
12417
|
|
|
12416
12418
|
// src/agents/compose.ts
|
|
12417
12419
|
import { createHash } from "node:crypto";
|
|
@@ -12482,23 +12484,46 @@ function getPeerCred(fd) {
|
|
|
12482
12484
|
}
|
|
12483
12485
|
}
|
|
12484
12486
|
|
|
12485
|
-
// src/
|
|
12486
|
-
|
|
12487
|
-
var SOCKET_PATH_AGENT_SUBDIR_RE = /^\/run\/switchroom\/broker\/([a-zA-Z0-9][a-zA-Z0-9_-]*)\/sock$/;
|
|
12488
|
-
var RESERVED_AGENT_NAMES = new Set(["operator", "hostd"]);
|
|
12489
|
-
function socketPathToIdentity(socketPath) {
|
|
12487
|
+
// src/broker-common/peercred-path.ts
|
|
12488
|
+
function matchSocketName(socketPath, patterns, maxNameLen) {
|
|
12490
12489
|
if (typeof socketPath !== "string" || socketPath.length === 0)
|
|
12491
12490
|
return null;
|
|
12492
|
-
|
|
12493
|
-
|
|
12491
|
+
let name = null;
|
|
12492
|
+
for (const re of patterns) {
|
|
12493
|
+
const m = socketPath.match(re);
|
|
12494
|
+
if (m && typeof m[1] === "string") {
|
|
12495
|
+
name = m[1];
|
|
12496
|
+
break;
|
|
12497
|
+
}
|
|
12498
|
+
}
|
|
12499
|
+
if (name === null || name.length === 0)
|
|
12500
|
+
return null;
|
|
12501
|
+
if (maxNameLen !== undefined && name.length > maxNameLen)
|
|
12494
12502
|
return null;
|
|
12495
|
-
|
|
12496
|
-
|
|
12503
|
+
return name;
|
|
12504
|
+
}
|
|
12505
|
+
function parseSocketIdentity(socketPath, spec) {
|
|
12506
|
+
const name = matchSocketName(socketPath, spec.patterns, spec.maxNameLen);
|
|
12507
|
+
if (name === null)
|
|
12508
|
+
return null;
|
|
12509
|
+
const operatorName = spec.operatorName ?? "operator";
|
|
12510
|
+
if (name === operatorName)
|
|
12497
12511
|
return { kind: "operator" };
|
|
12498
|
-
if (
|
|
12512
|
+
if (spec.reservedNames.has(name))
|
|
12499
12513
|
return null;
|
|
12500
12514
|
return { kind: "agent", name };
|
|
12501
12515
|
}
|
|
12516
|
+
|
|
12517
|
+
// src/vault/broker/peercred.ts
|
|
12518
|
+
var SOCKET_PATH_AGENT_RE = /^\/run\/switchroom\/broker\/([a-zA-Z0-9][a-zA-Z0-9_-]*)\.sock$/;
|
|
12519
|
+
var SOCKET_PATH_AGENT_SUBDIR_RE = /^\/run\/switchroom\/broker\/([a-zA-Z0-9][a-zA-Z0-9_-]*)\/sock$/;
|
|
12520
|
+
var RESERVED_AGENT_NAMES = new Set(["operator", "hostd"]);
|
|
12521
|
+
function socketPathToIdentity(socketPath) {
|
|
12522
|
+
return parseSocketIdentity(socketPath, {
|
|
12523
|
+
patterns: [SOCKET_PATH_AGENT_RE, SOCKET_PATH_AGENT_SUBDIR_RE],
|
|
12524
|
+
reservedNames: RESERVED_AGENT_NAMES
|
|
12525
|
+
});
|
|
12526
|
+
}
|
|
12502
12527
|
function socketPathToAgent(socketPath) {
|
|
12503
12528
|
const identity = socketPathToIdentity(socketPath);
|
|
12504
12529
|
return identity?.kind === "agent" ? identity.name : null;
|
|
@@ -12769,11 +12794,14 @@ import * as path3 from "node:path";
|
|
|
12769
12794
|
import { randomBytes, scryptSync, createCipheriv, createDecipheriv } from "node:crypto";
|
|
12770
12795
|
import {
|
|
12771
12796
|
readFileSync as readFileSync3,
|
|
12772
|
-
|
|
12797
|
+
writeSync as writeSync2,
|
|
12773
12798
|
existsSync as existsSync3,
|
|
12774
12799
|
renameSync,
|
|
12775
12800
|
mkdirSync,
|
|
12776
12801
|
unlinkSync as unlinkSync2,
|
|
12802
|
+
fsyncSync as fsyncSync2,
|
|
12803
|
+
openSync as openSync2,
|
|
12804
|
+
closeSync as closeSync2,
|
|
12777
12805
|
lstatSync,
|
|
12778
12806
|
realpathSync
|
|
12779
12807
|
} from "node:fs";
|
|
@@ -13017,8 +13045,22 @@ function atomicWriteFileSync(path, data, mode) {
|
|
|
13017
13045
|
const dir = dirname(resolve2(effectivePath));
|
|
13018
13046
|
const tmp = resolve2(dir, `.${basename(effectivePath)}.${process.pid}.${Date.now()}.tmp`);
|
|
13019
13047
|
try {
|
|
13020
|
-
|
|
13048
|
+
const fd = openSync2(tmp, "wx", mode);
|
|
13049
|
+
try {
|
|
13050
|
+
writeSync2(fd, data);
|
|
13051
|
+
fsyncSync2(fd);
|
|
13052
|
+
} finally {
|
|
13053
|
+
closeSync2(fd);
|
|
13054
|
+
}
|
|
13021
13055
|
renameSync(tmp, effectivePath);
|
|
13056
|
+
try {
|
|
13057
|
+
const dirFd = openSync2(dir, "r");
|
|
13058
|
+
try {
|
|
13059
|
+
fsyncSync2(dirFd);
|
|
13060
|
+
} finally {
|
|
13061
|
+
closeSync2(dirFd);
|
|
13062
|
+
}
|
|
13063
|
+
} catch {}
|
|
13022
13064
|
} catch (err) {
|
|
13023
13065
|
try {
|
|
13024
13066
|
if (existsSync3(tmp))
|
|
@@ -13289,7 +13331,18 @@ init_loader();
|
|
|
13289
13331
|
|
|
13290
13332
|
// src/vault/auto-unlock.ts
|
|
13291
13333
|
import { createHmac, randomBytes as randomBytes2, createCipheriv as createCipheriv2, createDecipheriv as createDecipheriv2 } from "node:crypto";
|
|
13292
|
-
import {
|
|
13334
|
+
import {
|
|
13335
|
+
chmodSync as chmodSync2,
|
|
13336
|
+
closeSync as closeSync4,
|
|
13337
|
+
existsSync as existsSync7,
|
|
13338
|
+
fsyncSync as fsyncSync4,
|
|
13339
|
+
mkdirSync as mkdirSync3,
|
|
13340
|
+
openSync as openSync4,
|
|
13341
|
+
readFileSync as readFileSync7,
|
|
13342
|
+
renameSync as renameSync3,
|
|
13343
|
+
unlinkSync as unlinkSync4,
|
|
13344
|
+
writeSync as writeSync3
|
|
13345
|
+
} from "node:fs";
|
|
13293
13346
|
var FORMAT_VERSION = 1;
|
|
13294
13347
|
var SALT_LEN = 16;
|
|
13295
13348
|
var NONCE_LEN = 12;
|
|
@@ -13959,7 +14012,7 @@ import * as path from "node:path";
|
|
|
13959
14012
|
|
|
13960
14013
|
// src/util/audit-hashchain.ts
|
|
13961
14014
|
import { createHash as createHash4 } from "node:crypto";
|
|
13962
|
-
import { openSync as
|
|
14015
|
+
import { openSync as openSync5, readSync, fstatSync as fstatSync2, closeSync as closeSync5 } from "node:fs";
|
|
13963
14016
|
var CHAIN_GENESIS = "GENESIS";
|
|
13964
14017
|
var SEP = "\x00";
|
|
13965
14018
|
function rowHash(prev, seq, rowJsonNoChain) {
|
|
@@ -13980,7 +14033,7 @@ function chainRow(state, entry) {
|
|
|
13980
14033
|
function readTail(path, tailBytes = 64 * 1024) {
|
|
13981
14034
|
let fd;
|
|
13982
14035
|
try {
|
|
13983
|
-
fd =
|
|
14036
|
+
fd = openSync5(path, "r");
|
|
13984
14037
|
} catch {
|
|
13985
14038
|
return null;
|
|
13986
14039
|
}
|
|
@@ -13996,7 +14049,7 @@ function readTail(path, tailBytes = 64 * 1024) {
|
|
|
13996
14049
|
return null;
|
|
13997
14050
|
} finally {
|
|
13998
14051
|
try {
|
|
13999
|
-
|
|
14052
|
+
closeSync5(fd);
|
|
14000
14053
|
} catch {}
|
|
14001
14054
|
}
|
|
14002
14055
|
}
|
|
@@ -14073,6 +14126,45 @@ function safeAuditLogPath(requestedPath) {
|
|
|
14073
14126
|
}
|
|
14074
14127
|
|
|
14075
14128
|
// src/vault/broker/audit-log.ts
|
|
14129
|
+
var DEFAULT_AUDIT_MAX_BYTES = 32 * 1024 * 1024;
|
|
14130
|
+
var DEFAULT_AUDIT_MAX_FILES = 5;
|
|
14131
|
+
function resolveRotation(opts) {
|
|
14132
|
+
const envBytes = Number(process.env.SWITCHROOM_VAULT_AUDIT_MAX_BYTES);
|
|
14133
|
+
const envFiles = Number(process.env.SWITCHROOM_VAULT_AUDIT_MAX_FILES);
|
|
14134
|
+
const maxBytes = opts.maxBytes !== undefined && opts.maxBytes !== 0 ? opts.maxBytes : Number.isFinite(envBytes) && envBytes !== 0 ? envBytes : DEFAULT_AUDIT_MAX_BYTES;
|
|
14135
|
+
const maxFiles = opts.maxFiles !== undefined && opts.maxFiles > 0 ? opts.maxFiles : Number.isFinite(envFiles) && envFiles > 0 ? envFiles : DEFAULT_AUDIT_MAX_FILES;
|
|
14136
|
+
return { maxBytes, maxFiles };
|
|
14137
|
+
}
|
|
14138
|
+
function rotateAuditLog(logPath, maxFiles) {
|
|
14139
|
+
const oldest = `${logPath}.${maxFiles}`;
|
|
14140
|
+
if (fs.existsSync(oldest)) {
|
|
14141
|
+
try {
|
|
14142
|
+
fs.unlinkSync(oldest);
|
|
14143
|
+
} catch (err) {
|
|
14144
|
+
process.stderr.write(`[vault-audit] ERROR: could not drop oldest rotation ${oldest}: ${err.message}
|
|
14145
|
+
`);
|
|
14146
|
+
}
|
|
14147
|
+
}
|
|
14148
|
+
for (let n = maxFiles - 1;n >= 1; n--) {
|
|
14149
|
+
const from = `${logPath}.${n}`;
|
|
14150
|
+
const to = `${logPath}.${n + 1}`;
|
|
14151
|
+
if (!fs.existsSync(from))
|
|
14152
|
+
continue;
|
|
14153
|
+
try {
|
|
14154
|
+
fs.renameSync(from, to);
|
|
14155
|
+
} catch (err) {
|
|
14156
|
+
process.stderr.write(`[vault-audit] ERROR: could not rotate ${from} → ${to}: ${err.message}
|
|
14157
|
+
`);
|
|
14158
|
+
return;
|
|
14159
|
+
}
|
|
14160
|
+
}
|
|
14161
|
+
try {
|
|
14162
|
+
fs.renameSync(logPath, `${logPath}.1`);
|
|
14163
|
+
} catch (err) {
|
|
14164
|
+
process.stderr.write(`[vault-audit] ERROR: could not rotate active audit log ${logPath}: ${err.message}
|
|
14165
|
+
`);
|
|
14166
|
+
}
|
|
14167
|
+
}
|
|
14076
14168
|
function defaultAuditLogPath() {
|
|
14077
14169
|
return path.join(os.homedir(), ".switchroom", "vault-audit.log");
|
|
14078
14170
|
}
|
|
@@ -14085,8 +14177,17 @@ function callerFromPeer(peer) {
|
|
|
14085
14177
|
function createAuditLogger(opts = {}) {
|
|
14086
14178
|
const logPath = safeAuditLogPath(opts.path ?? defaultAuditLogPath());
|
|
14087
14179
|
let chain = seedChain(logPath);
|
|
14180
|
+
const rotation = resolveRotation(opts);
|
|
14088
14181
|
return {
|
|
14089
14182
|
write(entry) {
|
|
14183
|
+
if (rotation.maxBytes > 0) {
|
|
14184
|
+
try {
|
|
14185
|
+
const size = fs.statSync(logPath).size;
|
|
14186
|
+
if (size >= rotation.maxBytes) {
|
|
14187
|
+
rotateAuditLog(logPath, rotation.maxFiles);
|
|
14188
|
+
}
|
|
14189
|
+
} catch {}
|
|
14190
|
+
}
|
|
14090
14191
|
const { line, next } = chainRow(chain, entry);
|
|
14091
14192
|
let fd;
|
|
14092
14193
|
try {
|
|
@@ -14117,7 +14218,7 @@ function createAuditLogger(opts = {}) {
|
|
|
14117
14218
|
// src/vault/grants.ts
|
|
14118
14219
|
import { randomBytes as randomBytes4 } from "node:crypto";
|
|
14119
14220
|
|
|
14120
|
-
// node_modules/bcryptjs/index.js
|
|
14221
|
+
// node_modules/.bun/bcryptjs@3.0.3/node_modules/bcryptjs/index.js
|
|
14121
14222
|
import nodeCrypto from "crypto";
|
|
14122
14223
|
var randomFallback = null;
|
|
14123
14224
|
function randomBytes3(len) {
|
|
@@ -16068,19 +16169,63 @@ var DEFAULT_MAX_TTL_LIFETIME_MS = 7 * 24 * 60 * 60 * 1000;
|
|
|
16068
16169
|
|
|
16069
16170
|
// src/vault/grants-db.ts
|
|
16070
16171
|
var DEFAULT_GRANTS_DB_PATH = path2.join(os2.homedir(), ".switchroom", "vault-grants.db");
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16172
|
+
var WAL_SIDECAR_SUFFIXES = ["-wal", "-shm"];
|
|
16173
|
+
function isGrantsDbCorruption(err) {
|
|
16174
|
+
if (!err || typeof err !== "object")
|
|
16175
|
+
return false;
|
|
16176
|
+
const code = String(err.code ?? "").toUpperCase();
|
|
16177
|
+
if (code === "SQLITE_CORRUPT" || code.startsWith("SQLITE_CORRUPT_")) {
|
|
16178
|
+
return true;
|
|
16179
|
+
}
|
|
16180
|
+
const message = String(err.message ?? "").toLowerCase();
|
|
16181
|
+
return message.includes("database disk image is malformed") || message.includes("database is corrupt");
|
|
16182
|
+
}
|
|
16183
|
+
function quarantineGrantsDb(dbPath) {
|
|
16184
|
+
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
16185
|
+
const quarantinePath = `${dbPath}.corrupt-${stamp}`;
|
|
16186
|
+
fs2.renameSync(dbPath, quarantinePath);
|
|
16187
|
+
for (const suffix of WAL_SIDECAR_SUFFIXES) {
|
|
16188
|
+
const sidecar = `${dbPath}${suffix}`;
|
|
16189
|
+
if (fs2.existsSync(sidecar)) {
|
|
16190
|
+
try {
|
|
16191
|
+
fs2.renameSync(sidecar, `${quarantinePath}${suffix}`);
|
|
16192
|
+
} catch {}
|
|
16193
|
+
}
|
|
16194
|
+
}
|
|
16195
|
+
return quarantinePath;
|
|
16196
|
+
}
|
|
16197
|
+
function openAndMigrate(dbPath) {
|
|
16074
16198
|
const db = new Database(dbPath, { create: true });
|
|
16075
16199
|
try {
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16080
|
-
|
|
16081
|
-
|
|
16200
|
+
try {
|
|
16201
|
+
fs2.chmodSync(dbPath, 384);
|
|
16202
|
+
} catch {}
|
|
16203
|
+
db.run("PRAGMA journal_mode=WAL");
|
|
16204
|
+
db.run("PRAGMA busy_timeout=5000");
|
|
16205
|
+
db.run("PRAGMA foreign_keys=ON");
|
|
16206
|
+
migrateGrantsSchema(db);
|
|
16207
|
+
migrateApprovalSchema(db);
|
|
16208
|
+
} catch (err) {
|
|
16209
|
+
try {
|
|
16210
|
+
db.close();
|
|
16211
|
+
} catch {}
|
|
16212
|
+
throw err;
|
|
16213
|
+
}
|
|
16082
16214
|
return db;
|
|
16083
16215
|
}
|
|
16216
|
+
function openGrantsDb(dbPath = DEFAULT_GRANTS_DB_PATH, opener = openAndMigrate) {
|
|
16217
|
+
const dir = path2.dirname(dbPath);
|
|
16218
|
+
fs2.mkdirSync(dir, { recursive: true });
|
|
16219
|
+
try {
|
|
16220
|
+
return opener(dbPath);
|
|
16221
|
+
} catch (err) {
|
|
16222
|
+
if (!isGrantsDbCorruption(err))
|
|
16223
|
+
throw err;
|
|
16224
|
+
const quarantinePath = quarantineGrantsDb(dbPath);
|
|
16225
|
+
console.error(`[vault-broker] grants DB at ${dbPath} is corrupt (${err.message ?? err}); quarantined to ${quarantinePath} and recreating an empty grants DB. ` + "Existing grants must be re-approved via the vault approval flow.");
|
|
16226
|
+
return opener(dbPath);
|
|
16227
|
+
}
|
|
16228
|
+
}
|
|
16084
16229
|
|
|
16085
16230
|
// src/vault/approvals/kernel.ts
|
|
16086
16231
|
import { randomBytes as randomBytes5, randomUUID } from "node:crypto";
|
|
@@ -16431,9 +16576,9 @@ class VaultBroker {
|
|
|
16431
16576
|
chmodSync4(parentDir, 448);
|
|
16432
16577
|
} catch {}
|
|
16433
16578
|
for (const p of [this.socketPath, this.unlockSocketPath]) {
|
|
16434
|
-
if (
|
|
16579
|
+
if (existsSync10(p)) {
|
|
16435
16580
|
try {
|
|
16436
|
-
|
|
16581
|
+
unlinkSync6(p);
|
|
16437
16582
|
} catch {}
|
|
16438
16583
|
}
|
|
16439
16584
|
}
|
|
@@ -16466,9 +16611,9 @@ class VaultBroker {
|
|
|
16466
16611
|
return;
|
|
16467
16612
|
try {
|
|
16468
16613
|
if (ready) {
|
|
16469
|
-
|
|
16470
|
-
} else if (
|
|
16471
|
-
|
|
16614
|
+
writeFileSync(p, "", { mode: 384 });
|
|
16615
|
+
} else if (existsSync10(p)) {
|
|
16616
|
+
unlinkSync6(p);
|
|
16472
16617
|
}
|
|
16473
16618
|
} catch {}
|
|
16474
16619
|
}
|
|
@@ -16500,24 +16645,24 @@ class VaultBroker {
|
|
|
16500
16645
|
try {
|
|
16501
16646
|
entry.server.close();
|
|
16502
16647
|
} catch {}
|
|
16503
|
-
if (
|
|
16648
|
+
if (existsSync10(sockPath)) {
|
|
16504
16649
|
try {
|
|
16505
|
-
|
|
16650
|
+
unlinkSync6(sockPath);
|
|
16506
16651
|
} catch {}
|
|
16507
16652
|
}
|
|
16508
16653
|
}
|
|
16509
16654
|
this.agentServers.clear();
|
|
16510
16655
|
for (const p of [this.socketPath, this.unlockSocketPath]) {
|
|
16511
|
-
if (p &&
|
|
16656
|
+
if (p && existsSync10(p)) {
|
|
16512
16657
|
try {
|
|
16513
|
-
|
|
16658
|
+
unlinkSync6(p);
|
|
16514
16659
|
} catch {}
|
|
16515
16660
|
}
|
|
16516
16661
|
}
|
|
16517
16662
|
try {
|
|
16518
16663
|
const pidPath = resolvePath(PID_FILE_DEFAULT);
|
|
16519
|
-
if (
|
|
16520
|
-
|
|
16664
|
+
if (existsSync10(pidPath))
|
|
16665
|
+
unlinkSync6(pidPath);
|
|
16521
16666
|
} catch {}
|
|
16522
16667
|
}
|
|
16523
16668
|
getStatus() {
|
|
@@ -16542,7 +16687,7 @@ class VaultBroker {
|
|
|
16542
16687
|
return new Promise((resolveP, rejectP) => {
|
|
16543
16688
|
if (abs.endsWith("/sock")) {
|
|
16544
16689
|
const dir = abs.slice(0, -"/sock".length);
|
|
16545
|
-
if (
|
|
16690
|
+
if (existsSync10(dir)) {
|
|
16546
16691
|
try {
|
|
16547
16692
|
chownSync(dir, 0, 0);
|
|
16548
16693
|
} catch {}
|
|
@@ -16551,9 +16696,9 @@ class VaultBroker {
|
|
|
16551
16696
|
} catch {}
|
|
16552
16697
|
}
|
|
16553
16698
|
}
|
|
16554
|
-
if (
|
|
16699
|
+
if (existsSync10(abs)) {
|
|
16555
16700
|
try {
|
|
16556
|
-
|
|
16701
|
+
unlinkSync6(abs);
|
|
16557
16702
|
} catch (err) {
|
|
16558
16703
|
const msg = err instanceof Error ? err.message : String(err);
|
|
16559
16704
|
process.stderr.write(`[vault-broker] could not unlink stale socket agent=${agentName} sock=${abs}: ${msg}
|
|
@@ -16583,9 +16728,9 @@ class VaultBroker {
|
|
|
16583
16728
|
} catch {}
|
|
16584
16729
|
this.agentServers.set(abs, { server, agentName });
|
|
16585
16730
|
const unlockAbs = unlockSocketFor(abs);
|
|
16586
|
-
if (
|
|
16731
|
+
if (existsSync10(unlockAbs)) {
|
|
16587
16732
|
try {
|
|
16588
|
-
|
|
16733
|
+
unlinkSync6(unlockAbs);
|
|
16589
16734
|
} catch {}
|
|
16590
16735
|
}
|
|
16591
16736
|
const unlockServer = net.createServer((sock) => {
|
|
@@ -16638,7 +16783,7 @@ class VaultBroker {
|
|
|
16638
16783
|
if (!Number.isFinite(uid) || uid <= 0)
|
|
16639
16784
|
return;
|
|
16640
16785
|
try {
|
|
16641
|
-
if (
|
|
16786
|
+
if (existsSync10(this.vaultPath))
|
|
16642
16787
|
chownSync(this.vaultPath, uid, uid);
|
|
16643
16788
|
} catch {}
|
|
16644
16789
|
}
|
|
@@ -16651,7 +16796,7 @@ class VaultBroker {
|
|
|
16651
16796
|
const unlockAbs = unlockSocketFor(abs);
|
|
16652
16797
|
if (abs.endsWith("/sock")) {
|
|
16653
16798
|
const dir = abs.slice(0, -"/sock".length);
|
|
16654
|
-
if (
|
|
16799
|
+
if (existsSync10(dir)) {
|
|
16655
16800
|
try {
|
|
16656
16801
|
chownSync(dir, 0, 0);
|
|
16657
16802
|
} catch {}
|
|
@@ -16661,9 +16806,9 @@ class VaultBroker {
|
|
|
16661
16806
|
}
|
|
16662
16807
|
}
|
|
16663
16808
|
for (const p of [abs, unlockAbs]) {
|
|
16664
|
-
if (
|
|
16809
|
+
if (existsSync10(p)) {
|
|
16665
16810
|
try {
|
|
16666
|
-
|
|
16811
|
+
unlinkSync6(p);
|
|
16667
16812
|
} catch {}
|
|
16668
16813
|
}
|
|
16669
16814
|
}
|
|
@@ -17524,8 +17669,8 @@ class VaultBroker {
|
|
|
17524
17669
|
mkdirSync5(tokenDir, { recursive: true });
|
|
17525
17670
|
const tokenPath = path3.join(tokenDir, ".vault-token");
|
|
17526
17671
|
const tmpPath = `${tokenPath}.tmp.${process.pid}`;
|
|
17527
|
-
|
|
17528
|
-
|
|
17672
|
+
writeFileSync(tmpPath, mintResult.token, { mode: 384 });
|
|
17673
|
+
renameSync6(tmpPath, tokenPath);
|
|
17529
17674
|
try {
|
|
17530
17675
|
const uid = allocateAgentUid(agent);
|
|
17531
17676
|
chownSync(tokenPath, uid, uid);
|
|
@@ -17585,9 +17730,9 @@ class VaultBroker {
|
|
|
17585
17730
|
const row = this.grantsDb.query("SELECT agent_slug FROM vault_grants WHERE id = ?").get(id);
|
|
17586
17731
|
if (row && AgentNameSchema.safeParse(row.agent_slug).success) {
|
|
17587
17732
|
const tokenPath = path3.join(os3.homedir(), ".switchroom", "agents", row.agent_slug, ".vault-token");
|
|
17588
|
-
if (
|
|
17733
|
+
if (existsSync10(tokenPath)) {
|
|
17589
17734
|
try {
|
|
17590
|
-
|
|
17735
|
+
unlinkSync6(tokenPath);
|
|
17591
17736
|
} catch {}
|
|
17592
17737
|
}
|
|
17593
17738
|
}
|
|
@@ -17810,7 +17955,7 @@ class VaultBroker {
|
|
|
17810
17955
|
_writePidFile() {
|
|
17811
17956
|
try {
|
|
17812
17957
|
const pidPath = resolvePath(PID_FILE_DEFAULT);
|
|
17813
|
-
|
|
17958
|
+
writeFileSync(pidPath, String(process.pid) + `
|
|
17814
17959
|
`, { mode: 384 });
|
|
17815
17960
|
} catch {}
|
|
17816
17961
|
}
|
|
@@ -17823,10 +17968,10 @@ class VaultBroker {
|
|
|
17823
17968
|
const envPath = process.env.SWITCHROOM_VAULT_BROKER_AUTO_UNLOCK_PATH;
|
|
17824
17969
|
const configuredPath = (envPath && envPath.length > 0 ? envPath : undefined) ?? this.config?.vault?.broker?.autoUnlockCredentialPath ?? DEFAULT_AUTO_UNLOCK_PATH;
|
|
17825
17970
|
const filePath = resolvePath(configuredPath);
|
|
17826
|
-
if (!
|
|
17971
|
+
if (!existsSync10(filePath))
|
|
17827
17972
|
return false;
|
|
17828
17973
|
try {
|
|
17829
|
-
if (
|
|
17974
|
+
if (statSync5(filePath).size === 0)
|
|
17830
17975
|
return false;
|
|
17831
17976
|
} catch {
|
|
17832
17977
|
return false;
|
|
@@ -17938,7 +18083,7 @@ async function main() {
|
|
|
17938
18083
|
const vaultPath = process.env.SWITCHROOM_VAULT_PATH;
|
|
17939
18084
|
let perAgentTargets = [];
|
|
17940
18085
|
try {
|
|
17941
|
-
if (
|
|
18086
|
+
if (existsSync10(perAgentDir)) {
|
|
17942
18087
|
const entries = readdirSync3(perAgentDir, { withFileTypes: true });
|
|
17943
18088
|
const flat = [];
|
|
17944
18089
|
const subdirs = [];
|
|
@@ -17993,7 +18138,7 @@ async function main() {
|
|
|
17993
18138
|
}
|
|
17994
18139
|
const operatorUidStr = process.env.SWITCHROOM_BROKER_OPERATOR_UID;
|
|
17995
18140
|
const operatorDir = "/run/switchroom/broker/operator";
|
|
17996
|
-
if (operatorUidStr !== undefined &&
|
|
18141
|
+
if (operatorUidStr !== undefined && existsSync10(operatorDir)) {
|
|
17997
18142
|
const operatorUid = parseInt(operatorUidStr, 10);
|
|
17998
18143
|
if (!Number.isFinite(operatorUid) || operatorUid <= 0) {
|
|
17999
18144
|
process.stderr.write(`[vault-broker] SWITCHROOM_BROKER_OPERATOR_UID='${operatorUidStr}' is not a positive integer; skipping operator listener
|