@datalayer/agent-runtimes 1.3.83 → 1.3.85
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/ChatFloating.d.ts +5 -4
- package/lib/chat/ChatFloating.js +8 -6
- package/lib/chat/ChatLanguage.d.ts +17 -0
- package/lib/chat/ChatLanguage.js +29 -0
- package/lib/chat/assistant/AssistantStage.d.ts +4 -4
- package/lib/chat/assistant/AssistantStage.js +4 -2
- package/lib/chat/assistant/BalloonParts.d.ts +2 -1
- package/lib/chat/assistant/BalloonParts.js +12 -5
- package/lib/chat/assistant/BalloonVisual.js +3 -1
- package/lib/chat/assistant/ConversationBalloon.d.ts +1 -1
- package/lib/chat/assistant/ConversationBalloon.js +3 -2
- package/lib/chat/assistant/SpeechBalloon.d.ts +1 -1
- package/lib/chat/assistant/SpeechBalloon.js +10 -7
- package/lib/chat/assistant/toolLine.d.ts +8 -4
- package/lib/chat/assistant/toolLine.js +13 -9
- package/lib/chat/base/ChatBase.js +30 -11
- package/lib/chat/base/loopElement.d.ts +53 -0
- package/lib/chat/base/loopElement.js +78 -0
- package/lib/chat/base/loopWindow.d.ts +31 -0
- package/lib/chat/base/loopWindow.js +74 -0
- package/lib/chat/display/EmptyState.js +3 -1
- package/lib/chat/index.d.ts +2 -0
- package/lib/chat/index.js +3 -0
- package/lib/chat/messages/ChatMessages.js +3 -1
- package/lib/chat/messages/TurnFooter.js +3 -1
- package/lib/chat/prompt/InputPrompt.js +3 -1
- package/lib/chat/prompt/InputPromptLexical.js +3 -1
- package/lib/chat/prompt/footer/InPromptFooter.js +3 -1
- package/lib/chat/tools/ToolApprovalBanner.js +5 -3
- package/lib/chat/tools/ToolApprovalDialog.js +5 -3
- package/lib/chat/tools/ToolCallDisplay.js +29 -25
- package/lib/chat/words.d.ts +102 -0
- package/lib/chat/words.js +460 -0
- package/lib/components/a2ui/custom/index.d.ts +39 -0
- package/lib/components/a2ui/custom/index.js +95 -0
- package/lib/components/a2ui/custom/sandbox.d.ts +73 -0
- package/lib/components/a2ui/custom/sandbox.js +188 -0
- package/lib/components/a2ui/datalayer/FileUpload.d.ts +10 -2
- package/lib/components/a2ui/datalayer/FileUpload.js +10 -7
- package/lib/components/a2ui/datalayer/Form.d.ts +2 -0
- package/lib/components/a2ui/datalayer/Form.js +9 -2
- package/lib/components/a2ui/datalayer/formWidgets.d.ts +19 -0
- package/lib/components/a2ui/datalayer/formWidgets.js +51 -0
- package/lib/components/a2ui/datalayer/index.d.ts +1 -1
- package/lib/components/a2ui/datalayer/index.js +1 -1
- package/lib/components/a2ui/datalayer/schema.d.ts +10 -0
- package/lib/components/a2ui/datalayer/schema.js +12 -1
- package/lib/components/a2ui/index.d.ts +1 -0
- package/lib/components/a2ui/index.js +1 -0
- package/lib/components/a2ui/visibleWhen.d.ts +12 -1
- package/lib/components/a2ui/visibleWhen.js +24 -3
- package/lib/components/inspector/AgentInspector.d.ts +25 -44
- package/lib/components/inspector/AgentInspector.js +27 -215
- package/lib/components/inspector/AgentInspectorDialog.d.ts +6 -6
- package/lib/components/inspector/AgentInspectorDialog.js +2 -2
- package/lib/components/inspector/a2aSpans.d.ts +51 -0
- package/lib/components/inspector/a2aSpans.js +373 -0
- package/lib/components/inspector/agentSpans.d.ts +120 -0
- package/lib/components/inspector/agentSpans.js +253 -0
- package/lib/components/inspector/chatSpans.d.ts +36 -0
- package/lib/components/inspector/chatSpans.js +50 -0
- package/lib/components/inspector/classify.d.ts +11 -8
- package/lib/components/inspector/classify.js +23 -24
- package/lib/components/inspector/index.d.ts +7 -7
- package/lib/components/inspector/index.js +7 -7
- package/lib/components/teams/A2ATeamGraph.d.ts +4 -4
- package/lib/components/teams/SceneTranscript.d.ts +29 -0
- package/lib/components/teams/SceneTranscript.js +54 -0
- package/lib/components/teams/SceneView.d.ts +41 -0
- package/lib/components/teams/SceneView.js +28 -0
- package/lib/components/teams/index.d.ts +3 -0
- package/lib/components/teams/index.js +3 -0
- package/lib/components/teams/sceneTranscript.d.ts +74 -0
- package/lib/components/teams/sceneTranscript.js +294 -0
- package/lib/components/teams/teamConnections.d.ts +2 -2
- package/lib/components/teams/teamConnections.js +3 -3
- package/lib/components/teams/useA2ATeam.d.ts +4 -4
- package/lib/components/teams/useA2ATeam.js +50 -46
- package/lib/examples/AgentA2ATeamExample.d.ts +10 -9
- package/lib/examples/AgentA2ATeamExample.js +70 -60
- package/lib/examples/AssistantExample.js +2 -2
- package/lib/loop/apps/AppComposer.d.ts +40 -4
- package/lib/loop/apps/AppComposer.js +194 -19
- package/lib/loop/apps/AppRenderer.d.ts +21 -3
- package/lib/loop/apps/AppRenderer.js +88 -48
- package/lib/loop/apps/appspec.d.ts +13 -1
- package/lib/loop/apps/appspec.js +305 -12
- package/lib/loop/apps/checks.d.ts +14 -0
- package/lib/loop/apps/checks.js +276 -5
- package/lib/loop/apps/composer.d.ts +21 -10
- package/lib/loop/apps/composer.js +41 -8
- package/lib/loop/apps/customComponents.d.ts +41 -0
- package/lib/loop/apps/customComponents.js +260 -0
- package/lib/loop/apps/hostTools.d.ts +8 -1
- package/lib/loop/apps/hostTools.js +9 -0
- package/lib/loop/apps/index.d.ts +1 -0
- package/lib/loop/apps/index.js +1 -0
- package/lib/loop/apps/language.d.ts +68 -0
- package/lib/loop/apps/language.js +275 -0
- package/lib/loop/apps/settingsInputs.d.ts +29 -0
- package/lib/loop/apps/settingsInputs.js +147 -0
- package/lib/loop/apps/uploads.d.ts +43 -0
- package/lib/loop/apps/uploads.js +66 -0
- package/lib/loop/core/a2uiComponents.d.ts +10 -0
- package/lib/loop/core/a2uiComponents.js +15 -0
- package/lib/loop/core/index.d.ts +15 -1
- package/lib/loop/core/index.js +3 -0
- package/lib/loop/embed/AppEmbed.d.ts +25 -3
- package/lib/loop/embed/AppEmbed.js +106 -18
- package/lib/loop/embed/element.d.ts +5 -0
- package/lib/loop/embed/element.js +84 -5
- package/lib/loop/embed/embedConfig.d.ts +8 -0
- package/lib/loop/embed/embedConfig.js +18 -0
- package/lib/loop/embed/embedSession.d.ts +14 -0
- package/lib/loop/embed/embedSession.js +34 -0
- package/lib/loop/embed/hostBridge.d.ts +50 -3
- package/lib/loop/embed/hostBridge.js +22 -2
- package/lib/loop/index.d.ts +4 -3
- package/lib/loop/index.js +4 -3
- package/lib/loop/plugins/a2ui-surface/InlineSurface.d.ts +7 -1
- package/lib/loop/plugins/a2ui-surface/InlineSurface.js +7 -2
- package/lib/loop/plugins/a2ui-surface/SurfaceToolResult.js +4 -1
- package/lib/loop/plugins/a2ui-surface/ownComponents.d.ts +6 -0
- package/lib/loop/plugins/a2ui-surface/ownComponents.js +30 -0
- package/lib/loop/plugins/app-components/index.d.ts +26 -0
- package/lib/loop/plugins/app-components/index.js +56 -0
- package/lib/loop/plugins/app-elements/AppElements.d.ts +27 -0
- package/lib/loop/plugins/app-elements/AppElements.js +79 -0
- package/lib/loop/plugins/app-elements/index.d.ts +20 -0
- package/lib/loop/plugins/app-elements/index.js +43 -0
- package/lib/loop/plugins/app-page/AppPage.d.ts +9 -0
- package/lib/loop/plugins/app-page/AppPage.js +106 -8
- package/lib/loop/plugins/app-page/appPageModel.d.ts +17 -1
- package/lib/loop/plugins/app-page/appPageModel.js +122 -4
- package/lib/loop/plugins/app-page/index.d.ts +1 -0
- package/lib/loop/plugins/app-page/index.js +1 -0
- package/lib/loop/plugins/app-page/pageRun.d.ts +46 -0
- package/lib/loop/plugins/app-page/pageRun.js +111 -0
- package/lib/loop/plugins/assistant/index.js +8 -6
- package/lib/loop/plugins/chat/ChatView.js +16 -6
- package/lib/loop/plugins/chat/index.d.ts +1 -1
- package/lib/loop/plugins/chat/index.js +2 -1
- package/lib/models/PageTag.d.ts +1 -1
- package/lib/protocols/BrowserAgentAdapter.d.ts +8 -6
- package/lib/protocols/BrowserAgentAdapter.js +13 -10
- package/lib/runtimes/browser/a2aPeer.d.ts +2 -1
- package/lib/runtimes/browser/protocol.d.ts +1 -1
- package/lib/specs/actions.js +78 -1
- package/lib/specs/apps.d.ts +5 -0
- package/lib/specs/apps.js +1518 -216
- package/lib/specs/appspecSchema.js +630 -3
- package/lib/specs/teams/teams.d.ts +3 -0
- package/lib/specs/teams/teams.js +249 -0
- package/lib/specs/uiPlugins.js +6 -1
- package/lib/types/agentspecs.d.ts +200 -1
- package/lib/types/chat.d.ts +6 -5
- package/lib/types/teams.d.ts +13 -2
- package/package.json +2 -2
- package/scripts/codegen/generate_apps.py +20 -2
- package/scripts/codegen/generate_teams.py +15 -2
- package/lib/components/inspector/JsonTree.d.ts +0 -24
- package/lib/components/inspector/JsonTree.js +0 -89
- package/lib/components/inspector/a2aInspect.d.ts +0 -56
- package/lib/components/inspector/a2aInspect.js +0 -478
- package/lib/components/inspector/agentInspector.d.ts +0 -179
- package/lib/components/inspector/agentInspector.js +0 -267
- package/lib/components/inspector/chatInspect.d.ts +0 -38
- package/lib/components/inspector/chatInspect.js +0 -65
|
@@ -33,6 +33,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
33
33
|
* address and embedded;
|
|
34
34
|
* - its **frame**, when the host asks (`frame`): the `window-frame` plugin's
|
|
35
35
|
* window, its title the application's face and name;
|
|
36
|
+
* - its **language** (LOOP P-26): what a person reads of it — its name,
|
|
37
|
+
* welcome, starters, settings, commands, modes and profiles — in the first
|
|
38
|
+
* language they prefer that its Appspec is translated into (`language`,
|
|
39
|
+
* else the browser's), its own words otherwise (`translatedAppspec`);
|
|
40
|
+
* what it does is the same in every language;
|
|
36
41
|
* - its **sidebar**, when the host asks (`sidebar`, R-01b): its rules and
|
|
37
42
|
* the approvals waiting for the person (`app-rules`), what it did
|
|
38
43
|
* (`app-activity`), and its computer, live (`app-computer`, R-23), beside
|
|
@@ -52,14 +57,18 @@ import { CANVAS_BLOCK_PLUGINS, canvasBlocksPluginName, } from '../plugins/canvas
|
|
|
52
57
|
import { LoopEmbed } from '../embed/LoopEmbed';
|
|
53
58
|
import { dumpAppspec } from './appspec';
|
|
54
59
|
import { defineAppActivityPlugin } from '../plugins/app-activity';
|
|
60
|
+
import { AppElementsPlugin } from '../plugins/app-elements';
|
|
61
|
+
import { defineAppComponentsPlugin, hasCustomComponents, } from '../plugins/app-components';
|
|
55
62
|
import { defineAppComputerPlugin } from '../plugins/app-computer';
|
|
56
63
|
import { defineAppRulesPlugin } from '../plugins/app-rules';
|
|
57
|
-
import { defineAppComposerPlugin } from './AppComposer';
|
|
64
|
+
import { defineAppComposerPlugin, needsAppComposer, startersAsOpeners, } from './AppComposer';
|
|
58
65
|
import { modeEffect } from './composer';
|
|
66
|
+
import { preferredLanguages, translatedAppspec } from './language';
|
|
59
67
|
import { defineAppFeedbackPlugin } from './AppFeedback';
|
|
60
68
|
import { defineAppKeptPlugin } from './AppKept';
|
|
61
69
|
import { keepsFeedback } from './feedback';
|
|
62
70
|
import { keptBeforeFirstMessage } from './kept';
|
|
71
|
+
import { ChatLanguage } from '../../chat/ChatLanguage';
|
|
63
72
|
/** The id of an agent or a Cog, without its version. */
|
|
64
73
|
export const agentIdOf = (app) => {
|
|
65
74
|
const reference = app.agent || app.team;
|
|
@@ -80,14 +89,16 @@ export const agentIdOf = (app) => {
|
|
|
80
89
|
* An application run by a team is not supported in the workspace yet: a team
|
|
81
90
|
* is not an agent spec, and is refused here rather than launched as one.
|
|
82
91
|
*/
|
|
83
|
-
export function defineAppPlugin(app) {
|
|
92
|
+
export function defineAppPlugin(app, shown = app) {
|
|
84
93
|
if (!app.agent) {
|
|
85
94
|
throw new Error(`“${app.name}” is run by a team, which the workspace does not run as an application yet.`);
|
|
86
95
|
}
|
|
87
96
|
return defineAgentCapacityPlugin({
|
|
88
97
|
key: `app-${app.id}`,
|
|
89
|
-
|
|
90
|
-
|
|
98
|
+
// What a person reads is in their language (P-26); what it is created
|
|
99
|
+
// with is its own Appspec.
|
|
100
|
+
displayName: shown.name,
|
|
101
|
+
description: shown.description || `The ${shown.name} application`,
|
|
91
102
|
specId: agentIdOf(app),
|
|
92
103
|
emoji: app.emoji,
|
|
93
104
|
createPayload: {
|
|
@@ -98,21 +109,21 @@ export function defineAppPlugin(app) {
|
|
|
98
109
|
enable_codemode: Boolean(app.permissions?.computer?.shell),
|
|
99
110
|
...(app.model ? { model: app.model } : {}),
|
|
100
111
|
},
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})),
|
|
112
|
+
// Its starters, each under its category (P-20); with profiles, the
|
|
113
|
+
// composer offers the profile's in their place.
|
|
114
|
+
suggestions: startersAsOpeners(shown.interface.starters),
|
|
105
115
|
// In the page, the agent is told what a runtime tells it: its own
|
|
106
116
|
// spec's prompt, then the application's instructions; on the
|
|
107
117
|
// application's model when it names one (`loop/apps/agent`).
|
|
108
118
|
instructions: app.instructions,
|
|
109
119
|
model: app.model,
|
|
110
|
-
// Its modes (LOOP P-19), as the session API
|
|
111
|
-
//
|
|
112
|
-
// run they are sent with.
|
|
113
|
-
...((app.interface.modes ?? []).length > 0
|
|
120
|
+
// Its modes and its profiles (LOOP P-19, P-20), as the session API
|
|
121
|
+
// applies them: the profile's instructions and those of the options
|
|
122
|
+
// chosen, and the model one names, for the run they are sent with.
|
|
123
|
+
...((app.interface.modes ?? []).length > 0 ||
|
|
124
|
+
(app.interface.profiles ?? []).length > 0
|
|
114
125
|
? {
|
|
115
|
-
modeEffect: (chosen) => modeEffect(app, chosen),
|
|
126
|
+
modeEffect: (chosen, profile) => modeEffect(app, chosen, profile),
|
|
116
127
|
}
|
|
117
128
|
: {}),
|
|
118
129
|
});
|
|
@@ -157,7 +168,9 @@ export function appLayoutOptions(app) {
|
|
|
157
168
|
* but those of the UI plugins its organization turned off (`pluginsOff`),
|
|
158
169
|
* whose contributions are the blocks it may draw (R-01b); a thumb and a
|
|
159
170
|
* comment on each answer when its record keeps feedback (V-18); its
|
|
160
|
-
* commands in the composer's `/` menu and its modes beside it (P-19);
|
|
171
|
+
* commands in the composer's `/` menu and its modes beside it (P-19); the
|
|
172
|
+
* side panel and the pages its code opens (`app-elements`, P-18); the
|
|
173
|
+
* components its developer wrote (`app-components`, P-17); what it
|
|
161
174
|
* keeps and for how long, under its prompt before the first message, when
|
|
162
175
|
* `kept` says it (R-31); with
|
|
163
176
|
* `sidebar`, its rules and approvals card, its activity feed and its
|
|
@@ -185,19 +198,21 @@ export function appPreset(app, options = {}) {
|
|
|
185
198
|
};
|
|
186
199
|
}
|
|
187
200
|
const withPage = hasAppPage(app);
|
|
201
|
+
const shown = options.shown ?? app;
|
|
188
202
|
// The blocks its Canvas offers: those of the UI plugins not turned off.
|
|
189
203
|
const off = new Set((options.pluginsOff ?? []).map(canvasBlocksPluginName));
|
|
190
204
|
const blocks = CANVAS_BLOCK_PLUGINS.filter(plugin => !off.has(plugin.name));
|
|
191
205
|
return {
|
|
192
206
|
plugins: [
|
|
193
|
-
defineAppPlugin(app),
|
|
194
|
-
...(withPage ? [defineAppPagePlugin(
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
-
...((app
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
207
|
+
defineAppPlugin(app, shown),
|
|
208
|
+
...(withPage ? [defineAppPagePlugin(shown), ...blocks] : []),
|
|
209
|
+
// The components its developer wrote (LOOP P-17): blocks of its page
|
|
210
|
+
// and renderers of its page, its elements and its answers — its own.
|
|
211
|
+
...(hasCustomComponents(app) ? [defineAppComponentsPlugin(app)] : []),
|
|
212
|
+
// Its commands in the composer's `/` menu, its modes and its profiles
|
|
213
|
+
// beside the composer (LOOP P-19, P-20) and what a person may attach
|
|
214
|
+
// there (P-21): only for an application that has some.
|
|
215
|
+
...(needsAppComposer(app) ? [defineAppComposerPlugin(shown)] : []),
|
|
201
216
|
// A thumb and a comment on each answer, kept in its record (LOOP
|
|
202
217
|
// V-18): only for an application whose record keeps feedback.
|
|
203
218
|
...(keepsFeedback(app) ? [defineAppFeedbackPlugin(app)] : []),
|
|
@@ -217,6 +232,9 @@ export function appPreset(app, options = {}) {
|
|
|
217
232
|
: options.computer
|
|
218
233
|
? [defineAppComputerPlugin(app)]
|
|
219
234
|
: []),
|
|
235
|
+
// What its code opens beside the conversation (LOOP P-18): a side
|
|
236
|
+
// panel, a page of its own; nothing drawn while nothing is open.
|
|
237
|
+
AppElementsPlugin,
|
|
220
238
|
],
|
|
221
239
|
workspace: appLayoutOptions(app),
|
|
222
240
|
};
|
|
@@ -281,7 +299,7 @@ export function appThemeOverrides(app, variant) {
|
|
|
281
299
|
}
|
|
282
300
|
: undefined;
|
|
283
301
|
}
|
|
284
|
-
export function AppRenderer({ app, plugins = NO_PLUGINS, instance, onPresence, onSaying, paused = false, sidebar = false, computer = false, frame = false, page, pluginsOff, ...embed }) {
|
|
302
|
+
export function AppRenderer({ app, plugins = NO_PLUGINS, instance, onPresence, onSaying, paused = false, sidebar = false, computer = false, frame = false, page, pluginsOff, language, ...embed }) {
|
|
285
303
|
/*
|
|
286
304
|
* The kind's plugins, made once per application. `LoopEmbed` rebuilds its
|
|
287
305
|
* whole reactor when its plugins change, so a new plugin on every render
|
|
@@ -290,6 +308,14 @@ export function AppRenderer({ app, plugins = NO_PLUGINS, instance, onPresence, o
|
|
|
290
308
|
*/
|
|
291
309
|
const source = JSON.stringify(dumpAppspec(app));
|
|
292
310
|
const off = [...(pluginsOff ?? [])].sort().join(',');
|
|
311
|
+
/*
|
|
312
|
+
* What the person reads, in their language (P-26): the host's, else the
|
|
313
|
+
* browser's. Read once per language: a new one is a new workspace.
|
|
314
|
+
*/
|
|
315
|
+
const preferred = (language ? [language] : preferredLanguages()).join(',');
|
|
316
|
+
const shown = useMemo(() => translatedAppspec(app, preferred.split(',').filter(Boolean)),
|
|
317
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
318
|
+
[source, preferred]);
|
|
293
319
|
/*
|
|
294
320
|
* What it keeps, said before the first message (R-31): run as a
|
|
295
321
|
* deployment — at its address, embedded — and not in its builder's
|
|
@@ -305,6 +331,7 @@ export function AppRenderer({ app, plugins = NO_PLUGINS, instance, onPresence, o
|
|
|
305
331
|
sidebar,
|
|
306
332
|
computer,
|
|
307
333
|
appUid: instance?.appUid,
|
|
334
|
+
shown,
|
|
308
335
|
...(deployed ? { kept: { visitor } } : {}),
|
|
309
336
|
});
|
|
310
337
|
}
|
|
@@ -315,7 +342,17 @@ export function AppRenderer({ app, plugins = NO_PLUGINS, instance, onPresence, o
|
|
|
315
342
|
}
|
|
316
343
|
},
|
|
317
344
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
318
|
-
[
|
|
345
|
+
[
|
|
346
|
+
source,
|
|
347
|
+
shown,
|
|
348
|
+
page,
|
|
349
|
+
off,
|
|
350
|
+
sidebar,
|
|
351
|
+
computer,
|
|
352
|
+
instance?.appUid,
|
|
353
|
+
deployed,
|
|
354
|
+
visitor,
|
|
355
|
+
]);
|
|
319
356
|
const allPlugins = useMemo(() => ('problem' in preset ? plugins : [...preset.plugins, ...plugins]), [preset, plugins]);
|
|
320
357
|
/*
|
|
321
358
|
* On Datalayer, the application runs on a runtime: allocated with a plain
|
|
@@ -354,31 +391,34 @@ export function AppRenderer({ app, plugins = NO_PLUGINS, instance, onPresence, o
|
|
|
354
391
|
if ('problem' in preset) {
|
|
355
392
|
return (_jsx("div", { role: "status", style: { padding: 16 }, children: preset.problem }));
|
|
356
393
|
}
|
|
357
|
-
return (
|
|
358
|
-
// The
|
|
359
|
-
//
|
|
360
|
-
, {
|
|
394
|
+
return (
|
|
395
|
+
// The chat's own words in the person's language too (P-26): the host's,
|
|
396
|
+
// else the browser's.
|
|
397
|
+
_jsx(ChatLanguage, { language: language, children: _jsx(LoopEmbed
|
|
361
398
|
// The application's own agent: created under its id, so that its
|
|
362
399
|
// spec is applied to an agent of its own, never to the one it extends.
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
name:
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
400
|
+
, {
|
|
401
|
+
// The application's own agent: created under its id, so that its
|
|
402
|
+
// spec is applied to an agent of its own, never to the one it extends.
|
|
403
|
+
agentId: app.id, ...preset.workspace, ...(frame
|
|
404
|
+
? {
|
|
405
|
+
frameTitle: [app.emoji, shown.name].filter(Boolean).join(' '),
|
|
406
|
+
}
|
|
407
|
+
: {}),
|
|
408
|
+
// Its rules, activity and computer on a rail, one at a time (T-07).
|
|
409
|
+
sidebarRail: sidebar || computer, teamPicker: false, showAgentVariants: false, graph: false, pluginsPanel: false, datalayerAgentSpecId: DATALAYER_BOOTSTRAP_AGENTSPEC,
|
|
410
|
+
// Where an application runs is decided by its host — the Studio's
|
|
411
|
+
// Preview, the hosted page — not offered to its user.
|
|
412
|
+
targetFixed: true, ...(named ? { themeVariant: named.variant } : {}), ...(namedMode ? { colorMode: namedMode } : {}), themeOverrides: themeOverrides,
|
|
413
|
+
// Its own face, name and welcome in the chat (T-08); no counters: a
|
|
414
|
+
// person using an application is not asking about tokens.
|
|
415
|
+
presence: {
|
|
416
|
+
name: shown.name,
|
|
417
|
+
face: app.emoji,
|
|
418
|
+
welcome: shown.interface.welcome || shown.description,
|
|
419
|
+
paused,
|
|
420
|
+
onPresence,
|
|
421
|
+
onSaying,
|
|
422
|
+
}, showTokenUsage: false, datalayerCreatePayload: datalayerCreatePayload, ...embed, plugins: allPlugins }) }));
|
|
383
423
|
}
|
|
384
424
|
export default AppRenderer;
|
|
@@ -24,9 +24,11 @@
|
|
|
24
24
|
*
|
|
25
25
|
* @module loop/apps/appspec
|
|
26
26
|
*/
|
|
27
|
-
import type { AppAccent, AppThemeMode, AppThemeVariant, AppAssistantCharacter, AppEmbedMode, AppVoiceSpec, AppKind, AppLayout, AppSpec } from '../../types/agentspecs';
|
|
27
|
+
import type { AppAccent, AppThemeMode, AppThemeVariant, AppAssistantCharacter, AppEmbedMode, AppCustomComponentSpec, AppVoiceSpec, AppKind, AppLayout, AppPageOutputComponent, AppSpec } from '../../types/agentspecs';
|
|
28
28
|
/** The version of the spec itself. */
|
|
29
29
|
export declare const APP_SCHEMA = "loop.app/v1";
|
|
30
|
+
/** The language an application's own words are in, unless it says (LOOP P-26). */
|
|
31
|
+
export declare const DEFAULT_LANGUAGE = "en";
|
|
30
32
|
/** The face of an application that has not chosen one. */
|
|
31
33
|
export declare const DEFAULT_EMOJI = "\uD83D\uDC40";
|
|
32
34
|
export declare const APP_KINDS: AppKind[];
|
|
@@ -60,6 +62,16 @@ export declare function retentionDays(keepFor: string): number;
|
|
|
60
62
|
export declare function emptyAppspec(kind?: AppKind): AppSpec;
|
|
61
63
|
/** An application's voice (VOICE.md VO-41): off unless said. */
|
|
62
64
|
export declare const DEFAULT_VOICE: AppVoiceSpec;
|
|
65
|
+
/** What a page's output may be drawn with (LOOP P-05), and the property of each that shows its value. */
|
|
66
|
+
export declare const PAGE_OUTPUT_SHOWS: Record<AppPageOutputComponent, string>;
|
|
67
|
+
/** The height of a component its developer wrote (P-17), unless it says. */
|
|
68
|
+
export declare const DEFAULT_CUSTOM_HEIGHT = 240;
|
|
69
|
+
/**
|
|
70
|
+
* The property a page's output fills with its value (P-05): a catalog
|
|
71
|
+
* component's (`PAGE_OUTPUT_SHOWS`), or what a component of the
|
|
72
|
+
* application's own shows first (P-17). Undefined for any other.
|
|
73
|
+
*/
|
|
74
|
+
export declare function pageOutputShows(component: string, own?: readonly AppCustomComponentSpec[]): string | undefined;
|
|
63
75
|
/** What reading a document gives: the application, and what the document got wrong. */
|
|
64
76
|
export interface ParsedAppspec {
|
|
65
77
|
app: AppSpec;
|