switchroom 0.19.19 → 0.19.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-broker/index.js +53 -0
- package/dist/cli/switchroom.js +2444 -1264
- package/dist/host-control/main.js +54 -1
- package/dist/vault/approvals/kernel-server.js +53 -0
- package/dist/vault/broker/server.js +53 -0
- package/package.json +4 -2
- package/skills/switchroom-release/SKILL.md +103 -20
- package/telegram-plugin/card-format.ts +92 -3
- package/telegram-plugin/dist/gateway/gateway.js +769 -172
- package/telegram-plugin/edit-flood-fuse.ts +477 -0
- package/telegram-plugin/format.ts +19 -7
- package/telegram-plugin/gateway/boot-sweep-gate.ts +164 -0
- package/telegram-plugin/gateway/callback-query-handlers.ts +454 -81
- package/telegram-plugin/gateway/gateway.ts +66 -56
- package/telegram-plugin/gateway/inbound-interceptors.ts +27 -4
- package/telegram-plugin/gateway/narrative-lane.ts +49 -3
- package/telegram-plugin/gateway/status-pin-api.ts +145 -0
- package/telegram-plugin/hooks/subagent-tracker-posttool.mjs +325 -45
- package/telegram-plugin/retry-api-call.ts +15 -2
- package/telegram-plugin/send-gate.ts +1 -1
- package/telegram-plugin/status-no-truncate.ts +64 -1
- package/telegram-plugin/status-pin-driver.ts +50 -27
- package/telegram-plugin/status-pin.ts +43 -5
- package/telegram-plugin/tests/activity-card-send-gate.test.ts +275 -0
- package/telegram-plugin/tests/activity-card-wiring.test.ts +16 -7
- package/telegram-plugin/tests/boot-pin-sweep-wiring.test.ts +101 -0
- package/telegram-plugin/tests/boot-sweep-gate.test.ts +293 -0
- package/telegram-plugin/tests/boot-version-string.test.ts +0 -0
- package/telegram-plugin/tests/edit-flood-fuse.test.ts +431 -0
- package/telegram-plugin/tests/pinned-card-collapse.test.ts +356 -0
- package/telegram-plugin/tests/status-pin-api.test.ts +178 -0
- package/telegram-plugin/tests/status-pin-boot-recovery.test.ts +94 -11
- package/telegram-plugin/tests/status-pin.test.ts +106 -5
- package/telegram-plugin/tests/subagent-tracker-hooks.test.ts +631 -1
- package/telegram-plugin/tests/tool-activity-summary.test.ts +19 -10
- package/telegram-plugin/tests/vault-approval-posture.test.ts +6 -1
- package/telegram-plugin/tests/vault-passphrase-retry.test.ts +666 -0
- package/telegram-plugin/tests/vault-request-access-unlock-resume.test.ts +42 -21
- package/telegram-plugin/tests/worker-feed-coalesce.test.ts +233 -1
- package/telegram-plugin/tool-activity-summary.ts +85 -13
- package/telegram-plugin/worker-activity-feed.ts +5 -1
- package/vendor/hindsight-memory/scripts/drain_pending.py +193 -25
- package/vendor/hindsight-memory/scripts/lib/pending.py +84 -5
- package/vendor/hindsight-memory/scripts/lib/retain_split.py +21 -10
- package/vendor/hindsight-memory/scripts/recall.py +74 -5
- package/vendor/hindsight-memory/scripts/tests/test_pending_drops.py +158 -4
- package/vendor/hindsight-memory/scripts/tests/test_pending_failure_class.py +105 -0
- package/vendor/hindsight-memory/scripts/tests/test_pending_wedge.py +300 -0
- package/vendor/hindsight-memory/scripts/tests/test_recall_degraded_notice.py +365 -0
- package/vendor/hindsight-memory/scripts/tests/test_recall_envelope_strip_telemetry.py +12 -4
- package/vendor/hindsight-memory/scripts/tests/test_recall_transcript_fallback.py +27 -2
- package/vendor/hindsight-memory/scripts/tests/test_retain_split.py +19 -11
- package/vendor/hindsight-memory/tests/test_drain_pending.py +28 -2
|
@@ -18352,6 +18352,47 @@ for (const name of SHARED_FRAGMENTS) {
|
|
|
18352
18352
|
}
|
|
18353
18353
|
}
|
|
18354
18354
|
|
|
18355
|
+
// src/litellm/timeout-budget.ts
|
|
18356
|
+
var LITELLM_ROUTER_MARGIN_S = 10;
|
|
18357
|
+
var LITELLM_TIMEOUT_TIERS = {
|
|
18358
|
+
interactive: {
|
|
18359
|
+
group: "gpt-oss-20b",
|
|
18360
|
+
localTimeoutS: 90,
|
|
18361
|
+
fallbackGroup: "gpt-oss-20b-openrouter",
|
|
18362
|
+
fallbackTimeoutS: 60
|
|
18363
|
+
},
|
|
18364
|
+
retain: {
|
|
18365
|
+
group: "gpt-oss-20b-retain",
|
|
18366
|
+
localTimeoutS: 200,
|
|
18367
|
+
fallbackGroup: "gpt-oss-20b-retain-openrouter",
|
|
18368
|
+
fallbackTimeoutS: 90
|
|
18369
|
+
},
|
|
18370
|
+
consolidation: {
|
|
18371
|
+
group: "gpt-oss-20b-consolidation",
|
|
18372
|
+
localTimeoutS: 200,
|
|
18373
|
+
fallbackGroup: "gpt-oss-20b-consolidation-openrouter",
|
|
18374
|
+
fallbackTimeoutS: 90
|
|
18375
|
+
}
|
|
18376
|
+
};
|
|
18377
|
+
function litellmChainSeconds(tier) {
|
|
18378
|
+
assertPositive(tier.localTimeoutS, `${tier.group} localTimeoutS`);
|
|
18379
|
+
if (tier.fallbackGroup === null)
|
|
18380
|
+
return tier.localTimeoutS;
|
|
18381
|
+
assertPositive(tier.fallbackTimeoutS, `${tier.fallbackGroup} fallbackTimeoutS`);
|
|
18382
|
+
return tier.localTimeoutS + tier.fallbackTimeoutS;
|
|
18383
|
+
}
|
|
18384
|
+
function minimumClientBudgetSeconds(tier, marginS = LITELLM_ROUTER_MARGIN_S) {
|
|
18385
|
+
return litellmChainSeconds(tier) + marginS;
|
|
18386
|
+
}
|
|
18387
|
+
function clientBudgetSeconds(tier, floorS = 0, marginS = LITELLM_ROUTER_MARGIN_S) {
|
|
18388
|
+
return Math.max(Math.ceil(floorS), minimumClientBudgetSeconds(tier, marginS));
|
|
18389
|
+
}
|
|
18390
|
+
function assertPositive(value, label) {
|
|
18391
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
18392
|
+
throw new Error(`litellm timeout budget: ${label} must be a positive number, got ${value}`);
|
|
18393
|
+
}
|
|
18394
|
+
}
|
|
18395
|
+
|
|
18355
18396
|
// src/setup/hindsight.ts
|
|
18356
18397
|
var HINDSIGHT_DEFAULT_API_PORT = 18888;
|
|
18357
18398
|
var HINDSIGHT_DEFAULT_MCP_URL = `http://127.0.0.1:${HINDSIGHT_DEFAULT_API_PORT}/mcp/`;
|
|
@@ -18361,6 +18402,18 @@ var HINDSIGHT_IMAGE_REPO = "ghcr.io/switchroom/switchroom-hindsight";
|
|
|
18361
18402
|
var HINDSIGHT_IMAGE = `${HINDSIGHT_IMAGE_REPO}:latest`;
|
|
18362
18403
|
var HINDSIGHT_BROKER_SOCK_VOLUME = `auth-broker-${HINDSIGHT_CONSUMER_NAME}-sock`;
|
|
18363
18404
|
var HINDSIGHT_CREDS_MIRROR_VOLUME = `consumer-creds-${HINDSIGHT_CONSUMER_NAME}`;
|
|
18405
|
+
var HINDSIGHT_DEFAULT_RETAIN_MAX_COMPLETION_TOKENS = 16384;
|
|
18406
|
+
var HINDSIGHT_RETAIN_MIN_TOKENS_PER_SECOND = 80.6;
|
|
18407
|
+
function hindsightRetainLlmTimeoutSeconds(maxCompletionTokens = HINDSIGHT_DEFAULT_RETAIN_MAX_COMPLETION_TOKENS, tokensPerSecond = HINDSIGHT_RETAIN_MIN_TOKENS_PER_SECOND) {
|
|
18408
|
+
if (!(maxCompletionTokens > 0) || !(tokensPerSecond > 0)) {
|
|
18409
|
+
throw new Error(`hindsight retain budget: maxCompletionTokens (${maxCompletionTokens}) and ` + `tokensPerSecond (${tokensPerSecond}) must both be positive`);
|
|
18410
|
+
}
|
|
18411
|
+
return Math.ceil(maxCompletionTokens / tokensPerSecond);
|
|
18412
|
+
}
|
|
18413
|
+
function hindsightRetainClientTimeoutSeconds() {
|
|
18414
|
+
return clientBudgetSeconds(LITELLM_TIMEOUT_TIERS.retain, hindsightRetainLlmTimeoutSeconds());
|
|
18415
|
+
}
|
|
18416
|
+
var HINDSIGHT_RETAIN_CLIENT_DEADLINE_S = hindsightRetainClientTimeoutSeconds() + LITELLM_ROUTER_MARGIN_S;
|
|
18364
18417
|
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)';
|
|
18365
18418
|
var HINDSIGHT_HEALTHCHECK_CMD = `python3 -c '${HINDSIGHT_HEALTHCHECK_PY}'`;
|
|
18366
18419
|
var DOCKER_PROBE_TIMEOUT_MS = 60 * 1000;
|