replicas-cli 0.2.770 → 0.2.772
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 +26 -10
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23592,6 +23592,15 @@ function insertDisplayMessageByTimestamp(messages, message) {
|
|
|
23592
23592
|
}
|
|
23593
23593
|
|
|
23594
23594
|
// ../shared/src/display-message/format.ts
|
|
23595
|
+
function fileContentDiff(path7, content, action) {
|
|
23596
|
+
const lines = content.replace(/\n$/, "").split("\n");
|
|
23597
|
+
return [
|
|
23598
|
+
`--- ${action === "add" ? "/dev/null" : `a/${path7}`}`,
|
|
23599
|
+
`+++ ${action === "add" ? `b/${path7}` : "/dev/null"}`,
|
|
23600
|
+
action === "add" ? `@@ -0,0 +1,${lines.length} @@` : `@@ -1,${lines.length} +0,0 @@`,
|
|
23601
|
+
...lines.map((line) => `${action === "add" ? "+" : "-"}${line}`)
|
|
23602
|
+
].join("\n");
|
|
23603
|
+
}
|
|
23595
23604
|
var SCRIPT_ROOT = "/";
|
|
23596
23605
|
var commandName = (argv) => argv[0].split("/").pop() ?? argv[0];
|
|
23597
23606
|
var fileWrites = ({ writes }) => writes.filter(({ path: path7 }) => path7 !== "/dev/null");
|
|
@@ -27049,21 +27058,21 @@ function fileOrCommandMessage(toolName, toolUseId, input, timestamp) {
|
|
|
27049
27058
|
if (toolName === "Edit" && typeof input.old_string === "string" && typeof input.new_string === "string") {
|
|
27050
27059
|
const oldLines = input.old_string.replace(/\n$/, "").split("\n");
|
|
27051
27060
|
const newLines = input.new_string.replace(/\n$/, "").split("\n");
|
|
27061
|
+
let head = 0;
|
|
27062
|
+
while (head < oldLines.length && head < newLines.length && oldLines[head] === newLines[head]) head++;
|
|
27063
|
+
let tail = 0;
|
|
27064
|
+
while (tail < oldLines.length - head && tail < newLines.length - head && oldLines[oldLines.length - 1 - tail] === newLines[newLines.length - 1 - tail]) tail++;
|
|
27052
27065
|
diff = [
|
|
27053
27066
|
`--- a/${filePath}`,
|
|
27054
27067
|
`+++ b/${filePath}`,
|
|
27055
27068
|
`@@ -1,${oldLines.length} +1,${newLines.length} @@`,
|
|
27056
|
-
...oldLines.map((l) =>
|
|
27057
|
-
...
|
|
27069
|
+
...oldLines.slice(0, head).map((l) => ` ${l}`),
|
|
27070
|
+
...oldLines.slice(head, oldLines.length - tail).map((l) => `-${l}`),
|
|
27071
|
+
...newLines.slice(head, newLines.length - tail).map((l) => `+${l}`),
|
|
27072
|
+
...oldLines.slice(oldLines.length - tail).map((l) => ` ${l}`)
|
|
27058
27073
|
].join("\n");
|
|
27059
27074
|
} else if (toolName === "Write" && typeof input.content === "string") {
|
|
27060
|
-
|
|
27061
|
-
diff = [
|
|
27062
|
-
`--- /dev/null`,
|
|
27063
|
-
`+++ b/${filePath}`,
|
|
27064
|
-
`@@ -0,0 +1,${newLines.length} @@`,
|
|
27065
|
-
...newLines.map((l) => `+${l}`)
|
|
27066
|
-
].join("\n");
|
|
27075
|
+
diff = fileContentDiff(filePath, input.content, "add");
|
|
27067
27076
|
}
|
|
27068
27077
|
return {
|
|
27069
27078
|
id: `patch-${toolUseId}`,
|
|
@@ -27954,7 +27963,7 @@ var headlessAgentRequestSchema = external_exports.object({
|
|
|
27954
27963
|
});
|
|
27955
27964
|
|
|
27956
27965
|
// ../shared/src/cli-version.ts
|
|
27957
|
-
var CLI_VERSION = "0.2.
|
|
27966
|
+
var CLI_VERSION = "0.2.772";
|
|
27958
27967
|
|
|
27959
27968
|
// ../shared/src/version.ts
|
|
27960
27969
|
function compareVersions(v1, v2) {
|
|
@@ -28377,6 +28386,13 @@ var DEFAULT_WORKSPACE_FILTERS = {
|
|
|
28377
28386
|
activity: "any"
|
|
28378
28387
|
};
|
|
28379
28388
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
28389
|
+
var terminalRtcCandidateSchema = external_exports.object({ type: external_exports.literal("rtc-candidate"), candidate: external_exports.string(), mid: external_exports.string() });
|
|
28390
|
+
var terminalSocketServerMessageSchema = external_exports.discriminatedUnion("type", [
|
|
28391
|
+
external_exports.object({ type: external_exports.literal("output"), data: external_exports.string() }),
|
|
28392
|
+
external_exports.object({ type: external_exports.literal("rtc-answer"), sdp: external_exports.string() }),
|
|
28393
|
+
terminalRtcCandidateSchema,
|
|
28394
|
+
external_exports.object({ type: external_exports.literal("rtc-switch") })
|
|
28395
|
+
]);
|
|
28380
28396
|
|
|
28381
28397
|
// ../shared/src/routes/workspace-events.ts
|
|
28382
28398
|
var workspaceChangedEventSchema = external_exports.discriminatedUnion("type", [
|