@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,505 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Package Verification Script for @adverant-nexus/cli
|
|
5
|
+
*
|
|
6
|
+
* This script verifies that the package can be installed and used correctly
|
|
7
|
+
* by testing it in a clean temporary environment.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { execSync, spawn } from 'child_process';
|
|
11
|
+
import fs from 'fs';
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import os from 'os';
|
|
14
|
+
import { fileURLToPath } from 'url';
|
|
15
|
+
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = path.dirname(__filename);
|
|
18
|
+
const rootDir = path.resolve(__dirname, '..');
|
|
19
|
+
|
|
20
|
+
// ANSI color codes
|
|
21
|
+
const colors = {
|
|
22
|
+
reset: '\x1b[0m',
|
|
23
|
+
red: '\x1b[31m',
|
|
24
|
+
green: '\x1b[32m',
|
|
25
|
+
yellow: '\x1b[33m',
|
|
26
|
+
blue: '\x1b[34m',
|
|
27
|
+
magenta: '\x1b[35m',
|
|
28
|
+
cyan: '\x1b[36m',
|
|
29
|
+
bold: '\x1b[1m',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const icons = {
|
|
33
|
+
success: 'โ',
|
|
34
|
+
error: 'โ',
|
|
35
|
+
warning: 'โ ',
|
|
36
|
+
info: 'โน',
|
|
37
|
+
rocket: '๐',
|
|
38
|
+
package: '๐ฆ',
|
|
39
|
+
test: '๐งช',
|
|
40
|
+
clean: '๐งน',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Print colored output
|
|
45
|
+
*/
|
|
46
|
+
function print(message, color = 'reset', icon = null) {
|
|
47
|
+
const colorCode = colors[color] || colors.reset;
|
|
48
|
+
const iconStr = icon ? `${icon} ` : '';
|
|
49
|
+
console.log(`${colorCode}${iconStr}${message}${colors.reset}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Print section header
|
|
54
|
+
*/
|
|
55
|
+
function printSection(title) {
|
|
56
|
+
console.log('\n' + colors.bold + colors.cyan + `${'='.repeat(60)}` + colors.reset);
|
|
57
|
+
console.log(colors.bold + colors.cyan + title + colors.reset);
|
|
58
|
+
console.log(colors.bold + colors.cyan + `${'='.repeat(60)}` + colors.reset + '\n');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Execute command and return result
|
|
63
|
+
*/
|
|
64
|
+
function execCommand(command, options = {}) {
|
|
65
|
+
try {
|
|
66
|
+
const output = execSync(command, {
|
|
67
|
+
encoding: 'utf8',
|
|
68
|
+
stdio: options.silent ? 'pipe' : 'inherit',
|
|
69
|
+
...options,
|
|
70
|
+
});
|
|
71
|
+
return { success: true, output };
|
|
72
|
+
} catch (error) {
|
|
73
|
+
return {
|
|
74
|
+
success: false,
|
|
75
|
+
error: error.message,
|
|
76
|
+
stderr: error.stderr?.toString(),
|
|
77
|
+
stdout: error.stdout?.toString(),
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Execute command with promise
|
|
84
|
+
*/
|
|
85
|
+
function execCommandAsync(command, options = {}) {
|
|
86
|
+
return new Promise((resolve, reject) => {
|
|
87
|
+
const [cmd, ...args] = command.split(' ');
|
|
88
|
+
const proc = spawn(cmd, args, {
|
|
89
|
+
stdio: options.silent ? 'pipe' : 'inherit',
|
|
90
|
+
shell: true,
|
|
91
|
+
...options,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
let stdout = '';
|
|
95
|
+
let stderr = '';
|
|
96
|
+
|
|
97
|
+
if (proc.stdout) {
|
|
98
|
+
proc.stdout.on('data', (data) => {
|
|
99
|
+
stdout += data.toString();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (proc.stderr) {
|
|
104
|
+
proc.stderr.on('data', (data) => {
|
|
105
|
+
stderr += data.toString();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
proc.on('close', (code) => {
|
|
110
|
+
if (code === 0) {
|
|
111
|
+
resolve({ success: true, stdout, stderr });
|
|
112
|
+
} else {
|
|
113
|
+
resolve({ success: false, code, stdout, stderr });
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
proc.on('error', (error) => {
|
|
118
|
+
reject(error);
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Create temporary test directory
|
|
125
|
+
*/
|
|
126
|
+
function createTempDir() {
|
|
127
|
+
const tmpDir = path.join(os.tmpdir(), `nexus-cli-verify-${Date.now()}`);
|
|
128
|
+
fs.mkdirSync(tmpDir, { recursive: true });
|
|
129
|
+
return tmpDir;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Clean up directory
|
|
134
|
+
*/
|
|
135
|
+
function cleanupDir(dir) {
|
|
136
|
+
if (fs.existsSync(dir)) {
|
|
137
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Read package.json
|
|
143
|
+
*/
|
|
144
|
+
function readPackageJson() {
|
|
145
|
+
const pkgPath = path.resolve(rootDir, 'package.json');
|
|
146
|
+
const content = fs.readFileSync(pkgPath, 'utf8');
|
|
147
|
+
return JSON.parse(content);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Test package installation
|
|
152
|
+
*/
|
|
153
|
+
async function testPackageInstallation(testDir, packagePath) {
|
|
154
|
+
print('Installing package in test environment...', 'cyan', icons.package);
|
|
155
|
+
|
|
156
|
+
// Create a minimal package.json
|
|
157
|
+
const testPkgJson = {
|
|
158
|
+
name: 'nexus-cli-test',
|
|
159
|
+
version: '1.0.0',
|
|
160
|
+
private: true,
|
|
161
|
+
type: 'module',
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
fs.writeFileSync(
|
|
165
|
+
path.join(testDir, 'package.json'),
|
|
166
|
+
JSON.stringify(testPkgJson, null, 2)
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
// Install the package
|
|
170
|
+
const installCmd = `npm install "${packagePath}"`;
|
|
171
|
+
const result = execCommand(installCmd, { cwd: testDir, silent: false });
|
|
172
|
+
|
|
173
|
+
if (!result.success) {
|
|
174
|
+
print('Package installation failed', 'red', icons.error);
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
print('Package installed successfully', 'green', icons.success);
|
|
179
|
+
|
|
180
|
+
// Verify node_modules structure
|
|
181
|
+
const nodeModulesPath = path.join(testDir, 'node_modules', '@adverant-nexus', 'cli');
|
|
182
|
+
if (!fs.existsSync(nodeModulesPath)) {
|
|
183
|
+
print('Package not found in node_modules', 'red', icons.error);
|
|
184
|
+
return false;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
print('Package structure verified in node_modules', 'green', icons.success);
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Test CLI commands
|
|
193
|
+
*/
|
|
194
|
+
async function testCliCommands(testDir) {
|
|
195
|
+
const commands = [
|
|
196
|
+
{ cmd: 'nexus --version', desc: 'Version check', required: true },
|
|
197
|
+
{ cmd: 'nexus --help', desc: 'Help command', required: true },
|
|
198
|
+
{ cmd: 'nexus config --help', desc: 'Config help', required: false },
|
|
199
|
+
{ cmd: 'nexus plugin --help', desc: 'Plugin help', required: false },
|
|
200
|
+
];
|
|
201
|
+
|
|
202
|
+
for (const { cmd, desc, required } of commands) {
|
|
203
|
+
print(`Testing: ${desc}`, 'cyan', icons.test);
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
const result = await execCommandAsync(cmd, {
|
|
207
|
+
cwd: testDir,
|
|
208
|
+
silent: true,
|
|
209
|
+
timeout: 10000,
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
if (result.success || (!required && result.code === 1)) {
|
|
213
|
+
print(` โ ${desc} works`, 'green');
|
|
214
|
+
} else {
|
|
215
|
+
if (required) {
|
|
216
|
+
print(` โ ${desc} failed`, 'red');
|
|
217
|
+
if (result.stderr) {
|
|
218
|
+
console.log(colors.red + ` Error: ${result.stderr}` + colors.reset);
|
|
219
|
+
}
|
|
220
|
+
return false;
|
|
221
|
+
} else {
|
|
222
|
+
print(` โ ${desc} failed (optional)`, 'yellow');
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
} catch (error) {
|
|
226
|
+
if (required) {
|
|
227
|
+
print(` โ ${desc} failed with exception`, 'red');
|
|
228
|
+
console.error(error);
|
|
229
|
+
return false;
|
|
230
|
+
} else {
|
|
231
|
+
print(` โ ${desc} failed (optional)`, 'yellow');
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Test package imports
|
|
241
|
+
*/
|
|
242
|
+
async function testPackageImports(testDir) {
|
|
243
|
+
print('Testing package imports...', 'cyan', icons.test);
|
|
244
|
+
|
|
245
|
+
const testFile = path.join(testDir, 'test-import.mjs');
|
|
246
|
+
const testCode = `
|
|
247
|
+
import pkg from '@adverant-nexus/cli';
|
|
248
|
+
|
|
249
|
+
console.log('Import successful');
|
|
250
|
+
console.log('Package exports:', Object.keys(pkg || {}));
|
|
251
|
+
process.exit(0);
|
|
252
|
+
`;
|
|
253
|
+
|
|
254
|
+
fs.writeFileSync(testFile, testCode);
|
|
255
|
+
|
|
256
|
+
try {
|
|
257
|
+
const result = await execCommandAsync(`node ${testFile}`, {
|
|
258
|
+
cwd: testDir,
|
|
259
|
+
silent: true,
|
|
260
|
+
timeout: 5000,
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
if (result.success) {
|
|
264
|
+
print('Package imports work correctly', 'green', icons.success);
|
|
265
|
+
return true;
|
|
266
|
+
} else {
|
|
267
|
+
print('Package import test failed', 'red', icons.error);
|
|
268
|
+
if (result.stderr) {
|
|
269
|
+
console.log(colors.red + ` Error: ${result.stderr}` + colors.reset);
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
}
|
|
273
|
+
} catch (error) {
|
|
274
|
+
print('Package import test failed with exception', 'red', icons.error);
|
|
275
|
+
console.error(error);
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Verify package contents
|
|
282
|
+
*/
|
|
283
|
+
function verifyPackageContents(testDir) {
|
|
284
|
+
print('Verifying package contents...', 'cyan', icons.test);
|
|
285
|
+
|
|
286
|
+
const pkgDir = path.join(testDir, 'node_modules', '@adverant-nexus', 'cli');
|
|
287
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf8'));
|
|
288
|
+
|
|
289
|
+
const requiredFiles = [
|
|
290
|
+
'package.json',
|
|
291
|
+
'README.md',
|
|
292
|
+
'dist/index.js',
|
|
293
|
+
];
|
|
294
|
+
|
|
295
|
+
let allFound = true;
|
|
296
|
+
|
|
297
|
+
for (const file of requiredFiles) {
|
|
298
|
+
const filePath = path.join(pkgDir, file);
|
|
299
|
+
if (fs.existsSync(filePath)) {
|
|
300
|
+
print(` โ ${file}`, 'green');
|
|
301
|
+
} else {
|
|
302
|
+
print(` โ ${file} missing`, 'red');
|
|
303
|
+
allFound = false;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// Check if files field is respected
|
|
308
|
+
if (pkg.files) {
|
|
309
|
+
const filesField = pkg.files;
|
|
310
|
+
print(` Files field includes: ${filesField.join(', ')}`, 'cyan', icons.info);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// Check for unwanted files
|
|
314
|
+
const unwantedPatterns = ['.ts', 'tsconfig.json', '.env', 'src/'];
|
|
315
|
+
const allFiles = getAllFilesRecursive(pkgDir);
|
|
316
|
+
|
|
317
|
+
const unwantedFiles = allFiles.filter(file => {
|
|
318
|
+
const relativePath = path.relative(pkgDir, file);
|
|
319
|
+
return unwantedPatterns.some(pattern => {
|
|
320
|
+
if (pattern.startsWith('.')) {
|
|
321
|
+
return relativePath.includes(pattern) && !relativePath.includes('node_modules');
|
|
322
|
+
}
|
|
323
|
+
return relativePath.includes(pattern);
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
if (unwantedFiles.length > 0) {
|
|
328
|
+
print(' โ Unwanted files found in package:', 'yellow');
|
|
329
|
+
unwantedFiles.slice(0, 5).forEach(file => {
|
|
330
|
+
print(` - ${path.relative(pkgDir, file)}`, 'yellow');
|
|
331
|
+
});
|
|
332
|
+
if (unwantedFiles.length > 5) {
|
|
333
|
+
print(` ... and ${unwantedFiles.length - 5} more`, 'yellow');
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
print(' โ No unwanted files detected', 'green');
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return allFound;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Get all files recursively
|
|
344
|
+
*/
|
|
345
|
+
function getAllFilesRecursive(dir, fileList = []) {
|
|
346
|
+
const files = fs.readdirSync(dir);
|
|
347
|
+
|
|
348
|
+
for (const file of files) {
|
|
349
|
+
const filePath = path.join(dir, file);
|
|
350
|
+
const stat = fs.statSync(filePath);
|
|
351
|
+
|
|
352
|
+
if (stat.isDirectory() && file !== 'node_modules') {
|
|
353
|
+
getAllFilesRecursive(filePath, fileList);
|
|
354
|
+
} else if (stat.isFile()) {
|
|
355
|
+
fileList.push(filePath);
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return fileList;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Check package size
|
|
364
|
+
*/
|
|
365
|
+
function checkPackageSize(packagePath) {
|
|
366
|
+
print('Checking package size...', 'cyan', icons.test);
|
|
367
|
+
|
|
368
|
+
const stat = fs.statSync(packagePath);
|
|
369
|
+
const sizeMB = (stat.size / (1024 * 1024)).toFixed(2);
|
|
370
|
+
|
|
371
|
+
print(` Package size: ${sizeMB} MB`, 'cyan', icons.info);
|
|
372
|
+
|
|
373
|
+
if (stat.size > 10 * 1024 * 1024) { // 10MB
|
|
374
|
+
print(' โ Package is quite large (>10MB)', 'yellow');
|
|
375
|
+
print(' Consider optimizing or excluding unnecessary files', 'yellow');
|
|
376
|
+
} else if (stat.size > 50 * 1024 * 1024) { // 50MB
|
|
377
|
+
print(' โ Package is too large (>50MB)', 'red');
|
|
378
|
+
return false;
|
|
379
|
+
} else {
|
|
380
|
+
print(' โ Package size is reasonable', 'green');
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return true;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/**
|
|
387
|
+
* Main verification function
|
|
388
|
+
*/
|
|
389
|
+
async function runVerification() {
|
|
390
|
+
print('\n' + colors.bold + colors.magenta + '๐งช Package Verification for @adverant-nexus/cli' + colors.reset + '\n');
|
|
391
|
+
|
|
392
|
+
const pkg = readPackageJson();
|
|
393
|
+
print(`Package: ${colors.bold}${pkg.name}@${pkg.version}${colors.reset}\n`);
|
|
394
|
+
|
|
395
|
+
let testDir;
|
|
396
|
+
let packagePath;
|
|
397
|
+
let cleanupNeeded = false;
|
|
398
|
+
|
|
399
|
+
try {
|
|
400
|
+
// Step 1: Build the package
|
|
401
|
+
printSection('1. Building Package');
|
|
402
|
+
print('Running npm pack...', 'cyan', icons.package);
|
|
403
|
+
|
|
404
|
+
const packResult = execCommand('npm pack', { cwd: rootDir, silent: true });
|
|
405
|
+
if (!packResult.success) {
|
|
406
|
+
print('Failed to create package tarball', 'red', icons.error);
|
|
407
|
+
process.exit(1);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// Find the created tarball
|
|
411
|
+
const files = fs.readdirSync(rootDir);
|
|
412
|
+
const tarball = files.find(f => f.endsWith('.tgz'));
|
|
413
|
+
|
|
414
|
+
if (!tarball) {
|
|
415
|
+
print('Package tarball not found', 'red', icons.error);
|
|
416
|
+
process.exit(1);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
packagePath = path.join(rootDir, tarball);
|
|
420
|
+
print(`Package created: ${tarball}`, 'green', icons.success);
|
|
421
|
+
|
|
422
|
+
// Step 2: Check package size
|
|
423
|
+
printSection('2. Package Size Check');
|
|
424
|
+
const sizeOk = checkPackageSize(packagePath);
|
|
425
|
+
if (!sizeOk) {
|
|
426
|
+
print('Package size validation failed', 'red', icons.error);
|
|
427
|
+
// Don't exit, continue with other tests
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Step 3: Create test environment
|
|
431
|
+
printSection('3. Setting Up Test Environment');
|
|
432
|
+
testDir = createTempDir();
|
|
433
|
+
cleanupNeeded = true;
|
|
434
|
+
print(`Test directory: ${testDir}`, 'cyan', icons.info);
|
|
435
|
+
|
|
436
|
+
// Step 4: Test installation
|
|
437
|
+
printSection('4. Testing Package Installation');
|
|
438
|
+
const installOk = await testPackageInstallation(testDir, packagePath);
|
|
439
|
+
if (!installOk) {
|
|
440
|
+
print('Installation test failed', 'red', icons.error);
|
|
441
|
+
process.exit(1);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Step 5: Verify contents
|
|
445
|
+
printSection('5. Verifying Package Contents');
|
|
446
|
+
const contentsOk = verifyPackageContents(testDir);
|
|
447
|
+
if (!contentsOk) {
|
|
448
|
+
print('Contents verification failed', 'red', icons.error);
|
|
449
|
+
process.exit(1);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Step 6: Test imports
|
|
453
|
+
printSection('6. Testing Package Imports');
|
|
454
|
+
const importsOk = await testPackageImports(testDir);
|
|
455
|
+
if (!importsOk) {
|
|
456
|
+
print('Import tests failed', 'red', icons.error);
|
|
457
|
+
// Don't exit, this might be expected for CLI-only packages
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// Step 7: Test CLI commands
|
|
461
|
+
printSection('7. Testing CLI Commands');
|
|
462
|
+
const cliOk = await testCliCommands(testDir);
|
|
463
|
+
if (!cliOk) {
|
|
464
|
+
print('CLI command tests failed', 'red', icons.error);
|
|
465
|
+
process.exit(1);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// Final summary
|
|
469
|
+
printSection('Verification Summary');
|
|
470
|
+
print(colors.bold + colors.green + 'โ
All verification tests passed!' + colors.reset);
|
|
471
|
+
print('\nThe package is ready for publication.', 'green');
|
|
472
|
+
print('\nNext steps:', 'cyan');
|
|
473
|
+
print(' 1. Review the package contents', 'cyan');
|
|
474
|
+
print(' 2. Test in your target environment', 'cyan');
|
|
475
|
+
print(' 3. Publish with: npm publish', 'cyan');
|
|
476
|
+
|
|
477
|
+
} catch (error) {
|
|
478
|
+
print('\n' + colors.bold + colors.red + 'โ Verification failed:' + colors.reset);
|
|
479
|
+
console.error(error);
|
|
480
|
+
process.exit(1);
|
|
481
|
+
} finally {
|
|
482
|
+
// Cleanup
|
|
483
|
+
if (cleanupNeeded) {
|
|
484
|
+
printSection('Cleanup');
|
|
485
|
+
print('Cleaning up test environment...', 'cyan', icons.clean);
|
|
486
|
+
|
|
487
|
+
if (testDir) {
|
|
488
|
+
cleanupDir(testDir);
|
|
489
|
+
print(`Removed test directory: ${testDir}`, 'green', icons.success);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
if (packagePath && fs.existsSync(packagePath)) {
|
|
493
|
+
fs.unlinkSync(packagePath);
|
|
494
|
+
print(`Removed package tarball: ${path.basename(packagePath)}`, 'green', icons.success);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// Run verification
|
|
501
|
+
runVerification().catch(error => {
|
|
502
|
+
print('\n' + colors.bold + colors.red + 'โ Verification script failed:' + colors.reset);
|
|
503
|
+
console.error(error);
|
|
504
|
+
process.exit(1);
|
|
505
|
+
});
|