@streamoid/agent 0.6.51 → 0.6.53
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 +7 -4
- package/dist/index.d.ts +101 -4
- package/dist/index.js +19245 -18741
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,10 +53,13 @@ tank`); `title` keeps its original identity. Preserve proper names, acronyms and
|
|
|
53
53
|
|
|
54
54
|
Embedded and standalone chat use `ScComposerSurface` and `ScSuggestionRow` from
|
|
55
55
|
`@streamoid/ui` 0.6.86+. An empty composer starts with three 20px text lines and
|
|
56
|
-
grows to 170px before scrolling. Suggestions are native buttons in
|
|
57
|
-
|
|
56
|
+
grows to 170px before scrolling. Suggestions are native buttons in a stack of
|
|
57
|
+
cards (the DS row spaces and borders itself), and fill the composer without
|
|
58
|
+
navigating or sending. A panel scoped to an app shows exactly three when three
|
|
59
|
+
are available (see `AgentScopeAdapter.sections` in `index.d.ts`).
|
|
58
60
|
|
|
59
|
-
The secondary line shows `meta.
|
|
60
|
-
`meta.
|
|
61
|
+
The secondary line shows `meta.summary` — one outcome-first sentence — falling
|
|
62
|
+
back to `meta.outcome_summary`, then `meta.expected_output` (which stays the
|
|
63
|
+
agent's spec), optionally followed by authored `meta.ceiling_minutes`
|
|
61
64
|
and `meta.estimated_credits`. Unknown estimates are omitted. Scoped suggestions
|
|
62
65
|
use `deliverable` and `ceilingMinutes` from the host's outcome catalogue.
|
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,20 @@ export interface AgentHostContext {
|
|
|
50
50
|
ids?: Record<string, string | number>;
|
|
51
51
|
/** A short list of what is on screen — board names, selected items. */
|
|
52
52
|
visible?: string[];
|
|
53
|
+
/* The pane merges keys of its own into what is sent, never replacing the
|
|
54
|
+
* host's: `app_version` from `adapters.support.appVersion` on every message;
|
|
55
|
+
* and on a conversation started from the Get help home (`showAgentSupport`)
|
|
56
|
+
* `entry: "help_and_support"`, `current_page` (from `showAgentSupport({
|
|
57
|
+
* currentPage })`), `browser` ("Chrome") and `details_shared: true`. If the
|
|
58
|
+
* user removes the home's "We'll include" chip, that conversation's
|
|
59
|
+
* messages carry only `entry`, `details_shared: false` and the routing keys
|
|
60
|
+
* `scope` and `app` (plus `selection` / `ids.selection` while the composer's
|
|
61
|
+
* selection chip is attached) — none of the host's other keys, nor the
|
|
62
|
+
* pane's. The backend latches the opt-out on the conversation and strips
|
|
63
|
+
* the details from every later turn itself, even after a remount. */
|
|
64
|
+
/** Pane-set on the Get help conversation: whether the user shared the
|
|
65
|
+
* "We'll include" details. Hosts do not set it. */
|
|
66
|
+
details_shared?: boolean;
|
|
53
67
|
[key: string]: unknown;
|
|
54
68
|
}
|
|
55
69
|
|
|
@@ -63,6 +77,19 @@ export interface AgentSurfaceState {
|
|
|
63
77
|
activePanel?: { id: string; kind: string; title: string } | null;
|
|
64
78
|
}
|
|
65
79
|
|
|
80
|
+
/** `adapters.support` — what the "Get help" home ({@link showAgentSupport})
|
|
81
|
+
* and its messages say about the host. All optional; the home works without. */
|
|
82
|
+
export interface AgentSupportAdapter {
|
|
83
|
+
/**
|
|
84
|
+
* The host app's own build version, e.g. `0.0.61`. Sent as
|
|
85
|
+
* `hostContext.app_version` with EVERY message — support or not — so a
|
|
86
|
+
* problem report names the build it came from. Also shown in the Get help
|
|
87
|
+
* home's "We'll include" chip. A `hostContext.app_version` the host passes
|
|
88
|
+
* itself wins over this.
|
|
89
|
+
*/
|
|
90
|
+
appVersion?: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
66
93
|
export interface AgentChatShellAdapters {
|
|
67
94
|
auth: AgentChatShellAuth;
|
|
68
95
|
workspace: { current: AgentChatShellWorkspace };
|
|
@@ -162,6 +189,16 @@ export interface AgentChatShellAdapters {
|
|
|
162
189
|
* - `sections`: the app's outcome table. One suggestion per section, from
|
|
163
190
|
* its first sample's primary outcome. Change the samples and the
|
|
164
191
|
* suggestions follow. Omit it for the catalog briefs this app can run alone.
|
|
192
|
+
* The panel shows EXACTLY THREE suggested tasks when three exist: the
|
|
193
|
+
* sections' suggestions in table order (a fourth and later are left to
|
|
194
|
+
* "View all tasks"), topped up with the catalog briefs this app can run
|
|
195
|
+
* alone — those flagged for the empty chat first, by their authored rank,
|
|
196
|
+
* then the rest — never repeating one. Fewer only when fewer exist.
|
|
197
|
+
* - `headline`, `subline`, `placeholder`: the panel's app-specific question,
|
|
198
|
+
* helper line and composer hint. Pass all three: a scoped host that leaves
|
|
199
|
+
* any out gets one `console.warn` in a development build. Honoured at CXO
|
|
200
|
+
* home too (`hostContext.app` absent or `"cxo"`), where the defaults are
|
|
201
|
+
* the hub's own when they are absent.
|
|
165
202
|
* - `selection`: what was selected when the pane opened — a removable chip
|
|
166
203
|
* in the composer, and the subject suggestions name.
|
|
167
204
|
* - `onSuggestion`: DEPRECATED AND NOT CALLED. Picking a suggestion always
|
|
@@ -171,6 +208,12 @@ export interface AgentChatShellAdapters {
|
|
|
171
208
|
* offered the widening by the run that needs it.
|
|
172
209
|
*/
|
|
173
210
|
scope?: AgentScopeAdapter | null;
|
|
211
|
+
/**
|
|
212
|
+
* Details for the "Get help" home ({@link showAgentSupport}) and for message
|
|
213
|
+
* routing. Purely additive. There are deliberately no billing or credit
|
|
214
|
+
* callbacks: the billing flow runs in the chat, driven by the support agent.
|
|
215
|
+
*/
|
|
216
|
+
support?: AgentSupportAdapter | null;
|
|
174
217
|
}
|
|
175
218
|
|
|
176
219
|
export interface AgentScopeOutcome {
|
|
@@ -231,13 +274,15 @@ export interface AgentScopeAdapter {
|
|
|
231
274
|
sections?: AgentScopeSection[] | null;
|
|
232
275
|
selection?: AgentScopeSelection | null;
|
|
233
276
|
/** The line above the composer before the first turn, in the host's own
|
|
234
|
-
* words. Absent or blank = "Describe what you
|
|
277
|
+
* words — the app-specific question. Absent or blank = "Describe what you
|
|
278
|
+
* want to create" in an app, "Run your retail operations from here" at CXO
|
|
279
|
+
* home. */
|
|
235
280
|
headline?: string | null;
|
|
236
|
-
/** The quieter line under it. Absent or blank = "CXO will plan the
|
|
237
|
-
* and pause for your approval." */
|
|
281
|
+
/** The quieter helper line under it. Absent or blank = "CXO will plan the
|
|
282
|
+
* steps and pause for your approval." in an app, none at CXO home. */
|
|
238
283
|
subline?: string | null;
|
|
239
284
|
/** The empty composer's hint before the first turn. Absent or blank =
|
|
240
|
-
* "What needs to get done". */
|
|
285
|
+
* "What needs to get done". Honoured in an app and at CXO home alike. */
|
|
241
286
|
placeholder?: string | null;
|
|
242
287
|
/**
|
|
243
288
|
* @deprecated NOT CALLED. A suggestion always fills the composer. Kept so
|
|
@@ -448,3 +493,55 @@ export declare function enqueueChatPrompt(
|
|
|
448
493
|
* mounts, so reveal-then-call and call-then-reveal both work.
|
|
449
494
|
*/
|
|
450
495
|
export declare function focusAgentComposer(): void;
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Open the pane's "Get help" home. Call it from the app switcher's "Help and
|
|
499
|
+
* Support" row, in the same handler that reveals the pane.
|
|
500
|
+
*
|
|
501
|
+
* This REPLACES `enqueueChatPrompt({ prompt: "I need help and support",
|
|
502
|
+
* forceNewConversation: true })`, which auto-sent a message. This sends
|
|
503
|
+
* nothing: the pane shows a fresh, empty conversation as the Get help home —
|
|
504
|
+
* a title, an incident banner when a product is degraded, the ordinary
|
|
505
|
+
* composer, a "We'll include" line and four cards (Ask a question, Report a
|
|
506
|
+
* problem, Talk to the Streamoid team, Billing and credits). A card sends its
|
|
507
|
+
* prompt through the chat's own send path; typing works as usual.
|
|
508
|
+
*
|
|
509
|
+
* Every message of the conversation that starts on the home carries
|
|
510
|
+
* `hostContext.entry = "help_and_support"`, merged into the host's own
|
|
511
|
+
* context, for as long as that conversation stays open — so follow-ups keep
|
|
512
|
+
* routing to the support agent.
|
|
513
|
+
*
|
|
514
|
+
* The home's "We'll include" line is ONE removable chip naming what the
|
|
515
|
+
* support conversation is sent: workspace, `options.currentPage`, version
|
|
516
|
+
* and browser, after the app (plain text, always shared — it routes the
|
|
517
|
+
* request). Removing it (✕) sends none of them — only `entry`,
|
|
518
|
+
* `details_shared: false` and the routing keys `scope` and `app` — until the
|
|
519
|
+
* user restores it or the home is opened again. The opt-out is persisted on
|
|
520
|
+
* the conversation server-side, which also leaves the workspace off the
|
|
521
|
+
* support email and the issue. Starting a new task, or opening another
|
|
522
|
+
* conversation from history, leaves the mode.
|
|
523
|
+
*
|
|
524
|
+
* Queued like {@link enqueueChatPrompt}: the call may come before or after the
|
|
525
|
+
* pane mounts. Calling it while another conversation is open starts a new,
|
|
526
|
+
* empty one. Do not also set the panel's `chatId` to a new id — `null` (or
|
|
527
|
+
* leaving it alone) is right; the pane navigates itself.
|
|
528
|
+
*/
|
|
529
|
+
export declare function showAgentSupport(options?: ShowAgentSupportOptions | null): void;
|
|
530
|
+
|
|
531
|
+
/** Options for {@link showAgentSupport}. All optional; omit them entirely and
|
|
532
|
+
* the home behaves exactly as with no argument. */
|
|
533
|
+
export interface ShowAgentSupportOptions {
|
|
534
|
+
/**
|
|
535
|
+
* A short, human label for where the user was BEFORE opening help — the
|
|
536
|
+
* task or page they were on, e.g. `"SS26 range plan"` or `"Explore"`. Not a
|
|
537
|
+
* URL or a route (`hostContext.url`/`route` already carry those).
|
|
538
|
+
*
|
|
539
|
+
* Shown in the home's "We'll include" chip
|
|
540
|
+
* (`CXO · demo workspace · SS26 range plan · v0.0.61 · Chrome`) and sent as
|
|
541
|
+
* `hostContext.current_page` on every message of the support conversation,
|
|
542
|
+
* unless the user removes the chip. Cleared when the user leaves the home or
|
|
543
|
+
* its conversation (New task, another conversation); each call replaces it,
|
|
544
|
+
* and a call without it shows none.
|
|
545
|
+
*/
|
|
546
|
+
currentPage?: string | null;
|
|
547
|
+
}
|