@sentry/junior 0.107.1 → 0.109.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.
Files changed (68) hide show
  1. package/dist/{agent-hooks-ICPIJAFY.js → agent-hooks-FHHVLNPA.js} +12 -12
  2. package/dist/api/conversations/events.d.ts +1 -1
  3. package/dist/api/conversations/list.d.ts +1 -0
  4. package/dist/api/conversations/schema.d.ts +57 -6
  5. package/dist/api/schema.js +1 -1
  6. package/dist/api.js +116 -27
  7. package/dist/app.d.ts +1 -0
  8. package/dist/app.js +1741 -458
  9. package/dist/{catalog-runtime-FOFNPR3P.js → catalog-runtime-DMGJSLV2.js} +6 -4
  10. package/dist/chat/conversations/history.d.ts +16 -5
  11. package/dist/chat/conversations/message-projection.d.ts +3 -5
  12. package/dist/chat/conversations/sql/store.d.ts +0 -7
  13. package/dist/chat/log-context.d.ts +40 -0
  14. package/dist/chat/logging.d.ts +3 -26
  15. package/dist/chat/resource-events/store.d.ts +6 -0
  16. package/dist/chat/runtime/slack-resume.d.ts +2 -2
  17. package/dist/chat/runtime/slack-runtime.d.ts +3 -0
  18. package/dist/chat/services/turn-session-record.d.ts +0 -2
  19. package/dist/chat/slack/reply.d.ts +7 -19
  20. package/dist/chat/state/conversation.d.ts +1 -0
  21. package/dist/chat/task-execution/slack-work.d.ts +237 -10
  22. package/dist/chat/tool-support/turn-deadline-result.d.ts +3 -0
  23. package/dist/chunk-3SXUV423.js +10 -0
  24. package/dist/{chunk-YFQ7CQDE.js → chunk-72OMGPDS.js} +1017 -39
  25. package/dist/{chunk-2XXEKR44.js → chunk-7Q6WCISF.js} +1 -1
  26. package/dist/{chunk-NVOTGWYX.js → chunk-FENLIFJD.js} +97 -601
  27. package/dist/{chunk-IGHMVDWI.js → chunk-FWJRXN4F.js} +3 -3
  28. package/dist/{chunk-PUAMO4PI.js → chunk-HHVY4SMP.js} +41 -7
  29. package/dist/{chunk-SPUAJVVH.js → chunk-HO5NT6OE.js} +5 -7
  30. package/dist/{chunk-O24R4DCK.js → chunk-ISMWX44P.js} +93 -55
  31. package/dist/{chunk-7FBGKXPE.js → chunk-IVVGFRQQ.js} +5 -0
  32. package/dist/{chunk-EDLNHZH3.js → chunk-IXKSQGIO.js} +226 -191
  33. package/dist/{chunk-SS67LUOK.js → chunk-JNAVF45E.js} +6 -7
  34. package/dist/{chunk-DY7TRYB5.js → chunk-MGUMR35T.js} +1 -1
  35. package/dist/{chunk-CQ7KSO2B.js → chunk-MXW4GL53.js} +11 -15
  36. package/dist/{chunk-RT5BUHR5.js → chunk-O3JMSZLI.js} +1 -1
  37. package/dist/chunk-OCD3OZRK.js +125 -0
  38. package/dist/{chunk-B2Z2H66D.js → chunk-OUHNWH46.js} +60 -5
  39. package/dist/{chunk-VIXFG2VC.js → chunk-PLB7MRCQ.js} +1 -2
  40. package/dist/{chunk-RMVOAJRL.js → chunk-QY636HZU.js} +114 -12
  41. package/dist/{chunk-VH6KWKG2.js → chunk-RGX4V75M.js} +3 -3
  42. package/dist/{chunk-B7PUBQQM.js → chunk-SYAQIR5Z.js} +1 -1
  43. package/dist/chunk-TMBRFULF.js +471 -0
  44. package/dist/{chunk-YIPD3L6L.js → chunk-TT6GMXNA.js} +8 -10
  45. package/dist/{chunk-YT72TOEK.js → chunk-WHMOBKT7.js} +2 -2
  46. package/dist/cli/chat.js +23 -23
  47. package/dist/cli/check.js +8 -6
  48. package/dist/cli/plugins.js +16 -16
  49. package/dist/cli/snapshot-warmup.js +10 -9
  50. package/dist/cli/upgrade.js +314 -3505
  51. package/dist/db/db.d.ts +1 -1
  52. package/dist/{db-DIGO4TGW.js → db-V3NU72O2.js} +8 -6
  53. package/dist/instrumentation.js +3 -2
  54. package/dist/nitro.js +5 -4
  55. package/dist/{runner-ACR2HAIC.js → runner-JYBCQBLK.js} +17 -20
  56. package/dist/{skills-ITNHBARB.js → skills-U6MDAST7.js} +7 -5
  57. package/dist/{validation-AGQ46ZGV.js → validation-72N3JVRU.js} +7 -5
  58. package/dist/version.d.ts +2 -0
  59. package/dist/version.js +7 -0
  60. package/migrations/0006_drop_legacy_conversation_messages.sql +1 -0
  61. package/migrations/README.md +12 -9
  62. package/migrations/meta/0006_snapshot.json +948 -0
  63. package/migrations/meta/_journal.json +7 -0
  64. package/package.json +11 -7
  65. package/dist/chunk-4YF7Z6IA.js +0 -1061
  66. package/dist/chunk-AUUOHQAT.js +0 -115
  67. package/dist/chunk-G3E7SCME.js +0 -28
  68. package/dist/chunk-YNP2ATQX.js +0 -1282
@@ -1,13 +1,15 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-YIPD3L6L.js";
4
- import "./chunk-VIXFG2VC.js";
5
- import "./chunk-O24R4DCK.js";
3
+ } from "./chunk-3SXUV423.js";
4
+ import "./chunk-TT6GMXNA.js";
5
+ import "./chunk-PLB7MRCQ.js";
6
+ import "./chunk-ISMWX44P.js";
6
7
  import "./chunk-OB42YVAE.js";
7
8
  import "./chunk-6GWA276C.js";
8
9
  import "./chunk-B3IT5END.js";
9
- import "./chunk-7FBGKXPE.js";
10
10
  import "./chunk-3V7OFJZC.js";
11
+ import "./chunk-IVVGFRQQ.js";
12
+ import "./chunk-OCD3OZRK.js";
11
13
  import "./chunk-MLKGABMK.js";
12
14
  export {
13
15
  pluginCatalogRuntime
@@ -596,6 +596,20 @@ export declare const conversationEventSchema: z.ZodUnion<readonly [z.ZodObject<{
596
596
  }, z.core.$strict>]>;
597
597
  /** One versioned event read from the durable conversation log. */
598
598
  export type ConversationEvent = z.output<typeof conversationEventSchema>;
599
+ /** A decoded message-summary event and its readable history boundary. */
600
+ export type MessagesSummarizedEvent = Omit<Extract<ConversationEvent, {
601
+ schemaVersion: 1;
602
+ }>, "data"> & {
603
+ data: Extract<ConversationEventData, {
604
+ type: "messages_summarized";
605
+ }>;
606
+ };
607
+ /** Projection-ready message events paired with their authoritative boundary. */
608
+ export interface MessageHistory {
609
+ events: ConversationEvent[];
610
+ compaction: MessagesSummarizedEvent | undefined;
611
+ historyFromSeq: number;
612
+ }
599
613
  declare const storedConversationEventSchema: z.ZodObject<{
600
614
  schemaVersion: z.ZodNumber;
601
615
  seq: z.ZodNumber;
@@ -746,11 +760,8 @@ export interface ConversationEventStore {
746
760
  loadCurrentHistory(conversationId: string): Promise<ConversationEvent[]>;
747
761
  /** Events in the history version containing `seq`, when it exists. */
748
762
  loadHistoryContaining(conversationId: string, seq: number, throughSeq?: number): Promise<ConversationEvent[] | undefined>;
749
- /** Current source/destination messages and their latest summary snapshot. */
750
- loadMessageHistory(conversationId: string): Promise<{
751
- events: ConversationEvent[];
752
- compaction: ConversationEvent | undefined;
753
- }>;
763
+ /** Projection-ready message suffix, summary snapshot, and readable boundary. */
764
+ loadMessageHistory(conversationId: string): Promise<MessageHistory>;
754
765
  /** All events across every history version in `seq` order. */
755
766
  loadHistory(conversationId: string): Promise<ConversationEvent[]>;
756
767
  }
@@ -1,6 +1,4 @@
1
- import type { ConversationEvent } from "./history";
1
+ import type { MessageHistory } from "./history";
2
2
  import type { ConversationMessage } from "@/chat/state/conversation";
3
- /** Reduce canonical message facts into destination-facing history. */
4
- export declare function projectConversationMessages(events: ConversationEvent[], options?: {
5
- historyFromSeq?: number;
6
- }): ConversationMessage[];
3
+ /** Reduce a boundary-bearing message-history suffix into destination history. */
4
+ export declare function projectConversationMessages(history: Pick<MessageHistory, "events" | "historyFromSeq">): ConversationMessage[];
@@ -38,13 +38,6 @@ export declare class SqlStore implements ConversationStore {
38
38
  updatedAtMs: number;
39
39
  visibility?: ConversationPrivacy;
40
40
  }): Promise<void>;
41
- /** Copy one conversation record and retained metrics into SQL during backfill. */
42
- backfillConversation(sourceConversation: Conversation, metrics?: {
43
- durationMs: number;
44
- executionDurationMs: number;
45
- executionUsage?: AgentTurnUsage;
46
- usage?: AgentTurnUsage;
47
- }): Promise<void>;
48
41
  listByActivity(args?: {
49
42
  limit?: number;
50
43
  offset?: number;
@@ -0,0 +1,40 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+ export type LogAttributeValue = string | number | boolean | string[];
3
+ export type LogAttributes = Record<string, LogAttributeValue>;
4
+ /** Provider-neutral correlation data inherited by logs and spans in an operation. */
5
+ export interface LogContext {
6
+ conversationId?: string;
7
+ platform?: string;
8
+ requestId?: string;
9
+ messageConversationId?: string;
10
+ destinationName?: string;
11
+ userId?: string;
12
+ userName?: string;
13
+ userEmail?: string;
14
+ runId?: string;
15
+ actorType?: string;
16
+ actorId?: string;
17
+ assistantUserName?: string;
18
+ modelId?: string;
19
+ skillName?: string;
20
+ httpMethod?: string;
21
+ httpPath?: string;
22
+ urlFull?: string;
23
+ userAgent?: string;
24
+ }
25
+ /** Async attribute domain consumed directly by LogTape. */
26
+ export declare const logContextStorage: AsyncLocalStorage<LogAttributes>;
27
+ /** Convert provider-neutral domain context to stable telemetry attributes. */
28
+ export declare function logContextToAttributes(context: LogContext): LogAttributes;
29
+ /** Run an operation with merged context, restoring its parent on completion. */
30
+ export declare function runWithLogContext<T>(context: LogContext, attributes: LogAttributes, callback: () => T): T;
31
+ /** Run an operation with raw attributes, restoring its parent on completion. */
32
+ export declare function runWithLogAttributes<T>(attributes: LogAttributes, callback: () => T): T;
33
+ /** Merge raw attributes into the current scoped operation. */
34
+ export declare function updateLogAttributes(attributes: LogAttributes): void;
35
+ /** Merge context and attributes into the current scoped operation. */
36
+ export declare function updateLogContext(context: LogContext, attributes: LogAttributes): void;
37
+ /** Read the typed context bound to the current operation. */
38
+ export declare function getBoundLogContext(): LogContext;
39
+ /** Read the attributes bound to the current operation. */
40
+ export declare function getBoundLogAttributes(): LogAttributes;
@@ -1,9 +1,8 @@
1
1
  import type { Logger as ChatSdkLogger } from "chat";
2
+ import { type LogAttributes, type LogContext } from "@/chat/log-context";
2
3
  import * as Sentry from "@/chat/sentry";
3
4
  import type { AgentTurnUsage } from "@/chat/usage";
4
- type Primitive = string | number | boolean;
5
- type AttributeValue = Primitive | string[];
6
- export type LogAttributes = Record<string, AttributeValue>;
5
+ export type { LogAttributes, LogContext } from "@/chat/log-context";
7
6
  export type LogLevel = "debug" | "info" | "warn" | "error";
8
7
  export interface EmittedLogRecord {
9
8
  attributes: LogAttributes;
@@ -11,26 +10,6 @@ export interface EmittedLogRecord {
11
10
  eventName: string;
12
11
  level: LogLevel;
13
12
  }
14
- export interface LogContext {
15
- conversationId?: string;
16
- platform?: string;
17
- requestId?: string;
18
- slackThreadId?: string;
19
- slackUserId?: string;
20
- slackUserName?: string;
21
- slackUserEmail?: string;
22
- slackChannelId?: string;
23
- runId?: string;
24
- actorType?: string;
25
- actorId?: string;
26
- assistantUserName?: string;
27
- modelId?: string;
28
- skillName?: string;
29
- httpMethod?: string;
30
- httpPath?: string;
31
- urlFull?: string;
32
- userAgent?: string;
33
- }
34
13
  export type TracePropagationHeaders = Partial<Record<"baggage" | "sentry-trace" | "traceparent", string>>;
35
14
  interface SentryUserIdentity {
36
15
  id: string | number;
@@ -51,7 +30,6 @@ export declare const log: {
51
30
  /** Create a Chat SDK logger that routes records through Junior's logging backend. */
52
31
  export declare function createChatSdkLogger(): ChatSdkLogger;
53
32
  export declare function withLogContext<T>(context: LogContext, callback: () => Promise<T>): Promise<T>;
54
- export declare function setLogContext(context: LogContext): void;
55
33
  export declare function getLogContextAttributes(): LogAttributes;
56
34
  /** Return inherited log context filtered to attributes valid for the span operation. */
57
35
  export declare function getLogContextAttributesForSpan(op: string): LogAttributes;
@@ -75,7 +53,7 @@ export declare function logWarn(eventName: string, context?: LogContext, attribu
75
53
  export declare function logError(eventName: string, context?: LogContext, attributes?: Record<string, unknown>, body?: string): void;
76
54
  /** Log an error with exception capture; returns the Sentry event ID if available. */
77
55
  export declare function logException(error: unknown, eventName: string, context?: LogContext, attributes?: Record<string, unknown>, body?: string): string | undefined;
78
- /** Set log context and Sentry scope metadata for the current request. */
56
+ /** Add context to the current operation and Sentry scope. */
79
57
  export declare function setTags(context?: LogContext): void;
80
58
  /** Create a LogContext from an incoming HTTP request. */
81
59
  export declare function createRequestContext(request: Request, context?: Partial<LogContext>): LogContext;
@@ -107,4 +85,3 @@ export declare function serializeGenAiAttribute(value: unknown, maxChars?: numbe
107
85
  export declare function extractGenAiUsageSummary(...sources: unknown[]): AgentTurnUsage;
108
86
  /** Extract GenAI token and estimated USD cost attributes for tracing. */
109
87
  export declare function extractGenAiUsageAttributes(...sources: unknown[]): Partial<Record<"gen_ai.usage.input_tokens" | "gen_ai.usage.output_tokens" | "gen_ai.usage.cache_read.input_tokens" | "gen_ai.usage.cache_creation.input_tokens" | "gen_ai.usage.reasoning.output_tokens", number> & Partial<Record<"app.cost.input_usd" | "app.cost.output_usd" | "app.cost.cache_read_usd" | "app.cost.cache_write_usd" | "app.cost.total_usd", number>>>;
110
- export {};
@@ -57,6 +57,12 @@ export declare function cancelResourceEventSubscription(input: {
57
57
  nowMs?: number;
58
58
  state?: StateAdapter;
59
59
  }): Promise<ResourceEventSubscription | undefined>;
60
+ /** Cancel every active resource event subscription bound to one conversation. */
61
+ export declare function cancelSubscriptions(input: {
62
+ conversationId: string;
63
+ nowMs?: number;
64
+ state?: StateAdapter;
65
+ }): Promise<void>;
60
66
  /** Find active subscriptions interested in a normalized provider event. */
61
67
  export declare function findMatchingResourceEventSubscriptions(input: {
62
68
  eventType: string;
@@ -26,7 +26,7 @@ interface ResumeSlackTurnArgs {
26
26
  conversationId: string;
27
27
  sessionId: string;
28
28
  }) => Promise<void>;
29
- onSuccess?: (reply: AgentRunResult) => Promise<void>;
29
+ commitResult?: (result: AgentRunResult) => Promise<void>;
30
30
  onFailure?: (error: unknown) => Promise<void>;
31
31
  onAuthPause?: (pause: {
32
32
  providerDisplayName: string;
@@ -45,7 +45,7 @@ interface ResumePreparedTurn {
45
45
  inputMessageIds?: string[];
46
46
  initialStatus?: AssistantStatusSpec;
47
47
  replyContext: ResumeReplyContext;
48
- onSuccess?: (reply: AgentRunResult) => Promise<void>;
48
+ commitResult?: (result: AgentRunResult) => Promise<void>;
49
49
  onFailure?: (error: unknown) => Promise<void>;
50
50
  onAuthPause?: (pause: {
51
51
  providerDisplayName: string;
@@ -43,6 +43,9 @@ export interface SlackTurnOptions extends ReplyHooks {
43
43
  }
44
44
  export interface SlackTurnRuntimeDependencies<TPreparedState> {
45
45
  assistantUserName: string;
46
+ cancelEventSubscriptions: (input: {
47
+ conversationId: string;
48
+ }) => Promise<void>;
46
49
  getChannelId: (thread: Thread, message: Message) => string | undefined;
47
50
  getPreparedConversationContext: (preparedState: TPreparedState) => string | undefined;
48
51
  getThreadId: (thread: Thread, message: Message) => string | undefined;
@@ -64,7 +64,6 @@ export declare function persistCompletedSessionRecord(args: {
64
64
  sliceId?: number;
65
65
  allMessages: PiMessage[];
66
66
  loadedSkillNames?: string[];
67
- logContext: SessionRecordLogContext;
68
67
  modelId: string;
69
68
  actor?: Actor;
70
69
  reasoningLevel?: string;
@@ -79,7 +78,6 @@ export declare function completeDeliveredTurn(args: {
79
78
  destinationVisibility?: ConversationPrivacy;
80
79
  durationMs?: number;
81
80
  loadedSkillNames?: string[];
82
- logContext: SessionRecordLogContext;
83
81
  messages: PiMessage[];
84
82
  modelId: string;
85
83
  actor?: Actor;
@@ -1,24 +1,12 @@
1
- import { type SlackReplyFooter } from "@/chat/slack/footer";
2
- export type PlannedSlackReplyStage = "thread_reply" | "thread_reply_continuation";
3
- export interface PlannedSlackReplyPost {
4
- stage: PlannedSlackReplyStage;
5
- text: string;
6
- }
7
- /** Plan the Slack posts for one completed assistant message. */
8
- export declare function planSlackAssistantMessagePosts(text: string): PlannedSlackReplyPost[];
9
1
  /**
10
- * Deliver planned Slack reply posts over raw Slack Web API calls for resume and
11
- * callback handlers that do not have a Chat SDK thread object.
2
+ * Send one destination-visible Slack reply.
3
+ *
4
+ * Chunks oversized text, builds the conversation footer from
5
+ * `conversationId`, and posts through the shared Slack outbound boundary.
12
6
  */
13
- export declare function postSlackApiReplyPosts(args: {
14
- beforePost?: () => Promise<void>;
15
- footer?: SlackReplyFooter;
7
+ export declare function sendSlackReply(args: {
16
8
  channelId: string;
17
- onPostError?: (context: {
18
- error: unknown;
19
- messageTs?: string;
20
- stage: PlannedSlackReplyStage;
21
- }) => Promise<void> | void;
9
+ conversationId: string;
10
+ text: string;
22
11
  threadTs?: string;
23
- posts: PlannedSlackReplyPost[];
24
12
  }): Promise<string | undefined>;
@@ -7,6 +7,7 @@ export interface ConversationAuthor {
7
7
  }
8
8
  export interface ConversationMessageMeta {
9
9
  attachmentCount?: number;
10
+ eventType?: string;
10
11
  explicitMention?: boolean;
11
12
  imageAttachmentCount?: number;
12
13
  imageFileIds?: string[];
@@ -1,20 +1,247 @@
1
1
  import type { SlackAdapter } from "@chat-adapter/slack";
2
- import { Message, ThreadImpl, type SerializedMessage, type SerializedThread, type StateAdapter } from "chat";
2
+ import { Message, ThreadImpl, type StateAdapter } from "chat";
3
+ import { z } from "zod";
3
4
  import type { SlackTurnOptions } from "@/chat/runtime/slack-runtime";
4
5
  import type { ConversationStore } from "@/chat/conversations/store";
5
6
  import type { InboundMessage } from "@/chat/task-execution/store";
6
7
  import type { ConversationWorkerContext, ConversationWorkerResult } from "@/chat/task-execution/worker";
7
8
  import { type SlackInstallationContext } from "@/chat/slack/adapter-context";
8
9
  import { type SlackActorProfile } from "@/chat/actor";
9
- export type SlackConversationRoute = "mention" | "subscribed";
10
- export interface SlackConversationMessageMetadata {
11
- [key: string]: unknown;
12
- installation?: SlackInstallationContext;
13
- message: SerializedMessage;
14
- platform: "slack";
15
- route: SlackConversationRoute;
16
- thread: SerializedThread;
17
- }
10
+ declare const slackConversationRouteSchema: z.ZodEnum<{
11
+ mention: "mention";
12
+ subscribed: "subscribed";
13
+ }>;
14
+ export type SlackConversationRoute = z.output<typeof slackConversationRouteSchema>;
15
+ declare const slackConversationMessageMetadataSchema: z.ZodUnion<readonly [z.ZodObject<{
16
+ installation: z.ZodOptional<z.ZodObject<{
17
+ enterpriseId: z.ZodOptional<z.ZodString>;
18
+ isEnterpriseInstall: z.ZodOptional<z.ZodBoolean>;
19
+ teamId: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strict>>;
21
+ message: z.ZodObject<{
22
+ _type: z.ZodLiteral<"chat:Message">;
23
+ attachments: z.ZodArray<z.ZodObject<{
24
+ type: z.ZodEnum<{
25
+ image: "image";
26
+ file: "file";
27
+ audio: "audio";
28
+ video: "video";
29
+ }>;
30
+ url: z.ZodOptional<z.ZodString>;
31
+ name: z.ZodOptional<z.ZodString>;
32
+ mimeType: z.ZodOptional<z.ZodString>;
33
+ size: z.ZodOptional<z.ZodNumber>;
34
+ width: z.ZodOptional<z.ZodNumber>;
35
+ height: z.ZodOptional<z.ZodNumber>;
36
+ fetchMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
37
+ }, z.core.$strict>>;
38
+ author: z.ZodObject<{
39
+ userId: z.ZodString;
40
+ userName: z.ZodString;
41
+ fullName: z.ZodString;
42
+ isBot: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"unknown">]>;
43
+ isMe: z.ZodBoolean;
44
+ }, z.core.$strict>;
45
+ formatted: z.ZodCustom<import("chat").Root, import("chat").Root>;
46
+ id: z.ZodString;
47
+ isMention: z.ZodOptional<z.ZodBoolean>;
48
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
49
+ url: z.ZodString;
50
+ title: z.ZodOptional<z.ZodString>;
51
+ description: z.ZodOptional<z.ZodString>;
52
+ imageUrl: z.ZodOptional<z.ZodString>;
53
+ siteName: z.ZodOptional<z.ZodString>;
54
+ }, z.core.$strict>>>;
55
+ metadata: z.ZodObject<{
56
+ dateSent: z.ZodISODateTime;
57
+ edited: z.ZodBoolean;
58
+ editedAt: z.ZodOptional<z.ZodISODateTime>;
59
+ }, z.core.$strict>;
60
+ raw: z.ZodUnknown;
61
+ text: z.ZodString;
62
+ threadId: z.ZodString;
63
+ }, z.core.$strict>;
64
+ platform: z.ZodLiteral<"slack">;
65
+ route: z.ZodEnum<{
66
+ mention: "mention";
67
+ subscribed: "subscribed";
68
+ }>;
69
+ thread: z.ZodObject<{
70
+ _type: z.ZodLiteral<"chat:Thread">;
71
+ adapterName: z.ZodLiteral<"slack">;
72
+ channelId: z.ZodString;
73
+ channelVisibility: z.ZodOptional<z.ZodEnum<{
74
+ unknown: "unknown";
75
+ private: "private";
76
+ external: "external";
77
+ workspace: "workspace";
78
+ }>>;
79
+ currentMessage: z.ZodOptional<z.ZodObject<{
80
+ _type: z.ZodLiteral<"chat:Message">;
81
+ attachments: z.ZodArray<z.ZodObject<{
82
+ type: z.ZodEnum<{
83
+ image: "image";
84
+ file: "file";
85
+ audio: "audio";
86
+ video: "video";
87
+ }>;
88
+ url: z.ZodOptional<z.ZodString>;
89
+ name: z.ZodOptional<z.ZodString>;
90
+ mimeType: z.ZodOptional<z.ZodString>;
91
+ size: z.ZodOptional<z.ZodNumber>;
92
+ width: z.ZodOptional<z.ZodNumber>;
93
+ height: z.ZodOptional<z.ZodNumber>;
94
+ fetchMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
95
+ }, z.core.$strict>>;
96
+ author: z.ZodObject<{
97
+ userId: z.ZodString;
98
+ userName: z.ZodString;
99
+ fullName: z.ZodString;
100
+ isBot: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"unknown">]>;
101
+ isMe: z.ZodBoolean;
102
+ }, z.core.$strict>;
103
+ formatted: z.ZodCustom<import("chat").Root, import("chat").Root>;
104
+ id: z.ZodString;
105
+ isMention: z.ZodOptional<z.ZodBoolean>;
106
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
107
+ url: z.ZodString;
108
+ title: z.ZodOptional<z.ZodString>;
109
+ description: z.ZodOptional<z.ZodString>;
110
+ imageUrl: z.ZodOptional<z.ZodString>;
111
+ siteName: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strict>>>;
113
+ metadata: z.ZodObject<{
114
+ dateSent: z.ZodISODateTime;
115
+ edited: z.ZodBoolean;
116
+ editedAt: z.ZodOptional<z.ZodISODateTime>;
117
+ }, z.core.$strict>;
118
+ raw: z.ZodUnknown;
119
+ text: z.ZodString;
120
+ threadId: z.ZodString;
121
+ }, z.core.$strict>>;
122
+ id: z.ZodString;
123
+ isDM: z.ZodBoolean;
124
+ }, z.core.$strict>;
125
+ }, z.core.$strict>, z.ZodObject<{
126
+ installation: z.ZodOptional<z.ZodObject<{
127
+ enterpriseId: z.ZodOptional<z.ZodString>;
128
+ isEnterpriseInstall: z.ZodOptional<z.ZodBoolean>;
129
+ teamId: z.ZodOptional<z.ZodString>;
130
+ }, z.core.$strict>>;
131
+ message: z.ZodObject<{
132
+ _type: z.ZodLiteral<"chat:Message">;
133
+ attachments: z.ZodArray<z.ZodObject<{
134
+ type: z.ZodEnum<{
135
+ image: "image";
136
+ file: "file";
137
+ audio: "audio";
138
+ video: "video";
139
+ }>;
140
+ url: z.ZodOptional<z.ZodString>;
141
+ name: z.ZodOptional<z.ZodString>;
142
+ mimeType: z.ZodOptional<z.ZodString>;
143
+ size: z.ZodOptional<z.ZodNumber>;
144
+ width: z.ZodOptional<z.ZodNumber>;
145
+ height: z.ZodOptional<z.ZodNumber>;
146
+ fetchMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
147
+ }, z.core.$strict>>;
148
+ author: z.ZodObject<{
149
+ userId: z.ZodString;
150
+ userName: z.ZodString;
151
+ fullName: z.ZodString;
152
+ isBot: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"unknown">]>;
153
+ isMe: z.ZodBoolean;
154
+ }, z.core.$strict>;
155
+ formatted: z.ZodCustom<import("chat").Root, import("chat").Root>;
156
+ id: z.ZodString;
157
+ isMention: z.ZodOptional<z.ZodBoolean>;
158
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
159
+ url: z.ZodString;
160
+ title: z.ZodOptional<z.ZodString>;
161
+ description: z.ZodOptional<z.ZodString>;
162
+ imageUrl: z.ZodOptional<z.ZodString>;
163
+ siteName: z.ZodOptional<z.ZodString>;
164
+ }, z.core.$strict>>>;
165
+ metadata: z.ZodObject<{
166
+ dateSent: z.ZodISODateTime;
167
+ edited: z.ZodBoolean;
168
+ editedAt: z.ZodOptional<z.ZodISODateTime>;
169
+ }, z.core.$strict>;
170
+ raw: z.ZodUnknown;
171
+ text: z.ZodString;
172
+ threadId: z.ZodString;
173
+ }, z.core.$strict>;
174
+ platform: z.ZodLiteral<"slack">;
175
+ route: z.ZodEnum<{
176
+ mention: "mention";
177
+ subscribed: "subscribed";
178
+ }>;
179
+ thread: z.ZodObject<{
180
+ _type: z.ZodLiteral<"chat:Thread">;
181
+ adapterName: z.ZodLiteral<"slack">;
182
+ channelId: z.ZodString;
183
+ channelVisibility: z.ZodOptional<z.ZodEnum<{
184
+ unknown: "unknown";
185
+ private: "private";
186
+ external: "external";
187
+ workspace: "workspace";
188
+ }>>;
189
+ currentMessage: z.ZodOptional<z.ZodObject<{
190
+ _type: z.ZodLiteral<"chat:Message">;
191
+ attachments: z.ZodArray<z.ZodObject<{
192
+ type: z.ZodEnum<{
193
+ image: "image";
194
+ file: "file";
195
+ audio: "audio";
196
+ video: "video";
197
+ }>;
198
+ url: z.ZodOptional<z.ZodString>;
199
+ name: z.ZodOptional<z.ZodString>;
200
+ mimeType: z.ZodOptional<z.ZodString>;
201
+ size: z.ZodOptional<z.ZodNumber>;
202
+ width: z.ZodOptional<z.ZodNumber>;
203
+ height: z.ZodOptional<z.ZodNumber>;
204
+ fetchMetadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
205
+ }, z.core.$strict>>;
206
+ author: z.ZodObject<{
207
+ userId: z.ZodString;
208
+ userName: z.ZodString;
209
+ fullName: z.ZodString;
210
+ isBot: z.ZodUnion<readonly [z.ZodBoolean, z.ZodLiteral<"unknown">]>;
211
+ isMe: z.ZodBoolean;
212
+ }, z.core.$strict>;
213
+ formatted: z.ZodCustom<import("chat").Root, import("chat").Root>;
214
+ id: z.ZodString;
215
+ isMention: z.ZodOptional<z.ZodBoolean>;
216
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
217
+ url: z.ZodString;
218
+ title: z.ZodOptional<z.ZodString>;
219
+ description: z.ZodOptional<z.ZodString>;
220
+ imageUrl: z.ZodOptional<z.ZodString>;
221
+ siteName: z.ZodOptional<z.ZodString>;
222
+ }, z.core.$strict>>>;
223
+ metadata: z.ZodObject<{
224
+ dateSent: z.ZodISODateTime;
225
+ edited: z.ZodBoolean;
226
+ editedAt: z.ZodOptional<z.ZodISODateTime>;
227
+ }, z.core.$strict>;
228
+ raw: z.ZodUnknown;
229
+ text: z.ZodString;
230
+ threadId: z.ZodString;
231
+ }, z.core.$strict>>;
232
+ id: z.ZodString;
233
+ isDM: z.ZodBoolean;
234
+ }, z.core.$strict>;
235
+ kind: z.ZodLiteral<"resource_event">;
236
+ resourceEvent: z.ZodObject<{
237
+ eventKey: z.ZodString;
238
+ eventType: z.ZodString;
239
+ provider: z.ZodString;
240
+ resourceRef: z.ZodString;
241
+ subscriptionId: z.ZodString;
242
+ }, z.core.$strict>;
243
+ }, z.core.$strict>]>;
244
+ export type SlackConversationMessageMetadata = z.output<typeof slackConversationMessageMetadataSchema>;
18
245
  type SlackInboxTurnOptions = SlackTurnOptions & {
19
246
  ack: () => Promise<void>;
20
247
  isFinalAttempt: boolean;
@@ -0,0 +1,3 @@
1
+ import type { AfterToolCallResult, AgentToolResult } from "@earendil-works/pi-agent-core";
2
+ /** Mark an unknown tool outcome as caused by an internal execution-slice deadline. */
3
+ export declare function annotateTurnDeadlineToolResult(result: AgentToolResult<unknown>): AfterToolCallResult | undefined;
@@ -0,0 +1,10 @@
1
+ import {
2
+ createPluginCatalogRuntime
3
+ } from "./chunk-TT6GMXNA.js";
4
+
5
+ // src/chat/plugins/catalog-runtime.ts
6
+ var pluginCatalogRuntime = createPluginCatalogRuntime();
7
+
8
+ export {
9
+ pluginCatalogRuntime
10
+ };