59 lines
1.8 KiB
TypeScript
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/channels";
|
|
|
|
/**
|
|
* 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,
|
|
};
|