@wonderwhy-er/desktop-commander 0.2.37 → 0.2.39
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 +290 -100
- package/dist/command-manager.js +6 -3
- package/dist/config-field-definitions.d.ts +41 -0
- package/dist/config-field-definitions.js +37 -0
- package/dist/config-manager.d.ts +2 -0
- package/dist/config-manager.js +22 -2
- package/dist/handlers/filesystem-handlers.d.ts +5 -0
- package/dist/handlers/filesystem-handlers.js +19 -12
- package/dist/remote-device/desktop-commander-integration.js +1 -1
- package/dist/remote-device/remote-channel.js +1 -1
- package/dist/search-manager.js +31 -38
- package/dist/server.js +11 -4
- package/dist/terminal-manager.js +4 -2
- package/dist/tools/config.d.ts +71 -0
- package/dist/tools/config.js +117 -2
- package/dist/tools/edit.js +34 -1
- package/dist/tools/filesystem.js +91 -3
- package/dist/tools/improved-process-tools.js +2 -1
- package/dist/tools/schemas.d.ts +3 -0
- package/dist/tools/schemas.js +1 -0
- package/dist/types.d.ts +0 -1
- package/dist/ui/config-editor/app.d.ts +43 -0
- package/dist/ui/config-editor/app.js +840 -0
- package/dist/ui/config-editor/array-modal.d.ts +19 -0
- package/dist/ui/config-editor/array-modal.js +185 -0
- package/dist/ui/config-editor/config-editor-runtime.js +150 -0
- package/dist/ui/config-editor/index.html +13 -0
- package/dist/ui/config-editor/main.js +2 -0
- package/dist/ui/config-editor/src/App.d.ts +43 -0
- package/dist/ui/config-editor/src/App.js +840 -0
- package/dist/ui/config-editor/src/array-modal.d.ts +19 -0
- package/dist/ui/config-editor/src/array-modal.js +185 -0
- package/dist/ui/config-editor/src/components/layout.d.ts +4 -0
- package/dist/ui/config-editor/src/components/layout.js +83 -0
- package/dist/ui/config-editor/src/components/toolbar.d.ts +1 -0
- package/dist/ui/config-editor/src/components/toolbar.js +21 -0
- package/dist/ui/config-editor/src/config-values.d.ts +6 -0
- package/dist/ui/config-editor/src/config-values.js +61 -0
- package/dist/ui/config-editor/src/contracts.d.ts +14 -0
- package/dist/ui/config-editor/src/contracts.js +3 -0
- package/dist/ui/config-editor/src/directory-browser.d.ts +6 -0
- package/dist/ui/config-editor/src/directory-browser.js +71 -0
- package/dist/ui/config-editor/src/layout.d.ts +5 -0
- package/dist/ui/config-editor/src/layout.js +90 -0
- package/dist/ui/config-editor/src/main.js +2 -0
- package/dist/ui/config-editor/src/parsing.d.ts +5 -0
- package/dist/ui/config-editor/src/parsing.js +50 -0
- package/dist/ui/config-editor/src/toolbar.d.ts +1 -0
- package/dist/ui/config-editor/src/toolbar.js +18 -0
- package/dist/ui/config-editor/src/types.d.ts +17 -0
- package/dist/ui/config-editor/src/types.js +3 -0
- package/dist/ui/config-editor/src/utils/config-values.d.ts +9 -0
- package/dist/ui/config-editor/src/utils/config-values.js +61 -0
- package/dist/ui/config-editor/src/utils/directory-browser.d.ts +31 -0
- package/dist/ui/config-editor/src/utils/directory-browser.js +201 -0
- package/dist/ui/config-editor/src/utils/parsing.d.ts +8 -0
- package/dist/ui/config-editor/src/utils/parsing.js +50 -0
- package/dist/ui/config-editor/styles.css +587 -0
- package/dist/ui/file-preview/app.d.ts +8 -0
- package/dist/ui/file-preview/app.js +2020 -0
- package/dist/ui/file-preview/components/code-viewer.d.ts +6 -0
- package/dist/ui/file-preview/components/code-viewer.js +73 -0
- package/dist/ui/file-preview/components/highlighting.d.ts +2 -0
- package/dist/ui/file-preview/components/highlighting.js +54 -0
- package/dist/ui/file-preview/components/html-renderer.d.ts +5 -0
- package/dist/ui/file-preview/components/html-renderer.js +47 -0
- package/dist/ui/file-preview/components/markdown-renderer.d.ts +1 -0
- package/dist/ui/file-preview/components/markdown-renderer.js +67 -0
- package/dist/ui/file-preview/components/toolbar.d.ts +6 -0
- package/dist/ui/file-preview/components/toolbar.js +75 -0
- package/dist/ui/file-preview/image-preview.d.ts +3 -0
- package/dist/ui/file-preview/image-preview.js +21 -0
- package/dist/ui/file-preview/main.js +5 -0
- package/dist/ui/file-preview/markdown/editor.d.ts +36 -0
- package/dist/ui/file-preview/markdown/editor.js +643 -0
- package/dist/ui/file-preview/markdown/linking.d.ts +9 -0
- package/dist/ui/file-preview/markdown/linking.js +210 -0
- package/dist/ui/file-preview/markdown/outline.d.ts +7 -0
- package/dist/ui/file-preview/markdown/outline.js +40 -0
- package/dist/ui/file-preview/markdown/preview.d.ts +8 -0
- package/dist/ui/file-preview/markdown/preview.js +33 -0
- package/dist/ui/file-preview/markdown/slugify.d.ts +3 -0
- package/dist/ui/file-preview/markdown/slugify.js +31 -0
- package/dist/ui/file-preview/markdown/toc.d.ts +11 -0
- package/dist/ui/file-preview/markdown/toc.js +75 -0
- package/dist/ui/file-preview/markdown/utils.d.ts +1 -0
- package/dist/ui/file-preview/markdown/utils.js +15 -0
- package/dist/ui/file-preview/markdown/workspace-controller.d.ts +25 -0
- package/dist/ui/file-preview/markdown/workspace-controller.js +40 -0
- package/dist/ui/file-preview/preview-runtime.js +399 -13969
- package/dist/ui/file-preview/shared/preview-file-types.d.ts +1 -1
- package/dist/ui/file-preview/shared/preview-file-types.js +3 -1
- package/dist/ui/file-preview/src/App.d.ts +4 -0
- package/dist/ui/file-preview/src/App.js +564 -0
- package/dist/ui/file-preview/src/components/CodeViewer.d.ts +6 -0
- package/dist/ui/file-preview/src/components/CodeViewer.js +60 -0
- package/dist/ui/file-preview/src/components/HtmlRenderer.d.ts +8 -0
- package/dist/ui/file-preview/src/components/HtmlRenderer.js +45 -0
- package/dist/ui/file-preview/src/components/MarkdownRenderer.d.ts +1 -0
- package/dist/ui/file-preview/src/components/MarkdownRenderer.js +15 -0
- package/dist/ui/file-preview/src/components/editor-toolbar.d.ts +15 -0
- package/dist/ui/file-preview/src/components/editor-toolbar.js +384 -0
- package/dist/ui/file-preview/src/components/html-renderer.d.ts +1 -5
- package/dist/ui/file-preview/src/components/html-renderer.js +11 -27
- package/dist/ui/file-preview/src/components/markdown-editor.d.ts +29 -0
- package/dist/ui/file-preview/src/components/markdown-editor.js +535 -0
- package/dist/ui/file-preview/src/components/markdown-renderer.js +47 -9
- package/dist/ui/file-preview/src/directory-controller.d.ts +8 -0
- package/dist/ui/file-preview/src/directory-controller.js +233 -0
- package/dist/ui/file-preview/src/document-layout.d.ts +20 -0
- package/dist/ui/file-preview/src/document-layout.js +109 -0
- package/dist/ui/file-preview/src/document-outline.d.ts +17 -0
- package/dist/ui/file-preview/src/document-outline.js +97 -0
- package/dist/ui/file-preview/src/document-workspace.d.ts +19 -0
- package/dist/ui/file-preview/src/document-workspace.js +33 -0
- package/dist/ui/file-preview/src/file-type-handlers.d.ts +10 -0
- package/dist/ui/file-preview/src/file-type-handlers.js +98 -0
- package/dist/ui/file-preview/src/host/external-actions.d.ts +19 -0
- package/dist/ui/file-preview/src/host/external-actions.js +94 -0
- package/dist/ui/file-preview/src/host/selection-context.d.ts +9 -0
- package/dist/ui/file-preview/src/host/selection-context.js +106 -0
- package/dist/ui/file-preview/src/markdown/block-merge.d.ts +25 -0
- package/dist/ui/file-preview/src/markdown/block-merge.js +86 -0
- package/dist/ui/file-preview/src/markdown/conflict-dialog.d.ts +40 -0
- package/dist/ui/file-preview/src/markdown/conflict-dialog.js +163 -0
- package/dist/ui/file-preview/src/markdown/controller.d.ts +38 -0
- package/dist/ui/file-preview/src/markdown/controller.js +921 -0
- package/dist/ui/file-preview/src/markdown/editor.d.ts +35 -0
- package/dist/ui/file-preview/src/markdown/editor.js +691 -0
- package/dist/ui/file-preview/src/markdown/link-modal.d.ts +13 -0
- package/dist/ui/file-preview/src/markdown/link-modal.js +213 -0
- package/dist/ui/file-preview/src/markdown/linking.d.ts +16 -0
- package/dist/ui/file-preview/src/markdown/linking.js +228 -0
- package/dist/ui/file-preview/src/markdown/outline.d.ts +2 -0
- package/dist/ui/file-preview/src/markdown/outline.js +16 -0
- package/dist/ui/file-preview/src/markdown/parser.d.ts +30 -0
- package/dist/ui/file-preview/src/markdown/parser.js +38 -0
- package/dist/ui/file-preview/src/markdown/preview.d.ts +1 -0
- package/dist/ui/file-preview/src/markdown/preview.js +20 -0
- package/dist/ui/file-preview/src/markdown/raw-editor.d.ts +8 -0
- package/dist/ui/file-preview/src/markdown/raw-editor.js +61 -0
- package/dist/ui/file-preview/src/markdown/selection-toolbar.d.ts +14 -0
- package/dist/ui/file-preview/src/markdown/selection-toolbar.js +128 -0
- package/dist/ui/file-preview/src/markdown/slugify.d.ts +3 -0
- package/dist/ui/file-preview/src/markdown/slugify.js +31 -0
- package/dist/ui/file-preview/src/markdown/toc.d.ts +11 -0
- package/dist/ui/file-preview/src/markdown/toc.js +75 -0
- package/dist/ui/file-preview/src/markdown/utils.d.ts +1 -0
- package/dist/ui/file-preview/src/markdown/utils.js +15 -0
- package/dist/ui/file-preview/src/markdown-workspace/editor.d.ts +36 -0
- package/dist/ui/file-preview/src/markdown-workspace/editor.js +643 -0
- package/dist/ui/file-preview/src/markdown-workspace/linking.d.ts +9 -0
- package/dist/ui/file-preview/src/markdown-workspace/linking.js +210 -0
- package/dist/ui/file-preview/src/markdown-workspace/outline.d.ts +7 -0
- package/dist/ui/file-preview/src/markdown-workspace/outline.js +40 -0
- package/dist/ui/file-preview/src/markdown-workspace/preview.d.ts +8 -0
- package/dist/ui/file-preview/src/markdown-workspace/preview.js +33 -0
- package/dist/ui/file-preview/src/markdown-workspace/slugify.d.ts +3 -0
- package/dist/ui/file-preview/src/markdown-workspace/slugify.js +31 -0
- package/dist/ui/file-preview/src/markdown-workspace/toc.d.ts +11 -0
- package/dist/ui/file-preview/src/markdown-workspace/toc.js +75 -0
- package/dist/ui/file-preview/src/markdown-workspace/utils.d.ts +1 -0
- package/dist/ui/file-preview/src/markdown-workspace/utils.js +15 -0
- package/dist/ui/file-preview/src/markdown-workspace/workspace-controller.d.ts +25 -0
- package/dist/ui/file-preview/src/markdown-workspace/workspace-controller.js +40 -0
- package/dist/ui/file-preview/src/model.d.ts +34 -0
- package/dist/ui/file-preview/src/panel-actions.d.ts +17 -0
- package/dist/ui/file-preview/src/panel-actions.js +182 -0
- package/dist/ui/file-preview/src/path-utils.d.ts +6 -0
- package/dist/ui/file-preview/src/path-utils.js +64 -0
- package/dist/ui/file-preview/src/payload-utils.d.ts +11 -0
- package/dist/ui/file-preview/src/payload-utils.js +94 -0
- package/dist/ui/file-preview/styles.css +1144 -277
- package/dist/ui/file-preview/types.d.ts +1 -0
- package/dist/ui/file-preview/types.js +1 -0
- package/dist/ui/resources.d.ts +7 -0
- package/dist/ui/resources.js +16 -2
- package/dist/ui/server-integration.d.ts +13 -0
- package/dist/ui/server-integration.js +31 -0
- package/dist/ui/shared/ToolHeader.d.ts +9 -0
- package/dist/ui/shared/ToolHeader.js +29 -0
- package/dist/ui/shared/app-bootstrap.d.ts +9 -0
- package/dist/ui/shared/app-bootstrap.js +15 -0
- package/dist/ui/shared/compact-row.d.ts +11 -0
- package/dist/ui/shared/compact-row.js +18 -0
- package/dist/ui/shared/guards.d.ts +1 -0
- package/dist/ui/shared/guards.js +3 -0
- package/dist/ui/shared/host-context.d.ts +15 -0
- package/dist/ui/shared/host-context.js +51 -0
- package/dist/ui/shared/host-lifecycle.d.ts +1 -0
- package/dist/ui/shared/host-lifecycle.js +8 -2
- package/dist/ui/shared/tool-bridge.d.ts +30 -0
- package/dist/ui/shared/tool-bridge.js +137 -0
- package/dist/ui/shared/tool-shell.d.ts +9 -0
- package/dist/ui/shared/tool-shell.js +46 -4
- package/dist/ui/shared/ui-event-tracker.d.ts +9 -0
- package/dist/ui/shared/ui-event-tracker.js +27 -0
- package/dist/ui/shared/widget-state.d.ts +6 -1
- package/dist/ui/shared/widget-state.js +102 -4
- package/dist/utils/capture.js +3 -3
- package/dist/utils/files/base.d.ts +2 -0
- package/dist/utils/open-browser.js +1 -1
- package/dist/utils/ui-call-context.d.ts +8 -0
- package/dist/utils/ui-call-context.js +72 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +13 -4
- package/dist/data/spec-kit-prompts.json +0 -123
- package/dist/handlers/node-handlers.d.ts +0 -6
- package/dist/handlers/node-handlers.js +0 -73
- package/dist/handlers/test-crash-handler.d.ts +0 -11
- package/dist/handlers/test-crash-handler.js +0 -26
- package/dist/http-index.d.ts +0 -45
- package/dist/http-index.js +0 -51
- package/dist/http-server-auto-tunnel.js +0 -667
- package/dist/http-server-named-tunnel.d.ts +0 -2
- package/dist/http-server-named-tunnel.js +0 -167
- package/dist/http-server-tunnel.d.ts +0 -2
- package/dist/http-server-tunnel.js +0 -111
- package/dist/http-server.d.ts +0 -2
- package/dist/http-server.js +0 -270
- package/dist/index-oauth.d.ts +0 -2
- package/dist/index-oauth.js +0 -201
- package/dist/oauth/auth-middleware.d.ts +0 -20
- package/dist/oauth/auth-middleware.js +0 -62
- package/dist/oauth/index.d.ts +0 -3
- package/dist/oauth/index.js +0 -3
- package/dist/oauth/oauth-manager.d.ts +0 -80
- package/dist/oauth/oauth-manager.js +0 -179
- package/dist/oauth/oauth-routes.d.ts +0 -3
- package/dist/oauth/oauth-routes.js +0 -377
- package/dist/oauth/provider.d.ts +0 -22
- package/dist/oauth/provider.js +0 -124
- package/dist/oauth/server.d.ts +0 -18
- package/dist/oauth/server.js +0 -160
- package/dist/oauth/types.d.ts +0 -54
- package/dist/oauth/types.js +0 -2
- package/dist/remote-device/templates/auth-success.d.ts +0 -1
- package/dist/remote-device/templates/auth-success.js +0 -30
- package/dist/setup.log +0 -275
- package/dist/test-setup.js +0 -14
- package/dist/tools/docx/builders/html-builder.d.ts +0 -17
- package/dist/tools/docx/builders/html-builder.js +0 -92
- package/dist/tools/docx/builders/image.d.ts +0 -14
- package/dist/tools/docx/builders/image.js +0 -84
- package/dist/tools/docx/builders/index.d.ts +0 -11
- package/dist/tools/docx/builders/index.js +0 -11
- package/dist/tools/docx/builders/markdown-builder.d.ts +0 -2
- package/dist/tools/docx/builders/markdown-builder.js +0 -260
- package/dist/tools/docx/builders/paragraph.d.ts +0 -12
- package/dist/tools/docx/builders/paragraph.js +0 -29
- package/dist/tools/docx/builders/table.d.ts +0 -10
- package/dist/tools/docx/builders/table.js +0 -138
- package/dist/tools/docx/builders/utils.d.ts +0 -5
- package/dist/tools/docx/builders/utils.js +0 -18
- package/dist/tools/docx/constants.d.ts +0 -32
- package/dist/tools/docx/constants.js +0 -61
- package/dist/tools/docx/converters/markdown-to-html.d.ts +0 -17
- package/dist/tools/docx/converters/markdown-to-html.js +0 -111
- package/dist/tools/docx/create.d.ts +0 -21
- package/dist/tools/docx/create.js +0 -386
- package/dist/tools/docx/dom.d.ts +0 -139
- package/dist/tools/docx/dom.js +0 -448
- package/dist/tools/docx/errors.d.ts +0 -28
- package/dist/tools/docx/errors.js +0 -48
- package/dist/tools/docx/extractors/images.d.ts +0 -14
- package/dist/tools/docx/extractors/images.js +0 -40
- package/dist/tools/docx/extractors/metadata.d.ts +0 -14
- package/dist/tools/docx/extractors/metadata.js +0 -64
- package/dist/tools/docx/extractors/sections.d.ts +0 -14
- package/dist/tools/docx/extractors/sections.js +0 -61
- package/dist/tools/docx/html.d.ts +0 -17
- package/dist/tools/docx/html.js +0 -111
- package/dist/tools/docx/index.d.ts +0 -10
- package/dist/tools/docx/index.js +0 -10
- package/dist/tools/docx/markdown.d.ts +0 -84
- package/dist/tools/docx/markdown.js +0 -507
- package/dist/tools/docx/modify.d.ts +0 -28
- package/dist/tools/docx/modify.js +0 -271
- package/dist/tools/docx/operations/handlers/index.d.ts +0 -39
- package/dist/tools/docx/operations/handlers/index.js +0 -152
- package/dist/tools/docx/operations/html-manipulator.d.ts +0 -24
- package/dist/tools/docx/operations/html-manipulator.js +0 -352
- package/dist/tools/docx/operations/index.d.ts +0 -14
- package/dist/tools/docx/operations/index.js +0 -61
- package/dist/tools/docx/operations/operation-handlers.d.ts +0 -3
- package/dist/tools/docx/operations/operation-handlers.js +0 -67
- package/dist/tools/docx/operations/preprocessor.d.ts +0 -14
- package/dist/tools/docx/operations/preprocessor.js +0 -44
- package/dist/tools/docx/operations/xml-replacer.d.ts +0 -9
- package/dist/tools/docx/operations/xml-replacer.js +0 -35
- package/dist/tools/docx/operations.d.ts +0 -13
- package/dist/tools/docx/operations.js +0 -13
- package/dist/tools/docx/ops/delete-paragraph-at-body-index.d.ts +0 -11
- package/dist/tools/docx/ops/delete-paragraph-at-body-index.js +0 -23
- package/dist/tools/docx/ops/header-replace-text-exact.d.ts +0 -13
- package/dist/tools/docx/ops/header-replace-text-exact.js +0 -55
- package/dist/tools/docx/ops/index.d.ts +0 -17
- package/dist/tools/docx/ops/index.js +0 -70
- package/dist/tools/docx/ops/insert-image-after-text.d.ts +0 -24
- package/dist/tools/docx/ops/insert-image-after-text.js +0 -128
- package/dist/tools/docx/ops/insert-paragraph-after-text.d.ts +0 -12
- package/dist/tools/docx/ops/insert-paragraph-after-text.js +0 -74
- package/dist/tools/docx/ops/insert-table-after-text.d.ts +0 -19
- package/dist/tools/docx/ops/insert-table-after-text.js +0 -57
- package/dist/tools/docx/ops/replace-hyperlink-url.d.ts +0 -12
- package/dist/tools/docx/ops/replace-hyperlink-url.js +0 -37
- package/dist/tools/docx/ops/replace-paragraph-at-body-index.d.ts +0 -9
- package/dist/tools/docx/ops/replace-paragraph-at-body-index.js +0 -25
- package/dist/tools/docx/ops/replace-paragraph-text-exact.d.ts +0 -21
- package/dist/tools/docx/ops/replace-paragraph-text-exact.js +0 -36
- package/dist/tools/docx/ops/replace-table-cell-text.d.ts +0 -25
- package/dist/tools/docx/ops/replace-table-cell-text.js +0 -85
- package/dist/tools/docx/ops/set-color-for-paragraph-exact.d.ts +0 -9
- package/dist/tools/docx/ops/set-color-for-paragraph-exact.js +0 -24
- package/dist/tools/docx/ops/set-color-for-style.d.ts +0 -13
- package/dist/tools/docx/ops/set-color-for-style.js +0 -31
- package/dist/tools/docx/ops/set-paragraph-style-at-body-index.d.ts +0 -8
- package/dist/tools/docx/ops/set-paragraph-style-at-body-index.js +0 -57
- package/dist/tools/docx/ops/table-set-cell-text.d.ts +0 -9
- package/dist/tools/docx/ops/table-set-cell-text.js +0 -40
- package/dist/tools/docx/parsers/image-extractor.d.ts +0 -18
- package/dist/tools/docx/parsers/image-extractor.js +0 -61
- package/dist/tools/docx/parsers/index.d.ts +0 -9
- package/dist/tools/docx/parsers/index.js +0 -9
- package/dist/tools/docx/parsers/paragraph-parser.d.ts +0 -2
- package/dist/tools/docx/parsers/paragraph-parser.js +0 -88
- package/dist/tools/docx/parsers/table-parser.d.ts +0 -9
- package/dist/tools/docx/parsers/table-parser.js +0 -72
- package/dist/tools/docx/parsers/xml-parser.d.ts +0 -25
- package/dist/tools/docx/parsers/xml-parser.js +0 -71
- package/dist/tools/docx/parsers/zip-reader.d.ts +0 -23
- package/dist/tools/docx/parsers/zip-reader.js +0 -52
- package/dist/tools/docx/read.d.ts +0 -27
- package/dist/tools/docx/read.js +0 -308
- package/dist/tools/docx/relationships.d.ts +0 -22
- package/dist/tools/docx/relationships.js +0 -76
- package/dist/tools/docx/structure.d.ts +0 -25
- package/dist/tools/docx/structure.js +0 -102
- package/dist/tools/docx/styled-html-parser.d.ts +0 -23
- package/dist/tools/docx/styled-html-parser.js +0 -1262
- package/dist/tools/docx/types.d.ts +0 -213
- package/dist/tools/docx/types.js +0 -5
- package/dist/tools/docx/utils/escaping.d.ts +0 -13
- package/dist/tools/docx/utils/escaping.js +0 -26
- package/dist/tools/docx/utils/images.d.ts +0 -9
- package/dist/tools/docx/utils/images.js +0 -26
- package/dist/tools/docx/utils/index.d.ts +0 -12
- package/dist/tools/docx/utils/index.js +0 -17
- package/dist/tools/docx/utils/markdown.d.ts +0 -13
- package/dist/tools/docx/utils/markdown.js +0 -32
- package/dist/tools/docx/utils/paths.d.ts +0 -15
- package/dist/tools/docx/utils/paths.js +0 -27
- package/dist/tools/docx/utils/versioning.d.ts +0 -25
- package/dist/tools/docx/utils/versioning.js +0 -55
- package/dist/tools/docx/utils.d.ts +0 -101
- package/dist/tools/docx/utils.js +0 -299
- package/dist/tools/docx/validate.d.ts +0 -33
- package/dist/tools/docx/validate.js +0 -49
- package/dist/tools/docx/validators.d.ts +0 -13
- package/dist/tools/docx/validators.js +0 -40
- package/dist/tools/docx/write.d.ts +0 -17
- package/dist/tools/docx/write.js +0 -88
- package/dist/tools/docx/xml-view-test.js +0 -63
- package/dist/tools/docx/xml-view.d.ts +0 -56
- package/dist/tools/docx/xml-view.js +0 -169
- package/dist/tools/docx/zip.d.ts +0 -21
- package/dist/tools/docx/zip.js +0 -35
- package/dist/tools/pdf-processor.js +0 -3
- package/dist/tools/search.d.ts +0 -32
- package/dist/tools/search.js +0 -202
- package/dist/ui/file-preview/src/app.d.ts +0 -4
- package/dist/ui/file-preview/src/app.js +0 -800
- package/dist/utils/crash-logger.d.ts +0 -18
- package/dist/utils/crash-logger.js +0 -44
- package/dist/utils/dedent.d.ts +0 -8
- package/dist/utils/dedent.js +0 -38
- /package/dist/{http-server-auto-tunnel.d.ts → ui/config-editor/main.d.ts} +0 -0
- /package/dist/{test-docx.d.ts → ui/config-editor/src/main.d.ts} +0 -0
- /package/dist/{tools/docx/xml-view-test.d.ts → ui/file-preview/main.d.ts} +0 -0
- /package/dist/ui/file-preview/src/components/{toolbar.d.ts → Toolbar.d.ts} +0 -0
- /package/dist/ui/file-preview/src/components/{toolbar.js → Toolbar.js} +0 -0
- /package/dist/{tools/pdf-processor.d.ts → ui/file-preview/src/model.js} +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { renderToolHeader } from '../../shared/tool-header.js';
|
|
2
|
+
export function renderConfigEditorToolbar(isExpanded, callToolAvailable) {
|
|
3
|
+
return renderToolHeader({
|
|
4
|
+
pillLabel: 'CFG',
|
|
5
|
+
pillClassName: 'file-pill--json',
|
|
6
|
+
title: 'Config Editor',
|
|
7
|
+
subtitle: 'Inspect and update runtime config safely.',
|
|
8
|
+
badges: [],
|
|
9
|
+
actionsHtml: `
|
|
10
|
+
<button class="icon-button icon-button--primary hidden" id="apply-config" type="button" title="Apply changes" aria-label="Apply changes" ${callToolAvailable ? '' : 'disabled'}>
|
|
11
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"></path></svg>
|
|
12
|
+
</button>
|
|
13
|
+
<button class="icon-button" id="toggle-expand" type="button" title="${isExpanded ? 'Collapse' : 'Expand'}" aria-label="${isExpanded ? 'Collapse' : 'Expand'}">${isExpanded
|
|
14
|
+
? '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M7 14l5-5 5 5z"></path></svg>'
|
|
15
|
+
: '<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M7 10l5 5 5-5z"></path></svg>'}</button>
|
|
16
|
+
`
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type contracts for Config Editor data models and host/tool interaction payloads. These definitions prevent runtime shape drift between parser, UI state, and RPC calls.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConfigStructuredContent {
|
|
5
|
+
config: Record<string, unknown>;
|
|
6
|
+
editableKeys: string[];
|
|
7
|
+
warnings?: string[];
|
|
8
|
+
}
|
|
9
|
+
export interface ToolResultShape {
|
|
10
|
+
structuredContent?: ConfigStructuredContent;
|
|
11
|
+
}
|
|
12
|
+
export interface ToolCallRequest {
|
|
13
|
+
name: string;
|
|
14
|
+
arguments: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
export type HostCallTool = (request: ToolCallRequest) => Promise<any>;
|
|
17
|
+
export declare function isObject(value: unknown): value is Record<string, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalization utilities for config values shown/edited in the UI. It handles stringify/parse edge cases so edits round-trip safely through tool calls.
|
|
3
|
+
*/
|
|
4
|
+
import type { ToolCallRequest } from '../types.js';
|
|
5
|
+
export declare function serializeConfigValue(raw: string): unknown;
|
|
6
|
+
export declare function buildSetConfigRequest(key: string, value: unknown): ToolCallRequest;
|
|
7
|
+
export declare function shouldAppendArrayValue(key: string, value: unknown): boolean;
|
|
8
|
+
export declare function formatValueForEditor(value: unknown): string;
|
|
9
|
+
export declare function valueToComparableJson(raw: string): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export function serializeConfigValue(raw) {
|
|
2
|
+
const trimmed = raw.trim();
|
|
3
|
+
if (trimmed.length === 0) {
|
|
4
|
+
return '';
|
|
5
|
+
}
|
|
6
|
+
if (trimmed === 'true') {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (trimmed === 'false') {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
if (trimmed === 'null') {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
if (/^-?\d+(\.\d+)?$/.test(trimmed)) {
|
|
16
|
+
return Number(trimmed);
|
|
17
|
+
}
|
|
18
|
+
if ((trimmed.startsWith('[') && trimmed.endsWith(']')) || (trimmed.startsWith('{') && trimmed.endsWith('}'))) {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(trimmed);
|
|
21
|
+
}
|
|
22
|
+
catch {
|
|
23
|
+
return raw;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return raw;
|
|
27
|
+
}
|
|
28
|
+
export function buildSetConfigRequest(key, value) {
|
|
29
|
+
return {
|
|
30
|
+
name: 'set_config_value',
|
|
31
|
+
arguments: {
|
|
32
|
+
key,
|
|
33
|
+
value
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function shouldAppendArrayValue(key, value) {
|
|
38
|
+
return (key === 'blockedCommands' || key === 'allowedDirectories') && typeof value === 'string' && value.trim().length > 0;
|
|
39
|
+
}
|
|
40
|
+
export function formatValueForEditor(value) {
|
|
41
|
+
if (typeof value === 'string') {
|
|
42
|
+
return value;
|
|
43
|
+
}
|
|
44
|
+
if (value === undefined) {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
return JSON.stringify(value, null, 2);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return String(value);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function valueToComparableJson(raw) {
|
|
55
|
+
try {
|
|
56
|
+
return JSON.stringify(serializeConfigValue(raw));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return raw;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { ConfigStructuredContent } from '../types.js';
|
|
2
|
+
import type { HostCallTool } from '../types.js';
|
|
3
|
+
type StatusTone = 'info' | 'success' | 'error';
|
|
4
|
+
export interface DirectoryBrowserElements {
|
|
5
|
+
browseControls: HTMLElement | null;
|
|
6
|
+
browseButton: HTMLButtonElement | null;
|
|
7
|
+
browserPanel: HTMLElement | null;
|
|
8
|
+
browserPath: HTMLElement | null;
|
|
9
|
+
browserStatus: HTMLElement | null;
|
|
10
|
+
browserList: HTMLElement | null;
|
|
11
|
+
}
|
|
12
|
+
interface DirectoryBrowserControllerOptions {
|
|
13
|
+
callTool: HostCallTool | null;
|
|
14
|
+
payload: ConfigStructuredContent;
|
|
15
|
+
elements: DirectoryBrowserElements;
|
|
16
|
+
onRender?: () => void;
|
|
17
|
+
setStatus: (message: string, tone?: StatusTone) => void;
|
|
18
|
+
getEditorValue: () => string;
|
|
19
|
+
setEditorValue: (nextValue: string) => void;
|
|
20
|
+
syncApplyVisibility: () => void;
|
|
21
|
+
}
|
|
22
|
+
export interface DirectoryBrowserController {
|
|
23
|
+
syncControls: (activeKey: string) => void;
|
|
24
|
+
toggle: () => Promise<void>;
|
|
25
|
+
close: () => void;
|
|
26
|
+
refresh: () => Promise<void>;
|
|
27
|
+
navigateUp: () => Promise<void>;
|
|
28
|
+
selectCurrent: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function createDirectoryBrowserController(options: DirectoryBrowserControllerOptions): DirectoryBrowserController;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Directory browsing helpers used when config values reference filesystem paths. It encapsulates browse call orchestration and response validation for consistent UX.
|
|
3
|
+
*/
|
|
4
|
+
import { escapeHtml } from '../../../shared/escape-html.js';
|
|
5
|
+
import { isObject } from '../types.js';
|
|
6
|
+
import { extractToolText, unwrapToolResult } from './parsing.js';
|
|
7
|
+
import { serializeConfigValue } from './config-values.js';
|
|
8
|
+
function getDefaultBrowsePath(payload) {
|
|
9
|
+
const configured = payload.config.allowedDirectories;
|
|
10
|
+
if (Array.isArray(configured) && configured.length > 0 && typeof configured[0] === 'string' && configured[0].trim().length > 0) {
|
|
11
|
+
return configured[0];
|
|
12
|
+
}
|
|
13
|
+
const systemInfo = payload.config.systemInfo;
|
|
14
|
+
if (isObject(systemInfo) && isObject(systemInfo.examplePaths) && typeof systemInfo.examplePaths.home === 'string') {
|
|
15
|
+
return systemInfo.examplePaths.home;
|
|
16
|
+
}
|
|
17
|
+
return '/';
|
|
18
|
+
}
|
|
19
|
+
function splitDirectoryLine(line) {
|
|
20
|
+
const marker = '[DIR] ';
|
|
21
|
+
if (!line.startsWith(marker)) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
return line.slice(marker.length).trim();
|
|
25
|
+
}
|
|
26
|
+
function parseDirectoryEntries(listText) {
|
|
27
|
+
const lines = listText.split('\n');
|
|
28
|
+
const entries = [];
|
|
29
|
+
for (const line of lines) {
|
|
30
|
+
const entry = splitDirectoryLine(line.trim());
|
|
31
|
+
if (entry && !entry.includes('/') && !entry.includes('\\')) {
|
|
32
|
+
entries.push(entry);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return entries;
|
|
36
|
+
}
|
|
37
|
+
function joinPath(basePath, name) {
|
|
38
|
+
if (/^[A-Za-z]:\\?$/.test(basePath)) {
|
|
39
|
+
return `${basePath.replace(/[\\/]+$/, '')}\\${name}`;
|
|
40
|
+
}
|
|
41
|
+
if (basePath.endsWith('/')) {
|
|
42
|
+
return `${basePath}${name}`;
|
|
43
|
+
}
|
|
44
|
+
if (basePath.endsWith('\\')) {
|
|
45
|
+
return `${basePath}${name}`;
|
|
46
|
+
}
|
|
47
|
+
return `${basePath}/${name}`;
|
|
48
|
+
}
|
|
49
|
+
function getParentPath(currentPath) {
|
|
50
|
+
if (!currentPath) {
|
|
51
|
+
return '/';
|
|
52
|
+
}
|
|
53
|
+
if (/^[A-Za-z]:\\?$/.test(currentPath)) {
|
|
54
|
+
return currentPath;
|
|
55
|
+
}
|
|
56
|
+
const normalized = currentPath.replace(/[\\/]+$/, '');
|
|
57
|
+
if (normalized === '') {
|
|
58
|
+
return '/';
|
|
59
|
+
}
|
|
60
|
+
const slashIndex = Math.max(normalized.lastIndexOf('/'), normalized.lastIndexOf('\\'));
|
|
61
|
+
if (slashIndex <= 0) {
|
|
62
|
+
if (normalized.includes('\\')) {
|
|
63
|
+
return normalized.slice(0, slashIndex + 1) || normalized;
|
|
64
|
+
}
|
|
65
|
+
return '/';
|
|
66
|
+
}
|
|
67
|
+
return normalized.slice(0, slashIndex);
|
|
68
|
+
}
|
|
69
|
+
function addDirectoryToEditorValue(currentRaw, selectedPath) {
|
|
70
|
+
const parsed = serializeConfigValue(currentRaw);
|
|
71
|
+
const values = Array.isArray(parsed) ? [...parsed] : [];
|
|
72
|
+
if (!values.includes(selectedPath)) {
|
|
73
|
+
values.push(selectedPath);
|
|
74
|
+
}
|
|
75
|
+
return JSON.stringify(values, null, 2);
|
|
76
|
+
}
|
|
77
|
+
function renderDirectoryRows(directories) {
|
|
78
|
+
if (directories.length === 0) {
|
|
79
|
+
return '<p class="browser-empty">No subdirectories found.</p>';
|
|
80
|
+
}
|
|
81
|
+
return directories.map((name) => `
|
|
82
|
+
<div class="browser-item">
|
|
83
|
+
<span class="browser-name"><span class="folder-icon" aria-hidden="true"><svg viewBox="0 0 24 24" focusable="false"><path d="M10 4l2 2h8v12H4V4z"></path></svg></span>${escapeHtml(name)}</span>
|
|
84
|
+
<div class="browser-row-actions">
|
|
85
|
+
<button type="button" class="ghost browser-open icon-only" data-name="${escapeHtml(name)}" title="Open ${escapeHtml(name)}" aria-label="Open ${escapeHtml(name)}">
|
|
86
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M10 17l5-5-5-5v10z"></path></svg>
|
|
87
|
+
</button>
|
|
88
|
+
<button type="button" class="browser-select icon-only" data-name="${escapeHtml(name)}" title="Add ${escapeHtml(name)}" aria-label="Add ${escapeHtml(name)} to allowed directories">
|
|
89
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M19 11h-6V5h-2v6H5v2h6v6h2v-6h6z"></path></svg>
|
|
90
|
+
</button>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
`).join('');
|
|
94
|
+
}
|
|
95
|
+
export function createDirectoryBrowserController(options) {
|
|
96
|
+
const { callTool, payload, elements, onRender, setStatus, getEditorValue, setEditorValue, syncApplyVisibility } = options;
|
|
97
|
+
const { browseControls, browseButton, browserPanel, browserPath, browserStatus, browserList } = elements;
|
|
98
|
+
let browserCurrentPath = getDefaultBrowsePath(payload);
|
|
99
|
+
let browserOpen = false;
|
|
100
|
+
const selectCurrent = () => {
|
|
101
|
+
const nextValue = addDirectoryToEditorValue(getEditorValue(), browserCurrentPath);
|
|
102
|
+
setEditorValue(nextValue);
|
|
103
|
+
setStatus(`Added ${browserCurrentPath} to allowedDirectories. Click Apply to save.`, 'info');
|
|
104
|
+
syncApplyVisibility();
|
|
105
|
+
};
|
|
106
|
+
const bindDirectoryRowActions = () => {
|
|
107
|
+
if (!browserList) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const openButtons = Array.from(browserList.querySelectorAll('.browser-open'));
|
|
111
|
+
const selectButtons = Array.from(browserList.querySelectorAll('.browser-select'));
|
|
112
|
+
openButtons.forEach((button) => {
|
|
113
|
+
button.addEventListener('click', async () => {
|
|
114
|
+
const name = button.dataset.name;
|
|
115
|
+
if (!name) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
browserCurrentPath = joinPath(browserCurrentPath, name);
|
|
119
|
+
await refresh();
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
selectButtons.forEach((button) => {
|
|
123
|
+
button.addEventListener('click', () => {
|
|
124
|
+
const name = button.dataset.name;
|
|
125
|
+
if (!name) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
browserCurrentPath = joinPath(browserCurrentPath, name);
|
|
129
|
+
selectCurrent();
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
const refresh = async () => {
|
|
134
|
+
if (!callTool || !browserPath || !browserStatus || !browserList) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
browserPath.textContent = browserCurrentPath;
|
|
138
|
+
browserStatus.textContent = `Loading ${browserCurrentPath}...`;
|
|
139
|
+
browserList.innerHTML = '';
|
|
140
|
+
try {
|
|
141
|
+
const result = unwrapToolResult(await callTool({
|
|
142
|
+
name: 'list_directory',
|
|
143
|
+
arguments: { path: browserCurrentPath, depth: 1 },
|
|
144
|
+
}));
|
|
145
|
+
const directories = parseDirectoryEntries(extractToolText(result));
|
|
146
|
+
browserStatus.textContent = '';
|
|
147
|
+
browserList.innerHTML = renderDirectoryRows(directories);
|
|
148
|
+
bindDirectoryRowActions();
|
|
149
|
+
onRender?.();
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
browserStatus.textContent = `Failed to list ${browserCurrentPath}: ${error instanceof Error ? error.message : String(error)}`;
|
|
153
|
+
onRender?.();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
const close = () => {
|
|
157
|
+
browserOpen = false;
|
|
158
|
+
browserPanel?.classList.add('hidden');
|
|
159
|
+
browseButton?.classList.remove('active');
|
|
160
|
+
onRender?.();
|
|
161
|
+
};
|
|
162
|
+
const syncControls = (activeKey) => {
|
|
163
|
+
const enabled = activeKey === 'allowedDirectories';
|
|
164
|
+
browseControls?.classList.toggle('hidden', !enabled);
|
|
165
|
+
browseButton?.classList.toggle('active', enabled && browserOpen);
|
|
166
|
+
if (!enabled) {
|
|
167
|
+
close();
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
const toggle = async () => {
|
|
171
|
+
if (!callTool || !browserPanel) {
|
|
172
|
+
setStatus('MCP RPC unavailable. Cannot browse directories from widget.', 'error');
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
browserOpen = !browserOpen;
|
|
176
|
+
browserPanel.classList.toggle('hidden', !browserOpen);
|
|
177
|
+
browseButton?.classList.toggle('active', browserOpen);
|
|
178
|
+
if (browserOpen) {
|
|
179
|
+
browserCurrentPath = getDefaultBrowsePath(payload);
|
|
180
|
+
await refresh();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
onRender?.();
|
|
184
|
+
};
|
|
185
|
+
const navigateUp = async () => {
|
|
186
|
+
const parent = getParentPath(browserCurrentPath);
|
|
187
|
+
if (parent === browserCurrentPath) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
browserCurrentPath = parent;
|
|
191
|
+
await refresh();
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
syncControls,
|
|
195
|
+
toggle,
|
|
196
|
+
close,
|
|
197
|
+
refresh,
|
|
198
|
+
navigateUp,
|
|
199
|
+
selectCurrent,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input parsing and guard functions for Config Editor payloads. It defensively converts unknown host data into validated internal structures with clear failure handling.
|
|
3
|
+
*/
|
|
4
|
+
import type { ConfigStructuredContent } from '../types.js';
|
|
5
|
+
export declare function parseConfigStructuredContent(value: unknown): ConfigStructuredContent | undefined;
|
|
6
|
+
export declare function extractStructuredContent(value: unknown): ConfigStructuredContent | undefined;
|
|
7
|
+
export declare function unwrapToolResult(value: unknown): unknown;
|
|
8
|
+
export declare function extractToolText(value: unknown): string;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isObject } from '../types.js';
|
|
2
|
+
function isConfigStructuredContent(value) {
|
|
3
|
+
if (!isObject(value)) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
return isObject(value.config) && Array.isArray(value.editableKeys);
|
|
7
|
+
}
|
|
8
|
+
export function parseConfigStructuredContent(value) {
|
|
9
|
+
if (!isObject(value)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const candidate = value;
|
|
13
|
+
if (isConfigStructuredContent(candidate.structuredContent)) {
|
|
14
|
+
return candidate.structuredContent;
|
|
15
|
+
}
|
|
16
|
+
if (isConfigStructuredContent(value)) {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
export function extractStructuredContent(value) {
|
|
22
|
+
if (!isObject(value)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (value.method === 'ui/notifications/tool-result') {
|
|
26
|
+
const params = value.params;
|
|
27
|
+
const candidate = isObject(params) && isObject(params.result) ? params.result : params;
|
|
28
|
+
return parseConfigStructuredContent(candidate);
|
|
29
|
+
}
|
|
30
|
+
return parseConfigStructuredContent(value);
|
|
31
|
+
}
|
|
32
|
+
export function unwrapToolResult(value) {
|
|
33
|
+
if (!isObject(value)) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
if (isObject(value.result)) {
|
|
37
|
+
return value.result;
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
export function extractToolText(value) {
|
|
42
|
+
if (!isObject(value) || !Array.isArray(value.content)) {
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
const first = value.content[0];
|
|
46
|
+
if (!isObject(first) || typeof first.text !== 'string') {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
return first.text;
|
|
50
|
+
}
|