@streamoid/agent 0.6.15 → 0.6.17
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/dist/index.d.ts +101 -0
- package/dist/index.js +23184 -22892
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,34 @@ export interface AgentChatShellWorkspace {
|
|
|
33
33
|
[key: string]: unknown;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/** What the host reports about the page the panel is sitting on. Unknown keys
|
|
37
|
+
* are dropped server-side, so hosts may add their own freely. */
|
|
38
|
+
export interface AgentHostContext {
|
|
39
|
+
/** Which application, e.g. `artifax`. */
|
|
40
|
+
app?: string;
|
|
41
|
+
/** Human name of the current page, e.g. `Boards`. */
|
|
42
|
+
page?: string;
|
|
43
|
+
/** Route pattern rather than the filled path, e.g. `/dashboard/:workspaceId/home`. */
|
|
44
|
+
route?: string;
|
|
45
|
+
/** Absolute URL of the host page. */
|
|
46
|
+
url?: string;
|
|
47
|
+
/** Identifiers a tool call might need: workspaceId, boardId, sessionId… */
|
|
48
|
+
ids?: Record<string, string | number>;
|
|
49
|
+
/** A short list of what is on screen — board names, selected items. */
|
|
50
|
+
visible?: string[];
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Whether the panel currently needs the host's whole screen, and why. */
|
|
55
|
+
export interface AgentSurfaceState {
|
|
56
|
+
/** `fullscreen` while the conversation on screen has an artefact panel open. */
|
|
57
|
+
mode: 'inline' | 'fullscreen';
|
|
58
|
+
/** How many panels that conversation has open. */
|
|
59
|
+
panelCount: number;
|
|
60
|
+
/** The panel in front, when there is one. */
|
|
61
|
+
activePanel?: { id: string; kind: string; title: string } | null;
|
|
62
|
+
}
|
|
63
|
+
|
|
36
64
|
export interface AgentChatShellAdapters {
|
|
37
65
|
auth: AgentChatShellAuth;
|
|
38
66
|
workspace: { current: AgentChatShellWorkspace };
|
|
@@ -40,6 +68,13 @@ export interface AgentChatShellAdapters {
|
|
|
40
68
|
config: {
|
|
41
69
|
apiBase: string;
|
|
42
70
|
hide?: { sidepane?: boolean; newBrief?: boolean; notifications?: boolean };
|
|
71
|
+
/**
|
|
72
|
+
* `inline_ask` declares this mount an inline assistant sitting on top of a
|
|
73
|
+
* host application page. It unlocks the tools that only make sense there —
|
|
74
|
+
* `capture_inline_screenshot`, `navigate_parent` — and adds the inline-mode
|
|
75
|
+
* instructions to the prompt. Defaults to `normal`.
|
|
76
|
+
*/
|
|
77
|
+
widgetMode?: 'normal' | 'inline_ask';
|
|
43
78
|
};
|
|
44
79
|
navigation: {
|
|
45
80
|
chatId: string | null;
|
|
@@ -48,6 +83,25 @@ export interface AgentChatShellAdapters {
|
|
|
48
83
|
/** Backend recovered after an outage — host decides what to do (must NOT
|
|
49
84
|
* reload the host window). */
|
|
50
85
|
onBackendRecovered?: () => void;
|
|
86
|
+
/**
|
|
87
|
+
* The page the panel is sitting on. Sent with every message, so update it as
|
|
88
|
+
* the user navigates: the agent then knows where they are without spending a
|
|
89
|
+
* turn on `capture_inline_screenshot`.
|
|
90
|
+
*/
|
|
91
|
+
hostContext?: AgentHostContext | null;
|
|
92
|
+
/**
|
|
93
|
+
* Called when the panel starts or stops showing a non-text artefact — a
|
|
94
|
+
* table, an image set, a widget, a techpack, a board.
|
|
95
|
+
*
|
|
96
|
+
* The panel cannot give an artefact more room than the host gave the panel,
|
|
97
|
+
* and a rail wide enough for a conversation is not wide enough for a
|
|
98
|
+
* spreadsheet. So the decision is reported rather than taken: widen your
|
|
99
|
+
* container on `fullscreen` and restore it on `inline`. Do nothing and
|
|
100
|
+
* behaviour is unchanged.
|
|
101
|
+
*
|
|
102
|
+
* Fires only on change, and only for the conversation on screen.
|
|
103
|
+
*/
|
|
104
|
+
onSurfaceChange?: (state: AgentSurfaceState) => void;
|
|
51
105
|
/**
|
|
52
106
|
* Supply the canvas as a component and the Dreamer panel drops its iframe:
|
|
53
107
|
* no embedded page, so no cross-origin auth, no postMessage handshake, no
|
|
@@ -100,3 +154,50 @@ export declare function AgentPanel(props: AgentPanelProps): ReactElement;
|
|
|
100
154
|
|
|
101
155
|
/** The embeddable chat shell AgentPanel wraps — for advanced composition. */
|
|
102
156
|
export declare function AgentChatShell(props: { adapters: AgentChatShellAdapters }): ReactElement;
|
|
157
|
+
|
|
158
|
+
/* ── Search or Ask CXO ─────────────────────────────────────────────────────
|
|
159
|
+
*
|
|
160
|
+
* NOTE FOR MAINTAINERS: this file is COPIED VERBATIM into the published
|
|
161
|
+
* package (`build:lib` does `cp lib-template/index.d.ts dist-lib/dist/`), so it
|
|
162
|
+
* is a second, hand-kept surface alongside `src/embed/index.ts`. Exporting
|
|
163
|
+
* something there and not here ships a value with no type, and the consumer's
|
|
164
|
+
* `tsc` fails on the import rather than at runtime. */
|
|
165
|
+
|
|
166
|
+
/** One search hit. Mirrors `ConversationSearchResult` in `src/api/chat.ts` —
|
|
167
|
+
* keep the two in step, field for field. */
|
|
168
|
+
export interface ConversationSearchResult {
|
|
169
|
+
conversation_id: string;
|
|
170
|
+
workspace_id?: string | null;
|
|
171
|
+
message_id?: string | null;
|
|
172
|
+
conversation_title?: string | null;
|
|
173
|
+
/** The matching text. Required — the result row renders it. */
|
|
174
|
+
snippet: string;
|
|
175
|
+
role?: string | null;
|
|
176
|
+
created_at?: string | null;
|
|
177
|
+
updated_at?: string | null;
|
|
178
|
+
matched_on: 'message' | 'title';
|
|
179
|
+
rank: number;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface ConversationSearchDialogProps {
|
|
183
|
+
workspaceId?: string | null;
|
|
184
|
+
/** Override the search call. Defaults to this workspace's conversations, so a
|
|
185
|
+
* host embedding the panel needs no API client of its own. */
|
|
186
|
+
search?: (query: string) => Promise<ConversationSearchResult[]>;
|
|
187
|
+
onClose(): void;
|
|
188
|
+
onSelectResult(result: ConversationSearchResult): void;
|
|
189
|
+
/** Start a NEW chat from the typed text. Supplying it turns the search box
|
|
190
|
+
* into "Search or Ask CXO": an Ask row appears and Enter submits it. Throw
|
|
191
|
+
* or reject to keep the dialog open with an inline error. Omit for
|
|
192
|
+
* search-only. */
|
|
193
|
+
onAsk?(query: string): Promise<void> | void;
|
|
194
|
+
placeholder?: string;
|
|
195
|
+
emptyStateTitle?: string;
|
|
196
|
+
emptyStateDescription?: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** "Search or Ask CXO" — the command dialog a host opens from its sidebar's
|
|
200
|
+
* search trigger, identical in every product. */
|
|
201
|
+
export declare function ConversationSearchDialog(
|
|
202
|
+
props: ConversationSearchDialogProps,
|
|
203
|
+
): ReactElement;
|