@rasputin-ai/node 0.1.3 → 0.2.0

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
@@ -8,7 +8,8 @@ import { RasputinInit } from '@rasputin-ai/node';
8
8
  const rasputin = RasputinInit({
9
9
  projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
10
10
  environment: process.env.NODE_ENV ?? 'development',
11
- release: process.env.GIT_COMMIT,
11
+ release: process.env.RASPUTIN_RELEASE,
12
+ moduleUrl: import.meta.url,
12
13
  });
13
14
 
14
15
  try {
@@ -28,6 +29,7 @@ For short-lived processes (scripts, serverless), call `await rasputin.flush()` b
28
29
  | --- | --- | --- |
29
30
  | `projectApiKey` | yes | Project API key from the Rasputin dashboard |
30
31
  | `environment` | yes | Where errors occur, e.g. `production`, `staging` |
31
- | `release` | no | Deploy id (usually a git SHA). Auto-detected from common CI env vars when omitted |
32
+ | `release` | no | Git commit SHA. Prefer `process.env.RASPUTIN_RELEASE`; auto-detected from platform env / `.git` when omitted |
32
33
  | `enabled` | no | Master switch. Default `true` |
33
- | `repoRoot` | no | Repo root for stack paths. |
34
+ | `moduleUrl` | one of these two | `import.meta.url` from the file where you call `RasputinInit`. Lets Rasputin find your project folder. |
35
+ | `repoRoot` | one of these two | Your project folder — the one you open in your editor. Use this when `moduleUrl` isn't enough (for example in Docker). |
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/install-global-handlers.ts
2
+ var removeProcessListener = process.off.bind(process);
2
3
  var installGlobalHandlers = (client, options = {}) => {
3
4
  const exitOnUncaught = options.exitOnUncaughtException ?? true;
4
5
  const flushTimeoutMs = options.flushTimeoutMs ?? 2e3;
@@ -38,8 +39,8 @@ var installGlobalHandlers = (client, options = {}) => {
38
39
  }
39
40
  return () => {
40
41
  try {
41
- process.off("uncaughtException", onUncaughtException);
42
- process.off("unhandledRejection", onUnhandledRejection);
42
+ removeProcessListener("uncaughtException", onUncaughtException);
43
+ removeProcessListener("unhandledRejection", onUnhandledRejection);
43
44
  } catch {
44
45
  }
45
46
  };
@@ -53,7 +54,7 @@ import {
53
54
 
54
55
  // src/sdk-meta.ts
55
56
  var SDK_NAME = "@rasputin-ai/node";
56
- var SDK_VERSION = "0.1.3";
57
+ var SDK_VERSION = "0.2.0";
57
58
 
58
59
  // src/rasputin-init.ts
59
60
  var RasputinInit = (options) => {
@@ -1 +1 @@
1
- {"version":3,"file":"install-global-handlers.d.ts","sourceRoot":"","sources":["../src/install-global-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,4BAA4B,GAAG;IAC1C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GACjC,QAAQ,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,OAAO,CAAC,EAC1D,UAAS,4BAAiC,KACxC,CAAC,MAAM,IAAI,CAuDb,CAAC"}
1
+ {"version":3,"file":"install-global-handlers.d.ts","sourceRoot":"","sources":["../src/install-global-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,MAAM,4BAA4B,GAAG;IAC1C;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GACjC,QAAQ,IAAI,CAAC,cAAc,EAAE,kBAAkB,GAAG,OAAO,CAAC,EAC1D,UAAS,4BAAiC,KACxC,CAAC,MAAM,IAAI,CAuDb,CAAC"}
@@ -2,6 +2,14 @@ import { type RasputinClient, type RasputinOptions } from '@rasputin-ai/core';
2
2
  /**
3
3
  * Boot the Node/Bun SDK: client + process global handlers.
4
4
  * Call once at process start. Never throws into the host app.
5
+ *
6
+ * @example
7
+ * RasputinInit({
8
+ * projectApiKey: process.env.RASPUTIN_PROJECT_API_KEY!,
9
+ * environment: process.env.NODE_ENV ?? 'development',
10
+ * release: process.env.RASPUTIN_RELEASE,
11
+ * moduleUrl: import.meta.url,
12
+ * });
5
13
  */
6
14
  export declare const RasputinInit: (options: RasputinOptions) => RasputinClient;
7
15
  //# sourceMappingURL=rasputin-init.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rasputin-init.d.ts","sourceRoot":"","sources":["../src/rasputin-init.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,mBAAmB,CAAC;AAI3B;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,eAAe,KAAG,cAUvD,CAAC"}
1
+ {"version":3,"file":"rasputin-init.d.ts","sourceRoot":"","sources":["../src/rasputin-init.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,SAAS,eAAe,KAAG,cAUvD,CAAC"}
@@ -1,4 +1,4 @@
1
1
  /** Generated by packages/sdk/scripts/generate-sdk-meta.ts — do not edit. */
2
2
  export declare const SDK_NAME = "@rasputin-ai/node";
3
- export declare const SDK_VERSION = "0.1.3";
3
+ export declare const SDK_VERSION = "0.2.0";
4
4
  //# sourceMappingURL=sdk-meta.d.ts.map
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@rasputin-ai/node",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "description": "Official Rasputin AI SDK for Node and Bun.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {
8
- "bun": "./src/index.ts",
9
8
  "types": "./dist/index.d.ts",
10
9
  "import": "./dist/index.js",
11
10
  "default": "./dist/index.js"
@@ -26,7 +25,7 @@
26
25
  "access": "public"
27
26
  },
28
27
  "dependencies": {
29
- "@rasputin-ai/core": "0.1.3"
28
+ "@rasputin-ai/core": "0.2.0"
30
29
  },
31
30
  "devDependencies": {
32
31
  "@rasputin-ai/core": "workspace:*",