@tradalab/lyra 3.18.0 → 3.19.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 +2 -2
- package/dist/blocks/index.d.ts +236 -2
- package/dist/blocks/index.js +865 -19
- package/dist/blocks/index.js.map +1 -1
- package/dist/chunk-W3J2KTYP.js +82 -0
- package/dist/chunk-W3J2KTYP.js.map +1 -0
- package/dist/hooks/index.d.ts +9 -1
- package/dist/hooks/index.js +1 -1
- package/dist/shell/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-D2O4GTCC.js +0 -30
- package/dist/chunk-D2O4GTCC.js.map +0 -1
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ The stylesheet pulls in Tailwind v4, so your app needs `@tailwindcss/postcss`.
|
|
|
25
25
|
| Subpath | Exports | Boundary |
|
|
26
26
|
|---|---|---|
|
|
27
27
|
| `@tradalab/lyra/utils` | `cn`, `foldText`, `formatBytes`/`formatCount`, `addTag`/`matchesKeyword`, `pickDelimiter`/`groupByPrefix`, `CONNECTION_COLORS`/`resolveColor`/`ENV_FRAME` | server-safe |
|
|
28
|
-
| `@tradalab/lyra/hooks` | `useMobile`, `useDirtyFields` | client |
|
|
28
|
+
| `@tradalab/lyra/hooks` | `useMobile`, `useDirtyFields`, `useBackClose`/`pushBackLayer` | client |
|
|
29
29
|
| `@tradalab/lyra/ui` | 61 shadcn primitives + `AccountMenu`, `ActionButton`, `Container`, `EmptyState`, `StatusBadge` | client |
|
|
30
|
-
| `@tradalab/lyra/blocks` | `Form`/`FormField` + RHF glue, `Panel`, `Confirm`/`useConfirm`, `Tree`, `TzPicker`, `OptionPicker`, `MobileSheet`, `ChoiceDrawer`, `McpSettings`, `LlmSettings`, `PlatePicker`, `usePlate`, `useCompact`, `PreferenceScript`, `StatTile`, `BarList`, `ColorSwatches`, `TagInput`, `loadExpanded`/`saveExpanded`, `DateField`, `LockedReason`, `UnsavedBadge`, `useConfirmReason`, `useBlocked` | client |
|
|
30
|
+
| `@tradalab/lyra/blocks` | `Form`/`FormField` + RHF glue, `Panel`, `Confirm`/`useConfirm`, `Tree`, `TzPicker`, `OptionPicker`, `MobileSheet`, `ChoiceDrawer`, `McpSettings`, `LlmSettings`, `PlatePicker`, `usePlate`, `useCompact`, `PreferenceScript`, `StatTile`, `BarList`, `ColorSwatches`, `TagInput`, `loadExpanded`/`saveExpanded`, `DateField`, `LockedReason`, `UnsavedBadge`, `useConfirmReason`, `useBlocked`, `ConnectionTree`/`buildConnectionTree`, `ConfigListDialog`, `SshFields`/`TlsFields`/`ProxyFields` + `sshDefaults`/`tlsDefaults`/`proxyDefaults`, `ReleaseNotes`, `useHostKeyTrust` + `hostKeyAsk`/`retryAfterTrust` | client |
|
|
31
31
|
| `@tradalab/lyra/data-table` | `DataTable` + `usePager`, `TableFilterBar`, `TableFilterChips`, `TableSearch`, `TableReload`, `filterRows`, `pageWindow` | client |
|
|
32
32
|
| `@tradalab/lyra/shell` | `AppShell`, `PageShell`, `PageHeader`, `NavItem`, `NavGroup`, `Breadcrumbs`, `BottomNav`, `useActiveRoute`, `useSearchParam`, `useTabParam`, `usePageParam`, `UrlTabs` | client |
|
|
33
33
|
| `@tradalab/lyra/styles.css` | Tailwind v4 base + `radix-lyra` tokens (light/dark) | CSS |
|
package/dist/blocks/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_hook_form from 'react-hook-form';
|
|
2
|
-
import { FieldValues, FieldPath, ControllerProps } from 'react-hook-form';
|
|
2
|
+
import { FieldValues, FieldPath, ControllerProps, UseFormReturn } from 'react-hook-form';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import { ReactNode, DragEvent, HTMLAttributes, ComponentProps, ReactElement } from 'react';
|
|
5
5
|
import { Slot, Label } from 'radix-ui';
|
|
@@ -307,6 +307,229 @@ interface TagInputProps extends Pick<ComponentProps<"input">, "id" | "aria-descr
|
|
|
307
307
|
/** Tags as chips plus a text box: Enter, comma or blur adds, Backspace on an empty box removes the last. Repeats ignoring case are dropped, also from `value`. */
|
|
308
308
|
declare function TagInput({ value, onChange, suggestions, placeholder, removeLabel, className, disabled, ...aria }: TagInputProps): React$1.JSX.Element;
|
|
309
309
|
|
|
310
|
+
interface ConnectionTreeGroup {
|
|
311
|
+
id: string;
|
|
312
|
+
name: string;
|
|
313
|
+
sort_order?: number;
|
|
314
|
+
}
|
|
315
|
+
interface ConnectionTreeConnection {
|
|
316
|
+
id: string;
|
|
317
|
+
name: string;
|
|
318
|
+
group_id?: string;
|
|
319
|
+
sort_order?: number;
|
|
320
|
+
}
|
|
321
|
+
interface ConnectionTreeItem<G extends ConnectionTreeGroup, C extends ConnectionTreeConnection> {
|
|
322
|
+
id: string;
|
|
323
|
+
name: string;
|
|
324
|
+
level: number;
|
|
325
|
+
isGroup: boolean;
|
|
326
|
+
group?: G;
|
|
327
|
+
connection?: C;
|
|
328
|
+
children?: ConnectionTreeItem<G, C>[];
|
|
329
|
+
}
|
|
330
|
+
/** Groups first in their saved order, each holding its connections; then connections with no known group. Inputs are not mutated. */
|
|
331
|
+
declare function buildConnectionTree<G extends ConnectionTreeGroup, C extends ConnectionTreeConnection>(groups: readonly G[], connections: readonly C[]): ConnectionTreeItem<G, C>[];
|
|
332
|
+
/** The default filter: the connection's name, ignoring case and Vietnamese marks. */
|
|
333
|
+
declare function connectionNameMatches(item: {
|
|
334
|
+
name: string;
|
|
335
|
+
}, keyword: string): boolean;
|
|
336
|
+
|
|
337
|
+
interface ConnectionTreeProps<G extends ConnectionTreeGroup, C extends ConnectionTreeConnection> {
|
|
338
|
+
groups: readonly G[];
|
|
339
|
+
connections: readonly C[];
|
|
340
|
+
keyword?: string;
|
|
341
|
+
matches?: (item: ConnectionTreeItem<G, C>, keyword: string) => boolean;
|
|
342
|
+
storageKey: string;
|
|
343
|
+
activeId?: string;
|
|
344
|
+
onOpen?: (connection: C) => void;
|
|
345
|
+
onDrop?: (plan: DropPlan) => void | Promise<void>;
|
|
346
|
+
icon?: (item: ConnectionTreeItem<G, C>) => ReactNode;
|
|
347
|
+
iconClassName?: (item: ConnectionTreeItem<G, C>) => string | undefined;
|
|
348
|
+
badges?: (item: ConnectionTreeItem<G, C>, memberIds: readonly string[]) => ReactNode;
|
|
349
|
+
actions?: (item: ConnectionTreeItem<G, C>) => ReactNode;
|
|
350
|
+
className?: string;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Saved connections in their groups, for a sidebar. Expansion persists under storageKey, except while filtering;
|
|
354
|
+
* dropping into a closed group opens it. Drag is off while filtering and when onDrop is absent.
|
|
355
|
+
*/
|
|
356
|
+
declare function ConnectionTree<G extends ConnectionTreeGroup, C extends ConnectionTreeConnection>({ groups, connections, keyword, matches, storageKey, activeId, onOpen, onDrop, icon, iconClassName, badges, actions, className, }: ConnectionTreeProps<G, C>): React$1.JSX.Element;
|
|
357
|
+
|
|
358
|
+
interface ConfigListDialogLabels {
|
|
359
|
+
add: string;
|
|
360
|
+
delete: string;
|
|
361
|
+
test: string;
|
|
362
|
+
save: string;
|
|
363
|
+
}
|
|
364
|
+
interface ConfigListDialogProps<T> {
|
|
365
|
+
open: boolean;
|
|
366
|
+
onOpenChange: (open: boolean) => void;
|
|
367
|
+
title: ReactNode;
|
|
368
|
+
items: readonly T[];
|
|
369
|
+
getId: (item: T) => string;
|
|
370
|
+
renderItem: (item: T) => ReactNode;
|
|
371
|
+
selectedId?: string;
|
|
372
|
+
onSelect: (item: T) => void;
|
|
373
|
+
onAdd: () => void;
|
|
374
|
+
loading?: boolean;
|
|
375
|
+
onSave?: () => unknown;
|
|
376
|
+
onTest?: () => unknown;
|
|
377
|
+
onDelete?: () => unknown;
|
|
378
|
+
labels?: Partial<ConfigListDialogLabels>;
|
|
379
|
+
children?: ReactNode;
|
|
380
|
+
className?: string;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Saved configurations on the left, the selected one's form on the right, Delete / Test / Save below it.
|
|
384
|
+
* A button stays busy until the promise its handler returns settles; a rejection is the handler's to report.
|
|
385
|
+
*/
|
|
386
|
+
declare function ConfigListDialog<T>({ open, onOpenChange, title, items, getId, renderItem, selectedId, onSelect, onAdd, loading, onSave, onTest, onDelete, labels, children, className, }: ConfigListDialogProps<T>): React$1.JSX.Element;
|
|
387
|
+
|
|
388
|
+
interface FieldsLabels {
|
|
389
|
+
host: string;
|
|
390
|
+
port: string;
|
|
391
|
+
username: string;
|
|
392
|
+
password: string;
|
|
393
|
+
optional: string;
|
|
394
|
+
required: string;
|
|
395
|
+
portRange: string;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
interface ProxyValues {
|
|
399
|
+
id?: string;
|
|
400
|
+
protocol: string;
|
|
401
|
+
host: string;
|
|
402
|
+
port: number;
|
|
403
|
+
username?: string;
|
|
404
|
+
password?: string;
|
|
405
|
+
}
|
|
406
|
+
declare function proxyDefaults(p?: Partial<ProxyValues>): ProxyValues;
|
|
407
|
+
type ProxyFieldsLabels = FieldsLabels & {
|
|
408
|
+
protocol: string;
|
|
409
|
+
};
|
|
410
|
+
/** Protocol (HTTP CONNECT or SOCKS5), host, port and optional credentials of a proxy, bound to the caller's form. */
|
|
411
|
+
declare function ProxyFields({ form, labels, secretPlaceholder, }: {
|
|
412
|
+
form: UseFormReturn<ProxyValues>;
|
|
413
|
+
labels?: Partial<ProxyFieldsLabels>;
|
|
414
|
+
secretPlaceholder?: string;
|
|
415
|
+
}): React$1.JSX.Element;
|
|
416
|
+
|
|
417
|
+
interface TlsValues {
|
|
418
|
+
id?: string;
|
|
419
|
+
name?: string;
|
|
420
|
+
verify: boolean;
|
|
421
|
+
use_sni: boolean;
|
|
422
|
+
server_name?: string;
|
|
423
|
+
ca_cert?: string;
|
|
424
|
+
client_auth: boolean;
|
|
425
|
+
cert?: string;
|
|
426
|
+
key?: string;
|
|
427
|
+
}
|
|
428
|
+
declare function tlsDefaults(t?: Partial<TlsValues>): TlsValues;
|
|
429
|
+
interface TlsFieldsLabels {
|
|
430
|
+
name: string;
|
|
431
|
+
optional: string;
|
|
432
|
+
verify: string;
|
|
433
|
+
verifyHint: string;
|
|
434
|
+
useSni: string;
|
|
435
|
+
useSniHint: string;
|
|
436
|
+
serverName: string;
|
|
437
|
+
caCert: string;
|
|
438
|
+
clientAuth: string;
|
|
439
|
+
clientAuthHint: string;
|
|
440
|
+
clientCert: string;
|
|
441
|
+
clientKey: string;
|
|
442
|
+
}
|
|
443
|
+
/** Verification, SNI, CA bundle and an optional client certificate, bound to the caller's form. secretPlaceholder replaces the key's PEM hint when editing. */
|
|
444
|
+
declare function TlsFields({ form, labels, serverNamePlaceholder, secretPlaceholder, }: {
|
|
445
|
+
form: UseFormReturn<TlsValues>;
|
|
446
|
+
labels?: Partial<TlsFieldsLabels>;
|
|
447
|
+
serverNamePlaceholder?: string;
|
|
448
|
+
secretPlaceholder?: string;
|
|
449
|
+
}): React$1.JSX.Element;
|
|
450
|
+
|
|
451
|
+
type SshKind = "password" | "keypair" | "agent";
|
|
452
|
+
interface SshValues {
|
|
453
|
+
id?: string;
|
|
454
|
+
host: string;
|
|
455
|
+
port: number;
|
|
456
|
+
timeout: number;
|
|
457
|
+
username: string;
|
|
458
|
+
kind: SshKind;
|
|
459
|
+
password?: string;
|
|
460
|
+
private_key?: string;
|
|
461
|
+
passphrase?: string;
|
|
462
|
+
host_key?: string;
|
|
463
|
+
}
|
|
464
|
+
declare function sshDefaults(s?: Partial<SshValues>): SshValues;
|
|
465
|
+
type SshFieldsLabels = FieldsLabels & {
|
|
466
|
+
timeout: string;
|
|
467
|
+
kind: string;
|
|
468
|
+
kindPassword: string;
|
|
469
|
+
kindKeypair: string;
|
|
470
|
+
kindAgent: string;
|
|
471
|
+
privateKey: string;
|
|
472
|
+
privateKeyPlaceholder: string;
|
|
473
|
+
passphrase: string;
|
|
474
|
+
hostKey: string;
|
|
475
|
+
hostKeyUntrusted: string;
|
|
476
|
+
hostKeyHint: string;
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* Address, login and authentication of an SSH bastion, bound to the caller's form. With pinHostKey the pinned key
|
|
480
|
+
* shows read-only and is cleared once host or port moves away from what the form was reset to.
|
|
481
|
+
*/
|
|
482
|
+
declare function SshFields({ form, labels, kinds, secretPlaceholder, pinHostKey, }: {
|
|
483
|
+
form: UseFormReturn<SshValues>;
|
|
484
|
+
labels?: Partial<SshFieldsLabels>;
|
|
485
|
+
kinds?: readonly SshKind[];
|
|
486
|
+
secretPlaceholder?: string;
|
|
487
|
+
pinHostKey?: boolean;
|
|
488
|
+
}): React$1.JSX.Element;
|
|
489
|
+
|
|
490
|
+
declare const HOST_KEY_UNKNOWN = "ssh_host_key_unknown";
|
|
491
|
+
declare const HOST_KEY_CHANGED = "ssh_host_key_changed";
|
|
492
|
+
type HostKeyAsk = {
|
|
493
|
+
key: string;
|
|
494
|
+
fingerprint: string;
|
|
495
|
+
changed: boolean;
|
|
496
|
+
details: Record<string, unknown>;
|
|
497
|
+
};
|
|
498
|
+
/** Reads the fault scorix netx.HostKeyFault sends (code + details.key/fingerprint); null for any other error. */
|
|
499
|
+
declare function hostKeyAsk(e: unknown): HostKeyAsk | null;
|
|
500
|
+
/** Calls sharing an id while one is in flight get that call's promise instead of starting another. */
|
|
501
|
+
declare function sharedWhilePending<T>(): (id: string, run: () => Promise<T>) => Promise<T>;
|
|
502
|
+
type TrustOutcome<T> = {
|
|
503
|
+
declined: true;
|
|
504
|
+
error: unknown;
|
|
505
|
+
} | {
|
|
506
|
+
declined: false;
|
|
507
|
+
value: T;
|
|
508
|
+
trusted: boolean;
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* Runs `run`; on a host key fault asks `confirm`, pins through what `trustFor` returns, then runs once more.
|
|
512
|
+
* `trustFor` returns undefined when this call cannot pin (no ssh config id), and the fault is rethrown unasked.
|
|
513
|
+
*/
|
|
514
|
+
declare function retryAfterTrust<T>(run: () => Promise<T>, confirm: (ask: HostKeyAsk) => Promise<boolean>, trustFor: (ask: HostKeyAsk) => (() => Promise<unknown>) | undefined): Promise<TrustOutcome<T>>;
|
|
515
|
+
|
|
516
|
+
type HostKeyLabels = {
|
|
517
|
+
trustTitle: string;
|
|
518
|
+
changedTitle: string;
|
|
519
|
+
trustDescription: (fingerprint: string) => ReactNode;
|
|
520
|
+
changedDescription: (fingerprint: string) => ReactNode;
|
|
521
|
+
trust: string;
|
|
522
|
+
cancel: string;
|
|
523
|
+
};
|
|
524
|
+
/**
|
|
525
|
+
* The trust prompt for scorix host key faults, inside a ConfirmProvider. A changed key gets a danger confirm, and
|
|
526
|
+
* prompts for the same key in the same scope while one is open share it. Both functions keep their identity.
|
|
527
|
+
*/
|
|
528
|
+
declare function useHostKeyTrust(labels: HostKeyLabels): {
|
|
529
|
+
confirmHostKey: (ask: HostKeyAsk, scope?: string) => Promise<boolean>;
|
|
530
|
+
runWithTrust: <T>(run: () => Promise<T>, trustFor: (ask: HostKeyAsk) => (() => Promise<unknown>) | undefined, scope?: string) => Promise<TrustOutcome<T>>;
|
|
531
|
+
};
|
|
532
|
+
|
|
310
533
|
interface TzPickerLabels {
|
|
311
534
|
/** Shown when the value is empty and `allowInherit`. Default: "Inherit". */
|
|
312
535
|
inherit?: string;
|
|
@@ -767,4 +990,15 @@ interface LlmSettingsProps {
|
|
|
767
990
|
}
|
|
768
991
|
declare function LlmSettings({ api, labels, className, header, footer }: LlmSettingsProps): React$1.JSX.Element;
|
|
769
992
|
|
|
770
|
-
|
|
993
|
+
interface ReleaseNotesProps {
|
|
994
|
+
notes: string;
|
|
995
|
+
onOpenLink?: (url: string) => void;
|
|
996
|
+
className?: string;
|
|
997
|
+
}
|
|
998
|
+
/**
|
|
999
|
+
* Renders the markdown of a CHANGELOG section or a GitHub release body as React nodes, never as HTML.
|
|
1000
|
+
* Links keep only http(s) and mailto targets; with `onOpenLink` a click goes there instead of the webview.
|
|
1001
|
+
*/
|
|
1002
|
+
declare function ReleaseNotes({ notes, onOpenLink, className }: ReleaseNotesProps): React$1.JSX.Element;
|
|
1003
|
+
|
|
1004
|
+
export { AuthCard, type AuthCardProps, AvatarTile, type AvatarTileProps, BarList, type BarListItem, BlockedContext, BlockedDialog, type BlockedFn, type BlockedOptions, ChoiceDrawer, type ChoiceDrawerProps, type ChoiceOption, ColorSwatches, type ColorSwatchesProps, ConfigListDialog, type ConfigListDialogLabels, type ConfigListDialogProps, ConfirmContext, ConfirmDialog, type ConfirmFn, type ConfirmOptions, ConfirmProvider, ConfirmReasonContext, type ConfirmReasonFn, type ConfirmReasonOptions, ConnectionTree, type ConnectionTreeConnection, type ConnectionTreeGroup, type ConnectionTreeItem, type ConnectionTreeProps, DateField, type DateFieldProps, type DatePattern, type DropPlan, type DropPosition, type FieldsLabels, type FlatTreeNode, Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, HOST_KEY_CHANGED, HOST_KEY_UNKNOWN, type HostKeyAsk, type HostKeyLabels, type LlmCapability, type LlmDriver, type LlmField, type LlmFound, type LlmModel, type LlmProvider, type LlmProviderInput, type LlmPullProgress, LlmSettings, type LlmSettingsApi, type LlmSettingsFormat, type LlmSettingsLabels, type LlmSettingsProps, type LlmSlot, type LlmState, LockedReason, type McpCall, type McpClient, McpSettings, type McpSettingsApi, type McpSettingsLabels, type McpStatus, type McpTool, MobileSheet, type MobileSheetProps, OptionPicker, type OptionPickerLabels, Panel, PanelCard, type PanelCardProps, type PanelItemProps, type PickOption, ProxyFields, type ProxyFieldsLabels, type ProxyValues, type ReasonField, ReleaseNotes, type ReleaseNotesProps, SshFields, type SshFieldsLabels, type SshKind, type SshValues, StatTile, type StatTileProps, TagInput, type TagInputProps, TlsFields, type TlsFieldsLabels, type TlsValues, type TreeData, TreeDndProvider, type TreeDndProviderProps, 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, type TrustOutcome, TzPicker, type TzPickerLabels, type TzPickerProps, UnsavedBadge, buildConnectionTree, connectionNameMatches, datePattern, filterTree, flattenTree, formatDate, hostKeyAsk, loadExpanded, moveId, parseDate, planDrop, proxyDefaults, retryAfterTrust, sameOrder, saveExpanded, sharedWhilePending, sortTree, sshDefaults, tlsDefaults, useBlocked, useConfirm, useConfirmReason, useFormField, useHostKeyTrust, useTreeDndNode, useTreeDndRoot };
|