switchroom 0.18.3 → 0.18.6
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 +2 -1
- package/dist/auth-broker/index.js +2 -1
- package/dist/cli/notion-write-pretool.mjs +2 -1
- package/dist/cli/switchroom.js +119 -74
- package/dist/host-control/main.js +3 -2
- package/dist/vault/approvals/kernel-server.js +2 -1
- package/dist/vault/broker/server.js +37 -8
- package/package.json +1 -1
- package/skills/switchroom-release/SKILL.md +78 -0
- package/telegram-plugin/auth-snapshot-format.ts +15 -1
- package/telegram-plugin/dist/gateway/gateway.js +922 -459
- package/telegram-plugin/gateway/gateway.ts +260 -21
- package/telegram-plugin/gateway/resolve-person.ts +304 -0
- package/telegram-plugin/gateway/unhandled-rejection-policy.ts +21 -1
- package/telegram-plugin/hooks/silent-end-scan.mjs +164 -40
- package/telegram-plugin/operator-events.ts +21 -0
- package/telegram-plugin/pending-work-progress.ts +42 -7
- package/telegram-plugin/quota-bar-format.ts +360 -0
- package/telegram-plugin/subagent-watcher.ts +27 -9
- package/telegram-plugin/tests/auth-snapshot-format.test.ts +21 -0
- package/telegram-plugin/tests/gateway-boot-marker-clear.test.ts +3 -3
- package/telegram-plugin/tests/operator-events.test.ts +16 -0
- package/telegram-plugin/tests/pending-work-progress.test.ts +116 -3
- package/telegram-plugin/tests/quota-bar-format.test.ts +444 -0
- package/telegram-plugin/tests/resolve-person.test.ts +290 -0
- package/telegram-plugin/tests/silent-end-interrupt-stop-integration.test.ts +53 -0
- package/telegram-plugin/tests/silent-end-interrupt-stop-scan.test.ts +138 -0
- package/telegram-plugin/tests/subagent-watcher.test.ts +61 -0
- package/telegram-plugin/tests/unhandled-rejection-policy.test.ts +19 -0
- package/telegram-plugin/tests/worker-activity-feed.test.ts +97 -0
- package/telegram-plugin/worker-activity-feed.ts +220 -15
- package/profiles/default/CLAUDE.md +0 -116
- package/telegram-plugin/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +0 -1
- package/vendor/hindsight-memory/scripts/__pycache__/directive_verify.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/__pycache__/drain_pending.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/__pycache__/recall.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/__pycache__/retain.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/__pycache__/session_end.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/__init__.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/bank.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/client.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/config.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/content.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/daemon.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/directives.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/gateway_ipc.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/llm.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/pending.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/state.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/lib/__pycache__/switchroom_envelope.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/__init__.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_config_client_casts.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_config_client_casts.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_directive_capture_nudge.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_directive_capture_nudge.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_directive_verify.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_directive_verify.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_directives.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_directives.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_gateway_ipc.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_gateway_ipc.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_context_slice.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_context_slice.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_integration.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_integration.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_tag_filters.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_tag_filters.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_topic_filter.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_topic_filter.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_trivial_skip.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_recall_trivial_skip.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_retain_window.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_retain_window.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_sender_routing.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_sender_routing.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/scripts/tests/__pycache__/test_switchroom_envelope.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/conftest.cpython-313-pytest-9.0.3.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/conftest.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_bank.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_bank.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_client.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_client.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_config.cpython-313-pytest-9.0.3.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_config.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_config.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_content.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_content.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_drain_pending.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_drain_pending.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_hooks.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_hooks.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_manifest.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_manifest.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_pending.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_pending.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_recall_exit_codes.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_recall_exit_codes.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_session_end_pending.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_session_end_pending.cpython-313.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_state.cpython-313-pytest-9.1.1.pyc +0 -0
- package/vendor/hindsight-memory/tests/__pycache__/test_state.cpython-313.pyc +0 -0
package/dist/cli/switchroom.js
CHANGED
|
@@ -14205,7 +14205,8 @@ var init_schema = __esm(() => {
|
|
|
14205
14205
|
UserSchema = exports_external.object({
|
|
14206
14206
|
name: exports_external.string().optional().describe("Display name for the user."),
|
|
14207
14207
|
telegram_ids: exports_external.array(exports_external.string()).min(1).describe("Telegram username(s) and/or numeric user id(s) identifying this user " + "(a leading @ is optional). Matched against the message sender for " + "per-speaker memory routing."),
|
|
14208
|
-
profile_bank: exports_external.string().describe("Hindsight bank holding this user's memory profile (author via " + "`switchroom memory profile add <bank> ...`).")
|
|
14208
|
+
profile_bank: exports_external.string().describe("Hindsight bank holding this user's memory profile (author via " + "`switchroom memory profile add <bank> ...`)."),
|
|
14209
|
+
person_id: exports_external.string().optional().describe("Free-text display name projected into the inbound `<channel>` " + 'tag\'s `user` attribute (e.g. "Lisa") so an agent can greet by ' + "name instead of only seeing the raw Telegram id/username. NOT a " + "stable identity system \u2014 just a label. Resolution is boot-time-only " + "(no hot-reload; a config change needs an agent restart) and " + "chat-scoped (a resolved name is only shown in a chat/group the " + "person is actually a member of, per that chat's access.json " + "membership \u2014 never broadcast into every chat the agent operates " + "in). Keep this broadly safe to show, the same discipline as " + "picking a `profile_bank` name: there is no automated enforcement " + "that a `person_id` stays safe if a group's membership changes " + "later \u2014 see docs/configuration.md.")
|
|
14209
14210
|
});
|
|
14210
14211
|
SwitchroomConfigSchema = exports_external.object({
|
|
14211
14212
|
switchroom: exports_external.object({
|
|
@@ -15177,6 +15178,16 @@ function resolveUsers(config, agentName) {
|
|
|
15177
15178
|
]);
|
|
15178
15179
|
return { senderBanks, additionalBanks };
|
|
15179
15180
|
}
|
|
15181
|
+
function resolvePersonEntries(config) {
|
|
15182
|
+
const users = config.users ?? {};
|
|
15183
|
+
const entries = [];
|
|
15184
|
+
for (const [key, u] of Object.entries(users)) {
|
|
15185
|
+
if (!u.person_id)
|
|
15186
|
+
continue;
|
|
15187
|
+
entries.push({ key, person_id: u.person_id, telegram_ids: u.telegram_ids });
|
|
15188
|
+
}
|
|
15189
|
+
return entries;
|
|
15190
|
+
}
|
|
15180
15191
|
var init_users = __esm(() => {
|
|
15181
15192
|
init_merge();
|
|
15182
15193
|
});
|
|
@@ -27360,6 +27371,7 @@ This file is auto-maintained. Do not edit manually.
|
|
|
27360
27371
|
}, created, skipped, 384);
|
|
27361
27372
|
writeIfMissing(join10(agentDir, "telegram", "access.json"), () => buildAccessJson2(agentConfig, telegramConfig, topicId, userId), created, skipped, 384);
|
|
27362
27373
|
reconcileConfiguredGroup(join10(agentDir, "telegram", "access.json"), agentConfig, telegramConfig);
|
|
27374
|
+
writeFileSyncIfChanged(join10(agentDir, "telegram", "people.json"), buildPeopleJson(switchroomConfig), 384);
|
|
27363
27375
|
if (agentConfig.subagents) {
|
|
27364
27376
|
const agentsDir2 = join10(agentDir, ".claude", "agents");
|
|
27365
27377
|
mkdirSync10(agentsDir2, { recursive: true });
|
|
@@ -28582,6 +28594,11 @@ function reconcileConfiguredGroup(accessPath, agentConfig, telegramConfig) {
|
|
|
28582
28594
|
renameSync4(tmp, accessPath);
|
|
28583
28595
|
console.log(source_default.green(` registered supergroup ${forumChatId} in access.json ` + `(responds to all topics; requireMention=false)`));
|
|
28584
28596
|
}
|
|
28597
|
+
function buildPeopleJson(switchroomConfig) {
|
|
28598
|
+
const entries = switchroomConfig ? resolvePersonEntries(switchroomConfig) : [];
|
|
28599
|
+
return JSON.stringify({ entries }, null, 2) + `
|
|
28600
|
+
`;
|
|
28601
|
+
}
|
|
28585
28602
|
function buildAccessJson2(agentConfig, telegramConfig, resolvedTopicId, userId) {
|
|
28586
28603
|
const allowFrom = userId ? [String(userId)] : [];
|
|
28587
28604
|
if (allowFrom.length === 0) {
|
|
@@ -35505,7 +35522,7 @@ function formatForCli(entries, opts = {}) {
|
|
|
35505
35522
|
var init_audit_reader = () => {};
|
|
35506
35523
|
|
|
35507
35524
|
// node_modules/.bun/posthog-node@5.29.2/node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
35508
|
-
import { dirname as
|
|
35525
|
+
import { dirname as dirname13, posix, sep as sep2 } from "path";
|
|
35509
35526
|
function createModulerModifier() {
|
|
35510
35527
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
35511
35528
|
return async (frames) => {
|
|
@@ -35514,7 +35531,7 @@ function createModulerModifier() {
|
|
|
35514
35531
|
return frames;
|
|
35515
35532
|
};
|
|
35516
35533
|
}
|
|
35517
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
35534
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname13(process.argv[1]) : process.cwd(), isWindows = sep2 === "\\") {
|
|
35518
35535
|
const normalizedBase = isWindows ? normalizeWindowsPath(basePath) : basePath;
|
|
35519
35536
|
return (filename) => {
|
|
35520
35537
|
if (!filename)
|
|
@@ -40130,7 +40147,7 @@ import {
|
|
|
40130
40147
|
readFileSync as readFileSync43,
|
|
40131
40148
|
writeFileSync as writeFileSync23
|
|
40132
40149
|
} from "node:fs";
|
|
40133
|
-
import { dirname as
|
|
40150
|
+
import { dirname as dirname14 } from "node:path";
|
|
40134
40151
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
40135
40152
|
function telemetryDisabled() {
|
|
40136
40153
|
const v = process.env.SWITCHROOM_TELEMETRY_DISABLED;
|
|
@@ -40152,7 +40169,7 @@ function getDistinctId() {
|
|
|
40152
40169
|
const id = randomUUID3();
|
|
40153
40170
|
cachedDistinctId = id;
|
|
40154
40171
|
try {
|
|
40155
|
-
mkdirSync26(
|
|
40172
|
+
mkdirSync26(dirname14(path4), { recursive: true });
|
|
40156
40173
|
writeFileSync23(path4, id, "utf-8");
|
|
40157
40174
|
} catch {}
|
|
40158
40175
|
return id;
|
|
@@ -40399,7 +40416,7 @@ import {
|
|
|
40399
40416
|
readFileSync as readFileSync52,
|
|
40400
40417
|
readdirSync as readdirSync19
|
|
40401
40418
|
} from "node:fs";
|
|
40402
|
-
import { dirname as
|
|
40419
|
+
import { dirname as dirname17, join as join50 } from "node:path";
|
|
40403
40420
|
import { execSync as execSync2 } from "node:child_process";
|
|
40404
40421
|
function locateManifestPath() {
|
|
40405
40422
|
let dir = import.meta.dirname;
|
|
@@ -40407,7 +40424,7 @@ function locateManifestPath() {
|
|
|
40407
40424
|
const candidate = join50(dir, "dependencies.json");
|
|
40408
40425
|
if (existsSync57(candidate))
|
|
40409
40426
|
return candidate;
|
|
40410
|
-
dir =
|
|
40427
|
+
dir = dirname17(dir);
|
|
40411
40428
|
}
|
|
40412
40429
|
return null;
|
|
40413
40430
|
}
|
|
@@ -43578,7 +43595,7 @@ import {
|
|
|
43578
43595
|
readdirSync as readdirSync21,
|
|
43579
43596
|
statSync as statSync26
|
|
43580
43597
|
} from "node:fs";
|
|
43581
|
-
import { dirname as
|
|
43598
|
+
import { dirname as dirname18, join as join62, resolve as resolve37 } from "node:path";
|
|
43582
43599
|
import { createPublicKey, createPrivateKey } from "node:crypto";
|
|
43583
43600
|
function findInNvm(bin) {
|
|
43584
43601
|
const nvmRoot = join62(process.env.HOME ?? "", ".nvm", "versions", "node");
|
|
@@ -45060,7 +45077,7 @@ async function checkMffAuthFlow(envPath = mffEnvPath(), timeoutMs = 8000) {
|
|
|
45060
45077
|
detail: "skipped (MFF_API_URL not set)"
|
|
45061
45078
|
};
|
|
45062
45079
|
}
|
|
45063
|
-
const credDir =
|
|
45080
|
+
const credDir = dirname18(envPath);
|
|
45064
45081
|
const authScript = join62(credDir, "claude-auth.py");
|
|
45065
45082
|
if (!existsSync62(authScript)) {
|
|
45066
45083
|
return {
|
|
@@ -48983,7 +49000,7 @@ __export(exports_voice_sidecar_token, {
|
|
|
48983
49000
|
});
|
|
48984
49001
|
import { randomBytes as randomBytes14 } from "node:crypto";
|
|
48985
49002
|
import { chmodSync as chmodSync11, chownSync as chownSync7, existsSync as existsSync81, mkdirSync as mkdirSync45, readFileSync as readFileSync68, rmSync as rmSync17, writeFileSync as writeFileSync37 } from "node:fs";
|
|
48986
|
-
import { dirname as
|
|
49003
|
+
import { dirname as dirname27 } from "node:path";
|
|
48987
49004
|
async function defaultResolveOrSeedToken(home2, writeErr) {
|
|
48988
49005
|
const [{ getViaBrokerStructured: getViaBrokerStructured2, putViaBroker: putViaBroker2 }, { resolveOperatorVaultPassphrase }] = await Promise.all([
|
|
48989
49006
|
Promise.resolve().then(() => (init_client(), exports_client)),
|
|
@@ -49037,7 +49054,7 @@ async function provisionVoiceSidecarToken(composePath, home2, ctx) {
|
|
|
49037
49054
|
if (!token)
|
|
49038
49055
|
return;
|
|
49039
49056
|
try {
|
|
49040
|
-
mkdirSync45(
|
|
49057
|
+
mkdirSync45(dirname27(envPath), { recursive: true });
|
|
49041
49058
|
let body = "";
|
|
49042
49059
|
try {
|
|
49043
49060
|
if (existsSync81(envPath))
|
|
@@ -49099,11 +49116,11 @@ __export(exports_apply, {
|
|
|
49099
49116
|
DEFAULT_COMPOSE_PATH: () => DEFAULT_COMPOSE_PATH2,
|
|
49100
49117
|
COMPOSE_PROJECT: () => COMPOSE_PROJECT2
|
|
49101
49118
|
});
|
|
49102
|
-
import { accessSync as accessSync3, chownSync as chownSync8, constants as fsConstants6, copyFileSync as
|
|
49119
|
+
import { accessSync as accessSync3, chownSync as chownSync8, constants as fsConstants6, copyFileSync as copyFileSync12, existsSync as existsSync82, mkdirSync as mkdirSync46, readFileSync as readFileSync69, readdirSync as readdirSync28, renameSync as renameSync18, writeFileSync as writeFileSync38 } from "node:fs";
|
|
49103
49120
|
import { mkdir as mkdir2 } from "node:fs/promises";
|
|
49104
49121
|
import { spawnSync as childSpawnSync } from "node:child_process";
|
|
49105
49122
|
import readline from "node:readline";
|
|
49106
|
-
import { dirname as
|
|
49123
|
+
import { dirname as dirname28, join as join80, resolve as resolve50 } from "node:path";
|
|
49107
49124
|
import { homedir as homedir47 } from "node:os";
|
|
49108
49125
|
import { execFileSync as execFileSync25 } from "node:child_process";
|
|
49109
49126
|
function effectiveLiteLLMEnabled(config, agentResolvedLitellm) {
|
|
@@ -49348,7 +49365,7 @@ async function provisionLiteLLMKeys(config, agentNames, switchroomConfigPath, ct
|
|
|
49348
49365
|
function resolveVaultBindMountDir(homeDir, ctx) {
|
|
49349
49366
|
const isCustomPath = ctx.migrationKind === "custom-path-skipped";
|
|
49350
49367
|
if (isCustomPath && ctx.customVaultPath) {
|
|
49351
|
-
return
|
|
49368
|
+
return dirname28(ctx.customVaultPath);
|
|
49352
49369
|
}
|
|
49353
49370
|
return join80(homeDir, ".switchroom", "vault");
|
|
49354
49371
|
}
|
|
@@ -50003,7 +50020,7 @@ function copyExampleConfig2(name) {
|
|
|
50003
50020
|
if (!existsSync82(exampleFile)) {
|
|
50004
50021
|
throw new Error(`Example config not found: ${name}.yaml (available: ${Object.keys(EMBEDDED_EXAMPLES).join(", ")})`);
|
|
50005
50022
|
}
|
|
50006
|
-
|
|
50023
|
+
copyFileSync12(exampleFile, dest);
|
|
50007
50024
|
console.log(source_default.green(`Copied ${name}.yaml -> switchroom.yaml`));
|
|
50008
50025
|
}
|
|
50009
50026
|
function findUnwritableAgentDirs(config, opts) {
|
|
@@ -64550,7 +64567,7 @@ import {
|
|
|
64550
64567
|
mkdirSync as mkdirSync53,
|
|
64551
64568
|
writeFileSync as writeFileSync44
|
|
64552
64569
|
} from "node:fs";
|
|
64553
|
-
import { resolve as resolve55, dirname as
|
|
64570
|
+
import { resolve as resolve55, dirname as dirname31 } from "node:path";
|
|
64554
64571
|
import { homedir as homedir56 } from "node:os";
|
|
64555
64572
|
function resolveSwitchroomBase(home2 = process.env.SWITCHROOM_HOME ?? process.env.HOME ?? homedir56()) {
|
|
64556
64573
|
return resolve55(home2, ".switchroom");
|
|
@@ -64641,11 +64658,11 @@ function readLedgerIfPresent(base) {
|
|
|
64641
64658
|
}
|
|
64642
64659
|
}
|
|
64643
64660
|
function ledgerPathForBase(base) {
|
|
64644
|
-
return fleetHealthLedgerPath(
|
|
64661
|
+
return fleetHealthLedgerPath(dirname31(base));
|
|
64645
64662
|
}
|
|
64646
64663
|
function writeLedger(base, ledger) {
|
|
64647
64664
|
const path8 = ledgerPathForBase(base);
|
|
64648
|
-
mkdirSync53(
|
|
64665
|
+
mkdirSync53(dirname31(path8), { recursive: true });
|
|
64649
64666
|
writeFileSync44(path8, JSON.stringify(ledger, null, 2) + `
|
|
64650
64667
|
`, "utf-8");
|
|
64651
64668
|
return path8;
|
|
@@ -64665,8 +64682,8 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
64665
64682
|
import { dirname, join } from "node:path";
|
|
64666
64683
|
|
|
64667
64684
|
// src/build-info.ts
|
|
64668
|
-
var VERSION = "0.18.
|
|
64669
|
-
var COMMIT_SHA = "
|
|
64685
|
+
var VERSION = "0.18.6";
|
|
64686
|
+
var COMMIT_SHA = "b62d558a";
|
|
64670
64687
|
|
|
64671
64688
|
// src/cli/resolve-version.ts
|
|
64672
64689
|
function readPackageVersion() {
|
|
@@ -71499,7 +71516,7 @@ init_acl();
|
|
|
71499
71516
|
init_protocol();
|
|
71500
71517
|
import * as net3 from "node:net";
|
|
71501
71518
|
import { mkdirSync as mkdirSync24, chmodSync as chmodSync7, chownSync as chownSync4, existsSync as existsSync41, readFileSync as readFileSync34, readdirSync as readdirSync17, statSync as statSync21, unlinkSync as unlinkSync10, writeFileSync as writeFileSync18, renameSync as renameSync13 } from "node:fs";
|
|
71502
|
-
import { dirname as
|
|
71519
|
+
import { dirname as dirname12, resolve as resolve28, basename as basename7 } from "node:path";
|
|
71503
71520
|
import * as os4 from "node:os";
|
|
71504
71521
|
import * as path3 from "node:path";
|
|
71505
71522
|
|
|
@@ -71592,10 +71609,38 @@ function rotateAuditLog(logPath, maxFiles) {
|
|
|
71592
71609
|
return;
|
|
71593
71610
|
}
|
|
71594
71611
|
}
|
|
71612
|
+
const snapshotPath = `${logPath}.1`;
|
|
71613
|
+
try {
|
|
71614
|
+
fs2.copyFileSync(logPath, snapshotPath);
|
|
71615
|
+
} catch (err) {
|
|
71616
|
+
process.stderr.write(`[vault-audit] ERROR: could not snapshot active audit log ${logPath} \u2192 ${snapshotPath}: ${err.message}
|
|
71617
|
+
`);
|
|
71618
|
+
return;
|
|
71619
|
+
}
|
|
71620
|
+
try {
|
|
71621
|
+
const fd = fs2.openSync(snapshotPath, "r");
|
|
71622
|
+
try {
|
|
71623
|
+
fs2.fsyncSync(fd);
|
|
71624
|
+
} finally {
|
|
71625
|
+
fs2.closeSync(fd);
|
|
71626
|
+
}
|
|
71627
|
+
} catch (err) {
|
|
71628
|
+
process.stderr.write(`[vault-audit] ERROR: could not fsync audit snapshot ${snapshotPath}; leaving active log intact to avoid data loss: ${err.message}
|
|
71629
|
+
`);
|
|
71630
|
+
return;
|
|
71631
|
+
}
|
|
71632
|
+
try {
|
|
71633
|
+
const dirFd = fs2.openSync(path.dirname(snapshotPath), "r");
|
|
71634
|
+
try {
|
|
71635
|
+
fs2.fsyncSync(dirFd);
|
|
71636
|
+
} finally {
|
|
71637
|
+
fs2.closeSync(dirFd);
|
|
71638
|
+
}
|
|
71639
|
+
} catch {}
|
|
71595
71640
|
try {
|
|
71596
|
-
fs2.
|
|
71641
|
+
fs2.truncateSync(logPath, 0);
|
|
71597
71642
|
} catch (err) {
|
|
71598
|
-
process.stderr.write(`[vault-audit] ERROR: could not
|
|
71643
|
+
process.stderr.write(`[vault-audit] ERROR: could not truncate active audit log ${logPath}: ${err.message}
|
|
71599
71644
|
`);
|
|
71600
71645
|
}
|
|
71601
71646
|
}
|
|
@@ -74004,7 +74049,7 @@ class VaultBroker {
|
|
|
74004
74049
|
this.passphrase = this.testOpts._testPassphrase;
|
|
74005
74050
|
}
|
|
74006
74051
|
process.umask(63);
|
|
74007
|
-
const parentDir =
|
|
74052
|
+
const parentDir = dirname12(this.socketPath);
|
|
74008
74053
|
mkdirSync24(parentDir, { recursive: true, mode: 448 });
|
|
74009
74054
|
try {
|
|
74010
74055
|
chmodSync7(parentDir, 448);
|
|
@@ -75485,15 +75530,15 @@ class VaultBroker {
|
|
|
75485
75530
|
}
|
|
75486
75531
|
}
|
|
75487
75532
|
function detectVaultLayoutDrift(vaultPath) {
|
|
75488
|
-
const dir =
|
|
75533
|
+
const dir = dirname12(vaultPath);
|
|
75489
75534
|
if (basename7(dir) !== "vault")
|
|
75490
75535
|
return;
|
|
75491
75536
|
if (basename7(vaultPath) !== "vault.enc")
|
|
75492
75537
|
return;
|
|
75493
|
-
const switchroomDir =
|
|
75538
|
+
const switchroomDir = dirname12(dir);
|
|
75494
75539
|
if (basename7(switchroomDir) !== ".switchroom")
|
|
75495
75540
|
return;
|
|
75496
|
-
const home2 =
|
|
75541
|
+
const home2 = dirname12(switchroomDir);
|
|
75497
75542
|
const result = inspectVaultLayout(home2);
|
|
75498
75543
|
if (result.kind === "divergent") {
|
|
75499
75544
|
throw new VaultError(`Vault layout divergence detected at boot: ${result.details.oldPath} and ${result.details.newPath} are both regular files with different content. An older switchroom CLI may have written to the legacy path after migration ran. Run \`switchroom apply\` from the host to surface the recovery recipe (state E refusal with literal \`mv\` commands). See docs/operators/state-e-recovery.md.`);
|
|
@@ -76525,7 +76570,7 @@ import {
|
|
|
76525
76570
|
appendFileSync as appendFileSync3,
|
|
76526
76571
|
closeSync as closeSync10,
|
|
76527
76572
|
existsSync as existsSync45,
|
|
76528
|
-
fsyncSync as
|
|
76573
|
+
fsyncSync as fsyncSync7,
|
|
76529
76574
|
mkdirSync as mkdirSync25,
|
|
76530
76575
|
openSync as openSync10,
|
|
76531
76576
|
readdirSync as readdirSync18,
|
|
@@ -76672,7 +76717,7 @@ function backupVault(opts) {
|
|
|
76672
76717
|
const fd = openSync10(tmpPath, "wx", 384);
|
|
76673
76718
|
try {
|
|
76674
76719
|
writeSync7(fd, src);
|
|
76675
|
-
|
|
76720
|
+
fsyncSync7(fd);
|
|
76676
76721
|
} finally {
|
|
76677
76722
|
closeSync10(fd);
|
|
76678
76723
|
}
|
|
@@ -76703,7 +76748,7 @@ function backupVault(opts) {
|
|
|
76703
76748
|
try {
|
|
76704
76749
|
const dirFd = openSync10(opts.destDir, "r");
|
|
76705
76750
|
try {
|
|
76706
|
-
|
|
76751
|
+
fsyncSync7(dirFd);
|
|
76707
76752
|
} finally {
|
|
76708
76753
|
closeSync10(dirFd);
|
|
76709
76754
|
}
|
|
@@ -76719,7 +76764,7 @@ function backupVault(opts) {
|
|
|
76719
76764
|
try {
|
|
76720
76765
|
const dirFd = openSync10(opts.destDir, "r");
|
|
76721
76766
|
try {
|
|
76722
|
-
|
|
76767
|
+
fsyncSync7(dirFd);
|
|
76723
76768
|
} finally {
|
|
76724
76769
|
closeSync10(dirFd);
|
|
76725
76770
|
}
|
|
@@ -78889,7 +78934,7 @@ import {
|
|
|
78889
78934
|
writeSync as writeSync8,
|
|
78890
78935
|
constants as fsConstants3
|
|
78891
78936
|
} from "node:fs";
|
|
78892
|
-
import { resolve as resolve32, extname, join as join49, relative, dirname as
|
|
78937
|
+
import { resolve as resolve32, extname, join as join49, relative, dirname as dirname15 } from "node:path";
|
|
78893
78938
|
import { homedir as homedir27 } from "node:os";
|
|
78894
78939
|
import { timingSafeEqual as timingSafeEqual3, randomBytes as randomBytes11 } from "node:crypto";
|
|
78895
78940
|
|
|
@@ -82165,7 +82210,7 @@ function resolveWebToken() {
|
|
|
82165
82210
|
return existing;
|
|
82166
82211
|
}
|
|
82167
82212
|
const token = randomBytes11(32).toString("hex");
|
|
82168
|
-
mkdirSync30(
|
|
82213
|
+
mkdirSync30(dirname15(tokenPath), { recursive: true, mode: 448 });
|
|
82169
82214
|
try {
|
|
82170
82215
|
const fd = openSync11(tokenPath, fsConstants3.O_WRONLY | fsConstants3.O_CREAT | fsConstants3.O_EXCL, 384);
|
|
82171
82216
|
try {
|
|
@@ -82923,8 +82968,8 @@ Starting Switchroom dashboard...
|
|
|
82923
82968
|
init_source();
|
|
82924
82969
|
init_loader();
|
|
82925
82970
|
init_scaffold();
|
|
82926
|
-
import { existsSync as existsSync56, copyFileSync as
|
|
82927
|
-
import { resolve as resolve33, dirname as
|
|
82971
|
+
import { existsSync as existsSync56, copyFileSync as copyFileSync9, readFileSync as readFileSync51, writeFileSync as writeFileSync26, mkdirSync as mkdirSync31 } from "node:fs";
|
|
82972
|
+
import { resolve as resolve33, dirname as dirname16 } from "node:path";
|
|
82928
82973
|
init_state();
|
|
82929
82974
|
init_vault();
|
|
82930
82975
|
init_manager();
|
|
@@ -83229,8 +83274,8 @@ async function copyExampleConfig(nonInteractive) {
|
|
|
83229
83274
|
if (!existsSync56(srcFile)) {
|
|
83230
83275
|
throw new ConfigError(`Example config not found: ${choice}.yaml`);
|
|
83231
83276
|
}
|
|
83232
|
-
mkdirSync31(
|
|
83233
|
-
|
|
83277
|
+
mkdirSync31(dirname16(destFile), { recursive: true });
|
|
83278
|
+
copyFileSync9(srcFile, destFile);
|
|
83234
83279
|
console.log(source_default.green(` Copied ${choice}.yaml -> ${destFile}`));
|
|
83235
83280
|
console.log(source_default.yellow(` Edit ${destFile} to customize, then re-run switchroom setup.`));
|
|
83236
83281
|
await writeDetectedTimezone(destFile, nonInteractive);
|
|
@@ -84012,7 +84057,7 @@ init_lifecycle();
|
|
|
84012
84057
|
init_compose_env();
|
|
84013
84058
|
import { cpSync as cpSync2, existsSync as existsSync63, mkdirSync as mkdirSync33, readFileSync as readFileSync56, realpathSync as realpathSync6, rmSync as rmSync12, statSync as statSync28, chownSync as chownSync5 } from "node:fs";
|
|
84014
84059
|
import { spawnSync as spawnSync12 } from "node:child_process";
|
|
84015
|
-
import { join as join63, dirname as
|
|
84060
|
+
import { join as join63, dirname as dirname19, resolve as resolve38 } from "node:path";
|
|
84016
84061
|
import { homedir as homedir38 } from "node:os";
|
|
84017
84062
|
|
|
84018
84063
|
// src/cli/release-yaml.ts
|
|
@@ -84121,7 +84166,7 @@ function defaultPersistPin(configPath) {
|
|
|
84121
84166
|
}
|
|
84122
84167
|
var DEFAULT_COMPOSE_PATH = join63(homedir38(), ".switchroom", "compose", "docker-compose.yml");
|
|
84123
84168
|
function runningFromSwitchroomCheckout(scriptPath) {
|
|
84124
|
-
let dir =
|
|
84169
|
+
let dir = dirname19(scriptPath);
|
|
84125
84170
|
for (let i = 0;i < 12; i++) {
|
|
84126
84171
|
if (existsSync63(join63(dir, ".git"))) {
|
|
84127
84172
|
try {
|
|
@@ -84130,7 +84175,7 @@ function runningFromSwitchroomCheckout(scriptPath) {
|
|
|
84130
84175
|
return true;
|
|
84131
84176
|
} catch {}
|
|
84132
84177
|
}
|
|
84133
|
-
const parent =
|
|
84178
|
+
const parent = dirname19(dir);
|
|
84134
84179
|
if (parent === dir)
|
|
84135
84180
|
break;
|
|
84136
84181
|
dir = parent;
|
|
@@ -84346,7 +84391,7 @@ function planUpdate(opts) {
|
|
|
84346
84391
|
if (existsSync63(dest)) {
|
|
84347
84392
|
rmSync12(dest, { recursive: true, force: true });
|
|
84348
84393
|
}
|
|
84349
|
-
mkdirSync33(
|
|
84394
|
+
mkdirSync33(dirname19(dest), { recursive: true });
|
|
84350
84395
|
cpSync2(source, dest, { recursive: true, dereference: false });
|
|
84351
84396
|
} catch (err) {
|
|
84352
84397
|
throw new Error(`sync-bundled-skills failed: ${err.message}`);
|
|
@@ -84459,7 +84504,7 @@ function defaultStatusProbe(composePath) {
|
|
|
84459
84504
|
try {
|
|
84460
84505
|
cliBuiltAt = new Date(statSync28(scriptPath).mtimeMs).toISOString();
|
|
84461
84506
|
} catch {}
|
|
84462
|
-
let dir =
|
|
84507
|
+
let dir = dirname19(scriptPath);
|
|
84463
84508
|
for (let i = 0;i < 8; i++) {
|
|
84464
84509
|
const pkgPath = join63(dir, "package.json");
|
|
84465
84510
|
if (existsSync63(pkgPath)) {
|
|
@@ -84472,7 +84517,7 @@ function defaultStatusProbe(composePath) {
|
|
|
84472
84517
|
}
|
|
84473
84518
|
break;
|
|
84474
84519
|
}
|
|
84475
|
-
const parent =
|
|
84520
|
+
const parent = dirname19(dir);
|
|
84476
84521
|
if (parent === dir)
|
|
84477
84522
|
break;
|
|
84478
84523
|
dir = parent;
|
|
@@ -85103,7 +85148,7 @@ init_helpers();
|
|
|
85103
85148
|
init_lifecycle();
|
|
85104
85149
|
import { execSync as execSync4 } from "node:child_process";
|
|
85105
85150
|
import { existsSync as existsSync64, readFileSync as readFileSync58 } from "node:fs";
|
|
85106
|
-
import { dirname as
|
|
85151
|
+
import { dirname as dirname20, join as join64 } from "node:path";
|
|
85107
85152
|
function getClaudeCodeVersion() {
|
|
85108
85153
|
try {
|
|
85109
85154
|
const out = execSync4("claude --version 2>/dev/null", {
|
|
@@ -85162,7 +85207,7 @@ function locateSwitchroomInstallDir() {
|
|
|
85162
85207
|
}
|
|
85163
85208
|
} catch {}
|
|
85164
85209
|
}
|
|
85165
|
-
dir =
|
|
85210
|
+
dir = dirname20(dir);
|
|
85166
85211
|
}
|
|
85167
85212
|
return null;
|
|
85168
85213
|
}
|
|
@@ -86363,7 +86408,7 @@ import {
|
|
|
86363
86408
|
rmSync as rmSync13,
|
|
86364
86409
|
writeFileSync as writeFileSync28
|
|
86365
86410
|
} from "node:fs";
|
|
86366
|
-
import { dirname as
|
|
86411
|
+
import { dirname as dirname21, join as join67 } from "node:path";
|
|
86367
86412
|
import { homedir as homedir40 } from "node:os";
|
|
86368
86413
|
import { execFileSync as execFileSync19 } from "node:child_process";
|
|
86369
86414
|
|
|
@@ -86410,7 +86455,7 @@ function ensurePythonEnv(opts) {
|
|
|
86410
86455
|
if (existsSync67(venvDir)) {
|
|
86411
86456
|
rmSync13(venvDir, { recursive: true, force: true });
|
|
86412
86457
|
}
|
|
86413
|
-
mkdirSync35(
|
|
86458
|
+
mkdirSync35(dirname21(venvDir), { recursive: true });
|
|
86414
86459
|
try {
|
|
86415
86460
|
execFileSync19(hostPython, ["-m", "venv", venvDir], { stdio: "pipe" });
|
|
86416
86461
|
} catch (err) {
|
|
@@ -86444,14 +86489,14 @@ function ensurePythonEnv(opts) {
|
|
|
86444
86489
|
// src/deps/node.ts
|
|
86445
86490
|
import { createHash as createHash13 } from "node:crypto";
|
|
86446
86491
|
import {
|
|
86447
|
-
copyFileSync as
|
|
86492
|
+
copyFileSync as copyFileSync10,
|
|
86448
86493
|
existsSync as existsSync68,
|
|
86449
86494
|
mkdirSync as mkdirSync36,
|
|
86450
86495
|
readFileSync as readFileSync61,
|
|
86451
86496
|
rmSync as rmSync14,
|
|
86452
86497
|
writeFileSync as writeFileSync29
|
|
86453
86498
|
} from "node:fs";
|
|
86454
|
-
import { dirname as
|
|
86499
|
+
import { dirname as dirname22, join as join68 } from "node:path";
|
|
86455
86500
|
import { homedir as homedir41 } from "node:os";
|
|
86456
86501
|
import { execFileSync as execFileSync20 } from "node:child_process";
|
|
86457
86502
|
|
|
@@ -86478,7 +86523,7 @@ function defaultNodeCacheRoot() {
|
|
|
86478
86523
|
return join68(homedir41(), ".switchroom", "deps", "node");
|
|
86479
86524
|
}
|
|
86480
86525
|
function hashDepInputs(packageJsonPath) {
|
|
86481
|
-
const sourceDir =
|
|
86526
|
+
const sourceDir = dirname22(packageJsonPath);
|
|
86482
86527
|
const hasher = createHash13("sha256");
|
|
86483
86528
|
hasher.update(`package.json
|
|
86484
86529
|
`);
|
|
@@ -86503,7 +86548,7 @@ function ensureNodeEnv(opts) {
|
|
|
86503
86548
|
if (!existsSync68(packageJsonPath)) {
|
|
86504
86549
|
throw new NodeEnvError(`package.json not found: ${packageJsonPath}`);
|
|
86505
86550
|
}
|
|
86506
|
-
const sourceDir =
|
|
86551
|
+
const sourceDir = dirname22(packageJsonPath);
|
|
86507
86552
|
const envDir = join68(cacheRoot, skillName);
|
|
86508
86553
|
const stampPath = join68(envDir, ".package.sha256");
|
|
86509
86554
|
const nodeModulesDir = join68(envDir, "node_modules");
|
|
@@ -86525,12 +86570,12 @@ function ensureNodeEnv(opts) {
|
|
|
86525
86570
|
rmSync14(envDir, { recursive: true, force: true });
|
|
86526
86571
|
}
|
|
86527
86572
|
mkdirSync36(envDir, { recursive: true });
|
|
86528
|
-
|
|
86573
|
+
copyFileSync10(packageJsonPath, join68(envDir, "package.json"));
|
|
86529
86574
|
let copiedLockfile = false;
|
|
86530
86575
|
for (const lockName of LOCKFILES_FOR[installer]) {
|
|
86531
86576
|
const lockPath = join68(sourceDir, lockName);
|
|
86532
86577
|
if (existsSync68(lockPath)) {
|
|
86533
|
-
|
|
86578
|
+
copyFileSync10(lockPath, join68(envDir, lockName));
|
|
86534
86579
|
copiedLockfile = true;
|
|
86535
86580
|
}
|
|
86536
86581
|
}
|
|
@@ -87529,7 +87574,7 @@ function safeParseInt(value, fallback) {
|
|
|
87529
87574
|
init_helpers();
|
|
87530
87575
|
init_loader();
|
|
87531
87576
|
init_merge();
|
|
87532
|
-
import { copyFileSync as
|
|
87577
|
+
import { copyFileSync as copyFileSync11, existsSync as existsSync71, readFileSync as readFileSync62, writeFileSync as writeFileSync30 } from "node:fs";
|
|
87533
87578
|
import { join as join70, resolve as resolve44 } from "node:path";
|
|
87534
87579
|
init_scaffold();
|
|
87535
87580
|
init_profiles();
|
|
@@ -87606,7 +87651,7 @@ function registerSoulCommand(program3) {
|
|
|
87606
87651
|
if (existsSync71(backupPath)) {
|
|
87607
87652
|
backupPath = `${t.soulPath}.bak.${Date.now()}`;
|
|
87608
87653
|
}
|
|
87609
|
-
|
|
87654
|
+
copyFileSync11(t.soulPath, backupPath);
|
|
87610
87655
|
}
|
|
87611
87656
|
writeFileSync30(t.soulPath, content, "utf-8");
|
|
87612
87657
|
if (backupPath) {
|
|
@@ -89092,7 +89137,7 @@ function registerDriveMcpLauncherCommand(program3) {
|
|
|
89092
89137
|
init_scaffold_integration();
|
|
89093
89138
|
import { spawn as spawn5 } from "node:child_process";
|
|
89094
89139
|
import { writeFileSync as writeFileSync33, mkdirSync as mkdirSync41 } from "node:fs";
|
|
89095
|
-
import { dirname as
|
|
89140
|
+
import { dirname as dirname23, join as join76 } from "node:path";
|
|
89096
89141
|
var SOFTERIA_TOKEN_ENV = "MS365_MCP_OAUTH_TOKEN";
|
|
89097
89142
|
var DEFAULT_REFRESH_LEAD_MS = 5 * 60 * 1000;
|
|
89098
89143
|
var MAX_REFRESH_INTERVAL_MS = 60 * 60 * 1000;
|
|
@@ -89117,7 +89162,7 @@ function computeRefreshDelayMs(expiresAt, now, leadMs = DEFAULT_REFRESH_LEAD_MS)
|
|
|
89117
89162
|
function writeRefreshHeartbeat(agentName, data) {
|
|
89118
89163
|
const path7 = heartbeatPath(agentName);
|
|
89119
89164
|
try {
|
|
89120
|
-
mkdirSync41(
|
|
89165
|
+
mkdirSync41(dirname23(path7), { recursive: true });
|
|
89121
89166
|
writeFileSync33(path7, JSON.stringify(data, null, 2), { mode: 420 });
|
|
89122
89167
|
} catch {}
|
|
89123
89168
|
}
|
|
@@ -89310,7 +89355,7 @@ function registerM365McpLauncherCommand(program3) {
|
|
|
89310
89355
|
init_scaffold_integration();
|
|
89311
89356
|
import { spawn as spawn6 } from "node:child_process";
|
|
89312
89357
|
import { existsSync as existsSync78, mkdirSync as mkdirSync42, writeFileSync as writeFileSync34 } from "node:fs";
|
|
89313
|
-
import { dirname as
|
|
89358
|
+
import { dirname as dirname24 } from "node:path";
|
|
89314
89359
|
var HEARTBEAT_WRITE_INTERVAL_MS = 30 * 1000;
|
|
89315
89360
|
var DEFAULT_HEARTBEAT_PATH = "/state/agent/notion-launcher.heartbeat.json";
|
|
89316
89361
|
var DEFAULT_VAULT_KEY = "notion/integration-token";
|
|
@@ -89320,7 +89365,7 @@ function buildNotionMcpArgs(opts) {
|
|
|
89320
89365
|
}
|
|
89321
89366
|
function defaultWriteHeartbeat(path7, contents) {
|
|
89322
89367
|
try {
|
|
89323
|
-
const dir =
|
|
89368
|
+
const dir = dirname24(path7);
|
|
89324
89369
|
if (!existsSync78(dir))
|
|
89325
89370
|
mkdirSync42(dir, { recursive: true });
|
|
89326
89371
|
writeFileSync34(path7, contents);
|
|
@@ -90475,7 +90520,7 @@ init_paths();
|
|
|
90475
90520
|
import {
|
|
90476
90521
|
closeSync as closeSync14,
|
|
90477
90522
|
existsSync as existsSync84,
|
|
90478
|
-
fsyncSync as
|
|
90523
|
+
fsyncSync as fsyncSync8,
|
|
90479
90524
|
mkdirSync as mkdirSync47,
|
|
90480
90525
|
openSync as openSync14,
|
|
90481
90526
|
readdirSync as readdirSync30,
|
|
@@ -90558,7 +90603,7 @@ function writeOverlayEntry(agent, slug, yamlText, opts = {}) {
|
|
|
90558
90603
|
const fd = openSync14(stagingPath, "w", 384);
|
|
90559
90604
|
try {
|
|
90560
90605
|
writeSync10(fd, yamlText);
|
|
90561
|
-
|
|
90606
|
+
fsyncSync8(fd);
|
|
90562
90607
|
} finally {
|
|
90563
90608
|
closeSync14(fd);
|
|
90564
90609
|
}
|
|
@@ -90575,7 +90620,7 @@ function writeSkillsOverlayEntry(agent, slug, yamlText, opts = {}) {
|
|
|
90575
90620
|
const fd = openSync14(stagingPath, "w", 384);
|
|
90576
90621
|
try {
|
|
90577
90622
|
writeSync10(fd, yamlText);
|
|
90578
|
-
|
|
90623
|
+
fsyncSync8(fd);
|
|
90579
90624
|
} finally {
|
|
90580
90625
|
closeSync14(fd);
|
|
90581
90626
|
}
|
|
@@ -90782,7 +90827,7 @@ function reconcileAgentCronOnly(agent) {
|
|
|
90782
90827
|
import {
|
|
90783
90828
|
closeSync as closeSync15,
|
|
90784
90829
|
existsSync as existsSync85,
|
|
90785
|
-
fsyncSync as
|
|
90830
|
+
fsyncSync as fsyncSync9,
|
|
90786
90831
|
mkdirSync as mkdirSync48,
|
|
90787
90832
|
openSync as openSync15,
|
|
90788
90833
|
readdirSync as readdirSync31,
|
|
@@ -90826,7 +90871,7 @@ function stagePendingScheduleEntry(opts) {
|
|
|
90826
90871
|
const fd = openSync15(yamlTmp, "w", 384);
|
|
90827
90872
|
try {
|
|
90828
90873
|
writeSync11(fd, opts.yamlText);
|
|
90829
|
-
|
|
90874
|
+
fsyncSync9(fd);
|
|
90830
90875
|
} finally {
|
|
90831
90876
|
closeSync15(fd);
|
|
90832
90877
|
}
|
|
@@ -91794,7 +91839,7 @@ import {
|
|
|
91794
91839
|
writeFileSync as writeFileSync40
|
|
91795
91840
|
} from "node:fs";
|
|
91796
91841
|
import { tmpdir as tmpdir5, homedir as homedir49 } from "node:os";
|
|
91797
|
-
import { dirname as
|
|
91842
|
+
import { dirname as dirname29, join as join85, relative as relative2, resolve as resolve52 } from "node:path";
|
|
91798
91843
|
import { spawnSync as spawnSync15 } from "node:child_process";
|
|
91799
91844
|
|
|
91800
91845
|
// src/cli/skill-common.ts
|
|
@@ -92264,7 +92309,7 @@ function writePayload(poolDir, name, files) {
|
|
|
92264
92309
|
try {
|
|
92265
92310
|
for (const [path8, content] of Object.entries(files)) {
|
|
92266
92311
|
const full = join85(staging, path8);
|
|
92267
|
-
mkdirSync49(
|
|
92312
|
+
mkdirSync49(dirname29(full), { recursive: true, mode: 493 });
|
|
92268
92313
|
const fd = openSync16(full, "wx");
|
|
92269
92314
|
try {
|
|
92270
92315
|
writeFileSync40(fd, content);
|
|
@@ -92386,7 +92431,7 @@ import {
|
|
|
92386
92431
|
utimesSync,
|
|
92387
92432
|
writeFileSync as writeFileSync41
|
|
92388
92433
|
} from "node:fs";
|
|
92389
|
-
import { dirname as
|
|
92434
|
+
import { dirname as dirname30, join as join86, relative as relative3, resolve as resolve53 } from "node:path";
|
|
92390
92435
|
import { homedir as homedir50, tmpdir as tmpdir6 } from "node:os";
|
|
92391
92436
|
import { spawnSync as spawnSync16 } from "node:child_process";
|
|
92392
92437
|
init_helpers();
|
|
@@ -92639,13 +92684,13 @@ function writePersonalSkill(targetDir, files) {
|
|
|
92639
92684
|
if (targetIsSymlink) {
|
|
92640
92685
|
fail4(`refusing to overwrite symlink at ${targetDir}; investigate manually`);
|
|
92641
92686
|
}
|
|
92642
|
-
mkdirSync50(
|
|
92643
|
-
const staging = mkdtempSync6(join86(
|
|
92687
|
+
mkdirSync50(dirname30(targetDir), { recursive: true, mode: 493 });
|
|
92688
|
+
const staging = mkdtempSync6(join86(dirname30(targetDir), `.skill-personal-stage-`));
|
|
92644
92689
|
let oldRename = null;
|
|
92645
92690
|
try {
|
|
92646
92691
|
for (const [path8, content] of Object.entries(files)) {
|
|
92647
92692
|
const full = join86(staging, path8);
|
|
92648
|
-
mkdirSync50(
|
|
92693
|
+
mkdirSync50(dirname30(full), { recursive: true, mode: 493 });
|
|
92649
92694
|
const fd = openSync17(full, "wx");
|
|
92650
92695
|
try {
|
|
92651
92696
|
writeFileSync41(fd, content);
|
|
@@ -93388,7 +93433,7 @@ import {
|
|
|
93388
93433
|
statSync as statSync39,
|
|
93389
93434
|
lstatSync as lstatSync11,
|
|
93390
93435
|
realpathSync as realpathSync8,
|
|
93391
|
-
copyFileSync as
|
|
93436
|
+
copyFileSync as copyFileSync13
|
|
93392
93437
|
} from "node:fs";
|
|
93393
93438
|
import { homedir as homedir53 } from "node:os";
|
|
93394
93439
|
import { join as join89 } from "node:path";
|
|
@@ -93659,7 +93704,7 @@ function backupExistingCompose() {
|
|
|
93659
93704
|
return null;
|
|
93660
93705
|
const ts = new Date().toISOString().replace(/[:.]/g, "-");
|
|
93661
93706
|
const bak = `${p}.bak-${ts}`;
|
|
93662
|
-
|
|
93707
|
+
copyFileSync13(p, bak);
|
|
93663
93708
|
return bak;
|
|
93664
93709
|
}
|
|
93665
93710
|
function runDocker(args) {
|
|
@@ -93872,7 +93917,7 @@ The log is created when hostd handles its first privileged-verb request.`));
|
|
|
93872
93917
|
init_source();
|
|
93873
93918
|
init_helpers();
|
|
93874
93919
|
init_operator_uid();
|
|
93875
|
-
import { existsSync as existsSync93, mkdirSync as mkdirSync52, writeFileSync as writeFileSync43, copyFileSync as
|
|
93920
|
+
import { existsSync as existsSync93, mkdirSync as mkdirSync52, writeFileSync as writeFileSync43, copyFileSync as copyFileSync14 } from "node:fs";
|
|
93876
93921
|
import { homedir as homedir54 } from "node:os";
|
|
93877
93922
|
import { join as join90 } from "node:path";
|
|
93878
93923
|
import { spawnSync as spawnSync21 } from "node:child_process";
|
|
@@ -93970,7 +94015,7 @@ function backupExistingCompose2() {
|
|
|
93970
94015
|
return null;
|
|
93971
94016
|
const ts = new Date().toISOString().replace(/[:.]/g, "-");
|
|
93972
94017
|
const bak = `${p}.bak-${ts}`;
|
|
93973
|
-
|
|
94018
|
+
copyFileSync14(p, bak);
|
|
93974
94019
|
return bak;
|
|
93975
94020
|
}
|
|
93976
94021
|
function runDocker2(args) {
|