@sentry/junior 0.78.0 → 0.80.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-OFDNZJB2.js → agent-hooks-ZGTDOXQY.js} +11 -10
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.js +39 -41
- package/dist/catalog-runtime-IVWRAPSI.js +12 -0
- package/dist/chat/conversation-privacy.d.ts +4 -0
- package/dist/chat/plugins/catalog-runtime.d.ts +1 -0
- package/dist/chat/plugins/registry.d.ts +27 -26
- package/dist/chat/sentry-payload-filter.d.ts +14 -0
- package/dist/chat/sentry.d.ts +1 -1
- package/dist/chat/state/session-log.d.ts +84 -0
- package/dist/chat/tools/advisor/tool.d.ts +1 -0
- package/dist/chat/tools/definition.d.ts +6 -0
- package/dist/{chunk-LUNMJQ7D.js → chunk-2AJ4TEKE.js} +6 -6
- package/dist/{chunk-ST6YNAXG.js → chunk-3DA7X2U3.js} +6 -3
- package/dist/{chunk-PNGAJ75P.js → chunk-3JKTVW4R.js} +7 -8
- package/dist/{chunk-Q6XFTRV5.js → chunk-4XHCVBXH.js} +2 -2
- package/dist/{chunk-Z4CIQ3EB.js → chunk-66NX7MNW.js} +1 -1
- package/dist/{chunk-Q3XNY442.js → chunk-6APU57E6.js} +1 -3
- package/dist/{chunk-T77LUIX3.js → chunk-ABRNFE3N.js} +7 -211
- package/dist/chunk-DR75T7J3.js +225 -0
- package/dist/{chunk-KIDP757T.js → chunk-FAGWUF44.js} +17 -7
- package/dist/{chunk-OJ53FYVG.js → chunk-FTMXFBDC.js} +14 -0
- package/dist/{chunk-RARSKPVT.js → chunk-GUO4EE7L.js} +2 -2
- package/dist/{chunk-2ECJXSVQ.js → chunk-IOBSRZK5.js} +1 -1
- package/dist/{chunk-EJN6G5A2.js → chunk-KF7522P3.js} +5 -19
- package/dist/{chunk-C2YBH4S6.js → chunk-LX5GBMEP.js} +6 -6
- package/dist/{chunk-237T7XAN.js → chunk-PQ2U2AO3.js} +3 -3
- package/dist/{chunk-YLVJRYTD.js → chunk-TW23AT22.js} +190 -196
- package/dist/{chunk-2MSW5BZY.js → chunk-W2QGQCKG.js} +129 -62
- package/dist/{chunk-Y3EG7S7P.js → chunk-WCXVEQPI.js} +7 -8
- package/dist/{chunk-LXTPBU4K.js → chunk-X2FL5ZH5.js} +1 -1
- package/dist/{chunk-SSWBYEFH.js → chunk-Y3YUOEAZ.js} +13 -7
- package/dist/{chunk-QDQVOMBA.js → chunk-YA2JCC7G.js} +165 -14
- package/dist/{chunk-VALUBQ7R.js → chunk-ZPCGQRFJ.js} +1 -1
- package/dist/cli/chat.js +12 -10
- package/dist/cli/check.js +7 -7
- package/dist/cli/main.js +1 -1
- package/dist/cli/plugins.js +17 -16
- package/dist/cli/snapshot-warmup.js +14 -15
- package/dist/cli/upgrade.js +20 -22
- package/dist/db-GQJKBX5W.js +18 -0
- package/dist/instrumentation.js +76 -3
- package/dist/nitro.js +8 -7
- package/dist/reporting/conversations.d.ts +30 -0
- package/dist/reporting.d.ts +1 -1
- package/dist/reporting.js +115 -24
- package/dist/{runner-WW4GJFUB.js → runner-JOVPVMIH.js} +18 -17
- package/dist/{sentry-4CP5NNQ5.js → sentry-EGFOV3DH.js} +5 -3
- package/dist/validation-TN6HMZAD.js +15 -0
- package/package.json +4 -4
- package/dist/db-NGQ3JCMF.js +0 -17
- package/dist/registry-RRIDPJBT.js +0 -46
- package/dist/validation-MDMYBRFB.js +0 -15
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConversationStore
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PQ2U2AO3.js";
|
|
4
4
|
import {
|
|
5
5
|
SANDBOX_DATA_ROOT,
|
|
6
6
|
SANDBOX_WORKSPACE_ROOT,
|
|
@@ -9,30 +9,32 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
getConnectedStateContext,
|
|
11
11
|
getStateAdapter
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-X2FL5ZH5.js";
|
|
13
13
|
import {
|
|
14
14
|
parseDestination
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-4XHCVBXH.js";
|
|
16
16
|
import {
|
|
17
17
|
TURN_CONTEXT_TAG,
|
|
18
18
|
botConfig,
|
|
19
19
|
getChatConfig
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ABRNFE3N.js";
|
|
21
21
|
import {
|
|
22
22
|
parseRequester,
|
|
23
23
|
storedSlackRequesterSchema,
|
|
24
24
|
toStoredSlackRequester
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZPCGQRFJ.js";
|
|
26
26
|
import {
|
|
27
27
|
listReferenceFiles,
|
|
28
28
|
soulPathCandidates,
|
|
29
29
|
worldPathCandidates
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6APU57E6.js";
|
|
31
31
|
import {
|
|
32
|
-
isRecord,
|
|
33
32
|
logInfo,
|
|
34
33
|
logWarn
|
|
35
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-KF7522P3.js";
|
|
35
|
+
import {
|
|
36
|
+
isRecord
|
|
37
|
+
} from "./chunk-FTMXFBDC.js";
|
|
36
38
|
|
|
37
39
|
// src/chat/state/session-log.ts
|
|
38
40
|
import { isDeepStrictEqual } from "util";
|
|
@@ -99,13 +101,56 @@ var authorizationCompletedEntrySchema = z.object({
|
|
|
99
101
|
requesterId: z.string().min(1),
|
|
100
102
|
authorizationId: z.string().min(1)
|
|
101
103
|
});
|
|
104
|
+
var transcriptRefSchema = z.object({
|
|
105
|
+
type: z.literal("advisor_session"),
|
|
106
|
+
parentConversationId: z.string().min(1),
|
|
107
|
+
key: z.string().min(1)
|
|
108
|
+
});
|
|
109
|
+
var toolExecutionStartedEntrySchema = z.object({
|
|
110
|
+
schemaVersion: z.literal(AGENT_SESSION_LOG_SCHEMA_VERSION),
|
|
111
|
+
type: z.literal("tool_execution_started"),
|
|
112
|
+
sessionId: z.string().min(1).default(INITIAL_SESSION_ID),
|
|
113
|
+
createdAtMs: z.number().int().nonnegative(),
|
|
114
|
+
toolCallId: z.string().min(1),
|
|
115
|
+
toolName: z.string().min(1),
|
|
116
|
+
args: z.unknown().optional()
|
|
117
|
+
});
|
|
118
|
+
var subagentStartedEntrySchema = z.object({
|
|
119
|
+
schemaVersion: z.literal(AGENT_SESSION_LOG_SCHEMA_VERSION),
|
|
120
|
+
type: z.literal("subagent_started"),
|
|
121
|
+
sessionId: z.string().min(1).default(INITIAL_SESSION_ID),
|
|
122
|
+
subagentInvocationId: z.string().min(1),
|
|
123
|
+
subagentKind: z.string().min(1),
|
|
124
|
+
parentToolCallId: z.string().min(1).optional(),
|
|
125
|
+
parentConversationId: z.string().min(1),
|
|
126
|
+
parentSessionId: z.string().min(1).optional(),
|
|
127
|
+
transcriptRef: transcriptRefSchema,
|
|
128
|
+
historyMode: z.literal("shared"),
|
|
129
|
+
createdAtMs: z.number().int().nonnegative()
|
|
130
|
+
});
|
|
131
|
+
var subagentEndedEntrySchema = z.object({
|
|
132
|
+
schemaVersion: z.literal(AGENT_SESSION_LOG_SCHEMA_VERSION),
|
|
133
|
+
type: z.literal("subagent_ended"),
|
|
134
|
+
sessionId: z.string().min(1).default(INITIAL_SESSION_ID),
|
|
135
|
+
subagentInvocationId: z.string().min(1),
|
|
136
|
+
outcome: z.union([
|
|
137
|
+
z.literal("success"),
|
|
138
|
+
z.literal("error"),
|
|
139
|
+
z.literal("aborted")
|
|
140
|
+
]),
|
|
141
|
+
errorCode: z.string().min(1).optional(),
|
|
142
|
+
createdAtMs: z.number().int().nonnegative()
|
|
143
|
+
});
|
|
102
144
|
var sessionLogEntrySchema = z.discriminatedUnion("type", [
|
|
103
145
|
piMessageEntrySchema,
|
|
104
146
|
projectionResetEntrySchema,
|
|
105
147
|
requesterRecordedEntrySchema,
|
|
106
148
|
mcpProviderConnectedEntrySchema,
|
|
107
149
|
authorizationRequestedEntrySchema,
|
|
108
|
-
authorizationCompletedEntrySchema
|
|
150
|
+
authorizationCompletedEntrySchema,
|
|
151
|
+
toolExecutionStartedEntrySchema,
|
|
152
|
+
subagentStartedEntrySchema,
|
|
153
|
+
subagentEndedEntrySchema
|
|
109
154
|
]);
|
|
110
155
|
function key(scope) {
|
|
111
156
|
const prefix = getChatConfig().state.keyPrefix;
|
|
@@ -133,6 +178,9 @@ function countMatchingPrefix(left, right) {
|
|
|
133
178
|
function entrySessionId(entry) {
|
|
134
179
|
return entry.sessionId ?? INITIAL_SESSION_ID;
|
|
135
180
|
}
|
|
181
|
+
function isActivityEntry(entry) {
|
|
182
|
+
return entry.type === "tool_execution_started" || entry.type === "subagent_started" || entry.type === "subagent_ended";
|
|
183
|
+
}
|
|
136
184
|
function latestProjectionResetIndex(entries) {
|
|
137
185
|
for (let index = entries.length - 1; index >= 0; index -= 1) {
|
|
138
186
|
if (entries[index]?.type === "projection_reset") {
|
|
@@ -257,6 +305,43 @@ function authorizationCompletedEntry(args) {
|
|
|
257
305
|
authorizationId: args.authorizationId
|
|
258
306
|
};
|
|
259
307
|
}
|
|
308
|
+
function toolExecutionStartedEntry(args) {
|
|
309
|
+
return {
|
|
310
|
+
schemaVersion: AGENT_SESSION_LOG_SCHEMA_VERSION,
|
|
311
|
+
type: "tool_execution_started",
|
|
312
|
+
sessionId: args.sessionId,
|
|
313
|
+
createdAtMs: args.createdAtMs,
|
|
314
|
+
toolCallId: args.toolCallId,
|
|
315
|
+
toolName: args.toolName,
|
|
316
|
+
...args.args !== void 0 ? { args: args.args } : {}
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
function subagentStartedEntry(args) {
|
|
320
|
+
return {
|
|
321
|
+
schemaVersion: AGENT_SESSION_LOG_SCHEMA_VERSION,
|
|
322
|
+
type: "subagent_started",
|
|
323
|
+
sessionId: args.sessionId,
|
|
324
|
+
subagentInvocationId: args.subagentInvocationId,
|
|
325
|
+
subagentKind: args.subagentKind,
|
|
326
|
+
...args.parentToolCallId ? { parentToolCallId: args.parentToolCallId } : {},
|
|
327
|
+
parentConversationId: args.parentConversationId,
|
|
328
|
+
...args.parentSessionId ? { parentSessionId: args.parentSessionId } : {},
|
|
329
|
+
transcriptRef: args.transcriptRef,
|
|
330
|
+
historyMode: args.historyMode,
|
|
331
|
+
createdAtMs: args.createdAtMs
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
function subagentEndedEntry(args) {
|
|
335
|
+
return {
|
|
336
|
+
schemaVersion: AGENT_SESSION_LOG_SCHEMA_VERSION,
|
|
337
|
+
type: "subagent_ended",
|
|
338
|
+
sessionId: args.sessionId,
|
|
339
|
+
subagentInvocationId: args.subagentInvocationId,
|
|
340
|
+
outcome: args.outcome,
|
|
341
|
+
...args.errorCode ? { errorCode: args.errorCode } : {},
|
|
342
|
+
createdAtMs: args.createdAtMs
|
|
343
|
+
};
|
|
344
|
+
}
|
|
260
345
|
function decode(value) {
|
|
261
346
|
if (typeof value === "string") {
|
|
262
347
|
return decode(JSON.parse(value));
|
|
@@ -286,13 +371,13 @@ function project(entries, sessionId) {
|
|
|
286
371
|
messages.push(authorizationObservationMessage(entry));
|
|
287
372
|
continue;
|
|
288
373
|
}
|
|
289
|
-
if (entry.type === "
|
|
374
|
+
if (entry.type === "projection_reset") {
|
|
375
|
+
messages = [...entry.messages];
|
|
376
|
+
if (entry.requester) {
|
|
377
|
+
requester = entry.requester;
|
|
378
|
+
}
|
|
290
379
|
continue;
|
|
291
380
|
}
|
|
292
|
-
messages = [...entry.messages];
|
|
293
|
-
if (entry.requester) {
|
|
294
|
-
requester = entry.requester;
|
|
295
|
-
}
|
|
296
381
|
}
|
|
297
382
|
return { messages, requester };
|
|
298
383
|
}
|
|
@@ -404,6 +489,10 @@ async function loadEntries(args) {
|
|
|
404
489
|
const store = args.store ?? await defaultStore();
|
|
405
490
|
return await store.read(args);
|
|
406
491
|
}
|
|
492
|
+
async function loadActivityEntries(args) {
|
|
493
|
+
const entries = await loadEntries(args);
|
|
494
|
+
return projectionEntries(entries, args.sessionId).filter(isActivityEntry);
|
|
495
|
+
}
|
|
407
496
|
async function loadMessages(args) {
|
|
408
497
|
const messageCount = normalizeMessageCount(args.messageCount);
|
|
409
498
|
if (messageCount === 0) {
|
|
@@ -482,6 +571,64 @@ async function recordAuthorizationCompleted(args) {
|
|
|
482
571
|
ttlMs: args.ttlMs
|
|
483
572
|
});
|
|
484
573
|
}
|
|
574
|
+
async function recordToolExecutionStarted(args) {
|
|
575
|
+
const store = args.store ?? await defaultStore();
|
|
576
|
+
const entries = await store.read(args);
|
|
577
|
+
const sessionId = args.sessionId ?? currentSessionId(entries);
|
|
578
|
+
await store.append({
|
|
579
|
+
scope: args,
|
|
580
|
+
entries: [
|
|
581
|
+
toolExecutionStartedEntry({
|
|
582
|
+
args: args.args,
|
|
583
|
+
createdAtMs: args.createdAtMs ?? Date.now(),
|
|
584
|
+
sessionId,
|
|
585
|
+
toolCallId: args.toolCallId,
|
|
586
|
+
toolName: args.toolName
|
|
587
|
+
})
|
|
588
|
+
],
|
|
589
|
+
ttlMs: args.ttlMs
|
|
590
|
+
});
|
|
591
|
+
}
|
|
592
|
+
async function recordSubagentStarted(args) {
|
|
593
|
+
const store = args.store ?? await defaultStore();
|
|
594
|
+
const entries = await store.read(args);
|
|
595
|
+
const sessionId = args.sessionId ?? currentSessionId(entries);
|
|
596
|
+
await store.append({
|
|
597
|
+
scope: args,
|
|
598
|
+
entries: [
|
|
599
|
+
subagentStartedEntry({
|
|
600
|
+
createdAtMs: args.createdAtMs ?? Date.now(),
|
|
601
|
+
historyMode: args.historyMode,
|
|
602
|
+
parentConversationId: args.parentConversationId,
|
|
603
|
+
parentSessionId: args.parentSessionId,
|
|
604
|
+
parentToolCallId: args.parentToolCallId,
|
|
605
|
+
sessionId,
|
|
606
|
+
subagentInvocationId: args.subagentInvocationId,
|
|
607
|
+
subagentKind: args.subagentKind,
|
|
608
|
+
transcriptRef: args.transcriptRef
|
|
609
|
+
})
|
|
610
|
+
],
|
|
611
|
+
ttlMs: args.ttlMs
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
async function recordSubagentEnded(args) {
|
|
615
|
+
const store = args.store ?? await defaultStore();
|
|
616
|
+
const entries = await store.read(args);
|
|
617
|
+
const sessionId = args.sessionId ?? currentSessionId(entries);
|
|
618
|
+
await store.append({
|
|
619
|
+
scope: args,
|
|
620
|
+
entries: [
|
|
621
|
+
subagentEndedEntry({
|
|
622
|
+
createdAtMs: args.createdAtMs ?? Date.now(),
|
|
623
|
+
errorCode: args.errorCode,
|
|
624
|
+
outcome: args.outcome,
|
|
625
|
+
sessionId,
|
|
626
|
+
subagentInvocationId: args.subagentInvocationId
|
|
627
|
+
})
|
|
628
|
+
],
|
|
629
|
+
ttlMs: args.ttlMs
|
|
630
|
+
});
|
|
631
|
+
}
|
|
485
632
|
async function commitMessages(args) {
|
|
486
633
|
const store = args.store ?? await defaultStore();
|
|
487
634
|
const entries = await store.read(args);
|
|
@@ -2039,11 +2186,15 @@ export {
|
|
|
2039
2186
|
buildPluginSystemPromptContributions,
|
|
2040
2187
|
buildSystemPrompt,
|
|
2041
2188
|
buildTurnContextPrompt,
|
|
2189
|
+
loadActivityEntries,
|
|
2042
2190
|
loadProjection,
|
|
2043
2191
|
loadConnectedMcpProviders,
|
|
2044
2192
|
recordMcpProviderConnected,
|
|
2045
2193
|
recordAuthorizationRequested,
|
|
2046
2194
|
recordAuthorizationCompleted,
|
|
2195
|
+
recordToolExecutionStarted,
|
|
2196
|
+
recordSubagentStarted,
|
|
2197
|
+
recordSubagentEnded,
|
|
2047
2198
|
commitMessages,
|
|
2048
2199
|
getAgentTurnSessionRecord,
|
|
2049
2200
|
upsertAgentTurnSessionRecord,
|
package/dist/cli/chat.js
CHANGED
|
@@ -125,25 +125,25 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
125
125
|
const [
|
|
126
126
|
pluginsModule,
|
|
127
127
|
agentHooksModule,
|
|
128
|
-
|
|
128
|
+
catalogRuntimeModule,
|
|
129
129
|
validationModule,
|
|
130
130
|
databaseModule
|
|
131
131
|
] = await Promise.all([
|
|
132
132
|
import("../plugins-PZMDS7AT.js"),
|
|
133
|
-
import("../agent-hooks-
|
|
134
|
-
import("../
|
|
135
|
-
import("../validation-
|
|
136
|
-
import("../db-
|
|
133
|
+
import("../agent-hooks-ZGTDOXQY.js"),
|
|
134
|
+
import("../catalog-runtime-IVWRAPSI.js"),
|
|
135
|
+
import("../validation-TN6HMZAD.js"),
|
|
136
|
+
import("../db-GQJKBX5W.js")
|
|
137
137
|
]);
|
|
138
138
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
139
139
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
140
140
|
const pluginConfig = resolvedPluginSet ? pluginsModule.pluginCatalogConfigFromPluginSet(resolvedPluginSet) : pluginsModule.pluginCatalogConfigFromEnv();
|
|
141
141
|
const shouldValidatePluginCatalog = Boolean(pluginConfig) || Boolean(resolvedPluginSet?.registrations.length);
|
|
142
142
|
agentHooksModule.validatePlugins(plugins);
|
|
143
|
-
const previousPluginCatalogConfig =
|
|
143
|
+
const previousPluginCatalogConfig = catalogRuntimeModule.pluginCatalogRuntime.setConfig(pluginConfig);
|
|
144
144
|
try {
|
|
145
145
|
if (shouldValidatePluginCatalog) {
|
|
146
|
-
|
|
146
|
+
catalogRuntimeModule.pluginCatalogRuntime.getSignature();
|
|
147
147
|
validationModule.validatePluginRegistrations(
|
|
148
148
|
resolvedPluginSet?.registrations ?? []
|
|
149
149
|
);
|
|
@@ -154,7 +154,9 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
154
154
|
databaseModule.getDb();
|
|
155
155
|
agentHooksModule.setPlugins(plugins);
|
|
156
156
|
} catch (error) {
|
|
157
|
-
|
|
157
|
+
catalogRuntimeModule.pluginCatalogRuntime.setConfig(
|
|
158
|
+
previousPluginCatalogConfig
|
|
159
|
+
);
|
|
158
160
|
throw error;
|
|
159
161
|
}
|
|
160
162
|
}
|
|
@@ -193,7 +195,7 @@ async function runPrompt(options, io, pluginSet) {
|
|
|
193
195
|
defaultStateAdapterForLocalChat();
|
|
194
196
|
await configureLocalChatPlugins(pluginSet);
|
|
195
197
|
const conversationId = newRunConversationId();
|
|
196
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
198
|
+
const { runLocalAgentTurn } = await import("../runner-JOVPVMIH.js");
|
|
197
199
|
const result = await runLocalAgentTurn(
|
|
198
200
|
{
|
|
199
201
|
conversationId,
|
|
@@ -217,7 +219,7 @@ async function runInteractive(io, pluginSet) {
|
|
|
217
219
|
defaultStateAdapterForLocalChat();
|
|
218
220
|
await configureLocalChatPlugins(pluginSet);
|
|
219
221
|
const conversationId = newRunConversationId();
|
|
220
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
222
|
+
const { runLocalAgentTurn } = await import("../runner-JOVPVMIH.js");
|
|
221
223
|
const rl = readline.createInterface({
|
|
222
224
|
input: io.input,
|
|
223
225
|
output: io.output,
|
package/dist/cli/check.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseSkillFile
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-WCXVEQPI.js";
|
|
4
4
|
import {
|
|
5
5
|
parseInlinePluginManifest,
|
|
6
6
|
parsePluginManifest
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-TW23AT22.js";
|
|
8
|
+
import "../chunk-ZPCGQRFJ.js";
|
|
9
|
+
import "../chunk-6APU57E6.js";
|
|
10
|
+
import "../chunk-KF7522P3.js";
|
|
11
11
|
import {
|
|
12
12
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
13
13
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
14
14
|
LEGACY_JUNIOR_CONVERSATION_WORK_FUNCTION
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-FTMXFBDC.js";
|
|
16
|
+
import "../chunk-3DA7X2U3.js";
|
|
17
17
|
import "../chunk-MLKGABMK.js";
|
|
18
18
|
|
|
19
19
|
// src/cli/check.ts
|
package/dist/cli/main.js
CHANGED
|
@@ -10,7 +10,7 @@ import "../chunk-MLKGABMK.js";
|
|
|
10
10
|
import { pathToFileURL } from "url";
|
|
11
11
|
var SENTRY_FLUSH_TIMEOUT_MS = 2e3;
|
|
12
12
|
async function flushSentry() {
|
|
13
|
-
const mod = await import("../sentry-
|
|
13
|
+
const mod = await import("../sentry-EGFOV3DH.js");
|
|
14
14
|
await mod.flush(SENTRY_FLUSH_TIMEOUT_MS);
|
|
15
15
|
}
|
|
16
16
|
async function initSentry() {
|
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-FAGWUF44.js";
|
|
5
5
|
import {
|
|
6
6
|
pluginCatalogConfigFromPluginSet,
|
|
7
7
|
pluginCliRegistrationsFromPluginSet,
|
|
@@ -10,28 +10,29 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
setPlugins,
|
|
12
12
|
validatePlugins
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-Y3YUOEAZ.js";
|
|
14
14
|
import {
|
|
15
15
|
createPluginLogger
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-GUO4EE7L.js";
|
|
17
17
|
import {
|
|
18
18
|
getDb
|
|
19
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-PQ2U2AO3.js";
|
|
20
20
|
import "../chunk-G3E7SCME.js";
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-X2FL5ZH5.js";
|
|
22
|
+
import "../chunk-4XHCVBXH.js";
|
|
23
|
+
import "../chunk-ABRNFE3N.js";
|
|
24
|
+
import "../chunk-DR75T7J3.js";
|
|
24
25
|
import {
|
|
25
26
|
loadAppPluginSet
|
|
26
27
|
} from "../chunk-Y2CM7HXH.js";
|
|
27
28
|
import {
|
|
28
|
-
|
|
29
|
-
} from "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
29
|
+
pluginCatalogRuntime
|
|
30
|
+
} from "../chunk-TW23AT22.js";
|
|
31
|
+
import "../chunk-ZPCGQRFJ.js";
|
|
32
|
+
import "../chunk-6APU57E6.js";
|
|
33
|
+
import "../chunk-KF7522P3.js";
|
|
34
|
+
import "../chunk-FTMXFBDC.js";
|
|
35
|
+
import "../chunk-3DA7X2U3.js";
|
|
35
36
|
import "../chunk-MLKGABMK.js";
|
|
36
37
|
|
|
37
38
|
// src/cli/plugins.ts
|
|
@@ -189,7 +190,7 @@ async function loadPluginRegistrations(args) {
|
|
|
189
190
|
const runtimePlugins = pluginRuntimeRegistrationsFromPluginSet(pluginSet);
|
|
190
191
|
const pluginConfig = pluginCatalogConfigFromPluginSet(pluginSet);
|
|
191
192
|
validatePlugins(runtimePlugins);
|
|
192
|
-
const previousPluginCatalogConfig =
|
|
193
|
+
const previousPluginCatalogConfig = pluginCatalogRuntime.setConfig(pluginConfig);
|
|
193
194
|
try {
|
|
194
195
|
validatePluginRegistrations(pluginSet.registrations);
|
|
195
196
|
validatePluginEgressCredentialHooks(pluginSet.registrations);
|
|
@@ -197,7 +198,7 @@ async function loadPluginRegistrations(args) {
|
|
|
197
198
|
setPlugins(runtimePlugins);
|
|
198
199
|
return { cliPlugins, runtimePlugins };
|
|
199
200
|
} catch (error) {
|
|
200
|
-
|
|
201
|
+
pluginCatalogRuntime.setConfig(previousPluginCatalogConfig);
|
|
201
202
|
throw error;
|
|
202
203
|
}
|
|
203
204
|
}
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRuntimeDependencySnapshot
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-3JKTVW4R.js";
|
|
4
4
|
import "../chunk-G3E7SCME.js";
|
|
5
5
|
import {
|
|
6
6
|
disconnectStateAdapter
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-X2FL5ZH5.js";
|
|
8
|
+
import "../chunk-ABRNFE3N.js";
|
|
9
|
+
import "../chunk-DR75T7J3.js";
|
|
9
10
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-OJ53FYVG.js";
|
|
18
|
-
import "../chunk-ST6YNAXG.js";
|
|
11
|
+
pluginCatalogRuntime
|
|
12
|
+
} from "../chunk-TW23AT22.js";
|
|
13
|
+
import "../chunk-ZPCGQRFJ.js";
|
|
14
|
+
import "../chunk-6APU57E6.js";
|
|
15
|
+
import "../chunk-KF7522P3.js";
|
|
16
|
+
import "../chunk-FTMXFBDC.js";
|
|
17
|
+
import "../chunk-3DA7X2U3.js";
|
|
19
18
|
import "../chunk-MLKGABMK.js";
|
|
20
19
|
|
|
21
20
|
// src/cli/snapshot-warmup.ts
|
|
@@ -40,21 +39,21 @@ function formatList(values) {
|
|
|
40
39
|
return values.length > 0 ? values.join(", ") : "none";
|
|
41
40
|
}
|
|
42
41
|
function logSnapshotProfile(log) {
|
|
43
|
-
const providers =
|
|
42
|
+
const providers = pluginCatalogRuntime.getProviders();
|
|
44
43
|
const pluginNames = providers.map((plugin) => plugin.manifest.name).sort();
|
|
45
44
|
const snapshotPluginNames = providers.filter(
|
|
46
45
|
(plugin) => (plugin.manifest.runtimeDependencies?.length ?? 0) > 0 || (plugin.manifest.runtimePostinstall?.length ?? 0) > 0
|
|
47
46
|
).map((plugin) => plugin.manifest.name).sort();
|
|
48
47
|
const systemDependencies = [];
|
|
49
48
|
const npmDependencies = [];
|
|
50
|
-
for (const dep of
|
|
49
|
+
for (const dep of pluginCatalogRuntime.getRuntimeDependencies()) {
|
|
51
50
|
if (dep.type === "npm") {
|
|
52
51
|
npmDependencies.push(`${dep.package}@${dep.version}`);
|
|
53
52
|
continue;
|
|
54
53
|
}
|
|
55
54
|
systemDependencies.push("package" in dep ? dep.package : dep.url);
|
|
56
55
|
}
|
|
57
|
-
const postinstallCommands =
|
|
56
|
+
const postinstallCommands = pluginCatalogRuntime.getRuntimePostinstall().map(
|
|
58
57
|
({ cmd, args }) => [cmd, ...args ?? []].filter((part) => part.trim().length > 0).join(" ")
|
|
59
58
|
);
|
|
60
59
|
log(`Loaded plugins (${pluginNames.length}): ${formatList(pluginNames)}`);
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
recordConversationActivity,
|
|
5
5
|
recordConversationExecution,
|
|
6
6
|
requestConversationWork
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-2AJ4TEKE.js";
|
|
8
8
|
import {
|
|
9
9
|
JUNIOR_THREAD_STATE_TTL_MS,
|
|
10
10
|
coerceThreadConversationState
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-66NX7MNW.js";
|
|
12
12
|
import {
|
|
13
13
|
defineJuniorPlugins,
|
|
14
14
|
pluginCatalogConfigFromEnv,
|
|
@@ -18,39 +18,39 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
createPluginLogger,
|
|
20
20
|
createPluginState
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-GUO4EE7L.js";
|
|
22
22
|
import {
|
|
23
23
|
createJuniorSqlExecutor,
|
|
24
24
|
createSqlStore,
|
|
25
25
|
getDb
|
|
26
|
-
} from "../chunk-
|
|
26
|
+
} from "../chunk-PQ2U2AO3.js";
|
|
27
27
|
import {
|
|
28
28
|
disconnectStateAdapter,
|
|
29
29
|
getConnectedStateContext
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-X2FL5ZH5.js";
|
|
31
31
|
import {
|
|
32
32
|
parseDestination,
|
|
33
33
|
sameDestination
|
|
34
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-4XHCVBXH.js";
|
|
35
35
|
import {
|
|
36
36
|
getChatConfig
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-ABRNFE3N.js";
|
|
38
|
+
import "../chunk-DR75T7J3.js";
|
|
38
39
|
import {
|
|
39
40
|
loadAppPluginSet
|
|
40
41
|
} from "../chunk-Y2CM7HXH.js";
|
|
41
42
|
import {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-
|
|
43
|
+
pluginCatalogRuntime
|
|
44
|
+
} from "../chunk-TW23AT22.js";
|
|
45
|
+
import "../chunk-ZPCGQRFJ.js";
|
|
46
|
+
import "../chunk-6APU57E6.js";
|
|
47
|
+
import "../chunk-KF7522P3.js";
|
|
47
48
|
import {
|
|
48
49
|
isRecord,
|
|
49
50
|
toOptionalNumber,
|
|
50
51
|
toOptionalString
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import "../chunk-
|
|
53
|
-
import "../chunk-ST6YNAXG.js";
|
|
52
|
+
} from "../chunk-FTMXFBDC.js";
|
|
53
|
+
import "../chunk-3DA7X2U3.js";
|
|
54
54
|
import "../chunk-MLKGABMK.js";
|
|
55
55
|
|
|
56
56
|
// src/cli/upgrade.ts
|
|
@@ -218,7 +218,7 @@ async function runPluginStorageMigrations(context) {
|
|
|
218
218
|
if (!pluginSet) {
|
|
219
219
|
return emptyResult();
|
|
220
220
|
}
|
|
221
|
-
const previousConfig =
|
|
221
|
+
const previousConfig = pluginCatalogRuntime.setConfig(pluginCatalogConfig);
|
|
222
222
|
const ownedExecutor = context.db || !context.sqlDatabaseUrl ? void 0 : createJuniorSqlExecutor({
|
|
223
223
|
connectionString: context.sqlDatabaseUrl,
|
|
224
224
|
driver: context.sqlDriver ?? getChatConfig().sql.driver
|
|
@@ -248,7 +248,7 @@ async function runPluginStorageMigrations(context) {
|
|
|
248
248
|
}
|
|
249
249
|
return result;
|
|
250
250
|
} finally {
|
|
251
|
-
|
|
251
|
+
pluginCatalogRuntime.setConfig(previousConfig);
|
|
252
252
|
await ownedExecutor?.close();
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -388,15 +388,13 @@ function requirePluginSqlDatabaseUrl(context) {
|
|
|
388
388
|
async function migratePluginsToSql(context) {
|
|
389
389
|
const databaseUrl = requirePluginSqlDatabaseUrl(context);
|
|
390
390
|
const { pluginCatalogConfig } = await resolveUpgradePlugins(context);
|
|
391
|
-
const previousConfig =
|
|
391
|
+
const previousConfig = pluginCatalogRuntime.setConfig(pluginCatalogConfig);
|
|
392
392
|
const executor = createJuniorSqlExecutor({
|
|
393
393
|
connectionString: databaseUrl,
|
|
394
394
|
driver: context.sqlDriver ?? getChatConfig().sql.driver
|
|
395
395
|
});
|
|
396
396
|
try {
|
|
397
|
-
const migrations =
|
|
398
|
-
(root) => readPluginMigrations(root)
|
|
399
|
-
);
|
|
397
|
+
const migrations = pluginCatalogRuntime.getMigrationRoots().flatMap((root) => readPluginMigrations(root));
|
|
400
398
|
const result = await migratePluginSchemas(executor, migrations);
|
|
401
399
|
return {
|
|
402
400
|
existing: result.existing,
|
|
@@ -405,7 +403,7 @@ async function migratePluginsToSql(context) {
|
|
|
405
403
|
scanned: result.scanned
|
|
406
404
|
};
|
|
407
405
|
} finally {
|
|
408
|
-
|
|
406
|
+
pluginCatalogRuntime.setConfig(previousConfig);
|
|
409
407
|
await executor.close();
|
|
410
408
|
}
|
|
411
409
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeDb,
|
|
3
|
+
getConversationStore,
|
|
4
|
+
getDb
|
|
5
|
+
} from "./chunk-PQ2U2AO3.js";
|
|
6
|
+
import "./chunk-4XHCVBXH.js";
|
|
7
|
+
import "./chunk-ABRNFE3N.js";
|
|
8
|
+
import "./chunk-DR75T7J3.js";
|
|
9
|
+
import "./chunk-ZPCGQRFJ.js";
|
|
10
|
+
import "./chunk-KF7522P3.js";
|
|
11
|
+
import "./chunk-FTMXFBDC.js";
|
|
12
|
+
import "./chunk-3DA7X2U3.js";
|
|
13
|
+
import "./chunk-MLKGABMK.js";
|
|
14
|
+
export {
|
|
15
|
+
closeDb,
|
|
16
|
+
getConversationStore,
|
|
17
|
+
getDb
|
|
18
|
+
};
|