@rubytech/create-maxy 1.0.702 → 1.0.704
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/dist/uninstall.js +24 -15
- package/package.json +1 -1
- package/payload/platform/config/brand.json +1 -1
- package/payload/platform/package-lock.json +67 -249
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts +1 -0
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.d.ts.map +1 -1
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js +11 -3
- package/payload/platform/plugins/admin/mcp/dist/lib/onboarding.js.map +1 -1
- package/payload/platform/plugins/admin/skills/business-profile/SKILL.md +13 -1
- package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +19 -6
- package/payload/platform/plugins/docs/references/internals.md +2 -0
- package/payload/platform/plugins/docs/references/platform.md +2 -1
- package/payload/platform/plugins/docs/references/plugins-guide.md +1 -0
- package/payload/platform/plugins/linkedin-import/PLUGIN.md +26 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/SKILL.md +119 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/connections.md +162 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/profile.md +102 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts +21 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js +50 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/graph-write-gate.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js +15 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-update.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +11 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +5 -3
- package/payload/platform/templates/specialists/agents/database-operator.md +113 -0
- package/payload/server/{chunk-O2FWENOD.js → chunk-UFLV7I6N.js} +181 -33
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/public/assets/{Checkbox-C24zNZ3g.js → Checkbox-CDUmQ1Bu.js} +1 -1
- package/payload/server/public/assets/{admin-DQS9d7gx.js → admin-picYWZfn.js} +2 -2
- package/payload/server/public/assets/{data-lJ2vb2jV.js → data-yYbcrFrc.js} +1 -1
- package/payload/server/public/assets/{file-16btGXA4.js → file-CzLc4Rvq.js} +1 -1
- package/payload/server/public/assets/{graph-gsP1la3h.js → graph-BRzC0ZtS.js} +1 -1
- package/payload/server/public/assets/{house-DJ35FtjK.js → house-lM4gLKkH.js} +1 -1
- package/payload/server/public/assets/jsx-runtime-I6ZqIGn8.css +1 -0
- package/payload/server/public/assets/{public-D8whQhxR.js → public-scZadgzt.js} +1 -1
- package/payload/server/public/assets/{share-2-C-ICFdTB.js → share-2-CNdrRWue.js} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-xTGR1bpD.js → useVoiceRecorder-D2kfoqVB.js} +1 -1
- package/payload/server/public/assets/{x-BrDQr7Iy.js → x-CsDhB6Vr.js} +1 -1
- package/payload/server/public/data.html +6 -6
- package/payload/server/public/graph.html +7 -7
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +90 -45
- 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-32ZHQJNX.js +0 -11395
- package/payload/server/chunk-3RBKKDHC.js +0 -783
- package/payload/server/chunk-3VVHVJK2.js +0 -11405
- package/payload/server/chunk-5YIXIF6C.js +0 -726
- package/payload/server/chunk-B54KBAK4.js +0 -72
- package/payload/server/chunk-IAIGB5WN.js +0 -11406
- package/payload/server/chunk-Q6NDXCM6.js +0 -11448
- package/payload/server/chunk-U3W5YIXU.js +0 -11450
- package/payload/server/chunk-ZL2A4ROK.js +0 -11416
- package/payload/server/public/assets/jsx-runtime-n7GjUxnC.css +0 -1
- package/payload/server/upgrade-progress-server.js +0 -83
- /package/payload/server/public/assets/{jsx-runtime-CHagz7cd.js → jsx-runtime-BK2hplUC.js} +0 -0
|
@@ -3487,6 +3487,7 @@ function cacheConversationId(sessionKey, conversationId) {
|
|
|
3487
3487
|
}
|
|
3488
3488
|
}
|
|
3489
3489
|
var GREETING_DIRECTIVE = "[New session. Greet the visitor.]";
|
|
3490
|
+
var DIRECTIVE_PREFIX = "[New session.";
|
|
3490
3491
|
async function ensureConversation(accountId, agentType, sessionKey, visitorId, agentSlug, userId) {
|
|
3491
3492
|
const cached = getCachedConversationId(sessionKey);
|
|
3492
3493
|
if (cached) return cached;
|
|
@@ -4063,23 +4064,50 @@ async function searchMessages(accountId, queryEmbedding, limit = 10) {
|
|
|
4063
4064
|
await session.close();
|
|
4064
4065
|
}
|
|
4065
4066
|
}
|
|
4067
|
+
var LIST_BACKFILL_CAP = 3;
|
|
4066
4068
|
async function listAdminSessions(accountId, userId, limit = 20) {
|
|
4067
4069
|
const session = getSession();
|
|
4068
4070
|
try {
|
|
4069
4071
|
const result = await session.run(
|
|
4070
4072
|
`MATCH (c:Conversation {accountId: $accountId, agentType: 'admin', userId: $userId})
|
|
4073
|
+
WITH c
|
|
4074
|
+
ORDER BY c.updatedAt DESC
|
|
4075
|
+
LIMIT $limit
|
|
4076
|
+
CALL {
|
|
4077
|
+
WITH c
|
|
4078
|
+
OPTIONAL MATCH (m:Message)-[:PART_OF]->(c)
|
|
4079
|
+
WHERE m.role = 'user'
|
|
4080
|
+
AND c.name IS NULL
|
|
4081
|
+
AND NOT (m.content STARTS WITH '[New session.')
|
|
4082
|
+
AND NOT (m.content STARTS WITH '{"')
|
|
4083
|
+
AND size(m.content) >= 4
|
|
4084
|
+
RETURN m.content AS content, m.createdAt AS createdAt
|
|
4085
|
+
ORDER BY m.createdAt ASC
|
|
4086
|
+
LIMIT 1
|
|
4087
|
+
}
|
|
4071
4088
|
RETURN c.conversationId AS conversationId,
|
|
4072
4089
|
c.name AS name,
|
|
4073
|
-
c.updatedAt AS updatedAt
|
|
4074
|
-
|
|
4075
|
-
LIMIT $limit`,
|
|
4090
|
+
c.updatedAt AS updatedAt,
|
|
4091
|
+
content AS firstSubstantiveUserMessage`,
|
|
4076
4092
|
{ accountId, userId, limit: neo4j.int(limit) }
|
|
4077
4093
|
);
|
|
4078
|
-
|
|
4094
|
+
const rows = result.records.map((r) => ({
|
|
4079
4095
|
conversationId: r.get("conversationId"),
|
|
4080
4096
|
name: r.get("name"),
|
|
4081
|
-
updatedAt: String(r.get("updatedAt"))
|
|
4097
|
+
updatedAt: String(r.get("updatedAt")),
|
|
4098
|
+
firstSubstantiveUserMessage: r.get("firstSubstantiveUserMessage")
|
|
4082
4099
|
}));
|
|
4100
|
+
let backfillsKicked = 0;
|
|
4101
|
+
for (const row of rows) {
|
|
4102
|
+
if (backfillsKicked >= LIST_BACKFILL_CAP) break;
|
|
4103
|
+
if (row.name !== null) continue;
|
|
4104
|
+
const seed = row.firstSubstantiveUserMessage;
|
|
4105
|
+
if (!seed || !isMessageUseful(seed)) continue;
|
|
4106
|
+
backfillsKicked++;
|
|
4107
|
+
autoLabelSession(row.conversationId, seed).catch(() => {
|
|
4108
|
+
});
|
|
4109
|
+
}
|
|
4110
|
+
return rows.map(({ conversationId, name, updatedAt }) => ({ conversationId, name, updatedAt }));
|
|
4083
4111
|
} catch (err) {
|
|
4084
4112
|
console.error(`[persist] listAdminSessions failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
4085
4113
|
return [];
|
|
@@ -4120,9 +4148,15 @@ function isMessageUseful(message) {
|
|
|
4120
4148
|
if (trimmed.length < 4) return false;
|
|
4121
4149
|
if (trimmed.startsWith('{"')) return false;
|
|
4122
4150
|
if (GENERIC_MESSAGE.test(trimmed)) return false;
|
|
4123
|
-
if (trimmed.startsWith(
|
|
4151
|
+
if (trimmed.startsWith(DIRECTIVE_PREFIX)) return false;
|
|
4124
4152
|
return true;
|
|
4125
4153
|
}
|
|
4154
|
+
function totalFailures(f) {
|
|
4155
|
+
return f.skip + f.error;
|
|
4156
|
+
}
|
|
4157
|
+
function failureBreakdown(f) {
|
|
4158
|
+
return `skip:${f.skip} error:${f.error}`;
|
|
4159
|
+
}
|
|
4126
4160
|
var labelAccumulator = /* @__PURE__ */ new Map();
|
|
4127
4161
|
var _spawnOverride = null;
|
|
4128
4162
|
var SESSION_LABEL_SYSTEM = `You are a session labeler. Given the opening messages of a conversation with an AI assistant, produce a concise topic label.
|
|
@@ -4202,17 +4236,53 @@ ${userContent}`;
|
|
|
4202
4236
|
async function autoLabelSession(conversationId, userMessage) {
|
|
4203
4237
|
if (!conversationId) return;
|
|
4204
4238
|
if (!isMessageUseful(userMessage)) {
|
|
4205
|
-
const
|
|
4239
|
+
const trimmed = userMessage.trim();
|
|
4240
|
+
const reason = trimmed.startsWith('{"') ? "JSON envelope" : trimmed.startsWith(DIRECTIVE_PREFIX) ? "directive" : GENERIC_MESSAGE.test(trimmed) ? "greeting" : trimmed.length < 4 ? "too short" : "directive";
|
|
4206
4241
|
console.error(`[persist] autoLabel: skipped ${conversationId.slice(0, 8)}\u2026 \u2014 ${reason}`);
|
|
4207
4242
|
return;
|
|
4208
4243
|
}
|
|
4244
|
+
try {
|
|
4245
|
+
const preCheck = getSession();
|
|
4246
|
+
try {
|
|
4247
|
+
const res = await preCheck.run(
|
|
4248
|
+
`MATCH (c:Conversation {conversationId: $conversationId})
|
|
4249
|
+
OPTIONAL MATCH (m:Message)-[:PART_OF]->(c)
|
|
4250
|
+
WHERE m.role = 'user'
|
|
4251
|
+
WITH c, count(m) AS userCount
|
|
4252
|
+
RETURN c.name AS name, userCount`,
|
|
4253
|
+
{ conversationId }
|
|
4254
|
+
);
|
|
4255
|
+
const firstRecord = res.records[0];
|
|
4256
|
+
const existingName = firstRecord?.get("name");
|
|
4257
|
+
const userCountRaw = firstRecord?.get("userCount");
|
|
4258
|
+
const userCount = typeof userCountRaw === "object" && userCountRaw !== null ? Number(userCountRaw) : Number(userCountRaw ?? 0);
|
|
4259
|
+
if (existingName) {
|
|
4260
|
+
console.error(`[persist] autoLabel: already named ${conversationId.slice(0, 8)}\u2026 \u2014 skipping`);
|
|
4261
|
+
labelAccumulator.delete(conversationId);
|
|
4262
|
+
return;
|
|
4263
|
+
}
|
|
4264
|
+
if (userCount > 3) {
|
|
4265
|
+
console.error(`[persist] autoLabel: past autolabel window ${conversationId.slice(0, 8)}\u2026 \u2014 userCount=${userCount}, skipping`);
|
|
4266
|
+
labelAccumulator.delete(conversationId);
|
|
4267
|
+
return;
|
|
4268
|
+
}
|
|
4269
|
+
} finally {
|
|
4270
|
+
await preCheck.close();
|
|
4271
|
+
}
|
|
4272
|
+
} catch (err) {
|
|
4273
|
+
console.error(`[persist] autoLabel: pre-check read failed for ${conversationId.slice(0, 8)}\u2026 \u2014 proceeding: ${err instanceof Error ? err.message : String(err)}`);
|
|
4274
|
+
}
|
|
4209
4275
|
let entry = labelAccumulator.get(conversationId);
|
|
4210
4276
|
if (!entry) {
|
|
4211
|
-
entry = {
|
|
4277
|
+
entry = {
|
|
4278
|
+
messages: [],
|
|
4279
|
+
pending: false,
|
|
4280
|
+
failures: { skip: 0, error: 0 }
|
|
4281
|
+
};
|
|
4212
4282
|
labelAccumulator.set(conversationId, entry);
|
|
4213
4283
|
}
|
|
4214
|
-
if (entry.
|
|
4215
|
-
console.error(`[persist] autoLabel: evicted ${conversationId.slice(0, 8)}\u2026 after ${SESSION_LABEL_MAX_ATTEMPTS} attempts`);
|
|
4284
|
+
if (totalFailures(entry.failures) >= SESSION_LABEL_MAX_ATTEMPTS) {
|
|
4285
|
+
console.error(`[persist] autoLabel: evicted ${conversationId.slice(0, 8)}\u2026 after ${SESSION_LABEL_MAX_ATTEMPTS} failed-attempts (${failureBreakdown(entry.failures)})`);
|
|
4216
4286
|
labelAccumulator.delete(conversationId);
|
|
4217
4287
|
return;
|
|
4218
4288
|
}
|
|
@@ -4222,11 +4292,11 @@ async function autoLabelSession(conversationId, userMessage) {
|
|
|
4222
4292
|
return;
|
|
4223
4293
|
}
|
|
4224
4294
|
entry.pending = true;
|
|
4225
|
-
entry.attempts++;
|
|
4226
4295
|
try {
|
|
4227
4296
|
const label = await generateSessionLabel(entry.messages);
|
|
4228
4297
|
if (!label) {
|
|
4229
|
-
|
|
4298
|
+
entry.failures.skip++;
|
|
4299
|
+
console.error(`[persist] autoLabel: generateSessionLabel returned null for ${conversationId.slice(0, 8)}\u2026 (failures ${failureBreakdown(entry.failures)}, ${entry.messages.length} msgs)`);
|
|
4230
4300
|
entry.pending = false;
|
|
4231
4301
|
return;
|
|
4232
4302
|
}
|
|
@@ -4253,16 +4323,22 @@ async function autoLabelSession(conversationId, userMessage) {
|
|
|
4253
4323
|
{ conversationId, label: fullLabel, ...embedding ? { embedding } : {} }
|
|
4254
4324
|
);
|
|
4255
4325
|
if (result.records.length > 0) {
|
|
4256
|
-
console.error(`[persist]
|
|
4326
|
+
console.error(`[persist] autoLabel: commit ${conversationId.slice(0, 8)}\u2026 name="${fullLabel}"${embedding ? " (embedded)" : ""}`);
|
|
4327
|
+
labelAccumulator.delete(conversationId);
|
|
4328
|
+
} else {
|
|
4329
|
+
console.error(`[persist] autoLabel: no-op commit ${conversationId.slice(0, 8)}\u2026 (name already set or userCount>3)`);
|
|
4257
4330
|
labelAccumulator.delete(conversationId);
|
|
4258
4331
|
}
|
|
4259
4332
|
} catch (err) {
|
|
4260
|
-
|
|
4333
|
+
entry.failures.error++;
|
|
4334
|
+
console.error(`[persist] autoLabelSession failed: ${err instanceof Error ? err.message : String(err)} (failures ${failureBreakdown(entry.failures)})`);
|
|
4261
4335
|
} finally {
|
|
4262
4336
|
await session.close();
|
|
4263
4337
|
}
|
|
4264
4338
|
} catch (err) {
|
|
4265
|
-
|
|
4339
|
+
const currentEntry = labelAccumulator.get(conversationId);
|
|
4340
|
+
if (currentEntry) currentEntry.failures.error++;
|
|
4341
|
+
console.error(`[persist] autoLabel: unexpected error \u2014 ${err instanceof Error ? err.message : String(err)}${currentEntry ? ` (failures ${failureBreakdown(currentEntry.failures)})` : ""}`);
|
|
4266
4342
|
} finally {
|
|
4267
4343
|
const currentEntry = labelAccumulator.get(conversationId);
|
|
4268
4344
|
if (currentEntry) currentEntry.pending = false;
|
|
@@ -4944,7 +5020,7 @@ import { spawn as spawn2, spawnSync as spawnSync2 } from "child_process";
|
|
|
4944
5020
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
4945
5021
|
import { resolve as resolve7, join as join3 } from "path";
|
|
4946
5022
|
import { platform as osPlatform } from "os";
|
|
4947
|
-
import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, readdirSync as readdirSync2, existsSync as existsSync6, mkdirSync as mkdirSync6, createWriteStream, statSync as statSync2, unlinkSync as unlinkSync3, cpSync, rmSync as rmSync2, appendFileSync as appendFileSync2, openSync as openSync2, readSync as readSync2, closeSync as closeSync2 } from "fs";
|
|
5023
|
+
import { readFileSync as readFileSync9, writeFileSync as writeFileSync6, readdirSync as readdirSync2, existsSync as existsSync6, mkdirSync as mkdirSync6, createWriteStream, statSync as statSync2, unlinkSync as unlinkSync3, renameSync as renameSync2, cpSync, rmSync as rmSync2, appendFileSync as appendFileSync2, openSync as openSync2, readSync as readSync2, closeSync as closeSync2 } from "fs";
|
|
4948
5024
|
import { lookup as dnsLookup } from "dns/promises";
|
|
4949
5025
|
import { createConnection as netConnect } from "net";
|
|
4950
5026
|
import { StringDecoder } from "string_decoder";
|
|
@@ -6207,6 +6283,9 @@ function loadAdminSchemaBlock(schemaCypherPath) {
|
|
|
6207
6283
|
return buildSchemaBlock(text);
|
|
6208
6284
|
}
|
|
6209
6285
|
|
|
6286
|
+
// app/lib/specialist-domains-clause.ts
|
|
6287
|
+
var SPECIALIST_DOMAINS_ROUTING_CLAUSE = "Specialist subagents own these domains. Match user intent to a tool below and delegate to the specialist. Fall back to memory-search only when no tool here matches. ToolSearch is a last-resort escape hatch for tools not listed in any domain \u2014 not a routing mechanism; prefer admitting ignorance over discovering.";
|
|
6288
|
+
|
|
6210
6289
|
// app/lib/claude-agent.ts
|
|
6211
6290
|
var LOG_RETENTION_DAYS = 7;
|
|
6212
6291
|
var BROWSER_TOOL_PREFIXES = [
|
|
@@ -7183,6 +7262,7 @@ function fetchMcpToolsList(pluginDir) {
|
|
|
7183
7262
|
const serverPath = resolve7(PLATFORM_ROOT4, "plugins", pluginDir, "mcp/dist/index.js");
|
|
7184
7263
|
if (!existsSync6(serverPath)) return Promise.resolve([]);
|
|
7185
7264
|
const startMs = Date.now();
|
|
7265
|
+
console.error(`[spawn-env] STREAM_LOG_PATH=unset site=toolslist pluginDir=${pluginDir} reason=discovery-no-conversation`);
|
|
7186
7266
|
return new Promise((resolvePromise) => {
|
|
7187
7267
|
const proc = spawn2(process.execPath, [serverPath], {
|
|
7188
7268
|
env: {
|
|
@@ -7361,7 +7441,7 @@ async function buildPluginManifest(enabledPlugins) {
|
|
|
7361
7441
|
}
|
|
7362
7442
|
if (specialistGroups.size > 0) {
|
|
7363
7443
|
lines.push("\n<specialist-domains>");
|
|
7364
|
-
lines.push(
|
|
7444
|
+
lines.push(SPECIALIST_DOMAINS_ROUTING_CLAUSE);
|
|
7365
7445
|
for (const [specialist, plugins] of specialistGroups) {
|
|
7366
7446
|
lines.push(`
|
|
7367
7447
|
${specialist}: ${plugins.join(", ")}`);
|
|
@@ -7370,6 +7450,9 @@ ${specialist}: ${plugins.join(", ")}`);
|
|
|
7370
7450
|
if (details) {
|
|
7371
7451
|
for (const tool of details.tools) {
|
|
7372
7452
|
const toolDesc = tool.description ? tool.description.split(/\.\s/)[0].replace(/\.$/, "") : "";
|
|
7453
|
+
if (!toolDesc) {
|
|
7454
|
+
console.error(`[plugin-manifest] WARN: specialist tool missing description plugin=${plugin} tool=${tool.name}`);
|
|
7455
|
+
}
|
|
7373
7456
|
lines.push(toolDesc ? ` ${tool.name} \u2014 ${toolDesc}` : ` ${tool.name}`);
|
|
7374
7457
|
}
|
|
7375
7458
|
}
|
|
@@ -7519,6 +7602,13 @@ function resolveUserAccounts(userId) {
|
|
|
7519
7602
|
}
|
|
7520
7603
|
return results;
|
|
7521
7604
|
}
|
|
7605
|
+
function findFirstSubstantiveUserMessage(turns) {
|
|
7606
|
+
for (const t of turns) {
|
|
7607
|
+
if (t.role !== "user") continue;
|
|
7608
|
+
if (isMessageUseful(t.content)) return t.content;
|
|
7609
|
+
}
|
|
7610
|
+
return null;
|
|
7611
|
+
}
|
|
7522
7612
|
var sessionStore = /* @__PURE__ */ new Map();
|
|
7523
7613
|
setSessionStoreRef(sessionStore);
|
|
7524
7614
|
function registerSession(sessionKey, agentType, accountId, agentName, userId, userName) {
|
|
@@ -7602,7 +7692,7 @@ function drainPendingTurns(sessionKey) {
|
|
|
7602
7692
|
async function maybeFlushConversationBuffer(sessionKey, agentType, accountId) {
|
|
7603
7693
|
const session = sessionStore.get(sessionKey);
|
|
7604
7694
|
if (!session) return null;
|
|
7605
|
-
if (session.conversationId) return session.conversationId;
|
|
7695
|
+
if (session.conversationId) return { conversationId: session.conversationId, buffered: [] };
|
|
7606
7696
|
if (getPendingTurnCount(sessionKey) < 2) return null;
|
|
7607
7697
|
if (session.flushInFlight) return session.flushInFlight;
|
|
7608
7698
|
const attempt = (async () => {
|
|
@@ -7619,6 +7709,7 @@ async function maybeFlushConversationBuffer(sessionKey, agentType, accountId) {
|
|
|
7619
7709
|
}
|
|
7620
7710
|
if (!conversationId) return null;
|
|
7621
7711
|
session.conversationId = conversationId;
|
|
7712
|
+
renameStreamLogsOnFlush(resolve7(ACCOUNTS_DIR, accountId), sessionKey, conversationId);
|
|
7622
7713
|
const buffered = drainPendingTurns(sessionKey) ?? [];
|
|
7623
7714
|
for (const turn of buffered) {
|
|
7624
7715
|
persistMessage(conversationId, turn.role, turn.content, accountId, turn.tokens, turn.timestamp, turn.sender).catch((err) => {
|
|
@@ -7626,7 +7717,7 @@ async function maybeFlushConversationBuffer(sessionKey, agentType, accountId) {
|
|
|
7626
7717
|
});
|
|
7627
7718
|
}
|
|
7628
7719
|
console.log(`[conversation-gate] ${(/* @__PURE__ */ new Date()).toISOString()} flushed sessionKey=${sessionKey.slice(0, 8)} conversationId=${conversationId.slice(0, 8)} bufferedMessages=${buffered.length} agentType=${agentType}`);
|
|
7629
|
-
return conversationId;
|
|
7720
|
+
return { conversationId, buffered };
|
|
7630
7721
|
})();
|
|
7631
7722
|
session.flushInFlight = attempt;
|
|
7632
7723
|
try {
|
|
@@ -7641,6 +7732,41 @@ function isDmChannelSessionKey(sessionKey) {
|
|
|
7641
7732
|
function preflushStreamLogKey(sessionKey) {
|
|
7642
7733
|
return `preflush-${sessionKey.slice(0, 12)}`;
|
|
7643
7734
|
}
|
|
7735
|
+
function renameStreamLogsOnFlush(accountDir, sessionKey, conversationId) {
|
|
7736
|
+
const STREAM_LOG_NAMES = ["claude-agent-stream", "claude-agent-stderr", "public-agent-stream"];
|
|
7737
|
+
const logDir = resolve7(accountDir, "logs");
|
|
7738
|
+
const preflushSuffix = preflushStreamLogKey(sessionKey);
|
|
7739
|
+
const sk8 = sessionKey.slice(0, 8);
|
|
7740
|
+
const cid8 = conversationId.slice(0, 8);
|
|
7741
|
+
for (const name of STREAM_LOG_NAMES) {
|
|
7742
|
+
const fromPath = resolve7(logDir, `${name}-${preflushSuffix}.log`);
|
|
7743
|
+
const toPath = resolve7(logDir, `${name}-${conversationId}.log`);
|
|
7744
|
+
let result;
|
|
7745
|
+
let reason = "";
|
|
7746
|
+
try {
|
|
7747
|
+
if (!existsSync6(fromPath)) {
|
|
7748
|
+
result = "skipped";
|
|
7749
|
+
reason = "no-preflush-file";
|
|
7750
|
+
} else {
|
|
7751
|
+
const targetExisted = existsSync6(toPath);
|
|
7752
|
+
renameSync2(fromPath, toPath);
|
|
7753
|
+
for (const entry of openStreamLogs.values()) {
|
|
7754
|
+
if (entry.path === fromPath) {
|
|
7755
|
+
entry.path = toPath;
|
|
7756
|
+
entry.conversationId = conversationId;
|
|
7757
|
+
}
|
|
7758
|
+
}
|
|
7759
|
+
result = "renamed";
|
|
7760
|
+
if (targetExisted) reason = "target-existed";
|
|
7761
|
+
}
|
|
7762
|
+
} catch (err) {
|
|
7763
|
+
result = "error";
|
|
7764
|
+
reason = err instanceof Error ? err.message : String(err);
|
|
7765
|
+
}
|
|
7766
|
+
const reasonPart = reason ? ` reason=${JSON.stringify(reason)}` : "";
|
|
7767
|
+
console.log(`[stream-log-rename] ${(/* @__PURE__ */ new Date()).toISOString()} sessionKey=${sk8} conversationId=${cid8} name=${name} result=${result}${reasonPart}`);
|
|
7768
|
+
}
|
|
7769
|
+
}
|
|
7644
7770
|
function getAgentNameForSession(sessionKey) {
|
|
7645
7771
|
return sessionStore.get(sessionKey)?.agentName;
|
|
7646
7772
|
}
|
|
@@ -8354,6 +8480,15 @@ async function fetchMemoryContext(accountId, query, sessionKey, options) {
|
|
|
8354
8480
|
return null;
|
|
8355
8481
|
}
|
|
8356
8482
|
const startMs = Date.now();
|
|
8483
|
+
let memoryStreamLogPath;
|
|
8484
|
+
if (sessionKey) {
|
|
8485
|
+
const convId = getConversationIdForSession(sessionKey);
|
|
8486
|
+
const logKey = convId ?? preflushStreamLogKey(sessionKey);
|
|
8487
|
+
memoryStreamLogPath = streamLogPathFor(accountId, logKey).streamLogPath;
|
|
8488
|
+
console.error(`[spawn-env] STREAM_LOG_PATH=set site=fetchMemoryContext accountId=${accountId.slice(0, 8)} logKey=${logKey}`);
|
|
8489
|
+
} else {
|
|
8490
|
+
console.error(`[spawn-env] STREAM_LOG_PATH=unset site=fetchMemoryContext accountId=${accountId.slice(0, 8)} reason=no-sessionKey-passed`);
|
|
8491
|
+
}
|
|
8357
8492
|
return new Promise((resolve9) => {
|
|
8358
8493
|
const proc = spawn2(process.execPath, [serverPath], {
|
|
8359
8494
|
env: {
|
|
@@ -8363,6 +8498,7 @@ async function fetchMemoryContext(accountId, query, sessionKey, options) {
|
|
|
8363
8498
|
READ_ONLY: "true",
|
|
8364
8499
|
ALLOWED_SCOPES: "public,shared",
|
|
8365
8500
|
...sessionKey ? { SESSION_ID: sessionKey } : {},
|
|
8501
|
+
...memoryStreamLogPath ? { STREAM_LOG_PATH: memoryStreamLogPath } : {},
|
|
8366
8502
|
...options?.agentSlug ? { AGENT_SLUG: options.agentSlug } : {},
|
|
8367
8503
|
...options?.knowledgeKeywords && options.knowledgeKeywords.length > 0 ? { KNOWLEDGE_KEYWORDS: options.knowledgeKeywords.join(",") } : {}
|
|
8368
8504
|
}
|
|
@@ -8449,6 +8585,7 @@ async function compactTrimmedMessages(accountId, trimmedMessages) {
|
|
|
8449
8585
|
const serverPath = resolve7(PLATFORM_ROOT4, "plugins/memory/mcp/dist/index.js");
|
|
8450
8586
|
if (!existsSync6(serverPath)) return false;
|
|
8451
8587
|
const briefing = trimmedMessages.map((m) => `[${m.role.toUpperCase()}] ${m.content}`).join("\n\n");
|
|
8588
|
+
console.error(`[spawn-env] STREAM_LOG_PATH=unset site=compactTrimmedMessages accountId=${accountId.slice(0, 8)} reason=no-sessionKey-binding`);
|
|
8452
8589
|
return new Promise((resolvePromise) => {
|
|
8453
8590
|
const proc = spawn2(process.execPath, [serverPath], {
|
|
8454
8591
|
env: { ...process.env, ACCOUNT_ID: accountId }
|
|
@@ -8888,6 +9025,9 @@ async function* parseClaudeStream(proc, streamLog, adminModel, conversationId, a
|
|
|
8888
9025
|
let buffer = "";
|
|
8889
9026
|
const modelCtxWindow = contextWindow(adminModel);
|
|
8890
9027
|
let peakRequestContextPct = 0;
|
|
9028
|
+
let toolUseTotal = 0;
|
|
9029
|
+
let toolSearchCount = 0;
|
|
9030
|
+
let delegatedCount = 0;
|
|
8891
9031
|
const API_WAIT_PING_MS = 15e3;
|
|
8892
9032
|
let apiWaitTimer;
|
|
8893
9033
|
let apiWaitStart = 0;
|
|
@@ -9094,6 +9234,9 @@ async function* parseClaudeStream(proc, streamLog, adminModel, conversationId, a
|
|
|
9094
9234
|
} else if (block.type === "thinking" && block.thinking) {
|
|
9095
9235
|
yield { type: "thinking", content: block.thinking };
|
|
9096
9236
|
} else if (block.type === "tool_use" && block.name) {
|
|
9237
|
+
toolUseTotal++;
|
|
9238
|
+
if (block.name === "ToolSearch") toolSearchCount++;
|
|
9239
|
+
if (block.name === "Agent") delegatedCount++;
|
|
9097
9240
|
if (block.name === "mcp__admin__render-component") {
|
|
9098
9241
|
if (block.id) toolIdToName.set(block.id, "__component__");
|
|
9099
9242
|
const rawInput = block.input;
|
|
@@ -9387,6 +9530,8 @@ async function* parseClaudeStream(proc, streamLog, adminModel, conversationId, a
|
|
|
9387
9530
|
streamLog.write(`[${isoTs()}] [result] subtype=${resultSubtype} stop_reason=${resultStopReason ?? "unknown"}
|
|
9388
9531
|
`);
|
|
9389
9532
|
}
|
|
9533
|
+
streamLog.write(`[${isoTs()}] [admin-agent] turn-end${convIdTag} tools=${toolUseTotal} toolsearch=${toolSearchCount} delegated=${delegatedCount}
|
|
9534
|
+
`);
|
|
9390
9535
|
yield { type: "done", subtype: resultSubtype, stop_reason: resultStopReason };
|
|
9391
9536
|
continue;
|
|
9392
9537
|
}
|
|
@@ -9950,11 +10095,12 @@ async function* invokeAdminAgent(message, systemPrompt, accountDir, accountId, a
|
|
|
9950
10095
|
} else if (sessionKey) {
|
|
9951
10096
|
bufferPendingTurn(sessionKey, { role: "user", content: fullMessage, timestamp: userTimestamp });
|
|
9952
10097
|
if (responseText) bufferPendingTurn(sessionKey, { role: "assistant", content: responseText, timestamp: assistantTimestamp, tokens: capturedTokens });
|
|
9953
|
-
const
|
|
9954
|
-
if (
|
|
9955
|
-
|
|
10098
|
+
const flushResult = await maybeFlushConversationBuffer(sessionKey, "admin", accountId);
|
|
10099
|
+
if (flushResult) {
|
|
10100
|
+
const substantive = findFirstSubstantiveUserMessage(flushResult.buffered);
|
|
10101
|
+
if (substantive) autoLabelSession(flushResult.conversationId, substantive).catch(() => {
|
|
9956
10102
|
});
|
|
9957
|
-
yield { type: "conversation_attributed", conversationId:
|
|
10103
|
+
yield { type: "conversation_attributed", conversationId: flushResult.conversationId };
|
|
9958
10104
|
}
|
|
9959
10105
|
}
|
|
9960
10106
|
if (sessionKey) {
|
|
@@ -10292,11 +10438,12 @@ async function* invokeManagedAdminAgent(message, systemPrompt, accountDir, accou
|
|
|
10292
10438
|
} else {
|
|
10293
10439
|
bufferPendingTurn(sessionKey, { role: "user", content: fullMessage, timestamp: userTimestamp });
|
|
10294
10440
|
if (responseText) bufferPendingTurn(sessionKey, { role: "assistant", content: responseText, timestamp: assistantTimestamp, tokens: capturedTokens });
|
|
10295
|
-
const
|
|
10296
|
-
if (
|
|
10297
|
-
|
|
10441
|
+
const flushResult = await maybeFlushConversationBuffer(sessionKey, "admin", accountId);
|
|
10442
|
+
if (flushResult) {
|
|
10443
|
+
const substantive = findFirstSubstantiveUserMessage(flushResult.buffered);
|
|
10444
|
+
if (substantive) autoLabelSession(flushResult.conversationId, substantive).catch(() => {
|
|
10298
10445
|
});
|
|
10299
|
-
yield { type: "conversation_attributed", conversationId:
|
|
10446
|
+
yield { type: "conversation_attributed", conversationId: flushResult.conversationId };
|
|
10300
10447
|
}
|
|
10301
10448
|
}
|
|
10302
10449
|
const commitSession = sessionStore.get(sessionKey);
|
|
@@ -10626,11 +10773,12 @@ User messages are prefixed with the sender's name in brackets. Address participa
|
|
|
10626
10773
|
} else if (sessionKey) {
|
|
10627
10774
|
bufferPendingTurn(sessionKey, { role: "user", content: message, timestamp: userTimestamp, sender });
|
|
10628
10775
|
if (fullText) bufferPendingTurn(sessionKey, { role: "assistant", content: fullText, timestamp: assistantTimestamp });
|
|
10629
|
-
const
|
|
10630
|
-
if (
|
|
10631
|
-
|
|
10776
|
+
const flushResult = await maybeFlushConversationBuffer(sessionKey, "public", accountId);
|
|
10777
|
+
if (flushResult) {
|
|
10778
|
+
const substantive = findFirstSubstantiveUserMessage(flushResult.buffered);
|
|
10779
|
+
if (substantive) autoLabelSession(flushResult.conversationId, substantive).catch(() => {
|
|
10632
10780
|
});
|
|
10633
|
-
yield { type: "conversation_attributed", conversationId:
|
|
10781
|
+
yield { type: "conversation_attributed", conversationId: flushResult.conversationId };
|
|
10634
10782
|
}
|
|
10635
10783
|
}
|
|
10636
10784
|
streamLog.end();
|
|
@@ -10785,8 +10933,8 @@ ${sessionContext}`;
|
|
|
10785
10933
|
}
|
|
10786
10934
|
if (onboardingStep === null) {
|
|
10787
10935
|
console.log(`[onboarding-inject] accountId=${accountId.slice(0, 8)}\u2026 error=neo4j-unreachable injected=false`);
|
|
10788
|
-
} else if (onboardingStep <
|
|
10789
|
-
const GENERIC_FALLBACK = "At every session start, call `onboarding-get`. If `currentStep` is less than
|
|
10936
|
+
} else if (onboardingStep < 9) {
|
|
10937
|
+
const GENERIC_FALLBACK = "At every session start, call `onboarding-get`. If `currentStep` is less than 9, load the onboarding skill via `plugin-read` (find its path in the manifest under `admin`) and follow it \u2014 before any business setup. If `onboarding-get` fails (Neo4j unreachable), tell the user and skip onboarding for this session \u2014 it resumes automatically when the graph is available.";
|
|
10790
10938
|
const skillPath = resolve7(PLATFORM_ROOT4, "plugins/admin/skills/onboarding/SKILL.md");
|
|
10791
10939
|
let skillContent = "";
|
|
10792
10940
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./jsx-runtime-
|
|
1
|
+
import{t as e}from"./jsx-runtime-BK2hplUC.js";var t=e();function n({checked:e,onChange:n,label:r,disabled:i}){return(0,t.jsxs)(`label`,{className:`maxy-checkbox${i?` maxy-checkbox--disabled`:``}`,children:[(0,t.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>n(e.target.checked),disabled:i}),(0,t.jsx)(`span`,{className:`maxy-checkbox__box`,children:`✱`}),r&&(0,t.jsx)(`span`,{className:`maxy-checkbox__label`,children:r})]})}export{n as t};
|