@rubytech/create-maxy-code 0.1.492 → 0.1.493
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/plugins/admin/PLUGIN.md +1 -0
- package/payload/platform/plugins/admin/hooks/__tests__/quote-render-pdf-conformance.test.sh +99 -0
- package/payload/platform/plugins/admin/hooks/quote-render-pdf-conformance.sh +108 -0
- package/payload/platform/plugins/admin/skills/agent-builder/references/agent-pattern.md +18 -6
- package/payload/platform/plugins/business-assistant/skills/e-sign/SKILL.md +11 -1
- package/payload/platform/plugins/cloudflare/bin/__tests__/portal-brand-css.test.sh +1 -1
- package/payload/platform/plugins/cloudflare/bin/portal-index-push.mjs +22 -0
- package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-index-push.test.ts +111 -3
- package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-indexed-download.test.ts +13 -0
- package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/download.ts +12 -0
- package/payload/platform/plugins/cloudflare/skills/data-portal/template/portal.js +8 -0
- package/payload/platform/scripts/lib/provision-account-dir.sh +6 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +35 -6
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/index.js +62 -1
- package/payload/platform/services/claude-session-manager/dist/index.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +7 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +9 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/skill-staleness-audit.d.ts +80 -0
- package/payload/platform/services/claude-session-manager/dist/skill-staleness-audit.d.ts.map +1 -0
- package/payload/platform/services/claude-session-manager/dist/skill-staleness-audit.js +216 -0
- package/payload/platform/services/claude-session-manager/dist/skill-staleness-audit.js.map +1 -0
- package/payload/platform/templates/agents/admin/IDENTITY.md +5 -1
- package/payload/platform/templates/agents/passive/IDENTITY.md +2 -0
- package/payload/platform/templates/agents/public/IDENTITY.md +2 -0
- package/payload/platform/templates/specialists/agents/citation-auditor.md +1 -0
- package/payload/platform/templates/specialists/agents/coding-assistant.md +1 -0
- package/payload/platform/templates/specialists/agents/compiled-truth-rewriter.md +3 -0
- package/payload/platform/templates/specialists/agents/content-producer.md +1 -0
- package/payload/platform/templates/specialists/agents/data-manager.md +1 -0
- package/payload/platform/templates/specialists/agents/database-operator.md +1 -0
- package/payload/platform/templates/specialists/agents/librarian.md +1 -0
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -0
- package/payload/platform/templates/specialists/agents/project-manager.md +1 -0
- package/payload/platform/templates/specialists/agents/public-session-reviewer.md +1 -0
- package/payload/platform/templates/specialists/agents/research-assistant.md +3 -0
- package/payload/platform/templates/specialists/agents/typed-edge-classifier.md +1 -0
- package/payload/premium-plugins/writer-craft/agents/writer-craft--manuscript-reviewer.md +3 -0
- package/payload/server/public/assets/{chat-DWvYv9jq.js → chat-1SSmFsjd.js} +1 -1
- package/payload/server/public/assets/{operator-CldXXilj.js → operator-Cxq9TxaH.js} +1 -1
- package/payload/server/public/assets/{page-BIwdWXnv.js → page-DBHzC59_.js} +1 -1
- package/payload/server/public/assets/{public-BKQEQGPE.js → public-jIzvdjt_.js} +1 -1
- package/payload/server/public/chat.html +2 -2
- package/payload/server/public/operator.html +2 -2
- package/payload/server/public/public.html +2 -2
- package/payload/server/server.js +35 -26
package/payload/server/server.js
CHANGED
|
@@ -3498,6 +3498,16 @@ import {
|
|
|
3498
3498
|
getContentType,
|
|
3499
3499
|
normalizeMessageContent
|
|
3500
3500
|
} from "@whiskeysockets/baileys";
|
|
3501
|
+
function extractQuoted(ctx) {
|
|
3502
|
+
const quoted = ctx?.quotedMessage;
|
|
3503
|
+
if (!quoted) return void 0;
|
|
3504
|
+
const qc = extractMessageContent(quoted);
|
|
3505
|
+
return {
|
|
3506
|
+
id: ctx?.stanzaId ?? "",
|
|
3507
|
+
text: qc?.conversation ?? qc?.extendedTextMessage?.text ?? qc?.imageMessage?.caption ?? void 0,
|
|
3508
|
+
sender: ctx?.participant ?? void 0
|
|
3509
|
+
};
|
|
3510
|
+
}
|
|
3501
3511
|
function extractMessage(msg) {
|
|
3502
3512
|
const result = {
|
|
3503
3513
|
text: "",
|
|
@@ -3516,15 +3526,7 @@ function extractMessage(msg) {
|
|
|
3516
3526
|
} else if (inner.extendedTextMessage) {
|
|
3517
3527
|
result.text = inner.extendedTextMessage.text ?? "";
|
|
3518
3528
|
result.mentionedJids = inner.extendedTextMessage.contextInfo?.mentionedJid ?? [];
|
|
3519
|
-
|
|
3520
|
-
if (quoted) {
|
|
3521
|
-
const quotedContent = extractMessageContent(quoted);
|
|
3522
|
-
result.quotedMessage = {
|
|
3523
|
-
id: inner.extendedTextMessage.contextInfo?.stanzaId ?? "",
|
|
3524
|
-
text: quotedContent?.conversation ?? quotedContent?.extendedTextMessage?.text ?? quotedContent?.imageMessage?.caption ?? void 0,
|
|
3525
|
-
sender: inner.extendedTextMessage.contextInfo?.participant ?? void 0
|
|
3526
|
-
};
|
|
3527
|
-
}
|
|
3529
|
+
result.quotedMessage = extractQuoted(inner.extendedTextMessage.contextInfo);
|
|
3528
3530
|
}
|
|
3529
3531
|
if (inner.imageMessage) {
|
|
3530
3532
|
result.mediaType = "image";
|
|
@@ -3532,16 +3534,19 @@ function extractMessage(msg) {
|
|
|
3532
3534
|
result.caption = inner.imageMessage.caption ?? void 0;
|
|
3533
3535
|
if (!result.text && result.caption) result.text = result.caption;
|
|
3534
3536
|
result.mentionedJids = inner.imageMessage.contextInfo?.mentionedJid ?? result.mentionedJids;
|
|
3537
|
+
result.quotedMessage = extractQuoted(inner.imageMessage.contextInfo);
|
|
3535
3538
|
}
|
|
3536
3539
|
if (inner.audioMessage) {
|
|
3537
3540
|
result.mediaType = "audio";
|
|
3538
3541
|
result.mimetype = inner.audioMessage.mimetype ?? void 0;
|
|
3542
|
+
result.quotedMessage = extractQuoted(inner.audioMessage.contextInfo);
|
|
3539
3543
|
}
|
|
3540
3544
|
if (inner.videoMessage) {
|
|
3541
3545
|
result.mediaType = "video";
|
|
3542
3546
|
result.mimetype = inner.videoMessage.mimetype ?? void 0;
|
|
3543
3547
|
result.caption = inner.videoMessage.caption ?? void 0;
|
|
3544
3548
|
if (!result.text && result.caption) result.text = result.caption;
|
|
3549
|
+
result.quotedMessage = extractQuoted(inner.videoMessage.contextInfo);
|
|
3545
3550
|
}
|
|
3546
3551
|
if (inner.documentMessage) {
|
|
3547
3552
|
result.mediaType = "document";
|
|
@@ -3550,6 +3555,7 @@ function extractMessage(msg) {
|
|
|
3550
3555
|
if (!result.text) {
|
|
3551
3556
|
result.text = result.caption ?? `[document: ${inner.documentMessage.fileName ?? "file"}]`;
|
|
3552
3557
|
}
|
|
3558
|
+
result.quotedMessage = extractQuoted(inner.documentMessage.contextInfo);
|
|
3553
3559
|
}
|
|
3554
3560
|
if (inner.stickerMessage) {
|
|
3555
3561
|
result.mediaType = "sticker";
|
|
@@ -10752,6 +10758,18 @@ async function pushAccount(opts) {
|
|
|
10752
10758
|
);
|
|
10753
10759
|
const current = Number(state[0]?.currentGeneration ?? 0);
|
|
10754
10760
|
const next = current + 1;
|
|
10761
|
+
const orphan = await client.query(
|
|
10762
|
+
"SELECT COUNT(*) AS n FROM directory WHERE accountId = ? AND generation = ?",
|
|
10763
|
+
[accountId, next]
|
|
10764
|
+
);
|
|
10765
|
+
const orphanCount = Number(orphan[0]?.n ?? 0);
|
|
10766
|
+
if (orphanCount > 0) {
|
|
10767
|
+
await client.query("DELETE FROM directory WHERE accountId = ? AND generation = ?", [
|
|
10768
|
+
accountId,
|
|
10769
|
+
next
|
|
10770
|
+
]);
|
|
10771
|
+
log2(`${TAG27} op=stage-clear account=${accountId} generation=${next} cleared=${orphanCount}`);
|
|
10772
|
+
}
|
|
10755
10773
|
for (const row of rows) {
|
|
10756
10774
|
await client.query(
|
|
10757
10775
|
"INSERT INTO directory (accountId, relPath, sizeBytes, modifiedAt, indexedAt, isDir, generation) VALUES (?, ?, ?, ?, ?, ?, ?)",
|
|
@@ -13651,7 +13669,7 @@ async function managerActivity(sessionId) {
|
|
|
13651
13669
|
return null;
|
|
13652
13670
|
}
|
|
13653
13671
|
}
|
|
13654
|
-
async function managerInterrupt(sessionId, trigger) {
|
|
13672
|
+
async function managerInterrupt(sessionId, trigger, escalate = false) {
|
|
13655
13673
|
let port2;
|
|
13656
13674
|
try {
|
|
13657
13675
|
port2 = requirePortEnv("CLAUDE_SESSION_MANAGER_PORT", { tag: "webchat:interrupt" });
|
|
@@ -13662,7 +13680,7 @@ async function managerInterrupt(sessionId, trigger) {
|
|
|
13662
13680
|
const res = await fetch(`http://127.0.0.1:${port2}/${sessionId}/interrupt`, {
|
|
13663
13681
|
method: "POST",
|
|
13664
13682
|
headers: { "content-type": "application/json" },
|
|
13665
|
-
body: JSON.stringify({ byte: "esc", trigger }),
|
|
13683
|
+
body: JSON.stringify({ byte: "esc", trigger, ...escalate ? { escalate: true } : {} }),
|
|
13666
13684
|
signal: AbortSignal.timeout(INTERRUPT_TIMEOUT_MS)
|
|
13667
13685
|
});
|
|
13668
13686
|
if (!res.ok) return { ok: false, stopped: false, intId: null, deadChild: false };
|
|
@@ -13943,21 +13961,12 @@ ${note}` : note;
|
|
|
13943
13961
|
}
|
|
13944
13962
|
console.log(`[webchat:inbound] op=send-parsed kind=${kind} files=${stored.length} bytes=${Buffer.byteLength(text, "utf8")}`);
|
|
13945
13963
|
}
|
|
13946
|
-
let deliveredIntId = null;
|
|
13947
13964
|
if (deliverySessionId !== void 0 && await managerActivity(deliverySessionId) === "busy") {
|
|
13948
|
-
|
|
13949
|
-
if (!outcome.stopped) {
|
|
13950
|
-
console.error(`[webchat-interrupt] op=deliver-refused sessionId=${deliverySessionId.slice(0, 8)} intId=${outcome.intId ?? "none"} reason=${outcome.ok ? "not-stopped" : "interrupt-call-failed"}`);
|
|
13951
|
-
return c.json({ error: "interrupt-failed" }, 409);
|
|
13952
|
-
}
|
|
13953
|
-
deliveredIntId = outcome.intId;
|
|
13965
|
+
console.log(`[webchat:inbound] op=queued-busy sessionId=${deliverySessionId.slice(0, 8)} key=${deliveryKey}`);
|
|
13954
13966
|
}
|
|
13955
13967
|
const adminUserId = requesterUserId ?? void 0;
|
|
13956
13968
|
const inboundStartedAt = Date.now();
|
|
13957
13969
|
const inbound = deliverySessionId !== void 0 ? await deps.handleInbound({ role: "admin", accountId: deliveryAccountId, key: deliveryKey, text, sessionId: deliverySessionId, adminUserId }) : await deps.handleInbound({ role: "admin", accountId: bootstrapAccountId, key: deliveryKey, text, adminUserId });
|
|
13958
|
-
if (deliveredIntId !== null) {
|
|
13959
|
-
console.log(`[webchat-interrupt] op=delivered intId=${deliveredIntId} sessionId=${deliverySessionId.slice(0, 8)}`);
|
|
13960
|
-
}
|
|
13961
13970
|
const sendId = sendIdFromResolve ?? ++sendSeq;
|
|
13962
13971
|
let turnSessionId = deliverySessionId;
|
|
13963
13972
|
if (turnSessionId === void 0) {
|
|
@@ -14008,7 +14017,7 @@ ${note}` : note;
|
|
|
14008
14017
|
if (target === void 0) {
|
|
14009
14018
|
return c.json({ error: "no active session" }, 404);
|
|
14010
14019
|
}
|
|
14011
|
-
const outcome = await managerInterrupt(target, "stop-button");
|
|
14020
|
+
const outcome = await managerInterrupt(target, "stop-button", true);
|
|
14012
14021
|
if (!outcome.ok) {
|
|
14013
14022
|
return c.json({ error: "interrupt-failed" }, 502);
|
|
14014
14023
|
}
|
|
@@ -24261,8 +24270,8 @@ app55.post("/", async (c) => {
|
|
|
24261
24270
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
24262
24271
|
}
|
|
24263
24272
|
const host = c.req.header("host") ?? "";
|
|
24264
|
-
const
|
|
24265
|
-
const magicUrl = `${
|
|
24273
|
+
const proto2 = (c.req.header("x-forwarded-proto") ?? "https").toLowerCase();
|
|
24274
|
+
const magicUrl = `${proto2}://${host}/${agentSlug}?token=${token}`;
|
|
24266
24275
|
const subject = `Your link to ${grant.agentSlug}`;
|
|
24267
24276
|
const bodyText = [
|
|
24268
24277
|
grant.displayName ? `Hi ${grant.displayName},` : "Hello,",
|
|
@@ -29754,8 +29763,8 @@ var lastRemoteAuthDisplayName = "";
|
|
|
29754
29763
|
function originFrom(c) {
|
|
29755
29764
|
const host = c.req.header("host");
|
|
29756
29765
|
if (!host) return void 0;
|
|
29757
|
-
const
|
|
29758
|
-
return `${
|
|
29766
|
+
const proto2 = (c.req.header("x-forwarded-proto") ?? "https").split(",")[0].trim().toLowerCase() || "https";
|
|
29767
|
+
return `${proto2}://${host}`;
|
|
29759
29768
|
}
|
|
29760
29769
|
function resolveRemoteAuthOpts(c) {
|
|
29761
29770
|
const origin = originFrom(c);
|