@rasputin-ai/sveltekit 0.16.0 → 1.0.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.
@@ -1,5 +1,3 @@
1
- export declare const isServerOnlyPath: (path: string) => boolean;
2
1
  export declare const isApplicationJsPath: (id: string, onlyIfPathIncludes?: string[]) => boolean;
3
2
  export declare const isCompiledSveltePath: (id: string, onlyIfPathIncludes?: string[]) => boolean;
4
- export declare const isBrowserClientEntry: (path: string) => boolean;
5
3
  //# sourceMappingURL=module-kind.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module-kind.d.ts","sourceRoot":"","sources":["../../src/vite/module-kind.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OAIhB,CAAC;AAQjC,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,EAAE,qBAAqB,MAAM,EAAE,KAAG,OAY/E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,EAAE,qBAAqB,MAAM,EAAE,KAAG,OAahF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,KAAG,OAgBnD,CAAC"}
1
+ {"version":3,"file":"module-kind.d.ts","sourceRoot":"","sources":["../../src/vite/module-kind.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,EAAE,qBAAqB,MAAM,EAAE,KAAG,OAW/E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,IAAI,MAAM,EAAE,qBAAqB,MAAM,EAAE,KAAG,OAahF,CAAC"}
@@ -1,16 +1,18 @@
1
+ /**
2
+ * Vite coordinator for SvelteKit SSR builds. Client bundles are not transformed.
3
+ * The machine running Vite is not assumed to be the deployment runtime.
4
+ */
1
5
  import type { RasputinEnvironment } from '@rasputin-ai/core';
2
6
  import type { Plugin } from 'vite';
3
7
  export type RasputinSvelteKitViteOptions = {
4
8
  enabled?: boolean;
5
9
  onlyIfPathIncludes?: string[];
6
10
  release: string;
7
- /** Secret project API key used to upload build artifacts. Never injected into the browser. */
11
+ /** Secret project API key used to upload the server instrumentation manifest. */
8
12
  projectApiKey?: string;
9
13
  apiUrl?: string;
10
14
  environment?: RasputinEnvironment;
11
15
  buildId?: string;
12
- serverBuildId?: string;
13
- includeRuntimeNames?: boolean;
14
16
  };
15
17
  export declare const rasputin: (options: RasputinSvelteKitViteOptions) => Plugin[];
16
18
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AA6BnC,MAAM,MAAM,4BAA4B,GAAG;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AA0BF,eAAO,MAAM,QAAQ,GAAI,SAAS,4BAA4B,KAAG,MAAM,EAqNtE,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAanC,MAAM,MAAM,4BAA4B,GAAG;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,iFAAiF;IACjF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAqBF,eAAO,MAAM,QAAQ,GAAI,SAAS,4BAA4B,KAAG,MAAM,EA2HtE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"rasputin-sdk-path.d.ts","sourceRoot":"","sources":["../../src/vite/rasputin-sdk-path.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAqB5E,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,KAAG,MAAqC,CAAC;AAoCvF,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,OAOpD,CAAC"}
1
+ {"version":3,"file":"rasputin-sdk-path.d.ts","sourceRoot":"","sources":["../../src/vite/rasputin-sdk-path.ts"],"names":[],"mappings":"AAoDA,eAAO,MAAM,kBAAkB,GAAI,IAAI,MAAM,KAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAqB5E,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,KAAG,MAAqC,CAAC;AAoCvF,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,OAOpD,CAAC"}
@@ -1,52 +1,10 @@
1
1
  import { type InstrumentationManifestContent } from '@rasputin-ai/core';
2
2
  import type { TargetState } from './target-state';
3
- type ClientDebugImage = {
4
- debugId: string;
5
- fileName: string;
6
- map: unknown;
7
- };
8
- type CaptureClass = 'full' | 'structure' | 'skip' | 'reactive-sparse';
9
- type ClientArtifactFunction = {
10
- functionId: string;
11
- name: string;
12
- packageName: string | null;
13
- packageRelativePath: string | null;
14
- line: number | null;
15
- column: number | null;
16
- endLine: number | null;
17
- endColumn: number | null;
18
- params: unknown[];
19
- captureClass: CaptureClass;
20
- captureReason: string;
21
- moduleIndex?: number;
22
- planIndex?: number;
23
- };
24
- type ClientBuildArtifact = {
25
- schema_version: 1;
26
- buildId: string;
27
- functions: ClientArtifactFunction[];
28
- identities: Array<{
29
- compactId: string;
30
- functionId: string;
31
- moduleIndex: number;
32
- planIndex: number;
33
- }>;
34
- callSites: unknown[];
35
- debugImages: ClientDebugImage[];
36
- };
37
- export declare const snapshotClientBuildArtifact: (state: TargetState, debugImages: ClientDebugImage[]) => ClientBuildArtifact;
38
3
  export declare const snapshotServerInstrumentationManifest: (state: TargetState) => InstrumentationManifestContent;
39
- export declare const uploadClientBuildArtifact: (input: {
40
- artifacts: ClientBuildArtifact;
41
- release: string;
42
- projectApiKey?: string;
43
- apiUrl?: string;
44
- }) => Promise<"uploaded" | "duplicate" | "conflict" | "skipped" | "failed">;
45
4
  export declare const uploadServerBuildManifest: (input: {
46
5
  manifest: InstrumentationManifestContent;
47
6
  release: string;
48
7
  projectApiKey?: string;
49
8
  apiUrl?: string;
50
9
  }) => Promise<"uploaded" | "skipped" | "failed">;
51
- export {};
52
10
  //# sourceMappingURL=upload-build-artifacts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upload-build-artifacts.d.ts","sourceRoot":"","sources":["../../src/vite/upload-build-artifacts.ts"],"names":[],"mappings":"AACA,OAAO,EAGN,KAAK,8BAA8B,EAGnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,KAAK,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,O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C;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,KAAG,OAAO,CAAC,UAAU,GAAG,WAAW,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,CAwCvE,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,OAAO;IACtD,QAAQ,EAAE,8BAA8B,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,KAAG,OAAO,CAAC,UAAU,GAAG,SAAS,GAAG,QAAQ,CAgB5C,CAAC"}
1
+ {"version":3,"file":"upload-build-artifacts.d.ts","sourceRoot":"","sources":["../../src/vite/upload-build-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,KAAK,8BAA8B,EAInC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAoBlD,eAAO,MAAM,qCAAqC,GACjD,OAAO,WAAW,KAChB,8BAsBF,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAU,OAAO;IACtD,QAAQ,EAAE,8BAA8B,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,KAAG,OAAO,CAAC,UAAU,GAAG,SAAS,GAAG,QAAQ,CAmB5C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rasputin-ai/sveltekit",
3
- "version": "0.16.0",
3
+ "version": "1.0.0",
4
4
  "description": "Official Rasputin AI SDK for SvelteKit.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,11 +9,6 @@
9
9
  "import": "./dist/index.js",
10
10
  "default": "./dist/index.js"
11
11
  },
12
- "./client": {
13
- "types": "./dist/client/hooks.d.ts",
14
- "import": "./dist/client/hooks.js",
15
- "default": "./dist/client/hooks.js"
16
- },
17
12
  "./vite": {
18
13
  "types": "./dist/vite/index.d.ts",
19
14
  "import": "./dist/vite/index.js",
@@ -42,9 +37,8 @@
42
37
  "access": "public"
43
38
  },
44
39
  "dependencies": {
45
- "@rasputin-ai/browser": "0.16.0",
46
- "@rasputin-ai/core": "0.16.0",
47
- "@rasputin-ai/node": "0.16.0",
40
+ "@rasputin-ai/core": "1.0.0",
41
+ "@rasputin-ai/node": "1.0.0",
48
42
  "typescript": "5"
49
43
  },
50
44
  "peerDependencies": {
@@ -56,7 +50,7 @@
56
50
  "@sveltejs/adapter-node": "5",
57
51
  "@sveltejs/kit": "2",
58
52
  "@sveltejs/vite-plugin-svelte": "5",
59
- "@types/bun": "1.3.14",
53
+ "@types/bun": "1.4.5",
60
54
  "@types/node": "22.13.10",
61
55
  "svelte": "5.55.2",
62
56
  "typescript": "6.0.3",
@@ -1,12 +0,0 @@
1
- import { type ClientInit, type HandleClientError } from '@sveltejs/kit';
2
- import type { RasputinSvelteKitClientOptions } from './options';
3
- export type RasputinSvelteKitClientHooks = {
4
- init: ClientInit;
5
- handleError: HandleClientError;
6
- };
7
- export type RasputinSvelteKitClientHooksOptions = RasputinSvelteKitClientOptions & {
8
- init?: ClientInit;
9
- handleError?: HandleClientError;
10
- };
11
- export declare function rasputinClientHooks(options: RasputinSvelteKitClientHooksOptions): RasputinSvelteKitClientHooks;
12
- //# sourceMappingURL=hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../../src/client/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAe,MAAM,eAAe,CAAC;AACrF,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAOhE,MAAM,MAAM,4BAA4B,GAAG;IAC1C,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,iBAAiB,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG,8BAA8B,GAAG;IAClF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,iBAAiB,CAAC;CAChC,CAAC;AAOF,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,mCAAmC,GAC1C,4BAA4B,CAAC"}
@@ -1,39 +0,0 @@
1
- // src/client/hooks.ts
2
- import { RasputinInit } from "@rasputin-ai/browser";
3
- import { isHttpError } from "@sveltejs/kit";
4
- var shouldCaptureClientError = (error) => {
5
- if (isHttpError(error)) return false;
6
- return error instanceof Error || typeof error === "string";
7
- };
8
- function rasputinClientHooks(options, internals = {}) {
9
- const { init: userInit, handleError: userHandleError, ...clientOptions } = options;
10
- let client;
11
- const createClient = internals.createClient ?? RasputinInit;
12
- return {
13
- init: () => {
14
- try {
15
- client = createClient({
16
- ...clientOptions,
17
- // Event-handler throws never reach Kit handleError.
18
- installGlobalHandlers: clientOptions.installGlobalHandlers ?? true
19
- });
20
- } catch {
21
- client = void 0;
22
- }
23
- return userInit?.();
24
- },
25
- handleError: (input) => {
26
- try {
27
- if (shouldCaptureClientError(input.error)) {
28
- client?.captureException(input.error);
29
- }
30
- } catch {
31
- }
32
- if (userHandleError) return userHandleError(input);
33
- return { message: input.message };
34
- }
35
- };
36
- }
37
- export {
38
- rasputinClientHooks
39
- };
@@ -1,16 +0,0 @@
1
- import type { RasputinEnvironment } from '@rasputin-ai/core';
2
- /**
3
- * Public browser configuration only. The privileged project key cannot appear
4
- * here, so it is structurally excluded from the client hook API.
5
- */
6
- export type RasputinSvelteKitClientOptions = {
7
- dsn?: string;
8
- environment: RasputinEnvironment;
9
- release: string;
10
- buildId?: string;
11
- enabled?: boolean;
12
- apiUrl?: string;
13
- logSuccess?: boolean;
14
- installGlobalHandlers?: boolean;
15
- };
16
- //# sourceMappingURL=options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/client/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,8BAA8B,GAAG;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC"}
@@ -1,12 +0,0 @@
1
- import type { RasputinEnvironment } from '@rasputin-ai/core';
2
- export declare const VIRTUAL_IDENTITY_ID = "virtual:rasputin-identity";
3
- export declare const RESOLVED_VIRTUAL_IDENTITY_ID = "\0virtual:rasputin-identity";
4
- export declare const BUILD_IDENTITIES_MARKER = "@@RASPUTIN_IDENTITIES@@";
5
- export declare const BUILD_STATS_MARKER = "@@RASPUTIN_STATS@@";
6
- export declare const isVirtualIdentityId: (id: string) => boolean;
7
- export declare const clientIdentitySource: (input: {
8
- buildId: string;
9
- release: string;
10
- environment?: RasputinEnvironment;
11
- }) => string;
12
- //# sourceMappingURL=virtual-identity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-identity.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAC/D,eAAO,MAAM,4BAA4B,gCAA6B,CAAC;AACvE,eAAO,MAAM,uBAAuB,4BAA4B,CAAC;AACjE,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,eAAO,MAAM,mBAAmB,GAAI,IAAI,MAAM,KAAG,OACiB,CAAC;AAEnE,eAAO,MAAM,oBAAoB,GAAI,OAAO;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,mBAAmB,CAAC;CAClC,KAAG,MAiBH,CAAC"}