@jini-ai/ui 0.6.23 → 0.7.1

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 (78) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +3 -3
  3. package/dist/features/admin-widgets/components/ImagePreviewModal.js +3 -1
  4. package/dist/features/admin-widgets/components/InfoTip.d.ts +2 -2
  5. package/dist/features/admin-widgets/components/InfoTip.js +3 -1
  6. package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +2 -2
  7. package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -1
  8. package/dist/features/admin-widgets/components/Select/Select.d.ts +2 -2
  9. package/dist/features/admin-widgets/components/Select/Select.js +12 -8
  10. package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.d.ts +2 -2
  11. package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.js +3 -1
  12. package/dist/features/execution/react/components/SearchableModelSelect.d.ts +5 -5
  13. package/dist/features/execution/react/components/SearchableModelSelect.js +4 -2
  14. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.d.ts +3 -2
  15. package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +5 -2
  16. package/dist/features/interactive-ui/providers/shadcn/select-field.d.ts +4 -2
  17. package/dist/features/interactive-ui/providers/shadcn/select-field.js +9 -2
  18. package/dist/features/interactive-ui/providers/shadcn/select.d.ts +5 -3
  19. package/dist/features/interactive-ui/providers/shadcn/select.js +9 -4
  20. package/dist/features/mcp-ui/cards.d.ts +12 -0
  21. package/dist/features/mcp-ui/cards.js +8 -0
  22. package/dist/features/mcp-ui/credential-card.d.ts +34 -0
  23. package/dist/features/mcp-ui/credential-card.js +42 -0
  24. package/dist/features/mcp-ui/secret-card.d.ts +2 -16
  25. package/dist/features/mcp-ui/sign-in-card.d.ts +57 -0
  26. package/dist/features/mcp-ui/sign-in-card.js +67 -0
  27. package/dist/features/mcp-ui/surfaces/access-approval.d.ts +15 -0
  28. package/dist/features/mcp-ui/surfaces/access-approval.js +17 -0
  29. package/dist/features/mcp-ui/surfaces/bridge.d.ts +2 -8
  30. package/dist/features/mcp-ui/surfaces/confirmation.d.ts +9 -8
  31. package/dist/features/mcp-ui/surfaces/confirmation.js +23 -8
  32. package/dist/features/mcp-ui/surfaces/document.d.ts +3 -22
  33. package/dist/features/mcp-ui/surfaces/document.js +4 -0
  34. package/dist/features/mcp-ui/surfaces/fields.d.ts +2 -74
  35. package/dist/features/mcp-ui/surfaces/form.d.ts +2 -42
  36. package/dist/features/mcp-ui/surfaces/index.d.ts +1 -0
  37. package/dist/features/mcp-ui/surfaces/index.js +1 -0
  38. package/dist/features/mcp-ui/surfaces/outcome.d.ts +2 -39
  39. package/dist/features/mcp-ui/surfaces/outcome.js +25 -2
  40. package/dist/features/mcp-ui/surfaces/select.d.ts +2 -7
  41. package/dist/features/mcp-ui/surfaces/structured-details.d.ts +2 -19
  42. package/dist/features/mcp-ui/surfaces/text-input.d.ts +2 -5
  43. package/dist/features/mcp-ui/surfaces/tokens.d.ts +2 -2
  44. package/dist/features/panel-kit/failure-channel.d.ts +25 -0
  45. package/dist/features/panel-kit/failure-channel.js +36 -0
  46. package/dist/features/panel-kit/index.d.ts +2 -0
  47. package/dist/features/panel-kit/index.js +1 -0
  48. package/dist/features/site-card/SiteCard.d.ts +40 -0
  49. package/dist/features/site-card/SiteCard.js +15 -0
  50. package/dist/features/site-card/SiteListToolbar.d.ts +28 -0
  51. package/dist/features/site-card/SiteListToolbar.js +15 -0
  52. package/dist/features/site-card/index.d.ts +5 -0
  53. package/dist/features/site-card/index.js +5 -0
  54. package/dist/features/site-card/site-card.css +136 -0
  55. package/dist/features/site-card/site-list-view.d.ts +53 -0
  56. package/dist/features/site-card/site-list-view.js +62 -0
  57. package/dist/features/site-card/use-site-list-view.hooks.d.ts +24 -0
  58. package/dist/features/site-card/use-site-list-view.hooks.js +26 -0
  59. package/dist/features/tab-strip/react/components/TabStrip.d.ts +3 -2
  60. package/dist/features/tab-strip/react/components/TabStrip.js +5 -2
  61. package/dist/features/tab-strip/react/components/TabStripItem.d.ts +3 -2
  62. package/dist/features/tab-strip/react/components/TabStripItem.js +5 -2
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.js +3 -0
  65. package/dist/react/components/CustomSelect.d.ts +5 -3
  66. package/dist/react/components/CustomSelect.js +18 -11
  67. package/dist/react/components/PillButton.d.ts +3 -2
  68. package/dist/react/components/PillButton.js +5 -2
  69. package/dist/react/components/PopoverItem.d.ts +3 -2
  70. package/dist/react/components/PopoverItem.js +5 -2
  71. package/dist/react/components/PopoverMenu.d.ts +3 -2
  72. package/dist/react/components/PopoverMenu.js +5 -2
  73. package/dist/react/components/select-popover.d.ts +8 -2
  74. package/dist/react/components/select-popover.js +8 -3
  75. package/dist/react/hooks/useAgentHandle.d.ts +17 -0
  76. package/dist/react/hooks/useAgentHandle.js +17 -0
  77. package/dist/styles/admin.css +1 -0
  78. package/package.json +38 -12
package/CHANGELOG.md CHANGED
@@ -1,3 +1,36 @@
1
+ ## 0.7.1
2
+
3
+ ### Patch Changes
4
+
5
+ - Updated dependencies [873f10c]
6
+ - @jini-ai/core@0.7.1
7
+ - @jini-ai/agentic@0.7.1
8
+ - @jini-ai/platform@0.7.1
9
+ - @jini-ai/ui-kit@0.7.1
10
+
11
+ ## 0.7.0
12
+
13
+ ### Minor Changes
14
+
15
+ - 1cf0306: Expose host-wired credential card builders, credential-save routing and card metadata operations, and provider-status tools. Hosts supply app identity, reviewed tool metadata, permission names, validation errors and public-field policy.
16
+
17
+ ### Patch Changes
18
+
19
+ - 39cf677: New entry `@jini-ai/ui/mcp-ui/cards` exports `mcpUiCards`, the five card builders as one object checked with `satisfies SurfaceCardsPort<UIResource>`.
20
+ - 699b478: Expose six type-only contract areas in core and retain existing type exports. Reconcile card contracts with the complete UI presentation shapes so hosts can wire package objects without cross-package type imports.
21
+ - Updated dependencies [8fe045b]
22
+ - Updated dependencies [c393010]
23
+ - Updated dependencies [41ff2ff]
24
+ - Updated dependencies [a266ba8]
25
+ - Updated dependencies [27063ef]
26
+ - Updated dependencies [6ab1d81]
27
+ - Updated dependencies [699b478]
28
+ - Updated dependencies [39cf677]
29
+ - @jini-ai/core@0.7.0
30
+ - @jini-ai/platform@0.7.0
31
+ - @jini-ai/agentic@0.7.0
32
+ - @jini-ai/ui-kit@0.7.0
33
+
1
34
  ## 0.6.23
2
35
 
3
36
  - Security hardening.
@@ -6,12 +6,12 @@ export interface ImagePreviewModalProps {
6
6
  onClose: () => void;
7
7
  /** A fake controller can exercise rendering without a real native-dialog lifecycle. */
8
8
  useModal?: typeof useLightbox | undefined;
9
- /** Optional tagging preserves existing untagged renders when no agent handle is supplied. */
10
- agentHandle?: string | undefined;
9
+ /** Explicit names override automatic addressing; false excludes the close control. */
10
+ agentHandle?: string | false | undefined;
11
11
  /** No locale is owned here; a translated caller must pass its own accessible close label. */
12
12
  closeLabel?: string | undefined;
13
13
  }
14
14
  /** One image in the shared `Lightbox`; the alt text doubles as its title. Kept as a named
15
15
  * single-image entry point so callers need not assemble the lightbox for the common case. */
16
- export declare function ImagePreviewModal({ open, src, alt, onClose, useModal, agentHandle: handle, closeLabel, }: ImagePreviewModalProps): import("react").JSX.Element;
16
+ export declare function ImagePreviewModal({ open, src, alt, onClose, useModal, agentHandle: suppliedHandle, closeLabel, }: ImagePreviewModalProps): import("react").JSX.Element;
17
17
  //# sourceMappingURL=ImagePreviewModal.d.ts.map
@@ -1,9 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useAgentHandle } from '../../../react/hooks/useAgentHandle.js';
2
3
  import { agentHandle } from "@jini-ai/agentic";
3
4
  import { Lightbox } from "./Lightbox/Lightbox.js";
4
5
  /** One image in the shared `Lightbox`; the alt text doubles as its title. Kept as a named
5
6
  * single-image entry point so callers need not assemble the lightbox for the common case. */
6
- export function ImagePreviewModal({ open, src, alt, onClose, useModal, agentHandle: handle, closeLabel = "Close preview", }) {
7
+ export function ImagePreviewModal({ open, src, alt, onClose, useModal, agentHandle: suppliedHandle, closeLabel = "Close preview", }) {
8
+ const handle = useAgentHandle({ agentHandle: suppliedHandle });
7
9
  return (_jsx(Lightbox, { open: open, title: alt, onClose: onClose, className: "image-preview-modal", labels: { close: closeLabel }, useLightboxHook: useModal, partAttrs: handle ? { close: { ...agentHandle({ handle: handle }, { role: "button", label: closeLabel }) } } : undefined, children: _jsx("img", { src: src, alt: alt }) }));
8
10
  }
9
11
  //# sourceMappingURL=ImagePreviewModal.js.map
@@ -31,11 +31,11 @@ export interface InfoTipProps {
31
31
  /** Preferred side, or inline help that reserves space instead of covering nearby controls. */
32
32
  placement?: "top" | "bottom" | "inline" | undefined;
33
33
  useTip?: typeof useInfoTip | undefined;
34
- agentHandle?: string | undefined;
34
+ agentHandle?: string | false | undefined;
35
35
  /** What the trigger shows instead of the default ⓘ, e.g. a status icon whose meaning the bubble
36
36
  * explains. Decorative: the trigger is still named by `triggerLabel`/`label`. */
37
37
  icon?: ReactNode | undefined;
38
38
  }
39
39
  /** Focus/hover tooltip that portals outside clipping ancestors; Escape dismisses in place. */
40
- export declare function InfoTip({ label, triggerLabel, descriptionId, placement: preferredPlacement, useTip, agentHandle: handle, icon }: InfoTipProps): import("react").JSX.Element;
40
+ export declare function InfoTip({ label, triggerLabel, descriptionId, placement: preferredPlacement, useTip, agentHandle: suppliedHandle, icon }: InfoTipProps): import("react").JSX.Element;
41
41
  //# sourceMappingURL=InfoTip.d.ts.map
@@ -1,11 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAgentHandle } from '../../../react/hooks/useAgentHandle.js';
2
3
  import { useId } from "react";
3
4
  import { createPortal } from "react-dom";
4
5
  import { agentHandle } from "@jini-ai/agentic";
5
6
  import { useInfoTip } from "./InfoTip.hooks.js";
6
7
  import { infoTipBubbleStyle, infoTipLines } from "./InfoTip.rules.js";
7
8
  /** Focus/hover tooltip that portals outside clipping ancestors; Escape dismisses in place. */
8
- export function InfoTip({ label, triggerLabel, descriptionId, placement: preferredPlacement, useTip = useInfoTip, agentHandle: handle, icon }) {
9
+ export function InfoTip({ label, triggerLabel, descriptionId, placement: preferredPlacement, useTip = useInfoTip, agentHandle: suppliedHandle, icon }) {
10
+ const handle = useAgentHandle({ agentHandle: suppliedHandle });
9
11
  const inline = preferredPlacement === "inline";
10
12
  const { open, placement, coords, iconRef, bubbleRef, show, hide, leave, toggle, pointerDown, handleIconKeyDown } = useTip({}, { placement: inline ? undefined : preferredPlacement });
11
13
  const autoId = useId();
@@ -19,7 +19,7 @@ export interface SeeMoreProps {
19
19
  /** Supply a fake measurement hook when rendering without real scrollHeight/clientHeight layout. */
20
20
  useClamp?: typeof useSeeMoreClamp | undefined;
21
21
  /** The handle identifies a rendered toggle only; fitting content has no control to address. */
22
- agentHandle?: string | undefined;
22
+ agentHandle?: string | false | undefined;
23
23
  }
24
24
  export interface SeeMoreView {
25
25
  wrapperClassName: string;
@@ -37,5 +37,5 @@ export declare function resolveSeeMoreView({ expanded, }: {
37
37
  toggleClassName?: string | undefined;
38
38
  }): SeeMoreView;
39
39
  /** Clamps overflowing text and exposes an accessible expand/collapse toggle. Labels are host-owned. */
40
- export declare function SeeMore({ useClamp, agentHandle: handle, ...props }: SeeMoreProps): import("react").JSX.Element;
40
+ export declare function SeeMore({ useClamp, agentHandle: suppliedHandle, ...props }: SeeMoreProps): import("react").JSX.Element;
41
41
  //# sourceMappingURL=SeeMore.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
2
3
  import { agentHandle } from "@jini-ai/agentic";
3
4
  import { useSeeMoreClamp } from "./SeeMore.hooks.js";
4
5
  import { withClassName } from "../../../../utils/class-names.js";
@@ -13,7 +14,8 @@ export function resolveSeeMoreView({ expanded, }, { moreLabel = "See more", less
13
14
  };
14
15
  }
15
16
  /** Clamps overflowing text and exposes an accessible expand/collapse toggle. Labels are host-owned. */
16
- export function SeeMore({ useClamp = useSeeMoreClamp, agentHandle: handle, ...props }) {
17
+ export function SeeMore({ useClamp = useSeeMoreClamp, agentHandle: suppliedHandle, ...props }) {
18
+ const handle = useAgentHandle({ agentHandle: suppliedHandle });
17
19
  const { children, lines = DEFAULT_LINES, moreLabel, lessLabel, className, textClassName, toggleClassName, toggleAriaLabel } = props;
18
20
  const { expanded, setExpanded, overflows, textRef, regionId, lineCount } = useClamp({ lines, children });
19
21
  const view = resolveSeeMoreView({ expanded }, { moreLabel, lessLabel, className, textClassName, toggleClassName });
@@ -21,8 +21,8 @@ export interface SelectProps {
21
21
  disabled?: boolean | undefined;
22
22
  /** Injectable state/effect seam; rendering tests need not drive portal positioning or listeners. */
23
23
  useDropdown?: typeof useSelectDropdown | undefined;
24
- agentHandle?: string | undefined;
25
- /** Host-owned portal destination. Defaults to the trigger's nearest dialog, then document.body.
24
+ agentHandle?: string | false | undefined;
25
+ /** Host-owned portal destination. Defaults to the nearest dialog, kit overlay, then document.body.
26
26
  * Within a modal dialog, supply a descendant of that dialog so the panel remains interactive.
27
27
  * Keep this container outside scrolling/clipping regions and free of transforms that establish
28
28
  * a fixed-position containing block; panel coordinates are viewport-relative.
@@ -1,16 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { resolveSelectPortalContainer } from '../../../../react/components/select-popover.js';
2
+ import { useOverlayContainer } from '@jini-ai/ui-kit/react';
3
+ import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
4
+ import { resolveSelectPortalContainer, resolveSelectOriginPage } from '../../../../react/components/select-popover.js';
3
5
  import { createPortal } from "react-dom";
4
6
  import { agentHandle } from "@jini-ai/agentic";
5
- import { buildAgentListHandles } from "@jini-ai/agentic";
7
+ import { agentHandleSegment } from "@jini-ai/agentic";
6
8
  import { Fragment } from "react";
7
9
  import { useSelectDropdown, groupHeadingAt } from "./Select.hooks.js";
8
10
  function SelectOptionRow({ option, index, isSelected, isHighlighted, optionId, setOptionRef, onHighlight, onSelect, agentHandle: optionHandle, }) {
9
11
  return (_jsxs("li", { ref: (el) => setOptionRef(index, el), id: optionId, role: "option", "aria-selected": isSelected, className: `select-option${isSelected ? " is-selected" : ""}${isHighlighted ? " is-highlighted" : ""}`, onMouseEnter: () => onHighlight(index), onClick: () => onSelect(option), ...(optionHandle ? agentHandle({ handle: optionHandle }, { role: "button", label: option.label }) : {}), children: [_jsx("span", { className: "select-option-label", children: option.label }), option.detail ? _jsx("span", { className: "select-option-detail", children: option.detail }) : null, option.badge ? _jsx("span", { className: "select-option-badge", children: option.badge }) : null, isSelected ? (_jsx("svg", { className: "select-option-check", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M3.5 8.5 6.5 11.5 12.5 4.5", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) })) : null] }));
10
12
  }
11
- function SelectPanel({ panelRef, position, showSearch, searchInputRef, query, setQuery, filtered, value, highlightedIndex, listboxId, optionId, setOptionRef, onHighlight, onSelect, onKeyDown, searchHandle, optionHandles, t, }) {
13
+ function SelectPanel({ panelRef, page, position, showSearch, searchInputRef, query, setQuery, filtered, value, highlightedIndex, listboxId, optionId, setOptionRef, onHighlight, onSelect, onKeyDown, searchHandle, optionHandles, t, }) {
12
14
  const searchHandleProps = searchHandle ? agentHandle({ handle: searchHandle }, { role: "field", label: "Search the option list" }) : {};
13
- return (_jsxs("div", { ref: panelRef, className: "select-panel", style: { left: position.left, width: position.width, top: position.top, bottom: position.bottom, maxHeight: position.maxHeight }, tabIndex: -1, onKeyDown: onKeyDown, children: [showSearch ? (_jsx("input", { ref: searchInputRef, type: "text", className: "select-search", "aria-label": t("Search options"), placeholder: t("Search…"), value: query, onChange: (e) => setQuery(e.target.value), ...searchHandleProps })) : null, _jsx("ul", { className: "select-list", role: "listbox", id: listboxId, children: filtered.length === 0 ? (_jsx("li", { className: "select-empty", role: "presentation", children: t("No matches") })) : (filtered.map((option, index) => (_jsxs(Fragment, { children: [groupHeadingAt({ options: filtered, index }) ? (_jsx("li", { className: "select-group-label", role: "presentation", children: option.group })) : null, _jsx(SelectOptionRow, { option: option, index: index, isSelected: option.value === value, isHighlighted: index === highlightedIndex, optionId: optionId(index), setOptionRef: setOptionRef, onHighlight: onHighlight, onSelect: onSelect, agentHandle: optionHandles?.[index] })] }, option.value)))) })] }));
15
+ return (_jsxs("div", { ref: panelRef, "data-agent-page": page, className: "select-panel", style: { left: position.left, width: position.width, top: position.top, bottom: position.bottom, maxHeight: position.maxHeight }, tabIndex: -1, onKeyDown: onKeyDown, children: [showSearch ? (_jsx("input", { ref: searchInputRef, type: "text", className: "select-search", "aria-label": t("Search options"), placeholder: t("Search…"), value: query, onChange: (e) => setQuery(e.target.value), ...searchHandleProps })) : null, _jsx("ul", { className: "select-list", role: "listbox", id: listboxId, children: filtered.length === 0 ? (_jsx("li", { className: "select-empty", role: "presentation", children: t("No matches") })) : (filtered.map((option, index) => (_jsxs(Fragment, { children: [groupHeadingAt({ options: filtered, index }) ? (_jsx("li", { className: "select-group-label", role: "presentation", children: option.group })) : null, _jsx(SelectOptionRow, { option: option, index: index, isSelected: option.value === value, isHighlighted: index === highlightedIndex, optionId: optionId(index), setOptionRef: setOptionRef, onHighlight: onHighlight, onSelect: onSelect, agentHandle: optionHandles?.[index] })] }, option.value)))) })] }));
14
16
  }
15
17
  export function resolveSelectTriggerLabel({ selectedOption, placeholder }, { t = (key) => key } = {}) {
16
18
  if (selectedOption)
@@ -25,7 +27,9 @@ function resolveSelectTriggerHandleProps(base, ariaLabel, placeholder) {
25
27
  }
26
28
  /** Controlled searchable listbox with viewport positioning, dialog-local portals and keyboard navigation. */
27
29
  export function Select(props, _optional = {}) {
28
- const { value, onChange, options, placeholder, id, disabled, useDropdown = useSelectDropdown, agentHandle: base, translate, t = translate ?? ((key) => key) } = props;
30
+ const { value, onChange, options, placeholder, id, disabled, useDropdown = useSelectDropdown, agentHandle: suppliedBase, translate, t = translate ?? ((key) => key) } = props;
31
+ const base = useAgentHandle({ agentHandle: suppliedBase });
32
+ const overlayContainer = useOverlayContainer({});
29
33
  const ariaLabel = props["aria-label"];
30
34
  const ariaLabelledBy = props["aria-labelledby"];
31
35
  const { open, highlightedIndex, setHighlightedIndex, position, triggerRef, panelRef, searchInputRef, optionRefs, listboxId, showSearch, filtered, selectedOption, openPanel, closePanel, selectOption, handleTriggerKeyDown, handlePanelKeyDown, optionId, query, setQuery, } = useDropdown({ value, onChange, options }, { disabled });
@@ -40,10 +44,10 @@ export function Select(props, _optional = {}) {
40
44
  // One handle per FILTERED option, recomputed as the search query narrows the list — an option
41
45
  // dropped by the current query has no rendered row to attach a handle to, so it is simply absent
42
46
  // this render rather than holding a handle nothing resolves to. `undefined` (not an empty array)
43
- // when `base` itself is unset, so `SelectPanel` can tell "opted out" apart from "no options match".
44
- const optionHandles = base ? buildAgentListHandles({ prefix: `${base}-option`, ids: filtered.map((option) => option.value) }) : undefined;
47
+ // when `base` is explicitly opted out, so `SelectPanel` can tell "opted out" apart from "no options match".
48
+ const optionHandles = base ? filtered.map((option) => `${base}-option-${agentHandleSegment({ value: option.value })}`) : undefined;
45
49
  return (_jsxs(_Fragment, { children: [_jsxs("button", { type: "button", ref: triggerRef, id: id, className: "select-trigger", role: "combobox", "aria-expanded": open, "aria-haspopup": "listbox", "aria-controls": open ? listboxId : undefined, "aria-activedescendant": activeDescendant, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, disabled: disabled, onClick: () => (open ? closePanel({ refocusTrigger: false }) : openPanel()), onKeyDown: handleTriggerKeyDown, ...resolveSelectTriggerHandleProps(base, ariaLabel, placeholder), children: [_jsx("span", { className: triggerLabel.className, children: triggerLabel.text }), _jsx("span", { className: "select-trigger-chevron", "aria-hidden": "true" })] }), open && position
46
- ? createPortal(_jsx(SelectPanel, { panelRef: panelRef, position: position, showSearch: showSearch, searchInputRef: searchInputRef, query: query, setQuery: setQuery, filtered: filtered, value: value, highlightedIndex: highlightedIndex, listboxId: listboxId, optionId: optionId, setOptionRef: setOptionRef, onHighlight: setHighlightedIndex, onSelect: selectOption, onKeyDown: handlePanelKeyDown, searchHandle: base ? `${base}-search` : undefined, optionHandles: optionHandles, t: t }), resolveSelectPortalContainer({ trigger: triggerRef.current }, { container: props.portalContainer }))
50
+ ? createPortal(_jsx(SelectPanel, { panelRef: panelRef, page: resolveSelectOriginPage({ trigger: triggerRef.current }), position: position, showSearch: showSearch, searchInputRef: searchInputRef, query: query, setQuery: setQuery, filtered: filtered, value: value, highlightedIndex: highlightedIndex, listboxId: listboxId, optionId: optionId, setOptionRef: setOptionRef, onHighlight: setHighlightedIndex, onSelect: selectOption, onKeyDown: handlePanelKeyDown, searchHandle: base ? `${base}-search` : undefined, optionHandles: optionHandles, t: t }), resolveSelectPortalContainer({ trigger: triggerRef.current }, { container: props.portalContainer, fallbackContainer: overlayContainer }))
47
51
  : null] }));
48
52
  }
49
53
  //# sourceMappingURL=Select.js.map
@@ -26,11 +26,11 @@ export interface SuggestInputProps {
26
26
  className?: string | undefined;
27
27
  /** Cap on listed matches; omit to list them all. */
28
28
  limit?: number | undefined;
29
- agentHandle?: string | undefined;
29
+ agentHandle?: string | false | undefined;
30
30
  agentLabel?: string | undefined;
31
31
  useSuggest?: typeof useSuggestInput | undefined;
32
32
  /** Injectable for tests; defaults to `scrollIntoView({ block: 'nearest' })`. */
33
33
  scrollOptionIntoView?: ((option: Element) => void) | undefined;
34
34
  }
35
- export declare function SuggestInput({ value, onValueChange, suggestions, onPick, onKeyDown, placeholder, disabled, className, limit, agentHandle: handle, agentLabel, useSuggest, scrollOptionIntoView, ...rest }: SuggestInputProps): import("react").JSX.Element;
35
+ export declare function SuggestInput({ value, onValueChange, suggestions, onPick, onKeyDown, placeholder, disabled, className, limit, agentHandle: suppliedHandle, agentLabel, useSuggest, scrollOptionIntoView, ...rest }: SuggestInputProps): import("react").JSX.Element;
36
36
  //# sourceMappingURL=SuggestInput.d.ts.map
@@ -1,8 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
2
3
  import { useId, useRef } from 'react';
3
4
  import { agentHandle } from '@jini-ai/agentic';
4
5
  import { useScrollHighlightedIntoView, useSuggestInput } from './SuggestInput.hooks.js';
5
- export function SuggestInput({ value, onValueChange, suggestions, onPick, onKeyDown, placeholder, disabled, className, limit, agentHandle: handle, agentLabel, useSuggest = useSuggestInput, scrollOptionIntoView, ...rest }) {
6
+ export function SuggestInput({ value, onValueChange, suggestions, onPick, onKeyDown, placeholder, disabled, className, limit, agentHandle: suppliedHandle, agentLabel, useSuggest = useSuggestInput, scrollOptionIntoView, ...rest }) {
7
+ const handle = useAgentHandle({ agentHandle: suppliedHandle });
6
8
  const vm = useSuggest({ value, suggestions }, { limit });
7
9
  const listRef = useRef(null);
8
10
  useScrollHighlightedIntoView({ listRef, scrollTarget: vm.scrollTarget }, { scrollIntoView: scrollOptionIntoView });
@@ -1,9 +1,10 @@
1
+ import { type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
1
2
  import type { AgentModelOption } from '../../types.js';
2
3
  export interface SearchableModelSelectAdditionalOption {
3
4
  value: string;
4
5
  label: string;
5
6
  }
6
- export interface SearchableModelSelectProps {
7
+ export interface SearchableModelSelectProps extends AgentControlProps {
7
8
  models: readonly AgentModelOption[];
8
9
  value: string;
9
10
  onChange: (value: string) => void;
@@ -24,9 +25,8 @@ export interface SearchableModelSelectProps {
24
25
  menuClassName?: string | undefined;
25
26
  testId?: string | undefined;
26
27
  searchInputTestId?: string | undefined;
27
- /** Tags the wrapping element — `CustomSelect` owns the actual trigger/popover markup, so this is
28
- * the addressable unit an agent locates, then drives via its own trigger button inside. */
29
- agentHandle?: string | undefined;
28
+ /** Addresses the actual trigger, options and search field; false excludes every control. */
29
+ agentHandle?: string | false | undefined;
30
30
  }
31
31
  /**
32
32
  * A `CustomSelect` with a search box inside its popover, for model lists long
@@ -44,5 +44,5 @@ export interface SearchableModelSelectProps {
44
44
  * capability, and this package ships no such vocabulary for a host to hook
45
45
  * into. A host that needs per-option badges can compose them into `label`.
46
46
  */
47
- export declare function SearchableModelSelect({ models, value, onChange, ariaLabel, searchPlaceholder, additionalOptions, minSearchableOptions, className, menuClassName, testId, searchInputTestId, agentHandle, }: SearchableModelSelectProps): import("react").JSX.Element;
47
+ export declare function SearchableModelSelect({ models, value, onChange, ariaLabel, searchPlaceholder, additionalOptions, minSearchableOptions, className, menuClassName, testId, searchInputTestId, agentHandle, ...agentProps }: SearchableModelSelectProps): import("react").JSX.Element;
48
48
  //# sourceMappingURL=SearchableModelSelect.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useRef, useState } from 'react';
3
3
  import { agentHandleProps } from '@jini-ai/agentic';
4
+ import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
4
5
  import { filterAgentModelOptions } from '../../rules.js';
5
6
  import { CustomSelect } from '../../../../react/components/CustomSelect.js';
6
7
  /**
@@ -19,7 +20,8 @@ import { CustomSelect } from '../../../../react/components/CustomSelect.js';
19
20
  * capability, and this package ships no such vocabulary for a host to hook
20
21
  * into. A host that needs per-option badges can compose them into `label`.
21
22
  */
22
- export function SearchableModelSelect({ models, value, onChange, ariaLabel, searchPlaceholder, additionalOptions, minSearchableOptions = 8, className, menuClassName, testId, searchInputTestId, agentHandle, }) {
23
+ export function SearchableModelSelect({ models, value, onChange, ariaLabel, searchPlaceholder, additionalOptions, minSearchableOptions = 8, className, menuClassName, testId, searchInputTestId, agentHandle, ...agentProps }) {
24
+ const base = useAgentHandle({ ...agentProps, agentHandle });
23
25
  const [query, setQuery] = useState('');
24
26
  const searchRef = useRef(null);
25
27
  const allOptions = [
@@ -46,7 +48,7 @@ export function SearchableModelSelect({ models, value, onChange, ariaLabel, sear
46
48
  setQuery('');
47
49
  }
48
50
  };
49
- return (_jsx("div", { className: "jini-searchable-select", "data-testid": testId, ...agentHandleProps({}, { base: agentHandle, ...({ role: 'field', label: ariaLabel }) }), children: _jsx(CustomSelect, { value: value, options: visibleOptions, onChange: onChange, ariaLabel: ariaLabel, className: className, ...(menuClassName === undefined ? {} : { menuClassName }), onOpenChange: handleOpenChange, menuHeader: shouldShowSearch ? (_jsx("div", { className: "jini-searchable-select-search-row", children: _jsx("input", { ref: searchRef, type: "search", className: "jini-input jini-searchable-select-search", value: query, placeholder: searchPlaceholder, "aria-label": searchPlaceholder, "data-testid": searchInputTestId,
51
+ return (_jsx("div", { className: "jini-searchable-select", "data-testid": testId, "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], children: _jsx(CustomSelect, { agentHandle: base ?? false, "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], value: value, options: visibleOptions, onChange: onChange, ariaLabel: ariaLabel, className: className, ...(menuClassName === undefined ? {} : { menuClassName }), onOpenChange: handleOpenChange, menuHeader: shouldShowSearch ? (_jsx("div", { className: "jini-searchable-select-search-row", children: _jsx("input", { ref: searchRef, "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], ...agentHandleProps({}, { base, action: 'search', role: 'field', label: searchPlaceholder }), type: "search", className: "jini-input jini-searchable-select-search", value: query, placeholder: searchPlaceholder, "aria-label": searchPlaceholder, "data-testid": searchInputTestId,
50
52
  // The popover's own outside-pointerdown/keydown listeners are
51
53
  // scoped to the menu element, so typing here never closes it
52
54
  // — but stopping propagation keeps that explicit rather than
@@ -1,9 +1,10 @@
1
+ import { type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
1
2
  /** Host-wired `onCheckedChange`, not part of the agent-facing wire schema — see checkbox-field.manifest.ts. */
2
- export interface CheckboxFieldProps {
3
+ export interface CheckboxFieldProps extends AgentControlProps {
3
4
  readonly label?: string;
4
5
  readonly checked?: boolean;
5
6
  readonly disabled?: boolean;
6
7
  readonly onCheckedChange?: (checked: boolean) => void;
7
8
  }
8
- export declare function CheckboxField({ label, checked, disabled, onCheckedChange }: CheckboxFieldProps): import("react").JSX.Element;
9
+ export declare function CheckboxField({ label, checked, disabled, onCheckedChange, ...agentProps }: CheckboxFieldProps): import("react").JSX.Element;
9
10
  //# sourceMappingURL=checkbox-field.d.ts.map
@@ -1,9 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId } from 'react';
3
+ import { agentHandleProps } from '@jini-ai/agentic';
4
+ import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
3
5
  import { Checkbox } from './checkbox.js';
4
6
  import { Label } from './label.js';
5
- export function CheckboxField({ label, checked, disabled, onCheckedChange }) {
7
+ export function CheckboxField({ label, checked, disabled, onCheckedChange, ...agentProps }) {
6
8
  const id = useId();
7
- return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: id, ...(checked !== undefined ? { checked } : {}), ...(disabled !== undefined ? { disabled } : {}), ...(onCheckedChange ? { onCheckedChange: (state) => onCheckedChange(state === true) } : {}) }), label ? _jsx(Label, { htmlFor: id, children: label }) : null] }));
9
+ const base = useAgentHandle(agentProps);
10
+ return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: id, ...agentHandleProps({}, { base, role: 'field', ...(label === undefined ? {} : { label }) }), "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], ...(checked !== undefined ? { checked } : {}), ...(disabled !== undefined ? { disabled } : {}), ...(onCheckedChange ? { onCheckedChange: (state) => onCheckedChange(state === true) } : {}) }), label ? _jsx(Label, { htmlFor: id, children: label }) : null] }));
8
11
  }
9
12
  //# sourceMappingURL=checkbox-field.js.map
@@ -1,14 +1,16 @@
1
+ import { type AgentControlProps } from '../../../../react/hooks/useAgentHandle.js';
1
2
  export interface SelectOption {
2
3
  readonly value: string;
3
4
  readonly label: string;
4
5
  }
5
6
  /** Host-wired `onValueChange`, not part of the agent-facing wire schema — see select-field.manifest.ts. */
6
- export interface SelectFieldProps {
7
+ export interface SelectFieldProps extends AgentControlProps {
8
+ readonly portalContainer?: Element | DocumentFragment | null | undefined;
7
9
  readonly options: readonly SelectOption[];
8
10
  readonly value?: string;
9
11
  readonly placeholder?: string;
10
12
  readonly disabled?: boolean;
11
13
  readonly onValueChange?: (value: string) => void;
12
14
  }
13
- export declare function SelectField({ options, value, placeholder, disabled, onValueChange }: SelectFieldProps): import("react").JSX.Element;
15
+ export declare function SelectField({ options, value, placeholder, disabled, onValueChange, portalContainer, ...agentProps }: SelectFieldProps): import("react").JSX.Element;
14
16
  //# sourceMappingURL=select-field.d.ts.map
@@ -1,8 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { resolveSelectOriginPage } from '../../../../react/components/select-popover.js';
4
+ import { agentHandleProps, agentHandleSegment } from '@jini-ai/agentic';
5
+ import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
2
6
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select.js';
3
- export function SelectField({ options, value, placeholder, disabled, onValueChange }) {
7
+ export function SelectField({ options, value, placeholder, disabled, onValueChange, portalContainer, ...agentProps }) {
8
+ const base = useAgentHandle(agentProps);
9
+ const [trigger, setTrigger] = useState(null);
10
+ const page = agentProps['data-agent-page'] ?? resolveSelectOriginPage({ trigger });
4
11
  return (
5
12
  // Conditional spread for the same `exactOptionalPropertyTypes` reason as checkbox-field.tsx.
6
- _jsxs(Select, { ...(value !== undefined ? { defaultValue: value } : {}), ...(disabled !== undefined ? { disabled } : {}), ...(onValueChange ? { onValueChange } : {}), children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: placeholder }) }), _jsx(SelectContent, { children: options.map((option) => (_jsx(SelectItem, { value: option.value, children: option.label }, option.value))) })] }));
13
+ _jsxs(Select, { ...(value !== undefined ? { defaultValue: value } : {}), ...(disabled !== undefined ? { disabled } : {}), ...(onValueChange ? { onValueChange } : {}), children: [_jsx(SelectTrigger, { ref: setTrigger, ...agentHandleProps({}, { base, role: 'field' }), "data-agent-private": agentProps['data-agent-private'], "data-agent-page": page, children: _jsx(SelectValue, { placeholder: placeholder }) }), _jsx(SelectContent, { portalContainer: portalContainer ?? trigger?.closest('dialog'), "data-agent-page": page, "data-agent-private": agentProps['data-agent-private'], children: options.map((option) => (_jsx(SelectItem, { value: option.value, ...agentHandleProps({}, { base, action: `option-${agentHandleSegment({ value: option.value })}`, role: 'button', label: option.label }), children: option.label }, option.value))) })] }));
7
14
  }
8
15
  //# sourceMappingURL=select-field.js.map
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Ported from shadcn's `new-york` style registry (`ui.shadcn.com/r/styles/new-york/select.json`,
3
- * 2026-08-18). Only the `cn` import path changed, same as `table.tsx`; every class name and
4
- * `data-*` attribute below is unmodified CLI output.
3
+ * 2026-08-18). The host adapts the `cn` import and portal destination; every class name and
4
+ * existing `data-*` attribute below remains the registry's output.
5
5
  * Unused private group, label, and separator primitives are omitted.
6
6
  */
7
7
  import * as React from 'react';
@@ -11,7 +11,9 @@ declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.Selec
11
11
  declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
12
12
  declare const SelectScrollUpButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
13
13
  declare const SelectScrollDownButton: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
15
+ portalContainer?: Element | DocumentFragment | null | undefined;
16
+ } & React.RefAttributes<HTMLDivElement>>;
15
17
  declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
16
18
  export { Select, SelectValue, SelectTrigger, SelectContent, SelectItem, SelectScrollUpButton, SelectScrollDownButton, };
17
19
  //# sourceMappingURL=select.d.ts.map
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * Ported from shadcn's `new-york` style registry (`ui.shadcn.com/r/styles/new-york/select.json`,
4
- * 2026-08-18). Only the `cn` import path changed, same as `table.tsx`; every class name and
5
- * `data-*` attribute below is unmodified CLI output.
4
+ * 2026-08-18). The host adapts the `cn` import and portal destination; every class name and
5
+ * existing `data-*` attribute below remains the registry's output.
6
6
  * Unused private group, label, and separator primitives are omitted.
7
7
  */
8
8
  import * as React from 'react';
9
+ import { useOverlayContainer } from '@jini-ai/ui-kit/react';
9
10
  import * as SelectPrimitive from '@radix-ui/react-select';
10
11
  import { Check, ChevronDown, ChevronUp } from './icons.js';
11
12
  import { cn } from './lib/utils.js';
@@ -17,8 +18,12 @@ const SelectScrollUpButton = React.forwardRef(({ className, ...props }, ref) =>
17
18
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
18
19
  const SelectScrollDownButton = React.forwardRef(({ className, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, className: cn('flex cursor-default items-center justify-center py-1', className), ...props, children: _jsx(ChevronDown, { className: "h-4 w-4" }) })));
19
20
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
20
- const SelectContent = React.forwardRef(({ className, children, position = 'popper', ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn('relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]', position === 'popper' &&
21
- 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1', position === 'popper' && 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'), children: children }), _jsx(SelectScrollDownButton, {})] }) })));
21
+ const SelectContent = React.forwardRef(({ className, children, position = 'popper', portalContainer, ...props }, ref) => {
22
+ const overlayContainer = useOverlayContainer({});
23
+ const container = portalContainer ?? overlayContainer;
24
+ return (_jsx(SelectPrimitive.Portal, { ...(container === null ? {} : { container }), children: _jsxs(SelectPrimitive.Content, { ref: ref, className: cn('relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]', position === 'popper' &&
25
+ 'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1', className), position: position, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { className: cn('p-1', position === 'popper' && 'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'), children: children }), _jsx(SelectScrollDownButton, {})] }) }));
26
+ });
22
27
  SelectContent.displayName = SelectPrimitive.Content.displayName;
23
28
  const SelectItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(SelectPrimitive.Item, { ref: ref, className: cn('relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50', className), ...props, children: [_jsx("span", { className: "absolute right-2 flex h-3.5 w-3.5 items-center justify-center", children: _jsx(SelectPrimitive.ItemIndicator, { children: _jsx(Check, { className: "h-4 w-4" }) }) }), _jsx(SelectPrimitive.ItemText, { children: children })] })));
24
29
  SelectItem.displayName = SelectPrimitive.Item.displayName;
@@ -0,0 +1,12 @@
1
+ import { defineSecretCardTool } from './secret-card.js';
2
+ import { buildSignInCard, waitAtSignInCard } from './sign-in-card.js';
3
+ import { buildFormSurface } from './surfaces/form.js';
4
+ import { buildOutcomeSurface } from './surfaces/outcome.js';
5
+ export declare const mcpUiCards: {
6
+ defineSecretCardTool: typeof defineSecretCardTool;
7
+ buildSignInCard: typeof buildSignInCard;
8
+ waitAtSignInCard: typeof waitAtSignInCard;
9
+ buildFormSurface: typeof buildFormSurface;
10
+ buildOutcomeSurface: typeof buildOutcomeSurface;
11
+ };
12
+ //# sourceMappingURL=cards.d.ts.map
@@ -0,0 +1,8 @@
1
+ import { defineSecretCardTool } from './secret-card.js';
2
+ import { buildSignInCard, waitAtSignInCard } from './sign-in-card.js';
3
+ import { buildFormSurface } from './surfaces/form.js';
4
+ import { buildOutcomeSurface } from './surfaces/outcome.js';
5
+ export const mcpUiCards = {
6
+ defineSecretCardTool, buildSignInCard, waitAtSignInCard, buildFormSurface, buildOutcomeSurface,
7
+ };
8
+ //# sourceMappingURL=cards.js.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file A key card an installed plugin declares for its own provider (2026-10-22, starting with mail
3
+ * providers). The generic "Save an API credential" card asks for a label, base URL, category and
4
+ * deploy targets the person has no reason to know; a plugin that already knows them declares its own
5
+ * card copy, and core fills the rest in on the server. The form carries a masked token plus
6
+ * declared non-secret fields. Fixed labels, origins and categories remain server-owned, so a
7
+ * submission cannot redirect the key to another row. Instance-specific origins are explicit fields. Core names no vendor: every word on the card comes from the plugin's descriptor.
8
+ */
9
+ /** @agent-note `app` is the host's own id; it appears in every rendered card. */
10
+ import type { SurfaceCardSecretForm as SecretCardForm, SurfaceCardApp } from '@jini-ai/core/contracts/cards';
11
+ import type { PluginCredentialCard } from '@jini-ai/core/contracts/credentials';
12
+ /**
13
+ * Renders a plugin's key card: its title, intro and help link above declared public fields and one masked token field.
14
+ * The help link is a detail row (the form surface has no link control), and the saved label is
15
+ * shown so the person can find the row later under Access Tokens.
16
+ *
17
+ * @complexity O(f) declared public fields; mail retains its original one-field form.
18
+ */
19
+ export declare function buildPluginCredentialForm({ card, app }: {
20
+ card: PluginCredentialCard;
21
+ app: SurfaceCardApp;
22
+ }, _optional?: {}): SecretCardForm & {
23
+ preferredFrameSize: readonly [string, string];
24
+ description: string;
25
+ };
26
+ /** Apply plugin copy to an existing domain form, preserving its fields, update and blank-token rules.
27
+ * Domain stores remain authoritative for connection validation. @complexity O(f) form fields.
28
+ */
29
+ export declare function applyPluginCredentialCard({ card, form, app }: {
30
+ card?: PluginCredentialCard | undefined;
31
+ form: SecretCardForm;
32
+ app: SurfaceCardApp;
33
+ }, _options?: {}): SecretCardForm;
34
+ //# sourceMappingURL=credential-card.d.ts.map
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Renders a plugin's key card: its title, intro and help link above declared public fields and one masked token field.
3
+ * The help link is a detail row (the form surface has no link control), and the saved label is
4
+ * shown so the person can find the row later under Access Tokens.
5
+ *
6
+ * @complexity O(f) declared public fields; mail retains its original one-field form.
7
+ */
8
+ export function buildPluginCredentialForm({ card, app }, _optional = {}) {
9
+ return {
10
+ title: card.title,
11
+ description: `${card.intro ? card.intro + " " : ""}The key is sealed on the server the moment you submit — the assistant never sees it.`,
12
+ details: pluginCardDetails({ card }),
13
+ submitLabel: "Save key",
14
+ fields: [...(card.fields ?? []).map(field => ({ kind: "string", ...field })), {
15
+ kind: "string",
16
+ name: "token",
17
+ label: "API key",
18
+ hint: card.keyHint ?? "Paste the key here. It is never shown to the assistant.",
19
+ required: true,
20
+ secret: true,
21
+ }],
22
+ app,
23
+ preferredFrameSize: ["100%", "360px"],
24
+ };
25
+ }
26
+ /** Apply plugin copy to an existing domain form, preserving its fields, update and blank-token rules.
27
+ * Domain stores remain authoritative for connection validation. @complexity O(f) form fields.
28
+ */
29
+ export function applyPluginCredentialCard({ card, form, app }, _options = {}) {
30
+ if (!card)
31
+ return form;
32
+ const pluginForm = buildPluginCredentialForm({ card, app });
33
+ return { ...form, title: pluginForm.title, description: form.description ? `${card.intro ?? ""} ${form.description}`.trim() : pluginForm.description, details: [...(form.details ?? []), ...(pluginForm.details ?? [])],
34
+ fields: form.fields.map(field => field.kind === "string" && field.name === "token" && field.secret ? { ...field, ...(card.keyHint === undefined ? {} : { hint: card.keyHint }) } : field) };
35
+ }
36
+ /** API rows have a fixed label; domain owners choose their own connection identity. */
37
+ function pluginCardDetails({ card }, _options = {}) {
38
+ const help = card.helpUrl ? [{ label: card.helpLabel ?? 'Get a key', value: card.helpUrl }] : [];
39
+ const details = [...help, ...(card.usedFor?.length ? [{ label: 'Used for', value: card.usedFor.join('; ') }] : [])];
40
+ return card.saveKind && card.saveKind !== 'api' ? details : [...details, { label: 'Saved as', value: card.label }];
41
+ }
42
+ //# sourceMappingURL=credential-card.js.map
@@ -1,3 +1,5 @@
1
+ import type { SecretCardForm } from '@jini-ai/core/contracts/cards';
2
+ export type { SecretCardField, SecretCardForm } from '@jini-ai/core/contracts/cards';
1
3
  /**
2
4
  * One human-only secret-card lifecycle. Keystrokes go directly to the held exchange and save
3
5
  * port, never through model input, chat text, or logs. Saved values must stay in the host's
@@ -10,23 +12,7 @@
10
12
  * actual outcome. The host supplies the daemon's existing helper, never a second store.
11
13
  */
12
14
  import { type SurfaceAskThenReport, type SurfaceExchangeStore, type ToolExecutionContext, type ToolExecutionOptions } from '@jini-ai/core';
13
- import { type FormSurfaceSpec } from './surfaces/form.js';
14
15
  import { type SurfaceOutcomeSpec } from './surfaces/outcome.js';
15
- import type { StringField, SurfaceField } from './surfaces/fields.js';
16
- /** Secret fields cannot carry a value, even through a previously declared variable.
17
- * `allowBlank` permits an empty string for stored-value preservation or public-client auth. */
18
- export type SecretCardField = (SurfaceField & {
19
- readonly secret?: false;
20
- }) | (Omit<StringField, 'value' | 'secret'> & {
21
- readonly secret: true;
22
- readonly value?: never;
23
- readonly allowBlank?: boolean;
24
- });
25
- /** The host controls copy, field construction and display; routing/dismissal belong to the engine. */
26
- export type SecretCardForm = Omit<FormSurfaceSpec, 'fields' | 'toolName' | 'baseParams' | 'cancel'> & {
27
- readonly fields: readonly SecretCardField[];
28
- readonly cancelLabel?: string;
29
- };
30
16
  export type SecretCardRun<Saved> = {
31
17
  readonly status: 'saved';
32
18
  readonly saved: Saved;