@sentry/junior 0.180.0 → 0.181.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-DKDDRKZA.js → agent-hooks-KO56HJ74.js} +11 -11
- package/dist/api/schema/workspace.d.ts +2 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +32 -31
- package/dist/app.js +34 -34
- package/dist/{catalog-runtime-WXKGUF3W.js → catalog-runtime-CJTFLCK3.js} +4 -4
- package/dist/chat/plugins/agent-hooks.d.ts +1 -1
- package/dist/chat/services/turn-session-routing.d.ts +1 -0
- package/dist/chat/tools/types.d.ts +2 -0
- package/dist/chat/workspaces/types.d.ts +2 -0
- package/dist/{chunk-RAZG3YHC.js → chunk-2CZ63QCL.js} +1 -1
- package/dist/{chunk-L7LTGN4Z.js → chunk-4GOZBB22.js} +4 -4
- package/dist/{chunk-CCDXTDSY.js → chunk-4OSVTPYQ.js} +1 -1
- package/dist/{chunk-QSO7B5JO.js → chunk-4WYHL4EH.js} +1 -1
- package/dist/{chunk-2AYEVN7K.js → chunk-6TB7JN63.js} +3 -3
- package/dist/{chunk-2YIRH4E3.js → chunk-7UF37LNL.js} +1 -1
- package/dist/{chunk-MXEUIGHO.js → chunk-CJRUBOJI.js} +1 -1
- package/dist/{chunk-TKB25A3L.js → chunk-CZYNWPWD.js} +2 -1
- package/dist/{chunk-TC5DE5KJ.js → chunk-DINF4LMR.js} +7 -7
- package/dist/{chunk-GPXAHUQH.js → chunk-DTRCZOHE.js} +6 -6
- package/dist/{chunk-DRHEGXTZ.js → chunk-DXK3VTVP.js} +1 -1
- package/dist/{chunk-IANUX7HX.js → chunk-GITIZ6TZ.js} +1 -1
- package/dist/{chunk-GA5NS74S.js → chunk-H6MPFFBE.js} +1 -1
- package/dist/{chunk-CP73FKME.js → chunk-HG6HNOTQ.js} +13 -13
- package/dist/{chunk-EWHP2IRG.js → chunk-HPFHC7YR.js} +5 -5
- package/dist/{chunk-ZE2KOV3G.js → chunk-HRTW7FFX.js} +1 -1
- package/dist/{chunk-5PUMIMNQ.js → chunk-IWRPJ3J5.js} +53 -33
- package/dist/{chunk-KCL6AWYW.js → chunk-J4ID4ZI6.js} +19 -19
- package/dist/{chunk-VGPPWWHF.js → chunk-KH2SL2HT.js} +2 -2
- package/dist/{chunk-SDBKZ5LV.js → chunk-MR36BRPE.js} +4 -4
- package/dist/{chunk-U5EUCUBH.js → chunk-NRF23QZ4.js} +3 -3
- package/dist/{chunk-5TUR4M3M.js → chunk-PJ7EGFME.js} +5 -5
- package/dist/{chunk-WVAMRKYG.js → chunk-QA6RE6IB.js} +3 -3
- package/dist/{chunk-LGVQLNLS.js → chunk-RULGB5NX.js} +8 -8
- package/dist/{chunk-ZM7ZURJS.js → chunk-S5X2VQOD.js} +1 -1
- package/dist/{chunk-I6IFTAPF.js → chunk-S63LNPIV.js} +2 -2
- package/dist/{chunk-FGC3PHNH.js → chunk-ULM7P4EQ.js} +8 -1
- package/dist/{chunk-GUKXEPMX.js → chunk-VHSBLFNT.js} +1 -1
- package/dist/{chunk-DHLOGWYH.js → chunk-WDNA4LML.js} +19 -8
- package/dist/{chunk-3ILJBWP7.js → chunk-XL3C4NAR.js} +17 -12
- package/dist/{chunk-VG722ONZ.js → chunk-XQ56HNH5.js} +6 -6
- package/dist/{chunk-S7YRTOSQ.js → chunk-YCW6RZGX.js} +3 -3
- package/dist/{chunk-CK6EINVZ.js → chunk-YFJDRORU.js} +5 -5
- package/dist/{chunk-6YCEWOLO.js → chunk-Z2UG4FBT.js} +1 -1
- package/dist/{chunk-O4QYZTDK.js → chunk-ZQQWJMHE.js} +6 -6
- package/dist/cli/chat.js +32 -32
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/snapshots.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-6SBHIAJK.js → db-4PXTD3OH.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-WSDQPZZS.js → oauth-callback-server-TQWNEVR6.js} +25 -25
- package/dist/{runner-GWTSWESR.js → runner-G5HLQA43.js} +18 -18
- package/dist/{skills-F32BPFYW.js → skills-BNNNRYNT.js} +5 -5
- package/dist/spawn-U2RKOFP2.js +37 -0
- package/dist/task-runner-CDZJBEXP.js +32 -0
- package/dist/{validation-62WO524A.js → validation-IJSBB6JR.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-3C3CMZ24.js → work-5FQI4P2A.js} +18 -18
- package/dist/worker-KJ362GVB.js +22 -0
- package/migrations/0035_workspace_snapshot_size_bytes.sql +2 -0
- package/migrations/meta/0035_snapshot.json +3048 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +4 -4
- package/dist/spawn-X5BPP5OE.js +0 -37
- package/dist/task-runner-2FPBV5PP.js +0 -32
- package/dist/worker-MFAI6ZEK.js +0 -22
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DXK3VTVP.js";
|
|
4
4
|
import {
|
|
5
5
|
skillRoots
|
|
6
6
|
} from "./chunk-TXKUKMVO.js";
|
|
7
7
|
import {
|
|
8
8
|
logWarn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-2CZ63QCL.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/skills.ts
|
|
12
12
|
import fs from "fs/promises";
|
|
@@ -19,23 +19,23 @@ import {
|
|
|
19
19
|
releaseConversationWork,
|
|
20
20
|
requestAnotherSlice,
|
|
21
21
|
startConversationWork
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-4GOZBB22.js";
|
|
23
23
|
import {
|
|
24
24
|
ConversationQueueMessageRejectedError
|
|
25
25
|
} from "./chunk-JAL3CH4G.js";
|
|
26
26
|
import {
|
|
27
27
|
getTurnRequestDeadline
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-HRTW7FFX.js";
|
|
29
29
|
import {
|
|
30
30
|
getChatConfig,
|
|
31
31
|
isProviderRetryError
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-S63LNPIV.js";
|
|
33
33
|
import {
|
|
34
34
|
logException,
|
|
35
35
|
logInfo,
|
|
36
36
|
logWarn,
|
|
37
37
|
withLogContext
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-2CZ63QCL.js";
|
|
39
39
|
|
|
40
40
|
// src/chat/task-execution/worker.ts
|
|
41
41
|
var CONVERSATION_WORK_DEFER_DELAY_MS = 15e3;
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-7H2VZTWN.js";
|
|
7
7
|
import {
|
|
8
8
|
runWithTurnRequestDeadline
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-HRTW7FFX.js";
|
|
10
10
|
import {
|
|
11
11
|
logWarn
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2CZ63QCL.js";
|
|
13
13
|
|
|
14
14
|
// src/chat/plugins/task-queue.ts
|
|
15
15
|
import { createHash } from "crypto";
|
|
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
|
|
|
129
129
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
130
130
|
// Load the runner on first use so this module can send without a cycle.
|
|
131
131
|
run: async (message) => {
|
|
132
|
-
const { processPluginTask } = await import("./task-runner-
|
|
132
|
+
const { processPluginTask } = await import("./task-runner-CDZJBEXP.js");
|
|
133
133
|
await processPluginTask(message);
|
|
134
134
|
},
|
|
135
135
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
persistConversationMessages
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DTRCZOHE.js";
|
|
4
4
|
import {
|
|
5
5
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
6
6
|
} from "./chunk-3Y47VMHV.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YCW6RZGX.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorLocationConfigurations
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ULM7P4EQ.js";
|
|
13
13
|
import {
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-H6MPFFBE.js";
|
|
16
16
|
import {
|
|
17
17
|
juniorDestinations
|
|
18
18
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
isRecord,
|
|
21
21
|
toOptionalNumber,
|
|
22
22
|
toOptionalString
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-2CZ63QCL.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/state/conversation.ts
|
|
26
26
|
function defaultConversationState() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toOptionalTrimmed
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S63LNPIV.js";
|
|
4
4
|
import {
|
|
5
5
|
pluginCatalogRuntime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DXK3VTVP.js";
|
|
7
7
|
import {
|
|
8
8
|
setSpanAttributes,
|
|
9
9
|
setSpanStatus
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2CZ63QCL.js";
|
|
11
11
|
|
|
12
12
|
// src/chat/sandbox/paths.ts
|
|
13
13
|
function normalizeWorkspaceRoot(input) {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-RF6J3DIO.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZQQWJMHE.js";
|
|
7
7
|
import {
|
|
8
8
|
isExperimentalFeatureEnabled
|
|
9
9
|
} from "./chunk-VRS6WDK5.js";
|
|
@@ -12,27 +12,27 @@ import {
|
|
|
12
12
|
getPlugins,
|
|
13
13
|
getSlackClient,
|
|
14
14
|
withSlackRetries
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WDNA4LML.js";
|
|
16
16
|
import {
|
|
17
17
|
getDb,
|
|
18
18
|
parseDestination
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YCW6RZGX.js";
|
|
20
20
|
import {
|
|
21
21
|
sleep
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-QA6RE6IB.js";
|
|
23
23
|
import {
|
|
24
24
|
acquireActiveLock,
|
|
25
25
|
getStateAdapter
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-H6MPFFBE.js";
|
|
27
27
|
import {
|
|
28
28
|
pluginCatalogRuntime
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-DXK3VTVP.js";
|
|
30
30
|
import {
|
|
31
31
|
fetchWithBoundedOAuthErrorBodies
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-7UF37LNL.js";
|
|
33
33
|
import {
|
|
34
34
|
isRecord
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2CZ63QCL.js";
|
|
36
36
|
|
|
37
37
|
// src/chat/capabilities/router.ts
|
|
38
38
|
var ProviderCredentialRouter = class {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
toCanonicalInputMessage,
|
|
4
4
|
toCanonicalOutputMessage,
|
|
5
5
|
toGenAiMessagesTraceAttributes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Z2UG4FBT.js";
|
|
7
7
|
import {
|
|
8
8
|
extractGenAiUsageAttributes,
|
|
9
9
|
logException,
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
normalizeGenAiFinishReason,
|
|
12
12
|
serializeGenAiAttribute,
|
|
13
13
|
withSpan
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2CZ63QCL.js";
|
|
15
15
|
|
|
16
16
|
// src/chat/services/provider-error.ts
|
|
17
17
|
var ProviderError = class extends Error {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-VFUK3X5B.js";
|
|
5
5
|
import {
|
|
6
6
|
DEFAULT_SQL_STATEMENT_TIMEOUT_MS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-S63LNPIV.js";
|
|
8
8
|
|
|
9
9
|
// src/db/neon.ts
|
|
10
10
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -655,6 +655,7 @@ var juniorSchedulerRuns = pgTable16(
|
|
|
655
655
|
// src/db/schema/snapshots.ts
|
|
656
656
|
import { sql as sql6 } from "drizzle-orm";
|
|
657
657
|
import {
|
|
658
|
+
bigint as bigint4,
|
|
658
659
|
check as check2,
|
|
659
660
|
index as index13,
|
|
660
661
|
integer as integer6,
|
|
@@ -699,6 +700,8 @@ var juniorSnapshots = pgTable18(
|
|
|
699
700
|
// Ready artifact facts.
|
|
700
701
|
snapshotId: text18("snapshot_id"),
|
|
701
702
|
buildDurationMs: integer6("build_duration_ms"),
|
|
703
|
+
// Provider snapshot size when the capture response includes it.
|
|
704
|
+
sizeBytes: bigint4("size_bytes", { mode: "number" }),
|
|
702
705
|
generatedAt: timestamptz("generated_at"),
|
|
703
706
|
// Builder references for check-in and snapshot-owner cleanup.
|
|
704
707
|
buildStartedAt: timestamptz("build_started_at"),
|
|
@@ -730,6 +733,10 @@ var juniorSnapshots = pgTable18(
|
|
|
730
733
|
"junior_snapshots_build_duration_check",
|
|
731
734
|
sql6`${table.buildDurationMs} is null or ${table.buildDurationMs} >= 0`
|
|
732
735
|
),
|
|
736
|
+
check2(
|
|
737
|
+
"junior_snapshots_size_bytes_check",
|
|
738
|
+
sql6`${table.sizeBytes} is null or ${table.sizeBytes} >= 0`
|
|
739
|
+
),
|
|
733
740
|
// Provider snapshot ids are unique. Nulls stay allowed for in-flight rows.
|
|
734
741
|
uniqueIndex8("junior_snapshots_snapshot_id_uidx").on(table.snapshotId),
|
|
735
742
|
index13("junior_snapshots_workspace_idx").on(table.workspaceId),
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getConversationEventStore,
|
|
6
6
|
getDb,
|
|
7
7
|
getSqlExecutor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YCW6RZGX.js";
|
|
9
9
|
import {
|
|
10
10
|
juniorConversationAnnotations,
|
|
11
11
|
juniorConversationEvents,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
juniorUsers,
|
|
15
15
|
juniorWorkspaceRepos,
|
|
16
16
|
juniorWorkspaces
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ULM7P4EQ.js";
|
|
18
18
|
import {
|
|
19
19
|
SANDBOX_WORKSPACE_ROOT,
|
|
20
20
|
getVercelSandboxCredentials,
|
|
@@ -22,17 +22,17 @@ import {
|
|
|
22
22
|
isSandboxMissingError,
|
|
23
23
|
runNonInteractiveCommand,
|
|
24
24
|
sleep
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QA6RE6IB.js";
|
|
26
26
|
import {
|
|
27
27
|
getStateAdapter
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-H6MPFFBE.js";
|
|
29
29
|
import {
|
|
30
30
|
botConfig,
|
|
31
31
|
completeObject,
|
|
32
32
|
defaultModelId,
|
|
33
33
|
embedTexts,
|
|
34
34
|
getSlackBotToken
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-S63LNPIV.js";
|
|
36
36
|
import {
|
|
37
37
|
isActorUserId,
|
|
38
38
|
parseActorUserId,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
setSpanAttributes,
|
|
49
49
|
setSpanStatus,
|
|
50
50
|
withSpan
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-2CZ63QCL.js";
|
|
52
52
|
|
|
53
53
|
// src/chat/plugins/agent-hooks.ts
|
|
54
54
|
import {
|
|
@@ -1733,6 +1733,7 @@ function snapshotFromRow(row) {
|
|
|
1733
1733
|
id: row.snapshotId,
|
|
1734
1734
|
generatedAt: row.generatedAt,
|
|
1735
1735
|
buildDurationMs: row.buildDurationMs,
|
|
1736
|
+
sizeBytes: row.sizeBytes,
|
|
1736
1737
|
profileHash: row.profileHash
|
|
1737
1738
|
};
|
|
1738
1739
|
}
|
|
@@ -1799,6 +1800,7 @@ async function setWorkspaceSnapshot(workspaceId, snapshot, options) {
|
|
|
1799
1800
|
status: "ready",
|
|
1800
1801
|
snapshotId: snapshot.id,
|
|
1801
1802
|
buildDurationMs: snapshot.buildDurationMs,
|
|
1803
|
+
sizeBytes: snapshot.sizeBytes,
|
|
1802
1804
|
generatedAt: snapshot.generatedAt,
|
|
1803
1805
|
buildStartedAt: null,
|
|
1804
1806
|
buildPhase: null,
|
|
@@ -1877,6 +1879,7 @@ async function setWorkspaceSnapshotBuild(workspaceId, build, options = {}) {
|
|
|
1877
1879
|
status: build.status,
|
|
1878
1880
|
snapshotId: null,
|
|
1879
1881
|
buildDurationMs: null,
|
|
1882
|
+
sizeBytes: null,
|
|
1880
1883
|
generatedAt: null,
|
|
1881
1884
|
buildStartedAt: build.startedAt,
|
|
1882
1885
|
buildPhase: build.phase,
|
|
@@ -2221,7 +2224,10 @@ function systemPromptPluginContext(plugin) {
|
|
|
2221
2224
|
};
|
|
2222
2225
|
}
|
|
2223
2226
|
function pluginInvocationContext(context) {
|
|
2224
|
-
const common = {
|
|
2227
|
+
const common = {
|
|
2228
|
+
conversationId: context.conversationId,
|
|
2229
|
+
locationId: context.locationId
|
|
2230
|
+
};
|
|
2225
2231
|
switch (context.source.platform) {
|
|
2226
2232
|
case "slack": {
|
|
2227
2233
|
if (context.destination.platform !== "slack") {
|
|
@@ -2259,6 +2265,7 @@ function invocationPluginContext(plugin, context, turnId) {
|
|
|
2259
2265
|
const common = {
|
|
2260
2266
|
...base,
|
|
2261
2267
|
conversationId: context.conversationId,
|
|
2268
|
+
locationId: context.locationId,
|
|
2262
2269
|
embedder: createPluginEmbedder(plugin.manifest.name),
|
|
2263
2270
|
...context.conversationId && turnId ? {
|
|
2264
2271
|
events: createPluginConversationEvents({
|
|
@@ -2271,7 +2278,10 @@ function invocationPluginContext(plugin, context, turnId) {
|
|
|
2271
2278
|
model: createPluginModel(plugin.manifest.name, plugin.model),
|
|
2272
2279
|
source: context.source,
|
|
2273
2280
|
text: context.userText ?? "",
|
|
2274
|
-
state: createPluginState(plugin.manifest.name)
|
|
2281
|
+
state: createPluginState(plugin.manifest.name),
|
|
2282
|
+
users: {
|
|
2283
|
+
resolveActor: context.resolveActorIdentity ?? (async () => void 0)
|
|
2284
|
+
}
|
|
2275
2285
|
};
|
|
2276
2286
|
return {
|
|
2277
2287
|
...common,
|
|
@@ -2621,6 +2631,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
2621
2631
|
...basePluginContext(plugin),
|
|
2622
2632
|
...annotations ? { annotations } : void 0,
|
|
2623
2633
|
conversationId: context.conversationId,
|
|
2634
|
+
locationId: context.locationId,
|
|
2624
2635
|
userText: context.userText,
|
|
2625
2636
|
embedder: createPluginEmbedder(pluginName),
|
|
2626
2637
|
egress: context.egress,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
coerceThreadConversationState,
|
|
3
3
|
getPersistedThreadState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PJ7EGFME.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginTaskId,
|
|
7
7
|
pluginTaskParamsSchema,
|
|
8
8
|
sendVercelPluginTask
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NRF23QZ4.js";
|
|
10
10
|
import {
|
|
11
11
|
getPiMessageRole,
|
|
12
12
|
getTurnRecord,
|
|
@@ -16,15 +16,16 @@ import {
|
|
|
16
16
|
isToolResultMessage,
|
|
17
17
|
normalizeToolNameFromResult,
|
|
18
18
|
stripRuntimeTurnContext
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-DTRCZOHE.js";
|
|
20
20
|
import {
|
|
21
21
|
createPluginConversationEvents,
|
|
22
22
|
createPluginEmbedder,
|
|
23
23
|
createPluginLogger,
|
|
24
24
|
createPluginModel,
|
|
25
25
|
createPluginState,
|
|
26
|
-
getPlugins
|
|
27
|
-
|
|
26
|
+
getPlugins,
|
|
27
|
+
readActorIdentity
|
|
28
|
+
} from "./chunk-WDNA4LML.js";
|
|
28
29
|
import {
|
|
29
30
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
30
31
|
} from "./chunk-3Y47VMHV.js";
|
|
@@ -32,14 +33,14 @@ import {
|
|
|
32
33
|
getConversationStore,
|
|
33
34
|
getDb,
|
|
34
35
|
sameActorIdentity
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-YCW6RZGX.js";
|
|
36
37
|
import {
|
|
37
38
|
juniorConversations,
|
|
38
39
|
juniorTaskExecutions
|
|
39
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-ULM7P4EQ.js";
|
|
40
41
|
import {
|
|
41
42
|
getStateAdapter
|
|
42
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-H6MPFFBE.js";
|
|
43
44
|
import {
|
|
44
45
|
credentialSubjectSchema
|
|
45
46
|
} from "./chunk-CEMMLV5L.js";
|
|
@@ -48,14 +49,14 @@ import {
|
|
|
48
49
|
} from "./chunk-N7TMSOZH.js";
|
|
49
50
|
import {
|
|
50
51
|
logWarn
|
|
51
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-2CZ63QCL.js";
|
|
52
53
|
|
|
53
54
|
// src/chat/plugins/task-runner.ts
|
|
54
55
|
import { pluginRunContextSchema } from "@sentry/junior-plugin-api";
|
|
55
56
|
|
|
56
57
|
// src/chat/services/turn-session-routing.ts
|
|
57
58
|
async function resolveTurnSessionRouting(args) {
|
|
58
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
59
|
+
const conversationStore = args.conversationStore ?? (await import("./db-4PXTD3OH.js")).getConversationStore();
|
|
59
60
|
const conversation = await conversationStore.get({
|
|
60
61
|
conversationId: args.conversationId
|
|
61
62
|
});
|
|
@@ -66,6 +67,7 @@ async function resolveTurnSessionRouting(args) {
|
|
|
66
67
|
}
|
|
67
68
|
return {
|
|
68
69
|
destination: conversation.destination,
|
|
70
|
+
...conversation.location ? { locationId: conversation.location.id } : void 0,
|
|
69
71
|
source: conversation.sessionSource
|
|
70
72
|
};
|
|
71
73
|
}
|
|
@@ -887,6 +889,7 @@ async function loadPluginRun(params) {
|
|
|
887
889
|
conversationId: params.conversationId
|
|
888
890
|
});
|
|
889
891
|
const runActor = record.actors[0] ?? (record.dispatchId ? (await getDispatchRecord(record.dispatchId))?.actor : void 0);
|
|
892
|
+
const actorUser = runActor ? (await readActorIdentity(runActor))?.user : void 0;
|
|
890
893
|
const runEntries = turnMessagesWithProvenance(record).map(
|
|
891
894
|
({ message, provenance }) => runTranscriptEntry(message, provenance, runActor)
|
|
892
895
|
).filter((entry) => Boolean(entry));
|
|
@@ -901,11 +904,13 @@ async function loadPluginRun(params) {
|
|
|
901
904
|
(entry) => entry.type !== "message" || !runMessageTexts.has(entry.text)
|
|
902
905
|
);
|
|
903
906
|
return pluginRunContextSchema.parse({
|
|
907
|
+
...actorUser ? { actorUserId: actorUser.id } : void 0,
|
|
904
908
|
completedAtMs: record.updatedAtMs,
|
|
905
909
|
conversationId: record.conversationId,
|
|
906
910
|
destination: routing.destination,
|
|
907
|
-
|
|
908
|
-
//
|
|
911
|
+
...routing.locationId ? { locationId: routing.locationId } : void 0,
|
|
912
|
+
// Read Actors from the full run record, not the shorter transcript.
|
|
913
|
+
// This includes every Actor that supplied an instruction.
|
|
909
914
|
actors: record.actors,
|
|
910
915
|
...runActor ? { actor: runActor } : void 0,
|
|
911
916
|
runId: record.turnId,
|
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
formatProviderLabel,
|
|
9
9
|
startOAuthFlow
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZQQWJMHE.js";
|
|
11
11
|
import {
|
|
12
12
|
abandonReplacedPendingAuth,
|
|
13
13
|
canReusePendingAuthLink
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VHSBLFNT.js";
|
|
15
15
|
import {
|
|
16
16
|
recordAuthorizationRequested
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DTRCZOHE.js";
|
|
18
18
|
import {
|
|
19
19
|
AGENT_INVOCATION_MAILBOX_STATUSES
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ULM7P4EQ.js";
|
|
21
21
|
import {
|
|
22
22
|
TURN_REASONING_LEVELS
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-S63LNPIV.js";
|
|
24
24
|
import {
|
|
25
25
|
pluginCatalogRuntime
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DXK3VTVP.js";
|
|
27
27
|
import {
|
|
28
28
|
credentialContextSchema
|
|
29
29
|
} from "./chunk-CEMMLV5L.js";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
juniorConversations,
|
|
9
9
|
juniorIdentities,
|
|
10
10
|
juniorUsers
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ULM7P4EQ.js";
|
|
12
12
|
import {
|
|
13
13
|
juniorDestinations
|
|
14
14
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
TURN_REASONING_LEVELS,
|
|
17
17
|
getChatConfig,
|
|
18
18
|
modelProfileSchema
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-S63LNPIV.js";
|
|
20
20
|
import {
|
|
21
21
|
parseActorUserId,
|
|
22
22
|
parseSlackChannelReferenceId,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-N7TMSOZH.js";
|
|
25
25
|
import {
|
|
26
26
|
normalizeIdentityEmail
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2CZ63QCL.js";
|
|
28
28
|
|
|
29
29
|
// src/chat/conversations/sql/store.ts
|
|
30
30
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
ToolInputError,
|
|
3
3
|
canRouteResourceEvents,
|
|
4
4
|
getPlugins
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WDNA4LML.js";
|
|
6
6
|
import {
|
|
7
7
|
getDb
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YCW6RZGX.js";
|
|
9
9
|
import {
|
|
10
10
|
juniorAttachments,
|
|
11
11
|
juniorConversations,
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
juniorSchedulerRuns,
|
|
14
14
|
juniorSchedulerTasks,
|
|
15
15
|
juniorStats
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ULM7P4EQ.js";
|
|
17
17
|
import {
|
|
18
18
|
juniorDestinations
|
|
19
19
|
} from "./chunk-VFUK3X5B.js";
|
|
20
20
|
import {
|
|
21
21
|
getSlackBotToken
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-S63LNPIV.js";
|
|
23
23
|
import {
|
|
24
24
|
logWarn
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-2CZ63QCL.js";
|
|
26
26
|
|
|
27
27
|
// src/chat/resource-events/catalog.ts
|
|
28
28
|
import {
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId,
|
|
7
7
|
withSlackRetries
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WDNA4LML.js";
|
|
9
9
|
import {
|
|
10
10
|
parseDestination
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YCW6RZGX.js";
|
|
12
12
|
import {
|
|
13
13
|
getStateAdapter
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H6MPFFBE.js";
|
|
15
15
|
import {
|
|
16
16
|
normalizeSlackEmojiName
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-S63LNPIV.js";
|
|
18
18
|
import {
|
|
19
19
|
pluginCatalogRuntime
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DXK3VTVP.js";
|
|
21
21
|
import {
|
|
22
22
|
parseSlackMessageTs,
|
|
23
23
|
parseSlackUserId
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
isRecord,
|
|
27
27
|
logInfo,
|
|
28
28
|
logWarn
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-2CZ63QCL.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/slack/outbound.ts
|
|
32
32
|
var MAX_SLACK_MESSAGE_TEXT_CHARS = 4e4;
|