@makinbakin/sdk 0.0.1-rc.2 → 0.0.1-rc.21
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 +1 -0
- package/_internal/app/components/agent-select.d.ts +16 -2
- package/_internal/app/components/asset-picker.d.ts +25 -0
- package/_internal/app/components/charts/bar-chart.d.ts +16 -0
- package/_internal/app/components/charts/chart-data-table.d.ts +31 -0
- package/_internal/app/components/charts/chart-explainer.d.ts +9 -0
- package/_internal/app/components/charts/chart-tooltip.d.ts +8 -0
- package/_internal/app/components/charts/line-chart.d.ts +13 -0
- package/_internal/app/components/charts/palette.d.ts +24 -0
- package/_internal/app/components/charts/sparkline.d.ts +12 -0
- package/_internal/app/components/charts/stacked-column-chart.d.ts +40 -0
- package/_internal/app/components/confirm-dialog.d.ts +54 -0
- package/_internal/app/components/conversation/activity-group.d.ts +15 -0
- package/_internal/app/components/conversation/agent-turn.d.ts +36 -0
- package/_internal/app/components/conversation/attention.d.ts +56 -0
- package/_internal/app/components/conversation/composer.d.ts +35 -0
- package/_internal/app/components/conversation/conversation-empty-state.d.ts +8 -0
- package/_internal/app/components/conversation/conversation-panel.d.ts +33 -0
- package/_internal/app/components/conversation/conversation.d.ts +14 -0
- package/_internal/app/components/conversation/fold.d.ts +129 -0
- package/_internal/app/components/conversation/notification-sound.d.ts +8 -0
- package/_internal/app/components/conversation/relative-time.d.ts +8 -0
- package/_internal/app/components/conversation/reply-toast.d.ts +15 -0
- package/_internal/app/components/conversation/thread-id.d.ts +8 -0
- package/_internal/app/components/conversation/tool-call-drawer.d.ts +7 -0
- package/_internal/app/components/conversation/turn-recorder.d.ts +37 -0
- package/_internal/app/components/conversation/use-conversation-attention.d.ts +64 -0
- package/_internal/app/components/conversation/use-conversation-thread.d.ts +55 -0
- package/_internal/app/components/conversation/user-message.d.ts +11 -0
- package/_internal/app/components/danger-zone.d.ts +28 -0
- package/_internal/app/components/empty-state.d.ts +18 -6
- package/_internal/app/components/plugin-header.d.ts +4 -3
- package/_internal/app/components/save-bar.d.ts +32 -0
- package/_internal/app/components/score-overlay.d.ts +33 -0
- package/_internal/app/components/search-degraded-chip.d.ts +4 -0
- package/_internal/app/components/search-partial-chip.d.ts +13 -0
- package/_internal/app/components/search-unavailable.d.ts +12 -0
- package/_internal/app/components/section-card.d.ts +22 -0
- package/_internal/app/components/segmented-control.d.ts +28 -0
- package/_internal/app/components/stat-tile.d.ts +26 -0
- package/_internal/app/components/status-badge.d.ts +19 -0
- package/_internal/app/components/turn-output-view.d.ts +57 -0
- package/_internal/app/components/ui/badge.d.ts +1 -1
- package/_internal/app/components/ui/button.d.ts +1 -1
- package/_internal/app/components/underline-tabs.d.ts +6 -2
- package/_internal/app/components/unsaved-changes-guard.d.ts +34 -0
- package/_internal/app/core/conversation-turns.d.ts +148 -0
- package/_internal/app/core/logger.d.ts +1 -0
- package/_internal/app/hooks/use-available-models.d.ts +5 -0
- package/_internal/app/hooks/use-content-store.d.ts +0 -9
- package/_internal/app/hooks/use-file-drop.d.ts +25 -0
- package/_internal/app/hooks/use-history-back.d.ts +1 -0
- package/_internal/app/hooks/use-horizontal-resize.d.ts +22 -0
- package/_internal/app/hooks/use-json-fetch.d.ts +26 -0
- package/_internal/app/hooks/use-nav-badge.d.ts +13 -0
- package/_internal/app/hooks/use-plugin-event.d.ts +19 -0
- package/_internal/app/hooks/use-query-state.d.ts +2 -0
- package/_internal/app/hooks/use-resizable-pane.d.ts +35 -0
- package/_internal/app/hooks/use-schedule.d.ts +47 -1
- package/_internal/app/hooks/use-search.d.ts +27 -8
- package/_internal/app/hooks/use-task-run-history.d.ts +26 -0
- package/_internal/app/hooks/use-toast.d.ts +3 -3
- package/_internal/app/hooks/use-vertical-resize.d.ts +6 -7
- package/_internal/app/lib/browser-notify.d.ts +12 -1
- package/_internal/app/types/index.d.ts +1 -105
- package/_internal/core/adapters/runtime/concepts.d.ts +671 -99
- package/_internal/core/adapters/runtime/errors.d.ts +98 -0
- package/_internal/core/adapters/runtime/helpers.d.ts +19 -0
- package/_internal/core/adapters/runtime/index.d.ts +7 -2
- package/_internal/core/adapters/runtime/testing.d.ts +79 -0
- package/_internal/core/adapters/runtime/turn-activity.d.ts +23 -0
- package/_internal/core/adapters/shared.d.ts +122 -12
- package/_internal/core/content-dir.d.ts +9 -0
- package/_internal/core/docs/route.d.ts +1 -1
- package/_internal/core/format/structured.d.ts +44 -0
- package/_internal/core/format.d.ts +13 -0
- package/_internal/core/media/downscale.d.ts +18 -0
- package/_internal/core/media/sharp-loader.d.ts +36 -0
- package/_internal/core/plugin-types.d.ts +216 -499
- package/_internal/core/routing/define.d.ts +26 -3
- package/_internal/core/routing/dispatcher.d.ts +15 -6
- package/_internal/core/routing/index.d.ts +1 -1
- package/_internal/core/routing/types.d.ts +13 -70
- package/_internal/core/storage/atomic-write.d.ts +11 -0
- package/_internal/core/tasks/store.d.ts +129 -0
- package/_internal/core/tasks/testing.d.ts +2 -0
- package/_internal/{plugins/workflows/lib → core/workflows}/notification-channel-registry.d.ts +1 -1
- package/_internal/plugins/team/types.d.ts +61 -4
- package/_internal/plugins/workflows/hooks/use-notification-channels.d.ts +1 -1
- package/components/index.d.ts +111 -5
- package/components/index.js +61815 -30060
- package/hooks/index.d.ts +90 -9
- package/hooks/index.js +15181 -685
- package/hooks/router.d.ts +20 -4
- package/index.d.ts +20 -3
- package/index.js +297 -259
- package/internal/index.d.ts +70 -0
- package/internal/index.js +409 -0
- package/metadata/index.d.ts +14 -1
- package/package.json +9 -2
- package/register.d.ts +63 -9
- package/routing/index.d.ts +6 -1
- package/routing/index.js +187 -147
- package/slots/index.d.ts +16 -24
- package/slots/index.js +215 -30
- package/testing/index.d.ts +122 -0
- package/testing/index.js +21874 -0
- package/types/index.d.ts +19 -919
- package/types/index.js +16 -0
- package/ui/index.js +2 -1
- package/utils/index.d.ts +46 -6
- package/utils/index.js +322 -249
- package/_internal/app/components/integrated-brainstorm/activity.d.ts +0 -23
- package/_internal/app/components/integrated-brainstorm/collapsed-header.d.ts +0 -14
- package/_internal/app/components/integrated-brainstorm/empty-state.d.ts +0 -5
- package/_internal/app/components/integrated-brainstorm/index.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/input-row.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/message-list.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/session.d.ts +0 -16
- package/_internal/app/components/integrated-brainstorm/sse.d.ts +0 -8
- package/_internal/app/components/integrated-brainstorm/thinking-indicator.d.ts +0 -19
- package/_internal/app/components/integrated-brainstorm/types.d.ts +0 -63
- package/_internal/app/components/integrated-brainstorm/use-auto-grow.d.ts +0 -6
- package/_internal/app/components/integrated-brainstorm/use-brainstorm-state.d.ts +0 -21
- package/_internal/app/hooks/use-assets.d.ts +0 -25
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function ConversationReplyToast({ agentId, title, preview, to, onNavigate, testId }: {
|
|
2
|
+
agentId: string;
|
|
3
|
+
/** e.g. "replied" / "replied in a project brainstorm" — prefixed with the agent's name. */
|
|
4
|
+
title: string;
|
|
5
|
+
preview?: string;
|
|
6
|
+
/** Internal route to navigate to on click (router push, never a reload). */
|
|
7
|
+
to: string;
|
|
8
|
+
/** Called before navigation (wire the attention hook's `dismiss` here). */
|
|
9
|
+
onNavigate?: () => void;
|
|
10
|
+
/** data-* marker attribute value for tests (e.g. chat sets data-chat-toast). */
|
|
11
|
+
testId?: {
|
|
12
|
+
attr: string;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* conversationThreadId — the adapter-neutral durable thread key for embedded
|
|
3
|
+
* conversation surfaces: `scope:entityId:agentId`, each part URL-encoded,
|
|
4
|
+
* empty parts defaulting to 'default'. (The chat plugin uses its own
|
|
5
|
+
* `chat:<chatId>` scheme; this is for entity-scoped threads like
|
|
6
|
+
* brainstorms and plan reviews.)
|
|
7
|
+
*/
|
|
8
|
+
export declare function conversationThreadId(scope: string, entityId: string, agentId: string): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ConversationToolCall } from './fold';
|
|
2
|
+
export interface ToolCallDrawerProps {
|
|
3
|
+
call: ConversationToolCall | null;
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function ToolCallDrawer({ call, open, onOpenChange }: ToolCallDrawerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* createTurnRecorder — server-side helper turning one streamed turn's
|
|
3
|
+
* RuntimeChatChunks into persisted ConversationMessage rows. ONE
|
|
4
|
+
* implementation of "what survives a turn" shared by the chat plugin's
|
|
5
|
+
* stream bridge and embedded surfaces' plugin routes:
|
|
6
|
+
*
|
|
7
|
+
* - assistant text accumulates and lands as ONE assistant row (in stream
|
|
8
|
+
* position relative to the tool rows around it — earlier text flushes
|
|
9
|
+
* when a tool result arrives so replay preserves interleaving)
|
|
10
|
+
* - only `phase:'result'` tool chunks persist, merged over their call
|
|
11
|
+
* phase (summary/previews), previews clipped at honest byte caps with
|
|
12
|
+
* a `metadata.truncated` marker
|
|
13
|
+
* - error chunks persist as error rows (after any partial text)
|
|
14
|
+
* - status/done chunks never persist
|
|
15
|
+
*/
|
|
16
|
+
import type { ChatChunk as RuntimeChatChunk } from '../../../core/adapters/runtime';
|
|
17
|
+
import type { ConversationMessage } from './fold';
|
|
18
|
+
export declare const SUMMARY_MAX_CHARS = 500;
|
|
19
|
+
export declare const PREVIEW_MAX_CHARS = 2000;
|
|
20
|
+
interface RecorderOptions {
|
|
21
|
+
turnId: string;
|
|
22
|
+
agentId?: string;
|
|
23
|
+
now?: () => string;
|
|
24
|
+
}
|
|
25
|
+
export interface TurnRecorder {
|
|
26
|
+
ingest: (chunk: RuntimeChatChunk) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Rows settled since the last drain (tool results, flushed text) — lets
|
|
29
|
+
* callers persist incrementally so a crash keeps the partial turn.
|
|
30
|
+
* Pending (unflushed) text stays buffered until finish().
|
|
31
|
+
*/
|
|
32
|
+
drain: () => ConversationMessage[];
|
|
33
|
+
/** Flush trailing text and return the remaining undrained rows; call once at turn end. */
|
|
34
|
+
finish: () => ConversationMessage[];
|
|
35
|
+
}
|
|
36
|
+
export declare function createTurnRecorder({ turnId, agentId, now }: RecorderOptions): TurnRecorder;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useConversationAttention — the provider building block behind every
|
|
3
|
+
* conversational surface's `nav-badge-providers` slot component (#703).
|
|
4
|
+
* Mount the consumer's provider outside the router (the host renders the
|
|
5
|
+
* slot on every page) and call this hook with the surface's wiring; it
|
|
6
|
+
* keeps the nav badge (unread count / working dot), the optional `(N)`
|
|
7
|
+
* tab-title prefix, and fires toast + chime + OS notification when a
|
|
8
|
+
* reply lands while the user is elsewhere — rules in ./attention.ts,
|
|
9
|
+
* mechanics generalized from chat's ChatBadgeProvider (which now
|
|
10
|
+
* composes this hook).
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
import { type PluginEventPayload } from '../../hooks/use-plugin-event';
|
|
14
|
+
import { type ConversationDonePayload } from './attention';
|
|
15
|
+
export interface ConversationAttentionTotals {
|
|
16
|
+
unreadTotal: number;
|
|
17
|
+
/** Threads with a server-seeded in-flight turn (kept live by chunk/done events). */
|
|
18
|
+
inflightKeys: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface ConversationAttentionConfig {
|
|
21
|
+
pluginId: string;
|
|
22
|
+
navItemId: string;
|
|
23
|
+
/**
|
|
24
|
+
* The surface's bus event names; `refresh` lists extra total-bumping
|
|
25
|
+
* events — AT MOST TWO (hook-count constraints; extras would be
|
|
26
|
+
* silently dropped, so the type forbids them).
|
|
27
|
+
*/
|
|
28
|
+
events: {
|
|
29
|
+
chunk: string;
|
|
30
|
+
done: string;
|
|
31
|
+
error: string;
|
|
32
|
+
started?: string;
|
|
33
|
+
refresh?: [string] | [string, string];
|
|
34
|
+
};
|
|
35
|
+
keyOf: (payload: PluginEventPayload) => string;
|
|
36
|
+
/** The thread key currently on screen ('' = none) — read at event time. */
|
|
37
|
+
visibleKey: () => string;
|
|
38
|
+
/** Fetch unread + in-flight totals; null keeps the previous totals. */
|
|
39
|
+
refreshTotals: () => Promise<ConversationAttentionTotals | null>;
|
|
40
|
+
/** Attention settings at event time. Default: sound + toasts on. */
|
|
41
|
+
settings?: () => {
|
|
42
|
+
sound: boolean;
|
|
43
|
+
toasts: boolean;
|
|
44
|
+
};
|
|
45
|
+
/** Reply toast content; `dismiss` closes it (call before in-app navigation). */
|
|
46
|
+
renderToast: (payload: ConversationDonePayload, dismiss: () => void) => ReactNode | string;
|
|
47
|
+
/**
|
|
48
|
+
* OS notification for a reply that landed while the user was elsewhere;
|
|
49
|
+
* null skips it. Runs only when the done carries a preview (matching
|
|
50
|
+
* chat: silent settles never notify).
|
|
51
|
+
*/
|
|
52
|
+
osNotification: (payload: ConversationDonePayload) => {
|
|
53
|
+
title: string;
|
|
54
|
+
body: string;
|
|
55
|
+
href: string;
|
|
56
|
+
} | null;
|
|
57
|
+
/** Error toast content when a turn fails off-screen; null skips. */
|
|
58
|
+
errorToast?: (payload: PluginEventPayload) => string | null;
|
|
59
|
+
/** Maintain the `(N)` tab-title prefix (chat does; embedded surfaces may skip). */
|
|
60
|
+
titlePrefix?: boolean;
|
|
61
|
+
/** Injectable chime (tests); defaults to the kit reply chime. */
|
|
62
|
+
chime?: () => void;
|
|
63
|
+
}
|
|
64
|
+
export declare function useConversationAttention(config: ConversationAttentionConfig): void;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ChatChunk as RuntimeChatChunk } from '../../../core/adapters/runtime';
|
|
2
|
+
import type { ConversationMessage } from './fold';
|
|
3
|
+
export interface ConversationThreadLoad<Meta> {
|
|
4
|
+
messages: ConversationMessage[];
|
|
5
|
+
/**
|
|
6
|
+
* Server-seeded in-flight flag: true seeds the streaming indicator on
|
|
7
|
+
* mount so a turn started before this mount shows as live immediately.
|
|
8
|
+
*/
|
|
9
|
+
streaming?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Assistant text the in-flight turn streamed BEFORE this mount (the
|
|
12
|
+
* engine's inflightPreview) — seeds liveChunks so mid-turn rehydration
|
|
13
|
+
* doesn't show a reply missing its beginning.
|
|
14
|
+
*/
|
|
15
|
+
streamingText?: string;
|
|
16
|
+
/** Consumer payload fetched alongside the transcript (e.g. chat summary). */
|
|
17
|
+
meta?: Meta;
|
|
18
|
+
}
|
|
19
|
+
export interface ConversationThreadOptions<Meta = unknown, Attachment = unknown> {
|
|
20
|
+
/** Active thread key; empty string disables loading and sending. */
|
|
21
|
+
threadKey: string;
|
|
22
|
+
/** The consumer's bus event names (e.g. chat.chunk/chat.done/chat.error). */
|
|
23
|
+
events: {
|
|
24
|
+
chunk: string;
|
|
25
|
+
done: string;
|
|
26
|
+
error: string;
|
|
27
|
+
};
|
|
28
|
+
/** Extract the thread key from a bus payload (e.g. p => p.chatId). */
|
|
29
|
+
keyOf: (payload: Record<string, unknown>) => unknown;
|
|
30
|
+
/** Fetch the durable transcript (+ in-flight flag + consumer meta). Null = gone. */
|
|
31
|
+
load: (key: string) => Promise<ConversationThreadLoad<Meta> | null>;
|
|
32
|
+
/** POST the user's message; the turn itself arrives over the bus. */
|
|
33
|
+
post: (key: string, content: string, attachments?: Attachment[]) => Promise<{
|
|
34
|
+
ok: boolean;
|
|
35
|
+
status?: number;
|
|
36
|
+
error?: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** Build the optimistic user row (chat maps attachment paths to URLs here). */
|
|
39
|
+
optimisticRow?: (content: string, attachments?: Attachment[]) => ConversationMessage;
|
|
40
|
+
/** A turn for the ACTIVE thread settled (after the refetch was triggered). */
|
|
41
|
+
onSettled?: (payload: Record<string, unknown>) => void;
|
|
42
|
+
}
|
|
43
|
+
export interface ConversationThread<Meta = unknown, Attachment = unknown> {
|
|
44
|
+
/** Durable transcript rows (+ any optimistic user rows awaiting refetch). */
|
|
45
|
+
messages: ConversationMessage[];
|
|
46
|
+
/** Consumer meta from the last load (e.g. chat summary), null before it. */
|
|
47
|
+
meta: Meta | null;
|
|
48
|
+
/** The in-flight turn's chunks; null when idle. */
|
|
49
|
+
liveChunks: RuntimeChatChunk[] | null;
|
|
50
|
+
streaming: boolean;
|
|
51
|
+
sendError: string | null;
|
|
52
|
+
send: (content: string, attachments?: Attachment[]) => Promise<void>;
|
|
53
|
+
refresh: () => Promise<void>;
|
|
54
|
+
}
|
|
55
|
+
export declare function useConversationThread<Meta = unknown, Attachment = unknown>(options: ConversationThreadOptions<Meta, Attachment>): ConversationThread<Meta, Attachment>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* UserMessage — the user's side of a conversation: right-aligned bubble in
|
|
3
|
+
* contrast-safe tokens, attachment thumbnails, hover timestamp + copy.
|
|
4
|
+
*/
|
|
5
|
+
import type { ConversationTurn } from './fold';
|
|
6
|
+
export interface UserMessageProps {
|
|
7
|
+
turn: Extract<ConversationTurn, {
|
|
8
|
+
kind: 'user';
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export declare function UserMessage({ turn }: UserMessageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface DangerZoneProps {
|
|
3
|
+
/** Section heading (default "Danger zone"). */
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
/** What the action destroys and what the consequences are — spell it out. */
|
|
6
|
+
description: ReactNode;
|
|
7
|
+
/** The destructive button + dialog confirm label (e.g. "Delete this brand"). */
|
|
8
|
+
confirmLabel: string;
|
|
9
|
+
/** The exact value the user must type to arm the confirm button (e.g. the record id). */
|
|
10
|
+
confirmValue: string;
|
|
11
|
+
/** Dialog title (default = confirmLabel + "?"). */
|
|
12
|
+
confirmTitle?: ReactNode;
|
|
13
|
+
/** Dialog body copy (default = description). */
|
|
14
|
+
confirmDescription?: ReactNode;
|
|
15
|
+
/** Action in flight — keeps the dialog open and disables its buttons. */
|
|
16
|
+
busy?: boolean;
|
|
17
|
+
/** Inline error from a failed attempt, shown in the dialog. */
|
|
18
|
+
error?: string | null;
|
|
19
|
+
onConfirm: () => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The big-and-scary destructive section that belongs at the very bottom of a
|
|
24
|
+
* settings surface: red-bordered, consequences spelled out, and a typed
|
|
25
|
+
* confirmation (via ConfirmDialog's `confirmValue` — the ONE confirm engine)
|
|
26
|
+
* so nothing irreversible is one accidental click away.
|
|
27
|
+
*/
|
|
28
|
+
export declare function DangerZone({ title, description, confirmLabel, confirmValue, confirmTitle, confirmDescription, busy, error, onConfirm, className, }: DangerZoneProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
2
|
interface EmptyStateProps {
|
|
3
|
-
icon?:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
icon?: ComponentType<{
|
|
4
|
+
className?: string;
|
|
5
|
+
}>;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
action?: ReactNode;
|
|
7
9
|
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Visual size.
|
|
12
|
+
* - `default` — compact rounded chip + small title (the original SDK look).
|
|
13
|
+
* - `panel` — larger rounded-2xl chip + semibold title for full-tab empty
|
|
14
|
+
* surfaces (folded in from the team plugin's former local variant).
|
|
15
|
+
* - `section` — soft in-card empty for a SectionCard body (folded in from
|
|
16
|
+
* the brands plugin): centered caption in a breathing tinted container,
|
|
17
|
+
* never a muted sentence blended into section copy.
|
|
18
|
+
*/
|
|
19
|
+
variant?: 'default' | 'panel' | 'section';
|
|
8
20
|
}
|
|
9
|
-
export declare function EmptyState({ icon: Icon, title, description, action, className }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function EmptyState({ icon: Icon, title, description, action, className, variant }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
10
22
|
export {};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
interface PluginHeaderProps {
|
|
1
|
+
export interface PluginHeaderProps {
|
|
2
2
|
title: string;
|
|
3
3
|
subtitle?: string;
|
|
4
4
|
count?: number;
|
|
5
|
+
/** Optional path context rendered above the title. Supply a labelled nav when interactive. */
|
|
6
|
+
breadcrumbs?: React.ReactNode;
|
|
5
7
|
actions?: React.ReactNode;
|
|
6
8
|
meta?: React.ReactNode;
|
|
7
9
|
search?: {
|
|
@@ -12,5 +14,4 @@ interface PluginHeaderProps {
|
|
|
12
14
|
debounce?: number;
|
|
13
15
|
};
|
|
14
16
|
}
|
|
15
|
-
export declare function PluginHeader({ title, subtitle, count, actions, meta, search }: PluginHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
17
|
+
export declare function PluginHeader({ title, subtitle, count, breadcrumbs, actions, meta, search, }: PluginHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface SaveBarProps {
|
|
3
|
+
/** Whether there are staged, unsaved changes. The bar renders only while dirty (or briefly flashing "Saved"). */
|
|
4
|
+
dirty: boolean;
|
|
5
|
+
/** Save in flight — disables both actions and spins the save button. */
|
|
6
|
+
saving?: boolean;
|
|
7
|
+
/** Inline error from the last failed save. */
|
|
8
|
+
error?: string | null;
|
|
9
|
+
/** Save button label (default "Save changes"). */
|
|
10
|
+
saveLabel?: string;
|
|
11
|
+
/** Extra content rendered before the actions (e.g. a changed-fields summary). */
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
onSave: () => void;
|
|
15
|
+
onDiscard: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Sticky bottom save/discard bar for pages that stage edits into one draft —
|
|
19
|
+
* the single dirty-state pattern (converges with PluginSettingsRenderer's
|
|
20
|
+
* disabled-until-dirty save; migrating the renderer onto this bar is a tracked
|
|
21
|
+
* follow-up). Renders nothing when clean; after a successful save it flashes
|
|
22
|
+
* "Saved" briefly so success is never silent.
|
|
23
|
+
*
|
|
24
|
+
* Pair with `useUnsavedGuard(dirty)` so a hard navigation can't eat staged edits.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SaveBar({ dirty, saving, error, saveLabel, children, className, onSave, onDiscard, }: SaveBarProps): import("react/jsx-runtime").JSX.Element | null;
|
|
27
|
+
/**
|
|
28
|
+
* Blocks the hard ways out (tab close, reload) while `dirty`. In-app route
|
|
29
|
+
* guards are the router's job — wire those at the page level where the
|
|
30
|
+
* navigation happens.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useUnsavedGuard(dirty: boolean): void;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Search-relevance debug overlay (spec req 2 / D17). Renders the fused
|
|
3
|
+
* score plus ONE badge per leg in `scoreBreakdown` — whatever legs the
|
|
4
|
+
* adapter reports, by their neutral names. No engine-specific key sniffing:
|
|
5
|
+
* the engine returns `full_text` plus the table's declared leg names.
|
|
6
|
+
*
|
|
7
|
+
* Embedding legs report -cosine_distance (higher = better, but negative);
|
|
8
|
+
* they render as cosine similarity (1 + score) so they read as a normal
|
|
9
|
+
* 0..1 relevance. Detection is by sign: negative = distance-based leg.
|
|
10
|
+
*/
|
|
11
|
+
export interface ScoreOverlayInfo {
|
|
12
|
+
/** Fused (RRF/RSF) score. */
|
|
13
|
+
score: number;
|
|
14
|
+
/** Per-leg scores keyed by neutral leg name (from the adapter). */
|
|
15
|
+
indexScores?: Record<string, number>;
|
|
16
|
+
/**
|
|
17
|
+
* Field names whose text contains the query terms (client-side
|
|
18
|
+
* approximation — see `computeMatchedFields`). Empty array = nothing
|
|
19
|
+
* matched textually, i.e. a pure semantic hit.
|
|
20
|
+
*/
|
|
21
|
+
matchedFields?: string[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Which of a hit's fields textually contain any query term (case-
|
|
25
|
+
* insensitive). An honest approximation for debug display — the engine
|
|
26
|
+
* exposes no per-field match info; a hit with NO textual match is a
|
|
27
|
+
* semantic (meaning-based) match and is labeled as such.
|
|
28
|
+
*/
|
|
29
|
+
export declare function computeMatchedFields(query: string, fields: Record<string, unknown>): string[];
|
|
30
|
+
export declare function ScoreOverlay({ info, className }: {
|
|
31
|
+
info: ScoreOverlayInfo;
|
|
32
|
+
className?: string;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SearchPartialMeta {
|
|
2
|
+
partial?: boolean;
|
|
3
|
+
tables?: Array<{
|
|
4
|
+
table: string;
|
|
5
|
+
hits: number;
|
|
6
|
+
took_ms: number;
|
|
7
|
+
budget?: 'degraded' | 'omitted';
|
|
8
|
+
}>;
|
|
9
|
+
}
|
|
10
|
+
export declare function SearchPartialChip({ meta, className }: {
|
|
11
|
+
meta: SearchPartialMeta | null | undefined;
|
|
12
|
+
className?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface SearchUnavailableProps {
|
|
2
|
+
/** Re-run the query that hit the unavailable state. */
|
|
3
|
+
retry?: () => void;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Honest engine-down state (spec D11): search UIs show THIS — never a
|
|
8
|
+
* silent client-side fallback whose quality degrades invisibly. Browse
|
|
9
|
+
* and filter views keep working; only search is down.
|
|
10
|
+
*/
|
|
11
|
+
export declare function SearchUnavailable({ retry, className }: SearchUnavailableProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export interface SectionCardProps {
|
|
3
|
+
title: ReactNode;
|
|
4
|
+
/** Lucide icon component rendered before the title. */
|
|
5
|
+
icon?: ComponentType<{
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** One line answering "why does this matter to me?" — every user-facing section should have one. */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** Right-aligned header action (button, toggle, hint). */
|
|
11
|
+
action?: ReactNode;
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
className?: string;
|
|
14
|
+
contentClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The standard titled settings/detail card: icon + title, a muted one-line
|
|
18
|
+
* description explaining why the section matters, an optional header action,
|
|
19
|
+
* and the section body. Compose this instead of hand-rolling card headers so
|
|
20
|
+
* every surface explains itself the same way.
|
|
21
|
+
*/
|
|
22
|
+
export declare function SectionCard({ title, icon: Icon, description, action, children, className, contentClassName, }: SectionCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export interface SegmentedControlOption<T extends string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ComponentType<{
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
|
+
/** Icon-only segment — the label stays for screen readers + the hover title. */
|
|
9
|
+
hideLabel?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SegmentedControlProps<T extends string> {
|
|
12
|
+
options: ReadonlyArray<SegmentedControlOption<T>>;
|
|
13
|
+
value: T;
|
|
14
|
+
onValueChange: (value: T) => void;
|
|
15
|
+
/** `sm` (default) for toolbars, `md` for page-level view switchers. */
|
|
16
|
+
size?: 'sm' | 'md';
|
|
17
|
+
/** Accessible name for the group — always pass one. */
|
|
18
|
+
ariaLabel: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* THE segmented control / mode toggle (Edit|Preview, Board|Log, 5m|1h|24h...).
|
|
23
|
+
* Five plugins hand-rolled this in two drifted dialects with almost no a11y —
|
|
24
|
+
* this is the one implementation: neutral track, card-colored active segment
|
|
25
|
+
* (selection is never accent — accent is signal only), proper tablist
|
|
26
|
+
* semantics.
|
|
27
|
+
*/
|
|
28
|
+
export declare function SegmentedControl<T extends string>({ options, value, onValueChange, size, ariaLabel, className, }: SegmentedControlProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export interface StatTileProps {
|
|
3
|
+
icon?: ComponentType<{
|
|
4
|
+
className?: string;
|
|
5
|
+
}>;
|
|
6
|
+
/** Uppercase micro-label above the number. */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** The big number (tabular). */
|
|
9
|
+
value: ReactNode;
|
|
10
|
+
/** Small line under the number (unit, denominator, context). */
|
|
11
|
+
sub?: ReactNode;
|
|
12
|
+
/** Optional meter under the number — `tone` follows the status scale. */
|
|
13
|
+
progress?: {
|
|
14
|
+
percent: number;
|
|
15
|
+
tone?: 'success' | 'warning' | 'destructive';
|
|
16
|
+
};
|
|
17
|
+
/** Makes the tile a jump link. */
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* THE metric tile (promoted from the brands overview; ≥7 surfaces hand-rolled
|
|
23
|
+
* the same label + big-number card with drifting styles): icon + uppercase
|
|
24
|
+
* micro-label, `text-2xl tabular-nums` value, optional sublabel and meter.
|
|
25
|
+
*/
|
|
26
|
+
export declare function StatTile({ icon: Icon, label, value, sub, progress, onClick, className }: StatTileProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
export type StatusTone = 'neutral' | 'success' | 'warning' | 'destructive' | 'accent';
|
|
3
|
+
export interface StatusBadgeProps {
|
|
4
|
+
tone?: StatusTone;
|
|
5
|
+
/** `solid` (default) or `outline` (softer fill + toned border). */
|
|
6
|
+
variant?: 'solid' | 'outline';
|
|
7
|
+
icon?: ComponentType<{
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
className?: string;
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* THE status chip: one tone scale for every "what state is this thing in"
|
|
15
|
+
* badge (Draft/Published/Queued/Blocked/...). Ad-hoc Badge classNames drifted
|
|
16
|
+
* into three different Draft chips across one plugin — status chips compose
|
|
17
|
+
* this instead so state reads the same everywhere.
|
|
18
|
+
*/
|
|
19
|
+
export declare function StatusBadge({ tone, variant, icon: Icon, className, children }: StatusBadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TurnOutputView — legacy-shaped renderer for normalized turn chunks,
|
|
3
|
+
* now a thin wrapper over the conversation kit: foldTurnChunks delegates
|
|
4
|
+
* to foldConversation (ONE folding engine) and flattens the turn model
|
|
5
|
+
* back to the flat segments/tools shape existing consumers pin.
|
|
6
|
+
*
|
|
7
|
+
* New surfaces should compose the kit directly (Conversation/AgentTurn/
|
|
8
|
+
* ActivityGroup); this stays for single-turn output embeds (task step
|
|
9
|
+
* viewer, workflow step drawer).
|
|
10
|
+
*/
|
|
11
|
+
import type { ReactNode } from 'react';
|
|
12
|
+
import type { RuntimeChatChunk, RuntimeChatTextFormat } from '@makinbakin/sdk/types';
|
|
13
|
+
export interface TurnTextSegment {
|
|
14
|
+
format: RuntimeChatTextFormat;
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
export interface TurnToolChipState {
|
|
18
|
+
key: string;
|
|
19
|
+
toolName: string;
|
|
20
|
+
summary?: string;
|
|
21
|
+
status: 'running' | 'completed' | 'failed';
|
|
22
|
+
}
|
|
23
|
+
export interface FoldedTurnOutput {
|
|
24
|
+
segments: TurnTextSegment[];
|
|
25
|
+
tools: TurnToolChipState[];
|
|
26
|
+
/** Latest status chunk content (e.g. 'thinking'), if any. */
|
|
27
|
+
status: string | null;
|
|
28
|
+
error: {
|
|
29
|
+
message: string;
|
|
30
|
+
kind?: string;
|
|
31
|
+
} | null;
|
|
32
|
+
done: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Fold a chunk list into the flat renderable shape. Delegates to
|
|
36
|
+
* foldConversation and flattens: text items → segments (consecutive
|
|
37
|
+
* same-format segments re-merged across tool boundaries, preserving the
|
|
38
|
+
* legacy contract), activity calls → chips, latest status label, first
|
|
39
|
+
* error, done flag.
|
|
40
|
+
*/
|
|
41
|
+
export declare function foldTurnChunks(chunks: readonly RuntimeChatChunk[]): FoldedTurnOutput;
|
|
42
|
+
/** One tool-activity chip (kit ToolCallRow under the legacy name/props). */
|
|
43
|
+
export declare function TurnToolChip({ toolName, summary, status }: Omit<TurnToolChipState, 'key'>): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export interface TurnOutputViewProps {
|
|
45
|
+
chunks: readonly RuntimeChatChunk[];
|
|
46
|
+
/**
|
|
47
|
+
* Turn still in flight: renders the latest status ('thinking…') until
|
|
48
|
+
* text arrives, so the user sees life before the first token/tool.
|
|
49
|
+
*/
|
|
50
|
+
live?: boolean;
|
|
51
|
+
/** Optional frame around the merged text block (e.g. chat's avatar bubble). */
|
|
52
|
+
textFrame?: (text: ReactNode) => ReactNode;
|
|
53
|
+
/** Applied to each tool/status/error row (e.g. chat's `pl-8` indent). */
|
|
54
|
+
rowClassName?: string;
|
|
55
|
+
className?: string;
|
|
56
|
+
}
|
|
57
|
+
export declare function TurnOutputView({ chunks, live, textFrame, rowClassName, className }: TurnOutputViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRender } from "@base-ui/react/use-render";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "destructive" | "
|
|
4
|
+
variant?: "destructive" | "default" | "link" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function Badge({ className, variant, render, ...props }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
7
7
|
export { Badge, badgeVariants };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Button as ButtonPrimitive } from "@base-ui/react/button";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "destructive" | "
|
|
4
|
+
variant?: "warning" | "destructive" | "info" | "default" | "link" | "outline" | "secondary" | "ghost" | "accent" | null | undefined;
|
|
5
5
|
size?: "default" | "sm" | "lg" | "icon" | "xs" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, ...props }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
export interface UnderlineTab {
|
|
3
3
|
id: string;
|
|
4
4
|
label: string;
|
|
@@ -10,6 +10,10 @@ interface UnderlineTabsProps {
|
|
|
10
10
|
onValueChange: (id: string) => void;
|
|
11
11
|
className?: string;
|
|
12
12
|
rightSlot?: ReactNode;
|
|
13
|
+
/** Accessible name for the tab list. */
|
|
14
|
+
ariaLabel?: string;
|
|
15
|
+
/** Links each tab to `${idPrefix}-panel-${tab.id}` and enables arrow-key activation. */
|
|
16
|
+
idPrefix?: string;
|
|
13
17
|
}
|
|
14
|
-
export declare function UnderlineTabs({ tabs, value, onValueChange, className, rightSlot }: UnderlineTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function UnderlineTabs({ tabs, value, onValueChange, className, rightSlot, ariaLabel, idPrefix, }: UnderlineTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
15
19
|
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface UnsavedChangesGuardOptions {
|
|
3
|
+
/** True while the surface holds unsaved edits — gates all the interception. */
|
|
4
|
+
hasUnsavedChanges: boolean;
|
|
5
|
+
/** True while a save is in flight — disables the dialog actions. */
|
|
6
|
+
saving: boolean;
|
|
7
|
+
/** Whether the "Save and exit" action is offered (default true; e.g. managed sources can't save in place). */
|
|
8
|
+
canSaveInPlace?: boolean;
|
|
9
|
+
/** Extra disable for "Save and exit" beyond `saving` (e.g. an open node drawer). */
|
|
10
|
+
saveDisabled?: boolean;
|
|
11
|
+
/** Final navigation when there is nothing to confirm / after the user proceeds. */
|
|
12
|
+
onCancel?: () => void;
|
|
13
|
+
/** Persist + clear dirty state. Resolves true to proceed with the exit, false to stay. */
|
|
14
|
+
onSaveAndExit: () => Promise<boolean>;
|
|
15
|
+
/** Drop dirty state without saving. */
|
|
16
|
+
onDiscardAndExit: () => void;
|
|
17
|
+
/** Dialog copy overrides — defaults are surface-neutral. */
|
|
18
|
+
title?: ReactNode;
|
|
19
|
+
description?: ReactNode;
|
|
20
|
+
saveLabel?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generic unsaved-changes navigation guard: beforeunload, the TanStack
|
|
24
|
+
* history blocker, and a capture-phase anchor-click interceptor (TanStack's
|
|
25
|
+
* blocker misses plain `<a href>` navigation). Surfaces an exit-confirmation
|
|
26
|
+
* dialog and a `requestExit()` to drive from an explicit cancel/back button.
|
|
27
|
+
* `reset()` clears the in-flight prompt state — call it when the host re-seeds
|
|
28
|
+
* (its props-change reset effect) so a stale prompt can't linger.
|
|
29
|
+
*/
|
|
30
|
+
export declare function useUnsavedChangesGuard({ hasUnsavedChanges, saving, canSaveInPlace, saveDisabled, onCancel, onSaveAndExit, onDiscardAndExit, title, description, saveLabel, }: UnsavedChangesGuardOptions): {
|
|
31
|
+
requestExit: () => void;
|
|
32
|
+
reset: () => void;
|
|
33
|
+
dialog: ReactNode;
|
|
34
|
+
};
|