@alexkroman1/aai-ui 0.16.0 → 0.18.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 +6 -7
- package/dist/_submission-timing.d.ts +40 -0
- package/dist/_submission.d.ts +56 -0
- package/dist/_theme.d.ts +17 -0
- package/dist/_theme.test-d.d.ts +14 -0
- package/dist/{_utils-Mi-SCFA1.js → _utils-BlZBJPdj.js} +4 -5
- package/dist/_utils.d.ts +4 -5
- package/dist/agent-state-labels.d.ts +8 -3
- package/dist/agent-state.d.ts +4 -2
- package/dist/append-dictation.d.ts +23 -0
- package/dist/audio/dictation.d.ts +36 -0
- package/dist/audio/index.d.ts +4 -2
- package/dist/audio/index.js +44 -1
- package/dist/{chat-view-DIwPoAEG.js → chat-view-BwKpF0MN.js} +65 -45
- package/dist/{client-config-C7fQrioM.js → client-config-DcMCWmkO.js} +8 -13
- package/dist/client-config.d.ts +29 -10
- package/dist/components/_form-readiness.d.ts +2 -1
- package/dist/components/audio-result.d.ts +2 -0
- package/dist/components/bullet-list.d.ts +1 -0
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/chat-view.js +1 -2
- package/dist/components/console-shell.d.ts +8 -5
- package/dist/components/controls.d.ts +1 -0
- package/dist/components/controls.js +2 -2
- package/dist/components/conversation-view.d.ts +1 -0
- package/dist/components/facts.d.ts +1 -0
- package/dist/components/form-fields.d.ts +31 -12
- package/dist/components/form-types.d.ts +48 -2
- package/dist/components/form.d.ts +10 -5
- package/dist/components/markdown.d.ts +1 -0
- package/dist/components/message-list.d.ts +1 -0
- package/dist/components/message-list.js +1 -2
- package/dist/components/session-controls.d.ts +7 -2
- package/dist/components/session-error-banner.d.ts +1 -0
- package/dist/components/session-state-dot.d.ts +45 -20
- package/dist/components/sidebar-layout.d.ts +2 -2
- package/dist/components/sidebar-layout.js +1 -1
- package/dist/components/start-screen.js +2 -2
- package/dist/components/tool-call-block.d.ts +3 -3
- package/dist/components/tool-call-block.js +1 -2
- package/dist/components/tool-call-row.d.ts +1 -0
- package/dist/components/tool-config-context.d.ts +23 -5
- package/dist/components/url-chips.d.ts +4 -3
- package/dist/components/workflow-fields.d.ts +36 -11
- package/dist/components/workflow-pending-note.d.ts +31 -12
- package/dist/components/workflow-run-error.d.ts +1 -0
- package/dist/components/workflow-run-panel.d.ts +1 -0
- package/dist/context-BF0KsI9X.js +473 -0
- package/dist/context.d.ts +8 -7
- package/dist/context.js +1 -381
- package/dist/default-client/assets/audio-CtBvSS3L.js +1 -0
- package/dist/default-client/assets/{capture-processor-CXCWxCO8.js → capture-processor-BZXisGjZ.js} +1 -1
- package/dist/default-client/assets/index-BkjCv4MX.css +2 -0
- package/dist/default-client/assets/index-DUQoaxdq.js +127 -0
- package/dist/default-client/assets/{playback-processor-DXHfyQD9.js → playback-processor-BHk-iXEU.js} +1 -1
- package/dist/default-client/index.html +2 -2
- package/dist/default-client.d.ts +1 -3
- package/dist/define-client.d.ts +32 -28
- package/dist/define-client.js +85 -44
- package/dist/dictation-transcriber.d.ts +49 -0
- package/dist/{eyebrow-UfmSz9yy.js → eyebrow-Bp4y1rZ9.js} +1 -1
- package/dist/{hooks-DN4gHYsj.js → hooks-1CoQY_Fc.js} +2 -2
- package/dist/hooks.js +1 -2
- package/dist/inbox-protocol.d.ts +14 -4
- package/dist/inbox.d.ts +1 -0
- package/dist/index.d.ts +12 -9
- package/dist/index.js +905 -277
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +6 -6
- package/dist/linked-client.d.ts +2 -0
- package/dist/{message-list-DHZcLhRA.js → message-list-BBHLK05X.js} +24 -13
- package/dist/page.d.ts +2 -0
- package/dist/phone.d.ts +1 -0
- package/dist/route-fetch.d.ts +8 -1
- package/dist/session/audio-setup.d.ts +1 -1
- package/dist/session/audio-state.d.ts +6 -6
- package/dist/session/index.js +1 -1
- package/dist/session/messages.d.ts +1 -9
- package/dist/session/preconnect.d.ts +1 -1
- package/dist/session/types.d.ts +4 -0
- package/dist/{session-CYdjRvbl.js → session-Rud8mmU-.js} +26 -15
- package/dist/stored-value.d.ts +2 -0
- package/dist/{tool-call-block-uXtMOUWN.js → tool-call-block-C8s6AhjS.js} +4 -4
- package/dist/tool-config-context-Bd-7xrfP.js +28 -0
- package/dist/types.d.ts +95 -6
- package/dist/{url-chips-oyy_Eiqh.js → url-chips-C_SHU6fq.js} +2 -2
- package/dist/use-client-runs.d.ts +2 -0
- package/dist/use-conversation-log.d.ts +2 -0
- package/dist/use-conversation.d.ts +24 -9
- package/dist/use-copy.d.ts +1 -0
- package/dist/use-dictation.d.ts +145 -0
- package/dist/use-download-url.d.ts +6 -1
- package/dist/use-flash.d.ts +1 -0
- package/dist/use-inbox.d.ts +2 -0
- package/dist/use-push-to-talk.d.ts +6 -1
- package/dist/use-route-mutation.d.ts +3 -0
- package/dist/use-route.d.ts +51 -7
- package/dist/use-run-key.d.ts +6 -1
- package/dist/use-session-controls.d.ts +1 -0
- package/dist/use-tap-to-talk.d.ts +5 -2
- package/dist/{use-user-transcript-uyHhzy4d.js → use-user-transcript-lOu_uMnf.js} +1 -1
- package/dist/use-user-transcript.d.ts +5 -1
- package/dist/use-workflow-form.d.ts +76 -167
- package/dist/use-workflow-progress.d.ts +5 -0
- package/dist/{use-workflow-run-DdhWmbx-.js → use-workflow-run-BTEemod0.js} +2 -2
- package/dist/use-workflow-run.d.ts +5 -0
- package/dist/use-workflow-runs.d.ts +18 -4
- package/dist/use-workflow-stream.d.ts +33 -7
- package/dist/use-workflows.d.ts +10 -2
- package/dist/workflow-client.d.ts +5 -0
- package/dist/workflow-def-types.d.ts +18 -2
- package/dist/workflow-field-kind.d.ts +66 -10
- package/dist/workflow-submission.d.ts +265 -0
- package/dist/worklets/capture-processor.d.ts +3 -3
- package/dist/worklets/capture-processor.js +2 -2
- package/dist/worklets/playback-processor.d.ts +3 -3
- package/dist/worklets/playback-processor.js +2 -2
- package/package.json +2 -2
- package/dist/default-client/assets/audio-DzwGxdv4.js +0 -1
- package/dist/default-client/assets/index-BOTLwsNO.js +0 -126
- package/dist/default-client/assets/index-_-x5JLLa.css +0 -2
- package/dist/tool-config-context-Es4YUzV2.js +0 -19
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import { type Context } from "react";
|
|
1
2
|
/**
|
|
2
|
-
* Display configuration for a tool call in the UI
|
|
3
|
+
* Display configuration for a tool call in the UI, keyed by tool name: the
|
|
4
|
+
* icon and label each tool declared with `tool({ ui })`, as the agent serves
|
|
5
|
+
* them in its `GET /client-config` body. `mountClient()` installs the served
|
|
6
|
+
* map as it is — a page has no map of its own to merge over it, so the tool's
|
|
7
|
+
* declaration is the one place a tool's icon lives.
|
|
3
8
|
*
|
|
9
|
+
* Not on the package barrel: nothing an author writes names it (the value a
|
|
10
|
+
* page reads comes from the agent), so it is the context's value type only.
|
|
11
|
+
*
|
|
12
|
+
* @sealed
|
|
4
13
|
* @public
|
|
5
14
|
*/
|
|
6
15
|
export type ToolDisplayConfig = Record<string, {
|
|
7
|
-
icon?: string;
|
|
8
|
-
label?: string;
|
|
16
|
+
icon?: string | undefined;
|
|
17
|
+
label?: string | undefined;
|
|
9
18
|
}>;
|
|
19
|
+
/**
|
|
20
|
+
* The value the context holds before the lookup lands (and forever, when the
|
|
21
|
+
* lookup fails): one frozen object, so the provider's value is stable across
|
|
22
|
+
* renders rather than a fresh `{}` per commit.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
export declare const EMPTY_TOOL_DISPLAY: ToolDisplayConfig;
|
|
10
27
|
/**
|
|
11
28
|
* Context for tool display configuration. Installed by `mountClient()` from
|
|
12
|
-
* `
|
|
29
|
+
* the agent's `GET /client-config` `tools`; the built-in components read it
|
|
30
|
+
* via `useToolConfig`.
|
|
13
31
|
*
|
|
14
32
|
* @internal
|
|
15
33
|
*/
|
|
16
|
-
export declare const ToolConfigContext:
|
|
34
|
+
export declare const ToolConfigContext: Context<ToolDisplayConfig>;
|
|
17
35
|
/**
|
|
18
36
|
* Read tool display configuration from the nearest `ToolConfigContext.Provider`.
|
|
19
37
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
1
2
|
/**
|
|
2
3
|
* The session's shareable UI URL — the page this UI is served from, what
|
|
3
4
|
* you'd send someone to talk to the agent.
|
|
@@ -6,7 +7,7 @@
|
|
|
6
7
|
*/
|
|
7
8
|
export declare function UiUrlChip({ className }: {
|
|
8
9
|
className?: string | undefined;
|
|
9
|
-
}):
|
|
10
|
+
}): JSX.Element;
|
|
10
11
|
/**
|
|
11
12
|
* The session's programmatic WebSocket endpoint — the URL a script or backend
|
|
12
13
|
* can connect to directly instead of using this UI.
|
|
@@ -15,7 +16,7 @@ export declare function UiUrlChip({ className }: {
|
|
|
15
16
|
*/
|
|
16
17
|
export declare function ApiUrlChip({ className }: {
|
|
17
18
|
className?: string | undefined;
|
|
18
|
-
}):
|
|
19
|
+
}): JSX.Element;
|
|
19
20
|
/**
|
|
20
21
|
* The UI and API URLs side by side. They answer the same question — "how do I
|
|
21
22
|
* reach this agent?" — so they belong together and each needs its label to be
|
|
@@ -26,4 +27,4 @@ export declare function ApiUrlChip({ className }: {
|
|
|
26
27
|
*/
|
|
27
28
|
export declare function SessionUrlChips({ className }: {
|
|
28
29
|
className?: string | undefined;
|
|
29
|
-
}):
|
|
30
|
+
}): JSX.Element;
|
|
@@ -1,6 +1,39 @@
|
|
|
1
1
|
import type { WorkflowSummary } from "@alexkroman1/aai/workflow-api";
|
|
2
|
+
import { type JSX } from "react";
|
|
3
|
+
import type { WorkflowAppLike, WorkflowNameOf } from "../workflow-def-types.ts";
|
|
4
|
+
import { type WorkflowFieldRender } from "../workflow-field-kind.ts";
|
|
2
5
|
/**
|
|
3
|
-
*
|
|
6
|
+
* Props for {@link WorkflowFields}.
|
|
7
|
+
*
|
|
8
|
+
* @typeParam App - The agent, when the page names it
|
|
9
|
+
* (`<WorkflowFields<typeof agentDef> workflow="digest" />`): `workflow` is
|
|
10
|
+
* then a name the agent declares, checked. Left to its default, any string:
|
|
11
|
+
* `WorkflowNameOf<WorkflowAppLike>` is `string`. The default is the
|
|
12
|
+
* constraint rather than the hooks' `never` because this is ONE signature —
|
|
13
|
+
* a form has no def form to fall to, so there is no second overload for a
|
|
14
|
+
* `never` to hand the call on to.
|
|
15
|
+
*
|
|
16
|
+
* @input
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export type WorkflowFieldsProps<App extends WorkflowAppLike = WorkflowAppLike> = {
|
|
20
|
+
/**
|
|
21
|
+
* The workflow whose input schema to render. A NAME is looked up here (one
|
|
22
|
+
* `GET workflows`); a {@link WorkflowSummary} the page already holds fetches
|
|
23
|
+
* nothing. `undefined` renders nothing, so a page may pass a selection
|
|
24
|
+
* straight through before one is made.
|
|
25
|
+
*/
|
|
26
|
+
workflow?: WorkflowSummary | WorkflowNameOf<App> | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The control to draw for a property, by name, where the schema alone does
|
|
29
|
+
* not say — `{ mustCover: "lines", source: "namedText" }`. Beats the schema
|
|
30
|
+
* for that property, never a declared upload. See `WorkflowFieldKind`.
|
|
31
|
+
*/
|
|
32
|
+
render?: Readonly<Record<string, WorkflowFieldRender>> | undefined;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Render one field per property of a workflow's input schema that has an
|
|
36
|
+
* honest control — every scalar, an array of strings, a `{ name, text }` object.
|
|
4
37
|
*
|
|
5
38
|
* Pass the workflow's NAME and the schema is fetched here; pass a
|
|
6
39
|
* {@link WorkflowSummary} you already hold and nothing is fetched. The name form
|
|
@@ -31,16 +64,8 @@ import type { WorkflowSummary } from "@alexkroman1/aai/workflow-api";
|
|
|
31
64
|
* }
|
|
32
65
|
* ```
|
|
33
66
|
*
|
|
34
|
-
* @param props -
|
|
67
|
+
* @param props - See {@link WorkflowFieldsProps}.
|
|
35
68
|
*
|
|
36
69
|
* @public
|
|
37
70
|
*/
|
|
38
|
-
export declare function WorkflowFields({ workflow, }:
|
|
39
|
-
/**
|
|
40
|
-
* The workflow whose input schema to render. A NAME is looked up here (one
|
|
41
|
-
* `GET workflows`); a {@link WorkflowSummary} the page already holds fetches
|
|
42
|
-
* nothing. `undefined` renders nothing, so a page may pass a selection
|
|
43
|
-
* straight through before one is made.
|
|
44
|
-
*/
|
|
45
|
-
workflow?: WorkflowSummary | string | undefined;
|
|
46
|
-
}): import("react").JSX.Element | null;
|
|
71
|
+
export declare function WorkflowFields<App extends WorkflowAppLike = WorkflowAppLike>({ workflow, render, }: WorkflowFieldsProps<App>): JSX.Element | null;
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import type { WorkflowRun } from "../workflow-client.ts";
|
|
3
|
+
import type { UploadStatus, WorkflowSubmissionScope } from "../workflow-submission.ts";
|
|
3
4
|
/**
|
|
4
5
|
* Props for {@link WorkflowPendingNote}.
|
|
5
6
|
*
|
|
7
|
+
* @input
|
|
6
8
|
* @public
|
|
7
9
|
*/
|
|
8
10
|
export type WorkflowPendingNoteProps = {
|
|
9
11
|
/**
|
|
10
12
|
* The submission the page is rendering — `useWorkflowSubmit`'s or
|
|
11
|
-
* `useWorkflowStream`'s result, or any object carrying
|
|
12
|
-
* Nothing renders while `pending` is false.
|
|
13
|
+
* `useWorkflowStream`'s result, or any object carrying the three required
|
|
14
|
+
* fields. Nothing renders while `pending` is false. `scope` and `upload`,
|
|
15
|
+
* when present, choose two more sentences — see below.
|
|
13
16
|
*/
|
|
14
17
|
submission: {
|
|
15
18
|
readonly pending: boolean;
|
|
16
19
|
readonly startedHere: boolean;
|
|
17
20
|
readonly run: WorkflowRun | undefined;
|
|
21
|
+
/** Who finds the run again — `WorkflowSubmission.scope`; the `scope` prop overrides it. */
|
|
22
|
+
readonly scope?: WorkflowSubmissionScope | undefined;
|
|
23
|
+
/** The bytes in flight — `WorkflowSubmission.upload`; a PAUSED one gets its own line. */
|
|
24
|
+
readonly upload?: UploadStatus | undefined;
|
|
18
25
|
};
|
|
19
26
|
/**
|
|
20
27
|
* What the run produces, as the noun the sentences name: `"draft"`,
|
|
@@ -22,13 +29,16 @@ export type WorkflowPendingNoteProps = {
|
|
|
22
29
|
*/
|
|
23
30
|
subject?: string | undefined;
|
|
24
31
|
/**
|
|
25
|
-
* Where the key that finds the run again lives
|
|
26
|
-
* `useWorkflowSubmit`'s own `sessionStorage`
|
|
27
|
-
* passed `useRunKey({ storage: "local" })`,
|
|
28
|
-
* can find — so the sentence says "this
|
|
29
|
-
* closing the tab loses anything
|
|
32
|
+
* Where the key that finds the run again lives, overriding what the
|
|
33
|
+
* submission reports. `"tab"` is `useWorkflowSubmit`'s own `sessionStorage`
|
|
34
|
+
* key; `"browser"` is a page that passed `useRunKey({ storage: "local" })`,
|
|
35
|
+
* whose runs any tab on this browser can find — so the sentence says "this
|
|
36
|
+
* browser" and stops promising that closing the tab loses anything;
|
|
37
|
+
* `"none"` is a run nothing will find again (`recover: false`,
|
|
38
|
+
* `useWorkflowStream`), which the sentence has to say instead. Default: the
|
|
39
|
+
* submission's own `scope`, else `"tab"`.
|
|
30
40
|
*/
|
|
31
|
-
scope?:
|
|
41
|
+
scope?: WorkflowSubmissionScope | undefined;
|
|
32
42
|
/**
|
|
33
43
|
* ADDED to the note's own `text-sm opacity-70` rather than replacing it.
|
|
34
44
|
* There is no `tailwind-merge` in this package, so a class that CONFLICTS with
|
|
@@ -37,7 +47,7 @@ export type WorkflowPendingNoteProps = {
|
|
|
37
47
|
className?: string | undefined;
|
|
38
48
|
};
|
|
39
49
|
/**
|
|
40
|
-
* The one sentence a page says while a run is in flight —
|
|
50
|
+
* The one sentence a page says while a run is in flight — five situations,
|
|
41
51
|
* one line each — as a muted line under the form, and nothing otherwise.
|
|
42
52
|
*
|
|
43
53
|
* Six template pages had each written the function under this, byte-identical
|
|
@@ -60,9 +70,18 @@ export type WorkflowPendingNoteProps = {
|
|
|
60
70
|
*
|
|
61
71
|
* `startedHere`, `run` and `pending` are what {@link WorkflowSubmission}
|
|
62
72
|
* reports, which is why the prop is the submission itself rather than three
|
|
63
|
-
* booleans a page would re-derive.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
73
|
+
* booleans a page would re-derive. The two situations past those three read
|
|
74
|
+
* two more of its fields, and used to be the one page that wrote its own note:
|
|
75
|
+
*
|
|
76
|
+
* - **A run nothing will find again** (`scope: "none"` — `useWorkflowStream`,
|
|
77
|
+
* whose run reads the recording as this page sends it and gives up on one
|
|
78
|
+
* that stops arriving, or `recover: false`): "keep this tab open", because
|
|
79
|
+
* a reload does not orphan that run, it ENDS it. A page telling a reader they
|
|
80
|
+
* can close the tab would be wrong in exactly that mode.
|
|
81
|
+
* - **A PAUSED upload** is that same fact arriving through a button, which is
|
|
82
|
+
* why it is tested first and why its two sentences differ: with no run yet
|
|
83
|
+
* a pause costs nothing, and in the streaming mode the run is already
|
|
84
|
+
* watching an upload it will give up on.
|
|
66
85
|
*
|
|
67
86
|
* @example
|
|
68
87
|
* ```tsx
|