@rubytech/create-maxy 1.0.771 → 1.0.773
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 +2 -1
- package/payload/platform/plugins/admin/mcp/dist/index.js +131 -20
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/admin/skills/business-profile/SKILL.md +5 -6
- package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +5 -6
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js +21 -6
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-read.js.map +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +3 -2
- package/payload/server/{chunk-TKYZ7AEB.js → chunk-2HBD6IRL.js} +105 -5
- package/payload/server/{chunk-IO2WQEY4.js → chunk-PIMJJCOQ.js} +2 -1
- package/payload/server/{client-pool-5V5GX3UT.js → client-pool-U3A5YUO7.js} +1 -1
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/public/assets/{admin-CaXX8wc3.js → admin-C4CTVtBu.js} +6 -6
- package/payload/server/public/index.html +1 -1
- package/payload/server/server.js +81 -15
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.d.ts +0 -61
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.d.ts.map +0 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.js +0 -266
- package/payload/platform/plugins/memory/mcp/dist/lib/semantic-chunker.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.d.ts +0 -2
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.js +0 -293
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.js +0 -88
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/crypto.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts +0 -80
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js +0 -355
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/loop-api.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.d.ts +0 -5
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.js +0 -34
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/lib/neo4j.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.js +0 -24
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/customer-preferences.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.d.ts +0 -6
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.js +0 -18
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback-list.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.d.ts +0 -16
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.js +0 -35
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/feedback.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.d.ts +0 -5
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.js +0 -19
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-deregister.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.d.ts +0 -4
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.js +0 -14
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-list.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.js +0 -60
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/key-register.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.d.ts +0 -13
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.js +0 -41
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-enquiry.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.js +0 -16
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-batch.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.d.ts +0 -15
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.js +0 -11
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match-request.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.js +0 -39
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/marketing-match.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.js +0 -125
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-detail.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.d.ts +0 -7
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.js +0 -16
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-list.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.d.ts +0 -18
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.js +0 -87
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/people-search.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.d.ts +0 -7
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.js +0 -19
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/properties-list.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.d.ts +0 -10
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.js +0 -82
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-detail.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.d.ts +0 -12
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.js +0 -32
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-listed.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.d.ts +0 -15
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.js +0 -11
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-request.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.d.ts +0 -16
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.js +0 -41
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/property-search.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.d.ts +0 -13
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.js +0 -49
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/supplier.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.d.ts +0 -7
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.js +0 -19
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-availability.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.d.ts +0 -5
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.js +0 -32
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/team-info.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.d.ts +0 -14
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.js +0 -11
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-create.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.js +0 -85
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-detail.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.d.ts +0 -13
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.js +0 -44
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-search.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.d.ts +0 -14
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.js +0 -18
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewing-update.js.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.d.ts +0 -9
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.d.ts.map +0 -1
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.js +0 -25
- package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/tools/viewings-list.js.map +0 -1
- package/payload/server/chunk-26QT2HEQ.js +0 -9483
- package/payload/server/chunk-2T4RRIJK.js +0 -9462
- package/payload/server/chunk-2W7O63CK.js +0 -3052
- package/payload/server/chunk-32ZHQJNX.js +0 -11395
- package/payload/server/chunk-3KDVGWPQ.js +0 -2920
- package/payload/server/chunk-3RBKKDHC.js +0 -783
- package/payload/server/chunk-3VVHVJK2.js +0 -11405
- package/payload/server/chunk-43JK6WNK.js +0 -3057
- package/payload/server/chunk-5YIXIF6C.js +0 -726
- package/payload/server/chunk-7ODDM7L4.js +0 -12370
- package/payload/server/chunk-A5K3CFMI.js +0 -12297
- package/payload/server/chunk-AIWWYOBH.js +0 -9439
- package/payload/server/chunk-B54KBAK4.js +0 -72
- package/payload/server/chunk-BIOIXN5A.js +0 -12165
- package/payload/server/chunk-D53LK5YC.js +0 -12171
- package/payload/server/chunk-EIQT6QDH.js +0 -9562
- package/payload/server/chunk-FM5JMRED.js +0 -12033
- package/payload/server/chunk-HPU24BXP.js +0 -12173
- package/payload/server/chunk-HU5FSQYA.js +0 -12186
- package/payload/server/chunk-IAIGB5WN.js +0 -11406
- package/payload/server/chunk-JDT3MGUY.js +0 -12165
- package/payload/server/chunk-JLVVVQN7.js +0 -9447
- package/payload/server/chunk-K7GQ5RMN.js +0 -12172
- package/payload/server/chunk-LQ5GSMEW.js +0 -12036
- package/payload/server/chunk-MPWGVFU2.js +0 -12340
- package/payload/server/chunk-O2FWENOD.js +0 -11530
- package/payload/server/chunk-PE76FPYP.js +0 -12040
- package/payload/server/chunk-PQ6LDXZ4.js +0 -2997
- package/payload/server/chunk-Q6NDXCM6.js +0 -11448
- package/payload/server/chunk-QXAUMZXQ.js +0 -9512
- package/payload/server/chunk-S3M2NZMA.js +0 -3136
- package/payload/server/chunk-SGBNY4NP.js +0 -9540
- package/payload/server/chunk-SKXO42T6.js +0 -2934
- package/payload/server/chunk-SPTD7L7Z.js +0 -9474
- package/payload/server/chunk-TXPEEAV6.js +0 -2997
- package/payload/server/chunk-U3W5YIXU.js +0 -11450
- package/payload/server/chunk-U5JPRUYZ.js +0 -12298
- package/payload/server/chunk-UFLV7I6N.js +0 -11678
- package/payload/server/chunk-ULVR2RRY.js +0 -9439
- package/payload/server/chunk-VOD2IZ6J.js +0 -2934
- package/payload/server/chunk-VS7CRH4M.js +0 -9439
- package/payload/server/chunk-W6ZUNLLS.js +0 -9446
- package/payload/server/chunk-WW464F23.js +0 -9512
- package/payload/server/chunk-Y57ACANQ.js +0 -12292
- package/payload/server/chunk-ZK3VNR7Y.js +0 -9510
- package/payload/server/chunk-ZL2A4ROK.js +0 -11416
- package/payload/server/client-pool-67NUIL7H.js +0 -28
- package/payload/server/client-pool-CX2MFW75.js +0 -28
- package/payload/server/client-pool-DQBHSKAF.js +0 -28
- package/payload/server/client-pool-I5TCP7WI.js +0 -28
- package/payload/server/client-pool-ISMYJXCU.js +0 -28
- package/payload/server/client-pool-SGPHSYLK.js +0 -28
- package/payload/server/client-pool-TCKGDZLE.js +0 -28
- package/payload/server/client-pool-TULUIO6M.js +0 -28
- package/payload/server/upgrade-progress-server.js +0 -83
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/admin-
|
|
8
|
+
<script type="module" crossorigin src="/assets/admin-C4CTVtBu.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DeNudFNA.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
|
package/payload/server/server.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
vncLog,
|
|
48
48
|
waitForExit,
|
|
49
49
|
writeChromiumWrapper
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-PIMJJCOQ.js";
|
|
51
51
|
import {
|
|
52
52
|
ACCOUNTS_DIR,
|
|
53
53
|
GREETING_DIRECTIVE,
|
|
@@ -87,6 +87,7 @@ import {
|
|
|
87
87
|
interruptClient,
|
|
88
88
|
listAdminSessions,
|
|
89
89
|
listAdminSessionsInProgress,
|
|
90
|
+
loadAdminUserName,
|
|
90
91
|
loadOnboardingStep,
|
|
91
92
|
preConversationLogStream,
|
|
92
93
|
preflushStreamLogKey,
|
|
@@ -106,8 +107,9 @@ import {
|
|
|
106
107
|
validateAgentSlug,
|
|
107
108
|
validateSession,
|
|
108
109
|
verifyAndGetConversationUpdatedAt,
|
|
109
|
-
verifyConversationOwnership
|
|
110
|
-
|
|
110
|
+
verifyConversationOwnership,
|
|
111
|
+
writeAdminUserAndPerson
|
|
112
|
+
} from "./chunk-2HBD6IRL.js";
|
|
111
113
|
|
|
112
114
|
// ../lib/graph-trash/dist/index.js
|
|
113
115
|
var require_dist = __commonJS({
|
|
@@ -7443,12 +7445,22 @@ app8.post("/set-pin", async (c) => {
|
|
|
7443
7445
|
if (!body.pin || body.pin.length < 4) {
|
|
7444
7446
|
return c.json({ error: "PIN must be at least 4 characters." }, 400);
|
|
7445
7447
|
}
|
|
7448
|
+
const fullName = (body.name ?? "").trim();
|
|
7449
|
+
if (!fullName) {
|
|
7450
|
+
return c.json({ error: "Your name is required." }, 400);
|
|
7451
|
+
}
|
|
7446
7452
|
const hash = hashPin(body.pin);
|
|
7447
|
-
const userId = randomUUID7();
|
|
7448
|
-
mkdirSync6(dirname5(USERS_FILE), { recursive: true });
|
|
7449
|
-
writeFileSync7(USERS_FILE, JSON.stringify([{ userId, name: "Owner", pin: hash }]), { mode: 384 });
|
|
7450
|
-
console.log(`[set-pin] created users.json: userId=${userId.slice(0, 8)}\u2026 hash=${hash.slice(0, 8)}\u2026`);
|
|
7451
7453
|
const account = resolveAccount();
|
|
7454
|
+
const existingOwnerUserId = account?.config.admins?.find((a) => a.role === "owner")?.userId;
|
|
7455
|
+
const userId = existingOwnerUserId ?? randomUUID7();
|
|
7456
|
+
if (existingOwnerUserId) {
|
|
7457
|
+
console.log(`[set-pin] reusing existing owner userId=${userId.slice(0, 8)}\u2026 (change-PIN preserves identity)`);
|
|
7458
|
+
} else {
|
|
7459
|
+
console.log(`[set-pin] minted new userId=${userId.slice(0, 8)}\u2026 (first-time install)`);
|
|
7460
|
+
}
|
|
7461
|
+
mkdirSync6(dirname5(USERS_FILE), { recursive: true });
|
|
7462
|
+
writeFileSync7(USERS_FILE, JSON.stringify([{ userId, pin: hash }]), { mode: 384 });
|
|
7463
|
+
console.log(`[set-pin] wrote users.json: userId=${userId.slice(0, 8)}\u2026 hash=${hash.slice(0, 8)}\u2026`);
|
|
7452
7464
|
if (account) {
|
|
7453
7465
|
try {
|
|
7454
7466
|
const config = JSON.parse(readFileSync10(`${account.accountDir}/account.json`, "utf-8"));
|
|
@@ -7461,6 +7473,21 @@ app8.post("/set-pin", async (c) => {
|
|
|
7461
7473
|
} catch (err) {
|
|
7462
7474
|
console.error(`[set-pin] failed to update account.json admins: ${err instanceof Error ? err.message : String(err)}`);
|
|
7463
7475
|
}
|
|
7476
|
+
try {
|
|
7477
|
+
const result = await writeAdminUserAndPerson({
|
|
7478
|
+
userId,
|
|
7479
|
+
fullName,
|
|
7480
|
+
accountId: account.accountId
|
|
7481
|
+
});
|
|
7482
|
+
console.log(
|
|
7483
|
+
`[admin-identity] adminuser-bound userId=${userId.slice(0, 8)} givenName=${result.givenName} familyName=${result.familyName ?? "null"} personReused=${result.personReused}`
|
|
7484
|
+
);
|
|
7485
|
+
} catch (err) {
|
|
7486
|
+
console.error(
|
|
7487
|
+
`[admin-identity] adminuser-bind-failed userId=${userId.slice(0, 8)} accountId=${account.accountId.slice(0, 8)} error=${err instanceof Error ? err.message : String(err)}`
|
|
7488
|
+
);
|
|
7489
|
+
return c.json({ error: "Failed to write admin identity to graph. Check Neo4j connectivity and retry." }, 500);
|
|
7490
|
+
}
|
|
7464
7491
|
}
|
|
7465
7492
|
return c.json({ ok: true });
|
|
7466
7493
|
});
|
|
@@ -7706,8 +7733,9 @@ app9.post("/", async (c) => {
|
|
|
7706
7733
|
var client_error_default = app9;
|
|
7707
7734
|
|
|
7708
7735
|
// server/routes/admin/session.ts
|
|
7709
|
-
import { readFileSync as readFileSync11, existsSync as existsSync13 } from "fs";
|
|
7736
|
+
import { readFileSync as readFileSync11, writeFileSync as writeFileSync8, existsSync as existsSync13 } from "fs";
|
|
7710
7737
|
import { createHash as createHash2 } from "crypto";
|
|
7738
|
+
var deprecationLogged = /* @__PURE__ */ new Set();
|
|
7711
7739
|
function hashPin2(pin) {
|
|
7712
7740
|
return createHash2("sha256").update(pin).digest("hex");
|
|
7713
7741
|
}
|
|
@@ -7717,6 +7745,33 @@ function readUsersFile2() {
|
|
|
7717
7745
|
if (!raw) return [];
|
|
7718
7746
|
return JSON.parse(raw);
|
|
7719
7747
|
}
|
|
7748
|
+
function stripLegacyNameField(users) {
|
|
7749
|
+
const dirty = users.some((u) => "name" in u && u.name !== void 0);
|
|
7750
|
+
if (!dirty) return;
|
|
7751
|
+
for (const u of users) {
|
|
7752
|
+
if ("name" in u && u.name !== void 0) {
|
|
7753
|
+
if (!deprecationLogged.has(u.userId)) {
|
|
7754
|
+
console.log(`[admin-identity] users-json-name-field-deprecated userId=${u.userId.slice(0, 8)}`);
|
|
7755
|
+
deprecationLogged.add(u.userId);
|
|
7756
|
+
}
|
|
7757
|
+
delete u.name;
|
|
7758
|
+
}
|
|
7759
|
+
}
|
|
7760
|
+
try {
|
|
7761
|
+
writeFileSync8(USERS_FILE, JSON.stringify(users), { mode: 384 });
|
|
7762
|
+
} catch (err) {
|
|
7763
|
+
console.error(`[admin-identity] users-json strip failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
7764
|
+
}
|
|
7765
|
+
}
|
|
7766
|
+
async function resolveUserName(accountId, userId) {
|
|
7767
|
+
const result = await loadAdminUserName(accountId, userId);
|
|
7768
|
+
if (result.source === "neo4j") {
|
|
7769
|
+
console.log(`[admin-identity] userName-source=neo4j userId=${userId.slice(0, 8)} givenName=${result.givenName} familyName=${result.familyName ?? "null"} joined=${result.joined}`);
|
|
7770
|
+
return result.joined;
|
|
7771
|
+
}
|
|
7772
|
+
console.log(`[admin-identity] userName-source=fallback reason=${result.reason} userId=${userId.slice(0, 8)} accountId=${accountId.slice(0, 8)}`);
|
|
7773
|
+
return result.reason === "neo4j-unreachable" ? "Owner" : void 0;
|
|
7774
|
+
}
|
|
7720
7775
|
async function createAdminSession(accountId, thinkingView, userId, userName, role) {
|
|
7721
7776
|
const account = resolveAccount();
|
|
7722
7777
|
const effectiveThinkingView = thinkingView ?? account?.config.thinkingView ?? "default";
|
|
@@ -7776,11 +7831,20 @@ app10.get("/", async (c) => {
|
|
|
7776
7831
|
}
|
|
7777
7832
|
const role = getRoleForSession(sessionKey);
|
|
7778
7833
|
console.log(`[admin-session] role=${role ?? "null"} sessionKey=${sessionKey.slice(0, 8)} phase=restore`);
|
|
7834
|
+
const restoredUserId = getUserIdForSession(sessionKey);
|
|
7835
|
+
let restoredUserName = getUserNameForSession(sessionKey);
|
|
7836
|
+
if (restoredUserId) {
|
|
7837
|
+
const resolved = await resolveUserName(accountId, restoredUserId);
|
|
7838
|
+
restoredUserName = resolved;
|
|
7839
|
+
if (resolved !== void 0) {
|
|
7840
|
+
registerSession(sessionKey, "admin", accountId, void 0, restoredUserId, resolved, role ?? void 0);
|
|
7841
|
+
}
|
|
7842
|
+
}
|
|
7779
7843
|
return c.json({
|
|
7780
7844
|
session_key: sessionKey,
|
|
7781
7845
|
agent_id: "admin",
|
|
7782
|
-
userId:
|
|
7783
|
-
userName:
|
|
7846
|
+
userId: restoredUserId,
|
|
7847
|
+
userName: restoredUserName,
|
|
7784
7848
|
role: role ?? null,
|
|
7785
7849
|
thinkingView,
|
|
7786
7850
|
onboardingComplete,
|
|
@@ -7812,7 +7876,8 @@ app10.post("/", async (c) => {
|
|
|
7812
7876
|
console.log(`[session] PIN auth failed: no matching user`);
|
|
7813
7877
|
return c.json({ error: "Invalid PIN" }, 401);
|
|
7814
7878
|
}
|
|
7815
|
-
|
|
7879
|
+
stripLegacyNameField(users);
|
|
7880
|
+
const { userId } = matchedUser;
|
|
7816
7881
|
const accounts = resolveUserAccounts(userId);
|
|
7817
7882
|
if (accounts.length === 0) {
|
|
7818
7883
|
console.log(`[session] user has no accounts: userId=${userId}`);
|
|
@@ -7831,13 +7896,14 @@ app10.post("/", async (c) => {
|
|
|
7831
7896
|
return { accountId: a.accountId, businessName, role: a.role };
|
|
7832
7897
|
})
|
|
7833
7898
|
);
|
|
7834
|
-
return c.json({ accounts: accountList, userId
|
|
7899
|
+
return c.json({ accounts: accountList, userId });
|
|
7835
7900
|
}
|
|
7836
7901
|
const selected = body.accountId ? accounts.find((a) => a.accountId === body.accountId) : accounts[0];
|
|
7837
7902
|
if (!selected) {
|
|
7838
7903
|
console.log(`[session] account selection invalid: userId=${userId} requested=${body.accountId}`);
|
|
7839
7904
|
return c.json({ error: "Invalid account selection." }, 403);
|
|
7840
7905
|
}
|
|
7906
|
+
const userName = await resolveUserName(selected.accountId, userId);
|
|
7841
7907
|
const payload = await createAdminSession(selected.accountId, selected.config.thinkingView, userId, userName, selected.role);
|
|
7842
7908
|
return c.json(payload);
|
|
7843
7909
|
});
|
|
@@ -8135,7 +8201,7 @@ var app11 = new Hono();
|
|
|
8135
8201
|
app11.post("/cancel", requireAdminSession, async (c) => {
|
|
8136
8202
|
const session_key = c.var.sessionKey;
|
|
8137
8203
|
try {
|
|
8138
|
-
const { interruptClient: interruptClient2 } = await import("./client-pool-
|
|
8204
|
+
const { interruptClient: interruptClient2 } = await import("./client-pool-U3A5YUO7.js");
|
|
8139
8205
|
await interruptClient2(session_key);
|
|
8140
8206
|
return c.json({ ok: true });
|
|
8141
8207
|
} catch (err) {
|
|
@@ -9340,7 +9406,7 @@ function isValidDomain(value) {
|
|
|
9340
9406
|
}
|
|
9341
9407
|
|
|
9342
9408
|
// app/lib/alias-domains.ts
|
|
9343
|
-
import { existsSync as existsSync18, mkdirSync as mkdirSync8, readFileSync as readFileSync14, writeFileSync as
|
|
9409
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync8, readFileSync as readFileSync14, writeFileSync as writeFileSync9 } from "fs";
|
|
9344
9410
|
import { dirname as dirname7 } from "path";
|
|
9345
9411
|
import { resolve as resolve16 } from "path";
|
|
9346
9412
|
var ALIAS_DOMAINS_PATH = resolve16(MAXY_DIR, "alias-domains.json");
|
|
@@ -9359,7 +9425,7 @@ function addAliasDomain(hostname2) {
|
|
|
9359
9425
|
if (existing.has(hostname2)) return;
|
|
9360
9426
|
existing.add(hostname2);
|
|
9361
9427
|
mkdirSync8(dirname7(ALIAS_DOMAINS_PATH), { recursive: true });
|
|
9362
|
-
|
|
9428
|
+
writeFileSync9(ALIAS_DOMAINS_PATH, JSON.stringify([...existing], null, 2) + "\n", "utf-8");
|
|
9363
9429
|
}
|
|
9364
9430
|
|
|
9365
9431
|
// server/routes/admin/cloudflare.ts
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export interface TextBlock {
|
|
2
|
-
text: string;
|
|
3
|
-
paragraphs: string[];
|
|
4
|
-
headingLine: string | null;
|
|
5
|
-
}
|
|
6
|
-
export interface ChunkedSection {
|
|
7
|
-
title: string;
|
|
8
|
-
chunks: Array<{
|
|
9
|
-
id: number;
|
|
10
|
-
preview: string;
|
|
11
|
-
content: string;
|
|
12
|
-
}>;
|
|
13
|
-
}
|
|
14
|
-
export type EmbedFn = (texts: string[]) => Promise<number[][]>;
|
|
15
|
-
export declare function splitIntoParagraphs(text: string): string[];
|
|
16
|
-
export declare function aggregateBlocks(paragraphs: string[], minBytes?: number): TextBlock[];
|
|
17
|
-
export declare function cosine(a: number[], b: number[]): number;
|
|
18
|
-
/**
|
|
19
|
-
* Compute cosine similarity between each consecutive pair of embeddings.
|
|
20
|
-
* Returns array of length (embeddings.length - 1).
|
|
21
|
-
*/
|
|
22
|
-
export declare function similarityCurve(embeddings: number[][]): number[];
|
|
23
|
-
/**
|
|
24
|
-
* Compute valley depth at each position in the similarity curve.
|
|
25
|
-
*
|
|
26
|
-
* depth(i) = (left_peak - curve[i]) + (right_peak - curve[i])
|
|
27
|
-
* where left_peak and right_peak are the nearest local maxima on each side.
|
|
28
|
-
*
|
|
29
|
-
* Deep valleys indicate strong topic transitions.
|
|
30
|
-
*/
|
|
31
|
-
export declare function valleyDepths(curve: number[]): number[];
|
|
32
|
-
/**
|
|
33
|
-
* Select the top N deepest valleys, sorted by position.
|
|
34
|
-
* Skips positions with zero depth (no valley).
|
|
35
|
-
*/
|
|
36
|
-
export declare function selectBoundaries(depths: number[], n: number): number[];
|
|
37
|
-
/**
|
|
38
|
-
* Snap valley-based boundaries to nearby markdown headings.
|
|
39
|
-
* Boundary values represent the first block index of the new section.
|
|
40
|
-
*/
|
|
41
|
-
export declare function snapToHeadings(boundaries: number[], blocks: TextBlock[], window?: number): number[];
|
|
42
|
-
/**
|
|
43
|
-
* Semantic document chunking using embedding-based topic boundary detection.
|
|
44
|
-
*
|
|
45
|
-
* Replaces heading-regex chunking. Works on plain text, PDF output, and
|
|
46
|
-
* markdown. Headings are used as tiebreakers for boundary placement, not
|
|
47
|
-
* as the primary segmentation signal.
|
|
48
|
-
*
|
|
49
|
-
* @param text - Document text to chunk
|
|
50
|
-
* @param embedFn - Batch embedding function (injected for testability)
|
|
51
|
-
* @returns ChunkedSection[] — same shape as the previous heading-regex chunker
|
|
52
|
-
*/
|
|
53
|
-
export declare function chunkText(text: string, embedFn: EmbedFn): Promise<ChunkedSection[]>;
|
|
54
|
-
/**
|
|
55
|
-
* Build ChunkedSection[] from blocks and section boundary positions.
|
|
56
|
-
* Each boundary is a block index where a new section starts.
|
|
57
|
-
* Within each section, paragraphs are grouped into chunks respecting
|
|
58
|
-
* MIN_CHUNK_SIZE (200) and MAX_CHUNK_SIZE (2000) byte constraints.
|
|
59
|
-
*/
|
|
60
|
-
export declare function buildSections(blocks: TextBlock[], boundaries: number[]): ChunkedSection[];
|
|
61
|
-
//# sourceMappingURL=semantic-chunker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-chunker.d.ts","sourceRoot":"","sources":["../../src/lib/semantic-chunker.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC;QACZ,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;CACJ;AAED,MAAM,MAAM,OAAO,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAE/D,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAQ1D;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,QAAQ,SAAiB,GAAG,SAAS,EAAE,CA2B5F;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAevD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAMhE;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAoBtD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAUtE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAAE,EACpB,MAAM,EAAE,SAAS,EAAE,EACnB,MAAM,SAAsB,GAC3B,MAAM,EAAE,CAgBV;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CA+DzF;AAWD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAqDzF"}
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
// ---------------------------------------------------------------------------
|
|
2
|
-
// Semantic document chunking — embedding-based topic boundary detection
|
|
3
|
-
//
|
|
4
|
-
// TEXT --> PARAGRAPHS --> BLOCKS --> EMBED --> SIMILARITY --> VALLEYS --> SECTIONS
|
|
5
|
-
//
|
|
6
|
-
// Replaces heading-regex chunking. Works identically on plain text, PDF
|
|
7
|
-
// output, and markdown. Headings are tiebreakers, not drivers.
|
|
8
|
-
// ---------------------------------------------------------------------------
|
|
9
|
-
const MIN_BLOCK_SIZE = 300;
|
|
10
|
-
const PREVIEW_LENGTH = 150;
|
|
11
|
-
const MIN_CHUNK_SIZE = 200;
|
|
12
|
-
const MAX_CHUNK_SIZE = 2000;
|
|
13
|
-
const MAX_SECTIONS = 25;
|
|
14
|
-
const BYTES_PER_SECTION = 4000;
|
|
15
|
-
const HEADING_SNAP_WINDOW = 2;
|
|
16
|
-
const HEADING_RE = /^(#{1,6})\s+(.+)$/m;
|
|
17
|
-
const SENTENCE_RE = /(?<=[.!?])\s+(?=[A-Z])/;
|
|
18
|
-
export function splitIntoParagraphs(text) {
|
|
19
|
-
const paragraphs = text.split(/\n{2,}/).map((p) => p.trim()).filter(Boolean);
|
|
20
|
-
if (paragraphs.length > 1)
|
|
21
|
-
return paragraphs;
|
|
22
|
-
const sentences = text.split(SENTENCE_RE).map((s) => s.trim()).filter(Boolean);
|
|
23
|
-
if (sentences.length > 1)
|
|
24
|
-
return sentences;
|
|
25
|
-
return paragraphs.length > 0 ? paragraphs : [text.trim()];
|
|
26
|
-
}
|
|
27
|
-
export function aggregateBlocks(paragraphs, minBytes = MIN_BLOCK_SIZE) {
|
|
28
|
-
const blocks = [];
|
|
29
|
-
let currentParagraphs = [];
|
|
30
|
-
let currentText = "";
|
|
31
|
-
function flush() {
|
|
32
|
-
if (!currentText)
|
|
33
|
-
return;
|
|
34
|
-
const headingMatch = currentText.match(HEADING_RE);
|
|
35
|
-
blocks.push({
|
|
36
|
-
text: currentText,
|
|
37
|
-
paragraphs: [...currentParagraphs],
|
|
38
|
-
headingLine: headingMatch ? headingMatch[0] : null,
|
|
39
|
-
});
|
|
40
|
-
currentParagraphs = [];
|
|
41
|
-
currentText = "";
|
|
42
|
-
}
|
|
43
|
-
for (const para of paragraphs) {
|
|
44
|
-
if (currentText && currentText.length >= minBytes) {
|
|
45
|
-
flush();
|
|
46
|
-
}
|
|
47
|
-
currentParagraphs.push(para);
|
|
48
|
-
currentText = currentText ? currentText + "\n\n" + para : para;
|
|
49
|
-
}
|
|
50
|
-
flush();
|
|
51
|
-
return blocks;
|
|
52
|
-
}
|
|
53
|
-
export function cosine(a, b) {
|
|
54
|
-
if (a.length !== b.length) {
|
|
55
|
-
throw new Error(`Vector length mismatch: ${a.length} vs ${b.length}`);
|
|
56
|
-
}
|
|
57
|
-
let dot = 0;
|
|
58
|
-
let magA = 0;
|
|
59
|
-
let magB = 0;
|
|
60
|
-
for (let i = 0; i < a.length; i++) {
|
|
61
|
-
dot += a[i] * b[i];
|
|
62
|
-
magA += a[i] * a[i];
|
|
63
|
-
magB += b[i] * b[i];
|
|
64
|
-
}
|
|
65
|
-
const denom = Math.sqrt(magA) * Math.sqrt(magB);
|
|
66
|
-
if (denom === 0)
|
|
67
|
-
return 0;
|
|
68
|
-
return dot / denom;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Compute cosine similarity between each consecutive pair of embeddings.
|
|
72
|
-
* Returns array of length (embeddings.length - 1).
|
|
73
|
-
*/
|
|
74
|
-
export function similarityCurve(embeddings) {
|
|
75
|
-
const curve = [];
|
|
76
|
-
for (let i = 0; i < embeddings.length - 1; i++) {
|
|
77
|
-
curve.push(cosine(embeddings[i], embeddings[i + 1]));
|
|
78
|
-
}
|
|
79
|
-
return curve;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Compute valley depth at each position in the similarity curve.
|
|
83
|
-
*
|
|
84
|
-
* depth(i) = (left_peak - curve[i]) + (right_peak - curve[i])
|
|
85
|
-
* where left_peak and right_peak are the nearest local maxima on each side.
|
|
86
|
-
*
|
|
87
|
-
* Deep valleys indicate strong topic transitions.
|
|
88
|
-
*/
|
|
89
|
-
export function valleyDepths(curve) {
|
|
90
|
-
const depths = new Array(curve.length).fill(0);
|
|
91
|
-
for (let i = 0; i < curve.length; i++) {
|
|
92
|
-
let leftPeak = curve[i];
|
|
93
|
-
for (let j = i - 1; j >= 0; j--) {
|
|
94
|
-
if (curve[j] > leftPeak)
|
|
95
|
-
leftPeak = curve[j];
|
|
96
|
-
else
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
let rightPeak = curve[i];
|
|
100
|
-
for (let j = i + 1; j < curve.length; j++) {
|
|
101
|
-
if (curve[j] > rightPeak)
|
|
102
|
-
rightPeak = curve[j];
|
|
103
|
-
else
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
depths[i] = (leftPeak - curve[i]) + (rightPeak - curve[i]);
|
|
107
|
-
}
|
|
108
|
-
return depths;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Select the top N deepest valleys, sorted by position.
|
|
112
|
-
* Skips positions with zero depth (no valley).
|
|
113
|
-
*/
|
|
114
|
-
export function selectBoundaries(depths, n) {
|
|
115
|
-
const indexed = depths
|
|
116
|
-
.map((d, i) => ({ depth: d, index: i }))
|
|
117
|
-
.filter((v) => v.depth > 0);
|
|
118
|
-
indexed.sort((a, b) => b.depth - a.depth);
|
|
119
|
-
const selected = indexed.slice(0, n).map((v) => v.index);
|
|
120
|
-
selected.sort((a, b) => a - b);
|
|
121
|
-
return selected;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Snap valley-based boundaries to nearby markdown headings.
|
|
125
|
-
* Boundary values represent the first block index of the new section.
|
|
126
|
-
*/
|
|
127
|
-
export function snapToHeadings(boundaries, blocks, window = HEADING_SNAP_WINDOW) {
|
|
128
|
-
return boundaries.map((pos) => {
|
|
129
|
-
const sectionStart = pos + 1;
|
|
130
|
-
let bestDist = Infinity;
|
|
131
|
-
let bestIdx = sectionStart;
|
|
132
|
-
for (let offset = -window; offset <= window; offset++) {
|
|
133
|
-
const idx = sectionStart + offset;
|
|
134
|
-
if (idx < 1 || idx >= blocks.length)
|
|
135
|
-
continue;
|
|
136
|
-
if (blocks[idx].headingLine && Math.abs(offset) < bestDist) {
|
|
137
|
-
bestDist = Math.abs(offset);
|
|
138
|
-
bestIdx = idx;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return bestIdx;
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Semantic document chunking using embedding-based topic boundary detection.
|
|
146
|
-
*
|
|
147
|
-
* Replaces heading-regex chunking. Works on plain text, PDF output, and
|
|
148
|
-
* markdown. Headings are used as tiebreakers for boundary placement, not
|
|
149
|
-
* as the primary segmentation signal.
|
|
150
|
-
*
|
|
151
|
-
* @param text - Document text to chunk
|
|
152
|
-
* @param embedFn - Batch embedding function (injected for testability)
|
|
153
|
-
* @returns ChunkedSection[] — same shape as the previous heading-regex chunker
|
|
154
|
-
*/
|
|
155
|
-
export async function chunkText(text, embedFn) {
|
|
156
|
-
const trimmed = text.trim();
|
|
157
|
-
const t0 = Date.now();
|
|
158
|
-
const log = (stage, detail) => console.error(`[semantic-chunker] ${stage}${detail ? ` — ${detail}` : ""} (${Date.now() - t0}ms)`);
|
|
159
|
-
log("start", `${trimmed.length} chars`);
|
|
160
|
-
// Short-circuit: very short documents don't need embedding
|
|
161
|
-
if (trimmed.length < MIN_BLOCK_SIZE) {
|
|
162
|
-
log("short-circuit", "below MIN_BLOCK_SIZE");
|
|
163
|
-
return [{
|
|
164
|
-
title: deriveTitle(trimmed),
|
|
165
|
-
chunks: [{
|
|
166
|
-
id: 0,
|
|
167
|
-
preview: trimmed.slice(0, PREVIEW_LENGTH),
|
|
168
|
-
content: trimmed,
|
|
169
|
-
}],
|
|
170
|
-
}];
|
|
171
|
-
}
|
|
172
|
-
// 1. Split into paragraphs and aggregate into blocks
|
|
173
|
-
const paragraphs = splitIntoParagraphs(trimmed);
|
|
174
|
-
const blocks = aggregateBlocks(paragraphs);
|
|
175
|
-
log("blocks", `${paragraphs.length} paragraphs → ${blocks.length} blocks`);
|
|
176
|
-
// Short-circuit: too few blocks for boundary detection
|
|
177
|
-
if (blocks.length <= 2) {
|
|
178
|
-
log("short-circuit", "≤2 blocks, skipping embedding");
|
|
179
|
-
return buildSections(blocks, []);
|
|
180
|
-
}
|
|
181
|
-
// 2. Batch embed all blocks
|
|
182
|
-
log("embedding", `${blocks.length} blocks via Ollama`);
|
|
183
|
-
const embeddings = await embedFn(blocks.map((b) => b.text));
|
|
184
|
-
log("embedded", `${embeddings.length} vectors (dim=${embeddings[0]?.length ?? 0})`);
|
|
185
|
-
// 3. Compute similarity curve and valley depths
|
|
186
|
-
const curve = similarityCurve(embeddings);
|
|
187
|
-
const depths = valleyDepths(curve);
|
|
188
|
-
// 4. Select top N boundaries (adaptive with ceiling)
|
|
189
|
-
const targetN = Math.min(Math.ceil(trimmed.length / BYTES_PER_SECTION), MAX_SECTIONS, curve.length);
|
|
190
|
-
const rawBoundaries = selectBoundaries(depths, targetN);
|
|
191
|
-
// 5. Snap to nearby headings
|
|
192
|
-
const snappedBoundaries = snapToHeadings(rawBoundaries, blocks);
|
|
193
|
-
// Deduplicate (snapping can cause two boundaries to land on the same block)
|
|
194
|
-
const uniqueBoundaries = [...new Set(snappedBoundaries)].sort((a, b) => a - b);
|
|
195
|
-
log("boundaries", `${uniqueBoundaries.length} section breaks from ${rawBoundaries.length} candidates`);
|
|
196
|
-
// 6. Build sections with chunks
|
|
197
|
-
const sections = buildSections(blocks, uniqueBoundaries);
|
|
198
|
-
const totalChunks = sections.reduce((n, s) => n + s.chunks.length, 0);
|
|
199
|
-
log("done", `${sections.length} sections, ${totalChunks} chunks`);
|
|
200
|
-
return sections;
|
|
201
|
-
}
|
|
202
|
-
function deriveTitle(text) {
|
|
203
|
-
const headingMatch = text.match(HEADING_RE);
|
|
204
|
-
if (headingMatch)
|
|
205
|
-
return headingMatch[2].trim().slice(0, 80);
|
|
206
|
-
const sentenceEnd = text.search(/[.!?]\s/);
|
|
207
|
-
return sentenceEnd > 0 && sentenceEnd < 80
|
|
208
|
-
? text.slice(0, sentenceEnd + 1)
|
|
209
|
-
: text.slice(0, 80);
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Build ChunkedSection[] from blocks and section boundary positions.
|
|
213
|
-
* Each boundary is a block index where a new section starts.
|
|
214
|
-
* Within each section, paragraphs are grouped into chunks respecting
|
|
215
|
-
* MIN_CHUNK_SIZE (200) and MAX_CHUNK_SIZE (2000) byte constraints.
|
|
216
|
-
*/
|
|
217
|
-
export function buildSections(blocks, boundaries) {
|
|
218
|
-
const sections = [];
|
|
219
|
-
let chunkId = 0;
|
|
220
|
-
const starts = [0, ...boundaries];
|
|
221
|
-
const ends = [...boundaries, blocks.length];
|
|
222
|
-
for (let s = 0; s < starts.length; s++) {
|
|
223
|
-
const sectionBlocks = blocks.slice(starts[s], ends[s]);
|
|
224
|
-
if (sectionBlocks.length === 0)
|
|
225
|
-
continue;
|
|
226
|
-
const headingBlock = sectionBlocks.find((b) => b.headingLine);
|
|
227
|
-
const title = headingBlock
|
|
228
|
-
? headingBlock.headingLine.replace(/^#+\s+/, "")
|
|
229
|
-
: deriveTitle(sectionBlocks[0].paragraphs[0] || sectionBlocks[0].text);
|
|
230
|
-
const allParagraphs = sectionBlocks.flatMap((b) => b.paragraphs);
|
|
231
|
-
const chunks = [];
|
|
232
|
-
let buffer = "";
|
|
233
|
-
for (const para of allParagraphs) {
|
|
234
|
-
if (buffer && buffer.length + para.length + 2 > MAX_CHUNK_SIZE) {
|
|
235
|
-
chunks.push({
|
|
236
|
-
id: chunkId++,
|
|
237
|
-
preview: buffer.slice(0, PREVIEW_LENGTH),
|
|
238
|
-
content: buffer,
|
|
239
|
-
});
|
|
240
|
-
buffer = para;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
buffer = buffer ? buffer + "\n\n" + para : para;
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
if (buffer) {
|
|
247
|
-
if (buffer.length < MIN_CHUNK_SIZE && chunks.length > 0) {
|
|
248
|
-
const prev = chunks[chunks.length - 1];
|
|
249
|
-
prev.content = prev.content + "\n\n" + buffer;
|
|
250
|
-
prev.preview = prev.content.slice(0, PREVIEW_LENGTH);
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
chunks.push({
|
|
254
|
-
id: chunkId++,
|
|
255
|
-
preview: buffer.slice(0, PREVIEW_LENGTH),
|
|
256
|
-
content: buffer,
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
if (chunks.length > 0) {
|
|
261
|
-
sections.push({ title, chunks });
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
return sections;
|
|
265
|
-
}
|
|
266
|
-
//# sourceMappingURL=semantic-chunker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"semantic-chunker.js","sourceRoot":"","sources":["../../src/lib/semantic-chunker.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wEAAwE;AACxE,EAAE;AACF,mFAAmF;AACnF,EAAE;AACF,wEAAwE;AACxE,+DAA+D;AAC/D,8EAA8E;AAE9E,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,cAAc,GAAG,GAAG,CAAC;AAC3B,MAAM,cAAc,GAAG,IAAI,CAAC;AAC5B,MAAM,YAAY,GAAG,EAAE,CAAC;AACxB,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAC/B,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAC9B,MAAM,UAAU,GAAG,oBAAoB,CAAC;AACxC,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAmB7C,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7E,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IAE7C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC/E,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAE3C,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CA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,MAAM,GAAG,CAAC,CAAC,CAAC;gBACvC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;gBAC9C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;YACvD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,IAAI,CAAC;oBACV,EAAE,EAAE,OAAO,EAAE;oBACb,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC;oBACxC,OAAO,EAAE,MAAM;iBAChB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/payload/premium-plugins/real-agency/plugins/real-agency-loop/mcp/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|