@rasputin-ai/sveltekit 0.7.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.
Files changed (42) hide show
  1. package/README.md +5 -0
  2. package/dist/client/hooks.d.ts +12 -0
  3. package/dist/client/hooks.d.ts.map +1 -0
  4. package/dist/client/hooks.js +39 -0
  5. package/dist/client/options.d.ts +15 -0
  6. package/dist/client/options.d.ts.map +1 -0
  7. package/dist/compiler/svelte-generated.d.ts +7 -0
  8. package/dist/compiler/svelte-generated.d.ts.map +1 -0
  9. package/dist/index.d.ts +4 -0
  10. package/dist/index.d.ts.map +1 -0
  11. package/dist/index.js +130 -0
  12. package/dist/runtime/node.d.ts +10 -0
  13. package/dist/runtime/node.d.ts.map +1 -0
  14. package/dist/runtime/node.js +180 -0
  15. package/dist/sdk-meta.d.ts +4 -0
  16. package/dist/sdk-meta.d.ts.map +1 -0
  17. package/dist/server/expected-error.d.ts +3 -0
  18. package/dist/server/expected-error.d.ts.map +1 -0
  19. package/dist/server/hooks.d.ts +22 -0
  20. package/dist/server/hooks.d.ts.map +1 -0
  21. package/dist/server/request-scopes.d.ts +5 -0
  22. package/dist/server/request-scopes.d.ts.map +1 -0
  23. package/dist/shared/server-runtime.d.ts +44 -0
  24. package/dist/shared/server-runtime.d.ts.map +1 -0
  25. package/dist/vite/build-identity.d.ts +4 -0
  26. package/dist/vite/build-identity.d.ts.map +1 -0
  27. package/dist/vite/identify-environment.d.ts +8 -0
  28. package/dist/vite/identify-environment.d.ts.map +1 -0
  29. package/dist/vite/index.d.ts +3 -0
  30. package/dist/vite/index.d.ts.map +1 -0
  31. package/dist/vite/index.js +5095 -0
  32. package/dist/vite/module-kind.d.ts +7 -0
  33. package/dist/vite/module-kind.d.ts.map +1 -0
  34. package/dist/vite/plugin.d.ts +15 -0
  35. package/dist/vite/plugin.d.ts.map +1 -0
  36. package/dist/vite/rasputin-sdk-path.d.ts +7 -0
  37. package/dist/vite/rasputin-sdk-path.d.ts.map +1 -0
  38. package/dist/vite/upload-build-artifacts.d.ts +68 -0
  39. package/dist/vite/upload-build-artifacts.d.ts.map +1 -0
  40. package/dist/vite/virtual-identity.d.ts +11 -0
  41. package/dist/vite/virtual-identity.d.ts.map +1 -0
  42. package/package.json +65 -0
@@ -0,0 +1,7 @@
1
+ export declare const isServerOnlyPath: (path: string) => boolean;
2
+ export declare const isFrameworkGeneratedPath: (path: string) => boolean;
3
+ export declare const isJsModulePath: (path: string) => boolean;
4
+ export declare const isApplicationJsPath: (id: string, onlyIfPathIncludes?: string[]) => boolean;
5
+ export declare const isCompiledSveltePath: (id: string, onlyIfPathIncludes?: string[]) => boolean;
6
+ export declare const isBrowserClientEntry: (path: string) => boolean;
7
+ //# sourceMappingURL=module-kind.d.ts.map
@@ -0,0 +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;AAEjC,eAAO,MAAM,wBAAwB,GAAI,MAAM,MAAM,KAAG,OACU,CAAC;AAEnE,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,KAAG,OACU,CAAC;AAEzD,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"}
@@ -0,0 +1,15 @@
1
+ import type { Plugin } from 'vite';
2
+ export type RasputinSvelteKitViteOptions = {
3
+ enabled?: boolean;
4
+ onlyIfPathIncludes?: string[];
5
+ release: string;
6
+ /** Secret project API key used to upload build artifacts. Never injected into the browser. */
7
+ projectApiKey?: string;
8
+ apiUrl?: string;
9
+ environment?: string;
10
+ buildId?: string;
11
+ serverBuildId?: string;
12
+ includeRuntimeNames?: boolean;
13
+ };
14
+ export declare const rasputin: (options: RasputinSvelteKitViteOptions) => Plugin[];
15
+ //# sourceMappingURL=plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAOA,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,MAAM,CAAC;IACrB,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"}
@@ -0,0 +1,7 @@
1
+ export declare const modulePathAndQuery: (id: string) => {
2
+ path: string;
3
+ query: string;
4
+ };
5
+ export declare const normalizeModulePath: (id: string) => string;
6
+ export declare const isRasputinSdkPath: (idOrPath: string) => boolean;
7
+ //# sourceMappingURL=rasputin-sdk-path.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,68 @@
1
+ import { type InstrumentationManifestContent } from '@rasputin-ai/core';
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
+ filePath: string;
20
+ captureClass: CaptureClass;
21
+ captureReason: string;
22
+ moduleIndex?: number;
23
+ planIndex?: number;
24
+ };
25
+ type ClientBuildArtifact = {
26
+ schema_version: 1;
27
+ buildId: string;
28
+ functions: ClientArtifactFunction[];
29
+ identities: Array<{
30
+ compactId: string;
31
+ functionId: string;
32
+ name: string;
33
+ captureClass: CaptureClass;
34
+ packageRelativePath: string | null;
35
+ line: number | null;
36
+ column: number | null;
37
+ moduleIndex: number;
38
+ planIndex: number;
39
+ }>;
40
+ callSites: unknown[];
41
+ destructures: unknown[];
42
+ expressionSites: unknown[];
43
+ classification: {
44
+ full: number;
45
+ structure: number;
46
+ skip: number;
47
+ reactiveSparse: number;
48
+ expressionSites: number;
49
+ };
50
+ debugImages: ClientDebugImage[];
51
+ verificationFailed: string[];
52
+ };
53
+ export declare const snapshotClientBuildArtifact: (state: TargetState, debugImages: ClientDebugImage[]) => ClientBuildArtifact;
54
+ export declare const snapshotServerInstrumentationManifest: (state: TargetState) => InstrumentationManifestContent;
55
+ export declare const uploadClientBuildArtifact: (input: {
56
+ artifacts: ClientBuildArtifact;
57
+ release: string;
58
+ projectApiKey?: string;
59
+ apiUrl?: string;
60
+ }) => Promise<"uploaded" | "duplicate" | "conflict" | "skipped" | "failed">;
61
+ export declare const uploadServerBuildManifest: (input: {
62
+ manifest: InstrumentationManifestContent;
63
+ release: string;
64
+ projectApiKey?: string;
65
+ apiUrl?: string;
66
+ }) => Promise<"uploaded" | "skipped" | "failed">;
67
+ export {};
68
+ //# sourceMappingURL=upload-build-artifacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload-build-artifacts.d.ts","sourceRoot":"","sources":["../../src/vite/upload-build-artifacts.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,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,OAAO,CAAA;CAAE,CAAC;AAE5E,KAAK,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAEtE,KAAK,sBAAsB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,KAAK,mBAAmB,GAAG;IAC1B,cAAc,EAAE,CAAC,CAAC;IAClB,OAAO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M,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"}
@@ -0,0 +1,11 @@
1
+ export declare const VIRTUAL_IDENTITY_ID = "virtual:rasputin-identity";
2
+ export declare const RESOLVED_VIRTUAL_IDENTITY_ID = "\0virtual:rasputin-identity";
3
+ export declare const BUILD_IDENTITIES_MARKER = "@@RASPUTIN_IDENTITIES@@";
4
+ export declare const BUILD_STATS_MARKER = "@@RASPUTIN_STATS@@";
5
+ export declare const isVirtualIdentityId: (id: string) => boolean;
6
+ export declare const clientIdentitySource: (input: {
7
+ buildId: string;
8
+ release: string;
9
+ environment?: string;
10
+ }) => string;
11
+ //# sourceMappingURL=virtual-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-identity.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-identity.ts"],"names":[],"mappings":"AAAA,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,MAAM,CAAC;CACrB,KAAG,MAeH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@rasputin-ai/sveltekit",
3
+ "version": "0.7.0",
4
+ "description": "Official Rasputin AI SDK for SvelteKit.",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/index.d.ts",
9
+ "import": "./dist/index.js",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./client": {
13
+ "types": "./dist/client/hooks.d.ts",
14
+ "import": "./dist/client/hooks.js",
15
+ "default": "./dist/client/hooks.js"
16
+ },
17
+ "./vite": {
18
+ "types": "./dist/vite/index.d.ts",
19
+ "import": "./dist/vite/index.js",
20
+ "default": "./dist/vite/index.js"
21
+ },
22
+ "./runtime/node": {
23
+ "types": "./dist/runtime/node.d.ts",
24
+ "import": "./dist/runtime/node.js",
25
+ "default": "./dist/runtime/node.js"
26
+ }
27
+ },
28
+ "files": [
29
+ "dist"
30
+ ],
31
+ "scripts": {
32
+ "build": "bun ../../scripts/build-package.ts .",
33
+ "prepack": "bun ../../scripts/sanitize-published-package-json.ts apply",
34
+ "postpack": "bun ../../scripts/sanitize-published-package-json.ts restore",
35
+ "prepublishOnly": "npm run build && bun ../../scripts/check-lockstep-versions.ts",
36
+ "pack:check": "npm run build && npm pack --dry-run",
37
+ "typecheck": "bun ../../scripts/generate-sdk-meta.ts . && bunx tsc --noEmit",
38
+ "lint": "biome check src tests",
39
+ "test": "bun test"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public"
43
+ },
44
+ "dependencies": {
45
+ "@rasputin-ai/browser": "0.7.0",
46
+ "@rasputin-ai/core": "0.7.0",
47
+ "@rasputin-ai/node": "0.7.0",
48
+ "typescript": ">=5"
49
+ },
50
+ "peerDependencies": {
51
+ "@sveltejs/kit": ">=2",
52
+ "svelte": ">=5",
53
+ "vite": ">=5"
54
+ },
55
+ "devDependencies": {
56
+ "@sveltejs/adapter-node": "5",
57
+ "@sveltejs/kit": "2",
58
+ "@sveltejs/vite-plugin-svelte": "5",
59
+ "@types/bun": "1.3.14",
60
+ "@types/node": "22.13.10",
61
+ "svelte": "5.55.2",
62
+ "typescript": "6.0.3",
63
+ "vite": "6.3.5"
64
+ }
65
+ }