@arbidocs/blocks 0.5.142 → 0.5.144
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/{ConnectedCallDock-ZNS5BS2R.cjs → ConnectedCallDock-FHKM7MAL.cjs} +28 -28
- package/dist/{ConnectedCallDock-ZNS5BS2R.cjs.map → ConnectedCallDock-FHKM7MAL.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-ACNVSFH7.cjs → ConnectedCallRoom-QNMZJMLB.cjs} +21 -21
- package/dist/{ConnectedCallRoom-ACNVSFH7.cjs.map → ConnectedCallRoom-QNMZJMLB.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-KZIMMOOL.cjs → ConnectedNativeDocxComparison-SWY7327V.cjs} +16 -16
- package/dist/{ConnectedNativeDocxComparison-KZIMMOOL.cjs.map → ConnectedNativeDocxComparison-SWY7327V.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-3JXN6SRT.cjs → ConnectedPresentation-XPMQQ3E2.cjs} +17 -17
- package/dist/{ConnectedPresentation-3JXN6SRT.cjs.map → ConnectedPresentation-XPMQQ3E2.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-EOWZQ6J3.cjs → ConnectedProductionSetDialog-GM5D7IUG.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-EOWZQ6J3.cjs.map → ConnectedProductionSetDialog-GM5D7IUG.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-IECS2MJI.cjs → ConnectedSlidesTab-OOTWJBDV.cjs} +15 -15
- package/dist/{ConnectedSlidesTab-IECS2MJI.cjs.map → ConnectedSlidesTab-OOTWJBDV.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-2FUCYULO.cjs → ConnectedStreamedWordArtifact-TU5GEHEV.cjs} +16 -16
- package/dist/{ConnectedStreamedWordArtifact-2FUCYULO.cjs.map → ConnectedStreamedWordArtifact-TU5GEHEV.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-ENCPTGJE.cjs → DocumentReviewCard-BCWIW7PU.cjs} +15 -15
- package/dist/{DocumentReviewCard-ENCPTGJE.cjs.map → DocumentReviewCard-BCWIW7PU.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-4CVIX3PD.cjs → FilesViewerDialog-UX7LNBJI.cjs} +46 -46
- package/dist/{FilesViewerDialog-4CVIX3PD.cjs.map → FilesViewerDialog-UX7LNBJI.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-2RH33X3U.cjs → WorkspaceTableView-NW3ANGBX.cjs} +8 -8
- package/dist/{WorkspaceTableView-2RH33X3U.cjs.map → WorkspaceTableView-NW3ANGBX.cjs.map} +1 -1
- package/dist/agents/index.cjs +407 -407
- package/dist/agents/workflows/StepParts.js +3 -0
- package/dist/agents/workflows/StepParts.js.map +2 -2
- package/dist/agents/workflows/WorkflowStepAction.d.ts +3 -1
- package/dist/agents/workflows/WorkflowStepAction.js +24 -3
- package/dist/agents/workflows/WorkflowStepAction.js.map +2 -2
- package/dist/agents/workflows/planSteps.js +24 -0
- package/dist/agents/workflows/planSteps.js.map +2 -2
- package/dist/agents/workflows/run.d.ts +1 -1
- package/dist/agents/workflows/run.js +9 -1
- package/dist/agents/workflows/run.js.map +2 -2
- package/dist/agents/workflows/stepKinds.d.ts +2 -1
- package/dist/agents/workflows/stepKinds.js +7 -4
- package/dist/agents/workflows/stepKinds.js.map +2 -2
- package/dist/agents/workflows/types.d.ts +22 -1
- package/dist/agents/workflows/types.js.map +1 -1
- package/dist/agents/workflows/useWorkflowView.js +13 -2
- package/dist/agents/workflows/useWorkflowView.js.map +3 -3
- package/dist/{ai-QEXZ4SYR.cjs → ai-T2BDBHI3.cjs} +31 -31
- package/dist/ai-T2BDBHI3.cjs.map +1 -0
- package/dist/calls/index.cjs +121 -121
- package/dist/chat/index.cjs +59 -59
- package/dist/{chunk-6CGMSJLB.cjs → chunk-2Q32RXY2.cjs} +16 -16
- package/dist/{chunk-6CGMSJLB.cjs.map → chunk-2Q32RXY2.cjs.map} +1 -1
- package/dist/{chunk-DGAGSP5G.cjs → chunk-2V5HW6T5.cjs} +6 -6
- package/dist/{chunk-DGAGSP5G.cjs.map → chunk-2V5HW6T5.cjs.map} +1 -1
- package/dist/{chunk-F6CEPWIF.cjs → chunk-5RMVFFVW.cjs} +7 -7
- package/dist/{chunk-F6CEPWIF.cjs.map → chunk-5RMVFFVW.cjs.map} +1 -1
- package/dist/{chunk-MSJGEZHL.cjs → chunk-6RJXO2NF.cjs} +6 -6
- package/dist/{chunk-MSJGEZHL.cjs.map → chunk-6RJXO2NF.cjs.map} +1 -1
- package/dist/{chunk-OOHBXCDV.cjs → chunk-6TU4YLFW.cjs} +18 -18
- package/dist/{chunk-OOHBXCDV.cjs.map → chunk-6TU4YLFW.cjs.map} +1 -1
- package/dist/{chunk-5A6T4W46.cjs → chunk-7D4WXUBS.cjs} +7 -7
- package/dist/{chunk-5A6T4W46.cjs.map → chunk-7D4WXUBS.cjs.map} +1 -1
- package/dist/{chunk-VCDD763Y.cjs → chunk-7HU2NQVO.cjs} +3 -3
- package/dist/{chunk-VCDD763Y.cjs.map → chunk-7HU2NQVO.cjs.map} +1 -1
- package/dist/{chunk-56Z6CQC6.cjs → chunk-7KEB3VZ5.cjs} +4 -4
- package/dist/{chunk-56Z6CQC6.cjs.map → chunk-7KEB3VZ5.cjs.map} +1 -1
- package/dist/{chunk-NRRX3TYV.cjs → chunk-AJTHOVCM.cjs} +64 -64
- package/dist/{chunk-NRRX3TYV.cjs.map → chunk-AJTHOVCM.cjs.map} +1 -1
- package/dist/{chunk-R7VF2UFA.cjs → chunk-ANFDJIJP.cjs} +4 -4
- package/dist/{chunk-R7VF2UFA.cjs.map → chunk-ANFDJIJP.cjs.map} +1 -1
- package/dist/{chunk-PIYYBPHH.cjs → chunk-BCRB42SP.cjs} +56 -5
- package/dist/chunk-BCRB42SP.cjs.map +1 -0
- package/dist/{chunk-RSQGDXAF.cjs → chunk-BSZ45U3F.cjs} +12 -12
- package/dist/{chunk-RSQGDXAF.cjs.map → chunk-BSZ45U3F.cjs.map} +1 -1
- package/dist/{chunk-KP7BQIZL.cjs → chunk-BT2QTDZ4.cjs} +35 -35
- package/dist/{chunk-KP7BQIZL.cjs.map → chunk-BT2QTDZ4.cjs.map} +1 -1
- package/dist/{chunk-X46QYO4S.cjs → chunk-BXLY2UQM.cjs} +9 -9
- package/dist/{chunk-X46QYO4S.cjs.map → chunk-BXLY2UQM.cjs.map} +1 -1
- package/dist/{chunk-QW6NCUR7.cjs → chunk-DH5NOQCU.cjs} +5 -5
- package/dist/{chunk-QW6NCUR7.cjs.map → chunk-DH5NOQCU.cjs.map} +1 -1
- package/dist/{chunk-IFJBE7M5.cjs → chunk-EY23TOPI.cjs} +11 -11
- package/dist/{chunk-IFJBE7M5.cjs.map → chunk-EY23TOPI.cjs.map} +1 -1
- package/dist/{chunk-TOYKBRAU.cjs → chunk-F47B75LV.cjs} +27 -27
- package/dist/{chunk-TOYKBRAU.cjs.map → chunk-F47B75LV.cjs.map} +1 -1
- package/dist/{chunk-UWTCK5IN.cjs → chunk-F7IBUDD5.cjs} +8 -8
- package/dist/{chunk-UWTCK5IN.cjs.map → chunk-F7IBUDD5.cjs.map} +1 -1
- package/dist/{chunk-R5NTEW4L.cjs → chunk-FM46VQ5D.cjs} +149 -114
- package/dist/chunk-FM46VQ5D.cjs.map +1 -0
- package/dist/{chunk-QFXOTJ6G.cjs → chunk-FWD4WSGR.cjs} +38 -14
- package/dist/chunk-FWD4WSGR.cjs.map +1 -0
- package/dist/{chunk-33GOYI3O.cjs → chunk-FYNNNQ6H.cjs} +4 -4
- package/dist/{chunk-33GOYI3O.cjs.map → chunk-FYNNNQ6H.cjs.map} +1 -1
- package/dist/{chunk-VF26CUE3.cjs → chunk-HG72AVXX.cjs} +3 -3
- package/dist/{chunk-VF26CUE3.cjs.map → chunk-HG72AVXX.cjs.map} +1 -1
- package/dist/{chunk-EQTZQD66.cjs → chunk-I2LJ7RZ2.cjs} +17 -9
- package/dist/chunk-I2LJ7RZ2.cjs.map +1 -0
- package/dist/{chunk-ACDMGTHX.cjs → chunk-JDQIZFDO.cjs} +7 -7
- package/dist/{chunk-ACDMGTHX.cjs.map → chunk-JDQIZFDO.cjs.map} +1 -1
- package/dist/{chunk-ZTHYJP4G.cjs → chunk-JXSSR6T3.cjs} +10 -10
- package/dist/{chunk-ZTHYJP4G.cjs.map → chunk-JXSSR6T3.cjs.map} +1 -1
- package/dist/{chunk-MBXXWTKT.cjs → chunk-JXZM5ODS.cjs} +28 -28
- package/dist/{chunk-MBXXWTKT.cjs.map → chunk-JXZM5ODS.cjs.map} +1 -1
- package/dist/{chunk-VL7ZX4KQ.cjs → chunk-KMOIE2XH.cjs} +12 -9
- package/dist/chunk-KMOIE2XH.cjs.map +1 -0
- package/dist/{chunk-UD56Y6UA.cjs → chunk-LYDPVFNS.cjs} +4 -4
- package/dist/{chunk-UD56Y6UA.cjs.map → chunk-LYDPVFNS.cjs.map} +1 -1
- package/dist/{chunk-ECSOXKJQ.cjs → chunk-N5UI363Q.cjs} +3 -3
- package/dist/{chunk-ECSOXKJQ.cjs.map → chunk-N5UI363Q.cjs.map} +1 -1
- package/dist/{chunk-ZPIZINH2.cjs → chunk-N7B5OAI5.cjs} +4 -4
- package/dist/{chunk-ZPIZINH2.cjs.map → chunk-N7B5OAI5.cjs.map} +1 -1
- package/dist/{chunk-MEYQLQWS.cjs → chunk-NM2WDBXH.cjs} +17 -17
- package/dist/{chunk-MEYQLQWS.cjs.map → chunk-NM2WDBXH.cjs.map} +1 -1
- package/dist/{chunk-N3H3YAKY.cjs → chunk-PQQA34ZR.cjs} +4 -4
- package/dist/{chunk-N3H3YAKY.cjs.map → chunk-PQQA34ZR.cjs.map} +1 -1
- package/dist/{chunk-OOW7H2YD.cjs → chunk-PWGHCEJK.cjs} +6 -6
- package/dist/{chunk-OOW7H2YD.cjs.map → chunk-PWGHCEJK.cjs.map} +1 -1
- package/dist/{chunk-UVP5RJWA.cjs → chunk-Q67V6O4R.cjs} +110 -110
- package/dist/{chunk-UVP5RJWA.cjs.map → chunk-Q67V6O4R.cjs.map} +1 -1
- package/dist/{chunk-EYXU32D7.cjs → chunk-Q77OKXYM.cjs} +6 -6
- package/dist/{chunk-EYXU32D7.cjs.map → chunk-Q77OKXYM.cjs.map} +1 -1
- package/dist/{chunk-U6XMZG6G.cjs → chunk-RDBUQCAS.cjs} +3 -3
- package/dist/{chunk-U6XMZG6G.cjs.map → chunk-RDBUQCAS.cjs.map} +1 -1
- package/dist/{chunk-JJZOL5MG.cjs → chunk-RYVZDFVO.cjs} +3 -3
- package/dist/{chunk-JJZOL5MG.cjs.map → chunk-RYVZDFVO.cjs.map} +1 -1
- package/dist/{chunk-GG7QKDV5.cjs → chunk-SDSK7RWP.cjs} +11 -11
- package/dist/{chunk-GG7QKDV5.cjs.map → chunk-SDSK7RWP.cjs.map} +1 -1
- package/dist/{chunk-ORQXGMCC.cjs → chunk-SJTLHWFC.cjs} +18 -18
- package/dist/{chunk-ORQXGMCC.cjs.map → chunk-SJTLHWFC.cjs.map} +1 -1
- package/dist/{chunk-SK6LFIU2.cjs → chunk-TIBTTITZ.cjs} +3 -3
- package/dist/{chunk-SK6LFIU2.cjs.map → chunk-TIBTTITZ.cjs.map} +1 -1
- package/dist/{chunk-JN5YMHGI.cjs → chunk-XPQR2PJX.cjs} +2 -2
- package/dist/chunk-XPQR2PJX.cjs.map +1 -0
- package/dist/{chunk-LFMOQALU.cjs → chunk-YQRACWAS.cjs} +54 -54
- package/dist/{chunk-LFMOQALU.cjs.map → chunk-YQRACWAS.cjs.map} +1 -1
- package/dist/{chunk-VZUXTF3U.cjs → chunk-ZCSX5SMV.cjs} +88 -83
- package/dist/chunk-ZCSX5SMV.cjs.map +1 -0
- package/dist/{chunk-TXBXIUTX.cjs → chunk-ZJS2BM7D.cjs} +6 -6
- package/dist/{chunk-TXBXIUTX.cjs.map → chunk-ZJS2BM7D.cjs.map} +1 -1
- package/dist/connect/docx.cjs +19 -19
- package/dist/connect/index.cjs +1095 -1048
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +33 -33
- package/dist/connection/ConnectedWorkflowBuilder.js +8 -0
- package/dist/connection/ConnectedWorkflowBuilder.js.map +2 -2
- package/dist/connection/billing/StripeCheckoutModal.js +1 -1
- package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
- package/dist/connection/databases/ConnectedDatabasesPage.js +50 -8
- package/dist/connection/databases/ConnectedDatabasesPage.js.map +2 -2
- package/dist/connection/notification-center/useOpenNotificationTarget.d.ts +2 -0
- package/dist/connection/notification-center/useOpenNotificationTarget.js +11 -2
- package/dist/connection/notification-center/useOpenNotificationTarget.js.map +2 -2
- package/dist/connection/tasks/ConnectedThreadTaskBar.js +9 -2
- package/dist/connection/tasks/ConnectedThreadTaskBar.js.map +2 -2
- package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +2 -2
- package/dist/dashboards/index.cjs +1 -1
- package/dist/databases/DatabaseColumnDialog.d.ts +13 -0
- package/dist/databases/DatabaseColumnDialog.js +38 -1
- package/dist/databases/DatabaseColumnDialog.js.map +2 -2
- package/dist/databases/DatabaseRowDetail.d.ts +6 -1
- package/dist/databases/DatabaseRowDetail.js +15 -1
- package/dist/databases/DatabaseRowDetail.js.map +2 -2
- package/dist/databases/column-types.d.ts +14 -0
- package/dist/databases/column-types.js.map +2 -2
- package/dist/databases/databaseColumns.js +1 -1
- package/dist/databases/databaseColumns.js.map +2 -2
- package/dist/databases/index.cjs +48 -48
- package/dist/embed/index.cjs +40 -40
- package/dist/files/index.cjs +224 -224
- package/dist/index.cjs +1727 -1727
- package/dist/office/index.cjs +5 -5
- package/dist/settings/index.cjs +146 -146
- package/dist/shell/index.cjs +87 -87
- package/dist/studio/index.cjs +29 -29
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/StepActionSettings.d.ts +25 -1
- package/dist/workflow-canvas/StepActionSettings.js +113 -1
- package/dist/workflow-canvas/StepActionSettings.js.map +2 -2
- package/dist/workflow-canvas/StepInspector.d.ts +5 -3
- package/dist/workflow-canvas/StepInspector.js +14 -1
- package/dist/workflow-canvas/StepInspector.js.map +2 -2
- package/dist/workflow-canvas/WorkflowBuilder.d.ts +4 -2
- package/dist/workflow-canvas/WorkflowBuilder.js +8 -2
- package/dist/workflow-canvas/WorkflowBuilder.js.map +2 -2
- package/dist/workflow-canvas/WorkflowCanvas.d.ts +4 -0
- package/dist/workflow-canvas/WorkflowCanvas.js +5 -1
- package/dist/workflow-canvas/WorkflowCanvas.js.map +2 -2
- package/dist/workflow-canvas/edit.js +19 -1
- package/dist/workflow-canvas/edit.js.map +2 -2
- package/dist/workflow-canvas/index.cjs +256 -100
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/blocks.css +3 -0
- package/dist/ai-QEXZ4SYR.cjs.map +0 -1
- package/dist/chunk-EQTZQD66.cjs.map +0 -1
- package/dist/chunk-JN5YMHGI.cjs.map +0 -1
- package/dist/chunk-PIYYBPHH.cjs.map +0 -1
- package/dist/chunk-QFXOTJ6G.cjs.map +0 -1
- package/dist/chunk-R5NTEW4L.cjs.map +0 -1
- package/dist/chunk-VL7ZX4KQ.cjs.map +0 -1
- package/dist/chunk-VZUXTF3U.cjs.map +0 -1
package/dist/chat/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk6RJXO2NF_cjs = require('../chunk-6RJXO2NF.cjs');
|
|
5
5
|
var chunkKLMNCBLY_cjs = require('../chunk-KLMNCBLY.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk2V5HW6T5_cjs = require('../chunk-2V5HW6T5.cjs');
|
|
7
7
|
var chunkXZMYSDU4_cjs = require('../chunk-XZMYSDU4.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk6TU4YLFW_cjs = require('../chunk-6TU4YLFW.cjs');
|
|
9
9
|
var chunkJHDCDEXY_cjs = require('../chunk-JHDCDEXY.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunk5RMVFFVW_cjs = require('../chunk-5RMVFFVW.cjs');
|
|
11
11
|
var chunk5F4DCIHS_cjs = require('../chunk-5F4DCIHS.cjs');
|
|
12
12
|
require('../chunk-CT3SLXB7.cjs');
|
|
13
13
|
require('../chunk-DEXUL3T6.cjs');
|
|
@@ -19,25 +19,25 @@ require('../chunk-MCXS6X37.cjs');
|
|
|
19
19
|
require('../chunk-KQF7POTG.cjs');
|
|
20
20
|
var chunk75BNMCUX_cjs = require('../chunk-75BNMCUX.cjs');
|
|
21
21
|
require('../chunk-IN6ILI5A.cjs');
|
|
22
|
-
require('../chunk-
|
|
22
|
+
require('../chunk-KMOIE2XH.cjs');
|
|
23
23
|
require('../chunk-FX3K6LNZ.cjs');
|
|
24
|
-
require('../chunk-
|
|
25
|
-
require('../chunk-
|
|
24
|
+
require('../chunk-I2LJ7RZ2.cjs');
|
|
25
|
+
require('../chunk-XPQR2PJX.cjs');
|
|
26
26
|
require('../chunk-UDSHVNU3.cjs');
|
|
27
27
|
require('../chunk-IPSHAMO2.cjs');
|
|
28
28
|
var chunkZBP4ZSAJ_cjs = require('../chunk-ZBP4ZSAJ.cjs');
|
|
29
29
|
require('../chunk-PPCATBOY.cjs');
|
|
30
|
+
require('../chunk-LJJJ6CYH.cjs');
|
|
30
31
|
require('../chunk-LIKDQBNJ.cjs');
|
|
31
32
|
require('../chunk-YZBDHBKI.cjs');
|
|
32
33
|
require('../chunk-CVPV4I7Z.cjs');
|
|
33
|
-
require('../chunk-LJJJ6CYH.cjs');
|
|
34
34
|
require('../chunk-PLIF5CUV.cjs');
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
Object.defineProperty(exports, "AssistantToaster", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunk6RJXO2NF_cjs.AssistantToaster; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "ComposerAccessories", {
|
|
43
43
|
enumerable: true,
|
|
@@ -181,15 +181,15 @@ Object.defineProperty(exports, "useDismissibleCard", {
|
|
|
181
181
|
});
|
|
182
182
|
Object.defineProperty(exports, "AssistantDock", {
|
|
183
183
|
enumerable: true,
|
|
184
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunk2V5HW6T5_cjs.AssistantDock; }
|
|
185
185
|
});
|
|
186
186
|
Object.defineProperty(exports, "AssistantDockToggle", {
|
|
187
187
|
enumerable: true,
|
|
188
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunk2V5HW6T5_cjs.AssistantDockToggle; }
|
|
189
189
|
});
|
|
190
190
|
Object.defineProperty(exports, "useAssistantDock", {
|
|
191
191
|
enumerable: true,
|
|
192
|
-
get: function () { return
|
|
192
|
+
get: function () { return chunk2V5HW6T5_cjs.useAssistantDock; }
|
|
193
193
|
});
|
|
194
194
|
Object.defineProperty(exports, "useOpenCitation", {
|
|
195
195
|
enumerable: true,
|
|
@@ -197,75 +197,75 @@ Object.defineProperty(exports, "useOpenCitation", {
|
|
|
197
197
|
});
|
|
198
198
|
Object.defineProperty(exports, "AssistantModeToggle", {
|
|
199
199
|
enumerable: true,
|
|
200
|
-
get: function () { return
|
|
200
|
+
get: function () { return chunk6TU4YLFW_cjs.AssistantModeToggle; }
|
|
201
201
|
});
|
|
202
202
|
Object.defineProperty(exports, "ChatDocuments", {
|
|
203
203
|
enumerable: true,
|
|
204
|
-
get: function () { return
|
|
204
|
+
get: function () { return chunk6TU4YLFW_cjs.ChatDocuments; }
|
|
205
205
|
});
|
|
206
206
|
Object.defineProperty(exports, "ChatMessageContent", {
|
|
207
207
|
enumerable: true,
|
|
208
|
-
get: function () { return
|
|
208
|
+
get: function () { return chunk6TU4YLFW_cjs.ChatMessageContent; }
|
|
209
209
|
});
|
|
210
210
|
Object.defineProperty(exports, "ChatPage", {
|
|
211
211
|
enumerable: true,
|
|
212
|
-
get: function () { return
|
|
212
|
+
get: function () { return chunk6TU4YLFW_cjs.ChatPage; }
|
|
213
213
|
});
|
|
214
214
|
Object.defineProperty(exports, "ChatThreadList", {
|
|
215
215
|
enumerable: true,
|
|
216
|
-
get: function () { return
|
|
216
|
+
get: function () { return chunk6TU4YLFW_cjs.ChatThreadList; }
|
|
217
217
|
});
|
|
218
218
|
Object.defineProperty(exports, "ChatThreadSelect", {
|
|
219
219
|
enumerable: true,
|
|
220
|
-
get: function () { return
|
|
220
|
+
get: function () { return chunk6TU4YLFW_cjs.ChatThreadSelect; }
|
|
221
221
|
});
|
|
222
222
|
Object.defineProperty(exports, "CitationMark", {
|
|
223
223
|
enumerable: true,
|
|
224
|
-
get: function () { return
|
|
224
|
+
get: function () { return chunk6TU4YLFW_cjs.CitationMark; }
|
|
225
225
|
});
|
|
226
226
|
Object.defineProperty(exports, "ContextChip", {
|
|
227
227
|
enumerable: true,
|
|
228
|
-
get: function () { return
|
|
228
|
+
get: function () { return chunk6TU4YLFW_cjs.ContextChip; }
|
|
229
229
|
});
|
|
230
230
|
Object.defineProperty(exports, "ConversationEmpty", {
|
|
231
231
|
enumerable: true,
|
|
232
|
-
get: function () { return
|
|
232
|
+
get: function () { return chunk6TU4YLFW_cjs.ConversationEmpty; }
|
|
233
233
|
});
|
|
234
234
|
Object.defineProperty(exports, "DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS", {
|
|
235
235
|
enumerable: true,
|
|
236
|
-
get: function () { return
|
|
236
|
+
get: function () { return chunk6TU4YLFW_cjs.DEFAULT_ASSISTANT_MODE_TOGGLE_LABELS; }
|
|
237
237
|
});
|
|
238
238
|
Object.defineProperty(exports, "DEFAULT_CHAT_PAGE_LABELS", {
|
|
239
239
|
enumerable: true,
|
|
240
|
-
get: function () { return
|
|
240
|
+
get: function () { return chunk6TU4YLFW_cjs.DEFAULT_CHAT_PAGE_LABELS; }
|
|
241
241
|
});
|
|
242
242
|
Object.defineProperty(exports, "DEFAULT_CONVERSATION_EMPTY_LABELS", {
|
|
243
243
|
enumerable: true,
|
|
244
|
-
get: function () { return
|
|
244
|
+
get: function () { return chunk6TU4YLFW_cjs.DEFAULT_CONVERSATION_EMPTY_LABELS; }
|
|
245
245
|
});
|
|
246
246
|
Object.defineProperty(exports, "DEFAULT_MESSAGE_ALERT_LABELS", {
|
|
247
247
|
enumerable: true,
|
|
248
|
-
get: function () { return
|
|
248
|
+
get: function () { return chunk6TU4YLFW_cjs.DEFAULT_MESSAGE_ALERT_LABELS; }
|
|
249
249
|
});
|
|
250
250
|
Object.defineProperty(exports, "MessageAlert", {
|
|
251
251
|
enumerable: true,
|
|
252
|
-
get: function () { return
|
|
252
|
+
get: function () { return chunk6TU4YLFW_cjs.MessageAlert; }
|
|
253
253
|
});
|
|
254
254
|
Object.defineProperty(exports, "useChatSurface", {
|
|
255
255
|
enumerable: true,
|
|
256
|
-
get: function () { return
|
|
256
|
+
get: function () { return chunk6TU4YLFW_cjs.useChatSurface; }
|
|
257
257
|
});
|
|
258
258
|
Object.defineProperty(exports, "useControlledThread", {
|
|
259
259
|
enumerable: true,
|
|
260
|
-
get: function () { return
|
|
260
|
+
get: function () { return chunk6TU4YLFW_cjs.useControlledThread; }
|
|
261
261
|
});
|
|
262
262
|
Object.defineProperty(exports, "useRegisterEmbeddedChat", {
|
|
263
263
|
enumerable: true,
|
|
264
|
-
get: function () { return
|
|
264
|
+
get: function () { return chunk6TU4YLFW_cjs.useRegisterEmbeddedChat; }
|
|
265
265
|
});
|
|
266
266
|
Object.defineProperty(exports, "useStartRequestedConversation", {
|
|
267
267
|
enumerable: true,
|
|
268
|
-
get: function () { return
|
|
268
|
+
get: function () { return chunk6TU4YLFW_cjs.useStartRequestedConversation; }
|
|
269
269
|
});
|
|
270
270
|
Object.defineProperty(exports, "BranchControls", {
|
|
271
271
|
enumerable: true,
|
|
@@ -417,119 +417,119 @@ Object.defineProperty(exports, "useRecipientDraft", {
|
|
|
417
417
|
});
|
|
418
418
|
Object.defineProperty(exports, "Composer", {
|
|
419
419
|
enumerable: true,
|
|
420
|
-
get: function () { return
|
|
420
|
+
get: function () { return chunk5RMVFFVW_cjs.Composer; }
|
|
421
421
|
});
|
|
422
422
|
Object.defineProperty(exports, "ComposerContainer", {
|
|
423
423
|
enumerable: true,
|
|
424
|
-
get: function () { return
|
|
424
|
+
get: function () { return chunk5RMVFFVW_cjs.ComposerContainer; }
|
|
425
425
|
});
|
|
426
426
|
Object.defineProperty(exports, "ComposerDock", {
|
|
427
427
|
enumerable: true,
|
|
428
|
-
get: function () { return
|
|
428
|
+
get: function () { return chunk5RMVFFVW_cjs.ComposerDock; }
|
|
429
429
|
});
|
|
430
430
|
Object.defineProperty(exports, "ComposerSend", {
|
|
431
431
|
enumerable: true,
|
|
432
|
-
get: function () { return
|
|
432
|
+
get: function () { return chunk5RMVFFVW_cjs.ComposerSend; }
|
|
433
433
|
});
|
|
434
434
|
Object.defineProperty(exports, "ComposerVoiceButton", {
|
|
435
435
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
436
|
+
get: function () { return chunk5RMVFFVW_cjs.ComposerVoiceButton; }
|
|
437
437
|
});
|
|
438
438
|
Object.defineProperty(exports, "DEFAULT_COMPOSER_LABELS", {
|
|
439
439
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
440
|
+
get: function () { return chunk5RMVFFVW_cjs.DEFAULT_COMPOSER_LABELS; }
|
|
441
441
|
});
|
|
442
442
|
Object.defineProperty(exports, "DEFAULT_MESSAGE_LABELS", {
|
|
443
443
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
444
|
+
get: function () { return chunk5RMVFFVW_cjs.DEFAULT_MESSAGE_LABELS; }
|
|
445
445
|
});
|
|
446
446
|
Object.defineProperty(exports, "DEFAULT_MESSAGE_LIST_LABELS", {
|
|
447
447
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
448
|
+
get: function () { return chunk5RMVFFVW_cjs.DEFAULT_MESSAGE_LIST_LABELS; }
|
|
449
449
|
});
|
|
450
450
|
Object.defineProperty(exports, "DEFAULT_WORKFLOW_STEP_CHIP_LABELS", {
|
|
451
451
|
enumerable: true,
|
|
452
|
-
get: function () { return
|
|
452
|
+
get: function () { return chunk5RMVFFVW_cjs.DEFAULT_WORKFLOW_STEP_CHIP_LABELS; }
|
|
453
453
|
});
|
|
454
454
|
Object.defineProperty(exports, "Message", {
|
|
455
455
|
enumerable: true,
|
|
456
|
-
get: function () { return
|
|
456
|
+
get: function () { return chunk5RMVFFVW_cjs.Message; }
|
|
457
457
|
});
|
|
458
458
|
Object.defineProperty(exports, "MessageActionButton", {
|
|
459
459
|
enumerable: true,
|
|
460
|
-
get: function () { return
|
|
460
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageActionButton; }
|
|
461
461
|
});
|
|
462
462
|
Object.defineProperty(exports, "MessageActionMenu", {
|
|
463
463
|
enumerable: true,
|
|
464
|
-
get: function () { return
|
|
464
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageActionMenu; }
|
|
465
465
|
});
|
|
466
466
|
Object.defineProperty(exports, "MessageAuthor", {
|
|
467
467
|
enumerable: true,
|
|
468
|
-
get: function () { return
|
|
468
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageAuthor; }
|
|
469
469
|
});
|
|
470
470
|
Object.defineProperty(exports, "MessageBody", {
|
|
471
471
|
enumerable: true,
|
|
472
|
-
get: function () { return
|
|
472
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageBody; }
|
|
473
473
|
});
|
|
474
474
|
Object.defineProperty(exports, "MessageBubble", {
|
|
475
475
|
enumerable: true,
|
|
476
|
-
get: function () { return
|
|
476
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageBubble; }
|
|
477
477
|
});
|
|
478
478
|
Object.defineProperty(exports, "MessageByline", {
|
|
479
479
|
enumerable: true,
|
|
480
|
-
get: function () { return
|
|
480
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageByline; }
|
|
481
481
|
});
|
|
482
482
|
Object.defineProperty(exports, "MessageContent", {
|
|
483
483
|
enumerable: true,
|
|
484
|
-
get: function () { return
|
|
484
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageContent; }
|
|
485
485
|
});
|
|
486
486
|
Object.defineProperty(exports, "MessageFooter", {
|
|
487
487
|
enumerable: true,
|
|
488
|
-
get: function () { return
|
|
488
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageFooter; }
|
|
489
489
|
});
|
|
490
490
|
Object.defineProperty(exports, "MessageList", {
|
|
491
491
|
enumerable: true,
|
|
492
|
-
get: function () { return
|
|
492
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageList; }
|
|
493
493
|
});
|
|
494
494
|
Object.defineProperty(exports, "MessageListEmpty", {
|
|
495
495
|
enumerable: true,
|
|
496
|
-
get: function () { return
|
|
496
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageListEmpty; }
|
|
497
497
|
});
|
|
498
498
|
Object.defineProperty(exports, "MessageListRoot", {
|
|
499
499
|
enumerable: true,
|
|
500
|
-
get: function () { return
|
|
500
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageListRoot; }
|
|
501
501
|
});
|
|
502
502
|
Object.defineProperty(exports, "MessageNarration", {
|
|
503
503
|
enumerable: true,
|
|
504
|
-
get: function () { return
|
|
504
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageNarration; }
|
|
505
505
|
});
|
|
506
506
|
Object.defineProperty(exports, "MessageRoot", {
|
|
507
507
|
enumerable: true,
|
|
508
|
-
get: function () { return
|
|
508
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageRoot; }
|
|
509
509
|
});
|
|
510
510
|
Object.defineProperty(exports, "MessageSubagentBadge", {
|
|
511
511
|
enumerable: true,
|
|
512
|
-
get: function () { return
|
|
512
|
+
get: function () { return chunk5RMVFFVW_cjs.MessageSubagentBadge; }
|
|
513
513
|
});
|
|
514
514
|
Object.defineProperty(exports, "ScrollToBottom", {
|
|
515
515
|
enumerable: true,
|
|
516
|
-
get: function () { return
|
|
516
|
+
get: function () { return chunk5RMVFFVW_cjs.ScrollToBottom; }
|
|
517
517
|
});
|
|
518
518
|
Object.defineProperty(exports, "WorkflowStepChip", {
|
|
519
519
|
enumerable: true,
|
|
520
|
-
get: function () { return
|
|
520
|
+
get: function () { return chunk5RMVFFVW_cjs.WorkflowStepChip; }
|
|
521
521
|
});
|
|
522
522
|
Object.defineProperty(exports, "toSpeakableText", {
|
|
523
523
|
enumerable: true,
|
|
524
|
-
get: function () { return
|
|
524
|
+
get: function () { return chunk5RMVFFVW_cjs.toSpeakableText; }
|
|
525
525
|
});
|
|
526
526
|
Object.defineProperty(exports, "useMentionAutocomplete", {
|
|
527
527
|
enumerable: true,
|
|
528
|
-
get: function () { return
|
|
528
|
+
get: function () { return chunk5RMVFFVW_cjs.useMentionAutocomplete; }
|
|
529
529
|
});
|
|
530
530
|
Object.defineProperty(exports, "useStreamAnnouncement", {
|
|
531
531
|
enumerable: true,
|
|
532
|
-
get: function () { return
|
|
532
|
+
get: function () { return chunk5RMVFFVW_cjs.useStreamAnnouncement; }
|
|
533
533
|
});
|
|
534
534
|
Object.defineProperty(exports, "DEFAULT_SLASH_MENU_LABELS", {
|
|
535
535
|
enumerable: true,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk7D4WXUBS_cjs = require('./chunk-7D4WXUBS.cjs');
|
|
5
|
+
var chunkXPQR2PJX_cjs = require('./chunk-XPQR2PJX.cjs');
|
|
5
6
|
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
6
|
-
var chunkJN5YMHGI_cjs = require('./chunk-JN5YMHGI.cjs');
|
|
7
7
|
var chunkLIKDQBNJ_cjs = require('./chunk-LIKDQBNJ.cjs');
|
|
8
8
|
var react = require('@arbidocs/react');
|
|
9
9
|
var ui = require('@arbidocs/react/ui');
|
|
@@ -34,7 +34,7 @@ function useWorkflowTasks() {
|
|
|
34
34
|
);
|
|
35
35
|
const create = react$1.useCallback(
|
|
36
36
|
async (ctx, forceWorkflow = false) => {
|
|
37
|
-
const request =
|
|
37
|
+
const request = chunk7D4WXUBS_cjs.taskComposerToCreateRequest(
|
|
38
38
|
{ ...ctx, documentTitles, plan: ctx.plan ?? null },
|
|
39
39
|
activeWorkspaceId ?? void 0,
|
|
40
40
|
forceWorkflow
|
|
@@ -76,7 +76,7 @@ function useWorkflowTasks() {
|
|
|
76
76
|
);
|
|
77
77
|
const update = react$1.useCallback(
|
|
78
78
|
async (task, ctx) => {
|
|
79
|
-
const patch =
|
|
79
|
+
const patch = chunk7D4WXUBS_cjs.taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null });
|
|
80
80
|
if (task.is_owner === false) delete patch.shared;
|
|
81
81
|
await updateConversation.mutateAsync({ conversationId: task.external_id, patch });
|
|
82
82
|
},
|
|
@@ -84,7 +84,7 @@ function useWorkflowTasks() {
|
|
|
84
84
|
);
|
|
85
85
|
const updateWorkflow = react$1.useCallback(
|
|
86
86
|
async (workflow, ctx) => {
|
|
87
|
-
const patch =
|
|
87
|
+
const patch = chunk7D4WXUBS_cjs.composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null });
|
|
88
88
|
if (workflow.is_owner === false) delete patch.shared;
|
|
89
89
|
const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId;
|
|
90
90
|
const updated = await updateWorkflowMutation.mutateAsync({
|
|
@@ -123,7 +123,7 @@ var DEFAULT_PACK_LABEL = "Skills from this site";
|
|
|
123
123
|
var NO_PACKS = [];
|
|
124
124
|
function useHostSkills() {
|
|
125
125
|
const packs = chunk3YZKDCWY_cjs.useHost().workflows?.skillPacks;
|
|
126
|
-
return react$1.useMemo(() => packs?.length ? packs.flatMap(
|
|
126
|
+
return react$1.useMemo(() => packs?.length ? packs.flatMap(chunk7D4WXUBS_cjs.skillPackWorkflows) : NO_PACKS, [packs]);
|
|
127
127
|
}
|
|
128
128
|
function hostSkillItem(workflow) {
|
|
129
129
|
const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL;
|
|
@@ -136,7 +136,7 @@ function hostSkillItem(workflow) {
|
|
|
136
136
|
}
|
|
137
137
|
function useNamedWorkflows(workflows) {
|
|
138
138
|
const copy = shell.useAssistantCopy();
|
|
139
|
-
return react$1.useMemo(() =>
|
|
139
|
+
return react$1.useMemo(() => chunk7D4WXUBS_cjs.nameBuiltinWorkflows(workflows, copy), [workflows, copy]);
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
// src/connection/workflows/useWorkflowDefinitions.ts
|
|
@@ -152,28 +152,28 @@ function useUsableSkillListings(hostSkills) {
|
|
|
152
152
|
function useWorkflowDefinitions() {
|
|
153
153
|
const hostSkills = useHostSkills();
|
|
154
154
|
const listings = useUsableSkillListings(hostSkills);
|
|
155
|
-
const usage =
|
|
155
|
+
const usage = chunk7D4WXUBS_cjs.useWorkflowUsage();
|
|
156
156
|
const skillsEnabled = useSkillsEnabled();
|
|
157
|
-
const web = useNamedWorkflows(
|
|
158
|
-
const operations = useNamedWorkflows(
|
|
157
|
+
const web = useNamedWorkflows(chunk7D4WXUBS_cjs.WEB_WORKFLOWS);
|
|
158
|
+
const operations = useNamedWorkflows(chunk7D4WXUBS_cjs.DASHBOARD_OPERATIONS);
|
|
159
159
|
return react$1.useMemo(() => {
|
|
160
160
|
const packSlugs = new Set(hostSkills.map((w) => w.id));
|
|
161
|
-
const { host: builtins, skills: fromServer } =
|
|
161
|
+
const { host: builtins, skills: fromServer } = chunkXPQR2PJX_cjs.mergeSkillWorkflows(
|
|
162
162
|
web.filter((w) => !packSlugs.has(w.id)),
|
|
163
163
|
listings
|
|
164
164
|
);
|
|
165
165
|
const all = [...builtins, ...hostSkills, ...fromServer];
|
|
166
166
|
const byId = new Map(all.map((w) => [w.id, w]));
|
|
167
|
-
const pinned =
|
|
167
|
+
const pinned = chunk7D4WXUBS_cjs.DASHBOARD_PINNED.flatMap((id) => {
|
|
168
168
|
const w = byId.get(id);
|
|
169
169
|
return w ? [w] : [];
|
|
170
170
|
});
|
|
171
171
|
return {
|
|
172
172
|
skills: all,
|
|
173
173
|
skillsEnabled,
|
|
174
|
-
start: skillsEnabled ? [...builtins, ...
|
|
174
|
+
start: skillsEnabled ? [...builtins, ...chunk7D4WXUBS_cjs.sortByRecentUse(fromServer, usage)] : [],
|
|
175
175
|
dashboard: [...pinned, ...operations],
|
|
176
|
-
forTasks: [
|
|
176
|
+
forTasks: [chunk7D4WXUBS_cjs.CUSTOM_TASK, ...all.filter((w) => w.schedulable), chunk7D4WXUBS_cjs.REMIND_TASK]
|
|
177
177
|
};
|
|
178
178
|
}, [hostSkills, listings, usage, skillsEnabled, web, operations]);
|
|
179
179
|
}
|
|
@@ -189,5 +189,5 @@ exports.useUsableSkillListings = useUsableSkillListings;
|
|
|
189
189
|
exports.useWorkflowDefinitions = useWorkflowDefinitions;
|
|
190
190
|
exports.useWorkflowTasks = useWorkflowTasks;
|
|
191
191
|
exports.withoutMarketplace = withoutMarketplace;
|
|
192
|
-
//# sourceMappingURL=chunk-
|
|
193
|
-
//# sourceMappingURL=chunk-
|
|
192
|
+
//# sourceMappingURL=chunk-2Q32RXY2.cjs.map
|
|
193
|
+
//# sourceMappingURL=chunk-2Q32RXY2.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workflows/useWorkflowTasks.ts","../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts"],"names":["useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","useMemo","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate","useArbiSession","useUserSettings","useHost","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK"],"mappings":";;;;;;;;;;;AAuDO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,cAAcA,oBAAA,EAAe;AACnC,EAAA,MAAM,aAAaC,uBAAA,EAAkB;AACrC,EAAA,MAAM,iBAAiBC,uBAAA,EAAkB;AACzC,EAAA,MAAM,qBAAqBC,2BAAA,EAAsB;AACjD,EAAA,MAAM,yBAAyBC,uBAAA,EAAkB;AACjD,EAAA,MAAM,iBAAA,GAAoBC,yBAAA,CAAoB,CAAC,CAAA,KAAM,EAAE,WAAW,CAAA;AAClE,EAAA,MAAM,UAAA,GAAaC,mBAAA,CAAc,EAAE,WAAA,EAAa,mBAAmB,CAAA;AACnE,EAAA,MAAM,EAAE,SAAA,EAAU,GAAIC,sCAAA,EAAqB;AAI3C,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAM,GAAIC,yBAAA,EAAoB;AACnD,EAAA,MAAM,gBAAA,GAAmBC,mBAAA;AAAA,IACvB,CAAC,YAAoB,WAAA,KACnB,KAAA,CAAM,EAAE,UAAA,EAAY,WAAA,EAAa,CAAA,CAAE,IAAA;AAAA,MACjC,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,KACR;AAAA,IACF,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,GAAY,EAAC,KAAMC,kBAAA,EAAa;AAC9C,EAAA,MAAM,cAAA,GAAiBC,eAAA;AAAA,IACrB,MACE,MAAA,CAAO,WAAA,CAAY,SAAA,CAAU,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,WAAA,EAAaC,oBAAiB,CAAA,EAAG,CAAA,CAAE,WAAW,CAAC,CAAC,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,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,EAAA,EAAI,CAAC,CAAC,CAAC,CAAA;AAC9C,IAAA,MAAM,MAAA,GAASC,kCAAA,CAAiB,OAAA,CAAQ,CAAC,EAAA,KAAO;AAC9C,MAAA,MAAM,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA;AACrB,MAAA,OAAO,CAAA,GAAI,CAAC,CAAC,CAAA,GAAI,EAAC;AAAA,IACpB,CAAC,CAAA;AACD,IAAA,OAAO;AAAA,MACL,MAAA,EAAQ,GAAA;AAAA,MACR,aAAA;AAAA,MACA,KAAA,EAAO,aAAA,GAAgB,CAAC,GAAG,QAAA,EAAU,GAAGC,iCAAA,CAAgB,UAAA,EAAY,KAAK,CAAC,CAAA,GAAI,EAAC;AAAA,MAC/E,SAAA,EAAW,CAAC,GAAG,MAAA,EAAQ,GAAG,UAAU,CAAA;AAAA,MACpC,QAAA,EAAU,CAACC,6BAAA,EAAa,GAAG,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA,EAAGC,6BAAW;AAAA,KAC1E;AAAA,EACF,CAAA,EAAG,CAAC,UAAA,EAAY,QAAA,EAAU,OAAO,aAAA,EAAe,GAAA,EAAK,UAAU,CAAC,CAAA;AAClE","file":"chunk-6CGMSJLB.cjs","sourcesContent":["/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // Standing access for a workflow's agent, so its unattended runs can read the workspace. An agent\n // that is already a member makes the server refuse the re-grant: that is no failure here.\n const { mutateAsync: grant } = useGrantAgentAccess()\n const grantAgentAccess = useCallback(\n (agentExtId: string, workspaceId: string) =>\n grant({ agentExtId, workspaceId }).then(\n () => undefined,\n () => undefined\n ),\n [grant]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n // Keep access: deposit the key for the agent the server assigned (the Assistant when none was\n // picked), while the owner is here, so unattended runs start on their own.\n const workspaceId = workflow.workspace_ext_id ?? request.body.workspace_ext_id\n if (\n workflow.auth_mode === 'scheduled_permanent' &&\n !workflow.on_demand &&\n workflow.agent_ext_id &&\n workspaceId\n ) {\n await grantAgentAccess(workflow.agent_ext_id, workspaceId)\n }\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n grantAgentAccess,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // The agent the server keeps (the Assistant when none was picked) gets the key for unattended runs.\n const agentId = updated.agent_ext_id ?? patch.agent_ext_id ?? workflow.agent_ext_id\n if (\n updated.auth_mode === 'scheduled_permanent' &&\n !updated.on_demand &&\n agentId &&\n workspaceId\n ) {\n await grantAgentAccess(agentId, workspaceId)\n }\n },\n [activeWorkspaceId, documentTitles, grantAgentAccess, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n","import { useArbiSession } from '@arbidocs/react'\n\n/** The account fields that say it is an external one. */\ninterface AccountKind {\n temporary_access_only?: boolean | null\n user_type?: string | null\n}\n\n/** An external account: temporary access to shared workspaces only. */\nexport const isExternalAccount = (user: AccountKind | null | undefined): boolean =>\n !!user && (user.temporary_access_only === true || user.user_type === 'external')\n\n/**\n * Whether the signed-in person is an external guest. They get the built-in skills and the host's\n * skill packs, never the marketplace (the backend enforces it as well).\n */\nexport function useIsExternalAccount(): boolean {\n return isExternalAccount(useArbiSession().user)\n}\n\n/** Skill listings without the marketplace's (`visibility: global`): what an external guest gets. */\nexport const withoutMarketplace = <T extends { visibility?: string | null }>(listings: T[]): T[] =>\n listings.filter((s) => s.visibility !== 'global')\n","/**\n * The one gate for everything skill-shaped in the app: the empty chat's Start list, the skill\n * entries of the slash menu, the sidebar's Skills item, the Skills browser's entry points and the\n * typed `/skill` interception. It is the personal `show_skills` user setting, default off; the\n * switch lives in Settings, Experimental (developers only), so today only developers have it.\n */\n\nimport { useUserSettings } from '@arbidocs/react'\nimport { useIsExternalAccount } from '../useIsExternalAccount'\n\nexport function useSkillsEnabled(): boolean {\n const { data: userSettings } = useUserSettings()\n return userSettings?.show_skills ?? false\n}\n\n/**\n * Whether the Skills browser (the marketplace: \"Browse skills\", the Skills menu entry) is offered:\n * to skills users, never to an external guest (the backend enforces it as well).\n */\nexport function useCanBrowseSkills(): boolean {\n const skillsEnabled = useSkillsEnabled()\n const isExternal = useIsExternalAccount()\n return skillsEnabled && !isExternal\n}\n","/**\n * The host's skill packs (`host.workflows.skillPacks`) as the kit's workflows, and the `/` menu's\n * rows for them: one section per heading (a category, else a pack's label).\n */\nimport { useMemo } from 'react'\nimport { skillPackWorkflows, type SkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { useHost } from '../../provider/host'\n\n/** The section heading of a pack without a label or category. */\nconst DEFAULT_PACK_LABEL = 'Skills from this site'\n\nconst NO_PACKS: SkillPackWorkflow[] = []\n\nexport function useHostSkills(): SkillPackWorkflow[] {\n const packs = useHost().workflows?.skillPacks\n return useMemo(() => (packs?.length ? packs.flatMap(skillPackWorkflows) : NO_PACKS), [packs])\n}\n\n/**\n * A pack skill's `/` menu row. Its section is its heading (its category, else its pack's label), so\n * skills of several packs under one heading share one section.\n */\nexport function hostSkillItem(workflow: SkillPackWorkflow): SlashMenuItem {\n const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL\n return {\n name: workflow.id,\n description: workflow.description,\n kind: 'skill',\n group: { id: `pack-${label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`, label },\n }\n}\n","import { useMemo } from 'react'\nimport { useAssistantCopy } from '@arbidocs/react/shell'\nimport { nameBuiltinWorkflows } from '../../agents/workflows/catalogue/seed'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\n\n/** The seeded workflows in the host's assistant name (`nameBuiltinWorkflows`). */\nexport function useNamedWorkflows(\n workflows: ReadonlyArray<WorkflowDefinition>\n): WorkflowDefinition[] {\n const copy = useAssistantCopy()\n return useMemo(() => nameBuiltinWorkflows(workflows, copy), [workflows, copy])\n}\n","/**\n * The one list of workflows: the seeded ones plus every skill the user can invoke (each degraded\n * to a single-field form from its `arg_hint`). The dashboard tiles, the slash menu, tasks and\n * agents all read this.\n */\n\nimport { useMemo } from 'react'\nimport { useSkills } from '@arbidocs/react'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport {\n CUSTOM_TASK,\n DASHBOARD_OPERATIONS,\n DASHBOARD_PINNED,\n REMIND_TASK,\n} from '../../agents/workflows/catalogue/seed'\nimport { useSkillsEnabled } from './useSkillsEnabled'\nimport { useHostSkills } from './useHostSkills'\nimport { useIsExternalAccount, withoutMarketplace } from '../useIsExternalAccount'\nimport { sortByRecentUse, useWorkflowUsage } from '../../agents/workflows/catalogue/workflow-usage'\nimport { WEB_WORKFLOWS } from '../../agents/workflows/catalogue/registry'\nimport { useNamedWorkflows } from './useNamedWorkflows'\n\nexport interface UseWorkflowDefinitionsResult {\n /**\n * Every skill workflow of this host: built-ins, the host's skill packs, then the user's and the\n * marketplace's (one list).\n */\n skills: WorkflowDefinition[]\n /** The user has skills switched on (`show_skills`): the gate of every skill-shaped surface. */\n skillsEnabled: boolean\n /**\n * The empty chat's Start section: built-ins first (their own order), then the user's own and\n * marketplace skills by recent use, then name. EMPTY for users without skills enabled.\n */\n start: WorkflowDefinition[]\n /** The dashboard Start band: pinned skills in order, then the operation launchers. */\n dashboard: WorkflowDefinition[]\n /** What a task can run: schedulable skills plus a free instruction and a reminder. */\n forTasks: WorkflowDefinition[]\n}\n\n/**\n * The skill listings a person may use from the menus: a host pack's slug is the pack's (an\n * installed copy is the same skill), and an external guest gets no marketplace skills.\n */\nexport function useUsableSkillListings(hostSkills: ReadonlyArray<WorkflowDefinition>) {\n const { data: listings } = useSkills()\n const isExternal = useIsExternalAccount()\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n const usable = (listings ?? []).filter((s) => !packSlugs.has(s.slug))\n return isExternal ? withoutMarketplace(usable) : usable\n }, [listings, hostSkills, isExternal])\n}\n\nexport function useWorkflowDefinitions(): UseWorkflowDefinitionsResult {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const usage = useWorkflowUsage()\n const skillsEnabled = useSkillsEnabled()\n const web = useNamedWorkflows(WEB_WORKFLOWS)\n const operations = useNamedWorkflows(DASHBOARD_OPERATIONS)\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n // An uploaded skill of a built-in's slug is used instead of it.\n const { host: builtins, skills: fromServer } = mergeSkillWorkflows(\n web.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n // The host's packs sit with the built-ins; they are listed in the menus, not in Start.\n const all = [...builtins, ...hostSkills, ...fromServer]\n const byId = new Map(all.map((w) => [w.id, w]))\n const pinned = DASHBOARD_PINNED.flatMap((id) => {\n const w = byId.get(id)\n return w ? [w] : []\n })\n return {\n skills: all,\n skillsEnabled,\n start: skillsEnabled ? [...builtins, ...sortByRecentUse(fromServer, usage)] : [],\n dashboard: [...pinned, ...operations],\n forTasks: [CUSTOM_TASK, ...all.filter((w) => w.schedulable), REMIND_TASK],\n }\n }, [hostSkills, listings, usage, skillsEnabled, web, operations])\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/workflows/useWorkflowTasks.ts","../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts"],"names":["useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","useMemo","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate","useArbiSession","useUserSettings","useHost","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK"],"mappings":";;;;;;;;;;;AAuDO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,cAAcA,oBAAA,EAAe;AACnC,EAAA,MAAM,aAAaC,uBAAA,EAAkB;AACrC,EAAA,MAAM,iBAAiBC,uBAAA,EAAkB;AACzC,EAAA,MAAM,qBAAqBC,2BAAA,EAAsB;AACjD,EAAA,MAAM,yBAAyBC,uBAAA,EAAkB;AACjD,EAAA,MAAM,iBAAA,GAAoBC,yBAAA,CAAoB,CAAC,CAAA,KAAM,EAAE,WAAW,CAAA;AAClE,EAAA,MAAM,UAAA,GAAaC,mBAAA,CAAc,EAAE,WAAA,EAAa,mBAAmB,CAAA;AACnE,EAAA,MAAM,EAAE,SAAA,EAAU,GAAIC,sCAAA,EAAqB;AAI3C,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAM,GAAIC,yBAAA,EAAoB;AACnD,EAAA,MAAM,gBAAA,GAAmBC,mBAAA;AAAA,IACvB,CAAC,YAAoB,WAAA,KACnB,KAAA,CAAM,EAAE,UAAA,EAAY,WAAA,EAAa,CAAA,CAAE,IAAA;AAAA,MACjC,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,KACR;AAAA,IACF,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Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // Standing access for a workflow's agent, so its unattended runs can read the workspace. An agent\n // that is already a member makes the server refuse the re-grant: that is no failure here.\n const { mutateAsync: grant } = useGrantAgentAccess()\n const grantAgentAccess = useCallback(\n (agentExtId: string, workspaceId: string) =>\n grant({ agentExtId, workspaceId }).then(\n () => undefined,\n () => undefined\n ),\n [grant]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n // Keep access: deposit the key for the agent the server assigned (the Assistant when none was\n // picked), while the owner is here, so unattended runs start on their own.\n const workspaceId = workflow.workspace_ext_id ?? request.body.workspace_ext_id\n if (\n workflow.auth_mode === 'scheduled_permanent' &&\n !workflow.on_demand &&\n workflow.agent_ext_id &&\n workspaceId\n ) {\n await grantAgentAccess(workflow.agent_ext_id, workspaceId)\n }\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n grantAgentAccess,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // The agent the server keeps (the Assistant when none was picked) gets the key for unattended runs.\n const agentId = updated.agent_ext_id ?? patch.agent_ext_id ?? workflow.agent_ext_id\n if (\n updated.auth_mode === 'scheduled_permanent' &&\n !updated.on_demand &&\n agentId &&\n workspaceId\n ) {\n await grantAgentAccess(agentId, workspaceId)\n }\n },\n [activeWorkspaceId, documentTitles, grantAgentAccess, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n","import { useArbiSession } from '@arbidocs/react'\n\n/** The account fields that say it is an external one. */\ninterface AccountKind {\n temporary_access_only?: boolean | null\n user_type?: string | null\n}\n\n/** An external account: temporary access to shared workspaces only. */\nexport const isExternalAccount = (user: AccountKind | null | undefined): boolean =>\n !!user && (user.temporary_access_only === true || user.user_type === 'external')\n\n/**\n * Whether the signed-in person is an external guest. They get the built-in skills and the host's\n * skill packs, never the marketplace (the backend enforces it as well).\n */\nexport function useIsExternalAccount(): boolean {\n return isExternalAccount(useArbiSession().user)\n}\n\n/** Skill listings without the marketplace's (`visibility: global`): what an external guest gets. */\nexport const withoutMarketplace = <T extends { visibility?: string | null }>(listings: T[]): T[] =>\n listings.filter((s) => s.visibility !== 'global')\n","/**\n * The one gate for everything skill-shaped in the app: the empty chat's Start list, the skill\n * entries of the slash menu, the sidebar's Skills item, the Skills browser's entry points and the\n * typed `/skill` interception. It is the personal `show_skills` user setting, default off; the\n * switch lives in Settings, Experimental (developers only), so today only developers have it.\n */\n\nimport { useUserSettings } from '@arbidocs/react'\nimport { useIsExternalAccount } from '../useIsExternalAccount'\n\nexport function useSkillsEnabled(): boolean {\n const { data: userSettings } = useUserSettings()\n return userSettings?.show_skills ?? false\n}\n\n/**\n * Whether the Skills browser (the marketplace: \"Browse skills\", the Skills menu entry) is offered:\n * to skills users, never to an external guest (the backend enforces it as well).\n */\nexport function useCanBrowseSkills(): boolean {\n const skillsEnabled = useSkillsEnabled()\n const isExternal = useIsExternalAccount()\n return skillsEnabled && !isExternal\n}\n","/**\n * The host's skill packs (`host.workflows.skillPacks`) as the kit's workflows, and the `/` menu's\n * rows for them: one section per heading (a category, else a pack's label).\n */\nimport { useMemo } from 'react'\nimport { skillPackWorkflows, type SkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { useHost } from '../../provider/host'\n\n/** The section heading of a pack without a label or category. */\nconst DEFAULT_PACK_LABEL = 'Skills from this site'\n\nconst NO_PACKS: SkillPackWorkflow[] = []\n\nexport function useHostSkills(): SkillPackWorkflow[] {\n const packs = useHost().workflows?.skillPacks\n return useMemo(() => (packs?.length ? packs.flatMap(skillPackWorkflows) : NO_PACKS), [packs])\n}\n\n/**\n * A pack skill's `/` menu row. Its section is its heading (its category, else its pack's label), so\n * skills of several packs under one heading share one section.\n */\nexport function hostSkillItem(workflow: SkillPackWorkflow): SlashMenuItem {\n const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL\n return {\n name: workflow.id,\n description: workflow.description,\n kind: 'skill',\n group: { id: `pack-${label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`, label },\n }\n}\n","import { useMemo } from 'react'\nimport { useAssistantCopy } from '@arbidocs/react/shell'\nimport { nameBuiltinWorkflows } from '../../agents/workflows/catalogue/seed'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\n\n/** The seeded workflows in the host's assistant name (`nameBuiltinWorkflows`). */\nexport function useNamedWorkflows(\n workflows: ReadonlyArray<WorkflowDefinition>\n): WorkflowDefinition[] {\n const copy = useAssistantCopy()\n return useMemo(() => nameBuiltinWorkflows(workflows, copy), [workflows, copy])\n}\n","/**\n * The one list of workflows: the seeded ones plus every skill the user can invoke (each degraded\n * to a single-field form from its `arg_hint`). The dashboard tiles, the slash menu, tasks and\n * agents all read this.\n */\n\nimport { useMemo } from 'react'\nimport { useSkills } from '@arbidocs/react'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport {\n CUSTOM_TASK,\n DASHBOARD_OPERATIONS,\n DASHBOARD_PINNED,\n REMIND_TASK,\n} from '../../agents/workflows/catalogue/seed'\nimport { useSkillsEnabled } from './useSkillsEnabled'\nimport { useHostSkills } from './useHostSkills'\nimport { useIsExternalAccount, withoutMarketplace } from '../useIsExternalAccount'\nimport { sortByRecentUse, useWorkflowUsage } from '../../agents/workflows/catalogue/workflow-usage'\nimport { WEB_WORKFLOWS } from '../../agents/workflows/catalogue/registry'\nimport { useNamedWorkflows } from './useNamedWorkflows'\n\nexport interface UseWorkflowDefinitionsResult {\n /**\n * Every skill workflow of this host: built-ins, the host's skill packs, then the user's and the\n * marketplace's (one list).\n */\n skills: WorkflowDefinition[]\n /** The user has skills switched on (`show_skills`): the gate of every skill-shaped surface. */\n skillsEnabled: boolean\n /**\n * The empty chat's Start section: built-ins first (their own order), then the user's own and\n * marketplace skills by recent use, then name. EMPTY for users without skills enabled.\n */\n start: WorkflowDefinition[]\n /** The dashboard Start band: pinned skills in order, then the operation launchers. */\n dashboard: WorkflowDefinition[]\n /** What a task can run: schedulable skills plus a free instruction and a reminder. */\n forTasks: WorkflowDefinition[]\n}\n\n/**\n * The skill listings a person may use from the menus: a host pack's slug is the pack's (an\n * installed copy is the same skill), and an external guest gets no marketplace skills.\n */\nexport function useUsableSkillListings(hostSkills: ReadonlyArray<WorkflowDefinition>) {\n const { data: listings } = useSkills()\n const isExternal = useIsExternalAccount()\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n const usable = (listings ?? []).filter((s) => !packSlugs.has(s.slug))\n return isExternal ? withoutMarketplace(usable) : usable\n }, [listings, hostSkills, isExternal])\n}\n\nexport function useWorkflowDefinitions(): UseWorkflowDefinitionsResult {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const usage = useWorkflowUsage()\n const skillsEnabled = useSkillsEnabled()\n const web = useNamedWorkflows(WEB_WORKFLOWS)\n const operations = useNamedWorkflows(DASHBOARD_OPERATIONS)\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n // An uploaded skill of a built-in's slug is used instead of it.\n const { host: builtins, skills: fromServer } = mergeSkillWorkflows(\n web.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n // The host's packs sit with the built-ins; they are listed in the menus, not in Start.\n const all = [...builtins, ...hostSkills, ...fromServer]\n const byId = new Map(all.map((w) => [w.id, w]))\n const pinned = DASHBOARD_PINNED.flatMap((id) => {\n const w = byId.get(id)\n return w ? [w] : []\n })\n return {\n skills: all,\n skillsEnabled,\n start: skillsEnabled ? [...builtins, ...sortByRecentUse(fromServer, usage)] : [],\n dashboard: [...pinned, ...operations],\n forTasks: [CUSTOM_TASK, ...all.filter((w) => w.schedulable), REMIND_TASK],\n }\n }, [hostSkills, listings, usage, skillsEnabled, web, operations])\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk6TU4YLFW_cjs = require('./chunk-6TU4YLFW.cjs');
|
|
5
5
|
var chunkAFQTQC7A_cjs = require('./chunk-AFQTQC7A.cjs');
|
|
6
6
|
var chunkXJEXFEWG_cjs = require('./chunk-XJEXFEWG.cjs');
|
|
7
7
|
var react = require('react');
|
|
@@ -31,7 +31,7 @@ function AssistantDockToggle({
|
|
|
31
31
|
label = "Assistant chat",
|
|
32
32
|
testId = "chat-dock-toggle"
|
|
33
33
|
}) {
|
|
34
|
-
const { isDockAvailable } =
|
|
34
|
+
const { isDockAvailable } = chunk6TU4YLFW_cjs.useChatSurface();
|
|
35
35
|
const dock = useAssistantDock();
|
|
36
36
|
if (!isDockAvailable) return null;
|
|
37
37
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkAFQTQC7A_cjs.ToolButton, { onClick: dock.toggle, label, active: dock.isOpen, "data-testid": testId, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageSquare, { className: "size-4", "aria-hidden": "true" }) });
|
|
@@ -45,7 +45,7 @@ function AssistantDock({
|
|
|
45
45
|
labels,
|
|
46
46
|
onOpenCitation
|
|
47
47
|
}) {
|
|
48
|
-
const { isDockAvailable } =
|
|
48
|
+
const { isDockAvailable } = chunk6TU4YLFW_cjs.useChatSurface();
|
|
49
49
|
const dock = useAssistantDock();
|
|
50
50
|
if (!isDockAvailable) return null;
|
|
51
51
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -59,7 +59,7 @@ function AssistantDock({
|
|
|
59
59
|
closeLabel,
|
|
60
60
|
"data-testid": "chat-dock",
|
|
61
61
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
-
|
|
62
|
+
chunk6TU4YLFW_cjs.ChatPage,
|
|
63
63
|
{
|
|
64
64
|
chat,
|
|
65
65
|
labels,
|
|
@@ -87,5 +87,5 @@ function AssistantDock({
|
|
|
87
87
|
exports.AssistantDock = AssistantDock;
|
|
88
88
|
exports.AssistantDockToggle = AssistantDockToggle;
|
|
89
89
|
exports.useAssistantDock = useAssistantDock;
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-2V5HW6T5.cjs.map
|
|
91
|
+
//# sourceMappingURL=chunk-2V5HW6T5.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chat/assistant-dock-state.tsx","../src/chat/AssistantDock.tsx"],"names":["useSyncExternalStore","useChatSurface","ToolButton","jsx","MessageSquare","Shell","ChatPage","X"],"mappings":";;;;;;;;;AASA,IAAI,MAAA,GAAS,KAAA;AACb,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,IAAM,SAAA,GAAY,CAAC,CAAA,KAAkB;AACnC,EAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AACf,EAAA,OAAO,MAAM,SAAA,CAAU,MAAA,CAAO,CAAC,CAAA;AACjC,CAAA;AACA,SAAS,IAAI,IAAA,EAAe;AAC1B,EAAA,IAAI,SAAS,MAAA,EAAQ;AACrB,EAAA,MAAA,GAAS,IAAA;AACT,EAAA,SAAA,CAAU,OAAA,CAAQ,CAAC,CAAA,KAAM,CAAA,EAAG,CAAA;AAC9B;AAEO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,IAAA,GAAOA,0BAAA;AAAA,IACX,SAAA;AAAA,IACA,MAAM,MAAA;AAAA,IACN,MAAM;AAAA,G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BAAAF,cAAAA;AAAA,QAACG,0BAAA;AAAA,QAAA;AAAA,UACC,IAAA;AAAA,UACA,MAAA;AAAA,UACA,cAAA;AAAA,UACA,OAAA,EAAQ,MAAA;AAAA,UACR,SAAA,EAAU,gBAAA;AAAA,UACV,aAAA;AAAA;AAAA,YAEE,CAAC,4BACCH,cAAAA;AAAA,cAACD,4BAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,MAAM,IAAA,CAAK,OAAA,CAAQ,KAAK,CAAA;AAAA,gBACjC,KAAA,EAAO,UAAA;AAAA,gBACP,aAAA,EAAY,YAAA;AAAA,gBAEZ,0BAAAC,cAAAA,CAACI,aAAA,EAAA,EAAE,SAAA,EAAU,QAAA,EAAS,eAAY,MAAA,EAAO;AAAA;AAAA;AAC3C;AAAA;AAAA;AAGN;AAAA,GACF;AAEJ","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/chat/assistant-dock-state.tsx","../src/chat/AssistantDock.tsx"],"names":["useSyncExternalStore","useChatSurface","ToolButton","jsx","MessageSquare","Shell","ChatPage","X"],"mappings":";;;;;;;;;AASA,IAAI,MAAA,GAAS,KAAA;AACb,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AACtC,IAAM,SAAA,GAAY,CAAC,CAAA,KAAkB;AACnC,EAAA,SAAA,CAAU,IAAI,CAAC,CAAA;AACf,EAAA,OAAO,MAAM,SAAA,CAAU,MAAA,CAAO,CAAC,CAAA;AACjC,CAAA;AACA,SAAS,IAAI,IAAA,EAAe;AAC1B,EAAA,IAAI,SAAS,MAAA,EAAQ;AACrB,EAAA,MAAA,GAAS,IAAA;AACT,EAAA,SAAA,CAAU,OAAA,CAAQ,CAAC,CAAA,KAAM,CAAA,EAAG,CAAA;AAC9B;AAEO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,IAAA,GAAOA,0BAAA;AAAA,IACX,SAAA;AAAA,IACA,MAAM,MAAA;AAAA,IACN,MAAM;AAAA,GACR;AACA,EAAA,OAAO,E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AACG,0BAAA;AAAA,QAAA;AAAA,UACC,IAAA;AAAA,UACA,MAAA;AAAA,UACA,cAAA;AAAA,UACA,OAAA,EAAQ,MAAA;AAAA,UACR,SAAA,EAAU,gBAAA;AAAA,UACV,aAAA;AAAA;AAAA,YAEE,CAAC,4BACCH,cAAAA;AAAA,cAACD,4BAAA;AAAA,cAAA;AAAA,gBACC,OAAA,EAAS,MAAM,IAAA,CAAK,OAAA,CAAQ,KAAK,CAAA;AAAA,gBACjC,KAAA,EAAO,UAAA;AAAA,gBACP,aAAA,EAAY,YAAA;AAAA,gBAEZ,0BAAAC,cAAAA,CAACI,aAAA,EAAA,EAAE,SAAA,EAAU,QAAA,EAAS,eAAY,MAAA,EAAO;AAAA;AAAA;AAC3C;AAAA;AAAA;AAGN;AAAA,GACF;AAEJ","file":"chunk-2V5HW6T5.cjs","sourcesContent":["import { useSyncExternalStore } from 'react'\nimport { MessageSquare } from 'lucide-react'\nimport { ToolButton } from '../shell/ToolButton'\nimport { useChatSurface } from './chat-surface'\n\n/**\n * Open/closed state of the assistant dock: one module-level store, so the topbar button and the\n * dock agree wherever they are mounted, with no host store to write.\n */\nlet isOpen = false\nconst listeners = new Set<() => void>()\nconst subscribe = (l: () => void) => {\n listeners.add(l)\n return () => listeners.delete(l)\n}\nfunction set(next: boolean) {\n if (next === isOpen) return\n isOpen = next\n listeners.forEach((l) => l())\n}\n\nexport function useAssistantDock() {\n const open = useSyncExternalStore(\n subscribe,\n () => isOpen,\n () => false\n )\n return { isOpen: open, setOpen: set, toggle: () => set(!isOpen) }\n}\n\nexport interface AssistantDockToggleProps {\n /** Accessible name. Default \"Open assistant chat\". */\n label?: string\n testId?: string\n}\n\n/** Topbar button that opens and closes the dock. Renders nothing while a page chat is mounted. */\nexport function AssistantDockToggle({\n label = 'Assistant chat',\n testId = 'chat-dock-toggle',\n}: AssistantDockToggleProps) {\n const { isDockAvailable } = useChatSurface()\n const dock = useAssistantDock()\n if (!isDockAvailable) return null\n return (\n <ToolButton onClick={dock.toggle} label={label} active={dock.isOpen} data-testid={testId}>\n <MessageSquare className=\"size-4\" aria-hidden=\"true\" />\n </ToolButton>\n )\n}\n","import { X } from 'lucide-react'\nimport { Shell } from '../shell/Shell'\nimport { ToolButton } from '../shell/ToolButton'\nimport { ChatPage } from './ChatPage'\nimport { useChatSurface } from './chat-surface'\nimport type { ChatPageController, ChatPageProps } from './chat-page-types'\nimport { useAssistantDock } from './assistant-dock-state'\n\n/** What a dock takes: its chat, its frame and its words. The thread is the full page's `ChatPage`. */\nexport interface AssistantDockProps extends Pick<ChatPageProps, 'labels' | 'onOpenCitation'> {\n chat: ChatPageController\n /** Phone layout: the dock covers the screen as a modal. */\n isMobile?: boolean\n /** Desktop width. Default 380. */\n width?: number | string\n /** Accessible name of the dock. Default \"Assistant chat\". */\n label?: string\n closeLabel?: string\n}\n\n/**\n * The assistant as a right-hand dock: `Shell.Dock` around the same `ChatPage` as the full page\n * (`surface=\"dock\"`), with its open state in `useAssistantDock`. It yields to a mounted page chat\n * (`useChatSurface`), so the host only mounts it once, next to `Shell.Root`'s `aside`:\n *\n * ```tsx\n * <Shell.Root aside={<AssistantDock chat={chat} isMobile={isMobile} />} ... />\n * <AssistantDockToggle /> // in the topbar\n * ```\n *\n * Keep the `chat` controller in a component that stays mounted (the layout), so the conversation\n * survives closing the dock.\n */\nexport function AssistantDock({\n chat,\n isMobile = false,\n width = 380,\n label = 'Assistant chat',\n closeLabel = 'Close chat',\n labels,\n onOpenCitation,\n}: AssistantDockProps) {\n const { isDockAvailable } = useChatSurface()\n const dock = useAssistantDock()\n if (!isDockAvailable) return null\n return (\n <Shell.Dock\n isOpen={dock.isOpen}\n onOpenChange={dock.setOpen}\n isMobile={isMobile}\n width={width}\n label={label}\n closeLabel={closeLabel}\n data-testid=\"chat-dock\"\n >\n <ChatPage\n chat={chat}\n labels={labels}\n onOpenCitation={onOpenCitation}\n surface=\"dock\"\n className=\"min-h-0 flex-1\"\n headerActions={\n // On a phone the dock draws its own close button over the header.\n !isMobile && (\n <ToolButton\n onClick={() => dock.setOpen(false)}\n label={closeLabel}\n data-testid=\"chat-close\"\n >\n <X className=\"size-4\" aria-hidden=\"true\" />\n </ToolButton>\n )\n }\n />\n </Shell.Dock>\n )\n}\n"]}
|