@manta-eu/react 0.1.2 → 0.1.4

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.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/dist/components/brand-icons/index.d.ts +6 -0
  3. package/dist/components/brand-icons/index.d.ts.map +1 -0
  4. package/dist/components/brand-icons/index.js +34 -0
  5. package/dist/components/chat/chat-input/index.d.ts.map +1 -1
  6. package/dist/components/chat/chat-input/index.js +7 -0
  7. package/dist/components/chat-view/Chat.d.ts +2 -1
  8. package/dist/components/chat-view/Chat.d.ts.map +1 -1
  9. package/dist/components/chat-view/Chat.js +4 -2
  10. package/dist/components/embedded-chat/index.d.ts +1 -0
  11. package/dist/components/embedded-chat/index.d.ts.map +1 -1
  12. package/dist/components/embedded-chat/index.js +1 -1
  13. package/dist/globals.css +3 -0
  14. package/dist/graph/nodes/AdMockupCard.d.ts.map +1 -1
  15. package/dist/graph/nodes/AdMockupCard.js +2 -1
  16. package/dist/graph/nodes/AttioCompanyView.d.ts.map +1 -1
  17. package/dist/graph/nodes/AttioCompanyView.js +2 -1
  18. package/dist/graph/nodes/LinkedinAdAccountView.d.ts.map +1 -1
  19. package/dist/graph/nodes/LinkedinAdAccountView.js +1 -1
  20. package/dist/graph/nodes/SlackChannelView.d.ts.map +1 -1
  21. package/dist/graph/nodes/SlackChannelView.js +2 -1
  22. package/dist/graph/nodes/SlackMessageView.d.ts.map +1 -1
  23. package/dist/graph/nodes/SlackMessageView.js +1 -1
  24. package/dist/graph/nodes/SlackUserView.d.ts.map +1 -1
  25. package/dist/graph/nodes/SlackUserView.js +2 -1
  26. package/dist/graph/nodes/SlackWorkspaceView.d.ts.map +1 -1
  27. package/dist/graph/nodes/SlackWorkspaceView.js +1 -1
  28. package/dist/hooks/use-composer-draft.d.ts +10 -0
  29. package/dist/hooks/use-composer-draft.d.ts.map +1 -0
  30. package/dist/hooks/use-composer-draft.js +20 -0
  31. package/dist/hooks/useAuth.d.ts +43 -0
  32. package/dist/hooks/useAuth.d.ts.map +1 -1
  33. package/dist/hooks/useAuth.js +46 -10
  34. package/dist/hooks/useValidateActionPlan.d.ts.map +1 -1
  35. package/dist/lib/chat-types.d.ts +5 -0
  36. package/dist/lib/chat-types.d.ts.map +1 -1
  37. package/dist/routes/chat/index.d.ts +2 -1
  38. package/dist/routes/chat/index.d.ts.map +1 -1
  39. package/dist/routes/chat/index.js +2 -2
  40. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts +2 -0
  41. package/dist/routes/datastores/components/DatastoreFormDialog.d.ts.map +1 -1
  42. package/dist/routes/datastores/components/DatastoreFormDialog.js +11 -5
  43. package/dist/routes/datastores/index.d.ts.map +1 -1
  44. package/dist/routes/datastores/index.js +15 -11
  45. package/package.json +15 -15
package/README.md CHANGED
@@ -62,7 +62,6 @@ pnpm manta-codegen generate \
62
62
  --datastore your-datastore \
63
63
  --keycloak-url https://auth.hiremanta.com \
64
64
  --keycloak-realm your-realm \
65
- --client-id your-realm-app \
66
65
  --out ./.ldkit
67
66
  ```
68
67
 
@@ -109,7 +108,8 @@ That is a working copilot. Everything below is optional.
109
108
  | `title` | `string` | Header text |
110
109
  | `assistantName` | `string` | What the assistant calls itself |
111
110
  | `welcomeSubtitle` | `string` | Subtitle on the empty state |
112
- | `initialPrompt` | `string` | Prefills the composer |
111
+ | `initialPrompt` | `string` | Sent as the first message of a new chat |
112
+ | `initialDraft` | `{ id, text }` | Prefills the composer; a new `id` re-seeds it |
113
113
  | `mark` | `ReactNode` | Your logo in the header |
114
114
  | `allowedModels` | `MantaModelId[]` | Restricts the model picker |
115
115
  | `pageContext` | `PageContext` | Tells the assistant what the user is looking at |
@@ -0,0 +1,6 @@
1
+ export declare const Facebook: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
2
+ export declare const Instagram: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
3
+ export declare const Linkedin: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
4
+ export declare const Slack: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
5
+ export declare const Twitter: import("react").ForwardRefExoticComponent<Omit<import("lucide-react").LucideProps, "ref"> & import("react").RefAttributes<SVGSVGElement>>;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/brand-icons/index.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,2IAEnB,CAAC;AAEH,eAAO,MAAM,SAAS,2IAIpB,CAAC;AAEH,eAAO,MAAM,QAAQ,2IAInB,CAAC;AAEH,eAAO,MAAM,KAAK,2IAShB,CAAC;AAEH,eAAO,MAAM,OAAO,2IAQlB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { createLucideIcon } from "lucide-react";
2
+ // lucide-react 1.0 removed its brand icons. These are the lucide-react 0.525.0 paths (ISC license).
3
+ export const Facebook = createLucideIcon("facebook", [
4
+ ["path", { d: "M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z", key: "1jg4f8" }],
5
+ ]);
6
+ export const Instagram = createLucideIcon("instagram", [
7
+ ["rect", { width: "20", height: "20", x: "2", y: "2", rx: "5", ry: "5", key: "2e1cvw" }],
8
+ ["path", { d: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z", key: "9exkf1" }],
9
+ ["line", { x1: "17.5", x2: "17.51", y1: "6.5", y2: "6.5", key: "r4j83e" }],
10
+ ]);
11
+ export const Linkedin = createLucideIcon("linkedin", [
12
+ ["path", { d: "M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z", key: "c2jq9f" }],
13
+ ["rect", { width: "4", height: "12", x: "2", y: "9", key: "mk3on5" }],
14
+ ["circle", { cx: "4", cy: "4", r: "2", key: "bt5ra8" }],
15
+ ]);
16
+ export const Slack = createLucideIcon("slack", [
17
+ ["rect", { width: "3", height: "8", x: "13", y: "2", rx: "1.5", key: "diqz80" }],
18
+ ["path", { d: "M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5", key: "183iwg" }],
19
+ ["rect", { width: "3", height: "8", x: "8", y: "14", rx: "1.5", key: "hqg7r1" }],
20
+ ["path", { d: "M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5", key: "76g71w" }],
21
+ ["rect", { width: "8", height: "3", x: "14", y: "13", rx: "1.5", key: "1kmz0a" }],
22
+ ["path", { d: "M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5", key: "jc4sz0" }],
23
+ ["rect", { width: "8", height: "3", x: "2", y: "8", rx: "1.5", key: "1omvl4" }],
24
+ ["path", { d: "M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5", key: "16f3cl" }],
25
+ ]);
26
+ export const Twitter = createLucideIcon("twitter", [
27
+ [
28
+ "path",
29
+ {
30
+ d: "M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",
31
+ key: "pff0z6",
32
+ },
33
+ ],
34
+ ]);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chat/chat-input/index.tsx"],"names":[],"mappings":"AAMA,OAAO,EAQL,KAAK,WAAW,EAEhB,KAAK,aAAa,EAGlB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AA6Bf,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,IAAI,CAAC;IACX,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setOnRejected(onRejected ?? null);
101
101
  }, [store, onRejected]);
102
+ // Mount only: puts the cursor after a seeded value. Focus stays with the textarea's `autoFocus`.
103
+ useEffect(() => {
104
+ const textarea = store.getState().textareaRef.current;
105
+ if (!textarea?.value)
106
+ return;
107
+ textarea.setSelectionRange(textarea.value.length, textarea.value.length);
108
+ }, [store]);
102
109
  const handleSubmit = useCallback(async (ev) => {
103
110
  ev.preventDefault();
104
111
  if (submittingRef.current)
@@ -1,7 +1,7 @@
1
1
  import { type ChatContext } from "@manta-eu/client/shared/agent-types";
2
2
  import { type MantaModelId } from "@manta-eu/client/shared/model";
3
3
  import type { ReactNode } from "react";
4
- import type { CopilotMenuDefaults, Datastore, PageContext, User } from "#lib/chat-types";
4
+ import type { ChatDraft, CopilotMenuDefaults, Datastore, PageContext, User } from "#lib/chat-types";
5
5
  export type ChatProps = {
6
6
  datastore?: Datastore;
7
7
  user: User;
@@ -13,6 +13,7 @@ export type ChatProps = {
13
13
  pageContext?: PageContext;
14
14
  allowedModels?: MantaModelId[];
15
15
  initialPrompt?: string;
16
+ initialDraft?: ChatDraft;
16
17
  title?: string;
17
18
  welcomeSubtitle?: string;
18
19
  mark?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Chat.d.ts","sourceRoot":"","sources":["../../../src/components/chat-view/Chat.tsx"],"names":[],"mappings":"AACA,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGxF,OAAO,EAOL,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AAMvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AA+BvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAYzF,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,IA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EAAE,MAAM,IAAI,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,SAAS,EAAE,CAAC;CAClE,CAAC;AAuCF,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,2CAKpC;AAmBD,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC"}
@@ -22,6 +22,7 @@ import { StagedRuleCta } from "./StagedRuleCta.js";
22
22
  import { isPendingRequestUserInputPart } from "./tool-part-rendering.js";
23
23
  import { ChatInput, ChatInputAttachButton, ChatInputFilePreview, ChatInputFooter, ChatInputSubmit, ChatInputTextarea, ChatModelPicker, ChatWelcome, } from "#components/chat/index";
24
24
  import { ReviewCta } from "#components/review-cta/index";
25
+ import { useComposerDraft } from "#hooks/use-composer-draft";
25
26
  import { useShouldAutoFocusInput } from "#hooks/use-should-auto-focus-input";
26
27
  import { useConversationGraphContext } from "#hooks/useConversationGraphContext";
27
28
  import { useSelectedModel } from "#hooks/useSelectedModel";
@@ -108,7 +109,7 @@ function getChatWelcomeContent(args) {
108
109
  .exhaustive();
109
110
  }
110
111
  function ChatContent(props) {
111
- const { datastore, user, isCopilot, isEmbedded, isOperator, onCloseAction, pageContext, allowedModels, initialPrompt, title, welcomeSubtitle, mark, renderMenuItems, turnState, } = props;
112
+ const { datastore, user, isCopilot, isEmbedded, isOperator, onCloseAction, pageContext, allowedModels, initialPrompt, initialDraft, title, welcomeSubtitle, mark, renderMenuItems, turnState, } = props;
112
113
  const assistantName = useAssistantName();
113
114
  const { activeTurnKey, pendingAssistantTurn, resetChatTurn, setActiveTurnKey, setPendingAssistantTurn, setThinkingSeconds, thinkingSeconds, turnKeyRef, } = turnState;
114
115
  const modelPickerOptions = isPresent(allowedModels) ? operatorModelOptionsFor(allowedModels) : operatorModelOptions;
@@ -208,6 +209,7 @@ function ChatContent(props) {
208
209
  mantaBaseUrl,
209
210
  datastorePath,
210
211
  ]);
212
+ const composerDraft = useComposerDraft(initialDraft, handleAgentSubmit);
211
213
  const handleConversationStarterSubmit = useCallback((value) => {
212
214
  void handleAgentSubmit(value, []);
213
215
  }, [handleAgentSubmit]);
@@ -289,7 +291,7 @@ function ChatContent(props) {
289
291
  .with({ ruleEditContext: P.nonNullable }, () => "Describe the change you'd like to make to this rule…")
290
292
  .with({ isRuleCreateContext: true }, () => "Describe the rule you'd like to create…")
291
293
  .otherwise(() => `Ask me anything about ${datastoreName ?? "your datastore"}...`);
292
- const chatPanel = (_jsx("div", { ref: dropZoneRef, className: "relative h-full w-full min-w-0", children: _jsx("div", { ref: chatPanelRef, className: "h-full w-full overflow-y-auto overscroll-contain bg-base-background", children: _jsx(Conversation, { scrollRef: chatPanelRef, children: _jsxs("div", { className: "min-h-full flex flex-col", children: [_jsxs("div", { className: "sticky top-0 z-20", children: [connectionNotice, isCopilot && (_jsx(CopilotHeader, { isOperator: isOperator, datastoreId: datastore?.id, onClear: chatData?.clearHistory, onClose: onCloseAction, conversationId: activeConversation?.id, messages: chatData?.messages ?? [], isEmbedded: isEmbedded, renderMenuItems: renderMenuItems, title: title })), !isCopilot && ruleEditContext && (_jsx(RuleEditBanner, { ruleIri: ruleEditContext.ruleIri, ruleName: ruleEditName, onExit: () => startNewChat() }))] }), showGraphContextPanel && (_jsx("div", { className: "sticky top-0 z-10 h-0", children: _jsx(GraphContextPanel, { mergedGraph: graphContext.mergedGraph, graphCount: graphContext.graphCount, nodeCount: graphContext.nodeCount, sparqlQueries: graphContext.sparqlQueries }) })), _jsxs("div", { className: "flex-1 flex flex-col min-h-0", children: [!hasMessages && (_jsx("div", { "data-testid": "chat-welcome", className: "flex-1 flex flex-col items-center justify-center px-6 py-12", children: _jsxs("div", { className: "w-full max-w-4xl space-y-8 text-center", children: [_jsx(ChatWelcome, { channel: "MANTA", title: welcome.title, subtitle: welcome.subtitle, mark: mark }), _jsx(ConversationStarters, { onSubmit: handleConversationStarterSubmit, disabled: isChatInputDisabled })] }) })), hasMessages && (_jsx(MessagesContainer, { messages: displayMessages, toolsUsedInSession: toolsUsedInSession, onAddToolResult: addToolResult || (() => { }), status: status, thinkingSeconds: thinkingSeconds, activeTurnKey: activeTurnKey, compact: isCopilot, animateOnMount: !hasPendingMessage, turnError: turnError, onRetryTurn: () => void handleRetryTurn(), onStartNewChat: startNewChat }))] }), _jsxs("div", { className: cn("sticky bottom-0 z-20 py-2 px-4 space-y-2 w-full bg-base-background", !isCopilot && "max-w-3xl mx-auto", isCopilot && "pb-4"), children: [hasMessages && (_jsx("div", { className: "pointer-events-none absolute -top-10 left-0 right-0 h-10 bg-linear-to-t from-base-background to-transparent" })), _jsx(ConversationScrollButton, { className: "absolute -top-12 left-1/2 -translate-x-1/2 z-30" }), !isEmbedded && latestShowcase && (_jsx(ReviewCta, { title: humanizePlanName(latestShowcase.planName), subtitle: planStatusLabel(latestShowcase.status), className: "plan-badge-border gap-4 px-4 py-2 rounded-full", onClick: () => void handleSelectPlan(latestShowcase.planIri) })), !isEmbedded && isRuleCreateContext && _jsx(StagedRuleCta, { messages: agentMessages }), _jsxs(ChatInput, { dropTargetRef: dropZoneRef, onSubmit: isChatInputDisabled ? undefined : handleAgentSubmit, onRejected: handleFilesRejected, topContent: _jsx(ChatInputFilePreview, { progress: uploadProgress }), children: [!hasPendingQuestionnaire && _jsx(ChatInputAttachButton, {}), _jsx(ChatInputTextarea, { placeholder: composerPlaceholder, className: "pl-5", autoFocus: shouldAutoFocusInput, disabled: hasPendingQuestionnaire, "data-chat-input": true }), _jsx(ChatInputSubmit, { icon: ArrowUp, "aria-label": "Send", isLoading: isUploading, disabled: isChatInputDisabled, stopGeneration: !isResumeProbe && (isChatStreaming || chatStatus === "submitted") ? stop : undefined })] }), !isCopilot && (_jsx(ChatInputFooter, { infoText: "Manta can make mistakes.", version: kg.knowledgeGraphState?.dataVersion?.uniqueId ?? "unknown", circularProgressTooltip: "Context used (tokens)", min: agentState?.contextTokens ?? 0, max: contextWindow, actions: _jsxs(_Fragment, { children: [isOperator && modelPickerOptions.length > 1 && (_jsx(ChatModelPicker, { models: modelPickerOptions, selectedId: selectedModel, onChange: setSelectedModel })), showDebugMessages && _jsx(DebugMessagesButton, { messages: agentMessages })] }) }))] })] }) }) }) }));
294
+ const chatPanel = (_jsx("div", { ref: dropZoneRef, className: "relative h-full w-full min-w-0", children: _jsx("div", { ref: chatPanelRef, className: "h-full w-full overflow-y-auto overscroll-contain bg-base-background", children: _jsx(Conversation, { scrollRef: chatPanelRef, children: _jsxs("div", { className: "min-h-full flex flex-col", children: [_jsxs("div", { className: "sticky top-0 z-20", children: [connectionNotice, isCopilot && (_jsx(CopilotHeader, { isOperator: isOperator, datastoreId: datastore?.id, onClear: chatData?.clearHistory, onClose: onCloseAction, conversationId: activeConversation?.id, messages: chatData?.messages ?? [], isEmbedded: isEmbedded, renderMenuItems: renderMenuItems, title: title })), !isCopilot && ruleEditContext && (_jsx(RuleEditBanner, { ruleIri: ruleEditContext.ruleIri, ruleName: ruleEditName, onExit: () => startNewChat() }))] }), showGraphContextPanel && (_jsx("div", { className: "sticky top-0 z-10 h-0", children: _jsx(GraphContextPanel, { mergedGraph: graphContext.mergedGraph, graphCount: graphContext.graphCount, nodeCount: graphContext.nodeCount, sparqlQueries: graphContext.sparqlQueries }) })), _jsxs("div", { className: "flex-1 flex flex-col min-h-0", children: [!hasMessages && (_jsx("div", { "data-testid": "chat-welcome", className: "flex-1 flex flex-col items-center justify-center px-6 py-12", children: _jsxs("div", { className: "w-full max-w-4xl space-y-8 text-center", children: [_jsx(ChatWelcome, { channel: "MANTA", title: welcome.title, subtitle: welcome.subtitle, mark: mark }), _jsx(ConversationStarters, { onSubmit: handleConversationStarterSubmit, disabled: isChatInputDisabled })] }) })), hasMessages && (_jsx(MessagesContainer, { messages: displayMessages, toolsUsedInSession: toolsUsedInSession, onAddToolResult: addToolResult || (() => { }), status: status, thinkingSeconds: thinkingSeconds, activeTurnKey: activeTurnKey, compact: isCopilot, animateOnMount: !hasPendingMessage, turnError: turnError, onRetryTurn: () => void handleRetryTurn(), onStartNewChat: startNewChat }))] }), _jsxs("div", { className: cn("sticky bottom-0 z-20 py-2 px-4 space-y-2 w-full bg-base-background", !isCopilot && "max-w-3xl mx-auto", isCopilot && "pb-4"), children: [hasMessages && (_jsx("div", { className: "pointer-events-none absolute -top-10 left-0 right-0 h-10 bg-linear-to-t from-base-background to-transparent" })), _jsx(ConversationScrollButton, { className: "absolute -top-12 left-1/2 -translate-x-1/2 z-30" }), !isEmbedded && latestShowcase && (_jsx(ReviewCta, { title: humanizePlanName(latestShowcase.planName), subtitle: planStatusLabel(latestShowcase.status), className: "plan-badge-border gap-4 px-4 py-2 rounded-full", onClick: () => void handleSelectPlan(latestShowcase.planIri) })), !isEmbedded && isRuleCreateContext && _jsx(StagedRuleCta, { messages: agentMessages }), _jsxs(ChatInput, { initialValue: composerDraft.initialValue, dropTargetRef: dropZoneRef, onSubmit: isChatInputDisabled ? undefined : composerDraft.onSubmit, onRejected: handleFilesRejected, topContent: _jsx(ChatInputFilePreview, { progress: uploadProgress }), children: [!hasPendingQuestionnaire && _jsx(ChatInputAttachButton, {}), _jsx(ChatInputTextarea, { placeholder: composerPlaceholder, className: "pl-5", autoFocus: shouldAutoFocusInput, disabled: hasPendingQuestionnaire, "data-chat-input": true }), _jsx(ChatInputSubmit, { icon: ArrowUp, "aria-label": "Send", isLoading: isUploading, disabled: isChatInputDisabled, stopGeneration: !isResumeProbe && (isChatStreaming || chatStatus === "submitted") ? stop : undefined })] }, composerDraft.key), !isCopilot && (_jsx(ChatInputFooter, { infoText: "Manta can make mistakes.", version: kg.knowledgeGraphState?.dataVersion?.uniqueId ?? "unknown", circularProgressTooltip: "Context used (tokens)", min: agentState?.contextTokens ?? 0, max: contextWindow, actions: _jsxs(_Fragment, { children: [isOperator && modelPickerOptions.length > 1 && (_jsx(ChatModelPicker, { models: modelPickerOptions, selectedId: selectedModel, onChange: setSelectedModel })), showDebugMessages && _jsx(DebugMessagesButton, { messages: agentMessages })] }) }))] })] }) }) }) }));
293
295
  if (isConnectingOrSyncing) {
294
296
  return (_jsxs("div", { className: "relative", children: [_jsx(LoadingView, {}), activeChat?.connectionState === "closed" && (_jsx("div", { className: "absolute inset-x-0 top-0 z-20", children: connectionNotice }))] }));
295
297
  }
@@ -1,3 +1,4 @@
1
1
  import { type AuthenticatedChatProps } from "#lib/chat-types";
2
+ export type { ChatDraft } from "#lib/chat-types";
2
3
  export declare function EmbeddedChat(props: AuthenticatedChatProps): import("react/jsx-runtime").JSX.Element;
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/embedded-chat/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAoB,KAAK,sBAAsB,EAA0C,MAAM,iBAAiB,CAAC;AAOxH,wBAAgB,YAAY,CAAC,KAAK,EAAE,sBAAsB,2CAazD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/embedded-chat/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAoB,KAAK,sBAAsB,EAA0C,MAAM,iBAAiB,CAAC;AAOxH,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,wBAAgB,YAAY,CAAC,KAAK,EAAE,sBAAsB,2CAazD"}
@@ -46,5 +46,5 @@ function EmbeddedContent(props) {
46
46
  if (isOperator && !activeDatastore) {
47
47
  return (_jsx(EmbeddedDatastorePicker, { datastores: datastores, canSwitchDatastore: canSwitchDatastore, onDatastoreChosen: setChosenDatastore }));
48
48
  }
49
- return (_jsx(ChatManagerProvider, { datastoreId: activeDatastore?.id, onSelectPlan: onSelectPlan, children: _jsx(KnowledgeGraphStateProvider, { datastoreId: activeDatastore?.id, children: _jsx(KnowledgeGraphStartupGate, { embedded: true, children: _jsx(Chat, { datastore: activeDatastore, user: user, onLogout: onLogout, onCloseAction: onClose, isCopilot: true, isEmbedded: true, isOperator: isOperator, pageContext: props.pageContext, title: props.title, mark: props.mark, initialPrompt: props.initialPrompt, welcomeSubtitle: props.welcomeSubtitle, renderMenuItems: props.renderMenuItems }) }) }) }, activeDatastore?.id));
49
+ return (_jsx(ChatManagerProvider, { datastoreId: activeDatastore?.id, onSelectPlan: onSelectPlan, children: _jsx(KnowledgeGraphStateProvider, { datastoreId: activeDatastore?.id, children: _jsx(KnowledgeGraphStartupGate, { embedded: true, children: _jsx(Chat, { datastore: activeDatastore, user: user, onLogout: onLogout, onCloseAction: onClose, isCopilot: true, isEmbedded: true, isOperator: isOperator, pageContext: props.pageContext, title: props.title, mark: props.mark, initialPrompt: props.initialPrompt, initialDraft: props.initialDraft, welcomeSubtitle: props.welcomeSubtitle, renderMenuItems: props.renderMenuItems }) }) }) }, activeDatastore?.id));
50
50
  }
package/dist/globals.css CHANGED
@@ -1433,6 +1433,9 @@
1433
1433
  .min-h-0 {
1434
1434
  min-height: calc(var(--spacing) * 0);
1435
1435
  }
1436
+ .min-h-5 {
1437
+ min-height: calc(var(--spacing) * 5);
1438
+ }
1436
1439
  .min-h-8 {
1437
1440
  min-height: calc(var(--spacing) * 8);
1438
1441
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AdMockupCard.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/AdMockupCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,8BAA8B,CAAC;AAQxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC;CAC3B,CAAC;AAIF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;AAEtF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAYxD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiFpD"}
1
+ {"version":3,"file":"AdMockupCard.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/AdMockupCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,8BAA8B,CAAC;AASxD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IAC9C,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,MAAM,CAAC,EAAE;QAAE,OAAO,EAAE,GAAG,CAAA;KAAE,CAAC;CAC3B,CAAC;AAIF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;AAEtF,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,2CAYxD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,2CAiFpD"}
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Facebook, Infinity as InfinityIcon, Instagram } from "lucide-react";
2
+ import { Infinity as InfinityIcon } from "lucide-react";
3
3
  import { useState } from "react";
4
4
  import { match } from "ts-pattern";
5
5
  import { OpenInPlatformLink } from "../OpenInPlatformLink.js";
6
6
  import { FacebookAdPreview, InstagramAdPreview } from "#components/ad-preview/index";
7
+ import { Facebook, Instagram } from "#components/brand-icons/index";
7
8
  import { cn } from "#style";
8
9
  export function AdMockupHeader(props) {
9
10
  const { label, iri, schema } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"AttioCompanyView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/AttioCompanyView.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA0BhD,eAAO,MAAM,gBAAgB,uDA2I3B,CAAC"}
1
+ {"version":3,"file":"AttioCompanyView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/AttioCompanyView.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA2BhD,eAAO,MAAM,gBAAgB,uDA2I3B,CAAC"}
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AttioCompanySchema } from "@manta-eu/ldo";
3
3
  import { humanCount, humanNumber } from "@manta-eu/lib/humanize";
4
4
  import { isPresent } from "@manta-eu/lib/present";
5
- import { Building2, Calendar, Coins, Facebook, Handshake, Linkedin, Tags, TrendingUp, Twitter, Users, } from "lucide-react";
5
+ import { Building2, Calendar, Coins, Handshake, Tags, TrendingUp, Users } from "lucide-react";
6
6
  import { Fragment, memo } from "react";
7
7
  import { formatCurrency, formatNumber } from "../property-formatters.js";
8
8
  import { AttioNodeBody, attioPurple } from "./attio-shared.js";
@@ -10,6 +10,7 @@ import { CardRows, row } from "./card-rows.js";
10
10
  import { EntityCardShell } from "./EntityCardShell.js";
11
11
  import { EntityImage } from "./EntityImage.js";
12
12
  import { firstValue, readEntityIri, toIriArray } from "./typed-node-helpers.js";
13
+ import { Facebook, Linkedin, Twitter } from "#components/brand-icons/index";
13
14
  import { useEntity } from "#hooks/use-entity";
14
15
  import { formatGraphDate } from "#lib/format-date";
15
16
  function socialLink(href, label, icon) {
@@ -1 +1 @@
1
- {"version":3,"file":"LinkedinAdAccountView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/LinkedinAdAccountView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,eAAO,MAAM,qBAAqB,uDAEhC,CAAC"}
1
+ {"version":3,"file":"LinkedinAdAccountView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/LinkedinAdAccountView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,eAAO,MAAM,qBAAqB,uDAEhC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Linkedin } from "lucide-react";
3
2
  import { memo } from "react";
4
3
  import { ConnectedAccountCard } from "./ConnectedAccountCard.js";
4
+ import { Linkedin } from "#components/brand-icons/index";
5
5
  export const LinkedinAdAccountView = memo(function LinkedinAdAccountView(props) {
6
6
  return _jsx(ConnectedAccountCard, { icon: Linkedin, noun: "Ad account", accent: "#0A66C2", ...props });
7
7
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SlackChannelView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackChannelView.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,eAAO,MAAM,gBAAgB,uDA0D3B,CAAC"}
1
+ {"version":3,"file":"SlackChannelView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackChannelView.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAUhD,eAAO,MAAM,gBAAgB,uDA0D3B,CAAC"}
@@ -2,13 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SlackChannelSchema } from "@manta-eu/ldo";
3
3
  import { humanCount } from "@manta-eu/lib/humanize";
4
4
  import { isPresent } from "@manta-eu/lib/present";
5
- import { CalendarPlus, Hash, MessageSquareText, Slack, Users } from "lucide-react";
5
+ import { CalendarPlus, Hash, MessageSquareText, Users } from "lucide-react";
6
6
  import { memo } from "react";
7
7
  import { CardRows, row } from "./card-rows.js";
8
8
  import { EntityCardShell } from "./EntityCardShell.js";
9
9
  import { slackAubergine } from "./slack-shared.js";
10
10
  import { ToneBadge } from "./tone-badge.js";
11
11
  import { readEntityIri } from "./typed-node-helpers.js";
12
+ import { Slack } from "#components/brand-icons/index";
12
13
  import { useEntity } from "#hooks/use-entity";
13
14
  import { formatGraphDate, formatRelativeUpdated } from "#lib/format-date";
14
15
  export const SlackChannelView = memo(function SlackChannelView(props) {
@@ -1 +1 @@
1
- {"version":3,"file":"SlackMessageView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackMessageView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,eAAO,MAAM,gBAAgB,uDAiB3B,CAAC"}
1
+ {"version":3,"file":"SlackMessageView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackMessageView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,eAAO,MAAM,gBAAgB,uDAiB3B,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Slack } from "lucide-react";
3
2
  import { memo } from "react";
4
3
  import { EntityCardShell } from "./EntityCardShell.js";
4
+ import { Slack } from "#components/brand-icons/index";
5
5
  export const SlackMessageView = memo(function SlackMessageView(props) {
6
6
  const { selected, ringColor, onContextMenu } = props;
7
7
  return (_jsx(EntityCardShell, { icon: Slack, label: "Slack message", labelMaxWidth: "max-w-80", selected: selected, ringColor: ringColor, onContextMenu: onContextMenu, children: _jsx("div", { className: "w-[260px] bg-muted rounded-[6px] px-[10px] py-[8px]", children: _jsx("span", { className: "typography-tiny text-muted-foreground italic", children: "Sends the report to Slack on execution" }) }) }));
@@ -1 +1 @@
1
- {"version":3,"file":"SlackUserView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackUserView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAQhD,eAAO,MAAM,aAAa,uDA2CxB,CAAC"}
1
+ {"version":3,"file":"SlackUserView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackUserView.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD,eAAO,MAAM,aAAa,uDA2CxB,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SlackUserSchema } from "@manta-eu/ldo";
3
3
  import { isPresent } from "@manta-eu/lib/present";
4
- import { AtSign, Briefcase, Clock, Slack } from "lucide-react";
4
+ import { AtSign, Briefcase, Clock } from "lucide-react";
5
5
  import { memo } from "react";
6
6
  import { CardRows, row } from "./card-rows.js";
7
7
  import { EntityCardShell } from "./EntityCardShell.js";
8
8
  import { slackAubergine } from "./slack-shared.js";
9
9
  import { ToneBadge } from "./tone-badge.js";
10
10
  import { readEntityIri } from "./typed-node-helpers.js";
11
+ import { Slack } from "#components/brand-icons/index";
11
12
  import { useEntity } from "#hooks/use-entity";
12
13
  export const SlackUserView = memo(function SlackUserView(props) {
13
14
  const { data, selected = false, ringColor, onContextMenu } = props;
@@ -1 +1 @@
1
- {"version":3,"file":"SlackWorkspaceView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackWorkspaceView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,eAAO,MAAM,kBAAkB,uDAE7B,CAAC"}
1
+ {"version":3,"file":"SlackWorkspaceView.d.ts","sourceRoot":"","sources":["../../../src/graph/nodes/SlackWorkspaceView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAKhD,eAAO,MAAM,kBAAkB,uDAE7B,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Slack } from "lucide-react";
3
2
  import { memo } from "react";
4
3
  import { ConnectedAccountCard } from "./ConnectedAccountCard.js";
5
4
  import { slackAubergine } from "./slack-shared.js";
5
+ import { Slack } from "#components/brand-icons/index";
6
6
  export const SlackWorkspaceView = memo(function SlackWorkspaceView(props) {
7
7
  return _jsx(ConnectedAccountCard, { icon: Slack, noun: "Workspace", accent: slackAubergine, ...props });
8
8
  });
@@ -0,0 +1,10 @@
1
+ import type { ChatInputProps } from "#components/chat/chat-input/index";
2
+ import type { ChatDraft } from "#lib/chat-types";
3
+ type ComposerSubmit = NonNullable<ChatInputProps["onSubmit"]>;
4
+ export declare function useComposerDraft(initialDraft: ChatDraft | undefined, submit: ComposerSubmit): {
5
+ key: string;
6
+ initialValue: string | undefined;
7
+ onSubmit: (value: string, files: File[]) => void | Promise<void>;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=use-composer-draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-composer-draft.d.ts","sourceRoot":"","sources":["../../src/hooks/use-composer-draft.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,KAAK,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;AAO9D,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,SAAS,GAAG,SAAS,EAAE,MAAM,EAAE,cAAc;;;sBAKhF,MAAM,SAAS,IAAI,EAAE;EAYhC"}
@@ -0,0 +1,20 @@
1
+ import { useCallback, useState } from "react";
2
+ // Module scope, so a remount of the whole chat (startup gate, datastore switch, the host moving
3
+ // its mount) does not bring back a draft the host still passes after it was sent.
4
+ const sentDraftIds = new Set();
5
+ // Props for `ChatInput`: a new draft `id` remounts it with the text, an undefined draft keeps it.
6
+ export function useComposerDraft(initialDraft, submit) {
7
+ const [seeded, setSeeded] = useState(initialDraft);
8
+ if (initialDraft && initialDraft.id !== seeded?.id)
9
+ setSeeded(initialDraft);
10
+ const onSubmit = useCallback((value, files) => {
11
+ if (seeded)
12
+ sentDraftIds.add(seeded.id);
13
+ return submit(value, files);
14
+ }, [seeded, submit]);
15
+ return {
16
+ key: seeded?.id ?? "composer",
17
+ initialValue: seeded && !sentDraftIds.has(seeded.id) ? seeded.text : undefined,
18
+ onSubmit,
19
+ };
20
+ }
@@ -1,5 +1,6 @@
1
1
  import { type MantaModelId } from "@manta-eu/client/shared/model";
2
2
  import type { OrgRoleDefinition } from "@manta-eu/client/shared/org-roles";
3
+ import { z } from "zod";
3
4
  import type { Datastore, User } from "../lib/chat-types.js";
4
5
  export type LoginStatusCheck = {
5
6
  isSessionValid: boolean;
@@ -26,5 +27,47 @@ export type UseAuthResult = {
26
27
  /** Re-checks login status against the server, bypassing cached/stale state. */
27
28
  refetchLoginStatus: () => Promise<LoginStatusCheck>;
28
29
  };
30
+ export declare const contextResponseSchema: z.ZodObject<{
31
+ datastoreAccessGranted: z.ZodDefault<z.ZodBoolean>;
32
+ user: z.ZodObject<{
33
+ id: z.ZodString;
34
+ email: z.ZodString;
35
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
+ isOperator: z.ZodBoolean;
37
+ adminOrgs: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
38
+ memberOrgs: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
39
+ canManageIntegrations: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
40
+ canManageTeam: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
41
+ datastore: z.ZodOptional<z.ZodNullable<z.ZodObject<{
42
+ id: z.ZodString;
43
+ name: z.ZodString;
44
+ depth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
45
+ selectable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
46
+ badge: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
+ }, z.core.$strip>>>;
48
+ }, z.core.$strip>;
49
+ datastores: z.ZodArray<z.ZodObject<{
50
+ id: z.ZodString;
51
+ name: z.ZodString;
52
+ depth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
53
+ selectable: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
54
+ badge: z.ZodOptional<z.ZodNullable<z.ZodString>>;
55
+ }, z.core.$strip>>;
56
+ orgRoles: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ id: z.ZodString;
58
+ groupName: z.ZodString;
59
+ label: z.ZodString;
60
+ capabilities: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<("team:manage" | "org:settings" | "org:integrations")[], string[]>>;
61
+ }, z.core.$strip>>>>;
62
+ }, z.core.$strip>;
63
+ export type ContextResponse = z.infer<typeof contextResponseSchema>;
64
+ export type SessionContextFailure = {
65
+ message?: string;
66
+ extensions?: {
67
+ status?: unknown;
68
+ };
69
+ };
70
+ export declare function parseSessionContext(payload: unknown): ContextResponse;
71
+ export declare function sessionContextFailure(failure: SessionContextFailure | undefined): Error | undefined;
29
72
  export declare function useAuth(): UseAuthResult;
30
73
  //# sourceMappingURL=useAuth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/hooks/useAuth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAQ3E,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,IAAI,GAAG,SAAS,CAAC;IACvB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,UAAU,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,EAAE,OAAO,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kGAAkG;IAClG,cAAc,EAAE,OAAO,CAAC;IACxB,uGAAuG;IACvG,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB,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AAC,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,+EAA+E;IAC/E,kBAAkB,EAAE,MAAM,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACrD,CAAC;AAuBF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAehC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,MAAM,MAAM,qBAAqB,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,CAAC;AAE5F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,eAAe,CAErE;AAED,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,CAKnG;AAqBD,wBAAgB,OAAO,IAAI,aAAa,CA0IvC"}
@@ -1,3 +1,4 @@
1
+ import { SessionContextDocument } from "@manta-eu/client";
1
2
  import { datastoreHeader } from "@manta-eu/client/shared/datastore-path";
2
3
  import { createHttpError, isHttpError } from "@manta-eu/client/shared/error-utils";
3
4
  import { isValidModelId } from "@manta-eu/client/shared/model";
@@ -16,9 +17,9 @@ const loginStatusSchema = z.object({
16
17
  const datastoreSchema = z.object({
17
18
  id: z.string(),
18
19
  name: z.string(),
19
- depth: z.number().optional(),
20
- selectable: z.boolean().optional(),
21
- badge: z.string().optional(),
20
+ depth: z.number().nullish(),
21
+ selectable: z.boolean().nullish(),
22
+ badge: z.string().nullish(),
22
23
  });
23
24
  const orgRoleSchema = z.object({
24
25
  id: z.string(),
@@ -26,7 +27,7 @@ const orgRoleSchema = z.object({
26
27
  label: z.string(),
27
28
  capabilities: z.array(z.string()).transform((values) => values.filter(isCapability)),
28
29
  });
29
- const contextResponseSchema = z.object({
30
+ export const contextResponseSchema = z.object({
30
31
  datastoreAccessGranted: z.boolean().default(true),
31
32
  user: z.object({
32
33
  id: z.string(),
@@ -37,11 +38,22 @@ const contextResponseSchema = z.object({
37
38
  memberOrgs: z.array(z.string()).optional().default([]),
38
39
  canManageIntegrations: z.boolean().optional().default(false),
39
40
  canManageTeam: z.boolean().optional().default(false),
40
- datastore: datastoreSchema.optional(),
41
+ datastore: datastoreSchema.nullish(),
41
42
  }),
42
43
  datastores: z.array(datastoreSchema),
43
44
  orgRoles: z.array(orgRoleSchema).optional().default([]),
44
45
  });
46
+ export function parseSessionContext(payload) {
47
+ return contextResponseSchema.parse(payload);
48
+ }
49
+ export function sessionContextFailure(failure) {
50
+ if (!isPresent(failure?.message))
51
+ return undefined;
52
+ const status = failure.extensions?.status;
53
+ if (status === 401 || status === 403)
54
+ return createHttpError(failure.message, status);
55
+ return new Error(failure.message);
56
+ }
45
57
  // A user with no datastore waits on an operator; the grant rides in the token, so recovery is a re-fetch.
46
58
  const awaitingDatastorePollMs = 15_000;
47
59
  function isAwaitingDatastore(context) {
@@ -49,6 +61,17 @@ function isAwaitingDatastore(context) {
49
61
  return false;
50
62
  return !context.user.isOperator && !isPresent(context.user.datastore);
51
63
  }
64
+ function sessionDatastore(datastore) {
65
+ if (!isPresent(datastore))
66
+ return undefined;
67
+ return {
68
+ id: datastore.id,
69
+ name: datastore.name,
70
+ ...(typeof datastore.depth === "number" ? { depth: datastore.depth } : {}),
71
+ ...(typeof datastore.selectable === "boolean" ? { selectable: datastore.selectable } : {}),
72
+ ...(isPresent(datastore.badge) ? { badge: datastore.badge } : {}),
73
+ };
74
+ }
52
75
  export function useAuth() {
53
76
  const { mantaBaseUrl, datastoreId } = useMantaClient();
54
77
  const queryClient = useQueryClient();
@@ -80,9 +103,15 @@ export function useAuth() {
80
103
  const { data: contextData, isLoading: isContextLoading, error: contextError, } = useQuery({
81
104
  queryKey: ["user-context", datastoreId],
82
105
  queryFn: async ({ signal }) => {
83
- const res = await fetch(new URL("/api/data/context", mantaBaseUrl), {
106
+ const res = await fetch(new URL("/graphql", mantaBaseUrl), {
107
+ method: "POST",
84
108
  credentials: "include",
85
- headers: { ...datastoreHeader(datastoreId), Accept: "application/json" },
109
+ headers: {
110
+ ...datastoreHeader(datastoreId),
111
+ Accept: "application/json",
112
+ "content-type": "application/json",
113
+ },
114
+ body: JSON.stringify({ query: SessionContextDocument }),
86
115
  signal,
87
116
  });
88
117
  if (!res.ok) {
@@ -90,7 +119,11 @@ export function useAuth() {
90
119
  const message = body?.error ?? "user not available";
91
120
  throw createHttpError(message, res.status);
92
121
  }
93
- return contextResponseSchema.parse(await res.json());
122
+ const body = (await res.json());
123
+ const failure = sessionContextFailure(body.errors?.[0]);
124
+ if (isPresent(failure))
125
+ throw failure;
126
+ return parseSessionContext(body.data?.sessionContext);
94
127
  },
95
128
  enabled: contextEnabled,
96
129
  retry: false,
@@ -134,8 +167,11 @@ export function useAuth() {
134
167
  }, [refetchLoginStatusQuery]);
135
168
  return {
136
169
  user,
137
- datastore: contextData?.user?.datastore,
138
- datastores: contextData?.datastores,
170
+ datastore: sessionDatastore(contextData?.user?.datastore),
171
+ datastores: contextData?.datastores.flatMap((row) => {
172
+ const datastore = sessionDatastore(row);
173
+ return isPresent(datastore) ? [datastore] : [];
174
+ }),
139
175
  datastoreAccessGranted: contextData?.datastoreAccessGranted ?? true,
140
176
  isOperator: contextData?.user?.isOperator ?? false,
141
177
  canManageTeam: contextData?.user?.canManageTeam ?? false,
@@ -1 +1 @@
1
- {"version":3,"file":"useValidateActionPlan.d.ts","sourceRoot":"","sources":["../../src/hooks/useValidateActionPlan.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS;;;;;;;;;sBAkB4rlI,CAAC;;sBAAwF,CAAC;iBAAsC,CAAC;uBAA4C,CAAC;;;mBAAuI,CAAC;;;;;EAD9kmI"}
1
+ {"version":3,"file":"useValidateActionPlan.d.ts","sourceRoot":"","sources":["../../src/hooks/useValidateActionPlan.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,SAAS;;;;;;;;;sBAkBywmJ,CAAC;;sBAAwF,CAAC;iBAAsC,CAAC;uBAA4C,CAAC;;;mBAAuI,CAAC;;;;;EAD3pnJ"}
@@ -14,6 +14,10 @@ export type CopilotMenuDefaults = {
14
14
  debugMessages: ReactNode | null;
15
15
  clearChat: ReactNode | null;
16
16
  };
17
+ export type ChatDraft = {
18
+ id: string;
19
+ text: string;
20
+ };
17
21
  export type AuthenticatedChatProps = {
18
22
  datastore?: Datastore;
19
23
  user: User;
@@ -28,6 +32,7 @@ export type AuthenticatedChatProps = {
28
32
  pageContext?: PageContext;
29
33
  allowedModels?: MantaModelId[];
30
34
  initialPrompt?: string;
35
+ initialDraft?: ChatDraft;
31
36
  title?: string;
32
37
  welcomeSubtitle?: string;
33
38
  assistantName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-types.d.ts","sourceRoot":"","sources":["../../src/lib/chat-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,IAAI,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAClC,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AK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,mBAAmB,KAAK,SAAS,EAAE,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,sBAAsB,GAAG;IACvD,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CAEjF;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { MantaModelId } from "@manta-eu/client/shared/model";
2
2
  import type { ReactNode } from "react";
3
- import type { Datastore, User } from "#lib/chat-types";
3
+ import type { ChatDraft, Datastore, User } from "#lib/chat-types";
4
4
  type ChatRouteProps = {
5
5
  datastore?: Datastore;
6
6
  user: User;
@@ -10,6 +10,7 @@ type ChatRouteProps = {
10
10
  datastores?: Datastore[];
11
11
  allowedModels?: MantaModelId[];
12
12
  initialPrompt?: string;
13
+ initialDraft?: ChatDraft;
13
14
  title?: string;
14
15
  welcomeSubtitle?: string;
15
16
  assistantName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/chat/index.tsx"],"names":[],"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C;IACzB,aAAa,CAAC,EAAE,YAAY,EAAE,CAAC;IAC/B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,2CA4C9C"}
@@ -3,6 +3,6 @@ import { Chat } from "#components/chat-view/index";
3
3
  import { RouteLayout } from "#components/layouts/RouteLayout";
4
4
  import { AssistantNameProvider } from "#providers/AssistantNameProvider";
5
5
  export function ChatRoute(props) {
6
- const { datastore, user, logout, isOperator, canSwitchDatastore, datastores, allowedModels, initialPrompt, title, welcomeSubtitle, assistantName, mark, } = props;
7
- return (_jsx(AssistantNameProvider, { name: assistantName, children: _jsx(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, floatingMobileMenu: true, title: title, mark: mark, children: _jsx(Chat, { datastore: datastore, user: user, onLogout: logout, isOperator: isOperator, allowedModels: allowedModels, initialPrompt: initialPrompt, welcomeSubtitle: welcomeSubtitle, mark: mark }) }) }));
6
+ const { datastore, user, logout, isOperator, canSwitchDatastore, datastores, allowedModels, initialPrompt, initialDraft, title, welcomeSubtitle, assistantName, mark, } = props;
7
+ return (_jsx(AssistantNameProvider, { name: assistantName, children: _jsx(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, floatingMobileMenu: true, title: title, mark: mark, children: _jsx(Chat, { datastore: datastore, user: user, onLogout: logout, isOperator: isOperator, allowedModels: allowedModels, initialPrompt: initialPrompt, initialDraft: initialDraft, welcomeSubtitle: welcomeSubtitle, mark: mark }) }) }));
8
8
  }
@@ -12,7 +12,9 @@ type DatastoreFormDialogProps = {
12
12
  name: string;
13
13
  }) => void;
14
14
  onCancel: () => void;
15
+ isSubmitting?: boolean;
15
16
  };
17
+ export declare function provisioningNotice(target: DatastoreFormTarget): string;
16
18
  export declare function DatastoreFormDialog(props: DatastoreFormDialogProps): import("react/jsx-runtime").JSX.Element;
17
19
  export {};
18
20
  //# sourceMappingURL=DatastoreFormDialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DatastoreFormDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/DatastoreFormDialog.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CA2DlE"}
1
+ {"version":3,"file":"DatastoreFormDialog.d.ts","sourceRoot":"","sources":["../../../../src/routes/datastores/components/DatastoreFormDialog.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,GACxB;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEN,KAAK,wBAAwB,GAAG;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CAKtE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAmElE"}
@@ -4,24 +4,30 @@ import { match } from "ts-pattern";
4
4
  import { Button } from "#components/button/index";
5
5
  import { Input } from "#components/input/index";
6
6
  import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "#components/modal/index";
7
+ export function provisioningNotice(target) {
8
+ return match(target)
9
+ .with({ kind: "organization" }, () => "Creating the organization and its first datastore. This can take a minute.")
10
+ .with({ kind: "datastore" }, () => "Creating the datastore. This can take a minute.")
11
+ .exhaustive();
12
+ }
7
13
  export function DatastoreFormDialog(props) {
8
- const { target, onSubmit, onCancel } = props;
14
+ const { target, onSubmit, onCancel, isSubmitting = false } = props;
9
15
  const [name, setName] = useState("");
10
16
  const isOrganization = target.kind === "organization";
11
- const canSubmit = !!name.trim();
17
+ const canSubmit = !!name.trim() && !isSubmitting;
12
18
  function submit() {
13
19
  if (!canSubmit)
14
20
  return;
15
21
  onSubmit({ name: name.trim() });
16
22
  }
17
- return (_jsx(Dialog, { open: true, onOpenChange: (nextOpen) => !nextOpen && onCancel(), children: _jsxs(DialogContent, { className: "flex flex-col overflow-hidden", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { text: isOrganization ? "Add organization" : "Add datastore" }), _jsx(DialogDescription, { children: match(target)
23
+ return (_jsx(Dialog, { open: true, onOpenChange: (nextOpen) => !nextOpen && !isSubmitting && onCancel(), children: _jsxs(DialogContent, { className: "flex flex-col overflow-hidden", showCloseButton: !isSubmitting, children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { text: isOrganization ? "Add organization" : "Add datastore" }), _jsx(DialogDescription, { children: match(target)
18
24
  .with({ kind: "organization" }, () => "Sets up a new top-level organization with its own datastore and a fresh Manta you can build on.")
19
25
  .with({ kind: "datastore", parentPath: "/" }, (datastore) => `Adds a top-level datastore in ${datastore.organizationName}.`)
20
26
  .with({ kind: "datastore" }, (datastore) => `Adds a datastore nested under ${datastore.parentName}, in ${datastore.organizationName}.`)
21
- .exhaustive() })] }), _jsx(Input, { autoFocus: true, label: isOrganization ? "Organization name" : "Datastore name", placeholder: isOrganization ? "e.g. Other Reseller Co" : "e.g. Acme Corp", value: name, onChange: (event) => setName(event.target.value), onKeyDown: (event) => {
27
+ .exhaustive() })] }), _jsx(Input, { autoFocus: true, label: isOrganization ? "Organization name" : "Datastore name", placeholder: isOrganization ? "e.g. Other Reseller Co" : "e.g. Acme Corp", value: name, disabled: isSubmitting, onChange: (event) => setName(event.target.value), onKeyDown: (event) => {
22
28
  if (event.key === "Enter")
23
29
  submit();
24
30
  if (event.key === "Escape")
25
31
  onCancel();
26
- } }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "tertiary", onClick: onCancel, children: "Cancel" }), _jsx(Button, { onClick: submit, disabled: !canSubmit, children: isOrganization ? "Add organization" : "Add datastore" })] })] }) }));
32
+ } }), _jsx("p", { role: "status", "aria-live": "polite", className: "typography-caption text-muted-foreground min-h-5", children: isSubmitting ? provisioningNotice(target) : "" }), _jsxs(DialogFooter, { children: [_jsx(Button, { variant: "tertiary", onClick: onCancel, disabled: isSubmitting, children: "Cancel" }), _jsx(Button, { onClick: submit, disabled: !canSubmit, isLoading: isSubmitting, label: isOrganization ? "Add organization" : "Add datastore" })] })] }) }));
27
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/datastores/index.tsx"],"names":[],"mappings":"AAqFA,wBAAgB,eAAe,4CAypB9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/datastores/index.tsx"],"names":[],"mappings":"AAqFA,wBAAgB,eAAe,4CAsqB9B"}
@@ -70,7 +70,7 @@ export function DatastoresRoute() {
70
70
  const toggleVisibility = useCallback((key) => {
71
71
  setVisibility((current) => ({ ...current, [key]: !current[key] }));
72
72
  }, []);
73
- const { data, isLoading, isFetching, refetch } = useDatastoreTreeQuery(mantaClient, undefined, {
73
+ const { data, isLoading, isFetching } = useDatastoreTreeQuery(mantaClient, undefined, {
74
74
  enabled: !!isOperator,
75
75
  });
76
76
  const { data: unlinkedData, error: unlinkedError, isLoading: isUnlinkedLoading, } = useUnlinkedDatastoresQuery(mantaClient, undefined, {
@@ -82,22 +82,27 @@ export function DatastoresRoute() {
82
82
  function invalidateTree() {
83
83
  void queryClient.invalidateQueries({ queryKey: useDatastoreTreeQuery.getKey() });
84
84
  }
85
+ const refreshDatastores = useCallback(async () => {
86
+ await queryClient.invalidateQueries({ queryKey: useDatastoreTreeQuery.getKey() });
87
+ await Promise.all([
88
+ queryClient.refetchQueries({ queryKey: ["DatastoreProvisioningStatuses"] }),
89
+ queryClient.refetchQueries({ queryKey: useUnlinkedDatastoresQuery.getKey() }),
90
+ ]);
91
+ }, [queryClient]);
85
92
  const handleRefresh = useCallback(() => {
86
- void refetch();
87
- void queryClient.refetchQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
88
- void queryClient.refetchQueries({ queryKey: useUnlinkedDatastoresQuery.getKey() });
89
- }, [refetch, queryClient]);
93
+ void refreshDatastores();
94
+ }, [refreshDatastores]);
90
95
  const provisionMutation = useProvisionDatastoreMutation(mantaClient, {
91
- onSuccess: (result) => {
92
- invalidateTree();
96
+ onSuccess: async (result) => {
93
97
  const { success, name, error, pending } = result.provisionDatastore;
94
98
  if (!success) {
99
+ void refreshDatastores();
95
100
  toast.error("Couldn't create the datastore", { description: error ?? undefined });
96
101
  return;
97
102
  }
98
103
  // The datastore is usually ready by the time this returns, so read its status now rather
99
104
  // than leaving the row stale until the next poll.
100
- void queryClient.refetchQueries({ queryKey: ["DatastoreProvisioningStatuses"] });
105
+ await refreshDatastores();
101
106
  // pending means only that its Dagster run outlived the wait.
102
107
  if (pending) {
103
108
  toast.success(`Datastore "${name}" is being created`, {
@@ -442,13 +447,12 @@ export function DatastoresRoute() {
442
447
  name,
443
448
  atOrganizationRoot: false,
444
449
  };
445
- provisionMutation.mutate({ input });
446
- setFormTarget(null);
450
+ provisionMutation.mutate({ input }, { onSuccess: (result) => result.provisionDatastore.success && setFormTarget(null) });
447
451
  }
448
452
  return (_jsxs(RouteLayout, { user: user, datastore: datastore, datastores: datastores, isOperator: isOperator, canSwitchDatastore: canSwitchDatastore, logout: logout, children: [_jsx(PageHeader, { title: "Datastores", icon: Database, actions: _jsxs(_Fragment, { children: [_jsx(Button, { iconOnly: true, variant: "tertiary", onClick: handleRefresh, disabled: isFetching, icon: RefreshCcw, "aria-label": "Refresh datastores" }), activeTab === "organizations" && (_jsxs(_Fragment, { children: [filterToggles.map((toggle) => (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(Button, { variant: "secondary", "aria-pressed": toggle.active, onClick: toggle.onToggle, icon: toggle.icon, children: toggle.label }) }), _jsx(TooltipContent, { children: toggle.description })] }, toggle.key))), _jsx(Button, { icon: Plus, onClick: () => setFormTarget({ kind: "organization" }), children: "Add organization" })] }))] }) }), _jsxs(Tabs, { value: activeTab, onValueChange: (tab) => setSearchParams({ tab }, { replace: true }), className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [_jsxs(TabsContent, { value: "organizations", className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [_jsx("div", { className: "border-b border-muted-border px-5 py-3 shrink-0", children: _jsx(DatastoresToolbar, { tabs: tabsList, searchQuery: searchQuery, onSearchQueryChange: onSearchQueryChange, statusFilter: statusFilter, onStatusFilterChange: handleStatusFilterChange, table: table }) }), _jsxs("div", { className: "flex-1 overflow-auto p-4", children: [isLoading && _jsx(DatastoreTableSkeleton, {}), !isLoading && !isPresent(rows) && (_jsx(EmptyState, { icon: Database, title: "No organizations yet", description: "Provision an organization to give it its first datastore.", children: _jsx(Button, { icon: Plus, onClick: () => setFormTarget({ kind: "organization" }), children: "Add organization" }) })), !isLoading && isPresent(rows) && (_jsxs("div", { className: "flex flex-col gap-3", children: [_jsx("div", { className: "rounded-xl border border-muted-border bg-card overflow-hidden", children: _jsx(DataTable, { table: table, noResultsMessage: "No datastores match your filters." }) }), _jsx(TablePagination, { table: table, total: rows.length })] }))] })] }), _jsx(TabsContent, { value: "unlinked", className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: _jsx(UnlinkedDatastoresPanel, { tabs: tabsList, table: unlinkedTable, rows: unlinkedRows, searchQuery: unlinkedSearchQuery, onSearchQueryChange: onUnlinkedSearchQueryChange, statusFilter: unlinkedStatusFilter, onStatusFilterChange: onUnlinkedStatusFilterChange, columnLabels: unlinkedColumnLabels, columnDefaultOrder: unlinkedColumnOrder, isLoading: isUnlinkedLoading, errorMessage: unlinkedError != null
449
453
  ? (parseError(unlinkedError, "Couldn't list unlinked datastores").description ??
450
454
  "Couldn't list unlinked datastores")
451
- : null }) })] }), formTarget && (_jsx(DatastoreFormDialog, { target: formTarget, onSubmit: submitForm, onCancel: () => setFormTarget(null) })), linkDialogTarget && (_jsx(LinkUnlinkedDatastoreDialog, { datastoreId: linkDialogTarget, suggestedMatch: suggestedLinkTarget(linkDialogTarget), organizationNames: organizationNameOptions, existingOrganizationNames: existingOrganizationNames, onClose: () => setLinkDialogTarget(null) })), renameTarget && (_jsx(RenameDatastoreGroupDialog, { target: renameTarget, onSubmit: (name) => {
455
+ : null }) })] }), formTarget && (_jsx(DatastoreFormDialog, { target: formTarget, onSubmit: submitForm, onCancel: () => setFormTarget(null), isSubmitting: provisionMutation.isPending })), linkDialogTarget && (_jsx(LinkUnlinkedDatastoreDialog, { datastoreId: linkDialogTarget, suggestedMatch: suggestedLinkTarget(linkDialogTarget), organizationNames: organizationNameOptions, existingOrganizationNames: existingOrganizationNames, onClose: () => setLinkDialogTarget(null) })), renameTarget && (_jsx(RenameDatastoreGroupDialog, { target: renameTarget, onSubmit: (name) => {
452
456
  renameMutation.mutate({
453
457
  input: {
454
458
  id: renameTarget.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manta-eu/react",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "The Manta design system, knowledge-graph UI and agent components",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1046,8 +1046,8 @@
1046
1046
  "@tanstack/react-table": "^8.21.3",
1047
1047
  "@types/json-schema": "^7.0.15",
1048
1048
  "@unpic/react": "^1.0.2",
1049
- "agents": "0.22.0",
1050
- "ai": "7.0.98",
1049
+ "agents": "^0.22.0",
1050
+ "ai": "^7.0.98",
1051
1051
  "change-case": "^5.4.4",
1052
1052
  "clsx": "^2.1.1",
1053
1053
  "cmdk": "^1.1.1",
@@ -1060,9 +1060,9 @@
1060
1060
  "hono": "^4.9.8",
1061
1061
  "input-otp": "^1.4.2",
1062
1062
  "js-cookie": "^3.0.5",
1063
- "ldkit": "2.8.0",
1063
+ "ldkit": "^2.8.0",
1064
1064
  "libphonenumber-js": "^1.11.15",
1065
- "lucide-react": "^0.525.0",
1065
+ "lucide-react": "^1.17.0",
1066
1066
  "mime": "^4.1.0",
1067
1067
  "motion": "^12.23.5",
1068
1068
  "mustache": "^4.2.0",
@@ -1081,15 +1081,15 @@
1081
1081
  "tailwind-merge": "^3.4.0",
1082
1082
  "tailwind-variants": "^3.2.2",
1083
1083
  "tailwindcss-animate": "^1.0.7",
1084
- "ts-pattern": "^5.8.0",
1084
+ "ts-pattern": "^5.9.0",
1085
1085
  "usehooks-ts": "^3.1.1",
1086
1086
  "zod": "^4.5.0",
1087
1087
  "zustand": "^5.0.2",
1088
- "@manta-eu/client": "0.1.2",
1089
- "@manta-eu/ldo": "0.1.2",
1090
- "@manta-eu/lib": "0.1.2",
1091
- "@manta-eu/datalog-parser": "0.1.2",
1092
- "@manta-eu/rdf-lib": "0.1.2"
1088
+ "@manta-eu/client": "0.1.4",
1089
+ "@manta-eu/ldo": "0.1.4",
1090
+ "@manta-eu/lib": "0.1.4",
1091
+ "@manta-eu/rdf-lib": "0.1.4",
1092
+ "@manta-eu/datalog-parser": "0.1.4"
1093
1093
  },
1094
1094
  "peerDependencies": {
1095
1095
  "@ulb-darmstadt/shacl-form": "^2.1.1-rc1",
@@ -1111,7 +1111,7 @@
1111
1111
  "@types/react": "^19.2.7",
1112
1112
  "@types/react-dom": "^19.2.3",
1113
1113
  "ajv": "^8.17.1",
1114
- "eslint": "^9.0.0",
1114
+ "eslint": "^9.39.2",
1115
1115
  "happy-dom": "^15.11.7",
1116
1116
  "jsdom": "^28.1.0",
1117
1117
  "next-themes": "^0.4.6",
@@ -1122,10 +1122,10 @@
1122
1122
  "storybook": "^10.2.1",
1123
1123
  "tailwindcss": "^4.1.17",
1124
1124
  "tsc-alias": "^1.9.5",
1125
- "typescript": "^5.0.0",
1125
+ "typescript": "^5.9.3",
1126
1126
  "uuid": "^13.0.0",
1127
- "vite": "^6.0.0",
1128
- "vitest": "^3.0.0",
1127
+ "vite": "^7.3.1",
1128
+ "vitest": "^4.1.8",
1129
1129
  "@manta-eu/eslint-config": "0.1.0"
1130
1130
  },
1131
1131
  "imports": {