@rubytech/create-maxy 1.0.743 → 1.0.744
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.d.ts +2 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.js +97 -0
- package/payload/platform/lib/graph-mcp/dist/__tests__/cypher-validate-write.test.js.map +1 -0
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.d.ts +13 -1
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.d.ts.map +1 -1
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.js +70 -3
- package/payload/platform/lib/graph-mcp/dist/cypher-validate.js.map +1 -1
- package/payload/platform/lib/graph-mcp/dist/index.js +154 -11
- package/payload/platform/lib/graph-mcp/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-mcp/src/__tests__/cypher-validate-write.test.ts +150 -0
- package/payload/platform/lib/graph-mcp/src/cypher-validate.ts +95 -3
- package/payload/platform/lib/graph-mcp/src/index.ts +202 -17
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.d.ts +2 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.js +147 -0
- package/payload/platform/lib/graph-write/dist/__tests__/audit.test.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/audit.d.ts +84 -0
- package/payload/platform/lib/graph-write/dist/audit.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/audit.js +129 -0
- package/payload/platform/lib/graph-write/dist/audit.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/index.d.ts +1 -0
- package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-write/dist/index.js +18 -22
- package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-write/src/__tests__/audit.test.ts +162 -0
- package/payload/platform/lib/graph-write/src/audit.ts +182 -0
- package/payload/platform/lib/graph-write/src/index.ts +5 -0
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/docs/references/memory-guide.md +2 -0
- package/payload/platform/plugins/docs/references/troubleshooting.md +16 -0
- package/payload/platform/templates/specialists/agents/database-operator.md +39 -6
- package/payload/server/chunk-2T4RRIJK.js +9462 -0
- package/payload/server/maxy-edge.js +94 -16
- package/payload/server/server.js +1 -1
|
@@ -16,13 +16,13 @@ import {
|
|
|
16
16
|
sanitizeClientCorrId,
|
|
17
17
|
streamActionEvents,
|
|
18
18
|
vncLog
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2T4RRIJK.js";
|
|
20
20
|
import "./chunk-TXPEEAV6.js";
|
|
21
21
|
|
|
22
22
|
// server/edge.ts
|
|
23
23
|
import { createServer, request as httpRequest } from "http";
|
|
24
24
|
import { createConnection as createConnection2 } from "net";
|
|
25
|
-
import { readFileSync as
|
|
25
|
+
import { readFileSync as readFileSync4, existsSync as existsSync5, watchFile } from "fs";
|
|
26
26
|
import { homedir } from "os";
|
|
27
27
|
import { join as join3 } from "path";
|
|
28
28
|
|
|
@@ -666,23 +666,90 @@ function createEdgeAdminApp(opts) {
|
|
|
666
666
|
return app6;
|
|
667
667
|
}
|
|
668
668
|
|
|
669
|
-
// server/edge.ts
|
|
670
|
-
|
|
671
|
-
var
|
|
672
|
-
|
|
673
|
-
if (
|
|
669
|
+
// server/edge-fallback.ts
|
|
670
|
+
import { existsSync as existsSync4, readFileSync as readFileSync3 } from "fs";
|
|
671
|
+
var BRAND_DEFAULTS = { configDir: ".maxy", productName: "Maxy" };
|
|
672
|
+
function loadBrand(path) {
|
|
673
|
+
if (!path || !existsSync4(path)) return { ...BRAND_DEFAULTS };
|
|
674
674
|
try {
|
|
675
|
-
const parsed = JSON.parse(readFileSync3(
|
|
676
|
-
|
|
675
|
+
const parsed = JSON.parse(readFileSync3(path, "utf-8"));
|
|
676
|
+
return {
|
|
677
|
+
configDir: typeof parsed.configDir === "string" ? parsed.configDir : BRAND_DEFAULTS.configDir,
|
|
678
|
+
productName: typeof parsed.productName === "string" ? parsed.productName : BRAND_DEFAULTS.productName
|
|
679
|
+
};
|
|
677
680
|
} catch (err) {
|
|
678
681
|
console.error(`[edge] brand.json parse error: ${err.message}`);
|
|
682
|
+
return { ...BRAND_DEFAULTS };
|
|
679
683
|
}
|
|
680
684
|
}
|
|
685
|
+
function classifyUpstreamError(err) {
|
|
686
|
+
return err && err.code === "ECONNREFUSED" ? "econnrefused-coldstart" : "other";
|
|
687
|
+
}
|
|
688
|
+
var HTML_ESCAPES = { "<": "<", ">": ">", "&": "&", '"': """, "'": "'" };
|
|
689
|
+
function escapeHtml(s) {
|
|
690
|
+
return String(s).replace(/[<>&"']/g, (c) => HTML_ESCAPES[c] ?? c);
|
|
691
|
+
}
|
|
692
|
+
function buildHoldingPage(productName) {
|
|
693
|
+
const safeName = escapeHtml(productName);
|
|
694
|
+
return `<!doctype html>
|
|
695
|
+
<html lang="en">
|
|
696
|
+
<head>
|
|
697
|
+
<meta charset="utf-8">
|
|
698
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
699
|
+
<title>${safeName}</title>
|
|
700
|
+
<style>
|
|
701
|
+
html, body { margin: 0; padding: 0; height: 100%; }
|
|
702
|
+
body {
|
|
703
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
704
|
+
background: #fafaf8;
|
|
705
|
+
color: #2a2a2a;
|
|
706
|
+
display: flex;
|
|
707
|
+
align-items: center;
|
|
708
|
+
justify-content: center;
|
|
709
|
+
flex-direction: column;
|
|
710
|
+
}
|
|
711
|
+
.name { font-size: 1.4rem; font-weight: 500; margin: 0 0 0.5rem; }
|
|
712
|
+
.sub { font-size: 0.95rem; color: #888; margin: 0; }
|
|
713
|
+
.dot {
|
|
714
|
+
display: inline-block; width: 6px; height: 6px; border-radius: 50%;
|
|
715
|
+
background: currentColor; margin: 0 2px; opacity: 0.3;
|
|
716
|
+
animation: pulse 1.4s infinite ease-in-out;
|
|
717
|
+
}
|
|
718
|
+
.dot:nth-child(2) { animation-delay: 0.2s; }
|
|
719
|
+
.dot:nth-child(3) { animation-delay: 0.4s; }
|
|
720
|
+
@keyframes pulse { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
|
|
721
|
+
</style>
|
|
722
|
+
</head>
|
|
723
|
+
<body>
|
|
724
|
+
<p class="name">${safeName} is starting</p>
|
|
725
|
+
<p class="sub"><span class="dot"></span><span class="dot"></span><span class="dot"></span></p>
|
|
726
|
+
<script>
|
|
727
|
+
(function () {
|
|
728
|
+
var attempts = 0;
|
|
729
|
+
var MAX = 120;
|
|
730
|
+
function poll() {
|
|
731
|
+
if (attempts++ >= MAX) return;
|
|
732
|
+
fetch('/api/health', { cache: 'no-store' })
|
|
733
|
+
.then(function (r) { if (r.ok) location.reload(); else setTimeout(poll, 1500); })
|
|
734
|
+
.catch(function () { setTimeout(poll, 1500); });
|
|
735
|
+
}
|
|
736
|
+
setTimeout(poll, 1500);
|
|
737
|
+
})();
|
|
738
|
+
</script>
|
|
739
|
+
</body>
|
|
740
|
+
</html>
|
|
741
|
+
`;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
// server/edge.ts
|
|
745
|
+
var PLATFORM_ROOT2 = process.env.MAXY_PLATFORM_ROOT || "";
|
|
746
|
+
var BRAND_JSON_PATH = PLATFORM_ROOT2 ? join3(PLATFORM_ROOT2, "config", "brand.json") : "";
|
|
747
|
+
var BRAND = loadBrand(BRAND_JSON_PATH);
|
|
681
748
|
var ALIAS_DOMAINS_PATH = join3(homedir(), BRAND.configDir, "alias-domains.json");
|
|
682
749
|
function loadAliasDomains() {
|
|
683
750
|
try {
|
|
684
|
-
if (!
|
|
685
|
-
const parsed = JSON.parse(
|
|
751
|
+
if (!existsSync5(ALIAS_DOMAINS_PATH)) return /* @__PURE__ */ new Set();
|
|
752
|
+
const parsed = JSON.parse(readFileSync4(ALIAS_DOMAINS_PATH, "utf-8"));
|
|
686
753
|
if (!Array.isArray(parsed)) return /* @__PURE__ */ new Set();
|
|
687
754
|
return new Set(parsed.filter((h) => typeof h === "string"));
|
|
688
755
|
} catch {
|
|
@@ -735,12 +802,22 @@ function forwardHttp(clientReq, clientRes) {
|
|
|
735
802
|
upstreamRes.pipe(clientRes);
|
|
736
803
|
});
|
|
737
804
|
upstream.on("error", (err) => {
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
805
|
+
const errClass = classifyUpstreamError(err);
|
|
806
|
+
console.error(
|
|
807
|
+
`[edge] upstream http error path=${clientReq.url} err=${err.message} err-class=${errClass} upstream=${UPSTREAM_HOST}:${UPSTREAM_PORT}`
|
|
808
|
+
);
|
|
809
|
+
if (clientRes.headersSent) {
|
|
743
810
|
clientRes.destroy();
|
|
811
|
+
return;
|
|
812
|
+
}
|
|
813
|
+
const accept = String(clientReq.headers["accept"] ?? "");
|
|
814
|
+
const isHtmlNavigation = errClass === "econnrefused-coldstart" && clientReq.method === "GET" && accept.includes("text/html");
|
|
815
|
+
if (isHtmlNavigation) {
|
|
816
|
+
clientRes.writeHead(200, { "content-type": "text/html; charset=utf-8", "cache-control": "no-store" });
|
|
817
|
+
clientRes.end(buildHoldingPage(BRAND.productName));
|
|
818
|
+
} else {
|
|
819
|
+
clientRes.writeHead(502, { "content-type": "text/plain" });
|
|
820
|
+
clientRes.end(`Bad Gateway (${BRAND.productName} unavailable)`);
|
|
744
821
|
}
|
|
745
822
|
});
|
|
746
823
|
clientReq.on("aborted", () => upstream.destroy());
|
|
@@ -827,6 +904,7 @@ server.on("upgrade", (req, socket, head) => {
|
|
|
827
904
|
});
|
|
828
905
|
server.listen(EDGE_PORT, EDGE_HOSTNAME, () => {
|
|
829
906
|
console.log(`[edge] listening on http://${EDGE_HOSTNAME}:${EDGE_PORT}`);
|
|
907
|
+
console.log(`[edge] brand=${BRAND.productName}`);
|
|
830
908
|
console.log(`[edge] /websockify \u2192 ${WEBSOCKIFY_HOST}:${WEBSOCKIFY_PORT}`);
|
|
831
909
|
console.log(`[edge] everything else \u2192 ${UPSTREAM_HOST}:${UPSTREAM_PORT}`);
|
|
832
910
|
});
|