@mrpatronz/nexusflow 0.1.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/GETTING_STARTED.md +109 -0
- package/README.md +310 -0
- package/dist/analyzers/detect-apis.d.ts +19 -0
- package/dist/analyzers/detect-apis.d.ts.map +1 -0
- package/dist/analyzers/detect-apis.js +121 -0
- package/dist/analyzers/detect-apis.js.map +1 -0
- package/dist/analyzers/detect-deps.d.ts +30 -0
- package/dist/analyzers/detect-deps.d.ts.map +1 -0
- package/dist/analyzers/detect-deps.js +121 -0
- package/dist/analyzers/detect-deps.js.map +1 -0
- package/dist/analyzers/detect-existing.d.ts +15 -0
- package/dist/analyzers/detect-existing.d.ts.map +1 -0
- package/dist/analyzers/detect-existing.js +65 -0
- package/dist/analyzers/detect-existing.js.map +1 -0
- package/dist/analyzers/detect-ports.d.ts +20 -0
- package/dist/analyzers/detect-ports.d.ts.map +1 -0
- package/dist/analyzers/detect-ports.js +103 -0
- package/dist/analyzers/detect-ports.js.map +1 -0
- package/dist/analyzers/index.d.ts +29 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +74 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/analyzers/readme-summarizer.d.ts +13 -0
- package/dist/analyzers/readme-summarizer.d.ts.map +1 -0
- package/dist/analyzers/readme-summarizer.js +59 -0
- package/dist/analyzers/readme-summarizer.js.map +1 -0
- package/dist/analyzers/tech-stack.d.ts +15 -0
- package/dist/analyzers/tech-stack.d.ts.map +1 -0
- package/dist/analyzers/tech-stack.js +284 -0
- package/dist/analyzers/tech-stack.js.map +1 -0
- package/dist/commands/create.d.ts +17 -0
- package/dist/commands/create.d.ts.map +1 -0
- package/dist/commands/create.js +111 -0
- package/dist/commands/create.js.map +1 -0
- package/dist/commands/init.d.ts +10 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +50 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +9 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +32 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/logs.d.ts +12 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +54 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/open.d.ts +9 -0
- package/dist/commands/open.d.ts.map +1 -0
- package/dist/commands/open.js +49 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/start.d.ts +13 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +97 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +11 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +47 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/stop.d.ts +11 -0
- package/dist/commands/stop.d.ts.map +1 -0
- package/dist/commands/stop.js +47 -0
- package/dist/commands/stop.js.map +1 -0
- package/dist/commands/ui.d.ts +13 -0
- package/dist/commands/ui.d.ts.map +1 -0
- package/dist/commands/ui.js +44 -0
- package/dist/commands/ui.js.map +1 -0
- package/dist/core/config.d.ts +32 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +68 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/scanner.d.ts +18 -0
- package/dist/core/scanner.d.ts.map +1 -0
- package/dist/core/scanner.js +73 -0
- package/dist/core/scanner.js.map +1 -0
- package/dist/core/workspace.d.ts +53 -0
- package/dist/core/workspace.d.ts.map +1 -0
- package/dist/core/workspace.js +114 -0
- package/dist/core/workspace.js.map +1 -0
- package/dist/core/worktree.d.ts +27 -0
- package/dist/core/worktree.d.ts.map +1 -0
- package/dist/core/worktree.js +35 -0
- package/dist/core/worktree.js.map +1 -0
- package/dist/generators/base.d.ts +15 -0
- package/dist/generators/base.d.ts.map +1 -0
- package/dist/generators/base.js +175 -0
- package/dist/generators/base.js.map +1 -0
- package/dist/generators/claude.d.ts +17 -0
- package/dist/generators/claude.d.ts.map +1 -0
- package/dist/generators/claude.js +29 -0
- package/dist/generators/claude.js.map +1 -0
- package/dist/generators/codex.d.ts +16 -0
- package/dist/generators/codex.d.ts.map +1 -0
- package/dist/generators/codex.js +41 -0
- package/dist/generators/codex.js.map +1 -0
- package/dist/generators/copilot.d.ts +16 -0
- package/dist/generators/copilot.d.ts.map +1 -0
- package/dist/generators/copilot.js +49 -0
- package/dist/generators/copilot.js.map +1 -0
- package/dist/generators/cursor.d.ts +17 -0
- package/dist/generators/cursor.d.ts.map +1 -0
- package/dist/generators/cursor.js +37 -0
- package/dist/generators/cursor.js.map +1 -0
- package/dist/generators/index.d.ts +18 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +95 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/gui/assets/index-Cq9V485S.js +21 -0
- package/dist/gui/assets/index-Dh1b5gSZ.css +2 -0
- package/dist/gui/favicon.svg +1 -0
- package/dist/gui/icons.svg +24 -0
- package/dist/gui/index.html +18 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +169 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestration/detect.d.ts +29 -0
- package/dist/orchestration/detect.d.ts.map +1 -0
- package/dist/orchestration/detect.js +292 -0
- package/dist/orchestration/detect.js.map +1 -0
- package/dist/orchestration/index.d.ts +7 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +7 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/runner.d.ts +40 -0
- package/dist/orchestration/runner.d.ts.map +1 -0
- package/dist/orchestration/runner.js +242 -0
- package/dist/orchestration/runner.js.map +1 -0
- package/dist/server.d.ts +16 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +419 -0
- package/dist/server.js.map +1 -0
- package/dist/types.d.ts +210 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +6 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/detect-ai.d.ts +21 -0
- package/dist/utils/detect-ai.d.ts.map +1 -0
- package/dist/utils/detect-ai.js +76 -0
- package/dist/utils/detect-ai.js.map +1 -0
- package/dist/utils/detect-editors.d.ts +19 -0
- package/dist/utils/detect-editors.d.ts.map +1 -0
- package/dist/utils/detect-editors.js +49 -0
- package/dist/utils/detect-editors.js.map +1 -0
- package/dist/utils/git.d.ts +27 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +57 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/prompts.d.ts +27 -0
- package/dist/utils/prompts.d.ts.map +1 -0
- package/dist/utils/prompts.js +119 -0
- package/dist/utils/prompts.js.map +1 -0
- package/dist/utils/session-finder.d.ts +29 -0
- package/dist/utils/session-finder.d.ts.map +1 -0
- package/dist/utils/session-finder.js +462 -0
- package/dist/utils/session-finder.js.map +1 -0
- package/gui/README.md +73 -0
- package/gui/eslint.config.js +22 -0
- package/gui/index.html +17 -0
- package/gui/package-lock.json +3054 -0
- package/gui/package.json +33 -0
- package/gui/public/favicon.svg +1 -0
- package/gui/public/icons.svg +24 -0
- package/gui/src/App.css +1 -0
- package/gui/src/App.tsx +1949 -0
- package/gui/src/assets/hero.png +0 -0
- package/gui/src/assets/react.svg +1 -0
- package/gui/src/assets/vite.svg +1 -0
- package/gui/src/index.css +1 -0
- package/gui/src/main.tsx +10 -0
- package/gui/tsconfig.app.json +25 -0
- package/gui/tsconfig.json +7 -0
- package/gui/tsconfig.node.json +24 -0
- package/gui/vite.config.ts +12 -0
- package/package.json +48 -0
- package/src/analyzers/detect-apis.ts +138 -0
- package/src/analyzers/detect-deps.ts +138 -0
- package/src/analyzers/detect-existing.ts +74 -0
- package/src/analyzers/detect-ports.ts +110 -0
- package/src/analyzers/index.ts +85 -0
- package/src/analyzers/readme-summarizer.ts +68 -0
- package/src/analyzers/tech-stack.ts +255 -0
- package/src/commands/create.ts +142 -0
- package/src/commands/init.ts +58 -0
- package/src/commands/list.ts +46 -0
- package/src/commands/logs.ts +63 -0
- package/src/commands/open.ts +54 -0
- package/src/commands/start.ts +117 -0
- package/src/commands/status.ts +54 -0
- package/src/commands/stop.ts +55 -0
- package/src/commands/ui.ts +47 -0
- package/src/core/config.ts +79 -0
- package/src/core/scanner.ts +91 -0
- package/src/core/workspace.ts +149 -0
- package/src/core/worktree.ts +50 -0
- package/src/generators/base.ts +187 -0
- package/src/generators/claude.ts +34 -0
- package/src/generators/codex.ts +48 -0
- package/src/generators/copilot.ts +56 -0
- package/src/generators/cursor.ts +44 -0
- package/src/generators/index.ts +122 -0
- package/src/index.ts +178 -0
- package/src/orchestration/detect.ts +313 -0
- package/src/orchestration/index.ts +7 -0
- package/src/orchestration/runner.ts +279 -0
- package/src/server.ts +466 -0
- package/src/types.ts +294 -0
- package/src/utils/detect-ai.ts +81 -0
- package/src/utils/detect-editors.ts +54 -0
- package/src/utils/git.ts +61 -0
- package/src/utils/prompts.ts +135 -0
- package/src/utils/session-finder.ts +483 -0
- package/tsconfig.json +19 -0
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|
package/gui/src/main.tsx
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023", "DOM"],
|
|
6
|
+
"module": "esnext",
|
|
7
|
+
"types": ["vite/client"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
|
|
18
|
+
/* Linting */
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"erasableSyntaxOnly": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["src"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
4
|
+
"target": "es2023",
|
|
5
|
+
"lib": ["ES2023"],
|
|
6
|
+
"module": "esnext",
|
|
7
|
+
"types": ["node"],
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"moduleDetection": "force",
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
/* Linting */
|
|
18
|
+
"noUnusedLocals": true,
|
|
19
|
+
"noUnusedParameters": true,
|
|
20
|
+
"erasableSyntaxOnly": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true
|
|
22
|
+
},
|
|
23
|
+
"include": ["vite.config.ts"]
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import react from '@vitejs/plugin-react'
|
|
3
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
4
|
+
|
|
5
|
+
// https://vite.dev/config/
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
plugins: [react(), tailwindcss()],
|
|
8
|
+
build: {
|
|
9
|
+
outDir: '../dist/gui',
|
|
10
|
+
emptyOutDir: true,
|
|
11
|
+
},
|
|
12
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mrpatronz/nexusflow",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Combine multiple repos into a workspace with rich AI assistant context",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"nexusflow": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc && npm run build --prefix gui",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"test": "vitest run",
|
|
15
|
+
"test:watch": "vitest",
|
|
16
|
+
"clean": "rimraf dist",
|
|
17
|
+
"prepublishOnly": "npm run build"
|
|
18
|
+
},
|
|
19
|
+
"keywords": [
|
|
20
|
+
"ai",
|
|
21
|
+
"workspace",
|
|
22
|
+
"multi-repo",
|
|
23
|
+
"claude",
|
|
24
|
+
"codex",
|
|
25
|
+
"copilot",
|
|
26
|
+
"cursor",
|
|
27
|
+
"developer-tools"
|
|
28
|
+
],
|
|
29
|
+
"author": "",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@hono/node-server": "^2.0.4",
|
|
33
|
+
"@inquirer/prompts": "^7.0.0",
|
|
34
|
+
"chalk": "^5.3.0",
|
|
35
|
+
"commander": "^13.0.0",
|
|
36
|
+
"execa": "^9.5.0",
|
|
37
|
+
"fs-extra": "^11.2.0",
|
|
38
|
+
"hono": "^4.12.23",
|
|
39
|
+
"ora": "^8.1.0"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/fs-extra": "^11.0.4",
|
|
43
|
+
"@types/node": "^22.0.0",
|
|
44
|
+
"rimraf": "^6.0.0",
|
|
45
|
+
"typescript": "^5.7.0",
|
|
46
|
+
"vitest": "^3.0.0"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/detect-apis
|
|
3
|
+
* Detects API endpoints in a repository by scanning for OpenAPI/Swagger files,
|
|
4
|
+
* route patterns in common frameworks, and gRPC proto files.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fs from 'node:fs/promises';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
|
|
10
|
+
import type { ApiEndpoint } from '../types.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Detects API endpoints in a repository.
|
|
14
|
+
*
|
|
15
|
+
* Strategies (in order):
|
|
16
|
+
* 1. Look for OpenAPI/Swagger spec files (JSON/YAML)
|
|
17
|
+
* 2. Scan source files for Express/Fastify/ASP.NET route patterns
|
|
18
|
+
* 3. Look for gRPC .proto files
|
|
19
|
+
*
|
|
20
|
+
* @param repoPath - Absolute path to the repository root.
|
|
21
|
+
* @returns Array of detected {@link ApiEndpoint} objects.
|
|
22
|
+
*/
|
|
23
|
+
export async function detectApis(repoPath: string): Promise<ApiEndpoint[]> {
|
|
24
|
+
const endpoints: ApiEndpoint[] = [];
|
|
25
|
+
|
|
26
|
+
// 1. OpenAPI/Swagger files
|
|
27
|
+
const openApiEndpoints = await scanOpenApiFiles(repoPath);
|
|
28
|
+
endpoints.push(...openApiEndpoints);
|
|
29
|
+
|
|
30
|
+
// 2. Route patterns in source files (only if no OpenAPI found)
|
|
31
|
+
if (endpoints.length === 0) {
|
|
32
|
+
const routeEndpoints = await scanRoutePatterns(repoPath);
|
|
33
|
+
endpoints.push(...routeEndpoints);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return endpoints;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** Looks for OpenAPI/Swagger spec files and extracts paths. */
|
|
40
|
+
async function scanOpenApiFiles(repoPath: string): Promise<ApiEndpoint[]> {
|
|
41
|
+
const candidates = [
|
|
42
|
+
'swagger.json', 'swagger.yaml', 'swagger.yml',
|
|
43
|
+
'openapi.json', 'openapi.yaml', 'openapi.yml',
|
|
44
|
+
'api-spec.json', 'api-spec.yaml', 'api-spec.yml',
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
const endpoints: ApiEndpoint[] = [];
|
|
48
|
+
|
|
49
|
+
for (const filename of candidates) {
|
|
50
|
+
const filePath = path.join(repoPath, filename);
|
|
51
|
+
try {
|
|
52
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
53
|
+
|
|
54
|
+
if (filename.endsWith('.json')) {
|
|
55
|
+
const spec = JSON.parse(content) as Record<string, unknown>;
|
|
56
|
+
const paths = spec.paths as Record<string, Record<string, unknown>> | undefined;
|
|
57
|
+
|
|
58
|
+
if (paths) {
|
|
59
|
+
for (const [routePath, methods] of Object.entries(paths)) {
|
|
60
|
+
for (const method of Object.keys(methods)) {
|
|
61
|
+
if (['get', 'post', 'put', 'patch', 'delete', 'head', 'options'].includes(method)) {
|
|
62
|
+
endpoints.push({
|
|
63
|
+
method: method.toUpperCase(),
|
|
64
|
+
path: routePath,
|
|
65
|
+
source: filename,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
} catch {
|
|
73
|
+
// File doesn't exist or can't be parsed — skip
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return endpoints;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Scans source files for common route patterns. Limited to top-level files. */
|
|
81
|
+
async function scanRoutePatterns(repoPath: string): Promise<ApiEndpoint[]> {
|
|
82
|
+
const endpoints: ApiEndpoint[] = [];
|
|
83
|
+
|
|
84
|
+
// Look in common source directories
|
|
85
|
+
const sourceDirs = ['src', 'app', 'routes', 'controllers', 'Controllers', '.'];
|
|
86
|
+
const routeRegex = /\.(get|post|put|patch|delete)\s*\(\s*['"`]([^'"`]+)['"`]/gi;
|
|
87
|
+
const aspnetRegex = /\[Http(Get|Post|Put|Patch|Delete)\s*\(\s*"([^"]+)"\s*\)\]/gi;
|
|
88
|
+
|
|
89
|
+
for (const dir of sourceDirs) {
|
|
90
|
+
const dirPath = path.join(repoPath, dir);
|
|
91
|
+
|
|
92
|
+
let entries: string[];
|
|
93
|
+
try {
|
|
94
|
+
entries = await fs.readdir(dirPath);
|
|
95
|
+
} catch {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
for (const entry of entries) {
|
|
100
|
+
const ext = path.extname(entry).toLowerCase();
|
|
101
|
+
if (!['.ts', '.js', '.cs', '.py'].includes(ext)) continue;
|
|
102
|
+
|
|
103
|
+
const filePath = path.join(dirPath, entry);
|
|
104
|
+
try {
|
|
105
|
+
const stat = await fs.stat(filePath);
|
|
106
|
+
if (!stat.isFile() || stat.size > 100_000) continue; // Skip large files
|
|
107
|
+
|
|
108
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
109
|
+
const relPath = path.relative(repoPath, filePath);
|
|
110
|
+
|
|
111
|
+
// Express/Fastify/Hono style routes
|
|
112
|
+
let match: RegExpExecArray | null;
|
|
113
|
+
routeRegex.lastIndex = 0;
|
|
114
|
+
while ((match = routeRegex.exec(content)) !== null) {
|
|
115
|
+
endpoints.push({
|
|
116
|
+
method: match[1]!.toUpperCase(),
|
|
117
|
+
path: match[2]!,
|
|
118
|
+
source: relPath,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// ASP.NET style routes
|
|
123
|
+
aspnetRegex.lastIndex = 0;
|
|
124
|
+
while ((match = aspnetRegex.exec(content)) !== null) {
|
|
125
|
+
endpoints.push({
|
|
126
|
+
method: match[1]!.toUpperCase(),
|
|
127
|
+
path: match[2]!,
|
|
128
|
+
source: relPath,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
} catch {
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return endpoints;
|
|
138
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/detect-deps
|
|
3
|
+
* Detects dependencies declared in a repository by reading manifest files.
|
|
4
|
+
* This is used to find potential inter-repo connections (e.g., one repo
|
|
5
|
+
* consumes an npm package published by another).
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as fs from 'node:fs/promises';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
|
|
11
|
+
import type { RepoDependency } from '../types.js';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Extracts declared dependencies from a repository's manifest files.
|
|
15
|
+
*
|
|
16
|
+
* Supports:
|
|
17
|
+
* - npm (package.json)
|
|
18
|
+
* - NuGet (*.csproj)
|
|
19
|
+
* - pip (requirements.txt)
|
|
20
|
+
* - Go (go.mod)
|
|
21
|
+
*
|
|
22
|
+
* @param repoPath - Absolute path to the repository root.
|
|
23
|
+
* @returns Array of detected {@link RepoDependency} objects.
|
|
24
|
+
*/
|
|
25
|
+
export async function detectDependencies(repoPath: string): Promise<RepoDependency[]> {
|
|
26
|
+
const deps: RepoDependency[] = [];
|
|
27
|
+
|
|
28
|
+
// ── npm ───────────────────────────────────────────────────────────
|
|
29
|
+
try {
|
|
30
|
+
const raw = await fs.readFile(path.join(repoPath, 'package.json'), 'utf-8');
|
|
31
|
+
const pkg = JSON.parse(raw) as Record<string, unknown>;
|
|
32
|
+
|
|
33
|
+
const allDeps: Record<string, string> = {
|
|
34
|
+
...(pkg.dependencies as Record<string, string> | undefined),
|
|
35
|
+
...(pkg.devDependencies as Record<string, string> | undefined),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
for (const [name, version] of Object.entries(allDeps)) {
|
|
39
|
+
deps.push({ name, type: 'npm', version });
|
|
40
|
+
}
|
|
41
|
+
} catch {
|
|
42
|
+
// No package.json or parse error
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ── NuGet (.csproj) ───────────────────────────────────────────────
|
|
46
|
+
try {
|
|
47
|
+
const entries = await fs.readdir(repoPath);
|
|
48
|
+
const csprojFiles = entries.filter((e) => e.endsWith('.csproj'));
|
|
49
|
+
|
|
50
|
+
for (const csproj of csprojFiles) {
|
|
51
|
+
const content = await fs.readFile(path.join(repoPath, csproj), 'utf-8');
|
|
52
|
+
const packageRefRegex = /<PackageReference\s+Include="([^"]+)"\s+Version="([^"]*)"/gi;
|
|
53
|
+
let match: RegExpExecArray | null;
|
|
54
|
+
while ((match = packageRefRegex.exec(content)) !== null) {
|
|
55
|
+
deps.push({ name: match[1]!, type: 'nuget', version: match[2] });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
} catch {
|
|
59
|
+
// No .csproj files
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// ── pip (requirements.txt) ────────────────────────────────────────
|
|
63
|
+
try {
|
|
64
|
+
const content = await fs.readFile(path.join(repoPath, 'requirements.txt'), 'utf-8');
|
|
65
|
+
const lines = content.split('\n').filter((l) => l.trim() && !l.startsWith('#'));
|
|
66
|
+
|
|
67
|
+
for (const line of lines) {
|
|
68
|
+
const match = line.match(/^([a-zA-Z0-9_-]+)\s*([>=<~!]*\s*[\d.*]+)?/);
|
|
69
|
+
if (match) {
|
|
70
|
+
deps.push({
|
|
71
|
+
name: match[1]!,
|
|
72
|
+
type: 'pip',
|
|
73
|
+
version: match[2]?.trim() || undefined,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
} catch {
|
|
78
|
+
// No requirements.txt
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// ── Go (go.mod) ──────────────────────────────────────────────────
|
|
82
|
+
try {
|
|
83
|
+
const content = await fs.readFile(path.join(repoPath, 'go.mod'), 'utf-8');
|
|
84
|
+
const requireRegex = /require\s*\(([\s\S]*?)\)/g;
|
|
85
|
+
const modRegex = /^\s*([\S]+)\s+(v[\S]+)/gm;
|
|
86
|
+
|
|
87
|
+
let match: RegExpExecArray | null;
|
|
88
|
+
// Parse require blocks
|
|
89
|
+
while ((match = requireRegex.exec(content)) !== null) {
|
|
90
|
+
const block = match[1]!;
|
|
91
|
+
let modMatch: RegExpExecArray | null;
|
|
92
|
+
modRegex.lastIndex = 0;
|
|
93
|
+
while ((modMatch = modRegex.exec(block)) !== null) {
|
|
94
|
+
deps.push({ name: modMatch[1]!, type: 'go', version: modMatch[2] });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
} catch {
|
|
98
|
+
// No go.mod
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return deps;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Given analysis of multiple repos, find which repos depend on each other.
|
|
106
|
+
* Returns a map of repo name → list of repo names it depends on.
|
|
107
|
+
*
|
|
108
|
+
* @param repoAnalyses - Map of repo path to its detected dependencies.
|
|
109
|
+
* @param repoNames - Map of repo path to its name.
|
|
110
|
+
* @returns Map of repo name → list of repo names it depends on.
|
|
111
|
+
*/
|
|
112
|
+
export function findInterRepoDependencies(
|
|
113
|
+
repoAnalyses: Map<string, RepoDependency[]>,
|
|
114
|
+
repoNames: Map<string, string>,
|
|
115
|
+
): Map<string, string[]> {
|
|
116
|
+
const nameSet = new Set(repoNames.values());
|
|
117
|
+
const connections = new Map<string, string[]>();
|
|
118
|
+
|
|
119
|
+
for (const [repoPath, deps] of repoAnalyses) {
|
|
120
|
+
const thisName = repoNames.get(repoPath) ?? repoPath;
|
|
121
|
+
const dependsOn: string[] = [];
|
|
122
|
+
|
|
123
|
+
for (const dep of deps) {
|
|
124
|
+
// Check if the dependency name matches another repo name
|
|
125
|
+
// (e.g., an npm package name matching a repo folder name)
|
|
126
|
+
const depBaseName = dep.name.split('/').pop() ?? dep.name;
|
|
127
|
+
if (nameSet.has(depBaseName) && depBaseName !== thisName) {
|
|
128
|
+
dependsOn.push(depBaseName);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (dependsOn.length > 0) {
|
|
133
|
+
connections.set(thisName, dependsOn);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return connections;
|
|
138
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/detect-existing
|
|
3
|
+
* Detects existing AI assistant configuration files in a repository.
|
|
4
|
+
* These are merged into the generated workspace context to preserve
|
|
5
|
+
* repo-specific instructions.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import * as fs from 'node:fs/promises';
|
|
9
|
+
import * as path from 'node:path';
|
|
10
|
+
|
|
11
|
+
import type { ExistingAIConfig } from '../types.js';
|
|
12
|
+
|
|
13
|
+
/** Maximum chars to include as a content preview. */
|
|
14
|
+
const PREVIEW_LENGTH = 500;
|
|
15
|
+
|
|
16
|
+
/** Known AI config file locations. */
|
|
17
|
+
const AI_CONFIG_FILES = [
|
|
18
|
+
{ assistant: 'claude' as const, relativePath: 'CLAUDE.md' },
|
|
19
|
+
{ assistant: 'claude' as const, relativePath: 'CLAUDE.local.md' },
|
|
20
|
+
{ assistant: 'agents' as const, relativePath: 'AGENTS.md' },
|
|
21
|
+
{ assistant: 'copilot' as const, relativePath: '.github/copilot-instructions.md' },
|
|
22
|
+
{ assistant: 'cursor' as const, relativePath: '.cursorrules' },
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Scans a repository for existing AI assistant configuration files.
|
|
27
|
+
*
|
|
28
|
+
* @param repoPath - Absolute path to the repository root.
|
|
29
|
+
* @returns Array of detected {@link ExistingAIConfig} objects.
|
|
30
|
+
*/
|
|
31
|
+
export async function detectExistingAIConfigs(
|
|
32
|
+
repoPath: string,
|
|
33
|
+
): Promise<ExistingAIConfig[]> {
|
|
34
|
+
const results: ExistingAIConfig[] = [];
|
|
35
|
+
|
|
36
|
+
for (const config of AI_CONFIG_FILES) {
|
|
37
|
+
const filePath = path.join(repoPath, config.relativePath);
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
const content = await fs.readFile(filePath, 'utf-8');
|
|
41
|
+
results.push({
|
|
42
|
+
assistant: config.assistant,
|
|
43
|
+
relativePath: config.relativePath,
|
|
44
|
+
contentPreview: content.slice(0, PREVIEW_LENGTH),
|
|
45
|
+
});
|
|
46
|
+
} catch {
|
|
47
|
+
// File doesn't exist — skip
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Also check for Cursor rules directory
|
|
52
|
+
const cursorRulesDir = path.join(repoPath, '.cursor', 'rules');
|
|
53
|
+
try {
|
|
54
|
+
const entries = await fs.readdir(cursorRulesDir);
|
|
55
|
+
const mdcFiles = entries.filter((e) => e.endsWith('.mdc'));
|
|
56
|
+
|
|
57
|
+
for (const mdc of mdcFiles) {
|
|
58
|
+
try {
|
|
59
|
+
const content = await fs.readFile(path.join(cursorRulesDir, mdc), 'utf-8');
|
|
60
|
+
results.push({
|
|
61
|
+
assistant: 'cursor',
|
|
62
|
+
relativePath: `.cursor/rules/${mdc}`,
|
|
63
|
+
contentPreview: content.slice(0, PREVIEW_LENGTH),
|
|
64
|
+
});
|
|
65
|
+
} catch {
|
|
66
|
+
// Skip unreadable files
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} catch {
|
|
70
|
+
// No .cursor/rules directory
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return results;
|
|
74
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/detect-ports
|
|
3
|
+
* Detects configured ports and services in a repository by inspecting
|
|
4
|
+
* environment files, Docker configs, and framework-specific settings.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import * as fs from 'node:fs/promises';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
|
|
10
|
+
import type { ServicePort } from '../types.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Detects ports and service endpoints configured in a repository.
|
|
14
|
+
*
|
|
15
|
+
* Scans:
|
|
16
|
+
* - .env / .env.* files for PORT= patterns
|
|
17
|
+
* - docker-compose.yml for port mappings
|
|
18
|
+
* - launchSettings.json (.NET) for applicationUrl
|
|
19
|
+
* - package.json scripts for --port flags
|
|
20
|
+
*
|
|
21
|
+
* @param repoPath - Absolute path to the repository root.
|
|
22
|
+
* @returns Array of detected {@link ServicePort} objects.
|
|
23
|
+
*/
|
|
24
|
+
export async function detectPorts(repoPath: string): Promise<ServicePort[]> {
|
|
25
|
+
const ports: ServicePort[] = [];
|
|
26
|
+
const seen = new Set<number>();
|
|
27
|
+
|
|
28
|
+
const addPort = (port: number, protocol: 'http' | 'https' | 'grpc' | 'other', source: string) => {
|
|
29
|
+
if (!seen.has(port)) {
|
|
30
|
+
seen.add(port);
|
|
31
|
+
ports.push({ port, protocol, source });
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// ── .env files ────────────────────────────────────────────────────
|
|
36
|
+
const envFiles = ['.env', '.env.local', '.env.development'];
|
|
37
|
+
for (const envFile of envFiles) {
|
|
38
|
+
try {
|
|
39
|
+
const content = await fs.readFile(path.join(repoPath, envFile), 'utf-8');
|
|
40
|
+
const portMatch = content.match(/PORT\s*=\s*(\d+)/i);
|
|
41
|
+
if (portMatch) {
|
|
42
|
+
addPort(parseInt(portMatch[1]!, 10), 'http', envFile);
|
|
43
|
+
}
|
|
44
|
+
} catch {
|
|
45
|
+
// File doesn't exist
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// ── docker-compose.yml ────────────────────────────────────────────
|
|
50
|
+
const composeFiles = ['docker-compose.yml', 'docker-compose.yaml', 'compose.yaml', 'compose.yml'];
|
|
51
|
+
for (const composeFile of composeFiles) {
|
|
52
|
+
try {
|
|
53
|
+
const content = await fs.readFile(path.join(repoPath, composeFile), 'utf-8');
|
|
54
|
+
// Simple regex to extract port mappings like "3000:3000" or "- 8080:80"
|
|
55
|
+
const portRegex = /["']?(\d+):(\d+)["']?/g;
|
|
56
|
+
let match: RegExpExecArray | null;
|
|
57
|
+
while ((match = portRegex.exec(content)) !== null) {
|
|
58
|
+
addPort(parseInt(match[1]!, 10), 'http', composeFile);
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
// File doesn't exist
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ── launchSettings.json (.NET) ────────────────────────────────────
|
|
66
|
+
const launchSettingsPath = path.join(repoPath, 'Properties', 'launchSettings.json');
|
|
67
|
+
try {
|
|
68
|
+
const raw = await fs.readFile(launchSettingsPath, 'utf-8');
|
|
69
|
+
const settings = JSON.parse(raw) as Record<string, unknown>;
|
|
70
|
+
const profiles = settings.profiles as Record<string, Record<string, unknown>> | undefined;
|
|
71
|
+
|
|
72
|
+
if (profiles) {
|
|
73
|
+
for (const profile of Object.values(profiles)) {
|
|
74
|
+
const appUrl = profile.applicationUrl as string | undefined;
|
|
75
|
+
if (appUrl) {
|
|
76
|
+
const urlParts = appUrl.split(';');
|
|
77
|
+
for (const url of urlParts) {
|
|
78
|
+
const portMatch = url.match(/:(\d+)/);
|
|
79
|
+
if (portMatch) {
|
|
80
|
+
const protocol = url.startsWith('https') ? 'https' : 'http';
|
|
81
|
+
addPort(parseInt(portMatch[1]!, 10), protocol, 'launchSettings.json');
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
} catch {
|
|
88
|
+
// No launchSettings.json
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// ── package.json scripts ──────────────────────────────────────────
|
|
92
|
+
try {
|
|
93
|
+
const raw = await fs.readFile(path.join(repoPath, 'package.json'), 'utf-8');
|
|
94
|
+
const pkg = JSON.parse(raw) as Record<string, unknown>;
|
|
95
|
+
const scripts = pkg.scripts as Record<string, string> | undefined;
|
|
96
|
+
|
|
97
|
+
if (scripts) {
|
|
98
|
+
for (const script of Object.values(scripts)) {
|
|
99
|
+
const portMatch = script.match(/--port\s+(\d+)/i) ?? script.match(/-p\s+(\d+)/);
|
|
100
|
+
if (portMatch) {
|
|
101
|
+
addPort(parseInt(portMatch[1]!, 10), 'http', 'package.json scripts');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
} catch {
|
|
106
|
+
// No package.json
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return ports;
|
|
110
|
+
}
|