@sentry/junior 0.137.0 → 0.139.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 (103) hide show
  1. package/dist/{agent-hooks-MZOKEP3J.js → agent-hooks-MJXMD7JP.js} +11 -9
  2. package/dist/api/schema/task.d.ts +100 -1
  3. package/dist/api/schema.d.ts +2 -2
  4. package/dist/api/schema.js +9 -1
  5. package/dist/api.js +202 -55
  6. package/dist/app.d.ts +7 -0
  7. package/dist/app.js +601 -1356
  8. package/dist/{catalog-runtime-MD66YLFV.js → catalog-runtime-GCCFYPIK.js} +6 -6
  9. package/dist/chat/agent/request.d.ts +44 -4
  10. package/dist/chat/agent-dispatch/heartbeat.d.ts +5 -0
  11. package/dist/chat/agent-dispatch/types.d.ts +1 -1
  12. package/dist/chat/agent-invocations/errors.d.ts +8 -0
  13. package/dist/chat/agent-invocations/spawn.d.ts +12 -0
  14. package/dist/chat/agent-invocations/store.d.ts +44 -0
  15. package/dist/chat/agent-invocations/types.d.ts +449 -0
  16. package/dist/chat/agent-invocations/work.d.ts +31 -0
  17. package/dist/chat/config.d.ts +1 -0
  18. package/dist/chat/conversations/sql/store.d.ts +8 -0
  19. package/dist/chat/conversations/store.d.ts +7 -0
  20. package/dist/chat/credentials/context.d.ts +14 -0
  21. package/dist/chat/experimental.d.ts +16 -0
  22. package/dist/chat/resource-events/actor.d.ts +23 -0
  23. package/dist/chat/runtime/agent-runner.d.ts +2 -1
  24. package/dist/chat/services/auth-pause.d.ts +0 -1
  25. package/dist/chat/services/mcp-auth-orchestration.d.ts +3 -2
  26. package/dist/chat/services/plugin-auth-orchestration.d.ts +3 -2
  27. package/dist/chat/state/turn-session.d.ts +1 -5
  28. package/dist/chat/task-execution/state.d.ts +23 -11
  29. package/dist/chat/task-execution/store.d.ts +20 -11
  30. package/dist/chat/task-execution/worker.d.ts +2 -2
  31. package/dist/chat/tasks/execution-stats.d.ts +34 -3
  32. package/dist/chat/tasks/read.d.ts +3 -1
  33. package/dist/chat/tools/runtime/spawn-agent.d.ts +31 -0
  34. package/dist/chat/tools/types.d.ts +2 -0
  35. package/dist/{chunk-T6Z5S6PQ.js → chunk-2ECYPYKP.js} +1 -1
  36. package/dist/chunk-3T2JAGRH.js +115 -0
  37. package/dist/chunk-3Y47VMHV.js +6 -0
  38. package/dist/chunk-4V4QIYJH.js +41 -0
  39. package/dist/{chunk-SYCX4DOK.js → chunk-5GSZWRE2.js} +434 -65
  40. package/dist/chunk-5IDFPCON.js +46 -0
  41. package/dist/{chunk-36EG34YI.js → chunk-6OHTDR4F.js} +1 -1
  42. package/dist/chunk-6SU2DT27.js +441 -0
  43. package/dist/{chunk-UG6ZYPBI.js → chunk-75I3UBIL.js} +73 -60
  44. package/dist/chunk-AEQISMMU.js +711 -0
  45. package/dist/{chunk-5PNJMOY5.js → chunk-C2N6MNO4.js} +9 -2
  46. package/dist/{chunk-BZAMASJP.js → chunk-CXH25EL4.js} +2 -2
  47. package/dist/{chunk-K2NCQJKH.js → chunk-DW4PMHNW.js} +3 -3
  48. package/dist/chunk-EM225ITJ.js +56 -0
  49. package/dist/{chunk-UOXATPSI.js → chunk-G52UXKGO.js} +7 -5
  50. package/dist/chunk-GI52BW74.js +207 -0
  51. package/dist/{chunk-3Q342EJJ.js → chunk-GWQSZT4C.js} +2 -2
  52. package/dist/{chunk-EPBBYMNE.js → chunk-HUO3UTAQ.js} +1 -1
  53. package/dist/{chunk-WPPXIAFB.js → chunk-IIESAYDL.js} +17 -434
  54. package/dist/chunk-IUFM5JWV.js +24 -0
  55. package/dist/{chunk-UZQ4VY3M.js → chunk-J3S57AXY.js} +1 -1
  56. package/dist/{chunk-DQXAAVTR.js → chunk-J6EJQCHY.js} +46 -1471
  57. package/dist/{chunk-6ZK6FZIV.js → chunk-KCBZSJRU.js} +6 -27
  58. package/dist/chunk-MQ5RYATN.js +1523 -0
  59. package/dist/{chunk-5G34IEK2.js → chunk-MXTVUV3I.js} +2 -56
  60. package/dist/{chunk-YRPC6MJY.js → chunk-MXVD2BDS.js} +1 -1
  61. package/dist/{chunk-POBSY47Q.js → chunk-PJW6U46K.js} +337 -306
  62. package/dist/chunk-Q6QZTTLS.js +55 -0
  63. package/dist/{chunk-ZFS67WIR.js → chunk-QTBKPZDA.js} +57 -6
  64. package/dist/chunk-R776HKPK.js +81 -0
  65. package/dist/{chunk-77VDLF3Z.js → chunk-RUIXF3YQ.js} +10 -0
  66. package/dist/chunk-U27DSXKB.js +714 -0
  67. package/dist/{chunk-XZ7NPXAB.js → chunk-U7CMWQ7Z.js} +1 -1
  68. package/dist/{chunk-RB4NJKEX.js → chunk-UDBUS533.js} +125 -51
  69. package/dist/chunk-WQRX57EA.js +668 -0
  70. package/dist/chunk-WZH4JV7R.js +320 -0
  71. package/dist/{chunk-HCIVH3JS.js → chunk-YCTDA7BD.js} +28 -0
  72. package/dist/{chunk-YNFERGKP.js → chunk-YGZ2OLXL.js} +1 -1
  73. package/dist/{chunk-EWDSB24B.js → chunk-ZQCGQMF2.js} +16 -776
  74. package/dist/{chunk-KJ4HGRHN.js → chunk-ZYQSPQYR.js} +515 -601
  75. package/dist/cli/chat.js +68 -29
  76. package/dist/cli/check.js +7 -7
  77. package/dist/cli/plugins.js +15 -13
  78. package/dist/cli/snapshot-create.js +11 -10
  79. package/dist/cli/upgrade.js +8 -8
  80. package/dist/conversation-work-KATFHLG3.js +56 -0
  81. package/dist/db/schema/agent-invocations.d.ts +544 -0
  82. package/dist/db/schema/task-executions.d.ts +23 -2
  83. package/dist/db/schema.d.ts +563 -2
  84. package/dist/{db-66E7VDNC.js → db-UXPPGHDF.js} +7 -7
  85. package/dist/experimental-HH6OM6UH.js +13 -0
  86. package/dist/instrumentation.js +4 -4
  87. package/dist/nitro.js +4 -3
  88. package/dist/{oauth-callback-server-7QPD4Q7P.js → oauth-callback-server-4ZYMD5UA.js} +28 -19
  89. package/dist/{runner-L2BKJKOD.js → runner-MZSEONRZ.js} +32 -18
  90. package/dist/{sandbox-egress-signals-A5HWIQH4.js → sandbox-egress-signals-EKPAVWQL.js} +2 -2
  91. package/dist/{skills-HOQ2NSPW.js → skills-IMVPXSQ7.js} +7 -7
  92. package/dist/spawn-S5LSVOCE.js +38 -0
  93. package/dist/{validation-ENHI7S2C.js → validation-ZKCY2BVR.js} +7 -7
  94. package/dist/version.js +1 -1
  95. package/dist/work-GG3XDYRX.js +46 -0
  96. package/dist/worker-23AUELCJ.js +24 -0
  97. package/migrations/0021_first_warhawk.sql +35 -0
  98. package/migrations/0022_task_execution_status.sql +3 -0
  99. package/migrations/meta/0021_snapshot.json +2176 -0
  100. package/migrations/meta/0022_snapshot.json +2186 -0
  101. package/migrations/meta/_journal.json +15 -1
  102. package/package.json +4 -4
  103. package/dist/chunk-6QW2RRQT.js +0 -233
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  pluginCatalogRuntime
3
- } from "./chunk-36EG34YI.js";
4
- import "./chunk-BZAMASJP.js";
5
- import "./chunk-77VDLF3Z.js";
3
+ } from "./chunk-6OHTDR4F.js";
4
+ import "./chunk-CXH25EL4.js";
5
+ import "./chunk-RUIXF3YQ.js";
6
6
  import "./chunk-HZF5P5UN.js";
7
7
  import "./chunk-F3B2YJ76.js";
8
- import "./chunk-T6Z5S6PQ.js";
8
+ import "./chunk-2ECYPYKP.js";
9
9
  import "./chunk-6GWA276C.js";
10
10
  import "./chunk-OOUNJNMR.js";
11
11
  import "./chunk-H4HBKISO.js";
12
- import "./chunk-5PNJMOY5.js";
13
- import "./chunk-XZ7NPXAB.js";
12
+ import "./chunk-C2N6MNO4.js";
13
+ import "./chunk-U7CMWQ7Z.js";
14
14
  import "./chunk-MLKGABMK.js";
15
15
  export {
16
16
  pluginCatalogRuntime
@@ -16,7 +16,6 @@ import type { Actor } from "@/chat/actor";
16
16
  import type { SandboxRef } from "@/chat/sandbox/ref";
17
17
  import type { SandboxEgressTracePropagationConfig } from "@/chat/sandbox/egress/tracing";
18
18
  import type { SandboxEgressSignalTransport } from "@/chat/sandbox/egress/signals";
19
- import type { AuthorizationFlowMode } from "@/chat/services/auth-pause";
20
19
  import type { OAuthAuthorization } from "@/chat/oauth-authorization";
21
20
  import type { AssistantStatusSpec } from "@/chat/slack/assistant-thread/status";
22
21
  import type { SlackConversationContext } from "@/chat/slack/conversation-context";
@@ -49,6 +48,21 @@ export interface AgentRunSteeringMessage {
49
48
  timestampMs?: number;
50
49
  userAttachments?: AgentRunAttachment[];
51
50
  }
51
+ /** Model-safe input for one asynchronously delegated child-agent task. */
52
+ export type SpawnAgentInput = {
53
+ name?: string;
54
+ reasoningLevel?: TurnReasoningLevel;
55
+ task: string;
56
+ };
57
+ /** Handle returned after a child-agent task is durably scheduled. */
58
+ export type SpawnAgentResult = {
59
+ invocationId: string;
60
+ };
61
+ /** Runtime-bound child-agent capability exposed to model-facing tool wiring. */
62
+ export type SpawnAgent = (input: SpawnAgentInput, options: {
63
+ signal?: AbortSignal;
64
+ toolCallId: string;
65
+ }) => Promise<SpawnAgentResult>;
52
66
  /** Carries the user-visible content and prior transcript for one agent-run slice. */
53
67
  export interface AgentRunInput {
54
68
  actor?: AgentRunInstructionActor;
@@ -61,10 +75,20 @@ export interface AgentRunInput {
61
75
  piMessages?: PiMessage[];
62
76
  conversationContext?: string;
63
77
  }
64
- /** Carries identity and addressing needed to route tools, auth, and delivery. */
78
+ /**
79
+ * Identity and addressing for one run.
80
+ *
81
+ * Set `actor` first (who runs). Derive `credentialContext` with
82
+ * `credentialContextForActor(actor, subject?)` unless a caller already bound
83
+ * credentials (dispatch with delegated subject). They name the same principal
84
+ * except when a system actor carries `credentialContext.subject` for delegated
85
+ * user tokens.
86
+ */
65
87
  export interface AgentRunRouting {
66
- credentialContext?: CredentialContext;
88
+ /** Who this run executes as. Prefer always setting this. */
67
89
  actor?: Actor;
90
+ /** Credential authority projected from actor (plus optional subject). */
91
+ credentialContext?: CredentialContext;
68
92
  source: Source;
69
93
  slackConversation?: SlackConversationContext;
70
94
  /**
@@ -85,13 +109,27 @@ export interface AgentRunRouting {
85
109
  };
86
110
  toolChannelId?: string;
87
111
  }
112
+ /** Optional agent capabilities that a run slice can turn off. */
113
+ export declare const AGENT_RUN_FEATURES: readonly ["handoff", "interactive-auth", "subagents"];
114
+ /** One optional agent capability controlled by run policy. */
115
+ export type AgentRunFeature = (typeof AGENT_RUN_FEATURES)[number];
116
+ /** Return whether one optional agent capability is disabled for this run. */
117
+ export declare function isAgentRunFeatureDisabled(policy: Pick<AgentRunPolicy, "disabledFeatures"> | undefined, feature: AgentRunFeature): boolean;
88
118
  /** Carries execution limits and dependency overrides for one run slice. */
89
119
  export interface AgentRunPolicy {
120
+ /**
121
+ * Optional agent capabilities disabled for this run slice.
122
+ * `interactive-auth` blocks pausing to send an OAuth link; missing credentials
123
+ * hard-fail instead. Default is enabled when omitted.
124
+ * TODO(#881, #883): child invocations currently disable interactive-auth, but
125
+ * may later need a path to force the auth flow when a delegated tool requires
126
+ * credentials the parent can already request.
127
+ */
128
+ disabledFeatures?: readonly AgentRunFeature[];
90
129
  /** Absolute wall-clock deadline for this host request, in milliseconds. */
91
130
  turnDeadlineAtMs?: number;
92
131
  /** Cancels provider work when the owning host request is abandoned. */
93
132
  signal?: AbortSignal;
94
- authorizationFlowMode?: AuthorizationFlowMode;
95
133
  /** Explicit per-agent reasoning level. When set, adaptive routing is disabled. */
96
134
  reasoningLevel?: TurnReasoningLevel;
97
135
  configuration?: Record<string, unknown>;
@@ -141,6 +179,8 @@ export declare class RetryableDeliveryError extends Error {
141
179
  }
142
180
  /** Carries durable-worker ports that commit or update resumable run state. */
143
181
  export interface AgentRunDurability {
182
+ /** Schedule delegated work with authority bound by the active parent run. */
183
+ spawnAgent?: SpawnAgent;
144
184
  onInputCommitted?: () => void | Promise<void>;
145
185
  /** Return true when the durable worker should pause at the next Pi boundary. */
146
186
  shouldYield?: () => boolean;
@@ -15,6 +15,11 @@ export declare function recoverPendingDispatchMailboxAppends(args: {
15
15
  conversationWorkQueue: ConversationWorkQueue;
16
16
  nowMs: number;
17
17
  }): Promise<void>;
18
+ /** Repair invocation creation that stopped before its idempotent mailbox append. */
19
+ export declare function recoverPendingAgentInvocationMailboxAppends(args: {
20
+ conversationWorkQueue: ConversationWorkQueue;
21
+ nowMs: number;
22
+ }): Promise<void>;
18
23
  /** Run the core heartbeat phases. */
19
24
  export declare function runHeartbeat(args: {
20
25
  conversationWorkQueue?: ConversationWorkQueue;
@@ -47,7 +47,7 @@ export interface DispatchTurnResult {
47
47
  }
48
48
  /** Dispatch-owned authority supplied to the shared turn runtime. */
49
49
  export interface DispatchTurnContext {
50
- authorizationFlowMode: "disabled";
50
+ disabledFeatures: readonly ["interactive-auth"];
51
51
  channelConfiguration: ChannelConfigurationService;
52
52
  credentialContext: CredentialContext;
53
53
  destinationVisibility: DestinationVisibility;
@@ -0,0 +1,8 @@
1
+ /** Named child cannot accept another invocation until its active work ends. */
2
+ export declare class AgentInvocationBusyError extends Error {
3
+ constructor(name: string);
4
+ }
5
+ /** Parent already has the maximum number of non-terminal child invocations. */
6
+ export declare class AgentInvocationLimitError extends Error {
7
+ constructor(limit: number);
8
+ }
@@ -0,0 +1,12 @@
1
+ import type { StateAdapter } from "chat";
2
+ import type { ConversationStore } from "@/chat/conversations/store";
3
+ import type { AgentRunRequest, SpawnAgent } from "@/chat/agent/request";
4
+ import type { ConversationWorkQueue } from "@/chat/task-execution/queue";
5
+ type SpawnOptions = {
6
+ conversationStore?: ConversationStore;
7
+ queue: ConversationWorkQueue | (() => ConversationWorkQueue);
8
+ state?: StateAdapter;
9
+ };
10
+ /** Bind one run's runtime-owned authority to the model-safe spawn capability. */
11
+ export declare function bindSpawnAgent(request: AgentRunRequest, options: SpawnOptions): SpawnAgent | undefined;
12
+ export {};
@@ -0,0 +1,44 @@
1
+ import { type AgentInvocation, type CreateAgentInvocationInput } from "./types";
2
+ /** Cap concurrent non-terminal children one parent can keep in flight. */
3
+ export declare const MAX_ACTIVE_AGENT_INVOCATIONS_PER_PARENT = 8;
4
+ /** Return the stable identity for one retry-safe delegated task. */
5
+ export declare function getAgentInvocationId(parentConversationId: string, idempotencyKey: string): string;
6
+ /** Return the stable child identity for one invocation without a named binding. */
7
+ export declare function getUnnamedAgentConversationId(invocationId: string): string;
8
+ /** Return the stable child identity for one named binding. */
9
+ export declare function getNamedAgentConversationId(parentConversationId: string, name: string): string;
10
+ /** Return the stable turn identity advanced by one agent invocation. */
11
+ export declare function getAgentInvocationTurnId(invocationId: string): string;
12
+ /** Return the stable mailbox identity for one agent invocation. */
13
+ export declare function getAgentInvocationMessageId(invocationId: string): string;
14
+ /** Read one durable agent invocation. */
15
+ export declare function getAgentInvocation(invocationId: string): Promise<AgentInvocation | undefined>;
16
+ /** Resolve the single invocation that may resume for one child conversation. */
17
+ export declare function getActiveAgentInvocationForConversation(childConversationId: string): Promise<AgentInvocation | undefined>;
18
+ /**
19
+ * Create or replay one invocation, reusing named child conversations and
20
+ * keeping unnamed child identities scoped to the invocation.
21
+ */
22
+ export declare function createAgentInvocation(rawInput: CreateAgentInvocationInput, nowMs?: number): Promise<AgentInvocation>;
23
+ /** List bounded invocation records whose mailbox append still needs repair. */
24
+ export declare function listPendingAgentInvocationMailboxAppends(limit?: number): Promise<AgentInvocation[]>;
25
+ /** Record that the invocation's idempotent mailbox append completed. */
26
+ export declare function markAgentInvocationMailboxAppended(invocationId: string, nowMs?: number): Promise<void>;
27
+ /** Mark one non-terminal invocation as actively executing. */
28
+ export declare function markAgentInvocationRunning(invocationId: string, nowMs?: number): Promise<AgentInvocation | undefined>;
29
+ /** Mark one invocation as waiting for another shared execution slice. */
30
+ export declare function markAgentInvocationAwaitingResume(invocationId: string, nowMs?: number): Promise<void>;
31
+ /** Persist one terminal invocation result without overwriting an earlier result. */
32
+ export declare function completeAgentInvocation(args: {
33
+ invocationId: string;
34
+ result: string;
35
+ status: "completed";
36
+ nowMs?: number;
37
+ } | {
38
+ errorMessage: string;
39
+ invocationId: string;
40
+ status: "blocked" | "failed";
41
+ nowMs?: number;
42
+ }): Promise<AgentInvocation | undefined>;
43
+ /** Return whether an invocation already owns its immutable terminal result. */
44
+ export declare function isTerminalAgentInvocation(invocation: AgentInvocation): boolean;
@@ -0,0 +1,449 @@
1
+ import { z } from "zod";
2
+ import { AGENT_INVOCATION_STATUSES } from "@/db/schema/agent-invocations";
3
+ export declare const agentNameSchema: z.ZodString;
4
+ export declare const agentBindingSchema: z.ZodObject<{
5
+ childConversationId: z.ZodString;
6
+ name: z.ZodString;
7
+ parentConversationId: z.ZodString;
8
+ }, z.core.$strict>;
9
+ export declare const agentInvocationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
10
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
11
+ platform: z.ZodLiteral<"slack">;
12
+ teamId: z.ZodString;
13
+ email: z.ZodOptional<z.ZodString>;
14
+ fullName: z.ZodOptional<z.ZodString>;
15
+ userId: z.ZodString;
16
+ userName: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strict>, z.ZodObject<{
18
+ platform: z.ZodLiteral<"local">;
19
+ email: z.ZodOptional<z.ZodString>;
20
+ fullName: z.ZodOptional<z.ZodString>;
21
+ userId: z.ZodString;
22
+ userName: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ platform: z.ZodLiteral<"system">;
25
+ name: z.ZodString;
26
+ }, z.core.$strict>], "platform">;
27
+ agentName: z.ZodOptional<z.ZodString>;
28
+ childConversationId: z.ZodString;
29
+ createdAtMs: z.ZodNumber;
30
+ credentialContext: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
31
+ actor: z.ZodObject<{
32
+ type: z.ZodLiteral<"user">;
33
+ userId: z.ZodString;
34
+ }, z.core.$strict>;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ actor: z.ZodObject<{
37
+ platform: z.ZodLiteral<"system">;
38
+ name: z.ZodString;
39
+ }, z.core.$strict>;
40
+ subject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
41
+ type: z.ZodLiteral<"user">;
42
+ userId: z.ZodString;
43
+ allowedWhen: z.ZodLiteral<"private-direct-conversation">;
44
+ binding: z.ZodObject<{
45
+ type: z.ZodLiteral<"slack-direct-conversation">;
46
+ teamId: z.ZodString;
47
+ channelId: z.ZodString;
48
+ signature: z.ZodString;
49
+ }, z.core.$strict>;
50
+ }, z.core.$strict>, z.ZodObject<{
51
+ type: z.ZodLiteral<"user">;
52
+ userId: z.ZodString;
53
+ allowedWhen: z.ZodLiteral<"scheduled-task">;
54
+ taskId: z.ZodString;
55
+ binding: z.ZodObject<{
56
+ type: z.ZodLiteral<"scheduled-task">;
57
+ plugin: z.ZodString;
58
+ taskId: z.ZodString;
59
+ signature: z.ZodString;
60
+ }, z.core.$strict>;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ type: z.ZodLiteral<"user">;
63
+ userId: z.ZodString;
64
+ allowedWhen: z.ZodLiteral<"event-task">;
65
+ taskId: z.ZodString;
66
+ binding: z.ZodObject<{
67
+ type: z.ZodLiteral<"event-task">;
68
+ plugin: z.ZodString;
69
+ taskId: z.ZodString;
70
+ signature: z.ZodString;
71
+ }, z.core.$strict>;
72
+ }, z.core.$strict>], "allowedWhen">>;
73
+ }, z.core.$strict>]>>;
74
+ destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
75
+ platform: z.ZodLiteral<"slack">;
76
+ teamId: z.ZodString;
77
+ channelId: z.ZodString;
78
+ }, z.core.$strict>, z.ZodObject<{
79
+ platform: z.ZodLiteral<"local">;
80
+ conversationId: z.ZodString;
81
+ }, z.core.$strict>], "platform">;
82
+ destinationVisibility: z.ZodOptional<z.ZodEnum<{
83
+ public: "public";
84
+ private: "private";
85
+ }>>;
86
+ input: z.ZodString;
87
+ invocationId: z.ZodString;
88
+ mailboxStatus: z.ZodEnum<{
89
+ pending: "pending";
90
+ appended: "appended";
91
+ }>;
92
+ parentConversationId: z.ZodString;
93
+ reasoningLevel: z.ZodOptional<z.ZodEnum<{
94
+ low: "low";
95
+ medium: "medium";
96
+ high: "high";
97
+ xhigh: "xhigh";
98
+ none: "none";
99
+ }>>;
100
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
101
+ platform: z.ZodLiteral<"slack">;
102
+ teamId: z.ZodString;
103
+ channelId: z.ZodString;
104
+ visibility: z.ZodEnum<{
105
+ public: "public";
106
+ private: "private";
107
+ }>;
108
+ messageTs: z.ZodOptional<z.ZodString>;
109
+ threadTs: z.ZodOptional<z.ZodString>;
110
+ }, z.core.$strict>, z.ZodObject<{
111
+ platform: z.ZodLiteral<"local">;
112
+ visibility: z.ZodLiteral<"private">;
113
+ conversationId: z.ZodString;
114
+ }, z.core.$strict>], "platform">;
115
+ updatedAtMs: z.ZodNumber;
116
+ status: z.ZodEnum<{
117
+ pending: "pending";
118
+ running: "running";
119
+ awaiting_resume: "awaiting_resume";
120
+ }>;
121
+ }, z.core.$strict>, z.ZodObject<{
122
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
123
+ platform: z.ZodLiteral<"slack">;
124
+ teamId: z.ZodString;
125
+ email: z.ZodOptional<z.ZodString>;
126
+ fullName: z.ZodOptional<z.ZodString>;
127
+ userId: z.ZodString;
128
+ userName: z.ZodOptional<z.ZodString>;
129
+ }, z.core.$strict>, z.ZodObject<{
130
+ platform: z.ZodLiteral<"local">;
131
+ email: z.ZodOptional<z.ZodString>;
132
+ fullName: z.ZodOptional<z.ZodString>;
133
+ userId: z.ZodString;
134
+ userName: z.ZodOptional<z.ZodString>;
135
+ }, z.core.$strict>, z.ZodObject<{
136
+ platform: z.ZodLiteral<"system">;
137
+ name: z.ZodString;
138
+ }, z.core.$strict>], "platform">;
139
+ agentName: z.ZodOptional<z.ZodString>;
140
+ childConversationId: z.ZodString;
141
+ createdAtMs: z.ZodNumber;
142
+ credentialContext: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
143
+ actor: z.ZodObject<{
144
+ type: z.ZodLiteral<"user">;
145
+ userId: z.ZodString;
146
+ }, z.core.$strict>;
147
+ }, z.core.$strict>, z.ZodObject<{
148
+ actor: z.ZodObject<{
149
+ platform: z.ZodLiteral<"system">;
150
+ name: z.ZodString;
151
+ }, z.core.$strict>;
152
+ subject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
153
+ type: z.ZodLiteral<"user">;
154
+ userId: z.ZodString;
155
+ allowedWhen: z.ZodLiteral<"private-direct-conversation">;
156
+ binding: z.ZodObject<{
157
+ type: z.ZodLiteral<"slack-direct-conversation">;
158
+ teamId: z.ZodString;
159
+ channelId: z.ZodString;
160
+ signature: z.ZodString;
161
+ }, z.core.$strict>;
162
+ }, z.core.$strict>, z.ZodObject<{
163
+ type: z.ZodLiteral<"user">;
164
+ userId: z.ZodString;
165
+ allowedWhen: z.ZodLiteral<"scheduled-task">;
166
+ taskId: z.ZodString;
167
+ binding: z.ZodObject<{
168
+ type: z.ZodLiteral<"scheduled-task">;
169
+ plugin: z.ZodString;
170
+ taskId: z.ZodString;
171
+ signature: z.ZodString;
172
+ }, z.core.$strict>;
173
+ }, z.core.$strict>, z.ZodObject<{
174
+ type: z.ZodLiteral<"user">;
175
+ userId: z.ZodString;
176
+ allowedWhen: z.ZodLiteral<"event-task">;
177
+ taskId: z.ZodString;
178
+ binding: z.ZodObject<{
179
+ type: z.ZodLiteral<"event-task">;
180
+ plugin: z.ZodString;
181
+ taskId: z.ZodString;
182
+ signature: z.ZodString;
183
+ }, z.core.$strict>;
184
+ }, z.core.$strict>], "allowedWhen">>;
185
+ }, z.core.$strict>]>>;
186
+ destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
187
+ platform: z.ZodLiteral<"slack">;
188
+ teamId: z.ZodString;
189
+ channelId: z.ZodString;
190
+ }, z.core.$strict>, z.ZodObject<{
191
+ platform: z.ZodLiteral<"local">;
192
+ conversationId: z.ZodString;
193
+ }, z.core.$strict>], "platform">;
194
+ destinationVisibility: z.ZodOptional<z.ZodEnum<{
195
+ public: "public";
196
+ private: "private";
197
+ }>>;
198
+ input: z.ZodString;
199
+ invocationId: z.ZodString;
200
+ mailboxStatus: z.ZodEnum<{
201
+ pending: "pending";
202
+ appended: "appended";
203
+ }>;
204
+ parentConversationId: z.ZodString;
205
+ reasoningLevel: z.ZodOptional<z.ZodEnum<{
206
+ low: "low";
207
+ medium: "medium";
208
+ high: "high";
209
+ xhigh: "xhigh";
210
+ none: "none";
211
+ }>>;
212
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
213
+ platform: z.ZodLiteral<"slack">;
214
+ teamId: z.ZodString;
215
+ channelId: z.ZodString;
216
+ visibility: z.ZodEnum<{
217
+ public: "public";
218
+ private: "private";
219
+ }>;
220
+ messageTs: z.ZodOptional<z.ZodString>;
221
+ threadTs: z.ZodOptional<z.ZodString>;
222
+ }, z.core.$strict>, z.ZodObject<{
223
+ platform: z.ZodLiteral<"local">;
224
+ visibility: z.ZodLiteral<"private">;
225
+ conversationId: z.ZodString;
226
+ }, z.core.$strict>], "platform">;
227
+ updatedAtMs: z.ZodNumber;
228
+ result: z.ZodString;
229
+ status: z.ZodLiteral<"completed">;
230
+ terminalAtMs: z.ZodNumber;
231
+ }, z.core.$strict>, z.ZodObject<{
232
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
233
+ platform: z.ZodLiteral<"slack">;
234
+ teamId: z.ZodString;
235
+ email: z.ZodOptional<z.ZodString>;
236
+ fullName: z.ZodOptional<z.ZodString>;
237
+ userId: z.ZodString;
238
+ userName: z.ZodOptional<z.ZodString>;
239
+ }, z.core.$strict>, z.ZodObject<{
240
+ platform: z.ZodLiteral<"local">;
241
+ email: z.ZodOptional<z.ZodString>;
242
+ fullName: z.ZodOptional<z.ZodString>;
243
+ userId: z.ZodString;
244
+ userName: z.ZodOptional<z.ZodString>;
245
+ }, z.core.$strict>, z.ZodObject<{
246
+ platform: z.ZodLiteral<"system">;
247
+ name: z.ZodString;
248
+ }, z.core.$strict>], "platform">;
249
+ agentName: z.ZodOptional<z.ZodString>;
250
+ childConversationId: z.ZodString;
251
+ createdAtMs: z.ZodNumber;
252
+ credentialContext: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
253
+ actor: z.ZodObject<{
254
+ type: z.ZodLiteral<"user">;
255
+ userId: z.ZodString;
256
+ }, z.core.$strict>;
257
+ }, z.core.$strict>, z.ZodObject<{
258
+ actor: z.ZodObject<{
259
+ platform: z.ZodLiteral<"system">;
260
+ name: z.ZodString;
261
+ }, z.core.$strict>;
262
+ subject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
263
+ type: z.ZodLiteral<"user">;
264
+ userId: z.ZodString;
265
+ allowedWhen: z.ZodLiteral<"private-direct-conversation">;
266
+ binding: z.ZodObject<{
267
+ type: z.ZodLiteral<"slack-direct-conversation">;
268
+ teamId: z.ZodString;
269
+ channelId: z.ZodString;
270
+ signature: z.ZodString;
271
+ }, z.core.$strict>;
272
+ }, z.core.$strict>, z.ZodObject<{
273
+ type: z.ZodLiteral<"user">;
274
+ userId: z.ZodString;
275
+ allowedWhen: z.ZodLiteral<"scheduled-task">;
276
+ taskId: z.ZodString;
277
+ binding: z.ZodObject<{
278
+ type: z.ZodLiteral<"scheduled-task">;
279
+ plugin: z.ZodString;
280
+ taskId: z.ZodString;
281
+ signature: z.ZodString;
282
+ }, z.core.$strict>;
283
+ }, z.core.$strict>, z.ZodObject<{
284
+ type: z.ZodLiteral<"user">;
285
+ userId: z.ZodString;
286
+ allowedWhen: z.ZodLiteral<"event-task">;
287
+ taskId: z.ZodString;
288
+ binding: z.ZodObject<{
289
+ type: z.ZodLiteral<"event-task">;
290
+ plugin: z.ZodString;
291
+ taskId: z.ZodString;
292
+ signature: z.ZodString;
293
+ }, z.core.$strict>;
294
+ }, z.core.$strict>], "allowedWhen">>;
295
+ }, z.core.$strict>]>>;
296
+ destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
297
+ platform: z.ZodLiteral<"slack">;
298
+ teamId: z.ZodString;
299
+ channelId: z.ZodString;
300
+ }, z.core.$strict>, z.ZodObject<{
301
+ platform: z.ZodLiteral<"local">;
302
+ conversationId: z.ZodString;
303
+ }, z.core.$strict>], "platform">;
304
+ destinationVisibility: z.ZodOptional<z.ZodEnum<{
305
+ public: "public";
306
+ private: "private";
307
+ }>>;
308
+ input: z.ZodString;
309
+ invocationId: z.ZodString;
310
+ mailboxStatus: z.ZodEnum<{
311
+ pending: "pending";
312
+ appended: "appended";
313
+ }>;
314
+ parentConversationId: z.ZodString;
315
+ reasoningLevel: z.ZodOptional<z.ZodEnum<{
316
+ low: "low";
317
+ medium: "medium";
318
+ high: "high";
319
+ xhigh: "xhigh";
320
+ none: "none";
321
+ }>>;
322
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
323
+ platform: z.ZodLiteral<"slack">;
324
+ teamId: z.ZodString;
325
+ channelId: z.ZodString;
326
+ visibility: z.ZodEnum<{
327
+ public: "public";
328
+ private: "private";
329
+ }>;
330
+ messageTs: z.ZodOptional<z.ZodString>;
331
+ threadTs: z.ZodOptional<z.ZodString>;
332
+ }, z.core.$strict>, z.ZodObject<{
333
+ platform: z.ZodLiteral<"local">;
334
+ visibility: z.ZodLiteral<"private">;
335
+ conversationId: z.ZodString;
336
+ }, z.core.$strict>], "platform">;
337
+ updatedAtMs: z.ZodNumber;
338
+ errorMessage: z.ZodString;
339
+ status: z.ZodEnum<{
340
+ failed: "failed";
341
+ blocked: "blocked";
342
+ }>;
343
+ terminalAtMs: z.ZodNumber;
344
+ }, z.core.$strict>], "status">;
345
+ export declare const createAgentInvocationSchema: z.ZodObject<{
346
+ actor: z.ZodDiscriminatedUnion<[z.ZodObject<{
347
+ platform: z.ZodLiteral<"slack">;
348
+ teamId: z.ZodString;
349
+ email: z.ZodOptional<z.ZodString>;
350
+ fullName: z.ZodOptional<z.ZodString>;
351
+ userId: z.ZodString;
352
+ userName: z.ZodOptional<z.ZodString>;
353
+ }, z.core.$strict>, z.ZodObject<{
354
+ platform: z.ZodLiteral<"local">;
355
+ email: z.ZodOptional<z.ZodString>;
356
+ fullName: z.ZodOptional<z.ZodString>;
357
+ userId: z.ZodString;
358
+ userName: z.ZodOptional<z.ZodString>;
359
+ }, z.core.$strict>, z.ZodObject<{
360
+ platform: z.ZodLiteral<"system">;
361
+ name: z.ZodString;
362
+ }, z.core.$strict>], "platform">;
363
+ agentName: z.ZodOptional<z.ZodString>;
364
+ credentialContext: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
365
+ actor: z.ZodObject<{
366
+ type: z.ZodLiteral<"user">;
367
+ userId: z.ZodString;
368
+ }, z.core.$strict>;
369
+ }, z.core.$strict>, z.ZodObject<{
370
+ actor: z.ZodObject<{
371
+ platform: z.ZodLiteral<"system">;
372
+ name: z.ZodString;
373
+ }, z.core.$strict>;
374
+ subject: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
375
+ type: z.ZodLiteral<"user">;
376
+ userId: z.ZodString;
377
+ allowedWhen: z.ZodLiteral<"private-direct-conversation">;
378
+ binding: z.ZodObject<{
379
+ type: z.ZodLiteral<"slack-direct-conversation">;
380
+ teamId: z.ZodString;
381
+ channelId: z.ZodString;
382
+ signature: z.ZodString;
383
+ }, z.core.$strict>;
384
+ }, z.core.$strict>, z.ZodObject<{
385
+ type: z.ZodLiteral<"user">;
386
+ userId: z.ZodString;
387
+ allowedWhen: z.ZodLiteral<"scheduled-task">;
388
+ taskId: z.ZodString;
389
+ binding: z.ZodObject<{
390
+ type: z.ZodLiteral<"scheduled-task">;
391
+ plugin: z.ZodString;
392
+ taskId: z.ZodString;
393
+ signature: z.ZodString;
394
+ }, z.core.$strict>;
395
+ }, z.core.$strict>, z.ZodObject<{
396
+ type: z.ZodLiteral<"user">;
397
+ userId: z.ZodString;
398
+ allowedWhen: z.ZodLiteral<"event-task">;
399
+ taskId: z.ZodString;
400
+ binding: z.ZodObject<{
401
+ type: z.ZodLiteral<"event-task">;
402
+ plugin: z.ZodString;
403
+ taskId: z.ZodString;
404
+ signature: z.ZodString;
405
+ }, z.core.$strict>;
406
+ }, z.core.$strict>], "allowedWhen">>;
407
+ }, z.core.$strict>]>>;
408
+ destination: z.ZodDiscriminatedUnion<[z.ZodObject<{
409
+ platform: z.ZodLiteral<"slack">;
410
+ teamId: z.ZodString;
411
+ channelId: z.ZodString;
412
+ }, z.core.$strict>, z.ZodObject<{
413
+ platform: z.ZodLiteral<"local">;
414
+ conversationId: z.ZodString;
415
+ }, z.core.$strict>], "platform">;
416
+ destinationVisibility: z.ZodOptional<z.ZodEnum<{
417
+ public: "public";
418
+ private: "private";
419
+ }>>;
420
+ idempotencyKey: z.ZodString;
421
+ input: z.ZodString;
422
+ parentConversationId: z.ZodString;
423
+ reasoningLevel: z.ZodOptional<z.ZodEnum<{
424
+ low: "low";
425
+ medium: "medium";
426
+ high: "high";
427
+ xhigh: "xhigh";
428
+ none: "none";
429
+ }>>;
430
+ source: z.ZodDiscriminatedUnion<[z.ZodObject<{
431
+ platform: z.ZodLiteral<"slack">;
432
+ teamId: z.ZodString;
433
+ channelId: z.ZodString;
434
+ visibility: z.ZodEnum<{
435
+ public: "public";
436
+ private: "private";
437
+ }>;
438
+ messageTs: z.ZodOptional<z.ZodString>;
439
+ threadTs: z.ZodOptional<z.ZodString>;
440
+ }, z.core.$strict>, z.ZodObject<{
441
+ platform: z.ZodLiteral<"local">;
442
+ visibility: z.ZodLiteral<"private">;
443
+ conversationId: z.ZodString;
444
+ }, z.core.$strict>], "platform">;
445
+ }, z.core.$strict>;
446
+ export type AgentBinding = z.output<typeof agentBindingSchema>;
447
+ export type AgentInvocation = z.output<typeof agentInvocationSchema>;
448
+ export type AgentInvocationStatus = (typeof AGENT_INVOCATION_STATUSES)[number];
449
+ export type CreateAgentInvocationInput = z.input<typeof createAgentInvocationSchema>;