@datalayer/agent-runtimes 1.5.11 → 1.5.13
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-embed/chunks/ChatView-nnI1-MOR.js +32 -0
- package/dist-embed/datalayer-app-main.js +10 -10
- package/lib/apps/plugins/chat/ChatView.js +3 -2
- package/lib/apps/plugins/pap-sign-in/PapSignInCard.js +1 -1
- package/lib/apps/plugins/pap-sign-in/signIn.d.ts +6 -0
- package/lib/apps/plugins/pap-sign-in/signIn.js +8 -0
- package/lib/examples/AgentA2ATeamExample.js +2 -2
- package/lib/specs/actions.js +1 -0
- package/lib/specs/apps.d.ts +11 -11
- package/lib/specs/apps.js +109 -90
- package/lib/specs/scenes.js +2 -2
- package/lib/specs/teams/teams.js +4 -4
- package/package.json +1 -1
- package/dist-embed/chunks/ChatView-DIdw1rtZ.js +0 -32
|
@@ -1684,6 +1684,7 @@ export default function ChatView({ workspace }) {
|
|
|
1684
1684
|
};
|
|
1685
1685
|
const ComposerComponent = composerEntries[0]?.value.Component;
|
|
1686
1686
|
const HeaderComponent = headerEntries[0]?.value.Component;
|
|
1687
|
+
const headerShown = !config?.hideHeader && !!HeaderComponent;
|
|
1687
1688
|
const prompt = ComposerComponent ? (_jsx(ComposerComponent, { workspace: workspace, composer: composerProps })) : null;
|
|
1688
1689
|
/*
|
|
1689
1690
|
* The parts, named, so a layout can arrange them.
|
|
@@ -1855,7 +1856,7 @@ export default function ChatView({ workspace }) {
|
|
|
1855
1856
|
props through `renderHeader`. No contribution — or a host
|
|
1856
1857
|
that set `hideHeader` — means no bar.
|
|
1857
1858
|
*/
|
|
1858
|
-
showHeader:
|
|
1859
|
+
showHeader: headerShown,
|
|
1859
1860
|
// The `+` and the bin in the title bar, when the host asked for
|
|
1860
1861
|
// them; the header draws whatever `ChatBase` assembles here.
|
|
1861
1862
|
headerButtons: {
|
|
@@ -1978,7 +1979,7 @@ export default function ChatView({ workspace }) {
|
|
|
1978
1979
|
tool did. With an editor open the change is visible where it
|
|
1979
1980
|
happened, and the default tool row is enough.
|
|
1980
1981
|
*/
|
|
1981
|
-
notebookToolSurfacesId: active ? undefined : workspace.surfaceId, showTurnFooter: chatExtras.showTokenUsage ?? config?.showTokenUsage ?? true, onContextSnapshot: handleContextSnapshot, onLoadingChange: handleLoadingChange, onItemsChange: handleMessagesChange, onDisplayItemsChange: handleDisplayItemsChange, enableStreaming: true }, chatThread?.id)) }), besideChat && !promptHidden ? prompt : null] }) }));
|
|
1982
|
+
notebookToolSurfacesId: active ? undefined : workspace.surfaceId, showTurnFooter: chatExtras.showTokenUsage ?? config?.showTokenUsage ?? true, onContextSnapshot: handleContextSnapshot, onLoadingChange: handleLoadingChange, onItemsChange: handleMessagesChange, onDisplayItemsChange: handleDisplayItemsChange, enableStreaming: true }, chatThread?.id)) }), !headerShown && chatHeaderItems.length > 0 ? (_jsx(Box, { hidden: true, children: _jsx(ReactorSlot, { slot: LoopSlots.chatHeader, props: { workspace } }) })) : null, besideChat && !promptHidden ? prompt : null] }) }));
|
|
1982
1983
|
// Off when the host asked for the menu alone: the composer's suggestions
|
|
1983
1984
|
// control carries the same openers (`suggestions` above).
|
|
1984
1985
|
const chipsEl = config?.suggestionLabels !== false && chatSuggestions.length > 0 ? (_jsx(Box, { "aria-label": chatText.suggestedPrompts, display: "flex", flexWrap: "wrap", gap: 2, px: 2, pb: "6px", children: chatSuggestions.map(item => (_jsx(Box, { as: "button", type: "button",
|
|
@@ -58,7 +58,7 @@ export function PapSignInCard({ context, send, }) {
|
|
|
58
58
|
? PAP_SIGN_IN_WORDS.device
|
|
59
59
|
: read.mode === 'mediated'
|
|
60
60
|
? PAP_SIGN_IN_WORDS.mediated
|
|
61
|
-
: PAP_SIGN_IN_WORDS.direct }), read.sentTo ? (_jsx(Text, { as: "p", sx: { mt: 0, mb: 2, fontSize: 1 }, children: PAP_SIGN_IN_WORDS.sentTo(read.sentTo) })) : null, read.code ? (_jsxs(Box, { display: "flex", gap: 3, alignItems: "center", flexWrap: "wrap", mb: 2, children: [_jsxs(Box, { children: [_jsx(Text, { as: "div", sx: { fontSize: 0, color: 'fg.muted' }, children: PAP_SIGN_IN_WORDS.code }), _jsx(Text, { as: "div", "aria-live": "polite", sx: {
|
|
61
|
+
: PAP_SIGN_IN_WORDS.direct }), read.needs ? (_jsx(Text, { as: "p", sx: { mt: 0, mb: 2, fontSize: 1 }, children: PAP_SIGN_IN_WORDS.needs(read.needs) })) : null, read.sentTo ? (_jsx(Text, { as: "p", sx: { mt: 0, mb: 2, fontSize: 1 }, children: PAP_SIGN_IN_WORDS.sentTo(read.sentTo) })) : null, read.code ? (_jsxs(Box, { display: "flex", gap: 3, alignItems: "center", flexWrap: "wrap", mb: 2, children: [_jsxs(Box, { children: [_jsx(Text, { as: "div", sx: { fontSize: 0, color: 'fg.muted' }, children: PAP_SIGN_IN_WORDS.code }), _jsx(Text, { as: "div", "aria-live": "polite", sx: {
|
|
62
62
|
fontFamily: 'mono',
|
|
63
63
|
fontSize: 5,
|
|
64
64
|
fontWeight: 'bold',
|
|
@@ -31,6 +31,11 @@ export type PapSignInWaiting = {
|
|
|
31
31
|
sentTo?: string;
|
|
32
32
|
/** Until when, ISO 8601. */
|
|
33
33
|
expiresAt?: string;
|
|
34
|
+
/**
|
|
35
|
+
* What the company said it needs (its `authorization` event's scope,
|
|
36
|
+
* PAP_DATALAYER P-02): what the person is asked to allow there.
|
|
37
|
+
*/
|
|
38
|
+
needs?: string[];
|
|
34
39
|
};
|
|
35
40
|
/** What the card says. */
|
|
36
41
|
export declare const PAP_SIGN_IN_WORDS: {
|
|
@@ -41,6 +46,7 @@ export declare const PAP_SIGN_IN_WORDS: {
|
|
|
41
46
|
readonly mediatedTitle: (host: string) => string;
|
|
42
47
|
readonly mediated: "Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.";
|
|
43
48
|
readonly sentTo: (to: string) => string;
|
|
49
|
+
readonly needs: (scopes: string[]) => string;
|
|
44
50
|
readonly open: (host: string) => string;
|
|
45
51
|
readonly code: "Your code";
|
|
46
52
|
readonly copy: "Copy the code";
|
|
@@ -11,6 +11,7 @@ export const PAP_SIGN_IN_WORDS = {
|
|
|
11
11
|
mediatedTitle: (host) => `Sign in through ${host}`,
|
|
12
12
|
mediated: 'Open this page: it names the company and asks what the company needs. Type it there, never in this conversation.',
|
|
13
13
|
sentTo: (to) => `The company sent a code to ${to}.`,
|
|
14
|
+
needs: (scopes) => `It needs: ${scopes.join(', ')}.`,
|
|
14
15
|
open: (host) => `Open ${host}`,
|
|
15
16
|
code: 'Your code',
|
|
16
17
|
copy: 'Copy the code',
|
|
@@ -34,6 +35,8 @@ export const PAP_SIGN_IN_WORDS = {
|
|
|
34
35
|
* person's tab, so the conversation goes on there.
|
|
35
36
|
*/
|
|
36
37
|
export const PAP_SIGN_IN_CHANNEL = 'datalayer-pap-sign-in';
|
|
38
|
+
/** One OAuth scope token (RFC 6749 §3.3). */
|
|
39
|
+
const SCOPE = /^[\x21\x23-\x5B\x5D-\x7E]{1,128}$/;
|
|
37
40
|
const DOMAIN = /^(?=.{1,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;
|
|
38
41
|
/** What a message on the channel says of this company's sign-in, or `null`: another company's, or not one. */
|
|
39
42
|
export function signInReturnOf(message, company) {
|
|
@@ -122,6 +125,10 @@ export function readPapSignIn(result) {
|
|
|
122
125
|
const company = typeof data.company === 'string' && DOMAIN.test(data.company)
|
|
123
126
|
? data.company
|
|
124
127
|
: '';
|
|
128
|
+
// What the company said it needs: scope tokens only, anything else not shown.
|
|
129
|
+
const needs = Array.isArray(data.needs)
|
|
130
|
+
? data.needs.filter((scope) => typeof scope === 'string' && SCOPE.test(scope))
|
|
131
|
+
: [];
|
|
125
132
|
return {
|
|
126
133
|
mode: data.mode,
|
|
127
134
|
open: url.toString(),
|
|
@@ -136,5 +143,6 @@ export function readPapSignIn(result) {
|
|
|
136
143
|
...(typeof data.expires_at === 'string' && data.expires_at
|
|
137
144
|
? { expiresAt: data.expires_at }
|
|
138
145
|
: {}),
|
|
146
|
+
...(needs.length > 0 ? { needs } : {}),
|
|
139
147
|
};
|
|
140
148
|
}
|
|
@@ -11,11 +11,11 @@ import { useBrowserInference } from '../hooks/useBrowserInference';
|
|
|
11
11
|
import { readJwtClaims, tokenLifetimeMs, useAnonymousSessionStore, } from '../runtimes/browser/anonymousToken';
|
|
12
12
|
import { connectA2APeer } from '../runtimes/browser/a2aPeer';
|
|
13
13
|
import { A2ATeamGraph, SceneView, NOTEBOOK_AND_WORDS, teamConnectionsOf, teamToolClassifier, useA2ATeam, usePeerSandbox, } from '../components/teams';
|
|
14
|
-
import { ACCOUNTING_APP_0_0_1,
|
|
14
|
+
import { ACCOUNTING_APP_0_0_1, SALES_APP_0_0_2 } from '../specs/apps';
|
|
15
15
|
import { AgentInspector, classifyToolCall, traceA2AFetch, useAgentInspector, } from '../components/inspector';
|
|
16
16
|
import { SALES_AND_ACCOUNTING_TEAM_SPEC_0_0_1 } from '../specs/teams/teams';
|
|
17
17
|
const TEAM = SALES_AND_ACCOUNTING_TEAM_SPEC_0_0_1;
|
|
18
|
-
const SALES =
|
|
18
|
+
const SALES = SALES_APP_0_0_2;
|
|
19
19
|
const ACCOUNTING = ACCOUNTING_APP_0_0_1;
|
|
20
20
|
/** What Accounting reaches, from its Appspec: Odoo, through the odoo-accounting MCP server. */
|
|
21
21
|
const ACCOUNTING_CONNECTIONS = teamConnectionsOf(ACCOUNTING);
|
package/lib/specs/actions.js
CHANGED
package/lib/specs/apps.d.ts
CHANGED
|
@@ -12,32 +12,32 @@ export declare const ACCOUNTING_APP_0_0_1: AppSpec;
|
|
|
12
12
|
export declare const BOOKKEEPING_DESK_APP_0_0_1: AppSpec;
|
|
13
13
|
export declare const CHANGE_DETECTION_APP_0_0_1: AppSpec;
|
|
14
14
|
export declare const CROP_MONITORING_APP_0_0_1: AppSpec;
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
15
|
+
export declare const CUSTOMER_INTERVIEW_APP_0_0_2: AppSpec;
|
|
16
|
+
export declare const DATA_QUALITY_APP_0_0_2: AppSpec;
|
|
17
17
|
export declare const DECIDE_APP_0_0_1: AppSpec;
|
|
18
18
|
export declare const DISASTER_ASSESSMENT_APP_0_0_1: AppSpec;
|
|
19
19
|
export declare const ERRAND_RUNNER_APP_0_0_1: AppSpec;
|
|
20
|
-
export declare const
|
|
21
|
-
export declare const
|
|
20
|
+
export declare const EVENT_RESPONSE_APP_0_0_2: AppSpec;
|
|
21
|
+
export declare const EXCHANGE_DESK_APP_0_0_2: AppSpec;
|
|
22
22
|
export declare const GUEST_DESK_APP_0_0_1: AppSpec;
|
|
23
23
|
export declare const INBOX_TRIAGE_APP_0_0_1: AppSpec;
|
|
24
24
|
export declare const LIVE_SHOP_CHAT_APP_0_0_1: AppSpec;
|
|
25
|
-
export declare const
|
|
25
|
+
export declare const MODEL_CHOICE_APP_0_0_2: AppSpec;
|
|
26
26
|
export declare const MONTH_END_CLOSE_APP_0_0_1: AppSpec;
|
|
27
27
|
export declare const ORDER_DESK_APP_0_0_1: AppSpec;
|
|
28
28
|
export declare const ORDER_TRACKER_APP_0_0_1: AppSpec;
|
|
29
29
|
export declare const PIPELINE_REPORT_APP_0_0_1: AppSpec;
|
|
30
|
-
export declare const
|
|
31
|
-
export declare const
|
|
30
|
+
export declare const QUOTE_CALCULATOR_APP_0_0_5: AppSpec;
|
|
31
|
+
export declare const REPORT_FROM_A_FILE_APP_0_0_4: AppSpec;
|
|
32
32
|
export declare const RETURNS_DESK_APP_0_0_1: AppSpec;
|
|
33
|
-
export declare const
|
|
34
|
-
export declare const
|
|
33
|
+
export declare const SALES_APP_0_0_2: AppSpec;
|
|
34
|
+
export declare const SHIP_OR_FIX_APP_0_0_2: AppSpec;
|
|
35
35
|
export declare const SHOP_CONCIERGE_APP_0_0_1: AppSpec;
|
|
36
36
|
export declare const SHOPPING_DESK_APP_0_0_1: AppSpec;
|
|
37
37
|
export declare const SIGN_IN_DESK_APP_0_0_1: AppSpec;
|
|
38
38
|
export declare const SIGNED_READER_APP_0_0_1: AppSpec;
|
|
39
|
-
export declare const
|
|
40
|
-
export declare const
|
|
39
|
+
export declare const SUPPLIER_COMPARISON_APP_0_0_2: AppSpec;
|
|
40
|
+
export declare const SUPPORT_DESK_APP_0_0_4: AppSpec;
|
|
41
41
|
export declare const TRAVEL_DESK_APP_0_0_1: AppSpec;
|
|
42
42
|
export declare const WEB_RESEARCH_APP_0_0_1: AppSpec;
|
|
43
43
|
export declare const APP_CATALOGUE: Record<string, AppSpec>;
|