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 | export const removeNodeModulesEntriesFromStack = (stack: string) => { |
| 2 | const lines = stack.split('\r\n'); |
| 3 | |
| 4 | return lines.filter(line => line.includes(process.cwd()) && !line.includes('/node_modules/')); |
| 5 | }; |
| 6 | |
| 7 | export const maybeAddErrorToSpansStack = ( |
| 8 | stack: string | undefined, |
| 9 | spanAttributesStack: string[] | undefined |
| 10 | ) => { |
| 11 | const effectStack: string[] = []; |
| 12 | |
| 13 | if (stack && spanAttributesStack !== undefined) { |
| 14 | effectStack.push(...removeNodeModulesEntriesFromStack(stack)); |
| 15 | } |
| 16 | if (spanAttributesStack !== undefined) { |
| 17 | effectStack.push(...spanAttributesStack); |
| 18 | } |
| 19 | |
| 20 | return effectStack; |
| 21 | }; |