@datalayer/agent-runtimes 1.5.1 → 1.5.3
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-Dc1x4aBR.js → ChatView-B3QqHhAP.js} +4 -4
- package/dist-embed/datalayer-app-main.js +3 -3
- package/lib/apps/core/index.d.ts +16 -0
- package/lib/apps/index.d.ts +1 -1
- package/lib/apps/plugins/chat/ChatView.js +13 -1
- package/lib/apps/shell/LoopWorkspace.d.ts +8 -1
- package/lib/apps/shell/LoopWorkspace.js +5 -3
- package/lib/chat/header/ChatHeaderBase.d.ts +3 -1
- package/lib/chat/header/ChatHeaderBase.js +2 -2
- package/lib/chat/header/ChatViewModeToggle.d.ts +7 -1
- package/lib/chat/header/ChatViewModeToggle.js +5 -2
- package/lib/examples/pap/PapTraceView.d.ts +2 -0
- package/lib/examples/pap/PapTraceView.js +3 -1
- package/lib/examples/pap/traces/account-tokens.json +88 -825
- package/lib/examples/pap/traces/conversation-control.json +45 -131
- package/lib/examples/pap/traces/conversation-streaming.json +27 -127
- package/lib/examples/pap/traces/mediated-sign-in.json +22 -122
- package/lib/examples/pap/traces/operations.json +65 -412
- package/lib/examples/pap/traces/two-companies.json +233 -720
- package/lib/examples/pap/traces/user-with-a-company.json +95 -532
- package/lib/protocols/agentProtocols.js +3 -1
- package/lib/protocols/pap/index.d.ts +4 -0
- package/lib/protocols/pap/index.js +41 -0
- package/package.json +2 -2
package/lib/apps/core/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { AssistantCharacter } from '../../chat/assistant/characters';
|
|
|
9
9
|
import type { AssistantCharacterData } from '../../chat/assistant/formats/types';
|
|
10
10
|
import type { PresenceState } from '../../chat/presence/presenceStatus';
|
|
11
11
|
import type { ChatWords } from '../../chat/words';
|
|
12
|
+
import type { ChatViewMode } from '../../types/chat';
|
|
12
13
|
/** Lifecycle of the sandbox a workspace is attached to. */
|
|
13
14
|
export type SandboxState = 'idle' | 'starting' | 'running' | 'stopping' | 'error';
|
|
14
15
|
/** What the workspace knows about the sandbox behind it. */
|
|
@@ -196,6 +197,21 @@ export type LoopWorkspaceContext = {
|
|
|
196
197
|
* part of the page and the chat's stay together at the trailing edge.
|
|
197
198
|
*/
|
|
198
199
|
chatHeaderActions?: ReactNode;
|
|
200
|
+
/**
|
|
201
|
+
* The chat's view, as the host keeps it: the chat's title bar offers the
|
|
202
|
+
* views with its view-mode toggle (`ChatViewModeToggle`). Unsaid, the
|
|
203
|
+
* title bar offers none.
|
|
204
|
+
*/
|
|
205
|
+
chatViewModes?: LoopChatViewModes;
|
|
206
|
+
};
|
|
207
|
+
/** The chat's view in a workspace whose host keeps it (`chatViewModes`). */
|
|
208
|
+
export type LoopChatViewModes = {
|
|
209
|
+
/** The view the chat is in. */
|
|
210
|
+
value: ChatViewMode;
|
|
211
|
+
/** The person picked another view. */
|
|
212
|
+
onChange: (mode: ChatViewMode) => void;
|
|
213
|
+
/** The views offered, in the toggle's order; all of them when unsaid. */
|
|
214
|
+
offered?: readonly ChatViewMode[];
|
|
199
215
|
};
|
|
200
216
|
/**
|
|
201
217
|
* How a prompt typed in the shell reaches whatever should answer it.
|
package/lib/apps/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* @module apps
|
|
8
8
|
*/
|
|
9
|
-
export { LoopCommand, LoopDocumentToolbar, LoopMention, LoopNotebookToolbar, LoopRunProps, LoopSlots, LoopViewType, canOpenView, createPromptChannel, parseCommand, runForwardedProps, type CommandArgSpec, type CommandContribution, type CommandResult, type EditorToolbarContext, type EditorToolbarContribution, type LoopCommandContext, type LoopViewProps, type LoopWorkspaceContext, type MentionCandidate, type MentionContribution, type PromptChannel, type RunPropsContribution, type SandboxSnapshot, type SandboxState, type ViewControls, type ViewTypeContribution, useLoopPromptStore, suggestLoopPrompt, focusPrompt, onPromptFocusRequest, type LoopPromptState, type SuggestedPrompt, } from './core';
|
|
9
|
+
export { LoopCommand, LoopDocumentToolbar, LoopMention, LoopNotebookToolbar, LoopRunProps, LoopSlots, LoopViewType, canOpenView, createPromptChannel, parseCommand, runForwardedProps, type CommandArgSpec, type CommandContribution, type CommandResult, type EditorToolbarContext, type EditorToolbarContribution, type LoopCommandContext, type LoopViewProps, type LoopWorkspaceContext, type LoopChatViewModes, type MentionCandidate, type MentionContribution, type PromptChannel, type RunPropsContribution, type SandboxSnapshot, type SandboxState, type ViewControls, type ViewTypeContribution, useLoopPromptStore, suggestLoopPrompt, focusPrompt, onPromptFocusRequest, type LoopPromptState, type SuggestedPrompt, } from './core';
|
|
10
10
|
export { useEditorToolbar } from './core/toolbar';
|
|
11
11
|
export { LoopWorkspace, PluginToggles, ViewSwitcher, WorkspaceFullScreenAction, buildLoopReactor, useWorkspaceFullScreen, type LoopWorkspaceProps, type PluginTogglesProps, type ViewSwitcherProps, } from './shell';
|
|
12
12
|
export { A2uiPlugin, A2UI_PLUGIN_NAME } from './plugins/a2ui';
|
|
@@ -1845,7 +1845,19 @@ export default function ChatView({ workspace }) {
|
|
|
1845
1845
|
showNewChat: config?.headerButtons?.newChat ?? false,
|
|
1846
1846
|
showClear: config?.headerButtons?.clear ?? false,
|
|
1847
1847
|
}, renderHeader: HeaderComponent
|
|
1848
|
-
? headerProps => (_jsx(HeaderComponent, { workspace: workspace, header:
|
|
1848
|
+
? headerProps => (_jsx(HeaderComponent, { workspace: workspace, header:
|
|
1849
|
+
/* The chat's view, when the host keeps it: the
|
|
1850
|
+
title bar's toggle, given to the header only —
|
|
1851
|
+
the chat itself stays where the workspace
|
|
1852
|
+
places it, whichever view is picked. */
|
|
1853
|
+
workspace.chatViewModes
|
|
1854
|
+
? {
|
|
1855
|
+
...headerProps,
|
|
1856
|
+
chatViewMode: workspace.chatViewModes.value,
|
|
1857
|
+
onChatViewModeChange: workspace.chatViewModes.onChange,
|
|
1858
|
+
offeredViewModes: workspace.chatViewModes.offered,
|
|
1859
|
+
}
|
|
1860
|
+
: headerProps }))
|
|
1849
1861
|
: undefined,
|
|
1850
1862
|
/*
|
|
1851
1863
|
The (i), which opens the agent's details over the transcript.
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import type { JSX } from 'react';
|
|
23
23
|
import type { ReactNode } from 'react';
|
|
24
24
|
import { type PlatformInput, type PluginRef, type ReactorPlatform } from '@datalayer/reactor';
|
|
25
|
-
import { type LoopWorkspaceContext, type SandboxSnapshot } from '../core';
|
|
25
|
+
import { type LoopChatViewModes, type LoopWorkspaceContext, type SandboxSnapshot } from '../core';
|
|
26
26
|
export type LoopWorkspaceProps = {
|
|
27
27
|
/** Server backing this session. */
|
|
28
28
|
serverUrl: string;
|
|
@@ -93,6 +93,13 @@ export type LoopWorkspaceProps = {
|
|
|
93
93
|
* to `LoopSlots.chatHeader` instead, and both end up in the same row.
|
|
94
94
|
*/
|
|
95
95
|
chatHeaderActions?: ReactNode;
|
|
96
|
+
/**
|
|
97
|
+
* The chat's view, kept by the host: offered in the chat's title bar by
|
|
98
|
+
* its view-mode toggle. The host draws the view picked — for the
|
|
99
|
+
* assistant, a chat layout (`LoopChatLayout`) that hands the transcript
|
|
100
|
+
* and the composer to `ChatFloating`'s assistant mode.
|
|
101
|
+
*/
|
|
102
|
+
chatViewModes?: LoopChatViewModes;
|
|
96
103
|
/**
|
|
97
104
|
* The host's own controls for the workspace header row.
|
|
98
105
|
*
|
|
@@ -13,21 +13,21 @@ export function buildLoopReactor(extensions) {
|
|
|
13
13
|
return buildReactorFromPlugins(extensions);
|
|
14
14
|
}
|
|
15
15
|
export function LoopWorkspace(props) {
|
|
16
|
-
const { serverUrl, agentId, conversationId, model, sandbox = { state: 'idle' }, extensions = [], reactor: providedReactor, manageReactor = true, initialViewType, onSend, layout = 'page', showViewSelector = true, showHeader = true, chatHeaderActions, headerActions, headerContainer, sidebarRail = false, } = props;
|
|
16
|
+
const { serverUrl, agentId, conversationId, model, sandbox = { state: 'idle' }, extensions = [], reactor: providedReactor, manageReactor = true, initialViewType, onSend, layout = 'page', showViewSelector = true, showHeader = true, chatHeaderActions, chatViewModes, headerActions, headerContainer, sidebarRail = false, } = props;
|
|
17
17
|
// Building the platform is a one-time act: rebuilding it on every render
|
|
18
18
|
// would restart every plugin.
|
|
19
19
|
const reactor = useMemo(() => providedReactor ?? buildLoopReactor(extensions),
|
|
20
20
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
21
|
[providedReactor]);
|
|
22
22
|
useReactor(reactor, { autoStart: manageReactor });
|
|
23
|
-
return (_jsx(WorkspaceBody, { serverUrl: serverUrl, agentId: agentId, conversationId: conversationId, model: model, initialSandbox: sandbox, initialViewType: initialViewType, onSend: onSend, layout: layout, showViewSelector: showViewSelector, showHeader: showHeader, chatHeaderActions: chatHeaderActions, headerActions: headerActions, headerContainer: headerContainer, sidebarRail: sidebarRail }));
|
|
23
|
+
return (_jsx(WorkspaceBody, { serverUrl: serverUrl, agentId: agentId, conversationId: conversationId, model: model, initialSandbox: sandbox, initialViewType: initialViewType, onSend: onSend, layout: layout, showViewSelector: showViewSelector, showHeader: showHeader, chatHeaderActions: chatHeaderActions, chatViewModes: chatViewModes, headerActions: headerActions, headerContainer: headerContainer, sidebarRail: sidebarRail }));
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Split from `LoopWorkspace` so the hooks below run with the platform already
|
|
27
27
|
* registered — `useContributions` needs a reactor in the store, and `useReactor`
|
|
28
28
|
* registers it during the parent's render.
|
|
29
29
|
*/
|
|
30
|
-
function WorkspaceBody({ serverUrl, agentId: initialAgentId, conversationId, model, initialSandbox, initialViewType, onSend, layout = 'page', showViewSelector = true, showHeader = true, chatHeaderActions, headerActions, headerContainer, sidebarRail = false, }) {
|
|
30
|
+
function WorkspaceBody({ serverUrl, agentId: initialAgentId, conversationId, model, initialSandbox, initialViewType, onSend, layout = 'page', showViewSelector = true, showHeader = true, chatHeaderActions, chatViewModes, headerActions, headerContainer, sidebarRail = false, }) {
|
|
31
31
|
/*
|
|
32
32
|
* Which agent the session is talking to.
|
|
33
33
|
*
|
|
@@ -119,6 +119,7 @@ function WorkspaceBody({ serverUrl, agentId: initialAgentId, conversationId, mod
|
|
|
119
119
|
viewControls,
|
|
120
120
|
setViewControls,
|
|
121
121
|
chatHeaderActions,
|
|
122
|
+
chatViewModes,
|
|
122
123
|
}), [
|
|
123
124
|
serverUrl,
|
|
124
125
|
agentId,
|
|
@@ -131,6 +132,7 @@ function WorkspaceBody({ serverUrl, agentId: initialAgentId, conversationId, mod
|
|
|
131
132
|
viewControls,
|
|
132
133
|
setViewControls,
|
|
133
134
|
chatHeaderActions,
|
|
135
|
+
chatViewModes,
|
|
134
136
|
]);
|
|
135
137
|
// `submit` must not be rebuilt whenever the workspace object changes — the
|
|
136
138
|
// chat holds on to it — so it reads the current values through refs.
|
|
@@ -69,6 +69,8 @@ export interface ChatBaseHeaderProps {
|
|
|
69
69
|
onChatViewModeChange?: (mode: ChatViewMode) => void;
|
|
70
70
|
/** Modes shown greyed out: the sidebar, when the host has no mount point. */
|
|
71
71
|
disabledViewModes?: readonly ChatViewMode[];
|
|
72
|
+
/** The modes the toggle offers; all of them when unsaid. */
|
|
73
|
+
offeredViewModes?: readonly ChatViewMode[];
|
|
72
74
|
/** Show the companion-surface segmented control (None / Notebook / Document). */
|
|
73
75
|
showEphemeralSurfaceControl?: boolean;
|
|
74
76
|
/** Whether the Notebook option is available in the surface control. */
|
|
@@ -80,5 +82,5 @@ export interface ChatBaseHeaderProps {
|
|
|
80
82
|
/** Callback fired when the user changes the companion-surface mode. */
|
|
81
83
|
onEphemeralSurfaceModeChange?: (mode: EphemeralSurfaceMode) => void;
|
|
82
84
|
}
|
|
83
|
-
export declare function ChatBaseHeader({ title, subtitle, disableReason, brandIcon, headerContent, headerActions, showInformation, onInformationClick, padding, kernelIndicatorState, kernelIndicatorPlacement, runtimeStatus, kernel, kernelEnvironmentName, kernelCpu, kernelMemory, kernelGpu, headerButtons, messageCount, onNewChat, onClear, chatViewMode, onChatViewModeChange, disabledViewModes, showEphemeralSurfaceControl, enableEphemeralNotebookOption, enableEphemeralDocumentOption, ephemeralSurfaceMode, onEphemeralSurfaceModeChange, }: ChatBaseHeaderProps): import("react").JSX.Element;
|
|
85
|
+
export declare function ChatBaseHeader({ title, subtitle, disableReason, brandIcon, headerContent, headerActions, showInformation, onInformationClick, padding, kernelIndicatorState, kernelIndicatorPlacement, runtimeStatus, kernel, kernelEnvironmentName, kernelCpu, kernelMemory, kernelGpu, headerButtons, messageCount, onNewChat, onClear, chatViewMode, onChatViewModeChange, disabledViewModes, offeredViewModes, showEphemeralSurfaceControl, enableEphemeralNotebookOption, enableEphemeralDocumentOption, ephemeralSurfaceMode, onEphemeralSurfaceModeChange, }: ChatBaseHeaderProps): import("react").JSX.Element;
|
|
84
86
|
export {};
|
|
@@ -31,7 +31,7 @@ export function toRuntimeExecutionState(runtimeStatus) {
|
|
|
31
31
|
// ---------------------------------------------------------------------------
|
|
32
32
|
// Component
|
|
33
33
|
// ---------------------------------------------------------------------------
|
|
34
|
-
export function ChatBaseHeader({ title, subtitle, disableReason, brandIcon, headerContent, headerActions, showInformation, onInformationClick, padding, kernelIndicatorState, kernelIndicatorPlacement = 'left', runtimeStatus, kernel, kernelEnvironmentName, kernelCpu, kernelMemory, kernelGpu, headerButtons, messageCount, onNewChat, onClear, chatViewMode, onChatViewModeChange, disabledViewModes = [], showEphemeralSurfaceControl = false, enableEphemeralNotebookOption = false, enableEphemeralDocumentOption = false, ephemeralSurfaceMode = 'none', onEphemeralSurfaceModeChange, }) {
|
|
34
|
+
export function ChatBaseHeader({ title, subtitle, disableReason, brandIcon, headerContent, headerActions, showInformation, onInformationClick, padding, kernelIndicatorState, kernelIndicatorPlacement = 'left', runtimeStatus, kernel, kernelEnvironmentName, kernelCpu, kernelMemory, kernelGpu, headerButtons, messageCount, onNewChat, onClear, chatViewMode, onChatViewModeChange, disabledViewModes = [], offeredViewModes, showEphemeralSurfaceControl = false, enableEphemeralNotebookOption = false, enableEphemeralDocumentOption = false, ephemeralSurfaceMode = 'none', onEphemeralSurfaceModeChange, }) {
|
|
35
35
|
const effectiveIndicatorState = kernelIndicatorState ?? toRuntimeExecutionState(runtimeStatus);
|
|
36
36
|
/*
|
|
37
37
|
* No indicator where there is nothing to indicate.
|
|
@@ -58,5 +58,5 @@ export function ChatBaseHeader({ title, subtitle, disableReason, brandIcon, head
|
|
|
58
58
|
color: 'fg.muted',
|
|
59
59
|
minWidth: 0,
|
|
60
60
|
maxWidth: '100%',
|
|
61
|
-
}, children: _jsx(Truncate, { title: subtitle, maxWidth: "40ch", children: subtitle }) }))] })), disableReason && (_jsx(Label, { variant: "attention", sx: { flexShrink: 0 }, children: disableReason })), headerContent, showInformation && (_jsx(IconButton, { icon: InfoIcon, "aria-label": "Information", variant: "invisible", size: "small", onClick: onInformationClick })), kernelIndicatorPlacement === 'center' && kernelIndicatorElement] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [kernelIndicatorPlacement === 'right' && kernelIndicatorElement, headerButtons?.showNewChat && (_jsx(IconButton, { icon: PlusIcon, "aria-label": "New chat", variant: "invisible", size: "small", onClick: onNewChat })), headerButtons?.showClear && messageCount > 0 && (_jsx(IconButton, { icon: TrashIcon, "aria-label": "Clear messages", variant: "invisible", size: "small", onClick: onClear })), headerButtons?.showSettings && (_jsx(IconButton, { icon: GearIcon, "aria-label": "Settings", variant: "invisible", size: "small", onClick: headerButtons.onSettings })), showEphemeralSurfaceControl && (_jsx(EphemeralSurfaceControl, { mode: ephemeralSurfaceMode, onChange: onEphemeralSurfaceModeChange, enableNotebook: enableEphemeralNotebookOption, enableDocument: enableEphemeralDocumentOption })), chatViewMode && onChatViewModeChange && (_jsx(ChatViewModeToggle, { value: chatViewMode, onChange: onChatViewModeChange, disabledModes: disabledViewModes })), headerActions] })] }) }));
|
|
61
|
+
}, children: _jsx(Truncate, { title: subtitle, maxWidth: "40ch", children: subtitle }) }))] })), disableReason && (_jsx(Label, { variant: "attention", sx: { flexShrink: 0 }, children: disableReason })), headerContent, showInformation && (_jsx(IconButton, { icon: InfoIcon, "aria-label": "Information", variant: "invisible", size: "small", onClick: onInformationClick })), kernelIndicatorPlacement === 'center' && kernelIndicatorElement] }), _jsxs(Box, { display: "flex", alignItems: "center", gap: 1, flexShrink: 0, children: [kernelIndicatorPlacement === 'right' && kernelIndicatorElement, headerButtons?.showNewChat && (_jsx(IconButton, { icon: PlusIcon, "aria-label": "New chat", variant: "invisible", size: "small", onClick: onNewChat })), headerButtons?.showClear && messageCount > 0 && (_jsx(IconButton, { icon: TrashIcon, "aria-label": "Clear messages", variant: "invisible", size: "small", onClick: onClear })), headerButtons?.showSettings && (_jsx(IconButton, { icon: GearIcon, "aria-label": "Settings", variant: "invisible", size: "small", onClick: headerButtons.onSettings })), showEphemeralSurfaceControl && (_jsx(EphemeralSurfaceControl, { mode: ephemeralSurfaceMode, onChange: onEphemeralSurfaceModeChange, enableNotebook: enableEphemeralNotebookOption, enableDocument: enableEphemeralDocumentOption })), chatViewMode && onChatViewModeChange && (_jsx(ChatViewModeToggle, { value: chatViewMode, onChange: onChatViewModeChange, disabledModes: disabledViewModes, modes: offeredViewModes })), headerActions] })] }) }));
|
|
62
62
|
}
|
|
@@ -23,7 +23,13 @@ export type ChatViewModeToggleProps = {
|
|
|
23
23
|
onChange: (mode: ChatViewMode) => void;
|
|
24
24
|
/** Modes shown greyed out: the sidebar, when the host has no mount point. */
|
|
25
25
|
disabledModes?: readonly ChatViewMode[];
|
|
26
|
+
/**
|
|
27
|
+
* The modes offered, in `CHAT_VIEW_MODES` order whatever order they are
|
|
28
|
+
* given in: all of them when unsaid. A host that places only some of them
|
|
29
|
+
* — the workspace: its sidebar, or the assistant over it — leaves the rest out.
|
|
30
|
+
*/
|
|
31
|
+
modes?: readonly ChatViewMode[];
|
|
26
32
|
/** Where the tooltips open. Above by default; below for a control at the top of its window. */
|
|
27
33
|
tooltipDirection?: 'n' | 's';
|
|
28
34
|
};
|
|
29
|
-
export declare function ChatViewModeToggle({ value, onChange, disabledModes, tooltipDirection, }: ChatViewModeToggleProps): JSX.Element;
|
|
35
|
+
export declare function ChatViewModeToggle({ value, onChange, disabledModes, modes, tooltipDirection, }: ChatViewModeToggleProps): JSX.Element;
|
|
@@ -11,8 +11,11 @@ export const VIEW_MODE_ICONS = {
|
|
|
11
11
|
assistant: PaperclipIcon,
|
|
12
12
|
sidebar: SidebarExpandIcon,
|
|
13
13
|
};
|
|
14
|
-
export function ChatViewModeToggle({ value, onChange, disabledModes = [], tooltipDirection = 'n', }) {
|
|
15
|
-
|
|
14
|
+
export function ChatViewModeToggle({ value, onChange, disabledModes = [], modes, tooltipDirection = 'n', }) {
|
|
15
|
+
const offered = modes
|
|
16
|
+
? CHAT_VIEW_MODES.filter(option => modes.includes(option.mode))
|
|
17
|
+
: CHAT_VIEW_MODES;
|
|
18
|
+
return (_jsx(Box, { role: "group", "aria-label": "Display mode", "data-chat-view-mode-toggle": "", display: "inline-flex", alignItems: "center", bg: "neutral.muted", borderRadius: "6px", p: "2px", gap: "1px", children: offered.map(({ mode, label }) => {
|
|
16
19
|
const ModeIcon = VIEW_MODE_ICONS[mode];
|
|
17
20
|
const selected = value === mode;
|
|
18
21
|
/* Greyed rather than left out: the person sees the mode exists, and
|
|
@@ -60,6 +60,8 @@ export type PapTrace = {
|
|
|
60
60
|
title: string;
|
|
61
61
|
description: string;
|
|
62
62
|
generator: string;
|
|
63
|
+
/** The released SDK the trace was recorded with, as `personal-agent-protocol <version>`. */
|
|
64
|
+
sdk: string;
|
|
63
65
|
parties: PapTraceParty[];
|
|
64
66
|
steps: PapTraceStep[];
|
|
65
67
|
};
|
|
@@ -22,6 +22,8 @@ export function parsePapTrace(value) {
|
|
|
22
22
|
const trace = value;
|
|
23
23
|
if (!trace ||
|
|
24
24
|
typeof trace.slug !== 'string' ||
|
|
25
|
+
typeof trace.sdk !== 'string' ||
|
|
26
|
+
!/^personal-agent-protocol \d+\.\d+\.\d+$/.test(trace.sdk) ||
|
|
25
27
|
!Array.isArray(trace.parties) ||
|
|
26
28
|
!Array.isArray(trace.steps) ||
|
|
27
29
|
trace.steps.length === 0) {
|
|
@@ -190,7 +192,7 @@ export const PapTraceView = ({ trace, eyebrow = 'PAP · Replayed trace', }) => {
|
|
|
190
192
|
const go = (next) => setStepIndex(Math.max(0, Math.min(trace.steps.length - 1, next)));
|
|
191
193
|
const active = new Set(step.sequence.flatMap(item => [item.from, item.to]));
|
|
192
194
|
const observers = trace.parties.slice(1);
|
|
193
|
-
return (_jsxs(PapExamplePage, { eyebrow: eyebrow, title: trace.title, description: `${trace.description}
|
|
195
|
+
return (_jsxs(PapExamplePage, { eyebrow: eyebrow, title: trace.title, description: `${trace.description} Recorded data, not live: replayed from a trace the PAP Python SDK's demo world generated with ${trace.sdk} (${trace.generator}); every token, code, proof and assertion is a placeholder.`, maxWidth: 1240, children: [_jsx(Box, { display: "flex", gap: 2, flexWrap: "wrap", p: 3, bg: "canvas.default", border: "1px solid", borderColor: "border.default", borderRadius: 2, children: trace.parties.map(party => (_jsxs(Box, { display: "flex", gap: 2, alignItems: "center", mr: 3, children: [_jsx(Avatar, { party: party, tone: toneOf(trace.parties, party.id) }), _jsxs(Box, { children: [_jsx(Text, { as: "div", sx: { fontWeight: 700, fontSize: 1 }, children: party.name }), _jsx(Text, { as: "div", sx: { fontSize: 0, color: 'fg.muted' }, children: party.role })] })] }, party.id))) }), _jsxs(Box, { display: "flex", gap: 2, alignItems: "center", children: [_jsx(IconButton, { icon: ChevronLeftIcon, "aria-label": "Previous step", disabled: stepIndex === 0, onClick: () => go(stepIndex - 1) }), _jsx(Box, { display: "flex", gap: 2, overflow: "auto", flex: 1, "aria-label": "Trace steps", children: trace.steps.map((candidate, index) => (_jsxs(Button, { variant: index === stepIndex ? 'primary' : 'default', onClick: () => go(index), sx: { flexShrink: 0 }, children: [index + 1, ". ", candidate.title] }, candidate.title))) }), _jsx(IconButton, { icon: ChevronRightIcon, "aria-label": "Next step", disabled: stepIndex === trace.steps.length - 1, onClick: () => go(stepIndex + 1) })] }), _jsxs(Box, { display: "grid", sx: {
|
|
194
196
|
gridTemplateColumns: ['1fr', '1fr', 'minmax(300px, 0.7fr) 1.5fr'],
|
|
195
197
|
}, gap: 4, alignItems: "start", children: [_jsx(Phone, { trace: trace, stepIndex: stepIndex }), _jsxs(Box, { display: "flex", flexDirection: "column", gap: 3, minWidth: 0, children: [_jsxs(Box, { p: 3, bg: "canvas.default", border: "1px solid", borderColor: "border.default", borderRadius: 2, children: [_jsxs(Text, { as: "div", sx: { fontSize: 0, color: 'fg.muted' }, children: ["Step ", stepIndex + 1, " of ", trace.steps.length, " \u00B7 ", step.channel] }), _jsx(Heading, { as: "h2", sx: { mt: 1, fontSize: 3 }, children: step.title }), _jsx(Text, { as: "p", sx: { mt: 2, mb: 0, color: 'fg.muted' }, children: step.summary })] }), _jsx(Sequence, { trace: trace, step: step }), _jsx(Box, { display: "grid", sx: {
|
|
196
198
|
gridTemplateColumns: [
|