@sentry/junior 0.203.0 → 0.205.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 (174) hide show
  1. package/dist/agent-D4nu8MQV.js +17521 -0
  2. package/dist/agent-hooks-DXHpTJ4m.js +4042 -0
  3. package/dist/agent-runner-C04colea.js +678 -0
  4. package/dist/api/schema.d.ts +2736 -2639
  5. package/dist/api/schema.js +4 -169
  6. package/dist/api.d.ts +23 -17
  7. package/dist/api.js +3881 -5326
  8. package/dist/app-Cb776lL8.d.ts +247 -0
  9. package/dist/app.d.ts +4 -520
  10. package/dist/app.js +9524 -11875
  11. package/dist/auth-pause-state-C2P3guS1.js +168 -0
  12. package/dist/catalog-runtime-CXw3asJD.js +7 -0
  13. package/dist/checkpoint-CrViJ8Ps.js +2450 -0
  14. package/dist/cli/chat.d.ts +20 -0
  15. package/dist/cli/chat.js +229 -336
  16. package/dist/cli/check.d.ts +8 -0
  17. package/dist/cli/check.js +513 -806
  18. package/dist/cli/env.d.ts +13 -0
  19. package/dist/cli/env.js +63 -12
  20. package/dist/cli/init.d.ts +3 -0
  21. package/dist/cli/init.js +90 -159
  22. package/dist/cli/main.d.ts +6 -0
  23. package/dist/cli/main.js +43 -64
  24. package/dist/cli/plugins.d.ts +13 -0
  25. package/dist/cli/plugins.js +148 -227
  26. package/dist/cli/run.d.ts +16 -0
  27. package/dist/cli/run.js +52 -8
  28. package/dist/cli/snapshot-create.d.ts +4 -0
  29. package/dist/cli/snapshot-create.js +71 -125
  30. package/dist/cli/upgrade.d.ts +15 -0
  31. package/dist/cli/upgrade.js +232 -335
  32. package/dist/config-BOtJQ7Pc.js +941 -0
  33. package/dist/context-B45_WqVX.js +298 -0
  34. package/dist/conversation-privacy-BZRA6Pes.js +182 -0
  35. package/dist/conversation-work-C6y3T5Hx.js +51 -0
  36. package/dist/credential-sync-Bep34IB_.js +2661 -0
  37. package/dist/db-BeyXKJOI.d.ts +5 -0
  38. package/dist/destinations-BeBiJeEM.js +29 -0
  39. package/dist/execution-stats-B6lgWxCK.js +373 -0
  40. package/dist/executor-BlUhFL7_.js +721 -0
  41. package/dist/experimental-CIXf7Uye.js +46 -0
  42. package/dist/history-ClE4toxe.d.ts +32 -0
  43. package/dist/history-CqTuSAdI.js +441 -0
  44. package/dist/instrumentation.d.ts +3 -3
  45. package/dist/instrumentation.js +130 -176
  46. package/dist/job-queue-DLMqIK74.js +63 -0
  47. package/dist/logging-BMJzdDlP.js +1210 -0
  48. package/dist/model-profile-CZmVoGdX.js +49 -0
  49. package/dist/nitro.d.ts +31 -36
  50. package/dist/nitro.js +275 -456
  51. package/dist/oauth-callback-server-WwG5_Zgm.js +130 -0
  52. package/dist/oauth-relay-CdCnu80W.js +62 -0
  53. package/dist/package-discovery-7a9YqLhE.js +455 -0
  54. package/dist/pending-auth-CUbXq06G.js +185 -0
  55. package/dist/plugin-module-BKGOXca2.js +81 -0
  56. package/dist/plugins-BI9A1vKA.d.ts +95 -0
  57. package/dist/plugins-egKWjgue.js +99 -0
  58. package/dist/private-trace-result-BLvBjy_e.js +16 -0
  59. package/dist/profile-T0tXE4zu.js +861 -0
  60. package/dist/registry-BA0__8ai.js +1419 -0
  61. package/dist/reporting-schema-DosTN__Q.js +105 -0
  62. package/dist/resolve-bvD1ORdv.js +546 -0
  63. package/dist/rolldown-runtime-B4FMCO8f.js +28 -0
  64. package/dist/runner-BXYxfIUL.js +392 -0
  65. package/dist/sandbox-egress-signals-ngEPjSEW.js +46 -0
  66. package/dist/schema-Rn8-XEaN.js +1140 -0
  67. package/dist/sentry-CD3SdJl-.js +26 -0
  68. package/dist/skills-DJOlYdBs.js +316 -0
  69. package/dist/spawn-h0R1bTEo.js +29 -0
  70. package/dist/stats-3YZn-Swi.js +2648 -0
  71. package/dist/store-C5qxF2ac.d.ts +208 -0
  72. package/dist/task-queue-CoXwd2eq.js +136 -0
  73. package/dist/task-runner-B2_mJZj0.js +639 -0
  74. package/dist/thread-state-CqZ1m-es.js +431 -0
  75. package/dist/turn-execution-fI6PZ0iI.js +47 -0
  76. package/dist/turn-lifecycle-CcnwrOcp.js +54 -0
  77. package/dist/usage-B5SfMb3H.js +296 -0
  78. package/dist/usage-schema-CKaDkH_j.js +20 -0
  79. package/dist/validation-DfWcvhuS.js +40 -0
  80. package/dist/vercel-queue-DIkVcfK4.js +167 -0
  81. package/dist/vercel.d.ts +6 -6
  82. package/dist/vercel.js +14 -6
  83. package/dist/version-CnXZ614E.d.ts +5 -0
  84. package/dist/version-oD-oPrbO.js +8 -0
  85. package/dist/version.d.ts +2 -4
  86. package/dist/version.js +2 -6
  87. package/dist/web-authorization-Crbzlmzo.js +76 -0
  88. package/dist/web-input-BOuq3oKK.js +494 -0
  89. package/dist/work-B91LQKHr.js +509 -0
  90. package/dist/worker-BcRRTe6k.js +625 -0
  91. package/package.json +9 -9
  92. package/dist/agent-hooks-GB2VPTNA.js +0 -51
  93. package/dist/catalog-runtime-UBLIWD3O.js +0 -14
  94. package/dist/chunk-2LYHWMR4.js +0 -46
  95. package/dist/chunk-352OWAZH.js +0 -320
  96. package/dist/chunk-3Y47VMHV.js +0 -6
  97. package/dist/chunk-3YJSKOWF.js +0 -164
  98. package/dist/chunk-4KSSKTQ5.js +0 -229
  99. package/dist/chunk-4UO6FK4G.js +0 -64
  100. package/dist/chunk-5AHX53NQ.js +0 -717
  101. package/dist/chunk-5J3E5FWA.js +0 -700
  102. package/dist/chunk-5PDAG6O3.js +0 -206
  103. package/dist/chunk-6Y5B5PEX.js +0 -80
  104. package/dist/chunk-7GWQ5S5R.js +0 -2086
  105. package/dist/chunk-7H2VZTWN.js +0 -103
  106. package/dist/chunk-7NL7T6VU.js +0 -406
  107. package/dist/chunk-A5L27LE4.js +0 -387
  108. package/dist/chunk-ADIAWL34.js +0 -81
  109. package/dist/chunk-ASTEMBKJ.js +0 -519
  110. package/dist/chunk-CEMMLV5L.js +0 -98
  111. package/dist/chunk-CM5HNV2W.js +0 -131
  112. package/dist/chunk-CRTRBBRI.js +0 -105
  113. package/dist/chunk-DA2KGZZI.js +0 -13
  114. package/dist/chunk-DIB4GX3G.js +0 -8
  115. package/dist/chunk-DKIJ2RP5.js +0 -68
  116. package/dist/chunk-DWPN6SCH.js +0 -172
  117. package/dist/chunk-EDKUFGPL.js +0 -64
  118. package/dist/chunk-ENY6SKIU.js +0 -1228
  119. package/dist/chunk-F4MGCZOX.js +0 -2943
  120. package/dist/chunk-FA6POGLH.js +0 -70
  121. package/dist/chunk-FSUR7GTG.js +0 -20475
  122. package/dist/chunk-GKEOHJL5.js +0 -1856
  123. package/dist/chunk-GMCB6W5Y.js +0 -333
  124. package/dist/chunk-IE2VPG7O.js +0 -1135
  125. package/dist/chunk-IZ5B5IHQ.js +0 -3656
  126. package/dist/chunk-JAL3CH4G.js +0 -27
  127. package/dist/chunk-KIIEUXD3.js +0 -1764
  128. package/dist/chunk-KXU4NIL7.js +0 -692
  129. package/dist/chunk-MTM5IFCY.js +0 -1190
  130. package/dist/chunk-N7TMSOZH.js +0 -235
  131. package/dist/chunk-NCEBK6PH.js +0 -36
  132. package/dist/chunk-NHJU2ZAL.js +0 -56
  133. package/dist/chunk-P6KTRNVC.js +0 -321
  134. package/dist/chunk-PDO5BLNM.js +0 -22
  135. package/dist/chunk-PDRNLLFT.js +0 -3295
  136. package/dist/chunk-PEQXYSSE.js +0 -45
  137. package/dist/chunk-PKEX2AQX.js +0 -198
  138. package/dist/chunk-PSJCGIGO.js +0 -1163
  139. package/dist/chunk-PZUSUL55.js +0 -506
  140. package/dist/chunk-R45M4TUS.js +0 -37
  141. package/dist/chunk-RC745GGZ.js +0 -122
  142. package/dist/chunk-SP3QKZXJ.js +0 -820
  143. package/dist/chunk-TXKUKMVO.js +0 -417
  144. package/dist/chunk-UE4GPWSD.js +0 -931
  145. package/dist/chunk-UIE3R5XU.js +0 -17
  146. package/dist/chunk-UXPG6ZIN.js +0 -84
  147. package/dist/chunk-VFUK3X5B.js +0 -50
  148. package/dist/chunk-VNMJWREK.js +0 -787
  149. package/dist/chunk-VZ7CSOX2.js +0 -706
  150. package/dist/chunk-WCNQJKFT.js +0 -10
  151. package/dist/chunk-WDZR3QQM.js +0 -135
  152. package/dist/chunk-WLYVJCHV.js +0 -1433
  153. package/dist/chunk-WS7NAFTM.js +0 -1520
  154. package/dist/chunk-X6GDDWQH.js +0 -60
  155. package/dist/chunk-XPDEYNQI.js +0 -102
  156. package/dist/chunk-XRW44VGM.js +0 -58
  157. package/dist/chunk-Y2CM7HXH.js +0 -111
  158. package/dist/chunk-Y7X25LFY.js +0 -15
  159. package/dist/conversation-work-VIOQ5ZF3.js +0 -54
  160. package/dist/db-NGDJV7YH.js +0 -26
  161. package/dist/discovery-DWVDM7UK.js +0 -44
  162. package/dist/experimental-P5FZM4CU.js +0 -12
  163. package/dist/oauth-callback-server-YFY7YEGK.js +0 -243
  164. package/dist/oauth-relay-5XPVRPYB.js +0 -8
  165. package/dist/plugins-YTYJMMJF.js +0 -14
  166. package/dist/runner-ORTNSB2Q.js +0 -522
  167. package/dist/sandbox-egress-signals-FIL7EGPR.js +0 -73
  168. package/dist/sentry-MB3NL3IR.js +0 -42
  169. package/dist/skills-H376WQOH.js +0 -27
  170. package/dist/spawn-T43WHLOS.js +0 -42
  171. package/dist/task-runner-LBZWF32V.js +0 -36
  172. package/dist/validation-REJLRKI6.js +0 -17
  173. package/dist/work-3KJ3RE76.js +0 -51
  174. package/dist/worker-QFEBU72E.js +0 -24
package/dist/app.d.ts CHANGED
@@ -1,520 +1,4 @@
1
- import { Hono } from 'hono';
2
- import { PluginRuntimePostinstallCommand, PluginRegistration, locationSchema, Source, Destination } from '@sentry/junior-plugin-api';
3
- import { StateAdapter } from 'chat';
4
- import { z } from 'zod';
5
- export { JUNIOR_VERSION } from './version.js';
6
-
7
- declare const TURN_REASONING_LEVELS: readonly ["none", "low", "medium", "high", "xhigh"];
8
- type TurnReasoningLevel = (typeof TURN_REASONING_LEVELS)[number];
9
-
10
- /** Runtime configuration for one named model profile. */
11
- interface ModelProfileConfig {
12
- /**
13
- * Tells models which tasks fit this profile.
14
- * Name concrete tasks. Add use and avoid cases when helpful.
15
- * Do not use model product names as the selection rule.
16
- */
17
- description?: string;
18
- modelId: string;
19
- reasoningLevel?: TurnReasoningLevel;
20
- }
21
- /** App-level profile input: a model id string or a full profile config. */
22
- type ModelProfileInput = string | ModelProfileConfig;
23
-
24
- interface BotModelConfig {
25
- /** Model used for embeddings. */
26
- embeddingModelId?: string;
27
- /** Model used for low-cost structured and utility calls. */
28
- fastModelId?: string;
29
- /** Model used to review sensitive tool calls. */
30
- guardianModelId?: string;
31
- /** Model used to generate images. */
32
- imageGenerationModelId?: string;
33
- /** Model used to analyze images. */
34
- visionModelId?: string;
35
- /** Model used for web search. */
36
- webSearchModelId?: string;
37
- }
38
-
39
- /**
40
- * Known unstable product features that must be opted into explicitly.
41
- * Add new keys here as features graduate from private experiments; remove them
42
- * once they become stable defaults.
43
- */
44
- declare const EXPERIMENTAL_FEATURES: readonly ["passive-routing", "subagents"];
45
- /** One known experimental feature name. */
46
- type ExperimentalFeature = (typeof EXPERIMENTAL_FEATURES)[number];
47
- /** App-level opt-ins for unstable product features. */
48
- type ExperimentalFeaturesConfig = Readonly<Partial<Record<ExperimentalFeature, boolean>>>;
49
-
50
- interface SandboxResourceConfig {
51
- vcpus?: number;
52
- }
53
-
54
- interface PluginOAuthConfig {
55
- clientIdEnv: string;
56
- clientSecretEnv: string;
57
- authorizeEndpoint: string;
58
- tokenEndpoint: string;
59
- scope?: string;
60
- /**
61
- * Set true when the provider returns an empty scope string even for authorized
62
- * grants (e.g. GitHub App user-to-server tokens always return `scope: ""`
63
- * regardless of what was requested). When enabled, an empty response scope
64
- * uses the configured `scope` value instead of being treated as
65
- * "no scopes granted".
66
- */
67
- treatEmptyScopeAsUnreported?: boolean;
68
- authorizeParams?: Record<string, string>;
69
- tokenAuthMethod?: "body" | "basic";
70
- tokenExtraHeaders?: Record<string, string>;
71
- }
72
- interface PluginEnvVarDeclaration {
73
- default?: string;
74
- exposeToCommandEnv?: boolean;
75
- }
76
- type PluginRuntimeDependencyConfig = {
77
- type: "npm";
78
- package: string;
79
- version?: string;
80
- } | {
81
- type: "system";
82
- package: string;
83
- } | {
84
- type: "system";
85
- url: string;
86
- sha256: string;
87
- };
88
- interface PluginOAuthConfigPatch extends Omit<Partial<PluginOAuthConfig>, "authorizeParams" | "tokenExtraHeaders"> {
89
- authorizeParams?: Record<string, string | null> | null;
90
- tokenExtraHeaders?: Record<string, string | null> | null;
91
- }
92
- type PluginCredentialConfigBase = {
93
- domains?: string[];
94
- authTokenEnv?: string;
95
- authTokenPlaceholder?: string | null;
96
- };
97
- type PluginCredentialConfig = PluginCredentialConfigBase & {
98
- apiHeaders?: Record<string, string | null> | null;
99
- type?: "oauth-bearer";
100
- };
101
- /** Install-level changes applied to one plugin manifest before validation. */
102
- interface PluginManifestConfig {
103
- displayName?: string;
104
- description?: string;
105
- configKeys?: string[];
106
- domains?: string[] | null;
107
- apiHeaders?: Record<string, string | null> | null;
108
- commandEnv?: Record<string, string | null> | null;
109
- envVars?: Record<string, PluginEnvVarDeclaration | null> | null;
110
- credentials?: PluginCredentialConfig | null;
111
- runtimeDependencies?: PluginRuntimeDependencyConfig[] | null;
112
- runtimePostinstall?: PluginRuntimePostinstallCommand[] | null;
113
- mcp?: {
114
- transport?: "http";
115
- url?: string;
116
- headers?: Record<string, string | null> | null;
117
- allowedTools?: string[] | null;
118
- wrappedTools?: string[] | null;
119
- } | null;
120
- oauth?: PluginOAuthConfigPatch | null;
121
- target?: {
122
- type?: string;
123
- configKey?: string;
124
- commandFlags?: string[] | null;
125
- } | null;
126
- }
127
-
128
- type JuniorPluginInput = PluginRegistration | string;
129
- interface JuniorPluginSetOptions {
130
- /** Install-level manifest overrides applied before validation. */
131
- manifests?: Record<string, PluginManifestConfig>;
132
- }
133
- /** Reusable plugin registrations and manifest overrides. */
134
- interface JuniorPluginSet {
135
- /** Install-level manifest overrides applied before validation. */
136
- manifests?: Record<string, PluginManifestConfig>;
137
- /** Manifest-only plugin packages included by package name. */
138
- packageNames: string[];
139
- /** JavaScript plugin definitions included by package factories. */
140
- registrations: PluginRegistration[];
141
- }
142
- /** Define package-name plugins and JS plugin definitions for one app. */
143
- declare function defineJuniorPlugins(inputs: JuniorPluginInput[], options?: JuniorPluginSetOptions): JuniorPluginSet;
144
-
145
- /** Validated Location associated with a Conversation. */
146
- type Location = z.output<typeof locationSchema>;
147
-
148
- /**
149
- * Canonical actor identity.
150
- *
151
- * Runtime actors are platform-scoped actors. Stored Slack actor parsing
152
- * remains explicit so durable conversation metadata is not repaired on read.
153
- */
154
-
155
- declare const storedSlackActorSchema: z.ZodObject<{
156
- email: z.ZodOptional<z.ZodString>;
157
- fullName: z.ZodOptional<z.ZodString>;
158
- platform: z.ZodOptional<z.ZodLiteral<"slack">>;
159
- slackUserId: z.ZodOptional<z.ZodString>;
160
- slackUserName: z.ZodOptional<z.ZodString>;
161
- teamId: z.ZodOptional<z.ZodString>;
162
- }, z.core.$strict>;
163
- type StoredSlackActor = z.output<typeof storedSlackActorSchema>;
164
-
165
- type ConversationPrivacy = "public" | "private";
166
-
167
- declare const usageSchema: z.ZodObject<{
168
- inputTokens: z.ZodOptional<z.ZodNumber>;
169
- outputTokens: z.ZodOptional<z.ZodNumber>;
170
- cachedInputTokens: z.ZodOptional<z.ZodNumber>;
171
- cacheCreationTokens: z.ZodOptional<z.ZodNumber>;
172
- reasoningTokens: z.ZodOptional<z.ZodNumber>;
173
- totalTokens: z.ZodOptional<z.ZodNumber>;
174
- cost: z.ZodOptional<z.ZodObject<{
175
- input: z.ZodOptional<z.ZodNumber>;
176
- output: z.ZodOptional<z.ZodNumber>;
177
- cacheRead: z.ZodOptional<z.ZodNumber>;
178
- cacheWrite: z.ZodOptional<z.ZodNumber>;
179
- total: z.ZodOptional<z.ZodNumber>;
180
- }, z.core.$strict>>;
181
- }, z.core.$strict>;
182
- type Usage = z.output<typeof usageSchema>;
183
-
184
- /**
185
- * Structured token and cost usage captured for a single agent turn.
186
- *
187
- * Mirrors the fields pi-ai emits on `AssistantMessage.usage` (see
188
- * `@earendil-works/pi-ai` `Usage`) so diagnostics carry every counter the
189
- * provider normalizes into the pi-ai shape as its own item. Renderers decide
190
- * whether to display a breakdown or a single aggregate.
191
- */
192
- type AgentTurnUsage = Usage;
193
-
194
- /** Legacy provider Source fields stored on a Conversation. */
195
- type SessionSource = Extract<Source, {
196
- kind: "web";
197
- }> | Extract<Source, {
198
- kind: "local";
199
- }> | Omit<Extract<Source, {
200
- kind: "slack";
201
- }>, "messageTs">;
202
-
203
- type ConversationSource = "api" | "internal" | "local" | "plugin" | "resource_event" | "scheduler" | "slack" | "web";
204
- type ConversationStatus = "paused" | "failed" | "idle" | "pending" | "running";
205
- interface ConversationExecution {
206
- lastCheckpointAtMs?: number;
207
- lastEnqueuedAtMs?: number;
208
- runId?: string;
209
- status: ConversationStatus;
210
- updatedAtMs?: number;
211
- }
212
- /**
213
- * Durable Conversation owned by Junior.
214
- *
215
- * The final interface stores zero or one complete Location here. No Location
216
- * means the Conversation stays in Junior's API and UI. A Location names the
217
- * outside place where a provider can deliver the Conversation. A Run carries
218
- * this Location when the agent or tools need it. Source stays about the input.
219
- * Delivery is created for the Location and allows output to be sent there.
220
- *
221
- * `destination` and `sessionSource` temporarily duplicate parts of that model.
222
- * Their field TODOs state when each legacy copy can be removed.
223
- */
224
- interface Conversation {
225
- channelName?: string;
226
- conversationId: string;
227
- createdAtMs: number;
228
- destination?: Destination;
229
- execution: ConversationExecution;
230
- executionMetrics?: {
231
- durationMs: number;
232
- runId?: string;
233
- usage?: AgentTurnUsage;
234
- };
235
- lastActivityAtMs: number;
236
- /** Immutable parent Conversation. */
237
- parentConversationId?: string;
238
- /** Optional provider coordinates associated with this Conversation. */
239
- location?: Location;
240
- actor?: StoredSlackActor;
241
- schemaVersion: 1;
242
- source?: ConversationSource;
243
- /**
244
- * Structured inbound Source locator for this conversation session.
245
- * Session-stable (threaded Slack keeps threadTs; channel-level turns omit
246
- * it; never stores per-message ts). Set-once.
247
- */
248
- sessionSource?: SessionSource;
249
- title?: string;
250
- updatedAtMs: number;
251
- /**
252
- * When retention purged this conversation's content. Set means messages and
253
- * events were deleted wholesale; reporting presents the transcript as expired
254
- * rather than privacy-redacted (`../../../../../policies/data-redaction.md`).
255
- */
256
- transcriptPurgedAtMs?: number;
257
- /** Confirmed Conversation visibility. Undefined means no confirmation exists. */
258
- visibility?: ConversationPrivacy;
259
- }
260
- /** Persist and read durable conversation metadata for reporting surfaces. */
261
- interface ConversationStore {
262
- /** Create one Conversation with an immutable parent. */
263
- createChild(args: {
264
- childConversationId: string;
265
- parentConversationId: string;
266
- nowMs?: number;
267
- source?: ConversationSource;
268
- }): Promise<void>;
269
- get(args: {
270
- conversationId: string;
271
- }): Promise<Conversation | undefined>;
272
- /** Resolve the durable conversation bound to one provider conversation. */
273
- getConversationIdByProviderConversation(args: {
274
- provider: string;
275
- providerDestinationId: string;
276
- providerTenantId: string;
277
- providerConversationId: string;
278
- }): Promise<string | undefined>;
279
- /** Bind one provider conversation to its pre-existing durable conversation. */
280
- bindProviderConversation(args: {
281
- conversationId: string;
282
- provider: string;
283
- providerDestinationId: string;
284
- providerTenantId: string;
285
- providerConversationId: string;
286
- }): Promise<void>;
287
- /** Read confirmed public/private visibility for one destination. */
288
- getDestinationVisibility(args: {
289
- provider: string;
290
- providerDestinationId: string;
291
- providerTenantId?: string;
292
- }): Promise<ConversationPrivacy | undefined>;
293
- /**
294
- * Resolve one Slack channel id from a known destination display name.
295
- *
296
- * Matches only destinations Junior already stored for this workspace. Exact
297
- * name match after stripping a leading `#`. Returns undefined when missing
298
- * or ambiguous. Does not scan Slack.
299
- */
300
- findSlackDestinationByName(args: {
301
- channelName: string;
302
- teamId: string;
303
- }): Promise<{
304
- channelId: string;
305
- channelName?: string;
306
- } | undefined>;
307
- recordActivity(args: {
308
- activityAtMs?: number;
309
- channelName?: string;
310
- conversationId: string;
311
- destination?: Destination;
312
- nowMs?: number;
313
- actor?: StoredSlackActor;
314
- source?: ConversationSource;
315
- /** Source normalized to a stable session locator; set-once when absent. */
316
- sessionSource?: Source;
317
- title?: string;
318
- /** Confirmed destination visibility; omit when unavailable. */
319
- visibility?: ConversationPrivacy;
320
- }): Promise<void>;
321
- /**
322
- * Materialize execution and usage aggregates beside canonical metadata.
323
- * These fields serve reporting and runtime control, never history hydration.
324
- */
325
- recordExecution(args: {
326
- channelName?: string;
327
- conversationId: string;
328
- createdAtMs: number;
329
- destination?: Destination;
330
- execution: ConversationExecution;
331
- lastActivityAtMs: number;
332
- metrics: {
333
- durationMs: number;
334
- usage?: AgentTurnUsage;
335
- } | null;
336
- actor?: StoredSlackActor;
337
- source?: ConversationSource;
338
- title?: string;
339
- updatedAtMs: number;
340
- /** Confirmed destination visibility; omit when unavailable. */
341
- visibility?: ConversationPrivacy;
342
- }): Promise<void>;
343
- listByActivity(args?: {
344
- limit?: number;
345
- offset?: number;
346
- }): Promise<Conversation[]>;
347
- }
348
-
349
- /** Validate the v2 conversation work hint sent through Vercel Queue. */
350
- declare const conversationQueueMessageSchema: z.ZodObject<{
351
- schemaVersion: z.ZodLiteral<2>;
352
- conversationId: z.ZodString;
353
- }, z.core.$strict>;
354
- /** Conversation work hint accepted by the queue callback and worker. */
355
- type ConversationQueueMessage = z.output<typeof conversationQueueMessageSchema>;
356
- interface ConversationQueueSendOptions {
357
- delayMs?: number;
358
- idempotencyKey?: string;
359
- }
360
- interface ConversationQueueSendResult {
361
- messageId?: string;
362
- }
363
- /**
364
- * External transport for wake-up hints. Durable work stays in the mailbox;
365
- * transports only need to accept one hint and may return a provider message id.
366
- */
367
- interface ConversationWorkQueue {
368
- send(message: ConversationQueueMessage, options?: ConversationQueueSendOptions): Promise<ConversationQueueSendResult | void>;
369
- }
370
-
371
- /** Canonical durable mailbox entry owned by task execution. */
372
- declare const inboundMessageSchema: z.ZodObject<{
373
- attemptCount: z.ZodOptional<z.ZodNumber>;
374
- conversationId: z.ZodString;
375
- createdAtMs: z.ZodNumber;
376
- delivery: z.ZodEnum<{
377
- defer: "defer";
378
- interrupt: "interrupt";
379
- }>;
380
- destination: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
381
- platform: z.ZodLiteral<"slack">;
382
- teamId: z.ZodString;
383
- channelId: z.ZodString;
384
- }, z.core.$strict>, z.ZodObject<{
385
- platform: z.ZodLiteral<"local">;
386
- conversationId: z.ZodString;
387
- }, z.core.$strict>], "platform">>;
388
- inboundMessageId: z.ZodString;
389
- injectedAtMs: z.ZodOptional<z.ZodNumber>;
390
- input: z.ZodObject<{
391
- attachments: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
392
- authorId: z.ZodOptional<z.ZodString>;
393
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
394
- text: z.ZodString;
395
- }, z.core.$strict>;
396
- receivedAtMs: z.ZodNumber;
397
- source: z.ZodEnum<{
398
- slack: "slack";
399
- api: "api";
400
- plugin: "plugin";
401
- local: "local";
402
- web: "web";
403
- resource_event: "resource_event";
404
- internal: "internal";
405
- scheduler: "scheduler";
406
- }>;
407
- }, z.core.$strict>;
408
- type InboundMessage = z.output<typeof inboundMessageSchema>;
409
-
410
- interface ConversationWorkerContext {
411
- attempt: InboxAttempt;
412
- checkIn(): Promise<boolean>;
413
- conversationId: string;
414
- destination?: Destination;
415
- /** True when the current execution slice must stop at its next safe boundary. */
416
- shouldYield(): boolean;
417
- /** Return an AbortSignal backed by the durable Conversation stop request. */
418
- stopSignal?(): AbortSignal;
419
- }
420
- interface InboxAttempt {
421
- ack(): Promise<void>;
422
- conversationId: string;
423
- destination?: Destination;
424
- drain(handle: (messages: InboundMessage[]) => Promise<readonly string[] | void>): Promise<InboundMessage[]>;
425
- isFinalAttempt: boolean;
426
- messages: InboundMessage[];
427
- }
428
- interface ConversationWorkerResult {
429
- /** `paused` waits for an external wake but must resume if a stop raced it. */
430
- status: "completed" | "deferred" | "lost_lease" | "paused" | "yielded";
431
- }
432
-
433
- interface ProcessConversationQueueMessageOptions {
434
- checkInIntervalMs?: number;
435
- conversationStore?: ConversationStore;
436
- nowMs?: () => number;
437
- queue?: ConversationWorkQueue;
438
- run(context: ConversationWorkerContext): Promise<ConversationWorkerResult>;
439
- softYieldAfterMs?: number;
440
- state?: StateAdapter;
441
- }
442
- interface VercelConversationWorkCallbackOptions extends ProcessConversationQueueMessageOptions {
443
- topic?: string;
444
- visibilityTimeoutSeconds?: number;
445
- }
446
-
447
- type ConversationWorkCallbackOptions = VercelConversationWorkCallbackOptions;
448
-
449
- /** Callback to schedule background work that must finish before the function exits. */
450
- type WaitUntilFn = (task: Promise<unknown> | (() => Promise<unknown>)) => void;
451
-
452
- interface JuniorAppOptions extends BotModelConfig {
453
- /** Authenticated dashboard mounted by core when configured. */
454
- dashboard?: JuniorDashboardOptions;
455
- /**
456
- * Opt into unstable product features. Experimental keys may change or be
457
- * removed without a stable migration path; leave unset in production unless
458
- * you are deliberately dogfooding a pre-stable surface.
459
- */
460
- experimental?: ExperimentalFeaturesConfig;
461
- /** Profile used for new conversations. Configure with `profiles`. */
462
- defaultProfile?: string;
463
- /**
464
- * Named profiles available to the router and `handoff` tool. Configure with
465
- * `defaultProfile`. Each value may be a model id string or an object with
466
- * `modelId` and optional `description` and `reasoningLevel` settings.
467
- */
468
- profiles?: Readonly<Record<string, ModelProfileInput>>;
469
- /** Slack-specific overrides applied after env parsing. */
470
- slack?: {
471
- /** Slack emoji shown while Junior is processing. Defaults to `eyes`. */
472
- processingReactionEmoji?: string;
473
- /** Slack emoji shown after a turn completes. Defaults to `white_check_mark`. */
474
- completedReactionEmoji?: string;
475
- };
476
- /** Install-wide provider defaults. Unregistered `provider.key` entries warn at startup. */
477
- configDefaults?: Record<string, unknown>;
478
- /** Queue consumer wiring for the durable conversation worker. */
479
- conversationWork?: ConversationWorkCallbackOptions;
480
- /** Direct plugin set override. Usually omitted when `juniorNitro()` uses a plugin module. */
481
- plugins?: JuniorPluginSet;
482
- /** Sandbox execution options. */
483
- sandbox?: SandboxResourceConfig & {
484
- /**
485
- * Egress domains allowed to carry Sentry trace propagation headers.
486
- * Entries may be exact domains or leading wildcard domains such as
487
- * `*.sentry.io`; wildcard entries match subdomains, not the apex domain.
488
- */
489
- egressTracePropagationDomains?: string[];
490
- };
491
- waitUntil?: WaitUntilFn;
492
- }
493
- interface JuniorDashboardOptions {
494
- /** Browser auth route prefix used by Better Auth. */
495
- authPath?: string;
496
- /** Require a dashboard browser session before serving dashboard pages and APIs. */
497
- authRequired?: boolean;
498
- /** Exact Google account emails allowed to open the dashboard. */
499
- allowedEmails?: string[];
500
- /** Google Workspace domains allowed to open the dashboard. */
501
- allowedGoogleDomains?: string[];
502
- /** Browser route prefix for the dashboard shell. */
503
- basePath?: string;
504
- /** Public deployment origin used for auth callbacks and external links. */
505
- baseURL?: string;
506
- /** Expose the config-gated component gallery for local visual QA. */
507
- componentGallery?: boolean;
508
- /** Disable dashboard route mounting while preserving serializable config shape. */
509
- disabled?: boolean;
510
- /** Replace Conversation route responses with dashboard visual-QA fixtures. */
511
- mockConversations?: boolean;
512
- /** Browser session lifetime in seconds. */
513
- sessionMaxAgeSeconds?: number;
514
- /** Additional trusted origins accepted by Better Auth. */
515
- trustedOrigins?: string[];
516
- }
517
- /** Create a Hono app with all Junior routes. */
518
- declare function createApp(options?: JuniorAppOptions): Promise<Hono>;
519
-
520
- export { type JuniorAppOptions, type JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };
1
+ import { i as ModelProfileInput, n as JuniorDashboardOptions, r as createApp, t as JuniorAppOptions } from "./app-Cb776lL8.js";
2
+ import { i as defineJuniorPlugins, n as JuniorPluginSet, r as JuniorPluginSetOptions, t as JuniorPluginInput } from "./plugins-BI9A1vKA.js";
3
+ import { t as JUNIOR_VERSION } from "./version-CnXZ614E.js";
4
+ export { JUNIOR_VERSION, JuniorAppOptions, JuniorDashboardOptions, type JuniorPluginInput, type JuniorPluginSet, type JuniorPluginSetOptions, type ModelProfileInput, createApp, defineJuniorPlugins };