replicas-engine 0.1.1024 → 0.1.1026
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/src/{asp-host-RAWMASFX.js → asp-host-PCWQGSAZ.js} +5 -5
- package/dist/src/{chunk-KXADRVAB.js → chunk-7BKBAILL.js} +3 -3
- package/dist/src/{chunk-5HPD4VG2.js → chunk-GFAZ3ML4.js} +6 -6
- package/dist/src/{chunk-C2C4ZTHR.js → chunk-HCZS2Y4Y.js} +3 -3
- package/dist/src/{chunk-HHYJ2FOD.js → chunk-HLUAG4YU.js} +670 -581
- package/dist/src/{chunk-B4XY2JDA.js → chunk-IPL36DTU.js} +1 -1
- package/dist/src/{chunk-E5K35DUL.js → chunk-QFJFKNXF.js} +1 -1
- package/dist/src/{chunk-HW2ZEEFV.js → chunk-X5VJ2FDA.js} +1 -1
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +3 -3
- package/dist/src/index.js +22 -16
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -58,11 +58,11 @@ var CODEX_REASONING_EFFORT_BY_THINKING_LEVEL = {
|
|
|
58
58
|
ultra: "ultra",
|
|
59
59
|
ultracode: "xhigh"
|
|
60
60
|
};
|
|
61
|
-
function codexReasoningEffortForThinkingLevel(
|
|
62
|
-
return
|
|
61
|
+
function codexReasoningEffortForThinkingLevel(thinkingLevel2) {
|
|
62
|
+
return thinkingLevel2 ? CODEX_REASONING_EFFORT_BY_THINKING_LEVEL[thinkingLevel2] : void 0;
|
|
63
63
|
}
|
|
64
|
-
function getProviderDisplayName(
|
|
65
|
-
switch (
|
|
64
|
+
function getProviderDisplayName(provider2, variant = "short") {
|
|
65
|
+
switch (provider2) {
|
|
66
66
|
case "codex":
|
|
67
67
|
return "Codex";
|
|
68
68
|
case "cursor":
|
|
@@ -141,10 +141,10 @@ var OPENCODE_GO_BASE_URL = "https://opencode.ai/zen/go/v1";
|
|
|
141
141
|
var DEFAULT_OPENCODE_GO_MODEL = "glm-5.3";
|
|
142
142
|
async function fetchOpenCodeGoCatalog(fallbackModelIds = [DEFAULT_OPENCODE_GO_MODEL]) {
|
|
143
143
|
try {
|
|
144
|
-
const
|
|
145
|
-
if (!
|
|
144
|
+
const provider2 = (await fetchModelsDevCatalog())[OPENCODE_GO_PROVIDER];
|
|
145
|
+
if (!provider2) throw new Error("OpenCode Go model catalog is unavailable");
|
|
146
146
|
const models = Object.fromEntries(
|
|
147
|
-
Object.entries(
|
|
147
|
+
Object.entries(provider2.models).filter(([, definition]) => definition.status !== "deprecated" && definition.status !== "alpha").map(([id, definition]) => [id, {
|
|
148
148
|
id: definition.id ?? id,
|
|
149
149
|
name: definition.name,
|
|
150
150
|
api: definition.provider?.npm === "@ai-sdk/anthropic" ? "anthropic-messages" : definition.provider?.npm === "@ai-sdk/openai" ? "openai-responses" : void 0,
|
|
@@ -234,34 +234,34 @@ var FALLBACK_AGENT_MODEL = {
|
|
|
234
234
|
opencode: DEFAULT_OPENCODE_MODEL,
|
|
235
235
|
pi: DEFAULT_PI_MODEL
|
|
236
236
|
};
|
|
237
|
-
function getDefaultAgentModel(
|
|
238
|
-
const catalogDefault = overrides?.defaultModels?.[
|
|
237
|
+
function getDefaultAgentModel(provider2, overrides) {
|
|
238
|
+
const catalogDefault = overrides?.defaultModels?.[provider2];
|
|
239
239
|
if (catalogDefault === null) return "";
|
|
240
|
-
const options = getAgentModelOptions(
|
|
240
|
+
const options = getAgentModelOptions(provider2, overrides);
|
|
241
241
|
if (catalogDefault && options.includes(catalogDefault)) return catalogDefault;
|
|
242
|
-
const fallback = FALLBACK_AGENT_MODEL[
|
|
242
|
+
const fallback = FALLBACK_AGENT_MODEL[provider2];
|
|
243
243
|
return options.includes(fallback) ? fallback : options[0] ?? "";
|
|
244
244
|
}
|
|
245
|
-
function normalizeClaudeModel(
|
|
246
|
-
if (
|
|
245
|
+
function normalizeClaudeModel(model2) {
|
|
246
|
+
if (model2 === "opus" || model2 === CLAUDE_OPUS_1M_MODEL || model2 === LEGACY_CLAUDE_OPUS_1M_MODEL) {
|
|
247
247
|
return DEFAULT_CLAUDE_MODEL;
|
|
248
248
|
}
|
|
249
|
-
if (
|
|
249
|
+
if (model2 === "fable") {
|
|
250
250
|
return CLAUDE_FABLE_5_1_MODEL;
|
|
251
251
|
}
|
|
252
|
-
if (
|
|
252
|
+
if (model2 === "sonnet") {
|
|
253
253
|
return CLAUDE_SONNET_5_MODEL;
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
255
|
+
if (model2 === "haiku") {
|
|
256
256
|
return CLAUDE_HAIKU_4_5_MODEL;
|
|
257
257
|
}
|
|
258
|
-
return
|
|
258
|
+
return model2;
|
|
259
259
|
}
|
|
260
|
-
function toClaudeCodeModel(
|
|
260
|
+
function toClaudeCodeModel(model2, bedrock) {
|
|
261
261
|
if (!bedrock) {
|
|
262
|
-
return
|
|
262
|
+
return model2;
|
|
263
263
|
}
|
|
264
|
-
switch (normalizeClaudeModel(
|
|
264
|
+
switch (normalizeClaudeModel(model2)) {
|
|
265
265
|
case CLAUDE_FABLE_5_1_MODEL:
|
|
266
266
|
return CLAUDE_FABLE_5_1_BEDROCK_MODEL;
|
|
267
267
|
case CLAUDE_FABLE_5_MODEL:
|
|
@@ -281,7 +281,7 @@ function toClaudeCodeModel(model, bedrock) {
|
|
|
281
281
|
case CLAUDE_HAIKU_4_5_MODEL:
|
|
282
282
|
return "haiku";
|
|
283
283
|
default:
|
|
284
|
-
return
|
|
284
|
+
return model2;
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
var CLAUDE_MODEL_CONTEXT_WINDOWS = {
|
|
@@ -309,14 +309,14 @@ var CLAUDE_MODEL_CONTEXT_WINDOWS = {
|
|
|
309
309
|
"claude-haiku-4-5-20251001": 2e5,
|
|
310
310
|
"claude-haiku-4-5@20251001": 2e5
|
|
311
311
|
};
|
|
312
|
-
function getClaudeModelContextWindow(
|
|
313
|
-
if (!
|
|
314
|
-
const normalized = normalizeClaudeModel(
|
|
315
|
-
return CLAUDE_MODEL_CONTEXT_WINDOWS[normalized] ?? CLAUDE_MODEL_CONTEXT_WINDOWS[
|
|
312
|
+
function getClaudeModelContextWindow(model2) {
|
|
313
|
+
if (!model2) return null;
|
|
314
|
+
const normalized = normalizeClaudeModel(model2) ?? model2;
|
|
315
|
+
return CLAUDE_MODEL_CONTEXT_WINDOWS[normalized] ?? CLAUDE_MODEL_CONTEXT_WINDOWS[model2] ?? null;
|
|
316
316
|
}
|
|
317
|
-
function canUseClaudeFastMode(
|
|
318
|
-
const normalized = normalizeClaudeModel(
|
|
319
|
-
return normalized === CLAUDE_OPUS_5_5_MODEL || normalized === CLAUDE_OPUS_5_MODEL || normalized === CLAUDE_OPUS_4_8_MODEL ||
|
|
317
|
+
function canUseClaudeFastMode(model2) {
|
|
318
|
+
const normalized = normalizeClaudeModel(model2);
|
|
319
|
+
return normalized === CLAUDE_OPUS_5_5_MODEL || normalized === CLAUDE_OPUS_5_MODEL || normalized === CLAUDE_OPUS_4_8_MODEL || model2 === "claude-opus-4-7";
|
|
320
320
|
}
|
|
321
321
|
var CLAUDE_MODEL_MIN_SANDBOX_IMAGE = {
|
|
322
322
|
[CLAUDE_FABLE_5_1_MODEL]: "replicas-sandbox-2026-09-01-v6",
|
|
@@ -410,18 +410,18 @@ var HIDDEN_BY_DEFAULT_MODELS = /* @__PURE__ */ new Set([
|
|
|
410
410
|
"grok-4.3",
|
|
411
411
|
"kimi-k2.5"
|
|
412
412
|
]);
|
|
413
|
-
var withoutHiddenByDefault = (models) => models.filter((
|
|
413
|
+
var withoutHiddenByDefault = (models) => models.filter((model2) => !HIDDEN_BY_DEFAULT_MODELS.has(model2));
|
|
414
414
|
var DEFAULT_STATIC_AGENT_MODELS = {
|
|
415
415
|
claude: withoutHiddenByDefault(AGENT_MODELS.claude),
|
|
416
416
|
codex: withoutHiddenByDefault(AGENT_MODELS.codex)
|
|
417
417
|
};
|
|
418
418
|
var DEFAULT_CURSOR_MODELS = withoutHiddenByDefault(AGENT_MODELS.cursor);
|
|
419
|
-
function getAgentModelOptions(
|
|
420
|
-
const override = overrides?.[
|
|
419
|
+
function getAgentModelOptions(provider2, overrides) {
|
|
420
|
+
const override = overrides?.[provider2];
|
|
421
421
|
if (override?.length) return override;
|
|
422
|
-
if (
|
|
423
|
-
if (
|
|
424
|
-
return AGENT_MODELS[
|
|
422
|
+
if (provider2 === "claude" || provider2 === "codex") return DEFAULT_STATIC_AGENT_MODELS[provider2];
|
|
423
|
+
if (provider2 === "cursor") return DEFAULT_CURSOR_MODELS;
|
|
424
|
+
return AGENT_MODELS[provider2] ?? [];
|
|
425
425
|
}
|
|
426
426
|
var SANDBOX_IMAGE_MODEL_FALLBACKS = {
|
|
427
427
|
[CLAUDE_OPUS_5_5_MODEL]: CLAUDE_OPUS_5_MODEL,
|
|
@@ -629,14 +629,14 @@ var CONTEXT_WINDOW_KEYS = /* @__PURE__ */ new Set([
|
|
|
629
629
|
"maxContextLength"
|
|
630
630
|
]);
|
|
631
631
|
var MAX_CATALOG_PAGES = 20;
|
|
632
|
-
function getModelContextWindow(
|
|
633
|
-
const directValues = Object.entries(
|
|
632
|
+
function getModelContextWindow(model2) {
|
|
633
|
+
const directValues = Object.entries(model2).flatMap(([key, value]) => {
|
|
634
634
|
const contextWindow = CONTEXT_WINDOW_KEYS.has(key) ? positiveInteger(value) : null;
|
|
635
635
|
return contextWindow === null ? [] : [contextWindow];
|
|
636
636
|
});
|
|
637
637
|
if (directValues.length > 0) return Math.max(...directValues);
|
|
638
638
|
const values = [];
|
|
639
|
-
const pending = Object.entries(
|
|
639
|
+
const pending = Object.entries(model2).filter(([key]) => !CONTEXT_WINDOW_KEYS.has(key)).map(([, value]) => value);
|
|
640
640
|
for (let inspected = 0; pending.length > 0 && inspected < 1e3; inspected += 1) {
|
|
641
641
|
const current = pending.pop();
|
|
642
642
|
if (Array.isArray(current)) {
|
|
@@ -695,7 +695,7 @@ async function listOpenAICompatibleModels(credential) {
|
|
|
695
695
|
});
|
|
696
696
|
if (!response.ok) throw new Error(`Models request failed with status ${response.status}`);
|
|
697
697
|
const payload = await response.json();
|
|
698
|
-
for (const
|
|
698
|
+
for (const model2 of parseOpenAICompatibleModels(payload)) models.set(model2.id, model2);
|
|
699
699
|
if (!isRecord(payload) || payload.has_more !== true) break;
|
|
700
700
|
if (page === MAX_CATALOG_PAGES - 1) throw new Error(`The models endpoint exceeded ${MAX_CATALOG_PAGES} pages`);
|
|
701
701
|
if (typeof payload.next_cursor !== "string" || !payload.next_cursor) {
|
|
@@ -732,17 +732,17 @@ function readOllamaAuthEnv(agent, env) {
|
|
|
732
732
|
var DEFAULT_OLLAMA_MODEL = "gpt-oss:20b";
|
|
733
733
|
var catalogs = /* @__PURE__ */ new Map();
|
|
734
734
|
function getDefaultOllamaModel(models) {
|
|
735
|
-
return models.find((
|
|
735
|
+
return models.find((model2) => model2.id === DEFAULT_OLLAMA_MODEL && model2.capabilities?.includes("tools") && (model2.contextWindow ?? 0) >= 64e3)?.id ?? null;
|
|
736
736
|
}
|
|
737
|
-
function parseOllamaModelDetails(
|
|
738
|
-
if (!isRecord(payload)) return
|
|
737
|
+
function parseOllamaModelDetails(model2, payload) {
|
|
738
|
+
if (!isRecord(payload)) return model2;
|
|
739
739
|
const capabilities = Array.isArray(payload.capabilities) ? payload.capabilities.filter((value) => typeof value === "string") : void 0;
|
|
740
740
|
const info = isRecord(payload.model_info) ? payload.model_info : {};
|
|
741
741
|
const context = Object.entries(info).find(([key]) => key.endsWith(".context_length"))?.[1];
|
|
742
742
|
const configured = typeof payload.parameters === "string" ? /(?:^|\n)\s*num_ctx\s+(\d+)/.exec(payload.parameters)?.[1] : void 0;
|
|
743
743
|
const contextWindow = configured ? Number(configured) : context;
|
|
744
744
|
return {
|
|
745
|
-
...
|
|
745
|
+
...model2,
|
|
746
746
|
...capabilities ? { capabilities } : {},
|
|
747
747
|
...typeof contextWindow === "number" && Number.isSafeInteger(contextWindow) && contextWindow > 0 ? { contextWindow } : {}
|
|
748
748
|
};
|
|
@@ -769,18 +769,18 @@ async function loadOllamaModels(credential) {
|
|
|
769
769
|
detailed.push(...models.slice(offset));
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
772
|
-
detailed.push(...await Promise.all(models.slice(offset, offset + 10).map(async (
|
|
772
|
+
detailed.push(...await Promise.all(models.slice(offset, offset + 10).map(async (model2) => {
|
|
773
773
|
try {
|
|
774
774
|
const response = await fetch(url, {
|
|
775
775
|
method: "POST",
|
|
776
776
|
redirect: "error",
|
|
777
777
|
signal,
|
|
778
778
|
headers: { Authorization: `Bearer ${credential.apiKey}`, "Content-Type": "application/json" },
|
|
779
|
-
body: JSON.stringify({ model:
|
|
779
|
+
body: JSON.stringify({ model: model2.id })
|
|
780
780
|
});
|
|
781
|
-
return response.ok ? parseOllamaModelDetails(
|
|
781
|
+
return response.ok ? parseOllamaModelDetails(model2, await response.json()) : model2;
|
|
782
782
|
} catch {
|
|
783
|
-
return
|
|
783
|
+
return model2;
|
|
784
784
|
}
|
|
785
785
|
})));
|
|
786
786
|
}
|
|
@@ -1030,6 +1030,7 @@ function isCredentialScope(value) {
|
|
|
1030
1030
|
function isAgentChatTurnActivityRecord(value) {
|
|
1031
1031
|
return isAgentChatActivityRecord(value) && typeof value.turnId === "string" && typeof value.seconds === "number" && Number.isFinite(value.seconds) && value.seconds >= 0;
|
|
1032
1032
|
}
|
|
1033
|
+
var SKILL_USE_KINDS = ["invoke", "read", "shell"];
|
|
1033
1034
|
function isAgentChatActivityCallRecord(value) {
|
|
1034
1035
|
return isAgentChatActivityRecord(value) && typeof value.callId === "string" && value.callId.length > 0;
|
|
1035
1036
|
}
|
|
@@ -1039,7 +1040,7 @@ function isNamedAgentChatActivityRecord(value, field) {
|
|
|
1039
1040
|
return typeof name === "string" && name.length > 0;
|
|
1040
1041
|
}
|
|
1041
1042
|
function isAgentChatSkillActivityRecord(value) {
|
|
1042
|
-
return isNamedAgentChatActivityRecord(value, "skillName");
|
|
1043
|
+
return isNamedAgentChatActivityRecord(value, "skillName") && isRecord(value) && (value.useKind === void 0 || SKILL_USE_KINDS.some((kind) => kind === value.useKind));
|
|
1043
1044
|
}
|
|
1044
1045
|
function isAgentChatMcpActivityRecord(value) {
|
|
1045
1046
|
return isNamedAgentChatActivityRecord(value, "mcpName");
|
|
@@ -1101,14 +1102,14 @@ var AUTH_RETRY_STATUS_EVENT_TYPE = "auth-retry-status";
|
|
|
1101
1102
|
var CURSOR_CONNECTION_STATUS_EVENT_TYPE = "cursor-connection-status";
|
|
1102
1103
|
var AUTH_FALLBACK_EVENT_TYPE = "auth-fallback";
|
|
1103
1104
|
function coerceAuthFallbackPayload(payload) {
|
|
1104
|
-
const { provider, reason, exhaustedMethod, exhaustedScope, candidateMethod, candidateScope, status, detail } = payload;
|
|
1105
|
+
const { provider: provider2, reason, exhaustedMethod, exhaustedScope, candidateMethod, candidateScope, status, detail } = payload;
|
|
1105
1106
|
const exhaustedAccount = credentialAccountSchema.safeParse(payload.exhaustedAccount).data;
|
|
1106
1107
|
const candidateAccount = credentialAccountSchema.safeParse(payload.candidateAccount).data;
|
|
1107
|
-
if (typeof
|
|
1108
|
+
if (typeof provider2 !== "string" || !isValidAgentProvider(provider2) || reason !== "rate_limit" && reason !== "out_of_credits" || !isAuthMethod(exhaustedMethod) || !isAuthMethod(candidateMethod) || !isCredentialScope(candidateScope) || status !== "switched" && status !== "failed") {
|
|
1108
1109
|
return null;
|
|
1109
1110
|
}
|
|
1110
1111
|
return {
|
|
1111
|
-
provider,
|
|
1112
|
+
provider: provider2,
|
|
1112
1113
|
reason,
|
|
1113
1114
|
exhaustedMethod,
|
|
1114
1115
|
...isCredentialScope(exhaustedScope) ? { exhaustedScope } : {},
|
|
@@ -1279,14 +1280,14 @@ function imageContentToUserMessageImages(images) {
|
|
|
1279
1280
|
}
|
|
1280
1281
|
return userImages.length > 0 ? userImages : void 0;
|
|
1281
1282
|
}
|
|
1282
|
-
function createAcceptedUserMessageEvent(
|
|
1283
|
+
function createAcceptedUserMessageEvent(message2, messageId, timestamp, images) {
|
|
1283
1284
|
const eventImages = imageContentToUserMessageImages(images);
|
|
1284
1285
|
return {
|
|
1285
1286
|
timestamp,
|
|
1286
1287
|
type: "event_msg",
|
|
1287
1288
|
payload: {
|
|
1288
1289
|
type: "user_message",
|
|
1289
|
-
message,
|
|
1290
|
+
message: message2,
|
|
1290
1291
|
source: ACCEPTED_USER_MESSAGE_SOURCE,
|
|
1291
1292
|
[USER_MESSAGE_ID_PAYLOAD_KEY]: messageId,
|
|
1292
1293
|
...eventImages ? { images: eventImages } : {}
|
|
@@ -1492,6 +1493,62 @@ function paginateChatHistory(full, params) {
|
|
|
1492
1493
|
};
|
|
1493
1494
|
}
|
|
1494
1495
|
|
|
1496
|
+
// ../shared/src/subagent-mcp.ts
|
|
1497
|
+
var SUBAGENT_MCP_SERVER_NAME = "subagents";
|
|
1498
|
+
var SUBAGENT_MCP_TOOLS = {
|
|
1499
|
+
getProviders: "get_providers",
|
|
1500
|
+
spawnAgent: "spawn_agent",
|
|
1501
|
+
getAgent: "get_agent",
|
|
1502
|
+
waitAgent: "wait_agent",
|
|
1503
|
+
messageAgent: "message_agent",
|
|
1504
|
+
deleteAgent: "delete_agent"
|
|
1505
|
+
};
|
|
1506
|
+
var SUBAGENT_MCP_TOOL_NAMES = Object.values(SUBAGENT_MCP_TOOLS);
|
|
1507
|
+
|
|
1508
|
+
// ../shared/src/workspace-identity.ts
|
|
1509
|
+
import { z as z4 } from "zod";
|
|
1510
|
+
var WORKSPACE_IDENTITY_AUDIENCE = "replicas:workspace";
|
|
1511
|
+
var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
|
|
1512
|
+
var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
|
|
1513
|
+
var IDENTITY_PROXY_PORT = 17323;
|
|
1514
|
+
var IDENTITY_TOKEN_PATH = "/token";
|
|
1515
|
+
var workspaceAudienceSchema = z4.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
|
|
1516
|
+
var workspaceTokenRequestSchema = z4.object({
|
|
1517
|
+
audience: workspaceAudienceSchema.optional(),
|
|
1518
|
+
aws_source_identity: z4.boolean().optional()
|
|
1519
|
+
});
|
|
1520
|
+
var workspaceTokenClaimsSchema = z4.object({
|
|
1521
|
+
iss: z4.string(),
|
|
1522
|
+
sub: z4.string(),
|
|
1523
|
+
aud: z4.string(),
|
|
1524
|
+
iat: z4.number().int(),
|
|
1525
|
+
nbf: z4.number().int(),
|
|
1526
|
+
exp: z4.number().int(),
|
|
1527
|
+
jti: z4.string(),
|
|
1528
|
+
organization_id: z4.string().uuid(),
|
|
1529
|
+
workspace_id: z4.string().uuid(),
|
|
1530
|
+
environment_id: z4.string().uuid(),
|
|
1531
|
+
creator_id: z4.string().uuid().nullable(),
|
|
1532
|
+
creator_email: z4.string().nullable().default(null),
|
|
1533
|
+
[AWS_SOURCE_IDENTITY_CLAIM]: z4.string().uuid().optional()
|
|
1534
|
+
}).passthrough();
|
|
1535
|
+
var workspaceTokenResponseSchema = z4.object({
|
|
1536
|
+
issuer: z4.string(),
|
|
1537
|
+
audience: z4.string(),
|
|
1538
|
+
token: z4.string(),
|
|
1539
|
+
expires_at: z4.string()
|
|
1540
|
+
});
|
|
1541
|
+
var legacyWorkspaceTokenBundleSchema = z4.object({
|
|
1542
|
+
version: z4.literal(1),
|
|
1543
|
+
issuer: z4.string(),
|
|
1544
|
+
default_audience: z4.string(),
|
|
1545
|
+
tokens: z4.record(z4.string(), z4.object({ token: z4.string(), expires_at: z4.string() }))
|
|
1546
|
+
});
|
|
1547
|
+
var mcpWorkloadAuthSchema = z4.strictObject({
|
|
1548
|
+
type: z4.literal("workspace_identity"),
|
|
1549
|
+
audience: workspaceAudienceSchema
|
|
1550
|
+
});
|
|
1551
|
+
|
|
1495
1552
|
// ../shared/src/runtime-env.ts
|
|
1496
1553
|
var REPLICAS_RUNTIME_ENV_ALIASES = {
|
|
1497
1554
|
monolithUrl: ["REPLICAS_MONOLITH_URL", "MONOLITH_URL"],
|
|
@@ -1694,80 +1751,24 @@ function gitIdentityConfigCommands(identity, scope = "global") {
|
|
|
1694
1751
|
];
|
|
1695
1752
|
}
|
|
1696
1753
|
|
|
1697
|
-
// ../shared/src/subagent-mcp.ts
|
|
1698
|
-
var SUBAGENT_MCP_SERVER_NAME = "subagents";
|
|
1699
|
-
var SUBAGENT_MCP_TOOLS = {
|
|
1700
|
-
getProviders: "get_providers",
|
|
1701
|
-
spawnAgent: "spawn_agent",
|
|
1702
|
-
getAgent: "get_agent",
|
|
1703
|
-
waitAgent: "wait_agent",
|
|
1704
|
-
messageAgent: "message_agent",
|
|
1705
|
-
deleteAgent: "delete_agent"
|
|
1706
|
-
};
|
|
1707
|
-
var SUBAGENT_MCP_TOOL_NAMES = Object.values(SUBAGENT_MCP_TOOLS);
|
|
1708
|
-
|
|
1709
1754
|
// ../shared/src/headless-agent.ts
|
|
1710
|
-
import { z as
|
|
1711
|
-
var headlessAgentRequestSchema =
|
|
1712
|
-
mode:
|
|
1713
|
-
agent:
|
|
1755
|
+
import { z as z5 } from "zod";
|
|
1756
|
+
var headlessAgentRequestSchema = z5.object({
|
|
1757
|
+
mode: z5.literal("structured"),
|
|
1758
|
+
agent: z5.custom(
|
|
1714
1759
|
(value) => typeof value === "string" && isValidAgentProvider(value)
|
|
1715
1760
|
),
|
|
1716
|
-
model:
|
|
1717
|
-
prompt:
|
|
1718
|
-
workingDirectory:
|
|
1719
|
-
timeoutSeconds:
|
|
1720
|
-
codexOauthTokens:
|
|
1721
|
-
outputSchema:
|
|
1761
|
+
model: z5.string().min(1),
|
|
1762
|
+
prompt: z5.string(),
|
|
1763
|
+
workingDirectory: z5.string().min(1),
|
|
1764
|
+
timeoutSeconds: z5.number().int().min(1).max(1800).default(300),
|
|
1765
|
+
codexOauthTokens: z5.object({ accessToken: z5.string(), accountId: z5.string() }).optional(),
|
|
1766
|
+
outputSchema: z5.record(z5.string(), z5.json())
|
|
1722
1767
|
});
|
|
1723
1768
|
|
|
1724
1769
|
// ../shared/src/engine/environment.ts
|
|
1725
1770
|
var DESKTOP_STREAM_PORT = 6080;
|
|
1726
1771
|
|
|
1727
|
-
// ../shared/src/workspace-identity.ts
|
|
1728
|
-
import { z as z5 } from "zod";
|
|
1729
|
-
var WORKSPACE_IDENTITY_AUDIENCE = "replicas:workspace";
|
|
1730
|
-
var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
|
|
1731
|
-
var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
|
|
1732
|
-
var IDENTITY_PROXY_PORT = 17323;
|
|
1733
|
-
var IDENTITY_TOKEN_PATH = "/token";
|
|
1734
|
-
var workspaceAudienceSchema = z5.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
|
|
1735
|
-
var workspaceTokenRequestSchema = z5.object({
|
|
1736
|
-
audience: workspaceAudienceSchema.optional(),
|
|
1737
|
-
aws_source_identity: z5.boolean().optional()
|
|
1738
|
-
});
|
|
1739
|
-
var workspaceTokenClaimsSchema = z5.object({
|
|
1740
|
-
iss: z5.string(),
|
|
1741
|
-
sub: z5.string(),
|
|
1742
|
-
aud: z5.string(),
|
|
1743
|
-
iat: z5.number().int(),
|
|
1744
|
-
nbf: z5.number().int(),
|
|
1745
|
-
exp: z5.number().int(),
|
|
1746
|
-
jti: z5.string(),
|
|
1747
|
-
organization_id: z5.string().uuid(),
|
|
1748
|
-
workspace_id: z5.string().uuid(),
|
|
1749
|
-
environment_id: z5.string().uuid(),
|
|
1750
|
-
creator_id: z5.string().uuid().nullable(),
|
|
1751
|
-
creator_email: z5.string().nullable().default(null),
|
|
1752
|
-
[AWS_SOURCE_IDENTITY_CLAIM]: z5.string().uuid().optional()
|
|
1753
|
-
}).passthrough();
|
|
1754
|
-
var workspaceTokenResponseSchema = z5.object({
|
|
1755
|
-
issuer: z5.string(),
|
|
1756
|
-
audience: z5.string(),
|
|
1757
|
-
token: z5.string(),
|
|
1758
|
-
expires_at: z5.string()
|
|
1759
|
-
});
|
|
1760
|
-
var legacyWorkspaceTokenBundleSchema = z5.object({
|
|
1761
|
-
version: z5.literal(1),
|
|
1762
|
-
issuer: z5.string(),
|
|
1763
|
-
default_audience: z5.string(),
|
|
1764
|
-
tokens: z5.record(z5.string(), z5.object({ token: z5.string(), expires_at: z5.string() }))
|
|
1765
|
-
});
|
|
1766
|
-
var mcpWorkloadAuthSchema = z5.strictObject({
|
|
1767
|
-
type: z5.literal("workspace_identity"),
|
|
1768
|
-
audience: workspaceAudienceSchema
|
|
1769
|
-
});
|
|
1770
|
-
|
|
1771
1772
|
// ../shared/src/sse.ts
|
|
1772
1773
|
function parseSseChunk(chunk) {
|
|
1773
1774
|
let data = "";
|
|
@@ -1828,10 +1829,10 @@ async function raceWithTimeout(promise, ms) {
|
|
|
1828
1829
|
});
|
|
1829
1830
|
}
|
|
1830
1831
|
}
|
|
1831
|
-
async function withTimeout(promise, ms,
|
|
1832
|
+
async function withTimeout(promise, ms, message2) {
|
|
1832
1833
|
const result = await raceWithTimeout(promise, ms);
|
|
1833
1834
|
if (result === TIMEOUT) {
|
|
1834
|
-
throw new Error(
|
|
1835
|
+
throw new Error(message2);
|
|
1835
1836
|
}
|
|
1836
1837
|
return result;
|
|
1837
1838
|
}
|
|
@@ -1863,9 +1864,9 @@ function detectAgentQuotaLimit(text2) {
|
|
|
1863
1864
|
}
|
|
1864
1865
|
|
|
1865
1866
|
// ../shared/src/auth-fallback.ts
|
|
1866
|
-
function describeCredential(
|
|
1867
|
+
function describeCredential(provider2, credential) {
|
|
1867
1868
|
const { ownerName, email, ordinal } = credential.account ?? {};
|
|
1868
|
-
const label = `${getCredentialMethodLabel(
|
|
1869
|
+
const label = `${getCredentialMethodLabel(provider2, credential.method)}${ordinal ? ` #${ordinal}` : ""}`;
|
|
1869
1870
|
const owner = credential.scope === CREDENTIAL_SCOPE.USER ? ownerName ? `${ownerName}'s personal ${label}` : `your ${label}` : credential.scope === CREDENTIAL_SCOPE.ORG ? `the organization's ${label}` : `the ${label}`;
|
|
1870
1871
|
return email ? `${owner} (${email})` : owner;
|
|
1871
1872
|
}
|
|
@@ -1894,12 +1895,12 @@ var workspaceCredentialProviderSchema = z6.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
|
|
|
1894
1895
|
var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
|
|
1895
1896
|
var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
1896
1897
|
provider: z6.enum(VALID_AGENT_PROVIDERS)
|
|
1897
|
-
}).refine(({ provider, method }) => agentCredentialMethods(
|
|
1898
|
+
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
1898
1899
|
message: "This inference provider is not supported by this agent"
|
|
1899
1900
|
});
|
|
1900
1901
|
var switchWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
|
|
1901
1902
|
provider: workspaceCredentialProviderSchema
|
|
1902
|
-
}).refine(({ provider, method }) => agentCredentialMethods(
|
|
1903
|
+
}).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
|
|
1903
1904
|
message: "This authentication method is not supported by this agent"
|
|
1904
1905
|
});
|
|
1905
1906
|
|
|
@@ -1961,8 +1962,8 @@ var forkChatRequestSchema = z8.object({
|
|
|
1961
1962
|
function describeQuotaLimit(reason) {
|
|
1962
1963
|
return reason === "out_of_credits" ? "ran out of credits" : "hit its usage limit";
|
|
1963
1964
|
}
|
|
1964
|
-
function describeChatForkReason(reason,
|
|
1965
|
-
return reason ? `${getProviderDisplayName(
|
|
1965
|
+
function describeChatForkReason(reason, provider2) {
|
|
1966
|
+
return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
|
|
1966
1967
|
}
|
|
1967
1968
|
var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
|
|
1968
1969
|
var agentQuotaExhaustedPayloadSchema = z8.object({
|
|
@@ -1971,8 +1972,8 @@ var agentQuotaExhaustedPayloadSchema = z8.object({
|
|
|
1971
1972
|
detail: z8.string().optional(),
|
|
1972
1973
|
forkTo: fallbackHarnessStepSchema.optional()
|
|
1973
1974
|
});
|
|
1974
|
-
function defaultForkChatTitle(source,
|
|
1975
|
-
return isDefaultChat(source) ? `Forked from ${source.title}` : `${source.title} (${getProviderDisplayName(
|
|
1975
|
+
function defaultForkChatTitle(source, provider2) {
|
|
1976
|
+
return isDefaultChat(source) ? `Forked from ${source.title}` : `${source.title} (${getProviderDisplayName(provider2)})`;
|
|
1976
1977
|
}
|
|
1977
1978
|
|
|
1978
1979
|
// ../shared/src/credential-pool.ts
|
|
@@ -2183,6 +2184,7 @@ function emit(scope, raw) {
|
|
|
2183
2184
|
stdin,
|
|
2184
2185
|
afterAnd: raw.afterAnd,
|
|
2185
2186
|
stdinFile: stdinFile ? resolveShellPath(scope.dir, stdinFile.target) : null,
|
|
2187
|
+
stdinTarget: stdinFile?.target ?? null,
|
|
2186
2188
|
writes: raw.redirects.flatMap(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target) ? [{ path: resolveShellPath(scope.dir, target), target, content: output, append: op.endsWith(">>") }] : []),
|
|
2187
2189
|
wrapper: script !== void 0,
|
|
2188
2190
|
truncated,
|
|
@@ -2394,13 +2396,13 @@ function stringifyDisplayValue(value) {
|
|
|
2394
2396
|
return String(value);
|
|
2395
2397
|
}
|
|
2396
2398
|
}
|
|
2397
|
-
function upsertDisplayMessage(messages,
|
|
2398
|
-
const index = messages.findIndex((candidate) => candidate.id ===
|
|
2399
|
-
if (index === -1) messages.push(
|
|
2400
|
-
else messages[index] =
|
|
2401
|
-
return
|
|
2399
|
+
function upsertDisplayMessage(messages, message2) {
|
|
2400
|
+
const index = messages.findIndex((candidate) => candidate.id === message2.id);
|
|
2401
|
+
if (index === -1) messages.push(message2);
|
|
2402
|
+
else messages[index] = message2;
|
|
2403
|
+
return message2;
|
|
2402
2404
|
}
|
|
2403
|
-
function applyToolInputEvent(event, messages,
|
|
2405
|
+
function applyToolInputEvent(event, messages, provider2, state, questionFilter) {
|
|
2404
2406
|
if (event.type === "replicas-tool-input-request" && typeof event.payload.toolUseId === "string" && typeof event.payload.requestId === "string" && (Array.isArray(event.payload.options) || Array.isArray(event.payload.questions))) {
|
|
2405
2407
|
const previous = state.resolutions.get(event.payload.toolUseId);
|
|
2406
2408
|
const resolved = previous && (!previous.requestId || previous.requestId === event.payload.requestId) ? previous : void 0;
|
|
@@ -2413,8 +2415,8 @@ function applyToolInputEvent(event, messages, provider, state, questionFilter) {
|
|
|
2413
2415
|
...resolved?.selectionSummary ? { selectionSummary: resolved.selectionSummary } : {}
|
|
2414
2416
|
};
|
|
2415
2417
|
state.requests.set(event.payload.toolUseId, inputRequest);
|
|
2416
|
-
const
|
|
2417
|
-
if (
|
|
2418
|
+
const message2 = messages.find((candidate) => candidate.type === "tool_call" && candidate.id === `${provider2}-tool-${event.payload.toolUseId}`);
|
|
2419
|
+
if (message2) message2.inputRequest = inputRequest;
|
|
2418
2420
|
return true;
|
|
2419
2421
|
}
|
|
2420
2422
|
if (event.type === "replicas-tool-input-resolved" && typeof event.payload.toolUseId === "string" && typeof event.payload.selectionId === "string") {
|
|
@@ -2445,60 +2447,47 @@ function parseSkillName(tool, input) {
|
|
|
2445
2447
|
return typeof skillName === "string" && skillName ? skillName : null;
|
|
2446
2448
|
}
|
|
2447
2449
|
function skillNameFromFilePath(path) {
|
|
2448
|
-
const skillName = skillNameFromSkillRootPath(path);
|
|
2449
|
-
if (skillName) return skillName;
|
|
2450
2450
|
const parts = path.split(/[\\/]+/).filter(Boolean);
|
|
2451
2451
|
if (parts.length < 2 || parts[parts.length - 1].toLowerCase() !== "skill.md") return null;
|
|
2452
|
-
const
|
|
2453
|
-
return
|
|
2452
|
+
const skillName = parts[parts.length - 2];
|
|
2453
|
+
return /[*?[\]{}…$]/.test(skillName) || ["skills", ".system"].includes(skillName.toLowerCase()) ? null : skillName;
|
|
2454
2454
|
}
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
if (skillsIndex === -1) return null;
|
|
2459
|
-
const firstSkillPart = parts[skillsIndex + 1];
|
|
2460
|
-
const skillName = firstSkillPart?.toLowerCase() === ".system" ? parts[skillsIndex + 2] : firstSkillPart;
|
|
2461
|
-
return skillName && skillName.toLowerCase() !== "skill.md" ? skillName : null;
|
|
2462
|
-
}
|
|
2463
|
-
function parseSkillFilePath(input) {
|
|
2455
|
+
var READ_TOOL_NAMES = /* @__PURE__ */ new Set(["read", "read_file", "readfile", "view"]);
|
|
2456
|
+
function skillFilePath(tool, input) {
|
|
2457
|
+
if (!READ_TOOL_NAMES.has(tool.toLowerCase())) return null;
|
|
2464
2458
|
const parsedInput = typeof input === "string" ? safeJsonParse(input, null) : input;
|
|
2465
2459
|
if (!isRecord(parsedInput)) return null;
|
|
2466
2460
|
const path = [parsedInput.path, parsedInput.filePath, parsedInput.file_path].find((value) => typeof value === "string" && value.length > 0);
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
const
|
|
2472
|
-
|
|
2473
|
-
if (
|
|
2474
|
-
return parseSkillFilePath(input);
|
|
2475
|
-
}
|
|
2476
|
-
function createCallDisplayMessage(message) {
|
|
2477
|
-
if (message.inputRequest) return { ...message, type: "tool_call" };
|
|
2478
|
-
const skillName = message.server.toLowerCase() === "skills" ? message.tool : skillNameFromToolCall(message.tool, message.input);
|
|
2479
|
-
if (skillName === null) return { ...message, type: "tool_call" };
|
|
2461
|
+
return path && skillNameFromFilePath(path) ? path : null;
|
|
2462
|
+
}
|
|
2463
|
+
function createCallDisplayMessage(message2) {
|
|
2464
|
+
if (message2.inputRequest) return { ...message2, type: "tool_call" };
|
|
2465
|
+
const path = skillFilePath(message2.tool, message2.input);
|
|
2466
|
+
const skillName = message2.server.toLowerCase() === "skills" ? message2.tool : path ? skillNameFromFilePath(path) : parseSkillName(message2.tool, message2.input);
|
|
2467
|
+
if (skillName === null) return { ...message2, type: "tool_call" };
|
|
2480
2468
|
return {
|
|
2481
|
-
id:
|
|
2469
|
+
id: message2.id,
|
|
2482
2470
|
type: "skill",
|
|
2483
2471
|
skillName,
|
|
2484
|
-
|
|
2485
|
-
|
|
2472
|
+
...path ? { path } : {},
|
|
2473
|
+
status: message2.status,
|
|
2474
|
+
timestamp: message2.timestamp
|
|
2486
2475
|
};
|
|
2487
2476
|
}
|
|
2488
|
-
function insertDisplayMessageByTimestamp(messages,
|
|
2489
|
-
const messageMs = parseTimestampMs(
|
|
2477
|
+
function insertDisplayMessageByTimestamp(messages, message2) {
|
|
2478
|
+
const messageMs = parseTimestampMs(message2.timestamp);
|
|
2490
2479
|
let index = messages.length;
|
|
2491
2480
|
while (index > 0 && parseTimestampMs(messages[index - 1].timestamp) > messageMs) index--;
|
|
2492
|
-
messages.splice(index, 0,
|
|
2481
|
+
messages.splice(index, 0, message2);
|
|
2493
2482
|
}
|
|
2494
2483
|
|
|
2495
2484
|
// ../shared/src/display-message/format.ts
|
|
2496
|
-
function planItemsFromMessage(
|
|
2497
|
-
if (
|
|
2498
|
-
return
|
|
2485
|
+
function planItemsFromMessage(message2) {
|
|
2486
|
+
if (message2.type === "todo_list") {
|
|
2487
|
+
return message2.items.map((item) => ({ text: item.text, status: todoItemStatus(item) }));
|
|
2499
2488
|
}
|
|
2500
|
-
if (
|
|
2501
|
-
const input = typeof
|
|
2489
|
+
if (message2.type !== "tool_call" || message2.tool !== "TodoWrite" && message2.tool !== "write_todos") return null;
|
|
2490
|
+
const input = typeof message2.input === "object" ? message2.input : null;
|
|
2502
2491
|
const todos = Array.isArray(input?.todos) ? input.todos : null;
|
|
2503
2492
|
if (!todos) return null;
|
|
2504
2493
|
return todos.flatMap((todo) => {
|
|
@@ -2512,34 +2501,34 @@ function planItemsFromMessage(message) {
|
|
|
2512
2501
|
function todoItemStatus(item) {
|
|
2513
2502
|
return item.itemStatus ?? (item.completed ? "completed" : "pending");
|
|
2514
2503
|
}
|
|
2515
|
-
function getDisplayMessageActivity(
|
|
2516
|
-
if (
|
|
2517
|
-
if (
|
|
2518
|
-
if (
|
|
2519
|
-
const operations =
|
|
2504
|
+
function getDisplayMessageActivity(message2) {
|
|
2505
|
+
if (message2.type === "user" || message2.type === "agent" || message2.type === "reasoning") return null;
|
|
2506
|
+
if (message2.type === "command") return { kind: "command", title: "Command", summary: message2.command, content: message2.output ?? "" };
|
|
2507
|
+
if (message2.type === "patch") {
|
|
2508
|
+
const operations = message2.operations.map((operation) => `${operation.action.toUpperCase()} ${operation.path}${operation.moveTo ? ` \u2192 ${operation.moveTo}` : ""}${operation.diff ? `
|
|
2520
2509
|
${operation.diff}` : ""}`).join("\n\n");
|
|
2521
|
-
return { kind: "file", title: "Apply patch", summary:
|
|
2510
|
+
return { kind: "file", title: "Apply patch", summary: message2.operations.map((operation) => operation.path).join(", "), content: [operations, message2.output].filter(Boolean).join("\n\n") };
|
|
2522
2511
|
}
|
|
2523
|
-
if (
|
|
2524
|
-
if (
|
|
2525
|
-
if (
|
|
2526
|
-
if (
|
|
2527
|
-
const items = planItemsFromMessage(
|
|
2512
|
+
if (message2.type === "file_change") return { kind: "file", title: "File changes", summary: message2.changes.map((change) => change.path).join(", "), content: message2.changes.map((change) => `${change.kind.toUpperCase()} ${change.path}`).join("\n") };
|
|
2513
|
+
if (message2.type === "tool_call") return { kind: "tool", title: `Tool \xB7 ${message2.tool}`, summary: message2.server, content: [stringifyDisplayValue(message2.input), message2.output].filter(Boolean).join("\n\n") };
|
|
2514
|
+
if (message2.type === "web_search") return { kind: "search", title: "Web search", summary: message2.query, content: "" };
|
|
2515
|
+
if (message2.type === "todo_list") {
|
|
2516
|
+
const items = planItemsFromMessage(message2) ?? [];
|
|
2528
2517
|
return { kind: "plan", title: "Plan", summary: `${items.filter((item) => item.status === "completed").length}/${items.length}`, content: "", items };
|
|
2529
2518
|
}
|
|
2530
|
-
if (
|
|
2531
|
-
if (
|
|
2532
|
-
if (
|
|
2533
|
-
if (
|
|
2534
|
-
const rateLimited =
|
|
2535
|
-
return { kind: "error", title: rateLimited ? "Codex rate limit" : "Codex credits", summary: "", content: rateLimited ? `Codex hit a rate limit${
|
|
2519
|
+
if (message2.type === "subagent") return { kind: "task", title: "Subagent", summary: message2.description, content: [message2.prompt, message2.model ? `Model: ${message2.model}` : "", message2.receiverThreadIds?.length ? `Threads: ${message2.receiverThreadIds.join(", ")}` : "", message2.output].filter(Boolean).join("\n\n") };
|
|
2520
|
+
if (message2.type === "background_task") return { kind: "task", title: message2.description ?? message2.summary ?? "Background task", summary: message2.taskType ?? "", content: [message2.prompt, message2.outputFile, message2.error].filter(Boolean).join("\n\n") };
|
|
2521
|
+
if (message2.type === "skill") return { kind: "tool", title: `Skill \xB7 ${message2.skillName}`, summary: message2.args ?? "", content: "" };
|
|
2522
|
+
if (message2.type === "quota_status") {
|
|
2523
|
+
const rateLimited = message2.state === "rate_limited";
|
|
2524
|
+
return { kind: "error", title: rateLimited ? "Codex rate limit" : "Codex credits", summary: "", content: rateLimited ? `Codex hit a rate limit${message2.rateLimitResetType ? ` (${message2.rateLimitResetType})` : ""} \u2014 try again after reset.` : "Codex is out of credits \u2014 top up your OpenAI account to resume." };
|
|
2536
2525
|
}
|
|
2537
|
-
if (
|
|
2538
|
-
const { headline, outcomeClause } = describeAuthFallback(
|
|
2539
|
-
return { kind: "error", title: "Credential fallback", summary: headline, content: [`The workspace ${outcomeClause}.`,
|
|
2526
|
+
if (message2.type === "auth_fallback") {
|
|
2527
|
+
const { headline, outcomeClause } = describeAuthFallback(message2);
|
|
2528
|
+
return { kind: "error", title: "Credential fallback", summary: headline, content: [`The workspace ${outcomeClause}.`, message2.detail].filter(Boolean).join("\n\n") };
|
|
2540
2529
|
}
|
|
2541
|
-
if (
|
|
2542
|
-
return { kind: "error", title: "Agent error", summary: "", content:
|
|
2530
|
+
if (message2.type === "interruption") return { kind: "error", title: "Agent stopped", summary: "", content: "" };
|
|
2531
|
+
return { kind: "error", title: "Agent error", summary: "", content: message2.message };
|
|
2543
2532
|
}
|
|
2544
2533
|
function fileContentDiff(path, content, action) {
|
|
2545
2534
|
const lines = content.replace(/\n$/, "").split("\n");
|
|
@@ -2550,29 +2539,96 @@ function fileContentDiff(path, content, action) {
|
|
|
2550
2539
|
...lines.map((line) => `${action === "add" ? "+" : "-"}${line}`)
|
|
2551
2540
|
].join("\n");
|
|
2552
2541
|
}
|
|
2542
|
+
var SEARCH_COMMANDS = /* @__PURE__ */ new Set(["grep", "rg"]);
|
|
2543
|
+
var OPTION_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
2544
|
+
"-A",
|
|
2545
|
+
"-B",
|
|
2546
|
+
"-C",
|
|
2547
|
+
"-e",
|
|
2548
|
+
"-f",
|
|
2549
|
+
"-m",
|
|
2550
|
+
"--after-context",
|
|
2551
|
+
"--before-context",
|
|
2552
|
+
"--context",
|
|
2553
|
+
"--glob",
|
|
2554
|
+
"--max-count",
|
|
2555
|
+
"--regexp"
|
|
2556
|
+
]);
|
|
2557
|
+
var LINE_COUNT_VALUE_FLAGS = /* @__PURE__ */ new Set([
|
|
2558
|
+
"-c",
|
|
2559
|
+
"-n",
|
|
2560
|
+
"--lines"
|
|
2561
|
+
]);
|
|
2553
2562
|
var SCRIPT_ROOT = "/";
|
|
2554
2563
|
var commandName = (argv) => argv[0].split("/").pop() ?? argv[0];
|
|
2555
2564
|
var fileWrites = ({ writes }) => writes.filter(({ path }) => path !== "/dev/null");
|
|
2556
2565
|
function shellCommands(command) {
|
|
2557
2566
|
return parseShellScript(command, SCRIPT_ROOT).filter(({ wrapper }) => !wrapper);
|
|
2558
2567
|
}
|
|
2559
|
-
|
|
2560
|
-
const commands = shellCommands(command);
|
|
2561
|
-
const hasRedirectOrSubshell = commands.some((shellCommand) => shellCommand.subshell || shellCommand.stdinFile !== null || !shellCommand.piped && shellCommand.stdin !== void 0 || fileWrites(shellCommand).length > 0);
|
|
2562
|
-
if (commands.length === 0 || hasRedirectOrSubshell) return null;
|
|
2563
|
-
return commands.map((shellCommand) => {
|
|
2564
|
-
const argv = shellCommand.argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026"));
|
|
2565
|
-
return { ...shellCommand, argv, name: commandName(argv) };
|
|
2566
|
-
});
|
|
2567
|
-
}
|
|
2568
|
+
var SKILL_READ_COMMANDS = /* @__PURE__ */ new Set(["awk", "bat", "cat", "head", "less", "more", "nl", "sed", "tail"]);
|
|
2568
2569
|
function skillNamesFromCommand(command) {
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2570
|
+
return Array.from(new Set(shellCommands(command).flatMap((shellCommand) => {
|
|
2571
|
+
const argv = shellCommand.argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026"));
|
|
2572
|
+
const name = argv[0] ? commandName(argv) : "";
|
|
2573
|
+
if (!SKILL_READ_COMMANDS.has(name) || writesFiles(name, argv) || fileWrites(shellCommand).length > 0) return [];
|
|
2574
|
+
const paths = readCommandPaths(name, argv);
|
|
2575
|
+
const stdinTarget = shellCommand.stdinTarget?.replaceAll(SHELL_OPAQUE, "\u2026");
|
|
2576
|
+
return (paths.length === 0 && stdinTarget ? [stdinTarget] : paths).flatMap((path) => {
|
|
2577
|
+
const resolved = path.startsWith("~") ? path : resolveShellPath(shellCommand.dir, path)?.replace(SCRIPT_ROOT, "");
|
|
2578
|
+
const skillName = resolved && skillNameFromFilePath(resolved);
|
|
2579
|
+
return skillName ? [skillName] : [];
|
|
2580
|
+
});
|
|
2574
2581
|
})));
|
|
2575
2582
|
}
|
|
2583
|
+
function pathArgs(words, extraValueFlags) {
|
|
2584
|
+
const paths = [];
|
|
2585
|
+
for (let i = 0; i < words.length; i++) {
|
|
2586
|
+
const word = words[i];
|
|
2587
|
+
if (OPTION_VALUE_FLAGS.has(word) || extraValueFlags?.has(word)) {
|
|
2588
|
+
i++;
|
|
2589
|
+
continue;
|
|
2590
|
+
}
|
|
2591
|
+
if (word.startsWith("--glob=") || word.startsWith("--regexp=")) continue;
|
|
2592
|
+
if (word.startsWith("-")) continue;
|
|
2593
|
+
paths.push(word);
|
|
2594
|
+
}
|
|
2595
|
+
return Array.from(new Set(paths));
|
|
2596
|
+
}
|
|
2597
|
+
function readCommandPaths(command, words) {
|
|
2598
|
+
if (SEARCH_COMMANDS.has(command)) {
|
|
2599
|
+
const args = pathArgs(words.slice(1));
|
|
2600
|
+
return args.slice(1);
|
|
2601
|
+
}
|
|
2602
|
+
if (command === "sed") {
|
|
2603
|
+
const paths = [];
|
|
2604
|
+
let sawScript = false;
|
|
2605
|
+
for (let i = 1; i < words.length; i++) {
|
|
2606
|
+
const word = words[i];
|
|
2607
|
+
if (word === "-n" || word.startsWith("-n")) continue;
|
|
2608
|
+
if (word === "-e" || word === "-f" || word === "--expression" || word === "--file") {
|
|
2609
|
+
i++;
|
|
2610
|
+
sawScript = true;
|
|
2611
|
+
continue;
|
|
2612
|
+
}
|
|
2613
|
+
if (word.startsWith("--expression=") || word.startsWith("--file=")) {
|
|
2614
|
+
sawScript = true;
|
|
2615
|
+
continue;
|
|
2616
|
+
}
|
|
2617
|
+
if (word.startsWith("-")) continue;
|
|
2618
|
+
if (!sawScript) {
|
|
2619
|
+
sawScript = true;
|
|
2620
|
+
continue;
|
|
2621
|
+
}
|
|
2622
|
+
paths.push(word);
|
|
2623
|
+
}
|
|
2624
|
+
return Array.from(new Set(paths));
|
|
2625
|
+
}
|
|
2626
|
+
return pathArgs(words.slice(1), command === "head" || command === "tail" ? LINE_COUNT_VALUE_FLAGS : void 0);
|
|
2627
|
+
}
|
|
2628
|
+
function writesFiles(name, argv) {
|
|
2629
|
+
if (name === "sed") return argv.some((word) => /^(-[a-zA-Z]*i|--in-place)/.test(word));
|
|
2630
|
+
return name === "find" && argv.some((word) => /^-(exec|ok|delete|fprint|fls)/.test(word));
|
|
2631
|
+
}
|
|
2576
2632
|
|
|
2577
2633
|
// ../shared/src/user-message-matching.ts
|
|
2578
2634
|
function parseTimestampMs(timestamp) {
|
|
@@ -2672,16 +2728,16 @@ function decodePathSegments(segments) {
|
|
|
2672
2728
|
}
|
|
2673
2729
|
});
|
|
2674
2730
|
}
|
|
2675
|
-
function buildCodeHostPrUrl(repoUrl,
|
|
2731
|
+
function buildCodeHostPrUrl(repoUrl, provider2, prNumber) {
|
|
2676
2732
|
const normalizedRepoUrl = repoUrl.replace(/\.git$/, "");
|
|
2677
|
-
if (
|
|
2733
|
+
if (provider2 === "gitlab") {
|
|
2678
2734
|
return `${normalizedRepoUrl}/-/merge_requests/${prNumber}`;
|
|
2679
2735
|
}
|
|
2680
2736
|
return `${normalizedRepoUrl}/pull/${prNumber}`;
|
|
2681
2737
|
}
|
|
2682
2738
|
|
|
2683
2739
|
// ../shared/src/replicas-mcp.ts
|
|
2684
|
-
import { z as
|
|
2740
|
+
import { z as z14 } from "zod";
|
|
2685
2741
|
|
|
2686
2742
|
// ../shared/src/automations/trigger-schemas.ts
|
|
2687
2743
|
import { z as z10 } from "zod";
|
|
@@ -2711,32 +2767,22 @@ var automationTriggerSchema = z10.discriminatedUnion("type", [
|
|
|
2711
2767
|
z10.object({ type: z10.literal("custom"), config: z10.object({}) })
|
|
2712
2768
|
]);
|
|
2713
2769
|
|
|
2714
|
-
// ../shared/src/
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2724
|
-
|
|
2725
|
-
spawnSubagent: "spawn_subagent",
|
|
2726
|
-
messageSubagent: "message_subagent",
|
|
2727
|
-
listSubagents: "list_subagents",
|
|
2728
|
-
readSubagent: "read_subagent",
|
|
2729
|
-
archiveSubagent: "archive_subagent"
|
|
2730
|
-
};
|
|
2731
|
-
var automationToolInputSchema = z11.object({
|
|
2732
|
-
name: z11.string().describe("Short automation name."),
|
|
2733
|
-
prompt: z11.string().describe("Prompt each automation run starts with."),
|
|
2734
|
-
environment_id: z11.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
2735
|
-
triggers: z11.array(automationTriggerSchema).min(1).describe(
|
|
2736
|
-
'One or more triggers. Cron: `{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }`. GitHub: `{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }`.'
|
|
2737
|
-
),
|
|
2738
|
-
description: z11.string().optional().describe("One-line summary shown in the dashboard.")
|
|
2770
|
+
// ../shared/src/routes/environment.ts
|
|
2771
|
+
import { z as z11 } from "zod";
|
|
2772
|
+
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
2773
|
+
var stringMap = z11.record(z11.string(), z11.string());
|
|
2774
|
+
var createEnvironmentMcpRequestSchema = z11.object({
|
|
2775
|
+
name: z11.string(),
|
|
2776
|
+
transport: z11.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
2777
|
+
config: z11.union([
|
|
2778
|
+
z11.object({ command: z11.string().min(1), args: z11.array(z11.string()).optional(), env: stringMap.optional() }),
|
|
2779
|
+
z11.object({ url: z11.url(), headers: stringMap.optional(), auth: mcpWorkloadAuthSchema.optional() })
|
|
2780
|
+
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
2739
2781
|
});
|
|
2782
|
+
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
2783
|
+
|
|
2784
|
+
// ../shared/src/routes/workspaces.ts
|
|
2785
|
+
import { z as z13 } from "zod";
|
|
2740
2786
|
|
|
2741
2787
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
2742
2788
|
var SECTION = `### Computer use (Linux desktop control)
|
|
@@ -4883,6 +4929,100 @@ var REPLICAS_AGENT_ABILITIES = Object.keys(
|
|
|
4883
4929
|
REPLICAS_AGENT_ABILITY_REGISTRY
|
|
4884
4930
|
);
|
|
4885
4931
|
|
|
4932
|
+
// ../shared/src/routes/workspaces.ts
|
|
4933
|
+
var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
|
|
4934
|
+
var STALE_PREPARING_MS = 10 * 6e4;
|
|
4935
|
+
var VALID_LIFECYCLE_POLICIES = ["default", "archive_when_done", "sleep_when_done", "delete_after_inactivity"];
|
|
4936
|
+
var WORKSPACE_STATUS_FILTERS = WORKSPACE_STATUSES.map((status) => status === "error" ? "failed" : status);
|
|
4937
|
+
var WORKSPACE_SORT_CHOICES = [
|
|
4938
|
+
["manual", "Custom"],
|
|
4939
|
+
["activity", "Last activity"],
|
|
4940
|
+
["created", "Created date"]
|
|
4941
|
+
];
|
|
4942
|
+
var WORKSPACE_SORT_OPTIONS = WORKSPACE_SORT_CHOICES.map(([option]) => option);
|
|
4943
|
+
var WORKSPACE_SORT_LABELS = Object.fromEntries(WORKSPACE_SORT_CHOICES);
|
|
4944
|
+
var WORKSPACE_SIDEBAR_ORGANIZATION_CHOICES = [
|
|
4945
|
+
["chronological", "Chronological"],
|
|
4946
|
+
["environments", "Environments"],
|
|
4947
|
+
["recent", "Recent environments"]
|
|
4948
|
+
];
|
|
4949
|
+
var WORKSPACE_SIDEBAR_ORGANIZATIONS = WORKSPACE_SIDEBAR_ORGANIZATION_CHOICES.map(([organization]) => organization);
|
|
4950
|
+
var WORKSPACE_SIDEBAR_ORGANIZATION_LABELS = Object.fromEntries(WORKSPACE_SIDEBAR_ORGANIZATION_CHOICES);
|
|
4951
|
+
var DEFAULT_STATUS_FILTERS = [...WORKSPACE_STATUS_FILTERS];
|
|
4952
|
+
var DEFAULT_WORKSPACE_FILTERS = {
|
|
4953
|
+
statuses: [...DEFAULT_STATUS_FILTERS],
|
|
4954
|
+
ownerIds: [],
|
|
4955
|
+
activity: "any"
|
|
4956
|
+
};
|
|
4957
|
+
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
4958
|
+
var workspaceExecRequestSchema = z13.object({
|
|
4959
|
+
command: z13.string().regex(/\S/, "command is required"),
|
|
4960
|
+
timeout_seconds: z13.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
4961
|
+
});
|
|
4962
|
+
var terminalRtcCandidateSchema = z13.object({ type: z13.literal("rtc-candidate"), candidate: z13.string(), mid: z13.string() });
|
|
4963
|
+
var terminalSocketServerMessageSchema = z13.discriminatedUnion("type", [
|
|
4964
|
+
z13.object({ type: z13.literal("output"), data: z13.string() }),
|
|
4965
|
+
z13.object({ type: z13.literal("rtc-answer"), sdp: z13.string() }),
|
|
4966
|
+
terminalRtcCandidateSchema,
|
|
4967
|
+
z13.object({ type: z13.literal("rtc-switch") })
|
|
4968
|
+
]);
|
|
4969
|
+
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
4970
|
+
|
|
4971
|
+
// ../shared/src/replicas-mcp.ts
|
|
4972
|
+
var REPLICAS_MCP_TOOLS = {
|
|
4973
|
+
listEnvironments: "list_environments",
|
|
4974
|
+
createAutomation: "create_automation",
|
|
4975
|
+
spawn: "spawn_workspace",
|
|
4976
|
+
relay: "relay_to_workspace",
|
|
4977
|
+
linearStart: "start_linear_session",
|
|
4978
|
+
linearSessionIntent: "register_linear_session_intent",
|
|
4979
|
+
listChannelSettings: "list_channel_settings",
|
|
4980
|
+
saveChannelPreset: "save_channel_preset",
|
|
4981
|
+
updateChannelSettings: "update_channel_settings",
|
|
4982
|
+
spawnSubagent: "spawn_subagent",
|
|
4983
|
+
messageSubagent: "message_subagent",
|
|
4984
|
+
listSubagents: "list_subagents",
|
|
4985
|
+
readSubagent: "read_subagent",
|
|
4986
|
+
archiveSubagent: "archive_subagent"
|
|
4987
|
+
};
|
|
4988
|
+
var automationToolInputSchema = z14.object({
|
|
4989
|
+
name: z14.string().describe("Short automation name."),
|
|
4990
|
+
prompt: z14.string().describe("Prompt each automation run starts with."),
|
|
4991
|
+
environment_id: z14.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
4992
|
+
triggers: z14.array(automationTriggerSchema).min(1).describe(
|
|
4993
|
+
'One or more triggers. Cron: `{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }`. GitHub: `{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }`.'
|
|
4994
|
+
),
|
|
4995
|
+
description: z14.string().optional().describe("One-line summary shown in the dashboard."),
|
|
4996
|
+
plan_mode: z14.boolean().optional(),
|
|
4997
|
+
goal_mode: z14.boolean().optional(),
|
|
4998
|
+
fast_mode: z14.boolean().optional()
|
|
4999
|
+
});
|
|
5000
|
+
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
5001
|
+
scope: z14.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
5002
|
+
});
|
|
5003
|
+
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
5004
|
+
automation_id: z14.string().describe("Automation ID"),
|
|
5005
|
+
enabled: z14.boolean().optional(),
|
|
5006
|
+
agent_provider: z14.enum(AGENT).nullable().optional(),
|
|
5007
|
+
model: z14.string().nullable().optional(),
|
|
5008
|
+
thinking_level: z14.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
5009
|
+
workspace_lifecycle_policy: z14.enum(VALID_LIFECYCLE_POLICIES).optional(),
|
|
5010
|
+
workspace_size: z14.enum(WORKSPACE_SIZES).optional()
|
|
5011
|
+
});
|
|
5012
|
+
var chatPath = { id: z14.string().describe("Workspace ID"), chat_id: z14.string().describe("Chat ID") };
|
|
5013
|
+
var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
|
|
5014
|
+
var createChatToolInputSchema = z14.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
|
|
5015
|
+
var forkChatToolInputSchema = z14.object({ ...chatPath, provider, model, thinkingLevel, title, message });
|
|
5016
|
+
var renameChatToolInputSchema = z14.object({ ...chatPath, ...updateChatDisplayNameRequestSchema.shape });
|
|
5017
|
+
var runCommandToolInputSchema = z14.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
|
|
5018
|
+
var environmentMcpPath = { environment_id: z14.string().describe("Environment ID") };
|
|
5019
|
+
var createEnvironmentMcpToolInputSchema = z14.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
|
|
5020
|
+
var updateEnvironmentMcpToolInputSchema = z14.object({
|
|
5021
|
+
...environmentMcpPath,
|
|
5022
|
+
mcp_id: z14.string().describe("MCP ID"),
|
|
5023
|
+
...updateEnvironmentMcpRequestSchema.shape
|
|
5024
|
+
});
|
|
5025
|
+
|
|
4886
5026
|
// ../shared/src/routes/preferences.ts
|
|
4887
5027
|
var EMPTY_AGENT_DEFAULT_SETTINGS = {
|
|
4888
5028
|
agent_provider: null,
|
|
@@ -5029,8 +5169,8 @@ function messagesForCodexTurn(turn) {
|
|
|
5029
5169
|
coalesced.splice(responseIndex, 0, ...coalesced.splice(reasoningIndex, 1));
|
|
5030
5170
|
}
|
|
5031
5171
|
const messages = coalesced.flatMap((item) => {
|
|
5032
|
-
const
|
|
5033
|
-
return [...
|
|
5172
|
+
const message2 = messageForItem(item);
|
|
5173
|
+
return [...message2 ? [message2] : [], ...skillMessagesForItem(item)];
|
|
5034
5174
|
});
|
|
5035
5175
|
if (turn.error) {
|
|
5036
5176
|
messages.push({
|
|
@@ -5307,11 +5447,11 @@ function parseCodexEvents(events) {
|
|
|
5307
5447
|
return;
|
|
5308
5448
|
}
|
|
5309
5449
|
if (event.type === "event_msg" && event.payload?.type === "user_message") {
|
|
5310
|
-
const
|
|
5450
|
+
const message2 = getPayloadString(event, "message");
|
|
5311
5451
|
messages.push({
|
|
5312
5452
|
id: displayId(event, eventIndex, "user"),
|
|
5313
5453
|
type: "user",
|
|
5314
|
-
content:
|
|
5454
|
+
content: message2 ?? "",
|
|
5315
5455
|
images: userMessageImages(event.payload.images),
|
|
5316
5456
|
timestamp: event.timestamp
|
|
5317
5457
|
});
|
|
@@ -5447,34 +5587,34 @@ function parseCodexEvents(events) {
|
|
|
5447
5587
|
}
|
|
5448
5588
|
});
|
|
5449
5589
|
const recordedPrompts = /* @__PURE__ */ new Map();
|
|
5450
|
-
messages.forEach((
|
|
5451
|
-
if (
|
|
5452
|
-
const prompts = recordedPrompts.get(
|
|
5453
|
-
prompts.push({ message, index, timestampMs: parseTimestampMs(
|
|
5454
|
-
recordedPrompts.set(
|
|
5590
|
+
messages.forEach((message2, index) => {
|
|
5591
|
+
if (message2.type !== "user") return;
|
|
5592
|
+
const prompts = recordedPrompts.get(message2.content) ?? [];
|
|
5593
|
+
prompts.push({ message: message2, index, timestampMs: parseTimestampMs(message2.timestamp) });
|
|
5594
|
+
recordedPrompts.set(message2.content, prompts);
|
|
5455
5595
|
});
|
|
5456
5596
|
const claimedPrompts = /* @__PURE__ */ new Set();
|
|
5457
5597
|
for (const { index, turnId } of turnInsertions.reverse()) {
|
|
5458
5598
|
const turn = turns.get(turnId);
|
|
5459
5599
|
if (!turn) continue;
|
|
5460
5600
|
const kept = [];
|
|
5461
|
-
for (const
|
|
5462
|
-
if (
|
|
5463
|
-
kept.push(
|
|
5601
|
+
for (const message2 of messagesForCodexTurn(turn)) {
|
|
5602
|
+
if (message2.type !== "user") {
|
|
5603
|
+
kept.push(message2);
|
|
5464
5604
|
continue;
|
|
5465
5605
|
}
|
|
5466
|
-
const prompts = recordedPrompts.get(
|
|
5467
|
-
const recorded = prompts && takeRecordedPrompt(prompts,
|
|
5606
|
+
const prompts = recordedPrompts.get(message2.content);
|
|
5607
|
+
const recorded = prompts && takeRecordedPrompt(prompts, message2, index);
|
|
5468
5608
|
if (!recorded) {
|
|
5469
|
-
kept.push(
|
|
5609
|
+
kept.push(message2);
|
|
5470
5610
|
continue;
|
|
5471
5611
|
}
|
|
5472
5612
|
claimedPrompts.add(recorded);
|
|
5473
|
-
kept.push({ ...recorded, images: recorded.images ??
|
|
5613
|
+
kept.push({ ...recorded, images: recorded.images ?? message2.images });
|
|
5474
5614
|
}
|
|
5475
5615
|
messages.splice(index, 0, ...kept);
|
|
5476
5616
|
}
|
|
5477
|
-
return messages.filter((
|
|
5617
|
+
return messages.filter((message2) => !claimedPrompts.has(message2));
|
|
5478
5618
|
}
|
|
5479
5619
|
|
|
5480
5620
|
// ../shared/src/display-message/parsers/cursor-parser.ts
|
|
@@ -5490,24 +5630,24 @@ function cursorRunId(event) {
|
|
|
5490
5630
|
return typeof runId === "string" ? runId : "unknown-run";
|
|
5491
5631
|
}
|
|
5492
5632
|
function getCursorAssistantText(event) {
|
|
5493
|
-
const
|
|
5494
|
-
return getTextContent(
|
|
5633
|
+
const message2 = isRecord(event.payload.message) ? event.payload.message : null;
|
|
5634
|
+
return getTextContent(message2?.content);
|
|
5495
5635
|
}
|
|
5496
5636
|
function getCursorThinkingText(event) {
|
|
5497
5637
|
const text2 = event.payload.text;
|
|
5498
5638
|
if (typeof text2 === "string") return text2;
|
|
5499
|
-
const
|
|
5500
|
-
return typeof
|
|
5639
|
+
const message2 = isRecord(event.payload.message) ? event.payload.message : null;
|
|
5640
|
+
return typeof message2?.text === "string" ? message2.text : "";
|
|
5501
5641
|
}
|
|
5502
5642
|
function isTerminalStatus(status) {
|
|
5503
5643
|
return status === "FINISHED" || status === "ERROR" || status === "CANCELLED" || status === "EXPIRED";
|
|
5504
5644
|
}
|
|
5505
5645
|
function finalizeOpenCalls(messages, callIndexes, status) {
|
|
5506
5646
|
for (const index of callIndexes.values()) {
|
|
5507
|
-
const
|
|
5508
|
-
if ((
|
|
5647
|
+
const message2 = messages[index];
|
|
5648
|
+
if ((message2?.type === "tool_call" || message2?.type === "skill") && message2.status === "in_progress") {
|
|
5509
5649
|
messages[index] = {
|
|
5510
|
-
...
|
|
5650
|
+
...message2,
|
|
5511
5651
|
status
|
|
5512
5652
|
};
|
|
5513
5653
|
}
|
|
@@ -5522,10 +5662,10 @@ function parseCursorEvents(events) {
|
|
|
5522
5662
|
let activeThinking = null;
|
|
5523
5663
|
const finalizeActiveThinking = (status) => {
|
|
5524
5664
|
if (!activeThinking) return;
|
|
5525
|
-
const
|
|
5526
|
-
if (
|
|
5665
|
+
const message2 = messages[activeThinking.index];
|
|
5666
|
+
if (message2?.type === "reasoning") {
|
|
5527
5667
|
messages[activeThinking.index] = {
|
|
5528
|
-
...
|
|
5668
|
+
...message2,
|
|
5529
5669
|
status
|
|
5530
5670
|
};
|
|
5531
5671
|
}
|
|
@@ -5534,12 +5674,12 @@ function parseCursorEvents(events) {
|
|
|
5534
5674
|
if (event.type === "event_msg" && event.payload.type === "user_message") {
|
|
5535
5675
|
activeAssistant = null;
|
|
5536
5676
|
activeThinking = null;
|
|
5537
|
-
const
|
|
5538
|
-
if (typeof
|
|
5677
|
+
const message2 = event.payload.message;
|
|
5678
|
+
if (typeof message2 === "string" && message2.trim()) {
|
|
5539
5679
|
messages.push({
|
|
5540
5680
|
id: getUserMessageId(event) ?? `cursor-user-${event.timestamp}-${messages.length}`,
|
|
5541
5681
|
type: "user",
|
|
5542
|
-
content:
|
|
5682
|
+
content: message2,
|
|
5543
5683
|
timestamp: event.timestamp
|
|
5544
5684
|
});
|
|
5545
5685
|
}
|
|
@@ -5562,11 +5702,11 @@ function parseCursorEvents(events) {
|
|
|
5562
5702
|
}) - 1
|
|
5563
5703
|
};
|
|
5564
5704
|
}
|
|
5565
|
-
const
|
|
5566
|
-
if (
|
|
5705
|
+
const message2 = messages[activeAssistant.index];
|
|
5706
|
+
if (message2?.type === "agent") {
|
|
5567
5707
|
messages[activeAssistant.index] = {
|
|
5568
|
-
...
|
|
5569
|
-
content: `${
|
|
5708
|
+
...message2,
|
|
5709
|
+
content: `${message2.content}${text2}`
|
|
5570
5710
|
};
|
|
5571
5711
|
}
|
|
5572
5712
|
}
|
|
@@ -5590,11 +5730,11 @@ function parseCursorEvents(events) {
|
|
|
5590
5730
|
}) - 1
|
|
5591
5731
|
};
|
|
5592
5732
|
}
|
|
5593
|
-
const
|
|
5594
|
-
if (
|
|
5733
|
+
const message2 = messages[activeThinking.index];
|
|
5734
|
+
if (message2?.type === "reasoning") {
|
|
5595
5735
|
messages[activeThinking.index] = {
|
|
5596
|
-
...
|
|
5597
|
-
content: `${
|
|
5736
|
+
...message2,
|
|
5737
|
+
content: `${message2.content}${text2}`,
|
|
5598
5738
|
status: "in_progress"
|
|
5599
5739
|
};
|
|
5600
5740
|
}
|
|
@@ -5653,11 +5793,11 @@ function parseCursorEvents(events) {
|
|
|
5653
5793
|
finalizeOpenCalls(messages, callIndexes, "failed");
|
|
5654
5794
|
activeAssistant = null;
|
|
5655
5795
|
activeThinking = null;
|
|
5656
|
-
const
|
|
5796
|
+
const message2 = typeof event.payload.message === "string" ? event.payload.message : "Cursor run failed";
|
|
5657
5797
|
messages.push({
|
|
5658
5798
|
id: `cursor-error-${event.timestamp}-${messages.length}`,
|
|
5659
5799
|
type: "error",
|
|
5660
|
-
message,
|
|
5800
|
+
message: message2,
|
|
5661
5801
|
timestamp: event.timestamp
|
|
5662
5802
|
});
|
|
5663
5803
|
}
|
|
@@ -5739,16 +5879,16 @@ var TRANSIENT_HTTP_STATUSES = [408, 429, 500, 502, 503, 504, 529];
|
|
|
5739
5879
|
var SERVER_ERROR_TEXT_PATTERN = /internal ?server ?error|server ?error|service unavailable|bad gateway|gateway timeout|overloaded|too many requests/i;
|
|
5740
5880
|
var INFERENCE_ERROR_DETAIL_MAX = 600;
|
|
5741
5881
|
var INFERENCE_ERROR_RETRY_HINT = "This is usually temporary \u2014 retry the message.";
|
|
5742
|
-
function formatInferenceError(
|
|
5882
|
+
function formatInferenceError(message2, context = {}) {
|
|
5743
5883
|
const label = context.provider ? INFERENCE_PROVIDER_LABELS[context.provider] ?? context.provider : null;
|
|
5744
5884
|
const source = label ? `${label}${context.model ? ` (${context.model})` : ""} request failed${typeof context.status === "number" ? ` with HTTP ${context.status}` : ""}` : null;
|
|
5745
|
-
let body = source ?
|
|
5885
|
+
let body = source ? message2 ? `${source}: ${message2}` : `${source}.` : message2;
|
|
5746
5886
|
const detail = context.detail?.trim();
|
|
5747
5887
|
if (detail && !body.includes(detail)) {
|
|
5748
5888
|
body = `${body}
|
|
5749
5889
|
${detail.length > INFERENCE_ERROR_DETAIL_MAX ? `${detail.slice(0, INFERENCE_ERROR_DETAIL_MAX)}\u2026` : detail}`;
|
|
5750
5890
|
}
|
|
5751
|
-
const sniffText = `${
|
|
5891
|
+
const sniffText = `${message2}
|
|
5752
5892
|
${detail ?? ""}`;
|
|
5753
5893
|
const transient = context.retryable ?? (typeof context.status === "number" ? TRANSIENT_HTTP_STATUSES.includes(context.status) || context.status >= 500 : isTransientErrorText(sniffText, { httpStatuses: TRANSIENT_HTTP_STATUSES, includeRateLimit: true }) || SERVER_ERROR_TEXT_PATTERN.test(sniffText));
|
|
5754
5894
|
return transient ? `${body}
|
|
@@ -5768,9 +5908,9 @@ function toolStatus(status) {
|
|
|
5768
5908
|
function assistantError(info) {
|
|
5769
5909
|
if (!isRecord(info) || !isRecord(info.error)) return null;
|
|
5770
5910
|
const data = isRecord(info.error.data) ? info.error.data : null;
|
|
5771
|
-
const
|
|
5772
|
-
if (info.error.name === "MessageAbortedError") return
|
|
5773
|
-
return formatInferenceError(
|
|
5911
|
+
const message2 = typeof data?.message === "string" ? data.message : typeof info.error.message === "string" ? info.error.message : stringifyDisplayValue(info.error) ?? "Opencode run failed";
|
|
5912
|
+
if (info.error.name === "MessageAbortedError") return message2;
|
|
5913
|
+
return formatInferenceError(message2, {
|
|
5774
5914
|
...typeof info.providerID === "string" ? { provider: info.providerID } : {},
|
|
5775
5915
|
...typeof info.modelID === "string" ? { model: info.modelID } : {},
|
|
5776
5916
|
...typeof data?.statusCode === "number" ? { status: data.statusCode } : {},
|
|
@@ -5782,13 +5922,13 @@ function parseOpencodeEvents(events) {
|
|
|
5782
5922
|
const messages = [];
|
|
5783
5923
|
for (const event of events) {
|
|
5784
5924
|
if (event.type === "event_msg" && event.payload.type === "user_message") {
|
|
5785
|
-
const
|
|
5786
|
-
if (typeof
|
|
5925
|
+
const message2 = event.payload.message;
|
|
5926
|
+
if (typeof message2 === "string" && message2.trim()) {
|
|
5787
5927
|
const messageId = event.payload[USER_MESSAGE_ID_PAYLOAD_KEY];
|
|
5788
5928
|
messages.push({
|
|
5789
5929
|
id: typeof messageId === "string" ? messageId : `opencode-user-${event.timestamp}`,
|
|
5790
5930
|
type: "user",
|
|
5791
|
-
content:
|
|
5931
|
+
content: message2,
|
|
5792
5932
|
timestamp: event.timestamp
|
|
5793
5933
|
});
|
|
5794
5934
|
}
|
|
@@ -5807,11 +5947,11 @@ function parseOpencodeEvents(events) {
|
|
|
5807
5947
|
continue;
|
|
5808
5948
|
}
|
|
5809
5949
|
if (event.type === "opencode-error") {
|
|
5810
|
-
const
|
|
5950
|
+
const message2 = typeof event.payload.message === "string" ? event.payload.message : "Opencode run failed";
|
|
5811
5951
|
messages.push({
|
|
5812
5952
|
id: `opencode-${event.type}-${event.timestamp}`,
|
|
5813
5953
|
type: "error",
|
|
5814
|
-
message: formatInferenceError(
|
|
5954
|
+
message: formatInferenceError(message2, {
|
|
5815
5955
|
...typeof event.payload.status === "number" ? { status: event.payload.status } : {}
|
|
5816
5956
|
}),
|
|
5817
5957
|
timestamp: event.timestamp
|
|
@@ -5993,7 +6133,7 @@ function parseMuseEvents(events) {
|
|
|
5993
6133
|
} catch {
|
|
5994
6134
|
}
|
|
5995
6135
|
}
|
|
5996
|
-
const
|
|
6136
|
+
const message2 = createCallDisplayMessage({
|
|
5997
6137
|
id: `muse-tool-${item.itemId}`,
|
|
5998
6138
|
server: "muse",
|
|
5999
6139
|
tool: typeof item.tool === "string" ? item.tool : "tool",
|
|
@@ -6003,7 +6143,7 @@ function parseMuseEvents(events) {
|
|
|
6003
6143
|
status: item.status === "failed" || item.status === "rejected" ? "failed" : terminal ? "completed" : "in_progress",
|
|
6004
6144
|
timestamp: typeof item.recordedAt === "string" ? item.recordedAt : event.timestamp
|
|
6005
6145
|
});
|
|
6006
|
-
upsertDisplayMessage(messages,
|
|
6146
|
+
upsertDisplayMessage(messages, message2);
|
|
6007
6147
|
}
|
|
6008
6148
|
}
|
|
6009
6149
|
return messages;
|
|
@@ -6018,8 +6158,8 @@ function toolStatus2(value) {
|
|
|
6018
6158
|
}
|
|
6019
6159
|
function assistantErrorMessage(value) {
|
|
6020
6160
|
if (!isRecord(value) || value.role !== "assistant" || value.stopReason !== "error") return null;
|
|
6021
|
-
const
|
|
6022
|
-
return formatInferenceError(
|
|
6161
|
+
const message2 = typeof value.errorMessage === "string" && value.errorMessage ? value.errorMessage : "Pi run failed";
|
|
6162
|
+
return formatInferenceError(message2, {
|
|
6023
6163
|
...typeof value.provider === "string" ? { provider: value.provider } : {},
|
|
6024
6164
|
...typeof value.model === "string" ? { model: value.model } : {}
|
|
6025
6165
|
});
|
|
@@ -6066,8 +6206,8 @@ function parsePiEvents(events) {
|
|
|
6066
6206
|
continue;
|
|
6067
6207
|
}
|
|
6068
6208
|
if (event.type === "pi-message_start") {
|
|
6069
|
-
const
|
|
6070
|
-
activeMessageId = typeof
|
|
6209
|
+
const message2 = isRecord(event.payload.message) ? event.payload.message : null;
|
|
6210
|
+
activeMessageId = typeof message2?.id === "string" ? message2.id : `assistant-${event.timestamp}`;
|
|
6071
6211
|
continue;
|
|
6072
6212
|
}
|
|
6073
6213
|
if (event.type === "pi-tool_execution_start" || event.type === "pi-tool_execution_update" || event.type === "pi-tool_execution_end") {
|
|
@@ -6266,8 +6406,8 @@ function fileOrCommandMessage(toolName, toolUseId, input, timestamp) {
|
|
|
6266
6406
|
};
|
|
6267
6407
|
}
|
|
6268
6408
|
function createSubagentMessage(messageIndex, timestamp, fields) {
|
|
6269
|
-
const { id = `subagent-${timestamp}-${messageIndex}`, ...
|
|
6270
|
-
return { id, type: "subagent", ...
|
|
6409
|
+
const { id = `subagent-${timestamp}-${messageIndex}`, ...message2 } = fields;
|
|
6410
|
+
return { id, type: "subagent", ...message2, timestamp };
|
|
6271
6411
|
}
|
|
6272
6412
|
function collectNestedEvents(events, toolUseId) {
|
|
6273
6413
|
return events.filter((e) => e.payload.parent_tool_use_id === toolUseId).map(({ timestamp, type, payload }) => ({ timestamp, type, payload }));
|
|
@@ -6324,12 +6464,12 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6324
6464
|
const supersededUserMessageIndexes = /* @__PURE__ */ new Set();
|
|
6325
6465
|
const findMatchingUserMessageIndex = (indexes, content, timestamp, messageId) => {
|
|
6326
6466
|
if (typeof messageId === "string") {
|
|
6327
|
-
const byId = messages.findIndex((
|
|
6467
|
+
const byId = messages.findIndex((message2, index) => message2.type === "user" && message2.id === messageId && !supersededUserMessageIndexes.has(index));
|
|
6328
6468
|
if (byId !== -1) return byId;
|
|
6329
6469
|
}
|
|
6330
6470
|
return [...indexes].find((index) => {
|
|
6331
|
-
const
|
|
6332
|
-
return
|
|
6471
|
+
const message2 = messages[index];
|
|
6472
|
+
return message2?.type === "user" && areUserMessagesWithinMatchWindow(message2, { content, timestamp });
|
|
6333
6473
|
});
|
|
6334
6474
|
};
|
|
6335
6475
|
const taskAccumulator = new TaskAccumulator();
|
|
@@ -6346,7 +6486,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6346
6486
|
const messageId = event.payload[USER_MESSAGE_ID_PAYLOAD_KEY];
|
|
6347
6487
|
const canonicalIndex = findMatchingUserMessageIndex(canonicalUserMessageIndexes, content, event.timestamp, messageId);
|
|
6348
6488
|
const canonical = canonicalIndex === void 0 ? void 0 : messages[canonicalIndex];
|
|
6349
|
-
const
|
|
6489
|
+
const message2 = {
|
|
6350
6490
|
id: typeof messageId === "string" ? messageId : `user-${event.timestamp}`,
|
|
6351
6491
|
type: "user",
|
|
6352
6492
|
content,
|
|
@@ -6354,9 +6494,9 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6354
6494
|
timestamp: event.timestamp
|
|
6355
6495
|
};
|
|
6356
6496
|
if (canonicalIndex === void 0) {
|
|
6357
|
-
acceptedUserMessageIndexes.add(messages.push(
|
|
6497
|
+
acceptedUserMessageIndexes.add(messages.push(message2) - 1);
|
|
6358
6498
|
} else {
|
|
6359
|
-
messages[canonicalIndex] =
|
|
6499
|
+
messages[canonicalIndex] = message2;
|
|
6360
6500
|
canonicalUserMessageIndexes.delete(canonicalIndex);
|
|
6361
6501
|
}
|
|
6362
6502
|
}
|
|
@@ -6428,7 +6568,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6428
6568
|
stampedId
|
|
6429
6569
|
);
|
|
6430
6570
|
const accepted = acceptedIndex === void 0 ? void 0 : messages[acceptedIndex];
|
|
6431
|
-
const
|
|
6571
|
+
const message2 = {
|
|
6432
6572
|
id: accepted?.id ?? (typeof stampedId === "string" ? stampedId : `user-${event.timestamp}`),
|
|
6433
6573
|
type: "user",
|
|
6434
6574
|
content: textContent || (images.length > 0 ? `[${images.length} image${images.length > 1 ? "s" : ""} attached]` : ""),
|
|
@@ -6436,13 +6576,13 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6436
6576
|
timestamp: event.timestamp
|
|
6437
6577
|
};
|
|
6438
6578
|
if (acceptedIndex === void 0) {
|
|
6439
|
-
canonicalUserMessageIndexes.add(messages.push(
|
|
6579
|
+
canonicalUserMessageIndexes.add(messages.push(message2) - 1);
|
|
6440
6580
|
} else if (acceptedUserMessageIndexes.has(acceptedIndex)) {
|
|
6441
6581
|
supersededUserMessageIndexes.add(acceptedIndex);
|
|
6442
6582
|
acceptedUserMessageIndexes.delete(acceptedIndex);
|
|
6443
|
-
canonicalUserMessageIndexes.add(messages.push(
|
|
6583
|
+
canonicalUserMessageIndexes.add(messages.push(message2) - 1);
|
|
6444
6584
|
} else {
|
|
6445
|
-
messages[acceptedIndex] =
|
|
6585
|
+
messages[acceptedIndex] = message2;
|
|
6446
6586
|
}
|
|
6447
6587
|
}
|
|
6448
6588
|
}
|
|
@@ -6568,15 +6708,14 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6568
6708
|
timestamp: event.timestamp
|
|
6569
6709
|
});
|
|
6570
6710
|
} else {
|
|
6571
|
-
messages.push({
|
|
6711
|
+
messages.push(createCallDisplayMessage({
|
|
6572
6712
|
id: `toolcall-${event.timestamp}-${messages.length}`,
|
|
6573
|
-
type: "tool_call",
|
|
6574
6713
|
server: "claude",
|
|
6575
6714
|
tool: toolName,
|
|
6576
6715
|
input: toolInput,
|
|
6577
6716
|
status: "in_progress",
|
|
6578
6717
|
timestamp: event.timestamp
|
|
6579
|
-
});
|
|
6718
|
+
}));
|
|
6580
6719
|
}
|
|
6581
6720
|
}
|
|
6582
6721
|
});
|
|
@@ -6666,9 +6805,9 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6666
6805
|
if (!Array.isArray(payload.options) && !Array.isArray(payload.questions)) return;
|
|
6667
6806
|
const toolInfo = toolCallMap.get(payload.toolUseId);
|
|
6668
6807
|
if (!toolInfo) return;
|
|
6669
|
-
const
|
|
6670
|
-
if (!
|
|
6671
|
-
|
|
6808
|
+
const message2 = messages[toolInfo.messageIndex];
|
|
6809
|
+
if (!message2 || message2.type !== "tool_call") return;
|
|
6810
|
+
message2.inputRequest = {
|
|
6672
6811
|
requestId: payload.requestId,
|
|
6673
6812
|
status: "pending",
|
|
6674
6813
|
options: payload.options,
|
|
@@ -6680,10 +6819,10 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6680
6819
|
if (!payload.toolUseId || !payload.selectionId) return;
|
|
6681
6820
|
const toolInfo = toolCallMap.get(payload.toolUseId);
|
|
6682
6821
|
if (!toolInfo) return;
|
|
6683
|
-
const
|
|
6684
|
-
if (!
|
|
6685
|
-
|
|
6686
|
-
...
|
|
6822
|
+
const message2 = messages[toolInfo.messageIndex];
|
|
6823
|
+
if (!message2 || message2.type !== "tool_call" || !message2.inputRequest) return;
|
|
6824
|
+
message2.inputRequest = {
|
|
6825
|
+
...message2.inputRequest,
|
|
6687
6826
|
status: payload.selectionId === "aborted" ? "aborted" : "resolved",
|
|
6688
6827
|
selectionId: payload.selectionId,
|
|
6689
6828
|
selectionSummary: payload.selectionSummary
|
|
@@ -6705,39 +6844,41 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6705
6844
|
if (toolInfo.toolName === "TaskCreate" && !isError) {
|
|
6706
6845
|
taskAccumulator.processContentBlock(toolResult);
|
|
6707
6846
|
}
|
|
6708
|
-
const
|
|
6709
|
-
if (!
|
|
6710
|
-
if (
|
|
6711
|
-
|
|
6712
|
-
|
|
6847
|
+
const message2 = messages[toolInfo.messageIndex];
|
|
6848
|
+
if (!message2) return;
|
|
6849
|
+
if (message2.type === "command") {
|
|
6850
|
+
message2.output = resultContent;
|
|
6851
|
+
message2.status = status;
|
|
6713
6852
|
const exitCodeMatch = resultContent.match(/exit code:?\s*(\d+)/i);
|
|
6714
6853
|
if (exitCodeMatch) {
|
|
6715
|
-
|
|
6854
|
+
message2.exitCode = parseInt(exitCodeMatch[1], 10);
|
|
6716
6855
|
} else {
|
|
6717
|
-
|
|
6856
|
+
message2.exitCode = isError ? 1 : 0;
|
|
6718
6857
|
}
|
|
6719
|
-
} else if (
|
|
6720
|
-
|
|
6721
|
-
} else if (
|
|
6722
|
-
|
|
6723
|
-
} else if (
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
} else if (
|
|
6727
|
-
|
|
6728
|
-
} else if (
|
|
6729
|
-
|
|
6730
|
-
|
|
6858
|
+
} else if (message2.type === "patch") {
|
|
6859
|
+
message2.status = status;
|
|
6860
|
+
} else if (message2.type === "web_search") {
|
|
6861
|
+
message2.status = status;
|
|
6862
|
+
} else if (message2.type === "tool_call") {
|
|
6863
|
+
message2.output = resultContent;
|
|
6864
|
+
message2.status = status;
|
|
6865
|
+
} else if (message2.type === "skill" && isError && message2.path) {
|
|
6866
|
+
messages[toolInfo.messageIndex] = { id: message2.id, type: "tool_call", server: "claude", tool: toolInfo.toolName, input: toolInfo.input, output: resultContent, status, timestamp: message2.timestamp };
|
|
6867
|
+
} else if (message2.type === "skill") {
|
|
6868
|
+
message2.status = status;
|
|
6869
|
+
} else if (message2.type === "subagent") {
|
|
6870
|
+
message2.output = resultContent;
|
|
6871
|
+
message2.status = status;
|
|
6731
6872
|
}
|
|
6732
6873
|
});
|
|
6733
|
-
for (const
|
|
6734
|
-
if (
|
|
6735
|
-
const toolInfo = toolCallMap.get(
|
|
6874
|
+
for (const message2 of messages) {
|
|
6875
|
+
if (message2.type === "background_task" && message2.toolUseId) {
|
|
6876
|
+
const toolInfo = toolCallMap.get(message2.toolUseId);
|
|
6736
6877
|
const toolMessage = toolInfo ? messages[toolInfo.messageIndex] : void 0;
|
|
6737
|
-
if (toolMessage?.type === "command")
|
|
6878
|
+
if (toolMessage?.type === "command") message2.command = toolMessage.command;
|
|
6738
6879
|
if (toolMessage?.type === "subagent") {
|
|
6739
|
-
|
|
6740
|
-
|
|
6880
|
+
message2.prompt ??= toolMessage.prompt;
|
|
6881
|
+
message2.subagentType ??= toolMessage.subagentType;
|
|
6741
6882
|
}
|
|
6742
6883
|
}
|
|
6743
6884
|
}
|
|
@@ -6789,9 +6930,9 @@ function parseDisplayMessages(events, agentType, options = {}) {
|
|
|
6789
6930
|
events = excludeQueuedAcceptedEvents(events, []);
|
|
6790
6931
|
const parsedEvents = agentType === "claude" ? parseClaudeEvents(events, options.parentToolUseId) : parseAgentEvents(events, agentType);
|
|
6791
6932
|
const reconciledEvents = [];
|
|
6792
|
-
for (const
|
|
6793
|
-
if (
|
|
6794
|
-
else reconciledEvents.push(
|
|
6933
|
+
for (const message2 of parsedEvents) {
|
|
6934
|
+
if (message2.type === "user") upsertDisplayMessage(reconciledEvents, message2);
|
|
6935
|
+
else reconciledEvents.push(message2);
|
|
6795
6936
|
}
|
|
6796
6937
|
if (options.filter === false) return reconciledEvents;
|
|
6797
6938
|
return applyAuthFallbackNotices(
|
|
@@ -6853,17 +6994,17 @@ function applyAuthFallbackNotices(messages, events) {
|
|
|
6853
6994
|
for (const notice of notices) insertDisplayMessageByTimestamp(result, notice);
|
|
6854
6995
|
return result;
|
|
6855
6996
|
}
|
|
6856
|
-
function isCodexInitializationPrompt(
|
|
6857
|
-
return
|
|
6997
|
+
function isCodexInitializationPrompt(message2) {
|
|
6998
|
+
return message2.type === "user" && removeReplicasInstructions(message2.content).trim() === "Hello";
|
|
6858
6999
|
}
|
|
6859
7000
|
function isAgentBackendEvent(value) {
|
|
6860
7001
|
if (!value || typeof value !== "object") return false;
|
|
6861
7002
|
const candidate = value;
|
|
6862
7003
|
return typeof candidate.timestamp === "string" && typeof candidate.type === "string" && typeof candidate.payload === "object" && candidate.payload !== null;
|
|
6863
7004
|
}
|
|
6864
|
-
function filterDisplayMessages(messages,
|
|
7005
|
+
function filterDisplayMessages(messages, provider2) {
|
|
6865
7006
|
let result = messages;
|
|
6866
|
-
if (
|
|
7007
|
+
if (provider2 === "codex") {
|
|
6867
7008
|
const userMessages = result.map((msg, index) => ({ msg, index })).filter(({ msg }) => msg.type === "user");
|
|
6868
7009
|
if (userMessages.length >= 2 && isCodexInitializationPrompt(userMessages[0].msg)) {
|
|
6869
7010
|
result = result.slice(userMessages[1].index);
|
|
@@ -6894,24 +7035,24 @@ function attachSendersToMessages(messages, senders) {
|
|
|
6894
7035
|
const sendersByMessageId = new Map(senders.flatMap((sender) => sender.messageId ? [[sender.messageId, sender], [`user-${sender.messageId}`, sender]] : []));
|
|
6895
7036
|
const legacySenders = senders.filter((sender) => !sender.messageId);
|
|
6896
7037
|
const userIndices = [];
|
|
6897
|
-
const attachSender = (
|
|
6898
|
-
...
|
|
7038
|
+
const attachSender = (message2, sender) => message2.type === "user" ? {
|
|
7039
|
+
...message2,
|
|
6899
7040
|
senderUserId: sender.senderUserId,
|
|
6900
7041
|
senderEmail: sender.senderEmail,
|
|
6901
7042
|
...sender.senderDisplayName ? { senderDisplayName: sender.senderDisplayName } : {},
|
|
6902
7043
|
...sender.senderAvatarUrl ? { senderAvatarUrl: sender.senderAvatarUrl } : {}
|
|
6903
|
-
} :
|
|
6904
|
-
const next = messages.map((
|
|
6905
|
-
const sender =
|
|
6906
|
-
return sender ? attachSender(
|
|
7044
|
+
} : message2;
|
|
7045
|
+
const next = messages.map((message2) => {
|
|
7046
|
+
const sender = message2.type === "user" ? sendersByMessageId.get(message2.id) : void 0;
|
|
7047
|
+
return sender ? attachSender(message2, sender) : message2;
|
|
6907
7048
|
});
|
|
6908
|
-
messages.forEach((
|
|
6909
|
-
if (
|
|
7049
|
+
messages.forEach((message2, index) => {
|
|
7050
|
+
if (message2.type === "user" && !sendersByMessageId.has(message2.id)) {
|
|
6910
7051
|
userIndices.push(index);
|
|
6911
7052
|
}
|
|
6912
7053
|
});
|
|
6913
7054
|
const timestampSenders = senders.filter((sender) => sender.messageId && !messages.some(
|
|
6914
|
-
(
|
|
7055
|
+
(message2) => message2.type === "user" && sendersByMessageId.get(message2.id) === sender
|
|
6915
7056
|
));
|
|
6916
7057
|
for (const sender of timestampSenders) {
|
|
6917
7058
|
const senderTime = parseTimestampMs(sender.recordedAt);
|
|
@@ -6935,9 +7076,9 @@ function attachSendersToMessages(messages, senders) {
|
|
|
6935
7076
|
}
|
|
6936
7077
|
|
|
6937
7078
|
// ../shared/src/display-message/final-response.ts
|
|
6938
|
-
function extractFinalResponse(history,
|
|
6939
|
-
const
|
|
6940
|
-
return
|
|
7079
|
+
function extractFinalResponse(history, provider2) {
|
|
7080
|
+
const message2 = parseAgentEvents(history.events ?? [], provider2).findLast((candidate) => candidate.type === "agent");
|
|
7081
|
+
return message2?.type === "agent" && message2.content ? message2.content : null;
|
|
6941
7082
|
}
|
|
6942
7083
|
|
|
6943
7084
|
// ../shared/src/agent-event-utils.ts
|
|
@@ -6960,7 +7101,7 @@ function getUserMessageItemId(event) {
|
|
|
6960
7101
|
return typeof itemId === "string" ? itemId : null;
|
|
6961
7102
|
}
|
|
6962
7103
|
function excludeQueuedAcceptedEvents(events, queue, removedMessageIds = []) {
|
|
6963
|
-
const queuedMessageIds = /* @__PURE__ */ new Set([...queue.map((
|
|
7104
|
+
const queuedMessageIds = /* @__PURE__ */ new Set([...queue.map((message2) => message2.id), ...removedMessageIds]);
|
|
6964
7105
|
for (const event of events) {
|
|
6965
7106
|
for (const messageId of getRemovedMessageIds(event)) queuedMessageIds.add(messageId);
|
|
6966
7107
|
}
|
|
@@ -7058,25 +7199,25 @@ function redactSecrets(value) {
|
|
|
7058
7199
|
}
|
|
7059
7200
|
|
|
7060
7201
|
// ../shared/src/transcript-canonicalize.ts
|
|
7061
|
-
function canonicalizeChatTranscriptBlocks(content,
|
|
7202
|
+
function canonicalizeChatTranscriptBlocks(content, provider2, senders) {
|
|
7062
7203
|
const messages = attachSendersToMessages(
|
|
7063
|
-
parseDisplayMessages(parseCodexHistoryEvents(content),
|
|
7204
|
+
parseDisplayMessages(parseCodexHistoryEvents(content), provider2),
|
|
7064
7205
|
senders
|
|
7065
7206
|
);
|
|
7066
|
-
return messages.flatMap((
|
|
7207
|
+
return messages.flatMap((message2) => {
|
|
7067
7208
|
let block = null;
|
|
7068
|
-
if (
|
|
7069
|
-
block = `## User${
|
|
7070
|
-
${
|
|
7071
|
-
} else if (
|
|
7209
|
+
if (message2.type === "user") {
|
|
7210
|
+
block = `## User${message2.senderEmail ? ` (${message2.senderEmail})` : ""}
|
|
7211
|
+
${message2.content}`;
|
|
7212
|
+
} else if (message2.type === "agent") {
|
|
7072
7213
|
block = `## Agent
|
|
7073
|
-
${
|
|
7074
|
-
} else if (
|
|
7214
|
+
${message2.content}`;
|
|
7215
|
+
} else if (message2.type === "reasoning") {
|
|
7075
7216
|
block = `## Agent reasoning (unverified)
|
|
7076
|
-
Timestamp: ${
|
|
7077
|
-
${
|
|
7217
|
+
Timestamp: ${message2.sourceTimestamp ?? message2.timestamp}
|
|
7218
|
+
${message2.content}`;
|
|
7078
7219
|
} else {
|
|
7079
|
-
const activity = getDisplayMessageActivity(
|
|
7220
|
+
const activity = getDisplayMessageActivity(message2);
|
|
7080
7221
|
if (activity) {
|
|
7081
7222
|
const details = [];
|
|
7082
7223
|
if (activity.summary) details.push(`Summary: ${activity.summary}`);
|
|
@@ -7086,7 +7227,7 @@ ${activity.items.map((item) => `- [${item.status}] ${item.text}`).join("\n")}`);
|
|
|
7086
7227
|
}
|
|
7087
7228
|
if (activity.content) details.push(`Details:
|
|
7088
7229
|
${activity.content}`);
|
|
7089
|
-
if (
|
|
7230
|
+
if (message2.type === "command" && message2.exitCode != null) details.push(`Exit: ${message2.exitCode}`);
|
|
7090
7231
|
block = `## Activity
|
|
7091
7232
|
${activity.title}${details.length > 0 ? `
|
|
7092
7233
|
${details.join("\n")}` : ""}`;
|
|
@@ -7144,7 +7285,7 @@ ${CLOSE_MARKER}
|
|
|
7144
7285
|
|
|
7145
7286
|
${instruction}`;
|
|
7146
7287
|
}
|
|
7147
|
-
function formatSideChatUpdateMessage(source, turns,
|
|
7288
|
+
function formatSideChatUpdateMessage(source, turns, message2) {
|
|
7148
7289
|
const meta = { sourceProvider: source.provider, sourceTitle: source.title, trigger: "side" };
|
|
7149
7290
|
return `${OPEN_MARKER}${JSON.stringify(meta)}${OPEN_MARKER_END}
|
|
7150
7291
|
# Main chat update
|
|
@@ -7154,7 +7295,7 @@ The main chat "${source.title}" has new turns since your last reply:
|
|
|
7154
7295
|
${turns}
|
|
7155
7296
|
${CLOSE_MARKER}
|
|
7156
7297
|
|
|
7157
|
-
${
|
|
7298
|
+
${message2}`;
|
|
7158
7299
|
}
|
|
7159
7300
|
|
|
7160
7301
|
// ../shared/src/transcript-condense.ts
|
|
@@ -7333,27 +7474,27 @@ function buildCodexTokenUsageContextUsagePayload(usage) {
|
|
|
7333
7474
|
updatedAt: usage.updatedAt
|
|
7334
7475
|
};
|
|
7335
7476
|
}
|
|
7336
|
-
function resolveClaudeContextWindow(
|
|
7337
|
-
if (
|
|
7477
|
+
function resolveClaudeContextWindow(provider2, model2, reportedMaxTokens) {
|
|
7478
|
+
if (provider2 !== "claude") {
|
|
7338
7479
|
return { maxTokens: reportedMaxTokens, usedKnownWindow: false };
|
|
7339
7480
|
}
|
|
7340
|
-
const knownWindow = getClaudeModelContextWindow(
|
|
7481
|
+
const knownWindow = getClaudeModelContextWindow(model2);
|
|
7341
7482
|
return {
|
|
7342
7483
|
maxTokens: knownWindow ?? reportedMaxTokens,
|
|
7343
7484
|
usedKnownWindow: knownWindow !== null
|
|
7344
7485
|
};
|
|
7345
7486
|
}
|
|
7346
7487
|
function coerceContextUsagePayload(payload, timestamp) {
|
|
7347
|
-
const
|
|
7348
|
-
if (typeof
|
|
7488
|
+
const provider2 = payload.provider;
|
|
7489
|
+
if (typeof provider2 !== "string" || !isValidAgentProvider(provider2)) return null;
|
|
7349
7490
|
const rawTotalTokens = numberOrNull(payload.totalTokens);
|
|
7350
7491
|
const percentageValue = numberOrNull(payload.percentage);
|
|
7351
7492
|
if (rawTotalTokens === null || percentageValue === null) {
|
|
7352
7493
|
return null;
|
|
7353
7494
|
}
|
|
7354
|
-
const
|
|
7495
|
+
const model2 = typeof payload.model === "string" ? payload.model : null;
|
|
7355
7496
|
const reportedMaxTokens = numberOrNull(payload.maxTokens);
|
|
7356
|
-
const { maxTokens, usedKnownWindow } = resolveClaudeContextWindow(
|
|
7497
|
+
const { maxTokens, usedKnownWindow } = resolveClaudeContextWindow(provider2, model2, reportedMaxTokens);
|
|
7357
7498
|
const rawMaxTokens = usedKnownWindow ? maxTokens : numberOrNull(payload.rawMaxTokens);
|
|
7358
7499
|
const totalTokens = clampTokensToWindow(rawTotalTokens, maxTokens);
|
|
7359
7500
|
const source = payload.source === "codex_token_count" || payload.source === "claude_usage" || payload.source === "provider_usage" ? payload.source : "claude_context";
|
|
@@ -7373,9 +7514,9 @@ function coerceContextUsagePayload(payload, timestamp) {
|
|
|
7373
7514
|
const compactsAutomatically = typeof payload.compactsAutomatically === "boolean" ? payload.compactsAutomatically : void 0;
|
|
7374
7515
|
const autoCompactThreshold = normalizeAutoCompactThreshold(payload.autoCompactThreshold, maxTokens);
|
|
7375
7516
|
return {
|
|
7376
|
-
provider,
|
|
7517
|
+
provider: provider2,
|
|
7377
7518
|
source,
|
|
7378
|
-
...
|
|
7519
|
+
...model2 ? { model: model2 } : {},
|
|
7379
7520
|
totalTokens,
|
|
7380
7521
|
maxTokens,
|
|
7381
7522
|
rawMaxTokens,
|
|
@@ -7406,18 +7547,18 @@ function codexTokenCountToContextUsage(event) {
|
|
|
7406
7547
|
updatedAt: event.timestamp
|
|
7407
7548
|
});
|
|
7408
7549
|
}
|
|
7409
|
-
function extractLatestContextUsage(events,
|
|
7550
|
+
function extractLatestContextUsage(events, provider2) {
|
|
7410
7551
|
if (!events || events.length === 0) return null;
|
|
7411
7552
|
let latest = null;
|
|
7412
7553
|
for (const event of events) {
|
|
7413
7554
|
if (event.type === CONTEXT_USAGE_EVENT_TYPE) {
|
|
7414
7555
|
const usage = coerceContextUsagePayload(event.payload, event.timestamp);
|
|
7415
|
-
if (usage && usage.provider ===
|
|
7556
|
+
if (usage && usage.provider === provider2) {
|
|
7416
7557
|
latest = usage;
|
|
7417
7558
|
}
|
|
7418
7559
|
continue;
|
|
7419
7560
|
}
|
|
7420
|
-
if (
|
|
7561
|
+
if (provider2 === "codex") {
|
|
7421
7562
|
const usage = codexTokenCountToContextUsage(event);
|
|
7422
7563
|
if (usage) {
|
|
7423
7564
|
latest = usage;
|
|
@@ -7530,7 +7671,7 @@ function normalizeSlashCommandName(name) {
|
|
|
7530
7671
|
if (!command || /\s/.test(command)) return null;
|
|
7531
7672
|
return `/${command}`;
|
|
7532
7673
|
}
|
|
7533
|
-
function createProviderSlashCommand(
|
|
7674
|
+
function createProviderSlashCommand(provider2, name, description, argumentHint) {
|
|
7534
7675
|
const command = normalizeSlashCommandName(name);
|
|
7535
7676
|
if (!command) return null;
|
|
7536
7677
|
const trimmedDescription = description?.trim();
|
|
@@ -7539,7 +7680,7 @@ function createProviderSlashCommand(provider, name, description, argumentHint) {
|
|
|
7539
7680
|
command,
|
|
7540
7681
|
description: trimmedDescription || `Run ${command}.`,
|
|
7541
7682
|
...trimmedArgumentHint ? { argumentHint: trimmedArgumentHint } : {},
|
|
7542
|
-
providers: [
|
|
7683
|
+
providers: [provider2]
|
|
7543
7684
|
};
|
|
7544
7685
|
}
|
|
7545
7686
|
var SIDE_CHAT_COMMANDS = ["/btw", "/side"];
|
|
@@ -7596,8 +7737,8 @@ function mergeSlashCommands(...commandGroups) {
|
|
|
7596
7737
|
}
|
|
7597
7738
|
return commands;
|
|
7598
7739
|
}
|
|
7599
|
-
function getSlashCommandsForProvider(
|
|
7600
|
-
return commands.filter((command) => command.providers.includes(
|
|
7740
|
+
function getSlashCommandsForProvider(provider2, commands = SLASH_COMMANDS) {
|
|
7741
|
+
return commands.filter((command) => command.providers.includes(provider2));
|
|
7601
7742
|
}
|
|
7602
7743
|
var MAX_CODEX_GOAL_OBJECTIVE_CHARS = 4e3;
|
|
7603
7744
|
function classifyGoalValue(value) {
|
|
@@ -7606,20 +7747,20 @@ function classifyGoalValue(value) {
|
|
|
7606
7747
|
if (/^resume$/i.test(value)) return { type: "resume" };
|
|
7607
7748
|
return { type: "set", objective: value };
|
|
7608
7749
|
}
|
|
7609
|
-
function parseGoalCommand(
|
|
7610
|
-
const match =
|
|
7750
|
+
function parseGoalCommand(message2) {
|
|
7751
|
+
const match = message2.trim().match(/^\/goal(?:\s+([\s\S]*))?$/i);
|
|
7611
7752
|
const value = match?.[1]?.trim();
|
|
7612
7753
|
if (!value) return null;
|
|
7613
7754
|
return classifyGoalValue(value);
|
|
7614
7755
|
}
|
|
7615
|
-
function getGoalCommand(
|
|
7616
|
-
if (!goalMode) return parseGoalCommand(
|
|
7617
|
-
const value =
|
|
7756
|
+
function getGoalCommand(message2, goalMode) {
|
|
7757
|
+
if (!goalMode) return parseGoalCommand(message2);
|
|
7758
|
+
const value = message2.trim();
|
|
7618
7759
|
if (!value) return null;
|
|
7619
7760
|
return classifyGoalValue(value);
|
|
7620
7761
|
}
|
|
7621
|
-
function getGoalCommandObjectiveValidationError(
|
|
7622
|
-
const command = getGoalCommand(
|
|
7762
|
+
function getGoalCommandObjectiveValidationError(message2, goalMode) {
|
|
7763
|
+
const command = getGoalCommand(message2, goalMode);
|
|
7623
7764
|
if (command?.type !== "set") return null;
|
|
7624
7765
|
const length = command.objective.length;
|
|
7625
7766
|
if (length <= MAX_CODEX_GOAL_OBJECTIVE_CHARS) return null;
|
|
@@ -7997,7 +8138,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
7997
8138
|
};
|
|
7998
8139
|
|
|
7999
8140
|
// ../shared/src/routes/command-protection.ts
|
|
8000
|
-
import { z as
|
|
8141
|
+
import { z as z15 } from "zod";
|
|
8001
8142
|
|
|
8002
8143
|
// ../shared/src/git-invocations.ts
|
|
8003
8144
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -8088,27 +8229,27 @@ function findCheckoutTarget(args) {
|
|
|
8088
8229
|
}
|
|
8089
8230
|
|
|
8090
8231
|
// ../shared/src/routes/command-protection.ts
|
|
8091
|
-
var commandProtectionRepoStateSchema =
|
|
8092
|
-
branch:
|
|
8093
|
-
defaultBranch:
|
|
8094
|
-
pushBranch:
|
|
8095
|
-
pushConfig:
|
|
8096
|
-
headMessage:
|
|
8097
|
-
mergeInProgress:
|
|
8232
|
+
var commandProtectionRepoStateSchema = z15.object({
|
|
8233
|
+
branch: z15.string().nullable(),
|
|
8234
|
+
defaultBranch: z15.string().nullable(),
|
|
8235
|
+
pushBranch: z15.string().nullable(),
|
|
8236
|
+
pushConfig: z15.string().nullable(),
|
|
8237
|
+
headMessage: z15.string().nullable(),
|
|
8238
|
+
mergeInProgress: z15.boolean().optional()
|
|
8098
8239
|
});
|
|
8099
|
-
var commandProtectionEvaluateRequestSchema =
|
|
8100
|
-
provider:
|
|
8101
|
-
source:
|
|
8102
|
-
toolName:
|
|
8103
|
-
toolInput:
|
|
8104
|
-
command:
|
|
8105
|
-
cwd:
|
|
8106
|
-
toolUseId:
|
|
8240
|
+
var commandProtectionEvaluateRequestSchema = z15.object({
|
|
8241
|
+
provider: z15.enum(["claude", "codex", "cursor", "opencode", "pi"]),
|
|
8242
|
+
source: z15.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
|
|
8243
|
+
toolName: z15.string(),
|
|
8244
|
+
toolInput: z15.unknown(),
|
|
8245
|
+
command: z15.string().nullish(),
|
|
8246
|
+
cwd: z15.string().nullish(),
|
|
8247
|
+
toolUseId: z15.string().nullish(),
|
|
8107
8248
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
8108
8249
|
// policy can see branches and commit messages the command text only references.
|
|
8109
|
-
gitContext:
|
|
8110
|
-
repos:
|
|
8111
|
-
messageFiles:
|
|
8250
|
+
gitContext: z15.object({
|
|
8251
|
+
repos: z15.record(z15.string(), commandProtectionRepoStateSchema),
|
|
8252
|
+
messageFiles: z15.record(z15.string(), z15.string())
|
|
8112
8253
|
}).optional()
|
|
8113
8254
|
});
|
|
8114
8255
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
@@ -8305,89 +8446,89 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
8305
8446
|
}
|
|
8306
8447
|
|
|
8307
8448
|
// ../shared/src/routes/linear.ts
|
|
8308
|
-
import { z as
|
|
8309
|
-
var linearSessionMetadataSchema =
|
|
8310
|
-
via_mothership:
|
|
8311
|
-
issue_id:
|
|
8312
|
-
issue_identifier:
|
|
8313
|
-
issue_title:
|
|
8314
|
-
issue_description:
|
|
8315
|
-
issue_url:
|
|
8316
|
-
comment_id:
|
|
8317
|
-
comment_body:
|
|
8318
|
-
triggered_by_id:
|
|
8319
|
-
triggered_by_name:
|
|
8320
|
-
triggered_by_email:
|
|
8321
|
-
linear_workspace_id:
|
|
8322
|
-
creator_id:
|
|
8323
|
-
creator_name:
|
|
8324
|
-
creator_email:
|
|
8325
|
-
assignee_id:
|
|
8326
|
-
assignee_name:
|
|
8327
|
-
assignee_email:
|
|
8328
|
-
issue_state:
|
|
8329
|
-
parent_issue:
|
|
8330
|
-
id:
|
|
8331
|
-
identifier:
|
|
8332
|
-
title:
|
|
8333
|
-
description:
|
|
8449
|
+
import { z as z16 } from "zod";
|
|
8450
|
+
var linearSessionMetadataSchema = z16.object({
|
|
8451
|
+
via_mothership: z16.boolean().optional(),
|
|
8452
|
+
issue_id: z16.string(),
|
|
8453
|
+
issue_identifier: z16.string(),
|
|
8454
|
+
issue_title: z16.string(),
|
|
8455
|
+
issue_description: z16.string(),
|
|
8456
|
+
issue_url: z16.string(),
|
|
8457
|
+
comment_id: z16.string(),
|
|
8458
|
+
comment_body: z16.string(),
|
|
8459
|
+
triggered_by_id: z16.string().optional(),
|
|
8460
|
+
triggered_by_name: z16.string().optional(),
|
|
8461
|
+
triggered_by_email: z16.string().optional(),
|
|
8462
|
+
linear_workspace_id: z16.string().optional(),
|
|
8463
|
+
creator_id: z16.string().optional(),
|
|
8464
|
+
creator_name: z16.string().optional(),
|
|
8465
|
+
creator_email: z16.string().optional(),
|
|
8466
|
+
assignee_id: z16.string().optional(),
|
|
8467
|
+
assignee_name: z16.string().optional(),
|
|
8468
|
+
assignee_email: z16.string().optional(),
|
|
8469
|
+
issue_state: z16.string().optional(),
|
|
8470
|
+
parent_issue: z16.object({
|
|
8471
|
+
id: z16.string(),
|
|
8472
|
+
identifier: z16.string(),
|
|
8473
|
+
title: z16.string(),
|
|
8474
|
+
description: z16.string().nullable()
|
|
8334
8475
|
}).optional(),
|
|
8335
|
-
workspace:
|
|
8336
|
-
id:
|
|
8337
|
-
coding_agent:
|
|
8338
|
-
task_description:
|
|
8339
|
-
created_at:
|
|
8476
|
+
workspace: z16.object({
|
|
8477
|
+
id: z16.string(),
|
|
8478
|
+
coding_agent: z16.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
|
|
8479
|
+
task_description: z16.string(),
|
|
8480
|
+
created_at: z16.string()
|
|
8340
8481
|
}).optional()
|
|
8341
8482
|
});
|
|
8342
8483
|
|
|
8343
8484
|
// ../shared/src/routes/mothership.ts
|
|
8344
|
-
import { z as
|
|
8485
|
+
import { z as z17 } from "zod";
|
|
8345
8486
|
var MOTHERSHIP_LINEAR_ACTIONS = ["ask", "start"];
|
|
8346
|
-
var mothershipLinearSessionIntentRequestSchema =
|
|
8347
|
-
comment_id:
|
|
8348
|
-
action:
|
|
8487
|
+
var mothershipLinearSessionIntentRequestSchema = z17.object({
|
|
8488
|
+
comment_id: z17.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
8489
|
+
action: z17.enum(MOTHERSHIP_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it is the complete task prompt.")
|
|
8349
8490
|
});
|
|
8350
|
-
var mothershipLinearStartRequestSchema =
|
|
8351
|
-
issue_id:
|
|
8352
|
-
agent_session_id:
|
|
8353
|
-
prompt:
|
|
8491
|
+
var mothershipLinearStartRequestSchema = z17.object({
|
|
8492
|
+
issue_id: z17.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
8493
|
+
agent_session_id: z17.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
8494
|
+
prompt: z17.string().trim().min(1).describe("Complete task prompt for the coding workspace.")
|
|
8354
8495
|
});
|
|
8355
|
-
var slackChannelIdSchema =
|
|
8356
|
-
var slackThreadTsSchema =
|
|
8357
|
-
var mothershipSlackSpawnRequestSchema =
|
|
8496
|
+
var slackChannelIdSchema = z17.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
8497
|
+
var slackThreadTsSchema = z17.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
8498
|
+
var mothershipSlackSpawnRequestSchema = z17.object({
|
|
8358
8499
|
channel_id: slackChannelIdSchema,
|
|
8359
8500
|
thread_ts: slackThreadTsSchema,
|
|
8360
|
-
message_ts:
|
|
8361
|
-
user_id:
|
|
8362
|
-
prompt:
|
|
8363
|
-
environment_id:
|
|
8501
|
+
message_ts: z17.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
|
|
8502
|
+
user_id: z17.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
8503
|
+
prompt: z17.string().describe("Complete task for the new workspace, written so it stands on its own."),
|
|
8504
|
+
environment_id: z17.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
|
|
8364
8505
|
});
|
|
8365
|
-
var mothershipSlackRelayRequestSchema =
|
|
8506
|
+
var mothershipSlackRelayRequestSchema = z17.object({
|
|
8366
8507
|
channel_id: slackChannelIdSchema,
|
|
8367
8508
|
thread_ts: slackThreadTsSchema,
|
|
8368
|
-
message:
|
|
8369
|
-
user_id:
|
|
8370
|
-
queue:
|
|
8509
|
+
message: z17.string().describe("The follow-up to deliver, combining every fresh message that belongs to this update."),
|
|
8510
|
+
user_id: z17.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester."),
|
|
8511
|
+
queue: z17.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it.")
|
|
8371
8512
|
});
|
|
8372
|
-
var mothershipSlackConfirmationSchema =
|
|
8373
|
-
confirmation_channel_id:
|
|
8374
|
-
confirmation_thread_ts:
|
|
8375
|
-
confirmation_message_ts:
|
|
8376
|
-
confirmation_user_id:
|
|
8513
|
+
var mothershipSlackConfirmationSchema = z17.object({
|
|
8514
|
+
confirmation_channel_id: z17.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
8515
|
+
confirmation_thread_ts: z17.string().describe("`thread_ts` from that message's envelope."),
|
|
8516
|
+
confirmation_message_ts: z17.string().describe("`message_ts` from that message's envelope."),
|
|
8517
|
+
confirmation_user_id: z17.string().describe("`user_id` from that message's envelope.")
|
|
8377
8518
|
});
|
|
8378
8519
|
var mothershipAutomationToolInputSchema = automationToolInputSchema.extend(mothershipSlackConfirmationSchema.shape);
|
|
8379
8520
|
var mothershipSaveChannelPresetToolInputSchema = mothershipSlackConfirmationSchema.extend({
|
|
8380
|
-
preset_id:
|
|
8381
|
-
name:
|
|
8382
|
-
description:
|
|
8383
|
-
icon:
|
|
8384
|
-
instructions:
|
|
8521
|
+
preset_id: z17.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
8522
|
+
name: z17.string().trim().min(1).max(MOTHERSHIP_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
8523
|
+
description: z17.string().optional().describe("One-line summary shown in settings."),
|
|
8524
|
+
icon: z17.enum(MOTHERSHIP_PRESET_ICONS).optional(),
|
|
8525
|
+
instructions: z17.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
8385
8526
|
});
|
|
8386
8527
|
var mothershipUpdateChannelSettingsToolInputSchema = mothershipSlackConfirmationSchema.extend({
|
|
8387
|
-
source:
|
|
8388
|
-
external_id:
|
|
8389
|
-
preset_id:
|
|
8390
|
-
instructions:
|
|
8528
|
+
source: z17.enum(MOTHERSHIP_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
8529
|
+
external_id: z17.string().describe(`Slack channel id or Linear team id of an already monitored source, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`),
|
|
8530
|
+
preset_id: z17.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
8531
|
+
instructions: z17.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them.")
|
|
8391
8532
|
});
|
|
8392
8533
|
|
|
8393
8534
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -8711,85 +8852,46 @@ var workspaceLastViewedAtClientStateKey = orgUserClientStateKey(WORKSPACE_LAST_V
|
|
|
8711
8852
|
var workspaceAttentionDoneClientStateKey = orgUserClientStateKey(WORKSPACE_ATTENTION_DONE_CLIENT_STATE_KEY_PREFIX);
|
|
8712
8853
|
var workspaceStagesClientStateKey = orgUserClientStateKey(WORKSPACE_STAGES_CLIENT_STATE_KEY_PREFIX);
|
|
8713
8854
|
|
|
8714
|
-
// ../shared/src/routes/workspaces.ts
|
|
8715
|
-
import { z as z16 } from "zod";
|
|
8716
|
-
var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
|
|
8717
|
-
var STALE_PREPARING_MS = 10 * 6e4;
|
|
8718
|
-
var WORKSPACE_STATUS_FILTERS = WORKSPACE_STATUSES.map((status) => status === "error" ? "failed" : status);
|
|
8719
|
-
var WORKSPACE_SORT_CHOICES = [
|
|
8720
|
-
["manual", "Custom"],
|
|
8721
|
-
["activity", "Last activity"],
|
|
8722
|
-
["created", "Created date"]
|
|
8723
|
-
];
|
|
8724
|
-
var WORKSPACE_SORT_OPTIONS = WORKSPACE_SORT_CHOICES.map(([option]) => option);
|
|
8725
|
-
var WORKSPACE_SORT_LABELS = Object.fromEntries(WORKSPACE_SORT_CHOICES);
|
|
8726
|
-
var WORKSPACE_SIDEBAR_ORGANIZATION_CHOICES = [
|
|
8727
|
-
["chronological", "Chronological"],
|
|
8728
|
-
["environments", "Environments"],
|
|
8729
|
-
["recent", "Recent environments"]
|
|
8730
|
-
];
|
|
8731
|
-
var WORKSPACE_SIDEBAR_ORGANIZATIONS = WORKSPACE_SIDEBAR_ORGANIZATION_CHOICES.map(([organization]) => organization);
|
|
8732
|
-
var WORKSPACE_SIDEBAR_ORGANIZATION_LABELS = Object.fromEntries(WORKSPACE_SIDEBAR_ORGANIZATION_CHOICES);
|
|
8733
|
-
var DEFAULT_STATUS_FILTERS = [...WORKSPACE_STATUS_FILTERS];
|
|
8734
|
-
var DEFAULT_WORKSPACE_FILTERS = {
|
|
8735
|
-
statuses: [...DEFAULT_STATUS_FILTERS],
|
|
8736
|
-
ownerIds: [],
|
|
8737
|
-
activity: "any"
|
|
8738
|
-
};
|
|
8739
|
-
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
8740
|
-
var workspaceExecRequestSchema = z16.object({
|
|
8741
|
-
command: z16.string().regex(/\S/, "command is required"),
|
|
8742
|
-
timeout_seconds: z16.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
8743
|
-
});
|
|
8744
|
-
var terminalRtcCandidateSchema = z16.object({ type: z16.literal("rtc-candidate"), candidate: z16.string(), mid: z16.string() });
|
|
8745
|
-
var terminalSocketServerMessageSchema = z16.discriminatedUnion("type", [
|
|
8746
|
-
z16.object({ type: z16.literal("output"), data: z16.string() }),
|
|
8747
|
-
z16.object({ type: z16.literal("rtc-answer"), sdp: z16.string() }),
|
|
8748
|
-
terminalRtcCandidateSchema,
|
|
8749
|
-
z16.object({ type: z16.literal("rtc-switch") })
|
|
8750
|
-
]);
|
|
8751
|
-
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
8752
|
-
|
|
8753
8855
|
// ../shared/src/routes/workspace-events.ts
|
|
8754
|
-
import { z as
|
|
8755
|
-
var workspaceChangedEventSchema =
|
|
8756
|
-
|
|
8757
|
-
type:
|
|
8758
|
-
workspaceId:
|
|
8759
|
-
completion:
|
|
8760
|
-
workspaceName:
|
|
8761
|
-
completedAt:
|
|
8762
|
-
processing:
|
|
8856
|
+
import { z as z18 } from "zod";
|
|
8857
|
+
var workspaceChangedEventSchema = z18.discriminatedUnion("type", [
|
|
8858
|
+
z18.object({
|
|
8859
|
+
type: z18.literal("workspace.changed"),
|
|
8860
|
+
workspaceId: z18.string(),
|
|
8861
|
+
completion: z18.object({
|
|
8862
|
+
workspaceName: z18.string(),
|
|
8863
|
+
completedAt: z18.string(),
|
|
8864
|
+
processing: z18.boolean().optional()
|
|
8763
8865
|
}).optional(),
|
|
8764
|
-
ts:
|
|
8866
|
+
ts: z18.string()
|
|
8765
8867
|
}),
|
|
8766
|
-
|
|
8767
|
-
type:
|
|
8768
|
-
workspaceId:
|
|
8769
|
-
chatId:
|
|
8770
|
-
ts:
|
|
8868
|
+
z18.object({
|
|
8869
|
+
type: z18.literal("workspace.chat.changed"),
|
|
8870
|
+
workspaceId: z18.string(),
|
|
8871
|
+
chatId: z18.string(),
|
|
8872
|
+
ts: z18.string()
|
|
8771
8873
|
}),
|
|
8772
|
-
|
|
8773
|
-
|
|
8774
|
-
type:
|
|
8775
|
-
workspaceId:
|
|
8776
|
-
ts:
|
|
8874
|
+
z18.object({ type: z18.literal("presence.changed"), ts: z18.string() }),
|
|
8875
|
+
z18.object({
|
|
8876
|
+
type: z18.literal("mobile-testing.changed"),
|
|
8877
|
+
workspaceId: z18.string(),
|
|
8878
|
+
ts: z18.string()
|
|
8777
8879
|
})
|
|
8778
8880
|
]);
|
|
8779
8881
|
|
|
8780
8882
|
// ../shared/src/routes/presence.ts
|
|
8781
|
-
import { z as
|
|
8782
|
-
var presenceStatusSchema =
|
|
8783
|
-
var presenceLocationSchema =
|
|
8784
|
-
workspaceId:
|
|
8883
|
+
import { z as z19 } from "zod";
|
|
8884
|
+
var presenceStatusSchema = z19.enum(["online", "typing"]);
|
|
8885
|
+
var presenceLocationSchema = z19.object({
|
|
8886
|
+
workspaceId: z19.string().optional()
|
|
8785
8887
|
});
|
|
8786
|
-
var presenceEntrySchema =
|
|
8787
|
-
userId:
|
|
8888
|
+
var presenceEntrySchema = z19.object({
|
|
8889
|
+
userId: z19.string(),
|
|
8788
8890
|
status: presenceStatusSchema,
|
|
8789
8891
|
location: presenceLocationSchema,
|
|
8790
|
-
ts:
|
|
8892
|
+
ts: z19.string()
|
|
8791
8893
|
});
|
|
8792
|
-
var updatePresenceRequestSchema =
|
|
8894
|
+
var updatePresenceRequestSchema = z19.object({
|
|
8793
8895
|
status: presenceStatusSchema,
|
|
8794
8896
|
location: presenceLocationSchema.optional()
|
|
8795
8897
|
});
|
|
@@ -8864,20 +8966,6 @@ function scoreRepoFileMatch(query, filePath) {
|
|
|
8864
8966
|
var WEBHOOK_PROVIDERS = ["linear", "github", "gitlab", "slack", "e2b", "stripe", "sentry"];
|
|
8865
8967
|
var WEBHOOK_PROVIDER_SET = new Set(WEBHOOK_PROVIDERS);
|
|
8866
8968
|
|
|
8867
|
-
// ../shared/src/routes/environment.ts
|
|
8868
|
-
import { z as z19 } from "zod";
|
|
8869
|
-
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
8870
|
-
var stringMap = z19.record(z19.string(), z19.string());
|
|
8871
|
-
var createEnvironmentMcpRequestSchema = z19.object({
|
|
8872
|
-
name: z19.string(),
|
|
8873
|
-
transport: z19.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
8874
|
-
config: z19.union([
|
|
8875
|
-
z19.object({ command: z19.string().min(1), args: z19.array(z19.string()).optional(), env: stringMap.optional() }),
|
|
8876
|
-
z19.object({ url: z19.url(), headers: stringMap.optional(), auth: mcpWorkloadAuthSchema.optional() })
|
|
8877
|
-
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
8878
|
-
});
|
|
8879
|
-
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
8880
|
-
|
|
8881
8969
|
// ../shared/src/workspace-sidebar-state.ts
|
|
8882
8970
|
var FIRST_BOOT_GRACE_MS = 15 * 6e4;
|
|
8883
8971
|
var SLOW_ENGINE_GRACE_MS = 10 * 6e4;
|
|
@@ -9023,12 +9111,12 @@ function normalizeChatTranscriptMetadata(value) {
|
|
|
9023
9111
|
if (!isRecord(value)) return {};
|
|
9024
9112
|
const metadata = {};
|
|
9025
9113
|
const {
|
|
9026
|
-
provider,
|
|
9114
|
+
provider: provider2,
|
|
9027
9115
|
credential,
|
|
9028
9116
|
credentialSource,
|
|
9029
9117
|
environmentAuthMethod,
|
|
9030
|
-
model,
|
|
9031
|
-
title,
|
|
9118
|
+
model: model2,
|
|
9119
|
+
title: title2,
|
|
9032
9120
|
displayName,
|
|
9033
9121
|
createdAt,
|
|
9034
9122
|
updatedAt,
|
|
@@ -9042,14 +9130,14 @@ function normalizeChatTranscriptMetadata(value) {
|
|
|
9042
9130
|
sha256,
|
|
9043
9131
|
fork
|
|
9044
9132
|
} = value;
|
|
9045
|
-
if (typeof
|
|
9133
|
+
if (typeof provider2 === "string" && isValidAgentProvider(provider2)) metadata.provider = provider2;
|
|
9046
9134
|
const parsedCredential = agentCredentialSnapshotSchema.safeParse(credential);
|
|
9047
9135
|
if (parsedCredential.success) metadata.credential = parsedCredential.data;
|
|
9048
9136
|
if (credentialSource === "stored" || credentialSource === "environment") metadata.credentialSource = credentialSource;
|
|
9049
9137
|
const authMethod = Object.values(CREDENTIAL_METHOD).find((method) => method === environmentAuthMethod);
|
|
9050
9138
|
if (authMethod) metadata.environmentAuthMethod = authMethod;
|
|
9051
|
-
if (typeof
|
|
9052
|
-
if (typeof
|
|
9139
|
+
if (typeof model2 === "string") metadata.model = model2;
|
|
9140
|
+
if (typeof title2 === "string") metadata.title = title2;
|
|
9053
9141
|
if (typeof displayName === "string") metadata.displayName = displayName;
|
|
9054
9142
|
if (typeof createdAt === "string") metadata.createdAt = createdAt;
|
|
9055
9143
|
if (typeof updatedAt === "string") metadata.updatedAt = updatedAt;
|
|
@@ -9249,15 +9337,28 @@ export {
|
|
|
9249
9337
|
paginateChatHistory,
|
|
9250
9338
|
coerceBackgroundTaskPayload,
|
|
9251
9339
|
fileContentDiff,
|
|
9340
|
+
skillNamesFromCommand,
|
|
9252
9341
|
areUserMessagesWithinMatchWindow,
|
|
9253
9342
|
isGitHubUrl,
|
|
9254
9343
|
parseCodeHostPrUrl,
|
|
9255
9344
|
decodePathSegments,
|
|
9256
9345
|
buildCodeHostPrUrl,
|
|
9257
9346
|
createUuidFromHex,
|
|
9347
|
+
SUBAGENT_MCP_SERVER_NAME,
|
|
9348
|
+
SUBAGENT_MCP_TOOLS,
|
|
9349
|
+
SUBAGENT_MCP_TOOL_NAMES,
|
|
9350
|
+
WORKSPACE_IDENTITY_AUDIENCE,
|
|
9351
|
+
AWS_SOURCE_IDENTITY_CLAIM,
|
|
9352
|
+
IDENTITY_PROXY_PORT,
|
|
9353
|
+
IDENTITY_TOKEN_PATH,
|
|
9354
|
+
workspaceAudienceSchema,
|
|
9355
|
+
workspaceTokenRequestSchema,
|
|
9356
|
+
workspaceTokenResponseSchema,
|
|
9357
|
+
legacyWorkspaceTokenBundleSchema,
|
|
9258
9358
|
SANDBOX_SKILL_DIRS,
|
|
9259
9359
|
HISTORY_ROOT,
|
|
9260
9360
|
HISTORY_INDEX_FILENAME,
|
|
9361
|
+
TERMINAL_RTC_ICE_SERVER,
|
|
9261
9362
|
REPLICAS_INSTRUCTIONS_TAG,
|
|
9262
9363
|
wrapInTag,
|
|
9263
9364
|
extractErrorText,
|
|
@@ -9322,9 +9423,6 @@ export {
|
|
|
9322
9423
|
resolveWarmHookConfig,
|
|
9323
9424
|
REPLICAS_CONFIG_FILENAMES,
|
|
9324
9425
|
parseReplicasConfigString,
|
|
9325
|
-
SUBAGENT_MCP_SERVER_NAME,
|
|
9326
|
-
SUBAGENT_MCP_TOOLS,
|
|
9327
|
-
SUBAGENT_MCP_TOOL_NAMES,
|
|
9328
9426
|
headlessAgentRequestSchema,
|
|
9329
9427
|
isClaudeAuthErrorText,
|
|
9330
9428
|
isCodexAuthError,
|
|
@@ -9344,18 +9442,9 @@ export {
|
|
|
9344
9442
|
findGitCommitSignals,
|
|
9345
9443
|
findCommandProtectionGitLookups,
|
|
9346
9444
|
shouldRefreshPullRequests,
|
|
9347
|
-
TERMINAL_RTC_ICE_SERVER,
|
|
9348
9445
|
MAX_REPO_FILE_CONTENT_BYTES,
|
|
9349
9446
|
searchRepoFileIndex,
|
|
9350
9447
|
isExcludedRepoFilePath,
|
|
9351
|
-
WORKSPACE_IDENTITY_AUDIENCE,
|
|
9352
|
-
AWS_SOURCE_IDENTITY_CLAIM,
|
|
9353
|
-
IDENTITY_PROXY_PORT,
|
|
9354
|
-
IDENTITY_TOKEN_PATH,
|
|
9355
|
-
workspaceAudienceSchema,
|
|
9356
|
-
workspaceTokenRequestSchema,
|
|
9357
|
-
workspaceTokenResponseSchema,
|
|
9358
|
-
legacyWorkspaceTokenBundleSchema,
|
|
9359
9448
|
readJsonlPage,
|
|
9360
9449
|
normalizeChatTranscriptMetadata,
|
|
9361
9450
|
parseChatTranscriptArtifact,
|