@arbidocs/blocks 0.5.155 → 0.5.157
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-SD4DKTMX.cjs → ConnectedCallDock-TGI43VKB.cjs} +15 -15
- package/dist/{ConnectedCallDock-SD4DKTMX.cjs.map → ConnectedCallDock-TGI43VKB.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-2FLGH3JB.cjs → ConnectedCallRoom-FBTDSG3N.cjs} +14 -14
- package/dist/{ConnectedCallRoom-2FLGH3JB.cjs.map → ConnectedCallRoom-FBTDSG3N.cjs.map} +1 -1
- package/dist/{ConnectedMailInviteCard-VMFTQ5PW.cjs → ConnectedMailInviteCard-LV2VARX3.cjs} +5 -5
- package/dist/{ConnectedMailInviteCard-VMFTQ5PW.cjs.map → ConnectedMailInviteCard-LV2VARX3.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-2DAQX5GX.cjs → ConnectedNativeDocxComparison-7VD4ZIHO.cjs} +22 -22
- package/dist/{ConnectedNativeDocxComparison-2DAQX5GX.cjs.map → ConnectedNativeDocxComparison-7VD4ZIHO.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-J42JPUVR.cjs → ConnectedPresentation-FDYO2TSX.cjs} +18 -18
- package/dist/{ConnectedPresentation-J42JPUVR.cjs.map → ConnectedPresentation-FDYO2TSX.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-LB5B7OXR.cjs → ConnectedProductionSetDialog-4N7R7SFZ.cjs} +4 -4
- package/dist/{ConnectedProductionSetDialog-LB5B7OXR.cjs.map → ConnectedProductionSetDialog-4N7R7SFZ.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-BYS7HFNK.cjs → ConnectedSlidesTab-NM2UEE77.cjs} +16 -16
- package/dist/{ConnectedSlidesTab-BYS7HFNK.cjs.map → ConnectedSlidesTab-NM2UEE77.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-LTYB62VM.cjs → ConnectedStreamedWordArtifact-ISLZLV4V.cjs} +22 -22
- package/dist/{ConnectedStreamedWordArtifact-LTYB62VM.cjs.map → ConnectedStreamedWordArtifact-ISLZLV4V.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-5AP55NGZ.cjs → DocumentReviewCard-5CVWGOZQ.cjs} +28 -28
- package/dist/{DocumentReviewCard-5AP55NGZ.cjs.map → DocumentReviewCard-5CVWGOZQ.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-SHWCE3UN.cjs → FilesViewerDialog-PXUXYTPK.cjs} +52 -52
- package/dist/{FilesViewerDialog-SHWCE3UN.cjs.map → FilesViewerDialog-PXUXYTPK.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-S4IBYQVF.cjs → WorkspaceTableView-HR4KTFSX.cjs} +14 -14
- package/dist/{WorkspaceTableView-S4IBYQVF.cjs.map → WorkspaceTableView-HR4KTFSX.cjs.map} +1 -1
- package/dist/agents/index.cjs +290 -290
- package/dist/{ai-QFY4LYQZ.cjs → ai-HME7CNDE.cjs} +24 -24
- package/dist/ai-HME7CNDE.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-BTQ7IAOH.cjs → chunk-4ZC6YLVQ.cjs} +4 -4
- package/dist/{chunk-BTQ7IAOH.cjs.map → chunk-4ZC6YLVQ.cjs.map} +1 -1
- package/dist/{chunk-EG3DPKXM.cjs → chunk-5NWTA4Y4.cjs} +5 -5
- package/dist/{chunk-EG3DPKXM.cjs.map → chunk-5NWTA4Y4.cjs.map} +1 -1
- package/dist/{chunk-OAIOOVFN.cjs → chunk-7SJXYEZI.cjs} +36 -36
- package/dist/chunk-7SJXYEZI.cjs.map +1 -0
- package/dist/{chunk-TD5V5BZ3.cjs → chunk-7WENPOCP.cjs} +5 -5
- package/dist/{chunk-TD5V5BZ3.cjs.map → chunk-7WENPOCP.cjs.map} +1 -1
- package/dist/{chunk-JCFXS336.cjs → chunk-AVXJSCRN.cjs} +11 -11
- package/dist/chunk-AVXJSCRN.cjs.map +1 -0
- package/dist/{chunk-2XHJVYNY.cjs → chunk-BAZZTZW5.cjs} +6 -6
- package/dist/{chunk-2XHJVYNY.cjs.map → chunk-BAZZTZW5.cjs.map} +1 -1
- package/dist/{chunk-Y2Z5UHHV.cjs → chunk-BCCMCR2U.cjs} +40 -40
- package/dist/{chunk-Y2Z5UHHV.cjs.map → chunk-BCCMCR2U.cjs.map} +1 -1
- package/dist/{chunk-SLCH5JRI.cjs → chunk-C2VVBU7K.cjs} +3 -3
- package/dist/{chunk-SLCH5JRI.cjs.map → chunk-C2VVBU7K.cjs.map} +1 -1
- package/dist/{chunk-4UDGCXUR.cjs → chunk-C4JRUDAY.cjs} +10 -10
- package/dist/{chunk-4UDGCXUR.cjs.map → chunk-C4JRUDAY.cjs.map} +1 -1
- package/dist/{chunk-QEH375MU.cjs → chunk-CZCSDIQY.cjs} +4 -4
- package/dist/{chunk-QEH375MU.cjs.map → chunk-CZCSDIQY.cjs.map} +1 -1
- package/dist/{chunk-AHUEBRLX.cjs → chunk-FQXZZXS2.cjs} +4 -4
- package/dist/{chunk-AHUEBRLX.cjs.map → chunk-FQXZZXS2.cjs.map} +1 -1
- package/dist/{chunk-TN3UP3CI.cjs → chunk-FV6AKSI7.cjs} +8 -8
- package/dist/{chunk-TN3UP3CI.cjs.map → chunk-FV6AKSI7.cjs.map} +1 -1
- package/dist/{chunk-WOVNXJK5.cjs → chunk-GQIH6ALC.cjs} +772 -772
- package/dist/chunk-GQIH6ALC.cjs.map +1 -0
- package/dist/{chunk-TSAZWUPZ.cjs → chunk-GTWCDGXH.cjs} +4 -4
- package/dist/{chunk-TSAZWUPZ.cjs.map → chunk-GTWCDGXH.cjs.map} +1 -1
- package/dist/{chunk-UJHQ4DA4.cjs → chunk-HJDMKDAE.cjs} +6 -6
- package/dist/{chunk-UJHQ4DA4.cjs.map → chunk-HJDMKDAE.cjs.map} +1 -1
- package/dist/{chunk-GF6AYAMI.cjs → chunk-I3GFGJSX.cjs} +7 -7
- package/dist/{chunk-GF6AYAMI.cjs.map → chunk-I3GFGJSX.cjs.map} +1 -1
- package/dist/{chunk-2XOIULVN.cjs → chunk-IDV6I7GX.cjs} +44 -44
- package/dist/{chunk-2XOIULVN.cjs.map → chunk-IDV6I7GX.cjs.map} +1 -1
- package/dist/{chunk-74RUAGVD.cjs → chunk-JB26AJ2L.cjs} +42 -42
- package/dist/{chunk-74RUAGVD.cjs.map → chunk-JB26AJ2L.cjs.map} +1 -1
- package/dist/{chunk-6I5HHWCD.cjs → chunk-JUOGNUQR.cjs} +5 -5
- package/dist/{chunk-6I5HHWCD.cjs.map → chunk-JUOGNUQR.cjs.map} +1 -1
- package/dist/{chunk-MAKCWF45.cjs → chunk-JXKUWLFZ.cjs} +4 -4
- package/dist/{chunk-MAKCWF45.cjs.map → chunk-JXKUWLFZ.cjs.map} +1 -1
- package/dist/{chunk-D4SJT3NG.cjs → chunk-K4SFQPOF.cjs} +3 -3
- package/dist/{chunk-D4SJT3NG.cjs.map → chunk-K4SFQPOF.cjs.map} +1 -1
- package/dist/{chunk-ZCQXQIBA.cjs → chunk-KIXB7V7A.cjs} +28 -28
- package/dist/{chunk-ZCQXQIBA.cjs.map → chunk-KIXB7V7A.cjs.map} +1 -1
- package/dist/{chunk-6P4U63HO.cjs → chunk-KJ65QZJI.cjs} +12 -12
- package/dist/{chunk-6P4U63HO.cjs.map → chunk-KJ65QZJI.cjs.map} +1 -1
- package/dist/{chunk-4M3OIBIS.cjs → chunk-KL7R2IBY.cjs} +2 -2
- package/dist/{chunk-4M3OIBIS.cjs.map → chunk-KL7R2IBY.cjs.map} +1 -1
- package/dist/{chunk-7UPEFZCV.cjs → chunk-KZFE65SA.cjs} +12 -12
- package/dist/{chunk-7UPEFZCV.cjs.map → chunk-KZFE65SA.cjs.map} +1 -1
- package/dist/{chunk-CULUTYOD.cjs → chunk-L2Q2UHRY.cjs} +4 -4
- package/dist/{chunk-CULUTYOD.cjs.map → chunk-L2Q2UHRY.cjs.map} +1 -1
- package/dist/{chunk-73KNWWBW.cjs → chunk-LBYJUPMV.cjs} +27 -27
- package/dist/{chunk-73KNWWBW.cjs.map → chunk-LBYJUPMV.cjs.map} +1 -1
- package/dist/{chunk-OZJENXU3.cjs → chunk-LFO3HNBX.cjs} +25 -25
- package/dist/{chunk-OZJENXU3.cjs.map → chunk-LFO3HNBX.cjs.map} +1 -1
- package/dist/{chunk-GK3U3FWY.cjs → chunk-LZZSCW7D.cjs} +5 -5
- package/dist/{chunk-GK3U3FWY.cjs.map → chunk-LZZSCW7D.cjs.map} +1 -1
- package/dist/{chunk-CYWOL2LS.cjs → chunk-MSFWSDRS.cjs} +3 -3
- package/dist/{chunk-CYWOL2LS.cjs.map → chunk-MSFWSDRS.cjs.map} +1 -1
- package/dist/{chunk-3RAW2ZH5.cjs → chunk-N362DFM4.cjs} +3 -3
- package/dist/{chunk-3RAW2ZH5.cjs.map → chunk-N362DFM4.cjs.map} +1 -1
- package/dist/{chunk-2P7VH2SK.cjs → chunk-NGATAD62.cjs} +3 -3
- package/dist/{chunk-2P7VH2SK.cjs.map → chunk-NGATAD62.cjs.map} +1 -1
- package/dist/{chunk-NGM4HIPP.cjs → chunk-PA5CCOBU.cjs} +140 -140
- package/dist/chunk-PA5CCOBU.cjs.map +1 -0
- package/dist/{chunk-SGYURQ23.cjs → chunk-PDDC5JOE.cjs} +10 -10
- package/dist/{chunk-SGYURQ23.cjs.map → chunk-PDDC5JOE.cjs.map} +1 -1
- package/dist/{chunk-3GQQUR27.cjs → chunk-PFGRONAI.cjs} +4 -4
- package/dist/{chunk-3GQQUR27.cjs.map → chunk-PFGRONAI.cjs.map} +1 -1
- package/dist/{chunk-6ZZWQ3OL.cjs → chunk-Q6ASMKFN.cjs} +10 -10
- package/dist/{chunk-6ZZWQ3OL.cjs.map → chunk-Q6ASMKFN.cjs.map} +1 -1
- package/dist/{chunk-3SGFIDID.cjs → chunk-QA2MTHMN.cjs} +82 -82
- package/dist/{chunk-3SGFIDID.cjs.map → chunk-QA2MTHMN.cjs.map} +1 -1
- package/dist/{chunk-V27WLYTG.cjs → chunk-RI367OOL.cjs} +3 -3
- package/dist/{chunk-V27WLYTG.cjs.map → chunk-RI367OOL.cjs.map} +1 -1
- package/dist/{chunk-SH7W4WVI.cjs → chunk-RLRDQICM.cjs} +104 -103
- package/dist/chunk-RLRDQICM.cjs.map +1 -0
- package/dist/{chunk-RL2HI6NP.cjs → chunk-S3GVFAFB.cjs} +3 -3
- package/dist/{chunk-RL2HI6NP.cjs.map → chunk-S3GVFAFB.cjs.map} +1 -1
- package/dist/{chunk-BZVK7JW5.cjs → chunk-ST5EZE2O.cjs} +12 -12
- package/dist/{chunk-BZVK7JW5.cjs.map → chunk-ST5EZE2O.cjs.map} +1 -1
- package/dist/{chunk-KWWGUQJV.cjs → chunk-UYBTXYYW.cjs} +10 -10
- package/dist/{chunk-KWWGUQJV.cjs.map → chunk-UYBTXYYW.cjs.map} +1 -1
- package/dist/{chunk-G3MRW4WB.cjs → chunk-UYTFPMEA.cjs} +8 -8
- package/dist/{chunk-G3MRW4WB.cjs.map → chunk-UYTFPMEA.cjs.map} +1 -1
- package/dist/{chunk-UD3LPATQ.cjs → chunk-WKIESVWJ.cjs} +6 -6
- package/dist/{chunk-UD3LPATQ.cjs.map → chunk-WKIESVWJ.cjs.map} +1 -1
- package/dist/{chunk-B5BGVPQ5.cjs → chunk-YPNGDJLX.cjs} +4 -4
- package/dist/{chunk-B5BGVPQ5.cjs.map → chunk-YPNGDJLX.cjs.map} +1 -1
- package/dist/{chunk-4XNP27N4.cjs → chunk-ZJ4P5QE5.cjs} +37 -37
- package/dist/{chunk-4XNP27N4.cjs.map → chunk-ZJ4P5QE5.cjs.map} +1 -1
- package/dist/collaboration/index.cjs +13 -13
- package/dist/connect/docx.cjs +25 -25
- package/dist/connect/index.cjs +1421 -1418
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +40 -40
- package/dist/connection/files/page/ConnectedFilesPage.js +16 -13
- package/dist/connection/files/page/ConnectedFilesPage.js.map +2 -2
- package/dist/connection/pages/DocumentBlocks.js +1 -1
- package/dist/connection/pages/DocumentBlocks.js.map +2 -2
- package/dist/connection/pages/EditablePageGrid.js +44 -13
- package/dist/connection/pages/EditablePageGrid.js.map +2 -2
- package/dist/connection/storage/ConnectedWorkspaceTrash.d.ts +5 -4
- package/dist/connection/storage/ConnectedWorkspaceTrash.js +1 -1
- package/dist/connection/storage/ConnectedWorkspaceTrash.js.map +2 -2
- package/dist/dashboards/index.cjs +17 -17
- package/dist/document-tools/index.cjs +21 -21
- package/dist/embed/index.cjs +45 -45
- package/dist/facts/index.cjs +66 -66
- package/dist/files/FilesPage.d.ts +4 -1
- package/dist/files/FilesPage.js +1 -1
- package/dist/files/FilesPage.js.map +2 -2
- package/dist/files/SelectionBar.js +1 -1
- package/dist/files/SelectionBar.js.map +2 -2
- package/dist/files/index.cjs +234 -234
- package/dist/home/index.cjs +24 -24
- package/dist/index.cjs +1935 -1935
- package/dist/pages/index.cjs +85 -60
- 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 +27 -27
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +57 -57
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/trigger.d.ts +5 -1
- package/dist/workflow-canvas/trigger.js +1 -1
- package/dist/workflow-canvas/trigger.js.map +2 -2
- package/dist/workspaces/index.cjs +9 -9
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/blocks.css +18 -0
- package/dist/ai-QFY4LYQZ.cjs.map +0 -1
- package/dist/chunk-JCFXS336.cjs.map +0 -1
- package/dist/chunk-NGM4HIPP.cjs.map +0 -1
- package/dist/chunk-OAIOOVFN.cjs.map +0 -1
- package/dist/chunk-SH7W4WVI.cjs.map +0 -1
- package/dist/chunk-WOVNXJK5.cjs.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunkM55XUF4L_cjs = require('./chunk-M55XUF4L.cjs');
|
|
7
|
-
var chunkG3MRW4WB_cjs = require('./chunk-G3MRW4WB.cjs');
|
|
4
|
+
var chunkRI367OOL_cjs = require('./chunk-RI367OOL.cjs');
|
|
5
|
+
var chunkWKIESVWJ_cjs = require('./chunk-WKIESVWJ.cjs');
|
|
8
6
|
var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
|
|
7
|
+
var chunkM55XUF4L_cjs = require('./chunk-M55XUF4L.cjs');
|
|
8
|
+
var chunkUYTFPMEA_cjs = require('./chunk-UYTFPMEA.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(() => chunkUYTFPMEA_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 } = chunkRI367OOL_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 = chunkUYTFPMEA_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 = chunkUYTFPMEA_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(() => chunkUYTFPMEA_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
|
+
chunkWKIESVWJ_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-KZFE65SA.cjs.map
|
|
269
|
+
//# sourceMappingURL=chunk-KZFE65SA.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,WA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J","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"]}
|
|
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;AA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AA,GACJ,MAAA,CAAO,MAAA,CAAO,IAAA,IAAQ,EAAE,CAAA,CAAE,IAAA,EAAK,IAAKF,sCAAA,CAAqB,MAAA,CAAO,MAAA,CAAO,WAAA,IAAe,EAAE,CAAC,CAAA;AAC3F,QAAA,MAAM,QAAA,GAAW,IAAA,GACb,IAAA,CAAK,IAAA,CAAK,CAAC,CAAA,KAAM,CAAA,CAAE,IAAA,CAAK,WAAA,EAAY,KAAM,IAAA,CAAK,WAAA,EAAa,CAAA,GAC5D,MAAA;AACJ,QAAA,IAAI,CAAC,UAAU,OAAO,IAAA;AACtB,QAAA,uBACEW,eAAA;AAAA,UAAC,KAAA;AAAA,UAAA;AAAA,YACC,SAAA,EAAU,mIAAA;AAAA,YACV,IAAA,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,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkNGATAD62_cjs = require('./chunk-NGATAD62.cjs');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var ui = require('@arbidocs/react/ui');
|
|
7
7
|
|
|
@@ -24,7 +24,7 @@ function DataTableBlock({ columns, rows, caption, emptyText, testId }) {
|
|
|
24
24
|
}
|
|
25
25
|
) : null,
|
|
26
26
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27
|
-
|
|
27
|
+
chunkNGATAD62_cjs.DataTable,
|
|
28
28
|
{
|
|
29
29
|
columns: tableColumns,
|
|
30
30
|
rows: tableRows,
|
|
@@ -54,5 +54,5 @@ function StatGroup({ items, testId }) {
|
|
|
54
54
|
|
|
55
55
|
exports.DataTableBlock = DataTableBlock;
|
|
56
56
|
exports.StatGroup = StatGroup;
|
|
57
|
-
//# sourceMappingURL=chunk-
|
|
58
|
-
//# sourceMappingURL=chunk-
|
|
57
|
+
//# sourceMappingURL=chunk-L2Q2UHRY.cjs.map
|
|
58
|
+
//# sourceMappingURL=chunk-L2Q2UHRY.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/DataTableBlock.tsx","../src/components/StatGroup.tsx"],"names":["jsxs","jsx","DataTable","cn"],"mappings":";;;;;;AA6CO,SAAS,eAAe,EAAE,OAAA,EAAS,MAAM,OAAA,EAAS,SAAA,EAAW,QAAO,EAAwB;AACjG,EAAA,MAAM,OAAO,MAAA,IAAU,kBAAA;AAEvB,EAAA,MAAM,YAAA,GAAuC,OAAA,CAAQ,GAAA,CAAI,CAAC,KAAK,KAAA,MAAW;AAAA,IACxE,GAAA,EAAK,GAAA,CAAI,KAAA,IAAS,CAAA,IAAA,EAAO,KAAK,CAAA,CAAA;AAAA,IAC9B,QAAQ,GAAA,CAAI,MAAA;AAAA,IACZ,OAAO,GAAA,CAAI,KAAA;AAAA,IACX,QAAQ,CAAC,GAAA,KAAQ,IAAI,KAAA,CAAM,GAAA,CAAI,KAAK,CAAA,IAAK;AAAA,GAC3C,CAAE,CAAA;AAEF,EAAA,MAAM,SAAA,GAA4B,IAAA,CAAK,GAAA,CAAI,CAAC,KAAA,EAAO,KAAA,MAAW,EA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,CAAC,KAAA,EAAA,EAAY,SAAA,EAAU,qBAAA,EAAsB,aAAA,EAAa,MAAA,IAAU,CAAA,EAAG,MAAM,CAAA,MAAA,EAAS,CAAC,CAAA,CAAA,EACrF,QAAA,EAAA;AAAA,oBAAAC,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,SAAA,EAAW,eAAK,KAAA,EAAM,CAAA;AAAA,oBACpCA,cAAAA,CAAC,IAAA,EAAA,EAAG,SAAA,EAAU,4EAAA,EACX,eAAK,KAAA,EACR,CAAA;AAAA,oBACAA,cAAAA,CAAC,GAAA,EAAA,EAAE,SAAA,EAAU,oCAAA,EAAsC,eAAK,KAAA,EAAM,CAAA;AAAA,IAC7D,IAAA,CAAK,uBAAOA,cAAAA,CAAC,OAAE,SAAA,EAAU,uCAAA,EAAyC,eAAK,GAAA,EAAI;AAAA,GAAA,EAAA,EANpE,CAOV,CACD,CAAA,EACH,CAAA;AAEJ","file":"chunk-L2Q2UHRY.cjs","sourcesContent":["/**\n * A **serializable** data table for the Puck builder.\n *\n * The library's developer-facing {@link DataTable} is driven by `Column<T>` whose\n * `header`/`render` are React nodes and functions — powerful, but non-serializable,\n * so it can never be a Puck block. `DataTableBlock` closes that gap with a flat,\n * JSON-safe schema (string headers, string field keys, string cells) and rebuilds\n * the non-serializable `Column<Row>[]` internally, rendering through the very same\n * {@link DataTable} so it inherits the library's markup and tokens verbatim.\n */\nimport { DataTable, type Column } from './DataTable'\n\nexport interface DataTableBlockColumn {\n /** Column heading text. */\n header: string\n /** Key used to look a cell up in each row record. */\n field: string\n /** Cell/heading alignment. */\n align?: 'left' | 'right' | 'center'\n}\n\nexport interface DataTableBlockProps {\n /** Serializable column schema. */\n columns: DataTableBlockColumn[]\n /** One record per row; cells are looked up by each column's `field`. */\n rows: Array<Record<string, string>>\n /** Optional caption rendered above the table. */\n caption?: string\n /** Empty-state title shown when there are no rows. */\n emptyText?: string\n /** testid area prefix; also set on the wrapper element. */\n testId?: string\n}\n\n/** A row wrapper so {@link DataTable} gets a stable id without polluting the record. */\ninterface TableRowData {\n __id: string\n cells: Record<string, string>\n}\n\n/**\n * Renders a {@link DataTable} from a flat, serializable schema. Columns are mapped\n * to `Column<TableRowData>[]` (header string, positional-stable key, alignment) and\n * each cell is resolved by `field`; rows carry a synthetic id for React keys/testids.\n */\nexport function DataTableBlock({ columns, rows, caption, emptyText, testId }: DataTableBlockProps) {\n const area = testId ?? 'data-table-block'\n\n const tableColumns: Column<TableRowData>[] = columns.map((col, index) => ({\n key: col.field || `col-${index}`,\n header: col.header,\n align: col.align,\n render: (row) => row.cells[col.field] ?? '',\n }))\n\n const tableRows: TableRowData[] = rows.map((cells, index) => ({ __id: String(index), cells }))\n\n return (\n <div data-testid={testId}>\n {caption ? (\n <p\n className=\"mb-2 text-sm text-muted-foreground\"\n data-testid={testId ? `${testId}-caption` : undefined}\n >\n {caption}\n </p>\n ) : null}\n <DataTable\n columns={tableColumns}\n rows={tableRows}\n getRowId={(row) => row.__id}\n area={area}\n emptyTitle={emptyText}\n />\n </div>\n )\n}\n","import { cn } from '@arbidocs/react/ui'\n\nexport interface StatItem {\n value: string\n label: string\n /** Optional caption under the label (e.g. a qualifier or unit). */\n sub?: string\n}\n\nexport interface StatGroupProps {\n items: StatItem[]\n testId?: string\n}\n\nconst GRID: Record<number, string> = {\n 1: 'grid-cols-1',\n 2: 'grid-cols-2',\n 3: 'grid-cols-2 sm:grid-cols-3',\n 4: 'grid-cols-2 lg:grid-cols-4',\n}\n\n/** Big-number stat group — headline metrics with captions. */\nexport function StatGroup({ items, testId }: StatGroupProps) {\n const list = items ?? []\n const cols = GRID[Math.min(list.length, 4)] ?? GRID[4]\n return (\n <dl className={cn('grid gap-8', cols)} data-testid={testId}>\n {list.map((item, i) => (\n <div key={i} className=\"min-w-0 text-center\" data-testid={testId && `${testId}-item-${i}`}>\n <dt className=\"sr-only\">{item.label}</dt>\n <dd className=\"text-4xl font-semibold tracking-tight [overflow-wrap:anywhere] sm:text-5xl\">\n {item.value}\n </dd>\n <p className=\"mt-2 text-sm text-muted-foreground\">{item.label}</p>\n {item.sub && <p className=\"mt-1 text-xs text-muted-foreground/80\">{item.sub}</p>}\n </div>\n ))}\n </dl>\n )\n}\n"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
5
4
|
var chunkWQ2KG4LS_cjs = require('./chunk-WQ2KG4LS.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
5
|
+
var chunk7SJXYEZI_cjs = require('./chunk-7SJXYEZI.cjs');
|
|
6
|
+
var chunkRLRDQICM_cjs = require('./chunk-RLRDQICM.cjs');
|
|
7
|
+
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
9
8
|
var chunkZBP4ZSAJ_cjs = require('./chunk-ZBP4ZSAJ.cjs');
|
|
9
|
+
var chunkVHD5DZW4_cjs = require('./chunk-VHD5DZW4.cjs');
|
|
10
10
|
var chunk46LX6EQT_cjs = require('./chunk-46LX6EQT.cjs');
|
|
11
11
|
var chunkCVPV4I7Z_cjs = require('./chunk-CVPV4I7Z.cjs');
|
|
12
12
|
var react$1 = require('react');
|
|
@@ -123,13 +123,13 @@ function RecordingControl({
|
|
|
123
123
|
modes: [
|
|
124
124
|
{
|
|
125
125
|
mode: "audio",
|
|
126
|
-
label:
|
|
126
|
+
label: chunkRLRDQICM_cjs.MODE_LABEL.audio,
|
|
127
127
|
description: "Everyone\u2019s microphone, one track each",
|
|
128
128
|
testId: "recording-mode-audio"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
mode: "audio_video",
|
|
132
|
-
label:
|
|
132
|
+
label: chunkRLRDQICM_cjs.MODE_LABEL.audio_video,
|
|
133
133
|
description: "Plus a video of your view of the call",
|
|
134
134
|
testId: "recording-mode-video"
|
|
135
135
|
}
|
|
@@ -181,7 +181,7 @@ function RecordingIndicator({
|
|
|
181
181
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
182
182
|
chunkWQ2KG4LS_cjs.RecordingStatusChip,
|
|
183
183
|
{
|
|
184
|
-
sentence: `Recording${mode ? ` (${
|
|
184
|
+
sentence: `Recording${mode ? ` (${chunkRLRDQICM_cjs.MODE_LABEL[mode]})` : ""} \u2014 started by ${by}`,
|
|
185
185
|
compact,
|
|
186
186
|
announce,
|
|
187
187
|
onAnnounced,
|
|
@@ -654,7 +654,7 @@ function WebinarChat({ chat }) {
|
|
|
654
654
|
const id = `${line.senderIdentity}-${line.id}`;
|
|
655
655
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkVHD5DZW4_cjs.MessageRoot, { role: "user", messageId: id, className: "px-3", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkVHD5DZW4_cjs.MessageContent, { role: "user", messageId: id, align: line.mine ? "end" : "start", children: [
|
|
656
656
|
startsRun && /* @__PURE__ */ jsxRuntime.jsx(chunkVHD5DZW4_cjs.MessageAuthor, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
657
|
-
|
|
657
|
+
chunkRLRDQICM_cjs.CallUserPill,
|
|
658
658
|
{
|
|
659
659
|
identity: line.senderIdentity,
|
|
660
660
|
name: line.senderName,
|
|
@@ -725,14 +725,14 @@ function WebinarQA({ webinar }) {
|
|
|
725
725
|
body: q.text,
|
|
726
726
|
status: q.status,
|
|
727
727
|
answer: q.answerText,
|
|
728
|
-
answeredBy: q.answered_by_ext_id ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
728
|
+
answeredBy: q.answered_by_ext_id ? /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: q.answered_by_ext_id }) : void 0,
|
|
729
729
|
voteCount: q.vote_count,
|
|
730
730
|
voted: q.voted,
|
|
731
731
|
mine: q.mine,
|
|
732
732
|
createdAt: q.created_at,
|
|
733
733
|
// Who asked is hidden from attendees (another attendee's question): "Attendee".
|
|
734
734
|
askerName: q.asker_ext_id ? "" : null,
|
|
735
|
-
asker: q.asker_ext_id ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
735
|
+
asker: q.asker_ext_id ? /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: q.asker_ext_id }) : void 0
|
|
736
736
|
})),
|
|
737
737
|
[webinar.questions]
|
|
738
738
|
);
|
|
@@ -764,7 +764,7 @@ function WebinarAudience({ webinar }) {
|
|
|
764
764
|
id: h.identity,
|
|
765
765
|
name: h.name,
|
|
766
766
|
raisedAt: h.raised_at,
|
|
767
|
-
entity: /* @__PURE__ */ jsxRuntime.jsx(
|
|
767
|
+
entity: /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: h.identity, name: h.name, size: "sm" })
|
|
768
768
|
})),
|
|
769
769
|
attendees: webinar.attendees.map((a) => ({
|
|
770
770
|
id: a.identity,
|
|
@@ -772,7 +772,7 @@ function WebinarAudience({ webinar }) {
|
|
|
772
772
|
role: a.role,
|
|
773
773
|
onStage: a.on_stage,
|
|
774
774
|
handRaised: a.hand_raised,
|
|
775
|
-
entity: /* @__PURE__ */ jsxRuntime.jsx(
|
|
775
|
+
entity: /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: a.identity, name: a.name, size: "sm" })
|
|
776
776
|
})),
|
|
777
777
|
onPromote: webinar.promote,
|
|
778
778
|
onDemote: webinar.demote
|
|
@@ -912,7 +912,7 @@ function useRoomVoiceLevels() {
|
|
|
912
912
|
muted: !componentsReact.isTrackReference(t) || t.publication.isMuted,
|
|
913
913
|
local: t.participant.isLocal
|
|
914
914
|
}));
|
|
915
|
-
react$1.useEffect(() =>
|
|
915
|
+
react$1.useEffect(() => chunk7SJXYEZI_cjs.startVoiceLevels(() => sources.current), []);
|
|
916
916
|
}
|
|
917
917
|
function CallBody({
|
|
918
918
|
callExtId,
|
|
@@ -956,9 +956,9 @@ function CallBody({
|
|
|
956
956
|
onTranscriptionChange?.(transcription.on);
|
|
957
957
|
}, [transcription.on, onTranscriptionChange]);
|
|
958
958
|
react$1.useEffect(() => {
|
|
959
|
-
|
|
959
|
+
chunk7SJXYEZI_cjs.publishCallStatus({ callExtId, transcribing: transcription.on });
|
|
960
960
|
}, [callExtId, transcription.on]);
|
|
961
|
-
react$1.useEffect(() => () =>
|
|
961
|
+
react$1.useEffect(() => () => chunk7SJXYEZI_cjs.publishCallStatus({ callExtId: null, transcribing: false }), []);
|
|
962
962
|
const recording = calls.useCallRecorder({ callExtId, callKey: e2eeKey, isCreator, linkVersion });
|
|
963
963
|
react$1.useEffect(() => {
|
|
964
964
|
onRecordingChange?.(recording.on);
|
|
@@ -981,9 +981,9 @@ function CallBody({
|
|
|
981
981
|
const askToMute = calls.useMuteRequests();
|
|
982
982
|
calls.useHostMuteNotice(callExtId);
|
|
983
983
|
const participants = componentsReact.useParticipants();
|
|
984
|
-
const speakingIds =
|
|
984
|
+
const speakingIds = chunk7SJXYEZI_cjs.useSpeakingIds();
|
|
985
985
|
const speakingNames = react$1.useMemo(
|
|
986
|
-
() => speakingIds.map((id) => participants.find((p) => p.identity === id)).filter((p) => !!p).map((p) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
986
|
+
() => speakingIds.map((id) => participants.find((p) => p.identity === id)).filter((p) => !!p).map((p) => /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: p.identity, name: p.name }, p.identity)),
|
|
987
987
|
[speakingIds, participants]
|
|
988
988
|
);
|
|
989
989
|
const stageRef = react$1.useRef(null);
|
|
@@ -1198,7 +1198,7 @@ function webinarControls(webinar, opts) {
|
|
|
1198
1198
|
}
|
|
1199
1199
|
function useCallNotices(recording, transcription) {
|
|
1200
1200
|
const [shown, setShown] = react$1.useState({});
|
|
1201
|
-
const recordingText = recording.on ? `Recording${recording.mode ? ` (${
|
|
1201
|
+
const recordingText = recording.on ? `Recording${recording.mode ? ` (${chunkRLRDQICM_cjs.MODE_LABEL[recording.mode]})` : ""} \u2014 started by ${recording.startedByMe ? "you" : recording.startedByName || "the host"}` : null;
|
|
1202
1202
|
const transcriptionText = transcription.on ? `Transcription on \u2014 started by ${transcription.startedByMe ? "you" : transcription.startedByName || "a participant"}` : null;
|
|
1203
1203
|
useNotice("recording", recordingText, setShown);
|
|
1204
1204
|
useNotice("transcription", transcriptionText, setShown);
|
|
@@ -1262,8 +1262,8 @@ function RoomTile({
|
|
|
1262
1262
|
const screen = trackRef.source === livekitClient.Track.Source.ScreenShare;
|
|
1263
1263
|
const videoMuted = componentsReact.useIsMuted(trackRef);
|
|
1264
1264
|
const micMuted = componentsReact.useIsMuted({ participant, source: livekitClient.Track.Source.Microphone });
|
|
1265
|
-
const speaking =
|
|
1266
|
-
const level =
|
|
1265
|
+
const speaking = chunk7SJXYEZI_cjs.useIsSpeaking(participant.identity);
|
|
1266
|
+
const level = chunk7SJXYEZI_cjs.useVoiceLevel(participant.identity);
|
|
1267
1267
|
const { quality } = componentsReact.useConnectionQualityIndicator({ participant });
|
|
1268
1268
|
const hasVideo = componentsReact.isTrackReference(trackRef) && !!trackRef.publication.track && !videoMuted;
|
|
1269
1269
|
const name = participant.name || participant.identity;
|
|
@@ -1274,7 +1274,7 @@ function RoomTile({
|
|
|
1274
1274
|
...elementProps,
|
|
1275
1275
|
name: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1276
1276
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1277
|
-
|
|
1277
|
+
chunkRLRDQICM_cjs.CallUserPill,
|
|
1278
1278
|
{
|
|
1279
1279
|
identity: participant.identity,
|
|
1280
1280
|
name: participant.name,
|
|
@@ -1312,7 +1312,7 @@ function useStageTracks(includeLocal = true) {
|
|
|
1312
1312
|
return { share, cameras };
|
|
1313
1313
|
}
|
|
1314
1314
|
function useSpotlightCamera(cameras) {
|
|
1315
|
-
const spotlight =
|
|
1315
|
+
const spotlight = chunk7SJXYEZI_cjs.useSpotlightId();
|
|
1316
1316
|
const id = chunkZBP4ZSAJ_cjs.pickSpotlight(
|
|
1317
1317
|
cameras.map((t) => ({ id: t.participant.identity, local: t.participant.isLocal })),
|
|
1318
1318
|
spotlight
|
|
@@ -1402,7 +1402,7 @@ function ParticipantsList({
|
|
|
1402
1402
|
);
|
|
1403
1403
|
}
|
|
1404
1404
|
};
|
|
1405
|
-
const levels =
|
|
1405
|
+
const levels = chunk7SJXYEZI_cjs.useVoiceLevels();
|
|
1406
1406
|
const ordered = [
|
|
1407
1407
|
...speakingIds.map((id) => participants.find((p) => p.identity === id)).filter((p) => !!p),
|
|
1408
1408
|
...participants.filter((p) => !speakingIds.includes(p.identity))
|
|
@@ -1416,7 +1416,7 @@ function ParticipantsList({
|
|
|
1416
1416
|
id: p.identity,
|
|
1417
1417
|
name: p.name || p.identity,
|
|
1418
1418
|
isLocal: p.isLocal,
|
|
1419
|
-
entity: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1419
|
+
entity: /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: p.identity, name: p.name, size: "sm", interactive: !p.isLocal }),
|
|
1420
1420
|
speaking: speakingIds.includes(p.identity),
|
|
1421
1421
|
level: levels[p.identity] ?? 0,
|
|
1422
1422
|
micMuted: !p.isMicrophoneEnabled,
|
|
@@ -1449,7 +1449,7 @@ function Lobby({ callExtId }) {
|
|
|
1449
1449
|
requests: mine.map((k) => ({
|
|
1450
1450
|
id: k.knockId,
|
|
1451
1451
|
name: k.displayName,
|
|
1452
|
-
entity: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1452
|
+
entity: /* @__PURE__ */ jsxRuntime.jsx(chunkRLRDQICM_cjs.CallUserPill, { identity: k.userExtId, name: k.displayName })
|
|
1453
1453
|
})),
|
|
1454
1454
|
onDecide: (id, admit) => void decide(id, admit)
|
|
1455
1455
|
}
|
|
@@ -1463,5 +1463,5 @@ function ConnectingOverlay() {
|
|
|
1463
1463
|
}
|
|
1464
1464
|
|
|
1465
1465
|
exports.ConnectedCallRoom = ConnectedCallRoom;
|
|
1466
|
-
//# sourceMappingURL=chunk-
|
|
1467
|
-
//# sourceMappingURL=chunk-
|
|
1466
|
+
//# sourceMappingURL=chunk-LBYJUPMV.cjs.map
|
|
1467
|
+
//# sourceMappingURL=chunk-LBYJUPMV.cjs.map
|