@datalayer/agent-runtimes 1.3.114 → 1.5.0
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/ChatView-CaBuPTyG.js +32 -0
- package/dist-embed/chunks/{DeckComponent-CuRWiARr.js → DeckComponent-cRJJMGgt.js} +1 -1
- package/dist-embed/chunks/{DocumentView-BYU2HREd.js → DocumentView-CiqN9ze6.js} +1 -1
- package/dist-embed/chunks/{EphemeralDocument-BjFSuQKH.js → EphemeralDocument-BjJfn7J-.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawComponent-CFLnMPnf.js → ExcalidrawComponent-BtNXWUN8.js} +1 -1
- package/dist-embed/chunks/{ExcalidrawModal-CB9d5Vpk.js → ExcalidrawModal-C6SEKFlD.js} +1 -1
- package/dist-embed/chunks/{JupyterLexicalExtension-CYnZrelh.js → JupyterLexicalExtension-BuRLImy5.js} +5 -5
- package/dist-embed/chunks/{NotebookToolSurfaces-D62q-lbb.js → NotebookToolSurfaces-ktcGRm7d.js} +1 -1
- package/dist-embed/chunks/{Output-2KxoKu5F.js → Output-BscOPLqE.js} +10 -10
- package/dist-embed/chunks/{YouTubePlugin-CjODyxZ2.js → YouTubePlugin-xBjNr2Iu.js} +1 -1
- package/dist-embed/chunks/{ar-SA-G6X2FPQ2-C-zAYgA-.js → ar-SA-G6X2FPQ2-BB82iKLz.js} +1 -1
- package/dist-embed/chunks/{az-AZ-76LH7QW2-BHq5js6U.js → az-AZ-76LH7QW2-DsMRKXlw.js} +1 -1
- package/dist-embed/chunks/{bg-BG-XCXSNQG7-BTcNNcTc.js → bg-BG-XCXSNQG7-43Y1kPxa.js} +1 -1
- package/dist-embed/chunks/{bn-BD-2XOGV67Q-DXRk27u1.js → bn-BD-2XOGV67Q-CLqPJBll.js} +1 -1
- package/dist-embed/chunks/{ca-ES-6MX7JW3Y-D-0J9rqp.js → ca-ES-6MX7JW3Y-CDFGSEh3.js} +1 -1
- package/dist-embed/chunks/{cs-CZ-2BRQDIVT-CgN3I-57.js → cs-CZ-2BRQDIVT-ByNB8eZd.js} +1 -1
- package/dist-embed/chunks/{da-DK-5WZEPLOC-CHQloSoX.js → da-DK-5WZEPLOC-B7MrVwy8.js} +1 -1
- package/dist-embed/chunks/{de-DE-XR44H4JA-C-Hq84pe.js → de-DE-XR44H4JA-CN1cdk94.js} +1 -1
- package/dist-embed/chunks/{el-GR-BZB4AONW-MTzGcSsP.js → el-GR-BZB4AONW-DnaGhWD1.js} +1 -1
- package/dist-embed/chunks/{es-ES-U4NZUMDT-Thj-4Rwn.js → es-ES-U4NZUMDT-DE1vZzDE.js} +1 -1
- package/dist-embed/chunks/{eu-ES-A7QVB2H4-BEEyNQo-.js → eu-ES-A7QVB2H4-DmHB0zpm.js} +1 -1
- package/dist-embed/chunks/{fa-IR-HGAKTJCU-CtUGmNBZ.js → fa-IR-HGAKTJCU-CNzE8tJj.js} +1 -1
- package/dist-embed/chunks/{fi-FI-Z5N7JZ37-6GMgpkSu.js → fi-FI-Z5N7JZ37-Ca2vTFQC.js} +1 -1
- package/dist-embed/chunks/{fr-FR-RHASNOE6-BakNCbxj.js → fr-FR-RHASNOE6-B0yWFX3_.js} +1 -1
- package/dist-embed/chunks/{gl-ES-HMX3MZ6V-Cwkb9OPk.js → gl-ES-HMX3MZ6V-2_3FMVJq.js} +1 -1
- package/dist-embed/chunks/{he-IL-6SHJWFNN-BaMmvCkr.js → he-IL-6SHJWFNN-BW1lby00.js} +1 -1
- package/dist-embed/chunks/{hi-IN-IWLTKZ5I-1aWewhep.js → hi-IN-IWLTKZ5I-DTixfSwB.js} +1 -1
- package/dist-embed/chunks/{hu-HU-A5ZG7DT2-BIHI23BQ.js → hu-HU-A5ZG7DT2-DOfYwLWP.js} +1 -1
- package/dist-embed/chunks/{id-ID-SAP4L64H-CYpgmx8X.js → id-ID-SAP4L64H-Cwtdtkvg.js} +1 -1
- package/dist-embed/chunks/{index-BhSMzuKq.js → index--qMT5k1q.js} +1 -1
- package/dist-embed/chunks/{index-b1yzCiTq.js → index-B-UP9DlM.js} +1 -1
- package/dist-embed/chunks/{index-DMKsCn-y.js → index-BAwsCLGT.js} +1 -1
- package/dist-embed/chunks/{index-BUhqZVtg.js → index-BITOMOWN.js} +1 -1
- package/dist-embed/chunks/{index-1wTrAXI1.js → index-B_9UD0bt.js} +2 -2
- package/dist-embed/chunks/{index-DtlUttQj.js → index-BgFbP5P0.js} +1 -1
- package/dist-embed/chunks/{index-CC-Ht79i.js → index-CMUTS_sA.js} +1 -1
- package/dist-embed/chunks/{index-B7nmHsEo.js → index-Cgf7tlW3.js} +1 -1
- package/dist-embed/chunks/{index-CsZ2HycN.js → index-CrNfUmIU.js} +1 -1
- package/dist-embed/chunks/{index-DIOcQUrz.js → index-CzuLxFBK.js} +1 -1
- package/dist-embed/chunks/{index-EmZm7_bH.js → index-DEn5R18M.js} +1 -1
- package/dist-embed/chunks/{index-DeVZ-nmF.js → index-DFEBhySA.js} +1 -1
- package/dist-embed/chunks/{index-CMYyiALV.js → index-DYkwi0aX.js} +1 -1
- package/dist-embed/chunks/{index-Fzz2KjFM.js → index-DvpdAlVH.js} +1 -1
- package/dist-embed/chunks/{index-W7TVoWP5.js → index-Dyh5xopp.js} +1 -1
- package/dist-embed/chunks/{index-en9Yf1Yz.js → index-Jt4bWLoz.js} +1 -1
- package/dist-embed/chunks/{index-BbucLMre.js → index-S-sjhoD3.js} +1 -1
- package/dist-embed/chunks/{index-D18sf241.js → index-TRLGqZaF.js} +1 -1
- package/dist-embed/chunks/{index-ZZnjmFwm.js → index-YcqCoWJl.js} +1 -1
- package/dist-embed/chunks/{index-BFLtEBuP.js → index-sQy5cmWo.js} +1 -1
- package/dist-embed/chunks/{it-IT-JPQ66NNP-CLcqplyX.js → it-IT-JPQ66NNP-C3xZ61-6.js} +1 -1
- package/dist-embed/chunks/{ja-JP-DBVTYXUO-u8Qe6tR7.js → ja-JP-DBVTYXUO-CeTmglEb.js} +1 -1
- package/dist-embed/chunks/{kaa-6HZHGXH3-BG2kx50I.js → kaa-6HZHGXH3-D6Jr6B6Y.js} +1 -1
- package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-CSYUpRxd.js → kab-KAB-ZGHBKWFO-pEXBqeuG.js} +1 -1
- package/dist-embed/chunks/{kk-KZ-P5N5QNE5-CpBMgHAz.js → kk-KZ-P5N5QNE5-BRJunmHm.js} +1 -1
- package/dist-embed/chunks/{km-KH-HSX4SM5Z-CoMUUQMb.js → km-KH-HSX4SM5Z--GJgT9rN.js} +1 -1
- package/dist-embed/chunks/{ko-KR-MTYHY66A-DwxY8CGI.js → ko-KR-MTYHY66A-Bjnez4qR.js} +1 -1
- package/dist-embed/chunks/{ku-TR-6OUDTVRD-UoNYUfm0.js → ku-TR-6OUDTVRD-DgOdYJrS.js} +1 -1
- package/dist-embed/chunks/{lt-LT-XHIRWOB4-Dr4uXaEj.js → lt-LT-XHIRWOB4-BMwhrtjM.js} +1 -1
- package/dist-embed/chunks/{lv-LV-5QDEKY6T-CNC56J-_.js → lv-LV-5QDEKY6T-0pxW7YE0.js} +1 -1
- package/dist-embed/chunks/{mr-IN-CRQNXWMA-BKWa9nzZ.js → mr-IN-CRQNXWMA-tndp8BXC.js} +1 -1
- package/dist-embed/chunks/{my-MM-5M5IBNSE-bwAzOWhV.js → my-MM-5M5IBNSE-sispDhO4.js} +1 -1
- package/dist-embed/chunks/{nb-NO-T6EIAALU-CkpsChor.js → nb-NO-T6EIAALU-CjBurOuS.js} +1 -1
- package/dist-embed/chunks/{nl-NL-IS3SIHDZ-COVk4rlb.js → nl-NL-IS3SIHDZ-B58EVmr3.js} +1 -1
- package/dist-embed/chunks/{nn-NO-6E72VCQL-DlyFF-C1.js → nn-NO-6E72VCQL-D1p7LZSq.js} +1 -1
- package/dist-embed/chunks/{oc-FR-POXYY2M6-CFDosV2C.js → oc-FR-POXYY2M6-C1M8sddP.js} +1 -1
- package/dist-embed/chunks/{pa-IN-N4M65BXN-BKRB3O0U.js → pa-IN-N4M65BXN-D8ESzASl.js} +1 -1
- package/dist-embed/chunks/{percentages-BXMCSKIN-D7pnqUsZ.js → percentages-BXMCSKIN-BihMTsFR.js} +3 -3
- package/dist-embed/chunks/{pl-PL-T2D74RX3-C5r2Tds7.js → pl-PL-T2D74RX3-DQGe6LHC.js} +1 -1
- package/dist-embed/chunks/{pt-BR-5N22H2LF-CDnT98bW.js → pt-BR-5N22H2LF-CvXBgZQs.js} +1 -1
- package/dist-embed/chunks/{pt-PT-UZXXM6DQ-C6c4SPk1.js → pt-PT-UZXXM6DQ-BMnnlIUJ.js} +1 -1
- package/dist-embed/chunks/{ro-RO-JPDTUUEW-CW6pbzEZ.js → ro-RO-JPDTUUEW-DZ-9UUH7.js} +1 -1
- package/dist-embed/chunks/{ru-RU-B4JR7IUQ-CbaAJG0w.js → ru-RU-B4JR7IUQ-JlRBwjob.js} +1 -1
- package/dist-embed/chunks/{si-LK-N5RQ5JYF-BZkUjpXF.js → si-LK-N5RQ5JYF-Bx8kHnkd.js} +1 -1
- package/dist-embed/chunks/{sk-SK-C5VTKIMK-DsfWgpPU.js → sk-SK-C5VTKIMK-xsfEfbZb.js} +1 -1
- package/dist-embed/chunks/{sl-SI-NN7IZMDC-Kx0FqxKU.js → sl-SI-NN7IZMDC-SQYUECnr.js} +1 -1
- package/dist-embed/chunks/{subset-shared.chunk-DM3l9OuH.js → subset-shared.chunk-Ch6j8nKC.js} +1 -1
- package/dist-embed/chunks/{subset-worker.chunk-4w4yibm3.js → subset-worker.chunk-pJjck5pR.js} +1 -1
- package/dist-embed/chunks/{sv-SE-XGPEYMSR-DY0ryO-L.js → sv-SE-XGPEYMSR-BxcjSHE2.js} +1 -1
- package/dist-embed/chunks/{ta-IN-2NMHFXQM-CWpIs0i0.js → ta-IN-2NMHFXQM-rItSkDUS.js} +1 -1
- package/dist-embed/chunks/{th-TH-HPSO5L25-Cwkcfb3u.js → th-TH-HPSO5L25-B7UzESFj.js} +1 -1
- package/dist-embed/chunks/{tr-TR-DEFEU3FU-BqJZZl-Y.js → tr-TR-DEFEU3FU-Ci6oNfEX.js} +1 -1
- package/dist-embed/chunks/{uk-UA-QMV73CPH-Dg213mG4.js → uk-UA-QMV73CPH-C9csqvO6.js} +1 -1
- package/dist-embed/chunks/{vi-VN-M7AON7JQ-DY94NKxF.js → vi-VN-M7AON7JQ-DRAj2kZj.js} +1 -1
- package/dist-embed/chunks/{zh-CN-LNUGB5OW-B6I9A7sA.js → zh-CN-LNUGB5OW-DLOyW8hH.js} +1 -1
- package/dist-embed/chunks/{zh-HK-E62DVLB3-D3oqgDOt.js → zh-HK-E62DVLB3-DwC6_2Ws.js} +1 -1
- package/dist-embed/chunks/{zh-TW-RAJ6MFWO-CYwgY0Jo.js → zh-TW-RAJ6MFWO-DEMugIwa.js} +1 -1
- package/dist-embed/datalayer-app-main.js +156 -156
- package/lib/apps/apps/appspec.d.ts +13 -0
- package/lib/apps/apps/appspec.js +93 -0
- package/lib/apps/apps/checks.d.ts +1 -1
- package/lib/apps/apps/checks.js +2 -2
- package/lib/apps/apps/customComponents.js +1 -1
- package/lib/apps/core/canvasBlocks.d.ts +3 -3
- package/lib/apps/core/canvasParts.d.ts +6 -4
- package/lib/apps/core/index.d.ts +8 -0
- package/lib/apps/embed/AppEmbed.js +13 -20
- package/lib/apps/embed/embedSession.d.ts +8 -4
- package/lib/apps/embed/embedSession.js +16 -9
- package/lib/apps/embed/hostBridge.d.ts +47 -13
- package/lib/apps/embed/hostBridge.js +135 -18
- package/lib/apps/index.d.ts +1 -1
- package/lib/apps/index.js +1 -1
- package/lib/apps/plugins/a2ui-surface/AnswerShows.d.ts +21 -0
- package/lib/apps/plugins/a2ui-surface/AnswerShows.js +29 -0
- package/lib/apps/plugins/a2ui-surface/SurfaceToolResult.js +4 -7
- package/lib/apps/plugins/a2ui-surface/index.d.ts +2 -1
- package/lib/apps/plugins/a2ui-surface/index.js +10 -1
- package/lib/apps/plugins/a2ui-surface/toolResult.d.ts +20 -11
- package/lib/apps/plugins/a2ui-surface/toolResult.js +27 -11
- package/lib/apps/plugins/app-components/index.d.ts +1 -1
- package/lib/apps/plugins/app-components/index.js +2 -2
- package/lib/apps/plugins/app-elements/AppElements.d.ts +3 -3
- package/lib/apps/plugins/app-elements/AppElements.js +5 -20
- package/lib/apps/plugins/app-elements/QuestionView.d.ts +30 -0
- package/lib/apps/plugins/app-elements/QuestionView.js +70 -0
- package/lib/apps/plugins/app-elements/index.d.ts +7 -4
- package/lib/apps/plugins/app-elements/index.js +14 -5
- package/lib/apps/plugins/app-page/appPageModel.d.ts +6 -8
- package/lib/apps/plugins/app-page/appPageModel.js +0 -2
- package/lib/apps/plugins/app-page/pageRun.d.ts +2 -2
- package/lib/apps/plugins/app-page/pageRun.js +3 -3
- package/lib/apps/plugins/canvas-blocks/index.d.ts +13 -13
- package/lib/apps/plugins/canvas-blocks/index.js +24 -24
- package/lib/apps/plugins/canvas-parts/index.d.ts +7 -1
- package/lib/apps/plugins/canvas-parts/index.js +36 -0
- package/lib/apps/plugins/chat/ChatView.js +29 -3
- package/lib/chat/base/ChatBase.js +264 -43
- package/lib/chat/base/loopElement.d.ts +16 -17
- package/lib/chat/base/loopElement.js +11 -27
- package/lib/chat/base/loopStep.d.ts +15 -15
- package/lib/chat/base/loopStep.js +10 -13
- package/lib/chat/base/loopWindow.d.ts +15 -20
- package/lib/chat/base/loopWindow.js +26 -27
- package/lib/chat/base/uiFiles.d.ts +29 -0
- package/lib/chat/base/uiFiles.js +69 -0
- package/lib/chat/base/uiOps.d.ts +96 -0
- package/lib/chat/base/uiOps.js +251 -0
- package/lib/chat/messages/ChatMessageList.d.ts +13 -1
- package/lib/chat/messages/ChatMessageList.js +4 -4
- package/lib/components/a2ui/datalayer/Chart.d.ts +1 -1
- package/lib/components/a2ui/datalayer/schema.js +1 -1
- package/lib/components/teams/AnswerSurfaces.d.ts +3 -2
- package/lib/components/teams/AnswerSurfaces.js +7 -7
- package/lib/components/teams/useA2ATeam.d.ts +1 -1
- package/lib/config/AgentConfiguration.d.ts +1 -1
- package/lib/examples/ProtocolSignedRequestsExample.d.ts +10 -0
- package/lib/examples/ProtocolSignedRequestsExample.js +41 -0
- package/lib/examples/ProtocolUcpCheckoutExample.d.ts +10 -0
- package/lib/examples/ProtocolUcpCheckoutExample.js +59 -0
- package/lib/examples/example-selector.js +2 -0
- package/lib/examples/exampleGroups.d.ts +1 -1
- package/lib/examples/exampleGroups.js +4 -0
- package/lib/examples/index.d.ts +2 -0
- package/lib/examples/index.js +2 -0
- package/lib/examples/protocols/signedRequestsDemo.d.ts +27 -0
- package/lib/examples/protocols/signedRequestsDemo.js +59 -0
- package/lib/examples/protocols/ucpCheckoutDemo.d.ts +36 -0
- package/lib/examples/protocols/ucpCheckoutDemo.js +68 -0
- package/lib/protocols/AGUIAdapter.d.ts +7 -0
- package/lib/protocols/AGUIAdapter.js +43 -3
- package/lib/protocols/a2a/index.js +1 -0
- package/lib/protocols/agentic-commerce/index.js +1 -0
- package/lib/protocols/core.d.ts +6 -0
- package/lib/protocols/mcp/index.js +1 -0
- package/lib/protocols/pact/index.js +1 -0
- package/lib/protocols/ucp/index.js +1 -0
- package/lib/protocols/ucp/merchant.d.ts +15 -0
- package/lib/protocols/ucp/merchant.js +257 -0
- package/lib/protocols/web-bot-auth/index.js +1 -0
- package/lib/specs/agents/agents.js +338 -169
- package/lib/specs/apps.js +134 -6
- package/lib/specs/appspecSchema.js +59 -0
- package/lib/specs/cogs.js +6 -3
- package/lib/specs/index.d.ts +2 -1
- package/lib/specs/index.js +2 -1
- package/lib/specs/protocols.d.ts +24 -0
- package/lib/specs/protocols.js +197 -0
- package/lib/specs/ui.d.ts +21 -0
- package/lib/specs/{uiPlugins.js → ui.js} +14 -14
- package/lib/types/agentspecs.d.ts +69 -5
- package/lib/types/messages.d.ts +7 -0
- package/lib/types/protocol.d.ts +15 -0
- package/package.json +2 -2
- package/scripts/codegen/generate_agents.py +43 -8
- package/scripts/codegen/generate_protocols.py +207 -0
- package/scripts/codegen/generate_sandbox_agents.py +1 -1
- package/scripts/codegen/{generate_ui_plugins.py → generate_ui.py} +40 -40
- package/scripts/gen_workers.py +2 -2
- package/dist-embed/chunks/ChatView-D41Nx5rC.js +0 -32
- package/lib/chat/base/loopMessage.d.ts +0 -37
- package/lib/chat/base/loopMessage.js +0 -37
- package/lib/specs/uiPlugins.d.ts +0 -21
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* code (`session.close`) or by the person. Inline, an element is a message,
|
|
6
6
|
* which the chat draws (P-04); this plugin draws the other two.
|
|
7
7
|
*
|
|
8
|
-
* The chat keeps what is open (`chat/base/loopElement`), from the session
|
|
9
|
-
*
|
|
10
|
-
* root slot, positioned against the workspace, so that nothing
|
|
11
|
-
* while nothing is open.
|
|
8
|
+
* The chat keeps what is open (`chat/base/loopElement`), from the session's
|
|
9
|
+
* ui socket (REACTOR_UI RU-3, RU-W); this plugin draws it from the
|
|
10
|
+
* workspace's root slot, positioned against the workspace, so that nothing
|
|
11
|
+
* is laid out while nothing is open. It also contributes the renderer of
|
|
12
|
+
* what the code asks (`QuestionView`, RU-4), drawn under the message that
|
|
13
|
+
* asks it.
|
|
12
14
|
*
|
|
13
15
|
* @module apps/plugins/app-elements
|
|
14
16
|
*/
|
|
@@ -17,4 +19,5 @@ export declare const APP_ELEMENTS_PLUGIN_NAME = "@datalayer/loop-plugin-app-elem
|
|
|
17
19
|
/** The plugin that draws an application's side panel and pages. */
|
|
18
20
|
export declare const AppElementsPlugin: ReactorPlugin<Record<string, never>, unknown, unknown>;
|
|
19
21
|
export { AppElements, APP_PANEL_WIDTH, elementsByPlace } from './AppElements';
|
|
22
|
+
export { QUESTION_DISPLAY_TYPE, QuestionView, questionOf, } from './QuestionView';
|
|
20
23
|
export default AppElementsPlugin;
|
|
@@ -9,17 +9,22 @@
|
|
|
9
9
|
* code (`session.close`) or by the person. Inline, an element is a message,
|
|
10
10
|
* which the chat draws (P-04); this plugin draws the other two.
|
|
11
11
|
*
|
|
12
|
-
* The chat keeps what is open (`chat/base/loopElement`), from the session
|
|
13
|
-
*
|
|
14
|
-
* root slot, positioned against the workspace, so that nothing
|
|
15
|
-
* while nothing is open.
|
|
12
|
+
* The chat keeps what is open (`chat/base/loopElement`), from the session's
|
|
13
|
+
* ui socket (REACTOR_UI RU-3, RU-W); this plugin draws it from the
|
|
14
|
+
* workspace's root slot, positioned against the workspace, so that nothing
|
|
15
|
+
* is laid out while nothing is open. It also contributes the renderer of
|
|
16
|
+
* what the code asks (`QuestionView`, RU-4), drawn under the message that
|
|
17
|
+
* asks it.
|
|
16
18
|
*
|
|
17
19
|
* @module apps/plugins/app-elements
|
|
18
20
|
*/
|
|
19
|
-
import { definePlugin } from '@datalayer/reactor';
|
|
21
|
+
import { contribution, definePlugin, } from '@datalayer/reactor';
|
|
22
|
+
import { Renderers } from '@datalayer/reactor/ui';
|
|
23
|
+
import { defineRenderer } from '@datalayer/reactor/ui/react';
|
|
20
24
|
import { clearLoopElements } from '../../../chat/base/loopElement';
|
|
21
25
|
import { LoopSlots } from '../../core';
|
|
22
26
|
import { AppElements } from './AppElements';
|
|
27
|
+
import { QUESTION_DISPLAY_TYPE, QuestionView } from './QuestionView';
|
|
23
28
|
export const APP_ELEMENTS_PLUGIN_NAME = '@datalayer/loop-plugin-app-elements';
|
|
24
29
|
/** The plugin that draws an application's side panel and pages. */
|
|
25
30
|
export const AppElementsPlugin = definePlugin({
|
|
@@ -27,6 +32,9 @@ export const AppElementsPlugin = definePlugin({
|
|
|
27
32
|
displayName: 'Side panel and pages',
|
|
28
33
|
description: 'What an application opens beside the conversation: a side panel, or a page of its own.',
|
|
29
34
|
octicon: 'sidebar-expand',
|
|
35
|
+
contributes: [
|
|
36
|
+
contribution(Renderers, defineRenderer({ type: QUESTION_DISPLAY_TYPE, component: QuestionView }), { id: 'app-elements:question' }),
|
|
37
|
+
],
|
|
30
38
|
build: () => ({
|
|
31
39
|
components: [
|
|
32
40
|
{
|
|
@@ -40,4 +48,5 @@ export const AppElementsPlugin = definePlugin({
|
|
|
40
48
|
register: () => clearLoopElements,
|
|
41
49
|
});
|
|
42
50
|
export { AppElements, APP_PANEL_WIDTH, elementsByPlace } from './AppElements';
|
|
51
|
+
export { QUESTION_DISPLAY_TYPE, QuestionView, questionOf, } from './QuestionView';
|
|
43
52
|
export default AppElementsPlugin;
|
|
@@ -162,16 +162,14 @@ export declare function settingsOf(app: Pick<AppSpec, 'interface'>, inputs: unkn
|
|
|
162
162
|
*/
|
|
163
163
|
export declare function pageInputsOf(app: Pick<AppSpec, 'kind' | 'interface'>, inputs: unknown): Record<string, unknown>;
|
|
164
164
|
/**
|
|
165
|
-
* What the page did besides its message, for the session API: the
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
*
|
|
165
|
+
* What the page did besides its message, for the session API: the files
|
|
166
|
+
* given with it, the settings it holds. Sent with the chat's own run (AG-UI's
|
|
167
|
+
* `forwardedProps.loop`), so that what it answers streams in the
|
|
168
|
+
* conversation (LOOP R-04). A block sends a message, never an action of its
|
|
169
|
+
* own: an action of the application's code is pressed with the token its
|
|
170
|
+
* session offered, up the ui socket (REACTOR_UI RU-5).
|
|
169
171
|
*/
|
|
170
172
|
export type AppPageLoop = {
|
|
171
|
-
action: {
|
|
172
|
-
name: string;
|
|
173
|
-
payload: Record<string, unknown>;
|
|
174
|
-
};
|
|
175
173
|
files?: GivenFile[];
|
|
176
174
|
settings?: Record<string, unknown>;
|
|
177
175
|
};
|
|
@@ -474,9 +474,7 @@ export function appPageAction(app, event, read, lastInputs = '') {
|
|
|
474
474
|
const message = typeof given === 'string' ? given.trim() : '';
|
|
475
475
|
const inputs = paths.inputs ? inputsInWords(app, read('/inputs')) : '';
|
|
476
476
|
const settings = paths.inputs ? settingsOf(app, read('/inputs')) : undefined;
|
|
477
|
-
const payload = Object.fromEntries(Object.entries(event.context ?? {}).filter(([key]) => key !== 'message' && key !== 'files'));
|
|
478
477
|
const loop = (files) => ({
|
|
479
|
-
action: { name: event.name, payload },
|
|
480
478
|
...(files && files.length > 0 ? { files } : {}),
|
|
481
479
|
...(settings ? { settings } : {}),
|
|
482
480
|
});
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*
|
|
4
4
|
* The page opens a session of the application's agent on its runtime
|
|
5
5
|
* (`POST /api/v1/apps/sessions`), then, each time an input changes, sends
|
|
6
|
-
* them all
|
|
7
|
-
*
|
|
6
|
+
* them all to its page (`POST …/sessions/{uid}/page`, `{inputs}`) — not an
|
|
7
|
+
* action of its code (REACTOR_UI RU-5). The runtime checks them against the
|
|
8
8
|
* page's form — refused with 422 and a sentence — runs its code's
|
|
9
9
|
* `@app.page` on them, and answers its outputs as a `CUSTOM` event named
|
|
10
10
|
* `loop.page`, `{inputs, outputs}`, which the page shows in place. Nothing is
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* The page opens a session of the application's agent on its runtime
|
|
9
9
|
* (`POST /api/v1/apps/sessions`), then, each time an input changes, sends
|
|
10
|
-
* them all
|
|
11
|
-
*
|
|
10
|
+
* them all to its page (`POST …/sessions/{uid}/page`, `{inputs}`) — not an
|
|
11
|
+
* action of its code (REACTOR_UI RU-5). The runtime checks them against the
|
|
12
12
|
* page's form — refused with 422 and a sentence — runs its code's
|
|
13
13
|
* `@app.page` on them, and answers its outputs as a `CUSTOM` event named
|
|
14
14
|
* `loop.page`, `{inputs, outputs}`, which the page shows in place. Nothing is
|
|
@@ -98,7 +98,7 @@ export async function openPageSession(context) {
|
|
|
98
98
|
*/
|
|
99
99
|
export async function runPageIn(context, uid, inputs) {
|
|
100
100
|
try {
|
|
101
|
-
const stream = await posted(context, `${base(context)}/${encodeURIComponent(uid)}/
|
|
101
|
+
const stream = await posted(context, `${base(context)}/${encodeURIComponent(uid)}/page`, { inputs });
|
|
102
102
|
return pageTurnOf(stream);
|
|
103
103
|
}
|
|
104
104
|
catch (error) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The Canvas's palette as a contribution point (LOOP C-12): each UI
|
|
3
|
-
* the catalogue that renders components (`agentspecs/ui
|
|
2
|
+
* The Canvas's palette as a contribution point (LOOP C-12): each UI of
|
|
3
|
+
* the catalogue that renders components (`agentspecs/ui`, C-13) is a
|
|
4
4
|
* Reactor plugin contributing its components to `loop.canvas.block`. The
|
|
5
5
|
* palette lists what the enabled plugins contribute, and nothing else; a
|
|
6
6
|
* plugin disabled takes its blocks off it, and an application that uses one
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* @module apps/plugins/canvas-blocks
|
|
13
13
|
*/
|
|
14
14
|
import { type ReactorPlatform, type ReactorPlugin } from '@datalayer/reactor';
|
|
15
|
-
import type { AppSpec, ComponentSpec,
|
|
15
|
+
import type { AppSpec, ComponentSpec, UISpec } from '../../../types/agentspecs';
|
|
16
16
|
import { LoopCanvasBlock, type CanvasBlockContribution } from '../../core/canvasBlocks';
|
|
17
17
|
/** What is read of a reactor here: its contributions to the point, and who is enabled. */
|
|
18
18
|
type BlocksReader = {
|
|
@@ -20,12 +20,12 @@ type BlocksReader = {
|
|
|
20
20
|
value: CanvasBlockContribution;
|
|
21
21
|
}>;
|
|
22
22
|
};
|
|
23
|
-
/** The name of the Reactor plugin that contributes a UI
|
|
24
|
-
export declare const canvasBlocksPluginName: (
|
|
25
|
-
/** A UI
|
|
26
|
-
export declare function uiPluginBlocks(
|
|
23
|
+
/** The name of the Reactor plugin that contributes a UI's blocks. */
|
|
24
|
+
export declare const canvasBlocksPluginName: (ui: string) => string;
|
|
25
|
+
/** A UI of the catalogue as the Reactor plugin contributing its components as blocks. */
|
|
26
|
+
export declare function uiPluginBlocks(ui: UISpec): ReactorPlugin<Record<string, never>, unknown, unknown>;
|
|
27
27
|
/**
|
|
28
|
-
* The plugins of the catalogue's UI
|
|
28
|
+
* The plugins of the catalogue's UI specs that render components and may
|
|
29
29
|
* be named today (`enabled` in the catalogue).
|
|
30
30
|
*/
|
|
31
31
|
export declare const CANVAS_BLOCK_PLUGINS: ReactorPlugin<Record<string, never>, unknown, unknown>[];
|
|
@@ -35,16 +35,16 @@ export declare const CANVAS_BLOCK_PLUGINS: ReactorPlugin<Record<string, never>,
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function canvasBlocksReactor(disabled?: readonly string[], plugins?: ReactorPlugin<any, any, any>[]): ReactorPlatform;
|
|
37
37
|
/**
|
|
38
|
-
* The palette of an organization: the block plugins of the UI
|
|
38
|
+
* The palette of an organization: the block plugins of the UI specs it has
|
|
39
39
|
* turned off (`plugins_off` in IAM, catalogue ids such as 'a2ui') switched
|
|
40
|
-
* off. A UI
|
|
40
|
+
* off. A UI of the catalogue that contributes no block takes nothing
|
|
41
41
|
* off; an id the catalogue does not have is said by `unknownPluginsOff`.
|
|
42
42
|
*/
|
|
43
43
|
export declare function canvasBlocksReactorOf(pluginsOff: readonly string[]): ReactorPlatform;
|
|
44
|
-
/** The ids an organization turns off that no UI
|
|
44
|
+
/** The ids an organization turns off that no UI of the catalogue has. */
|
|
45
45
|
export declare function unknownPluginsOff(pluginsOff: readonly string[]): string[];
|
|
46
46
|
/**
|
|
47
|
-
* What an application's page uses from a UI
|
|
47
|
+
* What an application's page uses from a UI its organization has
|
|
48
48
|
* turned off, as its setup notes say it (`blockSetupNotes`, on the palette of
|
|
49
49
|
* `canvasBlocksReactorOf`).
|
|
50
50
|
*/
|
|
@@ -55,7 +55,7 @@ export declare function canvasBlocksOf(reactor: BlocksReader): ComponentSpec[];
|
|
|
55
55
|
export declare function componentsUsedBy(app: Pick<AppSpec, 'interface'>): string[];
|
|
56
56
|
/**
|
|
57
57
|
* What an application's page uses that no enabled plugin contributes, as its
|
|
58
|
-
* setup notes say it: one sentence per UI
|
|
58
|
+
* setup notes say it: one sentence per UI of the catalogue whose
|
|
59
59
|
* blocks it uses while its plugin is off. A component the catalogue does not
|
|
60
60
|
* have is not a note but a problem of the instant checks.
|
|
61
61
|
*/
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Distributed under the terms of the Modified BSD License.
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
|
-
* The Canvas's palette as a contribution point (LOOP C-12): each UI
|
|
7
|
-
* the catalogue that renders components (`agentspecs/ui
|
|
6
|
+
* The Canvas's palette as a contribution point (LOOP C-12): each UI of
|
|
7
|
+
* the catalogue that renders components (`agentspecs/ui`, C-13) is a
|
|
8
8
|
* Reactor plugin contributing its components to `loop.canvas.block`. The
|
|
9
9
|
* palette lists what the enabled plugins contribute, and nothing else; a
|
|
10
10
|
* plugin disabled takes its blocks off it, and an application that uses one
|
|
@@ -16,26 +16,26 @@
|
|
|
16
16
|
* @module apps/plugins/canvas-blocks
|
|
17
17
|
*/
|
|
18
18
|
import { buildReactorFromPlugins, contribution, definePlugin, } from '@datalayer/reactor';
|
|
19
|
-
import {
|
|
19
|
+
import { listUI } from '../../../specs/ui';
|
|
20
20
|
import { LoopCanvasBlock, } from '../../core/canvasBlocks';
|
|
21
|
-
/** The name of the Reactor plugin that contributes a UI
|
|
22
|
-
export const canvasBlocksPluginName = (
|
|
23
|
-
/** A UI
|
|
24
|
-
export function uiPluginBlocks(
|
|
21
|
+
/** The name of the Reactor plugin that contributes a UI's blocks. */
|
|
22
|
+
export const canvasBlocksPluginName = (ui) => `@datalayer/loop-plugin-ui-${ui}`;
|
|
23
|
+
/** A UI of the catalogue as the Reactor plugin contributing its components as blocks. */
|
|
24
|
+
export function uiPluginBlocks(ui) {
|
|
25
25
|
return definePlugin({
|
|
26
|
-
name: canvasBlocksPluginName(
|
|
27
|
-
displayName:
|
|
28
|
-
description: `The blocks of ${
|
|
26
|
+
name: canvasBlocksPluginName(ui.id),
|
|
27
|
+
displayName: ui.name,
|
|
28
|
+
description: `The blocks of ${ui.name} on the Canvas: ${ui.components.map(component => component.name).join(', ')}.`,
|
|
29
29
|
octicon: 'apps',
|
|
30
|
-
contributes:
|
|
30
|
+
contributes: ui.components.map(component => contribution(LoopCanvasBlock, { id: component.id, ui: ui.id, component }, { id: component.id })),
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* The plugins of the catalogue's UI
|
|
34
|
+
* The plugins of the catalogue's UI specs that render components and may
|
|
35
35
|
* be named today (`enabled` in the catalogue).
|
|
36
36
|
*/
|
|
37
|
-
export const CANVAS_BLOCK_PLUGINS =
|
|
38
|
-
.filter(
|
|
37
|
+
export const CANVAS_BLOCK_PLUGINS = listUI()
|
|
38
|
+
.filter(ui => ui.enabled && ui.components.length > 0)
|
|
39
39
|
.map(uiPluginBlocks);
|
|
40
40
|
/**
|
|
41
41
|
* A reactor holding the block plugins given, started, with those named in
|
|
@@ -53,9 +53,9 @@ export function canvasBlocksReactor(disabled = [], plugins = CANVAS_BLOCK_PLUGIN
|
|
|
53
53
|
return reactor;
|
|
54
54
|
}
|
|
55
55
|
/**
|
|
56
|
-
* The palette of an organization: the block plugins of the UI
|
|
56
|
+
* The palette of an organization: the block plugins of the UI specs it has
|
|
57
57
|
* turned off (`plugins_off` in IAM, catalogue ids such as 'a2ui') switched
|
|
58
|
-
* off. A UI
|
|
58
|
+
* off. A UI of the catalogue that contributes no block takes nothing
|
|
59
59
|
* off; an id the catalogue does not have is said by `unknownPluginsOff`.
|
|
60
60
|
*/
|
|
61
61
|
export function canvasBlocksReactorOf(pluginsOff) {
|
|
@@ -64,13 +64,13 @@ export function canvasBlocksReactorOf(pluginsOff) {
|
|
|
64
64
|
.map(canvasBlocksPluginName)
|
|
65
65
|
.filter(name => blockPlugins.has(name)));
|
|
66
66
|
}
|
|
67
|
-
/** The ids an organization turns off that no UI
|
|
67
|
+
/** The ids an organization turns off that no UI of the catalogue has. */
|
|
68
68
|
export function unknownPluginsOff(pluginsOff) {
|
|
69
|
-
const known = new Set(
|
|
69
|
+
const known = new Set(listUI().map(ui => ui.id));
|
|
70
70
|
return pluginsOff.filter(id => !known.has(id));
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
|
-
* What an application's page uses from a UI
|
|
73
|
+
* What an application's page uses from a UI its organization has
|
|
74
74
|
* turned off, as its setup notes say it (`blockSetupNotes`, on the palette of
|
|
75
75
|
* `canvasBlocksReactorOf`).
|
|
76
76
|
*/
|
|
@@ -96,7 +96,7 @@ export function componentsUsedBy(app) {
|
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* What an application's page uses that no enabled plugin contributes, as its
|
|
99
|
-
* setup notes say it: one sentence per UI
|
|
99
|
+
* setup notes say it: one sentence per UI of the catalogue whose
|
|
100
100
|
* blocks it uses while its plugin is off. A component the catalogue does not
|
|
101
101
|
* have is not a note but a problem of the instant checks.
|
|
102
102
|
*/
|
|
@@ -107,12 +107,12 @@ export function blockSetupNotes(app, reactor) {
|
|
|
107
107
|
if (contributed.has(name)) {
|
|
108
108
|
continue;
|
|
109
109
|
}
|
|
110
|
-
for (const
|
|
111
|
-
const component =
|
|
110
|
+
for (const ui of listUI()) {
|
|
111
|
+
const component = ui.components.find(each => each.id === name);
|
|
112
112
|
if (component) {
|
|
113
|
-
off.set(
|
|
113
|
+
off.set(ui, [...(off.get(ui) ?? []), component.name]);
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
return [...off.entries()].map(([
|
|
117
|
+
return [...off.entries()].map(([ui, names]) => `The UI “${ui.name}” is not enabled, and its page uses its ${names.length === 1 ? 'block' : 'blocks'} ${names.join(', ')}: ${names.length === 1 ? 'it is' : 'they are'} off the Canvas until it is.`);
|
|
118
118
|
}
|
|
@@ -15,7 +15,7 @@ type PartsReader = {
|
|
|
15
15
|
}>;
|
|
16
16
|
};
|
|
17
17
|
/** The short ids an organization turns off, and the plugin each names. */
|
|
18
|
-
export declare const CANVAS_PART_SOURCES: readonly ["connections", "skills", "models", "rules", "tests", "events"];
|
|
18
|
+
export declare const CANVAS_PART_SOURCES: readonly ["connections", "skills", "models", "rules", "tests", "events", "protocols", "ui", "characters"];
|
|
19
19
|
export type CanvasPartSource = (typeof CANVAS_PART_SOURCES)[number];
|
|
20
20
|
export declare const canvasPartsPluginName: (source: CanvasPartSource) => string;
|
|
21
21
|
/** A connection to each server of the catalogue: read-only, as its owner, every tool. */
|
|
@@ -30,6 +30,12 @@ export declare const RULE_PARTS: CanvasPartContribution[];
|
|
|
30
30
|
export declare const TEST_PARTS: CanvasPartContribution[];
|
|
31
31
|
/** The events an application answers (C-21): on a schedule, on an event, once. */
|
|
32
32
|
export declare const EVENT_PARTS: CanvasPartContribution[];
|
|
33
|
+
/** Each protocol of the catalogue (AGENT_PROTOCOLS PS-04): a planned one offered, not enabled. */
|
|
34
|
+
export declare const PROTOCOL_PARTS: CanvasPartContribution[];
|
|
35
|
+
/** Each UI of the catalogue its answers may render in (AGENT_PROTOCOLS PS-04). */
|
|
36
|
+
export declare const UI_PARTS: CanvasPartContribution[];
|
|
37
|
+
/** Datalayer's characters for its floating assistant, dropped on the agent (AGENT_PROTOCOLS PS-05). */
|
|
38
|
+
export declare const CHARACTER_PARTS: CanvasPartContribution[];
|
|
33
39
|
export declare const CANVAS_PART_PLUGINS: ReactorPlugin<Record<string, never>, unknown, unknown>[];
|
|
34
40
|
/** The toolbox's reactor, its named plugins disabled; a name no plugin has is refused. */
|
|
35
41
|
export declare function canvasPartsReactor(disabled?: readonly string[], plugins?: ReactorPlugin<any, any, any>[]): ReactorPlatform;
|
|
@@ -15,6 +15,9 @@ import { buildReactorFromPlugins, contribution, definePlugin, } from '@datalayer
|
|
|
15
15
|
import { MCP_SERVER_LIBRARY } from '../../../specs/mcpServers';
|
|
16
16
|
import { listChatModels } from '../../../specs/models';
|
|
17
17
|
import { getSkillSpecs } from '../../../specs/skills';
|
|
18
|
+
import { listProtocolSpecs } from '../../../specs/protocols';
|
|
19
|
+
import { listUI } from '../../../specs/ui';
|
|
20
|
+
import { ASSISTANT_CHARACTERS } from '../../../chat/assistant/characters';
|
|
18
21
|
import { LoopCanvasPart, } from '../../core/canvasParts';
|
|
19
22
|
/** The short ids an organization turns off, and the plugin each names. */
|
|
20
23
|
export const CANVAS_PART_SOURCES = [
|
|
@@ -24,6 +27,9 @@ export const CANVAS_PART_SOURCES = [
|
|
|
24
27
|
'rules',
|
|
25
28
|
'tests',
|
|
26
29
|
'events',
|
|
30
|
+
'protocols',
|
|
31
|
+
'ui',
|
|
32
|
+
'characters',
|
|
27
33
|
];
|
|
28
34
|
export const canvasPartsPluginName = (source) => `@datalayer/loop-plugin-parts-${source}`;
|
|
29
35
|
const partsPlugin = (source, displayName, parts) => definePlugin({
|
|
@@ -172,6 +178,33 @@ export const EVENT_PARTS = [
|
|
|
172
178
|
enabled: true,
|
|
173
179
|
},
|
|
174
180
|
];
|
|
181
|
+
/** Each protocol of the catalogue (AGENT_PROTOCOLS PS-04): a planned one offered, not enabled. */
|
|
182
|
+
export const PROTOCOL_PARTS = listProtocolSpecs().map(protocol => ({
|
|
183
|
+
id: `protocol:${protocol.id}`,
|
|
184
|
+
kind: 'protocol',
|
|
185
|
+
label: protocol.name,
|
|
186
|
+
says: protocol.connects,
|
|
187
|
+
example: protocol.id,
|
|
188
|
+
enabled: protocol.status === 'shipped',
|
|
189
|
+
}));
|
|
190
|
+
/** Each UI of the catalogue its answers may render in (AGENT_PROTOCOLS PS-04). */
|
|
191
|
+
export const UI_PARTS = listUI().map(ui => ({
|
|
192
|
+
id: `ui:${ui.id}`,
|
|
193
|
+
kind: 'ui',
|
|
194
|
+
label: ui.name,
|
|
195
|
+
says: ui.description,
|
|
196
|
+
example: ui.id,
|
|
197
|
+
enabled: ui.enabled,
|
|
198
|
+
}));
|
|
199
|
+
/** Datalayer's characters for its floating assistant, dropped on the agent (AGENT_PROTOCOLS PS-05). */
|
|
200
|
+
export const CHARACTER_PARTS = ASSISTANT_CHARACTERS.map(character => ({
|
|
201
|
+
id: `character:${character.id}`,
|
|
202
|
+
kind: 'character',
|
|
203
|
+
label: character.name,
|
|
204
|
+
says: `Its floating assistant shows ${character.name}.`,
|
|
205
|
+
example: character.id,
|
|
206
|
+
enabled: true,
|
|
207
|
+
}));
|
|
175
208
|
export const CANVAS_PART_PLUGINS = [
|
|
176
209
|
partsPlugin('connections', 'Connections', CONNECTION_PARTS),
|
|
177
210
|
partsPlugin('skills', 'Skills', SKILL_PARTS),
|
|
@@ -179,6 +212,9 @@ export const CANVAS_PART_PLUGINS = [
|
|
|
179
212
|
partsPlugin('rules', 'Rules', RULE_PARTS),
|
|
180
213
|
partsPlugin('tests', 'Tests', TEST_PARTS),
|
|
181
214
|
partsPlugin('events', 'Events', EVENT_PARTS),
|
|
215
|
+
partsPlugin('protocols', 'Protocols', PROTOCOL_PARTS),
|
|
216
|
+
partsPlugin('ui', 'UI', UI_PARTS),
|
|
217
|
+
partsPlugin('characters', 'Characters', CHARACTER_PARTS),
|
|
182
218
|
];
|
|
183
219
|
/** The toolbox's reactor, its named plugins disabled; a name no plugin has is refused. */
|
|
184
220
|
export function canvasPartsReactor(disabled = [], plugins = CANVAS_PART_PLUGINS) {
|
|
@@ -6,7 +6,7 @@ import { ScreenFullIcon, ScreenNormalIcon } from '@primer/octicons-react';
|
|
|
6
6
|
import { computed, signal } from '@datalayer/reactor';
|
|
7
7
|
/* A signal to read when the layout publishes no live stance: the hook needs one. */
|
|
8
8
|
const NO_STANCE = signal(undefined);
|
|
9
|
-
import { useContributions, useSignalValue, useGate, useReactorPlatform, ReactorLazy, ReactorSlot, useSlotComponents, } from '@datalayer/reactor/react';
|
|
9
|
+
import { useAgentToolBundles, useContributions, useSignalValue, useGate, useReactorPlatform, ReactorLazy, ReactorSlot, useSlotComponents, } from '@datalayer/reactor/react';
|
|
10
10
|
import { ChatBase } from '../../../chat/base/ChatBase';
|
|
11
11
|
import { useChatAvailability } from '../../../chat/base/ChatAvailability';
|
|
12
12
|
import { offeredModels as offeredModelsFor, readServerCatalogue, readServerDecisions, } from '../../../chat/base/modelChoice';
|
|
@@ -45,7 +45,7 @@ import { AI_MODEL_CATALOGUE, isChatModel } from '../../../specs/models';
|
|
|
45
45
|
import { LoopAgentBlueprint, LoopAgentGate, LoopChatComposer, LoopChatExtras, LoopChatHeader, LoopChatLayout, LoopChatSuggestion, LoopChatSurface, LoopChatTurn, LoopCommand, LoopFrontendTool, LoopRunProps, LoopSlots, agentServerOf, noRuntimeSaid, canOpenView, runForwardedProps, onPromptFocusRequest, onSurfaceRequest, useLoopPromptStore, } from '../../core';
|
|
46
46
|
import { messageText, turnWritersOf } from './turnState';
|
|
47
47
|
import { isInactiveSurfaceContribution, orderToolContributions, toolsForChatView, } from './chatViewTools';
|
|
48
|
-
import { useAgentCommandTools } from '../../../tools/adapters/commands';
|
|
48
|
+
import { agentBundleToolDefinitions, useAgentCommandTools, } from '../../../tools/adapters/commands';
|
|
49
49
|
import { NONE_EDITOR, seedEditorChoice, setEditorOptions, } from '../shell/editorChoice';
|
|
50
50
|
import { generateMessageId } from '../../../types/messages';
|
|
51
51
|
import { openThread, THREAD_WORDS } from '../../apps/threads';
|
|
@@ -982,6 +982,23 @@ export default function ChatView({ workspace }) {
|
|
|
982
982
|
...commandTools.filter(tool => !taken.has(tool.name)),
|
|
983
983
|
];
|
|
984
984
|
}, [notebookTools, commandTools]);
|
|
985
|
+
/*
|
|
986
|
+
* The page's own tools for an agent on a server: a host example's, and
|
|
987
|
+
* the tools of the `AgentTools` bundles its extras name (REACTOR_UI RU-7:
|
|
988
|
+
* the host page's functions, `host_<name>`, each running its command on
|
|
989
|
+
* this reactor). An in-page agent has every bundle already (above).
|
|
990
|
+
*/
|
|
991
|
+
const bundles = useAgentToolBundles();
|
|
992
|
+
const handedBundles = chatExtras.agentToolBundles;
|
|
993
|
+
const pageTools = useMemo(() => {
|
|
994
|
+
const own = chatExtras.frontendTools ?? [];
|
|
995
|
+
if (!handedBundles?.length) {
|
|
996
|
+
return chatExtras.frontendTools;
|
|
997
|
+
}
|
|
998
|
+
const handed = agentBundleToolDefinitions(bundles.filter(bundle => handedBundles.includes(bundle.id)), reactor);
|
|
999
|
+
const taken = new Set(own.map(tool => tool.name));
|
|
1000
|
+
return [...own, ...handed.filter(tool => !taken.has(tool.name))];
|
|
1001
|
+
}, [chatExtras.frontendTools, handedBundles, bundles, reactor]);
|
|
985
1002
|
// The page's sandbox, while the agent turned here runs its code in it.
|
|
986
1003
|
pageSandboxRef.current =
|
|
987
1004
|
inPage && agentTools.some(tool => tool.name === BROWSER_CODE_TOOL)
|
|
@@ -1374,6 +1391,15 @@ export default function ChatView({ workspace }) {
|
|
|
1374
1391
|
? `${agentServerUrl}/api/v1/apps/agents/${encodeURIComponent(agentId)}/ag-ui/`
|
|
1375
1392
|
: `${agentServerUrl}/api/v1/ag-ui/${agentId}/`,
|
|
1376
1393
|
...(runsApp && iamToken ? { authToken: iamToken } : {}),
|
|
1394
|
+
// Its session's ui channel (REACTOR_UI RU-W): what its answers
|
|
1395
|
+
// show, its steps and its elements, beside the run's text.
|
|
1396
|
+
...(runsApp
|
|
1397
|
+
? {
|
|
1398
|
+
uiSocket: `${agentServerUrl.replace(/^http/, 'ws')}/api/v1/apps/ui`,
|
|
1399
|
+
// Its files, uploaded before what names them (RU-6).
|
|
1400
|
+
uiFiles: `${agentServerUrl}/api/v1/apps/agents/${encodeURIComponent(agentId)}/files`,
|
|
1401
|
+
}
|
|
1402
|
+
: {}),
|
|
1377
1403
|
agentId,
|
|
1378
1404
|
// `/api/v1/configure`, not `/api/v1/configure/config`: the hooks
|
|
1379
1405
|
// strip one trailing `config`/`configure` segment to find the API
|
|
@@ -1724,7 +1750,7 @@ export default function ChatView({ workspace }) {
|
|
|
1724
1750
|
embedded application's run carried no tool at all (seen
|
|
1725
1751
|
2026-10-10: `toolsForRequest: []`).
|
|
1726
1752
|
*/
|
|
1727
|
-
frontendTools: inPage ? undefined :
|
|
1753
|
+
frontendTools: inPage ? undefined : pageTools,
|
|
1728
1754
|
/*
|
|
1729
1755
|
The model this view is on, as the chat's opening pick.
|
|
1730
1756
|
|