@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.js CHANGED
@@ -829,6 +829,27 @@ var resetThread = async (_request, ctx) => {
829
829
  const thread = await ctx.client.threads.reset(requireParam(ctx.params, "id"));
830
830
  return json(200, thread);
831
831
  };
832
+ var listThreadFiles = async (_request, ctx) => {
833
+ const files = await ctx.client.threads.listFiles(requireParam(ctx.params, "id"));
834
+ return json(200, files);
835
+ };
836
+ var getThreadFile = async (request, ctx) => {
837
+ const path = requireQueryParam(request.query, "path");
838
+ const file = await ctx.client.threads.getFile(requireParam(ctx.params, "id"), path);
839
+ return json(200, file);
840
+ };
841
+ var writeThreadFile = async (request, ctx) => {
842
+ const body = requireBodyObject(request.body);
843
+ const path = requireStringField(body, "path");
844
+ const content = requireStringField(body, "content");
845
+ const file = await ctx.client.threads.writeFile(requireParam(ctx.params, "id"), path, content);
846
+ return json(200, file);
847
+ };
848
+ var deleteThreadFile = async (request, ctx) => {
849
+ const path = requireQueryParam(request.query, "path");
850
+ await ctx.client.threads.deleteFile(requireParam(ctx.params, "id"), path);
851
+ return noContent();
852
+ };
832
853
 
833
854
  // src/routes/voice.ts
834
855
  var createVoiceSession = async (request, ctx) => {
@@ -1597,6 +1618,10 @@ function buildRoutes(capabilities) {
1597
1618
  { method: "DELETE", pattern: ["threads", ":id"], handler: deleteThread },
1598
1619
  { method: "GET", pattern: ["threads", ":id", "messages"], handler: getThreadMessages },
1599
1620
  { method: "POST", pattern: ["threads", ":id", "reset"], handler: resetThread },
1621
+ { method: "GET", pattern: ["threads", ":id", "files"], handler: listThreadFiles },
1622
+ { method: "GET", pattern: ["threads", ":id", "file"], handler: getThreadFile },
1623
+ { method: "PUT", pattern: ["threads", ":id", "file"], handler: writeThreadFile },
1624
+ { method: "DELETE", pattern: ["threads", ":id", "file"], handler: deleteThreadFile },
1600
1625
  // Voice — always on, end-user-scoped real-time voice sessions
1601
1626
  // (powered by Gemini Live). Mints a ticket only; the host's own
1602
1627
  // frontend opens the WebSocket directly, this runtime never proxies it.