@rubytech/create-maxy 1.0.794 → 1.0.796

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 (69) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/neo4j/migrations/003-person-name-eradicate.cypher +24 -0
  3. package/payload/platform/plugins/admin/hooks/__tests__/archive-ingest-gate.test.sh +166 -0
  4. package/payload/platform/plugins/admin/hooks/archive-ingest-gate.sh +147 -0
  5. package/payload/platform/plugins/docs/references/internals.md +4 -0
  6. package/payload/platform/plugins/linkedin-import/skills/linkedin-import/SKILL.md +2 -0
  7. package/payload/platform/plugins/memory/PLUGIN.md +4 -2
  8. package/payload/platform/plugins/memory/mcp/dist/index.js +2 -2
  9. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  10. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js +11 -0
  11. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js.map +1 -1
  12. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +124 -1
  13. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -1
  14. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts +12 -0
  15. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts.map +1 -1
  16. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js +41 -2
  17. package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js.map +1 -1
  18. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts +9 -0
  19. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts.map +1 -1
  20. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js +44 -0
  21. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js.map +1 -1
  22. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js +20 -2
  23. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js.map +1 -1
  24. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts +1 -1
  25. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts.map +1 -1
  26. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js +0 -1
  27. package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -1
  28. package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.d.ts +2 -1
  29. package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.d.ts.map +1 -1
  30. package/payload/platform/plugins/memory/mcp/dist/tools/whatsapp-export-parse.js.map +1 -1
  31. package/payload/platform/plugins/memory/references/schema-base.md +11 -1
  32. package/payload/platform/plugins/whatsapp-import/PLUGIN.md +4 -0
  33. package/payload/platform/plugins/whatsapp-import/lib/dist/parse-export.d.ts +8 -2
  34. package/payload/platform/plugins/whatsapp-import/lib/dist/parse-export.d.ts.map +1 -1
  35. package/payload/platform/plugins/whatsapp-import/lib/dist/parse-export.js +66 -15
  36. package/payload/platform/plugins/whatsapp-import/lib/dist/parse-export.js.map +1 -1
  37. package/payload/platform/plugins/whatsapp-import/lib/src/__tests__/parse-export.test.ts +175 -0
  38. package/payload/platform/plugins/whatsapp-import/lib/src/parse-export.ts +78 -17
  39. package/payload/platform/plugins/whatsapp-import/skills/whatsapp-import/SKILL.md +2 -0
  40. package/payload/platform/plugins/whatsapp-import/skills/whatsapp-import/references/export-parse.md +8 -6
  41. package/payload/platform/scripts/seed-neo4j.sh +43 -20
  42. package/payload/platform/templates/specialists/agents/database-operator.md +2 -0
  43. package/payload/server/chunk-BURNRCKP.js +3405 -0
  44. package/payload/server/chunk-JSBRDJBE.js +30 -0
  45. package/payload/server/chunk-KM23Y7SY.js +9896 -0
  46. package/payload/server/client-pool-PV45NUTN.js +29 -0
  47. package/payload/server/maxy-edge.js +3 -2
  48. package/payload/server/neo4j-migrations-IUSBODOP.js +51 -0
  49. package/payload/server/public/assets/{Checkbox-DHsoNPeM.js → Checkbox-BruL6MSR.js} +1 -1
  50. package/payload/server/public/assets/{admin-DEhQ1wNO.js → admin-StzFnTQB.js} +60 -60
  51. package/payload/server/public/assets/data-BvV94XHO.js +1 -0
  52. package/payload/server/public/assets/graph-BOKpKqLw.js +1 -0
  53. package/payload/server/public/assets/{jsx-runtime-lOmSwjvd.css → jsx-runtime-foO6ZMix.css} +1 -1
  54. package/payload/server/public/assets/page-DItB4skl.js +50 -0
  55. package/payload/server/public/assets/page-DM19J3ur.js +1 -0
  56. package/payload/server/public/assets/{public-Bn-gEWOv.js → public-CfjzDdUe.js} +1 -1
  57. package/payload/server/public/assets/useAdminFetch-iYCQ9lT0.js +1 -0
  58. package/payload/server/public/assets/{useVoiceRecorder-B1S_t3Hq.js → useVoiceRecorder-D_8P7xJU.js} +1 -1
  59. package/payload/server/public/data.html +5 -5
  60. package/payload/server/public/graph.html +6 -6
  61. package/payload/server/public/index.html +8 -8
  62. package/payload/server/public/public.html +5 -5
  63. package/payload/server/server.js +99 -131
  64. package/payload/server/public/assets/data-bIkywng-.js +0 -1
  65. package/payload/server/public/assets/graph-DwzwJvlu.js +0 -1
  66. package/payload/server/public/assets/page-BuoQU1c6.js +0 -50
  67. package/payload/server/public/assets/page-DU8F3OGU.js +0 -1
  68. package/payload/server/public/assets/share-2-0IDKUUq9.js +0 -1
  69. /package/payload/server/public/assets/{jsx-runtime-Br2bU3EJ.js → jsx-runtime-DJER3a7U.js} +0 -0
@@ -49,14 +49,12 @@ import {
49
49
  vncLog,
50
50
  waitForExit,
51
51
  writeChromiumWrapper
52
- } from "./chunk-3SQJW5Y5.js";
52
+ } from "./chunk-KM23Y7SY.js";
53
53
  import {
54
54
  ACCOUNTS_DIR,
55
55
  GREETING_DIRECTIVE,
56
56
  HAIKU_MODEL,
57
57
  PLATFORM_ROOT,
58
- __commonJS,
59
- __toESM,
60
58
  agentLogStream,
61
59
  backfillNullUserIdConversations,
62
60
  bindVisitorToGroup,
@@ -103,6 +101,7 @@ import {
103
101
  resolveAgentConfig,
104
102
  resolveDefaultAgentSlug,
105
103
  resolveUserAccounts,
104
+ runBootMigrations,
106
105
  setAgentSessionId,
107
106
  setConversationIdForSession,
108
107
  setGroupContextForSession,
@@ -113,7 +112,11 @@ import {
113
112
  verifyAndGetConversationUpdatedAt,
114
113
  verifyConversationOwnership,
115
114
  writeAdminUserAndPerson
116
- } from "./chunk-2N7XJW6Q.js";
115
+ } from "./chunk-BURNRCKP.js";
116
+ import {
117
+ __commonJS,
118
+ __toESM
119
+ } from "./chunk-JSBRDJBE.js";
117
120
 
118
121
  // ../lib/graph-trash/dist/index.js
119
122
  var require_dist = __commonJS({
@@ -4726,7 +4729,7 @@ app2.post("/", async (c) => {
4726
4729
  }
4727
4730
  const cookieHeader = c.req.header("cookie");
4728
4731
  if (body.session_key && typeof body.session_key === "string") {
4729
- if (validateSession(body.session_key, "public")) {
4732
+ if (validateSession(body.session_key, "public").ok) {
4730
4733
  const storedAgent = getAgentNameForSession(body.session_key);
4731
4734
  if (storedAgent && storedAgent !== agentSlug) {
4732
4735
  console.log(`[session] hot-resume agent mismatch: session=${body.session_key.slice(0, 8)}\u2026 has=${storedAgent} requested=${agentSlug} \u2014 creating new session`);
@@ -5414,7 +5417,7 @@ app3.post("/", async (c) => {
5414
5417
  if (!session_key) {
5415
5418
  return c.json({ error: "session_key required" }, 400);
5416
5419
  }
5417
- if (!validateSession(session_key, "public")) {
5420
+ if (!validateSession(session_key, "public").ok) {
5418
5421
  return c.json({ error: "Invalid or expired session" }, 401);
5419
5422
  }
5420
5423
  const files = formData.getAll("attachments");
@@ -5483,7 +5486,7 @@ app3.post("/", async (c) => {
5483
5486
  if (!message) {
5484
5487
  return c.json({ error: "message required" }, 400);
5485
5488
  }
5486
- if (!validateSession(session_key, "public")) {
5489
+ if (!validateSession(session_key, "public").ok) {
5487
5490
  return c.json({ error: "Invalid or expired session" }, 401);
5488
5491
  }
5489
5492
  }
@@ -5623,7 +5626,7 @@ app4.get("/messages", async (c) => {
5623
5626
  if (isNaN(sinceDate.getTime())) {
5624
5627
  return c.json({ error: "Invalid since parameter \u2014 expected ISO 8601" }, 400);
5625
5628
  }
5626
- if (!validateSession(sessionKey, "public")) {
5629
+ if (!validateSession(sessionKey, "public").ok) {
5627
5630
  return c.json({ error: "Session expired" }, 401);
5628
5631
  }
5629
5632
  const groupSlug = getGroupSlugForSession(sessionKey);
@@ -6247,7 +6250,7 @@ app5.post("/create-credentials", async (c) => {
6247
6250
  const { session_key, password } = body;
6248
6251
  if (!session_key || typeof session_key !== "string") return c.json({ error: "session_key required" }, 400);
6249
6252
  if (!password || typeof password !== "string") return c.json({ error: "password required" }, 400);
6250
- if (!validateSession(session_key, "public")) {
6253
+ if (!validateSession(session_key, "public").ok) {
6251
6254
  return c.json({ error: "Invalid or expired session" }, 401);
6252
6255
  }
6253
6256
  const grant = getGrantForSession(session_key);
@@ -7813,7 +7816,7 @@ async function createAdminSession(accountId, thinkingView, userId, userName, rol
7813
7816
  var app10 = new Hono();
7814
7817
  app10.get("/", async (c) => {
7815
7818
  const sessionKey = c.req.query("session_key");
7816
- if (!sessionKey || !validateSession(sessionKey, "admin")) {
7819
+ if (!sessionKey || !validateSession(sessionKey, "admin").ok) {
7817
7820
  return c.json({ error: "Invalid or expired admin session" }, 401);
7818
7821
  }
7819
7822
  const accountId = getAccountIdForSession(sessionKey);
@@ -8210,7 +8213,7 @@ var app11 = new Hono();
8210
8213
  app11.post("/cancel", requireAdminSession, async (c) => {
8211
8214
  const session_key = c.var.sessionKey;
8212
8215
  try {
8213
- const { interruptClient: interruptClient2 } = await import("./client-pool-CTMWNDMO.js");
8216
+ const { interruptClient: interruptClient2 } = await import("./client-pool-PV45NUTN.js");
8214
8217
  await interruptClient2(session_key);
8215
8218
  return c.json({ ok: true });
8216
8219
  } catch (err) {
@@ -11782,57 +11785,16 @@ app30.get("/", requireAdminSession, async (c) => {
11782
11785
  });
11783
11786
  var adherence_default = app30;
11784
11787
 
11785
- // server/routes/admin/sidebar-projects.ts
11786
- import neo4j3 from "neo4j-driver";
11787
- var LIMIT = 50;
11788
- var app31 = new Hono();
11789
- app31.get("/", requireAdminSession, async (c) => {
11790
- const sessionKey = c.var.sessionKey;
11791
- const accountId = getAccountIdForSession(sessionKey);
11792
- if (!accountId) {
11793
- return c.json({ error: "Account not found for session" }, 401);
11794
- }
11795
- const start = Date.now();
11796
- const session = getSession();
11797
- try {
11798
- const result = await session.run(
11799
- `MATCH (p:Project { accountId: $accountId })
11800
- WHERE NOT p:Trashed
11801
- RETURN p.taskId AS id, elementId(p) AS elementId, p.name AS name, p.updatedAt AS updatedAt
11802
- ORDER BY p.updatedAt DESC
11803
- LIMIT $limit`,
11804
- { accountId, limit: neo4j3.int(LIMIT) }
11805
- );
11806
- const projects = result.records.map((r) => ({
11807
- id: r.get("id"),
11808
- elementId: r.get("elementId"),
11809
- name: r.get("name") ?? "",
11810
- updatedAt: r.get("updatedAt") ?? ""
11811
- }));
11812
- const ms = Date.now() - start;
11813
- console.log(`[admin/sidebar-projects] account=${accountId} count=${projects.length} ms=${ms}`);
11814
- return c.json({ projects });
11815
- } catch (err) {
11816
- const ms = Date.now() - start;
11817
- const message = err instanceof Error ? err.message : String(err);
11818
- console.error(`[admin/sidebar-projects] account=${accountId} error="${message}" ms=${ms}`);
11819
- return c.json({ error: "Failed to load projects" }, 500);
11820
- } finally {
11821
- await session.close();
11822
- }
11823
- });
11824
- var sidebar_projects_default = app31;
11825
-
11826
11788
  // server/routes/admin/sidebar-artefacts.ts
11827
- import neo4j4 from "neo4j-driver";
11789
+ import neo4j3 from "neo4j-driver";
11828
11790
  import { readFile as readFile5, readdir as readdir3, stat as stat5 } from "fs/promises";
11829
11791
  import { resolve as resolve20, relative as relative2, isAbsolute } from "path";
11830
11792
  import { existsSync as existsSync19 } from "fs";
11831
- var LIMIT2 = 50;
11793
+ var LIMIT = 50;
11832
11794
  var TEXT_MIME_PREFIXES = ["text/", "application/json", "application/markdown"];
11833
11795
  var ADMIN_AGENT_FILES = ["IDENTITY.md", "SOUL.md", "KNOWLEDGE.md"];
11834
- var app32 = new Hono();
11835
- app32.get("/", requireAdminSession, async (c) => {
11796
+ var app31 = new Hono();
11797
+ app31.get("/", requireAdminSession, async (c) => {
11836
11798
  const sessionKey = c.var.sessionKey;
11837
11799
  const accountId = getAccountIdForSession(sessionKey);
11838
11800
  if (!accountId) {
@@ -11847,7 +11809,7 @@ app32.get("/", requireAdminSession, async (c) => {
11847
11809
  const agents = await fetchAgentTemplateRows(accountDir);
11848
11810
  const artefacts = [...docs, ...agents].sort(
11849
11811
  (a, b) => (b.updatedAt ?? "").localeCompare(a.updatedAt ?? "")
11850
- ).slice(0, LIMIT2);
11812
+ ).slice(0, LIMIT);
11851
11813
  const ms = Date.now() - start;
11852
11814
  console.log(
11853
11815
  `[admin/sidebar-artefacts] account=${accountId} count=${artefacts.length} docs=${docs.length} agents=${agents.length} ms=${ms}`
@@ -11865,7 +11827,7 @@ async function fetchKnowledgeDocs(accountId) {
11865
11827
  d.attachmentId AS attachmentId, d.encodingFormat AS mimeType
11866
11828
  ORDER BY d.updatedAt DESC
11867
11829
  LIMIT $limit`,
11868
- { accountId, limit: neo4j4.int(LIMIT2) }
11830
+ { accountId, limit: neo4j3.int(LIMIT) }
11869
11831
  );
11870
11832
  metas = result.records.map((r) => ({
11871
11833
  id: r.get("id"),
@@ -12038,7 +12000,7 @@ function isWithin(target, root) {
12038
12000
  const rel = relative2(root, target);
12039
12001
  return !rel.startsWith("..") && !isAbsolute(rel);
12040
12002
  }
12041
- var sidebar_artefacts_default = app32;
12003
+ var sidebar_artefacts_default = app31;
12042
12004
 
12043
12005
  // server/routes/admin/sidebar-artefact-save.ts
12044
12006
  import { mkdir as mkdir4, readdir as readdir4, stat as stat6, writeFile as writeFile5 } from "fs/promises";
@@ -12046,8 +12008,8 @@ import { resolve as resolve21 } from "path";
12046
12008
  import { existsSync as existsSync20 } from "fs";
12047
12009
  var ADMIN_AGENT_FILES2 = /* @__PURE__ */ new Set(["IDENTITY.md", "SOUL.md", "KNOWLEDGE.md"]);
12048
12010
  var UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
12049
- var app33 = new Hono();
12050
- app33.post("/", requireAdminSession, async (c) => {
12011
+ var app32 = new Hono();
12012
+ app32.post("/", requireAdminSession, async (c) => {
12051
12013
  const sessionKey = c.var.sessionKey;
12052
12014
  const accountId = getAccountIdForSession(sessionKey);
12053
12015
  if (!accountId) return c.json({ error: "Account not found for session" }, 401);
@@ -12127,15 +12089,15 @@ async function resolveSavePath(id, accountId, accountDir) {
12127
12089
  function relPath(absPath, root) {
12128
12090
  return absPath.startsWith(root) ? absPath.slice(root.length + 1) : absPath;
12129
12091
  }
12130
- var sidebar_artefact_save_default = app33;
12092
+ var sidebar_artefact_save_default = app32;
12131
12093
 
12132
12094
  // server/routes/admin/sidebar-artefact-content.ts
12133
12095
  import { readFile as readFile6, readdir as readdir5 } from "fs/promises";
12134
12096
  import { existsSync as existsSync21 } from "fs";
12135
12097
  import { resolve as resolve22 } from "path";
12136
12098
  var UUID_RE5 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
12137
- var app34 = new Hono();
12138
- app34.get("/", requireAdminSession, async (c) => {
12099
+ var app33 = new Hono();
12100
+ app33.get("/", requireAdminSession, async (c) => {
12139
12101
  const sessionKey = c.var.sessionKey;
12140
12102
  const accountId = getAccountIdForSession(sessionKey);
12141
12103
  if (!accountId) return new Response("Unauthorized", { status: 401 });
@@ -12176,36 +12138,35 @@ app34.get("/", requireAdminSession, async (c) => {
12176
12138
  }
12177
12139
  });
12178
12140
  });
12179
- var sidebar_artefact_content_default = app34;
12141
+ var sidebar_artefact_content_default = app33;
12180
12142
 
12181
12143
  // server/routes/admin/index.ts
12182
- var app35 = new Hono();
12183
- app35.route("/session", session_default2);
12184
- app35.route("/chat", chat_default2);
12185
- app35.route("/compact", compact_default);
12186
- app35.route("/logs", logs_default);
12187
- app35.route("/claude-info", claude_info_default);
12188
- app35.route("/attachment", attachment_default);
12189
- app35.route("/agents", agents_default);
12190
- app35.route("/sessions", sessions_default);
12191
- app35.route("/browser", browser_default);
12192
- app35.route("/device-browser", device_browser_default);
12193
- app35.route("/events", events_default);
12194
- app35.route("/cloudflare", cloudflare_default);
12195
- app35.route("/files", files_default);
12196
- app35.route("/graph-search", graph_search_default);
12197
- app35.route("/graph-subgraph", graph_subgraph_default);
12198
- app35.route("/graph-delete", graph_delete_default);
12199
- app35.route("/graph-restore", graph_restore_default);
12200
- app35.route("/graph-labels-in-graph", graph_labels_in_graph_default);
12201
- app35.route("/graph-default-view", graph_default_view_default);
12202
- app35.route("/file-attach", file_attach_default);
12203
- app35.route("/adherence", adherence_default);
12204
- app35.route("/sidebar-projects", sidebar_projects_default);
12205
- app35.route("/sidebar-artefacts", sidebar_artefacts_default);
12206
- app35.route("/sidebar-artefact-save", sidebar_artefact_save_default);
12207
- app35.route("/sidebar-artefact-content", sidebar_artefact_content_default);
12208
- var admin_default = app35;
12144
+ var app34 = new Hono();
12145
+ app34.route("/session", session_default2);
12146
+ app34.route("/chat", chat_default2);
12147
+ app34.route("/compact", compact_default);
12148
+ app34.route("/logs", logs_default);
12149
+ app34.route("/claude-info", claude_info_default);
12150
+ app34.route("/attachment", attachment_default);
12151
+ app34.route("/agents", agents_default);
12152
+ app34.route("/sessions", sessions_default);
12153
+ app34.route("/browser", browser_default);
12154
+ app34.route("/device-browser", device_browser_default);
12155
+ app34.route("/events", events_default);
12156
+ app34.route("/cloudflare", cloudflare_default);
12157
+ app34.route("/files", files_default);
12158
+ app34.route("/graph-search", graph_search_default);
12159
+ app34.route("/graph-subgraph", graph_subgraph_default);
12160
+ app34.route("/graph-delete", graph_delete_default);
12161
+ app34.route("/graph-restore", graph_restore_default);
12162
+ app34.route("/graph-labels-in-graph", graph_labels_in_graph_default);
12163
+ app34.route("/graph-default-view", graph_default_view_default);
12164
+ app34.route("/file-attach", file_attach_default);
12165
+ app34.route("/adherence", adherence_default);
12166
+ app34.route("/sidebar-artefacts", sidebar_artefacts_default);
12167
+ app34.route("/sidebar-artefact-save", sidebar_artefact_save_default);
12168
+ app34.route("/sidebar-artefact-content", sidebar_artefact_content_default);
12169
+ var admin_default = app34;
12209
12170
 
12210
12171
  // app/lib/graph-health.ts
12211
12172
  var HOUR_MS = 60 * 60 * 1e3;
@@ -12359,9 +12320,9 @@ watchFile(ALIAS_DOMAINS_PATH2, { interval: 2e3 }, () => {
12359
12320
  function isPublicHost(host) {
12360
12321
  return host.startsWith("public.") || aliasDomains.has(host);
12361
12322
  }
12362
- var app36 = new Hono();
12363
- app36.use("*", clientIpMiddleware);
12364
- app36.use("*", async (c, next) => {
12323
+ var app35 = new Hono();
12324
+ app35.use("*", clientIpMiddleware);
12325
+ app35.use("*", async (c, next) => {
12365
12326
  await next();
12366
12327
  c.header("X-Content-Type-Options", "nosniff");
12367
12328
  c.header("Referrer-Policy", "strict-origin-when-cross-origin");
@@ -12384,7 +12345,7 @@ var PUBLIC_ALLOWED_PREFIXES = [
12384
12345
  "/g/"
12385
12346
  ];
12386
12347
  var PUBLIC_ALLOWED_EXACT = ["/favicon.ico"];
12387
- app36.use("*", async (c, next) => {
12348
+ app35.use("*", async (c, next) => {
12388
12349
  const host = (c.req.header("host") ?? "").split(":")[0];
12389
12350
  if (!isPublicHost(host)) {
12390
12351
  await next();
@@ -12424,7 +12385,7 @@ function resolveRemoteAuthOpts() {
12424
12385
  return brandLoginOpts;
12425
12386
  }
12426
12387
  var MAX_LOGIN_BODY = 8 * 1024;
12427
- app36.post("/__remote-auth/login", async (c) => {
12388
+ app35.post("/__remote-auth/login", async (c) => {
12428
12389
  const client = clientFrom(c);
12429
12390
  const clientIp = client.ip || "unknown";
12430
12391
  if (!requestIsTlsTerminated(c)) {
@@ -12468,7 +12429,7 @@ app36.post("/__remote-auth/login", async (c) => {
12468
12429
  }
12469
12430
  });
12470
12431
  });
12471
- app36.get("/__remote-auth/logout", (c) => {
12432
+ app35.get("/__remote-auth/logout", (c) => {
12472
12433
  return new Response(null, {
12473
12434
  status: 302,
12474
12435
  headers: {
@@ -12478,7 +12439,7 @@ app36.get("/__remote-auth/logout", (c) => {
12478
12439
  }
12479
12440
  });
12480
12441
  });
12481
- app36.post("/__remote-auth/change-password", async (c) => {
12442
+ app35.post("/__remote-auth/change-password", async (c) => {
12482
12443
  const client = clientFrom(c);
12483
12444
  const clientIp = client.ip || "unknown";
12484
12445
  const rateLimited = checkRateLimit(client);
@@ -12528,13 +12489,13 @@ app36.post("/__remote-auth/change-password", async (c) => {
12528
12489
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "change", changeError: "Failed to save password", redirect }), 200);
12529
12490
  }
12530
12491
  });
12531
- app36.get("/__remote-auth/setup", (c) => {
12492
+ app35.get("/__remote-auth/setup", (c) => {
12532
12493
  if (isRemoteAuthConfigured()) {
12533
12494
  return c.redirect("/");
12534
12495
  }
12535
12496
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup" }), 200);
12536
12497
  });
12537
- app36.post("/__remote-auth/set-initial-password", async (c) => {
12498
+ app35.post("/__remote-auth/set-initial-password", async (c) => {
12538
12499
  if (isRemoteAuthConfigured()) {
12539
12500
  return c.redirect("/");
12540
12501
  }
@@ -12570,17 +12531,17 @@ app36.post("/__remote-auth/set-initial-password", async (c) => {
12570
12531
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
12571
12532
  }
12572
12533
  });
12573
- app36.get("/api/remote-auth/status", (c) => {
12534
+ app35.get("/api/remote-auth/status", (c) => {
12574
12535
  return c.json({ configured: isRemoteAuthConfigured() });
12575
12536
  });
12576
- app36.post("/api/remote-auth/set-password", async (c) => {
12537
+ app35.post("/api/remote-auth/set-password", async (c) => {
12577
12538
  let body;
12578
12539
  try {
12579
12540
  body = await c.req.json();
12580
12541
  } catch {
12581
12542
  return c.json({ error: "Invalid request" }, 400);
12582
12543
  }
12583
- if (!body.session_key || !validateSession(body.session_key, "admin")) {
12544
+ if (!body.session_key || !validateSession(body.session_key, "admin").ok) {
12584
12545
  return c.json({ error: "Unauthorized" }, 401);
12585
12546
  }
12586
12547
  if (!body.password) {
@@ -12603,9 +12564,9 @@ app36.post("/api/remote-auth/set-password", async (c) => {
12603
12564
  return c.json({ error: "Failed to save password" }, 500);
12604
12565
  }
12605
12566
  });
12606
- app36.route("/api/_client-error", client_error_default);
12567
+ app35.route("/api/_client-error", client_error_default);
12607
12568
  console.log("[client-error-route] mounted");
12608
- app36.use("*", async (c, next) => {
12569
+ app35.use("*", async (c, next) => {
12609
12570
  const host = (c.req.header("host") ?? "").split(":")[0];
12610
12571
  const path2 = c.req.path;
12611
12572
  if (path2 === "/favicon.ico" || path2.startsWith("/assets/") || path2.startsWith("/brand/")) {
@@ -12638,15 +12599,15 @@ app36.use("*", async (c, next) => {
12638
12599
  console.error(`[remote-auth] login required ip=${clientIp} path=${path2} ${disambig}`);
12639
12600
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), redirect: path2 }), 200);
12640
12601
  });
12641
- app36.route("/api/health", health_default);
12642
- app36.route("/api/session", session_default);
12643
- app36.route("/api/chat", chat_default);
12644
- app36.route("/api/group", group_default);
12645
- app36.route("/api/access", access_default);
12646
- app36.route("/api/telegram", telegram_default);
12647
- app36.route("/api/whatsapp", whatsapp_default);
12648
- app36.route("/api/onboarding", onboarding_default);
12649
- app36.route("/api/admin", admin_default);
12602
+ app35.route("/api/health", health_default);
12603
+ app35.route("/api/session", session_default);
12604
+ app35.route("/api/chat", chat_default);
12605
+ app35.route("/api/group", group_default);
12606
+ app35.route("/api/access", access_default);
12607
+ app35.route("/api/telegram", telegram_default);
12608
+ app35.route("/api/whatsapp", whatsapp_default);
12609
+ app35.route("/api/onboarding", onboarding_default);
12610
+ app35.route("/api/admin", admin_default);
12650
12611
  var SAFE_SLUG_RE = /^[a-z][a-z0-9-]{2,49}$/;
12651
12612
  var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
12652
12613
  var IMAGE_MIME = {
@@ -12658,7 +12619,7 @@ var IMAGE_MIME = {
12658
12619
  ".svg": "image/svg+xml",
12659
12620
  ".ico": "image/x-icon"
12660
12621
  };
12661
- app36.get("/agent-assets/:slug/:filename", (c) => {
12622
+ app35.get("/agent-assets/:slug/:filename", (c) => {
12662
12623
  const slug = c.req.param("slug");
12663
12624
  const filename = c.req.param("filename");
12664
12625
  if (!SAFE_SLUG_RE.test(slug)) {
@@ -12693,7 +12654,7 @@ app36.get("/agent-assets/:slug/:filename", (c) => {
12693
12654
  "Cache-Control": "public, max-age=3600"
12694
12655
  });
12695
12656
  });
12696
- app36.get("/generated/:filename", (c) => {
12657
+ app35.get("/generated/:filename", (c) => {
12697
12658
  const filename = c.req.param("filename");
12698
12659
  if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
12699
12660
  console.error(`[generated] serve file=${filename} status=403`);
@@ -12859,7 +12820,7 @@ function brandedPublicHtml(agentSlug) {
12859
12820
  function escapeHtml(s) {
12860
12821
  return s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
12861
12822
  }
12862
- app36.get("/", (c) => {
12823
+ app35.get("/", (c) => {
12863
12824
  const host = (c.req.header("host") ?? "").split(":")[0];
12864
12825
  if (isPublicHost(host)) {
12865
12826
  const defaultSlug = resolveDefaultSlug();
@@ -12867,12 +12828,12 @@ app36.get("/", (c) => {
12867
12828
  }
12868
12829
  return c.html(cachedHtml("index.html"));
12869
12830
  });
12870
- app36.get("/public", (c) => {
12831
+ app35.get("/public", (c) => {
12871
12832
  const host = (c.req.header("host") ?? "").split(":")[0];
12872
12833
  if (isPublicHost(host)) return c.text("Not found", 404);
12873
12834
  return c.html(cachedHtml("public.html"));
12874
12835
  });
12875
- app36.get("/chat", (c) => {
12836
+ app35.get("/chat", (c) => {
12876
12837
  const host = (c.req.header("host") ?? "").split(":")[0];
12877
12838
  if (isPublicHost(host)) return c.text("Not found", 404);
12878
12839
  return c.html(cachedHtml("public.html"));
@@ -12891,9 +12852,9 @@ async function logViewerFetch(c, next) {
12891
12852
  duration_ms: Date.now() - start
12892
12853
  });
12893
12854
  }
12894
- app36.use("/vnc-viewer.html", logViewerFetch);
12895
- app36.use("/vnc-popout.html", logViewerFetch);
12896
- app36.get("/vnc-popout.html", (c) => {
12855
+ app35.use("/vnc-viewer.html", logViewerFetch);
12856
+ app35.use("/vnc-popout.html", logViewerFetch);
12857
+ app35.get("/vnc-popout.html", (c) => {
12897
12858
  let html = htmlCache.get("vnc-popout.html");
12898
12859
  if (!html) {
12899
12860
  html = readFileSync16(resolve23(process.cwd(), "public", "vnc-popout.html"), "utf-8");
@@ -12906,7 +12867,7 @@ app36.get("/vnc-popout.html", (c) => {
12906
12867
  }
12907
12868
  return c.html(html);
12908
12869
  });
12909
- app36.post("/api/vnc/client-event", async (c) => {
12870
+ app35.post("/api/vnc/client-event", async (c) => {
12910
12871
  let body;
12911
12872
  try {
12912
12873
  body = await c.req.json();
@@ -12927,20 +12888,20 @@ app36.post("/api/vnc/client-event", async (c) => {
12927
12888
  });
12928
12889
  return c.json({ ok: true });
12929
12890
  });
12930
- app36.get("/g/:slug", (c) => {
12891
+ app35.get("/g/:slug", (c) => {
12931
12892
  return c.html(brandedPublicHtml());
12932
12893
  });
12933
- app36.get("/graph", (c) => {
12894
+ app35.get("/graph", (c) => {
12934
12895
  const host = (c.req.header("host") ?? "").split(":")[0];
12935
12896
  if (isPublicHost(host)) return c.text("Not found", 404);
12936
12897
  return c.html(cachedHtml("graph.html"));
12937
12898
  });
12938
- app36.get("/data", (c) => {
12899
+ app35.get("/data", (c) => {
12939
12900
  const host = (c.req.header("host") ?? "").split(":")[0];
12940
12901
  if (isPublicHost(host)) return c.text("Not found", 404);
12941
12902
  return c.html(cachedHtml("data.html"));
12942
12903
  });
12943
- app36.get("/:slug", async (c, next) => {
12904
+ app35.get("/:slug", async (c, next) => {
12944
12905
  const slug = c.req.param("slug");
12945
12906
  if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
12946
12907
  const branding = loadBrandingCache(slug);
@@ -12949,10 +12910,10 @@ app36.get("/:slug", async (c, next) => {
12949
12910
  }
12950
12911
  await next();
12951
12912
  });
12952
- app36.use("/*", serveStatic({ root: "./public" }));
12913
+ app35.use("/*", serveStatic({ root: "./public" }));
12953
12914
  var port = parseInt(process.env.MAXY_UI_INTERNAL_PORT ?? process.env.PORT ?? "19199", 10);
12954
12915
  var hostname = process.env.HOSTNAME ?? "127.0.0.1";
12955
- var httpServer = serve({ fetch: app36.fetch, port, hostname });
12916
+ var httpServer = serve({ fetch: app35.fetch, port, hostname });
12956
12917
  console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
12957
12918
  var SUBAPP_MANIFEST = [
12958
12919
  { prefix: "/api/health", file: "server/routes/health.ts", subapp: health_default },
@@ -12972,7 +12933,7 @@ for (const m of SUBAPP_MANIFEST) {
12972
12933
  }
12973
12934
  try {
12974
12935
  const registered = [];
12975
- for (const r of app36.routes ?? []) {
12936
+ for (const r of app35.routes ?? []) {
12976
12937
  if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
12977
12938
  if (AGENT_SLUG_PATTERN.test(r.path)) {
12978
12939
  registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });
@@ -12995,6 +12956,13 @@ try {
12995
12956
  console.error(`[session] backfill startup failed: ${err instanceof Error ? err.message : String(err)}`);
12996
12957
  }
12997
12958
  })();
12959
+ (async () => {
12960
+ try {
12961
+ await runBootMigrations();
12962
+ } catch (err) {
12963
+ console.error(`[migration] runBootMigrations rejected: ${err instanceof Error ? err.message : String(err)}`);
12964
+ }
12965
+ })();
12998
12966
  (async () => {
12999
12967
  try {
13000
12968
  await startReviewDetector();
@@ -1 +0,0 @@
1
- import{i as e,t}from"./jsx-runtime-Br2bU3EJ.js";import{t as n}from"./page-DU8F3OGU.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -1 +0,0 @@
1
- import{i as e,t}from"./jsx-runtime-Br2bU3EJ.js";import{n}from"./page-BuoQU1c6.js";import"./Checkbox-DHsoNPeM.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));