@sentry/junior 0.316.0 → 0.317.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/{admin-QYiDMnsu.js → admin-CAugg87B.js} +1 -1
- package/dist/{agent-runner-Cr5Fhjf-.js → agent-runner-AjrEV6Qe.js} +13438 -13149
- package/dist/{reporting-window-C4dbzDiR.js → agent-status-BA5x3Xtp.js} +33 -1
- package/dist/{agent-update-delivery-BY13DPSD.js → agent-update-delivery-B_YIZcgf.js} +5 -5
- package/dist/api/schema.d.ts +558 -102
- package/dist/api/schema.js +6 -6
- package/dist/api.js +230 -213
- package/dist/{app-BhvzRD__.d.ts → app-MoNAsVV5.d.ts} +34 -14
- package/dist/app.d.ts +1 -1
- package/dist/app.js +167 -122
- package/dist/catalog-runtime-DfSpJZdY.js +6 -0
- package/dist/{change-record-Bqsa5ZXE.d.ts → change-record-BzJgLsv7.d.ts} +60 -1
- package/dist/{adapter-context-Bref7aPI.js → channel-access-j-YAVYK4.js} +2 -42
- package/dist/{chat-core-engine-3dtlMku3.js → chat-core-engine-aH85nEHv.js} +4 -3
- package/dist/{child-message--2G3Ft26.js → child-message-DHjQLEd1.js} +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.js +5 -4
- package/dist/cli/snapshot-create.js +5 -2
- package/dist/cli/upgrade.js +5 -3
- package/dist/config-CHQ8X251.js +2422 -0
- package/dist/{continue-in-slack-DbQUFe_F.js → continue-in-slack-D-FZ8Fin.js} +2 -3
- package/dist/{conversation-feed-B84pMjHo.js → conversation-feed--9S0_PXL.js} +3 -3
- package/dist/{proxy-path-BTmXDjfx.js → conversation-privacy-B1uXn5sf.js} +2 -16
- package/dist/{conversation-turn-DzEpTIaf.js → conversation-turn-BUE_7xaN.js} +99 -76
- package/dist/{create-DUJBXr6E.js → create-DoDIYgtZ.js} +12 -9
- package/dist/{credential-sync-JH_K9Adg.js → credential-sync-BJOqGnjV.js} +17 -12
- package/dist/{db-DhzvUY23.js → db-BFmyYZtJ.js} +20265 -27551
- package/dist/{deployment-BhvrhQeh.js → deployment-DXq9ZLU4.js} +17 -15
- package/dist/{engine-context-C9Nal48K.js → engine-context-CgQ7mlHt.js} +264 -47
- package/dist/{html-B_12WjKT.js → html-B3VKTGbJ.js} +6 -2
- package/dist/instrumentation.js +15 -7
- package/dist/{job-runner-DO8nslyY.js → job-runner-A1lCkybD.js} +391 -24
- package/dist/{lineage-D3AZAJVe.js → lineage-Bktb0UcV.js} +1 -1
- package/dist/{list-B0zsb5Cp.js → list-Bxvg5wXf.js} +224 -544
- package/dist/{logging-B8KEJegM.js → logging--smS7XRK.js} +2 -2
- package/dist/{session-stop-DponjDUZ.js → mailbox-turn-uSXhUFc9.js} +4747 -7039
- package/dist/{message-B5fKDYzz.js → message-BNenhsmB.js} +12 -22
- package/dist/{model-input-CuMWy37l.js → model-input-BReSnwHp.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +20 -6
- package/dist/{oauth-callback-server-B3Vvlydo.js → oauth-callback-server-CE4soEIY.js} +2 -2
- package/dist/{oauth-relay-6ERrGPbA.js → oauth-relay-C36gX1gH.js} +2 -2
- package/dist/{package-discovery-BI6T_RkD.js → package-discovery-DD9vencX.js} +1 -50
- package/dist/{list-mkB_GU8R.js → parent-result-Ck1rFYRQ.js} +107 -92
- package/dist/{plugins-BXMdNdyA.js → plugins-D_Ru4CWc.js} +1 -1
- package/dist/profile-BQ-iBDsZ.js +4657 -0
- package/dist/{transcript-CCi7323k.js → prompt-Dv7gkpD6.js} +97 -103
- package/dist/proxy-path-BHYoKZdq.js +15 -0
- package/dist/registry-iXMT5Jmh.js +3279 -0
- package/dist/reports-WKHfGTsU.js +195 -0
- package/dist/{resolve-D5JVvv6A.js → resolve-tony4ibz.js} +9 -29
- package/dist/{result-CS_7mo8a.js → result-Bta_dlWa.js} +25 -116
- package/dist/run-conversation-DL6ru7iW.js +336 -0
- package/dist/{runner-BzAES5W3.js → runner-BstDRbD9.js} +7 -7
- package/dist/{sandbox-egress-signals-Dwhk2Q5F.js → sandbox-egress-signals-oSJMJOnn.js} +1 -1
- package/dist/{schema-z5-wA6N4.js → schema-DfqrHACA.js} +48 -86
- package/dist/sender-actors-CPglLd5R.js +83 -0
- package/dist/{service-account-D6AsAtc1.js → service-account-CTV_jaNu.js} +3 -1
- package/dist/{skills-DgJ9GBPR.js → skills-BCEU41zM.js} +4 -4
- package/dist/{slack-conversation-unfurl-Dq71EkhM.js → slack-conversation-unfurl-DxVmhbGP.js} +7 -6
- package/dist/{spawn-BJWpdwhQ.js → spawn-frczVPIr.js} +11 -8
- package/dist/{system-prompt-table-iIgpmslr.js → system-prompt-table-CiXy0eNR.js} +88 -69
- package/dist/{task-runner-BJae4JwE.js → task-runner-C9Yc2_ae.js} +20 -46
- package/dist/{thread-context-fiMNylbg.js → thread-context-CqZDKErp.js} +6 -6
- package/dist/topics-SRN7IVX-.js +24 -0
- package/dist/turn-membership-CENFf3kI.js +856 -0
- package/dist/{turn-wake-BjDW7x-5.js → turn-wake-BhloiI2h.js} +4 -5
- package/dist/{media-BebquhET.js → types-C4iC-IMC.js} +801 -771
- package/dist/user-customization-CvfuY9Eo.js +93 -0
- package/dist/users-ByG5RCEJ.js +181 -0
- package/dist/{validation-D5WmmmhX.js → validation-8gjfR91V.js} +1 -1
- package/dist/{version-CBQoanXb.js → version-BeZhWWBE.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{worker-Cyb4kF17.js → worker-BqMQQNRk.js} +5 -4
- package/migrations/20261126025226_drop_agent_invocations/migration.sql +6 -0
- package/migrations/20261126025226_drop_agent_invocations/snapshot.json +9 -0
- package/migrations/20261126033000_space_conversations_lead_children/migration.sql +155 -0
- package/migrations/20261126033000_space_conversations_lead_children/snapshot.json +9 -0
- package/migrations/20261126144620_drop_user_message_time_index/migration.sql +1 -0
- package/migrations/20261126144620_drop_user_message_time_index/snapshot.json +38 -0
- package/migrations/20261126153100_inbox_item_subjects/migration.sql +140 -0
- package/migrations/20261126153100_inbox_item_subjects/snapshot.json +9 -0
- package/migrations/20261126153103_inbox_item_subjects_not_null/migration.sql +12 -0
- package/migrations/20261126153103_inbox_item_subjects_not_null/snapshot.json +9 -0
- package/migrations/20261126153105_inbox_item_subject_indexes/migration.sql +1 -0
- package/migrations/20261126153105_inbox_item_subject_indexes/snapshot.json +9 -0
- package/migrations/20261126153108_automation_run_conversation_index/migration.sql +1 -0
- package/migrations/20261126153108_automation_run_conversation_index/snapshot.json +9 -0
- package/migrations/20261126153159_inbox_item_subjects_schema/migration.sql +4 -0
- package/migrations/20261126153159_inbox_item_subjects_schema/snapshot.json +437 -0
- package/migrations/20261126153259_inbox_questions/migration.sql +76 -0
- package/migrations/20261126153259_inbox_questions/snapshot.json +9 -0
- package/migrations/20261126153301_inbox_questions_valid/migration.sql +3 -0
- package/migrations/20261126153301_inbox_questions_valid/snapshot.json +9 -0
- package/migrations/20261126153343_inbox_questions_schema/migration.sql +5 -0
- package/migrations/20261126153343_inbox_questions_schema/snapshot.json +407 -0
- package/migrations/20261126154025_inbox_item_owners/migration.sql +74 -0
- package/migrations/20261126154025_inbox_item_owners/snapshot.json +9 -0
- package/migrations/20261126154048_inbox_item_open_subject_key_index/migration.sql +1 -0
- package/migrations/20261126154048_inbox_item_open_subject_key_index/snapshot.json +9 -0
- package/migrations/20261126154051_drop_inbox_item_owner_indexes/migration.sql +7 -0
- package/migrations/20261126154051_drop_inbox_item_owner_indexes/snapshot.json +9 -0
- package/migrations/20261126154121_inbox_item_owners_schema/migration.sql +8 -0
- package/migrations/20261126154121_inbox_item_owners_schema/snapshot.json +311 -0
- package/migrations/20261126175601_conversation_event_turn/migration.sql +5 -0
- package/migrations/20261126175601_conversation_event_turn/snapshot.json +103 -0
- package/migrations/20261126175614_conversation_event_turn_index/migration.sql +1 -0
- package/migrations/20261126175614_conversation_event_turn_index/snapshot.json +62 -0
- package/migrations/20261126230028_merge_leaves/migration.sql +2 -0
- package/migrations/20261126230028_merge_leaves/snapshot.json +12 -0
- package/migrations/20261126231932_space_lead_holds_name/migration.sql +46 -0
- package/migrations/20261126231932_space_lead_holds_name/snapshot.json +58 -0
- package/migrations/20261127001022_merge_leaves/migration.sql +2 -0
- package/migrations/20261127001022_merge_leaves/snapshot.json +12 -0
- package/package.json +5 -5
- package/dist/people-CUtFApfL.js +0 -81
- package/dist/start-conversation-B-LIqqNi.js +0 -162
- package/dist/turn-session-routing-D15orfwy.js +0 -1309
- package/dist/user-customization-B27StpVQ.js +0 -9
- package/dist/web-message-id-C6P83ans.js +0 -10
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import { h as logWarn, m as logInfo, p as logException } from "./logging
|
|
2
|
-
import pLimit from "p-limit";
|
|
1
|
+
import { h as logWarn, m as logInfo, p as logException } from "./logging--smS7XRK.js";
|
|
3
2
|
import { escapeClosingTags, escapeTagText, escapeTagTextAndQuotes, findTag, openingTag, readTag, renderTag, startsWithTag, stripTags, unescapeClosingTags, unescapeTagText } from "@sentry/junior-plugin-api";
|
|
4
|
-
|
|
5
|
-
* Map each item through `fn`, with at most `concurrency` calls at once. The
|
|
6
|
-
* results keep the order of `items`. Use it for independent work over a list
|
|
7
|
-
* whose length the code does not fix.
|
|
8
|
-
*/
|
|
9
|
-
async function mapBounded(items, fn, concurrency = 8) {
|
|
10
|
-
return await pLimit(concurrency).map(items, fn);
|
|
11
|
-
}
|
|
3
|
+
import pLimit from "p-limit";
|
|
12
4
|
// src/chat/input-tags.ts
|
|
13
5
|
/**
|
|
14
6
|
* Tags for Turn inputs that the runtime creates. Each input is its own prompt
|
|
@@ -129,100 +121,13 @@ function instructionBlock(text) {
|
|
|
129
121
|
const closeStart = block.end - 19 - 3;
|
|
130
122
|
return text[bodyStart] === "\n" && text[closeStart - 1] === "\n" ? block : void 0;
|
|
131
123
|
}
|
|
132
|
-
// src/chat/plugins/logging.ts
|
|
133
|
-
/** Create the host logger exposed to plugin hooks. */
|
|
134
|
-
function createPluginLogger(plugin) {
|
|
135
|
-
return {
|
|
136
|
-
info(message, metadata) {
|
|
137
|
-
logInfo("plugin.log.info", {
|
|
138
|
-
"app.log.message": message,
|
|
139
|
-
"app.plugin.name": plugin,
|
|
140
|
-
...metadata
|
|
141
|
-
});
|
|
142
|
-
},
|
|
143
|
-
warn(message, metadata) {
|
|
144
|
-
logWarn("plugin.log.warning", {
|
|
145
|
-
"app.log.message": message,
|
|
146
|
-
"app.plugin.name": plugin,
|
|
147
|
-
...metadata
|
|
148
|
-
});
|
|
149
|
-
},
|
|
150
|
-
error(message, metadata, cause) {
|
|
151
|
-
logException(new Error(message, { cause }), "plugin.log.error", {
|
|
152
|
-
"app.plugin.name": plugin,
|
|
153
|
-
...metadata
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
// src/chat/sandbox/paths.ts
|
|
159
|
-
function normalizeWorkspaceRoot(input) {
|
|
160
|
-
const candidate = (input ?? "").trim();
|
|
161
|
-
if (!candidate) return "/vercel/sandbox";
|
|
162
|
-
const normalized = candidate.replace(/\/+$/, "");
|
|
163
|
-
return normalized.startsWith("/") ? normalized : `/${normalized}`;
|
|
164
|
-
}
|
|
165
|
-
const SANDBOX_WORKSPACE_ROOT = normalizeWorkspaceRoot(process.env["VERCEL_SANDBOX_WORKSPACE_DIR"]);
|
|
166
|
-
const SANDBOX_REPOS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/repos`;
|
|
167
|
-
const SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
168
|
-
const SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
169
|
-
/** Runtime-owned files inside the sandbox, outside every repository. */
|
|
170
|
-
const SANDBOX_JUNIOR_ROOT = `${SANDBOX_WORKSPACE_ROOT}/.junior`;
|
|
171
124
|
/**
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*/
|
|
176
|
-
const SANDBOX_SCRATCH_ROOT = "/tmp/jr";
|
|
177
|
-
/** Sandbox directory for attachment files that tools write. */
|
|
178
|
-
const ATTACHMENT_DIR = ".junior/attachments";
|
|
179
|
-
/**
|
|
180
|
-
* PATH for sandbox commands. Plugin runtime binaries come last so they never
|
|
181
|
-
* shadow repo or Workspace tools with the same name. Repo tools often start
|
|
182
|
-
* child processes through PATH, so only PATH order can protect them. Plugin
|
|
183
|
-
* binaries stay reachable by name or by absolute path.
|
|
184
|
-
*/
|
|
185
|
-
const SANDBOX_COMMAND_PATH = `$PATH:${`${SANDBOX_JUNIOR_ROOT}/bin`}`;
|
|
186
|
-
function sandboxSkillDir(skillName) {
|
|
187
|
-
return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
|
|
188
|
-
}
|
|
189
|
-
function sandboxSkillFile(skillName) {
|
|
190
|
-
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
191
|
-
}
|
|
192
|
-
/** Explain how the agent should resolve files and commands owned by a skill. */
|
|
193
|
-
function sandboxSkillPathResolution(skillName) {
|
|
194
|
-
const skillDir = sandboxSkillDir(skillName);
|
|
195
|
-
return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
|
|
196
|
-
}
|
|
197
|
-
// src/chat/plugins/hook-runner.ts
|
|
198
|
-
/**
|
|
199
|
-
* Run one hook of each plugin at once. `start` gives the call for a plugin,
|
|
200
|
-
* or nothing when the plugin has no such hook. The outcomes keep plugin
|
|
201
|
-
* order, so budgets and output order do not depend on which hook ends first.
|
|
125
|
+
* Map each item through `fn`, with at most `concurrency` calls at once. The
|
|
126
|
+
* results keep the order of `items`. Use it for independent work over a list
|
|
127
|
+
* whose length the code does not fix.
|
|
202
128
|
*/
|
|
203
|
-
async function
|
|
204
|
-
|
|
205
|
-
return await Promise.all(plugins.flatMap((plugin) => {
|
|
206
|
-
const run = start(plugin);
|
|
207
|
-
return run ? [limit(run).then((value) => ({
|
|
208
|
-
plugin,
|
|
209
|
-
value
|
|
210
|
-
}), (error) => ({
|
|
211
|
-
error,
|
|
212
|
-
plugin
|
|
213
|
-
}))] : [];
|
|
214
|
-
}));
|
|
215
|
-
}
|
|
216
|
-
// src/chat/plugins/prompt.ts
|
|
217
|
-
/** The most characters that the plugin guidance of one prompt may hold. */
|
|
218
|
-
const PLUGIN_PROMPT_CONTRIBUTION_TOTAL_MAX_CHARS = 16e3;
|
|
219
|
-
/** Name one validated prompt message of a plugin hook. */
|
|
220
|
-
function toPromptContributionContext(args) {
|
|
221
|
-
return {
|
|
222
|
-
id: `${args.hookName}:${args.index}`,
|
|
223
|
-
pluginName: args.pluginName,
|
|
224
|
-
text: args.message.text
|
|
225
|
-
};
|
|
129
|
+
async function mapBounded(items, fn, concurrency = 8) {
|
|
130
|
+
return await pLimit(concurrency).map(items, fn);
|
|
226
131
|
}
|
|
227
132
|
// src/chat/turn-context-tag.ts
|
|
228
133
|
/**
|
|
@@ -407,4 +312,93 @@ function stripRuntimeTurnContext(messages) {
|
|
|
407
312
|
return [withUserContent(message, nextContent)];
|
|
408
313
|
});
|
|
409
314
|
}
|
|
410
|
-
|
|
315
|
+
// src/chat/plugins/logging.ts
|
|
316
|
+
/** Create the host logger exposed to plugin hooks. */
|
|
317
|
+
function createPluginLogger(plugin) {
|
|
318
|
+
return {
|
|
319
|
+
info(message, metadata) {
|
|
320
|
+
logInfo("plugin.log.info", {
|
|
321
|
+
"app.log.message": message,
|
|
322
|
+
"app.plugin.name": plugin,
|
|
323
|
+
...metadata
|
|
324
|
+
});
|
|
325
|
+
},
|
|
326
|
+
warn(message, metadata) {
|
|
327
|
+
logWarn("plugin.log.warning", {
|
|
328
|
+
"app.log.message": message,
|
|
329
|
+
"app.plugin.name": plugin,
|
|
330
|
+
...metadata
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
error(message, metadata, cause) {
|
|
334
|
+
logException(new Error(message, { cause }), "plugin.log.error", {
|
|
335
|
+
"app.plugin.name": plugin,
|
|
336
|
+
...metadata
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
// src/chat/sandbox/paths.ts
|
|
342
|
+
const SANDBOX_WORKSPACE_ROOT = "/vercel/sandbox";
|
|
343
|
+
const SANDBOX_REPOS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/repos`;
|
|
344
|
+
const SANDBOX_SKILLS_ROOT = `${SANDBOX_WORKSPACE_ROOT}/skills`;
|
|
345
|
+
const SANDBOX_DATA_ROOT = `${SANDBOX_WORKSPACE_ROOT}/data`;
|
|
346
|
+
/** Runtime-owned files inside the sandbox, outside every repository. */
|
|
347
|
+
const SANDBOX_JUNIOR_ROOT = `${SANDBOX_WORKSPACE_ROOT}/.junior`;
|
|
348
|
+
/**
|
|
349
|
+
* Runtime-written files that live only as long as the Sandbox. Nothing here
|
|
350
|
+
* is ever copied out of the Sandbox. Tool notes name these paths, so keep the
|
|
351
|
+
* root short.
|
|
352
|
+
*/
|
|
353
|
+
const SANDBOX_SCRATCH_ROOT = "/tmp/jr";
|
|
354
|
+
/** Sandbox directory for attachment files that tools write. */
|
|
355
|
+
const ATTACHMENT_DIR = ".junior/attachments";
|
|
356
|
+
/**
|
|
357
|
+
* PATH for sandbox commands. Plugin runtime binaries come last so they never
|
|
358
|
+
* shadow repo or Workspace tools with the same name. Repo tools often start
|
|
359
|
+
* child processes through PATH, so only PATH order can protect them. Plugin
|
|
360
|
+
* binaries stay reachable by name or by absolute path.
|
|
361
|
+
*/
|
|
362
|
+
const SANDBOX_COMMAND_PATH = `$PATH:${`${SANDBOX_JUNIOR_ROOT}/bin`}`;
|
|
363
|
+
function sandboxSkillDir(skillName) {
|
|
364
|
+
return `${SANDBOX_SKILLS_ROOT}/${skillName}`;
|
|
365
|
+
}
|
|
366
|
+
function sandboxSkillFile(skillName) {
|
|
367
|
+
return `${sandboxSkillDir(skillName)}/SKILL.md`;
|
|
368
|
+
}
|
|
369
|
+
/** Explain how the agent should resolve files and commands owned by a skill. */
|
|
370
|
+
function sandboxSkillPathResolution(skillName) {
|
|
371
|
+
const skillDir = sandboxSkillDir(skillName);
|
|
372
|
+
return `Resolve relative paths in this skill against ${skillDir}. For bash commands from this skill, cd to ${skillDir} first or use absolute paths.`;
|
|
373
|
+
}
|
|
374
|
+
// src/chat/plugins/hook-runner.ts
|
|
375
|
+
/**
|
|
376
|
+
* Run one hook of each plugin at once. `start` gives the call for a plugin,
|
|
377
|
+
* or nothing when the plugin has no such hook. The outcomes keep plugin
|
|
378
|
+
* order, so budgets and output order do not depend on which hook ends first.
|
|
379
|
+
*/
|
|
380
|
+
async function runPluginHooksAtOnce(plugins, start) {
|
|
381
|
+
const limit = pLimit(8);
|
|
382
|
+
return await Promise.all(plugins.flatMap((plugin) => {
|
|
383
|
+
const run = start(plugin);
|
|
384
|
+
return run ? [limit(run).then((value) => ({
|
|
385
|
+
plugin,
|
|
386
|
+
value
|
|
387
|
+
}), (error) => ({
|
|
388
|
+
error,
|
|
389
|
+
plugin
|
|
390
|
+
}))] : [];
|
|
391
|
+
}));
|
|
392
|
+
}
|
|
393
|
+
// src/chat/plugins/prompt.ts
|
|
394
|
+
/** The most characters that the plugin guidance of one prompt may hold. */
|
|
395
|
+
const PLUGIN_PROMPT_CONTRIBUTION_TOTAL_MAX_CHARS = 16e3;
|
|
396
|
+
/** Name one validated prompt message of a plugin hook. */
|
|
397
|
+
function toPromptContributionContext(args) {
|
|
398
|
+
return {
|
|
399
|
+
id: `${args.hookName}:${args.index}`,
|
|
400
|
+
pluginName: args.pluginName,
|
|
401
|
+
text: args.message.text
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
export { retainRuntimeTurnContext as A, THREAD_CONTEXT_TAGS as B, instructionTextForProjection as C, isToolResultError as D, isStandaloneRuntimeContextMessage as E, SESSION_CONTEXT_SECTION_TAG as F, renderThreadContext as G, readParentAgentTask as H, TURN_CONTEXT_TAG as I, mapBounded as L, trimTrailingAssistantMessages as M, CAPABILITY_SECTION_TAG as N, isToolResultMessage as O, REQUEST_CONTEXT_SECTION_TAG as P, renderCurrentInstruction as R, hasTurnInput as S, isContinuablePiBoundary as T, renderDataTag as U, authorAttrs as V, renderParentAgentTask as W, extractAssistantText as _, SANDBOX_COMMAND_PATH as a, getUserMessageInstructionText as b, SANDBOX_REPOS_ROOT as c, SANDBOX_WORKSPACE_ROOT as d, sandboxSkillDir as f, RUNTIME_CONTEXT_TEXT_STARTS as g, createPluginLogger as h, ATTACHMENT_DIR as i, stripRuntimeTurnContext as j, normalizeToolNameFromResult as k, SANDBOX_SCRATCH_ROOT as l, sandboxSkillPathResolution as m, toPromptContributionContext as n, SANDBOX_DATA_ROOT as o, sandboxSkillFile as p, runPluginHooksAtOnce as r, SANDBOX_JUNIOR_ROOT as s, PLUGIN_PROMPT_CONTRIBUTION_TOTAL_MAX_CHARS as t, SANDBOX_SKILLS_ROOT as u, getPiMessageRole as v, isAssistantMessage as w, hasRuntimeTurnContext as x, getTerminalAssistantMessages as y, unwrapCurrentInstruction as z };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// src/chat/sandbox/egress/proxy-path.ts
|
|
2
|
+
const SANDBOX_EGRESS_PROXY_PATH = "/api/internal/sandbox-egress";
|
|
3
|
+
const PROXY_PATH_PREFIX = `${SANDBOX_EGRESS_PROXY_PATH}/`;
|
|
4
|
+
const SIGNALS_SEGMENT = "signals";
|
|
5
|
+
/**
|
|
6
|
+
* Replace the credential token and everything after it in a sandbox egress
|
|
7
|
+
* proxy path or URL. Other values are returned unchanged.
|
|
8
|
+
*/
|
|
9
|
+
function redactSandboxEgressProxyPath(value) {
|
|
10
|
+
const index = value.indexOf(PROXY_PATH_PREFIX);
|
|
11
|
+
if (index === -1) return value;
|
|
12
|
+
if (value.slice(index + PROXY_PATH_PREFIX.length).split(/[/?#]/, 1)[0] === SIGNALS_SEGMENT) return value;
|
|
13
|
+
return `${value.slice(0, index)}${PROXY_PATH_PREFIX}<token>`;
|
|
14
|
+
}
|
|
15
|
+
export { redactSandboxEgressProxyPath as n, SANDBOX_EGRESS_PROXY_PATH as t };
|