@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,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { readEnvFile } from '@amodalai/core';
|
|
7
|
+
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
8
|
+
/**
|
|
9
|
+
* Substitute $VAR and ${VAR} placeholders in a URL.
|
|
10
|
+
*/
|
|
11
|
+
export function resolveEndpointUrl(url, envVars) {
|
|
12
|
+
return url.replace(/\$\{([A-Z_][A-Z0-9_]*)\}|\$([A-Z_][A-Z0-9_]*)/g, (_match, braced, bare) => {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- regex capture groups are string|undefined
|
|
14
|
+
const varName = (braced ?? bare);
|
|
15
|
+
return envVars.get(varName) ?? '';
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build auth headers based on auth config and env vars.
|
|
20
|
+
*/
|
|
21
|
+
export function buildAuthHeaders(auth, envVars) {
|
|
22
|
+
if (!auth)
|
|
23
|
+
return {};
|
|
24
|
+
switch (auth.type) {
|
|
25
|
+
case 'bearer': {
|
|
26
|
+
// Use first envVar value as the token
|
|
27
|
+
const envVarEntries = auth['envVars'] ?? {};
|
|
28
|
+
const firstKey = Object.keys(envVarEntries)[0];
|
|
29
|
+
if (firstKey) {
|
|
30
|
+
const token = envVars.get(firstKey) ?? '';
|
|
31
|
+
if (token) {
|
|
32
|
+
return { Authorization: `Bearer ${token}` };
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {};
|
|
36
|
+
}
|
|
37
|
+
case 'api_key': {
|
|
38
|
+
const headers = {};
|
|
39
|
+
const headerDefs = auth['headers'] ?? {};
|
|
40
|
+
for (const [headerName, template] of Object.entries(headerDefs)) {
|
|
41
|
+
headers[headerName] = template.replace(/\$\{?([A-Z_][A-Z0-9_]*)\}?/g,
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- regex capture group
|
|
43
|
+
(_match, varName) => envVars.get(varName) ?? '');
|
|
44
|
+
}
|
|
45
|
+
return headers;
|
|
46
|
+
}
|
|
47
|
+
case 'oauth2': {
|
|
48
|
+
const envVarEntries = auth['envVars'] ?? {};
|
|
49
|
+
// Look for access_token mapping or use first entry
|
|
50
|
+
const tokenKey = Object.entries(envVarEntries).find(([, desc]) => desc.toLowerCase().includes('access'))?.[0] ?? Object.keys(envVarEntries)[0];
|
|
51
|
+
if (tokenKey) {
|
|
52
|
+
const token = envVars.get(tokenKey) ?? '';
|
|
53
|
+
if (token) {
|
|
54
|
+
return { Authorization: `Bearer ${token}` };
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
default:
|
|
60
|
+
return {};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Test a single endpoint. Never throws.
|
|
65
|
+
*/
|
|
66
|
+
async function testSingleEndpoint(url, headers, timeoutMs) {
|
|
67
|
+
const start = Date.now();
|
|
68
|
+
try {
|
|
69
|
+
const response = await fetch(url, {
|
|
70
|
+
method: 'GET',
|
|
71
|
+
headers,
|
|
72
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
73
|
+
});
|
|
74
|
+
const durationMs = Date.now() - start;
|
|
75
|
+
if (!response.ok) {
|
|
76
|
+
return {
|
|
77
|
+
url,
|
|
78
|
+
status: 'error',
|
|
79
|
+
statusCode: response.status,
|
|
80
|
+
error: `HTTP ${response.status}`,
|
|
81
|
+
durationMs,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Best-effort record count extraction
|
|
85
|
+
let recordCount;
|
|
86
|
+
try {
|
|
87
|
+
const body = await response.json();
|
|
88
|
+
if (Array.isArray(body)) {
|
|
89
|
+
recordCount = body.length;
|
|
90
|
+
}
|
|
91
|
+
else if (body && typeof body === 'object') {
|
|
92
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- narrowed by typeof check above
|
|
93
|
+
const obj = body;
|
|
94
|
+
if (typeof obj['total'] === 'number') {
|
|
95
|
+
recordCount = obj['total'];
|
|
96
|
+
}
|
|
97
|
+
else if (typeof obj['count'] === 'number') {
|
|
98
|
+
recordCount = obj['count'];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
// Not JSON — that's fine
|
|
104
|
+
}
|
|
105
|
+
return {
|
|
106
|
+
url,
|
|
107
|
+
status: 'ok',
|
|
108
|
+
statusCode: response.status,
|
|
109
|
+
recordCount,
|
|
110
|
+
durationMs,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (err) {
|
|
114
|
+
const durationMs = Date.now() - start;
|
|
115
|
+
const message = err instanceof Error ? err.message : 'Unknown error';
|
|
116
|
+
return {
|
|
117
|
+
url,
|
|
118
|
+
status: 'error',
|
|
119
|
+
error: message,
|
|
120
|
+
durationMs,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Test connection endpoints sequentially. Never throws.
|
|
126
|
+
*/
|
|
127
|
+
export async function testConnection(options) {
|
|
128
|
+
const { connectionName, testEndpoints, envFilePath, auth, timeoutMs = DEFAULT_TIMEOUT_MS, } = options;
|
|
129
|
+
const envVars = await readEnvFile(envFilePath);
|
|
130
|
+
const headers = buildAuthHeaders(auth, envVars);
|
|
131
|
+
const results = [];
|
|
132
|
+
for (const endpoint of testEndpoints) {
|
|
133
|
+
const url = resolveEndpointUrl(endpoint, envVars);
|
|
134
|
+
process.stderr.write(` Testing ${url} ... `);
|
|
135
|
+
const result = await testSingleEndpoint(url, headers, timeoutMs);
|
|
136
|
+
if (result.status === 'ok') {
|
|
137
|
+
const countInfo = result.recordCount !== undefined
|
|
138
|
+
? ` (${result.recordCount} records)`
|
|
139
|
+
: '';
|
|
140
|
+
process.stderr.write(`OK ${result.statusCode}${countInfo} [${result.durationMs}ms]\n`);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
process.stderr.write(`FAILED ${result.error ?? 'unknown'} [${result.durationMs}ms]\n`);
|
|
144
|
+
}
|
|
145
|
+
results.push(result);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
connectionName,
|
|
149
|
+
results,
|
|
150
|
+
allPassed: results.every((r) => r.status === 'ok'),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=test-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-connection.js","sourceRoot":"","sources":["../../../src/auth/test-connection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAa3C,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAW,EACX,OAA4B;IAE5B,OAAO,GAAG,CAAC,OAAO,CAAC,gDAAgD,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QAC5F,oH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AC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Result returned by oauth2 and credential prompt flows.
|
|
8
|
+
*/
|
|
9
|
+
export interface AuthResult {
|
|
10
|
+
credentials: Record<string, string>;
|
|
11
|
+
summary: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Per-endpoint test result.
|
|
15
|
+
*/
|
|
16
|
+
export interface EndpointTestResult {
|
|
17
|
+
url: string;
|
|
18
|
+
status: 'ok' | 'error';
|
|
19
|
+
statusCode?: number;
|
|
20
|
+
recordCount?: number;
|
|
21
|
+
error?: string;
|
|
22
|
+
durationMs: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Aggregated connection test report.
|
|
26
|
+
*/
|
|
27
|
+
export interface ConnectionTestReport {
|
|
28
|
+
connectionName: string;
|
|
29
|
+
results: EndpointTestResult[];
|
|
30
|
+
allPassed: boolean;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/auth/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,SAAS,EAAE,OAAO,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/auth/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandModule } from 'yargs';
|
|
7
|
+
export interface AuditOptions {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
format?: 'json' | 'table';
|
|
10
|
+
platformUrl?: string;
|
|
11
|
+
platformApiKey?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve audit trail for a session from the platform.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runAudit(options: AuditOptions): Promise<void>;
|
|
17
|
+
export declare const auditCommand: CommandModule;
|
|
18
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/commands/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAGzC,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEnE;AAED,eAAO,MAAM,YAAY,EAAE,aAuB1B,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
* Retrieve audit trail for a session from the platform.
|
|
9
|
+
*/
|
|
10
|
+
export async function runAudit(options) {
|
|
11
|
+
let platformUrl;
|
|
12
|
+
let apiKey;
|
|
13
|
+
try {
|
|
14
|
+
const config = await resolvePlatformConfig({
|
|
15
|
+
url: options.platformUrl,
|
|
16
|
+
apiKey: options.platformApiKey,
|
|
17
|
+
});
|
|
18
|
+
platformUrl = config.url;
|
|
19
|
+
apiKey = config.apiKey;
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
23
|
+
process.stderr.write(`[audit] ${msg}\n`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch(`${platformUrl}/api/audit/sessions/${options.sessionId}`, {
|
|
28
|
+
headers: { 'Authorization': `Bearer ${apiKey}` },
|
|
29
|
+
});
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
process.stderr.write(`[audit] HTTP ${response.status}: ${await response.text()}\n`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- platform response
|
|
35
|
+
const data = await response.json();
|
|
36
|
+
if (options.format === 'json') {
|
|
37
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
// Table format
|
|
41
|
+
const events = data.events;
|
|
42
|
+
if (events.length === 0) {
|
|
43
|
+
process.stdout.write('No audit events found for this session.\n');
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const typeWidth = Math.max(10, ...events.map((e) => e.eventType.length));
|
|
47
|
+
process.stdout.write(`\nSession: ${data.sessionId}\n`);
|
|
48
|
+
process.stdout.write(`${'Type'.padEnd(typeWidth)} ${'Time'.padEnd(24)} Details\n`);
|
|
49
|
+
process.stdout.write('-'.repeat(typeWidth + 50) + '\n');
|
|
50
|
+
for (const event of events) {
|
|
51
|
+
const time = event.createdAt.slice(0, 24);
|
|
52
|
+
const details = event.durationMs ? `${event.durationMs}ms` : '';
|
|
53
|
+
process.stdout.write(`${event.eventType.padEnd(typeWidth)} ${time.padEnd(24)} ${details}\n`);
|
|
54
|
+
}
|
|
55
|
+
process.stdout.write(`\nTotal: ${events.length} events\n`);
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
59
|
+
process.stderr.write(`[audit] Error: ${msg}\n`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export const auditCommand = {
|
|
64
|
+
command: 'audit <session-id>',
|
|
65
|
+
describe: 'View audit trail for a session',
|
|
66
|
+
builder: (yargs) => yargs
|
|
67
|
+
.positional('session-id', {
|
|
68
|
+
type: 'string',
|
|
69
|
+
demandOption: true,
|
|
70
|
+
describe: 'The session ID to retrieve audit events for',
|
|
71
|
+
})
|
|
72
|
+
.option('format', {
|
|
73
|
+
type: 'string',
|
|
74
|
+
choices: ['json', 'table'],
|
|
75
|
+
default: 'table',
|
|
76
|
+
describe: 'Output format',
|
|
77
|
+
}),
|
|
78
|
+
handler: async (argv) => {
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
80
|
+
const sessionId = argv['sessionId'];
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
82
|
+
const format = argv['format'];
|
|
83
|
+
await runAudit({ sessionId, format });
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../src/commands/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,qBAAqB,EAAC,MAAM,8BAA8B,CAAC;AASnE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,OAAqB;IAClD,IAAI,WAAmB,CAAC;IACxB,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC;YACzC,GAAG,EAAE,OAAO,CAAC,WAAW;YACxB,MAAM,EAAE,OAAO,CAAC,cAAc;SAC/B,CAAC,CAAC;QACH,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC;QACzB,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACzB,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,WAAW,GAAG,IAAI,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,WAAW,uBAAuB,OAAO,CAAC,SAAS,EAAE,EAAE;YACrF,OAAO,EAAE,EAAC,eAAe,EAAE,UAAU,MAAM,EAAE,EAAC;SAC/C,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,OAAO,CAAC,MAAM,CAAC,KAAK,CA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uE;QACvE,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAW,CAAC;QAC9C,uEAAuE;QACvE,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAqB,CAAC;QAClD,MAAM,QAAQ,CAAC,EAAC,SAAS,EAAE,MAAM,EAAC,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { CommandModule } from 'yargs';
|
|
7
|
+
export interface AutomationsOptions {
|
|
8
|
+
url?: string;
|
|
9
|
+
json?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* List automations from a running server.
|
|
13
|
+
*/
|
|
14
|
+
export declare function runAutomationsList(options?: AutomationsOptions): Promise<number>;
|
|
15
|
+
/**
|
|
16
|
+
* Start a cron automation on a running server.
|
|
17
|
+
*/
|
|
18
|
+
export declare function runAutomationsStart(name: string, options?: AutomationsOptions): Promise<number>;
|
|
19
|
+
/**
|
|
20
|
+
* Stop a running cron automation on a running server.
|
|
21
|
+
*/
|
|
22
|
+
export declare function runAutomationsStop(name: string, options?: AutomationsOptions): Promise<number>;
|
|
23
|
+
/**
|
|
24
|
+
* Manually trigger an automation on a running server.
|
|
25
|
+
*/
|
|
26
|
+
export declare function runAutomationsRun(name: string, options?: AutomationsOptions): Promise<number>;
|
|
27
|
+
export declare const automationsCommand: CommandModule;
|
|
28
|
+
//# sourceMappingURL=automations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.d.ts","sourceRoot":"","sources":["../../../src/commands/automations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,OAAO,CAAC;AAuBzC,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAmD1F;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWzG;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWxG;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,CAWvG;AAED,eAAO,MAAM,kBAAkB,EAAE,aAkEhC,CAAC"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
const DEFAULT_URL = 'http://localhost:3847';
|
|
7
|
+
async function fetchJson(url, method = 'GET') {
|
|
8
|
+
const res = await fetch(url, { method });
|
|
9
|
+
const body = await res.json();
|
|
10
|
+
if (!res.ok) {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- JSON response
|
|
12
|
+
const err = body['error'] ?? res.statusText;
|
|
13
|
+
throw new Error(String(err));
|
|
14
|
+
}
|
|
15
|
+
return body;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* List automations from a running server.
|
|
19
|
+
*/
|
|
20
|
+
export async function runAutomationsList(options = {}) {
|
|
21
|
+
const base = options.url ?? DEFAULT_URL;
|
|
22
|
+
try {
|
|
23
|
+
const data = await fetchJson(`${base}/automations`);
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- JSON response
|
|
25
|
+
const automations = data.automations;
|
|
26
|
+
if (automations.length === 0) {
|
|
27
|
+
process.stderr.write('[automations] No automations defined.\n');
|
|
28
|
+
return 0;
|
|
29
|
+
}
|
|
30
|
+
if (options.json) {
|
|
31
|
+
process.stdout.write(JSON.stringify(automations, null, 2) + '\n');
|
|
32
|
+
return 0;
|
|
33
|
+
}
|
|
34
|
+
const nameW = Math.max(4, ...automations.map((a) => a.name.length));
|
|
35
|
+
const titleW = Math.max(5, ...automations.map((a) => a.title.length));
|
|
36
|
+
const typeW = 8;
|
|
37
|
+
const statusW = 7;
|
|
38
|
+
const header = [
|
|
39
|
+
'NAME'.padEnd(nameW),
|
|
40
|
+
'TITLE'.padEnd(titleW),
|
|
41
|
+
'TYPE'.padEnd(typeW),
|
|
42
|
+
'STATUS'.padEnd(statusW),
|
|
43
|
+
'SCHEDULE',
|
|
44
|
+
].join(' ');
|
|
45
|
+
process.stdout.write(header + '\n');
|
|
46
|
+
for (const a of automations) {
|
|
47
|
+
const type = a.webhookTriggered ? 'webhook' : 'cron';
|
|
48
|
+
const status = a.running ? 'running' : 'stopped';
|
|
49
|
+
const row = [
|
|
50
|
+
a.name.padEnd(nameW),
|
|
51
|
+
a.title.padEnd(titleW),
|
|
52
|
+
type.padEnd(typeW),
|
|
53
|
+
status.padEnd(statusW),
|
|
54
|
+
a.schedule ?? '-',
|
|
55
|
+
].join(' ');
|
|
56
|
+
process.stdout.write(row + '\n');
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
62
|
+
process.stderr.write(`[automations] ${msg}\n`);
|
|
63
|
+
return 1;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Start a cron automation on a running server.
|
|
68
|
+
*/
|
|
69
|
+
export async function runAutomationsStart(name, options = {}) {
|
|
70
|
+
const base = options.url ?? DEFAULT_URL;
|
|
71
|
+
try {
|
|
72
|
+
await fetchJson(`${base}/automations/${encodeURIComponent(name)}/start`, 'POST');
|
|
73
|
+
process.stderr.write(`[automations] Started "${name}"\n`);
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
78
|
+
process.stderr.write(`[automations] ${msg}\n`);
|
|
79
|
+
return 1;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Stop a running cron automation on a running server.
|
|
84
|
+
*/
|
|
85
|
+
export async function runAutomationsStop(name, options = {}) {
|
|
86
|
+
const base = options.url ?? DEFAULT_URL;
|
|
87
|
+
try {
|
|
88
|
+
await fetchJson(`${base}/automations/${encodeURIComponent(name)}/stop`, 'POST');
|
|
89
|
+
process.stderr.write(`[automations] Stopped "${name}"\n`);
|
|
90
|
+
return 0;
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
94
|
+
process.stderr.write(`[automations] ${msg}\n`);
|
|
95
|
+
return 1;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Manually trigger an automation on a running server.
|
|
100
|
+
*/
|
|
101
|
+
export async function runAutomationsRun(name, options = {}) {
|
|
102
|
+
const base = options.url ?? DEFAULT_URL;
|
|
103
|
+
try {
|
|
104
|
+
await fetchJson(`${base}/automations/${encodeURIComponent(name)}/run`, 'POST');
|
|
105
|
+
process.stderr.write(`[automations] Triggered "${name}"\n`);
|
|
106
|
+
return 0;
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
110
|
+
process.stderr.write(`[automations] ${msg}\n`);
|
|
111
|
+
return 1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
export const automationsCommand = {
|
|
115
|
+
command: 'automations <action> [name]',
|
|
116
|
+
describe: 'Manage automations on a running server',
|
|
117
|
+
builder: (yargs) => yargs
|
|
118
|
+
.positional('action', {
|
|
119
|
+
type: 'string',
|
|
120
|
+
choices: ['list', 'start', 'stop', 'run'],
|
|
121
|
+
describe: 'Action to perform',
|
|
122
|
+
})
|
|
123
|
+
.positional('name', {
|
|
124
|
+
type: 'string',
|
|
125
|
+
describe: 'Automation name (required for start/stop/run)',
|
|
126
|
+
})
|
|
127
|
+
.option('url', {
|
|
128
|
+
type: 'string',
|
|
129
|
+
describe: `Server URL (default: ${DEFAULT_URL})`,
|
|
130
|
+
})
|
|
131
|
+
.option('json', {
|
|
132
|
+
type: 'boolean',
|
|
133
|
+
default: false,
|
|
134
|
+
describe: 'Output as JSON (list only)',
|
|
135
|
+
}),
|
|
136
|
+
handler: async (argv) => {
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
138
|
+
const action = argv['action'];
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
140
|
+
const name = argv['name'];
|
|
141
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
142
|
+
const url = argv['url'];
|
|
143
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
|
144
|
+
const json = argv['json'];
|
|
145
|
+
let code;
|
|
146
|
+
switch (action) {
|
|
147
|
+
case 'list':
|
|
148
|
+
code = await runAutomationsList({ url, json });
|
|
149
|
+
break;
|
|
150
|
+
case 'start':
|
|
151
|
+
if (!name) {
|
|
152
|
+
process.stderr.write('[automations] Name required for start\n');
|
|
153
|
+
process.exit(1);
|
|
154
|
+
}
|
|
155
|
+
code = await runAutomationsStart(name, { url });
|
|
156
|
+
break;
|
|
157
|
+
case 'stop':
|
|
158
|
+
if (!name) {
|
|
159
|
+
process.stderr.write('[automations] Name required for stop\n');
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
code = await runAutomationsStop(name, { url });
|
|
163
|
+
break;
|
|
164
|
+
case 'run':
|
|
165
|
+
if (!name) {
|
|
166
|
+
process.stderr.write('[automations] Name required for run\n');
|
|
167
|
+
process.exit(1);
|
|
168
|
+
}
|
|
169
|
+
code = await runAutomationsRun(name, { url });
|
|
170
|
+
break;
|
|
171
|
+
default:
|
|
172
|
+
process.stderr.write(`[automations] Unknown action: ${action}\n`);
|
|
173
|
+
code = 1;
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
process.exit(code);
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=automations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automations.js","sourceRoot":"","sources":["../../../src/commands/automations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAU5C,KAAK,UAAU,SAAS,CAAC,GAAW,EAAE,SAAyB,KAAK;IAClE,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAC,MAAM,EAAC,CAAC,CAAC;IACvC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,wFAAwF;QACxF,MAAM,GAAG,GAAI,IAAgC,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC;QACzE,MAAM,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAOD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,UAA8B,EAAE;IACvE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,IAAI,WAAW,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,SAAS,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC;QACpD,wFAAwF;QACxF,MAA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 -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Schema for a single tool entry in the build manifest.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BuildManifestToolSchema: z.ZodObject<{
|
|
11
|
+
snapshotId: z.ZodString;
|
|
12
|
+
imageHash: z.ZodString;
|
|
13
|
+
sandboxLanguage: z.ZodDefault<z.ZodString>;
|
|
14
|
+
hasDockerfile: z.ZodDefault<z.ZodBoolean>;
|
|
15
|
+
hasSetupScript: z.ZodDefault<z.ZodBoolean>;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
/**
|
|
18
|
+
* Schema for .amodal/build-manifest.json.
|
|
19
|
+
*/
|
|
20
|
+
export declare const BuildManifestSchema: z.ZodObject<{
|
|
21
|
+
version: z.ZodLiteral<1>;
|
|
22
|
+
builtAt: z.ZodString;
|
|
23
|
+
tools: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
24
|
+
snapshotId: z.ZodString;
|
|
25
|
+
imageHash: z.ZodString;
|
|
26
|
+
sandboxLanguage: z.ZodDefault<z.ZodString>;
|
|
27
|
+
hasDockerfile: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
hasSetupScript: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
export type BuildManifest = z.infer<typeof BuildManifestSchema>;
|
|
32
|
+
export type BuildManifestTool = z.infer<typeof BuildManifestToolSchema>;
|
|
33
|
+
//# sourceMappingURL=build-manifest-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-manifest-types.d.ts","sourceRoot":"","sources":["../../../src/commands/build-manifest-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;iBAWlC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
/**
|
|
8
|
+
* Schema for a single tool entry in the build manifest.
|
|
9
|
+
*/
|
|
10
|
+
export const BuildManifestToolSchema = z.object({
|
|
11
|
+
/** Daytona snapshot ID for fast workspace creation */
|
|
12
|
+
snapshotId: z.string().min(1),
|
|
13
|
+
/** Content hash of the tool's source files */
|
|
14
|
+
imageHash: z.string().min(1),
|
|
15
|
+
/** Sandbox language runtime */
|
|
16
|
+
sandboxLanguage: z.string().default('typescript'),
|
|
17
|
+
/** Whether the tool was built from a Dockerfile */
|
|
18
|
+
hasDockerfile: z.boolean().default(false),
|
|
19
|
+
/** Whether the tool has a setup.sh script */
|
|
20
|
+
hasSetupScript: z.boolean().default(false),
|
|
21
|
+
});
|
|
22
|
+
/**
|
|
23
|
+
* Schema for .amodal/build-manifest.json.
|
|
24
|
+
*/
|
|
25
|
+
export const BuildManifestSchema = z.object({
|
|
26
|
+
version: z.literal(1),
|
|
27
|
+
builtAt: z.string().datetime(),
|
|
28
|
+
tools: z.record(z.string(), BuildManifestToolSchema),
|
|
29
|
+
});
|
|
30
|
+
//# sourceMappingURL=build-manifest-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-manifest-types.js","sourceRoot":"","sources":["../../../src/commands/build-manifest-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,sDAAsD;IACtD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,8CAA8C;IAC9C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,+BAA+B;IAC/B,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IACjD,mDAAmD;IACnD,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACzC,6CAA6C;IAC7C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;CAC3C,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACrB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,uBAAuB,CAAC;CACrD,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Amodal Labs, Inc.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import type { LoadedTool } from '@amodalai/core';
|
|
7
|
+
import type { BuildManifest } from './build-manifest-types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Recursively list all files in a directory, returning paths relative to root.
|
|
10
|
+
* Skips node_modules, .git, __pycache__.
|
|
11
|
+
*/
|
|
12
|
+
export declare function listFilesRecursive(dir: string, root?: string): string[];
|
|
13
|
+
/**
|
|
14
|
+
* Create a tar.gz archive of the tool directory.
|
|
15
|
+
* Excludes node_modules, .git, __pycache__, etc.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createToolArchive(tool: LoadedTool): Buffer;
|
|
18
|
+
/**
|
|
19
|
+
* Build Daytona sandbox snapshots for custom tools.
|
|
20
|
+
*
|
|
21
|
+
* For each tool:
|
|
22
|
+
* 1. Compute a content hash of all files in the tool directory
|
|
23
|
+
* 2. If hash matches existing manifest entry, skip (cached)
|
|
24
|
+
* 3. Otherwise, upload to the platform API which builds the image
|
|
25
|
+
* and creates the Daytona snapshot using the platform's Daytona key
|
|
26
|
+
*
|
|
27
|
+
* The ISV never touches Daytona directly. The platform owns the infra.
|
|
28
|
+
*
|
|
29
|
+
* Writes .amodal/build-manifest.json locally for caching.
|
|
30
|
+
* The manifest is also included in the deploy snapshot.
|
|
31
|
+
*/
|
|
32
|
+
export declare function buildToolTemplates(repoPath: string, tools: LoadedTool[]): Promise<BuildManifest>;
|
|
33
|
+
//# sourceMappingURL=build-tools.d.ts.map
|