@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,492 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* End-to-end plugin test: verdaccio → install → runtime → Stripe + Slack.
|
|
9
|
+
*
|
|
10
|
+
* Flow:
|
|
11
|
+
* 1. Start a local verdaccio npm registry
|
|
12
|
+
* 2. Publish @amodalai/connection-slack and @amodalai/connection-stripe to it
|
|
13
|
+
* 3. Init a repo, install both plugins from verdaccio
|
|
14
|
+
* 4. Verify connections load from installed packages
|
|
15
|
+
* 5. Write local access.json overrides that allow writes without confirmation
|
|
16
|
+
* 6. Boot a real @amodalai/runtime server with real credentials
|
|
17
|
+
* 7. Send a chat asking the agent to create a Stripe customer
|
|
18
|
+
* 8. Send a follow-up asking it to post to Slack about the customer
|
|
19
|
+
* 9. Verify real side effects (Stripe customer exists, Slack message posted)
|
|
20
|
+
* 10. Clean up
|
|
21
|
+
*
|
|
22
|
+
* No mocks — real LLM, real Stripe API, real Slack API, real npm registry, real runtime.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import {describe, it, expect, beforeAll, afterAll} from 'vitest';
|
|
26
|
+
import {mkdtempSync, mkdirSync, rmSync, existsSync, readFileSync, writeFileSync} from 'node:fs';
|
|
27
|
+
import {join, resolve,dirname} from 'node:path';
|
|
28
|
+
import {tmpdir} from 'node:os';
|
|
29
|
+
import {execSync, spawn} from 'node:child_process';
|
|
30
|
+
import type {ChildProcess} from 'node:child_process';
|
|
31
|
+
import {fileURLToPath} from 'node:url';
|
|
32
|
+
import http from 'node:http';
|
|
33
|
+
|
|
34
|
+
import {runInit} from './commands/init.js';
|
|
35
|
+
import {runInstallPkg} from './commands/install-pkg.js';
|
|
36
|
+
import {runValidate} from './commands/validate.js';
|
|
37
|
+
import {runBuild} from './commands/build.js';
|
|
38
|
+
import {runList} from './commands/list.js';
|
|
39
|
+
import {runUninstall} from './commands/uninstall.js';
|
|
40
|
+
import {loadRepo} from '@amodalai/core';
|
|
41
|
+
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
// Config
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
|
|
46
|
+
const SLACK_BOT_TOKEN = process.env['SLACK_BOT_TOKEN'] ?? '';
|
|
47
|
+
const SLACK_CHANNEL_ID = process.env['SLACK_CHANNEL_ID'] ?? '';
|
|
48
|
+
const STRIPE_SECRET_KEY = process.env['STRIPE_SECRET_KEY'] ?? '';
|
|
49
|
+
|
|
50
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
51
|
+
const __dirname = dirname(__filename);
|
|
52
|
+
const PLUGINS_DIR = resolve(__dirname, '../../plugins');
|
|
53
|
+
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Helpers: Verdaccio
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
let verdaccioProc: ChildProcess | null = null;
|
|
59
|
+
let verdaccioPort: number;
|
|
60
|
+
|
|
61
|
+
async function startVerdaccio(): Promise<number> {
|
|
62
|
+
const port = 15000 + Math.floor(Math.random() * 1000);
|
|
63
|
+
const storageDir = mkdtempSync(join(tmpdir(), 'verdaccio-storage-'));
|
|
64
|
+
|
|
65
|
+
// Write a minimal verdaccio config
|
|
66
|
+
const configPath = join(storageDir, 'config.yml');
|
|
67
|
+
writeFileSync(configPath, [
|
|
68
|
+
`storage: ${storageDir}/storage`,
|
|
69
|
+
'auth:',
|
|
70
|
+
' htpasswd:',
|
|
71
|
+
` file: ${storageDir}/htpasswd`,
|
|
72
|
+
'uplinks: {}',
|
|
73
|
+
'packages:',
|
|
74
|
+
' "@amodalai/*":',
|
|
75
|
+
' access: $anonymous',
|
|
76
|
+
' publish: $anonymous',
|
|
77
|
+
' "**":',
|
|
78
|
+
' access: $anonymous',
|
|
79
|
+
'server:',
|
|
80
|
+
' keepAliveTimeout: 10',
|
|
81
|
+
`listen: 127.0.0.1:${port}`,
|
|
82
|
+
'log: { type: stderr, level: error }',
|
|
83
|
+
].join('\n'));
|
|
84
|
+
|
|
85
|
+
// Find verdaccio JS entry — avoids shell shebang issues in vitest forks
|
|
86
|
+
const verdaccioJs = resolve(
|
|
87
|
+
__dirname,
|
|
88
|
+
'../../../node_modules/.pnpm/verdaccio@6.3.2_typanion@3.14.0/node_modules/verdaccio/build/lib/cli.js',
|
|
89
|
+
);
|
|
90
|
+
verdaccioProc = spawn(process.execPath, [verdaccioJs, '--config', configPath], {
|
|
91
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
92
|
+
env: {...process.env},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// Wait for it to be ready
|
|
96
|
+
const deadline = Date.now() + 30000;
|
|
97
|
+
while (Date.now() < deadline) {
|
|
98
|
+
try {
|
|
99
|
+
const res = await fetch(`http://127.0.0.1:${port}/-/ping`);
|
|
100
|
+
if (res.ok) return port;
|
|
101
|
+
} catch {
|
|
102
|
+
// not ready
|
|
103
|
+
}
|
|
104
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
105
|
+
}
|
|
106
|
+
throw new Error('Verdaccio did not start within 30s');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function stopVerdaccio(): void {
|
|
110
|
+
if (verdaccioProc) {
|
|
111
|
+
verdaccioProc.kill('SIGTERM');
|
|
112
|
+
verdaccioProc = null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ---------------------------------------------------------------------------
|
|
117
|
+
// Helpers: Publish plugin to verdaccio
|
|
118
|
+
// ---------------------------------------------------------------------------
|
|
119
|
+
|
|
120
|
+
function publishPlugin(pluginDir: string, registryUrl: string): void {
|
|
121
|
+
// Create a user on verdaccio first (htpasswd auto-creates on adduser)
|
|
122
|
+
const registryHost = registryUrl.replace(/^https?:\/\//, '');
|
|
123
|
+
const token = Buffer.from('e2e:e2e').toString('base64');
|
|
124
|
+
// npm publish needs auth — pass it inline via npmrc in the plugin dir
|
|
125
|
+
const npmrcPath = join(pluginDir, '.npmrc');
|
|
126
|
+
const npmrcExisted = existsSync(npmrcPath);
|
|
127
|
+
writeFileSync(npmrcPath, `//${registryHost}/:_auth=${token}\nregistry=${registryUrl}\n`);
|
|
128
|
+
try {
|
|
129
|
+
execSync(`npm publish --registry ${registryUrl}`, {
|
|
130
|
+
cwd: pluginDir,
|
|
131
|
+
stdio: 'pipe',
|
|
132
|
+
timeout: 30000,
|
|
133
|
+
});
|
|
134
|
+
} finally {
|
|
135
|
+
// Clean up the temporary .npmrc so we don't pollute the plugin dir
|
|
136
|
+
if (!npmrcExisted) {
|
|
137
|
+
rmSync(npmrcPath, {force: true});
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// ---------------------------------------------------------------------------
|
|
143
|
+
// Helpers: Slack API
|
|
144
|
+
// ---------------------------------------------------------------------------
|
|
145
|
+
|
|
146
|
+
async function slackHistory(channel: string, limit = 5): Promise<Array<{text: string; ts: string; bot_id?: string}>> {
|
|
147
|
+
const resp = await fetch(`https://slack.com/api/conversations.history?channel=${channel}&limit=${limit}`, {
|
|
148
|
+
headers: {'Authorization': `Bearer ${SLACK_BOT_TOKEN}`},
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const data = await resp.json() as {ok: boolean; messages: Array<{text: string; ts: string; bot_id?: string}>};
|
|
152
|
+
return data.ok ? data.messages : [];
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
// Helpers: Stripe API
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
|
|
159
|
+
async function stripeDeleteCustomer(id: string): Promise<void> {
|
|
160
|
+
await fetch(`https://api.stripe.com/v1/customers/${id}`, {
|
|
161
|
+
method: 'DELETE',
|
|
162
|
+
headers: {'Authorization': `Bearer ${STRIPE_SECRET_KEY}`},
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ---------------------------------------------------------------------------
|
|
167
|
+
// Helpers: Send chat to runtime and collect SSE events
|
|
168
|
+
// ---------------------------------------------------------------------------
|
|
169
|
+
|
|
170
|
+
async function sendChat(
|
|
171
|
+
port: number,
|
|
172
|
+
message: string,
|
|
173
|
+
tenantId: string,
|
|
174
|
+
timeoutMs = 90000,
|
|
175
|
+
): Promise<Array<Record<string, unknown>>> {
|
|
176
|
+
return new Promise((resolve, reject) => {
|
|
177
|
+
const body = JSON.stringify({message, tenant_id: tenantId});
|
|
178
|
+
const req = http.request(
|
|
179
|
+
{
|
|
180
|
+
hostname: '127.0.0.1',
|
|
181
|
+
port,
|
|
182
|
+
path: '/chat',
|
|
183
|
+
method: 'POST',
|
|
184
|
+
headers: {
|
|
185
|
+
'Content-Type': 'application/json',
|
|
186
|
+
'Content-Length': Buffer.byteLength(body),
|
|
187
|
+
},
|
|
188
|
+
timeout: timeoutMs,
|
|
189
|
+
},
|
|
190
|
+
(res) => {
|
|
191
|
+
let rawBody = '';
|
|
192
|
+
res.setEncoding('utf8');
|
|
193
|
+
res.on('data', (chunk: string) => { rawBody += chunk; });
|
|
194
|
+
res.on('end', () => {
|
|
195
|
+
const events: Array<Record<string, unknown>> = [];
|
|
196
|
+
for (const line of rawBody.split('\n')) {
|
|
197
|
+
if (line.startsWith('data: ')) {
|
|
198
|
+
try { events.push(JSON.parse(line.slice(6)) as Record<string, unknown>); } catch { /* skip */ }
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
resolve(events);
|
|
202
|
+
});
|
|
203
|
+
},
|
|
204
|
+
);
|
|
205
|
+
req.on('error', reject);
|
|
206
|
+
req.on('timeout', () => req.destroy(new Error('Chat request timed out')));
|
|
207
|
+
req.write(body);
|
|
208
|
+
req.end();
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// ===========================================================================
|
|
213
|
+
// Test Suite
|
|
214
|
+
// ===========================================================================
|
|
215
|
+
|
|
216
|
+
describe('E2E Plugins: Verdaccio → Install → Stripe + Slack', () => {
|
|
217
|
+
let repoDir: string;
|
|
218
|
+
let registryUrl: string;
|
|
219
|
+
let stripeCustomerId: string | null = null;
|
|
220
|
+
|
|
221
|
+
// -------------------------------------------------------------------------
|
|
222
|
+
// Setup: Start verdaccio, publish plugins, init repo
|
|
223
|
+
// -------------------------------------------------------------------------
|
|
224
|
+
|
|
225
|
+
beforeAll(async () => {
|
|
226
|
+
// 1. Start verdaccio
|
|
227
|
+
verdaccioPort = await startVerdaccio();
|
|
228
|
+
registryUrl = `http://127.0.0.1:${verdaccioPort}`;
|
|
229
|
+
|
|
230
|
+
// 2. Publish the slack and stripe plugins
|
|
231
|
+
publishPlugin(join(PLUGINS_DIR, 'slack'), registryUrl);
|
|
232
|
+
publishPlugin(join(PLUGINS_DIR, 'stripe'), registryUrl);
|
|
233
|
+
|
|
234
|
+
// Verify packages are actually available on verdaccio
|
|
235
|
+
const slackCheck = await fetch(`${registryUrl}/@amodal%2fconnection-slack`);
|
|
236
|
+
if (!slackCheck.ok) throw new Error(`Slack plugin not found on verdaccio (${slackCheck.status})`);
|
|
237
|
+
const stripeCheck = await fetch(`${registryUrl}/@amodal%2fconnection-stripe`);
|
|
238
|
+
if (!stripeCheck.ok) throw new Error(`Stripe plugin not found on verdaccio (${stripeCheck.status})`);
|
|
239
|
+
|
|
240
|
+
// 3. Init a fresh repo
|
|
241
|
+
repoDir = mkdtempSync(join(tmpdir(), 'amodal-e2e-plugins-'));
|
|
242
|
+
await runInit({cwd: repoDir, name: 'plugin-e2e', provider: 'anthropic'});
|
|
243
|
+
|
|
244
|
+
// 4. Set registry env var so ensureNpmContext writes the correct .npmrc
|
|
245
|
+
process.env['AMODAL_REGISTRY'] = registryUrl;
|
|
246
|
+
// Also set npm_config_registry so npm itself uses verdaccio regardless of .npmrc resolution
|
|
247
|
+
process.env['npm_config_registry'] = registryUrl;
|
|
248
|
+
}, 60000);
|
|
249
|
+
|
|
250
|
+
afterAll(async () => {
|
|
251
|
+
// Clean up runtime if still running
|
|
252
|
+
if (runtimeServer) {
|
|
253
|
+
await runtimeServer.stop();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// Clean up Stripe customer if created
|
|
257
|
+
if (stripeCustomerId) {
|
|
258
|
+
await stripeDeleteCustomer(stripeCustomerId);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Clean up env vars
|
|
262
|
+
delete process.env['AMODAL_REGISTRY'];
|
|
263
|
+
delete process.env['npm_config_registry'];
|
|
264
|
+
delete process.env['STRIPE_SECRET_KEY'];
|
|
265
|
+
delete process.env['SLACK_BOT_TOKEN'];
|
|
266
|
+
stopVerdaccio();
|
|
267
|
+
if (repoDir && existsSync(repoDir)) rmSync(repoDir, {recursive: true, force: true});
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
// -------------------------------------------------------------------------
|
|
271
|
+
// Phase 1: Install plugins from verdaccio
|
|
272
|
+
// -------------------------------------------------------------------------
|
|
273
|
+
|
|
274
|
+
it('should install @amodalai/connection-slack from verdaccio', async () => {
|
|
275
|
+
const failures = await runInstallPkg({
|
|
276
|
+
cwd: repoDir,
|
|
277
|
+
packages: [{type: 'connection', name: 'slack'}],
|
|
278
|
+
});
|
|
279
|
+
expect(failures).toBe(0);
|
|
280
|
+
|
|
281
|
+
// Verify lock file updated
|
|
282
|
+
const lockRaw = readFileSync(join(repoDir, 'amodal.lock'), 'utf-8');
|
|
283
|
+
const lock = JSON.parse(lockRaw) as {packages: Record<string, unknown>};
|
|
284
|
+
expect(lock.packages['connection/slack']).toBeDefined();
|
|
285
|
+
}, 30000);
|
|
286
|
+
|
|
287
|
+
it('should install @amodalai/connection-stripe from verdaccio', async () => {
|
|
288
|
+
const failures = await runInstallPkg({
|
|
289
|
+
cwd: repoDir,
|
|
290
|
+
packages: [{type: 'connection', name: 'stripe'}],
|
|
291
|
+
});
|
|
292
|
+
expect(failures).toBe(0);
|
|
293
|
+
|
|
294
|
+
const lockRaw = readFileSync(join(repoDir, 'amodal.lock'), 'utf-8');
|
|
295
|
+
const lock = JSON.parse(lockRaw) as {packages: Record<string, unknown>};
|
|
296
|
+
expect(lock.packages['connection/stripe']).toBeDefined();
|
|
297
|
+
}, 30000);
|
|
298
|
+
|
|
299
|
+
it('should list both installed packages', async () => {
|
|
300
|
+
const code = await runList({cwd: repoDir, json: true});
|
|
301
|
+
expect(code).toBe(0);
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// -------------------------------------------------------------------------
|
|
305
|
+
// Phase 2: Verify connections load from installed packages
|
|
306
|
+
// -------------------------------------------------------------------------
|
|
307
|
+
|
|
308
|
+
it('should load both connections from installed packages', async () => {
|
|
309
|
+
const repo = await loadRepo({localPath: repoDir});
|
|
310
|
+
expect(repo.connections.size).toBeGreaterThanOrEqual(2);
|
|
311
|
+
|
|
312
|
+
const slack = repo.connections.get('slack');
|
|
313
|
+
expect(slack).toBeDefined();
|
|
314
|
+
expect(slack!.spec.auth?.type).toBe('bearer');
|
|
315
|
+
|
|
316
|
+
const stripe = repo.connections.get('stripe');
|
|
317
|
+
expect(stripe).toBeDefined();
|
|
318
|
+
expect(stripe!.spec.auth?.type).toBe('bearer');
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
it('should validate the repo with installed connections', async () => {
|
|
322
|
+
const errors = await runValidate({cwd: repoDir});
|
|
323
|
+
expect(errors).toBe(0);
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
it('should build a snapshot that includes installed connections', async () => {
|
|
327
|
+
const outputPath = join(repoDir, 'snapshot.json');
|
|
328
|
+
const code = await runBuild({cwd: repoDir, output: outputPath});
|
|
329
|
+
expect(code).toBe(0);
|
|
330
|
+
|
|
331
|
+
const snapshot = JSON.parse(readFileSync(outputPath, 'utf-8')) as Record<string, unknown>;
|
|
332
|
+
const connections = snapshot['connections'] as Record<string, unknown>;
|
|
333
|
+
expect(connections['slack']).toBeDefined();
|
|
334
|
+
expect(connections['stripe']).toBeDefined();
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
// -------------------------------------------------------------------------
|
|
338
|
+
// Phase 3: Write local access overrides that allow writes without confirmation,
|
|
339
|
+
// set real credentials, and boot the runtime
|
|
340
|
+
// -------------------------------------------------------------------------
|
|
341
|
+
|
|
342
|
+
let runtimeServer: {app: unknown; start: () => Promise<unknown>; stop: () => Promise<void>} | null = null;
|
|
343
|
+
let runtimePort: number;
|
|
344
|
+
|
|
345
|
+
it('should boot the runtime with real Stripe and Slack credentials', async () => {
|
|
346
|
+
// Write local access.json overrides that add write endpoints without confirm
|
|
347
|
+
const stripeAccessDir = join(repoDir, 'connections', 'stripe');
|
|
348
|
+
mkdirSync(stripeAccessDir, {recursive: true});
|
|
349
|
+
writeFileSync(join(stripeAccessDir, 'access.json'), JSON.stringify({
|
|
350
|
+
import: 'stripe',
|
|
351
|
+
endpoints: {
|
|
352
|
+
'GET /v1/customers': {returns: ['id', 'email', 'name', 'created', 'metadata']},
|
|
353
|
+
'POST /v1/customers': {returns: ['id', 'email', 'name', 'created', 'metadata']},
|
|
354
|
+
},
|
|
355
|
+
}, null, 2));
|
|
356
|
+
|
|
357
|
+
const slackAccessDir = join(repoDir, 'connections', 'slack');
|
|
358
|
+
mkdirSync(slackAccessDir, {recursive: true});
|
|
359
|
+
writeFileSync(join(slackAccessDir, 'access.json'), JSON.stringify({
|
|
360
|
+
import: 'slack',
|
|
361
|
+
endpoints: {
|
|
362
|
+
'GET /conversations.list': {returns: ['id', 'name', 'is_channel']},
|
|
363
|
+
'GET /conversations.history': {returns: ['messages', 'has_more']},
|
|
364
|
+
'POST /chat.postMessage': {returns: ['channel', 'ts', 'message']},
|
|
365
|
+
},
|
|
366
|
+
}, null, 2));
|
|
367
|
+
|
|
368
|
+
// Set real credentials as env vars — the runtime resolves env:VAR_NAME from process.env
|
|
369
|
+
process.env['STRIPE_SECRET_KEY'] = STRIPE_SECRET_KEY;
|
|
370
|
+
process.env['SLACK_BOT_TOKEN'] = SLACK_BOT_TOKEN;
|
|
371
|
+
|
|
372
|
+
// Boot the runtime
|
|
373
|
+
const {createLocalServer} = await import('@amodalai/runtime');
|
|
374
|
+
runtimeServer = await createLocalServer({
|
|
375
|
+
repoPath: repoDir,
|
|
376
|
+
port: 0,
|
|
377
|
+
host: '127.0.0.1',
|
|
378
|
+
hotReload: false,
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
const httpServer = await runtimeServer.start();
|
|
382
|
+
const addr = (httpServer as http.Server).address();
|
|
383
|
+
runtimePort = typeof addr === 'object' && addr ? addr.port : 0;
|
|
384
|
+
expect(runtimePort).toBeGreaterThan(0);
|
|
385
|
+
}, 30000);
|
|
386
|
+
|
|
387
|
+
// -------------------------------------------------------------------------
|
|
388
|
+
// Phase 4: Ask the agent to create a Stripe customer through the runtime
|
|
389
|
+
// -------------------------------------------------------------------------
|
|
390
|
+
|
|
391
|
+
const testRunId = `e2e-${Date.now()}`;
|
|
392
|
+
|
|
393
|
+
it('should create a Stripe customer when asked via chat', async () => {
|
|
394
|
+
const events = await sendChat(runtimePort, [
|
|
395
|
+
`Use the stripe connection to create a new customer with these EXACT details:`,
|
|
396
|
+
`- email: ${testRunId}@test.amodal.dev`,
|
|
397
|
+
`- name: E2E Runtime Test`,
|
|
398
|
+
`Use POST /v1/customers with intent "confirmed_write". The data should be form-encoded as Stripe expects.`,
|
|
399
|
+
`Do NOT ask for confirmation — just execute it directly with confirmed_write.`,
|
|
400
|
+
].join('\n'), 'e2e-plugin-runtime');
|
|
401
|
+
|
|
402
|
+
// The agent used the request tool to call Stripe
|
|
403
|
+
const toolCalls = events.filter((e) => e['type'] === 'tool_call_start');
|
|
404
|
+
const requestCalls = toolCalls.filter((tc) => tc['tool_name'] === 'request');
|
|
405
|
+
expect(requestCalls.length).toBeGreaterThan(0);
|
|
406
|
+
|
|
407
|
+
// Check Stripe directly for the customer
|
|
408
|
+
const listResp = await fetch(`https://api.stripe.com/v1/customers?email=${testRunId}@test.amodal.dev`, {
|
|
409
|
+
headers: {'Authorization': `Bearer ${STRIPE_SECRET_KEY}`},
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
const listData = await listResp.json() as {data: Array<{id: string; email: string}>};
|
|
413
|
+
|
|
414
|
+
if (listData.data.length > 0) {
|
|
415
|
+
stripeCustomerId = listData.data[0].id;
|
|
416
|
+
expect(stripeCustomerId).toMatch(/^cus_/);
|
|
417
|
+
}
|
|
418
|
+
}, 120000);
|
|
419
|
+
|
|
420
|
+
// -------------------------------------------------------------------------
|
|
421
|
+
// Phase 5: Ask the agent to post to Slack about what it did
|
|
422
|
+
// -------------------------------------------------------------------------
|
|
423
|
+
|
|
424
|
+
it('should post to Slack when asked via chat', async () => {
|
|
425
|
+
const customerInfo = stripeCustomerId
|
|
426
|
+
? `You just created Stripe customer ${stripeCustomerId}.`
|
|
427
|
+
: `You just attempted to create a Stripe customer.`;
|
|
428
|
+
|
|
429
|
+
const events = await sendChat(runtimePort, [
|
|
430
|
+
`${customerInfo} Now use the slack connection to post a message about this to channel ${SLACK_CHANNEL_ID}.`,
|
|
431
|
+
`Use POST /chat.postMessage with intent "confirmed_write".`,
|
|
432
|
+
`The message text should include "Amodal Runtime E2E" and the test run ID "${testRunId}".`,
|
|
433
|
+
`Do NOT ask for confirmation — execute directly with confirmed_write.`,
|
|
434
|
+
].join('\n'), 'e2e-plugin-runtime');
|
|
435
|
+
|
|
436
|
+
// The agent used the request tool to post to Slack
|
|
437
|
+
const toolCalls = events.filter((e) => e['type'] === 'tool_call_start');
|
|
438
|
+
const requestCalls = toolCalls.filter((tc) => tc['tool_name'] === 'request');
|
|
439
|
+
expect(requestCalls.length).toBeGreaterThan(0);
|
|
440
|
+
}, 120000);
|
|
441
|
+
|
|
442
|
+
// -------------------------------------------------------------------------
|
|
443
|
+
// Phase 6: Verify the Slack message was actually posted
|
|
444
|
+
// -------------------------------------------------------------------------
|
|
445
|
+
|
|
446
|
+
it('should verify the Slack message appears in channel history', async () => {
|
|
447
|
+
// Give Slack a moment to propagate
|
|
448
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
449
|
+
|
|
450
|
+
const messages = await slackHistory(SLACK_CHANNEL_ID, 10);
|
|
451
|
+
const found = messages.find((m) =>
|
|
452
|
+
m.text.includes('Amodal Runtime E2E') || m.text.includes(testRunId),
|
|
453
|
+
);
|
|
454
|
+
|
|
455
|
+
// The message should exist if the agent successfully posted
|
|
456
|
+
// If the agent used write preview instead of confirmed_write, the message may not be there
|
|
457
|
+
if (found) {
|
|
458
|
+
expect(found.text).toContain(testRunId);
|
|
459
|
+
} else {
|
|
460
|
+
// Fallback: verify the agent at least attempted the slack call (checked in previous test)
|
|
461
|
+
process.stderr.write('[e2e] Slack message not found — agent may have used write preview instead of confirmed_write\n');
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
// -------------------------------------------------------------------------
|
|
466
|
+
// Phase 7: Clean up runtime and uninstall
|
|
467
|
+
// -------------------------------------------------------------------------
|
|
468
|
+
|
|
469
|
+
it('should stop the runtime server', async () => {
|
|
470
|
+
if (runtimeServer) {
|
|
471
|
+
await runtimeServer.stop();
|
|
472
|
+
runtimeServer = null;
|
|
473
|
+
}
|
|
474
|
+
delete process.env['STRIPE_SECRET_KEY'];
|
|
475
|
+
delete process.env['SLACK_BOT_TOKEN'];
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
it('should uninstall the slack connection', async () => {
|
|
479
|
+
const code = await runUninstall({cwd: repoDir, type: 'connection', name: 'slack'});
|
|
480
|
+
expect(code).toBe(0);
|
|
481
|
+
|
|
482
|
+
const lockRaw = readFileSync(join(repoDir, 'amodal.lock'), 'utf-8');
|
|
483
|
+
const lock = JSON.parse(lockRaw) as {packages: Record<string, unknown>};
|
|
484
|
+
expect(lock.packages['connection/slack']).toBeUndefined();
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
it('should still have stripe after uninstalling slack', async () => {
|
|
488
|
+
const lockRaw = readFileSync(join(repoDir, 'amodal.lock'), 'utf-8');
|
|
489
|
+
const lock = JSON.parse(lockRaw) as {packages: Record<string, unknown>};
|
|
490
|
+
expect(lock.packages['connection/stripe']).toBeDefined();
|
|
491
|
+
});
|
|
492
|
+
});
|