@datalayer/agent-runtimes 1.0.18 → 1.0.20

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 (146) hide show
  1. package/README.md +14 -6
  2. package/lib/AgentNode.js +567 -67
  3. package/lib/App.js +2 -2
  4. package/lib/agent-node/AgentNodeGallery.d.ts +80 -0
  5. package/lib/agent-node/AgentNodeGallery.js +627 -0
  6. package/lib/agent-notebook-main.js +0 -1
  7. package/lib/api/runtimes/runtimes.d.ts +57 -0
  8. package/lib/api/runtimes/runtimes.js +55 -1
  9. package/lib/chat/Chat.d.ts +14 -1
  10. package/lib/chat/Chat.js +22 -7
  11. package/lib/chat/base/ChatBase.js +86 -23
  12. package/lib/chat/document/EphemeralDocument.d.ts +49 -1
  13. package/lib/chat/document/EphemeralDocument.js +141 -15
  14. package/lib/chat/header/ChatHeaderBase.d.ts +3 -1
  15. package/lib/chat/header/ChatHeaderBase.js +5 -3
  16. package/lib/chat/messages/ChatMessageList.d.ts +19 -0
  17. package/lib/chat/messages/ChatMessageList.js +180 -9
  18. package/lib/chat/notebook/EphemeralNotebook.d.ts +40 -1
  19. package/lib/chat/notebook/EphemeralNotebook.js +49 -13
  20. package/lib/chat/prompt/InputPrompt.js +1 -1
  21. package/lib/chat/tools/SubagentActivity.d.ts +20 -0
  22. package/lib/chat/tools/SubagentActivity.js +154 -0
  23. package/lib/chat/tools/index.d.ts +1 -0
  24. package/lib/chat/tools/index.js +1 -0
  25. package/lib/chat/usage/TokenUsageBar.js +3 -3
  26. package/lib/client/AgentRuntimesClient.d.ts +5 -0
  27. package/lib/client/AgentsMixin.js +3 -1
  28. package/lib/client/mixins/RuntimesMixin.d.ts +12 -0
  29. package/lib/client/mixins/RuntimesMixin.js +24 -1
  30. package/lib/components/AgentSummary.d.ts +1 -0
  31. package/lib/components/AgentSummary.js +66 -10
  32. package/lib/components/runtimes/RuntimePickerBase.js +64 -29
  33. package/lib/components/runtimes/RuntimePickerCell.js +1 -1
  34. package/lib/components/runtimes/RuntimePickerNotebook.js +1 -1
  35. package/lib/components/runtimes/RuntimeSimplePicker.js +3 -2
  36. package/lib/components/runtimes/RuntimeUtils.js +2 -2
  37. package/lib/context/GraphFlowChart.js +1 -1
  38. package/lib/context/TokenUsageChart.js +1 -1
  39. package/lib/context/TurnGraphChart.js +2 -2
  40. package/lib/examples/A2UiAgentExample.js +4 -4
  41. package/lib/examples/A2UiComponentsGalleryExample.js +3 -3
  42. package/lib/examples/A2UiContactCardExample.js +3 -3
  43. package/lib/examples/A2UiRestaurantExample.js +2 -2
  44. package/lib/examples/A2UiViewerExample.js +3 -3
  45. package/lib/examples/AgUiAgenticExample.js +3 -3
  46. package/lib/examples/AgUiBackendToolRenderingExample.js +2 -2
  47. package/lib/examples/AgUiHaikuGenUiExample.js +3 -3
  48. package/lib/examples/AgUiHumanInTheLoopExample.js +5 -5
  49. package/lib/examples/AgUiSharedStateExample.js +3 -3
  50. package/lib/examples/AgUiToolsBasedGenUiExample.js +7 -5
  51. package/lib/examples/AgentCheckpointsExample.js +6 -5
  52. package/lib/examples/{AgentSandboxExample.d.ts → AgentCodeSandboxExample.d.ts} +4 -4
  53. package/lib/examples/{AgentSandboxExample.js → AgentCodeSandboxExample.js} +10 -9
  54. package/lib/examples/AgentCodeSandboxesExample.js +2 -2
  55. package/lib/examples/AgentCodemodeExample.js +3 -3
  56. package/lib/examples/AgentCompactionExample.d.ts +12 -0
  57. package/lib/examples/AgentCompactionExample.js +244 -0
  58. package/lib/examples/AgentEvalsExample.js +10 -20
  59. package/lib/examples/AgentGuardrailsExample.js +2 -2
  60. package/lib/examples/AgentHooksExample.js +1 -1
  61. package/lib/examples/AgentInferenceProviderExample.js +6 -8
  62. package/lib/examples/AgentLoopExample.js +3 -3
  63. package/lib/examples/AgentMCPExample.js +3 -3
  64. package/lib/examples/AgentMemoryExample.d.ts +4 -2
  65. package/lib/examples/AgentMemoryExample.js +93 -10
  66. package/lib/examples/AgentMonitoringExample.js +2 -2
  67. package/lib/examples/AgentNotificationsExample.js +1 -1
  68. package/lib/examples/AgentOtelExample.d.ts +2 -3
  69. package/lib/examples/AgentOtelExample.js +7 -12
  70. package/lib/examples/AgentOutputsExample.js +5 -5
  71. package/lib/examples/AgentParametersExample.js +3 -3
  72. package/lib/examples/AgentSkillsExample.js +4 -4
  73. package/lib/examples/AgentSubagentsExample.d.ts +2 -2
  74. package/lib/examples/AgentSubagentsExample.js +43 -34
  75. package/lib/examples/AgentToolApprovalsExample.js +1 -1
  76. package/lib/examples/AgentTriggersExample.js +9 -11
  77. package/lib/examples/AgentspecsExample.js +13 -5
  78. package/lib/examples/CellExample.d.ts +6 -0
  79. package/lib/examples/CellExample.js +84 -0
  80. package/lib/examples/ChatCustomExample.js +1 -1
  81. package/lib/examples/ChatExample.js +1 -1
  82. package/lib/examples/ChatStandaloneExample.js +2 -2
  83. package/lib/examples/HomeExample.js +29 -28
  84. package/lib/examples/Lexical2Example.js +2 -2
  85. package/lib/examples/LexicalAgentExample.js +1 -1
  86. package/lib/examples/LexicalAgentSidebarExample.js +2 -2
  87. package/lib/examples/NotebookAgentSidebarExample.d.ts +1 -1
  88. package/lib/examples/NotebookAgentSidebarExample.js +5 -4
  89. package/lib/examples/NotebookCollaborationExample.js +3 -3
  90. package/lib/examples/NotebookExample.js +2 -2
  91. package/lib/examples/components/ExampleWrapper.js +5 -0
  92. package/lib/examples/components/Header.js +2 -2
  93. package/lib/examples/components/HeaderControls.js +1 -1
  94. package/lib/examples/components/LexicalEditor.js +1 -1
  95. package/lib/examples/components/MainContent.js +1 -1
  96. package/lib/examples/components/MockFileBrowser.js +8 -8
  97. package/lib/examples/components/TimeTravel.js +1 -1
  98. package/lib/examples/components/haiku/HaikuDisplay.js +2 -2
  99. package/lib/examples/example-selector.js +4 -3
  100. package/lib/examples/hooks/useExampleAgentRuntime.js +11 -1
  101. package/lib/examples/hooks/useExampleAgentRuntimes.d.ts +7 -0
  102. package/lib/examples/hooks/useExampleAgentRuntimes.js +82 -0
  103. package/lib/examples/index.d.ts +2 -1
  104. package/lib/examples/index.js +2 -1
  105. package/lib/examples/main.js +359 -46
  106. package/lib/examples/utils/agentSummaryStore.d.ts +17 -0
  107. package/lib/examples/utils/themedProvider.js +32 -2
  108. package/lib/examples/utils/useExampleAgentRuntimesUrl.js +2 -1
  109. package/lib/examples2/NotebookMutationsKernel.js +6 -3
  110. package/lib/examples2/NotebookMutationsServiceManager.js +6 -3
  111. package/lib/examples2/ReactRouterExample.js +5 -5
  112. package/lib/examples2/main.js +38 -0
  113. package/lib/hooks/useAIAgentsWebSocket.js +35 -0
  114. package/lib/hooks/useAgentRuntimes.d.ts +22 -0
  115. package/lib/hooks/useAgentRuntimes.js +192 -5
  116. package/lib/hooks/useCheckpoints.js +2 -2
  117. package/lib/hooks/useToolApprovals.d.ts +10 -4
  118. package/lib/hooks/useToolApprovals.js +11 -5
  119. package/lib/identity/AgentIdentity.js +1 -2
  120. package/lib/models/Runtime.d.ts +10 -8
  121. package/lib/models/RuntimeDTO.d.ts +5 -3
  122. package/lib/models/RuntimeDTO.js +3 -3
  123. package/lib/runtimes/actions.js +3 -1
  124. package/lib/runtimes/apis.d.ts +7 -0
  125. package/lib/shims/primerAddonsBox.d.ts +1 -0
  126. package/lib/shims/primerAddonsBox.js +7 -0
  127. package/lib/specs/agents/agents.d.ts +51 -0
  128. package/lib/specs/agents/agents.js +3389 -94
  129. package/lib/specs/models.d.ts +2 -0
  130. package/lib/specs/models.js +37 -0
  131. package/lib/stores/agentRuntimeStore.d.ts +32 -1
  132. package/lib/stores/agentRuntimeStore.js +65 -1
  133. package/lib/stores/index.d.ts +1 -1
  134. package/lib/stores/index.js +1 -1
  135. package/lib/types/agents.d.ts +9 -3
  136. package/lib/types/agentspecs.d.ts +2 -0
  137. package/lib/types/chat.d.ts +83 -0
  138. package/lib/types/models.d.ts +5 -0
  139. package/lib/types/stream.d.ts +58 -1
  140. package/package.json +6 -5
  141. package/scripts/codegen/generate_agents.py +7 -0
  142. package/scripts/codegen/generate_models.py +22 -9
  143. package/scripts/gen_workers.py +340 -0
  144. package/lib/examples/CellSimpleExample.d.ts +0 -6
  145. package/lib/examples/CellSimpleExample.js +0 -20
  146. package/scripts/codegen/__pycache__/generate_sandbox_agents.cpython-313.pyc +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datalayer/agent-runtimes",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  ".",
@@ -69,7 +69,7 @@
69
69
  "create:patches": "bash scripts/create-patches.sh",
70
70
  "examples": "run-p server:start server:start:codemode jupyter:start examples:vite",
71
71
  "examples2": "run-p server:start server:start:codemode jupyter:start examples2:vite",
72
- "examples:proxy": "make examples:proxy",
72
+ "example-local": "make example-local",
73
73
  "examples:fresh": "npm run clean:cache && npm run examples",
74
74
  "examples:jupyter": "run-p jupyter:start server:start server:start:codemode examples:vite",
75
75
  "examples:nextjs": "npm run dev --workspace=nextjs-notebook-example",
@@ -102,8 +102,8 @@
102
102
  "start:acp:vite": "VITE_ACP_WS_URL=ws://localhost:8765/api/v1/acp/ws vite",
103
103
  "start:agent": "run-p server:start start:agent:vite",
104
104
  "start:agent:vite": "vite --open /html/agent.html",
105
- "start:agent-node": "run-p server:start:agent-node start:agent-node:vite",
106
- "start:agent-node:vite": "vite --open /html/agent-node.html",
105
+ "start:agent-node": "run-p server:start:agent-node jupyter:start start:agent-node:vite",
106
+ "start:agent-node:vite": "VITE_JUPYTER_SANDBOX_URL=${VITE_JUPYTER_SANDBOX_URL:-http://0.0.0.0:8888/api/jupyter-server?token=60c1661cc408f978c309d04157af55c9588ff9557c9380e4fb50785750703da6} vite --open /html/agent-node.html",
107
107
  "start:agent-notebook": "run-p server:start jupyter:start start:agent-notebook:vite",
108
108
  "start:agent-notebook:vite": "vite --open /html/agent-notebook.html",
109
109
  "start:agent-document": "run-p server:start jupyter:start start:agent-document:vite",
@@ -141,6 +141,7 @@
141
141
  "@datalayer/core": "^1.1.48",
142
142
  "@datalayer/icons-react": "^1.0.7",
143
143
  "@datalayer/jupyter-lexical": "^1.0.16",
144
+ "@datalayer/lexical-loro": "^1.0.0",
144
145
  "@datalayer/jupyter-react": "^2.0.7",
145
146
  "@datalayer/primer-addons": "^1.0.15",
146
147
  "@datalayer/primer-rjsf": "^1.0.3",
@@ -299,7 +300,7 @@
299
300
  "playwright": "^1.53.2",
300
301
  "prettier": "^3.6.2",
301
302
  "react-router-dom": "^6.22.3",
302
- "rimraf": "^6.0.1",
303
+ "rimraf": "^6.1.3",
303
304
  "storybook": "^9.1.1",
304
305
  "typedoc-plugin-markdown": "^4.0.0",
305
306
  "typescript": "^5.8.3",
@@ -367,12 +367,15 @@ from agent_runtimes.types import Agentspec, SubAgentspecConfig, SubAgentsConfig
367
367
  )
368
368
  subagents_str = "SubAgentsConfig(" + ", ".join(cfg_parts) + ")"
369
369
 
370
+ domain_value = spec.get("domain") or spec.get("vertical")
371
+
370
372
  code += f'''{const_name} = Agentspec(
371
373
  id="{full_agent_id}",
372
374
  version="{version}",
373
375
  name="{display_name}",
374
376
  description="{description}",
375
377
  tags={_fmt_list(spec.get("tags", []))},
378
+ domain={f'"{domain_value}"' if domain_value else "None"},
376
379
  enabled={spec.get("enabled", True)},
377
380
  model={model_str},
378
381
  inference_provider={inference_provider_str},
@@ -836,6 +839,9 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
836
839
  tags = spec.get("tags", [])
837
840
  tags_str = "[" + ", ".join(f"'{t}'" for t in tags) + "]"
838
841
 
842
+ domain_val = spec.get("domain") or spec.get("vertical")
843
+ domain_ts = f"'{domain_val}'" if domain_val else "undefined"
844
+
839
845
  suggestions = spec.get("suggestions", [])
840
846
  # Escape single quotes in suggestions for TypeScript
841
847
  escaped_suggestions = [s.replace("'", "\\'") for s in suggestions]
@@ -940,6 +946,7 @@ const FRONTEND_TOOL_MAP: Record<string, any> = {
940
946
  name: '{display_name}',
941
947
  description: `{description}`,
942
948
  tags: {tags_str},
949
+ domain: {domain_ts},
943
950
  enabled: {str(spec.get("enabled", True)).lower()},
944
951
  model: {model_ts},
945
952
  {inference_provider_line} mcpServers: [{mcp_servers_str}],
@@ -104,6 +104,11 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
104
104
  else:
105
105
  env_vars_formatted = "[]"
106
106
 
107
+ tokens_limit = spec.get("tokens_limit")
108
+ tokens_limit_formatted = (
109
+ str(tokens_limit) if tokens_limit is not None else "None"
110
+ )
111
+
107
112
  lines.extend(
108
113
  [
109
114
  f"{const_name} = AIModel(",
@@ -114,6 +119,7 @@ def generate_python_code(specs: list[dict[str, Any]]) -> str:
114
119
  f' provider="{spec["provider"]}",',
115
120
  f" default={spec.get('default', False)},",
116
121
  f" required_env_vars={env_vars_formatted},",
122
+ f" tokens_limit={tokens_limit_formatted},",
117
123
  ")",
118
124
  "",
119
125
  ]
@@ -288,20 +294,27 @@ def generate_typescript_code(specs: list[dict[str, Any]]) -> str:
288
294
  # Escape description for TypeScript
289
295
  description = spec.get("description", "").replace("'", "\\'")
290
296
 
291
- lines.extend(
297
+ tokens_limit = spec.get("tokens_limit")
298
+
299
+ model_lines = [
300
+ f"export const {const_name}: AIModel = {{",
301
+ f" id: '{spec['id']}',",
302
+ f" version: '{spec['version']}',",
303
+ f" name: '{spec['name']}',",
304
+ f" description: '{description}',",
305
+ f" provider: '{spec['provider']}',",
306
+ f" default: {str(spec.get('default', False)).lower()},",
307
+ f" requiredEnvVars: {env_vars_formatted},",
308
+ ]
309
+ if tokens_limit is not None:
310
+ model_lines.append(f" tokensLimit: {tokens_limit},")
311
+ model_lines.extend(
292
312
  [
293
- f"export const {const_name}: AIModel = {{",
294
- f" id: '{spec['id']}',",
295
- f" version: '{spec['version']}',",
296
- f" name: '{spec['name']}',",
297
- f" description: '{description}',",
298
- f" provider: '{spec['provider']}',",
299
- f" default: {str(spec.get('default', False)).lower()},",
300
- f" requiredEnvVars: {env_vars_formatted},",
301
313
  "};",
302
314
  "",
303
315
  ]
304
316
  )
317
+ lines.extend(model_lines)
305
318
 
306
319
  # Generate catalog object
307
320
  lines.extend(
@@ -0,0 +1,340 @@
1
+ # Copyright (c) 2025-2026 Datalayer, Inc.
2
+ # Distributed under the terms of the Modified BSD License.
3
+ """One-off generator for the workers-* agent specs (9 verticals).
4
+
5
+ Creates one YAML spec per worker example from the Agent Workers portfolio.
6
+ Skips the three flagship workers that already exist as hand-authored specs.
7
+ """
8
+
9
+ from pathlib import Path
10
+
11
+ AGENTS_DIR = Path(__file__).resolve().parent.parent / "agentspecs" / "agentspecs" / "agents"
12
+
13
+ # Per-vertical defaults: label, emoji, icon, color, mcp servers, skills, envvars.
14
+ VERTICALS = {
15
+ "earth-observation": {
16
+ "emoji": "🛰️", "icon": "globe", "color": "#10B981",
17
+ "mcp": ["earthdata:0.0.1", "tavily:0.0.1"],
18
+ "skills": ["text-summarizer:0.0.1", "crawl:0.0.1"],
19
+ "envvars": ["TAVILY_API_KEY:0.0.1"],
20
+ },
21
+ "accounting": {
22
+ "emoji": "🧾", "icon": "credit-card", "color": "#F59E0B",
23
+ "mcp": ["odoo:0.0.1"],
24
+ "skills": ["accounting:0.0.1", "pdf:0.0.1"],
25
+ "envvars": [],
26
+ },
27
+ "energy": {
28
+ "emoji": "⚡", "icon": "zap", "color": "#EAB308",
29
+ "mcp": ["tavily:0.0.1", "chart:0.0.1"],
30
+ "skills": ["text-summarizer:0.0.1"],
31
+ "envvars": ["TAVILY_API_KEY:0.0.1"],
32
+ },
33
+ "insurance": {
34
+ "emoji": "🛡️", "icon": "shield", "color": "#EF4444",
35
+ "mcp": ["earthdata:0.0.1", "tavily:0.0.1"],
36
+ "skills": ["text-summarizer:0.0.1", "pdf:0.0.1"],
37
+ "envvars": ["TAVILY_API_KEY:0.0.1"],
38
+ },
39
+ "life-sciences": {
40
+ "emoji": "🧬", "icon": "beaker", "color": "#06B6D4",
41
+ "mcp": ["huggingface:0.0.1", "kaggle:0.0.1"],
42
+ "skills": ["text-summarizer:0.0.1", "pdf:0.0.1"],
43
+ "envvars": ["HF_TOKEN:0.0.1", "KAGGLE_TOKEN:0.0.1"],
44
+ },
45
+ "capital-markets": {
46
+ "emoji": "📈", "icon": "graph", "color": "#3B82F6",
47
+ "mcp": ["alphavantage:0.0.1", "chart:0.0.1"],
48
+ "skills": ["text-summarizer:0.0.1"],
49
+ "envvars": ["ALPHAVANTAGE_API_KEY:0.0.1"],
50
+ },
51
+ "personal-assistant": {
52
+ "emoji": "🤖", "icon": "person", "color": "#A855F7",
53
+ "mcp": ["tavily:0.0.1", "google-workspace:0.0.1"],
54
+ "skills": ["text-summarizer:0.0.1", "crawl:0.0.1", "events:0.0.1"],
55
+ "envvars": ["TAVILY_API_KEY:0.0.1"],
56
+ },
57
+ "marketing": {
58
+ "emoji": "📣", "icon": "megaphone", "color": "#8B5CF6",
59
+ "mcp": ["tavily:0.0.1", "slack:0.0.1"],
60
+ "skills": ["text-summarizer:0.0.1", "crawl:0.0.1", "events:0.0.1"],
61
+ "envvars": ["TAVILY_API_KEY:0.0.1", "SLACK_BOT_TOKEN:0.0.1"],
62
+ },
63
+ "market-analyst": {
64
+ "emoji": "🔎", "icon": "search", "color": "#EC4899",
65
+ "mcp": ["tavily:0.0.1", "salesforce:0.0.1"],
66
+ "skills": ["text-summarizer:0.0.1", "crawl:0.0.1"],
67
+ "envvars": ["TAVILY_API_KEY:0.0.1"],
68
+ },
69
+ }
70
+
71
+ # worker slug -> (vertical, name, description, goal). Renamed flagships excluded.
72
+ WORKERS = {
73
+ # Earth Observation
74
+ "change-detection": ("earth-observation", "Change Detection Worker",
75
+ "Detects environmental and land-use change between satellite image time periods and produces evidence-backed change maps.",
76
+ "Compare imagery across time periods, detect meaningful land-use and environmental change, and deliver annotated maps and reports."),
77
+ "crop-monitoring": ("earth-observation", "Crop Monitoring Worker",
78
+ "Monitors crop health, growth stages, and field conditions using multi-temporal satellite imagery.",
79
+ "Track crop vigor and growth over time from satellite imagery and flag fields that need attention."),
80
+ "disaster-assessment": ("earth-observation", "Disaster Assessment Worker",
81
+ "Assesses affected areas after natural disasters by comparing pre- and post-event satellite imagery.",
82
+ "Rapidly estimate affected areas and damage extent after a disaster and produce a response-ready assessment."),
83
+ "infrastructure-monitoring": ("earth-observation", "Infrastructure Monitoring Worker",
84
+ "Monitors infrastructure and physical assets from satellite imagery and detects anomalies over time.",
85
+ "Continuously monitor infrastructure from satellite imagery and surface anomalies with supporting evidence."),
86
+ "environmental-compliance": ("earth-observation", "Environmental Compliance Worker",
87
+ "Tracks environmental compliance from Earth observation data and generates recurring, auditable reports.",
88
+ "Detect potential environmental compliance issues from EO data and produce traceable evidence-backed reports."),
89
+ # Accounting (Odoo)
90
+ "ap-invoice": ("accounting", "AP Invoice Worker",
91
+ "Extracts, codes, and matches supplier invoices to purchase orders and receipts in Odoo.",
92
+ "Extract and code supplier invoices, match them to POs and receipts, and prepare them for approval."),
93
+ "bank-reconciliation": ("accounting", "Bank Reconciliation Worker",
94
+ "Reconciles bank statements against the ledger, matches transactions, and investigates exceptions.",
95
+ "Reconcile bank feeds against the ledger, auto-match transactions, and flag exceptions for review."),
96
+ "month-end-close": ("accounting", "Month-End Close Worker",
97
+ "Prepares close checklists, suggests accruals, and reconciles intercompany balances for month-end close.",
98
+ "Drive the month-end close checklist, suggest accruals, and surface remaining reconciliation gaps."),
99
+ "collections": ("accounting", "Collections Worker",
100
+ "Follows up on overdue receivables and drafts collection communications for approval.",
101
+ "Prioritize overdue receivables and draft tailored collection follow-ups for human approval."),
102
+ "expense-audit": ("accounting", "Expense Audit Worker",
103
+ "Audits employee expenses for duplicates, anomalies, and policy violations.",
104
+ "Review expenses for duplicates, anomalies, and policy breaches, and summarize findings."),
105
+ "audit-pack-builder": ("accounting", "Audit-Pack Builder",
106
+ "Assembles auditable evidence packs from invoices, approvals, and postings across Odoo.",
107
+ "Assemble a complete, traceable audit-evidence pack for a given period or transaction set."),
108
+ # Energy and Utilities
109
+ "renewable-asset-performance": ("energy", "Renewable Asset Performance Worker",
110
+ "Compares expected versus actual generation, adjusts for weather, and investigates performance anomalies.",
111
+ "Compare expected vs actual generation, weather-adjust performance, and investigate underperformance."),
112
+ "grid-forecast": ("energy", "Grid Forecast Worker",
113
+ "Forecasts electricity demand and prices to support grid operations and planning.",
114
+ "Produce demand and price forecasts for grid operations with clear assumptions and confidence."),
115
+ "curtailment-investigator": ("energy", "Curtailment Investigator",
116
+ "Analyzes curtailment events, quantifies lost generation, and investigates root causes.",
117
+ "Investigate curtailment events, quantify lost generation, and explain the primary drivers."),
118
+ "energy-trading-analyst": ("energy", "Energy Trading Analyst",
119
+ "Analyzes power markets, price signals, and trading opportunities across energy markets.",
120
+ "Analyze power-market signals and surface evidence-backed trading opportunities and risks."),
121
+ "predictive-maintenance": ("energy", "Predictive Maintenance Worker",
122
+ "Detects equipment degradation and anomalies to predict failures and prioritize maintenance.",
123
+ "Detect degradation and anomalies, predict likely failures, and prioritize maintenance work."),
124
+ # Insurance
125
+ "cat-exposure": ("insurance", "CAT Exposure Worker",
126
+ "Geocodes insurance portfolios and overlays hazard data to analyze catastrophe exposure.",
127
+ "Geocode portfolios, overlay hazard layers, and quantify catastrophe exposure with lineage."),
128
+ "event-response": ("insurance", "Event Response Worker",
129
+ "Assesses live catastrophe events against insured portfolios to estimate exposure and losses.",
130
+ "Assess a live catastrophe event against the portfolio and publish an auditable exposure estimate."),
131
+ "portfolio-accumulation": ("insurance", "Portfolio Accumulation Worker",
132
+ "Analyzes accumulation and concentration risk across an insurance portfolio.",
133
+ "Analyze accumulation and concentration risk and highlight where limits are approached."),
134
+ "exposure-data-quality": ("insurance", "Exposure Data Quality Worker",
135
+ "Cleanses exposure data, validates geocoding, and improves data quality for risk analysis.",
136
+ "Cleanse and validate exposure data and geocoding, and report remaining data-quality gaps."),
137
+ "model-comparison": ("insurance", "Model Comparison Worker",
138
+ "Compares catastrophe models and scenarios and explains differences in loss drivers.",
139
+ "Compare catastrophe models and scenarios and explain the drivers behind divergent results."),
140
+ # Life Sciences
141
+ "rna-seq": ("life-sciences", "RNA-Seq Worker",
142
+ "Runs RNA-seq quality control and differential expression analysis with reproducible pipelines.",
143
+ "Run RNA-seq QC and differential expression analysis and produce reproducible, documented results."),
144
+ "variant-analysis": ("life-sciences", "Variant Analysis Worker",
145
+ "Analyzes genomic variants, annotates findings, and prepares interpretable reports.",
146
+ "Analyze and annotate genomic variants and produce an interpretable, provenance-tracked report."),
147
+ "single-cell-processing": ("life-sciences", "Single-Cell Processing Worker",
148
+ "Processes, clusters, and annotates single-cell datasets with reproducible workflows.",
149
+ "Process and cluster single-cell data and deliver annotated, reproducible outputs."),
150
+ "cohort-comparison": ("life-sciences", "Cohort Comparison Worker",
151
+ "Compares cohorts, validates statistical results, and checks reproducibility.",
152
+ "Compare cohorts, validate the statistics, and confirm results are reproducible."),
153
+ "pipeline-debugger": ("life-sciences", "Pipeline Debugger",
154
+ "Troubleshoots bioinformatics pipeline failures and suggests corrective actions.",
155
+ "Diagnose bioinformatics pipeline failures and recommend concrete fixes with evidence."),
156
+ "compute-cost-optimizer": ("life-sciences", "Compute-Cost Optimizer",
157
+ "Optimizes pipeline runtime and compute cost while preserving reproducibility.",
158
+ "Analyze pipeline runs and recommend runtime and cost optimizations without breaking reproducibility."),
159
+ # Capital Markets
160
+ "quant-research": ("capital-markets", "Quant Research Worker",
161
+ "Constructs datasets and researches factors for quantitative strategies with point-in-time care.",
162
+ "Construct clean datasets and research factors, respecting point-in-time correctness."),
163
+ "portfolio-risk": ("capital-markets", "Portfolio Risk Worker",
164
+ "Computes exposures and generates recurring, auditable portfolio risk reports.",
165
+ "Compute portfolio exposures and produce recurring, auditable risk reports."),
166
+ "backtest-auditor": ("capital-markets", "Backtest Auditor",
167
+ "Audits backtests for look-ahead leakage, survivorship bias, and methodological errors.",
168
+ "Audit a backtest for leakage, survivorship bias, and other flaws, and report findings."),
169
+ "factor-analysis": ("capital-markets", "Factor Analysis Worker",
170
+ "Analyzes factor exposures and returns across a portfolio or strategy.",
171
+ "Analyze factor exposures and returns and explain the primary contributors."),
172
+ "performance-attribution": ("capital-markets", "Performance Attribution Worker",
173
+ "Attributes portfolio performance to its underlying drivers and produces clear reports.",
174
+ "Attribute portfolio performance to its drivers and produce a clear, auditable report."),
175
+ "scenario-testing": ("capital-markets", "Scenario Testing Worker",
176
+ "Runs stress tests and scenario analysis to quantify portfolio sensitivity to shocks.",
177
+ "Run stress tests and scenarios and quantify portfolio sensitivity to defined shocks."),
178
+ # Personal Assistant (news-aggregator excluded, already exists)
179
+ "travel-recommender": ("personal-assistant", "Travel Recommender",
180
+ "Researches travel options and builds personalized itineraries with source comparison.",
181
+ "Research travel options and build a personalized itinerary, comparing sources and prices."),
182
+ "trends-seeker": ("personal-assistant", "Trends Seeker",
183
+ "Tracks emerging trends across sources and summarizes what is gaining momentum.",
184
+ "Track emerging trends across sources and summarize what is worth attention and why."),
185
+ "product-finder": ("personal-assistant", "Product Finder",
186
+ "Researches and compares products against a user's criteria and budget.",
187
+ "Research and compare products against the user's criteria and recommend the best fit."),
188
+ "job-hunter": ("personal-assistant", "Job Hunter",
189
+ "Searches for relevant jobs and prepares tailored application materials.",
190
+ "Find relevant roles and prepare tailored application materials for review."),
191
+ "coding-tutor": ("personal-assistant", "Coding Tutor",
192
+ "Teaches coding through interactive, executable exercises and step-by-step feedback.",
193
+ "Teach coding interactively with executable exercises and give clear, incremental feedback."),
194
+ "mail-triage": ("personal-assistant", "Mail Triage Worker",
195
+ "Classifies the inbox, drafts replies, and extracts follow-up tasks, with approval for sending.",
196
+ "Classify the inbox, draft replies, and extract tasks, requiring approval before sending anything."),
197
+ # Marketing (social-marketer excluded, already exists)
198
+ "campaign-planning": ("marketing", "Campaign Planning Worker",
199
+ "Plans content calendars and campaign tasks across channels.",
200
+ "Plan a content calendar and campaign tasks aligned to goals and channels."),
201
+ "content-repurposing": ("marketing", "Content Repurposing Worker",
202
+ "Adapts existing content and assets across channels and formats.",
203
+ "Repurpose existing content into channel-specific formats while keeping brand voice."),
204
+ "social-listening": ("marketing", "Social Listening Worker",
205
+ "Monitors conversations across platforms and surfaces actionable insights.",
206
+ "Monitor conversations at scale and surface actionable, evidence-backed insights."),
207
+ "community-response": ("marketing", "Community Response Worker",
208
+ "Triages comments and messages and drafts community replies for approval.",
209
+ "Triage community comments and draft on-brand replies for human approval."),
210
+ # Market Analyst (customer-interviewer excluded, already exists)
211
+ "interview-guide": ("market-analyst", "Interview Guide Worker",
212
+ "Generates research plans and structured interview guides from research objectives.",
213
+ "Turn research objectives into a structured research plan and interview guide."),
214
+ "research-recruiter": ("market-analyst", "Research Recruiter",
215
+ "Selects and schedules research participants and manages consent.",
216
+ "Select suitable participants, schedule sessions, and manage consent."),
217
+ "thematic-analysis": ("market-analyst", "Thematic Analysis Worker",
218
+ "Codes transcripts, extracts themes, and organizes qualitative evidence.",
219
+ "Code transcripts, extract themes, and organize the supporting evidence."),
220
+ "competitive-intelligence": ("market-analyst", "Competitive Intelligence Worker",
221
+ "Researches competitors and market dynamics and synthesizes findings.",
222
+ "Research competitors and market dynamics and synthesize evidence-backed findings."),
223
+ "evidence-repository": ("market-analyst", "Evidence Repository Worker",
224
+ "Organizes research evidence for traceability from qualitative findings to conclusions.",
225
+ "Organize research evidence so every conclusion traces back to its source."),
226
+ }
227
+
228
+ TEMPLATE = """# Copyright (c) 2025-2026 Datalayer, Inc.
229
+ # Distributed under the terms of the Modified BSD License.
230
+
231
+ # Agent Specification: {name}
232
+ # {vertical_label} vertical worker.
233
+
234
+ id: workers-{slug}
235
+ version: 0.0.1
236
+ name: {name}
237
+ domain: {vertical}
238
+ description: >-
239
+ {description}
240
+
241
+ tags:
242
+ {tags}
243
+
244
+ enabled: true
245
+ model: "bedrock:us.anthropic.claude-sonnet-4-6"
246
+
247
+ sandbox_variant: jupyter
248
+
249
+ # Durable memory to retain context across sessions
250
+ memory: mem0
251
+
252
+ # MCP servers used by this agent
253
+ mcp_servers:
254
+ {mcp}
255
+
256
+ # Skills available to this agent
257
+ skills:
258
+ {skills}
259
+
260
+ # Runtime tools — sensitive actions require human approval
261
+ tools:
262
+ - runtime-echo:0.0.1
263
+ - runtime-sensitive-echo:0.0.1
264
+ frontend_tools:
265
+ - jupyter-notebook:0.0.1
266
+ - lexical-document:0.0.1
267
+ {envvars}
268
+ # Runtime environment
269
+ environment_name: ai-agents-env
270
+
271
+ # UI customization
272
+ icon: {icon}
273
+ emoji: "{emoji}"
274
+ color: "{color}"
275
+
276
+ # Goal / Prompt (Step 4 in the UI — the user-facing objective)
277
+ goal: >-
278
+ {goal}
279
+
280
+ # Protocols & UI Extensions
281
+ protocol: vercel-ai
282
+ ui_extension: a2ui
283
+
284
+ # Model configuration
285
+ model_config:
286
+ temperature: 0.5
287
+ max_tokens: 4096
288
+
289
+ # Codemode
290
+ codemode:
291
+ enabled: true
292
+
293
+ # System prompt
294
+ system_prompt: >-
295
+ {system_prompt}
296
+ """
297
+
298
+
299
+ def yaml_list(items):
300
+ return "\n".join(f" - {i}" for i in items)
301
+
302
+
303
+ def main():
304
+ written = 0
305
+ for slug, (vertical, name, description, goal) in WORKERS.items():
306
+ cfg = VERTICALS[vertical]
307
+ tags = [vertical, "agent-worker"]
308
+ envvars_block = ""
309
+ if cfg["envvars"]:
310
+ envvars_block = "\n# Secrets / environment variables\nenvvars:\n" + yaml_list(cfg["envvars"]) + "\n"
311
+ system_prompt = (
312
+ f"You are the {name}, an autonomous agent worker in the "
313
+ f"{vertical.replace('-', ' ')} domain. {description} "
314
+ "Work step by step, show your reasoning and evidence, and require "
315
+ "explicit human approval before any external or irreversible action."
316
+ )
317
+ content = TEMPLATE.format(
318
+ name=name,
319
+ slug=slug,
320
+ vertical=vertical,
321
+ vertical_label=vertical.replace("-", " ").title(),
322
+ description=description,
323
+ tags=yaml_list(tags),
324
+ mcp=yaml_list(cfg["mcp"]),
325
+ skills=yaml_list(cfg["skills"]),
326
+ envvars=envvars_block,
327
+ icon=cfg["icon"],
328
+ emoji=cfg["emoji"],
329
+ color=cfg["color"],
330
+ goal=goal,
331
+ system_prompt=system_prompt,
332
+ )
333
+ path = AGENTS_DIR / f"workers-{slug}.yaml"
334
+ path.write_text(content, encoding="utf-8")
335
+ written += 1
336
+ print(f"Wrote {written} worker specs to {AGENTS_DIR}")
337
+
338
+
339
+ if __name__ == "__main__":
340
+ main()
@@ -1,6 +0,0 @@
1
- import { ServiceManager } from '@jupyterlab/services';
2
- type IJupyterCellExampleProps = {
3
- serviceManager?: ServiceManager.IManager;
4
- };
5
- export declare const JupyterCellExample: (props: IJupyterCellExampleProps) => import("react/jsx-runtime").JSX.Element;
6
- export default JupyterCellExample;
@@ -1,20 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Cell, KernelIndicator, useJupyter, useKernelsStore, useCellsStore, } from '@datalayer/jupyter-react';
3
- import { ThemedJupyterProvider } from './utils/themedProvider';
4
- import { Button, Label } from '@primer/react';
5
- import { Box } from '@datalayer/primer-addons';
6
- const CELL_ID = 'cell-example-1';
7
- const DEFAULT_SOURCE = `from IPython.display import display
8
-
9
- for i in range(10):
10
- display('I am a long string which is repeatedly added to the dom in separated divs: %d' % i)`;
11
- const JupyterCellExampleContent = () => {
12
- const { defaultKernel } = useJupyter({ startDefaultKernel: true });
13
- const cellsStore = useCellsStore();
14
- const kernelsStore = useKernelsStore();
15
- return (_jsxs(Box, { p: 4, children: [_jsx(Box, { as: "h1", children: "Jupyter Cell Example" }), _jsxs(Box, { children: ["Source: ", cellsStore.getSource(CELL_ID)] }), _jsxs(Box, { children: ["Outputs Count: ", cellsStore.getOutputsCount(CELL_ID)] }), _jsxs(Box, { children: ["Kernel State:", ' ', _jsx(Label, { children: defaultKernel && kernelsStore.getExecutionState(defaultKernel.id) })] }), _jsxs(Box, { children: ["Kernel Phase:", ' ', _jsx(Label, { children: defaultKernel && kernelsStore.getExecutionPhase(defaultKernel.id) })] }), _jsxs(Box, { display: "flex", children: [_jsx(Box, { children: "Kernel Indicator:" }), _jsx(Box, { ml: 3, children: _jsx(KernelIndicator, { kernel: defaultKernel && defaultKernel.connection }) })] }), _jsx(Box, { children: _jsx(Button, { onClick: () => cellsStore.execute(CELL_ID), children: "Run cell" }) }), _jsx(Cell, { source: DEFAULT_SOURCE, id: CELL_ID, kernel: defaultKernel })] }));
16
- };
17
- export const JupyterCellExample = (props) => {
18
- return (_jsx(ThemedJupyterProvider, { children: _jsx(JupyterCellExampleContent, {}) }));
19
- };
20
- export default JupyterCellExample;