@sentry/junior 0.196.0 → 0.198.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/{agent-hooks-IQLRR4RC.js → agent-hooks-3E7O7ATZ.js} +11 -11
- package/dist/api.js +24 -24
- package/dist/app.d.ts +2 -1
- package/dist/app.js +44 -80
- package/dist/{catalog-runtime-EM7V2F4I.js → catalog-runtime-QDUBRXEW.js} +4 -4
- package/dist/chat/config.d.ts +16 -0
- package/dist/chat/services/automated-turn-limit.d.ts +13 -34
- package/dist/chat/slack/automated-turn-limit-notice.d.ts +2 -24
- package/dist/{chunk-PIZJBSGZ.js → chunk-2ACXVY6O.js} +1 -1
- package/dist/{chunk-VSOO3Y6M.js → chunk-342FVAX5.js} +1 -1
- package/dist/{chunk-G6YRPYDC.js → chunk-3J5Y4RWY.js} +1 -1
- package/dist/{chunk-CTS72G4B.js → chunk-3TMKXW4H.js} +1 -1
- package/dist/{chunk-ES7KCEND.js → chunk-4FHQ6CCO.js} +1 -1
- package/dist/{chunk-NE2UQMC7.js → chunk-4UW7BEJZ.js} +6 -6
- package/dist/{chunk-BXIVMNLR.js → chunk-7KXZRRMK.js} +1 -1
- package/dist/{chunk-S74KAE77.js → chunk-A6KKPVEA.js} +4 -4
- package/dist/{chunk-SR5FS2JP.js → chunk-BFIFTKUS.js} +3 -3
- package/dist/{chunk-EEUFKVCD.js → chunk-C3SNQB6B.js} +21 -21
- package/dist/{chunk-PI6VXVBK.js → chunk-CBHQOGFA.js} +1 -1
- package/dist/{chunk-VVU7GHIZ.js → chunk-CGNZXN7B.js} +8 -8
- package/dist/{chunk-P3LE2CSJ.js → chunk-CSGQWJIY.js} +2 -2
- package/dist/{chunk-RFNMWONZ.js → chunk-CZC6ZEXR.js} +6 -6
- package/dist/{chunk-LSPUMNZK.js → chunk-D3SLBCD4.js} +2 -2
- package/dist/{chunk-5XSEOJPC.js → chunk-EATO3SKS.js} +54 -2
- package/dist/{chunk-7TUDDW3Y.js → chunk-EWPTEQXA.js} +3 -3
- package/dist/{chunk-J357NJQ5.js → chunk-F3XUS2T5.js} +5 -5
- package/dist/{chunk-B5WJBVHY.js → chunk-FU4OWKCL.js} +2 -2
- package/dist/{chunk-QAINJHI4.js → chunk-G2CT2D5U.js} +5 -5
- package/dist/{chunk-LGXI6PWX.js → chunk-G6XSYS3Q.js} +4 -4
- package/dist/{chunk-VKLQ2M7V.js → chunk-IZ4CIFJY.js} +9 -9
- package/dist/{chunk-DFWJJOW3.js → chunk-KVXHBJCH.js} +1 -1
- package/dist/{chunk-KJGH3KWA.js → chunk-LXPGGSYD.js} +3 -3
- package/dist/{chunk-RAWYH7TW.js → chunk-N3GQY63R.js} +8 -2
- package/dist/{chunk-VRHZXY5X.js → chunk-N6LJYW7V.js} +1 -1
- package/dist/{chunk-VXAQTJSR.js → chunk-NVDUM2CM.js} +1 -1
- package/dist/{chunk-CNI74T7U.js → chunk-OKQMTCHU.js} +5 -5
- package/dist/{chunk-GZ336GZ5.js → chunk-QYSJWJLJ.js} +4 -4
- package/dist/{chunk-OVWAO5KY.js → chunk-SCVIT6K4.js} +51 -174
- package/dist/{chunk-XNXKRWWI.js → chunk-SPEJV3TW.js} +3 -10
- package/dist/{chunk-EQBHN4JK.js → chunk-T5KV6DUY.js} +1 -1
- package/dist/{chunk-6LQNW2CJ.js → chunk-U67DBSNZ.js} +6 -6
- package/dist/{chunk-LCAM2P7H.js → chunk-VYGZPJSM.js} +4 -4
- package/dist/{chunk-N2MSPOGG.js → chunk-X2WFY3TM.js} +8 -8
- package/dist/{chunk-I7GEGEHZ.js → chunk-XNZAZ57D.js} +1 -1
- package/dist/{chunk-EFNUCRB5.js → chunk-ZORFTPFN.js} +8 -8
- package/dist/{chunk-KZX7LORG.js → chunk-ZUEUBQWE.js} +3 -3
- package/dist/cli/chat.js +33 -33
- 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-YTM7ZXPK.js → db-OSPYS4WA.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-OXW4KQLQ.js → oauth-callback-server-VG736DHZ.js} +29 -29
- package/dist/{runner-RJY5RNJO.js → runner-3GKIVG6A.js} +21 -21
- package/dist/{skills-WZV6NLFY.js → skills-FKMV7HTX.js} +5 -5
- package/dist/spawn-5YR3E42B.js +42 -0
- package/dist/task-runner-GR2WZNCW.js +36 -0
- package/dist/{validation-XS5ZHV3W.js → validation-4XYG33GY.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-LJMSDEY3.js → work-TJAL6PV3.js} +21 -21
- package/dist/{worker-NMFZ7A2N.js → worker-3OYUEME2.js} +10 -10
- package/package.json +4 -4
- package/dist/spawn-J7SQJLYF.js +0 -42
- package/dist/task-runner-SMUQ5464.js +0 -36
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Stops event wakes after too many automated Turns with no user Turn.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* every scope that Turn can name.
|
|
4
|
+
* Counts on the Conversation only. A finished user Turn clears the count so
|
|
5
|
+
* later automated wakes can run again.
|
|
7
6
|
*/
|
|
8
|
-
import type {
|
|
7
|
+
import type { Source } from "@sentry/junior-plugin-api";
|
|
9
8
|
import type { StateAdapter } from "chat";
|
|
10
9
|
import { z } from "zod";
|
|
11
|
-
/** Stored consecutive-turn
|
|
10
|
+
/** Stored consecutive automated-turn count for one Conversation. */
|
|
12
11
|
declare const automatedTurnLimitStateSchema: z.ZodObject<{
|
|
13
12
|
consecutiveAutomatedTurns: z.ZodNumber;
|
|
14
13
|
noticePostedAtMs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -16,13 +15,6 @@ declare const automatedTurnLimitStateSchema: z.ZodObject<{
|
|
|
16
15
|
updatedAtMs: z.ZodNumber;
|
|
17
16
|
}, z.core.$strict>;
|
|
18
17
|
export type AutomatedTurnLimitState = z.output<typeof automatedTurnLimitStateSchema>;
|
|
19
|
-
export type AutomatedTurnLimitScope = {
|
|
20
|
-
kind: "conversation";
|
|
21
|
-
conversationId: string;
|
|
22
|
-
} | {
|
|
23
|
-
kind: "destination";
|
|
24
|
-
destination: Destination;
|
|
25
|
-
};
|
|
26
18
|
export type AutomatedTurnLimitDecision = {
|
|
27
19
|
status: "allow";
|
|
28
20
|
consecutiveAutomatedTurns: number;
|
|
@@ -35,29 +27,17 @@ export type AutomatedTurnLimitUpdate = {
|
|
|
35
27
|
consecutiveAutomatedTurns: number;
|
|
36
28
|
paused: boolean;
|
|
37
29
|
shouldPostNotice: boolean;
|
|
38
|
-
/** Where the pause notice should tell the user to reply. */
|
|
39
|
-
resumeIn: "thread" | "channel";
|
|
40
30
|
};
|
|
41
31
|
/** True when this Source starts an automated Turn rather than a user Turn. */
|
|
42
32
|
export declare function isAutomatedTurnSource(source: Source | undefined): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Scope that counts automated Turns for this Source.
|
|
45
|
-
* Resource-event watches stay on the Conversation. Dispatches use Destination.
|
|
46
|
-
*/
|
|
47
|
-
export declare function automatedTurnLimitScopeForSource(args: {
|
|
48
|
-
conversationId: string;
|
|
49
|
-
destination?: Destination;
|
|
50
|
-
source?: Source;
|
|
51
|
-
}): AutomatedTurnLimitScope | undefined;
|
|
52
33
|
/** Plain notice when automatic updates stop until the user replies. */
|
|
53
34
|
export declare function buildAutomatedTurnLimitResponse(args: {
|
|
54
35
|
maxTurns: number;
|
|
55
|
-
resumeIn?: "thread" | "channel";
|
|
56
36
|
}): string;
|
|
57
|
-
/** Read the
|
|
37
|
+
/** Read the consecutive automated-turn count for one Conversation. */
|
|
58
38
|
export declare function getAutomatedTurnLimitState(args: {
|
|
39
|
+
conversationId: string;
|
|
59
40
|
nowMs?: number;
|
|
60
|
-
scope: AutomatedTurnLimitScope;
|
|
61
41
|
state?: StateAdapter;
|
|
62
42
|
}): Promise<AutomatedTurnLimitState>;
|
|
63
43
|
/**
|
|
@@ -66,16 +46,16 @@ export declare function getAutomatedTurnLimitState(args: {
|
|
|
66
46
|
* posts it. Clear the claim if that post fails or is skipped.
|
|
67
47
|
*/
|
|
68
48
|
export declare function admitAutomatedTurn(args: {
|
|
49
|
+
conversationId: string;
|
|
69
50
|
maxTurns: number;
|
|
70
51
|
nowMs?: number;
|
|
71
|
-
scope: AutomatedTurnLimitScope;
|
|
72
52
|
state?: StateAdapter;
|
|
73
53
|
}): Promise<AutomatedTurnLimitDecision>;
|
|
74
54
|
/** Count one finished automated Turn toward the consecutive-turn limit. */
|
|
75
55
|
export declare function countAutomatedTurn(args: {
|
|
56
|
+
conversationId: string;
|
|
76
57
|
maxTurns: number;
|
|
77
58
|
nowMs?: number;
|
|
78
|
-
scope: AutomatedTurnLimitScope;
|
|
79
59
|
state?: StateAdapter;
|
|
80
60
|
}): Promise<AutomatedTurnLimitUpdate>;
|
|
81
61
|
/**
|
|
@@ -83,25 +63,24 @@ export declare function countAutomatedTurn(args: {
|
|
|
83
63
|
* Keeps the pause and consecutive count.
|
|
84
64
|
*/
|
|
85
65
|
export declare function clearAutomatedTurnLimitNoticeClaim(args: {
|
|
66
|
+
conversationId: string;
|
|
86
67
|
nowMs?: number;
|
|
87
|
-
scope: AutomatedTurnLimitScope;
|
|
88
68
|
state?: StateAdapter;
|
|
89
69
|
}): Promise<void>;
|
|
90
70
|
/** Clear the consecutive automated-turn count after a user-owned Turn. */
|
|
91
71
|
export declare function resetAutomatedTurnLimit(args: {
|
|
72
|
+
conversationId: string;
|
|
92
73
|
nowMs?: number;
|
|
93
|
-
scope: AutomatedTurnLimitScope;
|
|
94
74
|
state?: StateAdapter;
|
|
95
75
|
}): Promise<void>;
|
|
96
76
|
/**
|
|
97
|
-
* Update consecutive automated-turn
|
|
77
|
+
* Update consecutive automated-turn counts after one finished Turn.
|
|
98
78
|
*
|
|
99
|
-
* Automated Turns count
|
|
100
|
-
*
|
|
79
|
+
* Automated Turns count on the Conversation. User Turns clear that count so
|
|
80
|
+
* later event wakes can run again.
|
|
101
81
|
*/
|
|
102
82
|
export declare function recordFinishedTurnForAutomatedLimit(args: {
|
|
103
83
|
conversationId: string;
|
|
104
|
-
destination?: Destination;
|
|
105
84
|
maxTurns: number;
|
|
106
85
|
nowMs?: number;
|
|
107
86
|
source?: Source;
|
|
@@ -1,36 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
* Destination-visible pause notice for the consecutive automated-turn limit.
|
|
3
|
-
*
|
|
4
|
-
* Best-effort: a failed post must not fail the Turn or re-enable event wakes.
|
|
5
|
-
* The consecutive-turn limit claims the notice slot before this post. Clear that
|
|
6
|
-
* claim when the post fails or is skipped so a later paused wake can try again.
|
|
7
|
-
*/
|
|
8
|
-
import type { Destination } from "@sentry/junior-plugin-api";
|
|
9
|
-
import { type AutomatedTurnLimitScope, type AutomatedTurnLimitUpdate } from "@/chat/services/automated-turn-limit";
|
|
1
|
+
import { type AutomatedTurnLimitUpdate } from "@/chat/services/automated-turn-limit";
|
|
10
2
|
/** Post the pause notice for one Conversation Location when known. */
|
|
11
3
|
export declare function postAutomatedTurnLimitNoticeForConversation(args: {
|
|
12
4
|
conversationId: string;
|
|
13
5
|
maxTurns: number;
|
|
14
6
|
nowMs?: number;
|
|
15
|
-
resumeIn?: "thread" | "channel";
|
|
16
|
-
scope?: AutomatedTurnLimitScope;
|
|
17
|
-
}): Promise<boolean>;
|
|
18
|
-
/** Post the pause notice for one Slack Destination. */
|
|
19
|
-
export declare function postAutomatedTurnLimitNoticeForDestination(args: {
|
|
20
|
-
destination: Destination;
|
|
21
|
-
maxTurns: number;
|
|
22
|
-
nowMs?: number;
|
|
23
|
-
resumeIn?: "thread" | "channel";
|
|
24
|
-
scope?: AutomatedTurnLimitScope;
|
|
25
7
|
threadTs?: string;
|
|
26
8
|
}): Promise<boolean>;
|
|
27
|
-
/**
|
|
28
|
-
* Post the pause notice after a finished Turn hits the limit.
|
|
29
|
-
* Prefer the Conversation Location so thread watches stay in-thread.
|
|
30
|
-
*/
|
|
9
|
+
/** Post the pause notice after a finished Turn hits the limit. */
|
|
31
10
|
export declare function maybePostAutomatedTurnLimitNotice(args: {
|
|
32
11
|
conversationId: string;
|
|
33
|
-
destination?: Destination;
|
|
34
12
|
maxTurns: number;
|
|
35
13
|
nowMs?: number;
|
|
36
14
|
threadTs?: string;
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getConversationEventStore,
|
|
6
6
|
getDb,
|
|
7
7
|
getSqlExecutor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-SPEJV3TW.js";
|
|
9
9
|
import {
|
|
10
10
|
juniorCodeChanges,
|
|
11
11
|
juniorCodeRepositories,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
juniorUsers,
|
|
17
17
|
juniorWorkspaceRepos,
|
|
18
18
|
juniorWorkspaces
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2ACXVY6O.js";
|
|
20
20
|
import {
|
|
21
21
|
SANDBOX_WORKSPACE_ROOT,
|
|
22
22
|
getVercelSandboxCredentials,
|
|
@@ -24,16 +24,16 @@ import {
|
|
|
24
24
|
isSandboxMissingError,
|
|
25
25
|
runNonInteractiveCommand,
|
|
26
26
|
sleep
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-BFIFTKUS.js";
|
|
28
28
|
import {
|
|
29
29
|
getStateAdapter
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-T5KV6DUY.js";
|
|
31
31
|
import {
|
|
32
32
|
botConfig,
|
|
33
33
|
completeObject,
|
|
34
34
|
embedTexts,
|
|
35
35
|
getSlackBotToken
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-EATO3SKS.js";
|
|
37
37
|
import {
|
|
38
38
|
defaultModelId
|
|
39
39
|
} from "./chunk-NHJU2ZAL.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
setSpanAttributes,
|
|
53
53
|
setSpanStatus,
|
|
54
54
|
withSpan
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-3TMKXW4H.js";
|
|
56
56
|
|
|
57
57
|
// src/chat/plugins/agent-hooks.ts
|
|
58
58
|
import {
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
getConversationStore,
|
|
9
9
|
parseDestination,
|
|
10
10
|
sameDestination
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SPEJV3TW.js";
|
|
12
12
|
import {
|
|
13
13
|
getDefaultRedisStateAdapterFor,
|
|
14
14
|
getStateAdapter
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-T5KV6DUY.js";
|
|
16
16
|
import {
|
|
17
17
|
getChatConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EATO3SKS.js";
|
|
19
19
|
import {
|
|
20
20
|
parseStoredSlackActor
|
|
21
21
|
} from "./chunk-N7TMSOZH.js";
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
isRecord,
|
|
24
24
|
toOptionalNumber,
|
|
25
25
|
toOptionalString
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3TMKXW4H.js";
|
|
27
27
|
|
|
28
28
|
// src/chat/task-execution/state.ts
|
|
29
29
|
import { randomUUID } from "crypto";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toOptionalTrimmed
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EATO3SKS.js";
|
|
4
4
|
import {
|
|
5
5
|
pluginCatalogRuntime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-3J5Y4RWY.js";
|
|
7
7
|
import {
|
|
8
8
|
setSpanAttributes,
|
|
9
9
|
setSpanStatus
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-3TMKXW4H.js";
|
|
11
11
|
|
|
12
12
|
// src/chat/sandbox/paths.ts
|
|
13
13
|
function normalizeWorkspaceRoot(input) {
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
AgentRunError,
|
|
6
6
|
executeTurn
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LXPGGSYD.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
finalizeFailedTurnReplyWithEvent,
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
getTurnUserSlackMessageTs,
|
|
16
16
|
persistAuthPauseTurnState,
|
|
17
17
|
requireTurnFailureEventId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-F3XUS2T5.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveTurnSessionRouting,
|
|
21
21
|
scheduleSessionCompletedPluginTasks
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-CGNZXN7B.js";
|
|
23
23
|
import {
|
|
24
24
|
getTurnLifecycle
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-342FVAX5.js";
|
|
26
26
|
import {
|
|
27
27
|
coerceThreadConversationState,
|
|
28
28
|
configValueSchema,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
getPersistedSandboxState,
|
|
31
31
|
getPersistedThreadState,
|
|
32
32
|
persistThreadStateById
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-G2CT2D5U.js";
|
|
34
34
|
import {
|
|
35
35
|
buildSentryConversationUrl,
|
|
36
36
|
deleteWebAuthorization
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-N3GQY63R.js";
|
|
38
38
|
import {
|
|
39
39
|
createUserTokenStore,
|
|
40
40
|
deleteMcpAuthSession,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
lookupSlackUserProfile,
|
|
46
46
|
putMcpStoredOAuthCredentials,
|
|
47
47
|
resolvePluginOAuthAccount
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-X2WFY3TM.js";
|
|
49
49
|
import {
|
|
50
50
|
RetryableDeliveryError,
|
|
51
51
|
addReactionToMessage,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
removeReactionFromMessage,
|
|
60
60
|
resolveBaseUrl,
|
|
61
61
|
truncateStatusText
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-CZC6ZEXR.js";
|
|
63
63
|
import {
|
|
64
64
|
CooperativeTurnYieldError,
|
|
65
65
|
clearPendingAuth,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
isCooperativeTurnYieldError,
|
|
69
69
|
isPendingAuthLatestRequest,
|
|
70
70
|
markTurnFailed
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-KVXHBJCH.js";
|
|
72
72
|
import {
|
|
73
73
|
abandonTurnRecord,
|
|
74
74
|
buildConversationContext,
|
|
@@ -87,20 +87,20 @@ import {
|
|
|
87
87
|
recordTurnSummary,
|
|
88
88
|
saveTurnCheckpoint,
|
|
89
89
|
turnHasReply
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-U67DBSNZ.js";
|
|
91
91
|
import {
|
|
92
92
|
parseSlackThreadId,
|
|
93
93
|
readSlackRawMessageContext,
|
|
94
94
|
resolveSlackChannelIdFromMessage,
|
|
95
95
|
resolveSlackChannelIdFromThreadId
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-NVDUM2CM.js";
|
|
97
97
|
import {
|
|
98
98
|
ensureConversationWake,
|
|
99
99
|
requestConversationWork
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-A6KKPVEA.js";
|
|
101
101
|
import {
|
|
102
102
|
getTurnRequestDeadline
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-N6LJYW7V.js";
|
|
104
104
|
import {
|
|
105
105
|
getVercelConversationWorkQueue
|
|
106
106
|
} from "./chunk-DKIJ2RP5.js";
|
|
@@ -112,39 +112,39 @@ import {
|
|
|
112
112
|
getSlackClient,
|
|
113
113
|
isDmChannel,
|
|
114
114
|
normalizeSlackConversationId
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-4UW7BEJZ.js";
|
|
116
116
|
import {
|
|
117
117
|
getConversationStore,
|
|
118
118
|
getSqlExecutor,
|
|
119
119
|
requireSlackDestination,
|
|
120
120
|
upsertIdentity,
|
|
121
121
|
upsertLinkedIdentity
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-SPEJV3TW.js";
|
|
123
123
|
import {
|
|
124
124
|
acquireActiveLock,
|
|
125
125
|
getStateAdapter
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-T5KV6DUY.js";
|
|
127
127
|
import {
|
|
128
128
|
botConfig,
|
|
129
129
|
escapeXml,
|
|
130
130
|
getChatConfig,
|
|
131
131
|
getRuntimeMetadata,
|
|
132
132
|
normalizeSlackEmojiName
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-EATO3SKS.js";
|
|
134
134
|
import {
|
|
135
135
|
defaultModelId
|
|
136
136
|
} from "./chunk-NHJU2ZAL.js";
|
|
137
137
|
import {
|
|
138
138
|
discoverSkills
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-D3SLBCD4.js";
|
|
140
140
|
import {
|
|
141
141
|
pluginCatalogRuntime
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-3J5Y4RWY.js";
|
|
143
143
|
import {
|
|
144
144
|
buildOAuthTokenRequest,
|
|
145
145
|
hasRequiredOAuthScope,
|
|
146
146
|
parseOAuthTokenResponse
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-7KXZRRMK.js";
|
|
148
148
|
import {
|
|
149
149
|
createSlackResumeActor,
|
|
150
150
|
isUserActor,
|
|
@@ -162,7 +162,7 @@ import {
|
|
|
162
162
|
setTags,
|
|
163
163
|
toOptionalString,
|
|
164
164
|
withLogContext
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-3TMKXW4H.js";
|
|
166
166
|
|
|
167
167
|
// src/chat/slack/assistant-thread/status-render.ts
|
|
168
168
|
var DEFAULT_STATUS_CONTEXTS = {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
coerceThreadConversationState,
|
|
3
3
|
getPersistedThreadState
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G2CT2D5U.js";
|
|
5
5
|
import {
|
|
6
6
|
recordTaskExecution
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-G6XSYS3Q.js";
|
|
8
8
|
import {
|
|
9
9
|
pluginTaskId,
|
|
10
10
|
pluginTaskParamsSchema,
|
|
11
11
|
sendVercelPluginTask
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EWPTEQXA.js";
|
|
13
13
|
import {
|
|
14
14
|
getPiMessageRole,
|
|
15
15
|
getTurnRecord,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
isToolResultMessage,
|
|
20
20
|
normalizeToolNameFromResult,
|
|
21
21
|
stripRuntimeTurnContext
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-U67DBSNZ.js";
|
|
23
23
|
import {
|
|
24
24
|
createPluginConversationEvents,
|
|
25
25
|
createPluginEmbedder,
|
|
@@ -28,17 +28,17 @@ import {
|
|
|
28
28
|
createPluginState,
|
|
29
29
|
getPlugins,
|
|
30
30
|
readActorIdentity
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-4UW7BEJZ.js";
|
|
32
32
|
import {
|
|
33
33
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
34
34
|
} from "./chunk-3Y47VMHV.js";
|
|
35
35
|
import {
|
|
36
36
|
getConversationStore,
|
|
37
37
|
getDb
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-SPEJV3TW.js";
|
|
39
39
|
import {
|
|
40
40
|
getStateAdapter
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-T5KV6DUY.js";
|
|
42
42
|
import {
|
|
43
43
|
sameActorIdentity
|
|
44
44
|
} from "./chunk-7NL7T6VU.js";
|
|
@@ -84,7 +84,7 @@ function slackSourceForDestination(args) {
|
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
86
|
async function resolveConversationRouting(args) {
|
|
87
|
-
const conversationStore = args.conversationStore ?? (await import("./db-
|
|
87
|
+
const conversationStore = args.conversationStore ?? (await import("./db-OSPYS4WA.js")).getConversationStore();
|
|
88
88
|
const chain = await loadConversationChain(
|
|
89
89
|
args.conversationId,
|
|
90
90
|
conversationStore
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAndEnqueueAgentInvocation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IZ4CIFJY.js";
|
|
4
4
|
import {
|
|
5
5
|
actorFromRun,
|
|
6
6
|
toolInvocationDestination
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CZC6ZEXR.js";
|
|
8
8
|
|
|
9
9
|
// src/chat/agent-invocations/spawn.ts
|
|
10
10
|
function bindSpawnAgent(run, options) {
|
|
@@ -8,19 +8,19 @@ import {
|
|
|
8
8
|
isDmChannel,
|
|
9
9
|
normalizeSlackConversationId,
|
|
10
10
|
withSlackRetries
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4UW7BEJZ.js";
|
|
12
12
|
import {
|
|
13
13
|
parseDestination
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SPEJV3TW.js";
|
|
15
15
|
import {
|
|
16
16
|
getStateAdapter
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-T5KV6DUY.js";
|
|
18
18
|
import {
|
|
19
19
|
normalizeSlackEmojiName
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EATO3SKS.js";
|
|
21
21
|
import {
|
|
22
22
|
pluginCatalogRuntime
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-3J5Y4RWY.js";
|
|
24
24
|
import {
|
|
25
25
|
parseSlackMessageTs,
|
|
26
26
|
parseSlackUserId
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
isRecord,
|
|
30
30
|
logInfo,
|
|
31
31
|
logWarn
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-3TMKXW4H.js";
|
|
33
33
|
|
|
34
34
|
// src/chat/agent/types.ts
|
|
35
35
|
var RetryableDeliveryError = class extends Error {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3J5Y4RWY.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-3TMKXW4H.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/skills.ts
|
|
12
12
|
import fs from "fs/promises";
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
toCanonicalInputMessage,
|
|
9
9
|
toCanonicalOutputMessage,
|
|
10
10
|
toGenAiMessagesTraceAttributes
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4FHQ6CCO.js";
|
|
12
12
|
import {
|
|
13
13
|
extractGenAiUsageAttributes,
|
|
14
14
|
logException,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
normalizeGenAiFinishReason,
|
|
17
17
|
serializeGenAiAttribute,
|
|
18
18
|
withSpan
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3TMKXW4H.js";
|
|
20
20
|
|
|
21
21
|
// src/chat/services/provider-error.ts
|
|
22
22
|
var ProviderError = class extends Error {
|
|
@@ -808,6 +808,13 @@ function validateGatewayModelId(raw) {
|
|
|
808
808
|
function validateEmbeddingModelId(raw) {
|
|
809
809
|
return toOptionalTrimmed(raw);
|
|
810
810
|
}
|
|
811
|
+
function requireModelId(configName, raw, validate) {
|
|
812
|
+
const modelId = validate(raw);
|
|
813
|
+
if (!modelId) {
|
|
814
|
+
throw new Error(`${configName} must not be empty`);
|
|
815
|
+
}
|
|
816
|
+
return modelId;
|
|
817
|
+
}
|
|
811
818
|
var DEFAULT_STANDARD_PROFILE_DESCRIPTION = "Use for default assistant work: lookups, explanations, ordinary tool use, short answers, and light investigation of one source. Avoid for implementation, debugging, multi-file changes, architecture decisions, or research across several systems.";
|
|
812
819
|
var DEFAULT_HANDOFF_PROFILE_DESCRIPTION = "Use for coding and difficult multi-step work: implementation, debugging, root-cause analysis, broad refactors, multi-file changes, architecture decisions, and research across several systems. Avoid for simple lookups, short answers, single-file reads, or ordinary tool use that the default profile can finish.";
|
|
813
820
|
function parseOptionalProfileDescription(rawDescription, configName, profile) {
|
|
@@ -1093,6 +1100,50 @@ function getRuntimeMetadata() {
|
|
|
1093
1100
|
version: toOptionalTrimmed(process.env.VERCEL_GIT_COMMIT_SHA)
|
|
1094
1101
|
};
|
|
1095
1102
|
}
|
|
1103
|
+
function setBotModelConfig(config) {
|
|
1104
|
+
if (config.embeddingModelId !== void 0) {
|
|
1105
|
+
botConfig.embeddingModelId = requireModelId(
|
|
1106
|
+
"embeddingModelId",
|
|
1107
|
+
config.embeddingModelId,
|
|
1108
|
+
validateEmbeddingModelId
|
|
1109
|
+
);
|
|
1110
|
+
}
|
|
1111
|
+
if (config.fastModelId !== void 0) {
|
|
1112
|
+
botConfig.fastModelId = requireModelId(
|
|
1113
|
+
"fastModelId",
|
|
1114
|
+
config.fastModelId,
|
|
1115
|
+
validateGatewayModelId
|
|
1116
|
+
);
|
|
1117
|
+
}
|
|
1118
|
+
if (config.guardianModelId !== void 0) {
|
|
1119
|
+
botConfig.guardianModelId = requireModelId(
|
|
1120
|
+
"guardianModelId",
|
|
1121
|
+
config.guardianModelId,
|
|
1122
|
+
validateGatewayModelId
|
|
1123
|
+
);
|
|
1124
|
+
}
|
|
1125
|
+
if (config.imageGenerationModelId !== void 0) {
|
|
1126
|
+
botConfig.imageGenerationModelId = requireModelId(
|
|
1127
|
+
"imageGenerationModelId",
|
|
1128
|
+
config.imageGenerationModelId,
|
|
1129
|
+
validateEmbeddingModelId
|
|
1130
|
+
);
|
|
1131
|
+
}
|
|
1132
|
+
if (config.visionModelId !== void 0) {
|
|
1133
|
+
botConfig.visionModelId = requireModelId(
|
|
1134
|
+
"visionModelId",
|
|
1135
|
+
config.visionModelId,
|
|
1136
|
+
validateGatewayModelId
|
|
1137
|
+
);
|
|
1138
|
+
}
|
|
1139
|
+
if (config.webSearchModelId !== void 0) {
|
|
1140
|
+
botConfig.webSearchModelId = requireModelId(
|
|
1141
|
+
"webSearchModelId",
|
|
1142
|
+
config.webSearchModelId,
|
|
1143
|
+
validateGatewayModelId
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1096
1147
|
function setProfiles(profiles, defaultProfile) {
|
|
1097
1148
|
if (!profiles || !defaultProfile) {
|
|
1098
1149
|
throw new Error("profiles and defaultProfile must be configured together");
|
|
@@ -1170,6 +1221,7 @@ export {
|
|
|
1170
1221
|
getSlackClientId,
|
|
1171
1222
|
getSlackClientSecret,
|
|
1172
1223
|
getRuntimeMetadata,
|
|
1224
|
+
setBotModelConfig,
|
|
1173
1225
|
setProfiles,
|
|
1174
1226
|
getSlackReactionConfig,
|
|
1175
1227
|
setSlackReactionConfig
|