@sentry/junior 0.312.0 → 0.314.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-iIq7ihf7.js → adapter-JARQvoLw.js} +1 -2
- package/dist/{adapter-context-BRjEWRy1.js → adapter-context-B4BrJZuS.js} +2 -2
- package/dist/{admin-DhInw5K9.js → admin-BXGAySz0.js} +1 -1
- package/dist/{agent-runner-C9iDurwX.js → agent-runner-qZU5TR8i.js} +865 -138
- package/dist/agent-update-cS7Z9mnG.js +26 -0
- package/dist/agent-update-delivery-CZ5M8RDa.js +85 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +1 -1
- package/dist/api.js +340 -106
- package/dist/{app-DRFrC8Mw.d.ts → app-D7tKnw9a.d.ts} +4 -21
- package/dist/app.d.ts +2 -2
- package/dist/app.js +80 -171
- package/dist/{background-compaction-queue-DrKi7w3d.js → background-compaction-queue-C_uIBUvS.js} +6 -17
- package/dist/{callback-mFlTUWWx.js → callback-C8SdXCwr.js} +4 -11
- package/dist/{catalog-runtime-D7xapBAX.js → catalog-runtime-BLKtnUL3.js} +1 -1
- package/dist/{channel-access-CJGfNTdn.js → channel-access-BOL29BG3.js} +6 -6
- package/dist/child-message--2G3Ft26.js +19 -0
- package/dist/cli/chat.js +18 -21
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +5 -5
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +23 -4
- package/dist/{config-kXB2Y5tl.js → config-BIfHKNXN.js} +40 -35
- package/dist/{continue-in-slack-O6pV5004.js → continue-in-slack-fnmD2Ifb.js} +5 -7
- package/dist/{conversation-feed-uNOv_x68.js → conversation-feed-DdFQuQDR.js} +13 -2
- package/dist/{logging-dQ9ZRGQ8.js → conversation-privacy-DtZhI91r.js} +188 -2
- package/dist/{conversation-turn-CeLbHqdw.js → conversation-turn-DScuDYmN.js} +465 -62
- package/dist/create-CrNt4Ewu.js +212 -0
- package/dist/{credential-sync-I8VBGk05.js → credential-sync-CtqsGjj1.js} +14 -18
- package/dist/{credentialed-Cb6E2phL.js → credentialed-dWRA3-oJ.js} +911 -429
- package/dist/{db-LAyyX8tk.js → db-BTmLKZrp.js} +2245 -50
- package/dist/{db-BbC5stfa.d.ts → db-DcmzbA55.d.ts} +2 -2
- package/dist/{history-CYstOMKX.js → history-CneKY7_V.js} +19 -1
- package/dist/{html-BCZ3Xtb_.js → html-B8rBt7F4.js} +5 -7
- package/dist/{install-DCFJFkC0.js → install-OtFboxOM.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-B_m-4TJw.js → lineage-EULJkGO1.js} +1 -2
- package/dist/{list-CN2QA2R9.js → list-C5400AlJ.js} +284 -113
- package/dist/{thread-state-DhPndWi1.js → mailbox-turn-DL3Lvsm0.js} +4830 -485
- package/dist/markers-DUP8aBOp.js +323 -0
- package/dist/{media-CYm1QD8T.js → media-FYM-Bl3H.js} +42 -14
- package/dist/{message-DSXGj1hM.js → message-DuDelZFr.js} +16 -15
- package/dist/{model-input--TrP9hYV.js → model-input-0osF3pBS.js} +3 -3
- package/dist/nitro.d.ts +2 -4
- package/dist/nitro.js +340 -13
- package/dist/{oauth-callback-server-DHCZC6B4.js → oauth-callback-server-DX2fQ7Nq.js} +2 -2
- package/dist/{oauth-relay-pPMGnDZt.js → oauth-relay-PwPMdZJv.js} +1 -1
- package/dist/{plugins-Bkk0XRo2.js → plugins-BXMdNdyA.js} +1 -1
- package/dist/{registry-CZOzddwu.js → registry-D6kS6xYH.js} +1402 -64
- package/dist/{statuses-_cRJHXK7.js → reporting-window-C4dbzDiR.js} +1 -27
- package/dist/{resolve-cKOQ14Dh.js → resolve-D8CPJcNK.js} +3 -3
- package/dist/result-D090hxr5.js +402 -0
- package/dist/{runner-DBfUW44l.js → runner-BU7fgrm-.js} +7 -8
- package/dist/{sandbox-egress-signals-BVF_xAm1.js → sandbox-egress-signals-BUmVrsoG.js} +1 -1
- package/dist/{schema-Bk9Nm2E8.js → schema-7gW9vBpJ.js} +91 -10
- package/dist/{schema-BEHKxr4I.d.ts → schema-BB6E0wyV.d.ts} +2105 -2753
- package/dist/{service-account-CVYsFjty.js → service-account-plA-uzIB.js} +6 -5
- package/dist/{skills-VTnhAJWm.js → skills-CIosT6bS.js} +3 -3
- package/dist/{slack-conversation-unfurl-fuLnF1jE.js → slack-conversation-unfurl-CBgZqth6.js} +8 -10
- package/dist/spawn-DRjdzh3R.js +46 -0
- package/dist/{start-conversation-CEn2KH1A.js → start-conversation-a4NXH4X9.js} +13 -202
- package/dist/{store-DFZaN-Ix.js → store-BuhF1QDm.js} +2 -4
- package/dist/{task-queue-Cx4Lmjyk.js → task-queue-CrRjFzOh.js} +5 -16
- package/dist/{task-runner-CbTwFA6k.js → task-runner-C-pXsgHM.js} +105 -51
- package/dist/{thread-context-BkAZDTX2.js → thread-context-CDX4dSZd.js} +8 -10
- package/dist/turn-session-routing-CZTRU8IY.js +116 -0
- package/dist/turn-wake-Bzq1Efrm.js +154 -0
- package/dist/user-customization-B27StpVQ.js +9 -0
- package/dist/{validation-nIzMtAVJ.js → validation-bTq88sya.js} +1 -1
- package/dist/{vercel-queue-hW90XzbG.js → vercel-queue-nL0Hq3hr.js} +32 -147
- package/dist/{version-Brbtz4Qf.js → version-DGUa1dZK.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-BDA5myRK.js → warmup-CCOuIwAS.js} +831 -3254
- package/dist/{worker-D63RcaVD.js → worker-AkZg7Dg1.js} +5 -6
- package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
- package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -0
- package/migrations/0160_money_micro_usd_repair.sql +99 -0
- package/migrations/0161_agent_config_backfill.sql +34 -0
- package/migrations/0162_inbox_item_deliveries.sql +15 -0
- package/migrations/0163_pg_trgm.sql +2 -0
- package/migrations/0164_search_indexes.sql +4 -0
- package/migrations/0165_drop_legacy_archive_columns.sql +4 -0
- package/migrations/0166_memory_prefix_index.sql +1 -0
- package/migrations/0167_todo_search_indexes.sql +2 -0
- package/migrations/0168_todo_inbox_items.sql +4 -0
- package/migrations/0169_drop_code_urls.sql +2 -0
- package/migrations/meta/0158_snapshot.json +6515 -0
- package/migrations/meta/0159_snapshot.json +6515 -0
- package/migrations/meta/0160_snapshot.json +6515 -0
- package/migrations/meta/0161_snapshot.json +6278 -0
- package/migrations/meta/0162_snapshot.json +6404 -0
- package/migrations/meta/0163_snapshot.json +6404 -0
- package/migrations/meta/0164_snapshot.json +6466 -0
- package/migrations/meta/0165_snapshot.json +6466 -0
- package/migrations/meta/0166_snapshot.json +6494 -0
- package/migrations/meta/0167_snapshot.json +6525 -0
- package/migrations/meta/0168_snapshot.json +6525 -0
- package/migrations/meta/0169_snapshot.json +6513 -0
- package/migrations/meta/_journal.json +84 -0
- package/package.json +9 -18
- package/skills/design-automation-skill/SKILL.md +2 -3
- package/dist/actor-BsBdxDXQ.js +0 -208
- package/dist/child-message-DcsritGf.js +0 -179
- package/dist/conversation-privacy-L4ja1_W6.js +0 -189
- package/dist/executor-SCub-fAq.js +0 -1860
- package/dist/fan-out-Cod-yEHG.js +0 -10
- package/dist/ingest-BDf3D50j.js +0 -3836
- package/dist/result-DcvEOe1r.js +0 -574
- package/dist/result-event-type-BdIJuZxg.js +0 -48
- package/dist/service-account-Ts4ulcrV.js +0 -931
- package/dist/spawn-vxAarlX5.js +0 -73
- package/dist/state-C1P3_Ywk.js +0 -161
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-dQ9ZRGQ8.js";
|
|
2
|
-
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
|
|
4
|
-
// src/chat/conversation-privacy.ts
|
|
5
|
-
const SAFE_METADATA_KEY_LIMIT = 20;
|
|
6
|
-
const conversationPrivacyStorage = new AsyncLocalStorage();
|
|
7
|
-
/**
|
|
8
|
-
* Resolve whether a Conversation may expose full transcript and tool data.
|
|
9
|
-
*
|
|
10
|
-
* Read visibility from the stored Conversation. If it is missing, warn and
|
|
11
|
-
* treat the Conversation as private. Do not infer visibility from identifiers.
|
|
12
|
-
*/
|
|
13
|
-
function resolveConversationPrivacy(input) {
|
|
14
|
-
if (input.visibility === void 0) logWarn("conversation.visibility.defaulted");
|
|
15
|
-
return input.visibility === "public" ? "public" : "private";
|
|
16
|
-
}
|
|
17
|
-
/** Return whether a public Conversation may expose transcript and tool data. */
|
|
18
|
-
function canExposeConversationPayload(input) {
|
|
19
|
-
return resolveConversationPrivacy(input) === "public";
|
|
20
|
-
}
|
|
21
|
-
/** Return privacy for the current agent Turn. */
|
|
22
|
-
function getCurrentConversationPrivacy() {
|
|
23
|
-
return conversationPrivacyStorage.getStore();
|
|
24
|
-
}
|
|
25
|
-
/** Bind one conversation privacy mode to all async work in a turn. */
|
|
26
|
-
function runWithConversationPrivacy(privacy, callback) {
|
|
27
|
-
return conversationPrivacyStorage.run(privacy, callback);
|
|
28
|
-
}
|
|
29
|
-
function payloadType(payload) {
|
|
30
|
-
return Array.isArray(payload) ? "array" : typeof payload;
|
|
31
|
-
}
|
|
32
|
-
function payloadKeys(payload) {
|
|
33
|
-
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return;
|
|
34
|
-
const keys = Object.keys(payload).slice(0, SAFE_METADATA_KEY_LIMIT);
|
|
35
|
-
return keys.length > 0 ? keys : void 0;
|
|
36
|
-
}
|
|
37
|
-
function serializedLength(payload) {
|
|
38
|
-
return (typeof payload === "string" ? payload : JSON.stringify(payload))?.length ?? 0;
|
|
39
|
-
}
|
|
40
|
-
/** Convert an arbitrary payload into safe structured metadata for trace data fields. */
|
|
41
|
-
function toGenAiPayloadMetadata(payload) {
|
|
42
|
-
const base = {
|
|
43
|
-
type: payloadType(payload),
|
|
44
|
-
chars: serializedLength(payload)
|
|
45
|
-
};
|
|
46
|
-
if (!payload || typeof payload !== "object" || Array.isArray(payload)) return base;
|
|
47
|
-
const keys = payloadKeys(payload);
|
|
48
|
-
return {
|
|
49
|
-
...base,
|
|
50
|
-
...keys ? { keys } : void 0
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
/** Convert an arbitrary payload into safe flattened trace attributes. */
|
|
54
|
-
function toGenAiPayloadTraceAttributes(prefix, payload) {
|
|
55
|
-
const size = serializedLength(payload);
|
|
56
|
-
const attributes = {
|
|
57
|
-
[`${prefix}.type`]: payloadType(payload),
|
|
58
|
-
[`${prefix}.size_chars`]: size,
|
|
59
|
-
[`${prefix}.size`]: size
|
|
60
|
-
};
|
|
61
|
-
const keys = payloadKeys(payload);
|
|
62
|
-
if (keys) attributes[`${prefix}.keys`] = keys;
|
|
63
|
-
return attributes;
|
|
64
|
-
}
|
|
65
|
-
function summarizeContent(content) {
|
|
66
|
-
if (typeof content === "string") return {
|
|
67
|
-
chars: content.length,
|
|
68
|
-
partTypes: ["text"]
|
|
69
|
-
};
|
|
70
|
-
if (!Array.isArray(content)) return {
|
|
71
|
-
chars: serializedLength(content),
|
|
72
|
-
partTypes: [payloadType(content)]
|
|
73
|
-
};
|
|
74
|
-
let chars = 0;
|
|
75
|
-
const partTypes = /* @__PURE__ */ new Set();
|
|
76
|
-
for (const part of content) {
|
|
77
|
-
if (!part || typeof part !== "object") {
|
|
78
|
-
chars += serializedLength(part);
|
|
79
|
-
partTypes.add(payloadType(part));
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
const record = part;
|
|
83
|
-
const type = canonicalContentPartType(typeof record["type"] === "string" ? record["type"] : "unknown");
|
|
84
|
-
partTypes.add(type);
|
|
85
|
-
if (typeof record["text"] === "string") chars += record["text"].length;
|
|
86
|
-
else if (typeof record["thinking"] === "string") chars += record["thinking"].length;
|
|
87
|
-
else if (typeof record["data"] === "string") chars += record["data"].length;
|
|
88
|
-
else chars += serializedLength(part);
|
|
89
|
-
}
|
|
90
|
-
return {
|
|
91
|
-
chars,
|
|
92
|
-
partTypes: [...partTypes]
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
function normalizeFinishReason(reason) {
|
|
96
|
-
return reason === "toolUse" ? "tool_call" : reason;
|
|
97
|
-
}
|
|
98
|
-
function canonicalContentPartType(type) {
|
|
99
|
-
if (type === "thinking") return "reasoning";
|
|
100
|
-
if (type === "toolCall") return "tool_call";
|
|
101
|
-
return type;
|
|
102
|
-
}
|
|
103
|
-
function toCanonicalPart(part) {
|
|
104
|
-
if (part.type === "text") return {
|
|
105
|
-
type: "text",
|
|
106
|
-
content: part.text
|
|
107
|
-
};
|
|
108
|
-
if (part.type === "thinking") {
|
|
109
|
-
if (part.redacted) return;
|
|
110
|
-
return {
|
|
111
|
-
type: "reasoning",
|
|
112
|
-
content: part.thinking
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
if (part.type === "toolCall") return {
|
|
116
|
-
type: "tool_call",
|
|
117
|
-
id: part.id,
|
|
118
|
-
name: part.name,
|
|
119
|
-
arguments: part.arguments
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function toCanonicalParts(parts) {
|
|
123
|
-
return parts.map(toCanonicalPart).filter((part) => part !== void 0);
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Map a pi-ai AssistantMessage to the canonical gen_ai.output.messages shape:
|
|
127
|
-
* `{ role, parts: [...], finish_reason }` — drops provider noise fields.
|
|
128
|
-
*/
|
|
129
|
-
function toCanonicalOutputMessage(message) {
|
|
130
|
-
return {
|
|
131
|
-
role: "assistant",
|
|
132
|
-
parts: toCanonicalParts(message.content),
|
|
133
|
-
finish_reason: normalizeFinishReason(message.stopReason)
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Map a pi-ai Message (system/user/assistant/toolResult) to the canonical
|
|
138
|
-
* gen_ai.input.messages shape: `{ role, parts: [...] }`.
|
|
139
|
-
*/
|
|
140
|
-
function toCanonicalInputMessage(message) {
|
|
141
|
-
if (message.role === "system") return {
|
|
142
|
-
role: "system",
|
|
143
|
-
parts: [{
|
|
144
|
-
type: "text",
|
|
145
|
-
content: renderSystemMessageUpdate(message)
|
|
146
|
-
}]
|
|
147
|
-
};
|
|
148
|
-
if (message.role === "user") return {
|
|
149
|
-
role: "user",
|
|
150
|
-
parts: typeof message.content === "string" ? [{
|
|
151
|
-
type: "text",
|
|
152
|
-
content: message.content
|
|
153
|
-
}] : toCanonicalParts(message.content)
|
|
154
|
-
};
|
|
155
|
-
if (message.role === "toolResult") return {
|
|
156
|
-
role: "tool",
|
|
157
|
-
parts: [{
|
|
158
|
-
type: "tool_call_response",
|
|
159
|
-
id: message.toolCallId,
|
|
160
|
-
response: toCanonicalParts(message.content)
|
|
161
|
-
}]
|
|
162
|
-
};
|
|
163
|
-
return toCanonicalOutputMessage(message);
|
|
164
|
-
}
|
|
165
|
-
/** Summarize a message list without exposing raw message content. */
|
|
166
|
-
function toGenAiMessagesTraceAttributes(prefix, messages) {
|
|
167
|
-
let contentChars = 0;
|
|
168
|
-
const roles = /* @__PURE__ */ new Set();
|
|
169
|
-
const partTypes = /* @__PURE__ */ new Set();
|
|
170
|
-
for (const message of messages) {
|
|
171
|
-
if (!message || typeof message !== "object") {
|
|
172
|
-
contentChars += serializedLength(message);
|
|
173
|
-
continue;
|
|
174
|
-
}
|
|
175
|
-
const record = message;
|
|
176
|
-
if (typeof record["role"] === "string") roles.add(record["role"]);
|
|
177
|
-
const summary = summarizeContent(record["content"]);
|
|
178
|
-
contentChars += summary.chars;
|
|
179
|
-
for (const partType of summary.partTypes) partTypes.add(partType);
|
|
180
|
-
}
|
|
181
|
-
return {
|
|
182
|
-
[`${prefix}.message_count`]: messages.length,
|
|
183
|
-
[`${prefix}.content_chars`]: contentChars,
|
|
184
|
-
[`${prefix}.messages.size`]: contentChars,
|
|
185
|
-
...roles.size > 0 ? { [`${prefix}.roles`]: [...roles] } : void 0,
|
|
186
|
-
...partTypes.size > 0 ? { [`${prefix}.part_types`]: [...partTypes] } : void 0
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
export { toCanonicalInputMessage as a, toGenAiPayloadMetadata as c, runWithConversationPrivacy as i, toGenAiPayloadTraceAttributes as l, getCurrentConversationPrivacy as n, toCanonicalOutputMessage as o, resolveConversationPrivacy as r, toGenAiMessagesTraceAttributes as s, canExposeConversationPayload as t };
|