replicas-cli 0.2.245 → 0.2.247
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.mjs +14 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9157,7 +9157,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
|
|
|
9157
9157
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
9158
9158
|
|
|
9159
9159
|
// ../shared/src/cli-version.ts
|
|
9160
|
-
var CLI_VERSION = "0.2.
|
|
9160
|
+
var CLI_VERSION = "0.2.247";
|
|
9161
9161
|
|
|
9162
9162
|
// ../shared/src/engine/environment.ts
|
|
9163
9163
|
var DESKTOP_NOVNC_PORT = 6080;
|
|
@@ -9691,6 +9691,12 @@ function extractToolResultText(content, separator = "\n") {
|
|
|
9691
9691
|
}
|
|
9692
9692
|
return texts.join(separator);
|
|
9693
9693
|
}
|
|
9694
|
+
function normalizeContentBlocks(content) {
|
|
9695
|
+
if (typeof content === "string") {
|
|
9696
|
+
return content ? [{ type: "text", text: content }] : [];
|
|
9697
|
+
}
|
|
9698
|
+
return content ?? [];
|
|
9699
|
+
}
|
|
9694
9700
|
function parseStringField(value) {
|
|
9695
9701
|
if (typeof value !== "string") return null;
|
|
9696
9702
|
const trimmed = value.trim();
|
|
@@ -9801,6 +9807,7 @@ function parseMcpToolName(name) {
|
|
|
9801
9807
|
}
|
|
9802
9808
|
|
|
9803
9809
|
// ../shared/src/display-message/parsers/claude-parser.ts
|
|
9810
|
+
var LOCAL_COMMAND_ECHO_REGEX = /^<(?:command-name|command-message|local-command-stdout|local-command-stderr)>/;
|
|
9804
9811
|
function parseClaudeEvents(events, parentToolUseId) {
|
|
9805
9812
|
const messages = [];
|
|
9806
9813
|
const filterValue = parentToolUseId !== void 0 ? parentToolUseId : null;
|
|
@@ -9818,7 +9825,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
9818
9825
|
}));
|
|
9819
9826
|
filteredEvents.forEach((event) => {
|
|
9820
9827
|
if (event.type === "claude-user") {
|
|
9821
|
-
const content = event.payload.message?.content
|
|
9828
|
+
const content = normalizeContentBlocks(event.payload.message?.content);
|
|
9822
9829
|
const toolResult = content.find((c) => c.type === "tool_result");
|
|
9823
9830
|
if (toolResult && toolResult.tool_use_id) {
|
|
9824
9831
|
if (!toolResult.is_error) {
|
|
@@ -9830,6 +9837,9 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
9830
9837
|
return;
|
|
9831
9838
|
}
|
|
9832
9839
|
const textContent = content.filter((c) => c.type === "text").map((c) => c.text || "").join("\n");
|
|
9840
|
+
if (LOCAL_COMMAND_ECHO_REGEX.test(textContent.trim())) {
|
|
9841
|
+
return;
|
|
9842
|
+
}
|
|
9833
9843
|
const images = content.filter((c) => c.type === "image" && c.source).map((c) => {
|
|
9834
9844
|
const source = c.source;
|
|
9835
9845
|
return {
|
|
@@ -9849,7 +9859,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
9849
9859
|
}
|
|
9850
9860
|
}
|
|
9851
9861
|
if (event.type === "claude-assistant") {
|
|
9852
|
-
const contentBlocks = event.payload.message?.content
|
|
9862
|
+
const contentBlocks = normalizeContentBlocks(event.payload.message?.content);
|
|
9853
9863
|
contentBlocks.forEach((block) => {
|
|
9854
9864
|
if (block.type === "text" && block.text) {
|
|
9855
9865
|
messages.push({
|
|
@@ -10094,7 +10104,7 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
10094
10104
|
});
|
|
10095
10105
|
filteredEvents.forEach((event) => {
|
|
10096
10106
|
if (event.type === "claude-user") {
|
|
10097
|
-
const content = event.payload.message?.content
|
|
10107
|
+
const content = normalizeContentBlocks(event.payload.message?.content);
|
|
10098
10108
|
const toolResult = content.find((c) => c.type === "tool_result");
|
|
10099
10109
|
if (toolResult && toolResult.tool_use_id) {
|
|
10100
10110
|
const toolInfo = toolCallMap.get(toolResult.tool_use_id);
|