@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
|
@@ -137,10 +137,16 @@ export class AGUIAdapter extends BaseProtocolAdapter {
|
|
|
137
137
|
forwardedProps: null,
|
|
138
138
|
// Include model for per-request model override
|
|
139
139
|
...(options?.model && { model: options.model }),
|
|
140
|
+
// Include identities for tool execution with OAuth tokens
|
|
141
|
+
...(options?.identities &&
|
|
142
|
+
options.identities.length > 0 && { identities: options.identities }),
|
|
140
143
|
};
|
|
141
144
|
if (options?.model) {
|
|
142
145
|
console.log('[AGUIAdapter] Sending with model:', options.model);
|
|
143
146
|
}
|
|
147
|
+
if (options?.identities && options.identities.length > 0) {
|
|
148
|
+
console.log('[AGUIAdapter] Sending with identities:', options.identities.map(i => i.provider));
|
|
149
|
+
}
|
|
144
150
|
try {
|
|
145
151
|
const response = await fetch(this.aguiConfig.baseUrl, {
|
|
146
152
|
method: 'POST',
|
|
@@ -455,13 +461,25 @@ export class AGUIAdapter extends BaseProtocolAdapter {
|
|
|
455
461
|
}
|
|
456
462
|
}
|
|
457
463
|
if (toolCallId) {
|
|
464
|
+
// Check for execution errors in the result
|
|
465
|
+
// ExecutionResult format: { execution_ok, execution_error, code_error, ... }
|
|
466
|
+
const contentObj = content;
|
|
467
|
+
const isError = contentObj?.execution_ok === false ||
|
|
468
|
+
contentObj?.code_error != null ||
|
|
469
|
+
(contentObj?.error != null && !contentObj?.success);
|
|
470
|
+
const errorMessage = contentObj?.execution_error ||
|
|
471
|
+
contentObj?.error ||
|
|
472
|
+
(contentObj?.code_error
|
|
473
|
+
? `${contentObj.code_error?.name || 'Error'}: ${contentObj.code_error?.value || ''}`
|
|
474
|
+
: undefined);
|
|
458
475
|
// Emit tool result event with the actual content
|
|
459
476
|
this.emit({
|
|
460
477
|
type: 'tool-result',
|
|
461
478
|
toolResult: {
|
|
462
479
|
toolCallId,
|
|
463
|
-
success:
|
|
480
|
+
success: !isError,
|
|
464
481
|
result: content,
|
|
482
|
+
error: isError ? errorMessage : undefined,
|
|
465
483
|
},
|
|
466
484
|
timestamp: new Date(),
|
|
467
485
|
});
|
|
@@ -63,6 +63,13 @@ export declare class VercelAIAdapter extends BaseProtocolAdapter {
|
|
|
63
63
|
messages?: ChatMessage[];
|
|
64
64
|
/** Builtin tools / MCP tools to enable for this request */
|
|
65
65
|
builtinTools?: string[];
|
|
66
|
+
/** Skills to enable for this request */
|
|
67
|
+
skills?: string[];
|
|
68
|
+
/** Connected identities with access tokens for skill execution */
|
|
69
|
+
identities?: Array<{
|
|
70
|
+
provider: string;
|
|
71
|
+
accessToken?: string;
|
|
72
|
+
}>;
|
|
66
73
|
}): Promise<void>;
|
|
67
74
|
/**
|
|
68
75
|
* Parse SSE stream from Vercel AI
|
|
@@ -112,10 +112,29 @@ export class VercelAIAdapter extends BaseProtocolAdapter {
|
|
|
112
112
|
options.builtinTools.length > 0 && {
|
|
113
113
|
builtinTools: options.builtinTools,
|
|
114
114
|
}),
|
|
115
|
+
// Skills to enable
|
|
116
|
+
...(options?.skills &&
|
|
117
|
+
options.skills.length > 0 && {
|
|
118
|
+
skills: options.skills,
|
|
119
|
+
}),
|
|
120
|
+
// Connected identities with access tokens
|
|
121
|
+
...(options?.identities &&
|
|
122
|
+
options.identities.length > 0 && {
|
|
123
|
+
identities: options.identities,
|
|
124
|
+
}),
|
|
115
125
|
};
|
|
116
126
|
if (options?.model) {
|
|
117
127
|
console.log('[VercelAIAdapter] Sending with model:', options.model);
|
|
118
128
|
}
|
|
129
|
+
if (options?.builtinTools && options.builtinTools.length > 0) {
|
|
130
|
+
console.log('[VercelAIAdapter] Sending with builtinTools:', options.builtinTools);
|
|
131
|
+
}
|
|
132
|
+
if (options?.skills && options.skills.length > 0) {
|
|
133
|
+
console.log('[VercelAIAdapter] Sending with skills:', options.skills);
|
|
134
|
+
}
|
|
135
|
+
if (options?.identities && options.identities.length > 0) {
|
|
136
|
+
console.log('[VercelAIAdapter] Sending with identities:', options.identities.map(i => i.provider));
|
|
137
|
+
}
|
|
119
138
|
// Merge custom headers with defaults
|
|
120
139
|
const headers = {
|
|
121
140
|
'Content-Type': 'application/json',
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Execution types for code/skills execution results.
|
|
3
|
+
* Maps to the Python code-sandboxes ExecutionResult model.
|
|
4
|
+
*
|
|
5
|
+
* @module components/chat/types/execution
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Code error information when Python code raises an exception.
|
|
9
|
+
*/
|
|
10
|
+
export interface CodeError {
|
|
11
|
+
/** Exception class name (e.g., 'ValueError', 'TypeError') */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Exception message/value */
|
|
14
|
+
value: string;
|
|
15
|
+
/** Python traceback string */
|
|
16
|
+
traceback?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Result from code or skill execution.
|
|
20
|
+
* This maps to the Python ExecutionResult model from code-sandboxes.
|
|
21
|
+
*
|
|
22
|
+
* Distinguishes between three levels of outcome:
|
|
23
|
+
* 1. Execution-level failure (execution_ok=false): Infrastructure/sandbox failed
|
|
24
|
+
* 2. Code-level error (code_error present): User code raised Python exception
|
|
25
|
+
* 3. Exit code (exit_code present): User code called sys.exit() with a code
|
|
26
|
+
*/
|
|
27
|
+
export interface ExecutionResult {
|
|
28
|
+
/** Whether overall execution succeeded (no infrastructure or code errors) */
|
|
29
|
+
success: boolean;
|
|
30
|
+
/** Whether the sandbox infrastructure executed the code successfully */
|
|
31
|
+
execution_ok: boolean;
|
|
32
|
+
/** Infrastructure error details when execution_ok is false */
|
|
33
|
+
execution_error?: string | null;
|
|
34
|
+
/** Python exception details when code raised an error */
|
|
35
|
+
code_error?: CodeError | null;
|
|
36
|
+
/** Exit code when code called sys.exit() - not a failure, but an intentional exit */
|
|
37
|
+
exit_code?: number | null;
|
|
38
|
+
/** Execution results (display outputs, return values) */
|
|
39
|
+
result?: unknown[];
|
|
40
|
+
/** Standard output text */
|
|
41
|
+
output?: string;
|
|
42
|
+
/** Backwards-compatible error message (derived from execution_error or code_error) */
|
|
43
|
+
error?: string | null;
|
|
44
|
+
/** Execution timing in seconds */
|
|
45
|
+
duration?: number;
|
|
46
|
+
/** Whether execution was interrupted/cancelled */
|
|
47
|
+
interrupted?: boolean;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if an execution result indicates infrastructure failure.
|
|
51
|
+
*/
|
|
52
|
+
export declare function isExecutionFailure(result: ExecutionResult): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Check if an execution result indicates a code/script error.
|
|
55
|
+
*/
|
|
56
|
+
export declare function isCodeError(result: ExecutionResult): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Check if an execution result has a non-zero exit code (intentional exit).
|
|
59
|
+
*/
|
|
60
|
+
export declare function hasNonZeroExitCode(result: ExecutionResult): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Check if an execution result is truly successful (no errors AND exit_code is 0 or null).
|
|
63
|
+
*/
|
|
64
|
+
export declare function isFullySuccessful(result: ExecutionResult): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Get a human-readable error message from an execution result.
|
|
67
|
+
* Returns null if no error or intentional exit.
|
|
68
|
+
*/
|
|
69
|
+
export declare function getExecutionErrorMessage(result: ExecutionResult): string | null;
|
|
70
|
+
/**
|
|
71
|
+
* Get exit code message if present and non-zero.
|
|
72
|
+
* Returns null if no exit code or exit code is 0.
|
|
73
|
+
*/
|
|
74
|
+
export declare function getExitCodeMessage(result: ExecutionResult): string | null;
|
|
75
|
+
/**
|
|
76
|
+
* Format a code error for display, optionally including traceback.
|
|
77
|
+
*/
|
|
78
|
+
export declare function formatCodeError(error: CodeError, includeTraceback?: boolean): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025-2026 Datalayer, Inc.
|
|
3
|
+
* Distributed under the terms of the Modified BSD License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check if an execution result indicates infrastructure failure.
|
|
7
|
+
*/
|
|
8
|
+
export function isExecutionFailure(result) {
|
|
9
|
+
return !result.execution_ok;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Check if an execution result indicates a code/script error.
|
|
13
|
+
*/
|
|
14
|
+
export function isCodeError(result) {
|
|
15
|
+
return result.execution_ok && result.code_error != null;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if an execution result has a non-zero exit code (intentional exit).
|
|
19
|
+
*/
|
|
20
|
+
export function hasNonZeroExitCode(result) {
|
|
21
|
+
return result.exit_code != null && result.exit_code !== 0;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Check if an execution result is truly successful (no errors AND exit_code is 0 or null).
|
|
25
|
+
*/
|
|
26
|
+
export function isFullySuccessful(result) {
|
|
27
|
+
return (result.execution_ok &&
|
|
28
|
+
result.code_error == null &&
|
|
29
|
+
!result.interrupted &&
|
|
30
|
+
(result.exit_code == null || result.exit_code === 0));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get a human-readable error message from an execution result.
|
|
34
|
+
* Returns null if no error or intentional exit.
|
|
35
|
+
*/
|
|
36
|
+
export function getExecutionErrorMessage(result) {
|
|
37
|
+
if (!result.execution_ok) {
|
|
38
|
+
return `Execution failed: ${result.execution_error || 'Unknown error'}`;
|
|
39
|
+
}
|
|
40
|
+
if (result.code_error) {
|
|
41
|
+
return `${result.code_error.name}: ${result.code_error.value}`;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Get exit code message if present and non-zero.
|
|
47
|
+
* Returns null if no exit code or exit code is 0.
|
|
48
|
+
*/
|
|
49
|
+
export function getExitCodeMessage(result) {
|
|
50
|
+
if (result.exit_code != null && result.exit_code !== 0) {
|
|
51
|
+
return `Process exited with code ${result.exit_code}`;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Format a code error for display, optionally including traceback.
|
|
57
|
+
*/
|
|
58
|
+
export function formatCodeError(error, includeTraceback = false) {
|
|
59
|
+
let message = `${error.name}: ${error.value}`;
|
|
60
|
+
if (includeTraceback && error.traceback) {
|
|
61
|
+
message += `\n\n${error.traceback}`;
|
|
62
|
+
}
|
|
63
|
+
return message;
|
|
64
|
+
}
|
|
@@ -117,6 +117,15 @@ export interface ProtocolAdapter {
|
|
|
117
117
|
messages?: ChatMessage[];
|
|
118
118
|
/** Model to use for this request (overrides agent default) */
|
|
119
119
|
model?: string;
|
|
120
|
+
/** Built-in MCP tool names to enable */
|
|
121
|
+
builtinTools?: string[];
|
|
122
|
+
/** Skill IDs to enable */
|
|
123
|
+
skills?: string[];
|
|
124
|
+
/** Connected identity tokens to pass to backend for tool execution */
|
|
125
|
+
identities?: Array<{
|
|
126
|
+
provider: string;
|
|
127
|
+
accessToken: string;
|
|
128
|
+
}>;
|
|
120
129
|
}): Promise<void>;
|
|
121
130
|
/**
|
|
122
131
|
* Send tool execution result back
|
|
@@ -7,7 +7,7 @@ type PaginationLinkProps = {
|
|
|
7
7
|
isActive?: boolean;
|
|
8
8
|
} & Pick<React.ComponentProps<typeof Button>, 'size'> & React.ComponentProps<'a'>;
|
|
9
9
|
declare function PaginationLink({ className, isActive, size, ...props }: PaginationLinkProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
declare function PaginationPrevious({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
declare function PaginationNext({ className, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function PaginationPrevious({ className, size, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function PaginationNext({ className, size, ...props }: React.ComponentProps<typeof PaginationLink>): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
declare function PaginationEllipsis({ className, ...props }: React.ComponentProps<'span'>): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export { Pagination, PaginationContent, PaginationLink, PaginationItem, PaginationPrevious, PaginationNext, PaginationEllipsis, };
|
|
@@ -17,11 +17,11 @@ function PaginationLink({ className, isActive, size = 'icon', ...props }) {
|
|
|
17
17
|
size,
|
|
18
18
|
}), className), ...props }));
|
|
19
19
|
}
|
|
20
|
-
function PaginationPrevious({ className, ...props }) {
|
|
21
|
-
return (_jsxs(PaginationLink, { "aria-label": "Go to previous page", size:
|
|
20
|
+
function PaginationPrevious({ className, size = 'default', ...props }) {
|
|
21
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to previous page", size: size, className: cn('gap-1 px-2.5 sm:pl-2.5', className), ...props, children: [_jsx(ChevronLeftIcon, {}), _jsx("span", { className: "hidden sm:block", children: "Previous" })] }));
|
|
22
22
|
}
|
|
23
|
-
function PaginationNext({ className, ...props }) {
|
|
24
|
-
return (_jsxs(PaginationLink, { "aria-label": "Go to next page", size:
|
|
23
|
+
function PaginationNext({ className, size = 'default', ...props }) {
|
|
24
|
+
return (_jsxs(PaginationLink, { "aria-label": "Go to next page", size: size, className: cn('gap-1 px-2.5 sm:pr-2.5', className), ...props, children: [_jsx("span", { className: "hidden sm:block", children: "Next" }), _jsx(ChevronRightIcon, {})] }));
|
|
25
25
|
}
|
|
26
26
|
function PaginationEllipsis({ className, ...props }) {
|
|
27
27
|
return (_jsxs("span", { "aria-hidden": true, "data-slot": "pagination-ellipsis", className: cn('flex size-9 items-center justify-center', className), ...props, children: [_jsx(MoreHorizontalIcon, { className: "size-4" }), _jsx("span", { className: "sr-only", children: "More pages" })] }));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import
|
|
3
|
-
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof
|
|
4
|
-
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof
|
|
5
|
-
declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof
|
|
2
|
+
import { Group, Panel, Separator } from 'react-resizable-panels';
|
|
3
|
+
declare function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof Group>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function ResizablePanel({ ...props }: React.ComponentProps<typeof Panel>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function ResizableHandle({ withHandle, className, ...props }: React.ComponentProps<typeof Separator> & {
|
|
6
6
|
withHandle?: boolean;
|
|
7
7
|
}): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
'use client';
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
import { GripVerticalIcon } from 'lucide-react';
|
|
8
|
-
import
|
|
8
|
+
import { Group, Panel, Separator } from 'react-resizable-panels';
|
|
9
9
|
import { cn } from '@/lib/utils';
|
|
10
10
|
function ResizablePanelGroup({ className, ...props }) {
|
|
11
|
-
return (_jsx(
|
|
11
|
+
return (_jsx(Group, { "data-slot": "resizable-panel-group", className: cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className), ...props }));
|
|
12
12
|
}
|
|
13
13
|
function ResizablePanel({ ...props }) {
|
|
14
|
-
return _jsx(
|
|
14
|
+
return _jsx(Panel, { "data-slot": "resizable-panel", ...props });
|
|
15
15
|
}
|
|
16
16
|
function ResizableHandle({ withHandle, className, ...props }) {
|
|
17
|
-
return (_jsx(
|
|
17
|
+
return (_jsx(Separator, { "data-slot": "resizable-handle", className: cn('bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90', className), ...props, children: withHandle && (_jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: _jsx(GripVerticalIcon, { className: "size-2.5" }) })) }));
|
|
18
18
|
}
|
|
19
19
|
export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
|
|
@@ -20,7 +20,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
20
20
|
*/
|
|
21
21
|
import { useState, useCallback, useEffect, useRef } from 'react';
|
|
22
22
|
import { Box } from '@datalayer/primer-addons';
|
|
23
|
-
import {
|
|
23
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
24
24
|
import { Text, Spinner, TextInput, Button } from '@primer/react';
|
|
25
25
|
import { A2UIProvider, A2UIRenderer, useA2UI } from '../renderers/a2ui';
|
|
26
26
|
// A2UI endpoint for pydantic-ai restaurant agent
|
|
@@ -278,7 +278,7 @@ const A2UiRestaurantExample = () => {
|
|
|
278
278
|
console.log('A2UI Action:', action);
|
|
279
279
|
// Actions are handled in the content component
|
|
280
280
|
}, []);
|
|
281
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
281
|
+
return (_jsx(DatalayerThemeProvider, { colorMode: "day", children: _jsx(A2UIProvider, { onAction: handleAction, children: _jsxs(Box, { sx: {
|
|
282
282
|
display: 'flex',
|
|
283
283
|
flexDirection: 'column',
|
|
284
284
|
minHeight: '100vh',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Text } from '@primer/react';
|
|
3
3
|
import { Box } from '@datalayer/primer-addons';
|
|
4
|
-
import {
|
|
4
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
5
5
|
import { ChatFloating } from '../components/chat';
|
|
6
6
|
// AG-UI endpoint for agentic chat example
|
|
7
7
|
const AGENTIC_CHAT_ENDPOINT = 'http://localhost:8765/api/v1/examples/agentic_chat/';
|
|
@@ -17,7 +17,7 @@ const AGENTIC_CHAT_ENDPOINT = 'http://localhost:8765/api/v1/examples/agentic_cha
|
|
|
17
17
|
* - Floating popup interface
|
|
18
18
|
*/
|
|
19
19
|
const AgUiAgenticExample = () => {
|
|
20
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
20
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
21
21
|
minHeight: '100vh',
|
|
22
22
|
backgroundColor: 'canvas.default',
|
|
23
23
|
padding: 4,
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
import { useCallback } from 'react';
|
|
19
19
|
import { Text } from '@primer/react';
|
|
20
20
|
import { Box } from '@datalayer/primer-addons';
|
|
21
|
-
import {
|
|
21
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
22
22
|
import { ChatFloating } from '../components/chat';
|
|
23
23
|
import { InlineWeatherCard } from './ag-ui/weather';
|
|
24
24
|
// AG-UI endpoint for backend tool rendering example
|
|
@@ -58,7 +58,7 @@ const AgUiBackendToolRenderingExample = () => {
|
|
|
58
58
|
// State updates are still available if needed for other purposes
|
|
59
59
|
// Uncomment to debug: console.log('[WeatherExample] State update:', _state);
|
|
60
60
|
}, []);
|
|
61
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
61
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
62
62
|
minHeight: '100vh',
|
|
63
63
|
backgroundColor: 'canvas.default',
|
|
64
64
|
padding: 4,
|
|
@@ -19,7 +19,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
import { useState, useCallback, useRef, useImperativeHandle, forwardRef, } from 'react';
|
|
20
20
|
import { Text } from '@primer/react';
|
|
21
21
|
import { Box } from '@datalayer/primer-addons';
|
|
22
|
-
import {
|
|
22
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
23
23
|
import { ChatFloating } from '../components/chat';
|
|
24
24
|
import { InlineHaikuCard, HaikuDisplay } from './ag-ui/haiku';
|
|
25
25
|
// AG-UI endpoint for haiku generative UI example
|
|
@@ -95,7 +95,7 @@ const AgUiHaikuGenUIExample = () => {
|
|
|
95
95
|
}
|
|
96
96
|
return (_jsx(InlineHaikuCard, { haiku: haiku, status: context.status, error: context.error }));
|
|
97
97
|
}, []);
|
|
98
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
98
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
99
99
|
minHeight: '100vh',
|
|
100
100
|
backgroundColor: 'canvas.default',
|
|
101
101
|
padding: 4,
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
18
18
|
import { useState, useEffect } from 'react';
|
|
19
19
|
import { Text, Checkbox, FormControl, Label, ProgressBar, Button, } from '@primer/react';
|
|
20
20
|
import { Box } from '@datalayer/primer-addons';
|
|
21
|
-
import {
|
|
21
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
22
22
|
import { ChatFloating } from '../components/chat';
|
|
23
23
|
import { TasklistIcon, CheckCircleFillIcon, XCircleFillIcon, } from '@primer/octicons-react';
|
|
24
24
|
// AG-UI endpoint for human in the loop example
|
|
@@ -178,7 +178,7 @@ const renderTaskStepsTool = (context) => {
|
|
|
178
178
|
* - UI state changes based on user actions
|
|
179
179
|
*/
|
|
180
180
|
const AgUiHumanInTheLoopExample = () => {
|
|
181
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
181
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
182
182
|
minHeight: '100vh',
|
|
183
183
|
backgroundColor: 'canvas.default',
|
|
184
184
|
padding: 4,
|
|
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
import { useState, useCallback } from 'react';
|
|
16
16
|
import { Text, Button, TextInput, Label } from '@primer/react';
|
|
17
17
|
import { Box } from '@datalayer/primer-addons';
|
|
18
|
-
import {
|
|
18
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
19
19
|
import { ChatFloating } from '../components/chat';
|
|
20
20
|
import { PlusIcon, XIcon, BeakerIcon, ClockIcon, PersonIcon, } from '@primer/octicons-react';
|
|
21
21
|
// AG-UI endpoint for shared state example
|
|
@@ -125,7 +125,7 @@ const AgUiSharedStateExample = () => {
|
|
|
125
125
|
const handleClear = useCallback(() => {
|
|
126
126
|
setRecipe(DEFAULT_RECIPE);
|
|
127
127
|
}, []);
|
|
128
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
128
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
129
129
|
minHeight: '100vh',
|
|
130
130
|
backgroundColor: 'canvas.default',
|
|
131
131
|
padding: 4,
|
|
@@ -15,7 +15,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
import { useState, useCallback } from 'react';
|
|
16
16
|
import { Text, ProgressBar, Button } from '@primer/react';
|
|
17
17
|
import { Box } from '@datalayer/primer-addons';
|
|
18
|
-
import {
|
|
18
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
19
19
|
import { ChatFloating } from '../components/chat';
|
|
20
20
|
import { CheckCircleIcon, CircleIcon, DotFillIcon, CheckIcon, XIcon, } from '@primer/octicons-react';
|
|
21
21
|
// AG-UI endpoint for agentic generative UI example
|
|
@@ -209,7 +209,7 @@ const AgUiToolsBasedGenUIExample = () => {
|
|
|
209
209
|
setDecision('rejected');
|
|
210
210
|
console.log('Plan rejected');
|
|
211
211
|
}, []);
|
|
212
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
212
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
213
213
|
minHeight: '100vh',
|
|
214
214
|
backgroundColor: 'canvas.default',
|
|
215
215
|
padding: 4,
|
|
@@ -7,7 +7,7 @@ import { useCallback, useEffect, useState } from 'react';
|
|
|
7
7
|
import { Spinner, Text } from '@primer/react';
|
|
8
8
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
9
9
|
import { Box } from '@datalayer/primer-addons';
|
|
10
|
-
import {
|
|
10
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
11
11
|
import { Chat } from '../components/chat';
|
|
12
12
|
// Create a query client for React Query
|
|
13
13
|
const queryClient = new QueryClient({
|
|
@@ -121,7 +121,7 @@ Be concise, helpful, and provide working code examples when appropriate.`,
|
|
|
121
121
|
*/
|
|
122
122
|
const AgentRuntimeCustomExample = () => {
|
|
123
123
|
const { agentId, isLoading, error, retry } = useEnsureAgent();
|
|
124
|
-
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(DatalayerThemeProvider, {
|
|
124
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
125
125
|
display: 'flex',
|
|
126
126
|
flexDirection: 'column',
|
|
127
127
|
height: '100vh',
|
|
@@ -127,6 +127,7 @@ function CustomToolsRegistrar() {
|
|
|
127
127
|
}
|
|
128
128
|
function LexicalEditor({ serviceManager: _serviceManager, }) {
|
|
129
129
|
const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
|
|
130
|
+
const [_isLinkEditMode, setIsLinkEditMode] = useState(false);
|
|
130
131
|
const onRef = (_floatingAnchorElem) => {
|
|
131
132
|
if (_floatingAnchorElem !== null) {
|
|
132
133
|
setFloatingAnchorElem(_floatingAnchorElem);
|
|
@@ -153,7 +154,7 @@ function LexicalEditor({ serviceManager: _serviceManager, }) {
|
|
|
153
154
|
left: '24px',
|
|
154
155
|
color: 'var(--fgColor-muted)',
|
|
155
156
|
pointerEvents: 'none',
|
|
156
|
-
}, children: "Start typing or click the chat button to open the AI assistant..." }), ErrorBoundary: LexicalErrorBoundary }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(OnChangePlugin, { onChange: onChange }), _jsx(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }), _jsx(CodeHighlightingPlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(JupyterCellPlugin, {}), _jsx(JupyterInputOutputPlugin, {}), _jsx(ImagesPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(EquationsPlugin, {}), _jsx(YouTubePlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(ComponentPickerMenuPlugin, {}), _jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] }))] }) }));
|
|
157
|
+
}, children: "Start typing or click the chat button to open the AI assistant..." }), ErrorBoundary: LexicalErrorBoundary }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(OnChangePlugin, { onChange: onChange }), _jsx(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }), _jsx(CodeHighlightingPlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(JupyterCellPlugin, {}), _jsx(JupyterInputOutputPlugin, {}), _jsx(ImagesPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(EquationsPlugin, {}), _jsx(YouTubePlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(ComponentPickerMenuPlugin, {}), _jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem, setIsLinkEditMode: setIsLinkEditMode }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] }))] }) }));
|
|
157
158
|
}
|
|
158
159
|
export function ChatLexicalExampleInner({ serviceManager, }) {
|
|
159
160
|
// Chat configuration - set up the inference provider in the store
|
|
@@ -221,9 +221,12 @@ function LexicalWithChat({ content, serviceManager, }) {
|
|
|
221
221
|
const { isReady, error } = useEnsureAgent(AGENT_ID, BASE_URL);
|
|
222
222
|
// State to hold tools - populated by LexicalToolsPlugin inside the context
|
|
223
223
|
const [tools, setTools] = useState([]);
|
|
224
|
+
const [toolsKey, setToolsKey] = useState(0);
|
|
224
225
|
// Stable callback for receiving tools from LexicalToolsPlugin
|
|
225
226
|
const handleToolsReady = useCallback((newTools) => {
|
|
227
|
+
console.log('[LexicalWithChat] 🔄 Tools received, updating state');
|
|
226
228
|
setTools(newTools);
|
|
229
|
+
setToolsKey(prev => prev + 1); // Force ChatFloating to see new tools
|
|
227
230
|
}, []);
|
|
228
231
|
return (_jsxs(Box, { sx: {
|
|
229
232
|
height: '100vh',
|
|
@@ -239,7 +242,7 @@ function LexicalWithChat({ content, serviceManager, }) {
|
|
|
239
242
|
color: 'danger.fg',
|
|
240
243
|
borderRadius: 2,
|
|
241
244
|
maxWidth: 300,
|
|
242
|
-
}, children: [_jsx("strong", { children: "Error:" }), " ", error] })), isReady && (_jsx(ChatFloating, { endpoint: AG_UI_ENDPOINT, title: "Lexical AI Agent Runtime", description: "Hi! I can help you edit documents. Try: 'Insert a heading', 'Add a code block', or 'Create a list'", defaultOpen: true, defaultViewMode: "panel", position: "bottom-right", brandColor: "#7c3aed", tools: tools, useStore: false, showModelSelector: true, showToolsMenu: true, suggestions: [
|
|
245
|
+
}, children: [_jsx("strong", { children: "Error:" }), " ", error] })), isReady && (_jsx(ChatFloating, { endpoint: AG_UI_ENDPOINT, title: "Lexical AI Agent Runtime", description: "Hi! I can help you edit documents. Try: 'Insert a heading', 'Add a code block', or 'Create a list'", defaultOpen: true, defaultViewMode: "panel", position: "bottom-right", brandColor: "#7c3aed", tools: tools, useStore: false, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, suggestions: [
|
|
243
246
|
{
|
|
244
247
|
title: 'Insert heading',
|
|
245
248
|
message: 'Insert a heading that says "Welcome"',
|
|
@@ -252,7 +255,7 @@ function LexicalWithChat({ content, serviceManager, }) {
|
|
|
252
255
|
title: 'Create list',
|
|
253
256
|
message: 'Create a bullet list with three items about Jupyter',
|
|
254
257
|
},
|
|
255
|
-
] }))] }));
|
|
258
|
+
] }, `chat-${toolsKey}`))] }));
|
|
256
259
|
}
|
|
257
260
|
function AgentRuntimeLexicalExample({ content, serviceManager, }) {
|
|
258
261
|
return _jsx(LexicalWithChat, { content: content, serviceManager: serviceManager });
|
|
@@ -44,9 +44,10 @@ import { registerCodeHighlighting } from '@lexical/code';
|
|
|
44
44
|
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
|
45
45
|
import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin';
|
|
46
46
|
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
47
|
+
import { TablePlugin } from '@lexical/react/LexicalTablePlugin';
|
|
47
48
|
import { Box } from '@datalayer/primer-addons';
|
|
48
49
|
import { JupyterReactTheme, useJupyter } from '@datalayer/jupyter-react';
|
|
49
|
-
import { ComponentPickerMenuPlugin, JupyterCellPlugin, JupyterInputOutputPlugin, DraggableBlockPlugin, ImagesPlugin, HorizontalRulePlugin, EquationsPlugin, YouTubePlugin, AutoLinkPlugin, AutoEmbedPlugin, FloatingTextFormatToolbarPlugin, CodeActionMenuPlugin, ListMaxIndentLevelPlugin, LexicalConfigProvider, LexicalStatePlugin, } from '@datalayer/jupyter-lexical';
|
|
50
|
+
import { ComponentPickerMenuPlugin, JupyterCellPlugin, JupyterInputOutputPlugin, DraggableBlockPlugin, ImagesPlugin, HorizontalRulePlugin, EquationsPlugin, YouTubePlugin, ExcalidrawPlugin, CollapsiblePlugin, AutoLinkPlugin, AutoEmbedPlugin, FloatingTextFormatToolbarPlugin, CodeActionMenuPlugin, ListMaxIndentLevelPlugin, LexicalConfigProvider, LexicalStatePlugin, } from '@datalayer/jupyter-lexical';
|
|
50
51
|
// Import Chat components
|
|
51
52
|
import { ChatSidebar, } from '../components/chat';
|
|
52
53
|
import { useLexicalTools } from '../tools/adapters/agent-runtimes/lexicalHooks';
|
|
@@ -70,6 +71,7 @@ function CodeHighlightingPlugin() {
|
|
|
70
71
|
}
|
|
71
72
|
function LexicalEditor({ serviceManager }) {
|
|
72
73
|
const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
|
|
74
|
+
const [_isLinkEditMode, setIsLinkEditMode] = useState(false);
|
|
73
75
|
const onRef = (_floatingAnchorElem) => {
|
|
74
76
|
if (_floatingAnchorElem !== null) {
|
|
75
77
|
setFloatingAnchorElem(_floatingAnchorElem);
|
|
@@ -96,7 +98,7 @@ function LexicalEditor({ serviceManager }) {
|
|
|
96
98
|
left: '24px',
|
|
97
99
|
color: 'var(--fgColor-muted)',
|
|
98
100
|
pointerEvents: 'none',
|
|
99
|
-
}, children: "Start typing or use the chat to create content..." }), ErrorBoundary: LexicalErrorBoundary }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(OnChangePlugin, { onChange: onChange }), _jsx(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }), _jsx(CodeHighlightingPlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(JupyterCellPlugin, {}), _jsx(JupyterInputOutputPlugin, {}), _jsx(ImagesPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(EquationsPlugin, {}), _jsx(YouTubePlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(ComponentPickerMenuPlugin, {}), _jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] }))] })] }) }));
|
|
101
|
+
}, children: "Start typing or use the chat to create content..." }), ErrorBoundary: LexicalErrorBoundary }), _jsx(HistoryPlugin, {}), _jsx(AutoFocusPlugin, {}), _jsx(OnChangePlugin, { onChange: onChange }), _jsx(MarkdownShortcutPlugin, { transformers: TRANSFORMERS }), _jsx(CodeHighlightingPlugin, {}), _jsx(ListPlugin, {}), _jsx(CheckListPlugin, {}), _jsx(LinkPlugin, {}), _jsx(TablePlugin, {}), _jsx(JupyterCellPlugin, {}), _jsx(JupyterInputOutputPlugin, {}), _jsx(ImagesPlugin, {}), _jsx(HorizontalRulePlugin, {}), _jsx(EquationsPlugin, {}), _jsx(YouTubePlugin, {}), _jsx(ExcalidrawPlugin, {}), _jsx(CollapsiblePlugin, {}), _jsx(AutoLinkPlugin, {}), _jsx(AutoEmbedPlugin, {}), _jsx(ListMaxIndentLevelPlugin, { maxDepth: 7 }), floatingAnchorElem && (_jsxs(_Fragment, { children: [_jsx(ComponentPickerMenuPlugin, {}), _jsx(DraggableBlockPlugin, { anchorElem: floatingAnchorElem }), _jsx(FloatingTextFormatToolbarPlugin, { anchorElem: floatingAnchorElem, setIsLinkEditMode: setIsLinkEditMode }), _jsx(CodeActionMenuPlugin, { anchorElem: floatingAnchorElem })] }))] })] }) }));
|
|
100
102
|
}
|
|
101
103
|
export function ChatLexicalExampleInner({ serviceManager, }) {
|
|
102
104
|
// Get lexical tools for ChatSidebar
|
|
@@ -127,7 +127,7 @@ function NotebookWithChat({ serviceManager, }) {
|
|
|
127
127
|
color: 'danger.fg',
|
|
128
128
|
borderRadius: 2,
|
|
129
129
|
maxWidth: 300,
|
|
130
|
-
}, children: [_jsx("strong", { children: "Error:" }), " ", error] })), isReady && (_jsx(ChatFloating, { endpoint: AG_UI_ENDPOINT, title: "Notebook AI Agent Runtime", description: "Hi! I can help you edit notebook cells. Try: 'Add a new code cell', 'Run cell 1', or 'Delete the last cell'", defaultOpen: true, defaultViewMode: "panel", position: "bottom-right", brandColor: "#7c3aed", tools: tools, useStore: false, suggestions: [
|
|
130
|
+
}, children: [_jsx("strong", { children: "Error:" }), " ", error] })), isReady && (_jsx(ChatFloating, { endpoint: AG_UI_ENDPOINT, title: "Notebook AI Agent Runtime", description: "Hi! I can help you edit notebook cells. Try: 'Add a new code cell', 'Run cell 1', or 'Delete the last cell'", defaultOpen: true, defaultViewMode: "panel", position: "bottom-right", brandColor: "#7c3aed", tools: tools, useStore: false, showModelSelector: true, showToolsMenu: true, showSkillsMenu: true, suggestions: [
|
|
131
131
|
{
|
|
132
132
|
title: 'Add a cell',
|
|
133
133
|
message: 'Insert a random cell to the notebook',
|
|
@@ -18,7 +18,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
18
18
|
import { useCallback } from 'react';
|
|
19
19
|
import { Text } from '@primer/react';
|
|
20
20
|
import { Box } from '@datalayer/primer-addons';
|
|
21
|
-
import {
|
|
21
|
+
import { DatalayerThemeProvider } from '@datalayer/core';
|
|
22
22
|
import { ChatStandalone } from '../components/chat';
|
|
23
23
|
/**
|
|
24
24
|
* Simulated AI responses for demo purposes.
|
|
@@ -97,7 +97,7 @@ const AgentRuntimePopupStandaloneExample = () => {
|
|
|
97
97
|
throw err;
|
|
98
98
|
}
|
|
99
99
|
}, []);
|
|
100
|
-
return (_jsx(DatalayerThemeProvider, {
|
|
100
|
+
return (_jsx(DatalayerThemeProvider, { children: _jsxs(Box, { sx: {
|
|
101
101
|
minHeight: '100vh',
|
|
102
102
|
backgroundColor: 'canvas.default',
|
|
103
103
|
padding: 4,
|