@personaai/runtime 0.12.0 → 0.13.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 +25 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -1
- package/package.json +72 -72
package/dist/index.cjs
CHANGED
|
@@ -857,6 +857,27 @@ var resetThread = async (_request, ctx) => {
|
|
|
857
857
|
const thread = await ctx.client.threads.reset(requireParam(ctx.params, "id"));
|
|
858
858
|
return json(200, thread);
|
|
859
859
|
};
|
|
860
|
+
var listThreadFiles = async (_request, ctx) => {
|
|
861
|
+
const files = await ctx.client.threads.listFiles(requireParam(ctx.params, "id"));
|
|
862
|
+
return json(200, files);
|
|
863
|
+
};
|
|
864
|
+
var getThreadFile = async (request, ctx) => {
|
|
865
|
+
const path = requireQueryParam(request.query, "path");
|
|
866
|
+
const file = await ctx.client.threads.getFile(requireParam(ctx.params, "id"), path);
|
|
867
|
+
return json(200, file);
|
|
868
|
+
};
|
|
869
|
+
var writeThreadFile = async (request, ctx) => {
|
|
870
|
+
const body = requireBodyObject(request.body);
|
|
871
|
+
const path = requireStringField(body, "path");
|
|
872
|
+
const content = requireStringField(body, "content");
|
|
873
|
+
const file = await ctx.client.threads.writeFile(requireParam(ctx.params, "id"), path, content);
|
|
874
|
+
return json(200, file);
|
|
875
|
+
};
|
|
876
|
+
var deleteThreadFile = async (request, ctx) => {
|
|
877
|
+
const path = requireQueryParam(request.query, "path");
|
|
878
|
+
await ctx.client.threads.deleteFile(requireParam(ctx.params, "id"), path);
|
|
879
|
+
return noContent();
|
|
880
|
+
};
|
|
860
881
|
|
|
861
882
|
// src/routes/voice.ts
|
|
862
883
|
var createVoiceSession = async (request, ctx) => {
|
|
@@ -1625,6 +1646,10 @@ function buildRoutes(capabilities) {
|
|
|
1625
1646
|
{ method: "DELETE", pattern: ["threads", ":id"], handler: deleteThread },
|
|
1626
1647
|
{ method: "GET", pattern: ["threads", ":id", "messages"], handler: getThreadMessages },
|
|
1627
1648
|
{ method: "POST", pattern: ["threads", ":id", "reset"], handler: resetThread },
|
|
1649
|
+
{ method: "GET", pattern: ["threads", ":id", "files"], handler: listThreadFiles },
|
|
1650
|
+
{ method: "GET", pattern: ["threads", ":id", "file"], handler: getThreadFile },
|
|
1651
|
+
{ method: "PUT", pattern: ["threads", ":id", "file"], handler: writeThreadFile },
|
|
1652
|
+
{ method: "DELETE", pattern: ["threads", ":id", "file"], handler: deleteThreadFile },
|
|
1628
1653
|
// Voice — always on, end-user-scoped real-time voice sessions
|
|
1629
1654
|
// (powered by Gemini Live). Mints a ticket only; the host's own
|
|
1630
1655
|
// frontend opens the WebSocket directly, this runtime never proxies it.
|