@camstack/ui-library 1.2.303 → 1.2.305
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/dist/composites/grouped-tile-picker.d.ts +31 -0
- package/dist/composites/index.d.ts +1 -0
- package/dist/composites/log-history-paging.d.ts +62 -0
- package/dist/composites/log-stream.d.ts +6 -10
- package/dist/composites/scope-picker.d.ts +1 -1
- package/dist/generated/system-hooks.d.ts +4 -10
- package/dist/hooks/use-log-history.d.ts +26 -0
- package/dist/index.cjs +367 -92
- package/dist/index.js +366 -89
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `GroupedTilePicker` — choose ONE "type of thing" from tiles grouped by who
|
|
3
|
+
* provides it (an AI profile kind, a notification-target kind…): an uppercase
|
|
4
|
+
* group label, then a grid of icon + label tiles. The pre-modal of a
|
|
5
|
+
* create-flow whose form depends on the choice.
|
|
6
|
+
*
|
|
7
|
+
* The tile is deliberately not a `Button`: a vertical icon-over-label card in
|
|
8
|
+
* a grid, which toolbar-button chrome fights. One place owns that look so the
|
|
9
|
+
* pickers stay identical.
|
|
10
|
+
*/
|
|
11
|
+
import type { JSX, ReactNode } from "react";
|
|
12
|
+
export interface TilePickerTile {
|
|
13
|
+
/** Unique within the picker; handed back to `onPick`. */
|
|
14
|
+
readonly key: string;
|
|
15
|
+
readonly label: string;
|
|
16
|
+
readonly icon: ReactNode;
|
|
17
|
+
readonly testId?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TilePickerGroup {
|
|
20
|
+
readonly id: string;
|
|
21
|
+
/** Shown above the group's tiles (e.g. the providing addon). */
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly tiles: readonly TilePickerTile[];
|
|
24
|
+
}
|
|
25
|
+
export interface GroupedTilePickerProps {
|
|
26
|
+
readonly groups: readonly TilePickerGroup[];
|
|
27
|
+
readonly onPick: (key: string) => void;
|
|
28
|
+
/** Shown when there is no group at all. */
|
|
29
|
+
readonly emptyMessage: string;
|
|
30
|
+
}
|
|
31
|
+
export declare function GroupedTilePicker({ groups, onPick, emptyMessage }: GroupedTilePickerProps): JSX.Element;
|
|
@@ -135,6 +135,7 @@ export { ExtensionsPanel, type ExtensionsPanelProps } from "./extensions/Extensi
|
|
|
135
135
|
export * from "./filter-bar";
|
|
136
136
|
export * from "./form-field";
|
|
137
137
|
export type { GroupedModelSelectorProps } from "./grouped-model-selector";
|
|
138
|
+
export * from "./grouped-tile-picker";
|
|
138
139
|
export { GroupedModelSelector } from "./grouped-model-selector";
|
|
139
140
|
export type { HlsVideoProps } from "./hls-video";
|
|
140
141
|
export { HlsVideo } from "./hls-video";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure paging logic for the server-served log history (D898).
|
|
3
|
+
*
|
|
4
|
+
* The server answers one TIME-BOUNDED slice per call: `done: false` with fewer
|
|
5
|
+
* than `limit` entries means "the budget ran out, still searching". The client
|
|
6
|
+
* keeps calling with `before: nextBefore` until it holds a full page, the
|
|
7
|
+
* source says `done`, or the operator cancels. Kept free of React and tRPC so
|
|
8
|
+
* the loop is unit-testable.
|
|
9
|
+
*/
|
|
10
|
+
export interface LogWireEntry {
|
|
11
|
+
readonly id?: string;
|
|
12
|
+
readonly timestamp: string;
|
|
13
|
+
readonly level: string;
|
|
14
|
+
readonly message: string;
|
|
15
|
+
readonly scope?: string;
|
|
16
|
+
readonly tags?: Record<string, string | undefined>;
|
|
17
|
+
readonly meta?: Record<string, unknown>;
|
|
18
|
+
}
|
|
19
|
+
export interface LogWirePage {
|
|
20
|
+
/** NEWEST FIRST. */
|
|
21
|
+
readonly entries: readonly LogWireEntry[];
|
|
22
|
+
readonly nextBefore: string | null;
|
|
23
|
+
readonly nextAfter: string | null;
|
|
24
|
+
readonly scannedBytes: number;
|
|
25
|
+
readonly done: boolean;
|
|
26
|
+
readonly cancelled?: boolean;
|
|
27
|
+
readonly source: string;
|
|
28
|
+
}
|
|
29
|
+
/** Fetches one slice older than `before` (undefined = the first page). */
|
|
30
|
+
export type FetchLogSlice = (before: string | undefined, remaining: number, signal: AbortSignal) => Promise<LogWirePage>;
|
|
31
|
+
export interface CollectedPage {
|
|
32
|
+
/** NEWEST FIRST, across every slice the loop made. */
|
|
33
|
+
readonly entries: readonly LogWireEntry[];
|
|
34
|
+
/** Cursor for the next older page; null when nothing older exists. */
|
|
35
|
+
readonly nextBefore: string | null;
|
|
36
|
+
readonly done: boolean;
|
|
37
|
+
readonly cancelled: boolean;
|
|
38
|
+
readonly scannedBytes: number;
|
|
39
|
+
readonly source: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
export interface CollectPageOptions {
|
|
42
|
+
readonly fetchSlice: FetchLogSlice;
|
|
43
|
+
readonly limit: number;
|
|
44
|
+
readonly before?: string;
|
|
45
|
+
readonly signal: AbortSignal;
|
|
46
|
+
/** Called after every slice with the bytes scanned so far. */
|
|
47
|
+
readonly onProgress?: (scannedBytes: number) => void;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Accumulate slices until `limit` entries, `done`, or an abort. An abort keeps
|
|
51
|
+
* what was already collected and the cursor reached, so "Load older" resumes
|
|
52
|
+
* where the scan stopped instead of starting again.
|
|
53
|
+
*/
|
|
54
|
+
export declare function collectPage(options: CollectPageOptions): Promise<CollectedPage>;
|
|
55
|
+
/** Stable identity of an entry: the server id, else the legacy composite key. */
|
|
56
|
+
export declare function logEntryKey(entry: LogWireEntry): string;
|
|
57
|
+
/**
|
|
58
|
+
* History (newest first, as paged) merged with live entries (arrival order),
|
|
59
|
+
* deduped by key — a live entry wins (richer tags/meta) — and returned
|
|
60
|
+
* chronologically, newest LAST. Ties keep insertion order.
|
|
61
|
+
*/
|
|
62
|
+
export declare function mergeLogEntries(history: readonly LogWireEntry[], live: readonly LogWireEntry[]): LogWireEntry[];
|
|
@@ -10,14 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { type JSX } from "react";
|
|
12
12
|
import { type LiveBuffer } from "../hooks/use-live-buffer";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readonly level: string;
|
|
16
|
-
readonly message: string;
|
|
17
|
-
readonly scope?: string;
|
|
18
|
-
readonly tags?: Record<string, string | undefined>;
|
|
19
|
-
readonly meta?: Record<string, unknown>;
|
|
20
|
-
}
|
|
13
|
+
import { type LogWireEntry } from "./log-history-paging";
|
|
14
|
+
type LogEntry = LogWireEntry;
|
|
21
15
|
export interface LogStreamProps {
|
|
22
16
|
/** Lock to a specific agent. When set, the agent selector is hidden. */
|
|
23
17
|
readonly agentId?: string;
|
|
@@ -65,7 +59,9 @@ export interface LogStreamProps {
|
|
|
65
59
|
readonly showDeviceChip?: boolean;
|
|
66
60
|
/** Show the filter bar with selectors. Set false for compact inline use. */
|
|
67
61
|
readonly showFilters?: boolean;
|
|
68
|
-
/**
|
|
62
|
+
/** Show the history source selector (default: follows `showFilters`). */
|
|
63
|
+
readonly showSourceSelect?: boolean;
|
|
64
|
+
/** Entries per history page (default: 100). */
|
|
69
65
|
readonly limit?: number;
|
|
70
66
|
/**
|
|
71
67
|
* Optional controlled live buffer. When provided, the stream reads
|
|
@@ -79,7 +75,7 @@ export interface LogStreamProps {
|
|
|
79
75
|
readonly onClose?: () => void;
|
|
80
76
|
readonly className?: string;
|
|
81
77
|
}
|
|
82
|
-
export declare function LogStream({ agentId: propsAgentId, addonId: propsAddonId, deviceId: propsDeviceId, containerDeviceId: propsContainerDeviceId, integrationId: propsIntegrationId, requestId: propsRequestId, level: initialLevel, maxHeight, showScope, showDeviceChip, showFilters, limit, liveBuffer: externalBuffer, onClose, className }: LogStreamProps): JSX.Element;
|
|
78
|
+
export declare function LogStream({ agentId: propsAgentId, addonId: propsAddonId, deviceId: propsDeviceId, containerDeviceId: propsContainerDeviceId, integrationId: propsIntegrationId, requestId: propsRequestId, level: initialLevel, maxHeight, showScope, showDeviceChip, showFilters, showSourceSelect, limit, liveBuffer: externalBuffer, onClose, className }: LogStreamProps): JSX.Element;
|
|
83
79
|
export interface FloatingLogStreamProps extends LogStreamProps {
|
|
84
80
|
/** Position: 'bottom' anchors to parent bottom, 'overlay' is absolute positioned. */
|
|
85
81
|
readonly position?: "bottom" | "overlay";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Two consumers: the user-scope editor on `/system/users` (admin grants
|
|
5
5
|
* a baseline scope set to a non-admin user) and the scoped-token create
|
|
6
6
|
* modal on `/system/api-keys` (a caller carves out a subset of THEIR
|
|
7
|
-
* scopes for a
|
|
7
|
+
* scopes for a token).
|
|
8
8
|
*
|
|
9
9
|
* Row shapes per scope `type`:
|
|
10
10
|
* - category → target: 'device' | 'system'
|
|
@@ -487,6 +487,8 @@ export declare const useDeviceHistoryListNodeSeries: typeof trpc.deviceHistory.l
|
|
|
487
487
|
export declare const useDeviceHistoryQuery: typeof trpc.deviceHistory.query.useQuery;
|
|
488
488
|
/** Generated alias around `trpc.deviceHistory.queryNode.useQuery`. */
|
|
489
489
|
export declare const useDeviceHistoryQueryNode: typeof trpc.deviceHistory.queryNode.useQuery;
|
|
490
|
+
/** Generated alias around `trpc.deviceHistory.queryMany.useQuery`. */
|
|
491
|
+
export declare const useDeviceHistoryQueryMany: typeof trpc.deviceHistory.queryMany.useQuery;
|
|
490
492
|
/** Generated alias around `trpc.deviceHistory.declareSeries.useMutation`. */
|
|
491
493
|
export declare const useDeviceHistoryDeclareSeries: typeof trpc.deviceHistory.declareSeries.useMutation;
|
|
492
494
|
/** Generated alias around `trpc.deviceHistory.record.useMutation`. */
|
|
@@ -935,8 +937,8 @@ export declare const useLlmMigrateRawSecrets: typeof trpc.llm.migrateRawSecrets.
|
|
|
935
937
|
export declare const useLlmDeleteProfile: typeof trpc.llm.deleteProfile.useMutation;
|
|
936
938
|
/** Generated alias around `trpc.llm.testProfile.useMutation`. */
|
|
937
939
|
export declare const useLlmTestProfile: typeof trpc.llm.testProfile.useMutation;
|
|
938
|
-
/** Generated alias around `trpc.llm.listModels.
|
|
939
|
-
export declare const useLlmListModels: typeof trpc.llm.listModels.
|
|
940
|
+
/** Generated alias around `trpc.llm.listModels.useMutation`. */
|
|
941
|
+
export declare const useLlmListModels: typeof trpc.llm.listModels.useMutation;
|
|
940
942
|
/** Generated alias around `trpc.llm.getDefaults.useQuery`. */
|
|
941
943
|
export declare const useLlmGetDefaults: typeof trpc.llm.getDefaults.useQuery;
|
|
942
944
|
/** Generated alias around `trpc.llm.setDefault.useMutation`. */
|
|
@@ -2317,14 +2319,6 @@ export declare const useUserManagementValidateCredentials: typeof trpc.userManag
|
|
|
2317
2319
|
export declare const useUserManagementListApiKeys: typeof trpc.userManagement.listApiKeys.useQuery;
|
|
2318
2320
|
/** Generated alias around `trpc.userManagement.revokeApiKey.useMutation`. */
|
|
2319
2321
|
export declare const useUserManagementRevokeApiKey: typeof trpc.userManagement.revokeApiKey.useMutation;
|
|
2320
|
-
/** Generated alias around `trpc.userManagement.createScopedToken.useMutation`. */
|
|
2321
|
-
export declare const useUserManagementCreateScopedToken: typeof trpc.userManagement.createScopedToken.useMutation;
|
|
2322
|
-
/** Generated alias around `trpc.userManagement.revokeScopedToken.useMutation`. */
|
|
2323
|
-
export declare const useUserManagementRevokeScopedToken: typeof trpc.userManagement.revokeScopedToken.useMutation;
|
|
2324
|
-
/** Generated alias around `trpc.userManagement.validateScopedToken.useQuery`. */
|
|
2325
|
-
export declare const useUserManagementValidateScopedToken: typeof trpc.userManagement.validateScopedToken.useQuery;
|
|
2326
|
-
/** Generated alias around `trpc.userManagement.listScopedTokens.useQuery`. */
|
|
2327
|
-
export declare const useUserManagementListScopedTokens: typeof trpc.userManagement.listScopedTokens.useQuery;
|
|
2328
2322
|
/** Generated alias around `trpc.userManagement.setupTotp.useMutation`. */
|
|
2329
2323
|
export declare const useUserManagementSetupTotp: typeof trpc.userManagement.setupTotp.useMutation;
|
|
2330
2324
|
/** Generated alias around `trpc.userManagement.confirmTotp.useMutation`. */
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type LogWireEntry } from "../composites/log-history-paging";
|
|
2
|
+
export type LogHistoryLevel = "debug" | "info" | "warn" | "error";
|
|
3
|
+
/** The filters the SERVER applies; everything but paging. */
|
|
4
|
+
export interface LogHistoryQuery {
|
|
5
|
+
/** A log-destination addonId or `ring`; undefined = the server default. */
|
|
6
|
+
readonly source?: string;
|
|
7
|
+
readonly level: LogHistoryLevel;
|
|
8
|
+
readonly text?: string;
|
|
9
|
+
readonly tags?: Record<string, string | number>;
|
|
10
|
+
}
|
|
11
|
+
export type LogHistoryStatus = "idle" | "loading";
|
|
12
|
+
export interface LogHistory {
|
|
13
|
+
/** Newest first, as paged. */
|
|
14
|
+
readonly entries: readonly LogWireEntry[];
|
|
15
|
+
readonly status: LogHistoryStatus;
|
|
16
|
+
/** True when nothing older exists ("Beginning of logs"). */
|
|
17
|
+
readonly done: boolean;
|
|
18
|
+
/** Bytes scanned by the scan in flight (0 until its first slice answers). */
|
|
19
|
+
readonly scannedBytes: number;
|
|
20
|
+
/** The source that answered (the server may fall back to `ring`). */
|
|
21
|
+
readonly source: string | undefined;
|
|
22
|
+
readonly error: string | null;
|
|
23
|
+
readonly loadOlder: () => void;
|
|
24
|
+
readonly cancel: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function useLogHistory(query: LogHistoryQuery, limit: number): LogHistory;
|