@meetopenbot/slack 0.0.8 → 0.0.10

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.
package/dist/agent.js CHANGED
@@ -2,8 +2,8 @@ import { runMcpTurn } from "@meetopenbot/plugin-sdk";
2
2
  const SYSTEM_PROMPT = `You are the OpenBot Slack specialist agent.
3
3
  Use Slack MCP tools to post messages, list channels, read history, and perform other workspace actions when needed.
4
4
  Summarize results clearly in plain text for the user. Be concise and friendly.`;
5
- export async function runSlackAgent(args) {
6
- return runMcpTurn({
5
+ export async function* runSlackAgent(args) {
6
+ yield* runMcpTurn({
7
7
  mcp: {
8
8
  command: "npx",
9
9
  args: ["-y", "@modelcontextprotocol/server-slack"],
@@ -17,5 +17,6 @@ export async function runSlackAgent(args) {
17
17
  system: SYSTEM_PROMPT,
18
18
  prompt: args.prompt,
19
19
  maxSteps: 10,
20
+ groupId: "Slack:tools",
20
21
  });
21
22
  }
package/dist/invoke.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { randomUUID } from "node:crypto";
2
- import { agentOutput, creditsErrorMessage, hasLlmAuth, llmAuthNotConfiguredMessage, shouldHandleInvoke, } from "@meetopenbot/plugin-sdk";
2
+ import { agentOutput, creditsErrorMessage, hasLlmAuth, llmAuthNotConfiguredMessage, shouldHandleInvoke, toAgentTurnEvents, } from "@meetopenbot/plugin-sdk";
3
3
  import { runSlackAgent } from "./agent.js";
4
4
  import { formatMissingCredentials, resolveOpenBotChannelId, resolveSlackCredentials, ROUTING_AGENT_ID, SLACK_USER_DISPLAY_NAME, } from "./config.js";
5
5
  import { buildPromptWithSlackContext } from "./context.js";
@@ -197,18 +197,14 @@ export async function* handleSlackInvoke(args) {
197
197
  return;
198
198
  }
199
199
  try {
200
- const reply = await runSlackAgent({
200
+ for await (const item of runSlackAgent({
201
201
  prompt: userMessage,
202
202
  botToken: auth.credentials.botToken,
203
203
  teamId: auth.credentials.teamId,
204
204
  model: auth.credentials.model,
205
- });
206
- yield agentOutput({
207
- agentId: args.agentId,
208
- content: reply,
209
- threadId,
210
- meta: args.event.meta,
211
- });
205
+ })) {
206
+ yield* toAgentTurnEvents(item, args.agentId, threadId, args.event.meta);
207
+ }
212
208
  }
213
209
  catch (error) {
214
210
  const message = error instanceof Error ? error.message : String(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meetopenbot/slack",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "description": "Slack Events API ingress, simple agent replies, and thread delivery for OpenBot",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -19,7 +19,7 @@
19
19
  "dist"
20
20
  ],
21
21
  "dependencies": {
22
- "@meetopenbot/plugin-sdk": "^0.3.0"
22
+ "@meetopenbot/plugin-sdk": "^0.5.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^20.10.1",