@amodalai/amodal 0.1.2
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/CHANGELOG.md +21 -0
- package/LICENSE +21 -0
- package/README.md +42 -0
- package/dist/src/auth/index.d.ts +13 -0
- package/dist/src/auth/index.d.ts.map +1 -0
- package/dist/src/auth/index.js +10 -0
- package/dist/src/auth/index.js.map +1 -0
- package/dist/src/auth/oauth2.d.ts +51 -0
- package/dist/src/auth/oauth2.d.ts.map +1 -0
- package/dist/src/auth/oauth2.js +196 -0
- package/dist/src/auth/oauth2.js.map +1 -0
- package/dist/src/auth/prompt.d.ts +21 -0
- package/dist/src/auth/prompt.d.ts.map +1 -0
- package/dist/src/auth/prompt.js +81 -0
- package/dist/src/auth/prompt.js.map +1 -0
- package/dist/src/auth/test-connection.d.ts +27 -0
- package/dist/src/auth/test-connection.d.ts.map +1 -0
- package/dist/src/auth/test-connection.js +153 -0
- package/dist/src/auth/test-connection.js.map +1 -0
- package/dist/src/auth/types.d.ts +32 -0
- package/dist/src/auth/types.d.ts.map +1 -0
- package/dist/src/auth/types.js +7 -0
- package/dist/src/auth/types.js.map +1 -0
- package/dist/src/commands/audit.d.ts +18 -0
- package/dist/src/commands/audit.d.ts.map +1 -0
- package/dist/src/commands/audit.js +86 -0
- package/dist/src/commands/audit.js.map +1 -0
- package/dist/src/commands/automations.d.ts +28 -0
- package/dist/src/commands/automations.d.ts.map +1 -0
- package/dist/src/commands/automations.js +179 -0
- package/dist/src/commands/automations.js.map +1 -0
- package/dist/src/commands/build-manifest-types.d.ts +33 -0
- package/dist/src/commands/build-manifest-types.d.ts.map +1 -0
- package/dist/src/commands/build-manifest-types.js +30 -0
- package/dist/src/commands/build-manifest-types.js.map +1 -0
- package/dist/src/commands/build-tools.d.ts +33 -0
- package/dist/src/commands/build-tools.d.ts.map +1 -0
- package/dist/src/commands/build-tools.js +237 -0
- package/dist/src/commands/build-tools.js.map +1 -0
- package/dist/src/commands/build.d.ts +23 -0
- package/dist/src/commands/build.d.ts.map +1 -0
- package/dist/src/commands/build.js +120 -0
- package/dist/src/commands/build.js.map +1 -0
- package/dist/src/commands/chat.d.ts +26 -0
- package/dist/src/commands/chat.d.ts.map +1 -0
- package/dist/src/commands/chat.js +123 -0
- package/dist/src/commands/chat.js.map +1 -0
- package/dist/src/commands/connect.d.ts +18 -0
- package/dist/src/commands/connect.d.ts.map +1 -0
- package/dist/src/commands/connect.js +198 -0
- package/dist/src/commands/connect.js.map +1 -0
- package/dist/src/commands/deploy.d.ts +20 -0
- package/dist/src/commands/deploy.d.ts.map +1 -0
- package/dist/src/commands/deploy.js +137 -0
- package/dist/src/commands/deploy.js.map +1 -0
- package/dist/src/commands/deployments.d.ts +17 -0
- package/dist/src/commands/deployments.d.ts.map +1 -0
- package/dist/src/commands/deployments.js +77 -0
- package/dist/src/commands/deployments.js.map +1 -0
- package/dist/src/commands/dev.d.ts +17 -0
- package/dist/src/commands/dev.d.ts.map +1 -0
- package/dist/src/commands/dev.js +109 -0
- package/dist/src/commands/dev.js.map +1 -0
- package/dist/src/commands/diff.d.ts +19 -0
- package/dist/src/commands/diff.d.ts.map +1 -0
- package/dist/src/commands/diff.js +120 -0
- package/dist/src/commands/diff.js.map +1 -0
- package/dist/src/commands/docker.d.ts +21 -0
- package/dist/src/commands/docker.d.ts.map +1 -0
- package/dist/src/commands/docker.js +215 -0
- package/dist/src/commands/docker.js.map +1 -0
- package/dist/src/commands/eval.d.ts +20 -0
- package/dist/src/commands/eval.d.ts.map +1 -0
- package/dist/src/commands/eval.js +236 -0
- package/dist/src/commands/eval.js.map +1 -0
- package/dist/src/commands/experiment.d.ts +21 -0
- package/dist/src/commands/experiment.d.ts.map +1 -0
- package/dist/src/commands/experiment.js +133 -0
- package/dist/src/commands/experiment.js.map +1 -0
- package/dist/src/commands/index.d.ts +10 -0
- package/dist/src/commands/index.d.ts.map +1 -0
- package/dist/src/commands/index.js +75 -0
- package/dist/src/commands/index.js.map +1 -0
- package/dist/src/commands/init.d.ts +17 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +73 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/inspect.d.ts +22 -0
- package/dist/src/commands/inspect.d.ts.map +1 -0
- package/dist/src/commands/inspect.js +131 -0
- package/dist/src/commands/inspect.js.map +1 -0
- package/dist/src/commands/install-pkg.d.ts +29 -0
- package/dist/src/commands/install-pkg.d.ts.map +1 -0
- package/dist/src/commands/install-pkg.js +202 -0
- package/dist/src/commands/install-pkg.js.map +1 -0
- package/dist/src/commands/link.d.ts +32 -0
- package/dist/src/commands/link.d.ts.map +1 -0
- package/dist/src/commands/link.js +227 -0
- package/dist/src/commands/link.js.map +1 -0
- package/dist/src/commands/list.d.ts +19 -0
- package/dist/src/commands/list.d.ts.map +1 -0
- package/dist/src/commands/list.js +78 -0
- package/dist/src/commands/list.js.map +1 -0
- package/dist/src/commands/login.d.ts +31 -0
- package/dist/src/commands/login.d.ts.map +1 -0
- package/dist/src/commands/login.js +205 -0
- package/dist/src/commands/login.js.map +1 -0
- package/dist/src/commands/promote.d.ts +16 -0
- package/dist/src/commands/promote.d.ts.map +1 -0
- package/dist/src/commands/promote.js +55 -0
- package/dist/src/commands/promote.js.map +1 -0
- package/dist/src/commands/publish.d.ts +18 -0
- package/dist/src/commands/publish.d.ts.map +1 -0
- package/dist/src/commands/publish.js +122 -0
- package/dist/src/commands/publish.js.map +1 -0
- package/dist/src/commands/rollback.d.ts +17 -0
- package/dist/src/commands/rollback.d.ts.map +1 -0
- package/dist/src/commands/rollback.js +62 -0
- package/dist/src/commands/rollback.js.map +1 -0
- package/dist/src/commands/search.d.ts +20 -0
- package/dist/src/commands/search.d.ts.map +1 -0
- package/dist/src/commands/search.js +133 -0
- package/dist/src/commands/search.js.map +1 -0
- package/dist/src/commands/secrets.d.ts +20 -0
- package/dist/src/commands/secrets.d.ts.map +1 -0
- package/dist/src/commands/secrets.js +137 -0
- package/dist/src/commands/secrets.js.map +1 -0
- package/dist/src/commands/serve.d.ts +23 -0
- package/dist/src/commands/serve.d.ts.map +1 -0
- package/dist/src/commands/serve.js +144 -0
- package/dist/src/commands/serve.js.map +1 -0
- package/dist/src/commands/status.d.ts +16 -0
- package/dist/src/commands/status.d.ts.map +1 -0
- package/dist/src/commands/status.js +83 -0
- package/dist/src/commands/status.js.map +1 -0
- package/dist/src/commands/sync.d.ts +21 -0
- package/dist/src/commands/sync.d.ts.map +1 -0
- package/dist/src/commands/sync.js +94 -0
- package/dist/src/commands/sync.js.map +1 -0
- package/dist/src/commands/test-query.d.ts +19 -0
- package/dist/src/commands/test-query.d.ts.map +1 -0
- package/dist/src/commands/test-query.js +116 -0
- package/dist/src/commands/test-query.js.map +1 -0
- package/dist/src/commands/uninstall.d.ts +19 -0
- package/dist/src/commands/uninstall.d.ts.map +1 -0
- package/dist/src/commands/uninstall.js +84 -0
- package/dist/src/commands/uninstall.js.map +1 -0
- package/dist/src/commands/update.d.ts +21 -0
- package/dist/src/commands/update.d.ts.map +1 -0
- package/dist/src/commands/update.js +145 -0
- package/dist/src/commands/update.js.map +1 -0
- package/dist/src/commands/validate.d.ts +19 -0
- package/dist/src/commands/validate.d.ts.map +1 -0
- package/dist/src/commands/validate.js +114 -0
- package/dist/src/commands/validate.js.map +1 -0
- package/dist/src/fixtures/incident-response.d.ts +91 -0
- package/dist/src/fixtures/incident-response.d.ts.map +1 -0
- package/dist/src/fixtures/incident-response.js +208 -0
- package/dist/src/fixtures/incident-response.js.map +1 -0
- package/dist/src/main.d.ts +8 -0
- package/dist/src/main.d.ts.map +1 -0
- package/dist/src/main.js +30 -0
- package/dist/src/main.js.map +1 -0
- package/dist/src/shared/platform-client.d.ts +92 -0
- package/dist/src/shared/platform-client.d.ts.map +1 -0
- package/dist/src/shared/platform-client.js +155 -0
- package/dist/src/shared/platform-client.js.map +1 -0
- package/dist/src/shared/repo-discovery.d.ts +11 -0
- package/dist/src/shared/repo-discovery.d.ts.map +1 -0
- package/dist/src/shared/repo-discovery.js +33 -0
- package/dist/src/shared/repo-discovery.js.map +1 -0
- package/dist/src/templates/compose-template.d.ts +10 -0
- package/dist/src/templates/compose-template.d.ts.map +1 -0
- package/dist/src/templates/compose-template.js +30 -0
- package/dist/src/templates/compose-template.js.map +1 -0
- package/dist/src/templates/config-template.d.ts +14 -0
- package/dist/src/templates/config-template.d.ts.map +1 -0
- package/dist/src/templates/config-template.js +35 -0
- package/dist/src/templates/config-template.js.map +1 -0
- package/dist/src/templates/dockerfile-template.d.ts +10 -0
- package/dist/src/templates/dockerfile-template.d.ts.map +1 -0
- package/dist/src/templates/dockerfile-template.js +30 -0
- package/dist/src/templates/dockerfile-template.js.map +1 -0
- package/dist/src/templates/env-template.d.ts +12 -0
- package/dist/src/templates/env-template.d.ts.map +1 -0
- package/dist/src/templates/env-template.js +24 -0
- package/dist/src/templates/env-template.js.map +1 -0
- package/dist/src/templates/knowledge-template.d.ts +10 -0
- package/dist/src/templates/knowledge-template.d.ts.map +1 -0
- package/dist/src/templates/knowledge-template.js +24 -0
- package/dist/src/templates/knowledge-template.js.map +1 -0
- package/dist/src/templates/skill-template.d.ts +10 -0
- package/dist/src/templates/skill-template.d.ts.map +1 -0
- package/dist/src/templates/skill-template.js +27 -0
- package/dist/src/templates/skill-template.js.map +1 -0
- package/dist/src/ui/AskUserPrompt.d.ts +14 -0
- package/dist/src/ui/AskUserPrompt.d.ts.map +1 -0
- package/dist/src/ui/AskUserPrompt.js +17 -0
- package/dist/src/ui/AskUserPrompt.js.map +1 -0
- package/dist/src/ui/AssistantMessage.d.ts +14 -0
- package/dist/src/ui/AssistantMessage.d.ts.map +1 -0
- package/dist/src/ui/AssistantMessage.js +8 -0
- package/dist/src/ui/AssistantMessage.js.map +1 -0
- package/dist/src/ui/ChatApp.d.ts +15 -0
- package/dist/src/ui/ChatApp.d.ts.map +1 -0
- package/dist/src/ui/ChatApp.js +144 -0
- package/dist/src/ui/ChatApp.js.map +1 -0
- package/dist/src/ui/ConfirmationPrompt.d.ts +17 -0
- package/dist/src/ui/ConfirmationPrompt.d.ts.map +1 -0
- package/dist/src/ui/ConfirmationPrompt.js +21 -0
- package/dist/src/ui/ConfirmationPrompt.js.map +1 -0
- package/dist/src/ui/DiffRenderer.d.ts +32 -0
- package/dist/src/ui/DiffRenderer.d.ts.map +1 -0
- package/dist/src/ui/DiffRenderer.js +118 -0
- package/dist/src/ui/DiffRenderer.js.map +1 -0
- package/dist/src/ui/ExpandableContent.d.ts +15 -0
- package/dist/src/ui/ExpandableContent.d.ts.map +1 -0
- package/dist/src/ui/ExpandableContent.js +22 -0
- package/dist/src/ui/ExpandableContent.js.map +1 -0
- package/dist/src/ui/ExploreIndicator.d.ts +13 -0
- package/dist/src/ui/ExploreIndicator.d.ts.map +1 -0
- package/dist/src/ui/ExploreIndicator.js +14 -0
- package/dist/src/ui/ExploreIndicator.js.map +1 -0
- package/dist/src/ui/Footer.d.ts +19 -0
- package/dist/src/ui/Footer.d.ts.map +1 -0
- package/dist/src/ui/Footer.js +57 -0
- package/dist/src/ui/Footer.js.map +1 -0
- package/dist/src/ui/FullScreenLayout.d.ts +18 -0
- package/dist/src/ui/FullScreenLayout.d.ts.map +1 -0
- package/dist/src/ui/FullScreenLayout.js +14 -0
- package/dist/src/ui/FullScreenLayout.js.map +1 -0
- package/dist/src/ui/Header.d.ts +14 -0
- package/dist/src/ui/Header.d.ts.map +1 -0
- package/dist/src/ui/Header.js +11 -0
- package/dist/src/ui/Header.js.map +1 -0
- package/dist/src/ui/InputBar.d.ts +17 -0
- package/dist/src/ui/InputBar.d.ts.map +1 -0
- package/dist/src/ui/InputBar.js +49 -0
- package/dist/src/ui/InputBar.js.map +1 -0
- package/dist/src/ui/MessageList.d.ts +18 -0
- package/dist/src/ui/MessageList.d.ts.map +1 -0
- package/dist/src/ui/MessageList.js +9 -0
- package/dist/src/ui/MessageList.js.map +1 -0
- package/dist/src/ui/NotificationBar.d.ts +14 -0
- package/dist/src/ui/NotificationBar.d.ts.map +1 -0
- package/dist/src/ui/NotificationBar.js +38 -0
- package/dist/src/ui/NotificationBar.js.map +1 -0
- package/dist/src/ui/ScrollableMessageList.d.ts +27 -0
- package/dist/src/ui/ScrollableMessageList.d.ts.map +1 -0
- package/dist/src/ui/ScrollableMessageList.js +16 -0
- package/dist/src/ui/ScrollableMessageList.js.map +1 -0
- package/dist/src/ui/SessionBrowser.d.ts +20 -0
- package/dist/src/ui/SessionBrowser.d.ts.map +1 -0
- package/dist/src/ui/SessionBrowser.js +93 -0
- package/dist/src/ui/SessionBrowser.js.map +1 -0
- package/dist/src/ui/StatusMessage.d.ts +13 -0
- package/dist/src/ui/StatusMessage.d.ts.map +1 -0
- package/dist/src/ui/StatusMessage.js +17 -0
- package/dist/src/ui/StatusMessage.js.map +1 -0
- package/dist/src/ui/StreamingView.d.ts +19 -0
- package/dist/src/ui/StreamingView.d.ts.map +1 -0
- package/dist/src/ui/StreamingView.js +18 -0
- package/dist/src/ui/StreamingView.js.map +1 -0
- package/dist/src/ui/SubagentDisplay.d.ts +13 -0
- package/dist/src/ui/SubagentDisplay.d.ts.map +1 -0
- package/dist/src/ui/SubagentDisplay.js +22 -0
- package/dist/src/ui/SubagentDisplay.js.map +1 -0
- package/dist/src/ui/ThinkingDisplay.d.ts +13 -0
- package/dist/src/ui/ThinkingDisplay.d.ts.map +1 -0
- package/dist/src/ui/ThinkingDisplay.js +15 -0
- package/dist/src/ui/ThinkingDisplay.js.map +1 -0
- package/dist/src/ui/ToolCallDisplay.d.ts +16 -0
- package/dist/src/ui/ToolCallDisplay.d.ts.map +1 -0
- package/dist/src/ui/ToolCallDisplay.js +136 -0
- package/dist/src/ui/ToolCallDisplay.js.map +1 -0
- package/dist/src/ui/UserMessage.d.ts +12 -0
- package/dist/src/ui/UserMessage.d.ts.map +1 -0
- package/dist/src/ui/UserMessage.js +5 -0
- package/dist/src/ui/UserMessage.js.map +1 -0
- package/dist/src/ui/commands/clear.d.ts +7 -0
- package/dist/src/ui/commands/clear.d.ts.map +1 -0
- package/dist/src/ui/commands/clear.js +13 -0
- package/dist/src/ui/commands/clear.js.map +1 -0
- package/dist/src/ui/commands/help.d.ts +7 -0
- package/dist/src/ui/commands/help.d.ts.map +1 -0
- package/dist/src/ui/commands/help.js +26 -0
- package/dist/src/ui/commands/help.js.map +1 -0
- package/dist/src/ui/commands/index.d.ts +14 -0
- package/dist/src/ui/commands/index.d.ts.map +1 -0
- package/dist/src/ui/commands/index.js +15 -0
- package/dist/src/ui/commands/index.js.map +1 -0
- package/dist/src/ui/commands/model.d.ts +7 -0
- package/dist/src/ui/commands/model.d.ts.map +1 -0
- package/dist/src/ui/commands/model.js +16 -0
- package/dist/src/ui/commands/model.js.map +1 -0
- package/dist/src/ui/commands/registry.d.ts +30 -0
- package/dist/src/ui/commands/registry.d.ts.map +1 -0
- package/dist/src/ui/commands/registry.js +45 -0
- package/dist/src/ui/commands/registry.js.map +1 -0
- package/dist/src/ui/commands/sessions.d.ts +7 -0
- package/dist/src/ui/commands/sessions.d.ts.map +1 -0
- package/dist/src/ui/commands/sessions.js +13 -0
- package/dist/src/ui/commands/sessions.js.map +1 -0
- package/dist/src/ui/commands/stats.d.ts +7 -0
- package/dist/src/ui/commands/stats.d.ts.map +1 -0
- package/dist/src/ui/commands/stats.js +33 -0
- package/dist/src/ui/commands/stats.js.map +1 -0
- package/dist/src/ui/commands/theme.d.ts +7 -0
- package/dist/src/ui/commands/theme.d.ts.map +1 -0
- package/dist/src/ui/commands/theme.js +35 -0
- package/dist/src/ui/commands/theme.js.map +1 -0
- package/dist/src/ui/markdown/CodeBlock.d.ts +14 -0
- package/dist/src/ui/markdown/CodeBlock.d.ts.map +1 -0
- package/dist/src/ui/markdown/CodeBlock.js +55 -0
- package/dist/src/ui/markdown/CodeBlock.js.map +1 -0
- package/dist/src/ui/markdown/InlineRenderer.d.ts +12 -0
- package/dist/src/ui/markdown/InlineRenderer.d.ts.map +1 -0
- package/dist/src/ui/markdown/InlineRenderer.js +70 -0
- package/dist/src/ui/markdown/InlineRenderer.js.map +1 -0
- package/dist/src/ui/markdown/MarkdownDisplay.d.ts +17 -0
- package/dist/src/ui/markdown/MarkdownDisplay.d.ts.map +1 -0
- package/dist/src/ui/markdown/MarkdownDisplay.js +142 -0
- package/dist/src/ui/markdown/MarkdownDisplay.js.map +1 -0
- package/dist/src/ui/markdown/Table.d.ts +14 -0
- package/dist/src/ui/markdown/Table.d.ts.map +1 -0
- package/dist/src/ui/markdown/Table.js +31 -0
- package/dist/src/ui/markdown/Table.js.map +1 -0
- package/dist/src/ui/theme.d.ts +39 -0
- package/dist/src/ui/theme.d.ts.map +1 -0
- package/dist/src/ui/theme.js +39 -0
- package/dist/src/ui/theme.js.map +1 -0
- package/dist/src/ui/themes/index.d.ts +45 -0
- package/dist/src/ui/themes/index.d.ts.map +1 -0
- package/dist/src/ui/themes/index.js +73 -0
- package/dist/src/ui/themes/index.js.map +1 -0
- package/dist/src/ui/themes/light.d.ts +8 -0
- package/dist/src/ui/themes/light.d.ts.map +1 -0
- package/dist/src/ui/themes/light.js +37 -0
- package/dist/src/ui/themes/light.js.map +1 -0
- package/dist/src/ui/themes/monochrome.d.ts +8 -0
- package/dist/src/ui/themes/monochrome.d.ts.map +1 -0
- package/dist/src/ui/themes/monochrome.js +37 -0
- package/dist/src/ui/themes/monochrome.js.map +1 -0
- package/dist/src/ui/types.d.ts +191 -0
- package/dist/src/ui/types.d.ts.map +1 -0
- package/dist/src/ui/types.js +7 -0
- package/dist/src/ui/types.js.map +1 -0
- package/dist/src/ui/useAlternateBuffer.d.ts +11 -0
- package/dist/src/ui/useAlternateBuffer.d.ts.map +1 -0
- package/dist/src/ui/useAlternateBuffer.js +25 -0
- package/dist/src/ui/useAlternateBuffer.js.map +1 -0
- package/dist/src/ui/useChat.d.ts +18 -0
- package/dist/src/ui/useChat.d.ts.map +1 -0
- package/dist/src/ui/useChat.js +599 -0
- package/dist/src/ui/useChat.js.map +1 -0
- package/dist/src/ui/useElapsedTime.d.ts +11 -0
- package/dist/src/ui/useElapsedTime.d.ts.map +1 -0
- package/dist/src/ui/useElapsedTime.js +39 -0
- package/dist/src/ui/useElapsedTime.js.map +1 -0
- package/dist/src/ui/useResponsiveLayout.d.ts +16 -0
- package/dist/src/ui/useResponsiveLayout.d.ts.map +1 -0
- package/dist/src/ui/useResponsiveLayout.js +24 -0
- package/dist/src/ui/useResponsiveLayout.js.map +1 -0
- package/dist/src/ui/useScroll.d.ts +20 -0
- package/dist/src/ui/useScroll.d.ts.map +1 -0
- package/dist/src/ui/useScroll.js +64 -0
- package/dist/src/ui/useScroll.js.map +1 -0
- package/dist/src/ui/useSessionResume.d.ts +20 -0
- package/dist/src/ui/useSessionResume.d.ts.map +1 -0
- package/dist/src/ui/useSessionResume.js +77 -0
- package/dist/src/ui/useSessionResume.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +60 -0
- package/src/auth/index.ts +13 -0
- package/src/auth/oauth2.test.ts +305 -0
- package/src/auth/oauth2.ts +269 -0
- package/src/auth/prompt.test.ts +205 -0
- package/src/auth/prompt.ts +111 -0
- package/src/auth/test-connection.test.ts +224 -0
- package/src/auth/test-connection.ts +196 -0
- package/src/auth/types.ts +34 -0
- package/src/commands/audit.test.ts +92 -0
- package/src/commands/audit.ts +113 -0
- package/src/commands/automations.test.ts +85 -0
- package/src/commands/automations.ts +205 -0
- package/src/commands/build-manifest-types.ts +35 -0
- package/src/commands/build-tools.ts +281 -0
- package/src/commands/build.test.ts +63 -0
- package/src/commands/build.ts +135 -0
- package/src/commands/chat.ts +147 -0
- package/src/commands/command-exports.test.ts +88 -0
- package/src/commands/connect.test.ts +343 -0
- package/src/commands/connect.ts +237 -0
- package/src/commands/deploy.test.ts +124 -0
- package/src/commands/deploy.ts +153 -0
- package/src/commands/deployments.ts +90 -0
- package/src/commands/dev.test.ts +63 -0
- package/src/commands/dev.ts +124 -0
- package/src/commands/diff.test.ts +183 -0
- package/src/commands/diff.ts +143 -0
- package/src/commands/docker.ts +232 -0
- package/src/commands/eval.test.ts +88 -0
- package/src/commands/eval.ts +268 -0
- package/src/commands/experiment.test.ts +125 -0
- package/src/commands/experiment.ts +153 -0
- package/src/commands/index.ts +76 -0
- package/src/commands/init.test.ts +109 -0
- package/src/commands/init.ts +98 -0
- package/src/commands/inspect.test.ts +234 -0
- package/src/commands/inspect.ts +157 -0
- package/src/commands/install-pkg.test.ts +265 -0
- package/src/commands/install-pkg.ts +234 -0
- package/src/commands/link.ts +270 -0
- package/src/commands/list.test.ts +152 -0
- package/src/commands/list.ts +95 -0
- package/src/commands/login.test.ts +195 -0
- package/src/commands/login.ts +258 -0
- package/src/commands/promote.ts +64 -0
- package/src/commands/publish.test.ts +203 -0
- package/src/commands/publish.ts +142 -0
- package/src/commands/rollback.ts +72 -0
- package/src/commands/search.test.ts +174 -0
- package/src/commands/search.ts +154 -0
- package/src/commands/secrets.test.ts +168 -0
- package/src/commands/secrets.ts +163 -0
- package/src/commands/serve.ts +166 -0
- package/src/commands/status.ts +94 -0
- package/src/commands/sync.test.ts +130 -0
- package/src/commands/sync.ts +119 -0
- package/src/commands/test-query.test.ts +42 -0
- package/src/commands/test-query.ts +129 -0
- package/src/commands/uninstall.test.ts +162 -0
- package/src/commands/uninstall.ts +107 -0
- package/src/commands/update.test.ts +281 -0
- package/src/commands/update.ts +180 -0
- package/src/commands/validate.test.ts +260 -0
- package/src/commands/validate.ts +139 -0
- package/src/e2e-automations.test.ts +305 -0
- package/src/e2e-commands.test.ts +587 -0
- package/src/e2e-incident-response.test.ts +345 -0
- package/src/e2e-plugin-connections.test.ts +415 -0
- package/src/e2e-plugins.test.ts +492 -0
- package/src/e2e.test.ts +602 -0
- package/src/fixtures/incident-response.ts +232 -0
- package/src/main.ts +35 -0
- package/src/shared/platform-client.test.ts +106 -0
- package/src/shared/platform-client.ts +193 -0
- package/src/shared/repo-discovery.test.ts +56 -0
- package/src/shared/repo-discovery.ts +40 -0
- package/src/templates/compose-template.ts +30 -0
- package/src/templates/config-template.ts +44 -0
- package/src/templates/deployment-templates.test.ts +99 -0
- package/src/templates/dockerfile-template.ts +30 -0
- package/src/templates/env-template.ts +27 -0
- package/src/templates/knowledge-template.ts +24 -0
- package/src/templates/skill-template.ts +27 -0
- package/src/ui/AskUserPrompt.tsx +58 -0
- package/src/ui/AssistantMessage.tsx +51 -0
- package/src/ui/ChatApp.tsx +283 -0
- package/src/ui/ConfirmationPrompt.tsx +75 -0
- package/src/ui/DiffRenderer.test.ts +104 -0
- package/src/ui/DiffRenderer.tsx +188 -0
- package/src/ui/ExpandableContent.tsx +68 -0
- package/src/ui/ExploreIndicator.tsx +44 -0
- package/src/ui/Footer.tsx +87 -0
- package/src/ui/FullScreenLayout.tsx +45 -0
- package/src/ui/Header.tsx +50 -0
- package/src/ui/InputBar.tsx +105 -0
- package/src/ui/MessageList.tsx +31 -0
- package/src/ui/NotificationBar.tsx +64 -0
- package/src/ui/ScrollableMessageList.tsx +82 -0
- package/src/ui/SessionBrowser.test.ts +49 -0
- package/src/ui/SessionBrowser.tsx +179 -0
- package/src/ui/StatusMessage.tsx +35 -0
- package/src/ui/StreamingView.tsx +87 -0
- package/src/ui/SubagentDisplay.tsx +57 -0
- package/src/ui/ThinkingDisplay.tsx +45 -0
- package/src/ui/ToolCallDisplay.tsx +268 -0
- package/src/ui/UserMessage.tsx +22 -0
- package/src/ui/chat-e2e.test.ts +581 -0
- package/src/ui/commands/clear.ts +15 -0
- package/src/ui/commands/help.ts +31 -0
- package/src/ui/commands/index.ts +22 -0
- package/src/ui/commands/model.ts +19 -0
- package/src/ui/commands/registry.test.ts +76 -0
- package/src/ui/commands/registry.ts +66 -0
- package/src/ui/commands/sessions.ts +16 -0
- package/src/ui/commands/stats.ts +35 -0
- package/src/ui/commands/theme.ts +41 -0
- package/src/ui/markdown/CodeBlock.tsx +118 -0
- package/src/ui/markdown/InlineRenderer.tsx +115 -0
- package/src/ui/markdown/MarkdownDisplay.tsx +223 -0
- package/src/ui/markdown/Table.tsx +75 -0
- package/src/ui/theme.ts +39 -0
- package/src/ui/themes/index.ts +113 -0
- package/src/ui/themes/light.ts +39 -0
- package/src/ui/themes/monochrome.ts +39 -0
- package/src/ui/types.ts +157 -0
- package/src/ui/useAlternateBuffer.ts +27 -0
- package/src/ui/useChat.test.ts +492 -0
- package/src/ui/useChat.ts +693 -0
- package/src/ui/useElapsedTime.test.ts +33 -0
- package/src/ui/useElapsedTime.ts +43 -0
- package/src/ui/useResponsiveLayout.test.ts +54 -0
- package/src/ui/useResponsiveLayout.ts +32 -0
- package/src/ui/useScroll.test.ts +99 -0
- package/src/ui/useScroll.ts +97 -0
- package/src/ui/useSessionResume.test.ts +80 -0
- package/src/ui/useSessionResume.ts +102 -0
- package/tsconfig.json +17 -0
- package/vitest.config.ts +20 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { ensureNpmContext, fromNpmName, npmSearch, } from '@amodalai/core';
|
|
7
|
+
import { findRepoRoot } from '../shared/repo-discovery.js';
|
|
8
|
+
/**
|
|
9
|
+
* Search the registry for packages.
|
|
10
|
+
* Returns 0 on success, 1 on error.
|
|
11
|
+
*/
|
|
12
|
+
export async function runSearch(options = {}) {
|
|
13
|
+
let repoPath;
|
|
14
|
+
try {
|
|
15
|
+
repoPath = findRepoRoot(options.cwd);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// Not in a repo — use temp context
|
|
19
|
+
}
|
|
20
|
+
let paths;
|
|
21
|
+
try {
|
|
22
|
+
paths = await ensureNpmContext(repoPath ?? process.cwd());
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
26
|
+
process.stderr.write(`[search] Failed to set up npm context: ${msg}\n`);
|
|
27
|
+
return 1;
|
|
28
|
+
}
|
|
29
|
+
// Build query
|
|
30
|
+
let query = options.type ? `@amodalai/${options.type}-` : '@amodalai/';
|
|
31
|
+
if (options.query) {
|
|
32
|
+
query += options.query;
|
|
33
|
+
}
|
|
34
|
+
process.stderr.write(`[search] Searching for "${query}"...\n`);
|
|
35
|
+
let results;
|
|
36
|
+
try {
|
|
37
|
+
results = await npmSearch(paths, query);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
41
|
+
process.stderr.write(`[search] Search failed: ${msg}\n`);
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
// Filter to @amodalai/ packages only
|
|
45
|
+
results = results.filter((r) => r.name.startsWith('@amodalai/'));
|
|
46
|
+
// Further filter by type if specified
|
|
47
|
+
if (options.type) {
|
|
48
|
+
results = results.filter((r) => {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = fromNpmName(r.name);
|
|
51
|
+
return parsed.type === options.type;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (results.length === 0) {
|
|
59
|
+
process.stderr.write('[search] No packages found.\n');
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
if (options.json) {
|
|
63
|
+
const output = results.map((r) => {
|
|
64
|
+
let type;
|
|
65
|
+
let name;
|
|
66
|
+
try {
|
|
67
|
+
const parsed = fromNpmName(r.name);
|
|
68
|
+
type = parsed.type;
|
|
69
|
+
name = parsed.name;
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
// Not a parseable amodal name
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
npm: r.name,
|
|
76
|
+
version: r.version,
|
|
77
|
+
description: r.description,
|
|
78
|
+
type,
|
|
79
|
+
name,
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
process.stdout.write(JSON.stringify(output, null, 2) + '\n');
|
|
83
|
+
return 0;
|
|
84
|
+
}
|
|
85
|
+
// Categorize results
|
|
86
|
+
const grouped = new Map();
|
|
87
|
+
for (const r of results) {
|
|
88
|
+
let category = 'other';
|
|
89
|
+
let pkgName = r.name;
|
|
90
|
+
try {
|
|
91
|
+
const parsed = fromNpmName(r.name);
|
|
92
|
+
category = parsed.type;
|
|
93
|
+
pkgName = parsed.name;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// Not parseable
|
|
97
|
+
}
|
|
98
|
+
if (!grouped.has(category)) {
|
|
99
|
+
grouped.set(category, []);
|
|
100
|
+
}
|
|
101
|
+
grouped.get(category).push({ name: pkgName, version: r.version, description: r.description, npm: r.name });
|
|
102
|
+
}
|
|
103
|
+
for (const [category, items] of grouped) {
|
|
104
|
+
process.stdout.write(`\n ${category.toUpperCase()}\n`);
|
|
105
|
+
const nameWidth = Math.max(4, ...items.map((i) => i.name.length));
|
|
106
|
+
const versionWidth = Math.max(7, ...items.map((i) => i.version.length));
|
|
107
|
+
for (const item of items) {
|
|
108
|
+
process.stdout.write(` ${item.name.padEnd(nameWidth)} ${item.version.padEnd(versionWidth)} ${item.description}\n`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
process.stderr.write(`\n[search] ${results.length} package${results.length === 1 ? '' : 's'} found.\n`);
|
|
112
|
+
return 0;
|
|
113
|
+
}
|
|
114
|
+
export const searchCommand = {
|
|
115
|
+
command: 'search [query]',
|
|
116
|
+
describe: 'Search the registry for packages',
|
|
117
|
+
builder: (yargs) => yargs
|
|
118
|
+
.positional('query', { type: 'string', describe: 'Search query' })
|
|
119
|
+
.option('type', { type: 'string', choices: ['connection', 'skill', 'automation', 'knowledge'], describe: 'Filter by type' })
|
|
120
|
+
.option('json', { type: 'boolean', default: false, describe: 'Output as JSON' }),
|
|
121
|
+
handler: async (argv) => {
|
|
122
|
+
const code = await runSearch({
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
124
|
+
query: argv['query'],
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
126
|
+
type: argv['type'],
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
128
|
+
json: argv['json'],
|
|
129
|
+
});
|
|
130
|
+
process.exit(code);
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/search.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAC,YAAY,EAAC,MAAM,6BAA6B,CAAC;AASzD;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,UAAyB,EAAE;IACzD,IAAI,QAA4B,CAAC;IACjC,IAAI,CAAC;QACH,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,CAAC;IAAC,MAAM,CAAC;QACP,mCAAmC;IACrC,CAAC;IAED,IAAI,KAAK,CAAC;IACV,IAAI,CAAC;QACH,KAAK,GAAG,MAAM,gBAAgB,CAAC,QAAQ,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,0CAA0C,GAAG,IAAI,CAAC,CAAC;QACxE,OAAO,CAAC,CAAC;IACX,CAAC;IAED,cAAc;IACd,IAAI,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,aAAa,OAAO,CAAC,IAAI,GAAG,CA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,CAAC,CAAC;IACxG,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,kCAAkC;IAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,UAAU,CAAC,OAAO,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAC,CAAC;SAC/D,MAAM,CAAC,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,CAAU,EAAE,QAAQ,EAAE,gBAAgB,EAAC,CAAC;SAClI,MAAM,CAAC,MAAM,EAAE,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAAC,CAAC;IAClF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC;YAC3B,uEAAuE;YACvE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAuB;YAC1C,uEAAuE;YACvE,IAAI,EAAE,IAAI,CAAC,MAAM,CAA4B;YAC7C,uEAAuE;YACvE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAY;SAC9B,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandModule } from 'yargs';
|
|
7
|
+
export interface SecretsOptions {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
subcommand: 'set' | 'list' | 'delete';
|
|
10
|
+
key?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
json?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Manage platform secrets.
|
|
16
|
+
* Returns 0 on success, 1 on error.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runSecrets(options: SecretsOptions): Promise<number>;
|
|
19
|
+
export declare const secretsCommand: CommandModule;
|
|
20
|
+
//# sourceMappingURL=secrets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/commands/secrets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAGzC,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IACtC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAqHzE;AAED,eAAO,MAAM,cAAc,EAAE,aAsB5B,CAAC"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { resolvePlatformConfig } from '../shared/platform-client.js';
|
|
7
|
+
/**
|
|
8
|
+
* Manage platform secrets.
|
|
9
|
+
* Returns 0 on success, 1 on error.
|
|
10
|
+
*/
|
|
11
|
+
export async function runSecrets(options) {
|
|
12
|
+
let config;
|
|
13
|
+
try {
|
|
14
|
+
config = await resolvePlatformConfig();
|
|
15
|
+
}
|
|
16
|
+
catch (err) {
|
|
17
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
18
|
+
process.stderr.write(`[secrets] ${msg}\n`);
|
|
19
|
+
return 1;
|
|
20
|
+
}
|
|
21
|
+
const headers = {
|
|
22
|
+
'Authorization': `Bearer ${config.apiKey}`,
|
|
23
|
+
'Content-Type': 'application/json',
|
|
24
|
+
};
|
|
25
|
+
switch (options.subcommand) {
|
|
26
|
+
case 'set': {
|
|
27
|
+
if (!options.key) {
|
|
28
|
+
process.stderr.write('[secrets] Missing key. Usage: amodal secrets set <key> <value>\n');
|
|
29
|
+
return 1;
|
|
30
|
+
}
|
|
31
|
+
if (options.value === undefined) {
|
|
32
|
+
process.stderr.write('[secrets] Missing value. Usage: amodal secrets set <key> <value>\n');
|
|
33
|
+
return 1;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
const response = await fetch(`${config.url}/api/secrets`, {
|
|
37
|
+
method: 'PUT',
|
|
38
|
+
headers,
|
|
39
|
+
body: JSON.stringify({ key: options.key, value: options.value }),
|
|
40
|
+
});
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
process.stderr.write(`[secrets] Failed to set secret: ${response.status} ${response.statusText}\n`);
|
|
43
|
+
return 1;
|
|
44
|
+
}
|
|
45
|
+
process.stderr.write(`[secrets] Secret "${options.key}" set successfully.\n`);
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
50
|
+
process.stderr.write(`[secrets] Failed to set secret: ${msg}\n`);
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
case 'list': {
|
|
55
|
+
try {
|
|
56
|
+
const response = await fetch(`${config.url}/api/secrets`, {
|
|
57
|
+
method: 'GET',
|
|
58
|
+
headers,
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) {
|
|
61
|
+
process.stderr.write(`[secrets] Failed to list secrets: ${response.status} ${response.statusText}\n`);
|
|
62
|
+
return 1;
|
|
63
|
+
}
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
65
|
+
const secrets = (await response.json());
|
|
66
|
+
if (secrets.length === 0) {
|
|
67
|
+
process.stderr.write('[secrets] No secrets configured.\n');
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
if (options.json) {
|
|
71
|
+
process.stdout.write(JSON.stringify(secrets, null, 2) + '\n');
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
process.stdout.write('KEY\n');
|
|
75
|
+
for (const secret of secrets) {
|
|
76
|
+
process.stdout.write(`${secret.key}\n`);
|
|
77
|
+
}
|
|
78
|
+
process.stderr.write(`[secrets] ${secrets.length} secret${secrets.length === 1 ? '' : 's'} configured.\n`);
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
83
|
+
process.stderr.write(`[secrets] Failed to list secrets: ${msg}\n`);
|
|
84
|
+
return 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
case 'delete': {
|
|
88
|
+
if (!options.key) {
|
|
89
|
+
process.stderr.write('[secrets] Missing key. Usage: amodal secrets delete <key>\n');
|
|
90
|
+
return 1;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const response = await fetch(`${config.url}/api/secrets/${encodeURIComponent(options.key)}`, {
|
|
94
|
+
method: 'DELETE',
|
|
95
|
+
headers,
|
|
96
|
+
});
|
|
97
|
+
if (!response.ok) {
|
|
98
|
+
process.stderr.write(`[secrets] Failed to delete secret: ${response.status} ${response.statusText}\n`);
|
|
99
|
+
return 1;
|
|
100
|
+
}
|
|
101
|
+
process.stderr.write(`[secrets] Secret "${options.key}" deleted.\n`);
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
106
|
+
process.stderr.write(`[secrets] Failed to delete secret: ${msg}\n`);
|
|
107
|
+
return 1;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
default:
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
return 1;
|
|
114
|
+
}
|
|
115
|
+
export const secretsCommand = {
|
|
116
|
+
command: 'secrets <subcommand> [key] [value]',
|
|
117
|
+
describe: 'Manage platform secrets',
|
|
118
|
+
builder: (yargs) => yargs
|
|
119
|
+
.positional('subcommand', { type: 'string', demandOption: true, choices: ['set', 'list', 'delete'], describe: 'Action' })
|
|
120
|
+
.positional('key', { type: 'string', describe: 'Secret key' })
|
|
121
|
+
.positional('value', { type: 'string', describe: 'Secret value (for set)' })
|
|
122
|
+
.option('json', { type: 'boolean', default: false, describe: 'Output as JSON' }),
|
|
123
|
+
handler: async (argv) => {
|
|
124
|
+
const code = await runSecrets({
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
126
|
+
subcommand: argv['subcommand'],
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
128
|
+
key: argv['key'],
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
130
|
+
value: argv['value'],
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
132
|
+
json: argv['json'],
|
|
133
|
+
});
|
|
134
|
+
process.exit(code);
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
//# sourceMappingURL=secrets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../src/commands/secrets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AAUnE;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,OAAuB;IACtD,IAAI,MAAqC,CAAC;IAC1C,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,qBAAqB,EAAE,CAAC;IACzC,CAA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QACtB,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC;YAC5B,uEAAuE;YACvE,UAAU,EAAE,IAAI,CAAC,YAAY,CAA8B;YAC3D,uEAAuE;YACvE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAuB;YACtC,uEAAuE;YACvE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAuB;YAC1C,uEAAuE;YACvE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAY;SAC9B,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandModule } from 'yargs';
|
|
7
|
+
import type { AmodalRepo } from '@amodalai/core';
|
|
8
|
+
export interface ServeOptions {
|
|
9
|
+
config?: string;
|
|
10
|
+
platform?: boolean;
|
|
11
|
+
project?: string;
|
|
12
|
+
env?: string;
|
|
13
|
+
port?: number;
|
|
14
|
+
host?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Load an agent runtime from a snapshot (file or platform) and start the server.
|
|
18
|
+
*
|
|
19
|
+
* Returns the loaded repo, or exits with error.
|
|
20
|
+
*/
|
|
21
|
+
export declare function runServe(options: ServeOptions): Promise<AmodalRepo | null>;
|
|
22
|
+
export declare const serveCommand: CommandModule;
|
|
23
|
+
//# sourceMappingURL=serve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../src/commands/serve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAEzC,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAkDD;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAuChF;AAED,eAAO,MAAM,YAAY,EAAE,aAkD1B,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { loadSnapshotFromFile, snapshotToRepo } from '@amodalai/core';
|
|
7
|
+
import { createLocalServer } from '@amodalai/runtime';
|
|
8
|
+
import { PlatformClient } from '../shared/platform-client.js';
|
|
9
|
+
const DEFAULT_PORT = 3847;
|
|
10
|
+
/**
|
|
11
|
+
* Load a repo from a snapshot file or from the platform.
|
|
12
|
+
*/
|
|
13
|
+
async function loadFromSource(options) {
|
|
14
|
+
if (options.config) {
|
|
15
|
+
process.stderr.write(`[serve] Loading snapshot from ${options.config}...\n`);
|
|
16
|
+
try {
|
|
17
|
+
const snapshot = await loadSnapshotFromFile(options.config);
|
|
18
|
+
const repo = snapshotToRepo(snapshot, options.config);
|
|
19
|
+
process.stderr.write(`[serve] Loaded ${snapshot.deployId} (${snapshot.skills.length} skills, ${Object.keys(snapshot.connections).length} connections)\n`);
|
|
20
|
+
return repo;
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
24
|
+
process.stderr.write(`[serve] Failed to load snapshot: ${msg}\n`);
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (options.platform) {
|
|
29
|
+
process.stderr.write('[serve] Fetching active snapshot from platform...\n');
|
|
30
|
+
let client;
|
|
31
|
+
try {
|
|
32
|
+
client = await PlatformClient.create();
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
36
|
+
process.stderr.write(`[serve] ${msg}\n`);
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const environment = options.env ?? 'production';
|
|
40
|
+
try {
|
|
41
|
+
const snapshot = await client.getActiveSnapshot(environment);
|
|
42
|
+
const repo = snapshotToRepo(snapshot, `platform:${environment}`);
|
|
43
|
+
process.stderr.write(`[serve] Loaded ${snapshot.deployId} from ${environment}\n`);
|
|
44
|
+
return repo;
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
48
|
+
process.stderr.write(`[serve] Failed to fetch snapshot: ${msg}\n`);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
process.stderr.write('[serve] Specify --config <file> or --platform to load a snapshot.\n');
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Load an agent runtime from a snapshot (file or platform) and start the server.
|
|
57
|
+
*
|
|
58
|
+
* Returns the loaded repo, or exits with error.
|
|
59
|
+
*/
|
|
60
|
+
export async function runServe(options) {
|
|
61
|
+
const repo = await loadFromSource(options);
|
|
62
|
+
if (!repo)
|
|
63
|
+
return null;
|
|
64
|
+
// Start the runtime server
|
|
65
|
+
const port = options.port ?? DEFAULT_PORT;
|
|
66
|
+
const host = options.host ?? '0.0.0.0';
|
|
67
|
+
process.stderr.write(`[serve] Starting server on ${host}:${port}...\n`);
|
|
68
|
+
try {
|
|
69
|
+
const server = await createLocalServer({
|
|
70
|
+
repoPath: repo.origin,
|
|
71
|
+
port,
|
|
72
|
+
host,
|
|
73
|
+
hotReload: false,
|
|
74
|
+
corsOrigin: '*',
|
|
75
|
+
});
|
|
76
|
+
await server.start();
|
|
77
|
+
process.stderr.write(`[serve] Agent "${repo.config.name}" serving at http://${host}:${port}\n`);
|
|
78
|
+
// Graceful shutdown
|
|
79
|
+
const shutdown = async (signal) => {
|
|
80
|
+
process.stderr.write(`\n[serve] Received ${signal}, shutting down...\n`);
|
|
81
|
+
await server.stop();
|
|
82
|
+
process.exit(0);
|
|
83
|
+
};
|
|
84
|
+
process.on('SIGTERM', () => void shutdown('SIGTERM'));
|
|
85
|
+
process.on('SIGINT', () => void shutdown('SIGINT'));
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
89
|
+
process.stderr.write(`[serve] Failed to start server: ${msg}\n`);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
return repo;
|
|
93
|
+
}
|
|
94
|
+
export const serveCommand = {
|
|
95
|
+
command: 'serve',
|
|
96
|
+
describe: 'Load and serve an agent from a snapshot',
|
|
97
|
+
builder: (yargs) => yargs
|
|
98
|
+
.option('config', {
|
|
99
|
+
type: 'string',
|
|
100
|
+
describe: 'Path to resolved-config.json snapshot file',
|
|
101
|
+
})
|
|
102
|
+
.option('platform', {
|
|
103
|
+
type: 'boolean',
|
|
104
|
+
describe: 'Fetch active snapshot from platform',
|
|
105
|
+
default: false,
|
|
106
|
+
})
|
|
107
|
+
.option('project', {
|
|
108
|
+
type: 'string',
|
|
109
|
+
describe: 'Platform project name',
|
|
110
|
+
})
|
|
111
|
+
.option('env', {
|
|
112
|
+
type: 'string',
|
|
113
|
+
describe: 'Platform environment (default: production)',
|
|
114
|
+
})
|
|
115
|
+
.option('port', {
|
|
116
|
+
type: 'number',
|
|
117
|
+
describe: `Port to listen on (default: ${DEFAULT_PORT})`,
|
|
118
|
+
})
|
|
119
|
+
.option('host', {
|
|
120
|
+
type: 'string',
|
|
121
|
+
describe: 'Host to bind to (default: 0.0.0.0)',
|
|
122
|
+
}),
|
|
123
|
+
handler: async (argv) => {
|
|
124
|
+
const repo = await runServe({
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
126
|
+
config: argv['config'],
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
128
|
+
platform: argv['platform'],
|
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
130
|
+
project: argv['project'],
|
|
131
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
132
|
+
env: argv['env'],
|
|
133
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
134
|
+
port: argv['port'],
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
136
|
+
host: argv['host'],
|
|
137
|
+
});
|
|
138
|
+
if (!repo) {
|
|
139
|
+
process.exit(1);
|
|
140
|
+
}
|
|
141
|
+
// Server is running — process stays alive until SIGTERM/SIGINT
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/commands/serve.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,oBAAoB,EAAE,cAAc,EAAC,MAAM,gBAAgB,CAAC;AAEpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAW5D,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;GAEG;AACH,KAAK,UAAU,cAAc,CAAC,OAAqB;IACjD,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,iCAAiC,OAAO,CAAC,MAAM,OAAO,CAAC,CAAC;QAC7E,IAAI,CAAC;YACH,MAA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face StatusOptions {
|
|
8
|
+
env?: string;
|
|
9
|
+
json?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Show current deployment status per environment.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runStatus(options?: StatusOptions): Promise<number>;
|
|
15
|
+
export declare const statusCommand: CommandModule;
|
|
16
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAGzC,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmD5E;AAED,eAAO,MAAM,aAAa,EAAE,aAuB3B,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { PlatformClient } from '../shared/platform-client.js';
|
|
7
|
+
/**
|
|
8
|
+
* Show current deployment status per environment.
|
|
9
|
+
*/
|
|
10
|
+
export async function runStatus(options = {}) {
|
|
11
|
+
let client;
|
|
12
|
+
try {
|
|
13
|
+
client = await PlatformClient.create();
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
17
|
+
process.stderr.write(`[status] ${msg}\n`);
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
const environments = options.env ? [options.env] : ['production', 'staging'];
|
|
21
|
+
try {
|
|
22
|
+
const results = [];
|
|
23
|
+
for (const env of environments) {
|
|
24
|
+
const deployments = await client.listDeployments({ environment: env, limit: 1 });
|
|
25
|
+
const active = deployments.find((d) => d.isActive);
|
|
26
|
+
if (active) {
|
|
27
|
+
results.push({
|
|
28
|
+
environment: env,
|
|
29
|
+
id: active.id,
|
|
30
|
+
createdAt: active.createdAt,
|
|
31
|
+
createdBy: active.createdBy ?? undefined,
|
|
32
|
+
commitSha: active.commitSha ?? undefined,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
results.push({ environment: env });
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (options.json) {
|
|
40
|
+
process.stdout.write(JSON.stringify(results, null, 2) + '\n');
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
43
|
+
for (const r of results) {
|
|
44
|
+
if (r.id) {
|
|
45
|
+
const sha = r.commitSha ? ` (${r.commitSha.slice(0, 7)})` : '';
|
|
46
|
+
process.stdout.write(`${r.environment}: ${r.id}${sha} — ${r.createdBy ?? 'unknown'} at ${r.createdAt}\n`);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
process.stdout.write(`${r.environment}: no active deployment\n`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return 0;
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
56
|
+
process.stderr.write(`[status] Failed: ${msg}\n`);
|
|
57
|
+
return 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export const statusCommand = {
|
|
61
|
+
command: 'status',
|
|
62
|
+
describe: 'Show current deployment status',
|
|
63
|
+
builder: (yargs) => yargs
|
|
64
|
+
.option('env', {
|
|
65
|
+
type: 'string',
|
|
66
|
+
describe: 'Check specific environment',
|
|
67
|
+
})
|
|
68
|
+
.option('json', {
|
|
69
|
+
type: 'boolean',
|
|
70
|
+
describe: 'Output as JSON',
|
|
71
|
+
default: false,
|
|
72
|
+
}),
|
|
73
|
+
handler: async (argv) => {
|
|
74
|
+
const code = await runStatus({
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
76
|
+
env: argv['env'],
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
78
|
+
json: argv['json'],
|
|
79
|
+
});
|
|
80
|
+
process.exit(code);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/status.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AAO5D;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,UAAyB,EAAE;IACzD,IAAI,MAAsB,CAAC;IAC3B,IAAI,CAAC;QACH,MAAM,GAAG,MAAM,cAAc,CAAC,MAAM,EAAE,CAAC;IACzC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;QAC1C,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAE7E,IAAI,CAAC;QACH,MAAM,OAAO,GAA0G,EAAE,CAAC;QAE1H,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/B,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,EAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE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ions {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
/** CI mode — just check, exit 1 if drift detected */
|
|
10
|
+
check?: boolean;
|
|
11
|
+
/** Only sync a specific connection */
|
|
12
|
+
connection?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* For each connection with an OpenAPI spec URL, fetch the spec,
|
|
16
|
+
* detect drift against the surface endpoints, and optionally
|
|
17
|
+
* apply updates interactively.
|
|
18
|
+
*/
|
|
19
|
+
export declare function runSync(options?: SyncOptions): Promise<number>;
|
|
20
|
+
export declare const syncCommand: CommandModule;
|
|
21
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/commands/sync.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAGzC,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,sCAAsC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6CxE;AA2BD,eAAO,MAAM,WAAW,EAAE,aAsBzB,CAAC"}
|