@slopmachine/core 0.0.1 → 0.1.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 +21 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/package.json +3 -3
- package/src/index.ts +3 -3
package/README.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# @slopmachine/core
|
|
2
|
+
|
|
3
|
+
The core logic and shared utilities for the Slop Machine SDK.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @slopmachine/core
|
|
9
|
+
# or
|
|
10
|
+
yarn add @slopmachine/core
|
|
11
|
+
# or
|
|
12
|
+
pnpm add @slopmachine/core
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
This package provides the core functions and type definitions used by the Slop Machine framework integrations (like `@slopmachine/react` and `@slopmachine/svelte`).
|
|
18
|
+
|
|
19
|
+
## License
|
|
20
|
+
|
|
21
|
+
MIT
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface SlopImageOptions {
|
|
2
2
|
prompt: string;
|
|
3
3
|
aspectRatio?: string;
|
|
4
|
-
model?:
|
|
4
|
+
model?: "gemini" | "gemini-flash" | "imagen";
|
|
5
5
|
variables?: Record<string, string | number | undefined | null>;
|
|
6
6
|
baseUrl?: string;
|
|
7
7
|
}
|
|
8
8
|
declare function interpolatePrompt(prompt: string, variables?: Record<string, string | number | undefined | null>): string;
|
|
9
|
-
declare function buildImageUrl(options:
|
|
9
|
+
declare function buildImageUrl(options: SlopImageOptions): string;
|
|
10
10
|
|
|
11
|
-
export { type
|
|
11
|
+
export { type SlopImageOptions, buildImageUrl, interpolatePrompt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface SlopImageOptions {
|
|
2
2
|
prompt: string;
|
|
3
3
|
aspectRatio?: string;
|
|
4
|
-
model?:
|
|
4
|
+
model?: "gemini" | "gemini-flash" | "imagen";
|
|
5
5
|
variables?: Record<string, string | number | undefined | null>;
|
|
6
6
|
baseUrl?: string;
|
|
7
7
|
}
|
|
8
8
|
declare function interpolatePrompt(prompt: string, variables?: Record<string, string | number | undefined | null>): string;
|
|
9
|
-
declare function buildImageUrl(options:
|
|
9
|
+
declare function buildImageUrl(options: SlopImageOptions): string;
|
|
10
10
|
|
|
11
|
-
export { type
|
|
11
|
+
export { type SlopImageOptions, buildImageUrl, interpolatePrompt };
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@slopmachine/core",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
9
10
|
"import": "./dist/index.mjs",
|
|
10
|
-
"require": "./dist/index.js"
|
|
11
|
-
"types": "./dist/index.d.ts"
|
|
11
|
+
"require": "./dist/index.js"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface SlopImageOptions {
|
|
2
2
|
prompt: string;
|
|
3
3
|
aspectRatio?: string;
|
|
4
|
-
model?:
|
|
4
|
+
model?: "gemini" | "gemini-flash" | "imagen";
|
|
5
5
|
variables?: Record<string, string | number | undefined | null>;
|
|
6
6
|
baseUrl?: string;
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ export function interpolatePrompt(
|
|
|
22
22
|
return text;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export function buildImageUrl(options:
|
|
25
|
+
export function buildImageUrl(options: SlopImageOptions): string {
|
|
26
26
|
const {
|
|
27
27
|
prompt,
|
|
28
28
|
aspectRatio = "1:1",
|