1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,5944245,2962726,e=>{"use strict";var t=e.i(9681307),o=e.i(3995004);let r=t.z.enum([...Object.values(o.MothershipStreamV1ToolOutcome),"pending","executing","awaiting_approval","interrupted"]),i=t.z.object({id:t.z.string(),name:t.z.string(),state:r,activityDescription:t.z.string().optional(),params:t.z.record(t.z.string(),t.z.unknown()).optional(),result:t.z.object({success:t.z.boolean(),output:t.z.unknown().optional(),error:t.z.string().optional()}).optional(),error:t.z.string().optional(),calledBy:t.z.string().optional(),durationMs:t.z.number().optional(),display:t.z.object({title:t.z.string().optional()}).optional()}),a=t.z.object({type:t.z.union([t.z.enum(o.MothershipStreamV1EventType),t.z.literal("task")]),lane:t.z.enum(["main","subagent"]).optional(),agent:t.z.string().optional(),channel:t.z.enum(o.MothershipStreamV1TextChannel).optional(),phase:t.z.enum(o.MothershipStreamV1ToolPhase).optional(),kind:t.z.enum(o.MothershipStreamV1SpanPayloadKind).optional(),lifecycle:t.z.enum(o.MothershipStreamV1SpanLifecycleEvent).optional(),status:t.z.enum(o.MothershipStreamV1CompletionStatus).optional(),content:t.z.string().optional(),name:t.z.string().optional(),toolCall:i.optional(),task:t.z.object({taskId:t.z.string(),kind:t.z.enum(["timer","workflow_run"]),target:t.z.record(t.z.string(),t.z.unknown()),note:t.z.string(),status:t.z.enum(["pending","completed","failed","stopped","expired"]).optional(),summary:t.z.string().optional()}).optional(),timestamp:t.z.number().optional(),endedAt:t.z.number().optional(),error:t.z.string().optional(),parentToolCallId:t.z.string().optional(),spanId:t.z.string().optional(),parentSpanId:t.z.string().optional()});e.s(["persistedContentBlockSchema",0,a],5944245);var n=e.i(6396982);let s=t.z.enum(["search","sources","workflow","table","knowledgebase","file","dashboard","folder","filefolder","log","task","integration","browser","terminal","generic"]),l=t.z.object({query:t.z.string().trim().max(2e3),scope:t.z.discriminatedUnion("kind",[t.z.object({kind:t.z.literal("organization"),organizationId:t.z.string().min(1).max(200)}),t.z.object({kind:t.z.literal("workspace"),workspaceId:t.z.uuid()})]),filters:n.workspaceSearchFiltersSchema.optional(),topK:t.z.number().int().min(1).max(50).optional(),nativeQueries:n.nativeSearchQueriesSchema.optional()}),d=t.z.object({workspaceId:t.z.uuid().optional(),workspaceName:t.z.string().optional(),type:s,id:t.z.string().regex(/\S/),title:t.z.string().optional(),path:t.z.string().optional(),viewId:t.z.string().optional(),executionId:t.z.string().optional(),search:l.optional(),sources:t.z.object({messageId:t.z.string().min(1).max(200),requestId:t.z.string().min(1).max(200).optional()}).optional()}),c=t.z.object({type:t.z.literal("settings"),id:t.z.string().trim().min(1),scope:t.z.enum(["account","organization","workspace"]),workspaceId:t.z.uuid().optional(),organizationId:t.z.string().trim().min(1).optional()}),u=t.z.discriminatedUnion("op",[t.z.object({op:t.z.literal("upsert"),resource:d,readOnly:t.z.literal(!0).optional(),searchResult:t.z.object({actorUserId:t.z.string().min(1),data:n.workspaceKnowledgeSearchDataSchema}).optional()}),t.z.object({op:t.z.literal("remove"),resource:d}),t.z.object({op:t.z.literal("clear_view"),resource:t.z.object({type:t.z.literal("table"),workspaceId:t.z.uuid().optional(),id:t.z.string().regex(/\S/),viewId:t.z.string().regex(/\S/)})}),t.z.object({op:t.z.literal("refresh"),resource:t.z.union([t.z.object({type:s,workspaceId:t.z.uuid().optional(),id:t.z.string().regex(/\S/).optional()}),c])})]);t.z.array(u);let m=u.and(t.z.object({effectId:t.z.string().trim().min(1).max(512).optional(),replay:t.z.literal(!0).optional()}));e.s(["ResourceAddress",0,d,"ResourcePayload",0,m,"SearchResource",0,l],2962726)},4369045,1127948,2448180,e=>{"use strict";var t=e.i(9681307),o=e.i(5944245);e.i(6292695);var r=e.i(569803),i=e.i(8911397),a=e.i(8430890),n=e.i(2962726),s=e.i(1665656);let l=t.z.object({type:t.z.enum(s.PERSISTED_RESOURCE_TYPES),id:(0,i.requiredFieldSchema)("resource.id cannot be empty"),workspaceId:i.workspaceIdSchema.optional(),workspaceName:t.z.string().max(256).optional(),path:t.z.string().optional(),viewId:t.z.string().min(1).optional(),executionId:t.z.string().optional(),search:n.SearchResource.optional(),sources:n.ResourceAddress.shape.sources}).superRefine((e,t)=>
1{"sources"===e.type!=(void 0!==e.sources)&&t.addIssue({code:"custom",path:["sources"],message:"Source message is required only for sources resources"}),"search"===e.type!=(void 0!==e.search)&&t.addIssue({code:"custom",path:["search"],message:"Search metadata is required only for search resources"}),e.search&&e.workspaceId!==("workspace"===e.search.scope.kind?e.search.scope.workspaceId:void 0)&&t.addIssue({code:"custom",path:["workspaceId"],message:"Search scope must match its resource owner"}),void 0!==e.viewId&&"table"!==e.type&&t.addIssue({code:"custom",path:["viewId"],message:"viewId is only valid for table resources"})}),d=l.safeExtend({title:t.z.string()}),c=t.z.object({viewId:t.z.string().min(1).nullable(),filter:a.predicateInputSchema.nullable(),sort:a.sortSpecSchema.nullable()}).strict();l.safeExtend({type:t.z.enum(Object.values(s.MothershipResourceType)),title:t.z.string().optional(),active:t.z.boolean().optional(),currentView:c.optional(),url:t.z.string().max(2048).regex(/^https?:\/\//,"Must be an http(s) URL").optional()}),e.s(["mothershipResourceSchema",0,d],1127948);var u=e.i(5114438),m=e.i(3162366),p=e.i(8484136);let z=t.z.object({id:t.z.string(),displayKey:t.z.string(),name:t.z.string().nullable(),createdAt:t.z.string().nullable(),lastUsed:t.z.string().nullable()}),g=t.z.object({id:t.z.string().min(1)}),b=t.z.object({name:t.z.string().min(1,"Name is required").max(255,"Name is too long")}),h=t.z.object({chatId:t.z.string().uuid("Chat ID must be a valid UUID"),userQuery:t.z.string().min(1,"User query is required"),agentResponse:t.z.string().min(1,"Agent response is required"),isPositiveFeedback:t.z.boolean(),feedback:t.z.string().optional(),workflowYaml:t.z.string().optional()}),f=t.z.object({toolCallId:t.z.string().min(1,"Tool call ID is required"),executionId:t.z.string().min(1,"Execution ID is required").max(255).optional(),status:t.z.enum(Object.values(p.ASYNC_TOOL_CONFIRMATION_STATUS),{error:"Invalid notification status"}),message:t.z.string().optional(),data:t.z.unknown().optional()}),y=t.z.enum(["allow","allow_chat","always_allow","skip"]),w=t.z.object({decisions:t.z.array(t.z.object({toolCallId:t.z.string().min(1,"Tool call ID is required"),decision:y})).min(1,"At least one decision is required").max(50,"Too many decisions in one request")}),v=t.z.object({workspaceId:t.z.string().min(1),workflowId:t.z.string().min(1)}),I=t.z.object({chatId:(0,i.requiredFieldSchema)("chatId cannot be empty"),resource:d,clearViewId:t.z.literal(!0).optional()}).superRefine((e,t)=>{!0===e.clearViewId&&("table"!==e.resource.type&&t.addIssue({code:"custom",path:["clearViewId"],message:"clearViewId is only valid for table resources"}),void 0!==e.resource.viewId&&t.addIssue({code:"custom",path:["resource","viewId"],message:"viewId must be omitted when clearViewId is true"}))}),k=t.z.object({workspaceId:i.workspaceIdSchema.optional(),chatId:t.z.string(),resourceType:d.shape.type,resourceId:t.z.string()}),x=t.z.object({chatId:t.z.string(),resources:t.z.array(d)}),j=t.z.object({streamId:t.z.string().optional(),chatId:t.z.string().optional(),workspaceId:t.z.string().min(1).optional(),organizationId:t.z.string().min(1).optional()}).refine(e=>!(e.workspaceId&&e.organizationId),{message:"Choose either workspaceId or organizationId, not both",path:["organizationId"]}),S=t.z.object({streamId:t.z.string().min(1,"streamId is required"),chatId:t.z.string().min(1,"chatId is required"),steeringId:t.z.string().min(1,"steeringId is required"),content:t.z.string().min(1,"content is required").max(32768,"content is too long")});t.z.object({requestMode:t.z.enum(["assistant","agent","build","plan"]).optional(),assistantSearch:r.workspaceSearchFiltersSchema.optional(),targetWorkspaceId:i.workspaceIdSchema.optional(),toolCallId:t.z.string().min(1,"toolCallId is required"),toolName:t.z.string().min(1,"toolName is required"),params:t.z.record(t.z.string(),t.z.unknown()).default({}),userId:t.z.string().min(1,"userId is required"),workflowId:t.z.string().optional(),workspaceId:t.z.string().optional(),organizationId:t.z.string().min(1).max(200).optional(),chatId:t.z.string().optional(),messageId:t.z.string().optional(),parentToolCallId:t.z.string().optional(),userPermission:t.z.string().optional()}).refine(e=>!e.organizationId||!e.workspaceId&&!e.workflowId&&("assistant"===e.requestMode||"agent"===e.requestMode)&&!!e.chatId,{message:"Organization tools require an explicit mode and a private chat without workspace or workflow owner scope"}),t.z.object({workflowId:t.z.string().optional(),workspaceId:t.z.string().optional(),chatId:t.z.string().optional()}).passthrough();let C=t.z.object({streamId:t.z.string().optional().default(""),after:t.z.string().optional().default(""),batch:t.z.string().optional().transform(e=>"true"===e),source:t.z.enum(["ring","log"]).optional()}),q=t.z.object({chatId:t.z.string(),streamId:t.z.string(),content:t.z.string().default(""),contentBlocks:t.z.array(o.persistedContentBlockSchema).optional(),requestId:t.z.string().optional()}),D=t.z.object({chatId:t.z.string()}),_=t.z.object({"x-sim-billing-account-decision":t.z.string().max(2048).optional(),"x-sim-billing-protocol":t.z.enum(["attribution-v1","direct-v1","legacy-v0"]).optional(),"x-sim-billing-request-id":t.z.string().uuid().optional(),"x-sim-billing-attribution":t.z.string().max(8192).optional()}),E=t.z.object({error:t.z.string().min(1).max(500),details:t.z.array(t.z.unknown()).optional()}).strict(),R=t.z.object({userId:t.z.string().min(1,"userId is required"),purpose:t.z.enum(["new-turn","continuation","cancellation"]).default("new-turn"),workspaceId:t.z.string().min(1).optional(),organizationId:t.z.string().min(1).max(200).optional(),chatId:t.z.string().min(1).max(200).optional()}).refine(e=>!(e.workspaceId&&e.organizationId),{message:"workspaceId and organizationId are mutually exclusive"}),O=t.z.object({isEnterprise:t.z.boolean()}),T=t.z.object({code:t.z.literal("USAGE_LIMIT_EXCEEDED"),error:t.z.string(),usageUpgrade:u.usageUpgradePayloadSchema}),L=t.z.object({code:t.z.literal("BILLING_BLOCKED"),error:t.z.string()}),P=t.z.union([T,L]),A=(0,m.defineRouteContract)({method:"GET",path:"/api/copilot/api-keys",response:{mode:"json",schema:t.z.object({keys:t.z.array(z)})}}),M=t.z.object({id:t.z.string(),title:t.z.string().nullable(),workflowId:t.z.string().nullable().optional(),workspaceId:t.z.string().nullable().optional(),activeStreamId:t.z.string().nullable(),updatedAt:t.z.string().nullable()}),U=(0,m.defineRouteContract)({method:"GET",path:"/api/copilot/chats",response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),chats:t.z.array(M)})}}),B=(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/api-keys/generate",body:b,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),key:t.z.object({id:t.z.string(),apiKey:t.z.string()})})}}),N=(0,m.defineRouteContract)({method:"DELETE",path:"/api/copilot/api-keys",query:g,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0)})}}),G=(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/feedback",body:h,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),feedbackId:t.z.string(),message:t.z.string(),metadata:t.z.object({requestId:t.z.string(),duration:t.z.number()})})}}),V=t.z.object({success:t.z.literal(!0)});(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/api-keys/validate",headers:_,body:R,response:{mode:"json",schema:O,status:[200,402],statusSchemas:{200:O,402:P.optional()}},error:E});let F=t.z.object({workspaceId:t.z.string().min(1,"workspaceId is required"),userId:t.z.string().min(1,"userId is required")});(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/byok/validate",body:F,response:{mode:"empty"}});let K=(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/chats",body:v,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),id:t.z.string()})}});(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/confirm",body:f,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),message:t.z.string(),toolCallId:t.z.string(),status:t.z.string()})}});let H=(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/tool-permission",body:w,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),results:t.z.array(t.z.object({toolCallId:t.z.string(),decision:y,applied:t.z.boolean()}))})}});(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/chat/resources",body:I,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),resources:t.z.array(d).optional()})}}),(0,m.defineRouteContract)({method:"PATCH",path:"/api/copilot/chat/resources",body:x,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),resources:t.z.array(d)})}}),(0,m.defineRouteContract)({method:"DELETE",path:"/api/copilot/chat/resources",body:k,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),resources:t.z.array(d)})}}),(0,m.defineRouteContract)({method:"GET",path:"/api/copilot/chat/stream",query:C,response:{mode:"stream"}}),(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/chat/stop",body:q,response:{mode:"json",schema:V}});let Q=(0,m.defineRouteContract)({method:"DELETE",path:"/api/copilot/chat/delete",body:D,response:{mode:"json",schema:V}}),W=(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/chat/abort",headers:t.z.object({traceparent:t.z.string().max(512).optional()}),body:j.safeExtend({streamId:t.z.string().min(1,"streamId is required")}),response:{mode:"json",schema:t.z.object({aborted:t.z.boolean(),settled:t.z.boolean(),forceReleased:t.z.boolean().optional()})}});(0,m.defineRouteContract)({method:"POST",path:"/api/copilot/chat/steer",body:S,response:{mode:"json",schema:t.z.object({ok:t.z.boolean(),queued:t.z.boolean(),goStatus:t.z.number().optional()})}}),e.s(["addCopilotChatResourceBodySchema",0,I,"copilotChatAbortContract",0,W,"copilotToolPermissionContract",0,H,"createWorkflowCopilotChatContract",0,K,"deleteCopilotApiKeyContract",0,N,"deleteCopilotChatContract",0,Q,"generateCopilotApiKeyContract",0,B,"listCopilotApiKeysContract",0,A,"listCopilotChatsContract",0,U,"submitCopilotFeedbackContract",0,G],4369045);let Z=t.z.enum(["all","selected"]),$=t.z.string().trim().min(1).max(1024),X=t.z.array($).max(100);t.z.object({secretScope:Z,mountedSecrets:X}).partial(),e.s(["mountedSecretNamesSchema",0,X,"secretMountScopeSchema",0,Z],2448180)},6292695,8272469,569803,e=>{"use strict";var t=e.i(9681307);let o={google_drive:{origin:"https://www.googleapis.com",credentialProviderIds:["google-drive","google-docs","google-sheets","google-slides"],modes:["member","service_account"]},gmail:{origin:"https://gmail.googleapis.com",credentialProviderIds:["google-email","gmail"],modes:["member","service_account"]},google_meet:{origin:"https://meet.googleapis.com",credentialProviderIds:["google-meet"],modes:["member"]},zoom:{origin:"https://mcp.zoom.us",credentialProviderIds:["mcp:zoom"],modes:["member"]},google_calendar:{origin:"https://www.googleapis.com",credentialProviderIds:["google-calendar"],modes:["member","service_account"]},slack:{origin:"https://slack.com",credentialProviderIds:["slack"],modes:["member"]},jira:{origin:"https://api.atlassian.com",credentialProviderIds:["jira"],modes:["member"]},confluence:{origin:"https://api.atlassian.com",credentialProviderIds:["confluence"],modes:["member","service_account"]},github:{origin:"https://api.github.com",credentialProviderIds:["github-repositories"],modes:["member","service_account"]},gitlab:{origin:"https://gitlab.com",credentialProviderIds:["gitlab"],modes:["service_account"]},linear:{origin:"https://api.linear.app",credentialProviderIds:["linear"],modes:["member"]},lucid:{origin:"https://mcp.lucid.app",credentialProviderIds:["mcp:lucid"],modes:["member"]},hubspot:{origin:"https://mcp.hubspot.com",credentialProviderIds:["mcp:hubspot"],modes:["member"]},fireflies:{origin:"https://api.fireflies.ai",credentialProviderIds:["mcp:fireflies"],modes:["member"]},granola:{origin:"https://mcp.granola.ai",credentialProviderIds:["mcp:granola"],modes:["member"]},notion:{origin:"https://mcp.notion.com",credentialProviderIds:["mcp:notion"],modes:["member"]},coda:{origin:"https://coda.io",credentialProviderIds:["coda-service-account"],modes:["member","service_account"]}},r=Object.keys(o);e.s(["LIVE_SEARCH_PROVIDER_CATALOG",0,o,"LIVE_SEARCH_PROVIDER_IDS",0,r,"liveSearchProviderForCredential",0,function(e){return r.find(t=>o[t].credentialProviderIds.includes(e))},"supportsLiveSearchMode",0,function(e,t){return o[e].modes.includes(t)}],8272469);let i=t.z.enum(r),a={github:t.z.enum(["issues","code","repositories","commits"]),gitlab:t.z.enum(["issues","code","merge_requests","wiki"]),hubspot:t.z.enum(["contacts","companies","deals","tickets"]),lucid:t.z.enum(["lucidchart","lucidspark"]),google_meet:t.z.enum(["transcript","smart_notes"]),zoom:t.z.enum(["meeting"])};function n(e){return Object.hasOwn(a,e)}let s=t.z.enum([...a.github.options,...a.gitlab.options,...a.hubspot.options,...a.lucid.options,...a.google_meet.options,...a.zoom.options]),l=t.z.object({provider:i,query:t.z.string().trim().max(2e3),accountId:t.z.string().min(1).max(200).optional(),kind:s.optional(),project:t.z.string().min(1).max(300).optional(),browse:t.z.enum(["folder","private","shared","favorites","re
1cent"]).optional().describe("Queryless discovery: Lucid folder lists one folder page (omit project for root; otherwise use a returned numeric folder ID). Notion private/shared list sidebar pages, favorites lists pinned pages, recent lists recently viewed pages, not recently modified pages. These lists are not an exhaustive workspace inventory. Follow the returned cursor with the same account, browse mode, project, filters and topK."),cursor:t.z.string().max(4e3).optional(),termClauses:t.z.array(t.z.string().max(500)).max(10).optional(),modifiers:t.z.string().max(1e3).optional(),keywordOnly:t.z.boolean().optional()}).strict().superRefine((e,t)=>{if(e.kind){let o=n(e.provider)?a[e.provider]:null;o?.safeParse(e.kind).success||t.addIssue({code:"custom",path:["kind"],message:o?`${e.provider} kind must be one of: ${o.options.join(", ")}.`:`${e.provider} does not support kind selection.`})}e.browse&&(e.query||e.modifiers||e.keywordOnly||e.termClauses?.length||("folder"===e.browse?"lucid"!==e.provider:"notion"!==e.provider)||"notion"===e.provider&&e.project)&&t.addIssue({code:"custom",path:["browse"],message:"Browse requires an empty query and a supported provider mode; Notion lists cannot be scoped to a page."}),"folder"===e.browse&&e.project&&!/^[1-9]\d{0,14}$/.test(e.project)&&t.addIssue({code:"custom",path:["project"],message:"Lucid folder browsing requires a numeric folder ID returned by the provider."}),"lucid"!==e.provider||e.query||e.browse||t.addIssue({code:"custom",path:["query"],message:"Lucid requires title keywords or explicit browse: folder."})}),d=t.z.array(l).min(1).max(9).superRefine((e,t)=>{let o=(e,t)=>e.provider===t.provider&&(!e.accountId||!t.accountId||e.accountId===t.accountId),r=e=>{let t=new Map;for(let{accountId:o}of e)o&&t.set(o,(t.get(o)??0)+1);return e.filter(({accountId:e})=>!e).length+Math.max(0,...t.values())},i=({accountId:e,kind:t,...o})=>JSON.stringify({...o,kind:n(o.provider)?t:void 0});for(let[a,s]of e.entries()){let l=e=>t.addIssue({code:"custom",path:[a],message:e}),d=e.slice(0,a).filter(e=>o(e,s));d.some(e=>i(e)===i(s))?l("Duplicate native query."):n(s.provider)&&d.some(e=>!e.browse&&!s.browse&&(!e.kind||!s.kind))?l("A GitHub, GitLab, HubSpot, Lucid, Google Meet, or Zoom query without a kind already searches its default kinds; give each query on this account a kind."):r(d)>=4&&l("Send at most 4 native queries per provider account in one call; queries without an accountId count toward every account of their provider.")}}),c=t.z.object({accountId:t.z.string(),provider:i,queryIndex:t.z.number().int().min(0).optional(),displayName:t.z.string(),status:t.z.enum(["ok","partial","reconnect","rate_limited","unavailable","timeout"]),message:t.z.string().optional(),nextCursor:t.z.string().optional(),folders:t.z.array(t.z.object({id:t.z.string(),name:t.z.string()})).max(10).optional(),retryAfterSeconds:t.z.number().optional()}),u=t.z.object({backend:t.z.literal("live"),accounts:t.z.array(c),guidance:t.z.string()}),m=t.z.object({startDate:t.z.string().datetime({offset:!0}).optional().describe('Live search: inclusive lower date bound. For a specific day or bounded date range, always supply endDate too, including exact-title lookups; startDate alone means an open-ended "since" search. Calendar, Google Meet, Zoom, Fireflies and Granola use event or meeting start; Gmail/Slack use message time; other sources use modification time. Include the userâs timezone offset.'),endDate:t.z.string().datetime({offset:!0}).optional().describe("Live search: exclusive upper date bound. Include this with startDate whenever the request names a specific day or bounded range, even if the title uniquely identifies a result. For whole days, startDate is local midnight on the first included day and endDate is local midnight after the final included day. Preserve the timezone offset at each boundary."),sortBy:t.z.enum(["relevance","newest","oldest"]).optional().describe("Live search ordering by relevance or the provider date used by startDate/endDate. Date sorting covers retrieved results; inspect partial coverage before claiming latest or earliest overall. Without search terms or dates, newest or oldest lists items up to now."),source:t.z.string().trim().min(1,"Source cannot be empty").max(100).optional().describe("Connector type or upload source; narrows the selected search scope."),modifiedAfter:t.z.string().datetime({offset:!0}).optional().describe("ISO datetime; restricts results to documents modified after this time."),modifiedBefore:t.z.string().datetime({offset:!0}).optional().describe("ISO datetime; restricts results to documents modified before this time."),documentIds:t.z.array(t.z.string().min(1).max(4e3)).min(1).max(20).optional().describe("Document IDs returned by search or selected by the user; narrows retrieval to these documents.")});m.extend({nativeQueries:d.optional().describe("Live search only: queries in a provider's own language (Drive q, Gmail operators, JQL, CQL, GitHub qualifiers, Slack RTS, plain Linear/Fireflies/HubSpot/Lucid/Zoom terms, bounded local Google Meet text matching, Granola natural-language questions, Notion keywords or AI questions when available). Blank queries require a date bound, sortBy newest/oldest, or explicit browse mode. Lucid browse folder lists root or a numeric folder project; Notion browse private/shared/favorites/recent lists sidebar pages. Recent means viewed, not modified. Up to 4 per account run separately and merge; one GitHub, GitLab, or HubSpot query without a kind searches GitHub issues (plus code when the query has no date bound or boolean operators, as its status message says), GitLab issues, merge requests, and code, or every HubSpot
1CRM kind; other collections, and multiple content queries on one account, each need a kind, which may repeat; explicit browse queries may select distinct folders or sidebar sections without a kind. HubSpot kinds are contacts, companies, deals, and tickets; Lucid kinds are lucidchart and lucidspark. Google Meet kinds are transcript and smart_notes (note metadata and Docs link only); it searches bounded recent conference artifacts with 30-day retention. Zoom kind is meeting and searches past occurrences; read for transcripts and separately labeled summaries. Use Drive for saved Meet note bodies and older transcripts; Drive dates mean file modification time. HubSpot, Lucid, Zoom and Meet reject ownership filters. Lucid title search has no continuation; folder browsing is paginated and returns child folders in account coverage; project can scope a literal shape-text query to one known document UUID or Lucid URL. Read for structured diagram evidence. Dates and sorting cover only retrieved candidates, not globally newest/oldest matches. Write queries from the returned live guidance and account IDs; each account status names the queryIndex its cursor belongs to. Omit for simple cross-provider terms."),query:t.z.string().trim().max(2e3).default("").describe("Search terms, without dates already supplied as filters. May be empty for a live listing with a date bound or sortBy newest or oldest where supported, or use an explicit native browse mode. Notion date-only search depends on plan capabilities."),topK:t.z.number().int().min(1).max(50).default(20).describe("Maximum matching passage previews; retrieval ranking is independent of preview length.")}).superRefine((e,t)=>{let o=!!(e.startDate||e.endDate||e.modifiedAfter||e.modifiedBefore||"newest"===e.sortBy||"oldest"===e.sortBy);e.query||e.nativeQueries?.some(e=>e.query||e.browse)||o||t.addIssue({code:"custom",path:["query"],message:"Supply search terms, a native query, a date bound, or sortBy newest or oldest."}),e.startDate&&e.endDate&&Date.parse(e.startDate)>=Date.parse(e.endDate)&&t.addIssue({code:"custom",path:["endDate"],message:"endDate must be after startDate."}),e.nativeQueries?.some(e=>!e.query&&!e.browse)&&!o&&t.addIssue({code:"custom",path:["nativeQueries"],message:"Empty native queries require a date bound or sortBy newest or oldest."})}),t.z.object({documentId:t.z.string().min(1).max(4e3).describe("Canonical document ID returned by search or selected document context."),limit:t.z.preprocess(e=>"number"==typeof e&&e>8?8:e,t.z.number().int().min(1).max(8)).default(3).describe("Maximum number of chunks, from 1 to 8 (default 3); the server may return fewer to fit its text budget. Follow next for more context."),startChunkIndex:t.z.number().int().min(0).max(0x7fffffff).optional().describe("Inclusive chunk index from search or a prior read next object. Disabled chunk gaps are skipped."),startOffset:t.z.number().int().min(0).max(0x7fffffff).optional().describe("UTF-16 character offset within startChunkIndex. Copy next.startOffset to continue a partial chunk.")}),t.z.object({providerName:t.z.string().min(1).describe("Integration provider value (for example google-email or slack), or its service display name. Avoid ambiguous base providers such as google."),credentialId:t.z.string().optional().describe("Existing owned credential ID, only when the user requests reconnect or repair. Omit when adding another account.")}),t.z.object({workspaceId:t.z.string().uuid().optional().describe("Exact workspace ID to revalidate, when known."),query:t.z.string().trim().max(200).optional().describe("Case-insensitive workspace name filter."),limit:t.z.number().int().min(1).max(100).default(50),cursor:t.z.string().uuid().optional().describe("Copy nextCursor from the preceding page.")});let p=t.z.discriminatedUnion("capabilityDetail",[t.z.object({capabilityDetail:t.z.literal("full"),capabilities:t.z.record(t.z.string(),t.z.boolean())}),t.z.object({capabilityDetail:t.z.literal("restrictions"),copilotAllowed:t.z.boolean(),deniedCapabilities:t.z.array(t.z.string()).describe("Static capabilities explicitly with
1held by current workspace policy. Absence does not grant an operation; use exact workspaceId for the full map.")})]);t.z.object({success:t.z.literal(!0),workspaces:t.z.array(t.z.object({id:t.z.uuid(),name:t.z.string(),role:t.z.enum(["read","write","admin"])}).and(p)),nextCursor:t.z.uuid().nullable(),storedNotes:t.z.array(t.z.object({id:t.z.string(),kind:t.z.enum(["user_pref","workspace_fact"]),content:t.z.string(),updatedAt:t.z.iso.datetime()})).optional()});let z=t.z.object({documentId:t.z.string(),knowledgeBaseId:t.z.string(),knowledgeBaseName:t.z.string(),documentName:t.z.string().nullable(),sourceUrl:t.z.string().nullable(),connectorType:t.z.string().nullable(),sourceModifiedAt:t.z.string().nullable(),sourceDate:t.z.string().nullable().optional(),sourceContainerName:t.z.string().optional(),sourceContainerUrl:t.z.string().optional(),sourceDateType:t.z.enum(["event_start","message","modified"]).optional(),author:t.z.string().nullable(),content:t.z.string(),chunkIndex:t.z.number(),similarity:t.z.number()}),g=t.z.object({live:u.optional(),query:t.z.string(),results:t.z.array(z),retrieval:t.z.object({status:t.z.enum(["complete","partial"]),timedOutLegs:t.z.array(t.z.enum(["vector","keyword","tags"])).max(3)})});e.s(["nativeSearchQueriesSchema",0,d,"workspaceKnowledgeSearchDataSchema",0,g,"workspaceSearchFiltersSchema",0,m],569803);var b=e.i(8911397),h=e.i(3162366),f=e.i(5112343),y=e.i(2138584);let w=t.z.object({tagName:t.z.string(),tagSlot:t.z.string().optional(),fieldType:t.z.enum(["text","number","date","boolean"]).optional(),operator:t.z.string().default("eq"),value:t.z.union([t.z.string(),t.z.number(),t.z.boolean()]),valueTo:t.z.union([t.z.string(),t.z.number()]).optional()}),v=t.z.enum(["vector","hybrid"]).optional().nullable().transform(e=>e??void 0),I=t.z.object({knowledgeBaseIds:t.z.union([t.z.string().min(1,"Knowledge base ID is required"),t.z.array(t.z.string().min(1)).min(1,"At least one knowledge base ID is required")]),query:t.z.string().optional().nullable().transform(e=>e||void 0),topK:t.z.number().min(1).max(100).optional().nullable().default(10).transform(e=>e??10),tagFilters:t.z.array(w).optional().nullable().transform(e=>e||void 0),searchMode:v,rerankerEnabled:t.z.boolean().optional().default(!1),rerankerModel:y.rerankerModelSchema.optional().default(y.DEFAULT_RERANKER_MODEL),rerankerInputCount:t.z.number().int("rerankerInputCount must be an integer").min(1,"rerankerInputCount must be at least 1").max(100,"rerankerInputCount cannot exceed 100").optional().nullable().transform(e=>e??void 0),rerankerApiKey:t.z.string().optional().nullable().transform(e=>e||void 0)}).refine(e=>{let t=e.query&&e.query.trim().length>0,o=e.tagFilters&&e.tagFilters.length>0;return t||o},{message:"Please provide either a search query or tag filters to search your knowledge base"}),k=t.z.intersection(I,t.z.object({workflowId:t.z.string().optional(),skipUsageBilling:t.z.boolean().optional(),[f.RESOLVED_SECRET_PROVENANCE_FIELD]:b.resolvedSecretTraceProvenanceSchema.optional()})),x=t.z.object({documentId:t.z.string(),documentName:t.z.string().nullable(),sourceUrl:t.z.string().nullable(),content:t.z.string(),chunkIndex:t.z.number(),metadata:t.z.record(t.z.string(),t.z.unknown()),similarity:t.z.number().describe("Cosine similarity between the query embedding and the chunk (1 - cosine distance), in every search mode; 1 for tag-only matches. In hybrid mode this is not the ordering key â see rankScore."),rankScore:t.z.number().describe("The score results are ordered by, descending: the reciprocal-rank-fusion score in hybrid mode (a sum of 1/(60 + rank) per retrieval leg), the cosine similarity in vector mode, or rerankerScore when a reranker ordered the results."),rank:t.z.number().int().positive().describe("1-based position in the returned order."),rerankerScore:t.z.number().optional()});(0,h.defineRouteContract)({method:"POST",path:"/api/knowledge/search",body:k,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),data:t.z.object({results:t.z.array(x),query:t.z.string(),knowledgeBaseIds:t.z.array(t.z.string()),knowledgeBaseId:t.z.string(),topK:t.z.number(),totalResults:t.z.number(),cost:t.z.object({input:t.z.number(),output:t.z.number(),total:t.z.number(),tokens:t.z.object({prompt:t.z.number(),completion:t.z.number(),total:t.z.number()}),model:t.z.string(),pricing:t.z.object({input:t.z.number(),output:t.z.number(),updatedAt:t.z.string().optional()}),rerankerCost:t.z.number().optional(),rerankerModel:t.z.string().optional(),rerankerSearchUnits:t.z.number().optional()}).optional()})})}});let j=b.resourceOwnerSchema.safeExtend({filters:m.optional(),query:t.z.string().trim().max(2e3,"Query is too long").default(""),topK:t.z.number().int().min(1).max(50).optional().default(20),nativeQueries:d.optional()}).superRefine((e,t)=>
1{let{modifiedAfter:o,modifiedBefore:r,startDate:i,endDate:a,sortBy:n}=e.filters??{};e.query||e.nativeQueries?.some(e=>e.query)||i||a||o||r||"newest"===n||"oldest"===n||t.addIssue({code:"custom",path:["query"],message:"A search query, native query, date bound, or newest or oldest sort is required"}),i&&a&&Date.parse(a)<=Date.parse(i)&&t.addIssue({code:"custom",path:["filters","endDate"],message:"endDate must be after startDate"}),o&&r&&Date.parse(r)<Date.parse(o)&&t.addIssue({code:"custom",path:["filters","modifiedBefore"],message:"modifiedBefore must not precede modifiedAfter"})}),S=(0,h.defineRouteContract)({method:"POST",path:"/api/knowledge/search",body:j,response:{mode:"json",schema:t.z.object({success:t.z.literal(!0),data:g})}});e.s(["searchWorkspaceKnowledgeContract",0,S],6292695)},5114438,6525597,e=>{"use strict";var t=e.i(9681307),o=e.i(8911397),r=e.i(3162366);let i=t.z.object({context:t.z.enum(["user","organization"]).optional().default("user"),userId:t.z.string().optional(),organizationId:t.z.string().optional(),memberLimit:t.z.coerce.number().int().min(1).max(100).default(50),memberOffset:t.z.coerce.number().int().min(0).default(0)}),a=t.z.object({limit:t.z.number().min(0,"Limit must be a non-negative number"),context:t.z.enum(["user","organization"]).optional().default("user"),organizationId:t.z.string().optional()}).refine(e=>"organization"!==e.context||e.organizationId,{message:"Organization ID is required when context is organization"}),n=t.z.object({creditLimit:t.z.number().int("Credit limit must be a whole number of credits").min(0,"Credit limit cannot be negative").nullable()});e.s(["memberCreditLimitUpdateSchema",0,n,"usageLimitReadSchema",0,i,"usageLimitUpdateSchema",0,a],6525597);let s={attributed:"attribution-v1",direct:"direct-v1",previous:"legacy-v0"},l="x-sim-billing-protocol",d="x-sim-billing-request-id",c="x-sim-billing-attribution",u="x-sim-billing-account-decision",m=t.z.object({userId:t.z.string().min(1,"User ID is required"),cost:t.z.number().min(0,"Cost must be a non-negative number"),model:t.z.string().min(1,"Model is required"),inputTokens:t.z.number().min(0).default(0),outputTokens:t.z.number().min(0).default(0),source:t.z.enum(["copilot","workspace-chat","mcp_copilot","mothership_block"]).default("copilot"),idempotencyKey:t.z.string().min(1,"Idempotency key is required"),workspaceId:t.z.string().min(1).optional(),organizationId:t.z.string().min(1).max(200).optional()}).refine(e=>!(e.workspaceId&&e.organizationId),{message:"workspaceId and organizationId are mutually exclusive"}),p=t.z.object({[l]:t.z.enum(Object.values(s)).optional(),[d]:t.z.string().uuid().optional(),[c]:t.z.string().min(1).max(8192).optional(),[u]:t.z.string().min(1).max(2048).optional()}).superRefine((e,t)=>{let o=e[l],r=e[d],i=e[c],a=e[u],n=!1;switch(o){case void 0:n=!r&&!i&&!a;break;case s.attributed:n=!!(r&&i&&!a);break;case s.direct:n=!!(r&&a&&!i);break;case s.previous:n=!!(i&&!r&&!a)}n||t.addIssue({code:"custom",message:"Incomplete or conflicting billing protocol headers"})}),z=t.z.object({reason:t.z.literal("usage_limit"),action:t.z.enum(["upgrade_plan","increase_limit"]),message:t.z.string().min(1).max(1e3)});t.z.object({success:t.z.boolean(),code:t.z.string().optional(),usageExceeded:t.z.boolean().optional(),usageUpgrade:z.optional().catch(void 0)}),t.z.object({code:t.z.literal("USAGE_LIMIT_EXCEEDED"),usageUpgrade:z.optional().catch(void 0)});let g=t.z.strictObject({id:t.z.uuid(),streamId:t.z.uuid(),toolCallId:t.z.string().min(1).max(500),service:t.z.string().min(1).max(100),costUsd:t.z.number().finite().nonnegative()});t.z.strictObject({receipts:t.z.array(g).min(1).max(100)}),t.z.strictObject({accepted:t.z.array(t.z.uuid()).max(100)});let b=t.z.preprocess(e=>"true"===e||"false"!==e&&e,t.z.boolean()).optional().default(!1),h=t.z.object({targetPlanName:t.z.string(),interval:t.z.enum(["month","year"]).optional(),workspaceId:o.workspaceIdSchema.optional()}),f=t.z.object({context:t.z.enum(["user","organization"]).optional().default("user"),id:t.z.string().min(1).optional(),includeOrg:b,memberLimit:t.z.coerce.number().int().min(1).max(100).default(50),memberOffset:t.z.coerce.number().int().min(0).default(0)}),y=t.z.object({current:t.z.number(),limit:t.z.number(),percentUsed:t.z.number(),isWarning:t.z.boolean(),isExceeded:t.z.boolean(),billingPeriodStart:t.z.string().nullable(),billingPeriodEnd:t.z.string().nullable(),lastPeriodCost:t.z.number(),lastPeriodCopilotCost:t.z.number(),daysRemaining:t.z.number(),copilotCost:t.z.number()}).passthrough(),w=t.z.object({type:t.z.enum(["individual","organization"]),plan:t.z.string(),currentUsage:t.z.number(),usageLimit:t.z.number(),percentUsed:t.z.number(),isWarning:t.z.boolean(),isExceeded:t.z.boolean(),daysRemaining:t.z.number(),creditBalance:t.z.number(),billingInterval:t.z.enum(["month","year"]),isPaid:t.z.boolean(),isPro:t.z.boolean(),isTeam:t.z.boolean(),isEnterprise:t.z.boolean(),isOrgScoped:t.z.boolean(),organizationId:t.z.string().nullable(),status:t.z.string().nullable(),seats:t.z.number().nullable(),metadata:t.z.unknown().nullable(),stripeSubscriptionId:t.z.string().nullable(),periodEnd:t.z.string().nullable(),cancelAtPeriodEnd:t.z.boolean(),usage:y,billingBlocked:t.z.boolean(),billingBlockedReason:t.z.enum(["payment_failed","dispute"]).nullable(),blockedByOrgOwner:t.z.boolean(),upgradeWorkspaceId:o.workspaceIdSchema.nullable(),organization:t.z.object({id:t.z.string(),role:t.z.enum(["owner","admin","member"])}).optional()}).passthrough(),v=t.z.object({success:t.z.boolean(),context:t.z.string(),data:w}).passthrough(),I=t.z.object({id:t.z.string().optional(),userId:t.z.string().optional(),userName:t.z.string().nullable().optional(),userEmail:t.z.string().nullable().optional(),joinedAt:t.z.string().nullable().optional()}).passthrough(),k=t.z.object({organizationId:t.z.string(),organizationName:t.z.string(),subscriptionState:t.z.enum(["active","free","lapsed"]),hasSubscription:t.z.boolean(),subscriptionPlan:t.z.string(),subscriptionStatus:t.z.string().nullable(),creditBalance:t.z.number(),billingInterval:t.z.enum(["month","year"]),cancelAtPeriodEnd:t.z.boolean(),totalSeats:t.z.number(),usedSeats:t.z.number(),seatsCount:t.z.number(),totalCurrentUsage:t.z.number(),totalUsageLimit:t.z.number(),minimumBillingAmount:t.z.number(),averageUsagePerMember:t.z.number(),billingPeriodStart:t.z.string().nullable(),billingPeriodEnd:t.z.string().nullable(),membersTotal:t.z.number().int().min(0),memberPagination:t.z.object({total:t.z.number().int().min(0),limit:t.z.number().int().min(1).max(100),offset:t.z.number().int().min(0),hasMore:t.z.boolean()}),members:t.z.array(I),billingBlocked:t.z.boolean(),billingBlockedReason:t.z.enum(["payment_failed","dispute"]).nullable(),blockedByOrgOwner:t.z.boolean(),upgradeWorkspaceId:o.workspaceIdSchema.nullable()}).passthrough(),x=t.z.object({success:t.z.boolean(),context:t.z.literal("organization"),data:k,userRole:t.z.enum(["owner","admin","member"]),billingBlocked:t.z.boolean(),billingBlockedReason:t.z.enum(["payment_failed","dispute"]).nullable(),blockedByOrgOwner:t.z.boolean()}).passthrough(),j=t.z.object({currentLimit:t.z.number(),canEdit:t.z.boolean(),minimumLimit:t.z.number(),plan:t.z.string(),updatedAt:t.z.string().nullable(),scope:t.z.enum(["user","organization"]),organizationId:t.z.string().nullable()}).passthrough(),S=t.z.object({success:t.z.boolean(),context:t.z.string(),userId:t.z.string(),organizationId:t.z.string().nullable(),data:j}).passthrough(),C=t.z.object({success:t.z.boolean(),context:t.z.literal("organization"),userId:t.z.string(),organizationId:t.z.string(),data:k.nullable()}).passthrough(),q=t.z.object({context:t.z.enum(["user","organization"]).optional().default("user"),organizationId:t.z.string().min(1).optional(),returnUrl:t.z.string().min(1).optional()}),D=t.z.object({context:t.z.enum(["user","organization"]).optional().default("user"),organizationId:t.z.string().min(1).optional()}),_=t.z.object({id:t.z.string(),number:t.z.string().nullable(),created:t.z.number(),total:t.z.number(),amountPaid:t.z.number(),currency:t.z.string(),status:t.z.string().nullable(),description:t.z.string().nullable(),hostedInvoiceUrl:t.z.string().nullable(),invoicePdf:t.z.string().nullable()}),E=t.z.object({success:t.z.boolean(),invoices:t.z.array(_),hasMore:t.z.boolean()});(0,r.defineRouteContract)({method:"GET",path:"/api/billing",query:f,response:{mode:"json",schema:t.z.union([v,x])}});let R=(0,r.defineRouteContract)({method:"GET",path:"/api/billing",query:f.extend({context:t.z.literal("user").optional().default("user")}),response:{mode:"json",schema:v}}),O=(0,r.defineRouteContract)({method:"GET",path:"/api/billing",query:f.extend({context:t.z.literal("organization"),id:t.z.string().min(1)}),response:{mode:"json",schema:x}});(0,r.defineRouteContract)({method:"GET",path:"/api/usage",query:i,response:{mode:"json",schema:t.z.union([S,C])}});let T=(0,r.defineRouteContract)({method:"GET",path:"/api/usage",query:i.extend({context:t.z.literal("user").optional().default("user")}),response:{mode:"json",schema:S}}),L=(0,r.defineRouteContract)({method:"PUT",path:"/api/usage",body:a,response:{mode:"json",schema:t.z.union([S,C])}}),P=(0,r.defineRouteContract)({method:"POST",path:"/api/billing/portal",body:q,response:{mode:"json",schema:t.z.object({url:t.z.string().min(1)})}}),A=(0,r.defineRouteContract)({method:"GET",path:"/api/billing/invoices",query:D,response:{mode:"json",schema:E}}),M=t.z.object({success:t.z.literal(!0),plan:t.z.string().optional(),interval:t.z.enum(["month","year"]).optional(),message:t.z.string().optional()}),U=t.z.object({reason:t.z.literal("usage_limit"),action:t.z.enum(["upgrade_plan","increase_limit"]),message:t.z.string()}),B=t.z.discriminatedUnion("usageExceeded",[t.z.object({usageExceeded:t.z.literal(!1),usageUpgrade:t.z.never().optional()}),t.z.object({usageExceeded:t.z.literal(!0),usageUpgrade:U})]),N=t.z.object({success:t.z.literal(!0),message:t.z.string().optional(),data:t.z.object({userId:t.z.string().optional(),cost:t.z.number().optional(),billingEnabled:t.z.boolean().optional(),processedAt:t.z.string(),requestId:t.z.string()})}).and(B),G=(0,r.defineRouteContract)({method:"POST",path:"/api/billing/switch-plan",body:h,response:{mode:"json",schema:M}});(0,r.defineRouteContract)({method:"POST",path:"/api/billing/update-cost",headers:p,body:m,response:{mode:"json",schema:N}}),e.s(["billingSwitchPlanContract",0,G,"createBillingPortalContract",0,P,"getInvoicesContract",0,A,"getOrganizationBillingContract",0,O,"getUserBillingContract",0,R,"getUserUsageLimitContract",0,T,"organizationBillingDataSchema",0,k,"updateUsageLimitContract",0,L,"usageUpgradePayloadSchema",0,U],5114438)},8484136,3995004,e=>{"use strict";
1let t={pending:"pending",running:"running",completed:"completed",failed:"failed",cancelled:"cancelled",delivered:"delivered"},o={success:"success",error:"error",cancelled:"cancelled",skipped:"skipped",rejected:"rejected"};e.s(["MothershipStreamV1AsyncToolRecordStatus",0,t,"MothershipStreamV1CompletionStatus",0,{complete:"complete",error:"error",cancelled:"cancelled"},"MothershipStreamV1EventType",0,{session:"session",text:"text",tool:"tool",span:"span",resource:"resource",run:"run",error:"error",complete:"complete"},"MothershipStreamV1ResourceOp",0,{upsert:"upsert",remove:"remove"},"MothershipStreamV1RunKind",0,{checkpoint_pause:"checkpoint_pause",resumed:"resumed",compaction_start:"compaction_start",compaction_done:"compaction_done",steering_applied:"steering_applied",task_armed:"task_armed",task_delivered:"task_delivered"},"MothershipStreamV1SessionKind",0,{trace:"trace",chat:"chat",title:"title",start:"start"},"MothershipStreamV1SpanLifecycleEvent",0,{start:"start",end:"end"},"MothershipStreamV1SpanPayloadKind",0,{subagent:"subagent",structured_result:"structured_result",subagent_result:"subagent_result"},"MothershipStreamV1TextChannel",0,{assistant:"assistant",thinking:"thinking"},"MothershipStreamV1ToolOutcome",0,o,"MothershipStreamV1ToolPhase",0,{call:"call",args_delta:"args_delta",result:"result"},"MothershipStreamV1ToolStatus",0,{generating:"generating",awaiting_approval:"awaiting_approval",executing:"executing",success:"success",error:"error",cancelled:"cancelled",skipped:"skipped",rejected:"rejected"}],3995004);let r={background:"background",success:o.success,error:o.error,cancelled:o.cancelled};function i(e){return null!=e&&"skip"!==e}e.s(["ASYNC_TOOL_CONFIRMATION_STATUS",0,r,"ASYNC_TOOL_STATUS",0,t,"DESKTOP_TOOL_CLAIM_OWNER",0,{browser:"desktop-browser",terminal:"desktop-terminal",files:"desktop-files"},"EXECUTABLE_TOOL_PERMISSION_DECISIONS",0,["allow","allow_chat","always_allow"],"SIM_TOOL_EXECUTION_VERSION",0,2,"isAsyncEphemeralConfirmationStatus",0,function(e){return e===r.background},"isAsyncTerminalConfirmationStatus",0,function(e){return e===r.background||e===r.success||e===r.error||e===r.cancelled},"isDeliveredAsyncStatus",0,function(e){return e===t.delivered},"isExecutableToolPermissionDecision",0,i,"isTerminalAsyncStatus",0,function(e){return e===t.completed||e===t.failed||e===t.cancelled},"isWorkflowToolExecutionClaimable",0,function(e,o){return e===t.running||e===t.delivered||e===t.pending&&i(o)}],8484136)},6396982,e=>{"use strict";var t=e.i(9681307);let o=t.z.enum(["google_drive","gmail","google_meet","zoom","google_calendar","slack","jira","confluence","github","gitlab","linear","lucid","hubspot","fireflies","granola","notion","coda"]),r={github:t.z.enum(["issues","code","repositories","commits"]),gitlab:t.z.enum(["issues","code","merge_requests","wiki"]),hubspot:t.z.enum(["contacts","companies","deals","tickets"]),lucid:t.z.enum(["lucidchart","lucidspark"]),google_meet:t.z.enum(["transcript","smart_notes"]),zoom:t.z.enum(["meeting"])};function i(e){return Object.hasOwn(r,e)}let a=t.z.enum([...r.github.options,...r.gitlab.options,...r.hubspot.options,...r.lucid.options,...r.google_meet.options,...r.zoom.options]),n=t.z.object({provider:o,query:t.z.string().trim().max(2e3),accountId:t.z.string().min(1).max(200).optional(),kind:a.optional(),project:t.z.string().min(1).max(300).optional(),browse:t.z.enum(["folder","private","shared","favorites","recent"]).optional().describe("Queryless discovery: Lucid folder lists one folder page (omit project for root; otherwise use a returned numeric folder ID). Notion private/shared list sidebar pages, favorites lists pinned pages, recent lists recently viewed pages, not recently modified pages. These lists are not an exhaustive workspace inventory. Follow the returned cursor with the same account, browse mode, project, filters and topK."),cursor:t.z.string().max(4e3).optional(),termClauses:t.z.array(t.z.string().max(500)).max(10).optional(),modifiers:t.z.string().max(1e3).optional(),keywordOnly:t.z.boolean().optional()}).strict().superRefine((e,t)=>{if(e.kind){let o=i(e.provider)?r[e.provider]:null;o?.safeParse(e.kind).success||t.addIssue({code:"custom",path:["kind"],message:o?`${e.provider} kind must be one of: ${o.options.join(", ")}.`:`${e.provider} does not support kind selection.`})}e.browse&&(e.query||e.modifiers||e.keywordOnly||e.termClauses?.length||("folder"===e.browse?"lucid"!==e.provider:"notion"!==e.provider)||"notion"===e.provider&&e.project)&&t.addIssue({code:"custom",path:["browse"],message:"Browse requires an empty query and a supp
1orted provider mode; Notion lists cannot be scoped to a page."}),"folder"===e.browse&&e.project&&!/^[1-9]\d{0,14}$/.test(e.project)&&t.addIssue({code:"custom",path:["project"],message:"Lucid folder browsing requires a numeric folder ID returned by the provider."}),"lucid"!==e.provider||e.query||e.browse||t.addIssue({code:"custom",path:["query"],message:"Lucid requires title keywords or explicit browse: folder."})}),s=t.z.array(n).min(1).max(9).superRefine((e,t)=>{let o=(e,t)=>e.provider===t.provider&&(!e.accountId||!t.accountId||e.accountId===t.accountId),r=e=>{let t=new Map;for(let{accountId:o}of e)o&&t.set(o,(t.get(o)??0)+1);return e.filter(({accountId:e})=>!e).length+Math.max(0,...t.values())},a=({accountId:e,kind:t,...o})=>JSON.stringify({...o,kind:i(o.provider)?t:void 0});for(let[n,s]of e.entries()){let l=e=>t.addIssue({code:"custom",path:[n],message:e}),d=e.slice(0,n).filter(e=>o(e,s));d.some(e=>a(e)===a(s))?l("Duplicate native query."):i(s.provider)&&d.some(e=>!e.browse&&!s.browse&&(!e.kind||!s.kind))?l("A GitHub, GitLab, HubSpot, Lucid, Google Meet, or Zoom query without a kind already searches its default kinds; give each query on this account a kind."):r(d)>=4&&l("Send at most 4 native queries per provider account in one call; queries without an accountId count toward every account of their provider.")}}),l=t.z.object({accountId:t.z.string(),provider:o,queryIndex:t.z.number().int().min(0).optional(),displayName:t.z.string(),status:t.z.enum(["ok","partial","reconnect","rate_limited","unavailable","timeout"]),message:t.z.string().optional(),nextCursor:t.z.string().optional(),folders:t.z.array(t.z.object({id:t.z.string(),name:t.z.string()})).max(10).optional(),retryAfterSeconds:t.z.number().optional()}),d=t.z.object({backend:t.z.literal("live"),accounts:t.z.array(l),guidance:t.z.string()}),c=t.z.object({startDate:t.z.string().datetime({offset:!0}).optional().describe('Live search: inclusive lower date bound. For a specific day or bounded date range, always supply endDate too, including exact-title lookups; startDate alone means an open-ended "since" search. Calendar, Google Meet, Zoom, Fireflies and Granola use event or meeting start; Gmail/Slack use message time; other sources use modification time. Include the userâs timezone offset.'),endDate:t.z.string().datetime({offset:!0}).optional().describe("Live search: exclusive upper date bound. Include this with startDate whenever the request names a specific day or bounded range, even if the title uniquely identifies a result. For whole days, startDate is local midnight on the first included day and endDate is local midnight after the final included day. Preserve the timezone offset at each boundary."),sortBy:t.z.enum(["relevance","newest","oldest"]).optional().describe("Live search ordering by relevance or the provider date used by startDate/endDate. Date sorting covers retrieved results; inspect partial coverage before claiming latest or earliest overall. Without search terms or dates, newest or oldest lists items up to now."),source:t.z.string().trim().min(1,"Source cannot be empty").max(100).optional().describe("Connector type or upload source; narrows the selected search scope."),modifiedAfter:t.z.string().datetime({offset:!0}).optional().describe("ISO datetime; restricts results to documents modified after this time."),modifiedBefore:t.z.string().datetime({offset:!0}).optional().describe("ISO datetime; restricts results to documents modified before this time."),documentIds:t.z.array(t.z.string().min(1).max(4e3)).min(1).max(20).optional().describe("Document IDs returned by search or selected by the user; narrows retrieval to these documents.")});c.extend({nativeQueries:s.optional().describe("Live search only: queries in a provider's own language (Drive q, Gmail operators, JQL, CQL, GitHub qualifiers, Slack RTS, plain Linear/Fireflies/HubSpot/Lucid/Zoom terms, bounded local Google Meet text matching, Granola natural-language questions, Notion keywords or AI questions when available). Blank queries require a date bound, sortBy newest/oldest, or explicit browse mode. Lucid browse folder lists root or a numeric folder project; Notion browse private/shared/favorites/recent lists sidebar pages. Recent means viewed, not modified. Up to 4 per account run separately and merge; one GitHub, GitLab, or HubSpot query without a kind searches GitHub issues (plus code when the query has no date bound or boolean operators, as its status message says), GitLab issues, merge requests, and code, or every HubSpot
1CRM kind; other collections, and multiple content queries on one account, each need a kind, which may repeat; explicit browse queries may select distinct folders or sidebar sections without a kind. HubSpot kinds are contacts, companies, deals, and tickets; Lucid kinds are lucidchart and lucidspark. Google Meet kinds are transcript and smart_notes (note metadata and Docs link only); it searches bounded recent conference artifacts with 30-day retention. Zoom kind is meeting and searches past occurrences; read for transcripts and separately labeled summaries. Use Drive for saved Meet note bodies and older transcripts; Drive dates mean file modification time. HubSpot, Lucid, Zoom and Meet reject ownership filters. Lucid title search has no continuation; folder browsing is paginated and returns child folders in account coverage; project can scope a literal shape-text query to one known document UUID or Lucid URL. Read for structured diagram evidence. Dates and sorting cover only retrieved candidates, not globally newest/oldest matches. Write queries from the returned live guidance and account IDs; each account status names the queryIndex its cursor belongs to. Omit for simple cross-provider terms."),query:t.z.string().trim().max(2e3).default("").describe("Search terms, without dates already supplied as filters. May be empty for a live listing with a date bound or sortBy newest or oldest where supported, or use an explicit native browse mode. Notion date-only search depends on plan capabilities."),topK:t.z.number().int().min(1).max(50).default(20).describe("Maximum matching passage previews; retrieval ranking is independent of preview length.")}).superRefine((e,t)=>{let o=!!(e.startDate||e.endDate||e.modifiedAfter||e.modifiedBefore||"newest"===e.sortBy||"oldest"===e.sortBy);e.query||e.nativeQueries?.some(e=>e.query||e.browse)||o||t.addIssue({code:"custom",path:["query"],message:"Supply search terms, a native query, a date bound, or sortBy newest or oldest."}),e.startDate&&e.endDate&&Date.parse(e.startDate)>=Date.parse(e.endDate)&&t.addIssue({code:"custom",path:["endDate"],message:"endDate must be after startDate."}),e.nativeQueries?.some(e=>!e.query&&!e.browse)&&!o&&t.addIssue({code:"custom",path:["nativeQueries"],message:"Empty native queries require a date bound or sortBy newest or oldest."})}),t.z.object({documentId:t.z.string().min(1).max(4e3).describe("Canonical document ID returned by search or selected document context."),limit:t.z.preprocess(e=>"number"==typeof e&&e>8?8:e,t.z.number().int().min(1).max(8)).default(3).describe("Maximum number of chunks, from 1 to 8 (default 3); the server may return fewer to fit its text budget. Follow next for more context."),startChunkIndex:t.z.number().int().min(0).max(0x7fffffff).optional().describe("Inclusive chunk index from search or a prior read next object. Disabled chunk gaps are skipped."),startOffset:t.z.number().int().min(0).max(0x7fffffff).optional().describe("UTF-16 character offset within startChunkIndex. Copy next.startOffset to continue a partial chunk.")}),t.z.object({providerName:t.z.string().min(1).describe("Integration provider value (for example google-email or slack), or its service display name. Avoid ambiguous base providers such as google."),credentialId:t.z.string().optional().describe("Existing owned credential ID, only when the user requests reconnect or repair. Omit when adding another account.")}),t.z.object({workspaceId:t.z.string().uuid().optional().describe("Exact workspace ID to revalidate, when known."),query:t.z.string().trim().max(200).optional().describe("Case-insensitive workspace name filter."),limit:t.z.number().int().min(1).max(100).default(50),cursor:t.z.string().uuid().optional().describe("Copy nextCursor from the preceding page.")});let u=t.z.discriminatedUnion("capabilityDetail",[t.z.object({capabilityDetail:t.z.literal("full"),capabilities:t.z.record(t.z.string(),t.z.boolean())}),t.z.object({capabilityDetail:t.z.literal("restrictions"),copilotAllowed:t.z.boolean(),deniedCapabilities:t.z.array(t.z.string()).describe("Static capabilities explicitly with
1held by current workspace policy. Absence does not grant an operation; use exact workspaceId for the full map.")})]);t.z.object({success:t.z.literal(!0),workspaces:t.z.array(t.z.object({id:t.z.uuid(),name:t.z.string(),role:t.z.enum(["read","write","admin"])}).and(u)),nextCursor:t.z.uuid().nullable(),storedNotes:t.z.array(t.z.object({id:t.z.string(),kind:t.z.enum(["user_pref","workspace_fact"]),content:t.z.string(),updatedAt:t.z.iso.datetime()})).optional()});let m=t.z.object({documentId:t.z.string(),knowledgeBaseId:t.z.string(),knowledgeBaseName:t.z.string(),documentName:t.z.string().nullable(),sourceUrl:t.z.string().nullable(),connectorType:t.z.string().nullable(),sourceModifiedAt:t.z.string().nullable(),sourceDate:t.z.string().nullable().optional(),sourceContainerName:t.z.string().optional(),sourceContainerUrl:t.z.string().optional(),sourceDateType:t.z.enum(["event_start","message","modified"]).optional(),author:t.z.string().nullable(),content:t.z.string(),chunkIndex:t.z.number(),similarity:t.z.number()}),p=t.z.object({live:d.optional(),query:t.z.string(),results:t.z.array(m),retrieval:t.z.object({status:t.z.enum(["complete","partial"]),timedOutLegs:t.z.array(t.z.enum(["vector","keyword","tags"])).max(3)})});e.s(["nativeSearchQueriesSchema",0,s,"workspaceKnowledgeSearchDataSchema",0,p,"workspaceSearchFiltersSchema",0,c])},1665656,e=>{"use strict";function t(e){return e.workspaceId?JSON.stringify([e.workspaceId,e.type,e.id]):`${e.type}:${e.id}`}let o={search:{persisted:!0},sources:{persisted:!0},table:{persisted:!0},file:{persisted:!0},dashboard:{persisted:!0},workflow:{persisted:!0},knowledgebase:{persisted:!0},folder:{persisted:!0},filefolder:{persisted:!0},task:{persisted:!0},log:{persisted:!0},integration:{persisted:!0},generic:{persisted:!1},browser:{persisted:!1,desktopOnly:!0},terminal:{persisted:!1,desktopOnly:!0}},r=Object.keys(o).filter(e=>o[e].persisted);function i(e){return"streaming-file"===e.id||!o[e.type]?.persisted}function a(e){var t;return"string"==typeof(t=e.id)&&t.trim().length>0}function n(e){return e.filter(e=>!o[e.type]?.desktopOnly).filter(a)}let s=new Set(["Table","File","Workflow","Knowledge Base","Folder","Log"]),l=["title","workspaceId","workspaceName","path","viewId","executionId","search","sources"];function d(e,t){if(!e){let{clearViewId:e,...o}=t;return o}let{viewId:o,...r}=e,i={...!0===t.clearViewId?r:e,...void 0!==t.workspaceId?{workspaceId:t.workspaceId}:{},...void 0!==t.workspaceName?{workspaceName:t.workspaceName}:{},...void 0!==t.path?{path:t.path}:{},...!0!==t.clearViewId&&void 0!==t.viewId?{viewId:t.viewId}:{},...void 0!==t.executionId?{executionId:t.executionId}:{},...void 0!==t.search?{search:t.search}:{},...void 0!==t.sources?{sources:t.sources}:{},title:(!e.title.trim()||e.title===e.id||s.has(e.title))&&t.title.trim()&&t.title!==t.id&&!s.has(t.title)?t.title:e.title};return l.every(t=>i[t]===e[t])?e:i}e.s(["MothershipResourceType",0,{search:"search",sources:"sources",table:"table",file:"file",dashboard:"dashboard",workflow:"workflow",knowledgebase:"knowledgebase",folder:"folder",filefolder:"filefolder",task:"task",log:"log",integration:"integration",generic:"generic",browser:"browser",terminal:"terminal"},"PERSISTED_RESOURCE_TYPES",0,r,"VFS_DIR_TO_RESOURCE",0,{tables:"table",files:"file",dashboards:"dashboard",workflows:"workflow",knowledgebases:"knowledgebase",folders:"folder"},"getChatResourceKey",0,t,"getChatResourceSelectionId",0,function(e){let o=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e.id);return!e.workspaceId||o||i(e)?e.id:t(e)},"isAddressableResource",0,a,"isDesktopOnlyResource",0,function(e){return o[e.type]?.desktopOnly===!0},"isEphemeralResource",0,i,"mergeChatResource",0,d,"mergePendingChatResourceUpdate",0,function(e,t){let o,r;if(e){let{clearViewId:t,...i}=e;o=t,r=i}let i=d(r,t);return void 0===t.viewId&&(!0===t.clearViewId||!0===o)?{...i,clearViewId:!0}:i},"reorderStoredChatResources",0,function(e,o){let r=n(e),i=n(o),a=new Map(r.map(e=>[t(e),e])),s=Array.from(new Set(i.map(t)));if(s.length!==a.size)return null;let l=[];for(let e of s){let t=a.get(e);if(!t)return null;l.push(t)}return l},"sanitizeChatResources",0,n])},6325566,e=>{"use strict";e.s(["MAX_KNOWLEDGE_DOCUMENT_FILE_SIZE",0,0x6400000,"MAX_WORKSPACE_FILE_SIZE",0,0x140000000,"MAX_WORKSPACE_FORMDATA_FILE_SIZE",0,0x6400000])}]); 2 3//# sourceMappingURL=0aamqe8r4xaed.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.