Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | import { Effect, Layer } from 'effect'; |
| 2 | import type { CommandRunnerShape } from 'src/services/command-runner'; |
| 3 | import { |
| 4 | SetupSkillInstaller, |
| 5 | type SetupSkillInstallerShape, |
| 6 | } from 'src/services/setup-skill-installer'; |
| 7 | import { CommandRunnerTest } from './command-runner'; |
| 8 | |
| 9 | /** |
| 10 | * An installer with no Claude skill that changes nothing: every check and |
| 11 | * every install or removal answers `false`, however often it runs. |
| 12 | */ |
| 13 | const noOpSetupSkillInstaller = SetupSkillInstaller.of({ |
| 14 | isClaudeSkillReady: Effect.succeed(false), |
| 15 | hasManagedClaudeSkill: Effect.succeed(false), |
| 16 | ensureClaudeSkill: Effect.succeed(false), |
| 17 | removeClaudeSkill: Effect.succeed(false), |
| 18 | }); |
| 19 | |
| 20 | /** |
| 21 | * A `SetupSkillInstaller` that answers with `installer`, or the no-op one |
| 22 | * when the test leaves it out. |
| 23 | */ |
| 24 | export const SetupSkillInstallerTest = (installer?: SetupSkillInstallerShape) => |
| 25 | Layer.succeed(SetupSkillInstaller, installer ?? noOpSetupSkillInstaller); |
| 26 | |
| 27 | /** |
| 28 | * The host commands `setup` runs and the Claude skill it installs, for a |
| 29 | * test that needs nothing else from the full `TestLive` layer. |
| 30 | */ |
| 31 | export const SetupTest = (data?: { |
| 32 | readonly commandRunner?: CommandRunnerShape; |
| 33 | readonly setupSkillInstaller?: SetupSkillInstallerShape; |
| 34 | }) => |
| 35 | Layer.mergeAll( |
| 36 | CommandRunnerTest(data?.commandRunner), |
| 37 | SetupSkillInstallerTest(data?.setupSkillInstaller) |
| 38 | ); |