Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(ai): types (#278)

Eric Hayesc8265bc8fa37
diff --git a/js/app/packages/core/component/AI/component/tool/ListEmails.tsx b/js/app/packages/core/component/AI/component/tool/ListEmails.tsx
index 4133a4d6bd..8c47fdec58 100644
--- a/js/app/packages/core/component/AI/component/tool/ListEmails.tsx
+++ b/js/app/packages/core/component/AI/component/tool/ListEmails.tsx
@@ -121,7 +121,7 @@ const handler = createToolRenderer({
renderContext={ctx.renderContext}
type="response"
>
- <ListEmailsToolResponse results={ctx.tool.data.previews?.items || []} />
+ <ListEmailsToolResponse results={ctx.tool.data.items || []} />
</BaseTool>
),
});
diff --git a/js/app/packages/service-cognition/generated/tools/schemas.ts b/js/app/packages/service-cognition/generated/tools/schemas.ts
index 05cc395ada..1149bfddc4 100644
--- a/js/app/packages/service-cognition/generated/tools/schemas.ts
+++ b/js/app/packages/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({ "previews": z.object({ "items": z.array(z.object({ "attachments": z.array(z.object({ "content_id": z.union([z.string(), z.null()]).optional(), "data_url": z.union([z.string(), z.null()]).optional(), "db_id": z.union([z.string(), z.null()]).optional(), "filename": z.union([z.string(), z.null()]).optional(), "mime_type": z.union([z.string(), z.null()]).optional(), "provider_id": z.union([z.string(), z.null()]).optional(), "size_bytes": z.union([z.number().int(), z.null()]).optional() })), "attachmentsMacro": z.array(z.object({ "db_id": z.union([z.string(), z.null()]).optional(), "item_id": z.string(), "item_type": z.string(), "message_id": z.union([z.string(), z.null()]).optional() })), "createdAt": z.number().int(), "id": z.string(), "inboxVisible": z.boolean(), "isDraft": z.boolean(), "isImportant": z.boolean(), "isRead": z.boolean(), "name": z.union([z.string(), z.null()]).optional(), "ownerId": z.string(), "participants": z.array(z.object({ "email_address": z.union([z.string(), z.null()]).optional(), "id": z.union([z.string(), z.null()]).optional(), "link_id": z.string(), "name": z.union([z.string(), z.null()]).optional(), "original_photo_url": z.union([z.string(), z.null()]).optional(), "sfs_photo_url": z.union([z.string(), z.null()]).optional() })), "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(), "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 MarkdownRewriteInputSchema = z.object({ "instructions": z.string(), "markdown_file_id": z.string() }).strict()
diff --git a/js/app/packages/service-cognition/generated/tools/types.ts b/js/app/packages/service-cognition/generated/tools/types.ts
index e68c10eb62..5603f5dde0 100644
--- a/js/app/packages/service-cognition/generated/tools/types.ts
+++ b/js/app/packages/service-cognition/generated/tools/types.ts
@@ -144,53 +144,49 @@ export interface ListEmailsInput {
*/
export interface ListEmailsOutput {
- /**
- * the thread, with messages inside
- */
- previews: {
- items: {
- attachments: {
- content_id?: string | null;
- data_url?: string | null;
- db_id?: string | null;
- filename?: string | null;
- mime_type?: string | null;
- provider_id?: string | null;
- size_bytes?: number | null;
- }[];
- attachmentsMacro: {
- db_id?: string | null;
- item_id: string;
- item_type: string;
- message_id?: string | null;
- }[];
+ items: {
+ attachments: {
+ contentId?: string | null;
createdAt: number;
+ filename?: string | null;
+ id: string;
+ messageId: string;
+ mimeType?: string | null;
+ providerAttachmentId?: string | null;
+ sizeBytes?: number | null;
+ }[];
+ contacts: {
+ emailAddress?: string | null;
id: string;
- inboxVisible: boolean;
- isDraft: boolean;
- isImportant: boolean;
- isRead: boolean;
+ linkId: string;
name?: string | null;
- ownerId: string;
- participants: {
- email_address?: string | null;
- id?: string | null;
- link_id: string;
- name?: string | null;
- original_photo_url?: string | null;
- sfs_photo_url?: string | null;
- }[];
- providerId?: string | null;
- senderEmail?: string | null;
- senderName?: string | null;
- senderPhotoUrl?: string | null;
- snippet?: string | null;
- sortTs: number;
- updatedAt: number;
- viewedAt?: number | null;
+ sfsPhotoUrl?: string | null;
}[];
- next_cursor?: string | null;
- };
+ createdAt: number;
+ frecencyScore?: number | null;
+ id: string;
+ inboxVisible: boolean;
+ isDraft: boolean;
+ isImportant: boolean;
+ isRead: boolean;
+ macroAttachments: {
+ dbId: string;
+ itemId: string;
+ itemType: string;
+ messageId: string;
+ }[];
+ name?: string | null;
+ ownerId: string;
+ providerId?: string | null;
+ senderEmail?: string | null;
+ senderName?: string | null;
+ senderPhotoUrl?: string | null;
+ snippet?: string | null;
+ sortTs: number;
+ updatedAt: number;
+ viewedAt?: number | null;
+ }[];
+ next_cursor?: string | null;
}
diff --git a/js/app/packages/service-cognition/toolTypes.ts b/js/app/packages/service-cognition/toolTypes.ts
index 0c9c88e377..08d01247b0 100644
--- a/js/app/packages/service-cognition/toolTypes.ts
+++ b/js/app/packages/service-cognition/toolTypes.ts
@@ -22,6 +22,4 @@ export type ListDocumentsResult = FlattenArray<
types.ListDocumentsOutput['results']
>;
-export type ListEmailsResult = FlattenArray<
- types.ListEmailsOutput['previews']['items']
->;
+export type ListEmailsResult = FlattenArray<types.ListEmailsOutput['items']>;