@cubos/agent-sdk 0.0.1141710 → 0.0.1142284
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/admin/agents.d.ts +13 -4
- package/dist/admin/conversations.d.ts +10 -10
- package/dist/client.d.ts +4 -4
- package/dist/generated/schema.d.ts +546 -77
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -15
- package/dist/index.js.map +4 -4
- package/dist/types.d.ts +4 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,4 +13,4 @@ export { mergeToolActivities, mergeVoiceMessages } from "./mapping.js";
|
|
|
13
13
|
export type { Schemas } from "./schemas.js";
|
|
14
14
|
export type { FetchLike, SseOptions } from "./sse.js";
|
|
15
15
|
export { DEFAULT_IDLE_TIMEOUT_MS, readSse, SseIdleTimeout } from "./sse.js";
|
|
16
|
-
export type { Activity, Attachment, AttachmentKind, Block, ClientToolCall, Conversation, ConversationEvent, CreateConversationOptions, EnabledComponents, EventPage, Identity, ListConversationsOptions, Message, MessagePage, MessageRole, Page, PlanSnapshot, Todo, TodoStatus, ToolActivity,
|
|
16
|
+
export type { Activity, Attachment, AttachmentKind, Block, ClientToolCall, Conversation, ConversationEvent, CreateConversationOptions, EnabledComponents, EventPage, FilesystemDir, FilesystemEntry, Identity, ListConversationsOptions, Message, MessagePage, MessageRole, Page, PlanSnapshot, Todo, TodoStatus, ToolActivity, } from "./types.js";
|
package/dist/index.js
CHANGED
|
@@ -816,31 +816,31 @@ function conversationsAdminApi(t, tenantSlug) {
|
|
|
816
816
|
listSkills: (id, signal) => t.request("GET", `${conv(id)}/skills`, { signal }),
|
|
817
817
|
addSkill: (id, skillSlug) => t.request("PUT", `${conv(id)}/skills/${enc(skillSlug)}`, { raw: true }),
|
|
818
818
|
removeSkill: (id, skillSlug) => t.request("DELETE", `${conv(id)}/skills/${enc(skillSlug)}`, { raw: true }),
|
|
819
|
-
|
|
819
|
+
filesystemDir: (id, atSeq, path, signal) => t.request("GET", `${conv(id)}/filesystem/dir`, {
|
|
820
820
|
query: { at_seq: atSeq, path },
|
|
821
821
|
signal
|
|
822
822
|
}),
|
|
823
|
-
|
|
824
|
-
|
|
823
|
+
filesystemFile: (id, query) => t.fetchRaw("GET", `${conv(id)}/filesystem/file`, { query }),
|
|
824
|
+
filesystemWrite: (id, path, file, filename) => {
|
|
825
825
|
const form = new FormData;
|
|
826
826
|
form.append("file", file, filename ?? path.split("/").pop() ?? "upload");
|
|
827
|
-
return t.request("PUT", `${conv(id)}/
|
|
827
|
+
return t.request("PUT", `${conv(id)}/filesystem/file`, {
|
|
828
828
|
query: { path },
|
|
829
829
|
body: form
|
|
830
830
|
});
|
|
831
831
|
},
|
|
832
|
-
|
|
832
|
+
filesystemWriteMany: (id, files) => {
|
|
833
833
|
const form = new FormData;
|
|
834
834
|
for (const [i, entry] of files.entries()) {
|
|
835
835
|
form.append("file", entry.file, entry.filename ?? `file-${i + 1}`);
|
|
836
836
|
form.append("path", entry.path);
|
|
837
837
|
}
|
|
838
|
-
return t.request("POST", `${conv(id)}/
|
|
838
|
+
return t.request("POST", `${conv(id)}/filesystem/files`, { body: form });
|
|
839
839
|
},
|
|
840
|
-
|
|
840
|
+
filesystemDelete: (id, path) => t.request("DELETE", `${conv(id)}/filesystem/file`, {
|
|
841
841
|
query: { path }
|
|
842
842
|
}),
|
|
843
|
-
|
|
843
|
+
filesystemMove: (id, from, to) => t.request("POST", `${conv(id)}/filesystem/move`, {
|
|
844
844
|
body: { from, to }
|
|
845
845
|
}),
|
|
846
846
|
eventAttachment: (id, eventId, attachmentId) => t.fetchRaw("GET", `${conv(id)}/events/${eventId}/attachment`, {
|
|
@@ -1696,7 +1696,7 @@ class AgentClient {
|
|
|
1696
1696
|
return await res.blob();
|
|
1697
1697
|
}
|
|
1698
1698
|
async listFiles(id, opts = {}) {
|
|
1699
|
-
const raw = await this.#transport.request("GET", `${await this.#base()}/${id}/
|
|
1699
|
+
const raw = await this.#transport.request("GET", `${await this.#base()}/${id}/filesystem/dir`, {
|
|
1700
1700
|
query: { path: opts.path, at_seq: opts.atSeq },
|
|
1701
1701
|
signal: opts.signal
|
|
1702
1702
|
});
|
|
@@ -1716,14 +1716,14 @@ class AgentClient {
|
|
|
1716
1716
|
};
|
|
1717
1717
|
}
|
|
1718
1718
|
async readFile(id, path, opts = {}) {
|
|
1719
|
-
const res = await this.#transport.fetchRaw("GET", `${await this.#base()}/${id}/
|
|
1719
|
+
const res = await this.#transport.fetchRaw("GET", `${await this.#base()}/${id}/filesystem/file`, { query: { path, at_seq: opts.atSeq }, signal: opts.signal });
|
|
1720
1720
|
await raiseForStatus(res, "Could not read the file.");
|
|
1721
1721
|
return await res.blob();
|
|
1722
1722
|
}
|
|
1723
1723
|
async writeFile(id, path, file, opts = {}) {
|
|
1724
1724
|
const form = new FormData;
|
|
1725
1725
|
form.append("file", file, opts.filename ?? path.split("/").pop() ?? "upload");
|
|
1726
|
-
await this.#transport.request("PUT", `${await this.#base()}/${id}/
|
|
1726
|
+
await this.#transport.request("PUT", `${await this.#base()}/${id}/filesystem/file`, {
|
|
1727
1727
|
query: { path },
|
|
1728
1728
|
body: form,
|
|
1729
1729
|
signal: opts.signal
|
|
@@ -1738,19 +1738,19 @@ class AgentClient {
|
|
|
1738
1738
|
form.append("file", entry.file, entry.filename ?? `file-${i + 1}`);
|
|
1739
1739
|
form.append("path", entry.path);
|
|
1740
1740
|
}
|
|
1741
|
-
await this.#transport.request("POST", `${await this.#base()}/${id}/
|
|
1741
|
+
await this.#transport.request("POST", `${await this.#base()}/${id}/filesystem/files`, {
|
|
1742
1742
|
body: form,
|
|
1743
1743
|
signal: opts.signal
|
|
1744
1744
|
});
|
|
1745
1745
|
}
|
|
1746
1746
|
async deleteFile(id, path, signal) {
|
|
1747
|
-
await this.#transport.request("DELETE", `${await this.#base()}/${id}/
|
|
1747
|
+
await this.#transport.request("DELETE", `${await this.#base()}/${id}/filesystem/file`, {
|
|
1748
1748
|
query: { path },
|
|
1749
1749
|
signal
|
|
1750
1750
|
});
|
|
1751
1751
|
}
|
|
1752
1752
|
async moveFile(id, from, to, signal) {
|
|
1753
|
-
await this.#transport.request("POST", `${await this.#base()}/${id}/
|
|
1753
|
+
await this.#transport.request("POST", `${await this.#base()}/${id}/filesystem/move`, {
|
|
1754
1754
|
body: { from, to },
|
|
1755
1755
|
signal
|
|
1756
1756
|
});
|
|
@@ -1878,5 +1878,5 @@ export {
|
|
|
1878
1878
|
AgentApiError
|
|
1879
1879
|
};
|
|
1880
1880
|
|
|
1881
|
-
//# debugId=
|
|
1881
|
+
//# debugId=641C44370747442A64756E2164756E21
|
|
1882
1882
|
//# sourceMappingURL=index.js.map
|