@rubytech/create-maxy-code 0.1.352 → 0.1.353

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 (43) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/package-lock.json +76 -1
  3. package/payload/platform/plugins/cloudflare/skills/calendar-site/SKILL.md +2 -2
  4. package/payload/platform/plugins/cloudflare/skills/calendar-site/template/public/booking.css +41 -0
  5. package/payload/platform/plugins/cloudflare/skills/calendar-site/template/public/booking.js +236 -47
  6. package/payload/platform/plugins/cloudflare/skills/calendar-site/template/public/index.html +6 -0
  7. package/payload/platform/plugins/connector/mcp/dist/lib/call.d.ts +27 -9
  8. package/payload/platform/plugins/connector/mcp/dist/lib/call.d.ts.map +1 -1
  9. package/payload/platform/plugins/connector/mcp/dist/lib/call.js +102 -29
  10. package/payload/platform/plugins/connector/mcp/dist/lib/call.js.map +1 -1
  11. package/payload/platform/plugins/connector/mcp/dist/lib/ssrf.d.ts +17 -6
  12. package/payload/platform/plugins/connector/mcp/dist/lib/ssrf.d.ts.map +1 -1
  13. package/payload/platform/plugins/connector/mcp/dist/lib/ssrf.js +28 -10
  14. package/payload/platform/plugins/connector/mcp/dist/lib/ssrf.js.map +1 -1
  15. package/payload/platform/plugins/connector/mcp/package.json +13 -3
  16. package/payload/server/public/assets/{AdminLoginScreens-lt72mYrz.js → AdminLoginScreens-CzdOQKyO.js} +1 -1
  17. package/payload/server/public/assets/{AdminShell-B-GeoG3j.js → AdminShell-CC-CuN6Y.js} +1 -1
  18. package/payload/server/public/assets/{Checkbox-DoGMXVpF.js → Checkbox-sQBc9xSy.js} +1 -1
  19. package/payload/server/public/assets/{OperatorConversations-CfG1EYyP.js → OperatorConversations-CA_2c3sp.js} +1 -1
  20. package/payload/server/public/assets/OperatorConversations-DPVKGsRS.css +1 -0
  21. package/payload/server/public/assets/{admin-DzLxv-nz.js → admin-qW6jM6l0.js} +1 -1
  22. package/payload/server/public/assets/{browser-Cyi6v8BS.js → browser-BsW6KaxZ.js} +1 -1
  23. package/payload/server/public/assets/calendar-BPAiN1cL.js +1 -0
  24. package/payload/server/public/assets/chat-DVD9yoVL.js +1 -0
  25. package/payload/server/public/assets/{data-CrJZjlQ1.js → data-D_cR_NCZ.js} +1 -1
  26. package/payload/server/public/assets/{graph-CutaO0w1.js → graph-CmpAy2WP.js} +1 -1
  27. package/payload/server/public/assets/{graph-labels-CH0sWvcA.js → graph-labels-C0SLq_VP.js} +1 -1
  28. package/payload/server/public/assets/{operator-MASl7IqX.js → operator-CrjtJcEY.js} +1 -1
  29. package/payload/server/public/assets/page-Cf3fVDSo.js +32 -0
  30. package/payload/server/public/assets/{public-77Ubicd7.js → public-BkNtvSYp.js} +1 -1
  31. package/payload/server/public/browser.html +4 -4
  32. package/payload/server/public/calendar.html +4 -4
  33. package/payload/server/public/chat.html +5 -5
  34. package/payload/server/public/data.html +4 -4
  35. package/payload/server/public/graph.html +6 -6
  36. package/payload/server/public/index.html +6 -6
  37. package/payload/server/public/operator.html +7 -7
  38. package/payload/server/public/public.html +5 -5
  39. package/payload/server/server.js +125 -84
  40. package/payload/server/public/assets/OperatorConversations-C8G6Gfgu.css +0 -1
  41. package/payload/server/public/assets/calendar-CA3_Dm8j.js +0 -1
  42. package/payload/server/public/assets/chat-B9aNK1FG.js +0 -1
  43. package/payload/server/public/assets/page-CZy33qUH.js +0 -30
@@ -5,14 +5,14 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Chat — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/chat-B9aNK1FG.js"></script>
8
+ <script type="module" crossorigin src="/assets/chat-DVD9yoVL.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CAM3fms7.js">
10
- <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CfG1EYyP.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-B-GeoG3j.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CA_2c3sp.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CC-CuN6Y.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/admin-types-DJoj6VJv.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-uTix4PVD.js">
14
- <link rel="modulepreload" crossorigin href="/assets/page-CZy33qUH.js">
15
- <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-C8G6Gfgu.css">
14
+ <link rel="modulepreload" crossorigin href="/assets/page-Cf3fVDSo.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-DPVKGsRS.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -5,11 +5,11 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Data — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/data-CrJZjlQ1.js"></script>
8
+ <script type="module" crossorigin src="/assets/data-D_cR_NCZ.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CAM3fms7.js">
10
- <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CfG1EYyP.js">
11
- <link rel="modulepreload" crossorigin href="/assets/graph-labels-CH0sWvcA.js">
12
- <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-C8G6Gfgu.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CA_2c3sp.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/graph-labels-C0SLq_VP.js">
12
+ <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-DPVKGsRS.css">
13
13
  </head>
14
14
  <body>
15
15
  <div id="root"></div>
@@ -5,13 +5,13 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Graph — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/graph-CutaO0w1.js"></script>
8
+ <script type="module" crossorigin src="/assets/graph-CmpAy2WP.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CAM3fms7.js">
10
- <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CfG1EYyP.js">
11
- <link rel="modulepreload" crossorigin href="/assets/graph-labels-CH0sWvcA.js">
12
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-B-GeoG3j.js">
13
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-DoGMXVpF.js">
14
- <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-C8G6Gfgu.css">
10
+ <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CA_2c3sp.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/graph-labels-C0SLq_VP.js">
12
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CC-CuN6Y.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-sQBc9xSy.js">
14
+ <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-DPVKGsRS.css">
15
15
  </head>
16
16
  <body>
17
17
  <div id="root"></div>
@@ -5,14 +5,14 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/admin-DzLxv-nz.js"></script>
8
+ <script type="module" crossorigin src="/assets/admin-qW6jM6l0.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CAM3fms7.js">
10
- <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CfG1EYyP.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-B-GeoG3j.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CA_2c3sp.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CC-CuN6Y.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/admin-types-DJoj6VJv.js">
13
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-DoGMXVpF.js">
14
- <link rel="modulepreload" crossorigin href="/assets/AdminLoginScreens-lt72mYrz.js">
15
- <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-C8G6Gfgu.css">
13
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-sQBc9xSy.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/AdminLoginScreens-CzdOQKyO.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-DPVKGsRS.css">
16
16
  <link rel="stylesheet" crossorigin href="/assets/AdminLoginScreens-CWMpccrR.css">
17
17
  <link rel="stylesheet" href="/brand-defaults.css">
18
18
  </head>
@@ -5,16 +5,16 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Operator — Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/operator-MASl7IqX.js"></script>
8
+ <script type="module" crossorigin src="/assets/operator-CrjtJcEY.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CAM3fms7.js">
10
- <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CfG1EYyP.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-B-GeoG3j.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CA_2c3sp.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CC-CuN6Y.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/admin-types-DJoj6VJv.js">
13
- <link rel="modulepreload" crossorigin href="/assets/Checkbox-DoGMXVpF.js">
14
- <link rel="modulepreload" crossorigin href="/assets/AdminLoginScreens-lt72mYrz.js">
13
+ <link rel="modulepreload" crossorigin href="/assets/Checkbox-sQBc9xSy.js">
14
+ <link rel="modulepreload" crossorigin href="/assets/AdminLoginScreens-CzdOQKyO.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-uTix4PVD.js">
16
- <link rel="modulepreload" crossorigin href="/assets/page-CZy33qUH.js">
17
- <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-C8G6Gfgu.css">
16
+ <link rel="modulepreload" crossorigin href="/assets/page-Cf3fVDSo.js">
17
+ <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-DPVKGsRS.css">
18
18
  <link rel="stylesheet" crossorigin href="/assets/AdminLoginScreens-CWMpccrR.css">
19
19
  </head>
20
20
  <body>
@@ -5,14 +5,14 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Maxy</title>
7
7
  <link rel="icon" href="/favicon.ico">
8
- <script type="module" crossorigin src="/assets/public-77Ubicd7.js"></script>
8
+ <script type="module" crossorigin src="/assets/public-BkNtvSYp.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/chunk-CAM3fms7.js">
10
- <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CfG1EYyP.js">
11
- <link rel="modulepreload" crossorigin href="/assets/AdminShell-B-GeoG3j.js">
10
+ <link rel="modulepreload" crossorigin href="/assets/OperatorConversations-CA_2c3sp.js">
11
+ <link rel="modulepreload" crossorigin href="/assets/AdminShell-CC-CuN6Y.js">
12
12
  <link rel="modulepreload" crossorigin href="/assets/admin-types-DJoj6VJv.js">
13
13
  <link rel="modulepreload" crossorigin href="/assets/preload-helper-uTix4PVD.js">
14
- <link rel="modulepreload" crossorigin href="/assets/page-CZy33qUH.js">
15
- <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-C8G6Gfgu.css">
14
+ <link rel="modulepreload" crossorigin href="/assets/page-Cf3fVDSo.js">
15
+ <link rel="stylesheet" crossorigin href="/assets/OperatorConversations-DPVKGsRS.css">
16
16
  <link rel="stylesheet" href="/brand-defaults.css">
17
17
  </head>
18
18
  <body class="public-surface">
@@ -1301,9 +1301,9 @@ var serveStatic = (options = { root: "" }) => {
1301
1301
  };
1302
1302
 
1303
1303
  // server/index.ts
1304
- import { readFileSync as readFileSync33, existsSync as existsSync31, watchFile } from "fs";
1304
+ import { readFileSync as readFileSync33, existsSync as existsSync32, watchFile } from "fs";
1305
1305
  import { spawn as spawn3 } from "child_process";
1306
- import { resolve as resolve34, join as join31, basename as basename10 } from "path";
1306
+ import { resolve as resolve34, join as join32, basename as basename10 } from "path";
1307
1307
  import { homedir as homedir3 } from "os";
1308
1308
  import { monitorEventLoopDelay } from "perf_hooks";
1309
1309
 
@@ -5173,7 +5173,8 @@ async function storeComponentArtefact(accountId, attachmentId, mimeType, content
5173
5173
  import { writeFile as writeFile3, mkdtemp, rm } from "fs/promises";
5174
5174
  import { tmpdir } from "os";
5175
5175
  import { join as join5 } from "path";
5176
- var TAG14 = "[voice]";
5176
+
5177
+ // app/lib/stt/audio-mime.ts
5177
5178
  var AUDIO_MIME_TYPES = /* @__PURE__ */ new Set([
5178
5179
  "audio/ogg",
5179
5180
  "audio/opus",
@@ -5212,6 +5213,9 @@ function audioExtension(mimeType) {
5212
5213
  return ".audio";
5213
5214
  }
5214
5215
  }
5216
+
5217
+ // app/lib/stt/voice-note.ts
5218
+ var TAG14 = "[voice]";
5215
5219
  async function transcribeVoiceNote(file, source) {
5216
5220
  const startMs = Date.now();
5217
5221
  const bytes = file.size;
@@ -17411,6 +17415,10 @@ app42.post("/launch", requireAdminSession, async (c) => {
17411
17415
  });
17412
17416
  var browser_default = app42;
17413
17417
 
17418
+ // server/routes/admin/calendar.ts
17419
+ import { existsSync as existsSync26 } from "fs";
17420
+ import { join as join28 } from "path";
17421
+
17414
17422
  // server/lib/calendar-ics.ts
17415
17423
  var CRLF = "\r\n";
17416
17424
  var PRODID = "-//Maxy//Calendar//EN";
@@ -17507,6 +17515,49 @@ function countVEvents(ics) {
17507
17515
  return count;
17508
17516
  }
17509
17517
 
17518
+ // server/lib/calendar-availability.ts
17519
+ import { readFileSync as readFileSync28 } from "fs";
17520
+ import { join as join27 } from "path";
17521
+ var AVAILABILITY_FILENAME = "calendar-availability.json";
17522
+ var REQUIRED_KEYS = [
17523
+ "timezone",
17524
+ "durationMins",
17525
+ "bufferMins",
17526
+ "weekly"
17527
+ ];
17528
+ function readAvailabilityConfig(accountDir) {
17529
+ const path2 = join27(accountDir, AVAILABILITY_FILENAME);
17530
+ let raw;
17531
+ try {
17532
+ raw = readFileSync28(path2, "utf-8");
17533
+ } catch {
17534
+ throw new Error(`availability not configured: ${path2} not found`);
17535
+ }
17536
+ let parsed;
17537
+ try {
17538
+ parsed = JSON.parse(raw);
17539
+ } catch (err) {
17540
+ throw new Error(`invalid JSON in ${path2}: ${err.message}`);
17541
+ }
17542
+ const cfg = parsed;
17543
+ for (const key of REQUIRED_KEYS) {
17544
+ if (cfg[key] === void 0 || cfg[key] === null) {
17545
+ throw new Error(`availability config ${path2} missing required key: ${key}`);
17546
+ }
17547
+ }
17548
+ if (cfg.daysAhead !== void 0 && cfg.daysAhead !== null) {
17549
+ if (typeof cfg.daysAhead !== "number" || !Number.isInteger(cfg.daysAhead) || cfg.daysAhead < 1) {
17550
+ throw new Error(`availability config ${path2} invalid daysAhead: must be a positive integer`);
17551
+ }
17552
+ }
17553
+ if (cfg.allowMultiSlot !== void 0 && cfg.allowMultiSlot !== null) {
17554
+ if (typeof cfg.allowMultiSlot !== "boolean") {
17555
+ throw new Error(`availability config ${path2} invalid allowMultiSlot: must be a boolean`);
17556
+ }
17557
+ }
17558
+ return cfg;
17559
+ }
17560
+
17510
17561
  // server/routes/admin/calendar.ts
17511
17562
  var app43 = new Hono();
17512
17563
  function normalizeAttendees(raw) {
@@ -17830,6 +17881,29 @@ app43.delete("/meetings/:id", requireAdminSession, async (c) => {
17830
17881
  await session.close();
17831
17882
  }
17832
17883
  });
17884
+ app43.get("/booking-link", requireAdminSession, (c) => {
17885
+ try {
17886
+ const account = resolveAccount();
17887
+ if (!account) {
17888
+ console.error('[calendar] op=booking-link-fail err="no account configured"');
17889
+ return c.json({ bookingDomain: null });
17890
+ }
17891
+ if (!existsSync26(join28(account.accountDir, AVAILABILITY_FILENAME))) {
17892
+ console.log("[calendar] op=booking-link bookingDomain=none source=availability-config");
17893
+ return c.json({ bookingDomain: null });
17894
+ }
17895
+ const config = readAvailabilityConfig(account.accountDir);
17896
+ const bookingDomain = typeof config.bookingDomain === "string" && config.bookingDomain.trim() ? config.bookingDomain.trim() : null;
17897
+ console.log(
17898
+ `[calendar] op=booking-link bookingDomain=${bookingDomain ?? "none"} source=availability-config`
17899
+ );
17900
+ return c.json({ bookingDomain });
17901
+ } catch (err) {
17902
+ const message = err instanceof Error ? err.message : String(err);
17903
+ console.error(`[calendar] op=booking-link-fail err="${message}"`);
17904
+ return c.json({ bookingDomain: null });
17905
+ }
17906
+ });
17833
17907
  var calendar_default = app43;
17834
17908
 
17835
17909
  // server/routes/admin/index.ts
@@ -18105,7 +18179,7 @@ app47.route("/request-magic-link", request_magic_link_default);
18105
18179
  var access_default = app47;
18106
18180
 
18107
18181
  // server/routes/sites.ts
18108
- import { existsSync as existsSync26, readFileSync as readFileSync28, realpathSync as realpathSync7, statSync as statSync11 } from "fs";
18182
+ import { existsSync as existsSync27, readFileSync as readFileSync29, realpathSync as realpathSync7, statSync as statSync11 } from "fs";
18109
18183
  import { resolve as resolve28 } from "path";
18110
18184
  var SAFE_SEG_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
18111
18185
  var MIME = {
@@ -18171,7 +18245,7 @@ app48.get("/:rel{.*}", (c) => {
18171
18245
  }
18172
18246
  let stat8;
18173
18247
  try {
18174
- stat8 = existsSync26(filePath) ? statSync11(filePath) : null;
18248
+ stat8 = existsSync27(filePath) ? statSync11(filePath) : null;
18175
18249
  } catch {
18176
18250
  stat8 = null;
18177
18251
  }
@@ -18190,7 +18264,7 @@ app48.get("/:rel{.*}", (c) => {
18190
18264
  console.error(`[sites] path-traversal-rejected path=${reqPath} reason=escape status=403`);
18191
18265
  return c.text("Forbidden", 403);
18192
18266
  }
18193
- if (!existsSync26(filePath)) {
18267
+ if (!existsSync27(filePath)) {
18194
18268
  console.error(`[sites] not-found path=${reqPath} status=404`);
18195
18269
  return c.text("Not found", 404);
18196
18270
  }
@@ -18209,7 +18283,7 @@ app48.get("/:rel{.*}", (c) => {
18209
18283
  }
18210
18284
  let body;
18211
18285
  try {
18212
- body = readFileSync28(realPath);
18286
+ body = readFileSync29(realPath);
18213
18287
  } catch (err) {
18214
18288
  const code = err?.code;
18215
18289
  if (code === "EISDIR") {
@@ -18245,7 +18319,7 @@ var sites_default = app48;
18245
18319
 
18246
18320
  // app/lib/visitor-token.ts
18247
18321
  import { createHmac, randomBytes, timingSafeEqual } from "crypto";
18248
- import { mkdirSync as mkdirSync6, readFileSync as readFileSync29, writeFileSync as writeFileSync11 } from "fs";
18322
+ import { mkdirSync as mkdirSync6, readFileSync as readFileSync30, writeFileSync as writeFileSync11 } from "fs";
18249
18323
  import { dirname as dirname7 } from "path";
18250
18324
  var TOKEN_PREFIX = "v1.";
18251
18325
  var SECRET_BYTES = 32;
@@ -18254,7 +18328,7 @@ var cachedSecret = null;
18254
18328
  function getSecret() {
18255
18329
  if (cachedSecret) return cachedSecret;
18256
18330
  try {
18257
- const hex2 = readFileSync29(VISITOR_TOKEN_SECRET_FILE, "utf-8").trim();
18331
+ const hex2 = readFileSync30(VISITOR_TOKEN_SECRET_FILE, "utf-8").trim();
18258
18332
  if (hex2.length === SECRET_BYTES * 2) {
18259
18333
  cachedSecret = Buffer.from(hex2, "hex");
18260
18334
  return cachedSecret;
@@ -18268,7 +18342,7 @@ function getSecret() {
18268
18342
  console.log(`[visitor-token] secret minted path=${VISITOR_TOKEN_SECRET_FILE}`);
18269
18343
  } catch {
18270
18344
  }
18271
- const hex = readFileSync29(VISITOR_TOKEN_SECRET_FILE, "utf-8").trim();
18345
+ const hex = readFileSync30(VISITOR_TOKEN_SECRET_FILE, "utf-8").trim();
18272
18346
  cachedSecret = Buffer.from(hex, "hex");
18273
18347
  return cachedSecret;
18274
18348
  }
@@ -18321,8 +18395,8 @@ var VISITOR_COOKIE_NAME = "mxy_v";
18321
18395
  var VISITOR_COOKIE_MAX_AGE_SECONDS = Math.floor(DEFAULT_TTL_MS / 1e3);
18322
18396
 
18323
18397
  // app/lib/brand-config.ts
18324
- import { existsSync as existsSync27, readFileSync as readFileSync30 } from "fs";
18325
- import { join as join27 } from "path";
18398
+ import { existsSync as existsSync28, readFileSync as readFileSync31 } from "fs";
18399
+ import { join as join29 } from "path";
18326
18400
  var cached2 = null;
18327
18401
  var cachedAttempted = false;
18328
18402
  function readBrandConfig() {
@@ -18330,10 +18404,10 @@ function readBrandConfig() {
18330
18404
  cachedAttempted = true;
18331
18405
  const platformRoot3 = process.env.MAXY_PLATFORM_ROOT;
18332
18406
  if (!platformRoot3) return null;
18333
- const brandPath = join27(platformRoot3, "config", "brand.json");
18334
- if (!existsSync27(brandPath)) return null;
18407
+ const brandPath = join29(platformRoot3, "config", "brand.json");
18408
+ if (!existsSync28(brandPath)) return null;
18335
18409
  try {
18336
- cached2 = JSON.parse(readFileSync30(brandPath, "utf-8"));
18410
+ cached2 = JSON.parse(readFileSync31(brandPath, "utf-8"));
18337
18411
  return cached2;
18338
18412
  } catch {
18339
18413
  return null;
@@ -18822,7 +18896,7 @@ var visitor_event_default = app51;
18822
18896
 
18823
18897
  // server/routes/session.ts
18824
18898
  import { resolve as resolve29 } from "path";
18825
- import { existsSync as existsSync28, writeFileSync as writeFileSync12, mkdirSync as mkdirSync7 } from "fs";
18899
+ import { existsSync as existsSync29, writeFileSync as writeFileSync12, mkdirSync as mkdirSync7 } from "fs";
18826
18900
  var UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
18827
18901
  function writeBrandingCache(accountId, agentSlug, branding) {
18828
18902
  try {
@@ -18906,7 +18980,7 @@ app52.post("/", async (c) => {
18906
18980
  let agentConfig = null;
18907
18981
  if (account) {
18908
18982
  const agentDir = resolve29(account.accountDir, "agents", agentSlug);
18909
- if (!existsSync28(agentDir) || !existsSync28(resolve29(agentDir, "config.json"))) {
18983
+ if (!existsSync29(agentDir) || !existsSync29(resolve29(agentDir, "config.json"))) {
18910
18984
  return c.json({ error: "Agent not found" }, 404);
18911
18985
  }
18912
18986
  agentConfig = resolveAgentConfig(account.accountDir, agentSlug);
@@ -19014,39 +19088,6 @@ app52.post("/", async (c) => {
19014
19088
  });
19015
19089
  var session_default2 = app52;
19016
19090
 
19017
- // server/lib/calendar-availability.ts
19018
- import { readFileSync as readFileSync31 } from "fs";
19019
- import { join as join28 } from "path";
19020
- var AVAILABILITY_FILENAME = "calendar-availability.json";
19021
- var REQUIRED_KEYS = [
19022
- "timezone",
19023
- "durationMins",
19024
- "bufferMins",
19025
- "weekly"
19026
- ];
19027
- function readAvailabilityConfig(accountDir) {
19028
- const path2 = join28(accountDir, AVAILABILITY_FILENAME);
19029
- let raw;
19030
- try {
19031
- raw = readFileSync31(path2, "utf-8");
19032
- } catch {
19033
- throw new Error(`availability not configured: ${path2} not found`);
19034
- }
19035
- let parsed;
19036
- try {
19037
- parsed = JSON.parse(raw);
19038
- } catch (err) {
19039
- throw new Error(`invalid JSON in ${path2}: ${err.message}`);
19040
- }
19041
- const cfg = parsed;
19042
- for (const key of REQUIRED_KEYS) {
19043
- if (cfg[key] === void 0 || cfg[key] === null) {
19044
- throw new Error(`availability config ${path2} missing required key: ${key}`);
19045
- }
19046
- }
19047
- return cfg;
19048
- }
19049
-
19050
19091
  // server/lib/calendar-slots.ts
19051
19092
  var WEEKDAYS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
19052
19093
  function tzOffsetMs(instant, timeZone) {
@@ -19527,8 +19568,8 @@ async function migrateUploads(opts = {}) {
19527
19568
 
19528
19569
  // app/lib/migrate-admin-webchat-sidecars.ts
19529
19570
  import { readdir as readdir6, readFile as readFile7, rename as rename3, writeFile as writeFile4, unlink as unlink3 } from "fs/promises";
19530
- import { existsSync as existsSync29 } from "fs";
19531
- import { join as join29 } from "path";
19571
+ import { existsSync as existsSync30 } from "fs";
19572
+ import { join as join30 } from "path";
19532
19573
  var ADMIN_ROLE2 = "admin";
19533
19574
  var WEBCHAT_CHANNEL2 = "webchat";
19534
19575
  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;
@@ -19557,7 +19598,7 @@ async function writeRaw(path2, obj) {
19557
19598
  await rename3(tmp, path2);
19558
19599
  } catch (err) {
19559
19600
  try {
19560
- if (existsSync29(tmp)) await unlink3(tmp);
19601
+ if (existsSync30(tmp)) await unlink3(tmp);
19561
19602
  } catch {
19562
19603
  }
19563
19604
  throw err;
@@ -19573,7 +19614,7 @@ async function collectLiveSidecars(projectsRoot) {
19573
19614
  }
19574
19615
  for (const slug of slugs) {
19575
19616
  if (!slug.isDirectory()) continue;
19576
- const slugDir = join29(projectsRoot, slug.name);
19617
+ const slugDir = join30(projectsRoot, slug.name);
19577
19618
  let entries;
19578
19619
  try {
19579
19620
  entries = await readdir6(slugDir, { withFileTypes: true });
@@ -19582,9 +19623,9 @@ async function collectLiveSidecars(projectsRoot) {
19582
19623
  }
19583
19624
  for (const entry of entries) {
19584
19625
  if (entry.isFile() && SESSION_META_RE.test(entry.name)) {
19585
- out.push(join29(slugDir, entry.name));
19626
+ out.push(join30(slugDir, entry.name));
19586
19627
  } else if (entry.isDirectory() && entry.name === "subagents") {
19587
- const subDir = join29(slugDir, entry.name);
19628
+ const subDir = join30(slugDir, entry.name);
19588
19629
  let subs;
19589
19630
  try {
19590
19631
  subs = await readdir6(subDir, { withFileTypes: true });
@@ -19592,7 +19633,7 @@ async function collectLiveSidecars(projectsRoot) {
19592
19633
  continue;
19593
19634
  }
19594
19635
  for (const s of subs) {
19595
- if (s.isFile() && SESSION_META_RE.test(s.name)) out.push(join29(subDir, s.name));
19636
+ if (s.isFile() && SESSION_META_RE.test(s.name)) out.push(join30(subDir, s.name));
19596
19637
  }
19597
19638
  }
19598
19639
  }
@@ -19604,7 +19645,7 @@ function shortId(path2) {
19604
19645
  return base.slice(0, 8);
19605
19646
  }
19606
19647
  async function migrateAdminWebchatSidecars(opts = {}) {
19607
- const projectsRoot = opts.projectsRoot ?? (process.env.CLAUDE_CONFIG_DIR ? join29(process.env.CLAUDE_CONFIG_DIR, "projects") : null) ?? "";
19648
+ const projectsRoot = opts.projectsRoot ?? (process.env.CLAUDE_CONFIG_DIR ? join30(process.env.CLAUDE_CONFIG_DIR, "projects") : null) ?? "";
19608
19649
  const usersFile = opts.usersFile ?? USERS_FILE;
19609
19650
  const accountId = opts.accountId ?? resolveAccount()?.accountId ?? null;
19610
19651
  const resolveName = opts.resolveName ?? defaultResolveName;
@@ -21204,12 +21245,12 @@ function startTelegramNativeFileFollower(input) {
21204
21245
  }
21205
21246
 
21206
21247
  // server/telegram-descriptor.ts
21207
- import { resolve as resolve32, join as join30 } from "path";
21248
+ import { resolve as resolve32, join as join31 } from "path";
21208
21249
  function telegramGatewayUrl() {
21209
21250
  return `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`;
21210
21251
  }
21211
21252
  function telegramServerPath() {
21212
- return process.env.MAXY_TELEGRAM_CHANNEL_SERVER_PATH ?? resolve32(process.env.MAXY_PLATFORM_ROOT ?? join30(__dirname, ".."), "services/telegram-channel/dist/server.js");
21253
+ return process.env.MAXY_TELEGRAM_CHANNEL_SERVER_PATH ?? resolve32(process.env.MAXY_PLATFORM_ROOT ?? join31(__dirname, ".."), "services/telegram-channel/dist/server.js");
21213
21254
  }
21214
21255
 
21215
21256
  // app/lib/whatsapp/inbound/channel-admin-binding-drift.ts
@@ -21277,7 +21318,7 @@ function broadcastAdminShutdown(reason) {
21277
21318
 
21278
21319
  // ../lib/entitlement/src/index.ts
21279
21320
  import { createPublicKey, createHash as createHash5, verify as cryptoVerify } from "crypto";
21280
- import { existsSync as existsSync30, readFileSync as readFileSync32, statSync as statSync12 } from "fs";
21321
+ import { existsSync as existsSync31, readFileSync as readFileSync32, statSync as statSync12 } from "fs";
21281
21322
  import { resolve as resolve33 } from "path";
21282
21323
 
21283
21324
  // ../lib/entitlement/src/canonicalize.ts
@@ -21326,7 +21367,7 @@ function resolveEntitlement(brand, account) {
21326
21367
  return logResolved(implicitTrust(account), null);
21327
21368
  }
21328
21369
  const entitlementPath = resolve33(brand.configDir, "entitlement.json");
21329
- if (!existsSync30(entitlementPath)) {
21370
+ if (!existsSync31(entitlementPath)) {
21330
21371
  return logResolved(anonymousFallback("missing"), { reason: "missing" });
21331
21372
  }
21332
21373
  const stat8 = statSync12(entitlementPath);
@@ -21516,12 +21557,12 @@ function clientFrom(c) {
21516
21557
  );
21517
21558
  }
21518
21559
  var PLATFORM_ROOT8 = process.env.MAXY_PLATFORM_ROOT || "";
21519
- var BRAND_JSON_PATH = PLATFORM_ROOT8 ? join31(PLATFORM_ROOT8, "config", "brand.json") : "";
21560
+ var BRAND_JSON_PATH = PLATFORM_ROOT8 ? join32(PLATFORM_ROOT8, "config", "brand.json") : "";
21520
21561
  var BRAND = { productName: "Maxy", hostname: "maxy", configDir: ".maxy", marketingUrl: "https://getmaxy.com" };
21521
- if (BRAND_JSON_PATH && !existsSync31(BRAND_JSON_PATH)) {
21562
+ if (BRAND_JSON_PATH && !existsSync32(BRAND_JSON_PATH)) {
21522
21563
  console.error(`[brand] WARNING: brand.json not found at ${BRAND_JSON_PATH} \u2014 using Maxy defaults`);
21523
21564
  }
21524
- if (BRAND_JSON_PATH && existsSync31(BRAND_JSON_PATH)) {
21565
+ if (BRAND_JSON_PATH && existsSync32(BRAND_JSON_PATH)) {
21525
21566
  try {
21526
21567
  const parsed = JSON.parse(readFileSync33(BRAND_JSON_PATH, "utf-8"));
21527
21568
  BRAND = { ...BRAND, ...parsed };
@@ -21555,10 +21596,10 @@ var brandLoginOpts = {
21555
21596
  appleTouchIconPath: brandAppIcon512Path,
21556
21597
  themeColor: BRAND.defaultColors?.primary
21557
21598
  };
21558
- var ALIAS_DOMAINS_PATH = join31(homedir3(), BRAND.configDir, "alias-domains.json");
21599
+ var ALIAS_DOMAINS_PATH = join32(homedir3(), BRAND.configDir, "alias-domains.json");
21559
21600
  function loadAliasDomains() {
21560
21601
  try {
21561
- if (!existsSync31(ALIAS_DOMAINS_PATH)) return null;
21602
+ if (!existsSync32(ALIAS_DOMAINS_PATH)) return null;
21562
21603
  const parsed = JSON.parse(readFileSync33(ALIAS_DOMAINS_PATH, "utf-8"));
21563
21604
  if (!Array.isArray(parsed)) {
21564
21605
  console.error("[alias-domains] malformed alias-domains.json \u2014 expected array");
@@ -21587,7 +21628,7 @@ var app54 = new Hono();
21587
21628
  var nativeFileFollowers = /* @__PURE__ */ new Map();
21588
21629
  var waGateway = new WaGateway({
21589
21630
  gatewayUrl: `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`,
21590
- serverPath: process.env.MAXY_WA_CHANNEL_SERVER_PATH ?? resolve34(process.env.MAXY_PLATFORM_ROOT ?? join31(__dirname, ".."), "services/whatsapp-channel/dist/server.js"),
21631
+ serverPath: process.env.MAXY_WA_CHANNEL_SERVER_PATH ?? resolve34(process.env.MAXY_PLATFORM_ROOT ?? join32(__dirname, ".."), "services/whatsapp-channel/dist/server.js"),
21591
21632
  // Task 751 — file delivery on the native channel: resolve the platform
21592
21633
  // account + path validation here and funnel through the shared send core.
21593
21634
  sendDocument: async ({ senderId, accountId, filePath, caption }) => {
@@ -21603,7 +21644,7 @@ var waGateway = new WaGateway({
21603
21644
  caption,
21604
21645
  accountId,
21605
21646
  maxyAccountId,
21606
- platformRoot: resolve34(process.env.MAXY_PLATFORM_ROOT ?? join31(__dirname, ".."))
21647
+ platformRoot: resolve34(process.env.MAXY_PLATFORM_ROOT ?? join32(__dirname, ".."))
21607
21648
  });
21608
21649
  return result.ok ? { ok: true, messageId: result.messageId } : { ok: false, error: result.error };
21609
21650
  },
@@ -22115,7 +22156,7 @@ app54.get("/agent-assets/:slug/:filename", (c) => {
22115
22156
  console.error(`[agent-assets] path-traversal-rejected slug=${slug} file=${filename}`);
22116
22157
  return c.text("Forbidden", 403);
22117
22158
  }
22118
- if (!existsSync31(filePath)) {
22159
+ if (!existsSync32(filePath)) {
22119
22160
  console.error(`[agent-assets] serve slug=${slug} file=${filename} status=404`);
22120
22161
  return c.text("Not found", 404);
22121
22162
  }
@@ -22145,7 +22186,7 @@ app54.get("/generated/:filename", (c) => {
22145
22186
  console.error(`[generated] serve file=${filename} status=403`);
22146
22187
  return c.text("Forbidden", 403);
22147
22188
  }
22148
- if (!existsSync31(filePath)) {
22189
+ if (!existsSync32(filePath)) {
22149
22190
  console.error(`[generated] serve file=${filename} status=404`);
22150
22191
  return c.text("Not found", 404);
22151
22192
  }
@@ -22165,7 +22206,7 @@ app54.route("/v", visitor_consent_default);
22165
22206
  var htmlCache = /* @__PURE__ */ new Map();
22166
22207
  var brandLogoPath = "/brand/maxy-monochrome.png";
22167
22208
  var brandIconPath = "/brand/maxy-monochrome.png";
22168
- if (BRAND_JSON_PATH && existsSync31(BRAND_JSON_PATH)) {
22209
+ if (BRAND_JSON_PATH && existsSync32(BRAND_JSON_PATH)) {
22169
22210
  try {
22170
22211
  const fullBrand = JSON.parse(readFileSync33(BRAND_JSON_PATH, "utf-8"));
22171
22212
  if (fullBrand.assets?.logo) brandLogoPath = `/brand/${fullBrand.assets.logo}`;
@@ -22194,7 +22235,7 @@ var brandScript = `<script>window.__BRAND__=${JSON.stringify({
22194
22235
  var brandThemeColor = BRAND.defaultColors?.primary ?? "#000000";
22195
22236
  var brandBackgroundColor = BRAND.defaultColors?.background ?? "#ffffff";
22196
22237
  var brandAppIconsExist = [brandAppIcon192Path, brandAppIcon512Path, brandMaskableIconPath].every(
22197
- (p) => existsSync31(resolve34(process.cwd(), "public", p.replace(/^\//, "")))
22238
+ (p) => existsSync32(resolve34(process.cwd(), "public", p.replace(/^\//, "")))
22198
22239
  );
22199
22240
  var SW_SOURCE = (() => {
22200
22241
  try {
@@ -22206,8 +22247,8 @@ var SW_SOURCE = (() => {
22206
22247
  function readInstalledVersion() {
22207
22248
  try {
22208
22249
  if (!PLATFORM_ROOT8) return "unknown";
22209
- const versionFile = join31(PLATFORM_ROOT8, "config", `.${BRAND.hostname}-version`);
22210
- if (!existsSync31(versionFile)) return "unknown";
22250
+ const versionFile = join32(PLATFORM_ROOT8, "config", `.${BRAND.hostname}-version`);
22251
+ if (!existsSync32(versionFile)) return "unknown";
22211
22252
  const content = readFileSync33(versionFile, "utf-8").trim();
22212
22253
  return content || "unknown";
22213
22254
  } catch {
@@ -22266,12 +22307,12 @@ ${clientErrorReporterScript}
22266
22307
  return html;
22267
22308
  }
22268
22309
  function loadBrandingCache(agentSlug) {
22269
- const configDir2 = join31(homedir3(), BRAND.configDir);
22310
+ const configDir2 = join32(homedir3(), BRAND.configDir);
22270
22311
  try {
22271
22312
  const accountId = getDefaultAccountId();
22272
22313
  if (!accountId) return null;
22273
- const cachePath = join31(configDir2, "branding-cache", accountId, `${agentSlug}.json`);
22274
- if (!existsSync31(cachePath)) return null;
22314
+ const cachePath = join32(configDir2, "branding-cache", accountId, `${agentSlug}.json`);
22315
+ if (!existsSync32(cachePath)) return null;
22275
22316
  return JSON.parse(readFileSync33(cachePath, "utf-8"));
22276
22317
  } catch {
22277
22318
  return null;
@@ -22490,11 +22531,11 @@ var hostname = process.env.HOSTNAME ?? "127.0.0.1";
22490
22531
  var httpServer = serve({ fetch: app54.fetch, port, hostname });
22491
22532
  console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
22492
22533
  {
22493
- const reconcilePlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join31(__dirname, "..");
22534
+ const reconcilePlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join32(__dirname, "..");
22494
22535
  const reconcileScript = resolve34(reconcilePlatformRoot, "plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js");
22495
22536
  const RECONCILE_INTERVAL_MS = 12e4;
22496
22537
  const runReconcile = () => {
22497
- if (!existsSync31(reconcileScript)) return;
22538
+ if (!existsSync32(reconcileScript)) return;
22498
22539
  try {
22499
22540
  const child = spawn3(process.execPath, [reconcileScript], {
22500
22541
  env: { ...process.env, PLATFORM_ROOT: reconcilePlatformRoot },
@@ -22512,12 +22553,12 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
22512
22553
  loop.unref();
22513
22554
  }
22514
22555
  {
22515
- const auditPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join31(__dirname, "..");
22556
+ const auditPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join32(__dirname, "..");
22516
22557
  const auditScript = resolve34(auditPlatformRoot, "plugins/connector/mcp/dist/scripts/audit-connectors.js");
22517
22558
  const auditLogDir = process.env.LOG_DIR ?? LOG_DIR;
22518
22559
  const CONNECTOR_AUDIT_INTERVAL_MS = 3e5;
22519
22560
  const runConnectorAudit = () => {
22520
- if (!existsSync31(auditScript)) return;
22561
+ if (!existsSync32(auditScript)) return;
22521
22562
  try {
22522
22563
  const child = spawn3(process.execPath, [auditScript], {
22523
22564
  env: { ...process.env, PLATFORM_ROOT: auditPlatformRoot, LOG_DIR: auditLogDir },
@@ -22627,7 +22668,7 @@ try {
22627
22668
  var ADMINUSER_RECONCILE_INTERVAL_MS = 60 * 60 * 1e3;
22628
22669
  async function runAdminUserReconcileTick() {
22629
22670
  try {
22630
- if (!existsSync31(USERS_FILE)) {
22671
+ if (!existsSync32(USERS_FILE)) {
22631
22672
  console.error("[adminuser-self-heal] skip reason=no-users-file");
22632
22673
  return;
22633
22674
  }
@@ -22745,7 +22786,7 @@ if (bootAccountConfig?.whatsapp) {
22745
22786
  }
22746
22787
  init({
22747
22788
  configDir: configDirForWhatsApp,
22748
- platformRoot: resolve34(process.env.MAXY_PLATFORM_ROOT ?? join31(__dirname, "..")),
22789
+ platformRoot: resolve34(process.env.MAXY_PLATFORM_ROOT ?? join32(__dirname, "..")),
22749
22790
  accountConfig: bootAccountConfig,
22750
22791
  onMessage: async (msg) => {
22751
22792
  if (msg.isOwnerMirror) {