@sentry/junior 0.245.0 → 0.247.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/{admin-BEbNsG87.js → admin-BGwaqDMs.js} +1 -1
- package/dist/{agent-hooks-Caa0Qh_Q.js → agent-hooks-C72ByH0C.js} +11 -11
- package/dist/{agent-invocations-BO6ddZax.js → agent-invocations-D_YoNnAn.js} +8 -2
- package/dist/{agent-runner-BEuPFbbv.js → agent-runner-DsAFAKKs.js} +822 -2524
- package/dist/api/schema.d.ts +23 -1
- package/dist/api/schema.js +3 -3
- package/dist/api.js +82 -21
- package/dist/{app-BYB7szGb.d.ts → app-4t4mPTdS.d.ts} +8 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +37 -68
- package/dist/assistant-reply-ChOzcTBS.js +45 -0
- package/dist/{briefs-DFAh_jTW.js → briefs-Dc7qZrhc.js} +4 -4
- package/dist/{catalog-runtime-wmq_fqff.js → catalog-runtime-DS1k7fUG.js} +1 -1
- package/dist/cli/chat.js +25 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-Bn9SRFCi.js → client-BVnfNd3D.js} +2 -2
- package/dist/{config-_XAINZMN.js → config-CgWvImQL.js} +2 -2
- package/dist/{conversation-CvBG57Io.js → conversation-CYsbVFLx.js} +71 -1
- package/dist/{conversation-privacy-BN5SGxsF.js → conversation-privacy-D3TdVM9H.js} +1 -1
- package/dist/{credential-sync-BvaUm6HQ.js → credential-sync-DLw3jkv-.js} +14 -14
- package/dist/{executor-CFIqoCNJ.js → executor-DQazjeGA.js} +3 -3
- package/dist/{images-Ci43I3ek.js → images-C3e5E-p_.js} +4 -21
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-CGicV7x6.js → job-queue-BEUqRhjC.js} +1 -1
- package/dist/{logging-Bs3dV81s.js → logging-CZEc8_v4.js} +1 -1
- package/dist/message-BIJa7lKh.js +59 -0
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-authorization-COzWmMjO.js → oauth-authorization-BA4Dt6a7.js} +1 -45
- package/dist/{oauth-callback-server-17c9_39v.js → oauth-callback-server-R9OSdLP1.js} +2 -2
- package/dist/{pending-auth-Bnhg7Q9k.js → pending-auth-Oo5AQhaf.js} +2 -2
- package/dist/{profile-BA471c-l.js → profile-aVLDAirh.js} +4 -4
- package/dist/{prompt-C9Q9cjD3.js → prompt-ZG1UCxjF.js} +1 -1
- package/dist/{registry-BYNOFO6e.js → registry-CtaDOOM5.js} +1 -1
- package/dist/{resolve-rpz8No2i.js → resolve-Bdw4hu7s.js} +2 -2
- package/dist/result-DNgmkASh.js +463 -0
- package/dist/{runner-C8DRk9X6.js → runner-BUSScEu5.js} +11 -10
- package/dist/{sandbox-egress-signals-B8hurjFt.js → sandbox-egress-signals-E9r8bf9G.js} +1 -1
- package/dist/{schema-WRgR9EL6.js → schema-tyd6hALh.js} +23 -3
- package/dist/session-stop-CAhBfBUT.js +782 -0
- package/dist/{skills-C4yrD2NR.js → skills-DQy-mmBC.js} +2 -2
- package/dist/{spawn-CdAaTXrY.js → spawn-DQ_MVWZ6.js} +3 -2
- package/dist/store-DjLA8GKs.js +1417 -0
- package/dist/{task-queue-BBxHzlIB.js → task-queue-BT2h_t8I.js} +3 -3
- package/dist/{task-runner-BqFapTjs.js → task-runner-CiPepjIB.js} +11 -11
- package/dist/{tasks-Ddd7OAkp.js → tasks-DMmRrIVl.js} +9 -9
- package/dist/{thread-state-DqErwbA8.js → thread-state-ehZYGpX9.js} +7 -7
- package/dist/{turn-failure-response-DtL1-fOl.js → turn-failure-response-D7J10z7l.js} +9 -9
- package/dist/{turn-lifecycle-B5pzyD6W.js → turn-lifecycle-Buswqs90.js} +1 -1
- package/dist/{turn-session-routing-D6pTU5uF.js → turn-session-routing-Bw-yiSb4.js} +1 -1
- package/dist/{validation-BAzlyNIc.js → validation-DTguegIe.js} +1 -1
- package/dist/{version-CiXDH3oe.js → version-BrZSE5du.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-wCn8xneI.js → viewer-BlAozHer.js} +4 -4
- package/dist/{web-authorization-d5MtGpfG.js → web-authorization-DwyTlkAg.js} +6 -6
- package/dist/{web-input-BZTiCtvP.js → web-input-DSYxI7Wi.js} +77 -378
- package/dist/{work-4QPqTd5_.js → work-CRBXkJoU.js} +96 -13
- package/dist/{worker-mc62tybz.js → worker-BVJKM9Ja.js} +7 -7
- package/migrations/0053_conversation_stopped_at.sql +1 -0
- package/migrations/0054_flowery_rage.sql +1 -0
- package/migrations/meta/0053_snapshot.json +3771 -0
- package/migrations/meta/0054_snapshot.json +3777 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +5 -4
package/dist/cli/main.js
CHANGED
|
@@ -25,10 +25,10 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runAdmin(argv) {
|
|
28
|
-
return await (await import("../admin-
|
|
28
|
+
return await (await import("../admin-BGwaqDMs.js")).runAdmin(argv);
|
|
29
29
|
}
|
|
30
30
|
async function runBriefs(argv) {
|
|
31
|
-
return await (await import("../briefs-
|
|
31
|
+
return await (await import("../briefs-Dc7qZrhc.js")).runBriefs(argv);
|
|
32
32
|
}
|
|
33
33
|
function topLevelCommand(argv) {
|
|
34
34
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as getDb } from "../viewer-
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { d as setPlugins, f as validatePlugins, lt as createPluginLogger } from "../agent-hooks-
|
|
4
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { d as getDb } from "../viewer-BlAozHer.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-DS1k7fUG.js";
|
|
3
|
+
import { d as setPlugins, f as validatePlugins, lt as createPluginLogger } from "../agent-hooks-C72ByH0C.js";
|
|
4
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-DTguegIe.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
6
6
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
7
7
|
import { stderr, stdout } from "node:process";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
2
|
-
import { S as disconnectStateAdapter, t as create } from "../profile-
|
|
3
|
-
import { r as resolve } from "../resolve-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-DS1k7fUG.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-aVLDAirh.js";
|
|
3
|
+
import { r as resolve } from "../resolve-Bdw4hu7s.js";
|
|
4
4
|
//#region src/cli/snapshot-create.ts
|
|
5
5
|
const DEFAULT_RUNTIME = "node22";
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 6e5;
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-CgWvImQL.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-DQazjeGA.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-CtaDOOM5.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-CZEc8_v4.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-D3TdVM9H.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-
|
|
3
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-BVnfNd3D.js";
|
|
3
|
+
import { p as logWarn } from "./logging-CZEc8_v4.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-BwU8mqwD.js";
|
|
5
5
|
//#region src/chat/slack/emoji.ts
|
|
6
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
@@ -219,6 +219,76 @@ const INPUT_IMAGE_TYPES = [
|
|
|
219
219
|
"image/gif",
|
|
220
220
|
"image/webp"
|
|
221
221
|
];
|
|
222
|
+
/** Leading bytes of each accepted image type. `null` matches any byte. */
|
|
223
|
+
const IMAGE_SIGNATURES = [
|
|
224
|
+
{
|
|
225
|
+
mediaType: "image/png",
|
|
226
|
+
bytes: [
|
|
227
|
+
137,
|
|
228
|
+
80,
|
|
229
|
+
78,
|
|
230
|
+
71,
|
|
231
|
+
13,
|
|
232
|
+
10,
|
|
233
|
+
26,
|
|
234
|
+
10
|
|
235
|
+
]
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
mediaType: "image/jpeg",
|
|
239
|
+
bytes: [
|
|
240
|
+
255,
|
|
241
|
+
216,
|
|
242
|
+
255
|
|
243
|
+
]
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
mediaType: "image/gif",
|
|
247
|
+
bytes: [
|
|
248
|
+
71,
|
|
249
|
+
73,
|
|
250
|
+
70,
|
|
251
|
+
56,
|
|
252
|
+
55,
|
|
253
|
+
97
|
|
254
|
+
]
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
mediaType: "image/gif",
|
|
258
|
+
bytes: [
|
|
259
|
+
71,
|
|
260
|
+
73,
|
|
261
|
+
70,
|
|
262
|
+
56,
|
|
263
|
+
57,
|
|
264
|
+
97
|
|
265
|
+
]
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
mediaType: "image/webp",
|
|
269
|
+
bytes: [
|
|
270
|
+
82,
|
|
271
|
+
73,
|
|
272
|
+
70,
|
|
273
|
+
70,
|
|
274
|
+
null,
|
|
275
|
+
null,
|
|
276
|
+
null,
|
|
277
|
+
null,
|
|
278
|
+
87,
|
|
279
|
+
69,
|
|
280
|
+
66,
|
|
281
|
+
80
|
|
282
|
+
]
|
|
283
|
+
}
|
|
284
|
+
];
|
|
285
|
+
/**
|
|
286
|
+
* Detect an accepted image type from file bytes. Use this instead of a file
|
|
287
|
+
* name or declared content type, which can be wrong.
|
|
288
|
+
*/
|
|
289
|
+
function detectImageMediaType(data) {
|
|
290
|
+
return IMAGE_SIGNATURES.find(({ bytes }) => data.length >= bytes.length && bytes.every((byte, index) => byte === null || data[index] === byte))?.mediaType;
|
|
291
|
+
}
|
|
222
292
|
/** Report whether a media type is a raster image accepted by vision models. */
|
|
223
293
|
function isVisionImageMediaType(mediaType) {
|
|
224
294
|
const normalized = mediaType.split(";", 1)[0]?.trim().toLowerCase();
|
|
@@ -868,4 +938,4 @@ const conversationStatsReportSchema = z.object({
|
|
|
868
938
|
windowStart: z.string()
|
|
869
939
|
}).strict();
|
|
870
940
|
//#endregion
|
|
871
|
-
export { forkConversationBodySchema as A,
|
|
941
|
+
export { forkConversationBodySchema as A, briefOutcomeStatusSchema as B, conversationReportEventSchema as C, conversationUsageSchema as D, conversationSummaryReportSchema as E, INPUT_IMAGE_TYPES as F, messageCardText as G, parseBriefInput as H, detectImageMediaType as I, resolveMessageCards as J, readMessageCardRefs as K, isVisionImageMediaType as L, MAX_INPUT_IMAGES as M, MAX_INPUT_IMAGE_BYTES as N, createConversationBodySchema as O, readMessageAttachments as P, briefCodeChangeSchema as R, conversationReportEventDataSchema as S, conversationStatsReportSchema as T, annotationCard as U, conversationBriefSchema as V, messageCardRef as W, conversationParamsSchema as _, cancelConversationPendingMessagesBodySchema as a, conversationPendingMessageSchema as b, conversationAttachmentParamsSchema as c, conversationDetailReportSchema as d, conversationEventHistorySchema as f, conversationFeedSchema as g, conversationFeedQuerySchema as h, archiveConversationResponseSchema as i, forkConversationResponseSchema as j, createConversationMessageBodySchema as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, removedCardSchema as q, archiveConversationBodySchema as r, conversationActivityPreviewSchema as s, acceptedConversationMessageSchema as t, conversationDetailQuerySchema as u, conversationPendingAuthorizationSchema as v, conversationStatsItemSchema as w, conversationPendingMessagesReportSchema as x, conversationPendingMessageDeliverySchema as y, briefLinkSchema as z };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { f as escapeXml } from "./client-
|
|
3
|
-
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-
|
|
4
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
1
|
+
import { Ft as createUserTokenStore, Mt as parseOAuthStatePayload, Nt as resolveBaseUrl, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, jt as formatProviderLabel, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, yt as getMcpProviderErrorAttributes } from "./agent-runner-DsAFAKKs.js";
|
|
2
|
+
import { f as escapeXml } from "./client-BVnfNd3D.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-CZEc8_v4.js";
|
|
4
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-CgWvImQL.js";
|
|
5
5
|
import { f as parseSlackUserId } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-
|
|
6
|
+
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-BlAozHer.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-BVvSnQBB.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { Nt as recordAuthenticationLinked, Pt as recordAuthorizationCompleted, Q as getTurnRecord, V as postSlackMessage } from "./tasks-
|
|
12
|
-
import { zt as getSlackClient } from "./agent-hooks-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { i as getConversationPendingAuth } from "./pending-auth-
|
|
15
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
16
|
-
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CtaDOOM5.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DS1k7fUG.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-DQy-mmBC.js";
|
|
11
|
+
import { Nt as recordAuthenticationLinked, Pt as recordAuthorizationCompleted, Q as getTurnRecord, V as postSlackMessage } from "./tasks-DMmRrIVl.js";
|
|
12
|
+
import { zt as getSlackClient } from "./agent-hooks-C72ByH0C.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-aVLDAirh.js";
|
|
14
|
+
import { i as getConversationPendingAuth } from "./pending-auth-Oo5AQhaf.js";
|
|
15
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-ehZYGpX9.js";
|
|
16
|
+
import { n as deleteWebAuthorization, o as wakeAuthorizedTurn, s as wakePausedTurn } from "./web-authorization-DwyTlkAg.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { z } from "zod";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { d as logException } from "./logging-
|
|
1
|
+
import { d as logException } from "./logging-CZEc8_v4.js";
|
|
2
2
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import "./config-
|
|
4
|
-
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-
|
|
3
|
+
import "./config-CgWvImQL.js";
|
|
4
|
+
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { sql } from "drizzle-orm";
|
|
7
7
|
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-
|
|
3
|
-
import { f as getSqlExecutor } from "./viewer-
|
|
4
|
-
import "./conversation-
|
|
2
|
+
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-DsAFAKKs.js";
|
|
3
|
+
import { f as getSqlExecutor } from "./viewer-BlAozHer.js";
|
|
4
|
+
import { I as detectImageMediaType } from "./conversation-CYsbVFLx.js";
|
|
5
5
|
//#region src/chat/attachments/images.ts
|
|
6
6
|
var images_exports = /* @__PURE__ */ __exportAll({
|
|
7
7
|
decodeInputImages: () => decodeInputImages,
|
|
8
8
|
loadInputImages: () => loadInputImages,
|
|
9
9
|
storeInputImages: () => storeInputImages
|
|
10
10
|
});
|
|
11
|
-
function matchesImageType(data, contentType) {
|
|
12
|
-
switch (contentType) {
|
|
13
|
-
case "image/png": return data.subarray(0, 8).equals(Buffer.from([
|
|
14
|
-
137,
|
|
15
|
-
80,
|
|
16
|
-
78,
|
|
17
|
-
71,
|
|
18
|
-
13,
|
|
19
|
-
10,
|
|
20
|
-
26,
|
|
21
|
-
10
|
|
22
|
-
]));
|
|
23
|
-
case "image/jpeg": return data[0] === 255 && data[1] === 216 && data[2] === 255;
|
|
24
|
-
case "image/gif": return ["GIF87a", "GIF89a"].includes(data.toString("ascii", 0, 6));
|
|
25
|
-
case "image/webp": return data.toString("ascii", 0, 4) === "RIFF" && data.toString("ascii", 8, 12) === "WEBP";
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
11
|
/** Check declared image types against file signatures before storing uploads. */
|
|
29
12
|
function decodeInputImages(images) {
|
|
30
13
|
const files = images.map((image) => {
|
|
31
14
|
const data = Buffer.from(image.data, "base64");
|
|
32
|
-
if (
|
|
15
|
+
if (detectImageMediaType(data) !== image.contentType || data.toString("base64") !== image.data) throw new Error("Use PNG, JPEG, GIF, or WebP image files.");
|
|
33
16
|
return {
|
|
34
17
|
data,
|
|
35
18
|
bytes: data.byteLength,
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-CZEc8_v4.js";
|
|
2
2
|
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-D3TdVM9H.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { i as getChatConfig } from "./config-CgWvImQL.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-BrZSE5du.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { styleText } from "node:util";
|
|
5
5
|
import { ConfigError, configureSync, getConfig, getLogger } from "@logtape/logtape";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
+
import { Bt as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET, zt as actorFromRun } from "./agent-runner-DsAFAKKs.js";
|
|
3
|
+
import { n as enqueueAgentMessageToParent } from "./result-DNgmkASh.js";
|
|
4
|
+
import { r as enqueueAgentInvocation } from "./work-CRBXkJoU.js";
|
|
5
|
+
//#region src/chat/agent-invocations/message.ts
|
|
6
|
+
var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
|
|
7
|
+
/**
|
|
8
|
+
* Bind a Run's Actor and credentials to messages for its parent and child
|
|
9
|
+
* agents. A message to a child continues that child. A message to the parent
|
|
10
|
+
* wakes the parent like a result.
|
|
11
|
+
*/
|
|
12
|
+
function bindMessageAgent(run, options) {
|
|
13
|
+
const actor = actorFromRun(run);
|
|
14
|
+
if (!actor) return;
|
|
15
|
+
return async (input, call) => {
|
|
16
|
+
call.signal?.throwIfAborted();
|
|
17
|
+
const queue = typeof options.queue === "function" ? options.queue() : options.queue;
|
|
18
|
+
if (input.to === "parent") {
|
|
19
|
+
const sender = await getActiveAgentInvocationForConversation(run.conversationId);
|
|
20
|
+
if (!sender) throw new AgentMessageTargetError("This conversation has no parent agent");
|
|
21
|
+
await enqueueAgentMessageToParent({
|
|
22
|
+
messageKey: `${run.turnId}:${call.toolCallId}`,
|
|
23
|
+
queue,
|
|
24
|
+
sender,
|
|
25
|
+
state: options.state,
|
|
26
|
+
text: input.text
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
conversationId: sender.parentConversationId,
|
|
30
|
+
delivery: "queued"
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const childConversationId = await findChildAgentConversationId({
|
|
34
|
+
parentConversationId: run.conversationId,
|
|
35
|
+
target: input.to
|
|
36
|
+
});
|
|
37
|
+
if (!childConversationId) throw new AgentMessageTargetError(`"${input.to}" is not "${PARENT_AGENT_TARGET}" or a child agent of this conversation`);
|
|
38
|
+
const { invocation, queued } = await createAgentInvocationForMessage({
|
|
39
|
+
actor,
|
|
40
|
+
childConversationId,
|
|
41
|
+
...run.credentialContext ? { credentialContext: run.credentialContext } : void 0,
|
|
42
|
+
destination: toolInvocationDestination(run),
|
|
43
|
+
idempotencyKey: `${run.turnId}:${call.toolCallId}`,
|
|
44
|
+
input: input.text,
|
|
45
|
+
parentConversationId: run.conversationId,
|
|
46
|
+
parentToolCallId: call.toolCallId
|
|
47
|
+
});
|
|
48
|
+
await enqueueAgentInvocation(invocation, {
|
|
49
|
+
...options,
|
|
50
|
+
queue
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
conversationId: childConversationId,
|
|
54
|
+
delivery: queued ? "queued" : "started"
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { message_exports as n, bindMessageAgent as t };
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { r as JuniorDashboardOptions } from "./app-4t4mPTdS.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-CjfUP5gJ.js";
|
|
3
3
|
//#region src/nitro.d.ts
|
|
4
4
|
export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
|
package/dist/nitro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-CZEc8_v4.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-BVvSnQBB.js";
|
|
3
|
-
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
3
|
+
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-BEUqRhjC.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
5
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BT2h_t8I.js";
|
|
6
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-CVvEUSMH.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ot as extractAssistantText } from "./tasks-Ddd7OAkp.js";
|
|
2
1
|
//#region src/chat/runtime/turn.ts
|
|
3
2
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
4
3
|
var ConversationTurnBoundaryError = class extends Error {
|
|
@@ -91,53 +90,10 @@ function markTurnFailed(args) {
|
|
|
91
90
|
});
|
|
92
91
|
}
|
|
93
92
|
//#endregion
|
|
94
|
-
//#region src/chat/no-reply.ts
|
|
95
|
-
const NO_REPLY_MARKER = "[[NO_REPLY]]";
|
|
96
|
-
/**
|
|
97
|
-
* True when one assistant message ends with the silence marker.
|
|
98
|
-
* Mid-sentence mentions do not match. Detection is per message only.
|
|
99
|
-
*/
|
|
100
|
-
function isNoReplyMarker(text) {
|
|
101
|
-
return text.trimEnd().endsWith(NO_REPLY_MARKER);
|
|
102
|
-
}
|
|
103
|
-
//#endregion
|
|
104
|
-
//#region src/chat/services/assistant-reply.ts
|
|
105
|
-
const THINKING_XML_BLOCK_PATTERN = /[ \t]*<thinking\b[^>]*>[\s\S]*?<\/thinking>[ \t]*(?:\r?\n)?/gi;
|
|
106
|
-
const FENCED_CODE_BLOCK_PATTERN = /```[\s\S]*?```/g;
|
|
107
|
-
/** Remove provider reasoning wrappers while preserving fenced code examples. */
|
|
108
|
-
function sanitizeAssistantText(text) {
|
|
109
|
-
let result = "";
|
|
110
|
-
let cursor = 0;
|
|
111
|
-
for (const match of text.matchAll(FENCED_CODE_BLOCK_PATTERN)) {
|
|
112
|
-
const start = match.index;
|
|
113
|
-
if (start === void 0) continue;
|
|
114
|
-
result += text.slice(cursor, start).replace(THINKING_XML_BLOCK_PATTERN, "");
|
|
115
|
-
result += match[0];
|
|
116
|
-
cursor = start + match[0].length;
|
|
117
|
-
}
|
|
118
|
-
return (result + text.slice(cursor).replace(THINKING_XML_BLOCK_PATTERN, "")).trim();
|
|
119
|
-
}
|
|
120
|
-
/** Decide whether one completed assistant message becomes a reply. */
|
|
121
|
-
function decideReply(message) {
|
|
122
|
-
if (message.content.some((part) => part.type === "toolCall")) return { kind: "suppress" };
|
|
123
|
-
const text = sanitizeAssistantText(extractAssistantText(message));
|
|
124
|
-
if (!text) return { kind: "empty" };
|
|
125
|
-
if (isNoReplyMarker(text)) return { kind: "suppress" };
|
|
126
|
-
return {
|
|
127
|
-
kind: "deliver",
|
|
128
|
-
text
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
/** Return destination-visible reply text when the message is deliverable. */
|
|
132
|
-
function getAssistantReplyText(message) {
|
|
133
|
-
const decision = decideReply(message);
|
|
134
|
-
return decision.kind === "deliver" ? decision.text : void 0;
|
|
135
|
-
}
|
|
136
|
-
//#endregion
|
|
137
93
|
//#region src/chat/oauth-authorization.ts
|
|
138
94
|
/** Build the stable event identity shared by authorization request and completion. */
|
|
139
95
|
function authorizationId(args) {
|
|
140
96
|
return `${args.sessionId}:${args.kind}:${args.provider}`;
|
|
141
97
|
}
|
|
142
98
|
//#endregion
|
|
143
|
-
export {
|
|
99
|
+
export { TurnInputDeferredError as a, isTurnInputCommitLostError as c, markTurnCompleted as d, markTurnFailed as f, TurnInputCommitLostError as i, isTurnInputDeferredError as l, ConversationTurnBoundaryError as n, getConversationTurnBoundaryError as o, startActiveTurn as p, CooperativeTurnYieldError as r, isCooperativeTurnYieldError as s, authorizationId as t, markTurnClosed as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Ft as createUserTokenStore } from "./agent-runner-DsAFAKKs.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DLw3jkv-.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
//#region src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as isProviderRetryError } from "./client-
|
|
2
|
-
import { Y as abandonTurnRecord, sn as estimateTextTokens } from "./tasks-
|
|
1
|
+
import { v as isProviderRetryError } from "./client-BVnfNd3D.js";
|
|
2
|
+
import { Y as abandonTurnRecord, sn as estimateTextTokens } from "./tasks-DMmRrIVl.js";
|
|
3
3
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/chat/state/turn-id.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { S as toOptionalTrimmed } from "./client-BVnfNd3D.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-CZEc8_v4.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-CgWvImQL.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-DS1k7fUG.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
7
7
|
import { createRedisState } from "@chat-adapter/state-redis";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as
|
|
1
|
+
import { B as briefOutcomeStatusSchema, H as parseBriefInput, V as conversationBriefSchema } from "./conversation-CYsbVFLx.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/chat/briefs/generate.ts
|
|
4
4
|
const MAX_INPUT_CHARS = 6e4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-
|
|
1
|
+
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-CZEc8_v4.js";
|
|
2
2
|
import { o as parseActorUserId } from "./actor-BTtLaeWy.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-BVvSnQBB.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as setSpanAttributes, w as withSpan } from "./logging-
|
|
2
|
-
import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
1
|
+
import { v as setSpanAttributes, w as withSpan } from "./logging-CZEc8_v4.js";
|
|
2
|
+
import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-aVLDAirh.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
5
5
|
//#region src/chat/sandbox/resources.ts
|