@sentry/junior 0.281.0 → 0.282.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/{adapter-RVQGEa98.js → adapter-BAqo7eOH.js} +1 -1
- package/dist/{admin-DQpHx6Og.js → admin-DbWpMHh6.js} +1 -1
- package/dist/{agent-runner-B229gXUY.js → agent-runner-h4CDcnDV.js} +22 -25
- package/dist/api.d.ts +1 -1
- package/dist/api.js +21 -21
- package/dist/{app-BQ9RZS43.d.ts → app-B-0wwAxr.d.ts} +1 -1
- package/dist/app.d.ts +1 -1
- package/dist/app.js +27 -27
- package/dist/{assistant-reply-DQbtwc6j.js → assistant-reply-4Wvo95-N.js} +1 -1
- package/dist/{background-compaction-queue-oegyrxSe.js → background-compaction-queue-CoWqScCC.js} +2 -2
- package/dist/{briefs-BwzGWJgR.js → briefs-CMiotFo9.js} +2 -2
- package/dist/{catalog-runtime-ClKzLvbN.js → catalog-runtime-Cpje_Uic.js} +1 -1
- package/dist/cli/chat.js +14 -14
- package/dist/cli/check.js +3 -3
- package/dist/cli/main.js +3 -3
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/snapshot-create.js +4 -4
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +74 -7
- package/dist/{client-DkG0Tj53.js → client-BHgCXeaF.js} +2 -2
- package/dist/{config-3AZ11aSM.js → config-DBdBimZ9.js} +1 -1
- package/dist/{connections-C0ut_6RW.js → connections-DjY72_uF.js} +10 -10
- package/dist/{conversation-privacy-DAgeBGLN.js → conversation-privacy-DiDh9KE4.js} +1 -1
- package/dist/{credential-sync-Bg8NPuvj.js → credential-sync-DUrQwccr.js} +13 -13
- package/dist/{db-BCFM0CUX.d.ts → db-hQsoB16L.d.ts} +1 -0
- package/dist/{executor-DLKnzP6S.js → executor-CGqJCxgR.js} +14 -3
- package/dist/instrumentation.js +2 -2
- package/dist/{logging-DHzrobea.js → logging-DapIaJAi.js} +1 -1
- package/dist/{message-LR8z5jXJ.js → message-BjN5sKad.js} +9 -9
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +3 -11
- package/dist/{oauth-callback-server-EWdpj0_y.js → oauth-callback-server-DVHKrjJP.js} +2 -2
- package/dist/{projection-Bhz1tp0G.js → projection-ii_OYu6z.js} +28 -13
- package/dist/{registry-EjhulgQW.js → registry-DpjG3yS-.js} +1 -1
- package/dist/{resolve-Cw6OW4Fj.js → resolve-iMW9Dgo2.js} +3 -3
- package/dist/{result-BoD0jevy.js → result-BrlvfyIj.js} +8 -8
- package/dist/{runner-D22bsBDS.js → runner-Bg9mr2pB.js} +10 -10
- package/dist/{sandbox-egress-signals-BG5GYacQ.js → sandbox-egress-signals-Bd3lb_Wd.js} +1 -1
- package/dist/{service-account-xo-CeMqI.js → service-account-Bd1348kw.js} +3 -3
- package/dist/{service-account-Dd1nnAQZ.js → service-account-Dfl9Pitm.js} +3 -3
- package/dist/{session-stop-CHSYB2uw.js → session-stop-CVEEx_YD.js} +10 -10
- package/dist/{skills-BGJr6xtW.js → skills-DqUUuf4L.js} +2 -2
- package/dist/{spawn-Cl8WS7zi.js → spawn-e7rQs14T.js} +2 -2
- package/dist/{stop-C9lHWpvl.js → stop-DtpBUUJq.js} +265 -119
- package/dist/{store-DeTnwVJt.js → store-nETG4KVg.js} +4 -4
- package/dist/{store-C4z8gOgZ.js → store-nu3Xx08K.js} +3 -3
- package/dist/{task-queue-BBos68l0.js → task-queue-CYje8WKs.js} +3 -3
- package/dist/{task-runner-BSF9zO-H.js → task-runner-CwegN45x.js} +6 -6
- package/dist/{thread-state-DGq1o5JX.js → thread-state-BDaMl9yd.js} +4 -4
- package/dist/{turn-failure-response--9bA4uLP.js → turn-failure-response-CV06tN_R.js} +6 -6
- package/dist/{turn-lifecycle-t5fimxwQ.js → turn-lifecycle-CF2N7ud5.js} +1 -1
- package/dist/{turn-session-routing-RBtUe-3y.js → turn-session-routing-BIJGJjVh.js} +8 -8
- package/dist/{validation-DrR0leBT.js → validation-DXvxEEjq.js} +1 -1
- package/dist/{version-D_HFt_Dq.js → version-CzEk1KBX.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{viewer-DWlpSFdj.js → viewer-C2PztlYX.js} +18 -6
- package/dist/{work-pPoqtRea.js → work-BM_L0Pv9.js} +10 -10
- package/dist/{worker-CoVKgJ-O.js → worker-2no53G60.js} +6 -6
- package/migrations/0062_plugin_report_index.sql +3 -3
- package/migrations/0078_plugin_conversation_index.sql +3 -3
- package/migrations/0079_conversation_event_author_index.sql +3 -3
- package/migrations/0080_conversation_event_latest_message_indexes.sql +27 -0
- package/migrations/meta/0080_snapshot.json +4265 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
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-DBdBimZ9.js";
|
|
2
|
+
import { t as createJuniorSqlExecutor } from "../executor-CGqJCxgR.js";
|
|
3
|
+
import { t as createPluginCatalogRuntime } from "../registry-DpjG3yS-.js";
|
|
4
4
|
import { n as pluginCatalogConfigFromEnv, r as pluginCatalogConfigFromPluginSet, t as defineJuniorPlugins } from "../plugins-HYh_JOdw.js";
|
|
5
5
|
import { t as loadAppPluginSet } from "../plugin-module-Cf5gVPWP.js";
|
|
6
6
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -8,6 +8,69 @@ import { createHash } from "node:crypto";
|
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { createJiti } from "jiti";
|
|
10
10
|
import { readMigrationFiles } from "drizzle-orm/migrator";
|
|
11
|
+
// src/db/concurrent-indexes.ts
|
|
12
|
+
const CONCURRENT_INDEX_MARKER = "-- junior:concurrent-index";
|
|
13
|
+
const INDEX_STATEMENT = /^CREATE INDEX "([a-z0-9_]+)" ON "([a-z0-9_]+)" .+;$/;
|
|
14
|
+
function markedIndexes(migration) {
|
|
15
|
+
const lines = migration.sql.join("").split("\n").map((line) => line.trim());
|
|
16
|
+
const indexes = [];
|
|
17
|
+
for (const [index, line] of lines.entries()) {
|
|
18
|
+
if (line !== CONCURRENT_INDEX_MARKER) continue;
|
|
19
|
+
const statement = lines[index + 1] ?? "";
|
|
20
|
+
const match = INDEX_STATEMENT.exec(statement);
|
|
21
|
+
if (!match?.[1] || !match[2]) throw new Error(`Migration ${migration.folderMillis}: the line after "${CONCURRENT_INDEX_MARKER}" must be one CREATE INDEX statement on one line.`);
|
|
22
|
+
indexes.push({
|
|
23
|
+
name: match[1],
|
|
24
|
+
statement,
|
|
25
|
+
table: match[2]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return indexes;
|
|
29
|
+
}
|
|
30
|
+
/** Remove the schema name so indexes on same-name tables compare equal. */
|
|
31
|
+
function withoutSchema(definition) {
|
|
32
|
+
return definition.replace(/ ON [^ ]+\./, " ON ");
|
|
33
|
+
}
|
|
34
|
+
async function readIndexState(executor, name) {
|
|
35
|
+
const [row] = await executor.query(`SELECT pg_get_indexdef(indexrelid) AS definition,
|
|
36
|
+
indisvalid AND indisready AS usable
|
|
37
|
+
FROM pg_index
|
|
38
|
+
WHERE indexrelid = to_regclass($1)`, [name]);
|
|
39
|
+
return row;
|
|
40
|
+
}
|
|
41
|
+
async function expectedDefinition(executor, index) {
|
|
42
|
+
return await executor.transaction(async () => {
|
|
43
|
+
await executor.execute(`CREATE TEMPORARY TABLE "${index.table}" (LIKE "${index.table}") ON COMMIT DROP`);
|
|
44
|
+
await executor.execute(index.statement);
|
|
45
|
+
const [row] = await executor.query(`SELECT pg_get_indexdef(format('pg_temp.%I', $1::text)::regclass) AS definition`, [index.name]);
|
|
46
|
+
if (!row) throw new Error(`Index ${index.name} was not built on the empty copy.`);
|
|
47
|
+
return withoutSchema(row.definition);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async function buildConcurrentIndex(executor, index) {
|
|
51
|
+
const [table] = await executor.query(`SELECT to_regclass($1) IS NOT NULL AS "exists"`, [index.table]);
|
|
52
|
+
if (!table?.exists) return;
|
|
53
|
+
const expected = await expectedDefinition(executor, index);
|
|
54
|
+
let state = await readIndexState(executor, index.name);
|
|
55
|
+
if (state && !state.usable) {
|
|
56
|
+
await executor.execute(`DROP INDEX CONCURRENTLY IF EXISTS "${index.name}"`);
|
|
57
|
+
state = void 0;
|
|
58
|
+
}
|
|
59
|
+
if (!state) {
|
|
60
|
+
await executor.execute(index.statement.replace(/^CREATE INDEX /, "CREATE INDEX CONCURRENTLY "));
|
|
61
|
+
state = await readIndexState(executor, index.name);
|
|
62
|
+
}
|
|
63
|
+
if (!state?.usable || withoutSchema(state.definition) !== expected) throw new Error(`Index ${index.name} does not match its migration. Expected "${expected}", found "${state?.definition ?? "no index"}". Drop the index, then run junior upgrade again.`);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Build the marked indexes of pending migrations before the transactional
|
|
67
|
+
* migrate, so that the migrate does not block writes to existing tables.
|
|
68
|
+
* Call it while the migration lock is held.
|
|
69
|
+
*/
|
|
70
|
+
async function buildPendingConcurrentIndexes(executor, migrations, appliedAt) {
|
|
71
|
+
const pending = migrations.filter((migration) => appliedAt === void 0 || migration.folderMillis > appliedAt);
|
|
72
|
+
for (const index of pending.flatMap(markedIndexes)) await buildConcurrentIndex(executor, index);
|
|
73
|
+
}
|
|
11
74
|
// src/db/postgres-error.ts
|
|
12
75
|
/** Return whether an unknown PostgreSQL failure has the requested SQLSTATE. */
|
|
13
76
|
function isPostgresErrorCode(error, code) {
|
|
@@ -79,6 +142,7 @@ async function migrateSchema(executor) {
|
|
|
79
142
|
const lockedState = await loadCoreMigrationState(executor);
|
|
80
143
|
if (isCurrentMigrationState(lockedState, latestMigration.folderMillis)) return migrationResult(migrations, lockedState);
|
|
81
144
|
assertSupportedMigrationState(lockedState);
|
|
145
|
+
await buildPendingConcurrentIndexes(executor, migrations, lockedState.appliedAt);
|
|
82
146
|
await executor.migrate({
|
|
83
147
|
migrationsFolder,
|
|
84
148
|
migrationsTable: MIGRATIONS_TABLE
|
|
@@ -172,10 +236,13 @@ async function migratePluginSchemas(executor, roots, options = {}) {
|
|
|
172
236
|
table
|
|
173
237
|
});
|
|
174
238
|
const existing = appliedCount(migrations, currentTime);
|
|
175
|
-
if (existing < migrations.length)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
239
|
+
if (existing < migrations.length) {
|
|
240
|
+
await buildPendingConcurrentIndexes(executor, migrations, currentTime);
|
|
241
|
+
await executor.migrate({
|
|
242
|
+
migrationsFolder: root.dir,
|
|
243
|
+
migrationsTable: table
|
|
244
|
+
});
|
|
245
|
+
}
|
|
179
246
|
return {
|
|
180
247
|
existing,
|
|
181
248
|
migrated: migrations.length - existing,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
2
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
1
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DapIaJAi.js";
|
|
2
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-DiDh9KE4.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,5 +1,5 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { c as resolveGatewayModel, w as toOptionalTrimmed } from "./client-
|
|
2
|
+
import { c as resolveGatewayModel, w as toOptionalTrimmed } from "./client-BHgCXeaF.js";
|
|
3
3
|
import { AwsClient } from "aws4fetch";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/chat/attachments/s3.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { X as loadTurnCheckpoint, et as failTurnRecord, gi as startOAuthFlow, tt as getTurnRecord } from "./projection-
|
|
2
|
-
import { n as botConfig } from "./config-
|
|
3
|
-
import { C as getSqlExecutor, R as deleteProviderIdentityForSlackUser, y as getConversationEventStore, z as deleteProviderIdentityForUser } from "./viewer-
|
|
4
|
-
import { u as hasRequiredOAuthScope } from "./registry-
|
|
5
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
6
|
-
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-
|
|
7
|
-
import { r as getStateAdapter } from "./adapter-
|
|
8
|
-
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-
|
|
9
|
-
import { m as ensureConversationWake, w as requestConversationWork } from "./store-
|
|
10
|
-
import { n as resolveTurnSessionRouting } from "./turn-session-routing-
|
|
1
|
+
import { X as loadTurnCheckpoint, et as failTurnRecord, gi as startOAuthFlow, tt as getTurnRecord } from "./projection-ii_OYu6z.js";
|
|
2
|
+
import { n as botConfig } from "./config-DBdBimZ9.js";
|
|
3
|
+
import { C as getSqlExecutor, R as deleteProviderIdentityForSlackUser, y as getConversationEventStore, z as deleteProviderIdentityForUser } from "./viewer-C2PztlYX.js";
|
|
4
|
+
import { u as hasRequiredOAuthScope } from "./registry-DpjG3yS-.js";
|
|
5
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cpje_Uic.js";
|
|
6
|
+
import { c as deleteMcpAuthSessionsForUserProvider, l as deleteMcpServerSessionId, u as deleteMcpStoredOAuthCredentials } from "./agent-runner-h4CDcnDV.js";
|
|
7
|
+
import { r as getStateAdapter } from "./adapter-BAqo7eOH.js";
|
|
8
|
+
import { l as getVercelConversationWorkQueue } from "./background-compaction-queue-CoWqScCC.js";
|
|
9
|
+
import { m as ensureConversationWake, w as requestConversationWork } from "./store-nu3Xx08K.js";
|
|
10
|
+
import { n as resolveTurnSessionRouting } from "./turn-session-routing-BIJGJjVh.js";
|
|
11
11
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
// src/chat/task-execution/authorized-turn.ts
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { On as resolvePluginOAuthAccount, d as recordAuthorizationCompleted, hi as resolveBaseUrl, ki as postSlackMessage, mi as parseOAuthStatePayload, pi as formatProviderLabel, q as getConversationPendingAuth, tt as getTurnRecord, u as recordAuthenticationLinked, wn as createUserTokenStore, zi as getSlackClient } from "./projection-
|
|
2
|
-
import { m as escapeXml } from "./client-
|
|
3
|
-
import { a as getRuntimeMetadata, n as botConfig } from "./config-
|
|
4
|
-
import { H as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-
|
|
1
|
+
import { On as resolvePluginOAuthAccount, d as recordAuthorizationCompleted, hi as resolveBaseUrl, ki as postSlackMessage, mi as parseOAuthStatePayload, pi as formatProviderLabel, q as getConversationPendingAuth, tt as getTurnRecord, u as recordAuthenticationLinked, wn as createUserTokenStore, zi as getSlackClient } from "./projection-ii_OYu6z.js";
|
|
2
|
+
import { m as escapeXml } from "./client-BHgCXeaF.js";
|
|
3
|
+
import { a as getRuntimeMetadata, n as botConfig } from "./config-DBdBimZ9.js";
|
|
4
|
+
import { H as isNativeIdentityProvider, _ as runBestEffort, h as logWarn, p as logException } from "./logging-DapIaJAi.js";
|
|
5
5
|
import { p as parseSlackUserId } from "./actor-6jsm_v96.js";
|
|
6
|
-
import { B as findUserByVerifiedEmails, C as getSqlExecutor, I as resolveActorIdentityId, W as upsertLinkedIdentity, o as readIdentityById } from "./viewer-
|
|
6
|
+
import { B as findUserByVerifiedEmails, C as getSqlExecutor, I as resolveActorIdentityId, W as upsertLinkedIdentity, o as readIdentityById } from "./viewer-C2PztlYX.js";
|
|
7
7
|
import { i as homeDir } from "./package-discovery-DJhGdS4c.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 { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-
|
|
8
|
+
import { n as buildOAuthTokenRequest, r as parseOAuthTokenResponse, u as hasRequiredOAuthScope } from "./registry-DpjG3yS-.js";
|
|
9
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cpje_Uic.js";
|
|
10
|
+
import { t as discoverSkills } from "./skills-DqUUuf4L.js";
|
|
11
|
+
import { d as getMcpAuthSession, f as getMcpStoredOAuthCredentials, o as finalizeMcpAuthorization, p as putMcpStoredOAuthCredentials, s as deleteMcpAuthSession, y as lookupSlackUserProfile } from "./agent-runner-h4CDcnDV.js";
|
|
12
12
|
import { r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
13
|
-
import { r as getStateAdapter } from "./adapter-
|
|
14
|
-
import { _ as getMcpProviderErrorAttributes } from "./service-account-
|
|
15
|
-
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
16
|
-
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-
|
|
13
|
+
import { r as getStateAdapter } from "./adapter-BAqo7eOH.js";
|
|
14
|
+
import { _ as getMcpProviderErrorAttributes } from "./service-account-Dfl9Pitm.js";
|
|
15
|
+
import { o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BDaMl9yd.js";
|
|
16
|
+
import { c as deleteWebAuthorization, i as readConnectedOAuthTokens, m as wakePausedTurn, p as wakeAuthorizedTurn, u as htmlCallbackResponse } from "./connections-DjY72_uF.js";
|
|
17
17
|
import { n as relayLocalOAuthCallback } from "./oauth-relay-D6xxVywK.js";
|
|
18
18
|
import path from "node:path";
|
|
19
19
|
import { createHmac, createSecretKey, timingSafeEqual } from "node:crypto";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./config-
|
|
2
|
-
import { p as logException } from "./logging-
|
|
1
|
+
import "./config-DBdBimZ9.js";
|
|
2
|
+
import { p as logException } from "./logging-DapIaJAi.js";
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { getTableColumns, sql } from "drizzle-orm";
|
|
5
5
|
import { bigint, boolean, check, date, doublePrecision, foreignKey, index, integer, jsonb, pgTable, primaryKey, text, timestamp, uniqueIndex, uuid } from "drizzle-orm/pg-core";
|
|
@@ -232,6 +232,14 @@ const juniorApiTokens = pgTable("junior_api_tokens", {
|
|
|
232
232
|
}, (table) => [uniqueIndex("junior_api_tokens_token_hash_uidx").on(table.tokenHash), index("junior_api_tokens_owner_email_idx").on(table.ownerEmailNormalized)]);
|
|
233
233
|
// src/db/schema/conversation-events.ts
|
|
234
234
|
/**
|
|
235
|
+
* Match a user_message payload that a person sent as an instruction from a
|
|
236
|
+
* chat surface. `junior_conversation_events_user_message_time_idx` has this
|
|
237
|
+
* predicate, so a query with it can use the index and skip other events.
|
|
238
|
+
*/
|
|
239
|
+
function isUserInstruction(payload) {
|
|
240
|
+
return sql`(${payload}->'provenance'->>'authority') = 'instruction' and (${payload}->'provenance'->'actor'->>'platform') in ('slack', 'local', 'web')`;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
235
243
|
* Append-only canonical conversation history. `history_version` partitions
|
|
236
244
|
* model-history replacements, while `(conversation_id, seq)` is the stable
|
|
237
245
|
* event identity and lease-fencing tripwire.
|
|
@@ -265,6 +273,8 @@ const juniorConversationEvents = pgTable("junior_conversation_events", {
|
|
|
265
273
|
index("junior_conversation_events_plugin_conversation_idx").on(table.conversationId, sql`(${table.payload}->>'namespace')`, sql`(${table.payload}->>'name')`, table.seq).where(sql`${table.type} = 'structured_event'`),
|
|
266
274
|
index("junior_conversation_events_actor_identity_idx").on(table.actorIdentityId, table.conversationId, table.seq),
|
|
267
275
|
index("junior_conversation_events_author_idx").on(table.conversationId, table.actorIdentityId, table.seq).where(sql`${table.actorIdentityId} is not null`),
|
|
276
|
+
index("junior_conversation_events_message_role_idx").on(table.conversationId, sql`(${table.payload}->>'role')`, table.createdAt, table.seq).where(sql`${table.type} = 'message'`),
|
|
277
|
+
index("junior_conversation_events_user_message_time_idx").on(table.conversationId, table.createdAt, table.seq).where(sql`${table.type} = 'user_message' and ${isUserInstruction(table.payload)}`),
|
|
268
278
|
index("junior_conversation_events_message_search_idx").using("gin", sql`to_tsvector('english', ${table.payload}->>'text')`).where(sql`${table.type} = 'message'`),
|
|
269
279
|
uniqueIndex("junior_conversation_events_idempotency_idx").on(table.conversationId, table.idempotencyKey)
|
|
270
280
|
]);
|
|
@@ -822,6 +832,7 @@ function createNeonJuniorSqlExecutor(args) {
|
|
|
822
832
|
const pool = new Pool({
|
|
823
833
|
connectionString: args.connectionString,
|
|
824
834
|
max: 10,
|
|
835
|
+
idleTimeoutMillis: 6e4,
|
|
825
836
|
statement_timeout: args.statementTimeoutMs
|
|
826
837
|
});
|
|
827
838
|
pool.on("error", (error) => {
|
|
@@ -959,4 +970,4 @@ function createJuniorSqlExecutor(args) {
|
|
|
959
970
|
statementTimeoutMs
|
|
960
971
|
});
|
|
961
972
|
}
|
|
962
|
-
export {
|
|
973
|
+
export { juniorConversations as A, juniorConversationEvents as C, juniorCodeRepositories as D, juniorCodeChanges as E, juniorUsers as M, juniorDestinations as N, juniorAttachments as O, juniorArtifacts as P, isUserInstruction as S, juniorConversationAnnotations as T, juniorConversationParticipants as _, juniorReviewItemAssignees as a, CONVERSATION_METRICS as b, juniorReviewItems as c, juniorAutomations as d, juniorStats as f, juniorConversationReadPositions as g, juniorAgentInvocations as h, juniorWorkspaces as i, juniorIdentities as j, conversationReadColumns as k, juniorAutomationRuns as l, juniorAgentBindings as m, juniorSnapshots as n, juniorReviewItemConversations as o, juniorLocationConfigurations as p, juniorWorkspaceRepos as r, juniorReviewItemSlackCards as s, createJuniorSqlExecutor as t, juniorAutomationVersions as u, juniorConversationBindings as v, juniorApiTokens as w, juniorConversationMetrics as x, juniorConversationBriefs as y };
|
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 { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-
|
|
3
|
-
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-
|
|
2
|
+
import { R as getDeploymentServiceVersion, z as getDeploymentTelemetryAttributes } from "./logging-DapIaJAi.js";
|
|
3
|
+
import { n as getCurrentConversationPrivacy } from "./conversation-privacy-DiDh9KE4.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-CzEk1KBX.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,13 +1,13 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import {
|
|
3
|
-
import { n as botConfig } from "./config-
|
|
4
|
-
import { F as SYSTEM_IDENTITY_ID, S as getDb, x as getConversationStore } from "./viewer-
|
|
5
|
-
import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-
|
|
6
|
-
import { F as findChildAgentConversationId, L as PARENT_AGENT_TARGET, N as AgentMessageTargetError, a as createAgentInvocationForMessage, j as AgentMessagePausedError, s as getActiveAgentInvocationForConversation } from "./store-
|
|
7
|
-
import { D as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, j as admitAutomatedTurn } from "./session-stop-
|
|
8
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
9
|
-
import { r as enqueueAgentMessageToParent } from "./result-
|
|
10
|
-
import { i as enqueueAgentInvocation } from "./work-
|
|
2
|
+
import { Na as readConversationAccessFromSql, ja as canAccessConversation } from "./projection-ii_OYu6z.js";
|
|
3
|
+
import { n as botConfig } from "./config-DBdBimZ9.js";
|
|
4
|
+
import { F as SYSTEM_IDENTITY_ID, S as getDb, x as getConversationStore } from "./viewer-C2PztlYX.js";
|
|
5
|
+
import { Ft as toolInvocationDestination, Pt as actorFromRun } from "./agent-runner-h4CDcnDV.js";
|
|
6
|
+
import { F as findChildAgentConversationId, L as PARENT_AGENT_TARGET, N as AgentMessageTargetError, a as createAgentInvocationForMessage, j as AgentMessagePausedError, s as getActiveAgentInvocationForConversation } from "./store-nETG4KVg.js";
|
|
7
|
+
import { D as postAutomatedTurnLimitNoticeForConversation, a as EVENT_WAIT_MS, j as admitAutomatedTurn } from "./session-stop-CVEEx_YD.js";
|
|
8
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-nu3Xx08K.js";
|
|
9
|
+
import { r as enqueueAgentMessageToParent } from "./result-BrlvfyIj.js";
|
|
10
|
+
import { i as enqueueAgentInvocation } from "./work-BM_L0Pv9.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,4 +1,4 @@
|
|
|
1
|
-
import { i as JuniorDashboardOptions } from "./app-
|
|
1
|
+
import { i as JuniorDashboardOptions } from "./app-B-0wwAxr.js";
|
|
2
2
|
import { n as JuniorPluginSet } from "./plugins-DtmjkTza.js";
|
|
3
3
|
import { withSentryConfig as withSentryConfig$1 } from "@sentry/nitro";
|
|
4
4
|
type SentryNitroConfig = Parameters<typeof withSentryConfig$1>[0];
|
package/dist/nitro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_ROUTE, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_RETENTION_CRON_SCHEDULE, R as getDeploymentServiceVersion, j as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE } from "./logging-
|
|
1
|
+
import { A as JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE, D as JUNIOR_AUTO_ARCHIVE_CRON_SCHEDULE, F as JUNIOR_RETENTION_ROUTE, I as JUNIOR_WORKSPACE_SNAPSHOT_JOB_CALLBACK_ROUTE, M as JUNIOR_HEARTBEAT_ROUTE, N as JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE, O as JUNIOR_AUTO_ARCHIVE_ROUTE, P as JUNIOR_RETENTION_CRON_SCHEDULE, R as getDeploymentServiceVersion, j as JUNIOR_HEARTBEAT_CRON_SCHEDULE, k as JUNIOR_CONTEXT_COMPACTION_CALLBACK_ROUTE } from "./logging-DapIaJAi.js";
|
|
2
2
|
import { d as resolvePackageDir, t as discoverInstalledPluginPackageContent, u as isValidPackageName } from "./package-discovery-DJhGdS4c.js";
|
|
3
|
-
import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-
|
|
3
|
+
import { a as WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC, t as BACKGROUND_COMPACTION_QUEUE_TOPIC, u as resolveConversationWorkQueueTopic } from "./background-compaction-queue-CoWqScCC.js";
|
|
4
4
|
import { a as pluginRuntimeRegistrationsFromPluginSet, r as pluginCatalogConfigFromPluginSet } from "./plugins-HYh_JOdw.js";
|
|
5
|
-
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-
|
|
5
|
+
import { t as PLUGIN_TASK_QUEUE_TOPIC } from "./task-queue-CYje8WKs.js";
|
|
6
6
|
import { n as loadPluginSetFromModule, r as resolvePluginModule } from "./plugin-module-Cf5gVPWP.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { cpSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs";
|
|
@@ -39,7 +39,6 @@ function globToRegex(pattern) {
|
|
|
39
39
|
// src/build/copy-build-content.ts
|
|
40
40
|
const DASHBOARD_PACKAGE_NAME = "@sentry/junior-dashboard";
|
|
41
41
|
const JUNIOR_PACKAGE_NAME = "@sentry/junior";
|
|
42
|
-
const DASHBOARD_ASSET_NAMES = ["tailwind.css"];
|
|
43
42
|
/** Copy app, built-in skill, and declared plugin content into server output. */
|
|
44
43
|
function copyRuntimeContent(cwd, serverRoot, packageNames) {
|
|
45
44
|
copyIfExists(path.join(cwd, "app"), path.join(serverRoot, "app"));
|
|
@@ -58,12 +57,6 @@ function copyRuntimeContent(cwd, serverRoot, packageNames) {
|
|
|
58
57
|
for (const root of packagedContent.skillRoots) copyRootIntoServerOutput(cwd, serverRoot, root);
|
|
59
58
|
for (const pkg of packagedContent.packages) if (pkg.hasMigrationsDir) copyRootIntoServerOutput(cwd, serverRoot, path.join(pkg.dir, "migrations"));
|
|
60
59
|
}
|
|
61
|
-
/** Copy dashboard browser assets when core dashboard routes are enabled. */
|
|
62
|
-
function copyDashboardAssets(cwd, serverRoot) {
|
|
63
|
-
const packageDir = resolvePackageDir(cwd, DASHBOARD_PACKAGE_NAME);
|
|
64
|
-
if (!packageDir) throw new Error(`createApp({ dashboard }) requires installing "${DASHBOARD_PACKAGE_NAME}"`);
|
|
65
|
-
for (const fileName of DASHBOARD_ASSET_NAMES) copyIfExists(dashboardAssetPath(packageDir, fileName), path.join(serverRoot, "node_modules", DASHBOARD_PACKAGE_NAME, "dist", fileName));
|
|
66
|
-
}
|
|
67
60
|
/** Find the dashboard folder of content-hashed browser files that Nitro serves as static assets. */
|
|
68
61
|
function resolveDashboardPublicAssetsDir(cwd) {
|
|
69
62
|
const packageDir = resolvePackageDir(cwd, DASHBOARD_PACKAGE_NAME);
|
|
@@ -327,7 +320,6 @@ function juniorNitro(options = {}) {
|
|
|
327
320
|
const pluginSet = await loadConfiguredPluginSet();
|
|
328
321
|
const compiledPluginCatalogConfig = pluginCatalogConfigFromPluginSet(pluginSet);
|
|
329
322
|
copyRuntimeContent(cwd, nitro.options.output.serverDir, compiledPluginCatalogConfig?.packages);
|
|
330
|
-
if (dashboardEnabled(options.dashboard)) copyDashboardAssets(cwd, nitro.options.output.serverDir);
|
|
331
323
|
copyIncludedFiles(cwd, nitro.options.output.serverDir, options.includeFiles);
|
|
332
324
|
};
|
|
333
325
|
nitro.hooks.hook("rollup:before", (_nitro, config) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { wn as createUserTokenStore } from "./projection-
|
|
2
|
-
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-
|
|
1
|
+
import { wn as createUserTokenStore } from "./projection-ii_OYu6z.js";
|
|
2
|
+
import { a as GET, n as syncLocalOAuthCredential, r as GET$1 } from "./credential-sync-DUrQwccr.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,16 +1,16 @@
|
|
|
1
1
|
import { a as getClient$1, h as startSpan, n as captureMessage, r as continueTrace, v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { a as completeText, c as resolveGatewayModel, i as completeObject, m as escapeXml, o as embedTexts, p as unwrapCurrentInstruction, r as completeDecision, s as rerankTexts, t as GEN_AI_PROVIDER_NAME, w as toOptionalTrimmed, x as isProviderRetryError } from "./client-
|
|
3
|
-
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-
|
|
4
|
-
import { E as withSpan, G as toOptionalNumber, K as toOptionalString, W as isRecord$2, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-
|
|
5
|
-
import { t as canExposeConversationPayload } from "./conversation-privacy-
|
|
2
|
+
import { a as completeText, c as resolveGatewayModel, i as completeObject, m as escapeXml, o as embedTexts, p as unwrapCurrentInstruction, r as completeDecision, s as rerankTexts, t as GEN_AI_PROVIDER_NAME, w as toOptionalTrimmed, x as isProviderRetryError } from "./client-BHgCXeaF.js";
|
|
3
|
+
import { i as getChatConfig, n as botConfig, o as getSlackBotToken, v as normalizeSlackEmojiName } from "./config-DBdBimZ9.js";
|
|
4
|
+
import { E as withSpan, G as toOptionalNumber, K as toOptionalString, W as isRecord$2, _ as runBestEffort, a as extractGenAiUsageSummary, b as setSpanAttributes, c as getLogContextAttributes, d as logAudit, h as logWarn, m as logInfo, o as getActiveTraceContext, p as logException, t as buildTurnFailureResponse, y as setSentryUser } from "./logging-DapIaJAi.js";
|
|
5
|
+
import { t as canExposeConversationPayload } from "./conversation-privacy-DiDh9KE4.js";
|
|
6
6
|
import { c as parseStoredSlackActor, d as parseSlackChannelReferenceId, f as parseSlackTeamId, h as parseSlackMessageTs, i as isActorUserId, l as toStoredSlackActor, p as parseSlackUserId, s as parseActorUserId } from "./actor-6jsm_v96.js";
|
|
7
|
-
import { C as getSqlExecutor, D as createSqlConversationEventStore, G as bindProviderConversation, I as resolveActorIdentityId, O as eventFromRow, P as startLocationThread, S as getDb, U as saveUserTimezone, V as readUserTimezone, X as addAgentTurnUsage, at as sameDestination, et as hasAgentTurnUsage, g as createCache, i as readActorIdentity, j as createSqlStore, k as withConversationEventLock, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as conversationDetailTouch, rt as parseDestination, s as readIdentityByIdFromSql,
|
|
8
|
-
import { A as
|
|
7
|
+
import { C as getSqlExecutor, D as createSqlConversationEventStore, G as bindProviderConversation, I as resolveActorIdentityId, O as eventFromRow, P as startLocationThread, S as getDb, U as saveUserTimezone, V as readUserTimezone, X as addAgentTurnUsage, at as sameDestination, et as hasAgentTurnUsage, g as createCache, i as readActorIdentity, j as createSqlStore, k as withConversationEventLock, l as resolveViewerUser, n as findUserByEmailFromSql, o as readIdentityById, p as parseAvatarUrl, q as conversationDetailTouch, rt as parseDestination, s as readIdentityByIdFromSql, x as getConversationStore, y as getConversationEventStore } from "./viewer-C2PztlYX.js";
|
|
8
|
+
import { A as juniorConversations, C as juniorConversationEvents, D as juniorCodeRepositories, E as juniorCodeChanges, M as juniorUsers, N as juniorDestinations, O as juniorAttachments, T as juniorConversationAnnotations, _ as juniorConversationParticipants, a as juniorReviewItemAssignees, c as juniorReviewItems, d as juniorAutomations, i as juniorWorkspaces, j as juniorIdentities, n as juniorSnapshots, o as juniorReviewItemConversations, p as juniorLocationConfigurations, r as juniorWorkspaceRepos, y as juniorConversationBriefs } from "./executor-CGqJCxgR.js";
|
|
9
9
|
import { a as agentHistoryItemSchema, g as instructionProvenanceFor, h as instructionActors, m as contextProvenance } from "./media-Dq9_svfQ.js";
|
|
10
|
-
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-
|
|
11
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
10
|
+
import { _ as CredentialUnavailableError, a as resolveAuthTokenPlaceholder, f as credentialContextForActor, h as credentialSubjectSchema, m as credentialLogContext, o as resolvePluginCommandEnv, p as credentialContextSchema } from "./registry-DpjG3yS-.js";
|
|
11
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cpje_Uic.js";
|
|
12
12
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS, r as acquireActiveLock } from "./locks-D-0h111u.js";
|
|
13
|
-
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-
|
|
13
|
+
import { n as getDefaultRedisStateAdapterFor, r as getStateAdapter } from "./adapter-BAqo7eOH.js";
|
|
14
14
|
import { i as isValidTimeZone } from "./cadence-R7Em4RjE.js";
|
|
15
15
|
import { A as messageCardRef, H as conversationBriefSchema, M as readMessageCardRefs, O as reviewItemChangeRecordSchema, R as readMessageAttachments, U as parseBriefInput, W as parseStoredBrief, _ as conversationReportMessageEventSchema, g as conversationReportEventSchema } from "./conversation-DNtcULyX.js";
|
|
16
16
|
import { n as briefEntriesFromReportEvents, s as generateBrief, t as BRIEF_PROMPT } from "./prompt-DI6KCtwb.js";
|
|
@@ -708,7 +708,7 @@ async function listConversationAnnotationsById(db, conversationIds) {
|
|
|
708
708
|
const rows = await db.select({
|
|
709
709
|
annotation: juniorConversationAnnotations,
|
|
710
710
|
rootConversationId: juniorConversations.rootConversationId
|
|
711
|
-
}).from(juniorConversationAnnotations).innerJoin(juniorConversations, eq(juniorConversations.conversationId, juniorConversationAnnotations.conversationId)).where(or(inArray(
|
|
711
|
+
}).from(juniorConversationAnnotations).innerJoin(juniorConversations, eq(juniorConversations.conversationId, juniorConversationAnnotations.conversationId)).where(or(inArray(juniorConversations.conversationId, [...requested]), inArray(juniorConversations.rootConversationId, [...requested]))).orderBy(desc(juniorConversationAnnotations.updatedAt));
|
|
712
712
|
const seen = /* @__PURE__ */ new Set();
|
|
713
713
|
for (const { annotation: row, rootConversationId } of rows) {
|
|
714
714
|
const annotation = annotationFromRow(row);
|
|
@@ -2099,8 +2099,7 @@ async function conversationViewerMarks(db, conversationIds, subject) {
|
|
|
2099
2099
|
}]));
|
|
2100
2100
|
}
|
|
2101
2101
|
/** Read one viewer's archive and pin times for a conversation root. */
|
|
2102
|
-
async function readConversationViewerMarks(viewer,
|
|
2103
|
-
const rootConversationId = await resolveRootConversationId(getSqlExecutor(), conversationId);
|
|
2102
|
+
async function readConversationViewerMarks(viewer, rootConversationId) {
|
|
2104
2103
|
return (await conversationViewerMarks(getDb(), [rootConversationId], { userId: viewer.id })).get(rootConversationId);
|
|
2105
2104
|
}
|
|
2106
2105
|
/** True when one user pinned this root. Feeds sort these rows first. */
|
|
@@ -2162,6 +2161,22 @@ async function readConversationAccessFromSql(db, conversationIds, viewer) {
|
|
|
2162
2161
|
}));
|
|
2163
2162
|
}
|
|
2164
2163
|
/**
|
|
2164
|
+
* Read access for one request. Each id is read at most once, so the parts of
|
|
2165
|
+
* one response that need the same Conversation share a query.
|
|
2166
|
+
*/
|
|
2167
|
+
function createConversationAccessReader(db, viewer) {
|
|
2168
|
+
const byId = /* @__PURE__ */ new Map();
|
|
2169
|
+
return async (conversationIds) => {
|
|
2170
|
+
const missing = [...new Set(conversationIds)].filter((id) => !byId.has(id));
|
|
2171
|
+
if (missing.length > 0) {
|
|
2172
|
+
const read = readConversationAccessFromSql(db, missing, viewer);
|
|
2173
|
+
for (const id of missing) byId.set(id, read.then((access) => access.get(id)));
|
|
2174
|
+
}
|
|
2175
|
+
const entries = await Promise.all(conversationIds.map(async (id) => [id, await byId.get(id)]));
|
|
2176
|
+
return new Map(entries.flatMap(([id, access]) => access ? [[id, access]] : []));
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
/**
|
|
2165
2180
|
* Apply `policies/conversation-access.md`: whether work in the `requester`
|
|
2166
2181
|
* Conversation may read or find the data of the `target` Conversation. The
|
|
2167
2182
|
* person of the Turn does not change the result. A private Conversation is
|
|
@@ -14887,4 +14902,4 @@ async function recordGuardianActionReviewed(args) {
|
|
|
14887
14902
|
createdAtMs: Date.now()
|
|
14888
14903
|
}]);
|
|
14889
14904
|
}
|
|
14890
|
-
export { completeTurnRecord as $, notInheritedByForkChild as $a, isWorkspaceSnapshotNotReadyError as $i, takeReviewItem as $n, updateWorkspace as $r, isStandaloneRuntimeContextMessage as $t, getConversationMessageSlackTs as A, createPluginLogger as Aa, removeReactionFromMessage as Ai, createPluginHookRunner as An, takeDueTimerWatches as Ar, requestAnotherSlice as At, authorizationId as B, conversationViewerMarks as Ba, isConversationScopedChannel as Bi, coreTaskRegistrations as Bn, getDashboardObjectIconLink as Br, createTurnLimitGate as Bt, settleConversationTitleWork as C, sandboxSkillDir as Ca, addReactionToMessage as Ci, setExperimentalFeatures as Cn, collectEventMatchKeys as Cr, isInvalidConversationRecordError as Ct, buildConversationContext as D, buildNonInteractiveShellScript as Da, openSlackModal as Di, getOAuthAccountProviders as Dn, findMatchingWatches as Dr, recordConversationRetry as Dt, appendThreadContextMessages as E, buildCommandScript as Ea, openSlackDirectMessage as Ei, webActorUserIds as En, deliverWatch as Er, recordAttemptFailure as Et, turnHasReply as F, conversationHasParticipantUser as Fa, SlackActionError as Fi, getPluginTools as Fn, verifyScheduledAutomationCredentialSubject as Fr, TURN_LIMIT_WRAP_UP_MESSAGE as Ft, canReusePendingAuthLink as G, readLatestConversationBrief as Ga, getWorkspaceTeamId as Gi, countReviewItemsNeedingUser as Gn, createPluginState as Gr, getPiMessageRole as Gt, AuthorizationFlowDisabledError as H, viewerConversationMembership as Ha, normalizeSlackConversationId as Hi, setBriefsConfig as Hn, getDashboardTaskLink as Hr, CODEMODE_TOOL_NAME as Ht, upsertConversationMessage as I, conversationIsMemberRoot as Ia, downloadPrivateSlackFile as Ii, getPluginUserPromptContributions as In, verifySlackDirectCredentialSubject as Ir, TurnBudgetExceededError as It, wasPendingAuthStopped as J, readConversationEventPageAround as Ja, isAlreadyExistsError as Ji, getReviewItem as Jn, deleteWorkspace as Jr, hasCurrentInstruction as Jt, clearPendingAuth as K, readConversationEventPage as Ka, runWithWorkspaceTeamId as Ki, dismissOpenReviewItems as Kn, renderToolResultNudge as Kr, getTerminalAssistantMessages as Kt, createPluginEgress as L, conversationNotArchivedForEmail as La, getFilePermalink as Li, getPlugins as Ln, verifyTimerWatchCredentialSubject as Lr, TurnSliceLimitExceededError as Lt, markConversationMessage as M, readConversationAccessFromSql as Ma, uploadFilesToConversation as Mi, getPluginRoutes as Mn, bindScheduledAutomationCredentialSubject as Mr, startConversationWork as Mt, normalizeConversationText as N, conversationArchivedForEmail as Na, slackEntitySchema as Ni, getPluginSlackConversationLink as Nn, bindSlackDirectCredentialSubject as Nr, steerWebPendingMessages as Nt, createConversationMemoryService as O, runNonInteractiveCommand as Oa, postSlackEphemeralMessage as Oi, resolvePluginOAuthAccount as On, getWatch as Or, releaseConversationWork as Ot, recordDeliveredAssistantMessage as P, conversationArchivedForUser as Pa, slackExternalRefIdSchema as Pi, getPluginSystemPromptContributions as Pn, verifyEventAutomationCredentialSubject as Pr, stopConversationWork as Pt, abandonTurnRecord as Q, loadForkHistory as Qa, getWorkspaceSnapshotNotReadyError as Qi, searchReviewItems as Qn, listWorkspacesByRepository as Qr, isContinuablePiBoundary as Qt, PluginCredentialFailureError as R, conversationNotArchivedForUser as Ra, getHeaderString as Ri, setPlugins as Rn, JUNIOR_THREAD_STATE_TTL_MS as Rr, TurnToolCallLimitExceededError as Rt, resolveConversationTitle as S, SANDBOX_WORKSPACE_ROOT as Sa, truncateStatusText as Si, isExperimentalFeatureEnabled as Sn, setConfigDefaults as So, cancelWatch as Sr, isFinalAttempt as St, resolveTaskTitle as T, sandboxSkillPathResolution as Ta, getSlackMessagePermalink as Ti, findLegacyWebActorUserId as Tn, createWatch as Tr, markConversationWorkEnqueued as Tt, AuthorizationPauseError as U, createPluginConversationEvents as Ua, runWithSlackInstallationToken as Ui, REVIEW_ITEM_REPLIED_REASON as Un, setDashboardConversationLinkOptions as Ur, persistWithRetry as Ut, AuthPausePersistenceError as V, readConversationViewerMarks as Va, isDmChannel as Vi, registration_exports as Vn, getDashboardReviewItemLink as Vr, isTurnExecutionLimitExceededError as Vt, abandonReplacedPendingAuth as W, readConversationBriefThrough as Wa, withSlackRetries as Wi, closeReviewItem as Wn, ToolInputError as Wr, extractAssistantText as Wt, loadTurnCheckpoint as X, readConversationMessageEventSeq as Xa, wrapSandboxSetupError as Xi, listReplyActionItems as Xn, getWorkspaceByName as Xr, instructionTextForProjection as Xt, continuableMessages as Y, readConversationLastEventSeq as Ya, throwSandboxOperationError as Yi, insertReviewItem as Yn, getWorkspace as Yr, hasRuntimeTurnContext as Yt, saveTurnCheckpoint as Z, buildSentryConversationUrl as Za, WorkspaceSnapshotNotReadyError as Zi, listWaitingConversations as Zn, listWorkspaces as Zr, isAssistantMessage as Zt, appendConversationMessages as _, SANDBOX_COMMAND_PATH as _a, escapeSlackMrkdwnText as _i, estimateTextTokens as _n, piMessageFromHistoryItem as _o, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as _r, drainConversationMailbox as _t, loadProjection as a, parseSandboxEgressCredentialToken as aa, create as ai, trimTrailingAssistantMessages as an, resolveRootVisibility as ao, isOnlyAssignee as ar, CONVERSATION_WORK_STALE_ENQUEUE_MS as at, projectConversationMessages as b, SANDBOX_REPOS_ROOT as ba, normalizeSlackStatusText as bi, getAgentContextInputLimitTokens as bn, conversationNoteEvent as bo, STOP_WATCHING_TOOL_NAME as br, hasConversationStop as bt, recordAgentsInstructionsUpdated as c, resolveSandboxCommandEnvironment as ca, ensureDockerDaemon as ci, TURN_CONTEXT_TAG as cn, listConversationAnnotations as co, requireReviewItemLinks as cr, appendInboundMessage as ct, recordAuthorizationCompleted as d, sleep$2 as da, proxyVercelSandboxEgressRequest as di, SubscribedReplyReason as dn, resolveUserTimezone as do, EVERYONE_ASSIGNEE as dr, checkInConversationWork as dt, workspaceSnapshotNotReadyUserMessage as ea, WorkspaceValidationError as ei, isToolResultError as en, getSlackFileId as eo, updateReviewItemContent as er, failTurnRecord as et, recordAuthorizationRequested as f, tryWorkspaceRepoCheckoutPath as fa, deliverOAuthAuthorization as fi, decideSubscribedThreadReply as fn, lookupSlackUser as fo, automationCreatorUserId as fr, clearConsumedConversationWake as ft, recordToolExecutionStarted as g, createPluginModel as ga, startOAuthFlow as gi, estimateRequestOverheadTokens as gn, historyItemFromPiMessage as go, getSlackToolContext as gr, deadLetterAttempt as gt, recordSubscribedReplyRoute as h, createPluginEmbedder as ha, resolveBaseUrl as hi, calculateContextCompactionTargetTokens as hn, configValueSchema as ho, resolveChannelCapabilities as hr, completeConversationWork as ht, loadConversationProjection as i, createSandboxEgressCredentialToken as ia, setWorkspaceSnapshotBuild as ii, stripRuntimeTurnContext as in, recordSlackAttachment as io, canReadReviewItem as ir, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as it, isHumanConversationMessage as j, canAccessConversation as ja, updateSlackMessage as ji, getPluginApiRoutes as jn, bindEventAutomationCredentialSubject as jr, requestConversationWork as jt, estimateConversationContextTokens as k, createPluginModelCostRecorder as ka, postSlackMessage as ki, agent_hooks_exports as kn, listWatches as kr, removeActiveConversation as kt, recordAttachmentsDelivered as l, normalizeSandboxEgressTracePropagationDomains as la, getSandboxProvider as li, buildDeterministicAssistantMessageId as ln, listConversationAnnotationsById as lo, reviewItemNeedsUser as lr, beginConversationResume as lt, recordMcpProviderConnected as m, PluginToolDeniedError as ma, parseOAuthStatePayload as mi, getThreadStopDecision as mn, createDurableLocationConfigurationService as mo, resolveAssignees as mr, completeConversationStop as mt, commitMessages as n, consumeSandboxEgressAuthRequiredSignal as na, loadSnapshotsForProfile as ni, normalizeToolNameFromResult as nn, readAttachmentVisionSummary as no, canActOnReviewItem as nr, listTurnSummaries as nt, loadTurnProjection as o, sandboxEgressSignalsResponseSchema as oa, hash as oi, REQUEST_CONTEXT_SECTION_TAG as on, saveObjectAnnotations as oo, readReviewItemAgentScope as or, ackMessages as ot, recordGuardianActionReviewed as p, workspaceRepoCheckoutPath as pa, formatProviderLabel as pi, getSubscribedReplyPreflightDecision as pn, createPluginCache as po, resolveAssignee as pr, clearExpiredConversationLease as pt, getConversationPendingAuth as q, readConversationEventPageAfter as qa, isAbortError as qi, getOpenReviewItemByDedupeKey as qn, createWorkspace as qr, getUserMessageInstructionText as qt, loadConnectedMcpProviders as r, consumeSandboxEgressPermissionDeniedSignal as ra, setWorkspaceSnapshot as ri, retainRuntimeTurnContext as rn, readSlackAttachmentsVersion as ro, canAgentChangeReviewItem as rr, recordTurnSummary as rt, openConversationProjection as s, buildSandboxEgressNetworkPolicy as sa, isStale as si, SESSION_CONTEXT_SECTION_TAG as sn, createPluginAnnotations as so, requireReviewItemAssignees as sr, appendExclusiveInboundMessage as st, commitAcceptedReply as t, clearSandboxEgressSignals as ta, invalidateReadySnapshot as ti, isToolResultMessage as tn, matchSlackAttachments as to, PLUGIN_REVIEW_ITEM_KEY_PREFIX as tr, getTurnRecord as tt, recordAuthenticationLinked as u, SANDBOX_RUNTIME as ua, isVercelSandboxEgressRequest as ui, buildDeterministicTurnId as un, defaultTimezone as uo, reviewItemReaderForUser as ur, cancelHumanFacingPendingMessages as ut, hydrateConversationMessages as v, SANDBOX_DATA_ROOT as va, formatSlackLink as vi, getAgentBackgroundCompactionMarkTokens as vn, projectConversationEvents$1 as vo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as vr, getConversation as vt, fallbackShortTitle as w, sandboxSkillFile as wa, deleteSlackMessage as wi, createUserTokenStore as wn, createTimerWatch as wr, listActiveConversationIds as wt, persistConversationMessageSummaries as x, SANDBOX_SKILLS_ROOT as xa, slackMention as xi, getExperimentalFeatures as xn, getConfigDefaults as xo, cancelSubscriptions as xr, hasRunnableConversationWork as xt, persistConversationMessages as y, SANDBOX_JUNIOR_ROOT as ya, normalizeSlackReplyMarkdown as yi, getAgentContextCompactionTriggerTokens as yn, JUNIOR_NATIVE_EVENT_NAMESPACE as yo, RESOURCE_WATCH_TOOL_SOURCE as yr, getConversationWorkState as yt, createPluginAuthOrchestration as z, conversationPinnedForUser as za, getSlackClient as zi, validatePlugins as zn, getDashboardConversationLink as zr, buildTurnErrorResponse as zt };
|
|
14905
|
+
export { completeTurnRecord as $, loadForkHistory as $a, isWorkspaceSnapshotNotReadyError as $i, takeReviewItem as $n, updateWorkspace as $r, isStandaloneRuntimeContextMessage as $t, getConversationMessageSlackTs as A, createPluginLogger as Aa, removeReactionFromMessage as Ai, createPluginHookRunner as An, takeDueTimerWatches as Ar, requestAnotherSlice as At, authorizationId as B, conversationPinnedForUser as Ba, isConversationScopedChannel as Bi, coreTaskRegistrations as Bn, getDashboardObjectIconLink as Br, createTurnLimitGate as Bt, settleConversationTitleWork as C, sandboxSkillDir as Ca, addReactionToMessage as Ci, setExperimentalFeatures as Cn, setConfigDefaults as Co, collectEventMatchKeys as Cr, isInvalidConversationRecordError as Ct, buildConversationContext as D, buildNonInteractiveShellScript as Da, openSlackModal as Di, getOAuthAccountProviders as Dn, findMatchingWatches as Dr, recordConversationRetry as Dt, appendThreadContextMessages as E, buildCommandScript as Ea, openSlackDirectMessage as Ei, webActorUserIds as En, deliverWatch as Er, recordAttemptFailure as Et, turnHasReply as F, conversationArchivedForUser as Fa, SlackActionError as Fi, getPluginTools as Fn, verifyScheduledAutomationCredentialSubject as Fr, TURN_LIMIT_WRAP_UP_MESSAGE as Ft, canReusePendingAuthLink as G, readConversationBriefThrough as Ga, getWorkspaceTeamId as Gi, countReviewItemsNeedingUser as Gn, createPluginState as Gr, getPiMessageRole as Gt, AuthorizationFlowDisabledError as H, readConversationViewerMarks as Ha, normalizeSlackConversationId as Hi, setBriefsConfig as Hn, getDashboardTaskLink as Hr, CODEMODE_TOOL_NAME as Ht, upsertConversationMessage as I, conversationHasParticipantUser as Ia, downloadPrivateSlackFile as Ii, getPluginUserPromptContributions as In, verifySlackDirectCredentialSubject as Ir, TurnBudgetExceededError as It, wasPendingAuthStopped as J, readConversationEventPageAfter as Ja, isAlreadyExistsError as Ji, getReviewItem as Jn, deleteWorkspace as Jr, hasCurrentInstruction as Jt, clearPendingAuth as K, readLatestConversationBrief as Ka, runWithWorkspaceTeamId as Ki, dismissOpenReviewItems as Kn, renderToolResultNudge as Kr, getTerminalAssistantMessages as Kt, createPluginEgress as L, conversationIsMemberRoot as La, getFilePermalink as Li, getPlugins as Ln, verifyTimerWatchCredentialSubject as Lr, TurnSliceLimitExceededError as Lt, markConversationMessage as M, createConversationAccessReader as Ma, uploadFilesToConversation as Mi, getPluginRoutes as Mn, bindScheduledAutomationCredentialSubject as Mr, startConversationWork as Mt, normalizeConversationText as N, readConversationAccessFromSql as Na, slackEntitySchema as Ni, getPluginSlackConversationLink as Nn, bindSlackDirectCredentialSubject as Nr, steerWebPendingMessages as Nt, createConversationMemoryService as O, runNonInteractiveCommand as Oa, postSlackEphemeralMessage as Oi, resolvePluginOAuthAccount as On, getWatch as Or, releaseConversationWork as Ot, recordDeliveredAssistantMessage as P, conversationArchivedForEmail as Pa, slackExternalRefIdSchema as Pi, getPluginSystemPromptContributions as Pn, verifyEventAutomationCredentialSubject as Pr, stopConversationWork as Pt, abandonTurnRecord as Q, buildSentryConversationUrl as Qa, getWorkspaceSnapshotNotReadyError as Qi, searchReviewItems as Qn, listWorkspacesByRepository as Qr, isContinuablePiBoundary as Qt, PluginCredentialFailureError as R, conversationNotArchivedForEmail as Ra, getHeaderString as Ri, setPlugins as Rn, JUNIOR_THREAD_STATE_TTL_MS as Rr, TurnToolCallLimitExceededError as Rt, resolveConversationTitle as S, SANDBOX_WORKSPACE_ROOT as Sa, truncateStatusText as Si, isExperimentalFeatureEnabled as Sn, getConfigDefaults as So, cancelWatch as Sr, isFinalAttempt as St, resolveTaskTitle as T, sandboxSkillPathResolution as Ta, getSlackMessagePermalink as Ti, findLegacyWebActorUserId as Tn, createWatch as Tr, markConversationWorkEnqueued as Tt, AuthorizationPauseError as U, viewerConversationMembership as Ua, runWithSlackInstallationToken as Ui, REVIEW_ITEM_REPLIED_REASON as Un, setDashboardConversationLinkOptions as Ur, persistWithRetry as Ut, AuthPausePersistenceError as V, conversationViewerMarks as Va, isDmChannel as Vi, registration_exports as Vn, getDashboardReviewItemLink as Vr, isTurnExecutionLimitExceededError as Vt, abandonReplacedPendingAuth as W, createPluginConversationEvents as Wa, withSlackRetries as Wi, closeReviewItem as Wn, ToolInputError as Wr, extractAssistantText as Wt, loadTurnCheckpoint as X, readConversationLastEventSeq as Xa, wrapSandboxSetupError as Xi, listReplyActionItems as Xn, getWorkspaceByName as Xr, instructionTextForProjection as Xt, continuableMessages as Y, readConversationEventPageAround as Ya, throwSandboxOperationError as Yi, insertReviewItem as Yn, getWorkspace as Yr, hasRuntimeTurnContext as Yt, saveTurnCheckpoint as Z, readConversationMessageEventSeq as Za, WorkspaceSnapshotNotReadyError as Zi, listWaitingConversations as Zn, listWorkspaces as Zr, isAssistantMessage as Zt, appendConversationMessages as _, SANDBOX_COMMAND_PATH as _a, escapeSlackMrkdwnText as _i, estimateTextTokens as _n, historyItemFromPiMessage as _o, RESOURCE_SUBSCRIPTION_DEFAULT_TTL_MS as _r, drainConversationMailbox as _t, loadProjection as a, parseSandboxEgressCredentialToken as aa, create as ai, trimTrailingAssistantMessages as an, recordSlackAttachment as ao, isOnlyAssignee as ar, CONVERSATION_WORK_STALE_ENQUEUE_MS as at, projectConversationMessages as b, SANDBOX_REPOS_ROOT as ba, normalizeSlackStatusText as bi, getAgentContextInputLimitTokens as bn, JUNIOR_NATIVE_EVENT_NAMESPACE as bo, STOP_WATCHING_TOOL_NAME as br, hasConversationStop as bt, recordAgentsInstructionsUpdated as c, resolveSandboxCommandEnvironment as ca, ensureDockerDaemon as ci, TURN_CONTEXT_TAG as cn, createPluginAnnotations as co, requireReviewItemLinks as cr, appendInboundMessage as ct, recordAuthorizationCompleted as d, sleep$2 as da, proxyVercelSandboxEgressRequest as di, SubscribedReplyReason as dn, defaultTimezone as do, EVERYONE_ASSIGNEE as dr, checkInConversationWork as dt, workspaceSnapshotNotReadyUserMessage as ea, WorkspaceValidationError as ei, isToolResultError as en, notInheritedByForkChild as eo, updateReviewItemContent as er, failTurnRecord as et, recordAuthorizationRequested as f, tryWorkspaceRepoCheckoutPath as fa, deliverOAuthAuthorization as fi, decideSubscribedThreadReply as fn, resolveUserTimezone as fo, automationCreatorUserId as fr, clearConsumedConversationWake as ft, recordToolExecutionStarted as g, createPluginModel as ga, startOAuthFlow as gi, estimateRequestOverheadTokens as gn, configValueSchema as go, getSlackToolContext as gr, deadLetterAttempt as gt, recordSubscribedReplyRoute as h, createPluginEmbedder as ha, resolveBaseUrl as hi, calculateContextCompactionTargetTokens as hn, createDurableLocationConfigurationService as ho, resolveChannelCapabilities as hr, completeConversationWork as ht, loadConversationProjection as i, createSandboxEgressCredentialToken as ia, setWorkspaceSnapshotBuild as ii, stripRuntimeTurnContext as in, readSlackAttachmentsVersion as io, canReadReviewItem as ir, CONVERSATION_WORK_CHECK_IN_INTERVAL_MS as it, isHumanConversationMessage as j, canAccessConversation as ja, updateSlackMessage as ji, getPluginApiRoutes as jn, bindEventAutomationCredentialSubject as jr, requestConversationWork as jt, estimateConversationContextTokens as k, createPluginModelCostRecorder as ka, postSlackMessage as ki, agent_hooks_exports as kn, listWatches as kr, removeActiveConversation as kt, recordAttachmentsDelivered as l, normalizeSandboxEgressTracePropagationDomains as la, getSandboxProvider as li, buildDeterministicAssistantMessageId as ln, listConversationAnnotations as lo, reviewItemNeedsUser as lr, beginConversationResume as lt, recordMcpProviderConnected as m, PluginToolDeniedError as ma, parseOAuthStatePayload as mi, getThreadStopDecision as mn, createPluginCache as mo, resolveAssignees as mr, completeConversationStop as mt, commitMessages as n, consumeSandboxEgressAuthRequiredSignal as na, loadSnapshotsForProfile as ni, normalizeToolNameFromResult as nn, matchSlackAttachments as no, canActOnReviewItem as nr, listTurnSummaries as nt, loadTurnProjection as o, sandboxEgressSignalsResponseSchema as oa, hash as oi, REQUEST_CONTEXT_SECTION_TAG as on, resolveRootVisibility as oo, readReviewItemAgentScope as or, ackMessages as ot, recordGuardianActionReviewed as p, workspaceRepoCheckoutPath as pa, formatProviderLabel as pi, getSubscribedReplyPreflightDecision as pn, lookupSlackUser as po, resolveAssignee as pr, clearExpiredConversationLease as pt, getConversationPendingAuth as q, readConversationEventPage as qa, isAbortError as qi, getOpenReviewItemByDedupeKey as qn, createWorkspace as qr, getUserMessageInstructionText as qt, loadConnectedMcpProviders as r, consumeSandboxEgressPermissionDeniedSignal as ra, setWorkspaceSnapshot as ri, retainRuntimeTurnContext as rn, readAttachmentVisionSummary as ro, canAgentChangeReviewItem as rr, recordTurnSummary as rt, openConversationProjection as s, buildSandboxEgressNetworkPolicy as sa, isStale as si, SESSION_CONTEXT_SECTION_TAG as sn, saveObjectAnnotations as so, requireReviewItemAssignees as sr, appendExclusiveInboundMessage as st, commitAcceptedReply as t, clearSandboxEgressSignals as ta, invalidateReadySnapshot as ti, isToolResultMessage as tn, getSlackFileId as to, PLUGIN_REVIEW_ITEM_KEY_PREFIX as tr, getTurnRecord as tt, recordAuthenticationLinked as u, SANDBOX_RUNTIME as ua, isVercelSandboxEgressRequest as ui, buildDeterministicTurnId as un, listConversationAnnotationsById as uo, reviewItemReaderForUser as ur, cancelHumanFacingPendingMessages as ut, hydrateConversationMessages as v, SANDBOX_DATA_ROOT as va, formatSlackLink as vi, getAgentBackgroundCompactionMarkTokens as vn, piMessageFromHistoryItem as vo, RESOURCE_SUBSCRIPTION_MAX_TTL_MS as vr, getConversation as vt, fallbackShortTitle as w, sandboxSkillFile as wa, deleteSlackMessage as wi, createUserTokenStore as wn, createTimerWatch as wr, listActiveConversationIds as wt, persistConversationMessageSummaries as x, SANDBOX_SKILLS_ROOT as xa, slackMention as xi, getExperimentalFeatures as xn, conversationNoteEvent as xo, cancelSubscriptions as xr, hasRunnableConversationWork as xt, persistConversationMessages as y, SANDBOX_JUNIOR_ROOT as ya, normalizeSlackReplyMarkdown as yi, getAgentContextCompactionTriggerTokens as yn, projectConversationEvents$1 as yo, RESOURCE_WATCH_TOOL_SOURCE as yr, getConversationWorkState as yt, createPluginAuthOrchestration as z, conversationNotArchivedForUser as za, getSlackClient as zi, validatePlugins as zn, getDashboardConversationLink as zr, buildTurnErrorResponse as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-
|
|
1
|
+
import { b as setSpanAttributes, h as logWarn, m as logInfo } from "./logging-DapIaJAi.js";
|
|
2
2
|
import { o as isUserActor, s as parseActorUserId } from "./actor-6jsm_v96.js";
|
|
3
3
|
import { n as normalizePluginPackageNames, o as pluginRoots, t as discoverInstalledPluginPackageContent } from "./package-discovery-DJhGdS4c.js";
|
|
4
4
|
import path from "node:path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Oa as runNonInteractiveCommand, Sa as SANDBOX_WORKSPACE_ROOT, _a as SANDBOX_COMMAND_PATH, ai as create, da as sleep, li as getSandboxProvider, si as isStale } from "./projection-
|
|
2
|
-
import { E as withSpan, b as setSpanAttributes } from "./logging-
|
|
3
|
-
import { r as getStateAdapter } from "./adapter-
|
|
1
|
+
import { Oa as runNonInteractiveCommand, Sa as SANDBOX_WORKSPACE_ROOT, _a as SANDBOX_COMMAND_PATH, ai as create, da as sleep, li as getSandboxProvider, si as isStale } from "./projection-ii_OYu6z.js";
|
|
2
|
+
import { E as withSpan, b as setSpanAttributes } from "./logging-DapIaJAi.js";
|
|
3
|
+
import { r as getStateAdapter } from "./adapter-BAqo7eOH.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/chat/sandbox/resources.ts
|
|
6
6
|
let configuredResources;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { v as __exportAll } from "./sentry-BRTJqumy.js";
|
|
2
|
-
import { nt as listTurnSummaries, tt as getTurnRecord } from "./projection-
|
|
2
|
+
import { nt as listTurnSummaries, tt as getTurnRecord } from "./projection-ii_OYu6z.js";
|
|
3
3
|
import { t as createActor } from "./actor-6jsm_v96.js";
|
|
4
|
-
import { F as SYSTEM_IDENTITY_ID } from "./viewer-
|
|
5
|
-
import { f as credentialContextForActor } from "./registry-
|
|
6
|
-
import { wt as listUnreportedSiblingAgents } from "./agent-runner-
|
|
4
|
+
import { F as SYSTEM_IDENTITY_ID } from "./viewer-C2PztlYX.js";
|
|
5
|
+
import { f as credentialContextForActor } from "./registry-DpjG3yS-.js";
|
|
6
|
+
import { wt as listUnreportedSiblingAgents } from "./agent-runner-h4CDcnDV.js";
|
|
7
7
|
import { a as EVENT_SYSTEM_ACTOR, i as EVENT_MESSAGE_AUTHOR, o as isEventConversationMessage } from "./prompt-DI6KCtwb.js";
|
|
8
|
-
import { _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, d as getAgentInvocationIdForResult, l as getAgentInvocationIdForEvents, o as createAgentInvocationFromLatest, p as getAgentInvocationResultMessageId, u as getAgentInvocationIdForMessage, w as markAgentInvocationParentMailboxAppended, y as isTerminalAgentInvocation } from "./store-
|
|
9
|
-
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-
|
|
10
|
-
import { r as appendAndEnqueueInboundMessage } from "./store-
|
|
11
|
-
import { a as resolveAgentInvocationId, i as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-
|
|
8
|
+
import { _ as getLatestAgentInvocationForConversation, c as getAgentInvocation, d as getAgentInvocationIdForResult, l as getAgentInvocationIdForEvents, o as createAgentInvocationFromLatest, p as getAgentInvocationResultMessageId, u as getAgentInvocationIdForMessage, w as markAgentInvocationParentMailboxAppended, y as isTerminalAgentInvocation } from "./store-nETG4KVg.js";
|
|
9
|
+
import { a as EVENT_WAIT_MS, c as isEventMailboxMetadata, l as renderEventBatchText, u as timerWatchCredentialSubject } from "./session-stop-CVEEx_YD.js";
|
|
10
|
+
import { r as appendAndEnqueueInboundMessage } from "./store-nu3Xx08K.js";
|
|
11
|
+
import { a as resolveAgentInvocationId, i as enqueueAgentInvocation, t as createAgentInvocationWorker } from "./work-BM_L0Pv9.js";
|
|
12
12
|
import * as z from "zod";
|
|
13
13
|
import { createEventSource, createLocalSource, createWebSource } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/conversations/web-mailbox.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { B as authorizationId, D as buildConversationContext, I as upsertConversationMessage, M as markConversationMessage, N as normalizeConversationText, P as recordDeliveredAssistantMessage, Ut as persistWithRetry, Z as saveTurnCheckpoint, a as loadProjection, d as recordAuthorizationCompleted, t as commitAcceptedReply, v as hydrateConversationMessages, y as persistConversationMessages } from "./projection-
|
|
2
|
-
import { S as setTags, T as withLogContext, p as logException } from "./logging-
|
|
3
|
-
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-
|
|
4
|
-
import { f as credentialContextForActor } from "./registry-
|
|
1
|
+
import { B as authorizationId, D as buildConversationContext, I as upsertConversationMessage, M as markConversationMessage, N as normalizeConversationText, P as recordDeliveredAssistantMessage, Ut as persistWithRetry, Z as saveTurnCheckpoint, a as loadProjection, d as recordAuthorizationCompleted, t as commitAcceptedReply, v as hydrateConversationMessages, y as persistConversationMessages } from "./projection-ii_OYu6z.js";
|
|
2
|
+
import { S as setTags, T as withLogContext, p as logException } from "./logging-DapIaJAi.js";
|
|
3
|
+
import { F as SYSTEM_IDENTITY_ID, x as getConversationStore, y as getConversationEventStore } from "./viewer-C2PztlYX.js";
|
|
4
|
+
import { f as credentialContextForActor } from "./registry-DpjG3yS-.js";
|
|
5
5
|
import { j as messageCardText } from "./conversation-DNtcULyX.js";
|
|
6
|
-
import { $ as markTurnFailed, et as startActiveTurn } from "./store-
|
|
7
|
-
import { n as getAssistantReplyText } from "./assistant-reply-
|
|
8
|
-
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-
|
|
9
|
-
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-
|
|
10
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-
|
|
11
|
-
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response
|
|
6
|
+
import { $ as markTurnFailed, et as startActiveTurn } from "./store-nETG4KVg.js";
|
|
7
|
+
import { n as getAssistantReplyText } from "./assistant-reply-4Wvo95-N.js";
|
|
8
|
+
import { t as ConversationTurnLifecycleService } from "./turn-lifecycle-CF2N7ud5.js";
|
|
9
|
+
import { a as persistThreadStateById, n as getPersistedSandboxState, o as coerceThreadConversationState, r as getPersistedThreadState } from "./thread-state-BDaMl9yd.js";
|
|
10
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-CwegN45x.js";
|
|
11
|
+
import { i as completeAuthPauseTurn, l as buildDeliveredTurnStatePatch, t as finalizeFailedTurnReplyWithEvent, u as loadPendingMessageCards } from "./turn-failure-response-CV06tN_R.js";
|
|
12
12
|
import { randomUUID } from "node:crypto";
|
|
13
13
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
14
14
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { oa as sandboxEgressSignalsResponseSchema } from "./projection-
|
|
1
|
+
import { oa as sandboxEgressSignalsResponseSchema } from "./projection-ii_OYu6z.js";
|
|
2
2
|
// 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,6 +1,6 @@
|
|
|
1
|
-
import { n as pluginCatalogRuntime } from "./catalog-runtime-
|
|
2
|
-
import { t as disconnectStateAdapter } from "./adapter-
|
|
3
|
-
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-
|
|
1
|
+
import { n as pluginCatalogRuntime } from "./catalog-runtime-Cpje_Uic.js";
|
|
2
|
+
import { t as disconnectStateAdapter } from "./adapter-BAqo7eOH.js";
|
|
3
|
+
import { n as finishServiceAccountSignIn, o as serviceAccountPlugins, r as getServiceAccountStatus, s as startServiceAccountSignIn, t as disconnectServiceAccount } from "./service-account-Dfl9Pitm.js";
|
|
4
4
|
import { CLI_USAGE } from "./cli/run.js";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
// src/cli/service-account.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { W as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-
|
|
2
|
-
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-
|
|
1
|
+
import { W as isRecord, b as setSpanAttributes, h as logWarn } from "./logging-DapIaJAi.js";
|
|
2
|
+
import { c as fetchWithBoundedOAuthErrorBodies, i as resolvePluginHeaderEnvRefs } from "./registry-DpjG3yS-.js";
|
|
3
3
|
import { a as withLock, i as fenceLock, n as MUTATION_LOCK_TTL_MS } from "./locks-D-0h111u.js";
|
|
4
|
-
import { r as getStateAdapter } from "./adapter-
|
|
4
|
+
import { r as getStateAdapter } from "./adapter-BAqo7eOH.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
import { UnauthorizedError, auth } from "@modelcontextprotocol/sdk/client/auth.js";
|