@datalayer/agent-runtimes 1.3.94 → 1.3.96
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/dist-embed/chunks/AgentInspector-DaMCROPs.js +1 -0
- package/dist-embed/chunks/{AgentInspectorDialog-LBbHMnDa.js → AgentInspectorDialog-zGMiFR5z.js} +1 -1
- package/dist-embed/chunks/ChatView-DE-jo1oJ.js +288 -0
- package/dist-embed/datalayer-app-main.js +110 -110
- package/dist-embed/datalayer-app.js +1 -1
- package/lib/apps/__tests__/fixtures/sceneCheckCases.json +352 -0
- package/lib/apps/apps/computer.d.ts +25 -1
- package/lib/apps/apps/computer.js +45 -2
- package/lib/apps/apps/sceneChecks.d.ts +92 -0
- package/lib/apps/apps/sceneChecks.js +649 -0
- package/lib/apps/apps/sceneShape.d.ts +8 -0
- package/lib/apps/apps/sceneShape.js +191 -0
- package/lib/apps/apps/sceneYaml.d.ts +64 -0
- package/lib/apps/apps/sceneYaml.js +253 -0
- package/lib/apps/core/canvasParts.d.ts +28 -0
- package/lib/apps/core/canvasParts.js +14 -0
- package/lib/apps/core/index.d.ts +1 -0
- package/lib/apps/core/index.js +2 -0
- package/lib/apps/embed/loader.js +10 -0
- package/lib/apps/plugins/agents/SandboxSelector.js +13 -2
- package/lib/apps/plugins/agents/host.d.ts +2 -0
- package/lib/apps/plugins/agents/host.js +16 -0
- package/lib/apps/plugins/agents/plugin.js +10 -2
- package/lib/apps/plugins/agents/switchable.d.ts +12 -0
- package/lib/apps/plugins/agents/switchable.js +23 -0
- package/lib/apps/plugins/app-computer/AppComputer.js +18 -2
- package/lib/apps/plugins/canvas-parts/index.d.ts +44 -0
- package/lib/apps/plugins/canvas-parts/index.js +209 -0
- package/lib/components/teams/useA2ATeam.js +1 -1
- package/lib/examples/HomeExample.js +1 -1
- package/lib/examples/ScenesExample.d.ts +1 -1
- package/lib/examples/example-selector.js +1 -1
- package/lib/hooks/useAgUi.js +4 -1
- package/lib/protocols/AGUIAdapter.js +5 -1
- package/lib/protocols/agUiRefusal.d.ts +47 -0
- package/lib/protocols/agUiRefusal.js +87 -0
- package/lib/specs/apps.js +32 -24
- package/lib/specs/scenes.js +147 -142
- package/lib/specs/teams/teams.js +13 -13
- package/package.json +3 -1
- package/scripts/dist-embed.mjs +116 -0
- package/scripts/record-scene-checks.py +600 -0
- package/dist-embed/chunks/AgentInspector-DfPciQ79.js +0 -1
- package/dist-embed/chunks/ChatView-BzFbN_mp.js +0 -288
package/lib/specs/teams/teams.js
CHANGED
|
@@ -707,8 +707,8 @@ export const COMPREHENSIVE_SALES_ANALYTICS_TEAM_SPEC_0_0_1 = {
|
|
|
707
707
|
export const CROP_MONITORING_TEAM_SPEC_0_0_1 = {
|
|
708
708
|
id: 'crop-monitoring',
|
|
709
709
|
version: '0.0.1',
|
|
710
|
-
name: 'Crop
|
|
711
|
-
description: `One agent, its data: Crop
|
|
710
|
+
name: 'Crop Monitoring',
|
|
711
|
+
description: `One agent, its data: Crop Monitoring follows crop vigour and growth over a season from the satellite imagery NASA Earthdata holds, and flags the fields that need attention.`,
|
|
712
712
|
tags: [
|
|
713
713
|
'example',
|
|
714
714
|
'scene',
|
|
@@ -725,7 +725,7 @@ export const CROP_MONITORING_TEAM_SPEC_0_0_1 = {
|
|
|
725
725
|
orchestrationProtocol: 'a2a',
|
|
726
726
|
executionMode: 'supervisor',
|
|
727
727
|
supervisor: {
|
|
728
|
-
name: 'Crop
|
|
728
|
+
name: 'Crop Monitoring',
|
|
729
729
|
ref: '',
|
|
730
730
|
app: 'crop-monitoring:0.0.1',
|
|
731
731
|
model: '',
|
|
@@ -734,7 +734,7 @@ export const CROP_MONITORING_TEAM_SPEC_0_0_1 = {
|
|
|
734
734
|
approval: 'auto',
|
|
735
735
|
canTerminate: true,
|
|
736
736
|
},
|
|
737
|
-
routingInstructions: `Crop
|
|
737
|
+
routingInstructions: `Crop Monitoring answers every request from the imagery itself, one search at a time, and reports what the granules show without adding to it.`,
|
|
738
738
|
entry: 'crop-monitoring',
|
|
739
739
|
suggestions: [
|
|
740
740
|
{
|
|
@@ -783,8 +783,8 @@ export const CROP_MONITORING_TEAM_SPEC_0_0_1 = {
|
|
|
783
783
|
export const DISASTER_ASSESSMENT_TEAM_SPEC_0_0_1 = {
|
|
784
784
|
id: 'disaster-assessment',
|
|
785
785
|
version: '0.0.1',
|
|
786
|
-
name: 'Disaster
|
|
787
|
-
description: `An event desk in the browser that gets the area a disaster affected and the damage from Disaster
|
|
786
|
+
name: 'Disaster Assessment',
|
|
787
|
+
description: `An event desk in the browser that gets the area a disaster affected and the damage from Disaster Assessment, and what changed on the ground from Change detection, each on a runtime over A2A, each reading NASA Earthdata. Event response takes the event and reports; the two others read the imagery and answer.`,
|
|
788
788
|
tags: [
|
|
789
789
|
'example',
|
|
790
790
|
'scene',
|
|
@@ -811,7 +811,7 @@ export const DISASTER_ASSESSMENT_TEAM_SPEC_0_0_1 = {
|
|
|
811
811
|
approval: 'auto',
|
|
812
812
|
canTerminate: true,
|
|
813
813
|
},
|
|
814
|
-
routingInstructions: `Event response asks Disaster
|
|
814
|
+
routingInstructions: `Event response asks Disaster Assessment for the area and the damage, and Change detection for the change on the ground, one request each, and reports what they answer without adding to it.`,
|
|
815
815
|
entry: 'event-response',
|
|
816
816
|
suggestions: [
|
|
817
817
|
{
|
|
@@ -850,7 +850,7 @@ export const DISASTER_ASSESSMENT_TEAM_SPEC_0_0_1 = {
|
|
|
850
850
|
{ member: 'change-detection', over: 'a2a' },
|
|
851
851
|
],
|
|
852
852
|
role: 'initiator',
|
|
853
|
-
goal: `Take the person's event, ask Disaster
|
|
853
|
+
goal: `Take the person's event, ask Disaster Assessment and Change detection for it, and report what they answered.`,
|
|
854
854
|
dependsOn: [],
|
|
855
855
|
subagents: [],
|
|
856
856
|
model: '',
|
|
@@ -1120,8 +1120,8 @@ export const JUPYTER_TEAM_SPEC_0_0_1 = {
|
|
|
1120
1120
|
export const MONTH_END_CLOSE_TEAM_SPEC_0_0_1 = {
|
|
1121
1121
|
id: 'month-end-close',
|
|
1122
1122
|
version: '0.0.1',
|
|
1123
|
-
name: 'Month-end
|
|
1124
|
-
description: `One agent, its data: Month-end
|
|
1123
|
+
name: 'Month-end Close',
|
|
1124
|
+
description: `One agent, its data: Month-end Close drives the close from the Odoo books, which it only reads — the checklist, the accruals to book, the reconciliation gaps that remain.`,
|
|
1125
1125
|
tags: ['example', 'scene', 'accounting', 'finance', 'odoo', 'a2a'],
|
|
1126
1126
|
enabled: true,
|
|
1127
1127
|
icon: 'sync',
|
|
@@ -1131,7 +1131,7 @@ export const MONTH_END_CLOSE_TEAM_SPEC_0_0_1 = {
|
|
|
1131
1131
|
orchestrationProtocol: 'a2a',
|
|
1132
1132
|
executionMode: 'supervisor',
|
|
1133
1133
|
supervisor: {
|
|
1134
|
-
name: 'Month-end
|
|
1134
|
+
name: 'Month-end Close',
|
|
1135
1135
|
ref: '',
|
|
1136
1136
|
app: 'month-end-close:0.0.1',
|
|
1137
1137
|
model: '',
|
|
@@ -1140,7 +1140,7 @@ export const MONTH_END_CLOSE_TEAM_SPEC_0_0_1 = {
|
|
|
1140
1140
|
approval: 'auto',
|
|
1141
1141
|
canTerminate: true,
|
|
1142
1142
|
},
|
|
1143
|
-
routingInstructions: `Month-end
|
|
1143
|
+
routingInstructions: `Month-end Close answers every request from the books itself, one read at a time, and reports what the books hold without adding to it.`,
|
|
1144
1144
|
entry: 'month-end-close',
|
|
1145
1145
|
suggestions: [
|
|
1146
1146
|
{
|
|
@@ -1758,7 +1758,7 @@ export const SALES_AND_ACCOUNTING_TEAM_SPEC_0_0_1 = {
|
|
|
1758
1758
|
emoji: '🔎',
|
|
1759
1759
|
},
|
|
1760
1760
|
{
|
|
1761
|
-
text: 'Send a payment reminder to every customer
|
|
1761
|
+
text: 'Send a payment reminder to every customer whose invoice is overdue.',
|
|
1762
1762
|
emoji: '✉️',
|
|
1763
1763
|
},
|
|
1764
1764
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datalayer/agent-runtimes",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.96",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
".",
|
|
@@ -58,6 +58,8 @@
|
|
|
58
58
|
"build-storybook": "storybook build",
|
|
59
59
|
"build:all": "npm run build && npm run build:examples",
|
|
60
60
|
"build:embed": "cross-env NODE_OPTIONS=--max-old-space-size=8192 vite build --config vite.embed.config.ts",
|
|
61
|
+
"dist-embed": "node scripts/dist-embed.mjs",
|
|
62
|
+
"dist-embed:release": "node scripts/dist-embed.mjs --release",
|
|
61
63
|
"build:examples": "npm run build:nextjs",
|
|
62
64
|
"build:lib": "npm run clean:lib && gulp resources-to-lib && tsc -b",
|
|
63
65
|
"build:nextjs": "npm run build --workspace=nextjs-notebook-example",
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Put `dist-embed/` in a checkout: the embed element's own bundle.
|
|
4
|
+
*
|
|
5
|
+
* `dist-embed/datalayer-app.js` is what a page loads to put an application on
|
|
6
|
+
* someone else's site (LOOP D-08). A release carries it — `npm run build:embed`
|
|
7
|
+
* runs in the release, and the npm package ships the folder — but a workspace
|
|
8
|
+
* checkout has never run it, and the folder is gitignored. The landing's
|
|
9
|
+
* production build refuses to ship without it, because an embed bundle that
|
|
10
|
+
* does not match the runtime it talks to is worse than none:
|
|
11
|
+
*
|
|
12
|
+
* Error: @datalayer/agent-runtimes has no dist-embed/datalayer-app.js …
|
|
13
|
+
* install a release that carries the embed bundle (1.3.93 or later)
|
|
14
|
+
*
|
|
15
|
+
* Two ways to get it, and the right one depends on what you are doing:
|
|
16
|
+
*
|
|
17
|
+
* node scripts/dist-embed.mjs # build it here, from this tree
|
|
18
|
+
* node scripts/dist-embed.mjs --release # take the published one of this
|
|
19
|
+
* # package's own version
|
|
20
|
+
* node scripts/dist-embed.mjs --release 1.3.95 # or of the one named
|
|
21
|
+
*
|
|
22
|
+
* Build it when you changed the embed's own code and want to see it. Take the
|
|
23
|
+
* release when you only need the landing to build: the download is seconds
|
|
24
|
+
* against minutes, and it is byte for byte what the deployed runtime serves.
|
|
25
|
+
* `--force` replaces a folder that is already there; without it, an existing
|
|
26
|
+
* `dist-embed/datalayer-app.js` is left alone and said so.
|
|
27
|
+
*
|
|
28
|
+
* @module scripts/dist-embed
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
import { execFileSync } from 'node:child_process';
|
|
32
|
+
import { existsSync, mkdtempSync, rmSync, cpSync, readFileSync, statSync } from 'node:fs';
|
|
33
|
+
import { tmpdir } from 'node:os';
|
|
34
|
+
import { dirname, join } from 'node:path';
|
|
35
|
+
import { fileURLToPath } from 'node:url';
|
|
36
|
+
|
|
37
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
38
|
+
const ROOT = join(HERE, '..');
|
|
39
|
+
const OUT = join(ROOT, 'dist-embed');
|
|
40
|
+
const MADE = join(OUT, 'datalayer-app.js');
|
|
41
|
+
|
|
42
|
+
const args = process.argv.slice(2);
|
|
43
|
+
const wants = (name) => args.includes(name);
|
|
44
|
+
/** The value after a flag, when it is not another flag. */
|
|
45
|
+
const after = (name) => {
|
|
46
|
+
const at = args.indexOf(name);
|
|
47
|
+
const value = at < 0 ? '' : String(args[at + 1] ?? '');
|
|
48
|
+
return value.startsWith('-') ? '' : value;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const say = (line) => process.stdout.write(`${line}\n`);
|
|
52
|
+
|
|
53
|
+
const ownVersion = () => JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8')).version;
|
|
54
|
+
|
|
55
|
+
/** How big the folder is, in words a person reads. */
|
|
56
|
+
const sizeOf = (path) => {
|
|
57
|
+
const bytes = Number(
|
|
58
|
+
execFileSync('du', ['-sb', path], { encoding: 'utf8' }).split(/\s+/)[0] || 0
|
|
59
|
+
);
|
|
60
|
+
return bytes > 1024 * 1024 ? `${Math.round(bytes / (1024 * 1024))} MB` : `${Math.round(bytes / 1024)} KB`;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
function fromRelease(version) {
|
|
64
|
+
const named = `@datalayer/agent-runtimes@${version}`;
|
|
65
|
+
say(`Taking the embed bundle of ${named} from npm…`);
|
|
66
|
+
const work = mkdtempSync(join(tmpdir(), 'dist-embed-'));
|
|
67
|
+
try {
|
|
68
|
+
const packed = execFileSync('npm', ['pack', named, '--silent'], {
|
|
69
|
+
cwd: work,
|
|
70
|
+
encoding: 'utf8',
|
|
71
|
+
})
|
|
72
|
+
.trim()
|
|
73
|
+
.split('\n')
|
|
74
|
+
.pop();
|
|
75
|
+
const tarball = join(work, packed);
|
|
76
|
+
if (!existsSync(tarball)) {
|
|
77
|
+
throw new Error(`npm pack wrote no tarball for ${named}`);
|
|
78
|
+
}
|
|
79
|
+
execFileSync('tar', ['xzf', tarball, 'package/dist-embed'], { cwd: work });
|
|
80
|
+
const taken = join(work, 'package', 'dist-embed');
|
|
81
|
+
if (!existsSync(join(taken, 'datalayer-app.js'))) {
|
|
82
|
+
throw new Error(`${named} carries no dist-embed/datalayer-app.js: it predates the embed bundle`);
|
|
83
|
+
}
|
|
84
|
+
rmSync(OUT, { recursive: true, force: true });
|
|
85
|
+
cpSync(taken, OUT, { recursive: true });
|
|
86
|
+
} finally {
|
|
87
|
+
rmSync(work, { recursive: true, force: true });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function build() {
|
|
92
|
+
say('Building the embed bundle from this tree (vite.embed.config.ts)…');
|
|
93
|
+
execFileSync('npm', ['run', 'build:embed'], { cwd: ROOT, stdio: 'inherit' });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (existsSync(MADE) && !wants('--force')) {
|
|
97
|
+
say(`dist-embed is already here (${sizeOf(OUT)}): nothing done. Pass --force to replace it.`);
|
|
98
|
+
process.exit(0);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
if (wants('--release')) {
|
|
103
|
+
fromRelease(after('--release') || ownVersion());
|
|
104
|
+
} else {
|
|
105
|
+
build();
|
|
106
|
+
}
|
|
107
|
+
} catch (refused) {
|
|
108
|
+
say(`The embed bundle could not be made: ${refused.message}`);
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (!existsSync(MADE)) {
|
|
113
|
+
say('The embed bundle was not made: dist-embed/datalayer-app.js is absent.');
|
|
114
|
+
process.exit(1);
|
|
115
|
+
}
|
|
116
|
+
say(`dist-embed is ready: ${sizeOf(OUT)}, ${Math.round(statSync(MADE).size / 1024)} KB of loader.`);
|