@datalayer/agent-runtimes 1.3.29 → 1.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AgentNode.js +14 -33
- package/lib/chat/ChatFloating.js +40 -8
- package/lib/chat/assistant/AssistantStage.d.ts +26 -7
- package/lib/chat/assistant/AssistantStage.js +115 -8
- package/lib/chat/assistant/SpeechBalloon.js +7 -3
- package/lib/chat/assistant/characters.d.ts +32 -1
- package/lib/chat/assistant/characters.js +180 -15
- package/lib/chat/assistant/state.d.ts +28 -0
- package/lib/chat/assistant/state.js +31 -0
- package/lib/chat/base/ChatBase.js +74 -50
- package/lib/chat/base/modelChoice.d.ts +40 -1
- package/lib/chat/base/modelChoice.js +42 -15
- package/lib/chat/prompt/InputPrompt.d.ts +7 -1
- package/lib/chat/prompt/InputPrompt.js +2 -2
- package/lib/chat/prompt/InputPromptBase.js +1 -1
- package/lib/chat/prompt/menus/ModelSelector.d.ts +13 -1
- package/lib/chat/prompt/menus/ModelSelector.js +17 -5
- package/lib/chat/useViewportDrag.d.ts +9 -1
- package/lib/chat/useViewportDrag.js +4 -4
- package/lib/components/a2ui/index.d.ts +2 -0
- package/lib/components/a2ui/index.js +2 -0
- package/lib/components/a2ui/visibility.d.ts +15 -0
- package/lib/components/a2ui/visibility.js +24 -0
- package/lib/components/a2ui/visibleWhen.d.ts +17 -0
- package/lib/components/a2ui/visibleWhen.js +54 -0
- package/lib/examples/ChatAssistantExample.d.ts +4 -0
- package/lib/examples/ChatAssistantExample.js +26 -5
- package/lib/examples/utils/owlCharacterPlugin.d.ts +7 -0
- package/lib/examples/utils/owlCharacterPlugin.js +44 -0
- package/lib/loop/apps/AppFeedback.d.ts +27 -0
- package/lib/loop/apps/AppFeedback.js +78 -0
- package/lib/loop/apps/AppRenderer.d.ts +33 -1
- package/lib/loop/apps/AppRenderer.js +111 -29
- package/lib/loop/apps/agent.d.ts +15 -0
- package/lib/loop/apps/agent.js +42 -0
- package/lib/loop/apps/appspec.js +6 -3
- package/lib/loop/apps/checks.d.ts +10 -2
- package/lib/loop/apps/checks.js +21 -10
- package/lib/loop/apps/feedback.d.ts +51 -0
- package/lib/loop/apps/feedback.js +61 -0
- package/lib/loop/apps/index.d.ts +3 -0
- package/lib/loop/apps/index.js +3 -0
- package/lib/loop/apps/rules.d.ts +14 -0
- package/lib/loop/apps/rules.js +24 -0
- package/lib/loop/core/canvasBlocks.d.ts +16 -0
- package/lib/loop/core/canvasBlocks.js +13 -0
- package/lib/loop/core/index.d.ts +15 -0
- package/lib/loop/core/index.js +3 -0
- package/lib/loop/embed/AppEmbed.d.ts +42 -0
- package/lib/loop/embed/AppEmbed.js +205 -0
- package/lib/loop/embed/datalayer-app.d.ts +1 -0
- package/lib/loop/embed/datalayer-app.js +16 -0
- package/lib/loop/embed/element.d.ts +57 -0
- package/lib/loop/embed/element.js +405 -0
- package/lib/loop/embed/embedConfig.d.ts +120 -0
- package/lib/loop/embed/embedConfig.js +148 -0
- package/lib/loop/embed/embedTheme.d.ts +24 -0
- package/lib/loop/embed/embedTheme.js +83 -0
- package/lib/loop/index.d.ts +6 -2
- package/lib/loop/index.js +8 -2
- package/lib/loop/plugins/a2ui/A2uiView.js +2 -3
- package/lib/loop/plugins/a2ui-surface/InlineSurface.d.ts +23 -3
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +36 -9
- package/lib/loop/plugins/agent-capacity/index.d.ts +4 -0
- package/lib/loop/plugins/agent-capacity/index.js +3 -1
- package/lib/loop/plugins/agents/switchable.d.ts +7 -0
- package/lib/loop/plugins/agents/switchable.js +91 -88
- package/lib/loop/plugins/app-page/AppPage.d.ts +16 -0
- package/lib/loop/plugins/app-page/AppPage.js +53 -0
- package/lib/loop/plugins/app-page/appPageModel.d.ts +180 -0
- package/lib/loop/plugins/app-page/appPageModel.js +443 -0
- package/lib/loop/plugins/app-page/index.d.ts +8 -0
- package/lib/loop/plugins/app-page/index.js +34 -0
- package/lib/loop/plugins/canvas-blocks/index.d.ts +63 -0
- package/lib/loop/plugins/canvas-blocks/index.js +118 -0
- package/lib/loop/plugins/chat/ChatView.js +52 -26
- package/lib/loop/plugins/chat/turnState.d.ts +5 -2
- package/lib/loop/plugins/chat/turnState.js +2 -1
- package/lib/loop/plugins/page-layout/SplitLayout.d.ts +31 -0
- package/lib/loop/plugins/page-layout/SplitLayout.js +129 -0
- package/lib/loop/plugins/page-layout/index.d.ts +13 -0
- package/lib/loop/plugins/page-layout/index.js +10 -1
- package/lib/loop/presets.d.ts +12 -0
- package/lib/loop/presets.js +5 -3
- package/lib/specs/actions.js +9 -0
- package/lib/specs/agents/agents.js +20 -4
- package/lib/specs/apps.d.ts +10 -1
- package/lib/specs/apps.js +1779 -154
- package/lib/specs/appspecSchema.js +14 -8
- package/lib/specs/models.d.ts +1 -1
- package/lib/specs/models.js +8 -8
- package/lib/specs/tools.d.ts +1 -0
- package/lib/specs/tools.js +19 -0
- package/lib/stories/loop/LoopReference.stories.d.ts +21 -0
- package/lib/stories/loop/LoopReference.stories.js +31 -0
- package/lib/stories/loop/ReferenceScreens.d.ts +53 -0
- package/lib/stories/loop/ReferenceScreens.js +256 -0
- package/lib/stories/loop/pictures-main.d.ts +1 -0
- package/lib/stories/loop/pictures-main.js +64 -0
- package/lib/types/agentspecs.d.ts +17 -1
- package/lib/types/chat.d.ts +5 -0
- package/lib/types/config.d.ts +20 -0
- package/package.json +10 -6
- package/scripts/check-cloudflare-models.py +2 -2
- package/scripts/codegen/generate_agents.py +50 -2
- package/scripts/codegen/generate_apps.py +38 -7
- package/scripts/codegen/generate_models.py +4 -4
package/lib/loop/presets.js
CHANGED
|
@@ -52,12 +52,13 @@ import { LoopPageLayoutPlugin } from './plugins/page-layout';
|
|
|
52
52
|
* be installed or signed into, and the switches a demonstration wants are off.
|
|
53
53
|
*/
|
|
54
54
|
export function loopPlugins(options = {}) {
|
|
55
|
-
const { serverUrl, target = 'browser', defaultEditor
|
|
55
|
+
const { serverUrl, target = 'browser', defaultEditor: askedEditor, showViewSelector = true, hideChatHeader = false, chatHeaderButtons = false, promptPlacement, autoFocusPrompt = true, suggestionLabels = true, fullScreenTopOffset = 0, showAgentVariants = false, agentSummary = true, teamId, teamPicker = true, pageLayout = false, pageLayoutArrangement = 'page', pageLayoutTurnPanel = 'below', pageLayoutPrompt = 'docked', pageLayoutPromptAnchor = 'top', pageLayoutSize, pageLayoutTurnPanelFooter = 'full', localAgent, localAgentSpec, datalayerAgentSpecId, datalayerCreatePayload, targetFixed, themeVariant, presence, showTokenUsage, floatingPrompt = false, editorSelector = false, editors = true, graph = false, commandPalette = false, pluginsPanel = false, windowFrame = false, firstPromptHook, } = options;
|
|
56
|
+
const defaultEditor = askedEditor ?? (editors ? 'notebook' : 'none');
|
|
56
57
|
return [
|
|
57
58
|
// The chat owns the editor beside it, so which one opens is its
|
|
58
59
|
// configuration rather than the workspace's.
|
|
59
60
|
configurePlugin(ChatPlugin, {
|
|
60
|
-
defaultSurface:
|
|
61
|
+
defaultSurface: defaultEditor,
|
|
61
62
|
// The chat's strip stands down when the header selector offers the
|
|
62
63
|
// same choice; see `editorSelector` — and when there is no editor
|
|
63
64
|
// to choose.
|
|
@@ -130,13 +131,14 @@ export function loopPlugins(options = {}) {
|
|
|
130
131
|
// happens to be on is a workspace with a trap in it. The selector itself
|
|
131
132
|
// stays behind the old switch.
|
|
132
133
|
configurePlugin(ShellPlugin, {
|
|
133
|
-
defaultEditor
|
|
134
|
+
defaultEditor,
|
|
134
135
|
showSelector: editors && editorSelector,
|
|
135
136
|
}),
|
|
136
137
|
...(floatingPrompt ? [PromptPlugin] : []),
|
|
137
138
|
...(pageLayout
|
|
138
139
|
? [
|
|
139
140
|
configurePlugin(LoopPageLayoutPlugin, {
|
|
141
|
+
arrangement: pageLayoutArrangement,
|
|
140
142
|
turnPanel: pageLayoutTurnPanel,
|
|
141
143
|
turnPanelFooter: pageLayoutTurnPanelFooter,
|
|
142
144
|
prompt: pageLayoutPrompt,
|
package/lib/specs/actions.js
CHANGED
|
@@ -15,6 +15,7 @@ export const ACTION_CLASSES = [
|
|
|
15
15
|
export const TOOL_ACTIONS = {
|
|
16
16
|
'create-plan': ['read'],
|
|
17
17
|
'current-time': ['read'],
|
|
18
|
+
decide: ['read'],
|
|
18
19
|
'display-recipe': ['read'],
|
|
19
20
|
'example-create-plan': ['read'],
|
|
20
21
|
'example-current-time': ['read'],
|
|
@@ -439,6 +440,7 @@ export const SERVER_ACTIONS = {
|
|
|
439
440
|
* to reproduce.
|
|
440
441
|
*/
|
|
441
442
|
export const APP_BEHAVIOURS = {
|
|
443
|
+
'customer-interview': {},
|
|
442
444
|
'data-quality': {},
|
|
443
445
|
'inbox-triage': {
|
|
444
446
|
'google-workspace.append_table_rows': 'leave_to_me',
|
|
@@ -563,9 +565,12 @@ export const APP_BEHAVIOURS = {
|
|
|
563
565
|
'google-workspace.update_paragraph_style': 'leave_to_me',
|
|
564
566
|
},
|
|
565
567
|
'model-choice': {},
|
|
568
|
+
'pipeline-report': {},
|
|
566
569
|
'quote-calculator': {},
|
|
570
|
+
'report-from-a-file': {},
|
|
567
571
|
'ship-or-fix': {},
|
|
568
572
|
'supplier-comparison': {},
|
|
573
|
+
'support-desk': {},
|
|
569
574
|
'web-research': {
|
|
570
575
|
'tavily.tavily_crawl': 'do_it',
|
|
571
576
|
'tavily.tavily_extract': 'do_it',
|
|
@@ -579,6 +584,7 @@ export const APP_BEHAVIOURS = {
|
|
|
579
584
|
* application and tool, each condition and the behaviour when it holds.
|
|
580
585
|
*/
|
|
581
586
|
export const APP_ESCALATIONS = {
|
|
587
|
+
'customer-interview': {},
|
|
582
588
|
'data-quality': {},
|
|
583
589
|
'inbox-triage': {
|
|
584
590
|
'google-workspace.batch_modify_gmail_message_labels': [
|
|
@@ -615,8 +621,11 @@ export const APP_ESCALATIONS = {
|
|
|
615
621
|
],
|
|
616
622
|
},
|
|
617
623
|
'model-choice': {},
|
|
624
|
+
'pipeline-report': {},
|
|
618
625
|
'quote-calculator': {},
|
|
626
|
+
'report-from-a-file': {},
|
|
619
627
|
'ship-or-fix': {},
|
|
620
628
|
'supplier-comparison': {},
|
|
629
|
+
'support-desk': {},
|
|
621
630
|
'web-research': {},
|
|
622
631
|
};
|
|
@@ -3380,6 +3380,7 @@ export const EXAMPLE_ONE_TRIGGER_AGENTSPEC_0_0_1 = {
|
|
|
3380
3380
|
domain: undefined,
|
|
3381
3381
|
enabled: true,
|
|
3382
3382
|
model: 'bedrock:us.anthropic.claude-sonnet-4-6',
|
|
3383
|
+
modelAdditionals: ['alibaba:qwen-max'],
|
|
3383
3384
|
mcpServers: [],
|
|
3384
3385
|
skills: [
|
|
3385
3386
|
SKILL_MAP['github:0.0.1']
|
|
@@ -4384,18 +4385,19 @@ export const EXAMPLE_SIMPLE_AGENTSPEC_0_0_1 = {
|
|
|
4384
4385
|
id: 'example-simple',
|
|
4385
4386
|
version: '0.0.1',
|
|
4386
4387
|
name: 'A Simple Agent',
|
|
4387
|
-
description: `A simple conversational agent
|
|
4388
|
+
description: `A simple conversational agent with one tool, decide: it asks Jev typed questions (yes or no with a probability, a choice, a score) through datalayer-ai-inference. No MCP servers, no skills beyond events.`,
|
|
4388
4389
|
tags: ['workflow', 'automation', 'analysis'],
|
|
4389
4390
|
domain: undefined,
|
|
4390
4391
|
enabled: true,
|
|
4391
4392
|
model: 'bedrock:us.anthropic.claude-sonnet-4-6',
|
|
4393
|
+
modelAdditionals: ['alibaba:qwen-max'],
|
|
4392
4394
|
mcpServers: [],
|
|
4393
4395
|
skills: [
|
|
4394
4396
|
SKILL_MAP['events:0.0.1']
|
|
4395
4397
|
? toAgentSkillSpec(SKILL_MAP['events:0.0.1'])
|
|
4396
4398
|
: undefined,
|
|
4397
4399
|
].filter(Boolean),
|
|
4398
|
-
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
4400
|
+
tools: [TOOL_MAP['runtime-echo:0.0.1'], TOOL_MAP['decide:0.0.1']],
|
|
4399
4401
|
frontendTools: [
|
|
4400
4402
|
FRONTEND_TOOL_MAP['jupyter-notebook:0.0.1'],
|
|
4401
4403
|
FRONTEND_TOOL_MAP['lexical-document:0.0.1'],
|
|
@@ -4418,13 +4420,25 @@ export const EXAMPLE_SIMPLE_AGENTSPEC_0_0_1 = {
|
|
|
4418
4420
|
text: 'Summarize the key points of a topic I describe',
|
|
4419
4421
|
summary: 'Summarize a topic',
|
|
4420
4422
|
},
|
|
4423
|
+
{
|
|
4424
|
+
text: "Is this support ticket urgent? 'Payouts have failed for 3 days.'",
|
|
4425
|
+
summary: 'Decide: is it urgent?',
|
|
4426
|
+
},
|
|
4427
|
+
{
|
|
4428
|
+
text: "Which team should handle: 'I was charged twice'? Billing, Tech or Sales.",
|
|
4429
|
+
summary: 'Decide: which team?',
|
|
4430
|
+
},
|
|
4431
|
+
{
|
|
4432
|
+
text: "Score how positive this review is from 1 to 5: 'Setup took an hour, but support answered fast and it works.'",
|
|
4433
|
+
summary: 'Decide: score a review',
|
|
4434
|
+
},
|
|
4421
4435
|
],
|
|
4422
|
-
welcomeMessage: "Hi! I'm a simple assistant. I
|
|
4436
|
+
welcomeMessage: "Hi! I'm a simple assistant. I'm happy to chat, answer questions and help you think through ideas, and I can decide: ask me whether a ticket is urgent, which team should take it, or how positive a review is.\n",
|
|
4423
4437
|
welcomeNotebook: undefined,
|
|
4424
4438
|
welcomeDocument: undefined,
|
|
4425
4439
|
sandboxVariant: 'jupyter-server',
|
|
4426
4440
|
harness: 'pydantic-ai',
|
|
4427
|
-
systemPrompt: `You are a helpful, friendly AI assistant. You
|
|
4441
|
+
systemPrompt: `You are a helpful, friendly AI assistant. You have no MCP servers. You have a decide tool: when asked whether something holds (yes or no), which of named options fits, or where something sits on a scale, call decide with the text as the state and one typed question (noul, choice or score), then answer with what it decided and its probability or confidence. For anything else, answer from your training knowledge, be concise, and let the user know if a question is outside your knowledge.
|
|
4428
4442
|
`,
|
|
4429
4443
|
systemPromptCodemodeAddons: undefined,
|
|
4430
4444
|
goal: undefined,
|
|
@@ -5021,6 +5035,7 @@ export const JUPYTER_NOTEBOOK_COMPACTOR_AGENTSPEC_0_0_1 = {
|
|
|
5021
5035
|
domain: undefined,
|
|
5022
5036
|
enabled: true,
|
|
5023
5037
|
model: 'bedrock:us.anthropic.claude-sonnet-4-6',
|
|
5038
|
+
modelAdditionals: ['alibaba:qwen-max'],
|
|
5024
5039
|
mcpServers: [],
|
|
5025
5040
|
skills: [].filter(Boolean),
|
|
5026
5041
|
tools: [TOOL_MAP['runtime-echo:0.0.1']],
|
|
@@ -7663,6 +7678,7 @@ export const WORKER_CRAWLER_AGENTSPEC_0_0_1 = {
|
|
|
7663
7678
|
domain: 'market-analyst',
|
|
7664
7679
|
enabled: true,
|
|
7665
7680
|
model: 'bedrock:us.anthropic.claude-sonnet-4-6',
|
|
7681
|
+
modelAdditionals: ['alibaba:qwen-max'],
|
|
7666
7682
|
mcpServers: [MCP_SERVER_MAP['tavily:0.0.1']],
|
|
7667
7683
|
skills: [
|
|
7668
7684
|
SKILL_MAP['github:0.0.1']
|
package/lib/specs/apps.d.ts
CHANGED
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
* This file is AUTO-GENERATED from YAML specifications.
|
|
8
8
|
* DO NOT EDIT MANUALLY - run 'make specs' to regenerate.
|
|
9
9
|
*/
|
|
10
|
-
import type { AppKind, AppSpec } from '../types/agentspecs';
|
|
10
|
+
import type { AppBuilt, AppKind, AppSpec } from '../types/agentspecs';
|
|
11
|
+
export declare const CUSTOMER_INTERVIEW_APP_0_0_1: AppSpec;
|
|
11
12
|
export declare const DATA_QUALITY_APP_0_0_1: AppSpec;
|
|
12
13
|
export declare const INBOX_TRIAGE_APP_0_0_1: AppSpec;
|
|
13
14
|
export declare const MODEL_CHOICE_APP_0_0_1: AppSpec;
|
|
15
|
+
export declare const PIPELINE_REPORT_APP_0_0_1: AppSpec;
|
|
14
16
|
export declare const QUOTE_CALCULATOR_APP_0_0_1: AppSpec;
|
|
17
|
+
export declare const REPORT_FROM_A_FILE_APP_0_0_1: AppSpec;
|
|
15
18
|
export declare const SHIP_OR_FIX_APP_0_0_1: AppSpec;
|
|
16
19
|
export declare const SUPPLIER_COMPARISON_APP_0_0_1: AppSpec;
|
|
20
|
+
export declare const SUPPORT_DESK_APP_0_0_1: AppSpec;
|
|
17
21
|
export declare const WEB_RESEARCH_APP_0_0_1: AppSpec;
|
|
18
22
|
export declare const APP_CATALOGUE: Record<string, AppSpec>;
|
|
19
23
|
/** An application, by `id` or `id:version`, or undefined. */
|
|
@@ -24,5 +28,10 @@ export declare function getApp(ref: string): AppSpec | undefined;
|
|
|
24
28
|
* Appspec have to give back.
|
|
25
29
|
*/
|
|
26
30
|
export declare const APP_SOURCES: Record<string, Record<string, unknown>>;
|
|
31
|
+
/**
|
|
32
|
+
* How each application was built: `python` (its `app.py`), `canvas` (its
|
|
33
|
+
* page composed on the Canvas) or `written` (its spec written out).
|
|
34
|
+
*/
|
|
35
|
+
export declare const APP_BUILT: Record<string, AppBuilt>;
|
|
27
36
|
/** Every application of the catalogue, or those of a kind. */
|
|
28
37
|
export declare function listApps(kind?: AppKind): AppSpec[];
|