langwatch 0.2.0 → 0.3.0-prerelease.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/.editorconfig +16 -0
  2. package/LICENSE +7 -0
  3. package/README.md +268 -1
  4. package/copy-types.sh +19 -8
  5. package/examples/langchain/.env.example +2 -0
  6. package/examples/langchain/README.md +42 -0
  7. package/examples/langchain/package-lock.json +2930 -0
  8. package/examples/langchain/package.json +27 -0
  9. package/examples/langchain/src/cli-markdown.d.ts +137 -0
  10. package/examples/langchain/src/index.ts +109 -0
  11. package/examples/langchain/tsconfig.json +25 -0
  12. package/examples/langgraph/.env.example +2 -0
  13. package/examples/langgraph/README.md +42 -0
  14. package/examples/langgraph/package-lock.json +3031 -0
  15. package/examples/langgraph/package.json +28 -0
  16. package/examples/langgraph/src/cli-markdown.d.ts +137 -0
  17. package/examples/langgraph/src/index.ts +196 -0
  18. package/examples/langgraph/tsconfig.json +25 -0
  19. package/examples/mastra/.env.example +2 -0
  20. package/examples/mastra/README.md +57 -0
  21. package/examples/mastra/package-lock.json +5296 -0
  22. package/examples/mastra/package.json +32 -0
  23. package/examples/mastra/src/cli-markdown.d.ts +137 -0
  24. package/examples/mastra/src/index.ts +120 -0
  25. package/examples/mastra/src/mastra/agents/weather-agent.ts +30 -0
  26. package/examples/mastra/src/mastra/index.ts +21 -0
  27. package/examples/mastra/src/mastra/tools/weather-tool.ts +102 -0
  28. package/examples/mastra/tsconfig.json +25 -0
  29. package/examples/vercel-ai/.env.example +2 -0
  30. package/examples/vercel-ai/README.md +38 -0
  31. package/examples/vercel-ai/package-lock.json +2571 -0
  32. package/examples/vercel-ai/package.json +27 -0
  33. package/examples/vercel-ai/src/cli-markdown.d.ts +137 -0
  34. package/examples/vercel-ai/src/index.ts +110 -0
  35. package/examples/vercel-ai/src/instrumentation.ts +9 -0
  36. package/examples/vercel-ai/tsconfig.json +25 -0
  37. package/package.json +78 -34
  38. package/src/__tests__/client-browser.test.ts +92 -0
  39. package/src/__tests__/client-node.test.ts +76 -0
  40. package/src/__tests__/client.test.ts +71 -0
  41. package/src/__tests__/integration/client-browser.test.ts +46 -0
  42. package/src/__tests__/integration/client-node.test.ts +46 -0
  43. package/src/client-browser.ts +70 -0
  44. package/src/client-node.ts +82 -0
  45. package/src/client-shared.ts +72 -0
  46. package/src/client.ts +119 -0
  47. package/src/evaluation/__tests__/record-evaluation.test.ts +112 -0
  48. package/src/evaluation/__tests__/run-evaluation.test.ts +171 -0
  49. package/src/evaluation/index.ts +2 -0
  50. package/src/evaluation/record-evaluation.ts +101 -0
  51. package/src/evaluation/run-evaluation.ts +133 -0
  52. package/src/evaluation/tracer.ts +3 -0
  53. package/src/evaluation/types.ts +23 -0
  54. package/src/index.ts +10 -593
  55. package/src/internal/api/__tests__/errors.test.ts +98 -0
  56. package/src/internal/api/client.ts +30 -0
  57. package/src/internal/api/errors.ts +32 -0
  58. package/src/internal/generated/types/.gitkeep +0 -0
  59. package/src/observability/__tests__/integration/base.test.ts +74 -0
  60. package/src/observability/__tests__/integration/browser-setup-ordering.test.ts +60 -0
  61. package/src/observability/__tests__/integration/complex-nested-spans.test.ts +29 -0
  62. package/src/observability/__tests__/integration/error-handling.test.ts +24 -0
  63. package/src/observability/__tests__/integration/langwatch-disabled-otel.test.ts +24 -0
  64. package/src/observability/__tests__/integration/langwatch-first-then-vercel.test.ts +24 -0
  65. package/src/observability/__tests__/integration/multiple-setup-attempts.test.ts +27 -0
  66. package/src/observability/__tests__/integration/otel-ordering.test.ts +27 -0
  67. package/src/observability/__tests__/integration/vercel-configurations.test.ts +20 -0
  68. package/src/observability/__tests__/integration/vercel-first-then-langwatch.test.ts +27 -0
  69. package/src/observability/__tests__/span.test.ts +214 -0
  70. package/src/observability/__tests__/trace.test.ts +180 -0
  71. package/src/observability/exporters/index.ts +1 -0
  72. package/src/observability/exporters/langwatch-exporter.ts +53 -0
  73. package/src/observability/index.ts +4 -0
  74. package/src/observability/instrumentation/langchain/__tests__/integration/langchain-chatbot.test.ts +112 -0
  75. package/src/observability/instrumentation/langchain/__tests__/langchain.test.ts +284 -0
  76. package/src/observability/instrumentation/langchain/index.ts +624 -0
  77. package/src/observability/processors/__tests__/filterable-batch-span-exporter.test.ts +98 -0
  78. package/src/observability/processors/filterable-batch-span-processor.ts +99 -0
  79. package/src/observability/processors/index.ts +1 -0
  80. package/src/observability/semconv/attributes.ts +185 -0
  81. package/src/observability/semconv/events.ts +42 -0
  82. package/src/observability/semconv/index.ts +16 -0
  83. package/src/observability/semconv/values.ts +159 -0
  84. package/src/observability/span.ts +728 -0
  85. package/src/observability/trace.ts +301 -0
  86. package/src/prompt/__tests__/prompt.test.ts +139 -0
  87. package/src/prompt/get-prompt-version.ts +49 -0
  88. package/src/prompt/get-prompt.ts +44 -0
  89. package/src/prompt/index.ts +3 -0
  90. package/src/prompt/prompt.ts +133 -0
  91. package/src/prompt/service.ts +221 -0
  92. package/src/prompt/tracer.ts +3 -0
  93. package/src/prompt/types.ts +0 -0
  94. package/ts-to-zod.config.js +11 -0
  95. package/tsconfig.json +3 -9
  96. package/tsup.config.ts +11 -1
  97. package/vitest.config.ts +1 -0
  98. package/dist/chunk-LKD2K67J.mjs +0 -717
  99. package/dist/chunk-LKD2K67J.mjs.map +0 -1
  100. package/dist/index.d.mts +0 -1030
  101. package/dist/index.d.ts +0 -1030
  102. package/dist/index.js +0 -27310
  103. package/dist/index.js.map +0 -1
  104. package/dist/index.mjs +0 -963
  105. package/dist/index.mjs.map +0 -1
  106. package/dist/utils-Cv-rUjJ1.d.mts +0 -313
  107. package/dist/utils-Cv-rUjJ1.d.ts +0 -313
  108. package/dist/utils.d.mts +0 -2
  109. package/dist/utils.d.ts +0 -2
  110. package/dist/utils.js +0 -709
  111. package/dist/utils.js.map +0 -1
  112. package/dist/utils.mjs +0 -11
  113. package/dist/utils.mjs.map +0 -1
  114. package/example/.env.example +0 -12
  115. package/example/.eslintrc.json +0 -26
  116. package/example/LICENSE +0 -13
  117. package/example/README.md +0 -12
  118. package/example/app/(chat)/chat/[id]/page.tsx +0 -60
  119. package/example/app/(chat)/layout.tsx +0 -14
  120. package/example/app/(chat)/page.tsx +0 -27
  121. package/example/app/actions.ts +0 -156
  122. package/example/app/globals.css +0 -76
  123. package/example/app/guardrails/page.tsx +0 -26
  124. package/example/app/langchain/page.tsx +0 -27
  125. package/example/app/langchain-rag/page.tsx +0 -28
  126. package/example/app/late-update/page.tsx +0 -27
  127. package/example/app/layout.tsx +0 -64
  128. package/example/app/login/actions.ts +0 -71
  129. package/example/app/login/page.tsx +0 -18
  130. package/example/app/manual/page.tsx +0 -27
  131. package/example/app/new/page.tsx +0 -5
  132. package/example/app/opengraph-image.png +0 -0
  133. package/example/app/share/[id]/page.tsx +0 -58
  134. package/example/app/signup/actions.ts +0 -111
  135. package/example/app/signup/page.tsx +0 -18
  136. package/example/app/twitter-image.png +0 -0
  137. package/example/auth.config.ts +0 -42
  138. package/example/auth.ts +0 -45
  139. package/example/components/button-scroll-to-bottom.tsx +0 -36
  140. package/example/components/chat-history.tsx +0 -49
  141. package/example/components/chat-list.tsx +0 -52
  142. package/example/components/chat-message-actions.tsx +0 -40
  143. package/example/components/chat-message.tsx +0 -80
  144. package/example/components/chat-panel.tsx +0 -139
  145. package/example/components/chat-share-dialog.tsx +0 -95
  146. package/example/components/chat.tsx +0 -84
  147. package/example/components/clear-history.tsx +0 -75
  148. package/example/components/empty-screen.tsx +0 -38
  149. package/example/components/external-link.tsx +0 -29
  150. package/example/components/footer.tsx +0 -19
  151. package/example/components/header.tsx +0 -114
  152. package/example/components/login-button.tsx +0 -42
  153. package/example/components/login-form.tsx +0 -97
  154. package/example/components/markdown.tsx +0 -9
  155. package/example/components/prompt-form.tsx +0 -115
  156. package/example/components/providers.tsx +0 -17
  157. package/example/components/sidebar-actions.tsx +0 -125
  158. package/example/components/sidebar-desktop.tsx +0 -19
  159. package/example/components/sidebar-footer.tsx +0 -16
  160. package/example/components/sidebar-item.tsx +0 -124
  161. package/example/components/sidebar-items.tsx +0 -42
  162. package/example/components/sidebar-list.tsx +0 -38
  163. package/example/components/sidebar-mobile.tsx +0 -31
  164. package/example/components/sidebar-toggle.tsx +0 -24
  165. package/example/components/sidebar.tsx +0 -21
  166. package/example/components/signup-form.tsx +0 -95
  167. package/example/components/stocks/events-skeleton.tsx +0 -31
  168. package/example/components/stocks/events.tsx +0 -30
  169. package/example/components/stocks/index.tsx +0 -36
  170. package/example/components/stocks/message.tsx +0 -134
  171. package/example/components/stocks/spinner.tsx +0 -16
  172. package/example/components/stocks/stock-purchase.tsx +0 -146
  173. package/example/components/stocks/stock-skeleton.tsx +0 -22
  174. package/example/components/stocks/stock.tsx +0 -210
  175. package/example/components/stocks/stocks-skeleton.tsx +0 -9
  176. package/example/components/stocks/stocks.tsx +0 -67
  177. package/example/components/tailwind-indicator.tsx +0 -14
  178. package/example/components/theme-toggle.tsx +0 -31
  179. package/example/components/ui/alert-dialog.tsx +0 -141
  180. package/example/components/ui/badge.tsx +0 -36
  181. package/example/components/ui/button.tsx +0 -57
  182. package/example/components/ui/codeblock.tsx +0 -148
  183. package/example/components/ui/dialog.tsx +0 -122
  184. package/example/components/ui/dropdown-menu.tsx +0 -205
  185. package/example/components/ui/icons.tsx +0 -507
  186. package/example/components/ui/input.tsx +0 -25
  187. package/example/components/ui/label.tsx +0 -26
  188. package/example/components/ui/select.tsx +0 -164
  189. package/example/components/ui/separator.tsx +0 -31
  190. package/example/components/ui/sheet.tsx +0 -140
  191. package/example/components/ui/sonner.tsx +0 -31
  192. package/example/components/ui/switch.tsx +0 -29
  193. package/example/components/ui/textarea.tsx +0 -24
  194. package/example/components/ui/tooltip.tsx +0 -30
  195. package/example/components/user-menu.tsx +0 -53
  196. package/example/components.json +0 -17
  197. package/example/instrumentation.ts +0 -11
  198. package/example/lib/chat/guardrails.tsx +0 -181
  199. package/example/lib/chat/langchain-rag.tsx +0 -191
  200. package/example/lib/chat/langchain.tsx +0 -112
  201. package/example/lib/chat/late-update.tsx +0 -208
  202. package/example/lib/chat/manual.tsx +0 -605
  203. package/example/lib/chat/vercel-ai.tsx +0 -576
  204. package/example/lib/hooks/use-copy-to-clipboard.tsx +0 -33
  205. package/example/lib/hooks/use-enter-submit.tsx +0 -23
  206. package/example/lib/hooks/use-local-storage.ts +0 -24
  207. package/example/lib/hooks/use-scroll-anchor.tsx +0 -86
  208. package/example/lib/hooks/use-sidebar.tsx +0 -60
  209. package/example/lib/hooks/use-streamable-text.ts +0 -25
  210. package/example/lib/types.ts +0 -41
  211. package/example/lib/utils.ts +0 -89
  212. package/example/middleware.ts +0 -8
  213. package/example/next-env.d.ts +0 -5
  214. package/example/next.config.js +0 -16
  215. package/example/package-lock.json +0 -10917
  216. package/example/package.json +0 -84
  217. package/example/pnpm-lock.yaml +0 -5712
  218. package/example/postcss.config.js +0 -6
  219. package/example/prettier.config.cjs +0 -34
  220. package/example/public/apple-touch-icon.png +0 -0
  221. package/example/public/favicon-16x16.png +0 -0
  222. package/example/public/favicon.ico +0 -0
  223. package/example/public/next.svg +0 -1
  224. package/example/public/thirteen.svg +0 -1
  225. package/example/public/vercel.svg +0 -1
  226. package/example/tailwind.config.ts +0 -81
  227. package/example/tsconfig.json +0 -35
  228. package/src/LangWatchExporter.ts +0 -96
  229. package/src/evaluations.ts +0 -219
  230. package/src/index.test.ts +0 -402
  231. package/src/langchain.ts +0 -557
  232. package/src/typeUtils.ts +0 -89
  233. package/src/types.ts +0 -82
  234. package/src/utils.ts +0 -205
  235. /package/src/{server/types → internal/generated/openapi}/.gitkeep +0 -0
@@ -0,0 +1,221 @@
1
+ import {
2
+ createLangWatchApiClient,
3
+ type LangwatchApiClient,
4
+ } from "../internal/api/client";
5
+ import type { paths } from "../internal/generated/openapi/api-client";
6
+ import { Prompt } from "./prompt";
7
+
8
+ // Extract types directly from OpenAPI schema for strong type safety.
9
+ type CreatePromptBody = NonNullable<
10
+ paths["/api/prompts"]["post"]["requestBody"]
11
+ >["content"]["application/json"];
12
+ type UpdatePromptBody = NonNullable<
13
+ paths["/api/prompts/{id}"]["put"]["requestBody"]
14
+ >["content"]["application/json"];
15
+ type CreateVersionBody = NonNullable<
16
+ paths["/api/prompts/{id}/versions"]["post"]["requestBody"]
17
+ >["content"]["application/json"];
18
+
19
+ /**
20
+ * Custom error class for Prompts API operations.
21
+ * Provides context about the failed operation and the original error.
22
+ */
23
+ export class PromptsError extends Error {
24
+ constructor(
25
+ message: string,
26
+ public readonly operation: string,
27
+ public readonly originalError?: any,
28
+ ) {
29
+ super(message);
30
+ this.name = "PromptsError";
31
+ }
32
+ }
33
+
34
+ interface PromptServiceOptions {
35
+ client?: LangwatchApiClient;
36
+ }
37
+
38
+ /**
39
+ * Service for managing prompt resources via the Langwatch API.
40
+ *
41
+ * Responsibilities:
42
+ * - CRUD operations for prompts
43
+ * - Creating prompt versions
44
+ * - Error handling with contextual information
45
+ *
46
+ * All methods return Prompt instances, which encapsulate prompt data and template logic.
47
+ */
48
+ export class PromptService {
49
+ private client: LangwatchApiClient;
50
+ private static instance: PromptService | null = null;
51
+
52
+ constructor(opts?: PromptServiceOptions) {
53
+ this.client = opts?.client ?? createLangWatchApiClient();
54
+ }
55
+
56
+ /**
57
+ * Gets the singleton instance of PromptService.
58
+ * Creates the instance lazily on first access.
59
+ */
60
+ public static getInstance(): PromptService {
61
+ if (!PromptService.instance) {
62
+ PromptService.instance = new PromptService();
63
+ }
64
+ return PromptService.instance;
65
+ }
66
+
67
+ /**
68
+ * Resets the singleton instance. Primarily used for testing.
69
+ */
70
+ public static resetInstance(): void {
71
+ PromptService.instance = null;
72
+ }
73
+
74
+ /**
75
+ * Handles API errors by throwing a PromptsError with operation context.
76
+ * @param operation Description of the operation being performed.
77
+ * @param error The error object returned from the API client.
78
+ * @throws {PromptsError}
79
+ */
80
+ private handleApiError(operation: string, error: any): never {
81
+ const errorMessage =
82
+ typeof error === "string"
83
+ ? error
84
+ : error?.error ?? error?.message ?? "Unknown error occurred";
85
+ throw new PromptsError(
86
+ `Failed to ${operation}: ${errorMessage}`,
87
+ operation,
88
+ error,
89
+ );
90
+ }
91
+
92
+ /**
93
+ * Fetches all prompts from the API.
94
+ * @returns Array of Prompt instances.
95
+ * @throws {PromptsError} If the API call fails.
96
+ */
97
+ async getAll(): Promise<Prompt[]> {
98
+ const { data, error } = await this.client.GET("/api/prompts");
99
+ if (error) this.handleApiError("fetch all prompts", error);
100
+ return data.map((promptData) => new Prompt(promptData));
101
+ }
102
+
103
+ /**
104
+ * Fetches a single prompt by its ID.
105
+ * @param id The prompt's unique identifier.
106
+ * @returns The Prompt instance.
107
+ * @throws {PromptsError} If the API call fails.
108
+ */
109
+ async get(id: string): Promise<Prompt> {
110
+ const { data, error } = await this.client.GET("/api/prompts/{id}", {
111
+ params: { path: { id } },
112
+ });
113
+ if (error) this.handleApiError(`fetch prompt with ID "${id}"`, error);
114
+ return new Prompt(data);
115
+ }
116
+
117
+ /**
118
+ * Creates a new prompt.
119
+ * @param params The prompt creation payload, matching the OpenAPI schema.
120
+ * @returns The created Prompt instance.
121
+ * @throws {PromptsError} If the API call fails.
122
+ */
123
+ async create(params: CreatePromptBody): Promise<Prompt> {
124
+ const { data, error } = await this.client.POST("/api/prompts", {
125
+ body: params,
126
+ });
127
+ if (error) this.handleApiError("create prompt", error);
128
+ return new Prompt(data);
129
+ }
130
+
131
+ /**
132
+ * Updates an existing prompt.
133
+ * @param id The prompt's unique identifier.
134
+ * @param params The update payload, matching the OpenAPI schema.
135
+ * @returns The updated Prompt instance.
136
+ * @throws {PromptsError} If the API call fails.
137
+ * @remarks
138
+ * The API does not return the updated prompt directly, so this method fetches it after updating.
139
+ */
140
+ async update(id: string, params: UpdatePromptBody): Promise<Prompt> {
141
+ const { error } = await this.client.PUT("/api/prompts/{id}", {
142
+ params: { path: { id } },
143
+ body: params,
144
+ });
145
+ if (error) this.handleApiError(`update prompt with ID "${id}"`, error);
146
+ // TODO: This is a workaround to get the updated prompt. It would be better to return the updated prompt directly.
147
+ return await this.get(id);
148
+ }
149
+
150
+ /**
151
+ * Deletes a prompt by its ID.
152
+ * @param id The prompt's unique identifier.
153
+ * @throws {PromptsError} If the API call fails.
154
+ */
155
+ async delete(id: string): Promise<void> {
156
+ const { error } = await this.client.DELETE("/api/prompts/{id}", {
157
+ params: { path: { id } },
158
+ });
159
+ if (error) this.handleApiError(`delete prompt with ID "${id}"`, error);
160
+ }
161
+
162
+ /**
163
+ * Fetches all versions for a given prompt.
164
+ * @param id The prompt's unique identifier.
165
+ * @throws {PromptsError} If the API call fails.
166
+ */
167
+ async getVersions(
168
+ id: string,
169
+ ): Promise<Record<string, Prompt>> {
170
+ const { data, error } = await this.client.GET(
171
+ "/api/prompts/{id}/versions",
172
+ {
173
+ params: { path: { id } },
174
+ },
175
+ );
176
+ if (error)
177
+ this.handleApiError(`fetch versions for prompt with ID "${id}"`, error);
178
+
179
+ const prompts: Record<string, Prompt> = {};
180
+ const dataTypeCorrected = data as unknown as NonNullable<
181
+ paths["/api/prompts/{id}/versions"]["get"]["responses"]["200"]["content"]["application/json"]
182
+ >[];
183
+
184
+ for (const version of dataTypeCorrected) {
185
+ prompts[version.id] = new Prompt({
186
+ id: version.configId,
187
+ messages: version.configData.messages,
188
+ model: version.configData.model,
189
+ prompt: version.configData.prompt,
190
+ response_format: null,
191
+ name: `Prompt ${version.configId}@${version.id}`,
192
+ updatedAt: version.createdAt,
193
+ version: version.configData.version ?? 0,
194
+ versionCreatedAt: version.createdAt,
195
+ versionId: version.id,
196
+ });
197
+ }
198
+
199
+ return prompts;
200
+ }
201
+
202
+ /**
203
+ * Creates a new version for a given prompt.
204
+ * @param id The prompt's unique identifier.
205
+ * @param params The version creation payload, matching the OpenAPI schema.
206
+ * @returns The updated Prompt instance.
207
+ * @throws {PromptsError} If the API call fails.
208
+ * @remarks
209
+ * The API does not return the updated prompt directly, so this method fetches it after creation.
210
+ */
211
+ async createVersion(id: string, params: CreateVersionBody): Promise<Prompt> {
212
+ const { error } = await this.client.POST("/api/prompts/{id}/versions", {
213
+ params: { path: { id } },
214
+ body: params,
215
+ });
216
+ if (error)
217
+ this.handleApiError(`create version for prompt with ID "${id}"`, error);
218
+ // TODO: This is a workaround to get the updated prompt. It would be better to return the updated prompt directly.
219
+ return await this.get(id);
220
+ }
221
+ }
@@ -0,0 +1,3 @@
1
+ import { getLangWatchTracer } from "../observability/trace";
2
+
3
+ export const tracer = getLangWatchTracer("langwatch.prompt");
File without changes
@@ -20,5 +20,16 @@ module.exports = {
20
20
  "Literal",
21
21
  "DatasetSpan",
22
22
  "LLMModeTrace",
23
+ "ReservedSpanParams",
24
+ "SpanParams",
25
+ "ReservedTraceMetadataMapping",
26
+ "CustomMetadata",
27
+ "TraceMetadata",
28
+ "Event",
29
+ "ElasticSearchEvent",
30
+ "TrackEventRESTParamsValidator",
31
+ "Trace",
32
+ "ElasticSearchTrace",
33
+ "CollectorRESTParams",
23
34
  ].includes(name),
24
35
  };
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "es2017",
4
- "module": "ESNext",
4
+ "module": "NodeNext",
5
5
  "declaration": true,
6
6
  "declarationMap": true,
7
7
  "outDir": "./dist",
@@ -12,21 +12,15 @@
12
12
  "checkJs": true,
13
13
  "skipLibCheck": true,
14
14
  "forceConsistentCasingInFileNames": true,
15
- "moduleResolution": "node",
15
+ "moduleResolution": "nodenext",
16
16
  "isolatedModules": true,
17
17
  "jsx": "preserve",
18
18
  "incremental": true,
19
19
  "noUncheckedIndexedAccess": true,
20
- "baseUrl": ".",
21
20
  "tsBuildInfoFile": "./tsconfig.tsbuildinfo"
22
21
  },
23
22
  "include": [
24
- ".eslintrc.cjs",
25
- "next-env.d.ts",
26
23
  "**/*.ts",
27
- "**/*.tsx",
28
- "**/*.cjs",
29
- "**/*.mjs"
30
24
  ],
31
- "exclude": ["node_modules", "./dist/**/*", "./example/**/*"]
25
+ "exclude": ["node_modules", "./dist/**/*", "./example/**/*", "./examples/**/*"]
32
26
  }
package/tsup.config.ts CHANGED
@@ -2,7 +2,17 @@ import { defineConfig } from "tsup";
2
2
 
3
3
  export default defineConfig([
4
4
  {
5
- entry: ["src/index.ts", "src/utils.ts"],
5
+ entry: [
6
+ "src/index.ts",
7
+ "src/observability/index.ts",
8
+ "src/observability/instrumentation/langchain/index.ts",
9
+ "src/prompt/index.ts",
10
+ "src/evaluation/index.ts",
11
+ "src/client-node.ts",
12
+ "src/client-browser.ts",
13
+ ],
14
+ splitting: true,
15
+ clean: true,
6
16
  format: ["cjs", "esm"],
7
17
  dts: true,
8
18
  sourcemap: true,
package/vitest.config.ts CHANGED
@@ -4,5 +4,6 @@ export default defineConfig({
4
4
  test: {
5
5
  testTimeout: 30_000,
6
6
  hookTimeout: 30_000,
7
+ setupFiles: ["dotenv/config"]
7
8
  },
8
9
  });