@chai-ui/core 0.5.0 → 0.6.1
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 +33 -3
- package/dist/check-suggested-models.d.ts +31 -0
- package/dist/check-suggested-models.d.ts.map +1 -0
- package/dist/check-suggested-models.js +123 -0
- package/dist/check-suggested-models.js.map +1 -0
- package/dist/composer.d.ts +188 -0
- package/dist/composer.d.ts.map +1 -0
- package/dist/composer.js +326 -0
- package/dist/composer.js.map +1 -0
- package/dist/engines/fal.d.ts +6 -4
- package/dist/engines/fal.d.ts.map +1 -1
- package/dist/engines/fal.js +20 -19
- package/dist/engines/fal.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/media-analyzer.d.ts +55 -0
- package/dist/media-analyzer.d.ts.map +1 -0
- package/dist/media-analyzer.js +124 -0
- package/dist/media-analyzer.js.map +1 -0
- package/dist/reasoning.d.ts +59 -0
- package/dist/reasoning.d.ts.map +1 -0
- package/dist/reasoning.js +55 -0
- package/dist/reasoning.js.map +1 -0
- package/dist/suggested-models.d.ts +23 -0
- package/dist/suggested-models.d.ts.map +1 -0
- package/dist/suggested-models.js +110 -0
- package/dist/suggested-models.js.map +1 -0
- package/dist/types.d.ts +12 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/check-suggested-models.ts +147 -0
- package/src/composer.ts +525 -0
- package/src/engines/fal.ts +20 -19
- package/src/index.ts +5 -0
- package/src/media-analyzer.ts +182 -0
- package/src/reasoning.ts +90 -0
- package/src/suggested-models.ts +121 -0
- package/src/types.ts +13 -0
package/README.md
CHANGED
|
@@ -14,9 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
The headless core behind CHAI's components: the data types, the
|
|
16
16
|
Request → Run → Result model a submitted prompt flows through, and the
|
|
17
|
-
pluggable generation engines that actually call models
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
pluggable generation engines that actually call models, and the components'
|
|
18
|
+
behavior as small framework-free stores. No framework, no rendering:
|
|
19
|
+
`@chai-ui/react` wraps the stores in hooks, and a Vue binding will wrap the
|
|
20
|
+
same stores.
|
|
20
21
|
|
|
21
22
|
## Layout
|
|
22
23
|
|
|
@@ -26,9 +27,38 @@ binding would depend on this package the same way.
|
|
|
26
27
|
- `engines/fal.ts` — `createFalEngine`, media generation through Fal.ai (the default).
|
|
27
28
|
- `engines/openrouter.ts` — `createOpenRouterEngine`, text/reasoning through OpenRouter (prompt enhancement, media analysis).
|
|
28
29
|
- `media-analysis-prompts.ts` — the instruction text `MediaAnalyzer` sends, per media kind × prompt length.
|
|
30
|
+
- `suggested-models.ts` — the suggested model lists per use case (Fal for generation, OpenRouter for analysis), each model with its verified aspect ratios and Fal input format; `suggestedModels(useCase)`.
|
|
31
|
+
- `check-suggested-models.ts` — `checkSuggestedModels()`: checks those lists against Fal's and OpenRouter's catalogs as they are today. No key, no model run.
|
|
29
32
|
- `model-routing.ts` — auto-select: `buildModelRoutingPrompt`, `parseModelRoutingReply`, and `routeModel`, which falls back to the first listed model instead of throwing.
|
|
33
|
+
- `reasoning.ts` — the reasoning engine and models a `ChaiProvider` shares: `createReasoning`, `pickReasoning`, `reasoningModelFor` and the suggested defaults.
|
|
34
|
+
- `composer.ts` — `createComposerStore`, what `useComposer` wraps: submit payload → runs, auto-select routing, Enhance, cancel, and image edit versions. Plus the Composer's shared types (`ComposerSubmitPayload`, `EditVersion`, …).
|
|
35
|
+
- `media-analyzer.ts` — `createMediaAnalyzerStore`, what `useMediaAnalyzer` wraps.
|
|
30
36
|
- `server/` — `createChaiHandler` and `toNodeHandler`, exported from `@chai-ui/core/server` (server-only).
|
|
31
37
|
|
|
38
|
+
## Suggested models, and checking them
|
|
39
|
+
|
|
40
|
+
The components fill their Model menus from the suggested lists when a
|
|
41
|
+
builder passes none (see `@chai-ui/react`'s README). Each Fal model in them
|
|
42
|
+
carries `falInput`, read from its Fal schema: where the image goes
|
|
43
|
+
(`image_url`, `image_urls` or `start_image_url`) and how the aspect ratio
|
|
44
|
+
is sent (`aspect_ratio`, or a named `image_size`). `buildFalRequestBody`
|
|
45
|
+
uses it; for a model outside the lists it falls back to guessing from the
|
|
46
|
+
id.
|
|
47
|
+
|
|
48
|
+
The lists change only through package releases. `checkSuggestedModels()`
|
|
49
|
+
compares them with the providers right now, from a browser or Node, with
|
|
50
|
+
no key:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
const { ok, checked, problems } = await checkSuggestedModels();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
It reports a model that's gone or no longer active, a Fal model that no
|
|
57
|
+
longer takes an aspect ratio or image field Chai sends or now requires a
|
|
58
|
+
field Chai doesn't send, and an OpenRouter model that no longer accepts its
|
|
59
|
+
media kind. Fal's catalog is read 10 models a page (`api.fal.ai/v1/models`),
|
|
60
|
+
OpenRouter's from `openrouter.ai/api/v1/models`.
|
|
61
|
+
|
|
32
62
|
## The server route: `@chai-ui/core/server`
|
|
33
63
|
|
|
34
64
|
The built-in engines never hold an API key. They call one route on your
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** One way a provider no longer matches a suggested model. */
|
|
2
|
+
export interface SuggestedModelProblem {
|
|
3
|
+
provider: "fal" | "openrouter";
|
|
4
|
+
/** The model's id, or `"*"` when the provider couldn't be reached at all. */
|
|
5
|
+
modelId: string;
|
|
6
|
+
problem: string;
|
|
7
|
+
}
|
|
8
|
+
export interface SuggestedModelsCheck {
|
|
9
|
+
/** True when every suggested model still matches its provider. */
|
|
10
|
+
ok: boolean;
|
|
11
|
+
/** How many models were checked. */
|
|
12
|
+
checked: number;
|
|
13
|
+
problems: SuggestedModelProblem[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Checks the suggested model lists against Fal and OpenRouter as they are
|
|
17
|
+
* today: each model still exists and is active; for Fal, it still takes
|
|
18
|
+
* the aspect ratios and image field Chai sends, and needs no other field
|
|
19
|
+
* Chai doesn't send; for OpenRouter, it still accepts the media kind it's
|
|
20
|
+
* listed for. Run it while setting up your engine. It needs no API key,
|
|
21
|
+
* runs no model and costs nothing; both catalogs are public and allow
|
|
22
|
+
* calls from a browser.
|
|
23
|
+
*
|
|
24
|
+
* The lists themselves only change through package releases. A problem
|
|
25
|
+
* here means a provider changed since: pick another model, or update the
|
|
26
|
+
* package once a release catches up.
|
|
27
|
+
*/
|
|
28
|
+
export declare function checkSuggestedModels(options?: {
|
|
29
|
+
fetchImpl?: typeof fetch;
|
|
30
|
+
}): Promise<SuggestedModelsCheck>;
|
|
31
|
+
//# sourceMappingURL=check-suggested-models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-suggested-models.d.ts","sourceRoot":"","sources":["../src/check-suggested-models.ts"],"names":[],"mappings":"AAIA,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,KAAK,GAAG,YAAY,CAAC;IAC/B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,kEAAkE;IAClE,EAAE,EAAE,OAAO,CAAC;IACZ,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,qBAAqB,EAAE,CAAC;CACnC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAQpH"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { SUGGESTED_ANALYSIS_MODELS, SUGGESTED_FAL_MODELS } from "./suggested-models.js";
|
|
2
|
+
import { FAL_NAMED_IMAGE_SIZES } from "./engines/fal.js";
|
|
3
|
+
/**
|
|
4
|
+
* Checks the suggested model lists against Fal and OpenRouter as they are
|
|
5
|
+
* today: each model still exists and is active; for Fal, it still takes
|
|
6
|
+
* the aspect ratios and image field Chai sends, and needs no other field
|
|
7
|
+
* Chai doesn't send; for OpenRouter, it still accepts the media kind it's
|
|
8
|
+
* listed for. Run it while setting up your engine. It needs no API key,
|
|
9
|
+
* runs no model and costs nothing; both catalogs are public and allow
|
|
10
|
+
* calls from a browser.
|
|
11
|
+
*
|
|
12
|
+
* The lists themselves only change through package releases. A problem
|
|
13
|
+
* here means a provider changed since: pick another model, or update the
|
|
14
|
+
* package once a release catches up.
|
|
15
|
+
*/
|
|
16
|
+
export async function checkSuggestedModels(options = {}) {
|
|
17
|
+
const fetchImpl = (input, init) => (options.fetchImpl ?? fetch)(input, init);
|
|
18
|
+
const fal = [...SUGGESTED_FAL_MODELS.values()];
|
|
19
|
+
const analysis = Object.entries(SUGGESTED_ANALYSIS_MODELS).flatMap(([kind, models]) => (models ?? []).map((model) => ({ kind: kind, model })));
|
|
20
|
+
const problems = [...(await checkFal(fal, fetchImpl)), ...(await checkOpenRouter(analysis, fetchImpl))];
|
|
21
|
+
return { ok: problems.length === 0, checked: fal.length + analysis.length, problems };
|
|
22
|
+
}
|
|
23
|
+
async function checkFal(models, fetchImpl) {
|
|
24
|
+
const query = models.map((m) => `endpoint_id=${encodeURIComponent(m.id)}`).join("&");
|
|
25
|
+
let found;
|
|
26
|
+
try {
|
|
27
|
+
// Fal answers 10 models a page, with a cursor for the next.
|
|
28
|
+
found = [];
|
|
29
|
+
let cursor;
|
|
30
|
+
do {
|
|
31
|
+
const res = await fetchImpl(`https://api.fal.ai/v1/models?expand=openapi-3.0&${query}${cursor ? `&cursor=${encodeURIComponent(cursor)}` : ""}`);
|
|
32
|
+
if (!res.ok)
|
|
33
|
+
throw new Error(`${res.status} ${res.statusText}`);
|
|
34
|
+
const page = (await res.json());
|
|
35
|
+
found.push(...(page.models ?? []));
|
|
36
|
+
cursor = page.has_more ? page.next_cursor : undefined;
|
|
37
|
+
} while (cursor);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
return [{ provider: "fal", modelId: "*", problem: `Couldn't reach Fal's model catalog: ${err.message}` }];
|
|
41
|
+
}
|
|
42
|
+
const problems = [];
|
|
43
|
+
const add = (modelId, problem) => problems.push({ provider: "fal", modelId, problem });
|
|
44
|
+
for (const model of models) {
|
|
45
|
+
const entry = found.find((f) => f.endpoint_id === model.id);
|
|
46
|
+
if (!entry) {
|
|
47
|
+
add(model.id, "Not in Fal's catalog any more.");
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (entry.metadata?.status && entry.metadata.status !== "active")
|
|
51
|
+
add(model.id, `Fal lists it as "${entry.metadata.status}".`);
|
|
52
|
+
const input = inputSchema(entry.openapi);
|
|
53
|
+
if (!input)
|
|
54
|
+
continue;
|
|
55
|
+
const props = input.schema.properties ?? {};
|
|
56
|
+
const imageField = model.falInput?.image;
|
|
57
|
+
if (imageField && !props[imageField])
|
|
58
|
+
add(model.id, `No longer takes "${imageField}" for the image.`);
|
|
59
|
+
const ratioField = model.falInput?.aspectRatio;
|
|
60
|
+
if (model.aspectRatios && ratioField) {
|
|
61
|
+
const accepted = enumOf(props[ratioField], input.resolve);
|
|
62
|
+
if (!props[ratioField])
|
|
63
|
+
add(model.id, `No longer takes "${ratioField}".`);
|
|
64
|
+
else if (accepted) {
|
|
65
|
+
const wanted = ratioField === "image_size" ? model.aspectRatios.map((r) => FAL_NAMED_IMAGE_SIZES[r] ?? r) : model.aspectRatios;
|
|
66
|
+
const missing = wanted.filter((v) => !accepted.includes(v));
|
|
67
|
+
if (missing.length > 0)
|
|
68
|
+
add(model.id, `No longer takes these ${ratioField} values: ${missing.join(", ")}.`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const sent = new Set(["prompt", imageField ?? "", ratioField ?? ""]);
|
|
72
|
+
for (const name of input.schema.required ?? []) {
|
|
73
|
+
if (!sent.has(name) && props[name]?.default === undefined)
|
|
74
|
+
add(model.id, `Now requires "${name}", which Chai doesn't send.`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return problems;
|
|
78
|
+
}
|
|
79
|
+
async function checkOpenRouter(models, fetchImpl) {
|
|
80
|
+
let catalog;
|
|
81
|
+
try {
|
|
82
|
+
const res = await fetchImpl("https://openrouter.ai/api/v1/models");
|
|
83
|
+
if (!res.ok)
|
|
84
|
+
throw new Error(`${res.status} ${res.statusText}`);
|
|
85
|
+
catalog = (await res.json()).data ?? [];
|
|
86
|
+
}
|
|
87
|
+
catch (err) {
|
|
88
|
+
return [{ provider: "openrouter", modelId: "*", problem: `Couldn't reach OpenRouter's model list: ${err.message}` }];
|
|
89
|
+
}
|
|
90
|
+
const problems = [];
|
|
91
|
+
for (const { kind, model } of models) {
|
|
92
|
+
const entry = catalog.find((c) => c.id === model.id);
|
|
93
|
+
if (!entry)
|
|
94
|
+
problems.push({ provider: "openrouter", modelId: model.id, problem: "Not in OpenRouter's catalog any more." });
|
|
95
|
+
else if (!entry.architecture?.input_modalities?.includes(kind))
|
|
96
|
+
problems.push({ provider: "openrouter", modelId: model.id, problem: `No longer accepts ${kind}.` });
|
|
97
|
+
}
|
|
98
|
+
return problems;
|
|
99
|
+
}
|
|
100
|
+
/** The model's request schema, from its OpenAPI document, with a resolver for `$ref`s. */
|
|
101
|
+
function inputSchema(openapi) {
|
|
102
|
+
const schemas = openapi?.components?.schemas ?? {};
|
|
103
|
+
const resolve = (s) => (s.$ref ? (schemas[s.$ref.split("/").pop()] ?? s) : s);
|
|
104
|
+
for (const path of Object.values(openapi?.paths ?? {})) {
|
|
105
|
+
const body = path.post?.requestBody?.content?.["application/json"]?.schema;
|
|
106
|
+
if (body)
|
|
107
|
+
return { schema: resolve(body), resolve };
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
/** The allowed values of a field, wherever its schema keeps them. */
|
|
112
|
+
function enumOf(field, resolve) {
|
|
113
|
+
if (!field)
|
|
114
|
+
return null;
|
|
115
|
+
for (const s of [field, ...(field.anyOf ?? []), ...(field.allOf ?? [])].map(resolve)) {
|
|
116
|
+
if (s.enum)
|
|
117
|
+
return s.enum;
|
|
118
|
+
if (s.const !== undefined)
|
|
119
|
+
return [s.const];
|
|
120
|
+
}
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=check-suggested-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-suggested-models.js","sourceRoot":"","sources":["../src/check-suggested-models.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AACxF,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAkBzD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,UAAwC,EAAE;IACnF,MAAM,SAAS,GAAiB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAC3F,MAAM,GAAG,GAAG,CAAC,GAAG,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,EAAE,CACpF,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAiB,EAAE,KAAK,EAAE,CAAC,CAAC,CACpE,CAAC;IACF,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAC,MAAM,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,eAAe,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IACxG,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;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Composer's behavior with no framework: turns a submit payload into
|
|
3
|
+
* `Request` → `Run` → `Result` (§6), fanning out across `engine.generate`
|
|
4
|
+
* calls and folding each one back into state as it settles. A small store
|
|
5
|
+
* (`getState` + `subscribe`) that `useComposer` (React) and the Vue
|
|
6
|
+
* composable wrap; the pure transitions live in `run.ts`.
|
|
7
|
+
*/
|
|
8
|
+
import { type GenerationEngine } from "./engine.js";
|
|
9
|
+
import { type ModelRoutingInput, type ModelRoutingResult } from "./model-routing.js";
|
|
10
|
+
import { type EditRegion } from "./region-edit.js";
|
|
11
|
+
import { type Reasoning } from "./reasoning.js";
|
|
12
|
+
import { type ResultStatus, type Run } from "./run.js";
|
|
13
|
+
import type { DroppedMedia, GenerationUseCase, MediaKind, ModelOption } from "./types.js";
|
|
14
|
+
export interface ComposerAttachment extends DroppedMedia {
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The selected generation use case, shown as a removable chip (reference:
|
|
19
|
+
* the mock's "Video"/"Image" chip) — deliberately independent of
|
|
20
|
+
* `attachments`: a use case can be picked from the attach menu with nothing
|
|
21
|
+
* attached yet (e.g. "Create video"). Composer never derives this from
|
|
22
|
+
* `attachments` itself (that's app-level policy, not a Composer opinion —
|
|
23
|
+
* the design). With none picked, `defaultUseCase` applies.
|
|
24
|
+
*/
|
|
25
|
+
export interface ComposerUseCase {
|
|
26
|
+
kind: MediaKind;
|
|
27
|
+
label: string;
|
|
28
|
+
/**
|
|
29
|
+
* An edit of the attached image rather than a new one: no aspect ratio,
|
|
30
|
+
* region chips when `regions` is set, and a submit needs only an image and
|
|
31
|
+
* either a prompt or a region. Images only for now.
|
|
32
|
+
*/
|
|
33
|
+
edit?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/** A plain text request — what a submit means when no use case is picked, unless the builder sets `defaultUseCase`. */
|
|
36
|
+
export declare const TEXT_USE_CASE: ComposerUseCase;
|
|
37
|
+
/** Editing the attached image, the attach menu's "Edit image". Pair it with `useComposer`'s `editImage` and an `EditCard`. */
|
|
38
|
+
export declare const EDIT_IMAGE_USE_CASE: ComposerUseCase;
|
|
39
|
+
/** One use case to run and the models picked for it. Empty `modelIds` means the engine's default model. */
|
|
40
|
+
export interface ComposerSelection {
|
|
41
|
+
useCase: ComposerUseCase;
|
|
42
|
+
modelIds: string[];
|
|
43
|
+
/** The models offered for this use case: what auto-select routes among. */
|
|
44
|
+
models: ModelOption[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Everything Composer itself tracks, assembled into one object at submit
|
|
48
|
+
* time — an honest snapshot of the component's own state, handed to
|
|
49
|
+
* `onSubmit` so a builder doesn't have to re-derive it from five
|
|
50
|
+
* separately-controlled props they already hold.
|
|
51
|
+
*/
|
|
52
|
+
export interface ComposerSubmitPayload {
|
|
53
|
+
value: string;
|
|
54
|
+
attachments: ComposerAttachment[];
|
|
55
|
+
/** The use case to run — the picked one, or `defaultUseCase` when none is picked. The first one with `multiSelectUseCases`. */
|
|
56
|
+
useCase: ComposerUseCase;
|
|
57
|
+
/** The first picked model, or null for the engine's default. */
|
|
58
|
+
modelId: string | null;
|
|
59
|
+
aspectRatio: string | null;
|
|
60
|
+
/** Everything to run: one entry per use case with its picked models. A single entry unless `multiSelectUseCases` is on. */
|
|
61
|
+
selections: ComposerSelection[];
|
|
62
|
+
/** When true, the model is chosen at submit (`useComposer` routes among each selection's `models`), not by the picks. */
|
|
63
|
+
autoSelectModel: boolean;
|
|
64
|
+
/** An edit's marked regions, each with its own instruction. Empty unless the use case is an edit. */
|
|
65
|
+
regions?: EditRegion[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* One version of the image being edited: the original, or the result of an
|
|
69
|
+
* edit. The composer's `edit.versions` builds these from its runs.
|
|
70
|
+
*/
|
|
71
|
+
export interface EditVersion {
|
|
72
|
+
id: string;
|
|
73
|
+
/** The image, once there is one. */
|
|
74
|
+
src?: string;
|
|
75
|
+
/** The image this version was edited from, shown under the progress spinner until `src` arrives. */
|
|
76
|
+
from?: string;
|
|
77
|
+
status: ResultStatus;
|
|
78
|
+
/** The regions this version was made with (none for the original). Shown faintly, for reference. */
|
|
79
|
+
regions: EditRegion[];
|
|
80
|
+
error?: string;
|
|
81
|
+
}
|
|
82
|
+
/** A result's `modelId` when nothing was picked: the engine runs its own default model. */
|
|
83
|
+
export declare const DEFAULT_MODEL_ID = "default";
|
|
84
|
+
export interface ComposerOptions {
|
|
85
|
+
/** The generation engine a submitted run actually calls. Defaults to `mockEngine`. */
|
|
86
|
+
engine?: GenerationEngine;
|
|
87
|
+
/**
|
|
88
|
+
* Engines per use-case kind, overriding `engine` for that kind — needed
|
|
89
|
+
* for multi-use-case select, since one Fal engine outputs one kind, e.g.
|
|
90
|
+
* `{ image: createFalEngine({ outputKind: "image" }), video: createFalEngine({ outputKind: "video" }) }`.
|
|
91
|
+
*/
|
|
92
|
+
engineByKind?: Partial<Record<MediaKind, GenerationEngine>>;
|
|
93
|
+
/**
|
|
94
|
+
* The engine for text requests (a Composer with no use case picked, or a
|
|
95
|
+
* text use case). Defaults to `reasoningEngine`, and to a mock text engine
|
|
96
|
+
* when neither is set, so a text prompt always gets a reply.
|
|
97
|
+
*/
|
|
98
|
+
textEngine?: GenerationEngine;
|
|
99
|
+
/** The model text requests use when none is picked. Defaults to the reasoning model for the attachments' kinds, then the text engine's own default. */
|
|
100
|
+
textModel?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The reasoning engine Enhance calls — deliberately separate from
|
|
103
|
+
* `engine`: Fal's own text/vision access is itself an
|
|
104
|
+
* OpenRouter proxy, so defaulting Enhance to a Fal `engine` would
|
|
105
|
+
* silently double-proxy. Must return text. Set together with
|
|
106
|
+
* `reasoningModel` to override the nearest `ChaiProvider`'s pair; with
|
|
107
|
+
* neither set here nor a provider, `enhance` stays `undefined`, same
|
|
108
|
+
* shape as `Composer`'s own "omit `onEnhance` to hide the button" convention.
|
|
109
|
+
*/
|
|
110
|
+
reasoningEngine?: GenerationEngine;
|
|
111
|
+
/** Set with `reasoningEngine` to override the provider's pair; used for every kind (§5.5). */
|
|
112
|
+
reasoningModel?: string;
|
|
113
|
+
/** Overrides the instruction wrapping a raw prompt for Enhance. Defaults to a generic still/video-aware rewrite instruction. */
|
|
114
|
+
enhancePrompt?: (value: string, mode?: GenerationUseCase) => string;
|
|
115
|
+
/**
|
|
116
|
+
* Auto-select: with `autoSelectModel` on in the payload, the reasoning
|
|
117
|
+
* model picks one model per use case at submit, then these fire with the
|
|
118
|
+
* pick so the Composer's trigger shows it. Wire them to the same state as
|
|
119
|
+
* Composer's `onModelChange` / `onModelIdsChange`.
|
|
120
|
+
*/
|
|
121
|
+
onModelChange?: (modelId: string) => void;
|
|
122
|
+
onModelIdsChange?: (modelIds: string[]) => void;
|
|
123
|
+
/** Replaces the routing instruction (`buildModelRoutingPrompt`). */
|
|
124
|
+
routingPrompt?: (input: ModelRoutingInput) => string;
|
|
125
|
+
/**
|
|
126
|
+
* Fires when auto-select couldn't route and fell back to the first listed
|
|
127
|
+
* model: no reasoning model, a failed reasoning call (e.g. a bad key), or
|
|
128
|
+
* a reply naming no listed model. The request still runs.
|
|
129
|
+
*/
|
|
130
|
+
onRoutingFallback?: (result: Extract<ModelRoutingResult, {
|
|
131
|
+
status: "fallback";
|
|
132
|
+
}>) => void;
|
|
133
|
+
/**
|
|
134
|
+
* The image to edit, when the Composer's use case is an edit (e.g.
|
|
135
|
+
* `EDIT_IMAGE_USE_CASE`) and an image is attached. While it's set, `edit`
|
|
136
|
+
* returns props for an `EditCard`, and each edit's results become new
|
|
137
|
+
* versions of the image. Changing it to another image starts over.
|
|
138
|
+
*/
|
|
139
|
+
editImage?: DroppedMedia | null;
|
|
140
|
+
/** Replaces how an edit's prompt and regions become the model's prompt. Defaults to `buildRegionEditPrompt`, in the model's `regionFormat`. */
|
|
141
|
+
editPrompt?: (args: {
|
|
142
|
+
prompt: string;
|
|
143
|
+
regions: EditRegion[];
|
|
144
|
+
model?: ModelOption;
|
|
145
|
+
}) => string;
|
|
146
|
+
onRun?: (run: Run) => void;
|
|
147
|
+
onResult?: (run: Run, resultId: string) => void;
|
|
148
|
+
onError?: (run: Run, resultId: string) => void;
|
|
149
|
+
}
|
|
150
|
+
export interface ComposerState {
|
|
151
|
+
/** One run per use case submitted: a single run unless the Composer has `multiSelectUseCases` on. */
|
|
152
|
+
runs: Run[];
|
|
153
|
+
enhancing: boolean;
|
|
154
|
+
routing: boolean;
|
|
155
|
+
/** Edit mode. Each edit's runs are kept (not replaced by the next submit), since every result is a version of the image the person can page back to. */
|
|
156
|
+
editRuns: Run[];
|
|
157
|
+
regions: EditRegion[];
|
|
158
|
+
activeVersion: number;
|
|
159
|
+
/** The image the edit state belongs to. Another image starts over. */
|
|
160
|
+
editSource: string | null;
|
|
161
|
+
/** Numbers each image, so its original version has its own id and EditCard starts it clean. */
|
|
162
|
+
editImageCount: number;
|
|
163
|
+
}
|
|
164
|
+
/** Props for an `EditCard` (spread them in), and `regions` for `Composer`. */
|
|
165
|
+
export interface ComposerEdit {
|
|
166
|
+
versions: EditVersion[];
|
|
167
|
+
activeVersion: number;
|
|
168
|
+
onActiveVersionChange: (index: number) => void;
|
|
169
|
+
regions: EditRegion[];
|
|
170
|
+
onRegionsChange: (regions: EditRegion[]) => void;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* `getOptions` is read on every call, so options can change between
|
|
174
|
+
* renders; `getProvided` is the nearest provider's reasoning, if any.
|
|
175
|
+
*/
|
|
176
|
+
export declare function createComposerStore(getOptions: () => ComposerOptions, getProvided?: () => Reasoning | undefined): {
|
|
177
|
+
getState: () => ComposerState;
|
|
178
|
+
subscribe(listener: () => void): () => undefined;
|
|
179
|
+
submit: (payload: ComposerSubmitPayload) => void;
|
|
180
|
+
cancel: () => void;
|
|
181
|
+
enhance: (value: string) => Promise<string>;
|
|
182
|
+
edit: (s: ComposerState, editImage: DroppedMedia | null | undefined) => ComposerEdit | null;
|
|
183
|
+
reasoning: () => Reasoning | undefined;
|
|
184
|
+
};
|
|
185
|
+
export type ComposerStore = ReturnType<typeof createComposerStore>;
|
|
186
|
+
/** One console warning per message per page load: auto-select is on with no reasoning model to route with. */
|
|
187
|
+
export declare function warnNoReasoningOnce(consequence: string): void;
|
|
188
|
+
//# sourceMappingURL=composer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"composer.d.ts","sourceRoot":"","sources":["../src/composer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAc,KAAK,iBAAiB,EAAE,KAAK,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACjG,OAAO,EAA8C,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC/F,OAAO,EAAoC,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAUL,KAAK,YAAY,EACjB,KAAK,GAAG,EACT,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE1F,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,uHAAuH;AACvH,eAAO,MAAM,aAAa,EAAE,eAAiD,CAAC;AAE9E,8HAA8H;AAC9H,eAAO,MAAM,mBAAmB,EAAE,eAAoE,CAAC;AAEvG,2GAA2G;AAC3G,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAA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