@dbx-tools/appkit-mastra 0.6.3 → 0.6.4
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/README.md +10 -1
- package/index.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/src/config.d.ts +21 -3
- package/lib/src/config.js +26 -4
- package/lib/src/genie.js +113 -102
- package/lib/src/plugin.d.ts +8 -0
- package/lib/src/plugin.js +14 -6
- package/lib/src/server.js +6 -6
- package/package.json +9 -9
- package/src/config.ts +28 -3
- package/src/genie.ts +120 -114
- package/src/plugin.ts +18 -4
- package/src/server.ts +5 -6
package/src/server.ts
CHANGED
|
@@ -20,7 +20,7 @@ import { trace } from "@opentelemetry/api";
|
|
|
20
20
|
import type express from "express";
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
|
-
|
|
23
|
+
attributedUserId,
|
|
24
24
|
MASTRA_REQUEST_ID_KEY,
|
|
25
25
|
MASTRA_SCOPES_KEY,
|
|
26
26
|
MASTRA_USER_EMAIL_KEY,
|
|
@@ -91,11 +91,10 @@ export async function stampRequestContextUser(
|
|
|
91
91
|
// attributed to can differ: in `service-principal` mode every request shares
|
|
92
92
|
// the SP client, but the forwarded user id must still key the memory thread
|
|
93
93
|
// and the per-user cache namespace so two callers don't share a conversation.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const user: User = { id, executionContext };
|
|
94
|
+
const user: User = {
|
|
95
|
+
id: attributedUserId(executionContext, attributed.userId),
|
|
96
|
+
executionContext,
|
|
97
|
+
};
|
|
99
98
|
requestContext.set(MASTRA_USER_KEY, user);
|
|
100
99
|
requestContext.set(MASTRA_RESOURCE_ID_KEY, user.id);
|
|
101
100
|
// AppKit's `UserContext` surfaces display name / email only on
|