@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 104 lines 2.63 KB
Raw
1 import { Argument, Command, Flag } from 'effect/cli';
2 import { runLogsTools } from './logs.tools.handler';
3
4 const cursor = Flag.String('cursor').pipe(
5 Flag.optional,
6 Flag.withDescription('Cursor for pagination')
7 );
8
9 const from = Flag.Int('from').pipe(
10 Flag.withDescription('Start timestamp (epoch milliseconds)'),
11 Flag.optional
12 );
13
14 const to = Flag.Int('to').pipe(
15 Flag.withDescription('End timestamp (epoch milliseconds)'),
16 Flag.optional
17 );
18
19 const limit = Flag.Int('limit').pipe(
20 Flag.withDefault(30),
21 Flag.withDescription('Number of logs to fetch (1-100)')
22 );
23
24 const caseSensitive = Flag.Boolean('case-sensitive').pipe(
25 Flag.withDefault(false),
26 Flag.withDescription('Unsupported by the public API; use case-insensitive search')
27 );
28
29 const toolkit = Flag.String('toolkit').pipe(
30 Flag.withDescription('Filter by one toolkit key (e.g. "gmail")'),
31 Flag.optional
32 );
33
34 const tool = Flag.String('tool').pipe(
35 Flag.withDescription('Filter by one tool key (e.g. "GMAIL_SEND_EMAIL")'),
36 Flag.optional
37 );
38
39 const connectedAccountId = Flag.String('connected-account-id').pipe(
40 Flag.withDescription('Filter by one connected account id'),
41 Flag.optional
42 );
43
44 const authConfigId = Flag.String('auth-config-id').pipe(
45 Flag.withDescription('Filter by one auth config id'),
46 Flag.optional
47 );
48
49 const status = Flag.String('status').pipe(
50 Flag.withDescription('Filter by success or failed'),
51 Flag.optional
52 );
53
54 // Declared for its help row, which documents the user filter in place of the `dev`
55 // group's shared row. The parser hands every `--user-id` under `dev` to the shared flag, so
56 // the value is read from `CommandSurface`.
57 const userId = Flag.String('user-id').pipe(
58 Flag.withDescription('Filter by one user id'),
59 Flag.optional
60 );
61
62 const logIdFilter = Flag.String('log-id').pipe(
63 Flag.withDescription('Filter by one log id'),
64 Flag.optional
65 );
66
67 const toolRouterSessionId = Flag.String('tool-router-session-id').pipe(
68 Flag.withDescription('Filter by one tool router session id'),
69 Flag.optional
70 );
71
72 const sessionId = Flag.String('session-id').pipe(
73 Flag.withDescription('Legacy session filter (unsupported by the public API)'),
74 Flag.optional
75 );
76
77 const logId = Argument.String('log_id').pipe(
78 Argument.withDescription('Tool log ID'),
79 Argument.optional
80 );
81
82 export const logsCmd$Tools = Command.make(
83 'tools',
84 {
85 logId,
86 cursor,
87 from,
88 to,
89 limit,
90 caseSensitive,
91 toolkit,
92 tool,
93 connectedAccountId,
94 authConfigId,
95 status,
96 userId,
97 logIdFilter,
98 toolRouterSessionId,
99 sessionId,
100 },
101 runLogsTools
102 ).pipe(
103 Command.withDescription('List tool execution logs, or pass a log_id to fetch a specific log.')
104 );