@datalayer/agent-runtimes 1.3.81 → 1.3.83
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/chat/assistant/SpeechBalloon.js +16 -1
- package/lib/chat/base/ChatBase.js +40 -4
- package/lib/chat/indicators/McpStatusIndicator.d.ts +1 -1
- package/lib/chat/indicators/McpStatusIndicator.js +13 -6
- package/lib/chat/indicators/SkillsStatusIndicator.d.ts +1 -1
- package/lib/chat/indicators/SkillsStatusIndicator.js +7 -3
- package/lib/chat/prompt/InputPrompt.d.ts +4 -1
- package/lib/chat/prompt/InputPrompt.js +2 -2
- package/lib/chat/prompt/InputPromptBase.d.ts +4 -1
- package/lib/chat/prompt/InputPromptBase.js +2 -2
- package/lib/chat/prompt/InputPromptLexical.d.ts +7 -1
- package/lib/chat/prompt/InputPromptLexical.js +5 -3
- package/lib/components/a2ui/datalayer/Form.js +19 -2
- package/lib/components/teams/index.d.ts +1 -0
- package/lib/components/teams/index.js +1 -0
- package/lib/components/teams/usePeerSandbox.d.ts +13 -0
- package/lib/components/teams/usePeerSandbox.js +59 -0
- package/lib/examples/AgentA2ATeamExample.js +7 -2
- package/lib/loop/apps/AppComposer.d.ts +31 -0
- package/lib/loop/apps/AppComposer.js +67 -0
- package/lib/loop/apps/AppRenderer.d.ts +16 -5
- package/lib/loop/apps/AppRenderer.js +49 -16
- package/lib/loop/apps/appspec.d.ts +8 -1
- package/lib/loop/apps/appspec.js +88 -23
- package/lib/loop/apps/checks.js +125 -8
- package/lib/loop/apps/composer.d.ts +37 -0
- package/lib/loop/apps/composer.js +61 -0
- package/lib/loop/apps/index.d.ts +2 -0
- package/lib/loop/apps/index.js +2 -0
- package/lib/loop/core/index.d.ts +31 -0
- package/lib/loop/core/index.js +22 -0
- package/lib/loop/embed/AppEmbed.d.ts +46 -7
- package/lib/loop/embed/AppEmbed.js +108 -26
- package/lib/loop/embed/LoopEmbed.js +2 -0
- package/lib/loop/embed/element.js +19 -5
- package/lib/loop/embed/embedConfig.d.ts +10 -1
- package/lib/loop/embed/embedConfig.js +12 -1
- package/lib/loop/embed/embedSession.d.ts +79 -0
- package/lib/loop/embed/embedSession.js +136 -0
- package/lib/loop/embed/embedTheme.d.ts +12 -9
- package/lib/loop/embed/embedTheme.js +32 -22
- package/lib/loop/index.d.ts +4 -3
- package/lib/loop/index.js +4 -3
- package/lib/loop/plugins/agent-capacity/index.d.ts +3 -1
- package/lib/loop/plugins/agent-capacity/index.js +2 -1
- package/lib/loop/plugins/app-page/appPageModel.d.ts +14 -5
- package/lib/loop/plugins/app-page/appPageModel.js +80 -88
- package/lib/loop/plugins/chat/ChatView.js +31 -4
- package/lib/loop/plugins/chat/index.d.ts +6 -1
- package/lib/loop/presets.d.ts +3 -1
- package/lib/loop/presets.js +2 -1
- package/lib/loop/shell/LoopWorkspace.js +3 -0
- package/lib/protocols/BrowserAgentAdapter.d.ts +18 -0
- package/lib/protocols/BrowserAgentAdapter.js +35 -2
- package/lib/runtimes/__tests__/fixtures/accounting-agent-card.json +8 -0
- package/lib/runtimes/browser/a2aPeer.d.ts +11 -0
- package/lib/runtimes/browser/a2aPeer.js +15 -1
- package/lib/runtimes/browser/protocol.d.ts +3 -0
- package/lib/runtimes/browser/protocol.js +2 -1
- package/lib/specs/agents/agents.js +6 -3
- package/lib/specs/apps.js +216 -176
- package/lib/specs/appspecSchema.js +205 -84
- package/lib/specs/cogs.js +3 -2
- package/lib/types/agentspecs.d.ts +92 -7
- package/lib/types/chat.d.ts +29 -1
- package/package.json +1 -1
- package/scripts/codegen/generate_agents.py +4 -2
- package/scripts/codegen/generate_apps.py +0 -1
- package/scripts/codegen/generate_backend_tools.py +4 -12
- package/scripts/codegen/generate_cogs.py +3 -1
- package/scripts/codegen/generate_ui_plugins.py +22 -9
- package/scripts/voice/transcribe.mjs +29 -21
|
@@ -104,18 +104,18 @@ def _py_calls(specs: list[dict[str, Any]]) -> list[str]:
|
|
|
104
104
|
"# The components as typed calls (LOOP C-15)",
|
|
105
105
|
"# " + "=" * 76,
|
|
106
106
|
"",
|
|
107
|
-
|
|
107
|
+
'#: A property bound to what the application publishes or takes: ``{"path": "/runs"}``.',
|
|
108
108
|
"Bound = Mapping[str, str]",
|
|
109
109
|
"",
|
|
110
110
|
"",
|
|
111
111
|
"class SurfaceComponents:",
|
|
112
|
-
' """Every component of the catalog as a typed call: ``app.ui.table(
|
|
112
|
+
' """Every component of the catalog as a typed call: ``app.ui.table("runs", columns=[...])``.',
|
|
113
113
|
"",
|
|
114
114
|
" Each places the node the Canvas and the YAML write, through",
|
|
115
115
|
" `Application.component`, which checks it against the same JSON Schema; an",
|
|
116
116
|
" IDE completes its properties, and a type checker refuses a wrong value",
|
|
117
117
|
" before the application runs. A property may be bound instead",
|
|
118
|
-
' (``{
|
|
118
|
+
' (``{"path": ...}``); a property left as ``None`` is not written.',
|
|
119
119
|
' """',
|
|
120
120
|
"",
|
|
121
121
|
" def __init__(self, place: Callable[..., Dict[str, Any]]) -> None:",
|
|
@@ -131,15 +131,21 @@ def _py_calls(specs: list[dict[str, Any]]) -> list[str]:
|
|
|
131
131
|
bindings = component.get("bindings") or {}
|
|
132
132
|
extra = [
|
|
133
133
|
name
|
|
134
|
-
for name in dict.fromkeys(
|
|
134
|
+
for name in dict.fromkeys(
|
|
135
|
+
[*(bindings.get("shows") or []), *(bindings.get("sends") or [])]
|
|
136
|
+
)
|
|
135
137
|
if name not in fields
|
|
136
138
|
]
|
|
137
139
|
params = [" self,", " id: str,", " *,"]
|
|
138
|
-
ordered = [n for n in fields if n in required] + [
|
|
140
|
+
ordered = [n for n in fields if n in required] + [
|
|
141
|
+
n for n in fields if n not in required
|
|
142
|
+
]
|
|
139
143
|
for name in ordered:
|
|
140
144
|
kind = f"Union[{_py_type(fields[name])}, Bound]"
|
|
141
145
|
params.append(
|
|
142
|
-
f" {name}: {kind},"
|
|
146
|
+
f" {name}: {kind},"
|
|
147
|
+
if name in required
|
|
148
|
+
else f" {name}: Optional[{kind}] = None,"
|
|
143
149
|
)
|
|
144
150
|
for name in extra:
|
|
145
151
|
params.append(f" {name}: Optional[Bound] = None,")
|
|
@@ -157,9 +163,16 @@ def _py_calls(specs: list[dict[str, Any]]) -> list[str]:
|
|
|
157
163
|
]
|
|
158
164
|
for name in ordered:
|
|
159
165
|
field = fields[name]
|
|
160
|
-
doc += [
|
|
166
|
+
doc += [
|
|
167
|
+
f" {name} : {_py_type(field)} or Bound",
|
|
168
|
+
f" {field.get('title', name)}: {field.get('description', '')}",
|
|
169
|
+
]
|
|
161
170
|
for name in extra:
|
|
162
|
-
said =
|
|
171
|
+
said = (
|
|
172
|
+
"What it shows"
|
|
173
|
+
if name in (bindings.get("shows") or [])
|
|
174
|
+
else "Where what a person does is written"
|
|
175
|
+
)
|
|
163
176
|
doc += [f" {name} : Bound", f" {said}."]
|
|
164
177
|
doc += [' """']
|
|
165
178
|
names = [*ordered, *extra]
|
|
@@ -171,7 +184,7 @@ def _py_calls(specs: list[dict[str, Any]]) -> list[str]:
|
|
|
171
184
|
f" def {call_name(component['id'])}(",
|
|
172
185
|
*params,
|
|
173
186
|
" ) -> Dict[str, Any]:",
|
|
174
|
-
*[d.replace(
|
|
187
|
+
*[d.replace("\\", "\\\\") for d in doc],
|
|
175
188
|
" given = {",
|
|
176
189
|
*[f" {json.dumps(name)}: {name}," for name in names],
|
|
177
190
|
" }",
|
|
@@ -33,26 +33,34 @@ function readWav(path) {
|
|
|
33
33
|
return samples;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// Whisper is told the language; Moonshine hears English only.
|
|
43
|
-
const options = model.startsWith('whisper')
|
|
44
|
-
? { language: language === 'fr' ? 'french' : 'english', task: 'transcribe' }
|
|
45
|
-
: {};
|
|
46
|
-
const results = [];
|
|
47
|
-
for (const file of files) {
|
|
48
|
-
const audio = readWav(file);
|
|
49
|
-
const started = performance.now();
|
|
50
|
-
const output = await transcribe(audio, options);
|
|
51
|
-
results.push({
|
|
52
|
-
file: file.split('/').pop(),
|
|
53
|
-
text: output.text.trim(),
|
|
54
|
-
ms: Math.round(performance.now() - started),
|
|
55
|
-
audio_s: Math.round((audio.length / 16000) * 100) / 100,
|
|
36
|
+
/** Load the model, transcribe each file, print the JSON line. */
|
|
37
|
+
async function main() {
|
|
38
|
+
const loading = performance.now();
|
|
39
|
+
const transcribe = await pipeline('automatic-speech-recognition', model, {
|
|
40
|
+
dtype: 'q8',
|
|
41
|
+
device: 'cpu',
|
|
56
42
|
});
|
|
43
|
+
const loadMs = Math.round(performance.now() - loading);
|
|
44
|
+
// Whisper is told the language; Moonshine hears English only.
|
|
45
|
+
const options = model.startsWith('whisper')
|
|
46
|
+
? { language: language === 'fr' ? 'french' : 'english', task: 'transcribe' }
|
|
47
|
+
: {};
|
|
48
|
+
const results = [];
|
|
49
|
+
for (const file of files) {
|
|
50
|
+
const audio = readWav(file);
|
|
51
|
+
const started = performance.now();
|
|
52
|
+
const output = await transcribe(audio, options);
|
|
53
|
+
results.push({
|
|
54
|
+
file: file.split('/').pop(),
|
|
55
|
+
text: output.text.trim(),
|
|
56
|
+
ms: Math.round(performance.now() - started),
|
|
57
|
+
audio_s: Math.round((audio.length / 16000) * 100) / 100,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
console.log(JSON.stringify({ model, language, load_ms: loadMs, results }));
|
|
57
61
|
}
|
|
58
|
-
|
|
62
|
+
|
|
63
|
+
main().catch(error => {
|
|
64
|
+
console.error(error);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
});
|