@arbidocs/blocks 0.4.142 → 0.4.144
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents/index.cjs +435 -432
- package/dist/agents/index.js +7 -4
- package/dist/chat/index.cjs +139 -138
- package/dist/chat/index.js +4 -3
- package/dist/{chunk-N5X37J3D.js → chunk-2FJMTZNJ.js} +8 -5
- package/dist/chunk-2FJMTZNJ.js.map +1 -0
- package/dist/chunk-33ZOUJXA.js +561 -0
- package/dist/chunk-33ZOUJXA.js.map +1 -0
- package/dist/{chunk-S24XEVPS.cjs → chunk-464YPRAE.cjs} +33 -2
- package/dist/chunk-464YPRAE.cjs.map +1 -0
- package/dist/{chunk-7YLJHTDC.cjs → chunk-5A2QQAF5.cjs} +11 -11
- package/dist/{chunk-7YLJHTDC.cjs.map → chunk-5A2QQAF5.cjs.map} +1 -1
- package/dist/chunk-76L6LOP3.cjs +308 -0
- package/dist/chunk-76L6LOP3.cjs.map +1 -0
- package/dist/{chunk-FXG7TFAG.js → chunk-7NGAWGA3.js} +3 -3
- package/dist/{chunk-FXG7TFAG.js.map → chunk-7NGAWGA3.js.map} +1 -1
- package/dist/chunk-A6J2IBUG.js +1602 -0
- package/dist/chunk-A6J2IBUG.js.map +1 -0
- package/dist/{chunk-DPGFEMVT.cjs → chunk-ABUO6PIQ.cjs} +51 -1659
- package/dist/chunk-ABUO6PIQ.cjs.map +1 -0
- package/dist/chunk-AOSUHWIL.js +98 -0
- package/dist/chunk-AOSUHWIL.js.map +1 -0
- package/dist/{chunk-GBS6QVGS.cjs → chunk-BUWBXJ2N.cjs} +5 -5
- package/dist/{chunk-GBS6QVGS.cjs.map → chunk-BUWBXJ2N.cjs.map} +1 -1
- package/dist/chunk-CQCC7LE7.js +210 -0
- package/dist/chunk-CQCC7LE7.js.map +1 -0
- package/dist/{chunk-UGCKUXRV.js → chunk-CSI2B2H5.js} +3 -3
- package/dist/{chunk-UGCKUXRV.js.map → chunk-CSI2B2H5.js.map} +1 -1
- package/dist/{chunk-JO3EMZ4X.js → chunk-GWSGIZQ5.js} +3 -3
- package/dist/{chunk-JO3EMZ4X.js.map → chunk-GWSGIZQ5.js.map} +1 -1
- package/dist/{chunk-OWCEQKAR.cjs → chunk-JSTKEZBS.cjs} +21 -318
- package/dist/chunk-JSTKEZBS.cjs.map +1 -0
- package/dist/{chunk-CKCBBYTA.js → chunk-KSHKTOY2.js} +5 -205
- package/dist/chunk-KSHKTOY2.js.map +1 -0
- package/dist/chunk-LJJJ6CYH.cjs +62 -0
- package/dist/chunk-LJJJ6CYH.cjs.map +1 -0
- package/dist/chunk-MHFF5N65.cjs +101 -0
- package/dist/chunk-MHFF5N65.cjs.map +1 -0
- package/dist/{chunk-GYAUJ4KT.js → chunk-MTSKK3BN.js} +32 -3
- package/dist/chunk-MTSKK3BN.js.map +1 -0
- package/dist/chunk-O2ODDTMA.cjs +1627 -0
- package/dist/chunk-O2ODDTMA.cjs.map +1 -0
- package/dist/{chunk-3BFGL2JL.cjs → chunk-ODRHHWHY.cjs} +4 -4
- package/dist/{chunk-3BFGL2JL.cjs.map → chunk-ODRHHWHY.cjs.map} +1 -1
- package/dist/{chunk-Y5KTM3V5.js → chunk-PDKM27DF.js} +17 -295
- package/dist/chunk-PDKM27DF.js.map +1 -0
- package/dist/{chunk-OAL3B2ZU.cjs → chunk-PLJ7PHWU.cjs} +5 -5
- package/dist/{chunk-OAL3B2ZU.cjs.map → chunk-PLJ7PHWU.cjs.map} +1 -1
- package/dist/chunk-RA3ZJ45L.cjs +574 -0
- package/dist/chunk-RA3ZJ45L.cjs.map +1 -0
- package/dist/chunk-RFIBUWLF.cjs +232 -0
- package/dist/chunk-RFIBUWLF.cjs.map +1 -0
- package/dist/{chunk-MIDXCYZB.cjs → chunk-RQ2Y7USX.cjs} +15 -235
- package/dist/chunk-RQ2Y7USX.cjs.map +1 -0
- package/dist/chunk-SV65E4QW.js +58 -0
- package/dist/chunk-SV65E4QW.js.map +1 -0
- package/dist/chunk-TZGBRLPK.js +288 -0
- package/dist/chunk-TZGBRLPK.js.map +1 -0
- package/dist/{chunk-PROK33G6.js → chunk-X3TGXEFS.js} +11 -1596
- package/dist/chunk-X3TGXEFS.js.map +1 -0
- package/dist/{chunk-HIJUXAWS.cjs → chunk-XGZX22ET.cjs} +77 -74
- package/dist/chunk-XGZX22ET.cjs.map +1 -0
- package/dist/{chunk-5BXEYYH6.js → chunk-ZM26YEOT.js} +3 -3
- package/dist/{chunk-5BXEYYH6.js.map → chunk-ZM26YEOT.js.map} +1 -1
- package/dist/connect/docx.cjs +35 -6
- package/dist/connect/docx.cjs.map +1 -1
- package/dist/connect/docx.d.ts +9 -2
- package/dist/connect/docx.js +29 -5
- package/dist/connect/docx.js.map +1 -1
- package/dist/connect/index.cjs +126 -339
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +15 -260
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/docx/ConnectedNativeDocxComparison.d.ts +5 -0
- package/dist/connection/docx/ConnectedNativeDocxEditor.d.ts +16 -0
- package/dist/connection/{ConnectedStreamedWordArtifact.d.ts → docx/ConnectedStreamedWordArtifact.d.ts} +1 -1
- package/dist/connection/docx/support.d.ts +27 -0
- package/dist/connection/docx/useConnectedDocxReferences.d.ts +2 -0
- package/dist/connection/docx/useConnectedHouseTemplate.d.ts +2 -0
- package/dist/docx/index.cjs +17 -63
- package/dist/docx/index.cjs.map +1 -1
- package/dist/docx/index.d.ts +1 -0
- package/dist/docx/index.js +2 -64
- package/dist/docx/index.js.map +1 -1
- package/dist/docx/template/candidates.d.ts +16 -0
- package/dist/index.cjs +625 -609
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +13 -9
- package/dist/index.js.map +1 -1
- package/dist/lib/deep-link.d.ts +46 -0
- package/dist/settings/index.cjs +10 -9
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +2 -1
- package/dist/settings/index.js.map +1 -1
- package/dist/studio/index.cjs +5 -4
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +4 -3
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +58 -55
- package/dist/workflow-canvas/index.cjs.map +1 -1
- package/dist/workflow-canvas/index.js +7 -4
- package/dist/workflow-canvas/index.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
- package/dist/chunk-4TR5QCCX.cjs +0 -43
- package/dist/chunk-4TR5QCCX.cjs.map +0 -1
- package/dist/chunk-7NDW4KF4.cjs +0 -112
- package/dist/chunk-7NDW4KF4.cjs.map +0 -1
- package/dist/chunk-CKCBBYTA.js.map +0 -1
- package/dist/chunk-DPGFEMVT.cjs.map +0 -1
- package/dist/chunk-ETXYVO6E.js +0 -109
- package/dist/chunk-ETXYVO6E.js.map +0 -1
- package/dist/chunk-GYAUJ4KT.js.map +0 -1
- package/dist/chunk-HIJUXAWS.cjs.map +0 -1
- package/dist/chunk-MCKOZACC.js +0 -41
- package/dist/chunk-MCKOZACC.js.map +0 -1
- package/dist/chunk-MIDXCYZB.cjs.map +0 -1
- package/dist/chunk-N5X37J3D.js.map +0 -1
- package/dist/chunk-OWCEQKAR.cjs.map +0 -1
- package/dist/chunk-PROK33G6.js.map +0 -1
- package/dist/chunk-S24XEVPS.cjs.map +0 -1
- package/dist/chunk-Y5KTM3V5.js.map +0 -1
- package/dist/connection/ConnectedNativeDocxEditor.d.ts +0 -6
package/dist/connect/index.d.ts
CHANGED
|
@@ -28,3 +28,4 @@ export { useConnectedWorkNotifications, type WorkNotificationTarget, } from '../
|
|
|
28
28
|
export * from '../connection/mail';
|
|
29
29
|
export * from '../connection/calendar';
|
|
30
30
|
export { ConnectedAgentChatPanel, type ConnectedAgentChatPanelProps, } from '../connection/ConnectedAgentChatPanel';
|
|
31
|
+
export { NativeDocxSupportProvider, useNativeDocxSupport, type NativeDocxSupport, } from '../connection/docx/support';
|
package/dist/connect/index.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { DraggableHeader, SettingsSection, ProfileCard, AvatarPicker, IdentityVerificationCard, IdentityVerificationDialog, RequireVerified, PasswordChangeDialog, SettingsCard, SettingsActionRow, EMAIL_NOTIFICATION_KEYS, EMAIL_NOTIFICATION_CATEGORIES, NotificationCategoryList, toNotificationCategories, toActiveSessionViews, SettingsRow, ActiveSessionsDialog, LogoutDialog, toLogoutSessionViews, SettingsDangerZone, DeleteAccountDialog, toDeleteBlockerViews } from '../chunk-ON3TKY5Y.js';
|
|
3
|
-
export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-
|
|
4
|
-
import {
|
|
3
|
+
export { ConnectedAssistantDock, redlineStats, textToArtifact, toRedlineMarkdown, useConnectedAiTask, useConnectedChat, useSemanticSearch, useWorkspaceDocs } from '../chunk-CSI2B2H5.js';
|
|
4
|
+
import { useConnectedWorkspaceRole, ConnectedNativeDocxEditor } from '../chunk-33ZOUJXA.js';
|
|
5
|
+
export { ConnectedWorkflowDocumentsField, ConnectedWorkflowLauncher, ConnectedWorkflowsTable, DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, NativeDocxSupportProvider, toWorkflowFieldDocument, useConnectedAgentOptions, useConnectedWorkflowScopeSource, useConnectedWorkspaceRole, useNativeDocxSupport } from '../chunk-33ZOUJXA.js';
|
|
5
6
|
export { ConnectedWorkspaceDataProvider, useConnectedConversations, useConnectedDocuments, useConnectedTags } from '../chunk-45LRMW54.js';
|
|
6
|
-
import { ConnectedNativeDocxEditor } from '../chunk-ETXYVO6E.js';
|
|
7
7
|
import { ConnectionProvider, useConnection, useConnectedWorkspace } from '../chunk-US3S4DCB.js';
|
|
8
8
|
export { ConnectionProvider, SESSION_EXPIRED_MESSAGE, isAuthenticated, useConnectedWorkspace, useConnection } from '../chunk-US3S4DCB.js';
|
|
9
9
|
import { SignDocumentDialog } from '../chunk-2YOVK524.js';
|
|
10
|
-
import '../chunk-
|
|
10
|
+
import '../chunk-MTSKK3BN.js';
|
|
11
11
|
import '../chunk-2FL7QJKJ.js';
|
|
12
12
|
import '../chunk-HFZ45FD3.js';
|
|
13
13
|
import { FilesFilterBar, FolderFilterButton, FolderPickerRow } from '../chunk-7RJTEWYM.js';
|
|
14
|
-
import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, tagTableDocx } from '../chunk-
|
|
14
|
+
import { WorkspaceActivityList, WorkspaceNotificationMenu, ThreadFollowMenuItem, ThreadFollowButton, TagTable, tagTableDocx } from '../chunk-7NGAWGA3.js';
|
|
15
15
|
import { workspaceKindColor } from '../chunk-A3XPS2EU.js';
|
|
16
16
|
import { PlainMailBodyEditor, draftMailCompose, replyMailCompose, emptyMailCompose, MailGrid, MailMessageView, MailDocumentPicker, parseMailRecipients } from '../chunk-6HCJ3ZEU.js';
|
|
17
|
+
import '../chunk-SV65E4QW.js';
|
|
17
18
|
import { DOCX_MIME_TYPE } from '../chunk-QXMR5YHC.js';
|
|
18
19
|
import '../chunk-AF6RDAJF.js';
|
|
19
|
-
import {
|
|
20
|
+
import { buildLibrarySkills, filterLibrarySkills, SKILL_SOURCE_LABELS, SKILL_TYPE_LABELS, SkillViewToggle, SkillFilterChips, SkillTile, SkillGenerateForm, SkillLibraryDetail, parseSkillFrontmatter, SKILL_MAIN_FILENAME, SkillEditForm, DEFAULT_AGENT_CAPABILITIES, stripPersonaPreamble, AgentCreator, DEFAULT_AGENT_TYPES, DEFAULT_AGENT_TEMPLATES, AgentAvatarField, isValidAgentName, AgentConnectInstructions, TaskRunsDialog, TaskActivityDialog, WorkflowStepBar, composePersona, importSkillFile, importSkillFromUrl, WorkflowRunner, skillSlug, serializeSkill, fromPlanSteps, toPlanSteps, useWorkflowView, workflowToSkillMarkdown } from '../chunk-X3TGXEFS.js';
|
|
21
|
+
import { MultiSelect } from '../chunk-CQCC7LE7.js';
|
|
22
|
+
import { PersonPill } from '../chunk-A6J2IBUG.js';
|
|
20
23
|
import '../chunk-3RJN2VTL.js';
|
|
24
|
+
import { TriStateFilterMenu } from '../chunk-KSHKTOY2.js';
|
|
21
25
|
import '../chunk-RLWIUUQ5.js';
|
|
22
|
-
import { TriStateFilterMenu, MultiSelect } from '../chunk-CKCBBYTA.js';
|
|
23
26
|
import '../chunk-P6GHJSLR.js';
|
|
24
27
|
import '../chunk-EVUEIBNU.js';
|
|
25
28
|
import '../chunk-444XKG46.js';
|
|
@@ -32,10 +35,11 @@ import { upcomingOf, conferenceUrl, isWebinarConference, canJoinEvent, calendarT
|
|
|
32
35
|
import { detectTimeZone, utcToDate, formatPlainDate, formatInZone, safeZone, todayInZone, addDays, wallToUtc } from '../chunk-GTCC2VAR.js';
|
|
33
36
|
import { ConfirmDialog } from '../chunk-VHJHY7TT.js';
|
|
34
37
|
import { TabHeader } from '../chunk-4WWM3GQ5.js';
|
|
35
|
-
import { ChatPage } from '../chunk-
|
|
38
|
+
import { ChatPage } from '../chunk-GWSGIZQ5.js';
|
|
36
39
|
import '../chunk-7XF5SFJ2.js';
|
|
37
40
|
import { takeOpenDocumentForTurn, useRegisterOpenDocument } from '../chunk-YBLIKTJK.js';
|
|
38
|
-
import { splitDocRef, stepLevels, stepDocuments, stepKindOf, initialRunInputs, workflowSteps, stepStatesFromActivity, runThreadTitle, stepFields } from '../chunk-
|
|
41
|
+
import { splitDocRef, stepLevels, stepDocuments, stepKindOf, initialRunInputs, workflowSteps, stepStatesFromActivity, runThreadTitle, stepFields } from '../chunk-PDKM27DF.js';
|
|
42
|
+
import '../chunk-TZGBRLPK.js';
|
|
39
43
|
import '../chunk-AA3PT6KR.js';
|
|
40
44
|
import '../chunk-AUS3KBHJ.js';
|
|
41
45
|
import '../chunk-SLSBJRWW.js';
|
|
@@ -48,7 +52,7 @@ import { fmtDate, initials } from '../chunk-OXF2IFXG.js';
|
|
|
48
52
|
import '../chunk-VUNV25KB.js';
|
|
49
53
|
import { lazy, useState, useMemo, useEffect, useCallback, useRef, Suspense, useSyncExternalStore, useLayoutEffect } from 'react';
|
|
50
54
|
import { QueryClient, QueryClientProvider, useQueryClient, useQuery } from '@tanstack/react-query';
|
|
51
|
-
import { ArbiProvider, useConversations, useRunConversation, useWorkspaceActivity, useWorkspaceUsers, isWorkspaceNotificationType, useArbi, useNotifications, useDeleteNotifications, useMarkNotificationsRead, useWorkspaces, useWorkspaceNotificationLevel, useFollowThread,
|
|
55
|
+
import { ArbiProvider, useConversations, useRunConversation, useWorkspaceActivity, useWorkspaceUsers, isWorkspaceNotificationType, useArbi, useNotifications, useDeleteNotifications, useMarkNotificationsRead, useWorkspaces, useWorkspaceNotificationLevel, useFollowThread, useUploadSkillFiles, useSkills, useSetSkillVisibility, useDeleteSkill, useSkillSource, useAgentModels, useMcpTools, useAgentConfig, useAgentWorkspaces, useCreateAgent, useSaveAgentConfig, useGrantAgentAccess, useRevokeAgentAccess, useGenerateAgentAvatar, useWorkflowRuns, useConversationActivity, useAgents, ArtifactCanvas, useArbiChat, useDocuments, useTagKindSchema, useTags, useSetTagValues, useUpdateTagKindSchema, useInvalidateTagData, useShellWorkspaces, useProfile, useUpdateProfile, useRequestEmailChange, useConfirmEmailChange, useNameEditor, useAvatarCrop, useEmailChange, ImageCropModal, useIdentityVerification, usePasswordChange, usePasswordChangeForm, useNotificationPreferences, useSessions, useCurrentSessionId, useTerminateSession, useSignOut, useDeleteAccount, useDeleteAccountFlow, useArbiWebSocket, useWorkNotifications, mailDraftIdFromContent, useMailClient, defaultMailAlias, useClaimNativeAlias, useMailOnline, useConnectMailAccount, useDisconnectMailAccount, useMailPolicy, useMailAccounts, useMailUnlock, useMailFolders, useMailMessages, useMailDraftCompose, useMailMessage, useMailCache, MailOfflineUnavailableError, accountPath, useCalendarEvents, useCalendars, useFetchCalendarEvent, useCalendarSettings, useCalendarOverlays, useCalendarOutbox, useCalendarAccounts, useSyncAccountsOnOpen, useResumeCalendarAccountConnect, useCreateEvent, useUpdateEvent, useDeleteEvent, useMoveEvent, useRespondToEvent, useCreateCalendar, useUpdateCalendar, useDeleteCalendar, useImportCalendar, useSaveCalendarSettings, useRefreshCalendar, useCalendarEvent, useMailAttachmentText, useCalendarEventByUid, getPublicBookingPage, bookPublicSlot, PublicBookingError, useAgentSession, useStartAgentSession, useCloseAgentSession, isQueuedCalendarWrite, isAliasTakenError, nextAliasSuggestion, aliasTakenMessage, mailJson, ArbiWebSocketProvider, isDeploymentUserNotification, getWorkspaceActionText, getWorkspaceSentPhrase, describeServerNotification, BOX_SEAT_REFUSED, BOX_SEAT_REFUSED_TITLE, documentActivityPhrase, isSignatureNotificationType, inputRequestTitle, WORK_NOTIFICATION_LABELS, useArbiSessionState, documentDisplayName, getWorkspaceKind, formatRelativeTime, useCreateWork, useActOnStep, useConversationThreads, fileAttachment, useMailProjects, useSaveMailDraft, useSendMail, useMailDraftReplaced, useCalendarInvitations, useDecideCounter, useSearchContacts, usePublishCalendar, useCalendarShares, useShareCalendar, useUnshareCalendar, useSubscribeCalendar, useHolidayCountries, useAddHolidayCalendar, cancelPublicBooking, AiAnswer, signatureNotificationPhrase, signatureRequestMeta, getNotificationTypeMeta, useMailDraftEditor, useFreeBusy, useRooms, useFindTime, useCalendarSupport, useStartCalendarAccountOAuth, useConnectOAuthAccount, useAppPasswords, splitAppPasswords, useBookingPages, useDeleteBookingPage, useSyncCalendarAccount, useUpdateCalendarAccount, useDisconnectCalendarAccount, ACCOUNT_VENDOR, useCalDavProfiles, useConnectCalDavAccount, useCreateAppPassword, useCreateFeed, useSaveBookingPage, useCreateRoom, useRevokeAppPassword } from '@arbidocs/react';
|
|
52
56
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
53
57
|
import { Button, Label, Input, cn, Textarea, Dialog, DialogContent, DialogHeader, DialogTitle, DialogDescription, DocumentEntity, EntityPill, ShieldIcon, EntityIcon, Tooltip, TooltipTrigger, TooltipContent, Popover, PopoverTrigger, PopoverContent, Tabs, TabsList, TabsTrigger, TabsContent, DialogFooter, UserEntity, Switch } from '@arbidocs/react/ui';
|
|
54
58
|
import { useNotify } from '@arbidocs/react/shell';
|
|
@@ -839,255 +843,6 @@ function ConnectedThreadFollow({
|
|
|
839
843
|
}
|
|
840
844
|
);
|
|
841
845
|
}
|
|
842
|
-
function useConnectedWorkspaceRole() {
|
|
843
|
-
const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace();
|
|
844
|
-
const { data: members = [] } = useWorkspaceUsers(workspaceId ?? void 0, {
|
|
845
|
-
enabled: live && !!workspaceId,
|
|
846
|
-
beforeFetch: ensureWorkspaceOpen
|
|
847
|
-
});
|
|
848
|
-
const role = members.find((m) => m.user.external_id === userId)?.role;
|
|
849
|
-
return {
|
|
850
|
-
members,
|
|
851
|
-
role,
|
|
852
|
-
/** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */
|
|
853
|
-
canEditShared: role === "owner" || role === "collaborator",
|
|
854
|
-
/** With an item's creator, the only one who deletes it. */
|
|
855
|
-
isWorkspaceOwner: role === "owner"
|
|
856
|
-
};
|
|
857
|
-
}
|
|
858
|
-
var DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS = {
|
|
859
|
-
updateFailed: "Could not update the workflow",
|
|
860
|
-
deleteTitle: "Delete workflow",
|
|
861
|
-
deleteOne: (name) => `Delete \u201C${name}\u201D? Threads it already created stay.`,
|
|
862
|
-
deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,
|
|
863
|
-
runFailed: "The workflow failed. You can send an error report from its history.",
|
|
864
|
-
noThread: "The workflow did not create a thread.",
|
|
865
|
-
documentAction: (workflow) => workflow.action?.type === "email_documents" ? "Preparing your document email" : "Reviewing documents",
|
|
866
|
-
untitledTask: "Untitled thread"
|
|
867
|
-
};
|
|
868
|
-
var messageOf = (error) => error instanceof Error ? error.message : "";
|
|
869
|
-
function ConnectedWorkflowsTable({
|
|
870
|
-
filter,
|
|
871
|
-
describeTrigger = (w) => workflowTriggerType(w).replaceAll("_", " "),
|
|
872
|
-
formatDate: formatDate2 = fmtDate,
|
|
873
|
-
onViewRuns,
|
|
874
|
-
connectedLabels,
|
|
875
|
-
...tableProps
|
|
876
|
-
}) {
|
|
877
|
-
const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels };
|
|
878
|
-
const { notify, confirm, openConversation } = useBlocksEnvironment();
|
|
879
|
-
const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole();
|
|
880
|
-
const { data: saved = [], isLoading } = useWorkflows({ live: true });
|
|
881
|
-
const { data: conversations, refetch } = useConnectedConversations({ live: true });
|
|
882
|
-
const { data: agents = [] } = useAgents();
|
|
883
|
-
const update = useUpdateWorkflow();
|
|
884
|
-
const remove = useDeleteWorkflow();
|
|
885
|
-
const run = useRunWorkflow();
|
|
886
|
-
const [busyId, setBusyId] = useState(null);
|
|
887
|
-
const workflows = useMemo(() => filter ? saved.filter(filter) : saved, [saved, filter]);
|
|
888
|
-
const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ""}`).join("|");
|
|
889
|
-
useEffect(() => {
|
|
890
|
-
void refetch?.();
|
|
891
|
-
}, [firingStamp, refetch]);
|
|
892
|
-
const lastRuns = useMemo(() => {
|
|
893
|
-
const out = {};
|
|
894
|
-
for (const c of conversations) {
|
|
895
|
-
const id = c.workflow_ext_id;
|
|
896
|
-
if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))
|
|
897
|
-
out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status };
|
|
898
|
-
}
|
|
899
|
-
return out;
|
|
900
|
-
}, [conversations]);
|
|
901
|
-
const agentNames = useMemo(
|
|
902
|
-
() => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),
|
|
903
|
-
[agents]
|
|
904
|
-
);
|
|
905
|
-
const taskNames = useMemo(
|
|
906
|
-
() => Object.fromEntries(
|
|
907
|
-
conversations.filter((c) => c.status != null).map((c) => [c.external_id, c.title || l.untitledTask])
|
|
908
|
-
),
|
|
909
|
-
[conversations, l.untitledTask]
|
|
910
|
-
);
|
|
911
|
-
const act = async (workflow, action) => {
|
|
912
|
-
setBusyId(workflow.external_id);
|
|
913
|
-
try {
|
|
914
|
-
await action();
|
|
915
|
-
} catch (error) {
|
|
916
|
-
notify(messageOf(error) || l.updateFailed, "error");
|
|
917
|
-
} finally {
|
|
918
|
-
setBusyId(null);
|
|
919
|
-
}
|
|
920
|
-
};
|
|
921
|
-
const setActive = (workflow, active) => act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }));
|
|
922
|
-
const deleteAll = async (items) => {
|
|
923
|
-
if (!items.length) return;
|
|
924
|
-
const ok = await confirm({
|
|
925
|
-
title: l.deleteTitle,
|
|
926
|
-
message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length)
|
|
927
|
-
});
|
|
928
|
-
if (!ok) return;
|
|
929
|
-
for (const workflow of items)
|
|
930
|
-
await act(workflow, () => remove.mutateAsync(workflow.external_id));
|
|
931
|
-
};
|
|
932
|
-
return /* @__PURE__ */ jsx(
|
|
933
|
-
WorkflowsTable,
|
|
934
|
-
{
|
|
935
|
-
...tableProps,
|
|
936
|
-
workflows,
|
|
937
|
-
isLoading,
|
|
938
|
-
busyId,
|
|
939
|
-
describeTrigger,
|
|
940
|
-
formatDate: formatDate2,
|
|
941
|
-
agentNames,
|
|
942
|
-
taskNames,
|
|
943
|
-
lastRuns,
|
|
944
|
-
canEditShared,
|
|
945
|
-
isWorkspaceOwner,
|
|
946
|
-
onOpenThread: (conversationId) => openConversation(conversationId),
|
|
947
|
-
onViewRuns,
|
|
948
|
-
onToggleActive: (workflow, active) => void setActive(workflow, active),
|
|
949
|
-
onToggleActiveMany: (items, active) => {
|
|
950
|
-
void (async () => {
|
|
951
|
-
for (const workflow of items) await setActive(workflow, active);
|
|
952
|
-
})();
|
|
953
|
-
},
|
|
954
|
-
onToggleShared: (workflow, shared) => void act(
|
|
955
|
-
workflow,
|
|
956
|
-
() => update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })
|
|
957
|
-
),
|
|
958
|
-
onDelete: (workflow) => void deleteAll([workflow]),
|
|
959
|
-
onDeleteMany: (items) => void deleteAll(items),
|
|
960
|
-
onRun: (workflow) => void act(workflow, async () => {
|
|
961
|
-
const result = await run.mutateAsync(workflow.external_id);
|
|
962
|
-
if (result.conversation_ext_id) openConversation(result.conversation_ext_id);
|
|
963
|
-
if (result.error) {
|
|
964
|
-
onViewRuns?.(workflow);
|
|
965
|
-
notify(l.runFailed, "error");
|
|
966
|
-
return;
|
|
967
|
-
}
|
|
968
|
-
if (result.execution_id && !result.conversation_ext_id) {
|
|
969
|
-
onViewRuns?.(workflow);
|
|
970
|
-
notify(l.documentAction(workflow), "success");
|
|
971
|
-
return;
|
|
972
|
-
}
|
|
973
|
-
if (!result.conversation_ext_id) throw new Error(l.noThread);
|
|
974
|
-
})
|
|
975
|
-
}
|
|
976
|
-
);
|
|
977
|
-
}
|
|
978
|
-
var IMAGE_FILE_TYPES = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "bmp", "tiff", "webp"]);
|
|
979
|
-
function toWorkflowFieldDocument(doc) {
|
|
980
|
-
const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? "").toLowerCase());
|
|
981
|
-
return {
|
|
982
|
-
id: doc.external_id,
|
|
983
|
-
title: doc.doc_metadata?.title || doc.file_name || doc.external_id,
|
|
984
|
-
fileName: doc.file_name,
|
|
985
|
-
pages: isImage ? null : doc.n_pages ?? null,
|
|
986
|
-
tokens: isImage ? null : doc.tokens ?? null,
|
|
987
|
-
status: doc.status,
|
|
988
|
-
isImage
|
|
989
|
-
};
|
|
990
|
-
}
|
|
991
|
-
function useConnectedWorkflowScopeSource() {
|
|
992
|
-
const { data: docs } = useConnectedDocuments();
|
|
993
|
-
const { data: tags } = useConnectedTags();
|
|
994
|
-
return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags]);
|
|
995
|
-
}
|
|
996
|
-
function useConnectedAgentOptions() {
|
|
997
|
-
const { data: agents } = useAgents();
|
|
998
|
-
return useMemo(
|
|
999
|
-
() => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),
|
|
1000
|
-
[agents]
|
|
1001
|
-
);
|
|
1002
|
-
}
|
|
1003
|
-
function ConnectedWorkflowDocumentsField({
|
|
1004
|
-
field,
|
|
1005
|
-
value,
|
|
1006
|
-
onChange,
|
|
1007
|
-
onAddFiles,
|
|
1008
|
-
labels
|
|
1009
|
-
}) {
|
|
1010
|
-
const arbi = useArbi();
|
|
1011
|
-
const { notify } = useBlocksEnvironment();
|
|
1012
|
-
const { ensureWorkspaceOpen } = useConnectedWorkspace();
|
|
1013
|
-
const { data: docs, loaded, refetch } = useConnectedDocuments();
|
|
1014
|
-
const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs]);
|
|
1015
|
-
const chosen = value.documents ?? [];
|
|
1016
|
-
const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 });
|
|
1017
|
-
const input = useRef(null);
|
|
1018
|
-
const [adding, setAdding] = useState(false);
|
|
1019
|
-
const upload = useCallback(
|
|
1020
|
-
async (files) => {
|
|
1021
|
-
setAdding(true);
|
|
1022
|
-
try {
|
|
1023
|
-
await ensureWorkspaceOpen();
|
|
1024
|
-
for (const file of files) await arbi.documents.uploadFile(file, file.name);
|
|
1025
|
-
} catch (error) {
|
|
1026
|
-
notify(error instanceof Error && error.message ? error.message : String(error), "error");
|
|
1027
|
-
} finally {
|
|
1028
|
-
setAdding(false);
|
|
1029
|
-
await refetch?.();
|
|
1030
|
-
}
|
|
1031
|
-
},
|
|
1032
|
-
[arbi, ensureWorkspaceOpen, notify, refetch]
|
|
1033
|
-
);
|
|
1034
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1035
|
-
!onAddFiles && /* @__PURE__ */ jsx(
|
|
1036
|
-
"input",
|
|
1037
|
-
{
|
|
1038
|
-
ref: input,
|
|
1039
|
-
type: "file",
|
|
1040
|
-
multiple: true,
|
|
1041
|
-
className: "hidden",
|
|
1042
|
-
"aria-label": "Add files",
|
|
1043
|
-
"data-testid": "workflow-add-files-input",
|
|
1044
|
-
onChange: (e) => {
|
|
1045
|
-
const files = Array.from(e.target.files ?? []);
|
|
1046
|
-
e.target.value = "";
|
|
1047
|
-
if (files.length) void upload(files);
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
),
|
|
1051
|
-
/* @__PURE__ */ jsx(
|
|
1052
|
-
WorkflowDocumentsField,
|
|
1053
|
-
{
|
|
1054
|
-
field,
|
|
1055
|
-
value,
|
|
1056
|
-
onChange,
|
|
1057
|
-
documents,
|
|
1058
|
-
loaded,
|
|
1059
|
-
thumbnailOf: (id) => thumbnails?.[id],
|
|
1060
|
-
onAddFiles: onAddFiles ?? ((files) => files?.length ? void upload(files) : input.current?.click()),
|
|
1061
|
-
adding,
|
|
1062
|
-
labels
|
|
1063
|
-
}
|
|
1064
|
-
)
|
|
1065
|
-
] });
|
|
1066
|
-
}
|
|
1067
|
-
function ConnectedWorkflowLauncher({
|
|
1068
|
-
onAddFiles,
|
|
1069
|
-
...props
|
|
1070
|
-
}) {
|
|
1071
|
-
const scopeSource = useConnectedWorkflowScopeSource();
|
|
1072
|
-
const agents = useConnectedAgentOptions();
|
|
1073
|
-
return /* @__PURE__ */ jsx(
|
|
1074
|
-
WorkflowLauncher,
|
|
1075
|
-
{
|
|
1076
|
-
...props,
|
|
1077
|
-
scopeSource,
|
|
1078
|
-
agents,
|
|
1079
|
-
renderDocuments: (field, value, onChange) => /* @__PURE__ */ jsx(
|
|
1080
|
-
ConnectedWorkflowDocumentsField,
|
|
1081
|
-
{
|
|
1082
|
-
field,
|
|
1083
|
-
value,
|
|
1084
|
-
onChange,
|
|
1085
|
-
onAddFiles
|
|
1086
|
-
}
|
|
1087
|
-
)
|
|
1088
|
-
}
|
|
1089
|
-
);
|
|
1090
|
-
}
|
|
1091
846
|
var DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS = {
|
|
1092
847
|
title: "Add a skill",
|
|
1093
848
|
description: "Bring in a skill someone sent you, from a file or a link.",
|
|
@@ -9138,6 +8893,6 @@ function ConnectedAgentChatPanel({
|
|
|
9138
8893
|
] });
|
|
9139
8894
|
}
|
|
9140
8895
|
|
|
9141
|
-
export { ArbiAppProvider, ConnectedAgentChatPanel, ConnectedAgentCreator, ConnectedCalendar, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailInviteCard, ConnectedMailMessage, ConnectedMailSetup, ConnectedMailbox, ConnectedNotificationCenter, ConnectedNotificationPreferences, ConnectedPasswordChangeDialog, ConnectedProfileCard, ConnectedPublicBooking, ConnectedRequireVerified, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSkillUpload, ConnectedSkillsLibrary, ConnectedTagTable, ConnectedTaskAccessRequest, ConnectedTaskActivityDialog, ConnectedThreadFollow, ConnectedUpcomingEvents,
|
|
8896
|
+
export { ArbiAppProvider, ConnectedAgentChatPanel, ConnectedAgentCreator, ConnectedCalendar, ConnectedDangerZone, ConnectedIdentityVerification, ConnectedLogoutDialog, ConnectedMailAccounts, ConnectedMailComposer, ConnectedMailInviteCard, ConnectedMailMessage, ConnectedMailSetup, ConnectedMailbox, ConnectedNotificationCenter, ConnectedNotificationPreferences, ConnectedPasswordChangeDialog, ConnectedProfileCard, ConnectedPublicBooking, ConnectedRequireVerified, ConnectedSecuritySection, ConnectedSessionsRow, ConnectedSkillUpload, ConnectedSkillsLibrary, ConnectedTagTable, ConnectedTaskAccessRequest, ConnectedTaskActivityDialog, ConnectedThreadFollow, ConnectedUpcomingEvents, ConnectedWorkflowHistory, ConnectedWorkflowRunner, ConnectedWorkspaceActivity, ConnectedWorkspaceNotificationMenu, DEFAULT_CONNECTED_SKILL_UPLOAD_LABELS, DEFAULT_CONNECTED_WORKFLOW_RUNNER_LABELS, NotificationCenter, NotificationEvent, StreamedArtifact, WorkflowRunThread, bookingCancelLink, buildNotificationCenterItems, countNotificationTypes, defaultUnmetPasswordRequirement, filterNotificationCenterItems, openMeetingLink, requestCalendarComposer, requestCalendarEvent, resolveMailbox, useCalendarViewStore, useConnectedDocxNotifications, useConnectedShellWorkspaces, useConnectedWorkNotifications, workflowRunView };
|
|
9142
8897
|
//# sourceMappingURL=index.js.map
|
|
9143
8898
|
//# sourceMappingURL=index.js.map
|