@sentry/junior 0.293.0 → 0.295.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-uuecrKuD.js → admin-ifgjyfpF.js} +2 -2
- package/dist/{agent-runner-DHq1pjUg.js → agent-runner-DjMTPWEO.js} +192 -100
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +5 -5
- package/dist/api.d.ts +1 -1
- package/dist/api.js +73 -29
- package/dist/{app-fWzCHFIb.d.ts → app-uiTzRbvq.d.ts} +5 -3
- package/dist/app.d.ts +2 -2
- package/dist/app.js +64 -74
- package/dist/{automation-BE3z19VN.js → automation-yJX3C7i3.js} +3 -3
- package/dist/{background-compaction-queue-D7ncdEa6.js → background-compaction-queue-DUkHZjmL.js} +7 -9
- package/dist/{briefs-NpgMEFh1.js → briefs-CbNYM-q2.js} +3 -3
- package/dist/{catalog-runtime-DwbTyNRD.js → catalog-runtime-DgouZKZm.js} +1 -1
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +15 -15
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +2 -0
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +2 -2
- package/dist/cli/upgrade.js +7 -74
- package/dist/{config-B4b-NXH5.js → config-DvnTPCfp.js} +58 -7
- package/dist/{connections-Dz_AQg5p.js → connections-CWaIVl_1.js} +6 -6
- package/dist/{conversation-CtjR1Zcx.js → conversation-CMkSmi02.js} +3 -11
- package/dist/{conversation-pending-messages-1Kad1Mif.js → conversation-feed-BVAOga0H.js} +27 -2
- package/dist/{conversation-privacy-DRsSgLGO.js → conversation-privacy-DPjv4SnA.js} +1 -1
- package/dist/{credential-sync-ClCnnGVj.js → credential-sync-BhbaZfmO.js} +16 -15
- package/dist/{db-BbpttyKH.d.ts → db-CCUqQe0E.d.ts} +13 -6
- package/dist/{db-CoA7_Xqu.js → db-Dts2XvLu.js} +144 -7
- package/dist/{executor-SWyHhit0.js → executor-Ck73J0wP.js} +64 -10
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-BN5drSEZ.js → logging-9OAq-fdg.js} +2 -1
- package/dist/{message-D4qjpW1C.js → message-CtaPzC7m.js} +9 -9
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-Xi-mTLOV.js → oauth-callback-server-C_LXY1d4.js} +2 -2
- package/dist/{oauth-relay-D6xxVywK.js → oauth-relay-CsfIazeF.js} +2 -1
- package/dist/{plugins-DtmjkTza.d.ts → plugins-B_0Cr0MO.d.ts} +0 -1
- package/dist/{projection-DXl4ftyL.js → projection-BzJQncZV.js} +251 -161
- package/dist/{prompt-Dmx6IfWZ.js → prompt-Cbq5b4SO.js} +5 -6
- package/dist/{registry-DosVt9f9.js → registry-cbpOxO4M.js} +3 -13
- package/dist/{resolve-BDjWJC9s.js → resolve-t-pmRdwS.js} +3 -3
- package/dist/{result-CaAFpf4B.js → result-DhgjR3nQ.js} +8 -8
- package/dist/{runner-h96Mkss6.js → runner-CHv9X9TH.js} +8 -8
- package/dist/{sandbox-egress-signals-rK91BW7i.js → sandbox-egress-signals-Yy3fSCbg.js} +1 -1
- package/dist/{schema-C_v8wb80.js → schema-BhneuGYv.js} +39 -7
- package/dist/{schema-CHsBmXIj.d.ts → schema-TSEisVJR.d.ts} +87 -14
- package/dist/secrets-DebYU866.js +18 -0
- package/dist/{service-account-WUMVuqVL.js → service-account-C4rBP8ne.js} +3 -3
- package/dist/{service-account-BpGpScaT.js → service-account-DjPIwCMj.js} +42 -26
- package/dist/{session-stop-xYK15HUu.js → session-stop-DkxI5vc3.js} +20 -775
- package/dist/{skills-DHApyCjj.js → skills-BZE2DP8I.js} +2 -2
- package/dist/{spawn-BQQrwGNe.js → spawn-BvULxIiu.js} +5 -5
- package/dist/{adapter-CMJfmHso.js → state-CO9ETDzk.js} +132 -2
- package/dist/{stop-CBeD6_Gs.js → stop-CL-rdtQb.js} +85 -32
- package/dist/{store-xtibD98L.js → store-DgD78_NK.js} +3 -3
- package/dist/{task-runner-BYPN4BEO.js → task-runner-CKOj6xla.js} +11 -11
- package/dist/{turn-failure-response-jNVl00MD.js → turn-failure-response-BTSo6SMJ.js} +8 -8
- package/dist/{validation-DGeB_moV.js → validation-CXeYgBzq.js} +1 -1
- package/dist/{version-C6nqU3Qc.js → version-AQa7Fr2H.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-9KLQibjn.js → viewer-Bqkb678l.js} +3 -3
- package/dist/warmup-h6u1e9n0.js +1869 -0
- package/dist/{work-xwX6unUE.js → work-yN_GAuXY.js} +11 -11
- package/dist/{worker-CiCCfwd4.js → worker-Hl7N292I.js} +6 -6
- package/migrations/0062_plugin_report_index.sql +1 -20
- package/migrations/0078_plugin_conversation_index.sql +1 -20
- package/migrations/0079_conversation_event_author_index.sql +1 -20
- package/migrations/0080_conversation_event_latest_message_indexes.sql +2 -27
- package/migrations/0090_guardian_review_time_index.sql +1 -20
- package/migrations/0091_conversation_participant_unsubscribed_index.sql +1 -20
- package/migrations/0097_conversation_kind_automation.sql +6 -0
- package/migrations/0098_review_item_plugin_actions.sql +5 -0
- package/migrations/0099_conversation_last_message_at.sql +1 -0
- package/migrations/0100_automation_task_kind_repair.sql +48 -0
- package/migrations/meta/0097_snapshot.json +4490 -0
- package/migrations/meta/0098_snapshot.json +4490 -0
- package/migrations/meta/0099_snapshot.json +4720 -0
- package/migrations/meta/0100_snapshot.json +4496 -0
- package/migrations/meta/_journal.json +28 -0
- package/package.json +5 -5
- package/dist/assistant-reply-CIApSfor.js +0 -58
- package/dist/warmup-7S6z068f.js +0 -993
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as withScope } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import "./config-
|
|
3
|
-
import { h as logWarn, p as logException } from "./logging-
|
|
2
|
+
import "./config-DvnTPCfp.js";
|
|
3
|
+
import { h as logWarn, p as logException } from "./logging-9OAq-fdg.js";
|
|
4
4
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
5
5
|
import { sql } from "drizzle-orm";
|
|
6
6
|
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
@@ -108,6 +108,11 @@ const juniorConversations = pgTable("junior_conversations", {
|
|
|
108
108
|
title: text("title"),
|
|
109
109
|
createdAt: timestamptz("created_at").notNull(),
|
|
110
110
|
lastActivityAt: timestamptz("last_activity_at").notNull(),
|
|
111
|
+
/**
|
|
112
|
+
* The newest Message that a reader would notice (`refreshLastMessageAt`).
|
|
113
|
+
* Null until the Conversation has one.
|
|
114
|
+
*/
|
|
115
|
+
lastMessageAt: timestamptz("last_message_at"),
|
|
111
116
|
updatedAt: timestamptz("updated_at").notNull(),
|
|
112
117
|
executionUpdatedAt: timestamptz("execution_updated_at"),
|
|
113
118
|
executionStatus: text("execution_status").$type().notNull(),
|
|
@@ -140,8 +145,8 @@ const juniorConversations = pgTable("junior_conversations", {
|
|
|
140
145
|
metricRunId: text("metric_run_id"),
|
|
141
146
|
detailVersion: integer("detail_version").notNull().default(0)
|
|
142
147
|
}, (table) => [
|
|
143
|
-
check("junior_conversations_kind_check", sql`${table.kind} in ('root', 'thread', 'task')`),
|
|
144
|
-
check("junior_conversations_kind_parent_check", sql`${table.kind} is null or ((${table.kind}
|
|
148
|
+
check("junior_conversations_kind_check", sql`${table.kind} in ('root', 'automation', 'thread', 'task')`),
|
|
149
|
+
check("junior_conversations_kind_parent_check", sql`${table.kind} is null or ((${table.kind} in ('root', 'automation')) = (${table.parentConversationId} is null))`),
|
|
145
150
|
index("junior_conversations_last_activity_idx").on(table.lastActivityAt.desc(), table.conversationId),
|
|
146
151
|
index("junior_conversations_active_idx").using("btree", sql`coalesce(${table.executionUpdatedAt}, ${table.updatedAt})`, table.conversationId).where(sql`${table.executionStatus} <> 'idle'`),
|
|
147
152
|
index("junior_conversations_destination_activity_idx").on(table.destinationId, table.lastActivityAt.desc()),
|
|
@@ -644,7 +649,7 @@ const juniorReviewItems = pgTable("junior_review_items", {
|
|
|
644
649
|
createdAt: timestamptz("created_at").notNull(),
|
|
645
650
|
updatedAt: timestamptz("updated_at").notNull()
|
|
646
651
|
}, (table) => [
|
|
647
|
-
check("junior_review_items_kind_check", sql`(${table.kind} = 'notice' and ${table.request} is null and ${table.answer} is null) or (${table.kind} = 'action' and ${table.request} is not null)`),
|
|
652
|
+
check("junior_review_items_kind_check", sql`(${table.kind} = 'notice' and ${table.request} is null and ${table.answer} is null) or (${table.kind} = 'action' and (${table.request} is not null or (${table.dedupeKey} like 'plugin:%' and ${table.answer} is null)))`),
|
|
648
653
|
check("junior_review_items_status_check", sql`(${table.status} = 'open' and ${table.closedAt} is null) or (${table.status} in ('done', 'dismissed') and ${table.closedAt} is not null)`),
|
|
649
654
|
check("junior_review_items_tenant_check", sql`(${table.provider} is null) = (${table.providerTenantId} is null)`),
|
|
650
655
|
check("junior_review_items_visibility_check", sql`${table.visibility} = 'public' or not ${table.assignedToEveryone}`),
|
|
@@ -795,6 +800,29 @@ const LOCK_TIMEOUT_MS = 5e3;
|
|
|
795
800
|
const LOCK_ATTEMPTS = 5;
|
|
796
801
|
const LOCK_RETRY_DELAY_MS = 5e3;
|
|
797
802
|
const LOCK_NOT_AVAILABLE = "55P03";
|
|
803
|
+
const MIGRATION_LOCK_POLL_MS = 1e3;
|
|
804
|
+
const CONCURRENT_STATEMENT = /^(?:CREATE (?:UNIQUE )?INDEX|DROP INDEX|REINDEX)\b[^;]*\bCONCURRENTLY\b/i;
|
|
805
|
+
const CONCURRENT_INDEX = /^CREATE (?:UNIQUE )?INDEX CONCURRENTLY IF NOT EXISTS "([a-z0-9_]+)" /i;
|
|
806
|
+
/** Statement text without its leading comment lines. */
|
|
807
|
+
function sqlOf(statement) {
|
|
808
|
+
return statement.split("\n").filter((line) => !line.trim().startsWith("--")).join("\n").trim();
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* Index builds of a migration that only builds indexes concurrently, or
|
|
812
|
+
* undefined for a migration that runs in a transaction.
|
|
813
|
+
*/
|
|
814
|
+
function concurrentIndexes(tag, statements) {
|
|
815
|
+
const sql = statements.map(sqlOf).filter(Boolean);
|
|
816
|
+
if (!sql.some((statement) => CONCURRENT_STATEMENT.test(statement))) return;
|
|
817
|
+
return sql.map((statement) => {
|
|
818
|
+
const name = CONCURRENT_INDEX.exec(statement)?.[1];
|
|
819
|
+
if (!name) throw new Error(`Migration ${tag}: a migration that uses CONCURRENTLY must contain only CREATE [UNIQUE] INDEX CONCURRENTLY IF NOT EXISTS "name" statements.`);
|
|
820
|
+
return {
|
|
821
|
+
name,
|
|
822
|
+
statement
|
|
823
|
+
};
|
|
824
|
+
});
|
|
825
|
+
}
|
|
798
826
|
function isLockTimeout(error) {
|
|
799
827
|
let current = error;
|
|
800
828
|
for (let depth = 0; current instanceof Error && depth < 5; depth += 1) {
|
|
@@ -803,6 +831,15 @@ function isLockTimeout(error) {
|
|
|
803
831
|
}
|
|
804
832
|
return false;
|
|
805
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Wait for the migration lock by polling `pg_try_advisory_lock`. A session
|
|
836
|
+
* blocked in `pg_advisory_lock` holds a snapshot, and `CREATE INDEX
|
|
837
|
+
* CONCURRENTLY` waits for every older snapshot, so a second migrator that
|
|
838
|
+
* blocked there would deadlock with the build of the first.
|
|
839
|
+
*/
|
|
840
|
+
async function waitForMigrationLock(tryLock) {
|
|
841
|
+
while (!await tryLock()) await new Promise((resolve) => setTimeout(resolve, MIGRATION_LOCK_POLL_MS));
|
|
842
|
+
}
|
|
806
843
|
async function retryOnLockTimeout(tag, apply) {
|
|
807
844
|
for (let attempt = 1;; attempt += 1) try {
|
|
808
845
|
await apply();
|
|
@@ -823,7 +860,8 @@ async function retryOnLockTimeout(tag, apply) {
|
|
|
823
860
|
* (drizzle-orm#3249), so locks from earlier migrations stay held while later
|
|
824
861
|
* migrations wait for theirs. That can deadlock with live traffic. This keeps
|
|
825
862
|
* Drizzle's journal table and skip rule, so existing databases are unaffected.
|
|
826
|
-
* A migration that waits too long for a lock rolls back and runs again.
|
|
863
|
+
* A migration that waits too long for a lock rolls back and runs again. A
|
|
864
|
+
* migration that only builds indexes concurrently runs outside a transaction.
|
|
827
865
|
*/
|
|
828
866
|
async function applyMigrations(executor, config) {
|
|
829
867
|
const schema = config.migrationsSchema ?? "drizzle";
|
|
@@ -834,11 +872,23 @@ async function applyMigrations(executor, config) {
|
|
|
834
872
|
const appliedAt = Number(last?.createdAt ?? 0);
|
|
835
873
|
for (const migration of readMigrationFiles(config)) {
|
|
836
874
|
if (migration.folderMillis <= appliedAt) continue;
|
|
837
|
-
|
|
875
|
+
const tag = String(migration.folderMillis);
|
|
876
|
+
const recordApplied = () => executor.execute(`INSERT INTO ${table} (hash, created_at) VALUES ($1, $2)`, [migration.hash, migration.folderMillis]);
|
|
877
|
+
const indexes = concurrentIndexes(tag, migration.sql);
|
|
878
|
+
if (indexes) {
|
|
879
|
+
for (const { name, statement } of indexes) {
|
|
880
|
+
const [state] = await executor.query(`SELECT indisvalid AND indisready AS usable FROM pg_index WHERE indexrelid = to_regclass($1)`, [name]);
|
|
881
|
+
if (state && !state.usable) await executor.execute(`DROP INDEX CONCURRENTLY IF EXISTS "${name}"`);
|
|
882
|
+
await executor.execute(statement);
|
|
883
|
+
}
|
|
884
|
+
await recordApplied();
|
|
885
|
+
continue;
|
|
886
|
+
}
|
|
887
|
+
await retryOnLockTimeout(tag, async () => {
|
|
838
888
|
await executor.transaction(async () => {
|
|
839
889
|
await executor.execute(`SET LOCAL lock_timeout = ${LOCK_TIMEOUT_MS}`);
|
|
840
890
|
for (const statement of migration.sql) await executor.execute(statement);
|
|
841
|
-
await
|
|
891
|
+
await recordApplied();
|
|
842
892
|
});
|
|
843
893
|
});
|
|
844
894
|
}
|
|
@@ -1036,7 +1086,9 @@ var NeonExecutor = class {
|
|
|
1036
1086
|
const client = await this.pool.connect();
|
|
1037
1087
|
const lockName = `junior:migrate:${migrationTable}`;
|
|
1038
1088
|
try {
|
|
1039
|
-
await
|
|
1089
|
+
await waitForMigrationLock(async () => {
|
|
1090
|
+
return (await client.query("SELECT pg_try_advisory_lock(hashtext($1)) AS locked", [lockName])).rows[0]?.locked === true;
|
|
1091
|
+
});
|
|
1040
1092
|
return await this.pool.onWebSocket(callback);
|
|
1041
1093
|
} finally {
|
|
1042
1094
|
client.release(true);
|
|
@@ -1155,7 +1207,9 @@ var PostgresExecutor = class {
|
|
|
1155
1207
|
const client = await this.pool.connect();
|
|
1156
1208
|
const lockName = `junior:migrate:${migrationTable}`;
|
|
1157
1209
|
try {
|
|
1158
|
-
await
|
|
1210
|
+
await waitForMigrationLock(async () => {
|
|
1211
|
+
return (await client.query("SELECT pg_try_advisory_lock(hashtext($1)) AS locked", [lockName])).rows[0]?.locked === true;
|
|
1212
|
+
});
|
|
1159
1213
|
return await callback();
|
|
1160
1214
|
} finally {
|
|
1161
1215
|
client.release(true);
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as getClient, c as init, i as getActiveSpan, o as getGlobalScope, p as spanToJSON, s as getTraceData } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
2
|
+
import { B as getDeploymentTelemetryAttributes, z as getDeploymentServiceVersion } from "./logging-9OAq-fdg.js";
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DPjv4SnA.js";
|
|
4
4
|
import { n as redactSandboxEgressProxyPath } from "./proxy-path-BHYoKZdq.js";
|
|
5
5
|
import { t as consumePrivateTraceResultMarker } from "./private-trace-result-CE7_lEdq.js";
|
|
6
6
|
import { n as promoteHttpRouteName, r as routeNameMiddleware, t as nameRequestRoute } from "./sentry-route-name-BhwWnfqj.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as withScope, 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 } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { t as JUNIOR_VERSION } from "./version-
|
|
2
|
+
import { t as JUNIOR_VERSION } from "./version-AQa7Fr2H.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";
|
|
@@ -1240,6 +1240,7 @@ function extractGenAiUsageAttributes(...sources) {
|
|
|
1240
1240
|
...outputTokens !== void 0 ? { "gen_ai.usage.output_tokens": outputTokens } : void 0,
|
|
1241
1241
|
...cachedInputTokens !== void 0 ? { "gen_ai.usage.cache_read.input_tokens": cachedInputTokens } : void 0,
|
|
1242
1242
|
...cacheCreationTokens !== void 0 ? { "gen_ai.usage.cache_creation.input_tokens": cacheCreationTokens } : void 0,
|
|
1243
|
+
...cachedInputTokens !== void 0 && semanticInputTokens ? { "gen_ai.usage.cache_hit_ratio": cachedInputTokens / semanticInputTokens } : void 0,
|
|
1243
1244
|
...reasoningTokens !== void 0 ? { "gen_ai.usage.reasoning.output_tokens": reasoningTokens } : void 0,
|
|
1244
1245
|
...cost?.input !== void 0 ? { "app.cost.input_usd": cost.input } : void 0,
|
|
1245
1246
|
...cost?.output !== void 0 ? { "app.cost.output_usd": cost.output } : void 0,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import {
|
|
5
|
-
import { hn as toolInvocationDestination, in as AgentMessageTargetError, mn as actorFromRun, nn as AgentMessagePausedError } from "./agent-runner-
|
|
6
|
-
import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-
|
|
7
|
-
import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-
|
|
8
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
9
|
-
import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-
|
|
10
|
-
import { r as enqueueAgentMessageToParent } from "./result-
|
|
2
|
+
import { Cn as renderUntrustedTag, Za as canAccessConversation, eo as readConversationAccessFromSql } from "./projection-BzJQncZV.js";
|
|
3
|
+
import { n as botConfig } from "./config-DvnTPCfp.js";
|
|
4
|
+
import { M as SYSTEM_IDENTITY_ID, a as getConversationStore, o as getDb } from "./db-Dts2XvLu.js";
|
|
5
|
+
import { hn as toolInvocationDestination, in as AgentMessageTargetError, mn as actorFromRun, nn as AgentMessagePausedError } from "./agent-runner-DjMTPWEO.js";
|
|
6
|
+
import { I as PARENT_AGENT_TARGET, v as getActiveAgentInvocationForConversation } from "./turn-failure-response-BTSo6SMJ.js";
|
|
7
|
+
import { G as admitAutomatedTurn, S as EVENT_WAIT_MS, V as postAutomatedTurnLimitNoticeForConversation } from "./session-stop-DkxI5vc3.js";
|
|
8
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-DgD78_NK.js";
|
|
9
|
+
import { a as enqueueAgentInvocation, c as createAgentInvocationForMessage, u as findChildAgentConversationId } from "./work-yN_GAuXY.js";
|
|
10
|
+
import { r as enqueueAgentMessageToParent } from "./result-DhgjR3nQ.js";
|
|
11
11
|
// src/chat/agent-invocations/top-level-message.ts
|
|
12
12
|
const AGENT_MESSAGE_EVENT_NAMESPACE = "junior";
|
|
13
13
|
/** Event type of a message from another top-level agent. */
|
package/dist/nitro.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as JuniorDashboardOptions } from "./app-
|
|
2
|
-
import { n as JuniorPluginSet } from "./plugins-
|
|
1
|
+
import { i as JuniorDashboardOptions } from "./app-uiTzRbvq.js";
|
|
2
|
+
import { n as JuniorPluginSet } from "./plugins-B_0Cr0MO.js";
|
|
3
3
|
import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
|
|
4
4
|
type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
|
|
5
5
|
type SentryNitroOptions = NonNullable<Parameters<typeof withSentryConfig$1>[1]>;
|
package/dist/nitro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-
|
|
1
|
+
import { A as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_CRON_SCHEDULE, I as JUNIOR_RETENTION_ROUTE, L as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_CRON_SCHEDULE, N as JUNIOR_HEARTBEAT_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, j as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, k as JUNIOR_CACHE_WARMUP_CALLBACK_ROUTE, z as getDeploymentServiceVersion } from "./logging-9OAq-fdg.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
|
|
3
|
-
import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-
|
|
3
|
+
import { S as CACHE_WARMUP_QUEUE_TOPIC, _ as resolveConversationWorkQueueTopic, a as PLUGIN_TASK_QUEUE_TOPIC, f as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC } from "./background-compaction-queue-DUkHZjmL.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
|
|
5
5
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { En as createUserTokenStore } from "./projection-BzJQncZV.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-BhbaZfmO.js";
|
|
3
3
|
import { createServer } from "node:http";
|
|
4
4
|
// src/chat/local/oauth-callback-server.ts
|
|
5
5
|
const LOCAL_OAUTH_TIMEOUT_MS = 6e5;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
+
import { t as readJuniorSecret } from "./secrets-DebYU866.js";
|
|
2
3
|
import { randomBytes } from "node:crypto";
|
|
3
4
|
import * as z from "zod";
|
|
4
5
|
import { SignJWT, jwtVerify } from "jose";
|
|
@@ -19,7 +20,7 @@ const localOAuthRelayPayloadSchema = z.object({
|
|
|
19
20
|
}).strict();
|
|
20
21
|
/** Derive the HMAC key used only for signed local OAuth relay state. */
|
|
21
22
|
function relayKey() {
|
|
22
|
-
const secret =
|
|
23
|
+
const secret = readJuniorSecret();
|
|
23
24
|
if (!secret) throw new Error("Local OAuth requires JUNIOR_SECRET");
|
|
24
25
|
return new TextEncoder().encode(secret);
|
|
25
26
|
}
|