@shipfox/api-integration-slack 10.2.0 → 11.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
1
  $ shipfox-swc
2
- Successfully compiled: 25 files with swc (381.94ms)
2
+ Successfully compiled: 25 files with swc (447.03ms)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @shipfox/api-integration-slack
2
2
 
3
+ ## 11.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 4661bce: Rename the Slack agent tools to match the Slack MCP server and add channel metadata, channel members, scheduled messages, and canvas creation. Tool ids and parameters now follow the MCP naming (`read_thread`, `send_message`, `channel_id`, `message_ts`, `message`), messages are written as standard Markdown, and workflows selecting the previous ids have to be updated. `send_message`, `schedule_message`, and `update_message` now reject a message over Slack's 12,000-character Markdown block limit instead of forwarding it and failing, and their notification fallback text has Markdown syntax stripped instead of shown literally. Slack installations need reauthorization for the added `canvases:write`, `im:read`, `mpim:read`, and `mpim:history` scopes. `SLACK_TOOL_OPERATIONS` and the `SlackToolOperation` type are no longer exported from the package root; they are Web-API wire-mapping internals with no consumer outside this package, and the Linear and GitHub integration packages never exported their equivalents either.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [25158c8]
12
+ - @shipfox/api-auth-context@11.0.0
13
+ - @shipfox/api-workspaces-dto@11.0.0
14
+
3
15
  ## 10.2.0
4
16
 
5
17
  ### Patch Changes
@@ -19,54 +19,82 @@ export declare class SlackAgentToolsProvider implements AgentToolsProvider<Slack
19
19
  private readonly options;
20
20
  constructor(options: SlackAgentToolsProviderOptions);
21
21
  catalog(): readonly [{
22
- readonly id: "conversations_history";
23
- readonly description: "List messages in a Slack channel or direct message.";
22
+ readonly id: "read_channel";
23
+ readonly description: "Read messages from a Slack channel in reverse chronological order (newest first). Reading direct message history needs the ID of that conversation, not the ID of the user on the other side.";
24
24
  readonly sensitivity: "read";
25
25
  readonly sensitive: false;
26
26
  readonly requiredScope: "read";
27
27
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
28
28
  }, {
29
- readonly id: "conversations_replies";
30
- readonly description: "List replies in a Slack message thread.";
29
+ readonly id: "read_thread";
30
+ readonly description: "Read a Slack thread: the parent message and all of its replies. Requires the channel ID and the timestamp of the parent message.";
31
31
  readonly sensitivity: "read";
32
32
  readonly sensitive: false;
33
33
  readonly requiredScope: "read";
34
34
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
35
35
  }, {
36
- readonly id: "conversations_list";
37
- readonly description: "List Slack channels visible to the bot.";
36
+ readonly id: "read_channel_info";
37
+ readonly description: "Retrieve metadata for a single Slack channel by ID: name, topic, purpose, privacy, and archive status. Use this to learn what a channel is for before reading or posting. To read its messages, use read_channel instead.";
38
38
  readonly sensitivity: "read";
39
39
  readonly sensitive: false;
40
40
  readonly requiredScope: "read";
41
41
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
42
42
  }, {
43
- readonly id: "users_info";
44
- readonly description: "Look up a Slack user and profile by user ID.";
43
+ readonly id: "read_channel_members";
44
+ readonly description: "List the user IDs of the members of a Slack channel. Pair it with read_user_profile to resolve a member to a name.";
45
45
  readonly sensitivity: "read";
46
46
  readonly sensitive: false;
47
47
  readonly requiredScope: "read";
48
48
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
49
49
  }, {
50
- readonly id: "chat_postMessage";
51
- readonly description: "Post a Slack message to a channel or thread. Provide text, blocks, or both.";
50
+ readonly id: "read_user_profile";
51
+ readonly description: "Retrieve profile information for a Slack user, including contact details, status, timezone, and role.";
52
+ readonly sensitivity: "read";
53
+ readonly sensitive: false;
54
+ readonly requiredScope: "read";
55
+ readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
56
+ }, {
57
+ readonly id: "search_channels";
58
+ readonly description: "Search the channels this integration can see, by name, topic, or purpose. Returns channel names, IDs, topics, purposes, and archive status. Names are typically lowercase with hyphens. Space-separated terms all have to match. Only the requested page is searched, so page through with the returned cursor when a channel is missing.";
59
+ readonly sensitivity: "read";
60
+ readonly sensitive: false;
61
+ readonly requiredScope: "read";
62
+ readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
63
+ }, {
64
+ readonly id: "send_message";
65
+ readonly description: "Send a message to a Slack channel or user. To send a direct message, pass the user ID as the channel ID. Supports standard Markdown: bold, italic, strikethrough, links, lists, blockquotes, inline code, and code blocks. Returns the posted message timestamp.";
52
66
  readonly sensitivity: "write";
53
67
  readonly sensitive: false;
54
68
  readonly requiredScope: "write";
55
69
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
56
70
  }, {
57
- readonly id: "chat_update";
58
- readonly description: "Update a Slack message with text, blocks, or both.";
71
+ readonly id: "schedule_message";
72
+ readonly description: "Schedule a message for future delivery to a Slack channel. Does not send immediately. post_at has to be at least 2 minutes in the future and at most 120 days out. Once scheduled, the message cannot be edited.";
59
73
  readonly sensitivity: "write";
60
74
  readonly sensitive: false;
61
75
  readonly requiredScope: "write";
62
76
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
63
77
  }, {
64
- readonly id: "reactions_add";
78
+ readonly id: "update_message";
79
+ readonly description: "Update an already posted Slack message, replacing its content. Supports the same standard Markdown as send_message.";
80
+ readonly sensitivity: "write";
81
+ readonly sensitive: false;
82
+ readonly requiredScope: "write";
83
+ readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
84
+ }, {
85
+ readonly id: "add_reaction";
65
86
  readonly description: "Add an emoji reaction to a Slack message.";
66
87
  readonly sensitivity: "write";
67
88
  readonly sensitive: false;
68
89
  readonly requiredScope: "write";
69
90
  readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
91
+ }, {
92
+ readonly id: "create_canvas";
93
+ readonly description: "Create a standalone Slack canvas from Markdown and return its ID. Not available on free teams.";
94
+ readonly sensitivity: "write";
95
+ readonly sensitive: false;
96
+ readonly requiredScope: "write";
97
+ readonly inputSchema: import("@shipfox/api-integration-spi").AgentToolJsonSchema;
70
98
  }];
71
99
  selectionCatalog(): import("@shipfox/api-integration-spi").AgentToolSelectionCatalog;
72
100
  openSession(input: OpenAgentToolsSessionInput<SlackIntegrationConnection, SlackAgentToolRequiredScope, unknown>): Promise<AgentToolSession<SlackToolCallResult>>;
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tools-provider.d.ts","sourceRoot":"","sources":["../../src/core/agent-tools-provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAC,cAAc,EAAsB,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAIL,KAAK,2BAA2B,EAGjC,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,iBAAiB,CAAC;AAErD,KAAK,0BAA0B,GAAG,qBAAqB,CAAC,OAAO,CAAC,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,SAAS;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,EAAE,CAAC;IACjD,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CACzD,CAAC;AAEF,MAAM,WAAW,8BAA8B;IAC7C,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAC1C,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;CACrD;AAED,qBAAa,uBACX,YACE,kBAAkB,CAChB,0BAA0B,EAC1B,2BAA2B,EAC3B,OAAO,EACP,mBAAmB,CACpB;IAES,OAAO,CAA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CACpB;IAES,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,8BAA8B;IAEpE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIP,gBAAgB;IAIV,WAAW,CACf,KAAK,EAAE,0BAA0B,CAC/B,0BAA0B,EAC1B,2BAA2B,EAC3B,OAAO,CACR,GACA,OAAO,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,CAAC;CAsDlD"}
@@ -1,5 +1,5 @@
1
1
  import { logger } from '@shipfox/node-opentelemetry';
2
- import { SLACK_TOOL_METHODS, slackAgentToolCatalog, slackAgentToolSelectionCatalog } from '#core/agent-tools.js';
2
+ import { SLACK_TOOL_OPERATIONS, slackAgentToolCatalog, slackAgentToolSelectionCatalog } from '#core/agent-tools.js';
3
3
  import { SlackIntegrationProviderError } from '#core/errors.js';
4
4
  export class SlackAgentToolsProvider {
5
5
  constructor(options){
@@ -19,18 +19,24 @@ export class SlackAgentToolsProvider {
19
19
  call: async (call)=>{
20
20
  const tool = input.tools.find((candidate)=>candidate.id === call.toolId);
21
21
  if (!tool) return slackToolError(`Unknown Slack tool: ${call.toolId}`);
22
- const method = slackToolMethod(tool.id);
23
- if (!method) return slackToolError(`Unknown Slack tool method: ${tool.id}`);
22
+ const operation = slackToolOperation(tool.id);
23
+ if (!operation) return slackToolError(`Unknown Slack tool method: ${tool.id}`);
24
24
  const missingParameter = missingRequiredParameter(tool, call.arguments);
25
25
  if (missingParameter) {
26
26
  return slackToolError(`Missing required parameter: ${missingParameter}`);
27
27
  }
28
+ const validationError = operation.validate?.(call.arguments);
29
+ if (validationError) {
30
+ return slackToolError(validationError.message, {
31
+ code: validationError.code
32
+ });
33
+ }
28
34
  let body;
29
35
  try {
30
36
  body = await this.options.slack.callMethod({
31
- method,
37
+ method: operation.method,
32
38
  token,
33
- arguments: call.arguments
39
+ arguments: operation.mapArguments(call.arguments)
34
40
  });
35
41
  } catch (error) {
36
42
  if (error instanceof SlackIntegrationProviderError) {
@@ -41,7 +47,9 @@ export class SlackAgentToolsProvider {
41
47
  }
42
48
  throw error;
43
49
  }
44
- if (body.ok) return slackToolResult(body);
50
+ if (body.ok) {
51
+ return slackToolResult(operation.mapOutput?.(body, call.arguments) ?? body);
52
+ }
45
53
  const slackError = typeof body.error === 'string' ? body.error : 'Slack request failed';
46
54
  if (isSlackAccessError(slackError)) {
47
55
  logger().warn({
@@ -63,8 +71,8 @@ export class SlackAgentToolsProvider {
63
71
  };
64
72
  }
65
73
  }
66
- function slackToolMethod(toolId) {
67
- return SLACK_TOOL_METHODS[toolId];
74
+ function slackToolOperation(toolId) {
75
+ return SLACK_TOOL_OPERATIONS[toolId];
68
76
  }
69
77
  function missingRequiredParameter(tool, args) {
70
78
  const required = tool.inputSchema.required;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/core/agent-tools-provider.ts"],"sourcesContent":["import type {\n AgentToolSession,\n AgentToolsProvider,\n IntegrationConnection,\n OpenAgentToolsSessionInput,\n} from '@shipfox/api-integration-spi';\nimport {logger} from '@shipfox/node-opentelemetry';\nimport type {SlackApiClient, SlackWebApiResponse} from '#api/client.js';\nimport {\n SLACK_TOOL_METHODS,\n type SlackAgentToolCatalogEntry,\n type SlackAgentToolId,\n type SlackAgentToolRequiredScope,\n slackAgentToolCatalog,\n slackAgentToolSelectionCatalog,\n} from '#core/agent-tools.js';\nimport {SlackIntegrationProviderError} from '#core/errors.js';\nimport type {SlackTokenStore} from '#core/tokens.js';\n\ntype SlackIntegrationConnection = IntegrationConnection<'slack'>;\n\nexport type SlackToolCallResult = {\n isError?: boolean | undefined;\n content: readonly {type: 'text'; text: string}[];\n structuredContent?: Record<string, unknown> | undefined;\n};\n\nexport interface SlackAgentToolsProviderOptions {\n slack: Pick<SlackApiClient, 'callMethod'>;\n tokenStore: Pick<SlackTokenStore, 'getAccessToken'>;\n}\n\nexport class SlackAgentToolsProvider\n implements\n AgentToolsProvider<\n SlackIntegrationConnection,\n SlackAgentToolRequiredScope,\n unknown,\n SlackToolCallResult\n >\n{\n constructor(private readonly options: SlackAgentToolsProviderOptions) {}\n\n catalog() {\n return slackAgentToolCatalog;\n }\n\n selectionCatalog() {\n return slackAgentToolSelectionCatalog;\n }\n\n async openSession(\n input: OpenAgentToolsSessionInput<\n SlackIntegrationConnection,\n SlackAgentToolRequiredScope,\n unknown\n >,\n ): Promise<AgentToolSession<SlackToolCallResult>> {\n const token = await this.options.tokenStore.getAccessToken({connectionId: input.connection.id});\n\n return {\n call: async (call) => {\n const tool = input.tools.find((candidate) => candidate.id === call.toolId);\n if (!tool) return slackToolError(`Unknown Slack tool: ${call.toolId}`);\n const method = slackToolMethod(tool.id);\n if (!method) return slackToolError(`Unknown Slack tool method: ${tool.id}`);\n const missingParameter = missingRequiredParameter(tool, call.arguments);\n if (missingParameter) {\n return slackToolError(`Missing required parameter: ${missingParameter}`);\n }\n\n let body: SlackWebApiResponse;\n try {\n body = await this.options.slack.callMethod({\n method,\n token,\n arguments: call.arguments,\n });\n } catch (error) {\n if (error instanceof SlackIntegrationProviderError) {\n return slackToolError(error.message, {\n code: error.reason,\n retryAfterSeconds: error.retryAfterSeconds,\n });\n }\n throw error;\n }\n\n if (body.ok) return slackToolResult(body);\n const slackError = typeof body.error === 'string' ? body.error : 'Slack request failed';\n if (isSlackAccessError(slackError)) {\n logger().warn(\n {connectionId: input.connection.id, slackError},\n 'Slack API rejected integration credentials',\n );\n return slackToolError(slackError, {code: 'access-denied'});\n }\n if (slackError === 'ratelimited') {\n return slackToolError(slackError, {code: 'rate-limited'});\n }\n return slackToolError(slackError);\n },\n close: () => Promise.resolve(),\n };\n }\n}\n\nfunction slackToolMethod(toolId: string): string | undefined {\n return SLACK_TOOL_METHODS[toolId as SlackAgentToolId];\n}\n\nfunction missingRequiredParameter(\n tool: SlackAgentToolCatalogEntry,\n args: Record<string, unknown>,\n): string | undefined {\n const required = tool.inputSchema.required;\n if (!Array.isArray(required)) return undefined;\n return required.find((parameter) => typeof parameter === 'string' && !(parameter in args));\n}\n\nfunction isSlackAccessError(error: string): boolean {\n return error === 'invalid_auth' || error === 'token_revoked' || error === 'account_inactive';\n}\n\nfunction slackToolResult(body: SlackWebApiResponse): SlackToolCallResult {\n return {\n content: [{type: 'text', text: JSON.stringify(body)}],\n structuredContent: body,\n };\n}\n\nfunction slackToolError(\n message: string,\n options: {code?: string | undefined; retryAfterSeconds?: number | undefined} = {},\n): SlackToolCallResult {\n const structuredContent = {\n ...(options.code === undefined ? {} : {code: options.code}),\n ...(options.retryAfterSeconds === undefined\n ? {}\n : {retryAfterSeconds: options.retryAfterSeconds}),\n };\n return {\n isError: true,\n content: [{type: 'text', text: message}],\n ...(Object.keys(structuredContent).length === 0 ? {} : {structuredContent}),\n };\n}\n"],"names":["logger","SLACK_TOOL_METHODS","slackAgentToolCatalog","slackAgentToolSelectionCatalog","SlackIntegrationProviderError","SlackAgentToolsProvider","options","catalog","selectionCatalog","openSession","input","token","tokenStore","getAccessToken","connectionId","connection","id","call","tool","tools","find","candidate","toolId","slackToolError","method","slackToolMethod","missingParameter","missingRequiredParameter","arguments","body","slack","callMethod","error","message","code","reason","retryAfterSeconds","ok","slackToolResult","slackError","isSlackAccessError","warn","close","Promise","resolve","args","required","inputSchema","Array","isArray","undefined","parameter","content","type","text","JSON","stringify","structuredContent","isError","Object","keys","length"],"mappings":"AAMA,SAAQA,MAAM,QAAO,8BAA8B;AAEnD,SACEC,kBAAkB,EAIlBC,qBAAqB,EACrBC,8BAA8B,QACzB,uBAAuB;AAC9B,SAAQC,6BAA6B,QAAO,kBAAkB;AAgB9D,OAAO,MAAMC;IASX,YAAY,AAAiBC,OAAuC,CAAE;aAAzCA,UAAAA;IAA0C;IAEvEC,UAAU;QACR,OAAOL;IACT;IAEAM,mBAAmB;QACjB,OAAOL;IACT;IAEA,MAAMM,YACJC,KAIC,EAC+C;QAChD,MAAMC,QAAQ,MAAM,IAAI,CAACL,O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ToolSession,\n AgentToolsProvider,\n IntegrationConnection,\n OpenAgentToolsSessionInput,\n} from '@shipfox/api-integration-spi';\nimport {logger} from '@shipfox/node-opentelemetry';\nimport type {SlackApiClient, SlackWebApiResponse} from '#api/client.js';\nimport {\n SLACK_TOOL_OPERATIONS,\n type SlackAgentToolCatalogEntry,\n type SlackAgentToolId,\n type SlackAgentToolRequiredScope,\n type SlackToolOperation,\n slackAgentToolCatalog,\n slackAgentToolSelectionCatalog,\n} from '#core/agent-tools.js';\nimport {SlackIntegrationProviderError} from '#core/errors.js';\nimport type {SlackTokenStore} from '#core/tokens.js';\n\ntype SlackIntegrationConnection = IntegrationConnection<'slack'>;\n\nexport type SlackToolCallResult = {\n isError?: boolean | undefined;\n content: readonly {type: 'text'; text: string}[];\n structuredContent?: Record<string, unknown> | undefined;\n};\n\nexport interface SlackAgentToolsProviderOptions {\n slack: Pick<SlackApiClient, 'callMethod'>;\n tokenStore: Pick<SlackTokenStore, 'getAccessToken'>;\n}\n\nexport class SlackAgentToolsProvider\n implements\n AgentToolsProvider<\n SlackIntegrationConnection,\n SlackAgentToolRequiredScope,\n unknown,\n SlackToolCallResult\n >\n{\n constructor(private readonly options: SlackAgentToolsProviderOptions) {}\n\n catalog() {\n return slackAgentToolCatalog;\n }\n\n selectionCatalog() {\n return slackAgentToolSelectionCatalog;\n }\n\n async openSession(\n input: OpenAgentToolsSessionInput<\n SlackIntegrationConnection,\n SlackAgentToolRequiredScope,\n unknown\n >,\n ): Promise<AgentToolSession<SlackToolCallResult>> {\n const token = await this.options.tokenStore.getAccessToken({connectionId: input.connection.id});\n\n return {\n call: async (call) => {\n const tool = input.tools.find((candidate) => candidate.id === call.toolId);\n if (!tool) return slackToolError(`Unknown Slack tool: ${call.toolId}`);\n const operation = slackToolOperation(tool.id);\n if (!operation) return slackToolError(`Unknown Slack tool method: ${tool.id}`);\n const missingParameter = missingRequiredParameter(tool, call.arguments);\n if (missingParameter) {\n return slackToolError(`Missing required parameter: ${missingParameter}`);\n }\n const validationError = operation.validate?.(call.arguments);\n if (validationError) {\n return slackToolError(validationError.message, {code: validationError.code});\n }\n\n let body: SlackWebApiResponse;\n try {\n body = await this.options.slack.callMethod({\n method: operation.method,\n token,\n arguments: operation.mapArguments(call.arguments),\n });\n } catch (error) {\n if (error instanceof SlackIntegrationProviderError) {\n return slackToolError(error.message, {\n code: error.reason,\n retryAfterSeconds: error.retryAfterSeconds,\n });\n }\n throw error;\n }\n\n if (body.ok) {\n return slackToolResult(operation.mapOutput?.(body, call.arguments) ?? body);\n }\n const slackError = typeof body.error === 'string' ? body.error : 'Slack request failed';\n if (isSlackAccessError(slackError)) {\n logger().warn(\n {connectionId: input.connection.id, slackError},\n 'Slack API rejected integration credentials',\n );\n return slackToolError(slackError, {code: 'access-denied'});\n }\n if (slackError === 'ratelimited') {\n return slackToolError(slackError, {code: 'rate-limited'});\n }\n return slackToolError(slackError);\n },\n close: () => Promise.resolve(),\n };\n }\n}\n\nfunction slackToolOperation(toolId: string): SlackToolOperation | undefined {\n return SLACK_TOOL_OPERATIONS[toolId as SlackAgentToolId];\n}\n\nfunction missingRequiredParameter(\n tool: SlackAgentToolCatalogEntry,\n args: Record<string, unknown>,\n): string | undefined {\n const required = tool.inputSchema.required;\n if (!Array.isArray(required)) return undefined;\n return required.find((parameter) => typeof parameter === 'string' && !(parameter in args));\n}\n\nfunction isSlackAccessError(error: string): boolean {\n return error === 'invalid_auth' || error === 'token_revoked' || error === 'account_inactive';\n}\n\nfunction slackToolResult(body: SlackWebApiResponse): SlackToolCallResult {\n return {\n content: [{type: 'text', text: JSON.stringify(body)}],\n structuredContent: body,\n };\n}\n\nfunction slackToolError(\n message: string,\n options: {code?: string | undefined; retryAfterSeconds?: number | undefined} = {},\n): SlackToolCallResult {\n const structuredContent = {\n ...(options.code === undefined ? {} : {code: options.code}),\n ...(options.retryAfterSeconds === undefined\n ? {}\n : {retryAfterSeconds: options.retryAfterSeconds}),\n };\n return {\n isError: true,\n content: [{type: 'text', text: message}],\n ...(Object.keys(structuredContent).length === 0 ? {} : {structuredContent}),\n };\n}\n"],"names":["logger","SLACK_TOOL_OPERATIONS","slackAgentToolCatalog","slackAgentToolSelectionCatalog","SlackIntegrationProviderError","SlackAgentToolsProvider","options","catalog","selectionCatalog","openSession","input","token","tokenStore","getAccessToken","connectionId","connection","id","call","tool","tools","find","candidate","toolId","slackToolError","operation","slackToolOperation","missingParameter","missingRequiredParameter","arguments","validationError","validate","message","code","body","slack","callMethod","method","mapArguments","error","reason","retryAfterSeconds","ok","slackToolResult","mapOutput","slackError","isSlackAccessError","warn","close","Promise","resolve","args","required","inputSchema","Array","isArray","undefined","parameter","content","type","text","JSON","stringify","structuredContent","isError","Object","keys","length"],"mappings":"AAMA,SAAQA,MAAM,QAAO,8BAA8B;AAEnD,SACEC,qBAAqB,EAKrBC,qBAAqB,EACrBC,8BAA8B,QACzB,uBAAuB;AAC9B,SAAQC,6BAA6B,QAAO,kBAAkB;AAgB9D,OAAO,MAAMC;IASX,YAAY,AAAiBC,OAAuC,CAAE;aAAzCA,UAAAA;IAA0C;IAEvEC,UAAU;QACR,OAAOL;IACT;IAEAM,mBAAmB;QACjB,OAAOL;IACT;IAEA,MAAMM,YACJC,KAIC,EAC+C;QAChD,MAAMC,QAAQ,MAAM,IAAI,CAACL,OAAO,CAACM,UAAU,CAACC,cAAc,CAAC;YAACC,cAAcJ,MAAMK,UAAU,CAACC,EAAE;QAAA;QAE7F,OAAO;YACLC,MAAM,OAAOA;gBACX,MAAMC,OAAOR,MAAMS,KAAK,CAACC,IAAI,CAAC,CAACC,YAAcA,UAAUL,EAAE,KAAKC,KAAKK,MAAM;gBACzE,IAAI,CAACJ,MAAM,OAAOK,eAAe,CAAC,oBAAoB,EAAEN,KAAKK,MAAM,EAAE;gBACrE,MAAME,YAAYC,mBAAmBP,KAAKF,EAAE;gBAC5C,IAAI,CAACQ,WAAW,OAAOD,eAAe,CAAC,2BAA2B,EAAEL,KAAKF,EAAE,EAAE;gBAC7E,M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xB,mBAAmBH,MAAc;IACxC,OAAOrB,qBAAqB,CAACqB,OAA2B;AAC1D;AAEA,SAASK,yBACPT,IAAgC,EAChCgC,IAA6B;IAE7B,MAAMC,WAAWjC,KAAKkC,WAAW,CAACD,QAAQ;IAC1C,IAAI,CAACE,MAAMC,OAAO,CAACH,WAAW,OAAOI;IACrC,OAAOJ,SAAS/B,IAAI,CAAC,CAACoC,YAAc,OAAOA,cAAc,YAAY,CAAEA,CAAAA,aAAaN,IAAG;AACzF;AAEA,SAASL,mBAAmBP,KAAa;IACvC,OAAOA,UAAU,kBAAkBA,UAAU,mBAAmBA,UAAU;AAC5E;AAEA,SAASI,gBAAgBT,IAAyB;IAChD,OAAO;QACLwB,SAAS;YAAC;gBAACC,MAAM;gBAAQC,MAAMC,KAAKC,SAAS,CAAC5B;YAAK;SAAE;QACrD6B,mBAAmB7B;IACrB;AACF;AAEA,SAASV,eACPQ,OAAe,EACfzB,UAA+E,CAAC,CAAC;IAEjF,MAAMwD,oBAAoB;QACxB,GAAIxD,QAAQ0B,IAAI,KAAKuB,YAAY,CAAC,IAAI;YAACvB,MAAM1B,QAAQ0B,IAAI;QAAA,CAAC;QAC1D,GAAI1B,QAAQkC,iBAAiB,KAAKe,YAC9B,CAAC,IACD;YAACf,mBAAmBlC,QAAQkC,iBAAiB;QAAA,CAAC;IACpD;IACA,OAAO;QACLuB,SAAS;QACTN,SAAS;YAAC;gBAACC,MAAM;gBAAQC,MAAM5B;YAAO;SAAE;QACxC,GAAIiC,OAAOC,IAAI,CAACH,mBAAmBI,MAAM,KAAK,IAAI,CAAC,IAAI;YAACJ;QAAiB,CAAC;IAC5E;AACF"}
@@ -1,65 +1,198 @@
1
1
  import type { AgentToolCatalogEntry, AgentToolJsonSchema, AgentToolSelectionCatalog } from '@shipfox/api-integration-spi';
2
+ import type { SlackWebApiResponse } from '#api/client.js';
2
3
  export type SlackAgentToolRequiredScope = 'read' | 'write';
3
4
  export type SlackAgentToolCatalogEntry = AgentToolCatalogEntry<SlackAgentToolRequiredScope>;
4
5
  export declare const slackAgentToolCatalog: readonly [{
5
- readonly id: "conversations_history";
6
- readonly description: "List messages in a Slack channel or direct message.";
6
+ readonly id: "read_channel";
7
+ readonly description: "Read messages from a Slack channel in reverse chronological order (newest first). Reading direct message history needs the ID of that conversation, not the ID of the user on the other side.";
7
8
  readonly sensitivity: "read";
8
9
  readonly sensitive: false;
9
10
  readonly requiredScope: "read";
10
11
  readonly inputSchema: AgentToolJsonSchema;
11
12
  }, {
12
- readonly id: "conversations_replies";
13
- readonly description: "List replies in a Slack message thread.";
13
+ readonly id: "read_thread";
14
+ readonly description: "Read a Slack thread: the parent message and all of its replies. Requires the channel ID and the timestamp of the parent message.";
14
15
  readonly sensitivity: "read";
15
16
  readonly sensitive: false;
16
17
  readonly requiredScope: "read";
17
18
  readonly inputSchema: AgentToolJsonSchema;
18
19
  }, {
19
- readonly id: "conversations_list";
20
- readonly description: "List Slack channels visible to the bot.";
20
+ readonly id: "read_channel_info";
21
+ readonly description: "Retrieve metadata for a single Slack channel by ID: name, topic, purpose, privacy, and archive status. Use this to learn what a channel is for before reading or posting. To read its messages, use read_channel instead.";
21
22
  readonly sensitivity: "read";
22
23
  readonly sensitive: false;
23
24
  readonly requiredScope: "read";
24
25
  readonly inputSchema: AgentToolJsonSchema;
25
26
  }, {
26
- readonly id: "users_info";
27
- readonly description: "Look up a Slack user and profile by user ID.";
27
+ readonly id: "read_channel_members";
28
+ readonly description: "List the user IDs of the members of a Slack channel. Pair it with read_user_profile to resolve a member to a name.";
28
29
  readonly sensitivity: "read";
29
30
  readonly sensitive: false;
30
31
  readonly requiredScope: "read";
31
32
  readonly inputSchema: AgentToolJsonSchema;
32
33
  }, {
33
- readonly id: "chat_postMessage";
34
- readonly description: "Post a Slack message to a channel or thread. Provide text, blocks, or both.";
34
+ readonly id: "read_user_profile";
35
+ readonly description: "Retrieve profile information for a Slack user, including contact details, status, timezone, and role.";
36
+ readonly sensitivity: "read";
37
+ readonly sensitive: false;
38
+ readonly requiredScope: "read";
39
+ readonly inputSchema: AgentToolJsonSchema;
40
+ }, {
41
+ readonly id: "search_channels";
42
+ readonly description: "Search the channels this integration can see, by name, topic, or purpose. Returns channel names, IDs, topics, purposes, and archive status. Names are typically lowercase with hyphens. Space-separated terms all have to match. Only the requested page is searched, so page through with the returned cursor when a channel is missing.";
43
+ readonly sensitivity: "read";
44
+ readonly sensitive: false;
45
+ readonly requiredScope: "read";
46
+ readonly inputSchema: AgentToolJsonSchema;
47
+ }, {
48
+ readonly id: "send_message";
49
+ readonly description: "Send a message to a Slack channel or user. To send a direct message, pass the user ID as the channel ID. Supports standard Markdown: bold, italic, strikethrough, links, lists, blockquotes, inline code, and code blocks. Returns the posted message timestamp.";
35
50
  readonly sensitivity: "write";
36
51
  readonly sensitive: false;
37
52
  readonly requiredScope: "write";
38
53
  readonly inputSchema: AgentToolJsonSchema;
39
54
  }, {
40
- readonly id: "chat_update";
41
- readonly description: "Update a Slack message with text, blocks, or both.";
55
+ readonly id: "schedule_message";
56
+ readonly description: "Schedule a message for future delivery to a Slack channel. Does not send immediately. post_at has to be at least 2 minutes in the future and at most 120 days out. Once scheduled, the message cannot be edited.";
42
57
  readonly sensitivity: "write";
43
58
  readonly sensitive: false;
44
59
  readonly requiredScope: "write";
45
60
  readonly inputSchema: AgentToolJsonSchema;
46
61
  }, {
47
- readonly id: "reactions_add";
62
+ readonly id: "update_message";
63
+ readonly description: "Update an already posted Slack message, replacing its content. Supports the same standard Markdown as send_message.";
64
+ readonly sensitivity: "write";
65
+ readonly sensitive: false;
66
+ readonly requiredScope: "write";
67
+ readonly inputSchema: AgentToolJsonSchema;
68
+ }, {
69
+ readonly id: "add_reaction";
48
70
  readonly description: "Add an emoji reaction to a Slack message.";
49
71
  readonly sensitivity: "write";
50
72
  readonly sensitive: false;
51
73
  readonly requiredScope: "write";
52
74
  readonly inputSchema: AgentToolJsonSchema;
75
+ }, {
76
+ readonly id: "create_canvas";
77
+ readonly description: "Create a standalone Slack canvas from Markdown and return its ID. Not available on free teams.";
78
+ readonly sensitivity: "write";
79
+ readonly sensitive: false;
80
+ readonly requiredScope: "write";
81
+ readonly inputSchema: AgentToolJsonSchema;
53
82
  }];
54
83
  export type SlackAgentToolId = (typeof slackAgentToolCatalog)[number]['id'];
55
- export declare const SLACK_TOOL_METHODS: {
56
- readonly conversations_history: "conversations.history";
57
- readonly conversations_replies: "conversations.replies";
58
- readonly conversations_list: "conversations.list";
59
- readonly users_info: "users.info";
60
- readonly chat_postMessage: "chat.postMessage";
61
- readonly chat_update: "chat.update";
62
- readonly reactions_add: "reactions.add";
84
+ export interface SlackToolOperation {
85
+ method: string;
86
+ mapArguments: (args: Record<string, unknown>) => Record<string, unknown>;
87
+ mapOutput?: (body: SlackWebApiResponse, args: Record<string, unknown>) => SlackWebApiResponse;
88
+ validate?: (args: Record<string, unknown>) => SlackToolValidationError | undefined;
89
+ }
90
+ export interface SlackToolValidationError {
91
+ message: string;
92
+ code?: string | undefined;
93
+ }
94
+ export declare const SLACK_TOOL_OPERATIONS: {
95
+ readonly read_channel: {
96
+ readonly method: "conversations.history";
97
+ readonly mapArguments: ({ channel_id, oldest, latest, limit, cursor }: Record<string, unknown>) => {
98
+ channel: unknown;
99
+ oldest: unknown;
100
+ latest: unknown;
101
+ limit: unknown;
102
+ cursor: unknown;
103
+ };
104
+ };
105
+ readonly read_thread: {
106
+ readonly method: "conversations.replies";
107
+ readonly mapArguments: ({ channel_id, message_ts, oldest, latest, limit, cursor }: Record<string, unknown>) => {
108
+ channel: unknown;
109
+ ts: unknown;
110
+ oldest: unknown;
111
+ latest: unknown;
112
+ limit: unknown;
113
+ cursor: unknown;
114
+ };
115
+ };
116
+ readonly read_channel_info: {
117
+ readonly method: "conversations.info";
118
+ readonly mapArguments: ({ channel_id, include_num_members }: Record<string, unknown>) => {
119
+ channel: unknown;
120
+ include_num_members: unknown;
121
+ };
122
+ };
123
+ readonly read_channel_members: {
124
+ readonly method: "conversations.members";
125
+ readonly mapArguments: ({ channel_id, limit, cursor }: Record<string, unknown>) => {
126
+ channel: unknown;
127
+ limit: unknown;
128
+ cursor: unknown;
129
+ };
130
+ };
131
+ readonly read_user_profile: {
132
+ readonly method: "users.info";
133
+ readonly mapArguments: ({ user_id, include_locale }: Record<string, unknown>) => {
134
+ user: unknown;
135
+ include_locale: unknown;
136
+ };
137
+ };
138
+ readonly search_channels: {
139
+ readonly method: "conversations.list";
140
+ readonly mapArguments: ({ channel_types, include_archived, limit, cursor }: Record<string, unknown>) => {
141
+ types: unknown;
142
+ exclude_archived: boolean;
143
+ limit: unknown;
144
+ cursor: unknown;
145
+ };
146
+ readonly mapOutput: typeof matchingChannels;
147
+ };
148
+ readonly send_message: {
149
+ readonly method: "chat.postMessage";
150
+ readonly mapArguments: ({ channel_id, message, thread_ts, reply_broadcast }: Record<string, unknown>) => {
151
+ thread_ts: unknown;
152
+ reply_broadcast: unknown;
153
+ channel: unknown;
154
+ };
155
+ readonly validate: typeof validateMessageLength;
156
+ };
157
+ readonly schedule_message: {
158
+ readonly method: "chat.scheduleMessage";
159
+ readonly mapArguments: ({ channel_id, message, post_at, thread_ts, reply_broadcast }: Record<string, unknown>) => {
160
+ post_at: unknown;
161
+ thread_ts: unknown;
162
+ reply_broadcast: unknown;
163
+ channel: unknown;
164
+ };
165
+ readonly validate: typeof validateMessageLength;
166
+ };
167
+ readonly update_message: {
168
+ readonly method: "chat.update";
169
+ readonly mapArguments: ({ channel_id, message_ts, message }: Record<string, unknown>) => {
170
+ channel: unknown;
171
+ ts: unknown;
172
+ };
173
+ readonly validate: typeof validateMessageLength;
174
+ };
175
+ readonly add_reaction: {
176
+ readonly method: "reactions.add";
177
+ readonly mapArguments: ({ channel_id, message_ts, emoji }: Record<string, unknown>) => {
178
+ channel: unknown;
179
+ timestamp: unknown;
180
+ name: unknown;
181
+ };
182
+ };
183
+ readonly create_canvas: {
184
+ readonly method: "canvases.create";
185
+ readonly mapArguments: ({ title, content }: Record<string, unknown>) => {
186
+ title: unknown;
187
+ document_content: {
188
+ type: string;
189
+ markdown: unknown;
190
+ };
191
+ };
192
+ };
63
193
  };
64
194
  export declare const slackAgentToolSelectionCatalog: AgentToolSelectionCatalog;
195
+ declare function validateMessageLength(args: Record<string, unknown>): SlackToolValidationError | undefined;
196
+ declare function matchingChannels(body: SlackWebApiResponse, args: Record<string, unknown>): SlackWebApiResponse;
197
+ export {};
65
198
  //# sourceMappingURL=agent-tools.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/core/agent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EAE1B,MAAM,8BAA8B,CAAC;AAEtC,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,2BAA2B,CAAC,CAAC;AAe5F,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuGwB,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAE5E,eAAO,MAAM,kBAAkB;;;;;;;;CAQsB,CAAC;AAEtD,eAAO,MAAM,8BAA8B,2BACiB,CAAC"}
1
+ {"version":3,"file":"agent-tools.d.ts","sourceRoot":"","sources":["../../src/core/agent-tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EAE1B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAExD,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,OAAO,CAAC;AAC3D,MAAM,MAAM,0BAA0B,GAAG,qBAAqB,CAAC,2BAA2B,CAAC,CAAC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