@sentry/junior 0.202.0 → 0.204.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.
- package/dist/agent-CMyTD4DD.js +17509 -0
- package/dist/agent-hooks-Bbcp9e33.js +4040 -0
- package/dist/agent-runner-DNb1A49M.js +678 -0
- package/dist/api/schema.d.ts +2728 -2639
- package/dist/api/schema.js +4 -169
- package/dist/api.d.ts +23 -17
- package/dist/api.js +3881 -5326
- package/dist/app-B1TOqBI8.d.ts +246 -0
- package/dist/app.d.ts +4 -520
- package/dist/app.js +9522 -11875
- package/dist/auth-pause-state-DosEalIG.js +168 -0
- package/dist/catalog-runtime-BReos-D4.js +7 -0
- package/dist/checkpoint-CNrPyRJN.js +2450 -0
- package/dist/cli/chat.d.ts +20 -0
- package/dist/cli/chat.js +229 -336
- package/dist/cli/check.d.ts +8 -0
- package/dist/cli/check.js +513 -806
- package/dist/cli/env.d.ts +13 -0
- package/dist/cli/env.js +63 -12
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.js +90 -159
- package/dist/cli/main.d.ts +6 -0
- package/dist/cli/main.js +43 -64
- package/dist/cli/plugins.d.ts +13 -0
- package/dist/cli/plugins.js +148 -227
- package/dist/cli/run.d.ts +16 -0
- package/dist/cli/run.js +52 -8
- package/dist/cli/snapshot-create.d.ts +4 -0
- package/dist/cli/snapshot-create.js +71 -125
- package/dist/cli/upgrade.d.ts +15 -0
- package/dist/cli/upgrade.js +232 -335
- package/dist/config-nGCW1OTG.js +941 -0
- package/dist/context-B45_WqVX.js +298 -0
- package/dist/conversation-privacy-B4voFRSm.js +182 -0
- package/dist/conversation-work-C6y3T5Hx.js +51 -0
- package/dist/credential-sync-kXr1hvO1.js +2660 -0
- package/dist/db-BeyXKJOI.d.ts +5 -0
- package/dist/destinations-BeBiJeEM.js +29 -0
- package/dist/execution-stats-DWfSihcH.js +373 -0
- package/dist/executor-DcMSlI5c.js +721 -0
- package/dist/experimental-CIXf7Uye.js +46 -0
- package/dist/history-ClE4toxe.d.ts +32 -0
- package/dist/history-CqTuSAdI.js +441 -0
- package/dist/instrumentation.d.ts +3 -3
- package/dist/instrumentation.js +130 -176
- package/dist/job-queue-Drn_LXlM.js +63 -0
- package/dist/logging-BzAk1S_s.js +1210 -0
- package/dist/model-profile-CZmVoGdX.js +49 -0
- package/dist/nitro.d.ts +31 -36
- package/dist/nitro.js +275 -456
- package/dist/oauth-callback-server-JiftokvA.js +130 -0
- package/dist/oauth-relay-CdCnu80W.js +62 -0
- package/dist/package-discovery-7a9YqLhE.js +455 -0
- package/dist/pending-auth-CWmSdZVg.js +185 -0
- package/dist/plugin-module-BKGOXca2.js +81 -0
- package/dist/plugins-BI9A1vKA.d.ts +95 -0
- package/dist/plugins-egKWjgue.js +99 -0
- package/dist/private-trace-result-BLvBjy_e.js +16 -0
- package/dist/profile-CrT5nXbw.js +861 -0
- package/dist/registry-DH1xUo2N.js +1419 -0
- package/dist/reporting-schema-DosTN__Q.js +105 -0
- package/dist/resolve-CZHnfxaS.js +546 -0
- package/dist/rolldown-runtime-B4FMCO8f.js +28 -0
- package/dist/runner-CZV2sC46.js +392 -0
- package/dist/sandbox-egress-signals-bHZfmhbd.js +46 -0
- package/dist/schema-Rn8-XEaN.js +1140 -0
- package/dist/sentry-CD3SdJl-.js +26 -0
- package/dist/skills-CIcDQSgM.js +316 -0
- package/dist/spawn-DdkUFRmq.js +29 -0
- package/dist/stats-DTUbAb88.js +2634 -0
- package/dist/store-C5qxF2ac.d.ts +208 -0
- package/dist/task-queue-CJIR4RF7.js +136 -0
- package/dist/task-runner-D-O3A-Cp.js +639 -0
- package/dist/thread-state-CRc9jTJS.js +431 -0
- package/dist/turn-execution-BkinIdJF.js +47 -0
- package/dist/turn-lifecycle-DQV19VTW.js +54 -0
- package/dist/usage-D3EbSO7w.js +296 -0
- package/dist/usage-schema-CKaDkH_j.js +20 -0
- package/dist/validation-C2CR-OX3.js +40 -0
- package/dist/vercel-queue-DIkVcfK4.js +167 -0
- package/dist/vercel.d.ts +6 -6
- package/dist/vercel.js +14 -6
- package/dist/version-CnXZ614E.d.ts +5 -0
- package/dist/version-DxcWdoKa.js +8 -0
- package/dist/version.d.ts +2 -4
- package/dist/version.js +2 -6
- package/dist/web-authorization-RMBxAR_t.js +76 -0
- package/dist/web-input-3EPfpf55.js +494 -0
- package/dist/work-fGofI7Op.js +509 -0
- package/dist/worker-CsOLq-mR.js +625 -0
- package/package.json +9 -9
- package/dist/agent-hooks-UXITLYOK.js +0 -51
- package/dist/catalog-runtime-BG3JLLK2.js +0 -14
- package/dist/chunk-2LYHWMR4.js +0 -46
- package/dist/chunk-2MK3QBGA.js +0 -321
- package/dist/chunk-3PGQSKJV.js +0 -692
- package/dist/chunk-3UI3WFTX.js +0 -519
- package/dist/chunk-3Y47VMHV.js +0 -6
- package/dist/chunk-4UO6FK4G.js +0 -64
- package/dist/chunk-5NOPO64K.js +0 -198
- package/dist/chunk-5PKWYPFT.js +0 -2943
- package/dist/chunk-63NKKFJL.js +0 -1228
- package/dist/chunk-6AYH6252.js +0 -787
- package/dist/chunk-6Y5B5PEX.js +0 -80
- package/dist/chunk-7DHZP5KJ.js +0 -333
- package/dist/chunk-7H2VZTWN.js +0 -103
- package/dist/chunk-7NL7T6VU.js +0 -406
- package/dist/chunk-A76OIMYN.js +0 -102
- package/dist/chunk-AWMS3SPP.js +0 -58
- package/dist/chunk-B3LY5RCL.js +0 -229
- package/dist/chunk-BD2KT3OB.js +0 -36
- package/dist/chunk-BXCX5QKA.js +0 -2086
- package/dist/chunk-C6VVF43U.js +0 -81
- package/dist/chunk-CEMMLV5L.js +0 -98
- package/dist/chunk-CM5HNV2W.js +0 -131
- package/dist/chunk-DA2KGZZI.js +0 -13
- package/dist/chunk-DBVY6HLX.js +0 -64
- package/dist/chunk-DIB4GX3G.js +0 -8
- package/dist/chunk-DKIJ2RP5.js +0 -68
- package/dist/chunk-DL2KLKVH.js +0 -931
- package/dist/chunk-DWPN6SCH.js +0 -172
- package/dist/chunk-ELWOYVOY.js +0 -206
- package/dist/chunk-EWT7H65X.js +0 -506
- package/dist/chunk-FA6POGLH.js +0 -70
- package/dist/chunk-HMREVIO2.js +0 -135
- package/dist/chunk-IIWUT4FO.js +0 -820
- package/dist/chunk-JAL3CH4G.js +0 -27
- package/dist/chunk-JSJQEWBJ.js +0 -3295
- package/dist/chunk-KHKKHDLD.js +0 -387
- package/dist/chunk-LA6R4A7Q.js +0 -706
- package/dist/chunk-LOOU2DUR.js +0 -20428
- package/dist/chunk-M6FHWXE3.js +0 -700
- package/dist/chunk-M76HMB7M.js +0 -1856
- package/dist/chunk-MAGNK5J4.js +0 -1520
- package/dist/chunk-MTM5IFCY.js +0 -1190
- package/dist/chunk-N7TMSOZH.js +0 -235
- package/dist/chunk-NHJU2ZAL.js +0 -56
- package/dist/chunk-NSXKRGRT.js +0 -717
- package/dist/chunk-OWMPFXJA.js +0 -1764
- package/dist/chunk-PDO5BLNM.js +0 -22
- package/dist/chunk-PEQXYSSE.js +0 -45
- package/dist/chunk-PW4P4JYF.js +0 -1135
- package/dist/chunk-QB54UQUS.js +0 -320
- package/dist/chunk-QP3OGJXF.js +0 -105
- package/dist/chunk-RC745GGZ.js +0 -122
- package/dist/chunk-REOIRYPR.js +0 -37
- package/dist/chunk-SCOZRLZ4.js +0 -164
- package/dist/chunk-TXJSXBV5.js +0 -1433
- package/dist/chunk-TXKUKMVO.js +0 -417
- package/dist/chunk-U2GPUYAL.js +0 -3656
- package/dist/chunk-UIE3R5XU.js +0 -17
- package/dist/chunk-UXPG6ZIN.js +0 -84
- package/dist/chunk-VFUK3X5B.js +0 -50
- package/dist/chunk-WQSHDTTI.js +0 -1163
- package/dist/chunk-X6GDDWQH.js +0 -60
- package/dist/chunk-Y2CM7HXH.js +0 -111
- package/dist/chunk-Y7X25LFY.js +0 -15
- package/dist/chunk-YDUR3ZYW.js +0 -10
- package/dist/conversation-work-VIOQ5ZF3.js +0 -54
- package/dist/db-3L2MCVRI.js +0 -26
- package/dist/discovery-DWVDM7UK.js +0 -44
- package/dist/experimental-P5FZM4CU.js +0 -12
- package/dist/oauth-callback-server-YVV6C6T2.js +0 -243
- package/dist/oauth-relay-5XPVRPYB.js +0 -8
- package/dist/plugins-YTYJMMJF.js +0 -14
- package/dist/runner-LQ7RETDP.js +0 -522
- package/dist/sandbox-egress-signals-FIL7EGPR.js +0 -73
- package/dist/sentry-MB3NL3IR.js +0 -42
- package/dist/skills-XRWYEDCD.js +0 -27
- package/dist/spawn-RC6SJUAI.js +0 -42
- package/dist/task-runner-7DY7ARYH.js +0 -36
- package/dist/validation-7MNQGCJA.js +0 -17
- package/dist/work-COALHUCG.js +0 -51
- package/dist/worker-6MURZIPD.js +0 -24
package/dist/app.d.ts
CHANGED
|
@@ -1,520 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
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-B1TOqBI8.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 };
|