@wonderwhy-er/desktop-commander 0.2.38 ā 0.2.40
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 +53 -2
- package/dist/handlers/filesystem-handlers.d.ts +5 -0
- package/dist/handlers/filesystem-handlers.js +14 -2
- package/dist/remote-device/desktop-commander-integration.js +1 -1
- package/dist/search-manager.js +31 -38
- package/dist/server.js +9 -4
- package/dist/terminal-manager.js +4 -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/ui/config-editor/config-editor-runtime.js +65 -14096
- package/dist/ui/config-editor/styles.css +2 -1
- package/dist/ui/file-preview/preview-runtime.js +435 -26533
- package/dist/ui/file-preview/shared/preview-file-types.d.ts +1 -1
- package/dist/ui/file-preview/src/app.d.ts +1 -5
- package/dist/ui/file-preview/src/app.js +384 -534
- 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/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 +44 -0
- package/dist/ui/file-preview/src/markdown/controller.js +1040 -0
- package/dist/ui/file-preview/src/markdown/editor.d.ts +131 -0
- package/dist/ui/file-preview/src/markdown/editor.js +1479 -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/slugify.d.ts +3 -0
- package/dist/ui/file-preview/src/markdown/slugify.js +31 -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/model.d.ts +35 -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 +1066 -233
- package/dist/ui/shared/widget-state.d.ts +6 -1
- package/dist/ui/shared/widget-state.js +102 -4
- package/dist/utils/capture.js +1 -1
- package/dist/utils/files/base.d.ts +2 -0
- package/dist/utils/open-browser.js +1 -1
- package/dist/utils/toolHistory.d.ts +13 -0
- package/dist/utils/toolHistory.js +65 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +12 -1
- package/dist/data/spec-kit-prompts.json +0 -123
- package/dist/handlers/macos-control-handlers.d.ts +0 -16
- package/dist/handlers/macos-control-handlers.js +0 -81
- 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/lib.d.ts +0 -10
- package/dist/lib.js +0 -10
- 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-docx.d.ts +0 -1
- 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.d.ts +0 -1
- 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/macos-control/ax-adapter.d.ts +0 -55
- package/dist/tools/macos-control/ax-adapter.js +0 -438
- package/dist/tools/macos-control/cdp-adapter.d.ts +0 -23
- package/dist/tools/macos-control/cdp-adapter.js +0 -402
- package/dist/tools/macos-control/orchestrator.d.ts +0 -77
- package/dist/tools/macos-control/orchestrator.js +0 -136
- package/dist/tools/macos-control/role-aliases.d.ts +0 -5
- package/dist/tools/macos-control/role-aliases.js +0 -34
- package/dist/tools/macos-control/types.d.ts +0 -129
- package/dist/tools/macos-control/types.js +0 -1
- package/dist/tools/pdf-processor.d.ts +0 -1
- 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/components/toolbar.d.ts +0 -6
- package/dist/ui/file-preview/src/components/toolbar.js +0 -75
- package/dist/ui/shared/host-lifecycle.d.ts +0 -16
- package/dist/ui/shared/host-lifecycle.js +0 -35
- package/dist/ui/shared/rpc-client.d.ts +0 -14
- package/dist/ui/shared/rpc-client.js +0 -72
- package/dist/ui/shared/theme-adaptation.d.ts +0 -10
- package/dist/ui/shared/theme-adaptation.js +0 -118
- package/dist/ui/shared/tool-header.d.ts +0 -9
- package/dist/ui/shared/tool-header.js +0 -25
- 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/file-preview/src/model.js} +0 -0
|
@@ -23,6 +23,11 @@ export declare function isChatGPT(): boolean;
|
|
|
23
23
|
* Create a widget state storage adapter.
|
|
24
24
|
*
|
|
25
25
|
* On ChatGPT: Uses window.openai.widgetState for persistence
|
|
26
|
-
* On other hosts:
|
|
26
|
+
* On other hosts: Uses sessionStorage as a fallback so the preview can survive
|
|
27
|
+
* transient interruptions (page refresh on hosts that don't re-send tool_result,
|
|
28
|
+
* visibility/focus loss, etc.).
|
|
29
|
+
* The fallback cache key is scoped by app pathname and a per-frame widget id
|
|
30
|
+
* persisted in window.name, so different widgets in the same origin/session
|
|
31
|
+
* do not overwrite one another's cached state.
|
|
27
32
|
*/
|
|
28
33
|
export declare function createWidgetStateStorage<T>(validator?: (state: unknown) => boolean): WidgetStateStorage<T>;
|
|
@@ -9,6 +9,71 @@
|
|
|
9
9
|
* - ChatGPT: Uses window.openai.widgetState
|
|
10
10
|
* - Other hosts: No-op (rely on standard ui/notifications/tool-result)
|
|
11
11
|
*/
|
|
12
|
+
const FALLBACK_WIDGET_STATE_KEY_PREFIX = 'desktop-commander:widget-state';
|
|
13
|
+
const FALLBACK_WIDGET_INSTANCE_MARKER = '__dc_widget_id__:';
|
|
14
|
+
function createWidgetInstanceId() {
|
|
15
|
+
const cryptoObject = typeof globalThis.crypto === 'object' ? globalThis.crypto : undefined;
|
|
16
|
+
if (typeof cryptoObject?.randomUUID === 'function') {
|
|
17
|
+
return cryptoObject.randomUUID();
|
|
18
|
+
}
|
|
19
|
+
return `widget-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
|
|
20
|
+
}
|
|
21
|
+
function readWidgetInstanceIdFromWindowName(windowName) {
|
|
22
|
+
const markerIndex = windowName.indexOf(FALLBACK_WIDGET_INSTANCE_MARKER);
|
|
23
|
+
if (markerIndex === -1) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const encodedValue = windowName
|
|
27
|
+
.slice(markerIndex + FALLBACK_WIDGET_INSTANCE_MARKER.length)
|
|
28
|
+
.split('|', 1)[0];
|
|
29
|
+
if (!encodedValue) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
return decodeURIComponent(encodedValue);
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return encodedValue;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function getFallbackWidgetInstanceId() {
|
|
40
|
+
if (typeof window === 'undefined') {
|
|
41
|
+
return 'unknown-instance';
|
|
42
|
+
}
|
|
43
|
+
const currentWindowName = typeof window.name === 'string' ? window.name : '';
|
|
44
|
+
const existingInstanceId = readWidgetInstanceIdFromWindowName(currentWindowName);
|
|
45
|
+
if (existingInstanceId) {
|
|
46
|
+
return existingInstanceId;
|
|
47
|
+
}
|
|
48
|
+
const instanceId = createWidgetInstanceId();
|
|
49
|
+
const marker = `${FALLBACK_WIDGET_INSTANCE_MARKER}${encodeURIComponent(instanceId)}`;
|
|
50
|
+
try {
|
|
51
|
+
window.name = currentWindowName ? `${currentWindowName}|${marker}` : marker;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
// Ignore window.name write failures and fall back to the in-memory id.
|
|
55
|
+
}
|
|
56
|
+
return instanceId;
|
|
57
|
+
}
|
|
58
|
+
function getFallbackWidgetStateKey() {
|
|
59
|
+
if (typeof window === 'undefined') {
|
|
60
|
+
return `${FALLBACK_WIDGET_STATE_KEY_PREFIX}:unknown`;
|
|
61
|
+
}
|
|
62
|
+
const appPath = window.location.pathname || 'unknown';
|
|
63
|
+
const instanceId = getFallbackWidgetInstanceId();
|
|
64
|
+
return `${FALLBACK_WIDGET_STATE_KEY_PREFIX}:${appPath}:${encodeURIComponent(instanceId)}`;
|
|
65
|
+
}
|
|
66
|
+
function getSessionStorage() {
|
|
67
|
+
if (typeof window === 'undefined') {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
return window.sessionStorage;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
12
77
|
/**
|
|
13
78
|
* Check if we're running in ChatGPT (has special widget state API)
|
|
14
79
|
*/
|
|
@@ -20,14 +85,47 @@ export function isChatGPT() {
|
|
|
20
85
|
* Create a widget state storage adapter.
|
|
21
86
|
*
|
|
22
87
|
* On ChatGPT: Uses window.openai.widgetState for persistence
|
|
23
|
-
* On other hosts:
|
|
88
|
+
* On other hosts: Uses sessionStorage as a fallback so the preview can survive
|
|
89
|
+
* transient interruptions (page refresh on hosts that don't re-send tool_result,
|
|
90
|
+
* visibility/focus loss, etc.).
|
|
91
|
+
* The fallback cache key is scoped by app pathname and a per-frame widget id
|
|
92
|
+
* persisted in window.name, so different widgets in the same origin/session
|
|
93
|
+
* do not overwrite one another's cached state.
|
|
24
94
|
*/
|
|
25
95
|
export function createWidgetStateStorage(validator) {
|
|
26
96
|
if (!isChatGPT()) {
|
|
27
|
-
|
|
97
|
+
const storage = getSessionStorage();
|
|
98
|
+
const storageKey = getFallbackWidgetStateKey();
|
|
28
99
|
return {
|
|
29
|
-
read
|
|
30
|
-
|
|
100
|
+
read() {
|
|
101
|
+
if (!storage)
|
|
102
|
+
return undefined;
|
|
103
|
+
try {
|
|
104
|
+
const raw = storage.getItem(storageKey);
|
|
105
|
+
if (!raw)
|
|
106
|
+
return undefined;
|
|
107
|
+
const parsed = JSON.parse(raw);
|
|
108
|
+
const payload = parsed?.payload;
|
|
109
|
+
if (payload === undefined)
|
|
110
|
+
return undefined;
|
|
111
|
+
if (validator && !validator(payload))
|
|
112
|
+
return undefined;
|
|
113
|
+
return payload;
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
write(state) {
|
|
120
|
+
if (!storage)
|
|
121
|
+
return;
|
|
122
|
+
try {
|
|
123
|
+
storage.setItem(storageKey, JSON.stringify({ payload: state }));
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
// Ignore storage failures
|
|
127
|
+
}
|
|
128
|
+
}
|
|
31
129
|
};
|
|
32
130
|
}
|
|
33
131
|
// ChatGPT-specific implementation
|
package/dist/utils/capture.js
CHANGED
|
@@ -381,7 +381,7 @@ export const capture_call_tool = async (event, properties) => {
|
|
|
381
381
|
const GA_NEW_URL = `https://www.google-analytics.com/mp/collect?measurement_id=${GA_NEW_ID}&api_secret=${GA_NEW_SECRET}`;
|
|
382
382
|
// Route highest-volume tools to new property, rest to old
|
|
383
383
|
const HIGH_VOLUME_TOOLS = ['start_process', 'track_ui_event'];
|
|
384
|
-
const toolName = properties?.name;
|
|
384
|
+
const toolName = properties?.tool_name ?? properties?.name;
|
|
385
385
|
const gaUrl = HIGH_VOLUME_TOOLS.includes(toolName) ? GA_NEW_URL : GA_OLD_URL;
|
|
386
386
|
// Build properties once, send to GA4 + telemetry proxy in parallel
|
|
387
387
|
const eventProperties = await buildEventProperties(properties);
|
|
@@ -87,6 +87,8 @@ export interface FileResult {
|
|
|
87
87
|
export interface FileMetadata {
|
|
88
88
|
/** For images */
|
|
89
89
|
isImage?: boolean;
|
|
90
|
+
/** For directories (read_file fallback to listDirectory) */
|
|
91
|
+
isDirectory?: boolean;
|
|
90
92
|
/** For binary files */
|
|
91
93
|
isBinary?: boolean;
|
|
92
94
|
/** For Excel files */
|
|
@@ -24,7 +24,7 @@ export async function openBrowser(url) {
|
|
|
24
24
|
break;
|
|
25
25
|
case 'win32':
|
|
26
26
|
// Windows 'start' is a shell builtin, use spawn with shell but pass URL as separate arg
|
|
27
|
-
spawn('cmd', ['/c', 'start', '', url], { shell: false }).on('close', (code) => {
|
|
27
|
+
spawn('cmd', ['/c', 'start', '', url], { shell: false, windowsHide: true }).on('close', (code) => {
|
|
28
28
|
code === 0 ? resolve() : reject(new Error(`Exit code ${code}`));
|
|
29
29
|
});
|
|
30
30
|
break;
|
|
@@ -12,6 +12,8 @@ interface FormattedToolCallRecord extends Omit<ToolCallRecord, 'timestamp'> {
|
|
|
12
12
|
declare class ToolHistory {
|
|
13
13
|
private history;
|
|
14
14
|
private readonly MAX_ENTRIES;
|
|
15
|
+
private readonly MAX_HISTORY_FILE_SIZE_BYTES;
|
|
16
|
+
private readonly HISTORY_FILE_TRIM_TARGET_BYTES;
|
|
15
17
|
private readonly historyFile;
|
|
16
18
|
private writeQueue;
|
|
17
19
|
private isWriting;
|
|
@@ -21,6 +23,17 @@ declare class ToolHistory {
|
|
|
21
23
|
* Load history from disk (all instances share the same file)
|
|
22
24
|
*/
|
|
23
25
|
private loadFromDisk;
|
|
26
|
+
/**
|
|
27
|
+
* Trim the on-disk history file to stay under the size cap by dropping the
|
|
28
|
+
* oldest entries (lines) until the kept tail fits within the trim target.
|
|
29
|
+
* Returns true only when the file was actually rewritten with a smaller
|
|
30
|
+
* tail, so callers can fall through to their normal path on failure or
|
|
31
|
+
* no-op rather than mutating in-memory state.
|
|
32
|
+
*
|
|
33
|
+
* Always keeps at least the most recent entry, even if a single record
|
|
34
|
+
* exceeds the trim target ā there is no useful state below that.
|
|
35
|
+
*/
|
|
36
|
+
private trimHistoryFileIfTooLarge;
|
|
24
37
|
/**
|
|
25
38
|
* Trim history file to prevent it from growing indefinitely
|
|
26
39
|
*/
|
|
@@ -18,6 +18,11 @@ class ToolHistory {
|
|
|
18
18
|
constructor() {
|
|
19
19
|
this.history = [];
|
|
20
20
|
this.MAX_ENTRIES = 1000;
|
|
21
|
+
this.MAX_HISTORY_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
22
|
+
// When the file exceeds the cap we trim it down to this target instead of
|
|
23
|
+
// all the way to zero, so a single overflow doesn't cause every subsequent
|
|
24
|
+
// flush to re-trim.
|
|
25
|
+
this.HISTORY_FILE_TRIM_TARGET_BYTES = 4 * 1024 * 1024;
|
|
21
26
|
this.writeQueue = [];
|
|
22
27
|
this.isWriting = false;
|
|
23
28
|
// Store history in same directory as config to keep everything together
|
|
@@ -41,6 +46,9 @@ class ToolHistory {
|
|
|
41
46
|
if (!fs.existsSync(this.historyFile)) {
|
|
42
47
|
return;
|
|
43
48
|
}
|
|
49
|
+
// If the file is over the cap, trim it down before reading so we
|
|
50
|
+
// load a bounded amount.
|
|
51
|
+
this.trimHistoryFileIfTooLarge();
|
|
44
52
|
const content = fs.readFileSync(this.historyFile, 'utf-8');
|
|
45
53
|
const lines = content.trim().split('\n').filter(line => line.trim());
|
|
46
54
|
// Parse each line as JSON
|
|
@@ -64,6 +72,58 @@ class ToolHistory {
|
|
|
64
72
|
// Silently fail
|
|
65
73
|
}
|
|
66
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Trim the on-disk history file to stay under the size cap by dropping the
|
|
77
|
+
* oldest entries (lines) until the kept tail fits within the trim target.
|
|
78
|
+
* Returns true only when the file was actually rewritten with a smaller
|
|
79
|
+
* tail, so callers can fall through to their normal path on failure or
|
|
80
|
+
* no-op rather than mutating in-memory state.
|
|
81
|
+
*
|
|
82
|
+
* Always keeps at least the most recent entry, even if a single record
|
|
83
|
+
* exceeds the trim target ā there is no useful state below that.
|
|
84
|
+
*/
|
|
85
|
+
trimHistoryFileIfTooLarge() {
|
|
86
|
+
let stats;
|
|
87
|
+
try {
|
|
88
|
+
if (!fs.existsSync(this.historyFile)) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
stats = fs.statSync(this.historyFile);
|
|
92
|
+
if (stats.size <= this.MAX_HISTORY_FILE_SIZE_BYTES) {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
const content = fs.readFileSync(this.historyFile, 'utf-8');
|
|
101
|
+
const lines = content.split('\n').filter(line => line.length > 0);
|
|
102
|
+
if (lines.length === 0) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
// Walk lines from newest to oldest, accumulating bytes (line + '\n'),
|
|
106
|
+
// and keep as many as fit within the trim target. Always keep at
|
|
107
|
+
// least the last line.
|
|
108
|
+
const kept = [];
|
|
109
|
+
let bytes = 0;
|
|
110
|
+
for (let i = lines.length - 1; i >= 0; i--) {
|
|
111
|
+
const lineBytes = Buffer.byteLength(lines[i], 'utf-8') + 1; // +1 for '\n'
|
|
112
|
+
if (kept.length > 0 && bytes + lineBytes > this.HISTORY_FILE_TRIM_TARGET_BYTES) {
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
kept.push(lines[i]);
|
|
116
|
+
bytes += lineBytes;
|
|
117
|
+
}
|
|
118
|
+
kept.reverse();
|
|
119
|
+
fs.writeFileSync(this.historyFile, kept.join('\n') + '\n', 'utf-8');
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
// Trim failed; do not claim the file was changed.
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
67
127
|
/**
|
|
68
128
|
* Trim history file to prevent it from growing indefinitely
|
|
69
129
|
*/
|
|
@@ -101,6 +161,11 @@ class ToolHistory {
|
|
|
101
161
|
const toWrite = [...this.writeQueue];
|
|
102
162
|
this.writeQueue = [];
|
|
103
163
|
try {
|
|
164
|
+
// If the on-disk file has grown past the cap, trim it down to the
|
|
165
|
+
// target size (keeping the most recent entries) before appending.
|
|
166
|
+
// The in-memory cache is unaffected ā it is already bounded by
|
|
167
|
+
// MAX_ENTRIES via addCall.
|
|
168
|
+
this.trimHistoryFileIfTooLarge();
|
|
104
169
|
// Append to file (atomic append operation)
|
|
105
170
|
const lines = toWrite.map(entry => JSON.stringify(entry)).join('\n') + '\n';
|
|
106
171
|
fs.appendFileSync(this.historyFile, lines, 'utf-8');
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.2.
|
|
1
|
+
export declare const VERSION = "0.2.40";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.2.
|
|
1
|
+
export const VERSION = '0.2.40';
|
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.40",
|
|
4
4
|
"description": "MCP server for terminal operations and file editing",
|
|
5
5
|
"mcpName": "io.github.wonderwhy-er/desktop-commander",
|
|
6
6
|
"license": "MIT",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"release:dry": "node scripts/publish-release.cjs --dry-run",
|
|
54
54
|
"release:mcp": "node scripts/publish-release.cjs --mcp-only",
|
|
55
55
|
"release:alpha": "node scripts/publish-release.cjs --npm-only --alpha",
|
|
56
|
+
"release:skip-mcp": "node scripts/publish-release.cjs --skip-mcp",
|
|
56
57
|
"logs:view": "npm run build && node scripts/view-fuzzy-logs.js",
|
|
57
58
|
"logs:analyze": "npm run build && node scripts/analyze-fuzzy-logs.js",
|
|
58
59
|
"logs:clear": "npm run build && node scripts/clear-fuzzy-logs.js",
|
|
@@ -86,6 +87,14 @@
|
|
|
86
87
|
"@modelcontextprotocol/sdk": "^1.9.0",
|
|
87
88
|
"@opendocsg/pdf2md": "^0.2.2",
|
|
88
89
|
"@supabase/supabase-js": "^2.89.0",
|
|
90
|
+
"@tiptap/core": "^3.22.3",
|
|
91
|
+
"@tiptap/extension-image": "^3.22.3",
|
|
92
|
+
"@tiptap/extension-table": "^3.22.4",
|
|
93
|
+
"@tiptap/extension-table-cell": "^3.22.4",
|
|
94
|
+
"@tiptap/extension-table-header": "^3.22.4",
|
|
95
|
+
"@tiptap/extension-table-row": "^3.22.4",
|
|
96
|
+
"@tiptap/pm": "^3.22.3",
|
|
97
|
+
"@tiptap/starter-kit": "^3.22.3",
|
|
89
98
|
"@vscode/ripgrep": "^1.15.9",
|
|
90
99
|
"cross-fetch": "^4.1.0",
|
|
91
100
|
"exceljs": "^4.4.0",
|
|
@@ -103,6 +112,7 @@
|
|
|
103
112
|
"remark-gfm": "^4.0.1",
|
|
104
113
|
"remark-parse": "^11.0.0",
|
|
105
114
|
"sharp": "^0.34.5",
|
|
115
|
+
"tiptap-markdown": "^0.9.0",
|
|
106
116
|
"unified": "^11.0.5",
|
|
107
117
|
"unpdf": "^1.4.0",
|
|
108
118
|
"zod": "^3.24.1",
|
|
@@ -118,6 +128,7 @@
|
|
|
118
128
|
"commander": "^13.1.0",
|
|
119
129
|
"esbuild": "^0.27.2",
|
|
120
130
|
"js-tiktoken": "^1.0.21",
|
|
131
|
+
"jsdom": "^24.1.3",
|
|
121
132
|
"nexe": "^5.0.0-beta.4",
|
|
122
133
|
"nodemon": "^3.0.2",
|
|
123
134
|
"shx": "^0.3.4",
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "1.0.0",
|
|
3
|
-
"description": "Spec-Kit prompts for specification-driven development workflows",
|
|
4
|
-
"prompts": [
|
|
5
|
-
{
|
|
6
|
-
"id": "spec_001",
|
|
7
|
-
"title": "Initialize Spec-Kit Project",
|
|
8
|
-
"description": "Set up a new project with spec-driven development workflow including templates, scripts, and AI agent integration.",
|
|
9
|
-
"prompt": "Let's initialize a new spec-driven development project! šÆ\n\n**Project Setup Process:**\n\n1. **Check Current Environment**: I'll verify if we're already in a spec-kit project (look for `.specify` folder)\n2. **Initialize New Project**: Set up project structure with `specify init <project-name>`\n3. **Configure AI Integration**: Choose your preferred AI agent (claude, copilot, gemini, cursor, etc.)\n4. **Explain Workflow**: Show you the available slash commands and methodology\n\n**What's the name of your new project?**\n\n*Example: `my-photo-app` or `user-auth-service`*\n\nOnce initialized, you'll have access to the complete spec-driven workflow:\n⢠`/constitution` - Define project principles\n⢠`/specify` - Create feature specifications\n⢠`/plan` - Generate technical plans\n⢠`/tasks` - Break down into actionable tasks\n⢠`/implement` - Execute implementation\n\nReady to get started?",
|
|
10
|
-
"categories": ["spec-kit"],
|
|
11
|
-
"secondaryTag": "Setup",
|
|
12
|
-
"votes": 0,
|
|
13
|
-
"gaClicks": 0,
|
|
14
|
-
"icon": "Rocket",
|
|
15
|
-
"author": "GitHub Spec-Kit",
|
|
16
|
-
"verified": true
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "spec_002",
|
|
20
|
-
"title": "Create Project Constitution",
|
|
21
|
-
"description": "Define project principles and governance that will guide all development decisions and ensure consistency across features.",
|
|
22
|
-
"prompt": "Let's establish your project constitution - the foundational principles that will guide all development! š\n\n**Constitution Creation Process:**\n\n1. **Analyze Current Context**: I'll check if you already have a constitution and understand your project\n2. **Define Core Principles**: Create non-negotiable rules for your development process\n3. **Set Governance**: Establish how principles are updated and enforced\n4. **Sync Dependencies**: Ensure all templates align with your new principles\n\n**What principles should guide your project?**\n\n*Examples:*\n⢠Code quality standards (testing requirements, review processes)\n⢠User experience consistency (accessibility-first, performance targets)\n⢠Technical constraints (preferred frameworks, deployment requirements)\n⢠Security requirements (authentication standards, data protection)\n\n**Tell me about your project's core values and constraints:**\n\nI'll create a comprehensive constitution that includes:\n⢠Principle definitions with clear rationale\n⢠Amendment procedures and versioning\n⢠Compliance review expectations\n⢠Template synchronization\n\nThis becomes the foundation for all future specifications and technical decisions!",
|
|
23
|
-
"categories": ["spec-kit"],
|
|
24
|
-
"secondaryTag": "Setup",
|
|
25
|
-
"votes": 0,
|
|
26
|
-
"gaClicks": 0,
|
|
27
|
-
"icon": "BookOpen",
|
|
28
|
-
"author": "GitHub Spec-Kit",
|
|
29
|
-
"verified": true
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"id": "spec_003",
|
|
33
|
-
"title": "Create Feature Specification",
|
|
34
|
-
"description": "Generate a comprehensive feature specification from natural language description using spec-kit methodology and templates.",
|
|
35
|
-
"prompt": "Let's create a detailed feature specification using the spec-kit methodology! š\n\n**Specification Process:**\n\n1. **Create Feature Branch**: I'll run the create-new-feature script to set up a new branch and spec file\n2. **Generate Comprehensive Spec**: Use the spec-kit template to create:\n ⢠User scenarios and testing approaches\n ⢠Functional requirements (testable and unambiguous)\n ⢠Key entities and data models\n ⢠Success criteria and acceptance criteria\n3. **Mark Clarifications**: Highlight any areas that need more detail with [NEEDS CLARIFICATION] markers\n4. **Review Checklist**: Validate completeness and business alignment\n\n**What feature do you want to build?**\n\n*Be as detailed as possible about WHAT and WHY, avoid HOW:*\n\n*Examples:*\n⢠\"User authentication system with login, logout, and password reset\"\n⢠\"Photo album management with drag-and-drop organization\"\n⢠\"Real-time chat with message history and user presence\"\n⢠\"Task management with projects, assignments, and Kanban boards\"\n\n**Feature Description:**\n\nI'll focus on:\nā
What users need and why\nā
Business requirements and user scenarios\nā
Testable functional requirements\nā Technical implementation details (saved for planning phase)\n\nReady to create your specification?",
|
|
36
|
-
"categories": ["spec-kit"],
|
|
37
|
-
"secondaryTag": "Specification",
|
|
38
|
-
"votes": 0,
|
|
39
|
-
"gaClicks": 0,
|
|
40
|
-
"icon": "FileText",
|
|
41
|
-
"author": "GitHub Spec-Kit",
|
|
42
|
-
"verified": true
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"id": "spec_004",
|
|
46
|
-
"title": "Clarify Specification Requirements",
|
|
47
|
-
"description": "Run structured clarification workflow to resolve ambiguous requirements and ensure specification completeness before planning.",
|
|
48
|
-
"prompt": "Let's clarify any ambiguous areas in your specification before moving to technical planning! š\n\n**Clarification Workflow:**\n\n1. **Analyze Current Spec**: I'll read your feature specification and identify areas marked with [NEEDS CLARIFICATION]\n2. **Structured Questioning**: Ask targeted questions about:\n ⢠User types and permissions\n ⢠Data retention and deletion policies\n ⢠Performance targets and scale requirements\n ⢠Error handling behaviors\n ⢠Integration requirements\n3. **Document Answers**: Record all clarifications in the specification\n4. **Validate Completeness**: Ensure all requirements are testable and unambiguous\n\n**Current clarification areas in your spec:**\n\nI'll systematically work through each unclear aspect:\n⢠Who are the users and what are their roles?\n⢠What are the data and storage requirements?\n⢠What are the performance and scale expectations?\n⢠How should errors and edge cases be handled?\n⢠What integrations or external dependencies exist?\n\n**Ready to clarify your specification?**\n\n*This step is crucial for reducing rework during planning and implementation phases.*\n\nOnce clarified, your specification will be ready for technical planning with `/plan`!",
|
|
49
|
-
"categories": ["spec-kit"],
|
|
50
|
-
"secondaryTag": "Specification",
|
|
51
|
-
"votes": 0,
|
|
52
|
-
"gaClicks": 0,
|
|
53
|
-
"icon": "HelpCircle",
|
|
54
|
-
"author": "GitHub Spec-Kit",
|
|
55
|
-
"verified": true
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "spec_005",
|
|
59
|
-
"title": "Generate Technical Implementation Plan",
|
|
60
|
-
"description": "Create detailed technical plan from specification including architecture, tech stack, data models, and implementation strategy.",
|
|
61
|
-
"prompt": "Let's create a comprehensive technical implementation plan for your feature! šļø\n\n**Planning Process:**\n\n1. **Analyze Specification**: I'll read your feature spec and understand all requirements\n2. **Check Constitution**: Ensure alignment with project principles and constraints\n3. **Generate Implementation Plan**: Create detailed technical plan including:\n ⢠Architecture and tech stack decisions\n ⢠Data models based on key entities\n ⢠API contracts and interfaces\n ⢠Research for technical decisions\n ⢠Quickstart validation scenarios\n4. **Validate Against Gates**: Check simplicity, anti-abstraction, and constitutional compliance\n\n**What's your preferred technology approach?**\n\n*Specify your tech stack and architectural preferences:*\n\n*Examples:*\n⢠\"React with TypeScript, Node.js backend, PostgreSQL database\"\n⢠\"Vanilla HTML/CSS/JavaScript, SQLite for local storage\"\n⢠\"Python FastAPI, Redis for caching, Docker deployment\"\n⢠\"Vue.js frontend, .NET Core API, SQL Server database\"\n\n**Technical Context:**\n\nI'll generate:\nš **Implementation Plan** - Architecture and approach\nšļø **Data Model** - Entities and relationships\nš **API Contracts** - Endpoints and specifications\nš¬ **Research Notes** - Technical decisions and rationale\nā” **Quickstart Guide** - Key validation scenarios\n\nReady to create your technical plan?",
|
|
62
|
-
"categories": ["spec-kit"],
|
|
63
|
-
"secondaryTag": "Planning",
|
|
64
|
-
"votes": 0,
|
|
65
|
-
"gaClicks": 0,
|
|
66
|
-
"icon": "Blueprint",
|
|
67
|
-
"author": "GitHub Spec-Kit",
|
|
68
|
-
"verified": true
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"id": "spec_006",
|
|
72
|
-
"title": "Generate Implementation Tasks",
|
|
73
|
-
"description": "Break down technical plan into actionable, dependency-ordered tasks ready for execution with parallel execution markers.",
|
|
74
|
-
"prompt": "Let's break down your implementation plan into actionable tasks! ā
\n\n**Task Generation Process:**\n\n1. **Analyze Design Artifacts**: I'll read your plan.md, data-model.md, contracts/, and other design documents\n2. **Generate Task Breakdown**: Create specific tasks organized by phases:\n ⢠**Setup Tasks**: Project init, dependencies, configuration\n ⢠**Test Tasks [P]**: Contract tests, integration scenarios (parallel)\n ⢠**Core Tasks**: Models, services, CLI commands, endpoints\n ⢠**Integration Tasks**: Database, middleware, logging\n ⢠**Polish Tasks [P]**: Unit tests, performance, docs (parallel)\n3. **Order Dependencies**: Ensure proper execution sequence (TDD approach)\n4. **Mark Parallelization**: Identify tasks that can run simultaneously with [P]\n\n**Task Generation Rules:**\n⢠Each contract ā test task marked [P]\n⢠Each entity ā model creation task marked [P]\n⢠Each endpoint ā implementation task\n⢠Different files = parallel [P]\n⢠Same files = sequential\n⢠Tests before implementation (TDD)\n\n**Additional context for task generation:**\n\n*Any specific requirements or preferences for the implementation approach?*\n\nI'll create a `tasks.md` file with:\nš **Numbered Tasks** (T001, T002, etc.)\nš **File Paths** for each task\nš **Dependencies** clearly marked\nā” **Parallel Groups** for efficient execution\n\nReady to generate your implementation tasks?",
|
|
75
|
-
"categories": ["spec-kit"],
|
|
76
|
-
"secondaryTag": "Planning",
|
|
77
|
-
"votes": 0,
|
|
78
|
-
"gaClicks": 0,
|
|
79
|
-
"icon": "CheckSquare",
|
|
80
|
-
"author": "GitHub Spec-Kit",
|
|
81
|
-
"verified": true
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"id": "spec_007",
|
|
85
|
-
"title": "Execute Feature Implementation",
|
|
86
|
-
"description": "Execute all implementation tasks following the task breakdown with TDD approach, dependency management, and progress tracking.",
|
|
87
|
-
"prompt": "Let's implement your feature following the spec-driven task breakdown! š\n\n**Implementation Process:**\n\n1. **Load Implementation Context**: I'll read all your design documents:\n ⢠tasks.md (execution plan)\n ⢠plan.md (architecture and tech stack)\n ⢠data-model.md (entities and relationships)\n ⢠contracts/ (API specifications)\n ⢠research.md (technical decisions)\n\n2. **Execute Phase-by-Phase**:\n ⢠**Setup**: Project structure, dependencies, configuration\n ⢠**Tests**: Contract tests and integration scenarios (TDD)\n ⢠**Core**: Models, services, CLI commands, endpoints\n ⢠**Integration**: Database, middleware, logging\n ⢠**Polish**: Unit tests, performance, documentation\n\n3. **Follow Execution Rules**:\n ⢠Respect task dependencies (sequential vs parallel)\n ⢠Tests before implementation (TDD approach)\n ⢠File-based coordination (same file = sequential)\n ⢠Mark completed tasks with [X]\n\n4. **Progress Tracking**: Report after each completed task with validation\n\n**Implementation preferences:**\n\n*Any specific notes for the implementation (deployment targets, testing frameworks, etc.)?*\n\nI'll execute tasks systematically:\nā
**Validate Prerequisites** - All documents ready\nš **Phase-by-Phase Execution** - Setup ā Tests ā Core ā Integration ā Polish\nš **Real-time Progress** - Track completion and handle errors\nšÆ **Final Validation** - Ensure specs match implementation\n\nReady to build your feature?",
|
|
88
|
-
"categories": ["spec-kit"],
|
|
89
|
-
"secondaryTag": "Implementation",
|
|
90
|
-
"votes": 0,
|
|
91
|
-
"gaClicks": 0,
|
|
92
|
-
"icon": "Play",
|
|
93
|
-
"author": "GitHub Spec-Kit",
|
|
94
|
-
"verified": true
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
"id": "spec_008",
|
|
98
|
-
"title": "Analyze Spec-Kit Project Status",
|
|
99
|
-
"description": "Comprehensive analysis of current spec-kit project state including features, phases, and recommended next steps.",
|
|
100
|
-
"prompt": "Let me analyze your spec-kit project and show you the current state! š\n\n**Project Analysis Process:**\n\n1. **Project Structure Review**: I'll examine your `.specify` directory and validate:\n ⢠Templates and scripts availability\n ⢠Project constitution and principles\n ⢠Current branch and feature context\n\n2. **Feature Inventory**: Scan the `specs/` directory to identify:\n ⢠All features and their completion status\n ⢠Current phase (specification, planning, tasks, implementation)\n ⢠Missing or incomplete artifacts\n\n3. **Health Check**: Verify project follows spec-kit best practices:\n ⢠All required templates present\n ⢠Script permissions and functionality\n ⢠Git branch structure and workflow\n\n4. **Progress Assessment**: For the current feature:\n ⢠What phase are you in?\n ⢠What files exist vs. what's missing?\n ⢠What's the logical next step?\n\n**Current Project Overview:**\n\nI'll provide:\nš **Feature Status Matrix** - All features and their phases\nšÆ **Current Focus** - Active feature and next steps\nāļø **Configuration Health** - Templates and scripts status\nš **Recommendations** - Suggested workflow continuations\n\n**Any specific areas you'd like me to focus on?**\n\n*Examples: \"Focus on feature completion status\" or \"Check for any configuration issues\"*\n\nLet me give you a complete project status report!",
|
|
101
|
-
"categories": ["spec-kit"],
|
|
102
|
-
"secondaryTag": "Analysis",
|
|
103
|
-
"votes": 0,
|
|
104
|
-
"gaClicks": 0,
|
|
105
|
-
"icon": "BarChart3",
|
|
106
|
-
"author": "GitHub Spec-Kit",
|
|
107
|
-
"verified": true
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"id": "spec_009",
|
|
111
|
-
"title": "Validate Spec-Kit Workflow Compliance",
|
|
112
|
-
"description": "Check project adherence to spec-kit methodology and constitutional requirements with recommendations for improvements.",
|
|
113
|
-
"prompt": "Let's validate your project's compliance with spec-kit methodology and constitutional requirements! ā
\n\n**Compliance Validation Process:**\n\n1. **Constitutional Compliance**: I'll check if your features align with project constitution:\n ⢠Principle adherence in specifications\n ⢠Technical decisions follow governance\n ⢠Implementation respects constraints\n\n2. **Methodology Validation**: Verify proper spec-kit workflow:\n ⢠Specifications focus on WHAT/WHY (not HOW)\n ⢠Technical plans follow from specifications\n ⢠Tasks properly break down implementation\n ⢠Test-driven development approach\n\n3. **Quality Assessment**: Review specification and planning quality:\n ⢠Requirements are testable and unambiguous\n ⢠No [NEEDS CLARIFICATION] markers remain\n ⢠Success criteria are measurable\n ⢠Technical decisions have clear rationale\n\n4. **Process Adherence**: Check workflow execution:\n ⢠Proper phase progression (spec ā plan ā tasks ā implement)\n ⢠Branch management and version control\n ⢠Documentation completeness\n\n**Compliance Report:**\n\nI'll generate:\nš **Constitutional Alignment** - Principle compliance score\nš **Workflow Adherence** - Methodology following assessment\nš **Quality Metrics** - Specification and planning quality\nā ļø **Issue Identification** - Areas needing attention\nšÆ **Recommendations** - Specific improvement actions\n\n**Any specific compliance areas you're concerned about?**\n\nReady for a complete compliance assessment?",
|
|
114
|
-
"categories": ["spec-kit"],
|
|
115
|
-
"secondaryTag": "Analysis",
|
|
116
|
-
"votes": 0,
|
|
117
|
-
"gaClicks": 0,
|
|
118
|
-
"icon": "Shield",
|
|
119
|
-
"author": "GitHub Spec-Kit",
|
|
120
|
-
"verified": true
|
|
121
|
-
}
|
|
122
|
-
]
|
|
123
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ServerResult } from '../types.js';
|
|
2
|
-
export declare function handleMacosAxStatus(args: unknown): Promise<ServerResult>;
|
|
3
|
-
export declare function handleMacosAxListApps(args: unknown): Promise<ServerResult>;
|
|
4
|
-
export declare function handleMacosAxListElements(args: unknown): Promise<ServerResult>;
|
|
5
|
-
export declare function handleMacosAxFind(args: unknown): Promise<ServerResult>;
|
|
6
|
-
export declare function handleMacosAxGetState(args: unknown): Promise<ServerResult>;
|
|
7
|
-
export declare function handleMacosAxFindAndClick(args: unknown): Promise<ServerResult>;
|
|
8
|
-
export declare function handleMacosAxClick(args: unknown): Promise<ServerResult>;
|
|
9
|
-
export declare function handleMacosAxType(args: unknown): Promise<ServerResult>;
|
|
10
|
-
export declare function handleMacosAxKey(args: unknown): Promise<ServerResult>;
|
|
11
|
-
export declare function handleMacosAxActivate(args: unknown): Promise<ServerResult>;
|
|
12
|
-
export declare function handleMacosAxWaitFor(args: unknown): Promise<ServerResult>;
|
|
13
|
-
export declare function handleMacosAxBatch(args: unknown): Promise<ServerResult>;
|
|
14
|
-
export declare function handleElectronDebugAttach(args: unknown): Promise<ServerResult>;
|
|
15
|
-
export declare function handleElectronDebugEval(args: unknown): Promise<ServerResult>;
|
|
16
|
-
export declare function handleElectronDebugDisconnect(args: unknown): Promise<ServerResult>;
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { MacosAxStatusArgsSchema, MacosAxListAppsArgsSchema, MacosAxListElementsArgsSchema, MacosAxFindArgsSchema, MacosAxGetStateArgsSchema, MacosAxFindAndClickArgsSchema, MacosAxClickArgsSchema, MacosAxTypeArgsSchema, MacosAxKeyArgsSchema, MacosAxActivateArgsSchema, MacosAxWaitForArgsSchema, MacosAxBatchArgsSchema, ElectronDebugAttachArgsSchema, ElectronDebugEvalArgsSchema, ElectronDebugDisconnectArgsSchema, } from '../tools/schemas.js';
|
|
2
|
-
import { macosControlOrchestrator } from '../tools/macos-control/orchestrator.js';
|
|
3
|
-
function toServerResult(result) {
|
|
4
|
-
if (!result?.ok) {
|
|
5
|
-
const message = result?.error?.message || 'macOS control request failed';
|
|
6
|
-
const code = result?.error?.code ? ` (${result.error.code})` : '';
|
|
7
|
-
return {
|
|
8
|
-
content: [{
|
|
9
|
-
type: 'text',
|
|
10
|
-
text: `Error${code}: ${message}`,
|
|
11
|
-
}],
|
|
12
|
-
isError: true,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
content: [{
|
|
17
|
-
type: 'text',
|
|
18
|
-
text: JSON.stringify(result.data ?? {}, null, 2),
|
|
19
|
-
}],
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export async function handleMacosAxStatus(args) {
|
|
23
|
-
MacosAxStatusArgsSchema.parse(args || {});
|
|
24
|
-
return toServerResult(await macosControlOrchestrator.axStatus());
|
|
25
|
-
}
|
|
26
|
-
export async function handleMacosAxListApps(args) {
|
|
27
|
-
MacosAxListAppsArgsSchema.parse(args || {});
|
|
28
|
-
return toServerResult(await macosControlOrchestrator.axListApps());
|
|
29
|
-
}
|
|
30
|
-
export async function handleMacosAxListElements(args) {
|
|
31
|
-
const parsed = MacosAxListElementsArgsSchema.parse(args || {});
|
|
32
|
-
return toServerResult(await macosControlOrchestrator.axListElements(parsed));
|
|
33
|
-
}
|
|
34
|
-
export async function handleMacosAxFind(args) {
|
|
35
|
-
const parsed = MacosAxFindArgsSchema.parse(args);
|
|
36
|
-
return toServerResult(await macosControlOrchestrator.axFind(parsed));
|
|
37
|
-
}
|
|
38
|
-
export async function handleMacosAxGetState(args) {
|
|
39
|
-
const parsed = MacosAxGetStateArgsSchema.parse(args);
|
|
40
|
-
return toServerResult(await macosControlOrchestrator.axGetState(parsed));
|
|
41
|
-
}
|
|
42
|
-
export async function handleMacosAxFindAndClick(args) {
|
|
43
|
-
const parsed = MacosAxFindAndClickArgsSchema.parse(args);
|
|
44
|
-
return toServerResult(await macosControlOrchestrator.axFindAndClick(parsed));
|
|
45
|
-
}
|
|
46
|
-
export async function handleMacosAxClick(args) {
|
|
47
|
-
const parsed = MacosAxClickArgsSchema.parse(args);
|
|
48
|
-
return toServerResult(await macosControlOrchestrator.axClick(parsed));
|
|
49
|
-
}
|
|
50
|
-
export async function handleMacosAxType(args) {
|
|
51
|
-
const parsed = MacosAxTypeArgsSchema.parse(args);
|
|
52
|
-
return toServerResult(await macosControlOrchestrator.axType(parsed.text));
|
|
53
|
-
}
|
|
54
|
-
export async function handleMacosAxKey(args) {
|
|
55
|
-
const parsed = MacosAxKeyArgsSchema.parse(args);
|
|
56
|
-
return toServerResult(await macosControlOrchestrator.axKey(parsed.key, parsed.modifiers ?? []));
|
|
57
|
-
}
|
|
58
|
-
export async function handleMacosAxActivate(args) {
|
|
59
|
-
const parsed = MacosAxActivateArgsSchema.parse(args);
|
|
60
|
-
return toServerResult(await macosControlOrchestrator.axActivate(parsed.app));
|
|
61
|
-
}
|
|
62
|
-
export async function handleMacosAxWaitFor(args) {
|
|
63
|
-
const parsed = MacosAxWaitForArgsSchema.parse(args);
|
|
64
|
-
return toServerResult(await macosControlOrchestrator.axWaitFor(parsed));
|
|
65
|
-
}
|
|
66
|
-
export async function handleMacosAxBatch(args) {
|
|
67
|
-
const parsed = MacosAxBatchArgsSchema.parse(args);
|
|
68
|
-
return toServerResult(await macosControlOrchestrator.axBatch(parsed.commands, parsed.stopOnError));
|
|
69
|
-
}
|
|
70
|
-
export async function handleElectronDebugAttach(args) {
|
|
71
|
-
const parsed = ElectronDebugAttachArgsSchema.parse(args || {});
|
|
72
|
-
return toServerResult(await macosControlOrchestrator.electronDebugAttach(parsed));
|
|
73
|
-
}
|
|
74
|
-
export async function handleElectronDebugEval(args) {
|
|
75
|
-
const parsed = ElectronDebugEvalArgsSchema.parse(args);
|
|
76
|
-
return toServerResult(await macosControlOrchestrator.electronDebugEval(parsed));
|
|
77
|
-
}
|
|
78
|
-
export async function handleElectronDebugDisconnect(args) {
|
|
79
|
-
const parsed = ElectronDebugDisconnectArgsSchema.parse(args);
|
|
80
|
-
return toServerResult(await macosControlOrchestrator.electronDebugDisconnect(parsed));
|
|
81
|
-
}
|