@rubytech/create-maxy-code 0.1.446 → 0.1.447
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-style/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-style/dist/index.js +6 -0
- package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-style/src/index.ts +7 -0
- package/payload/platform/neo4j/schema.cypher +32 -1
- package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
- package/payload/platform/plugins/admin/hooks/lib/maxy-mcp-plugins.txt +1 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +42 -5
- package/payload/platform/plugins/docs/references/calendar-booking.md +18 -1
- package/payload/platform/plugins/docs/references/claudeai-connectors.md +15 -0
- package/payload/platform/plugins/docs/references/outlook-guide.md +8 -3
- package/payload/platform/plugins/email/skills/email-composition/SKILL.md +4 -4
- package/payload/platform/plugins/memory/references/schema-construction.md +7 -2
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +23 -5
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit.test.js +70 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-edit.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/html-to-text.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/html-to-text.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/html-to-text.test.js +22 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/html-to-text.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-delete.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-delete.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-delete.test.js +60 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-delete.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-fetch-body.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-fetch-body.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-fetch-body.test.js +80 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-fetch-body.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-otp-extract.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-otp-extract.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-otp-extract.test.js +90 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-otp-extract.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-reply.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-reply.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-reply.test.js +194 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-reply.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/otp.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/otp.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/otp.test.js +16 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/otp.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/outbound-attachments.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/outbound-attachments.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/outbound-attachments.test.js +103 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/outbound-attachments.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js +88 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/html-to-text.d.ts +9 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/html-to-text.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/html-to-text.js +24 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/html-to-text.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/otp.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/otp.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/otp.js +49 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/otp.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.d.ts +58 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.js +127 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/outbound-attachments.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/upload-session.d.ts +28 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/upload-session.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/upload-session.js +54 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/upload-session.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.d.ts +21 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js +38 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-delete.d.ts +14 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-delete.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-delete.js +39 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-delete.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts +23 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js +44 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-otp-extract.d.ts +22 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-otp-extract.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-otp-extract.js +90 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-otp-extract.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.d.ts +27 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.js +75 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.js.map +1 -0
- package/payload/platform/plugins/outlook/references/graph-surfaces.md +57 -1
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +15 -4
- package/payload/platform/plugins/scheduling/PLUGIN.md +15 -0
- package/payload/platform/plugins/scheduling/mcp/dist/index.js +29 -1
- package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/booking-reconcile.test.js +53 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/booking-reconcile.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.d.ts +21 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.js +80 -0
- package/payload/platform/plugins/scheduling/mcp/dist/lib/booking-reconcile.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.d.ts +4 -0
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js +68 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-connector-busy-sync.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-connector-busy-sync.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-connector-busy-sync.test.js +75 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-connector-busy-sync.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-connector-busy-sync.d.ts +31 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-connector-busy-sync.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-connector-busy-sync.js +41 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-connector-busy-sync.js.map +1 -0
- package/payload/platform/plugins/voice-mirror/.claude-plugin/plugin.json +21 -0
- package/payload/platform/plugins/voice-mirror/PLUGIN.md +72 -0
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/index.js +10 -10
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/index.js.map +1 -1
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/neo4j.d.ts +1 -1
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/neo4j.js +4 -4
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/neo4j.js.map +1 -1
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-record-feedback.js +1 -1
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-record-feedback.js.map +1 -1
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/package-lock.json +2 -2
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/package.json +1 -1
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/scripts/smoke.mjs +9 -9
- package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/skills/voice-mirror/SKILL.md +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +12 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/templates/agents/admin/AGENTS.md +1 -1
- package/payload/platform/templates/specialists/agents/content-producer.md +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +6 -2
- package/payload/premium-plugins/writer-craft/.claude-plugin/plugin.json +1 -14
- package/payload/premium-plugins/writer-craft/PLUGIN.md +2 -51
- package/payload/server/public/assets/{AdminLoginScreens-D9L-CuWi.js → AdminLoginScreens-Bvf4HKmq.js} +1 -1
- package/payload/server/public/assets/AdminShell-CaGc8ODG.js +2 -0
- package/payload/server/public/assets/{Checkbox-CFdt8ljo.js → Checkbox-2SswiICc.js} +1 -1
- package/payload/server/public/assets/admin-B7GPCzpr.js +1 -0
- package/payload/server/public/assets/browser-CodHC_MO.js +1 -0
- package/payload/server/public/assets/calendar-DH7cyXKF.js +1 -0
- package/payload/server/public/assets/chat-BQyPAEMv.js +1 -0
- package/payload/server/public/assets/chevron-left-Cmev0R9v.js +1 -0
- package/payload/server/public/assets/data-DWxZzMfL.js +1 -0
- package/payload/server/public/assets/{graph-DrE7KupQ.js → graph-BToB78LG.js} +2 -2
- package/payload/server/public/assets/graph-labels-JRGrstzM.js +1 -0
- package/payload/server/public/assets/maximize-2-CEQRv64B.js +1 -0
- package/payload/server/public/assets/operator-Cx8cq2wf.js +1 -0
- package/payload/server/public/assets/page-D6kzsk18.js +32 -0
- package/payload/server/public/assets/page-TCsQy4eP.js +1 -0
- package/payload/server/public/assets/public-B61xcmAr.js +1 -0
- package/payload/server/public/assets/{rotate-ccw-Cqp4oqHV.js → rotate-ccw-7_3ol0Z4.js} +1 -1
- package/payload/server/public/assets/{tasks-bQKOhMga.js → tasks-BY9ajKXf.js} +1 -1
- package/payload/server/public/assets/{time-entry-format-BIL4ZaDK.js → time-entry-format-DmNhIJnM.js} +1 -1
- package/payload/server/public/assets/useCopyFeedback-C5-GOl5l.js +1 -0
- package/payload/server/public/assets/useSelectionMode-UOUVnP9B.js +1 -0
- package/payload/server/public/assets/{useSubAccountSwitcher-CVHKTSst.css → useSubAccountSwitcher-DgM1ergs.css} +1 -1
- package/payload/server/public/assets/useVoiceRecorder-BAP3yGxs.js +2 -0
- package/payload/server/public/browser.html +5 -5
- package/payload/server/public/calendar.html +6 -6
- package/payload/server/public/chat.html +12 -12
- package/payload/server/public/data.html +10 -10
- package/payload/server/public/graph.html +11 -11
- package/payload/server/public/index.html +13 -13
- package/payload/server/public/operator.html +14 -14
- package/payload/server/public/public.html +12 -12
- package/payload/server/public/tasks.html +5 -5
- package/payload/server/server.js +349 -171
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts +0 -8
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.d.ts.map +0 -1
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js +0 -71
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/dist/index.js.map +0 -1
- package/payload/premium-plugins/writer-craft/lib/mcp-lifeline/package.json +0 -7
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts +0 -51
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.d.ts.map +0 -1
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js +0 -196
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/dist/index.js.map +0 -1
- package/payload/premium-plugins/writer-craft/lib/mcp-stderr-tee/package.json +0 -7
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts +0 -3
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.d.ts.map +0 -1
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js +0 -58
- package/payload/premium-plugins/writer-craft/mcp/dist/cli/ingest-session-text.js.map +0 -1
- package/payload/premium-plugins/writer-craft/mcp/src/index.ts +0 -457
- package/payload/premium-plugins/writer-craft/mcp/src/lib/neo4j.ts +0 -56
- package/payload/premium-plugins/writer-craft/mcp/src/lib/voice-corpus.ts +0 -154
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-distil-profile.ts +0 -833
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-ingest-session-text.ts +0 -153
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-record-feedback.ts +0 -148
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-retrieve-conditioning.ts +0 -270
- package/payload/premium-plugins/writer-craft/mcp/src/tools/voice-tag-content.ts +0 -181
- package/payload/premium-plugins/writer-craft/mcp/tsconfig.json +0 -8
- package/payload/server/public/assets/AdminShell-DSQrvZXq.js +0 -2
- package/payload/server/public/assets/admin-Ch4n-G0j.js +0 -1
- package/payload/server/public/assets/browser-B2AIxiuk.js +0 -1
- package/payload/server/public/assets/calendar-BvItH3B0.js +0 -1
- package/payload/server/public/assets/chat-eQFMaX9y.js +0 -1
- package/payload/server/public/assets/chevron-left-D2AnCEyE.js +0 -1
- package/payload/server/public/assets/data-BzOmbHoe.js +0 -1
- package/payload/server/public/assets/file-download-CK9j_Jx2.js +0 -1
- package/payload/server/public/assets/graph-labels-CwEtvIRV.js +0 -1
- package/payload/server/public/assets/maximize-2-CuzEom3K.js +0 -1
- package/payload/server/public/assets/operator-DlboYPPu.js +0 -1
- package/payload/server/public/assets/page-BuWH5gNK.js +0 -1
- package/payload/server/public/assets/page-Co9E8U5x.js +0 -32
- package/payload/server/public/assets/public-DtFpPMTG.js +0 -1
- package/payload/server/public/assets/useCopyFeedback-rB8QuqyH.js +0 -1
- package/payload/server/public/assets/useVoiceRecorder-Ctny8qWx.js +0 -2
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/lib/mcp-spawn-tee/index.js +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/lib/mcp-spawn-tee/package.json +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/index.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/index.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/neo4j.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/voice-corpus.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/voice-corpus.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/voice-corpus.js +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/lib/voice-corpus.js.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-distil-profile.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-distil-profile.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-distil-profile.js +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-distil-profile.js.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-ingest-session-text.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-ingest-session-text.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-ingest-session-text.js +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-ingest-session-text.js.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-record-feedback.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-record-feedback.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-retrieve-conditioning.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-retrieve-conditioning.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-retrieve-conditioning.js +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-retrieve-conditioning.js.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-tag-content.d.ts +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-tag-content.d.ts.map +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-tag-content.js +0 -0
- /package/payload/{premium-plugins/writer-craft → platform/plugins/voice-mirror}/mcp/dist/tools/voice-tag-content.js.map +0 -0
- /package/payload/server/public/assets/{useSubAccountSwitcher-CHEt_m6q.js → useSubAccountSwitcher-DF6bohQA.js} +0 -0
package/payload/server/server.js
CHANGED
|
@@ -562,6 +562,12 @@ var require_dist3 = __commonJS({
|
|
|
562
562
|
Part: "#7A3326",
|
|
563
563
|
PurchaseOrder: "#B07050",
|
|
564
564
|
PpmContract: "#8A4A3A",
|
|
565
|
+
// Job note (Task 1650). A child write-time label attached to its :Job via
|
|
566
|
+
// (:Note)-[:ABOUT]->(:Job). Not a top-level chip (job-attached, not an
|
|
567
|
+
// operator-entry entity) but given a colour so it renders on Job drilldown
|
|
568
|
+
// rather than fallback-grey — same treatment as Message/Section. Steel grey
|
|
569
|
+
// reads as an annotation, apart from the brick-red service family.
|
|
570
|
+
Note: "#5E6B73",
|
|
565
571
|
// External business entity — schema:Organization, written by memory-write
|
|
566
572
|
// as the Supplier label. Warm tobacco — distinct hue from internal-business
|
|
567
573
|
// slates so external entities are scannable at a glance.
|
|
@@ -2781,6 +2787,253 @@ function mediaFallbackBody(extracted) {
|
|
|
2781
2787
|
return extracted.mediaType ? `[${extracted.mediaType}]` : "";
|
|
2782
2788
|
}
|
|
2783
2789
|
|
|
2790
|
+
// app/lib/whatsapp/inbound/reaction.ts
|
|
2791
|
+
function toMillis(v) {
|
|
2792
|
+
if (v == null) return null;
|
|
2793
|
+
if (typeof v === "number") return v;
|
|
2794
|
+
if (typeof v.toNumber === "function") return v.toNumber();
|
|
2795
|
+
if (typeof v.low === "number") return (v.low >>> 0) + (v.high ?? 0) * 4294967296;
|
|
2796
|
+
return null;
|
|
2797
|
+
}
|
|
2798
|
+
function readReactionEntry(entry) {
|
|
2799
|
+
const targetMsgKeyId = entry.key?.id ?? void 0;
|
|
2800
|
+
if (!targetMsgKeyId) return null;
|
|
2801
|
+
const chatJid = entry.key?.remoteJid ?? entry.reaction?.key?.remoteJid ?? void 0;
|
|
2802
|
+
if (!chatJid) return null;
|
|
2803
|
+
const isGroup = isGroupJid(chatJid);
|
|
2804
|
+
const reactorKey = entry.reaction?.key;
|
|
2805
|
+
const reactorJid = isGroup ? reactorKey?.participant ?? void 0 : reactorKey?.remoteJid ?? chatJid;
|
|
2806
|
+
if (!reactorJid) return null;
|
|
2807
|
+
const emoji = entry.reaction?.text ?? "";
|
|
2808
|
+
return {
|
|
2809
|
+
targetMsgKeyId,
|
|
2810
|
+
chatJid,
|
|
2811
|
+
reactorJid,
|
|
2812
|
+
isGroup,
|
|
2813
|
+
emoji,
|
|
2814
|
+
removed: !emoji,
|
|
2815
|
+
fromMe: !!reactorKey?.fromMe,
|
|
2816
|
+
timestampMs: toMillis(entry.reaction?.senderTimestampMs)
|
|
2817
|
+
};
|
|
2818
|
+
}
|
|
2819
|
+
|
|
2820
|
+
// app/lib/whatsapp/message-store.ts
|
|
2821
|
+
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync3, appendFileSync, readdirSync, statSync as statSync2 } from "fs";
|
|
2822
|
+
import { dirname, join as join3 } from "path";
|
|
2823
|
+
function isReactionRecord(r) {
|
|
2824
|
+
return r.kind === "reaction";
|
|
2825
|
+
}
|
|
2826
|
+
var STORE_ROOT = () => join3(process.env.MAXY_DIR_OVERRIDE ?? MAXY_DIR, "data", "whatsapp-messages");
|
|
2827
|
+
function conversationFile(platformAccountId, remoteJid) {
|
|
2828
|
+
return join3(STORE_ROOT(), platformAccountId, `${remoteJid}.jsonl`);
|
|
2829
|
+
}
|
|
2830
|
+
function listStoredAccountIds() {
|
|
2831
|
+
const root = STORE_ROOT();
|
|
2832
|
+
if (!existsSync3(root)) return [];
|
|
2833
|
+
return readdirSync(root).filter((name) => {
|
|
2834
|
+
try {
|
|
2835
|
+
return statSync2(join3(root, name)).isDirectory();
|
|
2836
|
+
} catch {
|
|
2837
|
+
return false;
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
}
|
|
2841
|
+
function conversationFilePath(platformAccountId, remoteJid) {
|
|
2842
|
+
return conversationFile(platformAccountId, remoteJid);
|
|
2843
|
+
}
|
|
2844
|
+
function parseLines(raw) {
|
|
2845
|
+
const out = [];
|
|
2846
|
+
for (const line of raw.split("\n")) {
|
|
2847
|
+
if (!line.trim()) continue;
|
|
2848
|
+
try {
|
|
2849
|
+
const rec = JSON.parse(line);
|
|
2850
|
+
if (isReactionRecord(rec)) continue;
|
|
2851
|
+
out.push(rec);
|
|
2852
|
+
} catch {
|
|
2853
|
+
console.error(`[whatsapp-message-store] skip reason=corrupt-line`);
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
return out;
|
|
2857
|
+
}
|
|
2858
|
+
var byDateSentAsc = (a, b) => a.dateSent.localeCompare(b.dateSent);
|
|
2859
|
+
function appendMessage(platformAccountId, record, altDedupeRemoteJids = []) {
|
|
2860
|
+
const file = conversationFile(platformAccountId, record.remoteJid);
|
|
2861
|
+
try {
|
|
2862
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
2863
|
+
} catch (err) {
|
|
2864
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2865
|
+
console.error(`[whatsapp-message-store] FAIL op=append reason=${reason.slice(0, 100)} messageId=${record.messageId}`);
|
|
2866
|
+
return { created: false };
|
|
2867
|
+
}
|
|
2868
|
+
try {
|
|
2869
|
+
const filesToCheck = [file, ...altDedupeRemoteJids.filter((jid) => jid && jid !== record.remoteJid).map((jid) => conversationFile(platformAccountId, jid))];
|
|
2870
|
+
for (const candidate of new Set(filesToCheck)) {
|
|
2871
|
+
if (!existsSync3(candidate)) continue;
|
|
2872
|
+
const existing = parseLines(readFileSync3(candidate, "utf8"));
|
|
2873
|
+
if (existing.some((r) => r.messageId === record.messageId)) {
|
|
2874
|
+
return { created: false };
|
|
2875
|
+
}
|
|
2876
|
+
}
|
|
2877
|
+
} catch (err) {
|
|
2878
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2879
|
+
console.error(`[whatsapp-message-store] FAIL op=append reason=${reason.slice(0, 100)} messageId=${record.messageId}`);
|
|
2880
|
+
return { created: false };
|
|
2881
|
+
}
|
|
2882
|
+
try {
|
|
2883
|
+
appendFileSync(file, JSON.stringify(record) + "\n");
|
|
2884
|
+
} catch (err) {
|
|
2885
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2886
|
+
console.error(`[whatsapp-message-store] FAIL op=append reason=${reason.slice(0, 100)} messageId=${record.messageId}`);
|
|
2887
|
+
return { created: false };
|
|
2888
|
+
}
|
|
2889
|
+
return { created: true };
|
|
2890
|
+
}
|
|
2891
|
+
function readConversation(platformAccountId, remoteJid) {
|
|
2892
|
+
const file = conversationFile(platformAccountId, remoteJid);
|
|
2893
|
+
try {
|
|
2894
|
+
if (!existsSync3(file)) return [];
|
|
2895
|
+
return parseLines(readFileSync3(file, "utf8")).sort(byDateSentAsc);
|
|
2896
|
+
} catch (err) {
|
|
2897
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2898
|
+
console.error(`[whatsapp-message-store] FAIL op=read reason=${reason.slice(0, 100)} remoteJid=${remoteJid}`);
|
|
2899
|
+
return [];
|
|
2900
|
+
}
|
|
2901
|
+
}
|
|
2902
|
+
function appendReaction(platformAccountId, record) {
|
|
2903
|
+
const file = conversationFile(platformAccountId, record.remoteJid);
|
|
2904
|
+
try {
|
|
2905
|
+
mkdirSync(dirname(file), { recursive: true });
|
|
2906
|
+
appendFileSync(file, JSON.stringify(record) + "\n");
|
|
2907
|
+
} catch (err) {
|
|
2908
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2909
|
+
console.error(
|
|
2910
|
+
`[whatsapp-message-store] FAIL op=append-reaction reason=${reason.slice(0, 100)} target=${record.targetMsgKeyId} reactor=${record.reactorTelephone}`
|
|
2911
|
+
);
|
|
2912
|
+
return { appended: false };
|
|
2913
|
+
}
|
|
2914
|
+
return { appended: true };
|
|
2915
|
+
}
|
|
2916
|
+
function readReactions(platformAccountId, remoteJid) {
|
|
2917
|
+
const file = conversationFile(platformAccountId, remoteJid);
|
|
2918
|
+
try {
|
|
2919
|
+
if (!existsSync3(file)) return [];
|
|
2920
|
+
const out = [];
|
|
2921
|
+
for (const line of readFileSync3(file, "utf8").split("\n")) {
|
|
2922
|
+
if (!line.trim()) continue;
|
|
2923
|
+
try {
|
|
2924
|
+
const rec = JSON.parse(line);
|
|
2925
|
+
if (isReactionRecord(rec)) out.push(rec);
|
|
2926
|
+
} catch {
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
return out;
|
|
2930
|
+
} catch (err) {
|
|
2931
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
2932
|
+
console.error(`[whatsapp-message-store] FAIL op=read-reactions reason=${reason.slice(0, 100)} remoteJid=${remoteJid}`);
|
|
2933
|
+
return [];
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
function foldReactions(records) {
|
|
2937
|
+
const latest = /* @__PURE__ */ new Map();
|
|
2938
|
+
const ordered = records.slice().sort((a, b) => a.dateSent.localeCompare(b.dateSent));
|
|
2939
|
+
for (const r of ordered) {
|
|
2940
|
+
let byReactor = latest.get(r.targetMsgKeyId);
|
|
2941
|
+
if (!byReactor) {
|
|
2942
|
+
byReactor = /* @__PURE__ */ new Map();
|
|
2943
|
+
latest.set(r.targetMsgKeyId, byReactor);
|
|
2944
|
+
}
|
|
2945
|
+
byReactor.set(r.reactorTelephone, r);
|
|
2946
|
+
}
|
|
2947
|
+
const out = /* @__PURE__ */ new Map();
|
|
2948
|
+
for (const [target, byReactor] of latest) {
|
|
2949
|
+
const surviving = [...byReactor.values()].filter((r) => !r.removed).map((r) => ({ emoji: r.emoji, reactorName: r.reactorName }));
|
|
2950
|
+
if (surviving.length > 0) out.set(target, surviving);
|
|
2951
|
+
}
|
|
2952
|
+
return out;
|
|
2953
|
+
}
|
|
2954
|
+
var summaryCache = /* @__PURE__ */ new Map();
|
|
2955
|
+
function summariseRecords(records) {
|
|
2956
|
+
if (records.length === 0) return null;
|
|
2957
|
+
const sorted = records.slice().sort(byDateSentAsc);
|
|
2958
|
+
return {
|
|
2959
|
+
first: sorted[0],
|
|
2960
|
+
last: sorted[sorted.length - 1],
|
|
2961
|
+
firstNamedSender: sorted.find((r) => r.senderName)?.senderName ?? null
|
|
2962
|
+
};
|
|
2963
|
+
}
|
|
2964
|
+
function readConversationSummaries(platformAccountId) {
|
|
2965
|
+
const dir = join3(STORE_ROOT(), platformAccountId);
|
|
2966
|
+
const out = /* @__PURE__ */ new Map();
|
|
2967
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2968
|
+
let fullReads = 0;
|
|
2969
|
+
let cacheHits = 0;
|
|
2970
|
+
let bytesRead = 0;
|
|
2971
|
+
try {
|
|
2972
|
+
if (!existsSync3(dir)) return out;
|
|
2973
|
+
for (const entry of readdirSync(dir)) {
|
|
2974
|
+
if (!entry.endsWith(".jsonl")) continue;
|
|
2975
|
+
const remoteJid = entry.slice(0, -".jsonl".length);
|
|
2976
|
+
const file = join3(dir, entry);
|
|
2977
|
+
seen.add(file);
|
|
2978
|
+
let size;
|
|
2979
|
+
let mtimeMs;
|
|
2980
|
+
try {
|
|
2981
|
+
const st = statSync2(file);
|
|
2982
|
+
size = st.size;
|
|
2983
|
+
mtimeMs = st.mtimeMs;
|
|
2984
|
+
} catch {
|
|
2985
|
+
continue;
|
|
2986
|
+
}
|
|
2987
|
+
const cached3 = summaryCache.get(file);
|
|
2988
|
+
if (cached3 && cached3.size === size && cached3.mtimeMs === mtimeMs) {
|
|
2989
|
+
cacheHits++;
|
|
2990
|
+
out.set(remoteJid, cached3.summary);
|
|
2991
|
+
continue;
|
|
2992
|
+
}
|
|
2993
|
+
let summary;
|
|
2994
|
+
try {
|
|
2995
|
+
const raw = readFileSync3(file, "utf8");
|
|
2996
|
+
bytesRead += Buffer.byteLength(raw);
|
|
2997
|
+
fullReads++;
|
|
2998
|
+
summary = summariseRecords(parseLines(raw));
|
|
2999
|
+
} catch (err) {
|
|
3000
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
3001
|
+
console.error(`[whatsapp-message-store] FAIL op=summarise reason=${reason.slice(0, 100)} remoteJid=${remoteJid}`);
|
|
3002
|
+
continue;
|
|
3003
|
+
}
|
|
3004
|
+
if (!summary) continue;
|
|
3005
|
+
summaryCache.set(file, { size, mtimeMs, summary });
|
|
3006
|
+
out.set(remoteJid, summary);
|
|
3007
|
+
}
|
|
3008
|
+
for (const key of summaryCache.keys()) {
|
|
3009
|
+
if (dirname(key) === dir && !seen.has(key)) summaryCache.delete(key);
|
|
3010
|
+
}
|
|
3011
|
+
} catch (err) {
|
|
3012
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
3013
|
+
console.error(`[whatsapp-message-store] FAIL op=summaries reason=${reason.slice(0, 100)} platformAccountId=${platformAccountId}`);
|
|
3014
|
+
}
|
|
3015
|
+
console.log(
|
|
3016
|
+
`[whatsapp-message-store] op=summaries accountId=${platformAccountId} conversations=${out.size} fullReads=${fullReads} cacheHits=${cacheHits} bytesRead=${bytesRead}`
|
|
3017
|
+
);
|
|
3018
|
+
return out;
|
|
3019
|
+
}
|
|
3020
|
+
function readAllConversations(platformAccountId) {
|
|
3021
|
+
const dir = join3(STORE_ROOT(), platformAccountId);
|
|
3022
|
+
const out = /* @__PURE__ */ new Map();
|
|
3023
|
+
try {
|
|
3024
|
+
if (!existsSync3(dir)) return out;
|
|
3025
|
+
for (const entry of readdirSync(dir)) {
|
|
3026
|
+
if (!entry.endsWith(".jsonl")) continue;
|
|
3027
|
+
const remoteJid = entry.slice(0, -".jsonl".length);
|
|
3028
|
+
out.set(remoteJid, readConversation(platformAccountId, remoteJid));
|
|
3029
|
+
}
|
|
3030
|
+
} catch (err) {
|
|
3031
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
3032
|
+
console.error(`[whatsapp-message-store] FAIL op=read-all reason=${reason.slice(0, 100)} platformAccountId=${platformAccountId}`);
|
|
3033
|
+
}
|
|
3034
|
+
return out;
|
|
3035
|
+
}
|
|
3036
|
+
|
|
2784
3037
|
// app/lib/whatsapp/managed-account.ts
|
|
2785
3038
|
function normalizeEntry(v) {
|
|
2786
3039
|
return typeof v === "string" ? { account: v, mode: "active" } : { account: v.managesAccount, mode: v.mode ?? "active" };
|
|
@@ -2874,7 +3127,7 @@ function checkGroupAccess(_params) {
|
|
|
2874
3127
|
|
|
2875
3128
|
// app/lib/access-gate.ts
|
|
2876
3129
|
import neo4j from "neo4j-driver";
|
|
2877
|
-
import { readFileSync as
|
|
3130
|
+
import { readFileSync as readFileSync4 } from "fs";
|
|
2878
3131
|
import { resolve as resolve2 } from "path";
|
|
2879
3132
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
2880
3133
|
var PLATFORM_ROOT2 = process.env.MAXY_PLATFORM_ROOT ?? resolve2(process.cwd(), "..");
|
|
@@ -2883,7 +3136,7 @@ function readPassword() {
|
|
|
2883
3136
|
if (process.env.NEO4J_PASSWORD) return process.env.NEO4J_PASSWORD;
|
|
2884
3137
|
const passwordFile = resolve2(PLATFORM_ROOT2, "config/.neo4j-password");
|
|
2885
3138
|
try {
|
|
2886
|
-
return
|
|
3139
|
+
return readFileSync4(passwordFile, "utf-8").trim();
|
|
2887
3140
|
} catch {
|
|
2888
3141
|
throw new Error(
|
|
2889
3142
|
`Neo4j password not found. Expected at ${passwordFile} or in NEO4J_PASSWORD env var.`
|
|
@@ -3408,166 +3661,6 @@ async function sendMediaMessage(sock, to, media, opts) {
|
|
|
3408
3661
|
}
|
|
3409
3662
|
}
|
|
3410
3663
|
|
|
3411
|
-
// app/lib/whatsapp/message-store.ts
|
|
3412
|
-
import { existsSync as existsSync3, mkdirSync, readFileSync as readFileSync4, appendFileSync, readdirSync, statSync as statSync2 } from "fs";
|
|
3413
|
-
import { dirname, join as join3 } from "path";
|
|
3414
|
-
var STORE_ROOT = () => join3(process.env.MAXY_DIR_OVERRIDE ?? MAXY_DIR, "data", "whatsapp-messages");
|
|
3415
|
-
function conversationFile(platformAccountId, remoteJid) {
|
|
3416
|
-
return join3(STORE_ROOT(), platformAccountId, `${remoteJid}.jsonl`);
|
|
3417
|
-
}
|
|
3418
|
-
function listStoredAccountIds() {
|
|
3419
|
-
const root = STORE_ROOT();
|
|
3420
|
-
if (!existsSync3(root)) return [];
|
|
3421
|
-
return readdirSync(root).filter((name) => {
|
|
3422
|
-
try {
|
|
3423
|
-
return statSync2(join3(root, name)).isDirectory();
|
|
3424
|
-
} catch {
|
|
3425
|
-
return false;
|
|
3426
|
-
}
|
|
3427
|
-
});
|
|
3428
|
-
}
|
|
3429
|
-
function conversationFilePath(platformAccountId, remoteJid) {
|
|
3430
|
-
return conversationFile(platformAccountId, remoteJid);
|
|
3431
|
-
}
|
|
3432
|
-
function parseLines(raw) {
|
|
3433
|
-
const out = [];
|
|
3434
|
-
for (const line of raw.split("\n")) {
|
|
3435
|
-
if (!line.trim()) continue;
|
|
3436
|
-
try {
|
|
3437
|
-
out.push(JSON.parse(line));
|
|
3438
|
-
} catch {
|
|
3439
|
-
console.error(`[whatsapp-message-store] skip reason=corrupt-line`);
|
|
3440
|
-
}
|
|
3441
|
-
}
|
|
3442
|
-
return out;
|
|
3443
|
-
}
|
|
3444
|
-
var byDateSentAsc = (a, b) => a.dateSent.localeCompare(b.dateSent);
|
|
3445
|
-
function appendMessage(platformAccountId, record, altDedupeRemoteJids = []) {
|
|
3446
|
-
const file = conversationFile(platformAccountId, record.remoteJid);
|
|
3447
|
-
try {
|
|
3448
|
-
mkdirSync(dirname(file), { recursive: true });
|
|
3449
|
-
} catch (err) {
|
|
3450
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3451
|
-
console.error(`[whatsapp-message-store] FAIL op=append reason=${reason.slice(0, 100)} messageId=${record.messageId}`);
|
|
3452
|
-
return { created: false };
|
|
3453
|
-
}
|
|
3454
|
-
try {
|
|
3455
|
-
const filesToCheck = [file, ...altDedupeRemoteJids.filter((jid) => jid && jid !== record.remoteJid).map((jid) => conversationFile(platformAccountId, jid))];
|
|
3456
|
-
for (const candidate of new Set(filesToCheck)) {
|
|
3457
|
-
if (!existsSync3(candidate)) continue;
|
|
3458
|
-
const existing = parseLines(readFileSync4(candidate, "utf8"));
|
|
3459
|
-
if (existing.some((r) => r.messageId === record.messageId)) {
|
|
3460
|
-
return { created: false };
|
|
3461
|
-
}
|
|
3462
|
-
}
|
|
3463
|
-
} catch (err) {
|
|
3464
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3465
|
-
console.error(`[whatsapp-message-store] FAIL op=append reason=${reason.slice(0, 100)} messageId=${record.messageId}`);
|
|
3466
|
-
return { created: false };
|
|
3467
|
-
}
|
|
3468
|
-
try {
|
|
3469
|
-
appendFileSync(file, JSON.stringify(record) + "\n");
|
|
3470
|
-
} catch (err) {
|
|
3471
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3472
|
-
console.error(`[whatsapp-message-store] FAIL op=append reason=${reason.slice(0, 100)} messageId=${record.messageId}`);
|
|
3473
|
-
return { created: false };
|
|
3474
|
-
}
|
|
3475
|
-
return { created: true };
|
|
3476
|
-
}
|
|
3477
|
-
function readConversation(platformAccountId, remoteJid) {
|
|
3478
|
-
const file = conversationFile(platformAccountId, remoteJid);
|
|
3479
|
-
try {
|
|
3480
|
-
if (!existsSync3(file)) return [];
|
|
3481
|
-
return parseLines(readFileSync4(file, "utf8")).sort(byDateSentAsc);
|
|
3482
|
-
} catch (err) {
|
|
3483
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3484
|
-
console.error(`[whatsapp-message-store] FAIL op=read reason=${reason.slice(0, 100)} remoteJid=${remoteJid}`);
|
|
3485
|
-
return [];
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
var summaryCache = /* @__PURE__ */ new Map();
|
|
3489
|
-
function summariseRecords(records) {
|
|
3490
|
-
if (records.length === 0) return null;
|
|
3491
|
-
const sorted = records.slice().sort(byDateSentAsc);
|
|
3492
|
-
return {
|
|
3493
|
-
first: sorted[0],
|
|
3494
|
-
last: sorted[sorted.length - 1],
|
|
3495
|
-
firstNamedSender: sorted.find((r) => r.senderName)?.senderName ?? null
|
|
3496
|
-
};
|
|
3497
|
-
}
|
|
3498
|
-
function readConversationSummaries(platformAccountId) {
|
|
3499
|
-
const dir = join3(STORE_ROOT(), platformAccountId);
|
|
3500
|
-
const out = /* @__PURE__ */ new Map();
|
|
3501
|
-
const seen = /* @__PURE__ */ new Set();
|
|
3502
|
-
let fullReads = 0;
|
|
3503
|
-
let cacheHits = 0;
|
|
3504
|
-
let bytesRead = 0;
|
|
3505
|
-
try {
|
|
3506
|
-
if (!existsSync3(dir)) return out;
|
|
3507
|
-
for (const entry of readdirSync(dir)) {
|
|
3508
|
-
if (!entry.endsWith(".jsonl")) continue;
|
|
3509
|
-
const remoteJid = entry.slice(0, -".jsonl".length);
|
|
3510
|
-
const file = join3(dir, entry);
|
|
3511
|
-
seen.add(file);
|
|
3512
|
-
let size;
|
|
3513
|
-
let mtimeMs;
|
|
3514
|
-
try {
|
|
3515
|
-
const st = statSync2(file);
|
|
3516
|
-
size = st.size;
|
|
3517
|
-
mtimeMs = st.mtimeMs;
|
|
3518
|
-
} catch {
|
|
3519
|
-
continue;
|
|
3520
|
-
}
|
|
3521
|
-
const cached3 = summaryCache.get(file);
|
|
3522
|
-
if (cached3 && cached3.size === size && cached3.mtimeMs === mtimeMs) {
|
|
3523
|
-
cacheHits++;
|
|
3524
|
-
out.set(remoteJid, cached3.summary);
|
|
3525
|
-
continue;
|
|
3526
|
-
}
|
|
3527
|
-
let summary;
|
|
3528
|
-
try {
|
|
3529
|
-
const raw = readFileSync4(file, "utf8");
|
|
3530
|
-
bytesRead += Buffer.byteLength(raw);
|
|
3531
|
-
fullReads++;
|
|
3532
|
-
summary = summariseRecords(parseLines(raw));
|
|
3533
|
-
} catch (err) {
|
|
3534
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3535
|
-
console.error(`[whatsapp-message-store] FAIL op=summarise reason=${reason.slice(0, 100)} remoteJid=${remoteJid}`);
|
|
3536
|
-
continue;
|
|
3537
|
-
}
|
|
3538
|
-
if (!summary) continue;
|
|
3539
|
-
summaryCache.set(file, { size, mtimeMs, summary });
|
|
3540
|
-
out.set(remoteJid, summary);
|
|
3541
|
-
}
|
|
3542
|
-
for (const key of summaryCache.keys()) {
|
|
3543
|
-
if (dirname(key) === dir && !seen.has(key)) summaryCache.delete(key);
|
|
3544
|
-
}
|
|
3545
|
-
} catch (err) {
|
|
3546
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3547
|
-
console.error(`[whatsapp-message-store] FAIL op=summaries reason=${reason.slice(0, 100)} platformAccountId=${platformAccountId}`);
|
|
3548
|
-
}
|
|
3549
|
-
console.log(
|
|
3550
|
-
`[whatsapp-message-store] op=summaries accountId=${platformAccountId} conversations=${out.size} fullReads=${fullReads} cacheHits=${cacheHits} bytesRead=${bytesRead}`
|
|
3551
|
-
);
|
|
3552
|
-
return out;
|
|
3553
|
-
}
|
|
3554
|
-
function readAllConversations(platformAccountId) {
|
|
3555
|
-
const dir = join3(STORE_ROOT(), platformAccountId);
|
|
3556
|
-
const out = /* @__PURE__ */ new Map();
|
|
3557
|
-
try {
|
|
3558
|
-
if (!existsSync3(dir)) return out;
|
|
3559
|
-
for (const entry of readdirSync(dir)) {
|
|
3560
|
-
if (!entry.endsWith(".jsonl")) continue;
|
|
3561
|
-
const remoteJid = entry.slice(0, -".jsonl".length);
|
|
3562
|
-
out.set(remoteJid, readConversation(platformAccountId, remoteJid));
|
|
3563
|
-
}
|
|
3564
|
-
} catch (err) {
|
|
3565
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
3566
|
-
console.error(`[whatsapp-message-store] FAIL op=read-all reason=${reason.slice(0, 100)} platformAccountId=${platformAccountId}`);
|
|
3567
|
-
}
|
|
3568
|
-
return out;
|
|
3569
|
-
}
|
|
3570
|
-
|
|
3571
3664
|
// app/lib/whatsapp/persist-message.ts
|
|
3572
3665
|
var TAG7 = "[whatsapp-persist]";
|
|
3573
3666
|
var sessionWriteLocks = /* @__PURE__ */ new Map();
|
|
@@ -5009,6 +5102,7 @@ async function stopConnection(accountId) {
|
|
|
5009
5102
|
if (conn.sock) {
|
|
5010
5103
|
try {
|
|
5011
5104
|
conn.sock.ev.removeAllListeners("messages.upsert");
|
|
5105
|
+
conn.sock.ev.removeAllListeners("messages.reaction");
|
|
5012
5106
|
conn.sock.ev.removeAllListeners("connection.update");
|
|
5013
5107
|
conn.sock.ev.removeAllListeners("creds.update");
|
|
5014
5108
|
conn.sock.ws?.close?.();
|
|
@@ -5545,6 +5639,52 @@ function monitorInbound(conn) {
|
|
|
5545
5639
|
}
|
|
5546
5640
|
}
|
|
5547
5641
|
});
|
|
5642
|
+
console.error(`[whatsapp-reaction] op=subscribed account=${conn.platformAccountId}`);
|
|
5643
|
+
sock.ev.on("messages.reaction", async (reactions) => {
|
|
5644
|
+
for (const entry of reactions) {
|
|
5645
|
+
try {
|
|
5646
|
+
const sig = readReactionEntry(entry);
|
|
5647
|
+
if (!sig) continue;
|
|
5648
|
+
if (sig.fromMe) continue;
|
|
5649
|
+
const reactorTelephone = await resolveJidToE164(sig.reactorJid, conn.lidMapping) ?? sig.reactorJid;
|
|
5650
|
+
const { canonical: canonicalRemoteJid } = await resolveCanonicalConversationJid(
|
|
5651
|
+
sig.chatJid,
|
|
5652
|
+
conn.lidMapping
|
|
5653
|
+
);
|
|
5654
|
+
console.error(
|
|
5655
|
+
`[whatsapp-reaction] op=recv account=${conn.platformAccountId} target=${sig.targetMsgKeyId} reactor=${reactorTelephone} emoji=${sig.emoji || "EMPTY"} group=${sig.isGroup}`
|
|
5656
|
+
);
|
|
5657
|
+
const convo = readConversation(conn.platformAccountId, canonicalRemoteJid);
|
|
5658
|
+
const target = convo.find((m) => m.msgKeyId === sig.targetMsgKeyId);
|
|
5659
|
+
const reactorName = target && !target.fromMe && target.senderTelephone === reactorTelephone ? target.senderName : convo.find((m) => m.senderTelephone === reactorTelephone && m.senderName)?.senderName ?? null;
|
|
5660
|
+
if (target) {
|
|
5661
|
+
console.error(`[whatsapp-reaction] op=target-ok account=${conn.platformAccountId} target=${sig.targetMsgKeyId}`);
|
|
5662
|
+
} else {
|
|
5663
|
+
console.error(`[whatsapp-reaction] op=orphan account=${conn.platformAccountId} target=${sig.targetMsgKeyId} reason=target-not-found`);
|
|
5664
|
+
}
|
|
5665
|
+
const dateSent = sig.timestampMs ? new Date(sig.timestampMs).toISOString() : (/* @__PURE__ */ new Date()).toISOString();
|
|
5666
|
+
const { appended } = appendReaction(conn.platformAccountId, {
|
|
5667
|
+
kind: "reaction",
|
|
5668
|
+
targetMsgKeyId: sig.targetMsgKeyId,
|
|
5669
|
+
reactorTelephone,
|
|
5670
|
+
reactorName,
|
|
5671
|
+
emoji: sig.emoji,
|
|
5672
|
+
removed: sig.removed,
|
|
5673
|
+
dateSent,
|
|
5674
|
+
remoteJid: canonicalRemoteJid
|
|
5675
|
+
});
|
|
5676
|
+
if (appended) {
|
|
5677
|
+
console.error(
|
|
5678
|
+
`[whatsapp-reaction] op=persist account=${conn.platformAccountId} target=${sig.targetMsgKeyId} reactor=${reactorTelephone} emoji=${sig.emoji || "EMPTY"} removed=${sig.removed}`
|
|
5679
|
+
);
|
|
5680
|
+
} else {
|
|
5681
|
+
console.error(`[whatsapp-reaction] op=persist-fail account=${conn.platformAccountId} target=${sig.targetMsgKeyId} reason=append-failed`);
|
|
5682
|
+
}
|
|
5683
|
+
} catch (err) {
|
|
5684
|
+
console.error(`[whatsapp-reaction] op=persist-fail account=${conn.platformAccountId} reason=${String(err).slice(0, 120)}`);
|
|
5685
|
+
}
|
|
5686
|
+
}
|
|
5687
|
+
});
|
|
5548
5688
|
}
|
|
5549
5689
|
async function handleInboundMessage(conn, msg) {
|
|
5550
5690
|
if (!conn.sock || !onInboundMessage) return;
|
|
@@ -8265,10 +8405,12 @@ app2.get("/messages", (c) => {
|
|
|
8265
8405
|
);
|
|
8266
8406
|
const bounded = counterpartyBound ? storeMessages : [];
|
|
8267
8407
|
const limited = effectiveLimit ? bounded.slice(-effectiveLimit) : bounded;
|
|
8408
|
+
const threadReactions = foldReactions(readReactions(storeAccountId, jid));
|
|
8268
8409
|
let withAttachments = 0;
|
|
8269
8410
|
const messages = limited.map((m) => {
|
|
8270
8411
|
const attachment = recallAttachment(storeAccountId, m.attachmentId);
|
|
8271
8412
|
if (attachment) withAttachments += 1;
|
|
8413
|
+
const reactions = threadReactions.get(m.msgKeyId);
|
|
8272
8414
|
return {
|
|
8273
8415
|
id: m.messageId,
|
|
8274
8416
|
sender: m.senderTelephone,
|
|
@@ -8277,7 +8419,8 @@ app2.get("/messages", (c) => {
|
|
|
8277
8419
|
timestamp: Math.floor(Date.parse(m.dateSent) / 1e3),
|
|
8278
8420
|
fromMe: m.fromMe,
|
|
8279
8421
|
quoted: m.quotedId ? { id: m.quotedId, sender: m.quotedSender ?? void 0 } : void 0,
|
|
8280
|
-
attachment
|
|
8422
|
+
attachment,
|
|
8423
|
+
...reactions && reactions.length > 0 ? { reactions } : {}
|
|
8281
8424
|
};
|
|
8282
8425
|
});
|
|
8283
8426
|
console.error(`${TAG21} messages requested=${requestedAccountId} account=${storeAccountId} jid=${jid} projected=${projecting} storeAccount=${projecting ? storeAccountId : "self"} managerPhonesBound=${managerPhonesBound} storeKeyFound=${storeMessages.length > 0} limit=${effectiveLimit ?? "all"} returned=${messages.length} withAttachments=${withAttachments}`);
|
|
@@ -9950,7 +10093,9 @@ app5.get("/store-stream", requireAdminSession, (c) => {
|
|
|
9950
10093
|
const lastEventId = c.req.header("Last-Event-ID");
|
|
9951
10094
|
const uploadsBase = resolve13(DATA_ROOT, "accounts", accountId, "uploads");
|
|
9952
10095
|
const byMsgKeyId = /* @__PURE__ */ new Map();
|
|
9953
|
-
const
|
|
10096
|
+
const reactionRecords = [];
|
|
10097
|
+
const reactionsForTarget = (msgKeyId) => foldReactions(reactionRecords).get(msgKeyId);
|
|
10098
|
+
const toTurn = (r, reactions) => {
|
|
9954
10099
|
if (!r.body && !r.attachmentId) {
|
|
9955
10100
|
console.log(`[wa-reader] op=store-row msgKeyId=${r.msgKeyId} kind=empty textLen=0`);
|
|
9956
10101
|
}
|
|
@@ -9961,7 +10106,9 @@ app5.get("/store-stream", requireAdminSession, (c) => {
|
|
|
9961
10106
|
fromMe: r.fromMe,
|
|
9962
10107
|
senderName: r.senderName,
|
|
9963
10108
|
origin: r.origin,
|
|
9964
|
-
msgKeyId: r.msgKeyId
|
|
10109
|
+
msgKeyId: r.msgKeyId,
|
|
10110
|
+
// Task 1619 — folded inbound reactions for this bubble (omitted when none).
|
|
10111
|
+
...reactions && reactions.length > 0 ? { reactions } : {}
|
|
9965
10112
|
};
|
|
9966
10113
|
if (r.quotedId) {
|
|
9967
10114
|
const q = byMsgKeyId.get(r.quotedId);
|
|
@@ -9988,6 +10135,19 @@ data: ${JSON.stringify(turn)}
|
|
|
9988
10135
|
} catch {
|
|
9989
10136
|
}
|
|
9990
10137
|
};
|
|
10138
|
+
const sendReactionEvent = (targetMsgKeyId, id) => {
|
|
10139
|
+
const reactions = foldReactions(reactionRecords).get(targetMsgKeyId) ?? [];
|
|
10140
|
+
const payload = { targetMsgKeyId, reactions };
|
|
10141
|
+
try {
|
|
10142
|
+
controller.enqueue(encoder.encode(`event: reaction
|
|
10143
|
+
id: ${id}
|
|
10144
|
+
data: ${JSON.stringify(payload)}
|
|
10145
|
+
|
|
10146
|
+
`));
|
|
10147
|
+
} catch {
|
|
10148
|
+
}
|
|
10149
|
+
console.log(`[whatsapp-reaction] op=fold target=${targetMsgKeyId} reactions=${reactions.length}`);
|
|
10150
|
+
};
|
|
9991
10151
|
const fileEnd0 = (() => {
|
|
9992
10152
|
try {
|
|
9993
10153
|
return statSync5(file).size;
|
|
@@ -10004,7 +10164,12 @@ data: ${JSON.stringify(turn)}
|
|
|
10004
10164
|
for (const line of buf.toString("utf8").split("\n")) {
|
|
10005
10165
|
if (!line.trim()) continue;
|
|
10006
10166
|
try {
|
|
10007
|
-
|
|
10167
|
+
const parsed = JSON.parse(line);
|
|
10168
|
+
if (parsed.kind === "reaction") {
|
|
10169
|
+
reactionRecords.push(parsed);
|
|
10170
|
+
continue;
|
|
10171
|
+
}
|
|
10172
|
+
records.push(parsed);
|
|
10008
10173
|
} catch {
|
|
10009
10174
|
}
|
|
10010
10175
|
}
|
|
@@ -10014,10 +10179,13 @@ data: ${JSON.stringify(turn)}
|
|
|
10014
10179
|
records.sort((a, b) => a.dateSent.localeCompare(b.dateSent));
|
|
10015
10180
|
const scope = records.length ? records[records.length - 1].scope : "none";
|
|
10016
10181
|
for (const m of records) byMsgKeyId.set(m.msgKeyId, m);
|
|
10017
|
-
|
|
10182
|
+
const backlogFold = foldReactions(reactionRecords);
|
|
10183
|
+
for (const m of records) send(toTurn(m, backlogFold.get(m.msgKeyId)), offset);
|
|
10018
10184
|
console.log(
|
|
10019
10185
|
`[wa-reader] op=open remoteJid=${remoteJid} scope=${scope} messages=${records.length} source=store`
|
|
10020
10186
|
);
|
|
10187
|
+
} else {
|
|
10188
|
+
reactionRecords.push(...readReactions(accountId, remoteJid));
|
|
10021
10189
|
}
|
|
10022
10190
|
const drain = () => {
|
|
10023
10191
|
try {
|
|
@@ -10028,14 +10196,20 @@ data: ${JSON.stringify(turn)}
|
|
|
10028
10196
|
let n = 0;
|
|
10029
10197
|
for (const line of lines) {
|
|
10030
10198
|
if (!line.trim()) continue;
|
|
10031
|
-
let
|
|
10199
|
+
let parsed;
|
|
10032
10200
|
try {
|
|
10033
|
-
|
|
10201
|
+
parsed = JSON.parse(line);
|
|
10034
10202
|
} catch {
|
|
10035
10203
|
continue;
|
|
10036
10204
|
}
|
|
10205
|
+
if (parsed.kind === "reaction") {
|
|
10206
|
+
reactionRecords.push(parsed);
|
|
10207
|
+
sendReactionEvent(parsed.targetMsgKeyId, offset);
|
|
10208
|
+
continue;
|
|
10209
|
+
}
|
|
10210
|
+
const rec = parsed;
|
|
10037
10211
|
byMsgKeyId.set(rec.msgKeyId, rec);
|
|
10038
|
-
send(toTurn(rec), offset);
|
|
10212
|
+
send(toTurn(rec, reactionsForTarget(rec.msgKeyId)), offset);
|
|
10039
10213
|
n++;
|
|
10040
10214
|
}
|
|
10041
10215
|
if (n > 0) console.log(`[wa-reader] op=store-drain conn=${connId} turns=${n}`);
|
|
@@ -22268,7 +22442,11 @@ app61.get("/free-busy", async (c) => {
|
|
|
22268
22442
|
`MATCH (m:Meeting {accountId: $accountId})
|
|
22269
22443
|
WHERE NOT (m.endsAt IS NOT NULL AND m.endsAt <= datetime($from))
|
|
22270
22444
|
AND m.startsAt < datetime($to)
|
|
22271
|
-
RETURN toString(m.startsAt) AS start, toString(m.endsAt) AS end
|
|
22445
|
+
RETURN toString(m.startsAt) AS start, toString(m.endsAt) AS end
|
|
22446
|
+
UNION
|
|
22447
|
+
MATCH (b:ConnectorBusy {accountId: $accountId})
|
|
22448
|
+
WHERE b.endsAt > datetime($from) AND b.startsAt < datetime($to)
|
|
22449
|
+
RETURN toString(b.startsAt) AS start, toString(b.endsAt) AS end`,
|
|
22272
22450
|
{ accountId: account.accountId, from, to }
|
|
22273
22451
|
);
|
|
22274
22452
|
const busy = res.records.map((r) => {
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
type AnyHandler = (...args: any[]) => any;
|
|
2
|
-
type AnyServer = {
|
|
3
|
-
registerTool: (...args: any[]) => any;
|
|
4
|
-
};
|
|
5
|
-
export declare function wrapWithLifeline(name: string, handler: AnyHandler): AnyHandler;
|
|
6
|
-
export declare function lifelineTool(server: AnyServer, name: string, description: string, inputSchema: Record<string, unknown>, handler: AnyHandler): void;
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,KAAK,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AAE1C,KAAK,SAAS,GAAG;IAAE,YAAY,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAA;CAAE,CAAC;AA4B3D,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU,CAoC9E;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,OAAO,EAAE,UAAU,GAClB,IAAI,CAEN"}
|