@sentry/junior 0.251.0 → 0.252.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{admin-Dth5-1lw.js → admin-C_-XEdym.js} +1 -1
- package/dist/{agent-hooks-Ctw_jKaS.js → agent-hooks-DcoKnnxn.js} +8 -8
- package/dist/{agent-runner-dgQdPoGH.js → agent-runner-B-7S_DCS.js} +19 -19
- package/dist/api/schema.d.ts +32 -32
- package/dist/api.js +22 -22
- package/dist/app.js +38 -29
- package/dist/{assistant-reply-DBFRnZRx.js → assistant-reply-DbPLvsnL.js} +1 -1
- package/dist/{briefs-SDwPKduW.js → briefs-D4SMqc-r.js} +2 -2
- package/dist/{catalog-runtime-ulFceOA-.js → catalog-runtime-BQQiwwA7.js} +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +3 -3
- package/dist/cli/upgrade.js +3 -3
- package/dist/{client-DMt9kArs.js → client-ROZeVjq0.js} +2 -2
- package/dist/{config-iEOq080E.js → config-DNNkxfGS.js} +2 -2
- package/dist/{connections-BFU6GarA.js → connections-DJV6mLrH.js} +9 -9
- package/dist/{conversation-privacy-yZhQHnBe.js → conversation-privacy-B19umzIL.js} +1 -1
- package/dist/{credential-sync-GW0Rj57H.js → credential-sync-CEd2F5PS.js} +14 -14
- package/dist/{executor-BeH9LDKI.js → executor-_4bdoCxe.js} +59 -19
- package/dist/{images-hIXWwpRg.js → images-BAN7DHuO.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{job-queue-Bxlao6zL.js → job-queue-DSQx1qFY.js} +1 -1
- package/dist/{logging-BkI10z0D.js → logging-COUsTFIL.js} +1 -1
- package/dist/{message-BUcVfXmK.js → message-CtDDEwwV.js} +3 -3
- package/dist/nitro.js +3 -3
- package/dist/{oauth-callback-server-CYSEV35l.js → oauth-callback-server-CCiKrS0s.js} +2 -2
- package/dist/{pending-auth-h0B3FQEo.js → pending-auth-DDx3EU4M.js} +2 -2
- package/dist/{profile-AsD2uz0m.js → profile-DP4LKL6V.js} +4 -4
- package/dist/{registry-CN2Nie72.js → registry-CeEpPna6.js} +1 -1
- package/dist/{resolve-CrgwPWTS.js → resolve-B5ma3igH.js} +2 -2
- package/dist/{result-Cokw_MYC.js → result-Da0RVuWG.js} +6 -6
- package/dist/{runner-D-VZlBb_.js → runner-se1W_jGZ.js} +9 -9
- package/dist/{sandbox-egress-signals-Sie51RW0.js → sandbox-egress-signals-CS959-wm.js} +1 -1
- package/dist/{session-stop-DD0k0BXI.js → session-stop-DlRDisF5.js} +10 -10
- package/dist/{skills-CpyJJyqH.js → skills-CSzgs0EC.js} +2 -2
- package/dist/{spawn-DX3YjDtm.js → spawn-DT9fMjtd.js} +2 -2
- package/dist/{store-D-n2b2cI.js → store-Dx1U69mm.js} +6 -6
- package/dist/{task-queue-Bj2hFpjr.js → task-queue-BX9YrIsw.js} +3 -3
- package/dist/{task-runner-B3g16wjr.js → task-runner-CO55Olal.js} +14 -16
- package/dist/{tasks-DDzBxMio.js → tasks-DwGlFX9i.js} +129 -200
- package/dist/{thread-state-BlD6loX7.js → thread-state-Ces6tXmB.js} +6 -6
- package/dist/{turn-failure-response-BRlfATgu.js → turn-failure-response-B4VCvEQf.js} +7 -7
- package/dist/{turn-lifecycle-hMCbr_Ah.js → turn-lifecycle-B1VV58Yo.js} +1 -1
- package/dist/{turn-session-routing-DLb6eQMT.js → turn-session-routing-Dw2Kamg9.js} +1 -1
- package/dist/{validation-C2lG6yVH.js → validation-yJF9LKOv.js} +1 -1
- package/dist/{version-CyJ_kMe8.js → version-CZYqvIFh.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-C8u1HAdN.js → viewer-D96vo_42.js} +3 -3
- package/dist/{web-input-DHgIfSwj.js → web-input-5mls-41-.js} +65 -98
- package/dist/{work-hoPN8qjl.js → work-D2M2-zCO.js} +9 -9
- package/dist/{worker-CavJZxi8.js → worker-BwCpf8tB.js} +5 -5
- package/migrations/0055_automations.sql +125 -0
- package/migrations/meta/0055_snapshot.json +3948 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +4 -4
package/dist/cli/upgrade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as getChatConfig } from "../config-
|
|
2
|
-
import { t as createJuniorSqlExecutor } from "../executor-
|
|
3
|
-
import { t as createPluginCatalogRuntime } from "../registry-
|
|
1
|
+
import { i as getChatConfig } from "../config-DNNkxfGS.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-_4bdoCxe.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-CeEpPna6.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-egKWjgue.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-CVvEUSMH.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { d as logException, g as serializeGenAiAttribute, i as extractGenAiUsageAttributes, m as normalizeGenAiFinishReason, p as logWarn, w as withSpan } from "./logging-COUsTFIL.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-B19umzIL.js";
|
|
3
3
|
import { calculateCost, completeSimple, getEnvApiKey, getModels, registerApiProvider } from "@earendil-works/pi-ai/compat";
|
|
4
4
|
import { stream as streamAnthropic, streamSimple as streamSimpleAnthropic } from "@earendil-works/pi-ai/api/anthropic-messages";
|
|
5
5
|
import { createGatewayProvider } from "@ai-sdk/gateway";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-
|
|
3
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { S as toOptionalTrimmed, o as resolveGatewayModel } from "./client-ROZeVjq0.js";
|
|
3
|
+
import { p as logWarn } from "./logging-COUsTFIL.js";
|
|
4
4
|
import { l as TURN_REASONING_LEVELS, s as modelProfileSchema, t as DEFAULT_MODEL_PROFILES, u as parseTurnReasoningLevel } from "./model-profile-BwU8mqwD.js";
|
|
5
5
|
//#region src/chat/slack/emoji.ts
|
|
6
6
|
const SLACK_EMOJI_NAME_RE = /^(?:[a-z0-9_+-]+)(?:::(?:skin-tone-[2-6]))?$/;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { It as startOAuthFlow, c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-
|
|
2
|
-
import { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, f as getSqlExecutor } from "./viewer-
|
|
3
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
5
|
-
import { Q as getTurnRecord, Z as failTurnRecord, q as loadTurnCheckpoint } from "./tasks-
|
|
6
|
-
import { w as getStateAdapter } from "./profile-
|
|
7
|
-
import { a as getVercelConversationWorkQueue } from "./job-queue-
|
|
8
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
9
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { It as startOAuthFlow, c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-B-7S_DCS.js";
|
|
2
|
+
import { D as deleteProviderIdentityForSlackUser, c as getConversationEventStore, f as getSqlExecutor } from "./viewer-D96vo_42.js";
|
|
3
|
+
import { u as hasRequiredOAuthScope } from "./registry-CeEpPna6.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BQQiwwA7.js";
|
|
5
|
+
import { Q as getTurnRecord, Z as failTurnRecord, q as loadTurnCheckpoint } from "./tasks-DwGlFX9i.js";
|
|
6
|
+
import { w as getStateAdapter } from "./profile-DP4LKL6V.js";
|
|
7
|
+
import { a as getVercelConversationWorkQueue } from "./job-queue-DSQx1qFY.js";
|
|
8
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-Dx1U69mm.js";
|
|
9
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-Dw2Kamg9.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
//#region src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Ft as resolveBaseUrl, Lt as createUserTokenStore, Nt as formatProviderLabel, Pt as parseOAuthStatePayload, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, xt as getMcpProviderErrorAttributes } from "./agent-runner-
|
|
2
|
-
import { f as escapeXml } from "./client-
|
|
3
|
-
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-
|
|
4
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
1
|
+
import { Ft as resolveBaseUrl, Lt as createUserTokenStore, Nt as formatProviderLabel, Pt as parseOAuthStatePayload, _ as resolvePluginOAuthAccount, d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, x as lookupSlackUserProfile, xt as getMcpProviderErrorAttributes } from "./agent-runner-B-7S_DCS.js";
|
|
2
|
+
import { f as escapeXml } from "./client-ROZeVjq0.js";
|
|
3
|
+
import { d as logException, h as runBestEffort, p as logWarn } from "./logging-COUsTFIL.js";
|
|
4
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-DNNkxfGS.js";
|
|
5
5
|
import { f as parseSlackUserId } from "./actor-BTtLaeWy.js";
|
|
6
|
-
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-
|
|
6
|
+
import { A as upsertIdentity, f as getSqlExecutor, j as upsertLinkedIdentity } from "./viewer-D96vo_42.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-BVvSnQBB.js";
|
|
8
|
-
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-
|
|
9
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
-
import { t as discoverSkills } from "./skills-
|
|
11
|
-
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, Q as getTurnRecord, V as postSlackMessage } from "./tasks-
|
|
12
|
-
import { Ht as getSlackClient } from "./agent-hooks-
|
|
13
|
-
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-
|
|
14
|
-
import { i as getConversationPendingAuth } from "./pending-auth-
|
|
15
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
16
|
-
import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-CeEpPna6.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BQQiwwA7.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-CSzgs0EC.js";
|
|
11
|
+
import { It as recordAuthenticationLinked, Lt as recordAuthorizationCompleted, Q as getTurnRecord, V as postSlackMessage } from "./tasks-DwGlFX9i.js";
|
|
12
|
+
import { Ht as getSlackClient } from "./agent-hooks-DcoKnnxn.js";
|
|
13
|
+
import { E as acquireActiveLock, w as getStateAdapter } from "./profile-DP4LKL6V.js";
|
|
14
|
+
import { i as getConversationPendingAuth } from "./pending-auth-DDx3EU4M.js";
|
|
15
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ces6tXmB.js";
|
|
16
|
+
import { c as deleteWebAuthorization, f as wakeAuthorizedTurn, i as readConnectedOAuthTokens, p as wakePausedTurn } from "./connections-DJV6mLrH.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-CdCnu80W.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { z } from "zod";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as logException } from "./logging-
|
|
1
|
+
import { d as logException } from "./logging-COUsTFIL.js";
|
|
2
2
|
import { g as startSpanManual } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import "./config-
|
|
3
|
+
import "./config-DNNkxfGS.js";
|
|
4
4
|
import { a as juniorAgentInvocations, c as juniorIdentities, d as juniorDestinations, f as timestamptz, i as juniorAgentBindings, l as juniorUsers, s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { sql } from "drizzle-orm";
|
|
@@ -285,13 +285,10 @@ const juniorEventAutomations = pgTable("junior_event_tasks", {
|
|
|
285
285
|
namespace: text("namespace").notNull(),
|
|
286
286
|
identifier: text("identifier").notNull(),
|
|
287
287
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
288
|
-
|
|
289
|
-
status: text("status").$type().notNull().default("active"),
|
|
290
|
-
/** Why a run blocked this automation. Kept while paused; cleared on resume. */
|
|
288
|
+
status: text("status").notNull().default("active"),
|
|
291
289
|
statusReason: text("status_reason"),
|
|
292
|
-
/** Short display title generated from the task instruction. */
|
|
293
290
|
title: text("title"),
|
|
294
|
-
task: jsonb("task_json")
|
|
291
|
+
task: jsonb("task_json").notNull()
|
|
295
292
|
}, (table) => [index("junior_event_tasks_team_idx").on(table.teamId, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`), index("junior_event_tasks_match_idx").on(table.namespace, table.identifier, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`)]);
|
|
296
293
|
//#endregion
|
|
297
294
|
//#region src/db/schema/stats.ts
|
|
@@ -347,10 +344,49 @@ const juniorAutomationExecutions = pgTable("junior_task_executions", {
|
|
|
347
344
|
index("junior_task_executions_conversation_time_idx").on(table.conversationId, table.executedAtMs)
|
|
348
345
|
]);
|
|
349
346
|
//#endregion
|
|
347
|
+
//#region src/db/schema/automations.ts
|
|
348
|
+
/**
|
|
349
|
+
* One row per Automation of either kind. `record` holds the fields that have
|
|
350
|
+
* no column. Each write also copies the nested fields that queries filter or
|
|
351
|
+
* search on into columns: `team_id`, `channel_id`, `creator_slack_user_id`,
|
|
352
|
+
* `instruction`, and the event trigger `namespace` and `identifier`.
|
|
353
|
+
*/
|
|
354
|
+
const juniorAutomations = pgTable("junior_automations", {
|
|
355
|
+
id: text("id").primaryKey(),
|
|
356
|
+
kind: text("kind").$type().notNull(),
|
|
357
|
+
teamId: text("team_id").notNull(),
|
|
358
|
+
channelId: text("channel_id").notNull(),
|
|
359
|
+
creatorSlackUserId: text("creator_slack_user_id").notNull(),
|
|
360
|
+
/** Provider identity that created a Scheduled automation. */
|
|
361
|
+
creatorIdentityId: text("creator_identity_id"),
|
|
362
|
+
status: text("status").$type().notNull(),
|
|
363
|
+
/** Why a run blocked this Automation, until its creator resumes it. */
|
|
364
|
+
statusReason: text("status_reason"),
|
|
365
|
+
title: text("title"),
|
|
366
|
+
instruction: text("instruction").notNull(),
|
|
367
|
+
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
368
|
+
nextRunAtMs: bigint("next_run_at_ms", { mode: "number" }),
|
|
369
|
+
runNowAtMs: bigint("run_now_at_ms", { mode: "number" }),
|
|
370
|
+
namespace: text("namespace"),
|
|
371
|
+
identifier: text("identifier"),
|
|
372
|
+
record: jsonb("record").$type().notNull()
|
|
373
|
+
}, (table) => [
|
|
374
|
+
check("junior_automations_kind_check", sql`${table.kind} in ('scheduled', 'event')`),
|
|
375
|
+
check("junior_automations_status_check", sql`${table.status} in ('active', 'blocked', 'paused', 'completed', 'deleted')`),
|
|
376
|
+
check("junior_automations_record_check", sql`jsonb_typeof(${table.record}) = 'object'`),
|
|
377
|
+
check("junior_automations_trigger_check", sql`(${table.kind} = 'scheduled' and ${table.namespace} is null and ${table.identifier} is null) or (${table.kind} = 'event' and ${table.namespace} is not null and ${table.identifier} is not null and ${table.nextRunAtMs} is null and ${table.runNowAtMs} is null and ${table.status} <> 'completed')`),
|
|
378
|
+
index("junior_automations_team_idx").on(table.teamId, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`),
|
|
379
|
+
index("junior_automations_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id),
|
|
380
|
+
index("junior_automations_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(sql`${table.creatorIdentityId} IS NOT NULL`),
|
|
381
|
+
index("junior_automations_run_now_due_idx").on(table.runNowAtMs, table.createdAtMs, table.id).where(sql`${table.status} = 'active' AND ${table.runNowAtMs} IS NOT NULL`),
|
|
382
|
+
index("junior_automations_next_run_due_idx").on(table.nextRunAtMs, table.createdAtMs, table.id).where(sql`${table.status} = 'active' AND ${table.nextRunAtMs} IS NOT NULL`),
|
|
383
|
+
index("junior_automations_match_idx").on(table.namespace, table.identifier, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`)
|
|
384
|
+
]);
|
|
385
|
+
//#endregion
|
|
350
386
|
//#region src/db/schema/automation-versions.ts
|
|
351
387
|
/** One saved Automation definition. Lifecycle and scheduler state are not versioned. */
|
|
352
388
|
const juniorAutomationVersions = pgTable("junior_automation_versions", {
|
|
353
|
-
kind: text("kind").$type()
|
|
389
|
+
kind: text("kind").$type(),
|
|
354
390
|
automationId: text("automation_id").notNull(),
|
|
355
391
|
/** Starts at 1 and increases by 1 for each saved definition change. */
|
|
356
392
|
version: integer("version").notNull(),
|
|
@@ -358,14 +394,18 @@ const juniorAutomationVersions = pgTable("junior_automation_versions", {
|
|
|
358
394
|
/** Slack principal that saved this definition. Null when unknown. */
|
|
359
395
|
editedBy: jsonb("edited_by"),
|
|
360
396
|
definition: jsonb("definition").notNull()
|
|
361
|
-
}, (table) => [
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
table.automationId,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
397
|
+
}, (table) => [
|
|
398
|
+
check("junior_automation_versions_kind_check", sql`${table.kind} in ('scheduled', 'event')`),
|
|
399
|
+
primaryKey({
|
|
400
|
+
name: "junior_automation_versions_pk",
|
|
401
|
+
columns: [table.automationId, table.version]
|
|
402
|
+
}),
|
|
403
|
+
foreignKey({
|
|
404
|
+
name: "junior_automation_versions_automation_id_fk",
|
|
405
|
+
columns: [table.automationId],
|
|
406
|
+
foreignColumns: [juniorAutomations.id]
|
|
407
|
+
}).onDelete("cascade")
|
|
408
|
+
]);
|
|
369
409
|
//#endregion
|
|
370
410
|
//#region src/db/schema/scheduled-automations.ts
|
|
371
411
|
const juniorSchedulerTasks = pgTable("junior_scheduler_tasks", {
|
|
@@ -377,9 +417,8 @@ const juniorSchedulerTasks = pgTable("junior_scheduler_tasks", {
|
|
|
377
417
|
nextRunAtMs: bigint("next_run_at_ms", { mode: "number" }),
|
|
378
418
|
runNowAtMs: bigint("run_now_at_ms", { mode: "number" }),
|
|
379
419
|
createdAtMs: bigint("created_at_ms", { mode: "number" }).notNull(),
|
|
380
|
-
/** Short display title generated from the task instruction. */
|
|
381
420
|
title: text("title"),
|
|
382
|
-
record: jsonb("record")
|
|
421
|
+
record: jsonb("record").notNull()
|
|
383
422
|
}, (table) => [
|
|
384
423
|
index("junior_scheduler_tasks_creator_idx").on(table.teamId, table.creatorSlackUserId, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted'`),
|
|
385
424
|
index("junior_scheduler_tasks_creator_identity_idx").on(table.creatorIdentityId, table.createdAtMs, table.id).where(sql`${table.status} <> 'deleted' AND ${table.creatorIdentityId} IS NOT NULL`),
|
|
@@ -474,6 +513,7 @@ const juniorSqlSchema = {
|
|
|
474
513
|
juniorStats,
|
|
475
514
|
juniorAutomationExecutions,
|
|
476
515
|
juniorAutomationVersions,
|
|
516
|
+
juniorAutomations,
|
|
477
517
|
juniorSchedulerRuns,
|
|
478
518
|
juniorSchedulerTasks,
|
|
479
519
|
juniorUsers,
|
|
@@ -1018,4 +1058,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
1018
1058
|
});
|
|
1019
1059
|
}
|
|
1020
1060
|
//#endregion
|
|
1021
|
-
export { juniorArtifacts as
|
|
1061
|
+
export { juniorArtifacts as S, juniorApiTokens as _, juniorSchedulerRuns as a, juniorCodeRepositories as b, juniorAutomationExecutions as c, juniorConversationParticipants as d, juniorConversationBindings as f, juniorConversationEvents as g, juniorConversationMetrics as h, juniorWorkspaces as i, juniorStats as l, CONVERSATION_METRICS as m, juniorSnapshots as n, juniorAutomationVersions as o, juniorConversationBriefs as p, juniorWorkspaceRepos as r, juniorAutomations as s, createJuniorSqlExecutor as t, juniorLocationConfigurations as u, juniorConversationAnnotations as v, juniorAttachments as x, juniorCodeChanges as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-
|
|
3
|
-
import { f as getSqlExecutor } from "./viewer-
|
|
2
|
+
import { D as storeAttachment, T as readLiveAttachment } from "./agent-runner-B-7S_DCS.js";
|
|
3
|
+
import { f as getSqlExecutor } from "./viewer-D96vo_42.js";
|
|
4
4
|
import { L as detectImageMediaType } from "./conversation-T18Xlkx9.js";
|
|
5
5
|
//#region src/chat/attachments/images.ts
|
|
6
6
|
var images_exports = /* @__PURE__ */ __exportAll({
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-
|
|
1
|
+
import { N as getDeploymentServiceVersion, P as getDeploymentTelemetryAttributes } from "./logging-COUsTFIL.js";
|
|
2
2
|
import { _ as vercelAIIntegration, a as getClient, b as withStreamedSpan, c as init, o as getGlobalScope } from "./sentry-CgWZM_kV.js";
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-B19umzIL.js";
|
|
4
4
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-BLvBjy_e.js";
|
|
5
5
|
//#region src/chat/sentry-payload-filter.ts
|
|
6
6
|
const PAYLOAD_ATTRIBUTE_KEYS = /* @__PURE__ */ new Set([
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { i as getChatConfig } from "./config-DNNkxfGS.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash, createHmac, timingSafeEqual } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as setTag, f as setUser, h as startSpan, i as getActiveSpan, l as logger, n as captureMessage, p as spanToJSON, s as getTraceData, t as captureException, y as withScope } from "./sentry-CgWZM_kV.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-CZYqvIFh.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";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { Ht as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Vt as actorFromRun, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-
|
|
3
|
-
import { n as enqueueAgentMessageToParent } from "./result-
|
|
4
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Ht as toolInvocationDestination, Q as getActiveAgentInvocationForConversation, Vt as actorFromRun, Y as createAgentInvocationForMessage, Z as findChildAgentConversationId, _t as AgentMessageTargetError, vt as PARENT_AGENT_TARGET } from "./agent-runner-B-7S_DCS.js";
|
|
3
|
+
import { n as enqueueAgentMessageToParent } from "./result-Da0RVuWG.js";
|
|
4
|
+
import { r as enqueueAgentInvocation } from "./work-D2M2-zCO.js";
|
|
5
5
|
//#region src/chat/agent-invocations/message.ts
|
|
6
6
|
var message_exports = /* @__PURE__ */ __exportAll({ bindMessageAgent: () => bindMessageAgent });
|
|
7
7
|
/**
|
package/dist/nitro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_RETENTION_ROUTE, D as JUNIOR_HEARTBEAT_ROUTE, E as JUNIOR_HEARTBEAT_CRON_SCHEDULE, O as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, T as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, j as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, k as JUNIOR_RETENTION_CRON_SCHEDULE } from "./logging-COUsTFIL.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-BVvSnQBB.js";
|
|
3
|
-
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-
|
|
3
|
+
import { o as resolveConversationWorkQueueTopic, t as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC } from "./job-queue-DSQx1qFY.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-egKWjgue.js";
|
|
5
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-BX9YrIsw.js";
|
|
6
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-CVvEUSMH.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Lt as createUserTokenStore } from "./agent-runner-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { Lt as createUserTokenStore } from "./agent-runner-B-7S_DCS.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-CEd2F5PS.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
//#region src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as isProviderRetryError } from "./client-
|
|
2
|
-
import { Y as abandonTurnRecord, un as estimateTextTokens } from "./tasks-
|
|
1
|
+
import { v as isProviderRetryError } from "./client-ROZeVjq0.js";
|
|
2
|
+
import { Y as abandonTurnRecord, un as estimateTextTokens } from "./tasks-DwGlFX9i.js";
|
|
3
3
|
import { r as isExperimentalFeatureEnabled } from "./experimental-Qn9rKLgx.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
//#region src/chat/state/turn-id.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as toOptionalTrimmed } from "./client-
|
|
2
|
-
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-
|
|
3
|
-
import { i as getChatConfig } from "./config-
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
1
|
+
import { S as toOptionalTrimmed } from "./client-ROZeVjq0.js";
|
|
2
|
+
import { v as setSpanAttributes, y as setSpanStatus } from "./logging-COUsTFIL.js";
|
|
3
|
+
import { i as getChatConfig } from "./config-DNNkxfGS.js";
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BQQiwwA7.js";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
import { createMemoryState } from "@chat-adapter/state-memory";
|
|
7
7
|
import { createRedisState } from "@chat-adapter/state-redis";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-
|
|
1
|
+
import { f as logInfo, p as logWarn, v as setSpanAttributes } from "./logging-COUsTFIL.js";
|
|
2
2
|
import { o as parseActorUserId } from "./actor-BTtLaeWy.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-BVvSnQBB.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v as setSpanAttributes, w as withSpan } from "./logging-
|
|
2
|
-
import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-
|
|
1
|
+
import { v as setSpanAttributes, w as withSpan } from "./logging-COUsTFIL.js";
|
|
2
|
+
import { N as SANDBOX_WORKSPACE_ROOT, k as sleep, r as isStale, t as create, u as isSandboxUnavailableError, v as getVercelSandboxCredentials, w as getStateAdapter, x as runNonInteractiveCommand } from "./profile-DP4LKL6V.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { FileSystem, Sandbox } from "@vercel/sandbox";
|
|
5
5
|
//#region src/chat/sandbox/resources.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { $ as getAgentInvocation, X as createAgentInvocationFromLatest, ct as isTerminalAgentInvocation, et as getAgentInvocationIdForEvents, ft as markAgentInvocationParentMailboxAppended, it as getAgentInvocationResultMessageId, nt as getAgentInvocationIdForResult, st as getLatestAgentInvocationForConversation, tt as getAgentInvocationIdForMessage } from "./agent-runner-
|
|
2
|
+
import { $ as getAgentInvocation, X as createAgentInvocationFromLatest, ct as isTerminalAgentInvocation, et as getAgentInvocationIdForEvents, ft as markAgentInvocationParentMailboxAppended, it as getAgentInvocationResultMessageId, nt as getAgentInvocationIdForResult, st as getLatestAgentInvocationForConversation, tt as getAgentInvocationIdForMessage } from "./agent-runner-B-7S_DCS.js";
|
|
3
3
|
import { t as createActor } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { d as credentialContextForActor } from "./registry-
|
|
5
|
-
import { $ as listTurnSummaries, Q as getTurnRecord } from "./tasks-
|
|
6
|
-
import { a as EVENT_WAIT_MS, c as timerWatchCredentialSubject, s as isEventMailboxMetadata } from "./session-stop-
|
|
4
|
+
import { d as credentialContextForActor } from "./registry-CeEpPna6.js";
|
|
5
|
+
import { $ as listTurnSummaries, Q as getTurnRecord } from "./tasks-DwGlFX9i.js";
|
|
6
|
+
import { a as EVENT_WAIT_MS, c as timerWatchCredentialSubject, s as isEventMailboxMetadata } from "./session-stop-DlRDisF5.js";
|
|
7
7
|
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-C04mP1hu.js";
|
|
8
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
9
|
-
import { r as enqueueAgentInvocation } from "./work-
|
|
8
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-Dx1U69mm.js";
|
|
9
|
+
import { r as enqueueAgentInvocation } from "./work-D2M2-zCO.js";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
12
12
|
//#region src/chat/task-execution/mailbox-input.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { C as withLogContext, b as setTags, d as logException } from "./logging-
|
|
2
|
-
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-
|
|
3
|
-
import { d as credentialContextForActor } from "./registry-
|
|
4
|
-
import { At as loadProjection, Gt as hydrateConversationMessages, J as saveTurnCheckpoint, Kt as persistConversationMessages, Lt as recordAuthorizationCompleted, Tt as commitAcceptedReply, an as markConversationMessage, en as buildConversationContext, ln as upsertConversationMessage, on as normalizeConversationText, sn as recordDeliveredAssistantMessage, tt as persistWithRetry } from "./tasks-
|
|
1
|
+
import { C as withLogContext, b as setTags, d as logException } from "./logging-COUsTFIL.js";
|
|
2
|
+
import { c as getConversationEventStore, u as getConversationStore } from "./viewer-D96vo_42.js";
|
|
3
|
+
import { d as credentialContextForActor } from "./registry-CeEpPna6.js";
|
|
4
|
+
import { At as loadProjection, Gt as hydrateConversationMessages, J as saveTurnCheckpoint, Kt as persistConversationMessages, Lt as recordAuthorizationCompleted, Tt as commitAcceptedReply, an as markConversationMessage, en as buildConversationContext, ln as upsertConversationMessage, on as normalizeConversationText, sn as recordDeliveredAssistantMessage, tt as persistWithRetry } from "./tasks-DwGlFX9i.js";
|
|
5
5
|
import { K as messageCardText } from "./conversation-T18Xlkx9.js";
|
|
6
6
|
import { f as markTurnFailed, p as startActiveTurn, t as authorizationId } from "./oauth-authorization-BA4Dt6a7.js";
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
9
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
10
|
-
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
11
|
-
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-DbPLvsnL.js";
|
|
8
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CO55Olal.js";
|
|
9
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-B1VV58Yo.js";
|
|
10
|
+
import { n as getPersistedSandboxState, o as persistThreadStateById, r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ces6tXmB.js";
|
|
11
|
+
import { d as loadPendingMessageCards, i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent } from "./turn-failure-response-B4VCvEQf.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
//#region src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mt as sandboxEgressSignalsResponseSchema } from "./agent-runner-
|
|
1
|
+
import { Mt as sandboxEgressSignalsResponseSchema } from "./agent-runner-B-7S_DCS.js";
|
|
2
2
|
//#region src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { d as logException, f as logInfo, p as logWarn } from "./logging-
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { f as getSqlExecutor, u as getConversationStore } from "./viewer-
|
|
2
|
+
import { d as logException, f as logInfo, p as logWarn } from "./logging-COUsTFIL.js";
|
|
3
|
+
import { n as botConfig } from "./config-DNNkxfGS.js";
|
|
4
|
+
import { f as getSqlExecutor, u as getConversationStore } from "./viewer-D96vo_42.js";
|
|
5
5
|
import { s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
6
|
-
import "./executor-
|
|
7
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
8
|
-
import { V as postSlackMessage, _t as isToolResultError, ht as isAssistantMessage, vt as isToolResultMessage, wt as ToolInputError, yt as normalizeToolNameFromResult } from "./tasks-
|
|
9
|
-
import { it as JUNIOR_THREAD_STATE_TTL_MS, rt as verifyTimerWatchCredentialSubject, u as getPlugins } from "./agent-hooks-
|
|
10
|
-
import { w as getStateAdapter } from "./profile-
|
|
11
|
-
import { r as sanitizeAssistantText } from "./assistant-reply-
|
|
6
|
+
import "./executor-_4bdoCxe.js";
|
|
7
|
+
import { p as credentialSubjectSchema } from "./registry-CeEpPna6.js";
|
|
8
|
+
import { V as postSlackMessage, _t as isToolResultError, ht as isAssistantMessage, vt as isToolResultMessage, wt as ToolInputError, yt as normalizeToolNameFromResult } from "./tasks-DwGlFX9i.js";
|
|
9
|
+
import { it as JUNIOR_THREAD_STATE_TTL_MS, rt as verifyTimerWatchCredentialSubject, u as getPlugins } from "./agent-hooks-DcoKnnxn.js";
|
|
10
|
+
import { w as getStateAdapter } from "./profile-DP4LKL6V.js";
|
|
11
|
+
import { r as sanitizeAssistantText } from "./assistant-reply-DbPLvsnL.js";
|
|
12
12
|
import { r as EVENT_AUTHOR_ID } from "./prompt-C04mP1hu.js";
|
|
13
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
13
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-Dx1U69mm.js";
|
|
14
14
|
import { z } from "zod";
|
|
15
15
|
import { eq, inArray } from "drizzle-orm";
|
|
16
16
|
import { eventMatchSchema, normalizeEventIdentifier, objectTypeSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { p as logWarn } from "./logging-
|
|
2
|
+
import { p as logWarn } from "./logging-COUsTFIL.js";
|
|
3
3
|
import { s as skillRoots } from "./package-discovery-BVvSnQBB.js";
|
|
4
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
4
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-BQQiwwA7.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import fs from "node:fs/promises";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { Ht as toolInvocationDestination, Vt as actorFromRun } from "./agent-runner-
|
|
3
|
-
import { n as createAndEnqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Ht as toolInvocationDestination, Vt as actorFromRun } from "./agent-runner-B-7S_DCS.js";
|
|
3
|
+
import { n as createAndEnqueueAgentInvocation } from "./work-D2M2-zCO.js";
|
|
4
4
|
//#region src/chat/agent-invocations/spawn.ts
|
|
5
5
|
var spawn_exports = /* @__PURE__ */ __exportAll({ bindSpawnAgent: () => bindSpawnAgent });
|
|
6
6
|
/** Bind a Run's Actor and credentials to new Agent invocations. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-
|
|
2
|
-
import { i as getChatConfig } from "./config-
|
|
1
|
+
import { I as isRecord, L as toOptionalNumber, R as toOptionalString } from "./logging-COUsTFIL.js";
|
|
2
|
+
import { i as getChatConfig } from "./config-DNNkxfGS.js";
|
|
3
3
|
import { s as parseStoredSlackActor } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { F as sameDestination, N as parseDestination, u as getConversationStore } from "./viewer-
|
|
5
|
-
import { it as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-
|
|
6
|
-
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-
|
|
7
|
-
import "./job-queue-
|
|
4
|
+
import { F as sameDestination, N as parseDestination, u as getConversationStore } from "./viewer-D96vo_42.js";
|
|
5
|
+
import { it as JUNIOR_THREAD_STATE_TTL_MS } from "./agent-hooks-DcoKnnxn.js";
|
|
6
|
+
import { C as getDefaultRedisStateAdapterFor, w as getStateAdapter } from "./profile-DP4LKL6V.js";
|
|
7
|
+
import "./job-queue-DSQx1qFY.js";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import { destinationSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as logWarn } from "./logging-
|
|
2
|
-
import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-
|
|
1
|
+
import { p as logWarn } from "./logging-COUsTFIL.js";
|
|
2
|
+
import { c as QUEUE_SIGNATURE_MAX_AGE_MS, d as createVercelQueueClient, l as signQueueMessage, p as runWithTurnRequestDeadline, u as verifyQueueMessage } from "./job-queue-DSQx1qFY.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { handleCallback, registerDevConsumer } from "@vercel/queue";
|
|
@@ -115,7 +115,7 @@ function pluginTaskCallback() {
|
|
|
115
115
|
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
116
116
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
117
117
|
run: async (message) => {
|
|
118
|
-
const { processPluginTask } = await import("./task-runner-
|
|
118
|
+
const { processPluginTask } = await import("./task-runner-CO55Olal.js").then((n) => n.r);
|
|
119
119
|
await processPluginTask(message);
|
|
120
120
|
},
|
|
121
121
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.js";
|
|
2
|
-
import { h as runBestEffort, p as logWarn } from "./logging-
|
|
2
|
+
import { h as runBestEffort, p as logWarn } from "./logging-COUsTFIL.js";
|
|
3
3
|
import { g as parseSlackMessageTs } from "./actor-BTtLaeWy.js";
|
|
4
|
-
import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-
|
|
4
|
+
import { C as agentTurnTotalTokens, S as agentTurnCostUsd, d as getDb, r as readActorIdentity, u as getConversationStore } from "./viewer-D96vo_42.js";
|
|
5
5
|
import { s as juniorConversations } from "./agent-invocations-D_YoNnAn.js";
|
|
6
|
-
import { c as juniorAutomationExecutions,
|
|
6
|
+
import { c as juniorAutomationExecutions, s as juniorAutomations } from "./executor-_4bdoCxe.js";
|
|
7
7
|
import { m as sameActorIdentity } from "./history-9pO1Zd4Y.js";
|
|
8
|
-
import { p as credentialSubjectSchema } from "./registry-
|
|
9
|
-
import { Gt as hydrateConversationMessages, M as formatSlackLink, Q as getTurnRecord, V as postSlackMessage, Zt as fallbackShortTitle, _t as isToolResultError, a as readScheduledAutomation, g as getEventAutomation, j as escapeSlackMrkdwnText, mt as instructionTextForProjection, u as blockEventAutomation, ut as getPiMessageRole, vt as isToolResultMessage, xt as stripRuntimeTurnContext, yt as normalizeToolNameFromResult, z as openSlackDirectMessage } from "./tasks-
|
|
10
|
-
import { St as createPluginConversationEvents, dt as createPluginModel, ft as createPluginLogger, it as JUNIOR_THREAD_STATE_TTL_MS, lt as createPluginState, p as coreTaskRegistrations, st as getDashboardTaskLink, u as getPlugins, ut as createPluginEmbedder } from "./agent-hooks-
|
|
11
|
-
import { w as getStateAdapter } from "./profile-
|
|
12
|
-
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-
|
|
13
|
-
import { t as resolveConversationRouting } from "./turn-session-routing-
|
|
14
|
-
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-
|
|
8
|
+
import { p as credentialSubjectSchema } from "./registry-CeEpPna6.js";
|
|
9
|
+
import { Gt as hydrateConversationMessages, M as formatSlackLink, Q as getTurnRecord, V as postSlackMessage, Zt as fallbackShortTitle, _t as isToolResultError, a as readScheduledAutomation, g as getEventAutomation, j as escapeSlackMrkdwnText, mt as instructionTextForProjection, u as blockEventAutomation, ut as getPiMessageRole, vt as isToolResultMessage, xt as stripRuntimeTurnContext, yt as normalizeToolNameFromResult, z as openSlackDirectMessage } from "./tasks-DwGlFX9i.js";
|
|
10
|
+
import { St as createPluginConversationEvents, dt as createPluginModel, ft as createPluginLogger, it as JUNIOR_THREAD_STATE_TTL_MS, lt as createPluginState, p as coreTaskRegistrations, st as getDashboardTaskLink, u as getPlugins, ut as createPluginEmbedder } from "./agent-hooks-DcoKnnxn.js";
|
|
11
|
+
import { w as getStateAdapter } from "./profile-DP4LKL6V.js";
|
|
12
|
+
import { r as getPersistedThreadState, s as coerceThreadConversationState } from "./thread-state-Ces6tXmB.js";
|
|
13
|
+
import { t as resolveConversationRouting } from "./turn-session-routing-Dw2Kamg9.js";
|
|
14
|
+
import { i as pluginTaskParamsSchema, o as sendVercelPluginTask, r as pluginTaskId } from "./task-queue-BX9YrIsw.js";
|
|
15
15
|
import { z } from "zod";
|
|
16
16
|
import { createHash } from "node:crypto";
|
|
17
17
|
import { and, asc, count, desc, eq, gte, inArray, lte, max, or, sql } from "drizzle-orm";
|
|
@@ -287,16 +287,14 @@ async function readAutomationTitlesByConversationId(conversations) {
|
|
|
287
287
|
if (untitledIds.length === 0) return titles;
|
|
288
288
|
const rows = await getDb().select({
|
|
289
289
|
conversationId: juniorAutomationExecutions.conversationId,
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
scheduledTitle: juniorSchedulerTasks.title
|
|
294
|
-
}).from(juniorAutomationExecutions).leftJoin(juniorSchedulerTasks, and(eq(juniorAutomationExecutions.kind, "scheduled"), eq(juniorSchedulerTasks.id, juniorAutomationExecutions.automationId))).leftJoin(juniorEventAutomations, and(eq(juniorAutomationExecutions.kind, "event"), eq(juniorEventAutomations.id, juniorAutomationExecutions.automationId))).where(and(inArray(juniorAutomationExecutions.conversationId, untitledIds), eq(juniorAutomationExecutions.namespace, "junior"))).orderBy(desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId));
|
|
290
|
+
instruction: juniorAutomations.instruction,
|
|
291
|
+
title: juniorAutomations.title
|
|
292
|
+
}).from(juniorAutomationExecutions).innerJoin(juniorAutomations, eq(juniorAutomations.id, juniorAutomationExecutions.automationId)).where(and(inArray(juniorAutomationExecutions.conversationId, untitledIds), eq(juniorAutomationExecutions.namespace, "junior"))).orderBy(desc(juniorAutomationExecutions.executedAtMs), desc(juniorAutomationExecutions.executionId));
|
|
295
293
|
const seen = /* @__PURE__ */ new Set();
|
|
296
294
|
for (const row of rows) {
|
|
297
295
|
if (!row.conversationId || seen.has(row.conversationId)) continue;
|
|
298
296
|
seen.add(row.conversationId);
|
|
299
|
-
const title =
|
|
297
|
+
const title = row.title?.trim() || fallbackShortTitle(row.instruction, "");
|
|
300
298
|
if (title) titles.set(row.conversationId, title);
|
|
301
299
|
}
|
|
302
300
|
return titles;
|