@arbidocs/blocks 0.5.157 → 0.5.159
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-TGI43VKB.cjs → ConnectedCallDock-SD4DKTMX.cjs} +15 -15
- package/dist/{ConnectedCallDock-TGI43VKB.cjs.map → ConnectedCallDock-SD4DKTMX.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-FBTDSG3N.cjs → ConnectedCallRoom-2FLGH3JB.cjs} +14 -14
- package/dist/{ConnectedCallRoom-FBTDSG3N.cjs.map → ConnectedCallRoom-2FLGH3JB.cjs.map} +1 -1
- package/dist/{ConnectedMailInviteCard-LV2VARX3.cjs → ConnectedMailInviteCard-VMFTQ5PW.cjs} +5 -5
- package/dist/{ConnectedMailInviteCard-LV2VARX3.cjs.map → ConnectedMailInviteCard-VMFTQ5PW.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-7VD4ZIHO.cjs → ConnectedNativeDocxComparison-PV3SDVMZ.cjs} +21 -21
- package/dist/{ConnectedNativeDocxComparison-7VD4ZIHO.cjs.map → ConnectedNativeDocxComparison-PV3SDVMZ.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-FDYO2TSX.cjs → ConnectedPresentation-J42JPUVR.cjs} +18 -18
- package/dist/{ConnectedPresentation-FDYO2TSX.cjs.map → ConnectedPresentation-J42JPUVR.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-4N7R7SFZ.cjs → ConnectedProductionSetDialog-LB5B7OXR.cjs} +4 -4
- package/dist/{ConnectedProductionSetDialog-4N7R7SFZ.cjs.map → ConnectedProductionSetDialog-LB5B7OXR.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-NM2UEE77.cjs → ConnectedSlidesTab-BYS7HFNK.cjs} +16 -16
- package/dist/{ConnectedSlidesTab-NM2UEE77.cjs.map → ConnectedSlidesTab-BYS7HFNK.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-ISLZLV4V.cjs → ConnectedStreamedWordArtifact-T6GE5GME.cjs} +21 -21
- package/dist/{ConnectedStreamedWordArtifact-ISLZLV4V.cjs.map → ConnectedStreamedWordArtifact-T6GE5GME.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5CVWGOZQ.cjs → DocumentReviewCard-UXGPQNTN.cjs} +27 -27
- package/dist/{DocumentReviewCard-5CVWGOZQ.cjs.map → DocumentReviewCard-UXGPQNTN.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-PXUXYTPK.cjs → FilesViewerDialog-D6XDCE2U.cjs} +51 -51
- package/dist/{FilesViewerDialog-PXUXYTPK.cjs.map → FilesViewerDialog-D6XDCE2U.cjs.map} +1 -1
- package/dist/RechartsRenderer-KFHFIEIQ.cjs +347 -0
- package/dist/RechartsRenderer-KFHFIEIQ.cjs.map +1 -0
- package/dist/TimeSeriesDrawing-UHDFZPYG.cjs +166 -0
- package/dist/TimeSeriesDrawing-UHDFZPYG.cjs.map +1 -0
- package/dist/{WorkspaceTableView-HR4KTFSX.cjs → WorkspaceTableView-NMERZJZZ.cjs} +13 -13
- package/dist/{WorkspaceTableView-HR4KTFSX.cjs.map → WorkspaceTableView-NMERZJZZ.cjs.map} +1 -1
- package/dist/agents/index.cjs +289 -289
- package/dist/agents/tasks/WorkflowsTable.js +10 -6
- package/dist/agents/tasks/WorkflowsTable.js.map +2 -2
- package/dist/{ai-HME7CNDE.cjs → ai-QFY4LYQZ.cjs} +24 -24
- package/dist/ai-QFY4LYQZ.cjs.map +1 -0
- package/dist/auth/index.cjs +2 -2
- package/dist/calendar/index.cjs +106 -106
- package/dist/calls/index.cjs +61 -61
- package/dist/chat/index.cjs +23 -23
- package/dist/{chunk-AVXJSCRN.cjs → chunk-2EWDPIGO.cjs} +59 -7
- package/dist/chunk-2EWDPIGO.cjs.map +1 -0
- package/dist/{chunk-NGATAD62.cjs → chunk-2P7VH2SK.cjs} +3 -3
- package/dist/{chunk-NGATAD62.cjs.map → chunk-2P7VH2SK.cjs.map} +1 -1
- package/dist/{chunk-BAZZTZW5.cjs → chunk-2XHJVYNY.cjs} +6 -6
- package/dist/{chunk-BAZZTZW5.cjs.map → chunk-2XHJVYNY.cjs.map} +1 -1
- package/dist/{chunk-YPNGDJLX.cjs → chunk-35UL4GE7.cjs} +4 -4
- package/dist/{chunk-YPNGDJLX.cjs.map → chunk-35UL4GE7.cjs.map} +1 -1
- package/dist/{chunk-PFGRONAI.cjs → chunk-3GQQUR27.cjs} +4 -4
- package/dist/{chunk-PFGRONAI.cjs.map → chunk-3GQQUR27.cjs.map} +1 -1
- package/dist/{chunk-N362DFM4.cjs → chunk-3RAW2ZH5.cjs} +3 -3
- package/dist/{chunk-N362DFM4.cjs.map → chunk-3RAW2ZH5.cjs.map} +1 -1
- package/dist/{chunk-KL7R2IBY.cjs → chunk-4M3OIBIS.cjs} +2 -2
- package/dist/{chunk-KL7R2IBY.cjs.map → chunk-4M3OIBIS.cjs.map} +1 -1
- package/dist/{chunk-JUOGNUQR.cjs → chunk-4RR7ZZPD.cjs} +50 -8
- package/dist/chunk-4RR7ZZPD.cjs.map +1 -0
- package/dist/{chunk-LZZSCW7D.cjs → chunk-5HPUGSTJ.cjs} +18 -17
- package/dist/chunk-5HPUGSTJ.cjs.map +1 -0
- package/dist/{chunk-KJ65QZJI.cjs → chunk-6P4U63HO.cjs} +12 -12
- package/dist/{chunk-KJ65QZJI.cjs.map → chunk-6P4U63HO.cjs.map} +1 -1
- package/dist/{chunk-LBYJUPMV.cjs → chunk-73KNWWBW.cjs} +27 -27
- package/dist/{chunk-LBYJUPMV.cjs.map → chunk-73KNWWBW.cjs.map} +1 -1
- package/dist/{chunk-BCCMCR2U.cjs → chunk-7G64NNCC.cjs} +40 -40
- package/dist/{chunk-BCCMCR2U.cjs.map → chunk-7G64NNCC.cjs.map} +1 -1
- package/dist/{chunk-KZFE65SA.cjs → chunk-7UPEFZCV.cjs} +12 -12
- package/dist/{chunk-KZFE65SA.cjs.map → chunk-7UPEFZCV.cjs.map} +1 -1
- package/dist/{chunk-FQXZZXS2.cjs → chunk-AHUEBRLX.cjs} +4 -4
- package/dist/{chunk-FQXZZXS2.cjs.map → chunk-AHUEBRLX.cjs.map} +1 -1
- package/dist/{chunk-CZCSDIQY.cjs → chunk-BX3WRCXV.cjs} +4 -4
- package/dist/{chunk-CZCSDIQY.cjs.map → chunk-BX3WRCXV.cjs.map} +1 -1
- package/dist/{chunk-L2Q2UHRY.cjs → chunk-CULUTYOD.cjs} +4 -4
- package/dist/{chunk-L2Q2UHRY.cjs.map → chunk-CULUTYOD.cjs.map} +1 -1
- package/dist/{chunk-QA2MTHMN.cjs → chunk-CX4VR3ZT.cjs} +82 -82
- package/dist/{chunk-QA2MTHMN.cjs.map → chunk-CX4VR3ZT.cjs.map} +1 -1
- package/dist/{chunk-MSFWSDRS.cjs → chunk-CYWOL2LS.cjs} +3 -3
- package/dist/{chunk-MSFWSDRS.cjs.map → chunk-CYWOL2LS.cjs.map} +1 -1
- package/dist/{chunk-K4SFQPOF.cjs → chunk-D4SJT3NG.cjs} +3 -3
- package/dist/{chunk-K4SFQPOF.cjs.map → chunk-D4SJT3NG.cjs.map} +1 -1
- package/dist/{chunk-5NWTA4Y4.cjs → chunk-EG3DPKXM.cjs} +5 -5
- package/dist/{chunk-5NWTA4Y4.cjs.map → chunk-EG3DPKXM.cjs.map} +1 -1
- package/dist/{chunk-UYTFPMEA.cjs → chunk-G3MRW4WB.cjs} +8 -8
- package/dist/{chunk-UYTFPMEA.cjs.map → chunk-G3MRW4WB.cjs.map} +1 -1
- package/dist/{chunk-I3GFGJSX.cjs → chunk-GF6AYAMI.cjs} +7 -7
- package/dist/{chunk-I3GFGJSX.cjs.map → chunk-GF6AYAMI.cjs.map} +1 -1
- package/dist/{chunk-ST5EZE2O.cjs → chunk-GS2C25ID.cjs} +12 -12
- package/dist/{chunk-ST5EZE2O.cjs.map → chunk-GS2C25ID.cjs.map} +1 -1
- package/dist/{chunk-JB26AJ2L.cjs → chunk-HIG4DR7Z.cjs} +139 -48
- package/dist/chunk-HIG4DR7Z.cjs.map +1 -0
- package/dist/{chunk-KIXB7V7A.cjs → chunk-KCTQM3WO.cjs} +28 -28
- package/dist/{chunk-KIXB7V7A.cjs.map → chunk-KCTQM3WO.cjs.map} +1 -1
- package/dist/{chunk-IDV6I7GX.cjs → chunk-MTN6HOY3.cjs} +48 -45
- package/dist/chunk-MTN6HOY3.cjs.map +1 -0
- package/dist/{chunk-PA5CCOBU.cjs → chunk-NGM4HIPP.cjs} +140 -140
- package/dist/chunk-NGM4HIPP.cjs.map +1 -0
- package/dist/{chunk-7SJXYEZI.cjs → chunk-OAIOOVFN.cjs} +36 -36
- package/dist/chunk-OAIOOVFN.cjs.map +1 -0
- package/dist/{chunk-PBPO54KZ.cjs → chunk-QEMGGJB6.cjs} +97 -5
- package/dist/chunk-QEMGGJB6.cjs.map +1 -0
- package/dist/chunk-S3UNLRVM.cjs +87 -0
- package/dist/chunk-S3UNLRVM.cjs.map +1 -0
- package/dist/{chunk-PDDC5JOE.cjs → chunk-SGYURQ23.cjs} +10 -10
- package/dist/{chunk-PDDC5JOE.cjs.map → chunk-SGYURQ23.cjs.map} +1 -1
- package/dist/{chunk-RLRDQICM.cjs → chunk-SH7W4WVI.cjs} +103 -104
- package/dist/chunk-SH7W4WVI.cjs.map +1 -0
- package/dist/{chunk-C2VVBU7K.cjs → chunk-SLCH5JRI.cjs} +3 -3
- package/dist/{chunk-C2VVBU7K.cjs.map → chunk-SLCH5JRI.cjs.map} +1 -1
- package/dist/{chunk-7WENPOCP.cjs → chunk-TD5V5BZ3.cjs} +5 -5
- package/dist/{chunk-7WENPOCP.cjs.map → chunk-TD5V5BZ3.cjs.map} +1 -1
- package/dist/{chunk-UYBTXYYW.cjs → chunk-TU46WKTN.cjs} +15 -11
- package/dist/chunk-TU46WKTN.cjs.map +1 -0
- package/dist/{chunk-WKIESVWJ.cjs → chunk-UD3LPATQ.cjs} +6 -6
- package/dist/{chunk-WKIESVWJ.cjs.map → chunk-UD3LPATQ.cjs.map} +1 -1
- package/dist/{chunk-HJDMKDAE.cjs → chunk-UJHQ4DA4.cjs} +6 -6
- package/dist/{chunk-HJDMKDAE.cjs.map → chunk-UJHQ4DA4.cjs.map} +1 -1
- package/dist/{chunk-C4JRUDAY.cjs → chunk-UWJ63GLD.cjs} +10 -10
- package/dist/{chunk-C4JRUDAY.cjs.map → chunk-UWJ63GLD.cjs.map} +1 -1
- package/dist/{chunk-RI367OOL.cjs → chunk-V27WLYTG.cjs} +3 -3
- package/dist/{chunk-RI367OOL.cjs.map → chunk-V27WLYTG.cjs.map} +1 -1
- package/dist/{chunk-ZJ4P5QE5.cjs → chunk-VU2MESEX.cjs} +37 -37
- package/dist/{chunk-ZJ4P5QE5.cjs.map → chunk-VU2MESEX.cjs.map} +1 -1
- package/dist/{chunk-GQIH6ALC.cjs → chunk-WOVNXJK5.cjs} +741 -741
- package/dist/chunk-WOVNXJK5.cjs.map +1 -0
- package/dist/{chunk-4ZC6YLVQ.cjs → chunk-XTWHFHEK.cjs} +4 -4
- package/dist/{chunk-4ZC6YLVQ.cjs.map → chunk-XTWHFHEK.cjs.map} +1 -1
- package/dist/{chunk-FV6AKSI7.cjs → chunk-YHXJWYOF.cjs} +4 -4
- package/dist/{chunk-FV6AKSI7.cjs.map → chunk-YHXJWYOF.cjs.map} +1 -1
- package/dist/{chunk-GTWCDGXH.cjs → chunk-ZC6EPBVL.cjs} +4 -4
- package/dist/{chunk-GTWCDGXH.cjs.map → chunk-ZC6EPBVL.cjs.map} +1 -1
- package/dist/{chunk-Q6ASMKFN.cjs → chunk-ZC7X4ZIX.cjs} +10 -10
- package/dist/{chunk-Q6ASMKFN.cjs.map → chunk-ZC7X4ZIX.cjs.map} +1 -1
- package/dist/{chunk-JXKUWLFZ.cjs → chunk-ZPBTXRMG.cjs} +4 -4
- package/dist/{chunk-JXKUWLFZ.cjs.map → chunk-ZPBTXRMG.cjs.map} +1 -1
- package/dist/{chunk-LFO3HNBX.cjs → chunk-ZVQMCGUK.cjs} +20 -20
- package/dist/{chunk-LFO3HNBX.cjs.map → chunk-ZVQMCGUK.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +13 -13
- package/dist/connect/docx.cjs +24 -24
- package/dist/connect/index.cjs +1428 -1499
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +39 -39
- package/dist/connection/dashboards/DashboardPanel.js +1 -1
- package/dist/connection/dashboards/DashboardPanel.js.map +2 -2
- package/dist/connection/dashboards/PanelEditor.d.ts +4 -0
- package/dist/connection/dashboards/PanelEditor.js +45 -3
- package/dist/connection/dashboards/PanelEditor.js.map +2 -2
- package/dist/connection/export/ConnectedExportPanel.js +12 -7
- package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
- package/dist/connection/export/transfer-text.d.ts +5 -0
- package/dist/connection/export/transfer-text.js +6 -1
- package/dist/connection/export/transfer-text.js.map +2 -2
- package/dist/connection/pages/PageTransferDialog.js +19 -2
- package/dist/connection/pages/PageTransferDialog.js.map +2 -2
- package/dist/connection/workflows/WorkflowRunPage.js +4 -1
- package/dist/connection/workflows/WorkflowRunPage.js.map +2 -2
- package/dist/dashboards/ChartRenderer.js +3 -2
- package/dist/dashboards/ChartRenderer.js.map +2 -2
- package/dist/dashboards/RechartsRenderer.js +171 -2
- package/dist/dashboards/RechartsRenderer.js.map +2 -2
- package/dist/dashboards/chartModel.d.ts +52 -2
- package/dist/dashboards/chartModel.js +95 -3
- package/dist/dashboards/chartModel.js.map +2 -2
- package/dist/dashboards/index.cjs +774 -25
- package/dist/dashboards/index.cjs.map +1 -1
- package/dist/dashboards/index.d.ts +3 -2
- package/dist/dashboards/index.js +9 -2
- package/dist/dashboards/index.js.map +2 -2
- package/dist/dashboards/monitor/LogViewer.d.ts +47 -0
- package/dist/dashboards/monitor/LogViewer.js +279 -0
- package/dist/dashboards/monitor/LogViewer.js.map +7 -0
- package/dist/dashboards/monitor/RequestTimeline.d.ts +68 -0
- package/dist/dashboards/monitor/RequestTimeline.js +228 -0
- package/dist/dashboards/monitor/RequestTimeline.js.map +7 -0
- package/dist/dashboards/monitor/StackedBar.d.ts +41 -0
- package/dist/dashboards/monitor/StackedBar.js +131 -0
- package/dist/dashboards/monitor/StackedBar.js.map +7 -0
- package/dist/dashboards/monitor/TimeSeriesChart.d.ts +60 -0
- package/dist/dashboards/monitor/TimeSeriesChart.js +116 -0
- package/dist/dashboards/monitor/TimeSeriesChart.js.map +7 -0
- package/dist/dashboards/monitor/TimeSeriesDrawing.d.ts +14 -0
- package/dist/dashboards/monitor/TimeSeriesDrawing.js +173 -0
- package/dist/dashboards/monitor/TimeSeriesDrawing.js.map +7 -0
- package/dist/dashboards/monitor/index.d.ts +10 -0
- package/dist/dashboards/monitor/index.js +44 -0
- package/dist/dashboards/monitor/index.js.map +7 -0
- package/dist/dashboards/monitor/units.d.ts +30 -0
- package/dist/dashboards/monitor/units.js +85 -0
- package/dist/dashboards/monitor/units.js.map +7 -0
- package/dist/document-tools/index.cjs +21 -21
- package/dist/embed/index.cjs +44 -44
- package/dist/facts/index.cjs +65 -65
- package/dist/files/TransferParts.d.ts +18 -1
- package/dist/files/TransferParts.js +55 -3
- package/dist/files/TransferParts.js.map +2 -2
- package/dist/files/index.cjs +234 -230
- package/dist/files/index.d.ts +1 -1
- package/dist/files/index.js +2 -0
- package/dist/files/index.js.map +2 -2
- package/dist/home/index.cjs +24 -24
- package/dist/index.cjs +1934 -1934
- package/dist/pages/index.cjs +64 -49
- package/dist/pages/index.cjs.map +1 -1
- package/dist/settings/index.cjs +140 -140
- package/dist/shell/index.cjs +10 -10
- package/dist/site/index.cjs +5 -5
- package/dist/studio/index.cjs +30 -30
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/widgets.js +1 -1
- package/dist/studio/widgets.js.map +2 -2
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +55 -55
- package/dist/workspaces/index.cjs +9 -9
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/RechartsRenderer-EPVL5QZA.cjs +0 -186
- package/dist/RechartsRenderer-EPVL5QZA.cjs.map +0 -1
- package/dist/ai-HME7CNDE.cjs.map +0 -1
- package/dist/chunk-7SJXYEZI.cjs.map +0 -1
- package/dist/chunk-AVXJSCRN.cjs.map +0 -1
- package/dist/chunk-GQIH6ALC.cjs.map +0 -1
- package/dist/chunk-IDV6I7GX.cjs.map +0 -1
- package/dist/chunk-JB26AJ2L.cjs.map +0 -1
- package/dist/chunk-JUOGNUQR.cjs.map +0 -1
- package/dist/chunk-LZZSCW7D.cjs.map +0 -1
- package/dist/chunk-PA5CCOBU.cjs.map +0 -1
- package/dist/chunk-PBPO54KZ.cjs.map +0 -1
- package/dist/chunk-RLRDQICM.cjs.map +0 -1
- package/dist/chunk-UYBTXYYW.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
4
|
+
var chunkV27WLYTG_cjs = require('./chunk-V27WLYTG.cjs');
|
|
5
|
+
var chunkUD3LPATQ_cjs = require('./chunk-UD3LPATQ.cjs');
|
|
7
6
|
var chunkM55XUF4L_cjs = require('./chunk-M55XUF4L.cjs');
|
|
8
|
-
var
|
|
7
|
+
var chunkG3MRW4WB_cjs = require('./chunk-G3MRW4WB.cjs');
|
|
8
|
+
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
9
9
|
var chunkSQCCQU3K_cjs = require('./chunk-SQCCQU3K.cjs');
|
|
10
10
|
var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
|
|
11
11
|
var browser = require('@arbidocs/sdk/browser');
|
|
@@ -49,11 +49,11 @@ function useLaunchWorkflow({
|
|
|
49
49
|
} = {}) {
|
|
50
50
|
const { data: documents = [] } = react.useDocuments();
|
|
51
51
|
const { data: workspaceTags = [] } = react.useTags();
|
|
52
|
-
const tags = react$1.useMemo(() =>
|
|
52
|
+
const tags = react$1.useMemo(() => chunkG3MRW4WB_cjs.documentScopeLabels(workspaceTags), [workspaceTags]);
|
|
53
53
|
const createTag = react.useCreateTag();
|
|
54
54
|
const updateTag = react.useUpdateTag();
|
|
55
55
|
const generate = react.useGenerateDocTags();
|
|
56
|
-
const { create: createTask } =
|
|
56
|
+
const { create: createTask } = chunkV27WLYTG_cjs.useWorkflowTasks();
|
|
57
57
|
const applyModel = react.useApplyChatModel();
|
|
58
58
|
const session = react.useArbiSessionStore();
|
|
59
59
|
const { notify, openFiles, openNewConversation } = chunk46LX6EQT_cjs.useBlocksEnvironment();
|
|
@@ -61,7 +61,7 @@ function useLaunchWorkflow({
|
|
|
61
61
|
async ({ inputs, scope }) => {
|
|
62
62
|
const description = text(inputs, "description");
|
|
63
63
|
const name = text(inputs, "name") || chunkM55XUF4L_cjs.deriveAnnotationName(description);
|
|
64
|
-
const matching =
|
|
64
|
+
const matching = chunkG3MRW4WB_cjs.matchWorkflowScope(documents, scope);
|
|
65
65
|
if (!name || !description || matching.length === 0) return;
|
|
66
66
|
try {
|
|
67
67
|
const existing = tags.find((t) => t.name.toLowerCase() === name.toLowerCase());
|
|
@@ -161,7 +161,7 @@ function useLaunchWorkflow({
|
|
|
161
161
|
const binding = PROMPT_BINDINGS[workflow.id];
|
|
162
162
|
const prepare = () => {
|
|
163
163
|
if (binding?.attachScope !== false && !chunkSQCCQU3K_cjs.isEmptyWorkflowScope(scope)) {
|
|
164
|
-
const ids =
|
|
164
|
+
const ids = chunkG3MRW4WB_cjs.matchWorkflowScope(documents, scope).map((d) => d.external_id);
|
|
165
165
|
if (ids.length > 0) {
|
|
166
166
|
session.setConversationDocuments(
|
|
167
167
|
inPlace ? session.getState().conversationId ?? "new" : "new",
|
|
@@ -215,7 +215,7 @@ function ConnectedWorkflowStart({
|
|
|
215
215
|
);
|
|
216
216
|
const { openUpload } = chunk46LX6EQT_cjs.useBlocksEnvironment();
|
|
217
217
|
const { data: workspaceTags = [] } = react.useTags();
|
|
218
|
-
const tags = react$1.useMemo(() =>
|
|
218
|
+
const tags = react$1.useMemo(() => chunkG3MRW4WB_cjs.documentScopeLabels(workspaceTags), [workspaceTags]);
|
|
219
219
|
const fieldPlaceholder = react$1.useCallback(
|
|
220
220
|
(field, inputs, workflow) => {
|
|
221
221
|
if (workflow.id !== chunkM55XUF4L_cjs.ANNOTATE_ID || field.name !== "name") return void 0;
|
|
@@ -225,7 +225,7 @@ function ConnectedWorkflowStart({
|
|
|
225
225
|
[]
|
|
226
226
|
);
|
|
227
227
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
228
|
-
|
|
228
|
+
chunkUD3LPATQ_cjs.ConnectedWorkflowLauncher,
|
|
229
229
|
{
|
|
230
230
|
...rest,
|
|
231
231
|
workflows,
|
|
@@ -265,5 +265,5 @@ function ConnectedWorkflowStart({
|
|
|
265
265
|
exports.ConnectedWorkflowStart = ConnectedWorkflowStart;
|
|
266
266
|
exports.PROMPT_BINDINGS = PROMPT_BINDINGS;
|
|
267
267
|
exports.useLaunchWorkflow = useLaunchWorkflow;
|
|
268
|
-
//# sourceMappingURL=chunk-
|
|
269
|
-
//# sourceMappingURL=chunk-
|
|
268
|
+
//# sourceMappingURL=chunk-7UPEFZCV.cjs.map
|
|
269
|
+
//# sourceMappingURL=chunk-7UPEFZCV.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workflows/launch-bindings.ts","../src/connection/workflows/useLaunchWorkflow.ts","../src/connection/workflows/ConnectedWorkflowStart.tsx"],"names":["GENERATE_IMAGE_ID","buildRetrievalChunkTool","buildRetrievalFullContextTool","IMAGE_ASPECT_AUTO","useDocuments","useTags","useMemo","documentScopeLabels","useCreateTag","useUpdateTag","useGenerateDocTags","useWorkflowTasks","useApplyChatModel","useArbiSessionStore","useBlocksEnvironment","useCallback","deriveAnnotationName","matchWorkflowScope","ANNOTATE_ID","recordWorkflowUse","getDocumentTitle","composeWorkflowPrompt","isEmptyWorkflowScope","useHost","renderWorkflowIcon","jsx","ConnectedWorkflowLauncher","jsxs","TriangleAlert"],"mappings":";;;;;;;;;;;;;;;;AAwBA,IAAM,YAAA,GAAe,CAAC,MAAA,KAAqC;AACzD,EAAA,MAAM,QAAQ,MAAA,CAAO,UAAA;AACrB,EAAA,OAAO,KAAA,EAAO,aAAa,EAAC;AAC9B,CAAA;AAEO,IAAM,eAAA,GAAiD;AAAA,EAC5D,CAACA,mCAAiB,GAAG;AAAA,IACnB,WAAA,EAAa,KAAA;AAAA,IACb,KAAA,EAAO,CAAC,MAAA,KAAW;AACjB,MAAA,MAAM,cAAc,OAAO,MAAA,CAAO,YAAA,KAAiB,QAAA,GAAW,OAAO,YAAA,GAAe,EAAA;AACpF,MAAA,OAAO;AAAA,QACL,eAAA,EAAiBC,+BAAA,CAAwB,EAAE,CAAA;AAAA,QAC3C,sBAAA,EAAwBC,qCAAA,CAA8B,YAAA,CAAa,MAAM,CAAC,CAAA;AAAA,QAC1E,GAAI,WAAA,IAAe,WAAA,KAAgBC,mCAAA,GAC/B;AAAA,UACE,gBAAA,EAAkB;AAAA,YAChB,IAAA,EAAM,kBAAA;AAAA,YACN,WAAA,EAAa,kBAAA;AAAA,YACb,SAAA,EAAW,EAAE,YAAA,EAAc,WAAA,EAAY;AAAA,YACvC,gBAAgB;AAAC;AACnB,YAEF;AAAC,OACP;AAAA,IACF;AAAA;AAEJ;ACQA,IAAM,IAAA,GAAO,CAAC,MAAA,EAAwB,IAAA,KAAyB;AAC7D,EAAA,MAAM,CAAA,GAAI,OAAO,IAAI,CAAA;AACrB,EAAA,OAAO,OAAO,CAAA,KAAM,QAAA,GAAW,CAAA,CAAE,MAAK,GAAI,EAAA;AAC5C,CAAA;AAEO,SAAS,iBAAA,CAAkB;AAAA,EAChC,OAAA,EAAS,cAAA;AAAA,EACT;AACF,CAAA,GAA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A,EAAK,QAAA;AAAA,YACL,aAAA,EAAY,iCAAA;AAAA,YAEZ,QAAA,EAAA;AAAA,8BAAAF,cAAA,CAACG,yBAAA,EAAA,EAAc,WAAU,uCAAA,EAAwC,CAAA;AAAA,8CAChE,MAAA,EAAA,EAAK,QAAA,EAAA;AAAA,gBAAA,uBAAA;AAAA,gCACiBH,cAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,aAAA,EAAe,mBAAS,IAAA,EAAK,CAAA;AAAA,gBAAO;AAAA,eAAA,EAG3E;AAAA;AAAA;AAAA,SACF;AAAA,MAEJ;AAAA;AAAA,GACF;AAEJ","file":"chunk-KZFE65SA.cjs","sourcesContent":["/**\n * Host bindings of prompt workflows that need more than words on send. Bound by workflow id, the\n * same way the annotation operation is: blocks and the registry stay declarative, and the one\n * place that knows the wire shape is here.\n *\n * Generate image: the reference images and the aspect ratio ride structured tool arguments\n * (`retrieval_full_context` over every reference, `image_generation.aspect_ratio`), never the\n * prompt text: the image model does not reliably honour a shape or sources worded into the prompt,\n * and the references go to the separate image model in its own request, so (unlike the app's\n * one-at-a-time pinned document) several of them do not compound against the agent's context.\n */\n\nimport type { WorkflowInputs, WorkflowScope } from '../../agents/workflows/types'\nimport { buildRetrievalChunkTool, buildRetrievalFullContextTool } from '@arbidocs/sdk/browser'\nimport type { TurnTools } from '@arbidocs/react'\nimport { GENERATE_IMAGE_ID, IMAGE_ASPECT_AUTO } from '../../agents/workflows/catalogue/seed'\n\nexport interface PromptBinding {\n /** Attach the scoped files to the chat (default true). Off when the files are tool inputs. */\n attachScope: boolean\n /** Structured tools for the one send, from the form's inputs. */\n tools?: (inputs: WorkflowInputs) => TurnTools\n}\n\nconst referencesOf = (inputs: WorkflowInputs): string[] => {\n const value = inputs.references as WorkflowScope | undefined\n return value?.documents ?? []\n}\n\nexport const PROMPT_BINDINGS: Record<string, PromptBinding> = {\n [GENERATE_IMAGE_ID]: {\n attachScope: false,\n tools: (inputs) => {\n const aspectRatio = typeof inputs.aspect_ratio === 'string' ? inputs.aspect_ratio : ''\n return {\n retrieval_chunk: buildRetrievalChunkTool([]),\n retrieval_full_context: buildRetrievalFullContextTool(referencesOf(inputs)),\n ...(aspectRatio && aspectRatio !== IMAGE_ASPECT_AUTO\n ? {\n image_generation: {\n name: 'image_generation' as const,\n description: 'image generation',\n tool_args: { aspect_ratio: aspectRatio },\n tool_responses: {},\n },\n }\n : {}),\n }\n },\n },\n}\n","/**\n * The host side of the launch contract: `onLaunch({workflow, inputs, scope, agentId})`.\n *\n * Blocks only say WHAT to run; this performs it, so workspace isolation stays host-side:\n *\n * - prompt workflow, my assistant: open a fresh chat (or stay in this one when `inPlace`), scope\n * its documents, set the composed draft and ask for it to be sent (`autoSendDraft`). The host's\n * send waits for the new chat's documents to be seeded, so a scoped run is never sent with the\n * wrong files. Order matters: `openNewConversation` resets the draft, so it is set after it.\n * - prompt workflow, another agent: a run-now task assigned to that agent (the interactive chat\n * query has no agent parameter), created through the same path as the task composer.\n * - operation workflow (tier B): the handler bound to its id (annotation).\n * - a workflow's own model becomes the chat's (`useApplyChatModel`).\n *\n * The prompt is composed in exactly one place: `composeWorkflowPrompt(workflow, inputs)`.\n */\n\nimport {\n useApplyChatModel,\n useArbiSessionStore,\n useCreateTag,\n useDocuments,\n useGenerateDocTags,\n useTags,\n useUpdateTag,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport { useCallback, useMemo } from 'react'\nimport { composeWorkflowPrompt, isEmptyWorkflowScope } from '../../agents/workflows/workflow'\nimport { documentScopeLabels, matchWorkflowScope } from '../../agents/workflows/workspaceScope'\nimport {\n type WorkflowInputs,\n type WorkflowLanding,\n type WorkflowLaunch,\n} from '../../agents/workflows/types'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { PROMPT_BINDINGS } from './launch-bindings'\nimport { ANNOTATE_ID } from '../../agents/workflows/catalogue/seed'\nimport { useWorkflowTasks } from './useWorkflowTasks'\nimport { recordWorkflowUse } from '../../agents/workflows/catalogue/workflow-usage'\n\nexport interface UseLaunchWorkflowOptions {\n /**\n * Where launches from this surface land, over each workflow's own default. The empty chat and\n * the slash menu send into the conversation on screen (`current-chat`); everything else opens a\n * fresh one. A single launch can still override it (`WorkflowLaunch.landing`).\n */\n landing?: WorkflowLanding\n /**\n * A prompt run on the user's own assistant is sent here instead of through the session's draft:\n * the surface's own chat (`ChatPage`) or its own ask (the document ask). Everything else is the\n * same: the file scope, the workflow's model and its bound tools are set on the session in scope\n * (before a send in place, after a send that opens a fresh chat), so the turn carries them.\n */\n send?: (prompt: string) => void\n}\n\nconst text = (inputs: WorkflowInputs, name: string): string => {\n const v = inputs[name]\n return typeof v === 'string' ? v.trim() : ''\n}\n\nexport function useLaunchWorkflow({\n landing: surfaceLanding,\n send,\n}: UseLaunchWorkflowOptions = {}) {\n const { data: documents = [] } = useDocuments()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n const createTag = useCreateTag()\n const updateTag = useUpdateTag()\n const generate = useGenerateDocTags()\n const { create: createTask } = useWorkflowTasks()\n const applyModel = useApplyChatModel()\n const session = useArbiSessionStore()\n const { notify, openFiles, openNewConversation } = useBlocksEnvironment()\n\n /** Annotation: create (or reuse) the label, start the AI run, land on Files filtered to the set. */\n const annotate = useCallback(\n async ({ inputs, scope }: WorkflowLaunch) => {\n const description = text(inputs, 'description')\n const name = text(inputs, 'name') || deriveAnnotationName(description)\n const matching = matchWorkflowScope(documents, scope)\n if (!name || !description || matching.length === 0) return\n try {\n // A same-named label is reused rather than duplicated, the rule the Files page's\n // label-creation paths follow.\n const existing = tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n let tagId: string\n if (existing) {\n tagId = existing.external_id\n await updateTag.mutateAsync({\n tagId: tagId,\n change: { instruction: description },\n })\n } else {\n const created = await createTag.mutateAsync({\n name,\n tagType: { type: 'text', options: [] },\n shared: true,\n instruction: description,\n })\n const createdId = (created as { external_id?: string } | undefined)?.external_id\n if (!createdId) throw new Error('tag create returned no id')\n tagId = createdId\n }\n const docIds = matching.map((d) => d.external_id)\n // overwrite=true so a re-run on an existing field refreshes stale values, matching the\n // Files page's default review behaviour.\n await generate.mutateAsync({ tagIds: [tagId], docIds: docIds, overwrite: true })\n // Land on Files with those documents selected and the view narrowed to the annotated set\n // through the same tri-state quick filter the pickers write to. An empty scope selected\n // every file, so no filter is applied.\n const filters: Record<string, 'include'> = {}\n scope.folders.forEach((folder) => {\n filters[folder === '' ? 'folder:none' : `folder:${folder}`] = 'include'\n })\n scope.labels.forEach((labelId) => {\n filters[labelId] = 'include'\n })\n openFiles({ select: docIds, filters })\n } catch (error) {\n notify('Could not start the annotation', 'error')\n throw error\n }\n },\n [documents, tags, createTag, updateTag, generate, openFiles, notify]\n )\n\n return useCallback(\n async (launch: WorkflowLaunch) => {\n const { workflow, inputs, scope, agentId } = launch\n if (workflow.run.kind === 'operation') {\n if (workflow.id === ANNOTATE_ID) {\n await annotate(launch)\n recordWorkflowUse(workflow.id)\n return\n }\n throw new Error(`No host handler for workflow \"${workflow.id}\"`)\n }\n\n // Names for the wording: a `documents` field quotes the files it picked.\n const documentTitles = Object.fromEntries(\n documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])\n )\n const prompt = composeWorkflowPrompt(workflow, inputs, { documentTitles })\n if (!prompt) return\n recordWorkflowUse(workflow.id)\n\n if (agentId) {\n try {\n const created = await createTask({\n workflow,\n values: {\n assignee: 'agent',\n workflowId: workflow.id,\n inputs,\n when: 'now',\n runAt: '',\n rrule: '',\n timezone: 'UTC',\n eventKind: '',\n afterTaskId: '',\n parentTaskId: '',\n shared: true,\n description: '',\n dueAt: '',\n agentId,\n name: '',\n notifyOnComplete: true,\n access: 'ask_each_run',\n },\n })\n const ran = created.kind === 'work' ? created.ran : null\n const title = created.kind === 'work' ? created.task.title : created.workflow.name\n notify(\n ran === false\n ? 'Task created, but the run could not start'\n : `Running \\u201c${title ?? workflow.title}\\u201d`,\n ran === false ? 'warning' : 'success'\n )\n } catch (error) {\n notify(\n error instanceof Error && error.message.startsWith('Open a workspace')\n ? error.message\n : 'Could not start the run',\n 'error'\n )\n throw error\n }\n return\n }\n\n const landing = launch.landing ?? surfaceLanding ?? workflow.landing\n const inPlace = landing === 'current-chat'\n const binding = PROMPT_BINDINGS[workflow.id]\n /** The run's setup on the session in scope: its file scope, its model, its bound tools. */\n const prepare = () => {\n // Scope the chat to the chosen files when a restriction was made; otherwise the\n // workspace's usual \"all documents\" attachment (useDocumentAutoAdd) applies.\n if (binding?.attachScope !== false && !isEmptyWorkflowScope(scope)) {\n const ids = matchWorkflowScope(documents, scope).map((d) => d.external_id)\n if (ids.length > 0) {\n session.setConversationDocuments(\n inPlace ? (session.getState().conversationId ?? 'new') : 'new',\n ids.map((docId) => ({ docId, isPinned: false }))\n )\n }\n }\n if (workflow.model) void applyModel(workflow.model, `Workflow - ${workflow.title}`)\n // The tools ride the next send of the session in scope.\n session.setPendingTools(binding?.tools?.(inputs) ?? null)\n }\n // A fresh chat's reset clears the draft and the model, so the setup follows it. A surface\n // with its own send sends in its chat (set up first) or opens a fresh one (set up after).\n if (send) {\n if (inPlace) prepare()\n send(prompt)\n if (!inPlace) prepare()\n return\n }\n if (!inPlace) openNewConversation()\n prepare()\n session.setDraft(prompt)\n session.setAutoSendDraft(true)\n },\n [\n annotate,\n applyModel,\n createTask,\n documents,\n surfaceLanding,\n session,\n notify,\n openNewConversation,\n send,\n ]\n )\n}\n","/**\n * The workflow launcher, wired to run what it launches: `ConnectedWorkflowLauncher` (the\n * workspace's files behind scope and file fields, the user's agents behind \"Run as\") with the one\n * launch handler (`useLaunchWorkflow`), the host's upload dialog for adding files\n * (`environment.openUpload`), and the touches of the annotation operation (its derived name and\n * overwrite warning, \"Annotate N documents\").\n *\n * The dashboard's Start band, Files (\"Create new\") and, headless, the slash menu use it.\n */\n\nimport { useTags } from '@arbidocs/react'\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { TriangleAlert } from 'lucide-react'\nimport { documentScopeLabels } from '../../agents/workflows/workspaceScope'\nimport {\n type OnWorkflowLaunch,\n type WorkflowDefinition,\n type WorkflowField,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { ConnectedWorkflowLauncher } from '../ConnectedWorkflowLauncher'\nimport { type StartTile } from '../../home/StartTiles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { ANNOTATE_ID, renderWorkflowIcon } from '../../agents/workflows/catalogue/seed'\nimport { useLaunchWorkflow } from './useLaunchWorkflow'\n\n// The agent picker names the person it hands the work to: the default \"Run as\" / \"My assistant\"\n// copy did not say who an assistant is.\nconst AGENT_LABELS = { label: 'Who this runs for', myAssistant: 'Me (your own assistant)' }\n\nexport interface ConnectedWorkflowStartProps {\n workflows: WorkflowDefinition[]\n /** Which of `workflows` get a tile (a filtered or capped view). */\n tileWorkflows?: WorkflowDefinition[]\n /** Render the Start band (off when another surface opens the dialog). */\n showTiles?: boolean\n /** The band's layout: reflowing columns (default) or one sideways-scrolling row (a carousel). */\n tilesLayout?: 'grid' | 'carousel'\n caption?: string\n captionTestId?: string\n testId?: string\n /** Plain tiles appended to the band (e.g. the \"Create a file\" menu). */\n extraTiles?: StartTile[]\n /** Controlled open workflow id. */\n activeId?: string | null\n onActiveIdChange?: (id: string | null) => void\n initialInputsFor?: (workflow: WorkflowDefinition) => Partial<WorkflowInputs> | undefined\n /** Where launches land, over each workflow's default (`current-chat` = the chat on screen). */\n landing?: WorkflowLanding\n /** A prompt run's own send (a chat that is not the session's conversation). See `useLaunchWorkflow`. */\n send?: (prompt: string) => void\n /**\n * Run a launch here instead of the usual way (`useLaunchWorkflow`): a surface that wants the\n * result itself, e.g. the presentation, which adds a generated image to its clips. The dialog\n * shows it running until it resolves, closes then, and stays open if it throws.\n */\n onLaunch?: OnWorkflowLaunch\n /**\n * Files added from a `documents` field are uploaded right in the field instead of through the\n * host's upload dialog: for a dialog in a popped-out window, where the host's dialog would open\n * in the app's window, out of sight, and block this one.\n */\n uploadInPlace?: boolean\n /** The host's own \"Add\" control, offered when a workflow needs files and there are none. */\n addFilesAction?: ReactNode\n tileTestId?: (workflow: WorkflowDefinition) => string | undefined\n disabledReason?: (workflow: WorkflowDefinition) => string | undefined\n}\n\nexport function ConnectedWorkflowStart({\n workflows,\n landing,\n send,\n addFilesAction,\n onLaunch: launchHere,\n uploadInPlace = false,\n ...rest\n}: ConnectedWorkflowStartProps) {\n const launchUsually = useLaunchWorkflow({ landing, send })\n const onLaunch = launchHere ?? launchUsually\n // The host's icons first (a skill pack names its own), then the kit's, then the skill icon.\n const hostIcon = useHost().workflows?.renderIcon\n const renderIcon = useCallback(\n (key: string) => hostIcon?.(key) ?? renderWorkflowIcon(key) ?? renderWorkflowIcon('skill'),\n [hostIcon]\n )\n const { openUpload } = useBlocksEnvironment()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n\n // The annotation's name is optional: left blank it is taken from the question, which the\n // field's placeholder shows before anything runs.\n const fieldPlaceholder = useCallback(\n (field: WorkflowField, inputs: WorkflowInputs, workflow: WorkflowDefinition) => {\n if (workflow.id !== ANNOTATE_ID || field.name !== 'name') return undefined\n const derived = deriveAnnotationName(String(inputs.description ?? ''))\n return derived ? `Otherwise “${derived}”` : 'Taken from the description'\n },\n []\n )\n\n return (\n <ConnectedWorkflowLauncher\n {...rest}\n workflows={workflows}\n onLaunch={onLaunch}\n renderIcon={renderIcon}\n onAddFiles={uploadInPlace ? undefined : openUpload}\n agentLabels={AGENT_LABELS}\n addFilesAction={addFilesAction}\n fieldPlaceholder={fieldPlaceholder}\n submitLabel={({ workflow, matchedCount }) =>\n workflow.id === ANNOTATE_ID && matchedCount !== null\n ? `Annotate ${matchedCount} document${matchedCount !== 1 ? 's' : ''}`\n : undefined\n }\n renderNotice={({ workflow, inputs }) => {\n if (workflow.id !== ANNOTATE_ID) return null\n // A same-named label is reused: warn that this overwrites its stored description and the\n // cell values for the selected documents.\n const name =\n String(inputs.name ?? '').trim() || deriveAnnotationName(String(inputs.description ?? ''))\n const existing = name\n ? tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n : undefined\n if (!existing) return null\n return (\n <div\n className=\"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200\"\n role=\"status\"\n data-testid=\"workflow-existing-label-warning\"\n >\n <TriangleAlert className=\"mt-0.5 size-4 shrink-0 text-amber-500\" />\n <span>\n An annotation called <span className=\"font-medium\">{existing.name}</span> already\n exists. Annotating will overwrite its description and the current cell values for the\n selected files.\n </span>\n </div>\n )\n }}\n />\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/workflows/launch-bindings.ts","../src/connection/workflows/useLaunchWorkflow.ts","../src/connection/workflows/ConnectedWorkflowStart.tsx"],"names":["GENERATE_IMAGE_ID","buildRetrievalChunkTool","buildRetrievalFullContextTool","IMAGE_ASPECT_AUTO","useDocuments","useTags","useMemo","documentScopeLabels","useCreateTag","useUpdateTag","useGenerateDocTags","useWorkflowTasks","useApplyChatModel","useArbiSessionStore","useBlocksEnvironment","useCallback","deriveAnnotationName","matchWorkflowScope","ANNOTATE_ID","recordWorkflowUse","getDocumentTitle","composeWorkflowPrompt","isEmptyWorkflowScope","useHost","renderWorkflowIcon","jsx","ConnectedWorkflowLauncher","jsxs","TriangleAlert"],"mappings":";;;;;;;;;;;;;;;;AAwBA,IAAM,YAAA,GAAe,CAAC,MAAA,KAAqC;AACzD,EAAA,MAAM,QAAQ,MAAA,CAAO,UAAA;AACrB,EAAA,OAAO,KAAA,EAAO,aAAa,EAAC;AAC9B,CAAA;AAEO,IAAM,eAAA,GAAiD;AAAA,EAC5D,CAACA,mCAAiB,GAAG;AAAA,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GACF;AAEJ","file":"chunk-7UPEFZCV.cjs","sourcesContent":["/**\n * Host bindings of prompt workflows that need more than words on send. Bound by workflow id, the\n * same way the annotation operation is: blocks and the registry stay declarative, and the one\n * place that knows the wire shape is here.\n *\n * Generate image: the reference images and the aspect ratio ride structured tool arguments\n * (`retrieval_full_context` over every reference, `image_generation.aspect_ratio`), never the\n * prompt text: the image model does not reliably honour a shape or sources worded into the prompt,\n * and the references go to the separate image model in its own request, so (unlike the app's\n * one-at-a-time pinned document) several of them do not compound against the agent's context.\n */\n\nimport type { WorkflowInputs, WorkflowScope } from '../../agents/workflows/types'\nimport { buildRetrievalChunkTool, buildRetrievalFullContextTool } from '@arbidocs/sdk/browser'\nimport type { TurnTools } from '@arbidocs/react'\nimport { GENERATE_IMAGE_ID, IMAGE_ASPECT_AUTO } from '../../agents/workflows/catalogue/seed'\n\nexport interface PromptBinding {\n /** Attach the scoped files to the chat (default true). Off when the files are tool inputs. */\n attachScope: boolean\n /** Structured tools for the one send, from the form's inputs. */\n tools?: (inputs: WorkflowInputs) => TurnTools\n}\n\nconst referencesOf = (inputs: WorkflowInputs): string[] => {\n const value = inputs.references as WorkflowScope | undefined\n return value?.documents ?? []\n}\n\nexport const PROMPT_BINDINGS: Record<string, PromptBinding> = {\n [GENERATE_IMAGE_ID]: {\n attachScope: false,\n tools: (inputs) => {\n const aspectRatio = typeof inputs.aspect_ratio === 'string' ? inputs.aspect_ratio : ''\n return {\n retrieval_chunk: buildRetrievalChunkTool([]),\n retrieval_full_context: buildRetrievalFullContextTool(referencesOf(inputs)),\n ...(aspectRatio && aspectRatio !== IMAGE_ASPECT_AUTO\n ? {\n image_generation: {\n name: 'image_generation' as const,\n description: 'image generation',\n tool_args: { aspect_ratio: aspectRatio },\n tool_responses: {},\n },\n }\n : {}),\n }\n },\n },\n}\n","/**\n * The host side of the launch contract: `onLaunch({workflow, inputs, scope, agentId})`.\n *\n * Blocks only say WHAT to run; this performs it, so workspace isolation stays host-side:\n *\n * - prompt workflow, my assistant: open a fresh chat (or stay in this one when `inPlace`), scope\n * its documents, set the composed draft and ask for it to be sent (`autoSendDraft`). The host's\n * send waits for the new chat's documents to be seeded, so a scoped run is never sent with the\n * wrong files. Order matters: `openNewConversation` resets the draft, so it is set after it.\n * - prompt workflow, another agent: a run-now task assigned to that agent (the interactive chat\n * query has no agent parameter), created through the same path as the task composer.\n * - operation workflow (tier B): the handler bound to its id (annotation).\n * - a workflow's own model becomes the chat's (`useApplyChatModel`).\n *\n * The prompt is composed in exactly one place: `composeWorkflowPrompt(workflow, inputs)`.\n */\n\nimport {\n useApplyChatModel,\n useArbiSessionStore,\n useCreateTag,\n useDocuments,\n useGenerateDocTags,\n useTags,\n useUpdateTag,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport { useCallback, useMemo } from 'react'\nimport { composeWorkflowPrompt, isEmptyWorkflowScope } from '../../agents/workflows/workflow'\nimport { documentScopeLabels, matchWorkflowScope } from '../../agents/workflows/workspaceScope'\nimport {\n type WorkflowInputs,\n type WorkflowLanding,\n type WorkflowLaunch,\n} from '../../agents/workflows/types'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { PROMPT_BINDINGS } from './launch-bindings'\nimport { ANNOTATE_ID } from '../../agents/workflows/catalogue/seed'\nimport { useWorkflowTasks } from './useWorkflowTasks'\nimport { recordWorkflowUse } from '../../agents/workflows/catalogue/workflow-usage'\n\nexport interface UseLaunchWorkflowOptions {\n /**\n * Where launches from this surface land, over each workflow's own default. The empty chat and\n * the slash menu send into the conversation on screen (`current-chat`); everything else opens a\n * fresh one. A single launch can still override it (`WorkflowLaunch.landing`).\n */\n landing?: WorkflowLanding\n /**\n * A prompt run on the user's own assistant is sent here instead of through the session's draft:\n * the surface's own chat (`ChatPage`) or its own ask (the document ask). Everything else is the\n * same: the file scope, the workflow's model and its bound tools are set on the session in scope\n * (before a send in place, after a send that opens a fresh chat), so the turn carries them.\n */\n send?: (prompt: string) => void\n}\n\nconst text = (inputs: WorkflowInputs, name: string): string => {\n const v = inputs[name]\n return typeof v === 'string' ? v.trim() : ''\n}\n\nexport function useLaunchWorkflow({\n landing: surfaceLanding,\n send,\n}: UseLaunchWorkflowOptions = {}) {\n const { data: documents = [] } = useDocuments()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n const createTag = useCreateTag()\n const updateTag = useUpdateTag()\n const generate = useGenerateDocTags()\n const { create: createTask } = useWorkflowTasks()\n const applyModel = useApplyChatModel()\n const session = useArbiSessionStore()\n const { notify, openFiles, openNewConversation } = useBlocksEnvironment()\n\n /** Annotation: create (or reuse) the label, start the AI run, land on Files filtered to the set. */\n const annotate = useCallback(\n async ({ inputs, scope }: WorkflowLaunch) => {\n const description = text(inputs, 'description')\n const name = text(inputs, 'name') || deriveAnnotationName(description)\n const matching = matchWorkflowScope(documents, scope)\n if (!name || !description || matching.length === 0) return\n try {\n // A same-named label is reused rather than duplicated, the rule the Files page's\n // label-creation paths follow.\n const existing = tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n let tagId: string\n if (existing) {\n tagId = existing.external_id\n await updateTag.mutateAsync({\n tagId: tagId,\n change: { instruction: description },\n })\n } else {\n const created = await createTag.mutateAsync({\n name,\n tagType: { type: 'text', options: [] },\n shared: true,\n instruction: description,\n })\n const createdId = (created as { external_id?: string } | undefined)?.external_id\n if (!createdId) throw new Error('tag create returned no id')\n tagId = createdId\n }\n const docIds = matching.map((d) => d.external_id)\n // overwrite=true so a re-run on an existing field refreshes stale values, matching the\n // Files page's default review behaviour.\n await generate.mutateAsync({ tagIds: [tagId], docIds: docIds, overwrite: true })\n // Land on Files with those documents selected and the view narrowed to the annotated set\n // through the same tri-state quick filter the pickers write to. An empty scope selected\n // every file, so no filter is applied.\n const filters: Record<string, 'include'> = {}\n scope.folders.forEach((folder) => {\n filters[folder === '' ? 'folder:none' : `folder:${folder}`] = 'include'\n })\n scope.labels.forEach((labelId) => {\n filters[labelId] = 'include'\n })\n openFiles({ select: docIds, filters })\n } catch (error) {\n notify('Could not start the annotation', 'error')\n throw error\n }\n },\n [documents, tags, createTag, updateTag, generate, openFiles, notify]\n )\n\n return useCallback(\n async (launch: WorkflowLaunch) => {\n const { workflow, inputs, scope, agentId } = launch\n if (workflow.run.kind === 'operation') {\n if (workflow.id === ANNOTATE_ID) {\n await annotate(launch)\n recordWorkflowUse(workflow.id)\n return\n }\n throw new Error(`No host handler for workflow \"${workflow.id}\"`)\n }\n\n // Names for the wording: a `documents` field quotes the files it picked.\n const documentTitles = Object.fromEntries(\n documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])\n )\n const prompt = composeWorkflowPrompt(workflow, inputs, { documentTitles })\n if (!prompt) return\n recordWorkflowUse(workflow.id)\n\n if (agentId) {\n try {\n const created = await createTask({\n workflow,\n values: {\n assignee: 'agent',\n workflowId: workflow.id,\n inputs,\n when: 'now',\n runAt: '',\n rrule: '',\n timezone: 'UTC',\n eventKind: '',\n afterTaskId: '',\n parentTaskId: '',\n shared: true,\n description: '',\n dueAt: '',\n agentId,\n name: '',\n notifyOnComplete: true,\n access: 'ask_each_run',\n },\n })\n const ran = created.kind === 'work' ? created.ran : null\n const title = created.kind === 'work' ? created.task.title : created.workflow.name\n notify(\n ran === false\n ? 'Task created, but the run could not start'\n : `Running \\u201c${title ?? workflow.title}\\u201d`,\n ran === false ? 'warning' : 'success'\n )\n } catch (error) {\n notify(\n error instanceof Error && error.message.startsWith('Open a workspace')\n ? error.message\n : 'Could not start the run',\n 'error'\n )\n throw error\n }\n return\n }\n\n const landing = launch.landing ?? surfaceLanding ?? workflow.landing\n const inPlace = landing === 'current-chat'\n const binding = PROMPT_BINDINGS[workflow.id]\n /** The run's setup on the session in scope: its file scope, its model, its bound tools. */\n const prepare = () => {\n // Scope the chat to the chosen files when a restriction was made; otherwise the\n // workspace's usual \"all documents\" attachment (useDocumentAutoAdd) applies.\n if (binding?.attachScope !== false && !isEmptyWorkflowScope(scope)) {\n const ids = matchWorkflowScope(documents, scope).map((d) => d.external_id)\n if (ids.length > 0) {\n session.setConversationDocuments(\n inPlace ? (session.getState().conversationId ?? 'new') : 'new',\n ids.map((docId) => ({ docId, isPinned: false }))\n )\n }\n }\n if (workflow.model) void applyModel(workflow.model, `Workflow - ${workflow.title}`)\n // The tools ride the next send of the session in scope.\n session.setPendingTools(binding?.tools?.(inputs) ?? null)\n }\n // A fresh chat's reset clears the draft and the model, so the setup follows it. A surface\n // with its own send sends in its chat (set up first) or opens a fresh one (set up after).\n if (send) {\n if (inPlace) prepare()\n send(prompt)\n if (!inPlace) prepare()\n return\n }\n if (!inPlace) openNewConversation()\n prepare()\n session.setDraft(prompt)\n session.setAutoSendDraft(true)\n },\n [\n annotate,\n applyModel,\n createTask,\n documents,\n surfaceLanding,\n session,\n notify,\n openNewConversation,\n send,\n ]\n )\n}\n","/**\n * The workflow launcher, wired to run what it launches: `ConnectedWorkflowLauncher` (the\n * workspace's files behind scope and file fields, the user's agents behind \"Run as\") with the one\n * launch handler (`useLaunchWorkflow`), the host's upload dialog for adding files\n * (`environment.openUpload`), and the touches of the annotation operation (its derived name and\n * overwrite warning, \"Annotate N documents\").\n *\n * The dashboard's Start band, Files (\"Create new\") and, headless, the slash menu use it.\n */\n\nimport { useTags } from '@arbidocs/react'\nimport { useCallback, useMemo, type ReactNode } from 'react'\nimport { TriangleAlert } from 'lucide-react'\nimport { documentScopeLabels } from '../../agents/workflows/workspaceScope'\nimport {\n type OnWorkflowLaunch,\n type WorkflowDefinition,\n type WorkflowField,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { ConnectedWorkflowLauncher } from '../ConnectedWorkflowLauncher'\nimport { type StartTile } from '../../home/StartTiles'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useHost } from '../../provider/host'\nimport { deriveAnnotationName } from '../../agents/workflows/catalogue/annotation-name'\nimport { ANNOTATE_ID, renderWorkflowIcon } from '../../agents/workflows/catalogue/seed'\nimport { useLaunchWorkflow } from './useLaunchWorkflow'\n\n// The agent picker names the person it hands the work to: the default \"Run as\" / \"My assistant\"\n// copy did not say who an assistant is.\nconst AGENT_LABELS = { label: 'Who this runs for', myAssistant: 'Me (your own assistant)' }\n\nexport interface ConnectedWorkflowStartProps {\n workflows: WorkflowDefinition[]\n /** Which of `workflows` get a tile (a filtered or capped view). */\n tileWorkflows?: WorkflowDefinition[]\n /** Render the Start band (off when another surface opens the dialog). */\n showTiles?: boolean\n /** The band's layout: reflowing columns (default) or one sideways-scrolling row (a carousel). */\n tilesLayout?: 'grid' | 'carousel'\n caption?: string\n captionTestId?: string\n testId?: string\n /** Plain tiles appended to the band (e.g. the \"Create a file\" menu). */\n extraTiles?: StartTile[]\n /** Controlled open workflow id. */\n activeId?: string | null\n onActiveIdChange?: (id: string | null) => void\n initialInputsFor?: (workflow: WorkflowDefinition) => Partial<WorkflowInputs> | undefined\n /** Where launches land, over each workflow's default (`current-chat` = the chat on screen). */\n landing?: WorkflowLanding\n /** A prompt run's own send (a chat that is not the session's conversation). See `useLaunchWorkflow`. */\n send?: (prompt: string) => void\n /**\n * Run a launch here instead of the usual way (`useLaunchWorkflow`): a surface that wants the\n * result itself, e.g. the presentation, which adds a generated image to its clips. The dialog\n * shows it running until it resolves, closes then, and stays open if it throws.\n */\n onLaunch?: OnWorkflowLaunch\n /**\n * Files added from a `documents` field are uploaded right in the field instead of through the\n * host's upload dialog: for a dialog in a popped-out window, where the host's dialog would open\n * in the app's window, out of sight, and block this one.\n */\n uploadInPlace?: boolean\n /** The host's own \"Add\" control, offered when a workflow needs files and there are none. */\n addFilesAction?: ReactNode\n tileTestId?: (workflow: WorkflowDefinition) => string | undefined\n disabledReason?: (workflow: WorkflowDefinition) => string | undefined\n}\n\nexport function ConnectedWorkflowStart({\n workflows,\n landing,\n send,\n addFilesAction,\n onLaunch: launchHere,\n uploadInPlace = false,\n ...rest\n}: ConnectedWorkflowStartProps) {\n const launchUsually = useLaunchWorkflow({ landing, send })\n const onLaunch = launchHere ?? launchUsually\n // The host's icons first (a skill pack names its own), then the kit's, then the skill icon.\n const hostIcon = useHost().workflows?.renderIcon\n const renderIcon = useCallback(\n (key: string) => hostIcon?.(key) ?? renderWorkflowIcon(key) ?? renderWorkflowIcon('skill'),\n [hostIcon]\n )\n const { openUpload } = useBlocksEnvironment()\n const { data: workspaceTags = [] } = useTags()\n const tags = useMemo(() => documentScopeLabels(workspaceTags), [workspaceTags])\n\n // The annotation's name is optional: left blank it is taken from the question, which the\n // field's placeholder shows before anything runs.\n const fieldPlaceholder = useCallback(\n (field: WorkflowField, inputs: WorkflowInputs, workflow: WorkflowDefinition) => {\n if (workflow.id !== ANNOTATE_ID || field.name !== 'name') return undefined\n const derived = deriveAnnotationName(String(inputs.description ?? ''))\n return derived ? `Otherwise “${derived}”` : 'Taken from the description'\n },\n []\n )\n\n return (\n <ConnectedWorkflowLauncher\n {...rest}\n workflows={workflows}\n onLaunch={onLaunch}\n renderIcon={renderIcon}\n onAddFiles={uploadInPlace ? undefined : openUpload}\n agentLabels={AGENT_LABELS}\n addFilesAction={addFilesAction}\n fieldPlaceholder={fieldPlaceholder}\n submitLabel={({ workflow, matchedCount }) =>\n workflow.id === ANNOTATE_ID && matchedCount !== null\n ? `Annotate ${matchedCount} document${matchedCount !== 1 ? 's' : ''}`\n : undefined\n }\n renderNotice={({ workflow, inputs }) => {\n if (workflow.id !== ANNOTATE_ID) return null\n // A same-named label is reused: warn that this overwrites its stored description and the\n // cell values for the selected documents.\n const name =\n String(inputs.name ?? '').trim() || deriveAnnotationName(String(inputs.description ?? ''))\n const existing = name\n ? tags.find((t) => t.name.toLowerCase() === name.toLowerCase())\n : undefined\n if (!existing) return null\n return (\n <div\n className=\"flex items-start gap-2 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm text-amber-800 dark:text-amber-200\"\n role=\"status\"\n data-testid=\"workflow-existing-label-warning\"\n >\n <TriangleAlert className=\"mt-0.5 size-4 shrink-0 text-amber-500\" />\n <span>\n An annotation called <span className=\"font-medium\">{existing.name}</span> already\n exists. Annotating will overwrite its description and the current cell values for the\n selected files.\n </span>\n </div>\n )\n }}\n />\n )\n}\n"]}
|
|
@@ -6,11 +6,11 @@ var chunkNZNBJF3M_cjs = require('./chunk-NZNBJF3M.cjs');
|
|
|
6
6
|
var chunkNWNVWO6L_cjs = require('./chunk-NWNVWO6L.cjs');
|
|
7
7
|
var chunkOEJQFPWO_cjs = require('./chunk-OEJQFPWO.cjs');
|
|
8
8
|
var chunkII2OEXHW_cjs = require('./chunk-II2OEXHW.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkDKY67DA6_cjs = require('./chunk-DKY67DA6.cjs');
|
|
10
10
|
var chunkM74FWYNL_cjs = require('./chunk-M74FWYNL.cjs');
|
|
11
|
+
var chunkSJSGSHIT_cjs = require('./chunk-SJSGSHIT.cjs');
|
|
11
12
|
var chunkUDSHVNU3_cjs = require('./chunk-UDSHVNU3.cjs');
|
|
12
13
|
var chunkIPSHAMO2_cjs = require('./chunk-IPSHAMO2.cjs');
|
|
13
|
-
var chunkDKY67DA6_cjs = require('./chunk-DKY67DA6.cjs');
|
|
14
14
|
var chunkCVPV4I7Z_cjs = require('./chunk-CVPV4I7Z.cjs');
|
|
15
15
|
var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
|
|
16
16
|
var react = require('react');
|
|
@@ -4939,5 +4939,5 @@ exports.callsSwitchState = callsSwitchState;
|
|
|
4939
4939
|
exports.formatErrorReport = formatErrorReport;
|
|
4940
4940
|
exports.resolveSettingsSection = resolveSettingsSection;
|
|
4941
4941
|
exports.serverConnectionView = serverConnectionView;
|
|
4942
|
-
//# sourceMappingURL=chunk-
|
|
4943
|
-
//# sourceMappingURL=chunk-
|
|
4942
|
+
//# sourceMappingURL=chunk-AHUEBRLX.cjs.map
|
|
4943
|
+
//# sourceMappingURL=chunk-AHUEBRLX.cjs.map
|