Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
feat (chat): chat with folder frontend (#586)
Eric Hayes60249d68b789
diff --git a/js/app/packages/core/component/AI/component/input/Attachment.tsx b/js/app/packages/core/component/AI/component/input/Attachment.tsxindex 36f00e7e6c..df1a55050e 100644--- a/js/app/packages/core/component/AI/component/input/Attachment.tsx+++ b/js/app/packages/core/component/AI/component/input/Attachment.tsx@@ -104,7 +104,6 @@ function ChatAttachment(props: {onRemove: () => void;}) {const { replaceOrInsertSplit } = useSplitLayout();-const name = createMemo(() => {const attachment = props.attachment;if (!attachment.metadata) return '';@@ -114,7 +113,9 @@ function ChatAttachment(props: {? attachment.metadata.image_name: attachment.metadata.type === 'channel'? attachment.metadata.channel_name- : attachment.metadata.email_subject;+ : attachment.metadata.type === 'project'+ ? attachment.metadata.project_name+ : attachment.metadata.email_subject;});const block = createMemo(() => {@@ -191,6 +192,12 @@ function ChatAttachment(props: {<div> {name()}</div></div></Match>+ <Match when={props.attachment.attachmentType === 'project'}>+ <div class="flex gap-1 items-center">+ <EntityIcon targetType="project" />+ <div> {name()}</div>+ </div>+ </Match></Switch><divclass="hover:bg-hover hover-transition-bg rounded-md p-1 items-center flex"diff --git a/js/app/packages/core/component/AI/component/message/UserMessage.tsx b/js/app/packages/core/component/AI/component/message/UserMessage.tsxindex ae955b1729..9c31481d12 100644--- a/js/app/packages/core/component/AI/component/message/UserMessage.tsx+++ b/js/app/packages/core/component/AI/component/message/UserMessage.tsx@@ -70,8 +70,9 @@ export function UserMessage(props: {const itemPreviewAttachments = () =>props.message.attachments.filter((a) =>+ // jail!isImageAttachment(a) &&- ['channel', 'document', 'email'].includes(a.attachmentType)+ ['channel', 'document', 'email', 'project'].includes(a.attachmentType));return (@@ -101,7 +102,12 @@ export function UserMessage(props: {<ItemPreviewitemId={attachment.attachmentId}// TODO: improve typing for item preview attachments- itemType={attachment.attachmentType as 'channel' | 'document'}+ itemType={+ attachment.attachmentType as+ | 'channel'+ | 'document'+ | 'project'+ }/>)}</For>diff --git a/js/app/packages/core/component/AI/constant/fileType.ts b/js/app/packages/core/component/AI/constant/fileType.tsindex fceb01a084..557b810593 100644--- a/js/app/packages/core/component/AI/constant/fileType.ts+++ b/js/app/packages/core/component/AI/constant/fileType.ts@@ -330,4 +330,5 @@ export const SUPPORTED_CHAT_ATTACHMENT_BLOCKS: (BlockName | BlockAlias)[] = ['canvas','email','task',+ 'project',];diff --git a/js/app/packages/core/component/AI/signal/attachment.ts b/js/app/packages/core/component/AI/signal/attachment.tsindex 9d26390254..3220b16c8c 100644--- a/js/app/packages/core/component/AI/signal/attachment.ts+++ b/js/app/packages/core/component/AI/signal/attachment.ts@@ -85,6 +85,20 @@ export const useGetChatAttachmentInfo = () => {};};+ const getProjectAttachment = (id: string): Attachment | undefined => {+ const item = history().find((item) => item.id === id);+ if (!item || item.type !== 'project') return;+ return {+ attachmentType: 'project',+ attachmentId: item.id,+ id: item.id,+ metadata: {+ type: 'project',+ project_name: item.name,+ },+ };+ };+const getChannelAttachment = ({itemId: id,}: ItemMention): Attachment | undefined => {@@ -126,6 +140,8 @@ export const useGetChatAttachmentInfo = () => {return getChannelAttachment(mention);} else if (mention.itemType === 'email') {return getEmailAttachment(mention);+ } else if (mention.itemType === 'project') {+ return getProjectAttachment(mention.itemId);}};diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadata.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadata.tsindex 1716cc3b13..bfb6f7d4a7 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadata.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadata.ts@@ -8,5 +8,6 @@ import type { AttachmentMetadataOneOf } from './attachmentMetadataOneOf';import type { AttachmentMetadataOneOfThree } from './attachmentMetadataOneOfThree';import type { AttachmentMetadataOneOfFive } from './attachmentMetadataOneOfFive';import type { AttachmentMetadataOneOfSeven } from './attachmentMetadataOneOfSeven';+import type { AttachmentMetadataOneOfNine } from './attachmentMetadataOneOfNine';-export type AttachmentMetadata = AttachmentMetadataOneOf | AttachmentMetadataOneOfThree | AttachmentMetadataOneOfFive | AttachmentMetadataOneOfSeven;+export type AttachmentMetadata = AttachmentMetadataOneOf | AttachmentMetadataOneOfThree | AttachmentMetadataOneOfFive | AttachmentMetadataOneOfSeven | AttachmentMetadataOneOfNine;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFive.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFive.tsindex b78d694118..0dc86a0f22 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFive.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFive.ts@@ -4,11 +4,13 @@* Document Cognition Service* OpenAPI spec version: 1.0.0*/-import type { ChannelType } from './channelType';+import type { FileType } from './fileType';import type { AttachmentMetadataOneOfFiveType } from './attachmentMetadataOneOfFiveType';export type AttachmentMetadataOneOfFive = {- channel_name: string;- channel_type: ChannelType;+ /** jpg | png | etc */+ image_extension: FileType;+ /** image name */+ image_name: string;type: AttachmentMetadataOneOfFiveType;};diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFiveType.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFiveType.tsindex d90e8d8607..2e2495fb24 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFiveType.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfFiveType.ts@@ -10,5 +10,5 @@ export type AttachmentMetadataOneOfFiveType = typeof AttachmentMetadataOneOfFive// eslint-disable-next-line @typescript-eslint/no-redeclareexport const AttachmentMetadataOneOfFiveType = {- channel: 'channel',+ image: 'image',} as const;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfNine.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfNine.tsnew file mode 100644index 0000000000..8ebdb606a3--- /dev/null+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfNine.ts@@ -0,0 +1,15 @@+/**+ * Generated by orval v7.13.0 🍺+ * Do not edit manually.+ * Document Cognition Service+ * OpenAPI spec version: 1.0.0+ */+import type { AttachmentMetadataOneOfNineType } from './attachmentMetadataOneOfNineType';++/**+ * an email thread+ */+export type AttachmentMetadataOneOfNine = {+ email_subject: string;+ type: AttachmentMetadataOneOfNineType;+};diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfNineType.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfNineType.tsnew file mode 100644index 0000000000..005fbe51d6--- /dev/null+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfNineType.ts@@ -0,0 +1,14 @@+/**+ * Generated by orval v7.13.0 🍺+ * Do not edit manually.+ * Document Cognition Service+ * OpenAPI spec version: 1.0.0+ */++export type AttachmentMetadataOneOfNineType = typeof AttachmentMetadataOneOfNineType[keyof typeof AttachmentMetadataOneOfNineType];+++// eslint-disable-next-line @typescript-eslint/no-redeclare+export const AttachmentMetadataOneOfNineType = {+ email: 'email',+} as const;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSeven.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSeven.tsindex e2ca250b18..2237c9ba93 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSeven.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSeven.ts@@ -4,12 +4,11 @@* Document Cognition Service* OpenAPI spec version: 1.0.0*/+import type { ChannelType } from './channelType';import type { AttachmentMetadataOneOfSevenType } from './attachmentMetadataOneOfSevenType';-/**- * an email thread- */export type AttachmentMetadataOneOfSeven = {- email_subject: string;+ channel_name: string;+ channel_type: ChannelType;type: AttachmentMetadataOneOfSevenType;};diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSevenType.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSevenType.tsindex f9e97fdc54..745143f0a0 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSevenType.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfSevenType.ts@@ -10,5 +10,5 @@ export type AttachmentMetadataOneOfSevenType = typeof AttachmentMetadataOneOfSev// eslint-disable-next-line @typescript-eslint/no-redeclareexport const AttachmentMetadataOneOfSevenType = {- email: 'email',+ channel: 'channel',} as const;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThree.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThree.tsindex 6f909737ef..3fbaab1df0 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThree.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThree.ts@@ -4,13 +4,9 @@* Document Cognition Service* OpenAPI spec version: 1.0.0*/-import type { FileType } from './fileType';import type { AttachmentMetadataOneOfThreeType } from './attachmentMetadataOneOfThreeType';export type AttachmentMetadataOneOfThree = {- /** jpg | png | etc */- image_extension: FileType;- /** image name */- image_name: string;+ project_name: string;type: AttachmentMetadataOneOfThreeType;};diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThreeType.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThreeType.tsindex ac7717584d..58306e3ad9 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThreeType.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentMetadataOneOfThreeType.ts@@ -10,5 +10,5 @@ export type AttachmentMetadataOneOfThreeType = typeof AttachmentMetadataOneOfThr// eslint-disable-next-line @typescript-eslint/no-redeclareexport const AttachmentMetadataOneOfThreeType = {- image: 'image',+ project: 'project',} as const;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentType.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentType.tsindex 438583388e..d0a51390d5 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentType.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/attachmentType.ts@@ -14,4 +14,5 @@ export const AttachmentType = {image: 'image',channel: 'channel',email: 'email',+ project: 'project',} as const;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/chatAttachment.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/chatAttachment.tsindex e1a67e68c1..672ed17118 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/chatAttachment.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/chatAttachment.ts@@ -16,7 +16,7 @@ either a `document_id` or `project_id` or `chat_id` */attachment_type: AttachmentType;/** The id of the chat if the attachment is a chat */chat_id?: ChatAttachmentChatId;- /** Id of the attachment */+ /** db attachment id - unused */id: string;/** The id of the message if the attachment is a message */message_id?: ChatAttachmentMessageId;diff --git a/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts b/js/app/packages/service-clients/service-cognition/generated/schemas/index.tsindex 1703b4c5df..cdb32532a2 100644--- a/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts+++ b/js/app/packages/service-clients/service-cognition/generated/schemas/index.ts@@ -20,6 +20,8 @@ export * from './attachmentMetadata';export * from './attachmentMetadataOneOf';export * from './attachmentMetadataOneOfFive';export * from './attachmentMetadataOneOfFiveType';+export * from './attachmentMetadataOneOfNine';+export * from './attachmentMetadataOneOfNineType';export * from './attachmentMetadataOneOfSeven';export * from './attachmentMetadataOneOfSevenType';export * from './attachmentMetadataOneOfThree';diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.tsindex 3285ce7e03..c3c443c0f9 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/schemas.ts@@ -13,7 +13,7 @@ export const ListDocumentsOutputSchema = z.object({ "results": z.array(z.object(export const ListEmailsInputSchema = z.object({ "cursor": z.union([z.string(), z.null()]).default(null), "limit": z.number().int().default(20), "sortMethod": z.enum(["viewed_at","updated_at","created_at","viewed_updated"]).default("viewed_at"), "view": z.object({ "standardLabel": z.union([z.literal("Inbox"), z.literal("Sent"), z.literal("Drafts"), z.literal("Starred"), z.literal("All"), z.literal("Important"), z.literal("Other"), z.literal(null)]), "userLabel": z.union([z.string(), z.null()]) }).strict().default({"standardLabel":null,"userLabel":null}) }).strict()-export const ListEmailsOutputSchema = z.object({ "items": z.array(z.object({ "attachments": z.array(z.object({ "contentId": z.union([z.string(), z.null()]).optional(), "createdAt": z.number().int(), "filename": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "messageId": z.string().uuid(), "mimeType": z.union([z.string(), z.null()]).optional(), "providerAttachmentId": z.union([z.string(), z.null()]).optional(), "sizeBytes": z.union([z.number().int(), z.null()]).optional() })), "contacts": z.array(z.object({ "emailAddress": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "linkId": z.string().uuid(), "name": z.union([z.string(), z.null()]).optional(), "sfsPhotoUrl": z.union([z.string(), z.null()]).optional() })), "createdAt": z.number().int(), "frecencyScore": z.union([z.number(), z.null()]).optional(), "id": z.string().uuid(), "inboxVisible": z.boolean(), "isDraft": z.boolean(), "isImportant": z.boolean(), "isRead": z.boolean(), "labels": z.array(z.object({ "createdAt": z.string().datetime({ offset: true }), "id": z.string().uuid(), "labelListVisibility": z.enum(["LabelShow","LabelShowIfUnread","LabelHide"]), "linkId": z.string().uuid(), "messageListVisibility": z.enum(["Show","Hide"]), "name": z.string(), "providerLabelId": z.string(), "type": z.enum(["System","User"]) })), "macroAttachments": z.array(z.object({ "dbId": z.string().uuid(), "itemId": z.string().uuid(), "itemType": z.string(), "messageId": z.string().uuid() })), "name": z.union([z.string(), z.null()]).optional(), "ownerId": z.string(), "providerId": z.union([z.string(), z.null()]).optional(), "senderEmail": z.union([z.string(), z.null()]).optional(), "senderName": z.union([z.string(), z.null()]).optional(), "senderPhotoUrl": z.union([z.string(), z.null()]).optional(), "snippet": z.union([z.string(), z.null()]).optional(), "sortTs": z.number().int(), "updatedAt": z.number().int(), "viewedAt": z.union([z.number().int(), z.null()]).optional() })), "next_cursor": z.union([z.string(), z.null()]).optional() })+export const ListEmailsOutputSchema = z.object({ "items": z.array(z.object({ "attachments": z.array(z.object({ "contentId": z.union([z.string(), z.null()]).optional(), "createdAt": z.number().int(), "filename": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "messageId": z.string().uuid(), "mimeType": z.union([z.string(), z.null()]).optional(), "providerAttachmentId": z.union([z.string(), z.null()]).optional(), "sizeBytes": z.union([z.number().int(), z.null()]).optional() })), "contacts": z.array(z.object({ "emailAddress": z.union([z.string(), z.null()]).optional(), "id": z.string().uuid(), "linkId": z.string().uuid(), "name": z.union([z.string(), z.null()]).optional(), "sfsPhotoUrl": z.union([z.string(), z.null()]).optional() })), "createdAt": z.number().int(), "frecencyScore": z.union([z.number(), z.null()]).optional(), "id": z.string().uuid(), "inboxVisible": z.boolean(), "isDraft": z.boolean(), "isImportant": z.boolean(), "isRead": z.boolean(), "labels": z.array(z.object({ "createdAt": z.string().datetime({ offset: true }), "id": z.string().uuid(), "labelListVisibility": z.enum(["LabelShow","LabelShowIfUnread","LabelHide"]), "linkId": z.string().uuid(), "messageListVisibility": z.enum(["Show","Hide"]), "name": z.string(), "providerLabelId": z.string(), "type": z.enum(["System","User"]) })), "macroAttachments": z.array(z.object({ "dbId": z.string().uuid(), "itemId": z.string().uuid(), "itemType": z.string(), "messageId": z.string().uuid() })), "metadata": z.object({ "calendar_invite": z.boolean(), "generic_sender": z.boolean(), "known_sender": z.boolean(), "tabular": z.boolean() }), "name": z.union([z.string(), z.null()]).optional(), "ownerId": z.string(), "providerId": z.union([z.string(), z.null()]).optional(), "senderEmail": z.union([z.string(), z.null()]).optional(), "senderName": z.union([z.string(), z.null()]).optional(), "senderPhotoUrl": z.union([z.string(), z.null()]).optional(), "snippet": z.union([z.string(), z.null()]).optional(), "sortTs": z.number().int(), "updatedAt": z.number().int(), "viewedAt": z.union([z.number().int(), z.null()]).optional() })), "next_cursor": z.union([z.string(), z.null()]).optional() })export const MarkdownRewriteInputSchema = z.object({ "instructions": z.string(), "markdown_file_id": z.string() }).strict()@@ -22,7 +22,7 @@ export const MarkdownRewriteInputSchema = z.object({ "instructions": z.string(),export const MarkdownRewriteOutputSchema = z.object({ "diffs": z.array(z.object({ "markdown_text": z.string(), "node_key": z.string(), "operation": z.string() }).strict()) }).strict()-export const ReadInputSchema = z.object({ "contentType": z.enum(["document","channel","channel-message","chat-thread","chat-message","email-thread","email-message"]), "ids": z.array(z.string()), "messagesSince": z.union([z.string().datetime({ offset: true }), z.null()]) }).strict()+export const ReadInputSchema = z.object({ "contentType": z.enum(["document","channel","channel-message","chat-thread","chat-message","email-thread","email-message","project"]), "ids": z.array(z.string()), "messagesSince": z.union([z.string().datetime({ offset: true }), z.null()]) }).strict()export const ReadOutputSchema = z.object({ "content": z.any().superRefine((x, ctx) => {@@ -44,7 +44,7 @@ export const ReadOutputSchema = z.object({ "content": z.any().superRefine((x, ctmessage: "Invalid input: Should pass single schema",});}- })), "content": z.string(), "date": z.string().datetime({ offset: true }) })), "title": z.string() })), "type": z.literal("chat") }), z.object({ "messages": z.array(z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "content": z.string(), "messageId": z.string(), "recipients": z.array(z.string()), "sender": z.string(), "sentAt": z.union([z.string().datetime({ offset: true }), z.null()]).optional() })), "subject": z.union([z.string(), z.null()]).optional(), "thread_id": z.string(), "type": z.literal("email") })];+ })), "content": z.string(), "date": z.string().datetime({ offset: true }) })), "title": z.string() })), "type": z.literal("chat") }), z.object({ "messages": z.array(z.object({ "bcc": z.array(z.string()), "cc": z.array(z.string()), "content": z.string(), "messageId": z.string(), "recipients": z.array(z.string()), "sender": z.string(), "sentAt": z.union([z.string().datetime({ offset: true }), z.null()]).optional() })), "subject": z.union([z.string(), z.null()]).optional(), "thread_id": z.string(), "type": z.literal("email") }), z.object({ "formatted_preview": z.string(), "type": z.literal("itemPreviews") })];const errors = schemas.reduce<z.ZodError[]>((errors, schema) =>((result) =>diff --git a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts b/js/app/packages/service-clients/service-cognition/generated/tools/types.tsindex cbbc9f31b3..8a894c406c 100644--- a/js/app/packages/service-clients/service-cognition/generated/tools/types.ts+++ b/js/app/packages/service-clients/service-cognition/generated/tools/types.ts@@ -185,6 +185,24 @@ export interface ListEmailsOutput {itemType: string;messageId: string;}[];+ metadata: {+ /**+ * if any email contains a calendar invite+ */+ calendar_invite: boolean;+ /**+ * if any sender in the thread is a generic email+ */+ generic_sender: boolean;+ /**+ * if user has previously emailed any sender in the thread+ */+ known_sender: boolean;+ /**+ * if any email contains a <table> html tag+ */+ tabular: boolean;+ };name?: string | null;ownerId: string;providerId?: string | null;@@ -261,7 +279,8 @@ export interface ReadInput {| 'chat-thread'| 'chat-message'| 'email-thread'- | 'email-message';+ | 'email-message'+ | 'project';/*** ID(s) of the content to read. IMPORTANT: document, channel-message, chat-message, and email-message content types support MULTIPLE ids! For all other content types (channel, chat-thread, email-thread) provide a single id.*/@@ -342,6 +361,10 @@ export interface ReadOutput {subject?: string | null;thread_id: string;type: 'email';+ }+ | {+ formatted_preview: string;+ type: 'itemPreviews';};}diff --git a/js/app/packages/service-clients/service-cognition/openapi.json b/js/app/packages/service-clients/service-cognition/openapi.jsonindex bd3c107dfc..ef34d83722 100644--- a/js/app/packages/service-clients/service-cognition/openapi.json+++ b/js/app/packages/service-clients/service-cognition/openapi.json@@ -1034,6 +1034,14 @@"type": { "type": "string", "enum": ["document"] }}},+ {+ "type": "object",+ "required": ["project_name", "type"],+ "properties": {+ "project_name": { "type": "string" },+ "type": { "type": "string", "enum": ["project"] }+ }+ },{"type": "object","required": ["image_extension", "image_name", "type"],@@ -1068,7 +1076,7 @@},"AttachmentType": {"type": "string",- "enum": ["document", "image", "channel", "email"]+ "enum": ["document", "image", "channel", "email", "project"]},"ChannelSharePermission": {"type": "object",@@ -1147,7 +1155,10 @@"type": ["string", "null"],"description": "The id of the chat if the attachment is a chat"},- "id": { "type": "string", "description": "Id of the attachment" },+ "id": {+ "type": "string",+ "description": "db attachment id - unused"+ },"message_id": {"type": ["string", "null"],"description": "The id of the message if the attachment is a message"diff --git a/rust/cloud-storage/document_cognition_service/schemas/tools.json b/rust/cloud-storage/document_cognition_service/schemas/tools.jsonindex 6e002a8509..1865004efa 100644--- a/rust/cloud-storage/document_cognition_service/schemas/tools.json+++ b/rust/cloud-storage/document_cognition_service/schemas/tools.json@@ -1,596 +1,264 @@{"schemas": [{- "name": "Read",+ "name": "UnifiedSearch","inputSchema": {"additionalProperties": false,- "description": "Read content by ID(s). Supports reading documents, channels, chats, and emails by their respective IDs. Use this tool when you need to retrieve the full content of a specific item(s).\n Channel transcripts only include 300 messages. Use 'messages_since' to see messages in a different time window.",+ "description": "Universal search across all content types (documents, emails, AI conversations, chat/slack threads/channels, projects aka folders). This tool will return broad metadata from successful results and/or content matches. Use the Read tool next to read the results from those matches. Only ever refer to documents by name or with a document mention. Never state the id of the document in plaintext. User's are presented with the results of this tool as a UI element so there is no need to enumerate the information found from this tool.","properties": {- "contentType": {+ "exhaustiveSearch": {"additionalProperties": false,- "description": "The type of content to read. Choose based on the type of content you want to retrieve.",- "enum": [- "document",- "channel",- "channel-message",- "chat-thread",- "chat-message",- "email-thread",- "email-message",- "project"- ],- "type": "string"+ "default": true,+ "description": "Exhaustive search across all results matching the query. Defaults to true. Use false when the user only requires a limitied subset of results to answer the question",+ "type": "boolean"},- "ids": {+ "pageOffset": {"additionalProperties": false,- "description": "ID(s) of the content to read. IMPORTANT: document, channel-message, chat-message, and email-message content types support MULTIPLE ids! For all other content types (channel, chat-thread, email-thread) provide a single id.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"+ "default": 0,+ "description": "Page offset. Default is 0. Use a higher offset to page through results intelligently. Set exhaustive_search to true to get all results.",+ "format": "int64",+ "type": "integer"},- "messagesSince": {+ "pageSize": {"additionalProperties": false,- "description": "A local datetime of the earliest message to include in a channel transcript ex: 2025-11-25 12:00:09 EST, only applicable to channels",- "format": "date-time",- "type": [- "string",- "null"- ]- }- },- "required": [- "contentType",- "ids",- "messagesSince"- ],- "title": "Read",- "type": "object"- },- "outputSchema": {- "properties": {- "content": {- "oneOf": [- {+ "default": 10,+ "description": "Search count per search type (i.e. applies separately to each of documents, emails, ai_conversations, chats, projects). Max is 100. Default is 10. Does not apply when exhaustive_search is set to true.",+ "format": "int64",+ "type": "integer"+ },+ "request": {+ "additionalProperties": false,+ "description": "Aggregated search request, see individual fields for details",+ "properties": {+ "filters": {+ "additionalProperties": false,+ "description": "Search filters for various kinds of items. Set the entire filters property as `null` if you do not have specific filters for a given type, e.g. bcc for email filters.","properties": {- "documents": {- "items": {- "properties": {- "content": {+ "channel": {+ "additionalProperties": false,+ "description": "Channel filters. `null` to not filter channels searched over.",+ "properties": {+ "channel_ids": {+ "additionalProperties": false,+ "description": "Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels.",+ "items": {+ "additionalProperties": false,"type": "string"},- "documentId": {+ "type": "array"+ },+ "mentions": {+ "additionalProperties": false,+ "description": "Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions.",+ "items": {+ "additionalProperties": false,"type": "string"},- "metadata": {- "properties": {- "deleted": {- "type": "boolean"- },- "documentName": {- "type": "string"- },- "fileType": {- "type": [- "string",- "null"- ]- },- "owner": {- "type": "string"- },- "projectId": {- "type": [- "string",- "null"- ]- }- },- "required": [- "documentName",- "owner",- "deleted"- ],- "type": "object"- }+ "type": "array"},- "required": [- "documentId",- "content",- "metadata"- ],- "type": "object"+ "org_id": {+ "additionalProperties": false,+ "description": "Channel organization ID to search within. Empty to ignore organization filtering.",+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ },+ "sender_ids": {+ "additionalProperties": false,+ "description": "Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": "array"+ },+ "thread_ids": {+ "additionalProperties": false,+ "description": "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": "array"+ }},- "type": "array"- },- "type": {- "const": "documents",- "type": "string"- }- },- "required": [- "type",- "documents"- ],- "type": "object"- },- {- "properties": {- "channel_id": {- "type": "string"- },- "channel_name": {+ "required": [+ "channel_ids",+ "mentions",+ "org_id",+ "sender_ids",+ "thread_ids"+ ],"type": [- "string",+ "object","null"]},- "transcript": {- "type": "string"- },- "type": {- "const": "channel",- "type": "string"- }- },- "required": [- "type",- "channel_id",- "transcript"- ],- "type": "object"- },- {- "properties": {- "conversation": {- "items": {- "properties": {- "chat_id": {+ "chat": {+ "additionalProperties": false,+ "description": "Chat filters. `null` to not filter chats searched over.",+ "properties": {+ "chat_ids": {+ "additionalProperties": false,+ "description": "Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats.",+ "items": {+ "additionalProperties": false,"type": "string"},- "messages": {- "items": {- "properties": {- "attachment_summaries": {- "items": {- "oneOf": [- {- "additionalProperties": false,- "properties": {- "Summary": {- "properties": {- "created_at": {- "format": "date-time",- "type": [- "string",- "null"- ]- },- "document_id": {- "type": "string"- },- "id": {- "type": [- "string",- "null"- ]- },- "summary": {- "type": "string"- },- "version_id": {- "type": "string"- }- },- "required": [- "document_id",- "summary",- "version_id"- ],- "type": "object"- }- },- "required": [- "Summary"- ],- "type": "object"- },- {- "additionalProperties": false,- "properties": {- "NoSummary": {- "properties": {- "document_id": {- "type": "string"- }- },- "required": [- "document_id"- ],- "type": "object"- }- },- "required": [- "NoSummary"- ],- "type": "object"- }- ]- },- "type": "array"- },- "content": {- "type": "string"- },- "date": {- "format": "date-time",- "type": "string"- }- },- "required": [- "content",- "date",- "attachment_summaries"- ],- "type": "object"- },- "type": "array"+ "type": "array"+ },+ "owners": {+ "additionalProperties": false,+ "description": "Filter by chat owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",+ "items": {+ "additionalProperties": false,+ "type": "string"},- "title": {+ "type": "array"+ },+ "project_ids": {+ "additionalProperties": false,+ "description": "A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering.",+ "items": {+ "additionalProperties": false,"type": "string"- }+ },+ "type": "array"},- "required": [- "chat_id",- "title",- "messages"- ],- "type": "object"+ "role": {+ "additionalProperties": false,+ "description": "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": "array"+ }},- "type": "array"+ "required": [+ "chat_ids",+ "owners",+ "project_ids",+ "role"+ ],+ "type": [+ "object",+ "null"+ ]},- "type": {- "const": "chat",- "type": "string"- }- },- "required": [- "type",- "conversation"- ],- "type": "object"- },- {- "properties": {- "messages": {- "items": {- "properties": {- "bcc": {- "items": {- "type": "string"- },- "type": "array"+ "document": {+ "additionalProperties": false,+ "description": "Document filters. `null` to not filter documents searched over.",+ "properties": {+ "document_ids": {+ "additionalProperties": false,+ "description": "Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents.",+ "items": {+ "additionalProperties": false,+ "type": "string"},- "cc": {- "items": {- "type": "string"- },- "type": "array"+ "type": "array"+ },+ "file_types": {+ "additionalProperties": false,+ "description": "Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types.",+ "items": {+ "additionalProperties": false,+ "type": "string"},- "content": {+ "type": "array"+ },+ "owners": {+ "additionalProperties": false,+ "description": "Filter by document owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",+ "items": {+ "additionalProperties": false,"type": "string"},- "messageId": {+ "type": "array"+ },+ "project_ids": {+ "additionalProperties": false,+ "description": "A list of project ids to search within. Examples: ['project1'].\nfiltering. Empty to ignore project filtering.",+ "items": {+ "additionalProperties": false,"type": "string"},- "recipients": {- "items": {- "type": "string"- },- "type": "array"+ "type": "array"+ }+ },+ "required": [+ "document_ids",+ "file_types",+ "owners",+ "project_ids"+ ],+ "type": [+ "object",+ "null"+ ]+ },+ "email": {+ "additionalProperties": false,+ "description": "Email filters. `null` to not filter emails searched over.",+ "properties": {+ "bcc": {+ "additionalProperties": false,+ "description": "Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC.",+ "items": {+ "additionalProperties": false,+ "type": "string"},- "sender": {+ "type": "array"+ },+ "cc": {+ "additionalProperties": false,+ "description": "Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC.",+ "items": {+ "additionalProperties": false,"type": "string"},- "sentAt": {- "format": "date-time",- "type": [- "string",- "null"- ]- }+ "type": "array"},- "required": [- "messageId",- "sender",- "recipients",- "cc",- "bcc",- "content"- ],- "type": "object"+ "recipients": {+ "additionalProperties": false,+ "description": "Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": "array"+ },+ "senders": {+ "additionalProperties": false,+ "description": "Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": "array"+ }},- "type": "array"- },- "subject": {+ "required": [+ "bcc",+ "cc",+ "recipients",+ "senders"+ ],"type": [- "string",+ "object","null"]},- "thread_id": {- "type": "string"- },- "type": {- "const": "email",- "type": "string"- }- },- "required": [- "type",- "thread_id",- "messages"- ],- "type": "object"- },- {- "properties": {- "formatted_preview": {- "type": "string"- },- "type": {- "const": "itemPreviews",- "type": "string"- }- },- "required": [- "type",- "formatted_preview"- ],- "type": "object"- }- ]- }- },- "required": [- "content"- ],- "title": "ReadResponse",- "type": "object"- }- },- {- "name": "MarkdownRewrite",- "inputSchema": {- "additionalProperties": false,- "description": "Instruct an agent to edit a markdown file identified by an id.\n This tool should be used when the user include a markdown file in context and requests a revision or edit to that file",- "properties": {- "instructions": {- "additionalProperties": false,- "description": "Instructions for the revision agent to follow to edit the markdown. These instructions will be provided by the user.",- "type": "string"- },- "markdown_file_id": {- "additionalProperties": false,- "description": "The markdown file id to target for editing. This file id will be in your context and labeled as a markdown (md) document",- "type": "string"- }- },- "required": [- "instructions",- "markdown_file_id"- ],- "title": "MarkdownRewrite",- "type": "object"- },- "outputSchema": {- "additionalProperties": false,- "properties": {- "diffs": {- "items": {- "additionalProperties": false,- "properties": {- "markdown_text": {- "type": "string"- },- "node_key": {- "type": "string"- },- "operation": {- "type": "string"- }- },- "required": [- "operation",- "node_key",- "markdown_text"- ],- "type": "object"- },- "type": "array"- }- },- "required": [- "diffs"- ],- "title": "AIDiffResponse",- "type": "object"- }- },- {- "name": "UnifiedSearch",- "inputSchema": {- "additionalProperties": false,- "description": "Universal search across all content types (documents, emails, AI conversations, chat/slack threads/channels, projects aka folders). This tool will return broad metadata from successful results and/or content matches. Use the Read tool next to read the results from those matches. Only ever refer to documents by name or with a document mention. Never state the id of the document in plaintext. User's are presented with the results of this tool as a UI element so there is no need to enumerate the information found from this tool.",- "properties": {- "exhaustiveSearch": {- "additionalProperties": false,- "default": true,- "description": "Exhaustive search across all results matching the query. Defaults to true. Use false when the user only requires a limitied subset of results to answer the question",- "type": "boolean"- },- "pageOffset": {- "additionalProperties": false,- "default": 0,- "description": "Page offset. Default is 0. Use a higher offset to page through results intelligently. Set exhaustive_search to true to get all results.",- "format": "int64",- "type": "integer"- },- "pageSize": {- "additionalProperties": false,- "default": 10,- "description": "Search count per search type (i.e. applies separately to each of documents, emails, ai_conversations, chats, projects). Max is 100. Default is 10. Does not apply when exhaustive_search is set to true.",- "format": "int64",- "type": "integer"- },- "request": {- "additionalProperties": false,- "description": "Aggregated search request, see individual fields for details",- "properties": {- "filters": {- "additionalProperties": false,- "description": "Search filters for various kinds of items. Set the entire filters property as `null` if you do not have specific filters for a given type, e.g. bcc for email filters.",- "properties": {- "channel": {- "additionalProperties": false,- "description": "Channel filters. `null` to not filter channels searched over.",- "properties": {- "channel_ids": {- "additionalProperties": false,- "description": "Channel IDs to search within. Examples: ['general']. Empty to search all accessible channels.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "mentions": {- "additionalProperties": false,- "description": "Channel user mentions to search for. Examples: ['@username']. Empty if not filtering by mentions.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "org_id": {- "additionalProperties": false,- "description": "Channel organization ID to search within. Empty to ignore organization filtering.",- "format": "int64",- "type": [- "integer",- "null"- ]- },- "sender_ids": {- "additionalProperties": false,- "description": "Sender IDs to search within. Examples: ['user1']. Empty to search all accessible senders.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "thread_ids": {- "additionalProperties": false,- "description": "Channel thread IDs to search within. Examples: ['thread123']. Empty to search all threads.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }- },- "required": [- "channel_ids",- "mentions",- "org_id",- "sender_ids",- "thread_ids"- ],- "type": [- "object",- "null"- ]- },- "chat": {- "additionalProperties": false,- "description": "Chat filters. `null` to not filter chats searched over.",- "properties": {- "chat_ids": {- "additionalProperties": false,- "description": "Chat ids to search over. Examples: ['chat1'], ['chat1', 'chat2']. When provided, chat search will only match results on these chats. Empty to search all accessible chats.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "owners": {- "additionalProperties": false,- "description": "Filter by chat owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "project_ids": {- "additionalProperties": false,- "description": "A list of project ids to search within. Examples: ['project1']. Empty to ignore project filtering.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "role": {- "additionalProperties": false,- "description": "Chat message roles to search. Examples: ['user'], ['assistant']. Empty to search all roles.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }- },- "required": [- "chat_ids",- "owners",- "project_ids",- "role"- ],- "type": [- "object",- "null"- ]- },- "document": {+ "project": {"additionalProperties": false,- "description": "Document filters. `null` to not filter documents searched over.",+ "description": "Project filters. `null` to not filter projects searched over.","properties": {- "document_ids": {- "additionalProperties": false,- "description": "Document ids to search over. Examples: ['doc1'], ['doc1', 'doc2']. Empty to search all accessible documents.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "file_types": {- "additionalProperties": false,- "description": "Document file types to search. Examples: ['pdf'], ['md', 'txt']. Empty to search all file types.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },"owners": {"additionalProperties": false,- "description": "Filter by document owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",+ "description": "Filter by project owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.","items": {"additionalProperties": false,"type": "string"@@ -599,93 +267,7 @@},"project_ids": {"additionalProperties": false,- "description": "A list of project ids to search within. Examples: ['project1'].\nfiltering. Empty to ignore project filtering.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }- },- "required": [- "document_ids",- "file_types",- "owners",- "project_ids"- ],- "type": [- "object",- "null"- ]- },- "email": {- "additionalProperties": false,- "description": "Email filters. `null` to not filter emails searched over.",- "properties": {- "bcc": {- "additionalProperties": false,- "description": "Email BCC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by BCC.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "cc": {- "additionalProperties": false,- "description": "Email CC addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by CC.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "recipients": {- "additionalProperties": false,- "description": "Email Recipient addresses to filter by. Examples: ['[email protected]']. Empty if not filtering by Recipient.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "senders": {- "additionalProperties": false,- "description": "Email sender addresses to filter by. Examples: ['[email protected]']. Empty to search all senders.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- }- },- "required": [- "bcc",- "cc",- "recipients",- "senders"- ],- "type": [- "object",- "null"- ]- },- "project": {- "additionalProperties": false,- "description": "Project filters. `null` to not filter projects searched over.",- "properties": {- "owners": {- "additionalProperties": false,- "description": "Filter by project owner. Examples: ['macro|[email protected]'], ['macro|[email protected]', 'macro|[email protected]']. Empty to search all owners.",- "items": {- "additionalProperties": false,- "type": "string"- },- "type": "array"- },- "project_ids": {- "additionalProperties": false,- "description": "Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects.",+ "description": "Project IDs to search within. Examples: ['project1']. Empty to search all accessible projects.","items": {"additionalProperties": false,"type": "string"@@ -1224,6 +806,56 @@"type": "object"}},+ {+ "name": "WebSearch",+ "inputSchema": {+ "additionalProperties": false,+ "description": "Trigger an intelligent internet search tool with a search query. Phrase the query as a natural language question. The search tool only has the information passed into the query string to include any relevant context from the conversation. Use this tool when the user specifically requests a web search, asks for resources, asks for links, asks you to read documentationWhen referencing links returned by search remember to use github markdown notation to format them like this [description](https://example.com)Our CEO describes when to use web search like this: I think some important criteria for choosing to search the web are\",\n if the user is asking for time-sensitive information (sports scores, news, current happenings, etc) that would have changed since the knowledge cutoff date\n Specific questions that reference external sources, eg contain a hyperlink in the user message or explicitly say “use webmd” or “check arxiv”\n do not use web search for things that are likely to find SEO slop content; this will make it worse than if it didn’t do it\n the LLM is be allowed to guess an answer and then use the web search tool to check AFTER providing the answer, if it feels it’s necessary. E.g. user asks “when was Caesar stabbed” -> llm gives answer -> if needed use web to double check\"\n do not use this tool many times in a single response, you think the user may need more information ask them before calling web search again. You should always sharethe results of your search with the user even if you are not sure if they are useful",+ "properties": {+ "query": {+ "additionalProperties": false,+ "description": "The search string to search for. Should be long / descriptive",+ "type": "string"+ }+ },+ "required": [+ "query"+ ],+ "title": "WebSearch",+ "type": "object"+ },+ "outputSchema": {+ "properties": {+ "content": {+ "type": "string"+ },+ "results": {+ "items": {+ "properties": {+ "name": {+ "type": "string"+ },+ "url": {+ "type": "string"+ }+ },+ "required": [+ "url",+ "name"+ ],+ "type": "object"+ },+ "type": "array"+ }+ },+ "required": [+ "content",+ "results"+ ],+ "title": "SearchResults",+ "type": "object"+ }+ },{"name": "ListDocuments","inputSchema": {@@ -1383,56 +1015,6 @@"type": "object"}},- {- "name": "WebSearch",- "inputSchema": {- "additionalProperties": false,- "description": "Trigger an intelligent internet search tool with a search query. Phrase the query as a natural language question. The search tool only has the information passed into the query string to include any relevant context from the conversation. Use this tool when the user specifically requests a web search, asks for resources, asks for links, asks you to read documentationWhen referencing links returned by search remember to use github markdown notation to format them like this [description](https://example.com)Our CEO describes when to use web search like this: I think some important criteria for choosing to search the web are\",\n if the user is asking for time-sensitive information (sports scores, news, current happenings, etc) that would have changed since the knowledge cutoff date\n Specific questions that reference external sources, eg contain a hyperlink in the user message or explicitly say “use webmd” or “check arxiv”\n do not use web search for things that are likely to find SEO slop content; this will make it worse than if it didn’t do it\n the LLM is be allowed to guess an answer and then use the web search tool to check AFTER providing the answer, if it feels it’s necessary. E.g. user asks “when was Caesar stabbed” -> llm gives answer -> if needed use web to double check\"\n do not use this tool many times in a single response, you think the user may need more information ask them before calling web search again. You should always sharethe results of your search with the user even if you are not sure if they are useful",- "properties": {- "query": {- "additionalProperties": false,- "description": "The search string to search for. Should be long / descriptive",- "type": "string"- }- },- "required": [- "query"- ],- "title": "WebSearch",- "type": "object"- },- "outputSchema": {- "properties": {- "content": {- "type": "string"- },- "results": {- "items": {- "properties": {- "name": {- "type": "string"- },- "url": {- "type": "string"- }- },- "required": [- "url",- "name"- ],- "type": "object"- },- "type": "array"- }- },- "required": [- "content",- "results"- ],- "title": "SearchResults",- "type": "object"- }- },{"name": "ListEmails","inputSchema": {@@ -1721,129 +1303,547 @@"type": "string"}},- "required": [- "dbId",- "messageId",- "itemId",- "itemType"- ],- "type": "object"+ "required": [+ "dbId",+ "messageId",+ "itemId",+ "itemType"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "metadata": {+ "properties": {+ "calendar_invite": {+ "description": "if any email contains a calendar invite",+ "type": "boolean"+ },+ "generic_sender": {+ "description": "if any sender in the thread is a generic email",+ "type": "boolean"+ },+ "known_sender": {+ "description": "if user has previously emailed any sender in the thread",+ "type": "boolean"+ },+ "tabular": {+ "description": "if any email contains a <table> html tag",+ "type": "boolean"+ }+ },+ "required": [+ "known_sender",+ "tabular",+ "calendar_invite",+ "generic_sender"+ ],+ "type": "object"+ },+ "name": {+ "type": [+ "string",+ "null"+ ]+ },+ "ownerId": {+ "type": "string"+ },+ "providerId": {+ "type": [+ "string",+ "null"+ ]+ },+ "senderEmail": {+ "type": [+ "string",+ "null"+ ]+ },+ "senderName": {+ "type": [+ "string",+ "null"+ ]+ },+ "senderPhotoUrl": {+ "type": [+ "string",+ "null"+ ]+ },+ "snippet": {+ "type": [+ "string",+ "null"+ ]+ },+ "sortTs": {+ "format": "int64",+ "type": "integer"+ },+ "updatedAt": {+ "format": "int64",+ "type": "integer"+ },+ "viewedAt": {+ "format": "int64",+ "type": [+ "integer",+ "null"+ ]+ }+ },+ "required": [+ "id",+ "ownerId",+ "inboxVisible",+ "isRead",+ "isDraft",+ "isImportant",+ "sortTs",+ "createdAt",+ "updatedAt",+ "attachments",+ "macroAttachments",+ "contacts",+ "labels",+ "metadata"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "next_cursor": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "required": [+ "items"+ ],+ "title": "ApiPaginatedThreadCursor",+ "type": "object"+ }+ },+ {+ "name": "Read",+ "inputSchema": {+ "additionalProperties": false,+ "description": "Read content by ID(s). Supports reading documents, channels, chats, and emails by their respective IDs. Use this tool when you need to retrieve the full content of a specific item(s).\n Channel transcripts only include 300 messages. Use 'messages_since' to see messages in a different time window.",+ "properties": {+ "contentType": {+ "additionalProperties": false,+ "description": "The type of content to read. Choose based on the type of content you want to retrieve.",+ "enum": [+ "document",+ "channel",+ "channel-message",+ "chat-thread",+ "chat-message",+ "email-thread",+ "email-message",+ "project"+ ],+ "type": "string"+ },+ "ids": {+ "additionalProperties": false,+ "description": "ID(s) of the content to read. IMPORTANT: document, channel-message, chat-message, and email-message content types support MULTIPLE ids! For all other content types (channel, chat-thread, email-thread) provide a single id.",+ "items": {+ "additionalProperties": false,+ "type": "string"+ },+ "type": "array"+ },+ "messagesSince": {+ "additionalProperties": false,+ "description": "A local datetime of the earliest message to include in a channel transcript ex: 2025-11-25 12:00:09 EST, only applicable to channels",+ "format": "date-time",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "required": [+ "contentType",+ "ids",+ "messagesSince"+ ],+ "title": "Read",+ "type": "object"+ },+ "outputSchema": {+ "properties": {+ "content": {+ "oneOf": [+ {+ "properties": {+ "documents": {+ "items": {+ "properties": {+ "content": {+ "type": "string"+ },+ "documentId": {+ "type": "string"+ },+ "metadata": {+ "properties": {+ "deleted": {+ "type": "boolean"+ },+ "documentName": {+ "type": "string"+ },+ "fileType": {+ "type": [+ "string",+ "null"+ ]+ },+ "owner": {+ "type": "string"+ },+ "projectId": {+ "type": [+ "string",+ "null"+ ]+ }+ },+ "required": [+ "documentName",+ "owner",+ "deleted"+ ],+ "type": "object"+ }+ },+ "required": [+ "documentId",+ "content",+ "metadata"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "type": {+ "const": "documents",+ "type": "string"+ }+ },+ "required": [+ "type",+ "documents"+ ],+ "type": "object"+ },+ {+ "properties": {+ "channel_id": {+ "type": "string"+ },+ "channel_name": {+ "type": [+ "string",+ "null"+ ]+ },+ "transcript": {+ "type": "string"+ },+ "type": {+ "const": "channel",+ "type": "string"+ }+ },+ "required": [+ "type",+ "channel_id",+ "transcript"+ ],+ "type": "object"+ },+ {+ "properties": {+ "conversation": {+ "items": {+ "properties": {+ "chat_id": {+ "type": "string"+ },+ "messages": {+ "items": {+ "properties": {+ "attachment_summaries": {+ "items": {+ "oneOf": [+ {+ "additionalProperties": false,+ "properties": {+ "Summary": {+ "properties": {+ "created_at": {+ "format": "date-time",+ "type": [+ "string",+ "null"+ ]+ },+ "document_id": {+ "type": "string"+ },+ "id": {+ "type": [+ "string",+ "null"+ ]+ },+ "summary": {+ "type": "string"+ },+ "version_id": {+ "type": "string"+ }+ },+ "required": [+ "document_id",+ "summary",+ "version_id"+ ],+ "type": "object"+ }+ },+ "required": [+ "Summary"+ ],+ "type": "object"+ },+ {+ "additionalProperties": false,+ "properties": {+ "NoSummary": {+ "properties": {+ "document_id": {+ "type": "string"+ }+ },+ "required": [+ "document_id"+ ],+ "type": "object"+ }+ },+ "required": [+ "NoSummary"+ ],+ "type": "object"+ }+ ]+ },+ "type": "array"+ },+ "content": {+ "type": "string"+ },+ "date": {+ "format": "date-time",+ "type": "string"+ }+ },+ "required": [+ "content",+ "date",+ "attachment_summaries"+ ],+ "type": "object"+ },+ "type": "array"+ },+ "title": {+ "type": "string"+ }+ },+ "required": [+ "chat_id",+ "title",+ "messages"+ ],+ "type": "object"+ },+ "type": "array"},- "type": "array"+ "type": {+ "const": "chat",+ "type": "string"+ }},- "metadata": {- "properties": {- "calendar_invite": {- "description": "if any email contains a calendar invite",- "type": "boolean"- },- "generic_sender": {- "description": "if any sender in the thread is a generic email",- "type": "boolean"- },- "known_sender": {- "description": "if user has previously emailed any sender in the thread",- "type": "boolean"+ "required": [+ "type",+ "conversation"+ ],+ "type": "object"+ },+ {+ "properties": {+ "messages": {+ "items": {+ "properties": {+ "bcc": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "cc": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "content": {+ "type": "string"+ },+ "messageId": {+ "type": "string"+ },+ "recipients": {+ "items": {+ "type": "string"+ },+ "type": "array"+ },+ "sender": {+ "type": "string"+ },+ "sentAt": {+ "format": "date-time",+ "type": [+ "string",+ "null"+ ]+ }+ },+ "required": [+ "messageId",+ "sender",+ "recipients",+ "cc",+ "bcc",+ "content"+ ],+ "type": "object"},- "tabular": {- "description": "if any email contains a <table> html tag",- "type": "boolean"- }+ "type": "array"},- "required": [- "known_sender",- "tabular",- "calendar_invite",- "generic_sender"- ],- "type": "object"+ "subject": {+ "type": [+ "string",+ "null"+ ]+ },+ "thread_id": {+ "type": "string"+ },+ "type": {+ "const": "email",+ "type": "string"+ }},- "name": {- "type": [- "string",- "null"- ]+ "required": [+ "type",+ "thread_id",+ "messages"+ ],+ "type": "object"+ },+ {+ "properties": {+ "formatted_preview": {+ "type": "string"+ },+ "type": {+ "const": "itemPreviews",+ "type": "string"+ }},- "ownerId": {+ "required": [+ "type",+ "formatted_preview"+ ],+ "type": "object"+ }+ ]+ }+ },+ "required": [+ "content"+ ],+ "title": "ReadResponse",+ "type": "object"+ }+ },+ {+ "name": "MarkdownRewrite",+ "inputSchema": {+ "additionalProperties": false,+ "description": "Instruct an agent to edit a markdown file identified by an id.\n This tool should be used when the user include a markdown file in context and requests a revision or edit to that file",+ "properties": {+ "instructions": {+ "additionalProperties": false,+ "description": "Instructions for the revision agent to follow to edit the markdown. These instructions will be provided by the user.",+ "type": "string"+ },+ "markdown_file_id": {+ "additionalProperties": false,+ "description": "The markdown file id to target for editing. This file id will be in your context and labeled as a markdown (md) document",+ "type": "string"+ }+ },+ "required": [+ "instructions",+ "markdown_file_id"+ ],+ "title": "MarkdownRewrite",+ "type": "object"+ },+ "outputSchema": {+ "additionalProperties": false,+ "properties": {+ "diffs": {+ "items": {+ "additionalProperties": false,+ "properties": {+ "markdown_text": {"type": "string"},- "providerId": {- "type": [- "string",- "null"- ]- },- "senderEmail": {- "type": [- "string",- "null"- ]- },- "senderName": {- "type": [- "string",- "null"- ]- },- "senderPhotoUrl": {- "type": [- "string",- "null"- ]- },- "snippet": {- "type": [- "string",- "null"- ]- },- "sortTs": {- "format": "int64",- "type": "integer"- },- "updatedAt": {- "format": "int64",- "type": "integer"+ "node_key": {+ "type": "string"},- "viewedAt": {- "format": "int64",- "type": [- "integer",- "null"- ]+ "operation": {+ "type": "string"}},"required": [- "id",- "ownerId",- "inboxVisible",- "isRead",- "isDraft",- "isImportant",- "sortTs",- "createdAt",- "updatedAt",- "attachments",- "macroAttachments",- "contacts",- "labels",- "metadata"+ "operation",+ "node_key",+ "markdown_text"],"type": "object"},"type": "array"- },- "next_cursor": {- "type": [- "string",- "null"- ]}},"required": [- "items"+ "diffs"],- "title": "ApiPaginatedThreadCursor",+ "title": "AIDiffResponse","type": "object"}}