@outlit/tools 0.2.0 → 0.3.0

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/contracts.ts","../src/client.ts","../src/toolsets.ts"],"sourcesContent":["export type { OutlitToolsClient, OutlitToolsClientOptions, OutlitToolsFetch } from \"./client.js\"\nexport { createOutlitClient, DEFAULT_OUTLIT_API_URL } from \"./client.js\"\nexport type {\n CustomerContextSearchInput,\n CustomerSourceType,\n CustomerSourceTypeInput,\n CustomerToolContract,\n CustomerToolName,\n JsonSchema,\n SearchArgsLike,\n} from \"./contracts.js\"\nexport {\n customerActivityWindows,\n customerBillingStatuses,\n customerFactCategories,\n customerFactIncludes,\n customerFactStatuses,\n customerFactTypes,\n customerIncludeSections,\n customerListOrderFields,\n customerSourceTypeAliases,\n customerSourceTypeInputs,\n customerSourceTypes,\n customerTimeframes,\n customerToolContractHash,\n customerToolContracts,\n customerToolNames,\n getCustomerToolContract,\n isCustomerToolName,\n normalizeCustomerSourceType,\n notificationProviderValues,\n notificationSeverityValues,\n resolveCustomerContextSearchInput,\n schemaTables,\n timelineChannels,\n timelineTimeframes,\n unsupportedCustomerFactTypes,\n userJourneyStages,\n userListOrderFields,\n} from \"./contracts.js\"\n\nexport {\n actionToolNames,\n allCustomerToolNames,\n analyticalAgentToolNames,\n defaultAgentToolNames,\n sqlToolNames,\n} from \"./toolsets.js\"\n","export type JsonSchema = {\n readonly [key: string]: unknown\n}\n\nexport const customerToolNames = [\n \"outlit_list_customers\",\n \"outlit_list_users\",\n \"outlit_get_customer\",\n \"outlit_get_timeline\",\n \"outlit_list_facts\",\n \"outlit_get_fact\",\n \"outlit_get_source\",\n \"outlit_search_customer_context\",\n \"outlit_query\",\n \"outlit_schema\",\n \"outlit_send_notification\",\n] as const\n\nexport const customerSourceTypes = [\n \"EMAIL\",\n \"CALL\",\n \"CALENDAR_EVENT\",\n \"SUPPORT_TICKET\",\n \"OPPORTUNITY\",\n] as const\n\nexport const customerSourceTypeAliases = [\"CRM\", \"CRM_OPPORTUNITY\"] as const\n\nexport const customerSourceTypeInputs = [\n \"EMAIL\",\n \"CALL\",\n \"CALENDAR_EVENT\",\n \"SUPPORT_TICKET\",\n \"OPPORTUNITY\",\n \"CRM\",\n \"CRM_OPPORTUNITY\",\n] as const\n\nexport const notificationProviderValues = [\"slack\"] as const\n\nexport const customerToolContracts = {\n outlit_list_customers: {\n toolName: \"outlit_list_customers\",\n description:\n \"Browse and filter customers. Use this to find customers by billing status, activity recency, revenue, or name. Returns a paginated list with summary info (MRR, last activity, status).\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n billingStatus: {\n description: \"Filter by billing status\",\n type: \"string\",\n enum: [\"NONE\", \"TRIALING\", \"PAYING\", \"PAST_DUE\", \"CHURNED\"],\n },\n hasActivityInLast: {\n description: \"Filter customers with activity in the last N days\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\"],\n },\n noActivityInLast: {\n description: \"Filter customers with NO activity in the last N days\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\"],\n },\n mrrAbove: {\n description: \"Minimum MRR in cents (e.g., 10000 = $100)\",\n type: \"number\",\n minimum: 0,\n },\n mrrBelow: {\n description: \"Maximum MRR in cents\",\n type: \"number\",\n minimum: 0,\n },\n traitFilters: {\n description: \"Filter by exact trait values using key/value pairs\",\n type: \"object\",\n propertyNames: {\n type: \"string\",\n pattern: \"^[A-Za-z0-9_-]{1,100}$\",\n },\n additionalProperties: {\n anyOf: [\n {\n type: \"string\",\n maxLength: 500,\n },\n {\n type: \"number\",\n },\n {\n type: \"boolean\",\n },\n ],\n },\n },\n search: {\n description: \"Search by customer name or domain (case-insensitive)\",\n type: \"string\",\n maxLength: 500,\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n orderBy: {\n description: \"Field to order results by\",\n default: \"last_activity_at\",\n type: \"string\",\n enum: [\"last_activity_at\", \"first_seen_at\", \"name\", \"mrr_cents\"],\n },\n orderDirection: {\n description: \"Sort direction\",\n default: \"desc\",\n type: \"string\",\n enum: [\"asc\", \"desc\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_list_users: {\n toolName: \"outlit_list_users\",\n description:\n \"Browse and filter users. Use this to find users by journey stage, activity recency, customer, or email/name. Returns a paginated list with activity info.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n journeyStage: {\n description: \"Filter by user journey stage\",\n type: \"string\",\n enum: [\"DISCOVERED\", \"SIGNED_UP\", \"ACTIVATED\", \"ENGAGED\", \"INACTIVE\"],\n },\n customerId: {\n description: \"Filter users by customer ID\",\n type: \"string\",\n maxLength: 500,\n },\n traitFilters: {\n description: \"Filter by exact trait values using key/value pairs\",\n type: \"object\",\n propertyNames: {\n type: \"string\",\n pattern: \"^[A-Za-z0-9_-]{1,100}$\",\n },\n additionalProperties: {\n anyOf: [\n {\n type: \"string\",\n maxLength: 500,\n },\n {\n type: \"number\",\n },\n {\n type: \"boolean\",\n },\n ],\n },\n },\n hasActivityInLast: {\n description:\n \"Filter users active within this window. Format: Nd, Nh, or Nm (e.g., '7d', '24h', '90m')\",\n type: \"string\",\n pattern: \"^\\\\d+(d|h|m)$\",\n },\n noActivityInLast: {\n description:\n \"Filter users NOT active within this window. Format: Nd, Nh, or Nm (e.g., '30d', '2h')\",\n type: \"string\",\n pattern: \"^\\\\d+(d|h|m)$\",\n },\n search: {\n description: \"Search by user email or name (case-insensitive)\",\n type: \"string\",\n maxLength: 500,\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n orderBy: {\n description: \"Field to order by\",\n default: \"last_activity_at\",\n type: \"string\",\n enum: [\"last_activity_at\", \"first_seen_at\", \"email\"],\n },\n orderDirection: {\n description: \"Sort direction\",\n default: \"desc\",\n type: \"string\",\n enum: [\"asc\", \"desc\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_get_customer: {\n toolName: \"outlit_get_customer\",\n description:\n \"Get full details for a single customer. Use this when you already know which customer you want to inspect. Optionally include related data (users, revenue, recent activity, engagement metrics).\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n type: \"string\",\n description: \"Customer ID, domain, or name to look up\",\n },\n include: {\n description: \"Additional data sections to include in the response\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"users\", \"revenue\", \"recentTimeline\", \"behaviorMetrics\"],\n },\n },\n timeframe: {\n description: \"Timeframe for timeline and behavior metrics (default: 30d)\",\n default: \"30d\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\"],\n },\n },\n required: [\"customer\"],\n additionalProperties: false,\n },\n },\n outlit_get_timeline: {\n toolName: \"outlit_get_timeline\",\n description:\n \"Get the chronological activity timeline for a customer. Use this to see what happened and when — emails, calls, Slack messages, billing events, etc. Supports channel and date filtering.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n type: \"string\",\n description: \"Customer ID or domain\",\n },\n channels: {\n description: \"Filter by event channel (e.g., EMAIL, SLACK, CALL, CALENDAR)\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\n \"SDK\",\n \"EMAIL\",\n \"SLACK\",\n \"CALL\",\n \"CALENDAR\",\n \"CRM\",\n \"BILLING\",\n \"SUPPORT\",\n \"INTERNAL\",\n ],\n },\n },\n eventTypes: {\n description: \"Filter by event type\",\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n timeframe: {\n description:\n \"Relative time window (default: 30d). Cannot be used with startDate/endDate.\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\", \"all\"],\n },\n startDate: {\n description:\n \"Start of time window (ISO 8601, e.g. '2025-01-01T00:00:00Z'). Cannot be used with timeframe.\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n endDate: {\n description:\n \"End of time window (ISO 8601, e.g. '2025-01-31T23:59:59Z'). Cannot be used with timeframe.\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n },\n required: [\"customer\"],\n additionalProperties: false,\n },\n },\n outlit_list_facts: {\n toolName: \"outlit_list_facts\",\n description:\n \"List structured facts known about a customer. Use filters like status, sourceTypes, factTypes, factCategories, and date bounds to narrow the result set. For topic-specific retrieval, use outlit_search_customer_context instead.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n type: \"string\",\n description: \"Customer ID or domain\",\n },\n status: {\n description: \"Optional fact status filter\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"ACTIVE\", \"ACKNOWLEDGED\", \"RESOLVED\", \"SNOOZED\", \"CANDIDATE\"],\n },\n },\n sourceTypes: {\n description: \"Optional generic source types to restrict fact results to.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n },\n factTypes: {\n description:\n \"Optional customer-memory fact type filters, such as CHURN_RISK, EXPANSION, SENTIMENT, or BUDGET. Anomaly detector fact types are not supported.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\n \"CUSTOM\",\n \"COMPANY_CHANGE\",\n \"FUNDING_REVENUE\",\n \"TECHNOLOGY\",\n \"STRATEGY\",\n \"COMPETITIVE\",\n \"SENTIMENT\",\n \"CHAMPION_RISK\",\n \"EXPANSION\",\n \"CHURN_RISK\",\n \"TIMELINE\",\n \"BUDGET\",\n \"DECISION_MAKER\",\n \"REQUIREMENTS\",\n \"PRODUCT_USAGE\",\n \"CONTACT_INFO\",\n \"CONTACT_PREFERENCE\",\n ],\n },\n },\n factCategories: {\n description: \"Optional public fact category filters. Supported values: MEMORY, CUSTOM.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"MEMORY\", \"CUSTOM\"],\n },\n },\n after: {\n description: \"ISO 8601 datetime lower bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n before: {\n description: \"ISO 8601 datetime upper bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n limit: {\n description: \"Results per page (max 100)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 100,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n },\n required: [\"customer\"],\n additionalProperties: false,\n },\n },\n outlit_get_fact: {\n toolName: \"outlit_get_fact\",\n description:\n \"Get one exact fact by ID. Returns the canonical fact shape and optionally expands requested related data such as evidence.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n factId: {\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n description: \"Exact fact ID to retrieve\",\n },\n include: {\n description:\n \"Optional best-effort expansions. Use include=['evidence'] to request evidence when available; unsupported include values are ignored.\",\n type: \"array\",\n items: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n },\n },\n },\n required: [\"factId\"],\n additionalProperties: false,\n },\n },\n outlit_get_source: {\n toolName: \"outlit_get_source\",\n description:\n \"Get one exact source record by generic sourceType and sourceId. Use this when you already know the concrete underlying source you want to inspect.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n sourceType: {\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n sourceId: {\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n },\n },\n required: [\"sourceType\", \"sourceId\"],\n additionalProperties: false,\n },\n },\n outlit_search_customer_context: {\n toolName: \"outlit_search_customer_context\",\n description:\n \"Search across all known customer context using a natural-language query. Returns grouped artifact-level results for matching sources and facts. Omit customer to search across all customers in the organization.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n description: \"Customer ID, domain, or name. Omit to search across all customers.\",\n anyOf: [\n {\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n },\n {\n type: \"null\",\n },\n ],\n },\n query: {\n type: \"string\",\n minLength: 2,\n maxLength: 2000,\n description: \"Natural language query or topic to search for.\",\n },\n topK: {\n description: \"Maximum number of artifact results to return (default 20).\",\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n },\n after: {\n description: \"ISO 8601 datetime lower bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n before: {\n description: \"ISO 8601 datetime upper bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n sourceTypes: {\n description: \"Optional generic source types to restrict the search to.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n },\n },\n required: [\"query\"],\n additionalProperties: false,\n },\n },\n outlit_query: {\n toolName: \"outlit_query\",\n description:\n \"Execute read-only SQL queries against your analytics views.\\n\\nAvailable views:\\n- activity: Customer activity events (event_name, event_type, event_channel, customer_id, occurred_at, properties, ...)\\n- customers: Customer attributes (customer_id, domain, name, billing_status, plan, mrr_cents, traits, ...)\\n- users: User attributes (user_id, email, name, customer_id, traits, ...)\\n- revenue: Revenue snapshots over time (customer_id, snapshot_date, mrr_cents, ...)\\n\\nAll queries are automatically filtered to your organization's data.\\nOnly SELECT queries are allowed.\\nProperties and traits are JSON strings; inspect schemas and examples before filtering nested values.\\n\\nExample queries:\\n- SELECT event_name, count(*) FROM activity GROUP BY 1 ORDER BY 2 DESC LIMIT 10\\n- SELECT billing_status, sum(mrr_cents)/100 as mrr FROM customers GROUP BY 1\\n- SELECT * FROM activity WHERE customer_id = 'cust_123' ORDER BY occurred_at DESC LIMIT 50\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n sql: {\n type: \"string\",\n description: \"SQL SELECT query to execute\",\n },\n limit: {\n description: \"Max rows to return (default 1000, max 10000)\",\n default: 1000,\n type: \"integer\",\n minimum: 1,\n maximum: 10000,\n },\n },\n required: [\"sql\"],\n additionalProperties: false,\n },\n },\n outlit_schema: {\n toolName: \"outlit_schema\",\n description:\n \"Get schemas for available analytics views.\\n\\nUse this to discover column names, types, and descriptions before writing SQL queries.\\nReturns column definitions and example queries for each view.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n table: {\n description: \"Specific analytics view to describe. Omit to list all views.\",\n type: \"string\",\n enum: [\"activity\", \"customers\", \"users\", \"revenue\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_send_notification: {\n toolName: \"outlit_send_notification\",\n description:\n \"Send or post a notification. Use only when the user explicitly asks you to send, post, or notify. Slack is the default notifier when destinations are omitted.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n title: {\n type: \"string\",\n minLength: 1,\n maxLength: 160,\n description: \"Notification title\",\n },\n markdown: {\n description: \"Markdown notification body rendered for the target provider\",\n type: \"string\",\n minLength: 1,\n maxLength: 100000,\n },\n payload: {\n description:\n \"Optional JSON-compatible payload. Serialized size must be 100,000 characters or fewer.\",\n $ref: \"#/$defs/__schema0\",\n },\n message: {\n description: \"Optional summary message\",\n type: \"string\",\n minLength: 1,\n maxLength: 1200,\n },\n severity: {\n description: \"Optional notification severity\",\n type: \"string\",\n enum: [\"low\", \"medium\", \"high\"],\n },\n source: {\n description: \"Optional source label\",\n type: \"string\",\n minLength: 1,\n maxLength: 120,\n },\n subject: {\n description: \"Optional subject line\",\n type: \"string\",\n minLength: 1,\n maxLength: 240,\n },\n destinations: {\n description:\n \"Optional explicit notification destinations. Omit to use the default notifier.\",\n minItems: 1,\n maxItems: 10,\n type: \"array\",\n items: {\n type: \"object\",\n properties: {\n provider: {\n description: \"Notification provider\",\n type: \"string\",\n enum: notificationProviderValues,\n },\n channelId: {\n description: \"Provider-specific destination channel ID\",\n type: \"string\",\n minLength: 1,\n maxLength: 240,\n },\n label: {\n description: \"Optional destination label\",\n type: \"string\",\n minLength: 1,\n maxLength: 120,\n },\n },\n required: [\"provider\"],\n additionalProperties: false,\n },\n },\n },\n required: [\"title\"],\n additionalProperties: false,\n $defs: {\n __schema0: {\n anyOf: [\n {\n type: \"string\",\n },\n {\n type: \"number\",\n },\n {\n type: \"boolean\",\n },\n {\n type: \"null\",\n },\n {\n type: \"array\",\n items: {\n $ref: \"#/$defs/__schema0\",\n },\n },\n {\n type: \"object\",\n propertyNames: {\n type: \"string\",\n },\n additionalProperties: {\n $ref: \"#/$defs/__schema0\",\n },\n },\n ],\n },\n },\n },\n },\n} as const\n\nexport const customerBillingStatuses = [\n \"NONE\",\n \"TRIALING\",\n \"PAYING\",\n \"PAST_DUE\",\n \"CHURNED\",\n] as const\n\nexport const customerActivityWindows = [\"7d\", \"14d\", \"30d\", \"90d\"] as const\n\nexport const customerFactStatuses = [\n \"ACTIVE\",\n \"ACKNOWLEDGED\",\n \"RESOLVED\",\n \"SNOOZED\",\n \"CANDIDATE\",\n] as const\n\nexport const customerFactIncludes = [\"evidence\"] as const\n\nexport const customerFactTypes = [\n \"CUSTOM\",\n \"COMPANY_CHANGE\",\n \"FUNDING_REVENUE\",\n \"TECHNOLOGY\",\n \"STRATEGY\",\n \"COMPETITIVE\",\n \"SENTIMENT\",\n \"CHAMPION_RISK\",\n \"EXPANSION\",\n \"CHURN_RISK\",\n \"TIMELINE\",\n \"BUDGET\",\n \"DECISION_MAKER\",\n \"REQUIREMENTS\",\n \"PRODUCT_USAGE\",\n \"CONTACT_INFO\",\n \"CONTACT_PREFERENCE\",\n] as const\n\nexport const unsupportedCustomerFactTypes = [\n \"TRACKING_GAP\",\n \"SCHEMA_DRIFT\",\n \"INGESTION_LAG\",\n \"ACTIVATION_RATE_DROP\",\n \"FUNNEL_DROPOFF\",\n \"CORE_ACTION_DECAY\",\n \"CADENCE_BREAK\",\n \"QUIET_ACCOUNT\",\n \"CHAMPION_AT_RISK\",\n \"SEGMENT_DIVERGENCE\",\n] as const\n\nexport const customerFactCategories = [\"MEMORY\", \"CUSTOM\"] as const\n\nexport const customerListOrderFields = [\n \"last_activity_at\",\n \"first_seen_at\",\n \"name\",\n \"mrr_cents\",\n] as const\n\nexport const customerIncludeSections = [\n \"users\",\n \"revenue\",\n \"recentTimeline\",\n \"behaviorMetrics\",\n] as const\n\nexport const customerTimeframes = [\"7d\", \"14d\", \"30d\", \"90d\"] as const\n\nexport const notificationSeverityValues = [\"low\", \"medium\", \"high\"] as const\n\nexport const timelineChannels = [\n \"SDK\",\n \"EMAIL\",\n \"SLACK\",\n \"CALL\",\n \"CALENDAR\",\n \"CRM\",\n \"BILLING\",\n \"SUPPORT\",\n \"INTERNAL\",\n] as const\n\nexport const timelineTimeframes = [\"7d\", \"14d\", \"30d\", \"90d\", \"all\"] as const\n\nexport const userJourneyStages = [\n \"DISCOVERED\",\n \"SIGNED_UP\",\n \"ACTIVATED\",\n \"ENGAGED\",\n \"INACTIVE\",\n] as const\n\nexport const userListOrderFields = [\"last_activity_at\", \"first_seen_at\", \"email\"] as const\n\nexport const schemaTables = [\"activity\", \"customers\", \"users\", \"revenue\"] as const\n\nexport const customerToolContractHash =\n \"006ce091382509c3224815c4f6ead4c5e78e34f54df281fe8f143811890b04af\" as const\n\nexport type CustomerToolName = (typeof customerToolNames)[number]\nexport type CustomerSourceType = (typeof customerSourceTypes)[number]\nexport type CustomerSourceTypeInput = (typeof customerSourceTypeInputs)[number]\n\nexport type CustomerToolContract = {\n toolName: CustomerToolName\n description: string\n inputSchema: JsonSchema\n}\n\nconst customerToolNameSet = new Set<string>(customerToolNames)\nconst customerSourceTypeSet = new Set<string>(customerSourceTypes)\nconst customerSourceTypeAliasMap = new Map<\n (typeof customerSourceTypeAliases)[number],\n CustomerSourceType\n>([\n [\"CRM\", \"OPPORTUNITY\"],\n [\"CRM_OPPORTUNITY\", \"OPPORTUNITY\"],\n])\nconst iso8601UtcDateTimeRegex =\n /^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/\n\nexport function isCustomerToolName(value: string): value is CustomerToolName {\n return customerToolNameSet.has(value)\n}\n\nexport function getCustomerToolContract(name: CustomerToolName): CustomerToolContract {\n return customerToolContracts[name]\n}\n\nexport function normalizeCustomerSourceType(value: string): CustomerSourceType | null {\n const normalized = value.trim().toUpperCase()\n if (customerSourceTypeSet.has(normalized)) {\n return normalized as CustomerSourceType\n }\n\n return (\n customerSourceTypeAliasMap.get(normalized as (typeof customerSourceTypeAliases)[number]) ?? null\n )\n}\n\nexport type SearchArgsLike = {\n query?: string\n customer?: string | null\n topK?: number\n after?: string\n before?: string\n sourceTypes?: string[]\n}\n\nexport type CustomerContextSearchInput = {\n query: string\n customer?: string | null\n topK?: number\n after?: string\n before?: string\n sourceTypes?: CustomerSourceType[]\n}\n\nexport function resolveCustomerContextSearchInput(value: SearchArgsLike):\n | { ok: true; request: CustomerContextSearchInput }\n | {\n ok: false\n message: string\n } {\n if (!value.query) {\n return {\n ok: false,\n message: \"A query argument is required\",\n }\n }\n\n const normalizedQuery = value.query.trim()\n if (normalizedQuery.length < 2) {\n return {\n ok: false,\n message: \"Query must be at least 2 non-whitespace characters\",\n }\n }\n\n if (value.after !== undefined && !iso8601UtcDateTimeRegex.test(value.after)) {\n return {\n ok: false,\n message: \"--after must be a valid ISO 8601 datetime\",\n }\n }\n\n const afterTime = value.after === undefined ? undefined : new Date(value.after).getTime()\n if (afterTime !== undefined && Number.isNaN(afterTime)) {\n return {\n ok: false,\n message: \"--after must be a valid ISO 8601 datetime\",\n }\n }\n\n if (value.before !== undefined && !iso8601UtcDateTimeRegex.test(value.before)) {\n return {\n ok: false,\n message: \"--before must be a valid ISO 8601 datetime\",\n }\n }\n\n const beforeTime = value.before === undefined ? undefined : new Date(value.before).getTime()\n if (beforeTime !== undefined && Number.isNaN(beforeTime)) {\n return {\n ok: false,\n message: \"--before must be a valid ISO 8601 datetime\",\n }\n }\n\n if (afterTime !== undefined && beforeTime !== undefined && afterTime > beforeTime) {\n return {\n ok: false,\n message: \"--after must be before or equal to --before\",\n }\n }\n\n const invalidSourceTypes =\n value.sourceTypes?.filter((sourceType) => !normalizeCustomerSourceType(sourceType)) ?? []\n if (invalidSourceTypes.length > 0) {\n return {\n ok: false,\n message: `Unknown source types: ${invalidSourceTypes.join(\", \")}. Allowed: ${customerSourceTypeInputs.join(\", \")}`,\n }\n }\n\n const normalizedSourceTypes = value.sourceTypes\n ? Array.from(\n new Set(value.sourceTypes.map((sourceType) => normalizeCustomerSourceType(sourceType))),\n ).filter((sourceType): sourceType is CustomerSourceType => sourceType !== null)\n : undefined\n\n return {\n ok: true,\n request: {\n query: normalizedQuery,\n customer: value.customer,\n topK: value.topK,\n after: value.after,\n before: value.before,\n sourceTypes: normalizedSourceTypes,\n },\n }\n}\n","import { type CustomerToolName, isCustomerToolName } from \"./contracts.js\"\n\nexport const DEFAULT_OUTLIT_API_URL = \"https://app.outlit.ai\"\n\nexport type OutlitToolsFetch = (\n input: string | URL | Request,\n init?: RequestInit,\n) => Promise<Response>\n\nexport type OutlitToolsClientOptions = {\n apiKey: string\n baseUrl?: string\n fetch?: OutlitToolsFetch\n}\n\nexport type OutlitToolsClient = {\n key: string\n baseUrl: string\n callTool(toolName: CustomerToolName, input?: Record<string, unknown>): Promise<unknown>\n}\n\nexport function createOutlitClient(options: OutlitToolsClientOptions): OutlitToolsClient {\n const key = options.apiKey.trim()\n const baseUrl = options.baseUrl ?? DEFAULT_OUTLIT_API_URL\n const fetchImpl = options.fetch ?? globalThis.fetch\n\n if (!key) {\n throw new Error(\"apiKey is required\")\n }\n\n if (!fetchImpl) {\n throw new Error(\"fetch is not available\")\n }\n\n return {\n key,\n baseUrl,\n async callTool(toolName, input = {}) {\n if (!isCustomerToolName(toolName)) {\n throw new Error(`Unknown customer tool: ${toolName}`)\n }\n\n const response = await fetchImpl(new URL(\"/api/tools/call\", baseUrl).toString(), {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${key}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n tool: toolName,\n input,\n }),\n })\n\n if (!response.ok) {\n const text = await response.text()\n throw new Error(`API error (${response.status}): ${text}`)\n }\n\n return response.json()\n },\n }\n}\n","import { type CustomerToolName, customerToolNames } from \"./contracts.js\"\n\nexport const actionToolNames = [\n \"outlit_send_notification\",\n] as const satisfies readonly CustomerToolName[]\n\nexport const defaultAgentToolNames = [\n \"outlit_list_customers\",\n \"outlit_list_users\",\n \"outlit_get_customer\",\n \"outlit_get_timeline\",\n \"outlit_list_facts\",\n \"outlit_get_fact\",\n \"outlit_get_source\",\n \"outlit_search_customer_context\",\n ...actionToolNames,\n] as const satisfies readonly CustomerToolName[]\n\nexport const sqlToolNames = [\n \"outlit_schema\",\n \"outlit_query\",\n] as const satisfies readonly CustomerToolName[]\n\nexport const analyticalAgentToolNames = [\n ...defaultAgentToolNames,\n ...sqlToolNames,\n] as const satisfies readonly CustomerToolName[]\n\nexport const allCustomerToolNames = customerToolNames\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,4BAA4B,CAAC,OAAO,iBAAiB;AAE3D,IAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,6BAA6B,CAAC,OAAO;AAE3C,IAAM,wBAAwB;AAAA,EACnC,uBAAuB;AAAA,IACrB,UAAU;AAAA,IACV,aACE;AAA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AAW;AAE9C,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,oBAAoB;AAAA,EACtC;AAEA,MAAI,CAAC,WAAW;AACd,UAAM,IAAI,MAAM,wBAAwB;AAAA,EAC1C;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,MAAM,SAAS,UAAU,QAAQ,CAAC,GAAG;AACnC,UAAI,CAAC,mBAAmB,QAAQ,GAAG;AACjC,cAAM,IAAI,MAAM,0BAA0B,QAAQ,EAAE;AAAA,MACtD;AAEA,YAAM,WAAW,MAAM,UAAU,IAAI,IAAI,mBAAmB,OAAO,EAAE,SAAS,GAAG;AAAA,QAC/E,QAAQ;AAAA,QACR,SAAS;AAAA,UACP,eAAe,UAAU,GAAG;AAAA,UAC5B,gBAAgB;AAAA,QAClB;AAAA,QACA,MAAM,KAAK,UAAU;AAAA,UACnB,MAAM;AAAA,UACN;AAAA,QACF,CAAC;AAAA,MACH,CAAC;AAED,UAAI,CAAC,SAAS,IAAI;AAChB,cAAM,OAAO,MAAM,SAAS,KAAK;AACjC,cAAM,IAAI,MAAM,cAAc,SAAS,MAAM,MAAM,IAAI,EAAE;AAAA,MAC3D;AAEA,aAAO,SAAS,KAAK;AAAA,IACvB;AAAA,EACF;AACF;;;AC5DO,IAAM,kBAAkB;AAAA,EAC7B;AACF;AAEO,IAAM,wBAAwB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL;AAEO,IAAM,eAAe;AAAA,EAC1B;AAAA,EACA;AACF;AAEO,IAAM,2BAA2B;AAAA,EACtC,GAAG;AAAA,EACH,GAAG;AACL;AAEO,IAAM,uBAAuB;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/contracts.ts","../src/client.ts","../src/toolsets.ts"],"sourcesContent":["export type {\n CustomerToolResult,\n OutlitToolsClient,\n OutlitToolsClientOptions,\n OutlitToolsFetch,\n} from \"./client.js\"\nexport { createOutlitClient, DEFAULT_OUTLIT_API_URL } from \"./client.js\"\nexport type {\n CustomerContextSearchInput,\n CustomerSourceType,\n CustomerSourceTypeInput,\n CustomerToolContract,\n CustomerToolName,\n JsonSchema,\n SearchArgsLike,\n} from \"./contracts.js\"\nexport {\n customerActivityWindows,\n customerBillingStatuses,\n customerFactCategories,\n customerFactIncludes,\n customerFactStatuses,\n customerFactTypes,\n customerIncludeSections,\n customerListOrderFields,\n customerSourceTypeAliases,\n customerSourceTypeInputs,\n customerSourceTypes,\n customerTimeframes,\n customerToolContractHash,\n customerToolContracts,\n customerToolNames,\n getCustomerToolContract,\n isCustomerToolName,\n normalizeCustomerSourceType,\n notificationProviderValues,\n notificationSeverityValues,\n resolveCustomerContextSearchInput,\n schemaTables,\n timelineChannels,\n timelineTimeframes,\n unsupportedCustomerFactTypes,\n userJourneyStages,\n userListOrderFields,\n workspaceUserListOrderFields,\n} from \"./contracts.js\"\n\nexport type {\n CustomerAnalyticsRow,\n CustomerDetail,\n CustomerDetailResult,\n CustomerListItem,\n CustomerListResult,\n} from \"./results.js\"\n\nexport {\n actionToolNames,\n allCustomerToolNames,\n analyticalAgentToolNames,\n defaultAgentToolNames,\n sqlToolNames,\n} from \"./toolsets.js\"\n","export type JsonSchema = {\n readonly [key: string]: unknown\n}\n\nexport const customerToolNames = [\n \"outlit_list_customers\",\n \"outlit_list_users\",\n \"outlit_list_workspace_users\",\n \"outlit_get_customer\",\n \"outlit_get_timeline\",\n \"outlit_list_facts\",\n \"outlit_get_fact\",\n \"outlit_get_source\",\n \"outlit_list_sources\",\n \"outlit_search_customer_context\",\n \"outlit_query\",\n \"outlit_schema\",\n \"outlit_send_notification\",\n] as const\n\nexport const customerSourceTypes = [\n \"EMAIL\",\n \"CALL\",\n \"CALENDAR_EVENT\",\n \"SUPPORT_TICKET\",\n \"OPPORTUNITY\",\n \"SLACK\",\n] as const\n\nexport const customerSourceTypeAliases = [\"CRM\", \"CRM_OPPORTUNITY\"] as const\n\nexport const customerSourceTypeInputs = [\n \"EMAIL\",\n \"CALL\",\n \"CALENDAR_EVENT\",\n \"SUPPORT_TICKET\",\n \"OPPORTUNITY\",\n \"SLACK\",\n \"CRM\",\n \"CRM_OPPORTUNITY\",\n] as const\n\nexport const customerToolContracts = {\n outlit_list_customers: {\n toolName: \"outlit_list_customers\",\n title: \"List Customers\",\n description:\n \"Browse and filter customers. Use this to find customers by billing status, activity recency, revenue, or name. Returns a paginated list with summary info (MRR, last activity, status).\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n activatedSince: {\n description: \"Filter customers activated at or after this ISO-8601 datetime\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z|([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)))$\",\n },\n billingStatus: {\n description: \"Filter by billing status\",\n type: \"string\",\n enum: [\"NONE\", \"TRIALING\", \"PAYING\", \"PAST_DUE\", \"CHURNED\"],\n },\n hasActivityInLast: {\n description: \"Filter customers with activity in the last N days\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\"],\n },\n noActivityInLast: {\n description: \"Filter customers with NO activity in the last N days\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\"],\n },\n mrrAbove: {\n description: \"Minimum MRR in cents (e.g., 10000 = $100)\",\n type: \"number\",\n minimum: 0,\n },\n mrrBelow: {\n description: \"Maximum MRR in cents\",\n type: \"number\",\n minimum: 0,\n },\n traitFilters: {\n description: \"Filter by exact trait values using key/value pairs\",\n type: \"object\",\n propertyNames: {\n type: \"string\",\n pattern: \"^[A-Za-z0-9_-]{1,100}$\",\n },\n additionalProperties: {\n anyOf: [\n {\n type: \"string\",\n maxLength: 500,\n },\n {\n type: \"number\",\n },\n {\n type: \"boolean\",\n },\n ],\n },\n },\n search: {\n description: \"Search by customer name or domain (case-insensitive)\",\n type: \"string\",\n maxLength: 500,\n },\n ownerId: {\n description: \"Filter customers by internal owner user ID\",\n type: \"string\",\n maxLength: 500,\n },\n ownerEmail: {\n description: \"Filter customers by internal owner email address\",\n type: \"string\",\n maxLength: 500,\n },\n hasOwner: {\n description: \"Filter customers by whether they have an owner\",\n type: \"boolean\",\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n orderBy: {\n description: \"Field to order results by\",\n default: \"last_activity_at\",\n type: \"string\",\n enum: [\"last_activity_at\", \"first_seen_at\", \"name\", \"mrr_cents\"],\n },\n orderDirection: {\n description: \"Sort direction\",\n default: \"desc\",\n type: \"string\",\n enum: [\"asc\", \"desc\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_list_users: {\n toolName: \"outlit_list_users\",\n title: \"List Users\",\n description:\n \"Browse and filter users. Use this to find users by journey stage, activity recency, customer, or email/name. Returns a paginated list with activity info.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n journeyStage: {\n description: \"Filter by user journey stage\",\n type: \"string\",\n enum: [\"DISCOVERED\", \"SIGNED_UP\", \"ACTIVATED\", \"ENGAGED\", \"INACTIVE\"],\n },\n customerId: {\n description: \"Filter users by customer ID\",\n type: \"string\",\n maxLength: 500,\n },\n traitFilters: {\n description: \"Filter by exact trait values using key/value pairs\",\n type: \"object\",\n propertyNames: {\n type: \"string\",\n pattern: \"^[A-Za-z0-9_-]{1,100}$\",\n },\n additionalProperties: {\n anyOf: [\n {\n type: \"string\",\n maxLength: 500,\n },\n {\n type: \"number\",\n },\n {\n type: \"boolean\",\n },\n ],\n },\n },\n hasActivityInLast: {\n description:\n \"Filter users active within this window. Format: Nd, Nh, or Nm (e.g., '7d', '24h', '90m')\",\n type: \"string\",\n pattern: \"^\\\\d+(d|h|m)$\",\n },\n noActivityInLast: {\n description:\n \"Filter users NOT active within this window. Format: Nd, Nh, or Nm (e.g., '30d', '2h')\",\n type: \"string\",\n pattern: \"^\\\\d+(d|h|m)$\",\n },\n search: {\n description: \"Search by user email or name (case-insensitive)\",\n type: \"string\",\n maxLength: 500,\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n orderBy: {\n description: \"Field to order by\",\n default: \"last_activity_at\",\n type: \"string\",\n enum: [\"last_activity_at\", \"first_seen_at\", \"email\"],\n },\n orderDirection: {\n description: \"Sort direction\",\n default: \"desc\",\n type: \"string\",\n enum: [\"asc\", \"desc\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_list_workspace_users: {\n toolName: \"outlit_list_workspace_users\",\n title: \"List Workspace Users\",\n description:\n \"Browse internal workspace users such as CSMs, managers, account owners, and admins. Use this to discover who owns customers before composing dynamic reports across account books.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n search: {\n description: \"Search internal workspace users by name, email, title, role, or territory\",\n type: \"string\",\n maxLength: 500,\n },\n role: {\n description: \"Filter internal workspace users by role metadata when available\",\n type: \"string\",\n maxLength: 100,\n },\n managerEmail: {\n description: \"Filter internal workspace users by manager email metadata when available\",\n type: \"string\",\n maxLength: 500,\n },\n hasOwnedCustomers: {\n description: \"When true, return only workspace users who own at least one customer\",\n type: \"boolean\",\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n orderBy: {\n description: \"Field to order workspace users by\",\n default: \"owned_customer_count\",\n type: \"string\",\n enum: [\"name\", \"email\", \"owned_customer_count\"],\n },\n orderDirection: {\n description: \"Sort direction\",\n default: \"desc\",\n type: \"string\",\n enum: [\"asc\", \"desc\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_get_customer: {\n toolName: \"outlit_get_customer\",\n title: \"Get Customer\",\n description:\n \"Get full details for a single customer. Use this when you already know which customer you want to inspect. Optionally include related data (users, revenue, recent activity, engagement metrics).\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n type: \"string\",\n description: \"Customer ID, domain, or name to look up\",\n },\n include: {\n description: \"Additional data sections to include in the response\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"users\", \"revenue\", \"recentTimeline\", \"behaviorMetrics\"],\n },\n },\n timeframe: {\n description: \"Timeframe for timeline and behavior metrics (default: 30d)\",\n default: \"30d\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\"],\n },\n },\n required: [\"customer\"],\n additionalProperties: false,\n },\n },\n outlit_get_timeline: {\n toolName: \"outlit_get_timeline\",\n title: \"Get Customer Timeline\",\n description:\n \"Get the chronological activity timeline for a customer. Use this to see what happened and when — emails, calls, Slack messages, billing events, etc. Supports channel and date filtering.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n type: \"string\",\n description: \"Customer ID or domain\",\n },\n channels: {\n description:\n \"Filter by event channel. Use values such as PRODUCT, COMMUNICATION, MEETING, CRM, BILLING, SUPPORT, IDENTITY, DOCUMENT, or SYSTEM.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\n \"PRODUCT\",\n \"COMMUNICATION\",\n \"MEETING\",\n \"CRM\",\n \"BILLING\",\n \"SUPPORT\",\n \"IDENTITY\",\n \"DOCUMENT\",\n \"SYSTEM\",\n ],\n },\n },\n eventTypes: {\n description: \"Filter by event type\",\n type: \"array\",\n items: {\n type: \"string\",\n },\n },\n timeframe: {\n description:\n \"Relative time window (default: 30d). Cannot be used with startDate/endDate.\",\n type: \"string\",\n enum: [\"7d\", \"14d\", \"30d\", \"90d\", \"all\"],\n },\n startDate: {\n description:\n \"Start of time window (ISO 8601, e.g. '2025-01-01T00:00:00Z'). Cannot be used with timeframe.\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n endDate: {\n description:\n \"End of time window (ISO 8601, e.g. '2025-01-31T23:59:59Z'). Cannot be used with timeframe.\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n limit: {\n description: \"Results per page (max 1000)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 1000,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n },\n required: [\"customer\"],\n additionalProperties: false,\n },\n },\n outlit_list_facts: {\n toolName: \"outlit_list_facts\",\n title: \"List Customer Facts\",\n description:\n \"List structured facts known about a customer. Use filters like status, sourceTypes, factTypes, factCategories, and date bounds to narrow the result set. For topic-specific retrieval, use outlit_search_customer_context instead.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n type: \"string\",\n description: \"Customer ID or domain\",\n },\n status: {\n description: \"Optional fact status filter\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"ACTIVE\", \"ACKNOWLEDGED\", \"RESOLVED\", \"SNOOZED\", \"CANDIDATE\"],\n },\n },\n sourceTypes: {\n description: \"Optional generic source types to restrict fact results to.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n },\n factTypes: {\n description:\n \"Optional customer-memory fact type filters, such as CHURN_RISK, EXPANSION, SENTIMENT, or BUDGET. Anomaly detector fact types are not supported.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\n \"CUSTOM\",\n \"COMPANY_CHANGE\",\n \"FUNDING_REVENUE\",\n \"TECHNOLOGY\",\n \"STRATEGY\",\n \"COMPETITIVE\",\n \"SENTIMENT\",\n \"CHAMPION_RISK\",\n \"EXPANSION\",\n \"CHURN_RISK\",\n \"TIMELINE\",\n \"BUDGET\",\n \"DECISION_MAKER\",\n \"REQUIREMENTS\",\n \"PRODUCT_USAGE\",\n \"CONTACT_INFO\",\n \"CONTACT_PREFERENCE\",\n ],\n },\n },\n factCategories: {\n description: \"Optional public fact category filters. Supported values: MEMORY, CUSTOM.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"MEMORY\", \"CUSTOM\"],\n },\n },\n after: {\n description: \"ISO 8601 datetime lower bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n before: {\n description: \"ISO 8601 datetime upper bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n limit: {\n description: \"Results per page (max 100)\",\n default: 50,\n type: \"number\",\n minimum: 1,\n maximum: 100,\n },\n cursor: {\n description: \"Pagination cursor from previous response\",\n type: \"string\",\n },\n },\n required: [\"customer\"],\n additionalProperties: false,\n },\n },\n outlit_get_fact: {\n toolName: \"outlit_get_fact\",\n title: \"Get Customer Fact\",\n description:\n \"Get one exact fact by ID. Returns the canonical fact shape and optionally expands requested related data such as evidence.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n factId: {\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n description: \"Exact fact ID to retrieve\",\n },\n include: {\n description:\n \"Optional best-effort expansions. Use include=['evidence'] to request evidence when available; unsupported include values are ignored.\",\n type: \"array\",\n items: {\n type: \"string\",\n minLength: 1,\n maxLength: 100,\n },\n },\n },\n required: [\"factId\"],\n additionalProperties: false,\n },\n },\n outlit_get_source: {\n toolName: \"outlit_get_source\",\n title: \"Get Source\",\n description:\n \"Get one exact source record by generic sourceType and sourceId. Use this when you already know the concrete underlying source you want to inspect.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n sourceType: {\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n sourceId: {\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n },\n },\n required: [\"sourceType\", \"sourceId\"],\n additionalProperties: false,\n },\n },\n outlit_list_sources: {\n toolName: \"outlit_list_sources\",\n title: \"List Sources\",\n description:\n \"List concrete source records deterministically. Use this instead of semantic search when you need enumerated calls, emails, calendar events, support tickets, or opportunities.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n sourceType: {\n description: \"Generic source type to list.\",\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n customer: {\n description: \"Customer ID, domain, or name to scope source listing.\",\n type: \"string\",\n minLength: 1,\n maxLength: 200,\n },\n after: {\n description: \"ISO 8601 datetime lower bound.\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n before: {\n description: \"ISO 8601 datetime upper bound.\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n participant: {\n description: \"Participant email or name to filter source records.\",\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n },\n provider: {\n description: \"Provider identifier such as gmail, gong, or google-calendar.\",\n type: \"string\",\n minLength: 1,\n maxLength: 200,\n },\n hasTranscript: {\n description: \"Filter call sources by transcript presence.\",\n type: \"boolean\",\n },\n limit: {\n description: \"Results per page.\",\n default: 50,\n type: \"integer\",\n minimum: 1,\n maximum: 100,\n },\n cursor: {\n description: \"Pagination cursor.\",\n type: \"string\",\n minLength: 1,\n maxLength: 2000,\n },\n },\n additionalProperties: false,\n },\n },\n outlit_search_customer_context: {\n toolName: \"outlit_search_customer_context\",\n title: \"Search Customer Context\",\n description:\n \"Search across all known customer context using a natural-language query. Returns ranked artifact-level discovery previews with at most two matching excerpts per source or fact. Use outlit_get_source with a returned sourceType and sourceId when you need the canonical source contents. Omit customer to search across all customers in the organization.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n customer: {\n description: \"Customer ID, domain, or name. Omit to search across all customers.\",\n anyOf: [\n {\n type: \"string\",\n minLength: 1,\n maxLength: 500,\n },\n {\n type: \"null\",\n },\n ],\n },\n query: {\n type: \"string\",\n minLength: 2,\n maxLength: 2000,\n description: \"Natural language query or topic to search for.\",\n },\n topK: {\n description: \"Maximum number of artifact results to return (default 20).\",\n type: \"integer\",\n minimum: 1,\n maximum: 50,\n },\n after: {\n description: \"ISO 8601 datetime lower bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n before: {\n description: \"ISO 8601 datetime upper bound\",\n type: \"string\",\n format: \"date-time\",\n pattern:\n \"^(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))T(?:(?:[01]\\\\d|2[0-3]):[0-5]\\\\d(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?(?:Z))$\",\n },\n sourceTypes: {\n description: \"Optional generic source types to restrict the search to.\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: customerSourceTypeInputs,\n },\n },\n },\n required: [\"query\"],\n additionalProperties: false,\n },\n },\n outlit_query: {\n toolName: \"outlit_query\",\n title: \"Run SQL Query\",\n description:\n \"Execute read-only SQL queries against your analytics views.\\n\\nAvailable views:\\n- activity: Customer activity events (event_name, event_type, event_channel, customer_id, occurred_at, properties, ...)\\n- customers: Customer attributes (customer_id, domain, name, billing_status, plan, mrr_cents, traits, ...)\\n- users: User attributes (user_id, email, name, customer_id, traits, ...)\\n- revenue: Revenue snapshots over time (customer_id, snapshot_date, mrr_cents, ...)\\n\\nAll queries are automatically filtered to your organization's data.\\nOnly SELECT queries are allowed.\\nProperties and traits are JSON strings; inspect schemas and examples before filtering nested values.\\n\\nExample queries:\\n- SELECT event_name, count(*) FROM activity GROUP BY 1 ORDER BY 2 DESC LIMIT 10\\n- SELECT billing_status, sum(mrr_cents)/100 as mrr FROM customers GROUP BY 1\\n- SELECT * FROM activity WHERE customer_id = 'cust_123' ORDER BY occurred_at DESC LIMIT 50\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n sql: {\n type: \"string\",\n description: \"SQL SELECT query to execute\",\n },\n limit: {\n description: \"Max rows to return (default 1000, max 10000)\",\n default: 1000,\n type: \"integer\",\n minimum: 1,\n maximum: 10000,\n },\n },\n required: [\"sql\"],\n additionalProperties: false,\n },\n },\n outlit_schema: {\n toolName: \"outlit_schema\",\n title: \"Get SQL Schema\",\n description:\n \"Get schemas for available analytics views.\\n\\nUse this to discover column names, types, and descriptions before writing SQL queries.\\nReturns column definitions and example queries for each view.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n table: {\n description: \"Specific analytics view to describe. Omit to list all views.\",\n type: \"string\",\n enum: [\"activity\", \"customers\", \"users\", \"revenue\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_send_notification: {\n toolName: \"outlit_send_notification\",\n title: \"Send Notification\",\n description:\n \"Send or post a notification. Use only when the user explicitly asks you to send, post, or notify. Slack is the default notifier when destinations are omitted.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n title: {\n type: \"string\",\n minLength: 1,\n maxLength: 160,\n description: \"Notification title\",\n },\n markdown: {\n description: \"Markdown notification body rendered for the target provider\",\n type: \"string\",\n minLength: 1,\n maxLength: 100000,\n },\n payload: {\n description:\n \"Optional JSON-compatible payload. Serialized size must be 100,000 characters or fewer.\",\n $ref: \"#/$defs/__schema0\",\n },\n message: {\n description: \"Optional summary message\",\n type: \"string\",\n minLength: 1,\n maxLength: 1200,\n },\n severity: {\n description: \"Optional notification severity\",\n type: \"string\",\n enum: [\"low\", \"medium\", \"high\"],\n },\n source: {\n description: \"Optional source label\",\n type: \"string\",\n minLength: 1,\n maxLength: 120,\n },\n subject: {\n description: \"Optional subject line\",\n type: \"string\",\n minLength: 1,\n maxLength: 240,\n },\n destinationIds: {\n description: \"Optional NotificationDestination ids. Omit to use the default notifier.\",\n minItems: 1,\n maxItems: 10,\n type: \"array\",\n items: {\n type: \"string\",\n format: \"uuid\",\n pattern:\n \"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$\",\n },\n },\n },\n required: [\"title\"],\n additionalProperties: false,\n $defs: {\n __schema0: {\n anyOf: [\n {\n type: \"string\",\n },\n {\n type: \"number\",\n },\n {\n type: \"boolean\",\n },\n {\n type: \"null\",\n },\n {\n type: \"array\",\n items: {\n $ref: \"#/$defs/__schema0\",\n },\n },\n {\n type: \"object\",\n propertyNames: {\n type: \"string\",\n },\n additionalProperties: {\n $ref: \"#/$defs/__schema0\",\n },\n },\n ],\n },\n },\n },\n },\n} as const\n\nexport const customerBillingStatuses = [\n \"NONE\",\n \"TRIALING\",\n \"PAYING\",\n \"PAST_DUE\",\n \"CHURNED\",\n] as const\n\nexport const customerActivityWindows = [\"7d\", \"14d\", \"30d\", \"90d\"] as const\n\nexport const customerFactStatuses = [\n \"ACTIVE\",\n \"ACKNOWLEDGED\",\n \"RESOLVED\",\n \"SNOOZED\",\n \"CANDIDATE\",\n] as const\n\nexport const customerFactIncludes = [\"evidence\"] as const\n\nexport const customerFactTypes = [\n \"CUSTOM\",\n \"COMPANY_CHANGE\",\n \"FUNDING_REVENUE\",\n \"TECHNOLOGY\",\n \"STRATEGY\",\n \"COMPETITIVE\",\n \"SENTIMENT\",\n \"CHAMPION_RISK\",\n \"EXPANSION\",\n \"CHURN_RISK\",\n \"TIMELINE\",\n \"BUDGET\",\n \"DECISION_MAKER\",\n \"REQUIREMENTS\",\n \"PRODUCT_USAGE\",\n \"CONTACT_INFO\",\n \"CONTACT_PREFERENCE\",\n] as const\n\nexport const unsupportedCustomerFactTypes = [\n \"TRACKING_GAP\",\n \"SCHEMA_DRIFT\",\n \"INGESTION_LAG\",\n \"ACTIVATION_RATE_DROP\",\n \"FUNNEL_DROPOFF\",\n \"CORE_ACTION_DECAY\",\n \"CADENCE_BREAK\",\n \"QUIET_ACCOUNT\",\n \"CHAMPION_AT_RISK\",\n \"SEGMENT_DIVERGENCE\",\n] as const\n\nexport const customerFactCategories = [\"MEMORY\", \"CUSTOM\"] as const\n\nexport const customerListOrderFields = [\n \"last_activity_at\",\n \"first_seen_at\",\n \"name\",\n \"mrr_cents\",\n] as const\n\nexport const customerIncludeSections = [\n \"users\",\n \"revenue\",\n \"recentTimeline\",\n \"behaviorMetrics\",\n] as const\n\nexport const customerTimeframes = [\"7d\", \"14d\", \"30d\", \"90d\"] as const\n\nexport const notificationProviderValues = [\"slack\"] as const\n\nexport const notificationSeverityValues = [\"low\", \"medium\", \"high\"] as const\n\nexport const timelineChannels = [\n \"PRODUCT\",\n \"COMMUNICATION\",\n \"MEETING\",\n \"CRM\",\n \"BILLING\",\n \"SUPPORT\",\n \"IDENTITY\",\n \"DOCUMENT\",\n \"SYSTEM\",\n] as const\n\nexport const timelineTimeframes = [\"7d\", \"14d\", \"30d\", \"90d\", \"all\"] as const\n\nexport const userJourneyStages = [\n \"DISCOVERED\",\n \"SIGNED_UP\",\n \"ACTIVATED\",\n \"ENGAGED\",\n \"INACTIVE\",\n] as const\n\nexport const userListOrderFields = [\"last_activity_at\", \"first_seen_at\", \"email\"] as const\n\nexport const workspaceUserListOrderFields = [\"name\", \"email\", \"owned_customer_count\"] as const\n\nexport const schemaTables = [\"activity\", \"customers\", \"users\", \"revenue\"] as const\n\nexport const customerToolContractHash =\n \"f1f06ac1d3fb5131095ac7047f5871f47942b0f5efcb1229151b52475bf93816\" as const\n\nexport type CustomerToolName = (typeof customerToolNames)[number]\nexport type CustomerSourceType = (typeof customerSourceTypes)[number]\nexport type CustomerSourceTypeInput = (typeof customerSourceTypeInputs)[number]\n\nexport type CustomerToolContract = {\n toolName: CustomerToolName\n title: string\n description: string\n inputSchema: JsonSchema\n}\n\nconst customerToolNameSet = new Set<string>(customerToolNames)\nconst customerSourceTypeSet = new Set<string>(customerSourceTypes)\nconst customerSourceTypeAliasMap = new Map<\n (typeof customerSourceTypeAliases)[number],\n CustomerSourceType\n>([\n [\"CRM\", \"OPPORTUNITY\"],\n [\"CRM_OPPORTUNITY\", \"OPPORTUNITY\"],\n])\nconst iso8601UtcDateTimeRegex =\n /^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/\n\nexport function isCustomerToolName(value: string): value is CustomerToolName {\n return customerToolNameSet.has(value)\n}\n\nexport function getCustomerToolContract(name: CustomerToolName): CustomerToolContract {\n return customerToolContracts[name]\n}\n\nexport function normalizeCustomerSourceType(value: string): CustomerSourceType | null {\n const normalized = value.trim().toUpperCase()\n if (customerSourceTypeSet.has(normalized)) {\n return normalized as CustomerSourceType\n }\n\n return (\n customerSourceTypeAliasMap.get(normalized as (typeof customerSourceTypeAliases)[number]) ?? null\n )\n}\n\nexport type SearchArgsLike = {\n query?: string\n customer?: string | null\n topK?: number\n after?: string\n before?: string\n sourceTypes?: string[]\n}\n\nexport type CustomerContextSearchInput = {\n query: string\n customer?: string | null\n topK?: number\n after?: string\n before?: string\n sourceTypes?: CustomerSourceType[]\n}\n\nexport function resolveCustomerContextSearchInput(value: SearchArgsLike):\n | { ok: true; request: CustomerContextSearchInput }\n | {\n ok: false\n message: string\n } {\n if (!value.query) {\n return {\n ok: false,\n message: \"A query argument is required\",\n }\n }\n\n const normalizedQuery = value.query.trim()\n if (normalizedQuery.length < 2) {\n return {\n ok: false,\n message: \"Query must be at least 2 non-whitespace characters\",\n }\n }\n\n if (value.after !== undefined && !iso8601UtcDateTimeRegex.test(value.after)) {\n return {\n ok: false,\n message: \"--after must be a valid ISO 8601 datetime\",\n }\n }\n\n const afterTime = value.after === undefined ? undefined : new Date(value.after).getTime()\n if (afterTime !== undefined && Number.isNaN(afterTime)) {\n return {\n ok: false,\n message: \"--after must be a valid ISO 8601 datetime\",\n }\n }\n\n if (value.before !== undefined && !iso8601UtcDateTimeRegex.test(value.before)) {\n return {\n ok: false,\n message: \"--before must be a valid ISO 8601 datetime\",\n }\n }\n\n const beforeTime = value.before === undefined ? undefined : new Date(value.before).getTime()\n if (beforeTime !== undefined && Number.isNaN(beforeTime)) {\n return {\n ok: false,\n message: \"--before must be a valid ISO 8601 datetime\",\n }\n }\n\n if (afterTime !== undefined && beforeTime !== undefined && afterTime > beforeTime) {\n return {\n ok: false,\n message: \"--after must be before or equal to --before\",\n }\n }\n\n const invalidSourceTypes =\n value.sourceTypes?.filter((sourceType) => !normalizeCustomerSourceType(sourceType)) ?? []\n if (invalidSourceTypes.length > 0) {\n return {\n ok: false,\n message: `Unknown source types: ${invalidSourceTypes.join(\", \")}. Allowed: ${customerSourceTypeInputs.join(\", \")}`,\n }\n }\n\n const normalizedSourceTypes = value.sourceTypes\n ? Array.from(\n new Set(value.sourceTypes.map((sourceType) => normalizeCustomerSourceType(sourceType))),\n ).filter((sourceType): sourceType is CustomerSourceType => sourceType !== null)\n : undefined\n\n return {\n ok: true,\n request: {\n query: normalizedQuery,\n customer: value.customer,\n topK: value.topK,\n after: value.after,\n before: value.before,\n sourceTypes: normalizedSourceTypes,\n },\n }\n}\n","import { type CustomerToolName, isCustomerToolName } from \"./contracts.js\"\nimport type { CustomerDetailResult, CustomerListResult } from \"./results.js\"\n\nexport const DEFAULT_OUTLIT_API_URL = \"https://app.outlit.ai\"\n\nexport type OutlitToolsFetch = (\n input: string | URL | Request,\n init?: RequestInit,\n) => Promise<Response>\n\nexport type OutlitToolsClientOptions = {\n apiKey: string\n baseUrl?: string\n fetch?: OutlitToolsFetch\n}\n\nexport type CustomerToolResult<TToolName extends CustomerToolName> =\n TToolName extends \"outlit_list_customers\"\n ? CustomerListResult\n : TToolName extends \"outlit_get_customer\"\n ? CustomerDetailResult\n : unknown\n\nexport type OutlitToolsClient = {\n key: string\n baseUrl: string\n callTool<TToolName extends CustomerToolName>(\n toolName: TToolName,\n input?: Record<string, unknown>,\n ): Promise<CustomerToolResult<TToolName>>\n}\n\nexport function createOutlitClient(options: OutlitToolsClientOptions): OutlitToolsClient {\n const key = options.apiKey.trim()\n const baseUrl = options.baseUrl ?? DEFAULT_OUTLIT_API_URL\n const fetchImpl = options.fetch ?? globalThis.fetch\n\n if (!key) {\n throw new Error(\"apiKey is required\")\n }\n\n if (!fetchImpl) {\n throw new Error(\"fetch is not available\")\n }\n\n return {\n key,\n baseUrl,\n async callTool<TToolName extends CustomerToolName>(\n toolName: TToolName,\n input: Record<string, unknown> = {},\n ): Promise<CustomerToolResult<TToolName>> {\n if (!isCustomerToolName(toolName)) {\n throw new Error(`Unknown customer tool: ${toolName}`)\n }\n\n const response = await fetchImpl(new URL(\"/api/tools/call\", baseUrl).toString(), {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${key}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n tool: toolName,\n input,\n }),\n })\n\n if (!response.ok) {\n const text = await response.text()\n throw new Error(`API error (${response.status}): ${text}`)\n }\n\n return (await response.json()) as CustomerToolResult<TToolName>\n },\n }\n}\n","import { type CustomerToolName, customerToolNames } from \"./contracts.js\"\n\nexport const actionToolNames = [\n \"outlit_send_notification\",\n] as const satisfies readonly CustomerToolName[]\n\nexport const defaultAgentToolNames = [\n \"outlit_list_customers\",\n \"outlit_list_users\",\n \"outlit_list_workspace_users\",\n \"outlit_get_customer\",\n \"outlit_get_timeline\",\n \"outlit_list_facts\",\n \"outlit_get_fact\",\n \"outlit_get_source\",\n \"outlit_search_customer_context\",\n ...actionToolNames,\n] as const satisfies readonly CustomerToolName[]\n\nexport const sqlToolNames = [\n \"outlit_schema\",\n \"outlit_query\",\n] as const satisfies readonly CustomerToolName[]\n\nexport const analyticalAgentToolNames = [\n ...defaultAgentToolNames,\n ...sqlToolNames,\n] as const satisfies readonly CustomerToolName[]\n\nexport const allCustomerToolNames = customerToolNames\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIO,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,4BAA4B,CAAC,OAAO,iBAAiB;AAE3D,IAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,IAAM,wBAAwB;AAAA,EACnC,uBAAuB;AAAA,IACrB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,aACE;AAAA,IACF,aAAa;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,YAAY;AAAA,QACV,gBAAgB;AAAA,UACd,aAAa;AAAA,UACb,MAAM;AAAA,UACN,QAAQ;AAAA,UACR,SACE;AAAA,QACJ;AAAA,QACA,eAAe;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MA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