@sentry/junior 0.222.0 → 0.224.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-hooks-DkriF84n.js → agent-hooks-DNLBwmsh.js} +60 -16
- package/dist/{agent-7kKtDe-6.js → agent-runner-9g6TQk9y.js} +879 -69
- package/dist/api/schema.d.ts +160 -11
- package/dist/api/schema.js +2 -2
- package/dist/api.js +16 -16
- package/dist/{app-C0zbsnr7.d.ts → app-BbSD6EtD.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +1598 -69
- package/dist/{briefs-CNH1ztn5.js → briefs-CjXnGKzZ.js} +6 -6
- package/dist/{catalog-runtime-XH_LFA_7.js → catalog-runtime-CVZ9TEuK.js} +1 -1
- package/dist/{checkpoint-CRod8es5.js → checkpoint-Ceck_fLO.js} +12 -9
- package/dist/cli/chat.js +14 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-CcSboWx_.js → client-B27ufhzl.js} +56 -6
- package/dist/{config-CGYv-YPE.js → config-BAhl7-RC.js} +6 -7
- package/dist/{conversation-BBDt88di.js → conversation-1HUoZr2l.js} +33 -5
- package/dist/{conversation-privacy-BGjdDVWD.js → conversation-privacy-C-4JQzKD.js} +1 -1
- package/dist/credential-sync-BXHIxbtS.js +940 -0
- package/dist/{execution-stats-D97ePWuM.js → execution-stats-DikPOxJ1.js} +3 -3
- package/dist/{executor-BLBZ-UB8.js → executor-BG2Armby.js} +1 -1
- package/dist/{history-CaV8Ww7M.d.ts → history-yaSjGMD_.d.ts} +18 -0
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-_8gxwDzt.js → job-queue-D4oAVrL9.js} +1 -1
- package/dist/{logging-qmsMdU0y.js → logging-iY0ssa2q.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{pending-auth-_1Ry-_Bw.js → oauth-authorization-BIijVS2N.js} +6 -48
- package/dist/{oauth-callback-server-Mjfm46A5.js → oauth-callback-server-DPkK3kzi.js} +4 -4
- package/dist/{profile-DbG8AlNd.js → profile-6KWhg_-U.js} +5 -9
- package/dist/{prompt-B8rCQI7K.js → prompt-90miy8VV.js} +1 -1
- package/dist/{registry-DGyQCsiy.js → registry-Ctgdjt-W.js} +1 -1
- package/dist/{resolve-D5SqDbCA.js → resolve-CB45ZukQ.js} +2 -2
- package/dist/{runner-BRAFjJhe.js → runner-BwKCqoF3.js} +9 -10
- package/dist/{sandbox-egress-signals-CdI1aVHT.js → sandbox-egress-signals-Cmy8ODat.js} +1 -1
- package/dist/{schema-CTOODa3L.js → schema-RpbW5Od2.js} +1 -1
- package/dist/{short-title-CB2fxEyx.js → short-title-xEkZwkcV.js} +2 -2
- package/dist/{skills-BoS3b8cg.js → skills-c2bMDVRS.js} +2 -2
- package/dist/{spawn-BXCU1udr.js → spawn-Cg6lyjE7.js} +2 -2
- package/dist/{stats-qUXQZq-w.js → stats-DP9zl3Jg.js} +19 -17
- package/dist/{task-queue-Di_q8922.js → task-queue-SL4uLfBB.js} +3 -3
- package/dist/{task-runner-4rCppQMo.js → task-runner-fntmnqzx.js} +9 -84
- package/dist/{thread-state-2Paza8DV.js → thread-state-Wfr0GdKS.js} +5 -5
- package/dist/{auth-pause-state-3OT67TA8.js → turn-failure-response-DLjSEm-R.js} +74 -84
- package/dist/{turn-lifecycle-f-y0Irpi.js → turn-lifecycle-5_jvLqRz.js} +1 -1
- package/dist/turn-session-routing-CQaysLoe.js +77 -0
- package/dist/{validation-Be9lSORU.js → validation-CnZkCN7o.js} +1 -1
- package/dist/{version-BydrOZMQ.js → version-C6lA-h_o.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-BdfOkTuG.js → web-authorization-Bbx999_q.js} +1 -1
- package/dist/{web-input-DegYUyKU.js → web-input-BoE1xE-K.js} +7 -7
- package/dist/{work-Citqpnfc.js → work-4Nhz9mVv.js} +52 -10
- package/dist/{worker-Bn_HFyvM.js → worker-CdWPsNL2.js} +5 -5
- package/package.json +4 -4
- package/dist/agent-runner-D0ImXS7U.js +0 -679
- package/dist/credential-sync-BfzGNruT.js +0 -2757
- package/dist/experimental-CIXf7Uye.js +0 -46
- package/dist/turn-execution--F7a9kEU.js +0 -47
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as completeObject } from "./client-
|
|
1
|
+
import { r as completeObject } from "./client-B27ufhzl.js";
|
|
2
2
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
3
|
-
import {
|
|
4
|
-
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-
|
|
3
|
+
import { P as briefCodeChangeSchema, R as parseBriefInput, d as conversationDetailReportSchema, p as conversationEventPageSchema } from "./conversation-1HUoZr2l.js";
|
|
4
|
+
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-90miy8VV.js";
|
|
5
5
|
import { CLI_USAGE } from "./cli/run.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { z } from "zod";
|
|
@@ -179,11 +179,11 @@ function briefInputFromSnapshot(snapshot, throughIndex) {
|
|
|
179
179
|
const bounded = codeChangeAt(change, boundaryMs);
|
|
180
180
|
return bounded ? [bounded] : [];
|
|
181
181
|
}),
|
|
182
|
-
resources: (detail.annotations ?? []).
|
|
182
|
+
resources: (detail.annotations ?? []).flatMap((annotation) => annotation.url !== null && Date.parse(annotation.createdAt) <= boundaryMs ? [{
|
|
183
183
|
label: annotation.label,
|
|
184
184
|
url: annotation.url,
|
|
185
185
|
...annotation.status ? { status: annotation.status } : void 0
|
|
186
|
-
})
|
|
186
|
+
}] : [])
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
/** Return the last event index included in a conversation snapshot. */
|
|
@@ -269,7 +269,7 @@ async function parseRunOptions(argv) {
|
|
|
269
269
|
* `DATABASE_URL` at import, and `briefs pull` must work with only a token.
|
|
270
270
|
*/
|
|
271
271
|
async function configuredDefaultModelId() {
|
|
272
|
-
const { botConfig } = await import("./config-
|
|
272
|
+
const { botConfig } = await import("./config-BAhl7-RC.js").then((n) => n.r);
|
|
273
273
|
return defaultModelId(botConfig);
|
|
274
274
|
}
|
|
275
275
|
function apiUrl(baseUrl, pathname) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { t as createPluginCatalogRuntime } from "./registry-
|
|
2
|
+
import { t as createPluginCatalogRuntime } from "./registry-Ctgdjt-W.js";
|
|
3
3
|
//#region src/chat/plugins/catalog-runtime.ts
|
|
4
4
|
var catalog_runtime_exports = /* @__PURE__ */ __exportAll({ pluginCatalogRuntime: () => pluginCatalogRuntime });
|
|
5
5
|
const pluginCatalogRuntime = createPluginCatalogRuntime();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-
|
|
2
|
-
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
1
|
+
import { i as completeText, m as escapeXml, o as resolveGatewayModel, p as unwrapCurrentInstruction } from "./client-B27ufhzl.js";
|
|
2
|
+
import { _ as setSpanAttributes, f as logWarn, o as getActiveTraceId, t as buildTurnFailureResponse, u as logException } from "./logging-iY0ssa2q.js";
|
|
3
|
+
import { n as botConfig } from "./config-BAhl7-RC.js";
|
|
4
4
|
import { _ as parseSlackMessageTs, f as toStoredSlackActor } from "./context-Bplcgypl.js";
|
|
5
|
-
import { Bt as
|
|
6
|
-
import {
|
|
7
|
-
import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-
|
|
8
|
-
import {
|
|
5
|
+
import { Bt as agentsInstructionsUpdatedEvent, Ht as authenticationUnlinkedEvent, Jt as getSqlExecutor, Kt as getConversationStore, Vt as authenticationLinkedEvent, Wt as getConversationEventStore, Xt as withConversationEventLock, Yt as createSqlConversationEventStore, Zt as sanitizePostgresJson, en as bindProviderConversation, nn as addAgentTurnUsage, zt as JUNIOR_NATIVE_EVENT_NAMESPACE } from "./agent-hooks-DNLBwmsh.js";
|
|
6
|
+
import { B as agentHistoryItemSchema, J as instructionActors, Y as instructionProvenanceFor, q as contextProvenance } from "./conversation-1HUoZr2l.js";
|
|
7
|
+
import { n as generateShortTitle, t as fallbackShortTitle } from "./short-title-xEkZwkcV.js";
|
|
8
|
+
import { D as fenceLock, O as withLock, T as MUTATION_LOCK_TTL_MS, k as sleep, w as getStateAdapter } from "./profile-6KWhg_-U.js";
|
|
9
9
|
import { isDeepStrictEqual } from "node:util";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createHash } from "node:crypto";
|
|
@@ -237,6 +237,8 @@ function recordDeliveredAssistantMessage(args) {
|
|
|
237
237
|
replied: true,
|
|
238
238
|
skippedReason: void 0
|
|
239
239
|
});
|
|
240
|
+
const cards = args.cards?.filter((card) => card.kind === "automation");
|
|
241
|
+
const objectCards = args.cards?.filter((card) => card.kind === "object");
|
|
240
242
|
upsertConversationMessage(args.conversation, {
|
|
241
243
|
id: messageId,
|
|
242
244
|
role: "assistant",
|
|
@@ -247,7 +249,8 @@ function recordDeliveredAssistantMessage(args) {
|
|
|
247
249
|
isBot: true
|
|
248
250
|
},
|
|
249
251
|
meta: {
|
|
250
|
-
...
|
|
252
|
+
...cards?.length ? { cards } : void 0,
|
|
253
|
+
...objectCards?.length ? { objectCards } : void 0,
|
|
251
254
|
replied: true,
|
|
252
255
|
...args.source ? { source: args.source } : void 0
|
|
253
256
|
}
|
|
@@ -2072,4 +2075,4 @@ async function saveDone(args) {
|
|
|
2072
2075
|
});
|
|
2073
2076
|
}
|
|
2074
2077
|
//#endregion
|
|
2075
|
-
export {
|
|
2078
|
+
export { appendThreadContextMessages as $, commitAcceptedReply as A, recordAuthorizationCompleted as B, isToolResultError as C, stripRuntimeTurnContext as D, retainRuntimeTurnContext as E, loadTurnRoute as F, recordToolExecutionStarted as G, recordGuardianActionReviewed as H, openConversationProjection as I, hydrateConversationMessages as J, recordTurnRoute as K, recordAgentsInstructionsUpdated as L, loadConnectedMcpProviders as M, loadConversationProjection as N, trimTrailingAssistantMessages as O, loadProjection as P, resolveConversationTitle as Q, recordAttachmentsDelivered as R, isContinuablePiBoundary as S, normalizeToolNameFromResult as T, recordMcpProviderConnected as U, recordAuthorizationRequested as V, recordSubscribedReplyRoute as W, projectConversationMessages as X, persistConversationMessages as Y, persistConversationMessageSummaries as Z, getTerminalAssistantMessages as _, completeTurnRecord as a, markConversationMessage as at, instructionTextForProjection as b, listTurnSummaries as c, turnHasReply as ct, TurnSliceLimitExceededError as d, getAgentContextCompactionTriggerTokens as dt, buildConversationContext as et, assertTurnToolCallLimit as f, getAgentContextInputLimitTokens as ft, getPiMessageRole as g, extractAssistantText as h, abandonTurnRecord as i, isHumanConversationMessage as it, commitMessages as j, TURN_CONTEXT_TAG as k, recordTurnSummary as l, upsertConversationMessage as lt, isTurnExecutionLimitExceededError as m, piMessageFromHistoryItem as mt, loadTurnCheckpoint as n, estimateConversationContextTokens as nt, failTurnRecord as o, normalizeConversationText as ot, buildTurnErrorResponse as p, historyItemFromPiMessage as pt, appendConversationMessages as q, saveTurnCheckpoint as r, getConversationMessageSlackTs as rt, getTurnRecord as s, recordDeliveredAssistantMessage as st, continuableMessages as t, createConversationMemoryService as tt, persistWithRetry as u, estimateTextTokens as ut, getUserMessageInstructionText as v, isToolResultMessage as w, isAssistantMessage as x, hasRuntimeTurnContext as y, recordAuthenticationLinked as z };
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as createAgentRunner } from "../agent-runner-D0ImXS7U.js";
|
|
1
|
+
import { s as executeAgentRun, t as createAgentRunner } from "../agent-runner-9g6TQk9y.js";
|
|
3
2
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
4
3
|
import path from "node:path";
|
|
5
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
@@ -101,10 +100,10 @@ async function loadLocalPluginSet() {
|
|
|
101
100
|
async function configureLocalChatPlugins(pluginSet) {
|
|
102
101
|
const [pluginsModule, agentHooksModule, catalogRuntimeModule, validationModule, databaseModule] = await Promise.all([
|
|
103
102
|
import("../plugins-egKWjgue.js").then((n) => n.o),
|
|
104
|
-
import("../agent-hooks-
|
|
105
|
-
import("../catalog-runtime-
|
|
106
|
-
import("../validation-
|
|
107
|
-
import("../agent-hooks-
|
|
103
|
+
import("../agent-hooks-DNLBwmsh.js").then((n) => n.t),
|
|
104
|
+
import("../catalog-runtime-CVZ9TEuK.js").then((n) => n.t),
|
|
105
|
+
import("../validation-CnZkCN7o.js").then((n) => n.r),
|
|
106
|
+
import("../agent-hooks-DNLBwmsh.js").then((n) => n.Ut)
|
|
108
107
|
]);
|
|
109
108
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
110
109
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -154,18 +153,18 @@ function localDevServerUrl() {
|
|
|
154
153
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
155
154
|
defaultStateAdapterForLocalChat();
|
|
156
155
|
await configureLocalChatPlugins(pluginSet);
|
|
157
|
-
const { setExperimentalFeatures } = await import("../
|
|
156
|
+
const { setExperimentalFeatures } = await import("../agent-runner-9g6TQk9y.js").then((n) => n.r);
|
|
158
157
|
setExperimentalFeatures({ subagents: true });
|
|
159
|
-
const { setBriefsConfig } = await import("../agent-hooks-
|
|
158
|
+
const { setBriefsConfig } = await import("../agent-hooks-DNLBwmsh.js").then((n) => n.m);
|
|
160
159
|
setBriefsConfig({ enabled: true });
|
|
161
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
162
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
160
|
+
const { runLocalAgentTurn } = await import("../runner-BwKCqoF3.js");
|
|
161
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-DPkK3kzi.js");
|
|
163
162
|
const { createLocalOAuthState } = await import("../oauth-relay-CdCnu80W.js").then((n) => n.t);
|
|
164
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
165
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
166
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
163
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-Cmy8ODat.js");
|
|
164
|
+
const { bindSpawnAgent } = await import("../spawn-Cg6lyjE7.js").then((n) => n.n);
|
|
165
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-4Nhz9mVv.js").then((n) => n.a);
|
|
167
166
|
const { createLocalConversationWork } = await import("../conversation-work-C6y3T5Hx.js");
|
|
168
|
-
const { processConversationWork } = await import("../worker-
|
|
167
|
+
const { processConversationWork } = await import("../worker-CdWPsNL2.js").then((n) => n.n);
|
|
169
168
|
let agentRunner;
|
|
170
169
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
171
170
|
if (!agentRunner) throw new Error("Local agent runner is not ready");
|
|
@@ -181,7 +180,7 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
181
180
|
});
|
|
182
181
|
});
|
|
183
182
|
agentRunner = createAgentRunner(executeAgentRun, { bindSpawnAgent: (request) => bindSpawnAgent(request, { queue: localConversationWork.queue }) });
|
|
184
|
-
const oauthCallback = await startLocalOAuthCallbackServer(
|
|
183
|
+
const oauthCallback = await startLocalOAuthCallbackServer();
|
|
185
184
|
const deps = {
|
|
186
185
|
agentRunner,
|
|
187
186
|
authorization: {
|
package/dist/cli/check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-
|
|
2
|
-
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-
|
|
3
|
-
import { i as parseSkillFile } from "../skills-
|
|
1
|
+
import { E as JUNIOR_HEARTBEAT_ROUTE, j as LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "../logging-iY0ssa2q.js";
|
|
2
|
+
import { f as parseInlinePluginManifest, p as parsePluginManifest } from "../registry-Ctgdjt-W.js";
|
|
3
|
+
import { i as parseSkillFile } from "../skills-c2bMDVRS.js";
|
|
4
4
|
import { pathToFileURL } from "node:url";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs/promises";
|
package/dist/cli/main.js
CHANGED
|
@@ -25,7 +25,7 @@ async function runChat(argv, pluginSet) {
|
|
|
25
25
|
return await (await import("./chat.js")).runChat(argv, void 0, { pluginSet });
|
|
26
26
|
}
|
|
27
27
|
async function runBriefs(argv) {
|
|
28
|
-
return await (await import("../briefs-
|
|
28
|
+
return await (await import("../briefs-CjXnGKzZ.js")).runBriefs(argv);
|
|
29
29
|
}
|
|
30
30
|
function topLevelCommand(argv) {
|
|
31
31
|
return (argv[0] === "--" ? argv.slice(1) : argv)[0];
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as pluginCatalogRuntime } from "../catalog-runtime-
|
|
3
|
-
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-
|
|
1
|
+
import { bt as createPluginLogger, d as setPlugins, f as validatePlugins, qt as getDb } from "../agent-hooks-DNLBwmsh.js";
|
|
2
|
+
import { n as pluginCatalogRuntime } from "../catalog-runtime-CVZ9TEuK.js";
|
|
3
|
+
import { n as validatePluginRegistrations, t as validatePluginEgressCredentialHooks } from "../validation-CnZkCN7o.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, i as pluginCliRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-BKGOXca2.js";
|
|
6
6
|
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-CVZ9TEuK.js";
|
|
2
|
+
import { S as disconnectStateAdapter, t as create } from "../profile-6KWhg_-U.js";
|
|
3
|
+
import { r as resolve } from "../resolve-CB45ZukQ.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 { a as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { a as getChatConfig } from "../config-BAhl7-RC.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-BG2Armby.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-Ctgdjt-W.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-BKGOXca2.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { C as withSpan, f as logWarn, h as serializeGenAiAttribute, i as extractGenAiUsageAttributes, p as normalizeGenAiFinishReason, u as logException } from "./logging-iY0ssa2q.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-C-4JQzKD.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";
|
|
@@ -304,6 +304,31 @@ registerApiProvider({
|
|
|
304
304
|
const GATEWAY_PROVIDER = "vercel-ai-gateway";
|
|
305
305
|
const GATEWAY_BASE_URL = "https://ai-gateway.vercel.sh";
|
|
306
306
|
const GATEWAY_MODEL_OVERRIDES = {
|
|
307
|
+
"anthropic/claude-opus-5.5": {
|
|
308
|
+
id: "anthropic/claude-opus-5.5",
|
|
309
|
+
name: "Claude Opus 5.5",
|
|
310
|
+
api: "anthropic-messages",
|
|
311
|
+
provider: GATEWAY_PROVIDER,
|
|
312
|
+
baseUrl: GATEWAY_BASE_URL,
|
|
313
|
+
reasoning: true,
|
|
314
|
+
input: ["text", "image"],
|
|
315
|
+
cost: {
|
|
316
|
+
input: 4,
|
|
317
|
+
output: 20,
|
|
318
|
+
cacheRead: .2,
|
|
319
|
+
cacheWrite: 5
|
|
320
|
+
},
|
|
321
|
+
contextWindow: 1e6,
|
|
322
|
+
maxTokens: 128e3,
|
|
323
|
+
thinkingLevelMap: {
|
|
324
|
+
xhigh: "xhigh",
|
|
325
|
+
max: "max"
|
|
326
|
+
},
|
|
327
|
+
compat: {
|
|
328
|
+
forceAdaptiveThinking: true,
|
|
329
|
+
supportsTemperature: false
|
|
330
|
+
}
|
|
331
|
+
},
|
|
307
332
|
"xai/grok-4.5": {
|
|
308
333
|
id: "xai/grok-4.5",
|
|
309
334
|
name: "Grok 4.5",
|
|
@@ -321,6 +346,34 @@ const GATEWAY_MODEL_OVERRIDES = {
|
|
|
321
346
|
contextWindow: 5e5,
|
|
322
347
|
maxTokens: 5e5
|
|
323
348
|
},
|
|
349
|
+
"openai/gpt-6-luna": {
|
|
350
|
+
id: "openai/gpt-6-luna",
|
|
351
|
+
name: "GPT-6 Luna",
|
|
352
|
+
api: "anthropic-messages",
|
|
353
|
+
provider: GATEWAY_PROVIDER,
|
|
354
|
+
baseUrl: GATEWAY_BASE_URL,
|
|
355
|
+
reasoning: true,
|
|
356
|
+
input: ["text", "image"],
|
|
357
|
+
cost: {
|
|
358
|
+
input: .1,
|
|
359
|
+
output: .5,
|
|
360
|
+
cacheRead: .01,
|
|
361
|
+
cacheWrite: .125,
|
|
362
|
+
tiers: [{
|
|
363
|
+
inputTokensAbove: 272e3,
|
|
364
|
+
input: .2,
|
|
365
|
+
output: .75,
|
|
366
|
+
cacheRead: .02,
|
|
367
|
+
cacheWrite: .25
|
|
368
|
+
}]
|
|
369
|
+
},
|
|
370
|
+
contextWindow: 105e4,
|
|
371
|
+
maxTokens: 128e3,
|
|
372
|
+
thinkingLevelMap: {
|
|
373
|
+
xhigh: "xhigh",
|
|
374
|
+
max: "max"
|
|
375
|
+
}
|
|
376
|
+
},
|
|
324
377
|
"openai/gpt-6-astra": {
|
|
325
378
|
id: "openai/gpt-6-astra",
|
|
326
379
|
name: "GPT-6 Astra",
|
|
@@ -373,10 +426,7 @@ function embeddingCostUsd(modelId, inputTokens) {
|
|
|
373
426
|
function extractText(message) {
|
|
374
427
|
return (message.content ?? []).filter((part) => part.type === "text" && typeof part.text === "string").map((part) => part.text ?? "").join("").trim();
|
|
375
428
|
}
|
|
376
|
-
/**
|
|
377
|
-
* Look up a gateway model by id. Junior-owned overrides let new gateway
|
|
378
|
-
* models work before pi-ai publishes an updated bundled catalog.
|
|
379
|
-
*/
|
|
429
|
+
/** Resolve gateway models through local overrides, then Pi's bundled catalog. */
|
|
380
430
|
function resolveGatewayModel(modelId) {
|
|
381
431
|
const matched = GATEWAY_MODEL_OVERRIDES[modelId] ?? getModels(GATEWAY_PROVIDER).find((model) => model.id === modelId);
|
|
382
432
|
if (!matched) throw new Error(`Unknown AI Gateway model id: ${modelId}`);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
3
|
-
import { f as logWarn } from "./logging-
|
|
2
|
+
import { o as resolveGatewayModel, w as toOptionalTrimmed } from "./client-B27ufhzl.js";
|
|
3
|
+
import { f as logWarn } from "./logging-iY0ssa2q.js";
|
|
4
4
|
import { c as TURN_REASONING_LEVELS, l as parseTurnReasoningLevel, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
|
|
5
|
-
import { getModel } from "@earendil-works/pi-ai/compat";
|
|
6
5
|
//#region src/chat/slack/emoji.ts
|
|
7
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
8
7
|
function normalizeSlackEmojiName(value) {
|
|
@@ -126,10 +125,10 @@ function parseCrossActorMidRunMode(rawValue) {
|
|
|
126
125
|
throw new Error("JUNIOR_CROSS_ACTOR_MID_RUN_MODE must be follow_up or steer");
|
|
127
126
|
}
|
|
128
127
|
const DEFAULT_MODEL_ID = "xai/grok-4.5";
|
|
129
|
-
const DEFAULT_FAST_MODEL_ID =
|
|
130
|
-
const DEFAULT_GUARDIAN_MODEL_ID =
|
|
131
|
-
const DEFAULT_HANDOFF_MODEL_ID =
|
|
132
|
-
const DEFAULT_WEB_SEARCH_MODEL_ID =
|
|
128
|
+
const DEFAULT_FAST_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
129
|
+
const DEFAULT_GUARDIAN_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
130
|
+
const DEFAULT_HANDOFF_MODEL_ID = resolveGatewayModel("anthropic/claude-opus-5.5").id;
|
|
131
|
+
const DEFAULT_WEB_SEARCH_MODEL_ID = resolveGatewayModel("openai/gpt-6-luna").id;
|
|
133
132
|
const DEFAULT_EMBEDDING_MODEL_ID = "openai/text-embedding-3-small";
|
|
134
133
|
const DEFAULT_IMAGE_GENERATION_MODEL_ID = "google/gemini-3-pro-image";
|
|
135
134
|
function validateGatewayModelId(raw) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as TURN_REASONING_LEVELS, o as modelProfileSchema } from "./model-profile-CZmVoGdX.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { actorSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
3
|
+
import { actorSchema, codeChangeStateSchema, conversationAnnotationInputSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
4
4
|
//#region src/usage-schema.ts
|
|
5
5
|
const usageCostSchema = z.object({
|
|
6
6
|
input: z.number().finite().nonnegative().optional(),
|
|
@@ -599,22 +599,50 @@ function automationCardText(card) {
|
|
|
599
599
|
//#endregion
|
|
600
600
|
//#region src/chat/conversations/cards.ts
|
|
601
601
|
/** Built-in response types accepted by Message storage and delivery. */
|
|
602
|
-
const messageCardSchema = z.discriminatedUnion("kind", [automationCardSchema]);
|
|
602
|
+
const messageCardSchema = z.discriminatedUnion("kind", [automationCardSchema, ownedObjectAnnotationSchema]);
|
|
603
603
|
const storedCardSchema = automationCardSchema.extend({ operation: z.enum([
|
|
604
604
|
"created",
|
|
605
605
|
"updated",
|
|
606
606
|
"deleted"
|
|
607
607
|
]).optional() });
|
|
608
|
-
/** Read
|
|
608
|
+
/** Read both stored formats while keeping new objects out of the legacy field. */
|
|
609
609
|
function readMessageCards(value) {
|
|
610
|
-
return storedCardSchema.array().parse(value).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [card]);
|
|
610
|
+
return [...storedCardSchema.array().parse(value.cards ?? []).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [card]), ...ownedObjectAnnotationSchema.array().parse(value.objectCards ?? [])];
|
|
611
611
|
}
|
|
612
612
|
/** Render each built-in card with its own text format. */
|
|
613
613
|
function messageCardText(card) {
|
|
614
614
|
switch (card.kind) {
|
|
615
|
+
case "object": return [
|
|
616
|
+
card.title,
|
|
617
|
+
card.label !== card.title ? card.label : void 0,
|
|
618
|
+
card.description,
|
|
619
|
+
card.status,
|
|
620
|
+
card.trigger,
|
|
621
|
+
card.warning,
|
|
622
|
+
card.url
|
|
623
|
+
].filter(Boolean).join("\n");
|
|
615
624
|
case "automation": return automationCardText(card);
|
|
616
625
|
}
|
|
617
626
|
}
|
|
627
|
+
/** Deduplicate object cards across successful tool results. */
|
|
628
|
+
function messageCardKey(card) {
|
|
629
|
+
return card.kind === "object" ? JSON.stringify([card.plugin, card.key]) : JSON.stringify(["junior", card.id]);
|
|
630
|
+
}
|
|
631
|
+
/** Identify a deleted object whose pending card must be omitted. */
|
|
632
|
+
const messageCardRefSchema = z.object({
|
|
633
|
+
plugin: z.string().min(1),
|
|
634
|
+
key: z.string().min(1)
|
|
635
|
+
}).strict();
|
|
636
|
+
/** Copy saved annotation facts without storage timestamps for Message delivery. */
|
|
637
|
+
function annotationCard(annotation) {
|
|
638
|
+
const { createdAt: _createdAt, updatedAt: _updatedAt, ...value } = annotation;
|
|
639
|
+
return value.kind === "object" ? value : {
|
|
640
|
+
...value,
|
|
641
|
+
kind: "object",
|
|
642
|
+
objectType: "item",
|
|
643
|
+
title: value.label
|
|
644
|
+
};
|
|
645
|
+
}
|
|
618
646
|
//#endregion
|
|
619
647
|
//#region src/api/schema/conversation.ts
|
|
620
648
|
const conversationReportStatusSchema = z.enum([
|
|
@@ -1205,4 +1233,4 @@ const conversationStatsReportSchema = z.object({
|
|
|
1205
1233
|
windowStart: z.string()
|
|
1206
1234
|
}).strict();
|
|
1207
1235
|
//#endregion
|
|
1208
|
-
export {
|
|
1236
|
+
export { messageCardKey as A, agentHistoryItemSchema as B, conversationReportEventSchema as C, createConversationBodySchema as D, conversationSummaryReportSchema as E, briefLinkSchema as F, historyReplacementSchema as G, conversationTurnFailureCodeSchema as H, briefOutcomeStatusSchema as I, instructionActors as J, newConversationEventSchema as K, conversationBriefSchema as L, messageCardText as M, readMessageCards as N, createConversationMessageBodySchema as O, briefCodeChangeSchema as P, parseBriefInput as R, conversationReportEventDataSchema as S, conversationStatsReportSchema as T, conversationTurnFailureReasonSchema as U, conversationEventDataSchema as V, decodeStoredConversationEvent as W, sameActorIdentity as X, instructionProvenanceFor as Y, usageSchema as Z, 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, messageCardRefSchema as j, annotationCard as k, conversationAuxiliaryCostsSchema as l, conversationEventsQuerySchema as m, actorIdentitySchema as n, cancelConversationPendingMessagesResponseSchema as o, conversationEventPageSchema as p, contextProvenance 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, KNOWN_CONVERSATION_EVENT_TYPES as z };
|