@inkeep/agents-work-apps 0.53.12 → 0.53.13

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,11 +1,11 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types3 from "hono/types";
2
+ import * as hono_types5 from "hono/types";
3
3
 
4
4
  //#region src/github/mcp/index.d.ts
5
5
  declare const app: Hono<{
6
6
  Variables: {
7
7
  toolId: string;
8
8
  };
9
- }, hono_types3.BlankSchema, "/">;
9
+ }, hono_types5.BlankSchema, "/">;
10
10
  //#endregion
11
11
  export { app as default };
@@ -76,8 +76,8 @@ declare const ChangedFileSchema: z.ZodObject<{
76
76
  path: z.ZodString;
77
77
  status: z.ZodEnum<{
78
78
  added: "added";
79
- removed: "removed";
80
79
  modified: "modified";
80
+ removed: "removed";
81
81
  renamed: "renamed";
82
82
  copied: "copied";
83
83
  changed: "changed";
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types4 from "hono/types";
2
+ import * as hono_types6 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types6 from "hono/types";
2
+ import * as hono_types3 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/tokenExchange.d.ts
5
- declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types3.BlankEnv, hono_types3.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -225,6 +225,7 @@ async function handleAppMention(params) {
225
225
  agentId: agentConfig.agentId,
226
226
  conversationId: conversationId$1
227
227
  }, "Auto-executing agent with thread context");
228
+ span.end();
228
229
  await executeAgentPublicly({
229
230
  slackClient,
230
231
  channel,
@@ -240,7 +241,6 @@ async function handleAppMention(params) {
240
241
  conversationId: conversationId$1,
241
242
  entryPoint: "app_mention"
242
243
  });
243
- span.end();
244
244
  return;
245
245
  }
246
246
  let queryText = text;
@@ -308,6 +308,7 @@ async function handleAppMention(params) {
308
308
  totalPreExecMs,
309
309
  dispatchDelayMs
310
310
  }, "Executing agent");
311
+ span.end();
311
312
  await executeAgentPublicly({
312
313
  slackClient,
313
314
  channel,
@@ -323,7 +324,6 @@ async function handleAppMention(params) {
323
324
  conversationId,
324
325
  entryPoint: "app_mention"
325
326
  });
326
- span.end();
327
327
  } catch (error) {
328
328
  const errorMsg = error instanceof Error ? error.message : String(error);
329
329
  logger.error({
@@ -352,7 +352,6 @@ async function handleAppMention(params) {
352
352
  }, "Both ephemeral and thread message delivery failed");
353
353
  }
354
354
  }
355
- span.end();
356
355
  }
357
356
  });
358
357
  }
@@ -131,6 +131,7 @@ async function handleDirectMessage(params) {
131
131
  projectId: defaultAgent.projectId,
132
132
  conversationId
133
133
  }, "Executing agent for DM");
134
+ span.end();
134
135
  await executeAgentPublicly({
135
136
  slackClient,
136
137
  channel,
@@ -146,7 +147,6 @@ async function handleDirectMessage(params) {
146
147
  conversationId,
147
148
  entryPoint: "direct_message"
148
149
  });
149
- span.end();
150
150
  } catch (error) {
151
151
  const errorMsg = error instanceof Error ? error.message : String(error);
152
152
  logger.error({
@@ -165,7 +165,6 @@ async function handleDirectMessage(params) {
165
165
  } catch (postError) {
166
166
  logger.error({ error: postError }, "Failed to post DM error message");
167
167
  }
168
- span.end();
169
168
  }
170
169
  });
171
170
  }
@@ -226,6 +226,7 @@ async function streamAgentResponse(params) {
226
226
  let richMessageCount = 0;
227
227
  let richMessageCapWarned = false;
228
228
  const MAX_RICH_MESSAGES = 20;
229
+ span.end();
229
230
  try {
230
231
  let agentCompleted = false;
231
232
  while (true) {
@@ -431,7 +432,6 @@ async function streamAgentResponse(params) {
431
432
  try {
432
433
  await withTimeout(streamer.stop({ blocks: stopBlocks.slice(0, 50) }), CHATSTREAM_OP_TIMEOUT_MS, "streamer.stop");
433
434
  } catch (stopError) {
434
- span.setAttribute(SLACK_SPAN_KEYS.STREAM_FINALIZATION_FAILED, true);
435
435
  logger.warn({
436
436
  stopError,
437
437
  channel,
@@ -450,12 +450,21 @@ async function streamAgentResponse(params) {
450
450
  citationCount: citations.length,
451
451
  richMessageCount
452
452
  }, "Streaming completed");
453
- span.end();
454
453
  return { success: true };
455
454
  } catch (streamError) {
456
455
  clearTimeout(timeoutId);
457
456
  reader?.cancel().catch(() => {});
458
- if (streamError instanceof Error) setSpanWithError(span, streamError);
457
+ const contentAlreadyDelivered = fullText.length > 0;
458
+ tracer.startActiveSpan("slack.stream_error", (errorSpan) => {
459
+ if (streamError instanceof Error) setSpanWithError(errorSpan, streamError);
460
+ errorSpan.setAttribute(SLACK_SPAN_KEYS.TEAM_ID, teamId);
461
+ errorSpan.setAttribute(SLACK_SPAN_KEYS.CHANNEL_ID, channel);
462
+ errorSpan.setAttribute(SLACK_SPAN_KEYS.AGENT_ID, agentId);
463
+ if (conversationId) errorSpan.setAttribute(SLACK_SPAN_KEYS.CONVERSATION_ID, conversationId);
464
+ errorSpan.setAttribute(SLACK_SPAN_KEYS.CONTENT_ALREADY_DELIVERED, contentAlreadyDelivered);
465
+ errorSpan.setAttribute("pending_approval_count", pendingApprovalMessages.length);
466
+ errorSpan.end();
467
+ });
459
468
  for (const { messageTs, toolName } of pendingApprovalMessages) await slackClient.chat.update({
460
469
  channel,
461
470
  ts: messageTs,
@@ -465,8 +474,7 @@ async function streamAgentResponse(params) {
465
474
  error: e,
466
475
  messageTs
467
476
  }, "Failed to expire approval message"));
468
- if (fullText.length > 0) {
469
- span.setAttribute(SLACK_SPAN_KEYS.CONTENT_ALREADY_DELIVERED, true);
477
+ if (contentAlreadyDelivered) {
470
478
  logger.warn({
471
479
  streamError,
472
480
  channel,
@@ -475,7 +483,6 @@ async function streamAgentResponse(params) {
475
483
  }, "Error during Slack streaming after content was already delivered — suppressing user-facing error");
476
484
  if (streamerStarted) await withTimeout(streamer.stop(), CLEANUP_TIMEOUT_MS, "streamer.stop-cleanup").catch((e) => logger.warn({ error: e }, "Failed to stop streamer during error cleanup"));
477
485
  await cleanupThinkingMessage(cleanupParams);
478
- span.end();
479
486
  return { success: true };
480
487
  }
481
488
  if (pendingApprovalMessages.length > 0) {
@@ -486,7 +493,6 @@ async function streamAgentResponse(params) {
486
493
  }).catch((e) => logger.warn({ error: e }, "Failed to send approval expired notification"));
487
494
  if (streamerStarted) await withTimeout(streamer.stop(), CLEANUP_TIMEOUT_MS, "streamer.stop-cleanup").catch((e) => logger.warn({ error: e }, "Failed to stop streamer during error cleanup"));
488
495
  await cleanupThinkingMessage(cleanupParams);
489
- span.end();
490
496
  return { success: true };
491
497
  }
492
498
  logger.error({ streamError }, "Error during Slack streaming");
@@ -506,7 +512,6 @@ async function streamAgentResponse(params) {
506
512
  threadTs
507
513
  }, "Failed to notify user of stream error");
508
514
  }
509
- span.end();
510
515
  return {
511
516
  success: false,
512
517
  errorType,
@@ -1,5 +1,5 @@
1
1
  import { SlackLinkIntent } from "@inkeep/agents-core";
2
- import * as slack_block_builder0 from "slack-block-builder";
2
+ import * as slack_block_builder7 from "slack-block-builder";
3
3
 
4
4
  //#region src/slack/services/link-prompt.d.ts
5
5
  type LinkPromptResult = {
@@ -22,6 +22,6 @@ interface ResolveLinkActionParams {
22
22
  intent?: SlackLinkIntent;
23
23
  }
24
24
  declare function resolveUnlinkedUserAction(params: ResolveLinkActionParams): Promise<LinkPromptResult>;
25
- declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder0.SlackMessageDto>;
25
+ declare function buildLinkPromptMessage(result: LinkPromptResult): Readonly<slack_block_builder7.SlackMessageDto>;
26
26
  //#endregion
27
27
  export { LinkPromptResult, ResolveLinkActionParams, buildLinkPromptMessage, resolveUnlinkedUserAction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.53.12",
3
+ "version": "0.53.13",
4
4
  "description": "First party integrations for Inkeep Agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -33,7 +33,7 @@
33
33
  "jose": "^6.1.0",
34
34
  "minimatch": "^10.2.1",
35
35
  "slack-block-builder": "^2.8.0",
36
- "@inkeep/agents-core": "0.53.12"
36
+ "@inkeep/agents-core": "0.53.13"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@hono/zod-openapi": "^1.1.5",