@datalayer/agent-runtimes 0.0.7 → 0.0.9
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 +9 -0
- package/lib/components/chat/components/AgentDetails.d.ts +14 -1
- package/lib/components/chat/components/AgentDetails.js +3 -2
- package/lib/components/chat/components/AgentIdentity.d.ts +92 -0
- package/lib/components/chat/components/AgentIdentity.js +318 -0
- package/lib/components/chat/components/Chat.d.ts +20 -1
- package/lib/components/chat/components/Chat.js +16 -3
- package/lib/components/chat/components/ChatFloating.d.ts +6 -1
- package/lib/components/chat/components/ChatFloating.js +12 -6
- package/lib/components/chat/components/base/ChatBase.d.ts +47 -1
- package/lib/components/chat/components/base/ChatBase.js +242 -63
- package/lib/components/chat/components/display/ToolCallDisplay.d.ts +16 -2
- package/lib/components/chat/components/display/ToolCallDisplay.js +148 -6
- package/lib/components/chat/components/display/index.d.ts +1 -1
- package/lib/components/chat/components/display/index.js +1 -1
- package/lib/components/chat/components/elements/ChatInputPrompt.d.ts +12 -1
- package/lib/components/chat/components/elements/ChatInputPrompt.js +8 -3
- package/lib/components/chat/components/index.d.ts +1 -0
- package/lib/components/chat/components/index.js +1 -0
- package/lib/components/chat/components/parts/ToolPart.d.ts +1 -1
- package/lib/components/chat/components/parts/ToolPart.js +142 -6
- package/lib/components/chat/index.d.ts +1 -1
- package/lib/components/chat/index.js +1 -1
- package/lib/components/chat/protocols/A2AAdapter.d.ts +9 -0
- package/lib/components/chat/protocols/A2AAdapter.js +13 -2
- package/lib/components/chat/protocols/ACPAdapter.d.ts +9 -0
- package/lib/components/chat/protocols/ACPAdapter.js +13 -2
- package/lib/components/chat/protocols/AGUIAdapter.d.ts +9 -0
- package/lib/components/chat/protocols/AGUIAdapter.js +19 -1
- package/lib/components/chat/protocols/VercelAIAdapter.d.ts +7 -0
- package/lib/components/chat/protocols/VercelAIAdapter.js +19 -0
- package/lib/components/chat/types/execution.d.ts +78 -0
- package/lib/components/chat/types/execution.js +64 -0
- package/lib/components/chat/types/index.d.ts +1 -0
- package/lib/components/chat/types/index.js +1 -0
- package/lib/components/chat/types/protocol.d.ts +9 -0
- package/lib/components/ui/pagination.d.ts +2 -2
- package/lib/components/ui/pagination.js +4 -4
- package/lib/components/ui/resizable.d.ts +4 -4
- package/lib/components/ui/resizable.js +4 -4
- package/lib/examples/A2UiRestaurantExample.js +2 -2
- package/lib/examples/AgUiAgenticExample.js +2 -2
- package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
- package/lib/examples/AgUiHaikuGenUIExample.js +2 -2
- package/lib/examples/AgUiHumanInTheLoopExample.js +2 -2
- package/lib/examples/AgUiSharedStateExample.js +2 -2
- package/lib/examples/AgUiToolsBasedGenUIExample.js +2 -2
- package/lib/examples/AgentRuntimeCustomExample.js +2 -2
- package/lib/examples/AgentRuntimeLexical2Example.js +2 -1
- package/lib/examples/AgentRuntimeLexicalExample.js +5 -2
- package/lib/examples/AgentRuntimeLexicalSidebarExample.js +4 -2
- package/lib/examples/AgentRuntimeNotebookExample.js +1 -1
- package/lib/examples/AgentRuntimeStandaloneExample.js +2 -2
- package/lib/examples/AgentSpaceFormExample.d.ts +70 -2
- package/lib/examples/AgentSpaceFormExample.js +177 -43
- package/lib/examples/CopilotKitLexicalExample.js +2 -1
- package/lib/examples/components/AgentConfiguration.d.ts +17 -2
- package/lib/examples/components/AgentConfiguration.js +220 -16
- package/lib/examples/components/LexicalEditor.js +2 -1
- package/lib/examples/components/MockFileBrowser.js +6 -2
- package/lib/examples/components/index.d.ts +0 -1
- package/lib/examples/components/index.js +0 -1
- package/lib/examples/example-selector.js +0 -1
- package/lib/examples/index.d.ts +0 -1
- package/lib/examples/index.js +0 -1
- package/lib/examples/lexical/editorConfig.d.ts +3 -2
- package/lib/examples/lexical/editorConfig.js +7 -1
- package/lib/examples/lexical/initial-content.json +2210 -0
- package/lib/examples/main.js +15 -1
- package/lib/identity/IdentityConnect.d.ts +90 -0
- package/lib/identity/IdentityConnect.js +316 -0
- package/lib/identity/OAuthCallback.d.ts +58 -0
- package/lib/identity/OAuthCallback.js +223 -0
- package/lib/identity/dcr.d.ts +257 -0
- package/lib/identity/dcr.js +282 -0
- package/lib/identity/identityStore.d.ts +72 -0
- package/lib/identity/identityStore.js +529 -0
- package/lib/identity/index.d.ts +46 -0
- package/lib/identity/index.js +17 -0
- package/lib/identity/pkce.d.ts +30 -0
- package/lib/identity/pkce.js +65 -0
- package/lib/identity/types.d.ts +293 -0
- package/lib/identity/types.js +73 -0
- package/lib/identity/useIdentity.d.ts +108 -0
- package/lib/identity/useIdentity.js +323 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/lib/utils.js +1 -1
- package/lib/renderers/a2ui/lib/utils.js +1 -1
- package/lib/test-setup.d.ts +1 -1
- package/lib/test-setup.js +1 -0
- package/lib/tools/adapters/agent-runtimes/AgentRuntimesToolAdapter.js +32 -1
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.d.ts +6 -0
- package/lib/tools/adapters/agent-runtimes/lexicalHooks.js +16 -17
- package/package.json +20 -7
- package/patches/@datalayer+jupyter-lexical+1.0.8.patch +11628 -0
- package/patches/@datalayer+jupyter-react+2.0.2.patch +5338 -0
- package/scripts/apply-patches.sh +32 -0
- package/lib/examples/AgentSpaceHomeExample.d.ts +0 -8
- package/lib/examples/AgentSpaceHomeExample.js +0 -171
- package/lib/examples/components/AgentsDataTable.d.ts +0 -13
- package/lib/examples/components/AgentsDataTable.js +0 -74
- package/lib/examples/components/Rating.d.ts +0 -14
- package/lib/examples/components/Rating.js +0 -12
package/scripts/apply-patches.sh
CHANGED
|
@@ -11,6 +11,7 @@ set -e
|
|
|
11
11
|
# Colors for output
|
|
12
12
|
GREEN='\033[0;32m'
|
|
13
13
|
BLUE='\033[0;34m'
|
|
14
|
+
YELLOW='\033[0;33m'
|
|
14
15
|
NC='\033[0m' # No Color
|
|
15
16
|
|
|
16
17
|
echo -e "${BLUE}📝 Applying patches...${NC}"
|
|
@@ -21,6 +22,37 @@ CORE_ROOT="$( cd "$SCRIPT_DIR/.." && pwd )"
|
|
|
21
22
|
|
|
22
23
|
cd "$CORE_ROOT"
|
|
23
24
|
|
|
25
|
+
# Check if patches directory has any patch files (excluding .gitkeep)
|
|
26
|
+
PATCH_COUNT=$(find patches -name "*.patch" 2>/dev/null | wc -l)
|
|
27
|
+
|
|
28
|
+
if [ "$PATCH_COUNT" -eq 0 ]; then
|
|
29
|
+
echo -e "${YELLOW}⏭️ No patches to apply${NC}"
|
|
30
|
+
exit 0
|
|
31
|
+
fi
|
|
32
|
+
|
|
33
|
+
# Check if required packages exist in node_modules
|
|
34
|
+
# In a monorepo, packages may be hoisted to root node_modules
|
|
35
|
+
MISSING_PACKAGES=false
|
|
36
|
+
|
|
37
|
+
for patch_file in patches/*.patch; do
|
|
38
|
+
if [ -f "$patch_file" ]; then
|
|
39
|
+
# Extract package name from patch filename (e.g., @datalayer+jupyter-lexical+1.0.8.patch)
|
|
40
|
+
filename=$(basename "$patch_file")
|
|
41
|
+
# Handle scoped packages: @datalayer+jupyter-lexical+1.0.8.patch -> @datalayer/jupyter-lexical
|
|
42
|
+
pkg_name=$(echo "$filename" | sed 's/+/\//; s/+.*//')
|
|
43
|
+
|
|
44
|
+
if [ ! -d "node_modules/$pkg_name" ]; then
|
|
45
|
+
echo -e "${YELLOW}⚠️ Package $pkg_name not found in local node_modules (may be hoisted in monorepo)${NC}"
|
|
46
|
+
MISSING_PACKAGES=true
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
if [ "$MISSING_PACKAGES" = true ]; then
|
|
52
|
+
echo -e "${YELLOW}⏭️ Skipping patches - packages not in local node_modules (monorepo setup)${NC}"
|
|
53
|
+
exit 0
|
|
54
|
+
fi
|
|
55
|
+
|
|
24
56
|
npx patch-package
|
|
25
57
|
|
|
26
58
|
echo -e "${GREEN}✅ Patches applied successfully${NC}"
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
4
|
-
* Distributed under the terms of the Modified BSD License.
|
|
5
|
-
*/
|
|
6
|
-
import { useState } from 'react';
|
|
7
|
-
import { PageHeader, Button, TextInput, ActionMenu, ActionList, Box, Avatar, SegmentedControl, } from '@primer/react';
|
|
8
|
-
import { PlusIcon, SearchIcon, KebabHorizontalIcon, TriangleDownIcon, CircleIcon, PauseIcon, } from '@primer/octicons-react';
|
|
9
|
-
import { datalayerTheme, DatalayerThemeProvider } from '@datalayer/core';
|
|
10
|
-
import { useAgentsStore } from './stores/examplesStore';
|
|
11
|
-
import { AgentsDataTable } from './components/AgentsDataTable';
|
|
12
|
-
import { Rating } from './components/Rating';
|
|
13
|
-
const AgentTile = ({ type, title, description, author, lastEdited, screenshot, status, avatarUrl, stars = 0, notifications = 0, onClick, }) => {
|
|
14
|
-
if (type === 'create') {
|
|
15
|
-
return (_jsxs(Box, { onClick: onClick, style: {
|
|
16
|
-
width: '300px',
|
|
17
|
-
height: '200px',
|
|
18
|
-
border: '2px dashed var(--borderColor-default)',
|
|
19
|
-
borderRadius: '8px',
|
|
20
|
-
display: 'flex',
|
|
21
|
-
flexDirection: 'column',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
justifyContent: 'center',
|
|
24
|
-
cursor: 'pointer',
|
|
25
|
-
transition: 'all 0.2s',
|
|
26
|
-
background: 'var(--bgColor-default)',
|
|
27
|
-
}, onMouseEnter: e => {
|
|
28
|
-
e.currentTarget.style.borderColor =
|
|
29
|
-
'var(--borderColor-accent-emphasis)';
|
|
30
|
-
e.currentTarget.style.background = 'var(--bgColor-muted)';
|
|
31
|
-
}, onMouseLeave: e => {
|
|
32
|
-
e.currentTarget.style.borderColor = 'var(--borderColor-default)';
|
|
33
|
-
e.currentTarget.style.background = 'var(--bgColor-default)';
|
|
34
|
-
}, children: [_jsx(Box, { style: { color: 'var(--fgColor-muted)' }, children: _jsx(PlusIcon, { size: 48 }) }), _jsx(Box, { style: {
|
|
35
|
-
marginTop: '12px',
|
|
36
|
-
fontSize: '14px',
|
|
37
|
-
color: 'var(--fgColor-muted)',
|
|
38
|
-
fontWeight: 600,
|
|
39
|
-
}, children: "Create new agent space" })] }));
|
|
40
|
-
}
|
|
41
|
-
return (_jsxs(Box, { onClick: onClick, style: {
|
|
42
|
-
width: '300px',
|
|
43
|
-
border: '1px solid var(--borderColor-default)',
|
|
44
|
-
borderRadius: '8px',
|
|
45
|
-
overflow: 'visible',
|
|
46
|
-
cursor: 'pointer',
|
|
47
|
-
transition: 'all 0.2s',
|
|
48
|
-
background: 'var(--bgColor-default)',
|
|
49
|
-
position: 'relative',
|
|
50
|
-
}, onMouseEnter: e => {
|
|
51
|
-
e.currentTarget.style.boxShadow = '0 4px 12px rgba(0,0,0,0.1)';
|
|
52
|
-
e.currentTarget.style.transform = 'translateY(-2px)';
|
|
53
|
-
}, onMouseLeave: e => {
|
|
54
|
-
e.currentTarget.style.boxShadow = 'none';
|
|
55
|
-
e.currentTarget.style.transform = 'translateY(0)';
|
|
56
|
-
}, children: [notifications > 0 && (_jsx(Box, { style: {
|
|
57
|
-
position: 'absolute',
|
|
58
|
-
top: '-8px',
|
|
59
|
-
right: '-8px',
|
|
60
|
-
minWidth: '24px',
|
|
61
|
-
height: '24px',
|
|
62
|
-
padding: '0 6px',
|
|
63
|
-
borderRadius: '12px',
|
|
64
|
-
background: '#ef4444',
|
|
65
|
-
color: 'white',
|
|
66
|
-
fontSize: '13px',
|
|
67
|
-
fontWeight: 700,
|
|
68
|
-
display: 'flex',
|
|
69
|
-
alignItems: 'center',
|
|
70
|
-
justifyContent: 'center',
|
|
71
|
-
boxShadow: '0 2px 8px rgba(0,0,0,0.3)',
|
|
72
|
-
border: '2px solid var(--bgColor-default)',
|
|
73
|
-
zIndex: 10,
|
|
74
|
-
}, children: notifications })), _jsxs(Box, { style: {
|
|
75
|
-
width: '100%',
|
|
76
|
-
height: '150px',
|
|
77
|
-
background: screenshot
|
|
78
|
-
? `url(${screenshot}) center/cover`
|
|
79
|
-
: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
80
|
-
display: 'flex',
|
|
81
|
-
alignItems: 'center',
|
|
82
|
-
justifyContent: 'center',
|
|
83
|
-
color: 'white',
|
|
84
|
-
fontSize: '18px',
|
|
85
|
-
fontWeight: 600,
|
|
86
|
-
position: 'relative',
|
|
87
|
-
}, children: [!screenshot && title, status && (_jsx(Box, { style: {
|
|
88
|
-
position: 'absolute',
|
|
89
|
-
top: '8px',
|
|
90
|
-
right: '8px',
|
|
91
|
-
display: 'flex',
|
|
92
|
-
alignItems: 'center',
|
|
93
|
-
gap: '4px',
|
|
94
|
-
padding: '4px 8px',
|
|
95
|
-
borderRadius: '4px',
|
|
96
|
-
background: 'rgba(255, 255, 255, 0.9)',
|
|
97
|
-
fontSize: '12px',
|
|
98
|
-
fontWeight: 600,
|
|
99
|
-
color: status === 'running'
|
|
100
|
-
? 'var(--fgColor-success)'
|
|
101
|
-
: 'var(--fgColor-attention)',
|
|
102
|
-
}, children: status === 'running' ? (_jsxs(_Fragment, { children: [_jsx(CircleIcon, { size: 12, fill: "var(--fgColor-success)" }), _jsx("span", { children: "Running" })] })) : (_jsxs(_Fragment, { children: [_jsx(PauseIcon, { size: 12 }), _jsx("span", { children: "Paused" })] })) }))] }), _jsxs(Box, { style: { padding: '12px' }, children: [_jsx(Box, { style: {
|
|
103
|
-
fontSize: '16px',
|
|
104
|
-
fontWeight: 600,
|
|
105
|
-
color: 'var(--fgColor-default)',
|
|
106
|
-
marginBottom: '8px',
|
|
107
|
-
}, children: title }), description && (_jsx(Box, { style: {
|
|
108
|
-
fontSize: '13px',
|
|
109
|
-
color: 'var(--fgColor-muted)',
|
|
110
|
-
marginBottom: '8px',
|
|
111
|
-
lineHeight: '1.4',
|
|
112
|
-
}, children: description })), _jsxs(Box, { style: {
|
|
113
|
-
display: 'flex',
|
|
114
|
-
alignItems: 'center',
|
|
115
|
-
gap: '12px',
|
|
116
|
-
}, children: [avatarUrl && _jsx(Avatar, { src: avatarUrl, size: 40 }), _jsxs(Box, { style: { display: 'flex', flexDirection: 'column', gap: '2px' }, children: [_jsxs(Box, { style: {
|
|
117
|
-
fontSize: '12px',
|
|
118
|
-
color: 'var(--fgColor-muted)',
|
|
119
|
-
}, children: ["by ", author] }), _jsxs(Box, { style: {
|
|
120
|
-
fontSize: '12px',
|
|
121
|
-
color: 'var(--fgColor-muted)',
|
|
122
|
-
}, children: ["Edited ", lastEdited] }), stars > 0 && (_jsx(Box, { style: { marginTop: '4px' }, children: _jsx(Rating, { value: stars, size: 12 }) }))] })] })] })] }));
|
|
123
|
-
};
|
|
124
|
-
/**
|
|
125
|
-
* Agent Runtimes Example Component
|
|
126
|
-
*
|
|
127
|
-
* Displays a page with agent tiles using Primer PageHeader component.
|
|
128
|
-
*/
|
|
129
|
-
const AgentSpaceHomeExample = () => {
|
|
130
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
131
|
-
const [lastEditedFilter, setLastEditedFilter] = useState('Last edited');
|
|
132
|
-
const [visibilityFilter, setVisibilityFilter] = useState('Any visibility');
|
|
133
|
-
const [statusFilter, setStatusFilter] = useState('Any status');
|
|
134
|
-
const [analystFilter, setAnalystFilter] = useState('All analysts');
|
|
135
|
-
const [viewMode, setViewMode] = useState('tiles');
|
|
136
|
-
// Get agents from store
|
|
137
|
-
const agents = useAgentsStore(state => state.agents);
|
|
138
|
-
const handleCreateAgent = () => {
|
|
139
|
-
// Handle create new agent
|
|
140
|
-
};
|
|
141
|
-
const handleAgentClick = (agentName) => {
|
|
142
|
-
// Handle agent click
|
|
143
|
-
void agentName;
|
|
144
|
-
};
|
|
145
|
-
return (_jsx(DatalayerThemeProvider, { theme: datalayerTheme, children: _jsxs(Box, { style: {
|
|
146
|
-
minHeight: '100vh',
|
|
147
|
-
background: 'var(--bgColor-default)',
|
|
148
|
-
padding: '24px',
|
|
149
|
-
}, children: [_jsxs(PageHeader, { role: "banner", "aria-label": "Agent Spaces", sx: { borderBottom: 'none' }, children: [_jsx(PageHeader.TitleArea, { children: _jsx(PageHeader.Title, { children: "Agent Spaces" }) }), _jsx(PageHeader.Actions, { children: _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Anchor, { children: _jsx(Button, { variant: "invisible", leadingVisual: KebabHorizontalIcon, "aria-label": "More options" }) }), _jsx(ActionMenu.Overlay, { children: _jsx(ActionList, { children: _jsx(ActionList.Item, { onSelect: () => {
|
|
150
|
-
// Handle add folder
|
|
151
|
-
}, children: "Add folder" }) }) })] }) })] }), _jsxs(Box, { style: { padding: '24px' }, children: [_jsxs(Box, { style: {
|
|
152
|
-
display: 'flex',
|
|
153
|
-
gap: '12px',
|
|
154
|
-
marginBottom: '24px',
|
|
155
|
-
flexWrap: 'wrap',
|
|
156
|
-
alignItems: 'center',
|
|
157
|
-
justifyContent: 'space-between',
|
|
158
|
-
}, children: [_jsxs(Box, { style: {
|
|
159
|
-
display: 'flex',
|
|
160
|
-
gap: '12px',
|
|
161
|
-
flexWrap: 'wrap',
|
|
162
|
-
alignItems: 'center',
|
|
163
|
-
flex: 1,
|
|
164
|
-
}, children: [_jsx(Box, { style: { flex: '1 1 300px', minWidth: '200px' }, children: _jsx(TextInput, { leadingVisual: SearchIcon, placeholder: "Search agent spaces...", value: searchQuery, onChange: e => setSearchQuery(e.target.value), sx: { width: '100%' } }) }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: lastEditedFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: lastEditedFilter === 'Last edited', onSelect: () => setLastEditedFilter('Last edited'), children: "Last edited" }), _jsx(ActionList.Item, { selected: lastEditedFilter === 'Created date', onSelect: () => setLastEditedFilter('Created date'), children: "Created date" }), _jsx(ActionList.Item, { selected: lastEditedFilter === 'Name', onSelect: () => setLastEditedFilter('Name'), children: "Name" })] }) })] }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: visibilityFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: visibilityFilter === 'Any visibility', onSelect: () => setVisibilityFilter('Any visibility'), children: "Any visibility" }), _jsx(ActionList.Item, { selected: visibilityFilter === 'Public', onSelect: () => setVisibilityFilter('Public'), children: "Public" }), _jsx(ActionList.Item, { selected: visibilityFilter === 'Private', onSelect: () => setVisibilityFilter('Private'), children: "Private" })] }) })] }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: statusFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: statusFilter === 'Any status', onSelect: () => setStatusFilter('Any status'), children: "Any status" }), _jsx(ActionList.Item, { selected: statusFilter === 'Active', onSelect: () => setStatusFilter('Active'), children: "Active" }), _jsx(ActionList.Item, { selected: statusFilter === 'Draft', onSelect: () => setStatusFilter('Draft'), children: "Draft" }), _jsx(ActionList.Item, { selected: statusFilter === 'Archived', onSelect: () => setStatusFilter('Archived'), children: "Archived" })] }) })] }), _jsxs(ActionMenu, { children: [_jsx(ActionMenu.Button, { trailingAction: TriangleDownIcon, children: analystFilter }), _jsx(ActionMenu.Overlay, { children: _jsxs(ActionList, { selectionVariant: "single", children: [_jsx(ActionList.Item, { selected: analystFilter === 'All analysts', onSelect: () => setAnalystFilter('All analysts'), children: "All analysts" }), _jsx(ActionList.Item, { selected: analystFilter === 'Eric Charles', onSelect: () => setAnalystFilter('Eric Charles'), children: "Eric Charles" }), _jsx(ActionList.Item, { selected: analystFilter === 'Other users', onSelect: () => setAnalystFilter('Other users'), children: "Other users" })] }) })] })] }), _jsxs(SegmentedControl, { "aria-label": "View mode", onChange: index => setViewMode(index === 0 ? 'tiles' : 'table'), children: [_jsx(SegmentedControl.Button, { selected: viewMode === 'tiles', children: "Tiles" }), _jsx(SegmentedControl.Button, { selected: viewMode === 'table', children: "Table" })] })] }), viewMode === 'tiles' && (_jsxs(Box, { style: {
|
|
165
|
-
display: 'grid',
|
|
166
|
-
gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))',
|
|
167
|
-
gap: '24px',
|
|
168
|
-
marginBottom: '48px',
|
|
169
|
-
}, children: [_jsx(AgentTile, { type: "create", onClick: handleCreateAgent }), agents.map(agent => (_jsx(AgentTile, { type: "agent", title: agent.name, description: agent.description, author: agent.author, lastEdited: agent.lastEdited, screenshot: agent.screenshot, status: agent.status, avatarUrl: agent.avatarUrl, stars: agent.stars, notifications: agent.notifications, onClick: () => handleAgentClick(agent.name) }, agent.id)))] })), viewMode === 'table' && (_jsx(Box, { children: _jsx(AgentsDataTable, {}) }))] })] }) }));
|
|
170
|
-
};
|
|
171
|
-
export default AgentSpaceHomeExample;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface AgentsDataTableProps {
|
|
3
|
-
onToggleStatus?: (agentId: string) => void;
|
|
4
|
-
showAuthor?: boolean;
|
|
5
|
-
showLastEdited?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Agents Data Table Component
|
|
9
|
-
*
|
|
10
|
-
* Displays agents in a table format with status controls.
|
|
11
|
-
*/
|
|
12
|
-
export declare const AgentsDataTable: React.FC<AgentsDataTableProps>;
|
|
13
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { IconButton, Avatar, Box } from '@primer/react';
|
|
3
|
-
import { PlayIcon, PauseIcon } from '@primer/octicons-react';
|
|
4
|
-
import { useAgentsStore } from '../stores/examplesStore';
|
|
5
|
-
/**
|
|
6
|
-
* Agents Data Table Component
|
|
7
|
-
*
|
|
8
|
-
* Displays agents in a table format with status controls.
|
|
9
|
-
*/
|
|
10
|
-
export const AgentsDataTable = ({ onToggleStatus, showAuthor = true, showLastEdited = true, }) => {
|
|
11
|
-
const agents = useAgentsStore(state => state.agents);
|
|
12
|
-
const toggleAgentStatus = useAgentsStore(state => state.toggleAgentStatus);
|
|
13
|
-
const handleToggle = (agentId) => {
|
|
14
|
-
toggleAgentStatus(agentId);
|
|
15
|
-
onToggleStatus?.(agentId);
|
|
16
|
-
};
|
|
17
|
-
return (_jsx(Box, { sx: {
|
|
18
|
-
border: '1px solid',
|
|
19
|
-
borderColor: 'border.default',
|
|
20
|
-
borderRadius: 2,
|
|
21
|
-
overflow: 'hidden',
|
|
22
|
-
}, children: _jsxs("table", { style: {
|
|
23
|
-
width: '100%',
|
|
24
|
-
borderCollapse: 'collapse',
|
|
25
|
-
}, children: [_jsx("thead", { style: {
|
|
26
|
-
backgroundColor: 'var(--bgColor-muted)',
|
|
27
|
-
borderBottom: '1px solid var(--borderColor-default)',
|
|
28
|
-
}, children: _jsxs("tr", { children: [_jsx("th", { style: {
|
|
29
|
-
padding: '12px 16px',
|
|
30
|
-
textAlign: 'left',
|
|
31
|
-
fontWeight: 600,
|
|
32
|
-
fontSize: '14px',
|
|
33
|
-
}, children: "Agent" }), showAuthor && (_jsx("th", { style: {
|
|
34
|
-
padding: '12px 16px',
|
|
35
|
-
textAlign: 'left',
|
|
36
|
-
fontWeight: 600,
|
|
37
|
-
fontSize: '14px',
|
|
38
|
-
}, children: "Author" })), showLastEdited && (_jsx("th", { style: {
|
|
39
|
-
padding: '12px 16px',
|
|
40
|
-
textAlign: 'left',
|
|
41
|
-
fontWeight: 600,
|
|
42
|
-
fontSize: '14px',
|
|
43
|
-
}, children: "Last Edited" })), _jsx("th", { style: {
|
|
44
|
-
padding: '12px 16px',
|
|
45
|
-
textAlign: 'left',
|
|
46
|
-
fontWeight: 600,
|
|
47
|
-
fontSize: '14px',
|
|
48
|
-
}, children: "Status" }), _jsx("th", { style: {
|
|
49
|
-
padding: '12px 16px',
|
|
50
|
-
textAlign: 'left',
|
|
51
|
-
fontWeight: 600,
|
|
52
|
-
fontSize: '14px',
|
|
53
|
-
}, children: "Actions" })] }) }), _jsx("tbody", { children: agents.map(agent => (_jsxs("tr", { style: {
|
|
54
|
-
borderBottom: '1px solid var(--borderColor-default)',
|
|
55
|
-
}, children: [_jsx("td", { style: { padding: '12px 16px' }, children: _jsxs("div", { style: {
|
|
56
|
-
display: 'flex',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
gap: '12px',
|
|
59
|
-
}, children: [_jsx(Avatar, { src: agent.avatarUrl, size: 32 }), _jsx("span", { style: { fontWeight: 600 }, children: agent.name })] }) }), showAuthor && (_jsx("td", { style: { padding: '12px 16px' }, children: _jsx("span", { style: { color: 'var(--fgColor-muted)' }, children: agent.author }) })), showLastEdited && (_jsx("td", { style: { padding: '12px 16px' }, children: _jsx("span", { style: { color: 'var(--fgColor-muted)' }, children: agent.lastEdited }) })), _jsx("td", { style: { padding: '12px 16px' }, children: _jsx("span", { style: {
|
|
60
|
-
display: 'inline-flex',
|
|
61
|
-
alignItems: 'center',
|
|
62
|
-
gap: '6px',
|
|
63
|
-
padding: '2px 8px',
|
|
64
|
-
borderRadius: '12px',
|
|
65
|
-
fontSize: '12px',
|
|
66
|
-
fontWeight: 500,
|
|
67
|
-
backgroundColor: agent.status === 'running'
|
|
68
|
-
? 'var(--bgColor-success-muted)'
|
|
69
|
-
: 'var(--bgColor-attention-muted)',
|
|
70
|
-
color: agent.status === 'running'
|
|
71
|
-
? 'var(--fgColor-success)'
|
|
72
|
-
: 'var(--fgColor-attention)',
|
|
73
|
-
}, children: agent.status === 'running' ? 'Running' : 'Paused' }) }), _jsx("td", { style: { padding: '12px 16px' }, children: _jsx(IconButton, { icon: agent.status === 'running' ? PauseIcon : PlayIcon, "aria-label": agent.status === 'running' ? 'Pause agent' : 'Start agent', onClick: () => handleToggle(agent.id), variant: "invisible" }) })] }, agent.id))) })] }) }));
|
|
74
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface RatingProps {
|
|
3
|
-
/** Rating value between 1 and 5 */
|
|
4
|
-
value: number;
|
|
5
|
-
/** Size of the stars */
|
|
6
|
-
size?: number;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Rating Component
|
|
10
|
-
*
|
|
11
|
-
* Displays a star rating using octicons.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Rating: React.FC<RatingProps>;
|
|
14
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from '@datalayer/primer-addons';
|
|
3
|
-
import { StarFillIcon } from '@primer/octicons-react';
|
|
4
|
-
/**
|
|
5
|
-
* Rating Component
|
|
6
|
-
*
|
|
7
|
-
* Displays a star rating using octicons.
|
|
8
|
-
*/
|
|
9
|
-
export const Rating = ({ value, size = 12 }) => {
|
|
10
|
-
const clampedValue = Math.max(1, Math.min(5, value));
|
|
11
|
-
return (_jsx(Box, { sx: { display: 'flex', gap: 0.5, alignItems: 'center' }, children: Array.from({ length: 5 }, (_, index) => (_jsx(StarFillIcon, { size: size, fill: index < clampedValue ? '#fbbf24' : '#e5e7eb' }, index))) }));
|
|
12
|
-
};
|