@wonderwhy-er/desktop-commander 0.2.35 → 0.2.37
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/README.md +3 -0
- package/dist/handlers/filesystem-handlers.js +58 -11
- package/dist/handlers/history-handlers.d.ts +7 -0
- package/dist/handlers/history-handlers.js +33 -1
- package/dist/remote-device/remote-channel.d.ts +8 -3
- package/dist/remote-device/remote-channel.js +68 -21
- package/dist/search-manager.d.ts +13 -0
- package/dist/search-manager.js +146 -0
- package/dist/server.js +56 -4
- package/dist/test-docx.d.ts +1 -0
- package/dist/tools/docx/builders/image.d.ts +14 -0
- package/dist/tools/docx/builders/image.js +84 -0
- package/dist/tools/docx/builders/index.d.ts +9 -3
- package/dist/tools/docx/builders/index.js +9 -3
- package/dist/tools/docx/builders/paragraph.d.ts +12 -0
- package/dist/tools/docx/builders/paragraph.js +29 -0
- package/dist/tools/docx/builders/table.d.ts +10 -0
- package/dist/tools/docx/builders/table.js +138 -0
- package/dist/tools/docx/builders/utils.d.ts +5 -0
- package/dist/tools/docx/builders/utils.js +18 -0
- package/dist/tools/docx/constants.d.ts +28 -32
- package/dist/tools/docx/constants.js +56 -52
- package/dist/tools/docx/create.d.ts +21 -0
- package/dist/tools/docx/create.js +386 -0
- package/dist/tools/docx/dom.d.ts +139 -0
- package/dist/tools/docx/dom.js +448 -0
- package/dist/tools/docx/index.d.ts +8 -12
- package/dist/tools/docx/index.js +8 -14
- package/dist/tools/docx/modify.d.ts +28 -0
- package/dist/tools/docx/modify.js +271 -0
- package/dist/tools/docx/ops/delete-paragraph-at-body-index.d.ts +11 -0
- package/dist/tools/docx/ops/delete-paragraph-at-body-index.js +23 -0
- package/dist/tools/docx/ops/header-replace-text-exact.d.ts +13 -0
- package/dist/tools/docx/ops/header-replace-text-exact.js +55 -0
- package/dist/tools/docx/ops/index.d.ts +17 -0
- package/dist/tools/docx/ops/index.js +70 -0
- package/dist/tools/docx/ops/insert-image-after-text.d.ts +24 -0
- package/dist/tools/docx/ops/insert-image-after-text.js +128 -0
- package/dist/tools/docx/ops/insert-paragraph-after-text.d.ts +12 -0
- package/dist/tools/docx/ops/insert-paragraph-after-text.js +74 -0
- package/dist/tools/docx/ops/insert-table-after-text.d.ts +19 -0
- package/dist/tools/docx/ops/insert-table-after-text.js +57 -0
- package/dist/tools/docx/ops/replace-hyperlink-url.d.ts +12 -0
- package/dist/tools/docx/ops/replace-hyperlink-url.js +37 -0
- package/dist/tools/docx/ops/replace-paragraph-at-body-index.d.ts +9 -0
- package/dist/tools/docx/ops/replace-paragraph-at-body-index.js +25 -0
- package/dist/tools/docx/ops/replace-paragraph-text-exact.d.ts +21 -0
- package/dist/tools/docx/ops/replace-paragraph-text-exact.js +36 -0
- package/dist/tools/docx/ops/replace-table-cell-text.d.ts +25 -0
- package/dist/tools/docx/ops/replace-table-cell-text.js +85 -0
- package/dist/tools/docx/ops/set-color-for-paragraph-exact.d.ts +9 -0
- package/dist/tools/docx/ops/set-color-for-paragraph-exact.js +24 -0
- package/dist/tools/docx/ops/set-color-for-style.d.ts +13 -0
- package/dist/tools/docx/ops/set-color-for-style.js +31 -0
- package/dist/tools/docx/ops/set-paragraph-style-at-body-index.d.ts +8 -0
- package/dist/tools/docx/ops/set-paragraph-style-at-body-index.js +57 -0
- package/dist/tools/docx/ops/table-set-cell-text.d.ts +9 -0
- package/dist/tools/docx/ops/table-set-cell-text.js +40 -0
- package/dist/tools/docx/read.d.ts +27 -0
- package/dist/tools/docx/read.js +308 -0
- package/dist/tools/docx/relationships.d.ts +22 -0
- package/dist/tools/docx/relationships.js +76 -0
- package/dist/tools/docx/types.d.ts +202 -103
- package/dist/tools/docx/types.js +2 -5
- package/dist/tools/docx/validate.d.ts +33 -0
- package/dist/tools/docx/validate.js +49 -0
- package/dist/tools/docx/write.d.ts +17 -0
- package/dist/tools/docx/write.js +88 -0
- package/dist/tools/docx/xml-view-test.d.ts +1 -0
- package/dist/tools/docx/xml-view-test.js +63 -0
- package/dist/tools/docx/xml-view.d.ts +56 -0
- package/dist/tools/docx/xml-view.js +169 -0
- package/dist/tools/docx/zip.d.ts +21 -0
- package/dist/tools/docx/zip.js +35 -0
- package/dist/tools/edit.js +57 -27
- package/dist/tools/schemas.d.ts +13 -0
- package/dist/tools/schemas.js +6 -1
- package/dist/types.d.ts +10 -0
- package/dist/ui/contracts.d.ts +14 -0
- package/dist/ui/contracts.js +18 -0
- package/dist/ui/file-preview/index.html +16 -0
- package/dist/ui/file-preview/preview-runtime.js +13983 -0
- package/dist/ui/file-preview/shared/preview-file-types.d.ts +5 -0
- package/dist/ui/file-preview/shared/preview-file-types.js +57 -0
- package/dist/ui/file-preview/src/app.d.ts +4 -0
- package/dist/ui/file-preview/src/app.js +800 -0
- package/dist/ui/file-preview/src/components/code-viewer.d.ts +6 -0
- package/dist/ui/file-preview/src/components/code-viewer.js +73 -0
- package/dist/ui/file-preview/src/components/highlighting.d.ts +2 -0
- package/dist/ui/file-preview/src/components/highlighting.js +54 -0
- package/dist/ui/file-preview/src/components/html-renderer.d.ts +9 -0
- package/dist/ui/file-preview/src/components/html-renderer.js +63 -0
- package/dist/ui/file-preview/src/components/markdown-renderer.d.ts +1 -0
- package/dist/ui/file-preview/src/components/markdown-renderer.js +21 -0
- package/dist/ui/file-preview/src/components/toolbar.d.ts +6 -0
- package/dist/ui/file-preview/src/components/toolbar.js +75 -0
- package/dist/ui/file-preview/src/image-preview.d.ts +3 -0
- package/dist/ui/file-preview/src/image-preview.js +21 -0
- package/dist/ui/file-preview/src/main.d.ts +1 -0
- package/dist/ui/file-preview/src/main.js +5 -0
- package/dist/ui/file-preview/src/types.d.ts +1 -0
- package/dist/ui/file-preview/src/types.js +1 -0
- package/dist/ui/file-preview/styles.css +764 -0
- package/dist/ui/resources.d.ts +21 -0
- package/dist/ui/resources.js +72 -0
- package/dist/ui/shared/escape-html.d.ts +4 -0
- package/dist/ui/shared/escape-html.js +11 -0
- package/dist/ui/shared/host-lifecycle.d.ts +16 -0
- package/dist/ui/shared/host-lifecycle.js +35 -0
- package/dist/ui/shared/rpc-client.d.ts +14 -0
- package/dist/ui/shared/rpc-client.js +72 -0
- package/dist/ui/shared/theme-adaptation.d.ts +10 -0
- package/dist/ui/shared/theme-adaptation.js +118 -0
- package/dist/ui/shared/tool-header.d.ts +9 -0
- package/dist/ui/shared/tool-header.js +25 -0
- package/dist/ui/shared/tool-shell.d.ts +16 -0
- package/dist/ui/shared/tool-shell.js +65 -0
- package/dist/ui/shared/widget-state.d.ts +28 -0
- package/dist/ui/shared/widget-state.js +60 -0
- package/dist/utils/capture.d.ts +1 -0
- package/dist/utils/capture.js +176 -8
- package/dist/utils/files/base.d.ts +3 -1
- package/dist/utils/files/docx.d.ts +28 -22
- package/dist/utils/files/docx.js +630 -196
- package/dist/utils/files/factory.d.ts +6 -5
- package/dist/utils/files/factory.js +18 -6
- package/dist/utils/files/text.js +9 -1
- package/dist/utils/system-info.js +1 -1
- package/dist/utils/usageTracker.js +5 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +6 -2
|
@@ -14,11 +14,12 @@ import { FileHandler } from './base.js';
|
|
|
14
14
|
* BinaryFileHandler uses async isBinaryFile for content-based detection.
|
|
15
15
|
*
|
|
16
16
|
* Priority order:
|
|
17
|
-
* 1.
|
|
18
|
-
* 2.
|
|
19
|
-
* 3.
|
|
20
|
-
* 4.
|
|
21
|
-
* 5.
|
|
17
|
+
* 1. DOCX files (extension based)
|
|
18
|
+
* 2. PDF files (extension based)
|
|
19
|
+
* 3. Excel files (xlsx, xls, xlsm) - extension based
|
|
20
|
+
* 4. Image files (png, jpg, gif, webp) - extension based
|
|
21
|
+
* 5. Binary files - content-based detection via isBinaryFile
|
|
22
|
+
* 6. Text files (default)
|
|
22
23
|
*
|
|
23
24
|
* @param filePath File path to get handler for
|
|
24
25
|
* @returns FileHandler instance that can handle this file
|
|
@@ -10,12 +10,14 @@ import { ImageFileHandler } from './image.js';
|
|
|
10
10
|
import { BinaryFileHandler } from './binary.js';
|
|
11
11
|
import { ExcelFileHandler } from './excel.js';
|
|
12
12
|
import { PdfFileHandler } from './pdf.js';
|
|
13
|
+
import { DocxFileHandler } from './docx.js';
|
|
13
14
|
// Singleton instances of each handler
|
|
14
15
|
let excelHandler = null;
|
|
15
16
|
let imageHandler = null;
|
|
16
17
|
let textHandler = null;
|
|
17
18
|
let binaryHandler = null;
|
|
18
19
|
let pdfHandler = null;
|
|
20
|
+
let docxHandler = null;
|
|
19
21
|
/**
|
|
20
22
|
* Initialize handlers (lazy initialization)
|
|
21
23
|
*/
|
|
@@ -44,6 +46,11 @@ function getPdfHandler() {
|
|
|
44
46
|
pdfHandler = new PdfFileHandler();
|
|
45
47
|
return pdfHandler;
|
|
46
48
|
}
|
|
49
|
+
function getDocxHandler() {
|
|
50
|
+
if (!docxHandler)
|
|
51
|
+
docxHandler = new DocxFileHandler();
|
|
52
|
+
return docxHandler;
|
|
53
|
+
}
|
|
47
54
|
/**
|
|
48
55
|
* Get the appropriate file handler for a given file path
|
|
49
56
|
*
|
|
@@ -52,17 +59,22 @@ function getPdfHandler() {
|
|
|
52
59
|
* BinaryFileHandler uses async isBinaryFile for content-based detection.
|
|
53
60
|
*
|
|
54
61
|
* Priority order:
|
|
55
|
-
* 1.
|
|
56
|
-
* 2.
|
|
57
|
-
* 3.
|
|
58
|
-
* 4.
|
|
59
|
-
* 5.
|
|
62
|
+
* 1. DOCX files (extension based)
|
|
63
|
+
* 2. PDF files (extension based)
|
|
64
|
+
* 3. Excel files (xlsx, xls, xlsm) - extension based
|
|
65
|
+
* 4. Image files (png, jpg, gif, webp) - extension based
|
|
66
|
+
* 5. Binary files - content-based detection via isBinaryFile
|
|
67
|
+
* 6. Text files (default)
|
|
60
68
|
*
|
|
61
69
|
* @param filePath File path to get handler for
|
|
62
70
|
* @returns FileHandler instance that can handle this file
|
|
63
71
|
*/
|
|
64
72
|
export async function getFileHandler(filePath) {
|
|
65
|
-
// Check
|
|
73
|
+
// Check DOCX first (extension-based, sync)
|
|
74
|
+
if (getDocxHandler().canHandle(filePath)) {
|
|
75
|
+
return getDocxHandler();
|
|
76
|
+
}
|
|
77
|
+
// Check PDF (extension-based, sync)
|
|
66
78
|
if (getPdfHandler().canHandle(filePath)) {
|
|
67
79
|
return getPdfHandler();
|
|
68
80
|
}
|
package/dist/utils/files/text.js
CHANGED
|
@@ -87,7 +87,15 @@ export class TextFileHandler {
|
|
|
87
87
|
* Made static and public for use by other modules (e.g., writeFile telemetry in filesystem.ts)
|
|
88
88
|
*/
|
|
89
89
|
static countLines(content) {
|
|
90
|
-
|
|
90
|
+
if (content === '')
|
|
91
|
+
return 0;
|
|
92
|
+
// A file with N lines has N-1 newline characters.
|
|
93
|
+
// If the file ends with a trailing newline, don't count the empty string after it.
|
|
94
|
+
const lines = content.split('\n');
|
|
95
|
+
if (lines[lines.length - 1] === '') {
|
|
96
|
+
return lines.length - 1;
|
|
97
|
+
}
|
|
98
|
+
return lines.length;
|
|
91
99
|
}
|
|
92
100
|
/**
|
|
93
101
|
* Get file line count (for files under size limit)
|
|
@@ -129,7 +129,7 @@ function discoverContainerMounts(isContainer) {
|
|
|
129
129
|
const device = parts[0];
|
|
130
130
|
const mountPoint = parts[1];
|
|
131
131
|
const fsType = parts[2];
|
|
132
|
-
const options = parts[3];
|
|
132
|
+
const options = parts[3].split(',');
|
|
133
133
|
// Skip system mount points
|
|
134
134
|
const isSystemMountPoint = mountPoint === '/' ||
|
|
135
135
|
mountPoint.startsWith('/dev') ||
|
|
@@ -331,6 +331,11 @@ class UsageTracker {
|
|
|
331
331
|
if (!onboardingEnabled) {
|
|
332
332
|
return false;
|
|
333
333
|
}
|
|
334
|
+
// Check local config override (user can disable via config)
|
|
335
|
+
const localOverride = await configManager.getValue('onboarding_injection');
|
|
336
|
+
if (localOverride === false) {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
334
339
|
// Check if onboarding is disabled via command line argument
|
|
335
340
|
if (global.disableOnboarding) {
|
|
336
341
|
return false;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.37";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.
|
|
1
|
+
export const VERSION = '0.2.37';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wonderwhy-er/desktop-commander",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.37",
|
|
4
4
|
"description": "MCP server for terminal operations and file editing",
|
|
5
5
|
"mcpName": "io.github.wonderwhy-er/desktop-commander",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"bump": "node scripts/sync-version.js --bump",
|
|
32
32
|
"bump:minor": "node scripts/sync-version.js --bump --minor",
|
|
33
33
|
"bump:major": "node scripts/sync-version.js --bump --major",
|
|
34
|
-
"build": "tsc && shx cp setup-claude-server.js uninstall-claude-server.js track-installation.js dist/ && shx chmod +x dist/*.js && shx mkdir -p dist/data && shx cp src/data/onboarding-prompts.json dist/data/ && shx mkdir -p dist/remote-device/scripts && shx cp src/remote-device/scripts/blocking-offline-update.js dist/remote-device/scripts/",
|
|
34
|
+
"build": "tsc && shx cp setup-claude-server.js uninstall-claude-server.js track-installation.js dist/ && shx chmod +x dist/*.js && shx mkdir -p dist/data && shx cp src/data/onboarding-prompts.json dist/data/ && shx mkdir -p dist/remote-device/scripts && shx cp src/remote-device/scripts/blocking-offline-update.js dist/remote-device/scripts/ && node scripts/build-ui-runtime.cjs file-preview",
|
|
35
35
|
"watch": "tsc --watch",
|
|
36
36
|
"start": "node dist/index.js",
|
|
37
37
|
"start:debug": "node --inspect-brk=9229 dist/index.js",
|
|
@@ -90,10 +90,13 @@
|
|
|
90
90
|
"fastest-levenshtein": "^1.0.16",
|
|
91
91
|
"file-type": "^21.1.1",
|
|
92
92
|
"glob": "^10.3.10",
|
|
93
|
+
"highlight.js": "^11.11.1",
|
|
93
94
|
"isbinaryfile": "^5.0.4",
|
|
95
|
+
"markdown-it": "^14.1.0",
|
|
94
96
|
"md-to-pdf": "^5.2.5",
|
|
95
97
|
"open": "^10.2.0",
|
|
96
98
|
"pdf-lib": "^1.17.1",
|
|
99
|
+
"pizzip": "^3.2.0",
|
|
97
100
|
"remark": "^15.0.1",
|
|
98
101
|
"remark-gfm": "^4.0.1",
|
|
99
102
|
"remark-parse": "^11.0.0",
|
|
@@ -110,6 +113,7 @@
|
|
|
110
113
|
"@anthropic-ai/mcpb": "^1.2.0",
|
|
111
114
|
"@types/node": "^20.17.24",
|
|
112
115
|
"commander": "^13.1.0",
|
|
116
|
+
"esbuild": "^0.27.3",
|
|
113
117
|
"nexe": "^5.0.0-beta.4",
|
|
114
118
|
"nodemon": "^3.0.2",
|
|
115
119
|
"shx": "^0.3.4",
|