@thevinci/web 1.3.0 → 1.3.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/dist/assets/{GitView-CRSR4Udh.js → GitView-CIXtUiY4.js} +1 -1
- package/dist/assets/{HtmlEditor-Cdmqf-2N.js → HtmlEditor-DdqeDNYP.js} +1 -1
- package/dist/assets/{JsonTreeView-BHfF9Efv.js → JsonTreeView-nlJTFDBl.js} +1 -1
- package/dist/assets/{MarkdownRendererImpl--9MJLbha.js → MarkdownRendererImpl-Cj_UZ65i.js} +1 -1
- package/dist/assets/{MultiRunWindow-BgvoIqrW.js → MultiRunWindow-Cx2CTWGK.js} +1 -1
- package/dist/assets/{OnboardingScreen-D0MEhln5.js → OnboardingScreen-C-tioywh.js} +1 -1
- package/dist/assets/{SettingsWindow-Z-EFYu7z.js → SettingsWindow-mltact69.js} +1 -1
- package/dist/assets/{TerminalView-Ck9CASld.js → TerminalView-JImTzVKx.js} +1 -1
- package/dist/assets/{ToolOutputDialog-nYirsIiU.js → ToolOutputDialog-BgD_oylB.js} +1 -1
- package/dist/assets/{main-C0ZrxisB.js → main-DAAwouEn.js} +25 -23
- package/dist/assets/{main-DZyYGTEK.js → main-wcTLOXeD.js} +2 -2
- package/dist/assets/{miniChat-BYeO3Yg4.js → miniChat-_vwtyFsw.js} +2 -2
- package/dist/assets/{modelPrefsAutoSave-BUSppnWi.js → modelPrefsAutoSave-Czz-2ruh.js} +5 -5
- package/dist/assets/{renderElectronMiniChatApp-BilFShcX.js → renderElectronMiniChatApp-CUV8Cm4X.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/mini-chat.html +1 -1
- package/opencode-tools/opencode.json +8 -4
- package/opencode-tools/skills/shared-humanizer/SKILL.md +622 -0
- package/opencode-tools/tools/media-generate.ts +13 -3
- package/package.json +1 -1
- package/server/lib/fs/routes.js +26 -7
package/server/lib/fs/routes.js
CHANGED
|
@@ -746,15 +746,25 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
746
746
|
const Busboy = (await import('busboy')).default;
|
|
747
747
|
const busboy = Busboy({ headers: req.headers, limits: { files: 50 } });
|
|
748
748
|
|
|
749
|
-
|
|
749
|
+
let targetDir = '';
|
|
750
750
|
const uploadedFiles = [];
|
|
751
751
|
const errors = [];
|
|
752
|
+
let responseSent = false;
|
|
753
|
+
|
|
754
|
+
const sendError = (status, error) => {
|
|
755
|
+
if (responseSent) return;
|
|
756
|
+
responseSent = true;
|
|
757
|
+
return res.status(status).json({ error: error || 'Upload failed' });
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
busboy.on('field', (fieldname, value) => {
|
|
761
|
+
if (fieldname === 'path' && typeof value === 'string') {
|
|
762
|
+
targetDir = value;
|
|
763
|
+
}
|
|
764
|
+
});
|
|
752
765
|
|
|
753
766
|
busboy.on('file', (fieldname, file, info) => {
|
|
754
767
|
const filename = info?.filename || fieldname;
|
|
755
|
-
const encoding = info?.encoding || '7bit';
|
|
756
|
-
const mimeType = info?.mimeType || 'application/octet-stream';
|
|
757
|
-
|
|
758
768
|
const resolvedTarget = targetDir ? `${targetDir}/${filename}` : filename;
|
|
759
769
|
|
|
760
770
|
const writePromise = (async () => {
|
|
@@ -785,10 +795,15 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
785
795
|
|
|
786
796
|
writePromise
|
|
787
797
|
.then((result) => uploadedFiles.push(result))
|
|
788
|
-
.catch((err) =>
|
|
798
|
+
.catch((err) => {
|
|
799
|
+
console.error(`[upload] Failed to write ${filename}:`, err.message);
|
|
800
|
+
errors.push({ filename, error: err.message });
|
|
801
|
+
});
|
|
789
802
|
});
|
|
790
803
|
|
|
791
804
|
busboy.on('finish', () => {
|
|
805
|
+
if (responseSent) return;
|
|
806
|
+
responseSent = true;
|
|
792
807
|
if (errors.length > 0 && uploadedFiles.length === 0) {
|
|
793
808
|
return res.status(500).json({ error: errors[0].error || 'Upload failed', errors });
|
|
794
809
|
}
|
|
@@ -796,8 +811,12 @@ export const registerFsRoutes = (app, dependencies) => {
|
|
|
796
811
|
});
|
|
797
812
|
|
|
798
813
|
busboy.on('error', (err) => {
|
|
799
|
-
console.error('Busboy error:', err);
|
|
800
|
-
return
|
|
814
|
+
console.error('[upload] Busboy error:', err);
|
|
815
|
+
return sendError(500, 'Upload failed');
|
|
816
|
+
});
|
|
817
|
+
|
|
818
|
+
req.on('aborted', () => {
|
|
819
|
+
console.error('[upload] Request aborted');
|
|
801
820
|
});
|
|
802
821
|
|
|
803
822
|
req.pipe(busboy);
|