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

next
ts 28 lines 947 Bytes
Raw
1 import { Data } from 'effect';
2
3 import type { ErrorLocation } from './get-error-location-from-file-path';
4 import type { SourceCode } from './get-source-code';
5
6 export type MaybeMappedSources = Data.TaggedEnum<{
7 sources: {
8 readonly name: string;
9 readonly source: SourceCode[];
10 readonly runPath: string;
11 readonly sourcesPath: string | undefined;
12 };
13 location: ErrorLocation & {
14 readonly name: string;
15 };
16 'stack-entry': {
17 readonly runPath: string;
18 };
19 }>;
20
21 export const MappedSources = Data.taggedEnum<MaybeMappedSources>();
22
23 export type ErrorRelatedSources = Data.TaggedEnum.Value<MaybeMappedSources, 'sources'>;
24 export type RawErrorLocation = Data.TaggedEnum.Value<MaybeMappedSources, 'location'>;
25 export type StackEntry = Data.TaggedEnum.Value<MaybeMappedSources, 'stack-entry'>;
26
27 export const isErrorRelatedSources = MappedSources.$is('sources');
28 export const isRawErrorLocation = MappedSources.$is('location');