@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,260 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin SDK
|
|
3
|
+
*
|
|
4
|
+
* API for plugin developers to create Nexus plugins
|
|
5
|
+
*/
|
|
6
|
+
import { createPluginStorage } from './plugin-storage.js';
|
|
7
|
+
/**
|
|
8
|
+
* Plugin Builder - Fluent API for creating plugins
|
|
9
|
+
*/
|
|
10
|
+
export class PluginBuilder {
|
|
11
|
+
plugin;
|
|
12
|
+
commands = [];
|
|
13
|
+
permissions = [];
|
|
14
|
+
dependencies = [];
|
|
15
|
+
hooks = {};
|
|
16
|
+
mcpConfig;
|
|
17
|
+
constructor(name) {
|
|
18
|
+
this.plugin = {
|
|
19
|
+
name,
|
|
20
|
+
version: '1.0.0',
|
|
21
|
+
description: '',
|
|
22
|
+
author: '',
|
|
23
|
+
main: 'dist/index.js',
|
|
24
|
+
commands: [],
|
|
25
|
+
dependencies: [],
|
|
26
|
+
permissions: [],
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Create new plugin builder
|
|
31
|
+
*/
|
|
32
|
+
static create(name) {
|
|
33
|
+
return new PluginBuilder(name);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Set plugin version
|
|
37
|
+
*/
|
|
38
|
+
version(version) {
|
|
39
|
+
this.plugin.version = version;
|
|
40
|
+
return this;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Set plugin description
|
|
44
|
+
*/
|
|
45
|
+
description(description) {
|
|
46
|
+
this.plugin.description = description;
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Set plugin author
|
|
51
|
+
*/
|
|
52
|
+
author(author) {
|
|
53
|
+
this.plugin.author = author;
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Set plugin homepage
|
|
58
|
+
*/
|
|
59
|
+
homepage(homepage) {
|
|
60
|
+
this.plugin.homepage = homepage;
|
|
61
|
+
return this;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Set plugin repository
|
|
65
|
+
*/
|
|
66
|
+
repository(repository) {
|
|
67
|
+
this.plugin.repository = repository;
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Set main entry file
|
|
72
|
+
*/
|
|
73
|
+
main(main) {
|
|
74
|
+
this.plugin.main = main;
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Add command to plugin
|
|
79
|
+
*/
|
|
80
|
+
command(name, config) {
|
|
81
|
+
this.commands.push({
|
|
82
|
+
name,
|
|
83
|
+
description: config.description,
|
|
84
|
+
args: config.args,
|
|
85
|
+
options: config.options,
|
|
86
|
+
handler: config.handler,
|
|
87
|
+
examples: config.examples,
|
|
88
|
+
});
|
|
89
|
+
return this;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Add onLoad lifecycle hook
|
|
93
|
+
*/
|
|
94
|
+
onLoad(handler) {
|
|
95
|
+
this.hooks.onLoad = handler;
|
|
96
|
+
return this;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Add onUnload lifecycle hook
|
|
100
|
+
*/
|
|
101
|
+
onUnload(handler) {
|
|
102
|
+
this.hooks.onUnload = handler;
|
|
103
|
+
return this;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Add onEnable lifecycle hook
|
|
107
|
+
*/
|
|
108
|
+
onEnable(handler) {
|
|
109
|
+
this.hooks.onEnable = handler;
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Add onDisable lifecycle hook
|
|
114
|
+
*/
|
|
115
|
+
onDisable(handler) {
|
|
116
|
+
this.hooks.onDisable = handler;
|
|
117
|
+
return this;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Add permission to plugin
|
|
121
|
+
*/
|
|
122
|
+
permission(permission) {
|
|
123
|
+
// Convert PluginPermission object to string format if needed
|
|
124
|
+
const permStr = typeof permission === 'string'
|
|
125
|
+
? permission
|
|
126
|
+
: `${permission.type}:${permission.level}`;
|
|
127
|
+
this.permissions.push(permStr);
|
|
128
|
+
return this;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Add service dependency
|
|
132
|
+
*/
|
|
133
|
+
dependency(service) {
|
|
134
|
+
if (!this.dependencies.includes(service)) {
|
|
135
|
+
this.dependencies.push(service);
|
|
136
|
+
}
|
|
137
|
+
return this;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Configure MCP server
|
|
141
|
+
*/
|
|
142
|
+
mcp(config) {
|
|
143
|
+
this.mcpConfig = config;
|
|
144
|
+
return this;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build plugin
|
|
148
|
+
*/
|
|
149
|
+
build() {
|
|
150
|
+
if (!this.plugin.name) {
|
|
151
|
+
throw new Error('Plugin name is required');
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
name: this.plugin.name,
|
|
155
|
+
version: this.plugin.version,
|
|
156
|
+
description: this.plugin.description,
|
|
157
|
+
author: this.plugin.author,
|
|
158
|
+
homepage: this.plugin.homepage,
|
|
159
|
+
repository: this.plugin.repository,
|
|
160
|
+
main: this.plugin.main,
|
|
161
|
+
commands: this.commands,
|
|
162
|
+
dependencies: this.dependencies.length > 0 ? this.dependencies : undefined,
|
|
163
|
+
permissions: this.permissions.length > 0 ? this.permissions : undefined,
|
|
164
|
+
onLoad: this.hooks.onLoad,
|
|
165
|
+
onUnload: this.hooks.onUnload,
|
|
166
|
+
onEnable: this.hooks.onEnable,
|
|
167
|
+
onDisable: this.hooks.onDisable,
|
|
168
|
+
mcp: this.mcpConfig,
|
|
169
|
+
enabled: false,
|
|
170
|
+
installed: false,
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Create plugin logger
|
|
176
|
+
*/
|
|
177
|
+
export function createPluginLogger(pluginName) {
|
|
178
|
+
const prefix = `[${pluginName}]`;
|
|
179
|
+
return {
|
|
180
|
+
info(message, ...args) {
|
|
181
|
+
console.log(prefix, message, ...args);
|
|
182
|
+
},
|
|
183
|
+
warn(message, ...args) {
|
|
184
|
+
console.warn(prefix, message, ...args);
|
|
185
|
+
},
|
|
186
|
+
error(message, ...args) {
|
|
187
|
+
console.error(prefix, message, ...args);
|
|
188
|
+
},
|
|
189
|
+
debug(message, ...args) {
|
|
190
|
+
if (process.env.DEBUG || process.env.NEXUS_DEBUG) {
|
|
191
|
+
console.debug(prefix, message, ...args);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Create plugin context
|
|
198
|
+
*/
|
|
199
|
+
export function createPluginContext(pluginName, services, transport) {
|
|
200
|
+
return {
|
|
201
|
+
config: {},
|
|
202
|
+
workspace: undefined,
|
|
203
|
+
services: services || new Map(),
|
|
204
|
+
transport: transport || {},
|
|
205
|
+
logger: createPluginLogger(pluginName),
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Helper to create file permission
|
|
210
|
+
*/
|
|
211
|
+
export function filePermission(scope, level = 'read') {
|
|
212
|
+
return { type: 'file', scope, level };
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Helper to create network permission
|
|
216
|
+
*/
|
|
217
|
+
export function networkPermission(scope, level = 'read') {
|
|
218
|
+
return { type: 'network', scope, level };
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Helper to create service permission
|
|
222
|
+
*/
|
|
223
|
+
export function servicePermission(scope, level = 'read') {
|
|
224
|
+
return { type: 'service', scope, level };
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Helper to create system permission
|
|
228
|
+
*/
|
|
229
|
+
export function systemPermission(scope, level = 'read') {
|
|
230
|
+
return { type: 'system', scope, level };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Helper to create plugin argument
|
|
234
|
+
*/
|
|
235
|
+
export function arg(name, config) {
|
|
236
|
+
return {
|
|
237
|
+
name,
|
|
238
|
+
description: config.description,
|
|
239
|
+
required: config.required ?? false,
|
|
240
|
+
type: config.type ?? 'string',
|
|
241
|
+
default: config.default,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Helper to create plugin option
|
|
246
|
+
*/
|
|
247
|
+
export function option(long, config) {
|
|
248
|
+
return {
|
|
249
|
+
short: config.short,
|
|
250
|
+
long,
|
|
251
|
+
description: config.description,
|
|
252
|
+
type: config.type ?? 'boolean',
|
|
253
|
+
default: config.default,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Export all SDK components
|
|
258
|
+
*/
|
|
259
|
+
export { createPluginStorage, };
|
|
260
|
+
//# sourceMappingURL=plugin-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-sdk.js","sourceRoot":"","sources":["../../src/plugins/plugin-sdk.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,OAAO,EAAE,mBAAmB,EAAsB,MAAM,qBAAqB,CAAC;AAE9E;;GAEG;AACH,MAAM,OAAO,aAAa;IAChB,MAAM,CAAkB;IACxB,QAAQ,GAAoB,EAAE,CAAC;IAC/B,WAAW,GAAa,EAAE,CAAC;IAC3B,YAAY,GAAa,EAAE,CAAC;IAC5B,KAAK,GAKT,EAAE,CAAC;IACC,SAAS,CAAmB;IAEpC,YAAoB,IAAY;QAC9B,IAAI,CAAC,MAAM,GAAG;YACZ,IAAI;YACJ,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,EAAE;YACf,MAAM,EAAE,EAAE;YACV,IAAI,EAAE,eAAe;YACrB,QAAQ,EAAE,EAAE;YACZ,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,EAAE;SAChB,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,IAAY;QACxB,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAe;QACrB,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;QAC9B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,WAAmB;QAC7B,IAAI,CAAC,MAAM,CAAC,WAAW,GAAG,WAAW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,MAAM,CAAC,QAAQ,IAAI,KAAK;QAClC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,QAAQ;QAC7B,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CACpB,IAAY,EACZ,MAKC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,IAAI;QACJ,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,SAAS;QAC9B,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,OAAO,EAWL,mBAAmB,GACpB,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Storage
|
|
3
|
+
*
|
|
4
|
+
* Provides persistent storage for plugins
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get the Nexus home directory
|
|
8
|
+
*/
|
|
9
|
+
export declare function getNexusHome(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Plugin Storage Class
|
|
12
|
+
*
|
|
13
|
+
* Each plugin gets its own isolated storage directory
|
|
14
|
+
*/
|
|
15
|
+
export declare class PluginStorage {
|
|
16
|
+
private pluginName;
|
|
17
|
+
private storagePath;
|
|
18
|
+
private data;
|
|
19
|
+
constructor(pluginName: string);
|
|
20
|
+
/**
|
|
21
|
+
* Initialize storage directory
|
|
22
|
+
*/
|
|
23
|
+
initialize(): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Get value by key
|
|
26
|
+
*/
|
|
27
|
+
get<T = any>(key: string): T | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Set value by key
|
|
30
|
+
*/
|
|
31
|
+
set<T = any>(key: string, value: T): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Check if key exists
|
|
34
|
+
*/
|
|
35
|
+
has(key: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Delete value by key
|
|
38
|
+
*/
|
|
39
|
+
delete(key: string): Promise<boolean>;
|
|
40
|
+
/**
|
|
41
|
+
* Get all keys
|
|
42
|
+
*/
|
|
43
|
+
keys(): string[];
|
|
44
|
+
/**
|
|
45
|
+
* Get all values
|
|
46
|
+
*/
|
|
47
|
+
values(): any[];
|
|
48
|
+
/**
|
|
49
|
+
* Get all entries
|
|
50
|
+
*/
|
|
51
|
+
entries(): [string, any][];
|
|
52
|
+
/**
|
|
53
|
+
* Clear all data
|
|
54
|
+
*/
|
|
55
|
+
clear(): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Get storage size (number of keys)
|
|
58
|
+
*/
|
|
59
|
+
size(): number;
|
|
60
|
+
/**
|
|
61
|
+
* Load data from disk
|
|
62
|
+
*/
|
|
63
|
+
private loadFromDisk;
|
|
64
|
+
/**
|
|
65
|
+
* Persist data to disk
|
|
66
|
+
*/
|
|
67
|
+
private persistToDisk;
|
|
68
|
+
/**
|
|
69
|
+
* Get file storage path for plugin
|
|
70
|
+
*/
|
|
71
|
+
getFilePath(filename: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* Write file to plugin storage
|
|
74
|
+
*/
|
|
75
|
+
writeFile(filename: string, content: string | Buffer): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Read file from plugin storage
|
|
78
|
+
*/
|
|
79
|
+
readFile(filename: string): Promise<string>;
|
|
80
|
+
/**
|
|
81
|
+
* Check if file exists in plugin storage
|
|
82
|
+
*/
|
|
83
|
+
fileExists(filename: string): Promise<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Delete file from plugin storage
|
|
86
|
+
*/
|
|
87
|
+
deleteFile(filename: string): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* List files in plugin storage
|
|
90
|
+
*/
|
|
91
|
+
listFiles(): Promise<string[]>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Create plugin storage instance
|
|
95
|
+
*/
|
|
96
|
+
export declare function createPluginStorage(pluginName: string): PluginStorage;
|
|
97
|
+
/**
|
|
98
|
+
* Get plugins directory
|
|
99
|
+
*/
|
|
100
|
+
export declare function getPluginsDirectory(): string;
|
|
101
|
+
/**
|
|
102
|
+
* Get plugin data directory
|
|
103
|
+
*/
|
|
104
|
+
export declare function getPluginDataDirectory(pluginName: string): string;
|
|
105
|
+
/**
|
|
106
|
+
* Ensure Nexus directories exist
|
|
107
|
+
*/
|
|
108
|
+
export declare function ensureNexusDirectories(): Promise<void>;
|
|
109
|
+
//# sourceMappingURL=plugin-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-storage.d.ts","sourceRoot":"","sources":["../../src/plugins/plugin-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;;;GAIG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,IAAI,CAAmB;gBAEnB,UAAU,EAAE,MAAM;IAM9B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAWjC;;OAEG;IACH,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAIxC;;OAEG;IACG,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAKxD;;OAEG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIzB;;OAEG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAM3C;;OAEG;IACH,IAAI,IAAI,MAAM,EAAE;IAIhB;;OAEG;IACH,MAAM,IAAI,GAAG,EAAE;IAIf;;OAEG;IACH,OAAO,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;IAI1B;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B;;OAEG;IACH,IAAI,IAAI,MAAM;IAId;;OAEG;YACW,YAAY;IAkB1B;;OAEG;YACW,aAAa;IAY3B;;OAEG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIrC;;OAEG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1E;;OAEG;IACG,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKjD;;OAEG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD;;OAEG;IACG,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjD;;OAEG;IACG,SAAS,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAIrC;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,CAErE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC,CAU5D"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Storage
|
|
3
|
+
*
|
|
4
|
+
* Provides persistent storage for plugins
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'fs-extra';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
import os from 'os';
|
|
9
|
+
import { logger } from '../utils/logger.js';
|
|
10
|
+
/**
|
|
11
|
+
* Get the Nexus home directory
|
|
12
|
+
*/
|
|
13
|
+
export function getNexusHome() {
|
|
14
|
+
return process.env.NEXUS_HOME || path.join(os.homedir(), '.nexus');
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Plugin Storage Class
|
|
18
|
+
*
|
|
19
|
+
* Each plugin gets its own isolated storage directory
|
|
20
|
+
*/
|
|
21
|
+
export class PluginStorage {
|
|
22
|
+
pluginName;
|
|
23
|
+
storagePath;
|
|
24
|
+
data;
|
|
25
|
+
constructor(pluginName) {
|
|
26
|
+
this.pluginName = pluginName;
|
|
27
|
+
this.storagePath = path.join(getNexusHome(), 'plugin-data', pluginName);
|
|
28
|
+
this.data = new Map();
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Initialize storage directory
|
|
32
|
+
*/
|
|
33
|
+
async initialize() {
|
|
34
|
+
try {
|
|
35
|
+
await fs.ensureDir(this.storagePath);
|
|
36
|
+
await this.loadFromDisk();
|
|
37
|
+
logger.debug(`Plugin storage initialized for: ${this.pluginName}`);
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
logger.error(`Failed to initialize plugin storage for ${this.pluginName}:`, error);
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get value by key
|
|
46
|
+
*/
|
|
47
|
+
get(key) {
|
|
48
|
+
return this.data.get(key);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Set value by key
|
|
52
|
+
*/
|
|
53
|
+
async set(key, value) {
|
|
54
|
+
this.data.set(key, value);
|
|
55
|
+
await this.persistToDisk();
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Check if key exists
|
|
59
|
+
*/
|
|
60
|
+
has(key) {
|
|
61
|
+
return this.data.has(key);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Delete value by key
|
|
65
|
+
*/
|
|
66
|
+
async delete(key) {
|
|
67
|
+
const result = this.data.delete(key);
|
|
68
|
+
await this.persistToDisk();
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get all keys
|
|
73
|
+
*/
|
|
74
|
+
keys() {
|
|
75
|
+
return Array.from(this.data.keys());
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get all values
|
|
79
|
+
*/
|
|
80
|
+
values() {
|
|
81
|
+
return Array.from(this.data.values());
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Get all entries
|
|
85
|
+
*/
|
|
86
|
+
entries() {
|
|
87
|
+
return Array.from(this.data.entries());
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Clear all data
|
|
91
|
+
*/
|
|
92
|
+
async clear() {
|
|
93
|
+
this.data.clear();
|
|
94
|
+
await this.persistToDisk();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get storage size (number of keys)
|
|
98
|
+
*/
|
|
99
|
+
size() {
|
|
100
|
+
return this.data.size;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Load data from disk
|
|
104
|
+
*/
|
|
105
|
+
async loadFromDisk() {
|
|
106
|
+
const dataFile = path.join(this.storagePath, 'storage.json');
|
|
107
|
+
try {
|
|
108
|
+
if (await fs.pathExists(dataFile)) {
|
|
109
|
+
const content = await fs.readFile(dataFile, 'utf-8');
|
|
110
|
+
const parsed = JSON.parse(content);
|
|
111
|
+
this.data = new Map(Object.entries(parsed));
|
|
112
|
+
logger.debug(`Loaded ${this.data.size} entries for plugin: ${this.pluginName}`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
logger.warn(`Failed to load storage for plugin ${this.pluginName}:`, error);
|
|
117
|
+
// Don't throw - start with empty storage
|
|
118
|
+
this.data = new Map();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Persist data to disk
|
|
123
|
+
*/
|
|
124
|
+
async persistToDisk() {
|
|
125
|
+
const dataFile = path.join(this.storagePath, 'storage.json');
|
|
126
|
+
try {
|
|
127
|
+
const obj = Object.fromEntries(this.data.entries());
|
|
128
|
+
await fs.writeFile(dataFile, JSON.stringify(obj, null, 2), 'utf-8');
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
logger.error(`Failed to persist storage for plugin ${this.pluginName}:`, error);
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Get file storage path for plugin
|
|
137
|
+
*/
|
|
138
|
+
getFilePath(filename) {
|
|
139
|
+
return path.join(this.storagePath, filename);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Write file to plugin storage
|
|
143
|
+
*/
|
|
144
|
+
async writeFile(filename, content) {
|
|
145
|
+
const filePath = this.getFilePath(filename);
|
|
146
|
+
await fs.writeFile(filePath, content);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Read file from plugin storage
|
|
150
|
+
*/
|
|
151
|
+
async readFile(filename) {
|
|
152
|
+
const filePath = this.getFilePath(filename);
|
|
153
|
+
return fs.readFile(filePath, 'utf-8');
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Check if file exists in plugin storage
|
|
157
|
+
*/
|
|
158
|
+
async fileExists(filename) {
|
|
159
|
+
const filePath = this.getFilePath(filename);
|
|
160
|
+
return fs.pathExists(filePath);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Delete file from plugin storage
|
|
164
|
+
*/
|
|
165
|
+
async deleteFile(filename) {
|
|
166
|
+
const filePath = this.getFilePath(filename);
|
|
167
|
+
await fs.remove(filePath);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* List files in plugin storage
|
|
171
|
+
*/
|
|
172
|
+
async listFiles() {
|
|
173
|
+
const files = await fs.readdir(this.storagePath);
|
|
174
|
+
return files.filter((file) => file !== 'storage.json');
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Create plugin storage instance
|
|
179
|
+
*/
|
|
180
|
+
export function createPluginStorage(pluginName) {
|
|
181
|
+
return new PluginStorage(pluginName);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Get plugins directory
|
|
185
|
+
*/
|
|
186
|
+
export function getPluginsDirectory() {
|
|
187
|
+
return path.join(getNexusHome(), 'plugins');
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Get plugin data directory
|
|
191
|
+
*/
|
|
192
|
+
export function getPluginDataDirectory(pluginName) {
|
|
193
|
+
return path.join(getNexusHome(), 'plugin-data', pluginName);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Ensure Nexus directories exist
|
|
197
|
+
*/
|
|
198
|
+
export async function ensureNexusDirectories() {
|
|
199
|
+
const nexusHome = getNexusHome();
|
|
200
|
+
const pluginsDir = getPluginsDirectory();
|
|
201
|
+
const pluginDataDir = path.join(nexusHome, 'plugin-data');
|
|
202
|
+
await fs.ensureDir(nexusHome);
|
|
203
|
+
await fs.ensureDir(pluginsDir);
|
|
204
|
+
await fs.ensureDir(pluginDataDir);
|
|
205
|
+
logger.debug(`Nexus directories initialized at: ${nexusHome}`);
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=plugin-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-storage.js","sourceRoot":"","sources":["../../src/plugins/plugin-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO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GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,UAAU,GAAG,mBAAmB,EAAE,CAAC;IACzC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAE1D,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAC9B,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC/B,MAAM,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IAElC,MAAM,CAAC,KAAK,CAAC,qCAAqC,SAAS,EAAE,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Validator
|
|
3
|
+
*
|
|
4
|
+
* Validates plugin manifests, structure, permissions, and dependencies
|
|
5
|
+
*/
|
|
6
|
+
import type { Plugin, PluginManifest, PluginCommandDef } from '../types/plugin.js';
|
|
7
|
+
/**
|
|
8
|
+
* Validation result
|
|
9
|
+
*/
|
|
10
|
+
export interface ValidationResult {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
errors: string[];
|
|
13
|
+
warnings: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Plugin Validator Class
|
|
17
|
+
*/
|
|
18
|
+
export declare class PluginValidator {
|
|
19
|
+
/**
|
|
20
|
+
* Validate complete plugin
|
|
21
|
+
*/
|
|
22
|
+
validatePlugin(plugin: Plugin): ValidationResult;
|
|
23
|
+
/**
|
|
24
|
+
* Validate plugin manifest
|
|
25
|
+
*/
|
|
26
|
+
validateManifest(manifest: PluginManifest): ValidationResult;
|
|
27
|
+
/**
|
|
28
|
+
* Validate permissions
|
|
29
|
+
*/
|
|
30
|
+
validatePermissions(permissions: string[]): ValidationResult;
|
|
31
|
+
/**
|
|
32
|
+
* Check plugin dependencies are available
|
|
33
|
+
*/
|
|
34
|
+
checkDependencies(plugin: Plugin): ValidationResult;
|
|
35
|
+
/**
|
|
36
|
+
* Validate plugin command definition
|
|
37
|
+
*/
|
|
38
|
+
validateCommand(command: PluginCommandDef): ValidationResult;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Singleton instance
|
|
42
|
+
*/
|
|
43
|
+
export declare const pluginValidator: PluginValidator;
|
|
44
|
+
//# sourceMappingURL=plugin-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-validator.d.ts","sourceRoot":"","sources":["../../src/plugins/plugin-validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,MAAM,EACN,cAAc,EAEd,gBAAgB,EAGjB,MAAM,oBAAoB,CAAC;AAG5B;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAgED;;GAEG;AACH,qBAAa,eAAe;IAC1B;;OAEG;IACH,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB;IAkDhD;;OAEG;IACH,gBAAgB,CAAC,QAAQ,EAAE,cAAc,GAAG,gBAAgB;IAmD5D;;OAEG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,gBAAgB;IA2C5D;;OAEG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB;IAwCnD;;OAEG;IACH,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,gBAAgB;CA0C7D;AAED;;GAEG;AACH,eAAO,MAAM,eAAe,iBAAwB,CAAC"}
|