@rasputin-ai/elysia 0.14.0 → 0.15.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.
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ import { Elysia } from "elysia";
24
24
 
25
25
  // src/sdk-meta.ts
26
26
  var SDK_NAME = "@rasputin-ai/elysia";
27
- var SDK_VERSION = "0.14.0";
27
+ var SDK_VERSION = "0.15.1";
28
28
 
29
29
  // src/rasputin-init.ts
30
30
  var publicExecution = (runtime) => ({
@@ -203,7 +203,6 @@ function RasputinInit(options, hooks = {}) {
203
203
  const recorderEnabled = enabled && options.executionRecorder?.enabled !== false;
204
204
  const durationSampling = options.dynamicDurationSampling === true;
205
205
  const metrics = activation.enabled ? bindFunctionMetrics({
206
- options: options.functionMetrics,
207
206
  clientEnabled: true,
208
207
  environment: activation.environment,
209
208
  release: activation.release,
@@ -213,7 +212,6 @@ function RasputinInit(options, hooks = {}) {
213
212
  sampledMeasurementFormat: durationSampling
214
213
  }) : void 0;
215
214
  const executionMetrics = activation.enabled ? bindExecutionMetrics({
216
- options: options.executionMetrics,
217
215
  clientEnabled: true,
218
216
  environment: activation.environment,
219
217
  release: activation.release,
@@ -222,7 +220,8 @@ function RasputinInit(options, hooks = {}) {
222
220
  fetch,
223
221
  sampledMeasurementFormat: durationSampling
224
222
  }) : void 0;
225
- const durationSampler = durationSampling && (recorderEnabled || Boolean(metrics) || Boolean(executionMetrics)) ? createDynamicDurationSampleBuckets({ nowMs: () => Date.now() }) : void 0;
223
+ const observeExecutions = recorderEnabled || Boolean(metrics) || Boolean(executionMetrics);
224
+ const durationSampler = durationSampling && observeExecutions ? createDynamicDurationSampleBuckets({ nowMs: () => Date.now() }) : void 0;
226
225
  const { runtime, policy } = bindAdaptiveRecorder({
227
226
  executionRecorder: options.executionRecorder,
228
227
  recorderEnabled,
@@ -254,7 +253,7 @@ function RasputinInit(options, hooks = {}) {
254
253
  const { client: wrappedClient, startManifestUpload } = withExecution(
255
254
  client,
256
255
  runtime,
257
- recorderEnabled || Boolean(metrics),
256
+ observeExecutions,
258
257
  {
259
258
  projectApiKey: options.projectApiKey,
260
259
  release: options.release,
@@ -273,22 +272,20 @@ function RasputinInit(options, hooks = {}) {
273
272
  if (enabled && installProcessHandlers) {
274
273
  uninstallHandlers = installGlobalHandlers(wrappedClient);
275
274
  }
276
- const plugin = buildPlugin(wrappedClient, runtime, recorderEnabled || Boolean(metrics)).onStart(
277
- () => {
278
- startManifestUpload();
279
- if (!enabled || announceDeploy === false) return;
280
- const parsed = parseDsn(options.dsn);
281
- const apiUrl = typeof options.apiUrl === "string" && options.apiUrl.trim() ? options.apiUrl.trim() : parsed?.apiUrl;
282
- if (!apiUrl) return;
283
- scheduleAnnounceDeploy({
284
- deployUrl: resolveEndpointUrls(apiUrl).deployUrl,
285
- projectApiKey: options.projectApiKey,
286
- environment: options.environment,
287
- release: options.release,
288
- fetch
289
- });
290
- }
291
- );
275
+ const plugin = buildPlugin(wrappedClient, runtime, observeExecutions).onStart(() => {
276
+ startManifestUpload();
277
+ if (!enabled || announceDeploy === false) return;
278
+ const parsed = parseDsn(options.dsn);
279
+ const apiUrl = typeof options.apiUrl === "string" && options.apiUrl.trim() ? options.apiUrl.trim() : parsed?.apiUrl;
280
+ if (!apiUrl) return;
281
+ scheduleAnnounceDeploy({
282
+ deployUrl: resolveEndpointUrls(apiUrl).deployUrl,
283
+ projectApiKey: options.projectApiKey,
284
+ environment: options.environment,
285
+ release: options.release,
286
+ fetch
287
+ });
288
+ });
292
289
  return {
293
290
  client: wrappedClient,
294
291
  plugin
@@ -4,7 +4,7 @@
4
4
  * intentionally limited to lifecycle wiring; recording, serialization, and safety policy stay in
5
5
  * the framework-neutral Node recorder.
6
6
  */
7
- import { type ExecutionMetricsOptions, type FunctionMetricsOptions, type RasputinOptions } from '@rasputin-ai/core';
7
+ import { type RasputinOptions } from '@rasputin-ai/core';
8
8
  import type { ExecutionRecorderOptions, RasputinNodeClient } from '@rasputin-ai/node';
9
9
  import { type ExecutionRuntime } from '@rasputin-ai/node/internal';
10
10
  import { Elysia } from 'elysia';
@@ -48,17 +48,6 @@ export type RasputinElysiaOptions = RasputinOptions & {
48
48
  * values are treated as false.
49
49
  */
50
50
  dynamicDurationSampling?: boolean;
51
- /**
52
- * Opt-in function-level aggregate metrics. Off unless `enabled` is `true`.
53
- * Independent of `executionRecorder`.
54
- */
55
- functionMetrics?: FunctionMetricsOptions;
56
- /**
57
- * Execution-level counts, failures, and duration histograms. On with a
58
- * valid client. Set `enabled: false` to turn them off. Independent of
59
- * `executionRecorder` and `functionMetrics`.
60
- */
61
- executionMetrics?: ExecutionMetricsOptions;
62
51
  };
63
52
  declare const buildPlugin: (client: RasputinNodeClient, runtime: ExecutionRuntime, wrapRequests: boolean) => Elysia<"", {
64
53
  decorator: {
@@ -1 +1 @@
1
- {"version":3,"file":"rasputin-init.d.ts","sourceRoot":"","sources":["../src/rasputin-init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAIN,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAI3B,KAAK,eAAe,EAIpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACX,wBAAwB,EAExB,kBAAkB,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAQN,KAAK,gBAAgB,EAQrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,iFAAiF;AACjF,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAElE,MAAM,MAAM,cAAc,GAAG;IAC5B,8EAA8E;IAC9E,MAAM,EAAE,kBAAkB,CAAC;IAC3B,2EAA2E;IAC3E,MAAM,EAAE,oBAAoB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG;IACrD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,wBAAw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O,CAAC;IAChC;;;OAGG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IACzC;;;;;;;;;;;;OAYG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAgJF,QAAA,MAAM,WAAW,GAChB,QAAQ,kBAAkB,EAC1B,SAAS,gBAAgB,EACzB,cAAc,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmErB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAAC"}
@@ -1,4 +1,4 @@
1
1
  /** Generated by scripts/generate-sdk-meta.ts — do not edit. */
2
2
  export declare const SDK_NAME = "@rasputin-ai/elysia";
3
- export declare const SDK_VERSION = "0.14.0";
3
+ export declare const SDK_VERSION = "0.15.1";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/elysia",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "Official Rasputin AI SDK for Elysia.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -35,8 +35,8 @@
35
35
  "access": "public"
36
36
  },
37
37
  "dependencies": {
38
- "@rasputin-ai/core": "0.14.0",
39
- "@rasputin-ai/node": "0.14.0"
38
+ "@rasputin-ai/core": "0.15.1",
39
+ "@rasputin-ai/node": "0.15.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "elysia": ">=1.4.0 <2"