@sentry/junior 0.83.0 → 0.84.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-EEWWWIS2.js → agent-hooks-TFPY6V3T.js} +7 -7
- package/dist/app.js +58 -17
- package/dist/{catalog-runtime-IVWRAPSI.js → catalog-runtime-XOD7YPRS.js} +2 -2
- package/dist/chat/config.d.ts +1 -1
- package/dist/chat/requester.d.ts +1 -1
- package/dist/chat/slack/client.d.ts +1 -1
- package/dist/chat/state/session-log.d.ts +4 -0
- package/dist/chat/task-execution/state.d.ts +1 -1
- package/dist/{chunk-FAGWUF44.js → chunk-2TAIGJPQ.js} +1 -1
- package/dist/{chunk-WCXVEQPI.js → chunk-64ACM6AP.js} +1 -1
- package/dist/{chunk-5C3RY6IZ.js → chunk-AL6ZFV7U.js} +5 -5
- package/dist/{chunk-ABRNFE3N.js → chunk-ALL7GG6U.js} +7 -6
- package/dist/{chunk-KZLRUQAA.js → chunk-BAPRSWNW.js} +4 -1
- package/dist/{chunk-TW23AT22.js → chunk-BQ3ITJA6.js} +1 -1
- package/dist/{chunk-GUO4EE7L.js → chunk-CWMMGUWM.js} +1 -1
- package/dist/{chunk-ORRLK22J.js → chunk-FPN7NYTE.js} +4 -4
- package/dist/{chunk-ZPCGQRFJ.js → chunk-IXTBFABZ.js} +4 -5
- package/dist/{chunk-GK5CITCY.js → chunk-JK7376UT.js} +12 -6
- package/dist/{chunk-3JKTVW4R.js → chunk-LSG6PQF4.js} +3 -3
- package/dist/{chunk-X2FL5ZH5.js → chunk-MJ4E2PK7.js} +1 -1
- package/dist/{chunk-QVMLDCVR.js → chunk-QWKB6NJV.js} +3 -11
- package/dist/{chunk-AK7T7XRQ.js → chunk-SBYMRDH7.js} +1 -1
- package/dist/{chunk-BFQ7IUTE.js → chunk-SVFA43LT.js} +3 -3
- package/dist/{chunk-LK53AHO5.js → chunk-T2YRJZ5A.js} +20 -13
- package/dist/cli/chat.js +6 -6
- package/dist/cli/check.js +3 -3
- package/dist/cli/plugins.js +9 -9
- package/dist/cli/snapshot-warmup.js +5 -5
- package/dist/cli/upgrade.js +18 -34
- package/dist/{db-TRIVS6BW.js → db-ELRCNB4A.js} +4 -4
- package/dist/nitro.js +3 -3
- package/dist/reporting/conversations.d.ts +77 -0
- package/dist/reporting.d.ts +10 -2
- package/dist/reporting.js +423 -13
- package/dist/{runner-KS4XDMHF.js → runner-2XU6QQND.js} +12 -12
- package/dist/{validation-TN6HMZAD.js → validation-MBNJKWPQ.js} +3 -3
- package/package.json +6 -6
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
getPlugins,
|
|
12
12
|
setPlugins,
|
|
13
13
|
validatePlugins
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-AL6ZFV7U.js";
|
|
15
|
+
import "./chunk-CWMMGUWM.js";
|
|
16
|
+
import "./chunk-QWKB6NJV.js";
|
|
17
17
|
import "./chunk-G3E7SCME.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-MJ4E2PK7.js";
|
|
19
|
+
import "./chunk-BAPRSWNW.js";
|
|
20
|
+
import "./chunk-ALL7GG6U.js";
|
|
21
21
|
import "./chunk-DR75T7J3.js";
|
|
22
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-IXTBFABZ.js";
|
|
23
23
|
import "./chunk-KF7522P3.js";
|
|
24
24
|
import "./chunk-FTMXFBDC.js";
|
|
25
25
|
import "./chunk-3DA7X2U3.js";
|
package/dist/app.js
CHANGED
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
updateConversationStats,
|
|
69
69
|
uploadFilesToThread,
|
|
70
70
|
upsertConversationMessage
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-T2YRJZ5A.js";
|
|
72
72
|
import {
|
|
73
73
|
CONVERSATION_WORK_CHECK_IN_INTERVAL_MS,
|
|
74
74
|
CONVERSATION_WORK_STALE_ENQUEUE_MS,
|
|
@@ -88,17 +88,17 @@ import {
|
|
|
88
88
|
requestConversationContinuation,
|
|
89
89
|
requestConversationWork,
|
|
90
90
|
startConversationWork
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-FPN7NYTE.js";
|
|
92
92
|
import {
|
|
93
93
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
94
94
|
coerceThreadConversationState
|
|
95
95
|
} from "./chunk-66NX7MNW.js";
|
|
96
|
-
import "./chunk-
|
|
96
|
+
import "./chunk-LSG6PQF4.js";
|
|
97
97
|
import {
|
|
98
98
|
getVercelConversationWorkQueue,
|
|
99
99
|
resolveConversationWorkQueueTopic,
|
|
100
100
|
verifyConversationQueueMessage
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-SBYMRDH7.js";
|
|
102
102
|
import {
|
|
103
103
|
PLUGIN_TASK_QUEUE_TOPIC,
|
|
104
104
|
createVercelQueueClient,
|
|
@@ -111,7 +111,7 @@ import {
|
|
|
111
111
|
resolveSlackChannelTypeFromMessage,
|
|
112
112
|
resolveSlackConversationContext,
|
|
113
113
|
setConversationTitle
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-SVFA43LT.js";
|
|
115
115
|
import {
|
|
116
116
|
abandonAgentTurnSessionRecord,
|
|
117
117
|
buildSlackOutputMessage,
|
|
@@ -127,11 +127,11 @@ import {
|
|
|
127
127
|
recordAuthorizationCompleted,
|
|
128
128
|
splitSlackReplyText,
|
|
129
129
|
truncateStatusText
|
|
130
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-JK7376UT.js";
|
|
131
131
|
import {
|
|
132
132
|
validatePluginEgressCredentialHooks,
|
|
133
133
|
validatePluginRegistrations
|
|
134
|
-
} from "./chunk-
|
|
134
|
+
} from "./chunk-2TAIGJPQ.js";
|
|
135
135
|
import {
|
|
136
136
|
defineJuniorPlugins,
|
|
137
137
|
pluginCatalogConfigFromEnv,
|
|
@@ -147,21 +147,22 @@ import {
|
|
|
147
147
|
setPlugins,
|
|
148
148
|
validatePlugins,
|
|
149
149
|
verifySlackDirectCredentialSubject
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-AL6ZFV7U.js";
|
|
151
151
|
import {
|
|
152
152
|
createPluginLogger,
|
|
153
153
|
createPluginState
|
|
154
|
-
} from "./chunk-
|
|
154
|
+
} from "./chunk-CWMMGUWM.js";
|
|
155
155
|
import {
|
|
156
156
|
getConversationStore,
|
|
157
157
|
getDb
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-QWKB6NJV.js";
|
|
159
159
|
import "./chunk-G3E7SCME.js";
|
|
160
160
|
import {
|
|
161
161
|
acquireActiveLock,
|
|
162
162
|
getStateAdapter
|
|
163
|
-
} from "./chunk-
|
|
163
|
+
} from "./chunk-MJ4E2PK7.js";
|
|
164
164
|
import {
|
|
165
|
+
SlackActionError,
|
|
165
166
|
createSlackDestination,
|
|
166
167
|
destinationKey,
|
|
167
168
|
downloadPrivateSlackFile,
|
|
@@ -172,7 +173,7 @@ import {
|
|
|
172
173
|
parseDestination,
|
|
173
174
|
requireSlackDestination,
|
|
174
175
|
sameDestination
|
|
175
|
-
} from "./chunk-
|
|
176
|
+
} from "./chunk-BAPRSWNW.js";
|
|
176
177
|
import {
|
|
177
178
|
FUNCTION_TIMEOUT_BUFFER_SECONDS,
|
|
178
179
|
GEN_AI_PROVIDER_NAME,
|
|
@@ -191,7 +192,7 @@ import {
|
|
|
191
192
|
setSlackReactionConfig,
|
|
192
193
|
stripRuntimeTurnContext,
|
|
193
194
|
trimTrailingAssistantMessages
|
|
194
|
-
} from "./chunk-
|
|
195
|
+
} from "./chunk-ALL7GG6U.js";
|
|
195
196
|
import {
|
|
196
197
|
parseSlackThreadId,
|
|
197
198
|
resolveSlackChannelIdFromMessage,
|
|
@@ -199,13 +200,13 @@ import {
|
|
|
199
200
|
} from "./chunk-DR75T7J3.js";
|
|
200
201
|
import {
|
|
201
202
|
discoverSkills
|
|
202
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-64ACM6AP.js";
|
|
203
204
|
import {
|
|
204
205
|
buildOAuthTokenRequest,
|
|
205
206
|
hasRequiredOAuthScope,
|
|
206
207
|
parseOAuthTokenResponse,
|
|
207
208
|
pluginCatalogRuntime
|
|
208
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-BQ3ITJA6.js";
|
|
209
210
|
import {
|
|
210
211
|
createRequester,
|
|
211
212
|
createSlackRequester,
|
|
@@ -213,7 +214,7 @@ import {
|
|
|
213
214
|
isActorUserId,
|
|
214
215
|
parseActorUserId,
|
|
215
216
|
toStoredSlackRequester
|
|
216
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-IXTBFABZ.js";
|
|
217
218
|
import {
|
|
218
219
|
homeDir
|
|
219
220
|
} from "./chunk-6APU57E6.js";
|
|
@@ -7667,6 +7668,21 @@ function createSlackTurnRuntime(deps) {
|
|
|
7667
7668
|
if (error instanceof AuthorizationFlowDisabledError) {
|
|
7668
7669
|
return;
|
|
7669
7670
|
}
|
|
7671
|
+
if (error instanceof SlackActionError && error.code === "read_only_channel") {
|
|
7672
|
+
deps.logWarn(
|
|
7673
|
+
"mention_handler_read_only_channel",
|
|
7674
|
+
logContext({
|
|
7675
|
+
threadId: deps.getThreadId(thread, message),
|
|
7676
|
+
requesterId: message.author.userId,
|
|
7677
|
+
requesterUserName: requesterUserName(message),
|
|
7678
|
+
channelId: deps.getChannelId(thread, message),
|
|
7679
|
+
runId: deps.getRunId(thread, message)
|
|
7680
|
+
}),
|
|
7681
|
+
{},
|
|
7682
|
+
"Skipping reply to read-only channel"
|
|
7683
|
+
);
|
|
7684
|
+
return;
|
|
7685
|
+
}
|
|
7670
7686
|
const eventId = deps.logException(
|
|
7671
7687
|
error,
|
|
7672
7688
|
"mention_handler_failed",
|
|
@@ -7917,6 +7933,21 @@ function createSlackTurnRuntime(deps) {
|
|
|
7917
7933
|
if (error instanceof AuthorizationFlowDisabledError) {
|
|
7918
7934
|
return;
|
|
7919
7935
|
}
|
|
7936
|
+
if (error instanceof SlackActionError && error.code === "read_only_channel") {
|
|
7937
|
+
deps.logWarn(
|
|
7938
|
+
"subscribed_message_handler_read_only_channel",
|
|
7939
|
+
logContext({
|
|
7940
|
+
threadId: deps.getThreadId(thread, message),
|
|
7941
|
+
requesterId: message.author.userId,
|
|
7942
|
+
requesterUserName: requesterUserName(message),
|
|
7943
|
+
channelId: deps.getChannelId(thread, message),
|
|
7944
|
+
runId: deps.getRunId(thread, message)
|
|
7945
|
+
}),
|
|
7946
|
+
{},
|
|
7947
|
+
"Skipping reply to read-only channel"
|
|
7948
|
+
);
|
|
7949
|
+
return;
|
|
7950
|
+
}
|
|
7920
7951
|
const eventId = deps.logException(
|
|
7921
7952
|
error,
|
|
7922
7953
|
"subscribed_message_handler_failed",
|
|
@@ -10969,7 +11000,15 @@ function normalizeDashboardPath2(path2, fallback) {
|
|
|
10969
11000
|
function dashboardHostRoutePaths(dashboard) {
|
|
10970
11001
|
const basePath = normalizeDashboardPath2(dashboard.basePath, "/");
|
|
10971
11002
|
const authPath = normalizeDashboardPath2(dashboard.authPath, "/api/auth");
|
|
10972
|
-
const pagePaths = basePath === "/" ? [
|
|
11003
|
+
const pagePaths = basePath === "/" ? [
|
|
11004
|
+
"/",
|
|
11005
|
+
"/conversations",
|
|
11006
|
+
"/conversations/*",
|
|
11007
|
+
"/people",
|
|
11008
|
+
"/people/*",
|
|
11009
|
+
"/plugins",
|
|
11010
|
+
"/plugins/*"
|
|
11011
|
+
] : [basePath, `${basePath}/*`];
|
|
10973
11012
|
const loginPath = basePath === "/" ? "/auth/login" : `${basePath}/auth/login`;
|
|
10974
11013
|
return [
|
|
10975
11014
|
...pagePaths,
|
|
@@ -10984,6 +11023,8 @@ function dashboardHostRoutePaths(dashboard) {
|
|
|
10984
11023
|
"/api/skills",
|
|
10985
11024
|
"/api/conversations",
|
|
10986
11025
|
"/api/conversations/*",
|
|
11026
|
+
"/api/people",
|
|
11027
|
+
"/api/people/*",
|
|
10987
11028
|
"/api/config",
|
|
10988
11029
|
"/api/me",
|
|
10989
11030
|
authPath,
|
package/dist/chat/config.d.ts
CHANGED
package/dist/chat/requester.d.ts
CHANGED
|
@@ -59,7 +59,7 @@ export declare function createSlackRequester(teamId: string, userId: string, pro
|
|
|
59
59
|
export declare function parseStoredSlackRequester(value: unknown): StoredSlackRequester | undefined;
|
|
60
60
|
/** Convert a runtime Slack requester into its durable session shape. */
|
|
61
61
|
export declare function toStoredSlackRequester(requester: SlackRequester): StoredSlackRequester;
|
|
62
|
-
/** Resolve a Slack resume requester from stored
|
|
62
|
+
/** Resolve a Slack resume requester from stored profile data and the active actor. */
|
|
63
63
|
export declare function createSlackResumeRequester(args: {
|
|
64
64
|
requester?: Requester;
|
|
65
65
|
teamId: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebClient } from "@slack/web-api";
|
|
2
|
-
export type SlackActionErrorCode = "missing_token" | "missing_scope" | "rate_limited" | "feature_unavailable" | "canvas_creation_failed" | "canvas_editing_failed" | "invalid_arguments" | "not_found" | "not_in_channel" | "already_reacted" | "no_reaction" | "internal_error";
|
|
2
|
+
export type SlackActionErrorCode = "missing_token" | "missing_scope" | "rate_limited" | "feature_unavailable" | "canvas_creation_failed" | "canvas_editing_failed" | "invalid_arguments" | "not_found" | "not_in_channel" | "already_reacted" | "no_reaction" | "read_only_channel" | "internal_error";
|
|
3
3
|
export declare class SlackActionError extends Error {
|
|
4
4
|
code: SlackActionErrorCode;
|
|
5
5
|
apiError?: string;
|
|
@@ -110,6 +110,8 @@ declare const sessionLogEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
110
110
|
subagentInvocationId: z.ZodString;
|
|
111
111
|
outcome: z.ZodUnion<readonly [z.ZodLiteral<"success">, z.ZodLiteral<"error">, z.ZodLiteral<"aborted">]>;
|
|
112
112
|
errorCode: z.ZodOptional<z.ZodString>;
|
|
113
|
+
transcriptEndMessageIndex: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
transcriptStartMessageIndex: z.ZodOptional<z.ZodNumber>;
|
|
113
115
|
createdAtMs: z.ZodNumber;
|
|
114
116
|
}, z.core.$strip>], "type">;
|
|
115
117
|
/** Requester identity stored with turn-start messages for durable continuation. */
|
|
@@ -224,6 +226,8 @@ export declare function recordSubagentEnded(args: Scope & {
|
|
|
224
226
|
sessionId?: string;
|
|
225
227
|
store?: SessionLogStore;
|
|
226
228
|
subagentInvocationId: string;
|
|
229
|
+
transcriptEndMessageIndex?: number;
|
|
230
|
+
transcriptStartMessageIndex?: number;
|
|
227
231
|
ttlMs: number;
|
|
228
232
|
}): Promise<void>;
|
|
229
233
|
/**
|
|
@@ -127,7 +127,7 @@ export declare function recordConversationActivity(args: {
|
|
|
127
127
|
state?: StateAdapter;
|
|
128
128
|
title?: string;
|
|
129
129
|
}): Promise<void>;
|
|
130
|
-
/** Store task-execution metadata for
|
|
130
|
+
/** Store task-execution metadata for legacy SQL import. */
|
|
131
131
|
export declare function recordConversationExecution(args: {
|
|
132
132
|
channelName?: string;
|
|
133
133
|
conversationId: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createPluginLogger,
|
|
3
3
|
createPluginState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CWMMGUWM.js";
|
|
5
5
|
import {
|
|
6
6
|
getDb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QWKB6NJV.js";
|
|
8
8
|
import {
|
|
9
9
|
SANDBOX_WORKSPACE_ROOT
|
|
10
10
|
} from "./chunk-G3E7SCME.js";
|
|
@@ -13,16 +13,16 @@ import {
|
|
|
13
13
|
isConversationScopedChannel,
|
|
14
14
|
isDmChannel,
|
|
15
15
|
normalizeSlackConversationId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BAPRSWNW.js";
|
|
17
17
|
import {
|
|
18
18
|
botConfig,
|
|
19
19
|
completeObject,
|
|
20
20
|
embedTexts
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ALL7GG6U.js";
|
|
22
22
|
import {
|
|
23
23
|
isActorUserId,
|
|
24
24
|
parseActorUserId
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IXTBFABZ.js";
|
|
26
26
|
import {
|
|
27
27
|
logInfo,
|
|
28
28
|
logWarn
|
|
@@ -757,13 +757,14 @@ function readBotConfig(env) {
|
|
|
757
757
|
advisor: readAdvisorConfig(env)
|
|
758
758
|
};
|
|
759
759
|
}
|
|
760
|
-
function
|
|
761
|
-
|
|
762
|
-
}
|
|
763
|
-
function isLocalDatabaseUrl(databaseUrl) {
|
|
760
|
+
function readDatabaseUrl(env) {
|
|
761
|
+
const databaseUrl = toOptionalTrimmed(env.DATABASE_URL);
|
|
764
762
|
if (!databaseUrl) {
|
|
765
|
-
|
|
763
|
+
throw new Error("DATABASE_URL is required");
|
|
766
764
|
}
|
|
765
|
+
return databaseUrl;
|
|
766
|
+
}
|
|
767
|
+
function isLocalDatabaseUrl(databaseUrl) {
|
|
767
768
|
try {
|
|
768
769
|
const { hostname } = new URL(databaseUrl);
|
|
769
770
|
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
@@ -785,7 +786,7 @@ function readSqlDriver(env, databaseUrl) {
|
|
|
785
786
|
throw new Error("JUNIOR_DATABASE_DRIVER must be postgres or neon");
|
|
786
787
|
}
|
|
787
788
|
function readChatConfig(env = process.env) {
|
|
788
|
-
const databaseUrl =
|
|
789
|
+
const databaseUrl = readDatabaseUrl(env);
|
|
789
790
|
return {
|
|
790
791
|
bot: readBotConfig(env),
|
|
791
792
|
functionMaxDurationSeconds: resolveFunctionMaxDurationSeconds(env),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getSlackBotToken
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ALL7GG6U.js";
|
|
4
4
|
import {
|
|
5
5
|
isSlackConversationId,
|
|
6
6
|
isSlackTeamId,
|
|
@@ -145,6 +145,9 @@ function mapSlackError(error) {
|
|
|
145
145
|
if (apiError === "not_in_channel") {
|
|
146
146
|
return new SlackActionError(message, "not_in_channel", baseOptions);
|
|
147
147
|
}
|
|
148
|
+
if (apiError === "restricted_action_read_only_channel") {
|
|
149
|
+
return new SlackActionError(message, "read_only_channel", baseOptions);
|
|
150
|
+
}
|
|
148
151
|
if (apiError === "already_reacted") {
|
|
149
152
|
return new SlackActionError(message, "already_reacted", baseOptions);
|
|
150
153
|
}
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
getDefaultRedisStateAdapterFor,
|
|
6
6
|
getStateAdapter
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MJ4E2PK7.js";
|
|
8
8
|
import {
|
|
9
9
|
parseDestination,
|
|
10
10
|
sameDestination
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BAPRSWNW.js";
|
|
12
12
|
import {
|
|
13
13
|
getChatConfig
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ALL7GG6U.js";
|
|
15
15
|
import {
|
|
16
16
|
parseStoredSlackRequester
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-IXTBFABZ.js";
|
|
18
18
|
import {
|
|
19
19
|
isRecord,
|
|
20
20
|
toOptionalNumber,
|
|
@@ -157,11 +157,10 @@ function toStoredSlackRequester(requester) {
|
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
159
|
function createSlackResumeRequester(args) {
|
|
160
|
-
if (
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
throw new Error("Stored Slack requester did not match resume actor");
|
|
160
|
+
if (args.requester) {
|
|
161
|
+
if (args.requester.platform !== "slack" || args.requester.teamId !== args.teamId || args.requester.userId !== args.userId) {
|
|
162
|
+
throw new Error("Stored Slack requester did not match resume actor");
|
|
163
|
+
}
|
|
165
164
|
}
|
|
166
165
|
const requester = createRequester(args.requester, {
|
|
167
166
|
platform: "slack",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConversationStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QWKB6NJV.js";
|
|
4
4
|
import {
|
|
5
5
|
SANDBOX_DATA_ROOT,
|
|
6
6
|
SANDBOX_WORKSPACE_ROOT,
|
|
@@ -9,20 +9,20 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
getConnectedStateContext,
|
|
11
11
|
getStateAdapter
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MJ4E2PK7.js";
|
|
13
13
|
import {
|
|
14
14
|
parseDestination
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BAPRSWNW.js";
|
|
16
16
|
import {
|
|
17
17
|
TURN_CONTEXT_TAG,
|
|
18
18
|
botConfig,
|
|
19
19
|
getChatConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ALL7GG6U.js";
|
|
21
21
|
import {
|
|
22
22
|
parseRequester,
|
|
23
23
|
storedSlackRequesterSchema,
|
|
24
24
|
toStoredSlackRequester
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-IXTBFABZ.js";
|
|
26
26
|
import {
|
|
27
27
|
listReferenceFiles,
|
|
28
28
|
soulPathCandidates,
|
|
@@ -139,6 +139,8 @@ var subagentEndedEntrySchema = z.object({
|
|
|
139
139
|
z.literal("aborted")
|
|
140
140
|
]),
|
|
141
141
|
errorCode: z.string().min(1).optional(),
|
|
142
|
+
transcriptEndMessageIndex: z.number().int().nonnegative().optional(),
|
|
143
|
+
transcriptStartMessageIndex: z.number().int().nonnegative().optional(),
|
|
142
144
|
createdAtMs: z.number().int().nonnegative()
|
|
143
145
|
});
|
|
144
146
|
var sessionLogEntrySchema = z.discriminatedUnion("type", [
|
|
@@ -339,6 +341,8 @@ function subagentEndedEntry(args) {
|
|
|
339
341
|
subagentInvocationId: args.subagentInvocationId,
|
|
340
342
|
outcome: args.outcome,
|
|
341
343
|
...args.errorCode ? { errorCode: args.errorCode } : {},
|
|
344
|
+
...args.transcriptEndMessageIndex !== void 0 ? { transcriptEndMessageIndex: args.transcriptEndMessageIndex } : {},
|
|
345
|
+
...args.transcriptStartMessageIndex !== void 0 ? { transcriptStartMessageIndex: args.transcriptStartMessageIndex } : {},
|
|
342
346
|
createdAtMs: args.createdAtMs
|
|
343
347
|
};
|
|
344
348
|
}
|
|
@@ -623,7 +627,9 @@ async function recordSubagentEnded(args) {
|
|
|
623
627
|
errorCode: args.errorCode,
|
|
624
628
|
outcome: args.outcome,
|
|
625
629
|
sessionId,
|
|
626
|
-
subagentInvocationId: args.subagentInvocationId
|
|
630
|
+
subagentInvocationId: args.subagentInvocationId,
|
|
631
|
+
transcriptEndMessageIndex: args.transcriptEndMessageIndex,
|
|
632
|
+
transcriptStartMessageIndex: args.transcriptStartMessageIndex
|
|
627
633
|
})
|
|
628
634
|
],
|
|
629
635
|
ttlMs: args.ttlMs
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-G3E7SCME.js";
|
|
4
4
|
import {
|
|
5
5
|
getStateAdapter
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MJ4E2PK7.js";
|
|
7
7
|
import {
|
|
8
8
|
toOptionalTrimmed
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ALL7GG6U.js";
|
|
10
10
|
import {
|
|
11
11
|
pluginCatalogRuntime
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BQ3ITJA6.js";
|
|
13
13
|
import {
|
|
14
14
|
withSpan
|
|
15
15
|
} from "./chunk-KF7522P3.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseDestination,
|
|
3
3
|
sameDestination
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BAPRSWNW.js";
|
|
5
5
|
import {
|
|
6
6
|
getChatConfig
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ALL7GG6U.js";
|
|
8
8
|
import {
|
|
9
9
|
parseStoredSlackRequester
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IXTBFABZ.js";
|
|
11
11
|
|
|
12
12
|
// src/chat/conversations/sql/store.ts
|
|
13
13
|
import { randomUUID } from "crypto";
|
|
@@ -1041,14 +1041,6 @@ function createDb(args) {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
function getSqlExecutor() {
|
|
1043
1043
|
const { sql: sql3 } = getChatConfig();
|
|
1044
|
-
if (!sql3.databaseUrl) {
|
|
1045
|
-
if (current) {
|
|
1046
|
-
const previous = current;
|
|
1047
|
-
current = void 0;
|
|
1048
|
-
void previous.db.close().catch(() => void 0);
|
|
1049
|
-
}
|
|
1050
|
-
throw new Error("DATABASE_URL or JUNIOR_DATABASE_URL is required");
|
|
1051
|
-
}
|
|
1052
1044
|
if (current?.databaseUrl !== sql3.databaseUrl || current.driver !== sql3.driver) {
|
|
1053
1045
|
if (current) {
|
|
1054
1046
|
const previous = current;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getStateAdapter
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MJ4E2PK7.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeSlackConversationId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BAPRSWNW.js";
|
|
7
7
|
import {
|
|
8
8
|
parseSlackThreadId
|
|
9
9
|
} from "./chunk-DR75T7J3.js";
|
|
10
10
|
import {
|
|
11
11
|
parseStoredSlackRequester
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-IXTBFABZ.js";
|
|
13
13
|
import {
|
|
14
14
|
isRecord,
|
|
15
15
|
toOptionalNumber
|