@rubytech/create-maxy 1.0.892 → 1.0.893
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/oauth-llm/dist/index.d.ts +2 -2
- package/payload/platform/lib/oauth-llm/dist/index.js +1 -1
- package/payload/platform/lib/oauth-llm/src/index.ts +2 -2
- package/payload/platform/plugins/admin/PLUGIN.md +1 -2
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.d.ts +2 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.d.ts.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.js +141 -0
- package/payload/platform/plugins/admin/mcp/dist/__tests__/skill-load-required-inputs.test.js.map +1 -0
- package/payload/platform/plugins/admin/mcp/dist/index.js +19 -59
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.d.ts +1 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.d.ts.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.js +48 -0
- package/payload/platform/plugins/admin/mcp/dist/skill-resolution.js.map +1 -1
- package/payload/platform/plugins/docs/references/troubleshooting.md +2 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/llm-classifier.test.js.map +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +4 -2
- package/payload/premium-plugins/real-agency/plugins/brochures/skills/make-brochure/SKILL.md +3 -0
- package/payload/premium-plugins/real-agency/plugins/brochures/skills/property-brochure/SKILL.md +2 -0
- package/payload/server/chunk-4S22HQC6.js +9440 -0
- package/payload/server/chunk-FSJLLIEA.js +3570 -0
- package/payload/server/client-pool-XM2AWBV5.js +34 -0
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/public/assets/{Checkbox-CeujDRv0.js → Checkbox-C6ZCsPvl.js} +1 -1
- package/payload/server/public/assets/{admin-BM3orGyK.js → admin-CaaGEetW.js} +6 -6
- package/payload/server/public/assets/data-CWQQl_ZG.js +1 -0
- package/payload/server/public/assets/graph-CRSLozxc.js +1 -0
- package/payload/server/public/assets/{graph-labels-Co03qEv5.js → graph-labels-CQyZQ0u6.js} +1 -1
- package/payload/server/public/assets/jsx-runtime-DvanDPKm.css +1 -0
- package/payload/server/public/assets/{page-C4E0CWHe.js → page-DOA9eA6p.js} +1 -1
- package/payload/server/public/assets/{page-DGLz4ozf.js → page-TARBO-Yr.js} +1 -1
- package/payload/server/public/assets/{public-rILg7e8-.js → public-9hQfbymC.js} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-D3Upd7Q3.js → useVoiceRecorder-C3xcgryC.js} +1 -1
- package/payload/server/public/data.html +5 -5
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +91 -118
- package/payload/platform/plugins/docs/references/adherence.md +0 -98
- package/payload/server/public/assets/data-LYciLZK9.js +0 -1
- package/payload/server/public/assets/graph-C-SKAbGX.js +0 -1
- package/payload/server/public/assets/jsx-runtime-BcZkJOEw.css +0 -1
- /package/payload/server/public/assets/{jsx-runtime-BWYXu1CT.js → jsx-runtime-vPsBTwUp.js} +0 -0
package/payload/server/server.js
CHANGED
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
clearRateLimit,
|
|
14
14
|
clientIpMiddleware,
|
|
15
15
|
compactSession,
|
|
16
|
-
computeConstraints,
|
|
17
16
|
createRemoteSession,
|
|
18
17
|
deriveComponentAttachmentId,
|
|
19
18
|
deriveComponentMimeType,
|
|
@@ -32,11 +31,9 @@ import {
|
|
|
32
31
|
isRemoteAuthConfigured,
|
|
33
32
|
keyFilePath,
|
|
34
33
|
launchAction,
|
|
35
|
-
load,
|
|
36
34
|
logPath,
|
|
37
35
|
pickComponentBytes,
|
|
38
36
|
recordFailedAttempt,
|
|
39
|
-
render,
|
|
40
37
|
renderLoginPage,
|
|
41
38
|
requireAdminSession,
|
|
42
39
|
resolveBrowserTransport,
|
|
@@ -60,7 +57,7 @@ import {
|
|
|
60
57
|
vncLog,
|
|
61
58
|
waitForExit,
|
|
62
59
|
writeChromiumWrapper
|
|
63
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-4S22HQC6.js";
|
|
64
61
|
import {
|
|
65
62
|
ACCOUNTS_DIR,
|
|
66
63
|
CDP_PORT,
|
|
@@ -118,7 +115,7 @@ import {
|
|
|
118
115
|
validateAgentSlug,
|
|
119
116
|
validateSession,
|
|
120
117
|
walkPremiumBundles
|
|
121
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-FSJLLIEA.js";
|
|
122
119
|
import {
|
|
123
120
|
CLOUDFLARE_TASK_DIAGNOSTICS,
|
|
124
121
|
appendCloudflareSteps,
|
|
@@ -7480,7 +7477,7 @@ var app11 = new Hono();
|
|
|
7480
7477
|
app11.post("/cancel", requireAdminSession, async (c) => {
|
|
7481
7478
|
const session_key = c.var.cacheKey;
|
|
7482
7479
|
try {
|
|
7483
|
-
const { interruptClient: interruptClient2 } = await import("./client-pool-
|
|
7480
|
+
const { interruptClient: interruptClient2 } = await import("./client-pool-XM2AWBV5.js");
|
|
7484
7481
|
await interruptClient2(session_key);
|
|
7485
7482
|
return c.json({ ok: true });
|
|
7486
7483
|
} catch (err) {
|
|
@@ -8828,6 +8825,7 @@ app20.delete("/:id", requireAdminSession, async (c) => {
|
|
|
8828
8825
|
});
|
|
8829
8826
|
app20.post("/:id/resume", async (c) => {
|
|
8830
8827
|
const conversationId = c.req.param("id");
|
|
8828
|
+
const t0 = Date.now();
|
|
8831
8829
|
const signedSessionToken = c.req.query("session_key") ?? "";
|
|
8832
8830
|
if (!signedSessionToken) {
|
|
8833
8831
|
console.error(`[session] middleware-reject status=400 code=session-missing reason="session_key required" path=${c.req.path}`);
|
|
@@ -9090,6 +9088,7 @@ app20.post("/:id/resume", async (c) => {
|
|
|
9090
9088
|
}
|
|
9091
9089
|
const age = formatAge(updatedAt);
|
|
9092
9090
|
console.log(`[admin-resume] ${(/* @__PURE__ */ new Date()).toISOString()} reason=${reason} conversationId=${conversationId.slice(0, 8)}\u2026 age=${age} loaded=${messages.length} messages ${tag} components=${totalComponents} attachments=${totalAttachments} syntheticHidden=${syntheticHidden} jsonlMissing=${jsonlMissing} healMissing=${jsonlHealMissing} cacheKey=${cacheKey.slice(0, 8)}\u2026`);
|
|
9091
|
+
console.log(`[admin-session-restore] cacheKey=${cacheKey.slice(0, 8)} conversationId=${conversationId.slice(0, 8)} messageCount=${rehydrated.length} ms=${Date.now() - t0}`);
|
|
9093
9092
|
return c.json({
|
|
9094
9093
|
conversationId,
|
|
9095
9094
|
messages: rehydrated,
|
|
@@ -12307,31 +12306,6 @@ app33.post("/", async (c) => {
|
|
|
12307
12306
|
});
|
|
12308
12307
|
var file_attach_default = app33;
|
|
12309
12308
|
|
|
12310
|
-
// server/routes/admin/adherence.ts
|
|
12311
|
-
var app34 = new Hono();
|
|
12312
|
-
app34.get("/", requireAdminSession, async (c) => {
|
|
12313
|
-
const agent = c.req.query("agent") ?? "admin";
|
|
12314
|
-
const includeBlock = c.req.query("block") === "1";
|
|
12315
|
-
const account = resolveAccount();
|
|
12316
|
-
if (!account) return c.json({ error: "No account configured" }, 500);
|
|
12317
|
-
try {
|
|
12318
|
-
const ledger = load(account.accountDir, account.accountId, agent);
|
|
12319
|
-
const constraints = computeConstraints(ledger);
|
|
12320
|
-
const body = {
|
|
12321
|
-
ledger,
|
|
12322
|
-
constraints
|
|
12323
|
-
};
|
|
12324
|
-
if (includeBlock) {
|
|
12325
|
-
body.rendered = render(ledger, { blockingRuleIds: constraints.blockingRuleIds });
|
|
12326
|
-
}
|
|
12327
|
-
return c.json(body);
|
|
12328
|
-
} catch (err) {
|
|
12329
|
-
console.error(`[adherence-route] error agent=${agent} err=${err instanceof Error ? err.message : String(err)}`);
|
|
12330
|
-
return c.json({ error: "Failed to read adherence ledger", agent }, 500);
|
|
12331
|
-
}
|
|
12332
|
-
});
|
|
12333
|
-
var adherence_default = app34;
|
|
12334
|
-
|
|
12335
12309
|
// server/routes/admin/sidebar-artefacts.ts
|
|
12336
12310
|
import neo4j3 from "neo4j-driver";
|
|
12337
12311
|
import { readFile as readFile4, readdir as readdir3, stat as stat4 } from "fs/promises";
|
|
@@ -12340,8 +12314,8 @@ import { existsSync as existsSync19 } from "fs";
|
|
|
12340
12314
|
var LIMIT = 50;
|
|
12341
12315
|
var TEXT_MIME_PREFIXES = ["text/", "application/json", "application/markdown"];
|
|
12342
12316
|
var ADMIN_AGENT_FILES = ["IDENTITY.md", "SOUL.md", "KNOWLEDGE.md"];
|
|
12343
|
-
var
|
|
12344
|
-
|
|
12317
|
+
var app34 = new Hono();
|
|
12318
|
+
app34.get("/", requireAdminSession, async (c) => {
|
|
12345
12319
|
const cacheKey = c.var.cacheKey;
|
|
12346
12320
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12347
12321
|
if (!accountId) {
|
|
@@ -12547,7 +12521,7 @@ function isWithin(target, root) {
|
|
|
12547
12521
|
const rel = relative2(root, target);
|
|
12548
12522
|
return !rel.startsWith("..") && !isAbsolute(rel);
|
|
12549
12523
|
}
|
|
12550
|
-
var sidebar_artefacts_default =
|
|
12524
|
+
var sidebar_artefacts_default = app34;
|
|
12551
12525
|
|
|
12552
12526
|
// server/routes/admin/sidebar-artefact-save.ts
|
|
12553
12527
|
import { mkdir as mkdir3, readdir as readdir4, stat as stat5, writeFile as writeFile4 } from "fs/promises";
|
|
@@ -12555,8 +12529,8 @@ import { resolve as resolve16 } from "path";
|
|
|
12555
12529
|
import { existsSync as existsSync20 } from "fs";
|
|
12556
12530
|
var ADMIN_AGENT_FILES2 = /* @__PURE__ */ new Set(["IDENTITY.md", "SOUL.md", "KNOWLEDGE.md"]);
|
|
12557
12531
|
var UUID_RE8 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
12558
|
-
var
|
|
12559
|
-
|
|
12532
|
+
var app35 = new Hono();
|
|
12533
|
+
app35.post("/", requireAdminSession, async (c) => {
|
|
12560
12534
|
const cacheKey = c.var.cacheKey;
|
|
12561
12535
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12562
12536
|
if (!accountId) return c.json({ error: "Account not found for session" }, 401);
|
|
@@ -12668,15 +12642,15 @@ async function resolveSavePath(id, accountId, accountDir) {
|
|
|
12668
12642
|
function relPath(absPath, root) {
|
|
12669
12643
|
return absPath.startsWith(root) ? absPath.slice(root.length + 1) : absPath;
|
|
12670
12644
|
}
|
|
12671
|
-
var sidebar_artefact_save_default =
|
|
12645
|
+
var sidebar_artefact_save_default = app35;
|
|
12672
12646
|
|
|
12673
12647
|
// server/routes/admin/sidebar-artefact-content.ts
|
|
12674
12648
|
import { readFile as readFile5, readdir as readdir5 } from "fs/promises";
|
|
12675
12649
|
import { existsSync as existsSync21 } from "fs";
|
|
12676
12650
|
import { resolve as resolve17 } from "path";
|
|
12677
12651
|
var UUID_RE9 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
12678
|
-
var
|
|
12679
|
-
|
|
12652
|
+
var app36 = new Hono();
|
|
12653
|
+
app36.get("/", requireAdminSession, async (c) => {
|
|
12680
12654
|
const cacheKey = c.var.cacheKey;
|
|
12681
12655
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12682
12656
|
if (!accountId) return new Response("Unauthorized", { status: 401 });
|
|
@@ -12717,7 +12691,7 @@ app37.get("/", requireAdminSession, async (c) => {
|
|
|
12717
12691
|
}
|
|
12718
12692
|
});
|
|
12719
12693
|
});
|
|
12720
|
-
var sidebar_artefact_content_default =
|
|
12694
|
+
var sidebar_artefact_content_default = app36;
|
|
12721
12695
|
|
|
12722
12696
|
// server/routes/admin/health.ts
|
|
12723
12697
|
import { existsSync as existsSync22, readFileSync as readFileSync16 } from "fs";
|
|
@@ -12762,8 +12736,8 @@ async function probeConversationDb() {
|
|
|
12762
12736
|
});
|
|
12763
12737
|
}
|
|
12764
12738
|
}
|
|
12765
|
-
var
|
|
12766
|
-
|
|
12739
|
+
var app37 = new Hono();
|
|
12740
|
+
app37.get("/", async (c) => {
|
|
12767
12741
|
const version = readVersion();
|
|
12768
12742
|
const probe = await probeConversationDb();
|
|
12769
12743
|
const uptimeMs = Date.now() - new Date(PROCESS_STARTED_AT).getTime();
|
|
@@ -12785,40 +12759,39 @@ app38.get("/", async (c) => {
|
|
|
12785
12759
|
uptimeMs
|
|
12786
12760
|
});
|
|
12787
12761
|
});
|
|
12788
|
-
var health_default2 =
|
|
12762
|
+
var health_default2 = app37;
|
|
12789
12763
|
|
|
12790
12764
|
// server/routes/admin/index.ts
|
|
12791
|
-
var
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12806
|
-
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
var admin_default = app39;
|
|
12765
|
+
var app38 = new Hono();
|
|
12766
|
+
app38.route("/session", session_default2);
|
|
12767
|
+
app38.route("/chat", chat_default2);
|
|
12768
|
+
app38.route("/chat-failure", chat_failure_default);
|
|
12769
|
+
app38.route("/failure-report", failure_report_default);
|
|
12770
|
+
app38.route("/sse-telemetry", sse_telemetry_default);
|
|
12771
|
+
app38.route("/compact", compact_default);
|
|
12772
|
+
app38.route("/logs", logs_default);
|
|
12773
|
+
app38.route("/claude-info", claude_info_default);
|
|
12774
|
+
app38.route("/attachment", attachment_default);
|
|
12775
|
+
app38.route("/agents", agents_default);
|
|
12776
|
+
app38.route("/sessions", sessions_default);
|
|
12777
|
+
app38.route("/browser", browser_default);
|
|
12778
|
+
app38.route("/browser-iframe", browser_iframe_default);
|
|
12779
|
+
app38.route("/device-browser", device_browser_default);
|
|
12780
|
+
app38.route("/events", events_default);
|
|
12781
|
+
app38.route("/cloudflare", cloudflare_default);
|
|
12782
|
+
app38.route("/files", files_default);
|
|
12783
|
+
app38.route("/graph-search", graph_search_default);
|
|
12784
|
+
app38.route("/graph-subgraph", graph_subgraph_default);
|
|
12785
|
+
app38.route("/graph-delete", graph_delete_default);
|
|
12786
|
+
app38.route("/graph-restore", graph_restore_default);
|
|
12787
|
+
app38.route("/graph-labels-in-graph", graph_labels_in_graph_default);
|
|
12788
|
+
app38.route("/graph-default-view", graph_default_view_default);
|
|
12789
|
+
app38.route("/file-attach", file_attach_default);
|
|
12790
|
+
app38.route("/sidebar-artefacts", sidebar_artefacts_default);
|
|
12791
|
+
app38.route("/sidebar-artefact-save", sidebar_artefact_save_default);
|
|
12792
|
+
app38.route("/sidebar-artefact-content", sidebar_artefact_content_default);
|
|
12793
|
+
app38.route("/health-brand", health_default2);
|
|
12794
|
+
var admin_default = app38;
|
|
12822
12795
|
|
|
12823
12796
|
// server/routes/sites.ts
|
|
12824
12797
|
import { existsSync as existsSync23, readFileSync as readFileSync17, realpathSync as realpathSync4, statSync as statSync7 } from "fs";
|
|
@@ -12853,8 +12826,8 @@ function getExt(p) {
|
|
|
12853
12826
|
if (idx < p.lastIndexOf("/")) return "";
|
|
12854
12827
|
return p.slice(idx).toLowerCase();
|
|
12855
12828
|
}
|
|
12856
|
-
var
|
|
12857
|
-
|
|
12829
|
+
var app39 = new Hono();
|
|
12830
|
+
app39.get("/:rel{.*}", (c) => {
|
|
12858
12831
|
const reqPath = c.req.path;
|
|
12859
12832
|
const rawRel = c.req.param("rel") ?? "";
|
|
12860
12833
|
const trimmed = rawRel.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
@@ -12957,7 +12930,7 @@ app40.get("/:rel{.*}", (c) => {
|
|
|
12957
12930
|
"X-Content-Type-Options": "nosniff"
|
|
12958
12931
|
});
|
|
12959
12932
|
});
|
|
12960
|
-
var sites_default =
|
|
12933
|
+
var sites_default = app39;
|
|
12961
12934
|
|
|
12962
12935
|
// app/lib/graph-health.ts
|
|
12963
12936
|
var HOUR_MS = 60 * 60 * 1e3;
|
|
@@ -13367,9 +13340,9 @@ watchFile(ALIAS_DOMAINS_PATH2, { interval: 2e3 }, () => {
|
|
|
13367
13340
|
function isPublicHost(host) {
|
|
13368
13341
|
return host.startsWith("public.") || aliasDomains.has(host);
|
|
13369
13342
|
}
|
|
13370
|
-
var
|
|
13371
|
-
|
|
13372
|
-
|
|
13343
|
+
var app40 = new Hono();
|
|
13344
|
+
app40.use("*", clientIpMiddleware);
|
|
13345
|
+
app40.use("*", async (c, next) => {
|
|
13373
13346
|
await next();
|
|
13374
13347
|
c.header("X-Content-Type-Options", "nosniff");
|
|
13375
13348
|
c.header("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
@@ -13379,7 +13352,7 @@ app41.use("*", async (c, next) => {
|
|
|
13379
13352
|
);
|
|
13380
13353
|
});
|
|
13381
13354
|
var HTTP_LOG_PATHS = /* @__PURE__ */ new Set(["/vnc-viewer.html", "/vnc-popout.html"]);
|
|
13382
|
-
|
|
13355
|
+
app40.use("*", async (c, next) => {
|
|
13383
13356
|
if (!HTTP_LOG_PATHS.has(c.req.path)) {
|
|
13384
13357
|
await next();
|
|
13385
13358
|
return;
|
|
@@ -13412,7 +13385,7 @@ var PUBLIC_ALLOWED_PREFIXES = [
|
|
|
13412
13385
|
"/sites/"
|
|
13413
13386
|
];
|
|
13414
13387
|
var PUBLIC_ALLOWED_EXACT = ["/favicon.ico"];
|
|
13415
|
-
|
|
13388
|
+
app40.use("*", async (c, next) => {
|
|
13416
13389
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13417
13390
|
if (!isPublicHost(host)) {
|
|
13418
13391
|
await next();
|
|
@@ -13452,7 +13425,7 @@ function resolveRemoteAuthOpts() {
|
|
|
13452
13425
|
return brandLoginOpts;
|
|
13453
13426
|
}
|
|
13454
13427
|
var MAX_LOGIN_BODY = 8 * 1024;
|
|
13455
|
-
|
|
13428
|
+
app40.post("/__remote-auth/login", async (c) => {
|
|
13456
13429
|
const client = clientFrom(c);
|
|
13457
13430
|
const clientIp = client.ip || "unknown";
|
|
13458
13431
|
if (!requestIsTlsTerminated(c)) {
|
|
@@ -13497,7 +13470,7 @@ app41.post("/__remote-auth/login", async (c) => {
|
|
|
13497
13470
|
}
|
|
13498
13471
|
});
|
|
13499
13472
|
});
|
|
13500
|
-
|
|
13473
|
+
app40.get("/__remote-auth/logout", (c) => {
|
|
13501
13474
|
const client = clientFrom(c);
|
|
13502
13475
|
const clientIp = client.ip || "unknown";
|
|
13503
13476
|
console.error(`[remote-auth] logout ip=${clientIp}`);
|
|
@@ -13510,7 +13483,7 @@ app41.get("/__remote-auth/logout", (c) => {
|
|
|
13510
13483
|
}
|
|
13511
13484
|
});
|
|
13512
13485
|
});
|
|
13513
|
-
|
|
13486
|
+
app40.post("/__remote-auth/change-password", async (c) => {
|
|
13514
13487
|
const client = clientFrom(c);
|
|
13515
13488
|
const clientIp = client.ip || "unknown";
|
|
13516
13489
|
const rateLimited = checkRateLimit(client);
|
|
@@ -13561,13 +13534,13 @@ app41.post("/__remote-auth/change-password", async (c) => {
|
|
|
13561
13534
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "change", changeError: "Failed to save password", redirect }), 200);
|
|
13562
13535
|
}
|
|
13563
13536
|
});
|
|
13564
|
-
|
|
13537
|
+
app40.get("/__remote-auth/setup", (c) => {
|
|
13565
13538
|
if (isRemoteAuthConfigured()) {
|
|
13566
13539
|
return c.redirect("/");
|
|
13567
13540
|
}
|
|
13568
13541
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup" }), 200);
|
|
13569
13542
|
});
|
|
13570
|
-
|
|
13543
|
+
app40.post("/__remote-auth/set-initial-password", async (c) => {
|
|
13571
13544
|
if (isRemoteAuthConfigured()) {
|
|
13572
13545
|
return c.redirect("/");
|
|
13573
13546
|
}
|
|
@@ -13605,10 +13578,10 @@ app41.post("/__remote-auth/set-initial-password", async (c) => {
|
|
|
13605
13578
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
|
|
13606
13579
|
}
|
|
13607
13580
|
});
|
|
13608
|
-
|
|
13581
|
+
app40.get("/api/remote-auth/status", (c) => {
|
|
13609
13582
|
return c.json({ configured: isRemoteAuthConfigured() });
|
|
13610
13583
|
});
|
|
13611
|
-
|
|
13584
|
+
app40.post("/api/remote-auth/set-password", async (c) => {
|
|
13612
13585
|
let body;
|
|
13613
13586
|
try {
|
|
13614
13587
|
body = await c.req.json();
|
|
@@ -13639,9 +13612,9 @@ app41.post("/api/remote-auth/set-password", async (c) => {
|
|
|
13639
13612
|
return c.json({ error: "Failed to save password" }, 500);
|
|
13640
13613
|
}
|
|
13641
13614
|
});
|
|
13642
|
-
|
|
13615
|
+
app40.route("/api/_client-error", client_error_default);
|
|
13643
13616
|
console.log("[client-error-route] mounted");
|
|
13644
|
-
|
|
13617
|
+
app40.use("*", async (c, next) => {
|
|
13645
13618
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13646
13619
|
const path2 = c.req.path;
|
|
13647
13620
|
if (path2 === "/favicon.ico" || path2.startsWith("/assets/") || path2.startsWith("/brand/")) {
|
|
@@ -13681,15 +13654,15 @@ app41.use("*", async (c, next) => {
|
|
|
13681
13654
|
console.error(`[remote-auth] login required ip=${clientIp} path=${path2} ${disambig}`);
|
|
13682
13655
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), redirect: path2 }), 200);
|
|
13683
13656
|
});
|
|
13684
|
-
|
|
13685
|
-
|
|
13686
|
-
|
|
13687
|
-
|
|
13688
|
-
|
|
13689
|
-
|
|
13690
|
-
|
|
13691
|
-
|
|
13692
|
-
|
|
13657
|
+
app40.route("/api/health", health_default);
|
|
13658
|
+
app40.route("/api/session", session_default);
|
|
13659
|
+
app40.route("/api/chat", chat_default);
|
|
13660
|
+
app40.route("/api/group", group_default);
|
|
13661
|
+
app40.route("/api/access", access_default);
|
|
13662
|
+
app40.route("/api/telegram", telegram_default);
|
|
13663
|
+
app40.route("/api/whatsapp", whatsapp_default);
|
|
13664
|
+
app40.route("/api/onboarding", onboarding_default);
|
|
13665
|
+
app40.route("/api/admin", admin_default);
|
|
13693
13666
|
var SAFE_SLUG_RE = /^[a-z][a-z0-9-]{2,49}$/;
|
|
13694
13667
|
var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
|
|
13695
13668
|
var IMAGE_MIME = {
|
|
@@ -13701,7 +13674,7 @@ var IMAGE_MIME = {
|
|
|
13701
13674
|
".svg": "image/svg+xml",
|
|
13702
13675
|
".ico": "image/x-icon"
|
|
13703
13676
|
};
|
|
13704
|
-
|
|
13677
|
+
app40.get("/agent-assets/:slug/:filename", (c) => {
|
|
13705
13678
|
const slug = c.req.param("slug");
|
|
13706
13679
|
const filename = c.req.param("filename");
|
|
13707
13680
|
if (!SAFE_SLUG_RE.test(slug)) {
|
|
@@ -13736,7 +13709,7 @@ app41.get("/agent-assets/:slug/:filename", (c) => {
|
|
|
13736
13709
|
"Cache-Control": "public, max-age=3600"
|
|
13737
13710
|
});
|
|
13738
13711
|
});
|
|
13739
|
-
|
|
13712
|
+
app40.get("/generated/:filename", (c) => {
|
|
13740
13713
|
const filename = c.req.param("filename");
|
|
13741
13714
|
if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
|
|
13742
13715
|
console.error(`[generated] serve file=${filename} status=403`);
|
|
@@ -13766,7 +13739,7 @@ app41.get("/generated/:filename", (c) => {
|
|
|
13766
13739
|
"Cache-Control": "public, max-age=86400"
|
|
13767
13740
|
});
|
|
13768
13741
|
});
|
|
13769
|
-
|
|
13742
|
+
app40.route("/sites", sites_default);
|
|
13770
13743
|
var htmlCache = /* @__PURE__ */ new Map();
|
|
13771
13744
|
var brandLogoPath = "/brand/maxy-monochrome.png";
|
|
13772
13745
|
var brandIconPath = "/brand/maxy-monochrome.png";
|
|
@@ -13903,7 +13876,7 @@ function brandedPublicHtml(agentSlug) {
|
|
|
13903
13876
|
function escapeHtml(s) {
|
|
13904
13877
|
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
13905
13878
|
}
|
|
13906
|
-
|
|
13879
|
+
app40.get("/", (c) => {
|
|
13907
13880
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13908
13881
|
if (isPublicHost(host)) {
|
|
13909
13882
|
const defaultSlug = resolveDefaultSlug();
|
|
@@ -13911,12 +13884,12 @@ app41.get("/", (c) => {
|
|
|
13911
13884
|
}
|
|
13912
13885
|
return c.html(cachedHtml("index.html"));
|
|
13913
13886
|
});
|
|
13914
|
-
|
|
13887
|
+
app40.get("/public", (c) => {
|
|
13915
13888
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13916
13889
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
13917
13890
|
return c.html(cachedHtml("public.html"));
|
|
13918
13891
|
});
|
|
13919
|
-
|
|
13892
|
+
app40.get("/chat", (c) => {
|
|
13920
13893
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13921
13894
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
13922
13895
|
return c.html(cachedHtml("public.html"));
|
|
@@ -13935,9 +13908,9 @@ async function logViewerFetch(c, next) {
|
|
|
13935
13908
|
duration_ms: Date.now() - start
|
|
13936
13909
|
});
|
|
13937
13910
|
}
|
|
13938
|
-
|
|
13939
|
-
|
|
13940
|
-
|
|
13911
|
+
app40.use("/vnc-viewer.html", logViewerFetch);
|
|
13912
|
+
app40.use("/vnc-popout.html", logViewerFetch);
|
|
13913
|
+
app40.get("/vnc-popout.html", (c) => {
|
|
13941
13914
|
let html = htmlCache.get("vnc-popout.html");
|
|
13942
13915
|
if (!html) {
|
|
13943
13916
|
html = readFileSync19(resolve21(process.cwd(), "public", "vnc-popout.html"), "utf-8");
|
|
@@ -13950,7 +13923,7 @@ app41.get("/vnc-popout.html", (c) => {
|
|
|
13950
13923
|
}
|
|
13951
13924
|
return c.html(html);
|
|
13952
13925
|
});
|
|
13953
|
-
|
|
13926
|
+
app40.post("/api/vnc/client-event", async (c) => {
|
|
13954
13927
|
let body;
|
|
13955
13928
|
try {
|
|
13956
13929
|
body = await c.req.json();
|
|
@@ -13971,20 +13944,20 @@ app41.post("/api/vnc/client-event", async (c) => {
|
|
|
13971
13944
|
});
|
|
13972
13945
|
return c.json({ ok: true });
|
|
13973
13946
|
});
|
|
13974
|
-
|
|
13947
|
+
app40.get("/g/:slug", (c) => {
|
|
13975
13948
|
return c.html(brandedPublicHtml());
|
|
13976
13949
|
});
|
|
13977
|
-
|
|
13950
|
+
app40.get("/graph", (c) => {
|
|
13978
13951
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13979
13952
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
13980
13953
|
return c.html(cachedHtml("graph.html"));
|
|
13981
13954
|
});
|
|
13982
|
-
|
|
13955
|
+
app40.get("/data", (c) => {
|
|
13983
13956
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
13984
13957
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
13985
13958
|
return c.html(cachedHtml("data.html"));
|
|
13986
13959
|
});
|
|
13987
|
-
|
|
13960
|
+
app40.get("/:slug", async (c, next) => {
|
|
13988
13961
|
const slug = c.req.param("slug");
|
|
13989
13962
|
if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
|
|
13990
13963
|
const branding = loadBrandingCache(slug);
|
|
@@ -13994,15 +13967,15 @@ app41.get("/:slug", async (c, next) => {
|
|
|
13994
13967
|
await next();
|
|
13995
13968
|
});
|
|
13996
13969
|
if (brandFaviconPath !== "/favicon.ico") {
|
|
13997
|
-
|
|
13970
|
+
app40.get("/favicon.ico", (c) => {
|
|
13998
13971
|
c.header("Cache-Control", "public, max-age=300");
|
|
13999
13972
|
return c.redirect(brandFaviconPath, 302);
|
|
14000
13973
|
});
|
|
14001
13974
|
}
|
|
14002
|
-
|
|
13975
|
+
app40.use("/*", serveStatic({ root: "./public" }));
|
|
14003
13976
|
var port = parseInt(process.env.MAXY_UI_INTERNAL_PORT ?? process.env.PORT ?? "19199", 10);
|
|
14004
13977
|
var hostname = process.env.HOSTNAME ?? "127.0.0.1";
|
|
14005
|
-
var httpServer = serve({ fetch:
|
|
13978
|
+
var httpServer = serve({ fetch: app40.fetch, port, hostname });
|
|
14006
13979
|
console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
14007
13980
|
console.log("[boot] auth-mode summary: oauth=8 api-key=1 (api-key consumer: invokePublicAgent only)");
|
|
14008
13981
|
var SUBAPP_MANIFEST = [
|
|
@@ -14023,7 +13996,7 @@ for (const m of SUBAPP_MANIFEST) {
|
|
|
14023
13996
|
}
|
|
14024
13997
|
try {
|
|
14025
13998
|
const registered = [];
|
|
14026
|
-
for (const r of
|
|
13999
|
+
for (const r of app40.routes ?? []) {
|
|
14027
14000
|
if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
|
|
14028
14001
|
if (AGENT_SLUG_PATTERN.test(r.path)) {
|
|
14029
14002
|
registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
# Adherence Fidelity
|
|
2
|
-
|
|
3
|
-
User-facing reference for the attention-weighted correction ledger that makes agent adherence compound. Canonical platform documentation lives at [`.docs/agents.md`](../../../../.docs/agents.md) § Adherence Fidelity — this reference mirrors the same behaviour for operators reading plugin docs.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## What it solves
|
|
8
|
-
|
|
9
|
-
The agent's prerogatives (PRECISE, CONCISE, EVIDENCE-BASED) are prose at the top of every system prompt. Without a compounding mechanism, a rule corrected 50 times has the same attention weight as a rule corrected once. Adherence Fidelity adds a per-agent ledger whose rendered summary is inserted into the system prompt every turn, so the agent sees its own recidivism with counts, samples, and recency.
|
|
10
|
-
|
|
11
|
-
## How an operator sees it
|
|
12
|
-
|
|
13
|
-
**In chat:** ask the agent *"what is my adherence score?"* or *"what are my top rule violations?"* The admin agent answers via the `adherence-read` tool, which reads the ledger file on disk — the number is authoritative.
|
|
14
|
-
|
|
15
|
-
**Via API:** `GET /api/admin/adherence?agent=admin` returns the ledger JSON, plus `constraints` (whether capability routing is active for the next turn) and an optional `rendered` block when called with `?block=1`.
|
|
16
|
-
|
|
17
|
-
**On the filesystem:** `{accountDir}/agents/{agentName}/adherence-ledger.json` is the source of truth. `jq` queries work directly:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
jq '{score, top: (.rules | sort_by(-.count) | .[0])}' \
|
|
21
|
-
~/.maxy/<accountId>/agents/admin/adherence-ledger.json
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Score
|
|
25
|
-
|
|
26
|
-
```
|
|
27
|
-
score = 100 × (1 − rules_violating_in_rolling_7d / n_rules)
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
An agent with three rules, zero of which have a violation in the last 7 days, scores 100%. One out of three scores 67%. All three scores 0%.
|
|
31
|
-
|
|
32
|
-
## Top offenders
|
|
33
|
-
|
|
34
|
-
The rendered ledger block bolds the top-3 rules by `count` (all-time, not just the rolling window) and quotes their most recent `last_sample`. Rules 4 through 10 appear as one-liners. Zero-recidivism rules (`count = 0` and `rolling_7d = 0`) are omitted entirely.
|
|
35
|
-
|
|
36
|
-
Sort order: `count DESC, last_violated_at DESC`.
|
|
37
|
-
|
|
38
|
-
## Capability routing at threshold
|
|
39
|
-
|
|
40
|
-
When any rule's `rolling_7d` reaches `5`, the next turn's spawn is clamped:
|
|
41
|
-
|
|
42
|
-
- `--max-turns` drops to `5` — the agent has fewer turns to sprawl.
|
|
43
|
-
- Non-core tools drop from the allowed set (currently the specialist roles).
|
|
44
|
-
- The offending rule renders with a `BLOCKING:` prefix in the ledger block so it dominates the prompt.
|
|
45
|
-
|
|
46
|
-
The constraint is computed once per turn at the top of `invokeAgent` and frozen for that spawn — one-turn granularity. The next turn reads the updated ledger and re-evaluates, so a single clean turn begins to lift the constraint as `rolling_7d` decays.
|
|
47
|
-
|
|
48
|
-
## Data flow per turn
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
┌─ Pre-turn ────────────────────────────────────┐
|
|
52
|
-
│ loadAdherenceLedger(accountDir, accountId) │
|
|
53
|
-
│ renderAdherenceLedger(ledger, blockingRules) │
|
|
54
|
-
│ → inject at <!-- ADHERENCE-LEDGER-INSERT --> │
|
|
55
|
-
│ computeConstraints(ledger) │
|
|
56
|
-
│ → clamp max-turns, drop tools │
|
|
57
|
-
└────────────────────────────────────────────────┘
|
|
58
|
-
│
|
|
59
|
-
▼
|
|
60
|
-
Assistant stream
|
|
61
|
-
│
|
|
62
|
-
▼
|
|
63
|
-
┌─ Post-turn ───────────────────────────────────┐
|
|
64
|
-
│ criticAndRecord(responseText) — Haiku │
|
|
65
|
-
│ → verdict=pass → recordPass() │
|
|
66
|
-
│ → verdict=violation → recordViolation() │
|
|
67
|
-
│ Fire-and-forget. Non-blocking. │
|
|
68
|
-
└────────────────────────────────────────────────┘
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## What the ledger file looks like
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
{
|
|
75
|
-
"agent_id": "admin",
|
|
76
|
-
"account_id": "abc123...",
|
|
77
|
-
"rules": [
|
|
78
|
-
{
|
|
79
|
-
"rule_id": "PRECISE",
|
|
80
|
-
"canonical_text": "Use exact names...",
|
|
81
|
-
"rule_family": "prerogative",
|
|
82
|
-
"count": 7,
|
|
83
|
-
"violations": ["2026-04-19T10:12:00Z", "..."],
|
|
84
|
-
"last_violated_at": "2026-04-21T09:30:12Z",
|
|
85
|
-
"last_sample": "Something that paraphrased tool output…",
|
|
86
|
-
"current_streak": 2,
|
|
87
|
-
"rolling_7d": 5
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
"updated_at": "2026-04-21T09:30:13Z"
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
## Limits and deferrals
|
|
95
|
-
|
|
96
|
-
v1 covers the admin agent only. Specialist subagents (`specialists:personal-assistant`, `specialists:project-manager`, `specialists:research-assistant`, `specialists:content-producer`, `specialists:database-operator`) do not receive their own ledger injection yet — their `.md` templates load via `--plugin-dir` and have no TS-side assembly site. Follow-up task filed.
|
|
97
|
-
|
|
98
|
-
No cross-agent rule inheritance, no user-visible correction-ack signal, no blocking-critic retry loop in v1 — each is a separate follow-up task. See [`.docs/agents.md`](../../../../.docs/agents.md) § Adherence Fidelity for the full deferral list with task numbers.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,t}from"./jsx-runtime-BWYXu1CT.js";import{t as n}from"./page-C4E0CWHe.js";import"./graph-labels-Co03qEv5.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-BWYXu1CT.js";import{n}from"./page-DGLz4ozf.js";import"./graph-labels-Co03qEv5.js";import"./Checkbox-CeujDRv0.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
|