@devries-cameron20 / composio Mirror · read-only
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

Mirrored from https://github.com/Camo67/composio.git

Synced Nov 21, 04:45 UTC

next
ts 22 lines 813 Bytes
Raw
1 import { Effect, Option } from 'effect';
2 import {
3 resolveArtifactsRoot,
4 resolveCliSessionArtifacts,
5 } from 'src/services/cli-session-artifacts';
6 import { TerminalUI } from 'src/services/terminal-ui';
7
8 /**
9 * Prints the artifact directory of the CLI session bound to the current directory, or the
10 * artifacts root when no session is bound. The path is data, so it is written even when stdout
11 * is a terminal.
12 */
13 export const runArtifactsCwd = () =>
14 Effect.gen(function* () {
15 const ui = yield* TerminalUI;
16 const artifacts = yield* resolveCliSessionArtifacts();
17 const directoryPath = yield* Option.match(artifacts, {
18 onSome: ({ directoryPath }) => Effect.succeed(directoryPath),
19 onNone: () => resolveArtifactsRoot,
20 });
21 yield* ui.output(directoryPath, { force: true });
22 });