@sentry/junior 0.318.0 → 0.320.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/{context-BKF_5zzI.js → adapter-DlLLoJKj.js} +537 -537
- package/dist/{admin-UOHix_5P.js → admin-BzRXDVfh.js} +1 -1
- package/dist/{agent-runner-DeYymwh2.js → agent-DxZ7nHfD.js} +19866 -6720
- package/dist/{agent-status-BA5x3Xtp.js → agent-status-Bq_AIpyp.js} +105 -1
- package/dist/{agent-update-delivery-DH8bx7jU.js → agent-update-delivery-CO4FU5Gg.js} +4 -5
- package/dist/api/schema.d.ts +45 -23
- package/dist/api/schema.js +4 -4
- package/dist/api.js +79 -84
- package/dist/{app-DKAOuaoC.d.ts → app-CHCFIIDu.d.ts} +5 -4
- package/dist/app.d.ts +2 -2
- package/dist/app.js +119 -194
- package/dist/{change-record-BzJgLsv7.d.ts → change-record-K-KsqNhT.d.ts} +9 -5
- package/dist/{channel-access-A0de5lRv.js → channel-access-BghWqlXx.js} +1 -1
- package/dist/{chat-core-engine-D3Wd7f5n.js → chat-core-engine-BgfSLrDu.js} +31 -14
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.js +23 -23
- 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 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -4
- package/dist/{continue-in-slack-YxwMQVeR.js → continue-in-slack-DBlQP4PC.js} +3 -3
- package/dist/{conversation-feed-Cj7IuBtM.js → conversation-feed-DEUdD7mb.js} +2 -106
- package/dist/{conversation-privacy-Cr_dNW1p.js → conversation-privacy-qoh95v90.js} +1 -1
- package/dist/{create-Btl1y1rq.js → create-jZSaDrCR.js} +115 -5
- package/dist/{credential-sync-DTarZ63K.js → credential-sync-Bj9-UlNE.js} +15 -18
- package/dist/{db-of6e3sGt.js → db-BacvswT0.js} +4602 -727
- package/dist/{deployment-C0qXa0FD.js → deployment-BoJkRPDt.js} +3 -3
- package/dist/{engine-context-C_QL_bMQ.js → engine-context-Bi3Ync5t.js} +521 -150
- package/dist/{html-9_pS9SjY.js → html-DW0pw5Pr.js} +6 -8
- package/dist/instrumentation.js +7 -23
- package/dist/list-Dz3CdP3g.js +5016 -0
- package/dist/{logging-BnOG0qz2.js → logging-DsTnMqyi.js} +8 -33
- package/dist/{mailbox-turn-Byrry9o1.js → markers-C33gNYNE.js} +1705 -1284
- package/dist/nitro.d.ts +2 -2
- package/dist/nitro.js +6 -7
- package/dist/{oauth-callback-server-CjnnUr4o.js → oauth-callback-server-C-pEhAQK.js} +2 -2
- package/dist/{oauth-relay-BvHFH0fV.js → oauth-relay-DIXdH-io.js} +1 -1
- package/dist/{plugins-fBrz8PCV.d.ts → plugins-DhGXZjlu.d.ts} +1 -0
- package/dist/{profile-iHw1uu32.js → profile-v9vA3RvH.js} +16 -18
- package/dist/{prompt-DEkStuxG.js → prompt-C5CW2wKO.js} +1 -1
- package/dist/{reports-C1d9azyV.js → reports-eBgrhPXS.js} +2 -2
- package/dist/{resolve-DC6zBuDV.js → resolve-HVXmbeCr.js} +5 -5
- package/dist/{result-DxewDuXb.js → result-BPNzgeTl.js} +20 -9
- package/dist/{runner-99YxVN_r.js → runner-aNSDTST6.js} +7 -8
- package/dist/{sandbox-egress-signals-CgoX5CTI.js → sandbox-egress-signals-nzp9Ykf7.js} +1 -1
- package/dist/{schema-BTojNBr5.js → schema-BlTO5M1d.js} +16 -8
- package/dist/{service-account-YDCPSByj.js → service-account-DWIf1t6p.js} +4 -5
- package/dist/{skills-CleC0Hze.js → skills-50izzzdK.js} +9 -9
- package/dist/{slack-conversation-unfurl-BNQLC12R.js → slack-conversation-unfurl-C6jXhVYg.js} +7 -7
- package/dist/storage-BtCxXiNt.js +273 -0
- package/dist/{system-prompt-table-Ci6Ck4gk.js → system-prompt-table-CIR1B44Z.js} +27 -85
- package/dist/topic-B2EWKKBT.js +6 -0
- package/dist/{package-discovery-DD9vencX.js → topics-DxuKurCX.js} +21 -1
- package/dist/{types-DCzTAA63.js → types-BNHkJrOP.js} +25 -11
- package/dist/{users-Cb9c1k9q.js → users-DOVo9sdU.js} +1 -1
- package/dist/{validation-BiUmWPhy.js → validation-CK0vuEHB.js} +4 -4
- package/dist/{version-VEXiEcZu.js → version-BuLVNlxB.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-ChWYQdhm.js → worker-C82kHU1R.js} +4 -4
- 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/migrations/20261127150242_drop_space_members/migration.sql +9 -0
- package/migrations/20261127150242_drop_space_members/snapshot.json +53 -0
- package/package.json +9 -7
- package/dist/auth-pause-state-f9hJM_zO.js +0 -113
- package/dist/catalog-runtime-BfdAnztW.js +0 -6
- package/dist/child-message-peFWLcCZ.js +0 -15
- package/dist/conversation-turn-Bru4w_FD.js +0 -1250
- package/dist/job-runner-B2XEvpif.js +0 -1505
- package/dist/lineage-nh4z9iQN.js +0 -36
- package/dist/list-HRP3TIRl.js +0 -12631
- package/dist/markers-CTTtJqYn.js +0 -342
- package/dist/message-BRUuLgrY.js +0 -153
- package/dist/model-input-CFC62mf-.js +0 -82
- package/dist/registry-Cl7Labpe.js +0 -3279
- package/dist/run-conversation-Cz2ubZK-.js +0 -337
- package/dist/sender-actors-77zTQbSG.js +0 -84
- package/dist/spawn-DuZfodPa.js +0 -45
- package/dist/task-runner-BJ9Up3bG.js +0 -1529
- package/dist/topic-CRYYBYp-.js +0 -7
- package/dist/topics-BoCkoPJJ.js +0 -21
- package/dist/turn-membership-VT7XZh-L.js +0 -856
- package/dist/turn-wake-C7HeLHAM.js +0 -151
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { R as getChatConfig } from "./adapter-DlLLoJKj.js";
|
|
2
|
+
import { G as mapBounded } from "./prompt-C5CW2wKO.js";
|
|
3
|
+
import * as z from "zod";
|
|
4
|
+
import { AwsClient } from "aws4fetch";
|
|
5
|
+
import { del, get, issueSignedToken, presignUrl, put } from "@vercel/blob";
|
|
6
|
+
// src/chat/attachments/memory.ts
|
|
7
|
+
/**
|
|
8
|
+
* Store attachments in process memory, for tests.
|
|
9
|
+
*
|
|
10
|
+
* Objects are lost when the process stops, and each process has its own
|
|
11
|
+
* copy. Do not use this provider for deployed apps.
|
|
12
|
+
*/
|
|
13
|
+
function createMemoryAttachmentStorage() {
|
|
14
|
+
const objects = /* @__PURE__ */ new Map();
|
|
15
|
+
return {
|
|
16
|
+
objects,
|
|
17
|
+
provider: "memory",
|
|
18
|
+
async put(input) {
|
|
19
|
+
objects.set(input.key, Buffer.from(await new Response(input.body).arrayBuffer()));
|
|
20
|
+
},
|
|
21
|
+
async get(key, range) {
|
|
22
|
+
const body = objects.get(key);
|
|
23
|
+
if (!body) return null;
|
|
24
|
+
const bytes = range ? body.subarray(range.start, range.end + 1) : body;
|
|
25
|
+
return new ReadableStream({ start(controller) {
|
|
26
|
+
controller.enqueue(new Uint8Array(bytes));
|
|
27
|
+
controller.close();
|
|
28
|
+
} });
|
|
29
|
+
},
|
|
30
|
+
async delete(keys) {
|
|
31
|
+
for (const key of keys) objects.delete(key);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
// src/chat/attachments/s3.ts
|
|
36
|
+
const S3_DELETE_CONCURRENCY = 8;
|
|
37
|
+
/**
|
|
38
|
+
* Path-style object URL. Local S3 servers and AWS S3 both accept it.
|
|
39
|
+
*
|
|
40
|
+
* URL parsing removes `.` and `..` segments, also in `%2e` form. A key with
|
|
41
|
+
* such a segment would address a different object, so reject it.
|
|
42
|
+
*/
|
|
43
|
+
function objectUrl(config, key) {
|
|
44
|
+
const endpoint = config.endpoint.replace(/\/+$/, "");
|
|
45
|
+
const segments = key.split("/");
|
|
46
|
+
if (segments.some((segment) => segment === "." || segment === "..")) throw new Error("S3 object keys cannot contain . or .. path segments");
|
|
47
|
+
const path = segments.map(encodeURIComponent).join("/");
|
|
48
|
+
return `${endpoint}/${encodeURIComponent(config.bucket)}/${path}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Read a small S3 response body to the end so the connection is released.
|
|
52
|
+
*
|
|
53
|
+
* Error and empty bodies are small. `body.cancel()` can hang under the test
|
|
54
|
+
* HTTP interceptor, so read the body instead.
|
|
55
|
+
*/
|
|
56
|
+
async function drain(response) {
|
|
57
|
+
await response.arrayBuffer();
|
|
58
|
+
}
|
|
59
|
+
/** Throw on a failed S3 response, and release the response body. */
|
|
60
|
+
async function expectOk(response, operation) {
|
|
61
|
+
await drain(response);
|
|
62
|
+
if (!response.ok) throw new Error(`S3 ${operation} failed with status ${response.status}`);
|
|
63
|
+
}
|
|
64
|
+
/** Presigned URL lifetime in whole seconds, at least one. */
|
|
65
|
+
function expiresInSeconds(expiresAtMs) {
|
|
66
|
+
return String(Math.max(1, Math.ceil((expiresAtMs - Date.now()) / 1e3)));
|
|
67
|
+
}
|
|
68
|
+
/** Store private conversation attachments in an S3-compatible bucket. */
|
|
69
|
+
function createS3AttachmentStorage(config) {
|
|
70
|
+
const client = new AwsClient({
|
|
71
|
+
accessKeyId: config.accessKeyId,
|
|
72
|
+
region: config.region,
|
|
73
|
+
secretAccessKey: config.secretAccessKey,
|
|
74
|
+
service: "s3"
|
|
75
|
+
});
|
|
76
|
+
const writeClient = new AwsClient({
|
|
77
|
+
accessKeyId: config.accessKeyId,
|
|
78
|
+
region: config.region,
|
|
79
|
+
retries: 0,
|
|
80
|
+
secretAccessKey: config.secretAccessKey,
|
|
81
|
+
service: "s3"
|
|
82
|
+
});
|
|
83
|
+
return {
|
|
84
|
+
provider: "s3",
|
|
85
|
+
async put(input) {
|
|
86
|
+
await expectOk(await writeClient.fetch(objectUrl(config, input.key), {
|
|
87
|
+
body: input.body,
|
|
88
|
+
headers: {
|
|
89
|
+
"content-length": String(input.bytes),
|
|
90
|
+
"content-type": input.contentType,
|
|
91
|
+
"x-amz-content-sha256": "UNSIGNED-PAYLOAD"
|
|
92
|
+
},
|
|
93
|
+
method: "PUT"
|
|
94
|
+
}), "put");
|
|
95
|
+
},
|
|
96
|
+
async createUploadTarget(input) {
|
|
97
|
+
const url = new URL(objectUrl(config, input.key));
|
|
98
|
+
url.searchParams.set("X-Amz-Expires", expiresInSeconds(input.expiresAtMs));
|
|
99
|
+
const browserHeaders = {
|
|
100
|
+
"content-type": input.contentType,
|
|
101
|
+
"if-none-match": "*"
|
|
102
|
+
};
|
|
103
|
+
return {
|
|
104
|
+
headers: browserHeaders,
|
|
105
|
+
method: "PUT",
|
|
106
|
+
url: (await client.sign(url.toString(), {
|
|
107
|
+
aws: {
|
|
108
|
+
allHeaders: true,
|
|
109
|
+
signQuery: true
|
|
110
|
+
},
|
|
111
|
+
headers: {
|
|
112
|
+
...browserHeaders,
|
|
113
|
+
"content-length": String(input.bytes)
|
|
114
|
+
},
|
|
115
|
+
method: "PUT"
|
|
116
|
+
})).url
|
|
117
|
+
};
|
|
118
|
+
},
|
|
119
|
+
async createDownloadUrl(input) {
|
|
120
|
+
const url = new URL(objectUrl(config, input.key));
|
|
121
|
+
url.searchParams.set("X-Amz-Expires", expiresInSeconds(input.expiresAtMs));
|
|
122
|
+
return (await client.sign(url.toString(), {
|
|
123
|
+
aws: { signQuery: true },
|
|
124
|
+
method: "GET"
|
|
125
|
+
})).url;
|
|
126
|
+
},
|
|
127
|
+
async get(key, range) {
|
|
128
|
+
const response = await client.fetch(objectUrl(config, key), range ? { headers: { range: rangeHeader(range) } } : void 0);
|
|
129
|
+
if (response.status === 404) {
|
|
130
|
+
await drain(response);
|
|
131
|
+
return null;
|
|
132
|
+
}
|
|
133
|
+
if (!response.ok) await expectOk(response, "get");
|
|
134
|
+
if (range && response.status !== 206) {
|
|
135
|
+
await drain(response);
|
|
136
|
+
throw new Error(`S3 get ignored the byte range with status ${response.status}`);
|
|
137
|
+
}
|
|
138
|
+
return response.body;
|
|
139
|
+
},
|
|
140
|
+
async delete(keys) {
|
|
141
|
+
await mapBounded(keys, async (key) => {
|
|
142
|
+
const response = await client.fetch(objectUrl(config, key), { method: "DELETE" });
|
|
143
|
+
if (response.status === 404) {
|
|
144
|
+
await drain(response);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
await expectOk(response, "delete");
|
|
148
|
+
}, S3_DELETE_CONCURRENCY);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
// src/chat/attachments/vercel.ts
|
|
153
|
+
const BLOB_API_VERSION = "12";
|
|
154
|
+
const delegationPayloadSchema = z.object({ storeId: z.string().min(1) });
|
|
155
|
+
/**
|
|
156
|
+
* Read the store id from a delegation token, as the SDK does for its own
|
|
157
|
+
* presigned requests. The token payload is base64url JSON before the dot.
|
|
158
|
+
*/
|
|
159
|
+
function delegationStoreId(delegationToken) {
|
|
160
|
+
const { storeId } = delegationPayloadSchema.parse(JSON.parse(Buffer.from(delegationToken.split(".")[0] ?? "", "base64url").toString()));
|
|
161
|
+
return storeId.replace(/^store_/, "");
|
|
162
|
+
}
|
|
163
|
+
/** Store private conversation attachments in Vercel Blob. */
|
|
164
|
+
function createVercelAttachmentStorage() {
|
|
165
|
+
return {
|
|
166
|
+
provider: "vercel-blob",
|
|
167
|
+
async put(input) {
|
|
168
|
+
await put(input.key, input.body, {
|
|
169
|
+
access: "private",
|
|
170
|
+
addRandomSuffix: false,
|
|
171
|
+
allowOverwrite: true,
|
|
172
|
+
contentType: input.contentType
|
|
173
|
+
});
|
|
174
|
+
},
|
|
175
|
+
async createUploadTarget(input) {
|
|
176
|
+
const limits = {
|
|
177
|
+
allowedContentTypes: [input.contentType],
|
|
178
|
+
maximumSizeInBytes: input.bytes,
|
|
179
|
+
validUntil: input.expiresAtMs
|
|
180
|
+
};
|
|
181
|
+
const token = await issueSignedToken({
|
|
182
|
+
...limits,
|
|
183
|
+
operations: ["put"],
|
|
184
|
+
pathname: input.key
|
|
185
|
+
});
|
|
186
|
+
const { presignedUrl } = await presignUrl(token, {
|
|
187
|
+
...limits,
|
|
188
|
+
access: "private",
|
|
189
|
+
addRandomSuffix: false,
|
|
190
|
+
allowOverwrite: false,
|
|
191
|
+
operation: "put",
|
|
192
|
+
pathname: input.key
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
headers: {
|
|
196
|
+
"x-api-version": BLOB_API_VERSION,
|
|
197
|
+
"x-content-type": input.contentType,
|
|
198
|
+
"x-vercel-blob-access": "private",
|
|
199
|
+
"x-vercel-blob-store-id": delegationStoreId(token.delegationToken)
|
|
200
|
+
},
|
|
201
|
+
method: "PUT",
|
|
202
|
+
url: presignedUrl
|
|
203
|
+
};
|
|
204
|
+
},
|
|
205
|
+
async createDownloadUrl(input) {
|
|
206
|
+
const token = await issueSignedToken({
|
|
207
|
+
operations: ["get"],
|
|
208
|
+
pathname: input.key,
|
|
209
|
+
validUntil: input.expiresAtMs
|
|
210
|
+
});
|
|
211
|
+
const { presignedUrl } = await presignUrl(token, {
|
|
212
|
+
access: "private",
|
|
213
|
+
operation: "get",
|
|
214
|
+
pathname: input.key,
|
|
215
|
+
useCache: false,
|
|
216
|
+
validUntil: input.expiresAtMs
|
|
217
|
+
});
|
|
218
|
+
return presignedUrl;
|
|
219
|
+
},
|
|
220
|
+
async get(key, range) {
|
|
221
|
+
const result = await get(key, {
|
|
222
|
+
access: "private",
|
|
223
|
+
useCache: false,
|
|
224
|
+
...range ? { headers: { range: rangeHeader(range) } } : void 0
|
|
225
|
+
});
|
|
226
|
+
if (result?.statusCode !== 200) return null;
|
|
227
|
+
if (range && !result.headers.get("content-range")) {
|
|
228
|
+
await result.stream.cancel();
|
|
229
|
+
throw new Error("Vercel Blob get ignored the byte range");
|
|
230
|
+
}
|
|
231
|
+
return result.stream;
|
|
232
|
+
},
|
|
233
|
+
async delete(keys) {
|
|
234
|
+
if (keys.length === 0) return;
|
|
235
|
+
await del(keys);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
// src/chat/attachments/storage.ts
|
|
240
|
+
/** Stream bytes that are already in memory to `AttachmentStorage.put`. */
|
|
241
|
+
function bufferBody(data) {
|
|
242
|
+
return new ReadableStream({ start(controller) {
|
|
243
|
+
controller.enqueue(data);
|
|
244
|
+
controller.close();
|
|
245
|
+
} });
|
|
246
|
+
}
|
|
247
|
+
/** Build the HTTP `Range` request header value for one byte range. */
|
|
248
|
+
function rangeHeader(range) {
|
|
249
|
+
return `bytes=${range.start}-${range.end}`;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Return attachment storage for the configured provider.
|
|
253
|
+
*
|
|
254
|
+
* Callers do not choose a provider. Chat config decides it.
|
|
255
|
+
*/
|
|
256
|
+
function getAttachmentStorage() {
|
|
257
|
+
return createAttachmentStorage(getChatConfig().attachmentStorage);
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Create attachment storage for one provider config.
|
|
261
|
+
*
|
|
262
|
+
* Runtime code uses `getAttachmentStorage()`. Call this only to test a
|
|
263
|
+
* provider adapter with its own config.
|
|
264
|
+
*/
|
|
265
|
+
function createAttachmentStorage(config) {
|
|
266
|
+
switch (config.provider) {
|
|
267
|
+
case "vercel-blob": return createVercelAttachmentStorage();
|
|
268
|
+
case "s3": return createS3AttachmentStorage(config.s3);
|
|
269
|
+
case "memory": return createMemoryAttachmentStorage();
|
|
270
|
+
default: throw new Error(`Unsupported attachment storage provider: ${String(config.provider)}`);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
export { getAttachmentStorage as n, bufferBody as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { D as isToolResultError, F as SESSION_CONTEXT_SECTION_TAG, I as TURN_CONTEXT_TAG, N as CAPABILITY_SECTION_TAG, O as isToolResultMessage, P as REQUEST_CONTEXT_SECTION_TAG, _ as extractAssistantText, d as SANDBOX_WORKSPACE_ROOT, f as sandboxSkillDir, h as createPluginLogger, k as normalizeToolNameFromResult, n as toPromptContributionContext, o as SANDBOX_DATA_ROOT, r as runPluginHooksAtOnce, t as PLUGIN_PROMPT_CONTRIBUTION_TOTAL_MAX_CHARS, w as isAssistantMessage } from "./prompt-
|
|
3
|
-
import {
|
|
4
|
-
import { m as logWarn, p as logInfo } from "./logging-
|
|
2
|
+
import { D as isToolResultError, F as SESSION_CONTEXT_SECTION_TAG, I as TURN_CONTEXT_TAG, N as CAPABILITY_SECTION_TAG, O as isToolResultMessage, P as REQUEST_CONTEXT_SECTION_TAG, _ as extractAssistantText, d as SANDBOX_WORKSPACE_ROOT, f as sandboxSkillDir, h as createPluginLogger, k as normalizeToolNameFromResult, n as toPromptContributionContext, o as SANDBOX_DATA_ROOT, r as runPluginHooksAtOnce, t as PLUGIN_PROMPT_CONTRIBUTION_TOTAL_MAX_CHARS, w as isAssistantMessage } from "./prompt-C5CW2wKO.js";
|
|
3
|
+
import { m as worldPathCandidates, p as soulPathCandidates, u as listReferenceFiles } from "./topics-DxuKurCX.js";
|
|
4
|
+
import { m as logWarn, p as logInfo } from "./logging-DsTnMqyi.js";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { escapeClosingTag, escapeTagText, escapeTagTextAndQuotes, findTags, indentTagLines, markdownNodes, openingTag, parseMarkdown, promptMessageSchema, renderInlineTag, renderTag, unescapeTagText } from "@sentry/junior-plugin-api";
|
|
@@ -234,44 +234,11 @@ async function getPluginSystemPromptContributions(plugins, platform) {
|
|
|
234
234
|
}
|
|
235
235
|
// src/chat/system-prompt-rules.ts
|
|
236
236
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
* each rule has one block, so order and priority stay stable:
|
|
243
|
-
*
|
|
244
|
-
* 1. Identity: one header sentence with the role and the precedence rule,
|
|
245
|
-
* then the name and platform identity.
|
|
246
|
-
* 2. Working principles: `<task-execution>` (or `<automation-run>`,
|
|
247
|
-
* `<child-agent-run>`) says what the job is, when to continue, and when
|
|
248
|
-
* to ask. A Lead also gets `<lead>`, which says how it runs the Space's
|
|
249
|
-
* work. `<evidence>` says what to claim, how to mark
|
|
250
|
-
* inference, how to find a failure cause, and how to handle pushback.
|
|
251
|
-
* 3. Context and trust: `<context-trust>` holds generic rules for context
|
|
252
|
-
* inputs, with no tag table and no context data.
|
|
253
|
-
* 4. Actions and safety: `<safety>` holds action limits, approvals, and
|
|
254
|
-
* retries with side effects.
|
|
255
|
-
* 5. Tools and skills: `<tool-policy>` and `<skill-policy>` hold rules
|
|
256
|
-
* that span tools. A rule for one tool goes in its description.
|
|
257
|
-
* 6. Communication and output: `<tool-call-style>`, `<conversation>`,
|
|
258
|
-
* `<slack-actions>`, `<failure-reporting>`, `<output>`.
|
|
259
|
-
* 7. Personality: the consumer's `SOUL.md`, for voice and tone only.
|
|
260
|
-
* 8. World: the consumer's `WORLD.md`, for operator facts and workflow.
|
|
261
|
-
* 9. Plugin guidance: `<plugin-system-context>` from plugin `systemPrompt`
|
|
262
|
-
* hooks.
|
|
263
|
-
*
|
|
264
|
-
* Blocks 7 to 9 come last, and the identity header says that core rules win
|
|
265
|
-
* over them. A Prompt mode can replace the content of a block, but cannot add
|
|
266
|
-
* or move one. `<tool-call-style>`, `<conversation>`, and the conversation
|
|
267
|
-
* lines of `<context-trust>` are only for a person's input. `child_agent`
|
|
268
|
-
* also gets the Inbox item line of `<context-trust>`, because a child gets
|
|
269
|
-
* answers to its own items. `<slack-actions>` is only for a person's input on
|
|
270
|
-
* Slack. `thread` and `automation` hold two rule sets, with `for` set to the
|
|
271
|
-
* sender.
|
|
272
|
-
*
|
|
273
|
-
* Put a new rule in the block that owns it. If no block fits, change this map
|
|
274
|
-
* in the same change. The `build-tools` repo skill says how to write a rule.
|
|
237
|
+
* Block map: 1 and 7-9 (`SOUL.md`, `WORLD.md`, plugins) are in `prompt.ts`.
|
|
238
|
+
* 2 `<task-execution>` or `<automation-run>`/`<child-agent-run>`, `<lead>`,
|
|
239
|
+
* `<evidence>`; 3 `<context-trust>`; 4 `<safety>`; 5 `<tool-policy>`,
|
|
240
|
+
* `<skill-policy>`; 6 `<tool-call-style>`, `<conversation>`, `<slack-actions>`,
|
|
241
|
+
* `<failure-reporting>`, `<output>`. A mode never adds or moves a block.
|
|
275
242
|
*/
|
|
276
243
|
/**
|
|
277
244
|
* The rule sets of each Prompt mode, in prompt order. A rule set with a
|
|
@@ -316,9 +283,9 @@ function buildIdentityHeader(platform, mode) {
|
|
|
316
283
|
/**
|
|
317
284
|
* Block 2, `<task-execution>`: what the job is in a conversation, when to keep
|
|
318
285
|
* going, and when to ask. Junior acts as a colleague who owns the task, so it
|
|
319
|
-
* makes small decisions itself instead of asking.
|
|
320
|
-
* present an inferred fact as verified. The
|
|
321
|
-
* `
|
|
286
|
+
* makes small decisions itself instead of asking. It may infer intent, but it
|
|
287
|
+
* must not present an inferred fact as verified. The `automation` and
|
|
288
|
+
* `child_agent` modes replace this section with their own.
|
|
322
289
|
*/
|
|
323
290
|
const TASK_EXECUTION_RULES = [
|
|
324
291
|
"- Work as a trusted colleague who owns the task. Make the reasonable small decisions yourself and take the next appropriate step. Do not ask the user to confirm each step.",
|
|
@@ -353,12 +320,10 @@ const AUTOMATION_RUN_RULES = [
|
|
|
353
320
|
`- Use \`${NO_REPLY_TOOL_NAME}\` when the run worked and nothing should be posted, such as when a condition in the instruction is not met, or when a temporary failure stopped the work.`
|
|
354
321
|
];
|
|
355
322
|
/**
|
|
356
|
-
* Block 2, `<lead>`: how a Space's Lead runs the Space's work.
|
|
357
|
-
*
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
* holds the rules that it shares with other Conversations, such as how to
|
|
361
|
-
* ask a person.
|
|
323
|
+
* Block 2, `<lead>`: how a Space's Lead runs the Space's work. It plans,
|
|
324
|
+
* starts, reviews, and connects its child agents' work and never does it
|
|
325
|
+
* itself. Its tool list has no tools for the work, so the rules say where work
|
|
326
|
+
* goes. `<task-execution>` holds the rules it shares, such as how to ask.
|
|
362
327
|
*/
|
|
363
328
|
const LEAD_RULES = [
|
|
364
329
|
"- The members of the Space talk to you, and the person of a Turn is the member who sent its input. Your child agents are the Space's other Conversations.",
|
|
@@ -368,7 +333,7 @@ const LEAD_RULES = [
|
|
|
368
333
|
"- A member who tells you about a problem, a worry, or something they do not understand in the Space's area asks you to deal with it. Start the work that investigates it and delivers the fix or the answer, without asking first.",
|
|
369
334
|
"- A brief gives the goal, the targets, the facts with their source, the constraints, what done means, and the shape of the result. Hand off only the work that the member asked for, and name other work as a follow-up. When you pass on a member's approval, quote their exact words.",
|
|
370
335
|
"- When the result of one Thread changes the work of another, such as a renamed function or a moved file, tell the other Thread with `messageAgent`. Tell the members only when it changes what they get.",
|
|
371
|
-
"- When the done signal of a Thread's work is true, archive the Thread with `archiveAgent`.
|
|
336
|
+
"- When the done signal of a Thread's work is true, archive the Thread with `archiveAgent`.",
|
|
372
337
|
"- A decision is a member's only when it changes what ships or who sees it, and nothing that they said settles it. Look for their earlier words first. A child's question about how to do the work, such as a design detail, is not a member's decision. A confirmation that a child or Guardian asks for before an action is the member's, as `<task-execution>` says. Make every other decision yourself and say that it is your decision. Do not write that a member gave it to you, such as \"they delegated it to me\".",
|
|
373
338
|
`- When a child's result changes nothing for the members, end the Turn with \`${NO_REPLY_TOOL_NAME}\`.`,
|
|
374
339
|
"- When a member asks where the work is, answer from `listAgents` and the live state of its pull requests, which a Task reads for you, in this order: what needs them, what is in flight, what is done.",
|
|
@@ -555,7 +520,7 @@ const TOOL_CALL_STYLE_RULES = [
|
|
|
555
520
|
];
|
|
556
521
|
/**
|
|
557
522
|
* Block 6, `<conversation>`: how replies fit the thread, including follow-ups
|
|
558
|
-
* and resumed Turns.
|
|
523
|
+
* and resumed Turns. It and `<slack-actions>` apply only to a person's input.
|
|
559
524
|
*/
|
|
560
525
|
const CONVERSATION_RULES = ["- In thread follow-ups, answer from prior thread context; do not repeat resolved clarifying questions.", "- Runtime owns continuation and authorization notices; on resumed turns, answer with the final requested content only."];
|
|
561
526
|
/**
|
|
@@ -694,28 +659,11 @@ function buildRuleBlocks(platform, mode) {
|
|
|
694
659
|
}
|
|
695
660
|
// src/chat/prompt.ts
|
|
696
661
|
/**
|
|
697
|
-
*
|
|
698
|
-
*
|
|
699
|
-
*
|
|
700
|
-
* context
|
|
701
|
-
*
|
|
702
|
-
* The system prompt is the same for every Turn of one deployment, platform,
|
|
703
|
-
* and Prompt mode, so it holds no request, actor, time, or Conversation data.
|
|
704
|
-
* Facts for one request go in the context message: a user-role message before
|
|
705
|
-
* the current instruction, with `<runtime-turn-context>`, `AGENTS.md` at Turn
|
|
706
|
-
* start, and `<thread-context>`, each in its own content part. The current
|
|
707
|
-
* instruction is a separate user-role message with only a person's words and
|
|
708
|
-
* attachments. Tool results, files, and fetched pages are tool result
|
|
709
|
-
* messages.
|
|
710
|
-
*
|
|
711
|
-
* A Turn adds `AGENTS.md` only when it differs from the latest copy in
|
|
712
|
-
* history. An `AGENTS.md` that the Turn finds or changes later is a new
|
|
713
|
-
* user-role message at the end of history, because earlier messages do not
|
|
714
|
-
* change. Only context compaction rewrites them.
|
|
715
|
-
*
|
|
716
|
-
* Runtime context is session-scoped bootstrap data; it must stay separate
|
|
717
|
-
* from durable conversation history so compaction does not retain runtime
|
|
718
|
-
* instructions as user text.
|
|
662
|
+
* Builds the static system prompt, with no request, actor, time, or
|
|
663
|
+
* Conversation data, and the per-Turn context message before the instruction:
|
|
664
|
+
* `<runtime-turn-context>`, `AGENTS.md`, and `<thread-context>`, a part each.
|
|
665
|
+
* Runtime context stays out of durable history. A Turn adds `AGENTS.md` only
|
|
666
|
+
* when it differs from history, and a later change as a new message at the end.
|
|
719
667
|
*/
|
|
720
668
|
const DEFAULT_SOUL = "You are a practical and concise assistant.";
|
|
721
669
|
function getLoggedMarkdownFiles() {
|
|
@@ -986,16 +934,10 @@ function buildContextSection(params) {
|
|
|
986
934
|
}
|
|
987
935
|
/**
|
|
988
936
|
* Capability sections: the skills, MCP catalogs, tool guidance, Workspaces,
|
|
989
|
-
* and
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
* At Turn start, one system message sets each section that differs from the
|
|
994
|
-
* section state of history, or removes an empty one. System messages before
|
|
995
|
-
* the first assistant message fold into the system prompt. Pi sends a later
|
|
996
|
-
* one before the next assistant message, or folds it into the system prompt
|
|
997
|
-
* for a model without mid-conversation system messages. Context compaction
|
|
998
|
-
* folds the section state into one system message.
|
|
937
|
+
* and script tools the model can use now, or null when empty. At Turn start,
|
|
938
|
+
* one system message sets or removes each section that differs from history,
|
|
939
|
+
* so the Turn context and history stay the same. Compaction folds the section
|
|
940
|
+
* state into one system message.
|
|
999
941
|
*/
|
|
1000
942
|
function buildCapabilitySections(params) {
|
|
1001
943
|
const contents = {
|
|
@@ -1110,7 +1052,7 @@ function buildCoreSystemPromptSections(platform, mode, botName, files = {
|
|
|
1110
1052
|
}] : []
|
|
1111
1053
|
];
|
|
1112
1054
|
}
|
|
1113
|
-
/** Build
|
|
1055
|
+
/** Build the per-Turn runtime context, which stays out of the system prompt. */
|
|
1114
1056
|
function buildTurnContextPrompt(params) {
|
|
1115
1057
|
const includeSessionContext = params.includeSessionContext ?? true;
|
|
1116
1058
|
const pluginPromptContributions = renderPluginContextSection(params.pluginPromptContributions);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// src/core/turn/topic.ts
|
|
2
|
+
/** Queue topic of Turn step messages. */
|
|
3
|
+
const TURN_STEP_TOPIC = "junior_turn_step";
|
|
4
|
+
/** Queue topic of the messages that say a Turn ended. */
|
|
5
|
+
const TURN_ENDED_TOPIC = "junior_turn_ended";
|
|
6
|
+
export { TURN_STEP_TOPIC as n, TURN_ENDED_TOPIC as t };
|
|
@@ -3,6 +3,16 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs, { statSync } from "node:fs";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
// src/chat/optional-string.ts
|
|
7
|
+
/**
|
|
8
|
+
* Normalize optional env-style strings so blank values do not masquerade as
|
|
9
|
+
* configured inputs.
|
|
10
|
+
*/
|
|
11
|
+
function toOptionalTrimmed(value) {
|
|
12
|
+
if (!value) return;
|
|
13
|
+
const trimmed = value.trim();
|
|
14
|
+
return trimmed.length > 0 ? trimmed : void 0;
|
|
15
|
+
}
|
|
6
16
|
// src/package-resolution.ts
|
|
7
17
|
function isDirectory$1(targetPath) {
|
|
8
18
|
try {
|
|
@@ -447,4 +457,14 @@ function discoverInstalledPluginPackageContent(cwd = process.cwd(), options) {
|
|
|
447
457
|
tracingIncludes: uniqueStringsInOrder(tracingIncludes)
|
|
448
458
|
};
|
|
449
459
|
}
|
|
450
|
-
|
|
460
|
+
// src/chat/queue/topics.ts
|
|
461
|
+
/**
|
|
462
|
+
* Queue topic names. Vercel queue wiring uses them at build, so keep them
|
|
463
|
+
* stable, and keep this module free of runtime configuration.
|
|
464
|
+
*/
|
|
465
|
+
const CACHE_WARMUP_QUEUE_TOPIC = "junior_cache_warmups";
|
|
466
|
+
const PLUGIN_TASK_QUEUE_TOPIC = "junior_plugin_tasks";
|
|
467
|
+
const WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC = "junior_workspace_snapshots";
|
|
468
|
+
const BACKGROUND_COMPACTION_QUEUE_TOPIC = "junior_context_compaction";
|
|
469
|
+
const DEFAULT_CONVERSATION_WORK_QUEUE_TOPIC = "junior_conversation_work";
|
|
470
|
+
export { toOptionalTrimmed as _, WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC as a, discovery_exports as c, pluginRoots as d, skillRoots as f, resolvePackageDir as g, isValidPackageName as h, PLUGIN_TASK_QUEUE_TOPIC as i, homeDir as l, worldPathCandidates as m, CACHE_WARMUP_QUEUE_TOPIC as n, discoverInstalledPluginPackageContent as o, soulPathCandidates as p, DEFAULT_CONVERSATION_WORK_QUEUE_TOPIC as r, normalizePluginPackageNames as s, BACKGROUND_COMPACTION_QUEUE_TOPIC as t, listReferenceFiles as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import { actorSchema, actorUserIdSchema,
|
|
2
|
+
import { actorSchema, actorUserIdSchema, conversationEventPresentationSchema, conversationSidebarAnnotationSchema, destinationVisibilitySchema, eventMatchFieldsSchema, eventMatchSchema, eventReachSchema, eventTypeSchema, liveAnnotationSchema, objectFactFields, objectTypeSchema, pluginEventTypeSchema, slackDestinationSchema, taskOutcomeSchema } from "@sentry/junior-plugin-api";
|
|
3
3
|
// src/usage-schema.ts
|
|
4
4
|
const usageCostSchema = z.object({
|
|
5
5
|
input: z.number().finite().nonnegative().optional(),
|
|
@@ -1118,6 +1118,20 @@ function automationCardText(card) {
|
|
|
1118
1118
|
`Automation ID: ${card.id}`
|
|
1119
1119
|
].filter(Boolean).join("\n");
|
|
1120
1120
|
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Return the status and warning that the card and the Slack details of an
|
|
1123
|
+
* Automation show. The status is the saved status, except that an active
|
|
1124
|
+
* Automation whose trigger cannot work shows as unavailable. Only a block or
|
|
1125
|
+
* a trigger problem gives a warning, like Needs attention in `collection.ts`.
|
|
1126
|
+
*/
|
|
1127
|
+
function automationCardStatus(automation) {
|
|
1128
|
+
const problems = automation.triggerProblems ?? [];
|
|
1129
|
+
const warning = [automation.status === "blocked" ? automation.statusReason ?? "This automation is blocked." : void 0, problems.length > 0 ? ["Trigger unavailable.", ...problems].join(" ") : void 0].filter(Boolean).join(" ");
|
|
1130
|
+
return {
|
|
1131
|
+
status: automation.status === "active" && problems.length > 0 ? "unavailable" : automation.status,
|
|
1132
|
+
warning: warning || void 0
|
|
1133
|
+
};
|
|
1134
|
+
}
|
|
1121
1135
|
// src/chat/conversations/cards.ts
|
|
1122
1136
|
const storedCardSchema = automationCardSchema.extend({ operation: z.enum([
|
|
1123
1137
|
"created",
|
|
@@ -1163,10 +1177,11 @@ function messageCardRef(card) {
|
|
|
1163
1177
|
function readMessageCardRefs(value) {
|
|
1164
1178
|
return [...storedCardSchema.array().parse(value.cards ?? []).flatMap(({ operation, ...card }) => operation === "deleted" ? [] : [messageCardRef(card)]), ...messageCardRefSchema.strip().array().parse(value.objectCards ?? [])];
|
|
1165
1179
|
}
|
|
1166
|
-
/**
|
|
1180
|
+
/** Match each reference to the Annotation as it was read, in reference order. */
|
|
1167
1181
|
function resolveMessageCards(refs, annotations) {
|
|
1168
1182
|
return refs.map((ref) => {
|
|
1169
|
-
const
|
|
1183
|
+
const named = annotations.filter((item) => item.plugin === ref.plugin && item.key === ref.key);
|
|
1184
|
+
const annotation = named.find((item) => item.kind === ref.kind) ?? named.find((item) => item.kind === "resource_link");
|
|
1170
1185
|
return annotation ? annotationCard(annotation) : {
|
|
1171
1186
|
...ref,
|
|
1172
1187
|
objectType: "item",
|
|
@@ -1177,7 +1192,11 @@ function resolveMessageCards(refs, annotations) {
|
|
|
1177
1192
|
};
|
|
1178
1193
|
});
|
|
1179
1194
|
}
|
|
1180
|
-
/**
|
|
1195
|
+
/**
|
|
1196
|
+
* Return the card of a read Annotation without its timestamps, for Message
|
|
1197
|
+
* delivery. An Annotation that shows only its label gets that label as its
|
|
1198
|
+
* title.
|
|
1199
|
+
*/
|
|
1181
1200
|
function annotationCard(annotation) {
|
|
1182
1201
|
const { createdAt: _createdAt, updatedAt: _updatedAt, ...value } = annotation;
|
|
1183
1202
|
return value.kind === "object" ? value : {
|
|
@@ -2131,12 +2150,7 @@ const conversationSourceTaskSchema = z.object({
|
|
|
2131
2150
|
message: "sourceTask id and label must both be set or both omitted"
|
|
2132
2151
|
});
|
|
2133
2152
|
});
|
|
2134
|
-
const conversationAnnotationReportSchema =
|
|
2135
|
-
plugin: z.string().min(1),
|
|
2136
|
-
createdAt: z.string().datetime(),
|
|
2137
|
-
updatedAt: z.string().datetime(),
|
|
2138
|
-
previewImages: z.array(objectPreviewImageSchema).optional()
|
|
2139
|
-
}));
|
|
2153
|
+
const conversationAnnotationReportSchema = liveAnnotationSchema.and(z.object({ previewImages: z.array(objectPreviewImageSchema).optional() }));
|
|
2140
2154
|
const conversationActivityPreviewSchema = z.object({
|
|
2141
2155
|
createdAt: z.string().datetime(),
|
|
2142
2156
|
mentions: z.array(actorIdentitySchema).optional(),
|
|
@@ -3064,4 +3078,4 @@ const TODOS_REGISTRATION_NAME = "todos";
|
|
|
3064
3078
|
const UPDATE_TODOS_TOOL_NAME = `${TODOS_REGISTRATION_NAME}_updateTodos`;
|
|
3065
3079
|
/** Assignee text for the list's own agent, in tool results and blocks. */
|
|
3066
3080
|
const SELF_TODO_ASSIGNEE = "self";
|
|
3067
|
-
export { activityPreviewText as $,
|
|
3081
|
+
export { activityPreviewText as $, automationInstructionToolSchema as $t, automationVersionSchema as A, DEFAULT_NOTIFICATION_SCHEDULE as An, spaceListQuerySchema as At, conversationDetailQuerySchema as B, AGENT_UPDATE_EVENT_TYPE as Bn, annotationCard as Bt, automationScheduleIntentSchema as C, userInputQuestionSchema as Cn, instructionActors as Ct, automationVersionActivateSchema as D, automationTaskDescription as Dn, SPACE_NAME_MAX_CHARS as Dt, automationUpdateSchema as E, automationTaskColumns as En, SPACE_DESCRIPTION_MAX_CHARS as Et, actorIdentitySchema as F, getZonedDateTimeParts as Fn, spaceVisibilitySchema as Ft, conversationParamsSchema as G, gatewayOnlyProviders as Gn, resolveMessageCards as Gt, conversationEventHistorySchema as H, isAgentMessageEventType as Hn, messageCardText as Ht, conversationActivityPreviewSchema as I, isValidTimeZone as In, updateSpaceBodySchema as It, conversationReportMessageEventSchema as J, MAX_INPUT_ATTACHMENTS as Jt, conversationReportEventDataSchema as K, usageSchema as Kn, automationCardStatus as Kt, conversationAttachmentParamsSchema as L, CONTENT_VERSION_HEADER as Ln, conversationTreeStateSchema as Lt, scheduledAutomationSummarySchema as M, notificationScheduleSchema as Mn, spaceParamsSchema as Mt, CONVERSATION_DETAIL_VERSION_HEADER as N, getFirstRunAtMs as Nn, spaceRefSchema as Nt, automationVersionListSchema as O, automationTaskSchema as On, archiveSpaceBodySchema as Ot, CONVERSATION_VERSION_HEADER as P, getNextRunAtMs as Pn, spaceSchema as Pt, conversationUsageSchema as Q, automationContextToolSchema as Qt, conversationAttachmentQuerySchema as R, apiErrorSchema as Rn, conversationReadPositionSchema as Rt, automationRunWindowsSchema as S, userInputFieldsSchema as Sn, contextProvenance as St, automationSummarySchema as T, automationSkillNameSchema as Tn, sameActorIdentity as Tt, conversationEventPageSchema as U, isAgentUpdateEventType as Un, readMessageCardRefs as Ut, conversationDetailReportSchema as V, TOP_LEVEL_AGENT_MESSAGE_EVENT_TYPE as Vn, messageCardRef as Vt, conversationEventsQuerySchema as W, isLegacyResultEventType as Wn, removedCardSchema as Wt, conversationSummaryReportSchema as X, messageAttachmentSchema as Xt, conversationReportStatusSchema as Y, inputFileSchema as Yt, conversationSurfaceSchema as Z, readMessageAttachments as Zt, automationListQuerySchema as _, answeredChoices as _n, historyReplacementSchema as _t, UPDATE_TODOS_TOOL_NAME as a, ScheduleIntentError as an, KNOWN_CONVERSATION_EVENT_TYPES as at, automationRunListSchema as b, isEmptyUserInputAnswer as bn, piMessageSchema as bt, automationEditSchema as c, toolScheduleIntentSchema as cn, conversationTurnFailureReasonSchema as ct, automationExecutionSchema as d, eventAutomationTriggerSchema as dn, agentHistoryFromRow as dt, automationTitleSchema as en, conversationChildAgentTotalsSchema as et, automationExecutionStatusDaySchema as f, inboxItemNoticeRequestSchema as fn, encodeAgentHistoryPayload as ft, automationListPageSchema as g, USER_INPUT_NOTE as gn, historyItemFromPiMessage as gt, automationListItemSchema as h, USER_INPUT_LIMITS as hn, HISTORY_REPLACEMENT_TYPES as ht, TODO_STATUSES as i, scheduledRunSchema as in, formatAgentTypes as it, eventAutomationSummarySchema as j, isWithinNotificationSchedule as jn, spaceListSchema as jt, automationVersionParamsSchema as k, automationTaskText as kn, createSpaceBodySchema as kt, automationEventCatalogSchema as l, weekdaySchema as ln, decodeStoredConversationEvent as lt, automationLifecycleSchema as m, inboxItemRequestSchema as mn, AGENT_HISTORY_ITEM_TYPES as mt, SELF_TODO_ASSIGNEE as n, SCHEDULED_AUTOMATION_SYSTEM_ACTOR as nn, agentTypeInstructions as nt, isOpenTodoStatus as o, compileScheduleIntent as on, conversationEventDataSchema as ot, automationExecutionStatusSchema as p, inboxItemQuestion as pn, isAgentHistoryData as pt, conversationReportEventSchema as q, usageTokensSchema as qn, MAX_ATTACHMENT_BYTES as qt, TODOS_REGISTRATION_NAME as r, scheduledAutomationSchema as rn, agentTypeSchema as rt, automationEditErrorSchema as s, scheduleIntentFromTool as sn, conversationTurnFailureCodeSchema as st, OPEN_TODO_STATUSES as t, taskOutcomeInputSchema as tn, AGENT_TYPES as tt, automationExecutionListSchema as u, eventAutomationSchema as un, newConversationEventSchema as ut, automationListSchema as v, buttonUserInputField as vn, isHistoryReplacement as vt, automationSchedulePreviewSchema as w, userInputRequestSchema as wn, instructionProvenanceFor as wt, automationRunSchema as x, normalizeUserInputAnswer as xn, agentInstructionProvenance as xt, automationParamsSchema as y, formatUserInputAnswer as yn, piMessageFromHistoryItem as yt, conversationAuxiliaryCostsSchema as z, AGENT_MESSAGE_EVENT_TYPE as zn, inboxItemChangeRecordSchema as zt };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ks as SlackActionError, Xs as getSlackClient, ic as withSlackRetries } from "./db-BacvswT0.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/chat/slack/users.ts
|
|
4
4
|
const profileFieldsSchema = z.object({ fields: z.record(z.string(), z.object({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Pd as getAppContext } from "./db-BacvswT0.js";
|
|
3
3
|
import { isDeepStrictEqual } from "node:util";
|
|
4
4
|
// src/chat/plugins/validation.ts
|
|
5
5
|
var validation_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -8,18 +8,18 @@ var validation_exports = /* @__PURE__ */ __exportAll({
|
|
|
8
8
|
});
|
|
9
9
|
/** Validate hook registrations against the loaded plugin manifest catalog. */
|
|
10
10
|
function validatePluginRegistrations(registrations) {
|
|
11
|
-
const loadedPlugins = new Map(
|
|
11
|
+
const loadedPlugins = new Map(getAppContext().catalog.getProviders().map((plugin) => [plugin.manifest.name, plugin]));
|
|
12
12
|
for (const registration of registrations) {
|
|
13
13
|
const loadedPlugin = loadedPlugins.get(registration.manifest.name);
|
|
14
14
|
if (!loadedPlugin) throw new Error(`Plugin registration "${registration.manifest.name}" does not have a matching plugin manifest. Add an inline manifest, packageName, or app-local plugin.yaml with the same name.`);
|
|
15
|
-
const effectiveRegistrationManifest =
|
|
15
|
+
const effectiveRegistrationManifest = getAppContext().catalog.parseConfiguredInlineManifest(registration.manifest, loadedPlugin.dir);
|
|
16
16
|
if (!isDeepStrictEqual(effectiveRegistrationManifest, loadedPlugin.manifest)) throw new Error(`Plugin registration "${registration.manifest.name}" manifest does not match the loaded plugin manifest. Use one canonical manifest source for runtime hook plugins.`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
/** Validate credential hook registrations against the loaded plugin manifests. */
|
|
20
20
|
function validatePluginEgressCredentialHooks(registrations) {
|
|
21
21
|
const plugins = new Map(registrations.map((registration) => [registration.manifest.name, registration]));
|
|
22
|
-
for (const provider of
|
|
22
|
+
for (const provider of getAppContext().catalog.getProviders()) {
|
|
23
23
|
const hooks = plugins.get(provider.manifest.name)?.hooks;
|
|
24
24
|
const hasGrantHook = Boolean(hooks?.grantForEgress);
|
|
25
25
|
const hasIssueHook = Boolean(hooks?.issueCredential);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.320.0";
|
|
3
3
|
// src/version.ts
|
|
4
4
|
/** Installed Junior package version, or `unknown` when package metadata is unavailable. */
|
|
5
5
|
const JUNIOR_VERSION = typeof version === "string" && version.trim() ? version : "unknown";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as JUNIOR_VERSION } from "./version-
|
|
1
|
+
export { t as JUNIOR_VERSION } from "./version-BuLVNlxB.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
-
import { $t as completeConversationWork, Cn as isFinalAttempt, Gt as beginConversationResume,
|
|
3
|
-
import { R as getChatConfig } from "./
|
|
4
|
-
import { f as logException, m as logWarn, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-
|
|
5
|
-
import {
|
|
2
|
+
import { $t as completeConversationWork, Cn as isFinalAttempt, Gt as beginConversationResume, Jt as claimConversationAttempt, Mn as isAttemptInterrupt, Nn as selectAttemptMessages, Qt as completeConversationStop, Td as isProviderRetryError, Vr as ConversationQueueMessageRejectedError, Vt as ackMessages, Wr as nudgeIdempotencyKey, Xt as clearConsumedConversationWake, an as getConversationWorkState, cn as recordAttemptFailure, dn as requestAnotherSlice, en as deadLetterAttempt, ln as recordConversationRetry, pn as startConversationWork, qt as checkInConversationWork, rn as ensureConversationWake, tn as drainConversationMailbox, tu as isTopLevel, un as releaseConversationWork, ur as getTurnRequestDeadline, wn as isInvalidConversationRecordError, xn as hasConversationStop, yn as countPendingConversationMessages } from "./db-BacvswT0.js";
|
|
3
|
+
import { R as getChatConfig } from "./adapter-DlLLoJKj.js";
|
|
4
|
+
import { f as logException, m as logWarn, p as logInfo, w as withLogContext, y as setSpanAttributes } from "./logging-DsTnMqyi.js";
|
|
5
|
+
import { j as saveHeldInput, k as getConversationStoppedAtMs } from "./markers-C33gNYNE.js";
|
|
6
6
|
// src/chat/task-execution/lost-lease.ts
|
|
7
7
|
/**
|
|
8
8
|
* Count a slice that lost its Conversation Lease as a failed attempt, then
|