@outlit/cli 1.6.2 → 1.6.3

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.
Files changed (2) hide show
  1. package/dist/cli.js +127 -78
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -104,7 +104,7 @@ var package_default;
104
104
  var init_package = __esm(() => {
105
105
  package_default = {
106
106
  name: "@outlit/cli",
107
- version: "1.6.2",
107
+ version: "1.6.3",
108
108
  description: "CLI for Outlit customer intelligence platform",
109
109
  license: "Apache-2.0",
110
110
  repository: {
@@ -135,7 +135,7 @@ var init_package = __esm(() => {
135
135
  },
136
136
  dependencies: {
137
137
  "@clack/prompts": "^1.0.1",
138
- "@outlit/tools": "^0.1.1",
138
+ "@outlit/tools": "^0.1.2",
139
139
  citty: "^0.2.1"
140
140
  },
141
141
  devDependencies: {
@@ -1493,6 +1493,12 @@ var init_signup = __esm(() => {
1493
1493
  function isCustomerToolName(value) {
1494
1494
  return customerToolNameSet.has(value);
1495
1495
  }
1496
+ function normalizeCustomerSourceType(value) {
1497
+ if (customerSourceTypeSet.has(value)) {
1498
+ return value;
1499
+ }
1500
+ return customerSourceTypeAliasMap.get(value) ?? null;
1501
+ }
1496
1502
  function resolveCustomerContextSearchInput(value) {
1497
1503
  if (!value.query) {
1498
1504
  return {
@@ -1539,6 +1545,14 @@ function resolveCustomerContextSearchInput(value) {
1539
1545
  message: "--after must be before or equal to --before"
1540
1546
  };
1541
1547
  }
1548
+ const invalidSourceTypes = value.sourceTypes?.filter((sourceType) => !normalizeCustomerSourceType(sourceType)) ?? [];
1549
+ if (invalidSourceTypes.length > 0) {
1550
+ return {
1551
+ ok: false,
1552
+ message: `Unknown source types: ${invalidSourceTypes.join(", ")}. Allowed: ${customerSourceTypeInputs.join(", ")}`
1553
+ };
1554
+ }
1555
+ const normalizedSourceTypes = value.sourceTypes ? Array.from(new Set(value.sourceTypes.map((sourceType) => normalizeCustomerSourceType(sourceType)))).filter((sourceType) => sourceType !== null) : undefined;
1542
1556
  return {
1543
1557
  ok: true,
1544
1558
  request: {
@@ -1547,7 +1561,7 @@ function resolveCustomerContextSearchInput(value) {
1547
1561
  topK: value.topK,
1548
1562
  after: value.after,
1549
1563
  before: value.before,
1550
- sourceTypes: value.sourceTypes
1564
+ sourceTypes: normalizedSourceTypes
1551
1565
  }
1552
1566
  };
1553
1567
  }
@@ -1587,7 +1601,7 @@ function createOutlitClient(options) {
1587
1601
  }
1588
1602
  };
1589
1603
  }
1590
- var customerToolNames, customerToolContracts, customerBillingStatuses, customerFactStatuses, customerFactTypes, unsupportedCustomerFactTypes, customerFactCategories, customerIncludeSections, customerSourceTypes, customerTimeframes, notificationSeverityValues, timelineChannels, timelineTimeframes, userJourneyStages, schemaTables, customerToolNameSet, iso8601UtcDateTimeRegex, DEFAULT_OUTLIT_API_URL = "https://app.outlit.ai", actionToolNames, defaultAgentToolNames, sqlToolNames, analyticalAgentToolNames;
1604
+ var customerToolNames, customerSourceTypes, customerSourceTypeAliases, customerSourceTypeInputs, customerToolContracts, customerBillingStatuses, customerFactStatuses, customerFactTypes, unsupportedCustomerFactTypes, customerFactCategories, customerIncludeSections, customerTimeframes, notificationSeverityValues, timelineChannels, timelineTimeframes, userJourneyStages, customerToolNameSet, customerSourceTypeSet, customerSourceTypeAliasMap, iso8601UtcDateTimeRegex, DEFAULT_OUTLIT_API_URL = "https://app.outlit.ai", actionToolNames, defaultAgentToolNames, sqlToolNames, analyticalAgentToolNames;
1591
1605
  var init_dist4 = __esm(() => {
1592
1606
  customerToolNames = [
1593
1607
  "outlit_list_customers",
@@ -1602,6 +1616,23 @@ var init_dist4 = __esm(() => {
1602
1616
  "outlit_schema",
1603
1617
  "outlit_send_notification"
1604
1618
  ];
1619
+ customerSourceTypes = [
1620
+ "EMAIL",
1621
+ "CALL",
1622
+ "CALENDAR_EVENT",
1623
+ "SUPPORT_TICKET",
1624
+ "OPPORTUNITY"
1625
+ ];
1626
+ customerSourceTypeAliases = ["CRM", "CRM_OPPORTUNITY"];
1627
+ customerSourceTypeInputs = [
1628
+ "EMAIL",
1629
+ "CALL",
1630
+ "CALENDAR_EVENT",
1631
+ "SUPPORT_TICKET",
1632
+ "OPPORTUNITY",
1633
+ "CRM",
1634
+ "CRM_OPPORTUNITY"
1635
+ ];
1605
1636
  customerToolContracts = {
1606
1637
  outlit_list_customers: {
1607
1638
  toolName: "outlit_list_customers",
@@ -1812,11 +1843,21 @@ var init_dist4 = __esm(() => {
1812
1843
  description: "Customer ID or domain"
1813
1844
  },
1814
1845
  channels: {
1815
- description: "Filter by event channel (e.g., EMAIL, SLACK, CALL)",
1846
+ description: "Filter by event channel (e.g., EMAIL, SLACK, CALL, CALENDAR)",
1816
1847
  type: "array",
1817
1848
  items: {
1818
1849
  type: "string",
1819
- enum: ["SDK", "EMAIL", "SLACK", "CALL", "CRM", "BILLING", "SUPPORT", "INTERNAL"]
1850
+ enum: [
1851
+ "SDK",
1852
+ "EMAIL",
1853
+ "SLACK",
1854
+ "CALL",
1855
+ "CALENDAR",
1856
+ "CRM",
1857
+ "BILLING",
1858
+ "SUPPORT",
1859
+ "INTERNAL"
1860
+ ]
1820
1861
  }
1821
1862
  },
1822
1863
  eventTypes: {
@@ -1883,7 +1924,7 @@ var init_dist4 = __esm(() => {
1883
1924
  type: "array",
1884
1925
  items: {
1885
1926
  type: "string",
1886
- enum: ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"]
1927
+ enum: customerSourceTypeInputs
1887
1928
  }
1888
1929
  },
1889
1930
  factTypes: {
@@ -1984,7 +2025,7 @@ var init_dist4 = __esm(() => {
1984
2025
  properties: {
1985
2026
  sourceType: {
1986
2027
  type: "string",
1987
- enum: ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"]
2028
+ enum: customerSourceTypeInputs
1988
2029
  },
1989
2030
  sourceId: {
1990
2031
  type: "string",
@@ -2045,7 +2086,7 @@ var init_dist4 = __esm(() => {
2045
2086
  type: "array",
2046
2087
  items: {
2047
2088
  type: "string",
2048
- enum: ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"]
2089
+ enum: customerSourceTypeInputs
2049
2090
  }
2050
2091
  }
2051
2092
  },
@@ -2055,21 +2096,22 @@ var init_dist4 = __esm(() => {
2055
2096
  },
2056
2097
  outlit_query: {
2057
2098
  toolName: "outlit_query",
2058
- description: `Execute raw SQL queries against your analytics data.
2099
+ description: `Execute read-only SQL queries against your analytics views.
2059
2100
 
2060
- Available tables:
2061
- - events: Customer activity events (event_name, event_type, event_channel, customer_id, occurred_at, properties, ...)
2062
- - customer_dimensions: Customer attributes (customer_id, domain, name, billing_status, plan, mrr_cents, ...)
2063
- - user_dimensions: User attributes (user_id, email, name, customer_id, ...)
2064
- - mrr_snapshots: Revenue snapshots over time (customer_id, snapshot_date, mrr_cents, ...)
2101
+ Available views:
2102
+ - activity: Customer activity events (event_name, event_type, event_channel, customer_id, occurred_at, properties, ...)
2103
+ - customers: Customer attributes (customer_id, domain, name, billing_status, plan, mrr_cents, traits, ...)
2104
+ - users: User attributes (user_id, email, name, customer_id, traits, ...)
2105
+ - revenue: Revenue snapshots over time (customer_id, snapshot_date, mrr_cents, ...)
2065
2106
 
2066
2107
  All queries are automatically filtered to your organization's data.
2067
2108
  Only SELECT queries are allowed.
2109
+ Properties and traits are JSON strings; inspect schemas and examples before filtering nested values.
2068
2110
 
2069
2111
  Example queries:
2070
- - SELECT event_name, count(*) FROM events GROUP BY 1 ORDER BY 2 DESC LIMIT 10
2071
- - SELECT billing_status, sum(mrr_cents)/100 as mrr FROM customer_dimensions GROUP BY 1
2072
- - SELECT * FROM events WHERE customer_id = 'cust_123' ORDER BY occurred_at DESC LIMIT 50`,
2112
+ - SELECT event_name, count(*) FROM activity GROUP BY 1 ORDER BY 2 DESC LIMIT 10
2113
+ - SELECT billing_status, sum(mrr_cents)/100 as mrr FROM customers GROUP BY 1
2114
+ - SELECT * FROM activity WHERE customer_id = 'cust_123' ORDER BY occurred_at DESC LIMIT 50`,
2073
2115
  inputSchema: {
2074
2116
  $schema: "https://json-schema.org/draft/2020-12/schema",
2075
2117
  type: "object",
@@ -2081,7 +2123,8 @@ Example queries:
2081
2123
  limit: {
2082
2124
  description: "Max rows to return (default 1000, max 10000)",
2083
2125
  default: 1000,
2084
- type: "number",
2126
+ type: "integer",
2127
+ minimum: 1,
2085
2128
  maximum: 1e4
2086
2129
  }
2087
2130
  },
@@ -2091,18 +2134,18 @@ Example queries:
2091
2134
  },
2092
2135
  outlit_schema: {
2093
2136
  toolName: "outlit_schema",
2094
- description: `Get table schemas for available analytics tables.
2137
+ description: `Get schemas for available analytics views.
2095
2138
 
2096
2139
  Use this to discover column names, types, and descriptions before writing SQL queries.
2097
- Returns column definitions and example queries for each table.`,
2140
+ Returns column definitions and example queries for each view.`,
2098
2141
  inputSchema: {
2099
2142
  $schema: "https://json-schema.org/draft/2020-12/schema",
2100
2143
  type: "object",
2101
2144
  properties: {
2102
2145
  table: {
2103
- description: "Specific table to describe, or omit for all tables",
2146
+ description: "Specific analytics view to describe. Omit to list all views.",
2104
2147
  type: "string",
2105
- enum: ["events", "customer_dimensions", "user_dimensions", "mrr_snapshots"]
2148
+ enum: ["activity", "customers", "users", "revenue"]
2106
2149
  }
2107
2150
  },
2108
2151
  additionalProperties: false
@@ -2268,7 +2311,6 @@ Returns column definitions and example queries for each table.`,
2268
2311
  "recentTimeline",
2269
2312
  "behaviorMetrics"
2270
2313
  ];
2271
- customerSourceTypes = ["EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET"];
2272
2314
  customerTimeframes = ["7d", "14d", "30d", "90d"];
2273
2315
  notificationSeverityValues = ["low", "medium", "high"];
2274
2316
  timelineChannels = [
@@ -2276,6 +2318,7 @@ Returns column definitions and example queries for each table.`,
2276
2318
  "EMAIL",
2277
2319
  "SLACK",
2278
2320
  "CALL",
2321
+ "CALENDAR",
2279
2322
  "CRM",
2280
2323
  "BILLING",
2281
2324
  "SUPPORT",
@@ -2289,13 +2332,12 @@ Returns column definitions and example queries for each table.`,
2289
2332
  "ENGAGED",
2290
2333
  "INACTIVE"
2291
2334
  ];
2292
- schemaTables = [
2293
- "events",
2294
- "customer_dimensions",
2295
- "user_dimensions",
2296
- "mrr_snapshots"
2297
- ];
2298
2335
  customerToolNameSet = new Set(customerToolNames);
2336
+ customerSourceTypeSet = new Set(customerSourceTypes);
2337
+ customerSourceTypeAliasMap = /* @__PURE__ */ new Map([
2338
+ ["CRM", "OPPORTUNITY"],
2339
+ ["CRM_OPPORTUNITY", "OPPORTUNITY"]
2340
+ ]);
2299
2341
  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))$/;
2300
2342
  actionToolNames = [
2301
2343
  "outlit_send_notification"
@@ -4484,7 +4526,12 @@ function invalidValues(values, allowed) {
4484
4526
  return [];
4485
4527
  return values.filter((value) => !allowed.includes(value));
4486
4528
  }
4487
- var list_default3;
4529
+ function normalizeSourceTypes(values) {
4530
+ if (!values)
4531
+ return;
4532
+ return Array.from(new Set(values.map((value) => normalizeCustomerSourceType(value)))).filter((sourceType) => sourceType !== null);
4533
+ }
4534
+ var sourceTypeDescription, list_default3;
4488
4535
  var init_list3 = __esm(() => {
4489
4536
  init_dist4();
4490
4537
  init_dist();
@@ -4494,6 +4541,7 @@ var init_list3 = __esm(() => {
4494
4541
  init_api();
4495
4542
  init_config();
4496
4543
  init_output();
4544
+ sourceTypeDescription = `${customerSourceTypes.join(", ")} (aliases: ${customerSourceTypeAliases.join(", ")})`;
4497
4545
  list_default3 = defineCommand2({
4498
4546
  meta: {
4499
4547
  name: "list",
@@ -4506,11 +4554,11 @@ var init_list3 = __esm(() => {
4506
4554
  " outlit facts list acme.com",
4507
4555
  " outlit facts list acme.com --status ACTIVE",
4508
4556
  " outlit facts list acme.com --fact-types CHURN_RISK,EXPANSION",
4509
- " outlit facts list acme.com --source-types CALL,EMAIL --after 2025-01-01T00:00:00Z",
4557
+ " outlit facts list acme.com --source-types CALL,OPPORTUNITY --after 2025-01-01T00:00:00Z",
4510
4558
  " outlit facts list acme.com --limit 50 --json",
4511
4559
  "",
4512
4560
  `Statuses: ${customerFactStatuses.join(", ")}`,
4513
- `Source types: ${customerSourceTypes.join(", ")}`,
4561
+ `Source types: ${sourceTypeDescription}`,
4514
4562
  `Fact categories: ${customerFactCategories.join(", ")}`,
4515
4563
  "",
4516
4564
  AGENT_JSON_HINT
@@ -4532,7 +4580,7 @@ var init_list3 = __esm(() => {
4532
4580
  },
4533
4581
  "source-types": {
4534
4582
  type: "string",
4535
- description: `Comma-separated generic source type filter (${customerSourceTypes.join(", ")})`
4583
+ description: `Comma-separated generic source type filter (${sourceTypeDescription})`
4536
4584
  },
4537
4585
  "fact-types": {
4538
4586
  type: "string",
@@ -4564,13 +4612,14 @@ var init_list3 = __esm(() => {
4564
4612
  code: "invalid_input"
4565
4613
  }, json);
4566
4614
  }
4567
- const invalidSourceTypes = invalidValues(sourceTypes, customerSourceTypes);
4615
+ const invalidSourceTypes = sourceTypes?.filter((value) => !normalizeCustomerSourceType(value)) ?? [];
4568
4616
  if (invalidSourceTypes.length > 0) {
4569
4617
  return outputError({
4570
- message: `Unknown source types: ${invalidSourceTypes.join(", ")}. Allowed: ${customerSourceTypes.join(", ")}`,
4618
+ message: `Unknown source types: ${invalidSourceTypes.join(", ")}. Allowed: ${customerSourceTypeInputs.join(", ")}`,
4571
4619
  code: "invalid_input"
4572
4620
  }, json);
4573
4621
  }
4622
+ const normalizedSourceTypes = normalizeSourceTypes(sourceTypes);
4574
4623
  const invalidFactTypes = invalidValues(factTypes, customerFactTypes);
4575
4624
  if (invalidFactTypes.length > 0) {
4576
4625
  const anomalyFactTypes = invalidFactTypes.filter((value) => unsupportedCustomerFactTypes.includes(value));
@@ -4620,8 +4669,8 @@ var init_list3 = __esm(() => {
4620
4669
  };
4621
4670
  if (statuses)
4622
4671
  params.status = statuses;
4623
- if (sourceTypes)
4624
- params.sourceTypes = sourceTypes;
4672
+ if (normalizedSourceTypes)
4673
+ params.sourceTypes = normalizedSourceTypes;
4625
4674
  if (factTypes)
4626
4675
  params.factTypes = factTypes;
4627
4676
  if (factCategories)
@@ -4733,7 +4782,7 @@ var exports_get3 = {};
4733
4782
  __export(exports_get3, {
4734
4783
  default: () => get_default3
4735
4784
  });
4736
- var get_default3;
4785
+ var sourceTypeDescription2, get_default3;
4737
4786
  var init_get3 = __esm(() => {
4738
4787
  init_dist4();
4739
4788
  init_dist();
@@ -4741,6 +4790,7 @@ var init_get3 = __esm(() => {
4741
4790
  init_output2();
4742
4791
  init_api();
4743
4792
  init_output();
4793
+ sourceTypeDescription2 = `${customerSourceTypes.join(", ")} (aliases: ${customerSourceTypeAliases.join(", ")})`;
4744
4794
  get_default3 = defineCommand2({
4745
4795
  meta: {
4746
4796
  name: "get",
@@ -4749,9 +4799,10 @@ var init_get3 = __esm(() => {
4749
4799
  "",
4750
4800
  "Examples:",
4751
4801
  " outlit sources get --source-type CALL --source-id call_123",
4802
+ " outlit sources get --source-type OPPORTUNITY --source-id opp_123",
4752
4803
  " outlit sources get --source-type SUPPORT_TICKET --source-id ticket_456 --json",
4753
4804
  "",
4754
- `Source types: ${customerSourceTypes.join(", ")}`,
4805
+ `Source types: ${sourceTypeDescription2}`,
4755
4806
  "",
4756
4807
  AGENT_JSON_HINT
4757
4808
  ].join(`
@@ -4762,7 +4813,7 @@ var init_get3 = __esm(() => {
4762
4813
  ...outputArgs,
4763
4814
  "source-type": {
4764
4815
  type: "string",
4765
- description: "Canonical source type",
4816
+ description: `Source type (${sourceTypeDescription2})`,
4766
4817
  required: true
4767
4818
  },
4768
4819
  "source-id": {
@@ -4773,15 +4824,16 @@ var init_get3 = __esm(() => {
4773
4824
  },
4774
4825
  async run({ args }) {
4775
4826
  const json = !!args.json;
4776
- if (!customerSourceTypes.includes(args["source-type"])) {
4827
+ const sourceType = normalizeCustomerSourceType(args["source-type"]);
4828
+ if (!sourceType) {
4777
4829
  return outputError({
4778
- message: `--source-type must be one of ${customerSourceTypes.join(", ")}`,
4830
+ message: `--source-type must be one of ${customerSourceTypeInputs.join(", ")}`,
4779
4831
  code: "invalid_input"
4780
4832
  }, json);
4781
4833
  }
4782
4834
  const client = await getClientOrExit(args["api-key"], json);
4783
4835
  return runTool(client, customerToolContracts.outlit_get_source.toolName, {
4784
- sourceType: args["source-type"],
4836
+ sourceType,
4785
4837
  sourceId: args["source-id"]
4786
4838
  }, json);
4787
4839
  }
@@ -4821,7 +4873,7 @@ var exports_search = {};
4821
4873
  __export(exports_search, {
4822
4874
  default: () => search_default
4823
4875
  });
4824
- var search_default;
4876
+ var sourceTypeDescription3, search_default;
4825
4877
  var init_search = __esm(() => {
4826
4878
  init_dist4();
4827
4879
  init_dist();
@@ -4830,6 +4882,7 @@ var init_search = __esm(() => {
4830
4882
  init_api();
4831
4883
  init_config();
4832
4884
  init_output();
4885
+ sourceTypeDescription3 = `${customerSourceTypes.join(", ")} (aliases: ${customerSourceTypeAliases.join(", ")})`;
4833
4886
  search_default = defineCommand2({
4834
4887
  meta: {
4835
4888
  name: "search",
@@ -4844,7 +4897,7 @@ var init_search = __esm(() => {
4844
4897
  " outlit search 'churn risk signals' --customer acme.com",
4845
4898
  " outlit search 'expansion opportunities' --top-k 50 --json",
4846
4899
  " outlit search 'support escalations' --after 2025-01-01T00:00:00Z --before 2025-03-31T23:59:59Z",
4847
- " outlit search 'onboarding issues' --source-types CALL,EMAIL",
4900
+ " outlit search 'renewal opportunities' --source-types CALL,OPPORTUNITY",
4848
4901
  "",
4849
4902
  AGENT_JSON_HINT
4850
4903
  ].join(`
@@ -4876,7 +4929,7 @@ var init_search = __esm(() => {
4876
4929
  },
4877
4930
  "source-types": {
4878
4931
  type: "string",
4879
- description: `Comma-separated generic source type filter (${customerSourceTypes.join(", ")})`
4932
+ description: `Comma-separated generic source type filter (${sourceTypeDescription3})`
4880
4933
  }
4881
4934
  },
4882
4935
  async run({ args }) {
@@ -4886,13 +4939,6 @@ var init_search = __esm(() => {
4886
4939
  return outputError({ message: "--top-k must be an integer between 1 and 50", code: "invalid_input" }, json);
4887
4940
  }
4888
4941
  const sourceTypes = args["source-types"] ? splitCsv(args["source-types"]).map((item) => item.trim()).filter(Boolean) : undefined;
4889
- const invalidSourceTypes = sourceTypes?.filter((value) => !customerSourceTypes.includes(value));
4890
- if (invalidSourceTypes && invalidSourceTypes.length > 0) {
4891
- return outputError({
4892
- message: `Unknown source types: ${invalidSourceTypes.join(", ")}. Allowed: ${customerSourceTypes.join(", ")}`,
4893
- code: "invalid_input"
4894
- }, json);
4895
- }
4896
4942
  const resolved = resolveCustomerContextSearchInput({
4897
4943
  query: args.query,
4898
4944
  customer: args.customer,
@@ -4919,7 +4965,7 @@ __export(exports_sql, {
4919
4965
  default: () => sql_default
4920
4966
  });
4921
4967
  import { readFileSync as readFileSync4 } from "node:fs";
4922
- var sql_default;
4968
+ var publicSqlViews, sql_default;
4923
4969
  var init_sql = __esm(() => {
4924
4970
  init_dist4();
4925
4971
  init_dist();
@@ -4927,21 +4973,22 @@ var init_sql = __esm(() => {
4927
4973
  init_output2();
4928
4974
  init_api();
4929
4975
  init_output();
4976
+ publicSqlViews = ["activity", "customers", "users", "revenue"];
4930
4977
  sql_default = defineCommand2({
4931
4978
  meta: {
4932
4979
  name: "sql",
4933
4980
  description: [
4934
- "Run a SQL query against Outlit's analytics database.",
4981
+ "Run a SQL query against Outlit analytics views.",
4935
4982
  "",
4936
4983
  "Provide the query as a positional argument or via --query-file.",
4937
4984
  "When both are provided, --query-file takes precedence.",
4938
4985
  "",
4939
- `Available tables: ${schemaTables.join(", ")}`,
4986
+ `Available views: ${publicSqlViews.join(", ")}`,
4940
4987
  "",
4941
4988
  "Examples:",
4942
- " outlit sql 'SELECT * FROM events LIMIT 10'",
4989
+ " outlit sql 'SELECT * FROM activity LIMIT 10'",
4943
4990
  " outlit sql --query-file ./my-query.sql",
4944
- " outlit sql 'SELECT count(*) FROM events' --limit 1 --json",
4991
+ " outlit sql 'SELECT count(*) FROM activity' --limit 1 --json",
4945
4992
  "",
4946
4993
  AGENT_JSON_HINT
4947
4994
  ].join(`
@@ -4984,8 +5031,8 @@ var init_sql = __esm(() => {
4984
5031
  return outputError({ message: "Provide a SQL query or --query-file", code: "missing_input" }, json);
4985
5032
  }
4986
5033
  const limit = Number(args.limit);
4987
- if (!Number.isFinite(limit) || limit <= 0) {
4988
- return outputError({ message: "--limit must be a positive number", code: "invalid_input" }, json);
5034
+ if (!Number.isInteger(limit) || limit < 1 || limit > 1e4) {
5035
+ return outputError({ message: "--limit must be an integer between 1 and 10000", code: "invalid_input" }, json);
4989
5036
  }
4990
5037
  return runTool(client, customerToolContracts.outlit_query.toolName, { sql, limit }, json);
4991
5038
  }
@@ -5176,28 +5223,29 @@ var exports_schema = {};
5176
5223
  __export(exports_schema, {
5177
5224
  default: () => schema_default
5178
5225
  });
5179
- var schema_default;
5226
+ var publicSqlViews2, schema_default;
5180
5227
  var init_schema = __esm(() => {
5181
5228
  init_dist4();
5182
5229
  init_dist();
5183
5230
  init_auth();
5184
5231
  init_output2();
5185
5232
  init_api();
5233
+ publicSqlViews2 = ["activity", "customers", "users", "revenue"];
5186
5234
  schema_default = defineCommand2({
5187
5235
  meta: {
5188
5236
  name: "schema",
5189
5237
  description: [
5190
- "Describe the analytics database schema.",
5238
+ "Describe the available analytics views.",
5191
5239
  "",
5192
- "Without a table name, returns the full schema for all tables.",
5193
- "With a table name, returns detailed column info for that table.",
5240
+ "Without a view name, returns the full schema for all views.",
5241
+ "With a view name, returns detailed column info for that view.",
5194
5242
  "",
5195
- `Available tables: ${schemaTables.join(", ")}`,
5243
+ `Available views: ${publicSqlViews2.join(", ")}`,
5196
5244
  "",
5197
5245
  "Examples:",
5198
5246
  " outlit schema",
5199
- " outlit schema events",
5200
- " outlit schema customer_dimensions --json",
5247
+ " outlit schema activity",
5248
+ " outlit schema customers --json",
5201
5249
  "",
5202
5250
  AGENT_JSON_HINT
5203
5251
  ].join(`
@@ -5206,9 +5254,9 @@ var init_schema = __esm(() => {
5206
5254
  args: {
5207
5255
  ...authArgs,
5208
5256
  ...outputArgs,
5209
- table: {
5257
+ view: {
5210
5258
  type: "positional",
5211
- description: `Table to describe (${schemaTables.join(", ")}). Optional.`,
5259
+ description: `View to describe (${publicSqlViews2.join(", ")}). Optional.`,
5212
5260
  required: false
5213
5261
  }
5214
5262
  },
@@ -5216,8 +5264,9 @@ var init_schema = __esm(() => {
5216
5264
  const json = !!args.json;
5217
5265
  const client = await getClientOrExit(args["api-key"], json);
5218
5266
  const params = {};
5219
- if (args.table)
5220
- params.table = args.table;
5267
+ const view = args.view ?? args.table;
5268
+ if (view)
5269
+ params.table = view;
5221
5270
  return runTool(client, customerToolContracts.outlit_schema.toolName, params, json);
5222
5271
  }
5223
5272
  });
@@ -6114,7 +6163,7 @@ var init_completions = __esm(() => {
6114
6163
  desc: "Get one exact source record",
6115
6164
  flags: [
6116
6165
  ...COMMON,
6117
- { name: "--source-type", desc: "Canonical source type" },
6166
+ { name: "--source-type", desc: "Source type" },
6118
6167
  { name: "--source-id", desc: "Exact source ID" }
6119
6168
  ]
6120
6169
  }
@@ -6141,7 +6190,7 @@ var init_completions = __esm(() => {
6141
6190
  { name: "--limit", desc: "Max rows to return" }
6142
6191
  ]
6143
6192
  },
6144
- { name: "schema", desc: "Discover table schemas", flags: [...COMMON] },
6193
+ { name: "schema", desc: "Discover analytics view schemas", flags: [...COMMON] },
6145
6194
  {
6146
6195
  name: "integrations",
6147
6196
  desc: "Manage platform integrations",
@@ -6965,11 +7014,11 @@ Usage examples:
6965
7014
  outlit users list --journey-stage CHAMPION
6966
7015
  outlit facts list acme.com --fact-types CHURN_RISK,EXPANSION
6967
7016
  outlit facts get --fact-id fact_123 --include evidence
6968
- outlit sources get --source-type CALL --source-id call_123
6969
- outlit search 'pricing objections last quarter' --source-types CALL,EMAIL
6970
- outlit sql 'SELECT * FROM events LIMIT 10'
7017
+ outlit sources get --source-type OPPORTUNITY --source-id opp_123
7018
+ outlit search 'pricing objections last quarter' --source-types CALL,OPPORTUNITY
7019
+ outlit sql 'SELECT * FROM activity LIMIT 10'
6971
7020
  outlit notify --title 'Risk found' '{"customer":"acme.com"}'
6972
- outlit schema events
7021
+ outlit schema activity
6973
7022
  outlit doctor --json
6974
7023
 
6975
7024
  For AI agents: commands auto-output JSON when stdout is piped. No --json flag needed.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outlit/cli",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "description": "CLI for Outlit customer intelligence platform",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@clack/prompts": "^1.0.1",
34
- "@outlit/tools": "^0.1.1",
34
+ "@outlit/tools": "^0.1.2",
35
35
  "citty": "^0.2.1"
36
36
  },
37
37
  "devDependencies": {