agentic-ui-kit 0.8.0 → 0.9.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 (41) hide show
  1. package/README.md +19 -15
  2. package/dist/ask-user-CwDYhXX4.js +388 -0
  3. package/dist/core.js +3 -103
  4. package/dist/extensions-CJ4Asuxk.js +329 -0
  5. package/dist/index.js +43 -1394
  6. package/dist/partial-json-w_oXePqJ.js +111 -0
  7. package/dist/types/core/src/blocks.d.ts +1 -1
  8. package/dist/types/core/src/events.d.ts +1 -1
  9. package/dist/types/core/src/index.d.ts +9 -20
  10. package/dist/types/core/src/reduce.d.ts +2 -2
  11. package/dist/types/core/src/sse.d.ts +1 -1
  12. package/dist/types/core/src/ui-components.d.ts +1 -1
  13. package/dist/types/core/src/ui-markup.d.ts +1 -1
  14. package/dist/types/core/src/visuals.d.ts +11 -0
  15. package/dist/types/react/src/components/approval-card.d.ts +1 -1
  16. package/dist/types/react/src/components/ask-user.d.ts +1 -1
  17. package/dist/types/react/src/components/chat-list.d.ts +1 -1
  18. package/dist/types/react/src/components/composer.d.ts +1 -1
  19. package/dist/types/react/src/components/extensions.d.ts +50 -0
  20. package/dist/types/react/src/components/message-list.d.ts +1 -1
  21. package/dist/types/react/src/components/messages.d.ts +1 -1
  22. package/dist/types/react/src/components/tool-prompt.d.ts +1 -1
  23. package/dist/types/react/src/components/tools.d.ts +2 -2
  24. package/dist/types/react/src/hooks/sse-transport.d.ts +1 -1
  25. package/dist/types/react/src/hooks/use-chat.d.ts +1 -1
  26. package/dist/types/react/src/index.d.ts +86 -90
  27. package/dist/types/react/src/primitives/chat-theme.d.ts +3 -3
  28. package/dist/types/react/src/views/chat-transcript.d.ts +2 -5
  29. package/dist/types/react/src/views/chat-view.d.ts +4 -11
  30. package/dist/types/react/src/views/sidebar.d.ts +1 -1
  31. package/dist/types/react/src/visuals/core.d.ts +1 -0
  32. package/dist/types/react/src/visuals/index.d.ts +8 -0
  33. package/dist/types/react/src/visuals/provider.d.ts +26 -0
  34. package/dist/types/react/src/{components → visuals}/ui-components.d.ts +2 -2
  35. package/dist/types/react/src/{components → visuals}/ui-tree.d.ts +2 -1
  36. package/dist/types/react/src/{components → visuals}/widget-frame.d.ts +2 -1
  37. package/dist/{src-BrPYkHdt.js → visuals-CxCXnEob.js} +96 -490
  38. package/dist/visuals-core.js +1 -0
  39. package/dist/visuals.js +1134 -0
  40. package/package.json +9 -1
  41. /package/dist/types/react/src/{components → visuals}/replacements.d.ts +0 -0
@@ -0,0 +1,8 @@
1
+ export { VisualsProvider, visualToolViews } from "./provider.js";
2
+ export type { VisualsProviderProps } from "./provider.js";
3
+ export { WidgetFrame, WidgetHostProvider, useWidgetHost, WidgetPartView, widgetToolView, readVisualizeInput, widgetCsp, intersectAllow, openInNewTab, WIDGET_MAX_HEIGHT } from "./widget-frame.js";
4
+ export type { WidgetFrameProps, WidgetToolInput, WidgetHost, WidgetAllow, WidgetResource } from "./widget-frame.js";
5
+ export { UiComponentsProvider, UiTree, UiMarkupBlock, useUiMarkupLanguage, useUiAction, useUiState, htmlComponent, uiTreeToolView, uiMarkupToolView, readTreeInput } from "./ui-tree.js";
6
+ export type { UiComponent, UiStateStore, UiTreeProps, UiToolViewOptions } from "./ui-tree.js";
7
+ export { uiComponents, uiComponentSet, uiRenders } from "./ui-components.js";
8
+ export type { UiComponentSetOptions } from "./ui-components.js";
@@ -0,0 +1,26 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ToolViews } from "../components/tools.js";
3
+ import { type UiComponent, type UiStateStore } from "./ui-tree.js";
4
+ import { type WidgetHost } from "./widget-frame.js";
5
+ /** Views for the suggested tools: `visualizeTool`, `renderUiTool` and `showUiTool`, under their names. */
6
+ export declare const visualToolViews: ToolViews;
7
+ export interface VisualsProviderProps {
8
+ /** The components the model may use in `show_ui` / `render_ui` calls and ```ui blocks. None by default. */
9
+ components?: readonly UiComponent[];
10
+ /** Keeps each widget's state (ticks, picked tab) across reloads. */
11
+ persist?: UiStateStore;
12
+ /** Fence language of UI blocks in replies; `false` shows them as code. Default: core's `uiMarkupLanguage`. */
13
+ markup?: string | false;
14
+ /**
15
+ * What widgets (sandboxed HTML) may do: the domains they may load, and their callbacks. Inside a ChatView a
16
+ * widget's sendPrompt sends through `onSend`, and links open in a new tab unless set here; set a callback
17
+ * to `undefined` to turn it off. In a ChatTranscript widgets cannot send or call tools.
18
+ */
19
+ host?: WidgetHost;
20
+ children: ReactNode;
21
+ }
22
+ /**
23
+ * Turns on inline visuals for the chats below it: views for the suggested tools, `widget` parts, ```ui
24
+ * blocks, and in-place updates (`replaces`). One line: `<VisualsProvider components={uiComponents}>`.
25
+ */
26
+ export declare function VisualsProvider({ components, persist, markup, host, children }: VisualsProviderProps): import("react").JSX.Element;
@@ -1,6 +1,6 @@
1
- import { type UiSpecName, type UiSpecSelection } from "../../../core/src/index.js";
1
+ import { type UiSpecName, type UiSpecSelection } from "../../../core/src/visuals.js";
2
2
  import type { ComponentType } from "react";
3
- import { type UiComponent } from "./ui-tree";
3
+ import { type UiComponent } from "./ui-tree.js";
4
4
  /** How a component is drawn: gets its props (checked, state refs resolved) and its rendered children. */
5
5
  type UiRender = ComponentType<any>;
6
6
  /**
@@ -1,4 +1,5 @@
1
- import { type ToolCallPart, type UiComponentSpec } from "../../../core/src/index.js";
1
+ import { type ToolCallPart } from "../../../core/src/index.js";
2
+ import { type UiComponentSpec } from "../../../core/src/visuals.js";
2
3
  import { type ComponentType, type ReactNode } from "react";
3
4
  /** A component the model may use in a `render_ui` tree: its spec for the model and the React that draws it. */
4
5
  export interface UiComponent<Props = any> extends UiComponentSpec {
@@ -40,11 +40,12 @@ export interface WidgetHost {
40
40
  */
41
41
  frameUrl?: string;
42
42
  }
43
- /** Sets what widgets below may do. ChatView and ChatTranscript set it from their `widgets` prop. */
43
+ /** Sets what widgets below may do. `VisualsProvider` sets it from its `host` prop. */
44
44
  export declare function WidgetHostProvider({ host, children }: {
45
45
  host: WidgetHost;
46
46
  children: ReactNode;
47
47
  }): import("react").JSX.Element;
48
+ /** The host's abilities. Inside a ChatView, `onPrompt` sends through its `onSend`; a ChatTranscript has no `onPrompt` or `onCallTool`. */
48
49
  export declare function useWidgetHost(): WidgetHost;
49
50
  export interface WidgetFrameProps extends Omit<WidgetHost, "readResource" | "onWidgetError"> {
50
51
  /** The widget's script failed; each message once. */