@datalayer/agent-runtimes 1.5.2 → 1.5.4

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.
@@ -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} Replayed from a trace the PAP Python SDK's demo world generated (${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: {
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: [