@tradalab/lyra 2.7.0 → 3.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.
@@ -193,4 +193,225 @@ declare function OptionPicker({ value, onChange, options, labels, disabled, id,
193
193
  className?: string;
194
194
  }): React.JSX.Element;
195
195
 
196
- export { ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, TreeExpander, type TreeExpanderProps, TreeIcon, type TreeIconProps, TreeLabel, type TreeLabelProps, TreeLines, TreeNode, TreeNodeContent, type TreeNodeContentProps, type TreeNodeProps, TreeNodeTrigger, type TreeNodeTriggerProps, TreeProvider, type TreeProviderProps, TreeView, type TreeViewProps, TzPicker, type TzPickerLabels, type TzPickerProps, useConfirm, useFormField };
196
+ /**
197
+ * The settings screen for a scorix app's MCP tools: the user's switch, one switch per tool,
198
+ * the programs allowed in, and the calls as they happen.
199
+ *
200
+ * The api is INJECTED and its types are declared here, shaped like the `scorixMCP` that
201
+ * `scorix generate proto` emits, so an app passes that object as is. Importing scorix's types
202
+ * would put a desktop framework under the UI kit of every web app.
203
+ *
204
+ * `copy` is injected too, and without it there is no copy button: `navigator.clipboard` needs
205
+ * a secure context, which only WebView2 grants a scorix app. Reaching for it here would work
206
+ * on Windows and do nothing on macOS and Linux.
207
+ */
208
+ interface McpTool {
209
+ name: string;
210
+ description: string;
211
+ destructive: boolean;
212
+ enabled: boolean;
213
+ }
214
+ interface McpClient {
215
+ path: string;
216
+ name?: string;
217
+ approved_at: string;
218
+ }
219
+ interface McpStatus {
220
+ offered: boolean;
221
+ enabled: boolean;
222
+ running: boolean;
223
+ tools: McpTool[];
224
+ clients: McpClient[];
225
+ client: {
226
+ command: string;
227
+ args: string[];
228
+ };
229
+ audit_log: string;
230
+ }
231
+ interface McpCall {
232
+ tool: string;
233
+ client: string;
234
+ client_path: string;
235
+ outcome: "ok" | "error" | "denied";
236
+ error?: string;
237
+ ms: number;
238
+ }
239
+ interface McpSettingsApi {
240
+ status(): Promise<McpStatus>;
241
+ enable(enabled: boolean): Promise<McpStatus>;
242
+ setTool(name: string, enabled: boolean): Promise<McpStatus>;
243
+ revokeClient(path: string): Promise<McpStatus>;
244
+ onCall?(cb: (call: McpCall) => void): () => void;
245
+ }
246
+ interface McpSettingsLabels {
247
+ enable?: string;
248
+ enableHint?: string;
249
+ running?: string;
250
+ stopped?: string;
251
+ notOffered?: string;
252
+ connect?: string;
253
+ connectHint?: string;
254
+ copy?: string;
255
+ copied?: string;
256
+ copyConfig?: string;
257
+ tools?: string;
258
+ toolsHint?: string;
259
+ asksFirst?: string;
260
+ asksFirstHint?: string;
261
+ clients?: string;
262
+ clientsHint?: string;
263
+ clientsEmpty?: string;
264
+ revoke?: string;
265
+ activity?: string;
266
+ activityEmpty?: string;
267
+ ok?: string;
268
+ error?: string;
269
+ denied?: string;
270
+ auditLog?: string;
271
+ auditLogHint?: string;
272
+ retry?: string;
273
+ }
274
+ declare function McpSettings({ api, serverName, copy, labels, locale, className, }: {
275
+ api: McpSettingsApi;
276
+ /** The key under `mcpServers` in the configuration snippet: the app's own short name. */
277
+ serverName: string;
278
+ copy?: (text: string) => Promise<void>;
279
+ labels?: McpSettingsLabels;
280
+ locale?: string;
281
+ className?: string;
282
+ }): React.JSX.Element;
283
+
284
+ /**
285
+ * The settings screen for a scorix app's language models: which provider and model each of the
286
+ * app's slots uses, the providers the user added with their keys, and downloads with progress.
287
+ *
288
+ * The api is INJECTED and its types are declared here, shaped like the JSON of scorix's
289
+ * `mod:llm:*` commands, so an app maps each method to one `invoke` call. Importing scorix's types
290
+ * would put a desktop framework under the UI kit of every web app.
291
+ *
292
+ * Keys never come back from the api: a provider lists which secret fields hold a value, and the
293
+ * form sends only the ones the user typed into or cleared.
294
+ */
295
+ type LlmCapability = "chat" | "embed" | "vision" | "audio" | "tools" | "transcribe" | (string & {});
296
+ interface LlmField {
297
+ key: string;
298
+ label: string;
299
+ kind: "text" | "url" | "secret" | "bool";
300
+ required: boolean;
301
+ default?: string;
302
+ description?: string;
303
+ }
304
+ interface LlmDriver {
305
+ name: string;
306
+ fields: LlmField[];
307
+ }
308
+ interface LlmProvider {
309
+ id: string;
310
+ /** Absent for a provider the app runs itself. */
311
+ driver?: string;
312
+ values: Record<string, string>;
313
+ /** The secret fields that hold a value; never the value. */
314
+ secrets: string[];
315
+ capabilities: LlmCapability[];
316
+ local: boolean;
317
+ /** Can download and delete models. */
318
+ manages: boolean;
319
+ editable: boolean;
320
+ error?: string;
321
+ }
322
+ interface LlmSlot {
323
+ name: string;
324
+ label: string;
325
+ description?: string;
326
+ needs: LlmCapability[];
327
+ local_only: boolean;
328
+ provider?: string;
329
+ model?: string;
330
+ error?: string;
331
+ }
332
+ interface LlmState {
333
+ providers: LlmProvider[];
334
+ slots: LlmSlot[];
335
+ }
336
+ interface LlmModel {
337
+ id: string;
338
+ size?: number;
339
+ parameter_size?: string;
340
+ quantization?: string;
341
+ }
342
+ interface LlmFound {
343
+ name: string;
344
+ driver: string;
345
+ base_url: string;
346
+ version?: string;
347
+ }
348
+ interface LlmProviderInput {
349
+ id: string;
350
+ driver: string;
351
+ values: Record<string, string>;
352
+ /** Only the secret fields being changed; an empty string removes one. */
353
+ secrets: Record<string, string>;
354
+ }
355
+ interface LlmPullProgress {
356
+ provider: string;
357
+ model: string;
358
+ status: string;
359
+ done: number;
360
+ total: number;
361
+ }
362
+ interface LlmSettingsApi {
363
+ state(): Promise<LlmState>;
364
+ drivers(): Promise<LlmDriver[]>;
365
+ saveProvider(input: LlmProviderInput): Promise<LlmState>;
366
+ deleteProvider(id: string): Promise<LlmState>;
367
+ bind(slot: string, provider: string, model: string): Promise<LlmState>;
368
+ unbind(slot: string): Promise<LlmState>;
369
+ models(provider: string): Promise<LlmModel[]>;
370
+ /** Without these three there is no download button. */
371
+ pull?(provider: string, model: string): Promise<boolean>;
372
+ cancelPull?(provider: string, model: string): Promise<boolean>;
373
+ onPull?(cb: (p: LlmPullProgress) => void): () => void;
374
+ /** Runtimes already running on this machine, offered as providers to add. */
375
+ detect?(): Promise<LlmFound[]>;
376
+ }
377
+ interface LlmSettingsLabels {
378
+ slots?: string;
379
+ slotsHint?: string;
380
+ notSet?: string;
381
+ model?: string;
382
+ modelHint?: string;
383
+ localOnly?: string;
384
+ localOnlyHint?: string;
385
+ download?: string;
386
+ notDownloaded?: string;
387
+ cancel?: string;
388
+ providers?: string;
389
+ providersHint?: string;
390
+ providersEmpty?: string;
391
+ add?: string;
392
+ edit?: string;
393
+ remove?: string;
394
+ removeConfirm?: string;
395
+ keep?: string;
396
+ byApp?: string;
397
+ thisMachine?: string;
398
+ remote?: string;
399
+ keySaved?: string;
400
+ driver?: string;
401
+ id?: string;
402
+ idHint?: string;
403
+ save?: string;
404
+ keyKeep?: string;
405
+ keyRemove?: string;
406
+ running?: string;
407
+ addFound?: string;
408
+ retry?: string;
409
+ capabilities?: Partial<Record<string, string>>;
410
+ }
411
+ declare function LlmSettings({ api, labels, className, }: {
412
+ api: LlmSettingsApi;
413
+ labels?: LlmSettingsLabels;
414
+ className?: string;
415
+ }): React.JSX.Element;
416
+
417
+ export { ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, type LlmCapability, type LlmDriver, type LlmField, type LlmFound, type LlmModel, type LlmProvider, type LlmProviderInput, type LlmPullProgress, LlmSettings, type LlmSettingsApi, type LlmSettingsLabels, type LlmSlot, type LlmState, type McpCall, type McpClient, McpSettings, type McpSettingsApi, type McpSettingsLabels, type McpStatus, type McpTool, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, TreeExpander, type TreeExpanderProps, TreeIcon, type TreeIconProps, TreeLabel, type TreeLabelProps, TreeLines, TreeNode, TreeNodeContent, type TreeNodeContentProps, type TreeNodeProps, TreeNodeTrigger, type TreeNodeTriggerProps, TreeProvider, type TreeProviderProps, TreeView, type TreeViewProps, TzPicker, type TzPickerLabels, type TzPickerProps, useConfirm, useFormField };