replicas-cli 0.2.72 → 0.2.74
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.
|
@@ -7527,7 +7527,8 @@ var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml
|
|
|
7527
7527
|
// ../shared/src/engine/types.ts
|
|
7528
7528
|
var DEFAULT_CHAT_TITLES = {
|
|
7529
7529
|
claude: "Claude Code",
|
|
7530
|
-
codex: "Codex"
|
|
7530
|
+
codex: "Codex",
|
|
7531
|
+
relay: "Relay"
|
|
7531
7532
|
};
|
|
7532
7533
|
function getInitialChatId(chats, preferredProvider = "claude") {
|
|
7533
7534
|
if (chats.length === 0) return null;
|
|
@@ -7938,6 +7939,20 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
7938
7939
|
status: "in_progress",
|
|
7939
7940
|
timestamp: event.timestamp
|
|
7940
7941
|
});
|
|
7942
|
+
} else if (toolName === "mcp__relay-subagent-tools__spawn_agent") {
|
|
7943
|
+
const inputObj = typeof toolInput === "string" ? safeJsonParse2(toolInput, {}) : toolInput;
|
|
7944
|
+
messages.push({
|
|
7945
|
+
id: `subagent-${event.timestamp}-${messages.length}`,
|
|
7946
|
+
type: "subagent",
|
|
7947
|
+
toolUseId,
|
|
7948
|
+
description: inputObj.title || `Relay subagent (${inputObj.provider || "unknown"})`,
|
|
7949
|
+
prompt: inputObj.prompt || "",
|
|
7950
|
+
subagentType: inputObj.provider || "unknown",
|
|
7951
|
+
model: inputObj.model,
|
|
7952
|
+
status: "in_progress",
|
|
7953
|
+
nestedEvents: [],
|
|
7954
|
+
timestamp: event.timestamp
|
|
7955
|
+
});
|
|
7941
7956
|
} else {
|
|
7942
7957
|
messages.push({
|
|
7943
7958
|
id: `toolcall-${event.timestamp}-${messages.length}`,
|
|
@@ -7999,6 +8014,12 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
7999
8014
|
} else if (message.type === "subagent") {
|
|
8000
8015
|
message.output = resultContent;
|
|
8001
8016
|
message.status = status;
|
|
8017
|
+
if (!message.chatId && resultContent) {
|
|
8018
|
+
const parsed = safeJsonParse2(resultContent, {});
|
|
8019
|
+
if (parsed.chatId) {
|
|
8020
|
+
message.chatId = parsed.chatId;
|
|
8021
|
+
}
|
|
8022
|
+
}
|
|
8002
8023
|
}
|
|
8003
8024
|
}
|
|
8004
8025
|
}
|
|
@@ -8011,10 +8032,8 @@ var INTERRUPTED_MESSAGE_REGEX = /^\[Request interrupted by user.*\]$/;
|
|
|
8011
8032
|
function parseAgentEvents(events, agentType) {
|
|
8012
8033
|
if (agentType === "codex") {
|
|
8013
8034
|
return parseCodexEvents(events);
|
|
8014
|
-
} else if (agentType === "claude") {
|
|
8015
|
-
return parseClaudeEvents(events);
|
|
8016
8035
|
}
|
|
8017
|
-
return
|
|
8036
|
+
return parseClaudeEvents(events);
|
|
8018
8037
|
}
|
|
8019
8038
|
function createUserMessage(content) {
|
|
8020
8039
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
@@ -8484,9 +8503,44 @@ function parseLinearIssue(content) {
|
|
|
8484
8503
|
issueUrl: issueUrlMatch?.[1]?.trim()
|
|
8485
8504
|
};
|
|
8486
8505
|
}
|
|
8506
|
+
function safeHttpsUrl(raw) {
|
|
8507
|
+
if (!raw) return void 0;
|
|
8508
|
+
const trimmed = raw.trim();
|
|
8509
|
+
return trimmed.startsWith("https://") ? trimmed : void 0;
|
|
8510
|
+
}
|
|
8511
|
+
function parseAutomationTriggered(content) {
|
|
8512
|
+
if (!content.startsWith("# Automation Triggered")) return null;
|
|
8513
|
+
const nameMatch = content.match(/\*\*Automation Name:\*\*\s*(.+)/);
|
|
8514
|
+
if (!nameMatch) return null;
|
|
8515
|
+
const triggerTypeMatch = content.match(/\*\*Trigger Type:\*\*\s*(.+)/);
|
|
8516
|
+
const triggeredAtMatch = content.match(/\*\*Triggered At:\*\*\s*(.+)/);
|
|
8517
|
+
const eventMatch = content.match(/\*\*Event:\*\*\s*(.+)/);
|
|
8518
|
+
const repoMatch = content.match(/\*\*Repository:\*\*\s*(.+)/);
|
|
8519
|
+
const repoUrlMatch = content.match(/\*\*Repository URL:\*\*\s*(.+)/);
|
|
8520
|
+
const prNumberMatch = content.match(/\*\*PR Number:\*\*\s*(.+)/);
|
|
8521
|
+
const prUrlMatch = content.match(/\*\*PR URL:\*\*\s*(.+)/);
|
|
8522
|
+
const triggeredByMatch = content.match(/\*\*Triggered By:\*\*\s*@?(.+)/);
|
|
8523
|
+
const triggeredByUrlMatch = content.match(/\*\*Triggered By URL:\*\*\s*(.+)/);
|
|
8524
|
+
const promptMatch = content.match(/## Automation Prompt\n([\s\S]*)$/);
|
|
8525
|
+
const parsedPrNumber = prNumberMatch ? parseInt(prNumberMatch[1].trim(), 10) : NaN;
|
|
8526
|
+
return {
|
|
8527
|
+
source: "automation_triggered",
|
|
8528
|
+
automationName: nameMatch[1].trim(),
|
|
8529
|
+
triggerType: triggerTypeMatch?.[1]?.trim() ?? "unknown",
|
|
8530
|
+
triggeredAt: triggeredAtMatch?.[1]?.trim() ?? "",
|
|
8531
|
+
event: eventMatch?.[1]?.trim(),
|
|
8532
|
+
repositoryName: repoMatch?.[1]?.trim(),
|
|
8533
|
+
repositoryUrl: safeHttpsUrl(repoUrlMatch?.[1]),
|
|
8534
|
+
prNumber: isNaN(parsedPrNumber) ? void 0 : parsedPrNumber,
|
|
8535
|
+
prUrl: safeHttpsUrl(prUrlMatch?.[1]),
|
|
8536
|
+
triggeredBy: triggeredByMatch?.[1]?.trim(),
|
|
8537
|
+
triggeredByUrl: safeHttpsUrl(triggeredByUrlMatch?.[1]),
|
|
8538
|
+
userPrompt: promptMatch?.[1]?.trim() ?? ""
|
|
8539
|
+
};
|
|
8540
|
+
}
|
|
8487
8541
|
function parseUserMessage(rawContent) {
|
|
8488
8542
|
const content = removeReplicasInstructions(rawContent).trim();
|
|
8489
|
-
return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? { source: "raw", content };
|
|
8543
|
+
return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? parseAutomationTriggered(content) ?? { source: "raw", content };
|
|
8490
8544
|
}
|
|
8491
8545
|
|
|
8492
8546
|
// ../shared/src/user-message-parser/source-config.ts
|
|
@@ -8499,7 +8553,8 @@ var SOURCE_CONFIG = {
|
|
|
8499
8553
|
github_pr_existing_review: { label: "Code Review", color: "#8b949e" },
|
|
8500
8554
|
github_pr_existing_pr_review: { label: "PR Review", color: "#8b949e" },
|
|
8501
8555
|
github_pr_existing_general: { label: "GitHub PR", color: "#8b949e" },
|
|
8502
|
-
slack_task: { label: "Slack", color: "#BF6CC2" }
|
|
8556
|
+
slack_task: { label: "Slack", color: "#BF6CC2" },
|
|
8557
|
+
automation_triggered: { label: "Automation", color: "#f59e0b" }
|
|
8503
8558
|
};
|
|
8504
8559
|
|
|
8505
8560
|
export {
|
package/dist/index.mjs
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
setIdeCommand,
|
|
16
16
|
setOrganizationId,
|
|
17
17
|
writeConfig
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-H2KYINFB.mjs";
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
import "dotenv/config";
|
|
@@ -2509,12 +2509,12 @@ async function interactiveCommand() {
|
|
|
2509
2509
|
);
|
|
2510
2510
|
}
|
|
2511
2511
|
console.log(chalk18.gray("Starting interactive mode..."));
|
|
2512
|
-
const { launchInteractive } = await import("./interactive-
|
|
2512
|
+
const { launchInteractive } = await import("./interactive-GC2T2TVX.mjs");
|
|
2513
2513
|
await launchInteractive();
|
|
2514
2514
|
}
|
|
2515
2515
|
|
|
2516
2516
|
// src/index.ts
|
|
2517
|
-
var CLI_VERSION = "0.2.
|
|
2517
|
+
var CLI_VERSION = "0.2.74";
|
|
2518
2518
|
var program = new Command();
|
|
2519
2519
|
program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
|
|
2520
2520
|
program.command("login").description("Authenticate with your Replicas account").action(async () => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
isAgentBackendEvent,
|
|
12
12
|
parseAgentEvents,
|
|
13
13
|
parseUserMessage
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-H2KYINFB.mjs";
|
|
15
15
|
|
|
16
16
|
// src/interactive/index.tsx
|
|
17
17
|
import { createCliRenderer } from "@opentui/core";
|
|
@@ -320,10 +320,12 @@ function useWorkspaceEvents(workspaceId, enabled = true) {
|
|
|
320
320
|
if (!workspaceId) return;
|
|
321
321
|
const chatsKey = ["workspace-chats", workspaceId];
|
|
322
322
|
if (event.type === "chat.created" || event.type === "chat.updated") {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
if (event.payload.chat.parentChatId === null) {
|
|
324
|
+
qc.setQueryData(chatsKey, (current) => {
|
|
325
|
+
if (!current) return { chats: [event.payload.chat] };
|
|
326
|
+
return { chats: upsertChat(current.chats, event.payload.chat) };
|
|
327
|
+
});
|
|
328
|
+
}
|
|
327
329
|
return;
|
|
328
330
|
}
|
|
329
331
|
if (event.type === "chat.deleted") {
|