@personaai/runtime 0.12.0 → 0.14.0
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/index.cjs +6 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/package.json +72 -72
package/dist/index.cjs
CHANGED
|
@@ -1007,12 +1007,12 @@ var bulkDeleteFiles = async (request, ctx) => {
|
|
|
1007
1007
|
|
|
1008
1008
|
// src/routes/memory.ts
|
|
1009
1009
|
function requireScope(query) {
|
|
1010
|
-
const scope = query.scope === "agent" ? "agent" : query.scope === "user" ? "user" : void 0;
|
|
1011
|
-
if (scope === "agent" && !query.agentId) {
|
|
1010
|
+
const scope = query.scope === "agent" ? "agent" : query.scope === "workspace" ? "workspace" : query.scope === "user" ? "user" : void 0;
|
|
1011
|
+
if ((scope === "agent" || scope === "workspace") && !query.agentId) {
|
|
1012
1012
|
throw new RuntimeHttpError(
|
|
1013
1013
|
400,
|
|
1014
1014
|
"INVALID_REQUEST",
|
|
1015
|
-
|
|
1015
|
+
`"agentId" is required when scope is "${scope}".`
|
|
1016
1016
|
);
|
|
1017
1017
|
}
|
|
1018
1018
|
return { scope, agentId: query.agentId };
|
|
@@ -1031,13 +1031,13 @@ var writeMemoryFile = async (request, ctx) => {
|
|
|
1031
1031
|
const body = requireBodyObject(request.body);
|
|
1032
1032
|
const path = requireStringField(body, "path");
|
|
1033
1033
|
const content = requireStringField(body, "content");
|
|
1034
|
-
const scope = body.scope === "agent" ? "agent" : body.scope === "user" ? "user" : void 0;
|
|
1034
|
+
const scope = body.scope === "agent" ? "agent" : body.scope === "workspace" ? "workspace" : body.scope === "user" ? "user" : void 0;
|
|
1035
1035
|
const agentId = typeof body.agentId === "string" ? body.agentId : void 0;
|
|
1036
|
-
if (scope === "agent" && !agentId) {
|
|
1036
|
+
if ((scope === "agent" || scope === "workspace") && !agentId) {
|
|
1037
1037
|
throw new RuntimeHttpError(
|
|
1038
1038
|
400,
|
|
1039
1039
|
"INVALID_REQUEST",
|
|
1040
|
-
|
|
1040
|
+
`"agentId" is required when scope is "${scope}".`
|
|
1041
1041
|
);
|
|
1042
1042
|
}
|
|
1043
1043
|
const file = await ctx.client.memory.writeFile({ path, content, scope, agentId });
|