wizards 0.2.7 → 0.2.9

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 (97) hide show
  1. package/apps/runtime/dist/agents/project-assistant.js +16 -2
  2. package/apps/runtime/dist/agents/website.js +48 -10
  3. package/apps/runtime/dist/app.js +2 -0
  4. package/apps/runtime/dist/db/control-schema.js +18 -1
  5. package/apps/runtime/dist/db/migrations/control/0007_common_the_hand.sql +15 -0
  6. package/apps/runtime/dist/db/migrations/control/meta/0007_snapshot.json +460 -0
  7. package/apps/runtime/dist/db/migrations/control/meta/_journal.json +7 -0
  8. package/apps/runtime/dist/db/migrations/tenant/0006_hard_war_machine.sql +30 -0
  9. package/apps/runtime/dist/db/migrations/tenant/meta/0006_snapshot.json +1696 -0
  10. package/apps/runtime/dist/db/migrations/tenant/meta/_journal.json +7 -0
  11. package/apps/runtime/dist/db/schema.js +12 -6
  12. package/apps/runtime/dist/engine/steps.js +3 -0
  13. package/apps/runtime/dist/env.js +6 -0
  14. package/apps/runtime/dist/index.js +2 -0
  15. package/apps/runtime/dist/media/generate.js +2 -2
  16. package/apps/runtime/dist/media/transcribe.js +18 -6
  17. package/apps/runtime/dist/models.js +566 -218
  18. package/apps/runtime/dist/plugins/events.js +37 -14
  19. package/apps/runtime/dist/plugins/jobs.js +64 -0
  20. package/apps/runtime/dist/plugins/loader.js +67 -4
  21. package/apps/runtime/dist/plugins/public.js +31 -0
  22. package/apps/runtime/dist/plugins/registry.js +5 -0
  23. package/apps/runtime/dist/routes/plugin-public.js +59 -0
  24. package/apps/runtime/dist/routes/plugins.js +1 -1
  25. package/apps/runtime/dist/routes/studio.js +155 -10
  26. package/apps/runtime/dist/services/project-files.js +4 -0
  27. package/apps/runtime/dist/services/project-index.js +69 -9
  28. package/apps/runtime/dist/services/projects.js +7 -1
  29. package/apps/runtime/dist/services/spaces.js +2 -0
  30. package/apps/runtime/dist/tools/index.js +3 -2
  31. package/apps/runtime/dist/tools/plugin.js +89 -17
  32. package/apps/runtime/dist/tools/project.js +39 -31
  33. package/apps/web/dist/assets/Account-ZAqYVN9S.js +1 -0
  34. package/apps/web/dist/assets/{ChangelogDialog-DEfZRDK3.js → ChangelogDialog-CzdNuUMU.js} +1 -1
  35. package/apps/web/dist/assets/{ChatPanel-CNiFyu_w.js → ChatPanel-CDkHMh5g.js} +1 -1
  36. package/apps/web/dist/assets/{CreditsDialog-CUvc2iPM.js → CreditsDialog-DSjsgLoo.js} +1 -1
  37. package/apps/web/dist/assets/EditorPage-D4mertxP.js +2 -0
  38. package/apps/web/dist/assets/{FlowPreview-BC25OUH0.js → FlowPreview-DWYKllel.js} +1 -1
  39. package/apps/web/dist/assets/Harness-WJ0jpIl3.js +16 -0
  40. package/apps/web/dist/assets/HomePage-2Zn7et7Z.js +1 -0
  41. package/apps/web/dist/assets/ImportWizard-Dn7AiRgV.js +1 -0
  42. package/apps/web/dist/assets/LocalRuntime-BggRFDJt.js +1 -0
  43. package/apps/web/dist/assets/NewWizardPage-k-xPHAwe.js +2 -0
  44. package/apps/web/dist/assets/ProjectPage-CZgR1dQj.js +2 -0
  45. package/apps/web/dist/assets/{PublicRunner-BCrmXPkr.js → PublicRunner-BsvhBQMD.js} +1 -1
  46. package/apps/web/dist/assets/{ReadOnly-CvmN9XW4.js → ReadOnly-B0-ReU_0.js} +1 -1
  47. package/apps/web/dist/assets/RunnerView-0srHaE2T.js +2 -0
  48. package/apps/web/dist/assets/SettingsPage-CNsK0n6L.js +1 -0
  49. package/apps/web/dist/assets/SetupPage-BXQ6wfWP.js +1 -0
  50. package/apps/web/dist/assets/{SharePage-BqwqI3Ga.js → SharePage-CA8uuk9K.js} +1 -1
  51. package/apps/web/dist/assets/{api-Bf-l9Sd8.js → api-u3nydnnp.js} +1 -1
  52. package/apps/web/dist/assets/changelog-D7O5icPX.js +1 -0
  53. package/apps/web/dist/assets/circle-alert-B76z9TWZ.js +1 -0
  54. package/apps/web/dist/assets/definition-Co2Mg1qo.js +55 -0
  55. package/apps/web/dist/assets/esm-BbARZ7EE.js +7 -0
  56. package/apps/web/dist/assets/image-BShbErBm.js +1 -0
  57. package/apps/web/dist/assets/index-BQQihL4r.js +10 -0
  58. package/apps/web/dist/assets/index-CQQD8QNR.css +1 -0
  59. package/apps/web/dist/assets/meta-Dsb9LZTu.js +1 -0
  60. package/apps/web/dist/assets/oss-credits-CIxnNZor.js +1 -0
  61. package/apps/web/dist/assets/{outputs-CsESg-Eg.js → outputs-C806GWxt.js} +1 -1
  62. package/apps/web/dist/assets/{video-CjgmvRDk.js → pen-line-NK46C_nG.js} +1 -1
  63. package/apps/web/dist/assets/refresh-cw-Cmk7VCe0.js +1 -0
  64. package/apps/web/dist/assets/ui-gGAdXx-P.js +1 -0
  65. package/apps/web/dist/assets/video-DBmwF1Jm.js +1 -0
  66. package/apps/web/dist/assets/volume-2-Bp2tyaKE.js +1 -0
  67. package/apps/web/dist/index.html +4 -7
  68. package/apps/web/dist/mcp/flow.html +2 -2
  69. package/node_modules/@engenty-wizards/plugin-sdk/dist/index.d.ts +183 -0
  70. package/node_modules/@engenty-wizards/plugin-sdk/dist/studio.d.ts +48 -3
  71. package/node_modules/@engenty-wizards/shared/dist/projects.d.ts +7 -1
  72. package/node_modules/@engenty-wizards/shared/dist/providers.d.ts +75 -0
  73. package/node_modules/@engenty-wizards/shared/dist/providers.js +339 -0
  74. package/package.json +5 -1
  75. package/apps/web/dist/assets/Account-DLLeEwJL.js +0 -1
  76. package/apps/web/dist/assets/EditorPage-CZuCz7lB.js +0 -2
  77. package/apps/web/dist/assets/HomePage-DQKuhMFZ.js +0 -1
  78. package/apps/web/dist/assets/ImportWizard-BockXJXm.js +0 -1
  79. package/apps/web/dist/assets/LocalRuntime-C199bg_B.js +0 -16
  80. package/apps/web/dist/assets/NewWizardPage-C4cde8FO.js +0 -2
  81. package/apps/web/dist/assets/ProjectPage-DJC1K4w_.js +0 -2
  82. package/apps/web/dist/assets/RunnerView-CCe8-k9Q.js +0 -2
  83. package/apps/web/dist/assets/SettingsPage-BuocMkLt.js +0 -1
  84. package/apps/web/dist/assets/SetupPage-o6Jim2Pu.js +0 -1
  85. package/apps/web/dist/assets/changelog-CFeEzKqb.js +0 -1
  86. package/apps/web/dist/assets/cloud-off-D--dZLDw.js +0 -1
  87. package/apps/web/dist/assets/definition-DndaH5Ow.js +0 -55
  88. package/apps/web/dist/assets/esm-rJY59Ixx.js +0 -7
  89. package/apps/web/dist/assets/globe-ffVj8XwO.js +0 -1
  90. package/apps/web/dist/assets/index-B8n2AYO0.css +0 -1
  91. package/apps/web/dist/assets/index-BR5ELbeZ.js +0 -10
  92. package/apps/web/dist/assets/meta-CKE9QceT.js +0 -1
  93. package/apps/web/dist/assets/oss-credits-C-U2Tlpn.js +0 -1
  94. package/apps/web/dist/assets/react-dom-DenslgJm.js +0 -1
  95. package/apps/web/dist/assets/session-C7LDDcj7.js +0 -1
  96. package/apps/web/dist/assets/ui-BT0Y_Hci.js +0 -1
  97. /package/apps/web/dist/assets/{LocalRuntime-BrP-ENHg.css → Harness-BrP-ENHg.css} +0 -0
@@ -58,11 +58,20 @@ export interface PluginRoute {
58
58
  */
59
59
  handler(request: PluginRequest): unknown | Promise<unknown>;
60
60
  }
61
+ /** A space: what all its wizards share. The runtime's own tables call it a project. */
62
+ export interface PluginSpace {
63
+ id: string;
64
+ /** What the studio's switcher calls it. */
65
+ name: string;
66
+ }
61
67
  /** What a tool knows about the step that calls it. */
62
68
  export interface PluginStepContext {
63
69
  runId: string;
64
70
  stepId: string;
65
71
  tenantId: string;
72
+ /** The space of the step's wizard. */
73
+ space: PluginSpace;
74
+ /** The same as `space`, by its older name. */
66
75
  project: {
67
76
  id: string;
68
77
  name: string;
@@ -102,10 +111,33 @@ export interface PluginRunEvent {
102
111
  /** What the person answered, by field id. */
103
112
  values: Record<string, unknown>;
104
113
  }
114
+ /** A space was made, changed (title, about, colours, facts, systems) or deleted. */
115
+ export interface PluginSpaceEvent {
116
+ space: {
117
+ id: string;
118
+ };
119
+ }
120
+ /** A file of a space: read and ready (a document is in the index then), or removed. */
121
+ export interface PluginSpaceFileEvent {
122
+ space: {
123
+ id: string;
124
+ };
125
+ file: {
126
+ id: string;
127
+ name: string;
128
+ kind: "logo" | "asset" | "document";
129
+ mime: string;
130
+ };
131
+ }
105
132
  export interface PluginEvents {
106
133
  "run.done": PluginRunEvent;
107
134
  "run.failed": PluginRunEvent;
108
135
  "run.cancelled": PluginRunEvent;
136
+ "space.created": PluginSpaceEvent;
137
+ "space.updated": PluginSpaceEvent;
138
+ "space.deleted": PluginSpaceEvent;
139
+ "space.file.ready": PluginSpaceFileEvent;
140
+ "space.file.removed": PluginSpaceFileEvent;
109
141
  }
110
142
  /** The tenant's database. A plugin reads and writes its own tables with it. */
111
143
  export type PluginDb = LibSQLDatabase<Record<string, never>>;
@@ -126,9 +158,160 @@ export interface PluginGenerateResult<T = undefined> {
126
158
  /** Set when the request had a `schema`. */
127
159
  object: T;
128
160
  }
161
+ /** What a plugin adds to every agent step of a space's wizards. */
162
+ export interface PluginSpaceContext {
163
+ /**
164
+ * A block of the step's instructions, after what the space says about itself and its
165
+ * documents: what the plugin holds for the space, and which of its tools read it. Empty or
166
+ * null: the step gets neither the block nor the tools.
167
+ */
168
+ block(space: PluginSpace): string | null | Promise<string | null>;
169
+ /** Tools the step gets with the block, named `<plugin>_<name>` for the model. */
170
+ tools?: PluginTool[];
171
+ }
172
+ /** A text a plugin puts into a space's search index, beside the space's documents. */
173
+ export interface PluginIndexEntry {
174
+ /** The space's id. */
175
+ space: string;
176
+ /** The plugin's own name for it: putting the same key again replaces what it had. */
177
+ key: string;
178
+ /** What a hit is called: a page's title, a question. */
179
+ title: string;
180
+ /** Markdown, cut into passages like a document's text. */
181
+ text: string;
182
+ /** Where the studio shows it, an address of the studio: `/space#faq`. */
183
+ link?: string;
184
+ }
185
+ export interface PluginIndex {
186
+ /** Puts the entry in; `project_search` finds it from then on. */
187
+ put(entry: PluginIndexEntry): Promise<void>;
188
+ /** Takes one key out, or without a key every entry of the plugin in the space. */
189
+ remove(space: string, key?: string): Promise<void>;
190
+ }
191
+ /** What a tool of the space assistant knows about the turn that calls it. */
192
+ export interface PluginAssistantContext {
193
+ tenantId: string;
194
+ space: PluginSpace;
195
+ /** The person talking to the assistant. */
196
+ userId: string;
197
+ /** Aborted when the person leaves or stops the turn. */
198
+ signal: AbortSignal;
199
+ /** Tells the person what the assistant is doing right now: "Liest die Sitemap …". */
200
+ emit(message: string): void;
201
+ /** Say so when the tool changed what the space page shows: the page draws it again. */
202
+ changed(): void;
203
+ }
204
+ /** A tool of the space assistant: the chat on the space page that fills the space in. */
205
+ export interface PluginAssistantTool<S extends z.ZodType = z.ZodType> {
206
+ /** Lower case, digits and `_`. The model sees it as `<plugin>_<name>`. */
207
+ name: string;
208
+ /** For the model: what the tool does and when to use it. */
209
+ description: string;
210
+ inputSchema: S;
211
+ /**
212
+ * The result also goes to the chat, where the card the studio half registered for this tool
213
+ * (`registerAssistantCard`) draws it. It is sent as it is: keep such a result small.
214
+ */
215
+ card?: boolean;
216
+ execute(input: z.infer<S>, ctx: PluginAssistantContext): unknown | Promise<unknown>;
217
+ }
218
+ /** A page of the web, as `web.read` gives it. */
219
+ export interface PluginWebPage {
220
+ /** Where it ended up, after redirects. */
221
+ url: string;
222
+ status: number;
223
+ /** As the server sent them, for asking later whether the page changed. */
224
+ etag: string | null;
225
+ lastModified: string | null;
226
+ title: string;
227
+ description: string;
228
+ /** The page's text as Markdown. */
229
+ text: string;
230
+ /** Every link of the page, absolute, each once. */
231
+ links: {
232
+ url: string;
233
+ text: string;
234
+ }[];
235
+ }
236
+ export interface PluginWeb {
237
+ /**
238
+ * `fetch`, behind the guard of the runtime's own requests: addresses of this machine and of
239
+ * the local network are refused, after a redirect too.
240
+ */
241
+ fetch(url: string, init?: RequestInit): Promise<Response>;
242
+ /**
243
+ * A page read the way the space assistant reads one: guarded as `fetch`, and drawn in a
244
+ * browser when it has hardly any text without its scripts.
245
+ */
246
+ read(url: string, options?: {
247
+ signal?: AbortSignal;
248
+ }): Promise<PluginWebPage>;
249
+ }
250
+ export interface PluginDocuments {
251
+ /**
252
+ * A file as Markdown: PDF and Word by their text, scans and photos by a vision model (paid
253
+ * like every model call), spreadsheets as tables. Kept by content: the same bytes are read once.
254
+ */
255
+ parse(file: {
256
+ data: Uint8Array;
257
+ name: string;
258
+ mime: string;
259
+ }, options?: {
260
+ signal?: AbortSignal;
261
+ }): Promise<{
262
+ markdown: string;
263
+ pages: number | null;
264
+ }>;
265
+ }
266
+ /** One turn of a job `every` runs. */
267
+ export interface PluginTick {
268
+ tenantId: string;
269
+ /** When it ran for this tenant before; null the first time. */
270
+ lastRun: Date | null;
271
+ /** Aborted when the plugin unloads. */
272
+ signal: AbortSignal;
273
+ }
274
+ /** What a public route's handler gets. Nobody is signed in. */
275
+ export interface PluginPublicRequest {
276
+ request: Request;
277
+ /** The address below the plugin's public one. */
278
+ path: string;
279
+ params: Record<string, string>;
280
+ query: URLSearchParams;
281
+ /** The tenant whose address was called; the handler runs inside it. */
282
+ tenantId: string;
283
+ json<T = unknown>(): Promise<T>;
284
+ }
285
+ /**
286
+ * A route anyone may call, below the address `publicUrl` gives: a CMS that says a page
287
+ * changed, a service's webhook. Check a secret of your own in it, a token or a signature.
288
+ */
289
+ export interface PluginPublicRoute {
290
+ method: PluginHttpMethod;
291
+ path: string;
292
+ handler(request: PluginPublicRequest): unknown | Promise<unknown>;
293
+ }
129
294
  export interface PluginServerApi {
130
295
  registerHttpRoute(route: PluginRoute): void;
131
296
  registerTool<S extends z.ZodType>(tool: PluginTool<S>): void;
297
+ /** A block and tools for every agent step of a space's wizards. */
298
+ registerSpaceContext(context: PluginSpaceContext): void;
299
+ /** A tool of the space assistant. */
300
+ registerAssistantTool<S extends z.ZodType>(tool: PluginAssistantTool<S>): void;
301
+ registerPublicRoute(route: PluginPublicRoute): void;
302
+ /** The full address of a public route for the current tenant: what to hand to whoever calls it. */
303
+ publicUrl(path: string): Promise<string>;
304
+ /**
305
+ * Runs `handler` for every tenant that has the plugin, at most once per `everyMs` (a minute
306
+ * at least), inside that tenant. When it ran is kept: a restart does not start the count again,
307
+ * and a runtime that was off runs it once when it starts, not once per turn it missed. One turn
308
+ * per tenant at a time; a turn that throws counts as run.
309
+ */
310
+ every(name: string, everyMs: number, handler: (tick: PluginTick) => void | Promise<void>): void;
311
+ /** The space's search index, which `project_search` asks. */
312
+ index: PluginIndex;
313
+ web: PluginWeb;
314
+ documents: PluginDocuments;
132
315
  /**
133
316
  * A folder of `.sql` files with the plugin's own tables. Every tenant database gets each file
134
317
  * once, in the order of the file names. Nothing is taken back when the plugin unloads.
@@ -1,9 +1,10 @@
1
1
  import type { ComponentType } from "react";
2
2
  /**
3
3
  * What the studio hands a plugin's studio half: the built `client.js` the studio loads after
4
- * sign-in. Its default export registers pages, entries of the top bar and sections of the
5
- * settings. React, the router and the studio's own components come from the studio
6
- * (docs/content/dev/plugins), so the page a plugin draws is part of the same app.
4
+ * sign-in. Its default export registers pages, entries of the top bar, sections of the settings
5
+ * and of the space page, and cards of the space assistant's chat. React, the router and the
6
+ * studio's own components come from the studio (docs/content/dev/plugins), so the page a plugin
7
+ * draws is part of the same app.
7
8
  */
8
9
  export type StudioLang = "de" | "en";
9
10
  /** A plugin's words. `de` is the source: a key missing in `en` shows the German. */
@@ -34,6 +35,43 @@ export interface StudioSettingsSection {
34
35
  /** The user menu links to it directly. */
35
36
  menu?: boolean;
36
37
  }
38
+ /**
39
+ * A section of the space page, below the space's own sections. The studio draws its heading and
40
+ * hint above it, and its entry in the page's menu under the plugin's name; the component draws
41
+ * the rest, usually a `Card`.
42
+ */
43
+ export interface StudioSpaceSection {
44
+ /** Its anchor on the page: `/space#<id>`. */
45
+ id: string;
46
+ label: () => string;
47
+ /** One line under the heading: what the section is for. */
48
+ hint?: () => string;
49
+ component: ComponentType;
50
+ }
51
+ /** What a card in the assistant's chat is handed. */
52
+ export interface StudioAssistantCardProps<T = unknown> {
53
+ /** What the assistant tool returned. */
54
+ data: T;
55
+ /** Sends a message to the assistant, as if the person typed it: "Übernehmen". */
56
+ send(message: string): void;
57
+ }
58
+ /**
59
+ * Draws the result of a tool of the space assistant inside its chat: a tool the server half
60
+ * registered with `card: true`.
61
+ */
62
+ export interface StudioAssistantCard {
63
+ /** The tool's name, as the server half registered it. */
64
+ tool: string;
65
+ component: ComponentType<StudioAssistantCardProps<any>>;
66
+ }
67
+ /** The space the studio shows: what all its wizards share. */
68
+ export interface StudioSpace {
69
+ id: string;
70
+ /** What the switcher calls it. */
71
+ name: string;
72
+ /** Synced from a local install, or on a runtime where nothing is built: shown, not changed. */
73
+ readOnly: boolean;
74
+ }
37
75
  export interface StudioMe {
38
76
  user: {
39
77
  id: string;
@@ -56,6 +94,13 @@ export interface StudioPluginContext {
56
94
  registerPage(page: StudioPage): void;
57
95
  registerNav(entry: StudioNavEntry): void;
58
96
  registerSettingsSection(section: StudioSettingsSection): void;
97
+ registerSpaceSection(section: StudioSpaceSection): void;
98
+ registerAssistantCard(card: StudioAssistantCard): void;
99
+ /**
100
+ * A hook: the space the studio shows, `null` while it has none. A component that calls it draws
101
+ * again when the person picks another space.
102
+ */
103
+ useSpace(): StudioSpace | null;
59
104
  i18n: {
60
105
  /** Takes the plugin's words and gives the function that reads them in the language in effect. */
61
106
  register<M extends StudioMessages>(messages: M): (key: keyof M["de"] & string, vars?: Record<string, string | number>) => string;
@@ -65,8 +65,14 @@ export declare const PROJECT_LIMITS: {
65
65
  export declare function projectFileLimit(kind: ProjectFileKind, mime: string): number;
66
66
  /** One passage the document index found for a question. */
67
67
  export interface ProjectSearchHit {
68
- fileId: string;
68
+ /** The document the passage is of; null for a plugin's text. */
69
+ fileId: string | null;
70
+ /** The plugin whose text it is; null for a document. */
71
+ plugin: string | null;
72
+ /** The document's name, or the title of the plugin's text. */
69
73
  name: string;
74
+ /** Where the studio shows a plugin's text. */
75
+ link: string | null;
70
76
  /** The passage's place in its document, from 0. */
71
77
  index: number;
72
78
  text: string;
@@ -0,0 +1,75 @@
1
+ import type { ModelClass, TextClass } from "./definition.js";
2
+ /**
3
+ * What a wizard asks models for, as a person thinks of it. Each stands for model classes; the
4
+ * names are the marketplace's capabilities.
5
+ */
6
+ export declare const MODEL_CAPABILITIES: readonly ["text", "image", "video", "speech", "listening"];
7
+ export type ModelCapability = (typeof MODEL_CAPABILITIES)[number];
8
+ export declare const CAPABILITY_CLASSES: Record<ModelCapability, readonly ModelClass[]>;
9
+ export declare function capabilityOf(cls: ModelClass): ModelCapability;
10
+ /**
11
+ * A binding that sends a class to the credits of the account (or of the team in the cloud),
12
+ * whatever keys are there; engenty picks the model. `credits:<model>` names the model, as the
13
+ * gateway lists it (`fal:fal-ai/flux/schnell`, `elevenlabs:eleven_multilingual_v2`,
14
+ * `google/veo-3.1-fast-generate-001`).
15
+ */
16
+ export declare const CREDITS = "credits";
17
+ /** A binding to the credits: the class's model (`credits`) or a model named (`credits:<id>`). */
18
+ export declare function isCreditsRef(ref: string | undefined): boolean;
19
+ /** The model a credits binding names; null where engenty picks it. */
20
+ export declare function creditsModelOf(ref: string | undefined): string | null;
21
+ export declare function creditsRef(model: string | null): string;
22
+ /** A media model the credits pay for, as the model-gateway lists it (`/v1/models`, `models`). */
23
+ export interface CreditModel {
24
+ id: string;
25
+ name: string;
26
+ /** Who serves it: `ai-gateway`, `fal`, `elevenlabs`. */
27
+ source: string;
28
+ /** Who made it: `google`, `bfl`, `fal`, `elevenlabs` … */
29
+ provider: string;
30
+ kind: "image" | "video" | "speech" | "transcription";
31
+ creditsPerImage?: number;
32
+ creditsPerSecond?: number;
33
+ creditsPer1kCharacters?: number;
34
+ creditsPerMinute?: number;
35
+ }
36
+ /** The capability a credit model serves. */
37
+ export declare function capabilityOfKind(kind: CreditModel["kind"]): ModelCapability;
38
+ /** The providers whose API key a person can bring. */
39
+ export declare const PROVIDER_IDS: readonly ["openai", "anthropic", "google", "fal", "elevenlabs", "replicate", "gateway"];
40
+ export type ProviderId = (typeof PROVIDER_IDS)[number];
41
+ interface Labels {
42
+ de: string;
43
+ en: string;
44
+ }
45
+ export interface ModelOption {
46
+ /** The binding: `<provider>:<the provider's model id>`. */
47
+ ref: string;
48
+ /** The model's own name; not translated. */
49
+ label: string;
50
+ note?: Labels;
51
+ }
52
+ export interface ProviderInfo {
53
+ id: ProviderId;
54
+ name: string;
55
+ /** One line on what it is, for someone who never heard of it. */
56
+ about: Labels;
57
+ /** Where a person makes a key. */
58
+ keyUrl: string;
59
+ /** How a key looks, for the input's placeholder. */
60
+ keyPlaceholder: string;
61
+ /** The models offered per capability, the first one is taken when the provider is picked. */
62
+ models: Partial<Record<ModelCapability, ModelOption[]>>;
63
+ /** For text: the model of each class when this provider thinks. */
64
+ text?: Record<TextClass, string>;
65
+ }
66
+ export declare const PROVIDERS: readonly ProviderInfo[];
67
+ export declare function providerInfo(id: string): ProviderInfo | null;
68
+ /**
69
+ * The provider a binding goes to: `fal:…` names it, a binding without one (`google/veo-…`) goes
70
+ * through the AI Gateway. Null for an installed client (`codex/…`), a local model and credits.
71
+ */
72
+ export declare function providerOfRef(ref: string): ProviderId | null;
73
+ /** The name of a bound model as a person reads it: the offered label, else the provider's id. */
74
+ export declare function modelLabel(ref: string): string;
75
+ export {};