@howells/motif-sdk 5.4.0 → 6.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.
- package/README.md +3 -3
- package/dist/image.js +1 -74
- package/dist/index.cjs +30 -1042
- package/dist/index.d.cts +4 -11
- package/dist/index.d.ts +4 -11
- package/dist/index.js +31 -1042
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -150,7 +150,7 @@ export declare const CREATIVE_TAXONOMY: {
|
|
|
150
150
|
readonly experimental: true;
|
|
151
151
|
readonly id: "illustration";
|
|
152
152
|
readonly label: "Editorial illustration";
|
|
153
|
-
readonly model: "
|
|
153
|
+
readonly model: "flare";
|
|
154
154
|
}];
|
|
155
155
|
readonly mood: readonly [{
|
|
156
156
|
readonly clause: "soft natural daylight from a window out of frame, gentle falloff into the corners, low contrast, even diffused light with soft, held highlights";
|
|
@@ -1030,8 +1030,6 @@ interface TaskUnresolved {
|
|
|
1030
1030
|
type TaskResolution = TaskResolved | TaskUnresolved;
|
|
1031
1031
|
interface ModelProfile {
|
|
1032
1032
|
readonly capabilities: ReadonlySet<Capability>;
|
|
1033
|
-
/** Capabilities reachable only when this key variable is set. */
|
|
1034
|
-
readonly keyedCapabilities: ReadonlyMap<Capability, string>;
|
|
1035
1033
|
/** Key variables the Model needs for any request. */
|
|
1036
1034
|
readonly keys: readonly string[];
|
|
1037
1035
|
readonly maxReferences: number;
|
|
@@ -1140,8 +1138,6 @@ export declare function sumCosts(costs: readonly (number | null)[]): {
|
|
|
1140
1138
|
interface MotifClientConfig {
|
|
1141
1139
|
/** Falls back to FAL_KEY. */
|
|
1142
1140
|
falKey?: string;
|
|
1143
|
-
/** Falls back to OPENAI_API_KEY. Used only by Models routed through OpenAI. */
|
|
1144
|
-
openAiKey?: string;
|
|
1145
1141
|
/** Models pinned per Task, as `resolveTask` takes them. */
|
|
1146
1142
|
pins?: TaskEnvironment["pins"];
|
|
1147
1143
|
/** The one network seam. Defaults to global fetch. Retries and timeouts still apply. */
|
|
@@ -1259,8 +1255,8 @@ interface TaskPlan {
|
|
|
1259
1255
|
queued: boolean;
|
|
1260
1256
|
/** Projected: before the call. */
|
|
1261
1257
|
cost: ResolvedCost;
|
|
1262
|
-
/** The provider carrying the request.
|
|
1263
|
-
provider: "fal"
|
|
1258
|
+
/** The provider carrying the request. */
|
|
1259
|
+
provider: "fal";
|
|
1264
1260
|
}
|
|
1265
1261
|
interface TaskOutput extends Omit<TaskPlan, "body" | "cost" | "queued"> {
|
|
1266
1262
|
files: TaskFile[];
|
|
@@ -1311,7 +1307,7 @@ interface MotifClient {
|
|
|
1311
1307
|
*/
|
|
1312
1308
|
resume: (task: TaskId, input: TaskInput, requestId: string) => Promise<Result$1<TaskOutput, MotifError>>;
|
|
1313
1309
|
}
|
|
1314
|
-
/** Create the Task client.
|
|
1310
|
+
/** Create the Task client. The key falls back to FAL_KEY. */
|
|
1315
1311
|
export declare function createMotif(config?: MotifClientConfig): MotifClient;
|
|
1316
1312
|
//#endregion
|
|
1317
1313
|
//#region src/task-plan-shared.d.ts
|
|
@@ -1357,13 +1353,10 @@ export declare function promptWarnings(prompt: string, context?: {
|
|
|
1357
1353
|
export declare const motifEnvSchema: import("@howells/envy").EnvSchema<{
|
|
1358
1354
|
readonly optional: {
|
|
1359
1355
|
FAL_KEY: z.ZodString;
|
|
1360
|
-
OPENAI_API_KEY: z.ZodString;
|
|
1361
1356
|
};
|
|
1362
1357
|
}>;
|
|
1363
1358
|
type MotifEnv = ReturnType<typeof motifEnvSchema.parse>;
|
|
1364
1359
|
export declare function parseMotifEnv(input?: Record<string, unknown>): MotifEnv;
|
|
1365
1360
|
export declare function getFalKeyFromEnv(input?: Record<string, unknown>): string | undefined;
|
|
1366
|
-
/** The OpenAI key, used by direct OpenAI routes such as gpt2 transparency. */
|
|
1367
|
-
export declare function getOpenAiKeyFromEnv(input?: Record<string, unknown>): string | undefined;
|
|
1368
1361
|
//#endregion
|
|
1369
1362
|
export { type AspectRatio, type Blocker, type Capability, type ChosenBy, type CreativeDirection, type CreativeField, type CreativeOption, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, type EnrichPromptOptions, type FalFetch, type ImageSizeBounds, type LookId, type LookOption, type ModelProfile, type MoodId, type MotifClient, type MotifClientConfig, type MotifEnv, type OutputDimensions, type PlanOptions, type PromptWarning, type PromptWarningRule, type RankedFrom, type RankedModel, type Resolution, type ResolvedCost, type Result, type ResultAsync, type TaskDefinition, type TaskEnvironment, type TaskFile, type TaskFunction, type TaskId, type TaskInput, type TaskMode, type TaskOutput, type TaskPlan, type TaskRequest, type TaskResolution, type TaskResolved, type TaskStream, type TaskStreamEvent, type TaskStreamOptions, type TaskUnresolved, type Tier, type Unblocker, err, ok };
|
package/dist/index.d.ts
CHANGED
|
@@ -150,7 +150,7 @@ export declare const CREATIVE_TAXONOMY: {
|
|
|
150
150
|
readonly experimental: true;
|
|
151
151
|
readonly id: "illustration";
|
|
152
152
|
readonly label: "Editorial illustration";
|
|
153
|
-
readonly model: "
|
|
153
|
+
readonly model: "flare";
|
|
154
154
|
}];
|
|
155
155
|
readonly mood: readonly [{
|
|
156
156
|
readonly clause: "soft natural daylight from a window out of frame, gentle falloff into the corners, low contrast, even diffused light with soft, held highlights";
|
|
@@ -1030,8 +1030,6 @@ interface TaskUnresolved {
|
|
|
1030
1030
|
type TaskResolution = TaskResolved | TaskUnresolved;
|
|
1031
1031
|
interface ModelProfile {
|
|
1032
1032
|
readonly capabilities: ReadonlySet<Capability>;
|
|
1033
|
-
/** Capabilities reachable only when this key variable is set. */
|
|
1034
|
-
readonly keyedCapabilities: ReadonlyMap<Capability, string>;
|
|
1035
1033
|
/** Key variables the Model needs for any request. */
|
|
1036
1034
|
readonly keys: readonly string[];
|
|
1037
1035
|
readonly maxReferences: number;
|
|
@@ -1140,8 +1138,6 @@ export declare function sumCosts(costs: readonly (number | null)[]): {
|
|
|
1140
1138
|
interface MotifClientConfig {
|
|
1141
1139
|
/** Falls back to FAL_KEY. */
|
|
1142
1140
|
falKey?: string;
|
|
1143
|
-
/** Falls back to OPENAI_API_KEY. Used only by Models routed through OpenAI. */
|
|
1144
|
-
openAiKey?: string;
|
|
1145
1141
|
/** Models pinned per Task, as `resolveTask` takes them. */
|
|
1146
1142
|
pins?: TaskEnvironment["pins"];
|
|
1147
1143
|
/** The one network seam. Defaults to global fetch. Retries and timeouts still apply. */
|
|
@@ -1259,8 +1255,8 @@ interface TaskPlan {
|
|
|
1259
1255
|
queued: boolean;
|
|
1260
1256
|
/** Projected: before the call. */
|
|
1261
1257
|
cost: ResolvedCost;
|
|
1262
|
-
/** The provider carrying the request.
|
|
1263
|
-
provider: "fal"
|
|
1258
|
+
/** The provider carrying the request. */
|
|
1259
|
+
provider: "fal";
|
|
1264
1260
|
}
|
|
1265
1261
|
interface TaskOutput extends Omit<TaskPlan, "body" | "cost" | "queued"> {
|
|
1266
1262
|
files: TaskFile[];
|
|
@@ -1311,7 +1307,7 @@ interface MotifClient {
|
|
|
1311
1307
|
*/
|
|
1312
1308
|
resume: (task: TaskId, input: TaskInput, requestId: string) => Promise<Result$1<TaskOutput, MotifError>>;
|
|
1313
1309
|
}
|
|
1314
|
-
/** Create the Task client.
|
|
1310
|
+
/** Create the Task client. The key falls back to FAL_KEY. */
|
|
1315
1311
|
export declare function createMotif(config?: MotifClientConfig): MotifClient;
|
|
1316
1312
|
//#endregion
|
|
1317
1313
|
//#region src/task-plan-shared.d.ts
|
|
@@ -1357,13 +1353,10 @@ export declare function promptWarnings(prompt: string, context?: {
|
|
|
1357
1353
|
export declare const motifEnvSchema: import("@howells/envy").EnvSchema<{
|
|
1358
1354
|
readonly optional: {
|
|
1359
1355
|
FAL_KEY: z.ZodString;
|
|
1360
|
-
OPENAI_API_KEY: z.ZodString;
|
|
1361
1356
|
};
|
|
1362
1357
|
}>;
|
|
1363
1358
|
type MotifEnv = ReturnType<typeof motifEnvSchema.parse>;
|
|
1364
1359
|
export declare function parseMotifEnv(input?: Record<string, unknown>): MotifEnv;
|
|
1365
1360
|
export declare function getFalKeyFromEnv(input?: Record<string, unknown>): string | undefined;
|
|
1366
|
-
/** The OpenAI key, used by direct OpenAI routes such as gpt2 transparency. */
|
|
1367
|
-
export declare function getOpenAiKeyFromEnv(input?: Record<string, unknown>): string | undefined;
|
|
1368
1361
|
//#endregion
|
|
1369
1362
|
export { type AspectRatio, type Blocker, type Capability, type ChosenBy, type CreativeDirection, type CreativeField, type CreativeOption, type CreativeOptionErrorDetails, type CreativePromptResult, type CustomImageSize, type EnrichPromptOptions, type FalFetch, type ImageSizeBounds, type LookId, type LookOption, type ModelProfile, type MoodId, type MotifClient, type MotifClientConfig, type MotifEnv, type OutputDimensions, type PlanOptions, type PromptWarning, type PromptWarningRule, type RankedFrom, type RankedModel, type Resolution, type ResolvedCost, type Result, type ResultAsync, type TaskDefinition, type TaskEnvironment, type TaskFile, type TaskFunction, type TaskId, type TaskInput, type TaskMode, type TaskOutput, type TaskPlan, type TaskRequest, type TaskResolution, type TaskResolved, type TaskStream, type TaskStreamEvent, type TaskStreamOptions, type TaskUnresolved, type Tier, type Unblocker, err, ok };
|