@adverant-nexus/cli 2.0.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/ARCHITECTURE.md +1366 -0
- package/LICENSE +21 -0
- package/README.md +593 -0
- package/completions/_nexus +452 -0
- package/completions/nexus.bash +329 -0
- package/completions/nexus.fish +187 -0
- package/dist/cli.d.ts +35 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +135 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/agent/index.d.ts +9 -0
- package/dist/commands/agent/index.d.ts.map +1 -0
- package/dist/commands/agent/index.js +20 -0
- package/dist/commands/agent/index.js.map +1 -0
- package/dist/commands/agent/list.d.ts +9 -0
- package/dist/commands/agent/list.d.ts.map +1 -0
- package/dist/commands/agent/list.js +122 -0
- package/dist/commands/agent/list.js.map +1 -0
- package/dist/commands/agent/run.d.ts +10 -0
- package/dist/commands/agent/run.d.ts.map +1 -0
- package/dist/commands/agent/run.js +167 -0
- package/dist/commands/agent/run.js.map +1 -0
- package/dist/commands/agent/status.d.ts +9 -0
- package/dist/commands/agent/status.d.ts.map +1 -0
- package/dist/commands/agent/status.js +157 -0
- package/dist/commands/agent/status.js.map +1 -0
- package/dist/commands/compute/agent.d.ts +21 -0
- package/dist/commands/compute/agent.d.ts.map +1 -0
- package/dist/commands/compute/agent.js +158 -0
- package/dist/commands/compute/agent.js.map +1 -0
- package/dist/commands/compute/index.d.ts +10 -0
- package/dist/commands/compute/index.d.ts.map +1 -0
- package/dist/commands/compute/index.js +27 -0
- package/dist/commands/compute/index.js.map +1 -0
- package/dist/commands/compute/lib/hardware-detection.d.ts +52 -0
- package/dist/commands/compute/lib/hardware-detection.d.ts.map +1 -0
- package/dist/commands/compute/lib/hardware-detection.js +432 -0
- package/dist/commands/compute/lib/hardware-detection.js.map +1 -0
- package/dist/commands/compute/lib/local-compute-agent.d.ts +143 -0
- package/dist/commands/compute/lib/local-compute-agent.d.ts.map +1 -0
- package/dist/commands/compute/lib/local-compute-agent.js +1162 -0
- package/dist/commands/compute/lib/local-compute-agent.js.map +1 -0
- package/dist/commands/compute/lib/local-compute-client.d.ts +89 -0
- package/dist/commands/compute/lib/local-compute-client.d.ts.map +1 -0
- package/dist/commands/compute/lib/local-compute-client.js +388 -0
- package/dist/commands/compute/lib/local-compute-client.js.map +1 -0
- package/dist/commands/compute/list.d.ts +14 -0
- package/dist/commands/compute/list.d.ts.map +1 -0
- package/dist/commands/compute/list.js +164 -0
- package/dist/commands/compute/list.js.map +1 -0
- package/dist/commands/compute/logs.d.ts +14 -0
- package/dist/commands/compute/logs.d.ts.map +1 -0
- package/dist/commands/compute/logs.js +105 -0
- package/dist/commands/compute/logs.js.map +1 -0
- package/dist/commands/compute/resources.d.ts +14 -0
- package/dist/commands/compute/resources.d.ts.map +1 -0
- package/dist/commands/compute/resources.js +163 -0
- package/dist/commands/compute/resources.js.map +1 -0
- package/dist/commands/compute/status.d.ts +13 -0
- package/dist/commands/compute/status.d.ts.map +1 -0
- package/dist/commands/compute/status.js +223 -0
- package/dist/commands/compute/status.js.map +1 -0
- package/dist/commands/compute/submit.d.ts +19 -0
- package/dist/commands/compute/submit.d.ts.map +1 -0
- package/dist/commands/compute/submit.js +99 -0
- package/dist/commands/compute/submit.js.map +1 -0
- package/dist/commands/deploy.d.ts +11 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +117 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/dynamic/graphrag-commands.d.ts +16 -0
- package/dist/commands/dynamic/graphrag-commands.d.ts.map +1 -0
- package/dist/commands/dynamic/graphrag-commands.js +562 -0
- package/dist/commands/dynamic/graphrag-commands.js.map +1 -0
- package/dist/commands/dynamic/index.d.ts +10 -0
- package/dist/commands/dynamic/index.d.ts.map +1 -0
- package/dist/commands/dynamic/index.js +17 -0
- package/dist/commands/dynamic/index.js.map +1 -0
- package/dist/commands/dynamic/mageagent-commands.d.ts +8 -0
- package/dist/commands/dynamic/mageagent-commands.d.ts.map +1 -0
- package/dist/commands/dynamic/mageagent-commands.js +86 -0
- package/dist/commands/dynamic/mageagent-commands.js.map +1 -0
- package/dist/commands/dynamic/mcp-tool-mapper.d.ts +97 -0
- package/dist/commands/dynamic/mcp-tool-mapper.d.ts.map +1 -0
- package/dist/commands/dynamic/mcp-tool-mapper.js +328 -0
- package/dist/commands/dynamic/mcp-tool-mapper.js.map +1 -0
- package/dist/commands/dynamic/nexus-commands.d.ts +78 -0
- package/dist/commands/dynamic/nexus-commands.d.ts.map +1 -0
- package/dist/commands/dynamic/nexus-commands.js +426 -0
- package/dist/commands/dynamic/nexus-commands.js.map +1 -0
- package/dist/commands/dynamic/sandbox-commands.d.ts +8 -0
- package/dist/commands/dynamic/sandbox-commands.d.ts.map +1 -0
- package/dist/commands/dynamic/sandbox-commands.js +80 -0
- package/dist/commands/dynamic/sandbox-commands.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +128 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +10 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +81 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/login.d.ts +10 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +83 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logs.d.ts +11 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +79 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/nexus/index.d.ts +69 -0
- package/dist/commands/nexus/index.d.ts.map +1 -0
- package/dist/commands/nexus/index.js +336 -0
- package/dist/commands/nexus/index.js.map +1 -0
- package/dist/commands/plugin/disable.d.ts +8 -0
- package/dist/commands/plugin/disable.d.ts.map +1 -0
- package/dist/commands/plugin/disable.js +31 -0
- package/dist/commands/plugin/disable.js.map +1 -0
- package/dist/commands/plugin/enable.d.ts +8 -0
- package/dist/commands/plugin/enable.d.ts.map +1 -0
- package/dist/commands/plugin/enable.js +37 -0
- package/dist/commands/plugin/enable.js.map +1 -0
- package/dist/commands/plugin/index.d.ts +8 -0
- package/dist/commands/plugin/index.d.ts.map +1 -0
- package/dist/commands/plugin/index.js +23 -0
- package/dist/commands/plugin/index.js.map +1 -0
- package/dist/commands/plugin/info.d.ts +8 -0
- package/dist/commands/plugin/info.d.ts.map +1 -0
- package/dist/commands/plugin/info.js +129 -0
- package/dist/commands/plugin/info.js.map +1 -0
- package/dist/commands/plugin/init.d.ts +8 -0
- package/dist/commands/plugin/init.d.ts.map +1 -0
- package/dist/commands/plugin/init.js +83 -0
- package/dist/commands/plugin/init.js.map +1 -0
- package/dist/commands/plugin/install.d.ts +8 -0
- package/dist/commands/plugin/install.d.ts.map +1 -0
- package/dist/commands/plugin/install.js +56 -0
- package/dist/commands/plugin/install.js.map +1 -0
- package/dist/commands/plugin/list.d.ts +8 -0
- package/dist/commands/plugin/list.d.ts.map +1 -0
- package/dist/commands/plugin/list.js +72 -0
- package/dist/commands/plugin/list.js.map +1 -0
- package/dist/commands/plugin/uninstall.d.ts +8 -0
- package/dist/commands/plugin/uninstall.d.ts.map +1 -0
- package/dist/commands/plugin/uninstall.js +49 -0
- package/dist/commands/plugin/uninstall.js.map +1 -0
- package/dist/commands/register.d.ts +10 -0
- package/dist/commands/register.d.ts.map +1 -0
- package/dist/commands/register.js +85 -0
- package/dist/commands/register.js.map +1 -0
- package/dist/commands/services/health.d.ts +7 -0
- package/dist/commands/services/health.d.ts.map +1 -0
- package/dist/commands/services/health.js +73 -0
- package/dist/commands/services/health.js.map +1 -0
- package/dist/commands/services/index.d.ts +16 -0
- package/dist/commands/services/index.d.ts.map +1 -0
- package/dist/commands/services/index.js +26 -0
- package/dist/commands/services/index.js.map +1 -0
- package/dist/commands/services/info.d.ts +7 -0
- package/dist/commands/services/info.d.ts.map +1 -0
- package/dist/commands/services/info.js +68 -0
- package/dist/commands/services/info.js.map +1 -0
- package/dist/commands/services/list.d.ts +9 -0
- package/dist/commands/services/list.d.ts.map +1 -0
- package/dist/commands/services/list.js +43 -0
- package/dist/commands/services/list.js.map +1 -0
- package/dist/commands/services/logs.d.ts +7 -0
- package/dist/commands/services/logs.d.ts.map +1 -0
- package/dist/commands/services/logs.js +107 -0
- package/dist/commands/services/logs.js.map +1 -0
- package/dist/commands/services/ports.d.ts +7 -0
- package/dist/commands/services/ports.d.ts.map +1 -0
- package/dist/commands/services/ports.js +65 -0
- package/dist/commands/services/ports.js.map +1 -0
- package/dist/commands/services/restart.d.ts +7 -0
- package/dist/commands/services/restart.d.ts.map +1 -0
- package/dist/commands/services/restart.js +67 -0
- package/dist/commands/services/restart.js.map +1 -0
- package/dist/commands/services/start.d.ts +7 -0
- package/dist/commands/services/start.d.ts.map +1 -0
- package/dist/commands/services/start.js +67 -0
- package/dist/commands/services/start.js.map +1 -0
- package/dist/commands/services/status.d.ts +9 -0
- package/dist/commands/services/status.d.ts.map +1 -0
- package/dist/commands/services/status.js +119 -0
- package/dist/commands/services/status.js.map +1 -0
- package/dist/commands/services/stop.d.ts +7 -0
- package/dist/commands/services/stop.d.ts.map +1 -0
- package/dist/commands/services/stop.js +67 -0
- package/dist/commands/services/stop.js.map +1 -0
- package/dist/commands/session/delete.d.ts +9 -0
- package/dist/commands/session/delete.d.ts.map +1 -0
- package/dist/commands/session/delete.js +51 -0
- package/dist/commands/session/delete.js.map +1 -0
- package/dist/commands/session/export.d.ts +9 -0
- package/dist/commands/session/export.d.ts.map +1 -0
- package/dist/commands/session/export.js +36 -0
- package/dist/commands/session/export.js.map +1 -0
- package/dist/commands/session/import.d.ts +9 -0
- package/dist/commands/session/import.d.ts.map +1 -0
- package/dist/commands/session/import.js +54 -0
- package/dist/commands/session/import.js.map +1 -0
- package/dist/commands/session/index.d.ts +9 -0
- package/dist/commands/session/index.d.ts.map +1 -0
- package/dist/commands/session/index.js +28 -0
- package/dist/commands/session/index.js.map +1 -0
- package/dist/commands/session/list.d.ts +9 -0
- package/dist/commands/session/list.d.ts.map +1 -0
- package/dist/commands/session/list.js +88 -0
- package/dist/commands/session/list.js.map +1 -0
- package/dist/commands/session/load.d.ts +9 -0
- package/dist/commands/session/load.d.ts.map +1 -0
- package/dist/commands/session/load.js +71 -0
- package/dist/commands/session/load.js.map +1 -0
- package/dist/commands/session/resume.d.ts +9 -0
- package/dist/commands/session/resume.d.ts.map +1 -0
- package/dist/commands/session/resume.js +49 -0
- package/dist/commands/session/resume.js.map +1 -0
- package/dist/commands/session/save.d.ts +9 -0
- package/dist/commands/session/save.d.ts.map +1 -0
- package/dist/commands/session/save.js +69 -0
- package/dist/commands/session/save.js.map +1 -0
- package/dist/commands/workspace/git-commit.d.ts +9 -0
- package/dist/commands/workspace/git-commit.d.ts.map +1 -0
- package/dist/commands/workspace/git-commit.js +156 -0
- package/dist/commands/workspace/git-commit.js.map +1 -0
- package/dist/commands/workspace/git-status.d.ts +9 -0
- package/dist/commands/workspace/git-status.d.ts.map +1 -0
- package/dist/commands/workspace/git-status.js +192 -0
- package/dist/commands/workspace/git-status.js.map +1 -0
- package/dist/commands/workspace/index.d.ts +9 -0
- package/dist/commands/workspace/index.d.ts.map +1 -0
- package/dist/commands/workspace/index.js +24 -0
- package/dist/commands/workspace/index.js.map +1 -0
- package/dist/commands/workspace/info.d.ts +10 -0
- package/dist/commands/workspace/info.d.ts.map +1 -0
- package/dist/commands/workspace/info.js +191 -0
- package/dist/commands/workspace/info.js.map +1 -0
- package/dist/commands/workspace/init.d.ts +9 -0
- package/dist/commands/workspace/init.d.ts.map +1 -0
- package/dist/commands/workspace/init.js +193 -0
- package/dist/commands/workspace/init.js.map +1 -0
- package/dist/commands/workspace/validate.d.ts +9 -0
- package/dist/commands/workspace/validate.d.ts.map +1 -0
- package/dist/commands/workspace/validate.js +140 -0
- package/dist/commands/workspace/validate.js.map +1 -0
- package/dist/core/agent-client.d.ts +49 -0
- package/dist/core/agent-client.d.ts.map +1 -0
- package/dist/core/agent-client.js +289 -0
- package/dist/core/agent-client.js.map +1 -0
- package/dist/core/config/config-manager.d.ts +75 -0
- package/dist/core/config/config-manager.d.ts.map +1 -0
- package/dist/core/config/config-manager.js +379 -0
- package/dist/core/config/config-manager.js.map +1 -0
- package/dist/core/config/profile-manager.d.ts +76 -0
- package/dist/core/config/profile-manager.d.ts.map +1 -0
- package/dist/core/config/profile-manager.js +250 -0
- package/dist/core/config/profile-manager.js.map +1 -0
- package/dist/core/config/workspace-detector.d.ts +66 -0
- package/dist/core/config/workspace-detector.d.ts.map +1 -0
- package/dist/core/config/workspace-detector.js +291 -0
- package/dist/core/config/workspace-detector.js.map +1 -0
- package/dist/core/discovery/docker-parser.d.ts +27 -0
- package/dist/core/discovery/docker-parser.d.ts.map +1 -0
- package/dist/core/discovery/docker-parser.js +361 -0
- package/dist/core/discovery/docker-parser.js.map +1 -0
- package/dist/core/discovery/index.d.ts +11 -0
- package/dist/core/discovery/index.d.ts.map +1 -0
- package/dist/core/discovery/index.js +16 -0
- package/dist/core/discovery/index.js.map +1 -0
- package/dist/core/discovery/mcp-discovery.d.ts +41 -0
- package/dist/core/discovery/mcp-discovery.d.ts.map +1 -0
- package/dist/core/discovery/mcp-discovery.js +439 -0
- package/dist/core/discovery/mcp-discovery.js.map +1 -0
- package/dist/core/discovery/openapi-parser.d.ts +95 -0
- package/dist/core/discovery/openapi-parser.d.ts.map +1 -0
- package/dist/core/discovery/openapi-parser.js +353 -0
- package/dist/core/discovery/openapi-parser.js.map +1 -0
- package/dist/core/discovery/plugin-discovery.d.ts +63 -0
- package/dist/core/discovery/plugin-discovery.d.ts.map +1 -0
- package/dist/core/discovery/plugin-discovery.js +333 -0
- package/dist/core/discovery/plugin-discovery.js.map +1 -0
- package/dist/core/discovery/service-discovery.d.ts +107 -0
- package/dist/core/discovery/service-discovery.d.ts.map +1 -0
- package/dist/core/discovery/service-discovery.js +349 -0
- package/dist/core/discovery/service-discovery.js.map +1 -0
- package/dist/core/nexus-client.d.ts +119 -0
- package/dist/core/nexus-client.d.ts.map +1 -0
- package/dist/core/nexus-client.js +292 -0
- package/dist/core/nexus-client.js.map +1 -0
- package/dist/core/nexus-tool-executor.d.ts +102 -0
- package/dist/core/nexus-tool-executor.d.ts.map +1 -0
- package/dist/core/nexus-tool-executor.js +386 -0
- package/dist/core/nexus-tool-executor.js.map +1 -0
- package/dist/core/react-handler.d.ts +17 -0
- package/dist/core/react-handler.d.ts.map +1 -0
- package/dist/core/react-handler.js +296 -0
- package/dist/core/react-handler.js.map +1 -0
- package/dist/core/router/command-registry.d.ts +61 -0
- package/dist/core/router/command-registry.d.ts.map +1 -0
- package/dist/core/router/command-registry.js +138 -0
- package/dist/core/router/command-registry.js.map +1 -0
- package/dist/core/router/command-router.d.ts +33 -0
- package/dist/core/router/command-router.d.ts.map +1 -0
- package/dist/core/router/command-router.js +111 -0
- package/dist/core/router/command-router.js.map +1 -0
- package/dist/core/router/index.d.ts +9 -0
- package/dist/core/router/index.d.ts.map +1 -0
- package/dist/core/router/index.js +8 -0
- package/dist/core/router/index.js.map +1 -0
- package/dist/core/session/context-manager.d.ts +69 -0
- package/dist/core/session/context-manager.d.ts.map +1 -0
- package/dist/core/session/context-manager.js +109 -0
- package/dist/core/session/context-manager.js.map +1 -0
- package/dist/core/session/history-manager.d.ts +72 -0
- package/dist/core/session/history-manager.d.ts.map +1 -0
- package/dist/core/session/history-manager.js +175 -0
- package/dist/core/session/history-manager.js.map +1 -0
- package/dist/core/session/index.d.ts +9 -0
- package/dist/core/session/index.d.ts.map +1 -0
- package/dist/core/session/index.js +9 -0
- package/dist/core/session/index.js.map +1 -0
- package/dist/core/session/session-manager.d.ts +50 -0
- package/dist/core/session/session-manager.d.ts.map +1 -0
- package/dist/core/session/session-manager.js +200 -0
- package/dist/core/session/session-manager.js.map +1 -0
- package/dist/core/session/session-storage.d.ts +59 -0
- package/dist/core/session/session-storage.d.ts.map +1 -0
- package/dist/core/session/session-storage.js +226 -0
- package/dist/core/session/session-storage.js.map +1 -0
- package/dist/core/transport/http-client.d.ts +27 -0
- package/dist/core/transport/http-client.d.ts.map +1 -0
- package/dist/core/transport/http-client.js +182 -0
- package/dist/core/transport/http-client.js.map +1 -0
- package/dist/core/transport/index.d.ts +11 -0
- package/dist/core/transport/index.d.ts.map +1 -0
- package/dist/core/transport/index.js +10 -0
- package/dist/core/transport/index.js.map +1 -0
- package/dist/core/transport/mcp-client.d.ts +69 -0
- package/dist/core/transport/mcp-client.d.ts.map +1 -0
- package/dist/core/transport/mcp-client.js +252 -0
- package/dist/core/transport/mcp-client.js.map +1 -0
- package/dist/core/transport/stream-handler.d.ts +51 -0
- package/dist/core/transport/stream-handler.d.ts.map +1 -0
- package/dist/core/transport/stream-handler.js +264 -0
- package/dist/core/transport/stream-handler.js.map +1 -0
- package/dist/core/transport/websocket-client.d.ts +66 -0
- package/dist/core/transport/websocket-client.d.ts.map +1 -0
- package/dist/core/transport/websocket-client.js +232 -0
- package/dist/core/transport/websocket-client.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -0
- package/dist/output/formatters/index.d.ts +9 -0
- package/dist/output/formatters/index.d.ts.map +1 -0
- package/dist/output/formatters/index.js +9 -0
- package/dist/output/formatters/index.js.map +1 -0
- package/dist/output/formatters/json-formatter.d.ts +71 -0
- package/dist/output/formatters/json-formatter.d.ts.map +1 -0
- package/dist/output/formatters/json-formatter.js +236 -0
- package/dist/output/formatters/json-formatter.js.map +1 -0
- package/dist/output/formatters/stream-formatter.d.ts +107 -0
- package/dist/output/formatters/stream-formatter.d.ts.map +1 -0
- package/dist/output/formatters/stream-formatter.js +247 -0
- package/dist/output/formatters/stream-formatter.js.map +1 -0
- package/dist/output/formatters/table-formatter.d.ts +63 -0
- package/dist/output/formatters/table-formatter.d.ts.map +1 -0
- package/dist/output/formatters/table-formatter.js +294 -0
- package/dist/output/formatters/table-formatter.js.map +1 -0
- package/dist/output/formatters/text-formatter.d.ts +63 -0
- package/dist/output/formatters/text-formatter.d.ts.map +1 -0
- package/dist/output/formatters/text-formatter.js +202 -0
- package/dist/output/formatters/text-formatter.js.map +1 -0
- package/dist/output/formatters/yaml-formatter.d.ts +71 -0
- package/dist/output/formatters/yaml-formatter.d.ts.map +1 -0
- package/dist/output/formatters/yaml-formatter.js +239 -0
- package/dist/output/formatters/yaml-formatter.js.map +1 -0
- package/dist/output/index.d.ts +7 -0
- package/dist/output/index.d.ts.map +1 -0
- package/dist/output/index.js +7 -0
- package/dist/output/index.js.map +1 -0
- package/dist/output/output-manager.d.ts +156 -0
- package/dist/output/output-manager.d.ts.map +1 -0
- package/dist/output/output-manager.js +339 -0
- package/dist/output/output-manager.js.map +1 -0
- package/dist/output/renderers/index.d.ts +6 -0
- package/dist/output/renderers/index.d.ts.map +1 -0
- package/dist/output/renderers/index.js +6 -0
- package/dist/output/renderers/index.js.map +1 -0
- package/dist/output/renderers/progress-renderer.d.ts +56 -0
- package/dist/output/renderers/progress-renderer.d.ts.map +1 -0
- package/dist/output/renderers/progress-renderer.js +306 -0
- package/dist/output/renderers/progress-renderer.js.map +1 -0
- package/dist/output/renderers/terminal-renderer.d.ts +117 -0
- package/dist/output/renderers/terminal-renderer.d.ts.map +1 -0
- package/dist/output/renderers/terminal-renderer.js +294 -0
- package/dist/output/renderers/terminal-renderer.js.map +1 -0
- package/dist/plugins/index.d.ts +12 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +18 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/plugin-loader.d.ts +37 -0
- package/dist/plugins/plugin-loader.d.ts.map +1 -0
- package/dist/plugins/plugin-loader.js +155 -0
- package/dist/plugins/plugin-loader.js.map +1 -0
- package/dist/plugins/plugin-manager.d.ts +78 -0
- package/dist/plugins/plugin-manager.d.ts.map +1 -0
- package/dist/plugins/plugin-manager.js +310 -0
- package/dist/plugins/plugin-manager.js.map +1 -0
- package/dist/plugins/plugin-sdk.d.ts +136 -0
- package/dist/plugins/plugin-sdk.d.ts.map +1 -0
- package/dist/plugins/plugin-sdk.js +260 -0
- package/dist/plugins/plugin-sdk.js.map +1 -0
- package/dist/plugins/plugin-storage.d.ts +109 -0
- package/dist/plugins/plugin-storage.d.ts.map +1 -0
- package/dist/plugins/plugin-storage.js +207 -0
- package/dist/plugins/plugin-storage.js.map +1 -0
- package/dist/plugins/plugin-validator.d.ts +44 -0
- package/dist/plugins/plugin-validator.d.ts.map +1 -0
- package/dist/plugins/plugin-validator.js +272 -0
- package/dist/plugins/plugin-validator.js.map +1 -0
- package/dist/plugins/template-generator.d.ts +35 -0
- package/dist/plugins/template-generator.d.ts.map +1 -0
- package/dist/plugins/template-generator.js +438 -0
- package/dist/plugins/template-generator.js.map +1 -0
- package/dist/repl/completer.d.ts +58 -0
- package/dist/repl/completer.d.ts.map +1 -0
- package/dist/repl/completer.js +198 -0
- package/dist/repl/completer.js.map +1 -0
- package/dist/repl/evaluator.d.ts +55 -0
- package/dist/repl/evaluator.d.ts.map +1 -0
- package/dist/repl/evaluator.js +299 -0
- package/dist/repl/evaluator.js.map +1 -0
- package/dist/repl/index.d.ts +10 -0
- package/dist/repl/index.d.ts.map +1 -0
- package/dist/repl/index.js +10 -0
- package/dist/repl/index.js.map +1 -0
- package/dist/repl/renderer.d.ts +77 -0
- package/dist/repl/renderer.d.ts.map +1 -0
- package/dist/repl/renderer.js +291 -0
- package/dist/repl/renderer.js.map +1 -0
- package/dist/repl/repl.d.ts +89 -0
- package/dist/repl/repl.d.ts.map +1 -0
- package/dist/repl/repl.js +339 -0
- package/dist/repl/repl.js.map +1 -0
- package/dist/templates/python.d.ts +15 -0
- package/dist/templates/python.d.ts.map +1 -0
- package/dist/templates/python.js +375 -0
- package/dist/templates/python.js.map +1 -0
- package/dist/templates/typescript.d.ts +15 -0
- package/dist/templates/typescript.d.ts.map +1 -0
- package/dist/templates/typescript.js +274 -0
- package/dist/templates/typescript.js.map +1 -0
- package/dist/types/agent.d.ts +109 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +7 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/api.d.ts +125 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +53 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/command.d.ts +101 -0
- package/dist/types/command.d.ts.map +1 -0
- package/dist/types/command.js +7 -0
- package/dist/types/command.js.map +1 -0
- package/dist/types/compute.d.ts +317 -0
- package/dist/types/compute.d.ts.map +1 -0
- package/dist/types/compute.js +19 -0
- package/dist/types/compute.js.map +1 -0
- package/dist/types/config.d.ts +71 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +7 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/errors.d.ts +56 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +64 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +16 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/nexus.d.ts +254 -0
- package/dist/types/nexus.d.ts.map +1 -0
- package/dist/types/nexus.js +7 -0
- package/dist/types/nexus.js.map +1 -0
- package/dist/types/output.d.ts +107 -0
- package/dist/types/output.d.ts.map +1 -0
- package/dist/types/output.js +7 -0
- package/dist/types/output.js.map +1 -0
- package/dist/types/plugin.d.ts +118 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +7 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/types/service.d.ts +94 -0
- package/dist/types/service.d.ts.map +1 -0
- package/dist/types/service.js +15 -0
- package/dist/types/service.js.map +1 -0
- package/dist/types/session.d.ts +80 -0
- package/dist/types/session.d.ts.map +1 -0
- package/dist/types/session.js +7 -0
- package/dist/types/session.js.map +1 -0
- package/dist/types/transport.d.ts +96 -0
- package/dist/types/transport.d.ts.map +1 -0
- package/dist/types/transport.js +7 -0
- package/dist/types/transport.js.map +1 -0
- package/dist/utils/config.d.ts +47 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +166 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/error-handler.d.ts +82 -0
- package/dist/utils/error-handler.d.ts.map +1 -0
- package/dist/utils/error-handler.js +238 -0
- package/dist/utils/error-handler.js.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +61 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +200 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/prompt.d.ts +57 -0
- package/dist/utils/prompt.d.ts.map +1 -0
- package/dist/utils/prompt.js +141 -0
- package/dist/utils/prompt.js.map +1 -0
- package/dist/utils/spinner.d.ts +47 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +123 -0
- package/dist/utils/spinner.js.map +1 -0
- package/dist/utils/validation.d.ts +97 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +289 -0
- package/dist/utils/validation.js.map +1 -0
- package/docs/COMPLETIONS.md +528 -0
- package/docs/REPL.md +466 -0
- package/docs/graphrag-commands.md +387 -0
- package/package.json +154 -0
- package/scripts/install-completions.sh +356 -0
- package/scripts/prepublish.js +522 -0
- package/scripts/verify-package.js +505 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hardware Detection Module
|
|
3
|
+
*
|
|
4
|
+
* Detects local hardware capabilities including:
|
|
5
|
+
* - Apple Silicon (M1/M2/M3/M4 series)
|
|
6
|
+
* - NVIDIA GPUs
|
|
7
|
+
* - CPU cores and memory
|
|
8
|
+
* - Installed ML frameworks
|
|
9
|
+
*/
|
|
10
|
+
import os from 'os';
|
|
11
|
+
import { execSync } from 'child_process';
|
|
12
|
+
/**
|
|
13
|
+
* Apple Silicon GPU Specifications
|
|
14
|
+
*/
|
|
15
|
+
const APPLE_SILICON_SPECS = {
|
|
16
|
+
'Apple M1': {
|
|
17
|
+
memory: 16,
|
|
18
|
+
fp32Tflops: 2.6,
|
|
19
|
+
fp16Tflops: 5.2,
|
|
20
|
+
neuralEngine: true,
|
|
21
|
+
neuralEngineTops: 11,
|
|
22
|
+
api: 'Metal 3',
|
|
23
|
+
},
|
|
24
|
+
'Apple M1 Pro': {
|
|
25
|
+
memory: 32,
|
|
26
|
+
fp32Tflops: 5.2,
|
|
27
|
+
fp16Tflops: 10.4,
|
|
28
|
+
neuralEngine: true,
|
|
29
|
+
neuralEngineTops: 11,
|
|
30
|
+
api: 'Metal 3',
|
|
31
|
+
},
|
|
32
|
+
'Apple M1 Max': {
|
|
33
|
+
memory: 64,
|
|
34
|
+
fp32Tflops: 10.4,
|
|
35
|
+
fp16Tflops: 20.8,
|
|
36
|
+
neuralEngine: true,
|
|
37
|
+
neuralEngineTops: 11,
|
|
38
|
+
api: 'Metal 3',
|
|
39
|
+
},
|
|
40
|
+
'Apple M1 Ultra': {
|
|
41
|
+
memory: 128,
|
|
42
|
+
fp32Tflops: 20.8,
|
|
43
|
+
fp16Tflops: 41.6,
|
|
44
|
+
neuralEngine: true,
|
|
45
|
+
neuralEngineTops: 22,
|
|
46
|
+
api: 'Metal 3',
|
|
47
|
+
},
|
|
48
|
+
'Apple M2': {
|
|
49
|
+
memory: 24,
|
|
50
|
+
fp32Tflops: 3.6,
|
|
51
|
+
fp16Tflops: 7.2,
|
|
52
|
+
neuralEngine: true,
|
|
53
|
+
neuralEngineTops: 15.8,
|
|
54
|
+
api: 'Metal 3',
|
|
55
|
+
},
|
|
56
|
+
'Apple M2 Pro': {
|
|
57
|
+
memory: 32,
|
|
58
|
+
fp32Tflops: 6.8,
|
|
59
|
+
fp16Tflops: 13.6,
|
|
60
|
+
neuralEngine: true,
|
|
61
|
+
neuralEngineTops: 15.8,
|
|
62
|
+
api: 'Metal 3',
|
|
63
|
+
},
|
|
64
|
+
'Apple M2 Max': {
|
|
65
|
+
memory: 96,
|
|
66
|
+
fp32Tflops: 13.6,
|
|
67
|
+
fp16Tflops: 27.2,
|
|
68
|
+
neuralEngine: true,
|
|
69
|
+
neuralEngineTops: 15.8,
|
|
70
|
+
api: 'Metal 3',
|
|
71
|
+
},
|
|
72
|
+
'Apple M2 Ultra': {
|
|
73
|
+
memory: 192,
|
|
74
|
+
fp32Tflops: 27.2,
|
|
75
|
+
fp16Tflops: 54.4,
|
|
76
|
+
neuralEngine: true,
|
|
77
|
+
neuralEngineTops: 31.6,
|
|
78
|
+
api: 'Metal 3',
|
|
79
|
+
},
|
|
80
|
+
'Apple M3': {
|
|
81
|
+
memory: 24,
|
|
82
|
+
fp32Tflops: 4.0,
|
|
83
|
+
fp16Tflops: 8.0,
|
|
84
|
+
neuralEngine: true,
|
|
85
|
+
neuralEngineTops: 18,
|
|
86
|
+
api: 'Metal 3',
|
|
87
|
+
},
|
|
88
|
+
'Apple M3 Pro': {
|
|
89
|
+
memory: 36,
|
|
90
|
+
fp32Tflops: 7.5,
|
|
91
|
+
fp16Tflops: 15.0,
|
|
92
|
+
neuralEngine: true,
|
|
93
|
+
neuralEngineTops: 18,
|
|
94
|
+
api: 'Metal 3',
|
|
95
|
+
},
|
|
96
|
+
'Apple M3 Max': {
|
|
97
|
+
memory: 128,
|
|
98
|
+
fp32Tflops: 14.2,
|
|
99
|
+
fp16Tflops: 28.4,
|
|
100
|
+
neuralEngine: true,
|
|
101
|
+
neuralEngineTops: 18,
|
|
102
|
+
api: 'Metal 3',
|
|
103
|
+
},
|
|
104
|
+
'Apple M4': {
|
|
105
|
+
memory: 32,
|
|
106
|
+
fp32Tflops: 5.3,
|
|
107
|
+
fp16Tflops: 10.6,
|
|
108
|
+
neuralEngine: true,
|
|
109
|
+
neuralEngineTops: 38,
|
|
110
|
+
api: 'Metal 3',
|
|
111
|
+
},
|
|
112
|
+
'Apple M4 Pro': {
|
|
113
|
+
memory: 48,
|
|
114
|
+
fp32Tflops: 12.0,
|
|
115
|
+
fp16Tflops: 24.0,
|
|
116
|
+
neuralEngine: true,
|
|
117
|
+
neuralEngineTops: 38,
|
|
118
|
+
api: 'Metal 3',
|
|
119
|
+
},
|
|
120
|
+
'Apple M4 Max': {
|
|
121
|
+
memory: 128,
|
|
122
|
+
fp32Tflops: 18.0,
|
|
123
|
+
fp16Tflops: 36.0,
|
|
124
|
+
neuralEngine: true,
|
|
125
|
+
neuralEngineTops: 38,
|
|
126
|
+
api: 'Metal 3',
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Detect all hardware information
|
|
131
|
+
*/
|
|
132
|
+
export async function detectHardware() {
|
|
133
|
+
const platform = os.platform();
|
|
134
|
+
const arch = os.arch();
|
|
135
|
+
const hostname = os.hostname();
|
|
136
|
+
const cpu = detectCPU();
|
|
137
|
+
const memory = detectMemory();
|
|
138
|
+
const gpu = await detectGPU();
|
|
139
|
+
const frameworks = await detectFrameworks();
|
|
140
|
+
return {
|
|
141
|
+
platform,
|
|
142
|
+
arch,
|
|
143
|
+
hostname,
|
|
144
|
+
cpu,
|
|
145
|
+
memory,
|
|
146
|
+
gpu,
|
|
147
|
+
frameworks,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Detect CPU information
|
|
152
|
+
*/
|
|
153
|
+
function detectCPU() {
|
|
154
|
+
const cpus = os.cpus();
|
|
155
|
+
const model = cpus[0]?.model || 'Unknown';
|
|
156
|
+
const cores = cpus.length;
|
|
157
|
+
const speed = cpus[0]?.speed;
|
|
158
|
+
// Detect Apple Silicon core configuration
|
|
159
|
+
let performanceCores;
|
|
160
|
+
let efficiencyCores;
|
|
161
|
+
if (model.includes('Apple M')) {
|
|
162
|
+
// Apple Silicon has P-cores and E-cores
|
|
163
|
+
// M4 Max: 16 cores (12P + 4E)
|
|
164
|
+
if (model.includes('M4 Max')) {
|
|
165
|
+
performanceCores = 12;
|
|
166
|
+
efficiencyCores = 4;
|
|
167
|
+
}
|
|
168
|
+
else if (model.includes('M4 Pro')) {
|
|
169
|
+
performanceCores = 10;
|
|
170
|
+
efficiencyCores = 4;
|
|
171
|
+
}
|
|
172
|
+
else if (model.includes('M4')) {
|
|
173
|
+
performanceCores = 4;
|
|
174
|
+
efficiencyCores = 6;
|
|
175
|
+
}
|
|
176
|
+
else if (model.includes('M3 Max')) {
|
|
177
|
+
performanceCores = 12;
|
|
178
|
+
efficiencyCores = 4;
|
|
179
|
+
}
|
|
180
|
+
else if (model.includes('M3 Pro')) {
|
|
181
|
+
performanceCores = 6;
|
|
182
|
+
efficiencyCores = 6;
|
|
183
|
+
}
|
|
184
|
+
else if (model.includes('M3')) {
|
|
185
|
+
performanceCores = 4;
|
|
186
|
+
efficiencyCores = 4;
|
|
187
|
+
}
|
|
188
|
+
else {
|
|
189
|
+
// Generic Apple Silicon estimate
|
|
190
|
+
performanceCores = Math.ceil(cores * 0.75);
|
|
191
|
+
efficiencyCores = cores - performanceCores;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
model,
|
|
196
|
+
cores,
|
|
197
|
+
performanceCores,
|
|
198
|
+
efficiencyCores,
|
|
199
|
+
speed,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Detect memory information
|
|
204
|
+
*/
|
|
205
|
+
function detectMemory() {
|
|
206
|
+
const totalBytes = os.totalmem();
|
|
207
|
+
const freeBytes = os.freemem();
|
|
208
|
+
const total = Math.round(totalBytes / (1024 * 1024 * 1024));
|
|
209
|
+
const available = Math.round(freeBytes / (1024 * 1024 * 1024));
|
|
210
|
+
// Apple Silicon uses unified memory
|
|
211
|
+
const cpus = os.cpus();
|
|
212
|
+
const unified = cpus[0]?.model.includes('Apple M') || false;
|
|
213
|
+
return {
|
|
214
|
+
total,
|
|
215
|
+
available,
|
|
216
|
+
unified,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Detect GPU/Accelerator
|
|
221
|
+
*/
|
|
222
|
+
async function detectGPU() {
|
|
223
|
+
const platform = os.platform();
|
|
224
|
+
const cpus = os.cpus();
|
|
225
|
+
const cpuModel = cpus[0]?.model || '';
|
|
226
|
+
// Check for Apple Silicon
|
|
227
|
+
if (cpuModel.includes('Apple M')) {
|
|
228
|
+
// Find matching Apple Silicon specs
|
|
229
|
+
for (const [model, specs] of Object.entries(APPLE_SILICON_SPECS)) {
|
|
230
|
+
if (cpuModel.includes(model.replace('Apple ', ''))) {
|
|
231
|
+
const totalMemory = Math.round(os.totalmem() / (1024 * 1024 * 1024));
|
|
232
|
+
return {
|
|
233
|
+
type: model,
|
|
234
|
+
memory: totalMemory, // Unified memory
|
|
235
|
+
api: specs.api || 'Metal 3',
|
|
236
|
+
fp32Tflops: specs.fp32Tflops,
|
|
237
|
+
fp16Tflops: specs.fp16Tflops,
|
|
238
|
+
computeCapability: 'metal-3',
|
|
239
|
+
neuralEngine: specs.neuralEngine,
|
|
240
|
+
neuralEngineTops: specs.neuralEngineTops,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
// Generic Apple Silicon
|
|
245
|
+
const totalMemory = Math.round(os.totalmem() / (1024 * 1024 * 1024));
|
|
246
|
+
return {
|
|
247
|
+
type: cpuModel,
|
|
248
|
+
memory: totalMemory,
|
|
249
|
+
api: 'Metal 3',
|
|
250
|
+
computeCapability: 'metal-3',
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
// Check for NVIDIA GPU on Linux/Windows
|
|
254
|
+
if (platform === 'linux' || platform === 'win32') {
|
|
255
|
+
try {
|
|
256
|
+
const result = execSync('nvidia-smi --query-gpu=name,memory.total --format=csv,noheader', {
|
|
257
|
+
encoding: 'utf-8',
|
|
258
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
259
|
+
});
|
|
260
|
+
const lines = result.trim().split('\n');
|
|
261
|
+
if (lines.length > 0) {
|
|
262
|
+
const [name, memoryStr] = lines[0].split(',').map((s) => s.trim());
|
|
263
|
+
const memory = parseInt(memoryStr) / 1024; // Convert MiB to GB
|
|
264
|
+
return {
|
|
265
|
+
type: name,
|
|
266
|
+
memory: Math.round(memory),
|
|
267
|
+
api: 'CUDA',
|
|
268
|
+
computeCapability: await detectCudaCapability(),
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
catch {
|
|
273
|
+
// nvidia-smi not available or no GPU
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Detect CUDA compute capability
|
|
280
|
+
*/
|
|
281
|
+
async function detectCudaCapability() {
|
|
282
|
+
try {
|
|
283
|
+
const result = execSync('nvidia-smi --query-gpu=compute_cap --format=csv,noheader', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] });
|
|
284
|
+
return result.trim();
|
|
285
|
+
}
|
|
286
|
+
catch {
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Detect installed ML frameworks
|
|
292
|
+
*/
|
|
293
|
+
async function detectFrameworks() {
|
|
294
|
+
const frameworks = [];
|
|
295
|
+
const platform = os.platform();
|
|
296
|
+
const cpus = os.cpus();
|
|
297
|
+
const isAppleSilicon = cpus[0]?.model.includes('Apple M');
|
|
298
|
+
// Check PyTorch
|
|
299
|
+
try {
|
|
300
|
+
const result = execSync('python3 -c "import torch; print(torch.__version__)"', {
|
|
301
|
+
encoding: 'utf-8',
|
|
302
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
303
|
+
});
|
|
304
|
+
const version = result.trim();
|
|
305
|
+
// Check for GPU support
|
|
306
|
+
let gpuSupport = false;
|
|
307
|
+
try {
|
|
308
|
+
if (isAppleSilicon) {
|
|
309
|
+
const mpsCheck = execSync('python3 -c "import torch; print(torch.backends.mps.is_available())"', {
|
|
310
|
+
encoding: 'utf-8',
|
|
311
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
312
|
+
});
|
|
313
|
+
gpuSupport = mpsCheck.trim() === 'True';
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
const cudaCheck = execSync('python3 -c "import torch; print(torch.cuda.is_available())"', {
|
|
317
|
+
encoding: 'utf-8',
|
|
318
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
319
|
+
});
|
|
320
|
+
gpuSupport = cudaCheck.trim() === 'True';
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
catch {
|
|
324
|
+
// GPU check failed
|
|
325
|
+
}
|
|
326
|
+
frameworks.push({
|
|
327
|
+
name: 'PyTorch',
|
|
328
|
+
version,
|
|
329
|
+
available: true,
|
|
330
|
+
gpuSupport,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
catch {
|
|
334
|
+
frameworks.push({
|
|
335
|
+
name: 'PyTorch',
|
|
336
|
+
available: false,
|
|
337
|
+
gpuSupport: false,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
// Check TensorFlow
|
|
341
|
+
try {
|
|
342
|
+
const result = execSync('python3 -c "import tensorflow as tf; print(tf.__version__)"', {
|
|
343
|
+
encoding: 'utf-8',
|
|
344
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
345
|
+
});
|
|
346
|
+
const version = result.trim();
|
|
347
|
+
// Check for GPU support
|
|
348
|
+
let gpuSupport = false;
|
|
349
|
+
try {
|
|
350
|
+
const gpuCheck = execSync('python3 -c "import tensorflow as tf; print(len(tf.config.list_physical_devices(\'GPU\')) > 0)"', {
|
|
351
|
+
encoding: 'utf-8',
|
|
352
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
353
|
+
});
|
|
354
|
+
gpuSupport = gpuCheck.trim() === 'True';
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
// GPU check failed
|
|
358
|
+
}
|
|
359
|
+
frameworks.push({
|
|
360
|
+
name: 'TensorFlow',
|
|
361
|
+
version,
|
|
362
|
+
available: true,
|
|
363
|
+
gpuSupport,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
catch {
|
|
367
|
+
frameworks.push({
|
|
368
|
+
name: 'TensorFlow',
|
|
369
|
+
available: false,
|
|
370
|
+
gpuSupport: false,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
// Check MLX (Apple Silicon only)
|
|
374
|
+
if (isAppleSilicon) {
|
|
375
|
+
try {
|
|
376
|
+
const result = execSync('python3 -c "import mlx; print(mlx.__version__)"', {
|
|
377
|
+
encoding: 'utf-8',
|
|
378
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
379
|
+
});
|
|
380
|
+
const version = result.trim();
|
|
381
|
+
frameworks.push({
|
|
382
|
+
name: 'MLX',
|
|
383
|
+
version,
|
|
384
|
+
available: true,
|
|
385
|
+
gpuSupport: true, // MLX always uses GPU on Apple Silicon
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
frameworks.push({
|
|
390
|
+
name: 'MLX',
|
|
391
|
+
available: false,
|
|
392
|
+
gpuSupport: false,
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
// Check JAX
|
|
397
|
+
try {
|
|
398
|
+
const result = execSync('python3 -c "import jax; print(jax.__version__)"', {
|
|
399
|
+
encoding: 'utf-8',
|
|
400
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
401
|
+
});
|
|
402
|
+
const version = result.trim();
|
|
403
|
+
// Check for GPU support
|
|
404
|
+
let gpuSupport = false;
|
|
405
|
+
try {
|
|
406
|
+
const gpuCheck = execSync('python3 -c "import jax; print(len(jax.devices(\'gpu\')) > 0)"', {
|
|
407
|
+
encoding: 'utf-8',
|
|
408
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
409
|
+
});
|
|
410
|
+
gpuSupport = gpuCheck.trim() === 'True';
|
|
411
|
+
}
|
|
412
|
+
catch {
|
|
413
|
+
// GPU check failed
|
|
414
|
+
}
|
|
415
|
+
frameworks.push({
|
|
416
|
+
name: 'JAX',
|
|
417
|
+
version,
|
|
418
|
+
available: true,
|
|
419
|
+
gpuSupport,
|
|
420
|
+
});
|
|
421
|
+
}
|
|
422
|
+
catch {
|
|
423
|
+
frameworks.push({
|
|
424
|
+
name: 'JAX',
|
|
425
|
+
available: false,
|
|
426
|
+
gpuSupport: false,
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
return frameworks;
|
|
430
|
+
}
|
|
431
|
+
export default detectHardware;
|
|
432
|
+
//# sourceMappingURL=hardware-detection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hardware-detection.js","sourceRoot":"","sources":["../../../../src/commands/compute/lib/hardware-detection.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AA4CzC;;GAEG;AACH,MAAM,mBAAmB,GAAqC;IAC5D,UAAU,EAAE;QACV,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,GAAG;QACf,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,EAAE;QACpB,GAAG,EAAE,SAAS;KACf;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,GAAG;QACf,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,EAAE;QACpB,GAAG,EAAE,SAAS;KACf;IACD,cAAc,EAAE;QACd,MAAM,EAAE,EAAE;QACV,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,IAAI;QAChB,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,EAAE;QACpB,GAAG,EAAE,SAAS;KACf;IACD,gBAAgB,EAAE;QAChB,MAAM,EAAE,GAAG;QAC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AE,KAAK;aAClB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,YAAY;IACZ,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,QAAQ,CAAC,iDAAiD,EAAE;YACzE,QAAQ,EAAE,OAAO;YACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;SAClC,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAE9B,wBAAwB;QACxB,IAAI,UAAU,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,+DAA+D,EAAE;gBACzF,QAAQ,EAAE,OAAO;gBACjB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;aAClC,CAAC,CAAC;YACH,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,KAAK,MAAM,CAAC;QAC1C,CAAC;QAAC,MAAM,CAAC;YACP,mBAAmB;QACrB,CAAC;QAED,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,KAAK;YACX,OAAO;YACP,SAAS,EAAE,IAAI;YACf,UAAU;SACX,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,UAAU,CAAC,IAAI,CAAC;YACd,IAAI,EAAE,KAAK;YACX,SAAS,EAAE,KAAK;YAChB,UAAU,EAAE,KAAK;SAClB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local Compute Agent
|
|
3
|
+
*
|
|
4
|
+
* Daemon process that registers with HPC Gateway and executes ML jobs locally.
|
|
5
|
+
* Supports Apple Silicon (MPS), NVIDIA CUDA, and CPU-only execution.
|
|
6
|
+
*/
|
|
7
|
+
import EventEmitter from 'eventemitter3';
|
|
8
|
+
import type { LocalComputeConfig, ComputeAgentStatus, LocalAgentStatus, LocalComputeJob, JobStatus, ComputeEvents, KernelSession, ExecuteRequest, ExecuteResult } from '../../../types/compute.js';
|
|
9
|
+
export declare class LocalComputeAgent extends EventEmitter<ComputeEvents> {
|
|
10
|
+
private config;
|
|
11
|
+
private hardware;
|
|
12
|
+
private agentId;
|
|
13
|
+
private gatewaySocket;
|
|
14
|
+
private localServer;
|
|
15
|
+
private localApp;
|
|
16
|
+
private localIO;
|
|
17
|
+
private jobQueue;
|
|
18
|
+
private currentJob;
|
|
19
|
+
private completedJobs;
|
|
20
|
+
private jobLogs;
|
|
21
|
+
private kernelSessions;
|
|
22
|
+
private kernelProcesses;
|
|
23
|
+
private kernelOutputBuffers;
|
|
24
|
+
private reconnectAttempts;
|
|
25
|
+
private reconnectTimer;
|
|
26
|
+
private heartbeatTimer;
|
|
27
|
+
private idleTimer;
|
|
28
|
+
private running;
|
|
29
|
+
private jobsCompleted;
|
|
30
|
+
private jobsFailed;
|
|
31
|
+
private totalComputeTime;
|
|
32
|
+
private startTime;
|
|
33
|
+
constructor(config?: Partial<LocalComputeConfig>);
|
|
34
|
+
/**
|
|
35
|
+
* Start the local compute agent
|
|
36
|
+
*/
|
|
37
|
+
start(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Stop the agent gracefully
|
|
40
|
+
*/
|
|
41
|
+
stop(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Submit a job for execution
|
|
44
|
+
*/
|
|
45
|
+
submitJob(job: Omit<LocalComputeJob, 'id' | 'status' | 'submittedAt' | 'logs'>): Promise<LocalComputeJob>;
|
|
46
|
+
/**
|
|
47
|
+
* Get job by ID
|
|
48
|
+
*/
|
|
49
|
+
getJob(jobId: string): LocalComputeJob | null;
|
|
50
|
+
/**
|
|
51
|
+
* List all jobs
|
|
52
|
+
*/
|
|
53
|
+
listJobs(options?: {
|
|
54
|
+
status?: JobStatus;
|
|
55
|
+
limit?: number;
|
|
56
|
+
}): LocalComputeJob[];
|
|
57
|
+
/**
|
|
58
|
+
* Cancel a job
|
|
59
|
+
*/
|
|
60
|
+
cancelJob(jobId: string): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Get job logs
|
|
63
|
+
*/
|
|
64
|
+
getJobLogs(jobId: string, tail?: number): string[];
|
|
65
|
+
/**
|
|
66
|
+
* Get agent status for local CLI display
|
|
67
|
+
*/
|
|
68
|
+
getStatus(): Promise<LocalAgentStatus>;
|
|
69
|
+
/**
|
|
70
|
+
* Get full agent status for HPC Gateway
|
|
71
|
+
*/
|
|
72
|
+
getFullStatus(): ComputeAgentStatus;
|
|
73
|
+
/**
|
|
74
|
+
* Start agent as a background daemon
|
|
75
|
+
*/
|
|
76
|
+
startDaemon(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Check if another agent is already running
|
|
79
|
+
*/
|
|
80
|
+
private isAnotherAgentRunning;
|
|
81
|
+
/**
|
|
82
|
+
* Start local API server
|
|
83
|
+
*/
|
|
84
|
+
private startLocalServer;
|
|
85
|
+
/**
|
|
86
|
+
* Connect to HPC Gateway
|
|
87
|
+
*/
|
|
88
|
+
private connectToGateway;
|
|
89
|
+
/**
|
|
90
|
+
* Schedule reconnection attempt
|
|
91
|
+
*/
|
|
92
|
+
private scheduleReconnect;
|
|
93
|
+
/**
|
|
94
|
+
* Start heartbeat to gateway
|
|
95
|
+
*/
|
|
96
|
+
private startHeartbeat;
|
|
97
|
+
/**
|
|
98
|
+
* Reset idle timer
|
|
99
|
+
*/
|
|
100
|
+
private resetIdleTimer;
|
|
101
|
+
/**
|
|
102
|
+
* Process job queue
|
|
103
|
+
*/
|
|
104
|
+
private processQueue;
|
|
105
|
+
/**
|
|
106
|
+
* Execute a job
|
|
107
|
+
*/
|
|
108
|
+
private executeJob;
|
|
109
|
+
/**
|
|
110
|
+
* Create a new kernel session
|
|
111
|
+
*/
|
|
112
|
+
createKernel(language?: 'python' | 'r'): Promise<KernelSession>;
|
|
113
|
+
/**
|
|
114
|
+
* Execute code in a kernel
|
|
115
|
+
*/
|
|
116
|
+
executeCode(request: ExecuteRequest): Promise<ExecuteResult>;
|
|
117
|
+
/**
|
|
118
|
+
* Shutdown a kernel
|
|
119
|
+
*/
|
|
120
|
+
shutdownKernel(kernelId: string): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Get kernel session info
|
|
123
|
+
*/
|
|
124
|
+
getKernelSession(kernelId: string): KernelSession | null;
|
|
125
|
+
/**
|
|
126
|
+
* List all active kernels
|
|
127
|
+
*/
|
|
128
|
+
listKernels(): KernelSession[];
|
|
129
|
+
/**
|
|
130
|
+
* Interrupt kernel execution
|
|
131
|
+
*/
|
|
132
|
+
interruptKernel(kernelId: string): boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Shutdown all kernels (called on agent stop)
|
|
135
|
+
*/
|
|
136
|
+
private shutdownAllKernels;
|
|
137
|
+
/**
|
|
138
|
+
* Setup graceful shutdown handlers
|
|
139
|
+
*/
|
|
140
|
+
private setupShutdownHandlers;
|
|
141
|
+
}
|
|
142
|
+
export default LocalComputeAgent;
|
|
143
|
+
//# sourceMappingURL=local-compute-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-compute-agent.d.ts","sourceRoot":"","sources":["../../../../src/commands/compute/lib/local-compute-agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,YAAY,MAAM,eAAe,CAAC;AAMzC,OAAO,KAAK,EACV,kBAAkB,EAElB,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EAEf,SAAS,EAET,aAAa,EAGb,aAAa,EAEb,cAAc,EACd,aAAa,EAEd,MAAM,2BAA2B,CAAC;AASnC,qBAAa,iBAAkB,SAAQ,YAAY,CAAC,aAAa,CAAC;IAChE,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,QAAQ,CAA6B;IAC7C,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC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