@rasputin-ai/elysia 0.3.0 → 0.4.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/README.md CHANGED
@@ -15,7 +15,6 @@ const { client, plugin } = RasputinInit({
15
15
  release: process.env.RASPUTIN_RELEASE!,
16
16
  environment: process.env.NODE_ENV ?? 'development',
17
17
  enabled: ['staging', 'production'].includes(process.env.NODE_ENV ?? 'development'),
18
- moduleUrl: import.meta.url,
19
18
  });
20
19
 
21
20
  const app = new Elysia()
@@ -44,8 +43,23 @@ try {
44
43
  | `environment` | yes | Environment such as `production`, `staging`, or `preview` |
45
44
  | `release` | yes | Git commit SHA for the deployed version |
46
45
  | `enabled` | no | Enables or disables the SDK; defaults to `true` |
47
- | `moduleUrl` | one of these two | `import.meta.url` from the initialization file |
48
- | `repoRoot` | one of these two | Explicit source root for deployments with a different filesystem layout |
46
+ | `logSuccess` | no | Prints a configuration summary when setup succeeds; defaults to `true`. Failures always log. |
47
+ | `moduleUrl` | no | `import.meta.url` from the initialization file; helps normalize local stack paths |
48
+ | `sourceRoot` | no | Git repository folder for a single-package service, such as `apps/api` |
49
+ | `sourceRoots` | no | Package-name to Git-folder mappings for ambiguous monorepos |
50
+ | `repoRoot` | no | Local filesystem display root; it does not control instrumentation or Git identity |
51
+
52
+ Rasputin normally identifies source from the nearest `package.json` and verifies it against the exact release on the server. Filesystem paths such as `/container` are never used as source identity.
53
+
54
+ For deployment checks, call:
55
+
56
+ ```ts
57
+ const verification = await client.verifyConfiguration();
58
+ ```
59
+
60
+ `verified` means every instrumented source file maps uniquely to the configured Git release. If a monorepo is ambiguous, set `sourceRoot` or `sourceRoots` using repository-relative folders, never Docker paths.
61
+
62
+ Rasputin also prints a configuration summary after the instrumentation manifest is uploaded. Set `logSuccess: false` if you do not want that banner in production logs. Mapping failures still warn.
49
63
 
50
64
  ## Shutdown
51
65
 
@@ -130,7 +144,7 @@ Defaults work for most apps. Customize to exclude noisy sources, redact fields,
130
144
  | `maxStringLength` | `500` | Maximum characters retained from one string |
131
145
  | `maxSerializedValueBytes` | `8 KiB` | Maximum retained size of one captured value |
132
146
  | `redactKeys` | `[]` | Additional case-insensitive property names to redact |
133
- | `excludeSources` | `[]` | Source globs or function-ID patterns to exclude |
147
+ | `excludeSources` | `[]` | Source globs or function-name patterns to exclude |
134
148
 
135
149
  ```ts
136
150
  const { client, plugin } = RasputinInit({
package/dist/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  // src/rasputin-init.ts
2
2
  import {
3
3
  createClient,
4
- isClientEnabled,
5
- resolveRepoRoot
4
+ isClientEnabled
6
5
  } from "@rasputin-ai/core";
7
6
  import {
8
7
  createExecutionRecorder,
@@ -14,20 +13,18 @@ import { Elysia } from "elysia";
14
13
 
15
14
  // src/sdk-meta.ts
16
15
  var SDK_NAME = "@rasputin-ai/elysia";
17
- var SDK_VERSION = "0.3.0";
16
+ var SDK_VERSION = "0.4.1";
18
17
 
19
18
  // src/rasputin-init.ts
20
- var withExecution = (client, execution, installRuntime, repoRoot, manifest) => {
21
- const uninstallRuntime = installRuntime ? installAutomaticExecutionRuntime(execution, { repoRoot }) : () => {
19
+ var withExecution = (client, execution, installRuntime, manifest) => {
20
+ const uninstallRuntime = installRuntime ? installAutomaticExecutionRuntime(execution) : () => {
22
21
  };
23
- const manifestUpload = scheduleInstrumentationManifestUpload({
24
- ...manifest,
25
- repoRoot
26
- });
22
+ const manifestUpload = scheduleInstrumentationManifestUpload(manifest);
27
23
  return {
28
24
  ...client,
29
25
  execution,
30
26
  getStats: () => ({ ...client.getStats(), recorder: execution.getStats() }),
27
+ verifyConfiguration: manifestUpload.verify,
31
28
  captureException: (error, context) => {
32
29
  const runtimeState = context?.runtimeState ?? execution.getErrorState(
33
30
  error,
@@ -142,19 +139,16 @@ function RasputinInit(options, hooks = {}) {
142
139
  ...options.executionRecorder,
143
140
  enabled: recorderEnabled
144
141
  });
145
- const wrappedClient = withExecution(
146
- client,
147
- execution,
148
- recorderEnabled,
149
- resolveRepoRoot(options),
150
- {
151
- projectApiKey: options.projectApiKey,
152
- release: options.release,
153
- apiUrl: options.apiUrl,
154
- fetch,
155
- enabled: isClientEnabled(options)
156
- }
157
- );
142
+ const wrappedClient = withExecution(client, execution, recorderEnabled, {
143
+ projectApiKey: options.projectApiKey,
144
+ release: options.release,
145
+ apiUrl: options.apiUrl,
146
+ fetch,
147
+ enabled: isClientEnabled(options),
148
+ sourceRoot: options.sourceRoot,
149
+ sourceRoots: options.sourceRoots,
150
+ logSuccess: options.logSuccess
151
+ });
158
152
  if (isClientEnabled(options) && installProcessHandlers) {
159
153
  installGlobalHandlers(wrappedClient);
160
154
  }
@@ -165,11 +159,14 @@ function RasputinInit(options, hooks = {}) {
165
159
  } catch {
166
160
  const client = createClient({ ...options, enabled: false });
167
161
  const execution = createExecutionRecorder({ enabled: false });
168
- const wrappedClient = withExecution(client, execution, false, void 0, {
162
+ const wrappedClient = withExecution(client, execution, false, {
169
163
  projectApiKey: options.projectApiKey,
170
164
  release: options.release,
171
165
  apiUrl: options.apiUrl,
172
- enabled: false
166
+ enabled: false,
167
+ sourceRoot: options.sourceRoot,
168
+ sourceRoots: options.sourceRoots,
169
+ logSuccess: options.logSuccess
173
170
  });
174
171
  return { client: wrappedClient, plugin: buildPlugin(wrappedClient, execution, false) };
175
172
  }
@@ -55,7 +55,6 @@ declare const buildPlugin: (client: RasputinNodeClient, execution: RasputinExecu
55
55
  * release: process.env.RASPUTIN_RELEASE!,
56
56
  * environment: process.env.NODE_ENV ?? 'development',
57
57
  * enabled: ['staging', 'production'].includes(process.env.NODE_ENV ?? 'development'),
58
- * moduleUrl: import.meta.url,
59
58
  * });
60
59
  * app.use(plugin); // Chain this plugin as early as possible with .use(), before any other plugins or middleware.
61
60
  * client.captureException(err); // manual capture
@@ -1 +1 @@
1
- {"version":3,"file":"rasputin-init.d.ts","sourceRoot":"","sources":["../src/rasputin-init.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAC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M,MAAM,qBAAqB,GAAG,eAAe,GAAG;IACrD,8FAA8F;IAC9F,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;CAC7C,CAAC;AA4FF,QAAA,MAAM,WAAW,GAChB,QAAQ,kBAAkB,EAC1B,WAAW,iBAAiB,EAC5B,iBAAiB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0DxB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAAC"}
@@ -1,4 +1,4 @@
1
- /** Generated by packages/sdk/scripts/generate-sdk-meta.ts — do not edit. */
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.3.0";
3
+ export declare const SDK_VERSION = "0.4.1";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAC9C,eAAO,MAAM,WAAW,UAAU,CAAC"}
1
+ {"version":3,"file":"sdk-meta.d.ts","sourceRoot":"","sources":["../src/sdk-meta.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,wBAAwB,CAAC;AAC9C,eAAO,MAAM,WAAW,UAAU,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/elysia",
3
- "version": "0.3.0",
3
+ "version": "0.4.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.3.0",
39
- "@rasputin-ai/node": "0.3.0"
38
+ "@rasputin-ai/core": "0.4.1",
39
+ "@rasputin-ai/node": "0.4.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "elysia": ">=1.4.0 <2"