@sentry/junior 0.146.0 → 0.147.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-SLJADYE5.js → agent-hooks-HS6VGUPM.js} +10 -10
- package/dist/api/conversations/detail.d.ts +1 -0
- package/dist/api/conversations/event-list.d.ts +1 -0
- package/dist/api/schema/conversation.d.ts +4 -0
- package/dist/api/schema.js +1 -1
- package/dist/api.js +26 -22
- package/dist/app.js +220 -238
- package/dist/{catalog-runtime-RQIMSDPR.js → catalog-runtime-M6ZTPYRV.js} +5 -5
- package/dist/chat/agent/prompt.d.ts +0 -2
- package/dist/chat/agent/request.d.ts +2 -5
- package/dist/chat/agent/sandbox.d.ts +2 -2
- package/dist/chat/agent/tools.d.ts +0 -2
- package/dist/chat/agent-dispatch/types.d.ts +2 -2
- package/dist/chat/capabilities/jr-rpc-command.d.ts +2 -2
- package/dist/chat/configuration/service.d.ts +5 -2
- package/dist/chat/configuration/sql.d.ts +9 -0
- package/dist/chat/configuration/types.d.ts +17 -13
- package/dist/chat/conversations/history.d.ts +3 -0
- package/dist/chat/conversations/projection.d.ts +10 -0
- package/dist/chat/credentials/unlink-provider.d.ts +2 -1
- package/dist/chat/credentials/user-token-store.d.ts +2 -0
- package/dist/chat/event-tasks/tool-support.d.ts +2 -0
- package/dist/chat/identities/sql.d.ts +8 -0
- package/dist/chat/logging.d.ts +2 -0
- package/dist/chat/mcp/auth-store.d.ts +0 -2
- package/dist/chat/mcp/oauth.d.ts +0 -2
- package/dist/chat/oauth-flow.d.ts +3 -1
- package/dist/chat/pi/client.d.ts +2 -0
- package/dist/chat/plugins/credential-hooks.d.ts +2 -0
- package/dist/chat/prompt.d.ts +0 -2
- package/dist/chat/resource-events/notification.d.ts +2 -1
- package/dist/chat/runtime/delivered-turn-state.d.ts +1 -4
- package/dist/chat/runtime/thread-state.d.ts +8 -11
- package/dist/chat/runtime/turn-input.d.ts +4 -2
- package/dist/chat/runtime/turn-preparation.d.ts +2 -4
- package/dist/chat/sandbox/command-result.d.ts +2 -0
- package/dist/chat/sandbox/egress/schemas.d.ts +6 -0
- package/dist/chat/scheduled-tasks/tool-support.d.ts +2 -0
- package/dist/chat/scheduled-tasks/tools/create.d.ts +2 -0
- package/dist/chat/scheduled-tasks/tools/delete.d.ts +2 -0
- package/dist/chat/scheduled-tasks/tools/list.d.ts +2 -0
- package/dist/chat/scheduled-tasks/tools/run-now.d.ts +2 -0
- package/dist/chat/scheduled-tasks/tools/update.d.ts +2 -0
- package/dist/chat/services/mcp-auth-orchestration.d.ts +0 -3
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -1
- package/dist/chat/services/provider-default-config.d.ts +2 -2
- package/dist/chat/services/subscribed-decision.d.ts +3 -0
- package/dist/chat/services/subscribed-reply-policy.d.ts +1 -0
- package/dist/chat/services/turn-result.d.ts +0 -3
- package/dist/chat/services/turn-router.d.ts +3 -0
- package/dist/chat/slack/assistant-thread/lifecycle.d.ts +0 -1
- package/dist/chat/slack/assistant-thread/title.d.ts +0 -3
- package/dist/chat/slack/dispatch-turn.d.ts +1 -1
- package/dist/chat/slack/tools/canvas/context.d.ts +0 -10
- package/dist/chat/slack/tools/canvas/create.d.ts +2 -0
- package/dist/chat/slack/tools/canvas/edit.d.ts +2 -0
- package/dist/chat/slack/tools/canvas/read.d.ts +2 -0
- package/dist/chat/slack/tools/canvas/write.d.ts +2 -0
- package/dist/chat/slack/tools/channel-list-messages.d.ts +2 -0
- package/dist/chat/slack/tools/conversation-message-search.d.ts +2 -0
- package/dist/chat/slack/tools/list/add-items.d.ts +4 -1
- package/dist/chat/slack/tools/list/api.d.ts +8 -1
- package/dist/chat/slack/tools/list/create.d.ts +2 -0
- package/dist/chat/slack/tools/list/get-items.d.ts +5 -3
- package/dist/chat/slack/tools/list/update-item.d.ts +5 -1
- package/dist/chat/slack/tools/message-add-reaction.d.ts +2 -0
- package/dist/chat/slack/tools/public-search.d.ts +2 -0
- package/dist/chat/slack/tools/send-files.d.ts +2 -0
- package/dist/chat/slack/tools/thread-read.d.ts +2 -0
- package/dist/chat/slack/vision-cache.d.ts +5 -0
- package/dist/chat/state/conversation.d.ts +4 -5
- package/dist/chat/tool-support/structured-result.d.ts +1 -0
- package/dist/chat/tool-support/timed-out-tool-result.d.ts +11 -0
- package/dist/chat/tools/create-event-task.d.ts +2 -0
- package/dist/chat/tools/delete-event-task.d.ts +2 -0
- package/dist/chat/tools/handoff/tool.d.ts +2 -0
- package/dist/chat/tools/list-event-tasks.d.ts +2 -0
- package/dist/chat/tools/list-resource-event-subscriptions.d.ts +2 -0
- package/dist/chat/tools/runtime/report-progress.d.ts +2 -0
- package/dist/chat/tools/runtime/spawn-agent.d.ts +2 -0
- package/dist/chat/tools/search-conversation-events.d.ts +2 -0
- package/dist/chat/tools/search-resource-event-types.d.ts +2 -0
- package/dist/chat/tools/search-tools.d.ts +2 -0
- package/dist/chat/tools/skill/load-skill.d.ts +2 -0
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +2 -0
- package/dist/chat/tools/stop-watching-resources.d.ts +2 -0
- package/dist/chat/tools/system-time.d.ts +2 -0
- package/dist/chat/tools/types.d.ts +0 -6
- package/dist/chat/tools/update-event-task.d.ts +2 -0
- package/dist/chat/tools/user-lookup.d.ts +29 -0
- package/dist/chat/tools/watch-resource-events.d.ts +2 -0
- package/dist/chat/tools/web/fetch-tool.d.ts +2 -0
- package/dist/chat/tools/web/image-generate.d.ts +2 -0
- package/dist/chat/tools/web/search.d.ts +2 -0
- package/dist/{chunk-LVW7BLLT.js → chunk-34GS7B6L.js} +2 -2
- package/dist/{chunk-B63BF443.js → chunk-4LJO56OJ.js} +9 -1
- package/dist/{chunk-H6U2U3EP.js → chunk-6H5SZR24.js} +16 -20
- package/dist/{chunk-M6ZWP4RI.js → chunk-745QJ3ZA.js} +1 -1
- package/dist/{chunk-BLETMLRX.js → chunk-7A4M7PCV.js} +231 -472
- package/dist/{chunk-MKRIZ4VG.js → chunk-7NVJVJID.js} +4 -2
- package/dist/{chunk-ZDGHGY74.js → chunk-7UQIVT6G.js} +13 -6
- package/dist/{chunk-GDQEU4I7.js → chunk-AIOK6LAG.js} +28 -489
- package/dist/{chunk-QSXZ42KX.js → chunk-AVOCH2Z5.js} +3 -3
- package/dist/{chunk-FXDDDSPL.js → chunk-AVZDSUFB.js} +4 -4
- package/dist/{chunk-OFPYOC3M.js → chunk-AYU72WO7.js} +102 -72
- package/dist/chunk-AZ7EAOBE.js +566 -0
- package/dist/{chunk-PH4Q3A6W.js → chunk-CSZINQJ2.js} +1 -1
- package/dist/{chunk-X2WMBTS3.js → chunk-CWP5RHVX.js} +4 -4
- package/dist/{chunk-HQE6EJS5.js → chunk-DLDRQHG5.js} +1 -1
- package/dist/{chunk-MCFIXAV5.js → chunk-DU74WPIC.js} +55 -37
- package/dist/{chunk-X22KCSCO.js → chunk-EFLJ2WJH.js} +6 -4
- package/dist/{chunk-37JJDS4H.js → chunk-GGB4WL5A.js} +1 -1
- package/dist/{chunk-F7REGDKO.js → chunk-IIOOO4FQ.js} +1 -1
- package/dist/{chunk-PB222GIA.js → chunk-JUUKWRBE.js} +1 -1
- package/dist/{chunk-T5GXFFLA.js → chunk-K4SZAP3K.js} +1 -1
- package/dist/{chunk-GYEKOX7N.js → chunk-ORO3PWKQ.js} +1 -1
- package/dist/{chunk-AISNSNDV.js → chunk-PVNG6UMU.js} +3 -3
- package/dist/{chunk-47OSH2ZO.js → chunk-Q4R73I43.js} +365 -206
- package/dist/{chunk-QG7OOKIN.js → chunk-RXBVB2JM.js} +1 -1
- package/dist/{chunk-V6SRLKUB.js → chunk-SGZO7UWH.js} +2 -2
- package/dist/{chunk-JLMVCNXL.js → chunk-SVHUEHUL.js} +1 -0
- package/dist/{chunk-FEKQHPVA.js → chunk-X5UY34KT.js} +6 -5
- package/dist/{chunk-FGHADGIC.js → chunk-YBVXBNSV.js} +2 -2
- package/dist/{chunk-JUA6VU2Z.js → chunk-YEO3VX72.js} +10 -23
- package/dist/{chunk-SCGVWUZX.js → chunk-YHDERDRO.js} +7 -6
- package/dist/{chunk-TCEJ7XXM.js → chunk-YNTTROJT.js} +1 -1
- package/dist/{chunk-37EVZP66.js → chunk-YSB2N563.js} +49 -8
- package/dist/{chunk-W65V465O.js → chunk-Z4YU7Z4L.js} +3 -2
- package/dist/cli/chat.js +32 -32
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +13 -13
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +7 -7
- package/dist/db/schema/location-configurations.d.ts +127 -0
- package/dist/db/schema.d.ts +128 -1
- package/dist/{db-WWOMXWTT.js → db-CSEW4RII.js} +7 -7
- package/dist/instrumentation.js +4 -4
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-A6ZZX74U.js → oauth-callback-server-FUEV5HNG.js} +24 -24
- package/dist/{runner-KSGB2UAV.js → runner-U3XHSKSH.js} +21 -39
- package/dist/{skills-26QPWKVS.js → skills-AKE6W3WI.js} +6 -6
- package/dist/spawn-B6GDTWJ4.js +39 -0
- package/dist/{validation-OPSRGFGH.js → validation-WDTAULUF.js} +6 -6
- package/dist/version.js +1 -1
- package/dist/{work-VMSW7STJ.js → work-C3HAO2BG.js} +17 -17
- package/dist/{worker-2JNFB7C7.js → worker-LNP4YKBM.js} +10 -10
- package/migrations/0024_misty_typhoid_mary.sql +12 -0
- package/migrations/meta/0024_snapshot.json +2275 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +5 -5
- package/dist/chat/slack/tools/user-lookup.d.ts +0 -27
- package/dist/chat/state/artifacts.d.ts +0 -30
- package/dist/chat/tool-support/turn-deadline-result.d.ts +0 -3
- package/dist/chunk-Q6QZTTLS.js +0 -55
- package/dist/spawn-5LAJXZ2P.js +0 -39
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
appendAndEnqueueInboundMessage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CWP5RHVX.js";
|
|
4
4
|
import {
|
|
5
|
-
ConversationTurnLifecycleService
|
|
6
|
-
|
|
5
|
+
ConversationTurnLifecycleService,
|
|
6
|
+
getPersistedSandboxState,
|
|
7
|
+
getPersistedThreadState,
|
|
8
|
+
persistThreadStateById
|
|
9
|
+
} from "./chunk-AZ7EAOBE.js";
|
|
7
10
|
import {
|
|
8
11
|
AgentInvocationBusyError,
|
|
9
12
|
AgentInvocationLimitError,
|
|
@@ -12,31 +15,27 @@ import {
|
|
|
12
15
|
agentBindingSchema,
|
|
13
16
|
agentInvocationSchema,
|
|
14
17
|
createAgentInvocationSchema
|
|
15
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-X5UY34KT.js";
|
|
16
19
|
import {
|
|
17
20
|
TurnInputCommitLostError,
|
|
18
|
-
coerceThreadArtifactsState,
|
|
19
21
|
failTurnRecord,
|
|
20
22
|
getAssistantReplyText,
|
|
21
23
|
getConversationTurnBoundaryError,
|
|
22
|
-
getPersistedSandboxState,
|
|
23
|
-
getPersistedThreadState,
|
|
24
24
|
getTerminalAssistantMessages,
|
|
25
25
|
getTurnRecord,
|
|
26
26
|
isTurnInputCommitLostError,
|
|
27
27
|
openConversationProjection,
|
|
28
|
-
persistThreadStateById,
|
|
29
28
|
saveTurnCheckpoint
|
|
30
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-AIOK6LAG.js";
|
|
31
30
|
import {
|
|
32
31
|
getConversationEventStore,
|
|
33
32
|
getConversationStore,
|
|
34
33
|
getSqlExecutor
|
|
35
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-YSB2N563.js";
|
|
36
35
|
import {
|
|
37
36
|
juniorAgentBindings,
|
|
38
37
|
juniorAgentInvocations
|
|
39
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-DU74WPIC.js";
|
|
40
39
|
|
|
41
40
|
// src/chat/agent-invocations/work.ts
|
|
42
41
|
import { z } from "zod";
|
|
@@ -461,7 +460,6 @@ function createAgentInvocationWorker(options) {
|
|
|
461
460
|
const lifecycle = new ConversationTurnLifecycleService(
|
|
462
461
|
getConversationEventStore()
|
|
463
462
|
);
|
|
464
|
-
let artifacts;
|
|
465
463
|
let sandboxRef;
|
|
466
464
|
let history;
|
|
467
465
|
try {
|
|
@@ -500,7 +498,6 @@ function createAgentInvocationWorker(options) {
|
|
|
500
498
|
conversationId: invocation.childConversationId
|
|
501
499
|
})
|
|
502
500
|
]);
|
|
503
|
-
artifacts = coerceThreadArtifactsState(persisted);
|
|
504
501
|
sandboxRef = getPersistedSandboxState(persisted);
|
|
505
502
|
history = projection.messages;
|
|
506
503
|
} catch (error) {
|
|
@@ -548,23 +545,14 @@ function createAgentInvocationWorker(options) {
|
|
|
548
545
|
reasoningLevel: invocation.reasoningLevel
|
|
549
546
|
},
|
|
550
547
|
state: {
|
|
551
|
-
artifactState: artifacts,
|
|
552
548
|
sandboxRef
|
|
553
549
|
},
|
|
554
550
|
durability: {
|
|
555
551
|
onInputCommitted: acknowledge,
|
|
556
552
|
shouldYield: context.shouldYield,
|
|
557
|
-
onArtifactStateUpdated: async (nextArtifacts) => {
|
|
558
|
-
artifacts = nextArtifacts;
|
|
559
|
-
await persistThreadStateById(invocation.childConversationId, {
|
|
560
|
-
artifacts,
|
|
561
|
-
sandboxRef
|
|
562
|
-
});
|
|
563
|
-
},
|
|
564
553
|
onSandboxRefChanged: async (nextSandboxRef) => {
|
|
565
554
|
sandboxRef = nextSandboxRef;
|
|
566
555
|
await persistThreadStateById(invocation.childConversationId, {
|
|
567
|
-
artifacts,
|
|
568
556
|
sandboxRef
|
|
569
557
|
});
|
|
570
558
|
}
|
|
@@ -620,7 +608,6 @@ function createAgentInvocationWorker(options) {
|
|
|
620
608
|
const result = outcome.result;
|
|
621
609
|
const failed = result.diagnostics.outcome !== "success";
|
|
622
610
|
await persistThreadStateById(invocation.childConversationId, {
|
|
623
|
-
artifacts: result.artifactStatePatch ? { ...artifacts, ...result.artifactStatePatch } : artifacts,
|
|
624
611
|
sandboxRef: result.sandboxRef ?? sandboxRef
|
|
625
612
|
});
|
|
626
613
|
if (result.piMessages?.length) {
|
|
@@ -4,30 +4,30 @@ import {
|
|
|
4
4
|
isConversationScopedChannel,
|
|
5
5
|
isDmChannel,
|
|
6
6
|
normalizeSlackConversationId
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SGZO7UWH.js";
|
|
8
8
|
import {
|
|
9
9
|
getConversationEventStore,
|
|
10
10
|
getDb
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YSB2N563.js";
|
|
12
12
|
import {
|
|
13
13
|
juniorConversationAnnotations,
|
|
14
14
|
juniorConversationEvents,
|
|
15
15
|
juniorIdentities,
|
|
16
16
|
juniorUsers
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DU74WPIC.js";
|
|
18
18
|
import {
|
|
19
19
|
SANDBOX_WORKSPACE_ROOT
|
|
20
20
|
} from "./chunk-EM225ITJ.js";
|
|
21
21
|
import {
|
|
22
22
|
getStateAdapter
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-ORO3PWKQ.js";
|
|
24
24
|
import {
|
|
25
25
|
botConfig,
|
|
26
26
|
completeObject,
|
|
27
27
|
embedTexts,
|
|
28
28
|
getSlackBotToken,
|
|
29
29
|
standardModelId
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-7NVJVJID.js";
|
|
31
31
|
import {
|
|
32
32
|
isActorUserId,
|
|
33
33
|
parseActorUserId
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
logInfo,
|
|
43
43
|
logWarn,
|
|
44
44
|
normalizeIdentityEmail
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-4LJO56OJ.js";
|
|
46
46
|
|
|
47
47
|
// src/chat/plugins/agent-hooks.ts
|
|
48
48
|
import {
|
|
@@ -280,6 +280,7 @@ function createPluginModel(pluginName, options = {}, runtime = {}) {
|
|
|
280
280
|
...input.system !== void 0 ? { system: input.system } : {},
|
|
281
281
|
...input.maxTokens !== void 0 ? { maxTokens: input.maxTokens } : {},
|
|
282
282
|
signal: runtime.signal,
|
|
283
|
+
promptName: `${pluginName}.structured_completion`,
|
|
283
284
|
metadata: {
|
|
284
285
|
pluginName,
|
|
285
286
|
pluginModelRole: "structured"
|
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
juniorConversations,
|
|
6
6
|
juniorIdentities,
|
|
7
7
|
juniorUsers
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DU74WPIC.js";
|
|
9
9
|
import {
|
|
10
10
|
TURN_REASONING_LEVELS,
|
|
11
11
|
getChatConfig,
|
|
12
12
|
modelProfileSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-7NVJVJID.js";
|
|
14
14
|
import {
|
|
15
15
|
juniorDestinations
|
|
16
16
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-F3B2YJ76.js";
|
|
21
21
|
import {
|
|
22
22
|
normalizeIdentityEmail
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4LJO56OJ.js";
|
|
24
24
|
|
|
25
25
|
// src/chat/conversations/sql/store.ts
|
|
26
26
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
@@ -104,7 +104,7 @@ async function existingIdentity(executor, identity) {
|
|
|
104
104
|
);
|
|
105
105
|
return rows[0];
|
|
106
106
|
}
|
|
107
|
-
async function
|
|
107
|
+
async function upsertIdentityRecord(executor, identity, linkedUserId, nowMs) {
|
|
108
108
|
const emailNormalized = normalizeIdentityEmail(identity.email);
|
|
109
109
|
const email = emailNormalized ? identity.email?.trim() || emailNormalized : void 0;
|
|
110
110
|
const existing = await existingIdentity(executor, identity);
|
|
@@ -119,7 +119,13 @@ async function upsertIdentity(executor, identity, nowMs = Date.now()) {
|
|
|
119
119
|
if (existing?.userId && verifiedUserId && existing.userId !== verifiedUserId) {
|
|
120
120
|
throw new Error("Identity verified email conflicts with linked user");
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
if (linkedUserId && verifiedUserId && linkedUserId !== verifiedUserId) {
|
|
123
|
+
throw new Error("Linked identity conflicts with verified email user");
|
|
124
|
+
}
|
|
125
|
+
if (existing?.userId && linkedUserId && existing.userId !== linkedUserId) {
|
|
126
|
+
throw new Error("Identity conflicts with linked user");
|
|
127
|
+
}
|
|
128
|
+
const userId = existing?.userId ?? linkedUserId ?? verifiedUserId;
|
|
123
129
|
const rows = await executor.db().insert(juniorIdentities).values({
|
|
124
130
|
id: randomUUID(),
|
|
125
131
|
userId: userId ?? null,
|
|
@@ -145,21 +151,27 @@ async function upsertIdentity(executor, identity, nowMs = Date.now()) {
|
|
|
145
151
|
set: {
|
|
146
152
|
kind: sql`excluded.kind`,
|
|
147
153
|
userId: sql`coalesce(${juniorIdentities.userId}, excluded.user_id)`,
|
|
148
|
-
displayName: sql`coalesce(${juniorIdentities.displayName}, excluded.display_name)`,
|
|
149
|
-
handle: sql`coalesce(${juniorIdentities.handle}, excluded.handle)`,
|
|
154
|
+
displayName: linkedUserId ? sql`coalesce(excluded.display_name, ${juniorIdentities.displayName})` : sql`coalesce(${juniorIdentities.displayName}, excluded.display_name)`,
|
|
155
|
+
handle: linkedUserId ? sql`coalesce(excluded.handle, ${juniorIdentities.handle})` : sql`coalesce(${juniorIdentities.handle}, excluded.handle)`,
|
|
150
156
|
email: sql`case when ${juniorIdentities.emailVerified} then coalesce(${juniorIdentities.email}, excluded.email) when excluded.email_verified then excluded.email else coalesce(${juniorIdentities.email}, excluded.email) end`,
|
|
151
157
|
emailNormalized: sql`case when ${juniorIdentities.emailVerified} then coalesce(${juniorIdentities.emailNormalized}, excluded.email_normalized) when excluded.email_verified then excluded.email_normalized else coalesce(${juniorIdentities.emailNormalized}, excluded.email_normalized) end`,
|
|
152
158
|
emailVerified: sql`${juniorIdentities.emailVerified} OR excluded.email_verified`,
|
|
153
159
|
avatarUrl: sql`coalesce(${juniorIdentities.avatarUrl}, excluded.avatar_url)`,
|
|
154
160
|
metadata: sql`coalesce(${juniorIdentities.metadata}, excluded.metadata_json)`,
|
|
155
161
|
updatedAt: sql`excluded.updated_at`
|
|
156
|
-
}
|
|
162
|
+
},
|
|
163
|
+
...linkedUserId ? {
|
|
164
|
+
setWhere: sql`${juniorIdentities.userId} IS NULL OR ${juniorIdentities.userId} = excluded.user_id`
|
|
165
|
+
} : {}
|
|
157
166
|
}).returning({
|
|
158
167
|
id: juniorIdentities.id,
|
|
159
168
|
userId: juniorIdentities.userId
|
|
160
169
|
});
|
|
161
170
|
const row = rows[0];
|
|
162
171
|
if (!row) {
|
|
172
|
+
if (linkedUserId) {
|
|
173
|
+
throw new Error("Identity conflicts with linked user");
|
|
174
|
+
}
|
|
163
175
|
throw new Error("Identity upsert returned no row");
|
|
164
176
|
}
|
|
165
177
|
return {
|
|
@@ -167,6 +179,32 @@ async function upsertIdentity(executor, identity, nowMs = Date.now()) {
|
|
|
167
179
|
...row.userId ? { userId: row.userId } : {}
|
|
168
180
|
};
|
|
169
181
|
}
|
|
182
|
+
async function upsertIdentity(executor, identity, nowMs = Date.now()) {
|
|
183
|
+
return await upsertIdentityRecord(executor, identity, void 0, nowMs);
|
|
184
|
+
}
|
|
185
|
+
async function upsertLinkedIdentity(executor, userId, identity, nowMs = Date.now()) {
|
|
186
|
+
return await upsertIdentityRecord(executor, identity, userId, nowMs);
|
|
187
|
+
}
|
|
188
|
+
async function deleteProviderIdentityForSlackUser(executor, slackTeamId, slackUserId, provider, providerSubjectId) {
|
|
189
|
+
const slackRows = await executor.db().select({ userId: juniorIdentities.userId }).from(juniorIdentities).where(
|
|
190
|
+
and(
|
|
191
|
+
eq(juniorIdentities.kind, "user"),
|
|
192
|
+
eq(juniorIdentities.provider, "slack"),
|
|
193
|
+
eq(juniorIdentities.providerTenantId, slackTeamId),
|
|
194
|
+
eq(juniorIdentities.providerSubjectId, slackUserId)
|
|
195
|
+
)
|
|
196
|
+
).limit(1);
|
|
197
|
+
const userId = slackRows[0]?.userId;
|
|
198
|
+
if (!userId) return;
|
|
199
|
+
await executor.db().delete(juniorIdentities).where(
|
|
200
|
+
and(
|
|
201
|
+
eq(juniorIdentities.userId, userId),
|
|
202
|
+
eq(juniorIdentities.provider, provider),
|
|
203
|
+
eq(juniorIdentities.providerTenantId, ""),
|
|
204
|
+
eq(juniorIdentities.providerSubjectId, providerSubjectId)
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
}
|
|
170
208
|
|
|
171
209
|
// src/chat/source.ts
|
|
172
210
|
import { sourceSchema } from "@sentry/junior-plugin-api";
|
|
@@ -1120,6 +1158,7 @@ var turnRoutedEventDataSchema = z3.object({
|
|
|
1120
1158
|
turnId: z3.string().min(1),
|
|
1121
1159
|
modelProfile: modelProfileSchema,
|
|
1122
1160
|
modelId: z3.string().min(1),
|
|
1161
|
+
costUsd: z3.number().finite().nonnegative().optional(),
|
|
1123
1162
|
reasoningLevel: z3.enum(TURN_REASONING_LEVELS),
|
|
1124
1163
|
confidence: z3.number().min(0).max(1).optional(),
|
|
1125
1164
|
source: z3.enum(["configured", "inherited", "router"])
|
|
@@ -1742,6 +1781,8 @@ export {
|
|
|
1742
1781
|
requireSlackDestination,
|
|
1743
1782
|
sameDestination,
|
|
1744
1783
|
upsertIdentity,
|
|
1784
|
+
upsertLinkedIdentity,
|
|
1785
|
+
deleteProviderIdentityForSlackUser,
|
|
1745
1786
|
parseSessionSource,
|
|
1746
1787
|
bindProviderConversation,
|
|
1747
1788
|
locationFromRow,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
botConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7NVJVJID.js";
|
|
4
4
|
import {
|
|
5
5
|
logWarn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4LJO56OJ.js";
|
|
7
7
|
|
|
8
8
|
// src/chat/services/short-title.ts
|
|
9
9
|
var SHORT_TITLE_MAX_LENGTH = 60;
|
|
@@ -33,6 +33,7 @@ async function generateShortTitle(args) {
|
|
|
33
33
|
const result = await args.completeText({
|
|
34
34
|
modelId: botConfig.fastModelId,
|
|
35
35
|
temperature: 0,
|
|
36
|
+
promptName: `junior.${args.kind}_title`,
|
|
36
37
|
messages: [
|
|
37
38
|
{
|
|
38
39
|
role: "user",
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-7A4M7PCV.js";
|
|
5
|
+
import "../chunk-X5UY34KT.js";
|
|
6
6
|
import "../chunk-DIB4GX3G.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-Q4R73I43.js";
|
|
8
8
|
import "../chunk-R776HKPK.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-7UQIVT6G.js";
|
|
10
|
+
import "../chunk-K4SZAP3K.js";
|
|
11
|
+
import "../chunk-AIOK6LAG.js";
|
|
12
12
|
import "../chunk-3Y47VMHV.js";
|
|
13
13
|
import "../chunk-HUO3UTAQ.js";
|
|
14
14
|
import "../chunk-5IDFPCON.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-AVZDSUFB.js";
|
|
16
|
+
import "../chunk-EFLJ2WJH.js";
|
|
17
|
+
import "../chunk-CSZINQJ2.js";
|
|
18
|
+
import "../chunk-Z4YU7Z4L.js";
|
|
19
19
|
import "../chunk-HLXXQI5Q.js";
|
|
20
20
|
import "../chunk-PDO5BLNM.js";
|
|
21
21
|
import "../chunk-UIE3R5XU.js";
|
|
22
22
|
import {
|
|
23
23
|
loadAppPluginSet
|
|
24
24
|
} from "../chunk-Y2CM7HXH.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-YHDERDRO.js";
|
|
26
|
+
import "../chunk-SGZO7UWH.js";
|
|
27
|
+
import "../chunk-YSB2N563.js";
|
|
28
|
+
import "../chunk-DU74WPIC.js";
|
|
29
29
|
import "../chunk-EM225ITJ.js";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-ORO3PWKQ.js";
|
|
31
|
+
import "../chunk-7NVJVJID.js";
|
|
32
32
|
import "../chunk-VFUK3X5B.js";
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-RXBVB2JM.js";
|
|
34
|
+
import "../chunk-YBVXBNSV.js";
|
|
35
|
+
import "../chunk-JUUKWRBE.js";
|
|
36
|
+
import "../chunk-GGB4WL5A.js";
|
|
37
37
|
import "../chunk-RUIXF3YQ.js";
|
|
38
38
|
import "../chunk-HZF5P5UN.js";
|
|
39
39
|
import "../chunk-F3B2YJ76.js";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-4LJO56OJ.js";
|
|
41
41
|
import "../chunk-6GWA276C.js";
|
|
42
42
|
import "../chunk-OOUNJNMR.js";
|
|
43
43
|
import "../chunk-H4HBKISO.js";
|
|
44
|
-
import "../chunk-
|
|
45
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-DLDRQHG5.js";
|
|
45
|
+
import "../chunk-IIOOO4FQ.js";
|
|
46
46
|
import "../chunk-MLKGABMK.js";
|
|
47
47
|
|
|
48
48
|
// src/cli/chat.ts
|
|
@@ -165,10 +165,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
165
165
|
databaseModule
|
|
166
166
|
] = await Promise.all([
|
|
167
167
|
import("../plugins-HW4VWW6G.js"),
|
|
168
|
-
import("../agent-hooks-
|
|
169
|
-
import("../catalog-runtime-
|
|
170
|
-
import("../validation-
|
|
171
|
-
import("../db-
|
|
168
|
+
import("../agent-hooks-HS6VGUPM.js"),
|
|
169
|
+
import("../catalog-runtime-M6ZTPYRV.js"),
|
|
170
|
+
import("../validation-WDTAULUF.js"),
|
|
171
|
+
import("../db-CSEW4RII.js")
|
|
172
172
|
]);
|
|
173
173
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
174
174
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -234,14 +234,14 @@ async function prepareLocalChatRun(io, pluginSet) {
|
|
|
234
234
|
await configureLocalChatPlugins(pluginSet);
|
|
235
235
|
const { setExperimentalFeatures } = await import("../experimental-HH6OM6UH.js");
|
|
236
236
|
setExperimentalFeatures({ subagents: true });
|
|
237
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
238
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
237
|
+
const { runLocalAgentTurn } = await import("../runner-U3XHSKSH.js");
|
|
238
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-FUEV5HNG.js");
|
|
239
239
|
const { createLocalOAuthState } = await import("../oauth-relay-3ZU72UGL.js");
|
|
240
240
|
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-EKPAVWQL.js");
|
|
241
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
242
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
241
|
+
const { bindSpawnAgent } = await import("../spawn-B6GDTWJ4.js");
|
|
242
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-C3HAO2BG.js");
|
|
243
243
|
const { createLocalConversationWork } = await import("../conversation-work-KATFHLG3.js");
|
|
244
|
-
const { processConversationWork } = await import("../worker-
|
|
244
|
+
const { processConversationWork } = await import("../worker-LNP4YKBM.js");
|
|
245
245
|
let agentRunner;
|
|
246
246
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
247
247
|
if (!agentRunner) {
|
package/dist/cli/check.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-YBVXBNSV.js";
|
|
4
|
+
import "../chunk-JUUKWRBE.js";
|
|
5
5
|
import {
|
|
6
6
|
parseInlinePluginManifest,
|
|
7
7
|
parsePluginManifest
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-GGB4WL5A.js";
|
|
9
9
|
import "../chunk-RUIXF3YQ.js";
|
|
10
10
|
import "../chunk-HZF5P5UN.js";
|
|
11
11
|
import "../chunk-F3B2YJ76.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-4LJO56OJ.js";
|
|
13
13
|
import "../chunk-6GWA276C.js";
|
|
14
14
|
import "../chunk-OOUNJNMR.js";
|
|
15
15
|
import "../chunk-H4HBKISO.js";
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
18
18
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
19
19
|
LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-DLDRQHG5.js";
|
|
21
|
+
import "../chunk-IIOOO4FQ.js";
|
|
22
22
|
import "../chunk-MLKGABMK.js";
|
|
23
23
|
|
|
24
24
|
// src/cli/check.ts
|
package/dist/cli/plugins.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-YNTTROJT.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginCatalogConfigFromPluginSet,
|
|
7
7
|
pluginCliRegistrationsFromPluginSet,
|
|
@@ -14,30 +14,30 @@ import {
|
|
|
14
14
|
createPluginLogger,
|
|
15
15
|
setPlugins,
|
|
16
16
|
validatePlugins
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-YHDERDRO.js";
|
|
18
|
+
import "../chunk-SGZO7UWH.js";
|
|
19
19
|
import {
|
|
20
20
|
getDb
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-YSB2N563.js";
|
|
22
|
+
import "../chunk-DU74WPIC.js";
|
|
23
23
|
import "../chunk-EM225ITJ.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-ORO3PWKQ.js";
|
|
25
|
+
import "../chunk-7NVJVJID.js";
|
|
26
26
|
import "../chunk-VFUK3X5B.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-RXBVB2JM.js";
|
|
28
28
|
import {
|
|
29
29
|
pluginCatalogRuntime
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import "../chunk-
|
|
30
|
+
} from "../chunk-JUUKWRBE.js";
|
|
31
|
+
import "../chunk-GGB4WL5A.js";
|
|
32
32
|
import "../chunk-RUIXF3YQ.js";
|
|
33
33
|
import "../chunk-HZF5P5UN.js";
|
|
34
34
|
import "../chunk-F3B2YJ76.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-4LJO56OJ.js";
|
|
36
36
|
import "../chunk-6GWA276C.js";
|
|
37
37
|
import "../chunk-OOUNJNMR.js";
|
|
38
38
|
import "../chunk-H4HBKISO.js";
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
39
|
+
import "../chunk-DLDRQHG5.js";
|
|
40
|
+
import "../chunk-IIOOO4FQ.js";
|
|
41
41
|
import "../chunk-MLKGABMK.js";
|
|
42
42
|
|
|
43
43
|
// src/cli/plugins.ts
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
create,
|
|
3
3
|
resolve
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-AVZDSUFB.js";
|
|
5
5
|
import "../chunk-EM225ITJ.js";
|
|
6
6
|
import {
|
|
7
7
|
disconnectStateAdapter
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-ORO3PWKQ.js";
|
|
9
|
+
import "../chunk-7NVJVJID.js";
|
|
10
|
+
import "../chunk-RXBVB2JM.js";
|
|
11
11
|
import {
|
|
12
12
|
pluginCatalogRuntime
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
} from "../chunk-JUUKWRBE.js";
|
|
14
|
+
import "../chunk-GGB4WL5A.js";
|
|
15
15
|
import "../chunk-RUIXF3YQ.js";
|
|
16
16
|
import "../chunk-HZF5P5UN.js";
|
|
17
17
|
import "../chunk-F3B2YJ76.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-4LJO56OJ.js";
|
|
19
19
|
import "../chunk-6GWA276C.js";
|
|
20
20
|
import "../chunk-OOUNJNMR.js";
|
|
21
21
|
import "../chunk-H4HBKISO.js";
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-DLDRQHG5.js";
|
|
23
|
+
import "../chunk-IIOOO4FQ.js";
|
|
24
24
|
import "../chunk-MLKGABMK.js";
|
|
25
25
|
|
|
26
26
|
// src/cli/snapshot-create.ts
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -8,24 +8,24 @@ import {
|
|
|
8
8
|
} from "../chunk-Y2CM7HXH.js";
|
|
9
9
|
import {
|
|
10
10
|
createJuniorSqlExecutor
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-DU74WPIC.js";
|
|
12
12
|
import {
|
|
13
13
|
getChatConfig
|
|
14
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-7NVJVJID.js";
|
|
15
15
|
import "../chunk-VFUK3X5B.js";
|
|
16
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-RXBVB2JM.js";
|
|
17
17
|
import {
|
|
18
18
|
createPluginCatalogRuntime
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-GGB4WL5A.js";
|
|
20
20
|
import "../chunk-RUIXF3YQ.js";
|
|
21
21
|
import "../chunk-HZF5P5UN.js";
|
|
22
22
|
import "../chunk-F3B2YJ76.js";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-4LJO56OJ.js";
|
|
24
24
|
import "../chunk-6GWA276C.js";
|
|
25
25
|
import "../chunk-OOUNJNMR.js";
|
|
26
26
|
import "../chunk-H4HBKISO.js";
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-DLDRQHG5.js";
|
|
28
|
+
import "../chunk-IIOOO4FQ.js";
|
|
29
29
|
import "../chunk-MLKGABMK.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/conversations/sql/migrations.ts
|