@datalayer/agent-runtimes 1.3.83 → 1.3.85
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/lib/chat/ChatFloating.d.ts +5 -4
- package/lib/chat/ChatFloating.js +8 -6
- package/lib/chat/ChatLanguage.d.ts +17 -0
- package/lib/chat/ChatLanguage.js +29 -0
- package/lib/chat/assistant/AssistantStage.d.ts +4 -4
- package/lib/chat/assistant/AssistantStage.js +4 -2
- package/lib/chat/assistant/BalloonParts.d.ts +2 -1
- package/lib/chat/assistant/BalloonParts.js +12 -5
- package/lib/chat/assistant/BalloonVisual.js +3 -1
- package/lib/chat/assistant/ConversationBalloon.d.ts +1 -1
- package/lib/chat/assistant/ConversationBalloon.js +3 -2
- package/lib/chat/assistant/SpeechBalloon.d.ts +1 -1
- package/lib/chat/assistant/SpeechBalloon.js +10 -7
- package/lib/chat/assistant/toolLine.d.ts +8 -4
- package/lib/chat/assistant/toolLine.js +13 -9
- package/lib/chat/base/ChatBase.js +30 -11
- package/lib/chat/base/loopElement.d.ts +53 -0
- package/lib/chat/base/loopElement.js +78 -0
- package/lib/chat/base/loopWindow.d.ts +31 -0
- package/lib/chat/base/loopWindow.js +74 -0
- package/lib/chat/display/EmptyState.js +3 -1
- package/lib/chat/index.d.ts +2 -0
- package/lib/chat/index.js +3 -0
- package/lib/chat/messages/ChatMessages.js +3 -1
- package/lib/chat/messages/TurnFooter.js +3 -1
- package/lib/chat/prompt/InputPrompt.js +3 -1
- package/lib/chat/prompt/InputPromptLexical.js +3 -1
- package/lib/chat/prompt/footer/InPromptFooter.js +3 -1
- package/lib/chat/tools/ToolApprovalBanner.js +5 -3
- package/lib/chat/tools/ToolApprovalDialog.js +5 -3
- package/lib/chat/tools/ToolCallDisplay.js +29 -25
- package/lib/chat/words.d.ts +102 -0
- package/lib/chat/words.js +460 -0
- package/lib/components/a2ui/custom/index.d.ts +39 -0
- package/lib/components/a2ui/custom/index.js +95 -0
- package/lib/components/a2ui/custom/sandbox.d.ts +73 -0
- package/lib/components/a2ui/custom/sandbox.js +188 -0
- package/lib/components/a2ui/datalayer/FileUpload.d.ts +10 -2
- package/lib/components/a2ui/datalayer/FileUpload.js +10 -7
- package/lib/components/a2ui/datalayer/Form.d.ts +2 -0
- package/lib/components/a2ui/datalayer/Form.js +9 -2
- package/lib/components/a2ui/datalayer/formWidgets.d.ts +19 -0
- package/lib/components/a2ui/datalayer/formWidgets.js +51 -0
- package/lib/components/a2ui/datalayer/index.d.ts +1 -1
- package/lib/components/a2ui/datalayer/index.js +1 -1
- package/lib/components/a2ui/datalayer/schema.d.ts +10 -0
- package/lib/components/a2ui/datalayer/schema.js +12 -1
- package/lib/components/a2ui/index.d.ts +1 -0
- package/lib/components/a2ui/index.js +1 -0
- package/lib/components/a2ui/visibleWhen.d.ts +12 -1
- package/lib/components/a2ui/visibleWhen.js +24 -3
- package/lib/components/inspector/AgentInspector.d.ts +25 -44
- package/lib/components/inspector/AgentInspector.js +27 -215
- package/lib/components/inspector/AgentInspectorDialog.d.ts +6 -6
- package/lib/components/inspector/AgentInspectorDialog.js +2 -2
- package/lib/components/inspector/a2aSpans.d.ts +51 -0
- package/lib/components/inspector/a2aSpans.js +373 -0
- package/lib/components/inspector/agentSpans.d.ts +120 -0
- package/lib/components/inspector/agentSpans.js +253 -0
- package/lib/components/inspector/chatSpans.d.ts +36 -0
- package/lib/components/inspector/chatSpans.js +50 -0
- package/lib/components/inspector/classify.d.ts +11 -8
- package/lib/components/inspector/classify.js +23 -24
- package/lib/components/inspector/index.d.ts +7 -7
- package/lib/components/inspector/index.js +7 -7
- package/lib/components/teams/A2ATeamGraph.d.ts +4 -4
- package/lib/components/teams/SceneTranscript.d.ts +29 -0
- package/lib/components/teams/SceneTranscript.js +54 -0
- package/lib/components/teams/SceneView.d.ts +41 -0
- package/lib/components/teams/SceneView.js +28 -0
- package/lib/components/teams/index.d.ts +3 -0
- package/lib/components/teams/index.js +3 -0
- package/lib/components/teams/sceneTranscript.d.ts +74 -0
- package/lib/components/teams/sceneTranscript.js +294 -0
- package/lib/components/teams/teamConnections.d.ts +2 -2
- package/lib/components/teams/teamConnections.js +3 -3
- package/lib/components/teams/useA2ATeam.d.ts +4 -4
- package/lib/components/teams/useA2ATeam.js +50 -46
- package/lib/examples/AgentA2ATeamExample.d.ts +10 -9
- package/lib/examples/AgentA2ATeamExample.js +70 -60
- package/lib/examples/AssistantExample.js +2 -2
- package/lib/loop/apps/AppComposer.d.ts +40 -4
- package/lib/loop/apps/AppComposer.js +194 -19
- package/lib/loop/apps/AppRenderer.d.ts +21 -3
- package/lib/loop/apps/AppRenderer.js +88 -48
- package/lib/loop/apps/appspec.d.ts +13 -1
- package/lib/loop/apps/appspec.js +305 -12
- package/lib/loop/apps/checks.d.ts +14 -0
- package/lib/loop/apps/checks.js +276 -5
- package/lib/loop/apps/composer.d.ts +21 -10
- package/lib/loop/apps/composer.js +41 -8
- package/lib/loop/apps/customComponents.d.ts +41 -0
- package/lib/loop/apps/customComponents.js +260 -0
- package/lib/loop/apps/hostTools.d.ts +8 -1
- package/lib/loop/apps/hostTools.js +9 -0
- package/lib/loop/apps/index.d.ts +1 -0
- package/lib/loop/apps/index.js +1 -0
- package/lib/loop/apps/language.d.ts +68 -0
- package/lib/loop/apps/language.js +275 -0
- package/lib/loop/apps/settingsInputs.d.ts +29 -0
- package/lib/loop/apps/settingsInputs.js +147 -0
- package/lib/loop/apps/uploads.d.ts +43 -0
- package/lib/loop/apps/uploads.js +66 -0
- package/lib/loop/core/a2uiComponents.d.ts +10 -0
- package/lib/loop/core/a2uiComponents.js +15 -0
- package/lib/loop/core/index.d.ts +15 -1
- package/lib/loop/core/index.js +3 -0
- package/lib/loop/embed/AppEmbed.d.ts +25 -3
- package/lib/loop/embed/AppEmbed.js +106 -18
- package/lib/loop/embed/element.d.ts +5 -0
- package/lib/loop/embed/element.js +84 -5
- package/lib/loop/embed/embedConfig.d.ts +8 -0
- package/lib/loop/embed/embedConfig.js +18 -0
- package/lib/loop/embed/embedSession.d.ts +14 -0
- package/lib/loop/embed/embedSession.js +34 -0
- package/lib/loop/embed/hostBridge.d.ts +50 -3
- package/lib/loop/embed/hostBridge.js +22 -2
- package/lib/loop/index.d.ts +4 -3
- package/lib/loop/index.js +4 -3
- package/lib/loop/plugins/a2ui-surface/InlineSurface.d.ts +7 -1
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +7 -2
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +4 -1
- package/lib/loop/plugins/a2ui-surface/ownComponents.d.ts +6 -0
- package/lib/loop/plugins/a2ui-surface/ownComponents.js +30 -0
- package/lib/loop/plugins/app-components/index.d.ts +26 -0
- package/lib/loop/plugins/app-components/index.js +56 -0
- package/lib/loop/plugins/app-elements/AppElements.d.ts +27 -0
- package/lib/loop/plugins/app-elements/AppElements.js +79 -0
- package/lib/loop/plugins/app-elements/index.d.ts +20 -0
- package/lib/loop/plugins/app-elements/index.js +43 -0
- package/lib/loop/plugins/app-page/AppPage.d.ts +9 -0
- package/lib/loop/plugins/app-page/AppPage.js +106 -8
- package/lib/loop/plugins/app-page/appPageModel.d.ts +17 -1
- package/lib/loop/plugins/app-page/appPageModel.js +122 -4
- package/lib/loop/plugins/app-page/index.d.ts +1 -0
- package/lib/loop/plugins/app-page/index.js +1 -0
- package/lib/loop/plugins/app-page/pageRun.d.ts +46 -0
- package/lib/loop/plugins/app-page/pageRun.js +111 -0
- package/lib/loop/plugins/assistant/index.js +8 -6
- package/lib/loop/plugins/chat/ChatView.js +16 -6
- package/lib/loop/plugins/chat/index.d.ts +1 -1
- package/lib/loop/plugins/chat/index.js +2 -1
- package/lib/models/PageTag.d.ts +1 -1
- package/lib/protocols/BrowserAgentAdapter.d.ts +8 -6
- package/lib/protocols/BrowserAgentAdapter.js +13 -10
- package/lib/runtimes/browser/a2aPeer.d.ts +2 -1
- package/lib/runtimes/browser/protocol.d.ts +1 -1
- package/lib/specs/actions.js +78 -1
- package/lib/specs/apps.d.ts +5 -0
- package/lib/specs/apps.js +1518 -216
- package/lib/specs/appspecSchema.js +630 -3
- package/lib/specs/teams/teams.d.ts +3 -0
- package/lib/specs/teams/teams.js +249 -0
- package/lib/specs/uiPlugins.js +6 -1
- package/lib/types/agentspecs.d.ts +200 -1
- package/lib/types/chat.d.ts +6 -5
- package/lib/types/teams.d.ts +13 -2
- package/package.json +2 -2
- package/scripts/codegen/generate_apps.py +20 -2
- package/scripts/codegen/generate_teams.py +15 -2
- package/lib/components/inspector/JsonTree.d.ts +0 -24
- package/lib/components/inspector/JsonTree.js +0 -89
- package/lib/components/inspector/a2aInspect.d.ts +0 -56
- package/lib/components/inspector/a2aInspect.js +0 -478
- package/lib/components/inspector/agentInspector.d.ts +0 -179
- package/lib/components/inspector/agentInspector.js +0 -267
- package/lib/components/inspector/chatInspect.d.ts +0 -38
- package/lib/components/inspector/chatInspect.js +0 -65
|
@@ -54,6 +54,8 @@ CAMEL = {
|
|
|
54
54
|
"decision_model": "decisionModel",
|
|
55
55
|
"backend_tools": "backendTools",
|
|
56
56
|
"character_alone": "characterAlone",
|
|
57
|
+
"settings_ui": "settingsUi",
|
|
58
|
+
"custom_components": "customComponents",
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
#: The keys whose value is carried as it is written: a component tree, weights by name.
|
|
@@ -110,6 +112,24 @@ def load_specs(specs_dir: Path) -> tuple[list[dict[str, Any]], dict[str, Any]]:
|
|
|
110
112
|
if isinstance(rule["applies_to"], str)
|
|
111
113
|
else rule["applies_to"]
|
|
112
114
|
)
|
|
115
|
+
# A starter offered under a category names it; the others say nothing of it.
|
|
116
|
+
for starter in [
|
|
117
|
+
*spec["interface"]["starters"],
|
|
118
|
+
*(
|
|
119
|
+
item
|
|
120
|
+
for profile in spec["interface"]["profiles"]
|
|
121
|
+
for item in profile["starters"]
|
|
122
|
+
),
|
|
123
|
+
]:
|
|
124
|
+
if not starter.get("category"):
|
|
125
|
+
starter.pop("category", None)
|
|
126
|
+
# A case decided by code names it; the others say nothing of it.
|
|
127
|
+
for case in spec["tests"]["cases"]:
|
|
128
|
+
if not case.get("code"):
|
|
129
|
+
case.pop("code", None)
|
|
130
|
+
# Components of its own: said only when it has some.
|
|
131
|
+
if not spec["interface"].get("custom_components"):
|
|
132
|
+
spec["interface"].pop("custom_components", None)
|
|
113
133
|
for key in ("description", "instructions", "goal"):
|
|
114
134
|
spec[key] = _flat(spec.get(key))
|
|
115
135
|
spec["interface"]["welcome"] = _flat(spec["interface"].get("welcome"))
|
|
@@ -476,8 +496,6 @@ def generate_schema_typescript_code() -> str:
|
|
|
476
496
|
" * @module specs/appspecSchema",
|
|
477
497
|
" */",
|
|
478
498
|
"",
|
|
479
|
-
"/* eslint-disable */",
|
|
480
|
-
"",
|
|
481
499
|
"export type JsonSchema = {",
|
|
482
500
|
" [key: string]: unknown;",
|
|
483
501
|
" type?: string;",
|
|
@@ -151,6 +151,8 @@ def _generate_team_agent_py(agent: Dict[str, Any]) -> str:
|
|
|
151
151
|
# emitted only when said, as a team of agents says none of them.
|
|
152
152
|
if agent.get("app"):
|
|
153
153
|
lines.append(f' app="{agent["app"]}",')
|
|
154
|
+
if agent.get("server"):
|
|
155
|
+
lines.append(f' server="{agent["server"]}",')
|
|
154
156
|
if agent.get("runs_in"):
|
|
155
157
|
lines.append(f' runs_in="{agent["runs_in"]}",')
|
|
156
158
|
links = agent.get("talks_to") or []
|
|
@@ -220,6 +222,7 @@ def _generate_team_agent_ts(agent: Dict[str, Any]) -> str:
|
|
|
220
222
|
links = agent.get("talks_to") or []
|
|
221
223
|
application = (
|
|
222
224
|
(f"\n app: '{agent['app']}'," if agent.get("app") else "")
|
|
225
|
+
+ (f"\n server: '{agent['server']}'," if agent.get("server") else "")
|
|
223
226
|
+ (f"\n runsIn: '{agent['runs_in']}'," if agent.get("runs_in") else "")
|
|
224
227
|
+ (
|
|
225
228
|
"\n talksTo: ["
|
|
@@ -484,10 +487,14 @@ from agent_runtimes.types import (
|
|
|
484
487
|
# `shared` by default: routing only makes sense if the member
|
|
485
488
|
# receiving the work can see what was already said.
|
|
486
489
|
context = spec.get("context") or {}
|
|
490
|
+
# The Frames of its shared context (LOOP A-04): written only when
|
|
491
|
+
# it names some, as the parser reads it.
|
|
492
|
+
frames = context.get("frames") or []
|
|
487
493
|
code += (
|
|
488
494
|
" context=TeamContextSpec("
|
|
489
495
|
f'sharing="{context.get("sharing", "shared")}"'
|
|
490
|
-
")
|
|
496
|
+
+ (f", frames={_fmt_list(frames)}" if frames else "")
|
|
497
|
+
+ "),\n"
|
|
491
498
|
)
|
|
492
499
|
code += f" validation={validation_code},\n"
|
|
493
500
|
code += f" agents={agents_code},\n"
|
|
@@ -778,7 +785,13 @@ import type {{ TeamSpec }} from '{types_import_path}';
|
|
|
778
785
|
" },\n"
|
|
779
786
|
)
|
|
780
787
|
context = spec.get("context") or {}
|
|
781
|
-
|
|
788
|
+
frames = context.get("frames") or []
|
|
789
|
+
frames_ts = (
|
|
790
|
+
", frames: [" + ", ".join(f"'{frame}'" for frame in frames) + "]"
|
|
791
|
+
if frames
|
|
792
|
+
else ""
|
|
793
|
+
)
|
|
794
|
+
code += f" context: {{ sharing: '{context.get('sharing', 'shared')}'{frames_ts} }},\n"
|
|
782
795
|
code += f" validation: {validation_ts},\n"
|
|
783
796
|
code += f" agents: {agents_ts},\n"
|
|
784
797
|
if rr_ts is not None:
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A JSON value as a tree: objects and arrays fold and unfold, each value
|
|
3
|
-
* coloured by its type (theme colours, light and dark), long strings cut
|
|
4
|
-
* until asked for whole, and the whole value copied as JSON.
|
|
5
|
-
*
|
|
6
|
-
* @module components/inspector/JsonTree
|
|
7
|
-
*/
|
|
8
|
-
import type { JSX } from 'react';
|
|
9
|
-
export type JsonTreeProps = {
|
|
10
|
-
value: unknown;
|
|
11
|
-
/** The root's name, shown as its key. */
|
|
12
|
-
name?: string;
|
|
13
|
-
/** How many levels open at first. */
|
|
14
|
-
expandDepth?: number;
|
|
15
|
-
/** Offer *Copy JSON* above the tree. */
|
|
16
|
-
copyable?: boolean;
|
|
17
|
-
/** Longer strings are cut until clicked. */
|
|
18
|
-
stringLimit?: number;
|
|
19
|
-
};
|
|
20
|
-
/** A value's type, as the tree colours it. */
|
|
21
|
-
export declare function jsonType(value: unknown): 'string' | 'number' | 'boolean' | 'null' | 'array' | 'object' | 'undefined';
|
|
22
|
-
/** A JSON value, as a tree. */
|
|
23
|
-
export declare function JsonTree({ value, name, expandDepth, copyable, stringLimit, }: JsonTreeProps): JSX.Element;
|
|
24
|
-
export default JsonTree;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
import { Button, Text } from '@primer/react';
|
|
4
|
-
import { Box } from '@datalayer/primer-addons';
|
|
5
|
-
import { CopyIcon, CheckIcon } from '@primer/octicons-react';
|
|
6
|
-
const MONO = 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace';
|
|
7
|
-
/** A value's type, as the tree colours it. */
|
|
8
|
-
export function jsonType(value) {
|
|
9
|
-
if (value === null) {
|
|
10
|
-
return 'null';
|
|
11
|
-
}
|
|
12
|
-
if (Array.isArray(value)) {
|
|
13
|
-
return 'array';
|
|
14
|
-
}
|
|
15
|
-
const type = typeof value;
|
|
16
|
-
if (type === 'string' || type === 'number' || type === 'boolean') {
|
|
17
|
-
return type;
|
|
18
|
-
}
|
|
19
|
-
if (type === 'bigint') {
|
|
20
|
-
return 'number';
|
|
21
|
-
}
|
|
22
|
-
return type === 'undefined' ? 'undefined' : 'object';
|
|
23
|
-
}
|
|
24
|
-
const COLOURS = {
|
|
25
|
-
string: 'success.fg',
|
|
26
|
-
number: 'accent.fg',
|
|
27
|
-
boolean: 'done.fg',
|
|
28
|
-
null: 'fg.muted',
|
|
29
|
-
undefined: 'fg.muted',
|
|
30
|
-
};
|
|
31
|
-
function Leaf({ value, stringLimit, }) {
|
|
32
|
-
const type = jsonType(value);
|
|
33
|
-
const [whole, setWhole] = useState(false);
|
|
34
|
-
if (type === 'string') {
|
|
35
|
-
const text = value;
|
|
36
|
-
const cut = !whole && text.length > stringLimit;
|
|
37
|
-
return (_jsxs(Text, { "data-json-type": "string", sx: {
|
|
38
|
-
color: COLOURS.string,
|
|
39
|
-
whiteSpace: 'pre-wrap',
|
|
40
|
-
wordBreak: 'break-word',
|
|
41
|
-
}, children: [JSON.stringify(cut ? text.slice(0, stringLimit) : text), cut && (_jsxs(Box, { as: "button", type: "button", onClick: () => setWhole(true), sx: {
|
|
42
|
-
ml: 1,
|
|
43
|
-
p: 0,
|
|
44
|
-
border: 0,
|
|
45
|
-
bg: 'transparent',
|
|
46
|
-
color: 'accent.fg',
|
|
47
|
-
cursor: 'pointer',
|
|
48
|
-
font: 'inherit',
|
|
49
|
-
}, children: ["\u2026 ", text.length - stringLimit, " more"] }))] }));
|
|
50
|
-
}
|
|
51
|
-
return (_jsx(Text, { "data-json-type": type, sx: { color: COLOURS[type] ?? 'fg.default' }, children: type === 'undefined' ? 'undefined' : String(value) }));
|
|
52
|
-
}
|
|
53
|
-
function Node({ name, value, depth, expandDepth, stringLimit, }) {
|
|
54
|
-
const type = jsonType(value);
|
|
55
|
-
const branch = type === 'array' || type === 'object';
|
|
56
|
-
const [open, setOpen] = useState(depth < expandDepth);
|
|
57
|
-
const key = name !== undefined ? (_jsxs(Text, { sx: { color: 'fg.default', fontWeight: 600 }, children: [name, ": "] })) : null;
|
|
58
|
-
if (!branch) {
|
|
59
|
-
return (_jsxs(Box, { role: "treeitem", "data-json-node": "", sx: { pl: 3 }, children: [key, _jsx(Leaf, { value: value, stringLimit: stringLimit })] }));
|
|
60
|
-
}
|
|
61
|
-
const items = type === 'array'
|
|
62
|
-
? value.map((item, index) => [String(index), item])
|
|
63
|
-
: Object.entries(value);
|
|
64
|
-
const [openMark, closeMark] = type === 'array' ? ['[', ']'] : ['{', '}'];
|
|
65
|
-
return (_jsxs(Box, { role: "treeitem", "aria-expanded": open, "data-json-node": "", sx: { pl: depth ? 3 : 0 }, children: [_jsxs(Box, { as: "button", type: "button", onClick: () => setOpen(!open), "aria-label": `${open ? 'Fold' : 'Unfold'} ${name ?? 'the value'}`, "data-json-toggle": "", sx: {
|
|
66
|
-
p: 0,
|
|
67
|
-
border: 0,
|
|
68
|
-
bg: 'transparent',
|
|
69
|
-
color: 'inherit',
|
|
70
|
-
font: 'inherit',
|
|
71
|
-
cursor: 'pointer',
|
|
72
|
-
textAlign: 'left',
|
|
73
|
-
}, children: [_jsx(Text, { sx: { color: 'fg.muted', display: 'inline-block', width: '1em' }, children: open ? '▾' : '▸' }), key, _jsx(Text, { sx: { color: 'fg.muted' }, children: open
|
|
74
|
-
? openMark
|
|
75
|
-
: `${openMark} ${items.length} ${type === 'array' ? (items.length === 1 ? 'item' : 'items') : items.length === 1 ? 'key' : 'keys'} ${closeMark}` })] }), open && (_jsxs(Box, { role: "group", children: [items.map(([itemName, item]) => (_jsx(Node, { name: itemName, value: item, depth: depth + 1, expandDepth: expandDepth, stringLimit: stringLimit }, itemName))), _jsx(Text, { sx: { color: 'fg.muted', pl: 3 }, children: closeMark })] }))] }));
|
|
76
|
-
}
|
|
77
|
-
/** A JSON value, as a tree. */
|
|
78
|
-
export function JsonTree({ value, name, expandDepth = 1, copyable = true, stringLimit = 240, }) {
|
|
79
|
-
const [copied, setCopied] = useState(false);
|
|
80
|
-
const copy = () => {
|
|
81
|
-
const text = JSON.stringify(value, null, 2) ?? 'undefined';
|
|
82
|
-
void navigator.clipboard?.writeText(text).then(() => {
|
|
83
|
-
setCopied(true);
|
|
84
|
-
setTimeout(() => setCopied(false), 1500);
|
|
85
|
-
}, () => undefined);
|
|
86
|
-
};
|
|
87
|
-
return (_jsxs(Box, { "data-json-tree": "", sx: { fontFamily: MONO, fontSize: 0, lineHeight: 1.6, minWidth: 0 }, children: [copyable && (_jsx(Button, { size: "small", variant: "invisible", leadingVisual: copied ? CheckIcon : CopyIcon, onClick: copy, "data-json-copy": "", sx: { float: 'right' }, children: copied ? 'Copied' : 'Copy JSON' })), _jsx(Box, { role: "tree", "aria-label": name ?? 'JSON', children: _jsx(Node, { name: name, value: value, depth: 0, expandDepth: expandDepth, stringLimit: stringLimit }) })] }));
|
|
88
|
-
}
|
|
89
|
-
export default JsonTree;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The A2A traffic between two agents, as the Agent Inspector records it: a
|
|
3
|
-
* fetch that hands every request on and records what went (the JSON-RPC
|
|
4
|
-
* request: its method, its message) and what came back — a JSON-RPC
|
|
5
|
-
* response, or each server-sent event of a stream (the task, its status
|
|
6
|
-
* updates, its artifact updates, a message) — with its task, context and
|
|
7
|
-
* state, whole.
|
|
8
|
-
*
|
|
9
|
-
* It sits under the A2A SDK (`ClientFactory`'s `JsonRpcTransportFactory`
|
|
10
|
-
* takes a `fetchImpl`): the SDK reads the response it is handed, and the
|
|
11
|
-
* inspector reads a copy of its body. Nothing it records changes what the
|
|
12
|
-
* SDK sees, and a key sent as a header is never recorded.
|
|
13
|
-
*
|
|
14
|
-
* A peer served by agent-runtimes tells each tool call of its agent on a
|
|
15
|
-
* `working` status (`{tool_call}`, then `{tool_result}`): each call is
|
|
16
|
-
* recorded besides as one entry of its own, the peer's, from its start to
|
|
17
|
-
* its end, linked to the two statuses — an MCP call, a skill, or a tool its
|
|
18
|
-
* runtime runs, by who claims its name. The text chunks of one artifact are
|
|
19
|
-
* one entry, their count kept.
|
|
20
|
-
*
|
|
21
|
-
* {@link linkA2APeerEvent} attaches what the asker made of an event (an
|
|
22
|
-
* `A2APeerEvent`) to the entry it came from.
|
|
23
|
-
*
|
|
24
|
-
* @module components/inspector/a2aInspect
|
|
25
|
-
*/
|
|
26
|
-
import type { A2APeerEvent } from '../../runtimes/browser/a2aPeer';
|
|
27
|
-
import { type AgentInspectorEntry, type AgentInspectorSink, type ToolClass } from './agentInspector';
|
|
28
|
-
export type A2AInspectOptions = {
|
|
29
|
-
sink: AgentInspectorSink;
|
|
30
|
-
/** The agent that asks: `Sales`. */
|
|
31
|
-
asker: string;
|
|
32
|
-
/** The agent asked: `Accounting`. */
|
|
33
|
-
peer: string;
|
|
34
|
-
/**
|
|
35
|
-
* Where a peer's tool call comes from — an MCP server's, a skill, … — and
|
|
36
|
-
* its mark (`classifyToolCall`, or a team's `teamToolClassifier`).
|
|
37
|
-
* Without it, a tool the peer's runtime runs (`backend-tool`).
|
|
38
|
-
*/
|
|
39
|
-
classifyTool?: (name: string, args?: Record<string, unknown>) => ToolClass;
|
|
40
|
-
};
|
|
41
|
-
/** The text of an A2A 1.0 message's or artifact's parts, as JSON carries them. */
|
|
42
|
-
export declare function partsText(parts: unknown): string;
|
|
43
|
-
/** `TASK_STATE_WORKING` is `working`. */
|
|
44
|
-
export declare function stateWord(state: unknown): string;
|
|
45
|
-
/**
|
|
46
|
-
* A fetch that records the A2A traffic it carries into `options.sink`, and
|
|
47
|
-
* hands the SDK what the network gave.
|
|
48
|
-
*/
|
|
49
|
-
export declare function inspectA2AFetch(base: typeof globalThis.fetch, options: A2AInspectOptions): typeof globalThis.fetch;
|
|
50
|
-
/**
|
|
51
|
-
* The linker the A2A capture adds to its sink: an `A2APeerEvent` noted
|
|
52
|
-
* (`sink.note`) is attached to the entry it came from.
|
|
53
|
-
*/
|
|
54
|
-
export declare function a2aEventLinker(event: unknown): ((entry: AgentInspectorEntry) => boolean) | undefined;
|
|
55
|
-
/** Attach what the asker made of an event to the A2A entry it came from. */
|
|
56
|
-
export declare function linkA2APeerEvent(sink: AgentInspectorSink, event: A2APeerEvent): void;
|