Files
copilotkit__copilotkit/examples/slack/app/tools/index.ts
Alem Tuzlak acf17d6170 feat(examples): Slack on-call triage bot over Linear + Notion MCP
100% JSX bot at feature parity with the PoC example: issue/page cards,
tables, Chart.js charts, Mermaid diagrams, incident/status/links cards,
a confirm_write HITL gate, and /agent + /triage slash commands.
Registers examples/slack in the pnpm workspace.
2026-06-10 10:46:08 -07:00

59 lines
1.8 KiB
TypeScript

/**
* App-specific frontend tools — anything that's bot-specific, not
* universal-Slack. Universal-Slack stuff (tagging, formatting,
* conversation model) lives in the SDK and is auto-included by
* `defaultSlackTools` (spread in `app/index.ts`).
*
* Add new tools here and re-export them through `appTools`. Wire the
* array into `createBot({tools: [...defaultSlackTools, ...appTools]})`
* in `app/index.ts`.
*/
import { readThreadTool } from "./read-thread.js";
import { renderChartTool } from "./render-chart.js";
import { renderDiagramTool } from "./render-diagram.js";
import { renderTableTool } from "./render-table.js";
import { issueCardTool, issueListTool, pageListTool } from "./render-tools.js";
import {
showIncidentTool,
showStatusTool,
showLinksTool,
} from "./showcase-tools.js";
import { confirmWriteTool } from "../human-in-the-loop/index.js";
import type { BotTool } from "@copilotkit/bot";
/**
* Every tool is a plain `BotTool`: its handler receives the generic
* `BotToolContext` (`{ thread, message?, user?, signal?, platform }`) the
* adapter supplies at call time. Platform power (post/stream/postFile,
* `thread.getMessages()`, `thread.lookupUser()`, …) is reached via the
* `thread` methods, so there's no per-adapter context and no cast needed —
* the array assigns straight into `createBot({ tools })`.
*/
export const appTools: BotTool[] = [
readThreadTool,
renderChartTool,
renderDiagramTool,
renderTableTool,
issueCardTool,
issueListTool,
pageListTool,
showIncidentTool,
showStatusTool,
showLinksTool,
confirmWriteTool,
];
export {
readThreadTool,
renderChartTool,
renderDiagramTool,
renderTableTool,
issueCardTool,
issueListTool,
pageListTool,
showIncidentTool,
showStatusTool,
showLinksTool,
confirmWriteTool,
};