@datalayer/agent-runtimes 1.3.74 → 1.3.75

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.
Files changed (55) hide show
  1. package/lib/chat/ChatFloating.d.ts +17 -1
  2. package/lib/chat/ChatFloating.js +52 -5
  3. package/lib/chat/assistant/AssistantContextMenu.d.ts +67 -0
  4. package/lib/chat/assistant/AssistantContextMenu.js +68 -0
  5. package/lib/chat/assistant/AssistantStage.d.ts +95 -1
  6. package/lib/chat/assistant/AssistantStage.js +227 -7
  7. package/lib/chat/assistant/BalloonParts.d.ts +15 -1
  8. package/lib/chat/assistant/BalloonParts.js +26 -9
  9. package/lib/chat/assistant/BalloonVisual.d.ts +10 -2
  10. package/lib/chat/assistant/BalloonVisual.js +3 -3
  11. package/lib/chat/assistant/SpeechBalloon.d.ts +47 -1
  12. package/lib/chat/assistant/SpeechBalloon.js +60 -8
  13. package/lib/chat/base/ChatBase.js +51 -1
  14. package/lib/chat/indicators/TypingDots.d.ts +13 -0
  15. package/lib/chat/indicators/TypingDots.js +21 -0
  16. package/lib/chat/messages/ChatMessageList.js +1 -15
  17. package/lib/components/inspector/AgentInspector.d.ts +59 -0
  18. package/lib/components/inspector/AgentInspector.js +220 -0
  19. package/lib/components/inspector/AgentInspectorDialog.d.ts +19 -0
  20. package/lib/components/inspector/AgentInspectorDialog.js +9 -0
  21. package/lib/components/inspector/JsonTree.d.ts +24 -0
  22. package/lib/components/inspector/JsonTree.js +89 -0
  23. package/lib/components/inspector/a2aInspect.d.ts +56 -0
  24. package/lib/components/inspector/a2aInspect.js +478 -0
  25. package/lib/components/inspector/agentInspector.d.ts +179 -0
  26. package/lib/components/inspector/agentInspector.js +267 -0
  27. package/lib/components/inspector/chatInspect.d.ts +38 -0
  28. package/lib/components/inspector/chatInspect.js +65 -0
  29. package/lib/components/inspector/classify.d.ts +19 -0
  30. package/lib/components/inspector/classify.js +42 -0
  31. package/lib/components/inspector/index.d.ts +14 -0
  32. package/lib/components/inspector/index.js +18 -0
  33. package/lib/components/teams/A2ATeamGraph.d.ts +42 -1
  34. package/lib/components/teams/A2ATeamGraph.js +24 -7
  35. package/lib/components/teams/NotebookPreviewView.js +9 -1
  36. package/lib/components/teams/TeamNotebook.d.ts +3 -1
  37. package/lib/components/teams/TeamNotebook.js +3 -3
  38. package/lib/components/teams/jupyterThemeVariables.d.ts +9 -0
  39. package/lib/components/teams/jupyterThemeVariables.js +441 -0
  40. package/lib/components/teams/teamConnections.d.ts +9 -1
  41. package/lib/components/teams/teamConnections.js +20 -0
  42. package/lib/components/teams/useA2ATeam.d.ts +17 -4
  43. package/lib/components/teams/useA2ATeam.js +87 -23
  44. package/lib/examples/AgentA2ATeamExample.d.ts +13 -0
  45. package/lib/examples/AgentA2ATeamExample.js +61 -13
  46. package/lib/examples/AssistantExample.js +62 -2
  47. package/lib/loop/apps/AppRenderer.js +1 -1
  48. package/lib/loop/core/index.d.ts +17 -0
  49. package/lib/loop/core/index.js +1 -0
  50. package/lib/loop/plugins/assistant/index.d.ts +1 -1
  51. package/lib/loop/plugins/assistant/index.js +8 -3
  52. package/lib/runtimes/browser/a2aPeer.d.ts +4 -1
  53. package/lib/types/chat.d.ts +7 -0
  54. package/package.json +1 -1
  55. package/scripts/codegen/generate_jupyter_theme_variables.mjs +57 -0
@@ -43,7 +43,10 @@ export type ConnectA2APeerOptions = {
43
43
  url: string;
44
44
  /** A key granted to the peer's route, sent as a bearer token. */
45
45
  key?: string;
46
- /** The fetch to use, for tests and hosts that wrap the network. */
46
+ /**
47
+ * The fetch to use, for tests and hosts that wrap the network — such as
48
+ * the Agent Inspector's `inspectA2AFetch`, which records the traffic.
49
+ */
47
50
  fetch?: typeof globalThis.fetch;
48
51
  };
49
52
  /**
@@ -8,6 +8,7 @@ import type { ComponentType, ReactNode } from 'react';
8
8
  import type { ICollaborationProvider } from '@datalayer/jupyter-react';
9
9
  import type { ChatMessage, MessageHandler } from './messages';
10
10
  import type { Protocol, ProtocolConfig } from './protocol';
11
+ import type { AgentInspectorSink } from '../components/inspector/agentInspector';
11
12
  import type { McpServerSelection } from './inference';
12
13
  import type { MCPServerTool } from './mcp';
13
14
  import type { AgentRuntimeConfig } from './config';
@@ -1238,6 +1239,12 @@ export interface ChatBaseProps {
1238
1239
  * ```
1239
1240
  */
1240
1241
  onToolCallComplete?: (context: ToolCallCompleteContext) => void;
1242
+ /**
1243
+ * The Agent Inspector's sink: the agent's turns (its model, its tokens)
1244
+ * and its tool calls, from start to end, are recorded there. Without it,
1245
+ * the sink of the nearest `AgentInspectorProvider`, if any.
1246
+ */
1247
+ inspector?: AgentInspectorSink | null;
1241
1248
  /**
1242
1249
  * Whether to render the top-of-chat tool approval banner (and its review
1243
1250
  * dialog) when `pendingApprovals` is non-empty. The banner/dialog render
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.3.74",
3
+ "version": "1.3.75",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -0,0 +1,57 @@
1
+ /*
2
+ * Copyright (c) 2025-2026 Datalayer, Inc.
3
+ * Distributed under the terms of the Modified BSD License.
4
+ */
5
+
6
+ /**
7
+ * Writes src/components/teams/jupyterThemeVariables.ts: JupyterLab's light
8
+ * and dark theme variables (`--jp-*`), read from the theme extensions'
9
+ * variables.css, so a notebook preview can carry its own mode on its own
10
+ * subtree — JupyterLab writes them for the whole page.
11
+ *
12
+ * node scripts/codegen/generate_jupyter_theme_variables.mjs
13
+ */
14
+ import { readFileSync, writeFileSync } from 'node:fs';
15
+ import { createRequire } from 'node:module';
16
+
17
+ const require = createRequire(import.meta.url);
18
+
19
+ function variables(pkg) {
20
+ const css = readFileSync(require.resolve(`${pkg}/style/variables.css`), 'utf8')
21
+ .replace(/\/\*[\s\S]*?\*\//g, '');
22
+ const out = {};
23
+ for (const block of css.matchAll(/:root\s*\{([\s\S]*?)\}/g)) {
24
+ for (const declaration of block[1].split(';')) {
25
+ const match = /^\s*(--jp-[\w-]+)\s*:\s*([\s\S]+?)\s*$/.exec(declaration);
26
+ if (match) {
27
+ out[match[1]] = match[2].replace(/\s+/g, ' ');
28
+ }
29
+ }
30
+ }
31
+ return out;
32
+ }
33
+
34
+ const light = variables('@jupyterlab/theme-light-extension');
35
+ const dark = variables('@jupyterlab/theme-dark-extension');
36
+ const target = new URL('../../src/components/teams/jupyterThemeVariables.ts', import.meta.url);
37
+ writeFileSync(
38
+ target,
39
+ `/*
40
+ * Copyright (c) 2025-2026 Datalayer, Inc.
41
+ * Distributed under the terms of the Modified BSD License.
42
+ */
43
+
44
+ /**
45
+ * JupyterLab's theme variables, light and dark, as its theme extensions state
46
+ * them. Generated by scripts/codegen/generate_jupyter_theme_variables.mjs: do
47
+ * not edit.
48
+ *
49
+ * @module components/teams/jupyterThemeVariables
50
+ */
51
+
52
+ export const JUPYTER_LIGHT_VARIABLES: Readonly<Record<string, string>> = ${JSON.stringify(light, null, 2)};
53
+
54
+ export const JUPYTER_DARK_VARIABLES: Readonly<Record<string, string>> = ${JSON.stringify(dark, null, 2)};
55
+ `,
56
+ );
57
+ console.log(`light ${Object.keys(light).length}, dark ${Object.keys(dark).length}`);