@sentry/junior 0.205.0 → 0.207.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-D4nu8MQV.js → agent-CmQlX68D.js} +603 -394
- package/dist/{agent-hooks-DXHpTJ4m.js → agent-hooks-BBX9p6aG.js} +1171 -100
- package/dist/{agent-runner-C04colea.js → agent-runner-CQD4HKK2.js} +9 -9
- package/dist/api/schema.d.ts +116 -39
- package/dist/api/schema.js +3 -3
- package/dist/api.d.ts +1 -1
- package/dist/api.js +182 -649
- package/dist/{app-Cb776lL8.d.ts → app-DfNrn_gS.d.ts} +9 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +205 -233
- package/dist/{auth-pause-state-C2P3guS1.js → auth-pause-state-uv8on6cT.js} +7 -7
- package/dist/briefs-BXEmjD9D.js +398 -0
- package/dist/{catalog-runtime-CXw3asJD.js → catalog-runtime-1BZEOR8J.js} +1 -1
- package/dist/{checkpoint-CrViJ8Ps.js → checkpoint-B-JO5F3c.js} +9 -8
- package/dist/cli/chat.js +14 -12
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +1 -0
- package/dist/cli/main.js +5 -1
- package/dist/cli/plugins.js +3 -3
- package/dist/cli/run.d.ts +2 -1
- package/dist/cli/run.js +2 -1
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-BOtJQ7Pc.js → client-Bp297GA0.js} +6 -369
- package/dist/config-G2gv97R1.js +386 -0
- package/dist/{context-B45_WqVX.js → context-Bplcgypl.js} +13 -13
- package/dist/{schema-Rn8-XEaN.js → conversation-AA4R1VUn.js} +580 -558
- package/dist/{conversation-privacy-BZRA6Pes.js → conversation-privacy-BUfel19D.js} +1 -1
- package/dist/{credential-sync-Bep34IB_.js → credential-sync-D04NWqMR.js} +21 -20
- package/dist/{db-BeyXKJOI.d.ts → db-D74z7BZH.d.ts} +1 -1
- package/dist/{execution-stats-B6lgWxCK.js → execution-stats-Ds4bSvam.js} +77 -77
- package/dist/{executor-BlUhFL7_.js → executor-BZu1Ta06.js} +41 -13
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-DLMqIK74.js → job-queue-rnAPfUhP.js} +1 -1
- package/dist/{logging-BMJzdDlP.js → logging-Dx0S5k2z.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-WwG5_Zgm.js → oauth-callback-server-xGpwURIj.js} +2 -2
- package/dist/{pending-auth-CUbXq06G.js → pending-auth-DIZ4iZjS.js} +2 -2
- package/dist/{profile-T0tXE4zu.js → profile-d-fKypxo.js} +4 -3
- package/dist/prompt-x-0ZtTyb.js +552 -0
- package/dist/{registry-BA0__8ai.js → registry-CWKdLCTG.js} +2 -2
- package/dist/{resolve-bvD1ORdv.js → resolve-BhRB1s2A.js} +2 -2
- package/dist/{runner-BXYxfIUL.js → runner-DNml3owD.js} +10 -10
- package/dist/{sandbox-egress-signals-ngEPjSEW.js → sandbox-egress-signals-DUIl3-gW.js} +1 -1
- package/dist/schema-CwTeb-BF.js +559 -0
- package/dist/{skills-DJOlYdBs.js → skills-D9WesdJJ.js} +2 -2
- package/dist/{spawn-h0R1bTEo.js → spawn-Eh_3-s0M.js} +2 -2
- package/dist/{stats-3YZn-Swi.js → stats-CFlUGqVA.js} +292 -268
- package/dist/{store-C5qxF2ac.d.ts → store-Det8MQ9g.d.ts} +1 -1
- package/dist/{task-queue-CoXwd2eq.js → task-queue-D8I1_5wP.js} +3 -3
- package/dist/{task-runner-B2_mJZj0.js → task-runner-DO79gdho.js} +18 -18
- package/dist/{thread-state-CqZ1m-es.js → thread-state-DD6BA4xz.js} +5 -5
- package/dist/{turn-execution-fI6PZ0iI.js → turn-execution-BSIHxmQJ.js} +3 -3
- package/dist/{turn-lifecycle-CcnwrOcp.js → turn-lifecycle-DSBK4Ars.js} +1 -1
- package/dist/{usage-B5SfMb3H.js → usage-WRXkNOHp.js} +4 -125
- package/dist/{validation-DfWcvhuS.js → validation-BbHZ4r4S.js} +1 -1
- package/dist/{version-oD-oPrbO.js → version-C71UcRWw.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/web-authorization-C73gJV7l.js +38 -0
- package/dist/{web-input-BOuq3oKK.js → web-input-Ce1FcNIM.js} +8 -8
- package/dist/{work-B91LQKHr.js → work-BEzDU_2x.js} +9 -9
- package/dist/{worker-BcRRTe6k.js → worker-MK2ubOv-.js} +5 -4
- package/migrations/0040_conversation_briefs.sql +17 -0
- package/migrations/0041_automation_outcomes_backfill.sql +27 -0
- package/migrations/meta/0040_snapshot.json +3516 -0
- package/migrations/meta/0041_snapshot.json +3516 -0
- package/migrations/meta/_journal.json +14 -0
- package/package.json +4 -4
- package/dist/history-CqTuSAdI.js +0 -441
- package/dist/usage-schema-CKaDkH_j.js +0 -20
- package/dist/web-authorization-Crbzlmzo.js +0 -76
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { N as getMcpProviderErrorAttributes,
|
|
2
|
-
import {
|
|
3
|
-
import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-
|
|
1
|
+
import { N as getMcpProviderErrorAttributes, Y as createUserTokenStore, a as deleteMcpAuthSession, d as putMcpStoredOAuthCredentials, h as resolvePluginOAuthAccount, i as finalizeMcpAuthorization, l as getMcpAuthSession, u as getMcpStoredOAuthCredentials, y as lookupSlackUserProfile } from "./agent-CmQlX68D.js";
|
|
2
|
+
import { m as escapeXml } from "./client-Bp297GA0.js";
|
|
3
|
+
import { L as toOptionalString, S as withLogContext, d as logInfo, f as logWarn, m as runBestEffort, u as logException, y as setTags } from "./logging-Dx0S5k2z.js";
|
|
4
|
+
import { a as getChatConfig, h as normalizeSlackEmojiName, n as botConfig, o as getRuntimeMetadata } from "./config-G2gv97R1.js";
|
|
4
5
|
import { n as defaultModelId } from "./model-profile-CZmVoGdX.js";
|
|
5
|
-
import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-
|
|
6
|
-
import {
|
|
6
|
+
import { _ as parseSlackMessageTs, g as parseSlackUserId, l as isUserActor, s as createSlackResumeActor } from "./context-Bplcgypl.js";
|
|
7
|
+
import { Ft as getConversationStore, G as isDmChannel, H as getHeaderString, Jt as upsertLinkedIdentity, K as normalizeSlackConversationId, Lt as getSqlExecutor, U as getSlackClient, Zt as requireSlackDestination, mt as getDashboardConversationLink, o as getPluginSlackConversationLink, qt as upsertIdentity, wt as buildSentryConversationUrl, z as SlackActionError } from "./agent-hooks-BBX9p6aG.js";
|
|
7
8
|
import { i as homeDir } from "./package-discovery-7a9YqLhE.js";
|
|
8
|
-
import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, U as recordAuthenticationLinked, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, lt as markConversationMessage, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, u as recordTurnSummary } from "./checkpoint-
|
|
12
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
13
|
-
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-
|
|
14
|
-
import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-
|
|
15
|
-
import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-
|
|
9
|
+
import { l as hasRequiredOAuthScope, n as buildOAuthTokenRequest, r as parseOAuthTokenResponse } from "./registry-CWKdLCTG.js";
|
|
10
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
|
|
11
|
+
import { t as discoverSkills } from "./skills-D9WesdJJ.js";
|
|
12
|
+
import { P as commitAcceptedReply, Q as hydrateConversationMessages, R as loadProjection, U as recordAuthenticationLinked, W as recordAuthorizationCompleted, d as persistWithRetry, dt as recordDeliveredAssistantMessage, ft as turnHasReply, i as abandonTurnRecord, it as buildConversationContext, lt as markConversationMessage, m as buildTurnErrorResponse, n as loadTurnCheckpoint, o as failTurnRecord, r as saveTurnCheckpoint, s as getTurnRecord, u as recordTurnSummary } from "./checkpoint-B-JO5F3c.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-d-fKypxo.js";
|
|
14
|
+
import { Pt as requestConversationWork, c as parseSlackThreadId, d as resolveSlackChannelIdFromThreadId, l as readSlackRawMessageContext, u as resolveSlackChannelIdFromMessage, wt as ensureConversationWake } from "./stats-CFlUGqVA.js";
|
|
15
|
+
import { a as isPendingAuthLatestRequest, f as CooperativeTurnYieldError, g as isCooperativeTurnYieldError, i as getConversationPendingAuth, r as clearPendingAuth, s as getAssistantReplyText, x as markTurnFailed } from "./pending-auth-DIZ4iZjS.js";
|
|
16
|
+
import { a as parseOAuthStatePayload, c as escapeSlackMrkdwnText, d as normalizeSlackStatusText, f as truncateStatusText, g as removeReactionFromMessage, h as postSlackMessage, i as formatProviderLabel, l as formatSlackLink, o as resolveBaseUrl, p as addReactionToMessage, u as normalizeSlackReplyMarkdown, v as RetryableDeliveryError } from "./agent-runner-CQD4HKK2.js";
|
|
16
17
|
import { t as getVercelConversationWorkQueue } from "./vercel-queue-DIkVcfK4.js";
|
|
17
|
-
import { a as getTurnRequestDeadline } from "./job-queue-
|
|
18
|
-
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-
|
|
19
|
-
import { n as getTurnLifecycle } from "./turn-lifecycle-
|
|
20
|
-
import { n as executeTurn, t as AgentRunError } from "./turn-execution-
|
|
21
|
-
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-
|
|
22
|
-
import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-
|
|
23
|
-
import { i as buildSentryConversationUrl, n as deleteWebAuthorization } from "./web-authorization-Crbzlmzo.js";
|
|
18
|
+
import { a as getTurnRequestDeadline } from "./job-queue-rnAPfUhP.js";
|
|
19
|
+
import { i as resolveTurnSessionRouting, n as scheduleSessionCompletedPluginTasks } from "./task-runner-DO79gdho.js";
|
|
20
|
+
import { n as getTurnLifecycle } from "./turn-lifecycle-DSBK4Ars.js";
|
|
21
|
+
import { n as executeTurn, t as AgentRunError } from "./turn-execution-BSIHxmQJ.js";
|
|
22
|
+
import { c as configValueSchema, n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState, t as getLocationConfigurationService } from "./thread-state-DD6BA4xz.js";
|
|
23
|
+
import { a as requireTurnFailureEventId, c as getTurnUserMessageId, d as buildDeliveredTurnStatePatch, l as getTurnUserReplyAttachmentContext, n as persistAuthPauseTurnState, o as getInterruptionMarker, r as finalizeFailedTurnReplyWithEvent, s as getTurnUserMessage, u as getTurnUserSlackMessageTs } from "./auth-pause-state-uv8on6cT.js";
|
|
24
24
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
25
|
+
import { n as deleteWebAuthorization } from "./web-authorization-C73gJV7l.js";
|
|
25
26
|
import path from "node:path";
|
|
26
27
|
import { z } from "zod";
|
|
27
28
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-
|
|
1
|
+
import { f as logWarn } from "./logging-Dx0S5k2z.js";
|
|
2
|
+
import { It as getDb } from "./agent-hooks-BBX9p6aG.js";
|
|
3
|
+
import { s as juniorAutomationExecutions, w as juniorConversations } from "./executor-BZu1Ta06.js";
|
|
4
|
+
import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-WRXkNOHp.js";
|
|
5
5
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
6
6
|
//#region src/api/conversations/aggregate.ts
|
|
7
7
|
function usageTokenValue(source, field) {
|
|
@@ -85,9 +85,9 @@ function conversationActiveDaysColumn() {
|
|
|
85
85
|
return sql`COUNT(DISTINCT (${juniorConversations.lastActivityAt} AT TIME ZONE 'UTC')::date)::integer`;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
|
-
//#region src/chat/
|
|
89
|
-
const
|
|
90
|
-
const
|
|
88
|
+
//#region src/chat/automations/execution-stats.ts
|
|
89
|
+
const AUTOMATION_EXECUTION_TYPES = ["scheduled", "event"];
|
|
90
|
+
const AUTOMATION_EXECUTION_STATUSES = [
|
|
91
91
|
"blocked",
|
|
92
92
|
"completed",
|
|
93
93
|
"failed"
|
|
@@ -101,8 +101,8 @@ const EMPTY_RUN_WINDOWS = {
|
|
|
101
101
|
30: 0,
|
|
102
102
|
90: 0
|
|
103
103
|
};
|
|
104
|
-
/** Empty run windows for
|
|
105
|
-
function
|
|
104
|
+
/** Empty run windows for automations with no execution history. */
|
|
105
|
+
function emptyAutomationRunWindows() {
|
|
106
106
|
return { ...EMPTY_RUN_WINDOWS };
|
|
107
107
|
}
|
|
108
108
|
function utcDate(nowMs) {
|
|
@@ -124,24 +124,24 @@ function emptyStatusDay(date) {
|
|
|
124
124
|
failed: 0
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
/** Record one terminal
|
|
128
|
-
async function
|
|
127
|
+
/** Record one terminal automation execution and its durable conversation when present. */
|
|
128
|
+
async function recordAutomationExecution(type, automationId, options) {
|
|
129
129
|
const namespace = options.namespace ?? "junior";
|
|
130
130
|
const nowMs = options.nowMs ?? Date.now();
|
|
131
131
|
const status = options.status ?? "completed";
|
|
132
132
|
try {
|
|
133
|
-
await getDb().insert(
|
|
133
|
+
await getDb().insert(juniorAutomationExecutions).values({
|
|
134
134
|
...options.conversationId ? { conversationId: options.conversationId } : void 0,
|
|
135
135
|
executedAtMs: nowMs,
|
|
136
136
|
executionId: options.executionId,
|
|
137
137
|
kind: type,
|
|
138
138
|
namespace,
|
|
139
139
|
status,
|
|
140
|
-
|
|
140
|
+
automationId
|
|
141
141
|
}).onConflictDoNothing({ target: [
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
juniorAutomationExecutions.kind,
|
|
143
|
+
juniorAutomationExecutions.namespace,
|
|
144
|
+
juniorAutomationExecutions.executionId
|
|
145
145
|
] });
|
|
146
146
|
} catch (error) {
|
|
147
147
|
logWarn("task.execution.stat_failed", {
|
|
@@ -149,34 +149,34 @@ async function recordTaskExecution(type, taskId, options) {
|
|
|
149
149
|
"app.task.execution.id": options.executionId,
|
|
150
150
|
"app.task.execution.namespace": namespace,
|
|
151
151
|
"app.task.execution.status": status,
|
|
152
|
-
"app.task.execution.task_id":
|
|
152
|
+
"app.task.execution.task_id": automationId,
|
|
153
153
|
"app.task.execution.type": type
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
/** Load usage analytics for all
|
|
158
|
-
async function
|
|
157
|
+
/** Load usage analytics for all automations of one type and namespace. */
|
|
158
|
+
async function readAutomationExecutionSummaries(type, namespace, options = {}) {
|
|
159
159
|
const nowMs = options.nowMs ?? Date.now();
|
|
160
160
|
const oneDayAgoMs = nowMs - 864e5;
|
|
161
161
|
const sevenDaysAgoMs = nowMs - 6048e5;
|
|
162
162
|
const thirtyDaysAgoMs = nowMs - 2592e6;
|
|
163
163
|
const ninetyDaysAgoMs = nowMs - 7776e6;
|
|
164
164
|
const db = getDb();
|
|
165
|
-
const latest = db.selectDistinctOn([
|
|
166
|
-
conversationId:
|
|
167
|
-
|
|
168
|
-
}).from(
|
|
165
|
+
const latest = db.selectDistinctOn([juniorAutomationExecutions.automationId], {
|
|
166
|
+
conversationId: juniorAutomationExecutions.conversationId,
|
|
167
|
+
automationId: juniorAutomationExecutions.automationId
|
|
168
|
+
}).from(juniorAutomationExecutions).where(and(eq(juniorAutomationExecutions.kind, type), eq(juniorAutomationExecutions.namespace, namespace))).orderBy(juniorAutomationExecutions.automationId, desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId)).as("latest_task_execution");
|
|
169
169
|
const rows = await db.select({
|
|
170
170
|
lastConversationId: latest.conversationId,
|
|
171
|
-
lastExecutedAtMs: max(
|
|
172
|
-
runsLast1Day: sql`count(*) filter (where ${
|
|
173
|
-
runsLast7Days: sql`count(*) filter (where ${
|
|
174
|
-
runsLast30Days: sql`count(*) filter (where ${
|
|
175
|
-
runsLast90Days: sql`count(*) filter (where ${
|
|
176
|
-
|
|
171
|
+
lastExecutedAtMs: max(juniorAutomationExecutions.executedAtMs),
|
|
172
|
+
runsLast1Day: sql`count(*) filter (where ${juniorAutomationExecutions.executedAtMs} >= ${oneDayAgoMs})::int`,
|
|
173
|
+
runsLast7Days: sql`count(*) filter (where ${juniorAutomationExecutions.executedAtMs} >= ${sevenDaysAgoMs})::int`,
|
|
174
|
+
runsLast30Days: sql`count(*) filter (where ${juniorAutomationExecutions.executedAtMs} >= ${thirtyDaysAgoMs})::int`,
|
|
175
|
+
runsLast90Days: sql`count(*) filter (where ${juniorAutomationExecutions.executedAtMs} >= ${ninetyDaysAgoMs})::int`,
|
|
176
|
+
automationId: juniorAutomationExecutions.automationId,
|
|
177
177
|
totalRuns: sql`count(*)::int`
|
|
178
|
-
}).from(
|
|
179
|
-
return new Map(rows.map((row) => [row.
|
|
178
|
+
}).from(juniorAutomationExecutions).innerJoin(latest, eq(latest.automationId, juniorAutomationExecutions.automationId)).where(and(eq(juniorAutomationExecutions.kind, type), eq(juniorAutomationExecutions.namespace, namespace))).groupBy(juniorAutomationExecutions.automationId, latest.conversationId);
|
|
179
|
+
return new Map(rows.map((row) => [row.automationId, {
|
|
180
180
|
...row.lastConversationId ? { lastConversationId: row.lastConversationId } : void 0,
|
|
181
181
|
...row.lastExecutedAtMs !== null ? { lastExecutedAtMs: row.lastExecutedAtMs } : void 0,
|
|
182
182
|
runs: {
|
|
@@ -189,18 +189,18 @@ async function readTaskExecutionSummaries(type, namespace, options = {}) {
|
|
|
189
189
|
}]));
|
|
190
190
|
}
|
|
191
191
|
/** Load a fixed trailing window of completed executions stacked by task type. */
|
|
192
|
-
async function
|
|
192
|
+
async function readAutomationExecutionDays(dayCount = 90, options = {}) {
|
|
193
193
|
const end = utcDate(options.nowMs ?? Date.now());
|
|
194
194
|
const endMs = Date.parse(`${end}T23:59:59.999Z`);
|
|
195
195
|
const startMs = Date.parse(`${end}T00:00:00.000Z`) - (dayCount - 1) * 864e5;
|
|
196
|
-
const executionDate = sql`to_char(to_timestamp(${
|
|
196
|
+
const executionDate = sql`to_char(to_timestamp(${juniorAutomationExecutions.executedAtMs} / 1000.0) at time zone 'UTC', 'YYYY-MM-DD')`;
|
|
197
197
|
const conversationCost = conversationUsageCostExpr(juniorConversations.usage);
|
|
198
198
|
const rows = await getDb().select({
|
|
199
199
|
count: count(),
|
|
200
200
|
costUsd: sql`SUM(${conversationCost})::double precision`,
|
|
201
201
|
date: executionDate,
|
|
202
|
-
kind:
|
|
203
|
-
}).from(
|
|
202
|
+
kind: juniorAutomationExecutions.kind
|
|
203
|
+
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), eq(juniorAutomationExecutions.status, "completed"))).groupBy(executionDate, juniorAutomationExecutions.kind).orderBy(asc(executionDate), asc(juniorAutomationExecutions.kind));
|
|
204
204
|
const byDate = /* @__PURE__ */ new Map();
|
|
205
205
|
for (let offset = 0; offset < dayCount; offset += 1) {
|
|
206
206
|
const date = utcDate(startMs + offset * 864e5);
|
|
@@ -216,20 +216,20 @@ async function readTaskExecutionDays(dayCount = 90, options = {}) {
|
|
|
216
216
|
return [...byDate.values()];
|
|
217
217
|
}
|
|
218
218
|
/** Load a fixed trailing window of completed executions stacked by hour. */
|
|
219
|
-
async function
|
|
219
|
+
async function readAutomationExecutionHours(hourCount = 168, options = {}) {
|
|
220
220
|
const nowMs = options.nowMs ?? Date.now();
|
|
221
221
|
const end = new Date(nowMs);
|
|
222
222
|
end.setUTCMinutes(0, 0, 0);
|
|
223
223
|
const endMs = end.getTime() + 3599999;
|
|
224
224
|
const startMs = end.getTime() - (hourCount - 1) * 36e5;
|
|
225
|
-
const executionHour = sql`to_char(to_timestamp(${
|
|
225
|
+
const executionHour = sql`to_char(to_timestamp(${juniorAutomationExecutions.executedAtMs} / 1000.0) at time zone 'UTC', 'YYYY-MM-DD"T"HH24')`;
|
|
226
226
|
const conversationCost = conversationUsageCostExpr(juniorConversations.usage);
|
|
227
227
|
const rows = await getDb().select({
|
|
228
228
|
count: count(),
|
|
229
229
|
costUsd: sql`SUM(${conversationCost})::double precision`,
|
|
230
230
|
date: executionHour,
|
|
231
|
-
kind:
|
|
232
|
-
}).from(
|
|
231
|
+
kind: juniorAutomationExecutions.kind
|
|
232
|
+
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), eq(juniorAutomationExecutions.status, "completed"))).groupBy(executionHour, juniorAutomationExecutions.kind).orderBy(asc(executionHour), asc(juniorAutomationExecutions.kind));
|
|
233
233
|
const byHour = /* @__PURE__ */ new Map();
|
|
234
234
|
for (let offset = 0; offset < hourCount; offset += 1) {
|
|
235
235
|
const date = new Date(startMs + offset * 36e5).toISOString().slice(0, 13);
|
|
@@ -244,60 +244,60 @@ async function readTaskExecutionHours(hourCount = 168, options = {}) {
|
|
|
244
244
|
}
|
|
245
245
|
return [...byHour.values()];
|
|
246
246
|
}
|
|
247
|
-
/** Load the newest terminal
|
|
248
|
-
async function
|
|
247
|
+
/** Load the newest terminal automation execution linked to one conversation, if any. */
|
|
248
|
+
async function readAutomationExecutionByConversationId(args) {
|
|
249
249
|
const namespace = args.namespace ?? "junior";
|
|
250
250
|
const row = (await getDb().select({
|
|
251
|
-
kind:
|
|
252
|
-
|
|
253
|
-
}).from(
|
|
251
|
+
kind: juniorAutomationExecutions.kind,
|
|
252
|
+
automationId: juniorAutomationExecutions.automationId
|
|
253
|
+
}).from(juniorAutomationExecutions).where(and(eq(juniorAutomationExecutions.conversationId, args.conversationId), eq(juniorAutomationExecutions.namespace, namespace), inArray(juniorAutomationExecutions.kind, [...AUTOMATION_EXECUTION_TYPES]))).orderBy(desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId)).limit(1))[0];
|
|
254
254
|
if (!row) return void 0;
|
|
255
255
|
if (row.kind !== "scheduled" && row.kind !== "event") return void 0;
|
|
256
256
|
return {
|
|
257
257
|
kind: row.kind,
|
|
258
|
-
|
|
258
|
+
automationId: row.automationId
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
|
-
/** Load newest-first executions for one
|
|
262
|
-
async function
|
|
261
|
+
/** Load newest-first executions for one automation, with conversation titles when present. */
|
|
262
|
+
async function readAutomationExecutions(args) {
|
|
263
263
|
const namespace = args.namespace ?? "junior";
|
|
264
264
|
return (await getDb().select({
|
|
265
|
-
conversationId:
|
|
265
|
+
conversationId: juniorAutomationExecutions.conversationId,
|
|
266
266
|
durationMs: juniorConversations.durationMs,
|
|
267
|
-
executedAtMs:
|
|
268
|
-
executionId:
|
|
269
|
-
status:
|
|
267
|
+
executedAtMs: juniorAutomationExecutions.executedAtMs,
|
|
268
|
+
executionId: juniorAutomationExecutions.executionId,
|
|
269
|
+
status: juniorAutomationExecutions.status,
|
|
270
270
|
title: juniorConversations.title,
|
|
271
271
|
usage: juniorConversations.usage
|
|
272
|
-
}).from(
|
|
272
|
+
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(eq(juniorAutomationExecutions.kind, args.kind), eq(juniorAutomationExecutions.namespace, namespace), eq(juniorAutomationExecutions.automationId, args.automationId))).orderBy(desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId)).limit(args.limit)).map((row) => mapAutomationExecutionRecord(row));
|
|
273
273
|
}
|
|
274
274
|
/** Load newest-first executions for the supplied viewer-visible tasks. */
|
|
275
|
-
async function
|
|
276
|
-
const
|
|
275
|
+
async function readAutomationRuns(args) {
|
|
276
|
+
const automations = args.automations ?? [];
|
|
277
277
|
const conversationIds = [...new Set((args.conversationIds ?? []).filter((conversationId) => conversationId.trim().length > 0))];
|
|
278
|
-
if (
|
|
278
|
+
if (automations.length === 0 && conversationIds.length === 0) return [];
|
|
279
279
|
const namespace = args.namespace ?? "junior";
|
|
280
|
-
const selectors = [...
|
|
280
|
+
const selectors = [...automations.map((task) => and(eq(juniorAutomationExecutions.kind, task.kind), eq(juniorAutomationExecutions.automationId, task.automationId))), ...conversationIds.length > 0 ? [inArray(juniorAutomationExecutions.conversationId, conversationIds)] : []];
|
|
281
281
|
return (await getDb().select({
|
|
282
|
-
conversationId:
|
|
282
|
+
conversationId: juniorAutomationExecutions.conversationId,
|
|
283
283
|
durationMs: juniorConversations.durationMs,
|
|
284
|
-
executedAtMs:
|
|
285
|
-
executionId:
|
|
286
|
-
kind:
|
|
287
|
-
status:
|
|
288
|
-
|
|
284
|
+
executedAtMs: juniorAutomationExecutions.executedAtMs,
|
|
285
|
+
executionId: juniorAutomationExecutions.executionId,
|
|
286
|
+
kind: juniorAutomationExecutions.kind,
|
|
287
|
+
status: juniorAutomationExecutions.status,
|
|
288
|
+
automationId: juniorAutomationExecutions.automationId,
|
|
289
289
|
title: juniorConversations.title,
|
|
290
290
|
usage: juniorConversations.usage
|
|
291
|
-
}).from(
|
|
291
|
+
}).from(juniorAutomationExecutions).leftJoin(juniorConversations, eq(juniorConversations.conversationId, juniorAutomationExecutions.conversationId)).where(and(eq(juniorAutomationExecutions.namespace, namespace), or(...selectors))).orderBy(desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId)).limit(args.limit)).flatMap((row) => {
|
|
292
292
|
if (row.kind !== "scheduled" && row.kind !== "event") return [];
|
|
293
293
|
return [{
|
|
294
|
-
...
|
|
294
|
+
...mapAutomationExecutionRecord(row),
|
|
295
295
|
kind: row.kind,
|
|
296
|
-
|
|
296
|
+
automationId: row.automationId
|
|
297
297
|
}];
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function mapAutomationExecutionRecord(row) {
|
|
301
301
|
const title = row.title?.trim();
|
|
302
302
|
const costUsd = agentTurnCostUsd(row.usage ?? void 0);
|
|
303
303
|
const totalTokens = agentTurnTotalTokens(row.usage ?? void 0);
|
|
@@ -313,19 +313,19 @@ function mapTaskExecutionRecord(row) {
|
|
|
313
313
|
...totalTokens !== void 0 ? { totalTokens } : void 0
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
|
-
/** Load a fixed trailing window of terminal executions for one
|
|
317
|
-
async function
|
|
316
|
+
/** Load a fixed trailing window of terminal executions for one automation by status. */
|
|
317
|
+
async function readAutomationExecutionStatusDays(args) {
|
|
318
318
|
const dayCount = args.dayCount ?? 90;
|
|
319
319
|
const namespace = args.namespace ?? "junior";
|
|
320
320
|
const end = utcDate(args.nowMs ?? Date.now());
|
|
321
321
|
const endMs = Date.parse(`${end}T23:59:59.999Z`);
|
|
322
322
|
const startMs = Date.parse(`${end}T00:00:00.000Z`) - (dayCount - 1) * 864e5;
|
|
323
|
-
const executionDate = sql`to_char(to_timestamp(${
|
|
323
|
+
const executionDate = sql`to_char(to_timestamp(${juniorAutomationExecutions.executedAtMs} / 1000.0) at time zone 'UTC', 'YYYY-MM-DD')`;
|
|
324
324
|
const rows = await getDb().select({
|
|
325
325
|
count: count(),
|
|
326
326
|
date: executionDate,
|
|
327
|
-
status:
|
|
328
|
-
}).from(
|
|
327
|
+
status: juniorAutomationExecutions.status
|
|
328
|
+
}).from(juniorAutomationExecutions).where(and(eq(juniorAutomationExecutions.kind, args.kind), eq(juniorAutomationExecutions.namespace, namespace), eq(juniorAutomationExecutions.automationId, args.automationId), gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), inArray(juniorAutomationExecutions.status, [...AUTOMATION_EXECUTION_STATUSES]))).groupBy(executionDate, juniorAutomationExecutions.status).orderBy(asc(executionDate), asc(juniorAutomationExecutions.status));
|
|
329
329
|
const byDate = /* @__PURE__ */ new Map();
|
|
330
330
|
for (let offset = 0; offset < dayCount; offset += 1) {
|
|
331
331
|
const date = utcDate(startMs + offset * 864e5);
|
|
@@ -340,8 +340,8 @@ async function readTaskExecutionStatusDays(args) {
|
|
|
340
340
|
}
|
|
341
341
|
return [...byDate.values()];
|
|
342
342
|
}
|
|
343
|
-
/** Load a fixed trailing window of terminal executions for one
|
|
344
|
-
async function
|
|
343
|
+
/** Load a fixed trailing window of terminal executions for one automation by hour. */
|
|
344
|
+
async function readAutomationExecutionStatusHours(args) {
|
|
345
345
|
const hourCount = args.hourCount ?? 168;
|
|
346
346
|
const namespace = args.namespace ?? "junior";
|
|
347
347
|
const nowMs = args.nowMs ?? Date.now();
|
|
@@ -349,12 +349,12 @@ async function readTaskExecutionStatusHours(args) {
|
|
|
349
349
|
end.setUTCMinutes(0, 0, 0);
|
|
350
350
|
const endMs = end.getTime() + 3599999;
|
|
351
351
|
const startMs = end.getTime() - (hourCount - 1) * 36e5;
|
|
352
|
-
const executionHour = sql`to_char(to_timestamp(${
|
|
352
|
+
const executionHour = sql`to_char(to_timestamp(${juniorAutomationExecutions.executedAtMs} / 1000.0) at time zone 'UTC', 'YYYY-MM-DD"T"HH24')`;
|
|
353
353
|
const rows = await getDb().select({
|
|
354
354
|
count: count(),
|
|
355
355
|
date: executionHour,
|
|
356
|
-
status:
|
|
357
|
-
}).from(
|
|
356
|
+
status: juniorAutomationExecutions.status
|
|
357
|
+
}).from(juniorAutomationExecutions).where(and(eq(juniorAutomationExecutions.kind, args.kind), eq(juniorAutomationExecutions.namespace, namespace), eq(juniorAutomationExecutions.automationId, args.automationId), gte(juniorAutomationExecutions.executedAtMs, startMs), lte(juniorAutomationExecutions.executedAtMs, endMs), inArray(juniorAutomationExecutions.status, [...AUTOMATION_EXECUTION_STATUSES]))).groupBy(executionHour, juniorAutomationExecutions.status).orderBy(asc(executionHour), asc(juniorAutomationExecutions.status));
|
|
358
358
|
const byHour = /* @__PURE__ */ new Map();
|
|
359
359
|
for (let offset = 0; offset < hourCount; offset += 1) {
|
|
360
360
|
const date = new Date(startMs + offset * 36e5).toISOString().slice(0, 13);
|
|
@@ -370,4 +370,4 @@ async function readTaskExecutionStatusHours(args) {
|
|
|
370
370
|
return [...byHour.values()];
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
373
|
-
export {
|
|
373
|
+
export { readAutomationExecutionStatusDays as a, readAutomationExecutions as c, conversationActiveDaysColumn as d, conversationAggregateColumns as f, readAutomationExecutionHours as i, readAutomationRuns as l, readAutomationExecutionByConversationId as n, readAutomationExecutionStatusHours as o, conversationRangeColumns as p, readAutomationExecutionDays as r, readAutomationExecutionSummaries as s, emptyAutomationRunWindows as t, recordAutomationExecution as u };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./config-
|
|
1
|
+
import "./config-G2gv97R1.js";
|
|
2
2
|
import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { getTableColumns, sql } from "drizzle-orm";
|
|
5
|
-
import { bigint, boolean, check, date, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
5
|
+
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
6
6
|
import { Pool } from "@neondatabase/serverless";
|
|
7
7
|
import { drizzle } from "drizzle-orm/neon-serverless";
|
|
8
8
|
import { migrate } from "drizzle-orm/neon-serverless/migrator";
|
|
@@ -247,6 +247,33 @@ const juniorConversationEvents = pgTable("junior_conversation_events", {
|
|
|
247
247
|
uniqueIndex("junior_conversation_events_idempotency_idx").on(table.conversationId, table.idempotencyKey)
|
|
248
248
|
]);
|
|
249
249
|
//#endregion
|
|
250
|
+
//#region src/db/schema/conversation-briefs.ts
|
|
251
|
+
/** Append-only Brief versions produced for completed Conversation turns. */
|
|
252
|
+
const juniorConversationBriefs = pgTable("junior_conversation_briefs", {
|
|
253
|
+
conversationId: text("conversation_id").notNull(),
|
|
254
|
+
version: integer("version").notNull(),
|
|
255
|
+
turnId: text("turn_id").notNull(),
|
|
256
|
+
throughSeq: integer("through_seq").notNull(),
|
|
257
|
+
content: jsonb("content").$type().notNull(),
|
|
258
|
+
searchText: text("search_text").notNull(),
|
|
259
|
+
modelId: text("model_id").notNull(),
|
|
260
|
+
costUsd: doublePrecision("cost_usd"),
|
|
261
|
+
createdAt: timestamptz("created_at").defaultNow().notNull()
|
|
262
|
+
}, (table) => [
|
|
263
|
+
primaryKey({
|
|
264
|
+
name: "junior_conversation_briefs_conversation_id_version_pk",
|
|
265
|
+
columns: [table.conversationId, table.version]
|
|
266
|
+
}),
|
|
267
|
+
foreignKey({
|
|
268
|
+
name: "junior_conversation_briefs_conversation_id_junior_conversations_conversation_id_fk",
|
|
269
|
+
columns: [table.conversationId],
|
|
270
|
+
foreignColumns: [juniorConversations.conversationId]
|
|
271
|
+
}).onDelete("cascade"),
|
|
272
|
+
uniqueIndex("junior_conversation_briefs_conversation_turn_idx").on(table.conversationId, table.turnId),
|
|
273
|
+
index("junior_conversation_briefs_conversation_version_idx").on(table.conversationId, table.version.desc()),
|
|
274
|
+
index("junior_conversation_briefs_search_idx").using("gin", sql`to_tsvector('english', ${table.searchText})`)
|
|
275
|
+
]);
|
|
276
|
+
//#endregion
|
|
250
277
|
//#region src/db/schema/conversation-bindings.ts
|
|
251
278
|
/** Provider conversation coordinates bound to Junior's opaque durable conversation id. */
|
|
252
279
|
const juniorConversationBindings = pgTable("junior_conversation_bindings", {
|
|
@@ -326,8 +353,8 @@ const juniorLocationConfigurations = pgTable("junior_location_configurations", {
|
|
|
326
353
|
expiresAt: text("expires_at")
|
|
327
354
|
}, (table) => [primaryKey({ columns: [table.locationId, table.key] })]);
|
|
328
355
|
//#endregion
|
|
329
|
-
//#region src/db/schema/event-
|
|
330
|
-
const
|
|
356
|
+
//#region src/db/schema/event-automations.ts
|
|
357
|
+
const juniorEventAutomations = pgTable("junior_event_tasks", {
|
|
331
358
|
id: text("id").primaryKey(),
|
|
332
359
|
teamId: text("team_id").notNull(),
|
|
333
360
|
namespace: text("namespace").notNull(),
|
|
@@ -362,13 +389,13 @@ const juniorStats = pgTable("junior_stats", {
|
|
|
362
389
|
]
|
|
363
390
|
})]);
|
|
364
391
|
//#endregion
|
|
365
|
-
//#region src/db/schema/
|
|
366
|
-
/** One terminal
|
|
367
|
-
const
|
|
392
|
+
//#region src/db/schema/automation-executions.ts
|
|
393
|
+
/** One terminal automation execution linked to its durable conversation when present. */
|
|
394
|
+
const juniorAutomationExecutions = pgTable("junior_task_executions", {
|
|
368
395
|
executionId: text("execution_id").notNull(),
|
|
369
396
|
kind: text("kind").notNull(),
|
|
370
397
|
namespace: text("namespace").notNull(),
|
|
371
|
-
|
|
398
|
+
automationId: text("task_id").notNull(),
|
|
372
399
|
conversationId: text("conversation_id"),
|
|
373
400
|
executedAtMs: bigint("executed_at_ms", { mode: "number" }).notNull(),
|
|
374
401
|
status: text("status").$type().notNull()
|
|
@@ -388,12 +415,12 @@ const juniorTaskExecutions = pgTable("junior_task_executions", {
|
|
|
388
415
|
columns: [table.conversationId],
|
|
389
416
|
foreignColumns: [juniorConversations.conversationId]
|
|
390
417
|
}),
|
|
391
|
-
index("junior_task_executions_task_time_idx").on(table.kind, table.namespace, table.
|
|
418
|
+
index("junior_task_executions_task_time_idx").on(table.kind, table.namespace, table.automationId, table.executedAtMs),
|
|
392
419
|
index("junior_task_executions_time_kind_idx").on(table.executedAtMs, table.kind),
|
|
393
420
|
index("junior_task_executions_conversation_time_idx").on(table.conversationId, table.executedAtMs)
|
|
394
421
|
]);
|
|
395
422
|
//#endregion
|
|
396
|
-
//#region src/db/schema/scheduled-
|
|
423
|
+
//#region src/db/schema/scheduled-automations.ts
|
|
397
424
|
const juniorSchedulerTasks = pgTable("junior_scheduler_tasks", {
|
|
398
425
|
id: text("id").primaryKey(),
|
|
399
426
|
teamId: text("team_id").notNull(),
|
|
@@ -487,16 +514,17 @@ const juniorSqlSchema = {
|
|
|
487
514
|
juniorAgentBindings,
|
|
488
515
|
juniorAgentInvocations,
|
|
489
516
|
juniorConversationEvents,
|
|
517
|
+
juniorConversationBriefs,
|
|
490
518
|
juniorConversationBindings,
|
|
491
519
|
juniorConversationParticipants,
|
|
492
520
|
juniorConversations,
|
|
493
521
|
juniorLocationConfigurations,
|
|
494
522
|
juniorDestinations,
|
|
495
|
-
|
|
523
|
+
juniorEventAutomations,
|
|
496
524
|
juniorIdentities,
|
|
497
525
|
juniorSnapshots,
|
|
498
526
|
juniorStats,
|
|
499
|
-
|
|
527
|
+
juniorAutomationExecutions,
|
|
500
528
|
juniorSchedulerRuns,
|
|
501
529
|
juniorSchedulerTasks,
|
|
502
530
|
juniorUsers,
|
|
@@ -718,4 +746,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
718
746
|
});
|
|
719
747
|
}
|
|
720
748
|
//#endregion
|
|
721
|
-
export {
|
|
749
|
+
export { conversationReadColumns as C, juniorArtifacts as D, juniorUsers as E, juniorAttachments as S, juniorIdentities as T, juniorConversationEvents as _, juniorSchedulerRuns as a, juniorCodeChanges as b, juniorStats as c, AGENT_INVOCATION_MAILBOX_STATUSES as d, juniorAgentBindings as f, juniorConversationBriefs as g, juniorConversationBindings as h, juniorWorkspaces as i, juniorEventAutomations as l, juniorConversationParticipants as m, juniorSnapshots as n, juniorSchedulerTasks as o, juniorAgentInvocations as p, juniorWorkspaceRepos as r, juniorAutomationExecutions as s, createJuniorSqlExecutor as t, juniorLocationConfigurations as u, juniorApiTokens as v, juniorConversations as w, juniorCodeRepositories as x, juniorConversationAnnotations as y };
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { M as getDeploymentServiceVersion, N as getDeploymentTelemetryAttributes } from "./logging-Dx0S5k2z.js";
|
|
2
2
|
import { a as getClient, c as init, g as vercelAIIntegration, o as getGlobalScope, y as withStreamedSpan } from "./sentry-CD3SdJl-.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-BUfel19D.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 {
|
|
1
|
+
import { a as getChatConfig } from "./config-G2gv97R1.js";
|
|
2
2
|
import { a as signQueueMessage, i as QUEUE_SIGNATURE_MAX_AGE_MS, o as verifyQueueMessage, s as createVercelQueueClient } from "./vercel-queue-DIkVcfK4.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -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, v as withScope } from "./sentry-CD3SdJl-.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-C71UcRWw.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";
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { n as JuniorDashboardOptions } from "./app-DfNrn_gS.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-BI9A1vKA.js";
|
|
3
3
|
//#region src/nitro.d.ts
|
|
4
4
|
export type JuniorNitroDashboardOptions = JuniorDashboardOptions;
|
package/dist/nitro.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, D as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, E as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_RETENTION_CRON_SCHEDULE, T as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_RETENTION_ROUTE, w as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE } from "./logging-Dx0S5k2z.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-7a9YqLhE.js";
|
|
3
3
|
import { n as resolveConversationWorkQueueTopic } from "./vercel-queue-DIkVcfK4.js";
|
|
4
|
-
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
4
|
+
import { t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-rnAPfUhP.js";
|
|
5
5
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
6
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
6
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-D8I1_5wP.js";
|
|
7
7
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-BKGOXca2.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Y as createUserTokenStore } from "./agent-CmQlX68D.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-D04NWqMR.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 { i as abandonTurnRecord, yt as extractAssistantText } from "./checkpoint-
|
|
2
|
-
import { Kt as buildDeterministicTurnId } from "./stats-
|
|
1
|
+
import { i as abandonTurnRecord, yt as extractAssistantText } from "./checkpoint-B-JO5F3c.js";
|
|
2
|
+
import { Kt as buildDeterministicTurnId } from "./stats-CFlUGqVA.js";
|
|
3
3
|
//#region src/chat/runtime/turn.ts
|
|
4
4
|
/** Classified Slack turn failure carrying the owning Sentry capture outward. */
|
|
5
5
|
var ConversationTurnBoundaryError = class extends Error {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-
|
|
3
|
-
import {
|
|
1
|
+
import { w as toOptionalTrimmed } from "./client-Bp297GA0.js";
|
|
2
|
+
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-Dx0S5k2z.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-G2gv97R1.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-1BZEOR8J.js";
|
|
4
5
|
import { createHash } from "node:crypto";
|
|
5
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
6
7
|
import { createRedisState } from "@chat-adapter/state-redis";
|