replicas-cli 0.2.813 → 0.2.815
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/index.cjs +11 -104
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7629,13 +7629,6 @@ var SUBAGENT_MCP_HARNESSES = [AGENT.CLAUDE, AGENT.CODEX];
|
|
|
7629
7629
|
function isValidAgentProvider(value) {
|
|
7630
7630
|
return VALID_AGENT_PROVIDERS.some((p) => p === value);
|
|
7631
7631
|
}
|
|
7632
|
-
var LEGACY_RELAY_BASE_PROVIDERS = [AGENT.CLAUDE, AGENT.CODEX, AGENT.OPENCODE, AGENT.PI];
|
|
7633
|
-
function normalizeLegacyChatProvider(provider, relayBaseProvider) {
|
|
7634
|
-
if (provider === "relay") {
|
|
7635
|
-
return LEGACY_RELAY_BASE_PROVIDERS.find((base) => base === relayBaseProvider) ?? AGENT.CLAUDE;
|
|
7636
|
-
}
|
|
7637
|
-
return isValidAgentProvider(provider) ? provider : null;
|
|
7638
|
-
}
|
|
7639
7632
|
var AGENT_PROVIDER_OPTIONS = [
|
|
7640
7633
|
{
|
|
7641
7634
|
value: "claude",
|
|
@@ -22672,7 +22665,7 @@ function getAgentModelOptions(provider, overrides) {
|
|
|
22672
22665
|
if (override?.length) return override;
|
|
22673
22666
|
if (provider === "claude" || provider === "codex") return DEFAULT_STATIC_AGENT_MODELS[provider];
|
|
22674
22667
|
if (provider === "cursor") return DEFAULT_CURSOR_MODELS;
|
|
22675
|
-
return AGENT_MODELS[provider];
|
|
22668
|
+
return AGENT_MODELS[provider] ?? [];
|
|
22676
22669
|
}
|
|
22677
22670
|
var SANDBOX_IMAGE_MODEL_FALLBACKS = {
|
|
22678
22671
|
[CLAUDE_OPUS_5_5_MODEL]: CLAUDE_OPUS_5_MODEL,
|
|
@@ -22796,7 +22789,7 @@ var quotaLimitKindSchema = external_exports.enum(["rate_limit", "out_of_credits"
|
|
|
22796
22789
|
var chatForkInfoSchema = external_exports.object({
|
|
22797
22790
|
source: external_exports.object({
|
|
22798
22791
|
chatId: external_exports.string().min(1),
|
|
22799
|
-
provider: external_exports.
|
|
22792
|
+
provider: external_exports.enum(VALID_AGENT_PROVIDERS),
|
|
22800
22793
|
title: external_exports.string()
|
|
22801
22794
|
}),
|
|
22802
22795
|
trigger: external_exports.enum(["manual", "auto", "side"]),
|
|
@@ -27066,19 +27059,6 @@ var TaskAccumulator = class {
|
|
|
27066
27059
|
}
|
|
27067
27060
|
};
|
|
27068
27061
|
|
|
27069
|
-
// ../shared/src/display-message/parsers/mcp.ts
|
|
27070
|
-
function parseMcpToolName(name) {
|
|
27071
|
-
const prefix = "mcp__";
|
|
27072
|
-
if (!name.startsWith(prefix)) return null;
|
|
27073
|
-
const rest = name.slice(prefix.length);
|
|
27074
|
-
const sep = rest.indexOf("__");
|
|
27075
|
-
if (sep <= 0) return null;
|
|
27076
|
-
const server = rest.slice(0, sep);
|
|
27077
|
-
const tool = rest.slice(sep + 2);
|
|
27078
|
-
if (!server || !tool) return null;
|
|
27079
|
-
return { server, tool };
|
|
27080
|
-
}
|
|
27081
|
-
|
|
27082
27062
|
// ../shared/src/display-message/parsers/claude-parser.ts
|
|
27083
27063
|
var ABORTED_TERMINAL_REASONS = /* @__PURE__ */ new Set(["aborted_streaming", "aborted_tools"]);
|
|
27084
27064
|
var COMMAND_TOOL_NAMES = /* @__PURE__ */ new Set(["Bash", "bash", "shell"]);
|
|
@@ -27428,48 +27408,6 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27428
27408
|
status: "in_progress",
|
|
27429
27409
|
timestamp: event.timestamp
|
|
27430
27410
|
});
|
|
27431
|
-
} else if (toolName === "mcp__relay-subagent-tools__spawn_agent") {
|
|
27432
|
-
const inputObj = typeof toolInput === "string" ? safeJsonParse(toolInput, {}) : toolInput;
|
|
27433
|
-
const provider = typeof inputObj.provider === "string" ? inputObj.provider : "unknown";
|
|
27434
|
-
const prompt = typeof inputObj.prompt === "string" ? inputObj.prompt : "";
|
|
27435
|
-
const model = typeof inputObj.model === "string" ? inputObj.model : void 0;
|
|
27436
|
-
const title = typeof inputObj.title === "string" ? inputObj.title : void 0;
|
|
27437
|
-
messages.push(createSubagentMessage(messages.length, event.timestamp, {
|
|
27438
|
-
toolUseId,
|
|
27439
|
-
description: title || `Relay subagent (${provider})`,
|
|
27440
|
-
prompt,
|
|
27441
|
-
subagentType: provider,
|
|
27442
|
-
model,
|
|
27443
|
-
thinkingLevel: isValidThinkingLevel(inputObj.thinking_level) ? inputObj.thinking_level : void 0,
|
|
27444
|
-
status: "in_progress",
|
|
27445
|
-
nestedEvents: [],
|
|
27446
|
-
isChatBased: true
|
|
27447
|
-
}));
|
|
27448
|
-
} else if (toolName === "mcp__relay-subagent-tools__message_agent") {
|
|
27449
|
-
const inputObj = typeof toolInput === "string" ? safeJsonParse(toolInput, {}) : toolInput;
|
|
27450
|
-
messages.push({
|
|
27451
|
-
id: `subagent-followup-${event.timestamp}-${messages.length}`,
|
|
27452
|
-
type: "subagent_followup",
|
|
27453
|
-
toolUseId,
|
|
27454
|
-
chatId: typeof inputObj.chatId === "string" ? inputObj.chatId : "",
|
|
27455
|
-
message: typeof inputObj.message === "string" ? inputObj.message : "",
|
|
27456
|
-
model: typeof inputObj.model === "string" ? inputObj.model : void 0,
|
|
27457
|
-
thinkingLevel: isValidThinkingLevel(inputObj.thinking_level) ? inputObj.thinking_level : void 0,
|
|
27458
|
-
status: "in_progress",
|
|
27459
|
-
timestamp: event.timestamp
|
|
27460
|
-
});
|
|
27461
|
-
} else if (toolName === "mcp__relay-subagent-tools__delete_agent") {
|
|
27462
|
-
const inputObj = typeof toolInput === "string" ? safeJsonParse(toolInput, {}) : toolInput;
|
|
27463
|
-
const mcp = parseMcpToolName(toolName);
|
|
27464
|
-
messages.push({
|
|
27465
|
-
id: `toolcall-${event.timestamp}-${messages.length}`,
|
|
27466
|
-
type: "tool_call",
|
|
27467
|
-
server: mcp?.server ?? "relay-subagent-tools",
|
|
27468
|
-
tool: mcp?.tool ?? "delete_agent",
|
|
27469
|
-
input: inputObj,
|
|
27470
|
-
status: "in_progress",
|
|
27471
|
-
timestamp: event.timestamp
|
|
27472
|
-
});
|
|
27473
27411
|
} else {
|
|
27474
27412
|
messages.push({
|
|
27475
27413
|
id: `toolcall-${event.timestamp}-${messages.length}`,
|
|
@@ -27631,15 +27569,6 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27631
27569
|
} else if (message.type === "subagent") {
|
|
27632
27570
|
message.output = resultContent;
|
|
27633
27571
|
message.status = status;
|
|
27634
|
-
if (!message.chatId && resultContent) {
|
|
27635
|
-
const parsed = safeJsonParse(resultContent, {});
|
|
27636
|
-
if (parsed.chatId) {
|
|
27637
|
-
message.chatId = parsed.chatId;
|
|
27638
|
-
}
|
|
27639
|
-
}
|
|
27640
|
-
} else if (message.type === "subagent_followup") {
|
|
27641
|
-
message.output = resultContent;
|
|
27642
|
-
message.status = status;
|
|
27643
27572
|
}
|
|
27644
27573
|
});
|
|
27645
27574
|
for (const message of messages) {
|
|
@@ -27652,12 +27581,6 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
27652
27581
|
message.subagentType ?? (message.subagentType = toolMessage.subagentType);
|
|
27653
27582
|
}
|
|
27654
27583
|
}
|
|
27655
|
-
if (message.type !== "subagent_followup") continue;
|
|
27656
|
-
const target = messages.find((candidate) => candidate.type === "subagent" && candidate.chatId === message.chatId);
|
|
27657
|
-
if (target?.type === "subagent") {
|
|
27658
|
-
message.targetTitle = target.description;
|
|
27659
|
-
message.targetProvider = target.subagentType;
|
|
27660
|
-
}
|
|
27661
27584
|
}
|
|
27662
27585
|
const staleIndexes = new Set(supersededUserMessageIndexes);
|
|
27663
27586
|
for (const streamId of [...completedStreamIds, ...supersededStreamIds]) {
|
|
@@ -28096,7 +28019,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
28096
28019
|
});
|
|
28097
28020
|
|
|
28098
28021
|
// ../shared/src/cli-version.ts
|
|
28099
|
-
var CLI_VERSION = "0.2.
|
|
28022
|
+
var CLI_VERSION = "0.2.815";
|
|
28100
28023
|
|
|
28101
28024
|
// ../shared/src/version.ts
|
|
28102
28025
|
function compareVersions(v1, v2) {
|
|
@@ -30932,14 +30855,6 @@ function formatDisplayMessage(message) {
|
|
|
30932
30855
|
console.log(import_chalk16.default.gray(` ${truncate(message.output, 200)}`));
|
|
30933
30856
|
}
|
|
30934
30857
|
break;
|
|
30935
|
-
case "subagent_followup":
|
|
30936
|
-
console.log(import_chalk16.default.magenta(`
|
|
30937
|
-
[${time3}] MESSAGE SUBAGENT: ${message.targetTitle ?? message.chatId}`));
|
|
30938
|
-
console.log(import_chalk16.default.white(` ${truncate(message.message, 500)}`));
|
|
30939
|
-
if (message.output) {
|
|
30940
|
-
console.log(import_chalk16.default.gray(` ${truncate(message.output, 200)}`));
|
|
30941
|
-
}
|
|
30942
|
-
break;
|
|
30943
30858
|
case "error":
|
|
30944
30859
|
console.log(import_chalk16.default.red(`
|
|
30945
30860
|
[${time3}] ERROR:`));
|
|
@@ -31005,18 +30920,14 @@ Replica: ${replica.name}
|
|
|
31005
30920
|
}
|
|
31006
30921
|
console.log(import_chalk16.default.gray(` Status: ${formatStatus(replica.status)}`));
|
|
31007
30922
|
console.log(import_chalk16.default.gray(` Created: ${formatDate(replica.created_at)}`));
|
|
31008
|
-
if (replica.
|
|
31009
|
-
console.log(import_chalk16.default.
|
|
31010
|
-
}
|
|
31011
|
-
|
|
31012
|
-
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
console.log(import_chalk16.default.gray(
|
|
31016
|
-
for (const repositoryStatus of replica.repository_statuses) {
|
|
31017
|
-
const changeText = repositoryStatus.git_diff ? ` (${import_chalk16.default.green(`+${repositoryStatus.git_diff.added}`)} / ${import_chalk16.default.red(`-${repositoryStatus.git_diff.removed}`)})` : "";
|
|
31018
|
-
console.log(import_chalk16.default.gray(` - ${repositoryStatus.repository}: ${repositoryStatus.branch || "unknown"}${changeText}`));
|
|
31019
|
-
}
|
|
30923
|
+
if (replica.coding_agent) {
|
|
30924
|
+
console.log(import_chalk16.default.gray(` Coding Agent: ${replica.coding_agent}`));
|
|
30925
|
+
}
|
|
30926
|
+
if (replica.repository_statuses && replica.repository_statuses.length > 0) {
|
|
30927
|
+
console.log(import_chalk16.default.gray(" Repository Statuses:"));
|
|
30928
|
+
for (const repositoryStatus of replica.repository_statuses) {
|
|
30929
|
+
const changeText = repositoryStatus.git_diff ? ` (${import_chalk16.default.green(`+${repositoryStatus.git_diff.added}`)} / ${import_chalk16.default.red(`-${repositoryStatus.git_diff.removed}`)})` : "";
|
|
30930
|
+
console.log(import_chalk16.default.gray(` - ${repositoryStatus.repository}: ${repositoryStatus.branch || "unknown"}${changeText}`));
|
|
31020
30931
|
}
|
|
31021
30932
|
}
|
|
31022
30933
|
if (replica.pull_requests && replica.pull_requests.length > 0) {
|
|
@@ -31224,10 +31135,6 @@ async function replicaReadCommand(id, options) {
|
|
|
31224
31135
|
const response = await orgAuthenticatedFetch(
|
|
31225
31136
|
`/v1/replica/${id}/read${query ? "?" + query : ""}`
|
|
31226
31137
|
);
|
|
31227
|
-
if (response.waking) {
|
|
31228
|
-
console.log(import_chalk16.default.yellow("\nWorkspace is waking from sleep. Retry in 30-90 seconds.\n"));
|
|
31229
|
-
return;
|
|
31230
|
-
}
|
|
31231
31138
|
console.log(import_chalk16.default.green(`
|
|
31232
31139
|
Conversation History
|
|
31233
31140
|
`));
|