@sentry/junior 0.103.0 → 0.104.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{agent-hooks-NHIXBJW3.js → agent-hooks-EOFSY2PD.js} +3 -3
- package/dist/api/conversations/archive.d.ts +7 -0
- package/dist/api/conversations/detail.d.ts +7 -0
- package/dist/api/conversations/list.d.ts +109 -0
- package/dist/api/conversations/routes.d.ts +3 -0
- package/dist/api/conversations/schema.d.ts +72 -69
- package/dist/api/conversations/stats.d.ts +7 -0
- package/dist/api/conversations/subagent.d.ts +7 -0
- package/dist/api/http.d.ts +5 -0
- package/dist/api/locations/detail.d.ts +10 -2
- package/dist/api/locations/list.d.ts +7 -0
- package/dist/api/locations/routes.d.ts +3 -0
- package/dist/api/locations/schema.d.ts +4 -3
- package/dist/api/people/list.d.ts +7 -0
- package/dist/api/people/profile.d.ts +7 -0
- package/dist/api/people/routes.d.ts +3 -0
- package/dist/api/people/schema.d.ts +35 -33
- package/dist/api/people/shared.d.ts +3 -3
- package/dist/api/route.d.ts +7 -0
- package/dist/api/schema.js +11 -17
- package/dist/api.js +2184 -88
- package/dist/app.js +107 -101
- package/dist/chat/conversations/history.d.ts +6 -6
- package/dist/chat/conversations/store.d.ts +1 -0
- package/dist/chat/pi/messages.d.ts +2 -2
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/resource-events/store.d.ts +2 -2
- package/dist/chat/slack/tools/conversation-search.d.ts +2 -2
- package/dist/chat/state/session-log.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +2 -2
- package/dist/chat/tools/search-tools.d.ts +2 -2
- package/dist/chunk-AIRE7Q2W.js +362 -0
- package/dist/{chunk-HOBDQQJY.js → chunk-BCULHGZK.js} +23 -3
- package/dist/{chunk-DEQZ23O3.js → chunk-O7ILGCMJ.js} +77 -0
- package/dist/{chunk-C4BT2P2K.js → chunk-QDKRE3LS.js} +339 -8
- package/dist/{chunk-GY5ZRYPH.js → chunk-QVTVCJR4.js} +5 -5
- package/dist/{chunk-JXQWOCBE.js → chunk-RMZ65YAA.js} +2 -2
- package/dist/{chunk-E2VS47AZ.js → chunk-RYDF4GOX.js} +2 -2
- package/dist/{chunk-OE453VRG.js → chunk-TMWUGGSA.js} +26 -28
- package/dist/{chunk-JPXLAJUU.js → chunk-VDHMFCDY.js} +9 -10
- package/dist/cli/chat.js +10 -11
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/upgrade.js +3 -4
- package/dist/db/schema/conversations.d.ts +17 -0
- package/dist/db/schema.d.ts +17 -0
- package/dist/{db-I343BSOM.js → db-PDMC67T3.js} +1 -1
- package/dist/{legacy-import-M7VBOQTK.js → legacy-import-G333RHJZ.js} +2 -2
- package/dist/reporting-schema.d.ts +4 -4
- package/dist/{runner-IEE5G4NV.js → runner-6A7MQRUE.js} +7 -8
- package/migrations/0004_useful_magus.sql +1 -0
- package/migrations/meta/0004_snapshot.json +1041 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +6 -6
- package/dist/api/conversations/list.query.d.ts +0 -103
- package/dist/chunk-2RNOB32R.js +0 -17
- package/dist/chunk-6FPTHPXF.js +0 -77
- package/dist/chunk-6LBNXC4F.js +0 -66
- package/dist/chunk-7LLRS2OK.js +0 -215
- package/dist/chunk-B43K4C5K.js +0 -102
- package/dist/chunk-BQCPAIAB.js +0 -319
- package/dist/chunk-FW7DVHTL.js +0 -673
- package/dist/chunk-GCGRQJR5.js +0 -84
- package/dist/chunk-HRDWLE7Q.js +0 -273
- package/dist/chunk-LVUKF5CE.js +0 -63
- package/dist/chunk-QNVHH5PU.js +0 -20
- package/dist/chunk-QOZOJNSE.js +0 -96
- package/dist/chunk-VKFOVMZL.js +0 -331
- package/dist/detail-ENVV4HIY.js +0 -68
- package/dist/detail-UIOKVIET.js +0 -29
- package/dist/list-WR5U6JVM.js +0 -30
- package/dist/list-XZ4HKQ4R.js +0 -121
- package/dist/list-ZOUSMSEH.js +0 -30
- package/dist/plugin-conversations-DTUP4RH6.js +0 -37
- package/dist/profile-UO2N3XXG.js +0 -212
- package/dist/reporting/plugin-conversations.d.ts +0 -3
- package/dist/stats-NZIET4LT.js +0 -174
- package/dist/subagent-DY6XKTJ5.js +0 -49
|
@@ -1,22 +1,322 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "./chunk-BQCPAIAB.js";
|
|
2
|
+
ensureLegacyConversationImport
|
|
3
|
+
} from "./chunk-RYDF4GOX.js";
|
|
5
4
|
import {
|
|
6
5
|
usageSchema
|
|
7
6
|
} from "./chunk-PDO5BLNM.js";
|
|
8
7
|
import {
|
|
8
|
+
contextProvenance,
|
|
9
|
+
getAgentStepStore,
|
|
9
10
|
getConversationStore,
|
|
10
11
|
instructionActors,
|
|
11
12
|
instructionProvenanceFor
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-BCULHGZK.js";
|
|
13
14
|
import {
|
|
14
15
|
getStateAdapter
|
|
15
16
|
} from "./chunk-M3UAVLEN.js";
|
|
16
17
|
import {
|
|
18
|
+
logWarn,
|
|
17
19
|
toStoredSlackActor
|
|
18
20
|
} from "./chunk-AEWZ7F65.js";
|
|
19
21
|
|
|
22
|
+
// src/chat/conversations/projection.ts
|
|
23
|
+
import { isDeepStrictEqual } from "util";
|
|
24
|
+
function authorizationObservationMessage(entry, createdAtMs) {
|
|
25
|
+
const label = entry.kind === "mcp" ? "MCP authorization" : "Authorization";
|
|
26
|
+
return {
|
|
27
|
+
role: "user",
|
|
28
|
+
content: [
|
|
29
|
+
{
|
|
30
|
+
type: "text",
|
|
31
|
+
text: `${label} completed for provider "${entry.provider}". Continue the blocked request and retry the provider operation if needed.`
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
timestamp: createdAtMs
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function piEntryProvenance(entry) {
|
|
38
|
+
return entry.provenance ?? contextProvenance;
|
|
39
|
+
}
|
|
40
|
+
function projectSteps(steps, opts) {
|
|
41
|
+
const messages = [];
|
|
42
|
+
const provenance = [];
|
|
43
|
+
const seqs = [];
|
|
44
|
+
let modelProfile = "standard";
|
|
45
|
+
let modelId;
|
|
46
|
+
for (const step of steps) {
|
|
47
|
+
if (opts?.maxSeq !== void 0 && step.seq > opts.maxSeq) {
|
|
48
|
+
break;
|
|
49
|
+
}
|
|
50
|
+
if (step.entry.type === "context_epoch_started") {
|
|
51
|
+
modelProfile = step.entry.modelProfile ?? "standard";
|
|
52
|
+
modelId = step.entry.modelId;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
if (step.entry.type === "pi_message") {
|
|
56
|
+
messages.push(step.entry.message);
|
|
57
|
+
provenance.push(piEntryProvenance(step.entry));
|
|
58
|
+
seqs.push(step.seq);
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (step.entry.type === "authorization_completed") {
|
|
62
|
+
messages.push(
|
|
63
|
+
authorizationObservationMessage(step.entry, step.createdAtMs)
|
|
64
|
+
);
|
|
65
|
+
provenance.push(contextProvenance);
|
|
66
|
+
seqs.push(step.seq);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return { messages, provenance, seqs, modelProfile, modelId };
|
|
70
|
+
}
|
|
71
|
+
function connectedMcpProvidersFromSteps(steps) {
|
|
72
|
+
const providers = /* @__PURE__ */ new Set();
|
|
73
|
+
for (const step of steps) {
|
|
74
|
+
if (step.entry.type === "mcp_provider_connected") {
|
|
75
|
+
providers.add(step.entry.provider);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return [...providers].sort((left, right) => left.localeCompare(right));
|
|
79
|
+
}
|
|
80
|
+
function isUserMessage(message) {
|
|
81
|
+
return message.role === "user";
|
|
82
|
+
}
|
|
83
|
+
function countMatchingPrefix(left, right) {
|
|
84
|
+
const limit = Math.min(left.length, right.length);
|
|
85
|
+
for (let index = 0; index < limit; index += 1) {
|
|
86
|
+
if (!isDeepStrictEqual(left[index], right[index])) {
|
|
87
|
+
return index;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return limit;
|
|
91
|
+
}
|
|
92
|
+
function resolveCommitProvenance(args) {
|
|
93
|
+
if (args.explicitProvenance) {
|
|
94
|
+
if (args.explicitProvenance.length !== args.nextMessages.length) {
|
|
95
|
+
throw new Error("commit provenance must align one-to-one with messages");
|
|
96
|
+
}
|
|
97
|
+
return args.explicitProvenance;
|
|
98
|
+
}
|
|
99
|
+
const matchingPrefix = args.matchingPrefix;
|
|
100
|
+
const provenance = args.nextMessages.map(
|
|
101
|
+
(_, index) => index < matchingPrefix ? args.existing.provenance[index] ?? contextProvenance : contextProvenance
|
|
102
|
+
);
|
|
103
|
+
if (args.newMessageProvenance) {
|
|
104
|
+
for (let index = args.nextMessages.length - 1; index >= matchingPrefix; index -= 1) {
|
|
105
|
+
if (isUserMessage(args.nextMessages[index])) {
|
|
106
|
+
provenance[index] = args.newMessageProvenance;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (args.trailingMessageProvenance) {
|
|
112
|
+
if (args.trailingMessageProvenance.length > provenance.length) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
"trailing commit provenance cannot exceed committed messages"
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
const newMessageCount = args.nextMessages.length - matchingPrefix;
|
|
118
|
+
if (args.trailingMessageProvenance.length > newMessageCount) {
|
|
119
|
+
throw new Error(
|
|
120
|
+
"trailing commit provenance must align to newly committed messages"
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
const start = provenance.length - args.trailingMessageProvenance.length;
|
|
124
|
+
args.trailingMessageProvenance.forEach((entry, offset) => {
|
|
125
|
+
provenance[start + offset] = entry;
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return provenance;
|
|
129
|
+
}
|
|
130
|
+
async function importLegacyIfNeeded(args) {
|
|
131
|
+
await ensureLegacyConversationImport({ conversationId: args.conversationId });
|
|
132
|
+
}
|
|
133
|
+
async function loadProjection(args) {
|
|
134
|
+
await importLegacyIfNeeded(args);
|
|
135
|
+
const steps = await getAgentStepStore().loadCurrentEpoch(args.conversationId);
|
|
136
|
+
return projectSteps(steps).messages;
|
|
137
|
+
}
|
|
138
|
+
async function loadConversationProjection(args) {
|
|
139
|
+
await importLegacyIfNeeded(args);
|
|
140
|
+
const steps = await getAgentStepStore().loadCurrentEpoch(args.conversationId);
|
|
141
|
+
const { messages, provenance, modelProfile, modelId } = projectSteps(steps);
|
|
142
|
+
return { messages, provenance, modelProfile, modelId };
|
|
143
|
+
}
|
|
144
|
+
async function openConversationProjection(args) {
|
|
145
|
+
await importLegacyIfNeeded(args);
|
|
146
|
+
const stepStore = getAgentStepStore();
|
|
147
|
+
const steps = await stepStore.loadCurrentEpoch(args.conversationId);
|
|
148
|
+
const projection = projectSteps(steps);
|
|
149
|
+
if (steps.some(
|
|
150
|
+
(step) => step.entry.type === "context_epoch_started" || step.entry.type === "pi_message"
|
|
151
|
+
)) {
|
|
152
|
+
return projection;
|
|
153
|
+
}
|
|
154
|
+
await stepStore.startEpoch(args.conversationId, {
|
|
155
|
+
reason: "initial",
|
|
156
|
+
modelProfile: "standard",
|
|
157
|
+
modelId: args.modelId,
|
|
158
|
+
messages: []
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
messages: projection.messages,
|
|
162
|
+
provenance: projection.provenance,
|
|
163
|
+
modelProfile: "standard",
|
|
164
|
+
modelId: args.modelId
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
async function loadTurnProjection(args) {
|
|
168
|
+
await importLegacyIfNeeded(args);
|
|
169
|
+
const stepStore = getAgentStepStore();
|
|
170
|
+
if (args.committedSeq < 0) {
|
|
171
|
+
return projectSteps(await stepStore.loadCurrentEpoch(args.conversationId));
|
|
172
|
+
}
|
|
173
|
+
const history = await stepStore.loadHistory(args.conversationId);
|
|
174
|
+
const committedStep = history.find((step) => step.seq === args.committedSeq);
|
|
175
|
+
if (!committedStep) {
|
|
176
|
+
return void 0;
|
|
177
|
+
}
|
|
178
|
+
const epochSteps = history.filter(
|
|
179
|
+
(step) => step.contextEpoch === committedStep.contextEpoch
|
|
180
|
+
);
|
|
181
|
+
return args.includeTail ? projectSteps(epochSteps) : projectSteps(epochSteps, { maxSeq: args.committedSeq });
|
|
182
|
+
}
|
|
183
|
+
async function loadConnectedMcpProviders(args) {
|
|
184
|
+
await importLegacyIfNeeded(args);
|
|
185
|
+
const steps = await getAgentStepStore().loadCurrentEpoch(args.conversationId);
|
|
186
|
+
return connectedMcpProvidersFromSteps(steps);
|
|
187
|
+
}
|
|
188
|
+
function messageTimestamp(message) {
|
|
189
|
+
const timestamp = message.timestamp;
|
|
190
|
+
return typeof timestamp === "number" ? timestamp : Date.now();
|
|
191
|
+
}
|
|
192
|
+
async function commitMessages(args) {
|
|
193
|
+
const stepStore = getAgentStepStore();
|
|
194
|
+
const currentSteps = await stepStore.loadCurrentEpoch(args.conversationId);
|
|
195
|
+
const existing = projectSteps(currentSteps);
|
|
196
|
+
const matchingPrefix = countMatchingPrefix(existing.messages, args.messages);
|
|
197
|
+
const nextProvenance = resolveCommitProvenance({
|
|
198
|
+
existing,
|
|
199
|
+
nextMessages: args.messages,
|
|
200
|
+
matchingPrefix,
|
|
201
|
+
...args.provenance ? { explicitProvenance: args.provenance } : {},
|
|
202
|
+
...args.trailingMessageProvenance ? { trailingMessageProvenance: args.trailingMessageProvenance } : {},
|
|
203
|
+
...args.newMessageProvenance ? { newMessageProvenance: args.newMessageProvenance } : {}
|
|
204
|
+
});
|
|
205
|
+
if (currentSteps.length === 0) {
|
|
206
|
+
await stepStore.startEpoch(args.conversationId, {
|
|
207
|
+
reason: "initial",
|
|
208
|
+
modelProfile: "standard",
|
|
209
|
+
modelId: args.modelId,
|
|
210
|
+
messages: args.messages.map((message, index) => ({
|
|
211
|
+
message,
|
|
212
|
+
createdAtMs: messageTimestamp(message),
|
|
213
|
+
provenance: nextProvenance[index]
|
|
214
|
+
}))
|
|
215
|
+
});
|
|
216
|
+
} else if (matchingPrefix === existing.messages.length) {
|
|
217
|
+
const newMessages = args.messages.slice(matchingPrefix);
|
|
218
|
+
await stepStore.append(
|
|
219
|
+
args.conversationId,
|
|
220
|
+
newMessages.map((message, index) => ({
|
|
221
|
+
entry: {
|
|
222
|
+
type: "pi_message",
|
|
223
|
+
message,
|
|
224
|
+
provenance: nextProvenance[matchingPrefix + index]
|
|
225
|
+
},
|
|
226
|
+
createdAtMs: messageTimestamp(message)
|
|
227
|
+
}))
|
|
228
|
+
);
|
|
229
|
+
} else {
|
|
230
|
+
await stepStore.startEpoch(args.conversationId, {
|
|
231
|
+
reason: "rollback",
|
|
232
|
+
modelProfile: existing.modelProfile,
|
|
233
|
+
modelId: args.modelId,
|
|
234
|
+
messages: args.messages.map((message, index) => ({
|
|
235
|
+
message,
|
|
236
|
+
createdAtMs: messageTimestamp(message),
|
|
237
|
+
provenance: nextProvenance[index]
|
|
238
|
+
}))
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const committed = projectSteps(
|
|
242
|
+
await stepStore.loadCurrentEpoch(args.conversationId)
|
|
243
|
+
);
|
|
244
|
+
return {
|
|
245
|
+
committedSeq: committed.seqs.at(-1) ?? -1,
|
|
246
|
+
messageSeqs: committed.seqs,
|
|
247
|
+
provenance: nextProvenance
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
async function recordMcpProviderConnected(args) {
|
|
251
|
+
const stepStore = getAgentStepStore();
|
|
252
|
+
const steps = await stepStore.loadCurrentEpoch(args.conversationId);
|
|
253
|
+
if (connectedMcpProvidersFromSteps(steps).includes(args.provider)) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
await stepStore.append(args.conversationId, [
|
|
257
|
+
{
|
|
258
|
+
entry: { type: "mcp_provider_connected", provider: args.provider },
|
|
259
|
+
createdAtMs: Date.now()
|
|
260
|
+
}
|
|
261
|
+
]);
|
|
262
|
+
}
|
|
263
|
+
async function recordAuthorizationRequested(args) {
|
|
264
|
+
const stepStore = getAgentStepStore();
|
|
265
|
+
const steps = await stepStore.loadCurrentEpoch(args.conversationId);
|
|
266
|
+
if (steps.some(
|
|
267
|
+
(step) => step.entry.type === "authorization_requested" && step.entry.authorizationId === args.authorizationId
|
|
268
|
+
)) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
await stepStore.append(args.conversationId, [
|
|
272
|
+
{
|
|
273
|
+
entry: {
|
|
274
|
+
type: "authorization_requested",
|
|
275
|
+
kind: args.kind,
|
|
276
|
+
provider: args.provider,
|
|
277
|
+
actorId: args.actorId,
|
|
278
|
+
authorizationId: args.authorizationId,
|
|
279
|
+
delivery: args.delivery
|
|
280
|
+
},
|
|
281
|
+
createdAtMs: Date.now()
|
|
282
|
+
}
|
|
283
|
+
]);
|
|
284
|
+
}
|
|
285
|
+
async function recordAuthorizationCompleted(args) {
|
|
286
|
+
const stepStore = getAgentStepStore();
|
|
287
|
+
const steps = await stepStore.loadCurrentEpoch(args.conversationId);
|
|
288
|
+
if (steps.some(
|
|
289
|
+
(step) => step.entry.type === "authorization_completed" && step.entry.authorizationId === args.authorizationId
|
|
290
|
+
)) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
await stepStore.append(args.conversationId, [
|
|
294
|
+
{
|
|
295
|
+
entry: {
|
|
296
|
+
type: "authorization_completed",
|
|
297
|
+
kind: args.kind,
|
|
298
|
+
provider: args.provider,
|
|
299
|
+
actorId: args.actorId,
|
|
300
|
+
authorizationId: args.authorizationId
|
|
301
|
+
},
|
|
302
|
+
createdAtMs: Date.now()
|
|
303
|
+
}
|
|
304
|
+
]);
|
|
305
|
+
}
|
|
306
|
+
async function recordToolExecutionStarted(args) {
|
|
307
|
+
await getAgentStepStore().append(args.conversationId, [
|
|
308
|
+
{
|
|
309
|
+
entry: {
|
|
310
|
+
type: "tool_execution_started",
|
|
311
|
+
toolCallId: args.toolCallId,
|
|
312
|
+
toolName: args.toolName,
|
|
313
|
+
...args.args !== void 0 ? { args: args.args } : {}
|
|
314
|
+
},
|
|
315
|
+
createdAtMs: args.createdAtMs ?? Date.now()
|
|
316
|
+
}
|
|
317
|
+
]);
|
|
318
|
+
}
|
|
319
|
+
|
|
20
320
|
// src/chat/usage.ts
|
|
21
321
|
var agentTurnUsageSchema = usageSchema;
|
|
22
322
|
var COMPONENT_USAGE_FIELDS = [
|
|
@@ -190,6 +490,13 @@ function parseAgentTurnSessionRecord(value) {
|
|
|
190
490
|
return storedAgentTurnSessionRecordSchema.parse(value);
|
|
191
491
|
}
|
|
192
492
|
function parseAgentTurnSessionSummary(value) {
|
|
493
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value) && "requester" in value) {
|
|
494
|
+
const { requester, ...summary } = value;
|
|
495
|
+
return agentTurnSessionSummarySchema.parse({
|
|
496
|
+
...summary,
|
|
497
|
+
...summary.actor === void 0 ? { actor: requester } : {}
|
|
498
|
+
});
|
|
499
|
+
}
|
|
193
500
|
return agentTurnSessionSummarySchema.parse(value);
|
|
194
501
|
}
|
|
195
502
|
async function appendAgentTurnSessionSummary(summary, ttlMs) {
|
|
@@ -500,10 +807,24 @@ async function readAgentTurnSessionSummariesFromIndex(key, stateAdapter) {
|
|
|
500
807
|
const values = await stateAdapter.getList(key);
|
|
501
808
|
const summaries = /* @__PURE__ */ new Map();
|
|
502
809
|
for (const value of [...values].reverse()) {
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
810
|
+
let summary;
|
|
811
|
+
try {
|
|
812
|
+
summary = parseAgentTurnSessionSummary(value);
|
|
813
|
+
} catch (error) {
|
|
814
|
+
logWarn(
|
|
815
|
+
"agent_turn_session_summary_parse_failed",
|
|
816
|
+
{},
|
|
817
|
+
{
|
|
818
|
+
"app.state.key": key,
|
|
819
|
+
"exception.message": error instanceof Error ? error.message : String(error)
|
|
820
|
+
},
|
|
821
|
+
"Skipping an invalid turn-session summary index entry"
|
|
822
|
+
);
|
|
823
|
+
continue;
|
|
824
|
+
}
|
|
825
|
+
const summaryKey = `${summary.conversationId}:${summary.sessionId}`;
|
|
826
|
+
if (!summaries.has(summaryKey)) {
|
|
827
|
+
summaries.set(summaryKey, summary);
|
|
507
828
|
}
|
|
508
829
|
}
|
|
509
830
|
return [...summaries.values()].sort(
|
|
@@ -597,6 +918,16 @@ async function failAgentTurnSessionRecord(args) {
|
|
|
597
918
|
}
|
|
598
919
|
|
|
599
920
|
export {
|
|
921
|
+
projectSteps,
|
|
922
|
+
loadProjection,
|
|
923
|
+
loadConversationProjection,
|
|
924
|
+
openConversationProjection,
|
|
925
|
+
loadConnectedMcpProviders,
|
|
926
|
+
commitMessages,
|
|
927
|
+
recordMcpProviderConnected,
|
|
928
|
+
recordAuthorizationRequested,
|
|
929
|
+
recordAuthorizationCompleted,
|
|
930
|
+
recordToolExecutionStarted,
|
|
600
931
|
hasAgentTurnUsage,
|
|
601
932
|
addAgentTurnUsage,
|
|
602
933
|
getAgentTurnSessionRecord,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
getPersistedThreadState,
|
|
10
10
|
markTurnCompleted,
|
|
11
11
|
mergeArtifactsState
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RMZ65YAA.js";
|
|
13
13
|
import {
|
|
14
14
|
coerceThreadConversationState
|
|
15
15
|
} from "./chunk-XIMUQ4IU.js";
|
|
16
16
|
import {
|
|
17
17
|
getAgentTurnSessionRecord
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-QDKRE3LS.js";
|
|
19
19
|
import {
|
|
20
20
|
generateConversationId,
|
|
21
21
|
hydrateConversationMessages,
|
|
@@ -23,19 +23,19 @@ import {
|
|
|
23
23
|
normalizeConversationText,
|
|
24
24
|
updateConversationStats,
|
|
25
25
|
upsertConversationMessage
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RYDF4GOX.js";
|
|
27
27
|
import {
|
|
28
28
|
createPluginEmbedder,
|
|
29
29
|
createPluginModel,
|
|
30
30
|
getPlugins
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-VDHMFCDY.js";
|
|
32
32
|
import {
|
|
33
33
|
createPluginLogger,
|
|
34
34
|
createPluginState
|
|
35
35
|
} from "./chunk-4PDVOHXP.js";
|
|
36
36
|
import {
|
|
37
37
|
getDb
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-BCULHGZK.js";
|
|
39
39
|
import {
|
|
40
40
|
botConfig,
|
|
41
41
|
getPiMessageRole,
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
addAgentTurnUsage,
|
|
8
8
|
getAgentTurnSessionRecord,
|
|
9
9
|
upsertAgentTurnSessionRecord
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-QDKRE3LS.js";
|
|
11
11
|
import {
|
|
12
12
|
persistConversationMessages
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RYDF4GOX.js";
|
|
14
14
|
import {
|
|
15
15
|
sleep
|
|
16
16
|
} from "./chunk-4ZNGQH7C.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
piMessageSchema,
|
|
13
13
|
readSessionLogEntries,
|
|
14
14
|
sanitizePostgresJson
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BCULHGZK.js";
|
|
16
16
|
import {
|
|
17
17
|
botConfig,
|
|
18
18
|
escapeXml,
|
|
@@ -465,7 +465,7 @@ async function hydrateConversationMessages(args) {
|
|
|
465
465
|
args.conversation.messages = [];
|
|
466
466
|
return;
|
|
467
467
|
}
|
|
468
|
-
const { ensureLegacyConversationImport: ensureLegacyConversationImport2 } = await import("./legacy-import-
|
|
468
|
+
const { ensureLegacyConversationImport: ensureLegacyConversationImport2 } = await import("./legacy-import-G333RHJZ.js");
|
|
469
469
|
await ensureLegacyConversationImport2({ conversationId: args.conversationId });
|
|
470
470
|
await hydrateConversationCompactions({
|
|
471
471
|
conversation: args.conversation,
|
|
@@ -11,37 +11,35 @@ import {
|
|
|
11
11
|
persistRunningSessionRecord,
|
|
12
12
|
persistTimeoutSessionRecord,
|
|
13
13
|
persistYieldSessionRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RMZ65YAA.js";
|
|
15
15
|
import {
|
|
16
16
|
JUNIOR_THREAD_STATE_TTL_MS
|
|
17
17
|
} from "./chunk-XIMUQ4IU.js";
|
|
18
18
|
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
buildNonInteractiveShellScript,
|
|
20
|
+
createSandboxInstance,
|
|
21
|
+
getRuntimeDependencyProfileHash,
|
|
22
|
+
getSandboxResources,
|
|
23
|
+
getVercelSandboxCredentials,
|
|
24
|
+
isSnapshotMissingError,
|
|
25
|
+
resolveRuntimeDependencySnapshot,
|
|
26
|
+
runNonInteractiveCommand
|
|
27
|
+
} from "./chunk-7G4J3CR7.js";
|
|
22
28
|
import {
|
|
29
|
+
addAgentTurnUsage,
|
|
30
|
+
hasAgentTurnUsage,
|
|
23
31
|
loadConnectedMcpProviders,
|
|
24
32
|
loadConversationProjection,
|
|
25
33
|
openConversationProjection,
|
|
26
34
|
recordAuthorizationRequested,
|
|
27
35
|
recordMcpProviderConnected,
|
|
28
36
|
recordToolExecutionStarted
|
|
29
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-QDKRE3LS.js";
|
|
30
38
|
import {
|
|
31
39
|
estimateTextTokens,
|
|
32
40
|
getAgentContextCompactionTriggerTokens,
|
|
33
41
|
updateConversationStats
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import {
|
|
36
|
-
buildNonInteractiveShellScript,
|
|
37
|
-
createSandboxInstance,
|
|
38
|
-
getRuntimeDependencyProfileHash,
|
|
39
|
-
getSandboxResources,
|
|
40
|
-
getVercelSandboxCredentials,
|
|
41
|
-
isSnapshotMissingError,
|
|
42
|
-
resolveRuntimeDependencySnapshot,
|
|
43
|
-
runNonInteractiveCommand
|
|
44
|
-
} from "./chunk-7G4J3CR7.js";
|
|
42
|
+
} from "./chunk-RYDF4GOX.js";
|
|
45
43
|
import {
|
|
46
44
|
privateTraceResultAttributes
|
|
47
45
|
} from "./chunk-UIE3R5XU.js";
|
|
@@ -53,7 +51,17 @@ import {
|
|
|
53
51
|
getPlugins,
|
|
54
52
|
getSlackToolContext,
|
|
55
53
|
resolveChannelCapabilities
|
|
56
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-VDHMFCDY.js";
|
|
55
|
+
import {
|
|
56
|
+
createPluginLogger
|
|
57
|
+
} from "./chunk-4PDVOHXP.js";
|
|
58
|
+
import {
|
|
59
|
+
SANDBOX_DATA_ROOT,
|
|
60
|
+
SANDBOX_SKILLS_ROOT,
|
|
61
|
+
SANDBOX_WORKSPACE_ROOT,
|
|
62
|
+
sandboxSkillDir,
|
|
63
|
+
sandboxSkillFile
|
|
64
|
+
} from "./chunk-G3E7SCME.js";
|
|
57
65
|
import {
|
|
58
66
|
SlackActionError,
|
|
59
67
|
downloadPrivateSlackFile,
|
|
@@ -64,9 +72,6 @@ import {
|
|
|
64
72
|
normalizeSlackConversationId,
|
|
65
73
|
withSlackRetries
|
|
66
74
|
} from "./chunk-CCTCIISK.js";
|
|
67
|
-
import {
|
|
68
|
-
createPluginLogger
|
|
69
|
-
} from "./chunk-4PDVOHXP.js";
|
|
70
75
|
import {
|
|
71
76
|
contextProvenance,
|
|
72
77
|
getAgentStepStore,
|
|
@@ -75,14 +80,7 @@ import {
|
|
|
75
80
|
getDb,
|
|
76
81
|
instructionActors,
|
|
77
82
|
instructionProvenanceFor
|
|
78
|
-
} from "./chunk-
|
|
79
|
-
import {
|
|
80
|
-
SANDBOX_DATA_ROOT,
|
|
81
|
-
SANDBOX_SKILLS_ROOT,
|
|
82
|
-
SANDBOX_WORKSPACE_ROOT,
|
|
83
|
-
sandboxSkillDir,
|
|
84
|
-
sandboxSkillFile
|
|
85
|
-
} from "./chunk-G3E7SCME.js";
|
|
83
|
+
} from "./chunk-BCULHGZK.js";
|
|
86
84
|
import {
|
|
87
85
|
sleep
|
|
88
86
|
} from "./chunk-4ZNGQH7C.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPluginLogger,
|
|
3
|
+
createPluginState
|
|
4
|
+
} from "./chunk-4PDVOHXP.js";
|
|
5
|
+
import {
|
|
6
|
+
SANDBOX_WORKSPACE_ROOT
|
|
7
|
+
} from "./chunk-G3E7SCME.js";
|
|
1
8
|
import {
|
|
2
9
|
isConversationChannel,
|
|
3
10
|
isConversationScopedChannel,
|
|
4
11
|
isDmChannel,
|
|
5
12
|
normalizeSlackConversationId
|
|
6
13
|
} from "./chunk-CCTCIISK.js";
|
|
7
|
-
import {
|
|
8
|
-
createPluginLogger,
|
|
9
|
-
createPluginState
|
|
10
|
-
} from "./chunk-4PDVOHXP.js";
|
|
11
14
|
import {
|
|
12
15
|
getDb
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
SANDBOX_WORKSPACE_ROOT
|
|
16
|
-
} from "./chunk-G3E7SCME.js";
|
|
16
|
+
} from "./chunk-BCULHGZK.js";
|
|
17
17
|
import {
|
|
18
18
|
botConfig,
|
|
19
19
|
completeObject,
|
|
@@ -926,7 +926,7 @@ function failedOperationalReport(args) {
|
|
|
926
926
|
]
|
|
927
927
|
};
|
|
928
928
|
}
|
|
929
|
-
async function getPluginOperationalReports(nowMs
|
|
929
|
+
async function getPluginOperationalReports(nowMs) {
|
|
930
930
|
const reports = [];
|
|
931
931
|
for (const plugin of getPlugins()) {
|
|
932
932
|
const pluginName = plugin.manifest.name;
|
|
@@ -938,7 +938,6 @@ async function getPluginOperationalReports(nowMs, conversations) {
|
|
|
938
938
|
const state = createPluginState(pluginName);
|
|
939
939
|
const report = await hook({
|
|
940
940
|
...basePluginContext(plugin),
|
|
941
|
-
conversations,
|
|
942
941
|
nowMs,
|
|
943
942
|
state: pluginReadState(state)
|
|
944
943
|
});
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createAgentRunner,
|
|
3
3
|
executeAgentRun
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-TMWUGGSA.js";
|
|
5
|
+
import "../chunk-RMZ65YAA.js";
|
|
6
6
|
import "../chunk-XIMUQ4IU.js";
|
|
7
|
-
import "../chunk-C4BT2P2K.js";
|
|
8
|
-
import "../chunk-BQCPAIAB.js";
|
|
9
|
-
import "../chunk-E2VS47AZ.js";
|
|
10
7
|
import "../chunk-7G4J3CR7.js";
|
|
8
|
+
import "../chunk-QDKRE3LS.js";
|
|
9
|
+
import "../chunk-RYDF4GOX.js";
|
|
11
10
|
import "../chunk-PDO5BLNM.js";
|
|
12
11
|
import "../chunk-UIE3R5XU.js";
|
|
13
12
|
import {
|
|
14
13
|
loadAppPluginSet
|
|
15
14
|
} from "../chunk-Y2CM7HXH.js";
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-CCTCIISK.js";
|
|
15
|
+
import "../chunk-VDHMFCDY.js";
|
|
18
16
|
import "../chunk-4PDVOHXP.js";
|
|
19
|
-
import "../chunk-HOBDQQJY.js";
|
|
20
17
|
import "../chunk-G3E7SCME.js";
|
|
18
|
+
import "../chunk-CCTCIISK.js";
|
|
19
|
+
import "../chunk-BCULHGZK.js";
|
|
21
20
|
import "../chunk-4ZNGQH7C.js";
|
|
22
21
|
import "../chunk-M3UAVLEN.js";
|
|
23
22
|
import "../chunk-FXFQNHRU.js";
|
|
@@ -153,10 +152,10 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
153
152
|
databaseModule
|
|
154
153
|
] = await Promise.all([
|
|
155
154
|
import("../plugins-PZMDS7AT.js"),
|
|
156
|
-
import("../agent-hooks-
|
|
155
|
+
import("../agent-hooks-EOFSY2PD.js"),
|
|
157
156
|
import("../catalog-runtime-5CVM2DOF.js"),
|
|
158
157
|
import("../validation-EUI2UFRM.js"),
|
|
159
|
-
import("../db-
|
|
158
|
+
import("../db-PDMC67T3.js")
|
|
160
159
|
]);
|
|
161
160
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
162
161
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -217,7 +216,7 @@ function newRunConversationId() {
|
|
|
217
216
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
218
217
|
defaultStateAdapterForLocalChat();
|
|
219
218
|
await configureLocalChatPlugins(pluginSet);
|
|
220
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
219
|
+
const { runLocalAgentTurn } = await import("../runner-6A7MQRUE.js");
|
|
221
220
|
const deps = {
|
|
222
221
|
agentRunner: createAgentRunner(executeAgentRun),
|
|
223
222
|
deliverReply: async (reply) => {
|
package/dist/cli/plugins.js
CHANGED
|
@@ -13,15 +13,15 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
setPlugins,
|
|
15
15
|
validatePlugins
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-CCTCIISK.js";
|
|
16
|
+
} from "../chunk-VDHMFCDY.js";
|
|
18
17
|
import {
|
|
19
18
|
createPluginLogger
|
|
20
19
|
} from "../chunk-4PDVOHXP.js";
|
|
20
|
+
import "../chunk-G3E7SCME.js";
|
|
21
|
+
import "../chunk-CCTCIISK.js";
|
|
21
22
|
import {
|
|
22
23
|
getDb
|
|
23
|
-
} from "../chunk-
|
|
24
|
-
import "../chunk-G3E7SCME.js";
|
|
24
|
+
} from "../chunk-BCULHGZK.js";
|
|
25
25
|
import "../chunk-4ZNGQH7C.js";
|
|
26
26
|
import "../chunk-M3UAVLEN.js";
|
|
27
27
|
import "../chunk-FXFQNHRU.js";
|
package/dist/cli/upgrade.js
CHANGED
|
@@ -18,11 +18,10 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
addAgentTurnUsage,
|
|
20
20
|
listAgentTurnSessionSummariesForConversations
|
|
21
|
-
} from "../chunk-
|
|
22
|
-
import "../chunk-BQCPAIAB.js";
|
|
21
|
+
} from "../chunk-QDKRE3LS.js";
|
|
23
22
|
import {
|
|
24
23
|
importConversationFromLegacy
|
|
25
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-RYDF4GOX.js";
|
|
26
25
|
import "../chunk-PDO5BLNM.js";
|
|
27
26
|
import {
|
|
28
27
|
loadAppPluginSet
|
|
@@ -36,7 +35,7 @@ import {
|
|
|
36
35
|
createSqlConversationMessageStore,
|
|
37
36
|
createSqlStore,
|
|
38
37
|
getDb
|
|
39
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-BCULHGZK.js";
|
|
40
39
|
import {
|
|
41
40
|
disconnectStateAdapter,
|
|
42
41
|
getChatConfig,
|