lemma-sdk 0.2.30 → 0.2.31
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 +211 -51
- package/dist/react/index.d.ts +20 -0
- package/dist/react/index.js +10 -0
- package/dist/react/useAgentInputSchema.d.ts +19 -0
- package/dist/react/useAgentInputSchema.js +73 -0
- package/dist/react/useAgentRun.js +18 -20
- package/dist/react/useAgentRuns.d.ts +33 -0
- package/dist/react/useAgentRuns.js +149 -0
- package/dist/react/useAssistantRun.js +10 -9
- package/dist/react/useAssistantSession.js +21 -25
- package/dist/react/useBulkRecords.js +9 -16
- package/dist/react/useConversation.js +24 -8
- package/dist/react/useConversations.d.ts +4 -0
- package/dist/react/useConversations.js +49 -3
- package/dist/react/useCreateRecord.js +9 -16
- package/dist/react/useCurrentUser.d.ts +14 -0
- package/dist/react/useCurrentUser.js +68 -0
- package/dist/react/useDeleteRecord.js +9 -16
- package/dist/react/useFlowRunHistory.js +1 -5
- package/dist/react/useFlowSession.js +41 -33
- package/dist/react/useForeignKeyOptions.js +26 -15
- package/dist/react/useFunctionRun.d.ts +19 -0
- package/dist/react/useFunctionRun.js +30 -0
- package/dist/react/useFunctionRuns.d.ts +33 -0
- package/dist/react/useFunctionRuns.js +149 -0
- package/dist/react/useFunctionSession.js +37 -29
- package/dist/react/useJoinedRecords.js +24 -23
- package/dist/react/useMembers.d.ts +4 -0
- package/dist/react/useMembers.js +55 -16
- package/dist/react/useOrganizationMembers.d.ts +26 -0
- package/dist/react/useOrganizationMembers.js +113 -0
- package/dist/react/usePodAccess.d.ts +22 -0
- package/dist/react/usePodAccess.js +128 -0
- package/dist/react/useRecord.js +24 -13
- package/dist/react/useRecordForm.js +1 -18
- package/dist/react/useRecords.d.ts +2 -0
- package/dist/react/useRecords.js +62 -22
- package/dist/react/useRelatedRecords.js +28 -21
- package/dist/react/useReverseRelatedRecords.js +30 -21
- package/dist/react/useSchemaForm.js +1 -13
- package/dist/react/useTable.js +24 -13
- package/dist/react/useTables.d.ts +4 -0
- package/dist/react/useTables.js +57 -15
- package/dist/react/useTaskSession.js +11 -22
- package/dist/react/useUpdateRecord.js +9 -16
- package/dist/react/useWorkflowResume.d.ts +18 -0
- package/dist/react/useWorkflowResume.js +45 -0
- package/dist/react/useWorkflowRun.d.ts +21 -0
- package/dist/react/useWorkflowRun.js +49 -0
- package/dist/react/useWorkflowRuns.d.ts +33 -0
- package/dist/react/useWorkflowRuns.js +149 -0
- package/dist/react/useWorkflowStart.js +20 -27
- package/dist/react/utils.d.ts +5 -0
- package/dist/react/utils.js +25 -0
- package/dist/types.d.ts +1 -0
- package/package.json +2 -4
- package/dist/react/components/AssistantChrome.d.ts +0 -86
- package/dist/react/components/AssistantChrome.js +0 -48
- package/dist/react/components/AssistantEmbedded.d.ts +0 -10
- package/dist/react/components/AssistantEmbedded.js +0 -15
- package/dist/react/components/AssistantExperience.d.ts +0 -96
- package/dist/react/components/AssistantExperience.js +0 -1294
- package/dist/react/components/assistant-types.d.ts +0 -80
- package/dist/react/components/assistant-types.js +0 -1
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
function cx(...values) {
|
|
4
|
-
return values.filter(Boolean).join(" ");
|
|
5
|
-
}
|
|
6
|
-
export function AssistantThemeScope({ className, children, theme = "auto", ...props }) {
|
|
7
|
-
return (_jsx("div", { "data-lemma-theme": theme, className: cx("lemma-assistant-theme", className), ...props, children: children }));
|
|
8
|
-
}
|
|
9
|
-
export const AssistantMessageViewport = forwardRef(function AssistantMessageViewport({ className, innerClassName, children, ...props }, ref) {
|
|
10
|
-
return (_jsx("div", { ref: ref, className: cx("lemma-assistant-viewport", className), ...props, children: _jsx("div", { className: cx("lemma-assistant-viewport-inner", innerClassName), children: children }) }));
|
|
11
|
-
});
|
|
12
|
-
export function AssistantShellLayout({ sidebar, sidebarVisible = false, main, className, }) {
|
|
13
|
-
const hasSidebar = !!sidebar;
|
|
14
|
-
return (_jsxs("div", { className: cx("lemma-assistant-shell", hasSidebar && "lemma-assistant-shell--with-sidebar", hasSidebar && sidebarVisible && "lemma-assistant-shell--sidebar-visible", className), children: [sidebar && sidebarVisible ? (_jsx("div", { className: "lemma-assistant-shell-sidebar", children: sidebar })) : null, main] }));
|
|
15
|
-
}
|
|
16
|
-
export function AssistantHeader({ title, subtitle, badge, controls, tone = "subtle", className, }) {
|
|
17
|
-
return (_jsxs("div", { "data-tone": tone, className: cx("lemma-assistant-header", className), children: [_jsxs("div", { className: "lemma-assistant-header-copy", children: [badge ? (_jsx("div", { className: "lemma-assistant-header-badge", children: badge })) : null, _jsxs("div", { className: "lemma-assistant-header-titles", children: [_jsx("h3", { className: "lemma-assistant-header-title", children: title }), subtitle ? (_jsx("p", { className: "lemma-assistant-header-subtitle", children: subtitle })) : null] })] }), controls ? (_jsx("div", { className: "lemma-assistant-header-controls", children: controls })) : null] }));
|
|
18
|
-
}
|
|
19
|
-
export function AssistantConversationList({ conversations, activeConversationId, onSelectConversation, onNewConversation, renderConversationLabel, title = "Conversations", newLabel = "New", className, }) {
|
|
20
|
-
return (_jsxs("aside", { className: cx("lemma-assistant-conversation-list", className), children: [_jsx("div", { className: "lemma-assistant-conversation-list-header", children: _jsxs("div", { className: "lemma-assistant-conversation-list-header-row", children: [_jsxs("div", { className: "lemma-assistant-conversation-list-copy", children: [_jsx("div", { className: "lemma-assistant-conversation-list-title", children: title }), _jsxs("div", { className: "lemma-assistant-conversation-list-meta", children: [conversations.length, " total"] })] }), onNewConversation ? (_jsx("button", { type: "button", onClick: onNewConversation, className: "lemma-assistant-conversation-list-new", children: newLabel })) : null] }) }), _jsx("div", { className: "lemma-assistant-conversation-list-items", children: conversations.map((conversation) => {
|
|
21
|
-
const isActive = conversation.id === activeConversationId;
|
|
22
|
-
return (_jsxs("button", { type: "button", onClick: () => onSelectConversation(conversation.id), className: cx("lemma-assistant-conversation-list-item", isActive && "lemma-assistant-conversation-list-item-active"), children: [_jsx("div", { className: "lemma-assistant-conversation-list-item-title", children: renderConversationLabel
|
|
23
|
-
? renderConversationLabel({ conversation, isActive })
|
|
24
|
-
: (conversation.title || "Untitled conversation") }), _jsx("div", { className: "lemma-assistant-conversation-list-item-status", children: (conversation.status || "waiting").toLowerCase() })] }, conversation.id));
|
|
25
|
-
}) })] }));
|
|
26
|
-
}
|
|
27
|
-
export function AssistantModelPicker({ value, options, disabled, autoLabel = "Auto", getOptionLabel, onChange, className, }) {
|
|
28
|
-
const autoValue = "__AUTO__";
|
|
29
|
-
return (_jsxs("select", { value: value ?? autoValue, onChange: (event) => onChange(event.target.value === autoValue ? null : event.target.value), disabled: disabled, className: cx("lemma-assistant-model-picker", className), "aria-label": "Conversation model", title: "Conversation model", children: [_jsx("option", { value: autoValue, children: autoLabel }), options.map((option) => (_jsx("option", { value: option, children: getOptionLabel ? getOptionLabel(option) : option }, option)))] }));
|
|
30
|
-
}
|
|
31
|
-
export function AssistantAskOverlay({ questionNumber, totalQuestions, question, options, selectedOptions, canContinue, continueLabel, onSelectOption, onContinue, onSkip, mode = "single_select", }) {
|
|
32
|
-
return (_jsxs("div", { className: "lemma-assistant-ask-overlay", children: [_jsxs("div", { className: "lemma-assistant-ask-overlay-header", children: [_jsxs("div", { className: "lemma-assistant-ask-overlay-copy", children: [_jsxs("div", { className: "lemma-assistant-ask-overlay-kicker", children: ["Question ", questionNumber, " of ", totalQuestions] }), _jsx("p", { className: "lemma-assistant-ask-overlay-question", children: question })] }), onSkip ? (_jsx("button", { type: "button", onClick: onSkip, className: "lemma-assistant-ask-overlay-skip", children: "Skip" })) : null] }), _jsx("div", { className: "lemma-assistant-ask-overlay-options", children: options.map((option, optionIndex) => {
|
|
33
|
-
const isSelected = selectedOptions.includes(option);
|
|
34
|
-
const rankLabel = mode === "rank_priorities" && isSelected
|
|
35
|
-
? selectedOptions.indexOf(option) + 1
|
|
36
|
-
: null;
|
|
37
|
-
return (_jsx("button", { type: "button", onClick: () => onSelectOption(option), className: cx("lemma-assistant-ask-overlay-option", isSelected && "lemma-assistant-ask-overlay-option-selected"), children: _jsxs("span", { className: "lemma-assistant-ask-overlay-option-label", children: [rankLabel ? (_jsx("span", { className: "lemma-assistant-ask-overlay-option-rank", children: rankLabel })) : (_jsx("span", { className: cx("lemma-assistant-ask-overlay-option-indicator", isSelected && "lemma-assistant-ask-overlay-option-indicator-selected") })), option] }) }, `${option}-${optionIndex}`));
|
|
38
|
-
}) }), onContinue ? (_jsx("div", { className: "lemma-assistant-ask-overlay-actions", children: _jsx("button", { type: "button", onClick: onContinue, disabled: !canContinue, className: cx("lemma-assistant-ask-overlay-continue", canContinue && "lemma-assistant-ask-overlay-continue-enabled"), children: continueLabel }) })) : null] }));
|
|
39
|
-
}
|
|
40
|
-
export function AssistantComposer({ floating, status, pendingFiles, children, tone = "subtle", className, }) {
|
|
41
|
-
return (_jsxs("div", { "data-tone": tone, "data-has-status": status ? "true" : "false", "data-has-pending-files": pendingFiles ? "true" : "false", "data-has-floating": floating ? "true" : "false", className: cx("lemma-assistant-composer", className), children: [floating ? (_jsx("div", { className: "lemma-assistant-composer-floating", children: floating })) : null, status ? (_jsx("div", { className: "lemma-assistant-composer-status-rail", children: _jsx("div", { className: "lemma-assistant-composer-status", children: status }) })) : null, pendingFiles ? (_jsx("div", { className: "lemma-assistant-composer-pending", children: pendingFiles })) : null, _jsx("div", { className: "lemma-assistant-composer-body", children: children })] }));
|
|
42
|
-
}
|
|
43
|
-
export function AssistantPendingFileChip({ label, onRemove, className, }) {
|
|
44
|
-
return (_jsxs("span", { className: cx("lemma-assistant-pending-file-chip", className), children: [_jsx("span", { className: "lemma-assistant-pending-file-chip-label", children: label }), onRemove ? (_jsx("button", { type: "button", onClick: onRemove, className: "lemma-assistant-pending-file-chip-remove", title: "Remove file", children: "\u00D7" })) : null] }));
|
|
45
|
-
}
|
|
46
|
-
export function AssistantStatusPill({ label, subtle = false, className, }) {
|
|
47
|
-
return (_jsxs("div", { className: cx("lemma-assistant-status-pill", subtle && "lemma-assistant-status-pill-subtle", className), children: [_jsxs("span", { className: "lemma-assistant-status-pill-dot", children: [_jsx("span", { className: "lemma-assistant-status-pill-dot-ping" }), _jsx("span", { className: "lemma-assistant-status-pill-dot-core" })] }), _jsx("span", { className: "lemma-assistant-status-pill-label", children: label })] }));
|
|
48
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { LemmaClient } from "../../client.js";
|
|
2
|
-
import { type AssistantConversationScope } from "../useAssistantController.js";
|
|
3
|
-
import { type AssistantThemeMode } from "./AssistantChrome.js";
|
|
4
|
-
import { type AssistantExperienceViewProps } from "./AssistantExperience.js";
|
|
5
|
-
export interface AssistantEmbeddedProps extends Omit<AssistantExperienceViewProps, "controller">, AssistantConversationScope {
|
|
6
|
-
client: LemmaClient;
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
theme?: AssistantThemeMode;
|
|
9
|
-
}
|
|
10
|
-
export declare function AssistantEmbedded({ client, podId, assistantName, assistantId, organizationId, enabled, theme, ...props }: AssistantEmbeddedProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useAssistantController } from "../useAssistantController.js";
|
|
3
|
-
import { AssistantThemeScope } from "./AssistantChrome.js";
|
|
4
|
-
import { AssistantExperienceView } from "./AssistantExperience.js";
|
|
5
|
-
export function AssistantEmbedded({ client, podId, assistantName, assistantId, organizationId, enabled = true, theme = "auto", ...props }) {
|
|
6
|
-
const controller = useAssistantController({
|
|
7
|
-
client,
|
|
8
|
-
podId: podId ?? undefined,
|
|
9
|
-
assistantName: assistantName ?? undefined,
|
|
10
|
-
assistantId: assistantId ?? undefined,
|
|
11
|
-
organizationId: organizationId ?? undefined,
|
|
12
|
-
enabled,
|
|
13
|
-
});
|
|
14
|
-
return (_jsx(AssistantThemeScope, { className: "lemma-assistant-embedded", theme: theme, children: _jsx(AssistantExperienceView, { controller: controller, ...props }) }));
|
|
15
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import type { AssistantRenderableMessage, AssistantToolInvocation } from "../useAssistantController.js";
|
|
3
|
-
import type { AssistantControllerView, AssistantConversationRenderArgs, AssistantMessageRenderArgs, AssistantPendingFileRenderArgs, AssistantPresentedFileRenderArgs, AssistantToolRenderArgs, EmptyStateSuggestion } from "./assistant-types.js";
|
|
4
|
-
type PlanStatus = "pending" | "in_progress" | "completed";
|
|
5
|
-
export interface PlanStepState {
|
|
6
|
-
step: string;
|
|
7
|
-
status: PlanStatus;
|
|
8
|
-
}
|
|
9
|
-
export interface PlanSummaryState {
|
|
10
|
-
steps: PlanStepState[];
|
|
11
|
-
completedCount: number;
|
|
12
|
-
inProgressCount: number;
|
|
13
|
-
running: boolean;
|
|
14
|
-
activeStep?: string;
|
|
15
|
-
}
|
|
16
|
-
type AskQuestionType = "single_select" | "multi_select" | "rank_priorities";
|
|
17
|
-
export interface AskUserInputQuestion {
|
|
18
|
-
question: string;
|
|
19
|
-
options: string[];
|
|
20
|
-
type: AskQuestionType;
|
|
21
|
-
}
|
|
22
|
-
export interface PendingAskUserInput {
|
|
23
|
-
toolCallId: string;
|
|
24
|
-
messageIndex: number;
|
|
25
|
-
questions: AskUserInputQuestion[];
|
|
26
|
-
}
|
|
27
|
-
export interface DisplayMessageRow {
|
|
28
|
-
id: string;
|
|
29
|
-
message: AssistantRenderableMessage;
|
|
30
|
-
sourceIndexes: number[];
|
|
31
|
-
}
|
|
32
|
-
export interface ActiveToolBanner {
|
|
33
|
-
summary: string;
|
|
34
|
-
activeCount: number;
|
|
35
|
-
}
|
|
36
|
-
export type AssistantChromeStyle = "elevated" | "subtle" | "flat";
|
|
37
|
-
export type AssistantStatusPlacement = "inline" | "composer" | "none";
|
|
38
|
-
export type AssistantRadiusScale = "none" | "sm" | "md" | "lg" | "xl";
|
|
39
|
-
export interface AssistantExperienceViewProps {
|
|
40
|
-
controller: AssistantControllerView;
|
|
41
|
-
title?: ReactNode;
|
|
42
|
-
subtitle?: ReactNode;
|
|
43
|
-
badge?: ReactNode | null;
|
|
44
|
-
placeholder?: string;
|
|
45
|
-
emptyState?: ReactNode;
|
|
46
|
-
emptyStateSuggestions?: EmptyStateSuggestion[];
|
|
47
|
-
draft?: string;
|
|
48
|
-
onDraftChange?: (value: string) => void;
|
|
49
|
-
showConversationList?: boolean;
|
|
50
|
-
chromeStyle?: AssistantChromeStyle;
|
|
51
|
-
statusPlacement?: AssistantStatusPlacement;
|
|
52
|
-
radius?: AssistantRadiusScale;
|
|
53
|
-
showModelPicker?: boolean;
|
|
54
|
-
showNewConversationButton?: boolean;
|
|
55
|
-
onNavigateResource?: (resourceType: string, resourceId: string, meta?: Record<string, unknown>) => void;
|
|
56
|
-
renderConversationLabel?: (args: AssistantConversationRenderArgs) => ReactNode;
|
|
57
|
-
renderMessageContent?: (args: AssistantMessageRenderArgs) => ReactNode;
|
|
58
|
-
renderPresentedFile?: (args: AssistantPresentedFileRenderArgs) => ReactNode;
|
|
59
|
-
renderPendingFile?: (args: AssistantPendingFileRenderArgs) => ReactNode;
|
|
60
|
-
renderToolInvocation?: (args: AssistantToolRenderArgs) => ReactNode;
|
|
61
|
-
}
|
|
62
|
-
export declare function dedupToolInvocations(message: AssistantRenderableMessage): AssistantToolInvocation[];
|
|
63
|
-
export declare function latestPlanSummary(messages: AssistantRenderableMessage[]): PlanSummaryState | null;
|
|
64
|
-
export declare function findPendingAskUserInput(messages: AssistantRenderableMessage[]): PendingAskUserInput | null;
|
|
65
|
-
export declare function formatAskUserInputAnswers(questions: AskUserInputQuestion[], answers: string[][]): string;
|
|
66
|
-
export declare function extractPresentFilePathsFromInvocation(invocation: AssistantToolInvocation): string[];
|
|
67
|
-
export declare function buildDisplayMessageRows(messages: AssistantRenderableMessage[]): DisplayMessageRow[];
|
|
68
|
-
export declare function getActiveToolBanner(messages: AssistantRenderableMessage[]): ActiveToolBanner | null;
|
|
69
|
-
export declare function PlanSummaryStrip({ plan, onHide }: {
|
|
70
|
-
plan: PlanSummaryState;
|
|
71
|
-
onHide: () => void;
|
|
72
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
73
|
-
export interface ThinkingIndicatorProps {
|
|
74
|
-
activeToolSummary?: string;
|
|
75
|
-
labels?: string[];
|
|
76
|
-
}
|
|
77
|
-
export declare function ThinkingIndicator({ activeToolSummary, labels, }?: ThinkingIndicatorProps): import("react/jsx-runtime").JSX.Element | null;
|
|
78
|
-
export interface EmptyStateProps {
|
|
79
|
-
onSendMessage: (msg: string) => void;
|
|
80
|
-
suggestions?: EmptyStateSuggestion[];
|
|
81
|
-
}
|
|
82
|
-
export declare const DEFAULT_EMPTY_STATE_SUGGESTIONS: EmptyStateSuggestion[];
|
|
83
|
-
export declare function EmptyState({ onSendMessage, suggestions, }: EmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
84
|
-
export declare function MessageGroup({ message, conversationId, onNavigateResource, onWidgetSendPrompt, isStreaming, showAssistantHeader, renderMessageContent, renderPresentedFile, renderToolInvocation, }: {
|
|
85
|
-
message: AssistantRenderableMessage;
|
|
86
|
-
conversationId?: string | null;
|
|
87
|
-
onNavigateResource?: (resourceType: string, resourceId: string, meta?: Record<string, unknown>) => void;
|
|
88
|
-
onWidgetSendPrompt: (text: string) => void | Promise<void>;
|
|
89
|
-
isStreaming: boolean;
|
|
90
|
-
showAssistantHeader: boolean;
|
|
91
|
-
renderMessageContent: (args: AssistantMessageRenderArgs) => ReactNode;
|
|
92
|
-
renderPresentedFile?: (args: AssistantPresentedFileRenderArgs) => ReactNode;
|
|
93
|
-
renderToolInvocation?: (args: AssistantToolRenderArgs) => ReactNode;
|
|
94
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
95
|
-
export declare function AssistantExperienceView({ controller, title, subtitle, badge, placeholder, emptyState, emptyStateSuggestions, draft: controlledDraft, onDraftChange, showConversationList, chromeStyle, statusPlacement, radius, showModelPicker, showNewConversationButton, onNavigateResource, renderConversationLabel, renderMessageContent, renderPresentedFile, renderPendingFile, renderToolInvocation, }: AssistantExperienceViewProps): import("react/jsx-runtime").JSX.Element;
|
|
96
|
-
export {};
|