@veryfront/ext-observability-opentelemetry 0.1.1032 → 0.1.1033

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 (227) hide show
  1. package/esm/_dnt.polyfills.d.ts +7 -0
  2. package/esm/_dnt.polyfills.d.ts.map +1 -0
  3. package/esm/_dnt.polyfills.js +1 -0
  4. package/esm/deno.d.ts +434 -0
  5. package/esm/deno.d.ts.map +1 -0
  6. package/esm/deno.js +520 -0
  7. package/esm/{index.d.ts → extensions/ext-observability-opentelemetry/src/index.d.ts} +18 -0
  8. package/esm/extensions/ext-observability-opentelemetry/src/index.d.ts.map +1 -0
  9. package/esm/{index.js → extensions/ext-observability-opentelemetry/src/index.js} +134 -6
  10. package/esm/src/config/defaults.d.ts +39 -0
  11. package/esm/src/config/defaults.d.ts.map +1 -0
  12. package/esm/src/config/defaults.js +65 -0
  13. package/esm/src/errors/error-registry/agent.d.ts +18 -0
  14. package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
  15. package/esm/src/errors/error-registry/agent.js +60 -0
  16. package/esm/src/errors/error-registry/boundary.d.ts +16 -0
  17. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
  18. package/esm/src/errors/error-registry/boundary.js +52 -0
  19. package/esm/src/errors/error-registry/build.d.ts +20 -0
  20. package/esm/src/errors/error-registry/build.d.ts.map +1 -0
  21. package/esm/src/errors/error-registry/build.js +68 -0
  22. package/esm/src/errors/error-registry/config.d.ts +22 -0
  23. package/esm/src/errors/error-registry/config.d.ts.map +1 -0
  24. package/esm/src/errors/error-registry/config.js +70 -0
  25. package/esm/src/errors/error-registry/deploy.d.ts +12 -0
  26. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
  27. package/esm/src/errors/error-registry/deploy.js +36 -0
  28. package/esm/src/errors/error-registry/dev.d.ts +14 -0
  29. package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
  30. package/esm/src/errors/error-registry/dev.js +44 -0
  31. package/esm/src/errors/error-registry/general.d.ts +29 -0
  32. package/esm/src/errors/error-registry/general.d.ts.map +1 -0
  33. package/esm/src/errors/error-registry/general.js +92 -0
  34. package/esm/src/errors/error-registry/module.d.ts +16 -0
  35. package/esm/src/errors/error-registry/module.d.ts.map +1 -0
  36. package/esm/src/errors/error-registry/module.js +52 -0
  37. package/esm/src/errors/error-registry/route.d.ts +16 -0
  38. package/esm/src/errors/error-registry/route.d.ts.map +1 -0
  39. package/esm/src/errors/error-registry/route.js +52 -0
  40. package/esm/src/errors/error-registry/runtime.d.ts +18 -0
  41. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
  42. package/esm/src/errors/error-registry/runtime.js +60 -0
  43. package/esm/src/errors/error-registry/server.d.ts +39 -0
  44. package/esm/src/errors/error-registry/server.d.ts.map +1 -0
  45. package/esm/src/errors/error-registry/server.js +129 -0
  46. package/esm/src/errors/error-registry-helpers.d.ts +6 -0
  47. package/esm/src/errors/error-registry-helpers.d.ts.map +1 -0
  48. package/esm/src/errors/error-registry-helpers.js +9 -0
  49. package/esm/src/errors/error-registry.d.ts +114 -0
  50. package/esm/src/errors/error-registry.d.ts.map +1 -0
  51. package/esm/src/errors/error-registry.js +60 -0
  52. package/esm/src/errors/types.d.ts +84 -0
  53. package/esm/src/errors/types.d.ts.map +1 -0
  54. package/esm/src/errors/types.js +69 -0
  55. package/esm/src/errors/veryfront-error.d.ts +149 -0
  56. package/esm/src/errors/veryfront-error.d.ts.map +1 -0
  57. package/esm/src/errors/veryfront-error.js +61 -0
  58. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts +13 -0
  59. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.d.ts.map +1 -0
  60. package/esm/src/modules/react-loader/ssr-module-loader/concurrency/semaphore.js +55 -0
  61. package/esm/src/observability/tracing/api-shim.d.ts +190 -0
  62. package/esm/src/observability/tracing/api-shim.d.ts.map +1 -0
  63. package/esm/src/observability/tracing/api-shim.js +281 -0
  64. package/esm/src/observability/tracing/otlp-setup.d.ts +58 -0
  65. package/esm/src/observability/tracing/otlp-setup.d.ts.map +1 -0
  66. package/esm/src/observability/tracing/otlp-setup.js +213 -0
  67. package/esm/src/observability/tracing/telemetry-env.d.ts +3 -0
  68. package/esm/src/observability/tracing/telemetry-env.d.ts.map +1 -0
  69. package/esm/src/observability/tracing/telemetry-env.js +10 -0
  70. package/esm/src/platform/adapters/base.d.ts +193 -0
  71. package/esm/src/platform/adapters/base.d.ts.map +1 -0
  72. package/esm/src/platform/adapters/base.js +15 -0
  73. package/esm/src/platform/compat/constants.d.ts +13 -0
  74. package/esm/src/platform/compat/constants.d.ts.map +1 -0
  75. package/esm/src/platform/compat/constants.js +12 -0
  76. package/esm/src/platform/compat/dynamic-import.d.ts +11 -0
  77. package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -0
  78. package/esm/src/platform/compat/dynamic-import.js +10 -0
  79. package/esm/src/platform/compat/fs.d.ts +71 -0
  80. package/esm/src/platform/compat/fs.d.ts.map +1 -0
  81. package/esm/src/platform/compat/fs.js +277 -0
  82. package/esm/src/platform/compat/path/resolution.d.ts +6 -0
  83. package/esm/src/platform/compat/path/resolution.d.ts.map +1 -0
  84. package/esm/src/platform/compat/path/resolution.js +121 -0
  85. package/esm/src/platform/compat/path/runtime.d.ts +8 -0
  86. package/esm/src/platform/compat/path/runtime.d.ts.map +1 -0
  87. package/esm/src/platform/compat/path/runtime.js +20 -0
  88. package/esm/src/platform/compat/path/types.d.ts +22 -0
  89. package/esm/src/platform/compat/path/types.d.ts.map +1 -0
  90. package/esm/src/platform/compat/path/types.js +1 -0
  91. package/esm/src/platform/compat/process/command.d.ts +31 -0
  92. package/esm/src/platform/compat/process/command.d.ts.map +1 -0
  93. package/esm/src/platform/compat/process/command.js +194 -0
  94. package/esm/src/platform/compat/process/env.d.ts +35 -0
  95. package/esm/src/platform/compat/process/env.d.ts.map +1 -0
  96. package/esm/src/platform/compat/process/env.js +194 -0
  97. package/esm/src/platform/compat/process/lifecycle.d.ts +99 -0
  98. package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -0
  99. package/esm/src/platform/compat/process/lifecycle.js +327 -0
  100. package/esm/src/platform/compat/process/runtime-process.d.ts +10 -0
  101. package/esm/src/platform/compat/process/runtime-process.d.ts.map +1 -0
  102. package/esm/src/platform/compat/process/runtime-process.js +25 -0
  103. package/esm/src/platform/compat/process.d.ts +5 -0
  104. package/esm/src/platform/compat/process.d.ts.map +1 -0
  105. package/esm/src/platform/compat/process.js +4 -0
  106. package/esm/src/platform/compat/runtime.d.ts +51 -0
  107. package/esm/src/platform/compat/runtime.d.ts.map +1 -0
  108. package/esm/src/platform/compat/runtime.js +101 -0
  109. package/esm/src/transforms/import-rewriter/url-builder.d.ts +70 -0
  110. package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -0
  111. package/esm/src/transforms/import-rewriter/url-builder.js +152 -0
  112. package/esm/src/utils/base64url.d.ts +6 -0
  113. package/esm/src/utils/base64url.d.ts.map +1 -0
  114. package/esm/src/utils/base64url.js +12 -0
  115. package/esm/src/utils/bundle-manifest.d.ts +63 -0
  116. package/esm/src/utils/bundle-manifest.d.ts.map +1 -0
  117. package/esm/src/utils/bundle-manifest.js +96 -0
  118. package/esm/src/utils/constants/buffers.d.ts +24 -0
  119. package/esm/src/utils/constants/buffers.d.ts.map +1 -0
  120. package/esm/src/utils/constants/buffers.js +23 -0
  121. package/esm/src/utils/constants/build.d.ts +8 -0
  122. package/esm/src/utils/constants/build.d.ts.map +1 -0
  123. package/esm/src/utils/constants/build.js +7 -0
  124. package/esm/src/utils/constants/cache.d.ts +74 -0
  125. package/esm/src/utils/constants/cache.d.ts.map +1 -0
  126. package/esm/src/utils/constants/cache.js +133 -0
  127. package/esm/src/utils/constants/cdn.d.ts +29 -0
  128. package/esm/src/utils/constants/cdn.d.ts.map +1 -0
  129. package/esm/src/utils/constants/cdn.js +58 -0
  130. package/esm/src/utils/constants/crypto.d.ts +10 -0
  131. package/esm/src/utils/constants/crypto.d.ts.map +1 -0
  132. package/esm/src/utils/constants/crypto.js +9 -0
  133. package/esm/src/utils/constants/env.d.ts +16 -0
  134. package/esm/src/utils/constants/env.d.ts.map +1 -0
  135. package/esm/src/utils/constants/env.js +20 -0
  136. package/esm/src/utils/constants/hash.d.ts +5 -0
  137. package/esm/src/utils/constants/hash.d.ts.map +1 -0
  138. package/esm/src/utils/constants/hash.js +4 -0
  139. package/esm/src/utils/constants/hmr.d.ts +24 -0
  140. package/esm/src/utils/constants/hmr.d.ts.map +1 -0
  141. package/esm/src/utils/constants/hmr.js +26 -0
  142. package/esm/src/utils/constants/html.d.ts +13 -0
  143. package/esm/src/utils/constants/html.d.ts.map +1 -0
  144. package/esm/src/utils/constants/html.js +12 -0
  145. package/esm/src/utils/constants/http.d.ts +77 -0
  146. package/esm/src/utils/constants/http.d.ts.map +1 -0
  147. package/esm/src/utils/constants/http.js +76 -0
  148. package/esm/src/utils/constants/index.d.ts +23 -0
  149. package/esm/src/utils/constants/index.d.ts.map +1 -0
  150. package/esm/src/utils/constants/index.js +22 -0
  151. package/esm/src/utils/constants/limits.d.ts +27 -0
  152. package/esm/src/utils/constants/limits.d.ts.map +1 -0
  153. package/esm/src/utils/constants/limits.js +26 -0
  154. package/esm/src/utils/constants/metrics.d.ts +10 -0
  155. package/esm/src/utils/constants/metrics.d.ts.map +1 -0
  156. package/esm/src/utils/constants/metrics.js +34 -0
  157. package/esm/src/utils/constants/network.d.ts +23 -0
  158. package/esm/src/utils/constants/network.d.ts.map +1 -0
  159. package/esm/src/utils/constants/network.js +27 -0
  160. package/esm/src/utils/constants/priorities.d.ts +31 -0
  161. package/esm/src/utils/constants/priorities.d.ts.map +1 -0
  162. package/esm/src/utils/constants/priorities.js +30 -0
  163. package/esm/src/utils/constants/retry.d.ts +14 -0
  164. package/esm/src/utils/constants/retry.d.ts.map +1 -0
  165. package/esm/src/utils/constants/retry.js +13 -0
  166. package/esm/src/utils/constants/security.d.ts +16 -0
  167. package/esm/src/utils/constants/security.d.ts.map +1 -0
  168. package/esm/src/utils/constants/security.js +15 -0
  169. package/esm/src/utils/constants/server.d.ts +107 -0
  170. package/esm/src/utils/constants/server.d.ts.map +1 -0
  171. package/esm/src/utils/constants/server.js +120 -0
  172. package/esm/src/utils/feature-flags.d.ts +7 -0
  173. package/esm/src/utils/feature-flags.d.ts.map +1 -0
  174. package/esm/src/utils/feature-flags.js +8 -0
  175. package/esm/src/utils/hash-utils.d.ts +19 -0
  176. package/esm/src/utils/hash-utils.d.ts.map +1 -0
  177. package/esm/src/utils/hash-utils.js +42 -0
  178. package/esm/src/utils/import-lockfile.d.ts +52 -0
  179. package/esm/src/utils/import-lockfile.d.ts.map +1 -0
  180. package/esm/src/utils/import-lockfile.js +187 -0
  181. package/esm/src/utils/index.d.ts +27 -0
  182. package/esm/src/utils/index.d.ts.map +1 -0
  183. package/esm/src/utils/index.js +25 -0
  184. package/esm/src/utils/logger/components.d.ts +73 -0
  185. package/esm/src/utils/logger/components.d.ts.map +1 -0
  186. package/esm/src/utils/logger/components.js +81 -0
  187. package/esm/src/utils/logger/core.d.ts +73 -0
  188. package/esm/src/utils/logger/core.d.ts.map +1 -0
  189. package/esm/src/utils/logger/core.js +143 -0
  190. package/esm/src/utils/logger/index.d.ts +10 -0
  191. package/esm/src/utils/logger/index.d.ts.map +1 -0
  192. package/esm/src/utils/logger/index.js +9 -0
  193. package/esm/src/utils/logger/logger.d.ts +179 -0
  194. package/esm/src/utils/logger/logger.d.ts.map +1 -0
  195. package/esm/src/utils/logger/logger.js +490 -0
  196. package/esm/src/utils/logger/redact.d.ts +74 -0
  197. package/esm/src/utils/logger/redact.d.ts.map +1 -0
  198. package/esm/src/utils/logger/redact.js +294 -0
  199. package/esm/src/utils/logger/request-context.d.ts +27 -0
  200. package/esm/src/utils/logger/request-context.d.ts.map +1 -0
  201. package/esm/src/utils/logger/request-context.js +28 -0
  202. package/esm/src/utils/memoize.d.ts +19 -0
  203. package/esm/src/utils/memoize.d.ts.map +1 -0
  204. package/esm/src/utils/memoize.js +72 -0
  205. package/esm/src/utils/parallel.d.ts +25 -0
  206. package/esm/src/utils/parallel.d.ts.map +1 -0
  207. package/esm/src/utils/parallel.js +91 -0
  208. package/esm/src/utils/path-utils.d.ts +34 -0
  209. package/esm/src/utils/path-utils.d.ts.map +1 -0
  210. package/esm/src/utils/path-utils.js +138 -0
  211. package/esm/src/utils/perf-timer.d.ts +11 -0
  212. package/esm/src/utils/perf-timer.d.ts.map +1 -0
  213. package/esm/src/utils/perf-timer.js +114 -0
  214. package/esm/src/utils/platform.d.ts +9 -0
  215. package/esm/src/utils/platform.d.ts.map +1 -0
  216. package/esm/src/utils/platform.js +20 -0
  217. package/esm/src/utils/runtime-guards.d.ts +29 -0
  218. package/esm/src/utils/runtime-guards.d.ts.map +1 -0
  219. package/esm/src/utils/runtime-guards.js +23 -0
  220. package/esm/src/utils/version-constant.d.ts +3 -0
  221. package/esm/src/utils/version-constant.d.ts.map +1 -0
  222. package/esm/src/utils/version-constant.js +4 -0
  223. package/esm/src/utils/version.d.ts +17 -0
  224. package/esm/src/utils/version.d.ts.map +1 -0
  225. package/esm/src/utils/version.js +36 -0
  226. package/package.json +18 -7
  227. package/esm/index.d.ts.map +0 -1
@@ -13,7 +13,9 @@
13
13
  *
14
14
  * @module extensions/ext-observability-opentelemetry
15
15
  */
16
- import * as dntShim from "./_dnt.shims.js";
16
+ import "../../../_dnt.polyfills.js";
17
+ import * as dntShim from "../../../_dnt.shims.js";
18
+ import { VERSION } from "../../../src/utils/index.js";
17
19
  const NOOP_SPAN = {
18
20
  setAttribute() {
19
21
  return NOOP_SPAN;
@@ -124,6 +126,42 @@ function parseHeaders(headerInput) {
124
126
  }
125
127
  return result;
126
128
  }
129
+ function parseResourceAttributes(value) {
130
+ if (!value)
131
+ return {};
132
+ const attributes = {};
133
+ for (const part of value.split(",")) {
134
+ const [rawKey, ...rawValueParts] = part.split("=");
135
+ const key = rawKey?.trim();
136
+ if (!key || rawValueParts.length === 0)
137
+ continue;
138
+ attributes[key] = rawValueParts.join("=").trim();
139
+ }
140
+ return attributes;
141
+ }
142
+ function resolveServiceName(read, resourceAttributes) {
143
+ return read("OTEL_SERVICE_NAME") ?? resourceAttributes["service.name"] ??
144
+ read("DD_SERVICE") ?? "veryfront";
145
+ }
146
+ function resolveServiceVersion(read, resourceAttributes) {
147
+ return resourceAttributes["service.version"] ??
148
+ read("OTEL_SERVICE_VERSION") ??
149
+ read("DD_VERSION") ??
150
+ read("VERYFRONT_VERSION") ??
151
+ read("RELEASE_VERSION") ??
152
+ read("npm_package_version") ??
153
+ VERSION;
154
+ }
155
+ function resolveDeploymentEnvironment(read, resourceAttributes) {
156
+ return resourceAttributes["deployment.environment.name"] ??
157
+ resourceAttributes["deployment.environment"] ??
158
+ read("OTEL_DEPLOYMENT_ENVIRONMENT") ??
159
+ read("DD_ENV") ??
160
+ read("APP_ENVIRONMENT") ??
161
+ read("VERYFRONT_ENVIRONMENT") ??
162
+ read("NODE_ENV") ??
163
+ "development";
164
+ }
127
165
  function headersOrDefault(signalHeaders, defaultHeaders) {
128
166
  return signalHeaders ?? defaultHeaders;
129
167
  }
@@ -148,7 +186,79 @@ function logSeverityNumber(otel, level) {
148
186
  return otel.apiLogs.SeverityNumber.INFO;
149
187
  }
150
188
  }
151
- function logAttributes(record) {
189
+ const TRACE_ID_LOG_ALIASES = ["trace.id", "otel.trace_id"];
190
+ const SPAN_ID_LOG_ALIASES = ["span.id", "otel.span_id"];
191
+ const PROJECT_ID_LOG_ALIASES = ["project.id"];
192
+ const RUN_ID_LOG_ALIASES = ["run.id"];
193
+ const AGENT_ID_LOG_ALIASES = ["agent.id", "gen_ai.agent.id"];
194
+ const THREAD_ID_LOG_ALIASES = ["thread.id"];
195
+ const SCHEDULE_ID_LOG_ALIASES = ["schedule.id", "run.trigger.id"];
196
+ const SCHEDULE_NAME_LOG_ALIASES = ["schedule.name"];
197
+ const TOOL_NAME_LOG_ALIASES = ["tool.name", "gen_ai.tool.name"];
198
+ const TOOL_CALL_ID_LOG_ALIASES = ["tool.call.id", "gen_ai.tool.call.id"];
199
+ const LOG_ATTRIBUTE_ALIASES = {
200
+ trace_id: TRACE_ID_LOG_ALIASES,
201
+ span_id: SPAN_ID_LOG_ALIASES,
202
+ project_id: PROJECT_ID_LOG_ALIASES,
203
+ run_id: RUN_ID_LOG_ALIASES,
204
+ agent_id: AGENT_ID_LOG_ALIASES,
205
+ thread_id: THREAD_ID_LOG_ALIASES,
206
+ schedule_id: SCHEDULE_ID_LOG_ALIASES,
207
+ schedule_name: SCHEDULE_NAME_LOG_ALIASES,
208
+ tool_name: TOOL_NAME_LOG_ALIASES,
209
+ tool_call_id: TOOL_CALL_ID_LOG_ALIASES,
210
+ };
211
+ const CONTEXT_LOG_ATTRIBUTE_ALIASES = {
212
+ traceId: TRACE_ID_LOG_ALIASES,
213
+ trace_id: TRACE_ID_LOG_ALIASES,
214
+ spanId: SPAN_ID_LOG_ALIASES,
215
+ span_id: SPAN_ID_LOG_ALIASES,
216
+ projectId: PROJECT_ID_LOG_ALIASES,
217
+ project_id: PROJECT_ID_LOG_ALIASES,
218
+ runId: RUN_ID_LOG_ALIASES,
219
+ run_id: RUN_ID_LOG_ALIASES,
220
+ agentId: AGENT_ID_LOG_ALIASES,
221
+ agent_id: AGENT_ID_LOG_ALIASES,
222
+ threadId: THREAD_ID_LOG_ALIASES,
223
+ thread_id: THREAD_ID_LOG_ALIASES,
224
+ scheduleId: SCHEDULE_ID_LOG_ALIASES,
225
+ schedule_id: SCHEDULE_ID_LOG_ALIASES,
226
+ scheduleName: SCHEDULE_NAME_LOG_ALIASES,
227
+ schedule_name: SCHEDULE_NAME_LOG_ALIASES,
228
+ toolName: TOOL_NAME_LOG_ALIASES,
229
+ tool_name: TOOL_NAME_LOG_ALIASES,
230
+ toolCallId: TOOL_CALL_ID_LOG_ALIASES,
231
+ tool_call_id: TOOL_CALL_ID_LOG_ALIASES,
232
+ };
233
+ function isLogAttributeValue(value) {
234
+ return typeof value === "string" || typeof value === "number" || typeof value === "boolean";
235
+ }
236
+ function hexToUnsignedDecimal(value) {
237
+ const normalized = value?.trim().replace(/^0x/, "");
238
+ if (!normalized || !/^[0-9a-f]+$/i.test(normalized))
239
+ return undefined;
240
+ try {
241
+ return BigInt(`0x${normalized}`).toString(10);
242
+ }
243
+ catch {
244
+ return undefined;
245
+ }
246
+ }
247
+ function addLogAttributeAliases(attributes, key, value) {
248
+ const aliases = LOG_ATTRIBUTE_ALIASES[key] ?? CONTEXT_LOG_ATTRIBUTE_ALIASES[key];
249
+ for (const alias of aliases ?? []) {
250
+ attributes[alias] ??= value;
251
+ }
252
+ if (key === "trace_id" || key === "traceId") {
253
+ const traceId = typeof value === "string" ? value : String(value);
254
+ attributes["dd.trace_id"] ??= hexToUnsignedDecimal(traceId.slice(-16)) ?? traceId;
255
+ }
256
+ if (key === "span_id" || key === "spanId") {
257
+ const spanId = typeof value === "string" ? value : String(value);
258
+ attributes["dd.span_id"] ??= hexToUnsignedDecimal(spanId) ?? spanId;
259
+ }
260
+ }
261
+ export function logAttributes(record) {
152
262
  const attributes = {};
153
263
  for (const [key, value] of Object.entries(record)) {
154
264
  if (key === "timestamp" ||
@@ -158,14 +268,16 @@ function logAttributes(record) {
158
268
  key === "error") {
159
269
  continue;
160
270
  }
161
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
271
+ if (isLogAttributeValue(value)) {
162
272
  attributes[key] = value;
273
+ addLogAttributeAliases(attributes, key, value);
163
274
  }
164
275
  }
165
276
  if (record.context) {
166
277
  for (const [key, value] of Object.entries(record.context)) {
167
- if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
278
+ if (isLogAttributeValue(value)) {
168
279
  attributes[`context.${key}`] = value;
280
+ addLogAttributeAliases(attributes, key, value);
169
281
  }
170
282
  }
171
283
  }
@@ -213,6 +325,7 @@ function resolveMetricsTemporalityPreference(value) {
213
325
  return "delta";
214
326
  }
215
327
  export function resolveOtlpExtensionConfig(read = readEnv) {
328
+ const resourceAttributes = parseResourceAttributes(read("OTEL_RESOURCE_ATTRIBUTES"));
216
329
  const endpoint = read("OTEL_EXPORTER_OTLP_ENDPOINT");
217
330
  const tracesEndpoint = read("OTEL_EXPORTER_OTLP_TRACES_ENDPOINT") ?? endpoint;
218
331
  const metricsEndpoint = read("OTEL_EXPORTER_OTLP_METRICS_ENDPOINT") ?? endpoint;
@@ -223,8 +336,9 @@ export function resolveOtlpExtensionConfig(read = readEnv) {
223
336
  const metricsHeaders = mergeHeaders(headers, parseHeaders(read("OTEL_EXPORTER_OTLP_METRICS_HEADERS")));
224
337
  const logsHeaders = mergeHeaders(headers, parseHeaders(read("OTEL_EXPORTER_OTLP_LOGS_HEADERS")));
225
338
  return {
226
- serviceName: read("OTEL_SERVICE_NAME") ?? "veryfront",
227
- serviceVersion: "0.1.0",
339
+ serviceName: resolveServiceName(read, resourceAttributes),
340
+ serviceVersion: resolveServiceVersion(read, resourceAttributes),
341
+ deploymentEnvironment: resolveDeploymentEnvironment(read, resourceAttributes),
228
342
  headers,
229
343
  tracesHeaders,
230
344
  metricsHeaders,
@@ -259,6 +373,8 @@ class OtlpTracingExporter {
259
373
  const resource = otel.resources.resourceFromAttributes({
260
374
  [otel.semanticConventions.ATTR_SERVICE_NAME]: cfg.serviceName,
261
375
  [otel.semanticConventions.ATTR_SERVICE_VERSION]: cfg.serviceVersion,
376
+ "deployment.environment": cfg.deploymentEnvironment,
377
+ "deployment.environment.name": cfg.deploymentEnvironment,
262
378
  });
263
379
  if (cfg.tracesEnabled) {
264
380
  if (!cfg.tracesUrl) {
@@ -409,6 +525,7 @@ class OpenTelemetryNodeTelemetryProvider {
409
525
  "service.name": options.serviceName,
410
526
  "service.version": options.serviceVersion,
411
527
  "deployment.environment": options.deploymentEnvironment,
528
+ "deployment.environment.name": options.deploymentEnvironment,
412
529
  });
413
530
  const spanProcessors = tracesEnabled
414
531
  ? [
@@ -541,7 +658,18 @@ const extOpenTelemetry = () => {
541
658
  "OTEL_EXPORTER_OTLP_TRACES_HEADERS",
542
659
  "OTEL_EXPORTER_OTLP_METRICS_HEADERS",
543
660
  "OTEL_EXPORTER_OTLP_LOGS_HEADERS",
661
+ "OTEL_RESOURCE_ATTRIBUTES",
544
662
  "OTEL_SERVICE_NAME",
663
+ "OTEL_SERVICE_VERSION",
664
+ "OTEL_DEPLOYMENT_ENVIRONMENT",
665
+ "DD_SERVICE",
666
+ "DD_VERSION",
667
+ "DD_ENV",
668
+ "VERYFRONT_VERSION",
669
+ "RELEASE_VERSION",
670
+ "APP_ENVIRONMENT",
671
+ "VERYFRONT_ENVIRONMENT",
672
+ "NODE_ENV",
545
673
  "OTEL_TRACES_ENABLED",
546
674
  "OTEL_METRICS_ENABLED",
547
675
  "OTEL_LOGS_ENABLED",
@@ -0,0 +1,39 @@
1
+ import { DEFAULT_PORT } from "../platform/compat/constants.js";
2
+ export { DEFAULT_PORT };
3
+ export declare const DEFAULT_TIMEOUT_MS = 5000;
4
+ export declare const SSR_TIMEOUT_MS = 10000;
5
+ export declare const SANDBOX_TIMEOUT_MS = 5000;
6
+ /** Timeout for user data fetching functions (getServerData, getStaticData) */
7
+ export declare const DATA_FETCH_TIMEOUT_MS = 10000;
8
+ export declare const DEFAULT_CACHE_MAX_SIZE = 100;
9
+ export declare const DURATION_HISTOGRAM_BOUNDARIES_MS: readonly [5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000];
10
+ export declare const SIZE_HISTOGRAM_BOUNDARIES_KB: readonly [1, 5, 10, 25, 50, 100, 250, 500, 1000, 2500, 5000, 10000];
11
+ export declare const defaultConfig: {
12
+ readonly server: {
13
+ readonly port: 3000;
14
+ readonly hostname: "0.0.0.0";
15
+ };
16
+ readonly timeouts: {
17
+ readonly default: 5000;
18
+ readonly api: 30000;
19
+ readonly ssr: 10000;
20
+ readonly hmr: 30000;
21
+ readonly sandbox: 5000;
22
+ };
23
+ readonly cache: {
24
+ readonly jit: {
25
+ readonly maxSize: 100;
26
+ readonly tempDirPrefix: "vf-bundle-";
27
+ };
28
+ };
29
+ readonly metrics: {
30
+ readonly ssrBoundaries: readonly [5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000];
31
+ };
32
+ };
33
+ export declare const DEFAULT_PREFETCH_DELAY_MS = 100;
34
+ export declare const DEFAULT_METRICS_COLLECT_INTERVAL_MS = 60000;
35
+ export declare const DEFAULT_REDIS_SCAN_COUNT = 100;
36
+ export declare const DEFAULT_REDIS_BATCH_DELETE_SIZE = 1000;
37
+ export declare const PAGE_TRANSITION_DELAY_MS = 150;
38
+ export type DefaultConfig = typeof defaultConfig;
39
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../../src/src/config/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,eAAO,MAAM,kBAAkB,OAAO,CAAC;AACvC,eAAO,MAAM,cAAc,QAAQ,CAAC;AACpC,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAEvC,8EAA8E;AAC9E,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C,eAAO,MAAM,gCAAgC,iFAenC,CAAC;AAEX,eAAO,MAAM,4BAA4B,qEAa/B,CAAC;AAEX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;CAqBhB,CAAC;AAEX,eAAO,MAAM,yBAAyB,MAAM,CAAC;AAC7C,eAAO,MAAM,mCAAmC,QAAQ,CAAC;AACzD,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAC5C,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { DEFAULT_PORT } from "../platform/compat/constants.js";
2
+ export { DEFAULT_PORT };
3
+ export const DEFAULT_TIMEOUT_MS = 5000;
4
+ export const SSR_TIMEOUT_MS = 10000;
5
+ export const SANDBOX_TIMEOUT_MS = 5000;
6
+ /** Timeout for user data fetching functions (getServerData, getStaticData) */
7
+ export const DATA_FETCH_TIMEOUT_MS = 10000;
8
+ export const DEFAULT_CACHE_MAX_SIZE = 100;
9
+ export const DURATION_HISTOGRAM_BOUNDARIES_MS = [
10
+ 5,
11
+ 10,
12
+ 25,
13
+ 50,
14
+ 75,
15
+ 100,
16
+ 250,
17
+ 500,
18
+ 750,
19
+ 1000,
20
+ 2500,
21
+ 5000,
22
+ 7500,
23
+ 10000,
24
+ ];
25
+ export const SIZE_HISTOGRAM_BOUNDARIES_KB = [
26
+ 1,
27
+ 5,
28
+ 10,
29
+ 25,
30
+ 50,
31
+ 100,
32
+ 250,
33
+ 500,
34
+ 1000,
35
+ 2500,
36
+ 5000,
37
+ 10000,
38
+ ];
39
+ export const defaultConfig = {
40
+ server: {
41
+ port: DEFAULT_PORT,
42
+ hostname: "0.0.0.0",
43
+ },
44
+ timeouts: {
45
+ default: DEFAULT_TIMEOUT_MS,
46
+ api: 30000,
47
+ ssr: SSR_TIMEOUT_MS,
48
+ hmr: 30000,
49
+ sandbox: SANDBOX_TIMEOUT_MS,
50
+ },
51
+ cache: {
52
+ jit: {
53
+ maxSize: DEFAULT_CACHE_MAX_SIZE,
54
+ tempDirPrefix: "vf-bundle-",
55
+ },
56
+ },
57
+ metrics: {
58
+ ssrBoundaries: DURATION_HISTOGRAM_BOUNDARIES_MS,
59
+ },
60
+ };
61
+ export const DEFAULT_PREFETCH_DELAY_MS = 100;
62
+ export const DEFAULT_METRICS_COLLECT_INTERVAL_MS = 60000;
63
+ export const DEFAULT_REDIS_SCAN_COUNT = 100;
64
+ export const DEFAULT_REDIS_BATCH_DELETE_SIZE = 1000;
65
+ export const PAGE_TRANSITION_DELAY_MS = 150;
@@ -0,0 +1,18 @@
1
+ export declare const AGENT_ERROR: import("../types.js").RegisteredError;
2
+ export declare const AGENT_NOT_FOUND: import("../types.js").RegisteredError;
3
+ export declare const AGENT_TIMEOUT: import("../types.js").RegisteredError;
4
+ export declare const AGENT_INTENT_ERROR: import("../types.js").RegisteredError;
5
+ export declare const ORCHESTRATION_ERROR: import("../types.js").RegisteredError;
6
+ export declare const COST_LIMIT_EXCEEDED: import("../types.js").RegisteredError;
7
+ export declare const TOOL_ID_CONFLICT: import("../types.js").RegisteredError;
8
+ /** Registry fragment for AGENT errors (slug → definition). */
9
+ export declare const AGENT_REGISTRY: {
10
+ readonly "agent-error": import("../types.js").RegisteredError;
11
+ readonly "agent-not-found": import("../types.js").RegisteredError;
12
+ readonly "agent-timeout": import("../types.js").RegisteredError;
13
+ readonly "agent-intent-error": import("../types.js").RegisteredError;
14
+ readonly "orchestration-error": import("../types.js").RegisteredError;
15
+ readonly "cost-limit-exceeded": import("../types.js").RegisteredError;
16
+ readonly "tool-id-conflict": import("../types.js").RegisteredError;
17
+ };
18
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/error-registry/agent.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,uCAMtB,CAAC;AAEH,eAAO,MAAM,eAAe,uCAM1B,CAAC;AAEH,eAAO,MAAM,aAAa,uCAMxB,CAAC;AAEH,eAAO,MAAM,kBAAkB,uCAM7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,uCAM9B,CAAC;AAEH,eAAO,MAAM,mBAAmB,uCAM9B,CAAC;AAEH,eAAO,MAAM,gBAAgB,uCAM3B,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,cAAc;;;;;;;;CAQjB,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { defineError } from "../types.js";
2
+ export const AGENT_ERROR = defineError({
3
+ slug: "agent-error",
4
+ category: "AGENT",
5
+ status: 500,
6
+ title: "Agent operation error",
7
+ suggestion: "Check agent configuration and logs",
8
+ });
9
+ export const AGENT_NOT_FOUND = defineError({
10
+ slug: "agent-not-found",
11
+ category: "AGENT",
12
+ status: 404,
13
+ title: "Agent not found",
14
+ suggestion: "Verify the agent ID exists",
15
+ });
16
+ export const AGENT_TIMEOUT = defineError({
17
+ slug: "agent-timeout",
18
+ category: "AGENT",
19
+ status: 408,
20
+ title: "Agent operation timed out",
21
+ suggestion: "Increase timeout or simplify the request",
22
+ });
23
+ export const AGENT_INTENT_ERROR = defineError({
24
+ slug: "agent-intent-error",
25
+ category: "AGENT",
26
+ status: 400,
27
+ title: "Agent intent parsing error",
28
+ suggestion: "Rephrase the request more clearly",
29
+ });
30
+ export const ORCHESTRATION_ERROR = defineError({
31
+ slug: "orchestration-error",
32
+ category: "AGENT",
33
+ status: 500,
34
+ title: "Multi-agent orchestration error",
35
+ suggestion: "Check agent coordination logic",
36
+ });
37
+ export const COST_LIMIT_EXCEEDED = defineError({
38
+ slug: "cost-limit-exceeded",
39
+ category: "AGENT",
40
+ status: 429,
41
+ title: "Cost limit exceeded",
42
+ suggestion: "Wait for the budget period to reset or increase the limit",
43
+ });
44
+ export const TOOL_ID_CONFLICT = defineError({
45
+ slug: "tool-id-conflict",
46
+ category: "AGENT",
47
+ status: 409,
48
+ title: "Tool ID conflict",
49
+ suggestion: "Use a unique tool ID or rename one of the conflicting tools",
50
+ });
51
+ /** Registry fragment for AGENT errors (slug → definition). */
52
+ export const AGENT_REGISTRY = {
53
+ "agent-error": AGENT_ERROR,
54
+ "agent-not-found": AGENT_NOT_FOUND,
55
+ "agent-timeout": AGENT_TIMEOUT,
56
+ "agent-intent-error": AGENT_INTENT_ERROR,
57
+ "orchestration-error": ORCHESTRATION_ERROR,
58
+ "cost-limit-exceeded": COST_LIMIT_EXCEEDED,
59
+ "tool-id-conflict": TOOL_ID_CONFLICT,
60
+ };
@@ -0,0 +1,16 @@
1
+ export declare const CLIENT_BOUNDARY_VIOLATION: import("../types.js").RegisteredError;
2
+ export declare const SERVER_ONLY_IN_CLIENT: import("../types.js").RegisteredError;
3
+ export declare const CLIENT_ONLY_IN_SERVER: import("../types.js").RegisteredError;
4
+ export declare const INVALID_USE_CLIENT: import("../types.js").RegisteredError;
5
+ export declare const INVALID_USE_SERVER: import("../types.js").RegisteredError;
6
+ export declare const RSC_PAYLOAD_ERROR: import("../types.js").RegisteredError;
7
+ /** Registry fragment for BOUNDARY errors (slug → definition). */
8
+ export declare const BOUNDARY_REGISTRY: {
9
+ readonly "client-boundary-violation": import("../types.js").RegisteredError;
10
+ readonly "server-only-in-client": import("../types.js").RegisteredError;
11
+ readonly "client-only-in-server": import("../types.js").RegisteredError;
12
+ readonly "invalid-use-client": import("../types.js").RegisteredError;
13
+ readonly "invalid-use-server": import("../types.js").RegisteredError;
14
+ readonly "rsc-payload-error": import("../types.js").RegisteredError;
15
+ };
16
+ //# sourceMappingURL=boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boundary.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/error-registry/boundary.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,yBAAyB,uCAMpC,CAAC;AAEH,eAAO,MAAM,qBAAqB,uCAMhC,CAAC;AAEH,eAAO,MAAM,qBAAqB,uCAMhC,CAAC;AAEH,eAAO,MAAM,kBAAkB,uCAM7B,CAAC;AAEH,eAAO,MAAM,kBAAkB,uCAM7B,CAAC;AAEH,eAAO,MAAM,iBAAiB,uCAM5B,CAAC;AAEH,iEAAiE;AACjE,eAAO,MAAM,iBAAiB;;;;;;;CAOpB,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { defineError } from "../types.js";
2
+ export const CLIENT_BOUNDARY_VIOLATION = defineError({
3
+ slug: "client-boundary-violation",
4
+ category: "BOUNDARY",
5
+ status: 400,
6
+ title: "Client boundary rule violation",
7
+ suggestion: "Add 'use client' directive or move code to a client component",
8
+ });
9
+ export const SERVER_ONLY_IN_CLIENT = defineError({
10
+ slug: "server-only-in-client",
11
+ category: "BOUNDARY",
12
+ status: 400,
13
+ title: "Server-only code in client component",
14
+ suggestion: "Move server-only code to a server component",
15
+ });
16
+ export const CLIENT_ONLY_IN_SERVER = defineError({
17
+ slug: "client-only-in-server",
18
+ category: "BOUNDARY",
19
+ status: 400,
20
+ title: "Client-only code in server component",
21
+ suggestion: "Move client-only code to a client component",
22
+ });
23
+ export const INVALID_USE_CLIENT = defineError({
24
+ slug: "invalid-use-client",
25
+ category: "BOUNDARY",
26
+ status: 400,
27
+ title: "Invalid 'use client' directive",
28
+ suggestion: "Place 'use client' at the top of the file",
29
+ });
30
+ export const INVALID_USE_SERVER = defineError({
31
+ slug: "invalid-use-server",
32
+ category: "BOUNDARY",
33
+ status: 400,
34
+ title: "Invalid 'use server' directive",
35
+ suggestion: "Place 'use server' at the top of the file or function",
36
+ });
37
+ export const RSC_PAYLOAD_ERROR = defineError({
38
+ slug: "rsc-payload-error",
39
+ category: "BOUNDARY",
40
+ status: 500,
41
+ title: "RSC payload serialization error",
42
+ suggestion: "Ensure props are serializable (no functions, symbols, etc.)",
43
+ });
44
+ /** Registry fragment for BOUNDARY errors (slug → definition). */
45
+ export const BOUNDARY_REGISTRY = {
46
+ "client-boundary-violation": CLIENT_BOUNDARY_VIOLATION,
47
+ "server-only-in-client": SERVER_ONLY_IN_CLIENT,
48
+ "client-only-in-server": CLIENT_ONLY_IN_SERVER,
49
+ "invalid-use-client": INVALID_USE_CLIENT,
50
+ "invalid-use-server": INVALID_USE_SERVER,
51
+ "rsc-payload-error": RSC_PAYLOAD_ERROR,
52
+ };
@@ -0,0 +1,20 @@
1
+ export declare const BUILD_FAILED: import("../types.js").RegisteredError;
2
+ export declare const BUNDLE_ERROR: import("../types.js").RegisteredError;
3
+ export declare const TYPESCRIPT_ERROR: import("../types.js").RegisteredError;
4
+ export declare const MDX_COMPILE_ERROR: import("../types.js").RegisteredError;
5
+ export declare const ASSET_OPTIMIZATION_ERROR: import("../types.js").RegisteredError;
6
+ export declare const SSG_GENERATION_ERROR: import("../types.js").RegisteredError;
7
+ export declare const SOURCEMAP_ERROR: import("../types.js").RegisteredError;
8
+ export declare const COMPILATION_ERROR: import("../types.js").RegisteredError;
9
+ /** Registry fragment for BUILD errors (slug → definition). */
10
+ export declare const BUILD_REGISTRY: {
11
+ readonly "build-failed": import("../types.js").RegisteredError;
12
+ readonly "bundle-error": import("../types.js").RegisteredError;
13
+ readonly "typescript-error": import("../types.js").RegisteredError;
14
+ readonly "mdx-compile-error": import("../types.js").RegisteredError;
15
+ readonly "asset-optimization-error": import("../types.js").RegisteredError;
16
+ readonly "ssg-generation-error": import("../types.js").RegisteredError;
17
+ readonly "sourcemap-error": import("../types.js").RegisteredError;
18
+ readonly "compilation-error": import("../types.js").RegisteredError;
19
+ };
20
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/error-registry/build.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,uCAMvB,CAAC;AAEH,eAAO,MAAM,YAAY,uCAMvB,CAAC;AAEH,eAAO,MAAM,gBAAgB,uCAM3B,CAAC;AAEH,eAAO,MAAM,iBAAiB,uCAM5B,CAAC;AAEH,eAAO,MAAM,wBAAwB,uCAMnC,CAAC;AAEH,eAAO,MAAM,oBAAoB,uCAM/B,CAAC;AAEH,eAAO,MAAM,eAAe,uCAM1B,CAAC;AAEH,eAAO,MAAM,iBAAiB,uCAM5B,CAAC;AAEH,8DAA8D;AAC9D,eAAO,MAAM,cAAc;;;;;;;;;CASjB,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { defineError } from "../types.js";
2
+ export const BUILD_FAILED = defineError({
3
+ slug: "build-failed",
4
+ category: "BUILD",
5
+ status: 500,
6
+ title: "Build process failed",
7
+ suggestion: "Check the build output for specific errors",
8
+ });
9
+ export const BUNDLE_ERROR = defineError({
10
+ slug: "bundle-error",
11
+ category: "BUILD",
12
+ status: 500,
13
+ title: "Bundle generation failed",
14
+ suggestion: "Review bundler output for details",
15
+ });
16
+ export const TYPESCRIPT_ERROR = defineError({
17
+ slug: "typescript-error",
18
+ category: "BUILD",
19
+ status: 500,
20
+ title: "TypeScript compilation error",
21
+ suggestion: "Fix TypeScript errors shown in the output",
22
+ });
23
+ export const MDX_COMPILE_ERROR = defineError({
24
+ slug: "mdx-compile-error",
25
+ category: "BUILD",
26
+ status: 500,
27
+ title: "MDX compilation failed",
28
+ suggestion: "Check your MDX file syntax",
29
+ });
30
+ export const ASSET_OPTIMIZATION_ERROR = defineError({
31
+ slug: "asset-optimization-error",
32
+ category: "BUILD",
33
+ status: 500,
34
+ title: "Asset optimization failed",
35
+ suggestion: "Check asset file formats and paths",
36
+ });
37
+ export const SSG_GENERATION_ERROR = defineError({
38
+ slug: "ssg-generation-error",
39
+ category: "BUILD",
40
+ status: 500,
41
+ title: "Static site generation failed",
42
+ suggestion: "Review SSG configuration and data fetching",
43
+ });
44
+ export const SOURCEMAP_ERROR = defineError({
45
+ slug: "sourcemap-error",
46
+ category: "BUILD",
47
+ status: 500,
48
+ title: "Source map generation failed",
49
+ suggestion: "Check source map configuration",
50
+ });
51
+ export const COMPILATION_ERROR = defineError({
52
+ slug: "compilation-error",
53
+ category: "BUILD",
54
+ status: 500,
55
+ title: "Compilation failed",
56
+ suggestion: "Review compiler output for specific errors",
57
+ });
58
+ /** Registry fragment for BUILD errors (slug → definition). */
59
+ export const BUILD_REGISTRY = {
60
+ "build-failed": BUILD_FAILED,
61
+ "bundle-error": BUNDLE_ERROR,
62
+ "typescript-error": TYPESCRIPT_ERROR,
63
+ "mdx-compile-error": MDX_COMPILE_ERROR,
64
+ "asset-optimization-error": ASSET_OPTIMIZATION_ERROR,
65
+ "ssg-generation-error": SSG_GENERATION_ERROR,
66
+ "sourcemap-error": SOURCEMAP_ERROR,
67
+ "compilation-error": COMPILATION_ERROR,
68
+ };
@@ -0,0 +1,22 @@
1
+ export declare const CONFIG_NOT_FOUND: import("../types.js").RegisteredError;
2
+ export declare const CONFIG_INVALID: import("../types.js").RegisteredError;
3
+ export declare const CONFIG_PARSE_ERROR: import("../types.js").RegisteredError;
4
+ /** Schema-level config validation (e.g. Zod schema mismatch at runtime) */
5
+ export declare const CONFIG_VALIDATION_ERROR: import("../types.js").RegisteredError;
6
+ export declare const CONFIG_TYPE_ERROR: import("../types.js").RegisteredError;
7
+ export declare const IMPORT_MAP_INVALID: import("../types.js").RegisteredError;
8
+ export declare const CORS_CONFIG_INVALID: import("../types.js").RegisteredError;
9
+ /** Config file validation failures (replaces ConfigValidationError) */
10
+ export declare const CONFIG_VALIDATION_FAILED: import("../types.js").RegisteredError;
11
+ /** Registry fragment for CONFIG errors (slug → definition). */
12
+ export declare const CONFIG_REGISTRY: {
13
+ readonly "config-not-found": import("../types.js").RegisteredError;
14
+ readonly "config-invalid": import("../types.js").RegisteredError;
15
+ readonly "config-parse-error": import("../types.js").RegisteredError;
16
+ readonly "config-validation-error": import("../types.js").RegisteredError;
17
+ readonly "config-type-error": import("../types.js").RegisteredError;
18
+ readonly "import-map-invalid": import("../types.js").RegisteredError;
19
+ readonly "cors-config-invalid": import("../types.js").RegisteredError;
20
+ readonly "config-validation-failed": import("../types.js").RegisteredError;
21
+ };
22
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/src/errors/error-registry/config.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,gBAAgB,uCAM3B,CAAC;AAEH,eAAO,MAAM,cAAc,uCAMzB,CAAC;AAEH,eAAO,MAAM,kBAAkB,uCAM7B,CAAC;AAEH,2EAA2E;AAC3E,eAAO,MAAM,uBAAuB,uCAMlC,CAAC;AAEH,eAAO,MAAM,iBAAiB,uCAM5B,CAAC;AAEH,eAAO,MAAM,kBAAkB,uCAM7B,CAAC;AAEH,eAAO,MAAM,mBAAmB,uCAM9B,CAAC;AAEH,uEAAuE;AACvE,eAAO,MAAM,wBAAwB,uCAMnC,CAAC;AAEH,+DAA+D;AAC/D,eAAO,MAAM,eAAe;;;;;;;;;CASlB,CAAC"}
@@ -0,0 +1,70 @@
1
+ import { defineError } from "../types.js";
2
+ export const CONFIG_NOT_FOUND = defineError({
3
+ slug: "config-not-found",
4
+ category: "CONFIG",
5
+ status: 404,
6
+ title: "Configuration file not found",
7
+ suggestion: "Run 'vf init' to create a configuration file",
8
+ });
9
+ export const CONFIG_INVALID = defineError({
10
+ slug: "config-invalid",
11
+ category: "CONFIG",
12
+ status: 400,
13
+ title: "Invalid configuration format",
14
+ suggestion: "Check your veryfront.config.ts for syntax errors",
15
+ });
16
+ export const CONFIG_PARSE_ERROR = defineError({
17
+ slug: "config-parse-error",
18
+ category: "CONFIG",
19
+ status: 400,
20
+ title: "Failed to parse configuration",
21
+ suggestion: "Ensure your configuration file is valid TypeScript/JSON",
22
+ });
23
+ /** Schema-level config validation (e.g. Zod schema mismatch at runtime) */
24
+ export const CONFIG_VALIDATION_ERROR = defineError({
25
+ slug: "config-validation-error",
26
+ category: "CONFIG",
27
+ status: 422,
28
+ title: "Configuration validation failed",
29
+ suggestion: "Check the configuration against the schema requirements",
30
+ });
31
+ export const CONFIG_TYPE_ERROR = defineError({
32
+ slug: "config-type-error",
33
+ category: "CONFIG",
34
+ status: 400,
35
+ title: "Configuration type mismatch",
36
+ suggestion: "Ensure configuration values match expected types",
37
+ });
38
+ export const IMPORT_MAP_INVALID = defineError({
39
+ slug: "import-map-invalid",
40
+ category: "CONFIG",
41
+ status: 400,
42
+ title: "Invalid import map configuration",
43
+ suggestion: "Check your import map syntax and paths",
44
+ });
45
+ export const CORS_CONFIG_INVALID = defineError({
46
+ slug: "cors-config-invalid",
47
+ category: "CONFIG",
48
+ status: 400,
49
+ title: "Invalid CORS configuration",
50
+ suggestion: "Review CORS settings in your configuration",
51
+ });
52
+ /** Config file validation failures (replaces ConfigValidationError) */
53
+ export const CONFIG_VALIDATION_FAILED = defineError({
54
+ slug: "config-validation-failed",
55
+ category: "CONFIG",
56
+ status: 400,
57
+ title: "Configuration validation failed",
58
+ suggestion: "Check configuration values against requirements",
59
+ });
60
+ /** Registry fragment for CONFIG errors (slug → definition). */
61
+ export const CONFIG_REGISTRY = {
62
+ "config-not-found": CONFIG_NOT_FOUND,
63
+ "config-invalid": CONFIG_INVALID,
64
+ "config-parse-error": CONFIG_PARSE_ERROR,
65
+ "config-validation-error": CONFIG_VALIDATION_ERROR,
66
+ "config-type-error": CONFIG_TYPE_ERROR,
67
+ "import-map-invalid": IMPORT_MAP_INVALID,
68
+ "cors-config-invalid": CORS_CONFIG_INVALID,
69
+ "config-validation-failed": CONFIG_VALIDATION_FAILED,
70
+ };