@sentry/junior 0.124.1 → 0.125.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-2YRIRKNT.js → agent-hooks-MF5UZRCO.js} +8 -8
- package/dist/api/conversations/auxiliary-costs.d.ts +6 -0
- package/dist/api/conversations/detail.d.ts +10 -0
- package/dist/api/conversations/list.d.ts +11 -0
- package/dist/api/conversations/projection.d.ts +2 -1
- package/dist/api/locations/detail.d.ts +20 -0
- package/dist/api/people/profile.d.ts +10 -0
- package/dist/api/people/shared.d.ts +36 -0
- package/dist/api/plugin-reports.d.ts +1 -0
- package/dist/api/schema/conversation.d.ts +40 -0
- package/dist/api/schema/location.d.ts +10 -0
- package/dist/api/schema/person.d.ts +10 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +4 -2
- package/dist/api.js +322 -169
- package/dist/app.js +22 -23
- package/dist/{catalog-runtime-R4N3NYWQ.js → catalog-runtime-V6SJTUV7.js} +5 -5
- package/dist/chat/agent/prompt.d.ts +1 -0
- package/dist/chat/conversations/history.d.ts +4 -2
- package/dist/chat/conversations/sql/conversation-row.d.ts +7 -4
- package/dist/chat/conversations/sql/store.d.ts +2 -1
- package/dist/chat/conversations/store.d.ts +9 -1
- package/dist/chat/pi/client.d.ts +1 -0
- package/dist/chat/plugins/agent-hooks.d.ts +1 -0
- package/dist/chat/plugins/conversation-event-stats.d.ts +3 -0
- package/dist/chat/plugins/conversation-events.d.ts +1 -1
- package/dist/chat/slack/source-link.d.ts +5 -0
- package/dist/chat/source.d.ts +16 -0
- package/dist/{chunk-6RHGQF6H.js → chunk-2R5MASH3.js} +1 -1
- package/dist/{chunk-SFYFRZ6A.js → chunk-2U5CLBYF.js} +1 -1
- package/dist/{chunk-AYQZCJZJ.js → chunk-6ZBSTNYN.js} +14 -0
- package/dist/{chunk-P2RFRHJS.js → chunk-7K57FJXR.js} +6 -5
- package/dist/{chunk-S7KM4EQY.js → chunk-CAPBVX4L.js} +2 -2
- package/dist/{chunk-V6O47TCR.js → chunk-EXD2Z3YR.js} +2 -2
- package/dist/{chunk-TWHNWGXY.js → chunk-HT7DSLKL.js} +16 -14
- package/dist/{chunk-PR3M62LK.js → chunk-HX236W2U.js} +6 -4
- package/dist/{chunk-B3Y7UZVA.js → chunk-IHNBJHEP.js} +1 -1
- package/dist/{chunk-5FEVPYXP.js → chunk-IS4DGI5J.js} +73 -17
- package/dist/{chunk-LCIYVQBM.js → chunk-JT3YMQR3.js} +7 -9
- package/dist/{chunk-J45CX6IY.js → chunk-K6MQWEEJ.js} +7 -7
- package/dist/{chunk-ZOYZCEYE.js → chunk-KN7QI56S.js} +23 -3
- package/dist/{chunk-GI56KFRQ.js → chunk-LG5TXWXI.js} +11 -11
- package/dist/{chunk-5HFV6BEV.js → chunk-MVYNJECP.js} +1 -1
- package/dist/{chunk-MXVTNDYF.js → chunk-MYKSUTUV.js} +4 -4
- package/dist/{chunk-7SCPUYHG.js → chunk-NM3PMQS6.js} +1 -1
- package/dist/{chunk-XDX3QTFA.js → chunk-ODB55JM7.js} +162 -15
- package/dist/{chunk-OAUFSZ54.js → chunk-Q3UF3K77.js} +2 -2
- package/dist/{chunk-GCGJGSQL.js → chunk-S4PUICSB.js} +2 -0
- package/dist/{chunk-PE44LDDQ.js → chunk-UTL3MHPC.js} +1 -0
- package/dist/{chunk-WTB3ATMR.js → chunk-XJYGLTYI.js} +1 -1
- package/dist/{chunk-BBSB62UJ.js → chunk-ZXGBLAYQ.js} +1 -1
- package/dist/cli/chat.js +23 -23
- package/dist/cli/check.js +6 -6
- package/dist/cli/plugins.js +11 -11
- package/dist/cli/snapshot-create.js +8 -8
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/conversations.d.ts +20 -0
- package/dist/db/schema.d.ts +19 -0
- package/dist/{db-NPESWXWE.js → db-JSDSWK7T.js} +6 -6
- package/dist/instrumentation.js +2 -2
- package/dist/nitro.js +2 -2
- package/dist/{oauth-callback-server-V6OVD7NI.js → oauth-callback-server-UMS2T3HN.js} +16 -17
- package/dist/reporting-schema.d.ts +2 -0
- package/dist/{runner-ORVU25XU.js → runner-RGOANIRV.js} +11 -12
- package/dist/{skills-Y3OSYR6V.js → skills-GBLPOQOD.js} +6 -6
- package/dist/{validation-4MRKY64W.js → validation-BMQY6CD4.js} +6 -6
- package/dist/version.js +1 -1
- package/migrations/0013_conversation_session_source.sql +38 -0
- package/migrations/meta/0013_snapshot.json +1250 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +6 -6
- package/dist/chunk-DVSAX7MS.js +0 -55
package/dist/app.js
CHANGED
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
startConversationWork,
|
|
51
51
|
startSlackProcessingReaction,
|
|
52
52
|
stripLeadingBotMention
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-LG5TXWXI.js";
|
|
54
54
|
import "./chunk-FA6POGLH.js";
|
|
55
55
|
import {
|
|
56
56
|
ConversationTurnLifecycleService,
|
|
@@ -65,16 +65,15 @@ import {
|
|
|
65
65
|
processPluginTask,
|
|
66
66
|
requireTurnFailureEventId,
|
|
67
67
|
scheduleSessionCompletedPluginTasks
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-JT3YMQR3.js";
|
|
69
69
|
import {
|
|
70
70
|
GET,
|
|
71
71
|
conversationVisibilityFromSlackChannelType,
|
|
72
72
|
resolveSlackChannelTypeFromMessage,
|
|
73
73
|
resolveSlackConversationContext
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-EXD2Z3YR.js";
|
|
75
75
|
import "./chunk-4CODA7P5.js";
|
|
76
|
-
import "./chunk-
|
|
77
|
-
import "./chunk-PE44LDDQ.js";
|
|
76
|
+
import "./chunk-UTL3MHPC.js";
|
|
78
77
|
import {
|
|
79
78
|
ConversationQueueMessageRejectedError,
|
|
80
79
|
conversationQueueMessageSchema,
|
|
@@ -91,7 +90,7 @@ import {
|
|
|
91
90
|
import {
|
|
92
91
|
validatePluginEgressCredentialHooks,
|
|
93
92
|
validatePluginRegistrations
|
|
94
|
-
} from "./chunk-
|
|
93
|
+
} from "./chunk-IHNBJHEP.js";
|
|
95
94
|
import {
|
|
96
95
|
defineJuniorPlugins,
|
|
97
96
|
pluginCatalogConfigFromEnv,
|
|
@@ -124,7 +123,7 @@ import {
|
|
|
124
123
|
setConfigDefaults,
|
|
125
124
|
shouldEmitDevAgentTrace,
|
|
126
125
|
shouldPropagateSandboxEgressTrace
|
|
127
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-HT7DSLKL.js";
|
|
128
127
|
import "./chunk-DIB4GX3G.js";
|
|
129
128
|
import {
|
|
130
129
|
RetryableDeliveryError,
|
|
@@ -135,7 +134,7 @@ import {
|
|
|
135
134
|
formatProviderLabel,
|
|
136
135
|
postSlackMessage,
|
|
137
136
|
startOAuthFlow
|
|
138
|
-
} from "./chunk-
|
|
137
|
+
} from "./chunk-K6MQWEEJ.js";
|
|
139
138
|
import {
|
|
140
139
|
ConversationTurnBoundaryError,
|
|
141
140
|
CooperativeTurnYieldError,
|
|
@@ -191,11 +190,11 @@ import {
|
|
|
191
190
|
trimTrailingAssistantMessages,
|
|
192
191
|
updateConversationStats,
|
|
193
192
|
upsertConversationMessage
|
|
194
|
-
} from "./chunk-
|
|
193
|
+
} from "./chunk-7K57FJXR.js";
|
|
195
194
|
import "./chunk-HDSDCEPK.js";
|
|
196
|
-
import "./chunk-
|
|
197
|
-
import "./chunk-
|
|
198
|
-
import "./chunk-
|
|
195
|
+
import "./chunk-MYKSUTUV.js";
|
|
196
|
+
import "./chunk-Q3UF3K77.js";
|
|
197
|
+
import "./chunk-HX236W2U.js";
|
|
199
198
|
import "./chunk-PDO5BLNM.js";
|
|
200
199
|
import "./chunk-UIE3R5XU.js";
|
|
201
200
|
import {
|
|
@@ -219,7 +218,7 @@ import {
|
|
|
219
218
|
validatePlugins,
|
|
220
219
|
verifyScheduledTaskCredentialSubject,
|
|
221
220
|
verifySlackDirectCredentialSubject
|
|
222
|
-
} from "./chunk-
|
|
221
|
+
} from "./chunk-ODB55JM7.js";
|
|
223
222
|
import {
|
|
224
223
|
contextProvenance,
|
|
225
224
|
createSlackDestination,
|
|
@@ -230,16 +229,16 @@ import {
|
|
|
230
229
|
instructionProvenanceFor,
|
|
231
230
|
requireSlackDestination,
|
|
232
231
|
withConversationEventLock
|
|
233
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-IS4DGI5J.js";
|
|
234
233
|
import {
|
|
235
234
|
juniorConversationEvents,
|
|
236
235
|
juniorConversations
|
|
237
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-S4PUICSB.js";
|
|
238
237
|
import {
|
|
239
238
|
acquireActiveLock,
|
|
240
239
|
getStateAdapter,
|
|
241
240
|
sleep
|
|
242
|
-
} from "./chunk-
|
|
241
|
+
} from "./chunk-XJYGLTYI.js";
|
|
243
242
|
import {
|
|
244
243
|
STANDARD_MODEL_PROFILE,
|
|
245
244
|
botConfig,
|
|
@@ -257,18 +256,18 @@ import {
|
|
|
257
256
|
modelIdForProfile,
|
|
258
257
|
setSlackReactionConfig,
|
|
259
258
|
standardModelId
|
|
260
|
-
} from "./chunk-
|
|
259
|
+
} from "./chunk-KN7QI56S.js";
|
|
261
260
|
import {
|
|
262
261
|
juniorDestinations
|
|
263
262
|
} from "./chunk-VFUK3X5B.js";
|
|
264
263
|
import {
|
|
265
264
|
parseSlackThreadId
|
|
266
265
|
} from "./chunk-S7G34U75.js";
|
|
267
|
-
import "./chunk-
|
|
266
|
+
import "./chunk-CAPBVX4L.js";
|
|
268
267
|
import {
|
|
269
268
|
pluginCatalogRuntime
|
|
270
|
-
} from "./chunk-
|
|
271
|
-
import "./chunk-
|
|
269
|
+
} from "./chunk-NM3PMQS6.js";
|
|
270
|
+
import "./chunk-2U5CLBYF.js";
|
|
272
271
|
import {
|
|
273
272
|
credentialSubjectSchema
|
|
274
273
|
} from "./chunk-W3U3YQYI.js";
|
|
@@ -295,7 +294,7 @@ import {
|
|
|
295
294
|
withContext,
|
|
296
295
|
withLogContext,
|
|
297
296
|
withSpan
|
|
298
|
-
} from "./chunk-
|
|
297
|
+
} from "./chunk-MVYNJECP.js";
|
|
299
298
|
import {
|
|
300
299
|
toOptionalString
|
|
301
300
|
} from "./chunk-OB42YVAE.js";
|
|
@@ -310,10 +309,10 @@ import "./chunk-OOUNJNMR.js";
|
|
|
310
309
|
import "./chunk-H4HBKISO.js";
|
|
311
310
|
import {
|
|
312
311
|
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
|
|
313
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-2R5MASH3.js";
|
|
314
313
|
import {
|
|
315
314
|
JUNIOR_VERSION
|
|
316
|
-
} from "./chunk-
|
|
315
|
+
} from "./chunk-ZXGBLAYQ.js";
|
|
317
316
|
import "./chunk-MLKGABMK.js";
|
|
318
317
|
|
|
319
318
|
// src/app.ts
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-NM3PMQS6.js";
|
|
4
|
+
import "./chunk-2U5CLBYF.js";
|
|
5
5
|
import "./chunk-W3U3YQYI.js";
|
|
6
6
|
import "./chunk-HZF5P5UN.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-MVYNJECP.js";
|
|
8
8
|
import "./chunk-OB42YVAE.js";
|
|
9
9
|
import "./chunk-F3B2YJ76.js";
|
|
10
10
|
import "./chunk-6GWA276C.js";
|
|
11
11
|
import "./chunk-OOUNJNMR.js";
|
|
12
12
|
import "./chunk-H4HBKISO.js";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-2R5MASH3.js";
|
|
14
|
+
import "./chunk-ZXGBLAYQ.js";
|
|
15
15
|
import "./chunk-MLKGABMK.js";
|
|
16
16
|
export {
|
|
17
17
|
pluginCatalogRuntime
|
|
@@ -72,6 +72,7 @@ export declare function assemblePrompt(args: {
|
|
|
72
72
|
resumedFromSessionRecord: boolean;
|
|
73
73
|
routing: AgentRunRouting;
|
|
74
74
|
spanContext: LogContext;
|
|
75
|
+
turnId: string;
|
|
75
76
|
toolGuidance: Array<{
|
|
76
77
|
name: string;
|
|
77
78
|
promptGuidelines: AnyToolDefinition["promptGuidelines"];
|
|
@@ -944,8 +944,10 @@ export interface ConversationEventPage {
|
|
|
944
944
|
}
|
|
945
945
|
/** Persist and read the canonical per-conversation event log. */
|
|
946
946
|
export interface ConversationEventStore {
|
|
947
|
-
/** Append events atomically,
|
|
948
|
-
append(conversationId: string, events: NewConversationEvent[]
|
|
947
|
+
/** Append events atomically, optionally preserving conversation activity. */
|
|
948
|
+
append(conversationId: string, events: NewConversationEvent[], options?: {
|
|
949
|
+
activity?: "preserve";
|
|
950
|
+
}): Promise<void>;
|
|
949
951
|
/** Replace active model history with a compaction or handoff event. */
|
|
950
952
|
replaceHistory(conversationId: string, replacement: HistoryReplacement): Promise<void>;
|
|
951
953
|
/** One event selected by its retry-stable key across history versions. */
|
|
@@ -6,9 +6,12 @@ import type { JuniorSqlDatabase } from "@/db/db";
|
|
|
6
6
|
*
|
|
7
7
|
* First contact creates the row; every later content write advances the
|
|
8
8
|
* activity clock so retention mirrors append-refresh semantics (each content
|
|
9
|
-
* append refreshes the retention window).
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* append refreshes the retention window). Background observations may opt out
|
|
10
|
+
* and leave an existing row unchanged. The timestamp is content-intrinsic (the
|
|
11
|
+
* first item's `createdAtMs`), and `greatest(...)` guarantees a backfilled or
|
|
12
|
+
* imported historical write — which carries an old timestamp — can never
|
|
12
13
|
* regress `last_activity_at`.
|
|
13
14
|
*/
|
|
14
|
-
export declare function ensureConversationRow(executor: JuniorSqlDatabase, conversationId: string, atMs: number
|
|
15
|
+
export declare function ensureConversationRow(executor: JuniorSqlDatabase, conversationId: string, atMs: number, options?: {
|
|
16
|
+
activity?: "preserve";
|
|
17
|
+
}): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Destination } from "@sentry/junior-plugin-api";
|
|
1
|
+
import type { Destination, Source } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
3
3
|
import type { StoredSlackActor } from "@/chat/actor";
|
|
4
4
|
import type { JuniorSqlDatabase } from "@/db/db";
|
|
@@ -18,6 +18,7 @@ export declare class SqlStore implements ConversationStore {
|
|
|
18
18
|
nowMs?: number;
|
|
19
19
|
actor?: StoredSlackActor;
|
|
20
20
|
source?: ConversationSource;
|
|
21
|
+
sessionSource?: Source;
|
|
21
22
|
title?: string;
|
|
22
23
|
visibility?: ConversationPrivacy;
|
|
23
24
|
}): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Destination } from "@sentry/junior-plugin-api";
|
|
1
|
+
import type { Destination, Source } from "@sentry/junior-plugin-api";
|
|
2
2
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
3
3
|
import type { StoredSlackActor } from "@/chat/actor";
|
|
4
|
+
import type { SessionSource } from "@/chat/source";
|
|
4
5
|
import type { AgentTurnUsage } from "@/chat/usage";
|
|
5
6
|
export type ConversationSource = "api" | "internal" | "local" | "plugin" | "resource_event" | "scheduler" | "slack";
|
|
6
7
|
export type ConversationStatus = "awaiting_resume" | "failed" | "idle" | "pending" | "running";
|
|
@@ -27,6 +28,11 @@ export interface Conversation {
|
|
|
27
28
|
actor?: StoredSlackActor;
|
|
28
29
|
schemaVersion: 1;
|
|
29
30
|
source?: ConversationSource;
|
|
31
|
+
/**
|
|
32
|
+
* Structured inbound Source locator for this conversation session.
|
|
33
|
+
* Session-stable (Slack thread anchor, not per-message ts). Set-once.
|
|
34
|
+
*/
|
|
35
|
+
sessionSource?: SessionSource;
|
|
30
36
|
title?: string;
|
|
31
37
|
updatedAtMs: number;
|
|
32
38
|
/**
|
|
@@ -57,6 +63,8 @@ export interface ConversationStore {
|
|
|
57
63
|
nowMs?: number;
|
|
58
64
|
actor?: StoredSlackActor;
|
|
59
65
|
source?: ConversationSource;
|
|
66
|
+
/** Source normalized to a stable session locator; set-once when absent. */
|
|
67
|
+
sessionSource?: Source;
|
|
60
68
|
title?: string;
|
|
61
69
|
/** Source-confirmed visibility from the current event's signal only. */
|
|
62
70
|
visibility?: ConversationPrivacy;
|
package/dist/chat/pi/client.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export declare function getPluginSystemPromptContributions(source: ToolRuntimeCo
|
|
|
48
48
|
/** Collect request-scoped plugin prompt contributions. */
|
|
49
49
|
export declare function getPluginUserPromptContributions(args: {
|
|
50
50
|
context: Pick<ToolRuntimeContext, "conversationId" | "destination" | "actor" | "source" | "userText">;
|
|
51
|
+
turnId?: string;
|
|
51
52
|
}): Promise<PluginPromptContributionContext[]>;
|
|
52
53
|
/** Collect turn-scoped tools exposed by plugins. */
|
|
53
54
|
export declare function getPluginTools(context: ToolRuntimeContext): Record<string, AnyToolDefinition>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PluginConversationEventStats, PluginRegistration } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** Create aggregate event-cost reads bound to one plugin's registered namespace. */
|
|
3
|
+
export declare function createPluginConversationEventStats(plugin: PluginRegistration, now?: () => number): PluginConversationEventStats;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ConversationEventPresentation, PluginConversationEvents, PluginRegistration } from "@sentry/junior-plugin-api";
|
|
2
|
-
/** Create a conversation-bound writer for one plugin
|
|
2
|
+
/** Create a conversation-bound writer for one plugin operation. */
|
|
3
3
|
export declare function createPluginConversationEvents(args: {
|
|
4
4
|
conversationId: string;
|
|
5
5
|
operationId: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Source } from "@sentry/junior-plugin-api";
|
|
2
|
+
/** Source coordinates reduced to the stable locator for one conversation. */
|
|
3
|
+
export type SessionSource = Extract<Source, {
|
|
4
|
+
platform: "local";
|
|
5
|
+
}> | (Omit<Extract<Source, {
|
|
6
|
+
platform: "slack";
|
|
7
|
+
}>, "messageTs" | "threadTs"> & {
|
|
8
|
+
threadTs: string;
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Normalize a turn Source into the session-stable locator persisted on a
|
|
12
|
+
* conversation. Drops per-message timestamps; requires a Slack thread anchor.
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeSessionSource(value: Source | undefined): SessionSource | undefined;
|
|
15
|
+
/** Parse a serialized Source into the stable locator stored on a conversation. */
|
|
16
|
+
export declare function parseSessionSource(value: unknown): SessionSource | undefined;
|
|
@@ -74,10 +74,22 @@ var actorIdentitySchema = z2.object({
|
|
|
74
74
|
slackUserId: z2.string().optional(),
|
|
75
75
|
slackUserName: z2.string().optional()
|
|
76
76
|
}).strict();
|
|
77
|
+
var conversationAuxiliaryCostsSchema = z2.object({
|
|
78
|
+
costUsd: z2.number().finite().nonnegative(),
|
|
79
|
+
operations: z2.array(
|
|
80
|
+
z2.object({
|
|
81
|
+
costUsd: z2.number().finite().nonnegative(),
|
|
82
|
+
events: z2.number().int().positive(),
|
|
83
|
+
name: z2.string().min(1),
|
|
84
|
+
namespace: z2.string().min(1)
|
|
85
|
+
}).strict()
|
|
86
|
+
).min(1)
|
|
87
|
+
}).strict();
|
|
77
88
|
var conversationSummaryReportSchema = z2.object({
|
|
78
89
|
displayTitle: z2.string(),
|
|
79
90
|
cumulativeDurationMs: z2.number(),
|
|
80
91
|
cumulativeUsage: conversationUsageSchema.optional(),
|
|
92
|
+
auxiliaryCosts: conversationAuxiliaryCostsSchema.optional(),
|
|
81
93
|
conversationId: z2.string(),
|
|
82
94
|
isParticipant: z2.boolean(),
|
|
83
95
|
status: conversationReportStatusSchema,
|
|
@@ -92,6 +104,7 @@ var conversationSummaryReportSchema = z2.object({
|
|
|
92
104
|
channelNameRedacted: z2.boolean().optional(),
|
|
93
105
|
locationId: z2.string().optional(),
|
|
94
106
|
sentryTraceUrl: z2.string().optional(),
|
|
107
|
+
sourceUrl: z2.string().url().optional(),
|
|
95
108
|
traceId: z2.string().optional()
|
|
96
109
|
}).strict();
|
|
97
110
|
var conversationReportMessageEventDataSchema = z2.object({
|
|
@@ -592,6 +605,7 @@ export {
|
|
|
592
605
|
conversationFeedQuerySchema,
|
|
593
606
|
archiveConversationBodySchema,
|
|
594
607
|
archiveConversationResponseSchema,
|
|
608
|
+
conversationAuxiliaryCostsSchema,
|
|
595
609
|
conversationSummaryReportSchema,
|
|
596
610
|
conversationReportEventDataSchema,
|
|
597
611
|
conversationReportEventSchema,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
agentTurnUsageSchema,
|
|
5
5
|
authenticationLinkedEvent,
|
|
6
6
|
authenticationUnlinkedEvent
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HX236W2U.js";
|
|
8
8
|
import {
|
|
9
9
|
agentHistoryItemSchema,
|
|
10
10
|
contextProvenance,
|
|
@@ -16,17 +16,17 @@ import {
|
|
|
16
16
|
instructionProvenanceFor,
|
|
17
17
|
sanitizePostgresJson,
|
|
18
18
|
withConversationEventLock
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IS4DGI5J.js";
|
|
20
20
|
import {
|
|
21
21
|
getStateAdapter,
|
|
22
22
|
sleep
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XJYGLTYI.js";
|
|
24
24
|
import {
|
|
25
25
|
botConfig,
|
|
26
26
|
escapeXml,
|
|
27
27
|
resolveGatewayModel,
|
|
28
28
|
unwrapCurrentInstruction
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-KN7QI56S.js";
|
|
30
30
|
import {
|
|
31
31
|
toStoredSlackActor
|
|
32
32
|
} from "./chunk-HZF5P5UN.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
logException,
|
|
36
36
|
logWarn,
|
|
37
37
|
setSpanAttributes
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MVYNJECP.js";
|
|
39
39
|
import {
|
|
40
40
|
isRecord,
|
|
41
41
|
toOptionalNumber,
|
|
@@ -1502,6 +1502,7 @@ async function recordConversationActivityMetadata(args) {
|
|
|
1502
1502
|
nowMs: args.nowMs,
|
|
1503
1503
|
actor: sessionLogActor(args.summary.actor),
|
|
1504
1504
|
source,
|
|
1505
|
+
...args.summary.source ? { sessionSource: args.summary.source } : {},
|
|
1505
1506
|
visibility: args.destinationVisibility
|
|
1506
1507
|
});
|
|
1507
1508
|
await conversationStore.recordExecution({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
healthReportSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UTL3MHPC.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeSlackConversationId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ODB55JM7.js";
|
|
7
7
|
import {
|
|
8
8
|
parseSlackThreadId
|
|
9
9
|
} from "./chunk-S7G34U75.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
toMcpProviderError,
|
|
31
31
|
toolInvocationDestination,
|
|
32
32
|
uploadFilesToConversation
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-K6MQWEEJ.js";
|
|
34
34
|
import {
|
|
35
35
|
CooperativeTurnYieldError,
|
|
36
36
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
stripRuntimeTurnContext,
|
|
81
81
|
trimTrailingAssistantMessages,
|
|
82
82
|
updateConversationStats
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-7K57FJXR.js";
|
|
84
84
|
import {
|
|
85
85
|
parseSandboxEgressAuthRequiredSignal,
|
|
86
86
|
parseSandboxEgressPermissionDeniedSignal,
|
|
@@ -104,14 +104,14 @@ import {
|
|
|
104
104
|
runNonInteractiveCommand,
|
|
105
105
|
throwSandboxOperationError,
|
|
106
106
|
wrapSandboxSetupError
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-MYKSUTUV.js";
|
|
108
108
|
import {
|
|
109
109
|
incrementStat
|
|
110
|
-
} from "./chunk-
|
|
110
|
+
} from "./chunk-Q3UF3K77.js";
|
|
111
111
|
import {
|
|
112
112
|
addAgentTurnUsage,
|
|
113
113
|
hasAgentTurnUsage
|
|
114
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-HX236W2U.js";
|
|
115
115
|
import {
|
|
116
116
|
privateTraceResultAttributes
|
|
117
117
|
} from "./chunk-UIE3R5XU.js";
|
|
@@ -129,7 +129,7 @@ import {
|
|
|
129
129
|
normalizeSlackConversationId,
|
|
130
130
|
resolveChannelCapabilities,
|
|
131
131
|
withSlackRetries
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-ODB55JM7.js";
|
|
133
133
|
import {
|
|
134
134
|
KNOWN_CONVERSATION_EVENT_TYPES,
|
|
135
135
|
contextProvenance,
|
|
@@ -139,7 +139,7 @@ import {
|
|
|
139
139
|
instructionActors,
|
|
140
140
|
instructionProvenanceFor,
|
|
141
141
|
sameActorIdentity
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-IS4DGI5J.js";
|
|
143
143
|
import {
|
|
144
144
|
SANDBOX_DATA_ROOT,
|
|
145
145
|
SANDBOX_SKILLS_ROOT,
|
|
@@ -149,7 +149,7 @@ import {
|
|
|
149
149
|
sandboxSkillFile,
|
|
150
150
|
sandboxSkillPathResolution,
|
|
151
151
|
sleep
|
|
152
|
-
} from "./chunk-
|
|
152
|
+
} from "./chunk-XJYGLTYI.js";
|
|
153
153
|
import {
|
|
154
154
|
ACTIVE_TURN_COMPACTION_SUMMARY_PREFIX,
|
|
155
155
|
COMPACTION_SUMMARY_PREFIX,
|
|
@@ -183,7 +183,7 @@ import {
|
|
|
183
183
|
renderCurrentInstruction,
|
|
184
184
|
resolveGatewayModel,
|
|
185
185
|
unwrapCurrentInstruction
|
|
186
|
-
} from "./chunk-
|
|
186
|
+
} from "./chunk-KN7QI56S.js";
|
|
187
187
|
import {
|
|
188
188
|
canExposeConversationPayload,
|
|
189
189
|
parseSlackThreadId,
|
|
@@ -200,10 +200,10 @@ import {
|
|
|
200
200
|
findSkillByName,
|
|
201
201
|
loadSkillsByName,
|
|
202
202
|
parseSkillInvocation
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-CAPBVX4L.js";
|
|
204
204
|
import {
|
|
205
205
|
pluginCatalogRuntime
|
|
206
|
-
} from "./chunk-
|
|
206
|
+
} from "./chunk-NM3PMQS6.js";
|
|
207
207
|
import {
|
|
208
208
|
CredentialUnavailableError,
|
|
209
209
|
OAuthProviderError,
|
|
@@ -211,7 +211,7 @@ import {
|
|
|
211
211
|
getOAuthProviderErrorAttributes,
|
|
212
212
|
resolveAuthTokenPlaceholder,
|
|
213
213
|
resolvePluginCommandEnv
|
|
214
|
-
} from "./chunk-
|
|
214
|
+
} from "./chunk-2U5CLBYF.js";
|
|
215
215
|
import {
|
|
216
216
|
credentialUserSubjectId
|
|
217
217
|
} from "./chunk-W3U3YQYI.js";
|
|
@@ -235,7 +235,7 @@ import {
|
|
|
235
235
|
summarizeMessageText,
|
|
236
236
|
withLogContext,
|
|
237
237
|
withSpan
|
|
238
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-MVYNJECP.js";
|
|
239
239
|
import {
|
|
240
240
|
parseSlackChannelId,
|
|
241
241
|
parseSlackMessageTs,
|
|
@@ -2374,7 +2374,8 @@ async function assemblePrompt(args) {
|
|
|
2374
2374
|
);
|
|
2375
2375
|
const baseInstructions = [buildSystemPrompt({ source }), pluginSystemPrompt].filter((section) => Boolean(section)).join("\n\n");
|
|
2376
2376
|
const pluginUserPromptContributions = !shouldPromptAgent || replayedPromptContent ? [] : await getPluginUserPromptContributions({
|
|
2377
|
-
context: args.toolRuntimeContext
|
|
2377
|
+
context: args.toolRuntimeContext,
|
|
2378
|
+
turnId: args.turnId
|
|
2378
2379
|
});
|
|
2379
2380
|
const turnContextPrompt = needsBootstrapContextForPrompt || pluginUserPromptContributions.length > 0 ? buildTurnContextPrompt({
|
|
2380
2381
|
availableSkills: args.availableSkills,
|
|
@@ -15881,6 +15882,7 @@ async function executeAgentRunInPrivacyContext(request, conversationPrivacy, run
|
|
|
15881
15882
|
resumedFromSessionRecord,
|
|
15882
15883
|
routing,
|
|
15883
15884
|
spanContext,
|
|
15885
|
+
turnId,
|
|
15884
15886
|
toolGuidance: wiring.toolGuidance,
|
|
15885
15887
|
toolRuntimeContext: wiring.toolRuntimeContext,
|
|
15886
15888
|
userContentParts
|
|
@@ -57,7 +57,10 @@ var authenticationUnlinkedEvent = defineConversationEvent({
|
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
-
var NATIVE_EVENT_DEFINITIONS = [
|
|
60
|
+
var NATIVE_EVENT_DEFINITIONS = [
|
|
61
|
+
authenticationLinkedEvent,
|
|
62
|
+
authenticationUnlinkedEvent
|
|
63
|
+
];
|
|
61
64
|
function getJuniorNativeEventDefinition(args) {
|
|
62
65
|
return NATIVE_EVENT_DEFINITIONS.find(
|
|
63
66
|
(definition) => definition.eventName === args.name && definition.version === args.version
|
|
@@ -67,9 +70,8 @@ function renderJuniorNativeConversationEvent(args) {
|
|
|
67
70
|
if (args.namespace !== JUNIOR_NATIVE_EVENT_NAMESPACE) return void 0;
|
|
68
71
|
const definition = getJuniorNativeEventDefinition(args);
|
|
69
72
|
if (!definition) return void 0;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
);
|
|
73
|
+
const presentation = definition.renderEvent(definition.parse(args.content));
|
|
74
|
+
return presentation === void 0 ? void 0 : conversationEventPresentationSchema.parse(presentation);
|
|
73
75
|
}
|
|
74
76
|
|
|
75
77
|
// src/chat/usage.ts
|