@rubytech/create-maxy-code 0.1.405 → 0.1.406

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.
Files changed (29) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/scheduling/PLUGIN.md +2 -0
  3. package/payload/platform/plugins/scheduling/mcp/dist/__tests__/agent-dispatch-manager-grounding.test.d.ts +2 -0
  4. package/payload/platform/plugins/scheduling/mcp/dist/__tests__/agent-dispatch-manager-grounding.test.d.ts.map +1 -0
  5. package/payload/platform/plugins/scheduling/mcp/dist/__tests__/agent-dispatch-manager-grounding.test.js +19 -0
  6. package/payload/platform/plugins/scheduling/mcp/dist/__tests__/agent-dispatch-manager-grounding.test.js.map +1 -0
  7. package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/deliverability-grounding.test.d.ts +2 -0
  8. package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/deliverability-grounding.test.d.ts.map +1 -0
  9. package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/deliverability-grounding.test.js +33 -0
  10. package/payload/platform/plugins/whatsapp/mcp/dist/__tests__/deliverability-grounding.test.js.map +1 -0
  11. package/payload/platform/plugins/whatsapp/references/channels-whatsapp.md +2 -0
  12. package/payload/platform/plugins/whatsapp/skills/manage-whatsapp-config/SKILL.md +5 -1
  13. package/payload/platform/services/claude-session-manager/dist/claude-host-creds.d.ts +8 -7
  14. package/payload/platform/services/claude-session-manager/dist/claude-host-creds.d.ts.map +1 -1
  15. package/payload/platform/services/claude-session-manager/dist/claude-host-creds.js +63 -40
  16. package/payload/platform/services/claude-session-manager/dist/claude-host-creds.js.map +1 -1
  17. package/payload/platform/services/claude-session-manager/dist/claude-keychain-write.d.ts +40 -0
  18. package/payload/platform/services/claude-session-manager/dist/claude-keychain-write.d.ts.map +1 -0
  19. package/payload/platform/services/claude-session-manager/dist/claude-keychain-write.js +159 -0
  20. package/payload/platform/services/claude-session-manager/dist/claude-keychain-write.js.map +1 -0
  21. package/payload/platform/services/claude-session-manager/dist/connector-availability.d.ts +36 -0
  22. package/payload/platform/services/claude-session-manager/dist/connector-availability.d.ts.map +1 -0
  23. package/payload/platform/services/claude-session-manager/dist/connector-availability.js +76 -0
  24. package/payload/platform/services/claude-session-manager/dist/connector-availability.js.map +1 -0
  25. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +2 -1
  26. package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
  27. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js +2 -2
  28. package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
  29. package/payload/server/server.js +80 -63
@@ -1307,7 +1307,7 @@ var serveStatic = (options = { root: "" }) => {
1307
1307
  // server/index.ts
1308
1308
  import { readFileSync as readFileSync35, existsSync as existsSync33, watchFile } from "fs";
1309
1309
  import { spawn as spawn3 } from "child_process";
1310
- import { resolve as resolve33, join as join34, basename as basename13 } from "path";
1310
+ import { resolve as resolve33, join as join35, basename as basename13 } from "path";
1311
1311
  import { homedir as homedir3 } from "os";
1312
1312
  import { monitorEventLoopDelay } from "perf_hooks";
1313
1313
 
@@ -10501,6 +10501,9 @@ function claudeBin() {
10501
10501
  return process.env.CLAUDE_BIN ?? "claude";
10502
10502
  }
10503
10503
 
10504
+ // server/routes/onboarding.ts
10505
+ import { dirname as dirname8, join as join23 } from "path";
10506
+
10504
10507
  // app/lib/claude-keychain.ts
10505
10508
  import { execFileSync as execFileSync2 } from "child_process";
10506
10509
  var CREDS_SERVICE_PREFIX = "Claude Code-credentials";
@@ -10567,6 +10570,15 @@ function bridgeKeychainToFile(deps) {
10567
10570
  deps.log(`[onboarding] op=login-writeback src=keychain dst=host-creds-file bytes=${blob.length}`);
10568
10571
  return { wrote: true, reason: "ok", bytes: blob.length, service };
10569
10572
  }
10573
+ function persistKeychainService(result, persist, log) {
10574
+ if (!result.wrote || !result.service) return;
10575
+ try {
10576
+ persist(result.service);
10577
+ log(`[onboarding] op=keychain-service-persist service=${JSON.stringify(result.service)}`);
10578
+ } catch (err) {
10579
+ log(`[onboarding] op=keychain-service-persist result=failed err=${err instanceof Error ? err.message : String(err)}`);
10580
+ }
10581
+ }
10570
10582
  function listHostCredsMdats() {
10571
10583
  try {
10572
10584
  const out = execFileSync2("security", ["dump-keychain"], { encoding: "utf-8", timeout: 1e4 });
@@ -10879,7 +10891,7 @@ app9.post("/claude-auth", async (c) => {
10879
10891
  claudeProc2.stderr?.on("data", onClaudeOutput);
10880
10892
  claudeProc2.once("close", () => {
10881
10893
  closeSync3(claudeAuthLogFd);
10882
- bridgeKeychainToFile({
10894
+ const writebackResult = bridgeKeychainToFile({
10883
10895
  platform: process.platform,
10884
10896
  before: darwinCredsBefore,
10885
10897
  listMdats: listHostCredsMdats,
@@ -10891,6 +10903,11 @@ app9.post("/claude-auth", async (c) => {
10891
10903
  },
10892
10904
  log: (line) => console.log(line)
10893
10905
  });
10906
+ persistKeychainService(
10907
+ writebackResult,
10908
+ (service) => writeFileSync10(join23(dirname8(CLAUDE_CREDENTIALS_FILE), ".keychain-service"), service, { mode: 384 }),
10909
+ (line) => console.log(line)
10910
+ );
10894
10911
  if (darwinAuthChild === claudeProc2) darwinAuthChild = null;
10895
10912
  });
10896
10913
  return c.json({ started: true, transport: "native" });
@@ -11154,8 +11171,8 @@ var onboarding_default = app9;
11154
11171
 
11155
11172
  // server/routes/client-error.ts
11156
11173
  import { appendFileSync as appendFileSync3, existsSync as existsSync16, renameSync as renameSync8, statSync as statSync9 } from "fs";
11157
- import { join as join23 } from "path";
11158
- var CLIENT_ERRORS_LOG = join23(LOG_DIR, "client-errors.log");
11174
+ import { join as join24 } from "path";
11175
+ var CLIENT_ERRORS_LOG = join24(LOG_DIR, "client-errors.log");
11159
11176
  var MAX_LOG_SIZE = 10 * 1024 * 1024;
11160
11177
  var MAX_BODY_SIZE = 8 * 1024;
11161
11178
  var MAX_STACK_LEN = 2e3;
@@ -11522,12 +11539,12 @@ import { resolve as resolve16, basename as basename8 } from "path";
11522
11539
 
11523
11540
  // app/lib/logs-read-resolve.ts
11524
11541
  import { existsSync as existsSync17 } from "fs";
11525
- import { join as join24 } from "path";
11542
+ import { join as join25 } from "path";
11526
11543
  function resolveSessionLogPaths(filename, logDirs) {
11527
11544
  const tried = [filename];
11528
11545
  const hits = [];
11529
11546
  for (const dir of logDirs) {
11530
- const fullPath = join24(dir, filename);
11547
+ const fullPath = join25(dir, filename);
11531
11548
  if (existsSync17(fullPath)) {
11532
11549
  hits.push({ path: fullPath, dir });
11533
11550
  }
@@ -12555,7 +12572,7 @@ var sessions_default = app17;
12555
12572
 
12556
12573
  // app/lib/claude-agent/spawn-context.ts
12557
12574
  import { existsSync as existsSync22, readFileSync as readFileSync27, readdirSync as readdirSync16, statSync as statSync11 } from "fs";
12558
- import { dirname as dirname8, resolve as resolve19, join as join25 } from "path";
12575
+ import { dirname as dirname9, resolve as resolve19, join as join26 } from "path";
12559
12576
  async function resolveOwnerProfileBlock(accountId, userId) {
12560
12577
  if (!userId) return { ok: false, reason: "missing-user-id" };
12561
12578
  try {
@@ -12596,8 +12613,8 @@ function frontmatterField(manifest, field2) {
12596
12613
  function extractPluginToolDescriptions(pluginDir) {
12597
12614
  const out = /* @__PURE__ */ new Map();
12598
12615
  const candidates = [
12599
- join25(pluginDir, "mcp/dist/index.js"),
12600
- join25(pluginDir, "mcp/src/index.ts")
12616
+ join26(pluginDir, "mcp/dist/index.js"),
12617
+ join26(pluginDir, "mcp/src/index.ts")
12601
12618
  ];
12602
12619
  let raw = null;
12603
12620
  for (const path2 of candidates) {
@@ -12655,21 +12672,21 @@ function listPluginDirs() {
12655
12672
  const platformPlugins = resolve19(PLATFORM_ROOT, "plugins");
12656
12673
  if (existsSync22(platformPlugins)) {
12657
12674
  for (const name of readdirSync16(platformPlugins)) {
12658
- const dir = join25(platformPlugins, name);
12675
+ const dir = join26(platformPlugins, name);
12659
12676
  try {
12660
12677
  if (statSync11(dir).isDirectory()) out.set(name, dir);
12661
12678
  } catch {
12662
12679
  }
12663
12680
  }
12664
12681
  }
12665
- const premiumRoot = resolve19(dirname8(PLATFORM_ROOT), "premium-plugins");
12682
+ const premiumRoot = resolve19(dirname9(PLATFORM_ROOT), "premium-plugins");
12666
12683
  if (existsSync22(premiumRoot)) {
12667
12684
  for (const bundle of readdirSync16(premiumRoot)) {
12668
- const bundlePlugins = join25(premiumRoot, bundle, "plugins");
12685
+ const bundlePlugins = join26(premiumRoot, bundle, "plugins");
12669
12686
  if (!existsSync22(bundlePlugins)) continue;
12670
12687
  try {
12671
12688
  for (const name of readdirSync16(bundlePlugins)) {
12672
- const dir = join25(bundlePlugins, name);
12689
+ const dir = join26(bundlePlugins, name);
12673
12690
  try {
12674
12691
  if (statSync11(dir).isDirectory()) out.set(name, dir);
12675
12692
  } catch {
@@ -12712,7 +12729,7 @@ function computeActivePlugins(accountId) {
12712
12729
  for (const name of Array.from(enabled).sort()) {
12713
12730
  const dir = pluginDirs.get(name);
12714
12731
  if (!dir) continue;
12715
- const fm = readFrontmatter(join25(dir, "PLUGIN.md"));
12732
+ const fm = readFrontmatter(join26(dir, "PLUGIN.md"));
12716
12733
  if (!fm) continue;
12717
12734
  const description = frontmatterField(`---
12718
12735
  ${fm}
@@ -12729,7 +12746,7 @@ ${fm}
12729
12746
  `plugin-manifest-tool-coverage plugin=${name} tools=${tools.length} with-desc=${withDesc}`
12730
12747
  );
12731
12748
  if (toolNames.length > 0 && descMap.size === 0) {
12732
- const hasSource = existsSync22(join25(dir, "mcp/dist/index.js")) || existsSync22(join25(dir, "mcp/src/index.ts"));
12749
+ const hasSource = existsSync22(join26(dir, "mcp/dist/index.js")) || existsSync22(join26(dir, "mcp/src/index.ts"));
12733
12750
  if (hasSource) {
12734
12751
  console.warn(
12735
12752
  `[spawn-context] WARN plugin=${name} mcp source present but tool-description regex matched zero entries \u2014 SDK upgrade may have changed the registration shape`
@@ -12739,7 +12756,7 @@ ${fm}
12739
12756
  const skillPaths = parseSkillPathsFromFrontmatter(fm);
12740
12757
  const skills = [];
12741
12758
  for (const relPath of skillPaths) {
12742
- const skillPath = join25(dir, relPath);
12759
+ const skillPath = join26(dir, relPath);
12743
12760
  const skillFm = readFrontmatter(skillPath);
12744
12761
  if (!skillFm) continue;
12745
12762
  const skillName = frontmatterField(`---
@@ -12783,7 +12800,7 @@ function computeSpecialistDomains(accountId) {
12783
12800
  const out = [];
12784
12801
  for (const file of entries.sort()) {
12785
12802
  if (!file.endsWith(".md")) continue;
12786
- const fm = readFrontmatter(join25(specialistsDir, file));
12803
+ const fm = readFrontmatter(join26(specialistsDir, file));
12787
12804
  if (!fm) continue;
12788
12805
  const wrapped = `---
12789
12806
  ${fm}
@@ -13111,7 +13128,7 @@ import { createReadStream as createReadStream2, createWriteStream as createWrite
13111
13128
  import { readdir as readdir3, readFile as readFile4, stat as stat4, mkdir as mkdir3, unlink as unlink2, rename } from "fs/promises";
13112
13129
  import { realpathSync as realpathSync5 } from "fs";
13113
13130
  import { randomUUID as randomUUID9 } from "crypto";
13114
- import { basename as basename10, dirname as dirname9, join as join27, relative as relative4, resolve as resolve22, sep as sep6 } from "path";
13131
+ import { basename as basename10, dirname as dirname10, join as join28, relative as relative4, resolve as resolve22, sep as sep6 } from "path";
13115
13132
  import { Readable as Readable2 } from "stream";
13116
13133
 
13117
13134
  // ../lib/graph-trash/src/index.ts
@@ -13429,7 +13446,7 @@ async function cascadeDeleteDocument(params) {
13429
13446
 
13430
13447
  // app/lib/file-index.ts
13431
13448
  import * as fsp from "fs/promises";
13432
- import { resolve as resolve21, relative as relative3, join as join26, basename as basename9, extname as extname2, sep as sep5 } from "path";
13449
+ import { resolve as resolve21, relative as relative3, join as join27, basename as basename9, extname as extname2, sep as sep5 } from "path";
13433
13450
  import { tmpdir as tmpdir2 } from "os";
13434
13451
  import { execFile as execFile2 } from "child_process";
13435
13452
  import { promisify as promisify2 } from "util";
@@ -13511,7 +13528,7 @@ async function extractPdf(absolute) {
13511
13528
  return stdout.trim();
13512
13529
  }
13513
13530
  async function ocrPdf(absolute) {
13514
- const outPdf = join26(tmpdir2(), `file-index-ocr-${process.pid}-${Date.now()}.pdf`);
13531
+ const outPdf = join27(tmpdir2(), `file-index-ocr-${process.pid}-${Date.now()}.pdf`);
13515
13532
  try {
13516
13533
  await execFileAsync2(
13517
13534
  "ocrmypdf",
@@ -13573,7 +13590,7 @@ async function readDisplayName(absolute) {
13573
13590
  const stem = dot === -1 ? base : base.slice(0, dot);
13574
13591
  if (base === `${stem}.meta.json`) return null;
13575
13592
  try {
13576
- const raw = await fsp.readFile(join26(dir, `${stem}.meta.json`), "utf-8");
13593
+ const raw = await fsp.readFile(join27(dir, `${stem}.meta.json`), "utf-8");
13577
13594
  const meta = JSON.parse(raw);
13578
13595
  const dn = meta.displayName ?? meta.filename;
13579
13596
  return typeof dn === "string" && dn.length > 0 ? dn : null;
@@ -13594,7 +13611,7 @@ async function walkSubtree(root, dataRoot, out) {
13594
13611
  for (const entry of entries) {
13595
13612
  if (entry.isSymbolicLink()) continue;
13596
13613
  if (entry.isDirectory() && entry.name === ".uploads-tmp") continue;
13597
- const abs = join26(root, entry.name);
13614
+ const abs = join27(root, entry.name);
13598
13615
  if (entry.isDirectory()) {
13599
13616
  const sub = await walkSubtree(abs, dataRoot, out);
13600
13617
  if (!sub.clean) clean = false;
@@ -13950,7 +13967,7 @@ var UPLOAD_TMP_DIR = ".uploads-tmp";
13950
13967
  var UUID_RE3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
13951
13968
  async function readMeta(absDir, baseName) {
13952
13969
  try {
13953
- const raw = await readFile4(join27(absDir, `${baseName}.meta.json`), "utf8");
13970
+ const raw = await readFile4(join28(absDir, `${baseName}.meta.json`), "utf8");
13954
13971
  const parsed = JSON.parse(raw);
13955
13972
  if (typeof parsed?.filename === "string") {
13956
13973
  return { filename: parsed.filename, mimeType: typeof parsed.mimeType === "string" ? parsed.mimeType : void 0 };
@@ -13988,7 +14005,7 @@ async function readAccountNames() {
13988
14005
  }
13989
14006
  async function enrich(absolute, entry, accountNames) {
13990
14007
  if (entry.kind === "directory" && UUID_RE3.test(entry.name)) {
13991
- const meta = await readMeta(join27(absolute, entry.name), entry.name);
14008
+ const meta = await readMeta(join28(absolute, entry.name), entry.name);
13992
14009
  if (meta?.filename) {
13993
14010
  entry.displayName = meta.filename;
13994
14011
  entry.mimeType = meta.mimeType;
@@ -14152,7 +14169,7 @@ app21.get("/", requireAdminSession, async (c) => {
14152
14169
  const childRel = relPath === "" || relPath === "." ? name : `${relPath}/${name}`;
14153
14170
  const protectedEntry = isProtectedFromDeletion(childRel).protected;
14154
14171
  try {
14155
- const entryPath = join27(absolute, name);
14172
+ const entryPath = join28(absolute, name);
14156
14173
  const s = await stat4(entryPath);
14157
14174
  entries.push({
14158
14175
  name,
@@ -14205,7 +14222,7 @@ app21.get("/download", requireAdminSession, async (c) => {
14205
14222
  console.error(`[data] op=scratchpad-no-session sessionId="${sessionId.slice(0, 8)}\u2026"`);
14206
14223
  return c.json({ error: "Not found" }, 404);
14207
14224
  }
14208
- const meta = readSidecarMeta(join27(projectDir, `${sessionId}.meta.json`));
14225
+ const meta = readSidecarMeta(join28(projectDir, `${sessionId}.meta.json`));
14209
14226
  if (!meta.accountId || meta.accountId !== accountId) {
14210
14227
  console.error(`[data] account-scope-blocked root="scratchpad" sessionId="${sessionId.slice(0, 8)}\u2026" account=${accountId.slice(0, 8)}\u2026`);
14211
14228
  return c.json({ error: "Not found" }, 404);
@@ -14292,7 +14309,7 @@ async function* walkRegularFiles(dirAbsolute) {
14292
14309
  const dirents = await readdir3(dirAbsolute, { withFileTypes: true });
14293
14310
  for (const d of dirents) {
14294
14311
  if (d.isSymbolicLink()) continue;
14295
- const child = join27(dirAbsolute, d.name);
14312
+ const child = join28(dirAbsolute, d.name);
14296
14313
  if (d.isDirectory()) {
14297
14314
  yield* walkRegularFiles(child);
14298
14315
  continue;
@@ -14341,7 +14358,7 @@ app21.get("/download-zip", requireAdminSession, async (c) => {
14341
14358
  const info = await stat4(absolute);
14342
14359
  if (info.isDirectory()) {
14343
14360
  dirsWalked++;
14344
- const parentAbs = dirname9(absolute);
14361
+ const parentAbs = dirname10(absolute);
14345
14362
  for await (const fileAbs of walkRegularFiles(absolute)) {
14346
14363
  const within = relative4(absolute, fileAbs).split(sep6).join("/");
14347
14364
  const fileRel = relPath === "" || relPath === "." ? within : `${relPath}/${within}`;
@@ -14395,8 +14412,8 @@ async function resolveUploadTarget(c, accountId, uid) {
14395
14412
  const rawDir = c.req.query("path") ?? "";
14396
14413
  const base = resolveOwnAccountWrite(rawDir, accountId, "POST /api/admin/files/upload");
14397
14414
  if (!base.ok) return { ok: false, status: base.status, error: base.error };
14398
- const relDir = relpath ? dirname9(relpath) : ".";
14399
- const destRel = relDir === "." ? base.relative : join27(base.relative, relDir);
14415
+ const relDir = relpath ? dirname10(relpath) : ".";
14416
+ const destRel = relDir === "." ? base.relative : join28(base.relative, relDir);
14400
14417
  if (crossesForeignAccountPartition(destRel, accountId)) {
14401
14418
  console.error(`[data] account-scope-blocked endpoint="POST /api/admin/files/upload" path="${destRel}" account=${accountId.slice(0, 8)}\u2026`);
14402
14419
  return { ok: false, status: 404, error: "Not found" };
@@ -14772,7 +14789,7 @@ app21.delete("/", requireAdminSession, async (c) => {
14772
14789
  }
14773
14790
  const dot = base.lastIndexOf(".");
14774
14791
  const stem = dot === -1 ? base : base.slice(0, dot);
14775
- const sidecarPath = UUID_RE3.test(stem) && base !== `${stem}.meta.json` ? join27(dirname9(absolute), `${stem}.meta.json`) : null;
14792
+ const sidecarPath = UUID_RE3.test(stem) && base !== `${stem}.meta.json` ? join28(dirname10(absolute), `${stem}.meta.json`) : null;
14776
14793
  await unlink2(absolute);
14777
14794
  if (sidecarPath) {
14778
14795
  try {
@@ -14868,8 +14885,8 @@ app21.post("/rename", requireAdminSession, async (c) => {
14868
14885
  console.error(`[data] file-rename blocked path="${src.relative}" reason="protected"`);
14869
14886
  return c.json({ error: "Protected entry \u2014 refusing to rename" }, 403);
14870
14887
  }
14871
- const destAbs = resolve22(dirname9(src.absolute), newName);
14872
- const newRel = `${dirname9(src.relative)}/${newName}`.replace(/^\.\//, "");
14888
+ const destAbs = resolve22(dirname10(src.absolute), newName);
14889
+ const newRel = `${dirname10(src.relative)}/${newName}`.replace(/^\.\//, "");
14873
14890
  if (isProtectedFromRename(newRel)) {
14874
14891
  console.error(`[data] file-rename blocked path="${newRel}" reason="protected-target"`);
14875
14892
  return c.json({ error: "That name is reserved" }, 403);
@@ -17738,10 +17755,10 @@ var system_stats_default = app36;
17738
17755
 
17739
17756
  // server/routes/admin/health.ts
17740
17757
  import { existsSync as existsSync26, readFileSync as readFileSync29 } from "fs";
17741
- import { resolve as resolve24, join as join28 } from "path";
17758
+ import { resolve as resolve24, join as join29 } from "path";
17742
17759
  var PLATFORM_ROOT6 = process.env.MAXY_PLATFORM_ROOT ?? resolve24(process.cwd(), "..");
17743
17760
  var brandHostname = "maxy";
17744
- var brandJsonPath = join28(PLATFORM_ROOT6, "config", "brand.json");
17761
+ var brandJsonPath = join29(PLATFORM_ROOT6, "config", "brand.json");
17745
17762
  if (existsSync26(brandJsonPath)) {
17746
17763
  try {
17747
17764
  const brand = JSON.parse(readFileSync29(brandJsonPath, "utf-8"));
@@ -18528,7 +18545,7 @@ var browser_default = app44;
18528
18545
 
18529
18546
  // server/routes/admin/calendar.ts
18530
18547
  import { existsSync as existsSync27 } from "fs";
18531
- import { join as join30 } from "path";
18548
+ import { join as join31 } from "path";
18532
18549
 
18533
18550
  // server/lib/calendar-ics.ts
18534
18551
  var CRLF = "\r\n";
@@ -18628,7 +18645,7 @@ function countVEvents(ics) {
18628
18645
 
18629
18646
  // server/lib/calendar-availability.ts
18630
18647
  import { readFileSync as readFileSync30 } from "fs";
18631
- import { join as join29 } from "path";
18648
+ import { join as join30 } from "path";
18632
18649
  var AVAILABILITY_FILENAME = "calendar-availability.json";
18633
18650
  var REQUIRED_KEYS = [
18634
18651
  "timezone",
@@ -18637,7 +18654,7 @@ var REQUIRED_KEYS = [
18637
18654
  "weekly"
18638
18655
  ];
18639
18656
  function readAvailabilityConfig(accountDir) {
18640
- const path2 = join29(accountDir, AVAILABILITY_FILENAME);
18657
+ const path2 = join30(accountDir, AVAILABILITY_FILENAME);
18641
18658
  let raw;
18642
18659
  try {
18643
18660
  raw = readFileSync30(path2, "utf-8");
@@ -18999,7 +19016,7 @@ app45.get("/booking-link", requireAdminSession, (c) => {
18999
19016
  console.error('[calendar] op=booking-link-fail err="no account configured"');
19000
19017
  return c.json({ bookingDomain: null });
19001
19018
  }
19002
- if (!existsSync27(join30(account.accountDir, AVAILABILITY_FILENAME))) {
19019
+ if (!existsSync27(join31(account.accountDir, AVAILABILITY_FILENAME))) {
19003
19020
  console.log("[calendar] op=booking-link bookingDomain=none source=availability-config");
19004
19021
  return c.json({ bookingDomain: null });
19005
19022
  }
@@ -19433,7 +19450,7 @@ var sites_default = app50;
19433
19450
  // app/lib/visitor-token.ts
19434
19451
  import { createHmac, randomBytes, timingSafeEqual } from "crypto";
19435
19452
  import { mkdirSync as mkdirSync7, readFileSync as readFileSync32, writeFileSync as writeFileSync11 } from "fs";
19436
- import { dirname as dirname10 } from "path";
19453
+ import { dirname as dirname11 } from "path";
19437
19454
  var TOKEN_PREFIX = "v1.";
19438
19455
  var SECRET_BYTES = 32;
19439
19456
  var DEFAULT_TTL_MS = 30 * 24 * 60 * 60 * 1e3;
@@ -19450,7 +19467,7 @@ function getSecret() {
19450
19467
  }
19451
19468
  const fresh = randomBytes(SECRET_BYTES).toString("hex");
19452
19469
  try {
19453
- mkdirSync7(dirname10(VISITOR_TOKEN_SECRET_FILE), { recursive: true, mode: 448 });
19470
+ mkdirSync7(dirname11(VISITOR_TOKEN_SECRET_FILE), { recursive: true, mode: 448 });
19454
19471
  writeFileSync11(VISITOR_TOKEN_SECRET_FILE, fresh, { mode: 384, flag: "wx" });
19455
19472
  console.log(`[visitor-token] secret minted path=${VISITOR_TOKEN_SECRET_FILE}`);
19456
19473
  } catch {
@@ -19509,7 +19526,7 @@ var VISITOR_COOKIE_MAX_AGE_SECONDS = Math.floor(DEFAULT_TTL_MS / 1e3);
19509
19526
 
19510
19527
  // app/lib/brand-config.ts
19511
19528
  import { existsSync as existsSync29, readFileSync as readFileSync33 } from "fs";
19512
- import { join as join31 } from "path";
19529
+ import { join as join32 } from "path";
19513
19530
  var cached = null;
19514
19531
  var cachedAttempted = false;
19515
19532
  function readBrandConfig() {
@@ -19517,7 +19534,7 @@ function readBrandConfig() {
19517
19534
  cachedAttempted = true;
19518
19535
  const platformRoot3 = process.env.MAXY_PLATFORM_ROOT;
19519
19536
  if (!platformRoot3) return null;
19520
- const brandPath = join31(platformRoot3, "config", "brand.json");
19537
+ const brandPath = join32(platformRoot3, "config", "brand.json");
19521
19538
  if (!existsSync29(brandPath)) return null;
19522
19539
  try {
19523
19540
  cached = JSON.parse(readFileSync33(brandPath, "utf-8"));
@@ -20558,7 +20575,7 @@ async function startFileWatcher(opts = {}) {
20558
20575
 
20559
20576
  // app/lib/migrate-uploads.ts
20560
20577
  import { mkdir as mkdir5, readdir as readdir5, rename as rename2, rm as rm3 } from "fs/promises";
20561
- import { dirname as dirname11, relative as relative6, resolve as resolve29 } from "path";
20578
+ import { dirname as dirname12, relative as relative6, resolve as resolve29 } from "path";
20562
20579
  var ACCOUNT_UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
20563
20580
  async function walkFiles(dir) {
20564
20581
  const out = [];
@@ -20590,7 +20607,7 @@ async function relocateTree(srcDir, destDir, dataRoot, accountId, session) {
20590
20607
  for (const oldAbs of files) {
20591
20608
  const suffix = relative6(srcDir, oldAbs);
20592
20609
  const newAbs = resolve29(destDir, suffix);
20593
- await mkdir5(dirname11(newAbs), { recursive: true });
20610
+ await mkdir5(dirname12(newAbs), { recursive: true });
20594
20611
  await rename2(oldAbs, newAbs);
20595
20612
  moved++;
20596
20613
  const oldRel = relative6(dataRoot, oldAbs);
@@ -20682,7 +20699,7 @@ async function migrateUploads(opts = {}) {
20682
20699
  // app/lib/migrate-admin-webchat-sidecars.ts
20683
20700
  import { readdir as readdir6, readFile as readFile6, rename as rename3, writeFile as writeFile4, unlink as unlink3 } from "fs/promises";
20684
20701
  import { existsSync as existsSync31 } from "fs";
20685
- import { join as join32 } from "path";
20702
+ import { join as join33 } from "path";
20686
20703
  var ADMIN_ROLE2 = "admin";
20687
20704
  var WEBCHAT_CHANNEL2 = "webchat";
20688
20705
  var SESSION_META_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.meta\.json$/i;
@@ -20727,7 +20744,7 @@ async function collectLiveSidecars(projectsRoot) {
20727
20744
  }
20728
20745
  for (const slug of slugs) {
20729
20746
  if (!slug.isDirectory()) continue;
20730
- const slugDir = join32(projectsRoot, slug.name);
20747
+ const slugDir = join33(projectsRoot, slug.name);
20731
20748
  let entries;
20732
20749
  try {
20733
20750
  entries = await readdir6(slugDir, { withFileTypes: true });
@@ -20736,9 +20753,9 @@ async function collectLiveSidecars(projectsRoot) {
20736
20753
  }
20737
20754
  for (const entry of entries) {
20738
20755
  if (entry.isFile() && SESSION_META_RE.test(entry.name)) {
20739
- out.push(join32(slugDir, entry.name));
20756
+ out.push(join33(slugDir, entry.name));
20740
20757
  } else if (entry.isDirectory() && entry.name === "subagents") {
20741
- const subDir = join32(slugDir, entry.name);
20758
+ const subDir = join33(slugDir, entry.name);
20742
20759
  let subs;
20743
20760
  try {
20744
20761
  subs = await readdir6(subDir, { withFileTypes: true });
@@ -20746,7 +20763,7 @@ async function collectLiveSidecars(projectsRoot) {
20746
20763
  continue;
20747
20764
  }
20748
20765
  for (const s of subs) {
20749
- if (s.isFile() && SESSION_META_RE.test(s.name)) out.push(join32(subDir, s.name));
20766
+ if (s.isFile() && SESSION_META_RE.test(s.name)) out.push(join33(subDir, s.name));
20750
20767
  }
20751
20768
  }
20752
20769
  }
@@ -20758,7 +20775,7 @@ function shortId(path2) {
20758
20775
  return base.slice(0, 8);
20759
20776
  }
20760
20777
  async function migrateAdminWebchatSidecars(opts = {}) {
20761
- const projectsRoot = opts.projectsRoot ?? (process.env.CLAUDE_CONFIG_DIR ? join32(process.env.CLAUDE_CONFIG_DIR, "projects") : null) ?? "";
20778
+ const projectsRoot = opts.projectsRoot ?? (process.env.CLAUDE_CONFIG_DIR ? join33(process.env.CLAUDE_CONFIG_DIR, "projects") : null) ?? "";
20762
20779
  const usersFile = opts.usersFile ?? USERS_FILE;
20763
20780
  const accountId = opts.accountId ?? resolveAccount()?.accountId ?? null;
20764
20781
  const resolveName = opts.resolveName ?? defaultResolveName;
@@ -22815,12 +22832,12 @@ function startTelegramNativeFileFollower(input) {
22815
22832
  }
22816
22833
 
22817
22834
  // server/telegram-descriptor.ts
22818
- import { resolve as resolve31, join as join33 } from "path";
22835
+ import { resolve as resolve31, join as join34 } from "path";
22819
22836
  function telegramGatewayUrl() {
22820
22837
  return `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`;
22821
22838
  }
22822
22839
  function telegramServerPath() {
22823
- return process.env.MAXY_TELEGRAM_CHANNEL_SERVER_PATH ?? resolve31(process.env.MAXY_PLATFORM_ROOT ?? join33(__dirname, ".."), "services/telegram-channel/dist/server.js");
22840
+ return process.env.MAXY_TELEGRAM_CHANNEL_SERVER_PATH ?? resolve31(process.env.MAXY_PLATFORM_ROOT ?? join34(__dirname, ".."), "services/telegram-channel/dist/server.js");
22824
22841
  }
22825
22842
 
22826
22843
  // app/lib/channel-pty-bridge/public-session-end-review.ts
@@ -23320,7 +23337,7 @@ function clientFrom(c) {
23320
23337
  );
23321
23338
  }
23322
23339
  var PLATFORM_ROOT8 = process.env.MAXY_PLATFORM_ROOT || "";
23323
- var BRAND_JSON_PATH = PLATFORM_ROOT8 ? join34(PLATFORM_ROOT8, "config", "brand.json") : "";
23340
+ var BRAND_JSON_PATH = PLATFORM_ROOT8 ? join35(PLATFORM_ROOT8, "config", "brand.json") : "";
23324
23341
  var BRAND = { productName: "Maxy", hostname: "maxy", configDir: ".maxy", marketingUrl: "https://getmaxy.com" };
23325
23342
  if (BRAND_JSON_PATH && !existsSync33(BRAND_JSON_PATH)) {
23326
23343
  console.error(`[brand] WARNING: brand.json not found at ${BRAND_JSON_PATH} \u2014 using Maxy defaults`);
@@ -23359,7 +23376,7 @@ var brandLoginOpts = {
23359
23376
  appleTouchIconPath: brandAppIcon512Path,
23360
23377
  themeColor: BRAND.defaultColors?.primary
23361
23378
  };
23362
- var ALIAS_DOMAINS_PATH = join34(homedir3(), BRAND.configDir, "alias-domains.json");
23379
+ var ALIAS_DOMAINS_PATH = join35(homedir3(), BRAND.configDir, "alias-domains.json");
23363
23380
  function loadAliasDomains() {
23364
23381
  try {
23365
23382
  if (!existsSync33(ALIAS_DOMAINS_PATH)) return null;
@@ -23391,7 +23408,7 @@ var app56 = new Hono();
23391
23408
  var nativeFileFollowers = /* @__PURE__ */ new Map();
23392
23409
  var waGateway = new WaGateway({
23393
23410
  gatewayUrl: `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`,
23394
- serverPath: process.env.MAXY_WA_CHANNEL_SERVER_PATH ?? resolve33(process.env.MAXY_PLATFORM_ROOT ?? join34(__dirname, ".."), "services/whatsapp-channel/dist/server.js"),
23411
+ serverPath: process.env.MAXY_WA_CHANNEL_SERVER_PATH ?? resolve33(process.env.MAXY_PLATFORM_ROOT ?? join35(__dirname, ".."), "services/whatsapp-channel/dist/server.js"),
23395
23412
  // Task 751 / 1390 — file delivery on the native channel. `maxyAccountId` (the
23396
23413
  // path-validation scope) is the sender's effective SESSION account, resolved
23397
23414
  // once at the inbound gate and threaded here via the gateway's per-sender doc
@@ -23406,7 +23423,7 @@ var waGateway = new WaGateway({
23406
23423
  caption,
23407
23424
  accountId,
23408
23425
  maxyAccountId,
23409
- platformRoot: resolve33(process.env.MAXY_PLATFORM_ROOT ?? join34(__dirname, ".."))
23426
+ platformRoot: resolve33(process.env.MAXY_PLATFORM_ROOT ?? join35(__dirname, ".."))
23410
23427
  });
23411
23428
  return result.ok ? { ok: true, messageId: result.messageId } : { ok: false, error: result.error };
23412
23429
  },
@@ -24048,7 +24065,7 @@ var SW_SOURCE = (() => {
24048
24065
  function readInstalledVersion() {
24049
24066
  try {
24050
24067
  if (!PLATFORM_ROOT8) return "unknown";
24051
- const versionFile = join34(PLATFORM_ROOT8, "config", `.${BRAND.hostname}-version`);
24068
+ const versionFile = join35(PLATFORM_ROOT8, "config", `.${BRAND.hostname}-version`);
24052
24069
  if (!existsSync33(versionFile)) return "unknown";
24053
24070
  const content = readFileSync35(versionFile, "utf-8").trim();
24054
24071
  return content || "unknown";
@@ -24108,11 +24125,11 @@ ${clientErrorReporterScript}
24108
24125
  return html;
24109
24126
  }
24110
24127
  function loadBrandingCache(agentSlug) {
24111
- const configDir2 = join34(homedir3(), BRAND.configDir);
24128
+ const configDir2 = join35(homedir3(), BRAND.configDir);
24112
24129
  try {
24113
24130
  const accountId = getDefaultAccountId();
24114
24131
  if (!accountId) return null;
24115
- const cachePath = join34(configDir2, "branding-cache", accountId, `${agentSlug}.json`);
24132
+ const cachePath = join35(configDir2, "branding-cache", accountId, `${agentSlug}.json`);
24116
24133
  if (!existsSync33(cachePath)) return null;
24117
24134
  return JSON.parse(readFileSync35(cachePath, "utf-8"));
24118
24135
  } catch {
@@ -24336,7 +24353,7 @@ var hostname = process.env.HOSTNAME ?? "127.0.0.1";
24336
24353
  var httpServer = serve({ fetch: app56.fetch, port, hostname });
24337
24354
  console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
24338
24355
  {
24339
- const reconcilePlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join34(__dirname, "..");
24356
+ const reconcilePlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join35(__dirname, "..");
24340
24357
  const reconcileScript = resolve33(reconcilePlatformRoot, "plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js");
24341
24358
  const RECONCILE_INTERVAL_MS = 12e4;
24342
24359
  const runReconcile = () => {
@@ -24358,7 +24375,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
24358
24375
  loop.unref();
24359
24376
  }
24360
24377
  {
24361
- const auditPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join34(__dirname, "..");
24378
+ const auditPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join35(__dirname, "..");
24362
24379
  const auditScript = resolve33(auditPlatformRoot, "plugins/connector/mcp/dist/scripts/audit-connectors.js");
24363
24380
  const auditLogDir = process.env.LOG_DIR ?? LOG_DIR;
24364
24381
  const CONNECTOR_AUDIT_INTERVAL_MS = 3e5;
@@ -24626,7 +24643,7 @@ if (bootAccountConfig?.whatsapp) {
24626
24643
  }
24627
24644
  init({
24628
24645
  configDir: configDirForWhatsApp,
24629
- platformRoot: resolve33(process.env.MAXY_PLATFORM_ROOT ?? join34(__dirname, "..")),
24646
+ platformRoot: resolve33(process.env.MAXY_PLATFORM_ROOT ?? join35(__dirname, "..")),
24630
24647
  accountConfig: bootAccountConfig,
24631
24648
  onMessage: async (msg) => {
24632
24649
  if (msg.isOwnerMirror) {