From 4e0d0c9f0e0271f7006388ad557b78bb9895e9a7 Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 19 Jul 2026 19:21:45 -0700 Subject: [PATCH 1/2] sync customer context Slack contract --- .changeset/customer-context-slack-source.md | 5 +++++ packages/tools/src/contracts.ts | 4 +++- packages/tools/tests/client.test.ts | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changeset/customer-context-slack-source.md diff --git a/.changeset/customer-context-slack-source.md b/.changeset/customer-context-slack-source.md new file mode 100644 index 0000000..3dff968 --- /dev/null +++ b/.changeset/customer-context-slack-source.md @@ -0,0 +1,5 @@ +--- +"@outlit/tools": patch +--- + +Add Slack as a supported customer-context search source type. diff --git a/packages/tools/src/contracts.ts b/packages/tools/src/contracts.ts index 152246a..4bb6a0c 100644 --- a/packages/tools/src/contracts.ts +++ b/packages/tools/src/contracts.ts @@ -24,6 +24,7 @@ export const customerSourceTypes = [ "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", + "SLACK", ] as const export const customerSourceTypeAliases = ["CRM", "CRM_OPPORTUNITY"] as const @@ -34,6 +35,7 @@ export const customerSourceTypeInputs = [ "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", + "SLACK", "CRM", "CRM_OPPORTUNITY", ] as const @@ -913,7 +915,7 @@ export const workspaceUserListOrderFields = ["name", "email", "owned_customer_co export const schemaTables = ["activity", "customers", "users", "revenue"] as const export const customerToolContractHash = - "d704edcb21910caaceef9ce2046e7e27c395ba3c0e286206368c82c716bd1e5a" as const + "fae5d47c73e2401362019f27f85925d36d3d87485611af0753f4a3bee2b002ae" as const export type CustomerToolName = (typeof customerToolNames)[number] export type CustomerSourceType = (typeof customerSourceTypes)[number] diff --git a/packages/tools/tests/client.test.ts b/packages/tools/tests/client.test.ts index f4a715e..aa7e4c0 100644 --- a/packages/tools/tests/client.test.ts +++ b/packages/tools/tests/client.test.ts @@ -112,13 +112,14 @@ describe("tool contracts", () => { expect(properties.factCategories?.items?.enum).not.toContain("JOURNEY") }) - test("exposes opportunity as the canonical CRM source type with aliases for inputs", () => { + test("exposes canonical source types with CRM aliases for inputs", () => { expect(customerSourceTypes).toEqual([ "EMAIL", "CALL", "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", + "SLACK", ]) expect(customerSourceTypeInputs).toEqual([ "EMAIL", @@ -126,6 +127,7 @@ describe("tool contracts", () => { "CALENDAR_EVENT", "SUPPORT_TICKET", "OPPORTUNITY", + "SLACK", "CRM", "CRM_OPPORTUNITY", ]) @@ -374,7 +376,7 @@ describe("resolveCustomerContextSearchInput", () => { ).toEqual({ ok: false, message: - "Unknown source types: ZENDESK_TICKET. Allowed: EMAIL, CALL, CALENDAR_EVENT, SUPPORT_TICKET, OPPORTUNITY, CRM, CRM_OPPORTUNITY", + "Unknown source types: ZENDESK_TICKET. Allowed: EMAIL, CALL, CALENDAR_EVENT, SUPPORT_TICKET, OPPORTUNITY, SLACK, CRM, CRM_OPPORTUNITY", }) }) }) From 40596564ee81a97e4cf6f1f87b7013923db85671 Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 19 Jul 2026 19:26:52 -0700 Subject: [PATCH 2/2] test Slack source normalization --- packages/tools/tests/client.test.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/tools/tests/client.test.ts b/packages/tools/tests/client.test.ts index aa7e4c0..93c52a8 100644 --- a/packages/tools/tests/client.test.ts +++ b/packages/tools/tests/client.test.ts @@ -333,7 +333,24 @@ describe("resolveCustomerContextSearchInput", () => { }) }) - test("normalizes CRM source aliases in search input", () => { + test("normalizes source types and CRM aliases in search input", () => { + expect( + resolveCustomerContextSearchInput({ + query: "renewal", + sourceTypes: ["slack"], + }), + ).toEqual({ + ok: true, + request: { + query: "renewal", + customer: undefined, + topK: undefined, + after: undefined, + before: undefined, + sourceTypes: ["SLACK"], + }, + }) + expect( resolveCustomerContextSearchInput({ query: "renewal",