@alexkroman1/aai-ui 16.1.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/_page-shell.d.ts +11 -0
- package/dist/{chat-view-DsylXJsw.js → chat-view-P12pHKQU.js} +1 -1
- package/dist/{client-config-DJQHnYjm.js → client-config-CFhkMkmv.js} +15 -13
- package/dist/client-config.d.ts +14 -13
- package/dist/components/chat-view.js +1 -1
- package/dist/components/controls.js +1 -1
- package/dist/components/message-list.js +1 -1
- package/dist/components/tool-call-block.js +1 -1
- package/dist/context.d.ts +27 -5
- package/dist/context.js +3 -3
- package/dist/default-client/assets/index-5XG8PqGw.css +2 -0
- package/dist/default-client/assets/index-tc-nAWq3.js +121 -0
- package/dist/default-client/index.html +2 -2
- package/dist/default-client.d.ts +21 -0
- package/dist/define-client.js +4 -4
- package/dist/hooks.d.ts +19 -9
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +17 -13
- package/dist/index.js +734 -433
- package/dist/internal.js +3 -3
- package/dist/{message-list-BLyPRS1Q.js → message-list-CJX560b5.js} +1 -1
- package/dist/page.d.ts +47 -21
- package/dist/{session-core-gwePM95B.js → session-core-TOdm_Con.js} +424 -174
- package/dist/session-core-audio-effects.d.ts +26 -0
- package/dist/session-core-audio-setup.d.ts +38 -31
- package/dist/session-core-audio-state.d.ts +152 -0
- package/dist/session-core-messages.d.ts +9 -10
- package/dist/session-core-types.d.ts +60 -21
- package/dist/session-core-user-turn.d.ts +30 -0
- package/dist/session-core.js +1 -1
- package/dist/use-push-to-talk.d.ts +105 -0
- package/dist/{use-workflow-run-CNahvlgL.js → use-workflow-run-ZqJWJn2-.js} +24 -11
- package/dist/workflow-client.d.ts +26 -12
- package/package.json +2 -2
- package/dist/default-client/assets/index-CMh4E-Ci.css +0 -2
- package/dist/default-client/assets/index-eOmPq2sS.js +0 -284
- package/dist/{tool-call-block-C2t_5fpp.js → tool-call-block-4gXoL_eP.js} +1 -1
- package/dist/{url-chips-D62RTz7v.js → url-chips-0n35fPJY.js} +1 -1
package/dist/internal.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as loadClientConfig, t as buildAgentUrl } from "./client-config-
|
|
1
|
+
import { r as loadClientConfig, t as buildAgentUrl } from "./client-config-CFhkMkmv.js";
|
|
2
2
|
import { SessionProvider, ThemeProvider } from "./context.js";
|
|
3
|
-
import { n as SessionUrlChips, r as UiUrlChip, t as ApiUrlChip } from "./url-chips-
|
|
3
|
+
import { n as SessionUrlChips, r as UiUrlChip, t as ApiUrlChip } from "./url-chips-0n35fPJY.js";
|
|
4
4
|
import { t as TRANSCRIBING_PLACEHOLDER } from "./use-user-transcript-uyHhzy4d.js";
|
|
5
5
|
import { t as ToolConfigContext } from "./tool-config-context-Es4YUzV2.js";
|
|
6
|
-
import { i as DEFAULT_PROGRESS_POLL_MS, n as MAX_MISSING_READS, t as DEFAULT_WORKFLOW_POLL_MS } from "./use-workflow-run-
|
|
6
|
+
import { i as DEFAULT_PROGRESS_POLL_MS, n as MAX_MISSING_READS, t as DEFAULT_WORKFLOW_POLL_MS } from "./use-workflow-run-ZqJWJn2-.js";
|
|
7
7
|
import { VOICE_CAPTURE_CONSTRAINTS } from "./types.js";
|
|
8
8
|
export { ApiUrlChip, DEFAULT_PROGRESS_POLL_MS, DEFAULT_WORKFLOW_POLL_MS, MAX_MISSING_READS, SessionProvider, SessionUrlChips, TRANSCRIBING_PLACEHOLDER, ThemeProvider, ToolConfigContext, UiUrlChip, VOICE_CAPTURE_CONSTRAINTS, buildAgentUrl, loadClientConfig };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSessionSelector, useTheme } from "./context.js";
|
|
2
2
|
import { a as inkTint, o as primaryTint } from "./_colors-CpZO-88A.js";
|
|
3
3
|
import { n as useUserTranscript } from "./use-user-transcript-uyHhzy4d.js";
|
|
4
|
-
import { n as ToolCallRow, t as ToolCallBlock } from "./tool-call-block-
|
|
4
|
+
import { n as ToolCallRow, t as ToolCallBlock } from "./tool-call-block-4gXoL_eP.js";
|
|
5
5
|
import clsx from "clsx";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { StickToBottom } from "use-stick-to-bottom";
|
package/dist/page.d.ts
CHANGED
|
@@ -14,7 +14,13 @@
|
|
|
14
14
|
* Authoring is otherwise identical — the file is still `client.tsx`, still
|
|
15
15
|
* React, still Tailwind, still the same theme tokens — so a workflow app reads
|
|
16
16
|
* like every other agent. What it reaches for instead of `useSession()` is
|
|
17
|
-
* `
|
|
17
|
+
* `useWorkflowSubmit()` / `useWorkflowRun()`, neither of which needs a client
|
|
18
|
+
* built for it.
|
|
19
|
+
*
|
|
20
|
+
* And `component` is OPTIONAL, the way `mountClient()`'s is: with none, this
|
|
21
|
+
* mounts the generated shell in `_page-shell.tsx`. That is also what a workflow
|
|
22
|
+
* app with NO `client.tsx` at all now gets — `default-client.tsx`, the prebuilt
|
|
23
|
+
* page, branches on the agent's declared front door and mounts this.
|
|
18
24
|
*/
|
|
19
25
|
import { type ComponentType } from "react";
|
|
20
26
|
import type { ClientTheme } from "./types.ts";
|
|
@@ -25,10 +31,17 @@ import type { ClientTheme } from "./types.ts";
|
|
|
25
31
|
*/
|
|
26
32
|
export type PageConfig = {
|
|
27
33
|
/**
|
|
28
|
-
* The root component
|
|
29
|
-
*
|
|
34
|
+
* The root component, rendered instead of the generated shell.
|
|
35
|
+
*
|
|
36
|
+
* **Optional**, the way `mountClient()`'s is: leave it out and `mountPage()`
|
|
37
|
+
* renders a form per declared workflow, the run's progress, its failure and
|
|
38
|
+
* its output — see `_page-shell.tsx` for what that shell is composed of and
|
|
39
|
+
* why it is deliberately functional rather than designed. It was REQUIRED,
|
|
40
|
+
* because "a workflow app has no default shell to fall back to" — true of a
|
|
41
|
+
* session and false of the page, and it cost the six shipped workflow
|
|
42
|
+
* templates 220-511 lines each of the same composition.
|
|
30
43
|
*/
|
|
31
|
-
component
|
|
44
|
+
component?: ComponentType;
|
|
32
45
|
/** CSS selector or DOM element to render into. Defaults to `"#app"`. */
|
|
33
46
|
target?: string | HTMLElement;
|
|
34
47
|
/**
|
|
@@ -53,28 +66,41 @@ export type PageHandle = {
|
|
|
53
66
|
/**
|
|
54
67
|
* Mount a page for an agent whose work happens in workflows.
|
|
55
68
|
*
|
|
56
|
-
* There is deliberately no session, no microphone, and no socket: the
|
|
57
|
-
*
|
|
58
|
-
*
|
|
69
|
+
* There is deliberately no session, no microphone, and no socket: the page talks
|
|
70
|
+
* to the agent over the workflow HTTP API (`useWorkflowSubmit`/`useWorkflowRun`),
|
|
71
|
+
* which is durable and outlives the tab.
|
|
72
|
+
*
|
|
73
|
+
* **Config only:** leave `component` out and the generated shell renders — a
|
|
74
|
+
* form per declared workflow, the run's progress, its failure, its output.
|
|
75
|
+
*
|
|
76
|
+
* **A custom component:** pass `component` and it is rendered inside the theme
|
|
77
|
+
* provider instead. The pieces the default shell is built from are all published
|
|
78
|
+
* (`useWorkflows`, `<WorkflowFields>`, `useWorkflowSubmit`,
|
|
79
|
+
* `<WorkflowProgress>`, `<WorkflowRunError>`), so replacing the shell does not
|
|
80
|
+
* mean starting from `fetch`.
|
|
59
81
|
*
|
|
60
|
-
* @example
|
|
82
|
+
* @example The default shell
|
|
61
83
|
* ```tsx
|
|
62
|
-
* import {
|
|
63
|
-
* import { useState } from "react";
|
|
84
|
+
* import { mountPage } from "@alexkroman1/aai-ui";
|
|
64
85
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
86
|
+
* mountPage({ name: "Digest" });
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* @example A custom component
|
|
90
|
+
* ```tsx
|
|
91
|
+
* import { mountPage, useWorkflows } from "@alexkroman1/aai-ui";
|
|
67
92
|
*
|
|
68
93
|
* function App() {
|
|
69
|
-
*
|
|
70
|
-
*
|
|
94
|
+
* // No client to build and none to hoist: every workflow hook defaults to one
|
|
95
|
+
* // aimed at the agent serving this page, built lazily and once.
|
|
96
|
+
* const { workflows, loading } = useWorkflows();
|
|
97
|
+
* if (loading) return <p>Loading…</p>;
|
|
71
98
|
* return (
|
|
72
|
-
* <
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* </button>
|
|
99
|
+
* <ul>
|
|
100
|
+
* {workflows.map((entry) => (
|
|
101
|
+
* <li key={entry.name}>{entry.description ?? entry.name}</li>
|
|
102
|
+
* ))}
|
|
103
|
+
* </ul>
|
|
78
104
|
* );
|
|
79
105
|
* }
|
|
80
106
|
*
|
|
@@ -85,4 +111,4 @@ export type PageHandle = {
|
|
|
85
111
|
*
|
|
86
112
|
* @public
|
|
87
113
|
*/
|
|
88
|
-
export declare function mountPage(config
|
|
114
|
+
export declare function mountPage(config?: PageConfig): PageHandle;
|