@rubytech/create-maxy-code 0.1.113 → 0.1.114

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 (22) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/neo4j/schema.cypher +7 -2
  3. package/payload/platform/plugins/admin/skills/public-agent-manager/SKILL.md +14 -7
  4. package/payload/platform/plugins/docs/references/internals.md +10 -26
  5. package/payload/platform/plugins/memory/PLUGIN.md +2 -1
  6. package/payload/platform/plugins/whatsapp/.claude-plugin/plugin.json +9 -0
  7. package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -1
  8. package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.d.ts +30 -0
  9. package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.d.ts.map +1 -0
  10. package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.js +86 -0
  11. package/payload/platform/services/claude-session-manager/dist/brand-foreign-filter.js.map +1 -0
  12. package/payload/platform/services/claude-session-manager/dist/index.js +51 -9
  13. package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
  14. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  15. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +35 -4
  16. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  17. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts +7 -0
  18. package/payload/platform/services/claude-session-manager/dist/system-prompt.d.ts.map +1 -1
  19. package/payload/platform/services/claude-session-manager/dist/system-prompt.js +7 -0
  20. package/payload/platform/services/claude-session-manager/dist/system-prompt.js.map +1 -1
  21. package/payload/premium-plugins/real-agent/plugins/buyers/skills/property-recommender/SKILL.md +23 -3
  22. package/payload/server/server.js +92 -41
@@ -12134,6 +12134,55 @@ app34.get("/:rel{.*}", (c) => {
12134
12134
  });
12135
12135
  var sites_default = app34;
12136
12136
 
12137
+ // server/routes/listings.ts
12138
+ var SAFE_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,118}[a-z0-9])?$/;
12139
+ var CHAT_SESSION_KEY_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{7,127}$/;
12140
+ var app35 = new Hono();
12141
+ app35.get("/:slug/click", async (c) => {
12142
+ const slug = c.req.param("slug") ?? "";
12143
+ const rawSession = c.req.query("session") ?? "";
12144
+ const sessionKey = CHAT_SESSION_KEY_RE.test(rawSession) ? rawSession : "invalid";
12145
+ if (!SAFE_SLUG_RE.test(slug)) {
12146
+ console.error(`[property-card-click] reject reason=bad-slug-shape slug=${JSON.stringify(slug)} status=400`);
12147
+ return c.text("Bad Request", 400);
12148
+ }
12149
+ const account = resolveAccount();
12150
+ if (!account) {
12151
+ console.error(`[property-card-click] reject reason=no-account slug=${slug} status=404`);
12152
+ return c.text("Not Found", 404);
12153
+ }
12154
+ let pageUrl = null;
12155
+ const session = getSession();
12156
+ try {
12157
+ const result = await session.run(
12158
+ `MATCH (l:Listing {accountId: $accountId, slug: $slug})
12159
+ WHERE l.scope = 'public'
12160
+ RETURN l.pageUrl AS pageUrl
12161
+ LIMIT 1`,
12162
+ { accountId: account.accountId, slug }
12163
+ );
12164
+ const record = result.records[0];
12165
+ const raw = record?.get("pageUrl");
12166
+ pageUrl = typeof raw === "string" && raw.length > 0 ? raw : null;
12167
+ } catch (err) {
12168
+ const message = err instanceof Error ? err.message : String(err);
12169
+ console.error(`[property-card-click] reject reason=neo4j-error slug=${slug} sessionKey=${sessionKey} err=${JSON.stringify(message)} status=503`);
12170
+ await session.close().catch(() => {
12171
+ });
12172
+ return c.text("Service Unavailable", 503);
12173
+ } finally {
12174
+ await session.close().catch(() => {
12175
+ });
12176
+ }
12177
+ if (!pageUrl) {
12178
+ console.error(`[property-card-click] reject reason=listing-not-found slug=${slug} sessionKey=${sessionKey} accountId=${account.accountId} status=404`);
12179
+ return c.text("Not Found", 404);
12180
+ }
12181
+ console.log(`[property-card-click] sessionKey=${sessionKey} listingSlug=${slug} ts=${(/* @__PURE__ */ new Date()).toISOString()}`);
12182
+ return c.redirect(pageUrl, 302);
12183
+ });
12184
+ var listings_default = app35;
12185
+
12137
12186
  // app/lib/graph-health.ts
12138
12187
  var HOUR_MS = 60 * 60 * 1e3;
12139
12188
  var timer = null;
@@ -12567,9 +12616,9 @@ watchFile(ALIAS_DOMAINS_PATH, { interval: 2e3 }, () => {
12567
12616
  function isPublicHost(host) {
12568
12617
  return host.startsWith("public.") || aliasDomains.has(host);
12569
12618
  }
12570
- var app35 = new Hono();
12571
- app35.use("*", clientIpMiddleware);
12572
- app35.use("*", async (c, next) => {
12619
+ var app36 = new Hono();
12620
+ app36.use("*", clientIpMiddleware);
12621
+ app36.use("*", async (c, next) => {
12573
12622
  await next();
12574
12623
  c.header("X-Content-Type-Options", "nosniff");
12575
12624
  c.header("Referrer-Policy", "strict-origin-when-cross-origin");
@@ -12579,7 +12628,7 @@ app35.use("*", async (c, next) => {
12579
12628
  );
12580
12629
  });
12581
12630
  var HTTP_LOG_PATHS = /* @__PURE__ */ new Set(["/vnc-viewer.html", "/vnc-popout.html"]);
12582
- app35.use("*", async (c, next) => {
12631
+ app36.use("*", async (c, next) => {
12583
12632
  if (!HTTP_LOG_PATHS.has(c.req.path)) {
12584
12633
  await next();
12585
12634
  return;
@@ -12612,7 +12661,7 @@ var PUBLIC_ALLOWED_PREFIXES = [
12612
12661
  "/sites/"
12613
12662
  ];
12614
12663
  var PUBLIC_ALLOWED_EXACT = ["/favicon.ico"];
12615
- app35.use("*", async (c, next) => {
12664
+ app36.use("*", async (c, next) => {
12616
12665
  const host = (c.req.header("host") ?? "").split(":")[0];
12617
12666
  if (!isPublicHost(host)) {
12618
12667
  await next();
@@ -12652,7 +12701,7 @@ function resolveRemoteAuthOpts() {
12652
12701
  return brandLoginOpts;
12653
12702
  }
12654
12703
  var MAX_LOGIN_BODY = 8 * 1024;
12655
- app35.post("/__remote-auth/login", async (c) => {
12704
+ app36.post("/__remote-auth/login", async (c) => {
12656
12705
  const client = clientFrom(c);
12657
12706
  const clientIp = client.ip || "unknown";
12658
12707
  if (!requestIsTlsTerminated(c)) {
@@ -12697,7 +12746,7 @@ app35.post("/__remote-auth/login", async (c) => {
12697
12746
  }
12698
12747
  });
12699
12748
  });
12700
- app35.get("/__remote-auth/logout", (c) => {
12749
+ app36.get("/__remote-auth/logout", (c) => {
12701
12750
  const client = clientFrom(c);
12702
12751
  const clientIp = client.ip || "unknown";
12703
12752
  console.error(`[remote-auth] logout ip=${clientIp}`);
@@ -12710,7 +12759,7 @@ app35.get("/__remote-auth/logout", (c) => {
12710
12759
  }
12711
12760
  });
12712
12761
  });
12713
- app35.post("/__remote-auth/change-password", async (c) => {
12762
+ app36.post("/__remote-auth/change-password", async (c) => {
12714
12763
  const client = clientFrom(c);
12715
12764
  const clientIp = client.ip || "unknown";
12716
12765
  const rateLimited = checkRateLimit(client);
@@ -12761,13 +12810,13 @@ app35.post("/__remote-auth/change-password", async (c) => {
12761
12810
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "change", changeError: "Failed to save password", redirect }), 200);
12762
12811
  }
12763
12812
  });
12764
- app35.get("/__remote-auth/setup", (c) => {
12813
+ app36.get("/__remote-auth/setup", (c) => {
12765
12814
  if (isRemoteAuthConfigured()) {
12766
12815
  return c.redirect("/");
12767
12816
  }
12768
12817
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup" }), 200);
12769
12818
  });
12770
- app35.post("/__remote-auth/set-initial-password", async (c) => {
12819
+ app36.post("/__remote-auth/set-initial-password", async (c) => {
12771
12820
  if (isRemoteAuthConfigured()) {
12772
12821
  return c.redirect("/");
12773
12822
  }
@@ -12805,10 +12854,10 @@ app35.post("/__remote-auth/set-initial-password", async (c) => {
12805
12854
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
12806
12855
  }
12807
12856
  });
12808
- app35.get("/api/remote-auth/status", (c) => {
12857
+ app36.get("/api/remote-auth/status", (c) => {
12809
12858
  return c.json({ configured: isRemoteAuthConfigured() });
12810
12859
  });
12811
- app35.post("/api/remote-auth/set-password", async (c) => {
12860
+ app36.post("/api/remote-auth/set-password", async (c) => {
12812
12861
  let body;
12813
12862
  try {
12814
12863
  body = await c.req.json();
@@ -12839,9 +12888,9 @@ app35.post("/api/remote-auth/set-password", async (c) => {
12839
12888
  return c.json({ error: "Failed to save password" }, 500);
12840
12889
  }
12841
12890
  });
12842
- app35.route("/api/_client-error", client_error_default);
12891
+ app36.route("/api/_client-error", client_error_default);
12843
12892
  console.log("[client-error-route] mounted");
12844
- app35.use("*", async (c, next) => {
12893
+ app36.use("*", async (c, next) => {
12845
12894
  const host = (c.req.header("host") ?? "").split(":")[0];
12846
12895
  const path2 = c.req.path;
12847
12896
  if (path2 === "/favicon.ico" || path2.startsWith("/assets/") || path2.startsWith("/brand/")) {
@@ -12874,12 +12923,12 @@ app35.use("*", async (c, next) => {
12874
12923
  console.error(`[remote-auth] login required ip=${clientIp} path=${path2} ${disambig}`);
12875
12924
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), redirect: path2 }), 200);
12876
12925
  });
12877
- app35.route("/api/health", health_default);
12878
- app35.route("/api/chat", chat_default);
12879
- app35.route("/api/whatsapp", whatsapp_default);
12880
- app35.route("/api/onboarding", onboarding_default);
12881
- app35.route("/api/admin", admin_default);
12882
- var SAFE_SLUG_RE = /^[a-z][a-z0-9-]{2,49}$/;
12926
+ app36.route("/api/health", health_default);
12927
+ app36.route("/api/chat", chat_default);
12928
+ app36.route("/api/whatsapp", whatsapp_default);
12929
+ app36.route("/api/onboarding", onboarding_default);
12930
+ app36.route("/api/admin", admin_default);
12931
+ var SAFE_SLUG_RE2 = /^[a-z][a-z0-9-]{2,49}$/;
12883
12932
  var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
12884
12933
  var IMAGE_MIME = {
12885
12934
  ".png": "image/png",
@@ -12890,10 +12939,10 @@ var IMAGE_MIME = {
12890
12939
  ".svg": "image/svg+xml",
12891
12940
  ".ico": "image/x-icon"
12892
12941
  };
12893
- app35.get("/agent-assets/:slug/:filename", (c) => {
12942
+ app36.get("/agent-assets/:slug/:filename", (c) => {
12894
12943
  const slug = c.req.param("slug");
12895
12944
  const filename = c.req.param("filename");
12896
- if (!SAFE_SLUG_RE.test(slug)) {
12945
+ if (!SAFE_SLUG_RE2.test(slug)) {
12897
12946
  console.error(`[agent-assets] invalid-slug slug=${slug}`);
12898
12947
  return c.text("Not found", 404);
12899
12948
  }
@@ -12925,7 +12974,7 @@ app35.get("/agent-assets/:slug/:filename", (c) => {
12925
12974
  "Cache-Control": "public, max-age=3600"
12926
12975
  });
12927
12976
  });
12928
- app35.get("/generated/:filename", (c) => {
12977
+ app36.get("/generated/:filename", (c) => {
12929
12978
  const filename = c.req.param("filename");
12930
12979
  if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
12931
12980
  console.error(`[generated] serve file=${filename} status=403`);
@@ -12955,7 +13004,8 @@ app35.get("/generated/:filename", (c) => {
12955
13004
  "Cache-Control": "public, max-age=86400"
12956
13005
  });
12957
13006
  });
12958
- app35.route("/sites", sites_default);
13007
+ app36.route("/sites", sites_default);
13008
+ app36.route("/listings", listings_default);
12959
13009
  var htmlCache = /* @__PURE__ */ new Map();
12960
13010
  var brandLogoPath = "/brand/maxy-monochrome.png";
12961
13011
  var brandIconPath = "/brand/maxy-monochrome.png";
@@ -13092,7 +13142,7 @@ function brandedPublicHtml(agentSlug) {
13092
13142
  function escapeHtml(s) {
13093
13143
  return s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
13094
13144
  }
13095
- app35.get("/", (c) => {
13145
+ app36.get("/", (c) => {
13096
13146
  const host = (c.req.header("host") ?? "").split(":")[0];
13097
13147
  if (isPublicHost(host)) {
13098
13148
  const defaultSlug = resolveDefaultSlug();
@@ -13100,12 +13150,12 @@ app35.get("/", (c) => {
13100
13150
  }
13101
13151
  return c.html(cachedHtml("index.html"));
13102
13152
  });
13103
- app35.get("/public", (c) => {
13153
+ app36.get("/public", (c) => {
13104
13154
  const host = (c.req.header("host") ?? "").split(":")[0];
13105
13155
  if (isPublicHost(host)) return c.text("Not found", 404);
13106
13156
  return c.html(cachedHtml("public.html"));
13107
13157
  });
13108
- app35.get("/chat", (c) => {
13158
+ app36.get("/chat", (c) => {
13109
13159
  const host = (c.req.header("host") ?? "").split(":")[0];
13110
13160
  if (isPublicHost(host)) return c.text("Not found", 404);
13111
13161
  return c.html(cachedHtml("public.html"));
@@ -13124,9 +13174,9 @@ async function logViewerFetch(c, next) {
13124
13174
  duration_ms: Date.now() - start
13125
13175
  });
13126
13176
  }
13127
- app35.use("/vnc-viewer.html", logViewerFetch);
13128
- app35.use("/vnc-popout.html", logViewerFetch);
13129
- app35.get("/vnc-popout.html", (c) => {
13177
+ app36.use("/vnc-viewer.html", logViewerFetch);
13178
+ app36.use("/vnc-popout.html", logViewerFetch);
13179
+ app36.get("/vnc-popout.html", (c) => {
13130
13180
  let html = htmlCache.get("vnc-popout.html");
13131
13181
  if (!html) {
13132
13182
  html = readFileSync19(resolve21(process.cwd(), "public", "vnc-popout.html"), "utf-8");
@@ -13139,7 +13189,7 @@ app35.get("/vnc-popout.html", (c) => {
13139
13189
  }
13140
13190
  return c.html(html);
13141
13191
  });
13142
- app35.post("/api/vnc/client-event", async (c) => {
13192
+ app36.post("/api/vnc/client-event", async (c) => {
13143
13193
  let body;
13144
13194
  try {
13145
13195
  body = await c.req.json();
@@ -13160,25 +13210,25 @@ app35.post("/api/vnc/client-event", async (c) => {
13160
13210
  });
13161
13211
  return c.json({ ok: true });
13162
13212
  });
13163
- app35.get("/g/:slug", (c) => {
13213
+ app36.get("/g/:slug", (c) => {
13164
13214
  return c.html(brandedPublicHtml());
13165
13215
  });
13166
- app35.get("/graph", (c) => {
13216
+ app36.get("/graph", (c) => {
13167
13217
  const host = (c.req.header("host") ?? "").split(":")[0];
13168
13218
  if (isPublicHost(host)) return c.text("Not found", 404);
13169
13219
  return c.html(cachedHtml("graph.html"));
13170
13220
  });
13171
- app35.get("/sessions", (c) => {
13221
+ app36.get("/sessions", (c) => {
13172
13222
  const host = (c.req.header("host") ?? "").split(":")[0];
13173
13223
  if (isPublicHost(host)) return c.text("Not found", 404);
13174
13224
  return c.html(cachedHtml("sessions.html"));
13175
13225
  });
13176
- app35.get("/data", (c) => {
13226
+ app36.get("/data", (c) => {
13177
13227
  const host = (c.req.header("host") ?? "").split(":")[0];
13178
13228
  if (isPublicHost(host)) return c.text("Not found", 404);
13179
13229
  return c.html(cachedHtml("data.html"));
13180
13230
  });
13181
- app35.get("/:slug", async (c, next) => {
13231
+ app36.get("/:slug", async (c, next) => {
13182
13232
  const slug = c.req.param("slug");
13183
13233
  if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
13184
13234
  const branding = loadBrandingCache(slug);
@@ -13188,15 +13238,15 @@ app35.get("/:slug", async (c, next) => {
13188
13238
  await next();
13189
13239
  });
13190
13240
  if (brandFaviconPath !== "/favicon.ico") {
13191
- app35.get("/favicon.ico", (c) => {
13241
+ app36.get("/favicon.ico", (c) => {
13192
13242
  c.header("Cache-Control", "public, max-age=300");
13193
13243
  return c.redirect(brandFaviconPath, 302);
13194
13244
  });
13195
13245
  }
13196
- app35.use("/*", serveStatic({ root: "./public" }));
13246
+ app36.use("/*", serveStatic({ root: "./public" }));
13197
13247
  var port = requirePortEnv("MAXY_UI_INTERNAL_PORT", { tag: "ui-server" });
13198
13248
  var hostname = process.env.HOSTNAME ?? "127.0.0.1";
13199
- var httpServer = serve({ fetch: app35.fetch, port, hostname });
13249
+ var httpServer = serve({ fetch: app36.fetch, port, hostname });
13200
13250
  console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
13201
13251
  {
13202
13252
  const loopHist = monitorEventLoopDelay({ resolution: 50 });
@@ -13220,7 +13270,8 @@ var SUBAPP_MANIFEST = [
13220
13270
  { prefix: "/api/whatsapp", file: "server/routes/whatsapp.ts", subapp: whatsapp_default },
13221
13271
  { prefix: "/api/onboarding", file: "server/routes/onboarding.ts", subapp: onboarding_default },
13222
13272
  { prefix: "/api/admin", file: "server/routes/admin/index.ts", subapp: admin_default },
13223
- { prefix: "/api/_client-error", file: "server/routes/client-error.ts", subapp: client_error_default }
13273
+ { prefix: "/api/_client-error", file: "server/routes/client-error.ts", subapp: client_error_default },
13274
+ { prefix: "/listings", file: "server/routes/listings.ts", subapp: listings_default }
13224
13275
  ];
13225
13276
  for (const m of SUBAPP_MANIFEST) {
13226
13277
  const routeCount = Array.isArray(m.subapp.routes) ? m.subapp.routes.length : 0;
@@ -13228,7 +13279,7 @@ for (const m of SUBAPP_MANIFEST) {
13228
13279
  }
13229
13280
  try {
13230
13281
  const registered = [];
13231
- for (const r of app35.routes ?? []) {
13282
+ for (const r of app36.routes ?? []) {
13232
13283
  if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
13233
13284
  if (AGENT_SLUG_PATTERN.test(r.path)) {
13234
13285
  registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });