@sentry/junior 0.317.0 → 0.319.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/adapter-8_S6Birm.js +1833 -0
- package/dist/{admin-CAugg87B.js → admin-EsbUON1j.js} +1 -1
- package/dist/{agent-runner-AjrEV6Qe.js → agent-CtzMl32d.js} +19953 -6727
- package/dist/{agent-status-BA5x3Xtp.js → agent-status-Bq_AIpyp.js} +105 -1
- package/dist/{agent-update-delivery-B_YIZcgf.js → agent-update-delivery-pAvsbuGL.js} +4 -5
- package/dist/api/schema.d.ts +85 -51
- package/dist/api/schema.js +4 -4
- package/dist/api.js +81 -94
- package/dist/{app-MoNAsVV5.d.ts → app-tACXxJPI.d.ts} +8 -13
- package/dist/app.d.ts +2 -2
- package/dist/app.js +246 -153
- package/dist/{change-record-BzJgLsv7.d.ts → change-record-K-KsqNhT.d.ts} +9 -5
- package/dist/{channel-access-j-YAVYK4.js → channel-access-DET5hzZM.js} +1 -1
- package/dist/{chat-core-engine-aH85nEHv.js → chat-core-engine-DpM3tMVi.js} +7 -7
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +38 -30
- package/dist/cli/check.js +5 -5
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.d.ts +1 -1
- package/dist/cli/plugins.js +8 -8
- package/dist/cli/snapshot-create.js +5 -6
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -4
- package/dist/{continue-in-slack-D-FZ8Fin.js → continue-in-slack-CFzDyxkH.js} +3 -2
- package/dist/{conversation-feed--9S0_PXL.js → conversation-feed-DEUdD7mb.js} +2 -106
- package/dist/{conversation-privacy-B1uXn5sf.js → conversation-privacy-C2vYK55O.js} +1 -1
- package/dist/{create-DoDIYgtZ.js → create-Ta3SEIB5.js} +124 -16
- package/dist/{credential-sync-BJOqGnjV.js → credential-sync-DyRqDmY4.js} +17 -20
- package/dist/{db-BFmyYZtJ.js → db-BCaNWl9p.js} +6536 -1920
- package/dist/{deployment-DXq9ZLU4.js → deployment-CfOew1Tm.js} +3 -3
- package/dist/{engine-context-CgQ7mlHt.js → engine-context-CiExoy1B.js} +181 -155
- package/dist/{html-B3VKTGbJ.js → html-Bb2Si1bR.js} +6 -8
- package/dist/instrumentation.js +7 -23
- package/dist/list-wwDcROh9.js +5007 -0
- package/dist/{logging--smS7XRK.js → logging-BRPTXAdf.js} +10 -81
- package/dist/{mailbox-turn-uSXhUFc9.js → markers-9QoqW5ov.js} +1875 -1458
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +7 -8
- package/dist/{oauth-callback-server-CE4soEIY.js → oauth-callback-server-vhL9b-PZ.js} +2 -2
- package/dist/{oauth-relay-C36gX1gH.js → oauth-relay-CH2v7WiB.js} +1 -1
- package/dist/{plugins-fBrz8PCV.d.ts → plugins-DhGXZjlu.d.ts} +1 -0
- package/dist/{profile-BQ-iBDsZ.js → profile-D9LdwmZi.js} +17 -19
- package/dist/{prompt-Dv7gkpD6.js → prompt-3TqxEOtc.js} +10 -10
- package/dist/{reports-WKHfGTsU.js → reports-K-tbtEyx.js} +2 -2
- package/dist/{resolve-tony4ibz.js → resolve-BBV2qf8A.js} +5 -5
- package/dist/{result-Bta_dlWa.js → result-5IdGJP4M.js} +24 -13
- package/dist/{runner-BstDRbD9.js → runner-BK_joPlM.js} +9 -18
- package/dist/{sandbox-egress-signals-oSJMJOnn.js → sandbox-egress-signals-DXgWXXmm.js} +1 -1
- package/dist/{schema-DfqrHACA.js → schema-zWGG6VC1.js} +13 -7
- package/dist/{service-account-CTV_jaNu.js → service-account-CateFyhw.js} +4 -5
- package/dist/{skills-BCEU41zM.js → skills-Ccjw8h2P.js} +10 -9
- package/dist/{slack-conversation-unfurl-DxVmhbGP.js → slack-conversation-unfurl-ZC_TSpc4.js} +7 -7
- package/dist/storage-C9U7R5rM.js +273 -0
- package/dist/{system-prompt-table-CiXy0eNR.js → system-prompt-table-YBTHIFlP.js} +26 -84
- package/dist/topic-B2EWKKBT.js +6 -0
- package/dist/{package-discovery-DD9vencX.js → topics-DxuKurCX.js} +21 -1
- package/dist/{types-C4iC-IMC.js → types-BNHkJrOP.js} +79 -59
- package/dist/{users-ByG5RCEJ.js → users-CCRAqYb_.js} +1 -1
- package/dist/{validation-8gjfR91V.js → validation-BCUpJa8K.js} +4 -4
- package/dist/{version-BeZhWWBE.js → version-BNm0JYj3.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-BqMQQNRk.js → worker-BhgpZ7_b.js} +5 -5
- package/migrations/20261127002500_turn_discarded_usage/migration.sql +2 -0
- package/migrations/20261127002500_turn_discarded_usage/snapshot.json +73 -0
- package/migrations/20261127052408_space_name_nullable/migration.sql +5 -0
- package/migrations/20261127052408_space_name_nullable/snapshot.json +29 -0
- package/migrations/20261127060000_annotation_object_id_index/migration.sql +1 -0
- package/migrations/20261127060000_annotation_object_id_index/snapshot.json +69 -0
- package/migrations/20261127060001_annotation_subjects/migration.sql +78 -0
- package/migrations/20261127060001_annotation_subjects/snapshot.json +104 -0
- package/migrations/20261127060002_annotation_subject_index/migration.sql +1 -0
- package/migrations/20261127060002_annotation_subject_index/snapshot.json +70 -0
- package/migrations/20261127060003_annotation_title_url/migration.sql +84 -0
- package/migrations/20261127060003_annotation_title_url/snapshot.json +73 -0
- package/package.json +9 -7
- package/dist/catalog-runtime-DfSpJZdY.js +0 -6
- package/dist/child-message-DHjQLEd1.js +0 -19
- package/dist/config-CHQ8X251.js +0 -2422
- package/dist/conversation-turn-BUE_7xaN.js +0 -1157
- package/dist/job-runner-A1lCkybD.js +0 -1506
- package/dist/lineage-Bktb0UcV.js +0 -36
- package/dist/list-Bxvg5wXf.js +0 -12623
- package/dist/message-BNenhsmB.js +0 -154
- package/dist/model-input-BReSnwHp.js +0 -82
- package/dist/parent-result-Ck1rFYRQ.js +0 -310
- package/dist/registry-iXMT5Jmh.js +0 -3279
- package/dist/run-conversation-DL6ru7iW.js +0 -336
- package/dist/sender-actors-CPglLd5R.js +0 -83
- package/dist/spawn-frczVPIr.js +0 -48
- package/dist/task-runner-C9Yc2_ae.js +0 -1526
- package/dist/thread-context-CqZDKErp.js +0 -166
- package/dist/topic-CRYYBYp-.js +0 -7
- package/dist/topics-SRN7IVX-.js +0 -24
- package/dist/turn-membership-CENFf3kI.js +0 -856
- package/dist/turn-wake-BhloiI2h.js +0 -151
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { a as getDb, n as getConversationEventStore, rn as getConversationWorkState, rs as listConversationAnnotations } from "./db-BFmyYZtJ.js";
|
|
2
|
-
import { b as setSpanAttributes } from "./logging--smS7XRK.js";
|
|
3
|
-
import { L as mapBounded } from "./prompt-Dv7gkpD6.js";
|
|
4
|
-
import { Gt as resolveMessageCards, Ut as readMessageCardRefs, Wt as removedCardSchema } from "./types-C4iC-IMC.js";
|
|
5
|
-
import { Nn as hydrateConversationMessages, Rn as buildConversationContext, Un as markConversationMessage, Z as getTurnUserMessageId, _t as coerceThreadConversationState, ct as markTurnClosed, fr as clearPendingAuth, gt as persistThreadStateById, lt as markTurnCompleted, mt as getPersistedThreadState } from "./mailbox-turn-uSXhUFc9.js";
|
|
6
|
-
import { n as listChildMessages } from "./child-message-DHjQLEd1.js";
|
|
7
|
-
// src/chat/conversations/pending-cards.ts
|
|
8
|
-
/**
|
|
9
|
-
* Add the cards that tool results selected since the last visible assistant
|
|
10
|
-
* Message or Turn start, scanning back from `beforeSeq`. Returns the input
|
|
11
|
-
* message ids of the Turn start that ended the scan.
|
|
12
|
-
*/
|
|
13
|
-
async function selectTurnCards(conversationId, selection, beforeSeq) {
|
|
14
|
-
while (true) {
|
|
15
|
-
const page = await getConversationEventStore().query(conversationId, {
|
|
16
|
-
beforeSeq,
|
|
17
|
-
limit: 100,
|
|
18
|
-
types: [
|
|
19
|
-
"tool_result",
|
|
20
|
-
"message",
|
|
21
|
-
"turn_started"
|
|
22
|
-
]
|
|
23
|
-
});
|
|
24
|
-
for (const event of [...page.events].reverse()) {
|
|
25
|
-
const data = event.data;
|
|
26
|
-
if (data.type === "turn_started") return data.inputMessageIds;
|
|
27
|
-
if (data.type === "message" && data.role === "assistant") return [];
|
|
28
|
-
if (data.type !== "tool_result" || data["isError"] || typeof data["toolName"] !== "string") continue;
|
|
29
|
-
const details = data["details"];
|
|
30
|
-
if (typeof details !== "object" || details === null) continue;
|
|
31
|
-
if ("timed_out" in details && details.timed_out === true) continue;
|
|
32
|
-
if ("removedCards" in details && Array.isArray(details.removedCards)) for (const ref of removedCardSchema.array().parse(details.removedCards)) selection.deleted.add(JSON.stringify([ref.plugin, ref.key]));
|
|
33
|
-
for (const card of readMessageCardRefs(details)) {
|
|
34
|
-
const key = JSON.stringify([card.plugin, card.key]);
|
|
35
|
-
if (!selection.deleted.has(key) && !selection.cards.has(key)) selection.cards.set(key, card);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
if (!page.hasOlder || page.events.length === 0) return [];
|
|
39
|
-
beforeSeq = page.events[0].seq;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Add the cards of child agents whose replies or results started this Turn.
|
|
44
|
-
* A child cannot reply to people, so its parent's reply delivers its cards.
|
|
45
|
-
*/
|
|
46
|
-
async function selectChildResultCards(conversationId, inputMessageIds, selection) {
|
|
47
|
-
if (inputMessageIds.length === 0) return;
|
|
48
|
-
const events = getConversationEventStore();
|
|
49
|
-
const execution = (await getConversationWorkState({ conversationId }))?.execution;
|
|
50
|
-
const messages = listChildMessages(inputMessageIds, execution?.messageSenders ?? {});
|
|
51
|
-
messages.reverse();
|
|
52
|
-
const terminals = await mapBounded(messages, ({ sender }) => events.loadByIdempotencyKey(sender.conversationId, `turn:${sender.turnId}:terminal`));
|
|
53
|
-
for (const [index, message] of messages.entries()) {
|
|
54
|
-
const terminal = terminals[index];
|
|
55
|
-
await selectTurnCards(message.sender.conversationId, selection, terminal?.seq);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
/** Select undelivered cards and load their latest saved facts. */
|
|
59
|
-
async function loadPendingMessageCards(conversationId) {
|
|
60
|
-
const selection = {
|
|
61
|
-
cards: /* @__PURE__ */ new Map(),
|
|
62
|
-
deleted: /* @__PURE__ */ new Set()
|
|
63
|
-
};
|
|
64
|
-
await selectChildResultCards(conversationId, await selectTurnCards(conversationId, selection), selection);
|
|
65
|
-
if (selection.cards.size === 0) return [];
|
|
66
|
-
return resolveMessageCards([...selection.cards.values()].reverse(), await listConversationAnnotations(getDb(), conversationId));
|
|
67
|
-
}
|
|
68
|
-
// src/chat/runtime/delivered-turn-state.ts
|
|
69
|
-
/** Build state after destination delivery or intentional no-reply completion. */
|
|
70
|
-
function buildDeliveredTurnStatePatch(args) {
|
|
71
|
-
const conversation = structuredClone(args.conversation);
|
|
72
|
-
clearPendingAuth(conversation, args.sessionId);
|
|
73
|
-
markConversationMessage(conversation, args.userMessageId, {
|
|
74
|
-
replied: true,
|
|
75
|
-
skippedReason: void 0
|
|
76
|
-
});
|
|
77
|
-
markTurnCompleted({
|
|
78
|
-
conversation,
|
|
79
|
-
nowMs: Date.now(),
|
|
80
|
-
sessionId: args.sessionId
|
|
81
|
-
});
|
|
82
|
-
return {
|
|
83
|
-
conversation,
|
|
84
|
-
sandboxRef: args.reply.sandboxRef
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
// src/chat/runtime/auth-pause-state.ts
|
|
88
|
-
/** Mark an auth-paused turn complete after private authorization link delivery. */
|
|
89
|
-
function completeAuthPauseTurn(args) {
|
|
90
|
-
markConversationMessage(args.conversation, getTurnUserMessageId(args.conversation, args.sessionId), {
|
|
91
|
-
replied: true,
|
|
92
|
-
skippedReason: void 0
|
|
93
|
-
});
|
|
94
|
-
markTurnClosed({
|
|
95
|
-
conversation: args.conversation,
|
|
96
|
-
nowMs: Date.now(),
|
|
97
|
-
sessionId: args.sessionId
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
/** Reload thread state, mark the auth pause as parked, and persist it. */
|
|
101
|
-
async function persistAuthPauseTurnState(args) {
|
|
102
|
-
const currentState = await getPersistedThreadState(args.threadStateId);
|
|
103
|
-
const conversation = coerceThreadConversationState(currentState);
|
|
104
|
-
await hydrateConversationMessages({
|
|
105
|
-
conversation,
|
|
106
|
-
conversationId: args.threadStateId
|
|
107
|
-
});
|
|
108
|
-
completeAuthPauseTurn({
|
|
109
|
-
conversation,
|
|
110
|
-
sessionId: args.sessionId
|
|
111
|
-
});
|
|
112
|
-
await persistThreadStateById(args.threadStateId, { conversation });
|
|
113
|
-
}
|
|
114
|
-
// src/chat/conversations/thread-context.ts
|
|
115
|
-
const CURSOR_TURN_LOOKBACK = 10;
|
|
116
|
-
async function loadThreadContextCursor(args) {
|
|
117
|
-
const store = getConversationEventStore();
|
|
118
|
-
const [started, completed] = await Promise.all([store.query(args.conversationId, {
|
|
119
|
-
limit: CURSOR_TURN_LOOKBACK,
|
|
120
|
-
types: ["turn_started"]
|
|
121
|
-
}), store.query(args.conversationId, {
|
|
122
|
-
limit: CURSOR_TURN_LOOKBACK,
|
|
123
|
-
types: ["turn_completed"]
|
|
124
|
-
})]);
|
|
125
|
-
const finished = new Set(completed.events.flatMap((event) => event.data.type === "turn_completed" && event.data.outcome !== "cancelled" ? [event.data.turnId] : []));
|
|
126
|
-
const previous = [...started.events].reverse().find((event) => event.data.type === "turn_started" && event.data.turnId !== args.turnId && finished.has(event.data.turnId));
|
|
127
|
-
return previous?.data.type === "turn_started" ? previous.data.threadContextThroughSeq : void 0;
|
|
128
|
-
}
|
|
129
|
-
/**
|
|
130
|
-
* Return the oldest cursor of the Turns that the cursor lookup reads. Messages
|
|
131
|
-
* after it may still be in the thread context delta of the next Turn, also
|
|
132
|
-
* when the latest Turns failed or the next Turn retries.
|
|
133
|
-
*/
|
|
134
|
-
async function loadThreadContextTrimFloor(conversationId) {
|
|
135
|
-
const cursors = (await getConversationEventStore().query(conversationId, {
|
|
136
|
-
limit: CURSOR_TURN_LOOKBACK,
|
|
137
|
-
types: ["turn_started"]
|
|
138
|
-
})).events.flatMap((event) => event.data.type === "turn_started" && event.data.threadContextThroughSeq !== void 0 ? [event.data.threadContextThroughSeq] : []);
|
|
139
|
-
return cursors.length > 0 ? Math.min(...cursors) : void 0;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Build the thread context of one Turn prompt. With agent history, show only
|
|
143
|
-
* the thread Messages saved after the cursor of the previous Turn.
|
|
144
|
-
*
|
|
145
|
-
* Sets `app.thread_context.*` on the active span: `chat.reply` in a Slack
|
|
146
|
-
* Turn, `chat.turn` in a web or Event Turn. Cursor `missing` means that the
|
|
147
|
-
* previous Turn ran before cursors existed.
|
|
148
|
-
*/
|
|
149
|
-
async function buildTurnThreadContext(args) {
|
|
150
|
-
const afterSeq = args.hasHistory ? await loadThreadContextCursor({
|
|
151
|
-
conversationId: args.conversationId,
|
|
152
|
-
turnId: args.turnId
|
|
153
|
-
}) : void 0;
|
|
154
|
-
const block = buildConversationContext(args.conversation, {
|
|
155
|
-
excludeMessageIds: args.excludeMessageIds,
|
|
156
|
-
...args.hasHistory ? { history: { afterSeq } } : void 0
|
|
157
|
-
});
|
|
158
|
-
setSpanAttributes({
|
|
159
|
-
"app.thread_context.chars": block.text?.length ?? 0,
|
|
160
|
-
"app.thread_context.shown_messages": block.shownMessages,
|
|
161
|
-
"app.thread_context.omitted_messages": block.omittedMessages,
|
|
162
|
-
"app.thread_context.cursor": !args.hasHistory ? "no_history" : afterSeq === void 0 ? "missing" : "found"
|
|
163
|
-
});
|
|
164
|
-
return block.text;
|
|
165
|
-
}
|
|
166
|
-
export { buildDeliveredTurnStatePatch as a, persistAuthPauseTurnState as i, loadThreadContextTrimFloor as n, loadPendingMessageCards as o, completeAuthPauseTurn as r, buildTurnThreadContext as t };
|
package/dist/topic-CRYYBYp-.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// src/core/turn/topic.ts
|
|
2
|
-
/** Queue topic of Turn step messages. */
|
|
3
|
-
const TURN_STEP_TOPIC = "junior_turn_step";
|
|
4
|
-
// src/core/delivery/topic.ts
|
|
5
|
-
/** Queue topic of delivery messages. */
|
|
6
|
-
const DELIVERY_TOPIC = "junior_delivery";
|
|
7
|
-
export { TURN_STEP_TOPIC as n, DELIVERY_TOPIC as t };
|
package/dist/topics-SRN7IVX-.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// src/chat/optional-string.ts
|
|
2
|
-
/**
|
|
3
|
-
* Normalize optional env-style strings so blank values do not masquerade as
|
|
4
|
-
* configured inputs.
|
|
5
|
-
*/
|
|
6
|
-
function toOptionalTrimmed(value) {
|
|
7
|
-
if (!value) return;
|
|
8
|
-
const trimmed = value.trim();
|
|
9
|
-
return trimmed.length > 0 ? trimmed : void 0;
|
|
10
|
-
}
|
|
11
|
-
// src/chat/queue/topics.ts
|
|
12
|
-
/**
|
|
13
|
-
* Queue topic names. Vercel queue wiring uses them at build, so keep them
|
|
14
|
-
* stable, and keep this module free of runtime configuration.
|
|
15
|
-
*/
|
|
16
|
-
const CACHE_WARMUP_QUEUE_TOPIC = "junior_cache_warmups";
|
|
17
|
-
const PLUGIN_TASK_QUEUE_TOPIC = "junior_plugin_tasks";
|
|
18
|
-
const WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC = "junior_workspace_snapshots";
|
|
19
|
-
const BACKGROUND_COMPACTION_QUEUE_TOPIC = "junior_context_compaction";
|
|
20
|
-
/** Resolve the Vercel Queue topic used for conversation wake-up nudges. */
|
|
21
|
-
function resolveConversationWorkQueueTopic(options = {}) {
|
|
22
|
-
return options.topic?.trim() || process.env["JUNIOR_CONVERSATION_WORK_QUEUE_TOPIC"]?.trim() || "junior_conversation_work";
|
|
23
|
-
}
|
|
24
|
-
export { resolveConversationWorkQueueTopic as a, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as i, CACHE_WARMUP_QUEUE_TOPIC as n, toOptionalTrimmed as o, PLUGIN_TASK_QUEUE_TOPIC as r, BACKGROUND_COMPACTION_QUEUE_TOPIC as t };
|