@outlit/tools 0.1.1 → 0.1.2
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.
- package/dist/index.cjs +69 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -16
- package/dist/index.d.ts +22 -16
- package/dist/index.js +66 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -33,6 +33,8 @@ __export(src_exports, {
|
|
|
33
33
|
customerFactTypes: () => customerFactTypes,
|
|
34
34
|
customerIncludeSections: () => customerIncludeSections,
|
|
35
35
|
customerListOrderFields: () => customerListOrderFields,
|
|
36
|
+
customerSourceTypeAliases: () => customerSourceTypeAliases,
|
|
37
|
+
customerSourceTypeInputs: () => customerSourceTypeInputs,
|
|
36
38
|
customerSourceTypes: () => customerSourceTypes,
|
|
37
39
|
customerTimeframes: () => customerTimeframes,
|
|
38
40
|
customerToolContractHash: () => customerToolContractHash,
|
|
@@ -41,6 +43,7 @@ __export(src_exports, {
|
|
|
41
43
|
defaultAgentToolNames: () => defaultAgentToolNames,
|
|
42
44
|
getCustomerToolContract: () => getCustomerToolContract,
|
|
43
45
|
isCustomerToolName: () => isCustomerToolName,
|
|
46
|
+
normalizeCustomerSourceType: () => normalizeCustomerSourceType,
|
|
44
47
|
notificationSeverityValues: () => notificationSeverityValues,
|
|
45
48
|
resolveCustomerContextSearchInput: () => resolveCustomerContextSearchInput,
|
|
46
49
|
schemaTables: () => schemaTables,
|
|
@@ -67,6 +70,23 @@ var customerToolNames = [
|
|
|
67
70
|
"outlit_schema",
|
|
68
71
|
"outlit_send_notification"
|
|
69
72
|
];
|
|
73
|
+
var customerSourceTypes = [
|
|
74
|
+
"EMAIL",
|
|
75
|
+
"CALL",
|
|
76
|
+
"CALENDAR_EVENT",
|
|
77
|
+
"SUPPORT_TICKET",
|
|
78
|
+
"OPPORTUNITY"
|
|
79
|
+
];
|
|
80
|
+
var customerSourceTypeAliases = ["CRM", "CRM_OPPORTUNITY"];
|
|
81
|
+
var customerSourceTypeInputs = [
|
|
82
|
+
"EMAIL",
|
|
83
|
+
"CALL",
|
|
84
|
+
"CALENDAR_EVENT",
|
|
85
|
+
"SUPPORT_TICKET",
|
|
86
|
+
"OPPORTUNITY",
|
|
87
|
+
"CRM",
|
|
88
|
+
"CRM_OPPORTUNITY"
|
|
89
|
+
];
|
|
70
90
|
var customerToolContracts = {
|
|
71
91
|
outlit_list_customers: {
|
|
72
92
|
toolName: "outlit_list_customers",
|
|
@@ -277,11 +297,21 @@ var customerToolContracts = {
|
|
|
277
297
|
description: "Customer ID or domain"
|
|
278
298
|
},
|
|
279
299
|
channels: {
|
|
280
|
-
description: "Filter by event channel (e.g., EMAIL, SLACK, CALL)",
|
|
300
|
+
description: "Filter by event channel (e.g., EMAIL, SLACK, CALL, CALENDAR)",
|
|
281
301
|
type: "array",
|
|
282
302
|
items: {
|
|
283
303
|
type: "string",
|
|
284
|
-
enum: [
|
|
304
|
+
enum: [
|
|
305
|
+
"SDK",
|
|
306
|
+
"EMAIL",
|
|
307
|
+
"SLACK",
|
|
308
|
+
"CALL",
|
|
309
|
+
"CALENDAR",
|
|
310
|
+
"CRM",
|
|
311
|
+
"BILLING",
|
|
312
|
+
"SUPPORT",
|
|
313
|
+
"INTERNAL"
|
|
314
|
+
]
|
|
285
315
|
}
|
|
286
316
|
},
|
|
287
317
|
eventTypes: {
|
|
@@ -348,7 +378,7 @@ var customerToolContracts = {
|
|
|
348
378
|
type: "array",
|
|
349
379
|
items: {
|
|
350
380
|
type: "string",
|
|
351
|
-
enum:
|
|
381
|
+
enum: customerSourceTypeInputs
|
|
352
382
|
}
|
|
353
383
|
},
|
|
354
384
|
factTypes: {
|
|
@@ -449,7 +479,7 @@ var customerToolContracts = {
|
|
|
449
479
|
properties: {
|
|
450
480
|
sourceType: {
|
|
451
481
|
type: "string",
|
|
452
|
-
enum:
|
|
482
|
+
enum: customerSourceTypeInputs
|
|
453
483
|
},
|
|
454
484
|
sourceId: {
|
|
455
485
|
type: "string",
|
|
@@ -510,7 +540,7 @@ var customerToolContracts = {
|
|
|
510
540
|
type: "array",
|
|
511
541
|
items: {
|
|
512
542
|
type: "string",
|
|
513
|
-
enum:
|
|
543
|
+
enum: customerSourceTypeInputs
|
|
514
544
|
}
|
|
515
545
|
}
|
|
516
546
|
},
|
|
@@ -520,7 +550,7 @@ var customerToolContracts = {
|
|
|
520
550
|
},
|
|
521
551
|
outlit_query: {
|
|
522
552
|
toolName: "outlit_query",
|
|
523
|
-
description: "Execute
|
|
553
|
+
description: "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",
|
|
524
554
|
inputSchema: {
|
|
525
555
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
526
556
|
type: "object",
|
|
@@ -532,7 +562,8 @@ var customerToolContracts = {
|
|
|
532
562
|
limit: {
|
|
533
563
|
description: "Max rows to return (default 1000, max 10000)",
|
|
534
564
|
default: 1e3,
|
|
535
|
-
type: "
|
|
565
|
+
type: "integer",
|
|
566
|
+
minimum: 1,
|
|
536
567
|
maximum: 1e4
|
|
537
568
|
}
|
|
538
569
|
},
|
|
@@ -542,15 +573,15 @@ var customerToolContracts = {
|
|
|
542
573
|
},
|
|
543
574
|
outlit_schema: {
|
|
544
575
|
toolName: "outlit_schema",
|
|
545
|
-
description: "Get
|
|
576
|
+
description: "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.",
|
|
546
577
|
inputSchema: {
|
|
547
578
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
548
579
|
type: "object",
|
|
549
580
|
properties: {
|
|
550
581
|
table: {
|
|
551
|
-
description: "Specific
|
|
582
|
+
description: "Specific analytics view to describe. Omit to list all views.",
|
|
552
583
|
type: "string",
|
|
553
|
-
enum: ["
|
|
584
|
+
enum: ["activity", "customers", "users", "revenue"]
|
|
554
585
|
}
|
|
555
586
|
},
|
|
556
587
|
additionalProperties: false
|
|
@@ -724,7 +755,6 @@ var customerIncludeSections = [
|
|
|
724
755
|
"recentTimeline",
|
|
725
756
|
"behaviorMetrics"
|
|
726
757
|
];
|
|
727
|
-
var customerSourceTypes = ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
728
758
|
var customerTimeframes = ["7d", "14d", "30d", "90d"];
|
|
729
759
|
var notificationSeverityValues = ["low", "medium", "high"];
|
|
730
760
|
var timelineChannels = [
|
|
@@ -732,6 +762,7 @@ var timelineChannels = [
|
|
|
732
762
|
"EMAIL",
|
|
733
763
|
"SLACK",
|
|
734
764
|
"CALL",
|
|
765
|
+
"CALENDAR",
|
|
735
766
|
"CRM",
|
|
736
767
|
"BILLING",
|
|
737
768
|
"SUPPORT",
|
|
@@ -746,14 +777,14 @@ var userJourneyStages = [
|
|
|
746
777
|
"INACTIVE"
|
|
747
778
|
];
|
|
748
779
|
var userListOrderFields = ["last_activity_at", "first_seen_at", "email"];
|
|
749
|
-
var schemaTables = [
|
|
750
|
-
|
|
751
|
-
"customer_dimensions",
|
|
752
|
-
"user_dimensions",
|
|
753
|
-
"mrr_snapshots"
|
|
754
|
-
];
|
|
755
|
-
var customerToolContractHash = "b778bd2aae7899361ac9ae4f098f4627582cd8513a1e686125ee2d44e3b5a082";
|
|
780
|
+
var schemaTables = ["activity", "customers", "users", "revenue"];
|
|
781
|
+
var customerToolContractHash = "f619a7dcc1845bc494a193d11e76c6fcee66ecaa2ea60a9a30b51750feb8b11a";
|
|
756
782
|
var customerToolNameSet = new Set(customerToolNames);
|
|
783
|
+
var customerSourceTypeSet = new Set(customerSourceTypes);
|
|
784
|
+
var customerSourceTypeAliasMap = /* @__PURE__ */ new Map([
|
|
785
|
+
["CRM", "OPPORTUNITY"],
|
|
786
|
+
["CRM_OPPORTUNITY", "OPPORTUNITY"]
|
|
787
|
+
]);
|
|
757
788
|
var iso8601UtcDateTimeRegex = /^(?:(?:\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))$/;
|
|
758
789
|
function isCustomerToolName(value) {
|
|
759
790
|
return customerToolNameSet.has(value);
|
|
@@ -761,6 +792,12 @@ function isCustomerToolName(value) {
|
|
|
761
792
|
function getCustomerToolContract(name) {
|
|
762
793
|
return customerToolContracts[name];
|
|
763
794
|
}
|
|
795
|
+
function normalizeCustomerSourceType(value) {
|
|
796
|
+
if (customerSourceTypeSet.has(value)) {
|
|
797
|
+
return value;
|
|
798
|
+
}
|
|
799
|
+
return customerSourceTypeAliasMap.get(value) ?? null;
|
|
800
|
+
}
|
|
764
801
|
function resolveCustomerContextSearchInput(value) {
|
|
765
802
|
if (!value.query) {
|
|
766
803
|
return {
|
|
@@ -807,6 +844,16 @@ function resolveCustomerContextSearchInput(value) {
|
|
|
807
844
|
message: "--after must be before or equal to --before"
|
|
808
845
|
};
|
|
809
846
|
}
|
|
847
|
+
const invalidSourceTypes = value.sourceTypes?.filter((sourceType) => !normalizeCustomerSourceType(sourceType)) ?? [];
|
|
848
|
+
if (invalidSourceTypes.length > 0) {
|
|
849
|
+
return {
|
|
850
|
+
ok: false,
|
|
851
|
+
message: `Unknown source types: ${invalidSourceTypes.join(", ")}. Allowed: ${customerSourceTypeInputs.join(", ")}`
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
const normalizedSourceTypes = value.sourceTypes ? Array.from(
|
|
855
|
+
new Set(value.sourceTypes.map((sourceType) => normalizeCustomerSourceType(sourceType)))
|
|
856
|
+
).filter((sourceType) => sourceType !== null) : void 0;
|
|
810
857
|
return {
|
|
811
858
|
ok: true,
|
|
812
859
|
request: {
|
|
@@ -815,7 +862,7 @@ function resolveCustomerContextSearchInput(value) {
|
|
|
815
862
|
topK: value.topK,
|
|
816
863
|
after: value.after,
|
|
817
864
|
before: value.before,
|
|
818
|
-
sourceTypes:
|
|
865
|
+
sourceTypes: normalizedSourceTypes
|
|
819
866
|
}
|
|
820
867
|
};
|
|
821
868
|
}
|
|
@@ -898,6 +945,8 @@ var allCustomerToolNames = customerToolNames;
|
|
|
898
945
|
customerFactTypes,
|
|
899
946
|
customerIncludeSections,
|
|
900
947
|
customerListOrderFields,
|
|
948
|
+
customerSourceTypeAliases,
|
|
949
|
+
customerSourceTypeInputs,
|
|
901
950
|
customerSourceTypes,
|
|
902
951
|
customerTimeframes,
|
|
903
952
|
customerToolContractHash,
|
|
@@ -906,6 +955,7 @@ var allCustomerToolNames = customerToolNames;
|
|
|
906
955
|
defaultAgentToolNames,
|
|
907
956
|
getCustomerToolContract,
|
|
908
957
|
isCustomerToolName,
|
|
958
|
+
normalizeCustomerSourceType,
|
|
909
959
|
notificationSeverityValues,
|
|
910
960
|
resolveCustomerContextSearchInput,
|
|
911
961
|
schemaTables,
|
package/dist/index.cjs.map
CHANGED
|
@@ -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 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 customerSourceTypes,\n customerTimeframes,\n customerToolContractHash,\n customerToolContracts,\n customerToolNames,\n getCustomerToolContract,\n isCustomerToolName,\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 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)\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"SDK\", \"EMAIL\", \"SLACK\", \"CALL\", \"CRM\", \"BILLING\", \"SUPPORT\", \"INTERNAL\"],\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: [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"],\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: [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"],\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: [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"],\n },\n },\n },\n required: [\"query\"],\n additionalProperties: false,\n },\n },\n outlit_query: {\n toolName: \"outlit_query\",\n description:\n \"Execute raw SQL queries against your analytics data.\\n\\nAvailable tables:\\n- events: Customer activity events (event_name, event_type, event_channel, customer_id, occurred_at, properties, ...)\\n- customer_dimensions: Customer attributes (customer_id, domain, name, billing_status, plan, mrr_cents, ...)\\n- user_dimensions: User attributes (user_id, email, name, customer_id, ...)\\n- mrr_snapshots: 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.\\n\\nExample queries:\\n- SELECT event_name, count(*) FROM events GROUP BY 1 ORDER BY 2 DESC LIMIT 10\\n- SELECT billing_status, sum(mrr_cents)/100 as mrr FROM customer_dimensions GROUP BY 1\\n- SELECT * FROM events 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: \"number\",\n maximum: 10000,\n },\n },\n required: [\"sql\"],\n additionalProperties: false,\n },\n },\n outlit_schema: {\n toolName: \"outlit_schema\",\n description:\n \"Get table schemas for available analytics tables.\\n\\nUse this to discover column names, types, and descriptions before writing SQL queries.\\nReturns column definitions and example queries for each table.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n table: {\n description: \"Specific table to describe, or omit for all tables\",\n type: \"string\",\n enum: [\"events\", \"customer_dimensions\", \"user_dimensions\", \"mrr_snapshots\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_send_notification: {\n toolName: \"outlit_send_notification\",\n description:\n \"Send or post a Slack notification. Use only when the user explicitly asks you to send, post, or notify. The payload is rendered as a Slack code block.\",\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 payload: {\n description:\n \"JSON-compatible payload rendered in Slack as a code block. Serialized size must be 100,000 characters or fewer.\",\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 $ref: \"#/$defs/__schema0\",\n },\n message: {\n description: \"Optional Slack 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 },\n required: [\"title\", \"payload\"],\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 customerSourceTypes = [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"] 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 \"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 = [\n \"events\",\n \"customer_dimensions\",\n \"user_dimensions\",\n \"mrr_snapshots\",\n] as const\n\nexport const customerToolContractHash =\n \"b778bd2aae7899361ac9ae4f098f4627582cd8513a1e686125ee2d44e3b5a082\" as const\n\nexport type CustomerToolName = (typeof customerToolNames)[number]\n\nexport type CustomerToolContract = {\n toolName: CustomerToolName\n description: string\n inputSchema: JsonSchema\n}\n\nconst customerToolNameSet = new Set<string>(customerToolNames)\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 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?: string[]\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 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: value.sourceTypes,\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;;;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,wBAAwB;AAAA,EACnC,uBAAuB;AAAA,IACrB,UAAU;AAAA,IACV,aACE;AAAA,IACF,aAAa;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,YAAY;AAAA,QACV,eAAe;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,QAAQ,YAAY,UAAU,YAAY,SAAS;AAAA,QAC5D;AAAA,QACA,mBAAmB;AAAA,UACjB,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,MAAM,OAAO,OAAO,KAAK;AAAA,QAClC;AAAA,QACA,kBAAkB;AAAA,UAChB,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,MAAM,OAAO,OAAO,KAAK;AAAA,QAClC;AAAA,QACA,UAAU;AAAA,UACR,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS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A,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 { 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 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 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 Slack notification. Use only when the user explicitly asks you to send, post, or notify. The payload is rendered as a Slack code block.\",\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 payload: {\n description:\n \"JSON-compatible payload rendered in Slack as a code block. Serialized size must be 100,000 characters or fewer.\",\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 $ref: \"#/$defs/__schema0\",\n },\n message: {\n description: \"Optional Slack 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 },\n required: [\"title\", \"payload\"],\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 \"f619a7dcc1845bc494a193d11e76c6fcee66ecaa2ea60a9a30b51750feb8b11a\" 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 if (customerSourceTypeSet.has(value)) {\n return value as CustomerSourceType\n }\n\n return customerSourceTypeAliasMap.get(value as (typeof customerSourceTypeAliases)[number]) ?? null\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;A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,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":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -2,6 +2,9 @@ type JsonSchema = {
|
|
|
2
2
|
readonly [key: string]: unknown;
|
|
3
3
|
};
|
|
4
4
|
declare const customerToolNames: readonly ["outlit_list_customers", "outlit_list_users", "outlit_get_customer", "outlit_get_timeline", "outlit_list_facts", "outlit_get_fact", "outlit_get_source", "outlit_search_customer_context", "outlit_query", "outlit_schema", "outlit_send_notification"];
|
|
5
|
+
declare const customerSourceTypes: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY"];
|
|
6
|
+
declare const customerSourceTypeAliases: readonly ["CRM", "CRM_OPPORTUNITY"];
|
|
7
|
+
declare const customerSourceTypeInputs: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
5
8
|
declare const customerToolContracts: {
|
|
6
9
|
readonly outlit_list_customers: {
|
|
7
10
|
readonly toolName: "outlit_list_customers";
|
|
@@ -204,11 +207,11 @@ declare const customerToolContracts: {
|
|
|
204
207
|
readonly description: "Customer ID or domain";
|
|
205
208
|
};
|
|
206
209
|
readonly channels: {
|
|
207
|
-
readonly description: "Filter by event channel (e.g., EMAIL, SLACK, CALL)";
|
|
210
|
+
readonly description: "Filter by event channel (e.g., EMAIL, SLACK, CALL, CALENDAR)";
|
|
208
211
|
readonly type: "array";
|
|
209
212
|
readonly items: {
|
|
210
213
|
readonly type: "string";
|
|
211
|
-
readonly enum: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
214
|
+
readonly enum: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CALENDAR", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
212
215
|
};
|
|
213
216
|
};
|
|
214
217
|
readonly eventTypes: {
|
|
@@ -275,7 +278,7 @@ declare const customerToolContracts: {
|
|
|
275
278
|
readonly type: "array";
|
|
276
279
|
readonly items: {
|
|
277
280
|
readonly type: "string";
|
|
278
|
-
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
281
|
+
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
279
282
|
};
|
|
280
283
|
};
|
|
281
284
|
readonly factTypes: {
|
|
@@ -358,7 +361,7 @@ declare const customerToolContracts: {
|
|
|
358
361
|
readonly properties: {
|
|
359
362
|
readonly sourceType: {
|
|
360
363
|
readonly type: "string";
|
|
361
|
-
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
364
|
+
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
362
365
|
};
|
|
363
366
|
readonly sourceId: {
|
|
364
367
|
readonly type: "string";
|
|
@@ -416,7 +419,7 @@ declare const customerToolContracts: {
|
|
|
416
419
|
readonly type: "array";
|
|
417
420
|
readonly items: {
|
|
418
421
|
readonly type: "string";
|
|
419
|
-
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
422
|
+
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
420
423
|
};
|
|
421
424
|
};
|
|
422
425
|
};
|
|
@@ -426,7 +429,7 @@ declare const customerToolContracts: {
|
|
|
426
429
|
};
|
|
427
430
|
readonly outlit_query: {
|
|
428
431
|
readonly toolName: "outlit_query";
|
|
429
|
-
readonly description: "Execute
|
|
432
|
+
readonly description: "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";
|
|
430
433
|
readonly inputSchema: {
|
|
431
434
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
432
435
|
readonly type: "object";
|
|
@@ -438,7 +441,8 @@ declare const customerToolContracts: {
|
|
|
438
441
|
readonly limit: {
|
|
439
442
|
readonly description: "Max rows to return (default 1000, max 10000)";
|
|
440
443
|
readonly default: 1000;
|
|
441
|
-
readonly type: "
|
|
444
|
+
readonly type: "integer";
|
|
445
|
+
readonly minimum: 1;
|
|
442
446
|
readonly maximum: 10000;
|
|
443
447
|
};
|
|
444
448
|
};
|
|
@@ -448,15 +452,15 @@ declare const customerToolContracts: {
|
|
|
448
452
|
};
|
|
449
453
|
readonly outlit_schema: {
|
|
450
454
|
readonly toolName: "outlit_schema";
|
|
451
|
-
readonly description: "Get
|
|
455
|
+
readonly description: "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.";
|
|
452
456
|
readonly inputSchema: {
|
|
453
457
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
454
458
|
readonly type: "object";
|
|
455
459
|
readonly properties: {
|
|
456
460
|
readonly table: {
|
|
457
|
-
readonly description: "Specific
|
|
461
|
+
readonly description: "Specific analytics view to describe. Omit to list all views.";
|
|
458
462
|
readonly type: "string";
|
|
459
|
-
readonly enum: readonly ["
|
|
463
|
+
readonly enum: readonly ["activity", "customers", "users", "revenue"];
|
|
460
464
|
};
|
|
461
465
|
};
|
|
462
466
|
readonly additionalProperties: false;
|
|
@@ -565,16 +569,17 @@ declare const unsupportedCustomerFactTypes: readonly ["TRACKING_GAP", "SCHEMA_DR
|
|
|
565
569
|
declare const customerFactCategories: readonly ["MEMORY", "CUSTOM"];
|
|
566
570
|
declare const customerListOrderFields: readonly ["last_activity_at", "first_seen_at", "name", "mrr_cents"];
|
|
567
571
|
declare const customerIncludeSections: readonly ["users", "revenue", "recentTimeline", "behaviorMetrics"];
|
|
568
|
-
declare const customerSourceTypes: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
569
572
|
declare const customerTimeframes: readonly ["7d", "14d", "30d", "90d"];
|
|
570
573
|
declare const notificationSeverityValues: readonly ["low", "medium", "high"];
|
|
571
|
-
declare const timelineChannels: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
574
|
+
declare const timelineChannels: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CALENDAR", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
572
575
|
declare const timelineTimeframes: readonly ["7d", "14d", "30d", "90d", "all"];
|
|
573
576
|
declare const userJourneyStages: readonly ["DISCOVERED", "SIGNED_UP", "ACTIVATED", "ENGAGED", "INACTIVE"];
|
|
574
577
|
declare const userListOrderFields: readonly ["last_activity_at", "first_seen_at", "email"];
|
|
575
|
-
declare const schemaTables: readonly ["
|
|
576
|
-
declare const customerToolContractHash: "
|
|
578
|
+
declare const schemaTables: readonly ["activity", "customers", "users", "revenue"];
|
|
579
|
+
declare const customerToolContractHash: "f619a7dcc1845bc494a193d11e76c6fcee66ecaa2ea60a9a30b51750feb8b11a";
|
|
577
580
|
type CustomerToolName = (typeof customerToolNames)[number];
|
|
581
|
+
type CustomerSourceType = (typeof customerSourceTypes)[number];
|
|
582
|
+
type CustomerSourceTypeInput = (typeof customerSourceTypeInputs)[number];
|
|
578
583
|
type CustomerToolContract = {
|
|
579
584
|
toolName: CustomerToolName;
|
|
580
585
|
description: string;
|
|
@@ -582,6 +587,7 @@ type CustomerToolContract = {
|
|
|
582
587
|
};
|
|
583
588
|
declare function isCustomerToolName(value: string): value is CustomerToolName;
|
|
584
589
|
declare function getCustomerToolContract(name: CustomerToolName): CustomerToolContract;
|
|
590
|
+
declare function normalizeCustomerSourceType(value: string): CustomerSourceType | null;
|
|
585
591
|
type SearchArgsLike = {
|
|
586
592
|
query?: string;
|
|
587
593
|
customer?: string | null;
|
|
@@ -596,7 +602,7 @@ type CustomerContextSearchInput = {
|
|
|
596
602
|
topK?: number;
|
|
597
603
|
after?: string;
|
|
598
604
|
before?: string;
|
|
599
|
-
sourceTypes?:
|
|
605
|
+
sourceTypes?: CustomerSourceType[];
|
|
600
606
|
};
|
|
601
607
|
declare function resolveCustomerContextSearchInput(value: SearchArgsLike): {
|
|
602
608
|
ok: true;
|
|
@@ -626,4 +632,4 @@ declare const sqlToolNames: readonly ["outlit_schema", "outlit_query"];
|
|
|
626
632
|
declare const analyticalAgentToolNames: readonly ["outlit_list_customers", "outlit_list_users", "outlit_get_customer", "outlit_get_timeline", "outlit_list_facts", "outlit_get_fact", "outlit_get_source", "outlit_search_customer_context", "outlit_send_notification", "outlit_schema", "outlit_query"];
|
|
627
633
|
declare const allCustomerToolNames: readonly ["outlit_list_customers", "outlit_list_users", "outlit_get_customer", "outlit_get_timeline", "outlit_list_facts", "outlit_get_fact", "outlit_get_source", "outlit_search_customer_context", "outlit_query", "outlit_schema", "outlit_send_notification"];
|
|
628
634
|
|
|
629
|
-
export { type CustomerContextSearchInput, type CustomerToolContract, type CustomerToolName, DEFAULT_OUTLIT_API_URL, type JsonSchema, type OutlitToolsClient, type OutlitToolsClientOptions, type OutlitToolsFetch, type SearchArgsLike, actionToolNames, allCustomerToolNames, analyticalAgentToolNames, createOutlitClient, customerActivityWindows, customerBillingStatuses, customerFactCategories, customerFactIncludes, customerFactStatuses, customerFactTypes, customerIncludeSections, customerListOrderFields, customerSourceTypes, customerTimeframes, customerToolContractHash, customerToolContracts, customerToolNames, defaultAgentToolNames, getCustomerToolContract, isCustomerToolName, notificationSeverityValues, resolveCustomerContextSearchInput, schemaTables, sqlToolNames, timelineChannels, timelineTimeframes, unsupportedCustomerFactTypes, userJourneyStages, userListOrderFields };
|
|
635
|
+
export { type CustomerContextSearchInput, type CustomerSourceType, type CustomerSourceTypeInput, type CustomerToolContract, type CustomerToolName, DEFAULT_OUTLIT_API_URL, type JsonSchema, type OutlitToolsClient, type OutlitToolsClientOptions, type OutlitToolsFetch, type SearchArgsLike, actionToolNames, allCustomerToolNames, analyticalAgentToolNames, createOutlitClient, customerActivityWindows, customerBillingStatuses, customerFactCategories, customerFactIncludes, customerFactStatuses, customerFactTypes, customerIncludeSections, customerListOrderFields, customerSourceTypeAliases, customerSourceTypeInputs, customerSourceTypes, customerTimeframes, customerToolContractHash, customerToolContracts, customerToolNames, defaultAgentToolNames, getCustomerToolContract, isCustomerToolName, normalizeCustomerSourceType, notificationSeverityValues, resolveCustomerContextSearchInput, schemaTables, sqlToolNames, timelineChannels, timelineTimeframes, unsupportedCustomerFactTypes, userJourneyStages, userListOrderFields };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,9 @@ type JsonSchema = {
|
|
|
2
2
|
readonly [key: string]: unknown;
|
|
3
3
|
};
|
|
4
4
|
declare const customerToolNames: readonly ["outlit_list_customers", "outlit_list_users", "outlit_get_customer", "outlit_get_timeline", "outlit_list_facts", "outlit_get_fact", "outlit_get_source", "outlit_search_customer_context", "outlit_query", "outlit_schema", "outlit_send_notification"];
|
|
5
|
+
declare const customerSourceTypes: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY"];
|
|
6
|
+
declare const customerSourceTypeAliases: readonly ["CRM", "CRM_OPPORTUNITY"];
|
|
7
|
+
declare const customerSourceTypeInputs: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
5
8
|
declare const customerToolContracts: {
|
|
6
9
|
readonly outlit_list_customers: {
|
|
7
10
|
readonly toolName: "outlit_list_customers";
|
|
@@ -204,11 +207,11 @@ declare const customerToolContracts: {
|
|
|
204
207
|
readonly description: "Customer ID or domain";
|
|
205
208
|
};
|
|
206
209
|
readonly channels: {
|
|
207
|
-
readonly description: "Filter by event channel (e.g., EMAIL, SLACK, CALL)";
|
|
210
|
+
readonly description: "Filter by event channel (e.g., EMAIL, SLACK, CALL, CALENDAR)";
|
|
208
211
|
readonly type: "array";
|
|
209
212
|
readonly items: {
|
|
210
213
|
readonly type: "string";
|
|
211
|
-
readonly enum: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
214
|
+
readonly enum: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CALENDAR", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
212
215
|
};
|
|
213
216
|
};
|
|
214
217
|
readonly eventTypes: {
|
|
@@ -275,7 +278,7 @@ declare const customerToolContracts: {
|
|
|
275
278
|
readonly type: "array";
|
|
276
279
|
readonly items: {
|
|
277
280
|
readonly type: "string";
|
|
278
|
-
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
281
|
+
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
279
282
|
};
|
|
280
283
|
};
|
|
281
284
|
readonly factTypes: {
|
|
@@ -358,7 +361,7 @@ declare const customerToolContracts: {
|
|
|
358
361
|
readonly properties: {
|
|
359
362
|
readonly sourceType: {
|
|
360
363
|
readonly type: "string";
|
|
361
|
-
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
364
|
+
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
362
365
|
};
|
|
363
366
|
readonly sourceId: {
|
|
364
367
|
readonly type: "string";
|
|
@@ -416,7 +419,7 @@ declare const customerToolContracts: {
|
|
|
416
419
|
readonly type: "array";
|
|
417
420
|
readonly items: {
|
|
418
421
|
readonly type: "string";
|
|
419
|
-
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
422
|
+
readonly enum: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", "CRM", "CRM_OPPORTUNITY"];
|
|
420
423
|
};
|
|
421
424
|
};
|
|
422
425
|
};
|
|
@@ -426,7 +429,7 @@ declare const customerToolContracts: {
|
|
|
426
429
|
};
|
|
427
430
|
readonly outlit_query: {
|
|
428
431
|
readonly toolName: "outlit_query";
|
|
429
|
-
readonly description: "Execute
|
|
432
|
+
readonly description: "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";
|
|
430
433
|
readonly inputSchema: {
|
|
431
434
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
432
435
|
readonly type: "object";
|
|
@@ -438,7 +441,8 @@ declare const customerToolContracts: {
|
|
|
438
441
|
readonly limit: {
|
|
439
442
|
readonly description: "Max rows to return (default 1000, max 10000)";
|
|
440
443
|
readonly default: 1000;
|
|
441
|
-
readonly type: "
|
|
444
|
+
readonly type: "integer";
|
|
445
|
+
readonly minimum: 1;
|
|
442
446
|
readonly maximum: 10000;
|
|
443
447
|
};
|
|
444
448
|
};
|
|
@@ -448,15 +452,15 @@ declare const customerToolContracts: {
|
|
|
448
452
|
};
|
|
449
453
|
readonly outlit_schema: {
|
|
450
454
|
readonly toolName: "outlit_schema";
|
|
451
|
-
readonly description: "Get
|
|
455
|
+
readonly description: "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.";
|
|
452
456
|
readonly inputSchema: {
|
|
453
457
|
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
454
458
|
readonly type: "object";
|
|
455
459
|
readonly properties: {
|
|
456
460
|
readonly table: {
|
|
457
|
-
readonly description: "Specific
|
|
461
|
+
readonly description: "Specific analytics view to describe. Omit to list all views.";
|
|
458
462
|
readonly type: "string";
|
|
459
|
-
readonly enum: readonly ["
|
|
463
|
+
readonly enum: readonly ["activity", "customers", "users", "revenue"];
|
|
460
464
|
};
|
|
461
465
|
};
|
|
462
466
|
readonly additionalProperties: false;
|
|
@@ -565,16 +569,17 @@ declare const unsupportedCustomerFactTypes: readonly ["TRACKING_GAP", "SCHEMA_DR
|
|
|
565
569
|
declare const customerFactCategories: readonly ["MEMORY", "CUSTOM"];
|
|
566
570
|
declare const customerListOrderFields: readonly ["last_activity_at", "first_seen_at", "name", "mrr_cents"];
|
|
567
571
|
declare const customerIncludeSections: readonly ["users", "revenue", "recentTimeline", "behaviorMetrics"];
|
|
568
|
-
declare const customerSourceTypes: readonly ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
569
572
|
declare const customerTimeframes: readonly ["7d", "14d", "30d", "90d"];
|
|
570
573
|
declare const notificationSeverityValues: readonly ["low", "medium", "high"];
|
|
571
|
-
declare const timelineChannels: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
574
|
+
declare const timelineChannels: readonly ["SDK", "EMAIL", "SLACK", "CALL", "CALENDAR", "CRM", "BILLING", "SUPPORT", "INTERNAL"];
|
|
572
575
|
declare const timelineTimeframes: readonly ["7d", "14d", "30d", "90d", "all"];
|
|
573
576
|
declare const userJourneyStages: readonly ["DISCOVERED", "SIGNED_UP", "ACTIVATED", "ENGAGED", "INACTIVE"];
|
|
574
577
|
declare const userListOrderFields: readonly ["last_activity_at", "first_seen_at", "email"];
|
|
575
|
-
declare const schemaTables: readonly ["
|
|
576
|
-
declare const customerToolContractHash: "
|
|
578
|
+
declare const schemaTables: readonly ["activity", "customers", "users", "revenue"];
|
|
579
|
+
declare const customerToolContractHash: "f619a7dcc1845bc494a193d11e76c6fcee66ecaa2ea60a9a30b51750feb8b11a";
|
|
577
580
|
type CustomerToolName = (typeof customerToolNames)[number];
|
|
581
|
+
type CustomerSourceType = (typeof customerSourceTypes)[number];
|
|
582
|
+
type CustomerSourceTypeInput = (typeof customerSourceTypeInputs)[number];
|
|
578
583
|
type CustomerToolContract = {
|
|
579
584
|
toolName: CustomerToolName;
|
|
580
585
|
description: string;
|
|
@@ -582,6 +587,7 @@ type CustomerToolContract = {
|
|
|
582
587
|
};
|
|
583
588
|
declare function isCustomerToolName(value: string): value is CustomerToolName;
|
|
584
589
|
declare function getCustomerToolContract(name: CustomerToolName): CustomerToolContract;
|
|
590
|
+
declare function normalizeCustomerSourceType(value: string): CustomerSourceType | null;
|
|
585
591
|
type SearchArgsLike = {
|
|
586
592
|
query?: string;
|
|
587
593
|
customer?: string | null;
|
|
@@ -596,7 +602,7 @@ type CustomerContextSearchInput = {
|
|
|
596
602
|
topK?: number;
|
|
597
603
|
after?: string;
|
|
598
604
|
before?: string;
|
|
599
|
-
sourceTypes?:
|
|
605
|
+
sourceTypes?: CustomerSourceType[];
|
|
600
606
|
};
|
|
601
607
|
declare function resolveCustomerContextSearchInput(value: SearchArgsLike): {
|
|
602
608
|
ok: true;
|
|
@@ -626,4 +632,4 @@ declare const sqlToolNames: readonly ["outlit_schema", "outlit_query"];
|
|
|
626
632
|
declare const analyticalAgentToolNames: readonly ["outlit_list_customers", "outlit_list_users", "outlit_get_customer", "outlit_get_timeline", "outlit_list_facts", "outlit_get_fact", "outlit_get_source", "outlit_search_customer_context", "outlit_send_notification", "outlit_schema", "outlit_query"];
|
|
627
633
|
declare const allCustomerToolNames: readonly ["outlit_list_customers", "outlit_list_users", "outlit_get_customer", "outlit_get_timeline", "outlit_list_facts", "outlit_get_fact", "outlit_get_source", "outlit_search_customer_context", "outlit_query", "outlit_schema", "outlit_send_notification"];
|
|
628
634
|
|
|
629
|
-
export { type CustomerContextSearchInput, type CustomerToolContract, type CustomerToolName, DEFAULT_OUTLIT_API_URL, type JsonSchema, type OutlitToolsClient, type OutlitToolsClientOptions, type OutlitToolsFetch, type SearchArgsLike, actionToolNames, allCustomerToolNames, analyticalAgentToolNames, createOutlitClient, customerActivityWindows, customerBillingStatuses, customerFactCategories, customerFactIncludes, customerFactStatuses, customerFactTypes, customerIncludeSections, customerListOrderFields, customerSourceTypes, customerTimeframes, customerToolContractHash, customerToolContracts, customerToolNames, defaultAgentToolNames, getCustomerToolContract, isCustomerToolName, notificationSeverityValues, resolveCustomerContextSearchInput, schemaTables, sqlToolNames, timelineChannels, timelineTimeframes, unsupportedCustomerFactTypes, userJourneyStages, userListOrderFields };
|
|
635
|
+
export { type CustomerContextSearchInput, type CustomerSourceType, type CustomerSourceTypeInput, type CustomerToolContract, type CustomerToolName, DEFAULT_OUTLIT_API_URL, type JsonSchema, type OutlitToolsClient, type OutlitToolsClientOptions, type OutlitToolsFetch, type SearchArgsLike, actionToolNames, allCustomerToolNames, analyticalAgentToolNames, createOutlitClient, customerActivityWindows, customerBillingStatuses, customerFactCategories, customerFactIncludes, customerFactStatuses, customerFactTypes, customerIncludeSections, customerListOrderFields, customerSourceTypeAliases, customerSourceTypeInputs, customerSourceTypes, customerTimeframes, customerToolContractHash, customerToolContracts, customerToolNames, defaultAgentToolNames, getCustomerToolContract, isCustomerToolName, normalizeCustomerSourceType, notificationSeverityValues, resolveCustomerContextSearchInput, schemaTables, sqlToolNames, timelineChannels, timelineTimeframes, unsupportedCustomerFactTypes, userJourneyStages, userListOrderFields };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,23 @@ var customerToolNames = [
|
|
|
12
12
|
"outlit_schema",
|
|
13
13
|
"outlit_send_notification"
|
|
14
14
|
];
|
|
15
|
+
var customerSourceTypes = [
|
|
16
|
+
"EMAIL",
|
|
17
|
+
"CALL",
|
|
18
|
+
"CALENDAR_EVENT",
|
|
19
|
+
"SUPPORT_TICKET",
|
|
20
|
+
"OPPORTUNITY"
|
|
21
|
+
];
|
|
22
|
+
var customerSourceTypeAliases = ["CRM", "CRM_OPPORTUNITY"];
|
|
23
|
+
var customerSourceTypeInputs = [
|
|
24
|
+
"EMAIL",
|
|
25
|
+
"CALL",
|
|
26
|
+
"CALENDAR_EVENT",
|
|
27
|
+
"SUPPORT_TICKET",
|
|
28
|
+
"OPPORTUNITY",
|
|
29
|
+
"CRM",
|
|
30
|
+
"CRM_OPPORTUNITY"
|
|
31
|
+
];
|
|
15
32
|
var customerToolContracts = {
|
|
16
33
|
outlit_list_customers: {
|
|
17
34
|
toolName: "outlit_list_customers",
|
|
@@ -222,11 +239,21 @@ var customerToolContracts = {
|
|
|
222
239
|
description: "Customer ID or domain"
|
|
223
240
|
},
|
|
224
241
|
channels: {
|
|
225
|
-
description: "Filter by event channel (e.g., EMAIL, SLACK, CALL)",
|
|
242
|
+
description: "Filter by event channel (e.g., EMAIL, SLACK, CALL, CALENDAR)",
|
|
226
243
|
type: "array",
|
|
227
244
|
items: {
|
|
228
245
|
type: "string",
|
|
229
|
-
enum: [
|
|
246
|
+
enum: [
|
|
247
|
+
"SDK",
|
|
248
|
+
"EMAIL",
|
|
249
|
+
"SLACK",
|
|
250
|
+
"CALL",
|
|
251
|
+
"CALENDAR",
|
|
252
|
+
"CRM",
|
|
253
|
+
"BILLING",
|
|
254
|
+
"SUPPORT",
|
|
255
|
+
"INTERNAL"
|
|
256
|
+
]
|
|
230
257
|
}
|
|
231
258
|
},
|
|
232
259
|
eventTypes: {
|
|
@@ -293,7 +320,7 @@ var customerToolContracts = {
|
|
|
293
320
|
type: "array",
|
|
294
321
|
items: {
|
|
295
322
|
type: "string",
|
|
296
|
-
enum:
|
|
323
|
+
enum: customerSourceTypeInputs
|
|
297
324
|
}
|
|
298
325
|
},
|
|
299
326
|
factTypes: {
|
|
@@ -394,7 +421,7 @@ var customerToolContracts = {
|
|
|
394
421
|
properties: {
|
|
395
422
|
sourceType: {
|
|
396
423
|
type: "string",
|
|
397
|
-
enum:
|
|
424
|
+
enum: customerSourceTypeInputs
|
|
398
425
|
},
|
|
399
426
|
sourceId: {
|
|
400
427
|
type: "string",
|
|
@@ -455,7 +482,7 @@ var customerToolContracts = {
|
|
|
455
482
|
type: "array",
|
|
456
483
|
items: {
|
|
457
484
|
type: "string",
|
|
458
|
-
enum:
|
|
485
|
+
enum: customerSourceTypeInputs
|
|
459
486
|
}
|
|
460
487
|
}
|
|
461
488
|
},
|
|
@@ -465,7 +492,7 @@ var customerToolContracts = {
|
|
|
465
492
|
},
|
|
466
493
|
outlit_query: {
|
|
467
494
|
toolName: "outlit_query",
|
|
468
|
-
description: "Execute
|
|
495
|
+
description: "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",
|
|
469
496
|
inputSchema: {
|
|
470
497
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
471
498
|
type: "object",
|
|
@@ -477,7 +504,8 @@ var customerToolContracts = {
|
|
|
477
504
|
limit: {
|
|
478
505
|
description: "Max rows to return (default 1000, max 10000)",
|
|
479
506
|
default: 1e3,
|
|
480
|
-
type: "
|
|
507
|
+
type: "integer",
|
|
508
|
+
minimum: 1,
|
|
481
509
|
maximum: 1e4
|
|
482
510
|
}
|
|
483
511
|
},
|
|
@@ -487,15 +515,15 @@ var customerToolContracts = {
|
|
|
487
515
|
},
|
|
488
516
|
outlit_schema: {
|
|
489
517
|
toolName: "outlit_schema",
|
|
490
|
-
description: "Get
|
|
518
|
+
description: "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.",
|
|
491
519
|
inputSchema: {
|
|
492
520
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
493
521
|
type: "object",
|
|
494
522
|
properties: {
|
|
495
523
|
table: {
|
|
496
|
-
description: "Specific
|
|
524
|
+
description: "Specific analytics view to describe. Omit to list all views.",
|
|
497
525
|
type: "string",
|
|
498
|
-
enum: ["
|
|
526
|
+
enum: ["activity", "customers", "users", "revenue"]
|
|
499
527
|
}
|
|
500
528
|
},
|
|
501
529
|
additionalProperties: false
|
|
@@ -669,7 +697,6 @@ var customerIncludeSections = [
|
|
|
669
697
|
"recentTimeline",
|
|
670
698
|
"behaviorMetrics"
|
|
671
699
|
];
|
|
672
|
-
var customerSourceTypes = ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
|
|
673
700
|
var customerTimeframes = ["7d", "14d", "30d", "90d"];
|
|
674
701
|
var notificationSeverityValues = ["low", "medium", "high"];
|
|
675
702
|
var timelineChannels = [
|
|
@@ -677,6 +704,7 @@ var timelineChannels = [
|
|
|
677
704
|
"EMAIL",
|
|
678
705
|
"SLACK",
|
|
679
706
|
"CALL",
|
|
707
|
+
"CALENDAR",
|
|
680
708
|
"CRM",
|
|
681
709
|
"BILLING",
|
|
682
710
|
"SUPPORT",
|
|
@@ -691,14 +719,14 @@ var userJourneyStages = [
|
|
|
691
719
|
"INACTIVE"
|
|
692
720
|
];
|
|
693
721
|
var userListOrderFields = ["last_activity_at", "first_seen_at", "email"];
|
|
694
|
-
var schemaTables = [
|
|
695
|
-
|
|
696
|
-
"customer_dimensions",
|
|
697
|
-
"user_dimensions",
|
|
698
|
-
"mrr_snapshots"
|
|
699
|
-
];
|
|
700
|
-
var customerToolContractHash = "b778bd2aae7899361ac9ae4f098f4627582cd8513a1e686125ee2d44e3b5a082";
|
|
722
|
+
var schemaTables = ["activity", "customers", "users", "revenue"];
|
|
723
|
+
var customerToolContractHash = "f619a7dcc1845bc494a193d11e76c6fcee66ecaa2ea60a9a30b51750feb8b11a";
|
|
701
724
|
var customerToolNameSet = new Set(customerToolNames);
|
|
725
|
+
var customerSourceTypeSet = new Set(customerSourceTypes);
|
|
726
|
+
var customerSourceTypeAliasMap = /* @__PURE__ */ new Map([
|
|
727
|
+
["CRM", "OPPORTUNITY"],
|
|
728
|
+
["CRM_OPPORTUNITY", "OPPORTUNITY"]
|
|
729
|
+
]);
|
|
702
730
|
var iso8601UtcDateTimeRegex = /^(?:(?:\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))$/;
|
|
703
731
|
function isCustomerToolName(value) {
|
|
704
732
|
return customerToolNameSet.has(value);
|
|
@@ -706,6 +734,12 @@ function isCustomerToolName(value) {
|
|
|
706
734
|
function getCustomerToolContract(name) {
|
|
707
735
|
return customerToolContracts[name];
|
|
708
736
|
}
|
|
737
|
+
function normalizeCustomerSourceType(value) {
|
|
738
|
+
if (customerSourceTypeSet.has(value)) {
|
|
739
|
+
return value;
|
|
740
|
+
}
|
|
741
|
+
return customerSourceTypeAliasMap.get(value) ?? null;
|
|
742
|
+
}
|
|
709
743
|
function resolveCustomerContextSearchInput(value) {
|
|
710
744
|
if (!value.query) {
|
|
711
745
|
return {
|
|
@@ -752,6 +786,16 @@ function resolveCustomerContextSearchInput(value) {
|
|
|
752
786
|
message: "--after must be before or equal to --before"
|
|
753
787
|
};
|
|
754
788
|
}
|
|
789
|
+
const invalidSourceTypes = value.sourceTypes?.filter((sourceType) => !normalizeCustomerSourceType(sourceType)) ?? [];
|
|
790
|
+
if (invalidSourceTypes.length > 0) {
|
|
791
|
+
return {
|
|
792
|
+
ok: false,
|
|
793
|
+
message: `Unknown source types: ${invalidSourceTypes.join(", ")}. Allowed: ${customerSourceTypeInputs.join(", ")}`
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
const normalizedSourceTypes = value.sourceTypes ? Array.from(
|
|
797
|
+
new Set(value.sourceTypes.map((sourceType) => normalizeCustomerSourceType(sourceType)))
|
|
798
|
+
).filter((sourceType) => sourceType !== null) : void 0;
|
|
755
799
|
return {
|
|
756
800
|
ok: true,
|
|
757
801
|
request: {
|
|
@@ -760,7 +804,7 @@ function resolveCustomerContextSearchInput(value) {
|
|
|
760
804
|
topK: value.topK,
|
|
761
805
|
after: value.after,
|
|
762
806
|
before: value.before,
|
|
763
|
-
sourceTypes:
|
|
807
|
+
sourceTypes: normalizedSourceTypes
|
|
764
808
|
}
|
|
765
809
|
};
|
|
766
810
|
}
|
|
@@ -842,6 +886,8 @@ export {
|
|
|
842
886
|
customerFactTypes,
|
|
843
887
|
customerIncludeSections,
|
|
844
888
|
customerListOrderFields,
|
|
889
|
+
customerSourceTypeAliases,
|
|
890
|
+
customerSourceTypeInputs,
|
|
845
891
|
customerSourceTypes,
|
|
846
892
|
customerTimeframes,
|
|
847
893
|
customerToolContractHash,
|
|
@@ -850,6 +896,7 @@ export {
|
|
|
850
896
|
defaultAgentToolNames,
|
|
851
897
|
getCustomerToolContract,
|
|
852
898
|
isCustomerToolName,
|
|
899
|
+
normalizeCustomerSourceType,
|
|
853
900
|
notificationSeverityValues,
|
|
854
901
|
resolveCustomerContextSearchInput,
|
|
855
902
|
schemaTables,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/contracts.ts","../src/client.ts","../src/toolsets.ts"],"sourcesContent":["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 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)\",\n type: \"array\",\n items: {\n type: \"string\",\n enum: [\"SDK\", \"EMAIL\", \"SLACK\", \"CALL\", \"CRM\", \"BILLING\", \"SUPPORT\", \"INTERNAL\"],\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: [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"],\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: [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"],\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: [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"],\n },\n },\n },\n required: [\"query\"],\n additionalProperties: false,\n },\n },\n outlit_query: {\n toolName: \"outlit_query\",\n description:\n \"Execute raw SQL queries against your analytics data.\\n\\nAvailable tables:\\n- events: Customer activity events (event_name, event_type, event_channel, customer_id, occurred_at, properties, ...)\\n- customer_dimensions: Customer attributes (customer_id, domain, name, billing_status, plan, mrr_cents, ...)\\n- user_dimensions: User attributes (user_id, email, name, customer_id, ...)\\n- mrr_snapshots: 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.\\n\\nExample queries:\\n- SELECT event_name, count(*) FROM events GROUP BY 1 ORDER BY 2 DESC LIMIT 10\\n- SELECT billing_status, sum(mrr_cents)/100 as mrr FROM customer_dimensions GROUP BY 1\\n- SELECT * FROM events 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: \"number\",\n maximum: 10000,\n },\n },\n required: [\"sql\"],\n additionalProperties: false,\n },\n },\n outlit_schema: {\n toolName: \"outlit_schema\",\n description:\n \"Get table schemas for available analytics tables.\\n\\nUse this to discover column names, types, and descriptions before writing SQL queries.\\nReturns column definitions and example queries for each table.\",\n inputSchema: {\n $schema: \"https://json-schema.org/draft/2020-12/schema\",\n type: \"object\",\n properties: {\n table: {\n description: \"Specific table to describe, or omit for all tables\",\n type: \"string\",\n enum: [\"events\", \"customer_dimensions\", \"user_dimensions\", \"mrr_snapshots\"],\n },\n },\n additionalProperties: false,\n },\n },\n outlit_send_notification: {\n toolName: \"outlit_send_notification\",\n description:\n \"Send or post a Slack notification. Use only when the user explicitly asks you to send, post, or notify. The payload is rendered as a Slack code block.\",\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 payload: {\n description:\n \"JSON-compatible payload rendered in Slack as a code block. Serialized size must be 100,000 characters or fewer.\",\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 $ref: \"#/$defs/__schema0\",\n },\n message: {\n description: \"Optional Slack 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 },\n required: [\"title\", \"payload\"],\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 customerSourceTypes = [\"EMAIL\", \"CALL\", \"CALENDAR_EVENT\", \"SUPPORT_TICKET\"] 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 \"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 = [\n \"events\",\n \"customer_dimensions\",\n \"user_dimensions\",\n \"mrr_snapshots\",\n] as const\n\nexport const customerToolContractHash =\n \"b778bd2aae7899361ac9ae4f098f4627582cd8513a1e686125ee2d44e3b5a082\" as const\n\nexport type CustomerToolName = (typeof customerToolNames)[number]\n\nexport type CustomerToolContract = {\n toolName: CustomerToolName\n description: string\n inputSchema: JsonSchema\n}\n\nconst customerToolNameSet = new Set<string>(customerToolNames)\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 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?: string[]\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 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: value.sourceTypes,\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":";AAIO,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,wBAAwB;AAAA,EACnC,uBAAuB;AAAA,IACrB,UAAU;AAAA,IACV,aACE;AAAA,IACF,aAAa;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,YAAY;AAAA,QACV,eAAe;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,QAAQ,YAAY,UAAU,YAAY,SAAS;AAAA,QAC5D;AAAA,QACA,mBAAmB;AAAA,UACjB,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,MAAM,OAAO,OAAO,KAAK;AAAA,QAClC;AAAA,QACA,kBAAkB;AAAA,UAChB,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,MAAM,OAAO,OAAO,KAAK;AAAA,QAClC;AAAA,QACA,UAAU;AAAA,UACR,aAAa;AAAA,UACb,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,QACA,UAAU;AAAA,UACR,aAAa;AAAA,UACb,MAAM;AA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AAA,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/contracts.ts","../src/client.ts","../src/toolsets.ts"],"sourcesContent":["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 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 Slack notification. Use only when the user explicitly asks you to send, post, or notify. The payload is rendered as a Slack code block.\",\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 payload: {\n description:\n \"JSON-compatible payload rendered in Slack as a code block. Serialized size must be 100,000 characters or fewer.\",\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 $ref: \"#/$defs/__schema0\",\n },\n message: {\n description: \"Optional Slack 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 },\n required: [\"title\", \"payload\"],\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 \"f619a7dcc1845bc494a193d11e76c6fcee66ecaa2ea60a9a30b51750feb8b11a\" 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 if (customerSourceTypeSet.has(value)) {\n return value as CustomerSourceType\n }\n\n return customerSourceTypeAliasMap.get(value as (typeof customerSourceTypeAliases)[number]) ?? null\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":";AAIO,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,wBAAwB;AAAA,EACnC,uBAAuB;AAAA,IACrB,UAAU;AAAA,IACV,aACE;AAAA,IACF,aAAa;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,MACN,YAAY;AAAA,QACV,eAAe;AAAA,UACb,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,QAAQ,YAAY,UAAU,YAAY,SAAS;AAAA,QAC5D;AAAA,QACA,mBAAmB;AAAA,UACjB,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,MAAM,OAAO,OAAO,KAAK;AAAA,QAClC;AAAA,QACA,kBAAkB;AAAA,UAChB,aAAa;AAAA,UACb,MAAM;AAAA,UACN,MAAM,CAAC,MAAM,OAAO,OAAO,KAAK;AA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