@nervekit/desktop 0.40.1 → 0.40.2
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/THIRD-PARTY-LICENSES.txt +7 -29
- package/dist/{chunk-KSZJ3HGD.js → chunk-2BKMOJYJ.js} +1 -1
- package/dist/{chunk-4MMJDHFX.js → chunk-3JJN36GV.js} +70 -71
- package/dist/{chunk-2Z5FLMLE.js → chunk-3SSNDIQT.js} +1 -1
- package/dist/{chunk-CKVFGRVV.js → chunk-3VZR3ZUY.js} +54 -7
- package/dist/{chunk-BXVRC3HF.js → chunk-4H3WR7IT.js} +1 -1
- package/dist/{chunk-QVHYARC2.js → chunk-4VPX67B7.js} +3 -1
- package/dist/chunk-5NN7JAJ2.js +258 -0
- package/dist/{chunk-AJGPULMX.js → chunk-6FSDDGFZ.js} +815 -3108
- package/dist/chunk-6PACEIUY.js +183 -0
- package/dist/{chunk-XNYZEQ3U.js → chunk-6TAN6WG6.js} +1 -1
- package/dist/{chunk-55OGZFNA.js → chunk-7FLZA2BD.js} +31 -15
- package/dist/{chunk-XBHEYY65.js → chunk-7JQBECUL.js} +1 -1
- package/dist/{chunk-5Y3NEEOK.js → chunk-AAEIGAGD.js} +9 -9
- package/dist/{chunk-H5UKINTD.js → chunk-ANI6J75M.js} +68 -65
- package/dist/chunk-B4IE2GAM.js +14 -0
- package/dist/chunk-BNVMNV4O.js +69 -0
- package/dist/{chunk-L3YB2QLN.js → chunk-C6RO4LP3.js} +2 -2
- package/dist/chunk-DTGL5P2V.js +250 -0
- package/dist/{chunk-QWTKCUIZ.js → chunk-E4JNHQGT.js} +11 -9
- package/dist/chunk-ER2ES2RH.js +64 -0
- package/dist/{chunk-SQ7CWNIT.js → chunk-EX63VKXY.js} +1 -1
- package/dist/{chunk-KQPEOUCA.js → chunk-F3MHINI6.js} +19 -23
- package/dist/{chunk-KAZFF2RD.js → chunk-FGZX4Q7W.js} +137 -113
- package/dist/{chunk-I6NVW4NX.js → chunk-FZ5N6WXF.js} +29 -33
- package/dist/chunk-H2G55ZPG.js +783 -0
- package/dist/chunk-HDBDYGJQ.js +40 -0
- package/dist/{chunk-TJR6ASRW.js → chunk-HOCODVKL.js} +22 -24
- package/dist/chunk-K2J2VZXO.js +142 -0
- package/dist/{chunk-MH3SUHI2.js → chunk-KBNEZR7T.js} +2 -2
- package/dist/chunk-KSSM6LUI.js +340 -0
- package/dist/{chunk-QFXKQNMT.js → chunk-KTGSBL6T.js} +14 -17
- package/dist/chunk-L2DHKP5C.js +42 -0
- package/dist/{chunk-DBXMYYPJ.js → chunk-M3ELKCNA.js} +1 -1
- package/dist/{chunk-KIGB3FK6.js → chunk-MWIKZIAI.js} +9 -8
- package/dist/{chunk-AON37AL2.js → chunk-O2652RWY.js} +29 -4
- package/dist/chunk-O6U226AI.js +249 -0
- package/dist/{chunk-N5B2RRSS.js → chunk-OAEV22IW.js} +47 -26
- package/dist/chunk-OANTMDXI.js +29 -0
- package/dist/{chunk-UGDIHDAR.js → chunk-ODS5QROC.js} +1 -1
- package/dist/{chunk-TW6FURZ7.js → chunk-PST63OUS.js} +5 -5
- package/dist/{chunk-S2PITDVA.js → chunk-QBAIDKF6.js} +1 -1
- package/dist/chunk-RPLBWENJ.js +224 -0
- package/dist/{chunk-CWHAK2HX.js → chunk-S62LLS4I.js} +33 -55
- package/dist/chunk-SHEU5KLD.js +32 -0
- package/dist/{chunk-FESN7DND.js → chunk-SU2USXTD.js} +1 -1
- package/dist/chunk-T6NRMNLQ.js +22 -0
- package/dist/{chunk-WXRYBXYR.js → chunk-TGKIV3F4.js} +53 -65
- package/dist/{chunk-MN7PZ2PH.js → chunk-TSV3PFU2.js} +2 -2
- package/dist/{chunk-24GQ74HM.js → chunk-UDC7NPQJ.js} +3 -3
- package/dist/{chunk-CEX2GWGZ.js → chunk-VBM7TD3X.js} +1 -1
- package/dist/chunk-VC6TX2Y2.js +359 -0
- package/dist/{chunk-V53CETNZ.js → chunk-VTDI5KP7.js} +241 -104
- package/dist/{chunk-ONWQH2W6.js → chunk-WIN7KHMV.js} +15 -18
- package/dist/chunk-WJULIJOU.js +168 -0
- package/dist/{chunk-HKLAYK2Z.js → chunk-WRTA5G57.js} +23 -0
- package/dist/{chunk-FOFVPPPV.js → chunk-WYPVD3HW.js} +10 -9
- package/dist/{chunk-D7WIIZAV.js → chunk-XE2E2KBP.js} +10 -9
- package/dist/chunk-XY53EFK3.js +39 -0
- package/dist/chunk-XZYFB566.js +153 -0
- package/dist/{chunk-OY6PIAR7.js → chunk-YJT4NXMV.js} +5 -5
- package/dist/{chunk-3DGBM7UW.js → chunk-YQFENES6.js} +3 -3
- package/dist/chunk-YUO5V75X.js +128 -0
- package/dist/daemon.js +15 -10
- package/dist/git-isolated-reader-helper.js +1 -1
- package/dist/main.js +14 -9
- package/dist/web/assets/{AsyncBashCenterHost-HGsdxUJ3.js → AsyncBashCenterHost-BvXKoCVr.js} +1 -1
- package/dist/web/assets/{ConversationsWorkbenchPanel-B6dzWkG1.js → ConversationsWorkbenchPanel-CIfK_e3I.js} +1 -1
- package/dist/web/assets/{DiscoverCenterHost-B186WBRA.js → DiscoverCenterHost-Ep8EN9iJ.js} +1 -1
- package/dist/web/assets/{FileCenterHost-DigJOU5M.js → FileCenterHost-C_7XZAFZ.js} +1 -1
- package/dist/web/assets/{FilesWorkbenchPanel-VPvx3Bmi.js → FilesWorkbenchPanel-CtXo7ywG.js} +1 -1
- package/dist/web/assets/{GitDiffCenterHost-IuZfF3hG.js → GitDiffCenterHost-Cr7lqGI_.js} +1 -1
- package/dist/web/assets/{GitWorkbenchPanel-CScC0CfH.js → GitWorkbenchPanel-BFbwUgIN.js} +1 -1
- package/dist/web/assets/{LaunchConfigurationNotice-5yb4cH27.js → LaunchConfigurationNotice-CJjWkMhv.js} +1 -1
- package/dist/web/assets/{LaunchesWorkbenchPanel-Vy0Gm7gg.js → LaunchesWorkbenchPanel-BqzJvsrj.js} +1 -1
- package/dist/web/assets/{LogsCenterHost-BXBozCYw.js → LogsCenterHost-BI1fSxFW.js} +1 -1
- package/dist/web/assets/{MermaidCenterHost-DDh4ArdK.js → MermaidCenterHost-DVsZB8nB.js} +1 -1
- package/dist/web/assets/{MobileFilesBody-Cda_7gDp.js → MobileFilesBody-BJMoaP9I.js} +1 -1
- package/dist/web/assets/{MobileFilesHost-C1jev2Un.js → MobileFilesHost-D843vkDF.js} +1 -1
- package/dist/web/assets/{MobileLaunchOutputHost-Bsv12o2H.js → MobileLaunchOutputHost-vpltMcar.js} +1 -1
- package/dist/web/assets/{MobileLaunchesHost-C9VH-2bn.js → MobileLaunchesHost-CdDrKASg.js} +1 -1
- package/dist/web/assets/{MobileLogsHost-BMDXc-WC.js → MobileLogsHost-qK7N-C1y.js} +1 -1
- package/dist/web/assets/{MobileNoteEditorHost-BA6WIY1Y.js → MobileNoteEditorHost-Bg1N8o54.js} +1 -1
- package/dist/web/assets/{MobileNotesHost-BZeYpK9H.js → MobileNotesHost-meLV39Yw.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsHost-U3Mx3EN8.js → MobileProjectSettingsHost-A49Fdn54.js} +1 -1
- package/dist/web/assets/{MobileProjectSettingsPageHost-CMvxbjfs.js → MobileProjectSettingsPageHost-BXpUqS_N.js} +1 -1
- package/dist/web/assets/{MobileSettingsHost-CP8Z_-gH.js → MobileSettingsHost-DPKPajzI.js} +1 -1
- package/dist/web/assets/{MobileSettingsPageHost-BPjXKTMV.js → MobileSettingsPageHost-izNWGN0i.js} +1 -1
- package/dist/web/assets/{MobileSettingsPageScreen-C5rHdrUU.js → MobileSettingsPageScreen-DWMg4fDo.js} +1 -1
- package/dist/web/assets/{ProjectSettingsCenterHost-BVXpBixy.js → ProjectSettingsCenterHost-DHeb274m.js} +1 -1
- package/dist/web/assets/{PullRequestCenterHost-CZhXfCX2.js → PullRequestCenterHost-BYkWxXQe.js} +1 -1
- package/dist/web/assets/{PullRequestsWorkbenchPanel-BBnZJVnI.js → PullRequestsWorkbenchPanel-ZvGbi1Cr.js} +1 -1
- package/dist/web/assets/{SearchWorkbenchPanel-qLgszneN.js → SearchWorkbenchPanel-DaC0smfe.js} +1 -1
- package/dist/web/assets/{SettingsCenter-7BfrBfiy.js → SettingsCenter-C_NLBsi6.js} +1 -1
- package/dist/web/assets/{SettingsCenterHost-Ck5uHILP.js → SettingsCenterHost-jP8MULEj.js} +1 -1
- package/dist/web/assets/{SystemPromptCenterHost-ya5AvXsd.js → SystemPromptCenterHost-B1hfsfAn.js} +1 -1
- package/dist/web/assets/{discover-B3I5g1_G.js → discover-B-aZ504j.js} +1 -1
- package/dist/web/assets/{index-FJEmK_L5.js → index-TZ1KAAsX.js} +34 -34
- package/dist/web/assets/{settings-page-controllers.svelte-CU0i08wo.js → settings-page-controllers.svelte-D_ydJF8u.js} +1 -1
- package/dist/web/assets/{shell-layout.svelte-BT2508sa.js → shell-layout.svelte-OoLFwzzJ.js} +2 -2
- package/dist/web/assets/{views-Z-n-GTYY.js → views-ByPCKDiZ.js} +1 -1
- package/dist/web/index.html +3 -3
- package/dist/web/sw.js +1 -1
- package/dist/worker.js +14 -9
- package/package.json +8 -9
- package/dist/chunk-RUZ2UAYH.js +0 -365
- package/dist/resize-worker.js +0 -168
- /package/dist/{chunk-CKVFGRVV.js.LEGAL.txt → chunk-3VZR3ZUY.js.LEGAL.txt} +0 -0
- /package/dist/{chunk-TW6FURZ7.js.LEGAL.txt → chunk-PST63OUS.js.LEGAL.txt} +0 -0
package/dist/resize-worker.js
DELETED
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { createRequire as __nerveCreateRequire } from "node:module";
|
|
2
|
-
const require = __nerveCreateRequire(import.meta.url);
|
|
3
|
-
|
|
4
|
-
// packages/harness/dist/models/image/resize-worker.js
|
|
5
|
-
import { Buffer } from "node:buffer";
|
|
6
|
-
import { createRequire } from "node:module";
|
|
7
|
-
var MAX_INPUT_BYTES = 32 * 1024 * 1024;
|
|
8
|
-
var JPEG_QUALITY = 90;
|
|
9
|
-
var require2 = createRequire(import.meta.url);
|
|
10
|
-
var electron = require2("electron");
|
|
11
|
-
async function main() {
|
|
12
|
-
const maxDimension = Number(process.argv[2]);
|
|
13
|
-
const mimeType = process.argv[3];
|
|
14
|
-
if (!Number.isSafeInteger(maxDimension) || maxDimension < 1 || !mimeType) {
|
|
15
|
-
throw new Error("Expected a positive max dimension and an image MIME type.");
|
|
16
|
-
}
|
|
17
|
-
const source = await readInput();
|
|
18
|
-
await electron.app.whenReady();
|
|
19
|
-
const resized = await resizeWithElectron(source, mimeType, maxDimension);
|
|
20
|
-
const header = Buffer.from(`${JSON.stringify({
|
|
21
|
-
mimeType: resized.mimeType,
|
|
22
|
-
changed: resized.changed,
|
|
23
|
-
length: resized.buffer.length,
|
|
24
|
-
width: resized.width,
|
|
25
|
-
height: resized.height
|
|
26
|
-
})}
|
|
27
|
-
`);
|
|
28
|
-
await writeOutput(Buffer.concat([header, resized.buffer]));
|
|
29
|
-
electron.app.quit();
|
|
30
|
-
}
|
|
31
|
-
async function readInput() {
|
|
32
|
-
const chunks = [];
|
|
33
|
-
let inputBytes = 0;
|
|
34
|
-
for await (const chunk of process.stdin) {
|
|
35
|
-
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
|
|
36
|
-
inputBytes += buffer.length;
|
|
37
|
-
if (inputBytes > MAX_INPUT_BYTES) {
|
|
38
|
-
throw new Error("Image resize helper input was too large.");
|
|
39
|
-
}
|
|
40
|
-
chunks.push(buffer);
|
|
41
|
-
}
|
|
42
|
-
if (inputBytes === 0)
|
|
43
|
-
throw new Error("Image resize helper received no image.");
|
|
44
|
-
return Buffer.concat(chunks);
|
|
45
|
-
}
|
|
46
|
-
async function resizeWithElectron(source, mimeType, maxDimension) {
|
|
47
|
-
const image = electron.nativeImage.createFromBuffer(source);
|
|
48
|
-
if (!image.isEmpty()) {
|
|
49
|
-
const size = image.getSize();
|
|
50
|
-
if (size.width <= maxDimension && size.height <= maxDimension) {
|
|
51
|
-
return {
|
|
52
|
-
buffer: source,
|
|
53
|
-
mimeType,
|
|
54
|
-
changed: false,
|
|
55
|
-
width: size.width,
|
|
56
|
-
height: size.height
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
const target = fitInside(size.width, size.height, maxDimension);
|
|
60
|
-
const resized = image.resize({ ...target, quality: "best" });
|
|
61
|
-
const resizedSize = resized.getSize();
|
|
62
|
-
if (mimeType.toLowerCase() === "image/jpeg") {
|
|
63
|
-
return {
|
|
64
|
-
buffer: resized.toJPEG(JPEG_QUALITY),
|
|
65
|
-
mimeType: "image/jpeg",
|
|
66
|
-
changed: true,
|
|
67
|
-
width: resizedSize.width,
|
|
68
|
-
height: resizedSize.height
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return {
|
|
72
|
-
buffer: resized.toPNG(),
|
|
73
|
-
mimeType: "image/png",
|
|
74
|
-
changed: true,
|
|
75
|
-
width: resizedSize.width,
|
|
76
|
-
height: resizedSize.height
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
return await resizeWithCanvas(source, mimeType, maxDimension);
|
|
80
|
-
}
|
|
81
|
-
async function resizeWithCanvas(source, mimeType, maxDimension) {
|
|
82
|
-
const window = new electron.BrowserWindow({
|
|
83
|
-
show: false,
|
|
84
|
-
webPreferences: { contextIsolation: true, sandbox: true }
|
|
85
|
-
});
|
|
86
|
-
try {
|
|
87
|
-
await window.loadURL("data:text/html,<html><body></body></html>");
|
|
88
|
-
const dataUrl = `data:${mimeType};base64,${source.toString("base64")}`;
|
|
89
|
-
const result = await window.webContents.executeJavaScript(`new Promise((resolve, reject) => {
|
|
90
|
-
const image = new Image();
|
|
91
|
-
image.onload = () => {
|
|
92
|
-
const scale = Math.min(1, ${maxDimension} / Math.max(image.width, image.height));
|
|
93
|
-
const width = Math.max(1, Math.round(image.width * scale));
|
|
94
|
-
const height = Math.max(1, Math.round(image.height * scale));
|
|
95
|
-
if (scale === 1) {
|
|
96
|
-
resolve({ data: "", width: image.width, height: image.height });
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const canvas = document.createElement("canvas");
|
|
100
|
-
canvas.width = width;
|
|
101
|
-
canvas.height = height;
|
|
102
|
-
const context = canvas.getContext("2d");
|
|
103
|
-
if (!context) {
|
|
104
|
-
reject(new Error("Could not create image canvas."));
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
context.imageSmoothingEnabled = true;
|
|
108
|
-
context.imageSmoothingQuality = "high";
|
|
109
|
-
context.drawImage(image, 0, 0, width, height);
|
|
110
|
-
resolve({ data: canvas.toDataURL("image/png"), width, height });
|
|
111
|
-
};
|
|
112
|
-
image.onerror = () => reject(new Error("Unsupported image format."));
|
|
113
|
-
image.src = ${JSON.stringify(dataUrl)};
|
|
114
|
-
})`, true);
|
|
115
|
-
if (!isCanvasResizeResult(result)) {
|
|
116
|
-
throw new Error("Image canvas returned an invalid result.");
|
|
117
|
-
}
|
|
118
|
-
if (!result.data) {
|
|
119
|
-
return {
|
|
120
|
-
buffer: source,
|
|
121
|
-
mimeType,
|
|
122
|
-
changed: false,
|
|
123
|
-
width: result.width,
|
|
124
|
-
height: result.height
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
const separator = result.data.indexOf(",");
|
|
128
|
-
if (separator < 0)
|
|
129
|
-
throw new Error("Image canvas returned invalid data.");
|
|
130
|
-
return {
|
|
131
|
-
buffer: Buffer.from(result.data.slice(separator + 1), "base64"),
|
|
132
|
-
mimeType: "image/png",
|
|
133
|
-
changed: true,
|
|
134
|
-
width: result.width,
|
|
135
|
-
height: result.height
|
|
136
|
-
};
|
|
137
|
-
} finally {
|
|
138
|
-
window.destroy();
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
function fitInside(width, height, maxDimension) {
|
|
142
|
-
const scale = Math.min(1, maxDimension / Math.max(width, height));
|
|
143
|
-
return {
|
|
144
|
-
width: Math.max(1, Math.round(width * scale)),
|
|
145
|
-
height: Math.max(1, Math.round(height * scale))
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
function isCanvasResizeResult(value) {
|
|
149
|
-
if (!value || typeof value !== "object")
|
|
150
|
-
return false;
|
|
151
|
-
const result = value;
|
|
152
|
-
return typeof result.data === "string" && typeof result.width === "number" && typeof result.height === "number";
|
|
153
|
-
}
|
|
154
|
-
async function writeOutput(output) {
|
|
155
|
-
await new Promise((resolve, reject) => {
|
|
156
|
-
process.stdout.write(output, (error) => {
|
|
157
|
-
if (error)
|
|
158
|
-
reject(error);
|
|
159
|
-
else
|
|
160
|
-
resolve();
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
void main().catch((error) => {
|
|
165
|
-
process.stderr.write(error instanceof Error ? error.message : String(error));
|
|
166
|
-
process.exitCode = 1;
|
|
167
|
-
electron.app.quit();
|
|
168
|
-
});
|
|
File without changes
|
|
File without changes
|