groove-dev 0.15.0 → 0.16.0
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/docs/FILE-EDITOR-PLAN.md +253 -0
- package/node_modules/@codemirror/autocomplete/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/autocomplete/CHANGELOG.md +639 -0
- package/node_modules/@codemirror/autocomplete/LICENSE +21 -0
- package/node_modules/@codemirror/autocomplete/README.md +43 -0
- package/node_modules/@codemirror/autocomplete/dist/index.cjs +2151 -0
- package/node_modules/@codemirror/autocomplete/dist/index.d.cts +648 -0
- package/node_modules/@codemirror/autocomplete/dist/index.d.ts +648 -0
- package/node_modules/@codemirror/autocomplete/dist/index.js +2120 -0
- package/node_modules/@codemirror/autocomplete/package.json +41 -0
- package/node_modules/@codemirror/commands/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/commands/CHANGELOG.md +386 -0
- package/node_modules/@codemirror/commands/LICENSE +21 -0
- package/node_modules/@codemirror/commands/README.md +35 -0
- package/node_modules/@codemirror/commands/dist/index.cjs +1909 -0
- package/node_modules/@codemirror/commands/dist/index.d.cts +650 -0
- package/node_modules/@codemirror/commands/dist/index.d.ts +650 -0
- package/node_modules/@codemirror/commands/dist/index.js +1795 -0
- package/node_modules/@codemirror/commands/package.json +42 -0
- package/node_modules/@codemirror/lang-css/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-css/CHANGELOG.md +106 -0
- package/node_modules/@codemirror/lang-css/LICENSE +21 -0
- package/node_modules/@codemirror/lang-css/README.md +50 -0
- package/node_modules/@codemirror/lang-css/dist/index.cjs +269 -0
- package/node_modules/@codemirror/lang-css/dist/index.d.cts +28 -0
- package/node_modules/@codemirror/lang-css/dist/index.d.ts +28 -0
- package/node_modules/@codemirror/lang-css/dist/index.js +264 -0
- package/node_modules/@codemirror/lang-css/package.json +42 -0
- package/node_modules/@codemirror/lang-html/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-html/CHANGELOG.md +210 -0
- package/node_modules/@codemirror/lang-html/LICENSE +21 -0
- package/node_modules/@codemirror/lang-html/README.md +147 -0
- package/node_modules/@codemirror/lang-html/dist/index.cjs +667 -0
- package/node_modules/@codemirror/lang-html/dist/index.d.cts +115 -0
- package/node_modules/@codemirror/lang-html/dist/index.d.ts +115 -0
- package/node_modules/@codemirror/lang-html/dist/index.js +661 -0
- package/node_modules/@codemirror/lang-html/package.json +46 -0
- package/node_modules/@codemirror/lang-javascript/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-javascript/CHANGELOG.md +206 -0
- package/node_modules/@codemirror/lang-javascript/LICENSE +21 -0
- package/node_modules/@codemirror/lang-javascript/README.md +125 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.cjs +526 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.d.cts +93 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.d.ts +93 -0
- package/node_modules/@codemirror/lang-javascript/dist/index.js +513 -0
- package/node_modules/@codemirror/lang-javascript/package.json +45 -0
- package/node_modules/@codemirror/lang-json/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-json/CHANGELOG.md +59 -0
- package/node_modules/@codemirror/lang-json/LICENSE +21 -0
- package/node_modules/@codemirror/lang-json/README.md +56 -0
- package/node_modules/@codemirror/lang-json/dist/index.cjs +68 -0
- package/node_modules/@codemirror/lang-json/dist/index.d.cts +22 -0
- package/node_modules/@codemirror/lang-json/dist/index.d.ts +22 -0
- package/node_modules/@codemirror/lang-json/dist/index.js +64 -0
- package/node_modules/@codemirror/lang-json/package.json +39 -0
- package/node_modules/@codemirror/lang-markdown/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-markdown/CHANGELOG.md +246 -0
- package/node_modules/@codemirror/lang-markdown/LICENSE +21 -0
- package/node_modules/@codemirror/lang-markdown/README.md +162 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.cjs +501 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.d.cts +124 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.d.ts +124 -0
- package/node_modules/@codemirror/lang-markdown/dist/index.js +492 -0
- package/node_modules/@codemirror/lang-markdown/package.json +44 -0
- package/node_modules/@codemirror/lang-python/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lang-python/CHANGELOG.md +174 -0
- package/node_modules/@codemirror/lang-python/LICENSE +21 -0
- package/node_modules/@codemirror/lang-python/README.md +61 -0
- package/node_modules/@codemirror/lang-python/dist/index.cjs +313 -0
- package/node_modules/@codemirror/lang-python/dist/index.d.cts +26 -0
- package/node_modules/@codemirror/lang-python/dist/index.d.ts +26 -0
- package/node_modules/@codemirror/lang-python/dist/index.js +308 -0
- package/node_modules/@codemirror/lang-python/package.json +42 -0
- package/node_modules/@codemirror/language/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/language/CHANGELOG.md +412 -0
- package/node_modules/@codemirror/language/LICENSE +21 -0
- package/node_modules/@codemirror/language/README.md +66 -0
- package/node_modules/@codemirror/language/dist/index.cjs +2742 -0
- package/node_modules/@codemirror/language/dist/index.d.cts +1220 -0
- package/node_modules/@codemirror/language/dist/index.d.ts +1220 -0
- package/node_modules/@codemirror/language/dist/index.js +2687 -0
- package/node_modules/@codemirror/language/package.json +44 -0
- package/node_modules/@codemirror/lint/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/lint/CHANGELOG.md +318 -0
- package/node_modules/@codemirror/lint/LICENSE +21 -0
- package/node_modules/@codemirror/lint/README.md +18 -0
- package/node_modules/@codemirror/lint/dist/index.cjs +958 -0
- package/node_modules/@codemirror/lint/dist/index.d.cts +195 -0
- package/node_modules/@codemirror/lint/dist/index.d.ts +195 -0
- package/node_modules/@codemirror/lint/dist/index.js +945 -0
- package/node_modules/@codemirror/lint/package.json +40 -0
- package/node_modules/@codemirror/search/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/search/CHANGELOG.md +324 -0
- package/node_modules/@codemirror/search/LICENSE +21 -0
- package/node_modules/@codemirror/search/README.md +18 -0
- package/node_modules/@codemirror/search/dist/index.cjs +1237 -0
- package/node_modules/@codemirror/search/dist/index.d.cts +385 -0
- package/node_modules/@codemirror/search/dist/index.d.ts +385 -0
- package/node_modules/@codemirror/search/dist/index.js +1217 -0
- package/node_modules/@codemirror/search/package.json +40 -0
- package/node_modules/@codemirror/state/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/state/CHANGELOG.md +308 -0
- package/node_modules/@codemirror/state/LICENSE +21 -0
- package/node_modules/@codemirror/state/README.md +18 -0
- package/node_modules/@codemirror/state/dist/index.cjs +3922 -0
- package/node_modules/@codemirror/state/dist/index.d.cts +1713 -0
- package/node_modules/@codemirror/state/dist/index.d.ts +1713 -0
- package/node_modules/@codemirror/state/dist/index.js +3892 -0
- package/node_modules/@codemirror/state/package.json +38 -0
- package/node_modules/@codemirror/theme-one-dark/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/theme-one-dark/CHANGELOG.md +97 -0
- package/node_modules/@codemirror/theme-one-dark/LICENSE +21 -0
- package/node_modules/@codemirror/theme-one-dark/README.md +46 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.cjs +139 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.d.cts +39 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.d.ts +39 -0
- package/node_modules/@codemirror/theme-one-dark/dist/index.js +134 -0
- package/node_modules/@codemirror/theme-one-dark/package.json +41 -0
- package/node_modules/@codemirror/view/.github/workflows/dispatch.yml +16 -0
- package/node_modules/@codemirror/view/CHANGELOG.md +2284 -0
- package/node_modules/@codemirror/view/LICENSE +21 -0
- package/node_modules/@codemirror/view/README.md +37 -0
- package/node_modules/@codemirror/view/dist/index.cjs +11796 -0
- package/node_modules/@codemirror/view/dist/index.d.cts +2389 -0
- package/node_modules/@codemirror/view/dist/index.d.ts +2389 -0
- package/node_modules/@codemirror/view/dist/index.js +11745 -0
- package/node_modules/@codemirror/view/package.json +41 -0
- package/node_modules/@groove-dev/daemon/src/api.js +157 -2
- package/node_modules/@groove-dev/daemon/src/filewatcher.js +59 -0
- package/node_modules/@groove-dev/daemon/src/index.js +28 -1
- package/node_modules/@groove-dev/daemon/src/skills.js +20 -0
- package/node_modules/@groove-dev/gui/dist/assets/index-Dxg9hdf3.js +103 -0
- package/node_modules/@groove-dev/gui/dist/index.html +1 -1
- package/node_modules/@groove-dev/gui/package.json +15 -2
- package/node_modules/@groove-dev/gui/src/App.jsx +3 -0
- package/node_modules/@groove-dev/gui/src/components/CodeEditor.jsx +143 -0
- package/node_modules/@groove-dev/gui/src/components/EditorTabs.jsx +83 -0
- package/node_modules/@groove-dev/gui/src/components/FileTree.jsx +193 -0
- package/node_modules/@groove-dev/gui/src/stores/groove.js +158 -1
- package/node_modules/@groove-dev/gui/src/views/FileEditor.jsx +142 -0
- package/node_modules/@groove-dev/gui/src/views/SkillsMarketplace.jsx +112 -1
- package/node_modules/@lezer/common/LICENSE +21 -0
- package/node_modules/@lezer/common/README.md +14 -0
- package/node_modules/@lezer/common/dist/index.cjs +2209 -0
- package/node_modules/@lezer/common/dist/index.d.cts +1174 -0
- package/node_modules/@lezer/common/dist/index.d.ts +1174 -0
- package/node_modules/@lezer/common/dist/index.js +2196 -0
- package/node_modules/@lezer/common/package.json +32 -0
- package/node_modules/@lezer/css/CHANGELOG.md +307 -0
- package/node_modules/@lezer/css/LICENSE +21 -0
- package/node_modules/@lezer/css/README.md +6 -0
- package/node_modules/@lezer/css/dist/index.cjs +151 -0
- package/node_modules/@lezer/css/dist/index.d.cts +3 -0
- package/node_modules/@lezer/css/dist/index.d.ts +3 -0
- package/node_modules/@lezer/css/dist/index.js +147 -0
- package/node_modules/@lezer/css/package.json +36 -0
- package/node_modules/@lezer/css/rollup.config.js +16 -0
- package/node_modules/@lezer/css/src/css.grammar +290 -0
- package/node_modules/@lezer/css/src/highlight.js +36 -0
- package/node_modules/@lezer/css/src/parser.js +31 -0
- package/node_modules/@lezer/css/src/parser.terms.js +63 -0
- package/node_modules/@lezer/css/src/tokens.js +75 -0
- package/node_modules/@lezer/css/test/declarations.txt +241 -0
- package/node_modules/@lezer/css/test/selector.txt +178 -0
- package/node_modules/@lezer/css/test/statements.txt +227 -0
- package/node_modules/@lezer/css/test/test-css.js +16 -0
- package/node_modules/@lezer/highlight/LICENSE +21 -0
- package/node_modules/@lezer/highlight/README.md +14 -0
- package/node_modules/@lezer/highlight/dist/index.cjs +936 -0
- package/node_modules/@lezer/highlight/dist/index.d.cts +623 -0
- package/node_modules/@lezer/highlight/dist/index.d.ts +623 -0
- package/node_modules/@lezer/highlight/dist/index.js +927 -0
- package/node_modules/@lezer/highlight/package.json +31 -0
- package/node_modules/@lezer/html/CHANGELOG.md +303 -0
- package/node_modules/@lezer/html/LICENSE +21 -0
- package/node_modules/@lezer/html/README.md +37 -0
- package/node_modules/@lezer/html/dist/index.cjs +354 -0
- package/node_modules/@lezer/html/dist/index.d.cts +14 -0
- package/node_modules/@lezer/html/dist/index.d.ts +14 -0
- package/node_modules/@lezer/html/dist/index.js +349 -0
- package/node_modules/@lezer/html/package.json +37 -0
- package/node_modules/@lezer/html/rollup.config.js +16 -0
- package/node_modules/@lezer/html/src/.tern-port +1 -0
- package/node_modules/@lezer/html/src/content.js +87 -0
- package/node_modules/@lezer/html/src/highlight.js +15 -0
- package/node_modules/@lezer/html/src/html.grammar +181 -0
- package/node_modules/@lezer/html/src/index.js +2 -0
- package/node_modules/@lezer/html/src/parser.js +27 -0
- package/node_modules/@lezer/html/src/parser.terms.js +53 -0
- package/node_modules/@lezer/html/src/tokens.js +199 -0
- package/node_modules/@lezer/html/test/mixed.txt +69 -0
- package/node_modules/@lezer/html/test/tags.txt +370 -0
- package/node_modules/@lezer/html/test/test-html.js +29 -0
- package/node_modules/@lezer/html/test/test-incremental.js +97 -0
- package/node_modules/@lezer/html/test/vue.txt +56 -0
- package/node_modules/@lezer/javascript/CHANGELOG.md +485 -0
- package/node_modules/@lezer/javascript/LICENSE +21 -0
- package/node_modules/@lezer/javascript/README.md +14 -0
- package/node_modules/@lezer/javascript/dist/index.cjs +196 -0
- package/node_modules/@lezer/javascript/dist/index.d.cts +3 -0
- package/node_modules/@lezer/javascript/dist/index.d.ts +3 -0
- package/node_modules/@lezer/javascript/dist/index.js +192 -0
- package/node_modules/@lezer/javascript/package.json +36 -0
- package/node_modules/@lezer/javascript/rollup.config.js +16 -0
- package/node_modules/@lezer/javascript/src/highlight.js +62 -0
- package/node_modules/@lezer/javascript/src/javascript.grammar +735 -0
- package/node_modules/@lezer/javascript/src/parser.js +33 -0
- package/node_modules/@lezer/javascript/src/parser.terms.js +177 -0
- package/node_modules/@lezer/javascript/src/tokens.js +87 -0
- package/node_modules/@lezer/javascript/test/decorator.txt +64 -0
- package/node_modules/@lezer/javascript/test/expression.txt +686 -0
- package/node_modules/@lezer/javascript/test/jsx.txt +79 -0
- package/node_modules/@lezer/javascript/test/semicolon.txt +77 -0
- package/node_modules/@lezer/javascript/test/statement.txt +404 -0
- package/node_modules/@lezer/javascript/test/test-javascript.js +17 -0
- package/node_modules/@lezer/javascript/test/typescript.txt +401 -0
- package/node_modules/@lezer/json/CHANGELOG.md +79 -0
- package/node_modules/@lezer/json/LICENSE +21 -0
- package/node_modules/@lezer/json/README.md +7 -0
- package/node_modules/@lezer/json/dist/index.cjs +41 -0
- package/node_modules/@lezer/json/dist/index.d.cts +3 -0
- package/node_modules/@lezer/json/dist/index.d.ts +3 -0
- package/node_modules/@lezer/json/dist/index.js +37 -0
- package/node_modules/@lezer/json/package.json +36 -0
- package/node_modules/@lezer/json/rollup.config.js +15 -0
- package/node_modules/@lezer/json/src/highlight.js +12 -0
- package/node_modules/@lezer/json/src/json.grammar +38 -0
- package/node_modules/@lezer/json/src/parser.js +23 -0
- package/node_modules/@lezer/json/src/parser.terms.js +12 -0
- package/node_modules/@lezer/json/test/arrays.txt +34 -0
- package/node_modules/@lezer/json/test/literals.txt +23 -0
- package/node_modules/@lezer/json/test/numbers.txt +87 -0
- package/node_modules/@lezer/json/test/objects.txt +34 -0
- package/node_modules/@lezer/json/test/strings.txt +50 -0
- package/node_modules/@lezer/json/test/test-json.js +17 -0
- package/node_modules/@lezer/lr/LICENSE +21 -0
- package/node_modules/@lezer/lr/README.md +25 -0
- package/node_modules/@lezer/lr/dist/constants.d.ts +45 -0
- package/node_modules/@lezer/lr/dist/constants.js +5 -0
- package/node_modules/@lezer/lr/dist/index.cjs +1891 -0
- package/node_modules/@lezer/lr/dist/index.d.cts +303 -0
- package/node_modules/@lezer/lr/dist/index.d.ts +303 -0
- package/node_modules/@lezer/lr/dist/index.js +1884 -0
- package/node_modules/@lezer/lr/package.json +32 -0
- package/node_modules/@lezer/markdown/CHANGELOG.md +279 -0
- package/node_modules/@lezer/markdown/LICENSE +21 -0
- package/node_modules/@lezer/markdown/README.md +725 -0
- package/node_modules/@lezer/markdown/bin/build-readme.cjs +39 -0
- package/node_modules/@lezer/markdown/build.js +16 -0
- package/node_modules/@lezer/markdown/dist/index.cjs +2352 -0
- package/node_modules/@lezer/markdown/dist/index.d.cts +600 -0
- package/node_modules/@lezer/markdown/dist/index.d.ts +600 -0
- package/node_modules/@lezer/markdown/dist/index.js +2335 -0
- package/node_modules/@lezer/markdown/package.json +37 -0
- package/node_modules/@lezer/markdown/src/README.md +83 -0
- package/node_modules/@lezer/markdown/src/extension.ts +301 -0
- package/node_modules/@lezer/markdown/src/index.ts +5 -0
- package/node_modules/@lezer/markdown/src/markdown.ts +1961 -0
- package/node_modules/@lezer/markdown/src/nest.ts +46 -0
- package/node_modules/@lezer/markdown/test/compare-tree.ts +14 -0
- package/node_modules/@lezer/markdown/test/spec.ts +79 -0
- package/node_modules/@lezer/markdown/test/test-extension.ts +269 -0
- package/node_modules/@lezer/markdown/test/test-incremental.ts +265 -0
- package/node_modules/@lezer/markdown/test/test-markdown.ts +3574 -0
- package/node_modules/@lezer/markdown/test/test-nesting.ts +86 -0
- package/node_modules/@lezer/markdown/test/tsconfig.json +12 -0
- package/node_modules/@lezer/markdown/tsconfig.json +14 -0
- package/node_modules/@lezer/python/CHANGELOG.md +243 -0
- package/node_modules/@lezer/python/LICENSE +21 -0
- package/node_modules/@lezer/python/README.md +6 -0
- package/node_modules/@lezer/python/dist/index.cjs +330 -0
- package/node_modules/@lezer/python/dist/index.d.cts +3 -0
- package/node_modules/@lezer/python/dist/index.d.ts +3 -0
- package/node_modules/@lezer/python/dist/index.js +326 -0
- package/node_modules/@lezer/python/package.json +36 -0
- package/node_modules/@lezer/python/rollup.config.js +16 -0
- package/node_modules/@lezer/python/src/highlight.js +35 -0
- package/node_modules/@lezer/python/src/python.grammar +381 -0
- package/node_modules/@lezer/python/src/tokens.js +224 -0
- package/node_modules/@lezer/python/test/expression.txt +231 -0
- package/node_modules/@lezer/python/test/statement.txt +442 -0
- package/node_modules/@lezer/python/test/test-incremental.js +33 -0
- package/node_modules/@lezer/python/test/test-python.js +17 -0
- package/node_modules/@marijn/find-cluster-break/LICENSE +21 -0
- package/node_modules/@marijn/find-cluster-break/README.md +28 -0
- package/node_modules/@marijn/find-cluster-break/dist/index.cjs +85 -0
- package/node_modules/@marijn/find-cluster-break/dist/index.d.cts +15 -0
- package/node_modules/@marijn/find-cluster-break/package.json +35 -0
- package/node_modules/@marijn/find-cluster-break/rollup.config.js +7 -0
- package/node_modules/@marijn/find-cluster-break/src/index.d.ts +15 -0
- package/node_modules/@marijn/find-cluster-break/src/index.js +87 -0
- package/node_modules/@marijn/find-cluster-break/test/test-cluster.js +30 -0
- package/node_modules/crelt/LICENSE +19 -0
- package/node_modules/crelt/README.md +23 -0
- package/node_modules/crelt/dist/index.cjs +31 -0
- package/node_modules/crelt/dist/index.d.cts +4 -0
- package/node_modules/crelt/index.d.ts +4 -0
- package/node_modules/crelt/index.js +28 -0
- package/node_modules/crelt/package.json +35 -0
- package/node_modules/crelt/rollup.config.js +13 -0
- package/node_modules/style-mod/LICENSE +19 -0
- package/node_modules/style-mod/README.md +98 -0
- package/node_modules/style-mod/dist/style-mod.cjs +165 -0
- package/node_modules/style-mod/dist/style-mod.d.cts +16 -0
- package/node_modules/style-mod/package.json +39 -0
- package/node_modules/style-mod/src/README.md +34 -0
- package/node_modules/style-mod/src/style-mod.d.ts +16 -0
- package/node_modules/style-mod/src/style-mod.js +172 -0
- package/node_modules/style-mod/test/test-style-mod.js +104 -0
- package/node_modules/w3c-keyname/.tern-port +1 -0
- package/node_modules/w3c-keyname/LICENSE +19 -0
- package/node_modules/w3c-keyname/README.md +18 -0
- package/node_modules/w3c-keyname/index.cjs +127 -0
- package/node_modules/w3c-keyname/index.d.cts +5 -0
- package/node_modules/w3c-keyname/index.d.ts +5 -0
- package/node_modules/w3c-keyname/index.js +119 -0
- package/node_modules/w3c-keyname/package.json +37 -0
- package/package.json +1 -1
- package/packages/daemon/src/api.js +157 -2
- package/packages/daemon/src/filewatcher.js +59 -0
- package/packages/daemon/src/index.js +28 -1
- package/packages/daemon/src/skills.js +20 -0
- package/packages/gui/dist/assets/index-Dxg9hdf3.js +103 -0
- package/packages/gui/dist/index.html +1 -1
- package/packages/gui/package.json +15 -2
- package/packages/gui/src/App.jsx +3 -0
- package/packages/gui/src/components/CodeEditor.jsx +143 -0
- package/packages/gui/src/components/EditorTabs.jsx +83 -0
- package/packages/gui/src/components/FileTree.jsx +193 -0
- package/packages/gui/src/stores/groove.js +158 -1
- package/packages/gui/src/views/FileEditor.jsx +142 -0
- package/packages/gui/src/views/SkillsMarketplace.jsx +112 -1
- package/node_modules/@groove-dev/gui/dist/assets/index-CNCSwHwH.js +0 -74
- package/packages/gui/dist/assets/index-CNCSwHwH.js +0 -74
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var base = {
|
|
6
|
+
8: "Backspace",
|
|
7
|
+
9: "Tab",
|
|
8
|
+
10: "Enter",
|
|
9
|
+
12: "NumLock",
|
|
10
|
+
13: "Enter",
|
|
11
|
+
16: "Shift",
|
|
12
|
+
17: "Control",
|
|
13
|
+
18: "Alt",
|
|
14
|
+
20: "CapsLock",
|
|
15
|
+
27: "Escape",
|
|
16
|
+
32: " ",
|
|
17
|
+
33: "PageUp",
|
|
18
|
+
34: "PageDown",
|
|
19
|
+
35: "End",
|
|
20
|
+
36: "Home",
|
|
21
|
+
37: "ArrowLeft",
|
|
22
|
+
38: "ArrowUp",
|
|
23
|
+
39: "ArrowRight",
|
|
24
|
+
40: "ArrowDown",
|
|
25
|
+
44: "PrintScreen",
|
|
26
|
+
45: "Insert",
|
|
27
|
+
46: "Delete",
|
|
28
|
+
59: ";",
|
|
29
|
+
61: "=",
|
|
30
|
+
91: "Meta",
|
|
31
|
+
92: "Meta",
|
|
32
|
+
106: "*",
|
|
33
|
+
107: "+",
|
|
34
|
+
108: ",",
|
|
35
|
+
109: "-",
|
|
36
|
+
110: ".",
|
|
37
|
+
111: "/",
|
|
38
|
+
144: "NumLock",
|
|
39
|
+
145: "ScrollLock",
|
|
40
|
+
160: "Shift",
|
|
41
|
+
161: "Shift",
|
|
42
|
+
162: "Control",
|
|
43
|
+
163: "Control",
|
|
44
|
+
164: "Alt",
|
|
45
|
+
165: "Alt",
|
|
46
|
+
173: "-",
|
|
47
|
+
186: ";",
|
|
48
|
+
187: "=",
|
|
49
|
+
188: ",",
|
|
50
|
+
189: "-",
|
|
51
|
+
190: ".",
|
|
52
|
+
191: "/",
|
|
53
|
+
192: "`",
|
|
54
|
+
219: "[",
|
|
55
|
+
220: "\\",
|
|
56
|
+
221: "]",
|
|
57
|
+
222: "'"
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var shift = {
|
|
61
|
+
48: ")",
|
|
62
|
+
49: "!",
|
|
63
|
+
50: "@",
|
|
64
|
+
51: "#",
|
|
65
|
+
52: "$",
|
|
66
|
+
53: "%",
|
|
67
|
+
54: "^",
|
|
68
|
+
55: "&",
|
|
69
|
+
56: "*",
|
|
70
|
+
57: "(",
|
|
71
|
+
59: ":",
|
|
72
|
+
61: "+",
|
|
73
|
+
173: "_",
|
|
74
|
+
186: ":",
|
|
75
|
+
187: "+",
|
|
76
|
+
188: "<",
|
|
77
|
+
189: "_",
|
|
78
|
+
190: ">",
|
|
79
|
+
191: "?",
|
|
80
|
+
192: "~",
|
|
81
|
+
219: "{",
|
|
82
|
+
220: "|",
|
|
83
|
+
221: "}",
|
|
84
|
+
222: "\""
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
|
|
88
|
+
var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
89
|
+
|
|
90
|
+
// Fill in the digit keys
|
|
91
|
+
for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);
|
|
92
|
+
|
|
93
|
+
// The function keys
|
|
94
|
+
for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i;
|
|
95
|
+
|
|
96
|
+
// And the alphabetic keys
|
|
97
|
+
for (var i = 65; i <= 90; i++) {
|
|
98
|
+
base[i] = String.fromCharCode(i + 32);
|
|
99
|
+
shift[i] = String.fromCharCode(i);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// For each code that doesn't have a shift-equivalent, copy the base name
|
|
103
|
+
for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code];
|
|
104
|
+
|
|
105
|
+
function keyName(event) {
|
|
106
|
+
// On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.
|
|
107
|
+
// On IE, shift effect is never included in `.key`.
|
|
108
|
+
var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||
|
|
109
|
+
ie && event.shiftKey && event.key && event.key.length == 1 ||
|
|
110
|
+
event.key == "Unidentified";
|
|
111
|
+
var name = (!ignoreKey && event.key) ||
|
|
112
|
+
(event.shiftKey ? shift : base)[event.keyCode] ||
|
|
113
|
+
event.key || "Unidentified";
|
|
114
|
+
// Edge sometimes produces wrong names (Issue #3)
|
|
115
|
+
if (name == "Esc") name = "Escape";
|
|
116
|
+
if (name == "Del") name = "Delete";
|
|
117
|
+
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/
|
|
118
|
+
if (name == "Left") name = "ArrowLeft";
|
|
119
|
+
if (name == "Up") name = "ArrowUp";
|
|
120
|
+
if (name == "Right") name = "ArrowRight";
|
|
121
|
+
if (name == "Down") name = "ArrowDown";
|
|
122
|
+
return name
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
exports.base = base;
|
|
126
|
+
exports.keyName = keyName;
|
|
127
|
+
exports.shift = shift;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export var base = {
|
|
2
|
+
8: "Backspace",
|
|
3
|
+
9: "Tab",
|
|
4
|
+
10: "Enter",
|
|
5
|
+
12: "NumLock",
|
|
6
|
+
13: "Enter",
|
|
7
|
+
16: "Shift",
|
|
8
|
+
17: "Control",
|
|
9
|
+
18: "Alt",
|
|
10
|
+
20: "CapsLock",
|
|
11
|
+
27: "Escape",
|
|
12
|
+
32: " ",
|
|
13
|
+
33: "PageUp",
|
|
14
|
+
34: "PageDown",
|
|
15
|
+
35: "End",
|
|
16
|
+
36: "Home",
|
|
17
|
+
37: "ArrowLeft",
|
|
18
|
+
38: "ArrowUp",
|
|
19
|
+
39: "ArrowRight",
|
|
20
|
+
40: "ArrowDown",
|
|
21
|
+
44: "PrintScreen",
|
|
22
|
+
45: "Insert",
|
|
23
|
+
46: "Delete",
|
|
24
|
+
59: ";",
|
|
25
|
+
61: "=",
|
|
26
|
+
91: "Meta",
|
|
27
|
+
92: "Meta",
|
|
28
|
+
106: "*",
|
|
29
|
+
107: "+",
|
|
30
|
+
108: ",",
|
|
31
|
+
109: "-",
|
|
32
|
+
110: ".",
|
|
33
|
+
111: "/",
|
|
34
|
+
144: "NumLock",
|
|
35
|
+
145: "ScrollLock",
|
|
36
|
+
160: "Shift",
|
|
37
|
+
161: "Shift",
|
|
38
|
+
162: "Control",
|
|
39
|
+
163: "Control",
|
|
40
|
+
164: "Alt",
|
|
41
|
+
165: "Alt",
|
|
42
|
+
173: "-",
|
|
43
|
+
186: ";",
|
|
44
|
+
187: "=",
|
|
45
|
+
188: ",",
|
|
46
|
+
189: "-",
|
|
47
|
+
190: ".",
|
|
48
|
+
191: "/",
|
|
49
|
+
192: "`",
|
|
50
|
+
219: "[",
|
|
51
|
+
220: "\\",
|
|
52
|
+
221: "]",
|
|
53
|
+
222: "'"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export var shift = {
|
|
57
|
+
48: ")",
|
|
58
|
+
49: "!",
|
|
59
|
+
50: "@",
|
|
60
|
+
51: "#",
|
|
61
|
+
52: "$",
|
|
62
|
+
53: "%",
|
|
63
|
+
54: "^",
|
|
64
|
+
55: "&",
|
|
65
|
+
56: "*",
|
|
66
|
+
57: "(",
|
|
67
|
+
59: ":",
|
|
68
|
+
61: "+",
|
|
69
|
+
173: "_",
|
|
70
|
+
186: ":",
|
|
71
|
+
187: "+",
|
|
72
|
+
188: "<",
|
|
73
|
+
189: "_",
|
|
74
|
+
190: ">",
|
|
75
|
+
191: "?",
|
|
76
|
+
192: "~",
|
|
77
|
+
219: "{",
|
|
78
|
+
220: "|",
|
|
79
|
+
221: "}",
|
|
80
|
+
222: "\""
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
var mac = typeof navigator != "undefined" && /Mac/.test(navigator.platform)
|
|
84
|
+
var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent)
|
|
85
|
+
|
|
86
|
+
// Fill in the digit keys
|
|
87
|
+
for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i)
|
|
88
|
+
|
|
89
|
+
// The function keys
|
|
90
|
+
for (var i = 1; i <= 24; i++) base[i + 111] = "F" + i
|
|
91
|
+
|
|
92
|
+
// And the alphabetic keys
|
|
93
|
+
for (var i = 65; i <= 90; i++) {
|
|
94
|
+
base[i] = String.fromCharCode(i + 32)
|
|
95
|
+
shift[i] = String.fromCharCode(i)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// For each code that doesn't have a shift-equivalent, copy the base name
|
|
99
|
+
for (var code in base) if (!shift.hasOwnProperty(code)) shift[code] = base[code]
|
|
100
|
+
|
|
101
|
+
export function keyName(event) {
|
|
102
|
+
// On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.
|
|
103
|
+
// On IE, shift effect is never included in `.key`.
|
|
104
|
+
var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||
|
|
105
|
+
ie && event.shiftKey && event.key && event.key.length == 1 ||
|
|
106
|
+
event.key == "Unidentified"
|
|
107
|
+
var name = (!ignoreKey && event.key) ||
|
|
108
|
+
(event.shiftKey ? shift : base)[event.keyCode] ||
|
|
109
|
+
event.key || "Unidentified"
|
|
110
|
+
// Edge sometimes produces wrong names (Issue #3)
|
|
111
|
+
if (name == "Esc") name = "Escape"
|
|
112
|
+
if (name == "Del") name = "Delete"
|
|
113
|
+
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/
|
|
114
|
+
if (name == "Left") name = "ArrowLeft"
|
|
115
|
+
if (name == "Up") name = "ArrowUp"
|
|
116
|
+
if (name == "Right") name = "ArrowRight"
|
|
117
|
+
if (name == "Down") name = "ArrowDown"
|
|
118
|
+
return name
|
|
119
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "w3c-keyname",
|
|
3
|
+
"version": "2.2.8",
|
|
4
|
+
"description": "Get a KeyboardEvent.key-style string from an event",
|
|
5
|
+
"main": "index.cjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
"import": "./index.js",
|
|
9
|
+
"require": "./index.cjs"
|
|
10
|
+
},
|
|
11
|
+
"module": "index.js",
|
|
12
|
+
"types": "index.d.ts",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/marijnh/w3c-keyname.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"browser",
|
|
19
|
+
"key",
|
|
20
|
+
"event",
|
|
21
|
+
"key code"
|
|
22
|
+
],
|
|
23
|
+
"author": "Marijn Haverbeke <marijn@haverbeke.berlin>",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/marijnh/w3c-keyname/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/marijnh/w3c-keyname#readme",
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "rollup -c",
|
|
31
|
+
"watch": "rollup -c -w",
|
|
32
|
+
"prepare": "npm run build"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"rollup": "^1.26.3"
|
|
36
|
+
}
|
|
37
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "groove-dev",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Open-source agent orchestration layer for AI coding tools. GUI dashboard, multi-agent coordination, zero cold-start (Journalist), infinite sessions (adaptive context rotation), AI Project Manager, Quick Launch. Works with Claude Code, Codex, Gemini CLI, Ollama.",
|
|
5
5
|
"license": "FSL-1.1-Apache-2.0",
|
|
6
6
|
"author": "Groove Dev <hello@groovedev.ai> (https://groovedev.ai)",
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import express from 'express';
|
|
5
5
|
import { resolve, dirname } from 'path';
|
|
6
6
|
import { fileURLToPath } from 'url';
|
|
7
|
-
import { existsSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
7
|
+
import { existsSync, readFileSync, readdirSync, statSync, writeFileSync } from 'fs';
|
|
8
8
|
import { listProviders } from './providers/index.js';
|
|
9
9
|
import { validateAgentConfig } from './validate.js';
|
|
10
10
|
|
|
@@ -35,7 +35,7 @@ export function createApi(app, daemon) {
|
|
|
35
35
|
next();
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
app.use(express.json({ limit: '
|
|
38
|
+
app.use(express.json({ limit: '6mb' }));
|
|
39
39
|
|
|
40
40
|
// Health check
|
|
41
41
|
app.get('/api/health', (req, res) => {
|
|
@@ -400,6 +400,16 @@ export function createApi(app, daemon) {
|
|
|
400
400
|
}
|
|
401
401
|
});
|
|
402
402
|
|
|
403
|
+
app.post('/api/skills/:id/rate', async (req, res) => {
|
|
404
|
+
try {
|
|
405
|
+
const rating = parseInt(req.body?.rating, 10);
|
|
406
|
+
const result = await daemon.skills.rate(req.params.id, rating);
|
|
407
|
+
res.json(result);
|
|
408
|
+
} catch (err) {
|
|
409
|
+
res.status(400).json({ error: err.message });
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
|
|
403
413
|
app.get('/api/skills/:id/content', (req, res) => {
|
|
404
414
|
const content = daemon.skills.getContent(req.params.id);
|
|
405
415
|
if (!content) return res.status(404).json({ error: 'Skill not installed' });
|
|
@@ -493,6 +503,151 @@ export function createApi(app, daemon) {
|
|
|
493
503
|
}
|
|
494
504
|
});
|
|
495
505
|
|
|
506
|
+
// --- File Editor API ---
|
|
507
|
+
|
|
508
|
+
const LANG_MAP = {
|
|
509
|
+
js: 'javascript', jsx: 'javascript', mjs: 'javascript', cjs: 'javascript',
|
|
510
|
+
ts: 'typescript', tsx: 'typescript',
|
|
511
|
+
css: 'css', scss: 'css', html: 'html', json: 'json',
|
|
512
|
+
md: 'markdown', py: 'python', rs: 'rust', go: 'go',
|
|
513
|
+
sh: 'shell', bash: 'shell', zsh: 'shell',
|
|
514
|
+
yaml: 'yaml', yml: 'yaml', toml: 'toml',
|
|
515
|
+
sql: 'sql', xml: 'xml', java: 'java', c: 'cpp', cpp: 'cpp', h: 'cpp',
|
|
516
|
+
rb: 'ruby', php: 'php', swift: 'swift', kt: 'kotlin',
|
|
517
|
+
dockerfile: 'dockerfile', makefile: 'makefile',
|
|
518
|
+
};
|
|
519
|
+
function detectLanguage(filename) {
|
|
520
|
+
const ext = filename.split('.').pop()?.toLowerCase();
|
|
521
|
+
return LANG_MAP[ext] || 'text';
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const IGNORED_NAMES = new Set(['.git', 'node_modules', '.DS_Store', '.groove', '__pycache__', '.next', '.cache', 'dist', 'coverage']);
|
|
525
|
+
|
|
526
|
+
function validateFilePath(relPath, projectDir) {
|
|
527
|
+
if (!relPath || typeof relPath !== 'string') return { error: 'path is required' };
|
|
528
|
+
if (relPath.startsWith('/') || relPath.includes('..') || relPath.includes('\0')) {
|
|
529
|
+
return { error: 'Invalid path' };
|
|
530
|
+
}
|
|
531
|
+
const fullPath = resolve(projectDir, relPath);
|
|
532
|
+
if (!fullPath.startsWith(projectDir)) return { error: 'Path outside project' };
|
|
533
|
+
return { fullPath };
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// File tree — returns dirs + files for a given path
|
|
537
|
+
app.get('/api/files/tree', (req, res) => {
|
|
538
|
+
const relPath = req.query.path || '';
|
|
539
|
+
|
|
540
|
+
// Security: reuse browse validation
|
|
541
|
+
if (relPath && (relPath.startsWith('/') || relPath.includes('..') || relPath.includes('\0'))) {
|
|
542
|
+
return res.status(400).json({ error: 'Invalid path' });
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
const fullPath = relPath ? resolve(daemon.projectDir, relPath) : daemon.projectDir;
|
|
546
|
+
if (!fullPath.startsWith(daemon.projectDir)) {
|
|
547
|
+
return res.status(400).json({ error: 'Path outside project' });
|
|
548
|
+
}
|
|
549
|
+
if (!existsSync(fullPath)) {
|
|
550
|
+
return res.status(404).json({ error: 'Directory not found' });
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
try {
|
|
554
|
+
const raw = readdirSync(fullPath, { withFileTypes: true });
|
|
555
|
+
const entries = [];
|
|
556
|
+
|
|
557
|
+
// Dirs first (sorted), then files (sorted)
|
|
558
|
+
const dirs = raw.filter((e) => e.isDirectory() && !IGNORED_NAMES.has(e.name) && !e.name.startsWith('.'))
|
|
559
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
560
|
+
const files = raw.filter((e) => e.isFile() && !e.name.startsWith('.'))
|
|
561
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
562
|
+
|
|
563
|
+
for (const d of dirs) {
|
|
564
|
+
const childPath = relPath ? `${relPath}/${d.name}` : d.name;
|
|
565
|
+
const childFull = resolve(fullPath, d.name);
|
|
566
|
+
let hasChildren = false;
|
|
567
|
+
try {
|
|
568
|
+
const children = readdirSync(childFull, { withFileTypes: true });
|
|
569
|
+
hasChildren = children.some((c) => !c.name.startsWith('.') && !IGNORED_NAMES.has(c.name));
|
|
570
|
+
} catch { /* unreadable */ }
|
|
571
|
+
entries.push({ name: d.name, type: 'dir', path: childPath, hasChildren });
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
for (const f of files) {
|
|
575
|
+
const childPath = relPath ? `${relPath}/${f.name}` : f.name;
|
|
576
|
+
let size = 0;
|
|
577
|
+
try { size = statSync(resolve(fullPath, f.name)).size; } catch { /* ignore */ }
|
|
578
|
+
entries.push({
|
|
579
|
+
name: f.name, type: 'file', path: childPath, size,
|
|
580
|
+
language: detectLanguage(f.name),
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
res.json({
|
|
585
|
+
current: relPath || '.',
|
|
586
|
+
parent: relPath ? relPath.split('/').slice(0, -1).join('/') : null,
|
|
587
|
+
entries,
|
|
588
|
+
});
|
|
589
|
+
} catch (err) {
|
|
590
|
+
res.status(500).json({ error: err.message });
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
// Read file contents
|
|
595
|
+
app.get('/api/files/read', (req, res) => {
|
|
596
|
+
const result = validateFilePath(req.query.path, daemon.projectDir);
|
|
597
|
+
if (result.error) return res.status(400).json({ error: result.error });
|
|
598
|
+
|
|
599
|
+
if (!existsSync(result.fullPath)) {
|
|
600
|
+
return res.status(404).json({ error: 'File not found' });
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
try {
|
|
604
|
+
const stat = statSync(result.fullPath);
|
|
605
|
+
if (stat.size > 5 * 1024 * 1024) {
|
|
606
|
+
return res.status(400).json({ error: 'File too large (>5MB)' });
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// Binary detection: check first 8KB for null bytes
|
|
610
|
+
const buf = readFileSync(result.fullPath);
|
|
611
|
+
const sample = buf.subarray(0, 8192);
|
|
612
|
+
if (sample.includes(0)) {
|
|
613
|
+
return res.json({ path: req.query.path, binary: true, size: stat.size });
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
const content = buf.toString('utf8');
|
|
617
|
+
const filename = req.query.path.split('/').pop();
|
|
618
|
+
res.json({
|
|
619
|
+
path: req.query.path,
|
|
620
|
+
content,
|
|
621
|
+
size: stat.size,
|
|
622
|
+
language: detectLanguage(filename),
|
|
623
|
+
});
|
|
624
|
+
} catch (err) {
|
|
625
|
+
res.status(500).json({ error: err.message });
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// Write file contents
|
|
630
|
+
app.post('/api/files/write', (req, res) => {
|
|
631
|
+
const { path: relPath, content } = req.body;
|
|
632
|
+
const result = validateFilePath(relPath, daemon.projectDir);
|
|
633
|
+
if (result.error) return res.status(400).json({ error: result.error });
|
|
634
|
+
|
|
635
|
+
if (typeof content !== 'string') {
|
|
636
|
+
return res.status(400).json({ error: 'content must be a string' });
|
|
637
|
+
}
|
|
638
|
+
if (content.length > 5 * 1024 * 1024) {
|
|
639
|
+
return res.status(400).json({ error: 'Content too large (>5MB)' });
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
try {
|
|
643
|
+
writeFileSync(result.fullPath, content, 'utf8');
|
|
644
|
+
daemon.audit.log('file.write', { path: relPath });
|
|
645
|
+
res.json({ ok: true, size: Buffer.byteLength(content, 'utf8') });
|
|
646
|
+
} catch (err) {
|
|
647
|
+
res.status(500).json({ error: err.message });
|
|
648
|
+
}
|
|
649
|
+
});
|
|
650
|
+
|
|
496
651
|
// --- Codebase Indexer ---
|
|
497
652
|
|
|
498
653
|
app.get('/api/indexer', (req, res) => {
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// GROOVE — File Watcher (per-file fs.watch + debounced WS broadcast)
|
|
2
|
+
// FSL-1.1-Apache-2.0 — see LICENSE
|
|
3
|
+
|
|
4
|
+
import { watch } from 'fs';
|
|
5
|
+
import { resolve } from 'path';
|
|
6
|
+
|
|
7
|
+
export class FileWatcher {
|
|
8
|
+
constructor(daemon) {
|
|
9
|
+
this.daemon = daemon;
|
|
10
|
+
this.watchers = new Map(); // relPath → { watcher, timer }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
watch(relPath) {
|
|
14
|
+
if (!relPath || typeof relPath !== 'string') return;
|
|
15
|
+
if (this.watchers.has(relPath)) return; // already watching
|
|
16
|
+
|
|
17
|
+
const fullPath = resolve(this.daemon.projectDir, relPath);
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const watcher = watch(fullPath, () => {
|
|
21
|
+
const entry = this.watchers.get(relPath);
|
|
22
|
+
if (!entry) return;
|
|
23
|
+
|
|
24
|
+
// Debounce 300ms — agents write in bursts
|
|
25
|
+
if (entry.timer) clearTimeout(entry.timer);
|
|
26
|
+
entry.timer = setTimeout(() => {
|
|
27
|
+
this.daemon.broadcast({
|
|
28
|
+
type: 'file:changed',
|
|
29
|
+
path: relPath,
|
|
30
|
+
timestamp: Date.now(),
|
|
31
|
+
});
|
|
32
|
+
}, 300);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
watcher.on('error', () => {
|
|
36
|
+
this.unwatch(relPath);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
this.watchers.set(relPath, { watcher, timer: null });
|
|
40
|
+
} catch {
|
|
41
|
+
// File doesn't exist or not watchable — ignore
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
unwatch(relPath) {
|
|
46
|
+
const entry = this.watchers.get(relPath);
|
|
47
|
+
if (!entry) return;
|
|
48
|
+
|
|
49
|
+
if (entry.timer) clearTimeout(entry.timer);
|
|
50
|
+
try { entry.watcher.close(); } catch { /* already closed */ }
|
|
51
|
+
this.watchers.delete(relPath);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
unwatchAll() {
|
|
55
|
+
for (const [relPath] of this.watchers) {
|
|
56
|
+
this.unwatch(relPath);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -28,6 +28,7 @@ import { CodebaseIndexer } from './indexer.js';
|
|
|
28
28
|
import { AuditLogger } from './audit.js';
|
|
29
29
|
import { Federation } from './federation.js';
|
|
30
30
|
import { SkillStore } from './skills.js';
|
|
31
|
+
import { FileWatcher } from './filewatcher.js';
|
|
31
32
|
import { isFirstRun, runFirstTimeSetup, loadConfig, saveConfig, printWelcome } from './firstrun.js';
|
|
32
33
|
|
|
33
34
|
const DEFAULT_PORT = 31415;
|
|
@@ -117,6 +118,7 @@ export class Daemon {
|
|
|
117
118
|
this.audit = new AuditLogger(this.grooveDir);
|
|
118
119
|
this.federation = new Federation(this);
|
|
119
120
|
this.skills = new SkillStore(this);
|
|
121
|
+
this.fileWatcher = new FileWatcher(this);
|
|
120
122
|
|
|
121
123
|
// HTTP + WebSocket server
|
|
122
124
|
this.app = express();
|
|
@@ -147,12 +149,34 @@ export class Daemon {
|
|
|
147
149
|
this.broadcast({ type: 'state', data: this.registry.getAll() });
|
|
148
150
|
});
|
|
149
151
|
|
|
150
|
-
// Send full state to new WebSocket clients
|
|
152
|
+
// Send full state to new WebSocket clients + handle editor messages
|
|
151
153
|
this.wss.on('connection', (ws) => {
|
|
152
154
|
ws.send(JSON.stringify({
|
|
153
155
|
type: 'state',
|
|
154
156
|
data: this.registry.getAll(),
|
|
155
157
|
}));
|
|
158
|
+
|
|
159
|
+
// Track which files this client is watching (for cleanup on disconnect)
|
|
160
|
+
const watchedFiles = new Set();
|
|
161
|
+
|
|
162
|
+
ws.on('message', (raw) => {
|
|
163
|
+
try {
|
|
164
|
+
const msg = JSON.parse(raw);
|
|
165
|
+
if (msg.type === 'editor:watch' && msg.path) {
|
|
166
|
+
this.fileWatcher.watch(msg.path);
|
|
167
|
+
watchedFiles.add(msg.path);
|
|
168
|
+
} else if (msg.type === 'editor:unwatch' && msg.path) {
|
|
169
|
+
this.fileWatcher.unwatch(msg.path);
|
|
170
|
+
watchedFiles.delete(msg.path);
|
|
171
|
+
}
|
|
172
|
+
} catch { /* ignore malformed messages */ }
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
ws.on('close', () => {
|
|
176
|
+
for (const path of watchedFiles) {
|
|
177
|
+
this.fileWatcher.unwatch(path);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
156
180
|
});
|
|
157
181
|
|
|
158
182
|
// Auto-update AGENTS_REGISTRY.md and CLAUDE.md GROOVE section on changes
|
|
@@ -250,6 +274,9 @@ export class Daemon {
|
|
|
250
274
|
this.journalist.stop();
|
|
251
275
|
this.rotator.stop();
|
|
252
276
|
|
|
277
|
+
// Clean up file watchers
|
|
278
|
+
this.fileWatcher.unwatchAll();
|
|
279
|
+
|
|
253
280
|
// Kill all agent processes
|
|
254
281
|
await this.processes.killAll();
|
|
255
282
|
|
|
@@ -193,6 +193,26 @@ export class SkillStore {
|
|
|
193
193
|
return { id: skillId, installed: false };
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
+
/**
|
|
197
|
+
* Rate a skill. Proxies to the skills server.
|
|
198
|
+
*/
|
|
199
|
+
async rate(skillId, rating) {
|
|
200
|
+
if (!Number.isInteger(rating) || rating < 1 || rating > 5) {
|
|
201
|
+
throw new Error('Rating must be an integer from 1 to 5');
|
|
202
|
+
}
|
|
203
|
+
const res = await fetch(`${SKILLS_API}/skills/${skillId}/rate`, {
|
|
204
|
+
method: 'POST',
|
|
205
|
+
headers: { 'Content-Type': 'application/json' },
|
|
206
|
+
body: JSON.stringify({ rating }),
|
|
207
|
+
signal: AbortSignal.timeout(10000),
|
|
208
|
+
});
|
|
209
|
+
if (!res.ok) {
|
|
210
|
+
const data = await res.json().catch(() => ({}));
|
|
211
|
+
throw new Error(data.error || 'Rating failed');
|
|
212
|
+
}
|
|
213
|
+
return res.json();
|
|
214
|
+
}
|
|
215
|
+
|
|
196
216
|
/**
|
|
197
217
|
* Get the full content of an installed skill.
|
|
198
218
|
*/
|