omnius 1.0.241 → 1.0.242
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.js +33 -3
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6469,7 +6469,7 @@ var init_file_write = __esm({
|
|
|
6469
6469
|
});
|
|
6470
6470
|
return {
|
|
6471
6471
|
success: true,
|
|
6472
|
-
output:
|
|
6472
|
+
output: isNew ? `Created ${content.length} bytes at ${fullPath} (sha256 ${newHash})` : `Overwrote ${content.length} bytes at ${fullPath} (sha256 ${beforeHash ?? "?"} → ${newHash})`,
|
|
6473
6473
|
durationMs: performance.now() - start2,
|
|
6474
6474
|
mutated: true,
|
|
6475
6475
|
mutatedFiles: [filePath],
|
|
@@ -591473,12 +591473,41 @@ function buildToolResultBody(toolName, success, output, verbose) {
|
|
|
591473
591473
|
if (!success) {
|
|
591474
591474
|
return [{ text: extractFirstLine(output, Number.MAX_SAFE_INTEGER), mode: "wrap", kind: "error" }];
|
|
591475
591475
|
}
|
|
591476
|
-
|
|
591476
|
+
const firstNewline = output.indexOf("\n");
|
|
591477
|
+
const body = firstNewline >= 0 ? diffBodyLines(output.slice(firstNewline + 1), verbose) : diffBodyLines(output, verbose);
|
|
591478
|
+
const shaHeader = firstNewline >= 0 ? output.slice(0, firstNewline) : output;
|
|
591479
|
+
const shaMatch = shaHeader.match(/^(Edited\s+\S+)\s+at\s+(.+?)\s+\(sha256\s+(\S+)/);
|
|
591480
|
+
if (shaMatch) {
|
|
591481
|
+
body.unshift({
|
|
591482
|
+
text: c3.dim(`${shaMatch[1]} — ${shaMatch[2]} · sha256 ${shaMatch[3].slice(0, 12)}…`),
|
|
591483
|
+
mode: "wrap",
|
|
591484
|
+
kind: "plain"
|
|
591485
|
+
});
|
|
591486
|
+
}
|
|
591487
|
+
return body;
|
|
591477
591488
|
}
|
|
591478
591489
|
if (toolName === "file_write") {
|
|
591479
591490
|
if (!success) {
|
|
591480
591491
|
return [{ text: extractFirstLine(output, Number.MAX_SAFE_INTEGER), mode: "wrap", kind: "error" }];
|
|
591481
591492
|
}
|
|
591493
|
+
const createdMatch = output.match(/^Created\s+(\d+)\s+bytes\s+at\s+(.+?)\s+\(sha256\s+(\S+)\)/);
|
|
591494
|
+
const overwroteMatch = output.match(/^Overwrote\s+(\d+)\s+bytes\s+at\s+(.+?)\s+\(sha256\s+(\S+)\s*→\s*(\S+)\)/);
|
|
591495
|
+
if (createdMatch) {
|
|
591496
|
+
const [, bytes, filePath, hash] = createdMatch;
|
|
591497
|
+
return [{
|
|
591498
|
+
text: c3.dim(`Created ${filePath} — ${Number(bytes).toLocaleString()}B · sha256 ${hash.slice(0, 12)}…`),
|
|
591499
|
+
mode: "wrap",
|
|
591500
|
+
kind: "plain"
|
|
591501
|
+
}];
|
|
591502
|
+
}
|
|
591503
|
+
if (overwroteMatch) {
|
|
591504
|
+
const [, bytes, filePath, oldHash, newHash] = overwroteMatch;
|
|
591505
|
+
return [{
|
|
591506
|
+
text: c3.dim(`Overwrote ${filePath} — ${Number(bytes).toLocaleString()}B · sha256 ${oldHash.slice(0, 12)}… → ${newHash.slice(0, 12)}…`),
|
|
591507
|
+
mode: "wrap",
|
|
591508
|
+
kind: "plain"
|
|
591509
|
+
}];
|
|
591510
|
+
}
|
|
591482
591511
|
const writeLines = output.split("\n").filter((l2) => l2.trim());
|
|
591483
591512
|
if (writeLines.length === 0) {
|
|
591484
591513
|
return [{ text: "Done", mode: "wrap", kind: "success" }];
|
|
@@ -591573,7 +591602,8 @@ function codePreviewLines(output, maxLines) {
|
|
|
591573
591602
|
const body = shown.map((line) => ({
|
|
591574
591603
|
text: line,
|
|
591575
591604
|
mode: "truncate",
|
|
591576
|
-
kind: "
|
|
591605
|
+
kind: "plain"
|
|
591606
|
+
// show content in default terminal color, not dim
|
|
591577
591607
|
}));
|
|
591578
591608
|
const remaining = lines.length - start2 - shown.length;
|
|
591579
591609
|
if (remaining > 0) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "omnius",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.242",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "omnius",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.242",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"image-to-ascii"
|
|
12
12
|
],
|
package/package.json
CHANGED