@sentry/junior 0.206.0 → 0.208.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-C9yuiZUF.js → agent-BfxfHsf1.js} +375 -346
- package/dist/{agent-hooks-DNjlz2A-.js → agent-hooks-CuGjLjmR.js} +224 -97
- package/dist/{agent-runner-E67lFrDG.js → agent-runner-Dz1PMKP0.js} +9 -9
- package/dist/api/schema.d.ts +39 -39
- package/dist/api/schema.js +2 -2
- package/dist/api.d.ts +1 -1
- package/dist/api.js +154 -154
- package/dist/{app-AxGmJHwK.d.ts → app-DfNrn_gS.d.ts} +2 -2
- package/dist/app.d.ts +1 -1
- package/dist/app.js +185 -183
- package/dist/{auth-pause-state-MVZ6xvEK.js → auth-pause-state-Bjoh8wCy.js} +7 -7
- package/dist/{briefs-CvJFQvhJ.js → briefs-q_onrGmf.js} +3 -3
- package/dist/{catalog-runtime-TBR8n4e1.js → catalog-runtime-D8YUMNhb.js} +1 -1
- package/dist/{checkpoint-BY47jJCB.js → checkpoint-FKMcINix.js} +8 -8
- package/dist/cli/chat.js +13 -13
- 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.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-ceE7NtvC.js → client-bRyPqwAV.js} +4 -4
- package/dist/{config-CIE83sR2.js → config-EtF2uEaW.js} +6 -6
- package/dist/{context-B45_WqVX.js → context-Bplcgypl.js} +13 -13
- package/dist/{conversation-privacy-Auyq26XQ.js → conversation-privacy-whGaV2TG.js} +1 -1
- package/dist/{credential-sync-BO33aNQd.js → credential-sync-DM-EE1ey.js} +21 -21
- package/dist/{db-BeyXKJOI.d.ts → db-D74z7BZH.d.ts} +1 -1
- package/dist/{execution-stats-SiS2FLcv.js → execution-stats-C-f8zwMU.js} +77 -77
- package/dist/{executor-BfbYPW63.js → executor-BW5qp0jC.js} +43 -14
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-CyTc24Es.js → job-queue-BIHNIEIX.js} +1 -1
- package/dist/{logging-D37bayDc.js → logging-sNS84Yuu.js} +1 -1
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-BtfOeHTZ.js → oauth-callback-server-Co6D_yXP.js} +2 -2
- package/dist/{pending-auth-BPUzcs7n.js → pending-auth-CRJCt9Ux.js} +2 -2
- package/dist/{profile-CSixooTi.js → profile-BfLMVhWo.js} +4 -4
- package/dist/{prompt-3gqNY1Ka.js → prompt-x-0ZtTyb.js} +14 -14
- package/dist/{registry-DiR0-xRg.js → registry-Cyww_jnC.js} +2 -2
- package/dist/{resolve-Bn5q__9b.js → resolve-BApIFQXX.js} +2 -2
- package/dist/{runner-DFx3dIJH.js → runner-C9okx4GL.js} +10 -10
- package/dist/{sandbox-egress-signals-bwvjihxA.js → sandbox-egress-signals-BHfx0esj.js} +1 -1
- package/dist/{schema-8GXFfclK.js → schema-CwTeb-BF.js} +39 -39
- package/dist/{skills-BhM5qyCF.js → skills-DhL_wXEp.js} +2 -2
- package/dist/{spawn-Dk0PqdH6.js → spawn-msnzfE8_.js} +2 -2
- package/dist/{stats-DKRP4rsY.js → stats-Cq5w_Awk.js} +292 -268
- package/dist/{store-C5qxF2ac.d.ts → store-Det8MQ9g.d.ts} +1 -1
- package/dist/{task-queue-CdpTvu4R.js → task-queue-JfmWmpjS.js} +3 -3
- package/dist/{task-runner-alpjVSxQ.js → task-runner-Cm0gXoLH.js} +15 -15
- package/dist/{thread-state-CRK7aA41.js → thread-state-lw2QwQ-y.js} +5 -5
- package/dist/{turn-execution-XtyzIHog.js → turn-execution-C7K6lQp1.js} +3 -3
- package/dist/{turn-lifecycle-VbwZLfBv.js → turn-lifecycle-DVlJLwB0.js} +1 -1
- package/dist/{usage-D4A48Bdl.js → usage-BMuAlKIW.js} +2 -2
- package/dist/{validation-jn_46o4U.js → validation-BI-r3iQA.js} +1 -1
- package/dist/{version-DcfJxB4z.js → version-s6smK6lP.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{web-authorization-CsfLSfEs.js → web-authorization-C9MxPvXX.js} +1 -1
- package/dist/{web-input-BPp_sc7t.js → web-input-CwVlaLd0.js} +7 -109
- package/dist/{work-Di-ubSGg.js → work-BK0W1QAt.js} +9 -9
- package/dist/{worker-Cu_D5Mr8.js → worker-D-WWKHQD.js} +5 -5
- package/migrations/0041_automation_outcomes_backfill.sql +27 -0
- package/migrations/meta/0041_snapshot.json +3516 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { f as logWarn } from "./logging-
|
|
2
|
-
import {
|
|
3
|
-
import { s as
|
|
4
|
-
import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-
|
|
1
|
+
import { f as logWarn } from "./logging-sNS84Yuu.js";
|
|
2
|
+
import { Gt as getDb } from "./agent-hooks-CuGjLjmR.js";
|
|
3
|
+
import { s as juniorAutomationExecutions, w as juniorConversations } from "./executor-BW5qp0jC.js";
|
|
4
|
+
import { n as agentTurnCostUsd, r as agentTurnTotalTokens } from "./usage-BMuAlKIW.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,4 +1,5 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import { h as startSpan } from "./sentry-CD3SdJl-.js";
|
|
2
|
+
import "./config-EtF2uEaW.js";
|
|
2
3
|
import { n as juniorDestinations, r as timestamptz } from "./destinations-BeBiJeEM.js";
|
|
3
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
5
|
import { getTableColumns, sql } from "drizzle-orm";
|
|
@@ -353,8 +354,8 @@ const juniorLocationConfigurations = pgTable("junior_location_configurations", {
|
|
|
353
354
|
expiresAt: text("expires_at")
|
|
354
355
|
}, (table) => [primaryKey({ columns: [table.locationId, table.key] })]);
|
|
355
356
|
//#endregion
|
|
356
|
-
//#region src/db/schema/event-
|
|
357
|
-
const
|
|
357
|
+
//#region src/db/schema/event-automations.ts
|
|
358
|
+
const juniorEventAutomations = pgTable("junior_event_tasks", {
|
|
358
359
|
id: text("id").primaryKey(),
|
|
359
360
|
teamId: text("team_id").notNull(),
|
|
360
361
|
namespace: text("namespace").notNull(),
|
|
@@ -389,13 +390,13 @@ const juniorStats = pgTable("junior_stats", {
|
|
|
389
390
|
]
|
|
390
391
|
})]);
|
|
391
392
|
//#endregion
|
|
392
|
-
//#region src/db/schema/
|
|
393
|
-
/** One terminal
|
|
394
|
-
const
|
|
393
|
+
//#region src/db/schema/automation-executions.ts
|
|
394
|
+
/** One terminal automation execution linked to its durable conversation when present. */
|
|
395
|
+
const juniorAutomationExecutions = pgTable("junior_task_executions", {
|
|
395
396
|
executionId: text("execution_id").notNull(),
|
|
396
397
|
kind: text("kind").notNull(),
|
|
397
398
|
namespace: text("namespace").notNull(),
|
|
398
|
-
|
|
399
|
+
automationId: text("task_id").notNull(),
|
|
399
400
|
conversationId: text("conversation_id"),
|
|
400
401
|
executedAtMs: bigint("executed_at_ms", { mode: "number" }).notNull(),
|
|
401
402
|
status: text("status").$type().notNull()
|
|
@@ -415,12 +416,12 @@ const juniorTaskExecutions = pgTable("junior_task_executions", {
|
|
|
415
416
|
columns: [table.conversationId],
|
|
416
417
|
foreignColumns: [juniorConversations.conversationId]
|
|
417
418
|
}),
|
|
418
|
-
index("junior_task_executions_task_time_idx").on(table.kind, table.namespace, table.
|
|
419
|
+
index("junior_task_executions_task_time_idx").on(table.kind, table.namespace, table.automationId, table.executedAtMs),
|
|
419
420
|
index("junior_task_executions_time_kind_idx").on(table.executedAtMs, table.kind),
|
|
420
421
|
index("junior_task_executions_conversation_time_idx").on(table.conversationId, table.executedAtMs)
|
|
421
422
|
]);
|
|
422
423
|
//#endregion
|
|
423
|
-
//#region src/db/schema/scheduled-
|
|
424
|
+
//#region src/db/schema/scheduled-automations.ts
|
|
424
425
|
const juniorSchedulerTasks = pgTable("junior_scheduler_tasks", {
|
|
425
426
|
id: text("id").primaryKey(),
|
|
426
427
|
teamId: text("team_id").notNull(),
|
|
@@ -520,11 +521,11 @@ const juniorSqlSchema = {
|
|
|
520
521
|
juniorConversations,
|
|
521
522
|
juniorLocationConfigurations,
|
|
522
523
|
juniorDestinations,
|
|
523
|
-
|
|
524
|
+
juniorEventAutomations,
|
|
524
525
|
juniorIdentities,
|
|
525
526
|
juniorSnapshots,
|
|
526
527
|
juniorStats,
|
|
527
|
-
|
|
528
|
+
juniorAutomationExecutions,
|
|
528
529
|
juniorSchedulerRuns,
|
|
529
530
|
juniorSchedulerTasks,
|
|
530
531
|
juniorUsers,
|
|
@@ -532,6 +533,34 @@ const juniorSqlSchema = {
|
|
|
532
533
|
juniorWorkspaces
|
|
533
534
|
};
|
|
534
535
|
//#endregion
|
|
536
|
+
//#region src/db/tracing.ts
|
|
537
|
+
const traced = Symbol("junior.db.traced");
|
|
538
|
+
const SQL_OPERATION = /^[\s;]*(ALTER|CALL|CREATE|DELETE|DROP|INSERT|MERGE|SELECT|TRUNCATE|UPDATE)\b/i;
|
|
539
|
+
function operationFromQuery(query) {
|
|
540
|
+
const text = typeof query === "string" ? query : query && typeof query === "object" && "text" in query ? query.text : void 0;
|
|
541
|
+
return typeof text === "string" ? SQL_OPERATION.exec(text)?.[1]?.toUpperCase() : void 0;
|
|
542
|
+
}
|
|
543
|
+
/** Add safe database spans to an owned PostgreSQL query client. */
|
|
544
|
+
function traceQueries(client, driver) {
|
|
545
|
+
if (client[traced]) return client;
|
|
546
|
+
client[traced] = true;
|
|
547
|
+
const query = client.query.bind(client);
|
|
548
|
+
client.query = ((...args) => {
|
|
549
|
+
const operation = operationFromQuery(args[0]);
|
|
550
|
+
return startSpan({
|
|
551
|
+
name: operation ?? "postgresql",
|
|
552
|
+
op: "db.query",
|
|
553
|
+
onlyIfParent: true,
|
|
554
|
+
attributes: {
|
|
555
|
+
"db.system.name": "postgresql",
|
|
556
|
+
...operation ? { "db.operation.name": operation } : void 0,
|
|
557
|
+
"app.db.driver": driver
|
|
558
|
+
}
|
|
559
|
+
}, () => query(...args));
|
|
560
|
+
});
|
|
561
|
+
return client;
|
|
562
|
+
}
|
|
563
|
+
//#endregion
|
|
535
564
|
//#region src/db/neon.ts
|
|
536
565
|
var NeonExecutor = class {
|
|
537
566
|
pool;
|
|
@@ -619,7 +648,7 @@ var NeonExecutor = class {
|
|
|
619
648
|
await this.pool.end();
|
|
620
649
|
}
|
|
621
650
|
queryClient() {
|
|
622
|
-
return this.transactionClient.getStore() ?? this.pool;
|
|
651
|
+
return traceQueries(this.transactionClient.getStore() ?? this.pool, "neon");
|
|
623
652
|
}
|
|
624
653
|
};
|
|
625
654
|
/** Create the shared Neon-backed Junior SQL executor. */
|
|
@@ -719,7 +748,7 @@ var PostgresExecutor = class {
|
|
|
719
748
|
await this.pool.end();
|
|
720
749
|
}
|
|
721
750
|
queryClient() {
|
|
722
|
-
return this.transactionClient.getStore() ?? this.pool;
|
|
751
|
+
return traceQueries(this.transactionClient.getStore() ?? this.pool, "postgres");
|
|
723
752
|
}
|
|
724
753
|
};
|
|
725
754
|
/** Create the shared Node Postgres-backed Junior SQL executor. */
|
|
@@ -746,4 +775,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
746
775
|
});
|
|
747
776
|
}
|
|
748
777
|
//#endregion
|
|
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,
|
|
778
|
+
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-sNS84Yuu.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-whGaV2TG.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 { a as getChatConfig } from "./config-
|
|
1
|
+
import { a as getChatConfig } from "./config-EtF2uEaW.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-s6smK6lP.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-sNS84Yuu.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-BIHNIEIX.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-JfmWmpjS.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 { Y as createUserTokenStore } from "./agent-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Y as createUserTokenStore } from "./agent-BfxfHsf1.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DM-EE1ey.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-FKMcINix.js";
|
|
2
|
+
import { Kt as buildDeterministicTurnId } from "./stats-Cq5w_Awk.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,7 +1,7 @@
|
|
|
1
|
-
import { w as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-
|
|
3
|
-
import { a as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { w as toOptionalTrimmed } from "./client-bRyPqwAV.js";
|
|
2
|
+
import { _ as setSpanAttributes, v as setSpanStatus } from "./logging-sNS84Yuu.js";
|
|
3
|
+
import { a as getChatConfig } from "./config-EtF2uEaW.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-D8YUMNhb.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";
|
|
@@ -407,36 +407,36 @@ async function generateBrief(args) {
|
|
|
407
407
|
};
|
|
408
408
|
}
|
|
409
409
|
//#endregion
|
|
410
|
-
//#region src/chat/
|
|
410
|
+
//#region src/chat/events/actor.ts
|
|
411
411
|
/**
|
|
412
|
-
* System author ID stamped on
|
|
412
|
+
* System author ID stamped on event mailbox messages.
|
|
413
413
|
*
|
|
414
414
|
* Keep this stable so conversation history can recognize the same system input
|
|
415
|
-
* for
|
|
415
|
+
* for event Turns.
|
|
416
416
|
*
|
|
417
|
-
* TODO(dcramer): Delete this ID after resumes read
|
|
417
|
+
* TODO(dcramer): Delete this ID after resumes read event Source.kind
|
|
418
418
|
* from the Turn checkpoint instead of Message author data.
|
|
419
419
|
*/
|
|
420
|
-
const
|
|
421
|
-
/** System Message author for
|
|
422
|
-
const
|
|
420
|
+
const EVENT_AUTHOR_ID = "UJRNEVENT";
|
|
421
|
+
/** System Message author for event input. */
|
|
422
|
+
const EVENT_MESSAGE_AUTHOR = {
|
|
423
423
|
fullName: "Junior event",
|
|
424
424
|
isBot: true,
|
|
425
|
-
userId:
|
|
425
|
+
userId: EVENT_AUTHOR_ID,
|
|
426
426
|
userName: "junior-event"
|
|
427
427
|
};
|
|
428
|
-
/** System execution actor for every
|
|
429
|
-
const
|
|
428
|
+
/** System execution actor for every event turn. */
|
|
429
|
+
const EVENT_SYSTEM_ACTOR = {
|
|
430
430
|
platform: "system",
|
|
431
|
-
name: "
|
|
431
|
+
name: "event"
|
|
432
432
|
};
|
|
433
433
|
/**
|
|
434
|
-
* Whether a saved Message started a
|
|
434
|
+
* Whether a saved Message started a event Turn.
|
|
435
435
|
*
|
|
436
436
|
* TODO(dcramer): Delete this marker check after deployed Turn cursors all store
|
|
437
437
|
* Source and Actor. `eventType` only supports saved synthetic Slack input.
|
|
438
438
|
*/
|
|
439
|
-
function
|
|
439
|
+
function isEventConversationMessage(message) {
|
|
440
440
|
return Boolean(message.meta?.eventType) || message.author?.userId === "UJRNEVENT";
|
|
441
441
|
}
|
|
442
442
|
//#endregion
|
|
@@ -549,4 +549,4 @@ Rules:
|
|
|
549
549
|
- Keep the summary under 600 characters, intent under 400 characters, outcome text under 600 characters, and each other string under 400 characters.
|
|
550
550
|
`;
|
|
551
551
|
//#endregion
|
|
552
|
-
export {
|
|
552
|
+
export { EVENT_SYSTEM_ACTOR as a, EVENT_MESSAGE_AUTHOR as i, briefEntriesFromReportEvents as n, isEventConversationMessage as o, EVENT_AUTHOR_ID as r, generateBrief as s, BRIEF_PROMPT as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-
|
|
2
|
-
import { i as credentialUserSubjectId } from "./context-
|
|
1
|
+
import { _ as setSpanAttributes, d as logInfo, f as logWarn } from "./logging-sNS84Yuu.js";
|
|
2
|
+
import { i as credentialUserSubjectId } from "./context-Bplcgypl.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-7a9YqLhE.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { z } from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as withSpan, _ as setSpanAttributes } from "./logging-
|
|
2
|
-
import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
1
|
+
import { C as withSpan, _ as setSpanAttributes } from "./logging-sNS84Yuu.js";
|
|
2
|
+
import { A as sleep, P as SANDBOX_WORKSPACE_ROOT, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-BfLMVhWo.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
5
5
|
//#region src/chat/sandbox/resources.ts
|