@anuma/sdk 10.0.0 → 10.0.1

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.
@@ -25215,6 +25215,7 @@ async function synthesizeFacet(facet, ctx, options, prior, vaultPreparation) {
25215
25215
  vaultPreparation,
25216
25216
  scopes,
25217
25217
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
25218
+ ...hasReviewGate && { memoryIds: [...reviewed] },
25218
25219
  types: ["fact"],
25219
25220
  factTypeWeights,
25220
25221
  proofCountAlpha
@@ -23512,6 +23512,7 @@ async function synthesizeFacet(facet, ctx, options, prior, vaultPreparation) {
23512
23512
  vaultPreparation,
23513
23513
  scopes,
23514
23514
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
23515
+ ...hasReviewGate && { memoryIds: [...reviewed] },
23515
23516
  types: ["fact"],
23516
23517
  factTypeWeights,
23517
23518
  proofCountAlpha
@@ -27535,6 +27535,7 @@ async function synthesizeFacet(facet, ctx, options, prior, vaultPreparation) {
27535
27535
  vaultPreparation,
27536
27536
  scopes,
27537
27537
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
27538
+ ...hasReviewGate && { memoryIds: [...reviewed] },
27538
27539
  types: ["fact"],
27539
27540
  factTypeWeights,
27540
27541
  proofCountAlpha
@@ -25624,6 +25624,7 @@ async function synthesizeFacet(facet, ctx, options, prior, vaultPreparation) {
25624
25624
  vaultPreparation,
25625
25625
  scopes,
25626
25626
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
25627
+ ...hasReviewGate && { memoryIds: [...reviewed] },
25627
25628
  types: ["fact"],
25628
25629
  factTypeWeights,
25629
25630
  proofCountAlpha
@@ -37002,6 +37002,7 @@ async function synthesizeFacet(facet, ctx, options, prior, vaultPreparation) {
37002
37002
  vaultPreparation,
37003
37003
  scopes,
37004
37004
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
37005
+ ...hasReviewGate && { memoryIds: [...reviewed] },
37005
37006
  types: ["fact"],
37006
37007
  factTypeWeights,
37007
37008
  proofCountAlpha
@@ -35224,6 +35224,7 @@ async function synthesizeFacet(facet, ctx, options, prior, vaultPreparation) {
35224
35224
  vaultPreparation,
35225
35225
  scopes,
35226
35226
  limit: hasReviewGate ? RECALL_MAX_LIMIT : limit,
35227
+ ...hasReviewGate && { memoryIds: [...reviewed] },
35227
35228
  types: ["fact"],
35228
35229
  factTypeWeights,
35229
35230
  proofCountAlpha
@@ -4610,12 +4610,12 @@ function createGmailGetMessageTool(getToken, requestAccess) {
4610
4610
  }
4611
4611
  };
4612
4612
  }
4613
- function createGmailSendMessageTool(getToken, requestAccess) {
4613
+ function createGmailSendMessageTool(getToken, requestAccess, confirmSend) {
4614
4614
  return {
4615
4615
  type: "function",
4616
4616
  function: {
4617
4617
  name: "gmail_send_message",
4618
- description: "Sends a plaintext email from the user's Gmail account. Use only when the user has explicitly confirmed the recipient, subject, and body.",
4618
+ description: "Sends a plaintext email from the user's Gmail account. The host must confirm To, Cc, Bcc, subject, and body before each send.",
4619
4619
  parameters: {
4620
4620
  type: "object",
4621
4621
  properties: {
@@ -4643,18 +4643,24 @@ function createGmailSendMessageTool(getToken, requestAccess) {
4643
4643
  required: ["to", "subject", "body"]
4644
4644
  }
4645
4645
  },
4646
- executor: async (args) => {
4646
+ executorTimeout: Infinity,
4647
+ executor: confirmSend ? async (args, signal) => {
4648
+ const typed = Object.freeze({
4649
+ to: sanitizeHeaderValue(args.to),
4650
+ subject: sanitizeHeaderValue(args.subject),
4651
+ body: args.body,
4652
+ cc: args.cc ? sanitizeHeaderValue(args.cc) : void 0,
4653
+ bcc: args.bcc ? sanitizeHeaderValue(args.bcc) : void 0
4654
+ });
4655
+ if (await confirmSend(typed) !== true) {
4656
+ return "Error: Gmail message send was not confirmed.";
4657
+ }
4658
+ signal?.throwIfAborted();
4647
4659
  const resolved = await resolveToken3(getToken, requestAccess);
4648
4660
  if ("error" in resolved) return resolved.error;
4649
- const typed = {
4650
- to: args.to,
4651
- subject: args.subject,
4652
- body: args.body,
4653
- cc: args.cc,
4654
- bcc: args.bcc
4655
- };
4661
+ signal?.throwIfAborted();
4656
4662
  return sendGmailMessage(resolved.token, typed);
4657
- }
4663
+ } : void 0
4658
4664
  };
4659
4665
  }
4660
4666
  function createGmailDraftTool(getToken, requestAccess) {
@@ -4704,12 +4710,12 @@ function createGmailDraftTool(getToken, requestAccess) {
4704
4710
  }
4705
4711
  };
4706
4712
  }
4707
- function createGmailTools(getToken, requestAccess) {
4713
+ function createGmailTools(getToken, requestAccess, confirmSend) {
4708
4714
  return {
4709
4715
  gmail_search_messages: createGmailSearchTool(getToken, requestAccess),
4710
4716
  gmail_get_message: createGmailGetMessageTool(getToken, requestAccess),
4711
4717
  gmail_create_draft: createGmailDraftTool(getToken, requestAccess),
4712
- gmail_send_message: createGmailSendMessageTool(getToken, requestAccess)
4718
+ gmail_send_message: createGmailSendMessageTool(getToken, requestAccess, confirmSend)
4713
4719
  };
4714
4720
  }
4715
4721
 
@@ -1879,6 +1879,8 @@ interface GmailSendMessageArgs {
1879
1879
  cc?: string;
1880
1880
  bcc?: string;
1881
1881
  }
1882
+ /** Requests host confirmation of the complete message before each send. */
1883
+ type GmailSendConfirmation = (message: Readonly<GmailSendMessageArgs>) => boolean | Promise<boolean>;
1882
1884
  interface GmailMessageSummary {
1883
1885
  id: string;
1884
1886
  threadId: string;
@@ -1909,19 +1911,13 @@ interface GmailMessageDetail {
1909
1911
  */
1910
1912
  declare function connectorMintErrorToToolResult(err: ConnectorMintError, provider: string): string;
1911
1913
  /**
1912
- * Build the Gmail tool set wired to the supplied token getter.
1914
+ * Creates Gmail tools with optional host confirmation before each send.
1913
1915
  *
1914
- * The returned record keys (`gmail_search_messages`, `gmail_get_message`,
1915
- * `gmail_create_draft`, `gmail_send_message`) match the underlying tool names
1916
- * so callers can forward a subset by destructuring.
1917
- *
1918
- * @param getToken Async getter — typically `createConnectorTokenGetter(portal, "gmail")`.
1919
- * @param requestAccess Fallback called when `getToken()` returns null.
1920
- * Server agents pass `async () => { throw ... }`; browser
1921
- * surfaces drive a connect flow and resolve with the
1922
- * fresh token (or `null` on user cancel).
1916
+ * @param getToken Retrieves the Gmail token.
1917
+ * @param requestAccess Requests access when no token exists.
1918
+ * @param confirmSend Confirms the complete message. Without this callback, the send tool has no executor and returns calls to the host.
1923
1919
  */
1924
- declare function createGmailTools(getToken: GmailTokenGetter, requestAccess: GmailRequestAccess): Record<string, ToolConfig>;
1920
+ declare function createGmailTools(getToken: GmailTokenGetter, requestAccess: GmailRequestAccess, confirmSend?: GmailSendConfirmation): Record<string, ToolConfig>;
1925
1921
 
1926
1922
  interface ListEventsArgs {
1927
1923
  timeMin?: string;
@@ -2933,4 +2929,4 @@ interface XGetMyPostsArgs {
2933
2929
  */
2934
2930
  declare function createXTools(callProxy: XProxyCaller): Record<string, ToolConfig>;
2935
2931
 
2936
- export { ADD_SLIDE_SCHEMA, APP_BUILDER_PROMPT, APP_COMPLETE_CONNECT_ACK_TYPE, APP_COMPLETE_CONNECT_TYPE, APP_COMPLETE_DEFAULT_TIMEOUT_MS, APP_COMPLETE_IFRAME_SHIM_SCRIPT, APP_COMPLETE_REQUEST_TYPE, APP_COMPLETE_RESPONSE_TYPE, APP_COMPLETE_STUB_SCRIPT, APP_FILE_TOOL_NAMES, APP_PREVIEW_BASELINE_CSS, AUDIT_DESIGN_SCHEMA, type AgentresAccount, type AgentresClient, type AgentresClientOptions, AgentresError, type AgentresErrorCode, type AgentresLinkStatus, type AgentresLinkStep, AgentresPathError, type AnchorMatch, type AnumaChild, AnumaJsxError, type AnumaNode, type AppCompleteBridge, type AppCompleteBridgeOptions, type AppFileRecord, type AppFileStorage, type AttrValue, type AuditIssue, type AuditIssueType, type AuditResult, type AuditSeverity, type AuditTokens, type BuildSlideSystemPromptOptions, CHOICE_TOOL_NAME, CONNECTOR_ERROR_MARKER, CREATE_DOCUMENT_SCHEMA, CREATE_FILE_SCHEMA, CRITIQUE_DESIGN_SCHEMA, type CalendarEvent, type ChartDataPoint, type ChoiceOption, type ConfirmParameter, type ConfirmToolResult, type ConnectorErrorCode, type ConnectorMintError, type ConnectorMintResult, type ConnectorTokenGetterOpts, type ConnectorTokenSource, type CreateAppGenerationToolsOptions, type CreateDocumentToolsOptions, type CreateEventArgs, type CreateFileArgs, type CreateSelectPaymentWalletToolOptions, type CreateSlideToolsOptions, type CreateUIToolsOptions, type CreateWalletPaymentToolOptions, type CreateWeatherToolOptions, DEFAULT_DESIGN_CRITIQUE_RUBRIC, DEFAULT_DOCUMENT_ID, DEFAULT_MAX_CONVERSATIONS, DEFAULT_MAX_DOCUMENT_CONVERSATIONS, DELETE_FILE_SCHEMA, DOCUMENT_BUILDER_PROMPT, DOCUMENT_TOOL_NAMES, type DisplayChartResult, type DisplayConnectorResult, type DisplayPhoneCallOfferResult, type DisplayToolConfig, type DisplayToolMigrations, type DisplayWeatherResult, type DocAttrValue, type DocChild, DocDslError, type DocNode, type DriveFile, type DropboxRequestAccess, type DropboxTokenGetter, type ExportAppOptions, FONT_LIBRARY, FONT_PRESETS, type FileChangeEvent, type FileSnippet, type FontCategory, type FontPreset, type FontSpec, type ForecastDay, type FormField, type FormFieldOption, type FormFieldType, type GetFileContentArgs, type GmailGetMessageArgs, type GmailMessageDetail, type GmailMessageSummary, type GmailRequestAccess, type GmailSearchArgs, type GmailSendMessageArgs, type GmailTokenGetter, type InteractiveToolConfig, type KnownTag, LAYOUT_MODES, LIST_FILES_SCHEMA, type LayoutMode, type LegacyDeckJson, type ListEventsArgs, type ListRecentFilesArgs, MapFileStorage, type NotionCreatePagesArgs, type NotionFetchArgs, type NotionMcpCaller, type NotionMovePagesArgs, type NotionSearchArgs, type NotionUpdatePageArgs, PATCH_DOCUMENT_SCHEMA, PATCH_FILE_SCHEMA, PATCH_SLIDES_SCHEMA, PLAN_DECK_SCHEMA, type PatchFailure, type PatchFailureReason, type PaymentWallet, type PdfTag, READ_DOCUMENT_SCHEMA, READ_FILE_SCHEMA, READ_SLIDES_SCHEMA, RUNTIME_ERROR_OVERLAY_SCRIPT, SELECT_PAYMENT_WALLET_TOOL_NAME, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, type SearchFilesArgs, type SelectPaymentWalletResult, SiwxChallengeError, SiwxUnsupportedError, type SlackGetChannelHistoryArgs, type SlackGetThreadRepliesArgs, type SlackListChannelsArgs, type SlackListDmsArgs, type SlackListUsersArgs, type SlackPostMessageArgs, type SlackProxyCaller, type SlackSearchMessagesArgs, type SlideToolSet, type SolanaSignMessageFn, THEME_ATTRS, type ThemeAttr, type ToolConfig, type ToolExecutionErrorType, type ToolExecutionResult, type UIInteractionContext, type UpdateEventArgs, type UpdateFileArgs, VERIFY_APP_SCHEMA, type VerifyAppResult, WALLET_PAYMENT_TOOL_NAME, type WalletPaymentOutcome, type WalletPaymentPassenger, type WalletPaymentRequest, type WalletPaymentResult, type XGetMeArgs, type XGetMyPostsArgs, type XProxyCaller, applyPatches, auditDesign, buildAppFileManifest, buildAppSystemPrompt, buildConnectorErrorResult, buildDocumentSystemPrompt, buildFontsUrl, buildSlideSystemPrompt, callNotionMCPTool, connectorMintErrorToToolResult, convertLegacyDeckJson, createAgentresClient, createAppCompleteBridge, createAppGenerationTools, createChartTool, createChatTools, createChoiceTool, createConfirmTool, createConnectorOfferTool, createConnectorTokenGetter, createDisplayTool, createDocumentTools, createDriveTools, createDropboxTools, createFormTool, createGitHubTools, createGmailTools, createGoogleCalendarCreateEventTool, createGoogleCalendarTool, createGoogleCalendarUpdateEventTool, createGoogleDriveCreateFileTool, createGoogleDriveGetContentTool, createGoogleDriveListRecentTool, createGoogleDriveSearchTool, createGoogleDriveUpdateFileTool, createInteractiveTool, createNotionCreateCommentTool, createNotionCreateDatabaseTool, createNotionCreatePagesTool, createNotionDuplicatePageTool, createNotionFetchTool, createNotionGetCommentsTool, createNotionGetTeamsTool, createNotionGetUsersTool, createNotionMovePagesTool, createNotionProxyTools, createNotionSearchTool, createNotionTools, createNotionUpdateDataSourceTool, createNotionUpdatePageTool, createPhoneCallOfferTool, createSelectPaymentWalletTool, createSlackTools, createSlideTools, createWalletPaymentTool, createWeatherTool, createXTools, documentPath, exportAppToHtml, findById, findParentOfId, getFontByName, getId, getMCPEndpoints, getNumberAttr, getStringAttr, insertAfterId, insertChild, installAppCompleteIframeShim, isAnumaTag, isHtmlTag, isKnownFont, isLegacyDeckJson, isPdfTag, migrateDisplayResult, normalizePath, parseDocumentDsl, parseJsx, pdfStyleKeys, pdfTags, removeById, replaceById, serializeJsx, truncateContent, updateAttrs, walk };
2932
+ export { ADD_SLIDE_SCHEMA, APP_BUILDER_PROMPT, APP_COMPLETE_CONNECT_ACK_TYPE, APP_COMPLETE_CONNECT_TYPE, APP_COMPLETE_DEFAULT_TIMEOUT_MS, APP_COMPLETE_IFRAME_SHIM_SCRIPT, APP_COMPLETE_REQUEST_TYPE, APP_COMPLETE_RESPONSE_TYPE, APP_COMPLETE_STUB_SCRIPT, APP_FILE_TOOL_NAMES, APP_PREVIEW_BASELINE_CSS, AUDIT_DESIGN_SCHEMA, type AgentresAccount, type AgentresClient, type AgentresClientOptions, AgentresError, type AgentresErrorCode, type AgentresLinkStatus, type AgentresLinkStep, AgentresPathError, type AnchorMatch, type AnumaChild, AnumaJsxError, type AnumaNode, type AppCompleteBridge, type AppCompleteBridgeOptions, type AppFileRecord, type AppFileStorage, type AttrValue, type AuditIssue, type AuditIssueType, type AuditResult, type AuditSeverity, type AuditTokens, type BuildSlideSystemPromptOptions, CHOICE_TOOL_NAME, CONNECTOR_ERROR_MARKER, CREATE_DOCUMENT_SCHEMA, CREATE_FILE_SCHEMA, CRITIQUE_DESIGN_SCHEMA, type CalendarEvent, type ChartDataPoint, type ChoiceOption, type ConfirmParameter, type ConfirmToolResult, type ConnectorErrorCode, type ConnectorMintError, type ConnectorMintResult, type ConnectorTokenGetterOpts, type ConnectorTokenSource, type CreateAppGenerationToolsOptions, type CreateDocumentToolsOptions, type CreateEventArgs, type CreateFileArgs, type CreateSelectPaymentWalletToolOptions, type CreateSlideToolsOptions, type CreateUIToolsOptions, type CreateWalletPaymentToolOptions, type CreateWeatherToolOptions, DEFAULT_DESIGN_CRITIQUE_RUBRIC, DEFAULT_DOCUMENT_ID, DEFAULT_MAX_CONVERSATIONS, DEFAULT_MAX_DOCUMENT_CONVERSATIONS, DELETE_FILE_SCHEMA, DOCUMENT_BUILDER_PROMPT, DOCUMENT_TOOL_NAMES, type DisplayChartResult, type DisplayConnectorResult, type DisplayPhoneCallOfferResult, type DisplayToolConfig, type DisplayToolMigrations, type DisplayWeatherResult, type DocAttrValue, type DocChild, DocDslError, type DocNode, type DriveFile, type DropboxRequestAccess, type DropboxTokenGetter, type ExportAppOptions, FONT_LIBRARY, FONT_PRESETS, type FileChangeEvent, type FileSnippet, type FontCategory, type FontPreset, type FontSpec, type ForecastDay, type FormField, type FormFieldOption, type FormFieldType, type GetFileContentArgs, type GmailGetMessageArgs, type GmailMessageDetail, type GmailMessageSummary, type GmailRequestAccess, type GmailSearchArgs, type GmailSendConfirmation, type GmailSendMessageArgs, type GmailTokenGetter, type InteractiveToolConfig, type KnownTag, LAYOUT_MODES, LIST_FILES_SCHEMA, type LayoutMode, type LegacyDeckJson, type ListEventsArgs, type ListRecentFilesArgs, MapFileStorage, type NotionCreatePagesArgs, type NotionFetchArgs, type NotionMcpCaller, type NotionMovePagesArgs, type NotionSearchArgs, type NotionUpdatePageArgs, PATCH_DOCUMENT_SCHEMA, PATCH_FILE_SCHEMA, PATCH_SLIDES_SCHEMA, PLAN_DECK_SCHEMA, type PatchFailure, type PatchFailureReason, type PaymentWallet, type PdfTag, READ_DOCUMENT_SCHEMA, READ_FILE_SCHEMA, READ_SLIDES_SCHEMA, RUNTIME_ERROR_OVERLAY_SCRIPT, SELECT_PAYMENT_WALLET_TOOL_NAME, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, type SearchFilesArgs, type SelectPaymentWalletResult, SiwxChallengeError, SiwxUnsupportedError, type SlackGetChannelHistoryArgs, type SlackGetThreadRepliesArgs, type SlackListChannelsArgs, type SlackListDmsArgs, type SlackListUsersArgs, type SlackPostMessageArgs, type SlackProxyCaller, type SlackSearchMessagesArgs, type SlideToolSet, type SolanaSignMessageFn, THEME_ATTRS, type ThemeAttr, type ToolConfig, type ToolExecutionErrorType, type ToolExecutionResult, type UIInteractionContext, type UpdateEventArgs, type UpdateFileArgs, VERIFY_APP_SCHEMA, type VerifyAppResult, WALLET_PAYMENT_TOOL_NAME, type WalletPaymentOutcome, type WalletPaymentPassenger, type WalletPaymentRequest, type WalletPaymentResult, type XGetMeArgs, type XGetMyPostsArgs, type XProxyCaller, applyPatches, auditDesign, buildAppFileManifest, buildAppSystemPrompt, buildConnectorErrorResult, buildDocumentSystemPrompt, buildFontsUrl, buildSlideSystemPrompt, callNotionMCPTool, connectorMintErrorToToolResult, convertLegacyDeckJson, createAgentresClient, createAppCompleteBridge, createAppGenerationTools, createChartTool, createChatTools, createChoiceTool, createConfirmTool, createConnectorOfferTool, createConnectorTokenGetter, createDisplayTool, createDocumentTools, createDriveTools, createDropboxTools, createFormTool, createGitHubTools, createGmailTools, createGoogleCalendarCreateEventTool, createGoogleCalendarTool, createGoogleCalendarUpdateEventTool, createGoogleDriveCreateFileTool, createGoogleDriveGetContentTool, createGoogleDriveListRecentTool, createGoogleDriveSearchTool, createGoogleDriveUpdateFileTool, createInteractiveTool, createNotionCreateCommentTool, createNotionCreateDatabaseTool, createNotionCreatePagesTool, createNotionDuplicatePageTool, createNotionFetchTool, createNotionGetCommentsTool, createNotionGetTeamsTool, createNotionGetUsersTool, createNotionMovePagesTool, createNotionProxyTools, createNotionSearchTool, createNotionTools, createNotionUpdateDataSourceTool, createNotionUpdatePageTool, createPhoneCallOfferTool, createSelectPaymentWalletTool, createSlackTools, createSlideTools, createWalletPaymentTool, createWeatherTool, createXTools, documentPath, exportAppToHtml, findById, findParentOfId, getFontByName, getId, getMCPEndpoints, getNumberAttr, getStringAttr, insertAfterId, insertChild, installAppCompleteIframeShim, isAnumaTag, isHtmlTag, isKnownFont, isLegacyDeckJson, isPdfTag, migrateDisplayResult, normalizePath, parseDocumentDsl, parseJsx, pdfStyleKeys, pdfTags, removeById, replaceById, serializeJsx, truncateContent, updateAttrs, walk };
@@ -1879,6 +1879,8 @@ interface GmailSendMessageArgs {
1879
1879
  cc?: string;
1880
1880
  bcc?: string;
1881
1881
  }
1882
+ /** Requests host confirmation of the complete message before each send. */
1883
+ type GmailSendConfirmation = (message: Readonly<GmailSendMessageArgs>) => boolean | Promise<boolean>;
1882
1884
  interface GmailMessageSummary {
1883
1885
  id: string;
1884
1886
  threadId: string;
@@ -1909,19 +1911,13 @@ interface GmailMessageDetail {
1909
1911
  */
1910
1912
  declare function connectorMintErrorToToolResult(err: ConnectorMintError, provider: string): string;
1911
1913
  /**
1912
- * Build the Gmail tool set wired to the supplied token getter.
1914
+ * Creates Gmail tools with optional host confirmation before each send.
1913
1915
  *
1914
- * The returned record keys (`gmail_search_messages`, `gmail_get_message`,
1915
- * `gmail_create_draft`, `gmail_send_message`) match the underlying tool names
1916
- * so callers can forward a subset by destructuring.
1917
- *
1918
- * @param getToken Async getter — typically `createConnectorTokenGetter(portal, "gmail")`.
1919
- * @param requestAccess Fallback called when `getToken()` returns null.
1920
- * Server agents pass `async () => { throw ... }`; browser
1921
- * surfaces drive a connect flow and resolve with the
1922
- * fresh token (or `null` on user cancel).
1916
+ * @param getToken Retrieves the Gmail token.
1917
+ * @param requestAccess Requests access when no token exists.
1918
+ * @param confirmSend Confirms the complete message. Without this callback, the send tool has no executor and returns calls to the host.
1923
1919
  */
1924
- declare function createGmailTools(getToken: GmailTokenGetter, requestAccess: GmailRequestAccess): Record<string, ToolConfig>;
1920
+ declare function createGmailTools(getToken: GmailTokenGetter, requestAccess: GmailRequestAccess, confirmSend?: GmailSendConfirmation): Record<string, ToolConfig>;
1925
1921
 
1926
1922
  interface ListEventsArgs {
1927
1923
  timeMin?: string;
@@ -2933,4 +2929,4 @@ interface XGetMyPostsArgs {
2933
2929
  */
2934
2930
  declare function createXTools(callProxy: XProxyCaller): Record<string, ToolConfig>;
2935
2931
 
2936
- export { ADD_SLIDE_SCHEMA, APP_BUILDER_PROMPT, APP_COMPLETE_CONNECT_ACK_TYPE, APP_COMPLETE_CONNECT_TYPE, APP_COMPLETE_DEFAULT_TIMEOUT_MS, APP_COMPLETE_IFRAME_SHIM_SCRIPT, APP_COMPLETE_REQUEST_TYPE, APP_COMPLETE_RESPONSE_TYPE, APP_COMPLETE_STUB_SCRIPT, APP_FILE_TOOL_NAMES, APP_PREVIEW_BASELINE_CSS, AUDIT_DESIGN_SCHEMA, type AgentresAccount, type AgentresClient, type AgentresClientOptions, AgentresError, type AgentresErrorCode, type AgentresLinkStatus, type AgentresLinkStep, AgentresPathError, type AnchorMatch, type AnumaChild, AnumaJsxError, type AnumaNode, type AppCompleteBridge, type AppCompleteBridgeOptions, type AppFileRecord, type AppFileStorage, type AttrValue, type AuditIssue, type AuditIssueType, type AuditResult, type AuditSeverity, type AuditTokens, type BuildSlideSystemPromptOptions, CHOICE_TOOL_NAME, CONNECTOR_ERROR_MARKER, CREATE_DOCUMENT_SCHEMA, CREATE_FILE_SCHEMA, CRITIQUE_DESIGN_SCHEMA, type CalendarEvent, type ChartDataPoint, type ChoiceOption, type ConfirmParameter, type ConfirmToolResult, type ConnectorErrorCode, type ConnectorMintError, type ConnectorMintResult, type ConnectorTokenGetterOpts, type ConnectorTokenSource, type CreateAppGenerationToolsOptions, type CreateDocumentToolsOptions, type CreateEventArgs, type CreateFileArgs, type CreateSelectPaymentWalletToolOptions, type CreateSlideToolsOptions, type CreateUIToolsOptions, type CreateWalletPaymentToolOptions, type CreateWeatherToolOptions, DEFAULT_DESIGN_CRITIQUE_RUBRIC, DEFAULT_DOCUMENT_ID, DEFAULT_MAX_CONVERSATIONS, DEFAULT_MAX_DOCUMENT_CONVERSATIONS, DELETE_FILE_SCHEMA, DOCUMENT_BUILDER_PROMPT, DOCUMENT_TOOL_NAMES, type DisplayChartResult, type DisplayConnectorResult, type DisplayPhoneCallOfferResult, type DisplayToolConfig, type DisplayToolMigrations, type DisplayWeatherResult, type DocAttrValue, type DocChild, DocDslError, type DocNode, type DriveFile, type DropboxRequestAccess, type DropboxTokenGetter, type ExportAppOptions, FONT_LIBRARY, FONT_PRESETS, type FileChangeEvent, type FileSnippet, type FontCategory, type FontPreset, type FontSpec, type ForecastDay, type FormField, type FormFieldOption, type FormFieldType, type GetFileContentArgs, type GmailGetMessageArgs, type GmailMessageDetail, type GmailMessageSummary, type GmailRequestAccess, type GmailSearchArgs, type GmailSendMessageArgs, type GmailTokenGetter, type InteractiveToolConfig, type KnownTag, LAYOUT_MODES, LIST_FILES_SCHEMA, type LayoutMode, type LegacyDeckJson, type ListEventsArgs, type ListRecentFilesArgs, MapFileStorage, type NotionCreatePagesArgs, type NotionFetchArgs, type NotionMcpCaller, type NotionMovePagesArgs, type NotionSearchArgs, type NotionUpdatePageArgs, PATCH_DOCUMENT_SCHEMA, PATCH_FILE_SCHEMA, PATCH_SLIDES_SCHEMA, PLAN_DECK_SCHEMA, type PatchFailure, type PatchFailureReason, type PaymentWallet, type PdfTag, READ_DOCUMENT_SCHEMA, READ_FILE_SCHEMA, READ_SLIDES_SCHEMA, RUNTIME_ERROR_OVERLAY_SCRIPT, SELECT_PAYMENT_WALLET_TOOL_NAME, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, type SearchFilesArgs, type SelectPaymentWalletResult, SiwxChallengeError, SiwxUnsupportedError, type SlackGetChannelHistoryArgs, type SlackGetThreadRepliesArgs, type SlackListChannelsArgs, type SlackListDmsArgs, type SlackListUsersArgs, type SlackPostMessageArgs, type SlackProxyCaller, type SlackSearchMessagesArgs, type SlideToolSet, type SolanaSignMessageFn, THEME_ATTRS, type ThemeAttr, type ToolConfig, type ToolExecutionErrorType, type ToolExecutionResult, type UIInteractionContext, type UpdateEventArgs, type UpdateFileArgs, VERIFY_APP_SCHEMA, type VerifyAppResult, WALLET_PAYMENT_TOOL_NAME, type WalletPaymentOutcome, type WalletPaymentPassenger, type WalletPaymentRequest, type WalletPaymentResult, type XGetMeArgs, type XGetMyPostsArgs, type XProxyCaller, applyPatches, auditDesign, buildAppFileManifest, buildAppSystemPrompt, buildConnectorErrorResult, buildDocumentSystemPrompt, buildFontsUrl, buildSlideSystemPrompt, callNotionMCPTool, connectorMintErrorToToolResult, convertLegacyDeckJson, createAgentresClient, createAppCompleteBridge, createAppGenerationTools, createChartTool, createChatTools, createChoiceTool, createConfirmTool, createConnectorOfferTool, createConnectorTokenGetter, createDisplayTool, createDocumentTools, createDriveTools, createDropboxTools, createFormTool, createGitHubTools, createGmailTools, createGoogleCalendarCreateEventTool, createGoogleCalendarTool, createGoogleCalendarUpdateEventTool, createGoogleDriveCreateFileTool, createGoogleDriveGetContentTool, createGoogleDriveListRecentTool, createGoogleDriveSearchTool, createGoogleDriveUpdateFileTool, createInteractiveTool, createNotionCreateCommentTool, createNotionCreateDatabaseTool, createNotionCreatePagesTool, createNotionDuplicatePageTool, createNotionFetchTool, createNotionGetCommentsTool, createNotionGetTeamsTool, createNotionGetUsersTool, createNotionMovePagesTool, createNotionProxyTools, createNotionSearchTool, createNotionTools, createNotionUpdateDataSourceTool, createNotionUpdatePageTool, createPhoneCallOfferTool, createSelectPaymentWalletTool, createSlackTools, createSlideTools, createWalletPaymentTool, createWeatherTool, createXTools, documentPath, exportAppToHtml, findById, findParentOfId, getFontByName, getId, getMCPEndpoints, getNumberAttr, getStringAttr, insertAfterId, insertChild, installAppCompleteIframeShim, isAnumaTag, isHtmlTag, isKnownFont, isLegacyDeckJson, isPdfTag, migrateDisplayResult, normalizePath, parseDocumentDsl, parseJsx, pdfStyleKeys, pdfTags, removeById, replaceById, serializeJsx, truncateContent, updateAttrs, walk };
2932
+ export { ADD_SLIDE_SCHEMA, APP_BUILDER_PROMPT, APP_COMPLETE_CONNECT_ACK_TYPE, APP_COMPLETE_CONNECT_TYPE, APP_COMPLETE_DEFAULT_TIMEOUT_MS, APP_COMPLETE_IFRAME_SHIM_SCRIPT, APP_COMPLETE_REQUEST_TYPE, APP_COMPLETE_RESPONSE_TYPE, APP_COMPLETE_STUB_SCRIPT, APP_FILE_TOOL_NAMES, APP_PREVIEW_BASELINE_CSS, AUDIT_DESIGN_SCHEMA, type AgentresAccount, type AgentresClient, type AgentresClientOptions, AgentresError, type AgentresErrorCode, type AgentresLinkStatus, type AgentresLinkStep, AgentresPathError, type AnchorMatch, type AnumaChild, AnumaJsxError, type AnumaNode, type AppCompleteBridge, type AppCompleteBridgeOptions, type AppFileRecord, type AppFileStorage, type AttrValue, type AuditIssue, type AuditIssueType, type AuditResult, type AuditSeverity, type AuditTokens, type BuildSlideSystemPromptOptions, CHOICE_TOOL_NAME, CONNECTOR_ERROR_MARKER, CREATE_DOCUMENT_SCHEMA, CREATE_FILE_SCHEMA, CRITIQUE_DESIGN_SCHEMA, type CalendarEvent, type ChartDataPoint, type ChoiceOption, type ConfirmParameter, type ConfirmToolResult, type ConnectorErrorCode, type ConnectorMintError, type ConnectorMintResult, type ConnectorTokenGetterOpts, type ConnectorTokenSource, type CreateAppGenerationToolsOptions, type CreateDocumentToolsOptions, type CreateEventArgs, type CreateFileArgs, type CreateSelectPaymentWalletToolOptions, type CreateSlideToolsOptions, type CreateUIToolsOptions, type CreateWalletPaymentToolOptions, type CreateWeatherToolOptions, DEFAULT_DESIGN_CRITIQUE_RUBRIC, DEFAULT_DOCUMENT_ID, DEFAULT_MAX_CONVERSATIONS, DEFAULT_MAX_DOCUMENT_CONVERSATIONS, DELETE_FILE_SCHEMA, DOCUMENT_BUILDER_PROMPT, DOCUMENT_TOOL_NAMES, type DisplayChartResult, type DisplayConnectorResult, type DisplayPhoneCallOfferResult, type DisplayToolConfig, type DisplayToolMigrations, type DisplayWeatherResult, type DocAttrValue, type DocChild, DocDslError, type DocNode, type DriveFile, type DropboxRequestAccess, type DropboxTokenGetter, type ExportAppOptions, FONT_LIBRARY, FONT_PRESETS, type FileChangeEvent, type FileSnippet, type FontCategory, type FontPreset, type FontSpec, type ForecastDay, type FormField, type FormFieldOption, type FormFieldType, type GetFileContentArgs, type GmailGetMessageArgs, type GmailMessageDetail, type GmailMessageSummary, type GmailRequestAccess, type GmailSearchArgs, type GmailSendConfirmation, type GmailSendMessageArgs, type GmailTokenGetter, type InteractiveToolConfig, type KnownTag, LAYOUT_MODES, LIST_FILES_SCHEMA, type LayoutMode, type LegacyDeckJson, type ListEventsArgs, type ListRecentFilesArgs, MapFileStorage, type NotionCreatePagesArgs, type NotionFetchArgs, type NotionMcpCaller, type NotionMovePagesArgs, type NotionSearchArgs, type NotionUpdatePageArgs, PATCH_DOCUMENT_SCHEMA, PATCH_FILE_SCHEMA, PATCH_SLIDES_SCHEMA, PLAN_DECK_SCHEMA, type PatchFailure, type PatchFailureReason, type PaymentWallet, type PdfTag, READ_DOCUMENT_SCHEMA, READ_FILE_SCHEMA, READ_SLIDES_SCHEMA, RUNTIME_ERROR_OVERLAY_SCRIPT, SELECT_PAYMENT_WALLET_TOOL_NAME, SLIDES_FILE_PATH, SLIDE_CANVAS_HEIGHT, SLIDE_CANVAS_WIDTH, type SearchFilesArgs, type SelectPaymentWalletResult, SiwxChallengeError, SiwxUnsupportedError, type SlackGetChannelHistoryArgs, type SlackGetThreadRepliesArgs, type SlackListChannelsArgs, type SlackListDmsArgs, type SlackListUsersArgs, type SlackPostMessageArgs, type SlackProxyCaller, type SlackSearchMessagesArgs, type SlideToolSet, type SolanaSignMessageFn, THEME_ATTRS, type ThemeAttr, type ToolConfig, type ToolExecutionErrorType, type ToolExecutionResult, type UIInteractionContext, type UpdateEventArgs, type UpdateFileArgs, VERIFY_APP_SCHEMA, type VerifyAppResult, WALLET_PAYMENT_TOOL_NAME, type WalletPaymentOutcome, type WalletPaymentPassenger, type WalletPaymentRequest, type WalletPaymentResult, type XGetMeArgs, type XGetMyPostsArgs, type XProxyCaller, applyPatches, auditDesign, buildAppFileManifest, buildAppSystemPrompt, buildConnectorErrorResult, buildDocumentSystemPrompt, buildFontsUrl, buildSlideSystemPrompt, callNotionMCPTool, connectorMintErrorToToolResult, convertLegacyDeckJson, createAgentresClient, createAppCompleteBridge, createAppGenerationTools, createChartTool, createChatTools, createChoiceTool, createConfirmTool, createConnectorOfferTool, createConnectorTokenGetter, createDisplayTool, createDocumentTools, createDriveTools, createDropboxTools, createFormTool, createGitHubTools, createGmailTools, createGoogleCalendarCreateEventTool, createGoogleCalendarTool, createGoogleCalendarUpdateEventTool, createGoogleDriveCreateFileTool, createGoogleDriveGetContentTool, createGoogleDriveListRecentTool, createGoogleDriveSearchTool, createGoogleDriveUpdateFileTool, createInteractiveTool, createNotionCreateCommentTool, createNotionCreateDatabaseTool, createNotionCreatePagesTool, createNotionDuplicatePageTool, createNotionFetchTool, createNotionGetCommentsTool, createNotionGetTeamsTool, createNotionGetUsersTool, createNotionMovePagesTool, createNotionProxyTools, createNotionSearchTool, createNotionTools, createNotionUpdateDataSourceTool, createNotionUpdatePageTool, createPhoneCallOfferTool, createSelectPaymentWalletTool, createSlackTools, createSlideTools, createWalletPaymentTool, createWeatherTool, createXTools, documentPath, exportAppToHtml, findById, findParentOfId, getFontByName, getId, getMCPEndpoints, getNumberAttr, getStringAttr, insertAfterId, insertChild, installAppCompleteIframeShim, isAnumaTag, isHtmlTag, isKnownFont, isLegacyDeckJson, isPdfTag, migrateDisplayResult, normalizePath, parseDocumentDsl, parseJsx, pdfStyleKeys, pdfTags, removeById, replaceById, serializeJsx, truncateContent, updateAttrs, walk };
@@ -4449,12 +4449,12 @@ function createGmailGetMessageTool(getToken, requestAccess) {
4449
4449
  }
4450
4450
  };
4451
4451
  }
4452
- function createGmailSendMessageTool(getToken, requestAccess) {
4452
+ function createGmailSendMessageTool(getToken, requestAccess, confirmSend) {
4453
4453
  return {
4454
4454
  type: "function",
4455
4455
  function: {
4456
4456
  name: "gmail_send_message",
4457
- description: "Sends a plaintext email from the user's Gmail account. Use only when the user has explicitly confirmed the recipient, subject, and body.",
4457
+ description: "Sends a plaintext email from the user's Gmail account. The host must confirm To, Cc, Bcc, subject, and body before each send.",
4458
4458
  parameters: {
4459
4459
  type: "object",
4460
4460
  properties: {
@@ -4482,18 +4482,24 @@ function createGmailSendMessageTool(getToken, requestAccess) {
4482
4482
  required: ["to", "subject", "body"]
4483
4483
  }
4484
4484
  },
4485
- executor: async (args) => {
4485
+ executorTimeout: Infinity,
4486
+ executor: confirmSend ? async (args, signal) => {
4487
+ const typed = Object.freeze({
4488
+ to: sanitizeHeaderValue(args.to),
4489
+ subject: sanitizeHeaderValue(args.subject),
4490
+ body: args.body,
4491
+ cc: args.cc ? sanitizeHeaderValue(args.cc) : void 0,
4492
+ bcc: args.bcc ? sanitizeHeaderValue(args.bcc) : void 0
4493
+ });
4494
+ if (await confirmSend(typed) !== true) {
4495
+ return "Error: Gmail message send was not confirmed.";
4496
+ }
4497
+ signal?.throwIfAborted();
4486
4498
  const resolved = await resolveToken3(getToken, requestAccess);
4487
4499
  if ("error" in resolved) return resolved.error;
4488
- const typed = {
4489
- to: args.to,
4490
- subject: args.subject,
4491
- body: args.body,
4492
- cc: args.cc,
4493
- bcc: args.bcc
4494
- };
4500
+ signal?.throwIfAborted();
4495
4501
  return sendGmailMessage(resolved.token, typed);
4496
- }
4502
+ } : void 0
4497
4503
  };
4498
4504
  }
4499
4505
  function createGmailDraftTool(getToken, requestAccess) {
@@ -4543,12 +4549,12 @@ function createGmailDraftTool(getToken, requestAccess) {
4543
4549
  }
4544
4550
  };
4545
4551
  }
4546
- function createGmailTools(getToken, requestAccess) {
4552
+ function createGmailTools(getToken, requestAccess, confirmSend) {
4547
4553
  return {
4548
4554
  gmail_search_messages: createGmailSearchTool(getToken, requestAccess),
4549
4555
  gmail_get_message: createGmailGetMessageTool(getToken, requestAccess),
4550
4556
  gmail_create_draft: createGmailDraftTool(getToken, requestAccess),
4551
- gmail_send_message: createGmailSendMessageTool(getToken, requestAccess)
4557
+ gmail_send_message: createGmailSendMessageTool(getToken, requestAccess, confirmSend)
4552
4558
  };
4553
4559
  }
4554
4560
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anuma/sdk",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",