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..93c52a8 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", ]) @@ -331,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", @@ -374,7 +393,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", }) }) })