switchroom 0.15.37 → 0.15.39
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 +89 -89
- package/dist/auth-broker/index.js +89 -89
- package/dist/cli/autoaccept-poll.js +13 -7
- package/dist/cli/drive-write-pretool.mjs +10 -10
- package/dist/cli/notion-write-pretool.mjs +91 -91
- package/dist/cli/skill-validate-pretool.mjs +72 -72
- package/dist/cli/switchroom.js +857 -572
- package/dist/cli/ui/index.html +87 -17
- package/dist/host-control/main.js +158 -158
- package/dist/vault/approvals/kernel-server.js +91 -91
- package/dist/vault/broker/server.js +92 -92
- package/package.json +1 -1
- package/profiles/_base/cron-session.sh.hbs +1 -1
- package/profiles/_base/start.sh.hbs +1 -1
- package/profiles/default/CLAUDE.md.hbs +2 -0
- package/skills/switchroom-manage/SKILL.md +1 -1
- package/skills/switchroom-runtime/SKILL.md +1 -1
- package/telegram-plugin/answer-stream.ts +1 -1
- package/telegram-plugin/bridge/bridge.ts +18 -1
- package/telegram-plugin/bridge/ipc-client.ts +4 -1
- package/telegram-plugin/bridge/tool-filter.ts +77 -0
- package/telegram-plugin/chat-lock.ts +1 -1
- package/telegram-plugin/credits-watch.ts +1 -1
- package/telegram-plugin/dist/bridge/bridge.js +141 -115
- package/telegram-plugin/dist/gateway/gateway.js +318 -207
- package/telegram-plugin/dist/server.js +193 -164
- package/telegram-plugin/gateway/auto-classify-mid-turn.ts +1 -1
- package/telegram-plugin/gateway/boot-card.ts +5 -1
- package/telegram-plugin/gateway/boot-probes.ts +62 -0
- package/telegram-plugin/gateway/cron-session.ts +1 -1
- package/telegram-plugin/gateway/gateway.ts +133 -12
- package/telegram-plugin/gateway/grant-restart.ts +1 -1
- package/telegram-plugin/gateway/inbound-delivery-machine-dispatch.ts +1 -1
- package/telegram-plugin/gateway/inbound-delivery-machine-shadow.ts +1 -1
- package/telegram-plugin/gateway/inbound-delivery-machine.ts +1 -1
- package/telegram-plugin/gateway/interrupt-defer.ts +1 -1
- package/telegram-plugin/gateway/ipc-protocol.ts +12 -0
- package/telegram-plugin/gateway/permission-card-origin.ts +62 -0
- package/telegram-plugin/gateway/permission-timeout.ts +70 -0
- package/telegram-plugin/gateway/prefix-warmup.ts +1 -1
- package/telegram-plugin/gateway/webhook-ingest-server.test.ts +1 -1
- package/telegram-plugin/gateway/webhook-ingest-server.ts +1 -1
- package/telegram-plugin/hooks/subagent-tracker-pretool.mjs +1 -1
- package/telegram-plugin/interrupt-marker.ts +1 -1
- package/telegram-plugin/over-ping-safety-net.ts +1 -1
- package/telegram-plugin/scoped-approval.ts +1 -1
- package/telegram-plugin/secret-detect/vault-error.ts +1 -1
- package/telegram-plugin/silence-poke.ts +2 -2
- package/telegram-plugin/silent-reply-anchor.ts +1 -1
- package/telegram-plugin/slot-banner-driver.ts +1 -1
- package/telegram-plugin/startup-reset.ts +1 -1
- package/telegram-plugin/tests/boot-probes-connections.test.ts +66 -0
- package/telegram-plugin/tests/gateway-startup-reset.test.ts +1 -1
- package/telegram-plugin/tests/inbound-delivery-machine.test.ts +1 -1
- package/telegram-plugin/tests/permission-card-origin.test.ts +97 -0
- package/telegram-plugin/tests/permission-card-routing.test.ts +23 -0
- package/telegram-plugin/tests/permission-no-repeat-wiring.test.ts +76 -0
- package/telegram-plugin/tests/permission-timeout.test.ts +87 -0
- package/telegram-plugin/tests/scoped-approval.test.ts +1 -1
- package/telegram-plugin/tests/silence-poke.test.ts +1 -1
- package/telegram-plugin/tests/tool-filter.test.ts +87 -0
- package/telegram-plugin/tests/turn-flush-safety.test.ts +1 -1
- package/telegram-plugin/turn-flush-safety.ts +1 -1
- package/telegram-plugin/uat/assertions.ts +1 -1
- package/telegram-plugin/uat/scenarios/bg-sub-agent-dispatch-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/fuzz-extended-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-fast-ack-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-fast-trivial-dm.test.ts +2 -2
- package/telegram-plugin/uat/scenarios/jtbd-forwarded-burst-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-memory-survives-restart-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-rapid-followup-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-reflective-status-reaction-dm.test.ts +1 -1
- package/telegram-plugin/uat/scenarios/jtbd-wake-audit-content-dm.test.ts +1 -1
|
@@ -40,7 +40,8 @@ var PROMPTS = [
|
|
|
40
40
|
keys: ["Enter"]
|
|
41
41
|
}
|
|
42
42
|
];
|
|
43
|
-
var
|
|
43
|
+
var REPL_READY_SIGNATURE = /\u2190 for agents|accept edits on|\? for shortcuts|esc to interrupt/;
|
|
44
|
+
var DEFAULT_BOOT_HARD_CAP_MS = 600000;
|
|
44
45
|
var DEFAULT_POLL_MS = 250;
|
|
45
46
|
function defaultSleep(ms) {
|
|
46
47
|
return new Promise((r) => setTimeout(r, ms));
|
|
@@ -70,8 +71,9 @@ function sendKeys(agentName, keys) {
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
async function runAutoaccept(opts) {
|
|
73
|
-
const
|
|
74
|
+
const bootHardCapMs = opts.bootHardCapMs ?? DEFAULT_BOOT_HARD_CAP_MS;
|
|
74
75
|
const pollIntervalMs = opts.pollIntervalMs ?? DEFAULT_POLL_MS;
|
|
76
|
+
const replReady = opts.replReadyMatch ?? REPL_READY_SIGNATURE;
|
|
75
77
|
const rules = (opts.prompts ?? PROMPTS).map((r) => ({
|
|
76
78
|
rule: r,
|
|
77
79
|
fired: 0,
|
|
@@ -81,10 +83,11 @@ async function runAutoaccept(opts) {
|
|
|
81
83
|
const now = opts.now ?? Date.now;
|
|
82
84
|
const sleep = opts.sleep ?? defaultSleep;
|
|
83
85
|
const maxPolls = opts.maxPolls ?? Number.POSITIVE_INFINITY;
|
|
84
|
-
|
|
86
|
+
const startTime = now();
|
|
85
87
|
let polls = 0;
|
|
86
88
|
while (polls < maxPolls) {
|
|
87
89
|
polls++;
|
|
90
|
+
const t = now();
|
|
88
91
|
const text = capturePane(opts.agentName);
|
|
89
92
|
let matchedThisPoll = false;
|
|
90
93
|
if (text) {
|
|
@@ -100,10 +103,13 @@ async function runAutoaccept(opts) {
|
|
|
100
103
|
}
|
|
101
104
|
}
|
|
102
105
|
}
|
|
103
|
-
if (matchedThisPoll) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
106
|
+
if (!matchedThisPoll) {
|
|
107
|
+
if (text && replReady.test(text)) {
|
|
108
|
+
return { fired, reason: "repl-ready" };
|
|
109
|
+
}
|
|
110
|
+
if (t - startTime >= bootHardCapMs) {
|
|
111
|
+
return { fired, reason: "idle-timeout" };
|
|
112
|
+
}
|
|
107
113
|
}
|
|
108
114
|
await sleep(pollIntervalMs);
|
|
109
115
|
}
|
|
@@ -14,7 +14,7 @@ var __export = (target, all) => {
|
|
|
14
14
|
};
|
|
15
15
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/util.js
|
|
18
18
|
var util, objectUtil, ZodParsedType, getParsedType = (data) => {
|
|
19
19
|
const t = typeof data;
|
|
20
20
|
switch (t) {
|
|
@@ -145,7 +145,7 @@ var init_util = __esm(() => {
|
|
|
145
145
|
]);
|
|
146
146
|
});
|
|
147
147
|
|
|
148
|
-
//
|
|
148
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/ZodError.js
|
|
149
149
|
var ZodIssueCode, quotelessJson = (obj) => {
|
|
150
150
|
const json = JSON.stringify(obj, null, 2);
|
|
151
151
|
return json.replace(/"([^"]+)":/g, "$1:");
|
|
@@ -266,7 +266,7 @@ var init_ZodError = __esm(() => {
|
|
|
266
266
|
};
|
|
267
267
|
});
|
|
268
268
|
|
|
269
|
-
//
|
|
269
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/locales/en.js
|
|
270
270
|
var errorMap = (issue, _ctx) => {
|
|
271
271
|
let message;
|
|
272
272
|
switch (issue.code) {
|
|
@@ -373,7 +373,7 @@ var init_en = __esm(() => {
|
|
|
373
373
|
en_default = errorMap;
|
|
374
374
|
});
|
|
375
375
|
|
|
376
|
-
//
|
|
376
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/errors.js
|
|
377
377
|
function setErrorMap(map) {
|
|
378
378
|
overrideErrorMap = map;
|
|
379
379
|
}
|
|
@@ -386,7 +386,7 @@ var init_errors = __esm(() => {
|
|
|
386
386
|
overrideErrorMap = en_default;
|
|
387
387
|
});
|
|
388
388
|
|
|
389
|
-
//
|
|
389
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js
|
|
390
390
|
function addIssueToContext(ctx, issueData) {
|
|
391
391
|
const overrideMap = getErrorMap();
|
|
392
392
|
const issue = makeIssue({
|
|
@@ -491,10 +491,10 @@ var init_parseUtil = __esm(() => {
|
|
|
491
491
|
});
|
|
492
492
|
});
|
|
493
493
|
|
|
494
|
-
//
|
|
494
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js
|
|
495
495
|
var init_typeAliases = () => {};
|
|
496
496
|
|
|
497
|
-
//
|
|
497
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js
|
|
498
498
|
var errorUtil;
|
|
499
499
|
var init_errorUtil = __esm(() => {
|
|
500
500
|
(function(errorUtil2) {
|
|
@@ -503,7 +503,7 @@ var init_errorUtil = __esm(() => {
|
|
|
503
503
|
})(errorUtil || (errorUtil = {}));
|
|
504
504
|
});
|
|
505
505
|
|
|
506
|
-
//
|
|
506
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/types.js
|
|
507
507
|
class ParseInputLazyPath {
|
|
508
508
|
constructor(parent, value, path, key) {
|
|
509
509
|
this._cachedPath = [];
|
|
@@ -3854,7 +3854,7 @@ var init_types = __esm(() => {
|
|
|
3854
3854
|
NEVER = INVALID;
|
|
3855
3855
|
});
|
|
3856
3856
|
|
|
3857
|
-
//
|
|
3857
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/v3/external.js
|
|
3858
3858
|
var exports_external = {};
|
|
3859
3859
|
__export(exports_external, {
|
|
3860
3860
|
void: () => voidType,
|
|
@@ -3974,7 +3974,7 @@ var init_external = __esm(() => {
|
|
|
3974
3974
|
init_ZodError();
|
|
3975
3975
|
});
|
|
3976
3976
|
|
|
3977
|
-
//
|
|
3977
|
+
// node_modules/.bun/zod@3.25.76/node_modules/zod/index.js
|
|
3978
3978
|
var init_zod = __esm(() => {
|
|
3979
3979
|
init_external();
|
|
3980
3980
|
init_external();
|